[proofplan]
We prove the theorem for $k$ infinite by induction on the minimal number of generators $m$ of $A$ as a $k$-algebra. If the generators are algebraically independent, we are done. Otherwise, we exploit an algebraic relation among the generators: by performing a linear change of variables chosen so that the leading homogeneous part does not vanish, we express the last generator as integral over a subalgebra generated by $m - 1$ elements. The inductive hypothesis then provides a polynomial subalgebra over which this smaller algebra is finite, and transitivity of finiteness completes the argument.
[/proofplan]
[step:Establish the base case $m = 0$]
We induct on the minimal number $m$ of generators of $A$ as a $k$-algebra. If $m = 0$, then $A = k$, so we set $n = 0$ and $A' = k$. The extension $k \subset k$ is trivially finite (with $\{1\}$ as a generating set over $k$).
[/step]
[step:Set up the inductive step: extract an algebraic relation among the generators]
Suppose the theorem holds for all $k$-algebras generated by fewer than $m$ elements, and let $A = k[y_1, \ldots, y_m]$. If $y_1, \ldots, y_m$ are algebraically independent over $k$, set $n = m$ and $x_i = y_i$; then $A = k[x_1, \ldots, x_n]$ is free (hence finite) over itself and we are done.
Otherwise, there exists a nonzero polynomial $f \in k[T_1, \ldots, T_m]$ with $f(y_1, \ldots, y_m) = 0$. Let $r = \deg f$ and let $F \in k[T_1, \ldots, T_m]$ denote the homogeneous component of $f$ of degree $r$ (the leading form of $f$). Since $f \neq 0$, we have $F \neq 0$.
[/step]
[step:Perform a linear substitution to make the relation monic in $y_m$]
For constants $c_1, \ldots, c_{m-1} \in k$ (to be chosen), define the polynomial
\begin{align*}
g(T_1, \ldots, T_m) = f(T_1 + c_1 T_m, \, T_2 + c_2 T_m, \, \ldots, \, T_{m-1} + c_{m-1} T_m, \, T_m).
\end{align*}
We analyse the coefficient of $T_m^r$ in $g$ when $g$ is viewed as a polynomial in $T_m$ with coefficients in $k[T_1, \ldots, T_{m-1}]$. Setting $T_1 = \cdots = T_{m-1} = 0$ isolates the pure $T_m^r$ term:
\begin{align*}
g(0, \ldots, 0, T_m) = f(c_1 T_m, c_2 T_m, \ldots, c_{m-1} T_m, T_m) = T_m^r \, F(c_1, c_2, \ldots, c_{m-1}, 1) + \text{lower order terms in } T_m.
\end{align*}
Therefore the coefficient of $T_m^r$ in $g$ (viewed as a polynomial in $T_m$) is exactly $F(c_1, \ldots, c_{m-1}, 1) \in k$.
[guided]
Why does the substitution $T_i \mapsto T_i + c_i T_m$ isolate the leading coefficient as $F(c_1, \ldots, c_{m-1}, 1)$? Write $f = F + (\text{terms of degree} < r)$. Under the substitution $T_i \mapsto c_i T_m$ for $1 \leq i \leq m-1$ and $T_m \mapsto T_m$, the degree-$r$ homogeneous part $F$ contributes $F(c_1 T_m, \ldots, c_{m-1} T_m, T_m) = T_m^r F(c_1, \ldots, c_{m-1}, 1)$ by homogeneity of degree $r$. Every other monomial in $f$ has total degree strictly less than $r$, so under this specialisation it contributes a term of degree strictly less than $r$ in $T_m$. Hence the coefficient of $T_m^r$ is $F(c_1, \ldots, c_{m-1}, 1)$.
Note that if we keep $T_1, \ldots, T_{m-1}$ as variables (not specialised to $0$), additional contributions to the $T_m^r$ coefficient could come from mixed terms. But the key observation is that $F(c_1, \ldots, c_{m-1}, 1)$ is the coefficient of the pure power $T_m^r$ when all other $T_i$ are set to zero, and this equals the leading coefficient of $g$ viewed as a polynomial in $T_m$ alone. To be precise: the coefficient of $T_m^r$ in $g \in k[T_1, \ldots, T_{m-1}][T_m]$ is a polynomial in $T_1, \ldots, T_{m-1}$, and its constant term is $F(c_1, \ldots, c_{m-1}, 1)$. In fact, since the only degree-$r$ monomial in $g$ that is a pure power of $T_m$ comes from $F$, the leading coefficient of $g$ as a polynomial in $T_m$ (with coefficients in $k[T_1, \ldots, T_{m-1}]$) has constant term $F(c_1, \ldots, c_{m-1}, 1)$. After the substitution $T_i \mapsto y_i - c_i y_m$, this will make $y_m$ integral over the subalgebra generated by $y_1 - c_1 y_m, \ldots, y_{m-1} - c_{m-1} y_m$.
[/guided]
[/step]
[step:Choose $c_1, \ldots, c_{m-1}$ so that $F(c_1, \ldots, c_{m-1}, 1) \neq 0$]
The polynomial $F(T_1, \ldots, T_{m-1}, 1) \in k[T_1, \ldots, T_{m-1}]$ is nonzero: since $F$ is a nonzero homogeneous polynomial of degree $r$, the dehomogenisation $F(T_1, \ldots, T_{m-1}, 1)$ is a nonzero polynomial of degree at most $r$ in $m-1$ variables.
Since $k$ is infinite, a nonzero polynomial in finitely many variables over $k$ cannot vanish on all of $k^{m-1}$. (This follows by induction on the number of variables: a nonzero polynomial of degree $d$ in one variable over a field has at most $d$ roots, and for $k$ infinite, $|k| > d$.) Therefore there exist $c_1, \ldots, c_{m-1} \in k$ with $F(c_1, \ldots, c_{m-1}, 1) \neq 0$.
Fix such a choice. Let $\lambda = F(c_1, \ldots, c_{m-1}, 1) \in k^\times$.
[/step]
[step:Conclude that $y_m$ is integral over $B = k[y_1 - c_1 y_m, \ldots, y_{m-1} - c_{m-1} y_m]$]
Define $z_i = y_i - c_i y_m$ for $1 \leq i \leq m-1$, and set $B = k[z_1, \ldots, z_{m-1}]$. The relation $f(y_1, \ldots, y_m) = 0$ can be rewritten using $y_i = z_i + c_i y_m$:
\begin{align*}
0 = f(z_1 + c_1 y_m, \ldots, z_{m-1} + c_{m-1} y_m, y_m) = g(z_1, \ldots, z_{m-1}, y_m).
\end{align*}
As established above, $g$ has degree $r$ in $y_m$ with leading coefficient $\lambda \in k^\times$ (plus terms involving $z_1, \ldots, z_{m-1}$). Dividing through by $\lambda$, we obtain a monic polynomial of degree $r$ in $y_m$ with coefficients in $B$:
\begin{align*}
y_m^r + \frac{1}{\lambda}\bigl(\text{terms of degree} < r \text{ in } y_m \text{ with coefficients in } B\bigr) = 0.
\end{align*}
Therefore $y_m$ is integral over $B$. Since $A = k[y_1, \ldots, y_m] = k[z_1, \ldots, z_{m-1}, y_m] = B[y_m]$, and $y_m$ is integral over $B$, the extension $B \subset A$ is finite: $A$ is generated as a $B$-module by $\{1, y_m, y_m^2, \ldots, y_m^{r-1}\}$.
[guided]
Let us verify that $A = B[y_m]$. Since $z_i = y_i - c_i y_m$, we have $y_i = z_i + c_i y_m \in B[y_m]$ for each $1 \leq i \leq m-1$. Also $y_m \in B[y_m]$. So $k[y_1, \ldots, y_m] \subseteq B[y_m]$. Conversely, each $z_i = y_i - c_i y_m \in k[y_1, \ldots, y_m]$, so $B = k[z_1, \ldots, z_{m-1}] \subseteq A$ and $B[y_m] \subseteq A$. Therefore $A = B[y_m]$.
The finiteness of $B \subset A$ follows from the monic relation: since $y_m^r \in B + By_m + \cdots + By_m^{r-1}$, every power $y_m^k$ with $k \geq r$ can be reduced modulo the monic relation to a $B$-linear combination of $1, y_m, \ldots, y_m^{r-1}$. Hence $A = B[y_m] = B + By_m + \cdots + By_m^{r-1}$, which is finitely generated as a $B$-module.
[/guided]
[/step]
[step:Apply the inductive hypothesis to $B$ and use transitivity of finiteness]
The $k$-algebra $B = k[z_1, \ldots, z_{m-1}]$ is generated by $m - 1$ elements as a $k$-algebra. By the inductive hypothesis, there exist $k$-algebraically independent elements $x_1, \ldots, x_n \in B$ such that $B$ is finite over $A' = k[x_1, \ldots, x_n]$.
We now have a chain of finite extensions:
\begin{align*}
A' = k[x_1, \ldots, x_n] \subset B \subset A.
\end{align*}
Since $B$ is finite over $A'$ and $A$ is finite over $B$, the [Transitivity of Finiteness and Integrality](/theorems/2866) gives that $A$ is finite over $A'$. The elements $x_1, \ldots, x_n$ are algebraically independent over $k$ (by the inductive hypothesis), so this completes the proof.
[guided]
Transitivity of finiteness is the following standard fact: if $R \subset S$ and $S \subset T$ are ring extensions with $S$ finitely generated as an $R$-module and $T$ finitely generated as an $S$-module, then $T$ is finitely generated as an $R$-module. Concretely, if $S = \sum_{i=1}^p R s_i$ and $T = \sum_{j=1}^q S t_j$, then $T = \sum_{i,j} R (s_i t_j)$, which is a finite generating set over $R$.
In our case: $B$ is finitely generated over $A'$ (by the inductive hypothesis), and $A$ is finitely generated over $B$ (by $\{1, y_m, \ldots, y_m^{r-1}\}$). So $A$ is finitely generated over $A' = k[x_1, \ldots, x_n]$, as required.
[/guided]
[/step]