Chinese Remainder Theorem

From Notes
Jump to navigation Jump to search

Let p and q be positive integers such that gcd(p,q)=1.

For two integers x and y, there exists an integer a such that

axmodpaymodq

if b satisfies the same equivalences as a above, then

abmodpq

Namely,

axq(1q(modp))+yp(1p(modq))(modpq)


Proof

Since gcd(p,q)=1, there exist integers p and q such that

gcd(p,q)=1=pp+qq

In particular, we have

qq1modppp1modq

Multiply both sides of the equivalence by x and y respectively…

xqqxmodpyppymodq

The integer a represents the sum of these two equivalences.

a=ypp+xqq

This is true because

ypp+xqq0+xmodpypp+xqqy+0modqaxmodpaymodq

Suppose another integer a also satisfies the equivalences above:

axmodpaymodq

Therefore for some k

aamodpaa=kp

However, aa is divisible by both p and q, which means that kp must also be divisible by q.

kp0modpobviouslykp0modq

p and q are coprime (gcd(p,q)=1; they do not divide each other), so the second equivalence implies that k must be divisible by q.

Therefore, aa must be divisible by pq, so as claimed,

aamodpq
Q.E.D.