Suppose we have a system of congruences with different moduli:
The \(gcd\) of all \(n_i\) pairs is 1. Let's define \(N\) as:
And let's define \(N_i\) as:
\(N_3\) is the multiplication of all \(n_i\) except \(n_3\). Since \((n_1, n_3)=1\) and \((n_2, n_3)=1\), then \((n_1n_2, n_3)=1\) using this lemma. This way we can also derive \((n_1n_2n_4, n_3)=1\), and we can further say \((N_3,n_3)=1\). By similar reasoning, we can say the same for any \(N_i\):
Using using lemma, we can conclude there exists an inverse:
Since \(N_i\) contains a factor of \(n_j\) where \(i \ne j\), then:
Consider:
If we take mod \(n_1\):
If we take mod \(n_2\):
If we take mod \(n_k\):
This means:
Which means \(A\) is a valid solution for \(x\). Now let \(y ≡ b_i \mod n_i\), \(x-y ≡ 0 \mod n_i\) If \(n_1 | (x-y)\), \(n_2 | (x-y)\), ..., \(n_k | (x-y)\), then using this lemma we can conclude \(N|x-y\), or:
This means that the solution is unique, meaning that there is only one solution modulo \(N\).