Lemma 38.11.2. Let $f : X \to S$ be a morphism of schemes. Let $U \subset S$ be open. Assume

1. $f$ is locally of finite type and flat,

2. $U \subset S$ is retrocompact and scheme theoretically dense,

3. $f|_{f^{-1}U} : f^{-1}U \to U$ is locally of finite presentation.

Then $f$ is of locally of finite presentation.

Proof. The question is local on $X$ and $S$, hence we may assume $X$ and $S$ affine. Choose a closed immersion $i : X \to \mathbf{A}^ n_ S$ and apply Lemma 38.11.1 to $i_*\mathcal{O}_ X$. Some details omitted. $\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).