Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Number theory research

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

KING ABDULAZIZ UNIVERSITY

Faculty of Science, Department of Mathematics

Number Theory Research paper

The Chinese Remainder Theorem

20/11/2022
Under the guidance of: Dr. Abd Al-Rahman Heliel
Authors: Yousef Al-Jedely – Maad MohammedAli – Yazn Al-Qurashi
Subject: Mathematics
Level: Bachelor
Course code: 444

1
1. Introduction........................................................................................................................................... 3
1.1. Contributions of the Chinese ............................................................................................................. 3
1.2. Origins and a brief overview of the Chinese Remainder Theorem .................................................... 3
2. The Chinese Remainder Theorem proof ................................................................................................ 5
2.1. Proof of two congruences ................................................................................................................. 5
2.2. Extensions to more than two congruences ....................................................................................... 6
3. Progression of the Chinese Remainder Theorem through history ........................................................ 7
4. Uses and applications of the theorem .................................................................................................. 9
4.1. Chinese Remainder Theorem for Rings and Domains ....................................................................... 9
4.2. Chinese Remainder Theorem for Polynomial Rings ........................................................................ 10
4.3. Finite Sequence of Integers ............................................................................................................. 11
4.4. Cryptography Schemes.................................................................................................................... 11
4.5. Fast Computation ............................................................................................................................ 11
4.6. Mathematics ................................................................................................................................... 12
5. Way of solving using Chinese Remainder Theorem ............................................................................ 12
6. Some solved problems ........................................................................................................................ 13
7. Sources ................................................................................................................................................ 18

2
1. Introduction

1.1. Contributions of the Chinese


Consider the following problem:
Find all positive integers n such that n4 - 4n3 + 22n2 - 36n + 18 is a perfect square.

This problem might be hard to solve for many of us, but it is one of the problems, among many harder
ones, that are taught to Chinese children in schools in preparation for the international math Olympiad.
In fact there is a whole book full of problems and solutions to train young Chinese minds in honing their
skills for the Mathematical Olympiad. The modern Chinese have some of the smartest minds in
Mathematics and Physics, but it not just about the modern times, Chinese people have always been
extremely proficient in the field of Mathematics and have contributed a lot towards the subject.

Some of the biggest and most important contributions are:

a) The Han Dynasty (202 BC - 220 AD), produced works of mathematics which presumably
expanded on earlier lost works. The most important is The Nine Chapters on the Mathematical
Art. It consists of 246-word problems involving agriculture, business, geometry to figure height
spans and dimension ratios for Chinese pagoda towers, engineering, and surveying. The Nine
Chapters also includes material on right triangles, values of pi, a mathematical proof for
the Pythagorean Theorem and a mathematical formula for Gaussian Elimination.

b) Shiing-Shen Chern (1911 — 2004): Helped link analysis and geometry together via
characteristic classes. In mathematical physics, he laid the framework for a theoretical
study of the Dirac equation.
c) Shing-Tung Yau (1949 — Present): One of Chern's students. Proved the Calabi Conjecture and
won a Fields Medal in 1982
d) Terence Tao (1975 — Present): Tao (of Chinese Origin, but born in Australia) was a multiple
time International Mathematical Olympiad (IMO) winner who became an associate professor at
UCLA in his early twenties. He proved the Green-Tao theorem about arithmetic progressions of
prime numbers and won a Fields Medal in 2006.
e) And of course, last but not least we have The Chinese Remainder Theorem.

1.2. Origins and a brief overview of the Chinese Remainder Theorem


Chinese remainder theorem is an ancient theorem that gives the conditions necessary for multiple
equations to have a simultaneous integer solution. The theorem has its origin in the work of the 3rd-
century-AD Chinese mathematician Sun Zi, it was given in the mathematician’s book called Sun Zi
Suanjing, or the Sun’s Arithmetical Manual.

Congruences of first degree were necessary to calculate calendars in ancient China as early as the 2nd
century B.C. Subsequently, in making the Jingchu calendar (237 A.D.), the astronomers defined
shangyuan as the starting point of the calendar. If the Winter Solstice of a certain year occurred r1 days

3
after shangyuan and r2 days after the new moon, then that year was N years after shangyuan; hence
arose the system of congruences

aN ≡ r1 (mod 60) ≡ r2 (mod b),


where a is the number of days in a tropical year and b the number of days in a lunar month. So in order
to solve these congruences, Mathematician Sun Zi came up with his method of solving multiple
congruences at once now known as The Chinese Remainder Theorem.

To understand the Chinese Remainder theorem, we first need to understand what congruences and
modulo are.

Suppose I tell you that I want a number “a” such that when you subtract “b” from it, it becomes a
multiple of another number “n” or that when you divide “a” by “n” you are left with a remainder “b”

i.e. 𝑎 − 𝑏 = 𝑛𝑘 ∋ 𝑘 ∈ ℤ or 𝑟𝑒𝑚(𝑎, 𝑛) = 𝑏

Then we write it as: 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)

Read as: “𝑎” is congruent to “𝑏” modulo “𝑛”

Some examples: 7 ≡ 1 (𝑚𝑜𝑑 3) 𝑎𝑠 7 − 1 = 3 ∗ 2 (7 is congruent to 1 modulo 3)

27 ≡ 2 (𝑚𝑜𝑑 5) 𝑎𝑠 27 − 2 = 5 ∗ 5 (27 is congruent to 2 modulo 5)

So suppose you want to find a solution to the following set of congruences:

𝑥 ≡ 𝑎1 (𝑚𝑜𝑑 𝑛1 )
𝑥 ≡ 𝑎2 (𝑚𝑜𝑑 𝑛2 )
𝑥 ≡ 𝑎3 (𝑚𝑜𝑑 𝑛3 )
.

𝑥 ≡ 𝑎𝑘 (𝑚𝑜𝑑 𝑛𝑘 )
Where 𝑎1 , 𝑎2 , 𝑎3 , … , 𝑎𝑘 ∈ ℤ 𝑎𝑛𝑑 𝑛1 , 𝑛2 , 𝑛3 , … , 𝑛𝑘 ∈ ℤ

This could be solved by using the Chinese Remainder theorem which states that the congruence has a
solution modulo 𝑛1 ∗ 𝑛2 ∗ 𝑛3 ∗ … ∗ 𝑛𝑘 if 𝑛𝑖 and 𝑛𝑗 are relatively prime ∀𝑖 ≠ 𝑗 ∋ 𝑖, 𝑗 ∈ {1,2, … , 𝑛}, i.e
gcd(𝑛𝑖 , 𝑛𝑗 ) = 1 ∀𝑖 ≠ 𝑗 ∋ 𝑖, 𝑗 ∈ {1,2, … , 𝑛}.

4
2. The Chinese Remainder Theorem proof

2.1. Proof of two congruences


We start with two congruences as it will be easier to prove for two congruences then translate to more
than two congruences rather than proving for more than two congruences.

Proof: First we show there is always a solution. Then we will show it is unique modulo 𝑚 ∗ 𝑛.

Existence of Solution: To show that the simultaneous congruences

𝑥 ≡ 𝑎 (𝑚𝑜𝑑 𝑚), 𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)

have a common solution in ℤ, we give two proofs.

First proof: Write the first congruence as an equation in ℤ, say 𝑥 = 𝑎 + 𝑚 ∗ 𝑘 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘 ∈ ℤ. Then
the second congruence is the same as

𝑎 + 𝑚 ∗ 𝑦 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)

Subtracting “𝑎“ from both sides, we need to solve for y in

(2.1) 𝑚 ∗ 𝑦 ≡ 𝑏 − 𝑎 (𝑚𝑜𝑑 𝑛)

Since (𝑚, 𝑛) = 1, we know m mod n is invertible. Let m’ be an inverse for m mod n, so

𝑚 ∗ 𝑚’ ≡ 1 𝑚𝑜𝑑 𝑛
Multiplying through (2.1) by m’ we have

𝑦 ≡ 𝑚′ (𝑏 − 𝑎) (𝑚𝑜𝑑 𝑛)
⇒ 𝑦 ≡ 𝑚′ (𝑏 − 𝑎) + 𝑛𝑧 𝑤ℎ𝑒𝑟𝑒 𝑧 ∈ ℤ
⇒ 𝑥 = 𝑎 + 𝑚𝑦 = 𝑎 + 𝑚(𝑚0 (𝑏 − 𝑎) + 𝑛𝑧) = 𝑎 + 𝑚𝑚0 (𝑏 − 𝑎) + 𝑚𝑛𝑧.

So if x satisfies the original two congruences it must have this form. Let’s now check this expression, for
every 𝑧 ∈ ℤ, really satisfies the original two congruences:

𝑎 + 𝑚 ∗ 𝑚′ (𝑏 − 𝑎) + 𝑚 ∗ 𝑛 ∗ 𝑧 ≡ 𝑎 + 0 + 0 ≡ 𝑎 (𝑚𝑜𝑑 𝑚)
And

𝑎 + 𝑚 ∗ 𝑚′(𝑏 − 𝑎) + 𝑚 ∗ 𝑛 ∗ 𝑧 ≡ 𝑎 + 1(𝑏 − 𝑎) + 0 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)


Second proof:

Write both congruences as equations in ℤ:

𝑥 = 𝑎 + 𝑚𝑦 and 𝑥 = 𝑏 + 𝑛𝑧 for integers y and z that need to be determined. The integers of the
form 𝑎 + 𝑚𝑦 are the numbers that are congruent to a mod m, and the integers of the form 𝑏 + 𝑛𝑧
are the numbers that are congruent to 𝑏 𝑚𝑜𝑑 𝑛. Finding a common solution to the two congruences
amounts to finding y and z in ℤ such that:

𝑎 + 𝑚𝑦 = 𝑏 + 𝑛𝑧

5
which is the same as:

(2.2) 𝑚𝑦 − 𝑛𝑧 = 𝑏 − 𝑎

Can we find such y and z for all a, b, m, and n where (𝑚, 𝑛) = 1? Bezout’s identity tells us 1 is a
ℤ - linear combination of m and n, and therefore every integer is a ℤ - linear combination of m and n.
Therefore integers y and z satisfying (2.2) exist.

Uniqueness of Solution: If x = c and x = c’ both satisfy

𝑥 ≡ 𝑎 𝑚𝑜𝑑 𝑚, 𝑥 ≡ 𝑏 𝑚𝑜𝑑 𝑛

then we have 𝑐 ≡ 𝑐’ (𝑚𝑜𝑑 𝑚) and 𝑐 ≡ 𝑐’ (𝑚𝑜𝑑 𝑛). Then 𝑚|(𝑐 – 𝑐’) and 𝑛|(𝑐 – 𝑐’). Since (m, n) = 1, the
product 𝑚𝑛|𝑐 – 𝑐’, which means 𝑐 ≡ 𝑐’ (𝑚𝑜𝑑 𝑚𝑛). This shows all solutions to the initial pair of
congruences are the same modulo mn.

2.2. Extensions to more than two congruences


Proof:

First we show there is always a solution. Then we will show it is unique modulo 𝑛1 𝑛2 … 𝑛𝑘 .

Existence of Solution: We argue by induction on k. The base case k = 2 is the above proof. Now we pass
to the inductive step. Suppose all simultaneous congruences with k pairwise relatively prime moduli can
be solved. Consider a system of simultaneous congruences with k + 1 pairwise relatively prime moduli:

𝑥 ≡ 𝑎1 (𝑚𝑜𝑑 𝑛1 )
𝑥 ≡ 𝑎2 (𝑚𝑜𝑑 𝑛2 )
.
.
.
𝑥 ≡ 𝑎𝑘 (𝑚𝑜𝑑 𝑛𝑘 )
𝑥 ≡ 𝑎𝑘+1 (𝑚𝑜𝑑 𝑛𝑘+1 )
where (𝑚𝑖 , 𝑚𝑗 ) = 1 ∀ 𝑖 ≠ 𝑗 and the 𝑎𝑖′ 𝑠 are arbitrary. By the inductive hypothesis, there is a solution
b to the first k congruences, say:

𝑏 ≡ 𝑎1 (𝑚𝑜𝑑 𝑛1 ), 𝑏 ≡ 𝑎2 (𝑚𝑜𝑑 𝑛2 ), … , 𝑏 ≡ 𝑎𝑘 (𝑚𝑜𝑑 𝑛𝑘 )


Now consider the system of two congruences:

(3.1) 𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑛1 𝑛2 … 𝑛𝑘 ), 𝑥 ≡ 𝑎𝑘+1 (𝑚𝑜𝑑 𝑛𝑘+1 )

𝑆𝑖𝑛𝑐𝑒 (𝑛𝑖 , 𝑛𝑘 ) = 1 𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑘, we have (𝑛1 , 𝑛2 , … 𝑛𝑘 , 𝑛𝑘+1 ) = 1, so the two moduli in (3.1) are
relatively prime. Then by the case of two congruences, there is a solution to (3.1). Call it c, since:

6
𝑐 ≡ 𝑏 (𝑚𝑜𝑑 𝑛1 𝑛2 … 𝑛𝑘 ), we have 𝑐 ≡ 𝑏 (𝑚𝑜𝑑 𝑛𝑖 )𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑘

From the choice of b we have:

𝑏 ≡ 𝑎𝑖 (𝑚𝑜𝑑 𝑛𝑖 ) 𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑘
⇒ 𝑐 ≡ 𝑎𝑖 (𝑚𝑜𝑑 𝑛𝑖 ) 𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑘
⇒ 𝑐 ≡ 𝑎𝑘+1 (𝑚𝑜𝑑 𝑛𝑘+1 )
⇒ 𝑐 satisfies the 𝑘 + 1 given congruences

⇒ This concludes the inductive step, so a solution exists.

Uniqueness of Solution: If 𝑥 = 𝑐 and 𝑥 = 𝑐’ both satisfy

𝑥 ≡ 𝑎1 (𝑚𝑜𝑑 𝑛1 )
𝑥 ≡ 𝑎2 (𝑚𝑜𝑑 𝑛2 )
.

𝑥 ≡ 𝑎𝑘 (𝑚𝑜𝑑 𝑛𝑘 )
then we have 𝑐 ≡ 𝑐 ′ (𝑚𝑜𝑑 𝑛𝑖 )𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑘, so 𝑛𝑖 |(𝑐 − 𝑐′) 𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑟. Since the 𝑛𝑖 ’𝑠 are
pairwise relatively prime, their product 𝑛1 𝑛2 … 𝑛𝑘 |𝑐 − 𝑐′ , which means 𝑐 ≡ 𝑐 ′ (𝑚𝑜𝑑 𝑛1 𝑛2 … 𝑛𝑘 ). This
shows all solutions to the given system of congruences are the same when viewed modulo 𝑛1 𝑛2 … 𝑛𝑘

3. Progression of the Chinese Remainder Theorem through history


In modern form, the remainder problem and the solution given in the Sun Zi Suanjing can be written as:
Remainder Problem:

𝑥 = 2 (𝑚𝑜𝑑 3) = 3 (𝑚𝑜𝑑 5) = 2 (𝑚𝑜𝑑 7)


where 𝑥 is an unknown that satisfies the requirements given in the remainder problem and needs to be
determined.

Moduli involved:

𝑛1 = 3, 𝑛2 = 5, 𝑛3 = 7
Formula of solution in the Sun Zi Suanjing:

𝑥 = 70𝑎1 + 21𝑎2 + 15𝑎3 − 105𝑚


where m = the biggest integer that satisfies:

7
105𝑚 < 70𝑎1 + 21𝑎2 + 15𝑎3 ∋ 𝑎1 = 2, 𝑎2 = 3, 𝑎3 = 2

𝑎1 , 𝑎2 𝑎𝑛𝑑 𝑎3 are the remainders of 𝑥 when 𝑥 is divided by 𝑚1 , 𝑚2 𝑎𝑛𝑑 𝑚3 respectively.

Solution:

𝑥 = 70(2) + 21(3) + 15(2) − 105(2)


𝑥 = 23
Only one solution was given in the Sun Zi Suanjing. The author of Sun Zi Suanjing did not give further
explanation on why the numbers 70, 21 and 15 were chosen nor why a multiple of 105 must be
subtracted from the sum of products that was added up. The method of solution in Sun Zi Suanjing
without further elaboration had raised many queries among researchers who wished to master the
method completely.

During the 11th century, Muslim mathematician Ibn Tahir Al Baghdadi (‫ )ابن طاهر البغدادي‬discussed the
Chinese Remainder Theorem in his treatise AI Takmila fi 'lim ai-Hisab (‫)التكملة في علم الحساب‬. The moduli
that Ibn Tahir gave were the same as Sun Zi Suanjing, which were 𝑛1 = 3 , 𝑛2 = 5 , 𝑛3 = 7. However, his
problem was

𝑥 = 𝑎(𝑚𝑜𝑑 3) = 𝑏(𝑚𝑜𝑑 5) = 𝑐(𝑚𝑜𝑑 7)


which was not entirely the same as Sun Zi Suanjing. It was clear that Ibn Tahir had advanced further in
his discussion of the remainder problem where arbitrary remainders, a, b, and c were given in his
problem.

It is interesting to note that Ibn Tahir was the first mathematician in antiquity to give an explanation
regarding why the numbers 70, 21 and 15 were related to the moduli 3, 5 and 7 respectively. He
explained that for each of the moduli, the related number was obtained by the multiplication of other
moduli involved in the problem, given that they are pairwise relatively prime. After that, division was
performed on the sum of multiplication repeatedly until the final remainder was 1.

The popular Chinese Remainder Theorem found its way to Europe in a famous mathematical treatise by
Italian mathematician Leonardo Fibonacci in 1202 entitled Liber Abaci. Even though the moduli given
were the same, the remainder problem in Liber Abaci

𝑥 = 2 (𝑚𝑜𝑑 3) = 3 (𝑚𝑜𝑑 5) = 4 (𝑚𝑜𝑑 7)


was slightly different than the one in Sun Zi Suanjing in the sense that one of the remainders given was
different. However, the method of solution given in Liber Abaci was entirely the same as Sun Zi Suanjing.

Since Sun Zi Suanjing, the Chinese Remainder Theorem was not found again in any Chinese
mathematical treatises until the 13th century in the book Xugu Zhaiqi Suanfa (The Continuation of
Ancient Mathematical Methods for Elucidating the Strange) in Yang Hui Suanfa (Yang Hui's Methods of
Computation). Yang Hui Suanfa was a compilation of three books by Chinese mathematician Yang Hui in
1278

8
The remainder problem in Xugu Zhaiqi Suanfa was the same as the original remainder problem in the
Sun Zi Suanjing and the same single solution was given for the problem. In Xugu Zhaiqi Suanfa, Yang Hui
clearly stated that he had taken the remainder problem from Sun Zi Suanjing.

Fibonacci was the first European to pave the way for the discussion of the Chinese Remainder Theorem
in his treatise. Later, in the 14th and 15th century Isaac Argyros and Frater Frederius discussed the
remainder problem in their treatises Eisagog·e Arithm'etik'e and Munich Manuscript respectively. Both
gave the problem

𝑥 = 𝑎 (𝑚𝑜𝑑 3) = 𝑏 (𝑚𝑜𝑑 5) = 𝑐(𝑚𝑜𝑑 7)


which was the same as the remainder problem given by the Muslim mathematician Ibn Tahir in Al-
Takmila fi 'Jim al-Hisab in the 11th century.

Since both gave a remainder problem with arbitrary remainders, the solution given for the problem was
general:

𝑥 = 21𝑎 + 15𝑏 + 70𝑐 − 105𝑚, 𝑚 = 𝑖𝑛𝑡𝑒𝑔𝑒𝑟.


Frater Frederius was the only mathematician after Ibn Tahir who offered explanation regarding the
specific number that was related to its respective moduli, an unsolved mystery since Sunzi Suanjing.

It was not surprising that the discussion of the remainder problem in the treatises of Argyros and
Frederius was like that of Ibn Tahir. In general, many European mathematical treatises in antiquity were
greatly influenced by the works of the Muslim mathematicians. Fibonacci was the pioneer of the
European mathematicians who had done research extensively on Muslim mathematical works such as
Tara'if al-Hisab (‫ )تراعف الحساب‬by Abu Kamil (‫)ابو كامل‬. He later incorporated many of the problems into
his great treatise like Liber Abaci. From his treatises, the works of the Muslim mathematicians were
spread to Europe, including the Chinese Remainder Theorem that was originated from China.

4. Uses and applications of the theorem

4.1. Chinese Remainder Theorem for Rings and Domains


From the original theorem dealing with integers, the Chinese Remainder Theorem is expanded into rings
and domains. We now are looking at the Chinese Remainder Theorem that can be formulated for rings
which have pairwise coprime ideals.

In a commutative ring R, two ideals A and B are called coprime if A + B = R.

Note that two principal ideals 〈𝑎〉 and 〈𝑏〉 are coprime in the ring of integers ℤ ⇔ a and b are
relatively prime. Therefore, coprime ideals are analogous to relatively prime integers.

Theorem 4.1: The Chinese Remainder Theorem for Two Ideals:

If 𝑅 is a commutative ring and 𝐼 𝑎𝑛𝑑 𝐽 are proper ideals with

9
𝐼 + 𝐽 = 𝑅, 𝑡ℎ𝑒𝑛 𝑅/(𝐼 ∩ 𝐽) 𝑖𝑠 𝑖𝑠𝑜𝑚𝑜𝑟𝑝ℎ𝑖𝑐 𝑡𝑜 𝑅/𝐼 ⊕ 𝑅/𝐽

Theorem 4.2: The Chinese Remainder Theorem for 𝑛 Ideals:

If 𝑅 is a ring and 𝐼1 , 𝐼2 , … , 𝐼𝑛 are ideals of 𝑅 which are pairwise coprime

i.e. 𝐼𝑖 + 𝐼𝑗 = 𝑅 whenever 𝑖 ≠ 𝑗, and 𝐼 = ⋂𝑛𝑖=1 𝐼𝑖

𝑅/𝐼 is isomorphic to 𝑅/𝐼1 ⊕ 𝑅/𝐼2 ⊕. . .⊕ 𝑅/𝐼𝑛

Theorem 4.3: General Chinese Remainder Theorem for Rings:

Let 𝐼1 , 𝐼2 , … , 𝐼𝑛 be ideals in a ring R such that 𝐼𝑖 + 𝐼𝑗 = 𝑅 ∀𝑖 ≠ 𝑗.

𝐼𝑓 𝑏1 , 𝑏2 , … , 𝑏𝑛 ∈ 𝑅 ⇒ ∃ 𝑏 ∈ 𝑅 ∋ 𝑏 ≡ 𝑏𝑖 (𝑚𝑜𝑑 𝐼𝑖 )𝑓𝑜𝑟 𝑖 = 1, 2, … , 𝑛.

Furthermore, 𝑏 is uniquely determined up to congruence modulo the ideal 𝐼1 ∩ 𝐼2 ∩ … ∩ 𝐼𝑛 .

Just as Theorem 4.2, the ideals are pairwise coprime; however, instead of having the factor ring 𝑅/𝐼
isomorphic to the direct sum of all factor rings, we have the case of the intersection of all ideals which
also combines several moduli to a new, larger modulo.

4.2. Chinese Remainder Theorem for Polynomial Rings


Theorem 4.4: General Chinese Remainder Theorem for Polynomial Rings:

Let 𝐹 be a field and let 𝑏1 (𝑥), 𝑏2 (𝑥), . . . , 𝑏𝑛 (𝑥) be arbitrary polynomials of 𝐹[𝑥],
𝑚1 (𝑥), 𝑚2 (𝑥), … , 𝑚𝑛 (𝑥)𝑎𝑛𝑑 𝑎1 (𝑥), 𝑎2 (𝑥), … , 𝑎𝑛 (𝑥) be polynomials of 𝐹[𝑥] such that

gcd (𝑚𝑖 (𝑥), 𝑚𝑗 (𝑥)) = 1, 𝑖 ≠ 𝑗

gcd(𝑎𝑖 (𝑥), 𝑚𝑖 (𝑥)) = 1, 𝑖 = 1,2, … , 𝑛

Then the system of congruences

𝑎𝑖 (𝑥)𝑢(𝑥) = 𝑏𝑖 (𝑥)(𝑚𝑜𝑑 𝑚𝑖 (𝑥)), 𝑖 = 1,2, … , 𝑛

has exactly one solution modulo 𝑚(𝑥) = 𝑚1 (𝑥)𝑚2 (𝑥) … 𝑚𝑛 (𝑥)

10
4.3. Finite Sequence of Integers
As mentioned in Chapter 1, the first indication of the power of the Chinese Remainder Theorem applies
to finite sequences of integers. For any finite sequence of integers, we can find another two integers to
represent it.

Theorem 4.5: Let 𝑎𝑖 , 0 < 𝑖 < 𝑡, be a finite sequence of nonnegative integers. Then there are integers 𝑢
and 𝑣 ∋ (𝑢 𝑚𝑜𝑑 (1 + (𝑖 + 1)𝑣)) = 𝑎𝑖 ,∀ 𝑖 = 0,1, … , 𝑡

4.4. Cryptography Schemes


The Chinese Remainder Theorem is applied in secret sharing, which is an important topic of
cryptography. The Chinese Remainder Theorem itself is a secret sharing scheme without any
modification. Let 𝑚1 , 𝑚2 , … , 𝑚𝑛 be t pairwise relatively prime positive integers. Also let 𝑚 = ∏𝑡𝑖=1 𝑚𝑖 . -
Suppose that we have a secret which is an integer 𝑠 such that 0 ≤ 𝑠 < 𝑚. Let 𝑃1 , 𝑃2 , … , 𝑃𝑡 be the t
parties who are going to share the secret.

Then 𝑃𝑖 has the residue 𝑠𝑖 ≡ 𝑠 (𝑚𝑜𝑑 𝑚𝑖 ) as the secret that is only known to 𝑃𝑖 . By the Chinese
Remainder Theorem, the 𝑡 pieces of information 𝑠, are sufficient to determine the original 𝑠.

For the 𝑡 parties, if we give out 𝑘 shares, then the secret can be computed; otherwise, 𝑘— 1 shares will
give a possible range of the secret. 𝐴(𝑘, 𝑡) secret-sharing scheme is defined as follows. The 𝑡 parties 𝑃𝑖
share a secret 𝑠 with the following conditions:

1) Each party has a share 𝑠𝑖 about the secret s which is not known to other parties.
2) The secret 𝑠 can be computed from any 𝑘 shares 𝑠𝑖 .
3) No 𝑘— 1 shares 𝑠𝑖 give any information about the secret 𝑠.

The Chinese Remainder Theorem is also used in RSA decryption: Most state-of-art implementations of
RSA use the Chinese remainder theorem to optimize and speed-up decryption and signing.

4.5. Fast Computation


• Fast Fourier Transform:
The prime-factor FFT algorithm or Good-Thomas algorithm reduces the computation of a fast
Fourier transform of size 𝑛1 𝑛2 to the computation of two fast Fourier transforms of smaller sizes
𝑛1 and 𝑛2 which are coprime.

• Parallel computation:
If we have an expensive computational task that involves adding, multiplying, and subtracting
integers on a finite set 𝑆. Then, we can choose primes 𝑝1 , 𝑝2 , … , 𝑝𝑛 which do not divide any

11
element of 𝑆 and split the computation over 𝑟 processors. Afterwards Chinese Remainder
Theorem is used to put the answers back together.

4.6. Mathematics
• Lagrangian interpolation:
Given a set of 𝑘 + 1 data points (𝑥0 , 𝑦0 ), (𝑥1 , 𝑦1 ), … , (𝑥𝑘 , 𝑦𝑘 ) where no two 𝑥𝑗 ’s are the same,
the Lagrangian interpolation tries to fit a polynomial of degree k.

• Hermite interpolation:
Given a set of 𝑘 + 1 data points (𝑥0 , 𝑦0 ), (𝑥1 , 𝑦1 ), … , (𝑥𝑘 , 𝑦𝑘 ), the Hermite polynomial tries to
find out a polynomial of the least possible degree, such that the polynomial and its first
derivatives take given values at the given data points.

• Gödel’s (First) incompleteness theorem:


Proof of the theorem depends on choosing a way to encode formulas and proofs as numbers.
The Chinese remainder theorem has been used to construct such a Gdel numbering for
sequences.

5. Way of solving using Chinese Remainder Theorem


Suppose you have a set of congruences:

𝑥 ≡ 𝑎1 (𝑚𝑜𝑑 𝑚1 )
𝑥 ≡ 𝑎2 (𝑚𝑜𝑑 𝑚2 )
.

𝑥 ≡ 𝑎𝑛 (𝑚𝑜𝑑 𝑚𝑛 )
Where 𝑎1 , 𝑎2 , … , 𝑎𝑛 , 𝑚1 , 𝑚2 , … , 𝑚𝑛 ∈ ℤ

Then the first step to solving it via CRT is:

1) Check if 𝑚1 , 𝑚2 , … , 𝑚𝑛 are all relatively prime. i.e.


gcd(𝑚𝑖 , 𝑚𝑗 ) = 1 ∀𝑖 ≠ 𝑗, 1 ≤ 𝑖, 𝑗 ≤ 𝑛

If step 1 holds we continue else the Chinese Remainder Theorem is inapplicable.

2) Let

12
𝑀
𝑀 = 𝑚1 ∗ 𝑚2 ∗ … ∗ 𝑚𝑛 and 𝑀𝑟 = 𝑚 , 1 ≤ 𝑟 ≤ 𝑛
𝑟
Then the solution is given by:
𝑥 = 𝑎1 ∗ 𝑀1 ∗ 𝑦1 + 𝑎2 ∗ 𝑀2 ∗ 𝑦2 + ⋯ + 𝑎𝑛 ∗ 𝑀𝑛 ∗ 𝑦𝑛

3) 𝑦𝑖 is given by solving the congruence:


𝑀𝑖 𝑦𝑖 ≡ 1 (𝑚𝑜𝑑 𝑚𝑖 ), 1 ≤ 𝑖 ≤ 𝑛

4) Then the solution is given by the equation above where the solution is modulo 𝑀
𝑖. 𝑒. it is modulo 𝑚1 ∗ 𝑚2 ∗ … ∗ 𝑚𝑛

6. Some solved problems


I. Solve the system:

𝑥 ≡ 3 (𝑚𝑜𝑑 7)
𝑥 ≡ 3 (𝑚𝑜𝑑 5)
𝑥 ≡ 4 (𝑚𝑜𝑑 12)
Solution

𝑎1 = 3, 𝑎2 = 3, 𝑎3 = 4, 𝑚1 = 7, 𝑚2 = 5, 𝑚3 = 12
7, 5, and 12 are all relatively prime to each other so we can use CRT

𝐿𝑒𝑡 𝑀 = 7 ∗ 5 ∗ 12 = 420
𝑀 420 420 420
⇒ 𝑀1 = = = 60, 𝑀2 = = 84, 𝑀3 = = 35
𝑚1 7 5 12

⇒ 𝑀1 𝑦1 ≡ 1 (𝑚𝑜𝑑 𝑚1 ) ⇒ 60𝑦1 ≡ 1 (𝑚𝑜𝑑 7) ⇒ 𝑠𝑖𝑛𝑐𝑒 (60,7) = 1 ⇒ 𝑦1 ≡ 60−1 ∗ 1 (𝑚𝑜𝑑 7)


⇒ 𝑦1 ≡ 2 (𝑚𝑜𝑑 7) ⇒ 𝑦1 = 2

⇒ 𝑀2 𝑦2 ≡ 1 (𝑚𝑜𝑑 𝑚2 ) ⇒ 84𝑦2 ≡ 1 (𝑚𝑜𝑑 5) ⇒ 𝑠𝑖𝑛𝑐𝑒 (84,5) = 1 ⇒ 𝑦2 ≡ 84−1 ∗ 1 (𝑚𝑜𝑑 5)


⇒ 𝑦2 ≡ 4 (𝑚𝑜𝑑 5) ⇒ 𝑦2 = 4

⇒ 𝑀3 𝑦3 ≡ 1 (𝑚𝑜𝑑 𝑚3 ) ⇒ 35𝑦3 ≡ 1 (𝑚𝑜𝑑 12) ⇒ 𝑠𝑖𝑛𝑐𝑒 (35,12) = 1 ⇒ 𝑦3 ≡ 35−1 ∗ 1 (𝑚𝑜𝑑 12)


⇒ 𝑦3 ≡ 11 (𝑚𝑜𝑑 12) ⇒ 𝑦3 = 11

13
⇒ 𝑥 = 𝑎1 𝑀1 𝑦1 + 𝑎2 𝑀2 𝑦2 + 𝑎3 𝑀3 𝑦3 = (3 ∗ 60 ∗ 2) + (3 ∗ 84 ∗ 4) + (4 ∗ 35 ∗ 11) = 2908
⇒ 𝑇ℎ𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 2908 (𝑚𝑜𝑑 420)
⇒ 𝑇ℎ𝑒 𝑢𝑛𝑖𝑞𝑢𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 388 (𝑚𝑜𝑑 420)

II. Solve the system:

𝑥 ≡ 2 (𝑚𝑜𝑑 5)
𝑥 ≡ 3 (𝑚𝑜𝑑 7)
𝑥 ≡ 10 (𝑚𝑜𝑑 11)
Solution

𝑎1 = 2, 𝑎2 = 3, 𝑎3 = 10, 𝑚1 = 5, 𝑚2 = 7, 𝑚3 = 11
5, 7, and 11 are all relatively prime to each other so we can use CRT

𝐿𝑒𝑡 𝑀 = 5 ∗ 7 ∗ 11 = 385
𝑀 385 385 385
⇒ 𝑀1 = = = 77, 𝑀2 = = 55, 𝑀3 = = 35
𝑚1 5 7 11

⇒ 𝑀1 𝑦1 ≡ 1 (𝑚𝑜𝑑 𝑚1 ) ⇒ 77𝑦1 ≡ 1 (𝑚𝑜𝑑 5) ⇒ 𝑠𝑖𝑛𝑐𝑒 (77,5) = 1 ⇒ 𝑦1 ≡ 77−1 ∗ 1 (𝑚𝑜𝑑 5)


⇒ 𝑦1 ≡ 3 (𝑚𝑜𝑑 5) ⇒ 𝑦1 = 3

⇒ 𝑀2 𝑦2 ≡ 1 (𝑚𝑜𝑑 𝑚2 ) ⇒ 55𝑦2 ≡ 1 (𝑚𝑜𝑑 7) ⇒ 𝑠𝑖𝑛𝑐𝑒 (55,7) = 1 ⇒ 𝑦2 ≡ 55−1 ∗ 1 (𝑚𝑜𝑑 7)


⇒ 𝑦2 ≡ 6 (𝑚𝑜𝑑 7) ⇒ 𝑦2 = 6

⇒ 𝑀3 𝑦3 ≡ 1 (𝑚𝑜𝑑 𝑚3 ) ⇒ 35𝑦3 ≡ 1 (𝑚𝑜𝑑 11) ⇒ 𝑠𝑖𝑛𝑐𝑒 (35,11) = 1 ⇒ 𝑦3 ≡ 35−1 ∗ 1 (𝑚𝑜𝑑 11)

⇒ 𝑦3 ≡ 6 (𝑚𝑜𝑑 11) ⇒ 𝑦3 = 6

⇒ 𝑥 = 𝑎1 𝑀1 𝑦1 + 𝑎2 𝑀2 𝑦2 + 𝑎3 𝑀3 𝑦3 = (2 ∗ 77 ∗ 3) + (3 ∗ 55 ∗ 6) + (10 ∗ 35 ∗ 6) = 3552
⇒ 𝑇ℎ𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 3552 (𝑚𝑜𝑑 385)
⇒ 𝑇ℎ𝑒 𝑢𝑛𝑖𝑞𝑢𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 87 (𝑚𝑜𝑑 385)

14
III. Solve the following congruence using the Chinese Remainder Theorem:

11𝑥 ≡ 1 (𝑚𝑜𝑑 504)


Solution

The congruence is equivalent to system:

11𝑥 ≡ 1 (𝑚𝑜𝑑 7)
11𝑥 ≡ 1 (𝑚𝑜𝑑 8)
11𝑥 ≡ 1 (𝑚𝑜𝑑 9)

And this system is equivalent to the system:

𝑥 ≡ 2 (𝑚𝑜𝑑 7)
𝑥 ≡ 3 (𝑚𝑜𝑑 8)
𝑥 ≡ 5 (𝑚𝑜𝑑 9)

Now we can use CRT on this system:

𝑎1 = 2, 𝑎2 = 3, 𝑎3 = 5, 𝑚1 = 7, 𝑚2 = 8, 𝑚3 = 9
7, 8, and 9 are all relatively prime to each other so we can use CRT

𝐿𝑒𝑡 𝑀 = 7 ∗ 8 ∗ 9 = 504
𝑀 504 504 504
⇒ 𝑀1 = = = 72, 𝑀2 = = 63, 𝑀3 = = 56
𝑚1 7 8 9

⇒ 𝑀1 𝑦1 ≡ 1 (𝑚𝑜𝑑 𝑚1 ) ⇒ 72𝑦1 ≡ 1 (𝑚𝑜𝑑 7) ⇒ 𝑠𝑖𝑛𝑐𝑒 (72,7) = 1 ⇒ 𝑦1 ≡ 72−1 ∗ 1 (𝑚𝑜𝑑 7)

⇒ 𝑦1 ≡ 4 (𝑚𝑜𝑑 7) ⇒ 𝑦1 = 4

⇒ 𝑀2 𝑦2 ≡ 1 (𝑚𝑜𝑑 𝑚2 ) ⇒ 63𝑦2 ≡ 1 (𝑚𝑜𝑑 8) ⇒ 𝑠𝑖𝑛𝑐𝑒 (63,8) = 1 ⇒ 𝑦2 ≡ 63−1 ∗ 1 (𝑚𝑜𝑑 8)


⇒ 𝑦2 ≡ 7 (𝑚𝑜𝑑 8) ⇒ 𝑦2 = 7

⇒ 𝑀3 𝑦3 ≡ 1 (𝑚𝑜𝑑 𝑚3 ) ⇒ 56𝑦3 ≡ 1 (𝑚𝑜𝑑 9) ⇒ 𝑠𝑖𝑛𝑐𝑒 (56,9) = 1 ⇒ 𝑦3 ≡ 56−1 ∗ 1 (𝑚𝑜𝑑 9)


⇒ 𝑦3 ≡ 5 (𝑚𝑜𝑑 9) ⇒ 𝑦3 = 5

15
⇒ 𝑥 = 𝑎1 𝑀1 𝑦1 + 𝑎2 𝑀2 𝑦2 + 𝑎3 𝑀3 𝑦3 = (2 ∗ 72 ∗ 4) + (3 ∗ 63 ∗ 7) + (5 ∗ 56 ∗ 5) = 3299
⇒ 𝑇ℎ𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 3299 (𝑚𝑜𝑑 504)
⇒ 𝑇ℎ𝑒 𝑢𝑛𝑖𝑞𝑢𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 275 (𝑚𝑜𝑑 504)

IV. Solve the system using CRT:

𝑥 ≡ 3 (𝑚𝑜𝑑 5)
𝑥 ≡ 1 (𝑚𝑜𝑑 6)
𝑥 ≡ 6 (𝑚𝑜𝑑 8)
Solution

5, 6, and 8 are all mutually prime but 6,8 are not relatively prime

𝑖. 𝑒. (5, 6, 8) = 1 𝑏𝑢𝑡 (6, 8) ≠ 1


Therefore, CRT is inapplicable in this system of congruences.

V. Solve the following congruence using CRT:

5𝑥 ≡ 3 (𝑚𝑜𝑑 14)
Solution

The congruence is equivalent to system:

5𝑥 ≡ 3 (𝑚𝑜𝑑 2)
5𝑥 ≡ 3 (𝑚𝑜𝑑 7)

And this system is equivalent to the system:

𝑥 ≡ 3 (𝑚𝑜𝑑 2)
𝑥 ≡ 9 (𝑚𝑜𝑑 7) ≡ 2 (𝑚𝑜𝑑 7)

2, and 7 are relatively prime so we can use CRT:

𝑎1 = 3, 𝑎2 = 2, 𝑚1 = 2, 𝑚2 = 7

16
𝐿𝑒𝑡 𝑀 = 2 ∗ 7 = 14
𝑀 14 14
⇒ 𝑀1 = = = 7, 𝑀2 = =2
𝑚1 2 7

⇒ 𝑀1 𝑦1 ≡ 1 (𝑚𝑜𝑑 𝑚1 ) ⇒ 7𝑦1 ≡ 1 (𝑚𝑜𝑑 2) ⇒ 𝑠𝑖𝑛𝑐𝑒 (7,2) = 1 ⇒ 𝑦1 ≡ 7−1 ∗ 1 (𝑚𝑜𝑑 2)


⇒ 𝑦1 ≡ 1 (𝑚𝑜𝑑 2) ⇒ 𝑦1 = 1

⇒ 𝑀2 𝑦2 ≡ 1 (𝑚𝑜𝑑 𝑚2 ) ⇒ 2𝑦2 ≡ 1 (𝑚𝑜𝑑 7) ⇒ 𝑠𝑖𝑛𝑐𝑒 (2,7) = 1 ⇒ 𝑦2 ≡ 2−1 ∗ 1 (𝑚𝑜𝑑 7)

⇒ 𝑦2 ≡ 4 (𝑚𝑜𝑑 7) ⇒ 𝑦2 = 4

⇒ 𝑥 = 𝑎1 𝑀1 𝑦1 + 𝑎2 𝑀2 𝑦2 = (3 ∗ 7 ∗ 1) + (2 ∗ 2 ∗ 4) = 37
⇒ 𝑇ℎ𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 37 (𝑚𝑜𝑑 14)
⇒ 𝑇ℎ𝑒 𝑢𝑛𝑖𝑞𝑢𝑒 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑖𝑠 𝑥 ≡ 9 (𝑚𝑜𝑑 14)

17
7. Sources
http://www.gimnazija-izdijankoveckoga-kc.skole.hr/upload/gimnazija-izdijankoveckoga-
kc/multistatic/437/Mathematical_Olympiad_in_China-Problems_and_Solutions.pdf

https://www.digitmath.com/chinese-indian-islamic-mathematics.html

https://www.quora.com/What-contributions-has-China-made-to-the-field-of-Mathematics

https://people.math.harvard.edu/~knill/crt/lib/Kangsheng.pdf

https://kconrad.math.uconn.edu/blurbs/ugradnumthy/crt.pdf

https://sms.math.nus.edu.sg/Smsmedley/Vol-30-
1/The%20History%20of%20the%20Chinese%20Reminder%20Theorem%20(Law%20Huang%20lng).Pdf

https://scholarworks.lib.csusb.edu/cgi/viewcontent.cgi?article=4457&context=etd-project

https://debabrota-basu.github.io/slides/cs1231r_crt.pdf

18

You might also like