Direct Product iff Nontrivial Idempotent

Theorem
Let $R$ be a commutative ring with unity whose zero is $0_R$ and whose unity is $1_R$.

Then $R$ is the direct product of two non-trivial rings $R$ contains an idempotent element not equal to $0_R$ or $1_R$.

Necessary Condition
Suppose $R$ has a nontrivial decomposition $R = R_1 \times R_2$, meaning that neither $R_1$ or $R_2$ is the null ring.

Then $\tuple {1_{R_1}, 0_{R_2}}$ is an idempotent element of $R$ not equal to $0_R$ or $1_R$.

Sufficient Condition
Suppose there exists an idempotent element $e \in R$ not equal to $0_R$ or $1_R$.

That is:
 * $0_R, 1_R \ne e$
 * $e^2 = e$

Let $R_1 = \ideal e$, the ideal generated by $e$, and $R_2 = R / \ideal e$.

Since $e \paren {e - 1_R} = 0_R$, it follows by definition that $e$ is a zero divisor.

So by Unit of Ring is not Zero Divisor, $e$ it is not a unit.

Therefore, $1 \notin R_1$ and $\ideal e \subsetneqq R$.

Also $R_1 \cap R_2 = \set {0_R}$ so the product is direct (that is, the Universal Property for Direct Products is satisfied).

Finally we define the "gluing homomorphism" $\phi : R \to R_1 \times R_2$ by


 * $\phi: a \mapsto \tuple {a e, a + \ideal e}$

which is easily shown to be an isomorphism.