Lemma 37.16.3. Let $S$ be a scheme. Let $f : X \to Y$ be a morphism of schemes over $S$. Assume
$S$, $X$, $Y$ are locally Noetherian,
$X$ is flat over $S$,
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$.