Chinese Remainder Theorem
Chinese Remainder Theorem
The Chinese Remainder Theorem (CRT) is a fundamental result in number theory that describes when and how a system of congruences can be solved simultaneously. It has applications in cryptography, computer science, and abstract algebra.
Statement
Let be pairwise coprime positive integers ( for ). Then the system of congruences:
has a unique solution modulo .
Constructive Proof
Let for each . Since , there exists such that .
The solution is:
Ring-Theoretic Formulation
CRT states there is a ring isomorphism:
This generalizes to ideals in any ring: if and are coprime ideals, then is isomorphic to .
Applications
RSA Decryption
CRT speeds up RSA decryption by computing and separately, then combining using CRT. This is about times faster than direct computation.
Secret Sharing
Shamirs secret sharing uses CRT ideas: a secret is split into shares that can be recombined when enough shares are present.
Computer Arithmetic
Residue number systems use CRT for parallel computation. Operations mod different primes can proceed independently and be combined at the end.
Calendar Calculations
Computing Easter dates and finding when calendar cycles repeat uses systems of congruences solved by CRT.
Generalization to Polynomials
CRT applies to polynomials: given coprime polynomials , a polynomial can be uniquely determined mod from its remainders mod each .
This is the basis for Lagrange interpolation and fast polynomial multiplication.
Algorithm Complexity
Finding the solution requires computing modular inverses (via extended Euclidean algorithm) and combining terms. Total complexity is using fast algorithms.
When Moduli Are Not Coprime
If , the system has a solution iff .
Historical Origin
The theorem appears in the rd-century Chinese text Sunzi Suanjing. The problem asks: find a number that leaves remainder when divided by , remainder when divided by , and remainder when divided by .
Garners Algorithm
An efficient algorithm for CRT that avoids large intermediate values by computing the solution incrementally.
CRT and Eulers Totient
CRT implies when , since the units mod decompose as products.
Explicit Formula
For two moduli and with :
Simultaneous Congruences
CRT allows solving systems like by working with each congruence independently.
Idempotents
The isomorphism in CRT is given by idempotent elements. If is and for , then .
CRT for Groups
For abelian groups: if has order with , then is isomorphic to where and .
Iterative Solution
For many congruences, solve two at a time. Combine and into , then continue with remaining congruences.
Error Detection
CRT enables redundant computation for error detection: compute a result mod several primes and check consistency.
Uniqueness
The solution is unique modulo , the product of all moduli. Different representatives of the same residue class are congruent mod .
Summary
CRT states: working mod (coprime factors) is equivalent to working mod each separately. This decomposition is fundamental in number theory, algebra, and computer science.
The theorem transforms hard problems mod large into easier problems mod smaller factors.