We have defined the completion of a noetherian local ring $A$ to be $\hat{A}=\left\{(a_1,a_2,\ldots)\in\prod_{i=1}^\infty A/\mathfrak{m}^i:a_j\equiv a_i\bmod{\mathfrak{m}^i} \,\,\forall j>i\right\}.$ I have a slight problem trying to understand the proof that then $\hat{A}$ is a complete local ring with maximal ideal $\hat{\mathfrak{m}}=\{(a_1,a_2,\ldots)\in\hat{A}:a_1=0\}$.
Proof. If $(a_1,a_2,\ldots)\in\hat{\mathfrak{m}}$, then $a_i\equiv 0\bmod{\mathfrak{m}}$ for all $i$, i.e., $a_i\in\mathfrak{m}$. Hence $\hat{\mathfrak{m}}^i=\left\{(a_1,a_2,\ldots)\in\hat{A}:a_j=0\,\,\forall j\leq i\right\}.$ So the canonical map $\hat{A}\to A/\mathfrak{m}^i$, $(a_1,a_2,\ldots)\mapsto a_i$, is surjective with kernel $\hat{\mathfrak{m}}^i$. Thus $\hat{A}/\hat{\mathfrak{m}}^i\cong A/\mathfrak{m}^i$. In particular, $\hat{\mathfrak{m}}$ is a maximal ideal. But why is it the only one in $\hat{A}$?
If $(a_1,a_2,\ldots)\not\in\hat{\mathfrak{m}}$, we have $a_1\neq 0$, hence $a_1\not\in\mathfrak{m}$, hence it is a unit. By the defining property of the completion, $a_j$ is a unit for all $j$. So I could choose a candidate for the inverse of $(a_1,a_2,\ldots)$ by choosing inverse elements of the $a_j$. Why would this candidate be in $\hat{A}$ then, i.e. how can I choose it properly such that the congruences on the right hand side of the definition of the completion would be fulfilled?
Regards!