21

In a lecture note from MIT on number theory says:

Theorem 5. The greatest common divisor of a and b is equal to the smallest positive linear combination of a and b.

For example, the greatest common divisor of 52 and 44 is 4. And, sure enough, 4 is a linear combination of 52 and 44:
6 · 52 + (−7) 44 = 4

What about 12 and 6 their gcd is 6 but 0 which is less than 6 can be

Bill Dubuque
  • 282,220
Alexander Suraphel
  • 651
  • 2
  • 5
  • 9

2 Answers2

53

You wrote it yourself: the gcd is the smallest positive linear combination. Smallest positive linear combination is shorthand for smallest positive number which is a linear combination. It is true that $0$ is a linear combination of $12$ and $6$ with integer coefficients, but $0$ is not positive.

The proof is not difficult, but it is somewhat lengthy. We give full detail below.

Let $e$ be the smallest positive linear combination $as+bt$ of $a$ and $b$, where $s$ and $t$ are integers. Suppose in particular that $e=ax+by$.

Let $d=\gcd(a,b)$. Then $d$ divides $a$ and $b$, so it divides $ax+by$. Thus $d$ divides $e$, and therefore in particular $d\le e$.

We show that in fact $e$ is a common divisor of $a$ and $b$, which will imply that $e\le d$. That, together with our earlier $d\le e$, will imply that $d=e$.

So it remains to show that $e$ divides $a$ and $e$ divides $b$. We show that $e$ divides $a$. The proof that $e$ divides $b$ is essentially the same.

Suppose to the contrary that $e$ does not divide $a$. Then when we try to divide $a$ by $e$, we get a positive remainder. More precisely, $$a=qe+r,$$ where $0\lt r\lt e$. Then $$r=a-qe=a-q(ax+by)=a(1-qx)+b(-qy).$$ This means that $r$ is a linear combination of $a$ and $b$, and is positive and less than $e$. This contradicts the fact that $e$ is the smallest positive linear combination of $a$ and $b$.

Pawel
  • 5,189
André Nicolas
  • 514,336
  • Key Idea used in above Euclidean descent is that the set (ideal) $,I = a\Bbb Z + b\Bbb Z,$ is closed under mod (remainder) so the least positive element $,e\in I,$ divides every $,i\in I,$ (else $,i\bmod e = i-q:!e\in I,$ is a positive element of $I$ smaller than $,e,,$ contra minimality of $,e).,$ More simply we can use that $,I,$ is closed under subtraction (i.e. subgroup vs. ideal test). See here for further (conceptual) elaboration. $\ \ $ – Bill Dubuque Oct 23 '24 at 20:20
-1

This isn't as nice as André's approach (and isn't a proof) but it may provide some insight.

Let $a,b,x,y \in \mathbb{Z}$ and let $D = \{ d \in \mathbb{Z} \mid d|a \land d|b \}$ be the set of all common divisors of $a$ and $b$.

  1. Every common divisor $d \in D$ of $a$ and $b$ is also a common divisor of $ax + by$.$^{[1]}$

  2. Specifically, the greatest common divisor $g \in D$ must divide $ax + by$, so we have:

    $$ax + by = gn,$$

    for some $n \in \mathbb{Z}$.

  3. We get the smallest such multiple when $n = 1$:

    $$ax + by = g$$

  4. This must be the smallest (positive) value of $ax + by$, because anything smaller would not be divisible by $g$, which would contradict our first point, above.

For example:

If $a = 24$ and $b= 36$, their common divisors are:

$$C = \{ -12, -6, -4, -3, -2, -1, 1, 2, 3, 4, 6, 12\}$$

Now we know $24x + 36y$ must be divisible by all of these factors. The smallest such value is clearly $12$, i.e. the smallest (positive) value of $24x + 36y$ must be $12 = GCD(12, 24)$.

If that's still not clear. We can apply the proof by contradiction strategy: assume there is a smaller linear combination, e.g. $24x + 36y = 6$, then we'd have:

$$\begin{aligned} 6 &= 24x + 36y \\ 6 &= (12 \cdot 2) x + (12 \cdot 3) y\\ 6 &= 12 (2x + 3y) \\ 6 &= 12 k \end{aligned}$$

for some $k \in \mathbb{Z}$, which is not possible. Moreover, we'll clearly have the same issue for any other value of $ax + by$ that is less than 12.


[1]: i.e. ($d | a \land d | b) \Rightarrow d | (ax + by)$.

Proof:

Since $d|a$, we have $a = d n$ for some $n \in \mathbb{Z}$. Similarly $d|b$ means we have $b = dm$ for some $m \in \mathbb{Z}$. As such:

$$\begin{aligned}ax + by & = (dn)x + (dm)y \\ & = d(nx + my) \\ & = d k \end{aligned}$$

where $(nx + my) = k \in \mathbb{Z}$; i.e, $ax + by$ can be expressed as a multiple of $d$, so $d|(ax + by)$.

Rax Adaam
  • 1,265