existence and uniqueness of the gcd of two integers
Theorem.
Given two integers, at least one different from zero, there exists a unique natural number satisfying the definition of the greatest common divisor
.
Proof.
Let , where at least one of is nonzero. First we show existence. Define. Now clearly is a subset of natural numbers, and is also nonempty, for depending upon the signs of and , we may take to have . So, by the well-ordering principle for natural numbers, has a smallest element which we denote .Note that, by construction, for some . We will show that is a greatest common divisor of and . Suppose first that . Then, by the division algorithm for integers, there exist unique , where , such that . By assumption, , so we have
But then is an element of strictly less than , contrary to assumption. Thus it must be that . Similarly it can be shown that . Now suppose is a divisor of both and . Then there exist such that and , and we have
so .Thus is a greatest common divisor of and . To see that is unique, suppose that is also a greatest common divisor of and . Then we have and , whence , and since , .∎