2.5 Integers
In this section, we focus on integers and explore their properties. We end by proving the so-called Fundamental Theorem of Arithmetic, which states that any integer can be broken down into a product of primes in a unique way.
2.5.1 Divisors
Definition 2.25 (Divisor).
Let and be integers, with . We say that divides , and that is a divisor (or factor) of , if is an integer. We also say that is divisible by .
We shall write to mean divides , and to mean that does not divide .
For example:
-
•
divides , since is an integers, and so we write ;
-
•
since is an integer;
-
•
since is not an integer;
-
•
since is not an integer;
-
•
is meaningless since we must have in the definition.
-
•
for any integer , we have and (since and are integers); and
-
•
for any nonzero integer , we have and .
You may be familiar with the term factor from your previous studies; this means the same as divisor.
Proposition 2.26.
Suppose that and are integers, with . The integer is a divisor of if and only if there exists an integer such that .
Proof.
We shall prove both directions of the ‘if and only if’ statement at once.
By Definition 2.25, is equivalent to being an integer. Let be that integer. The equation is equivalent to .
Definition 2.27 (Common divisor).
Let and be integers. If and then we say is a common divisor of and .
Note that, in this definition, there is an implicit assumption that because stating only makes sense if is a nonzero integer by Definition 2.25.
Lemma 2.28 (Linear Combination Lemma).
Let and be integers with common divisor . Then, for any pair of integers and , the integer is divisible by .
Note that the expression above is called a linear combination of and , hence the name of the lemma.
Proof.
Suppose and are integers with common divisor , and let and be integers.
By Definition 2.25, and are both integers. The product of two integers is an integer, and so and are also integers. The sum of two integers is an integer, and so is also an integer. Hence, by Definition 2.25, .
Exercise 2.29.
Write an alternative proof of Lemma 2.28 using the result from Proposition 2.26.
Solution (please try for yourself before looking)
We wish to prove that if and have common divisor then, for any integers and , we have .
Using Proposition 2.26, having divisor means that there exists an integer such that . Similarly, having divisor means that there exists an integer such that . Then, for any integers and , we have
Because , , and are integers, then so is and so Proposition 2.26 tells us that .
Exercise 2.30.
Use Lemma 2.28 to prove that the only integers which can divide a pair of consecutive integers are and .
Solution (please try for yourself before looking)
Let be an integer and suppose and . Applying Lemma 2.28 (with and ) tells us that must divide . But the only divisors of are and . Thus or .
Definition 2.31 (Greatest common divisor, ).
Let and be integers, not both zero. The greatest common divisor of and , denoted by , is the largest common divisor of and .
You should be wary of definitions like this that depend on the ‘existence and uniqueness’ of an object; notice that this definition only makes sense if and actually have a common divisor at all, and that they have a unique largest one.
Exercise 2.32.
Let’s explore Definition 2.31.
-
(a)
How do you know that and really do have a common divisor?
-
(b)
How do you know that they have a greatest common divisor?
-
(c)
Why is it necessary to assume that and should be ‘not both zero’?
Solution (please try for yourself before looking)
-
(a)
Every integer (including zero) has divisors and , so any pair of integers has (at least) these in common.
-
(b)
Assuming , the largest divisor of is . [Why is this the case? Why rather than ?] So the largest a common divisor of and could be is the smaller of and .
-
(c)
Suppose and were both zero. Then every nonzero integer is a common divisor of and , and so there is no largest common divisor.
2.5.2 Coprime integers
Definition 2.33 (Coprime).
Let and be integers. We say that and are coprime if .
For example:
-
•
and are not coprime because ;
-
•
and are coprime because . [Try listing the divisors of and .]
Exercise 2.34.
Which integers are coprime with ?
Solution (please try for yourself before looking)
Because is not defined, it only makes sense to consider .
Every nonzero integer is a divisor of and so . Therefore only and are coprime with .
Lemma 2.35.
Let and be integers. If there exist integers and such that then and are coprime.
Proof.
Let and be integers. Suppose there exist integers and such that . Let be a positive common divisor of and , so that and are integers. The equation
also holds.
Since , , and are integers, so is the entire left-hand side of the equation. Thus must be an integer too, hence . Therefore is the only positive common divisor of and .
Lemma 2.36 (Bézout’s Lemma (Special Case)).
Let and be coprime integers. Then there exist integers and such that .
This is a special case of a result known as Bézout’s lemma.
Proof.
Our strategy is to show that every possible linear combination is a multiple of some constant, then use the fact that and are coprime to deduce that this constant must be 1.
Fix integers and . For each and , the expression is some integer. Because each possible value of is an integer, there must be a smallest positive one – call it . In other words, there exists integers and such that
First we prove that every linear combination must be divisible by . For a contradiction, assume that some is not divisible by . Then dividing by must leave some nonzero remainder. Hence we can write
for some integers and with . [Convince yourself of this.] Then
| (rearranging equation 2.3) | |||||
| (by equation 2.2) | |||||
| (rearranging). |
Therefore is a linear combination of and that is positive and strictly smaller than . This is a contradiction, since is the smallest of these. So no such can exist in equation 2.3, thus must divisible by .
Second, we know two possible linear combinations:
-
•
putting and gives us the linear combination ;
-
•
putting and gives us the linear combination .
Above, we proved that any linear combination must be a multiple of the smallest one . In particular, and must be multiples of ; that is, is a common divisor of and . But and are coprime, so must be . Then equation 2.2 gives the result.
Exercise 2.37.
Lemma 2.35 and Lemma 2.35 are converses. Summarise these two results in one ‘if and only if’ statement.
Solution (please try for yourself before looking)
Let and be integers. There exist integers and such that if and only if and are coprime.
2.5.3 Prime numbers
Definition 2.38 (Prime).
An integer is prime if its only positive divisors are and .
For example:
-
•
is not prime because primes have to be greater than ;
-
•
is prime because its only positive divisors are and ;
-
•
is prime because its only positive divisors are and ;
-
•
is not prime because .
Observe that once we know an integer is prime then, for every positive integer , we know is not prime. [Why?] This observation gives a way of listing prime numbers known as the Sieve of Eratosthenes.
Exercise 2.39.
Prove that a prime cannot divide two consecutive integers.
Solution (please try for yourself before looking)
By definition, a prime number must be an integer greater than . By 2.30, the only integers that divide a pair of consecutive integers are and .
Exercise 2.40.
Suppose is prime and is an integer. What could be? Which integers are such that ?
Solution (please try for yourself before looking)
The divisors of a prime are precisely , so the only possible values of are and . Think about different values of and list their divisors.
-
•
Set . The divisors of are precisely , so .
-
•
Set . The divisors of are precisely , so .
-
•
Set . The divisors of are precisely , so .
-
•
Set . Every nonzero integer is a divisor of , so (the greatest divisor of ).
-
•
If appears in the list of divisors of then .
-
•
If does not appear in the list of divisors of then .
In summary,
Lemma 2.41 (Euclid’s lemma).
Let and be integers, and be prime. If then or .
Proof.
Suppose and ; we shall show that must divide . Since is prime and it follows that . Thus, by Lemma 2.36, there are integers and such that
Multiplying both sides by gives
But and , so divides the left-hand side of the equation. Therefore it must divide , the right-hand side, by the Linear Combination Lemma (Lemma 2.28).
The same argument can be applied to prove that if and then . Therefore the proof is complete.
Lemma 2.42.
Let be integers, and be prime. If then divides at least one of .
Proof.
For a contradiction, suppose is the shortest list of integers such that but does not divide any of . We know from Lemma 2.41 that . [Think about where we use this in the proof.]
Now
and so Lemma 2.41 tells us that or . By assumption, and so . But is a shorter list than and so it must be the case that divides one of . This contradicts the existence of such a list .
Note that there is an alternative proof using ‘strong induction’, a technique we shall discuss in the next chapter.
2.5.4 The Fundamental Theorem of Arithmetic
We shall now prove an important result about the role of primes. The Fundamental Theorem of Arithmetic states that any integer can be written as a product of primes in a unique way.
Theorem 2.43 (The Fundamental Theorem of Arithmetic).
Let be an integer. Then there is a list of positive primes such that
The primes are unique up to reordering.
First let’s interrogate this theorem to make sure we understand the claim. Here are some examples of writing integers as a product of primes.
-
•
is prime and we can write . In equation 2.4, and .
-
•
is prime; . In equation 2.4, and .
-
•
; , , .
-
•
; , , .
-
•
; , , , .
-
•
; , , .
The claim that primes are ‘unique up to reordering’ means, for example, if then we could have either (i) and or, (ii) and . However, there is no other way to write as a product of primes. The collection of primes, unordered, is unique.
Note that Definition 2.38 requires prime numbers to be greater than . Can you see why considering to be prime would complicate the statement of this theorem?
Proof.
Our strategy is to prove that can be written as a product of primes, and then prove that this factorisation is unique.
First, we prove that can be written as a product of primes. For a contradiction, assume that cannot be written as a product of primes and is the smallest integer with this property. Because such an cannot be prime itself [think about why], it must have a positive non-prime divisor strictly greater than and less than . [Think about why – try listing divisors of .] Thus for some positive integers and , both strictly smaller than . Because and are smaller than , and because we assumed was the smallest integer that could not be written as a product of primes, it must be possible to write and as a product of primes. But then is the product of and , both of which are a product of primes. Hence must also be a product of primes. Contradiction; no such can exist.
Now we prove that are unique up to reordering. For a contradiction, assume that is the smallest integer with two different prime factorisations. That is, there is a different list of primes such that
Now divides , so it must also divide . By Lemma 2.42, this means divides some . But is prime and so . In other words, the same prime appears on both lists. Delete this prime from each list to get two new lists:
[Don’t be confused by the notation in the second list – this is just with missing.] These lists must be different because we removed the same prime from each. But then
is a positive integer smaller than that can be written as a product of primes in two different ways. Contradiction, since we assumed was the smallest such integer.
The Fundamental Theorem of Arithmetic has many important consequences, some of which you have known for a long time. For example, in our proof that is irrational (Theorem 2.22), we assumed that a fraction of integers could be written in simplest terms. The fact that this is possible is really a consequence of the Fundamental Theorem of Arithmetic: we can express and as products of primes and then cancel factors until the fraction is as simple as possible.
2.5.5 Euclid’s theorem that there are infinitely many primes
We end this section on integers by presenting a classical result that there are infinitely many prime numbers.
Theorem 2.44 (Euclid’s theorem).
There are infinitely many primes.
Proof.
The strategy here is to start with a finite list of primes and then prove that there must be another one not on the list.
Let be a list of primes. Define to be the integer . Since is an integer greater than , it is either prime or not. Consider these cases separately.
-
(i)
Suppose is prime. Then it cannot be one of because it is greater than each . [Why?] Thus is a prime not on the list of primes.
-
(ii)
Suppose is not prime. The integers and are consecutive, and each in the list divides , so none of the can divide by 2.30. But, by the Fundamental Theorem of Arithmetic, must have a prime divisor and so there must be a prime number that is not on the list.
Note that you will often see this proof start with the assumption that is a list of all primes. As you can see from the proof above, it is not necessary to do this.
Note also that if is a list of primes (including perhaps all of them) then the proof does not assert that the number
is itself prime. The proof shows (i) it is not equal to any and (ii) is not divisible by any . In fact, need not be prime! For example