4

Beginner question here:

For a quiz on Elementary Number Theory in my Discrete Math course I was asked to prove if $\gcd(m, n) = \gcd(-m, n)$. I used the Euclidean Algorithm to show that the two expressions simplify to $\gcd(n,\ m\pmod{n})$ and $\gcd(n,\ -m\pmod{n})$ respectively. Then I went on to show (well I tried... but that's another question) that $-m\pmod{n} = m\pmod{n}$.

If I was able to do this correctly, does this approach result in a valid proof? If not, is there a different/better way to do it?

Thanks!

chandsie
  • 143

3 Answers3

3

The easiest way is simply to observe that $m$ and $-m$ have exactly the same divisors: $d\mid m$ iff there is an integer $k$ such that $m=kd$ iff $-m=(-k)d$ iff $d\mid -m$, and $-k$ is an integer iff $k$ is an integer. Thus, the common divisors of $m$ and $n$ are exactly the same as the common divisors of $-m$ and $n$, and hence $\gcd(m,n)=\gcd(-m,n)$.

Brian M. Scott
  • 616,228
3

Below are few proofs, by gcd definition, general Euclid's Lemma, and unimodularity.


$d\,|\,m,n\!\iff d\,|\,{-}m,n,\,$ so $\,m,n\,$ and $\: -m,n\,$ have the same set $S$ of common divisors $\,d\,$ so the same greatest common divisor $(= \max S),\,$ same as in the proof of $\:\!\gcd(a,b) = \gcd(a\bmod b,b)$


Alternatively it's a special case $\,\color{#c00}k=-1\,$ in $\,(\color{#c00}km,n)\,=\,(\color{#c00}{(k,n)}\:\!m,n)\,$

Proof $\ \ \,(km,n)\,=\,(km,n(m,1))\,=\,(km,nm,n)\,=\,((k,n)m,n)$

The above proof uses only basic gcd laws (associative, commutative, distributive) - see here.. Euclid's Lemma is the case: $\,\color{#c00}{(k,n) = 1}\,\Rightarrow\,(km,\:n)\,=\,(\color{#c00}{ 1}m,\:n)$


Or let $\,a,b,c,d=-1,0,0,1\,$ in $\,\gcd(m,n)=\gcd(am\!+\!bn,cm\!+\!dn)\,$ if $\,ad\!-\!bc = \pm1$


Corollary $\ \gcd(|m|,|n|) = \gcd(m,n),\ $ by $\,|x| = \pm x\ $ (or $\ d\mid |x|\!\iff d\mid x)$.

Bill Dubuque
  • 272,048
0

So here is really a simple answer that should follow by definition:

Let $d = \gcd(m, n)$ and $d' = \gcd(-m,n)$. By definition of a gcd, $d| m,n$. So, $d|-m,n$. Hence, $d|d'$. Similarly one can show that $d'|d$. Then $d= \pm d'$. But, GCDs in $\mathbb{Z}$ are positive. So, $d = d'$, because d, d' are both positive.

Rankeya
  • 8,826