Solution (source code)

= Solution

An element $x$ of an extension $L/K$ is an <algebraic element> over $K$ when some nonzero <polynomial> in $K[t]$ vanishes at $x$. Let its monic <minimal polynomial> have degree $d$. <Polynomial> division shows $K[x]$ is spanned by $1,x,\ldots,x^{d-1}$, and minimality makes these <vectors> independent. The <minimal polynomial> is irreducible; for any nonzero $q(x)$, Bezout's identity between $q$ and that <polynomial> gives a <polynomial> representative for $q(x)^{-1}$. Thus $K[x]$ is a field, equals $K(x)$, and has degree $d$.

Conversely, if $K(x)$ has finite vector-space <dimension> $d$, then $1,x,\ldots,x^d$ are linearly dependent over $K$, giving a nonzero annihilating <polynomial>. Hence
$$
\boxed{x\text{ algebraic over }K\ \Longleftrightarrow\ [K(x):K]<\infty.}
$$
An <algebraic extension> is one in which every element is algebraic. Suppose $M/L$ and $L/K$ are algebraic, and take $\alpha\in M$. A <polynomial> relation for $\alpha$ over $L$ uses only finitely many coefficients $a_1,\ldots,a_r$. Each is algebraic over $K$, so adjoining them successively gives a finite extension $E=K(a_1,\ldots,a_r)$, by the proved criterion and the <tower law>. The same relation makes $\alpha$ algebraic over $E$, so $E(\alpha)/E$ is finite. Therefore $E(\alpha)/K$ is finite, and its subspace $K(\alpha)$ is finite-dimensional. The criterion makes $\alpha$ algebraic over $K$. Since $\alpha$ was arbitrary, \b[$M/K$ is algebraic].