Solution (source code)

= Solution

For a prime ideal $\mathfrak p$, its height is the supremum of lengths $r$ of strict chains
$$
\mathfrak p_0\subsetneq\mathfrak p_1\subsetneq\cdots\subsetneq\mathfrak p_r=\mathfrak p.
$$
The <height of an ideal> $I$, without assuming $I$ prime, is
$$
\boxed{\operatorname{ht}(I)=
\inf_{\mathfrak p\supseteq I}\operatorname{ht}(\mathfrak p)}.
$$
The <Krull dimension> of a ring $R$ is
$$
\boxed{\dim R=\sup\{r:\mathfrak p_0\subsetneq\cdots\subsetneq\mathfrak p_r
\text{ are prime ideals of }R\}}.
$$