Greatest Common Divisors and Linear Combinations
In Section 8.1, we introduced the concept of the greatest common divisor of two integers. We showed how the Euclidean Algorithm can be used to find the greatest common divisor of two integers, \(a\) and \(b\), and also showed how to use the results of the Euclidean Algorithm to write the greatest common divisor of \(a\) and \(b\) as a linear combination of \(a\) and \(b\).
In this section, we will use these results to help prove the so-called Fundamental Theorem of Arithmetic, which states that any natural number greater than 1 that is not prime can be written as product of primes in “essentially” only one way. This means that given two prime factorizations, the prime factors are exactly the same, and the only difference may be in the order in which the prime factors are written. We start with more results concerning greatest common divisors. We first prove Proposition 5.16, which was part of Exercise (18) in Section 5.2 and Exercise (8) in Section 8.1.
Theorem 5.16
Let \(a\), \(b\), and \(t\) be integers with \(t \ne 0\). If \(t\) divides \(a\) and \(t\) divides \(b\), then for all integers \(x\) and \(y\), \(t\) divides \((ax + by)\).
- Proof
-
Let \(a\), \(b\), and \(t\) be integers with \(t \ne 0\), and assuem that \(t\) divides \(a\) and \(t\) divides \(b\). We will prove that for all integers \(x\) and \(y\), \(t\) divides \((ax + by)\).
So let \(x \in \mathbb{Z}\) and let \(y \in \mathbb{Z}\). Since \(t\) divides \(a\), there exists an integer \(m\) such that \(a = mt\) and since \(t\) divides \(b\), there exists an integer \(n\) such that \(b = nt\). Using substitution and algebra, we then see that
\[\begin{array} {rcl} {ax + by} &= & {(mt) x + (nt) y} \\ {} &= & {t(mx + ny)} \end{array}\]
Since \((mx + ny\)) is an integer, the last equation proves that \(t\) divides \(ax + by\) and this proves that for all integers \(x\) and \(y\), \(t\) divides \((ax + by)\).
We now let \(a, b \in \mathbb{Z}\), not both 0, and let \(d = \text{gcd}(a, b)\). Theorem 8.8 states that d can be written as a linear combination of \(a\) and \(b\). Now, since \(d\ |\ a\) and \(d\ |\ b\), we can use the result of Proposition 5.16 to conclude that for all \(x, y \in \mathbb{Z}\), \(d\ |\ (ax + by)\). This means that \(d\) divides every linear combination of \(a\) and \(b\). In addition, this means that \(d\) must be the smallest positive number that is a linear combination of \(a\) and \(b\). We summarize these results in Theorem 8.9.
Theorem 8.9.
Let \(a, b \in \mathbb{Z}\), not both 0.
- The greatest common divisor, \(d\), is a linear combination of \(a\) and \(b\). That is, there exist integers \(m\) and \(n\) such that \(d = am + bn\).
- The greatest common divisor, \(d\), divides every linear combination of \(a\) and \(b\). That is, for all \(x, y \in \mathbb{Z}\), \(d\ |\ (ax + by)\).
- The greatest common divisor, \(d\), is the smallest positive number that is a linear combination of \(a\) and \(b\).
Relatively Prime Integers
In Preview Activity \(\PageIndex{1}\), we constructed several examples of integers \(a\), \(b\), and \(c\) such that \(a\ |\ (bc)\) but \(a\) does not divide \(b\) and \(a\) does not divide \(c\). For each example, we observed that \(\text{gcd}(a, b) \ne 1\) and \(\text{gcd}(a, c) \ne 1\).
We also constructed several examples where \(a\ |\ (bc)\) and \(\text{gcd}(a, b) = 1\). In all of these cases, we noted that \(a\) divides \(c\). Integers whose greatest common divisor is equal to 1 are given a special name.
Definition: relatively prime
Two nonzero integers \(a\) and \(b\) are relatively prime provided that \(\text{gcd}(a, b) = 1\).
Progress Check 8.10: Relatively Prime Integers
- Construct at least three different examples where \(p\) is a prime number, \(a \in \mathbb{Z}\), and \(p\ |\ a\). In each example, what is gcd(\(a\), \(p\))? Based on these examples, formulate a conjecture about gcd(\(a\), \(p\)) when \(p\ |\ a\).
- Construct at least three different examples where \(p\) is a prime number, \(a \in \mathbb{Z}\), and \(p\) does not divide \(a\). In each example, what is gcd(\(a, p\))? Based on these examples, formulate a conjecture about gcd(\(a\), \(p\)) when \(p\) does not divide \(a\).
- Give at least three different examples of integers \(a\) and \(b\) where a is not prime, \(b\) is not prime, and \(\text{gcd}(a, b) = 1\), or explain why it is not possible to construct such examples.
- Answer
-
Add texts here. Do not delete this text first.
Theorem 8.11.
Let \(a\) and \(b\) be nonzero integers, and let \(p\) be a prime number.
- If \(a\) and \(b\) are relatively prime, then there exist integers \(m\) and \(n\) such that \(am + bn = 1\). That is, 1 can be written as linear combination of \(a\) of \(b\).
- If \(p\ |\ a\), then \(\text{gcd}(a, p) = p\).
- If \(p\) does not divide \(a\), then \(\text{gcd}(a, p) = 1\).
Part (1) of Theorem 8.11 is actually a corollary of Theorem 8.9. Parts (2) and (3) could have been the conjectures you formulated in Progress Check 8.10. The proofs are included in Exercise (1).
Given nonzero integers a and b, we have seen that it is possible to use the Euclidean Algorithm to write their greatest common divisor as a linear combination of \(a\) and \(b\). We have also seen that this can sometimes be a tedious, time-consuming process, which is why people have programmed computers to do this. Fortunately, in many proofs of number theory results, we do not actually have to construct this linear combination since simply knowing that it exists can be useful in proving results. This will be illustrated in the proof of Theorem 8.12, which is based on work in Preview Activity \(\PageIndex{1}\).
Theorem 8.12
Let \(a\), \(b\), be nonzero integers and let \(c\) be an integer. If \(a\) and \(b\) are relatively prime and \(a\ |\ (bc)\), then \(a\ |\ c\)
The explorations in Preview Activity \(\PageIndex{1}\) were related to this theorem. We will first explore the forward-backward process for the proof. The goal is to prove that \(a\ |\ c\). A standard way to do this is to prove that there exists an integer \(q\) such that
\[c = aq.\]
Since we are given \(a\ |\ (bc)\), there exists an integer \(k\) such that
\[bc = ak.\]
It may seem tempting to divide both sides of Equation \ref{8.2.3} by \(b\), but if we do so, we run into problems with the fact that the integers are not closed under division. Instead, we look at the other part of the hypothesis, which is that \(a\) and \(b\) are relatively prime. This means that \(\text{gcd}(a, b) = 1\). How can we use this? This means that \(a\) and \(b\) have no common factors except for 1. In light of Equation \ref{8.2.3}, it seems reasonable that any factor of \(a\) must also be a factor of \(c\). But how do we formalize this?
One conclusion that we can use is that since \(\text{gcd}(a, b) = 1\), by Theorem 8.11, there exist integers \(m\) and \(n\) such that
\[am + bn = 1.\]
We may consider solving equation (8.2.4) for \(b\) and substituting this into Equation \ref{8.2.3}. The problem, again, is that in order to solve Equation \ref{8.2.4} for \(b\), we need to divide by \(n\).
Before doing anything else, we should look at the goal in Equation \ref{8.2.2}. We need to introduce c into Equation \ref{8.2.4}. One way to do this is to multiply both sides of equation (8.2.4) by \(c\). (This keeps us in the system of integers since the integers are closed under multiplication.) This gives
\[\begin{array} {rcl} {(am + bn) c} &= & {1 \cdot c} \\ {acm + bcn} &= & {c.} \end{array}\]
Notice that the left side of Equation \ref{8.2.5} contains a term, \(bcn\), that contains \(bc\). This means that we can use Equation \ref{8.2.3} and substitute bc D ak in Equation \ref{8.2.5}. After doing this, we can factor the left side of the equation to prove that \(a\ |\ c\).
Progress Check 8.13: Completing the Proof of Theorem 8.12
Write a complete proof of Theorem 8.12.
- Answer
-
Add texts here. Do not delete this text first.
Corollary 8.14
- Let \(a, b \in \mathbb{Z}\), and let \(p\) be a prime number. If \(p\ |\ (ab)\), then \(p\ |\ a\) or \(p\ |\ b\).
- Let \(p\) be a prime number, let \(n \in \mathbb{N}\), and let \(a_1, a_2, ..., a_n \in \mathbb{Z}\). If \(p\ |\ (a_{1}a_{2}\cdot\cdot\cdot a_{n})\), then there exists a natural number \(k\) with \(1 \le k \le n\) such that \(p\ |\ a_{k}\).
Part (1) of Corollary 8.14 is a corollary of Theorem 8.12. Part (2) is proved using mathematical induction. The basis step is the case where \(n = 1\), and Part (1) is the case where \(n = 2\). The proofs of these two results are included in Exercises (2) and (3).
Historical Note: Euclid’s Lemma
Part (1) of Corollary 8.14 is known as Euclid’s Lemma. Most people associate geometry with Euclid’s Elements, but these books also contain many basic results in number theory. Many of the results that are contained in this section appeared in Euclid’s Elements.
Prime Numbers and Prime Factorizations
We are now ready to prove the Fundamental Theorem of Arithmetic. The first part of this theorem was proved in Theorem 4.9 in Section 4.2. This theorem states that each natural number greater than 1 is either a prime number or is a product of prime numbers. Before we state the Fundamental Theorem of Arithmetic, we will discuss some notational conventions that will help us with the proof. We start with an example.
We will use \(n = 120\). Since \(5\ |\ 120\), we can write \(120 = 5 \cdot 24\). In addition, we can factor 24 as \(24 = 2 \cdot 2 \cdot 2 \cdot 3\). So we can write
\[\begin{array} {rcl} {120} &= & {5 \cdot 24} \\ {} &= & {5(2 \cdot 2 \cdot 2 \cdot 3).} \end{array}\]
This is a prime factorization of 120, but it is not the way we usually write this factorization. Most often, we will write the prime number factors in ascending order. So we write
\(120 = 2 \cdot 2 \cdot 2 \cdot 2 \cdot 3 \cdot 5\) or \(120 = 2^{3} \cdot 3 \cdot 5\).
Now, let \(n \in \mathbb{N}\). To write the prime factorization of \(n\) with the prime factors in ascending order requires that if we write \(n = p_{1}p_{2}\cdot\cdot\cdot p_{r}\), where \(p_{1}p_{2}\cdot\cdot\cdot p_{r}\) are prime numbers, we will have \(p_{1} \le p_{2} \le \cdot\cdot\cdot \le p_{r}\).
Theorem 8.15: The Fundamental Theorem of Arithmetic
- Each natural number greater than 1 is either a prime number or is a product of prime numbers.
- let \(n \in \mathbb{N}\) with \(n > 1\). Assume that
\[n = p_{1}p_{2}\cdot\cdot\cdot p_{r} \text{ and that } n = q_{1}q_{2}\cdot\cdot\cdot q_{s},\]
where \(p_{1}p_{2}\cdot\cdot\cdot p_{r}\) and \(q_{1}q_{2}\cdot\cdot\cdot q_{s}\) are prime with \(p_{1} \le p_{2} \le \cdot\cdot\cdot \le p_{r}\) and \(q_{1} \le q_{2} \le \cdot\cdot\cdot \le q_{s}\). Then \(r = s\), and for each \(j\) from 1 to \(r\), \(p_{j} = q{j}\).
- Proof
-
The first part of this theorem was proved in Theorem 4.9. We will prove the second part of the theorem by induction on \(n\) using the Second Principle of Mathematical Induction. (See Section 4.2.) For each natural number \(n\) with \(n > 1\), let \(P(n)\) be
If \(n = p_{1}p_{2}\cdot\cdot\cdot p_{r}\) and \(n = q_{1}q_{2}\cdot\cdot\cdot q_{s}\), where \(p_{1}p_{2}\cdot\cdot\cdot p_{r}\) and \(q_{1}q_{2}\cdot\cdot\cdot q_{s}\) are primes with \(p_{1} \le p_{2} \le \cdot\cdot\cdot \le p_{r}\) and \(q_{1} \le q_{2} \le \cdot\cdot\cdot \le q_{s}\), then \(r = s\), and for each \(j\) from 1 to \(r\), \(p_{j} = q{j}\).
For the basis step, we notice that since 2 is a prime number, its only factorization is \(2 = 1 \cdot 2\). This means that the only equation of the form \(n = p_{1}p_{2}\cdot\cdot\cdot p_{r}\), where \(p_{1}p_{2}\cdot\cdot\cdot p_{r}\) are prime numbers, is the case where \(r = 1\) and \(p_1 = 2\).This proves that \(P(2)\) is true.
For the inductive step, let \(k \in \mathbb{N}\) with \(k \ge 2\). We will assume that \(P(2), P(3), ..., P(k)\) are true. The goal now is to prove that \(P(k + 1)\) is true. To prove this, we assume that \((k + 1)\) has two prime factorizations and then prove that these prime factorizations are the same. So we assume that
\(k + 1 = p_{1}p_{2}\cdot\cdot\cdot p_{r}\) and that \(k + 1 = q_{1}q_{2}\cdot\cdot\cdot q_{s}\), wher \(p_{1}p_{2}\cdot\cdot\cdot p_{r}\) and \(q_{1}q_{2}\cdot\cdot\cdot q_{s}\) are prime with \(p_{1} \le p_{2} \le \cdot\cdot\cdot \le p_{r}\) and \(q_{1} \le q_{2} \le \cdot\cdot\cdot \le q_{s}\).
We must now prove that \(r = s\), and for each \(j\) from 1 to \(r\), \(p_{j} = q_{j}\). We can break our proof into two cases: (1) \(p_{1} \le q_{1}\); and (2) \(q_{1} \le p_{1}\). Since one of these must be true, and since the proofs will be similar, we can assume, without loss of generality, that \(p_{1} \le q_{1}\).
Since \(k + 1 = p_{1}p_{2}\cdot\cdot\cdot p_{r}\), we know that \(p_{1}\ |\ (k + 1)\), and hence we may conclude that \(p_{1}\ |\ (q_{1}q_{2}\cdot\cdot\cdot q_{s})\). We now use Corollary 8.14 to conclude that there exists a \(j\) with \(1 \le j \le s\) such that \(p_{1}\ |\ q_{j}\). Since \(p_{1}\) and \(q_{j}\) are primes, we conclude that
\(p_{1} = q_{j}\).
We now use this and the fact that \(k + 1 = p_{1}p_{2}\cdot\cdot\cdot p_{r} = q_{1}q_{2}\cdot\cdot\cdot q_{s}\) to conclude that
\(p_{2}\cdot\cdot\cdot p_{r} = q_{2}\cdot\cdot\cdot q_{s}\).
The product in the previous equation is less that \(k + 1\). Hence, we can apply our induction hypothesis to these factorizations and conclude that \(r = s\), and for each \(j\) from 2 to \(r\), \(p_{j} = q_{j}\).
This completes the proof that if \(P(2), P(3), ..., P(k)\) are true, then \(P(k + 1)\) is true. Hence, by the Second Principle of Mathematical Induction, we conclude that \(P(n)\) is true for all \(n \in \mathbb{N}\) with \(n \ge 2\). This completes the proof of the theorem.
Note: We often shorten the result of the Fundamental Theorem of Arithmetic by simply saying that each natural number greater than one that is not a prime has a unique factorization as a product of primes. This simply means that if \(n \in \mathbb{N}\), \(n > 1\), and n is not prime, then no matter how we choose to factor n into a product of primes, we will always have the same prime factors. The only difference may be in the order in which we write the prime factors.