I've been reading some commutative algebra, but have been struggling with this idea for a while.
Let $k$ be a field, and let $A=k[x_1,\dots,x_n]$ be a finitely generated integral domain, such that $\operatorname{tr. deg}_k(k(x_1,\dots,x_n))=r$. I want to know why for any maximal chain of (nonempty) irreducible closed sets $P_1\subset P_2\subset\cdots\subset P_m=\operatorname{Spec}(A)$, with $P_i\neq P_j$ when $i\neq j$, then $m=r+1$.
I know that since the $P_i$ are closed and irreducible, then each $P_i=Z(p_i)$, the set of zeroes for some prime ideal $p_i$. So I tried looking at a maximal chain $$ Z(p_1)\subset Z(p_2)\subset\cdots\subset Z(p_m)=\operatorname{Spec}(A). $$ I also know that $Z(a)\subset Z(b)\iff\text{rad }a\supset\text{rad }b$, so this gives a maximal chain of prime ideals $$ p_1\supset p_2\supset\cdots\supset p_m=(0). $$
I've not seen a way to relate this back to the transcendence degree to conclude that $m=r+1$. I thought about assuming $m<r+1$ or $m>r+1$ to get a contradiction, but didn't see a way to proceed. Is there a nice, relatively self contained proof that the length of every maximal chain of ideals is equal to the transcendence degree of the field of fractions in this case?
I've been looking around, but haven't found a very digestible proof.