Chinese Remainder Theorem

Theorem
Let $a, b \in \Z$.

Let $r$ and $s$ be coprime integers.

Then:
 * $a \equiv b \pmod {r s}$ $a \equiv b \pmod r$ and $a \equiv b \pmod s$

where $a \equiv b \pmod r$ denotes that $a$ is congruent modulo $r$ to $b$.

Necessary Condition
This is proved in Congruence by Divisor of Modulus.

Note that for this result it is not required that $r \perp s$.

Sufficient Condition
Now suppose that $a \equiv b \pmod r$ and $a \equiv b \pmod s$.

We have by definition of congruence:
 * $a \equiv b \pmod r \implies \exists k \in \Z: a - b = k r$

From $a \equiv b \pmod s$ we also have that:
 * $k r \equiv 0 \pmod s$

As $r \perp s$, we have from Common Factor Cancelling in Congruence:
 * $k \equiv 0 \pmod s$

So:
 * $\exists q \in \Z: a - b = q s r$

Hence by definition of congruence:
 * $a \equiv b \pmod {r s}$