# localization and depth

Let $$A$$ be a ring and $$p$$ be a prime ideal. By elementary considerations we have that $$\operatorname{depth}_p A_p \geq \operatorname{depth}_p A$$. Is it true that the reverse holds if $$p$$ is maximal?

This question came up as I was trying to work through Problem III.3.5 in Hartshorne's Algebraic Geometry. Let $$U$$ be an open subset of a Noetherian scheme and $$p \in U$$ a closed point, i.e., $$p$$ is a maximal ideal in an affine open. In this problem one needs to characterize unique extendibility of sections of the structure sheaf from $$U \setminus p$$ to $$U$$ in terms of the depth of the local ring at $$p$$.

This question came out naturally from trying to solve the above problem.

In Bruns and Herzog notation one knows that $$\mathrm{grade}(\mathfrak p,A)\le\mathrm{depth}(A_{\mathfrak p})$$ for every prime ideal $$\mathfrak p$$ since a regular sequence remains regular after localization.
In general, it is not true that $$\mathrm{grade}(\mathfrak p,A)=\mathrm{depth}(A_{\mathfrak p})$$, and a counterexample is the following: $$A=K[X,Y,Z]/(X^2,XY,XZ)$$ and $$\mathfrak p=(x,y)$$, where $$x$$, respectively $$y$$ denote the residue classes of $$X$$, respectively $$Y$$. We have $$\mathrm{grade}(\mathfrak p,A)=0$$ since $$x\mathfrak p=0$$, and $$\mathrm{depth}(A_{\mathfrak p})=1$$.
Such phenomenon occurs since $$\mathfrak p$$ is not an associated prime.
For maximal ideals this can not happen. That is, if $$\mathfrak m$$ is a maximal ideal with $$\mathrm{grade}(\mathfrak m,A)=0$$, then $$\mathfrak m\in\mathrm{Ass}(A)$$, and thus $$\mathfrak mA_{\mathfrak m}\in\mathrm{Ass}(A_{\mathfrak m})$$ which shows that $$\mathrm{depth}(A_{\mathfrak m})=0$$.
This leads immediately to the conclusion that $$\mathrm{grade}(\mathfrak m,A)=\mathrm{depth}(A_{\mathfrak m})$$ for every maximal ideal $$\mathfrak m$$.