Two ideals I and J of A are coprime if I + J = A, that is, if 1 = a + b for some a \in I and b \in J [1]. In \mathbb{Z} the sum (m) + (n) is generated by the greatest common divisor of m and n, so (m) and (n) are coprime exactly when this divisor is 1. In k[x] the ideals (x - a) and (x - b) with a \neq b are coprime, since (x - a) - (x - b) = b - a is a unit.
The figure finds the greatest common divisor by cutting the largest possible square off an m \times n rectangle again and again. Cutting a square of side n off the side m replaces (m, n) by (m - n, n), which generates the same ideal, and the side of the last square is the greatest common divisor. The rectangle 21 \times 13 ends with a square of side 1, so (21) + (13) = (1), while 24 \times 18 ends with side 6, so (24) + (18) = (6).
We saw in Ideals and Quotient Rings that IJ = I \cap J for coprime ideals. Powers of coprime ideals are again coprime: in the expansion of (a + b)^{k + l - 1} = 1, every term has a factor a^k or a factor b^l, so I^k + J^l = A. For example, (4) = (2)^2 and (9) = (3)^2 are coprime.
The product A \times B of two rings is the set of pairs (a, b) with componentwise addition and multiplication, and its identity is (1, 1). If I + J = A, the homomorphism A \to A/I \times A/J, x \mapsto (x + I, x + J), has kernel I \cap J = IJ and is surjective, so A/IJ \cong A/I \times A/J [1,2]. It is surjective because 1 = a + b sends b to (1, 0) and a to (0, 1), so ub + va is sent to (u, v).
For \mathbb{Z}/12 \cong \mathbb{Z}/3 \times \mathbb{Z}/4, the figure writes each k in the cell given by the remainders of k divided by 3 and by 4. The cells are visited along a diagonal that wraps around at the edges, and 0, 1, \ldots, 11 fill all twelve cells once each. Units correspond to pairs of units, so Euler's function satisfies \varphi(12) = \varphi(3)\varphi(4).
For 4 and 6, which are not coprime, the diagonal comes back to the cell (0, 0) at k = 12, and half of the twenty-four cells stay empty. The map \mathbb{Z} \to \mathbb{Z}/4 \times \mathbb{Z}/6 has kernel (4) \cap (6) = (12), so \mathbb{Z}/12 embeds into the product without filling it. In particular \mathbb{Z}/24 is not isomorphic to \mathbb{Z}/4 \times \mathbb{Z}/6, since only \mathbb{Z}/24 has an element of additive order 24.
The theorem extends to several ideals: if I_1, \ldots, I_n are pairwise coprime, then A/(I_1 \cap \cdots \cap I_n) \cong A/I_1 \times \cdots \times A/I_n [1]. The old Chinese arithmetic book Sunzi Suanjing asks for a number that leaves the remainder 2 when divided by 3, the remainder 3 when divided by 5 and the remainder 2 when divided by 7.
Under \mathbb{Z}/105 \cong \mathbb{Z}/3 \times \mathbb{Z}/5 \times \mathbb{Z}/7 we need the element that goes to (2, 3, 2). The numbers 70, 21 and 15 go to (1, 0, 0), (0, 1, 0) and (0, 0, 1), so 2 \cdot 70 + 3 \cdot 21 + 2 \cdot 15 = 233 goes to (2, 3, 2), and so does its remainder 23 after division by 105.
The figure marks the numbers 3k + 2, 5k + 3 and 7k + 2 on three rows and moves a vertical line from left to right. Two of the rows meet every 15, 21 or 35 steps, and all three meet only at 23 and 128, so the solutions are the numbers 23 + 105k.
For distinct real numbers a, b, c, the ideals (x - a), (x - b) and (x - c) are pairwise coprime, and their intersection is generated by (x - a)(x - b)(x - c). The theorem gives \mathbb{R}[x]/((x - a)(x - b)(x - c)) \cong \mathbb{R} \times \mathbb{R} \times \mathbb{R}, where the class of f goes to (f(a), f(b), f(c)), its values at the three points.
The inverse is Lagrange interpolation. The polynomial L_a = (x - b)(x - c)/((a - b)(a - c)) takes the value 1 at a and 0 at b and c, so it goes to (1, 0, 0), and L_b and L_c are built in the same way. Every class has exactly one representative of degree at most 2, namely uL_a + vL_b + wL_c with u = f(a), v = f(b) and w = f(c).
In the figure, the heights u, v, w of the vertical segments at a, b, c change slowly, and the graph of uL_a + vL_b + wL_c always passes through their tips. The faint curves are L_a, L_b and L_c, each equal to 1 at its own point and 0 at the other two.
An element e with e^2 = e is called an idempotent. In A \times B the elements (1, 0) and (0, 1) are idempotents with sum 1 and product 0. Conversely, an idempotent e of A splits A: the sets Ae and A(1 - e) are rings with identities e and 1 - e, and x \mapsto (xe, x(1 - e)) is an isomorphism A \cong Ae \times A(1 - e) [1].
In \mathbb{Z}/n, an idempotent corresponds to a way of writing n = rs with r and s coprime: it is the element that is 1 modulo r and 0 modulo s. If n has k distinct prime factors there are 2^k idempotents, and for \mathbb{Z}/30 they are 0, 1, 6, 10, 15, 16, 21, 25. The figure plots the points (x, x^2) of \mathbb{Z}/n for n = 7, 12, 30, and the idempotents are the points on the diagonal.
Splitting along the prime factors makes \mathbb{Z}/n the product of the rings \mathbb{Z}/p^a for the prime powers p^a in the factorization of n, as in \mathbb{Z}/360 \cong \mathbb{Z}/8 \times \mathbb{Z}/9 \times \mathbb{Z}/5. Each \mathbb{Z}/p^a is a local ring, whose only idempotents are 0 and 1, so this splitting cannot be refined.
The theorem needs I + J = A. For t \neq 0 the ideals (x - t) and (x + t) of \mathbb{R}[x] are coprime, since (x + t) - (x - t) = 2t is a unit, and \mathbb{R}[x]/(x^2 - t^2) \cong \mathbb{R} \times \mathbb{R}. The idempotent that goes to (1, 0) is e = (x + t)/(2t), whose coefficient of x is 1/(2t).
In the figure, the class a + bx is the point (a, b). The classes vanishing at t and those vanishing at -t fill two lines through 0, and the idempotents e and 1 - e lie on these lines. As t moves toward 0, the two lines approach the vertical axis, and e and 1 - e move up and down out of the picture.
At t = 0 both ideals are (x), and (x) + (x) = (x) is not the whole ring. In \mathbb{R}[x]/(x^2) we have x \neq 0 but x^2 = 0, and as a local ring with maximal ideal (x) it has no idempotents other than 0 and 1, so it is not a product of two rings. In the same way \mathbb{Z}/4, where 2^2 = 0, is not isomorphic to \mathbb{Z}/2 \times \mathbb{Z}/2, where every element u satisfies u^2 = u.