1.1.3. Euclidean algorithm
This section is based on parts of [BUR11, Sec. 2.3, Sec. 2.4, Sec. 2.5].
We begin with an auxiliary lemma.
Lemma 1.1.3.1.
Let be not both zero. Then
Proof.
Let and set and . We prove that by showing that and .
-
•
By definition, and . Proposition 1.1.1.6(11) implies that . Thus, is a common divisor of and . By the maximality of gcds,
-
•
By definition, and . Proposition 1.1.1.6(11) implies that
Thus, is a common divisor of and . By the maximality of gcds,
This finishes the proof. ∎
The following theorem gives an algorithmic procedure to compute the gcd of a pair of integers using the Division with Remainder Theorem (Theorem 1.1.1.8).
Theorem 1.1.3.2 (Euclidean algorithm).
Let with .
-
(1)
If , then .
-
(2)
If , set and . Then there exists a unique integer , unique integers , and unique integers such that
Moreover, .
Proof.
(1) Clear from the definition of gcd and the fact that .
(2) Applying the Division with Remainder Theorem (Theorem 1.1.1.8) successively yields unique quotient-remainder pairs (as in the statement of the theorem) such that
as long as does not divide . Since
is a strictly decreasing sequence of positive integers, this procedure must terminate. Therefore, there is a unique first integer such that . Finally, using the equations
Lemma 1.1.3.1 yields
for , and statement (1) (for the pair ) yields . Combining these equations we obtain
Example 1.1.3.3.
Example 1.1.3.4.
Definition 1.1.3.5.
Let and be integers. We say that is an integral linear combination of if there exist integers such that
The following theorem is a refinement of the Euclidean Algorithm (Theorem 1.1.3.2). With it, we can express the gcd of a pair of integers as an integral linear combination of the original pair; see Bézout’s Identity (Theorem 1.1.3.7).
Theorem 1.1.3.6 (Extended Euclidean algorithm).
Let with . Suppose that . By the Euclidean Algorithm (Theorem 1.1.3.2), there are a unique integer , unique integers , and unique integers such that
Moreover, . Then
where the integers are computed recursively as follows: Set
Recursively, for ,
Proof.
By definition,
and
Consider the equations
Inductively, let and suppose that
Then
In particular,
This finishes the proof. ∎
Theorem 1.1.3.7 (Bézout’s identity).
Let be not both zero. Then there exist such that
In other words, is an integral linear combination of and .
Proof.
Since the roles of and are symmetric, we may assume that . Also, without loss of generality, we may assume that . Indeed,
(Proposition 1.1.2.5(4)) and . If , then
If , then the claim is immediate from the Extended Euclidean Algorithm (Theorem 1.1.3.6). ∎
Definition 1.1.3.8.
Let be not both zero. The pairs of integers such that are called Bézout coefficients.
Warning 1.1.3.9.
Bézout coefficients always exist by Bézout’s Identity (Theorem 1.1.3.7) but are not unique (see Theorem 1.1.3.23). Here is an example: Let and , so that . Then
Example 1.1.3.10.
We compute Bézout coefficients for using the Extended Euclidean Algorithm (Theorem 1.1.3.6):
We have and Bézout coefficients and . Indeed,
Example 1.1.3.11.
Not covered in the lectureWe compute Bézout coefficients for using the Extended Euclidean Algorithm (Theorem 1.1.3.6):
Hence, with Bézout coefficients and . Indeed,
Below we list a number of important corollaries of Bézout’s Identity (Theorem 1.1.3.7).
Corollary 1.1.3.12.
Let be not both zero and set . Then
Proof.
By Bézout’s Identity (Theorem 1.1.3.7), there exist such that .
Let be such that . Then there exists such that and, therefore,
Conversely, let and set . Since divides both and , there exist such that and . Then
so that divides . ∎
Corollary 1.1.3.13.
Let be not both zero. Then if and only if there exist such that .
Proof.
Suppose that there exist such that
and let . By Corollary 1.1.3.12, the number is a multiple of , and hence (recall from Remark 1.1.2.6 that the gcd is always positive). The converse is a particular case of Bézout’s Identity (Theorem 1.1.3.7). ∎
Corollary 1.1.3.14.
Let be not both zero and set , so that and . Then .
Proof.
By Bézout’s Identity (Theorem 1.1.3.7), there exist such that . Then
Using Corollary 1.1.3.13, we conclude that . ∎
Example 1.1.3.15.
Not covered in the lectureRecall from Example 1.1.3.3 that . Since and , Corollary 1.1.3.14 yields . Indeed, the only positive divisors of are and , and does not divide .
Corollary 1.1.3.16.
Let be integers such that , and are defined. Then
Proof.
Suppose that . By Bézout’s Identity (Theorem 1.1.3.7), there exist such that
Corollary 1.1.3.13 implies that and .
Conversely, suppose that and . By Bézout’s Identity (Theorem 1.1.3.7), there exist such that
Then
Corollary 1.1.3.13 implies that . ∎
Corollary 1.1.3.17.
Let be not both zero and such that . For , if and , then .
Proof.
By Bézout’s Identity (Theorem 1.1.3.7), there exist such that
By assumption, there exist such that and . Then
so that divides . ∎
Corollary 1.1.3.18.
Let be not both zero and such that . For , if , then .
Proof.
By Bézout’s Identity (Theorem 1.1.3.7), there exist such that
By assumption, there exists such that . Then
so that . ∎
The following definition plays a guiding role in Part 1, as we can interpret many of our results in these terms (Example 1.1.3.21).
Definition 1.1.3.19.
A Diophantine equation is an equation defined by a non-zero polynomial with integer coefficients for which one is only interested in its solutions in the integers. The degree of such an equation is the degree of the polynomial that defines it.
Remark 1.1.3.20.
Often, it can be more natural to present a Diophantine equation as an equality between two polynomials with integer coefficients.
Example 1.1.3.21.
Not covered in the lecture Let be not both zero. Then can be regarded as a linear Diophantine equation in the indeterminates and .
Example 1.1.3.22.
Not covered in the lectureThe equation can be regarded as a quadratic Diophantine equation in the indeterminates and . While the pairs that give a solution to this equation are the points that lie on the unit circle, the only solutions in the integers are the pairs and .
End of Lecture 2
The following theorem is a refinement of Bézout’s Identity (Theorem 1.1.3.7).
Theorem 1.1.3.23.
Let be not both zero. Set , so that . Given , consider the linear Diophantine equation , in which and are indeterminates. The following statements hold:
-
(1)
The equation
has a solution in the integers if and only if divides . In symbols:
-
(2)
Suppose that are such that . Then satisfy if and only if there exists such that
Proof.
Since are not both zero, interchanging and if necessary (and also and ), we may assume that .
(1) This is precisely Corollary 1.1.3.12.
Conversely, let be such that . Since
we have
Dividing by yields
with and (Corollary 1.1.3.14). Since divides the left-hand side of the equation, Corollary 1.1.3.18 implies that divides . Therefore, there exists such that
Equivalently,
We then also have
Since , we may cancel it on both sides to obtain
Equivalently,
This finishes the proof. ∎
Remark 1.1.3.24.
Not covered in the lecture Let be not both zero. Set . Given , consider the linear Diophantine equation , in which and are indeterminates. Suppose that , so that the equation admits an integer solution (Theorem 1.1.3.23). A solution can be found algorithmically as follows:
-
•
Compute Bézout coefficients for using the procedure in the proof of Bézout’s Identity (Theorem 1.1.3.7). Thus, .
-
•
Write with .
-
•
The integers and give a solution to the linear Diophantine equation .
Example 1.1.3.25.
Not covered in the lectureWe use the notation in Remark 1.1.3.24. Let , and . From Example 1.1.3.3 we know that
Since , the linear Diophantine equation admits an integer solution. From Example 1.1.3.10 we know that and are Bézout coefficients for . Therefore, given that ,
give a solution to the equation. Indeed,