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 this lemma, we can conclude there exists an inverse:
Since \(b_i ≡ b_i \bmod n_i\):
Since \(N_j\) contains a factor of \(n_i\) where \(i \ne j\), then:
This means:
Similarly:
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 \bmod n_i\), \(x-y ≡ 0 \bmod 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\).