The Chinese remainder theorem is one of the most useful and important foundation theorems regarding cryptography and modular arithmetic.
has a unique solution
This is useful in reverse direction too, that is, if a congruence works for a modulo which is a multiplication of coprimes, then it will work for those coprimes individually.
We take
or
We know
To prove the theorem, we need to compute a solution for the system of congruences and prove the solution is unique having
is a trivial but general solution for every congruence. This is quite obvious, we didn't do basically anything since
This could look scary at first but we just summed every
Let's see why the previous solution works for
(it would be
if we take into consideration
and the same goes for
(etc. if we consider the general case) proving correctness and uniqueness. Uniqueness is more subtle, note that 'uniqueness' doesn't mean this is the only solution which solve the system, but that this solution is is unique modulo
solves
and
simultaneously and uniquely. Generalizing for
this solves
simultaneously and uniquely.
We could write for example
To better clarify the first example which is not obvious let's delve it. (Also note that
This theorem is more powerful than what it looks.
Suppose we have a couple numbers
Let's now try to solve
Finding the solutions to this congruence means finding the square roots of
Now, since the latter two congruences will have both
_ 1st solution _
_ 2nd solution _
_ 3rd solution _
_ 4th solution _
_ 1st solution _
This was quite obvious, but it's always better to verify.
_ 2nd solution _
_ 3rd solution _
_ 4th solution _
Resume
Indeed, recalling
These 4 numbers obtained are called the square roots of unity of