Lemma 37.16.3. Let $S$ be a scheme. Let $f : X \to Y$ be a morphism of schemes over $S$. Assume

1. $S$, $X$, $Y$ are locally Noetherian,

2. $X$ is flat over $S$,

3. for every $s \in S$ the morphism $f_ s : X_ s \to Y_ s$ is flat.

Then $f$ is flat. If $f$ is also surjective, then $Y$ is flat over $S$.

Proof. This is a special case of Theorem 37.16.1. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).