10

I was wondering if my proof makes any sense.

$a \equiv b \pmod m$

$ m \mid a -b$

$ ml = a - b$ for some integer $l$

let $d = \gcd(a, m)$ let $c = \gcd(b, m)$

$$\frac{a}{d} = \frac{m}{d}l - \frac{b}{d} \Rightarrow - \frac{a}{d} + \frac{ml}{d} = \frac{b}{d} \Rightarrow d \mid b \Rightarrow d \leq c$$

Similarly, $c \mid a$, which means $c \leq d$

Thus, $c = d \Rightarrow \gcd(a, m) = \gcd(b, m)$.

0xFF
  • 319
  • Hi, 0xFF. I upvoted your question as it helped me understand the proof given by Andreas. However, I think there might be a sign mistake. You have a/d = (m/d)l -b/d. Should that not be a/d = (m/d)l +b/d ? I'm a math dummy, just learning here. But I think there is a slight mistake there, no ? thanks ! – Chris Bedford Oct 22 '23 at 01:15

3 Answers3

6

If $d$ is a common divisor of $b$ and $m$, and $a = b + m l$, then $d$ also divides $a$, and thus divides $a$ and $m$.

By symmetry, the converse also holds, so the set of common divisors of $a, m$, and that of $b, m$ is the same, hence the two $\gcd$ are also the same.

This is basically your proof, without resorting to fractions, and without the need to go through inequalities, it's just a matter of divisibility.

4

Yes, that works. Quicker: if $\rm\: d\mid m\:$ then $\rm\:d\mid a\!\iff\! d\mid a+mk.\:$ So $\rm\ m,\,a\ $ and $\rm\ m,\,a\!+\!mk\ $ have the same set D of common divisors $\rm\,d,\,$ so they have the same greatest common divisor (= max D).

Math Gems
  • 19,574
  • 1
    In view of generalizations (and also, but less importantly, to allow $\gcd(0,0)$), I believe to be preferable to define a gdc not as the largest common divisor, but as a common divisor that is divisible by all common divisors. – Andreas Caranti Mar 05 '13 at 19:34
  • @Andreas Indeed, I often promote the universal definitions of gcd, lcm here, e.g. a recent example. The above proof works either way, whether one reads it as max absolute value, or maximal wrt to divisibility. – Math Gems Mar 05 '13 at 19:43
1

If $a\equiv b \pmod m$ (so that $a-b=km$ for some $k\in \mathbb{Z}$) then $$ a\mathbb{Z}+m\mathbb{Z}=b\mathbb{Z}+m\mathbb{Z}$$ because $$a\mathbb{Z}+m\mathbb{Z} \ni ap+mq = bp +mq +(a-b)p= bp+ m(q+kp)\in b\mathbb{Z}+m\mathbb{Z}$$ and the other inclusion is similar. The result then follows since $\gcd(r,s)$ is the least positive element of $r\mathbb{Z}+s\mathbb{Z}.$

Ragib Zaman
  • 35,127