《Proofs》
《Proofs》
Jay Cummings
Contents
1 Intuitive Proofs 1
1.1 Chessboard Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Naming Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 The Pigeonhole Principle . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2 Direct Proofs 35
2.1 Working From Definitions . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2 Proofs by Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.3 Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.4 Greatest Common Divisors . . . . . . . . . . . . . . . . . . . . . . . 46
2.5 Modular Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.6 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3 Sets 73
3.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2 Proving A ✓ B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.3 Proving A = B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.4 Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.5 Two Final Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.6 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4 Induction 107
4.1 Dominoes, Ladders and Chips . . . . . . . . . . . . . . . . . . . . . . 107
4.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.3 Strong Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4.4 Non-Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.5 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
iii
5 Logic 155
5.1 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.2 Truth Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5.3 Quantifiers and Negations . . . . . . . . . . . . . . . . . . . . . . . . 167
5.4 Proving Quantified Statements . . . . . . . . . . . . . . . . . . . . . 174
5.5 Paradoxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
5.6 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7 Contradiction 213
7.1 Two Warm-Up Examples . . . . . . . . . . . . . . . . . . . . . . . . . 215
7.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
7.3 The Most Famous Proof in History . . . . . . . . . . . . . . . . . . . 219
7.4 The Pythagoreans . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.5 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
8 Functions 247
8.1 Approaching Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 247
8.2 Injections, Surjections and Bijections . . . . . . . . . . . . . . . . . . 251
8.3 The Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
8.4 Invertibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
8.5 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
9 Relations 291
9.1 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2 Abstraction and Generalization . . . . . . . . . . . . . . . . . . . . . 303
9.3 Bonus Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
8
7
6
5
4
3
2
1
a b c d e f g h
Note that with 32 dominoes you can cover all 64 squares of the chessboard. There
are many different ways you can place the dominoes to do this, but one way is to cover
the first column by 4 dominoes end-to-end, cover the second column by 4 dominoes,
and so on.
8
7
6
5
4
3
2
1
a b c d e f g h
1
Note: Along the left and bottom edges of the chessboard are numbers and letters. They are
there simply to label the rows and the columns.
1
2 Chapter 1. Intuitive Proofs
Of course, that’s not the only way. Here’s a nifty way to cover all the squares:
8
7
6
5
4
3
2
1
a b c d e f g h
Math runs on definitions, so let’s give a name to this idea of covering all the
squares. Moreover, let’s not define it just for 8 ⇥ 8 boards — let’s allow the definition
to apply to boards of other dimensions.
Definition.
Proposition.
Before most proofs, we will discuss some of the proof’s key ingredients or ideas.
Proof Idea. This proposition is asserting that “there exists” a perfect cover. To say
“there exists” something means that there is at least one example of it. Therefore, any
proposition like this can be proven by simply presenting an example which satisfies
the statement.
Proofs: A Long-Form Mathematics Textbook 3
8
7
6
5
4
3
2
1
a b c d e f g h
We have shown by example that a perfect cover exists, completing the proof.
We typically put a small box at the end of a proof, indicating that we have
completed our argument. This practice was brought into mathematics by Paul
Halmos, and it is sometimes called the Halmos tombstone.2
We have seen two different perfect covers of the chessboard. How many are there
in total? This is a very hard question, but mathematicians have found the surprisingly
large answer: there are exactly 12,988,816 perfect covers. This was discovered in
1961, long before modern computers could discover the answer by brute force.3
Getting back to whether a chessboard can be covered, we proved that a standard
8 ⇥ 8 chessboard can be perfectly covered by dominoes. What if I cross out the
bottom-left and top-left squares, can we still perfectly cover the 62 remaining squares?
8
7
6
5
4
3
2
1
a b c d e f g h
2
One apocryphal story is that Halmos regarded proofs as living until proven. Once proven, they
have been defeated — killed. And so he wrote a little tombstone to conclude his proof.
3
In fact, in that 1961 paper by Temperley & Fisher (and independently by Kasteleyn), they
showed that the answer for a general m ⇥ n board is this crazy thing:
2 ✓ ✓ ◆ ✓ ◆◆
dm edn e
Y Y
2
⇡j ⇡k
4 cos2 + 4 cos2 .
j=1 k=1
m+1 n+1
4 Chapter 1. Intuitive Proofs
As you can probably already see, the answer is yes. For example, the first column
can now be covered by 3 dominoes and the other columns can be covered by 4
dominoes each.
8
7
6
5
4
3
2
1
a b c d e f g h
What if I cross out just one square, like the top-left square?
8
7
6
5
4
3
2
1
a b c d e f g h
Can this be perfectly covered? This is a good opportunity to mention how important it
is to reason through explanations at your own pace, and to try to solve things on your
own before reading the explanations here. Doing so will deepen your understanding
immensely. So, on that note, take a moment and come up with an answer before
reading on.
. . . Ok, hopefully you did so! The answer is no. . . Do you see why? Hint: Think
about parity — meaning, evenness vs. oddness. Try to convince yourself of the answer
before moving on.
Let’s again write this out formally as a proposition, and then include a formal
proof of it.
Proofs: A Long-Form Mathematics Textbook 5
Proposition.
Once again, we begin with a “Proof Idea” section in which we discuss the central
ideas in a more casual way.
Proof Idea. The idea behind this proof is that one domino, wherever it is placed,
covers two squares. And two dominoes must cover four squares. And three cover
six. In general, the number of squares covered — 2, 4, 6, 8, 10, etc. — is always an
even number. This insight is the key, because the number of squares left on this
chessboard is 63 — an odd number. Ok, now here is the proof.4
Proof . Since each domino covers 2 squares and the dominoes are non-overlapping,
if one places our k dominoes on the board, then they will cover 2k squares, which is
always an even number.5 Therefore, a perfect cover can only cover an even number
of squares. Notice, though, that the board has 63 remaining squares, which is an odd
number. Thus, it can not be perfectly covered.
Makes sense? One can never cover an odd number of squares, because any
collection of dominoes can only cover an even number of squares. This reasoning is
what prevents the existence of a perfect cover.
What if I take an 8 ⇥ 8 chessboard and cross out the top-left and the bottom-right
squares? Then can it be covered by dominoes?
8
7
6
5
4
3
2
1
a b c d e f g h
4
While a “proof idea” may include the essence of why a proposition is true, a proof is more
formal and thorough. Notions of formality and thoroughness are subjective, and it will take time to
understand what level of rigor is required. We will discuss this much more throughout this book.
5
Note: Since k is the number of dominoes, k must be a positive integer. We will be more formal
about this beginning in Chapter 2, but the integers are these numbers: . . . , 3, 2, 1, 0, 1, 2, 3, . . . ;
that is, we include positive numbers, negative numbers and zero, but not numbers like 2.4. The
positive integers are thus these numbers: 1, 2, 3, 4, . . . .
6 Chapter 1. Intuitive Proofs
a b c d
. . . I hope by now you have tried it on your own. If so, you probably got stuck.
Indeed, no perfect cover exists. Did the small cases give you any intuition for why
your attempts failed?8 There is a really slick way to see it, which is contained in the
proof below.
Proposition.
Proposition 1.4. If one crosses out the top-left and bottom-right squares of an
8 ⇥ 8 chessboard, the remaining squares can not be perfectly covered by dominoes.
Proof. Observe that the chessboard has 62 remaining squares, and since every
domino covers two squares, if a perfect cover did exist it would require
62
= 31 dominoes.
2
Also observe that every domino on the chessboard covers exactly one white square
and exactly one black square. Two examples are shown here:
6
Something I learned in grad school: Even the best mathematicians do this. Because it works.7
7
P.S. This works in life, too. Problem solving skills you learn in math class can have real
applications beyond your coursework.
8
The great Henri Poincaré said “It is by logic we prove. It is by intuition we discover.” An
important aspect of learning math is fine-tuning your intuition. Proofs run on logic, but you will
discover many proofs by following your intuition.
Proofs: A Long-Form Mathematics Textbook 7
8
7
6
5
4
3
2
1
a b c d e f g h
Did the proof make sense? We showed that any perfect cover using 31 dominoes
must cover 31 white squares and 31 black squares. And since our chessboard has 30
white squares and 32 black squares, no perfect cover is possible.9
We also used a picture within our proof. Pictures can help the reader, but you
must also be careful that your picture is not too simplistic and misses special cases.
A good rule of thumb is that you want your proof to be 100% complete without the
picture; the picture illustrates your words, but should not replace your words.
For many of you, your earlier math courses proceeded like this: You were intro-
duced to a new type of problem, you learned The Way to solve those problems, you
did a dozen similar problems on homework, and then if a similar problem was on
your exam, you repeated The Way one more time.
Beginning now, this paradigm will begin to shift. This shift will not be abrupt,
because there are many new skills which will require practice, but you will notice a
change. In calculus, if two students submitted full-credit solutions, then it is likely
their work looks very similar. For proofs, this is less likely.
Furthermore, when learning new ideas it is beneficial to think about them from
multiple angles. For example, below is a slightly different method to prove Proposition
1.4.
• Assume you do have a perfect cover and think about placing dominoes on the
board one at a time.
• At the start there are 62 squares — 32 black squares and 30 white squares.
9
A common mistake after reading Proposition 1.3 is to assume that the only way to prevent
perfect covers is by having an odd number of squares, and that as long as you have an even number
there must be perfect covers. Proposition 1.4 shows that this is not the case. Perfect covers could
be excluded for other reasons too.
8 Chapter 1. Intuitive Proofs
• After placing the first domino, no matter where it’s placed, there will be 31
black squares and 29 white squares left.
• After placing the second domino, no matter where it’s placed, there will be 30
black squares and 28 white squares left.
• After placing the third domino, no matter where it’s placed, there will be 29
black squares and 27 white squares left.
...
• After placing the 30th domino, no matter where it’s placed, there will be 2
black squares and 0 white squares left.
• But since every domino must cover up 1 black square and 1 white square, and
there are only 2 black squares to go, the final domino can not possibly be
placed.
The central idea is the same as in our earlier proof, but their presentations are
different. In other cases, two different proofs will rely on two different central ideas.
– Asking Questions –
Question 3: For every m and n, does there exist a perfect cover of the m ⇥ n
chessboard by 2 ⇥ 1 dominoes? If not, for which m and n is there a perfect cover?
These questions are asked of you in the Chapter 1 exercises. Other, more
challenging questions include: How many ways can one cover the m ⇥ n chessboard
with 2 ⇥ 1 dominoes? What if I change the domino to be another shape, and then
ask all these same questions again? Can we generalize these questions to higher
dimensions?10 What does the image on this book’s cover have to do with all this?
10
A good math problem is like whatever a fun version of the hydra monster is. You solve one
problem, and three more appear in its place! The number of unsolved math problems is steadily
increasing because of this. Indeed, pick up a math research paper and you will likely find more
questions asked than answered. This provides wonderful job security for us academics.
Proofs: A Long-Form Mathematics Textbook 9
• A proposition is a result that is less important than a theorem. It has also been
proved.
All of the above are results that have been proved — a conjecture, though, has not.
At this point, if you were to conjecture how many regions there will be for the
n = 6 case, your guess would probably be 32 regions — the number of regions certainly
seems to be doubling at every step. In fact, if it kept doubling, then with a little more
thought you might even conjecture a general answer: that n randomly placed dots
form 2n 1 regions; for example, the n = 4 case did indeed produce 24 1 = 23 = 8
regions.
If I saw such a conjecture, I know I’d be tempted to believe it! Yet surprisingly,
this conjecture would be incorrect. One way to disprove a conjecture is to find a
counterexample to it. And as it turns out, the n = 6 case is such a counterexample:
11
By “result” we mean a sentence or mathematical expression that is true. We will discuss this in
much more detail in Chapter 5.
12
It’s like it’s saying “Yo, lemma help you prove that theorem.”
10 Chapter 1. Intuitive Proofs
3 2
4
5
10
9 6
7 8 11
15 12
13
14 16
17 20 21
18
19
23 29
24 30
22 28
25 27
26
31
n=6
31 regions
This counterexample also underscores the reason why we prove things in math.
Sometimes math is surprising. We need proofs to ensure that we aren’t just guessing
at what seems reasonable. Proofs ensure we are always on solid ground.13
Further, proofs help us understand why something is true — and that under-
standing is what makes math so fun. When I showed you the chessboard with the
upper-left and bottom-right squares removed, if I immediately told you that it is
impossible to perfectly cover it with 31 dominoes, then you might not have found
the result very interesting (especially if I said the reason why is because a computer
just ran through all the cases and none worked). But when you understood precisely
why such a tiling was impossible by counting white and black squares, I hope you
found it much more interesting and insightful.
Lastly, we study proofs because they are what mathematicians do, and one goal
of this book is to teach you how to think and act like a mathematician.14 What else
does this book aim to teach you? I’m glad you asked:
Textbook Goal. Develop the skills to read and analyze mathematical statements,
learn techniques to prove or disprove such statements, and improve one’s ability to
communicate mathematics clearly. It also aims to give you a taste of the different
areas of math, and show what it is like to be a mathematician by learning some of
our discipline’s practices, culture, history and quirks.
There is another set of goals that has to come from you. To go beyond rote
learning — to really understand mathematics — requires you to struggle with the
material. As you are introduced to a proof, I hope you do not just passively read it
without challenging yourself to figure out portions on your own. I encourage you to
work through plenty of exercises, to read extra proofs on your own, and to organize
study groups to discuss the material with others. Challenge yourself and you will
grow faster. These are the soft skills that only you can instill, and I hope you put in
the work to do so.
13
Conjecture: All positive integers are smaller than a trillion. Computer: I’ve tested the first
billion cases, and they all check out. Looks true to me, mate!
14
And if you are using this book in a course, then there’s one final reason: It’s on the test!
Proofs: A Long-Form Mathematics Textbook 11
Fact. There are 3 non-balding people in Sacramento, CA, who have exactly the same
number of hairs on their head.
We will prove this using what is called the pigeonhole principle. This is principle
is fascinating because while it is obviously true, it has some remarkable consequences.
It’s name comes from a simple, real-world observation: If 6 pigeons live in just 5
pigeonholes, then at least one pigeonhole must have at least two pigeons living in it.
Likewise, if 11 or more pigeons are living in these 5 pigeonholes, then at least one
pigeonhole has at least 3 pigeons living in it.15
Said in complete generality: If at least kn + 1 pigeons live in n different pigeon-
holes, then at least one pigeonhole has at least k + 1 pigeons living in it.
The true power of the pigeonhole principle, is that it works for more than just
pigeons!16 Let’s now talk the hairs on the heads of Sacramentans. Our proof will
rely on a few real-world facts and a definition.
• The average person has between 100,000 and 150,000 hairs on their head, and
essentially everyone has under 200,000 hairs. So we will focus on Sacramentans
with at most 199,999 hairs.17
• For the sake of this problem we’ll define “non-balding” means they have at least
50,000 strands of hair (what we choose doesn’t change things much).
• There are 480,000 people in Sacramento. A quick search online shows that
certainly less than 100,000 Sacramentans are balding. Therefore, a conservative
estimate gives at least 380,000 non-balding Sacramentans.
Proof . By the above facts, there are at least 380,000 non-balding Sacramentans.
These are our “pigeons.” What are our pigeonholes?
For each number between 50,000 and 199,999, imagine a box with that number
written on it.
15
(Foot)Note: The most “balanced” case is if you have two pigeons living in each of the pigeonholes,
except one pigeonhole has three pigeons living in it. But we do not require this! Perhaps they are
all living in just one pigeonhole, or the breakdown is 3-4-0-2-2. In all these situations, at least one
of the pigeonholes does indeed have at least three pigeons living in it.
16
When my undergraduate combinatorics professor, Christine Kelley, told our class about the
pigeonhole principle, she made this joke. I thought it was hilarious and have not forgotten it.
17
Note that “at most 199,999 hairs” means “199,999 or fewer hairs.” Or, said more math-y: “if n
is the number of hairs, then n 199, 999.” Likewise, “at least 5” means “5 or more.” The phrases
“at most” and “at least” can be confusing when you first hear them, but they are used a lot in math.
12 Chapter 1. Intuitive Proofs
There are 150,000 boxes, and each of these becomes a “pigeonhole.” If Sophie Germain
has 122,537 hairs on her head, then write her name on a piece of paper and drop it
into the box with the number 122,537 written on it.
Sophie
Germain
If Chris Webber has 101,230 hairs on his head, then place his name into the box with
101,230 written on it. Do this for every one of the 380,000 non-balding Sacramentan.
In the end, we have 380,000 names to put in just 150,000 boxes. So certainly (or
by the pigeonhole principle) there must be at least two names in one of the boxes.
And these two people — being in the same box — must have the same number of hairs
on their head.
Moreover, if there were exactly two names in each box, that would be 300,000
names. But we have 380,000 names! With these extra 80,000 names to place, there
must be a box with at least three names in it. Indeed, the pigeonhole principle tells
us that if there are more than twice as many names as boxes, then there must be a
box with at least three names in it. This proves the fact.
Note that with 300,000 people, it is extremely likely that three people have exactly
the same number hairs on their heads — it would be remarkable for every number of
hairs to have exactly two people with that number. But it is not until 300,001 people
that it is guaranteed that three people have the same number.
Now, it is rare for a proof in math to rely on real-world data like the number of
hairs on a human’s head, but I think this is a fun example to introduce this important
mathematical principle which is the focus of the rest of this chapter. Let’s first restate
the pigeonhole principle using the more common objects/boxes phrasing than the
antiquated pigeon/pigeonhole phrasing.
Principle.
Principle 1.5 (The pigeonhole principle). The principle has a simple form and
a general form. Assume k and n are positive integers.18
Simple form: If n + 1 objects are placed into n boxes, then at least one box
has at least two objects in it.
General form: If kn + 1 objects are placed into n boxes, then at least one box
has at least k + 1 objects in it.
Proofs: A Long-Form Mathematics Textbook 13
This principle makes use of variables. When possible, I find it helpful to plug in
some specific values for those variables to better understand what it is saying. For
example, you could plug in k = 1 and n = 4, or k = 3 and n = 2. After some specific
cases make sense, you can begin to make sense of the general case.
Next, let’s take a look at some some basic examples of the pigeonhole principle,
beginning with the one we already proved.
Example 1.6.
• There are 3 non-balding Sacramentans who have exactly the same number of
hairs on their head.
• Among any 5 playing cards, there are at least two cards of the same suit.
Notice that these are asserting how many are needed to guarantee that the property
holds. With just four people, it is possible they all have the same birthmonth, but it
is not until the 37th person that we are guaranteed such a quadruple.
Likewise, it takes 367 people to guarantee that two of them have the same birthday.
But just as a quick fun fact, how many people do you think you need to have a 50%
chance that two have the same birthday? Maybe 367 2 ? The answer is remarkably
few. . . you only need 23 people! With 23 random people, the odds that two have the
same birthday is 51%. And the reason why is purely mathematical;19 look up the
birthday problem for the deets.
Let’s discuss some more examples of the pigeonhole principle.
Example 1.7. You just washed n pairs of socks (2n individuals), and suppose each
pair is a different color than the other pairs. If you pull the socks out of your dryer
one-at-a-time, how many must you pull out to be guaranteed to have a matching
pair?
Solution. Here, imagine we have one box for each pair of socks, and each sock is
considered an object; thus we have n boxes.
18
Reminder: The positive integers are these numbers: 1, 2, 3, 4, . . . .
19
Warning: In the real world, when people say “what are the odds” they usually mean it rhetorically
and do NOT want a detailed mathematical analysis of the answer.
14 Chapter 1. Intuitive Proofs
When you pull out a sock, put it in its box. As soon as a box has two socks in
it, we have a pair. By the pigeonhole principle, once we have pulled out and placed
n + 1 socks into the n boxes, we are guaranteed to have a box with two in it. So
n + 1 guarantees the property holds.20 Could fewer also guarantee it?
In fact, n + 1 is the smallest number that can guarantee a match, because it is
possible that the first n socks were all from separate pairs — for example, if each pair
has a left-foot sock and a right-foot sock, then it is possible that you pulled out the
n left-foot socks.
Since n + 1 socks guarantees the property but n does not, n + 1 is how many you
must pull out to be guaranteed a pair.
Example 1.8. As of this writing, the population of the United States is about 330
million people. How many U.S. residents are guaranteed to have the same birthday
according to the pigeonhole principle?
Most solutions are discovered through scratch work, in which you try out ideas
and test your hypotheses. At times I will include scratch work to help show how you
could of discovered the main idea on your own.
Scratch Work. To determine this, let’s see what would happen if each date of the
year had exactly the same number of people born on it.21 This is straightforward,
just divide the 330 million people into 366 days:
330, 000, 000
= 901, 639.344 . . .
366
Since 901,639.344 people are born on an average day of the year, we should be
able round up and say that at least one day of the year has had at least 901,640
people born on it. That is, with the pigeonhole principle we should be able to prove
that there are at least 901,640 people in the USA with the same birthday.
Solution. Imagine you have one box for each of the 366 dates of the (leap) year,
and each person in the U.S. is considered an object (sorry22 ). Put each person in the
box corresponding to their birthday. By the general form of the pigeonhole principle
(with n = 366 and k = 901, 639 and thus k + 1 = 901, 640), any group of
(901, 639)(366) + 1
people is guaranteed to contain 901,640 people which have the same birthday. And
because
330, 000, 000 > (901, 639)(366) + 1,
20
Said differently, n + 1 is an upper bound on how many socks are needed to guarantee a matching
pair.
21
No surges 9 months after New Year’s Eve or Valentine’s Day, or lulls on (the 75% absent) Leap
Day of February 29th .
22
How to Objectify People with Math was among the rejected titles for Chapter 1 of this book.
Others: The Hairs Within the Pigeon Holes, and Castles Going Mental.23
23
This last one will make sense at the end of the chapter.
Proofs: A Long-Form Mathematics Textbook 15
there are enough people in the U.S. to guarantee that 901,640 people all have the
same birthday.
Moreover, we can not do any better. That is, the pigeonhole principle does not
guarantee that 901,641 people all have the same birthday. In order to guarantee that,
we would need (901, 640)(366) + 1 people, but there are not this many people in the
U.S., because
330, 000, 000 < (901, 640)(366) + 1.
Mathematical Examples
One of the challenges of applying the pigeonhole principle is identifying what you
should make your “boxes” and what you should make your “objects.” The following
examples highlight this fact, and since these are becoming a little more mathy and
serious, we will begin to call them propositions.
The following example also refers to a set. In this case, the set is simply used to
refer to a collection of eight numbers. We will study sets in detail in Chapter 3.
Proposition.
Proposition 1.9. Given any five numbers from the set {1, 2, 3, 4, 5, 6, 7, 8}, two
of the chosen numbers will add up to 9.
Let’s again begin with some scratch work. When you work on homework, scratch
work is the space to try out ideas and test hypotheses. It also makes you more
efficient: By writing down ideas and trying out examples, you will likely discover a
proof faster.24
Scratch Work. For propositions like this, it is a good idea to begin by testing it on
your own. For example, when writing this I randomly chose these five numbers: 1, 3,
5, 6 and 7. In this case, 3 and 6 are the two numbers which add up to 9. Or perhaps
my five numbers were 2, 3, 4, 7 and 8. In this case, 2 and 7 are the two numbers
which add to 9. Pick five more on your own and check that it works.
It seems to check out, but how do we prove it? Since we are trying to have two
numbers add up to 9 from the set {1, 2, 3, 4, 5, 6, 7, 8}, it would be natural to start
24
It tends to be much faster than the stereotypical practice of just sitting back in an overstuffed
armchair, sipping Scotch until the idea pops fully-formed into your head. This was actually a
mistake of mine when I first learned proofs. Not the armchair or Scotch part, but I was hesitant
to start writing until I knew where I was going. I’ve learned from my mistake, though, and I now
jump right in to scratch work, and am a more efficient mathematician as a result.
16 Chapter 1. Intuitive Proofs
Given any five numbers from {1, 2, 3, 4, 5, 6, 7, 8}, place each of these five numbers
in the box to which it corresponds; for example, if your first number is a 6, then place
it in the box labeled “3 and 6.” Notice that we just placed five numbers into four
boxes. Thus, by the simple form of the pigeonhole principle (Principle 1.5), there
must be some box25 which contains two numbers in it. These two numbers add up
to 9, as desired.
Proposition.
Proposition 1.10. Given any collection of 10 points from inside the following
square (of side-length
p 3), there must be at least two of these points which are of
26
distance at most 2.
25
Note: The word “some” can be confusing to new mathematicians. The phrase “some box” means
“at least one box.” It does not mean “exactly one box.”
Proofs: A Long-Form Mathematics Textbook 17
Scratch Work. We have 10 points. How can we use the pigeonhole principle? Since
we are trying to show that two points have some property, and since the conclusion
of the simple form of the pigeonhole principle regards two objects, it’s probably the
simple form of the principle that we will use. . . Can you see a way to get 9 (or fewer)
“boxes” to put our points in? The 3-by-3 square has area 9. . . perhaps that’s a sign of
what to do. . .
Here’s one idea: Divide up the 3 ⇥ 3 square into 9 “boxes,” each 1 ⇥ 1:
1
1 1 1
Then if you pick any 10 points from the 3 ⇥ 3 square, they will fall neatly into
these boxes! For example:
• • • •
• •
• • • •
•
! •
• • • •
• •
• •
Of course, it is possible that a point will fall exactly on the line between two
boxes, so we will have to make up a rule for how to break a tie, but otherwise this
了百破平局
does at least place 10 points into 9 boxes. And so by the pigeonhole principle we will
get two points in the same box. But does that give us what we want?
If there are 2 points in the same 1 ⇥ 1 box, how far apart can two points be? I
think you see where this is going, so let’s start the proof!
1
1 1 1
26
p
Reminder: “At least two points” meansp “two or more points”. Likewise, “of distance at most 2”
means “of distance less than or equal to 2”.
18 Chapter 1. Intuitive Proofs
As for the points on the lines between squares, consider them part of the square above
and/or to the right. Doing this, each of the points in the 3 ⇥ 3 square is assigned
to one of the nine boxes. By the pigeonhole principle (Principle 1.5), by placing 10
points into these 9 boxes, at least one box must have at least two points in it; let’s
call these points x and y.
We now determine how far apart two points can be if they are in the same box.
Indeed, observe that the maximum such distance occurs when the two p points are on
opposite corners, which by the Pythagorean theorem is of distance 2.
p
2 1
1
p
The distance between x and y must be at most this maximum distance of 2, which
completes the proof.
Paul Erdős27 is one of the great mathematicians of the 20th century,28 and is as
unique and fascinating of a person as you can imagine. I encourage you all to read
The Man Who Loved Only Numbers for a really interesting look at an extraordinary
genius. If you are interested in my own mathematical upbringing, then the book
also tells of my Ph.D. advisor, Ron Graham, who struck up a lifelong friendship
with Erdős. But beyond that, the book is an excellent collection of mathematics,
mathematicians, and anecdotes that I think each of you will enjoy.
Erdős was famous for being a problem solver. More so than building theory, he
largely spent his time solving problems, a staple of combinatorics. He also liked to
share math with others, and liked giving problems to young and promising kids who
were aspiring mathematicians. The following was his favorite problem to give, and it
is this problem with which we end the main content of this chapter.
This problem will be a challenge and will introduce a few ideas which we have
not yet discussed, but I want to share it with you anyways; beginning in Chapter 2
we will methodically build new material from stuff we have already done, but our
goal for this chapter is to get our feet wet and to have fun proving some interesting
things.
Proposition.
Proposition 1.11. Given any 101 integers from {1, 2, 3, . . . , 200}, at least one
of these numbers will divide another.
27
Pro-Tip: “Erdős” is pronounced “air-dish.” It’s Hungarian.
28
He pioneered an area of math called combinatorics, which includes techniques like the pigeonhole
principle and areas like graph theory (which we will discuss on page 22) and Ramsey theory (which
we will discuss on page ??.
Proofs: A Long-Form Mathematics Textbook 19
Scratch Work. We will study divisibility in detail in Chapter 2, but for now you
simply have to recall that, say, 3 divides 15 because 15 3 is an integer. Likewise, 6
divides 30. However, 12 does not divide 30 because 30 12 = 2.5, which is not an integer.
This is again set up perfectly for the simple form of the pigeonhole principle. If
we can set up 100 boxes somehow, and we create some rule that tells us how to place
the 101 numbers into these 100 boxes, then the pigeonhole principle guarantees that
two of these numbers will land in the same box. So we just need it to be the case
that once two numbers land in the same box, then one will divide the other. . .
Another proof strategy is to look at related problems and see how we solved them.
Maybe a similar approach will work here. For example, for Proposition 1.9 the rule
was that a 1 or 8 goes in the first box; a 2 or 7 goes in the second box; and so on.
We need another rule like this, but instead of the two numbers adding to 9, one must
be a multiple of the other. . .
This is tough! I would encourage you to go out to dinner tonight with your most
boring friends, and when the conversation drifts you can spend the time pondering
this problem. So feel free to stop reading now and go do that.
..
.
Ok, welcome back! Hope your friends didn’t mind. Anyways, here are my
stream-of-consciousness thoughts in my scratch work:29
• There are 100 numbers between 1 and 100. Maybe we should make a box
for each of those numbers. And maybe in Box n we can put n and 2n? Like
Box 3 will be where 3 and 6 go? But wait. . . should 6 go in Box 3 or Box 6?
And where would a number like 135 go? Maybe Box 3 is for 3 and another
number from {101, 102, . . . , 200} which is divisible by 3? Like Box 5 could be
for 5 and 135? Box 15 for 15 and 165? But what about prime numbers in
{101, 102, . . . , 200}. . .
• Ok, new plan. The prime numbers30 larger than 100, like 101, do not divide any-
thing in {1, 2, 3, . . . , 200} besides themselves, and nothing in {1, 2, 3, . . . , 200}
divides them (except 1, but 1 divides everything and can only go in one box,
so let’s ignore 1 for now). So these big primes have to be in their own box.
Otherwise, if we got 101 and some other number in the same box, then once the
pigeonhole principle gives us “two in the same box” we would not be guaranteed
that one divides the other. Ok, so we start off with a box for each of them.
And a random dude on Quora.com31 says there are 20 primes between 101 and
29
I will only do this once, but for Chapter 1, let alone the hardest problem in Chapter 1, I think
it’s worth it to emphasize the trial-and-error mental process when trying to prove something hard.
30
Recall: A positive integer is prime if it is at least 2 and the only numbers which divide it are 1
and itself. The primes are 2, 3, 5, 7, 11, 13, 17, . . . .
31
The day that this reference stops making sense is the day I will start thinking about writing a
second edition of this book.
20 Chapter 1. Intuitive Proofs
200, so I’ll trust him. So 80 boxes to go. . . Hmmm. . . Well we can now start
doing what we had thought of before. We could pick a number less than 100
and pair it with a non-prime larger than 100. But then 20 of these numbers
can’t have their own box. . . Ok this is getting too complicated. No way Erdős’
favorite problem would have a solution this complicated. . .
• Ok, new plan. There are also 100 even numbers and 100 odd numbers in the
set {1, 2, 3, . . . , 200}. Maybe we can have a box for each even number? But
now if you double it or multiply it by anything else to find what to pair it
with, you keep getting even numbers! Ok, let’s try odd numbers. If you have a
box for every odd number. . . well, Box 3 could be where 3 and 6 go! And Box
5 can be where 5 and 10 go! IT’S WORKING!!! Oh wait. But what about,
like, 12? Where does it go? I suppose it could go in Box 3 with the 3 and the
6. . . Because if any two of 3, 6 or 12 wind up together, then the smaller one still
divides the larger one. . . Oh, and in that case, you might as well put 3, 6, 12,
24, 48, 96 and 192 all in the same box. Each is just 3 times a bunch of 2s, and
so the smaller will always divide the larger! Likewise, in Box 5 we will put 5,
10, 20, 40, 80 and 160. In Box 7 we will put 7, 14, 28, 56 and 112. And so on.
• Ok, now that’s feeling right. And the primes above 101 are all odd, and doubling
them is larger than 200, so they are ending up in their own box, which earlier
we said they would have to. So that’s a good sanity check. Let’s do one more
sanity check. We have said before that it is often beneficial to test ideas on
smaller cases. What would this look like if we instead chose 51 numbers from
{1, 2, 3, . . . , 100}? We are still choosing 1 more than half. Or 16 numbers from
{1, 2, 3, . . . , 30}? These are still too big to do by hand. Let’s do 7 numbers
from {1, 2, 3, . . . , 12}. Following the strategy we just discovered, let’s create a
box for every odd number in this set:
1 3 5 7 9 11
And in box m we will put any number of the form 2k · m. Thus, these are the
numbers that will go in each box:
1, 2, 4, 8 3, 6, 12 5, 10 7 9 11
This seems right. Pick any 7 of these 12 numbers, and place each in the
appropriate box. With 7 numbers but 6 boxes, by pigeonhole two will end up
in the same box. If it is, say, 2 and 8, then yes, one divides the other. Or 3
and 12, or 5 and 10. Being in the same box means the smaller number divides
the bigger one.
Proofs: A Long-Form Mathematics Textbook 21
• Ok, yeah, this is feeling right. Sanity has been checked! And the bigger case
should work in the same way. Now for the writeup!
Proof . For each number n from the set {1, 2, 3, . . . , 200}, factor out as many 2’s as
possible, and then write it as n = 2k · m, where m is an odd number. So, for example,
56 = 23 · 7, and 25 = 20 · 25. Now, create a box for each odd number from 1 to 199;
there are 100 such boxes.
Remember that we are given 101 integers and we want to find a pair for which
one divides the other. Place each of these 101 integers into boxes based on this rule:
For example, 72 = 23 · 9 would go into Box 9, because that’s the largest odd number
inside it.
Since 101 integers are placed in 100 boxes, by the pigeonhole principle (Principle
1.5) some box must have at least 2 integers placed into it; suppose it is Box m. And
suppose these two numbers are n1 = 2k · m and n2 = 2` · m, and let’s assume the
second one is the larger one, meaning ` > k. Then we have now found two integers
where one divides the other; in particular n1 divides n2 , because nn21 is an integer:
n2 2` · m
= k = 2` k
.
n1 2 ·m
This completes the proof.
This procedure might not seem optimal since some of the boxes have many
numbers in them (the first box contains {1, 2, 4, 8, 16, 32, 64, 128}) while each of the
fifty odd numbers larger than 100 is in a box all to itself. Moreover, many of these are
divisible by other numbers. For instance, if 125 and 25 were among the 101 numbers
chosen, then these two numbers would be placed in separate boxes and our procedure
would fail to detect that one is divisible by the other. Our proof still goes through,
and in some other box we will find a pair — but we did miss the 25 and 125 pair.
It makes you wonder if 101 numbers are really needed. If we risk missing lots
of pairs, maybe only 80 numbers guarantee that one divides another. Or maybe 51
numbers do so.
Alas, and perhaps surprisingly, our procedure is indeed optimal. Even if you
chose just 1 fewer number — 100 — you would not be guaranteed that one divides
another. You really do need 101. In Exercise 1.22, you will be asked to find 100
numbers from {1, 2, 3, . . . , 200} for which none divides another.
Your first bonus example comes from the field of graph theory. A graph 32 can
be thought of as a collection of points on a piece of paper, called vertices, with a
collection of line segments, called edges, each of which connects two vertices. Also,
there is no rule saying a graph has to be in one piece, and there is no rule saying that
a vertex has to have an edge touching it (if a vertex touches no edges, it is called a
lone vertex ). Here’s an example of a single graph:
• • •
• •
•
•
• •
For graphs we also do not care about how it’s drawn, only how many vertices
there are and which vertices are connected by an edge. For instance, here is the exact
same graph, just drawn differently:
• •
•
• • •
• •
Notice that there is a point at the bottom of the square where two edges appear
to intersect. This does not count as a vertex, though; only the solid dots count as
vertices.
The question we want to ask is in regards to the degree of a vertex, which is
defined to be the number of edges touching that vertex. For instance, here’s the same
graph, drawn the first way, with degrees labeled:
2 1 2
• • •
• •
3 • 1
• 1
0 • •
2 2
32
Note that a graph in this context is nothing like the xy-plane graphs that you have used in
every math class up to this point. Upper division math is very different than lower division math in
many ways. At times, this even includes the vocabulary.
Proofs: A Long-Form Mathematics Textbook 23
What we wish to prove is that in any graph (with at least two vertices), there
must be two vertices which have the same degree. In the above there are many such
pairs. Let’s do one more sanity check: Among graphs with at least two vertices, let’s
quickly check that the two simplest graphs satisfy this. Both of these graphs have
two vertices; the first is just two lone vertices, while the second has an edge between
its two vertices:
• • and • •
0 0 1 1
Yup! Both of these graphs contain a pair of vertices with the same degree. In fact,
that’s all they have! Feel free to draw a couple more examples and check that it is
satisfied on them as well. And then, when you’re ready, let’s prove it.
Proposition.
Proof Idea. How many options are there for the degree of a vertex? The smallest
number is 0. What is the max? Well, since G has n vertices, a vertex can be
connected to up to n 1 other vertices. If a vertex connected to all others, its degree
would be n 1, so that’s the max. Therefore the degree possibilities are:
0 1 2 3 ... n 2 n 1
This is beginning to look like a pigeonhole principle problem, where the “objects” are
the vertices, the “boxes” are the possible degrees, and you place a vertex into the box
corresponding to its degree. But there are n vertices and n boxes! The pigeonhole
principle can not be applied in such a scenario. If there weren’t a Box 0 we would
be in business, but there is. . . And we certainly can’t ignore that box, since we have
already seen examples where it is needed. Take a moment and see if you can figure
out how to get out of this pickle. And if you need a hint, check out the footnote33
before reading the proof.
33
Hint: Imagine you placed each vertex into its corresponding box. Is it possible that both of
these outer boxes have a vertex in them?
0 1 2 3 ... n 2 n 1
" "
24 Chapter 1. Intuitive Proofs
Proof . Let G be a graph with n vertices. Since each vertex may be connected to as
few as zero other vertices, or as many as all n 1 other vertices, the possible degrees
of a vertex are 0, 1, 2, . . . , (n 1). Next, note that G either has a lone vertex or it
does not. Consider these two cases separately.34
Case 1: G does not have a lone vertex. Since G does not have a lone vertex, every
vertex has degree at least 1. Therefore, there are n vertices and n 1 possible vertex
degrees:
1 2 3 ... n 2 n 1
Since we have n vertices being placed into n 1 boxes, by the simple form of the
pigeonhole principle (Principle 1.5) two vertices must be placed into the same box,
which means they have the same degree.
Case 2: G has a lone vertex. Let v0 be a lone vertex in G. Then, v0 has degree
zero. Moreover, if v1 is any other vertex in G, we know that v1 is not connected to v0 ,
implying that v1 has only n 2 other vertices which it may be connected to. That is,
the maximum possible degree of v1 is n 2. Since v1 was arbitrary, the maximum
possible degree of any vertex in G is n 2. Therefore, there are n vertices and n 1
possible vertex degrees:
0 1 2 ... n 3 n 2
Since we have n vertices being placed into n 1 boxes, by the simple form of the
pigeonhole principle (Principle 1.5) two vertices must be placed into the same box,
which means they have the same degree.
In both of the two possible cases we proved that G has two vertices of the same
degree. Therefore this is true in general, establishing the result.
The final example is a personal favorite. And while it could be phrased slightly
more rigorously using spheres and circles. . . I believe it is best phrased in terms of
fruit.
Proposition.
Proposition 1.13. If you draw five points on the surface of an orange in marker,
then there is always a way to cut the orange in half so that four points (or some
part of the point) all lie on one of the halves.
34
We will discuss proof by cases much more in Chapter 2.
Proofs: A Long-Form Mathematics Textbook 25
Proof Sketch. This should be surprising! When you cut an orange in half, you in
essence create two boxes for these five points; but shouldn’t the pigeonhole principle
only guarantee us 3 points on each half? How the heck do we get four points on one
half?!
There are two subtle parts of the statement. First, it asserts that “there is always
a way to cut the orange in half so that. . . .” It doesn’t assert that any such cut has
this property; just that among all of the infinitely many angles your knife can take,
at least one has this property.
Second, it is important that we say “or some part of the point.” Here is how we
will use that to our advantage: When you use a marker to make the points, the points
are big enough that when you slice through any point, part of the point appears on
both halves.
Perhaps this gives you some ideas. But, I confess, this is a sneaky problem because
its solution also relies on a theorem that I haven’t told you. It is in fact a classic
theorem from geometry. It deals with so-called great circles. Given a sphere, there
are infinitely many ways to cut it in half, and each of these paths of the knife is called
a great circle (like earth’s equator or any of earth’s lines of longitude). Below are
three examples, followed by the classic theorem from geometry.
Classic Geometry Theorem. Given any two points on the sphere, there is a great
circle that passes through those two points. For example:
•
! •
• •
Ok, now you have all the tools and caveats you need to prove this result. See if
you can piece it together before reading the solution.
Proof . Consider an orange with five points drawn on it. Pick any two of these
points, and call them p and q. By the Classic Geometry Theorem, there exists a
great circle passing through these points; angle your knife to cut along this great
circle. Because the points are drawn in marker, they are wide enough so that part of
these two points appear on both halves.
26 Chapter 1. Intuitive Proofs
Now consider the remaining three points and the two halves that you just cut the
orange into. Consider these three points to be objects and the halves to be boxes; by
the simple form of the pigeonhole principle (Principle 1.5), at least two of these three
points are on the same orange half. These two, as well a portion of p and of q, give
four points or partial points, as desired.35
35
If you feel slightly cheated by the fact that two points are in both halves, I will point out that
in practice this is rarely needed. Here’s how: (1) Pick any two points, and call them p and q; (2)
Angle your knife so that you would cut through them and the orange in half; (3) Identify which side
contains two of the remaining three points; (4) Shift and re-angle your knife just slightly so that
you get all of p and q on the same half as these other two, giving a half with four complete dots. It
is rare that doing this will cause you to lose the other two points, but if so just pick another two
points and try again. Unless all the points lie on a single great circle, you will soon find the angle
giving four complete points.
Proofs: A Long-Form Mathematics Textbook 27
— Chapter 1 Pro-Tips —
Next up are some “Pro-Tips,” with which I will end each chapter. These are short
thoughts on things I wish I had known when I took my intro-to-proofs class. They
are quite varied, and include finer comments on the material, study tips, historical
notes, comments on mathematical culture, and more. I hope you find them beneficial.
• To master mathematical content, one must struggle with it. In order to not just
learn the material but deeply understand it, you need to test it against your
own knowledge and intuition. It can’t be a passive enterprise; mathematics is
a contact sport. There is a fantastic metaphor for this, developed by Abigail
Higgins, to explain the laborious-yet-exciting work to construct your mental
conception of mathematics.
Think about math as a giant, beautiful castle. No teacher can download
this castle into your brain. We use definitions and theorems and proofs and
examples and non-examples and conjectures to introduce you to a new room or
alcove of the castle, or to help you make connections between different wings.
But in the end, you must build your own mental castle.
It takes effort, but I can assure you there is no greater satisfaction than
standing back after completing a new course, reading a new research paper,
completing a new project, or reflecting on a conversation, and realizing that
there is a connection between two ballrooms you hadn’t discovered before, or
that a room had some amazing artwork in it that you had never noticed. These
are the mental rewards when you’re willing to fight through a mathematical
difficulty rather than just looking up how the book does it. Furthermore, no
advancement in mathematics research has been won without a personal struggle
in which mistakes were made and small steps were taken. To be the first
to discover a new feature of the castle is reward reserved only for tenacious
learners.
These soft skills are not instilled easily. You must practice fighting through
difficulties in order to become good at fighting through difficulties. You must
practice solving a lot of problems to become good at solving a lot of problems.
I encourage you to carry this attitude forward with you as you enter into the
heart of the mathematics castle.
• It is strongly advised that you form a study group to practice and discuss
the material with others. The best math is done collaboratively, and the best
learning occurs from discussions with your peers. Also, I find that math is most
fun in collaboration.36
Also, remember that while math is intrinsic, proofs are human. Math is a
search for objective truths, while proofs are the search for subjective agreement.
The goal of a proof is to communicates your ideas and convince others that you
are correct, and so it is important to discuss your ideas and share your thoughts
36
The same can be said about discovering a castle’s secrets, by the way. Just ask Fred and George
Weasley.
28 Chapter 1. Intuitive Proofs
with others. So talk things out with your study group and read over each others’
work. This is the field research of proof writing, and it is important.
• When writing out their homework solutions, students are far more likely to
write too little than they are to write too much. As the author of long-form
textbooks, it may not be surprising that I am against terse proofs and homework
solutions, but I can assure you that this is not a personal quirk — a survey of
my colleagues agrees that more is better, especially for a class like this.
It is like that episode of The Office where Kevin tries to talk as simply as
possible. He justified this saying “Me think, why waste time say lot word when
few word do trick.” But it just causes mass confusion and wastes time. Don’t
be like Kevin. Say a little more to make sure your ideas are clear, and the
readers of your proofs will thank you.
• When you start taking upper-division math classes, how you approach the
material will make a big difference in how you do. Research suggests the
importance of active learning, deliberate practice, metacognition, and having a
growth mindset. These are more than just buzzwords, and I encourage you to
check out thee followhat was to be shownwing short articles and videos. And if
you plan to teach math at any level some day, they will be particularly helpful.
Each is available on Google Scholar or YouTube.
• We did not prove pigeonhole principle. It was also not called a lemma, proposi-
tion, theorem or corollary, which we said do require proofs. Is there a proof of
the pigeonhole principle? The answer is yes, and you are welcome to search
the Internet for them — you will quickly find several. The problem is that it is
such a basic idea that the proofs often rely on something that seems even less
obvious than the principle itself, or they are written in terms that will likely be
very confusing to you at the moment.
thousand years, and is still used occasionally today. You could also adopt your
own phrase, if you wish. A few suggestions: “Bada bing bada boom!” or “Oh
happy day!” or “Do you believe me now?!” or, for 90s music fans, “Proof, there
it is!”
30 Chapter 1. Intuitive Proofs
— Exercises —
Exercise 1.1. List 5 skills that are important for someone to be successful in a
college math class.
x2 = xy
x2 y 2 = xy y2
(x + y)(x y) = y(x y)
x+y =y
2y = y
2 = 1.
Exercise 1.6. If I remove four squares — two black, two white — from an 8 ⇥ 8
chessboard, must the result have a perfect cover?
! If you believe a perfect cover must exist, justify why.
! If you believe a perfect cover does not need to exist, give an example of four
squares that you could remove for which the result does not have a perfect
cover.
Exercise 1.7. The game Tetris is played with five different shapes — the five
shapes that can be obtained by piecing together four unit squares:
Proofs: A Long-Form Mathematics Textbook 31
In the below we also allow these pieces to be “flipped over.” For example, and
are both allowed,
Exercise 1.8. Prove that if one chooses n + 1 numbers from {1, 2, 3, . . . , 2n, it is
guaranteed that two of the numbers they chose are consecutive.
Exercise 1.9. Explain in your own words what the general pigeonhole principle
says.
Exercise 1.10. Assume that n is a positive integer. Prove that if one selects any
n + 1 numbers from the set {1, 2, 3, . . . , 2n}, then two of the selected numbers will
sum to 2n + 1.
Exercise 1.11. Prove that there are at least two U.S. residents that have the
same weight when rounded to the nearest millionth of a pound. Hint: Do a Google
search for how many U.S. residents weigh over 300 pounds.37
Exercise 1.13. Prove that at least 2 Sac State undergrads have the exact same
height, weight and gender (when we round height to the nearest inch, weight to the
nearest pound). You may make reasonable assumptions like “95% of CSUS undergrads
are between 4 feet and 7 feet tall” or “95% of CSUS undergrads identify as male or
female.”
Exercise 1.14. Find your own real-world example of the pigeonhole principle.
Exercise 1.15. Prove that if one chooses 31 numbers from the set {1, 2, 3, . . . , 60},
that two of the numbers must be relatively prime.
Exercise 1.16. Assume that n is a positive integer. Prove that if one chooses any
n + 1 distinct odd integers from {1, 2, 3, . . . , 3n}, then at least one of these numbers
will divide another.
Exercise 1.17. Prove that if one chooses any 19 points from the interior of a
6 ⇥ 4 rectangle, then there must exist four of these points which form a quadrilateral
of area at most 4.
Note: a quadrilateral is a four-sided shape, and any four points form a quadrilateral.
Exercise 1.18. Assume that 9 points are chosen from the right triangle below
and that no three of them form a straight line. Prove that there exist three of these
points which form a triangle whose area is less than 1/2.
Note: the condition that no three form a straight line is simply to guarantee that
any three of them can form a triangle.
Exercise 1.20. Imagine a friend gives you a deck of cards and lets you shuffle it a
few times. They then ask you to deal out the top 26 cards face down, which divides
the deck into two. You keep one half and they take the other. They ask you to count
how many red cards you have. In the meantime, you notice that they are silently
looking through their own half of the deck. But whatever they are doing they did it
as quickly as you, because once you’re done they declare that they know how many
red cards you counted, and correctly announce the answer! How did they do it?
Exercise 1.21.
(a) Determine the population of your hometown and how many non-balding people
in your hometown, if any, are guaranteed to have the same number of hairs on
their head according to the pigeonhole principle.
(b) Determine, as best you can, the number of students who attended your high
school while you were a senior. Then determine how many of them, if any, are
guaranteed to have the same birthday according to the pigeonhole principle.
Exercise 1.22. Give an example of 100 numbers from {1, 2, 3, . . . , 200} where not
one of your numbers divides another. This proves that Proposition 1.11 is optimal.
Exercise 1.23. Suppose you deal a pile of cards, face down, from a shuffled deck
of cards (this is a standard 52-card deck, where each card is one of 4 suits and one of
13 ranks). How many must you deal out until you are guaranteed. . .
5. two of one rank and three of another? That is, a full house.
Exercise 1.24. Prove that any set of seven integers contains a pair whose sum or
difference is divisible by 10.
Exercise 1.25. Read the Introduction to Ramsey theory following this chapter.
Then, let r(n, m) be the smallest value N for which every red/blue coloring of KN
contains either a red Kn or a blue Km . Prove that r(n, 2) = n.
Exercise 1.26. Determine the U.S. population at the time that you are reading
this.
(a) Does the pigeonhole principle guarantee that 1 million U.S. residents all have
the same birthday?
34 Chapter 1. Intuitive Proofs
(b) If the principle does not guarantee this, how many people are needed for until
that milestone is reached? If the USA grows by 2 million people per year, in
what year will this occur?
Exercise 1.27. An alien creature has three legs, and on each of his three alien
feet he wears an alien sock. Suppose he just washed n triplets of alien socks (3n
individuals), and each triplet is a different color. If this alien pulls his alien socks
out of his alien dryer one-at-a-time, how many must he pull out to be guaranteed to
have a matching triplet?
Exercise 1.28. A magic square is an n ⇥ n matrix where the sum of the entries
in each row, column and diagonal equal the same value. For example,
8 1 6
3 5 7
4 9 2
is a 3 ⇥ 3 matrix whose three rows, three columns, and two diagonals each sum
to 15. Thus, this is a magic square.
An antimagic square is an n ⇥ n matrix where each row, column and diagonal
sums to a distinct value. For example,
9 4 5
10 3 -2
6 9 7
is a 3 ⇥ 3 matrix whose rows sum to 18, 11 and 22, columns sum to 25, 16 and 10,
and diagonals sum to 19 and 14. Notice that all eight of these numbers is different
that the rest, showing that this is an antimagic square.
Prove that, for every n, there does not exist an n ⇥ n antimagic square where
each entry is 1, 0 or 1.
Chapter 2: Direct Proofs
If your professor asked you to prove that “every perfect number is even,” then you
would probably ask them what the heck a perfect number is. Definitions are really
important in math — they give us precision. They are also subjective, human choices.
The math is deep and intrinsic; definitions are our inventions to make it easier to
discuss the math.
Deciding on a definition can be difficult, too. It can be a challenge to precisely
write down what something is, and do so in a way that excludes the things that it is
not, in such a way that makes it easy to work with and apply. As a fun example of
this difficulty, imagine that you were writing a dictionary and were trying to define a
sandwich. Right now, try to come up your own definition of a sandwich.
Got one? Good. Does your definition require bread? Meat? Cheese? Vegetables?
Do you count these things? Does it attempt to classify them abstractly? If you
demand meat between bread, you rule out vegetarian sandwiches and grilled cheese,
while counting hot dogs. Are you ok with that? And what counts as “bread” anyways?
Any carb? Is a quesadilla a sandwich? You would have to carefully define that term
if you plan on using it.
Must the bread be on top and bottom? Do you want to include open-faced
sandwiches? Probably some, but probably not pizza or an “open-faced PB&J,” let
alone some buttered toast? Leniency with your bread is important, but if you are
too lenient you may accidentally include burritos or veggie wraps. And if you don’t
want those (but maybe you do?), then demanding two slices of bread would exclude
a submarine sandwich. You might say a sub is ok because it leaves one side open,
but so does a taco and a bread bowl of clam chowder.
A club sandwich is definitely a sandwich, but it includes bread in the middle.
But if that is ok, what about a Big Mac or a slice of lasagna? What about a
mushroom burger? Can a sandwich be sweet? Which definition would allow this
without including a poptart? Is a cookie an open-faced sandwich? As you can tell, it
is sometimes tough to get a definition right.1
Indeed, when considering the statement “every perfect number is even,” it is
important that you know the definition of a perfect number; in fact, it would also
be a good idea to ask for the precise definition of an even number. You intuitively
know that 2, 4, 6, 8, . . . are the (positive) even numbers, but there are potentially
multiple ways to define such a number, and we should all be on the same page as to
1
Search the hashtag #HoagieHomies on Twitter. You. . . may be surprised.
35
36 Chapter 2. Direct Proofs
which definition we are working with. In Chapter 1 we were more relaxed because we
wanted to jump into making mathematical arguments, but from here on out we will
be precise and deliberate. Indeed, in a moment we will define even and odd numbers.
But first, recall that the set of integers are {. . . , 3, 2, 1, 0, 1, 2, 3, . . . } and the
following basic fact.2
Fact.
Fact 2.1. The sum of integers is an integer, the difference of integers is an integer,
and the product of integers is an integer. Also, every integer is either even or
odd.
We are calling these facts because, while they are true and one could prove them,
we will not be proving them here. That would go beyond the scope of this text. We
will use these facts and you are allowed to use them too.
Definition.
Definition 2.2.
Example 2.3.
Proposition.
Proof Idea. First, make sure it is clear to you what we are assuming and what you
are trying to prove. The above is equivalent to saying
“If two integers are both even, then their sum is also even.”
Or:
“If n and m are even integers, then n + m is an even integer.”
The proposition doesn’t use the “if. . . , then. . . ” format, and doesn’t use variable
names to refer to the numbers, but these are all equivalent. Indeed, the third
statement, in which the numbers are named using variables, n and m, is going to be
useful for the proof; the proof will begin by doing just that.
As for the mechanics of the proof, the big picture is this:
That is, we use the definition of even integers to translate the problem to one that
is just about integers, then we solve the integer problem (that’s the middle “to be
determined” step), then we translate what we found back to a conclusion about
even integers. The algebra will need to be worked out in our proof, but that is the
overview. Ok, let’s prove it.
4
“No one is above the law! ” . . . (Also, no seven is above the law. And no zero or ⇡ either. No
number is above the law, is what I think that quote is getting at.
5
This means “to be determined.”
38 Chapter 2. Direct Proofs
Proof . Assume that n and m are even integers. By Definition 2.2, this means that
n = 2a and m = 2b, for some integers a and b. Then,
n + m = 2a + 2b = 2(a + b).
And since, by Fact 2.1, a + b is an integer too, we have shown that n + m = 2k,
where k = a + b is an integer. Therefore, by Definition 2.2, this means that n + m is
even.
Proposition.
Proof Idea. As with Proposition 2.4, this proposition is not phrased in the “if. . . ,
then. . . ” form, but it is equivalent to saying “If n and m are odd integers, then n + m
is an even integer.” The overview of this proof is very similar to the last one:
Let’s do it!
Proof . Assume that n and m are odd integers. By Definition 2.2, this means that
n = 2a + 1 and m = 2b + 1, for some integers a and b. Then,
And since, by Fact 2.1, a + b + 1 is an integer too, we have shown that n + m = 2k,
where k = a + b + 1 is an integer. Therefore, by Definition 2.2, this means that n + m
is even.
Proposition.
Proof Idea. This proof will be similar to the last two, and so this is an especially
good proposition to try to prove on your own before reading on.
Proof . Assume that n is an odd integer. By Definition 2.2, this means that n = 2a+1
for some integer a. Then,
You’ll notice that — perhaps with a little rewriting, like with Propositions 2.4 and
2.5 — most of our results in this chapter take on this standard form:
Since so many of our results can be broken down like this, mathematicians have given
the word “implies” a special symbol: “=)”. Therefore, the shorthand for the above is
this:
And so, a general statement is of the form “P =) Q,” where P and Q are each
statements.9
Symbols like this are commonly used in scratch work when you’re still figuring
out how to prove your homework problems, or when you are writing up solutions
on an exam and are crunched for time. This is a good thing — proofs are usually
obtained only after a lot of scratch work, and writing stuff down is a good way to
generate ideas. However, when writing formally, like when writing up the final draft
of your homework, these symbols are rarely used. You should write out solutions with
words, complete sentences, and proper grammar. Pick up any of your math textbooks,
or look online at math research articles, and you will find that such practices are
standard.
The proofs we did on evenness/oddness are called direct proofs. A direct proof is
a way to prove a “P ) Q” proposition by starting with P and working your way to
Q. The “working your way to Q” stage often involves applying definitions, previous
results, algebra, logic and techniques. Later on we will learn other proof methods.
Here is the general structure of a direct proof:
Proposition. P ) Q.
Proof. Assume P .
Apply definitions
« An explanation of what P means » and/or other results.
apply algebra,
logic, techniques
Take a look at the proofs of Propositions 2.4, 2.5 and 2.6 and see if you can
identify this general structure in each one.
9
We will discuss all this in much finer detail in Chapter 5.
Proofs: A Long-Form Mathematics Textbook 41
Proposition.
Proof Idea. At this point, if I asked you to prove “if n is even, then n2 + n + 6 is
even” or if I asked you to prove “if n is odd, then n2 + n + 6 is even,” then you would
know what to do: You would prove it directly, just like what we did in Propositions
2.4, 2.5 and 2.6.
For example, to show that “if n is odd, then n2 + n + 6 is even” you would write n
as 2a + 1 and you’d plug it in: This would turn n2 + n + 6 into (2a + 1)2 + (2a + 1) + 6.
Finally, you would do some algebra to try to write this as 2k for some integer k. If
you can do this, then you have successfully proved that if n is odd, then n2 + n + 6
is even.
In this problem you’re asked to prove that every integer has this property. Do
you see what to do? . . . Since every integer is either even or odd, if we prove the
proposition for even n, and we prove the proposition for odd n, then combined we
have proven it for all integers! This is what a proof by cases is all about.
n2 + n + 6 = (2a)2 + (2a) + 6
= 4a2 + 2a + 6
= 2(2a2 + a + 3).
Here are four examples of cases that you might see in the future:
1
X
Case 1: ak converges Case 1: n ⌘ 0 (mod 3)
k=1
1 Case 2: n ⌘ 1 (mod 3)
X
Case 2: ak diverges Case 3: n ⌘ 2 (mod 3)
k=1
A proof by cases cuts up the possibilities into more manageable chunks. If the
theorem refers to a collection of elements and your proof is simply checking each
element individually, then it is called a proof by exhaustion or a brute force proof.
2.3 Divisibility
In this section we will use direct proofs to prove some propositions about divisibility.
To begin, we must define what it means to say that one integer divides another.
But first, what should the definition be? We say that “2 divides 8” because 82 = 4,
and 4 is an integer. Likewise, we say “3 divides 18” because 18 3 = 6, and 6 is an
integer. On the other hand, we say “4 does not divide 10” because 10 4 = 2.5, and 2.5
is not an integer.
10
Likewise, if I showed you the equation 4n2 + 7 and you said to yourself, “huh, that’s an odd
equation,” then you’d be exactly right! For any integer n, 4n2 + 7 is odd. And the proof is by cases,
similar to that of Proposition 2.7. If n = 2a for an integer a, then 4n2 + 7 = 16a2 + 7 = 2(8a2 + 3) + 1,
which is odd. And if n = 2a + 1, then 4n2 + 7 = 16a2 + 16a + 15 = 2(8a2 + 8a + 7) + 1, which is
again odd. See if you can fill in the details.
Proofs: A Long-Form Mathematics Textbook 43
“a divides b” if b
a is an integer.
That’s a perfectly good definition, but it will be easier to apply the definition if
it includes what the integer actually is (as you will see in the proof of our next
proposition). So another option would be
“a divides b” if b
a = k where k is an integer.
But, as it turns out, we can do even better.11 By multiplying over the ‘a’ we obtain
Although the definitions are all the same, this is the one that will be the easiest to
work with. And although this may have seemed like a boring, pointless discussion,
there is something significant underlying it: Definitions do not fall out of the sky, they
are carefully chosen by mathematicians to do the work we seek. This will become an
important theme as we move forward.
Definition.
Example 2.9.
• The a = 0 case: 0 - b for any non-zero integer b, because for any such b, we have
b 6= 0 · k for any integer k.
Note: A common mistake is to see something like “2 | 8” and think that this
equals 4. The expression “a | b” is either true or false, it never equals a number; 2 | 8
is true, while 3 | 8 is false. This mistake is understandable because 2 | 8 looks a lot
like 2/8 or 8/2, and while these are all related, they are also all different.
Armed with Definition 2.8, let’s use a direct proof to prove our first result on
divisibility — the transitive property of divisibility.
11
And odd better.
44 Chapter 2. Direct Proofs
Proposition.
a | b and b | c =) a | c ?
3 | 12 and 12 | 24 =) 3 | 24 X
• On your own, do another example. And when you do so, remember that this
proposition is only referring to a, b and c for which a | b and b | c. So if a = 3
and b = 4, then we already know a - c and so the proposition does not apply.
But if a | b and b | c, then the proposition guarantees that a | c.
Proof. Assume P .
Apply definitions
« An explanation of what P means » and/or other results.
apply algebra,
logic, techniques
Therefore a | c.
There’s just a little work to go to bridge the gap, but it turns out that some
algebra does the trick. Now, finally, here’s the formal proof.
Proof . Assume that a, b and c are integers, a | b and b | c. Then by the definition
of divisibility (Definition 2.8), b = as for some integer s, and c = bt for some integer
t. Thus,
c = bt
= (as)t
= a(st).
We have shown that c = a(st), and since s and t are integers, so is st by Fact 2.1.
So it is indeed true that c = ak for the integer k = st, which by the definition of
divisibility (Definition 2.8) means a | c.
7 = 3 · 2 + 1.
In the above, the ‘2’ is called the quotient and the ‘1’ is called the remainder.
In fact, any two integers can be written in such a way. This is called the division
algorithm 13 and is important enough to be granted the stature of 14 . . . our first
theorem!
13
The fact that this theorem is called an algorithm is a misnomer. It got this name because
there is a related algorithm. Kind of like how koala bears aren’t actually bears, strawberries aren’t
actually berries but an avocado actually is, and this is called a footnote but is really just an excuse
for me to say that a banana is a berry but a raspberry is not and the world needs to know!
14
. . . Drum roll please. . .
46 Chapter 2. Direct Proofs
Theorem.
Theorem 2.11 (The division algorithm). For all integers a and m with m > 0,
there exist unique integers q and r such that
a = mq + r
where 0 r < m.
Note that if m = 2, then the two options are a = 2q + 0 and a = 2q + 1; these are
the definitions of even and odd numbers! And if r = 0, then this produces a = mq,
which is the divisibility definition (in this case, for a | m)! Here are a few more
examples of expressing numbers in the form of the division algorithm:
• If a = 18 and m = 7, then 18 = 7 · 2 + 4.
• If a = 13 and m = 3, then 13 = 3 · 4 + 1.
• If a = 3 and m = 13, then 3 = 13 · 0 + 3.
• If a = 35 and m = 5, then 35 = 5 · 7 + 0.
We will prove the division algorithm in the Bonus Examples section of Chapter 7.
Definition.
First observe that since 1 | a and 1 | b, the greatest common divisor always exists
and is always at least 1. Below are some examples.
Note that there is one pair of integers that does not have a greatest common divisor;
if a = 0 and b = 0, then every positive integer d is a common divisor of a and b. This
means that no divisor is the greatest divisor, since you can always find a bigger one.
Thus, in this one case, gcd(a, b) does not exist.
Next up is a pretty neat theorem about greatest common divisors, which has a
challenging but interesting proof.
Proofs: A Long-Form Mathematics Textbook 47
Theorem.
Theorem 2.13 (Bézout’s identity). If a and b are positive integers, then there
exist integers k and ` such that
gcd(a, b) = ak + b`.
Scratch Work. To make sure we understand this, let’s jot down an example. Maybe
a = 12 and b = 20, making gcd(12, 20) = 4. The claim is that there are integers k
and ` such that
gcd(12, 20) = 12k + 20`.
Indeed, gcd(12, 20) = 4, and by testing a few numbers one can find that
4 = (12)( 3) + (20)(2).
Indeed, there are (infinitely) many solutions! Nevertheless, this theorem simply says
that at least one solution must exist. Pretty cool! But how do we prove it? This will
be our general structure:
2. As it turns out, there is a clever way to choose the correct k and `. But once
we pick the correct k and `, we still have to prove that they work. Once we
choose them, the sum ak + b` will be equal to something (we will call this sum
d; that is, d = ak + b`), and then the goal turns to proving that d is what want:
We need to show d = gcd(a, b).
3. To show that d is in fact gcd(a, b), we will use the definition of the greatest
common divisor. Once we accomplish this, then d = ak + b` from the previous
step will turn into gcd(a, b) = ak + b`, completing the proof.
As you will see, step three will be the most difficult step. It will be solved in two
parts:
Part 2. Prove that d is the greater than any other common divisor of a and b.
48 Chapter 2. Direct Proofs
Proof . Assume that a and b are fixed positive integers. Notice that, for integers
x and y, the expression ax + by can take many different values, including positive
values, negative values and (if x = y = 0) can even be zero. Let d be the smallest
positive value that ax + by can equal.15 We now let k and ` be the x and y values
that give this minimum value of d. That is, for these integers k and `,
d = ak + b`. (K)
Later in this proof, Our goal in this proof is to find some k and ` such that gcd(a, b) = ak + b`. As
I will refer to it turns out, d = ak + b` is the exact equation we are looking for — we just need to
this equation by prove that d = gcd(a, b). We defined d to be the smallest positive value that ax + by
writing “(by K).” 16 can take; to prove that this same d is the gcd(a, b), we must prove that d is a common
divisor of a and b, and then that it is the greatest common divisor. We will prove
these two parts separately.
a = dq + r
r=a dq
=a (ak + b`)q (by K)
=a akq b`q
= a(1 kq) + b( `q).
And since (1 kq) and ( `q) are both integers by Fact 2.1, we have found another
expression of the form ax + by. But remember, d was chosen to be the smallest
positive number that can be written like this. So, since r can be written like this too,
and 0 r < d (and remember, 0 is not considered positive), it must be that r = 0.
This is what we wanted to show, since r = 0 means that a = dq + r is simply
a = dq, which by the definition of divisibility (Definition 2.8) means that d | a, as
desired.
In the same exact way, one can also show that d | b. Collectively, these prove that
d is a common divisor of a and b.
15
That is, if there exists x and y such that ax + by = 1, then d = 1. But if no such x and y exist,
but there exist x and y such that ax + by = 2, then d = 2. And so on. For example, if a = 4 and
b = 10, then d = 2 because there are no x and y for which ax + by = 1 (try to convince yourself of
this by thinking about even integers), but 4 · ( 2) + 10 · 1 = 2 does work, showing that d = 2 is the
smallest positive value.
16
Most books use a small star each time, but just for fun I will use a variety of little symbols, like
this little cup of coffee.
Proofs: A Long-Form Mathematics Textbook 49
Part 2: d is the greatest common divisor of a and b. Suppose that d0 is some other
common divisor of a and b. In order to conclude that d is the greatest among all
common divisors, we must show that d0 d. To do this, observe that since d0 is a
common divisor, d0 | a and d0 | b, which by the definition of divisibility (Definition
2.8) means that
a = d0 m and b = d0 n,
for some integers m and n. Then,
d = ak + b`
= d0 mk + d0 n`
= d0 (mk + n`).
We have shown that d = d0 (mk + n`) where (mk + n`) is an integer (by Fact 2.1).
With d being positive and d0 = mk+n`d
where the denominator is an integer, this
implies d d. We have shown that d is larger than any other divisor of a and b,
0
That was a tough one! Spending most of our time on shorter proofs makes sense,
as those are the ones which allow us to focus on the proof mechanics without getting
too distracted by complicated ideas. However, it is also beneficial to go over some
complicated ones, to see where you are headed.
A proof like this seems difficult now, and it is perfectly fine if you did not un-
derstand it completely, but once you have a few proof-based classes under your belt
proofs like this will seem much more manageable. Throughout this book I will throw
in some challenging proof from time to time for this very purpose — including another
one before the end of this chapter.
Definition.
Repeating the division algorithm examples from page 46, plus two extras:
• 18 = 7 · 2 + 4 • 3 = 13 · 0 + 3 • 3 = 5 · ( 1) + 2
• 13 = 3 · 4 + 1 • 35 = 5 · 7 + 0 • 15 = 2 · ( 8) + 1
Or, we can see that those six mod examples are true by using Definition 2.14:
• 7 | (18 4) X • 13 | (3 3) X • 5|( 3 2) X
• 3 | (13 1) X • 5 | (35 0) X • 2 | ( 15 1) X
One way to think about modulo congruence is with boxes. Let’s think about a
specific case: the integers modulo 6. Suppose you have a box with balls in it, and you
are allowed to remove 6 at a time. If you start with 14 balls, then you can remove
six to give you 8, and six again to give you 2. You can no longer remove six at a
time, thus we are done. The 14 balls turned into 2, thus 14 ⌘ 2 (mod 6). A number,
modulo 6, is congruent to whatever the remainder is after removing 6 at a time until
you can’t remove any more.
Moreover, m ⌘ n (mod 6) if a box with m things in it, and a box with n things in
it, will end up with the same number after removing 6 balls at a time. And the same
applies for other mods. For example, 9 ⌘ 13 (mod 4), because a box with 9 balls in
it, after removing four at a time, will leave you with 1. And a box with 13 balls in
it, after removing four at a time, will also leave you with 1. Because they leave you
with the same number when removing 4 at a time, they are congruent modulo 4.
! !
! ! !
And if you can accept that a box can have a negative number of balls, and if you
can ask questions like “what time was it five hours ago?”, then these metaphors also
show why, say, 2 ⌘ 3 (mod 5).
18
Unless you’re taking this class in West Point, Annapolis, or in most countries outside of North
America.
52 Chapter 2. Direct Proofs
These metaphors deal with adding numbers under a mod, and modular congruence
does indeed have some nice arithmetic properties. Here are the first three:
Proposition.
Scratch Work. A quick reminder: I recommend not being a passive learner, but an
active one. Try to prove (i) on your own before moving on. I know, it would be so
much easier to just read on. It’s like exercising — the fact that it’s strenuous is how
you know it’s working. Challenge yourself! Be a mathlete, not a mathemachicken!
Good job! As for my scratch work, let’s begin by seeing how far our general
strategy for direct proofs gets us for part (i).
What does each modular congruence mean? Definition 2.14 tells us!
Proofs: A Long-Form Mathematics Textbook 53
How do we bridge the gap? Well, what does it mean to say one integer divides
another? Definition 2.8 tells us!
apply algebra,
logic, techniques
And with that, I think we can bridge the gap. Now here’s the proof.
Proof . Part (i). Assume that a ⌘ b (mod m) and c ⌘ d (mod m). By the definition
of modular congruence (Definition 2.14),
m | (a b) and m | (c d).
a b = mk and c d = m`
(a b) + (c d) = mk + m`.
54 Chapter 2. Direct Proofs
Regrouping,
(a + c) (b + d) = m(k + `).
which then by the definition of modular congruence (Definition 2.14) means that
a + c ⌘ b + d (mod m),
Parts (ii) and (iii). These are left to you as exercises. For part (iii) you may use
the fact that if a ⌘ b (mod m), then a and b have the same remainder when divided
by m.
Modular arithmetic has nice properties for addition, subtraction and multiplication.
What about division? Well, not always. Try to think of an example on your own where
ak ⌘ bk (mod m), but a 6⌘ b (mod m). Really, try it on your own! . . . . . . . . . Now, if
you found one, there’s a good chance that it is an example where k ⌘ 0 (mod m); this
is similar to saying “2 · 0 = 3 · 0, even though 2 6= 3.” So here’s your next challenge:
Can you think of an example where k 6⌘ 0 (mod m)? Give it a shot on your own!
Then, once you have, you can check out one answer in the footnote.19
See if you can convince yourself that if k and m have a common divisor larger
than 1, then it is not necessarily true. And then see if you can convince yourself that
if gcd(k, m) = 1, then the cancellation property will hold. As an example of this
latter claim, note that 21 ⌘ 6 (mod 5), which means that 7 · 3 ⌘ 2 · 3 (mod 5). And
since gcd(3, 5) = 1, the cancellation property says that we can cancel the 3. And this
does check out: 7 ⌘ 2 (mod 5).
This is indeed the next proposition. The proof of this proposition will make us of
a lemma (our first lemma!). And this lemma requires that we know what a prime
number is. So let’s formally define a prime number, then state and prove the lemma,
and then use that to prove the proposition.
Definition.
Definition 2.16. An integer p 2 is prime if its only positive divisors are 1 and
p. An integer n 2 is composite if it is not prime. Equivalently, n is composite
if it can be written as n = st, where s and t are integers and 1 < s, t < n.
(To be clear, “1 < s, t < n” means that both s and t are between 1 and n. It
means 1 < s < n and 1 < t < n both hold.)
19 Notice that 20 ⌘ 8 (mod 6), but yet when dividing both by 4, we get 5 6⌘ 2 (mod 6).
Proofs: A Long-Form Mathematics Textbook 55
Lemma.
Proof Idea for (i). Here is the main idea for part (i). The divisors of p are p, p,
1, and 1. Therefore, these four numbers are the only possible common divisors
between p and a. The question is: Which of these also divides a? And among the
ones which do (i.e., the common divisors), which is the largest? Let’s investigate,
keeping in mind that the lemma assumed that p - a.
p 1 1 p
is not a is a is a is not a
common common common common
divisor divisor divisor divisor
with a with a with a with a
Among the two which are common divisors, we can see that 1 is the greatest.
Proof Idea for (ii). In this part we need a tool. A tool that connects integers to
their gcd. . . and Bézout’s identity (plus a little algebra) will do just that!
Proof Idea for (iii). Part (iii) turns out to be just a mixture of parts (i) and (ii).
So once those two are proven, we will be able to unite their powers to give us (iii).
20
We do not consider 1 to be prime, and we do not consider negative numbers like 7 to be prime.
Definitions are human choices, and mathematicians decided that having those be considered prime
would be detrimental. Here’s one reason: One of the most fundamental properties of an integer
n 2 is that it can be written uniquely as a product of primes; for example, 12 = 2 · 2 · 3. But if 1
and negative numbers could be prime, then also 12 = 1 · 2 · 2 · 3 and 12 = ( 2) · 2 · ( 3) would be
ways to write 12 as a product of primes. We exclude 1 and negative numbers for many reasons, but
keeping this unique factorization is one such reason.
21
Note: In math, ‘or’ is always an inclusive or, as compared to an exclusive or. An ‘inclusive
or’ allows the possibility that both are true, while an ‘exclusive or’ demands that only one is true.
Notice that Lemma 2.17 part (iii) would be false if math used an ‘exclusive or’. For example, if
p = 5, a = 10 and b = 15, then p | ab, but it’s not true that p only divides one of the two — it divides
both!
56 Chapter 2. Direct Proofs
Proof of (i). Assume that p does not divide a. To be a common divisor of a and
p means that you must divide both of them, but since we are assuming that p does
not divide a, this also means that p is not a common divisor of a and p. And since p
is not a common divisor of a and p, it is certainly not the greatest common divisor of
a and p.
Since p is prime, the two largest divisors of p are 1 and p — and we just showed
that p is not the gcd(p, a). Therefore, since 1 is a common divisor of a and p (since
1 | a and 1 | p), it must be the greatest common divisor of these numbers.
gcd(a, b) = ak + b`.
1 = ak + b`.
c = ack + bc`.
Now, we assumed that a | bc, which by the definition of divisibility (Definition 2.8)
means bc = am for some integer m. Plugging this in,
c = ack + am`
= a(ck + m`).
Proof of (iii). Now that we have proven that (i) and (ii) are true, we may use
them to prove that (iii) is also true. To prove (iii), we begin by assuming that p | bc.
We will use a proof by cases here. The two cases are: p | b or p - b.
Case 2. Assume that p - b. Then, by part (i), gcd(p, b) = 1. But at this point, we
simply apply (ii): we know that p | bc and gcd(p, b) = 1, therefore p | c.
22
The trickiest part is to not overthink this. In math, often the easiest proofs are the hardest to
think about, because so little happens. The proof of Case 1 is basically this: “Assume Joe’s last
name is Smith. Prove that Joe’s last name is either Smith or Anderson. We are done, because we
already assumed at the start that it was Smith.”
Proofs: A Long-Form Mathematics Textbook 57
In either case we have deduced that p | b or p | c, which shows that (iii) must be
true.
Euclid wrote down proofs of these results nearly 2500 years ago, making them
among the first recorded and rigorously proven results in number theory.23 And since
we called them a lemma, you already know that we’re about to use them to prove
another result.
Proposition.
Proof Idea. The idea behind this proof is very similar to that of Proposition 2.15,
in that both our assumption and conclusion may be expressed in terms of divisibility,
which can in turn be expressed in terms of a product. This will again leave a gap
that we will need to cross, but this time we will need the help of Lemma 2.17 to do
so.24 See if you can do it on your own before looking at the proof below!
m | (ak bk).
And by the definition of divisibility (Definition 2.8), this means that ak bk = m`,
or
for some integer `. By the same definition, and because (a b) must be an integer,
the above also implies that
k | m`.
And since, by assumption, gcd(k, m) = 1, by Lemma 2.17 part (ii) we must have
k | `; by the definition of divisibility (Definition 2.8) this means that ` = kt, for some
integer t. This allows us to rewrite Equation (b):
k(a b) = m`
k(a b) = mkt
a b = mt.
By the definition of modular congruence (Definition 2.14) this means that m | (a b).
That is, a ⌘ b (mod m).
23
Conspiracy theorist somewhere: “Proven? Whatever, man. Number theory is just a theory.
Who knows if number is true?”
24
“Yo, lemma help you prove that proposition.”
58 Chapter 2. Direct Proofs
Another way to think about this proposition is this: If a 6⌘ b (mod m), under
what conditions is it possible that, by multiplying a and b by some k, you can get
ak ⌘ bk (mod m)?
For example, consider what happens when you multiply 0, 1, 2, 3, 4 and 5 by 2,
and write the answers modulo 6:
a: 0 , 1 , 2 , 3 , 4 , 5
2a (mod 6): 0 , 2 , 4
You can see that 2 · 0 and 2 · 3 are the same, modulo 6. And 2 · 1 and 2 · 4 are the
same, modulo 6. And 2 · 2 and 2 · 5 are the same, modulo 6. This allows us to have,
say, 1 · 2 ⌘ 4 · 2 (mod 6), and yet we are unable to divide out those 2s from each side,
since doing so would produce 1 ⌘ 4 (mod 6), which is false.
We end this chapter on a challenging proof.25 Let’s use Lemma 2.17 to prove an
important theorem from number theory. Now, if the following theorem had been
proven by a mathematician like me, then it would be known as Cummings’s Super
Duper Important Theorem; but for the likes of Pierre de Fermat,26 it is simply known
as Fermat’s little theorem. Which is a pretty nice tribute to the guy.
Theorem.
ap 1
⌘ 1 (mod p).
These look like completely different sets. But look what happens when you consider
each of the numbers modulo p; the second set stays the same (e.g., 3 ⌘ 3 (mod 7)),
but the numbers in the first set do change (e.g., 12 ⌘ 5 (mod 7)). Indeed, here are
the sets now:
{4, 1, 5, 2, 6, 3} and {1, 2, 3, 4, 5, 6}.
Notice anything interesting? These are the same set! Sure, the numbers in the first
set are written in a different order, but since the exact same numbers are there,
they are considered identical sets. In particular, since order does not matter with
multiplication (e.g., 1 · 2 · 3 · 4 = 3 · 2 · 4 · 1), this means that
a · 2a · 3a · 4a · 5a · 6a ⌘ 1 · 2 · 3 · 4 · 5 · 6 (mod 7).
Why? Because once the numbers are reduced mod 7, we are multiplying the same
six numbers together — just perhaps in a different order. This in fact holds for any a
and p, and is the key to prove Fermat’s little theorem.
Proof . Assume that a is an integer and p is a prime which does not divide a. We
begin by proving that when taken modulo p,
To do this, observe that the set on the right has every modulo except 0, and each
such modulo appears exactly once. Therefore, since both sets have p 1 elements
listed, in order to prove that the left set is the same as the right set, it suffices to
prove this:
1. No element in the left set is congruent to 0, and
Step 1. First we show that none of the terms in {a, 2a, 3a, . . . , (p 1)a}, when
considered modulo p, are congruent to 0. To do this, we will consider an arbitrary
term ia, where i is anything in {1, 2, 3, . . . , p 1}. Indeed, if we did have some
ia ⌘ 0 (mod p),
which is equivalent to
ia ⌘ 0a (mod p),
then by the modular cancellation law (Proposition 2.18) we would have
i ⌘ 0 (mod p).
That is, in order to have ia ⌘ 0 (mod p), that i would have to have i ⌘ 0 (mod p).
Therefore we are done with Step 1, since no i from {1, 2, 3, . . . , p 1} is congruent to
60 Chapter 2. Direct Proofs
0 modulo p.
Step 2. Next we show that every term in {a, 2a, 3a, . . . , (p 1)a}, when considered
modulo p, does not appear more than once in that set. Indeed, if we did have
ia ⌘ ja (mod p),
for i and j from {1, 2, 3, . . . , p 1}, then by the modular cancellation law (Proposition
2.18) we have
i ⌘ j (mod p).
And since i and j are both from the set {1, 2, 3, . . . , p 1}, this means that i = j.
In other words, each term in {a, 2a, 3a, . . . , (p 1)a} is not congruent to any other
term from that set — it is only congruent to itself. This completes Step 2.
even though the numbers in these sets may be in a different order. But since the
order does not matter when multiplying numbers, we see that
Then, since gcd(2, p) = 1 by Lemma 2.17 part (i), by the modular cancellation law
(Proposition 2.18) we may cancel a 2 from both sides:
Then, since gcd(3, p) = 1 by Lemma 2.17 part (i), by the modular cancellation law
(Proposition 2.18) we may cancel a 3 from both sides:
Continuing to do this for the 4, 5, . . . , (p 1) on each side (each of which has a greatest
common divisor of 1 with p, by Lemma 2.17 part (i)), by the modular cancellation
law (Proposition 2.18) we obtain
ap 1
⌘ 1 (mod p).
Proposition.
Proof Sketch. Following our general direct proof strategy doesn’t get us very far:
Proof. Assume x y.
Apply definitions
« An explanation of what x y means » and/or other results.
apply algebra,
logic, techniques
It doesn’t seem like we have any definitions and/or other results to apply. As
p p
it turns out, getting from x y to x y is just algebra. There are certain
strategies you will pick up along your mathematical journey, and one is that it is
often helpful to have 0 on one side of an equality or inequality, since that allows you
to factor.
Proof. Assume x y.
apply algebra,
logic, techniques
p p
Which implies x y 0.
p p
Therefore x y.
62 Chapter 2. Direct Proofs
How do we bridge this gap? Well, we mentioned that when one side equals zero,
it’s a good idea to try to factor. If it were a2 b2 you would probably notice a
difference of squares and think a2 b2 = (a b)(a + b). In fact, x y can also be
p 2 p 2
viewed as a difference of squares: x y = x y . And from this perspective
and a little more algebra, the bridge can be formed. Below is this argument.
Proof . Assume that x y, and that x and y are positive numbers. Since x y,
x y 0.
p 2 p
Moreover, since x and y are positive, note that x = x and y = y 2 . This allows
us to again rewrite our expression as
p 2 p 2
x y 0.
The left-hand side is a difference of squares, and hence can be factored:
p p p p
( x y)( x + y) 0.
p p
Next observe that since x and y are positive, so is x + y, which allows us to divide
p p
both sides of the inequality by ( x + y), which simply gives
p p
( x y) 0.
p
Finally, by moving y to the right, we get what we sought:
p p
x y.
Deep results in math are typically built on other results. Indeed, let’s now use
the result we just proved to prove another, much less intuitive result. This is also a
very important result in the world of inequalities, called the AM-GM inequality.28
Theorem.
28
The ‘AM’ refers to the arithmetic mean of two numbers,
and the ‘GM’ refers to their geometric mean. Given
two numbers x and y, their algebraic mean is simply QM
their average: x+y2
. Their geometric mean is the multi- AM
plication version of this: instead of adding, you multi-
ply; instead of dividing by 2, you take the second root. HM
p
Thus, their GM is xy. In fact, there’s even a version
with four inequalities, called the QM-AM-GM-HM in- GM
equalities. There is also a neat way to view all four as
parts of a circle. This is pictured on the right !
x y
Proofs: A Long-Form Mathematics Textbook 63
Scratch Work. Since not much is being assumed, let’s jump straight to the
conclusion and then do some algebra to see if we can reach something that we know
to be true. Starting at
p x+y
xy ,
2
let’s multiply over the 2 (since denominators are annoying) which gives
p
2 xy x + y.
Next, let’s square both sides (since square roots are annoying), which gives
4xy x2 + 2xy + y 2 .
Just like in the last proposition, having things equal to zero is commonly a wise step
since it allows you to factor, so let’s move the 4xy to the right:
0 x2 2xy + y 2 .
Be grateful, my friends, for The Factoring Gods have smiled upon us. This is the
same as
0 (x y)2 .
And this we know to be true, since squaring a real number always gives a non-negative
result.
Now, it might seem weird that we started scratch work at our conclusion and
ended our scratch work at something we know to be true. . . Typically a direct proof
is the exact opposite. But this is actually ok, because all of our steps can also be
done in reverse! (The one questionable step might be when we squared both sides,
but this can be done in reverse by Proposition 2.20!) Indeed, if we now start at the
bottom of our scratch work and move upwards, we will have a proof.
Proof . Let x and y be positive integers. Observe that 0 (x y)2 , because the
square of a real number is always non-negative. Rewriting this,
0 x2 2xy + y 2 .
Adding 4xy to both sides then gives
4xy x2 + 2xy + y 2 ,
which allows us to factor the right-hand side:
4xy (x + y)2 .
Finally, since everything is positive we may apply Proposition 2.20 and take the
square root of both sides to get
p
2 xy x + y,
and dividing over the 2 proves our result:
p x+y
xy .
2
64 Chapter 2. Direct Proofs
Pretty neat, don’t cha think? If you saw this proof without the scratch work it
would seem like only a genius could have realized where to begin and foreseen the
required algebra. But with a little reverse scratch work, it becomes clear.
One final note: A common mistake is to do the scratch work as we did, but to not
reverse it for your actual proof. Remember, our scratch work started at our desired
conclusion, and then worked its way back to something we knew to be true. But at
the end of the day, our desired conclusion has to be at the end of our proof, not at
the start.
If the theorem says “P ) Q,” and what you prove is “Q ) P ,” well that’s a very
interesting result but it is not what you had to prove. Do you see how, if you had
proved “Q ) P ” instead, what you are actually doing is starting with the conclusion
of P ) Q and working your way back to the assumptions?
Furthermore, if P ) Q is true, this does not mean that Q ) P is true. It is
true that “living in California implies living in the United States,” but it is false that
“living in the United States implies living in California.” In Chapter 5 we will spend
a lot of time studying the many subtleties of this.
Proofs: A Long-Form Mathematics Textbook 65
— Chapter 2 Pro-Tips —
• When reading a definition, get in the habit of asking “why is it called that?”
Often the word that mathematicians chose provides some intuition for what’s
being defined, or suggests a connection to something else. Graph theory is
especially rich in this way, given how tangible a graph is. For more abstract
areas of math, the connections can be harder to spot.
• Definitions not only offer us precision in our language, but they present to us
objects worthy of study. It had always been the case that 6 and 28 were the
sum of their proper divisors (6 = 3 + 2 + 1 and 28 = 14 + 7 + 4 + 2 + 1), but
when such a property was given a name — that of a perfect number — then it
became a concrete, tangible thing. It allowed mathematicians to focus their
attention and sharpen their dialogue.
Do you believe math is deep and intrinsic, a consequence of logic and nature,
existing beyond humans? Or is it created only in our minds, and would not
exist without us? The mathematician Leopold Kronecker was far on one side of
this argument, saying “God created the integers the rest is the work of man.”
This topic makes for a fun debate, but in the end most people at least agree
that what we choose to define, and what definitions we use, is a distinctly human
decision. Indeed, there is even an example of this in Jewish and Christian faith:
according to Genesis, the first book of the Torah and the Bible, it was God
who created the animals, but it was Adam, the human, who named them.
• Some things we will study here are mostly used as instruments to practice new
proof techniques. You would be forgiven, for example, if you walked away from
this book believing that even and odd integers were going to play a massive
role in your later courses. There is a good reason for this: When first learning
a new proof method or technique, if the problem is phrased in simpler terms
then your focus can remain on the method.
Modular arithmetic, though, is certainly not some arbitrary topic. If
you learn it well, your experience learning abstract algebra will be much
improved, and you will have a big leg-up in your future studies of number
theory, cryptography, and more. In Chapter 9, some of these connections are
introduced.
• In basically all of pure mathematics from here on out, including in the Intro-
duction to Number Theory following this chapter, “log” refers to the natural
log — the log with a base of e.
things from each others’ perspective, you will enrich each others’ understanding.
This is sometimes called the Feynman technique.29
• Suppose you are proving something by cases, and it turns out that two cases
are exactly the same just with variable names switched. For example, suppose
you are proving that n · m is even if one of these two variables is even and the
other is odd. It would be natural to do this in cases. Case 1: n is even and m
is odd; Case 2: n is odd and m is even. One allowed trick is to say “without
loss of generality, we will assume that n is even and m is odd.” The reader can
see that that the proof of the second case is exactly the same, and thus you
only have to write out the proof once.
• When you take abstract algebra you will learn that Z (with the addition and
multiplication operations) is just one example of a more general algebraic object
called a ring. You will learn that in a general ring, our definition of primality
29
Relatedly, Murphy’s Law says that if you wish to find someone on the Internet to answer a
question you have, the best approach is not to post your question, but to post a wrong answer to
your question. Doing this guarantees that someone will come along to prove that you are wrong by
telling you what the correct answer is — producing the exact answer that you sought. (In fact, this
is not at all what Murphy’s Law says. Now, it is safe to print that, but be warned: If you were to
post that on the Internet, then very quickly someone will show up to tell you what Murphy’s Law
really says. This is guaranteed to occur, as I have said, according to Murphy’s Law.)
Proofs: A Long-Form Mathematics Textbook 67
(p 2 is prime if its only positive divisors are 1 and p) is actually the definition
of an irreducible element. In a ring, an element p is called prime if p | ab implies
that p | a or p | b. For the integers these are equivalent conditions, but for other
rings they are not.
68 Chapter 2. Direct Proofs
— Exercises —
30
Exercise 2.1. For each of the following, give three examples of this property.
Then, prove that it is true.
Exercise 2.2. For each of the following, give three examples of this property.
Then, prove that it is true.
(c) If n is an even integer, then ( 1)n = 1. You may use standard properties of
exponents.
(d) 1 divides
Exercise 2.4. Prove the following. For each, m and n are integers.
(a) If m and n are odd, then 5m 3n is even.
(c) If
(d) If
(e) If
30
Mo’ chapters, mo’ problems
Proofs: A Long-Form Mathematics Textbook 69
Exercise 2.8. Prove the following. For each, m, n and t are integers.
(a) 1 | n. (c) If mn | t, then m | t.
Exercise 2.9. Prove that if m and n are positive real numbers and m < n, then
m2 < n2 . You may use the fact that if a < b and c is positive, then ac < bc.
Exercise 2.10. Define the absolute value of a real number x in this way:
(
x if x 0
|x| =
x if x < 0.
Give three examples showing that if x and y are real numbers, then |xy| = |x| · |y|.
Then, prove that this is true.
Exercise 2.11. Prove that if m, n and t are integers, then at least one of m n,
n t and m t is even.
Exercise 2.12. For each pair of integers, find the unique quotient and remainder
when b is divided by a.
Exercise 2.13. For each of the following pairs of numbers, list all of their common
divisors (positive and negative!), and find gcd(a, b).
Exercise 2.14. Let a and b be positive integers, and suppose r is the nonzero
remainder when b is divided by a. Prove that when b is divided by a, the remainder
is a r.
Exercise 2.15. Determine the remainder when 3302 is divided by 28, and show how
you found your answer (without a calculator!). Hint: First figure out 33 (mod 28).
Exercise 2.16. Assume that a ⌘ b (mod n) and c ⌘ d (mod n). Prove the
following.
Exercise 2.17. Assume that a is an integer and p and q are distinct primes.
Prove that if p | a and q | a, then pq | a.
Exercise 2.19. By changing the polynomial , write three more questions which
resemble Exercises ?? and ??. You do not need to prove that they work, but they
should be true.
Exercise 2.20. The Pythagorean theorem involves integers a, b and c for which
a2 + b2 = c2 . Prove that if three integers satisfy this relationship, then either a or b
will be divisible by 3.
Note. The next three exercises will ask you to prove that one thing is true
if and only only if something else is true. If one says “P if and only if Q,”
where P and Q are some mathematical statements, what this means is “If
P , then Q” and also “If Q, then P .”
Exercise 2.21. Prove that n is even if and only if n2 is even. To do this, here are
the two things that you should prove:
(a) If n is even, then n2 is even.
Exercise 2.22. Suppose that a, b and c are positive integers, and gcd(a, b) = d.
Prove that a | b if and only if d = a To do this, here are the two things that you
should prove:
Proofs: A Long-Form Mathematics Textbook 71
(a) If a | b, then d = a.
(b) If d = a, then a | b.
Exercise 2.23. Suppose that p and q are distinct primes, and a is a positive
integer. Prove that if p | a and q | a, then pq | a.
Exercise 2.24. Prove that m ⌘ n (mod 15) if and only if m ⌘ n (mod 3) and
m ⌘ n (mod 5). To do this, here are the two things that you should prove:
Exercise 2.25. Prove that 3 | (4n 1) for every n 2 N in two different ways.
First, prove it using modular arithmetic. Second, prove it using the fact (which you
do not have to prove) that
xn y n = (x y)(xn 1
+ xn 2
y + xn 3 2
y + · · · + xy n 2
+ yn 1
)
Exercise 2.26. The following conjectures are all false. Prove that they are false
by finding a counterexample to each.
1 1 1 1
1+ + + + · · · + < 3.
2 3 4 n
Exercise 2.27. Prove that every odd integer is the difference of two squares. (For
example, 11 = 62 52 .)
Exercise 2.28. Prove that for every positive integer n, there exist a string of n
consecutive integers none of which are prime.
3.1 Definitions
We began with the most fundamental forms of proof — direct proofs. Now we turn
to one of the most fundamental objects in math — sets. Let’s kick that off with some
important definitions.
Definition.
Definition 3.1.
When possible, sets are often drawn with curly braces enclosing their elements,
like {2, ⇡, 6}. Let’s record some important sets and their notation.
Definition.
Definition 3.2.
• The set without any elements, denoted ; or {}, is called the empty set.
Another way to think about a set is as a box, possibly with some things inside.
When you look into a box, the things inside do not have any particular order; the
same can be said about the elements of a set. Indeed, consider the following.
1
Alternative definition: Everything. Everything is a set. Almost no definition in the world is as
general as that of a set. And while some day you may learn that “everything” is just slightly too
broad, it is pretty dang close.
73
74 Chapter 3. Sets
3
1
2 = {2,3,1}
The above box also corresponds to {1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {3, 2, 1} and
{3, 1, 2}. Indeed, we will view all of these sets as being equal to each other, since
they contain the exactly the same elements. For example, {1, 3, 2} = {3, 2, 1}.
Another important thing to note about sets is that the elements do not have to
be numbers. The elements of a set can be anything.
le ⇡
app
Joe
= {apple, Joe, ⇡}
Also, just as boxes can be empty, so can sets!
= ;
Furthermore, it’s certainly possible for one box to be inside another box. Likewise,
it’s certainly possible for one set to be a single element inside another set.
le ⇡ ,
app
Joe 7 = {{apple, Joe, ⇡}, 7, ,}
Notice that the above set has three elements in it: (1) a set (containing three
specific elements), (2) the number 7, and (3) a smiley face. Your box could also
have just one thing in it: a smaller box with nothing inside it. This looks like the
following.
= {;}
In the last three pictures we have seen an example for ; and for {;}. Notice that
these are different! The empty set is different than the set containing the empty set,
just as an empty box is different than a box containing an empty box. It would be
a mistake to think about ; as being nothing. It’s something! It’s a set! It doesn’t
have anything in it, but it’s still a thing. In the same way, {;} is a set containing
one element — its element is a set which contains no elements, but it’s still there and
it’s still a thing.
Proofs: A Long-Form Mathematics Textbook 75
Like in the examples above, sets are often written like {. . . }, where inside the
braces is just a list of the elements, like {1, 2, 3} or {1, 2, 3, 4, . . . }. Sometimes, though,
they are defined by a rule; this is called set-builder notation. Set-builder notation
either looks like this:
where S is some larger set in which the conditions are restricting. Let’s discuss a
couple examples of both of these forms. First, here are two examples of the first form:
• {|n| : n 2 Z} = {0, 1, 2, 3, . . . }.
The first example uses the condition n 2 N, which means2 that you should plug in
n = 1, 2, 3, 4, 5, . . . into n2 to get the elements of the set. Next, here are two examples
of the second form:
• {n 2 Z : n is even} = {. . . , 6, 4, 2, 0, 2, 4, 6, . . . }
Next4 up, let’s discuss one weird set and one important set. First, here is the
weird set: {w : w is weird}. And now, for the important set: the set of rational
numbers, which is important enough to deserve a special symbol, and to have its
definition be enclosed in a definition box.
Definition.
2
Recall that 0 is not considered a natural number.3 I will defend this to my grave.
3
The set {0, 1, 2, 3, . . . } is denoted N0 . (Fun fact: ‘0’ was first discovered by an ancient Babylonian
who asked how many of his friends wanted to talk about numbers with him.)
4
Quick note: Be careful when you use dot-dot-dots. They are not rigorous — they are an informal
way to say “and continue this pattern forever.” It is fine to use them in your work provided the
pattern is clear. For example, “1, 2, . . . ” is not clear at all. Does this mean the arithmetic sequence
1, 2, 3, 4, 5, . . . ? Or the geometric sequence 1, 2, 4, 8, 16, . . . ? Or perhaps it is the sequence of factorials
1, 2, 6, 24, 120, . . . ? Or the sequence of Catalan numbers 1, 2, 5, 14, 42, . . . ? Make sure your patten is
very clear before throwing down the dot-dot-dots.
76 Chapter 3. Sets
Q = { a
: a, b 2 Z , b 6= 0}
b
The are fractions a and
the set such b is
rational defined of the b are and
of all that nonzero
numbers to be form ab integers
You might notice that the definition of Q considers both 23 and 46 and 69 , and
infinitely more representations of this same number. Shouldn’t we only consider one
of these? This is actually not an issue, since a set only ever keeps one of each element;
Definition 3.1 says that the elements must be distinct. For example, {1, 1, 2} is really
just the set {1, 2}. So the duplicates in the definition will be automatically removed,
simply by nature of a set.
The set of real numbers, denoted R, is more difficult to define, so for now just
rely on your intuition — real numbers are all the numbers you can write down with
a decimal point. This includes integers like 4, finite-decimals like 12.439, and
infinite-decimals like 3.14159 . . . . To define them rigorously would literally take
dozens of pages, which you would likely find much more confusing than enlightening.
Let’s now use R and set-builder notation to generate other familiar sets. The set
of 2 ⇥ 2 real matrices can be written
⇢
a b
: a, b, c, d 2 R .
c d
The xy-plane represents the set of ordered pairs of real numbers. This set can be
written
R2 = {(x, y) : x 2 R and y 2 R}.
The unit circle (circle of radius 1 centered at the origin) is contained inside of R2 ,
and can be defined as follows:
S 1 = {(x, y) 2 R2 : x2 + y 2 = 1}.
3.2 Proving A ✓ B
Definition.
Just as definitions are human choices whivh can at times provide intuition,
notation is too. The notation “A ✓ B” for sets A and B looks quite similar to “x y”
for numbers x and y. And many of the same properties carry over: If A ✓ B, then
B is bigger than A is some sense. And if A ✓ B and B ✓ C, then A ✓ C. Later on
we will discuss other similarities
Below are three standard examples and one subtle example.
Example 3.5.
• {1, 3, 5} ✓ {1, 2, 3, 5, 7}.
• N ✓ Z ✓ Q ✓ R.
• {a, b, c} 6✓ {a, b, e, f, g}.
• For every set B, it is true that ; ✓ B. Why does this satisfy Definition 3.4? To
see it, first note that, because there are no elements in ;, it would be true to say
“for any x 2 ;, x is a purple elephant that speaks German.” It’s vacuously5 true!
You certainly can’t disprove it, right? You can’t present to me any element in
; that is not a purple elephant that speaks German.
By this reasoning, I could switch out “is a purple elephant that speaks
German” for any other statement and it would still be true! And this includes
the subset criteria: if x 2 ;, then x 2 B, which by definition means that ; ✓ B.
Again, you certainly can not present to me any x 2 ; which is not also an
element of B, can you?6
Notice that if A = B, then A ✓ B. In the case that A ✓ B and A 6= B, we
say that A is a proper subset of B. We will not use it in this text, but the correct
notation for this is “A ⇢ B.” 7
Given a pair of sets A and B, Definition 3.4 tells us that in order to prove that
A ✓ B, what we would have to show is this:
“If x 2 A, then x 2 B.”
5
A vacuum in physics is a container in which the air inside has been sucked out, leaving nothing
left. Likewise in math, saying something is vacuously true means that the set of elements that the
statement is referring to is empty; therefore there is nothing to prove, and it’s automatically true.
6
Perhaps ; ✓ B is true only due to a technicality — but this is a technical subject!
7
Note: Some people use “⇢” to mean “is a subset of” and “(” for “is a proper subset of.” These
people are wrong. We write and < for our inequalities, and our subset notation should be likewise.
I wrote this book mainly as a vehicle to push my opinions on mathematical notation, so don’t let
me down here. Go forth and spread the word.
78 Chapter 3. Sets
Thus, here is the outline for a (direct proof) that a set A is a subset of a set B:
Proposition. A ✓ B.
Proof. Assume x 2 A.
Let’s practice.
Proposition.
{n 2 Z : 12 | n} ✓ {n 2 Z : 3 | n}.
Scratch Work. For a problem like this, where it is possible to write out more
explicitly what sets we are dealing with, it’s always a good idea to write out a few of
the terms to make sure you believe that it is true. This may also help you prove the
result. Here is the first set:
So yes, it does seem to be checking out. It looks like the terms in the first set make
up one fourth of the terms in the second set.
As for the proof, we will follow the outline above; here, A = {n 2 Z : 12 | n} and
B = {n 2 Z : 3 | n}. “An explanation of what x 2 A means” will basically just be
8
Note: It is considered improper to have sentence start with mathematical notation. So we add
a short statement like “It is the case that” or “We have” at the start of propositions like this.
Proofs: A Long-Form Mathematics Textbook 79
an application of Definition 2.8 to explain what it would mean to say “12 | x.” This
brings our proof outline to the following point.
apply algebra,
logic, techniques
Can you see how to bridge the gap? Think about it on your own, then check out
the proof below.
x = 3 · (4k).
And since k 2 Z, by Fact 2.1 it is also true that 4k 2 Z. Thus, by the definition of
divisibility (Definition 2.8), this means that 3 | x.
Since x 2 {n 2 Z : 12 | n} implies that x 2 {n 2 Z : 3 | n}, it follows that
{n 2 Z : 12 | n} ✓ {n 2 Z : 3 | n}.
The next example looks a little different, but the same general principles apply.
Proposition.
Proof Idea. Remember that what we must show is that x 2 A implies x 2 B. The
trick here is to realize that x 2 A can only mean one of two things: either x = 1 or
x = 3. Since there are just two distinct options, this suggests that perhaps using a
proof by cases is the way to go.
Next, in each case, how do we show that x 2 B? We must show that such an x
satisfies x3 3x2 x + 3 = 0; if it does then it’s in B since that’s literally how B is
defined. This is how we proceed.
Proof . Assume x 2 A. Then either x = 1 or x = 3. Consider these two cases
separately.
3.3 Proving A = B
Recall that, for sets A and B, to say that “A = B” is to say that these two sets
contain exactly the same elements. Said differently, it means these two things:
1. Every element in A is also in B (which means A ✓ B), and
Proposition. A = B.
Proof. Assume x 2 A.
Next, assume x 2 B.
Definition.
Definition 3.8.
To test your understanding, think about what the union and intersection of two
sets would look like from the box interpretation with which we began this chapter.10
One answer: The union of two boxes A and B can be obtained by dumping everything
in A and everything in B into a new box, and then removing any duplicate items.
The intersection can be obtained by identifying everything in A that is also in B,
and putting those items into a new box. The intersection can also be obtained by
dumping everything in A and everything in B into a new box, and then removing
one of each item (so if there are two of something, you remove just one of the two).
Next, if A1 , A2 , A3 , . . . , An are all boxes, think if you can now describe the
following in terms of boxes.
n
[ n
\
• Ai = A1 [ A2 [ · · · [ An • Ai = A1 \ A2 \ · · · \ An
i=1 i=1
10
Or, for additional intuition, here’s a popular meme involving the union and intersection of an
interesting haircut with a balding man:
and
Proofs: A Long-Form Mathematics Textbook 83
Another helpful way to picture a collection of sets is via Venn diagrams. For
example, below are A [ B, A \ B, A [ B [ C and A \ B \ C, represented by the
shaded region in the image.
A B A B
A[B A\B
A A
B C B C
A[B[C A\B\C
For numbers, there is a notation of addition, subtraction and products. For sets,
there are unions, set subtractions and Cartesian products. Taking the absolute value
of a number tells you how big it is; for sets, we can find its cardinality. These are
some of the major set operations left to discuss. Let’s (mostly) go through them
two-at-a-time.
Definition.
Definition 3.9. Assume A and B are sets and “x 62 B” means that x is not an
element of B.
11
If is the universal set, then the complement of is .
84 Chapter 3. Sets
Intuitively, A \ B means “all the elements in A that are not in B.” You can find
this set by starting with A, and then removing everything in it that is also in B. As
for the complement, Ac intuitively means “everything that is not in A,” with one
caveat: When we say “everything” we are only referring to things in the universe U .
Here are their Venn diagrams:
A
A B
A\B Ac in U
Example 3.10. Let A be the set of odd integers and B be the set of even integers.
• See if you can determine what A [ B, A \ B, Z \ A and A \ B are. Only once you
have a guess in mind, check out the answer in the footnote. (And to encourage
you to try it first, it is upside down.)13
Next, here are two set operations that involve just a single set. The first is the power
set, which takes in a set and outputs a much larger set. The second is the cardinality
operator, which takes in a set and outputs a number.
12
Pop-quiz: When is it true?
13 A [ B = Z, A \ B = ;, Z \ A = B and A \ B = A.
Proofs: A Long-Form Mathematics Textbook 85
Definition.
The power set of a set A is denoted P(A). Since P(A) is a set, what are the
elements of P(A)? First, every element of P(A) is itself a set.14 And which sets have
earned the honor of being an element of P(A)? If X is a subset of A, then X is an
element of P(A). (Read that last sentence as many times as needed for it to make
sense.)
P({1, 2, 3}) = {1, 2, 3}, {1, 2}, {1, 3}, {2, 3}, {1}, {2}, {3}, ; .
• The power set P(N) is the set of all sets of natural numbers. Every set which
contains only natural numbers — whether that set is infinite like the set of even
natural numbers, or finite like {23, 74, 140} — is an element of P(N). Make
sense?16
Most students find cardinality a little easier to grasp. It just tells you how
many elements are in your set. For example, |{1, 2, 3}| = 3, and |{a, b, c}| = 3, and
|{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}| = 10, and |N| = 1.
Cartesian Products
Our final set operation is the Cartesian product. This is once again an operation
that combines two sets to create a new set.
Definition.
14
Remember, a box can contain anything, including other boxes!
15
“Don’t forget your empty set!” is the “Don’t forget your +C!” of set theory.
16
If so, now try to make sense of the set P(P(N)). Got it?17
17
If so, now try to make sense of the set P(P(P(N))). Got it?18
18
If so, now try to. . . (Attn: I hereby define the footnote of a footnote to be a toenote.)
86 Chapter 3. Sets
The Cartesian product is a way to “multiply” sets. The product of sets A and
B is a set which is denoted A ⇥ B. It is a set for which each of its elements is an
ordered pair (like (1, 2)). Which ordered pairs have earned the honor of being an
element of A ⇥ B? If a is an element of A, and b is an element of B, then (a, b) is an
element of A ⇥ B. Below is an example.
Example 3.14. Below are two examples of Cartesian products.
• The Cartesian product of {1, 2, 3} and {,, ⇡} is
{1, 2, 3} ⇥ {,, ⇡} = {(1, ,), (2, ,), (3, ,), (1, ⇡), (2, ⇡), (3, ⇡)}.
1 2 3
⇡ (1, ⇡) (2, ⇡) (3, ⇡)
• When a set has two “dimensions” to it, it can often be viewed as a Cartesian
product. For example, consider the integer points in the xy-plane.
These points have a x-axis dimension and a y-axis dimension, and so the set of
these points should be a Cartesian product. And indeed, they are: This is a
plot of the set Z ⇥ Z.
We have now learned five new set operations. And if you’re not tired of my silly
sets-as-boxes idea, you can now try to describe A \ B, Ac , P(A), |A| and A ⇥ B in
terms of boxes.
19
In fact, this perspective helps one see that if A and B are finite sets, then |A ⇥ B| = |A| · |B|.
Proofs: A Long-Form Mathematics Textbook 87
– BEGIN INTERJECTION –
Theorem.
Proof . Despite being defined in terms of circles, ⇡ has the property that
1 1 1 1 ⇡
1 + + ··· = .
3 5 7 9 4
And I think we can all agree that is super cool, thus completing the proof.
– END INTERJECTION –
Back to sets, next up is a proposition whose main goal is to test our understanding
of power sets and subsets.
Proposition.
Proposition. A ✓ B.
Proof. Assume x 2 A.
As you will see, this proof basically comes down to remembering the definitions
of a subset and a power set. In fact, these are the two important observations:
Before moving on to the proof, make sure these both make sense to you; if they don’t,
then go back and stare at the definitions of a subset and a power set until they do.
The proof will be a blur unless these are clear in your mind.
Proof . Assume that A and B are sets and P(A) ✓ P(B). Let x 2 A. Note that
this implies that {x} ✓ A by the definition of a subset (Definition 3.4), and so
{x} 2 P(A) by the definition of a power set (Definition 3.11). And since we assumed
that P(A) ✓ P(B), this in turn means that {x} 2 P(B), again by the definition of a
subset. Finally, by each of these definitions one last time, {x} 2 P(B) means that
{x} ✓ B, which in turn means that x 2 B.
We showed that x 2 A implies x 2 B, and so A ✓ B.
In math there is often more than one way to prove something. Proposition 3.15
is a good example of this. Below is second proof.
Second Proof. Assume A and B are sets and P(A) ✓ P(B). To begin, observe
that A ✓ A; this is because x 2 A of course implies x 2 A, which means that A ✓ A
by the definition of a subset (Definition 3.4).
By the definition of the power set of A (Definition 3.11), the fact that A ✓ A
means that A 2 P(A). And since we assumed that P(A) ✓ P(B), this means that
A 2 P(B).
Finally, by the definition of the powerset of B (Definition 3.11), having A 2 P(B)
implies that A ✓ B. This concludes the (second) proof.
It’s now time for a result which you know is important because its labeled a
theorem, it has a name, and the result is call a law. Any one of these should cause
you to sit up and pay attention. But all three?? This is a result to remember.
Theorem.
Theorem 3.16 (De Morgan’s Law ). Suppose A and B are subsets of a universal
set U . Then,
Proof Idea. We will prove the first identity and leave the second as an exercise.
Let’s see if the first identity makes sense based on the its Venn diagram. Here is
A [ B, inside the set U :
Proofs: A Long-Form Mathematics Textbook 89
A B
A B
U U
A B A B
Since these are Ac and B c , the Venn diagram of Ac \ B c is the set of all points
which are shaded in both of the above diagrams. Which is this:
A B
20
There are two types of people in this world. Those who understand complements and
c
those who understand complements .
90 Chapter 3. Sets
That’s the same as the Venn diagram for (A [ B)c ! That is intuition for why
these two are the same, but to prove it we will use the approach laid out in Section
3.3. That is, we will prove that
(A [ B)c = Ac \ B c .
Proof . Assume A and B are subsets of U and all complements are taken inside U .
First, we will prove that (A [ B)c ✓ Ac \ B c . To this end, assume x 2 (A [ B)c .
Then, by the definition of the complement (in U ), x 2 U and
x 62 (A [ B).
x 62 A and x 62 B,
x 2 Ac and x 2 B c .
x 2 Ac \ B c .
(A [ B)c ✓ Ac \ B c .
x 2 Ac and x 2 B c .
x 62 A and x 62 B,
x 62 (A [ B).
21
Note: We will be studying the logic of this step in depth in Chapter 5.
Proofs: A Long-Form Mathematics Textbook 91
x 2 (A [ B)c .
Ac \ B c ✓ (A [ B)c .
(A [ B)c = Ac \ B c ,
The above proof was longer and more challenging than others in this chapter.22
But it was good practice for our subset proofs, and is a great reminder of how to
work with unions, intersections and complements. But now that I’ve forced you to
suffer through a page-long argument, I thought I’d mention that there is another way
to prove some of these set equalities by manipulating the set-builder notation. The
above proof, for example, can be consolidated into just 4 lines:
Proving a 2 A
The first topic is proving that an element a belongs to a set A. This is considered
miscellaneous because often it is more-or-less clear whether or not a specific element
is in a specific set, and when it is not clear the methods are highly dependent on the
specific element and set. For example, consider the set Q. Given a rational number
22
The Struggle 2 R.
23
Again, this step will be studied in depth in Chapter 5.
92 Chapter 3. Sets
A = {x 2 S : P (x)},
(i) a 2 S, and
Proof . First, note that (17, 2) 2 Z ⇥ N since 17 2 Z and 2 2 N. Next, observe that
17 2 = 5(3),
5 | (17 2),
which by the definition of modular congruence (Definition 2.14) then means that
17 ⌘ 2 (mod 5).
Thus, (17, 2) 2 A.
ask questions about such a family — like, what is the union of all of the sets in F?25
That is, [
S = {x : x 2 S for some S 2 F}.
S2F
Likewise, \
S = {x : x 2 S for every S 2 F}.
S2F
For example, if F = {N, {2, 4, 6, 8, 10, . . . }, {5, 10, 15, 20, 25, . . . }}, then
\
S = {10, 20, 30, 40, . . . }.
S2F
Proposition.
{n 2 Z : 12 | n} = {n 2 Z : 3 | n} \ {n 2 Z : 4 | n}.
Scratch Work. Let’s make sure we believe the result. Here are the n such that
n 2 Z and 3 | n:
. . . , 24, 21, 18, 15, 12, 9, 6, 3, 0, 3, 6, 9, 12, 15, 18, 21, 24, . . .
Those are indeed the n such that n 2 Z and 12 | n, so it seems to be checking out.
25
These are the ‘family reunions’ of set theory.
94 Chapter 3. Sets
Now, following the proof outline from Section 3.3 we will prove this by showing
that
{n 2 Z : 12 | n} ✓ {n 2 Z : 3 | n} \ {n 2 Z : 4 | n}
and
{n 2 Z : 3 | n} \ {n 2 Z : 4 | n} ✓ {n 2 Z : 12 | n}.
Let’s jump right into it.
A = {n 2 Z : 3 | n},
B = {n 2 Z : 4 | n}, and
C = {n 2 Z : 12 | n}.
x = 4 · (3k).
And since k 2 Z, by Fact 2.1 it is also true that 3k 2 Z. By Definition 2.8 this means
that 4 | x. Therefore, x 2 B.
Since x 2 C implies that x 2 B, it follows that C ✓ B. The fact that C ✓ A is
by Proposition 3.6, which by the definition of a subset means that if x 2 C, then
x 2 A.
We have proven that x 2 A and x 2 B, so by the definition of the intersection
(Definition 3.8), this implies x 2 A \ B.
We have shown that if x 2 C, then x 2 A \ B. This implies C ✓ A \ B, as desired.
26
“Yo, lemma help you prove that proposition.”
Proofs: A Long-Form Mathematics Textbook 95
C ✓A\B and A \ B ✓ C.
Suppose you’re trying to generate a subset of {1, 2, 3}. You could think about
doing so by asking three yes/no questions, the answers to which uniquely determine
your set. With 2 options for the first element, 2 for the second, and 2 for the third, in
total there are 2 ⇥ 2 ⇥ 2 = 8 ways to answer the three questions, and hence 8 subsets!
In general, a subset of A = {1, 2, 3, . . . , n} can be generated like this:
Is 1 in Is 2 in Is 3 in Is n 1 in Is n in
the subset? the subset? the subset? the subset? the subset?
yes/no yes/no yes/no yes/no yes/no
2 2 2 2 2
options options options options option
96 Chapter 3. Sets
Proposition.
Proposition 3.19. Given any A ✓ {1, 2, 3, . . . , 100} for which |A| = 10, there
exist two different subsets X ✓ A and Y ✓ A for which the sum of the elements
in X is equal to the sum of the elements in Y .
For example, I asked a computer for 10 random numbers from {1, 2, 3, . . . , 100},
and here is what it spit out:
{6, 23, 30, 39, 44, 46, 62, 73, 90, 91}.
And sure enough, I was able to find two subsets X and Y which work. If we let
X = {6, 23, 46, 73, 90} and Y = {30, 44, 73, 91},
6 + 23 + 46 + 73 + 90 = 238 = 30 + 44 + 73 + 91
(Now, since 73 was included in both sets, if we removed it from both we would have
another pair of sets satisfying the theorem. Or if we added 39 to both, then again it
would be satisfied.)
This seems like quite the amazing property! Any set of 10 elements from
{1, 2, 3, . . . , 100} has this property. You might think there are just too many possible
sums for such a thing to be guaranteed. But when you wonder whether there are
“too many” of something to guarantee some property, your pigeoney senses should
start tingling, since the pigeonhole principle is a great tool to determine whether or
not there are enough of something.27
Proof . Suppose A ✓ {1, 2, 3, . . . , 100} and |A| = 10. The smallest possible subset
sum would be with the subset ;, whose elements sum to 0, since there are no
elements.28 Meanwhile, the largest possible subset sum would correspond to the
subset {91, 92, 93, 94, 95, 96, 97, 98, 99, 100}, whose sum is
91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 = 955.
Thus, there are certainly no more than 956 possible subset sums of A. Imagine a box
for each possible sum.
27
A pigeoney sense is similar to a spidey sense: With great power sets comes great responsibility.
28
Alternatively, you don’t lose anything by focusing on non-empty subsets, in which case the
smallest possible subset sum is 1, corresponding to the subset {1}.
Proofs: A Long-Form Mathematics Textbook 97
How many subsets of A are there, if |A| = 10? Before this proof we showed that
the answer is 210 = 1024. For each subset of A, place it into the box corresponding to
its sum. We are placing 1024 objects into 956 boxes, so by the pigeonhole principle
(Principle 1.5) there must be a box containing two subsets of A — which means these
two subsets have the same sum.
98 Chapter 3. Sets
— Chapter 3 Pro-Tips —
• Typically when taking the complement of A in some universal set U , the set U is
clear from the context. If you’re taking real analysis and your professor discusses
the complement of the open interval (1, 5), what she means is ( 1, 1] [ [5, 1),
because the complement is assumed to be in the reals. When you’re reading
a research article on combinatorics on the integers and the author writes
{. . . , 9, 6, 3, 0, 3, 6, 9, . . . }c , what they mean is the set of integers which are
not divisible by 3, because it is assumed that the universal set is the integers.
Context clues help relax the writing in advanced mathematics. If one wishes to
refer to the unit circle in the xy-plane, perhaps they would define S to be this
set of points: S = {(x, y) 2 R2 : x2 + y 2 = 1}. Then, if later they wish to refer
to the points in the xy-plane which are not on the unit circle, they might write
S c , and the understanding would be that the universal set is R2 .
• If you’re trying to write a xi (⇠), a three (3) or a right set brace (}), and they
all look like one of these:
then I know how you feel. I had a professor in undergrad who loved to use xi as
his variable, and I spent so much mental energy just trying to draw them that
it’s literally the only thing I remember from that class. But this is a chapter
on sets, let’s focus on how to write set braces. Try this: write a 2 ( )
That will give you a right set brace. As for the left, write an S and then a 2:
+ = . It’ll take a little practice to get the curves right, but that should
help. (But if your prof starts using xi in every proof, my best advice is to just
drop the class.)
Proofs: A Long-Form Mathematics Textbook 99
• Up until now, we have been very careful to always justify every small step
in every proof. We started each proof by stating our assumptions, we said
when nearly every definition was used, and we worked out every little bit of
algebra. From this point on, we will begin, ever so slightly, to pull back from
this meticulousness. And in your later courses your professors will probably
pull back a little more. And if you go to graduate school in math, or read
math research papers, even more will be held back. While I firmly believe that
research papers and advanced math books should say a lot more than they
do. . . it is practical to not cite every last definition and work out the details of
every small algebraic step.
Here’s how I think about it. When my dad taught me how to drive, he
insisted that I do everything perfectly. Hand placement, mirrors, speed limit,
spacing, signs, blinkers, lights, focus, radio, . . . every last thing should be done
perfectly. It’s not that being soooo meticulous is crucial; less so would still be
plenty safe. It’s because everyone relaxes this alertness eventually — and if you
start by driving perfectly, then once you relax you will still end up in a great
place. This was my dad’s reasoning.
I believe the same holds with proofs. If your proofs begin with surgical
precision, then once you inevitably relax a bit, you won’t do so to a point that
mistakes are introduce or your readeres are confused.29
29
When my grandma taught my dad to drive, her advice was simpler: “Assume every other driver
is an idiot.” While I did consider making this the lesson for your proof writing. . . I ultimately chose
to go with my dad’s more wholesome take.
100 Chapter 3. Sets
— Exercises —
Exercise 3.1. If A and B are two boxes (possibly with things inside), describe
the following in terms of boxes: A \ B, P(A), and |A|.
Exercise 3.2. Rewrite each of the following sets by listing their elements between
braces.
(d) { m
n 2Q:
m
n < 1 and 1 n 4} (j) P({{1, 2}, {a, b}})
(e) {x 2 R : x2 + 5x + 6 = 0} (k) {A 2 P({a, b, c}) : |A| < 2}
Exercise 3.11. Prove the second identity in De Morgan’s Law (Theorem 3.16).
That is, suppose A and B are subsets of R. Using U as our universal set,
(A \ B)c = Ac [ B c .
Exercise 3.12. For sets A, B and C, and a universal set U , draw the Venn
diagram representing each of the following.
Exercise 3.13. For each of the following Venn diagrams, write down an expression
which would describe that Venn diagram. There are multiple correct answers.
30
For part (n), note that R2 is defined to be R ⇥ R, which is the set of ordered pairs of real
numbers. Meanwhile, R3 is the set of ordered triples of real numbers.
102 Chapter 3. Sets
A A A
B C B C B C
Exercise 3.16. Let A and B be sets. Prove that if A ✓ B, then P(A) ✓ P(B)
A \ (B [ C) = (A \ B) [ (A \ C).
Exercise 3.20. Suppose someone conjectured that, for any sets A and B which
contain finitely many elements, we have
|A [ B| = |A| + |B|.
Exercise 3.21. Give examples of sets A, B, C and D where the following hold.
(a) A [ B \ B = A (b) C [ D \ D 6= C
Proofs: A Long-Form Mathematics Textbook 103
Exercise 3.22. For each of the following conjectures, either prove it is true or
find a counterexample demonstrating that it is false. For each, suppose A, B and C
are sets.
{n 2 Z : 2 | n} \ {n 2 Z : 9 | n} ✓ {n 2 Z : 6 | n}.
Exercise 3.26.
(a) Give an example of three sets A, B and C for which A [ B = A [ C, but B 6= C.
Exercise 3.28. Suppose A and B be sets, with universal set U . Prove that
A \ B = A \ Bc.
Exercise 3.31. If R ⇥ R is our universal set, describe the elements in the set
(Q ⇥ Q)c .
Note. The next two exercises will ask you to prove that one thing is true
if and only only if something else is true. If one says “P if and only if Q,”
where P and Q are some mathematical statements, what this means is “If
P , then Q” and also “If Q, then P .”
Exercise 3.32. Suppose A and B are sets. Prove that A ✓ B if and only if
A \ B = ;. To do this, here are the two things that you should prove:
(a) If A ✓ B, then A \ B = ;.
(b) If A \ B = ;, then A ✓ B.
Exercise 3.33. Suppose A and B are sets. Prove that A ✓ B if and only if
A \ B = A. To do this, here are the two things that you should prove:
(a) If A ✓ B, then A \ B = A.
(b) If A \ B = A, then A ✓ B.
Exercise 3.34. Let A = {a, b}. Write out the set A ⇥ P(A).
Exercise 3.35. Let A and B be sets. Prove that P(A \ B) = P(A) \ P(B).
(b) Prove that there is a unique set A 2 P(C) such that for every B 2 P(C) we have
A [ B = A.
(c) Prove that there is a unique set A 2 P(C) such that for every B 2 P(C) we have
A \ B = B.
(d) Prove that there is a unique set A 2 P(C) such that for every B 2 P(C) we have
A \ B = A.
Exercise 3.37. Define the symmetric difference of sets A and B to be the set
A 4 B = (A [ B) \ (A \ B).
are equal to. You do not need to formally prove your answer, but you should explain
your reasoning.
Chapter 4: Induction
... ...
1 = 1 = 12
1 + 3 = 4 = 22
1 + 3 + 5 = 9 = 32
1 + 3 + 5 + 7 = 16 = 42
1 + 3 + 5 + 7 + 9 = 25 = 52
1 + 3 + 5 + 7 + 9 + 11 = 36 = 62
1 + 3 + 5 + 7 + 9 + 11 + 13 = 49 = 72
107
108 Chapter 4. Induction
It sure looks like the sum of the first n odd numbers is n2 . What a neat property!1
But how can we prove that it’s true for every one of the infinitely many n? The trick
is to use the domino idea. Imagine one domino for each of the above statements.
1 = (k + 1)2
1 = (k + 2)2
1 = (k + 3)2
1 = (k + 4)2
1) = k2
1 + 3 + 5 + 7 = 42
⌘
1 + 3 + 5 = 32
1 + 3 = 22
1 + 3 + · · · + 2(k + 1)
1 + 3 + · · · + 2(k + 2)
1 + 3 + · · · + 2(k + 3)
1 + 3 + · · · + 2(k + 4)
1 + 3 + · · · + (2k
1 = 12
... ...
⇣
Suppose we do the following:
• Show that the first domino is true (this is trivial, since obviously 1 = 12 ).
• Show that any domino, if true, implies that the following domino is true too.
Given these two, we may conclude that all the dominoes are true. It’s exactly the
same as noting that all the dominoes from earlier will fall. This is a slick way to prove
infinitely many statements all at once, and it is called the principle of mathematical
induction, or, when among friends, it is simply called induction.2
Principle.
1
There is also a pleasant way to visualize this fact. Here’s the case 52 = 1 + 3 + 5 + 7 + 9:
52 = = = 1+3+5+7+9
1 3 5 7 9
2
The principle of induction, like the pigeonhole principle, will be considered true without proof.
Proofs: A Long-Form Mathematics Textbook 109
Sk+1
Sk+2
Sk+3
Sk+4
... ...
Sk
S1
S2
S3
S4
The above also suggests a general framework for how to use induction.
Before we get into examples, why is this section called Dominoes, Ladders and
Chips? First, there is another popular metaphor for induction that uses ladders. And
in case you’re not falling for the domino metaphor, perhaps this next one will elevate
your understanding.
Assume there is a ladder that rests on the ground but climbs upwards forever.
Assuming you can step on the first rung, and assuming that you can always step from
one rung to the next, then sky’s (not even) the limit! You can climb upward forever!3
And in case dominoes and ladders aren’t doing it for you, I came up with one
final metaphor for you — one that really resonates in my soul. Assume you have an
endless bag of potato chips. Assuming you eat a first chip, and assuming that eating
a chip always makes you want to eat another chip, then you will want to eat chips
forever.
4.2 Examples
The example that we have discussed thus far will be saved for Exercise 4.1, but fear
not, there are many more beautiful results for us to tackle. I want to go simpler than
adding up the first n odd natural numbers — let’s simply sum the first n natural
numbers: 1 + 2 + 3 + 4 + · · · + n. These sums are called the triangular numbers since
they can be pictured as the number of balls in the following triangles.
3
Between these two metaphors, I prefer dominoes, although some prefer the latter.
110 Chapter 4. Induction
1 3 6 10 15
Proposition.
n(n + 1)
1 + 2 + 3 + ··· + n = .
2
Proof Idea. Since we are aiming to prove something for all n 2 N, it makes sense
to use induction. The base case will be fine: If n = 1 in the formula in Proposition
4.2, the left side is just 1, and the right side is 1(1+1)
2 . Since these are indeed equal,
the statement S1 has been shown to be true.
Next up is our inductive hypothesis, in which we assume the k th step is true.
That is, we assume that
k(k + 1)
1 + 2 + 3 + ··· + k = .
2
Here, k is some fixed natural number; we don’t know what it is — perhaps k = 1 or
k = 2 or k = 174. Our assumption is independent of the choice, but we do assume it
is a fixed. It’s like assuming the k th domino will at some point fall, and all you’re
wondering is whether it is guaranteed to knock over the (k + 1)st domino.4
4
Think back to Chapter 2 where we referred to an arbitrary odd integer as n = 2a + 1 where a
is some integer. It wasn’t that n was all the odd integers at once, but at the same time it wasn’t
guaranteed to be 7 or 23 or 101 either. It was a fixed odd integer, but it was also an arbitrary odd
integer. Thus, every thing we did to it (like finding n2 = (2a + 1)2 = 4a2 + 4a + 1) would apply
equally to every odd integer. Indeed, our proof of Proposition 2.6 proceeded by showing that if n is
an arbitrary odd number, then n2 is also odd. By proving it for a fixed-but-arbitrary odd integer,
we could conclude that it holds for every odd integer! In the same way, the kth domino is fixed but
arbitrary. Our induction step will prove that this arbitrary domino must knock over the next one,
and because k was arbitrary this in turn means that every domino will knock over the next one.
Proofs: A Long-Form Mathematics Textbook 111
Ok, so we have stated our assumption, and we wish to use it to prove that the
(k + 1)st step must also be true:5
(k + 1)((k + 1) + 1)
1 + 2 + 3 + · · · + (k + 1) = .
2
How do we do it?6 And how do we make use of the assumption that we know
what 1 + 2 + · · · + k is equal to? If I told you that 1 + 2 + · · · + 60 = 1830, and then
I asked you to tell me what 1 + 2 + · · · + 61 was equal to, what would you do? You
wouldn’t start at the beginning, you would simply take 1830 + 61 = 1891, and that’s
the answer! The same trick works here: The sum of the first k + 1 natural numbers
begins with the sum of the first k natural numbers:
1 + 2 + 3 + · · · + (k + 1) = 1 + 2 + 3 + · · · + k + (k + 1).
1 + 2 + 3 + · · · + (k + 1) = |1 + 2 + 3{z+ · · · + k} +(k + 1)
k(k+1)
= 2
, by induc. hyp.
(k + 1)(k + 2)
1 + 2 + 3 + · · · + k + (k + 1) = .
2
To do this, we begin with the expression the left, we apply the inductive hypothesis
to the sum of the first k numbers, and after three further steps of algebra we will
obtain the expression on the right. Indeed, by the inductive hypothesis we see that
k(k + 1)
1 + 2 + 3 + · · · + k + (k + 1) = + (k + 1).
2
k 2 + k 2(k + 1)
= +
2 2
k 2 + 3k + 2
=
2
(k + 1)(k + 2)
=
2
(k + 1)((k + 1) + 1)
= ,
2
as desired.
n(n+1)
Conclusion. Therefore, by induction, 1 + 2 + 3 + · · · + n = 2 for all n 2 N.
Sn = 1 + 2 + 3 + . . . + (n 2) + (n 1) + n,
Sn = n + (n 1) + (n 2) + . . . + 3 + 2 + 1,
since adding up the same n numbers in a different order does not change its sum.7
Next, look what happens when we add these two sums together:
Sn = 1 + 2 + 3 + . . . + (n 2) + (n 1) + n
Sn = n + (n 1) + (n 2) + . . . + 3 + 2 + 1
2Sn = (n + 1) + (n + 1) + (n + 1) + . . . + (n + 1) + (n + 1) + (n + 1)
7
Remarkable fact: It actually is important that we are only adding up finitely many numbers
here. If you are adding up infinitely many numbers, changing the order in which you add them can
change the result! Reference: real analysis.
Proofs: A Long-Form Mathematics Textbook 113
and hence
n(n + 1)
Sn = .
2
Neat!8 However, we should be a little careful here. When you see the ellipses
(the dot-dot-dots), there is implicitly an induction going on. I showed you 6 pairs
that added to n + 1 and just asserted that the other n 6 pairs will also add
to n + 1. Now, you might think that it’s clear that this pattern will continue and
all the terms will add up to n+1, but formally that leap should be proven by induction.
Using this formula for Sn and pushing these ideas farther, notice the following:
n Sn Sn + Sn+1
1 1 4
2 3 9
3 6 16
4 10 25
5 15 36
6 21 49
It sure looks like Sn + Sn+1 = (n + 1)2 . Neat! Let’s use induction to prove this
fact!
Proposition.
Proposition 4.3. Let Sn be the sum of the first n natural numbers. Then, for
any n 2 N,
Sn + Sn+1 = (n + 1)2 .
We will prove this proposition twice. The first proof is a direct proof, the second
will be by induction.
8
One of history’s most accomplished number theorists was Carl Friedrich Gauss. He passed
away in 1855, and the following year his biographer recorded a story which he says Gauss used
to tell late in his life. As the story goes, when Gauss was seven he was in arithmetic class and
his teacher told the class that he would give them a problem to solve; as soon as a student found
the answer, they were to place their slate on one of the tables. The problem was to find the sum
1 + 2 + 3 + · · · + 100. As his biographer wrote, “The problem was barely stated before Gauss
threw his slate on the table with the words (in the low Braunschweig dialect): ‘There it lies.’ ”
According to the elder Gauss, he solved it with a similar trick to what we discussed. His approach:
1 + 2 + 3 + · · · + 100 = (1 + 100) + (2 + 99) + (3 + 98) + · · · + (50 + 51) = 50 ⇥ (101) = 5050.
114 Chapter 4. Induction
And there you have it! Apply the previous proposition and do a little algebra
and it pops right out. But to practice induction, let’s prove it again.
Sk+1 = 1 + 2 + 3 + · · · + (k + 1)
= 1 + 2 + 3 + · · · + k + (k + 1)
= Sk + (k + 1).
Proofs: A Long-Form Mathematics Textbook 115
A quick note: For some proof techniques, adding a sentence at the end of your
proof is nice but not required. For induction, though, it really is required. You
can prove that the first domino will fall, and you can prove that each domino — if
fallen — will knock over the next domino, but why does this mean they all fall?
Because induction says so! Until you say “by induction. . . ” your work will not
officially prove the result.
We started this chapter by talking about how the sum of the first n odd natural
numbers is equal to n2 . We just now proved Proposition 4.4, which shows that
Sn + Sn+1 = (n + 1)2 . That is, Sn + Sn+1 is equal to the sum of the first n + 1 odd
natural numbers. So there should be some connection between Sn + Sn+1 and the
sum of odd numbers. See if you can find the connection on your own!
Proposition.
Proposition 4.4. For every n 2 N, the product of the first n odd natural
(2n)!
numbers equals n . That is,
2 n!
(2n)!
1 · 3 · 5 · . . . · (2n 1) = .
2n n!
Scratch Work. When presented with a problem like this, it is a good idea to
immediately do an example. This helps convince yourself that it is true, and also
might suggest a reason why it is true — hence suggesting a path to prove it. Below
we check it for n = 1, 2 and 3.
116 Chapter 4. Induction
(2 · 1)! 2! 2
• For n = 1, note that 1 = 1, and also 1
= = = 1. X
2 1! 2·1 2
(2 · 2)! 4! 24
• For n = 2, note that 1 · 3 = 3, and also 2
= = = 3. X
2 2! 4·2 8
(2 · 3)! 6! 720
• For n = 3, note that 1 · 3 · 5 = 15, and also
3
= = = 15. X
2 3! 8·6 48
As you can see, factorials quickly become large, and the numbers quickly become
hard to work with. Nevertheless, we we able to check the first few cases.
Now, to prove this by induction, we will need to show that the base case works,
and hey, what do you know, we just did — the first bullet point above is the base
case.
For the inductive hypothesis we will be assuming that, for some k 2 N,
(2k)!
1 · 3 · 5 · . . . · (2k . 1) =
2k k!
Our goal in the induction step we will be to show that
(2k + 1)!
1 · 3 · 5 · . . . · (2(k + 1) 1) = .
2k+1 (k
+ 1)!
Now, do you remember how in the last couple examples it was really beneficial to
note
1 + 2 + · · · + (k + 1)
is really
(1 + 2 + · · · + k) + (k + 1)?
That allowed us to apply the inductive hypothesis to turn knowledge about the k th
step into knowledge about the (k + 1)st step.
Is there a similar trick we can use here? Starting on the left side, how can we
write
1 · 3 · 5 · . . . · (2(k + 1) 1)
to include the penultimate term? Each term in the above is 2 bigger than the previous.
And 2(k + 1) 1 simplifies to 2k + 1. Thus, the above is the same as
1 · 3 · 5 · . . . · (2k 1) · (2k + 1)
What about the right side, with all the factorials? Notice that (k + 1)! is this:
(k + 1)! = 1 · 2 · . . . · (k + 1).
Right before that (k + 1) in the product must have been a k, and so
(k + 1)! = (1 · 2 · . . . · k) · (k + 1),
which you may notice means that (k + 1)! = k! · (k + 1). Likewise, (2k + 2)! =
(2k)! · (2k + 1) · (2k + 2). Finally, note that the 2k+1 term is just k + 1 copies of 2
multiplied together, and hence 2k+1 = 2k · 2. You see, with a little algebra we are
able to turn information about the (k + 1)st step into knowledge about the k th step.
Using this new knowledge, we can put together a proof.
Proofs: A Long-Form Mathematics Textbook 117
2!
1= ,
2 · (1!)
as desired.
(2k)!
1 · 3 · 5 · . . . · (2k 1) = .
2k k!
Induction Step. We aim to prove that the result holds for k + 1. That is, we wish to
show that
(2(k + 1))!
1 · 3 · 5 · . . . · (2(k + 1) 1) = k+1 .
2 (k + 1)!
Written slightly differently, we wish to show
(2k + 2)!
1 · 3 · 5 · . . . · (2k 1) · (2k + 1) = .
2k+1 (k
+ 1)!
To do this, we begin on the left side, and notice that the “1 · 3 · 5 · . . . · (2k 1)”
portion can be replaced by (2k)!
2k k!
, according to the inductive hypothesis. Indeed, by
doing this, and then some algebra, we can arrive at the right side.
(2k)!
1 · 3 · 5 · . . . · (2k 1) · (2k + 1) = · (2k + 1)
2k k!
(2k + 1)!
=
2k k!
(2k + 1)! · (2k + 2)
=
2k k! · (2k + 2)
(2k + 2)!
= k
2 k! · 2(k + 1)
(2k + 2)!
= k+1
,
2 (k + 1)!
as desired.
A Tiling Problem
Next up is another tiling problem, harking back to the very first pages of this book.
This time, though, we are not tiling with dominoes, we are tiling with – shaped
tiles:
118 Chapter 4. Induction
With a small board like a 4 ⇥ 4, trial and error (and thinking about the corners)
can get you pretty far, but for a 64 ⇥ 64 board — or a 2294 ⇥ 2294 board — it’s not so
easy. Nevertheless, induction will get us there.
Proofs: A Long-Form Mathematics Textbook 119
Proposition.
Proof Idea. Again, recall that the tiles cover three squares and look like this:
Since the proposition refers to something being true “for every n 2 N,” that’s a
pretty good indication that induction is the way to proceed. The base case (when
n = 1) will be fine. For the inductive hypothesis, we will be assuming that any
2k ⇥ 2k board, with one square removed, can be perfectly covered by – shaped tiles.
2k
2k
In the induction step we are going to consider a 2k+1 ⇥ 2k+1 board — a board
that is twice as big in each dimension — with one square missing.
2k+1
2k+1
As always, the biggest question we should ask ourselves is: “How are we going
to use the inductive hypothesis to prove this?” The inductive hypothesis deals with
120 Chapter 4. Induction
2k
2k+1
2k
2k 2k
2k+1
Now, one of these four 2k ⇥ 2k chessboards has a square removed, and hence by
the inductive hypothesis it can be perfectly covered by – shaped tiles. Perhaps like
this:
2k
2k+1
2k
2k 2k
2k+1
12
Since n + n = 2n, and 2a · 2b = 2a+b , we have 2k + 2k = 2 · 2k = 21 · 2k = 21+k = 2k+1 .
Proofs: A Long-Form Mathematics Textbook 121
But what about the other three 2k ⇥ 2k squares? They don’t have any squares
removed, so we can’t apply the inductive hypothesis to them. And if we picked a
random square from each to remove, then sure we could cover the rest, but those
three squares would be left uncovered by a tile.
2k
2k+1
2k
2k 2k
2k+1
The trick is to remember that the inductive hypothesis says that if any square
is removed, then a perfect covering exists. So we don’t have to imagine that the
squares are randomly chosen — we can choose them! For example, we could choose
these three squares:
2k
2k+1
2k
2k 2k
2k+1
122 Chapter 4. Induction
Then, two things happen at the same time. First, by the inductive hypothesis,
these three 2k ⇥ 2k squares be perfectly covered:
2k
2k+1
2k
2k 2k
2k+1
And second, those middle three squares that we crossed out can be covered by a
single tile:
2k
2k+1
2k
2k 2k
2k+1
And there it is!13 A tiling of the entire 2k+1 ⇥ 2k+1 board. Whew. Ok, that’s the
idea, now here’s the formal proof.
13
So cool that it made the cover.
Proofs: A Long-Form Mathematics Textbook 123
Base Case. The base case is when n = 1, and among the four possible squares that
one can remove from a 2 ⇥ 2 chessboard, each leaves a chessboard which can be
perfectly covered by a single – shaped tile:
! !
! !
Inductive Hypothesis. Let k 2 N, and assume that if any one square is removed from
a 2k ⇥ 2k chessboard, the result can be perfectly covered with – shaped tiles.
Induction Step. Consider a 2k+1 ⇥ 2k+1 chessboard with any one square removed.
Cut this chessboard in half vertically and horizontally to form four 2k ⇥2k chessboards.
One of these four will have a square removed and hence by the induction hypothesis
can be perfectly covered.
Next, place a single – shaped tile so that it covers one square from each of the
other three 2k ⇥ 2k chessboards, as shown in the picture below.
2k
2k
2k 2k
Note 4.6. So far, in all of our examples we proved that a statement holds from all
n 2 N. The base case was n = 1 and in the inductive hypothesis we assumed that
the result holds for some k 2 N.
There are times where one instead wants to prove that a statement holds for only
the natural numbers past some point. For example, it is possible to prove the p-test
by induction, a result that you might remember from your calculus class:
1
X 1
converges for all integers n 2.
in
i=1
To prove this result, the base case would be n = 2 and in the inductive hypothesis
we would assume that the result holds for some k in {2, 3, 4, 5, . . . }.
At other times, you may want to prove that a result holds for more than just the
natural numbers. For example, a result from combinatorics is that
X n ✓ ◆
n
= 2n holds for all integers n 0.
i
i=1
Here, the base case is n = 0, and the inductive hypothesis is the assumption that
this holds for some k in {0, 1, 2, 3, . . . }.
Principle.
For our first example, recall from Definition 2.16 that if n is an integer and n 2,
then n is either prime or composite. An integer p is prime if p 2 and its only
positive divisors are 1 and p. A positive integer n 2 that is not prime is called
composite, and is therefore one that can be written as n = st, where s and t are
integers smaller than n but larger than 1. And with that, it is time for a really big
and important result.
Theorem.
Proof Idea. The base case will be n = 2, which is prime and hence satisfies the
theorem. The inductive hypothesis will be that each of 2, 3, 4, . . . , k is either prime
or a product of primes. How do we prove that k + 1 is also prime or a product of
primes? Regular induction does not seem helpful at all here — if you know that k
is prime or a product of a couple primes, then that may tell you something useful
about, say, 2k or 3k. But what does it say about k + 1? Seemingly very little! This
is why regular induction is faltering. But as you’ll see, strong induction is just what
the doctor14 ordered.
Note that k + 1 is an integer larger than 1, and hence must be either prime or
composite (i.e., a product of primes). We will consider these two cases separately. If
k + 1 is prime, then that’s fantastic — it satisfies the theorem! What about if it is
composite? Being composite, that would mean k + 1 = st for some smaller numbers
s and t. Do you see why this is exactly what we need? By strong induction, both s
14
(of philosophy)
126 Chapter 4. Induction
and t will satisfy the theorem. And if s and t are both either prime or a product of
primes, their product will be too.
Here’s a quick summary:
If k + 1 is prime, then we’re done. Otherwise, k + 1 = st, and both s and t are in the
range of numbers covered by the inductive hypothesis.
And if s and t are both primes or products of primes, then so must be st, which is
k + 1. Ok, now here’s the proof.
Base Case. Our base case is when n = 2, and since 2 itself is prime, we are done.
Inductive Hypothesis. Let k be a natural number such that k 2, and assume that
each of the integers 2, 3, 4, . . . , k is either prime or a product of primes.
By the inductive hypothesis, s and t can both be written as a product of primes. Say,
s = p1 · p2 · · · pm and t = q1 · q2 · · · q`
k + 1 = st = (p1 · p2 · · · pm )(q1 · q2 · · · q` )
15
Note that if, say, s is prime, then m = 1 and the expression for s is simply s = p1 . So this
includes the cases in which s and/or t are prime.
Proofs: A Long-Form Mathematics Textbook 127
Conclusion. By strong induction, every positive integer larger than 2 can be written
as a product of primes.
Suppose you had a chocolate bar and you wanted to break it up completely, so
that each piece is only one square of chocolate. How many breaks will be required
to break it all up? To answer this question, there is another question we should ask
first: Does the answer depend on how you break it up? Is there an efficient way to
break it all up and a slow way to break it all up? Or will the answer be the same no
matter how you do it?
The rules are simple: No tricks. You can’t stack pieces to break them together
and only count that as one break. No tricky ways to hold many pieces at once. The
simplest way to think about it is that whenever you break a piece into two, you then
have to work on those two new pieces separately.
Start thinking about this on your own, and at least have a guess in mind of
whether the answer depends on how you do it, or whether all breaking sequences are
the same number of steps. And then, when you’re ready, here’s a very small example:
! !
! ! !
128 Chapter 4. Induction
Proposition.
Proof Sketch. The base case will deal with the 1 ⇥ 1 chocolate bar, and will work
out fine. So let’s turn our attention to the inductive hypothesis and the induction
step. The inductive hypothesis will say that all bars with at most k squares satisfy
the result, and we wish to prove that any chocolate bar with k + 1 squares satisfies
the result too.
Now, due to the fact that we are a grid of squares, thinking in terms of a single
variable k makes it more confusing. So instead we will phrase the problem in terms
of a grid. Instead of showing it is true for k + 1, where k + 1 is some m ⇥ n, for now
let’s talk about it in terms of that m ⇥ n.
16
Just to be safe, I recommend you go to the grocery store right now and buy lots of different-sized
chocolate bars and try this on your own. For science.
Proofs: A Long-Form Mathematics Textbook 129
With that perspective, our inductive hypothesis will be that all chocolate bars
with fewer than mn squares satisfies the proposition, and we will aim to prove that
the m ⇥ n chocolate bar satisfies the result.
Consider the first break of an m ⇥ n chocolate bar, which will break the bar into
two pieces. There are many ways to make this first break, but here’s one vertical
break:
Suppose the first of the two pieces has a squares and the second has b squares.
Since the original had mn squares, this means a + b = mn. Moreover, notice that
what we have essentially done is produce two new smaller rectangular chocolate bars!
In fact, since both of these have fewer than mn squares, we can apply the inductive
hypothesis to each of them! Here’s what that gives us: The bar with a squares can be
completely broken up with a 1 breaks, and the bar with b squares can be completely
broken up with b 1 breaks. Combined, this tells us how many breaks it takes for
the original bar.
Before we write out the formal proof, notice that we really do need strong
induction. With regular induction, when proving the (k + 1)st case you are only
permitted to use the previous case — the k th case. If breaking apart a bar with (k + 1)
squares was guaranteed to produce a bar with k squares, then you could use regular
induction — but this is not the case. Typically, the first break produces two bars
which have fewer than k pieces, and thus we need strong induction.17
Base Case. Our base case is for a chocolate bar with just 1 square; the only bar like
this is the 1 ⇥ 1 bar. And the number of breaks required to break the 1 ⇥ 1 bar into
individual squares is clearly 0, as it is already an individual square. This satisfies the
result, as 0 = 1 · 1 1 is one less than the number of squares in the bar.
Inductive Hypothesis. Let k 2 N, and assume that all bars with at most k squares
satisfy the proposition.
17
Go hit the gym regular-induction, we need some up in here.
130 Chapter 4. Induction
Induction Step. Consider now any chocolate bar with k + 1 squares;18 suppose this
bar has dimensions m ⇥ n. Any sequence of breaks begins with a first break which
breaks the bar into two smaller bars. Consider an arbitrary first break, and suppose
the two smaller bars have a squares and b squares, respectively. Note that we must
have a + b = mn, because the number of squares in the smaller bars must add up to
the number of squares in the original m ⇥ n bar.
By the inductive hypothesis, the bar with a squares will require a 1 breaks to
completely break it up, and the bar with b breaks will require b 1 breaks. Therefore,
to break up the m ⇥ n bar, we must make a first break, followed by (a 1) + (b 1)
additional breaks. The total number of breaks is then
1 + (a 1) + (b 1) = (a + b) 1 = mn 1.
And mn 1 is indeed one less than the number of squares in the m ⇥ n bar.
Conclusion. By strong induction, a chocolate bar of any size requires one break less
than its number of squares to break it up into individual squares.
When you prove a result, it is good practice to ask yourself, “were all the
assumptions in the problem necessary?” Proposition 4.10 assumed that the bar was
an m ⇥ n grid of squares, and then concluded that mn 1 breaks were needed. Said
differently, the number of breaks was 1 less than the number of squares.
What if the pieces were in the shape of a triangle? If it had T squares would it
still require T 1 breaks?
What about other shapes? What if there are pieces missing in the middle?
Interestingly, the answer is T 1 no matter the bar’s shape, and even if pieces are
missing! As long as each of your “breaks” divides one chunk into two, that’s the
answer.
Here is some intuition for that: No matter the shape, the bar starts out as a
single “chunk” of chocolate, and after your sequence of breaks the bar is broken into
T chunks of chocolate — the T individual squares. How many breaks does it take to
move from 1 chunk to T chunks? Notice that every break increases the number of
chunks by 1. So after 1 break, there will be 2 chunks. After 2 breaks, there will be 3
chunks. And so on. Thus, after T 1 breaks there will be T chunks, which is why
T 1 breaks is guaranteed to be the answer, no matter which shape you started with.
18
By the way, note that there could be many different bars with k + 1 squares, but there is
guaranteed to be at least one: the bar with dimensions (k + 1) ⇥ 1.
Proofs: A Long-Form Mathematics Textbook 131
In the same way, if each step relies on the previous three steps, then you must
prove three base cases. If each step relies on the previous four, then you must prove
four bases cases. And so on. But let’s not get too crazy, below is an example relying
on just two base cases.
Proposition.
Scratch Work. First, note that this proposition is asserts that this property holds
for n = 11, 12, 13, 14, . . . . Since the process starts at n = 11, this will be a base
case. So will have to find an a, b 2 N for which 11 = 2a + 5b. I think a = 3 and b = 1
works. But again, just to get our feet wet, let’s write out the first few cases. There
are at times multiple ways of doing so, but remember that a, b 2 N, so they can’t be
negative or zero.
132 Chapter 4. Induction
• 11 = 2 · 3 + 5 · 1 • 13 = 2 · 4 + 5 · 1 • 15 = 2 · 5 + 5 · 1
• 12 = 2 · 1 + 5 · 2 • 14 = 2 · 2 + 5 · 2 • 16 = 2 · 3 + 5 · 2
Writing out some examples is often the best way to discover a proof. Do you
see anything interesting about the numbers? In particular, do you see a pattern
between the n = 11, 13 and 15 cases? And perhaps you can spot a pattern between
the n = 12, 14 and 16 cases?
To move from the n = 13 case to the n = 15 case, for example. . . all you need is
an extra 2! So 2 · 4 + 5 · 1 simply turns into 2 · 5 + 5 · 1, and that’s it! This is how
we will prove it. Each case replies on two cases back. How do you show that there
is a way to write (k + 1) in this way? Well, by the inductive hypothesis for strong
induction, it is possible to write (k 1) in such a way, and now you just tack on
another 2. Let’s do it.
Base Cases. In the induction step we will need two cases prior, so we show two base
cases here: n = 11 and n = 12. Both of these can be written as asserted:
11 = 2 · 3 + 5 · 1
12 = 2 · 1 + 5 · 2.
Inductive Hypothesis. Assume that for some integer k 12, the results holds for
Induction Step. We aim to prove the result for k + 1. By the inductive hypothesis,
k 1 = 2a + 5b
k + 1 = 2(a + 1) + 5b.
To close out this section, I will note that while there are many instances where
regular induction is not enough and strong induction is needed, you will discover that
regular induction comes up far more often than strong induction — usually the k th
case is enough to prove the (k + 1)st case. And the most common instances in which
you need strong induction are one like the above, where you need a fixed number of
prior cases to prove the next.
Proofs: A Long-Form Mathematics Textbook 133
4.4 Non-Examples
What if instead of doing induction properly, you make only a teeny-tiny mistake
that’s super hard to notice? Then what could we prove? Lots of things! Behold, a
fun non-example!
Fake Proposition.
Fake Proof. We will consider groups of n people at a time, and by induction we will
“prove” that for every n 2 N, every group of n people must have everyone with the
same name.
Base Case. If n = 1, then of course everyone in the group has the same name, since
there’s only one person in the group!
Inductive Hypothesis. Let k 2 N, and assume that any group of k people all have
the same name.
k + 1 people
But notice that we can look at the first k of these people and then the last k of
these people, and to each of these groups we can apply the inductive hypothesis:
And the only way that this can all happen, is if all k + 1 people have the same name.
Conclusion. This “proves” by induction that for every n 2 N, every group of n people
must have the same name. So if you let n be equal to the number of people on Earth,
this “proves” that everyone has the same name.
This is, of course, flawed somewhere. To find the mistake, think about how the
above argument moves from the n = 1 case to the n = 2 case. . . Exercise 4.10 asks
for an explanation of the error.
Let’s do one more. In calculus you probably learned that the harmonic series
diverges. That is,
1 1 1
1 + + + + · · · = 1.
2 3 4
You may have learned this on its own, or perhaps within the discussion of the series
p-test. And your calc professor did not lie to you — what you learned was completely
true, so only a Fake Proof could assert otherwise. See if the Fake Proof below does
the job.
Fake Proposition.
1 1 1
1+ + + + · · · < 1,
2 3 4
Once again, this is flawed somewhere. To find the mistake, think about what
conclusion is actually being reached by the first three stages of this proof. . . Exercise
4.11 asks for an explanation of the error.
Lemma.
1 + 2 + 4 + 8 + · · · + 2n = 2n+1 1.
Scratch Work. Let’s do some examples to convince ourselves that this seems true.
1 = 21 1 X
1+2=2 2
1 X
1 + 2 + 4 = 23 1 X
1+2+4+8=2 4
1 X
Seems to check out! The inductive hypothesis will be 1+2+4+8+· · ·+2k = 2k+1 1.
See if you can see a way to use this to prove that 1 + 2 + 4 + 8 + · · · + 2k+1 = 2k+2 1,
which is the induction step. Then check out the proof below.
1 = 20+1 1,
136 Chapter 4. Induction
as desired.
1 + 2 + 4 + 8 + · · · + 2k = 2k+1 1.
Induction Step. We aim to prove that the result holds for k + 1. That is, we wish to
show that
1 + 2 + 4 + 8 + · · · + 2k+1 = 2(k+1)+1 1.
Written slightly differently, we wish to show
(2k + 2)!
1 · 3 · 5 · . . . · (2k 1) · (2k + 1) = .
2k+1 (k + 1)!
Starting with the inductive hypothesis, we can add 2k+1 to both sides, and then
do a little algebra, to get
as desired.
Our next bonus example deals with these same powers of 2. Just to be clear: by
powers of 2 we mean 20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, and so on. These are
important when discussing a number’s binary representation. A number like 11 can
be represented by sums of powers of 2 like this:
12 = 1 · 8 + 0 · 4 + 1 · 2 + 1 · 1.
This written in binary as 1011, representing how many 8s, 4s, 2s, and 1s you need. In
fact, every n 2 N0 can be represented in binary using only 0s and 1s, and moreover
this representation is unique. That is, every n 2 N0 can be represented in precisely
one way as a sum of distinct powers of 2. Here are the first representations; check
them each on your own.
• 0!0 • 3 ! 11 • 7 ! 111
• 2 ! 10 • 6 ! 110 • 9 ! 1001
Let’s now use strong induction to prove that every n 2 N has a unique binary
representation.
Proofs: A Long-Form Mathematics Textbook 137
Theorem.
Once you include 0 as the binary representation of 0, this theorem also tells us
that every n 2 N0 has a unique binary representation.
Base Case. Our base case is when n = 1. Note that 1 can be written as 20 , and this
is only way to write 1 as a sum of distinct powers of 2, because all other powers of 2
are larger than 1.
Inductive Hypothesis. Let k 2 N, and assume that each of the integers 1, 2, 3,. . . , k
can be expressed as a sum of distinct powers of 2 in precisely one way.
Induction Step. We now aim to show that k + 1 can be expressed as a sum of distinct
powers of 2 in precisely one way.
Let 2m be the largest power of 2 such that 2m k + 1. We now consider two
cases: the first is if 2m = k + 1, and the second is if 2m < k + 1.
Next, let’s use induction to provide a second proof of Fermat’s little theorem,
in the case that a 2 N. The proof is going to rely on a theorem we have not yet
discussed called the binomial theorem, but which you may have seen in some form in
an earlier course.
Theorem.
✓ ◆
n n!
Here, when n m, the binomial coefficient is defined to be ,
m m!(n m)!
which one can show is always 19
✓ ◆ an integer. The binomial coefficients can also be
n
defined combinatorially: is equal to the number of ways to choose m elements
m ✓ ◆ ✓ ◆
n 4
from an n-element set; in fact, is read “n choose m.” For example, =6
m 2
because there are six subsets of the set {1, 2, 3, 4} containing two elements:
Binomial coefficients can be computed iteratively using Pascal’s rule, which says
that ✓ ◆ ✓ ◆ ✓ ◆
n n 1 n 1
= + ,
r r 1 r
✓ ◆ ✓ ◆
n n
as well as the fact that = 1 and = 1 for all n 2 N0 .
0 n
A beautiful way to combine these facts is called Pascal’s triangle:
0
0 1
1 1
0 1 1 1
2 2 2
0 1 2 1 2 1
3
0
3
1
3
2
3
3 = 1 3 3 1
4 4 4 4 4
0 1 2 3 4 1 4 6 4 1
5 5 5 5 5 5
0 1 2 3 4 5 1 5 10 10 5 1
19
Note: We define 0! to be equal to 1.
Proofs: A Long-Form Mathematics Textbook 139
Indeed, we can even prove the binomial theorem by induction, by making use of
Pascal’s rule. Here is a sketch of that proof:
Proof Sketch. The base case is when n = 0, and indeed (x + y)0 = 1. The next
couple cases are more interesting, and you can check that (x + y)1 = x + y and
(x + y)2 = x2 + 2xy + y 2 do indeed match the theorem. The inductive hypothesis
will be
✓ ◆ ✓ ◆ ✓ ◆
k k k k 1 k k 2 2 k
(x + y) = x + x y+ x y + ··· + xy k 1 + y k .
1 2 k 1
For the induction step, we perform easy algebra, then apply the inductive hy-
pothesis, then perform hard algebra, then apply Pascal’s rule:
(x + y)k+1
= (x + y)(x + y)k
✓ ◆ ✓ ◆ ✓ ◆
k k k 1 k k 2 2 k
= (x + y) · x + x y+ x y + ··· + xy k 1 + y k
1 2 k 1
✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆
k+1 k k k k k
=x + + x y+ + xk 1 y 2
0 1 1 2
✓ ◆ ✓ ◆
k k
+ ··· + + xy k + y k+1
k 1 k
✓ ◆ ✓ ◆ ✓ ◆
k+1 k+1 k k+1 k 1 2 k+1
=x + x y+ x y + ··· + xy k + y k+1 .
1 2 k
The binomial theorem tells us that in order to expand (x + y)5 you can just look
at the 5th row of Pascal’s triangle (where the top element counts as the 0th row, so
the 5th row is 1 5 10 10 5 1):
Moreover, by plugging in special values for x and y, all sorts of neat identities pop
out. There are loads of examples of this,20 but here are just three:
Xn ✓ ◆
n n
• By plugging in x = 1, y = 1, we prove 2 = .
k
k=0
n ✓ ◆
X
n n
• By plugging in x = 2, y = 1, we prove 3 = 2k .
k
k=0
n
X ✓ ◆
n
• By plugging in x = 1, y = 1, we prove 0 = ( 1)k .
k
k=0
20
“A theorem that launched a thousand corollaries!”
140 Chapter 4. Induction
But let’s move on to the main event. The binomial theorem is a means to provide
a second proof of (the positive case of) Fermat’s little theorem, which we first discussed
while studying modular arithmetic in Chapter 2. Here was that theorem, written
just slightly differently by multiplying each side of the congruence by a, which can
also be undone by using the cancellation law (Proposition 2.18).
Theorem.
ap ⌘ a (mod p).
ap = 1p
=1
⌘ a (mod p),
as needed.
k p ⌘ k (mod p).
Induction Step. We aim to prove that (k + 1)p ⌘ k + 1 (mod p). To do this, we make
use of the binomial theorem, which says that
✓ ◆ ✓ ◆ ✓ ◆
p p p p 1 p p 2 p
(k + 1) = k + k + k + ··· + k + 1.
1 2 p 1
Next, note that kp = k!(pp! k)! is an integer where the numerator is divisible by p
but the denominator is not (since the denominator is a product of numbers smaller
than p). Therefore, every term except for the first and the last is congruent to 0
(mod p). That is,
✓ ◆ ✓ ◆ ✓ ◆
p p p p 1 p p 2 p
(k + 1) ⌘ k + k + k + ··· + k + 1 (mod p)
1 2 p 1
⌘ k p + 0 + 0 + · · · + 0 + 1 (mod p)
⌘ k p + 1 (mod p)
⌘ k + 1 (mod p),
Proofs: A Long-Form Mathematics Textbook 141
where in the final step we used that k p ⌘ k (mod p), which was given to us buy our
inductive hypothesis. We have successfully shown that (k + 1)p ⌘ k + 1 (mod p),
completing the induction step.
Conclusion. Therefore, for any fixed p we have shown that, by induction, Fermat’s
little theorem holds for all a 2 N. And since p was arbitrary, this theorem holds for
any prime p.
We just proved Fermat’s little theorem in the case that a 2 N, but in Chapter 2
we proved that the theorem applies to any a 2 Z. The a = 0 case is clear enough,
but does the theorem for a 2 N imply the theorem for negative integers?
If p is an odd prime (meaning, p 6= 2), then by multiplying both sides by 1 we
can turn ap ⌘ a (mod p) into ap ⌘ a (mod p), and because p is odd this means
( a)p ⌘ a (mod p), showing that the negative case is satisfied when p is an odd
prime.
What about if p = 2? Here, things are even simpler. If p = 2, then observe
that 1 ⌘ 1 (mod p), and so having a negative sign or not makes no difference. So
ap ⌘ a (mod p) is the same as ap ⌘ a (mod p). And because a2 = ( a)2 by basic
algebra, ap ⌘ a (mod p) is the same as ( a)p ⌘ a (mod p), showing that the
negative case is satisfied when p = 2.
Thus, with a little more work, our induction proof could quickly be amended to
account for the general a 2 Z case.
Mantel’s Theorem
As a final example, here is an important result from graph theory21 called Mantel’s
theorem. It is best phrased in terms of graphs with an even number of vertices, so
we will refer to the number of vertices as 2n. The question is how many edges must
we have in order to guarantee that the graph contains a triangle (three vertices for
which the three possible edges between them are all present). For example, here is a
graph with 4 vertices, 4 edges, and which contains a triangle.
• •
• •
However, having 4 vertices and 4 edges does not guarantee a triangle, because
the following is a graph with these statistics which does not have a triangle.
21
Please review the short introduction to graphs on pages 21 and 23 if the idea of a graph, vertex
and edge are unclear.
142 Chapter 4. Induction
• •
• •
However, it turns out that with 4 vertices and 5 edges, a triangle cannot be
avoided. A proof sketch of this: With four vertices, the maximum number of edges is
6, so with 5 edges there can only be one missing edge. So you could just draw all
six options and note that each one contains a triangle. Or you could note this: By
symmetry, removing any one edge essentially results in the same graph as if you had
removed any other edge. So the picture is essentially always this:
• •
• •
For a general graph with 2n vertices, how many edges are needed to guarantee a
triangle? The complete bipartite graph is the graph with 2n vertices which is best
drawn by placing n vertices on the left, n vertices on the right, and drawing in
all possible edges from the left to the right — but adding no edge between any two
vertices on the left, or any two on the right. For example, here is the complete
bipartite graph on 8 vertices:
• •
• •
• •
• •
Theorem.
Inductive Hypothesis. Let k 2 N, and assume that every graph on 2k vertices and
k 2 + 1 edges contains a triangle.
Induction Step. We aim to prove that every graph on 2(k +1) vertices and (k +1)2 +1
edges contains a triangle. Among our 2k + 2 vertices, choose any two which are
connected by an edge, and call these u and v. The other 2k vertices form a graph of
their own (let’s call this graph H), with a certain number of edges going between
these vertices.
u v
• •
This
2k vertices
is H
This • •
is H •
If this happens, we are done! We have found our triangle! What if there are not
k 2 + 1 edges among these 2k vertices? Then there are at most k 2 edges down there.
We had assumed our graph contained (k + 1)2 + 1 edges, so there must be
(k + 1)2 + 1 k 2 = 2k + 2
This • • •
is H • w
— Chapter 4 Pro-Tips —
• While it is common at this point of your math journey to carefully label your
base case, inductive hypothesis, induction step and conclusion, you’ll notice
that in later courses that some of these habits will be relaxed. And in a math
research paper you would never see “Inductive Hypothesis” and such. In fact,
it’s even the case that in math papers for which the base case is trivial, that
the base case isn’t even mentioned. I am aware of one very good combinatorics
researcher, who has used induction in a lot of his papers, and who told me once
that it is always his goal to set up his induction just right so that the base
case is vacuously true — not even trivially true, he aims for vacuously true each
time.23 I imagine that getting that just right each time is more effort than
simply working out his base cases. . . but I very much respect his conviction.
• If your induction step makes use of the previous two cases, then you need two
base cases to get the induction going. For example, the Fibonacci sequence24
is based on the previous two cases: Fn = Fn 1 + Fn 2 . Therefore, a proof by
induction involving a property about Fn often requires you to demonstrate both
F1 and F2 in your base case(s). Likewise, if your induction explicitly makes
use of the previous three cases, then you must establish three base cases. And
so on.
– If a theorem holds for every n 2 Z, then you may have to perform two
inductions: One for the positive values and one for the negative values.
For instance, if you prove that S0 holds, and you prove that Sk ) Sk+1
for every k 2 {0, 1, 2, 3 . . . }, and you prove that Sk ) Sk 1 for every
k 2 {0, 1, 2, 3, . . . }, then combined this would prove that Sn holds
for every n 2 Z.
– There is a fascinating extension of induction called transfinite induction.
One of its early successes was in 1904 when Ernst Zermelo proved that
every set can be well-ordered, which is one of the really cool results that
every mathematician should know. Go look it up! (Its statement may
read a little confusing at this point in your math career. . . but that will
serve as motivation to take more math courses!)
– Suppose you want to prove something only for all n 2 {1, 2, 3, . . . , 100}.
Can you still use induction? You can! Your base case would be n = 1,
in your inductive hypothesis you would assume the result for any k 2
{1, 2, 3, . . . , 99}, and then in your induction step you would show that
Sk ) Sk+1 . In this way, induction can also be used to prove a result in
finitely many cases.
23
As a reminder of what it means to be vacuously true, see Footnote 5 on page 77
24
See the Introduction to Sequences starting on page ?? for more.
146 Chapter 4. Induction
Why did this work? How could we have failed to prove something easier,
and then did the exact same thing with a harder problem and succeeded? It
comes down to the inductive hypothesis; proving a harder result allows us to
assume more in the inductive hypothesis, which was needed in the induction
step. There are other examples of this in mathematics, and it’s certainly not
limited to proofs by induction. Sometimes adding additional criteria can help
you see what’s really going on.
By the way, this result also implies that the infinite version of this sum,
X1
1
, must also be at most 2. But what does it equal? At age 24, the great
`2
`=1
Leonhard Euler proved the remarkable answer:
1
X 1 ⇡2
= .
`2 6
`=1
148 Chapter 4. Induction
— Exercises —
Exercise 4.1. Prove that the sum of the first n odd natural numbers equals n2
by induction or strong induction.
Exercise 4.3. Use induction or strong induction to prove that the following hold
for every n 2 N.
Exercise 4.4. Prove that each of the following hold for every n 2 N.
n(n + 1)(2n + 1)
(a) 12 + 22 + 32 + · · · + n2 =
6
n2 (n + 1)2
(b) 13 + 23 + 33 + · · · + n3 =
4
n(n + 1)(n + 2)
(c) 1 · 2 + 2 · 3 + 3 · 4 + · · · + n · (n + 1) =
3
n(n + 1)(2n + 7)
(d) 1 · 3 + 2 · 4 + 3 · 5 + · · · + n · (n + 2) =
6
(e) 13 + 23 + 33 + · · · + n3 = (1 + 2 + 3 + · · · + n)2
(f) 1 · 1! + 2 · 2! + 3 · 3! + · · · + n · n! = (n + 1)! 1
(g) 20 + 21 + 22 + 23 + · · · + 2n = 2n+1 1
3n+1 3
(h) 31 + 32 + 33 + · · · + 3n =
2
4n+1 1
(i) 40 + 41 + 42 + 43 + · · · + 4n =
3
1 2 3 n 1
(j) + + + ··· + =1
2! 3! 4! (n + 1)! (n + 1)!
1 1 1 1 n
(k) + + + ··· + =
1·2 2·3 3·4 n · (n + 1) n+1
Proofs: A Long-Form Mathematics Textbook 149
Exercise 4.5. Prove that each of the following hold for every n 2 N.
(a) n + 2 < 4n2
1 1 1 1 p
(b) p + p + p + · · · + p 2 n 1
1 2 3 n
1 1 1 1 1 1 1 n
(c) + + + + + ··· + + n + n 1+
1 2 3 4 5 2 1 2 2
(d) 2n 2n+1 2n 1
1
(e) 3n 1 + 2n
Exercise 4.9. If your friend Lexi asked you to explain the difference between
deductive reasoning and inductive reasoning, what would you tell her? Feel free to
look up definitions online before writing your explanation.
Exercise 4.10. Explain the error in the “proof” of Fake Proposition 4.11.
Exercise 4.11. Explain the error in the “proof” of Fake Proposition 4.12.
where n 2 N. Then, prove that your formula works in two different ways. First, by
using Proposition 4.2. Second, by induction.
150 Chapter 4. Induction
m + (m + 1) + (m + 2) + · · · + n,
where n 2 N. Then, prove that your formula works in two different ways. First, by
using Proposition 4.2. Second, by induction.
p | (a1 · a2 · a3 · . . . · an ),
Exercise 4.16. Use induction to prove that if A is a set and |A| = n, then
|P(A)| = 2n .
1 + nx (1 + x)n .
1 + nx (1 + x)n .
Exercise 4.19. Prove that, for every n 2 N, there are n distinct natural numbers
a1 , a2 , . . . , an such that a21 + a22 + · · · + a2n is a perfect square.
13 = 1 · 23 + 1 · 22 + 0 · 21 + 1 · 20 .
n = a k · 2k + a k 1 · 2k 1
+ · · · + a2 · 22 + a1 · 21 + a0 · 20 .
Exercise 4.22. Where is the mistake in the following “fake proof” that 2n = 0
for all n 2 {0, 1, 2, 3, 4, . . . }?
Fake Proof. The base case is when n = 0, and indeed 2n = 2(0) = 0, as desired,
when n = 0.
Since we are using strong induction, our inductive hypothesis is the assumption
that 2m = 0 for all m 2 {0, 1, 2, . . . , k}, and we wish to show that 2(k + 1) = 0.
In the induction step, we choose to write k + 1 = a + b for some smaller a and b
from {0, 1, 2, . . . , k}. For example, you could use a = k and b = 1, or you could use
any other a and b that work; this is just like in the proof of Proposition 4.10, where
we broke up a chocolate bar with k + 1 pieces into two parts, containing a and b
pieces, respectively. But no matter how you break it up, since a and b are smaller,
the inductive hypothesis tells us that 2a = 0 and 2b = 0, and hence
2(k + 1) = 2(a + b) = 2a + 2b = 0 + 0 = 0.
Exercise 4.23.
(a) Suppose that n 2 N, p is a prime and ai 2 Z for all i. Prove that if
p | (a1 a2 a3 · · · an ),
(b) In Theorem 4.8 we proved the fundamental theorem of arithmetic. Prove that if
n 2 is an integer, then it has a unique prime factorization in the sense that if
n = p1 p2 · · · p k and n = q1 q2 · · · q`
where each pi and qj is a prime, then there are the same number of primes in
each list (k = `) and in fact the primes p1 , p2 , . . . , pk are the same as the primes
q1 , q2 , . . . , q` , perhaps just in a different order.
Exercise 4.24. In this exercise you will use strong induction to study sequences
which are defined recursively.
Exercise 4.25. Prove that for any natural numbers a and b, there exists a natural
number m such that mb > a. This is a version of the so-called Archimedean principle.
Prove that the remaining 4n 1 triangles can be perfectly covered using tiles of this
shape: . As usual, you are allowed to rotate (and flip) these tiles as you please.
Also, just to be clear, these tiles will be properly sized for each n, so that they cover
three triangles. For n = 1, a single tile will cover all of the non-removed squares, and
for n = 2 you will need five tiles.
Exercise 4.27. Let P be any polygon in the plane. Prove that it is possible to
divide P into triangles, all of whose vertices are vertices of P . For example:
Exercise 4.28. A magic square is an n ⇥ n matrix where the sum of the entries
in each row, column and diagonal equal the same value. For example,
8 1 6
3 5 7
4 9 2
is a 3 ⇥ 3 matrix whose three rows, three columns, and two diagonals each sum
to 15. Thus, this is a magic square.
An antimagic square is an n ⇥ n matrix where each row, column and diagonal
sums to a distinct value. For example,
Proofs: A Long-Form Mathematics Textbook 153
9 4 5
10 3 -2
6 9 7
is a 3 ⇥ 3 matrix whose rows sum to 18, 11 and 22, columns sum to 25, 16 and 10,
and diagonals sum to 19 and 14. Notice that all eight of these numbers is different
that the rest, showing that this is an antimagic square.
Prove that, for every integer n 2, there exists an n ⇥ n antimagic square all of
whose entires are positive integers.
Exercise 4.29. In chess, a rook attacks all the squares in its row and column.
Consider the problem of placing n non-attacking rooks on an n ⇥ n chessboard; that
is, n rooks such that none attack any other. One way to do this is to place the rooks
on a single diagonal.
But that’s boring. Prove that for every n 4, it is possible to place n rooks on
the n ⇥ n chessboard so that none of the rooks are on either (or both) of the two
diagonals.
Exercise 4.30. Read the introduction to graphs on Page 22. A graph is called a
tree if it can be drawn so that it branches upwards and none of its branches intersect.
Here are two examples:
Exercise 4.31. Read the Introduction to Sequences following this chapter, and
prove the following hold for every n 2 N.
(a) F1 + F2 + F3 + · · · + Fn = Fn+2 1
154 Chapter 4. Induction
It is common for Chapter 1 of an intro to proofs book to be on logic, and for good
reason: Proofs rely entirely on logic. I decided to move it later for a few reasons.
First, the logic needed to begin discussion on the pigeonhole principle, direct proofs
and induction is not sophisticated, and you all mastered it naturally years ago. The
logic thus far has been about 60% common sense and 30% hard work.1 The problem
is that when you first learn formal logic, it is really easy to get confused. When you
come through the other side things will feel a lot more natural than when you’re
in the middle of it, but while you’re in the midst, it is easy to lose track of your
intuition.
Plus, advanced logic is legitimately weird. It is hard to grasp and requires really
careful thinking. The great logician Bertrand Russell defined research-level logic as
“The subject in which nobody knows what one is talking about, nor whether what
one is saying is true.” But fear not, we will not venture too far off the beaten path.
Mathematical proofs are tough to learn, but one of your best tools is your natural
intuition and ingenuity. I feared that starting with logic before you’d ever seen a
proof would send the wrong message — that you need to start warping your mind in
order to reason through a proof. You don’t! You have now proven dozens of results
without any fancy logic, and make sure not to lose that. Formal logic will teach us
some necessary things, and will open the door to some fundamental proof techniques,
but your natural logic will still be far more important than anything we cover here,
and your intuition is indispensable.
5.1 Statements
Logic is the process of deducing information correctly — it is not the process of
deducing correct information. For example,
1. Socrates is a Martian
2. Martians live on Pluto
3. Therefore, Socrates lives on Pluto
. . . is logically correct, even though all three statements are false. And if I said
“Socrates is a Martian and Martians live on Pluto, therefore 2 + 2 = 4,” then what I
1
The other half is intelligence.
155
156 Chapter 5. Logic
said was logically incorrect, even though the conclusion is correct.2 In mathematics,
we state axioms and then use logic to prove the necessary consequences of those
axioms. Mathematicians search for some form of truth, but don’t confuse correct
logic for correct information, and this chapter focuses on the logic.
Statements
The building blocks of logic are statements. We have used this term many times in
this book (including in the previous paragraph), but let’s formally define them now.
Definition.
9. x + 7
7. 8 + 9
10. Are polynomials
8. Q
differentiable?
The last one is a question — its answer is yes or no, not true or false. Also, whenever
a sentence is ambiguous, it is not a statement.3 Note also:
1. x + 7 = 12 3. f is continuous
2. 3 | x 4. x is even
For number 2, this open sentence is true if x = 6, but false if x = 8. For number
3, this open sentence is true if f (t) = t2 , but false if f (t) = 1/t (with domains of R
and R \ {0}).
Note, though, that simply using unknowns does not mean something is an open
sentence; an open sentence must not only use unknowns, but also have no truth value.
So, “for each x 2 R, we have x x = 0” is a (true) statement, while “x + x = 2” is an
open sentence (true when x = 1, false otherwise). Indeed, as you were told years ago,
the Pythagorean theorem is true and hence is a statement, even though it contains
variables and the equation a2 + b2 = c2 at the end.
Typically, we use capital letters for statements, like P, Q and R. Open sentences
are often written the same, or perhaps like P (x), Q(x) or R(x) when one wishes to
emphasize the variable. Below is some notation that is used often in logic, which
turn one or more statements into a single new statement.
Notation.
1. P ^ Q means “P and Q”
3. ⇠P means “not P ”
4
Reminder: In math, ‘or’ is always an inclusive or, as compared to an exclusive or. An ‘exclusive
or’ means that one or the other is true, but not both, like “The light is on or off.” Meanwhile, an
‘inclusive or’ allows the possibility that both are true; in everyday language, people sometimes say
“and/or” to emphasize that they mean an inclusive or. Notice that Lemma 2.17 part (iii) would be
false if math used an ‘exclusive or’. For example, if p = 5, a = 10 and b = 15, then p | ab, but it’s
not true that p only divides one of the two — it divides both!
158 Chapter 5. Logic
Again, if P and Q are statements, then P ^Q and P _Q and ⇠P are all statements
too. (This is like saying, if x and y are integers, then x + y is an integer too. Sure,
2 + 3 is a sum of integers, but it also equals 5, which is an integer in its own right.)
Let’s do some examples.
Example 5.5. Consider the following statements:
Then,
If a mom tells her son “in order to go out, you must do the dishes and take out
the trash,” then the son better do both. If instead she said “in order to go out, you
must do the dishes or take out the trash,” then the son can do either (or can do
both!) and he would be allowed to go out. Now, let’s talk implications.
Notation.
1. P ) Q means “P implies Q”
our propositions and theorems are of the form P ) Q. For example, “If n is odd,
then n2 is odd” is a (true) statement. In this way, not only are P ^ Q and P _ Q ways
to turn a pair of statements into a new statement, but P ) Q and P , Q are too.
Let’s now discuss a subtle aspect of implications: Translating them to and from
English. Language can be complicated,8 and we in fact have many different ways in
English to say “P implies Q.” Here are some more:
For example, “If it raining, then the grass is wet” has the same meaning as “The grass
is wet if it is raining.” These also mean the same as “The grass is wet whenever it is
raining” or “For the grass to be wet, it is sufficient that it is raining.”
Next, here are some ways to say “P if and only if Q”:9
• P is equivalent to Q • Symbolically: (P ) Q) ^ (Q ) P )
Note that if we used our wet grass and rainy weather example from before, then
these would all be false statements. This is because having wet grass does not imply
it is raining — perhaps the sprinkler is on, or there is an awesome water balloon fight
going down. To find an example where all the statements are true, we need to find
statements P and Q which are equivalent — each implies the other.
For example, suppose that Jessica wears sunglasses whenever it is sunny, and
never wears them when it is not sunny. That is, if it is sunny out, then Jessica
wears sunglasses; and if Jessica wears sunglasses, then it is sunny out. This means
that “Jessica wears sunglasses if and only if it is sunny out.” This also means that
“Jessica wearing sunglasses is a necessary and sufficient condition for it to be sunny,”
8
Or “rich,” if you’re a linguist.
9
And for each of these, you can also switch ‘P ’ and ‘Q’ around. For example, “Q is a necessary
and sufficient condition for P ” is another way.
10
More shorthand, in case you need it:
. if = if
. iff = if and only if
. ifff = iff and only iff = if and only if and only if and only if
. iffff = ifff and only ifff = iff and only iff and only iff and only iff = if and only if and only if and
only if and only if and only if and only if and only if
. etcetera etcetera etcetera
160 Chapter 5. Logic
• P )Q • P only if Q
be the
Should • If P , then Q
same as
or ?
• Q if P • Q only if P
The answer is “P only if Q”, and the way to think about it is that “P implies Q”
means that whenever P is true, Q must also be true. And “P only if Q” means that
P can only be true if Q is true. . . that is, whenever P is true, it must be the case that
Q is also true. . . that is, P ) Q.
Definition.
11
When a mathematician writes a sentence like this, what they mean is: If “P ) Q” is a true
statement, then it is not necessarily the case that “Q ) P ” is a true statement. (The converse
certainly exists and is a statement; what is being communicated is that it could either be true or
false.)
Proofs: A Long-Form Mathematics Textbook 161
x is an
integer
x is
even
This example also shows that if your universal set is B, then Ac is the set of odd
integers — the shaded portion above. And, again if your universe is the integers, then
if ⇠P is the statement “x is an odd integer.”
Likewise, if A = {x 2 Z : 2 | x} and B = {x 2 Z : 3 | x}, then A \ B = {x 2 Z :
6 | x}. And if P is the open sentence “x 2 Z and 2 | x,” and Q is the open sentence
“x 2 Z and 3 | x,” then P ^ Q is the open sentence x 2 Z and 6 | x.”
12
In fact, while ^ and _ are very standard, the “not” symbol is, well, not. In addition to ⇠P and
P , you may also see ¬P and !P .
162 Chapter 5. Logic
P Q P ^Q
True True True
True False False
False True False
False False False
To the left of the double line are the possible truth value combinations of P and
Q: They could be True/True, True/False, False/True or False/False.13 To the right
of the double line is what we are deducing. Refer back to Example 5.5 to see some
concrete examples of these deductions. What those examples illustrate is that in
order for “P and Q” to be a true statement, both P and Q must be independently
true.14
For instance, the second row of the above truth table is telling us that if P is true
but Q is false, then the statement P ^ Q is false. An example of this from Example
5.5: “3 is odd and 5 is even” is a false statement.
Next, here’s how the truth values for P and for Q affect the truth value for P _ Q.
P Q P _Q
True True True
True False True
False True True
False False False
Again, refer back to Example 5.5 to see some concrete examples. Here, in order
for “P or Q” to be a true statement, it is sufficient that either P is true or that Q is
true (or both).
Finally, here is how the truth values for P affects that of ⇠P .
P ⇠P
True False
False True
value.15 Using our intuition about sets, this is like how (Ac )c = A.
Example 5.8. This example is more complicated. Here we will find the truth values
of (P _ Q) ^ ⇠(P ^ Q), given the four possible truth value combinations for P and
Q. How do we do this? Well, to find the truth values of (P _ Q) ^ ⇠(P ^ Q) we
need the truth values of (P _ Q) and of ⇠(P ^ Q), and for the latter we will need
the truth values of (P ^ Q). This is how we proceed.
Indeed, in the truth table below, our first two columns are the four possible truth
value combinations for P and Q. These are then used to deduce columns three and
four. Column four is used to deduce column five. And columns three and five are
used to deduce column six.
P Q P _Q P ^Q ⇠(P ^ Q) (P _ Q) ^ ⇠(P ^ Q)
True True True True False False
True False True False True True
False True True False True True
False False False False True False
P Q P ^Q ⇠(P ^ Q) P Q ⇠P ⇠Q ⇠P _ ⇠Q
True True True False True True False False False
True False False True True False False True True
False True False True False True True False True
False False False True False False True True True
15
Linguistics prof: “In English, a double negative forms a positive. However, in some languages,
such as Russian, a double negative remains a negative. But there is no language where a double
positive can form a negative.” Heckler from the back of the room: “Yeah, right. . . ”
164 Chapter 5. Logic
Since the final columns are the same, if one is true, the other is true; if one is false, the
other is false; that is, there is no way to select P and Q without these two agreeing.
When two statements have the same final column in their truth tables, like in the
the example above, they are said to be logically equivalent (one is true if and only if
the other is true), which we denote with an “,” symbol. De Morgan’s logic law, for
example, can be written like this:
⇠(P ^ Q) , ⇠P _ ⇠Q.
In words, ⇠(P ^ Q) , ⇠P _ ⇠Q says this: “P and Q are not both true” is the
same as “P is false or Q is false.” 16
As with De Morgan’s laws for sets, there is also a second De Morgan law for
logic: ⇠(P _ Q) , ⇠P ^ ⇠Q. You can prove this in a similar way to the above,
by simply checking the truth tables for both. This is asked of you in Exercise 5.22.
Below we record these results.
Theorem.
This is a true statement. Indeed, here is a very small table which lays out the
truth value of this statement:
Perhaps you can see where I am going with this. The above is an example of a
P ) Q statement, in which P and Q are both true, and where P ) Q was in turn
16
By the way, De Morgan’s logic laws also show that technically we were redundant when we
defined all three of ^, _ and ⇠. For example, if we had only defined ^ and ⇠, then that would be
enough to do all logic, because P _ Q is the same as ⇠(⇠P ^ ⇠Q).
Proofs: A Long-Form Mathematics Textbook 165
true. This makes sense, as P ) Q means “If P is true, then Q is also true,” and both
are indeed true. If the above were a (rather simple) theorem, then you would say
that it is a true theorem, no sweat. You can perhaps even imagine that whenever P
and Q are true, the implication P ) Q will be a true implication.
But suppose we added a few more rows to the table, imagining other values of n:
We had already established that the final column is true — the implication “if
n = 2, then n is even” is absolutely true — and imagining any other possible values
of n does not change the fact that this implication is true all by itself. However, the
second row of this truth table does suggest that if P is false and Q is false, then
P ) Q should be considered true. And the third row suggests that if P is false and
Q is true, then P ) Q should be considered true. We still have the “True ) False”
row to add, and as you might expect, this is a false implication.
Intuition is important, but we should say right at the top that this truth table
we are generating is not up for dispute because this is how we are defining the
implication:
P Q P )Q
True True True
True False False
False True True
False False True
The row we just added is now the second row in this table, and I think this one
makes sense. The implication P ) Q means “If P is true, then Q is true,” and the
second row clearly does not satisfy this requirement. So for the second row, “If P is
true, then Q is true” is false.
The “n = 2 ) n is even” example provided motivation for the last two rows, but
I still expect these to be the hardest to think about. Why is the implication true if
the assumption, P , is false? It’s kind of like how we said that this is true: “If x 2 ;,
then x is a purple elephant that speaks German.” Since there is nothing in the empty
set, if you suppose x 2 ;, you can then claim anything you want about x and it is
inherently true — you certainly cannot present to me any element in the empty set
that is not a purple elephant that speaks German. In the set theory chapter (on
page 77), we called such a claim vacuously true.
Likewise, in a universe where P is true, the statement P ) Q has some real
meaning that needs to be proven or disproven: Does P being true imply Q is true, or
not? But in a universe where P is not true, it claims nothing, and hence P ) Q is
vacuously true.
“If unicorns exist, then they can fly” can certainly not be considered false, because
166 Chapter 5. Logic
unicorns do not exist,17 so any claim about them is considered vacuously true. Indeed,
the way to falsify that proposition would be to locate a unicorn that cannot fly, which
is impossible to do. Every unicorn in existence can indeed fly! Also, every unicorn in
existence cannot fly! Neither can be disproven!
– P ) Q is false if P ) Q is a lie –
One final way to think about it is this: If I said to you, “If unicorns exist, then
they can fly,” would you say that I lied to you? We only label an implication as false
if you would regard it as a lie, but I don’t think most people would consider that
implication a lie.
As another example, suppose I said “If you get an A on your final, then you will
get an A in the class.” And then suppose you get a B on the final and a B in the
class. Would you say I lied to you? Of course not! And if you got a B on the final
and an A in the class, I still did not lie. I said (A on final ) ) (A in class); the
two examples I gave are then “False ) False” and “False ) True.” But in neither of
these would you say I lied, so both “False ) False” and “False ) True” should be
considered as true.18 Compare this intuition with the truth table:
Grade Grade
(A on Final) ) (A in Class)
on Final in Class P Q P )Q
A A Did not lie True True True
A B LIE True False False
B A Did not lie False True True
B B Did not lie False False True
(And if you still think it is weird, that’s ok. Remember that, either way, the
above is how it is because we are defining it to be so.)19
Finally, let’s combine the above knowledge about P ) Q and the corresponding
truth table for Q ) P to generate the truth table for P , Q. Here are P ) Q and
17
18
Now, if it were possible to give Error 404 as an answer, then perhaps we could get out of
calling it true. But since the only options are true and false, and it definitely ain’t false, it’s gotta
be true.
19
According to an old story, the great logician Bertrand Russell, in a lecture on logic, was asked
about this strangeness by one of his students. In fact, the precious student challenged Russell to
prove that “if 1 = 0, then you are the Pope.” This is of the form P ) Q where P is false, so this
should be a true implication, right?
Russell immediately replied, “Add 1 to both sides of the equation: then we have 2 = 1. The set
containing just me and the Pope has 2 members. But 2 = 1, so it has only 1 member; therefore, I
am the Pope.”
(I like to imagine that at this point he held out has arm, dropped his mic, threw on some shades,
said “Russell out,” and exited the room to gasps and cheers.)
Proofs: A Long-Form Mathematics Textbook 167
Q ) P:
P Q P )Q P Q Q)P
True True True True True True
True False False True False True
False True True False True False
False False True False False True
P Q P ,Q
True True True
True False False
False True False
False False True
In closing, it is also useful at this point to reflect on the fact that the truth
values of P and of Q are one thing that we have looked at, and the truth values of
P ) Q and P , Q are another, and as truth tables illustrate, these do not match.
Think back to the first example of the chapter, with Socrates and Martians; correct
logic (the implication) does not need to match correct information (the component
statements). Make sure you distinguish these in your mind.
Here is the question: Are these two sentences saying the same thing, or different
things? I’ll let you mull that one over while we discuss quantifiers and negations.
— Quantifiers —
The sentence
“n is even”
is not a statement as defined in Definition 5.1, because it is neither true nor false. One
way to turn a sentence like this into a statement is to give n a value. For example,
168 Chapter 5. Logic
are each bona fide statements. What I’d like to discuss now are two other basic ways
to turn “n is even” into a statement: add quantifiers. A quantifier is an expression
which indicates the number (or quantity) of our objects. For example:
Saying “for all n 2 N” means that we are asserting that all of the infinitely many
n-values in N have the property. Another example:
Saying “there exists some n 2 N” means that we are asserting that at least one
n-value in N has the property.
Both of these are now statements — each is either true or false. “For all n 2 N,
n is even” is a false statement, because it is not true that all n 2 N are even (for
example, n = 5). “There exists some n 2 N such that n is even” is a true statement,
because of course there exists such an n (for example, n = 6).
The phrases “for all” and “there exists” are the two most important quantifiers in
math. Now, because language is complicated, there are many equivalent ways to say
these quantifiers. And, just for good measure, mathematicians gave them names and
symbols as well:
• The symbol 8 means “for all” or “for every” or “for each”, and is called the
universal quantifier.
• The symbol 9 means “there exists” or “for some”, and is called the existential
quantifier.20
— Negations —
We saw earlier that ⇠P is notation for “not P .” Below are some examples, the
first two of which use De Morgan’s Laws for logic (Theorem 5.9).
1. P : Socrates was a dog and Aristotle was a cat22
⇠P : Socrates was not a dog or Aristotle was not a cat
2. Q: Plato was a walrus or a chimp23
⇠Q: Plato was not a walrus and not a chimp
3. R: All Cretans are liars24
⇠R: Not all Cretans are liars25
22
Note that you could write this as, say, P ^ Q where P is “Socrates was a dog” and Q is “Aristotle
was a cat.” But remember, P ^ Q is its own statement too! It’s like how you could write 5 as 2 + 3,
but you don’t have to because it is its own statement too! So if we want to express “Socrates was a
dog and Aristotle was a cat” as a single statement with a single letter, that is certainly fine.
23
It is common to use the OG logicians in examples like this. I used to think it was a nice tribute
to include them, but is it really if I call them walruses or chimps??
24
This could be stated as: “For all people p, if p is a Cretan then p is a liar.
25
Make sure you convince yourself that the negation should be “Not all Cretans are liars,” and not
“All Cretans are not liars.” The negation of R should capture all the cases where R is false. And
having, say, half the Cretans being liars is certainly one way that R could be false, and hence it is
one of the cases that ⇠R should capture.
170 Chapter 5. Logic
In the first example, the “and” in P turned into an “or” in ⇠P . In the second example,
it was the opposite. In the third example, a “for all” in R turned into a “there exists”
in ⇠R. In the fourth example, it was the opposite. This suggests some rules of thumb
for negating statements:
• ⇠^ = _ • ⇠_ = ^ • ⇠8 = 9 • ⇠9 = 8
This gives us a new way to understand De Morgan’s Law for logic (Page 163):
⇠(P ^ Q) , ⇠P _ ⇠Q.
2. R: For every real number x, there is some real number y such that y 3 = x.
In symbols,
R: 8 x 2 R, 9 y 2 R such that y 3 = x.
Then,28
Notice that we negated every pawwrt of the statement R. Or did we? Notice
that “8 x 2 R” turned into “9 x 2 R” — it did not turn into “9 x 62 R.” Why is this?
Recall that the negation swaps the truth values: If R was true, then ⇠R is false, and
26
This ⇠R means the exact same thing as the ⇠R right above it. Convince yourself of this.
P.S. This is not to be insulting to the people of Crete. This is a reference to the Epimenides paradox.
P.P.S. If this book sells a zillion copies I might just go live in Crete forever. It looks beautiful.
27
This could be stated as: “There exists a person p in this room such that p is sleepy.
28
Note that R is true, as it is saying that every real number has a cubed root. And since R is
true, ⇠R will be false; indeed, ⇠R is saying that there is a single real number which is the cube of
every real number.
29
Note: The fact that the words “such that” moved is because of the English, not the math.
Include those words where they make sense linguistically. Typically, “there exists” is followed by a
“such that.” Meanwhile, “for all” is often followed by just a comma, or a phrase like “we have” or “it
is the case that.”
Proofs: A Long-Form Mathematics Textbook 171
vice versa. And the statement R is saying that every real number x satisfies some
property. Thus, the negation would be that not every real number x satisfies that
property. But that is still referring to real numbers! Makes sense?
For example, if I made the statement “Every NBA player can dunk,” then the
negation would be “someone in the NBA is unable to dunk.” Indeed, in order to show
“Every NBA player can dunk” is false, you would have to show that “someone in the
NBA is unable to dunk” is true. Using quantifiers more explicitly, the negation of
“For all players p in the NBA, player p can dunk” would be “There exists an NBA
player p such that p can not dunk.”
Notice that in this example, the negation still referred to NBA players! If I
said that every NBA player can dunk and you said “nuh uh, what about Serena
Williams??”, then your argument is flawed, because Serena Williams is not an NBA
player (she plays tennis). If the universe of people I’m talking about are NBA players,
then the negation remains in that universe. Getting back to our original example with
R, if the universe of x-values that I am referring to is R, then the negation remains
in that universe. That’s why the negation is “9 x 2 R,” rather than “9 x 62 R.”
P Q P )Q
True True True
True False False
False True True
False False True
The only way for P ) Q to be false is for both P to be true and for Q to be
false. This shows that
⇠(P ) Q) , P ^ ⇠Q.
This will be used in the following example.
Example 5.12. Let S be this statement: For every natural number n, if 3 | n, then
6 | n. (Note: This is false, so ⇠S will be true)
In symbols,
S: 8n 2 N, (3 | n) ) (6 | n).
30
Also the name of my next punk rock album.
172 Chapter 5. Logic
⇣ ⌘
= 9n 2 N such that ⇠ (3 | n) ) (6 | n)
= 9n 2 N such that (3 | n) ^ (6 - n)
— The Contrapositive —
Remember when I told you that the converse was a very important definition?
Well look alive, because here is another biggie.
Definition.
Given the truth values of P and Q, let’s build up the corresponding truth values
of its contrapositive: ⇠Q ) ⇠P . As always, the first two columns represent the
four possible combinations of truth values for P and Q, and the last three columns
are what we have deduced.
P Q ⇠Q ⇠P ⇠Q ) ⇠P
True True False False True
True False True False False
False True False True True
False False True True True
Does that final column look familar. . . It is the same as the final column as in the
P ) Q truth table!
31
Going to steal an opportunity to point out that while “P if and only if Q” is interesting and
important, “P if or only if Q” is distinctly boring and confusing and that nobody should construct
the truth table for “(P ) Q) _ (Q ) P )” unless they are willing to risk chalking up all of logic to
symbolic gobbledygook.
Proofs: A Long-Form Mathematics Textbook 173
P Q ⇠Q ⇠P ⇠Q ) ⇠P P Q P )Q
True True False False True True True True
True False True False False True False False
False True False True True False True True
False False True True True False False True
Theorem.
With this, let’s discuss the riddle from the start of this chapter, which asked
whether the two statements in the following sign are saying the same thing or different
things.
To our ear, they do seem to be saying different things. The first is asserting
something about good food, while the second is asserting something about cheap
food. With our perspective of the contrapositive, though, there may be more going
on. Here is a mathy way to write these, where F represents some food:
⇣ ⌘ ⇣ ⌘
F is good ) F is not cheap , ⇠(F is not cheap) ) ⇠(F is good)
⇣ ⌘
, F is cheap ) F is not good .
Logically, the two statements are equivalent! Take another look at the two
statements, and see if you can convince yourself that they are both saying this: There
is no food that is both good and cheap. Moreover, try to convince yourself that this
is all that they are saying.
As mentioned, using contrapositives will be the focus of the following chapter, so
we will soon pick back up this discussion.
Existential Proofs
To prove an existence statement, it suffices to exhibit an example satisfying the
criteria. For example, in the opening pages of this book we proved that “there exists
a perfect covering of a chessboard,” and we did so by drawing one out. Likewise,
if you were asked to prove that “there exists an integer with exactly three positive
divisors,” you could just find an integer which satisfies this; 4 is such an integer.
The above strategy is called a constructive proof — you literally construct an
example. There are also non-constructive ways to prove something exists. Often (but
not always!) non-constructive proofs make use of some other theorem. For example,
in real analysis you will study the intermediate value theorem, which tells us that if
f is a continuous function (such as a polynomial), and f (a) is negative while f (b) is
positive, then there must be some point between a and b, call it c, for which f (c) = 0.
x
a c b
Proofs: A Long-Form Mathematics Textbook 175
Now suppose you wish to prove that there exists an c 2 R for which
c7 = c2 + 1.
Without the intermediate value theorem, this would be an existential crisis! But with
it, it’s a breeze. Indeed, we simply let f (x) = x7 x2 1, which means that we are
trying to find is some c for which f (c) = 0. Note that f (1) is negative while f (2) is
positive. Therefore, since f is continuous, the intermediate value theorem guarantees
for us some c between 1 and 2 for which f (c) = 0.
Rather than finding the explicit c that works, we indirectly showed that such a
c must exist. The pigeonhole principle worked in a similar way. It never told you
which box had two objects in it, just that such a box much exist.
Universal Proofs
To prove a universal statement, it suffices to choose an arbitrary32 case and prove it
works there. We have seen several examples of this. For example, if you were asked to
prove that “For every odd number n, it follows that n + 1 is even,” your proof wouldn’t
explicitly check 1 and 3 and 5 and so on. Rather, you would say “Since n is odd,
n = 2a + 1 for some a 2 Z.” Then you would note that n + 1 = (2a + 1) + 1 = 2(a + 1)
is even. The point here is that by letting n = 2a + 1, you were essentially selecting
an arbitrary odd number, and operating on that. Every odd number can be written
in that form, and every odd number can have 1 added to it and then factored like we
did. Since our n was completely arbitrary, everything we did could be applied to any
particular odd number. Proving something holds for an arbitrary element of a set,
proves that it in turn holds for every element in that set.
The field of real analysis has a lot of definitions which make good use of quantifiers.
For example, here is the definition of what it means for a sequence to converge:
A sequence (an ) converges to a 2 R if for all " > 0 there exists some
N such that |an a| < " for all integers n > N .
This is a universal statement, since it begins with a “for all,” but it also includes
an existential condition. Working with definitions like these is a great way to sharpen
your knowledge of quantifiers. To give you a head start, in this chapter’s Bonus
Examples section, I include a 5-page introduction to proving sequence convergence.
Then, following this chapter is an Introduction to Real Analysis, whose primary goal
is to highlight a fun aspect of the field — the wealth of bizarre and exciting examples
it contains.
5.5 Paradoxes
To close out the main content of this chapter on logic, let’s steal a few pages to talk
about paradoxes. It would be natural at this point to give a proper definition of a
paradox, but the term is used in several distinct ways. It has been used to mean
32
Reminder: This means that it is fixed, but we nothing else about it.
176 Chapter 5. Logic
“something counterintuitive,” such as when Derek Jeter had a worse batting average
than David Justice in the 1995 season and again in the 1996 season, but yet, over
the two years combined, had a better batting average.33 Or how, from the year 2000
to 2015, the median income fell for every educational group, but yet incomes rose
when combining all of those incomes and considering the country as a whole.34
In these examples, something counterintuitive occurs, but logic itself is not bending
or breaking. Not only are these consistent with logic, they occurred in the real world!
And while these are fun to think about, they are not the self-defeating paradoxes.
They lead to no logical failing, and they have perfectly reasonable explanations.
Another class of “paradoxes” are of the magic-trick variety. For example, one of
the first exercises in Chapter 1 of this book was to find the error in the following
paradoxical “proof” that 2 = 1.
Let x = y. Then
x2 = xy
x2 y 2 = xy y2
(x + y)(x y) = y(x y)
x+y =y
2y = y
2 = 1.
You will notice that since x = y, then x y = 0, which means that we were not
allowed to divide by (x y) to move from the third line to the fourth. This “proof”
was a careful bit of sleight-of-hand, but it is far from a math breaker. Most visual or
animated “paradoxes” work this way. Like a magic trick, somewhere there is a small
lie which produces the effect.
There are also paradoxes which, even under careful inspection, really seem to
contradict math and logic. I kick off my real analysis book by talking about Zeno’s
paradox, which asks you to consider a hypothetical race between Achilles and a
tortoise. Zeno argued that if the tortoise was given any amount of a head start, that
Achilles can not possibly win. It was a laughable conclusion, but his logic seemed
33
This is phenomenon is called Simpson’s paradox, and it comes does to the sample sizes:
1995 1996 Combined
Jeter .250 (12/48) .314 (183/582) .310 (195/630)
Justice .253 (104/411) .321 (45/140) .270 (149/551)
34
And because we are considering the median, this is not due to the richest of the rich gaining so
much more money. It is due to social mobility!
Highest Education Attained Median Income Change (2000 - 2015)
High school dropout Incomes fell by 7.9%
High school diploma Incomes fell by 4.7%
Some college Incomes fell by 7.6%
At least one college degree Incomes fell by 1.2%
Everyone combined Incomes rose by 0.9%
Proofs: A Long-Form Mathematics Textbook 177
airtight. It took the development of calculus to really pin down why Zeno’s argument
was flawed.
None of these so-called paradoxes have dealt a fatal blow to mathematics, but
they have highlighted misconceptions among mathematicians. The age of rigorous,
axiomatic-based math is in-part a campaign to guard ourselves against these pitfalls.35
A famous example of this comes from set theory. It is hard to get more simple
than the notion of a set, but the mathematical world did a double take in 1901 when
Bertrand Russell discovered a paradoxical set. Recalling that the elements of a set
can themselves be sets, he considered the set
R = {x : x 62 x}.
Symbolically, there was no reason to disallow such a set definition, but yet you can
work out the strange contradiction that R 2 R if and only if R 62 R; indeed, if R is
not a member of itself, then according to its definition it must be a member of itself,
and if it does contain itself, then it contradicts its own definition. How unsettling!
Russell’s paradox demonstrated a hole in our theory, but that hole is now patched.36
In the above example, it was natural to assume that since the set R was able to
be succinctly defined, that it must exist. But this was false, and no such R exists.
The issue comes down to the fact that the set’s definition, in some way, referred back
to itself. No word in the dictionary uses itself in its definition, but in a less direct way
language can also fall into this trap. As a fun example, a word is called autological if
it is an example of itself. For instance, word is a word, and unhyphenated has no
hyphens. Here are some more:
• A pentasyllabic word is one having five syllables, and the word itself has five
syllables.
• The word oxymoron refers to a term that is self-contradicting. The word has
two parts to it: The ‘oxy’ part comes from a Greek work meaning ‘sharp’, and
the ‘moron’ part meaning ‘dull’. The word itself is self-contradicting, so it itself
is an oxymoron!37
Of course, there are also words that, in at least some ways, are not examples of
themselves—sometimes to an amusing degree. Hippopotomonstrosesquippedaliophobia,
for instance, is the fear of long words
A word that does not describe itself—meaning it is not autological—is called
heterological. So here’s a question: is the word “heterological” itself heterological?
Or is it autological? Well, if it is autological, then it describes itself, but what
heterological means is something that doesn’t describe itself—so if we assume it
35
Admittedly, doing so does spoil some of our fun. We’re just trying to have our minds blown,
but the drabby-clothed logicians keep stepping in and saying “Ack-tually, it was perfectly fine the
whole time!”
36
In fact, they went so deep into the rabbit hole to find the patch, that the set theory we learned
in Chapter 3 is now called naive set theory! How rude!
37
Preposterous is another example of this: combining ‘pre’ and ‘post’ in a single word is indeed
preposterous!
178 Chapter 5. Logic
describes itself then we can conclude that it does not describe itself. So that can’t be
right!
Does that mean it must be heterological? Well, if it does not describe itself, and
it itself means “does not describe itself,” then that means it does describe itself. So if
we assume it does not describe itself, then we conclude that it does describe itself.
Again, that can’t be right!
So it can’t be anything?? This phenomenon is known as the Grelling-Nelson
paradox and is another example of a self-referential paradox where the bind comes
not from the logic, but a faulty definition.38
Indeed, there are surprising results that often get called paradoxes — especially
in math fields for which we all have real-world intuition, like statistics, probability
and geometry. And some logical tangles seemed paradoxical for centuries until we
found sophisticated ways to unwind them — like work involving infinity. But now
that we have proved/resolved them, it seems strange to me to keep calling them
paradoxes. Simpson’s paradox and Zeno’s paradox are called paradoxes because they
are counterintuitive, not because there is anything contradictory about them.
The remaining “paradoxes” in math are of the false-at-their-core type.39 There is
some fundamental flaw which is causing the inconsistency, like the basic misuse of an
idea or object.40 Sometimes, these are benign paradoxes which we learn to live with,
like the Grelling-Nelson paradox. Other times, these are things which highlight an
error in our theory, and we are forced to correct our work in some way, whether it be
a definition, a piece of logic, or an axiom. Russell’s paradox is an example of this.
The goal of rigorous, axiomatic mathematics is to drive out each of these “real”
paradoxes (which are sometime called antinomies). In some ways this makes math
beautiful and pure. In other ways, it loses something exciting. Paradoxes of relativity
and quantum mechanics — genuine collisions of ideas — drove much of 20th century
physics. How exciting to wonder about a cat in a closed box, your twin soaring
through space near the speed or light, a box filled with light, or particle-like waves!
Just a single strange idea, caught between competing theories, can spawn a hundred
papers and a thousand YouTube videos!
To math’s credit, there is something to be said for purity and knowable truth.
And while physics is constrained by the laws of our universe, math’s free-rein has
allowed it to grow wider and freer and wilder than physics ever could. Our field
contains so much depth for those willing to submerge. And plus, everyone can watch
their YouTube videos.
38
A classic riddle works along the same lines: “A barber cuts the hair of everyone in his town who
does not cut their own hair. Does the barber cut his own hair?”
39
Unless you count unprovable statements as paradoxes, which I do not.
40
Unless you’re thinking beyond math in which case, let’s be honest, they usually involve time
travel.
Proofs: A Long-Form Mathematics Textbook 179
Truth tables can involve more than just two statements, P and Q. While it could
work for any number, let’s do one example with three statements, P , Q and R. With
three statements, we will have three columns before the double line, and in these
first three columns contains all possible true and false combinations for P , Q and R.
There are eight such combinations:
• True/False/True • False/True/False
P Q R
True True True
True True False
True False True
True False False
False True True
False True False
False False True
False False False
Example 5.15. The truth table for the statement (⇠P ) , (Q _ R) is below.
P Q R ⇠P Q_R (⇠P ) , (Q _ R)
True True True False True False
True True False False True False
True False True False True False
True False False False False True
False True True True True True
False True False True True True
False False True True True True
False False False True False False
P Q R S
True True True True
True True True False
True True False True
True True False False
True False True True
True False True False
True False False True
True False False False
False True True True
False True True False
False True False True
False True False False
False False True True
False False True False
False False False True
False False False False
also gets closer and closer to 0, in the sense that every term is closer to 0 than the
last. But this is clearly not what we mean, since all the terms are farther than 1
away. We want the terms to get arbitrarily close to 0. The sequence, 1, 12 , 13 , 14 , . . . ,
not only is getting closer and closer to 0, but there is no bound on how close it gets.
Consider an arbitrary sequence, which we denote
a1 , a2 , a3 , a4 , a5 , . . . .
If this sequence is going to converge to a number a, it must be that after some point,
all the terms of the sequence are within 0.5 of a. And it must be that after some
later point, all the terms of the sequence are within 0.1 of a. And, later on, it must
be that after some later point, all the terms of the sequence are within 0.0001 of a.
And so on.
Proofs: A Long-Form Mathematics Textbook 181
In general, if " is any number larger than 0, then the terms of the sequence must
eventually get within " of a, and from that point on they must remain within " of a.
Here’s what that looks like:
•
•
a+" •
• •
a • •
• •
•
a " •
• N
In this picture, the “N ” represents the point after which all the terms of the sequence
remain within " of a. Of course, if you chose a smaller value of ", which we will call
"2 , then you may need to choose a larger value of N , which we will call N2 , to mark
the point after which all the terms are within "2 of a.
•
•
•
a + "2 •
a •
• •
a "2 • •
•
•
• N2
With this intuition, see if you can parse the following precise definition for sequence
convergence.
Definition.
• A sequence (an ) converges to a 2 R if for all " > 0 there exists some N 2 R
such that |an a| < " for all integers n > N .
Because the sequence must be getting arbitrarily close to a, it must be the case
that, for all " > 0, eventually its terms get within " of a. But for any such ", all we
182 Chapter 5. Logic
require is that there exists just one N to mark the point after which all the terms of
the sequence are within " of a. And, finally, an being within " of a simply means
|an a| < ".
Given a specific sequence (an ) and a real number a which (an ) converges to, here
is the outline for how we will prove that (an ) converges to a.
Outline.
0. Scratch work: Start with |an a| < " and unravel to solve for n. This tells
you which N to pick for Step 2 below.
2. Let N be the final value of n you got in your scratch work, and let n > N .
3. Redo scratch work (without "’s, and in the opposite order), but at the end
use N to show that |an a| < ".
In short: The strategy is to start at the end (|an a| < "), and then unwind that
until you reach something you know to be true. The actual proof will then be in the
reverse of your scratch work. By beginning at the end, you learn how to begin!41
Proposition.
1
Proposition 5.18. Let (an ) be the sequence where an = . Then, an ! 0.
n
41
From Alice in Wonderland : “ ‘Begin at the beginning,’ the King said gravely, ‘and go on till
you come to the end: then stop.’ ” This is good advice, provided you can find your way from the
beginning to the end. But if you find yourself going in loops without reaching the end, instead try
to find your way from the end to the beginning. Sometimes that’s much easier, just ask an 8 year
old trying to solve one of those pencil maze puzzles.42
42
Fun Fact: Essentially all43 of those mazes can be solved by simply following the wall on your
right wherever it goes.
43
Technical condition is that it must be “simply connected.” If it fails, though, then you may have
to start over.41
Proofs: A Long-Form Mathematics Textbook 183
•
0+" • • • • • • • • • •
0
0 " N
We will follow Outline 5.17. Given an arbitrary " > 0, we will find a specific N
which guarantees that, for every n > N , we have |an 0| < ". For example, if " = 12 ,
then N = 2 works. If " = 13 , then N = 3 works. If " = 14 , then N = 4 works. You see
the pattern, but as practice for how to approach harder problems, here is how we
might come about it in general: you start at where you want to reach (|an a| < "),
and then unwind this until we discover an N which would guarantee this.
We want the following:
(As you saw, in the above we essentially did the important steps of Outline 5.17
in reverse order. We started with Step 3, undoing a bunch of algebra to find an N
that will work for Step 2.)
Proof . Fix any " > 0. Set N = 1" . Then for any n > N (implying 1
n < N ),
1
1 1 1 1
|an a| = 0 = < = = ".
n n N 1/"
1
That is, |an a| < ". So by Definition 5.16 we have shown that ! 0.
n
184 Chapter 5. Logic
Proposition.
1
Proposition 5.19. Let (an ) be the sequence where an = 2 . Then, an ! 2.
n2
2+"
2 • • • • • • • • • •
2 " •
•
Again, we first begin with our conclusion (that |an a| < "), and do some algebra
to figure out which values of n would give this.
We want the following:
This next one looks a bit trickier, but the same procedure works.
Proposition.
3n + 1
Proposition 5.20. Let (an ) be the sequence where an = . Then, an ! 3.
n+2
Scratch Work. Again, we first play around. We start with where we want to get
to (that |an a| < "), and then do some algebra to figure out which values of n
would give this.
We want the following:
3n + 1 3n + 1 3n + 6
|an a| = 3 =
n+2 n+2 n+2
5 5 5
= < = 5
n+2 N +2 " 2 +2
5
= = ".
5/"
3n + 1
That is, |an a| < ". So by Definition 5.16 we have shown that ! 3.
n+2
186 Chapter 5. Logic
— Chapter 5 Pro-Tips —
• Thinking this formally, especially in terms of truth tables, is something you
may not see in any later course, and even if you spent a career doing math
research you may never feel the need to whip out a truth table. They really
are not used much. However, the ability to parse a technical statement, work
with quantifiers, negate statements and find the contrapositive of a statement
are skills that you should ideally be able to do effortlessly. Working through all
this is primarily to help you get to that point.
• All that said, one of the most difficult concepts for students (or anyone) to wrap
their heads around is the idea that if P is false, then the implication P ) Q is
considered true. Fortunately, this particular idea is one that very rarely comes
up in higher-level mathematics. In math we almost always are dealing with P ’s
which we are assuming to be true, or know to be true. This weird case where P
is known to be false, and yet we are still interested in knowing the truth value
of some implication P ) Q, will likely never play a significant role in your
future work. But at this point in your math journey, there is still a benefit to
having crossed all of our antecedent t’s and dotted all of our consequent i’s.44
• If you really like logic and are considering studying it further, I thought I’d give
you a quick heads up: If you are male and you pursue a PhD in mathematical
logic, you will be required to grow a beard and wear some weird type of shoes.
I wish there were a way around it, but from my experience I can only assume
that is the law.
• Grammar Pro-Tip: In English, every “if, then” sentence has a comma separating
the two clauses. Examples:
– If n is odd, then n2 is odd.
– If p and p + 2 are both prime, then p is called a twin prime.
– If p and p + 4 are both prime, then p is called a cousin prime.
– If p and p + 6 are both prime, then p is called a sexy prime.45
– If a sexy prime could also be a twin prime and a cousin prime, then a lot
of college kids would be very amused.46
• One peculiar thing about math is that we typically use “if” in our definitions
when we really mean “if and only if.” We say “n is even if n = 2k for some
k 2 Z,” even though we really mean that those two are the same thing. With
an “if” we seem to be leaving open the possibility that n = 2k, for k 2 Z,
could be true without n being even. But this is never intended when stated
as a definition. Importantly, though: This is the only time in math where we
conflate these two.
44
Plus, when else can you talk about unicorns in math class?
45
Yes, this is a real term, and yes this is its actual definition.
46
Sorry college kids, but this is impossible. Try to prove this on your own by thinking about p,
p + 2, p + 4 and p + 6, each modulo 3.
Proofs: A Long-Form Mathematics Textbook 187
P ^ (Q _ R) = (P ^ Q) _ (P ^ R)
P _ (Q ^ R) = (P _ Q) ^ (P _ R)
P ^ (Q ^ R) = (P ^ Q) ^ R
P _ (Q _ R) = (P _ Q) _ R
Notice that, just like with De Morgan’s laws, logic rules mirror set theory rules.
If you replace statements P , Q and R with sets A, B and C, and you replace
logic operators ^ and _ with set operations \ and [, then the four rules above
still hold.
• Hopefully I bugged you enough that you created a study group. Here is your
reminder to keep meeting with them.47
47
Shout-out to my own undergrad study group of Zach, Adam, Hotovy, Corey and Laila, without
whom I wouldn’t be here today.
48
M8TH.
188 Chapter 5. Logic
— Exercises —
Exercise 5.1. Explain why the following is logically correct.
1. Everyone loves my baby;
Exercise 5.2. You are investigating muuuuurrderr. The following facts have been
established at the scene of the crime.
1. If Colonel Mustard is not guilty, then the crime took place in the library.
2. Either the weapon was the wrench or the crime took place in the billiard room.
4. Professor Plum is innocent if and only if the weapon was not the wrench.
(b) The crime did not take place in the billiard room.
Exercise 5.3. Determine which of the following are statements. Among those
that are statements, determine whether it is true or false.
Exercise 5.6. Give an example of an open sentence. Also, write down an input
value that causes your open sentence to be a true statement, and second input value
that causes your open sentence to be a false statement.
Exercise 5.7. Rewrite each of the following sentences to be of the form “If P ,
then Q.” Make sure your new wording does not change its meaning.
(b) Two graphs have identical degree sequences whenever they are isomorphic.
Exercise 5.8. Each of the below includes a hidden quantifier. Rewrite each of
these sentences in such a way that includes either “for all” or “there exists.”
Exercise 5.9. Rewrite each of the following sentences to be of the form “P if and
only if Q.” Make sure your new wording does not change its meaning.
(b) For a rectangle to be a square, it is necessary and sufficient that its sides all be
the same length.
(c) If xy = 0, then x = 0 or y = 0.
(g) For every " > 0 there exists an N such that n > N implies |an a| < ".
(h) For all " > 0 there exists some > 0 such that |x a| < implies |f (x) f (a)| < ".
(i) If I pass Algebra I and Analysis I this semester, than I will take Algebra II or
Analysis II next semester.
Exercise 5.12. Prove that for all x, y 2 Q, there exists some z 2 Q such that
x < z < y.
Exercise 5.13. Look up Fermat’s last theorem and Goldbach’s conjecture. Write
both down on your homework. Is Fermat’s Last Theorem a statement? Is Goldbach’s
Conjecture a statement?
(c) x 6= y.
(d) x < y.
Exercise 5.16. In the dystopian novel 1984, the official motto of Oceania is
War is Peace
Freedom is Slavery
Ignorance is Strength
By thinking about each of these as a conjunction of two statements, analyze their
logical merit.
Exercise 5.17. True or false: The flying panda in this room is riding a centaur.
Exercise 5.18. Given statements P , Q and R, write the truth tables for the
following.
(a) (⇠ P _ ⇠ Q) ^ Q (f) (P ^ Q) _ ⇠R
(b) ⇠ (⇠ P ^ Q)
(g) (P ^ Q) _ (P ^ R)
(c) ⇠(P _ Q) _ (⇠P )
(h) ⇠(P ) Q)
(d) ⇠(⇠P _ ⇠Q)
(e) (P _ Q) _ (⇠P ^ ⇠Q) (i) P _ (Q ) R)
192 Chapter 5. Logic
Exercise 5.19. For each of the below, find a compound statement involving P
and Q that you could put above the final column to make the truth table make sense.
(a)
P Q ⇠P P _Q ⇠(P _ Q)
True True False True False False
True False False True False False
False True True True False False
False False True False True True
(b)
P Q P ^Q P _Q
True True True True True
True False False True False
False True False True False
False False False False True
Exercise 5.20. Consider the expression (AxB)y(CzD). Using the Internet, pick
a random number between 1 and 6. And:
Exercise 5.21. Give two examples of statements which are true and whose
converse is also true; have one be a real-world example and one a math example.
Then, give two examples of statements which are true but whose converse is false;
have one be a real-world example and one a math example.
Proofs: A Long-Form Mathematics Textbook 193
Exercise 5.22. Construct truth tables to prove the following logical equivalences,
for propositions P , Q and R.
(a) P , ⇠(⇠P )
(b) ⇠(P _ Q) , ⇠P ^ ⇠Q
(c) P ^ (Q ^ R) , (P ^ Q) ^ R
(d) P _ (Q _ R) , (P _ Q) _ R
(e) P ^ (Q _ R) , (P ^ Q) _ (P ^ R)
(f) P _ (Q ^ R) , (P _ Q) ^ (P _ R)
(g) (P ) Q) , ⇠P _ Q
(h) P ) (Q ) R) , (P ^ Q) ) R
(i) P ) (Q ^ R) , (P ) Q) ^ (P ) R)
(j) P ) (Q _ R) , (P ^ ⇠R) ) Q
(k) (P _ Q) ) R , (P ) R) ^ (Q ) R)
Exercise 5.23. In the last exercise you proved the following. For each, describe
in your own words why it makes sense that they are equivalent.
(a) P , ⇠(⇠P )
(b) (P ) Q) , ⇠P _ Q
(c) P ) (Q ^ R) , (P ) Q) ^ (P ) R)
(d) (P _ Q) ) R , (P ) R) ^ (Q ) R)
(g)
Exercise 5.25. Translate each of the following to plain English, and then write
down whether each statement is true or false.
(i) 8x 2 N, 8y 2 R, we have x y.
(j) 8x 2 N, x2 x + 41 is prime.
Exercise 5.27. Determine which of the following are true. If it is true, just say
so. If it is false, give a counterexample.
p
(a) There exists some n 2 N such that n 2 N.
p
(b) There exists some n 2 N such that n 62 N.
(b) If a | b, then a | c.
(d) For every " > 0 there exists some N such that |an a| < " for all n > N .
Chapter 6: The Contrapositive
In 1966, cognitive psychologist Peter Wason devised a logic puzzle which is now
famous in the biz. Here is an equivalent form of the question:
You are shown a set of four cards placed on a table (pictured below),
each of which has a number on one side and a letter on the other side.
Which card, or cards, must you turn over in order to determine whether
the following is true or false: If a card shows an even number on one face,
then its opposite face is an H?
3 8 T H
Think about this on your own right now. Seriously, give it a shot. It’s easy to
keep reading on, but don’t! Try it! . . . Ok hopefully you did. This is a famous puzzle
because it tricked so many people. In Wason’s study, fewer than 10% of the people
answered it correctly.
I won’t tell you the answer immediately, because I really do want you to stop and
think about it first. So yeah, go do that. Have a guess in mind.
My next stalling tactic will be to rephrase the question slightly. Suppose four
people are each holding a drink (and each is drinking something different), and you’re
trying to determine whether it is true that “If a person is drinking alcohol, then they
are over 21 years old.” Observe that the only way this statement could be false is if
(1) a person is younger than 21 and (2) their drink is alcoholic. And to compare this
to Wason’s cards where you only see one side, let’s contemplate what this looks like
if you only know half this information.
• If you only know that the person is under 21, then the statement will become
false if they are drinking alcohol.
• If you only know that alcohol is being drank, then the statement will become
false if they are under 21.
With that in mind, let’s try Wason’s riddle again, but with new cards.
197
198 Chapter 6. The Contrapositive
You are shown a set of four cards placed on a table, each representing
one of the four people, each of which is drinking something. Each card
contains their age on one side, and what they are drinking on the other.
If presented with the four cards below, which must you turn over in order
to determine whether the following is true or false: If a person is drinking
alcohol, then they are over 21 years old.
25 16 Pepsi Beer
You must turn over the 16 card and the Beer card, right? Because by the bullet
points above, the only way that statement could be false is if the 16 year old is
drinking alcohol or the beer drinker is under 21. Does that make sense?
And notice what happened: In order to check the validity of “Alcohol ) over 21”
we turned over the alcohol card and the not over 21 card. Does that give you a hint
as to how to solve Wason’s puzzle?
Indeed, the above argues that the two statements below are logically equivalent.1
• If someone is drinking alcohol, then they are over 21.
• If someone is not over 21, then they are not drinking alcohol.
So what’s the answer to the original puzzle? Well, I asked you to try it on your
own, and if you still haven’t. . . I still won’t tell you — ha ha ha! You still have to
figure it out!2 But it’s very similar to the alcohol version, so you’re almost there.
(But if your original guess was to turn over the 8 and the H, then you made the most
common mistake, which you may now be able to fix.)
The goal of this puzzle is to provide motivation for the fact that P ) Q (e.g.,
Alcohol ) Over 21) being true is logically equivalent to not-Q ) not-P (e.g., Under
21 ) Non-Alcohol). In fact, this is something we showed at the end of the last
chapter in our discussion of the contrapositive.3
Theorem.
1
Recall what logical equivalence means: if one is true, the other is true too; if one is false, the
other is false too.
2
. . . or you can Google it, I guess. . . it is pretty famous. . .
3
Quick review of that: The contrapositive of P ) Q is ⇠Q ) ⇠P , and one can see that these two
are logically equivalent (P ) Q is true if and only if ⇠Q ) ⇠P is true). This fact was demonstrated
by showing that their truth tables align, and is stated formally in Theorem 5.14.
Proofs: A Long-Form Mathematics Textbook 199
Let’s prove some things. As you learn more proof techniques, you’ll discover that often
a proposition can be proved in many different ways, using different proof techniques.
For example, some of the propositions below could be proven by using either a direct
proof or the contrapositive. This is good! It means you have a choice. Also, learning
the proof to a proposition helps you understand it; and learning a second proof of
that proposition helps you understand it even more.4 Below is the general structure
of a proof by contraposition.
Proposition. P ) Q.
4
And, in general, if you know k proofs of a proposition, learning a (k + 1)st proof of it will further
deepen your understanding. And so, by induction, you should never stop learning new proofs of a
proposition.
Proofs: A Long-Form Mathematics Textbook 201
Proposition.
Proof Idea. If we tried to prove this directly, then we would start by applying the
definition of oddness to say that n2 = 2a + 1 for some a 2 Z. But then what? How
do we get to n being odd? The path seems unclear. But the contrapositive of
“If n2 is odd, then n is odd”
is
“If n is not odd, then n2 is not odd.”
And because n 2 N, this is the same as
“If n is even, then n2 is even.”
And this seems like a much clearer path! In fact, we have already proved a number
of results just like this in Chapter 2. So simply by taking the contrapositive we turn
a problem with no clear way forward into a routine problem from Chapter 2.
Proof . Suppose n 2 N. We will use the contrapositive. Assume that n is not odd,
which means that n is even,5 by Fact 2.1. By the definition of an even number
(Definition 2.2), this means that n = 2a for some integer a. Then,
n2 = (2a)2 = 4a2 = 2(2a2 ).
And note that since a is an integer, 2a2 is an integer too. Therefore, by Definition
2.2, this means that n2 is even. And since n 2 N, this is equivalent to concluding
that n2 is not odd.
We have shown that if n is not odd, then n2 is not odd. Thus, by the contrapositive,
if n is odd, then n is odd.
2
A common question at this point is “how do I know which proof method to use?”
Induction is the easiest to spot, because the proposition is asserting something (often
a simple equality or single property, rather than an “if, then” condition) holds for
every n 2 N, or similar. For direct proof versus contrapositive. . . it is trickier, and
experience certainly helps.
The last proposition worked well by contrapositive because the contrapositive
“flips” P and Q, and if n comes first and n2 comes second, that’s helpful. The next
proposition will be done in two parts, and one of those parts works best as a direct
proof, while the other works best as a contrapositive. However, to emphasize that
you do have choice, I will show how the contrapositive proof could have been done
directly.
5
(foot)Note: It is important that we said n 2 N. If n 2 R, for example, then n being “not odd”
no longer implies that n is even. Because maybe n = 2.2 or n = ⇡. These are not odd numbers
since they are not 2k + 1 for some k 2 Z — but that does not imply that they are even.
202 Chapter 6. The Contrapositive
Proposition.
Proof Sketch. Remember that to prove an “if and only if” proposition, you need to
prove it in “both directions.” Indeed, we will prove this proposition by proving
1. If n is odd, then 3n + 5 is even; and
2. If 3n + 5 is even, then n is odd.
The first of these is a classic problem that you could have solved in Chapter 2. The
second of these can be turned into a classic problem once we apply the contrapositive.
We have proven that n being odd implies 3n + 5 is even, and that 3n + 5 being
even implies n is odd. Combined, these show that n is odd if and only if 3n + 5 is
even, completing the proof.
6
For many proofs, having a summarizing sentence is nice but not required. For contrapositive
proofs, though, it is required. Taken at face value, the contrapositive is a different statement than
the proposition you are trying to prove. When we write “by the contrapositive” at the end, we are
saying that “we just proved that something else is true, but it being true implies that our proposition
is true.” Without formally invoking the contrapositive, you have not connected your proof to the
proposition you are trying to prove.
Proofs: A Long-Form Mathematics Textbook 203
In Part 2 we once again benefited from the contrapositive’s ability to “flip” the
order of P and Q. Starting with n being even made our approach much cleaner.
That said, I’d like to mention that there is actually a way to prove Part 2 as a
direct proof. If you assume that 3n + 5 is even, then you can write 3n + 5 = 2a where
a 2 Z. The goal now is to show that n is odd by writing n as 2b + 1 for some b 2 Z.
How do we do it? Notice that 3n + 5 = 2a implies that 3n = 2a 5, but should we
now divide both sides by 3? How would that give us 2b + 1?
The trick is to think about 3n as n + 2n, and then move the 2n to the right:
3n = 2a 5
n = 2a 2n 5
n = 2a 2n 6+1
= 2(a n 3) + 1.
In Lemma 2.17 we proved that if p | bc, then p | b or p | c. Let’s now prove the
indivisibility version of this result.
Proposition.
Proof Idea. You might hope that this proposition is precisely the contrapositive
of Lemma 2.17; if it were, then to prove this proposition we could simply apply the
contrapositive to Lemma 2.17, and the proof would be done! However, they are
not contrapositives. If Lemma 2.17 is P ) Q, then Proposition 6.4 is ⇠P ) ⇠Q,
whereas the contrapositive of P ) Q is ⇠Q ) ⇠P .
We will still use the contrapositive to prove this, but unfortunately we are unable
to make use of Lemma 2.17 in our proof. We will have to work a little harder.
ab = (pk)b = p(kb).
204 Chapter 6. The Contrapositive
Since k, b 2 Z, also (kb) 2 Z. And so, by the definition of divisibility (Definition 2.8),
p | ab.
ab = a(p`) = b(a`).
Since a, ` 2 Z, also (a`) 2 Z. And so, by the definition of divisibility (Definition 2.8),
p | ab.
In either case, we concluded that p | ab, which is equivalent to saying that it is not
true that p - ab.
We proved that if it is not true that p - a and p - b, then it is not true that p - ab.
Hence, by the contrapositive, this implies that if p - ab, then p - a and p - b.
Note that the two cases above were the exact same. Sure, in Case 1 we were
focused on a while on Case 2 we were focused on b, but their variable names is
literally the only difference between a and b. And sure, we chose different variable
names for k and `, but that’s it; every mathematical characteristic about these two
cases is exactly the same. In fact, when I typed this up, I literally copied Case 1 and
pasted it as Case 2. I switched out a few variables names, and was done. Seems a
little silly to be proving two things when they are essentially the same, doesn’t it?
Mathematicians have agreed that we should be allowed to skip essentially-identical
cases. With all those skipped Case-2s, just think of all the trees that can be saved!
And the time! We could all knock off work 10 minutes early and spend it with our
kids. It seemed like such a no-brainer that the Elders of Math were unanimous on
the motion’s first ballot. And from this, “without loss of generality” was born.
If you have two cases, like p | a and p | b, and there is literally no mathematical
distinction between them, then you are allowed to say “without loss of generality,
assume p | a.” This allow you to skip the “p | b” case entirely. For example, the above
proof is rewritten in this condensed way below.
As we close out the main content of this chapter, I wanted to comment again
on the fact that as we are learning more sophisticated proof techniques, and as our
proofs themselves become more complicated, it is increasingly important to proceed
with caution when writing out your own proofs.
The writer Joan Didion once noted that the process of writing is not only to share
what you think is true, but to discover what you think is true. This is insightful,
although it also comes with risk — are you actually discovering what you think is
true, or do you risk slowly convincing yourself of falsities, while all of your blind
spots remain?
If this is cause for concern with everyday writing, then proof writing demands
even greater caution. When writing about politics, people tend to be their easiest
market. When writing a proof, though, you must insist on being a (nice) critic of
yourself. Constantly test your intuition, probe your ideas, and break things down
until they are of their simplest form. It is healthy and productive to approach the
first draft of your proof with doubt. And if you can find a friend to read through
your proofs in a critical (and nice) way, then all the better.
Proposition.
Proof Idea. The fact that this proposition says a lot of things are not happening is
one indication that the contrapositive could be worthwhile. The contrapositive adds a
“not” to both P and Q, so it will turn “n - 36” into “n | 36,” and “36a 6⌘ 36b (mod n)”
into “36a ⌘ 36b (mod n).” In both cases, this looks better. By definition, n | 36
means that 36 = nk1 for some k1 2 Z, so if that is our assumption we have a clear
forward direction. And if our goal is to show that 36a ⌘ 36b (mod n), which means
that n | (36a 36b), which in turn means that (36a 36b) = nk2 for some k2 2 Z,
then this is a clearer target to aim for.
for some k 2 Z. We will now prove that 36a ⌘ 36b (mod n) by showing that
n | (36a 36b). Since 36 = nk,
And since k, a, b 2 Z, also (ka kb) 2 Z. By Definition 2.8, this means that
n | (36a 36b) and hence, by Definition 2.14, that 36a ⌘ 36b (mod n).
We have shown that n | 36 implies that 36a ⌘ 36b (mod n). Thus, by the
contrapositive, 36a 6⌘ 36b (mod n) implies that n - 36.
In the next bonus example, we will assume that the quadratic formula that you
learned in high school is true. (Spoiler: it is.) We will also use a couple of exercises,
which we state now as a lemma.
Lemma.
The proof of this lemma is asked of you in the exercises. Part (i) is Exercise ??,7
and part (ii) is Exercise 6.7 part (a).8 We now use this result to prove the following
proposition.
Proposition.
Proof Idea. Again, since the conclusion “x2 + x a2 = 0 has no integer solution” is
saying something can not happen, it makes sense to try the contrapositive. Assuming
that there is an integer solution seems like a good place to start a proof, especially
since the quadratic formula tells us exactly what such a solution can look like.
Proof . Suppose that a is an odd integer. We will use the contrapositive. Assume
that it is false that x2 + x a2 = 0 has no integer solutions; that is, assume that
there is some integer m such that
m2 + m a2 = 0.
7
Main idea: m2 + m is either a sum of two even numbers (if m is even) or the sum of two odds
(if m is odd). In either case, this sum will be even.
8
Hint: It is very similar to Proposition 6.2.
Proofs: A Long-Form Mathematics Textbook 207
Next, observe that m2 + m is guaranteed to be even, by Lemma 6.6 part (i). Thus,
since we just deduced that m2 + m = a2 , this means that a2 must be even. And
since a is an integer, a2 being even implies that a is even, by Lemma 6.6 part (ii). In
particular, this means that a is not odd.
We have shown that if it is false that x2 + x a2 = 0 has no integer solutions,
then it is also false that a is an odd integer. By the contrapositive, if a is an odd
integer, then x2 + x a2 = 0 has no integer solution.
There is also a nice proof of this by contradiction, which is the topic of the next
chapter.
9
Did your middle school teacher make you sing the formula? Are you singing it in your head
right now??
208 Chapter 6. The Contrapositive
— Chapter 6 Pro-Tips —
• We have discussed how P ) Q is logically equivalent to ⇠Q ) ⇠P . Therefore,
when someone discovers a theorem, they have a choice of how to express it.
If they write it as P ) Q, but their proof flips it around and proves the
contrapositive, then why not just write the theorem as ⇠Q ) ⇠P to begin
with, so the proof can be a direct proof? Sometimes these decisions are made
behind the scenes.
• This is your periodic reminder that struggling through tough ideas and proofs
is a really important skill in math. After awhile, you may even start to enjoy it.
It is also one of the most important skills that one can gain from a challenging
math class like an intro to proofs class. The classic high school math student
10
Or, sadly, the first European to prove it. See: Stigler’s Law.
11
This joke is trivial, and is left as an exercise to the reader.
12
Two things. First, if you look this up on Wikipedia, make sure you read the “Actual monkeys”
section; it’s pretty amusing. Second, a fun fact: “The Infinite Monkey Theorem” is also the name of
a winery with locations in Denver and Austin.
Proofs: A Long-Form Mathematics Textbook 209
question is “When are we going to use this material in the real world?” There
are many good answers to this question, but one is that the soft skills like grit
and mental tenacity are some of the most important in order to succeed “in
the real world,” and few other classes instill these skills better than a math
class. As I wrote in the Chapter 1 Pro-Tips, no teacher can download the Math
Castle into your brain,13 which forces you to struggle and get better at dealing
with new and uncomfortable ideas. And that is good.
13
Although Elon Musk seems to be trying.
210 Chapter 6. The Contrapositive
— Exercises —
Exercise 6.1. Explain in your own words the difference between the contrapositive,
the converse and a counterexample.
Exercise 6.2. Give 4 examples of implications, and for each write down their
contrapositive. Have two be real-world examples, and two be math examples.
Exercise 6.3.
(a) What is the contrapositive of “If n2 4n + 7 is even, then n is odd”?
(b) Suppose that n 2 Z. Prove that if n2 4n + 7 is even, then n is odd.
Exercise 6.4.
(a) What is the contrapositive of “If mn is odd, then m is odd and n is odd”?
(b) Suppose that m, n 2 Z. Prove that if mn is odd, then m is odd and n is odd.
(c) If x2 + 2x + 1
2 < 0, then x < 0. (f) If
Proofs: A Long-Form Mathematics Textbook 211
Exercise 6.9. Make up your own problem that is easier to solve with a contra-
positive than with a direct proof or a proof by induction.
Note. For the next exercise, recall that one way to prove P , Q is to
prove P ) Q and then Q ) P . Each direction will be its own proof, and
these two proofs may use different methods.
Suppose someone stole Mrs. Figg’s purse at 8pm last night; they grabbed it right from
her arms. If Carmen is a suspect, but the detective finds conclusive evidence that
Carmen was across town at 8pm, then there is no way for her to have grabbed Mrs.
Figg’s purse. For mathematical reasons, think about it like this: Assume Carmen
did steal it. Then Carmen was in two places at once. This is absurd, so she must not
have done it.
These arguments are called reductio ad absurdum — reduction to absurdity — and
are used often in everyday conversation. Suppose your mom asks “so. . . are you dating
anyone right now?” And, annoyed, you respond “no, if I were I would have told
you.” Then — whether or not you’re being truthful — you are making a reductio ad
absurdum argument. Your argument is essentially: If I were dating, then you would
know — but you don’t know. Therefore, I must not be dating. Here, you are assuming
for the argument that you are dating, and then deducing the absurdity that this
would mean you would have told her, which contradicts the reality that she has not
been told.
In math one might say “There is not a largest integer, because if there were and
we called it N , then N + 1 would be a larger integer.” Again, you are assuming what
ends up being false — that there exists a largest integer N . And we are showing that
such an assumption would imply something absurd — that N is the largest and yet
N + 1 is larger.
This is the main idea behind our next proof technique: proof by contradiction.
Recall from our logic chapter that if a statement Q is true, then ⇠Q is false. And if
Q is false, then ⇠Q is true. We described this relationship with the simplest of all
truth tables:
Q ⇠Q
True False
False True
The important observation is that Q and ⇠Q cannot both be true, and cannot
both be false. In fact, we could even draw out a truth table for that:
Q ⇠Q Q ^ ⇠Q
True False False
False True False
213
214 Chapter 7. Contradiction
This is analogous to Carmen not being in two different places at once, your mom
being told and not being told, or N and N + 1 both being integers while N is the
largest.
The big idea is this: If you start with something true and apply correct logic to
it, you will never arrive at something false. So it can’t be true that Carmen stole the
bag, if that would imply the falsity that she can be in two places at once. Indeed, if
your assumptions imply something false, then something you assumed had to be false
as well. Here’s a schematic summary of these thoughts:
Assumption throughout
this problem: P is true.
Theorem: P ) Q.
Goal: Show that Q is true.
The truth table for P ) Q can be unintuitive, so there is risk to using it to motivate
a new proof method. Nevertheless, it might be enlightening for you. Notice that the
only way that P ) Q can be false, is if P is true and Q is false.
P Q P )Q
True True True
True False False
False True True
False False True
Thus, this is the only case we have to rule out in order to prove our theorem:
that P ) Q is true. So, if you assume that P is true and Q is false, and manage
to use that to deduce a contradiction, then you will ruled out the one and only bad
case, which in turn means that the theorem it must be true! Voilà!
Proofs: A Long-Form Mathematics Textbook 215
Proposition.
Proof Idea. One quick note: This proposition is not phrased explicitly as “P ) Q,”
but you are probably starting to see how to rephrase propositions in this form. For
example, this proposition could instead be stated as: “If N is the set of natural
numbers, then N does not have a largest element.” Or, equivalently: “If N is larger
than every natural number, then N 62 N.” Or, equivalently: “If N is a natural number,
then there exists a natural number larger than N .”
For our proof by contradiction, we will assume that there is a largest natural
number, and then deduce a contradiction. There are several ways to do this, but one
way is to assume that N is the largest and then show that N + 1 must be larger — if
it weren’t, we could deduce that 0 1, which is clearly a contradiction. Here’s that:
Proof . Assume for a contradiction that there is a largest element of N, and call this
number N . Being larger than every other natural number, N has the property that
N m for all m 2 N.
Observe that since N 2 N, also (N + 1) 2 N. And so, by assumption,
N N + 1.
This is a contradiction1 since we know that 0 < 1, and therefore there must not be a
largest element of N.
Proposition.
Proposition 7.2. There does not exist a smallest positive rational number.
Scratch Work. In order to use a proof by contradiction, let’s suppose that there
does exist a smallest positive rational number, and let’s call such a number q; this
means q = ab for some a, b 2 Z such that a, b > 0 (they are in Z by the definition of
a rational number, and they are positive because q > 0). Why does this lead to a
contradiction? Because we can now find a smaller such number! For example, 2b a
will
be such a number. If b is rational and positive, then 2b will be too. And why is 2b
a a a
Proof . Assume for a contradiction that there is a smallest positive rational number,
and call this number q. Then, since q is rational,
a
q=
b
for some a, b 2 Z. And since q is positive, we may assume that a, b > 0. Then, by
starting with 0 < a, adding a to both sides, and then dividing by the positive number
2b, we get this:
0<a
a < 2a
a a
< .
2b b
a a a
We have shown that < . Moreover, is a positive rational number, since a
2b b 2b
and 2b are positive integers. This contradicts our assumption that q was the smallest
positive rational number,2 and completes the proof.
.
2 reductio ad
absurdum!
a smallest
b
a < a
while 2b b
Proofs: A Long-Form Mathematics Textbook 217
Our first proposition contradicted the fact that 0 < 1, and our second contradicted
a
b being the smallest by finding a smaller. For practice, try to flip these: Try to write
a second proof of Proposition 7.1 by contradicting N being the largest by finding a
larger, and write a second proof of Proposition 7.2 by contradicting 0 < 1. Both are
similar.3
Our proofs by contradiction follow this general form:
Proposition. P ) Q.
If you’re thinking that proofs by contradiction are a little weird, I agree! You
assume something false in order to show that it’s true? It’s a little strange. In fact, I
was inspired enough by this strangeness to write a short poem about it. Enjoy.
3
Hint: For the first, use 0 < 1 to show that N + 1 is larger. For the second, assume a
2b
> a
b
and
do algebra until you reach the contradiction 0 > 1.
218 Chapter 7. Contradiction
7.2 Examples
Let’s do a few more examples. The first comes from set theory.
Proposition.
Proposition.
Proposition 7.4. Prove that there do not exist integers m and n for which
15m + 35n = 1.
Scratch Work. Assume for a contradiction that there are integers m and n where
15m + 35n = 1.
Proofs: A Long-Form Mathematics Textbook 219
What can we do now? Well, even though we don’t know what m and n are, you
could plug in some numbers for m and n to get a feel for what’s going on. Doing so
might help you notice that 15m + 35n is always a multiple of 5.
That sounds really promising, because supposedly this multiple of 5 is equal to
1 (since 15m + 35n = 1), and 1 is not a multiple of 5. A multiple of 5 is equal to
something that is not a multiple of 5? Seems like a contradiction to me! We will
have to make that precise in some way, but that should do it.
Proof . Assume for a contradiction that there do exist integers m and n for which
15m + 35n = 1. Since m, n 2 Z, also (3m + 7n) 2 Z. Dividing both side by 5 gives
1
3m + 7n = .
5
There is often more than one way to prove something, for example, the above
proof could have began the same way, by assuming that there are m, n 2 Z for which
15m + 35n = 1, but then factoring out the 5 to get
5(3m + 7n) = 1.
Theorem.
Proof Sketch. Since the proof is by contradiction, it will begin by supposing there
are only finitely many primes, say p1 , p2 , . . . , pk . To find a contradiction, our goal will
be to prove that this list of primes is incomplete; there must be a prime left out. Over
two millennia ago, Euclid had the idea to consider what happens when you multiply
together this supposed list of all the primes, and then add one: p1 p2 p3 . . . pk + 1.
Why? Consider this for some subsets of the primes:
The fourth row, for instance, shows why 2, 3, 5 and 7 can’t be the only primes.
Since 2, 3, 5 and 7 all divide 2 · 3 · 5 · 7, there is no way that any of them divide
2 · 3 · 5 · 7 + 1. If they tried, they would get a remainder of 1! But of course, 2 · 3 · 5 · 7 + 1
is still a positive integer, and so is either a prime or a product of primes, so there
must be new primes in there — primes other than 2, 3, 5 or 7.
This was Euclid’s big idea. If the only primes are p1 , p2 , . . . , pk , then consider
(p1 · p2 · p3 · · · · · pk ) + 1. Either this number is prime, in which case it is a new prime,
since it is bigger than each pi , or5 it is composite, in which case it is a product of new
primes by our reasoning above. In either case, our assumption that p1 , p2 , . . . , pk was
a complete list of all the primes is contradicted. This is how the proof is traditionally
presented, although to be rigorous in this last step can be a little subtle. One way to
make it precise is to use modular arithmetic, which we do in our proof below.
Proof . Suppose for a contradiction that there are only finitely many primes, say k
in total. Let p1 , p2 , p3 , . . . , pk be the complete list of prime numbers, and consider
the number N = p1 · p2 · p3 · · · · · pk , which is the product of every prime. Next,
consider the number N + 1, which is (p1 · p2 · p3 · · · · · pk ) + 1. Using N + 1, we will
find a prime not appearing in the list p1 , p2 , . . . , pk , which will give us our desired
contradiction. First note that, being a natural number, N + 1 must either be prime
or composite, so consider these two cases.
5
By the way, when I write “bigger than each pi ,” what I mean is that it is bigger than p1 and p2
and p3 and . . . and pk . In general, when you see a mathematician write “each pi ,” what they mean
is: look at the context in the problem, and consider all the values of i for which pi is defined.
Proofs: A Long-Form Mathematics Textbook 221
N ⌘ 0 (mod pi ).
Then by applying Proposition 2.15 part (i), we may add 1 to each side to produce
N + 1 ⌘ 1 (mod pi ).
7
Euclid showed that there are pros and cons to geometry. Pro: tractor. Con: structions.
222 Chapter 7. Contradiction
Twenty five hundred years ago, Since every prime under the Sun
As games of thrones were waged, Divides N perfectly,
An old man sat in candles’ glow, No pi divides N + 1,
( )
His probing mind engaged. And that is this proof’s key.
8
“It is impossible to be a mathematician without being a poet in the soul.” – Sofia Kovalevskaya.
Now, this doesn’t mean you have to write poems or like poetry. I think Kovalevskaya’s point is that
the part of mathematics that so many mathematicians find attractive is when you find a creative
connection that you never saw before; it’s being able to see something from a new and enlightening
perspective; it’s when you realize that two seemingly-disparate ideas rhyme in an unexpected way.
It’s the poetry of ideas that inspires so many mathematicians.
Proofs: A Long-Form Mathematics Textbook 223
c
b
a
The Pythagoreans proved this by placing four copies of this triangle (non-
overlapping) into an (a + b) ⇥ (a + b) square, and asking this question: What’s
the area of the portion of the square not covered by any triangle? Of course, it
doesn’t matter how we place the triangles into the square — the non-covered area
is the same regardless. In fact, that was their key to prove this theorem: If we
strategically place them in two different ways, we will get two different answers to
the same question, which will give us exactly what we want.
The Pythagoreans first placed them like below. Doing so, the non-triangle area is
the area of one a ⇥ a square and one b ⇥ b square.
a b
a a
b b
a b
But if we place the triangles differently, we can answer the question a second
time! This time, the answer to the question is the area of a c ⇥ c square.
b a
c b
c
a
c a
b c
a b
224 Chapter 7. Contradiction
And since both are answers to the same question, they must equal each other.
a b b a
c b
c
a Area = a2 a a
Are
= a=
c2
c a
Area
b = b2 b b c
a b a b
That is,
a 2 + b2 = c 2 .
This theorem is significant not only for its own merits, but also because it is
the key to proving that irrational numbers exist. Sadly, despite having the key,
Pythagoras9 lived and died believing that all numbers were rational. But after his
death, his school of thought — Pythagoreanism — lived on.10 About a century after
his death, a Pythagorean named Hippasusp proved what is now the classic proof of
one of the classic theorems — that 2 is irrational. As the legend goes, the other
Pythagoreans were so horrified by this theorem that they took Hippasus out to sea
and threw him overboard, killing him. They then made a pact to never tell the world
of his discovery. This has got to be one of the worst cover-ups in history, as today his
proof is probably the second most known proof in the world, only behind Euclid’s
proof which we just discussed.11
In fact, even if only to stick it to the murderous,
p anti-intellectual Pythagoreans
one last time, let’s discuss Hippasus’ proof that 2 is irrational, which is another
proof by contradiction.
9
Pythagoras’ story is cloaked in legend — but fortunately the legends are all highly amusing.
Aristotle wrote that Pythagoras had a golden thigh, was born with a golden wreath upon his head,
and that after a deadly snake bit him, he bit the snake back, which killed it; he was supposedly the
son of Apollo, and it was said that a priest of Apollo gave him a magic arrow that allowed him to
fly; the philosophers Porphyry and Iamblichus both reported that Pythagoras once persuaded a
bull not to eat beans, and convinced a notoriously violent bear to swear that it would never harm a
living thing again — and the bear was true to his word. What is odd is that none of his own writings
have survived, and most of the credible writings about him were done long after his death. Some
have even suggested that he was not a real person. . . but this is certainly a minority opinion among
historians.
10
Some may argue that “school of thought” is a bit generous. It was basically a cult.
11
They tried to stay discrete and discreet, and failed on both counts.
Proofs: A Long-Form Mathematics Textbook 225
Theorem.
p
Theorem 7.6. The number 2 is irrational.
p
Proof . Assume for a contradiction that 2 is rational. Then there must be some
non-zero integers p and q where
p p
2= .
q
Moreover, we may assume that this fraction is written in lowest terms, meaning that
p and q have no common divisors. Then,
p
2q = p.
2q 2 = p2 .
2q 2 = p2
2q 2 = (2k)2
2q 2 = 4k 2
q 2 = 2k 2 .
Therefore, 2 | q 2 , and hence 2 | q, again by Lemma 2.17 part (iii). But this is
a contradiction: We had assumed that p and p q had no common factors, and yet
we proved that 2 divides each.13 Therefore 2 can not be rational, meaning it is
irrational.14
14
How does that taste, Pythagoreans? Bitter? Mmmhmm.
226 Chapter 7. Contradiction
p
We begin as we did the last proof: Assume for a contradiction that 2 = p/q
where p, q 2 N and the fraction is written in lowest terms. This implies that 2q 2 = p2 ,
but this time let’s think about this as p2 = 2q 2 . Or, better yet,
p2 = q 2 + q 2 .
Since p and q are integers, p2 represents the area of a square with side length p, and
each q 2 represents the area of a square with side length q.
p2 = q2 + q2
p
Now, to appreciate the punch line, you have to remember that 2 = p/q was
written in lowest terms.
p In particular, this means that there do not exist any smaller
a and b for which 2 = a/b. Our contradiction will be to find such an a and b.
Getting back to the squares above, we are now going to imagine each square is a
piece of paper and we are going to place the two q 2 squares on top of the p2 square.
If one q 2 square is placed in the lower-left, and the other is placed in the upper-right,
this happens:
The first
q 2 square The second
q 2 square
Notice that there is one square region in the middle that was covered twice, and
two small squares in the upper-left and lower-right that were not covered at all. And
remember: The amount of area in the p2 is equal to the amount of area in the two
q 2 squares. Therefore, the area that was covered twice must equal the area that was
not covered at all! Let’s suppose the middle square has dimensions a ⇥ a, and the
two corner squares have dimensions b ⇥ b. Then, this reasoning shows that
a2 = b2 + b2
Proofs: A Long-Form Mathematics Textbook 227
And those a and b must also be integers, since they are the difference of integers
from the overlap picture:
b=p q
a = 2q p p
q
p
We had assumed that p and q were the smallest integers for which 2 = p/q,
and yet the above image shows that a and b are also integers, and since a2 = b2 + b2 ,
which implies 2b2 = a2 , we have 2 = a2 /b2 . And so, finally, by taking the square root
of each side, we see that
p a
2= .
b
We have shown that a and b are integers with the above property. The picture above
also shows that a is smaller than p, and b is smaller than q. Combined,
p this contradicts
our assumption that p and q are the smallest integers where 2 = p/q.
Of historical significance, this theorem shows that the hypotenuse of the triangle
below is irrational.
The fact that irrational numbers exist explains why we need the real p
numbers
R — the rational numbers Q are clearly not enough! Next, note that while 2 is not
a ratio of integers, it is a root of x2 2 = 0, which is a polynomial with integer
coefficients. Big Question: Is every irrational number a root of a polynomial with
integer coefficients? Big Answer: Nope! In 1844, Joseph Liouville proved that
1
X 1
= 0.11000100000000000000000100 . . .
10k!
k=1
is not the root of any polynomial with integer coefficients.
The irrational numbers were thus partitioned into algebraic numbers, which are
the roots of such polynomials, and transcendental numbers, which are not. Today, ⇡
and e are the most famous numbers which have been proved to be transcendental.
Starting with N, our number system was extended to N0 , to Z, to Q, and to R. In
fact, it also extends to the complex numbers, the quaternions, the hyperreals, and more.
But while it is nice to talk about this progression as orderly and natural, its history
is less so. Our progression to today was filled with confusion and misunderstanding.
Prominent mathematicians even disagreed about the number zero as late as the 16th
century! Nevertheless, progress has marched on.
228 Chapter 7. Contradiction
Now it’s time for our next proposition, and I’ll let you decide whether it is absurdly
deep or deeply absurd.
Proposition.
• 7 is the smallest n such that the regular n-gon cannot be constructed with a
ruler and compass. Interesting!
• 10 has the property that among any 10 consecutive integers, there is at least
one that is relatively prime to all the others. Interesting!
15
In some ways, 2 is the oddest prime.
16
See: The four color theorem.
17
The pgeneral quadratic, ax2 + bx + c = 0 has the quadratic formula as a general solution:
b± b2 4ac
x= 2a
. The general cubic and quartic polynomials also have formulas for their roots
using only arithmetic operations and roots. For 250 years, one of the biggest unsolved problems
was to find a formula for the general quintic. Finally, in 1823, a 20 year old Niels Abel proved the
remarkable fact that no such formula is possible by inventing group theory, a course you will likely
take soon. An introduction to group theory follows Chapter 9.
18
A number is perfect if it is the sum of its proper divisors (positive divisors which are less than
the number). Six has proper divisors 1, 2 and 3, and 1 + 2 + 3 = 6. The next three perfect numbers
are 28, 496 and 8,128. So yeah, they’re pretty rare, and it is unknown whether there are infinitely
many of them.
19
A regular polyhedron is a 3-dimensional figure where each of its faces is the same regular polgon.
For example, a cube is a regular polyhedron because each face is a square. There are 5 convex
polyhedra: the classical Platonic solids; and 4 star polyhedra: Kepler-Poinsot stellated polyhedra.
And, amazingly, that’s it. They look like this:
Proofs: A Long-Form Mathematics Textbook 229
Ok, so far we have established that each of the first 10 natural numbers are
interesting. But if we are to prove that all of the infinitely many natural numbers
are interesting, listing properties one-by-one won’t cut it. We will have to be clever.
Asserting something is true for all n 2 N is typically a strong suggestion that we
should be using induction, but as you will see, in this case a proof by contradiction
works out nicely.
Proof . Assume for a contradiction that not every natural number is interesting.
Then, there must be a smallest uninteresting number,20 which we call n. But being
the smallest uninteresting number is a very interesting property for a number to have!
So n is both uninteresting and interesting, which gives the contradiction.21 Therefore,
every natural number must be interesting.
Sure, this was just a fun example, and “interesting” is impossible to define in the
way we mean it. But one of its main ideas was a good one: If we are assuming that
there exist uninteresting numbers, let’s find a specific one that is in fact interesting.
Don’t think about all of the cases, focus on a special one; in this case, the special
one is the smallest one.22
It’s like if someone time traveled to today, from 1911 — just before the Titanic
was set to embark on its infamous voyage. If this time traveler claimed that the
Titanic was unsinkable, and you wanted to prove to them otherwise, then (after
telling them to go kill Hitler) what would you say? You wouldn’t give them a lecture
on the subtle weaknesses in the hull’s rivets, you’d just show them the specific day in
1912 on which it sunk. There are often many reasons why something is false; the art
is to identify the simplest reason why it is false.
There are some mathematical purists who believe that direct proofs, contrapositive
proofs, and induction proofs are better than proofs by contradiction. First, in support
20
This is because of the fact that every non-empty set of natural numbers must contain a smallest
element. This is sometimes called the well-ordering principle.
.
21 reductio ad
absurdum!
n is uninteresting
and interesting
22
We will discuss this further in this chapter’s Bonus Examples.
23
The Ice-T in the parallel universe where all his raps were about math. And Jerry’s happy.24
24
P.S. If you don’t get this joke, ask one of your millennial profs.
230 Chapter 7. Contradiction
of this belief, we write proofs to explain our ideas to others, and to convince them
that we are correct. But the best proofs not only convince us that the result is
true, but also why it is true. And proofs by contradiction tend to struggle on this
score. Indeed, even the act of proving something by contradiction can prohibit your
understanding, since you end up spending all your time thinking about the way
things aren’t rather than the way things are.
What are reasons to rebel against these purists’ beliefs? First, proof by contradic-
tion is a perfectly valid proof method, and so ignoring a tool in your toolbox seems
silly. But most importantly for someone at the beginning of their journey with proofs:
It’s not just any tool, it’s a really freaking powerful tool! Contradiction is often the
most powerful proof technique you have. Moreover, thinking about the lies can still
aid understanding.
British science fiction writer Arthur Clarke formulated three “laws” for writings
in his field. The third is the most famous (“Any sufficiently advanced technology is
indistinguishable from magic.”), but let’s talk about his second law: “The only way
of discovering the limits of the possible is to venture a little way past them into the
impossible.” Indeed, to best understand the borders between truths and falsehoods,
reality and fantasy, it is useful to probe it from the dark side too. Clarke said it well,
but for the sake of balance I’ll close the main content of this chapter with some wise
words from Darth Vader:
Input: A number N
while N > 1 do
if N is even then
N ! (N + 2)
else
N ! (N 2)
end if
end while
If N = 5 is input, then the program will recognize that N > 1 and so will loop
through the if statement, turning N into N 2 = 3. And since the new N is still
25
“Any sufficiently advanced Python is indistinguishable from pseudocode.”
Proofs: A Long-Form Mathematics Textbook 231
larger than 1, it will again loop through the if statement, turning N into N 2 = 1.
Since N is no longer larger than 1, the program will halt after these two loops.
Likewise, if N = 7 were input, it would halt after three loops.
What about if N = 6 were input? One loop would turn N into 8. A second loop
would turn N into 10. A third turns it into 12. And so on. At every step we still
have N > 1, and since N is only ever climbing higher, this will never stop being true.
It’s an infinite loop!
Of course, with a program this simple, an experienced coder would know to avoid
such an infinite loop, but in a really long and complicated program an infinite loop
may be introduced without its author realizing it. How do we tell whether there is a
bug like this in our code?
If code is the problem, could code also be the solution? Is it possible to write
a program which can tell whether our code has an infinite loop? If such a program
existed, we could plug an entire program into it, and its output would either be “This
program has an infinite loop” or “This program does not have an infinite loop”? That
would be quite a neat program! Does it exist?
This question is known as the halting problem, since the goal is to determine
whether a program exists that can always determine whether or not other programs
will eventually halt.
So, does a halt-detecting program exist? Sadly, the answer is no. We have to sniff
out our own infinite loops, because no program exists that can always do it for us.
And I’m not simply saying that the code monkeys have all tried their best and so far
they’ve failed but, who knows, there’s always tomorrow. No, I would never disparage
computer scientists like that. All I’m saying is that the mathematicians swooped in
to save the day and proved that such a program is impossible. Check it out:
Theorem.
Proof . Assume for a contradiction that such a program H did exist. Create a new
program T (x); its input, x, is itself a program with some input. Now, we define the
program T (x) as follows:
The program T is designed to run counter to x: If the input program x was going
to halt, then T begins an infinite loop. And if the input program was going to run
forever, then T says to halt.
The program T accepts as input any program. And since T is itself a program, we
are allowed to plug T into itself ! What is the result? Well, since T (T ) is a program,
like any program either T (T ) contains an infinite loop or it does not. Let’s consider
each of these two cases.
Case 1. Observe that if T (T ) has an infinite loop, then like all programs with
infinite loops, it will not halt — but by looking at the above pseudocode for T , it is
clear that if T (T ) has an infinite loop, then it will halt! This is a contradiction.
Case 2. Conversely, if T (T ) does not have an infinite loop, then like all pro-
grams without an infinite loop it must eventually halt — but by looking at the
above pseudocode for T , it is clear that if T (T ) will eventually halt, then it will
begin an infinite loop which will prevent it from halting! This is again a contradiction.
Whether T does or does not have an infinite loop, we have reached a contradic-
tion.26 And since T was built from H, our assumption that there exists a halting
program H must have been incorrect. This concludes the proof.
The person who discovered this was Alan Turing, who formulated a mathematical
definition of a computer program, allowing him to prove interesting results like this
one, studying the limitations of computers. In particular, the study of undecidability.27
27
Five years earlier, a deep, mathematical result was published that decidedly halted the mathe-
matical world. To learn about the extent of mathematical undecidability, check out Kurt Gödel’s
incompleteness theorems.
Proofs: A Long-Form Mathematics Textbook 233
contradiction. Then you would assume for a contradiction not every natural number
satisfies the result — that is, you’re assuming there is at least one counterexample.
Well, among all of the counterexamples, one of them must be the smallest.28 And
thinking about that smallest counterexample — such as the smallest uninteresting
number — can at times be a powerful variant of proof by contradiction.
In Chapter 4, we used strong induction to prove the fundamental theorem of
arithmetic. There’s another slick proof of this theorem that uses a proof by minimal
counterexample, and which I would like to show you now.
Theorem.
Recall that every integer n 2 is either prime or composite, and being composite
means it is a product of smaller integers. Ok, let’s prove the theorem.
Proof . Assume for a contradiction that this is not true. Then there must be a
minimal counterexample; let’s say N is the smallest natural number at least 2 which
is neither prime nor the product of primes. The fact that it is not prime means that
it is composite: N = ab for some a, b 2 {2, 3, . . . , N 1}.
We now make use of the fact that N is assumed to be the minimal counterexample
to this result — which means that everything smaller than N must satisfy the result.
In particular, since a and b are smaller than this smallest counterexample, a and b
must each be prime or a product of primes.
And this gives us a contradiction: Since N = ab, if a and b are each prime or
a product of primes, then their product — which equals N — must be as well. This
contradicts our assumption that N was a counterexample,29 completing the proof.
Another way to think about this proof is that it argues that if N were a coun-
terexample, then since N = ab, it can’t possibly be that both a and b are primes or
a product of primes, since as we just saw, that would produce a contradiction. And
therefore it must be the case that either a or b is also a counterexample. This implies
that every counterexample produces a smaller counterexample — every N produces
28
This is because of the fact that every non-empty set of natural numbers must contain a smallest
element. This is sometimes called the well-ordering principle.
.
29 reductio ad
absurdum!
N is a counterexample
yet satisfies the theorem
234 Chapter 7. Contradiction
an a or a b. But this is a contradiction, since you can not repeatedly find smaller
and smaller natural numbers — at some point you reach the bottom.
Theorem.
Theorem 2.11 (The division algorithm). For all integers a and m with m > 0,
there exist unique integers q and r such that
a = mq + r
where 0 r < m.
Proof . Fix any two integers a and m for which m > 0. The theorem asserts two
things:
1. That there exist integers q and r for which a = mq + r and 0 r < m, and
mq 0 + r0 = m( q 1) + (m r) = mq m+m r= (mq + r) = a.
a = mq 0 + r0 ,
where 0 r0 < m. Because of this, any expression for a > 0 immediately produces
one for a. Thus, we need only prove the case where a is a positive integer.
30
Example: If a = 13 and m = 3, then a = m · 4 + 1, whereas a = m · ( 5) + 2.
Proofs: A Long-Form Mathematics Textbook 235
Case 1: a < m. In this case, we can simply let q = 0 and r = a, and we have obtained
a=m·q+r
Case 2: a = m. In this case, we can simply let q = 1 and r = 0, and we have obtained
a=m·q+r
Case 3: a > m. Recall that the theorem assumes that m > 0, and so in this case we
have a > m > 0. In particular, note that a > a m and also a m > 0.
Since a is the smallest positive counterexample to this theorem, and a m is
both positive and less than a, the integer a0 = a m must satisfy this theorem! That
is, there must exist integers d and s for which
(a m) = m · d + s
Uniqueness. Assume for a contradiction that for our fixed a and m, that the q and
r are not unique. That is, assume there exist two different representations of a,
a = mq + r and a = mq 0 + r0 ,
mq + r = mq 0 + r0 .
r r0 = m(q q 0 ).
236 Chapter 7. Contradiction
Since q and q 0 are integers, so is q q 0 (by Fact 2.1), which means the above
expression matches the definition of divisibility (Definition 2.8)! That is, m | (r r0 ).
Notice that since 0 r, r0 < m, the difference r r0 would have these restrictions:
m < r r0 < m. And the only number in this range which is divisible by m is zero.
That is, r r0 = 0, or r = r0 .
Next, since r = r0 , the fact that r r0 = m(q q 0 ) implies that
0 = m(q q 0 ).
a = mq + r and a = mq 0 + r0
were two different representations of a and m, but we have proven that q = q 0 and
r = r0 , proving that they are in fact the same representation, giving the contradiction
and concluding the proof.
Proofs: A Long-Form Mathematics Textbook 237
— Chapter 7 Pro-Tips —
• Before we discuss Pro-Tips regarding proofs by contradiction, I want to spend
a moment to mention how mathematicians (and and many more in academia
and the sciences) type up their work. Math is always typed up using a program
called LATEX. This is software that you can download to your computer for free,
and which was used to typeset this book, every other math book you have ever
had, and every recently-published research article in mathematics. It allows
you to make math symbols, Greek letters, and beautiful graphics. There are
many packages that you can load which supply you with a wealth of shortcuts
to create such symbols and graphics. It really is wonderful, and if you pursue
mathematics further (or even if you don’t), it would be worthwhile to learn
some LATEX. Get good at it, and you’ll never look back; I haven’t written a
document in Word in a decade. And it has been a good decade.
In fact, it has become so standard that journal editors, who receive more
3-page “proofs” of centuries-old problems that you can imagine, have developed
a number of rules to determine whether a paper is worth more than a glance.
And the number one rule: If it’s not written in LATEX, it goes straight to the
trash can. Because no mathematician uses Microsoft Equation Editor.
There are also good websites that allow you to use LATEX online without
downloading anything. Mostly notably, Overleaf.com has done a great job at
this. This site also allows you to collaborate with others, so that you and your
friends can share online notes, homework assignments, or a research project,
and each person has the ability to read, edit and add to the document.
• One mistake that students can make is to automatically use a proof by con-
tradiction when the proof they have in mind is in fact a direct proof or a
contrapositive proof. Indeed, if you are proving P ) Q and your proof goes
“Assume P and ⇠Q. <math math math> We have now shown that Q is true,
which contradicts our assumption that ⇠Q is true, and therefore P ) Q must
be true,” then you shouldn’t be using a proof by contradiction; if you prove Q
as a part of your proof, then you should be using a direct proof.
Likewise, if you are proving P ) Q and your proof goes “Assume P and ⇠Q.
<math math math> We have now shown that not-P is true, which contradicts
our assumption that P is true, and therefore P ) Q must be true,” then you
shouldn’t be using a proof by contradiction; if you prove not-P as a part of
your proof, then you should be using a contrapositive.
It is not uncommon for students to instinctively pursue a proof by con-
tradiction on each problem, when doing so only adds an unnecessary layer of
complication.31
• When using a direct proof, you usually know whether or not you have successfully
reached your conclusion. If you prove P ) Q by a direct proof and you make
a mistake on your journey from P to Q, you will likely not arrive at Q, and so
31
You’re a math major, not a proof-by-contradiction major. Remember that!
238 Chapter 7. Contradiction
you will know that you still have work to do. Indeed, a mistake will typically
throw you off course and it would take a second equal-but-opposite mistake to
arrive at Q. There could certainly be steps that require more justification than
you gave, but you were at least on a legitimate path.
And since a proof by contrapositive is essentially a direct proof from not-Q
to not-P , the same lesson holds there.
Likewise, if within a proof by induction you make a mistake within the
induction step, then you will rarely reach where you need to get to. And so,
once again, it will be clear to you that a mistake was made and must be hunted
down.
For a proof by contradiction, though, this is not so simple. Suppose you
are trying to prove P ) Q, and you begin your proof by assuming for a
contradiction that P is true and Q is false. The goal now is to identify anything
else that is false, which will give us the contradiction. Consequently, there’s no
longer a single target that is either hit or not — in a sense, there are innumerable
potential targets, since any contradiction counts. Thus, if you make a mistake
along the way, who is to say that the “contradiction” you find is the result of
the not-Q assumption, rather than a byproduct of your mistake?
Unfortunately, this Pro-Tip does not contain a silver bullet. There’s no
foolproof way to patch this vulnerability. All I can say is that a proof by
contradiction requires more care than other proofs, for this reason. It is easier
to deceive yourself into accepting a flawed proof. Proving by contradiction is a
powerful tool, but heightened risks call for a heightened attention to detail.32
• It is always difficult to know when one proof technique is better than another,
but I will continue my efforts to give you some general advice. One instance in
which a proof by contradiction is particularly useful is when the theorem asserts
that something is true “for every” or “for all” such-and-such. For example, “every
natural number is interesting” and “Every integer n 2 is prime or a product
or primes.” The reason is that when you assume for a contradiction that the
theorem is false, what that tells you is that there is a particular element which
does not satisfy the theorem.
This can be quite powerful, as it allows you to focus on a single element,
and what its existence implies — what does it mean if there is an uninteresting
number, or a number that is not a product of primes? Also, when you assume
such an element exists, what you’re really assuming is that there is at least one
element with those properties. But if there are possibly more such elements,
then maybe there is a smallest one, or a largest one, or one which is special
in some other way. If so, then you are perfectly allowed to focus not on any
supposed counterexample to this theorem, but one with other assumptions
piled on top. And then you’re really cookin’.
.
32
With great power comes
great responsibility
Proofs: A Long-Form Mathematics Textbook 239
— Exercises —
Exercise 7.1. Consider the four similar-sounding words: contrapositive, con-
tradiction, converse and counterexample. Explain the similarities and differences
between these.
Exercise 7.3. Prove that there do not exist integers m and n for which 15m+35n =
1.
Exercise 7.5. Let Q+ be the set of positive rational numbers. Prove that if
x2 Q+ ,
then there is some y 2 Q+ such that y < x. Provide two proofs of this fact,
one using a direct proof and one using a proof by contradiction.
Exercise 7.7. Are there infinitely many composite numbers? Prove your answer.
Exercise 7.11. Assume that x and y are positive real numbers such that
x 4y < y 3x. Prove that if 3x > 2y, then 12x2 + 10y 2 < 24xy. In fact, prove it
three times, once with each of our main proof methods: a direct proof, a contrapositive
proof, and a proof by contradiction.
Exercise 7.15. A magic square is an n ⇥ n matrix where the sum of the entries
in each row, column and diagonal equal the same value. For example,
8 1 6
3 5 7
4 9 2
is a 3 ⇥ 3 matrix whose three rows, three columns, and two diagonals each sum
to 15. Thus, this is a magic square.
Prove that the following can not be completed to form a magic square.
1 2 3
4 5 6
7 8
9 10
Exercise 7.16.
(a) Prove that there are arbitrarily long arithmetic progressions consisting of relatively
prime numbers.
(b) Prove that there does not exist an infinitely long arithmetic progression consisting
of relatively prime numbers.
Introduction to Game Theory
You and a classmate Tom are under investigation. The two of you submitted nearly-
identical essays for your assignment on the Banach-Tarski paradox. There are two
options: You two worked together when you weren’t supposed to, or one of you
cheated off the other. Your professor calls you two into her office one at a time, and
you two have no chance to discuss anything. She tells you that if you two simply
worked together, then that is bad, but not worthy of being reported to the university,
who would expel a proven cheater. She therefore lays out the possible outcomes:
• If you two both say you worked together, you will fail that assignment, but
that’s it.
• If you both accuse the other of cheating off them, then the university will decide
neither to be credible and so neither will be expelled. But the professor says
she would act harshly, and you would both fail her class.
• If you accuse Tom, and Tom says you worked together, then the university will
expel Tom and you will get no punishment.
• If Tom accuses you and you say you worked together, then the university will
expel you and Tom will get no punishment.
Tom’s Answer
You don’t know Tom too well, so you don’t know what he will do. And for the
sake of this problem, the truth about who cheated is not important. We simply ask:
If you and Tom are “rational actors” (i.e., selfish logicians), and will therefore choose
the option which minimizes your own penalty, what will you and Tom do?
241
242 Chapter 7. Contradiction
Game theory
This is what game theory is all about. It seeks to answer the question of what rational
actors will do when presented with such situations, which are called games. Game
theory deals with recreational games, like chess, poker and Call of Duty, as well as
real-world situations like the above in which the set up and rules are clear, and the
actions of one player affects the outcome of another player. And although the cheating
example, like many math applications, may feel contrived, game theory presents itself
naturally and often in the real world. Two notable examples are military strategy
and economics, which are filled with game theory.
There are five binary criteria which help to classify games. They are:
2. Normal Form vs. Extensive Form. A normal form game is one with a
matrix representation like the above, while an extensive form game is more
complicated and is modeled by a tree.
1. Non-cooperative, since you and Tom do not have the chance to speak;
5. Symmetric, since you and Tom are in identical situations with identical conse-
quences.
Proofs: A Long-Form Mathematics Textbook 243
Nash Equilibria
Sheldon and Leonard are playing a non-cooperative game, and each has a strategy.
Suppose each strategy is optimal in the sense that if Sheldon changes his strategy (but
Leonard doesn’t change his), then Sheldon only hurts himself. And, symmetrically,
Leonard can also not improve his outcome, given Sheldon’s strategy. Each is using
the best possible reply to the other’s strategy, and so, since they are not collaborating,
neither player will deviate from their strategy.
If such strategies exist for a game, then such strategies are said to be in Nash
equilibrium. This is one of the most important ideas in game theory, and is named
after its pioneer, John Nash.33 The obvious next question is: Does every game have
a Nash equilibrium? John Nash proved one great theorem about this: Every finite
non-cooperative game contains a Nash equilibrium.
If a game has a unique Nash equilibrium, then two rational players will play that
Nash equilibrium strategy, since any other pair of strategies can be improved upon
by at least one player. Our cheating example is a non-cooperative, finite34 game, and
so it must have a Nash equilibrium, which will tell us how you should react when
cornered by your professor. Below is the matrix again, for reference.
Tom’s Answer
I claim that the Nash equilibrium is that both you and Tom will blame the other,
which will result in you both failing the class. Let’s check if this is true.
• If Tom plans on blaming you, can you improve your position by changing your
strategy? Nope! You will either fail the class with your current strategy or get
expelled from the university by changing your strategy, so certainly you will
not change.
• If you plan on blaming Tom, can Tom improve his position by changing his
strategy? Nope! He will either fail the class with his current strategy or get
expelled by changing his strategy, so certainly he will not change.
33
The movie A Beautiful Mind is a great, and mostly accurate, portrayal of Nash’s life.
34
By the way, if a game gives the players infinitely many possible moves, then it is not guaranteed
to have a Nash equilibrium. Example: the game in which two players each shout out a number at
the same time, and the person who shouted out the larger number wins. There is certainly no Nash
equilibrium for this game, since any strategy can clearly be improved as you can always choose a
larger number.
244 Chapter 7. Contradiction
In both cases, “changing strategy” was straightforward to think about, since there
was literally only one other strategy possible.35 In a game of chess, if you changed
strategies you have an enormous number of other strategies to pursue. And so the
analysis of that game is. . . not so easy.
So there you have it! Both you and Tom, being rational actors, would choose to
blame the other. It is true that if you were able to collude, and you both trusted the
other to follow through with the plan, then you could work together to get a lighter
sentence. But since you cannot talk to Tom, and if you could you two still couldn’t
trust each other. . . it is optimal to just blame the other.
This cheating scenario is commonly phrased in terms of two prisoners in separate
cells, each asked whether they robbed the bank. If they accuse each other, they split
the jail sentence. If one accuses the other while the other stays silent, the accused gets
the full sentence while the other walks free. If neither confesses, they both get slapped
with tax evasion, which includes a small jail sentence (and conviction is certain).
Because of this setup, the problem is famously called the prisoner’s dilemma.36
35
Well, sort of. There are what are called mixed strategies in which you make your choice based
on some randomized procedure. Those are not important now, but we will talk about them soon.
36
And its solution, I assume, is called the prisoner’s diproof.
Proofs: A Long-Form Mathematics Textbook 245
Strategy-Stealing Arguments
One particularly fun and delicious game is called chomp. Given a chocolate bar37 — a
rectangular array of chocolate squares — there is a game two people can play with it
called chomp. Here are the rules:
• The upper-left square is called the poison square, and whoever eats that square
loses.
• Player 1 goes first, after which the players take turns. On each turn, a player
selects one of the remaining squares, and then eats that square and all of the
squares below and to the right of the chosen square.
Chosen
square
Below is an example game using a 4 ⇥ 7 bar. This game lasted for six moves, and
if you count it out you’ll find that Player 2 was forced to eat the poison square at
the end, which means that Player 1 won this game.
! ! ! !
37
Pro-Tip: When you spend hours making a virtual chocolate bar for one problem, it pays to use
it again for another. Likewise, if you write a math talk, go ahead and spend twice as long on it to
make it really good, and then find several more venues to give the talk. Your time-spent-per-delivery
will go down, and you’ll get to share the talk with more people.
246 Chapter 7. Contradiction
Before reading on, find someone to play a few rounds of chomp with, and see if
you can develop a strategy. Or at least play a few games against yourself!38
A common question for games like this is: Does there exist a winning strategy
for Player 1? That is, is there a strategy which would guarantee a win for Player
1? If not, does there exist a winning strategy for Player 2? Because there are only
finitely many ways this game can play out and, unlike a game like tic-tac-toe, each
game must end with someone winning, one of these two people must have a winning
strategy. So, is it Player 1 or Player 2? And what is that strategy?
Proposition.
Proof . If the chocolate bar is 1 ⇥ 1, then Player 1 is forced to eat the poison square
on the first move, and so Player 2 wins.
As for a larger chocolate bar, assume for a contradiction that Player 2 has
a winning strategy. Then Player 1 can execute what is called a strategy-stealing
argument. Given any such bar, have Player 1 select the bottom-right square on their
first move; this removes only that square.
Because we are working under the assumption that Player 2 has a winning strategy,
there must be a move that Player 2 can make which will eventually lead to victory.
For example, perhaps this is the move:
But notice that Player 1 could have made that move as their first move! And
since, as we said, this move will eventually lead to victory, this shows that Player 1 in
fact had a winning strategy (even though we can’t say what it is). This contradicts
our assumption that Player 2 had a winning strategy, and completes the proof.
38
Even when you lose, you win!
Chapter 8: Functions
If it passes
What you were the vertical
taught in middle school line test
A relation on A ⇥ B
What I’ll tell you such that 8a 2 A,
later in Chapter 9 9! b 2 B such that
(a, b) 2 R.
Go to A morphism in
grad school the category of sets
1
Here’s to hoping that memes have a longer half-life than I fear!
247
248 Chapter 8. Functions
Definition.
Definition 8.1. Given a pair of sets A and B, suppose that each element x 2 A
is associated, in some way, to a unique element of B, which we denote f (x). Then
f is said to be a function from A to B. This is often denoted
f : A ! B.
Intuitively, you can think of the domain as the inputs of f , the range as the
outputs of f , and the codomain as a possibly-larger set in which all the outputs live.
But at the end of the day, all three are just sets. They correspond to each other via
f , but they are just sets.
When you were young(er), the domain and codomain were usually the set R. The
range, though, varied a lot. The range consists only of the elements in the codomain
which get hit — that is, y is in the range if there is an x in the domain that maps
to it: f (x) = y. For example, if f : R ! R is given by f (x) = 2x, then the range is
R. But if f : R ! R is given by f (x) = x2 , then the range is the set of nonnegative
real numbers: the interval [0, 1); 4 and 9 are in the range because f (2) = 4 and
f ( 3) = 9, but 1 is not in the range, because no x 2 R has the property that
f (x) = 1. Before showing you some diagrams, we have a Recurring Theme Alert.
A function’s domain and codomain can be any sets, though. For example, here’s
a graphical way to write a function f :
Æ •
• m
˝ •
• å
b •
• ˝
1 •
This is a function with domain {1, b, ˝,Æ}, codomain {˝,å,m}, and range
{˝,m}. For example, f (1) = ˝, so ˝ is in the range. However, there does not
exist any x 2 {1, b, ˝,Æ} such that f (x) = å, which is why å is not in the range.2
For a diagram like this to not represent a function, it would have to have fail
either the existence or the uniqueness part of being a function, as discussed in the
Recurring Theme Alert. Below are two examples.
• m • m
˝ • ˝ •
• å • å
b • b •
• ˝ • ˝
1 • 1 •
It is perfectly ok to have two arrows pointing at the same dot in the codomain,
but for the domain the rules are rigid: one and only one line must emanate from
each dot. So the two diagrams above would not be functions;3 the first because b is
being sent to nowhere, and the second because ˝ is being sent to two places.
2
3
«
something profound about love »
We use similar language in the real world. If you dial someone’s number, but the call goes
nowhere, then you would say your phone isn’t functioning. Or if you dialed a single phone number,
but half the time the call went to Mikaela and half the time the call went to Brandon, then you
would again say that your phone is not functioning. If something is properly functioning, it always
does exactly what it is intended to do.
250 Chapter 8. Functions
In high school you were probably taught the vertical line test to check whether a
graph corresponds to a function. Below are two examples of that.
The vertical line test says that if every vertical line hits the graph in one (existence)
and only one (uniqueness) spot, then the graph corresponds to a function. So the left
example was a function, while the right example would not, according to this test.
Does the vertical line test ever fail? Could f be a function and yet have a graph
which fails the vertical line test? This answer to this question actually comes down
to what you define a graph to be. If graphing a function on the xy-plane means that
it is a function from R to R (where the x-axis is the domain), then the vertical line
test will never fail. But if you do not insist on this, then the vertical line test could
fail. Take a moment to try to think up an example, and then check out the one in
the footnote.4 But let’s now look at more examples of functions.
Example 8.2.
This is the floor function, where you just round down. E.g., b3.2c = 3, and
b 3.2c = 4.
This is the usual square function, except that you can not plug anything
besides 1, 2, 3, 4 or 5 into g. For example, g( 2) and g(6) do not mean
anything since g is only defined to accept elements from its domain. Notice
that g’s range is {1, 4, 9, 16, 25}.
Definition.
B B
A A
•4 •4
z • z •
•3 •3
y• y•
•2 •2
x• x•
•1 •1
Does it make sense why the above does or does not satisfy the definition? The
second example is not injective because f (x) = 2 and f (y) = 2. So we have
f (x) = f (y) while x 6= y, as these are clearly distinct elements of the domain.
Basically, to be injective means that you do not have two arrows pointing at the
same point.
Interestingly, the contrapositive provides another way to think about an injection.
Recall that the contrapositive turns an implication like “f (a1 ) = f (a2 ) implies that
a1 = a2 ” into a logically equivalent implication, and even for definitions this can at
times be useful. Applying the contrapositive to (the second half of) the injection
definition gives this:
252 Chapter 8. Functions
Definition.
A A
B B
z • z •
•3 •3
y• y•
•2 •2
x• x•
•1 •1
w• w•
Again, read through the definition and convince yourself that the first example
satisfies it while the second does not. For the second, it is not true that for every
b 2 {1, 2, 3} there exists some a 2 {w, x, y, z} such that f (a) = b. Why? Because
b = 3 does not have this property! In terms of arrows, this means every dot in B has
at least one arrow pointing at it.
Let’s take a look at another way to define this same idea, by again applying the
contrapositive (and doing a little rearranging).
Equivalent to Definition 8.5. A function f : A ! B is surjective (or
onto) if there does not exist any b 2 B for which f (a) 6= b for all a 2 A.
Let’s check back in with our recurring theme.
Definition.
Let’s look at some examples and non-examples. For starters, if you pick a random
function, then it certainly possible — in fact, likely — that it is neither injective nor
surjective. Here is such a case:
4
z
3
y X X X
2
x
1
What about functions that are injective or surjective (or both)? The next table
covers these three cases.
254 Chapter 8. Functions
4
z
3
y X X X
2
x
1
z
3
y
x
2 X X X
1
w
z 4
y 3
X X X
x 2
w 1
Being bijective means that every element in A is paired up with precisely one
element in B. As an analogy, you could think about f as putting elements in A
into relationships with elements in B. Being injective means all the relationships are
monogamous, while being not injective means there is at least one polygamous person.
Being surjective means that everyone has found love,5 while being not surjective
means at least one person (in B) is left out. And being bijective therefore means
everyone has found love in a monogamous relationship.
In terms of arrows, being a bijection means that every dot on the left has precisely
one arrow emanating from it, and every dot on the right has precisely one arrow
entering it. (And yes, that sentence is screaming for another Recurring Theme Alert.)
Proposition. f : A ! B is an injection.
apply algebra,
logic, techniques
Therefore, x = y.
Alternatively, one could use the contrapositive, which would mean one starts by
assuming x 6= y, and then concludes that f (x) 6= f (y).
Proposition. f : A ! B is a surjection.
Proof. Assume b 2 B.
Magic to find an a 2 A
where f (a) = b
It is important to remember that when you choose a b 2 B (at the start of your
proof), it must be completely arbitrary. If B = R, make sure you are never assuming
that b is positive or negative or non-zero or an integer or anything like that. Your
work must be valid regardless what the b is. Recall that this is what we mean when
we say that we chose an arbitrary b 2 B. The only exception to this is if you divide
up your work into cases where you have, say, the negative case and the non-negative
case, or the zero and the non-zero case. But if you do that, then within each case’s
things up and use B as a domain, A as a codomain, and have f map things “in reverse,” then that
is perfectly fine as far as the definition of a function is concerned. Indeed, by discussing bijections
now, we are allowing ourselves to discuss a function’s inverse later.
256 Chapter 8. Functions
set you must choose an arbitrary b, and collectively the cases must cover all the
options in B.
Again, one could instead proceed via the contrapositive, although that tends to
be less common for surjection arguments.
To prove a function is a bijection, one way is to prove both of the above. A
separate way (using inverses) will be discussed later. Let’s do some examples.
Example 8.8. Let R+ denote the nonnegative real numbers. Prove the following.
(a) f : R ! R where f (x) = x2 is not injective, surjective or bijective.
(b) g : R+ ! R where g(x) = x2 is injective, but not surjective or bijective.
(c) h : R ! R+ where h(x) = x2 is surjective, but not injective or bijective.
(d) k : R+ ! R+ where k(x) = x2 is injective, surjective and bijective.
Scratch Work.7 Here we have three different functions. Each squares its input,
but a function is not only the operation, but the domain and codomain as well. And
since their domains/codomains do not match, they are all different functions. This
allows them to have different properties, as we are proving here.
From R ! R, or subsets thereof, the injective property is essentially a “horizontal
line test.” If every horizontal line hits the function in only one place, then the function
is injective. But if any horizontal line hits the function in more than one place, then
the function is not injective.
R f (x)
R g(x)
R R+
R+
h(x) R+
k(x)
R
R+
.
7
This is your periodic encouragement to try out problems on your own before reading the solution.
Proofs: A Long-Form Mathematics Textbook 257
Thus it makes sense that f is not injective while g and h are. To show that f is
not injective it will suffice to find any two points from the domain which map to the
same value in the codomain; I believe 1 and 1 should work (or 2 and 2, or any
other such pair).8
In order to prove that g and h are injective, we will assume that, say, g(x) = g(y),
and we will try to prove that x = y. This would be some natural scratch work:
g(x) = g(y)
x2 = y 2
p p
x2 = y 2
x = y.
Proof . Part (a). Observe that f ( 2) = f (2) while 2 6= 2, showing that f is not
injective. Next, observe that f (x) = x2 0 for all x 2 R, showing that there does
not exist an x 2 R for which f (x) = 4. And since 4 is in f ’s codomain, this
proves that f is not surjective. Since f is neither injective nor surjective, it is also
not bijective.
Part (b). Similar to part (a), because g(x) = x2 0 for all x 2 R+ , there does not
exist an x 2 R for which g(x) = 4. And since 4 is in g’s codomain, this proves
that g is not surjective, which also proves that g is not bijective.
To see that g is injective, assume x, y 2 R+ and g(x) = g(y). Then,
g(x) = g(y)
x2 = y 2
p p
x2 = y 2 .
Part (c). The fact that f is not surjective is just like with f : Note that h( 2) = h(2)
while 2 6= 2, showing that h is not injective. To show that h is a surjection, pick
any b in its codomain, R+ . p
Since b 0, its positive square root exists. Let’s call this
square root x; that is, x = b. Since x 2 R+ as well and
p
h(x) = x2 = ( b)2 = b,
we have shown that for every b 2 R+ there exists an x 2 R+ such that h(x) = b.
This proves that h is a surjection.
Part (d). The fact that k is an injection follows the same exact reasoning as with g,
and the fact that k is a surjection follows the exact same reasoning as with h. And
because k is both an injection and a surjection, it is also a bijection.
As you can see, proofs that a function is not an injection or not a surjection are
shorter than proofs that a function is an injection or surjection. For example, to
prove that f : R ! R where f (x) = sin(x) is not injective you simply have to note
that sin(0) = sin(⇡), and to prove it is not surjective you simply have to note that
1 sin(x) 1 for all x, and so there does not exist any x for which sin(x) = 17.
Again, this should feel like you are searching for a counterexample to a claim that
they are injective and surjective.
Let’s do another example where the function is a bijection.
Example 8.9. The function f : (Z ⇥ Z) ! (Z ⇥ Z) where f (x, y) = (x + 2y, 2x + 3y)
is a bijection.
Scratch Work. If we prove that f is an injection and a surjection, then that will
prove that f is a bijection. For the injection proof, the scratch work is basically just
the proof, so let’s instead focus on proving that f is a surjection. To do so, we must
show that for an arbitrary (a, b) 2 Z ⇥ Z, there exists some (x, y) 2 Z ⇥ Z such that
f (x, y) = (a, b); that is, every element in the codomain gets hit. How do we find such
an (x, y)? Scratch work! We want9
f (x, y) = (a, b)
(x + 2y, 2x + 3y) = (a, b).
When are two ordered pairs equal? Well, certainly (2, 3) 6= (4, 5), but also (2, 3) 6=
(2, 5) and (2, 3) 6= (4, 3). In order to have two ordered pairs equal, they must be equal
in both coordinates! Thus, in order to have (x + 2y, 2x + 3y) = (a, b), we must have
x + 2y = a and 2x + 3y = b.
9
Note that if f takes in a single number x as input, then we write f (x); we put parentheses
around the input. So, since in this case we are inputting an ordered pair like (x, y) into f , should
we write it as f (x, y) ? Meaning, shouldn’t we put another set of parentheses around the (x, y)
input? Sometimes this is done, but it is in fact more common to drop the outer parentheses and
just write f (x, y). In most cases it looks nicer and does not add any confusion. (Also, frankly, it is
hard to remember to put the second set there!)
Proofs: A Long-Form Mathematics Textbook 259
We want to figure out which x and y make this work, so we do algebra to solve for x
and y. And if you’ve taken linear algebra, you probably have lots of experience with
these sorts of calculations.10
First
equation Plug in x + 2y = a
x + 2y = a x2 2x + 4y = 2a this y
2x + 3y = b
! 2x + 3y = b ! x + 2(2a b) = a
sub-
y = 2a b tract ) x= 3a + 2b
According to this scratch work, in order for f (x, y) = (a, b), we would need
(x, y) = ( 3a + 2b, 2a b). We will use this in the surjective half of our proof below.
f (x1 , y1 ) = f (x2 , y2 )
(x1 + 2y1 , 2x1 + 3y1 ) = (x2 + 2y2 , 2x2 + 3y2 ).
Two ordered pairs are equal provided their first coordinates are the same and their
second coordinates are the same. Thus, the above tells us that
y1 = y2 . (å)
To conclude that x1 = x2 , we plug y2 in for y1 (by equation (å)) into equation (o):
x1 + 2y2 = x2 + 2y2 .
x1 = x2 .
10
x + 2y = a
A pair of equations like , where none of the terms are raised to any power, is called
2x + 3y = b
a system of linear equations, which may be familiar if you have taken a course in linear algebra.
260 Chapter 8. Functions
We have shown that if f (x1 , y1 ) = f (x2 , y2 ), then (x1 , y1 ) = (x2 , y2 ), proving that
f is an injection.
f (x, y) = f ( 3a + 2b, 2a b)
⇣ ⌘
= ( 3a + 2b) + 2(2a b) , 2( 3a + 2b) + 3(2a b)
⇣ ⌘
= 3a + 2b + 4a 2b , 6a + 4b + 6a 3b
= (a, b).
We showed that for any (a, b) from the codomain, there exists some (x, y) from the
domain such that f (x, y) = (a, b). Thus, f is surjective.
A B
B A
z• •4
•3 z •
y• •3
•2 y•
x• •2
•1 x•
w• •1
If this reminds you of the pigeonhole principle, then great job! You’re exactly
right! If this does not remind you of the pigeonhole principle, well, I think you’re
pretty great anyways. Below is the function version of the pigeonhole principle.
Theorem.
Theorem 8.10 (The func-y pigeonhole principle). Suppose A and B are finite
sets and f : A ! B is any function.
Proof . Part (a). Consider each element in A to be an object and each element of
B to be a box. Given an a 2 A, place object a into box b if f (a) = b. Since there are
more objects than boxes, by the pigeonhole principle at least one box has at least
two objects in it. That is, f (a1 ) = f (a2 ) for some distinct a1 and a2 , implying that
f is not injective.
Part (b). Since f is a function, each a 2 A is mapped to only one b 2 B. Thus,
k elements in A can map to at most k elements of B. And so the |A| elements in
A can map to at most |A| elements in B. However, since |A| < |B|, there must be
some elements not hit, meaning that f is not surjective.
Viewing the statements this way is beneficial for another reason: It demonstrates
clearly that in order for f to be a bijection — meaning an injection and a surjection — we
would need |A| = |B|.
It is also worth mentioning that this theorem still holds true in the case that |A|
and/or |B| are/is infinite.11 But proving this to be the case would take us too far
afield.
11
When both are infinite, some particularly exciting stuff happens! Stay tuned for an Introduction
to Cardinality following this chapter, in which these exciting implications are explored.
262 Chapter 8. Functions
A B C
g f
a g(a) f (g(a))
A f g C
a (f g)(a)
We also give this function a special name: We call it the composition of f with g.
Definition.
12
Free short story idea: g is a mild-mannered function, living a happy little life. She is particularly
proud of her codomain on which she has imprinted her whole image. Then, in the distance, riding
across the range, is f . A smooth-talking, mean-valued jerk, f has worked his way into the local
government’s higher powers. And under the authority of the Composition Committee, f obtains a
function injunction to seize g’s codomain to be his own domain! Drama ensues. Suggested title:
Eminent Domain.
Proofs: A Long-Form Mathematics Textbook 263
Example 8.12. Recall that R+ is the set of non-negative reals, and N0 = N [ {0}.
• Suppose
g:R!R where g(x) = x + 1
+
f :R!R where f (x) = x2 .
Then,
• Suppose
g : R ! R+ where g(x) = x2
f : R+ ! R+ where f (x) = x + 1.
Then,
(f g) : R ! R+ where (f g)(x) = x2 + 1.
• Recall that the floor function rounds integers down; e.g., b5.7c = 5. Suppose
g:R!Z where g(x) = bxc
f : Z ! N0 where f (x) = |x|.
Then,
13
SPOILER ALERT: What follows is the plot to the movie Inception. Opening plot: Let d(t) be
the dream function. Audience: *Very interested.* Plot development: What if d(d(t))? Audience:
*Whoa!!* Plot twist: What if d(d(d(t)))? Audience: *Loses their minds.*
264 Chapter 8. Functions
Theorem.
To do this, we will first use the fact that f : B ! C is injective, which tells us
that for any b1 , b2 2 B, if f (b1 ) = f (b2 ), then b1 = b2 . And what’re two things in B?
Both g(a1 ) and g(a2 ) are in B!
A B C
g f
ai g(ai ) (f g)(ai )
Since g(a1 ) and g(a2 ) are in B and f is injective, this tells us that f (g(a1 )) = f (g(a2 ))
implies g(a1 ) = g(a2 ).
Next is a direct application of g : A ! B being injective. We have a1 , a2 2 A and
g(a1 ) = g(a2 ), which by injectivity means a1 = a2 . Boom!
Theorem.
Proof Idea. We want to repeat the main idea from the last proof, in which we first
apply the property to one function, and then to the other. In this case, to prove
f g : A ! C is surjective, we want to prove that for any c 2 C, there exists some
a 2 A such that (f g)(a) = c. To get from C back to A, the trick is to stop off in B
along the way. Here’s the three-step overview, beginning on the right:
A B C
g f
a b c
Next, recall that a corollary is a result that follows quickly from previous results.
Our previous two theorems quickly give the following corollary.
266 Chapter 8. Functions
Corollary.
As we close out this section, here is one final note. Notice that in our definition
of function composition (Definition 8.11) we had functions g and f where g : A ! B,
and f : B ! C. Notice that we don’t really need the codomain of g to equal the
domain of f . If we had g : A ! B and f : D ! C where B ✓ D, that would be
enough (for the definition, and for these last two theorems). As long as g(a) is a part
of f ’s domain, then f (g(a)) will make sense, which is all we need.
8.4 Invertibility
In the reals, the multiplicative identity is 1, because a · 1 = a for all a 2 R. Every
non-zero number has a multiplicative inverse. For example, the multiplicative inverse
of 4 is 14 , because 4 · 14 = 1. And the multiplicative inverse of 13 is 3, because
1
3 · 3 = 1. The multiplicative inverse is whatever you have to multiply by to get the
multiplicative identity element of 1.
Likewise, in the reals the additive identity is 0, because a + 0 = a for all a 2 R.
Every real number has an additive inverse. For example, the additive inverse of 6 is
6, because 6 + ( 6) = 0. And the additive inverse of 2 is 2, because ( 2) + 2 = 0.
The additive identity is whatever you have to add to get the additive identity element
of 0.
There is also an identity function, which is analogous to 1 and 0 above in that
when you apply it to any function, the function is unchanged. Except instead of
multiplication and addition, the operation is function composition. In this way, many
functions will also have inverses.
Definition.
An inverse undoes the function. If x was sent to y by f (that is, f (x) = y), then
y will be sent to x by f 1 (that is, f 1 (y) = x). Here’s a small example.
A B B A
4• •z z • •4
3• •y y• •3
2• •x x• •2
1• •w w• •1
1
f : {1, 2, 3, 4} ! {w, x, y, z} f : {w, x, y, z} ! {1, 2, 3, 4}
A B A A A
4• • •4 4• •4
z
3• • •3 3• •3
y
2• •
x
•2 2• •2
1• •
w
•1 1• •1
1
f f : {1, 2, 3, 4} ! {1, 2, 3, 4} iA : {1, 2, 3, 4} ! {1, 2, 3, 4}
B A B B B
z • • •z z • •z
4
y• • •y y• •y
3
x• • •x x• •x
2
w• • •w w• •w
1
1
f f : {w, x, y, z} ! {w, x, y, z} iB : {w, x, y, z} ! {w, x, y, z}
268 Chapter 8. Functions
1 1
(f f )(x) = f (f (x)) = f (x 1) = (x 1) + 1 = x
and
1 1 1
(f f )(x) = f (f (x)) = f (x + 1) = (x + 1) 1 = x.
• If f : [0, 1] ! [0, 2] where f (x) = 2x, then f 1 : [0, 2] ! [0, 1] is the function
f 1 (x) = 12 x.
B
A
•4
z •
•3
y•
•2
x•
•1
Why does this function not have an inverse? Because where would f 1 send 3? A
function has to send everything somewhere, so if the function f 1 did exist, it would
need to know what to do with 3. But f is silent on this point. This is why f must
be surjective, because otherwise f 1 will not even exist.
Next, suppose that f were not an injection; e.g., like this:
A
B
z•
•3
y•
•2
x•
•1
w•
Why does this function not have an inverse? Because where would f 1 send 2?
A function has to send everything to only one destination, so if the function f 1 did
exist, it would need to know what to do with 2. But f has two conflicting demands
on this point. This is why f must be injective in order for f 1 to exist.
We have argued that f must be injective and must be surjective; that is, if f is
invertible, then f is a bijection. Is the converse true? Is it true that every bijection
is invertible? The answer is yes, by similar reasoning to the above. Bijections are
functions which pair up the each element in the domain with an element in the
codomain, in such a way that every element in both sets is in a single pair. And
what determines the pair? The function f does: a is paired with b if f (a) = b. This
allows the inverse to pair up b with a, by having f 1 (b) = a. Perfect! This discussion
is the idea behind the proof of the following theorem.
Theorem.
To see that f is an injection, let a1 , a2 2 A and assume f (a1 ) = f (a2 ). Note that
f (a1 ) (and hence f (a2 ), since they’re equal) is an element of B due to the fact that
f : A ! B. And so, since f 1 : B ! A, we may apply f 1 to both sides:
f (a1 ) = f (a2 )
1 1
f (f (a1 )) = f (f (a2 ))
a1 = a2 ,
by the definition of the inverse. Thus, f is an injection. And since we already showed
that f is a surjection, it must be a bijection. This concludes the forward direction of
the theorem.
As for the backwards direction, assume that f is a bijection. For b 2 B, we will
now define f 1 (b) like this:
f 1 (b) =a if f (a) = b.
That is, we are defining f 1 to act as an inverse from B to A should act, without yet
claiming that f 1 is a function. Our goal now is to demonstrate that this definition
of f 1 satisfies the conditions to be a function, which would prove that f is invertible.
To do so, recall that to be a function there is an existence condition (f 1 (b) must be
equal to some a 2 A) and a uniqueness condition (f 1 (b) must be equal to only one
a 2 A). We will check these separately.
Existence: Let b 2 B. Since f is surjective, there must be some a 2 A such that
f (a) = b. Hence, by our definition of f 1 , we have f 1 (b) = a. We have shown that
for every b 2 B there exists at least one a 2 A for which f 1 (b) = a, which concludes
the existence portion of this argument.
Uniqueness: Suppose f 1 (b) = a1 and f 1 (b) = a2 , for some b 2 B and a1 , a2 2 A.
By the definition of f 1 , this means that f (a1 ) = b and f (a2 ) = b. But since f is
injective, this means that a1 = a2 . We have shown that f 1 (b) can not be equal to
two different elements of A, which concludes the uniqueness portion of this argument.
Combined, these two parts show that f 1 : B ! A is a function, hence proving
that f is invertible.
We have proved the forwards and backwards directions of Theorem 8.17, which
completes its proof.
compression algorithms, but sadly it does not exist. Many types of files can certainly
be compressed and then later inverted without losing data, but there is no universal
lossless compression algorithm.
Proposition.
Proposition 8.18. There does not exist a universal lossless compression algo-
rithm.
Proof . Assume for a contradiction that there does exist a universal lossless compres-
sion algorithm. Messages are sequences of bits (0 or 1), and a compression algorithm
takes in a message of length n and outputs a message of a smaller length — length at
most n 1. Let A be the set of all messages of length at most n, and let B be the set
of all messages of length at most n 1. Then by applying the lossless compression
algorithm to every string in A, the algorithm can be viewed as a function f : A ! B.
Observe that |A| > |B|, as there are certainly more strings of length at most n
than strings of length at most n 1. So, by the func-y pigeonhole principle (Theorem
8.10), f is not an injection. Then, by the definition of a bijection (Definition 8.7),
this also means that f is not a bijection. And by Theorem 8.17, this means that f is
not invertible. This is a contradiction: Since f is our compression function, being
able to retrieve a compressed file x would be equivalent to asking for f 1 (x). And so
if f 1 does not exist, then such an algorithm is impossible.
Another way to think about this is that, because f is not injective, there must
exist two files, a and b, for which f (a) = f (b). That is, two files which were com-
pressed to the same smaller file. And it makes sense that it is impossible to undo
this compression, because when presented with the file f (a), it is impossible to tell if
it was a or b before the compression.
on Page 255. To show f is an injection, we assume that f (x) = f (y) and do algebra
to show that x = y. To show that f is a surjection, we pick a b 2 (0, 1) and show
that there is some x 2 (0, 1) such that f (x) = b. Let’s do some scratch work to
determine which x we should use in our proof.
f (x) = b
1
=b
x+1
1
=x+1
b
1
1=x
b
Looks like if pick x = 1b 1, then f (x) = b. The x we choose must be from our
domain; is this x? Since b 2 (0, 1), notice that 1b > 1. So 1b 1 > 0. So yes, everything
seems ok there. Let’s write out a proof! Starting with the injective part.
1 1
= .
x+1 1+y
Simplifying,
y+1=x+1
y=x
x = y.
Surjective. Suppose that b 2 (0, 1). We wish to find an x from the domain for which
f (x) = b.
Let x = 1b 1. Notice that b 2 (0, 1) implies the following: Since b < 1 and b is
positive, we can divide both sides by b to get 1 < 1b . Hence, 0 < 1b 1, which means
that 0 < x. Thus we have demonstrated that x 2 (0, 1), our function’s domain.
Next, observe that
✓ ◆
1 1 1
f (x) = f 1 = 1 = = b.
b b 1 +1 1/b
That is, for any b 2 (0, 1) we found an x 2 (0, 1) for which f (x) = b. Thus, f is
surjective.
1
y= ,
x+1
1 1 1 1 1
x= ) y+1= ) y= 1 ) f (x) = 1.
y+1 x x x
First, this probably looks familiar: It is the x we found in the surjective portion
of the last proof! And if you spend 20 seconds staring at the above computation, and
then another 15 seconds comparing it to the computation in last example’s scratch
work, you’ll realize that this is no coincidence. But does the pre-calc strategy work
in general? And if so, why?
Answer: If your function f (x) has a simple-enough formula that you can set
y = f (x), switch the variables to get x = f (y), and solve this equation for x, then
yes, you will have found a formula for the inverse. (And at times this can work even
if f is a function of more than one variable, or of, say, an ordered pair.)
The inverse (when it exists) of a function f is the function that undoes it. If f
sends x to y (meaning, y = f (x)), then f 1 sends that same y back to that same
x. This suggests a slightly simpler way to find inverses, avoiding all the “switching
x and y” business: if we started with y = f (x) and simply solved for x, this would
gives us the answer for f 1 , only it would be expressed as a function of y instead of
a function of x. For example, the above computation would instead look like this:
1 1 1 1 1
y= ) x+1= ) x= 1 ) f (y) = 1.
x+1 y y y
We get the same inverse as before, just written in terms of a different variable.
Now, it seems like teachers decades ago decided that to have a function written
in terms of y would be confusing to students, so they told students to first switch
the ‘x’ and the ‘y’ so that in the end you get a function in terms of x. Perhaps this
way an attempt to lower the blood pressures of a million anxious students. While I
understand this, to me it seems is silly, since (1) it is an extra and unnecessary step,
and (2) writing the inverse in terms of y would help emphasize that f and f 1 have
their domains and codomains switched. But alas, I don’t have the power to change
things.15
Now, this is just discussion; we haven’t proven any theorems about this. So if
you use either of these approaches to find an inverse, consider it just scratch work.
At the end you should still verify that your inverse is true by checking it against the
definition of an inverse. Below is an example where we do this.
15
Future Pre-Calc Teachers: You do have the power!
274 Chapter 8. Functions
y = 2x + 5
y 5 = 2x
y 5
x= .
2
1 y 5
So f (y) = should be the inverse (written in terms of the variable y).
2
x 5
Proof . We claim that f : R ! R where f 1 (x) = is the inverse function of f .
2
To prove this, we check the definition. Note that
✓ ◆ ✓ ◆
1 x 5 x 5
f (f (x)) = f =2 + 5 = (x 5) + 5 = x
2 2
and
1 1 (2x + 5) 5 2x
f (f (x)) = f (2x + 5) = = = x.
2 2
We have shown that f f 1 and f
f are both the identity function on R. Therefore,
1
x 5
by the definition of the inverse (Definition 8.16), we have prove that f 1 (x) =
2
is the inverse of f .
Proofs: A Long-Form Mathematics Textbook 275
— Chapter 8 Pro-Tips —
• Function composition is the idea of applying a function to another function.
The idea of applying one thing to another, or in particular of applying one thing
to itself, is an important one in mathematics. Indeed, in the bonus examples of
Chapter 7 we discussed the halting problem, in which in order to study whether
a program exists, we assumed it did and then plugged it into itself. Another
example of this. . .
• In math, it doesn’t really matter what you choose as a variable name. You can
say “let x 2 N” or “m : R ! R is a function given by m(f ) = f 2 .” You could.
A computer wouldn’t care. But despite mathematicians working in the realm
of pure truths and deep ideas. . . we are humans too, darn it, and we like what
we like.
Mathematicians have come to prefer using x and y to represent a real
number. We like to use k, m and n as representing integers. We like to use
p and q as prime numbers. We like z for a complex number. We like " for a
small positive number. We use capital letters for our sets and lower case for
our elements, and while we sometimes dress ourselves from head to toe in drab,
mismatched clothes,16 we would never dare mismatch our elements and our
sets: we always let a 2 A and b 2 B. This is who we are.
16
First day of work at my tenure-track job was a simple pre-semester department meeting. I
remember wondering how nicely I should dress. A button-up rather than a t-shirt — that seemed
obvious. . . It’s nearly 100 out, but shorts seemed unprofessional. . . should the pants be nice or
are jeans ok? What about sneakers? I erred on the side of caution, drove to work, showed up to
the meeting. . . and there were shorts, t-shirts and Hawaiian shirts everywhere. One prof wasn’t
even wearing shoes. And when all of these attires continued into the semester, I realized that as a
mathematician there are some things you can get away with.
Once you start giving talks at various departments, especially ones whose colloquia are open to
the public, you will start to wonder whether the ragged fella in the back is a disheveled emeritus
professor, a homeless person, or the guy who will be taking you out to Thai food later that night. It
can, on occasion, be genuinely hard to tell.
276 Chapter 8. Functions
— Exercises —
Exercise 8.1. For each of the diagrams below, determine whether the diagram
represents a function. If it does, determine whether the function is injective, surjective,
bijective, or none of these.
(a) (c)
B
A A B
•4
z • z • •3
•3
y• y• •2
•2
x• x• •1
•1
(b) (d)
A A B
B
z• z• •4
•3
y• y• •3
•2
x• x• •2
•1
w• w• •1
p
Exercise 8.2. Give two reasons why “f : R ! R where f (x) = ± x ” is not a
function.
Exercise 8.3. In pre-calculus you may have written things like this:
x2 + x 6 (x⇠ ⇠
+⇠3)(x
(x + 3)(x 2) ⇠ 2)
= = ⇠⇠
=x 2.
x+3 x+3 ⇠
x+ 3
x2 +x 6
This seems to suggest that f (x) = x+3 and g(x) = x 2 are the same function.
Explain why they not.
Exercise 8.4.
(a) Define f : N ! Z where f (n) = n 5. Determine the range of f .
(b) Define g : R ! R where g(x) = bxc; this is the floor function from Example 8.2,
just with a new codomain. Determine the range of g.
(c) Define h : R \ {0} ! R where h(x) = 1
x2
. Determine the range of h.
Proofs: A Long-Form Mathematics Textbook 277
Exercise 8.10. Let A and B be finite sets for which |A| = |B|, and suppose
f : A ! B. Prove that f is injective if and only if f is surjective.
(b) For the set B from part (a), find the inverse of f : A ! B.
3x
Exercise 8.14. Consider the function f : R \ {1} ! R \ {3} where f (x) = .
x 1
1 x
Prove that f 1 : R \ {3} ! R \ {1} where f (x) = is indeed the inverse of f
x 3
by showing that it satisfies the definition of an inverse.
(a) Conjecture 1: (f + g) h = (f h) + (g h)
(b) Conjecture 2: h (f + g) = (h f ) + (h g)
For this problem, recall that “f + g” is the function (f + g)(x) = f (x) + g(x).
Exercise 8.22. Write down your own definition for what you think it should
mean to say a function f : R ! R is continuous.
Exercise 8.24. How many functions are there from {1, 2, 3} to {1, 2, 3}? For
n 2 N, how many functions are there from {1, 2, . . . , n} to {1, 2, . . . , n}? How many
bijections are there from {1, 2, . . . , n} to {1, 2, . . . , n}?
Exercise 8.25. In a previous math class you probably learned that a permutation is
a rearrangement of a collection of objects. For example, “1 a ˝ ,” is a permutation of
“, ˝ 1 a”. Explain why the definition in the box above jives with your rearrangement
intuition.
280 Chapter 8. Functions
and
|{1, 4, 9, 16, 25, . . . , 100}| = 10,
and
|Z| = 1.
While the cardinality of finite sets seems simple enough, you might agree that
when discussing sets of infinite size, the idea of size seems somewhat murky. Are we
ok saying that N and Z and R all have the same size, even though Z contains all of N
and more, and R seems vastly larger than both? We need a precise characterization
of what we mean when we say that two sets have the same size.
What mathematicians settled on is this: two sets have the same size if there is a
way to pair up the elements between the two sets. And if this language of “pairing
up” elements sounds familiar, it is because in Chapter 8 we drew lots of diagrams
arguing that a bijection does precisely that! So what does it mean to say that two
sets have the same size? It means there is a bijection between them. This is known
as the bijection principle.
17
And it’s at least semi-faintly-plausible. If he had said, “There is no problem in the whole of
mathematics which cannot be solved by the quadratic formula,” now that would have been quite
the hot take.
283
284 Chapter 8. Functions
Principle.
Principle 8.21 (The bijection principle). Two sets have the same size if and
only if there is a bijection between them.
Example 8.22. One reason that the sets {1, 2, 3} and {a, b, c} have the same size is
that the elements can be paired up like this:
And one reason that {x, y, z} and {m, a, t, h} do not have the same size is that the
elements can not be paired up. Whenever you try, one element from the second set
won’t get a pair. In particular, by Theorem 8.10, there do not exist any surjections
f : {x, y, z} ! {m, a, t, h}, and hence there can not exist a bijection between these
sets.
The really cool thing, though, is that this definition of the size of a set applies
even to infinite sets. And that implies some truly fascinating things.
Counting Infinities
The ability to “pair up” elements between two sets is what it means for them to have the
same size — this is perfectly intuitive for finite sets with nothing too counterintuitive
resulting, but with infinite sets. . . well, some pretty neat stuff pops out. Indeed, the
pluralization in this section’s title was first your sign of the miracles to come.
Hilbert’s Hotel
“No other question has ever moved so profoundly the spirit of man; no
other idea has so fruitfully stimulated his intellect; yet no other concept
stands in greater need of clarification, than that of the infinite.”
– David Hilbert
We begin by talking about the set of problems related to the so-called Hilbert’s
Hotel. Assume that there is a hotel, called Hilbert’s Hotel, which has infinitely many
rooms in a row.
Hilbert’s Hotel
No Vacancy
1 2 3 4 5 6 7 8 9 10 11 ...
Proofs: A Long-Form Mathematics Textbook 285
• Assume every room has someone in it, and so the “No Vacancy” sign has been
turned on. With most hotels this would mean that if someone else arrives at
the hotel, they will not be given a room. But this isn’t the case with Hibert’s
Hotel. If, for n 2 N, the patron in room n moves to room n + 1, then nobody
is left without a room and suddenly room 1 is completely open! So the new
customer can go to room 1. We created a room out of nothing!18
• What if, however, we have infinitely many people lined up wanting a room.
Can we accommodate all of them? Yes! We still can! Just have the person in
room n move to room 2n. Then all of the odd-numbered rooms are vacant and
the infinite line of people can take these rooms.19
The first point of this exercise is to simply realize that weird stuff can happen
when dealing with the infinite. The second point, though, is to realize that each time
the people switched rooms, those same exact people got new rooms. So in the first
example when they each just moved one room down, that should mean that there
are just as many rooms from 1 to 1 as there are from 2 to 1. . . And likewise for the
others.
Indeed, with this in mind, let’s talk about sizes of specific sets. But first, a ditty:
(repeat)
Specific Sets
Example 8.23. There are the same number of natural numbers as there are natural
numbers larger than 1 (that is, |N| = |{2, 3, 4, . . . }|). What’s the bijection that shows
this? Let
f : N ! {2, 3, 4, . . . } where f (n) = n + 1.
18
Make sure you take a moment to appreciate how remarkably, wonderfully weird this is.
19
Make sure you take a moment to appreciate how remarkably, wonderfully weird this is.
286 Chapter 8. Functions
The Moral. Two sets can have the same size even though one is a proper subset of
the other.20
Example 8.24. There are the same number of natural numbers as even natural
numbers (that is, |N| = |2N|). What’s the bijection that shows this? Let
The Moral. Two sets can have the same size even though one is a proper subset of
the other and the larger one even has infinitely many more elements than the smaller
one.21
And in a similar way, one can prove that |N| = |Z|. Indeed, a bijection f : N ! Z
can be given by following this pattern:
f (1) = 0
f (2) = 1
f (3) = 1
f (4) = 2
f (5) = 2
f (6) = 3
..
.
4 3 2 1 0 1 2 3 4
20
Make sure you take a moment to appreciate how remarkably, wonderfully weird this is.
21
Make sure you take a moment to appreciate how remarkably, wonderfully weird this is.
Proofs: A Long-Form Mathematics Textbook 287
In fact, one can even prove the remarkable fact that |Z| = |Q|. We won’t discuss
the details, but just as we winded our way through the integers in the previous
diagram, you can do likewise with the rational numbers. Here is the diagram which
accompanies (the positive portion of) that argument:
1 2 3 4 5 6 7 8 ...
With this, it is the case that |N| = |Z| = |Q|. Now, at this point you might be
tempted to predict that the reason all these sets have the same size is that they all
have infinitely many elements, and maybe all infinities are the same and that’s all
there is to it. . . But amazingly that’s not actually the case, as the next result states.
Theorem.
Theorem 8.25. There are more real numbers than natural numbers.
Proof . Since N ✓ R, clearly |N| |R|. To show that they are not equal, we must
prove that there is no bijection between R and N. Let’s again use the “pairing up”
idea. We will prove it by contradiction. In fact, we will prove the stronger statement
that there are more real numbers in (0, 1) than there are natural numbers. (This of
course would prove the larger statement since then we could say |R| |(0, 1)| > |N|.)
22
An infinite set of size |N| is said to be countable. Infinite sets of size larger than |N| are said to
be uncountable. Thus, N, Z and Q are countable, while R is uncountable.
288 Chapter 8. Functions
Assume for a contradiction that there does exist some way to pair up the naturals
with the reals in (0, 1). Writing these reals in decimal notation, assume the pairing is
this:
1 $ 0 . a11 a12 a13 a14 a15 a16 a17 a18 ...
2 $ 0 . a21 a22 a23 a24 a25 a26 a27 a28 ...
3 $ 0 . a31 a32 a33 a34 a35 a36 a37 a38 ...
4 $ 0 . a41 a42 a43 a44 a45 a46 a47 a48 ...
5 $ 0 . a51 a52 a53 a54 a55 a56 a57 a58 ...
6 $ 0 . a61 a62 a63 a64 a65 a66 a67 a68 ...
7 $ 0 . a71 a72 a73 a74 a75 a76 a77 a78 ...
8 $ 0 . a81 a82 a83 a84 a85 a86 a87 a88 ...
..
.
So we are assuming that on the left of the arrows is every natural number, and
on the right of the arrows is every number in the interval (0, 1), and they are just
paired up in some way. (And note that each aij is some digit, from 0 to 9.) This
proof is due to Georg Cantor and his next idea is quite brilliant. He said, focus now
on the “diagonal” of the above. That is, focus on the numbers of the form aii .
All real numbers were supposed to be paired up, but we are now going to create
a real number that was not in that above list. The new real number will be different
than the first number in its 1st position, different than the second number in its 2nd
position, different that the third number in the 3rd position, and so on. The number
will have decimal expansion
b = 0 . b1 b 2 b 3 b 4 b 5 b 6 b 7 b8 . . .
the first position (b1 6= a11 ). We know b is not paired up with 2 because b and that
number are different in the second position (b2 6= a22 ). In general, we know b is
not paired up with k because b and that number are different in the k th position
(bk =
6 akk ). So this real number b is not anywhere to be found! Thus we have reached
a contradiction; clearly we were unable to pair up all the reals, if b got left out.
Theorem.
Theorem 8.26. There are different sizes of infinity. Moreover, N, Z and Q are
all the same size, while R is larger.23
Do you think there is a smaller infinity than |N|? Or is |N| the smallest? Do you
think that there are any sizes of infinity between |N| and |R|? Or not? What size of
infinity do you think |R2 | and |P(R)| are? The same size as |R|? Bigger?
If you find this material a little disquieting, you are not alone. When Cantor’s
theorems were first published a century and a half ago, many of the great mathemati-
cians of the day responded with disgust. Henri Poincaré called it a “grave disease”
infecting mathematics, Leopold Kronecker accused Cantor of being a “corrupter of
youth” (a charge that Socrates was sentenced to death for!), and many Christian
theologians thought his work against the notion of a unique infinite was an affront to
“God’s exclusive claim to supreme infinity.” 24 Cantor struggled with this for decades.
On the other hand, if this material interests you, then I applaud you and encourage
you to read up on Russell’s paradox and Cantor’s theorem, as it is the next step down
a fascinating rabbit hole (which, quite literally, is a bottomless pit of mystery). And
you should know that Cantor’s legacy has been fully restored. The criticisms of the
past have been replaced ten times over with praise and accolades. One early defender
was the great David Hilbert. Towards the end of Cantor’s career, Cantor was awarded
the highly-prestigious Sylvester Medal by the Royal Society for his mathematical
research. Some criticized this move, but Hilbert — characteristically ahead of his
time — recognized the brilliance and importance of Cantor’s work, saying:
“No one shall expel us from the paradise that Cantor has created.”
23
Make sure you take a moment to appreciate how remarkably, wonderfully weird this is.
24
Or, less melodramatically:
There was a young fellow from Trinity,
p
Who took 1.
But the number of digits
Gave him the fidgets;
He dropped Math and took up Divinity.
—George Gamow
Chapter 9: Relations
For millennia, “math” basically meant geometry or primitive number theory. The
Pythagorean theorem, for example, was phrased geometrically; it wasn’t the algebraic
equation a2 + b2 = c2 that we teach our kids to ramble off today. Indeed, the use of
variables to describe unknowns in any sort of algebraic equations didn’t make their
first appearance until after Christopher Columbus’ famous voyage to not-America, and
even then it was far from our modern notation. It is a surprisingly recent innovation!
And abstract algebra, for its part, was still centuries away.
The 1600s saw the likes of Issac Newton, who led a charge to use mathematics
to understand the physical world. The 1700s saw the likes of Leonhard Euler, who
ushered in a purer form of mathematics which required no physical application or real
world connection. These ideas led to a movement of abstraction and generalization
which flourished in the 1800s, and is the topic of this chapter.
2 ⌘ 3 (mod 5)
3 ⌘ 3 (mod 5)
8 ⌘ 3 (mod 5)
13 ⌘ 3 (mod 5).
3⌘ 2 (mod 5)
3 ⌘ 3 (mod 5)
3 ⌘ 8 (mod 5)
3 ⌘ 13 (mod 5).
291
292 Chapter 9. Relations
2 ⌘ 13 (mod 5)
13 ⌘ 8 (mod 5)
2 ⌘ 8 (mod 5)
13 ⌘ 3 (mod 5).
For each of these, if you check the definition of modular congruence (Definition 2.14)
you will find that they hold. For example, 2 ⌘ 13 (mod 5) because 5 | ( 2 13),
because 5( 3) = 2 13.
So in this mod-5 way, every number in { 2, 3, 8, 13} is equivalent to every other
number in this set, including to itself. And this will extend:
Mod-5 Property. If you pick any two numbers in the set
• {. . . , 10, 5, 0, 5, 10, 15, 20, 25, . . . },
then they will be mod-5 equivalent to each other. Moreover, each number
in this set is also mod-5 equivalent to itself. This property also holds for
each of the following sets:
• {. . . , 9, 4, 1, 6, 11, 16, 21, 26, . . . }
• {. . . , 8, 3, 2, 7, 12, 17, 22, 27, . . . }
• {. . . , 7, 2, 3, 8, 13, 18, 23, 28 . . . },
• {. . . , 6, 1, 4, 9, 14, 19, 24, 29, . . . }
These five sets are called the equivalence classes of the mod-5 equivalence
relation. They also have this important property: They completely
partition Z; that is, every integer is in precisely one of these sets.
Quick break to talk about partitions: A partition is simply any way to break up
a set into a collection of subsets. For example, a partition of {1, 2, 3, 4, 5} is the
collection {1, 2}, {3, 5} and {4}. Another partition is {1, 3, 4, 5} and {2}. What’s
important here is that each of the five elements went into one and only one of the
parts. As long as the entire set is divided up, and you didn’t allow any element to go
into more than one of the parts, then you have a partition.
Definition.
1
Recurring Theme Alert. “one and only one” is an existence and uniqueness condition.
2
For the curious, there is a more formal way to define a partition, and it [
is this: A partition
is a collection of non-empty sets {Pi }i2S such that (1) Pi ✓ A for all i, (2) Pi = A, and (3)
i2S
Pi \ Pj = ; for all i 6= j. See if you can convince yourself that the two definitions are equivalent.
Proofs: A Long-Form Mathematics Textbook 293
Here are five more examples: A partition of Z is the set of evens and the set
of odds. Another partition of Z is the positive integers, the negative integers and
{0}. Another is the non-17 integers and {17}. Another is the five sets in the Mod-5
Property section on the previous page. And the simplest partition of Z is simply
Z — a partition with only one part.
Ok, let’s now get back to equivalence. We were just looking at (maximally-sized)
sets of numbers which are all mod-5 equivalent to each other, and we found that
there are five such sets. Moreover, these sets comprised a partition of Z:
The deep insight from modern algebraists is to ask what properties are required to
give us this partition property? Is it necessary that 5 is prime? Or, if we switched
mod 5 to mod 6 in that example, would a partition of Z still be produced?3 Or, even
better, can you describe the properties that produce a partition without any mention
of mods?
To start our journey of abstraction, just for a moment let’s use this notation:4
Given5 this definition of ⇠, see if you can prove each of three properties in the
following box.
• a ⇠ a for all a 2 Z;
Not only does the mod-5 property satisfy these three important properties,
but it turns out that these three are precisely what is required to produce this
equivalence/partition property. Here’s what I mean: Suppose “⇠” no longer means
mod-5 equivalence on Z. Instead, suppose you were only told that A is some set,
3
Spoiler: Yes, you still get a partition. However, the mod-6 equivalence relation will produce six
equivalence classes instead of five.
4
Note: In later examples, a ⇠ b will mean something else. So we are not saying a ⇠ b means
a ⌘ b (mod 5) forever. In each problem, it takes on a new meaning, but all the meanings are going
to be connected.
5
Pro-Tip: “⇠” is typically read as “tilde,” and is pronounced till-duh.
294 Chapter 9. Relations
and for some pairs of elements from A, you are told that a is “related” to b (denoted
a ⇠ b)6 while for others pairs you are told that a is “not related” to b (denoted a 6⇠ b).
But you are told nothing else about A and you have no idea what rule is determining
which pairs have a ⇠ b and which have a 6⇠ b.
Given that setup, here’s the miracle: If ⇠ satisfies the three bullet-point properties
in the box above, then the set will naturally partition itself into equivalence classes.
And if ⇠ does not satisfy one or more of these three properties, then the set will not
partition itself into equivalence classes (meaning that at least one element will either
be in no equivalence class, or in more than one equivalence class). Here’s a quick
example of the latter:
a⇠b if a b.
You may notice that a ⇠ a for all a 2 N; for example, 3 3 and 15 15. You
may also notice that if a ⇠ b and b ⇠ c, then a ⇠ c; for example, since 10 6 and
6 3, it is also true that 10 3. So the first and third bullet points are satisfied.
But what about the second? If a ⇠ b is it true that b ⇠ a? Nope! For example, 5 3,
but 3 6 5.
And so our next theorem says that this relation will not partition the numbers
from A into “equivalence classes.” To demonstrate this through a particular case,
think about all the numbers a for which 6 ⇠ a. If you put all of them into a set it
would be this:
{1, 2, 3, 4, 5, 6}.
What about the set all numbers a for which 4 ⇠ a? Or 8 ⇠ a? Those are these
sets:
{1, 2, 3, 4} and {1, 2, 3, 4, 5, 6, 7, 8}.
You see? It’s not working! There’s no grand partition happening. Just take a look
at the three sets above: In the set that 6 generated, we included 4 (because 6 ⇠ 4),
however in the set that 4 generated, we did not include 6 (because 4 6⇠ 6). And 2
is in all three of these sets! A partition has to have every number in exactly one
set. So this ⇠ relation on N is not producing the “equivalence classes” and partition
properties that the mod-5 ⇠ relationship on Z produced.
Returning now to the three bullet points, these three properties are indeed precisely
what’s important in order to produce this equivalence class/partition property. Mod-5
equivalence has all sorts of properties related to divisibility and prime factorizations
and the division algorithm and remainders. There is a lot that can be said about
6
To be clear, this ⇠ is not the same as the “not” symbol from when we studied logic. In math,
symbols are often reused, and as you will see, ⇠’s exact meaning in this chapter will change from
problem to problem. In stats, they also use this symbol to write things like X ⇠ N (0, 1), to assert
the distribution of a random variable. In asymptotics, they use this symbol to say that two functions
are growing at basically the same rate, like ⇡(x) ⇠ ln(x)x
; in fact, this final use of ⇠ is also an
equivalence relation, which we will be discussing in a moment. (Note: ⇡(x) is an important function
which we defined in the Introduction to Number Theory.)
Proofs: A Long-Form Mathematics Textbook 295
mod-5 equivalence, but for equivalence classes and partitions, all that matters is that
they satisfy those three properties — the rest is fluff. Likewise, the equivalence classes
in the last example failed to produce a partition, and as we will soon prove, this was
solely because ⇠ was not “symmetric,” which we will define next. This is the art of
discovering what really matters to obtain a result. Let’s now formally record these
definitions and results.
Definition.
Definition.
{b 2 A : a ⇠ b}.
Theorem.
Example 9.6. Recall that the floor function is the function that rounds down. For
example, b2.6c = 2. Now, let ⇠ be the relation on R where
For positive values, this would mean they have the same integer part; for example,
12.4 ⇠ 12.85 since b12.4c = b12.85c = 12.
We can verify that ⇠ is an equivalence relation10 by checking that it satisfies
Definition 9.3: it is reflexive because certainly bac = bac for any a 2 R; it is symmetric
because if bac = bbc, then certainly bbc = bac; and it is transitive because if bac = bbc
and bbc = bcc, then bac = bcc. Each of these is immediate because the equal sign
already has these properties; e.g., if I told you x = y you would immediately know
that y = x.
8
For example, “if a ⌘5 b, then b ⌘5 a” is true, since this is just notation for “if a ⌘ b (mod 5),
then b ⌘ a (mod 5).” And that can be quickly proved by the definition of mods.
9
Subtle note: The theorem refers to partitioning into classes, rather than into equivalence classes,
even though the theorem itself tells us that ⇠ will be an equivalence relation and hence they will
be equivalence classes. However, we use the relation term of “class” because we state the theorem
before the proof, and so we can’t use the theorem to refer to them as equivalence classes, since doing
so is only possible after the proof! Have I confused you yet?
10
But first, especially for these relation problems, do lots of examples first! Make sure you fully
understand the relation. Here, 12.4 ⇠ 12.85 and 12.85 ⇠ 12.554 and 12.54 ⇠ 12 and 12.4 6⇠ 13.4,
12.4 6⇠ 11.9, and 12.67 6⇠ 2.24. Looks like all the numbers between 12 and 13 are related to each
other, but none of them are related to anything else.
Proofs: A Long-Form Mathematics Textbook 297
By Theorem 9.5, this means that the equivalence classes must then partition all
of R, and indeed they do. The class of all numbers that are equivalent to 12.4 is the
set of numbers in the interval [12, 13); that is, all numbers x such that 12 x < 13.
Indeed, the equivalence classes for ⇠ are all intervals of the form [n, n + 1) for n 2 Z.
Moreover, by Theorem 9.5 this means that the equivalence classes must then partition
all of R, and they do: every x 2 R is in precisely one of these intervals:
a⇠b if a + b is even.
(a + b) + (b + c) = 2k + 2`
a + 2b + c = 2k + 2`
a + c = 2k + 2` 2b
a + c = 2(k + ` b).
evens is even, and the sum odds is even). However, any two elements from different
sets will not have an even sum (because an even plus an odd is not even). Therefore,
if a and b are from the same set, then a ⇠ b, but if a and b are from different sets,
then a 6⇠ b. Lastly, note that these two equivalence classes do indeed partition Z,
since every integer is either even or odd, but none are both.
Example 9.8. Let D be the set of words in the English dictionary and ⇠ be the
relation for which
Example: If “math” rhymes with “path,” then also “path” rhymes with
“math.”
Example: If “math” rhymes with “path” and “path” rhymes with “bath",
then also “math” rhymes with “bath.”
In fact, the rhyming poets and singer-songwriters in the audience will be well-
aware of websites like rhymezone.com where you type in a word and it tells you all
other words which rhyme with that word. Said differently, you give the website a
word and the website gives you back that word’s equivalence class in D!
The main point of this example is to drive intuition. In the mod-5 sense, we
imagine that 4 and 9 and 14 all rhyme, while 4 and 6 do not rhyme. In the floor-
function sense, we imagine that 3.4 and 3.9 and ⇡ all rhyme, while ⇡ and e do not. In
each problem we used an equivalence relation ⇠ to define a new mathematical rhyme
scheme on a set A, and then we stood back and watched as this rhyming property
partitions the set.
There are many more real-world examples of equivalence relations. These include
“has the same birthday as” and “is the same height as.” In Exercise 9.20, you are
asked to come up with more real-world examples.
Now that you have seen some concrete examples and have begun to build a little
intuition, let’s prove Theorem 9.5.
Proofs: A Long-Form Mathematics Textbook 299
Notation.
{x 2 A : a ⇠ x}.
Also note that [2] = [7] = [12], and [ 4] = [6], and so on. Next, we will need the
following lemma in the proof of the Theorem 9.5.
Lemma.
Proof Idea. The forward direction will be, charmingly enough, straightforward. As
for the backward direction, we will assume that a ⇠ b and try to prove that [a] = [b].
In it, don’t forget that according to Notation 9.9, [a] and [b] are sets! And in Section
3.3 we outlined one way to prove that two sets are equal: We will prove that [a] ✓ [b],
and [b] ✓ [a]. The proof itself will not be terribly interesting, it will simply require
some careful applications of the fact that ⇠ is an equivalence relation, and hence is
reflexive, symmetric and transitive.
300 Chapter 9. Relations
Proof . For the (straight)forward direction, assume that [a] = [b]. Observe that since
⇠ is reflexive, b ⇠ b and so b 2 [b]. And since [a] = [b], this in turn means that b 2 [a],
which by Notation 9.9 implies a ⇠ b. This concludes the forward direction.
As for the backward direction, we begin by assuming a ⇠ b, and we aim to prove
that [a] = [b]. This will be accomplished by demonstrating that [a] ✓ [b] and [b] ✓ [a].
To prove the former, choose any x 2 [a]; we will show that x 2 [b]. By assumption
we have a ⇠ b, and because x 2 [a] we have a ⇠ x. That is,
a⇠b and a ⇠ x.
b⇠a and a ⇠ x.
Let’s now prove Theorem 9.5, which for your reference is this:
Theorem.
Proof . We will first prove the forward direction, and then the backward direction.
– Foward Direction –
Assume that ⇠ partitions the elements of A into classes, say {Pi }i2S , where S is
some indexing set.12 And recall that by the definition of a class, that if x, y 2 Pi ,
then y is in the same class as x, meaning that x ⇠ y. We aim to prove that ⇠ is
reflexive, symmetric and transitive.
First, we prove that ⇠ is reflexive. Pick any a 2 A. Recall that being a partition
means that each a 2 A is in precisely one class; let’s say a 2 Pi . This will look like
12
For example, if there happens to be 8 partition sets, then S = {1, 2, 3, 4, 5, 6, 7, 8}. If there
happens to be |N| partition sets, then S = {1, 2, 3, 4, . . . }.
Proofs: A Long-Form Mathematics Textbook 301
– Backward Direction –
Now, observe that there exists an element in two distinct classes if and only if there
are two distinct equivalence classes that overlap. So the above is equivalent to this:
To turn this into symbols, note that equivalence classes like [a] and [b] being distinct
simply means [a] 6= [b].13 And for there to be overlap between them means [a]\[b] 6= ;.
Thus, the above is equivalent to saying this:
13
For example, with mod-5 equivalence, [1] = [6]. So even if a 6= b, we could still have [a] = [b].
But two sets are distinct provided they are not exactly equal, like how {1, 2, 3} and {2, 3, 4} are
distinct sets. So to determine distinctness, one must consider them as sets.
302 Chapter 9. Relations
This theorem tells us that a relation produces a partition precisely when that
relation is an equivalence relation. But it doesn’t tell us what that partition looks like.
It also does not tell us which partitions correspond to some equivalence relation and
which ones do not. As it turns out, for every partition of A there is an equivalence
relation which produces precisely that partition.
Proposition.
Proof . Define a relation ⇠ on A such that a ⇠ b if a and b belong to the same part
(that is, a, b 2 Pi for some i), and a 6⇠ b if a and b do not belong to the same part
(that is, a and b are not both in Pi for any i).
This rule is, by its very definition, producing the partition into the given Pi .
Moreover, we can see that ⇠ is an equivalence relation by checking the three properties,
as required by Definition 9.3. First, ⇠ is reflexive because a ⇠ a is simply saying that
a is in the same partition set as itself, which is certainly true for every a 2 A. Next,
⇠ is symmetric because if a ⇠ b, then this means a and b are in the same partition
set, which certainly also means that b and a are in the same partition set, or b ⇠ a.
Finally, if a and b are in the same partition set, and b and c are as well, then certainly
a and c must be as well; that is, if a ⇠ b and b ⇠ c, then a ⇠ c.
Given the partition into sets Pi , we have created a relation which gives this
partition and verified that it is indeed an equivalence relation. This completes the
proof.
14
“Yo, lemma help you prove that theorem.”
Proofs: A Long-Form Mathematics Textbook 303
15
It’s kind of like the classic Disney princess movies, like Snow White, Cinderella and Sleeping
Beauty, that I was forced to watch because I have twin older sisters who would always outvote me
if I suggested Space Jam for the 200th time. A young, isolated female with a beautiful voice and
animal friends finds herself in distress, only to be rescued by a strapping barrel-chested man who
they fall madly in love with within 6-12 hours of meeting and with a kiss they live happily ever
after. Sure, the details vary from movie to movie, but the main plot line remains constant. This is
the big idea with abstraction and generalization. Oftentimes the details don’t matter so much, like
whether you have a floor function or a mod-5 function. No matter how you dress it up, when you
focus on what really matters, you’re left with something worse than Space Jam.
16
Indeed, when you take abstract abstract algebra you’ll lean names likes “groups” and “ring” and
“field” to describe some of these essential properties. You will probably begin with groups, which is
the topic of the Introduction to following this chapter.
304 Chapter 9. Relations
Definition.
Note that if B = A, then this matches Definition 9.3, showing that this is a true
generalization.
2. Both allow for some sort of connection between an element in A and an element
in B. For a relation, it is a ⇠ b; for a function, it is f (a) = b. And for both,
some elements might have the connection while others do not.
3. Each operates on just one thing from A and one thing from B at a time (one
a 2 A and one b 2 B). So two elements in total are considered at a time, never
more and never less. We called this a binary relationship.
4. Order matters: For relations, we have seen that a ⇠ b and b ⇠ a are asserting
two different things (unless possibly when the relation is known to be symmetric).
Likewise, certainly f (a) = b does not imply that f (b) = a.
At this point, there is a way to think about both of these as ordered pairs.17
Note.
Note 9.13.
17
We are tying together all sorts of ideas at this point, and that now includes the Cartesian
product of sets! These were introduced way back in Definition 3.13.
Proofs: A Long-Form Mathematics Textbook 305
It may look weird to say that a function is nothing more than a set of ordered
pairs from A ⇥ B (domain ⇥ codomain), but when you graph a function from R ! R,
what you are seeing is exactly that! You are seeing a plot of all the ordered pairs!
Despite these similarities, there are two important differences between functions
and relations, which brings us to our final recurring theme alert.
In fact, it is the case that any subset of A ⇥ B is a relation, while only very special
subsets of A ⇥ B would constitute a function. This realization also shows us that a
function is a special type of relation. The definition below drives this point home by
providing yet another definition of a function, that time in terms of relations. And
while the below looks different than Definition 8.1 (our original function definition),
they are indeed equivalent.
Definition.
The word “unique” here is saying that for each a there exists one and only one b
where (a, b) 2 F . But this does not prevent some b from corresponding to more than
one a. It may be the case that (a1 , b) 2 F and also (a2 , b) 2 F . For example, if F
is the subset of R ⇥ R representing the function f : R ! R where f (x) = x2 , then
notice that (2, 4) 2 F and also ( 2, 4) 2 F . However, if this doesn’t happen, then
we did have a name for such a function: an injection!
It also does not mean that every b has at least one corresponding a. Perhaps
(a, b) 62 F for all a 2 A. But if this doesn’t happen, then we have again given such a
function a special name: a surjection!
306 Chapter 9. Relations
And with that — as far as functions are concerned — your undergraduate brain
expansion is now complete.
If it passes
What you were the vertical
taught in middle school line test
A relation on A ⇥ B
What I told you such that 8a 2 A,
later in Chapter 9 9! b 2 B such that
(a, b) 2 R.
Go to A morphism in
grad school the category of sets
Definition.
The most important example of a partial order is what a partial order is designed
to mimic: is a partial order on R. Below is the second most important example:
✓ is a partial order on P(N).
Example 9.16. Let . be the relation on P(N) where
a.b when a ✓ b.
That is, a and b come from the set P(N), meaning that they are both sets containing
only natural numbers. We say that a . b if the set a is a subset of the set b. For
example, {1, 4, 6} . {1, 2, 4, 6, 7} since {1, 4, 6} ✓ {1, 2, 4, 6, 7}.
Let’s show that . is a partial order on P(N). To do so, we must show that it
satisfies the three properties from Definition 9.15.
Reflexive: To see that a . a for all a 2 P(N), simply note that every set is a
subset of itself. Therefore, a . a for any a 2 P(N), which proves that . is reflexive.
Antisymmetric: Assume that a . b and b . a for some a, b 2 P(N). This means
that a ✓ b and b ✓ a. This is precisely what we need to prove that a = b, according
to our summary on Page 81. This proves that . is antisymmetric.
Transitive: Assume that a . b and b . c, for some a, b, c 2 P(N). That is, a ✓ b
and b ✓ c. To see that a ✓ c, pick any element x 2 a. Since x 2 a and a ✓ b, by the
308 Chapter 9. Relations
The one crucial difference between a partial order . and the typical inequality
on R is that in R, every two numbers a and b will either have a b or b a. One
of the two is bigger, and the inequality detects that.
Meanwhile, we made no such demands of a partial order. It could very well
be the case that . is a partial order on some set A, and for two the elements
a, b 2 A, we have a . b and b . a. Indeed, we saw this in the last example: note
that {1, 2, 3} * {2, 3, 4} and {2, 3, 4} * {1, 2, 3}.
This allows for some cool pictures of posets. In the below, we are looking at a
diagram of the partially ordered set on A = {1, 2, 3}, where the ordering is again
a . b if a ✓ b. In this diagram, if a . b, then there is a line between a and b, and b
appears in a more vertical position.
{1, 2, 3}
In Exercise 9.36 you will be asked to show that if A = N and . is the relation
where a . b whenever a | b, then . is a partial order on A. You will also be asked
to draw a Hasse diagram for a small case of this.
Proofs: A Long-Form Mathematics Textbook 309
— Chapter 9 Pro-Tips —
• Take another look at Definition 9.3 where we listed the three conditions for a
relation to be an equivalence relation, and note the difference between the first
condition and the last two conditions. For ⇠ to be reflexive on A, the condition
is straightforward: You need a ⇠ a for all a 2 A, otherwise the condition fails.
For symmetry and transitivity, though, it is more subtle. Both of these are
of the “If, then” variety. Suppose, for example, you have the relation ⇠ on the
set {a, b, c} where
and that’s it — every other pair is not related. Is it symmetric? Sure! Symmetry
says that if you have a ⇠ b, then you must also have b ⇠ a. But without the
“if,” you don’t need the “then.” 18 The only way it is not symmetric is if you
had, say, b ⇠ c and c 6⇠ b; that would be a problem. But the above is certainly
a symmetric and transitive relation.
• It’s good for mathematicians to know some of our field’s history. I’ve tried to
drizzle some in throughout this text, but I will steal an opportunity now to share
a bit more. Following this chapter is an introduction to group theory, so here
is some interesting history about one of the most important mathematicians in
the history of group theory: Évariste Galois.
Galois was a transcendent mathematician who developed much of group
theory as a teenager, yet struggled to get his work noticed; he was a political
firebrand with conspiratorial tendencies and a thirst for revolution during a
turbulent time in French politics; and he was a romantic who fell in love with a
young lady, but whose love she never returned. In fact, I believe out of everyone
in the history of mathematics, Galois would have been, hands down, the most
exciting to follow on Twitter.
There are many fascinating aspects to Galois’ life, but the one fact about
his life that nearly every working mathematician can immediately recite. . . is
how he died.19 Galois died in a duel at the age of 20, which was likely related
to one of these two non-math passions which drove so much of his emotions.
A tragic story to lose a life so young, and there is little doubt that this young
man, who changed the mathematical landscape with just a few years of work,
would have left a colossal legacy if he had decades more.
• Your final pro-tip of the book is simply this: Try to find joy in your mathematics.
Try to make friends with classmates to form study groups and enjoy the material
18
If it helps, this is similar to how our truth tables in Chapter 5 counted “False ) (True or False)”
as true. If that doesn’t help, then ignore it.
19
And that’s never a good sign. If people can recite many facts about you, but nobody can
remember how you died, then you probably lived a good, long life. Hope to be a George Washington
over an Abraham Lincoln.
310 Chapter 9. Relations
together. The joy lies in feeling a camaraderie among your classmates, rather
than competition.
If you are working a homework problem or research project, embrace the
adventure of not knowing an answer, but searching for it on your own or with
friends, rather than trying to find a solution online. The joy lies in the hunt,
and in realizing that the search itself is when the most important learning takes
place.
Math is a huge field, and no one likes all of it. Don’t be discouraged if one
area seems too dull or difficult. The joy lies in finding an area that excite you,
and pursuing it further.
Go out of your way to teach others — both younger math students and
those that are not studying math at all. And when you do, be energetic and
enthusiastic. More than anything, it is your attitude about math that will
resonate. A week or two later, they may forget every detail about the math
that you shared — but they will remember one thing: your joy.
Proofs: A Long-Form Mathematics Textbook 311
— Exercises —
Exercise 9.1. Give four examples of relations that we did not mention in the
chapter. Have two of them be real-world examples and two of them be math examples.
Exercise 9.2. Let A = {1, 2, 3, 4, 5}. Write out all a ⇠ b for all pairs that are
related, given the following relation rules.
Exercise 9.3.
(a) List all partitions of the set {1, 2}. (b) List all partitions of the set {a, b, c}.
Exercise 9.4. Give four examples of partitions that we did not mention in
the chapter. Have two of them be real-world examples and two of them be math
examples.
Exercise 9.5. Consider the relation ⇠ on the set {w, x, y, z} such that this is the
complete list of related elements:
Exercise 9.6. Consider the relation ⇠ on the set {w, x, y, z} such that this is the
complete list of related elements:
Exercise 9.7. Consider the following equivalence relation ⇠ on the set {1, 2, 3, 4, 5, 6}
such that this is the complete list of related elements:
Exercise 9.8. Let ⇠ be a relation on N where the complete set of related pairs is
{a ⇠ a : a 2 Z}.
Exercise 9.9.
(a) Give an example of a relation on the set {1, 2, 3, 4} which is reflexive and sym-
metric, but not transitive.
(b) Give an example of a relation on the set {1, 2, 3, 4} which is reflexive and transitive,
but not symmetric.
(c) Give an example of a relation on the set {1, 2, 3, 4} which is transitive and
symmetric, but not reflexive.
(d) Give an example of a relation on the set {1, 2, 3, 4} which is not transitive,
symmetric or reflexive.
Exercise 9.13. Each of the following rules defines a relation on Z. For each part,
prove that ⇠ is an equivalence relation and find its equivalence classes.
Exercise 9.14. Each of the following rules defines a relation on Z. For each, is ⇠
reflexive? Symmetric? Transitive? If a property holds, provide a brief justification.
If it doesn’t, say why it fails. If all three hold, then ⇠ is an equivalence relation; in
this case, list the equivalence classes.
Exercise 9.15. Each of the following rules defines a relation on Z. For each, is ⇠
reflexive? Symmetric? Transitive? If a property holds, provide a brief justification.
If it doesn’t, say why it fails. If all three hold, then ⇠ is an equivalence relation; in
this case, list the equivalence classes.
Exercise 9.19. Let d 2 N and consider the set P containing an infinite arithmetic
progression:
P = {. . . , 3d, 2d, d, 0, d, 2d, 3d, . . . }.
Let ⇠ be the relation on N where a ⇠ b if a b 2 P . Is ⇠ reflexive? Symmetric?
Transitive? If a property holds, you do not need to justify it. If it doesn’t, say why
it fails. If all three hold, then ⇠ is an equivalence relation; in this case, list the
equivalence classes.
Exercise 9.20. If PEEP S is the set of people in the world, and we define a relation
as a ⇠ b if person a has the same birthday as person b, then ⇠ is an equivalence
relation on PEEP S . Give three other real-world examples of an equivalence relation.
314 Chapter 9. Relations
Exercise 9.22. In this exercise we will put some rigor behind the practice of
thinking
p of fractions in their “lowest terms,” which was a central idea in the proof
that 2 is irrational. We will represent a fraction ab as an ordered pair (a, b) where
b 6= 0, and the equality ab = dc will be thought of as ad = bc.
Let A = {(a, b) : a, b 2 Z and b 6= 0}. Define the relation ⇠ on A to be
(a) Give an example of an equivalence relation on A which has finitely many equiva-
lence classes.
Exercise 9.24.
(a) Let ⇠ be the relation on Z where a ⇠ b when a ⌘ b (mod 2) and a ⌘ b (mod 3).
Is ⇠ an equivalence relation?
{. . . , 6, 3, 0, 3, 6, . . . } , {. . . , 5, 2, 1, 4, 7, . . . } , {. . . , 4, 1, 2, 5, 8, . . . }.
{0} , { 1, 1} , { 2, 2} , { 3, 3} , { 4, 4} , . . .
Exercise 9.31. Explain the error in the following “fake proof” that if ⇠ is a
relation on A that is both symmetric and transitive, then ⇠ is guaranteed to be
reflexive.
Fake Proof. Assume that ⇠ is symmetric and transitive. By symmetry, if a ⇠ b,
then b ⇠ a. By transitivity, since a ⇠ b and b ⇠ a, also a ⇠ a. We have shown that
a ⇠ a, proving that a is reflexive.
a⇠b if f1 (a) = b
Exercise 9.33. How many relations are there from {1, 2, 3} to {1, 2, 3}? For
n 2 N, how many functions are there from {1, 2, . . . , n} to {1, 2, . . . , n}? How many
relations from {1, 2, . . . , n} to {1, 2, . . . , n} are not functions?
(a) Write out an additional and multiplication tables for the equivalence classes for
the n = 4 case.
(b) Write out an additional and multiplication tables for the equivalence classes for
the n = 5 case.
(c) Write out an additional and multiplication tables for the equivalence classes for
the n = 6 case.
(d) Looking at the example below and your tables from parts (a), (b) and (c), name
a few things that you find interesting.
As an example, here are the addition and multiplication tables for n = 3:
Exercise 9.36. In the Bonus Examples section for this chapter, we discussed
partial orders. Read that section before answering the questions below.
(b) Suppose A = {1, 2, 3, 5, 6, 10, 15, 30} and . is the parial order on A where a . b
whenever a | b. Draw a Hasse diagram of this partial order.
Introduction to Group Theory
In the late 1800s, mathematicians kept noticing that the tools used to solve problems
from one area were also being used to solve problems from another. Must they keep
reinventing the wheel? Although these problems looked different, they were alike in
some fundamental ways. To motivate this, let’s look at four mathematical structures
which, despite their many differences, share five important characteristics.
319
320 Chapter 9. Relations
• Identity element: The number 0 is a number in {0, 1, 2, 3, 4, 5}, and it has the
property that n +6 0 = n and 0 +6 n = n for every n in {0, 1, 2, 3, 4, 5}.
n m n +6 m = 0 and m +6 n = 0?
0 0 X
1 5 X
2 4 X
3 3 X
4 2 X
5 1 X
✓ ◆
a b
• Invertibility: If is a 2 ⇥ 2 matrix with nonzero determinant, then
c d
✓ d b ◆
ad bc
c
ad bc
a is also a 2 ⇥ 2 matrix with nonzero determinant, and
ad bc ad bc
✓ ◆✓ d b ◆ ✓ ◆ ✓ d b ◆✓ ◆ ✓ ◆
a b 1 0 a b 1 0
ad bc
c
ad bc
a = and ad bc
c
ad bc
a = .
c d ad bc ad bc 0 1 ad bc ad bc c d 0 1
That is, every 2 ⇥ 2 matrix with nonzero determinant has an ◆ and, when
✓ inverse
1 0
combined with its inverse, produces the identity element .
0 1
• Associativity: If A, B and C are 2 ⇥ 2 matrices with nonzero determinant (or
without!), then (AB)C = A(BC).
We just considered four sets, each with an operation: First, Z with +. Second,
R \ {0} with ⇥. Third, {0, 1, 2, 3, 4, 5} with +6 . Last, the set of real 2 ⇥ 2 matrices
with nonzero determinant with matrix multiplication.
There are so many ways in which each of these is different, but in the above
five ways they are the same. In fact, these five characteristics are so important
that mathematicians have given a special name to a set and operation which satisfy
these five characteristics, and we make every undergrad math major spend a month
studying them. We call them groups.
First, if G is some set, then ⇤ is called a binary operation on G if it combines
two elements from G to create a single element of G. It will look like this: a ⇤ b = c.
Addition, multiplication, addition modulo 6, and matrix multiplication are all binary
operations.
Definition.
3. Inverses: For every a 2 G, there exists some b 2 G such that a⇤b = b⇤a = e.
These four properties are called the group axioms. And once we have this definition,
we could, if we wanted, jump right into proving things about groups. For example,
the second axiom tells us that there must be an identity element, like 0 for addition,
21
Technically, the way we defined a binary relation automatically means it is closed, but we keep
it here as emphasis.
322 Chapter 9. Relations
◆ ✓
1 0
or 1 for multiplication, or 0 for addition modulo 6, or for 2 ⇥ 2 matrix
0 1
multiplication. Is it the case that the identity element is always unique? Or could a
group have two identity elements? Answer: There can only be one.
Proposition.
Proof . Assume for a contradiction that e1 and e2 are two different identity elements
for G. Then, by simply stating what it means to be an identity element:
But since these hold for every a 2 G, they also hold for e1 and e2 , since those must
also be in G! Substituting a = e2 into the first equality in the first bullet point, this
means that e2 ⇤ e1 = e2 . And by substituting a = e1 into the second equality in the
second bullet point, this means that e2 ⇤ e1 = e1 . We have shown that
e2 = e2 ⇤ e1 = e1 ,
and so e2 = e1 .
We had assumed that e1 and e2 were different identity elements, but have proved
that they must be the same, giving the contradiction. This proves that a group’s
identity element must be unique.
Even for matrix multiplication, it takes some thought to convince yourself that
there can’t be a second identity matrix. But by Proposition 9.18, there is only
one identity matrix. And for any other set and operation which satisfy the group
axioms, you immediately know that the identity element is unique. And it doesn’t
stop there. . . there are whole books filled with theorems about groups! We have
already seen four groups — the four sets and operations with which we began this
introduction — and every theorem from those books on group theory applies equally
to each of those four groups.
There are two special classes of groups that we turn to next, called dihedral groups
and permutation groups. First, the dihedral group D6 , which looks at rigid motions
of a triangle.22
22
Note: Some people call this group D3 . I like to really think about these things and decide what
I think is best. But this is a really tough one. Compelling arguments on both sides. . .
Proofs: A Long-Form Mathematics Textbook 323
In a moment we are going to be rotating and flipping this triangle, so let’s label
it in some way so that we can tell how it was moved.23
F
1 3
F
1 3
This may seem silly, but if you remember that we are discussing groups, and that
every group has an identity element, this suddenly seems important. Next, we could
pick up the triangle and rotate it 120 clockwise,24 and then place it back down.
2
1
F !
F
1 3
3
23
Sorry, haven’t figured out how to integrate .gif files into a printed book yet. . .
24
More self-dating: It made me feel old when I realized that “clockwise” and “counterclockwise”
are becoming antiquated terms for students, since they don’t see many analog clocks anymore. So
I’ll included arrows here in case it helps.
324 Chapter 9. Relations
If we picked up the original triangle and rotated it 240 clockwise and placed it
back down, we would get this:
3
F
1
2
If we rotated the above triangle another third-turn we would get back to where
we started, which we have already talked about. So, is that all we can do? Nope!
We could also flip the triangle over! And, while we’re at it, we could add in some
rotations as well. By flipping the triangle over the vertical access, this is what we get:
2 2
F
! F
1 3 3 1
And by taking this and rotating it 120 degrees or 240 degrees, we see two more
ways that the triangle could look after we picked it up, moved it around, and placed
it back onto the same region it originally started. Here are those two:
3
1
F
F
1
3
2
And, finally, we are done. There are six possible ways that the triangle could look,
and we have now identified them all. Because we are talking about group theory,
let’s identify each of these with some symbols. For the identity, in which we just
picked up the triangle and placed it right back where it started, let’s call that 1. For
the 120 rotation, let’s call that r. Then, since the 240 rotation is just r twice, let’s
call that r ⇤ r, or r2 . If we rotate the triangle a third turn we would get back to the
identity, which shows that r3 = 1.
Next, we have flips. The triangle resulting from a flip over the vertical axis we
will call f . Flipping twice brings the triangle back to the identity, so f 2 = 1. The
last two triangles above would then be f ⇤ r and f ⇤ r2 .
With this, we have identified what is called the dihedral group of order 6, and is
denoted D6 . It is:
{1, r, r2 , f, f ⇤ r, f ⇤ r2 },
Proofs: A Long-Form Mathematics Textbook 325
and the way we combined elements is by using the logic of triangles. For example, to
figure out which of the six elements r2 ⇤ (f ⇤ r) is equal to, we could start with the r2
triangle, and then perform a f ⇤ r — that is, perform a flip and then a rotation:
1
! !
F
F
1
3
2
2
r2 r2 ⇤ f = f ⇤ r r2 ⇤ (f ⇤ r) = f ⇤ r2
Each number on top is being mapped to the number right below it. This gives a
group called the symmetric group of order 6, denoted S3 , and here are its elements:
⇢✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
, , , , ,
1 2 3 2 3 1 3 1 2 2 1 3 1 3 2 3 2 1
Let’s call the first function above g1 , the second g2 , and so on. What’s the
operation for this group? It is function composition; note that the composition of two
bijections is a bijection. For example, what is g2 g2 ? For starters, g2 is the function
So g2 g2 is the function where (g2 g2 )(1) = 3, (g2 g2 )(2) = 1 and (g2 g2 )(3) = 2.
Which is g3 ! So g2 g2 = g3 . Moreover, g2 g2 g2 = g1 .
Notice that g1 is the identity function, and hence will be the identity element in
this group. So, g2 composed with itself three times produced the group’s identity
element — does this property sound familiar? It kind of looks like the rotation element,
r, from the dihedral group. That element had r3 = 1, just like g2 does here.
The next element, g4 , has the property that g4 g4 = g1 , our identity element.
This is just like how f 2 = 1 in the dihedral group. Moreover, g5 is what you get
when you apply g4 and then g2 — just like f ⇤ r. And, likewise, g6 exactly mirrors
326 Chapter 9. Relations
1=1
1 +6 1 = 2
1 +6 1 +6 1 = 3
1 +6 1 +6 1 +6 1 = 4
1 +6 1 +6 1 +6 1 +6 1 = 5
1 +6 1 +6 1 +6 1 +6 1 +6 1 = 0
Note, however, that D6 and S3 do not have any such element. So Z6 can’t possibly
be isomorphic to D6 and S3 .
It took a long time for mathematicians to realize exactly which axioms to include
in their definition of a group and which to exclude. If they did not insist that the
group operation was associative, then the definition would be far too general, and we
would be unable to prove many interesting theorems. However, notice that we did
not insist that a ⇤ b = b ⇤ a for the elements in a group. If this happens, like with Z6 ,
or Z under +, or R \ {0} under ⇥, then the group is called abelian. But this is not
included as an axiom because doing so would exclude groups like D6 or S3 or the set
of real 2 ⇥ 2 matrices with nonzero determinant under matrix multiplication (which
is denoted (GL2 (R)).
The time mathematicians spent identifying the best definition of a group has paid
off immensely. Not only is group theory versatile and deep, but it is one of the most
beautiful theories in all of mathematics. I believe you will all enjoy learning it.