When is the completion of a ring a local ring ?

The completion of a ring with respect to a maximal ideal is always local.

Proof: If $x \in \hat{R}$, then we may write $x = \sum_{i=0}^{\infty} x_i,$ where $x_i \in \mathfrak m^i$. If $x_0 \not\in m,$ then I claim that $x$ is a unit. Indeed, in this case we may find $y \in R$ such that $x_0 y \equiv 1 \mod m,$ and so $xy = 1 + (x_1y + x_0y - 1) + \sum_{i = 2}^{\infty} x_iy,$ and so it suffices to show that $\sum_{i=0}^{\infty} x_i$ is a unit under the additional assumption that $x_0 = 1$. But then we can construct an explicit inverse for $x$ using the formula for a geometric series: $x^{-1} = 1 + (x_1 + x_2 + \cdots) + (x_1 + x_2 + \cdots )^2 + \cdots.$

Thus the kernel of the map $x \mapsto x_0 \bmod m$ (i.e. the kernel of the natural projection $\hat{R} \to R/m$) has the property that its complement consists of units, and so it must be the unique maximal ideal of $\hat{R}$, and so $\hat{R}$ is local. This completes the proof.


With Matt E's simple answer, the following answer may be of little help. But I'll post it nevertheless.

Recall that the completion is the inverse limit $\hat{R}=\varprojlim (R/m^i)$ which can be described as a subring of the product $\prod (R/m^i)$. $R/m^i$ is a local ring($m/m^i$ is a nilpotent maximal ideal) in which every element outside $m/m^i$ is a unit (let $w$ be in the complement, together with $m/m^i$ it generates the unit ideal, so $vw+n=1$ for some $n\in m/m^i$ and some $v$; thus, $vw$ being a sum of a unit and nilpotent is itself a unit).

The ideal $M\subseteq \hat{R}$ given by $M=\{(x_1,x_2,...)\in \hat{R}|x_1= 0\}$ is maximal since it is the kernel of the surjective homomorphism $\hat{R}\rightarrow R/m$ onto a field. Further we can see that any element of $\hat{R}$ outside $M$ is a unit as follows. Given $(x_1,x_2,...)$ with $x_1\neq 0$ we have an inverse $y_1\in R/m$. Now $x_2$ is non nilpotent since its homomorphic image $x_1$ is. Hence, $x_2$ is a unit by the observation in the previous answer. Moreover the image of $y_2$ in $R/m$ is $y_1$ (if $\varphi:R/m^2\rightarrow R/m$ is the canonical surjection, $x_1\varphi(y_2)=\varphi(x_2y_2)=1$ so $\varphi(y_2)=y_1x_1\varphi(y_2)=y_1$). Proceeding inductively with the same method, we get $y_i$ as the inverse of $x_i$ with the $y_i$'s satisfying the required compatibility and thus $y=(y_1,y_2,...)\in \hat{R}$ as the inverse of $(x_1,x_2,...)\notin M$.

Thus $M\subseteq\hat{R}$ is a maximal ideal with every element in the complement as a unit, hence $\hat{R}$ is local.