Greatest Common Divisor is expressible as a linear combination of its arguments

See greatest common divisor

For any nonzero integers a,b, there exist integers s,t such that gcd(a,b)=as+bt.
Furthermore, gcd(a,b) is the smallest possible integer of this form.

Proof

Let S={am+bn:m,nZ and am+bm>0}
nb S
By the well-ordering principle, S has a least element d=as+bt

Claim: gcd(a,b)=d

By Division Algorithm 1, a=qd+r, with 0r<d

Suppose r>0, then

r=aqd=aq(as+bt)=a(1qs)+b(qt)

Therefore rS,
but d the least element of S, so either rd or r=0,
and by construction r<d,
so r=0
so d|a

Similarly, d|b.

Let d another divisor of a and b.
Then a=hd and b=kd for some h,kZ

Therefore d=(hd)s+(hd)t=d(hs+kt)
So d|d
but dd
so d=d

so d=gcd(a,b)

QED

Powered by Forestry.md