Download Booklet of lecture notes, exercises and solutions.

Document related concepts

Infinitesimal wikipedia , lookup

Brouwer–Hilbert controversy wikipedia , lookup

Large numbers wikipedia , lookup

Foundations of mathematics wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

List of prime numbers wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Collatz conjecture wikipedia , lookup

Wiles's proof of Fermat's Last Theorem wikipedia , lookup

Theorem wikipedia , lookup

Fermat's Last Theorem wikipedia , lookup

Mathematical proof wikipedia , lookup

Addition wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Elementary mathematics wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
MAS114: Numbers and Groups
Semester One
Dr E Cheng
J24 Hicks Building
[email protected]
2012–13
http://cheng.staff.shef.ac.uk/mas114/
Lecturer’s version
Without beauty, we are lost.
Contents
Introduction
1 Sets and functions
1.1 Important sets . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 General set notation . . . . . . . . . . . . . . . . . . . . . . .
1.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
7
7
9
12
2 Logic
14
2.1 Basic logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Theorems and things . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2
CONTENTS
3 The natural numbers and induction
25
3.1
The basic principle . . . . . . . . . . . . . . . . . . . . . . . .
25
3.2
Further variants . . . . . . . . . . . . . . . . . . . . . . . . . .
33
3.3
The well-ordering axiom . . . . . . . . . . . . . . . . . . . . .
36
4 How to write proofs
39
4.1
What does a proof look like? . . . . . . . . . . . . . . . . . .
39
4.2
Why is writing a proof hard? . . . . . . . . . . . . . . . . . .
39
4.3
What sort of things do we try and prove? . . . . . . . . . . .
40
4.4
The general shape of a proof . . . . . . . . . . . . . . . . . .
41
4.5
What doesn’t a proof look like? . . . . . . . . . . . . . . . . .
43
4.6
Practicalities: how to think up a proof . . . . . . . . . . . . .
48
5 The integers and divisibility
51
5.1
Divisibility, primes and highest common factors . . . . . . . .
51
5.2
The infinitude of primes . . . . . . . . . . . . . . . . . . . . .
53
5.3
Division with remainder . . . . . . . . . . . . . . . . . . . . .
55
5.4
Highest common factors and Euclid’s Algorithm . . . . . . .
55
5.5
The Fundamental Theorem of Arithmetic . . . . . . . . . . .
62
5.6
The diophantine equation Ax + By = C . . . . . . . . . . . .
66
6 The integers (mod n) and congruences
75
6.1
Modular arithmetic . . . . . . . . . . . . . . . . . . . . . . . .
75
6.2
Solving ax ≡ b (mod m) . . . . . . . . . . . . . . . . . . . . .
78
6.3
Simultaneous congruences: CRT . . . . . . . . . . . . . . . .
82
6.4
Fermat’s Little Theorem and Wilson’s Theorem . . . . . . . .
86
6.5
Euler’s φ-function and the Fermat-Euler Theorem . . . . . .
92
7 The real numbers and convergent sequences
. . . . . . . . . . . . . . . .
99
7.1
Rational and irrational numbers
99
7.2
The real numbers . . . . . . . . . . . . . . . . . . . . . . . . . 101
7.3
Convergent sequences . . . . . . . . . . . . . . . . . . . . . . 101
Exercises
116
Logic puzzles
136
CONTENTS
3
Information
Please see the course webpage for answers to some Frequently Asked Questions on matters such as what to do if you miss a lecture.
• Exercises are to be handed in at the end of the tutorial of that week.
A selection of pertinent exercises will be marked, but if you would like
more feedback on your other solutions you may ask at the next tutorial
when your work is handed back to you.
• Logic puzzle solutions are also to be handed in at your tutorial. There
will be a prize each week, for the first correct solution drawn out of
a “hat” at Wednesday’s lecture. (If you’re not there the prize will be
given to the next one.)
• There will be an online test each week deadline, to be announced.
These will count for
...........................................
The deadline for these is:
...........................................
• There will be “office hours” each week when you can come and ask for
extra help with any lecture material or exercises. These are at
...........................................
• For this course you have two hours of lectures and one hour of tutorial
per week. We expect you to equal these hours in private study per
week, so that you do three hours per course and 18 hours in total per
week. If you do not do this amount, you are likely to find
that there is too much material to learn all at once before
the exams.
4
Introduction
Introduction
The history of maths shows that its greatest contribution to science, culture and technology has been in terms of expressive power,
to give a language for intuitions which enables exact description,
calculation, deduction.
Ronald Brown
A mathematician, like a painter or a poet, is a maker of forms.
G.H.Hardy
If you do not like abstraction, why are you doing mathematics?
Perhaps you should be in finance, where all the numbers have dollar
signs in front of them.
John Baez
I have done an experiment on two people and a raw carrot stick.
One person chewed sixteen times; the other I gave up counting
when he reached one hundred.
Eugenia Cheng
What is mathematics?
How many squares are there on a chessboard?
A chessboard has 204 squares
and
A chessboard has 64 squares
What am I on about?
Introduction
5
Moral:
We must be careful how we define things.
Contrary to popular belief, mathematics is not “the study of numbers”.
However, numbers are important building blocks for mathematics, and a
good place to start looking at how mathematics is done.
Mathematics is...
The rigorous study of conceptual systems.
Mathematics may be seen as having two general roles:
1. To provide a lanugage for making precise statements about concepts,
and a system for making clear arguments about them.
2. To idealise concepts so that a diverse range of notions may be compared and studied simultaneously by focusing only on relevant features
common to all of them.
Mathematics as a language has developed with a general aim of eliminating
ambiguity. What has been sacrificed in pursuit of this ideal?
scope—rigour can’t be imposed on everything
..........................................................................
Logic
If sets and numbers are building blocks of mathematics, logic is the cement
that holds them all together. The two most important things about making
progress in mathematics are:
1. Only using things we can and have defined very precisely.
2. Only using impeccable logic to reason with them.
6
Introduction
Logic is a bright search-light that cuts through the fog of the world. Beware:
sometimes it’s so bright it’s blinding, and then it’s a relief to dim that light
a bit and rest in cool darkness for a while.
Proofs are the buildings we build up using our bricks and cement. Proof is
how we know that things are true in mathematics. Constructing a proof is
a bit like building a building—for a very simple building, you might be able
to do it in one go, by intuition. But for more complicated buildings, it is
essential to make a plan, and possibly several different plans to see which is
best. Sometimes it’s even necessary to build a scale model first to see how
it will look.
Two of the greatest misconceptions about mathematics are:
Misconception 1: Mathematics is all about numbers.
Misconception 2: Mathematics is all either right or wrong.
Is a building either right or wrong? No, of course not. If it falls down, we
could probably say it’s “wrong”, but is it otherwise “right”?
Likewise mathematics can be completely wrong, but it can also be all sorts
of types of dodgy without being completely wrong. One of the most common
ways that students lose marks in exams is not because their maths is entirely
“wrong”, but because their logic is dodgy.
Mathematics is like grammar in a language. If you get your grammar wrong
you can probably still be understood if you’re saying something simple. But
if you try and say something a bit more complicated with the wrong grammar
you might end up unintelligible, or you might end up saying something
completely different from what you mean.
In this course we will find out some things about different types of numbers,
some of which may seem very obvious. But most importantly we’ll see how
mathematics is done.
7
1
Sets and functions
The main topic of the course is to discuss properties of numbers. First we’ll
talk about some important sets of numbers, and some important things
about sets in general.
1.1
Important sets
Question 1.1.1. Mathematics isn’t all about numbers, so why are we so
interested in numbers?
they are still important
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
good place to start trying out proper maths
2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
useful prototype for other things
3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
going to mars
4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Question 1.1.2. What kinds of numbers do you know about?
N, Z, Q, R, C
.........................................................................
Definition 1.1.3. The natural numbers, denoted N, consist of all of the
counting numbers, i.e., the positive whole numbers 1, 2, 3, . . . (footnote about
dots1 ). In set notation:
N = {1, 2, 3, . . .}.
z
Remark 1.1.4. Sometimes people include 0 as a natural number; other
people get very excited about this issue. Do you think it’s interesting?
The ancient Greeks didn’t consider 1 to be “a number”, apparently.
1
Note that the three dots . . . indicate that the sequence extends infinitely far. You
should be a bit careful with using . . . as an abbreviation – for example, the notation
1, . . . , 64 might refer to all natural numbers between 1 and 64, or all square numbers, or
even all powers of 2. Make sure when you use . . . that it really is clear to the reader
exactly what needs to be filled in. What comes next after 1, 2, 4, 8, 16, . . .?
8
Section 1. Sets and functions
Note that in N we can only really add and multiply.
We’re like children aged about ...........
1500BC or so? 700 for 0
or humans from the year ...................
Definition 1.1.5. The integers consist of all the whole numbers. The set
Zahl
of integers is denoted Z (the German word for number is ................), so
that:
Z = {. . . , −2, −1, 0, 1, 2, . . . }.
z
Remark 1.1.6. Of course, every natural number is an integer, so that
N ⊂ Z.
(Actually philosophers aren’t so sure about this. Are you?)
Certainly there are integers which are not natural numbers – for example,
−1 ∈
/N
.....................................
1, 1112
Again note that “. . .” is used to indicate that we “go off to infinity”; here
our sequence goes off to infinity in both directions, positive and negative.
202BC
We have made it to the year ................ or age ...................
Definition 1.1.7. The rational numbers Q consist of all fractions
a ∈ Z and b ∈ N.
a
b
with
z
Remarks 1.1.8.
1. Note that the expression
a
b
isn’t unique.
2. Note that each integer n can also be represented as
Z ⊂ Q.
n
1,
a fraction, so
3. We can now do division! We have reached the age....................
We haven’t written Q as a list in the same way that we did for N or Z. But
we can do this:
0 1 1 1 1 2 2 1 1 2 2 3 3
Q=
, ,− , ,− , ,− , ,− , ,− , ,− ,...
1 1 1 2 2 1 1 3 3 2 2 1 1
1.2 General set notation
9
What’s the rule we’re using?
we list the fractions ordering them by the sum of the numerator and denominator, and list fractions together with their negatives.
Definition 1.1.9. The set of real numbers is denoted R. One can think of
this as being the set of all possible decimal expansions. It’s actually rather
hard to define them precisely.
z
How old are we now and what can we now do? division?
Since each fraction has a decimal expansion, Q ⊂ R. Examples include
√
2 = 1.4142 . . . and π = 3.1415 . . . . We will see later in the course that
√
2∈
/ Q.
Question 1.1.10. Is it true that π =
22
7 ?
Question 1.1.11. Can we write R as a list?
No: the reals are more infinite than the rationals...
..........................................................................
1.2
General set notation
A set is a collection of objects. The objects are called elements of the set.
We use the following notation. Given a set S:
• a ∈ S means a is an element of S
• a 6∈ S means a is not an element of S
no. of elements
• |S| = the order of S, i.e. ............................................
For example N, Z, N0 , Q, R, C.
X = {1, 3, 5} is an example of a finite set.
∅ is the empty set, which has no elements. This can also be written { }. It
is not the same as {∅}.
Dire warning: This definition of a set will do for now, but such a simple
definition quickly causes problems, as shown by Russell’s Paradox.
10
Section 1. Sets and functions
Let M be the set containing every set that is not a member of itself.
Is M a member of itself?
To avoid this problem, we later have to demand that sets are not allowed
to be members of themselves. But for now (the whole of this course and
possibly your whole degree) we don’t have to worry about it.
Definition 1.2.1. We say A is a subset of B if every element of A is an
element of B. Formally
∀x, x ∈ A =⇒ x ∈ B
and we write
A ⊆ B.
Then A = B if and only if A ⊆ B and B ⊆ A, that is, they have the same
elements:
x ∈ A ⇐⇒ x ∈ B.
z
Remember: x ⊂ y is different from x ∈ y.
If you write the wrong symbol it’s wrong.
Here are some things we can do with sets.
Definition 1.2.2. Fix a set S which is “the universe” and consider A, B ⊆
S. We have
• union
A∪B
= {x ∈ S | x ∈ A or x ∈ B}
• intersection
A∩B
= {x ∈ S | x ∈ A and x ∈ B}
• complement
A0 = Ac = Ā
• difference
= {x ∈ S | x 6∈ A}
A \ B = A − B = {x ∈ A | x 6∈ B}
Theorem 1.2.3. De Morgan’s Law
1. (A ∩ B)0 = A0 ∪ B 0
A0 ∩ B 0
2. (A ∪ B)0 =...........................
1.2 General set notation
11
Proof.
1. We show that every element of the left hand side is an element of the
right, and that every element of the right hand side is an element of
the left.
Consider x ∈ (A ∩ B)0 .
so x 6∈ A ∩ B by definition of complement
so x 6∈ A or x 6∈ B.
so x ∈ A0 or x ∈ B 0
so x ∈ A0 ∪ B 0 .
Conversely, consider x ∈ A0 ∩ B 0 .
Then x ∈ A0 or x ∈ B 0
so x ∈ A0 or x ∈ B 0
so x 6∈ A or x 6∈ B.
so x 6∈ A ∪ B by definition of complement
so x ∈ (A ∪ B)0
2. We show X 00 = X and then deduce the second part from the first.
(Exercise).
2
Definition 1.2.4. Given a set S, the power set of S is the set of all subsets
of S, and is written P(S).
z
Examples 1.2.5.
1. S = {1, 2}, P(S) = {∅, {1}, {2}, {1, 2} }
2. ∅ ⊂ A for any A, so ∅ ∈ P(A).
3. P(∅) = {∅}
12
Section 1. Sets and functions
1.3
Functions
Functions are things that “map” elements of one set to another.
Definition 1.3.1. Given sets A, B, a function f : A −→ B gives for each
a ∈ A a unique element f (a) ∈ B.
We write f : a 7→ f (a).
• A is called the domain of f .
• B is called the range of f .
• f (a) is called the image of a under f .
z
Some pictures:
the usual injective/surjective, demonstrating we can’t go outside the range
or have one thing go to two things
2, 1112
Examples 1.3.2.
1. A = {0, 1}, B = {0, 1, 2, 3}
f (a) = a + 1 is a function f : A −→ B.
2. A = {0, 1, 2, 3}, B = {0, 1}
f (a) = remainder when dividing by 2. This is a function f : A −→ B.
3. A = {0, 1, 2, 3}, B = {0, 2, 4, 6}
f (a) = 2a is a function f : A −→ B.
4. A = {0, 1, 2, 3}, B = {0, 1}
f (a) = 2a is not function f : A −→ B.
1.3 Functions
13
Note: Given functions f, g : A −→ B, f = g if and only if they agree on all
of A, that is
f = g ⇐⇒ ∀a ∈ A, f (a) = g(a).
Definition 1.3.3. Given f : A −→ B, g : B −→ C, we can form the
composite
g ◦ f or gf : A −→ C
given by
f
A −→
a
7→
g
B
−→
C
f (a)
7→
g(f (a))
z
Definition 1.3.4. Let f : A −→ B be a function.
• We say f is injective if “nothing gets hit twice”, that is
∀x, y ∈ A, f (x) = f (y) =⇒ x = y.
• We say f is surjective if “everything gets hit”, that is
∀b ∈ B ∃a ∈ A s.t.
f (a) = b.
• We say f is bijective if it is both injective and surjective.
Examples 1.3.5. Using the functions from Examples 1.3.2:
1. This is/is not* injective, and is/is not* surjective inj not surj
2. This is/is not* injective, and is/is not* surjective surj not inj
3. This is/is not* injective, and is/is not* surjective bij
z
14
Section 2. Logic
2
Logic
2.1
Basic logic
The starting point is “logical implication”.
“A implies B” means that if A is true, then B has to be true.
A⇒B
A implies B
A only if B
A is sufficient for B.
A⇐B
A is implied by B
A if B
A is necessary for B.
A ⇐⇒ B
A is logically equivalent to B
A iff B
A is necessary and sufficient for B.
Which of the following mean A ⇒ B and which mean B ⇒ A?
1. A is true if B is true B ⇒ A
2. if A is true then B is true A ⇒ B
3. A is true only if B is true A ⇒ B
4. A is a necessary condition for B B ⇒ A
5. A is a sufficient condition for B A ⇒ B
Definition 2.1.1. If we start with an implication A ⇒ B:
1. The converse is “B ⇒ A”.
The converse is completely independent of the original.
2. The contrapositive is “not B ⇒ not A”.
The contrapositive is logically equivalent to the original.
z
This means that the contrapositive is true if the original is true, and false
if the original is false. This is useful because sometimes it’s easier to prove
the contrapositive than the original.
Whereas the converse can be true or false regardless of whether the original
is true or false.
2.1 Basic logic
15
This is incredibly important.
If you don’t understand it you must memorise it.
I am not joking.
People get get “if” and “only if” wrong all the time in normal speech. But
remember, mathematics is not normal speech. We do not say things like
You can only have ice cream if you eat your broccoli!
Example 2.1.2.
Let A be the statement “I just won the lottery”.
Let B be the statement “I have tons of money”.
yes
Is A ⇒ B true? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
if I have tons of money, I just won the lottery
The converse is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
which is/is not* true.
no eg maybe I inherited it
The contrapositive is
if I don’t have tons of money, I can’t have just won the lottery
..........................................................................
Example 2.1.3.
Let A be the statement “Steve lives in Sheffield”.
Let B be the statement “Steve lives in England”.
yes
Is A ⇒ B true? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The converse is
If Steve lives in England then Steve lives in Sheffield
..........................................................................
which is/is not* true.
The contrapositive is
If Steve doesn’t live in England then he doesn’t live in Sheffield
..........................................................................
Example 2.1.4.
Let A be the statement “Steve lives in Sheffield”.
Let B be the statement “Steve is English”.
16
Section 2. Logic
no
Is A ⇒ B true? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The converse is
If Steve lives is English then Steve lives in Sheffield
..........................................................................
which is/is not* true.
The contrapositive is
If Steve isn’t English then he doesn’t live in Sheffield
..........................................................................
3, 1112
Negation
The negation of a statement is a bit like the opposite, but we have to be
very careful what that means. There are many ways of thinking of the
“opposite” in ordinary speech, and not all of them are negations.
Definition 2.1.5. The negation of a statement A is “A is not true”, or “it
is not true that A holds”.
z
Examples 2.1.6.
I am not happy
1. The negation of “I am happy” is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
However, in normal speech we might say the opposite is “I am sad”.
This is not the negation.
I am not in front of you
2. The negation of “I am in front of you” is . . . . . . . . . . . . . . . . . . . . . . . . . . .
However, in normal speech the opposite is “I am behind you”. This is
not the negation.
A does not imply B
3. The negation of “A implies B” is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
It is not “A ⇒ not B”.
One way we can check this is by using truth tables.
2.1 Basic logic
17
A B A⇒B
0
0
1
0
1
1
1
0
0
1
1
1
draw square truth table here
A B B⇒A
0
0
1
0
1
0
1
0
1
1
1
1
A B
draw square truth table here
not A not B
not A ⇒ not B
0
0
1
1
1
0
1
1
0
0
1
0
0
1
1
1
1
0
0
1
A B
not A not B
not B ⇒ not A
0
0
1
1
1
0
1
1
0
1
1
0
0
1
0
1
1
0
0
1
A B
draw square truth table here
draw square truth table here
not B A ⇒ not B A ⇒ B
not (A ⇒ B)
0
0
1
1
1
0
0
1
0
1
1
0
1
0
1
1
0
1
0
0
1
0
1 1
ble here
draw square truth ta-
18
Section 2. Logic
Note that the easiest way of working out the truth values for A ⇒ B is to
think “the only thing that’s bad is if A is true and B is false”.
not (A and not B)
This hints at another way of saying “A implies B”: . . . . . . . . . . . . . . . . . . . . . .
A and not B
which gives us another way of negating “A implies B”: . . . . . . . . . . . . . . . . . . .
Let’s write some truth tables for “ and ” and “ or ”.
A B A and B
0
0
0
0
1
0
1
0
0
1
1
1
draw square truth table here
A B A or B
0
0
0
0
1
1
1
0
1
1
1
1
draw square truth table here
Note that
not A or not B
• the negation of A and B is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
not A and not B
• the negation of A or B is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This should remind you of De Morgan’s Law (Theorem 1.2.3).
2.1 Basic logic
19
Quantifiers
Our final logical ingredient is “for all” and “there exists”. This enables us
to move from things like
1−1 = 0
2−2 = 0
3−3 = 0
..
.
to
for all n ∈ N, n − n = 0
and
there exists a ∈ Z such that for all n ∈ N, n + a = n
Notation: we use these handy symbols:
∀x
means
∃y
means there exists y
s.t.
means
for all x
such that
For example
∀n ∈ N, n − n = 0
Note that order matters. Are these the same?
∀x ∈ Z ∃y ∈ Z s.t. x + y = 0
∃y ∈ Z s.t. ∀x ∈ Z x + y = 0
Or an example in words:
∀ people x in the room, ∃ a date y such that x was born on y.
∃ a date y such that ∀ people x in the room, x was born on y.
20
Section 2. Logic
Negation of quantifiers
Examples 2.1.7.
How do we negate the following statements?
“Everyone in the room is 18.”
There is someone in the room who is not 18
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
“There is someone in the room who is asleep.”
Everyone in the room is awake.
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Remark 2.1.8. Extremely important
Let P (x) be a statement involving x.
∃x s.t. not P (x)
• The negation of “∀x P (x)” is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
∀xnot P (x)
• The negation of “∃x P (x)” is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Note 2.1.9.
Here are some popular wrong ways of negating these.
The negation of “∀x P (x)” is not “∀x not P (x)”.
The negation of “∃x P (x)” is not “∃x not P (x)”.
This is another case where the notion of “opposite” in normal speech isn’t
quite right: you might well say the opposite of “everyone is asleep” is “everyone is awake” but this is not the negation.
We can string all this together as well: to negate a string of ∀ and ∃ just:
1. turn every ∀ into ∃,
2. turn every ∃ into ∀, and
3. negate the statement at the end.
2.1 Basic logic
21
(You will need to put “ s.t. ” in the right places too.)
This is another thing that is incredibly important.
If you don’t understand it you must memorise it.
Seriously.
Examples 2.1.10.
∃y ∈ Z s.t. ∀x ∈ Z x + y = 0
1.
∀y ∈ Z ∃x ∈ Z s.t.
x + y 6= 0
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
∀ε > 0 ∃N ∈ N s.t. ∀n ≥ N
2.
xn < ε
∃ε > 0 s.t. ∀N ∈ N ∃n ≥ N s.t. xn ≥ ε
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
∀a ∃b s.t. ∀c ∃d s.t. ∀e ∃f s.t. p
3.
∃a s.t. ∀b ∃c s.t. ∀d ∃e s.t. ∀f not p
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 2.1.11.
Slightly subtle: ∀x p(x) ⇒ q(x)
∃x s.t. p(x) but not q(x)
Negation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Proving things with quantifiers in
To prove “∃x s.t. A” we just have to exhibit one value of x for which A is
true, say 142.
To prove “∀x, A” we have to show that A is true for all values of x.
However, if x can be any integer, say, we don’t literally go through every
single integer and show that A is true. We just write x for an arbitary
integer, and make sure our proof only depends on properties that hold for
all integers.
For example
22
Section 2. Logic
• we can use the fact that x can be expressed as a product of prime
numbers, but
• we can’t use the fact that x is positive, or even, or a prime.
Do you find this confusing? Does it feel like you’ve only proved it for one
value of x?
NB When we say “pick an arbitrary integer x” it doesn’t mean that you
should go ahead and pick one, say, 142. It means that we will persist in
calling it x and it could be any integer but it’s going to be the same one all
the way through.
2.2
Theorems and things
Often in pure mathematics, the text is broken up into chunks marked Theorem, Definition and so on. This method of writing goes back to Euclid, and
his famous Elements is written in a fairly similar way. Here’s a rough guide
to the terminology.
Theorem, Proposition, Lemma. These are all statements that require
a proof. In order of size or importance:
theorem > proposition > lemma
Question 2.2.1. What’s the plural of “lemma”? I like “lemmata”.
Lemmata do all the work and Theorems take all the credit.
Corollary. These also need proof, but corollaries are meant to follow more
or less immediately from the result before. But what does “immediately”
mean??
2.3
Proof
We’ll have a detailed section on how to write proofs later, after we’ve actually
seen a few more proofs. For now, we’ll just sum up what a proof is.
2.3 Proof
23
A proof is a series of statements, each of which follows logically from what has gone before. It starts with things we are
assuming to be true. It ends with the thing we are trying to
prove.
So, like a good story, a proof has a beginning, a middle and an end.
• Beginning: things we are assuming to be true, including the definitions of the things we’re talking about
• Middle: statements, each following logically from the stuff before it
• End: the thing we’re trying to prove
The point is that we’re given the beginning and the end, and somehow we
have to fill in the middle. But we can’t just fill it in randomly – we have to
fill it in in a way that “gets us to the end”.
It’s like putting in stepping stones to cross a river. If we put them too far
apart, we’re in danger of falling in when we try to cross. It might be okay,
but it might not. . . and it’s probably better to be safe than sorry.
Even when you know how to do it, writing a proof takes planning, effort
and inspiration. For all but the simplest proofs, you’ll probably need to
plan it out in advance of actually writing it down. Like building a long
bridge or a large building – it needs some planning, even though building
a small bridge or a tiny hut might not. This might be very different
from maths you’ve done before, where you’re encourage to show
all your working because you can score points for it.
A proof should have the following shape.
1. At the beginning, say what you are assuming to be true.
2. You might also want to say what you are aiming to prove.
3. Each line should be a true statement, together with a justification of
why that statement follows logically from what has gone before it. It
is very helpful to the reader if you write each statement on a different
line of the page.
24
Section 2. Logic
4. The last statement in the proof should be the thing that you were
aiming to prove.
5. Draw a box at the end or write “QED” to show it’s the end.
4, 1112
2.
25
3
The natural numbers and induction
We will be examining the behaviour of different types of numbers, starting
with the natural numbers. In this section we look at a very important
method of proving things: the principle of induction.
How can a method of proving things be a property of the natural numbers??
3.1
The basic principle
Induction is magic.
Induction is like cheating...except it isn’t cheating!
mention stairs, being helicoptered in, etc
To show we can reach the nth stair on a staircase, we don’t actually have
to go there. We just have to show:
• we can get to the bottom of the staircase, and
• we know how to go up one stair.
I think this is why children are so excited when they first learn to climb
stairs—they’ve discovered the principle of induction!
Here’s a simple (and as usual somewhat contrived) example.
Example 3.1.1. Let x1 = 1, and define a sequence x1 , x2 , x3 , . . . by
xn+1 = 1 +
Explain why all the xn are rational.
1
xn
26
Section 3. The natural numbers and induction
We could write down a few terms of this sequence:
x1 = 1
x2 = 1 +
1
1
=2
x3 = 1 +
1
2
=
3
2
x4 = 1 +
2
3
=
5
3
x5 = 1 +
..
.
3
5
=
8
5
Now it’s “obvious” isn’t it? Because
clearly xk+1 is rational whenever xk is
and we started with a rational number so that’s fine
..........................................................................
The things we can try to prove by induction are statements depending on a
natural number. For example we might try to prove:
n!
1. The number of ways of ordering the numbers 1, . . . , n is . . . . . . . . . . . .
2n
2. The number of subsets of {1, . . . , n} is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
n(n+1)
3. 1 + 2 + · · · + n = . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4. Every natural number n can be expressed as a product of primes.
By a proposition P (n), we mean an assertion involving the natural number
n which is either true or false.
For example:
• If P (n) is the assertion that n = n2 , then P (1) is true, because 1 = 12 ,
but P (2), P (3), P (4), . . . are all false.
• If P (n) is the assertion that
1 + 2 + 3 + · · · + n = 21 n(n + 1),
then P (n) is true for all n ∈ N.
3.1 The basic principle
27
Definition 3.1.2. The Principle of Induction says:
Suppose that P (n) is an assertion such that:
1. P (1) is true;
2. for all k ∈ N, P (k) =⇒ P (k + 1) .
Then P (n) is true for all n ∈ N.
z
Note that “P (k) =⇒ P (k + 1)” means that if P (k) is true, then P (k + 1) is
doomed to be true. But it doesn’t say anything about whether or not P (k)
and P (k + 1) are actually true—it is hypothetical.
The fact that the Principle of Induction (PI) holds is actually a
defining feature of the natural numbers. It’s actually a property
of the natural numbers. Later we’ll see that it’s equivalent to the
“Well-ordering axiom” which seems much more like a sensible property than PI does2 .
Here’s an example of induction in practice.
Example 3.1.3. Use induction to prove that for all n ∈ N,
1 + 2 + 3 + · · · + n = 12 n(n + 1).
Do you know how to prove this some other way? eg combinatorially
Solution.
• Initial step.
When n = 1, the assertion is that 1 = 12 1(1 + 1), which is clearly true.
• Induction step.
Assume that the result is true when n = k, say, i.e.,
1 + 2 + 3 + · · · + k = 12 k(k + 1).
2
Warning: philosophers might tell you that proof by induction doesn’t work. That’s
because they have a different kind of induction. To avoid ambiguity when talking to
philosophers, ours is called the Principle of Mathematical Induction
28
Section 3. The natural numbers and induction
We aim to deduce that the result is true for n = k + 1.
Now
1 + 2 + 3 + · · · + k + (k + 1) =
=
=
1
2 k(k + 1) + (k + 1)
1
2 (k + 1)(k + 2)
1
2 (k + 1)((k + 1) + 1),
where the first equality just comes from the result for n = k.
But this is exactly the assertion for n = k + 1, and so we have deduced
the assertion for n = k + 1 from the assertion for n = k.
Thus by induction the result is true for all n ∈ N.
It is important to note that in the induction step, we do not make
any attempt to prove P (k). We just assume that it is true, and
show that P (k + 1) then follows from it. Just from the induction
step, we don’t know whether or not any of the P (n) are true.
Example 3.1.4. Prove that for all n ∈ N,
n(n + 1)(2n + 1)
6
1 + 2 + 3 + · · · + n = ..........................................
2
2
2
2
Solution. Proof by induction.
• Initial step.
When n = 1 the right hand side is
1.2.3
6
which clearly equals 1. So the result is true.
• Induction step.
Assume that the result is true when n = k, say ie
k(k + 1)(2k + 1)
12 + 2 2 + 3 2 + · · · + k 2 =
6
We aim to deduce that the result is true for n = k + 1.
2
3.1 The basic principle
29
Now
2
2
2
2
2
1 + 2 + 3 + · · · + k + (k + 1) =
k(k + 1)(2k + 1)
+ (k + 1)2
6
by induction hypothesis
NB what we’re aiming for etc
So we have deduced the result for n = k + 1 from the result for n = k.
Thus by induction the result is true for all n ∈ N.
2
Remark 3.1.5. Note that if we tried to do
n(n + 1)(2n + 1)
+ 11
6
the induction step would still work, even though the result isn’t true. That
is:
If
12 + 2 2 + 3 2 + · · · + n2 =
n(n + 1)(2n + 1)
+ 11
6
is true for n = k
Then it is also true for n = k + 1.
However the result is not true for all n ∈ N because
The initial step is false
..........................................................................
Induction isn’t just useful for summing up series. Sometimes more ingenuity
is required to prove the induction step. This is where things become funner3 .
3
“Funner” isn’t really a word, although some people think it should be. I don’t actually
think it should be, because etymologically the adjective “fun” is derived from a verb.
30
Section 3. The natural numbers and induction
Example 3.1.6. Prove that for all n ∈ N, the number of ways of ordering
1, 2, . . . , n
n!
is ..............
Can you prove this without induction?
Any argument that involves saying “and so on” in the middle, is probably
hiding an induction.
Solution. Proof by induction.
• Initial step.
When n = 1:
There is obviously only 1 way of ordering the number 1
.....................................................................
• Induction step.
Assume that the result is true when n = k, say, ie the number of ways
k!
of ordering the numbers 1, 2, . . . , k is ...................
We aim to deduce that the result is true for n = k + 1. Now, to order
the numbers 1, . . . , k + 1 we
1. pick the first number, and
2. order the remaining k numbers
k+1
The number of ways of picking the first number is . . . . . . . . . . . . . . . . . .
k!
The number of ways of ordering the remaining k numbers is . . . . . . . .
—by the induction hypothesis.
Therefore the total is obtained by multiplying these to give
(k + 1).k! = (k + 1)!
So we have deduced the result for n = k + 1 from the result for n = k.
Thus by induction the result is true for all n ∈ N.
2
3.1 The basic principle
31
1
Remark 3.1.7. This (sort of) explains why 0! = .......
Example 3.1.8. Prove that for all n ∈ N, the number of subsets of the set
{1, 2, . . . , n}
2n
is ............
Do you know how to prove this without induction?
Solution. Proof by induction.
• Initial step.
When n = 1 the set {1} has precisely 2 subsets:
{1} itself and ∅
.....................................................................
• Induction step.
Assume that the result is true when n = k, say, ie
We aim to deduce that the result is true for n = k + 1.
Now a subset of {1, . . . , k+1} either does or doesn’t contain the number
k + 1.
2k
– Number of subsets not containing k + 1 = . . . . . . . . . . . . . . . . . . . . .
—by induction hypothesis.
2k
– Number of subsets containing k + 1 = . . . . . . . . . . . . . . . . . . . . . . . . .
—by induction hypothesis.
Therefore the total number of subsets is
2k + 2k = 2.2k = 2k+1
So we have deduced the result for n = k + 1 from the result for n = k.
Thus by induction the result is true for all n ∈ N.
2
Example 3.1.9. Prove by induction that for all n ∈ N, n2 + n is always
even.
32
Section 3. The natural numbers and induction
Can you prove this without induction?
Solution.
• Initial step.
1 + 1 = 2 obviously even
When n = 1, n2 + n = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
• Induction step.
Assume that the result is true when n = k, say, ie k 2 + k is even.
We aim to deduce that the result is true for n = k + 1.
Now
(k + 1)2 + (k + 1) =
k 2 + 2k + 1 + k + 1
rearrange, and so on
So we have deduced the result for n = k + 1 from the result for n = k.
5, 1112
Thus by induction the result is true for all n ∈ N.
2
Remarks 3.1.10.
1. Note that this example involved fiddling around with the thing we were
interested in until we saw a way of using the induction hypothesis to
help us.
2. Note also that it doesn’t really matter where your initial step is—the
result will be true for any n ≥ your initial step. That could be 0, 1,
15 or anything else.
3. We could even change the size of the induction step. For example, to
prove something is true for all odd numbers we would
Start the induction at 1 and prove that P (k) =⇒ P k + 2
.
Lemma 3.1.11. All horses are the same colour.
3.2 Further variants
33
Proof. By induction.
2
How to write out a proof by induction.
• Begin by announcing that the proof will be by induction. If it’s at
all ambiguous, say which variable is having the induction applied to
it.
• Announce the initial step, and then prove it.
• Announce the induction step and state clearly what you are assuming as the induction hypothesis.
• Prove the induction step, using the induction hypothesis.
• Finish off by declaring that the result is true by induction, and say
for what values the result is true.
3.2
Further variants
There are some variants on the Principle of Induction, for cases when just
going one step at a time isn’t enough.
Example 3.2.1. Recall that the Fibonacci sequence is defined by
F1 = F2 = 1
Fn+1 = Fn + Fn−1 .
Show that for all natural numbers n, Fn < 2n .
Let’s do the induction step first to see what goes wrong with the basic
induction method.
34
Section 3. The natural numbers and induction
We will use the following argument:
Fk+1 = Fk + Fk−1
< 2k + 2k−1
< 2k + 2k
= 2.2k
= 2k+1 .
What is wrong with that?
To deduce the result for Fk+1 , we need to have assumed
both that Fk < 2k and that Fk−1 < 2k−1 .
So for the induction step we need to
assume the two previous cases
.........................................................................
and for the initial step we therefore have to
start by proving both 1 and 2, which is obvious
..........................................................................
Then the result follows for all natural numbers by induction.
2
Strong induction
This is a kind of induction where we don’t just assume the previous step is
true, but we assume that all previous steps are true.
Example 3.2.2. Suppose we try to use induction to show that every integer
at least 2 can be written as the product of prime numbers.
If we assume that k can be written as a product of primes, does this help
no
us write k + 1 as a product of primes?
How could we do it?
Either k + 1 is prime in which case done
or it can be written as ab where 1 < a, b < k + 1
then if we can factorise a and b we are done.
3.2 Further variants
35
So for the induction step we need to assume the result is true for all n ≤ k,
not just n = k.
Definition 3.2.3. Principle of Strong Induction
To prove that P (n) is true for any natural number n, it suffices to prove
1. (Initial step) P (1) is true;
2. (Inductive step) For all k ∈ N: if P (n) is true for all natural numbers
n < k, then P (k) is true.
z
Note: Technically we don’t need the initial step any more because
it is given by the induction step in the case k = 1.
..........................................................................
Proposition 3.2.4. The Principle of Induction and the Principle of Strong
Induction are equivalent.
Example 3.2.5. Show that every natural number can be written as the
sum of distinct Fibonacci numbers.
Solution. Proof by (strong) induction.
• Initial step.
When n = 1, it is already a Fibonacci number by itself.
• Induction step.
Suppose that the result is true for every integer k < n.
We aim to deduce the result for n.
Let F be the largest Fibonacci number less than n.
If F = n, then we are done.
Otherwise, n − F ≥ 1, so is a natural number.
By the induction hypothesis, n − F can be written as the sum of
distinct Fibonacci numbers F1 + · · · + Fr .
So
n = F + (n − F ) = F + F1 + · · · + Fr .
We need to show that these Fibonacci numbers are all distinct.
By the induction hypothesis, all of the Fi are distinct, so we just have
to show that for all i
Fi 6= F.
36
Section 3. The natural numbers and induction
We will now do two little mini proofs by contradiction
i) Suppose F ≤ n2 and aim for a contradiction.
Then both F and the previous Fibonacci number are less than
n
2 , so the next Fibonacci number, their sum, would be less than
n #
—contradicts F being largest Fibonacci number less than n.
n
Therefore F > .
2
ii) Suppose F = Fi and aim for a contradiction.
Now if Fi = F we have two F s in our expression, and 2F > n
#
—contradicts our expression summing to n.
So none of the Fi can equal F, so
n = F + F1 + · · · + Fr
is a sum of distinct Fibonacci numbers. So we have deduced the result
for n from the results for k < n.
Thus by the principle of strong induction the result is true for all n ∈ N. 2
3.3
The well-ordering axiom
The Principle of Induction is actually a property of the natural numbers.
That is, the fact that proof by induction works is a property of the natural
numbers.
Does proof by induction work in R?
It’s a bit odd becasue PI doesn’t exactly “feel” like a property of numbers.
However, it’s equivalent to the well-ordering axiom, which definitely does.
Definition 3.3.1. Well-ordering axiom (WO)
Every non-empty set of natural numbers has a least element.
How obvious do you think that is on a scale of 1 to 10? . . . . . . . . . . . . . . . . . .
no, eg positives
Is it true in R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 The well-ordering axiom
37
Theorem 3.3.2. The well-ordering axiom is equivalent to the principle of
(strong) induction.
Proof. “WO =⇒ PSI”
We assume that WO is true, and deduce PSI.
So, suppose we have a proposition P (n) such that
• P (1) is true
• for all k ∈ N, if P (n) is true for all n < k then P (k) is true.
We need to deduce that P (n) is true for all n ∈ N.
Suppose not, and aim to derive a contradiction.
So the set
S = {n ∈ N | P (n) is not true }
is not empty.
So by WO S has a least element s, say.
Since s is the least element for which P is not true, we know that
P (n) is true for all n < s
By hypothesis this means P (s) is true.
#
So P (n) is true for all n ∈ N.
So PSI holds.
“PSI =⇒ WO”
Let P (n) be the statement:
Every set of natural numbers containing the number n has a least
element.
Note that if P (n) is true for all n ∈ N then WO holds.
So we just need to prove P (n) is true for all n ∈ N, by induction.
38
Section 3. The natural numbers and induction
• Initial step.
Let n = 1. If a set of natural numbers contains 1, then clearly 1 is the
least element since it is the smallest possible natural number.
• Induction step
Suppose P (n) is true for all n < k.
Let A be a set of natural numbers containing the number k. We need
to show it has a least element.
But either
– k is the least element, or
– there is some element a ∈ A with a < k
But by the induction hypothesis we know that P (a) is true, so if a ∈ A
then A has a least element.
So in either case, A has a least element.
Thus by induction P (n) is true for all n ∈ N, ie WO is true.
2
Remark 3.3.3. We have shown WO ⇐⇒ PSI.
In the exercises you will show that WO =⇒ PI.
Since it is clear that PI =⇒ PSI it follows that PI and PSI are equivalent.
6, 1112
39
4
How to write proofs
A proof is like a poem,
or a painting,
or a building,
or a bridge,
or a novel,
or a symphony.
Writing a good proof is not supposed to be something we can just sit down
and do. It’s like writing a poem in a foreign language. First you have to
learn the language. And then you have to know it well enough to write
poetry in it, not just say “Which way is it to the train station please?”
4.1
What does a proof look like?
Remember, a proof has a beginning, a middle and an end.
• Beginning: things we are assuming to be true, including the definitions of the things we’re talking about
• Middle: statements, each following logically from the stuff before it
• End: the thing we’re trying to prove
4.2
Why is writing a proof hard?
One of the difficult things about writing a proof is that the order in which
we write it is often not the order in which we thought it up. In fact, we
often think up the proof backwards.
Imagine you’re flying from Manchester Airport at 11am. How
do you plan your journey?
40
Section 4. How to write proofs
Or to put it another way, to build a bridge across a river, we might well
start at both ends and work our way towards the middle. We might even
put some preliminary supports at various points in the middle and fill in all
the gaps afterwards. But when we actually go across the bridge, we start at
one end and finish at the other.
One of the easiest mistakes to make in a proof is to write it down in the
order you thought of it. This may contain all the right steps, but if they’re
in the wrong order it’s no use. It’s like taking a piece of music and playing
all the notes in a different order. Or writing a word with all the letters in
the wrong order.
Moral: plan your proof before writing it out.
4.3
What sort of things do we try and prove?
Here is a classification of the sorts of things we prove (this list is not exhaustive, and it’s also not clear cut – there is some overlap, depending on
how you look at it):
1. x = y i.e. “something equals something else”
2. x =⇒ y
3. x ⇐⇒ y
4. x is purple (or has some other interesting and relevant property)
5. ∀x p(x) is true i.e. “all animals of a certain kind x behave in a certain
way p(x)”
6. ∃x s.t. p(x) is true i.e. “there is an animal that behaves in a certain
way p(x)”
7. Suppose that a, b, c and d are true. Then e is true. [Note that this is
just a version of 2 in disguise.]
4.4 The general shape of a proof
4.4
41
The general shape of a proof
Let’s now have a look at the general shape of a proof, before taking a closer
look at what it might look like for each of the cases above. It doesn’t really
matter if you understand these proofs, just that you see the shape. We
must always remember that there is a beginning, a middle and an
end.
Example 1. Using the field axioms, prove that a(b − c) = ab − ac for any real
numbers a, b, c. You may use the fact that x.0 = 0 for any real number x.
beginning
field axioms
definition x − y = x + (−y)
given x.0 = 0
middle
a(b − c) = a(b + (−c)) definition
= ab + a(−c)
distributive law
ac + a(−c) = a(c + (−c)) distributive law
= a.0
additive inverse
= 0
given
∴ a(−c) = −(ac)
definition of additive inverse
∴ ab + a(−c) = ab − ac
end
∴ by line 2, a(b − c) = ab − ac as required
2
42
Section 4. How to write proofs
f
g
Example 2. Let f and g be functions A −→ B −→ C.
Show that if f and g are injective then g ◦ f is injective
beginning
definition (g ◦ f)(a) = g(f(a))
definition of injective and assumption that f and g are injective i.e.
middle
∀a, a0 ∈ A
f(a) = f(a0 ) =⇒ a = a0
∀b, b0 ∈ B
g(b) = g(b0 ) =⇒ b = b0
(g ◦ f)(a) = (g ◦ f)(a0 ) =⇒ g(f(a)) = g(f(a0 ))
=⇒ f(a) =
=⇒ a =
by definition
f(a0 )
since g is injective
a0
since f is injective
∴ (g ◦ f)(a) = (g ◦ f)(a0 ) =⇒ a = a0
end
i.e. g ◦ f is injective, as required
2
Example 3. Prove by induction that ∀n ∈ N, 1 + · · · + n =
beginning
middle
n(n + 1)
2
Principle of Induction
for n = 1, LHS = 1
1(1 + 1)
=1
2
∴ result is true for n = 1
RHS =
If result is true for n = k then
k(k + 1)
+ (k + 1)
2
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 2)
=
2
∴ result true for k =⇒ result true for k + 1
1 + · · · + k + (k + 1) =
end
i.e. result true for n = k + 1
∴ by the Principle of Induction, the result is true for all n ∈ N
2
4.5 What doesn’t a proof look like?
43
Of course, when we write a good story, we don’t actually label the beginning, the middle and the end with BEGINNING, MIDDLE, and END – it’s
supposed to be sort of obvious where they are. The same is true of a proof.
So here’s the thing I keep going on about but which is apparently not as
obvious as it might sound:
The end of a proof should come at the end, not at the
beginning.
Of course, I’ve deliberately made it sound really obvious there. But here’s
a more illuminating way of putting it:
The proof should end with the thing you’re trying to
prove. The proof should not begin with the thing you’re
trying to prove.
This is not to be confused with the fact that we often begin by announcing
what the end is going to be. Like The Go-Between or Brideshead Revisited
or Rebecca.
4.5
What doesn’t a proof look like?
There are more plastic flamingoes in America than real ones.
There are more bad novels in the world than good ones, and there are more
bad proofs in the world than good ones. Here are some of the most popular
ways to write a bad proof.
1. Begin at the end and end at the beginning
This is a really, really terrible thing to do. Here’s an example of this in an
attempt to prove:
44
Section 4. How to write proofs
Lemma
let n ∈ N. Then for any a ∈ Z
x≡y
(mod n) =⇒ ax ≡ ay
(mod n)
Really awful “proof ”.
ax ≡ ay (mod n)
=⇒
n|ax − ay
=⇒
n|a(x − y)
=⇒
n|x − y
=⇒
x ≡ y (mod n)
2
It’s backwards. Actually if it were just all the other way up it would be fine.
This is a terrible thing to do but not a terminal catastrophe—if you have all
the right ideas but in the wrong order, all you need to do is work out how
to put them in the right order. . .
However that doesn’t always fix a backwards proof.
Lemma
Let n ∈ Z. If n2 is even then n must be even.
Really awful “proof ”.
n even means n = 2k for some k ∈ Z.
Therefore n2 = 4k 2 = 2(2k 2 )
so n2 is even.
2
No, it’s actually a proof of the converse
Does reversing the lines here fix it? Why? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........................................................................
Here’s an example where we haven’t gone entirely backwards, but we’ve
begun at both ends and tried to meet in the middle.
Lemma
For all n ∈ Z
(n + 1)(n + 2)
n(n + 1)
+n+1=
2
2
4.5 What doesn’t a proof look like?
45
Really awful “proof ”.
n(n + 1)
+n+1 =
2
n(n + 1) + 2n + 2
=
2
(n + 1)(n + 2)
2
(n + 1)(n + 2)
2
n2 + n + 2n + 2 = n2 + 3n + 2
n2 + 3n = n2 + 3n
2
Can you fix this proof?
Sense any make doesn’t it backwards but things right the write you if.
2. Take flying leaps instead of earthbound steps.
This category includes leaping from one statement to another
• without justifying the leap
• leaving out too many steps in between
• using a profound theorem without proving it
• (worse) using a profound theorem without even mentioning it
For example, spot the flying leap in the following “proof”:
Lemma
Let n ∈ Z. If n2 is divisible by 3 then n is divisible by 3.
Really awful “proof ”.
We prove the contrapositive.
If n isn’t divisible by 3, nor is n2 .
Therefore the result is true.
2
46
Section 4. How to write proofs
3. Take flying leaps and land flat on your face in the mud
If you use a wrong argument to get to the right end, you haven’t actually
got to the end at all. You just think you have. But it’s a figment of your
imagination.
The end does not justify the means.
Here’s an example of a very imaginitive argument that is definitely flat on
its face in the mud:
4 1
−
6 3
=
=
=
4−1
6+3
3
9
1
3
What is wrong with it?
This is not how fractions are added
..........................................................................
Of course, it’s even worse if you do something illegal and thereby reach a
conclusion that isn’t even true. Like
x2 = y2 =⇒ x = y
or
x2 < y2 =⇒ x < y.
What is wrong with these two “deductions”?
negatives, in both cases
..........................................................................
4. Handwaving
Handwaving is when you arrive at a statement by some not-very-mathematical
means. The step isn’t necessarily wrong, but you haven’t arrived at it in a
4.5 What doesn’t a proof look like?
47
good logical manner. Perhaps you had to resort to writing a few sentences
of prose in English rather than Mathematics-speak. This is often a sign that
you’ve got the right idea but you haven’t worked out how to express it. Spot
the handwaving here – you can see it from a mile off:
a(b − c) = ab + a(−c)
a(−c) = −ac
because if you add ac to
both sides then both sides vanish
which means they0 re inverse
∴ ab + a(−c) = ab − ac
2
Handwaving is bad but is not ultimately catastrophic – you just need to
learn how to translate from English into Mathematics. This is probably
easier to learn than the problem of coming up with the right idea in the first
place.
5. Incorrect logic
This includes the two great classics
• negating a statement incorrectly
• proving the converse of something instead of the thing itself
What is the negation of the following statement:
∀ > 0 ∃δ > 0 s.t. ∀x satisfying
0 < |x − a| < δ, |f (x) − l| < ∃ε > 0 s.t. ∀δ > 0 ∃x satisfying 0 < |x − a| < δ s.t. |f (x) − l| ≥ .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
If you get it wrong, go directly to Jail. Do not pass Go. Do not collect £200.
48
Section 4. How to write proofs
6. Incorrect assumption
You could have all your logic right, you could make a series of perfectly good
and sensible steps, but if you start in the wrong place then you’re not going
to have a good proof.
7. Incorrect use of definitions – or use of incorrect definitions
One totally classic error is getting the definitions of injective and surjective
wrong. Learn those!
8. Assuming too much
This is a tricky one, especially when you’re a student at the beginning of a
course. What are you allowed to assume? How much do you have to justify
each step? A good rule of thumb is:
You need to justify things enough for your peers to understand.
This is a guideline that will always remain true however far you progress in
mathematics, even if you become an internationally acclaimed Fields-medalwinning mathematician.
If in doubt, justify things more rather than less.
Very few people give too much explanation of things. In fact, I have only
ever encountered one student who consistently explained things too much.
4.6
Practicalities: how to think up a proof
The harsh reality is that when you sit down to prove something you usually
have to start by just staring at it really hard and hoping for some inspiration
to hit you. However, you can put yourself in the best possible place to find
4.6 Practicalities: how to think up a proof
49
that inspiration by doing some of the following things, probably on a piece
of rough paper.
• Write out the beginning very carefully. Write down the definitions
very explicitly, write down the things you are allowed to assume, and
write it all down in careful mathematical language.
• Write out the end very carefully. That is, write down the thing you’re
trying to prove, in careful mathematical language.
• Try and manipulate both the beginning and the end to try and make
them look like one another. This is like building from both ends of
the bridge until they meet in the middle, and it’s okay as long as you
write the whole thing out properly in the right order afterwards.
• Take big leaps to see what happens, and then make the big leaps into
smaller leaps afterwards.
• See if the situation reminds you of any situations you’ve ever seen
before. If so, perhaps you can copy the method.
• Try some specific examples.
You should always read over your proof after you’ve written it to make
sure every single step makes sense. When you’re writing a proof the first
time through, you might get carried away in a frenzy of inspiration and
become blind to the world around you – by which I mean that you might
do something wrong without noticing it.
50
Section 4. How to write proofs
How to check your proof
1. Check that it begins at the beginning and ends at the end.
2. Check that each line is an actual sentence, and is true.
3. Check that each line follows logically from the one before it.
4. Check that you have made a justification of how each line follows
from the one before it.
5. Check that you have not used any assumptions that you weren’t
supposed to.
Some obvious signs that something is wrong with your proof.
• It has large chunks of text in it.
• It has no text in it, and consists of only symbols.
• It contains the line “1 = 1” or any other line saying something
equals itself.
7, 1112
51
5
The integers and divisibility
In this chapter, we study divisibility properties of the integers
. . . , −3, −2, −1, 0, 1, 2, 3, . . . .
Recall that the set of all integers is denoted by Z. You might think it’s
odd that our chosen property of the integers is divisibility, because that’s
something more usually associated with
the rationals
..............................
But divisibility isn’t interesting when you can just do it! Divisibility is
interesting in the integers precisely because we can’t always do it.
When you’re little and you first learn to divide, what do you do if it doesn’t
work?
5.1
Divisibility, primes and highest common factors
For now we will mostly be discussing properties of integers. Later we’ll talk
about the reals. What do we know about integers?
add, subtract, multiply, sometimes divide, remainders, prime numbers,
hcfs, unique factorisation into primes, infinitude...
Definition 5.1.1. Let a and b be integers. Then we say that b divides a,
or b is a factor or divisor of a, if a = nb for some integer n. We write b|a
to mean that b divides a and b - a to mean that b does not divide a.
z
Remark 5.1.2. “b does not divide a” means:
there does not exist n with a = nb
ie for all n, a 6= nb
Examples 5.1.3.
52
Section 5. The integers and divisibility
17|323
1. 323 = 17 × 19 so . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. For all a ∈ Z, we have
a=a×1
• 1|a because . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
a=a×1
• a|a because . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0=a×0
• a|0 because . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Do we have 0|a?
no unless a = 0 as otherwise we can’t have a = n.0
3. If b|a, then −b|a, so the non-zero divisors of an integer occur naturally
in pairs. But are those really different divisors?
4. If b 6= 0, then b|a means that the remainder when a is divided by b is
0. Alternatively, a divides b means that b is a multiple of a.
Prime numbers are the “building blocks” of the integers.
Definition 5.1.4. A prime number is a natural number p 6= 1 which is
not divisible by any other natural number except by 1 and p itself.
z
Remarks 5.1.5.
1. Actually this is the definition of irreducible.
2. We force the fact that 1 is not prime. Why?
eg to get unique factorisation into primes
....................................................................
It is be useful to have a word for numbers which are not prime.
Definition 5.1.6. A composite number is a natural number n 6= 1 which
is divisible by natural numbers other than 1 and itself.
z
no
Is 1 composite? ....................
Definition 5.1.7. The integer h is a highest common factor (hcf) or
greatest common divisor (gcd) of given integers a, b if
h|a and h|b
1. “h is a common factor”: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 The infinitude of primes
53
if c|a and c|b, then c ≤ h
2. “other common factors are no bigger”: . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
We write this as hcf (a, b) or just (a, b) (because we’re lazy, in the best
possible way).
z
|b|
Clearly (a, b) = (b, a) and (0, b) = (b, b) = ........... when b is non-zero.
Definition 5.1.8. Let a and b be integers. We say that a and b are coprime
(or relatively prime) if (a, b) = 1, i.e., a and b have no common factor
except (±)1.
z
Remark 5.1.9. A similar notion to that of highest common factor is given
by lowest common multiple.
5.2
The infinitude of primes
Prime numbers are surprisingly hard to understand. The definition is straightforward enough, but once we’ve defined something we want to know what
it’s like. Things we might want to know about prime numbers are:
• How can we test if a given number is prime?
• How can we tell what all the prime numbers are?
• How can we pick a prime number?
• How are the primes distributed?
• Are there arbitrarily long arithmetic progressions of primes?
• How many primes are there?
Most of these are very hard and are open research problems. However, we
can at least prove this famous theorem of Euclid:
54
Section 5. The integers and divisibility
There are infinitely many prime numbers.
Our strategy is going to be:
Contradiction: assume only finitely many primes, multiply together and add
1. This then can’t be divisible by any of the other primes. But that doesn’t
quite give the definition of prime - could it still be divisible by another
number? We need to know that every number > 1 has at least one prime
factor. Actually in that case every number > 1 can be completely factorised
into primes.
Theorem 5.2.1. Every integer n greater than 1 can be expressed as a product of one or more primes.
Proof.
By strong induction.
Initial step.
2
For the case n = ..... the result is obviously true.
Induction step.
We assume the result is true for all n < k and aim to show it is true for
n = k.
Now if k is prime then the result is true.
If k is not prime then it can be written as ab where 1 < a, b < k.
So by the induction hypothesis a and b can be written as a product of one
or more primes, thus ab is the product of all those primes.
So the result is true for n = k.
Therefore by strong induction the result is true for all n ≥ 2.
Theorem 5.2.2 (Euclid). There are infinitely many prime numbers.
Proof. By contradiction.
Suppose that there are only finitely many primes, p1 , p2 , . . . , pn .
2
5.3 Division with remainder
55
Define
N = p1 p2 . . . pn + 1.
By Theorem 5.2.1, N must have a prime factor p, say.
But none of the primes pi is a factor of N , as N is 1 more than a multiple
of pi .
So p is prime but is not one of the primes p1 , . . . , pn . #
—this contradicts our assumption that p1 , . . . , pn are all the primes.
So there must be infinitely many primes.
5.3
Division with remainder
An integer a can always be divided by a positive integer b to give a unique
quotient q and a unique remainder r in the range 0 ≤ r < b, i.e.,
(0 ≤ r < b).
a = qb + r
The quotient and remainder must be integers. Thus, for example,
78 = 8(9) + 6
and
− 78 = −9(9) + 3.
If b is negative, we still make the convention that r be non-negative and less
than the absolute value of b, i.e., 0 ≤ r < |b|. For example,
78 = (−8)(−9) + 6
and
− 78 = 9(−9) + 3.
This process of finding a quotient and remainder is known as the division
algorithm4 .
5.4
Highest common factors and Euclid’s Algorithm
Finding highest common factors is
a. useful
b. hard.
4
I think this is a bit odd, as it’s not really an algorithm
56
Section 5. The integers and divisibility
How could we do it?
by factorisation into primes: hard
In this section, we are going to do it by applying division with remainder
repeatedly. This method is called Euclid’s Algorithm.
Remark 5.4.1. An algorithm is
a process, and note that we’d like it to terminate and preferably fairly
quickly.
Algorithm 5.4.2. Euclid’s Algorithm is a way of finding the highest
common factor of two numbers. It’s best explained by an example.
We’ll work out the highest common factor of 630 and 132. first by sight
630 = 4.132 + 102
132 = 1.102 + 30
102 = 3.30 + 12
30 = 2.12 + 6
12 = 2.6 + 0
So the hcf is 6.
8, 1112
Why does this work? The key is the following fact. more examples
Lemma 5.4.3. Suppose that a = qb + r. Then (a, b) = (b, r).
Why does this help?
In the above example we then get
(630, 132) = (312, 102) = (102, 30) = (30, 12) = (6, 0) = 6
The numbers are decreasing non-negative integers so eventually it has to
terminate.
First observe that
k|a and k|b =⇒ k|sa + tb
5.4 Highest common factors and Euclid’s Algorithm
57
for any integers s and t because
a = pk and b = qk for integers p and q, and so
sa + tb = s(pk) + t(qk) = (sp + tq)k,
again a multiple of k.
Proof of Lemma 5.4.3. Write (b, r) = h. We want to see that h is also
the highest common factor of a and b.
By definition, this means that we must check the two defining properties of
the highest common factor:
h|a and h|b
1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
if c|a and c|b, then c ≤ h.
2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For (1) we know that h = (b, r) so
in particular h|b and h|r
so also h|a
For (2) suppose that c|a and c|b. Then
c|a − qb, and so c|r.
Now c is a common factor of b and r, so c ≤ (b, r), and so c ≤ h, as required.
2
Euclid’s algorithm backwards
We get interesting information by running the algorithm backwards too! We
can use all the lines above to write the highest common factor as
630s + 132t
for certain integers s and t.
58
Section 5. The integers and divisibility
6 = 30 − 2.12
= 30 − 2.(102 − 3.30) = 7.30 − 2.102
= 7.(132 − 1.102) − 2.102 = 7.132 − 9.102
= 7.132 − 9.(630 − 4.132) = 43.132 − 9.630.
Remark 5.4.4. Other values of s and t work too. Why? a. hb − b. ha = 0
Here’s the general result, which sounds dull but is remarkably useful.
Theorem 5.4.5. Let a, b ∈ Z, with b 6= 0. Then there exist s, t ∈ Z such
that (a, b) = sa + tb.
Proof. (Not examinable) should be induction
Throughout the proof, we make use of the division algorithm, and all letter
symbols denote integers.
Divide a by b to obtain
a = q1 b + r1
(0 ≤ r1 < |b|).
If r1 = 0, then, by Lemma 5.4.3,
(a, b) = (b, r1 ) = (b, 0) = |b| = 0a ± b,
so we write (a, b) in the desired form sa + tb.
Suppose then that r1 > 0. Divide b by r1 to obtain
b = q2 r1 + r2
(0 ≤ r2 < r1 ).
If r2 > 0, divide r1 by r2 to obtain
r1 = q3 r2 + r3
(0 ≤ r3 < r2 ).
Keep going as long as the remainder you get is non-zero (eventually we must
get a zero remainder, as the remainders are getting strictly smaller at every
step).
5.4 Highest common factors and Euclid’s Algorithm
59
Let rn be the last non-zero remainder. The divisions conclude
rn−3 = qn−1 rn−2 + rn−1
(0 ≤ rn−1 < rn−2 )
rn−2 =
(0 ≤ rn < rn−1 )
qn rn−1 + rn
rn−1 = qn+1 rn
+ 0.
By repeated use of Lemma 5.4.3, we find that
(a, b) = (b, r1 ) = (r1 , r2 ) = · · · = (rn−2 , rn−1 ) = (rn−1 , rn ) = (rn , 0) = rn ,
and so we see that rn , this last non-zero remainder, is the highest common
factor of a and b – just what we wanted!
Tracing our way back through the equations, we can express (a, b) in the
form sa + tb as follows:
(a, b) = rn = rn−2 − qn rn−1
(= rn−2 − qn (rn−3 − qn−1 rn−2 ))
= ?rn−3 +?rn−2
= ?rn−4 +?rn−3
...
= ?r1 +?r2
= ?b+?r1
= ?a+?b
= sa + tb
for some s, t ∈ Z.
That last bit was rather more imprecise than we normally like in a proof, but
at least it enables us to give a precise algorithm for computing the highest
common factor, and, not only that, for expressing the highest common factor
of a and b as the sum of a multiple of a and a multiple of b.
Corollary 5.4.6. Let a, b ∈ Z. Then a and b are coprime if and only if
there exist integers s and t such that sa + tb = 1.
Proof.
If (a, b) = 1 then we get sa + tb = 1 immediately from Theorem 5.4.5.
60
Section 5. The integers and divisibility
Conversely, suppose there exist s and t with sa + tb = 1.
Now any factor of a and b must divide sa + tb,
so any factor of a and b divides 1, so must be 1.
Hence the hcf of a and b is 1.
2
Remark 5.4.7. Note that if (A, B) = h 6= 1 we can use Euclid’s algorithm
find integers s, t such that
As + Bt = h
but in practice it’s easier to divide through by h first. So if we write
A = ah, B = bh
then we know that (a, b) = 1, so Euclid’s algorithm will give us s, t such
that
as + bt = 1
so then
has + hbt = h
ie
As + Bt = h.
If this confuses you you can forget about it.
We can use this result to prove several elementary properties of the highest
common factor which might seem rather familiar to you.
If you know these facts already, why do we need to prove them?
9, 1112
use different proof?
..........................................................................
Corollary 5.4.8. Let a, b ∈ Z, not both zero, and write (a, b) = h.
Then ha and hb are coprime.
Proof. By Euclid’s algorithm, there exist integers s and t such that
sa + tb = h
so
s. ha + t. hb = 1
so by Corollary 5.4.8 we have that
a
h
and
b
h
are coprime.
5.4 Highest common factors and Euclid’s Algorithm
61
Remark 5.4.9. Do you like this proof? This is the kind of proof I find
rather annoying, because it doesn’t help me understand why the result is true.
Mathematicians are divided about whether or not this matters.
The following is a series of technical lemmas that we will use to prove the
Fundamental Theorem of Arithmetic. You might think these results are
obvious...but that’s probably because you already know the Fundamental
Theorem of Arithmetic.
Lemma 5.4.10. Suppose that (a, bc) = 1. Then (a, b) = 1 and (a, c) = 1.
use different proof?
Proof. If a and bc are coprime, then we can find integers s and t such that contrapos?
sa + tbc = 1.
But then we have
sa + (tc)b = 1.
Put m = tc; then we have found integers s and m so that sa + mb = 1, and
it follows that a and b must be coprime.
Similarly, a and c are coprime, using the bracketing sa + (tb)c = 1.
In fact, the converse is also true i.e.
if a is coprime to b and to c, then it is coprime to bc.
..........................................................................
However, the proof is not quite obvious, and uses a little trick!
Lemma 5.4.11. Suppose that (a, b) = 1 and (a, c) = 1. Then (a, bc) = 1.
Proof. If (a, b) = 1, then there are integers s and t so that
sa + tb = 1.
If also (a, c) = 1, then there are integers p and q so that
pa + qc = 1.
We rearrange these:
tb = 1 − sa
qc = 1 − pa
62
Section 5. The integers and divisibility
and multiply:
(tq)bc = 1 − sa − pa + spa2 = 1 − (s + p − spa)a.
If we put m = s+p−spa and n = tq, then the equation becomes ma+nbc =
1, and so a and bc are coprime.
Note that the contrapositive of this result says:
if a is not coprime to bc, then it is not coprime to b or it is not coprime to
c – i.e., a has a common factor with at least one of b or c.
..........................................................................
The next result is surprisingly important. We’ll use it in the next section to
deduce the so-called Fundamental Theorem of Arithmetic.
Lemma 5.4.12. Suppose that a|bc and (a, b) = 1. Then a|c.
Proof. (Another totally unexplanatory one.)
We are given that (a, b) = 1, so that there s, t ∈ Z such that sa + tb = 1.
Multiply this equation by c:
sac + tbc = c.
Notice that a clearly divides sac.
Also, we are supposing that a divides bc, and so a clearly divides tbc.
Therefore a divides the left-hand side, and since this is equal to the righthand side, c, we get that a|c.
5.5
The Fundamental Theorem of Arithmetic
In this section, we are going to prove that every number can be written
uniquely as a product of prime numbers. I hope you are so used to working
with integers that this fact is completely obvious to you. But actually, it
wasn’t until about 1800 that Gauss pointed out that it fails in a number of
similar situations, and so it really needs to be proved.
5.5 The Fundamental Theorem of Arithmetic
63
In fact in future courses (eg MAS276 Rings‘n’Groups) we’ll give this
a fancy name and say that the integers form a special kind of ring
called a Unique Factorisation Domain. We’ll look at some rings
in which unique factorisation fails. Some people that Fermat made
a unique factorisation error which is why he thought his proof fitted
into a weeny margin, when the proof we now know about blatantly
does not.
Here is an example of what could go wrong in a somewhat artificial situation5 :
Examples 5.5.1.
1. Suppose I throw away the number 2. What numbers will become
prime?
4, 6, 8, 10, 14, 16, 22
....................................................................
Of course, the old primes will still be prime. Now can you think of a
number that has two different factorisations into primes in this silly
world?
6.4 = 3.8
.....................................................................
2. Gauss’s examples come from thinking of doing arithmetic with num√
bers of the form a + b d, where a, b, d are integers. When d = 10, one
has the equalities
6 = 2.3 = (4 +
√
10).(4 −
√
10),
and none of these factors can be further factored. This will be an
important example in MAS276.
The first result we need is just a mild reformulation of Lemma 5.4.12.
Lemma 5.5.2. Suppose that p|ab, where a, b ∈ Z, and p is prime.
Then either p|a or p|b.
5
One problem with learning maths is that non-artificial examples are sometimes too
hard to understand when you’re only learning the concept for the first time.
64
Section 5. The integers and divisibility
Remark 5.5.3. Note that this is actually the definition of prime! The
one about having no other factors blah blah blah is really the definition of
irreducible. It’s a misleading coincidence that these turn out to be the
same thing in Z. In MAS276 it becomes more important not to get these
mixed up.
Proof. If p|a, we are done.
So we suppose p - a and aim to prove that p|b.
Now if p - a, then (a, p) = 1
since the only other divisor of p is 1.
So by Theorem 5.4.5 we can write sa + tp = 1 for some integers s and t;
multiplying by b we get
sab + tpb = b.
Now p|ab by hypothesis, so p divides the left-hand side, which equals b
so p|b as required.
Now we generalise this result to longer strings of numbers, which is how
we’ll need to use it in the proof of unique factorisation.
Corollary 5.5.4. Suppose that p|a1 a2 . . . an .
Then p|ai for some i = 1, . . . , n.
Proof. Think of this as the same as the other.
Suppose that p does not divide any ai .
Then repeated application of the theorem shows that
p - a1 a2
p - (a1 a2 )a3
..
.
p - (a1 a2 . . . an−1 )an
which contradicts the hypothesis that p|a1 . . . an .
Thus p|ai for some i = 1, . . . , n as required.
We could also have done that by induction.
2
5.5 The Fundamental Theorem of Arithmetic
65
We can now use this result to prove the Fundamental Theorem of Arithmetic6 :
Theorem 5.5.5 (Fundamental Theorem of Arithmetic). Every integer n
greater than 1 can be expressed uniquely (apart from the order of factors) as
a product of primes.
Proof.
By contradiction.
Suppose that there is an integer n with two different factorisations.
Dividing out any primes occurring in both factorisations, we get an equality
of the form
p1 p2 . . . pr = q1 q2 . . . qs
where the factors pi and qj are all primes, not necessarily all distinct, but
where no prime on the left-hand side also occurs on the right-hand side.
But p1 divides the left-hand side and therefore the right-hand side ie
p1 |q1 . . . qs .
So by Corollary 5.5.4 p1 must divide one of the qj
so it must equal that qj # since there are no other factors
—contradicts the observation that no prime occurs on both sides of the
equality.
Therefore there is no integer n with two different factorisations.
2
The important thing to remember:
Each integer n greater than 1 can be uniquely written in the form
n = pn1 1 pn2 2 . . . pnk k
6
There’s something about calling theorems “The fundamental theorem of...” that
makes me want to vomit. I think it’s the idea that there’s only one fundamental theorem
in any particular field.
66
Section 5. The integers and divisibility
where p1 , p2 , . . . , pk are primes with p1 < p2 < · · · < pk , and n1 , n2 , . . . , nk
are natural numbers. For example,
360 =
4725 =
714420 =
10, 1112
23 .32 .5
..................
33 .52 .7
..................
22 .36 .5.72
..................
We call this the canonical factorisation of n.
5.6
The diophantine equation Ax + By = C
Everyone likes to seem clever, and mathematicians are no exception. One
way of making yourself seem clever is to confuse other people, and one way
of doing that is to make up fancy words for things.
Wikipedia tells me:
“A Diophantine equation is an indeterminate polynomial equation
that allows the variables to be integers only.”
Is that better or worse?
Diophantine equations are named after the Greek mathematician Diophantus. We’ll just look at linear ones of the form
Ax + By = C
where
• A, B, C are integers, and
• we’re only interested in integer solutions. ie values of x and y.
Examples 5.6.1.
5.6 The diophantine equation Ax + By = C
67
1. x + y = 10
2. 2x + 3y = 10
2.2 + 3.2 = 10
2.5 − 3.0 = 10
3. 2x + 4y = 3
no integer solutions as LHS even and RHS odd
Such an equation may have no integer solutions. For example, consider the
equation
12x + 33y = 3331.
This cannot have integer solutions because
the left-hand side will be divisible by 3
.........................................................................
Theorem 5.6.2. Let A, B, C ∈ Z, where at least one of A and B is nonzero. Let h = (A, B). Then the equation
Ax + By = C
has a solution in integers x and y if and only if h|C.
Proof.
“⇐”
Suppose that h|C, so that C = ch for some integer c.
By Euclid’s algorithm, there are integers s and t such that
As + Bt = h,
68
Section 5. The integers and divisibility
so
Asc + Btc = hc
= C
thus x = sc and y = tc are integers satisfying the equation.
“⇒”
Suppose we have x and y satisfying Ax + By = C.
Then h|A and h|B, so h|C.
Particular and general solutions
Theorem 5.6.2 gave us a particular solution to the equation
Ax + By = C
provided h|C.
However there are many solutions coming from the fact that
A.
A
B
− B. = 0
h
h
Examples 5.6.3.
1. A = 2, B = 3
2.3 − 3.2 = 0
2. A = 4, B = 6
4.6 − 6.4 = 0 cancel by (4, 6) = 2
4.3 − 6.2 = 0
3. A = 8, B = 12
(8, 12) = 4
8
8. 12
4 − 12. 4 = 0
2
5.6 The diophantine equation Ax + By = C
69
That is, writing
A = ah
B = bh
we have
Ab − Ba = 0
..........................................................................
and so we get infinitely many other solutions by
(Asc + Btc) + (Ab − Ba)k = C
for any k ∈ Z
i.e. A(sc + bk) + B(tc − ak) = C
for any k ∈ Z
So we get solutions of the form
x = sc + bk
y = tc − ak
for all k ∈ Z. Note only k is varying here
In fact this gives us all possible integer solutions.
70
Section 5. The integers and divisibility
Proof of this fact—non-examinable.
We need to show that every possible integer solution is of the above form.
So suppose Ax + By = C and we already know that Asc + Btc = C so
Ax + By = Asc + Btc
thus
A(x − sc) = B(tc − y)
and dividing through by h we get
a(x − sc) = b(tc − y).
B
Now a|RHS and (a, b) = ( A
h, h) = 1
so by Lemma 5.4.12 we must have
a|tc − y
ie
tc − y = ak for some k ∈ Z
so y = tc − ak
2
The result for x follows similarly.
Method 5.6.4. Here’s a summary of how to find integer solutions to the
Diophantine equation
Ax + By = C
1. Find hcf (A, B) = h, say. Does h divide C?
• If not, there are no integer solutions.
• If it does, there are infinitely many solutions, which we will now
find.
2. Preliminary step: write a =
A
h,
b=
B
h,
c=
C
h.
5.6 The diophantine equation Ax + By = C
71
3. Find one particular solution. A good way is to perform Euclid’s algorithm to get integers s, t such that
As + Bt = h
remembering (Remark 5.4.7) that it might be easier to divide through
by h first.
Then a particular solution is
Asc + Btc = hc = C.
............................................................
Note that any particular solution will do, so if you’re really stuck you
could just find one by trial and error, although that’s not a good method
in general.
4. Observe that
Ab − Ba = 0
so we can add this to our particular solution as many times as we like
to give
A(sc + bk) + B(tc − ak) = C
.............................................................
for any integer k.
5. Conclusion: the general solution is
x = sc + bk
y = tc − ak
for any k ∈ Z.
6. It’s a good idea to check your answer by plugging in a random value
of k to see if it works.
Example 5.6.5. Find integer solutions to the equations
1. 91x + 42y = 209
2. 91x + 42y = 210
Solution.
We begin by finding the hcf (91, 42) = 7
72
Section 5. The integers and divisibility
• 7 does/doesn’t* divide 209 so the first equation has
no integer solutions.
.....................................................................
• 7 does/doesn’t* divide 210 so the second equation has
infinitely many integer solutions
.....................................................................
Now we have
13
91 = ..... × 7
6
42 = ..... × 7
30
210 = ..... × 7
We start by finding integers s, t such that 91s + 42t = 7
NB as in Remark 5.4.7 it might be easier to divide through by 7 and multiply again afterwards: we look for 13s + 6t = 1 eg
1
-2
13 × ........ + 6 × ........ = 1
so also
1
-2
91 × ........ + 42 × ........ = 7
and then we multiply by 30 to get a particular solution:
30
-60
91 × ........ + 42 × ........ = 210.
Now for the general solution we observe that
91.
ie
91
42
− 42. = 0
7
7
6
13
91 × ..... − 42 × ..... = 0
so in general we have
30+6k
-60-13k
91.(..............) + 42(..............) = 210
for any integer k. So the general solution is
x =
y =
30+6k
..................
-60-13k
..................
5.6 The diophantine equation Ax + By = C
73
11, 1112
another example Example 5.6.6. 25 friends go out for a drink and have trouble paying,
hough it’s boring? because one guy claims he didn’t have a drink.
The possible drinks were:
beer
£2.10
whisky
£3.70
juice
£1.10
The total was £58.50. Is it possible he is telling the truth? Can you work
out what actually happened?
Solution.
Let’s start by multiplying everything by 10 to get rid of the decimal point,
and write down what information we have.
21b + 37w + 11j = 585
b + w + j = 25 or 24?
substitute for j: 21b + 37w + 11(25 − b − w) = 585
so
10b + 26w = 310 or 321 but this violates the hcf thing
so now we know he’s lying.
Solve using
10. − 5 + 26.2 = 2
10.13 − 26.5 = 0
so partic solution is
10. − 5.155 + 26.2.155 = 310
gen solution is
b = −775 + 13k
w = 310 − 5k
must have 60 ≤ k ≤ 61 to get b ≥ 0
must have 57 ≤ k ≤ 62 to get w ≥ 0
Second condition is redundant.
74
Section 5. The integers and divisibility
• k = 60 gives (b, w, j) = (5, 10, 10)
• k = 61 gives (b, w, j) = (18, 5, 2)
Which do you think is more likely?
That example was a bit contrived wasn’t it? Actually we’ll see that lots
of things turn out to be Diophantine equations in disguise.
12, 1112
75
6
The integers (mod n) and congruences
In this section we imagine that the integers are marked on an exceeeeeeeeeeeeeeedingly long tape measure, and we’ve wound it up to make it easier to carry
around.
6.1
Modular arithmetic
Can you tell the time? That’s arithmetic modulo 12.
various pictures of clockfaces with different numbers of hours
Definition 6.1.1. We fix some positive integer m ≥ 2. Then the integers
modulo m consists of the set
{0, 1, . . . , m − 1},
and addition and multiplication are taken modulo m (or “mod m”). That
is, we are only interested in the remainder after dividing by m.
z
What does that mean? For example modulo 5:
5, 10, 15, . . . and negatives
• 0 is “the same as” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6, 11, 16, . . .
• 1 is “the same as” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7, 12, 17, . . .
• 2 is “the same as” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8, 13, 18, . . .
• 3 is “the same as” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9, 14, 19, . . .
• 4 is “the same as” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0,1,2,3,4
So the only numbers that count as “different” mod 5 are . . . . . . . . . . . . . . . . .
76
Section 6. The integers (mod n) and congruences
We now make that precise:
Definition 6.1.2. Two numbers a and b are congruent modulo m if a
and b leave the same remainder when divided by m. Equivalently
m|b − a or m|a − b
or
a = b + km or b = a + km
We write: a ≡ b (mod m).
z
Examples 6.1.3.
0
1. 2 + 3 ≡ .......... (mod 5)
4
8. 32 ≡ .......... (mod 5)
3
2. 4 + 4 ≡ .......... (mod 5)
2
9. 33 ≡ .......... (mod 5)
4
3. 2 − 3 ≡ .......... (mod 5)
1
10. 34 ≡ .......... (mod 5)
2
4. 1 − 4 ≡ .......... (mod 5)
3
11. 35 ≡ .......... (mod 5)
1
5. 2.3 ≡ .......... (mod 5)
1
12. 42 ≡ .......... (mod 5)
4
6. 2.2 ≡ .......... (mod 5)
4
13. 43 ≡ .......... (mod 5)
1
7. 4.4 ≡ .......... (mod 5)
1
14. 44 ≡ .......... (mod 5)
4
15. 45 ≡ .......... (mod 5)
Now that we have this new way of doing arithmetic, we should work out
whether any of our old methods still work.
Questions 6.1.4. Let’s try this modulo 12 this time.
1. Suppose x ≡ y (mod 12) Is it true that a + x ≡ a + y (mod 12)? yes
2. Suppose x ≡ y (mod 12) Is it true that ax ≡ ay (mod 12)? yes
3. What about the converse:
Does ax ≡ ay (mod 12) imply x ≡ y (mod 12)?
.....................................................................
No: eg 3.5 ≡ 3.1 (mod 12)
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 Modular arithmetic
77
4. Suppose x2 ≡ 1 (mod 12). What can x be?
5. Suppose a.b. ≡ 0 (mod 12). Does this mean a ≡ 0 or b ≡ 0
Conclusion:
Some things work and some things go funny
..........................................................................
Lemma 6.1.5.
1. If a1 ≡ a2 (mod m) and b1 ≡ b2 (mod m), then
a1 + b1 ≡ a2 + b2 (mod m).
2. If a1 ≡ a2 (mod m) and b1 ≡ b2 (mod m), then
a1 b1 ≡ a2 b2 (mod m).
Proof.
The first is proved simply by observing that if m|a1 − a2 and m|b1 − b2 , then
m|(a1 − a2 ) + (b1 − b2 )= (a1 + b1 ) − (a2 + b2 ).
The second is slightly more complicated; we observe that
a1 b1 − a2 b2 = a1 b1 − a1 b2 + a1 b2 − a2 b2
= a1 (b1 − b2 ) + b2 (a1 − a2 )
so if m divides both a1 − a2 and b1 − b2 , then it divides a1 b1 − a2 b2 .
2
Question 6.1.6. Can we do cancellation?
ax ≡ ay
(mod m) implies x ≡ y
(mod m)
(a, m) = 1, in ptic if m is prime and a 6= p
if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Now ax ≡ ay (mod m) means
m|ax − ay = a(x − y)
..........................................................................
Then by Lemma 5.4.12 it follows that m|x − y ie
x≡y
(mod m)
78
Section 6. The integers (mod n) and congruences
Question 6.1.7. Can we do division?
For example, what would “9 ÷ 7 ≡ a (mod 12)” mean?
We could multiply by 7 and it would be 9 ≡ 7a (mod 12)
and we see that 9 ≡ 7.3 (mod 12)
so 9 ÷ 7 ≡ 3 and 9 ÷ 3 ≡ 7???
but then we also get 9 ≡ 3.3 so 9 ÷ 3 ≡ 3 and 7and 11??
What about 7 ÷ 9 ≡ a (mod 12)?
We’d need 7 ≡ 9a (mod 12) ie 7 = 9a + 12k which is impossible if you look
mod 3
Conclusion:
sometimes division has 1 answer, sometimes many, sometimes none!
..........................................................................
13, 1112
6.2
Solving ax ≡ b (mod m)
This is really all about division, as we’re sort of trying to divide b by a.
We want to solve ax ≡ b (mod m).
Here, m is fixed and we’re doing all arithmetic mod m.
We’re given a and b, and we’re trying to find a number x with this property,
ie
m|ax − b or ax = b + mk for some k ∈ Z i.e. ax − mk = b
..........................................................................
But we know how to do this from the previous section! This is just a
Diophantine equation
..........................................................................
in disguise. So we solve it like this:
1. Find hcf (a, m) = h, say
2. If h - b then there are no solutions.
6.2 Solving ax ≡ b (mod m)
79
3. If h|b we do the usual Euclid thing and get
as + mt = h
then a particular solution is
a s.
b
b
+ m. t.
= b.
h
h
4. For the general solution we use
a.
m
a
− m. = 0
h
h
so we get
a s.
b
m
b
a
+ k.
+ m t. − k.
=b
h
h
h
h
5. Finally observe that we’re taking this mod m so the multiple of m in
becomes 0, and we get
x = s.
b
m
+ k. for any k ∈ Z
h
h
i.e.
b
m
(mod )
h
h
m
Note that this has become mod h not just mod m, which is why we
might get multiple solutions mod m.
x ≡ s.
• If (a, m) - b there are no solutions.
• If (a, m) = 1 there is one solution.
• If (a, m) > 1 and divides b then there are multiple solutions.
This sounds complicated, but is easier if you work through an example as
it’s better with numbers than letters. I think it’s really hard to memorise
this process, so it’s best to remember two things:
1. How to solve a Diophantine equation
2. How to turn a congruence into a Diophantine equation.
Example 6.2.1. Solve 35x ≡ 28 (mod 91)
80
Section 6. The integers (mod n) and congruences
1. First remember that this is like solving the Diophantine equation
35x + 91m = 28
..........................................
You don’t have to write this down, but if you’re worried about confusing the roles of a, b, m, x this is likely to help.
2. First we find that (35, 91) = 7 and this does divide 28 so there are
solutions.
3. Now we want 35s+91t = 7 which is easiest to find by dividing through
by 7 and looking for
5s + 13t = 1
.....................................................................
5. − 5 + 13.2 = 1
which we can get as
so
-5
2
35.......... + 91.......... = 7.
4. Thus we get a particular solution
-20
8
35.......... + 91.......... = 28.
5. For the general solution we use
13
5
35.......... − 91......... = 0
so the general solution to the Diophantine equation is
-20 + 13k
8-5k
35.(..............) + 91.(..............) = 28
and the general solution to the congruence is
-20
13
x ≡ ......... (mod .....)
ie
6
13
x ≡ ....... (mod .....)
which means
x=
6. Check those answers.
6, 19, 32, 45, 58, 71, 84
6.2 Solving ax ≡ b (mod m)
81
Remark 6.2.2. Note that you may be able to find shortcuts through this
so that you don’t have to go through the entire argument each time. If
you want to take a short cut that’s fine but don’t blame me if you make a
mistake!! The first time I went on a camping expedition my friends and I
tried to take a short cut; we ended up crawling through a hedge and being
chased by a bull.
Example 6.2.3. Solve 35x ≡ 27 (mod 91).
1. The Diophantine equation7 we’re solving is
35x + 91k = 27
2. (35, 91) = 7 which does not divide 27, so there are no solutions (because 7 divides the left but not the right).
One last example to finish:
Example 6.2.4. Solve 102x ≡ 119 (mod 187).
We have to solve 102x = 187k + 119, so we start by computing (187, 102) =
17, either using Euclid’s algorithm or by inspection. (Using Euclid’s algorithm always works in general; inspection can take a long time for larger
numbers.)
Since 17|119, we do have solutions, and we can divide throughout by 17, so
that we have to solve 6x = 11k + 7, i.e., 6x ≡ 7 (mod 11).
Again, we can use inspection (or the reverse of Euclid’s algorithm) to find
a solution (see Exercises).
Remember: If (a, m) divides b we can divide the whole congruence
through by (a, m) including the modulus. I think the hardest thing is
remember which numbers are a, b and m in the first place.
7
Note that it doesn’t matter if it’s plus or minus in the middle as k is any integer,
positive or negative.
82
Section 6. The integers (mod n) and congruences
6.3
Simultaneous congruences: the Chinese Remainder Theorem
Exactly as for normal equations, we can ask about simultaneous congruences. You might have asked yourself questions like this before, in the form
I’ve decided to go the gym every 3 days and gorge on ice cream
every 5 days. When will I go to the gym and gorge on ice cream on
the same day?
This isn’t a very complicated simultaneous congruence:
x ≡ 0
(mod 3)
x ≡ 0
(mod 5)
x ≡ 0 (mod 15)
Answer: ...............................................
Examples 6.3.1.
1. A slightly harder one is
x ≡ 1
(mod 3)
x ≡ 2
(mod 5)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
0 1 2 0 1 2 0 1 2 0
1
2
0
1
2
0 1 2 3 4 0 1 2 3 4
0
1
2
3
4
Note it’s kind of obvious the pattern will still repeat every 15, it’s just
a question of where
x ≡ 7 (mod 15)
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. What about
x ≡ 1
(mod 4)
x ≡ 3
(mod 6)
6.3 Simultaneous congruences: CRT
83
12 - the lcm
We now expect the pattern to repeat every . . . . . . . . . . . . . . . . . . . . . . . .
0 1 2 3 4 5 6 7 8 9 10 11
0 1 2 3 0 1 2 3 0 1
2
3
0 1 2 3 4 5 0 1 2 3
4
5
x ≡ 9 (mod 12)
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3. What about
x ≡ 1
(mod 4)
x ≡ 2
(mod 6)
This isn’t possible
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4. What about
x ≡ 1
(mod 15)
x ≡ 2
(mod 10)
This also isn’t possible
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
It seems that the issue is:
The hcf of the two moduli
..........................................................................
The result about repeating patterns generalises to products of more numbers:
Theorem 6.3.2 (Chinese Remainder Theorem). Given congruences
x ≡ ai
(mod mi ) for i = 1, . . . , n
where
(mi , mj ) = 1 for all i 6= j
there is a unique solution to these congruences modulo m1 m2 . . . mn .
84
Section 6. The integers (mod n) and congruences
The earliest known examples of this kind of question date back to Sun Tsu
Suan-Ching (4th century AD).
Informally you can think about it like this, in the case of a, b coprime:
The remainders mod ab correspond precisely to pairs of remainders
mod a and mod b.
Note that this result has both
• existence, and
• uniqueness.
But knowing a solution exists isn’t enough—how do we find the solution??
Answer: It’s a Diophantine equation in disguise!
Example 6.3.3. Solve
14, 1112
x ≡ 3
(mod 5)
x ≡ 4
(mod 7)
11, 18, bingo 25
First do it by staring: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Now do it systematically: notice that we’re really solving
x = 5a + 3
x = 7b + 4
ie
5a + 3 = 7b + 4
ie
5a − 7b = 1
—a Diophantine equation! [Happy dance]
We solve it in the usual way:
6.3 Simultaneous congruences: CRT
85
1
1. First note that (5, 7) = ..... so there are solutions.
2. Now we want 5s + 7t = 1
which we can get as
5.3 + 7. − 2 = 1
which is immediately a particular solution.
3. For the general solution we use
7
5
5.......... − 7......... = 0
so the general solution to the Diophantine equation is
3 + 7k
2+5k
5.(..............) − 7.(..............) = 1
(note minus sign) ie
a = 3 + 7k
b = 2 + 5k
4. For the congruence we calculate x from a:
x = 5a + 3 = 5.(3 + 7k) + 3 = 35k + 18
We can check we get the same answer using b:
x = 7b + 4 = 7(2 + 5k) + 4 = 35k + 18
So converting back to a congruence we have the answer:
x ≡ 18 (mod 35)
......................................................
feeding some examples back in
5. Check the answer by: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
comparing with our first guess
.....................................................................
We can combine more than two congruences by proceeding inductively.
Given three equations
x ≡ 2 (mod 3),
x ≡ 3 (mod 5),
x ≡ 4 (mod 7);
do another
86
Section 6. The integers (mod n) and congruences
we can solve two of them (as above). Say we solve the last two, since by
extraordinary coincidence it’s the example we just did. We replace them by
the solution and we have reduced it to two equations:
x ≡ 2 (mod 3)
x ≡ 18 (mod 35)
Then solve these as above (see Exercises).
6.4
Fermat’s Little Theorem and Wilson’s Theorem
So far, we have only really considered solving linear congruences. We can
try to solve quadratic equations, e.g., 4x2 + 3x + 5 ≡ 0 (mod 13), or even
equations of higher degree. The theory of quadratic congruences, in particular, has some very interesting features, and will be covered in the course
Topics in Number Theory next year.
Our usual methods of solving quadratic equations don’t work any more, and
we’ll investigate this further in MAS276 Rings’n’Groups.
In this section, we will prove more results about higher degree congruences.
Our first result is known as Fermat’s Little Theorem8 . We will give two
proofs of the theorem, and you will see yet another proof using group theory
in the second semester of this course.
Theorem 6.4.1 (Fermat’s Little Theorem). Let p be prime. If (a, p) = 1,
then
ap−1 ≡ 1 (mod p).
Let’s try the example 7, and look at the 7th powers of all the integers modulo
7:
Remember: you can multiply the number by itself and reduce it mod 7
at every stage, you don’t have to raise it to the power and only reduce it
at the end.
8
This is to distinguish it from Fermat’s Last Theorem, which was enormous
6.4 Fermat’s Little Theorem and Wilson’s Theorem
07 ≡
17 ≡
27 ≡
37 ≡
47 ≡
57 ≡
67 ≡
0
1
2
3
4
5
6
87
(mod 7)
(mod 7)
(mod 7)
(mod 7)
(mod 7)
(mod 7)
(mod 7).
If you write the increasing powers mod 7 you’ll see a repeating pattern.
The proof that uses group theory makes use of these repeating patterns.
15, 1112
Proof of Fermat’s Little Theorem 6.4.1. —non-examinable because the
group theoretic proof is better
We prove this using a clever/annoying trick.
1. Let n ≡ (p − 1)! (mod p)
Imagine this list of numbers 1 × · · · × (p − 1). We’re going to multiply
each one by a and see what happens.
2. Note that
k 6≡ 0
(mod p) =⇒ ak 6≡ 0
(mod p)
since
p - k and we have p - a by hypothesis, so p - ak
.....................................................................
3. Note also that
k 6≡ j
(mod p) =⇒ ak 6≡ aj
(mod p)
since
(a, p) = 1 so ak ∼
= aj =⇒ k ∼
=j
.....................................................................
4. So multiplying each number in the list by a simply permutes the numbers in the list. try it for 5
88
Section 6. The integers (mod n) and congruences
5. This means
a.1 × a.2 × · · · × a.(p − 1) ≡ (p − 1)!
(mod p)
ie
(p − 1)!.ap−1 ≡ (p − 1)!
(mod p)
6. Finally note that the hcf of (p − 1)! and p is 1 since
p obviously can’t divide (p − 1)!
.....................................................................
so we can cancel by (p − 1)! to give
ap−1 ≡ 1
(mod p)
as required.
2
Instead of using the annoying trick, we can use induction. We begin with a
little remark about binomial coefficients:
Remark 6.4.2. Recall the binomial coefficient:
p
p!
=
k!(p − k)!
k
If p is prime, and k is a natural number between 1 and p − 1, then the
binomial coefficient kp is divisible by p.
This is because p divides the numerator but not the denominator.
Proof of Fermat’s Little Theorem 6.4.1.
By induction.
Since the result only depends on the value of a (mod p), we only have to
prove the result for natural numbers. We’ll do this by induction on a.
• Initial step
When a = 1, the result is clear.
• Induction step
Suppose that the result is true for a, and try to prove it for a + 1.
6.4 Fermat’s Little Theorem and Wilson’s Theorem
89
p p−1
p p−2
p
a
+
a
+ ··· +
a+1
1
2
p−1
all the binomial coefficients are divisible by p
≡ ap + 1 (mod p) as ..................................................................
the inductive hypothesis: ap ≡ a (mod p))
≡ a + 1 (mod p) by ..................................................................
(a + 1)p = ap +
and so the result for a + 1 follows from the result for a.
2
Which proof do you think is better? It’s good to have opinions about
whether a proof is good or not.
In the next section, we’ll prove a generalisation of this result which will work
for any modulus, not just a prime modulus.
Corollary 6.4.3. Let p be a prime number. For all natural numbers a, we
have
ap ≡ a (mod p).
Proof. There are two cases here.
boring
1. If p and a are coprime, then it follows immediately from Fermat’s
Little Theorem as we can multiply both sides by a.
2. If p and a are not coprime we must have p|a, i.e.,
a ≡ 0 (mod p).
So certainly
ap ≡ 0
(mod p)
≡ a
(mod p)
In the following example we’ll use both Fermat’s Little Theorem and the
Chinese Remainder Theorem. The example is a bit contrived, but no more
than, say pole-vaulting9 .
9
I quite like watching the pole-vault, although it’s hard to see how it could ever be
useful.
90
Section 6. The integers (mod n) and congruences
Example 6.4.4. What is 379 (mod 161)?
7 × 23
We first factor 161 = .....................
Now we use the Chinese Remainder Theorem:
If we can work out the answer mod 7 and mod 23
..........................................................................
that will give us a unique answer mod 161
..........................................................................
1. First we find 379 (mod 23).
322 ≡ 1 (mod 23)
By Fermat’s Little Theorem we know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
boring
so we write
379 = 322 × 322 × 322 × 313
≡ 1 × 1 × 1 × 313
≡ 33 × 33 × 33 × 33 × 3
≡ 4×4×4×4×3
≡ 4×4×2
≡ 9 (mod 23).
There isn’t really a systematic way of doing that part—you follow your
nose, and use anything that will help you. I admit that’s a bit annoying. Sometimes maths does turn out to be a combination of glorious
logic and organised trial-and-error.
2. Now we find 379 (mod 7).
36 ≡ 1 (mod 7)
By Fermat’s Little Theorem we know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
So
379 ≡ 36.13+1
≡ (36 )1 3 × 31
≡ 1×3
≡ 3
(mod 7)
6.4 Fermat’s Little Theorem and Wilson’s Theorem
91
3. So we have
9
379 ≡ ......... (mod 23)
3
379 ≡ ......... (mod 7)
And you know how to solve this!
DIY: 101 (mod 161)
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
We’ll now move onto a theorem about factorials, as they have appeared
already. This is known as Wilson’s Theorem, as he was the first to conjecture
it. However, Lagrange was the first to provide a proof10 .
Theorem 6.4.5 (Wilson’s Theorem). Let p be a prime number. Then
(p − 1)! ≡ −1 (mod p).
Let’s investigate this in the case p = 11
write out all the numbers, pair them up with their mult inverses
observe that only 1 and 10 are self-inverse so everything else is cancelled out
We need to know all the solutions to a2 ≡ 1.
Lemma 6.4.6. Let p be a prime number. The only solutions to
a2 ≡ 1 (mod p)
are a ≡ ±1 (mod p).
10
This is a bit unfair: these days we might call it the “Wilson–Lagrange” Theorem. But
sometimes things are named after people who had nothing much to do with them eg the
Eckmann–Hilton argument. L’Hôpital allegedly paid for his rule!
92
Section 6. The integers (mod n) and congruences
Proof.
a2 ≡ 1
(mod p)
⇐⇒
p|a2 − 1
⇐⇒
p|(a + 1)(a − 1)
⇐⇒
p is prime
p|a + 1 or p|a − 1 since .............................
⇐⇒
a ≡ ±1
(mod p)
Proof of Wilson’s Theorem 6.4.5.
Given 1 ≤ a ≤ p − 1 we know (a, p) = 1, so there is a unique integer b such
that
ab ≡ 1 (mod p).
So if a 6≡ b then a and b form a pair that cancel each other out in
(p − 1)!
(mod p).
If ab ≡ 1 (mod p) and a ≡ b (mod p) then we have
a2 ≡ 1
(mod p)
and by Lemma 6.4.6, this happens if and only if a = 1 or a = p − 1.
By pairing the remaining numbers between 2 and p − 2, we find that
(p − 1)! =
p−1
Y
a
a=1
= 1×
p−2
Y
a × (p − 1)
a=2
≡ 1 × 1 × (p − 1)
≡ −1
(mod p)
as required.
6.5
2
Euler’s φ-function and the Fermat-Euler Theorem
In this section, we are going to prove a generalisation of Fermat’s Little
Theorem. Remember the theorem said:
6.5 Euler’s φ-function and the Fermat-Euler Theorem
93
Let p be prime. If (a, p) = 1, then
ap−1 ≡ 1 (mod p).
We can try and generalise this by:
getting it mod non-primes
..........................................................................
The proof for prime modulus involved multiplying all numbers less than p
together; at various points in the proof of Fermat’s Little Theorem and of
Wilson’s Theorem, we use that these numbers are all coprime to p.
We can try to prove similar results for composite moduli by using instead
the list of numbers less than the modulus and coprime to it.
Example 6.5.1. Recall in the proof of Fermat’s Little Theorem:
1. We multiply all the numbers less than p and call it n.
2. We then multiply each of those numbers by a and observe that they
are permuted.
3. We deduce that n.ap−1 ≡ n (mod p).
4. We cancel out the n and Bob’s your uncle.
What will happen if we
• replace p with a non-prime m, and
• instead of using all numbers less than m, only those coprime to m?
It’ll be fine except that we won’t have am−1 ...
..........................................................................
..........................................................................
Example 6.5.2. Let’s do a specific example: m = 30, a = 7.
94
Section 6. The integers (mod n) and congruences
1. List all the integers coprime to 30. Then let their product be n (mod
30):
a ≡ 1.7.11.13.17.19.23.29 (mod 30)
.....................................................................
16, 1112
2. Multiply each of these by 7 (mod 30)
7, 29, 17, 1, 29, 13, 11, 23
.....................................................................
same numbers, different order
.....................................................................
3. Now observe that this means that
(7.1).(7.7). · · · .(7.29) ≡ 1.7. · · · .29
(mod 30).
78 n
But the right hand side is n, and the left hand side is ..........................
4. Therefore
78 n ≡ n (mod 30)
....................................
and as n is coprime to 30, we can cancel it, showing that
78 ≡ 1 (mod 30)
....................................
Question: Where did that 8 appear from?
the number of numbers less than m coprime to it
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This leads us to Euler’s totient function:
Definition 6.5.3. Let m be a natural number. We define Euler’s totient
function
φ(m) = the number of natural numbers less than m which are coprime to m.
z
Examples 6.5.4.
4
1. φ(5) = ........................ 1,2,3,4
2
2. φ(6) = ........................ 1,5
6.5 Euler’s φ-function and the Fermat-Euler Theorem
95
8
3. φ(15) = ........................ 1,2,4,7,8,11,13,14
8
4. φ(20) = ........................
Can you think of any rules?
primes etc
Lemma 6.5.5. Let p be a prime, and n ∈ N. Then
φ(pn ) = pn − pn−1 .
Proof.
There are pn natural numbers less than or equal to pn .
Those that are not coprime to pn are exactly those which are divisible by p,
i.e.,
p, 2p, . . . , pn = p(pn−1 ).
So there are pn−1 numbers up to pn which are divisible by p.
So φ(pn ) = pn − pn−1 as required.
2
We know that every natural number is the product of prime powers. The
next lemma will allow us to work out the value of φ(n) for all natural numbers n.
Lemma 6.5.6. Suppose that r and s are two coprime natural numbers.
Then φ(rs) = φ(r)φ(s).
Example 6.5.7. Take r = 5, s = 6, so that rs = 30.
4
φ(5) = ............
2
φ(6) = ............
So we’re expecting
8
φ(30) = ............
We will now use
96
Section 6. The integers (mod n) and congruences
Chinese Remainder Theorem
..........................................................................
which says that any pair of a number modulo 5 and a number modulo 6
corresponds to a number modulo 30.
Key fact: if the first number is coprime to 5, and the second is coprime to
6, then the result is coprime to 30, and conversely.
Here’s a table:
mod 5
mod 6
mod 30
1
1
1
2
1
7
3
1
13
4
1
19
1
5
11
2
5
17
3
5
23
4
5
29
and the numbers in the last column are exactly the numbers less than 30
and coprime to 30.
8
So we get φ(30) = .............. as expected.
Here’s a sketch proof. The main thing we’re leaving out is a proof of the
key fact—this is left to the Exercises.
Sketch Proof.
The Chinese Remainder Theorem tells us that to give a number n modulo
rs is equivalent to giving a pair of a number nr modulo r and a number ns
modulo s.
6.5 Euler’s φ-function and the Fermat-Euler Theorem
97
• Key fact:
(n, rs) = 1 ⇐⇒ (nr , r) = 1 and (ns , s) = 1.
It follows that the number of possible n is the product of the number of
possible nr and the number of possible ns i.e.,
φ(rs) = φ(r)φ(s).
as required.
Using the two lemmas, we can work out φ(360) say, as follows. We don’t
have to list all the numbers up to 360, and check which are coprime to 360;
we just begin with the canonical prime factorisation of 360 as
23 × 32 × 5
...............................
Then
φ(360) =
= φ(23 )φ(32 × 5)
= φ(23 )φ(32 )φ(51 )
= (23 − 22 )(32 − 31 )(51 − 50 )
= 4 × 6 × 4 = 96.
Finally we should state our generalisation of Fermat’s Little Theorem.
Theorem 6.5.8 (Fermat-Euler). Let m be any natural number. Then if
(a, m) = 1,
aφ(m) ≡ 1 (mod m).
You may have been wondering whether there is any “practical application”
of all the material we have seen so far. Perhaps surprisingly, the answer is
yes. everyone surprised including Hardy, morals of impact etc
One of the most brilliant applications is to cryptography. The RSA system
uses:
98
Section 6. The integers (mod n) and congruences
• the fact that multiplication is easy, but factorisation is hard (essentially
impossible if you pick a big enough number),
• the Fermat-Euler Theorem
This is a form of “public key cryptography” which means that the key for
the encryption can be made completely public, and still nobody will be able
to decode anything. This is amazing! It’s a completely different kind of key,
where you can use it to lock something up but can’t use it to unlock it again!
What does “big enough” mean? Current techniques mean that numbers up
to about 200 digits can be factorised. The US government imposes legal upper limits on the size of numbers people are allowed to use for cryptography!
1. Pick large primes p, q, set N = pq.
2. Compute φ(N ) = (p − 1)(q − 1).
3. Pick e coprime to φ “encryption key” eg a prime bigger than it.
4. So we have de + sφ = 1 ie de ∼
= 1 (mod φ).
d is decryption key.
Publish N and e.
• Encode M as M e (mod N ).
• Recover M as M de = M kφ+1 ∼
= M (mod N ).
φ(N
)
∼
since M
= 1 (mod N ).
17, 1112
99
7
The real numbers and convergent sequences
How are the real numbers different from the rationals? Better?
there are no “gaps”, IVT, sups - later
“There is an irrational number in between any two rational numbers.”
Once we have all the real numbers, we can talk about limits, continuity,
smoothness, and anything that involves things being “infinitesimally close
together”. People actually tried to use this kind of argument for ages before
being able to make it precise. One of the problems was the question of what
an irrational number is.
Have you ever tried to convince someone that
√
2 exists?
The construction of the real numbers and formalising of calculus was a
massive breakthrough in the history of mathematics.
7.1
Rational and irrational numbers
A rational number is one of the form m/n or m
n , where m and n are integers
and n 6= 0. We don’t have to know what that means, we just have to know
it satisfies this relation:
mn0 = m0 n
m
m0
= 0 ⇐⇒ .................................
n
n
This is an example of an equivalence relation and you’ll meet more of those
in the next semester of this course.
congruence
Another example is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A rational number m
n for which m and n are coprime is said to be in lowest
terms. So every rational number can be uniquely represented in lowest
terms, by cancelling out the hcf from m and n. This is an example of a
representative of an equivalence class.
100
Section 7. The real numbers and convergent sequences
Theorem 7.1.1. There is no rational number with square 2.
Proof. We argue by contradiction.
m 2
= 2 and aim for a contradiction.
n
Without loss of generality we can assume that m and n are coprime.
It follows that m2 = 2n2 , so that m2 is even.
It follows that m must be even, so m = 2q for some integer q.
But then
Suppose that
m2 = 4q 2 = 2n2
so
n2 = 2q 2
and so n2 is even, and so n is even.
But this means m and n are both even, so have a common factor of 2
—contradicts our assumption that m/n is in lowest terms.
Hence there is no rational number whose square is 2.
#
√
Question 7.1.2. Why didn’t we say “ 2 is irrational”?
we don’t know that irrational numbers exist
Answer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Note that
• the sum, difference and product of two rationals are again rational,
and
• if you divide a rational by a non-zero rational, the result is rational.
Thus the set Q of all rationals forms a nice number system in its own right
(they form a field, to be studied further at Level 3).
However, Q still has drawbacks; for example, there is no square root of 2 in
it. This leads from Q to the very much larger system of real numbers R.
(Of course, R still has drawbacks, such as the lack of a square root of −1;
this is remedied by going ever further, to the complex numbers C.)
7.2 The real numbers
7.2
101
The real numbers
The set R of real numbers can be thought of as the points on a line. Alternatively, the real numbers can be regarded as infinite decimals. Every
rational number is a real number, but there is an abundance of real numbers
that are not rational, and these are called irrational. The most important
examples are
√
2 = 1.414213 . . . .
π = 3.141592 . . . ;
e = 2.718281 . . . ;
Here is a picture of the real line:
−4
−3
−2
−1
0
1
2
√
2
3
e
4
π
Giving an actual construction of N, Z, and Q is not hard. However, constructing R is very hard, and wasn’t done properly until 1872, when it was
done independently and differently by Cantor and Dedekind.
Question 7.2.1. Why can’t we just say the reals are all the decimals?
Answer:
Does that make sense?
How do we know when two infinite expansions are the same?
We need to say they converge.
Once we are sure what the decimals are, it’s surprisingly easy to prove that
there are more of them than the rationals, using Cantor’s diagonal argument.
Cantor’s approach to constructing the reals uses Cauchy sequences.
7.3
Convergent sequences
The formalisation of calculus is spectacularly clever. We want to say what
it means for a sequence of numbers to get “infinitesimally close” to some
102
Section 7. The real numbers and convergent sequences
limit. For example, the sequence
1 1 1 1 1
1, , , , , , . . .
2 3 4 5 6
gets reeeaaaaaaaaally close to 0 but does it ever actually get there?
Invalid reasoning: It gets there at n = ∞ because
1
= 0.
∞
What is wrong with this argument?
What is ∞
..........................................................................
Instead we say:
No matter how small a distances we think of,
closer than that to 0.
1
n
eventually gets
waffle about zooming in, draw some pictures
Definition 7.3.1. A sequence of real numbers is a function N −→ R, usually
written
N −→
n
7→
R
an
so the sequence is
a1 , a2 , a3 , . . . , an , . . .
z
Sometimes sequences can be defined by a formula in terms of n, for example
1, 1 , 1 , . . .
so the sequence is . . . . .2 . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
• an =
1
n
• an =
(−1)n
n
•
n
−1, 1 , − 1 , . . .
so the sequence is . . . . . . .2. . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . .
0, 2, 0, 2, 0, 2, . . .
= 1 + (−1)n so the sequence is . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
sometimes by an inductive definition:
• F1 = F2 = 1, and Fn + Fn+1 = Fn+2 giving the sequence
Fib 1, 1, 2, 3, 5, 8, . . .
.....................................................................
—which works as a consequence of the Principle of Induction.
7.3 Convergent sequences
103
Note that just writing down the first few terms can be ambiguous, for example
1, 2, 4, 8, 16, . . .
an = no. of regions when you draw n points on a circle and join all dots
What sort of sequences are “manageable”? What wild behaviour could occur?
• shoot off to infinity
• oscillate forever
We want sequences that eventually settle down. It doesn’t matter how wild
they are at the beginning.
Definition 7.3.2. A sequence an of reals is said to be bounded by b ∈ R
if
z
∀n ∈ N, |an | ≤ b
no, could still oscillate forever
Is this good enough? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Definition 7.3.3. A sequence an of reals is said to converge to a ∈ R
when
z
∀ε > 0 ∃N ∈ N s.t. ∀n ≥ N |an − a| < ε is your εvil opponent.
What do we have to do to prove that such a statement is true? Remember
how we prove things with these quantifiers:
• For the “∀ε” we use an arbitrary unspecified value of ε, and only use
properties that hold for all possible ε values
104
Section 7. The real numbers and convergent sequences
• For the “∃N ” we need to exhibit a specific value of N . In practice,
this is likely to be some formula depending on ε.
• For “∀n” we again use an arbitary unspecified value of n.
Experiment: Let’s try it for an =
1
.
n
This is a game of you against εvil. In each round, εvil throws a postive
real number ε at you. You have to defend yourself by producing a natural
number N such that
1
∀n ≥ N, − 0 < ε
n
ie such that
∀n ≥ N, n1 < ε.
.................................
18, 1112
• If you fail to defend yourself with an N that works, you lose and εvil
wins.
• If you succeed in defending yourself, we move to the next round, and
εvil gets to throw another ε at you.
How can you win? If you produce a machine so that no matter what ε is
thrown at you, you can automatically produce an N , then εvil will have to
admit defeat.
get them to throw ε’s at me, I can always throw n ≥
Example 7.3.4.
Prove that the sequence an =
Solution.
Let ε > 0.
1
converges to 0.
n
1
ε
back
7.3 Convergent sequences
105
We need to find N ∈ N such that
∀n ≥ N,
i.e.
i.e.
1
− 0 < ε
n
1
<ε
n
1
n>
ε
So, put N > 1ε , as such a natural number clearly exists.
Then ∀n ≥ N, n ≥ N >
so
1
n
1
ε
2
< ε as required.
Example 7.3.5.
Prove that the sequence an =
1
converges to 0.
n2
Solution.
Let ε > 0.
We need to find N ∈ N such that
1
− 0 < ε
n2
∀n ≥ N,
i.e.
1
<ε
n2
i.e.
n2 >
i.e.
1
n> √
ε
1
ε
1
So, put N > √ , as such a natural number clearly exists.
ε
Then ∀n ≥ N, n2 ≥ N 2 >
so
1
n2
1
ε
2
< ε as required.
Example 7.3.6.
Prove that the sequence an =
(−1)n
n
converges to 0.
106
Section 7. The real numbers and convergent sequences
Solution.
Let ε > 0.
We need to find N ∈ N such that
(−1)n
n − 0 < ε
∀n ≥ N,
1
n
i.e.
and then the result follows exactly as for
<ε
1
.
n
2
Example 7.3.7.
Prove that the sequence an = 1 +
1
n
1
converges to .......
Solution.
Let ε > 0.
We need to find N ∈ N such that
1 +
∀n ≥ N,
i.e.
and then the result follows exactly as for
1
.
n
1
n
− 1 < ε
1
n
<ε
2
Note that
• To prove that something converges, you have to build an ε-defence
machine.
• If you are give that something converges, you are given an ε-defence
machine so you can use it whenever you want!
Example 7.3.8.
Let an be a sequence that converges to a. Prove that the sequence bn = 1+an
1+a
converges to ............
Solution.
Let ε > 0.
7.3 Convergent sequences
107
We need to find N ∈ N such that
∀n ≥ N,
|1 + an − (1 + a)| < ε
i.e.
|an − a| < ε
But we know an converges, so we are given such an N , and the result follows.
2
Now remember we realised that a sequence could be bounded without converging. Let’s make that precise:
Lemma 7.3.9. Bounded sequences do not necessarily converge.
Proof.
We just need to exhibit one counterexample
i.e. a sequence that is bounded but does not converge.
(−1)n
E.g. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
What about the converse?
Proposition 7.3.10. It is true/not true* that
every convergent sequence is bounded
.........................................................................
Proof.
Remember we have an ε-defence machine, so we can plug in any ε we
want and get an N .
Then, beyond N everything will be kept within ε of the limit. pic of line
Before N there are only finitely many terms, so they can’t be unbounded.
Let an be a seqence that converges to a.
Let ε = 1. So we have N ∈ N such that for all n ≥ N
|an − a| < 1.
19, 1112
108
Section 7. The real numbers and convergent sequences
Note that
|an | = |(an − a) + a| ≤ |an − a| + |a|
so for all n ≥ N ,
|an | ≤ |an − a| + |a| < 1 + |a|
We’re almost done—we just have to deal with all the an ’s before N .
So let b = max (|a1 |, . . . , |an−1 |, 1 + |a|)
Then for all n ∈ N, |an | ≤ b so an is bounded as required.
2
Example 7.3.11. Let
n
X
1
an =
.
k
k=1
Show that an does not converge.
Solution.
We use the contrapositive of Proposition 7.3.10:
if a sequence is not bounded it does not converge
..........................................................................
Given any b ∈ R, ∃n ∈ N s.t. 1 + n > b
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For all n, a2n ≥ 1 + n2 :
1+
1 1 1 1 1 1 1
+ + + + + + +···
2 |3 {z 4} |5 6 {z 7 8}
≥ 14 + 14
≥ 18 + 18 + 81 + 18
2
If an converges to a can we call this the limit of an ?
No, only once we know it’s unique
..........................................................................
7.3 Convergent sequences
109
Lemma 7.3.12. Uniqueness of limits
Suppose an converges to both a and b.
Then a = b.
Proof. By contradiction. draw pic of line with a and b far apart
and small regions around them where the an are supposed to land
Remember we have two ε-defence machines we can use here. So we can
feed in any ε we want, and the machines will produce us an N each.
Suppose a 6= b. Set ε =
|b − a|
which is greater than 0 by hypothesis.
4
Now since an converges to a we have N1 ∈ N such that
∀n ≥ N1 |an − a| < ε
and since an also converges to b we have N2 ∈ N such that
∀n ≥ N2 |an − b| < ε
max (N1 , N2 )
Now let N = ...........................
By the triangle inequality
|a − aN | + |aN − b| ≥ |a − b| = 4ε
but also by convergence as above
|a − aN | + |aN − b| < ε + ε = 2ε.
Thus we have 4ε < 2ε
#
2
So a = b as required.
So we can name this baby!
Definition 7.3.13. Suppose an is a sequence that converges to a. Then we
call a the limit of the sequence as n tends to ∞, and we write
lim an = a
n→∞
We also write an → a.
z
110
Section 7. The real numbers and convergent sequences
What do we know about limits? What do we think should be true?
Proposition 7.3.14.
a
1. If an is a constant sequence i.e. ∀n an = a, then an converges to . . .
If an → a and bn → b then
a+b
2. an + bn → . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ab
3. an .bn → . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
a
provided bn 6= 0 for all n, and b 6= 0
an
4.
→ . . .b. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
bn
ra
5. Given any r ∈ R, r.an → . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This is sometimes called the calculus of limits.
Proof.
Part 1.
Let ε > 0.
We need to find N ∈ N such that
∀n ≥ N,
|a − a| < ε
i.e.
20, 1112
0<ε
But this is always true, so we can pick N = 1.
Part 2.
Let ε > 0.
We need to find N ∈ N such that
∀n ≥ N,
|(an + bn ) − (a + b)| < ε
7.3 Convergent sequences
111
Remember: we have two ε-defence machines here, so we can feed in any
number we want. Here we’re adding the an terms and bn terms, so we’re
going to be a bit sneaky and feed 2ε into the machine.
Now since an converges to a we have N1 ∈ N such that
∀n ≥ N1 , |an − a| <
ε
2
and since bn converges to b we have N2 ∈ N such that
∀n ≥ N2 , |bn − b| <
ε
2
max (N1 , N2 )
Now let N = ......................
Then ∀n ≥ N :
|(an + bn ) − (a + b)| = |(an − a) + (bn − b)|
≤ |an − a| + |bn − b|
<
ε
2
+
ε
2
= ε
So we have ∀n ≥ N, |(an + bn ) − (a + b)| < ε as required
so an + bn → a + b.
Part 3.
Let ε > 0.
We need to find N ∈ N such that
∀n ≥ N,
|an bn − ab| < ε
Now
|an bn − ab| = |an bn − an b + an b − ab|
= |an (bn − b) + b(an − a)|
≤ |an |.|bn − b| + |b|.|an − a|
so we aim to make each summand less than 2ε .
112
Section 7. The real numbers and convergent sequences
• For |an |.|bn − b| we use the fact that every convergent sequence is
bounded (Proposition 7.3.10) so |an | ≤ M , say.
So to get
|an |.|bn − b| <
ε
2
M.|bn − b| <
ε
2
it suffices to get
i.e.
|bn − b| <
ε
2M
Now by convergence of bn we have N1 ∈ N such that for all n ≥ N1
|bn − b| <
ε
2M
• To get
|b|.|an − a| <
ε
2
it suffices to get
|an − a| <
ε
2|b|
Now by convergence of an we have N2 ∈ N such that for all n ≥ N2
|an − a| <
ε
2|b|
max (N1 , N2 )
Finally put N = ........................
Then for all n ≥ N
|an bn − ab| ≤ |an |.|bn − b| + |b|.|an − a|
ε
ε
+ |b|.
< M.
2M
2|b|
= ε
So an bn converges to ab as required.
what happened to parts 4 and 5??
2
7.3 Convergent sequences
113
Every time we prove convergence we begin by writing
Let ε > 0
.........................................
So we could get
1
n2
to converge to 0 by
1
times itself
. . n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
But here’s another way we could do this example (7.3.5).
Example 7.3.15.
Prove that the sequence an =
1
n2
converges to 0.
Solution.
Let ε > 0.
We need to find N ∈ N such that
∀n ≥ N,
1
n2
i.e.
− 0 < ε
1
n2
<ε
But we know that for all n ∈ N, n12 ≤ n1
and we know that the sequence n1 converges to 0
so we have N ∈ N such that for all n ≥ N
1
1
≤ <ε
2
n
n
so
1
n2
converges to 0 as required.
2
This is an example of a general result saying that if a sequence is “sandwiched” in between another two sequences that converge to the same place,
then it must converge to the same place too.
We “sandwiched”
1
n2
1
and constant 0
in between . . n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Proposition 7.3.16. Let an , bn , cn be sequences with
114
Section 7. The real numbers and convergent sequences
• for all n ∈ N, an ≤ bn ≤ cn , and
• an and cn both converge to the same limit a.
Then bn also converges to a.
Proof. Let ε > 0. draw picture of real line with an and cn within ε of a
We need to find N ∈ N such that
∀n ≥ N, |bn − a| < ε
Now, by convergence of an we have N1 ∈ N such that
∀n ≥ N1 ,
|an − a| < ε
i.e.
a − ε < an < a + ε
and by convergence of cn we have N2 ∈ N such that
∀n ≥ N2 ,
|cn − a| < ε
i.e.
a − ε < cn < a + ε
max (N1 , N2 )
Put N = ................................
Then for all n ≥ N we have
a − ε < an ≤ bn ≤ cn < a + ε
thus
|bn − a| < ε
and bn converges to a as required.
2
Question 7.3.17. Can we use the notion of convergent sequence to construct irrational numbers?
Answer: no, because we have to know in advance what they converge to
—we need something like convergence that doesn’t reference the actual limit
7.3 Convergent sequences
115
Definition 7.3.18. A sequence an of real numbers is called a Cauchy
sequence if
∀ε > 0 ∃N ∈ N s.t. ∀n, m ≥ N |an − am | < ε
Proposition 7.3.19. Every convergent sequence of real numbers is Cauchy.
Note that eventually (eg in Metric Spaces you will see that the convergence of
sequences can be studied in places other than the real numbers, for example
anywhere with a notion of “distance” (ie a metric space). It is true in any
metric space that a convergent sequence must be Cauchy, but it is possible
for a Cauchy sequence not to converge. This is the whole idea behind
constructing the reals from the rationals using Cauchy sequences.
Proposition 7.3.20. There exist Cauchy sequences of rational numbers that
do not converge in the rationals.
Example 7.3.21. Here are some sequences of rational numbers that con√
verge to 2 in R.
1. The Babylonian method: a0 > 0, an+1 =
an +
2
an
2
a2n −2
2. Newton’s method: a0 > 0, an+1 =
an −
2
2
3.
a1
an+1
= 1


 an +
=

 a −
n
1
n
a2n ≤ 2
1
n
a2n > 2
The following could be taken as a theorem, a definition, or a desired property
of the real numbers:
Every Cauchy sequence of real numbers converges in the reals.
Can define irrationals/reals *as* Cauchy sequences of rationals, subject to
equiv rel...
116
Exercises
Exercises week #1
1. Learn the Greek alphabet (lower case).
2. Try the 11 game:
• Play with n players, for any n ≥ 2.
• Each player says either one, two or three consecutive integers.
• The first player starts with either “1”, “1,2” or “1,2,3”.
• Each consecutive player must say the next one, two or three consecutive integers.
• If you say “11” you are out, and play continues with the next player saying “1”, “1,2”
or “1,2,3”.
• The last person not out is the winner.
Can you work out how to win if there are only 2 players? What about with more players?
3. (True story.) Restaurant servings of wine have been getting bigger and bigger recently. I
would like to drink a small 100ml glass of wine, but the waiter tells me that they can’t do
that as they only have a 175ml measure and a 250ml measure. Can you work out how they
could use those two measures to measure 100ml for me?
4. (True story.) Proteins are linear chains of amino acids. I was looking at an article in the
journal “Methods in Nature” which pointed out that looking at a chain with 100 places and
20 possible amino acids in each place would give 20100 possibilities. So far so good. The
article then commented that this was approximately 10130 . That’s also fine. But the funny
thing was that the authors actually gave a citation for this fact, that is, they referred the
readers to another paper whose research had apparently produced this approximation.
So how did I do this approximation in my head??
5. Write down all the elements of the following sets:
i) {a ∈ Z | a2 < 9}
iii) {a ∈ N |
ii) {a ∈ Z | a2 ≤ 9}
iv) {a ∈ Z |
√
√
a < 2}
a ≤ 2}
v) {a ∈ N |a| < 3}
vi) {a ∈ Z |a| ≤ 3}
6. An even number is one that can be written in the form 2k for some integer k. An odd
number is one that can be written in the form 2k + 1 for some integer k.
i) Prove that if n is even, n2 is even.
ii) Prove that if n and m are odd, n + m is even.
iii) Prove that if n and m are odd, nm is odd.
iv) State the converse of each of the above statements, and prove or disprove each one.
Exercises
117
7. This question is like the previous one, but where odd/even is about being divisible by 2,
this question is about being divisible by 3. Now there are three possible cases, because if a
number is not divisible by 3 there are two ways this can happen. That is: every integer n
satisfies precisely one of the following:
• n = 3k for some integer k, in which case we say n is “congruent to 0 mod 3”,
• n = 3k + 1 for some integer k, in which case we say n is “congruent to 1 mod 3”,
• n = 3k + 2 for some integer k, in which case we say n is “congruent to 2 mod 3”,
i) Write down five numbers falling into each of the three cases, including some negative
numbers.
ii) Prove that if n is congruent to 0 mod 3, n2 is also. What happens in the other two
cases?
iii) Prove that it is not possible for n2 to be congruent to 2 mod 3.
iv) What can you say about n + m in all possible cases of n and m? What about nm?
(Draw some tables.)
v) What can you deduce if nm is congruent to 0 mod 3?
8. Let A and B be statements.
• The statement “A and B” is true if both A and B are true, and false otherwise.
• The statement “A or B” is true if at least one of A and B is true, and false otherwise.
• The statement “not A” is true if A is false, and false otherwise.
Fill in the following truth tables: write 1 for true and 0 for false.
A B A and B
0
0
0
0
1
0
1
0
0
1
1
1
not (A and B)
A B A or B
A B
0
0
0
0
0
0
1
1
0
1
1
0
1
1
0
1
1
1
1
1
Do you notice anything?
not A not B
not A or not B
118
Exercises
Exercises week #2
1. Memorise the first 5 rows of Pascal’s triangle, that is, up to and including the one that
starts “1, 5, . . .”. Why is this useful?
2. Say what is wrong with each of the following definitions.
i) Definition. We define X to be a set of integers as follows. If n ≥ 0, then n ∈ X if
and only if n is odd. If n ≤ 0, then n ∈ X if and only if n is even.
ii) Definition. The highest common factor of two numbers is their greatest common
divisor.
iii) Definition. For each real number x, we define its reciprocal 1/x by the equation
x. x1 = 1.
iv) Definition. The square root of the number x is the real number y such that y 2 = x.
v) Definition. We define a function f as follows. For every fraction ab , we define f ( ab ) =
ab.
3. A natural number n is said to be a perfect number if it equals the sum of its proper divisors
(factors not equal to n). For example, the divisors of 6 are 1, 2, 3 and 6, so the proper
divisors are just 1, 2 and 3. Since 6 = 1 + 2 + 3, we see that 6 is perfect.
i) Show that 15 is not perfect, but that 28 is perfect.
ii) About 45 perfect numbers are known; none of them is odd. We can make the conjecture: “All perfect numbers are even”. What would you have to do to prove that this
conjecture is false?
4.
i) Let n, a, b be natural numbers. Show that if ab = n then one of a and b must be less
√
than or equal to n.
ii) One very inefficient way of testing to see if a number n is prime is to see if it is divisible
by k for every k < n. Can you see some ways of being a bit more efficient? Hint: the
first part was relevant.
5. Find three numbers a, b, c such that
• the highest common factor of a and b is 2,
• the highest common factor of a and c is 3,
• the highest common factor of b and c is 5, but
• the highest common factor of a, b and c is 1.
Similarly find four numbers such that any two have a common factor greater than 1, but
the only factor common to all four is 1.
Exercises
119
6. Let a and b be natural numbers. What is the relationship between the product, the highest
common factor, and the lowest common multiple of a and b? Prove that this is true for all
a and b. If you are stuck, try a few values of a and b to see if you can see what is going on.
7. Let S be a set and A, B ⊆ S.
i) Prove that A00 = A.
ii) Hence deduce the second part of De Morgan’s Law (Theorem 1.2.3) from the first.
Hint: apply the first part to A0 and B 0 .
8. Are the following functions injective? Surjective?
i) f : R −→ R given by f (x) = x2
ii) f : R+ −→ R given by f (x) = x2 where R+ denotes the set of positive real numbers.
iii) f : R −→ R given by f (x) = ex
iv) f : R −→ [−1, 1] given by f (x) = sin x, where
[−1, 1] = {a ∈ R | − 1 ≤ a ≤ 1}
9. Let f : A −→ B and g : B −→ C be functions. Prove that
i) If f and g are injective then gf is injective.
ii) If f and g are surjective then gf is surjective.
iii) If gf is injective then f must be injective.
iv) If gf is surjective then g must be surjective.
120
Exercises
Exercises week #3
1. I hope you can write out (x + y)2 on sight, without using any brainpower at all. Make sure
you can do this for (x + y)n and (x − y)n for all n up to and including 5.
2. The following statements are not true, so negate them:
i) ∀x ∈ R ∃y ∈ R s.t. xy = 1.
ii) ∃x ∈ Z s.t. ∀y ∈ Z x + y = 0.
iii) ∃N ∈ N s.t. ∀n ∈ N n > N .
iv) ∃ε > 0 s.t. ∀N ∈ N ∃n ≥ N s.t.
1
n
> ε.
v) ∀x, y ∈ R s.t. xy = 0, x = 0 and y = 0.
3. Write down the contrapositive, negation and converse of the following statements.
i) x = 2 ⇒ x2 = 4
ii) x2 is odd implies x is odd.
Are the original statements true or false? Are the new statements true or false?
4. Prove by induction that
1 + 3 + 5 + · · · + (2n − 1) = n2
for all natural numbers n. Can you think of a more geometrical proof?
5. Prove by induction that for all natural numbers n,
13 + 2 3 + · · · + n3 =
n2 (n + 1)2
.
4
(Notice that this implies the rather remarkable fact that the sum of the cubes of the first
n integers is the square of the sum of the first n integers.)
6. Prove by induction that for all n ∈ N
12 − 22 + 32 − · · · + (−1)n−1 n2 = (−1)n−1 12 n(n + 1)
7. Prove by induction that for all n ≥ 10
n! > 4n
Exercises
121
8. Prove by induction that for all integers n ≥ 2,
1
1
1
n+1
1− 2
1 − 2 ··· 1 − 2 =
,
2
3
n
2n
where the product involves all natural numbers between 2 and n.
9. Show by induction that for all n ∈ N
1
1
1
n
+
+ ··· +
=
.
1×2 2×3
n(n + 1)
n+1
10. Show that for all natural numbers n, the number n3 − n is divisible by 3.
11. There must be something wrong with the following proof. What is it?
Theorem. Let a be any positive number. For all positive integers n, we have an−1 = 1.
Proof. If n = 1, an−1 = a1−1 = a0 = 1. Now assume that the result is true for 1, 2,
3,. . . ,k. Then:
1×1
ak−1 × ak−1
=
= 1,
a(k+1)−1 = ak =
1
ak−2
so the theorem is true for n = k + 1 as well.
122
Exercises
Exercises week #4
1. Make sure you have learnt the definitions of injective and surjective functions.
2. Prove by induction that for all non-negative natural numbers n, the integer 3(4)n + 4(11)n
is divisible by 7.
3. Prove that the Well-Ordering axiom implies the Principle of Induction. (Hint: copy the
proof of Theorem 3.3.2 but modify it so that it’s for induction instead of strong induction.)
4. There must be something wrong with the following proof. What is it?
Theorem. We have
1
1
3 1
1
+
+ ··· +
= − .
1×2 2×3
(n − 1)n
2 n
Proof. We use induction on n. For n = 1,
n = k. Then
3
2
−
1
n
1
1
1
1
+
+ ··· +
+
1×2 2×3
(k − 1)k k(k + 1)
1
1×2 .
=
Assume the theorem is true for
3 1
1
−
+
2 k
k(k + 1)
3 1
1
1
=
−
+
−
2 k
k k+1
3
1
=
−
,
2 k+1
=
and so the theorem is true for n = k + 1 as well.
5. What is wrong with the following proof that ∀x 6= 0 ∈ R, x1 =
1
x
=
1
|x|
x≥0
⇐⇒
1
≥0
x
=
1
x
⇐⇒
1
<0
x
=
1
−x
=
−
so
1
x
x<0
so −
1
x
1
x
1
|x| ?
2
Exercises
123
6. What is wrong with the following proof?
Lemma.
f
g
Let f and g be functions A −→ B −→ C.
If f and g are injective then g ◦ f is injective.
f(a) = f(a0 ) =⇒ a = a0
g(a) = g(a0 ) =⇒ a = a0
(g ◦ f)(a) = (g ◦ f)(a0 ) =⇒ g(f(a)) = g(f(a0 ))
But g injective =⇒ a = a0 .
∴ g ◦ f is injective as required.
2
7. What is wrong with the following proof that ∀a > 0 ∈ R, ∃x ∈ R s.t. x2 > a
(2a)2 = 4a2 > a
∴ put x = 2a
8.
2
i) Show that the square of any odd number has a remainder of 1 when divided by 4.
(Remember that an odd number can be written in the form 2k + 1 for some integer
k.)
ii) Show that the remainder when this square is divided by 8 is also always 1.
9. Explain why the four natural numbers
5! + 2, 5! + 3, 5! + 4, 5! + 5
are composite. For a general natural number n, show that there are n consecutive composite
integers.
10. Prove each of the following statements
i) Let x ∈ R. If 5x ≤ x2 , then x ≤ 0 or x ≥ 5.
ii) Let a, b, c ∈ Z. If a|b and b|c, then a|c.
“a|b” means there is an integer k such that b = ka.
iii) If a|b and a|c then a|b + c.
124
Exercises
Exercises week #5
1. Suppose that α is a real number such that α + α1 is an integer. Prove by induction that for
all natural numbers n, αn + α1n is an integer.
[Hint: for the induction step, consider (αk + α1k )(α + α1 ). You may find that you need more
than one initial step!]
2. Suppose we lived in a world where the only positive integers were 1, 4, 7, 10, . . ., of the form
3k + 1. Show that 100 factorises into “primes” in two different ways. (Remember a “prime”
is a number that cannot be written as a product of two numbers other than 1 and itself.)
3. Suppose we lived in a world where the only positive integers were the even numbers.
i) Which numbers are “prime” in this world? (That is, which even numbers cannot be
expressed as a product of two even numbers.)
ii) Show that every number in this world can be expressed as a product of “primes”.
iii) Given an example of a number in this world that can be expressed as a product of
“primes” in two different ways.
4. Given a natural number n we say that a is congruent to r mod n if a = nk + r for some
k ∈ Z.
i) Write down five numbers congruent to 3 mod 7, and five numbers congruent to 3 mod
8.
ii) Prove that if ab is congruent to 0 mod 7, then at least one of a and b must be congruent
to 0 mod 7.
iii) Is the same true if we work mod 8 instead? That is, if ab is congruent to 0 mod 8, is
it true that at least one of a and b must be congruent to 0 mod 8? Prove it or give a
counterexample.
iv) Generalise this result to integers mod n, splitting into two cases: n is prime, or n is
not prime.
5.
i) Let p > 3. Write down the contrapositive of the following statement:
“If p is prime then it is congruent to 1 or 5 mod 6”.
Then either prove the original statement, or the contrapositive, whichever you think
is easiest. (I think the contrapositive is easiest.)
ii) Hence show that if p is prime then p2 must be congruent to 1 mod 6.
6. Use Euclid’s Algorithm to find the highest common factor of 8789 and 3641.
Exercises
125
7. Find the highest common factors of the following pairs of numbers. Only use Euclid’s
Algorithm if inspection is too hard. I think you should need it for at most one of these.
i) 126 and 333.
ii) 377 and 468.
iii) 256 and 1890.
iv) 12345 and 3456.
8. The Fibonacci numbers are defined by F1 = F2 = 1, and Fn+1 = Fn + Fn−1 for n ≥ 2.
Write down the first 15 Fibonacci numbers. Explain why Euclid’s takes n − 1 steps to find
the highest common factor of Fn+1 and Fn .
9. Express 4059091/2029039 in lowest terms. For every natural number n, show that the
14n + 3
is in lowest terms.
fraction
21n + 4
10. Find integers a and b such that 543a + 340b = 1.
11. Find the highest common factor of 3883 and 2739, and write it in the form 3883a + 2739b.
126
Exercises
Exercises week #6
1. What is the smallest number divisible by each of:
i) 1,2,3?
ii) 1,2,3,4?
iii) 1,2,3,4,5?
iv) 1,2,3,4,5,6?
v) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10?
2. Say whether or not each of the following statements is true:
(a) If x is any number, then there is a number y such that y > x.
(b) There is a number y, such that if x is any number then y > x.
3. Bertrand’s Postulate says that
For every natural number n, there is a prime number p such that p lies between
n and 2n.
Bertrand’s Postulate is true (and was proved around 1850: it will be proved in MAS430).
Show that the statement
There is a prime number p such that for every natural number n, p lies between
n and 2n,
got by exchanging some words, is false.
4. What is the canonical factorisation of the highest common factor of 23 34 51 73 and 24 32 53 73 ?
What is the canonical factorisation of their lowest common multiple?
Given two numbers a and b, explain why the product of their highest common factor and
their lowest common multiple is ab.
5. Find all integer solutions to the following Diophantine equations:
i) 57x + 38y = 19
ii) 56x + 40y = 15
iii) 3458x + 2177y = 35
iv) 627x + 348y = 15
In each case also find the solution with the smallest positive value of x.
Exercises
127
6. Find the smallest natural number b for which the equation 1001x + 770y = 1000000 + b is
soluble in integers, and show that it has 100 solutions in positive integers.
7. A student paid £11.37 for some 39p pens and some 69p pens. How many of each did he
buy?
8. We have previously said “a is congruent to r mod n” if a can be written as a = kn + r for
some k ∈ Z. Another way of saying this is n|a − r, and we write
a≡r
(mod n).
By considering all possibilities for x (mod 8), give another proof that if x is odd, then
x2 ≡ 1 (mod 8).
9. Again by considering all possibilities for x (mod 8), show that x2 ≡ 0, 1 or 4 (mod 8) for
every integer x. Considering congruences modulo 8, explain why
x2 + y 2 + z 2 = 1007
has no solution in integers x, y and z.
128
Exercises
Exercises week #8
1.
i) Write down powers of 2 (mod 7) until you spot a pattern.
ii) Hence find 220 (mod 7) without using a calculator and without working out what 220
is.
iii) Do the same (mod 11), without using your calculator at any point.
iv) What is 22011 (mod 11)? Can you think of a use for knowing this fact?
2. Show that the cube of any number is congruent to 0, 1 or 6 mod 7.
3. For which integers c is the equation 12x ≡ c (mod 30) soluble?
You can try and do this by thinking hard, or you can just try all values of x (mod 30) and
see what possible values of c show up.
4. Find, by inspection, the simultaneous solution to
x ≡ 3 (mod 7)
x ≡ 7 (mod 13)
and express the solution in the form x ≡ a (mod m) for suitable integers a and m.
5.
i) Find all the integers x between 0 and 19 (inclusive) such that
7x ≡ 4
(mod 20)
You can do this by trial and error; later we’ll see more systematic ways of doing this.
ii) Find all the integers x between 0 and 11 (inclusive) such that
x2 ≡ 4
(mod 12)
iii) Find all the integers x, y between 0 and 11 (inclusive) such that
xy ≡ 0
(mod 12)
6. Re-write the proof of Corollary 5.5.4 as a proof by induction.
Exercises
129
7. Prove in two different ways that for all non-negative integers n, the number
24.8n − 19.3n
is divisible by 5:
i) By induction.
ii) By considering the expression mod 5.
Which of the two proofs do you like best? (It’s good to have an opinion about how good a
proof is.)
8. Previously you proved by induction that for all natural numbers n, the number
n3 − n
is divisible by 3. Prove it two more times:
i) By considering the expression mod 3.
ii) By factorising the expression and considering the possible values of the factors mod 3.
Which of the three proofs do you like best?
130
Exercises
Exercises week #9
1. Solve the following congruences. Note that some are possible by inspection—just because
you’ve learnt a fancy way of doing something, don’t waste time using it if inspection might
be easier.
i) 102x ≡ 119 (mod 187)
ii) 48x ≡ 18 (mod 84)
iii) 39x ≡ 26 (mod 51)
iv) 81x ≡ 27 (mod 117)
v) 16x ≡ 32 (mod 48)
2. One of the equations 85x ≡ 119 (mod 204) and 85x ≡ 120 (mod 204) has no integer solutions. Determine which it is, and express the solutions to the other equation in the form
x ≡ a (mod m) for suitable values of a and m.
3. One of the equations 91x ≡ 133 (mod 203) and 91x ≡ 134 (mod 203) has no integer solutions. Determine which it is, and express the solutions to the other equation in the form
x ≡ a (mod m) for suitable values of a and m.
4. Solve the following simultaneous congruences.
i) x ≡ 3 (mod 5)
x ≡ 4 (mod 7)
ii) x ≡ 3 (mod 35)
x ≡ 4 (mod 37)
iii) x ≡ 10 (mod 89)
x ≡ 11 (mod 97)
iv) x ≡ 3 (mod 8)
x ≡ 2 (mod 12)
v) x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
x ≡ 4 (mod 7)
vi) x ≡ 2 (mod 5)
x ≡ 3 (mod 7)
x ≡ 4 (mod 11)
Exercises
131
5. Recall that the Fibonacci numbers are defined by F1 = F2 = 1, and Fn+1 = Fn + Fn−1 for
n ≥ 2.
i) By studying the values of the sequence modulo 3, explain why Fn is divisible by 3
if and only if n is divisible by 4. (You may like to investigate other small primes
similarly.)
√
ii) Let φ = 1+2 5 . Show that φ2 = φ + 1. Prove by induction that Fn ≤ φn−1 for all
natural numbers n.
iii) Prove by induction that
Fn ≡ 2n.3n (mod 5)
for all natural numbers n.
(In fact, the sequence does not satisfy any other congruence of the form
Fn ≡ an.bn (mod m)
with 0 < a < m and 0 < b < m; you might like to try to prove this!)
Hint: you will need to use a variant of induction as in Example 3.2.1.
132
Exercises
Exercises week #10
1. Make a helpful poster of Fermat’s Little Theorem, Wilson’s Theorem, and the Fermat-Euler
Theorem, because it’s really hard to remember what they say. There will be a prize for the
best poster.
2. Recall that φ is Euler’s Totient function. Write down all values of φ(n) for 1 ≤ n ≤ 12.
In the next few questions we’ll prove from scratch some ways of calculating φ(n) in special
cases.
3. Show that if p is prime, φ(p) = p − 1.
4. Let p and q be distinct prime numbers.
i) Write down all the numbers ≤ pq that are divisible by p. How many are there?
ii) Similarly, write down all the numbers ≤ pq that are divisible by q. How many are
there?
iii) Observe that a number is not coprime to pq if and only if it is divisible by p or q.
Hence show that
φ(pq) = φ(p)φ(q)
Hint: if you’re stuck, try it for a pair of primes eg 5 and 7. Which numbers less than 35
are coprime to 5? How many are there?
5. Now we’ll use Lemma 6.5.6.
i) Calculate k = φ(24) using φ(8) and φ(3).
ii) Thus there are k pairs of natural numbers a, b with
• a ≤ 8 and coprime to 8, and
• b ≤ 3 and coprime to 3.
List these k pairs.
iii) For each pair, the Chinese Remainder Theorem tells us there is a unique solution
x (mod 24) of the simultaneous congruences
x ≡ a (mod 8),
x ≡ b (mod 3),
Find the solution for each pair a, b.
iv) Verify that this gives the k natural numbers x such that x ≤ 24 and (x, 24) = 1
Exercises
133
6. In this question we’ll prove the part of Lemma 6.5.6 that we left out in lectures.
Let r and s be coprime and 1 ≤ n ≤ rs. Write nr for the remainder of n when dividing by
r, and ns for the remainder of n when dividing by s.
i) Write down the contrapositive of the following statement (being careful about how to
negate “ and ”) and then prove it:
“If n is coprime to rs then nr is coprime to r and ns is coprime to s.”
ii) Write down the converse of the above statement, and then the contrapositive of that,
and then prove it.
iii) Observe that you have proved the key fact from Lemma 6.5.6.
7. Fermat’s Little Theorem may be stated as:
“If p is prime and (a, p) = 1 then ap−1 ≡ 1 (mod p)”.
i) State the converse of this theorem.
ii) We will show that the converse of the theorem is not true, so first negate it.
iii) Verify that 341 is not prime and that (2, 341) = 1 (duh).
iv) Compute 210 (mod 341). (No fancy tricks are required here—just work it out.)
v) Hence compute 2340 (mod 341).
vi) Explain why this shows that the converse of Fermat’s Little Theorem is not true.
8.
i) Using Fermat’s Little Theorem, show that for all integers a coprime to 7 we have
a12 ≡ 1 (mod 7). Hence show that for all integers a, we have
a13 ≡ a (mod 7).
ii) Similarly show that for all integers a, we have
a13 ≡ a (mod 13).
iii) Using the Chinese Remainder Theorem or otherwise, deduce that for all integers a
a13 ≡ a (mod 91)
9. (In this question we will find square roots of −1 (mod p), in a slightly hilarious way.)
Let p be prime congruent to 1 (mod 4) and write x = ( p−1
2 )!. Using Wilson’s theorem,
show that
x2 ≡ −1 (mod p).
Hint: Match up half of the factors of (p − 1)! with the factors of one x, and then match up
the other half of the factors with the factors of the other x. You will pick up some −1’s in
the process, and this is where the fact that p is congruent to 1 (mod 4) comes in.
134
Exercises
Exercises week #11
1.
i) Prove that the sum of rational numbers is rational.
ii) Prove that the sum of a rational number and an irrational number must be irrational.
iii) Is it true that the sum of irrational numbers is irrational? Prove it or give a counterexample.
2. The triangle inequality says that |a + b| ≤ |a| + |b|.
i) Prove that the triangle inequality holds for real numbers, by considering different
cases.
ii) Show that the triangle inequality does not hold for train ticket prices in the UK. (Or at
least, explain what I mean by that, and remember it for future train travel reference.)
3. Prove from first principles (ie using an ε − N argument) that the following sequences
converge. You will have to decide what they converge to.
i) 2 +
1
n
ii) 2 +
1
n2
iii)
1
1+n
iv)
1
1000000+n
Note: I have included this example to see if you will fall into my trap. What is my
trap, and are you sure you haven’t fallen in it?
v)
√1
n
4. Write down what it means for a sequence not to converge to a? (That is, carefully negate
the definition of convergence.) Prove from first principles that the following sequences do
not converge to 1.
i) an =
1
n
ii) an = n
5. Write down what it means for a sequence to be unbounded. Prove that the sequence an = n
is unbounded.
Exercises
135
Exercises week #12
1. Show that none of the following assertions is equivalent to the definition of convergence of
an to a.
i) ∃ε > 0 and N ∈ N s.t. ∀n ≥ N |an − a| < ε
ii) ∀ε > 0 and ∀N ∈ N and ∀n ≥ N |an − a| < ε
iii) ∃N ∈ N s.t. ∀ε > 0 and ∀n ≥ N |an − a| < ε
2. Prove from first principles that the following sequences converge.
i)
ii)
iii)
2
n
2
1+n
1
n
+
1
n2
Hint: get each summand to be less than
ε
2
3. Prove that the following sequences converge. You may use the calculus of limits and the
sandwich lemma.
i)
1
2n
ii)
1
en
iii)
n
2n
Hint: sandwich with
1
n
4. The following statements are taken from students’ homework. What is wrong with them?
What were the students trying to say?
i) ∀N ∈ N ∃N >
ii) Choose n >
1
ε
1
ε
s.t.
1
N
<ε
for all n ∈ N
iii) Convergence means ∃N ∈ N s.t. ∀n ≥ N |an − a| < ε ∀ε > 0
iv) ∃N ∈ N s.t. N > c ∀c ∈ R
136
Logic puzzles
Logic puzzles
137
138
Logic puzzles
Logic puzzles
139
140
Logic puzzles
Logic puzzles
141
142
Logic puzzles
Logic puzzles
143
144
Logic puzzles
Logic puzzles
145