# Can a chain of irreducible subvarieties always be extended to one of maximal length?

I'm interested in computing the dimension of a variety $X$. I can get a lower bound by exhibiting some strictly increasing chain of irreducible subvarieties $$\varnothing =Z_{-1}\subset Z_0\subset Z_1\subset Z_2\subset\ldots\subset Z_r=X$$ so that $\dim X\ge r$.

To show $\dim X=r$, I'd like to do the following:

1. Show that there are no irreducible subvarieties $Y_i$ such that $Z_{i-1}\subsetneq Y_i\subsetneq Z_{i}$ for $i=0,1,\ldots,r-1$.
2. Show that the chain $\varnothing =Z_{-1}\subset Z_0\subset Z_1\subset Z_2\subset\ldots\subset Z_r=X$ may be extended to a chain of maximal length in $X$.

Now, if $X$ is reducible, then I can think of counterexamples to 2., but what if I require that $Z_{r-1}$ is contained in the irreducible component of $X$ of maximal dimension? So we may assume that $X$ is irreducible. Is 2. true in this case?

This is true if $X$ is an irreducible variety (a $k$-scheme of finite type), yes. The equivalent algebraic statement is that for an integral algebra $A$, of finite type over $k$, $ht(\mathfrak p)+\dim A/\mathfrak p= \dim A$.
As the height of $\mathfrak p$ is the codimension of $V(\mathfrak p)$ in $Spec A$, this is exactly the length of a maximum chain of irreducible subsets that starts with $V(\mathfrak p)$ and ends up with $Spec A$.
If $X$ is an irreducible variety, then $(2)$ holds. One way to see this is by the Noether normalization lemma, which implies that if $R$ is an affine $k$-algebra that is a domain, then for any $R$-ideal $I$, $\text{ht}(I) + \dim(R/I) = \dim R$. In particular $R$ is equidimensional (since any minimal prime $P$ of $R$ has $\dim(R/P) = \dim R$, and every maximal ideal $m$ has $\text{ht}(m) = \dim R$) and catenary, which implies (2).