2

Suppose that $ar\equiv b$ (mod $m$) and $br\equiv a$ (mod $m$) for some $r$. Show that $a^2\equiv b^2$ (mod $m$).

I've tried quite a few different things and I'm unable to get rid of terms with $r$ in it (if that is even necessary) to show that $a^2=b^2=mz$ for some integer $z$.

I know that $ar-b=mx$ and $br-a=my$ for integers $x,y$. I tried using different mod properties like sum, difference, and product to see if it helped, but didn't have any luck. I ended up with $(a^2-b^2)(r^2-1)=m^2xz=m(mxy)$, but this is was no help and just made things more complicated. Any hints are greatly appreciated. I know there is something obvious that I haven't considered and my mind is just stuck in a certain mode of thinking and I can't escape it at the moment.

Bill Dubuque
  • 272,048
ddswsd
  • 1,337

3 Answers3

6

$$a^2\equiv abr\equiv bar\equiv b^2\pmod m.$$

Surb
  • 55,662
  • Wow! I didn't think reading that would be so painful, but it was. That's so simple. In front of my face the whole time. +1 – ddswsd Mar 08 '21 at 14:09
  • Do you think there exists a solution with the way I was originally going with this or is that hard to say? What you did is much more elegant. – ddswsd Mar 08 '21 at 14:09
  • Our two methods are identical... @ddswsd – Surb Mar 08 '21 at 14:16
  • I can't conclude that $m$ divides $a^2-b^2$ with what I did. At least not in that form, more needs to be done. They're identical? Let me try and convince myself of that. – ddswsd Mar 08 '21 at 14:22
  • 3
    You have to write thing a bit differently. You have that $a=km+br$ and $ar=tm+b$. Therefore $$a^2=a(km+br)=akm+bar=akm+btm+b^2=b^2+m(ak+bt).$$ Therefore $a^2-b^2=m(ak+bt)$, and thus $m\mid (a^2-b^2)$. @ddswsd – Surb Mar 08 '21 at 14:27
  • Damn! You're good at this. I totally see that. What is the trick to seeing things like this or knowing to consider those forms? Just practice over time? – ddswsd Mar 08 '21 at 14:29
  • 1
    I think the easiest is to always work with equivalence class (as far as it's possible). Because it's much harder to see how to substitute things if you write them as $km+r$... But when you see the argument with equivalence class, then to find the argument with the notation $km+r$ becomes very easy. Just my experience... @ddswsd – Surb Mar 08 '21 at 14:33
  • 1
    @ddswsd I added a conceptual derivation that you may find illuminating. – Bill Dubuque Mar 08 '21 at 15:07
  • @ddswsd I added some further remarks on the elimination viewpoint. which show further how to discover such proofs (vs. pull them out of a hat like magic). – Bill Dubuque Mar 08 '21 at 16:12
1

Below is a conceptual derivation, showing how to view it as arising via CM = cross multiplication criterion for fraction equivalence. If $a$ and $b$ are invertible then we can use familiar properties of (modular) fractions, where we define $\,a/b := ab^{-1}.\,$ Solving for $r$ in both we obtain

$$\begin{align} \color{#c00}b\,r\equiv \color{#c00}a\\ \color{#0a0}a\,r\equiv \color{#0a0}b\end{align}\ \Longrightarrow\ \color{#c00}{\dfrac{a}b}\equiv r \equiv \color{#0a0}{\dfrac{b}a}\,\overset{\rm CM}\Longrightarrow\, \color{#c00}a\color{#0a0}a\equiv \color{#c00}b\color{#0a0}b\qquad\qquad $$

so $\,a^2\equiv b^2\,$ by CM. We can eliminate fractions to handle the case when $a$ or $b$ is not invertible. The proof of CM amounts to scaling the fractions to put them over a common denominator $ab$. We can do the same thing with the equations defining the fractions, where the denominator is just the coef of $\,r,\,$ e.g. $\, b\,r\equiv a \!\iff\! r\equiv a/b\,$ has denominator $\,b.\,$ So we want to scale both equations so they have the same coef of $\,r\,$ - which will necessarily be a common multiple of $a$ and $b$. We choose the simple multiple $\,ab,\,$ yielding

$$\begin{align} &a\times [b\,r\equiv a]\to \color{#c00}{ab\,r}\equiv a^2\\ &\:\!b\times [a\,r\equiv b]\to \color{#c00}{ba\,r}\equiv b^2 \end{align}\ \Rightarrow\ a^2\equiv b^2$$

This proof amounts to scaling the proof of the CM criterion by $\,ab,\,$ so we work only with (modular) integers (vs. fractions). Of course we can do the same with the general CM rule for $\frac{a}b\equiv \frac{c}d$ to obtain

$$ \begin{align} &b\,r\equiv a\\ &d\,r\equiv c\end{align}\ \Longrightarrow\ ad\equiv bc\qquad\qquad $$

Remark $ $ More generally, from an equational point of view, we can view the above derivation as cross-multiplying the equations to eliminate $\,r.\,$ From this standpoint we can view the above as a special case of general elimination algorithms such as the Grobner basis algorithm (which is a (multivariate) generalization of both the division (with remainder) algorithm and Gaussian elimination). Even more generally we can view it as a special case of various overlapping (unification) methods of generating consequences of equations used in term rewriting systems, e.g. the Knuth Bendix algorithm. For example, see here where I show how to derive a proof of uniqueness of inverses this way.

Bill Dubuque
  • 272,048
1

Since $ar^2 \equiv br \equiv a$, we have $b^2\equiv a^2r^2\equiv a^2 \bmod m$

Joffan
  • 39,627
  • 1
    I was thinking about showing $r^2\equiv 1$ but it isn't needed. – Joffan Mar 08 '21 at 15:30
  • I also tried that route. I had success with it and then started to think I made mistake and then tried other things. I will try it again and see if it actually works. – ddswsd Mar 08 '21 at 16:31
  • I was hoping I had avoided the use of commutativity as shown in Surb's excellent answer but I realized that I had quietly used it in $ar\cdot ar=a^2r^2$ – Joffan Mar 08 '21 at 16:35