A doubt in the proof of Noether's normalization lemma.

My question comes out of Exercise 5.16 of the book by Atiyah-Macdonald.

Let $k$ be an infinite field and let $A \neq 0$ be a finitely generated $k$-algebra. Let $x_1, \dots , x_n$ generate $A$ as a $k$-algebra. We can renumber the $x_i$ so that $x_1, \dots , x_r$ are algebraically independent over $k$ and each of $x_{r+1}, \dots , x_n$ is algebraic over $k[x_1, \dots , x_r]$.

I don't understand the sentence "We can renumber the $x_i$ so that $x_1, \cdots , x_r$ are algebraically independent over $k$ and each of $x_{r+1}, \cdots , x_n$ is algebraic over $k[x_1, \cdots , x_r]$"

[My try]

There is a maximal algebraically independent subset of generators and I renumber these elements by $x_1, \cdots , x_r$. But I can't show that each of the remainder ,say $x_{r+1}, \cdots , x_n$, is algebraic over $k[x_1, \cdots , x_r]$.

How can I suitably renumber the generators.

EDIT

There was a typo. $x_{r+1}, \cdots x_r$ is algebraic over $k[x_1, \cdots, x_r]$ not $k[x_1, \cdots , x_n]$.

$x_{r+1}, \cdots , x_{n}$ is trivially algebraic over $k[x_1, \cdots, x_n]$. But I don't know why it is algebraic over $k[x_1, \cdots, x_r]$.

• Well, if they weren't algebraic, then they would be transcendental... – Qiaochu Yuan Mar 14 '17 at 8:33
• @QiaochuYuan Sorry. I had a mistake in my question. So I edited it. – Jeong Mar 15 '17 at 0:00

(Just an elaboration of Qiaochu Yuan's comment.) Suppose $x_{r+1}$ is not algebraic over $k[x_1,\ldots,x_r]$. Then it is not the root of any polynomial with coefficients in $k[x_1,\ldots,x_r]$. Since $x_1,\ldots,x_r$ are algebraically independent, this implies that $x_1,\ldots,x_r,x_{r+1}$ are algebraically independent, contrary to the maximality of $r$.
• @user26857 $x_{r+1}$ is algebraic over $k[x_1, \cdots,x_{r},x_{r+2}, \cdots x_n]$ not yet over $k[x_1, \cdots,x_{r}]$. Why $x_{r+1}$ has a nontrivial polynomianl independent of $x_{r+2}, \cdots, x_n$? – Jeong Mar 16 '17 at 5:03
• The renumbering can be performed to avoid this problem. Suppose, inductively, that $x_{i_1},\ldots,x_{i_s}$ are algebraically independent. Take $x_j$ with $j\not\in \{i_1,\ldots, i_s\}$. Either $x_j$ is algebraic over $k[x_{i_1},\ldots,x_{i_s}]$, in which case ignore $x_j$ from now on, or $x_{i_1},\ldots,x_{i_s},x_j$ are algebraically independent. (As in my answer.) We end with $x_{i_1},\ldots,x_{i_r}$ algebraically independent and the remaining $x_j$ all algebraic over $k[x_{i_1},\ldots,x_{i_r}]$. (Some may be algebraic over a subfield.) Hope this helps. – Mark Wildon Mar 16 '17 at 20:54