MathLabs
TheoremProved

Chinese remainder theorem

Statement

If n1,…,nkn_1,\dots,n_k are pairwise coprime positive integers, then for any integers a1,…,aka_1,\dots,a_k the system of congruences x≡ai(modni)x\equiv a_i \pmod{n_i} (i=1,…,ki=1,\dots,k) has a solution xx, unique modulo N=n1n2⋯nkN=n_1n_2\cdots n_k.

Why is it true?

Pairwise-coprime moduli carry independent information, so specifying a remainder for each one pins down a unique residue modulo their product — like reading off a single number from several clocks that run at coprime periods.

Proof sketch

For each ii let Ni=N/niN_i=N/n_i. Since gcd⁡(Ni,ni)=1\gcd(N_i,n_i)=1, Bézout's identity gives yiy_i with Niyi≡1(modni)N_iy_i\equiv1\pmod{n_i}. Then x=∑iaiNiyix=\sum_i a_iN_iy_i satisfies x≡ai(modni)x\equiv a_i\pmod{n_i} for every ii, because Nj≡0(modni)N_j\equiv0\pmod{n_i} for j≠ij\ne i. Uniqueness modulo NN follows since two solutions must differ by a multiple of every nin_i, hence by a multiple of NN.

Proved by

Topics that use this theorem

Related theorems

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. Carl Friedrich Gauss (trans. Arthur A. Clarke) (1986). Disquisitiones Arithmeticae · DOI:10.1016/B978-044450871-3/50117-0
  2. Jean-Claude Martzloff (1997). A History of Chinese Mathematics · DOI:10.1007/978-3-540-33783-6