Is it true that $\mathrm{codim}(Z \cap Y, Y) \leq\mathrm{codim}(Z,X)$ for closed subsets $Z,Y$ of a scheme $X$?

69 Views Asked by At

This might be a standard thing but I'm not so sure.

Say $X$ is an irreducible affine scheme, $Y$ is an irreducible closed subset of $X$, and $Z$ a closed subset of $X$. If $Z \cap Y \neq \emptyset$ is it true that $$\mathrm{codim}(Z \cap Y, Y) \leq \mathrm{codim}(Z,X),$$ where on the left we have the codimension of $Z \cap Y$ in $Y$ and on the right we have the codimension of $Z$ in $X$?

I believe to have seen this in the context of Krull's intersection theorem but I don't see how this follows. I also do not want to assume that $X$ is noetherian.