[step:Prove the generic image lemma for irreducible locally closed sets][claim:Generic image lemma]
Let $Y \subset \mathbb{A}^{n+1}_K$ be an irreducible closed subset, and let $U \subset Y$ be a non-empty open subset in the [subspace topology](/page/Subspace%20Topology) on $Y$. Define
\begin{align*}
Z := \overline{\rho(Y)} \subset \mathbb{A}^n_K,
\end{align*}
where the closure is taken in the Zariski topology. Then $\rho(U)$ contains a non-empty open subset of $Z$.
[/claim]
[proof]
Let $A := K[x_1,\dots,x_n]$ and $B := K[x_1,\dots,x_n,t]$. Let $P \subset B$ be the prime ideal defining $Y$, and let
\begin{align*}
\mathfrak{p} := P \cap A.
\end{align*}
Then $Z = V(\mathfrak{p})$, because $\mathfrak{p}$ is precisely the ideal of all polynomial functions on $\mathbb{A}^n_K$ that vanish on $\rho(Y)$.
Since $U \subset Y$ is non-empty and open, there exists a polynomial $g \in B$ such that
\begin{align*}
\varnothing \neq Y \cap D(g) \subset U,
\end{align*}
where $D(g) := \{q \in \mathbb{A}^{n+1}_K : g(q) \neq 0\}$. Therefore it is enough to prove that $\rho(Y \cap D(g))$ contains a non-empty open subset of $Z$.
Let
\begin{align*}
A_0 := A/\mathfrak{p}, \qquad B_0 := B/P,
\end{align*}
and let $\bar{g} \in B_0$ denote the image of $g$. Since $Y \cap D(g) \neq \varnothing$, the element $\bar{g}$ is non-zero in the domain $B_0$. The inclusion $A \hookrightarrow B$ induces an injective map $A_0 \hookrightarrow B_0$, because $\mathfrak{p}=P\cap A$. Let $F := \operatorname{Frac}(A_0)$ be the fraction field of $A_0$. The localized algebra
\begin{align*}
C := (B_0)_{\bar{g}} \otimes_{A_0} F
\end{align*}
is non-zero: tensoring with $F$ localizes $B_0$ at the multiplicative set $A_0\setminus\{0\}$, and then inverting the non-zero element $\bar{g}$ cannot kill the domain $B_0$. It is finitely generated over $F$ because $(B_0)_{\bar{g}}$ is finitely generated over $A_0$.
Choose a maximal ideal $\mathfrak{m} \subset C$. By [Zariski's lemma](/page/Zariski%27s%20Lemma) applied to the finitely generated algebra $C$ over the field $F$, the residue field $L := C/\mathfrak{m}$ is a finite algebraic extension of $F$. Let
\begin{align*}
q: C \to L
\end{align*}
denote the quotient homomorphism. Choose an $F$-basis $\ell_1,\dots,\ell_s$ of $L$ with $\ell_1 = 1$. Since $q(C)$ generates $L$ as a field over $F$, and since $C$ is generated over $F$ by the image of the finitely generated $A_0$-algebra $(B_0)_{\bar{g}}$, each generator has coordinates in the basis $\ell_1,\dots,\ell_s$ with coefficients in $F$. The multiplication table also has finitely many coefficients $c_{ijk} \in F$ defined by
\begin{align*}
\ell_i\ell_j = \sum_{k=1}^s c_{ijk}\ell_k.
\end{align*}
Choose finitely many elements of $(B_0)_{\bar{g}}$ whose images generate $q((B_0)_{\bar{g}})$ as an $A_0$-algebra after tensoring with $F$. Each of their images has finitely many coordinates in the basis $\ell_1,\dots,\ell_s$, and the multiplication table has finitely many coefficients $c_{ijk}$. Choose a non-zero element $h_0 \in A_0$ clearing the denominators of all these coordinates and all the coefficients $c_{ijk}$. Then the $A_0[h_0^{-1}]$-submodule
\begin{align*}
M := A_0[h_0^{-1}]\ell_1 + \cdots + A_0[h_0^{-1}]\ell_s \subset L
\end{align*}
is closed under multiplication, because every product $\ell_i\ell_j$ has coefficients $c_{ijk}\in A_0[h_0^{-1}]$. Hence $M$ is a finite $A_0[h_0^{-1}]$-algebra. The same denominator choice puts the images under $q$ of the chosen algebra generators in $M$, so the quotient map $q$ restricts to a well-defined $A_0[h_0^{-1}]$-algebra homomorphism
\begin{align*}
(B_0)_{\bar{g}}[h_0^{-1}] \to M.
\end{align*}
Let $R$ be the image of this homomorphism. Because $A_0[h_0^{-1}]$ is Noetherian and $M$ is a finite $A_0[h_0^{-1}]$-module, the submodule $R \subset M$ is finite over $A_0[h_0^{-1}]$. Moreover $R \otimes_{A_0[h_0^{-1}]} F \cong L$, because localizing the restricted map recovers the surjective map $q: C \to L$.
We now apply [generic freeness](/page/Generic%20Freeness) to the finite $A_0[h_0^{-1}]$-module $R$. The ring $A_0[h_0^{-1}]$ is a finitely generated domain over the field $K$, hence Noetherian and reduced, so the hypotheses of generic freeness hold. Therefore there exists a non-zero element $h_1 \in A_0[h_0^{-1}]$ such that $R[h_1^{-1}]$ is a finite free module over $A_0[h_0^{-1}][h_1^{-1}]$. Since $R \otimes_{A_0[h_0^{-1}]} F \cong L \neq 0$, the localized module $R[h_1^{-1}]$ remains non-zero. Choose a representative $h_1' \in A_0$ for $h_1$ after clearing the denominator coming from powers of $h_0$, and define $h := h_0h_1' \in A_0$. Replacing $R$ by $R[h_1^{-1}]$, the original quotient map localizes to a quotient
\begin{align*}
(B_0)_{\bar{g}}[h^{-1}] \to R
\end{align*}
whose target is a non-zero finite free $A_0[h^{-1}]$-algebra.
Let
\begin{align*}
\Omega := D(h) \cap Z \subset Z.
\end{align*}
This is a non-empty open subset of $Z$ because $h \neq 0$ in the domain $A_0$. Let $a \in \Omega$. Evaluation at $a$ gives a $K$-algebra homomorphism
\begin{align*}
A_0[h^{-1}] \to K.
\end{align*}
Since $R$ is non-zero finite free over $A_0[h^{-1}]$, the fiber algebra
\begin{align*}
R_a := R \otimes_{A_0[h^{-1}]} K
\end{align*}
is a non-zero finite-dimensional $K$-algebra. Hence $R_a$ has a maximal ideal, and because $K$ is algebraically closed, the residue field at that maximal ideal is $K$. Therefore the quotient map $(B_0)_{\bar{g}}[h^{-1}] \to R$ produces a $K$-point of $Y \cap D(g)$ [lying over](/theorems/2876) $a$.
Thus every $a \in \Omega$ belongs to $\rho(Y \cap D(g))$. Hence
\begin{align*}
\Omega \subset \rho(Y \cap D(g)) \subset \rho(U),
\end{align*}
and $\Omega$ is a non-empty open subset of $Z$. This proves the claim.
[/proof][/step]