Number Theory – $x \equiv a \pmod{p}$ and $x \equiv a \pmod{q}\iff x \equiv a\pmod{pq}$: Constant Case CRT

chinese remainder theoremelementary-number-theorymodular arithmeticnumber theory

Prove $x \equiv a \pmod{p}$ and $x \equiv a \pmod{q}$ then $x \equiv a\pmod{pq}$ for $p\neq q$ distinct primes.

Where can I start with this proof?
It looks similar to the Chinese Remainder Theorem, but that deals with two different a values.

Best Answer

A few proofs of the ubiquitous $\small \bf CCRT = \bf{Constant\!\!-\!\!case \ CRT}\,$ [Chinese Remainder Theorem].

Theorem (CCRT) $\rm\ \ \ \begin{align}&\rm x\equiv a\!\!\pmod{\!p}\\ &\rm x\equiv a\!\!\pmod{\!q}\end{align}\!\iff x\equiv a\pmod{\!pq}\,$ if $\rm\,p,q\,$ are coprime,

$\rm\qquad said\ equivalently\!:\quad p,q\mid x-a\iff pq\mid x-a,\ $ if $\ \rm p,q\,$ are coprime

$\rm\qquad said\ equivalently\!:\qquad\ \ \ lcm(p,q)\, =\, pq,\ \ if\ \ p,q\,$ are coprime

Proof $\ $ For variety we give a few different proofs.

$\rm(1)\ \ \ x \equiv a\pmod {\!pq}\:$ is clearly a solution, and the solution is $\color{#C00}{unique}$ mod $\rm\,pq\,$ by CRT. $ $ [Note: rotely applying the common CRT formula also yields this obvious solution].

$\rm(2)\ \ \ p,q\:|\:x\!-\!a\iff lcm(p,q)\:|\:x\!-\!a\:$ by the Universal Property of $\rm lcm$.
$\qquad\! $ Further $\rm\:(p,q)=1^{\phantom{|^|}}\!\!\!\!\iff lcm(p,q) = pq,\,$ by this answer.

$(3)\ \, $ By Euclid's Lemma: $\rm\:(p,q)=1,\ p\:|\:qn =\:x\!-\!a\:\Rightarrow\:p\:|\:n\:\Rightarrow\:pq\:|\:nq = x\!-\!a.$

$\rm(4)\ \, $ The list of prime factors of $\rm\,p\,$ occurs in one factorization of $\,\rm x-a\,$, and the disjoint list of prime factors of $\rm\,q\,$ occurs in another. By $\color{#C00}{uniqueness}$, the prime factorizations are the same up to order, so the concatenation of these disjoint lists of primes occurs in $\rm\,x-a,\,$ hence $\rm\,pq\mid x-a$.

$\rm(5)\ \, $ Applying the mod Distributive Law, a handy operational form of CRT

$$\rm p\mid x\!-\!a\,\Rightarrow\, x\!-\!a\bmod pq = p\left[\dfrac{\color{#c00}{x\!-\!a}}p\bmod q\right] = p[\color{#c00}0]=0\ \ {\rm by}\ \ \color{#c00}{x\equiv a}\!\!\!\pmod{\!q}\qquad$$

Remark $\ $ This constant-case optimization of CRT arises frequently in practice so is well-worth memorizing, e.g. see some prior posts for many examples.

Quite frequently $\color{#C00}{uniqueness}$ theorems provide powerful tools for proving equalities.

More generally this idea works for values & moduli in A.P. $\ $ if $\,(a,b) = 1\,$ then

APCRT $\ \ \left\{\,x\equiv d\!-\!ck\!\pmod{b\!-\!ak}\,\right\}_{k=0}^{n}\!\!\iff\! x\equiv \dfrac{ad\!-\!bc}a\!\!\!\pmod{{\rm lcm}\{b\!-\!ak\}_{k=0}^n}$
$ $ e.g. here $\ \underbrace{\left\{\,x \equiv 3-k\pmod{7-k}\,\right\}_{k=0}^2}_{\!\!\!\!\!\!\textstyle{x\equiv 3,2,1\pmod{\!7,6,5}}}\!\iff x\equiv \dfrac{1(3)\!-\!7(1)^{\phantom{|^{|^|}}}}1\equiv -4\pmod{\!210}$