Lecture 8 - Chinese Remainder Theorem and Wilson's Theorem

Recap & Summary

Last class period we talked about solving linear congruence equations. Among other techniques, we discussed multiplicative inverses and how they can be used to help solve equations. Along the way we made the statement

$5x \equiv 2 \mod{67}$ if and only if $27\cdot 5x \equiv 27\cdot 2 \mod{67}$

We did this because 27 is the multiplicative inverse of 5. But recall that we have

Lemma: $cx \equiv cy \mod{m}$ if and only if $x \equiv y \mod{\frac{m}{(c,m)}}$.

In light of this result, our multiplication by 27 on both sides of the equivalence above requires that we have $(27,67) = 1$. We could have checked this by using the Euclidean Algorith, but we claim that we could instead prove

If b is the multiplicative inverse of a modulo m, then $(b,m) = 1$.

To see that this is true, notice that if b is the multiplicative inverse of a, then a must be the multiplicative inverse of b. Now since b has a multiplicative inverse modulo m, we know that we must have $(b,m) = 1$.

In today's class, we'll be discussing the Chinese Remainder Theorem and Wilson's Theorem. The former is a technique for finding simultaneous solutions to multiple congruence equations, whereas the latter is a congruence equation which characterizes primes.

# The Chinese Remainder Theorem

Recall that in the last class period we showed that the congruence equations

(1)
\begin{align} \begin{split} x &\equiv 1 \mod{2} \\ x &\equiv 2 \mod{3} \end{split} \end{align}

has integer solutions $x = -1,5,11,\cdots$. The way we came about these solutions was simply by using a "guess and check" technique. What we'd like to do is to develop a more systematic way of coming at this problem. For that, we have

The Chinese Remainder Theorem: If $m_1,\cdots,m_k$ are pairwise relatively prime integers, then the congruence equations $x \equiv a_i \mod{m_i}$ for each $1 \leq i \leq k$ have a unique solution modulo $\prod_{i=1}^k m_i$.

Proof: We'll break the proof into two pieces: first we'll construct a simultaneous solution to the given congruences, and then we'll show this solution is unique in the given modulus.

To start, we'll define $M = \prod_{j=1}^k m_j$, and for each $1 \leq i \leq k$ we'll write $N_i$ for $\frac{M}{m_i}$. Now since the $m_i$ are pairwise relatively prime, you showed in your homework (in the course of #43(c) in chapter 1) that $(N_i,m_i) = 1$. Hence for every i, there exists an integer $x_i$ which satisfies $N_ix_i \equiv 1 \mod{m_i}$.

With the $N_i,x_i$ so constructed, we claim that

(2)
\begin{align} x = N_1x_1a_1 + \cdots + N_kx_ka_k \end{align}