Fiveable

🧮Additive Combinatorics Unit 2 Review

QR code for Additive Combinatorics practice questions

2.4 The Chinese Remainder Theorem

2.4 The Chinese Remainder Theorem

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🧮Additive Combinatorics
Unit & Topic Study Guides

The Chinese Remainder Theorem is a powerful tool in number theory, allowing us to solve systems of congruences with coprime moduli. It's like a mathematical puzzle solver, finding unique solutions to complex equations by breaking them into simpler parts.

This theorem connects to the broader study of additive number theory by providing a way to work with modular arithmetic efficiently. It's essential for various applications, from cryptography to computer science, showcasing how fundamental number theory concepts can solve real-world problems.

Chinese Remainder Theorem

Statement and Proof

  • States if n1,n2,...,nkn_1, n_2, ..., n_k are pairwise coprime positive integers and a1,a2,...,aka_1, a_2, ..., a_k are any integers, then the system of simultaneous congruences xa1(modn1),xa2(modn2),...,xak(modnk)x \equiv a_1 \pmod {n_1}, x \equiv a_2 \pmod {n_2}, ..., x \equiv a_k \pmod {n_k} has a unique solution modulo N=n1×n2×...×nkN = n_1 \times n_2 \times ... \times n_k
  • Proves the theorem by constructing a solution using the following steps:
    • Let N=n1×n2×...×nkN = n_1 \times n_2 \times ... \times n_k and Ni=N/niN_i = N / n_i for each ii
    • Find integers yiy_i such that Ni×yi1(modni)N_i \times y_i \equiv 1 \pmod {n_i} using the extended Euclidean algorithm
    • The solution is given by x=a1×N1×y1+a2×N2×y2+...+ak×Nk×ykx = a_1 \times N_1 \times y_1 + a_2 \times N_2 \times y_2 + ... + a_k \times N_k \times y_k
  • Proves the uniqueness of the solution by assuming two solutions x1x_1 and x2x_2 and showing that x1x2(modN)x_1 \equiv x_2 \pmod N

Ring Isomorphisms

  • Establishes an isomorphism between the ring Z/NZ\mathbb{Z}/N\mathbb{Z} and the product of rings Z/n1Z×Z/n2Z×...×Z/nkZ\mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z} \times ... \times \mathbb{Z}/n_k\mathbb{Z}, where N=n1×n2×...×nkN = n_1 \times n_2 \times ... \times n_k and n1,n2,...,nkn_1, n_2, ..., n_k are pairwise coprime
  • The isomorphism is given by the map ϕ:Z/NZZ/n1Z×Z/n2Z×...×Z/nkZ\phi: \mathbb{Z}/N\mathbb{Z} \to \mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z} \times ... \times \mathbb{Z}/n_k\mathbb{Z} defined by ϕ(xmodN)=(xmodn1,xmodn2,...,xmodnk)\phi(x \bmod N) = (x \bmod n_1, x \bmod n_2, ..., x \bmod n_k)
  • The inverse map ϕ1:Z/n1Z×Z/n2Z×...×Z/nkZZ/NZ\phi^{-1}: \mathbb{Z}/n_1\mathbb{Z} \times \mathbb{Z}/n_2\mathbb{Z} \times ... \times \mathbb{Z}/n_k\mathbb{Z} \to \mathbb{Z}/N\mathbb{Z} is given by the Chinese Remainder Theorem, which constructs a unique element xZ/NZx \in \mathbb{Z}/N\mathbb{Z} from its residues (a1,a2,...,ak)(a_1, a_2, ..., a_k) modulo n1,n2,...,nkn_1, n_2, ..., n_k
  • Allows for the reduction of computations in Z/NZ\mathbb{Z}/N\mathbb{Z} to computations in the smaller rings Z/n1Z,Z/n2Z,...,Z/nkZ\mathbb{Z}/n_1\mathbb{Z}, \mathbb{Z}/n_2\mathbb{Z}, ..., \mathbb{Z}/n_k\mathbb{Z}, simplifying calculations and improving efficiency
Statement and Proof, elementary number theory - Extended Euclidean Algorithm and Chinese Remainder Theorem ...

Solving Linear Congruences

Application of the Chinese Remainder Theorem

  • Used to solve systems of linear congruences of the form xa1(modn1),xa2(modn2),...,xak(modnk)x \equiv a_1 \pmod {n_1}, x \equiv a_2 \pmod {n_2}, ..., x \equiv a_k \pmod {n_k}, where n1,n2,...,nkn_1, n_2, ..., n_k are pairwise coprime
  • To apply the theorem, follow these steps:
    • Check that the moduli n1,n2,...,nkn_1, n_2, ..., n_k are pairwise coprime
    • Calculate N=n1×n2×...×nkN = n_1 \times n_2 \times ... \times n_k and Ni=N/niN_i = N / n_i for each ii
    • Find integers yiy_i such that Ni×yi1(modni)N_i \times y_i \equiv 1 \pmod {n_i} using the extended Euclidean algorithm
    • Compute the solution x=a1×N1×y1+a2×N2×y2+...+ak×Nk×ykx = a_1 \times N_1 \times y_1 + a_2 \times N_2 \times y_2 + ... + a_k \times N_k \times y_k
  • The solution xx obtained is unique modulo NN, ensuring a single solution to the system of congruences
Statement and Proof, RSA Encryption using Chinese Remainder Theorem and Fermat's Little Theorem - Mathematics Stack ...

Examples

  • Solve the system of congruences: x2(mod3),x3(mod5),x2(mod7)x \equiv 2 \pmod 3, x \equiv 3 \pmod 5, x \equiv 2 \pmod 7
    • Check that 3,5,73, 5, 7 are pairwise coprime
    • Calculate N=3×5×7=105N = 3 \times 5 \times 7 = 105, N1=35N_1 = 35, N2=21N_2 = 21, N3=15N_3 = 15
    • Find y1=2y_1 = 2, y2=1y_2 = 1, y3=1y_3 = 1 using the extended Euclidean algorithm
    • Compute the solution x=2×35×2+3×21×1+2×15×1=233x = 2 \times 35 \times 2 + 3 \times 21 \times 1 + 2 \times 15 \times 1 = 233
    • The unique solution modulo 105105 is 2323
  • Solve the system of congruences: x1(mod4),x2(mod9),x5(mod11)x \equiv 1 \pmod 4, x \equiv 2 \pmod 9, x \equiv 5 \pmod {11}
    • Check that 4,9,114, 9, 11 are pairwise coprime
    • Calculate N=4×9×11=396N = 4 \times 9 \times 11 = 396, N1=99N_1 = 99, N2=44N_2 = 44, N3=36N_3 = 36
    • Find y1=3y_1 = 3, y2=5y_2 = 5, y3=4y_3 = 4 using the extended Euclidean algorithm
    • Compute the solution x=1×99×3+2×44×5+5×36×4=1417x = 1 \times 99 \times 3 + 2 \times 44 \times 5 + 5 \times 36 \times 4 = 1417
    • The unique solution modulo 396396 is 229229

Cryptographic Applications

RSA Cryptosystem

  • The Chinese Remainder Theorem is used to speed up the decryption process in the RSA cryptosystem
  • The modulus NN is the product of two large primes pp and qq
  • The decryption exponent dd is computed modulo ϕ(N)=(p1)(q1)\phi(N) = (p-1)(q-1)
  • To decrypt a ciphertext cc, compute m1=cdmodpm_1 = c^d \bmod p and m2=cdmodqm_2 = c^d \bmod q, then use the Chinese Remainder Theorem to find the unique message mm modulo NN
  • This method is more efficient than directly computing m=cdmodNm = c^d \bmod N, as it involves smaller modular exponentiations and the Chinese Remainder Theorem reconstruction

Paillier Cryptosystem

  • The Chinese Remainder Theorem is used in the key generation process of the Paillier cryptosystem
  • The public key is N=pqN = pq, where pp and qq are large primes
  • The private key is (λ,μ)(\lambda, \mu), where λ=lcm(p1,q1)\lambda = \text{lcm}(p-1, q-1) and μ=(L(gλmodN2))1modN\mu = (L(g^\lambda \bmod N^2))^{-1} \bmod N, with L(x)=(x1)/NL(x) = (x-1)/N and gg chosen such that gcd(L(gλmodN2),N)=1\gcd(L(g^\lambda \bmod N^2), N) = 1
  • The Chinese Remainder Theorem is used to compute μ\mu efficiently by working modulo pp and qq separately, reducing the complexity of the calculations
  • This application of the Chinese Remainder Theorem enables the efficient generation of the private key in the Paillier cryptosystem
Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly → and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot

2,589 studying →