The Chinese Remainder Theorem
"If you know a number's remainders on division by several coprime moduli, those remainders pin it down uniquely."
"If you know a number's remainders on division by several coprime moduli, those remainders pin it down uniquely."
The Chinese remainder theorem says that if you are told the remainders of an unknown whole number when divided by several moduli that are pairwise coprime, sharing no common factor, then there is exactly one solution modulo the product of those moduli. In other words, a system of simultaneous congruences with coprime moduli always has a solution, and that solution is unique up to adding multiples of the product. Named for its appearance in the third-to-fifth-century Chinese text Sunzi Suanjing, it is a foundational result of number theory and modular arithmetic, letting one reconstruct a number from its residues and reassemble modular calculations done separately for each modulus.
Give the remainders and the moduli. If the moduli are pairwise coprime there is exactly one answer below their product, and the construction finds it.
x = sum(ri Ni yi) mod N, N = product of the mi
The moduli must be pairwise coprime. When they are not, the theorem does not apply and this says so rather than returning a number.
Rated Empirical: grounded in studies or measurable evidence. The other 608.
The heart of the theorem is that reducing a number modulo a product of pairwise-coprime moduli carries the same information as reducing it modulo each factor separately, and these residues can be recombined. Constructively, for each modulus one builds a number that is one modulo that factor and zero modulo the others, using the fact that coprime moduli admit combinations via Bezout's identity, then sums the pieces weighted by the required remainders. In the language of abstract algebra, the ring of integers modulo the product is isomorphic to the direct product of the rings modulo each factor, so the theorem is an isomorphism that decomposes a complicated modulus into simple independent pieces.
The abstract statement that the integers modulo a product of coprime numbers factor as the direct product of the integers modulo each, generalising to any commutative ring with coprime ideals.
When moduli share factors, a solution exists only if the given remainders agree on the common parts, and then it is unique modulo the least common multiple.
The Chinese remainder theorem is a cornerstone of number theory and a workhorse of computation, letting a problem modulo a large number be broken into independent problems modulo its coprime factors and reassembled. It speeds up arithmetic in cryptography and error-correcting codes, underlies secret-sharing schemes, and appears throughout algebra as a structural decomposition of rings. Historically it records a remarkably early insight, from calendar and astronomy calculations in ancient China, and it remains a standard tool whenever numbers are handled through their remainders, from fast RSA decryption to the design of hash functions.
The clean existence-and-uniqueness guarantee requires the moduli to be pairwise coprime; without that, a system may have no solution at all, and when it does the solution is unique only modulo the least common multiple rather than the product. The theorem tells you a unique residue exists but, in its pure form, is a statement about remainders, not about the size of the smallest positive solution. Its computational payoff also depends on the moduli genuinely being coprime and on the cost of the recombination step, which uses modular inverses that must themselves be computed.
The theorem does not require the moduli to be prime, only pairwise coprime, so composite moduli are fine as long as they share no common factor. It is not a Chinese-only result despite the name; the name reflects the early appearance in Sunzi's manual, while the general method is due to Qin Jiushao and, in Europe, Gauss. And uniqueness is modular, not absolute: there are infinitely many integer solutions, all congruent modulo the product of the moduli, with the theorem singling out one residue class rather than one number.
Yes, as far as the evidence goes. The Chinese Remainder Theorem is rated Empirical here: it rests on studies or measurements rather than on a saying.
Rated from two sources. 609 of the 1,116 entries carry this rating. How the scale works.
The best-known laws are the least likely to rest on measurement.
First recorded as a specific puzzle in Sunzi Suanjing between the third and fifth centuries, given a complete general algorithm by Qin Jiushao in his 1247 Mathematical Treatise in Nine Sections, and set on modern foundations by Gauss in his Disquisitiones Arithmeticae of 1801.
10 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.
Everything above traces to en.wikipedia.org and mathworld.wolfram.com: two secondary sources, accounts of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.