Chapter 1: A Case Study in Number Theory
The Importance of Proof
This chapter is a case study in elementary number theory. As you read this case study, of course, one intent is for you to learn number theory.
But it is just one of the intended goals of this chapter. In fact it is not even the primary goal. You should pay more attention to the use of logic in proofs.
Do not underestimate the importance of proofs! Proof is fundamental to how all of mathematics gets done. Many students are deceived by their earlier education, and think that mathematics is about numbers, calculation, following steps. But those are the basic technical skills which get you up to the point where you could start doing math. Think of that like exercising so that you have enough strength to play football, or like playing scales so that you have enough knolwedge of the instrument to play real music.
The real math is in the proofs.
Proofs are the primary way that mathematicians talk about their subject. This street of communication goes in two ways: If you want your work in math to be read, understood, and valued by any other person in the mathematical community, then you're going to need to write it in proofs.
But also if you even want to read what mathematicians have discovered, you're going to need to be able to read proofs as well. Because again, the real math is in the proofs.
There's an interesting analogy to cooking and eating. As you learn to cook good food, you actually get better at noticing the food that you eat. You wouldn't have thought that tasting food is a skill you can build, but it is! And the two skills keep reinforcing each other: The more you develop the skill of cooking, the greater your skill at tasting; and the more you develop the skill of tassting, the greater your skill at cooking.
The same is true of consuming and producing proofs. You cannot adequately consume proofs, and fully, deeply understand them—without also developing the skill of producing them. For this reason I strongly urge you not to read this text passively. As the saying goes,
A mathematician reads with a pencil in her hand.
You should be reading and exercising by writing proofs. And then reading, and then exercising, and so on.
Divisibility
A fundamental interest in number theory is to understand how a natural number can be written as a product of smaller numbers. This is the same as the question of "which numbers divide a given number".
For example, 4 can be written as the product . In fact, technically, it can also be written as or .
Equivalently this means that the divisors of 4 are 1, 2, and 4.
Definition
If n is an integer, and some two integers such that , then we say any of the following equivalent statements:
- a and b are factors of n.
- a and b divide n.
- n is a multiple of a, and is a multiple of b.
When a divides n, we write . Note that, if then it follows immediately by definition that there exists an integer b such that .
For each integer n, we will say that the trivial divisors or trivial factors of n are: 1, -1, and .
For example, 5 and 7 are factors of 700. The former is true because (in the definition we use and ). The latter is true because .
Equivalently, 5 and 7 divide 700. Equivalently, 700 is a multiple of 5 and 7.
Therefore and .
The trivial divisors of 700 are 1, -1, 700, and -700.
The trivial divisors are called "trivial" because any number is divisible by its trivial divisors. In that sense, they are not "interesting".
Exercise
Find all of the divisors of -6, and identify which of them are the trivial divisors.
Also find all ways of writing -6 as a product of two integers. For example, one way to write -6 as a product of two integers is , and another is .
Solution
Its divisors are 1, 2, 3, 6, -1, -2, -3, -6. The trivial divisors are 1, -1, 6, and -6.
The following lists all ways of writing -6 as a product of two integers.
.
We cannot talk about a number with no divisors, since there are always the trivial divisors. Instead we define the notion of a number without any "nontrivial divisors", which we call a prime number.
For example, 2 is greater than 1 and has only the factorizations and . Since 1 and 2 are trivial divisors of 2, the fact that 2 has no other factorization means that 2 is prime. Likewise 3 is prime.
But 4 is composite because , and 2 is not a trivial divisor of 4.
For simplicity we will restrict our definition of prime numbers to those larger than 1. Doing otherwise would cause difficulties later on.
Definition
For each integer we say that n is prime if all of its divisors are trivial. If n is not prime, we call it composite.
The prime numbers are the “atoms” in the universe of number theory. They are the fundamental and indivisible objects, which assemble to make all the other objects. This helps to suggest why they are interesting to mathematicians.
Exercise
Find the first 10 primes.
Solution
2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
Let us see a first proof of a theorem.
Theorem
Let a and n be any two natural numbers.
if and only if is a natural number.
Note that the claim is an "if and only if" statement. This means two things: "If then is a natural number" and "If is a natural number then ".
Proof
Let a and n be natural numbers.
Proof
If then is a natural number.
Suppose that a divides n. Then by definition, there is a natural number b such that .
Then , and since we already noted that b is a natural number, then therefore is a natural number.
Proof
If is a natural number, then .
Suppose that is a natural number, and let’s call that number b. So .
Then and therefore, by definition, .
Note
Why do we have to prove such obviously true statements?
Although the theorem is obvious, we will later see very advanced theorems which are not obvious.
In order to prove advanced theorems, we will need to use sophisticated techniques of logic. It is better to see those techniques of logic employed now, while things are easy. That way, when we get to the hard ones, you will already have some facility with the logic.
Theorem
Every integer is divisible by 1 and itself.
Proof
Let n be any integer.
Then .
So .
It also follows from that .
The proof above is extremely simple, yet demonstrates an important point: If a proof is to be rigorous, it must refer to the exact and literal definitions of the terms involved.
To prove that n divides itself, it's not enough to just say that it's "obvious". You must use the definition that a divides b if there exists an integer k such that .
We applied this principle in the proof above, by showing that . When aligning a with 1 and b with n, the definition implies that . When aligning a with n and aligning b with n, the definition implies that .
Exercise
Suppose that are natural numbers such that and .
Prove that therefore .
Solution
Suppose that are natural numbers such that and . Since then by definition there is an integer, x, such that . Since there is some integer, y, such that .
By substitution of one equation into the other, we obtain
Since x and y are natural numbers, therefore is a natural number.
We have now shown that a and xy are factors of c. In particular, this means that .
Exercise
Suppose that are natural numbers such that .
Prove that .
Solution
Suppose that are natural numbers such that . Then by definition there is a natural number x such that .
Then . Since b and x are natural numbers therefore is a natural number, and therefore by definition .
Exercise
Suppose that a and b are natural numbers such that and .
Prove that .
Solution
Since , there is a natural number such that . Since , there is a natural number such that .
Substituting into gives . Since is a natural number, , so . The only natural numbers whose product is 1 are 1 and 1. Thus , and therefore .
Exercise
Suppose that are natural numbers such that and .
Prove that .
Solution
Since , there is a natural number such that . Since , there is a natural number such that .
Therefore . Since is a natural number, it follows from the definition of divisibility that .
Quotient and Remainder
Definition
Let x be an integer and d a positive integer. Let q and r be the unique integers satisfying
We call q the quotient of and r the remainder of . We also call r the modulus of .
We write
The above definition assumes, for any given integers x and , that the quotient and remainder
- exist, and
- are unique.
For example, if and then there is a quotient-remainder pair. Namely, and .
Moreover, there is no other quotient-remainder pair. That is to say, 2 and 4 are the only numbers which satisfy
But so far we just assume that existence and uniqueness are true.
We shouldn’t let such assumptions go unproven.
Theorem
Let x be an integer and an integer.
Then there exist unique integers q and r satisfying
Note that, to prove this theorem we must:
- Find integers q and r satisfying
- Show that no other integers also have these properties.
In the proof below we will proceed in the following order.
- Find r.
- Find q.
- Prove that .
- Prove that .
- Prove that .
- Prove uniqueness. That means, prove that for any integers satisfying and also , we must have that and .
Proof
Finding r.
Let
S explained.
If the definition of S is confusing, let’s see a specific example.
Suppose for instance that and .
Then we find the choices of q such that is nonnegative. That means we consider every nonnegative .
Let's start by trying out .
Of course with we would see even more nonnegative values of .
Note that, regardless of the value of x and d, it is always possible to choose q such that is nonnegative. We will use this fact below, but we will also prove it after we are done with the current proof.
S has at least one element (as explained in the note above).
Because S is a nonempty set of nonnegative numbers, then exists.
Define
Finding q.
Since then
- there is a such that
Showing .
Note that this means , which shows that .
Showing .
Note
If then r is not a lower bound of S.
Suppose that .
Then
From we have
Since then therefore .
But also
This is because so , and so , and so .
But this now show that there is an element in S which is smaller than . Therefore r is not a lower bound of S.
Notice that the principle above equivalently shows that, if r is a lower bound of S then .
But because by definition, then r is a lower bound of S.
Therefore .
Showing .
From the fact that we have that .
Showing uniqueness.
Suppose that there are integers satisfying and .
Note that therefore and so .
This proves that is a multiple of d.
But because and then we must have that .
The only multiple of d which is greater than -d and less than d is just the multiple 0.
Therefore and so .
Because of this, together with we can now infer that . And since we have .
The proof relied on the following principle, which we should prove before moving on to the next topic.
Theorem
Let x be any integer, and d a positive integer.
Then and therefore .
Moreover, therefore a choice of integer q always exists such that is positive.
Notice that the following proof employs a technique called "proof by cases". It breaks the proof up into two possibilties: If then we will show the claim holds, and if then we will again show that the claim holds.
Proof
Let x be an integer.
If then and therefore .
If then and therefore .
Hence, in every possible case, we always have .
If d is a positive integer, then therefore which implies .
Now we can prove that there is always a choice of integer q such that is positive. Set . Then
Since we have already show it follows that , using the fact that .
Exercise
Let and .
(Part 1.)
Find the quotient and remainder of .
(Part 2.)
Write down the three smallest elements of
Repeat the exercise with and .
Exercise
Find the quotient and remainder for and .
Exercise
Let and .
Show that if and only if .
Definition
An integer, n, is called even if . If then n is called odd.
Theorem
For any integer, n, we have that n is either even or odd, but not both.
Proof
Let be the quotient-remainder decomposition of .
By definition, and .
We know, from the quotient-remainder theorem above, that q and r are integers, and .
Therefore the only integers that r could be are 0 or 1.
Case 1: .
Suppose that . Then and therefore n is even.
Because are unique, we cannot also have , hence . Therefore n is not odd.
So n is even or odd, but not both.
Case 2: .
Suppose that . Then and therefore n is odd.
Because of uniqueness, and therefore n is not even.
So n is even or odd, but not both.
The only cases are and . In both cases, the theorem is true.
Therefore the theorem is always true.
Theorem
The product of an even and odd integer is even.
Proof
Let m be an even integer, and n an odd integer. Then and .
By definition of the modulus, there is an integer such that , and an integer such that .
Then their product is
Define . Because k is a product and sum of integers, therefore k is an integer.
By definition, therefore, shows that and therefore mn is even.
Exercise
Prove that the product of two even integers is even.
Prove that the product of two odd integers is odd.
Prove that the sum of two even integers is even, the sum of an even and odd is odd, and the sum of two odds is even.
Greatest Common Divisor
Suppose that you wish to simplify the fraction
One can do it by eliminating a factor of 2, so that the fraction becomes
One could then notice a shared factor of 3 and cancel this as well, resulting in
We could have noticed right at the beginning that each number shared a factor of 6, and that this was the greatest common factor for the two numbers. If we had seen that in the beginning we could have done everything in one step, by dividing by 6.
The above demonstrates just one use of the idea of the following definition.
Definition
Let . For any integer we say that d is a common divisor of a and b, if both and .
If a and b are not both zero, then we say that an integer is the greatest common divisor of a and b, if
When d is the greatest common divisor of a and b, we write .
If then we say that a and b are coprime.
Exercise
Explain why, if a and b are not both zero, then the set of their common divisors is bounded above, and therefore must have a maximum.
Exercise
Find gcd(6,6) and gcd(6,7) and gcd(6,8) and gcd(6,9) and gcd(6,12).
Exercise
Let and assume that not both are zero. Let .
Prove that is a common divisor of and .
Try to prove that is the greatest common divisor of and , but do not break your back trying to do this. You will probably get stuck, since this proof is surprisingly hard.
In order to prove that , you would have to show that, if e is any common divisor of and , then .
Think about proving this, and realize how hard it is to come up with a rigorous proof, using only the theorems that we’ve developed so far in the course. (You can't use other common-knowledge facts about divisors.)
But after some of the other theorems in this chapter, we will actually be able to prove that quite easily.
Exercise
Identify which of the following pairs are coprime.
Integer Combinations
Definition
For any , an expression , where , is called an integer combination of x and y.
The set of all integer combinations of x and y is
For example, set . Then
is an integer combination of x and y.
Another integer combination of them is
Therefore and are in the set of all integer combinations of 2 and 4.
Theorem
Let and not both of them equal to zero.
Then there exists an integer combination of x and y, which is equal to .
Proof
Let , not both equal to zero.
Define the set
Note
is a nonempty set of integers bounded below.
Exercise
Prove that , that it is bounded below, and is a set of integers.
Find a and b.
Define
Show that d is a common divisor.
Let the quotient-remainder decomposition of be
Then
which implies
Now r is a nonnegative linear combination of x and y.
Recall that d is the minimum positive linear combination of x and y, and therefore or .
But since we already have then we must have .
Therefore .
Exercise
Show that . The proof is a rehearsal of the proof that , but mutatis mutandis.
Note
Note: I am fond of using the phrase “mutatis mutandis” in proofs. It means “With the necessary changes having been made”.
I use this phrase to indicate that a part of the proof is very similar to the previous part, but with minor rearrangements or substitutions.
Note
Show that d is the greatest common divisor.
Suppose that is a common divisor of x and y.
Then and therefore .
Hence d is a common divisor, and an upper bound on the set of common divisors. Hence it is the maximum element, in the set of common divisors.
Therefore .
Exercise
Find .
Then find a and b such that .
Now find another pair of a and b such that .
Now find a and b such that .
The lesson.
Given x and y you have a theorem guaranteeing the existence of a and b such that
But just because you have a theorem doesn’t mean you have an algorithm to efficiently find a and b. We will see an algorithm later.
Exercise
Explain why it is impossible to find integers a and b such that
Exercise
Let and not both zero. Let .
Show that . Hint: Apply the integer combination theorem to , and multiply by 2. Then argue that any common divisor of and must divide .
The lesson.
We couldn’t do this before we had the integer combination theorem, but we can do it now. Hence the integer combination theorem is valuable.
Prime Numbers
Exercise
Find integers such that but also and .
Hint: If you read the statement of the next theorem, it suggests that you should not choose a to be a prime number.
The following is a fundamental fact about prime numbers, which deeply characterizes how they behave.
Theorem
Let p be a prime and such that .
Then either or .
The following proof uses a particular way of proving an “or” statement: In order to prove or , we prove that if then .
We will study logical patterns like this one in the next chapter.
Proof
Suppose that p is prime and such that .
Suppose that .
Since p is prime, its only positive divisors are 1 and p. Therefore is 1 or p.
But since then .
By the integer combination theorem, there are such that
Multiplying throughout by b,
Now because .
Also because .
Therefore p divides the left-hand side, . But since this equals the right-hand side, b, we must have that that .