- Reference 1: Brilliant – Chinese Remainder Theorem [4]
- Reference 2: YouTube – Extended Euclidean Algorithm Tutorial
Theorem A-13.1 Chinese Remainder Theorem
Suppose we have positive coprime integers . Let . We sample random integers from each modulo domain (i.e., , , , ). Then, there exists one and only one solution such that is congruent with in each modulo . That is:
To compute , we first compute each and (for ) as follows:
Note that each ’s inverse (i.e., ) can be computed by using the Extended Euclidean algorithm (watch the YouTube tutorial). Then, the unique solution can be computed as follows:
# Alternatively, we can compute (where )
Since such is unique in , there are isomorphic mappings between and .
Also, for all
Proof.
# because for all , as they are a multiple of
# because
Thus, the value of in each modulo is congruent with .
Alternatively, note that the following is also true:
Then, by definition of modulo congruence, .
Also, since are coprime, it must be the case that , or . This means that . Therefore, is a unique solution in modulo .
In the case of modulo , , since is an inverse of modulo . In the case of all other modulo where , , because and thus divides .
By squaring both sides of , we get . Similarly, by squaring both sides of , we get .
Therefore, , and . In other words, for all .
Then, we do the similar reasoning as step 2: since every co-prime divides , divides . Thus, , which is . This is true for all .