Number theory MOC

Chinese remainder theorem

The Chinese remainder theorem states that given a set of pairwise co-prime numbers {𝑝1,𝑝2,…,𝑝𝑛} with a product 𝑀 =∏𝑛𝑖=1𝑝𝑖, then the following set of congruence equations

𝑥≡𝑝1𝑎1𝑥≡𝑝2𝑎2⋮𝑥≡𝑝𝑛𝑎3

is guaranteed a solution, unique up to congruence modulo 𝑀.

Solution

For 𝑖 =1,2,…,𝑛, define 𝑏𝑖 so that

𝑏𝑖(𝑀𝑝𝑖)≡𝑝𝑖1

which is guaranteed to exist by Bézout's lemma and the co-prime requirement, then the value of 𝑥 is given by

𝑥≡𝑀𝑛∑𝑖=1𝑎𝑖𝑏𝑖(𝑀𝑝𝑖)

This works since every term except the 𝑖-th term goes to 0 modular 𝑝𝑖, and thus

𝑥≡𝑝𝑖𝑎𝑖𝑏𝑖(𝑀𝑝𝑖)≡𝑝𝑖𝑎𝑖⋅1≡𝑎𝑖

This is generalized by the Chinese remainder theorem for rings

Practice problems


#state/tidy | #lang/en | #SemBr | #review