[proofplan]
For part (1), we show both inequalities $\dim(A) \leq \dim(B)$ and $\dim(A) \geq \dim(B)$. The first uses the Lying-Over and Going-Up theorems to lift chains of primes from $A$ to $B$. The second uses the fact that contracting primes from $B$ to $A$ preserves strict inclusions by the Incomparability property of integral extensions. For part (2), we reduce to part (1) by relating transcendence degree to Krull dimension via fraction fields and polynomial rings.
[/proofplan]
[step:Show $\dim(A) \leq \dim(B)$ by lifting chains from $\operatorname{Spec}(A)$ to $\operatorname{Spec}(B)$ via Lying-Over and Going-Up]
Let $\mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \cdots \subsetneq \mathfrak{p}_d$ be a chain of prime ideals in $\operatorname{Spec}(A)$. We construct a chain of the same length in $\operatorname{Spec}(B)$.
By the [Lying-Over Theorem](/theorems/???), since $A \subset B$ is integral, there exists $\mathfrak{q}_0 \in \operatorname{Spec}(B)$ with $\mathfrak{q}_0 \cap A = \mathfrak{p}_0$.
By the [Going-Up Theorem](/theorems/???), applied inductively: given $\mathfrak{q}_0 \subsetneq \cdots \subsetneq \mathfrak{q}_i$ in $\operatorname{Spec}(B)$ with $\mathfrak{q}_j \cap A = \mathfrak{p}_j$ for $j \leq i$, and given $\mathfrak{p}_{i+1} \supsetneq \mathfrak{p}_i$ in $\operatorname{Spec}(A)$, there exists $\mathfrak{q}_{i+1} \in \operatorname{Spec}(B)$ with $\mathfrak{q}_{i+1} \supseteq \mathfrak{q}_i$ and $\mathfrak{q}_{i+1} \cap A = \mathfrak{p}_{i+1}$.
The resulting chain $\mathfrak{q}_0 \subsetneq \mathfrak{q}_1 \subsetneq \cdots \subsetneq \mathfrak{q}_d$ consists of distinct primes: if $\mathfrak{q}_i = \mathfrak{q}_{i+1}$ for some $i$, then $\mathfrak{p}_i = \mathfrak{q}_i \cap A = \mathfrak{q}_{i+1} \cap A = \mathfrak{p}_{i+1}$, contradicting $\mathfrak{p}_i \neq \mathfrak{p}_{i+1}$. Moreover, the inclusions are strict: $\mathfrak{q}_i \subseteq \mathfrak{q}_{i+1}$ (from Going-Up) and $\mathfrak{q}_i \neq \mathfrak{q}_{i+1}$ (just shown), so $\mathfrak{q}_i \subsetneq \mathfrak{q}_{i+1}$.
Since every chain of length $d$ in $\operatorname{Spec}(A)$ gives rise to a chain of length $d$ in $\operatorname{Spec}(B)$, we have $\dim(A) \leq \dim(B)$.
[guided]
We want to show that every chain of primes in $A$ can be "lifted" to a chain of the same length in $B$. The two key properties of integral extensions that make this possible are:
- **Lying-Over**: for every $\mathfrak{p} \in \operatorname{Spec}(A)$, there exists $\mathfrak{q} \in \operatorname{Spec}(B)$ with $\mathfrak{q} \cap A = \mathfrak{p}$.
- **Going-Up**: given $\mathfrak{q} \in \operatorname{Spec}(B)$ lying over $\mathfrak{p} \in \operatorname{Spec}(A)$ and $\mathfrak{p}' \supseteq \mathfrak{p}$ in $\operatorname{Spec}(A)$, there exists $\mathfrak{q}' \supseteq \mathfrak{q}$ in $\operatorname{Spec}(B)$ with $\mathfrak{q}' \cap A = \mathfrak{p}'$.
Let $\mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \cdots \subsetneq \mathfrak{p}_d$ be a chain of prime ideals in $A$. By Lying-Over, find $\mathfrak{q}_0 \in \operatorname{Spec}(B)$ with $\mathfrak{q}_0 \cap A = \mathfrak{p}_0$. Then apply Going-Up successively: from $\mathfrak{q}_0$ and $\mathfrak{p}_1 \supsetneq \mathfrak{p}_0$, get $\mathfrak{q}_1 \supseteq \mathfrak{q}_0$ with $\mathfrak{q}_1 \cap A = \mathfrak{p}_1$; from $\mathfrak{q}_1$ and $\mathfrak{p}_2 \supsetneq \mathfrak{p}_1$, get $\mathfrak{q}_2 \supseteq \mathfrak{q}_1$ with $\mathfrak{q}_2 \cap A = \mathfrak{p}_2$; and so on.
The lifted chain $\mathfrak{q}_0 \subseteq \mathfrak{q}_1 \subseteq \cdots \subseteq \mathfrak{q}_d$ has strict inclusions because the contractions $\mathfrak{q}_i \cap A = \mathfrak{p}_i$ are pairwise distinct. If $\mathfrak{q}_i = \mathfrak{q}_{i+1}$, contracting gives $\mathfrak{p}_i = \mathfrak{p}_{i+1}$, a contradiction. So we have a chain of length $d$ in $\operatorname{Spec}(B)$, proving $\dim(A) \leq \dim(B)$.
[/guided]
[/step]
[step:Show $\dim(A) \geq \dim(B)$ by contracting chains from $\operatorname{Spec}(B)$ to $\operatorname{Spec}(A)$ using Incomparability]
Let $\mathfrak{q}_0 \subsetneq \mathfrak{q}_1 \subsetneq \cdots \subsetneq \mathfrak{q}_d$ be a chain of prime ideals in $\operatorname{Spec}(B)$. For each $i$, define $\mathfrak{p}_i = \mathfrak{q}_i \cap A$. Each $\mathfrak{p}_i$ is a prime ideal of $A$ (the contraction of a prime ideal under a ring homomorphism is prime).
We claim the $\mathfrak{p}_i$ are pairwise distinct, so $\mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \cdots \subsetneq \mathfrak{p}_d$ is a chain of length $d$ in $\operatorname{Spec}(A)$. The inclusions $\mathfrak{p}_i \subseteq \mathfrak{p}_{i+1}$ follow from $\mathfrak{q}_i \subsetneq \mathfrak{q}_{i+1}$.
To show strictness, we use the [Incomparability Property](/theorems/???) of integral extensions: if $\mathfrak{q}, \mathfrak{q}' \in \operatorname{Spec}(B)$ satisfy $\mathfrak{q} \subseteq \mathfrak{q}'$ and $\mathfrak{q} \cap A = \mathfrak{q}' \cap A$, then $\mathfrak{q} = \mathfrak{q}'$. Taking the contrapositive: since $\mathfrak{q}_i \subsetneq \mathfrak{q}_{i+1}$ (i.e., $\mathfrak{q}_i \neq \mathfrak{q}_{i+1}$), Incomparability gives $\mathfrak{q}_i \cap A \neq \mathfrak{q}_{i+1} \cap A$, i.e., $\mathfrak{p}_i \neq \mathfrak{p}_{i+1}$.
Since every chain of length $d$ in $\operatorname{Spec}(B)$ contracts to a chain of length $d$ in $\operatorname{Spec}(A)$, we have $\dim(B) \leq \dim(A)$.
[guided]
For the reverse inequality, we go from $B$ back to $A$ by contracting. The subtlety is ensuring that contraction does not collapse the chain: two distinct primes in $B$ could contract to the same prime in $A$ in general, but integrality prevents this via Incomparability.
The **Incomparability Property** states: in an integral extension $A \subset B$, there are no inclusion relations among primes of $B$ lying over the same prime of $A$. Precisely, if $\mathfrak{q} \subseteq \mathfrak{q}'$ are primes of $B$ with $\mathfrak{q} \cap A = \mathfrak{q}' \cap A$, then $\mathfrak{q} = \mathfrak{q}'$.
Why does this help? Given a chain $\mathfrak{q}_0 \subsetneq \mathfrak{q}_1 \subsetneq \cdots \subsetneq \mathfrak{q}_d$ in $\operatorname{Spec}(B)$, set $\mathfrak{p}_i = \mathfrak{q}_i \cap A$. We have $\mathfrak{p}_i \subseteq \mathfrak{p}_{i+1}$ since $\mathfrak{q}_i \subseteq \mathfrak{q}_{i+1}$. If $\mathfrak{p}_i = \mathfrak{p}_{i+1}$, then $\mathfrak{q}_i$ and $\mathfrak{q}_{i+1}$ both lie over $\mathfrak{p}_i$ with $\mathfrak{q}_i \subseteq \mathfrak{q}_{i+1}$, so Incomparability forces $\mathfrak{q}_i = \mathfrak{q}_{i+1}$, contradicting our strict chain. Therefore $\mathfrak{p}_i \neq \mathfrak{p}_{i+1}$ for each $i$, giving a strictly ascending chain $\mathfrak{p}_0 \subsetneq \mathfrak{p}_1 \subsetneq \cdots \subsetneq \mathfrak{p}_d$ in $\operatorname{Spec}(A)$.
What would go wrong without integrality? The contraction map $\operatorname{Spec}(B) \to \operatorname{Spec}(A)$ would not need to be injective on chains. For a non-integral extension, one can have $\mathfrak{q} \subsetneq \mathfrak{q}'$ with $\mathfrak{q} \cap A = \mathfrak{q}' \cap A$, and the contracted chain would be shorter.
[/guided]
[/step]
[step:Combine the inequalities to prove part (1)]
From the first step, $\dim(A) \leq \dim(B)$. From the second step, $\dim(B) \leq \dim(A)$. Therefore $\dim(A) = \dim(B)$, completing the proof of part (1).
[/step]
[step:Prove part (2): transcendence degree is preserved for integral domains over a field]
Assume $A$ and $B$ are integral domains and $k$-algebras with $A \subset B$ integral. Let $K = \operatorname{Frac}(A)$ and $L = \operatorname{Frac}(B)$ denote the fraction fields. Since $A \subset B$ is integral and $B$ is a domain, $K \subset L$ is an algebraic field extension: every element of $B$ satisfies a monic polynomial over $A$, hence over $K$, so every element of $L = \operatorname{Frac}(B)$ is algebraic over $K$.
An algebraic field extension does not change the transcendence degree: $\operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(K)$. This follows from the [tower formula for transcendence degree](/theorems/???): $\operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(K) + \operatorname{trdeg}_K(L)$, and $\operatorname{trdeg}_K(L) = 0$ since $L/K$ is algebraic.
Since $\operatorname{trdeg}_k(A) = \operatorname{trdeg}_k(K)$ and $\operatorname{trdeg}_k(B) = \operatorname{trdeg}_k(L)$ (a domain and its fraction field have the same transcendence degree over $k$, as passing to the fraction field is an algebraic operation: every element of $K$ is of the form $a/b$ with $a, b \in A$, $b \neq 0$, and $a/b$ satisfies $bx - a = 0$ over $A$), we conclude
\begin{align*}
\operatorname{trdeg}_k(A) = \operatorname{trdeg}_k(K) = \operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(B).
\end{align*}
[guided]
For part (2), we need a different approach from part (1), since transcendence degree is not directly defined in terms of chains of primes (that relationship is the content of the [Dimension of Finitely Generated Domains](/theorems/2951) theorem, which is proved separately).
The key observation is that an integral extension of domains induces an algebraic extension of fraction fields. Let $K = \operatorname{Frac}(A)$ and $L = \operatorname{Frac}(B)$. Why is $L/K$ algebraic? Take any $\beta \in B$. Since $B$ is integral over $A$, there exist $a_0, \ldots, a_{n-1} \in A$ with $\beta^n + a_{n-1}\beta^{n-1} + \cdots + a_0 = 0$. This is a polynomial equation over $A \subset K$, so $\beta$ is algebraic over $K$. Since every element of $L$ is a ratio $\beta_1/\beta_2$ with $\beta_1, \beta_2 \in B$ and $\beta_2 \neq 0$, and algebraic elements form a field, every element of $L$ is algebraic over $K$.
The transcendence degree satisfies a tower formula: for field extensions $k \subset K \subset L$, $\operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(K) + \operatorname{trdeg}_K(L)$. Since $L/K$ is algebraic, $\operatorname{trdeg}_K(L) = 0$, giving $\operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(K)$.
Finally, why is $\operatorname{trdeg}_k(A) = \operatorname{trdeg}_k(K)$? By convention, $\operatorname{trdeg}_k(A) := \operatorname{trdeg}_k(\operatorname{Frac}(A)) = \operatorname{trdeg}_k(K)$ for an integral domain $A$. (Alternatively: the fraction field is obtained by inverting nonzero elements, and if $a/b \in K$ with $a, b \in A$, $b \neq 0$, then $a/b$ satisfies $bx - a = 0$ over $A$, so every element of $K$ is algebraic over $A$, and transcendence bases of $A$ and $K$ over $k$ coincide.) The same applies to $B$ and $L$, giving $\operatorname{trdeg}_k(A) = \operatorname{trdeg}_k(K) = \operatorname{trdeg}_k(L) = \operatorname{trdeg}_k(B)$.
[/guided]
[/step]