p-adic completion of ring only only depends on the mod $p$ reduction Let $R, S$ be rings and assume $R/pR\cong S/pS$. If necessary, we also assume that $R$ and $S$ are $p$-torsion-free. I'd like to ask why $R/p^nR\cong S/p^nS$ holds for all $n\geq1$? I think it suffices to consider the case for $n=2$.
Any help will be appreciated.
 A: Consider $R = \mathbf Z[i]$ and $S = \mathbf Z[\sqrt{2}]$. In each ring $2$ has just one prime above it: $2 = -i(1+i)^2$ and $2=\sqrt{2}^2$. The $2$-adic completion of $R$ is $\mathbf Z_2[i]$ and the $2$-adic completion of $S$ is $\mathbf Z_2[\sqrt{2}]$. These rings are of rank $2$ over $\mathbf Z_2$ and are not isomorphic rings since the first has no solution of $x^2 = 2$ and the second has no solution of $x^2=
-1$.
A: You certainly need some extra hypotheses, beyond $p$-torsion free (which is definitely essential).
Consider $R = \mathbb Z[X]/(X^2)$ and $S = \mathbb Z[X]/(X^2 + 1)$.
Then $R/2R \cong \mathbb F_2[X]/(X^2)$, and
$$S/2S \cong \mathbb F_2[X]/(X^2 + 1) \cong \mathbb F_2[X]/(X+1)^2\cong \mathbb F_2[X+1]/(X+1)^2 \cong R/2R.$$
But,
$$S/4S \cong \frac{\mathbb Z/4\mathbb Z[X]}{(X^2 + 1)}\not\cong  \frac{\mathbb Z/4\mathbb Z[X]}{(X^2)}\cong R/4R.$$
Indeed, if $a + bX \in S/4S$, with $a, b\in \mathbb Z/4\mathbb Z$, is such that $(a+bX)^2 = 0$, then
$$0 = (a+bX)^2 = a^2 - b^2 +2abX$$
so $2abX= 0$ and $a^2-b^2 = 0$. Hence, $a,b\in 2\mathbb Z/4\mathbb Z$. So $S/4S$ cannot be generated by any element $Y$ with $Y^2 = 0$.
