CRT for Rings

lean4-proofring-theoryvisualization
R/(I1In)R/I1××R/InR/(I_1 \cap \cdots \cap I_n) \cong R/I_1 \times \cdots \times R/I_n

Statement

Let RR be a commutative ring and I1,,InRI_1, \ldots, I_n \subseteq R ideals that are pairwise coprime: Ij+Ik=RI_j + I_k = R for all jkj \ne k.

Chinese Remainder Theorem (ring version). There is a ring isomorphism

R/k=1nIk    k=1nR/Ik.R \big/ \bigcap_{k=1}^n I_k \;\cong\; \prod_{k=1}^n R/I_k.

The classical case: R=ZR = \mathbb{Z}, Ik=(mk)I_k = (m_k) with gcd(mj,mk)=1\gcd(m_j, m_k) = 1 for jkj \ne k, gives Z/(m1mn)Z/m1××Z/mn\mathbb{Z}/(m_1 \cdots m_n) \cong \mathbb{Z}/m_1 \times \cdots \times \mathbb{Z}/m_n.

Visualization

Example: Z/15Z/3×Z/5\mathbb{Z}/15 \cong \mathbb{Z}/3 \times \mathbb{Z}/5.

Ideals (3)(3) and (5)(5) in Z\mathbb{Z} are coprime: 32+5(1)=13 \cdot 2 + 5 \cdot (-1) = 1.

nmod15n \bmod 15nmod3n \bmod 3nmod5n \bmod 5element of Z/3×Z/5\mathbb{Z}/3 \times \mathbb{Z}/5
000000(0,0)(0, 0)
111111(1,1)(1, 1)
552200(2,0)(2, 0)
660011(0,1)(0, 1)
10101100(1,0)(1, 0)
11112211(2,1)(2, 1)
14142244(2,4)(2, 4)

Reconstruction (CRT lift). Given (2,4)Z/3×Z/5(2, 4) \in \mathbb{Z}/3 \times \mathbb{Z}/5, find nmod15n \bmod 15.

Step 1: Need n2(mod3)n \equiv 2 \pmod{3} and n4(mod5)n \equiv 4 \pmod{5}.

Step 2: Bezout: 23+(1)5=12 \cdot 3 + (-1) \cdot 5 = 1. So e1=101(mod3)e_1 = 10 \equiv 1 \pmod{3}, e10(mod5)e_1 \equiv 0 \pmod{5} and e2=60(mod3)e_2 = 6 \equiv 0 \pmod{3}, e21(mod5)e_2 \equiv 1 \pmod{5}.

Step 3: n=2e1+4e2=210+46=20+24=4414(mod15)n = 2 \cdot e_1 + 4 \cdot e_2 = 2 \cdot 10 + 4 \cdot 6 = 20 + 24 = 44 \equiv 14 \pmod{15}.

Proof Sketch

  1. Define the map. Let ϕ:RkR/Ik\phi : R \to \prod_k R/I_k by ϕ(r)=(r+I1,,r+In)\phi(r) = (r + I_1, \ldots, r + I_n). This is a ring homomorphism.

  2. Surjectivity. Given (a1,,an)R/Ik(a_1, \ldots, a_n) \in \prod R/I_k, use pairwise coprimality to find idempotents ekRe_k \in R with ek1(modIk)e_k \equiv 1 \pmod{I_k} and ek0(modIj)e_k \equiv 0 \pmod{I_j} for jkj \ne k (via Bezout in RR). Then akek\sum a_k e_k maps to (a1,,an)(a_1, \ldots, a_n).

  3. Kernel is kIk\bigcap_k I_k. An element rr maps to 00 iff rIkr \in I_k for all kk, i.e., rkIkr \in \bigcap_k I_k. By pairwise coprimality, Ik=I1In\bigcap I_k = I_1 \cdots I_n (the product ideal).

  4. First Isomorphism Theorem gives R/IkR/IkR/\bigcap I_k \cong \prod R/I_k.

Connections

The number-theoretic Chinese Remainder TheoremChinese Remainder TheoremZ/mnZZ/mZ×Z/nZ\mathbb{Z}/mn\mathbb{Z} \cong \mathbb{Z}/m\mathbb{Z} \times \mathbb{Z}/n\mathbb{Z}Simultaneous congruences with coprime moduli have a unique solution mod their productRead more → is the special case R=ZR = \mathbb{Z}. The ring version generalises it to arbitrary commutative rings and gives Fundamental Theorem of ArithmeticFundamental Theorem of Arithmeticn=p1a1p2a2pkakn = p_1^{a_1} \cdot p_2^{a_2} \cdots p_k^{a_k}Every integer greater than 1 has a unique prime factorizationRead more → a structural home: Z/nZ/piei\mathbb{Z}/n \cong \prod \mathbb{Z}/p_i^{e_i} when n=piein = \prod p_i^{e_i}.

Lean4 Proof

-- Mathlib: Ideal.quotientInfRingEquivPiQuotient
-- in Mathlib.RingTheory.Ideal.Quotient.Operations

open Ideal in
/-- CRT for rings: if ideals are pairwise coprime, the quotient by their
    intersection is isomorphic to the product of the individual quotients. -/
#check @Ideal.quotientInfRingEquivPiQuotient
-- quotientInfRingEquivPiQuotient :
--   ∀ {R : Type u_1} [inst : CommRing R] {ι : Type u_2} (f : ι → Ideal R),
--     (∀ i j, i ≠ j → f i ⊔ f j = ⊤) →
--     R ⧸ ⨅ i, f i ≃+* ∀ i, R ⧸ f i

/-- Concrete instance: ℤ/15 ≅ ℤ/3 × ℤ/5. -/
example : ZMod 15 ≃+* ZMod 3 × ZMod 5 :=
  (ZMod.chineseRemainder (by norm_num)).toRingEquiv