0

Let $p$ and $q$ be two distinct odd prime numbers. Consider the following congruence equations:

$$x \equiv 1 \pmod{p}$$ $$x \equiv 1 \pmod{q}$$

It is obvious that $x \equiv 1 \pmod{pq}$. But I am trying to prove it in a certain way, and I cannot find the appropriate argument.

Let $p^{-1}$ and $q^{-1}$ denote the inverse of $p$ and $q$ in $\pmod q$ and $\pmod p$ respectively. Then $$x \equiv p \cdot p^{-1} + q \cdot q^{-1} \equiv 1 \pmod{pq}$$

I am trying to directly show that $p \cdot p^{-1} + q \cdot q^{-1} \equiv 1 \pmod {pq}$.

To be more explicit we know $qq^{-1} \equiv 1 \pmod p \Rightarrow qq^{-1} = pk + 1 \Rightarrow q^{-1} = \frac{pk+1}{q}$ and similarly $pp^{-1} = qk'+1 \Rightarrow p^{-1} =\frac{qk'+1}{q}$

so it follows that

$$x \equiv p \frac{qk'+1}{p} + q \frac{pk+1}{q} = qk' + 1 + pk + 1 = qk' + pk + 2 \pmod {pq}$$

I do not know how to transform this expression to conclude that $qk' + pk + 2 \equiv 1 \pmod {pq}$

Josh
  • 1,086
  • 4
  • 15
  • Your defns of $p^{-1}, q^{-1}$ have $\mod q$ twice. – JMP Jan 31 '23 at 09:43
  • 1
    Be careful with the accepted answer - in partcular it implicitly shifts betrween congruences mod $p$ & $q$ to congruences mod $pq$ without any explicit justification. I explicitly explain how to do that in my answer - since this is often troubling to students. If this were a homework problem you would be expected to rigorously justfiy that. Ditto for implicit use of uniqueness of inverses. – Bill Dubuque Feb 01 '23 at 00:32
  • @BillDubuque Thanks for pointing it out. The reason that I accepted it is that it is the only answer that specifically addressed my question given the specific proof I was looking for. It dealt with collecting those $1$'s in $qk' + 1 + pk + 1$. Otherwise, I really liked your answer too. – Josh Feb 01 '23 at 00:41
  • 1
    I further expanded my answer to elaborate on various points. If anything remains unclear the let me know so I can elaborate. – Bill Dubuque Feb 02 '23 at 21:39

4 Answers4

4

Note that if you already know the uniqueness criterion for CRT then the sought result is immediate, i.e. both $\,\color{#0a0}{x_0 = 1}\,$ and the CRT formula $\,x_1 = p(p^{-1}\!\bmod q) + q(q^{-1}\!\bmod p)$ are clearly solutions of the system $\,x\equiv 1\pmod{\!p},\ x\equiv 1\pmod{\!q},\,$ so by $\rm\color{#c00}{ U =}$ uniqueness $\,x_1\overset{\rm\color{#c00}U}\equiv \color{#0a0}{x_0\equiv 1}\pmod{\!pq}$.

Your question essentially asks for a (direct) proof of the uniqueness criterion. It is easy to show that the uniqueness criteria for [C]CRT, linear diophantine equations, and modular inverses are all equivalent (to Euclid's lemma and many other closely related basic results). Below is a direct proof via inverse uniqueness (with a trivial one-line proof) & $\rm\color{#0a0}{Bezout\ identity}$ for $\gcd(p,q)=1$.

There are $\,p',q'\in\Bbb Z\,$ with $\,\color{#0a0}{pp'\!+\!qq' = 1},\,$ so $\, \color{0a0}{pp'\equiv 1}\pmod{\!\color{darkorange1}q},\,$ so by inverse uniqueness $\,p^{-1}\equiv p'\!\pmod{\!q},\,$ so $\, p^{-1^{\phantom{|^|}}}\!\!\! = p'\!+\!iq,\,$ some $\,i\in\Bbb Z.\,$ Similarly $\,q^{-1^{\phantom{|^|}}}\!\!\! = q'\!+\!jp,\,$ some $\,j\in \Bbb Z,\,$ therefore $\, \color{#90f}{pp^{-1}\!+qq^{-1^{\phantom{|^|}}}}\!\!\! = p(p'\!+\!iq)+q(q'\!+\!jp)$ $ = pp'\!+\!qq'^{\phantom{|^|}}\!\!\!+\color{#c00}{pq}(i\!+\!j)\:\!\equiv_{\color{#c00}{pq}}\:\!\color{#0a0}{pp'\!+\!qq'\, [= 1]}$

Remark $ $ No answer actually "deals with the $\color{#0af}{1\!+\!1}$" -- which arise from your change from working with inverses $p^{-1},q^{-1}$ to working with their $\color{#c00}{{\rm negatives}\ \,k,k'}\,$ (which has the following effect on the Bezout identity summands: $\,i+j = 1\iff \color{#c00}{-i}+(\color{#c00}{-j})+\color{#0af}{2}=1).\,$ Rather, we eliminate the more unwieldly negative inverses by changing back to $\,p^{-1},q^{-1},\,$ i.e. read your last displayed equations in reverse to get $\,\color{#c00}kp+\color{#c00}{k'}q+\color{#0af}2 = \color{#90f}{p^{-1}p+q^{-1}p},\,$ which is $\color{#0a0}{\equiv 1\pmod{pq}}\,$ as proved above.

As usual, these matters are clarified arithmetically when viewed via the (product) ring form of CRT (see here for a simple intro requiring no knowledge of ring theory). Namely, your change to use of $\rm\color{#c00}{negated}$ inverses $\,\color{#c00}{k\equiv_q -p^{-1}}\,$ and $\,\color{#c00}{k'\equiv_p -q^{-1}}\,$ corresponds to a basis change to the negated standard basis $\,(0,\color{#c00}{-1}),(\color{#c00}{-1},0)\,$ vs. the normal standard basis $\,(0,1),(1,0).\,$ Then your final equation arises by negating the Bezout equation $\rm E$ then adding $\,\color{#0af}2,\,$ i.e. $\,\rm E\to -E\to \color{#0af}2+E,\,$ i.e.

$$\begin{align} \ \overbrace{(0,1)\ +\ (1,0)\ \equiv \ (1,1)}^{\textstyle\!\! \color{#90f}{p^{-1}p\ +\,\ q^{-1}q}\ \equiv\ 1\ \ \ \ \ } \!\overset{\rm -E}\iff \ \overbrace{(0,\color{#c00}{-1})+ (\color{#c00}{-1},0)\ \equiv \ (\color{#c00}{-1,-1})}^{\textstyle\!\!\!\!\!\!\!\!\!\!\!\!\!\!\color{#c00}{-p^{-1}}p\, \ \color{#c00}{-\ \ q^{-1}}q\, \ \ \equiv \ \ {-}1} \\[.7em] \underset{\rm \color{#0af}2\,+\,E^{\phantom |}\!}\iff\ \ \underbrace{\color{#0af}{(2,2)}+ (0,\color{#c00}{-1})+(\color{#c00}{-1},0)\ \equiv\ (1,1)}_{\textstyle\!\!\! \color{#0af}{2}\ \ \ +\ \ \ \color{#c00}kp\ \ \ \ +\ \ \ \ \color{#c00}{k'}q\ \ \equiv\ \ 1}\quad\ \ \end{align}\qquad\qquad$$

Thus the three above congruences $\!\bmod{pq}\,$ are all trivially equivalent, so it suffices to prove any one of them. It is easiest to prove the first (as we did above) since it connects more immediately to the intuitive arithmetical notion of inverses and their uniqueness. As is often true in algebraic proofs, a slight algebraic transformation of equations may transform them into a form which better reveals innate arithmetical structure facilitating intuition and proof. As such we should strive to transform towards such intuitive forms - not away from them (as do the above transforms to negated inverses and basis).

Bill Dubuque
  • 272,048
  • Or, directly, if congruence scaling is known: we can scale $,p^{-1}\equiv p'!\pmod{!q},$ by $,p,$ to get $,pp^{-1}\equiv pp'\pmod{!pq},$ and similarly get $,qq^{-1}\equiv qq'\pmod{!pq},,$ then add them. $\ \ $ – Bill Dubuque Jan 31 '23 at 10:00
  • 1
    Beware that it is a bit risky to denote $,p^{-1}\bmod q,$ by $,p^{-1}$ (vs. $,p^{-1}_{:!q},$ or other notation that makes explicit the dependence on the modulus $,q),$ because it faciltates (common) errors that occur when ignoring the dependence on the modulus. – Bill Dubuque Feb 02 '23 at 22:01
1

So what you're missing is control over $k, k'$. These aren't just arbitrary numbers. How can we determine these values?

By Bezout, there exists integers such that $ pa + qb = 1$.
Then, $ p^{-1} \equiv a \pmod{q}$ and $ q^{-1} \equiv b \pmod{p}$.
Hence, $p p^{-1} + q q^{-1} \equiv pa + qb \equiv 1 \pmod{pq}$.


If we wanted to pursue your approach, then $a \equiv p^{-1} = \frac{qk'+1}{p}$, $b \equiv q^{-1} = \frac{pk+1}{q}$.
So $ qk'+1 + pk+1 \equiv pa + qb \equiv 1 \pmod{pq}$

Calvin Lin
  • 68,864
  • The implicit shifting between congruences mod $p$ & $q$ to congruences mod $pq$ will likely lead to problems for many beginners. In particular if a student submitted a solution written as above they would surely lose credit for not justifying such. Ditto for implicit use of uniqueness of inverses (or equivalent uniqueness criteria). – Bill Dubuque Feb 01 '23 at 17:39
  • 1
    True, I skipped a step of explaining that if $\gcd(m, n) = 1$, then $ a \equiv b \pmod{m} \Leftrightarrow an \equiv bn \pmod{mn}$. While this is well-known, it is often done via the property that OP is trying to prove, which makes this argument circular. – Calvin Lin Feb 02 '23 at 11:40
0

An isomorphism between $\Bbb Z_{pq}$ and $\Bbb Z_p×\Bbb Z_q$ can be defined by $$1\mapsto (1,1).$$

In general, using Bezout, we find $a,b$ such that $ap+bq=1$. Then we do $$(x,y) \leftrightarrow yap+xbq.$$

The constant case of the Chinese remainder theorem (CCRT) falls out easily: $$c\leftrightarrow (c,c).$$

calc ll
  • 8,427
0

I'm not quite sure what you mean by showing it directly. There's an approach without the explicit concept of the modular inverse.

$x \equiv 1 \pmod{p}$

$x \equiv 1 \pmod{q}$

$x=kp+1$. $gcd(p,q)=1$

$kp+1\equiv 1 \pmod {q}$

$kp\equiv 0 \pmod{q}\implies q|k.$

$x=mpq+1\implies x\equiv 1 \pmod{pq}$

TurlocTheRed
  • 5,683
  • I understand there are alternatives. But I am trying to prove it in a specific way. – Josh Jan 31 '23 at 05:05