# Relative generic flatness.

It is known that any morphism is flat at an open set of points. I'd like to know if there is a relative version of this fact.

Let $f: X \rightarrow Y$ and $g:Y \rightarrow S$ be morphisms of varieties, and let $h=g \circ f$ be their composition. Suppose that $h$ and $g$ are flat. Is it true that the set $\{x\in X| f|_{h ^{-1}(h(x))} : h ^{-1}(h(x)) \to g ^{-1}(h(x)) \text{ is flat at } x \}$ is open?

-
With these assumptions, the set in question is the set of points in $X$ where $f$ is flat; hence it is open. This is "flatness by fibers", EGA IV (11.3.10) (applied with $\mathcal{F}=\mathcal{O}_X$).
I know that a map $f:X \to Y$ is flat in an open subset $U \subset X$. I just do not undestand why it implies what I need. Do you claim that $\\{x\in X| f|_{h ^{-1}(h(x))} : h ^{-1}(h(x)) \to g ^{-1}(h(x)) \text{ is flat at } x \\} =$ $= \\{ x \in X| f \text{ is flat at } x \\}$ ? Why? –  Rami Feb 9 '12 at 21:34
I think I got it. EGA IV (11.3.10) says that $\\{x\in X| f|_{h ^{-1}(h(x))} : h ^{-1}(h(x)) \to g ^{-1}(h(x)) \text{ is flat at } x \\} = \\{ x \in X| f \text{ is flat at } x \\}$. and EGA IV (11.3.1) says that the later is open. Please correct me if I'm wrong. Thank you very much. –  Rami Feb 10 '12 at 2:45