Section 2.4 The Bezout Identity
ΒΆSubsection 2.4.1 Backwards with Euclid
ΒΆNow, before we get to the third characterization of the gcd, we need to be able to do the Euclidean algorithm backwards. This is sometimes known as the Bezout identity.Definition 2.4.1. Bezout identity.
A representation of the gcd d of a and b as a linear combination ax+by=d of the original numbers is called an instance of the Bezout identity. (This representation is not unique.)
Example 2.4.2.
Sometimes it helps visually when starting to write the Euclidean algorithm down one side of a table, and then go up the other side of the table to obtain an instance of the Bezout identity.
Here's an example with the gcd of 8 and 5; follow it from top left to the bottom and then back up the right side. The middle column provides the necessary rewriting.
8=1β 5+3 | 1β 8β1β 5=3 | 1=2β 3β1β 5=2β (8β1β 5)β1β 5=2β 8β3β 5 |
5=1β 3+2 | 1β 5β1β 3=2 | 1=1β 3β1β 2=1β 3β1β (5β1β 3)=2β 3β1β 5 |
3=1β 2+1 | 1β 3β1β 2=1 | 1=1β 3β1β 2 |
2=2β 1+0 | Go up this column... |
So 1=2β 8β3β 5.
Example 2.4.3.
Usually students need a couple example of this to get the way this works, so here is another one. Let's do it with the gcd of 60 and 42.
60=1β 42+18 | 1β 60β1β 42=18 | 6=1β 42β2β 18=1β 42β2β (60β1β 42) |
42=2β 18+6 | 1β 42β2β 18=6 | 6=1β 42β2β 18 |
18=3β 6+0 | Go up this column... |
Simplifying 1β 42β2β (60β1β 42) (the top line on the right), we get 6=3β 42+(β2)β 60 again.
xgcd(a,b)
, because this is also known as the eXtended Euclidean algorithm.
xxxxxxxxxx
xgcd(60,42)
Example 2.4.4.
Try to get the xgcd/Bezout identity for gcd(135,50) using this algorithm. You should get 5=3β 135+(β8)β 50. Can you get another one a different way?
Try the following Sage cell to check that it works.
xxxxxxxxxx
xgcd(135,50)[1]*135 + xgcd(135,50)[2]*50
Sage note 2.4.5. Remind how to get list elements.
Do you remember what the [1]
means? What do you think the [2]
means in this context?
Example 2.4.6.
Try to get the xgcd/Bezout identity for gcd(1415,1735) using this algorithm. Hopefully you get 5=103β 1415+(β84)β 1735, though it may take a while! The previous example might help you on your way.
Subsection 2.4.2 Proving the final characterization
ΒΆThe final characterization of the greatest common divisor (Theorem 2.2.4) is that it is the least positive integer which can be written ax+by for integers x,y. Let's prove that now. First, we know there are some positive integers which can be written ax+by (just use positive x,y). So we know there is a smallest such positive integer, which we will call c=au+bv. Let's also designate the gcd of a and b to be d. By Proposition 1.2.8, any integer which divides a and b divides any ax+by, so it divides au+bv=c. In particular, since d is a divisor of both a and b, it must also divide c. So dβ€c. On the other hand, we know from the backward/extended Euclidean algorithm/Bezout identity that d can be written d=axβ²+byβ² for some integers xβ² and yβ². Since c is the smallest such (positive) integer, cβ€d. Thus we conclude that d=c.Subsection 2.4.3 Other gcd questions
ΒΆWe mentioned earlier there are many such linear combinations for any given pair a,b. How might we find more than one such representation?Example 2.4.7. Using Bezout to get another Bezout.
We used the backwards Euclidean algorithm to see that 6=β2β 60+3β 42. Let's use that to get another.
Since 6 is itself a divisor of both 60 and 42, let's pick one (the smaller one!), 42, and write it as 42=7β 6.
-
Then we can really write
42=7β 6=7β (β2β 60+3β 42),since after all we just saw that was a way to represent 6!
-
Now we plug this back into the original equation:
6=β2β 60+3β 42=β2β 60+3β (7β 6)=β2β 60+3β (7β (β2β 60+3β 42))
If we simplify it out, that means 6=β44β 60+63β 42, which is indeed correct!
Subsection 2.4.4 Relatively prime
ΒΆThere is one final thing that the linear combination version of the gcd can give us. It is something you may think is familiar, but which can arise very naturally from the Bezout identity. Consider the smallest possible greatest common divisor, which is one. Under what circumstances would a and b have gcd(a,b)=1? By our characterization, it is precisely when you can write ax+by=1 for some integers x and y. Think about this, though; if the gcd of a and b is 1, then we could write any integer as a (linear) combination of a and b! This is a property I think people would have come up with no matter how the development of mathematics had gone; namely, identifying pairs of integers such that you can write any number as a (linear) combination of them.Definition 2.4.8. Relatively Prime.
If the greatest common divisor of two numbers is one, we call them relatively prime numbers or coprime numbers.
Later, we will need to have a term for the situation where, in a collection of several integers, all possible pairs are relatively prime. We will call this mutually coprime, coprime in pairs, or an analogous term.
Proposition 2.4.9.
Here are two interesting facts about coprime integers a and b:
If aβ£c and bβ£c, then abβ£c.
If aβ£bc, then aβ£c.
Proof.
The first is not too hard to prove, if you think in terms of Bezout. It does need a little cleverness.
Remember that \(ax+by=1\) by definition.
So \(c=cax+cby\text{.}\)
Now write \(c=kb\) and \(c=\ell a\text{,}\) and substitute them in the opposite parts of the previous line.
This gives \(c=(kb)ax+(\ell a)by\text{,}\) and \(ab\) definitely divides both parts of this, so it divides the whole thing by our earlier proposition about divisibility.
We leave the second as an exercise (Exercise 2.5.19).