Greatest Common Divisors and Their Properties
Recall that we defined to be the greatest common divisor of integers and , not both zero. Since and have exactly the same set of factors, we may as well focus on the greatest common divisors of two nonnegative integers, for
If we divide and by their greatest common divisor , we remove all their common factors. It is intuitive that the quotients and have no common factors other than , that is, they are coprime.
Let and be integers, not both zero. We have
where . That is, and are coprime.
Proof
Let and , and let . We want to show that .
Since , we have . Similarly, . Thus is a common divisor of and . But is the greatest common divisor, so . Dividing both sides by , we obtain , and hence , since is positive.
The fraction is said to be in lowest termsfraction in lowest terms or an irreducible fractionirreducible fraction if . As a corollary of the preceding theorem, we may obtain an irreducible fraction from any two integers and () by dividing them by their greatest common divisor.
Let with . Then there exist such that
with .
Proof
Adding a multiple of one integer to the other does not change their greatest common divisor.
Let and . Then
Proof
Let and . We shall show that by showing both and .
Since and , by Proposition 1.11, . Thus is a common divisor of and . It then follows that .
On the other hand, since and , again by Proposition 1.11 we have , since . Therefore is a common divisor of and , and hence .
Therefore .
Bézout’s Identity
Recall linear combinations of the integers and : the integers of the form . What is the smallest positive integer we can make by tuning the coefficients and ? The answer is .
Proof
Let be the set of all positive linear combinations of and , that is,
We want a least element of . Note that is a linear combination of and , and since and are not both . Thus , so . Since is a nonempty subset of , the well-ordering principle gives a least element . And can be written as for some .
Let . We want to show .
Because and , by Proposition 1.11 we have . Since , we have .
For the other side of the inequality, we plan to show that divides both and . By the division algorithm Theorem 1.5, we have
Substitute :
Rearrange:
If , then . That would contradict the fact that is the least element of , since . Therefore , and hence . The same argument shows that . Thus is a common divisor of and , so by definition .
We have shown both and , and therefore .
Proof
. We have , and also . The solution of the equation
is not unique. The equation is known as Bézout’s identityBézout’s identity, and the integers and that satisfy it are called Bézout’s coefficientsBézout’s coefficients.
We think of the special case , and of being coprime.
Proof
(). Suppose and are coprime. Then , so by Corollary 3.2 there exist such that .
(). Suppose . Clearly and are not both . Let be the set of all positive linear combinations of and . We have . By Theorem 3.3, is the least element of , and hence . Therefore .
Consider a product , and suppose that and . Intuitively, has no irreducible factor in common with , so every factor of must be contained in , and hence . This intuition is true, and we will formally state it in a later section on the unique factorization of integers. But we can still prove it now, with the tools we already have.
Proof
If , then , so and . The hypothesis means , hence , and so .
If , then , and if and only if . The case of a positive first argument, applied to , gives , and hence . We may therefore assume that .
By Theorem 1.5, we can write
for some with . Then
Since and , we have .
Because , by Corollary 3.3 there exist such that . Multiplying through by gives
Note that and . It then follows that . But , so , which means that .
It will turn out that this proposition is very useful in proofs.
Sometimes we write Bézout’s identity as
where we use the letters and to emphasize that they are coefficients, and variables. Previously we said that the solution is not unique. Here we discuss the precise form of the solution.
When one of and is , the solution is degenerate, and not interesting. If , then is not defined, so (3.2) does not arise. If and , then . In this case if , and if . The integer can be anything.
Looking first at (3.2), we note that it is precisely the equation of a line in the plane. And by Corollary 3.2, we already have one particular solution, say . Using parametric equations, we write
where the parameter . Substituting into (3.2), we see that such and do solve the equation. But are these the only solutions?
Start with the special case .
Proof
It is easy to verify that and do solve (3.3).
Conversely, suppose that is a solution of (3.3). We have
Subtracting these equations yields
Note that , because and . Since , by Proposition 3.1 we have . Then there exists such that . Substitute into the subtracted equation:
Since , we obtain . Therefore and .
Now, to generalize to any integers and , the proof is simple: divide by the greatest common divisor, and reduce to two relatively prime integers.
Proof
Let and . We have , and neither nor is .
Since and , the equation (3.4) is . As , this is equivalent to . Thus the solutions of (3.4) are precisely the solutions of .
Let be a particular solution of (3.4). Then it is a particular solution of . By Proposition 3.2, the solutions are
where . Since and , this is
Theorem 3.3 gives us a different perspective on the greatest common divisor, and an alternative way of viewing it. Besides being the greatest integer in the set of common divisors of and , it is equivalently the least positive linear combination of and . Different perspectives are usually useful in a proof: we may choose the one that suits best.
Proof
We first show that . Let . Then for some . We have and for some . Thus , and hence . Therefore .
Next we show that . For any , we have . By Theorem 3.3, , and hence for some . Therefore , and hence .
We defined the greatest common divisor by the notion of order. We can also define it without that notion. This characterization, free of order, is generalized in algebraic number theory, where it applies to algebraic number fields.
In mathematics we often meet this way of working. We define a concept while learning one particular field, and later find that a wider field has a concept of the same kind, so I want to generalize it. But this also makes a great trouble for learning. In many books written from a high viewpoint, the definitions are abstract and hard to follow, because they were made for the wider field. They run against intuition and against the path of learning, and they are no place to begin.
If and are integers, not both , then a positive integer is the greatest common divisor of and if and only if
- and ,
- if is an integer with and , then .
Proof
(). Let . The first property holds by definition. Let be such that and . By Theorem 3.3, there exist such that . Then, by Proposition 1.11, . Thus the second property holds.
(). Let . By the property of , we have . Thus can be written as for some . (.) Meanwhile, since is a common divisor of and , we have . It then follows that , and hence . Therefore .
Theorem 3.5 tells us that is divisible by all other common divisors of and .
The Greatest Common Divisor of Multiple Integers
We can also define the greatest common divisor of multiple integers.
Clearly, the order of the in does not matter. That is,
where is a permutation of .
We can find the greatest common divisor of multiple integers by first finding the gcd of two of them, and then repeating this step.
If , not all , then
Proof
Let and .
Since and , by Theorem 3.5 we have . Hence is a common divisor of . It then follows that .
On the other hand, since , and divides both and , transitivity gives that divides both and . Thus is a common divisor of , and hence .
Therefore .
Clearly, pairwise relatively prime implies mutually relatively prime.
Farey Sequences
The first eight are
For a fraction in a Farey sequence, the following lemma finds a fraction after with certain properties. In fact, we will see that it is precisely the term consecutive to .
Let be a term in a Farey sequence of order . We can always find a term in such that
- ,
- , and
- .
The second property can be memorized using the determinant
Proof
Because , a small tweak of the solutions in Bézout’s identity Proposition 3.2 gives the solutions of
as
where is a particular solution and .
In a draft paper, we want , which will be the desired , to satisfy
It then follows that
Together,
Then
Rearrange:
which says . In the proof, we can start from this value of .
Let and , and let be determined accordingly. We will show that and are as desired.
We have
Rearrange:
It then follows that
Thus , as the definition of a Farey sequence requires, and , which is the third property.
Recall that
This is exactly the second property. We still need to be valid. We have
Here is the given condition, so . And from (3.5),
Then , and hence . (Both and are greater than , as we know.) This shows that the first property holds, and also that , so is indeed a term of .
Thus all three properties hold, and lies in .
Lemma 3.2 finds a fraction after . It does not yet say that this fraction is the next term: something might still sit between them. The next lemma says that nothing does.
Proof
We prove by contradiction. Assume that is the term consecutive to , and that it is not . Then sits strictly between the fraction we started with and the fraction we built:
A strict inequality of two fractions with positive denominators is a positive cross-difference, and a positive integer is at least . The first inequality implies , so . The difference is an integer, so . The same argument, from , gives .
The two gaps are now integers we can weight. Multiply the first by and the second by , and add. This is the step the argument turns on. The terms cancel, and the second property of Lemma 3.2 turns what remains into exactly :
where the last equality follows from .
The same sum is large for a different reason. Each gap is at least , and the third property of Lemma 3.2 says , so
The left side equals , so . Then cannot be a term in : a contradiction. Therefore the original assumption is false, and .
Both extra properties of Lemma 3.2 are spent once, and neither is decorative. is what collapses the weighted gaps to , rather than to some larger multiple of . is what makes that too big for .
The consecutive term is the fraction Lemma 3.2 already built. The two properties we used to single it out are therefore properties of any consecutive pair. We only have to rename.
If and are two consecutive terms in , then
- , and
- .
Proof
Consider:
In , the terms and are consecutive. With and ,
and . Both properties hold, and the list shows that is the term consecutive to , which is what Lemma 3.3 asserts.
The same two fractions and are consecutive in :
and . In they are no longer consecutive, since sits between them, and is not greater than .
There is another pleasing property. If you look at three consecutive terms, add the numerators of the first and the third, add their denominators, and divide, then, of all things, the quotient is the middle term.
For instance, , , and are consecutive in , and
If , , and are three consecutive terms in a Farey sequence, then
Proof
By Theorem 3.6, we have
We may solve for and in terms of , , , and . We have
Divide, and we are done: