Although this is an old question, I thought it was worth mentioning a recent paper by Heinrich that corrects the statements in EGA$0_{\text{IV}}$ mentioned in the comments.
Let us start with some definitions (following [Heinrich, Def. 1.2, Prop. 4.1]):
Definition. Let $X$ be a topological space which is $T_0$, noetherian, and finite dimensional.
- The space $X$ is biequidimensional if all maximal chains of irreducible closed subsets of $X$ have the same length.
- The space $X$ is weakly biequidimensional if it is equidimensional, equicodimensional, and catenary.
- A closed subset $Y \subseteq X$ satisfies the dimension formula if $\dim(X) = \dim(Y) + \operatorname{codim}(Y,X).$
The often cited result from EGA$0_{\text{IV}}$ is the following:
Claim [EGA$0_{\text{IV}}$, Prop. 14.3.3, Cor. 14.3.5]. Let $X$ be a topological space which is $T_0$, noetherian, and finite dimensional. The following are equivalent:
- The space $X$ is biequidimensional.
- The space $X$ is weakly biequidimensional.
Moreover, either of these equivalent conditions implies the following:
- Every closed subset $Y \subseteq X$ satisfies the dimension formula.
This is not quite correct; Heinrich shows that (1) implies both (2) and (3) [Heinrich, Lem. 2.1, Prop. 4.1], but that (2) does not imply (3):
Example [Heinrich, Ex. 3.7]. The ring $A$ obtained by localizing the ring $\frac{k[u, v, w, x, y, z]}{(uy, uz, vy, vz, wy, wz)}$ away from $(u,v,w,y,z)$ and $(u,v,w,x,y − 1,z − 1)$ is weakly biequidimensional but does not satisfy the dimension formula: the prime ideal $\mathfrak{p} = (u,v,w,y)$ satisfies $\operatorname{ht}(\mathfrak{p})+\dim(A/\mathfrak{p}) = 1+1 = 2 < 3 = \dim(A).$ See [Heinrich, Ex. 3.7] for details.
A preprint by Emerton and Gee gives a correct variant of the Claim above; see [Emerton and Gee, Lem. 2.32]. The basic difference is that the Claim is true if $X$ is assumed to be irreducible.