State and Prove Chinese Remainder Theorem.
Chinese Remainder Theorem. Let $n_{1},~ n_2,~ \cdots,~ n_r$ be positive integers such that $gcd(n_i, n_j) = 1$ for $i \not = j$. Then the system of linear congruences
$x \equiv a_{1} ~(mod ~n_{1})$
$x \equiv a_2 ~(mod~ n_2)$
$x \equiv a_3~ (mod~ n_3)$
$\vdots$
$x \equiv a_r~ (mod ~n_r)$
has a simultaneous solution, which is unique modulo the integer $n_{1} \cdot n_2 \cdot n_3 ~\cdots~ n_r$.
Proof: Consider $n = n_{1} \cdot n_2 \cdot n_3 ~\cdots~ n_r$. Let $N_k = \dfrac{n}{n_k} = n_{1} \cdot n_2 \cdot n_3 ~\cdots~ n_{k-1} \cdot n_{k+1} ~\cdots ~n_r $ for each $k = 1, ~2, ~3,~ \cdots, ~r $ i.e. $N_k$ is the product of all the integers $n_i$; with the factor $n_k$ omitted. Since $gcd(n_i, n_j) = 1$ for $i \not = j$, we will have $gcd(N_k, n_k) = 1$. By Theorem, the linear congruence $N_k ~x \equiv 1 ~(mod ~n_k)$, has a solution; call the unique solution $x_k$. We claim that the integer
$\bar{x} = a_{1} \cdot N_{1} \cdot x_{1} + a_2 \cdot N_2 \cdot x_2 + \cdots + a_r \cdot N_r \cdot x_r$ is a simultaneous solution of the given system. Since $n_k ~|~ N_i$ for $k \not = i$, we get $N_i \equiv 0 ~(mod~ n_k)$. This gives that $\bar{x} = a_{1} \cdot N_{1} \cdot x_{1} + a_2 \cdot N_2 \cdot x_2 + \cdots + a_r \cdot N_r \cdot x_r \equiv a_k \cdot N_k \cdot x_k ~(mod ~n_k) $. But $x_k$ is a solution of the linear congruence $N_k x \equiv 1 ~(mod ~n_k)$, so that $\bar{x} = a_{1} \cdot N_{1} \cdot x_{1} + a_2 \cdot N_2 \cdot x_2 + \cdots + a_r \cdot N_r \cdot x_r \equiv a_k \cdot 1 \equiv a_k ~(mod ~n_k) $. This shows that a solution to the given system of congruences exists.
Now, we prove the uniqueness of the solution. Suppose that $x'$ is any other integer that satisfies these congruences. Then
$\bar{x} \equiv a_k \equiv x' ~(mod ~n_k) $ where $ k = 1,~ 2,~ \cdots,~ r$. and so $n_k ~|~ \bar{x} -x'$ for each value of $k$. Since $gcd(n_i, n_j) = 1$, by Corollary, $n_{1} \cdot n_2 ~ \cdots~ n_r ~|~ \bar{x} -x'$; hence $\bar{x} \equiv x' ~(mod ~n)$. Hence solution to given system of linear congruences is unique.