Remark2.4.2
Sage note:
Do you remember what the [1] means? What do you think the [2] means in this context?
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, and it is worth doing some examples.
The previous exercises may have had one you solved, probably by trial and error. For instance, \[6=60\cdot (-2)+42\cdot 3\; .\]
The third characterization implies that doing this is always possible; \(gcd(a,b)=ax+by\) for some integers \(x\) and \(y\). Euclid backwards does this.
Sometimes it's good to write the Euclidean algorithm down one side of a table, and then go backwards up the other side of the table to obtain Bezout's 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.
\(8=1\cdot 5+3\) | \(8-1\cdot 5=3\) | \(1=2\cdot 3-1\cdot 5=2\cdot (8-1\cdot 5)-1\cdot 5=2\cdot 8-3\cdot 5\) |
\(5= 1\cdot 3+2\) | \(5- 1\cdot 3=2\) | \(1=3-1\cdot 2=3-1\cdot(5-1\cdot 3)=2\cdot 3-1\cdot 5\) |
\(3=1\cdot 2+1\) | \(3-1\cdot 2=1\) | \(1=3-1\cdot 2\) |
\(2=2\cdot 1+0\) | Go up this column... |
This question of Bezout's identity is implemented in Sage as xgcd(a,b), because this is also known as the eXtended Euclidean algorithm.
Or, \(6=-2\cdot 60+3\cdot 42\), as we saw above.Try to get the xgcd/Bezout for \(gcd(1492,1066)\). You should get \(2=-5\cdot 1492+7\cdot 1066\).
Sage note:
Do you remember what the [1] means? What do you think the [2] means in this context?
You might also want to do more than one linear combination, for variety. How might we get another such representation?
We used the backwards Euclidean algorithm to see that \(6=-2\cdot 60+3\cdot 42\). Let's use that to get another.
So, substituting a Bezout identity into itself yields more and more such identities. How many such identities are there? Is there a general form? That will be answered soon.
As another example, what makes finding \(gcd(42000,60000)\) so easy? Let's discuss.
If \(gcd(a,b)=d\), could you make a guess as to a formula for \(gcd(ka,kb)\) (for \(k>0\))? Can you prove it? (Hint: here is where our original definition or the Bezout version could be useful.)
Now let's prove the final characterization of GCD - namely, the least positive integer which can be written \(au+bv\) for integers \(u,v\).
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.
When do \(a\) and \(b\) have greatest common divisor 1? From this point of view, it is precisely when you can write \(ax+by=1\) for some integers \(x\) and \(y\). That means, in fact, that you can write any integer as a (linear) combination of \(a\) and \(b\) if their gcd is 1!
This is a property I think people would have come up with no matter how the development of mathematics had gone; the pairs of integers such that you can write any number as a combination of them. We call these relatively prime numbers or coprime numbers.
Here are two interesting facts about coprime integers \(a\) and \(b\):
It's also useful to try to find counterexamples! Can you find place where \(gcd(a,b)\neq 1\), \(a|c\) and \(b|c\), but \(ab\) does not divide \(c\)?