Let $A$ be an integral domain of finite Krull dimension. Let $\mathfrak{p}$ be a prime ideal. Is it true that $$\operatorname{height} \mathfrak{p} + \dim A / \mathfrak{p} = \dim A$$ where $\dim$ refers to the Krull dimension of a ring?
Hartshorne states it as Theorem 1.8A in Chapter I (for the case $A$ a finitely-generated $k$-algebra which is an integral domain) and cites Matsumura and Atiyah–Macdonald, but I haven't been able to find anything which looks relevant in either. (Disclaimer: I know nothing about dimension theory, and very little commutative algebra.) If it is true (under additional assumptions, if need be), where can I find a complete proof?
It is obvious that $$\operatorname{height} \mathfrak{p} + \dim A/\mathfrak{p} \le \dim A$$ by a lifting argument, but the reverse inequality is eluding me. Localisation doesn't seem to be the answer, since localisation can change the dimension...