# Do localization and completion commute?

Let A be a commutative Ring and $\mathfrak{p}$ be a prime ideal of A. Under which assumptions for A and $\mathfrak{p}$ does localization by $\mathfrak{p}$ and completion with respect to $\mathfrak{p}$ commute? To be more precise, when is $\hat{A}_\hat{\mathfrak{p}}$ (completion w.r.t. $\mathfrak{p}$) isomorphic to $\widehat{A_\mathfrak{p}}$ (completion w.r.t. $\mathfrak{p} A_\mathfrak{p}$)?

For example, is it true under the assumptions A noetherian and $\mathfrak{p}$ a maximal ideal?

It seems to me that one important ingredient for a possible proof (under the right assumptions) is that localisation and building factor rings commutes. So a side question: Is it always true that $A_\mathfrak{p}/(\mathfrak{p}A_\mathfrak{p})^k \cong (A/\mathfrak{p}^k)_{\bar{\mathfrak{p}}}$?

Thanks

-
Didn't you just ask this on MO and get an answer. –  BBischof May 10 '11 at 2:08
(MO question BBischof mentioned) –  Zev Chonoles May 10 '11 at 2:18
It doesn't look like it was asked by the same person to me. The notation is not the same and usually when questions are posted on both sites they are written in exactly the same way. In my opinion it is a different question. –  Adrián Barquero May 10 '11 at 2:29
Incidentally, it is not true that localization (in general) commutes with completion. For instance, if $A$ is a complete ring, $A_f$ may not be for $f \in A$. –  Akhil Mathew May 11 '11 at 4:05

The linked MO question shows that the answer is yes when $\mathfrak p$ is maximal, the key point in that case being that the completion of $A$ at a maximal ideal is automatically local.
If $\mathfrak p$ is not maximal, then there will be a natural map $\hat{A}_{\hat{\mathfrak p}} \to \widehat{A_{\mathfrak p}}$. Indeed, there is a map $A \to A_{\mathfrak p}$, which induces a map of $\mathfrak p$-adic completions $\hat{A} \to \widehat{A_{\mathfrak p}},$ which in turn induces a map $\hat{A}_{\hat{\mathfrak p}} \to \widehat{A_{\mathfrak p}}.$ But this map won't be an isomorphism if $\mathfrak p$ is not maximal (at least if $A$ is Noetherian, so that the completions are reasonably behaved).
To see why, consider as an example the case when $A = \mathbb Z_p[x]$, and $\mathfrak p = (x)$. Then $A_{\mathfrak p} = \mathbb Q_p[x]_{(x)},$ and so $\widehat{A_{\mathfrak p}} = \mathbb Q_p[[x]].$ On the other hand, $\hat{A}_{\hat{\mathfrak p}} = \mathbb Z_p[[x]]_{(x)}$, which is a proper subring of $\mathbb Q_p[[x]]$. (E.g. an element of $\mathbb Z_p[[x]]_{(x)}$ defines a meromorphic function on the $p$-adic disk $1 > |x|$ with only finitely many zeroes and finitely many poles, none of the latter being at $x = 0$; in particular, it has a non-trivial radius of convergence around $0$. On the other hand, a typical function in $\mathbb Q_p[[x]]$ does not have any non-trivial radius of convergence around $0$.)
This illustrates the general phenomonon that when $\mathfrak p$ is not maximal, so that $\hat{A}_{\hat{\mathfrak p}}$ is a genuinely non-trivial localization, only certain $\mathfrak p$-adic limits exist in the localization $\hat{A}_{\hat{\mathfrak p}}$, while by construction $\widehat{A_{\mathfrak p}}$ is $\mathfrak p$-adically complete.