The following result has been known for thousands of years.
proof 1:
We first show that
there are integers
such that
.
Let
be the set of all positive integers
of the form
, where
and
are integers.
Since
is not empty, it has a smallest element by
the well-ordering principle. Let
be the
smallest element of
. The division algorithm
(theorem 1.2.7)
tells us that there are integers
and
satisfying
and
. Now
would be in
if it were positive, which
would contradict our choice of
as the smallest
element of
. Therefore,
and
is
divisible by
. Similarly,
, and so it is
a common divisor of
and
. If
is another
common divisor of
and
, then
, so
and this implies
.
For the proof of the first statement of the theorem,
see the proof below.
proof 2: We can (and do) assume without loss
of generality that
. First we show that
there are integers
such that
. The proof of this is constructive
and follows an algorithm called the Euclidean
algorithm.
Let
and
. Let
.
Since
, at some point the
above algorithm must terminate. Suppose that
and
is the smallest such integer.
Claim:
.
To see that, we first show that
for some integers
.
Indeed, we claim that every
(
)
is a integral linear combination of
.
This may be proven by mathematical induction.
(The details are left to the reader as an exercise.
The cases
follow from
,
.)
Thus
.
The fact
implies
.
Next, to finish the proof of the above claim, we
show that
and
.
Indeed, we claim that
divides
every
(
)
(The details are left to the reader as an exercise.
The cases
follow from
,
.)
The fact
implies
.
The claim follows.
It remains to prove
proof:
First we prove the case when
.
We see from the previous theorem that the equation
does have a solution since
.
Let
,
be any solution.
Let
,
be any other solution.
We want to show that
and
.
We have
The general case follows easily from this special case.
It is left to the reader as an exercise.