Lemma 37.40.2. Let $f : Y \to X$ be a quasi-finite morphism. There exists a dense open $U \subset X$ such that $f|_{f^{-1}(U)} : f^{-1}(U) \to U$ is finite.

Proof. If $U_ i \subset X$, $i \in I$ is a collection of opens such that the restrictions $f|_{f^{-1}(U_ i)} : f^{-1}(U_ i) \to U_ i$ are finite, then with $U = \bigcup U_ i$ the restriction $f|_{f^{-1}(U)} : f^{-1}(U) \to U$ is finite, see Morphisms, Lemma 29.42.3. Thus the problem is local on $X$ and we may assume that $X$ is affine.

Assume $X$ is affine. Write $Y = \bigcup _{j = 1, \ldots , m} V_ j$ with $V_ j$ affine. This is possible since $f$ is quasi-finite and hence in particular quasi-compact. Each $V_ j \to X$ is quasi-finite and separated. Let $\eta \in X$ be a generic point of an irreducible component of $X$. We see from Morphisms, Lemmas 29.19.10 and 29.49.1 that there exists an open neighbourhood $\eta \in U_\eta$ such that $f^{-1}(U_\eta ) \cap V_ j \to U_\eta$ is finite. We may choose $U_\eta$ such that it works for each $j = 1, \ldots , m$. Note that the collection of generic points of $X$ is dense in $X$. Thus we see there exists a dense open $W = \bigcup _\eta U_\eta$ such that each $f^{-1}(W) \cap V_ j \to W$ is finite. It suffices to show that there exists a dense open $U \subset W$ such that $f|_{f^{-1}(U)} : f^{-1}(U) \to U$ is finite. Thus we may replace $X$ by an affine open subscheme of $W$ and assume that each $V_ j \to X$ is finite.

Assume $X$ is affine, $Y = \bigcup _{j = 1, \ldots , m} V_ j$ with $V_ j$ affine, and the restrictions $f|_{V_ j} : V_ j \to X$ are finite. Set

$\Delta _{ij} = \Big(\overline{V_ i \cap V_ j} \setminus V_ i \cap V_ j\Big) \cap V_ j.$

This is a nowhere dense closed subset of $V_ j$ because it is the boundary of the open subset $V_ i \cap V_ j$ in $V_ j$. By Morphisms, Lemma 29.46.7 the image $f(\Delta _{ij})$ is a nowhere dense closed subset of $X$. By Topology, Lemma 5.21.2 the union $T = \bigcup f(\Delta _{ij})$ is a nowhere dense closed subset of $X$. Thus $U = X \setminus T$ is a dense open subset of $X$. We claim that $f|_{f^{-1}(U)} : f^{-1}(U) \to U$ is finite. To see this let $U' \subset U$ be an affine open. Set $Y' = f^{-1}(U') = U' \times _ X Y$, $V_ j' = Y' \cap V_ j = U' \times _ X V_ j$. Consider the restriction

$f' = f|_{Y'} : Y' \longrightarrow U'$

of $f$. This morphism now has the property that $Y' = \bigcup _{j = 1, \ldots , m} V'_ j$ is an affine open covering, each $V'_ j \to U'$ is finite, and $V_ i' \cap V_ j'$ is (open and) closed both in $V'_ i$ and $V'_ j$. Hence $V_ i' \cap V_ j'$ is affine, and the map

$\mathcal{O}(V'_ i) \otimes _{\mathbf{Z}} \mathcal{O}(V'_ j) \longrightarrow \mathcal{O}(V'_ i \cap V'_ j)$

is surjective. This implies that $Y'$ is separated, see Schemes, Lemma 26.21.7. Finally, consider the commutative diagram

$\xymatrix{ \coprod _{j = 1, \ldots , m} V'_ j \ar[rd] \ar[rr] & & Y' \ar[ld] \\ & U' & }$

The south-east arrow is finite, hence proper, the horizontal arrow is surjective, and the south-west arrow is separated. Hence by Morphisms, Lemma 29.39.8 we conclude that $Y' \to U'$ is proper. Since it is also quasi-finite, we see that it is finite by Lemma 37.39.1, and we win. $\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).