The textbook I am reading (A Friendly Introduction to Number Theory) is proving that when $m$ and $n$ are coprime $ \phi(mn) = \phi(m)\phi(n)$ by defining two sets:
- All of the numbers a where $a$ and $mn$ are coprime (where $1 \le a < mn$)
- All pairs of numbers (b, c) where $b$ and $m$ are coprime and $c$ and $n$ are coprime ($1 \le b < m$ and $1 \le c < n$)
and then proving that their sizes are equal.
It does this in two steps:
- "Different numbers in the first set get sent to different pairs in the second set."
- "Every pair in the second set is hit by some number in the first set."
The second part is the one I don't understand. To prove it, the book just defines the Chinese Remainder Theorem and declares the proof complete. But as far as I understand, the Chinese Remainder Theorem defines a bijection between $\mathbb Z_{pq}$ and $\mathbb Z_p \times \mathbb Z_q$, and not the two sets they've defined above.
How is it proven that the number "hit" in the second set actually came from the first set and not some other element in $\mathbb Z_{pq}$ ?
Elementary Proof
Let $p$ and $q$ be coprime. The Chinese remainder theorem defines a bijection $\psi:\mathbb{Z}_p\times\mathbb{Z}_q\rightarrow\mathbb{Z}_{pq}$ given by $\psi(a,b)=qa+pb\pmod{pq}$. The crux, and missing detail of the proof in your book is that (LEMMA) for any $(a,b)\in\mathbb{Z}_p\times\mathbb{Z}_q$, we have that $\gcd(qa+pb,pq)=1$ iff $\gcd(a,p)=\gcd(b,q)=1$. This lemma eqivalently tells us that $\psi$ restricts to a bijection between from the set $\{(a,b)\in\mathbb{Z}_a\times\mathbb{Z}_b:\gcd(a,q)=\gcd(b,p)=1\}$ to the set $\{c\in\mathbb{Z}_{pq}:\gcd(c,pq)=1\}$, and thus that $\varphi(p)\varphi(q)=\varphi(pq)$. We prove this lemma below.
First, we prove $(\Rightarrow)$. Let $\gcd(qa+pb,pq)=1$, then if $n$ is a divisor of both $a$ and $p$, it must also divide $qa+pb$ and $pq$, so $n$ would have to divide $\gcd(qa+pb,pq)=1$, meaning that $n=1$. Since the only natural $n$ that divides both $a$ and $p$ is $n=1$, then $\gcd(a,p)=1$. We can repeat this same argument to show that $\gcd(b,q)=1$.
We now prove $(\Leftarrow)$. Let $\gcd(a,p)=\gcd(b,q)=1$. Since $q,a$ are both coprime to $p$ and $p,b$ are both coprime to $q$, then $\gcd(qa,p)=\gcd(pb,q)=1$. Since $p,q$ are coprime, then \begin{equation} \begin{split} \gcd(qa+pb,pq)&=\gcd(qa+pb,p)\gcd(qa+pb,q)\\ &=\gcd(qa,p)\gcd(pb,q)\\ &=1 \end{split} \end{equation} by the properties of the $\gcd$. This completes our proof of the lemma.
More Abstract Proof
Let's first define a useful concept. For any ring $R$, we may define $R^\times$ to be the set of units (elements with an inverse) of $R$; this is in fact a group under the multiplication operator inherited from $R$, and is known as the unit group of $R$.
It is not hard to see that the units of $\mathbb{Z}_n$ are simply the elements $[k]\in\mathbb{Z}_n$ such that $k$ is coprime to $n$. In other words, $|\mathbb{Z}_n^\times|=\varphi(n)$.
Now, the Chinese remainder theorem tells us that if $p,q$ are coprime, then there exists a ring isomorphism $\psi:\mathbb{Z}_{pq}\rightarrow\mathbb{Z}_p\times\mathbb{Z}_q$. Since $\psi$ is a ring isomorphism, then it must also restrict to a group isomorphism $\mathbb{Z}_{pq}^\times\rightarrow(\mathbb{Z}_p\times\mathbb{Z}_q)^\times$. Combining this with the fact that $(\mathbb{Z}_p\times\mathbb{Z}_q)^\times\cong\mathbb{Z}_p^\times\times\mathbb{Z}_q^\times$, we have that $\mathbb{Z}_{pq}^\times\cong\mathbb{Z}_p^\times\times\mathbb{Z}_q^\times$, and thus \begin{equation} \varphi(pq)=|\mathbb{Z}_{pq}^\times|=|\mathbb{Z}_p^\times|\cdot|\mathbb{Z}_q^\times|=\varphi(p)\varphi(q) \end{equation} as desired.