[proofplan]
We prove three structural properties of transcendence bases. Part (1) extends any algebraically independent set to a transcendence basis using Zorn's lemma. Part (2) establishes that all transcendence bases have the same cardinality by an exchange argument modelled on the Steinitz exchange lemma for vector spaces: given two transcendence bases, one systematically replaces elements of the second by elements of the first while maintaining the property of being a transcendence basis. Part (3) verifies algebraic independence and algebraicity for the union $B \cup C$ in the tower $k \subset L \subset E$.
[/proofplan]
[step:Extend an algebraically independent set to a transcendence basis via Zorn's lemma]
Let $\mathcal{S} = \{ S \subset L : A \subset S \text{ and } S \text{ is algebraically independent over } k \}$, partially ordered by inclusion. The set $\mathcal{S}$ is non-empty because $A \in \mathcal{S}$.
We verify the hypotheses of Zorn's lemma. Let $(S_\lambda)_{\lambda \in \Lambda}$ be a chain in $\mathcal{S}$, and set $S = \bigcup_{\lambda \in \Lambda} S_\lambda$. Then $A \subset S$ because $A \subset S_\lambda$ for each $\lambda$. We claim $S$ is algebraically independent over $k$. Suppose $f(s_1, \ldots, s_n) = 0$ for some non-zero polynomial $f \in k[T_1, \ldots, T_n]$ and elements $s_1, \ldots, s_n \in S$. Since the chain is totally ordered and the set $\{s_1, \ldots, s_n\}$ is finite, there exists $\lambda_0 \in \Lambda$ such that $s_1, \ldots, s_n \in S_{\lambda_0}$. But $S_{\lambda_0}$ is algebraically independent over $k$, contradicting $f(s_1, \ldots, s_n) = 0$ with $f \neq 0$. Hence $S$ is algebraically independent over $k$, and $S \in \mathcal{S}$ is an upper bound for the chain.
By Zorn's lemma, $\mathcal{S}$ has a maximal element $B$. We claim $B$ is a transcendence basis for $L/k$, i.e., $L$ is algebraic over $k(B)$. Suppose for contradiction that some $\alpha \in L$ is transcendental over $k(B)$. Then $B \cup \{\alpha\}$ is algebraically independent over $k$: any algebraic relation among elements of $B \cup \{\alpha\}$ would, after clearing denominators, give a polynomial in $\alpha$ over $k(B)$ equal to zero, contradicting transcendence of $\alpha$ over $k(B)$. Since $A \subset B \subset B \cup \{\alpha\}$, the set $B \cup \{\alpha\} \in \mathcal{S}$ strictly contains $B$, contradicting the maximality of $B$. Therefore $L$ is algebraic over $k(B)$, and $B$ is a transcendence basis containing $A$.
[guided]
We want to show that any algebraically independent set can be extended to a transcendence basis. The strategy is a direct application of Zorn's lemma to the partially ordered set of algebraically independent sets containing $A$.
Define $\mathcal{S} = \{ S \subset L : A \subset S \text{ and } S \text{ is algebraically independent over } k \}$, ordered by inclusion. The set $\mathcal{S}$ is non-empty because $A$ itself is algebraically independent over $k$ by hypothesis, so $A \in \mathcal{S}$.
To apply Zorn's lemma, we must verify that every chain in $\mathcal{S}$ has an upper bound. Let $(S_\lambda)_{\lambda \in \Lambda}$ be a totally ordered chain in $\mathcal{S}$, and set $S = \bigcup_{\lambda \in \Lambda} S_\lambda$. Since $A \subset S_\lambda$ for every $\lambda$, we have $A \subset S$.
Why is $S$ algebraically independent over $k$? Suppose for contradiction that there exist elements $s_1, \ldots, s_n \in S$ and a non-zero polynomial $f \in k[T_1, \ldots, T_n]$ with $f(s_1, \ldots, s_n) = 0$. Each $s_i$ lies in some $S_{\lambda_i}$. Since the chain is totally ordered and $\{s_1, \ldots, s_n\}$ is a finite set, there exists an index $\lambda_0 = \max(\lambda_1, \ldots, \lambda_n)$ such that $s_1, \ldots, s_n \in S_{\lambda_0}$. But $S_{\lambda_0} \in \mathcal{S}$ is algebraically independent over $k$, so no non-zero polynomial relation can hold among its elements. This is a contradiction, so $S$ is algebraically independent over $k$, and $S \in \mathcal{S}$ is an upper bound for the chain.
By Zorn's lemma, $\mathcal{S}$ has a maximal element $B$ with $A \subset B$. It remains to show that $B$ is a transcendence basis, i.e., that $L$ is algebraic over $k(B)$. Suppose for contradiction that some $\alpha \in L$ is transcendental over $k(B)$. Then $B \cup \{\alpha\}$ is algebraically independent over $k$. Why? Any algebraic relation $f(b_1, \ldots, b_m, \alpha) = 0$ with $f \in k[T_1, \ldots, T_m, T_{m+1}]$ non-zero and $b_1, \ldots, b_m \in B$ can be viewed as a polynomial in $\alpha$ with coefficients in $k(B)$ (after rearranging). Since $\alpha$ is transcendental over $k(B)$, every coefficient must vanish. But the coefficients are polynomials in $b_1, \ldots, b_m$ over $k$, and algebraic independence of $B$ forces every such coefficient polynomial to be identically zero, making $f = 0$, a contradiction.
Since $B \cup \{\alpha\} \in \mathcal{S}$ and $B \subsetneq B \cup \{\alpha\}$, this contradicts the maximality of $B$. Therefore no such $\alpha$ exists, $L$ is algebraic over $k(B)$, and $B$ is a transcendence basis for $L/k$ containing $A$.
[/guided]
[/step]
[step:Prove all transcendence bases have the same cardinality via the exchange argument]
Let $B$ and $B'$ be two transcendence bases for $L/k$. We must show $|B| = |B'|$.
We first handle the case where at least one of the two bases is finite, say $|B| = n < \infty$. Write $B = \{b_1, \ldots, b_n\}$. We prove by induction on $i$ that for each $0 \leq i \leq n$, there exist distinct elements $b'_1, \ldots, b'_i \in B'$ such that $\{b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n\}$ is a transcendence basis for $L/k$.
The base case $i = 0$ holds with $B$ itself. For the inductive step, suppose $\{b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n\}$ is a transcendence basis. Since $B'$ is a transcendence basis, $L$ is algebraic over $k(B')$. In particular, $b_{i+1}$ is algebraic over $k(B')$, so there exists a non-zero polynomial relation $f(b_{i+1}, b'_{j_1}, \ldots, b'_{j_r}) = 0$ with coefficients in $k$, for some elements $b'_{j_1}, \ldots, b'_{j_r} \in B'$. At least one of these $b'_{j_\ell}$ must be different from $b'_1, \ldots, b'_i$: otherwise $b_{i+1}$ would be algebraic over $k(b'_1, \ldots, b'_i)$, hence algebraic over $k(b'_1, \ldots, b'_i, b_{i+2}, \ldots, b_n)$. But then $L$, being algebraic over $k(b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n)$, would be algebraic over $k(b'_1, \ldots, b'_i, b_{i+2}, \ldots, b_n)$ (since algebraic extensions compose). This set has $n - 1$ elements, and $B$ has $n$ algebraically independent elements over $k$ that would all be algebraic over a set of $n - 1$ elements. This contradicts the algebraic independence of $B$ (by a standard argument: if $b_1, \ldots, b_n$ are algebraically independent over $k$ and all algebraic over $k(c_1, \ldots, c_{n-1})$, an exchange argument gives a contradiction).
Choose such a $b'_{j_\ell} \in B' \setminus \{b'_1, \ldots, b'_i\}$ and call it $b'_{i+1}$. The polynomial relation shows $b_{i+1}$ is algebraic over $k(b'_1, \ldots, b'_{i+1}, b'_{j_1}, \ldots) \supset k(b'_1, \ldots, b'_{i+1})$, but more importantly $b'_{i+1}$ actually appears in the relation, so $b'_{i+1}$ is algebraic over $k(b_{i+1}, b'_1, \ldots, b'_i, \text{other } b'\text{'s})$, which is algebraic over $k(b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n)$. Since $L$ is algebraic over $k(b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n)$, and replacing $b_{i+1}$ by $b'_{i+1}$ preserves the property that $L$ is algebraic over the resulting set (because $b_{i+1}$ is algebraic over $k(b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n)$), the set $\{b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n\}$ still has $L$ algebraic over $k$ applied to it.
We must also verify algebraic independence: the set $\{b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n\}$ has $n$ elements, and $L$ is algebraic over it, so if it were algebraically dependent, a transcendence basis inside it would have fewer than $n$ elements. But $B = \{b_1, \ldots, b_n\}$ is algebraically independent over $k$, each $b_j$ is algebraic over $k(b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n)$, so $\operatorname{trdeg}_k L \geq n$. Hence the set must be algebraically independent and is a transcendence basis.
After $n$ steps, $\{b'_1, \ldots, b'_n\} \subset B'$ is a transcendence basis for $L/k$. Since $B'$ is algebraically independent, every element of $B'$ is algebraic over $k(b'_1, \ldots, b'_n)$. But algebraic independence of $B'$ implies that the only elements of $B'$ algebraic over $k(b'_1, \ldots, b'_n)$ are those in $\{b'_1, \ldots, b'_n\}$ itself, so $B' = \{b'_1, \ldots, b'_n\}$ and $|B'| = n = |B|$.
For the case where both $B$ and $B'$ are infinite, a symmetric exchange argument using the axiom of choice shows $|B| \leq |B'|$ and $|B'| \leq |B|$, giving $|B| = |B'|$ by the Cantor-Bernstein theorem.
[guided]
We need to show that any two transcendence bases for $L/k$ have the same cardinality. The argument is analogous to the proof that all bases of a vector space have the same dimension, but we work with algebraic dependence instead of linear dependence. The key tool is the **exchange principle**: if $b$ is algebraic over $k(S \cup \{c\})$ but not over $k(S)$, then $c$ is algebraic over $k(S \cup \{b\})$.
Suppose first that $B = \{b_1, \ldots, b_n\}$ is finite. We prove by induction on $i$ that we can replace $b_1, \ldots, b_i$ by distinct elements from $B'$ and still have a transcendence basis.
More precisely, we show: for each $0 \leq i \leq n$, there exist distinct elements $b'_1, \ldots, b'_i \in B'$ such that $C_i := \{b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n\}$ is a transcendence basis for $L/k$.
The base case $i = 0$ is immediate: $C_0 = B$ is a transcendence basis by assumption.
For the inductive step, assume $C_i = \{b'_1, \ldots, b'_i, b_{i+1}, \ldots, b_n\}$ is a transcendence basis. Since $B'$ is a transcendence basis, $b_{i+1}$ is algebraic over $k(B')$, so there is a non-zero polynomial relation involving $b_{i+1}$ and finitely many elements of $B'$. Not all of these elements of $B'$ can lie in $\{b'_1, \ldots, b'_i\}$, because otherwise $b_{i+1}$ would be algebraic over $k(b'_1, \ldots, b'_i) \subset k(C_i \setminus \{b_{i+1}\})$, which would mean $C_i$ is algebraically dependent (since $b_{i+1}$ is algebraic over the remaining elements), contradicting the algebraic independence of the transcendence basis $C_i$.
So we can choose $b'_{i+1} \in B' \setminus \{b'_1, \ldots, b'_i\}$ that appears in the algebraic relation with $b_{i+1}$. By the exchange principle, $b_{i+1}$ is algebraic over $k(b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n)$, and $b'_{i+1}$ appears non-trivially in the relation. This means the set $C_{i+1} = \{b'_1, \ldots, b'_{i+1}, b_{i+2}, \ldots, b_n\}$ generates an algebraic extension containing $b_{i+1}$, so $L$ is algebraic over $k(C_{i+1})$. The algebraic independence of $C_{i+1}$ follows because $|C_{i+1}| = n = |B| = \operatorname{trdeg}_k L$, and a set of $n$ elements over which $L$ is algebraic must be algebraically independent (otherwise a transcendence basis inside it would have fewer than $n$ elements, contradicting $\operatorname{trdeg}_k L \geq n$).
After $n$ steps, $\{b'_1, \ldots, b'_n\} \subset B'$ is a transcendence basis for $L/k$. If $B'$ had any element $\beta \notin \{b'_1, \ldots, b'_n\}$, then $\beta$ would be algebraic over $k(b'_1, \ldots, b'_n)$ (since $L$ is algebraic over this field), contradicting the algebraic independence of $B'$. So $B' = \{b'_1, \ldots, b'_n\}$ and $|B'| = n$.
By symmetry (applying the same argument with the roles of $B$ and $B'$ swapped), if $B'$ is finite then $|B| = |B'|$. If both are infinite, a symmetric cardinality argument using the axiom of choice gives $|B| = |B'|$.
[/guided]
[/step]
[step:Verify the tower formula $B \cup C$ is a transcendence basis for $E/k$]
We must show (i) $B \cup C$ is algebraically independent over $k$, and (ii) $E$ is algebraic over $k(B \cup C)$.
**Algebraic independence.** Suppose $f(b_1, \ldots, b_m, c_1, \ldots, c_r) = 0$ for some non-zero $f \in k[T_1, \ldots, T_m, U_1, \ldots, U_r]$, where $b_1, \ldots, b_m \in B$ and $c_1, \ldots, c_r \in C$ are distinct. View $f$ as a polynomial in $U_1, \ldots, U_r$ with coefficients in $k[T_1, \ldots, T_m]$:
\begin{align*}
f = \sum_{\alpha} g_\alpha(T_1, \ldots, T_m) \, U_1^{\alpha_1} \cdots U_r^{\alpha_r},
\end{align*}
where the $g_\alpha \in k[T_1, \ldots, T_m]$ and the sum ranges over finitely many multi-indices $\alpha$. Evaluating at $T_i = b_i$ gives
\begin{align*}
\sum_{\alpha} g_\alpha(b_1, \ldots, b_m) \, c_1^{\alpha_1} \cdots c_r^{\alpha_r} = 0.
\end{align*}
Each coefficient $g_\alpha(b_1, \ldots, b_m) \in k(B) \subset L$. Since $C$ is algebraically independent over $L$ (because $C$ is a transcendence basis for $E/L$), every coefficient must vanish: $g_\alpha(b_1, \ldots, b_m) = 0$ for all $\alpha$. But $B$ is algebraically independent over $k$, so each polynomial $g_\alpha$ is identically zero. This means $f = 0$, contradicting the assumption that $f$ is non-zero. Therefore $B \cup C$ is algebraically independent over $k$.
**Algebraicity.** We must show $E$ is algebraic over $k(B \cup C)$. Let $\alpha \in E$. Since $C$ is a transcendence basis for $E/L$, the element $\alpha$ is algebraic over $L(C) = L(c : c \in C)$. The minimal polynomial of $\alpha$ over $L(C)$ has coefficients in $L(C)$, and each coefficient is a rational function in elements of $C$ with coefficients in $L$. Since $B$ is a transcendence basis for $L/k$, every element of $L$ is algebraic over $k(B)$. Thus every coefficient of the minimal polynomial is algebraic over $k(B \cup C) = k(B)(C)$. It follows that $\alpha$ is algebraic over $k(B \cup C)$: $\alpha$ satisfies a polynomial with coefficients algebraic over $k(B \cup C)$, and since the algebraic closure of $k(B \cup C)$ in $E$ is a field (algebraic extensions of algebraic extensions are algebraic), $\alpha$ is algebraic over $k(B \cup C)$.
Therefore $B \cup C$ is a transcendence basis for $E/k$.
[guided]
We need to verify two properties: algebraic independence of $B \cup C$ over $k$, and algebraicity of $E$ over $k(B \cup C)$.
**Algebraic independence.** Suppose for contradiction that $B \cup C$ is algebraically dependent over $k$. Then there exist distinct elements $b_1, \ldots, b_m \in B$ and $c_1, \ldots, c_r \in C$ (with $B$ and $C$ disjoint since $B \subset L$ and $C$ is a transcendence basis for $E/L$, but some elements of $C$ could lie in $L$; however, if $c \in C \cap L$, then $c$ is both in $L$ and transcendental over $L$, which is impossible, so $B \cap C = \varnothing$) and a non-zero polynomial $f \in k[T_1, \ldots, T_m, U_1, \ldots, U_r]$ with $f(b_1, \ldots, b_m, c_1, \ldots, c_r) = 0$.
The key idea is to exploit the two layers of algebraic independence separately. Write $f$ as a polynomial in $U_1, \ldots, U_r$ with coefficients that are polynomials in $T_1, \ldots, T_m$ over $k$:
\begin{align*}
f = \sum_{\alpha} g_\alpha(T_1, \ldots, T_m) \, U_1^{\alpha_1} \cdots U_r^{\alpha_r}.
\end{align*}
Evaluating $T_i = b_i$ yields $\sum_{\alpha} g_\alpha(b_1, \ldots, b_m) \, c_1^{\alpha_1} \cdots c_r^{\alpha_r} = 0$. Since $C$ is algebraically independent over $L$ (as $C$ is a transcendence basis for $E/L$), and each $g_\alpha(b_1, \ldots, b_m) \in k(b_1, \ldots, b_m) \subset L$, every coefficient must vanish: $g_\alpha(b_1, \ldots, b_m) = 0$ for each $\alpha$.
Now we use the second layer: $B$ is algebraically independent over $k$, so $g_\alpha(b_1, \ldots, b_m) = 0$ implies $g_\alpha$ is the zero polynomial. Since this holds for every $\alpha$, we get $f = 0$, contradicting our assumption. Hence $B \cup C$ is algebraically independent over $k$.
**Algebraicity.** Let $\alpha \in E$. Since $C$ is a transcendence basis for $E/L$, the element $\alpha$ is algebraic over $L(C)$. The field $L(C)$ consists of rational functions in elements of $C$ with coefficients in $L$. Every element of $L$ is algebraic over $k(B)$ (since $B$ is a transcendence basis for $L/k$). Therefore $L(C)$ is algebraic over $k(B)(C) = k(B \cup C)$: any element of $L(C)$ is a rational function whose numerator and denominator have coefficients algebraic over $k(B)$.
Since $\alpha$ is algebraic over $L(C)$ and $L(C)$ is algebraic over $k(B \cup C)$, the transitivity of algebraic extensions gives that $\alpha$ is algebraic over $k(B \cup C)$. (Explicitly: the minimal polynomial of $\alpha$ over $L(C)$ has coefficients algebraic over $k(B \cup C)$, and an element algebraic over an algebraic extension is algebraic over the base.)
This shows $E$ is algebraic over $k(B \cup C)$. Combined with algebraic independence, $B \cup C$ is a transcendence basis for $E/k$.
[/guided]
[/step]