See , , [Nagata-1], [Nagata-2], [Nagata-3], and [Nagata-4]

Theorem 38.33.8. Let $S$ be a quasi-compact and quasi-separated scheme. Let $X \to S$ be a separated, finite type morphism. Then $X$ has a compactification over $S$.

Proof. We first reduce to the Noetherian case. We strongly urge the reader to skip this paragraph. There exists a closed immersion $X \to X'$ with $X' \to S$ of finite presentation and separated. See Limits, Proposition 32.9.6. If we find a compactification of $X'$ over $S$, then taking the scheme theoretic image of $X$ in this will give a compactification of $X$ over $S$. Thus we may assume $X \to S$ is separated and of finite presentation. We may write $S = \mathop{\mathrm{lim}}\nolimits S_ i$ as a directed limit of a system of Noetherian schemes with affine transition morphisms. See Limits, Proposition 32.5.4. We can choose an $i$ and a morphism $X_ i \to S_ i$ of finite presentation whose base change to $S$ is $X \to S$, see Limits, Lemma 32.10.1. After increasing $i$ we may assume $X_ i \to S_ i$ is separated, see Limits, Lemma 32.8.6. If we can find a compactification of $X_ i$ over $S_ i$, then the base change of this to $S$ will be a compactification of $X$ over $S$. This reduces us to the case discussed in the next paragraph.

Assume $S$ is Noetherian. We can choose a finite affine open covering $X = \bigcup _{i = 1, \ldots , n} U_ i$ such that $U_1 \cap \ldots \cap U_ n$ is dense in $X$. This follows from Properties, Lemma 28.29.4 and the fact that $X$ is quasi-compact with finitely many irreducible components. For each $i$ we can choose an $n_ i \geq 0$ and an immersion $U_ i \to \mathbf{A}^{n_ i}_ S$ by Morphisms, Lemma 29.39.2. Hence $U_ i$ has a compactification over $S$ for $i = 1, \ldots , n$ by taking the scheme theoretic image in $\mathbf{P}^{n_ i}_ S$. Applying Lemma 38.33.7 $(n - 1)$ times we conclude that the theorem is true. $\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).