Finite free rings over complete local rings are direct products of local rings I came across the following statement: Let $R$ be a complete local Noetherian commutative ring. If $A$ is a commutative $R$-algebra that is finitely generated and free as a module over $R$, then $A$ is a semi-local ring that is the direct product of local rings. (I'm unsure if completeness or the Noetherian condition is actually relevant to this; but this is the specific fact being used)
I can prove it is a semi-local ring: Let $m$ be the maximal ideal of $R$, then $\frac{A}{mA}$ is finite dimensional as a $\frac{R}{m}$ vector space, and thus Artinian. Therefore, it only has a finite number of maximal ideals, and its maximal ideals correspond to maximal ideals of $A$ containing $mA$. But all maximal ideals of $A$ contain $mA$: To see this, this is equivalent to the Jacobson radical containing $mA$, which is equivalent to $1-x$ being a unit in $A$ for any $x \in mA$. The inverse is just $1+x+x^2+\cdots$, which exists by completeness.
But why is $A$ necessarily the direct product of local rings?
 A: Commutative Artinian rings in general are finite direct products of local Artinian rings, and that has nothing to do with it being an algebra over a special ring.
Every idempotent of such a ring generates an ideal (which is actually a subring) $eRe$. Sometimes it's possible that $e$ splits into two smaller nonzero orthogonal idempotents: $e=f+g$ such that $fg=0$, whereupon $eRe=fRf\oplus gRg$ and the idea splits into two smaller ideals.  Using the Artinian condition, you refine the idempotents until they cannot be broken down any more.
The result is a set of finitely many idempotents $e_i$ which cannot be written as a sum of two other orthogonal nontrivial idempotents, and $\sum e_i=1$. The resulting subrings (which are ideals) $e_iRe_i$ are local rings, and $\oplus e_iRe_i=R$.
A: As rschwieb notes, commutative Artinian rings can always be factored uniquely as a product of local Artinian rings, and the formation of this factorization commutes with the passage to the maximal reduced quotient (i.e. it is invariant under quotienting out by the nilradical).  
Since a complete semilocal ring is (by definition) the projective limit of $A/I^n A$, where $I$ is the Jacoson radical and is the intersection of the finitely many maximal ideals, applying the preceding paragraph to the quotients $A/I^n A$ (each of which is Artinian, and all of which has the same maximal reduced quotient, namely $A/IA$), we obtain a factorization of $A$ into a product of finitely many complete local rings.
This result uses completeness in a crucial way (via passage to the Artinian case).  E.g. the localization of $\mathbb Z[i]$ at the prime ideal $5$ of $\mathbb Z$ (i.e. invert all elements coprime to $5$) is semi-local (because there are two prime ideals in $\mathbb Z[i]$ lying over the prime ideal $5$ of $\mathbb Z$), but is not a product of local rings.  (It is an integral domain, and so cannot be written as a product in a non-trivial way.)  Of course, if we $5$-adically complete it, then by the preceding discussion it will split as a product (of two copies of $\mathbb Z_5$).
