Math 13 Textbook-SP23
Math 13 Textbook-SP23
April 1, 2023
Contents
1 A Paradigm Shift 3
1.1 Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Theorem and Conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Planning and Writing a Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
7 Relations and Partitions 181
7.1 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
7.2 Functions revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
7.3 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
7.4 Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
7.5 Well-definition, Rings and Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.6 Functions and Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Useful Texts
• Book of Proof, Richard Hammack, 2nd ed 2013. Available free online! Very good on the basics: if
you’re having trouble with reading set notation or how to construct a proof, this book’s for you!
These notes are deliberately pitched at a high level relative to this textbook to provide contrast.
• Mathematical Reasoning, Ted Sundstrom, 2nd ed 2014. Available free online! Excellent resource.
If you would like to buy the actual book, you can purchase it on Amazon at a really cheap price.
• Mathematical Proofs: A Transition to Advanced Mathematics, Chartrand/Polimeni/Zhang, 3rd Ed
2013, Pearson. The most recent course text. Has many, many exercises; the first half is fairly
straightforward while the second half is much more complex and dauntingly detailed.
• The Elements of Advanced Mathematics, Steven G. Krantz, 2nd ed 2002, Chapman & Hall and
Foundations of Higher Mathematics, Peter Fletcher and C. Wayne Patty, 3th ed 2000, Brooks–Cole
are old course textbooks for Math 13. Both are readable and concise with good exercises.
Learning Outcomes
1. Developing the skills necessary to read and practice abstract mathematics.
2. Understanding the concept of proof, and becoming acquainted with several proof techniques.
3. Learning what sort of questions mathematicians ask, what excites them, and what they are
looking for.
4. Introducing upper-division mathematics by giving a taste of what is covered in several areas of
the subject.
Along the way you will learn new techniques and concepts. For example:
Number Theory Five people each take the same number of candies from a jar. Then a group of
seven does the same. The, now empty, jar originally contained 239 candies. Can you decide
how much candy each person took?
Geometry and Topology How can we visualize and compute with objects like the Mobius strip?
Fractals How to use sequences of sets to produce objects that appear the same at all scales.
To Infinity and Beyond! Why are some infinities greater than others?
1 A Paradigm Shift
1.1 Proof
How can you convince someone that you’re telling the truth? Depending on the situation, there are
varying amounts of show and tell. If you’re a defense attorney, you tell a story to the jury, backed
up with evidence and witness testimony, that instills some reasonable doubt that your client com-
mitted the crime. If you’re a physicist or chemist, you run experiments and collect statistics that are
sufficiently close to your predicted values. If you’re an investigative journalist, you piece together
excerpts from primary sources and interviews with key people to construct a consistent narrative
that’s as complete as possible.
Critically, the attorney’s client doesn’t actually need to be innocent – the jury just needs to doubt
their guilt. The scientist’s results might be consistent with her predictions, but it might not be for the
reason she purports. The journalist may have neglected to interview an important, but peripheral
person of interest or a condemning document may have been destroyed that would otherwise com-
pletely upend their story. Even when all three of these characters act with the best intentions, there’s
still a gap between what they present to the world and the underlying fact of the matter. Of course,
there are reasons these disciplines have differing standards of truth. These could be liberal values
concerning justice, the physical limitations of our measurements, or the constraints of time, money
and access to information.
Let’s compare and contrast these examples with what it means to convince someone in mathemat-
ics. Up to this point, the only convincing you’ve probably had to do is showing that your calculations
are correct. You’d start with some given expression like an integral and then jump from equals sign
to equals sign using algebraic manipulations and identities. Eventually, you’d get some number
that you’d box and say “there’s my answer.” If asked for justification, you’d point to your chain of
equalities and say “there it is.”
But sometimes we want to use reasoning that isn’t just algebra. You might have gotten a taste of
this in your high school geometry class where you had to write proofs. Rather than give a technical
definition of what a proof is, let’s look at an example of what a proof can be.
Proof. Consider a square with side length a + b with four congruent copies of our triangle arranged
as in Figure 2. The total area of the square is ( a + b)2 , but if we add up the areas of the four triangles
and the square in the middle (try to prove that this is indeed a square!), we get 2ab + c2 .
Now let’s slide the lower-left triangle up and to the right so that it forms a rectangle with the
upper-right triangle. Then slide the upper-left triangle down and the lower-right triangle to the left
so they form a rectangle as well. If we add up the areas of the two rectangles and the two smaller
squares, we get 2ab + a2 + b2 .
But the area of the whole square hasn’t changed, so we must have that
2ab + c2 = 2ab + a2 + b2 .
When we subtract 2ab from both sides, we arrive at the desired conclusion.
3
a b
c
a a
b c
b
c
a
c c
c b b
a
b a
Discussion Questions
1. Are you convinced by this proof? If so, why? If not, what feels off?
Even though we finished this proof with an equation (the theorem concerns an equation after all),
the essence of the proof is in the picture. The picture informed which equations we wrote down. That
being said, we shouldn’t get too attached to the picture. Are all four angles in our square really right
angles? Are the four triangles exactly congruent to each other? If it turned out that one of the line
segments we drew wasn’t perfectly straight, would we need to scrap the whole argument? What if
we want to apply this reasoning to a right triangle with proportions very different from the ones we
drew here?
The point here is that the picture isn’t a proof in and of itself. Rather, it serves to remind us of our
assumptions and their consequences.
1.2 Definition
Mathematicians spend a lot of time proving theorems – stating truths and providing justification.
True statements about what? Well Theorem 1.1 seems to be a statement about right triangles. What
are those? Whatever it is, it had better satisfy the following definition, a set of unambiguous and clear
conditions.
Definition 1.2. A right triangle is a triangle, two of whose sides meet at a right angle.
It seems like we’ve cheated a bit here. This doesn’t make any sense until we’ve also defined “tri-
angle”, “right angle”, and “side” as well. How deep does the rabbit hole go? Well a triangle is a
polygon with three sides and a right angle is exactly half of a straight angle. Now it looks like we
4
have to define “polygon” and “straight angle.” We can keep defining objects in terms of other ideas,
but at some point we have to stop and say “you know what I mean.1 ”
In a way, definitions serve as the foundation upon which we construct buildings – theorems in
this analogy. Let’s walk through some other examples, this time from number theory.
For now we’ll take “the integers” to be the set of positive and negative whole numbers Z =
{. . . , −2, −1, 0, 1, 2, . . .}. If we really wanted to, we could come up with definitions for 0, 1, and so
on, but we’ll take these for granted here.2 Assuming we know what “integer” and “two” are, it looks
like we need to define “divisible.” This shouldn’t give us too much trouble, assuming that we know
how to do basic arithmetic like addition and multiplication of integers.
Proof. Let x and y be any two even integers. We want to show that x + y is an even integer.
By definition, an integer is even if it can be written in the form 2k for some integer k. Thus there exist
integers n, m such that x = 2m and y = 2n. We compute:
• ‘Any’ in the statement of the theorem means the proof must work regardless of what even in-
tegers you choose. It is not good enough to simply select, for example, 4 and 16, then write
4 + 16 = 20. This is an example, or test, of the theorem, not a mathematical proof.
• According to the definition, 2m and 2n together represent all possible pairs of even numbers.
1 The ancient Greek geometer Euclid left some pretty fundamental terms like “point” and “line” undefined by modern
standards. Instead of saying “you know what I mean,” a point was “that which has no part” and a line was “a length
without width.”
2 The use of Z for the set of integers comes from the German word for “number”, “zahlen”. The branch of math that
would be concerned with defining the integers in terms of more primitive objects would be mathematical logic and set
theory.
5
• The proof makes direct reference to the definition. The vast majority of the proofs in this course
are of this type. If you know the definition of every word in the statement of a theorem, you
will often discover a proof simply by writing down the definitions.
• The theorem itself did not mention any variables. The proof required a calculation for which
these were essential. In this case the variables m and n come for free once you write the definition
of evenness! A great mistake is to think that the proof is nothing more than the calculation (∗).
This is the easy bit, and it means nothing without the surrounding sentences.
The important link between theorems and definitions is much of what learning higher-level math-
ematics is about. We prove theorems (and solve homework problems) because they make us use and
understand the subtleties of definitions. One does not know mathematics, one does it. Mathematics is
a practice; an art as much as it is a science.
Exercises
1.2.1 Consider the following definitions.
Definition. A function from a set A to a set B is called “strictly increasing” if for all x1 < x2 in
the domain A, f ( x1 ) < f ( x2 ).
Definition. A function from a set A to a set B is called “strictly decreasing” if for all x1 < x2 in
the domain A, f ( x1 ) > f ( x2 ).
Give an example of a function which is neither strictly increasing nor strictly decreasing. Ex-
plain your answer.
Definition. A sequence { an } “goes to ∞” if for all number M, there exist a natural number N,
such that an > M for all n > N.
Test your understanding of the definition by creating some examples and some non-examples.
Why do your non-examples fail the definition?
2 = 2 · 1, 6 = 3 · 2, 12 = 4 · 3, 20 = 5 · 4, 30 = 6 · 5, 42 = 7 · 6, . . .
1.2.4 The following are incorrect ways of writing the definition of an odd integer. Explain why each
fails to properly define an odd integer n.
An integer n is odd if
6
1.2.5 Consider the following definition.
Definition: Let n, m be integers. We say n is “divisible by m” if n = mk for some integer k.
Explore using some examples. Then, for each of the following statements, explain why the
statement is true or false.
(i) If the last digit of an integer is divisible by 4, then the integer is divisible by 4.
(ii) If the last digit of an integer is divisible by 2, then the integer is divisible by 2.
Once a mathematician proves the validity of a conjecture it becomes a theorem. The job of a math-
ematics researcher is thus to formulate conjectures, prove them, and publish the resulting theorems.
The creativity lies as much in the formulation as in the proof. As you go through the class, try to
formulate conjectures. Like as not, many of your conjectures will be false, but you’ll gain a lot from
trying to form them.
Let us return to our conjectures: are they true or false? How can we decide? As a first attempt,
we may try to test the conjectures by computing with some small integers n. In practice this would
be done before stating the conjectures.
n 1 3 5 7 9 11 13 n 1 2 3 4 5 6 7
n2 − 1 0 8 24 48 80 120 168 n2 + n + 41 43 47 53 61 71 83 97
7
Because 0, 8, 24, 48, 80, 120 and 168 are all multiples of 8, and 43, 47, 53, 61, 71, 83 and 97 are all
prime, both conjectures appear to be true. Would you bet $100 that this is indeed the case? Is n2 − 1 a
multiple of 8 for every odd integer n? Is n2 + n + 41 prime for every positive integer n? The only way
to establish whether a conjecture is true or false is by doing one of the following:
Let us work with Conjecture 1.6. If n is an odd integer, then, by definition, we can write it as
n = 2k + 1 for some integer k. Then
n2 − 1 = (2k + 1)2 − 1 = (4k2 + 1 + 4k ) − 1 = 4k2 + 4k.
We need to investigate whether this is always a multiple of 8. Since
4k2 + 4k = 4(k2 + k )
is already a multiple of 4, it all comes down to deciding whether or not k2 + k contains a factor 2 for
all possible choices of k; i.e. is k2 + k even? Do we believe this? We can return to trying out some
small values of k:
k −2 −1 0 1 2 3 4
k2 + k 2 0 0 2 6 12 20
Once again, the claim seems to be true for small values of k, but how do we know it is true for all k?
Again, the only way is to prove it or disprove it. How to proceed? The question here is whether or not
k2 + k is always even. Factoring out k, we get:
k 2 + k = k ( k + 1).
We have therefore expressed k2 + k as a product of two consecutive integers. This is great, because
for any two consecutive integers, one is even and the other is odd, and so their product must be even.
We have now proved that the conjecture is true. Conjecture 1.6 is indeed a theorem! Everything we’ve
done so far has been investigative, and is laid out in an untidy way. We don’t want the reader to have
to wade through all of our scratch work, so we formalize the above argument. This is the final result
of our deliberations; investigate, spot a pattern, conjecture, prove, and finally present your work in
as clean and convincing a manner as you can.
Proof. Let n be any odd integer; we want to show that n2 − 1 is a multiple of 8. By the definition of
odd integer, we may write n = 2k + 1 for some integer k. Then
8
In both cases n2 − 1 = 4k(k + 1) is divisible by 8. This concludes the proof.
It is now time to explore Conjecture 1.7. The question here is whether or not n2 + n + 41 is a prime
integer for every positive integer n. We know that when n = 1, 2, 3, 4, 5, 6 or 7 the answer is yes, but
examples do not make a proof. At this point, we do not know whether the conjecture is true or false.
Let us investigate the question further. Suppose that n is any positive integer; we must ask whether it
is possible to factor n2 + n + 41 as a product of two positive integers, neither of which is one.3 When
n = 41 such a factorization certainly exists, since we can write
Our counterexample shows that there exists at least one value of n for which n2 + n + 41 is not prime.
We have therefore disproved the conjecture that ‘for all positive integers n, n2 + n + 41 is prime,’ and
so Conjecture 1.7 is false!
The moral of the story is this: to show that a conjecture is true you must prove that it holds for
all the cases in consideration, but to show that it is false a single counterexample suffices.
9. Consider the set R of all real numbers. For all x in R, there exists y in R such that x < y.
10. Consider the set R of all real numbers. There exists x in R such that, for all y in R, x < y.
11. The sets A = {n ∈ N : n2 < 25} and B = {n2 : n ∈ N and n < 5} are equal. Here N denotes
the set of natural numbers.
Now we know a little of what mathematics is about, it is time to practice some of it!
3 Once again we rely on a definition: a positive integer is prime if it cannot be written as a product of two integers, both
9
Discussion Questions
1. An integer is odd if it isn’t even. Prove that an integer a is odd if and only if a = 2b + 1 for some
integer b. That is, prove that all odd integers can be written this way, and that if an integer can
be written this way, then it is odd.
2. When you do math, do you feel like you’re engaging with the creative side of your personality?
3. Try to come up with some examples for each of the following definitions. Are these definitions
problematic in some way? If so, try to fix the definition.
Definition 1.9. A rational number a/b is even if a and b are both even integers.
Definition 1.10. We say that an integer a is very odd if a = bc for odd integers b and c.
Exercises
1.3.1 A rational number, roughly speaking, is what we think of as a fraction.
p
Definition. A real number r is a “rational number” if r = q for some integer p and for some
non-zero integer q.
Using the definitions of the super-odd and super-even integers, come up with a conjecture of
your own! Can you prove or disprove your conjecture?
1.3.3 Decide whether the following conjecture is true or false, and justify your reasoning.
Conjecture. There is a smallest positive real number.
10
Interpret Make sense of the statement. What is the proposition saying? Can you rephrase the claim in a
way that is more clear to you? What are you trying to prove and what are you assuming? The
most important part of this step is identifying the logical structure of the statement you’re trying
to prove. At this stage, you might ignore the particular details of the statement and instead
focus on its logical meaning. Depending on the statement, it might be helpful to rephrase the
statement as an if-then statement.
Brainstorm Now that you understand what the statement is saying, convince yourself that the statement is
true. First, look up the relevant definitions.
Next, think of some instances where the conditions of this proposition are met. Try out some
examples, and ask yourself what makes the claim work in those instances. Looking carefully at
examples may help build intuition about why the claim is true and suggest a strategy to prove
it.
You’ll also want to review other theorems that relate to these definitions. What theorems in-
volve the same definitions? Do you know any theorems that relate your assumptions to the
conclusion? Have you seen a proof for a similar statement before?
This stage is a little like packing for a trip. Imagine laying out all the stuff you might want
to bring, looking to get an overview of what you have available. Even if you don’t end up
bringing that fourth pair of shoes, maybe it was helpful to remind yourself of all the options.
Sketch This is the phase where you build the skeleton of your proof. Think again about what you are
assuming and what you are are you trying to prove. What should the first step of the proof
be? What about the last step? Write down some informal arguments for yourself to connect the
first and last steps of your proof, feeling free to use shorthand. If you get stuck, try a different
approach. Scribble out some drawings and draw as many arrows as you want to connect your
ideas.
This sketch step is where most of the thinking happens and it will most likely be the longest
step in the proof-writing process. This is also the step where you will be doing most of your
calculations. You can be as messy as you want in this step because you should be the only one
who ever reads this. Once you’ve learned a variety of different proof methods, this is a good
stage at which to experiment with them and try to find which proof method will work best.
Prove Once you have proven the statement to yourself, it’s time to prove the statement to the world.
Now is when you go back through your proof sketch and translate it into a linear story, written
in complete sentences. Here you should carefully word your explanations and you should
avoid using shorthand. The result should be a clear, formal proof like the ones you read in
a mathematics textbook, where symbols like =⇒ or ∴ are replaced by words like “hence” or
“therefore”. Although you are providing a mathematical argument, your proof should read
like prose.
Review Finally, you should review your proof. Assume that the reader is looking at the problem for
the first time and has not read your sketch. Read your own proof with some skepticism and
consider its readability and flow. Get read of unnecessary claims and revise the wording if
necessary.
During this review step, try also reading your proof out loud. If you find yourself adding extra
words that aren’t written down, then include those words in the proof.
11
Let’s use this framework to prove the following theorem.
Interpret. What is the logical structure of this statement we are trying to prove? In this case, it has
deliberately been written in a less-than-straightforward way. Don’t just read the words in the state-
ment, but read it slowly and carefully enough that you understand what it is asserting. Once you
understand what this sentence means, it is possible to translate it into an if-then statement.
• Equivalent statement: Let n be a positive integer. If the last digit of n is 5, then n is divisible by 5.
Not every statement can be rewritten as an if-then statement, but many can, including this state-
ment we are trying to prove. Before moving on, be sure you agree that our statement really means
the same thing as what we wrote above. Understanding the English meaning of the statement was
essential to writing it as an if-then statement.
It’s hopeless to try to memorize all the possibilities (in general, this course will involve less mem-
orization than your earlier math classes). Instead of memorizing that a statement with the logical
structure “P when Q” is the same as “if Q then P”, you should instead think about the natural En-
glish meaning of the sentences, and make sure they are equivalent. (It might be helpful to try an
example sentence that doesn’t involve math; can you think of one in this case, using the structure “P
when Q”?)
Now we move on to the brainstorm phase, where we gather examples and definitions related to
our theorem.
Brainstorm. A key practice is to write out the relevant definitions. We are already comfortable with
the notion of divisibility, but the precise notion of digits is probably less familiar.
• Definition of “divisible by 5”: An integer n is divisible by 5 if there exists an integer k such that
n = 5k. That is, n is a multiple of 5.
• Meaning of “digit”: Each digit of n is a number between 0 and 9, representing how many 1’s,
10’s, 100’s, etc. are “in” n. (For example, the number 671 has six hundreds, seven tens, and a
one. That is, 671 = 6 · 100 + 7 · 10 + 1.)
More formally, if n is a k-digit number and its digits are n0 , n1 , . . . , nk−1 , then
• 15 = 3 · 5 is divisible by 5.
12
• 245 = 49 · 5 is divisible by 5.
The theorem claims that every positive integer ending in 5 is a multiple of 5, or, as we rephrased it, if
a positive integer ends in 5, then it is divisible by 5. How important is that assumption, that the last
digit is 5? Here are some more examples.
• 13 is not divisible by 5.
• 20 = 4 · 5 is divisible by 5.
From these examples, we notice that not all positive integers are divisible by 5 (okay, we probably
already knew that), and that some positive integers which do not end in 5 are divisible by 5 (e.g.,
20).
The brainstorming phase is also a good time to write out relevant theorems. In this case, I don’t
think we know any theorems that will help us, but as we learn more theorems, we will have more
options available to us.
For example, imagine we knew a theorem that said, “A number is divisible by 5 if and only if
its last digit is 0 or 5.” That theorem would instantly imply what we’re trying to prove (and more).
(Warning! If you stumble upon a one-sentence proof like this on an exam, probably your instructor
doesn’t want you using that theorem, and at the very least you should ask to confirm whether or not
it’s okay to use.)
As another example, imagine we knew a theorem that said, “If the last digit of a positive integer
is 6, then that positive integer is divisible by 2.” This theorem itself wouldn’t help us prove our result,
but its proof would very likely be helpful.
Next we have the sketch portion of the proof. Let’s revisit our examples and experiment to try to
discover why this statement is true. We will make use of our description above of what it means to
have last digit equal to 5.
Our final proof needs to be written in complete sentences, but since the sketch portion is just for
us, we can be less formal. Here is how a sketch of this proof might look.
• 15 = 1 · 10 + 5 = 1 · |{z}
2 · 5 +5 = 5 · (2 + 1) (a multiple of 5).
10
13
• n = nk−1 · 10k−1 + nk−2 · 10k−2 + · · · + n1 · 10 + 5 (last digit 5)
• n1 , n2 , n3 , ... are not multiples of 5 (in general), but this is irrelevant to us.
• n is a multiple of 5 because
• So 5 divides n.
The authors had a difficult time writing this “sketch” portion, because, on one hand, we want
to explain what we’re thinking. On the other hand, we want to show you what a sketch looks like
in real life. The sketch is usually quite messy, and is nearly impossible for anyone else to follow. In
fact, a common struggle for professional mathematicians is returning to a sketch they wrote weeks
or months ago, and trying to figure out what their scratchwork meant.
Next, let’s turn this sketch into a formal proof that a classmate would be able to follow. There is a
certain writing style used in most formal mathematical proofs. We will use that style in the following,
and you will get more used to it in the more proofs you read (and write).
Prove. We need to show that if the positive integer n has last digit 5, then n is divisible by 5. Write n
in its base-10 expansion:
Note that for all j ≥ 1, 10 j is a multiple of 5. Hence, for all j = 1, . . . , k − 1, there exists an integer a j
such that we can write 10 j = a j · 5. Thus, we get:
n = n k −1 · ( a k −1 · 5 ) + n k −2 · ( a k −2 · 5 ) + · · · + n 1 · ( a 1 · 5 ) + 5
= ( n k −1 · a k −1 ) · 5 + ( n k −2 · a k −2 ) · 5 + · · · + ( n 1 · a 1 ) · 5 + 1 · 5
(by distributivity)
14
Because the quantity nk−1 · ak−1 + nk−2 · ak−2 + · · · + n1 · a1 + 1 is an integer, this shows that n is a
multiple of 5. Hence, n is divisible by 5. This completes the proof.
Finally, we review the proof and try to make it more readable. At the beginning of your career
as a proof writer, you will be required to justify every claim in your proof (hence, for example, the
reference to associativity above). You may think we are being too picky, but this initial requirement
is just an attempt to get you in the habit of explaining your claims. As you gain more practice with
proof writing, you will be expected to include fewer details in your proof and will even be allowed to
skip some simple steps that most readers may consider “trivial” (because they believe they are true
without feeling the need for an explanation). Thus, a more experienced proof-writer may review the
proof above and present a more compact version, like the one offered below.
Review. We need to show that if the positive integer n has last digit 5, then n is divisible by 5. Write
n in its base-10 expansion:
Since 10 j is a multiple of 5 for all j ≥ 1, the sum of the first k − 1 terms on the right-hand side is
divisible by 5 (i.e., the terms from nk−1 · 10k−1 to n1 · 10). Of course, 5 is also divisible by 5. Thus,
their sum n is also divisible by 5. This completes the proof.
Some comments:
1. Whether in the longer version of the proof, or the shorter version of the proof, we didn’t fully
justify that the sum of k − 1 terms which are divisible by 5 is divisible by 5. In fact, at this stage,
we may not even have one of the necessary tools (mathematical induction) to make that claim
100% rigorous. In this proof, we are asking the reader to accept that it is “obvious”.
2. If you ask 5 mathematicians to prove this statement, you will get 5 different proofs (like our
two versions above), possibly vastly different. Some aspects will be consistent (for example,
the use of complete sentences, and the fact that 10 is divisible by 5), but the proofs themselves
could look quite different.
3. Don’t expect to immediately be able to write a proof in the style of our proof; instead, focus on
correctness, clarity, using complete sentences, and including all necessary steps. The writing
style of your proofs will develop as you read and write more proofs.
Here is another example, illustrating the interpreting, brainstorming and sketching portions of our
proof-writing process. We won’t fully prove this proposition, but we will illustrate some first steps
in the proof-discovery process.
1. [Interpret] We rewrite this statement as an if-then statement. The result is quite similar to the
15
original statement (and of course, is identical in meaning, the whole point is to not change the
meaning).
Answer: If a function f : R → R is represented by a degree 2 polynomial, then f is non-
constant.
2. [Brainstorm] What are the most important definitions to recall for this problem? Write down
those definitions carefully.
Answer: “Degree 2 polynomial” and “non-constant function”.
A degree 2 polynomial is a polynomial which can be written in the form n2 x2 + n1 x + n0 , where
n2 ̸= 0.
A function f is non-constant if there exist inputs a and b such that f ( a) ̸= f (b).
Thus the theorem says that if f ( x ) = n2 x2 + n1 x + n0 with n2 ̸= 0, then we can find two values
a and b (with a ̸= b) such that f ( a) ̸= f (b).
Make a few examples to convince yourself that the statement is true.
Plan: Following the same strategy used in the previous examples, we can try to plug in some
small values of x. Hopefully, the corresponding outputs will be distinct. (If not, we will try
some more inputs.)
• f (0) = n0
• f (1) = n2 + n1 + n0
• f (−1) = n2 − n1 + n0 .
We are not quite ready to write out a formal proof using the suggested strategy, because that
strategy is secretly using the proof technique “proof by contradiction” which we will cover soon.
Instead, let’s practice reviewing “proofs” by evaluating some alternative arguments to prove our
proposition (which may, or may not, be logically correct).
16
Every function f : R → R represented by a degree 2 polynomial is non-constant.
• “Proof”: Consider the degree 2 polynomial f ( x ) = 3x2 − 5x + 7. This is not a constant poly-
nomial, because f (0) = 7 and f (1) = 5.
Is it a valid proof?
Answer. This is not a valid proof, because it is providing a single example. A complete proof
needs to work for every degree 2 polynomial, not just one.
• “Proof”: A degree 2 polynomial is a parabola (concave up, if the leading coefficient is positive,
and concave down, if the leading coefficient is negative). In either case, the graph is not a
horizontal line, so it is non-constant.
Is it a valid proof?
Answer. There is nothing incorrect with this proof, but it also feels incomplete. Everything
involving concave up or concave down seems like it would need to be justified (what is even the
definition of these terms?) and justifying them would probably be more difficult than proving
the original statement.
• “Proof”: The only constant polynomials are degree zero, and because 0 ̸= 2, a degree two
polynomial cannot be a constant function.
Is it a valid proof?
Answer. Again, there is nothing incorrect in what’s written here, but the “proof” is essentially
stating as obvious something that immediately implies what we are trying to prove. Not only
the statement “The only constant polynomials are degree zero” is not trivial, and hence requires
a proof, but it is actually a more elaborate (and general) result than the proposition we are trying
to prove.
This last argument is definitely not a complete proof in our context. (If your proof seems too
easy, for example if it’s a midterm and you’re given a whole page but only need one sentence,
you should worry that you might be assuming too much.)
17
Reading Quiz
1. At which of the following parts of the proof-writing process is it acceptable to use shorthand?
Select all that apply.
(a) Brainstorming
(b) Sketching
(c) Proof
Practice Problems
1.4.1 Use the steps discussed in this section to prove the following theorem.
Theorem 1.12. If the sum of two primes is again prime, then one of the primes must be 2.
Video Solution
Exercises
1.4.1 Take the sketch for the following theorem and turn it into a well-written proof.
Sketch. n2 − 1 = (n − 1)(n + 1)
1.4.2 Critique the following proof. That is, fix any mathematical errors and suggest ways to make
the proof more clear.
Prove or disprove: an integer is composite if and only if it has two distinct prime factors.
Proof. The claim is false. An integer is composite if it is not prime. For example, the number 6
is composite because 6 = 2 · 3. But 4 = 2 · 2.
1.4.3 What is wrong with the following proof? Explain why this error could be prevented by plan-
ning out a proof before writing it.
18
Theorem 1.14. If n ≥ 3 is an integer, then n2 > 2n + 1.
Proof. Let n2 > 2n + 1. Then 0 < n2 − 2n − 1 = (n − 1)2 − 2, which is only true when n ≥ 3.
1.4.4 We usually prove statements like “P if and only if Q” in two steps. First we prove that P
implies Q and then we prove that Q implies P. Explain why we can also do this; first prove that
P implies Q and then prove that ¬ P implies ¬ Q.
Below is a sketch of a proof of this statement. Unfortunately, it is incorrect. Find the mistake(s)
in the sketch and explain your reasoning.
Sketch:
n = 1 + 2k, m = 1 + 4k,
1 + 4k + 4k2 − (1 + 4k ),
n2 − m = 4k2 , 4 divides 4(k2 ).
Proof. Assume there are exactly n prime numbers 2 ≤ p1 , ..., pn and consider the integer
N = p1 · · · pn + 1.
N − p1 p2 · · · p n = 1
19
a+b
√
For any positive real numbers a and b, 2 ≥ ab.
a+b
√
Attempt 1: Assuming that 2 ≥ ab, we can multiply both sides by 2, which is positive, to get
√
a + b ≥ 2 ab
Squaring, we get
( a + b)2 ≥ 4ab
a2 + 2ab + b2 ≥ 4ab
a2 − 2ab + b2 ≥ 0
( a − b )2 ≥ 0
a+b
√
Since we have arrived at a true statement, the initial assumption must be true. Thus, 2 ≥ ab
as desired.
√ √ √ √
Attempt 2: For all positive numbers a and b, we have ( a − b)2 ≥ 0. Thus, a − 2 a b + b ≥
√ √
0, which is equivalent to a + b ≥ 2 ab. Dividing by 2, which is positive, we obtain a+2 b ≥ ab,
as desired.
a+b
√
Attempt 3: Let a = 18 and b = 2. Then 2 = 10 and ab = 6. 10 ≥ 6 so this is true.
(a) Decide which of the proof attempts below is best; describe as completely as possible why
the attempt you chose is best.
(b) What are your criticisms of the other proof attempts? Be as specific and thorough as pos-
sible.
1.4.8 Given below is the proof of a statement. Determine which statement the proof is trying to
show.
Proof. Let m and n be integers. Assume that m − n is odd, say m − n = 2t + 1 for some integer
t. We consider two cases:
If n is odd, then n = 2s + 1 for some integer s. Thus
20
Hence m and n have opposite parity.
21
2 Logic and the Language of Proofs
In order to read and construct proofs, we need to start with the language in which they are written:
logic. Logic is to mathematics what grammar is to English. Section 2.1 will not look particularly
mathematical, but we’ll quickly get to work in Section 2.3 using logic in a mathematical context.
2.1 Propositions
Examples. 1. 17 − 24 = 7.
2. 392 is an odd integer.
3. The moon is made of cheese.
4. Every cloud has a silver lining.
5. God exists.
In order to make sense, these propositions require a clear definition of every concept they contain.
There are many concepts of God in many cultures, but once it is decided which we are talking about,
it is clear that They either exist or do not. This example illustrates that a statement need not be indis-
putably true or false, or even determinable, in order to qualify as a proposition. Mostly when people
argue over propositions and statements, what they are really disagreeing about are definitions!
Note that any expression that is neither true nor false is not a proposition. January 1st is not a propo-
sition, neither is Green.
Truth Tables
One often has to deal with abstract propositions; those where you do not know the truth or falsity, or
indeed when you don’t explicitly know the proposition! In such cases it can be convenient to repre-
sent the combinations of propositions in a tabular format. For instance, if we have two propositions
(P and Q), or even three (P, Q and R) then all possible combinations of truth T and falsehood F are
represented in the following tables:
P Q P Q R
T T T T T
T F T T F
F T T F T
F F T F F
F T T
F T F
F F T
F F F
The mathematician in you should be looking for patterns and asking: how many rows would a truth
table corresponding to n propositions have, and can I prove my assertion? Right now it is hard to
prove that the answer is 2n : induction (Chapter 5) makes this very easy.
22
Connecting Propositions: Conjunction, Disjunction and Negation
We now define how to combine propositions in natural ways, modeled on the words and, or and not.
Definition 2.2. Let P and Q be propositions. The conjunction (AND, ∧) of P and Q, the disjunction
(OR, ∨) of P and Q, and the negation (NOT, ¬, ∼, ) of P are defined by the following truth tables,
P Q P∧Q P Q P∨Q P ¬P
T T T T T T T F
T F F T F T F T
F T F F T T
F F F F F F
It is usually better to use and, or and not rather than conjunction, disjunction and negation: the latter
may make you sound educated, but at the risk of being misunderstood!
Clearly P is true while R is false. If you happen to know someone from Scotland, you might know
that Q is true.a We can now compute the following (increasingly grotesque) combinations. . .
P ∧ Q P ∨ Q P ∧ R ¬ R (¬ R) ∧ P ¬( R ∨ P) (¬ P) ∨ [((¬ R) ∨ P) ∧ Q]
T T F T T F T
a The second syllable is pronounced like the i in bin or win. Indeed the first Californian antecedent of the Irvine family
which gave its name to UCI was an Ulster-Scotsman named James Irvine (1827–1886). Probably the family name was
originally pronounced in the Scottish manner.
How did we establish these facts? Some are quick, and can be done in your head. Consider, for
instance, the statement (¬ R) ∧ P. Because R is false, ¬ R is true. Thus (¬ R) ∧ P is the conjunction of
two true statements, hence it is true. Similarly, we can argue that R ∨ P is true (because R is false and
P is true), so the negation ¬( R ∨ P) is false.
Establishing the truth value of the final proposition (¬ P) ∨ [((¬ R) ∨ P) ∧ Q] requires more work.
You may want to set up a truth table with several auxiliary columns to help you compute:
P Q R ¬ P ¬ R (¬ R) ∨ P ((¬ R) ∨ P) ∧ Q (¬ P) ∨ [((¬ R) ∨ P) ∧ Q]
T T F F T T T T
The importance of parentheses in a logical expressions cannot be stressed enough. For example, try
building the truth table for the propositions P ∨ ( Q ∧ R) and ( P ∨ Q) ∧ R. Are they the same?
23
Conditional and Biconditional Connectives
In order to logically set up proofs, we need to see how propositions can lead one to another.
Definition 2.3. The conditional ( =⇒ ) and biconditional ( ⇐⇒ ) connectives have the truth tables
P Q P =⇒ Q P Q P ⇐⇒ Q
T T T T T T
T F F T F F
F T T F T F
F F T F F T
Observe that the expressions P =⇒ Q and P ⇐⇒ Q are themselves propositions: they are
sentences which are either true or false!
Synonyms
=⇒ and ⇐⇒ can be read in many different ways:
P =⇒ Q P ⇐⇒ Q
P implies Q P if and only if Q
Q if P P iff Q
P only if Q P and Q are equivalent
P is sufficient for Q P is necessary and sufficient for Q
Q is necessary for P
Example. The following propositions all mean exactly the same thing:
The biconditional connective should be easy to remember: P ⇐⇒ Q is true precisely when P and
Q have identical truth states. It is harder to make sense of the conditional connective. One way of
thinking about it is to consider what it means for an implication to be false. If P =⇒ Q is false,
it is impossible to create a logical argument which assumes P and concludes Q. The second row
of P =⇒ Q encapsulates the fact that it should be impossible for truth ever to logically imply
falsehood.
24
Aside. Why is F =⇒ T considered true?
This is the most immediately confusing part of the truth table for the conditional connective. One
way that may help to remember this is to think of the implication P =⇒ Q as making a promise.
For example, suppose your teacher says: “if the class earns a B average on the midterm exam, then I
will buy donuts for the class.” Under what circumstances will your teacher have lied to you? Only
in the case that it is true that the class earned a B average, but the teacher failed to provide donuts
for the class.
Here is a mathematical example, written with an English translation at the side.
Thus 7 = 3 =⇒ 0 = 0. Logically speaking this is a perfectly correct argument, thus the implication
is true. The argument makes us uncomfortable because 7 = 3 is clearly false.
Definition 2.4. A theorem is a justified assertion that some statement of the form P =⇒ Q is true.
A proof is an argument that justifies the truth of a theorem.
Think back to the truth table for P =⇒ Q in Definition 2.3. Suppose that the hypothesis P is true
and that P =⇒ Q is true: that is, P =⇒ Q is a theorem. We must be in the first row of the truth
table, and so the conclusion Q is also true. This is how we think about proving basic theorems. In a
direct proof we start by assuming the hypothesis (P) is true and make a logical argument (P =⇒ Q)
which asserts that the conclusion (Q) is true. As such, it often convenient to rewrite the statement of
a theorem as an implication of the form P =⇒ Q. Here is a very simple theorem which we prove
directly.
The first thing to do is to write the theorem in terms of propositions and connectives: that is, in the
form P =⇒ Q.
• Q is ‘The product of x and y is odd.’ This is what we want to show, the conclusion.
• Showing that P =⇒ Q is true, that (the truth of) P implies (the truth of) Q requires an
argument. This is the proof.
25
Proof. Let x and y be any two odd integers. We want to show that product x · y is an odd integer.
By definition, an integer is odd if it can be written in the form 2k + 1 for some integer k. Thus there
must be integers n, m such that x = 2n + 1 and y = 2m + 1. We compute:
It is common to place a symbol (in this case ) at the end of a proof to tell the reader that your argu-
ment is complete. Traditionally the letters Q.E.D. (from the Latin quod erat demonstrandum, literally
‘which is what had to be demonstrated’) were used, but this has gone out of style.You may also feel
that you want to write more, or less than the above. This is a difficult thing to judge. What do you
feel is a convincing argument? Test your argument on your classmates. The appropriate level of de-
tail will depend on your readership: a middle school student will need more detail than a graduate
student! At the moment, the best guide is to write for someone with the same mathematical sophis-
tication as yourself. If, in three weeks’ time, you can return to what you’ve written and understand
it, then it’s probably good!
In general, we cannot say anything about the truth value of the converse of a true implication. The
contrapositive of a true implication is, however, always true. Actually, even more is true, an implica-
tion and its contrapositive always have the same truth value. This is a common enough phenomenon
that we give it its own name.
Definition 2.7. We say two propositions are logically equivalent if they have the same truth table.
This definition is a bit vague (what does having the same truth table mean?) We could give a more
rigorous definition, but instead hope that the following examples will make the definition clear.
P Q P =⇒ Q Q =⇒ P ( P =⇒ Q) ∧ ( Q =⇒ P) P Q P ⇐⇒ Q
T T T T T T T T
T F F T F T F F
F T T F F F T F
F F T T T F F T
26
Notice that the bolded columns are the same in each table.
Note that when comparing truth tables, one should make sure the inputs (e.g. the columns for P and
Q in the above example) are in the same order in both tables.
Theorem 2.8. The contrapositive of an implication is logically equivalent the original implication.
Proof. Simply use our definitions of negation and implication to compute the truth table:
P Q P =⇒ Q ¬Q ¬P ¬Q =⇒ ¬ P
T T T F F T
T F F T F F
F T T F T T
F F T T T T
Since the truth states in the third and sixth columns (in bold) are identical, we see that P =⇒ Q
and its contrapositive ¬ Q =⇒ ¬ P are logically equivalent.
The implication P =⇒ Q is true, since all peaches are fruit. As a sentence, we have:
If Claudia is not holding any fruit, then she is not holding a peach.
Proof by Contrapositive
The fact that P =⇒ Q and ¬ Q =⇒ ¬ P are logically equivalent allows us, when convenient,
to prove P =⇒ Q by instead proving its contrapositive. As an example, consider another basic
theorem.
27
Theorem 2.9. Let x and y be integers. If x + y is odd, then exactly one of x or y is odd.
Proof. Assume that x and y have the same parity. There are two cases: x and y are both even, or both
odd.
De Morgan’s Laws
In order to perform proofs by contrapositive (and later by contradiction) it is necessary to compute
the negations of propositions. The most helpful results in this regard are attributable to Augustus de
Morgan, a very famous 19th century logician.
Theorem 2.10 (de Morgan’s laws). Let P and Q be any propositions. Then:
1. ¬( P ∧ Q) is logically equivalent to ¬ P ∨ ¬ Q.
2. ¬( P ∨ Q) is logically equivalent to ¬ P ∧ ¬ Q.
Here is a proof of the first law. Try the second on your own.
Proof. P Q P ∧ Q ¬( P ∧ Q) ¬ P ¬ Q ¬ P ∨ ¬ Q
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T
28
Simply observe that the fourth and seventh columns are identical.
It is worth pausing to observe how similar the two laws are, and how concise. There is some beauty
here. With a written example the laws are much easier to comprehend.
Example. (Of the first law) Suppose that of a morning you can choose (or not) to ride the subway to
work, and you can choose (or not) to have a cup of coffee. Consider the following sentence:
What would it mean for this sentence to be false? Any sentence which asserts the falsehood of the
above is a suitable negation. For example:
Note that the mathematical use of or includes the possibility that you neither rode the subway nor
had coffee.
is the proposition:
If you blindly appeal to De Morgan’s laws you might end up with the following piece of nonsense:
Logical rules are wonderfully concise, but very easy to misuse. Always think about the meaning of
a sentence and you shouldn’t go wrong.
Negating Conditionals
You will often want to understand the negation of a statement. In particular, it is important to under-
stand the negation of a conditional P =⇒ Q. Is it enough to say ‘P doesn’t imply Q’? And what
could this mean? To answer the question you can use truth tables, or just think.
Here is the truth table for P =⇒ Q and its negation: recall that negation simply swaps T and F.
P Q P =⇒ Q ¬( P =⇒ Q)
T T T F
T F F T
F T T F
F F T F
29
The only time there is a T in the final column is when both P is true and Q is false. We have therefore
proved the following:
Now think in words rather than calculate. What is the negation of the following implication?
The implication ‘therefore’ has disappeared and the expression ‘and won’t’ is in its place.
The converse, Q =⇒ P.
The contrapositive of the converse, ¬ P =⇒ ¬ Q.
If you are unsure about this, write down the truth tables and compare.
P. x is even.
Q. x2 is even.
Definition 2.12. A tautology is a logical expression that is always true, regardless of what the com-
ponent statements might be.
A contradiction is a logical expression that is always false.
30
The easiest way to detect these is simply to construct a truth table. We remark that two propositions
φ and ψ are logically equivalent if and only if φ ⇐⇒ ψ is a tautology.
P ¬ P P ∧ (¬ P)
T F F
F T F
Whatever the proposition P is, it cannot be true at the same time as its negation.
P Q P =⇒ Q P ∧ ( P =⇒ Q) ( P ∧ ( P =⇒ Q)) =⇒ Q
T T T T T
T F F F T
F T T F T
F F T F T
You can check them all with truth tables. Using these rules, one can answer questions, such as
deciding when an expression is a tautology, without laboriously creating truth tables. It is even fun!
Such an approach is appropriate when you are considering abstract propositions, say in a formal
logic course. In this text our primary interest with logic lies in using it to prove theorems. When one
31
has an explicit theorem it is important to keep the meanings of all propositions clear. By relying too
much on abstract laws like the above, it is easy to lose the meaning and write nonsense!
Reading Quiz
1. A tautology is a proposition which
(a) is false no matter what the truth value of its component propositions.
(b) is only true when all of its component propositions are true.
(c) is never false, no matter what the truth value of its component propositions.
(d) is built only using the connectives ∧, ∨.
(a) is false no matter what the truth value of its component propositions.
(b) is only true when all of its component propositions are false.
(c) is never false, no matter what the truth value of its component propositions.
(d) is built only using the connective ¬.
(a) ¬ P =⇒ Q
(b) ¬ Q =⇒ ¬ P
(c) Q =⇒ P
(d) P =⇒ ¬ Q
5. The negation of the conditional “if I study at least 25 hours per week, then I will be successful”
is the proposition
32
Practice Problems
2.1.1 Suppose that “If Colin was early, then no-one was playing pool” is a true statement.
(a) What is its contrapositive of this statement? Is it true?
(b) What is the converse? Is it true?
(c) What can we conclude (if anything?) if we discover each of the following? Treat the two
scenarios separately.
(i) Someone was playing pool.
(ii) Colin was late.
Video Solution
2.1.3 Define the connective ↑ (called the Sheffer stroke, or NAND) by the following truth table:
P Q P↑Q
T T F
T F T
F T T
F F T
Video Solution
Exercises
2.1.1 Express each of the following statements in the “If . . . , then . . . ” form. There are many possible
correct answers.
(a) You must eat your dinner if you want to grow.
(b) Being a multiple of 12 is a sufficient condition for a number to be even.
(c) It is necessary for you to pass your exams in order for you to obtain a degree.
(d) A triangle is equilateral only if all its sides have the same length.
33
2.1.2 Suppose that “x is an even integer” and “y is an irrational number” are true statements and
that “z ≥ 3” is a false statement. Which of the following are true?
Hint: Label each of the given statements, and think about each of the following using connectives.
(a) If x is an even integer, then z ≥ 3.
(b) If z ≥ 3, then y is an irrational number.
(c) If z ≥ 3 or x is an even integer, then y is an irrational number.
(d) If y is an irrational number and x is an even integer, then z ≥ 3.
2.1.3 Write the negation, the converse and the contrapositive of the following claim:
If A and B are invertible matrices, then AB is a square matrix and det( AB) ̸= 0.
2.1.4 Orange County has two competing transport plans under consideration: widening the 405
freeway and constructing light rail down its median. A local politician is asked, “Would you
like to see the 405 widened or would you like to see light rail constructed?” The politician
wants to sound positive, but to avoid being tied to one project. What is their response?
(Hint: Think about how the word ‘OR’ is used in logic. . . )
What are some issues with what your friend wrote, if any?
34
(b) Then your friend claims that the negation of this statement is
m or n is odd.
2.1.8 Construct the truth tables for the propositions P ∨ ( Q ∧ R) and ( P ∨ Q) ∧ R. Are they the same?
P Q R P =⇒ Q ( P =⇒ Q) ∧ ¬ R (( P =⇒ Q) ∧ ¬ R) =⇒ P
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
2.1.10 Apply de Morgan’s laws to the result of Theorem 2.11 to prove that P =⇒ Q is logically
equivalent to ¬ P ∨ Q. Do not use truth tables for this exercise.
2.1.15 Recall that a contradiction is a combination of statements that is always false, regardless of the
truth values of the original statements. A combination of statements that is always true is called
a tautology.
35
2.1.16 Prove or disprove: ( P ∧ ¬ Q =⇒ F ) ⇐⇒ ( P =⇒ Q) is a tautology. Here F represents a
contradiction: some proposition which is always false.
2.1.17 (a) Suppose that ‘ f is a linear function and b is a zero of f ’ is a false statement. What can we
conclude if we discover each of the following? Treat the two scenarios separately.
i. f is a linear function.
ii. f is a linear function if and only if b is a zero of f .
(b) Suppose that ‘If Amy likes art, then no one likes history.’ is a true statement.
i. What is the contrapositive of this statement? Is it true?
ii. What is the converse of this statement? Is it true?
iii. What can we conclude (if anything?) if we discover each of the following? Treat the
two scenarios separately.
A. Someone is likes history.
B. Amy does not like art.
( P ∧ Q) ∨ R is logically equivalent to ( P ∨ R) ∧ ( Q ∨ R)
(b) Use logical algebra (see the aside on page 32) to prove that
(( P =⇒ R) ∧ ( Q =⇒ R)) ⇐⇒ (( P ∨ Q) =⇒ R)
2.1.20 (a) Do there exists propositions P, Q such that both P =⇒ Q and its converse are true?
(b) Do there exist propositions P, Q such that both P =⇒ Q and its converse are false?
Justify your answers by giving an example or a proof that no such examples exist.
2.1.21 (a) Suppose we have propositions P and Q such that both P and ¬ P are sufficient for Q. What,
if anything, can be said about the tuth value of Q?
(b) Find truth values for P and Q which make the following expression false.
(¬ P ∧ ¬ Q) ∨ Q
2.1.22 (Hammack’s Book of Proof , Section 2.5, Exercise 11.) Suppose P is false and that the statement
( R =⇒ S) ⇐⇒ ( P ∧ Q) is true. Find the truth values of R and S. (This can be done with or
without a truth table).
36
2.1.23 Let R be the proposition “The summit of Mount Everest is underwater”. Suppose that S is a
proposition such that ( R ∨ S) ⇐⇒ ( R ∧ S) is false.
Q ∧ ¬( P =⇒ Q) is logically equivalent to Q ∧ ( P ∧ ¬ Q) ( )
is logically equivalent to (Commutative law)
is logically equivalent to ( Q ∧ ¬ Q) ∧ P ( )
2.1.25 Define the connective ↓ (called the Quine dagger, or NOR) by the following truth table:
P Q P↓Q
T T F
T F F
F T F
F F T
2.1.26 (Hard) Suppose that P, Q are propositions. Argue that any of the 16 possible truth tables
P Q ?
T T T/F
T F T/F
F T T/F
F F T/F
represents an expression ? created using only P and Q and the operations ∧, ∨, ¬. Can you
extend your argument to show that any truth table with any number of inputs represents some
logical expression?
37
2.2 Propositional Functions and Quantifiers
While the logic of propositions from Section 2.1 is a fairly straightforward place to start our explo-
rations, it is not powerful enough to express the majority of statements one encounters when actually
doing mathematics. For one, it lacks the ability to deal with variables, which are of central importance
in mathematics. For example, the expressions “17 is a prime number greater than 2”, “5 is a prime
number greater than 2”, and “32 is a prime number greater than 2” are really just three instances of
the same thing. Namely
“x is a prime number greater than 2”
with 17, 2, and 32 plugged in for x, respectively. In propositional logic, however, these three would
constitute three wholly different propositions, obscuring their relationship.
Moreover, propositional logic fails to capture standard patterns of argument which we wish to con-
sider. Consider propositions P and Q. If we know that P =⇒ Q is true, and we know P is true, then
we must conclude that Q is true (if you don’t believe this, try to prove it yourself!) Since this holds
no matter what propositions P and Q actually are, we call this a valid argument. On the other hand,
an argument of the form P is true, Q is true, therefore R is true is not valid as it could be the case that
P and Q are true and R false if you choose P, Q, and R to be certain statements! Now consider the
following:
All prime numbers greater than 2 are odd.
17 is a prime number greater than 2.
Therefore 17 is odd.
This is certainly correct reasoning, however in propositional logic this argument takes the form of: P
is true, Q is true, therefore R is true. But this (1) is not valid and (2) does not capture the true form of
the argument. A better way to translate this argument would be:
All A’s are B.
x is an A.
Therefore x is a B.
It turns out this is a valid argument, it does not depend on what A and B actually are. To study this
in more depth, we will need to move beyond propositions to propositional functions and quantifiers.
Definition 2.13. A propositional function is a family of propositions which depend on one or more
variables. The collection of objects allowed to be substituted in for variables in a propositional func-
tion is its domain.
For instance if P( x ) is a propositional function depending on a single variable x, then for each object
a in the domain of P, P( a) is a proposition.
Example. Suppose that x is allowed to be any real number. We could define the propositional func-
tion P( x ) by x2 > 4.
In this example P(5) is true, whilst P(−1) is false. More generally, P( x ) is true for some values of
38
x (namely x > 2 or x < −2) and false for others (−2 ≤ x ≤ 2).
Example. Suppose that x is allowed to be any integer. Define the propositional function P( x ) by “x
is a prime number” and Q( x ) by “x > 2”.
The expression “x is a prime number greater than 2” can then be translated as P( x ) ∧ Q( x ). Thus
P(17) ∧ Q(17) is true, whilst P(2) ∧ Q(2) and P(32) ∧ Q(32) are false.
At the beginning of the section we considered the expression “All prime numbers greater than 2 are
odd”. We saw in the example above how to translate “x is a prime number greater than 2” into logic.
To translate the rest of the expression, we need to deal with the “all” and the “is odd” parts. Here,
“all” is an example of a quantifier, something that tells us how many things satisfy some propositional
function. This one is called the universal quantifier as it says everything (in the domain) satisfies some
propositional function.
Let’s try to translate “x is odd” into logic now. Recall that a number x is odd if it can be written as
2k + 1 for some integer k. In other words there exists and integer k such that x = 2k + 1. Here we see
another type of quantifier, the existential quantifier, which posits the existence of some (at least one)
thing that satisfies some propositional function. The English language has all sorts of quantifiers (all,
some, many, few, etc.) but in mathematics we primarily deal with just two.
Definition 2.14. The universal quantifier is denoted ∀ (read “for all” or “for every”).
is a proposition which is true if and only if P( x0 ) is true for all x0 in the domain of P.
is a proposition which is true if and only if there exists some x0 in the domain of P such that P( x0 ) is
true.
We pause briefly to introduce some notation to help speed things along. We use N to denote the
positive integers, Z the integers, R the real numbers, and ∈ for ‘is a member of the set’. Thus 2 ∈ Z
is read as ‘2 is a member of the set of integers’, or more concisely, ‘2 is an integer’. We will properly
cover this notation in Chapter 3.
39
Example. Recall the above example where, for each real number x, P( x ) is the proposition x2 > 4.
Consider the quantified propositions:
Example. Here is a slightly more complicated example with a propositional function with two vari-
ables. Let R( x, y) be given by x = 2y + 1 where we agree that x and y are to be integers. Then
∃y R( x, y) asserts that there exists some integer, let’s call it k, such that x = 2k + 1. In other words,
∃y R( x, y) asserts that x is odd. Let O( x ) be ∃y R( x, y). Note that O( x ) is a propositional function. It
still depends on x!
As a test to see if you are following along, check to make sure the following make sense:
O(5) is true
O(24) is false
∀ x O( x ) is false
∃ x O( x ) is true.
Mathematics is filled with compound expressions of this type, where quantifiers and propositional
functions are combined to create more complicated propositional functions.
is really a statement of the following form, where P( x ) is the propositional function “x is an A” and
Q( x ) is the propositional function “x is a B”:
40
which can be written as
∀ x ( P( x ) =⇒ Q( x )).
Similarly, the statement
There is an A which is a B
is really
There is something satisfying P( x ) which also satisfies Q( x )
which can be written as
∃ x ( P( x ) ∧ Q( x )).
∀ x [( P( x ) ∧ Q( x )) =⇒ O( x )].
∃ x ( P( x ) ∧ O( x )).
Bounded Quantifiers
Often we wish to make explicit the domain of a propositional function which we are quantifying,
or to restrict our quantifiers to smaller parts of the domain. We can accomplish this by the use of
bounded quantifiers. We introduce this via examples.
Example. Consider the statement: “every real number is a cube”. By what we said above, we could
translate this into logic as
∀ x Q( x )
where Q( x ) is “x is a cube” and has domain the real numbersa . If we want to emphasize that we are
quantifying over the real numbers, we often write something like
∀ x ∈ R Q ( x ).
In reality, mathematicians rarely write out specific statements using notation like P( x ) or Q( x ) (these
letters are usually reserved for standing in for abstract propositional functions). In this example, “x
is a cube” can be written as ∃y ∈ R ( x = y3 ). So “every real number is a cube” is
∀ x ∈ R ∃ y ∈ R ( x = y3 ).
41
a We could also write this as ∀ x ( P( x ) =⇒ Q( x )) where P( x ) is “x is a real number”.
Example. While the statement “every real number is a square” is false, we can make it a true state-
ment by restricting our attention to just positive reals: “every positive real number is a square” is true.
We could write this as
∀ x > 0 ∃ y ∈ R ( x = y2 ).
Here, the condition x > 0 in the ∀ quantifier restricts the quantifier the smaller domain of just those
real numbers which are > 0, i.e., positive real numbers.
English Every positive integer may be written as the sum of the squares
of four integers
Remark. In some sense, we don’t really need bounded quantifiers. For example, one can view
∀ x ∈ R P( x ) as simply shorthand for ∀ x ( x ∈ R =⇒ P( x )) and ∃ x > 0 P( x ) as shorthand for
∃ x ( x > 0 ∧ P( x )). This pattern holds in general: you can replace a bounded ∀ quantifier with an
unbounded one by putting the condition at the front of an implication and a bounded ∃ quantifier
by putting the condition in a conjunction.
In practice, however, this can get very messy, especially in statements with many quantifiers! Getting
comfortable with bounded quantifiers can help you write cleaner statements.
42
Theorem 2.17. For any propositional function P( x ), we have:
In essence, negation swaps the quantifiers ∀ ↔ ∃. Like with all theorems, if you want to understand
it, you should unpack it, write it in English, and come up with some examples.
1. The negation of ‘P( x ) is true for all x’ is, ‘P( x ) is false for some x.’
2. The negation of ‘P( x ) is true for some x’ is, ‘P( x ) is always false.’
Examples. Here are two examples, numbered corresponding to the parts of Theorem 2.17.
This has the form ∃ x P( x ), and therefore has negation ∀ x ¬ P( x ). Explicitly, the negation is:
∀ x we have sin x ̸= 4.
Note how we introduced the words we have to make the sentence read more clearly.
Once you’re comfortable negating simple propositions and quantifiers, negating multiple quan-
tifiers is easy. Just follow the rules, think, and take your time.
Example. Show that the following statement about the real numbers is false.
∀ x ∃y such that xy = 3.
The negation of this expression follows the rules for switching quantifiers and negating the final
statement:
43
Proof. Let x = 0, then, regardless of y, we have xy = 0 ̸= 3.
Warning! When negating bounded quantifiers, do not change the condition. Here is a couple exam-
ples to illustrate. We leave the reason as to why to not change the condition to the exercises.
Example. 1. The negation of “every yellow car has four doors” is not “there exists a non-yellow
car without four doors”. The correct negation is “there is a yellow car without four doors”.
2. Consider the statement “every positive real number is a square” which we saw we could write
as
∀ x > 0 ∃ y ∈ R ( x = y2 ).
Note that this is a true statement and so its negation must be false. So something like
∃ x ≤ 0 ∀ y ∈ R ( x ̸ = y2 )
could not be the correct negation as this is also a true statement. Instead, simply negate the
quantifiers as you normally would, but leave the condition as is:
∃ x > 0 ∀ y ∈ R ( x ̸ = y2 ).
1. Don’t forget the meaning of the sentence. Use the logical rules in Theorem 2.17, but also think
it out in words. You should get the same result. Think about the finished sentence and read it
aloud: if it sounds like the opposite of what you started with then it probably is!
2. The symbol ∄ for ‘does not exist’ is much abused. Very occasionally its use is appropriate, but
it too often demonstrates laziness or a lack of understanding. Avoid using it unless absolutely
necessary.
3. Beware of hidden quantifiers! Sometimes a quantifier is not explicitly stated. This is espe-
cially the case with the universal quantifier and is very common when a statement contains an
implication. Consider the following very easy theorem.
This is really a statement about all integers. There is a hidden quantifier that’s been suppressed
in the interests of readability. Instead, the theorem could have been written
∀n ∈ Z (n is odd =⇒ n2 is odd).
44
In this form we can negate by combining the rules in Theorems 2.11 and 2.17. The pattern is
¬ [∀n ( P(n) =⇒ Q(n))] is equivalent to ∃n ( P(n) ∧ ¬ Q(n)).
The negation of (∗) is therefore,
∃n ∈ Z such that n is odd and n2 is even.
Given that (∗) is a theorem, its negation is, of course, false!
Here is a harder example of a hidden quantifier, this time from Linear Algebra. You do not have to
know what a vector is to work with this definition. We are purely concerned with how to negate an
abstract statement.
Definition 2.18. Vectors x, y, z are linearly independent if
ax + by + cz = 0 =⇒ a = b = c = 0
The implication is a statement about all real numbers a, b, c. We could instead have written
∀ a, b, c ∈ R we have ax + by + cz = 0 =⇒ a = b = c = 0.
To negate the definition, we must also negate the hidden quantifier. The result is the definition of
what it means for vectors x, y, z to be linearly dependent:
∃ a, b, c not all zero such that ax + by + cz = 0
The final challenge here is recalling how to negate an implication: recall Theorem 2.11, and note that
the negation of a = b = c = 0 is that at least one of a, b, c is non-zero.
Definition 2.19. Suppose that f is a function whose domain and codomain are sets of real numbers.
We say that f is continuous at x = a if,
The implication is a statement about all real numbers x which satisfy some property, so we once again
have a hidden quantifier:
∀ε > 0 ∃δ > 0 such that ∀ x ∈ R | x − a| < δ =⇒ | f ( x ) − f ( a)| < ε.
We can now use our rules to state what it means for f to be discontinuous at x = a:
∃ε > 0 such that ∀δ > 0 ∃ x ∈ R such that | x − a| < δ and | f ( x ) − f ( a)| ≥ ε.
Warning! Remember, the negation of ∀ε > 0 is not ∃ε ≤ 0. Only the ultimate proposition5 is negated!
For an example of this definition in use, see the exercises.
4 If not, you will have plenty time to get used to it in an upper-division Analysis course. . .
5 In this case the ultimate proposition is | x − a| < δ =⇒ | f ( x ) − f ( a)| < ε.
45
The Order of Quantifiers Matters!
We conclude this section with an important observation: the order of quantifiers matters critically!
Consider, for example, the following propositions:
Assuming that x and y always represent people, we can rewrite the sentences as follows:
All we’ve done is to switch the order of the two quantifiers! How does this affect the meaning?
Written entirely in English, the statements become:
Quite different! The critical observation is that if ∃y comes after x, then y is allowed to depend on x.
Each person might have a friend, but that friend is likely to be different depending on the person. If
∀ x comes after y, then x cannot depend on y.
Play around with the pairs of examples below. What are the meanings? Which ones are true?
• ∀ x ∈ Z ∃y ∈ Z such that y ≤ x.
• ∃y ∈ Z such that, ∀ x ∈ Z y ≤ x.
What happens in the last two examples if we replace the integers Z with the positive integers N?
Reading Quiz
1. Let P( x ) be x2 − 1 = 0. Which of the following are true? Select all that apply
(a) P(1)
(b) P(−1)
(c) P(3)
(d) P( x )
(e) ∀ x P( x )
46
(f) ∃ x P( x )
(g) ¬∀ x P( x )
(a) example.
(b) counterexample.
(c) realization.
(d) solution.
3. Which of the following are equivalent to the following? Select all that apply.
4. True or False: the order of quantifiers in an expression can always be switched without chang-
ing the meaning of the expression.
Practice Problems
2.2.1 Write each of the following using propositional functions and quantifiers. Make sure to define
any propositional functions you are using.
Video Solution
Video Solution
2.2.3 Here are four propositions. Which are true and which false? Justify your answers.
(a) ∀ x ∈ R, ∃y ∈ R such that y4 = 4x.
47
(b) ∃y ∈ R such that ∀ x ∈ R we have y4 = 4x.
(c) ∀y ∈ R, ∃ x ∈ R such that y4 = 4x.
(d) ∃ x ∈ R such that ∀y ∈ R we have y4 = 4x.
Video Solution
Exercises
2.2.1 For each of the following sentences, rewrite the sentence using quantifiers. Then write the
negation (using both words and quantifiers)
(a) All mathematics exams are hard.
(b) No football players are from San Diego.
(c) There is a odd number that is a perfect square.
2.2.2 Suppose that P( x ), Q(y) and R( x, y, z) are propositional functions. Compute the negation of
the following quantified propositions:
(a) ∀ x ∃y P( x ) ∧ Q(y)
(b) ∀ x ∃y ∀z R( x, y, z)
x2 > 0 =⇒ x > 0
is ‘x2 > 0 and x ≤ 0.’ Why is this incorrect? What is the correct negation?
2.2.5 The following statements are about positive real numbers. Which one is true? Explain your
answer.
(a) ∀ x ∃y such that xy < y2 .
(b) ∃ x such that ∀y xy < y2 .
48
2.2.7 A function f is said to be decreasing if:
x ≤ y =⇒ f ( x ) ≥ f (y).
2.2.8 Are the following True or False? Give some explanation for why you chose your answer.
(a) For every two points A and B in the plane, there exists a circle on which both A and B lie.
(b) There exists a circle in the plane on which lie any two points A and B.
2.2.9 You are given the following definition (you do not have to know what is meant by a field).
What is the largest collection (set) of real numbers A for which the proposition is true?
Justify your answer.
(a) Define the quantifier ∃≥n so that the proposition ∃≥n x P( x ) is true if and only if there are
at least n elements in the domain of P( x ) which make P( x ) true. Find an expression in
which the only quantifiers are ∀ and ∃ which has the same meaning as ∃≥n x P( x ).
(b) Define the quantifier ∃=n so that the proposition ∃=n x P( x ) is true if and only if there are
exactly n elements in the domain of P( x ) which make P( x ) true. Find an expression in
which the only quantifiers are ∀ and ∃ which has the same meaning as ∃=n x P( x ).
2.2.12 Recall from calculus the definitions of the limit of a sequence ( xn ) = ( x1 , x2 , x3 , . . .).
49
‘xn diverges to ∞’ means: ∀ M > 0, ∃ N ∈ N such that n > N =⇒ xn > M.
‘xn converges to L’ means: ∀ε > 0, ∃ N ∈ N such that n > N =⇒ | xn − L| < ε.
(a) State what it means for a sequence xn not to diverge to ∞. Beware of the hidden quantifier!
(b) State what it means for a sequence xn not to converge to L.
(c) State what it means for a sequence xn not to converge at all.
(d) (Hard) Prove, using the definition, that the sequence defined by xn = n diverges to ∞.
1
(e) (Hard) Prove that the sequence defined by xn = n converges to zero.
[You may want to revisit the last two parts after reading the following sections.]
50
2.3 Methods of Proof
There are four standard methods for proving a theorem P =⇒ Q. In practice, long proofs will use
several such arguments joined together. We have already discussed the first two types of proof in
Section 2.1.
Contradiction Assume that P and ¬ Q are true and deduce a contradiction. Since P ∧ ¬ Q implies a
contradiction, it follows that P ∧ ¬ Q must be false. By Theorem 2.11, we see that P =⇒ Q is
true.
Each of the methods has advantages and disadvantages. For instance, the direct method has the ad-
vantage of a straightforward logical flow. The contrapositive method is useful when the negations ¬ P,
¬ Q are simpler than P, Q themselves. This is often the case when one or both statements involve the
non-existence of something. Working with their negations might give you the existence of ingredients
with which you can calculate. Proof by contradiction has a similar advantage: assuming both P and
¬ Q gives you two pieces of information with which you can calculate. Logically speaking there is no
difference between the three methods, beyond how you visualize your argument.
To illustrate the difference between direct proof, proof by contrapositive, and proof by contradiction,
we prove the same simple theorem in three different ways.
3x = 2n − 5 = 2(n − 3) + 1.
This is clearly odd, because it is of the form ‘an even integer plus one.’
3x + 5 = 2n + 5 = 2(n + 2) + 1.
51
Contradiction Proof. We assume that 3x + 5 and 3x are both even, and we deduce a falsehood.
Write 3x + 5 = 2m and 3x = 2n for some integers m and n. Then
Theorem 2.21. Let m, n ∈ Z. Both m and n are odd if and only if the product mn is odd.
Proof. (⇒) Let m and n be odd. Then m = 2k + 1 and n = 2l + 1 for some k, l ∈ Z. Then
(⇐) Suppose that the integers m and n are not both odd. That is, assume that at least one of m and n
is even. We show that the product mn is even. Without loss of generality,a we may assume that
n is even, from which n = 2k for some integer k. Then,
In the second part of the proof, we did not need to consider whether m was even or odd: if n is even,
the product mn is even regardless. The second part would have been very difficult to prove directly.
For instance, you might have tried to start a direct proof with:
We are stuck!
We can prove this directly, by the contrapositive method, or by contradiction. We’ll do all of them,
so you can appreciate the difference.
52
Direct Proof. Simply quote the two previous theorems. Because 3x + 5 is even, 3x must be odd by
Theorem 2.20. Now, since 3x is odd, both 3 and x are odd by Theorem 2.21.
Contrapositive Proof. Suppose that x is even. Then x = 2m for some integer m and we get
3x + 5 = 6m + 5 = 2(3m + 2) + 1.
Contradiction Proof. Suppose that both 3x + 5 and x are even. We can write 3x + 5 = 2m and x = 2k
for some integers m and k. Then
5 = (3x + 5) − 3x = 2m − 6k = 2(m − 3k )
is even. Contradiction.
Selecting a method of proof is often a matter of taste. You should be able to see the advantages and
disadvantages of the various approaches. The direct proof is more logically straightforward, but it
depends on two previous results. The contrapositive and the contradiction arguments are quicker
and more self-contained, but they require a greater level of comfort with logic. Consider who you
are writing for before you decide to present a slick difficult proof over a slow simple one.6 For even
more variety, here is a direct proof of Theorem 2.22 that does not use any previous result.
x = (3x + 5) − 2x − 5 = 2n − 2x − 5
= 2( x − n − 3) + 1
is odd.
The fact that such variety is possible just makes proving theorems even more fun!
6 The Hungarian mathematician Paul Erdős used to refer to simple, elegant proofs as being ‘from the Book,’ as if the
Almighty had a book of perfect proofs of which mere mortals might occasionally be permitted a glimpse. Of course, as
with all matters spiritual, one person’s Book may be very different to another’s. . .
53
Fake Proof 1. m = 3 and n = 5 are both odd, and so mn = 15 is odd.
This is an example of the theorem, not a proof. Examples are critical to helping you understand and
believe what a theorem says, but they are no substitute for a proof! Recall the discussion in the
Introduction on the usage of the word proof in English.
is odd.
The problem with this second ‘proof’ is that it is insufficiently general. m and n are supposed to be
any odd integers, but by setting both of them equal to 2k + 1, we’ve chosen m and n to be the same!
Notice how the correct proof uses m = 2k + 1 and n = 2l + 1, where we place no restriction on the
integers k and l.
By generality we mean that we must make sure to consider all possibilities encompassed by the hy-
pothesis. The phrase Without Loss of Generality, often shorted to WLOG, is used when a choice is
made which might at first appear to restrict things but, in fact, does not.
Think back to how this was used in the the proof of Theorem 2.21. Since the integers m and n ap-
pear symmetrically in the Theorem, if at least one of them is even, then we lose nothing by assuming
that the second integer n is even.
The phrase WLOG is used to pre-empt a challenge to a proof in the sense of Fake Proof 2, as if to
say to the reader:
‘You might be tempted to object that my argument is not general enough. However, I’ve thought
about it, and there is no problem.’
Common Mistake 2. Incorrect use of the equal sign Remember that propositions should be
joined by connectives: i.e., by =⇒ or ⇐⇒ . It is very common to see students write something like
This is extremely confusing! If this is part of a longer argument, things will become very difficult
to follow. Since ‘m is odd’ and ‘m = 2k + 1 for some integer k’ are both propositions, they should be
linked by a connective. We should instead write
54
Theorem (Fake Theorem). The only number is zero.
Everything is fine up to the third line, but then we divide by x − y, which is zero! Don’t let yourself
become so enamoured of logical manipulations that you forget to check the basics.
We can prove this theorem using any of the three methods. All rely on your ability to factorize the
polynomial:
h i
x3 + 2x2 − 3x − 10 = ( x − 2)( x2 + 4x + 5) = ( x − 2) ( x + 2)2 + 1 ,
Direct Proof. If x3 + 2x2 − 3x − 10 = 0, then ( x − 2)[( x + 2)2 + 1] = 0. Hence at least one of the factors
x − 2 or ( x + 2)2 + 1 is zero.
In the first case we conclude that x = 2.
The second case is impossible, since ( x + 2)2 ≥ 0 =⇒ ( x + 2)2 + 1 > 0.
Therefore x = 2 is the only solution.
55
Contradiction Proof. Suppose that x3 + 2x2 − 3x − 10 = 0 and x ̸= 2. Then
Since x ̸= 2, we have x − 2 ̸= 0.
It follows that ( x + 2)2 + 1 must be zero. However, ( x + 2)2 + 1 ≥ 1 for all real numbers x, so we
have a contradiction.
On balance, the contrapositive proof is probably the most elegant, but you can decide for yourself.
Common Mistake 4. Being excessively logical The statement of Theorem 2.23 is an implication
P =⇒ Q where P and Q are:
P. x3 + 2x2 − 3x − 10 = 0, Q. x = 2.
You can make life very hard for yourself by being overly logical. For instance, you may wish take
a third proposition R. x ∈ R, and state the theorem as R =⇒ ( P =⇒ Q). This is the way of
pain! It’s easier to assume, as a universal constraint, that you’re always dealing with real numbers;
you can then ignore said constraint within the argument.
Indeed, one can always append a third proposition to the front of any theorem, namely, “all math I
already know.” Try to resist the temptation to be so logical that your arguments become unreadable.
The goal is to convince the reader that the theorem is true, not to confuse them!
Reading Quiz
1. In a proof by contrapositive, we assume that (1) and deduce that (2)
(a) ¬ P ∨ Q is true
(b) P ∧ ¬ Q is true
(c) P =⇒ Q is true
(d) Q =⇒ P is false
3. In which of the following situations would it be correct to invoke without loss of generality? Select
all that apply.
(a) Suppose we are attempting to prove that for two integers m and n, if either one is even,
then so is the product. Without loss of generality we can assume that n is even.
56
(b) We are trying to prove that for two integers m and n, if both are odd, then so is the product.
Without loss of generality, we can assume that both m and n are equal to 2k + 1 for some
integer k.
(c) Attempting to prove that if m is even and n is odd, then mn is even. Without loss of
generality can be used to assume that m = 2.
(d) Attempting to prove that if three boxes are painted either green or gold, there must be two
boxes which are painted the same color. Without loss of generality can be used to assume
that the first box is painted green.
Practice Problems
2.3.1 Let x and y be integers. Prove: For x2 + y2 to be even, it is necessary that x and y have the same
parity (i.e. both even or both odd).
Video Solution
2.3.2 Let n be an integer. Prove that, in order for n to be odd, it is sufficient that its ones digit is either
1, 3, 5, 7, or 9.
Video Solution
Exercises
2.3.1 Show that for any given integers a, b, c, if a is even and b is odd, then 7a − ab + 12c + b2 + 4 is
odd.
2.3.3 Suppose you are teleported to a world in which the law of double negation does not necessarily
hold, i.e., it is not the case that ¬¬ P is equivalent to P. Would you be able to carry out proofs
by contradiction in this world?
x3 − 3x2 − 2x + 6 = 0 =⇒ x = 3 (∗)
(a) Is the proposition (∗) true or false? Justify your answer. Is its converse true?
57
(b) Repeat part (a) for the proposition
x3 − 3x2 − 2x + 6 = 0 =⇒ x ̸= 3
(c) Does anything change about the truth status of (∗) if we assume that it is a statement about
rational numbers x? Explain.
2.3.7 Let n and m be positive integers. Prove n2 m is even if and only if n and m are not both odd.
2.3.8 Let x and y be integers. Prove x2 + y2 is even if and only if x and y have the same parity (i.e.
both even or both odd).
Proof. Assume, without loss of generality, that x and y are even. Then x = 2a and y = 2b for
some integers a, b. Therefore,
2.3.12 Consider the following proof of the fact that (for m an integer) if m2 is even, then m is even.
Is proceeding by contradiction necessary? Can you re-write the proof so that it doesn’t use
contradiction?
Proof. Suppose, for contradiction, that m2 is even, but m is odd. Say m = 2k + 1 for some
integer k. Then
58
is odd, contradicting that m2 is even. Thus m must be even.
√ √ √
2.3.13 (a) Prove that if x and y are positive real numbers, then x + y ̸= x+ y. Argue by contra-
diction.
√ √ √
(b) Prove that if x and y are positive real numbers, then x + y ̸= x+ y. Argue by contra-
positive.
2.3.15 You meet three men, Corey, Jansen, and Vogel, each of whom is a either Truthteller or a Liar.
Truthtellers speak only the truth; Liars speak only lies. You ask Corey whether he is a Truthteller
or a Liar. Corey answers with his back turned, so you cannot hear what he says.
“What did he say?” you ask Jansen.
Jansen replies: “Corey says he is a Truthteller.”
Vogel says: “Jansen is lying.”
Is Vogel a Truthteller or a Liar? Explain your answer.
2.3.16 Assume that Mary’s father lives in California. Consider the following implication P:
If Mary’s father is an oilman and does not have any friends in Wisconsin, then Mary plays
tennis or basketball, or she appeared in at least one article of a December 1997 New York
Times newspaper edition.
2.3.17 Suppose we have three proposition P, Q, and R, and we want to prove that all three are equiv-
alent, i.e., P ⇐⇒ Q, Q ⇐⇒ R, and P ⇐⇒ R.
(a) Prove that to establish these three equivalences, it is enough to show P ⇐⇒ Q and
Q ⇐⇒ R.
(b) Prove that to establish these three equivalences, it is enough to show P =⇒ Q, Q =⇒ R,
and R =⇒ P.
k ( k +1)
2.3.18 Numbers of the form 2 , where k is a positive integer, are called triangular numbers. Prove
1
that n is the square of an odd number if and only if n−
8 is triangular.
59
2.4 More Methods of Proof
Definition-Pushing
The next example concerns divisibility. Before you can prove a theorem, it is critical that you know
the meaning of all of the words in its statement. We therefore state the definition of divisibility.
Definition 2.24. Let n and p be integers. We say that n is divisible by p (or p divides n) if n = pk for
some integer k. If n is divisible by p, we write p | n.
Proof. We prove directly. Let n be divisible by p. Then n = pk for some k ∈ Z. Then n2 = p2 k2 , and
so n2 is divisible by p2 .
This is an example of a definition-pushing proof. If you simply state the the definition of everything
important in the theorem, the proof will often be staring you in the face.
Proof by Cases
The next proof is also in the definition-pushing vein. However, it requires that we consider several
cases. The relevant definition here is that of remainder.
With a little thought, it should be clear that every integer is of the form 3k, 3k + 1 or 3k + 2. This is
analogous to how all integers are either even (2k) or odd (2k + 1). We will consider remainders more
carefully in Chapter 4.
Proof. We again prove directly. There are three cases: n has remainder 0, 1 or 2 upon dividing by 3.
(a) If n has remainder 0, then n = 3m for some m ∈ Z and so n2 = 9m2 = 3(3m2 ) has remainder 0.
60
Thus n2 has remainder 0 or 1.
x +y √
This theorem is written in the form ∀ x, y > 0, P( x, y) where P( x, y) is the statement 2 ≥ xy. It
may seem unclear how to approach proving such a theorem as our proof methods so far have mostly
focused on proving conditional statements. So one way to start would be to rewrite this theorem as
a conditional. From Section 2.2, we know that ∀ x, y > 0, P( x, y) is equivalent to ∀ x, y (( x > 0 ∧ y >
0) =⇒ P( x, y)). So we are essentially proving:
x+y √
If x, y > 0, then ≥ xy.
2
First we give a direct proof: note how the implication signs are stacked to make the argument clearer.
Direct Proof. Clearly ( x − y)2 ≥ 0 with equality if and only if x = y. Now multiply out:
The following contradiction proof incorporates exactly the same calculation, but is laid out in a dif-
ferent order. This is not always possible, and you have to take great care when trying it. You will
likely agree that the direct proof is easier to follow. Note that for contradiction we assume that
x+y √
¬∀ x, y > 0, ≥ xy
2
61
is true. Pushing the negation through, our contradiction assumption becomes
x+y √
∃ x, y > 0, < xy.
2
x +y √
Contradiction Proof. Suppose that 2 < xy for some x, y > 0. Since x + y ≥ 0, this is true if and
only if ( x + y)2 < 4xy. Now multiply out and rearrange:
Theorem 2.29. Let m and n be two fixed integers with m < n. Then there exists a rational number r such
that m < r < n.
Proof. Let r = m+ n
2 be the arithmetic mean of m and n. Then r is a rational number as it is of the form
p/q for an integer p and nonzero integer q. Since m < n, we have 2m < m + n < 2n and dividing by
2 yields m < r < n.
This is an example of a constructive proof as we explicitly construct the number which makes the
proposition true. Later we will we give an example of a non-constructive proof of an existential state-
ment where we show that an example must exist, even though we do not know what it is explicitly.
Example. Disprove the following statement. If all four sides of a quadrilateral have the same length,
then the quadrilateral must be a square.
62
Proof. All four sides of a square certainly have the same length, but remember that all four angles
in a square must be congruent as well. Disproving this statement then amounts to finding some
quadrilateral with four congruent sides, but without four congruent angles.
We can easily construct such a figure in the following way. Start with any non-right isosceles
triangle △ ABC where the sides AB and AC are congruent. Now place an identical copy of △ ABC,
call it △ A′ B′ C ′ , on top of △ ABC and reflect it through the side BC. We’re left with the quadrilateral
ABA′ C. The sides AB and AC are congruent to each other since we started with an isosceles triangle,
and these are both congruent to BA′ and A′ C since these were obtained by copying AB and AC.
Finally, this figure is not a square because angle ∠ BAC not a right angle. You might remember this
figure as a rhombus.
B A′
A C
Theorem 2.30. The equation x17 + 12x3 + 13x + 3 = 0 has no positive (real number) solutions.
First we interpret the theorem as an implication: throughout we assume that x is a real number.
The negation of Q( x ) is simply ‘x > 0.’ To prove the theorem by contradiction, we assume ∃ x ( P( x ) ∧
¬ Q( x )), and deduce a contradiction.
63
Proof. Assume that a real number x satisfies x17 + 12x3 + 13x + 3 = 0, and that x > 0. Because all
terms on the left hand side are positive, we have x17 + 12x3 + 13x + 3 > 0. A contradiction.
Note how quickly the proof is written: it assumes that any reader is familiar with the underlying
logic of a contradiction proof without it needing to be spelled out. The discussion we undertook
before writing the proof would be considered scratch work: you shouldn’t include it a final write-up.
If you want to extend the above result, and you can recall the Intermediate and Mean Value Theorems
from Calculus, you should be able to prove that there is exactly one (necessarily negative!) solution
to the above polynomial equation.
Lemma: a theorem whose importance you want to downplay. Often the result is individually
unimportant, but becomes more useful when referenced in the proof of a larger theorem.
Corollary: a theorem which follows quickly from another result. Corollaries can be used to draw
attention to a particular aspect or a special case of a theorem.
In many mathematical papers the word theorem is reserved only for the most important results, ev-
erything else being presented as a lemma or corollary. The choice of what to call a result is entirely
one of presentation. If you want your paper to be more readable, or to highlight what you think is
important, then lemmas and corollaries are your friends!
Here is a famous example of a lemma at work.
Prove this yourself: the (⇒) direction is easiest using the contrapositive method, while the (⇐) di-
rection works well directly.
√
Theorem 2.32. 2 is irrational.
This is tricky for a few reasons. The theorem does not appear to be of the form P =⇒ Q, , nor does
it seem to be any of the forms covered in this section. However, let us look a little closer at what is
being claimed. Remember√irrational simply means not rational, i.e., not of the form m, n for m ∈ Z and
√∈ N.mThus saying that 2 is irrational is equivalent to saying that there are no m, n ∈ N such that
n
2 = n . Phrased like this, we can see that the theorem statement is really a non-existence statement,
and so it makes sense to try a proof by contradiction.
64
√
Proof. Suppose that 2 = mn for some m, n ∈ N. Without loss of generality, we may assume that m, n
have no common factors.
Then m2 = 2n2 which says that m2 is even.
By Lemma 2.31 we have that m is even.
Thus m = 2k for some k ∈ Z.
But now, n2 = 2k2 , from which (Lemma 2.31 again) we see that n is even.
Now m and n have a common factor of 2. This is a contradiction.
First observe how Lemma 2.31 was used to make the proof easier to read. Without the lemma, the
essential shape of the proof would have been less clear.
Now try to make sense of the proof. In the first line we invoke the definition of rational, being√the ratio
of two integers. The main challenge comes immediately afterwards. Once we assume that 2 = mn ,
we can immediately insist that m, n have no common factors.√ Indeed this is no significant restriction
once we assume that m, n exist, that is once we assume that 2 is rational. It is important to realize that the
‘no common factors’ assumption is not the assumption being contradicted. Because of this subtlety,
we include the phrase ‘without loss of generality’ so that the reader is forced to think carefully, and
does not jump to the wrong conclusion.
It might seem difficult to completely understand, but if we hadn’t made the observation, our calcu-
lation could have continued forever, telling us nothing!
m2 = 2n2 =⇒ n2 = 2k2 =⇒ k2 = 2l 2 =⇒ · · ·
If you find this approach difficult, you may prefer an alternative proof given in the exercises.
Non-constructive Proofs
We saw earlier that we usually prove an existential statement by coming up with an explicit object
and showing that it has the desired properties. Here is an example that shows that this can be a bit
subtle.
Theorem 2.33. There are irrational numbers a and b such that ab is a rational number.
√ √ √2
Proof. By Theorem 2.32, we know that 2 is irrational. Consider the number ( 2) . There are two
√ √2 √
possibilities. If ( 2) is rational,√ then we can take a = b = 2 in the theorem statement and we’re
√
done. On the other hand, if ( 2) 2 is irrational, then we have
√ √ √2 √ √ √ √
2
2 = ( 2) 2· 2 = ( 2)2 = 2.
√ √ √
In this case, we can take a = ( 2) 2 and b = 2 in the theorem statement. In both cases we have
found irrational numbers a and b where ab is rational.
65
The critical, and perhaps unsatisfying, part of this proof is that we have not said whether or not
√ √
2
( 2) is rational. We then say that this proof is non-constructive since it does not actually contain
explicit (and unconditional) irrational a and b with ab rational. Instead, we have shown that the
√ √2
theorem is true whether or not ( 2) is rational.
Prime Numbers
Here is another famous result, dating back at least to the Ancient Greeks (Euclid’s Elements, Proposi-
tion IX.20). As ever, we need a solid definition before we try to prove anything.
Definition 2.34. An integer ≥ 2 is prime if the only positive integers it is divisible by are itself and 1.
The first few primes are 2, 3, 5, 7, 11, 13, 17, 19, . . . It follows7 from the definition that all positive in-
tegers ≥ 2 are either primes or composites (products of primes). In particular, every integer ≥ 2 is
divisible by at least one prime. We may now state Euclid’s result.
Proof. We prove by contradiction. Assume there are exactly n prime numbers p1 , . . . , pn and consider
the integer
Π := p1 · · · pn + 1.
Certainly Π is divisible by some prime: since we are assuming that the list p1 , . . . , pn contains all the
primes, Π must be divisible by some prime pi in the list. However, the product p1 · · · pn is clearly
divisible by pi , whence so is the differencea
Π − p1 · · · pn = 1.
Reading Quiz
2.4.1 When proving a non-existence statement, i.e., proving that something does not exist, proof by
contradiction is often useful because .
66
(c) it allows one to assume such an object exists, hence giving an object that can be manipu-
lated.
(d) it allows one to assume such an object does not exist, which is exactly what the problem is
asking for.
2.4.2 True or False: When proving a universal statement like ∀ x P( x ), it suffices to give an explicit
example of an x for which P( x ) holds.
2.4.3 Which of the following would serve as a counterexample to the statement “any continuous
function defined on the open interval (0, 1) has a maximum value”?
Practice Problems
2.4.1 Prove or disprove the following conjectures:
(a) The sum of any 3 consecutive integers is divisible by 3.
(b) The sum of any 4 consecutive integers is divisible by 4.
(c) The product of any 3 consecutive integers is divisible by 6.
Video Solution
2.4.2 Critique the following proof. If the proof adequately demonstrates why the statement is true,
explain why. Otherwise, identify any errors and explain how to correct them.
Theorem 2.36. If x is a positive real number, then x > 1 if and only if 1/x < 1.
Proof. Suppose 1/x < 1. Since x is positive, multiplying both sides of this inequality by x does
not reverse the inequality and we obtain 1 < x.
Video Solution
Exercises
2.4.1 Prove or disprove the following conjectures.
(a) There is an even integer which can be expressed as the sum of three even integers.
(b) Every even integer can be expressed as the sum of three even integers.
(c) There is an odd integer which can be expressed as the sum of two odd integers.
(d) Every odd integer can be expressed as the sum of three odd integers.
67
To get a feel about whether a claim is true or false, try out some examples. If you believe a claim is
false, provide a specific counterexample. If you believe a claim is true, give a formal proof.
2.4.3 (a) Prove or disprove: There exist integers m and n such that 2m − 3n = 15.
(b) Prove or disprove: There exist integers m and n such that 6m − 3n = 11.
2.4.4 Prove or disprove: There exist a line L in R2 such that, for all points A, B ∈ R2 , we have A, B
lie on L.
2.4.5 Prove that between any two distinct rational numbers there exists another rational number.
For any non-zero rational number r and any irrational number t, rt is irrational.
(a) Translate this statement into logic using quantifiers and propositional functions.
(b) Prove the statement.
2.4.8 Prove: For every positive integer n, n2 + n + 3 is an odd integer greater than or equal to 5.
There are two claims here: n2 + n + 3 is odd, and n2 + n + 3 ≥ 5.
2.4.9 In this question, you should use the following definition of the rational numbers.
p
Definition. A real number x is rational if it may be written in the form x = q where p is an
integer and q is a positive integer. x is irrational if it is not rational.
Conjecture (1). If x and y are real numbers such that 3x + 5y is irrational, then at least one of x and y
is irrational.
2.4.10 (Snake-like integers) Let’s say that an integer y is Snake-like if and only if there is some integer k
such that y = (6k )2 + 9.
68
2.4.11 Prove that it is never the case that x2 = 2y2 for integers x and y.
√ √ m
2.4.12 Here is an alternative argument that 2 is irrational. Suppose that 2 = n where m, n ∈ N.
This time we don’t assume that m, n have no common factors.
(a) m, n satisfy the equation m2 = 2n2 . Prove that there exist positive integers m1 , n1 which
satisfy the following three conditions:
(b) Show that there exist two sequences of decreasing positive integers m > m1 > m2 > · · ·
and n > n1 > n2 > · · · which satisfy m2i = 2n2i for all i ∈ N.
(c) Is it possible to have an infinite sequence of decreasing√positive integers? Why not? Show
that we obtain a contradiction and thus conclude that 2 ̸∈ Q.
This is an example of the method of infinite descent, which is very important in number theory.
2.4.13 The real numbers have the Archimedean property, that is, for any positive real numbers x and y,
there exists a positive integer n such that nx > y. Use this fact to show that there do not exist
any positive real numbers which are less than 1/n for all positive integers n.
2.4.14 Consider the following proof of the fact that every real number is less than some positive inte-
ger:
Proof. Consider a real number x. For example, x = 19.7. Then x < 20 and 20 is a positive
integer.
What is wrong with this proof? Give a correct proof. [Hint: use the previous exercise.]
2.4.15 Here is an extension of question 5. Let ⌈ x ⌉, the ceiling of x, denote the smallest integer greater
than or equal to x. E.g. ⌈3.2⌉ = 4, ⌈7⌉ = 7 and ⌈−8.4⌉ = −8.
(a) Suppose that x and y are real numbers with x < y. Use the ceiling function to show that
there exists a positive integer n for which n(y − x ) > 1.
(b) Prove or disprove: ∀ x, y ∈ R with x < y, ∃m, n ∈ Z for which nx < m < ny.
(c) Use parts (a) and (b) to prove that between any two real numbers there exists a rational
number.
(d) (Hard) Is it true that between any two real numbers there exists an irrational number? If
so, prove it.
69
(a) All polynomials are continuous.
(b) (Intermediate Value Theorem) If f is continuous on [ a, b] and L lies between f ( a) and f (b),
then f ( x ) = L for some x ∈ ( a, b).
(c) If f ′ ( x ) > 0 on an interval, then f is an increasing function.
Use these facts to give a formal proof that x17 + 12x3 + 13x + 3 = 0 has exactly one solution x,
and that x lies in the interval (−1, 0).
(a) Prove, directly from the definition, that f ( x ) = x2 is continuous at x = 0. If you are given
ϵ > 0, what should δ be?
(
1 + x if x ≥ 0,
(b) Prove that g( x ) = is discontinuous at x = 0.
x if x < 0,
(
x if x is rational,
(c) (Very hard) Let h( x ) = Prove that f is continuous only at x = 0.
0 if x is irrational.
(a) Recall the Extreme Value Theorem. The function f is continuous on [ a, b], so f is bounded
and attains its bounds. Otherwise said,
Suppose that f (m) = f ( M ). Why is the conclusion of Rolle’s Theorem obvious in this
case?
(b) Now suppose that f (m) ̸= f ( M ). Argue that at least one of the following cases holds:
(c) Without loss of generality, we may assume that f ( M ) > 0. By considering the function
− f , explain why.
(d) Assume f ( M ) > 0. Then M ̸= a and M ̸= b. Consider the difference quotient,
f ( M + h) − f ( M)
.
h
Show that if 0 < |h| < min{ M − a, b − M } then the difference quotient is well-defined
(exists and makes sense).
70
(e) Suppose that 0 < h < b − M. Show that
f ( M + h) − f ( M)
≤ 0.
h
f ( M +h)− f ( M )
How do we know that L+ := lim h exists? What can you conclude about L+ ?
h → 0+
f ( M +h)− f ( M )
(f) Repeat part (d) for L− := lim h .
h → 0−
(g) Conclude that L+ = L− = 0. Why have we completed the proof?
71
3 Sets and Functions
Sets are the fundamental building blocks of mathematics. In the sub-discipline of Set Theory, mathe-
maticians define all basic notions, including number, addition, function, etc., purely in terms of sets.
In such a system it can take over 100 pages of discussion to prove that 1 + 1 = 2! We will not be any-
thing like so rigorous. Indeed, before one can accept that such formality has its place in mathematics,
a level of familiarity with sets and their basic operations is necessary.
Sets A and B are described as equal, written A = B, if they have exactly the same elements.
When thinking abstractly about sets, you may find Venn diagrams useful.
A set is visualized as a region in the plane and, if necessary, members of a2 a1
the set can be thought of as dots in this region. This is most useful when
one has to think about multiple, possibly over-lapping, sets. The graphic A
represents a set A with at least three elements a1 , a2 , a3 . The element x
does not lie in A. a3
x
S = {3, 5, f , α, β}
then we’d say, ‘S is the set whose elements are 3, 5, f , α and β.’
The order in which we list the elements of a set is irrelevant, thus
S = { β, f , 5, α, 3} = { f , α, 3, β, 5}.
72
for ‘such that.’ Which symbol you use depends partly on taste, although the context may make one
clearer to read.9 For example, if S = {3, 5, f , α, β} is the set defined above, we could write,
We would read: ‘The set of elements s in S such that s is a Greek letter is the set {α, β}.’
More generally, if S is a set and P is a propositional function whose domain is S, then we can
define a new set
A := {s ∈ S : P(s) is true}
Example. Let A = {2, 4, 6} and B = {1, 2, 5, 6}. There are many options for how to write A and B in
set-builder notation. For example, we could write
We now practice the opposite skill by converting five sets from set-builder to roster notation.
S1 = { a ∈ A : a is divisible by 4} = {4}
S2 = {b ∈ B : b is odd} = {1, 5}
S3 = { a ∈ A | a ∈ B} = {2, 6}
S4 = { a ∈ A : a ̸ ∈ B } = { 4 }
Take your time getting used to this notation. Can you find an alternative description in set-builder
notation for the sets S1 , . . . , S5 above? It is crucial that you can translate between various descriptions
of a set or you won’t be able to read much mathematics!
Sets of Numbers
Common sets of numbers are written in the BLACKBOARD BOLD typeface.
73
nZ = multiples of n = {. . . , −3n, −2n, −n, 0, n, 2n, 3n, . . .}
Where there are multiple choices of notation, we will tend to use the first in the list: for example N0
is preferred to Z≥0 . The use of a subscript 0 to include zero and a superscript ± to restrict to positive
or negative numbers is standard.
√
Examples. 7 ∈ Z, π ∈ R, π ̸∈ Q, −5 ∈ C, − e 2 ∈ R− .
There are often many different ways to represent the same set in set-builder notation. For example,
the set of even numbers may be written in multiple ways: think about the English translations.
Can you find any other ways to describe the even numbers using basic set notation?
The notation nZ is most commonly used when n is a natural number, but it can also be used for other
n. For example
1
1 1
2 Z = 2 x : x ∈ Z = m, m + 2 : m ∈ Z
is the set of multiples of 12 (comprising the integers and half-integers). The notation can also be
extended: for example 2Z + 1 would denote the odd integers.
2Z = {n ∈ Z | 2 | n}.
In other situations the opposite is true. In Section 3.4 we shall consider functions. If you recall the
concept of an even function from calculus, we could denote the set of such as
{ f : R → R : ∀ x f ( x ) = f (− x )} or { f : R → R | ∀ x f ( x ) = f (− x )}.
74
We see that
3.1.3 It is often harder to convert from roster to set-builder notation, as you might be required to spot
a pattern, and many choices could be available. For example, if
1 1 1 1 1 1
D= , , , , , ,... ,
6 20 42 72 110 156
Of course the ellipses (. . . ) might not indicate that the elements of the set continue in the way
you expect. For larger sets, the concision and clarity of set-builder notation makes it much
preferred!
n n2 n2 + 2
±1 1 3
±3 9 11
±5 25 27
±7 49 51
±9 81 83
.. .. ..
. . .
The set E consists of those integers of the form n2 + 2 where n is an odd integer. By the table,
75
On the other hand, F includes all those integers n such that n2 + 2 is odd. It is easy to see that
Intervals
Interval notation is useful when discussing collections of real numbers. You should be familiar from
calculus with the words open and closed with regard to intervals. For example,
When writing intervals with ±∞ use an open bracket at the infinite end(s): [1, ∞) = { x ∈ R : x ≥ 1}.
This is since the symbols ±∞ do not represent real numbers and so are not members of any interval.
Example. Recall some basic trigonometry. Consider the set of solutions to the equation cos x = − 12
where x lies in the interval [0, 4π ]. This set can be written in set-builder and roster notation as
1 2π 4π 8π 10π
x ∈ [0, 4π ] : cos x = − = , , ,
2 3 3 3 3
y
1
2π 4π 8π 10π
3 3 3 3
0 x
π 2π 3π 4π
− 21
−1
Definition 3.2. A set A is finite if it contains a finite number of elements: this number is the set’s
cardinality, written | A|. If A contains infinitely many elements, it said to be an infinite set.
76
√
Examples. 3.1.1 Let A = { a, b, α, γ, 2}, then | A| = 5.
n o
3.1.2 Let B = 4, {1, 2}, {3} . It is important to note that the elements/members of B are 4, {1, 2} and
{3}, two of which are themselves sets. Therefore | B| = 3. The set {1, 2} is an object in its own
right, and can therefore be placed in a set along with other objects.a
a The fact that a set (containing objects) is also an object might seem confusing, but you should be familiar with the
same problem in English. Consider the following sentences: ‘UCI are constructing a laboratory’ and ‘UCI is constructing a
laboratory.’ In the first case we are thinking of UCI as a collection of individuals, in the latter case UCI is a single object.
Opinions differ in various modes of English as to which is grammatically correct.
Cardinality is a very simple concept for finite sets. For infinite sets, such as the natural numbers N,
the concept of cardinality much more subtle. In Chapter 8 we will consider what cardinality means
for infinite sets and meet several bizarre and fun consequences. For the present, cardinality only has
meaning for finite sets.
To round things off we need a symbol to denote a set that contains nothing at all!
Axiom. There exists a set ∅ with no elements (cardinality zero: |∅| = 0). We call ∅ the empty set.
There are many representations of the empty set. For example { x ∈ N : x2 + 3x + 2 = 0} and
{n ∈ N : n < 0} are both empty. Despite this, we will see in Theorem 3.5 that there is only one set
with no elements, so that all representations actually denote the same set ∅. Note also that | A| ∈ N
for any finite non-empty set A.
Aside. Axioms
An axiom is a basic assumption; something that we need in order to do mathematics, but cannot
prove. This is the cheat by which mathematicians can be 100% sure that something is true: a result is
proved based on the assumption of several axioms. With regard to the empty set axiom, it probably
seems bizarre that we can assume the existence of some set that has nothing in it. Regardless, mathe-
maticians have universally agreed that we need the empty set in order to do the rest of mathematics.
The assumption that set-builder notation always defines a new set is another axiom.
Reading Questions
3.1.1 Which of the following describe the following set?
{0, 1, 2, 3, 4}
(a) { x ∈ N0 : x ≤ 4}
(b) { x ∈ Q : x ∈ [0, 4]}
(c) { x ∈ Z : x ∈ [0, 4)}
(d) { x ∈ Z : x ∈ [0, 4]}
3.1.2 What is the cardinality of the set {cat, {1, 2}, 2}?
77
(a) 2
(b) 3
(c) 4
(d) it is an infinite set
3.1.3 True or False: An open interval contains its endpoints.
3.1.4 True or False: {1, 2, 3} = {3, 1, 2}.
3.1.5 Which of the following sets are empty?
(a) { x ∈ R : x 2 < 0}
(b) { x ∈ R : x 2 ≤ 0}
(c) { x ∈ N : x ∈ [0.5, 0.75)}
(d) [1, 1]
Practice Problems
3.1.1 Write each of the following sets in roster notation (i.e. list their elements).
(a) { x ∈ R : x2 − 5x + 4 = −2}
(b) { x ∈ Q : 2x ∈ Z}
(c) {n2 − 1 ∈ Z : n ∈ {−3, −1, 1, 3}}
(d) { x ∈ 2Z + 1 : x ∈ (0, 10]}
Video Solution
3.1.2 Write each of the following sets in set-builder notation.
(a) {. . . , −8, −3, 2, 7, 12, 17, . . .}
(b) {2, 3, 5, 7, 11, 13}
1 1
(c) {1, 14 , 16 , 64 , . . .}
Video Solution
3.1.3 Let
A = {0, {0}, {1, 2}, {0, {1, 3}}}
Answer True or False for each of the following:
(a) 0∈A
(b) {0} ∈ A
(c) 1∈A
(d) {1} ∈ A
(e) {1, 3} ∈ A
(f) {0, {1, 3}} ∈ A
What is the cardinality of A?
Video Solution
78
Exercises
3.1.1 Describe the following sets in roster notation: that is, list their elements.
(a) { x ∈ N : x2 ≤ 5x }.
(b) { x2 ∈ R : x2 − 3x + 2 = 0}.
(c) n ∈ {−4, −2, −1, 0, 1, . . . , 21} : 4 | n2 (does : or | denote the condition?)
(d) { x ∈ 21 Z : 0 ≤ x ≤ 4 and 4x2 ∈ 2Z + 1}
3.1.2 Describe the following sets in set-builder notation (look for a pattern).
(a) {. . . , −3, 0, 3, 6, 9, . . .}
(b) {−3, 1, 5, 9, 13, . . .}
(c) {1, 31 , 71 , 15
1 1
, 31 , . . .}
3.1.3 Let
A=∅
B = { A}
C = {{ A}}
D = { A, {0}, {0, 1}}
(a) 0 ∈ A
(b) A ∈ B
(c) A ∈ C
(d) B ∈ C
(e) A ∈ D
(f) B ∈ D
(g) 0 ∈ D
(h) {0} ∈ D
(i) {1} ∈ D
3.1.4 Each of the following sets of real numbers is a single interval. Determine the interval.
3.1.5 Can you describe the set { x ∈ Z : −3 ≤ x < 77} in interval notation? Why/why not?
3.1.6 Compare the sets A = {3x ∈ Z : x ∈ 2Z} and B = { x ∈ Z : 6 | ( x − 12)}. Are they equal?
79
3.1.7 What is the cardinality of the following set? What are the elements?
n o
∅, ∅ , ∅, {∅} .
and
n o
D= x, {y} : x, y ∈ A .
80
3.2 Subsets
In this section we consider the most basic manner in which two sets can be related.
Definition 3.3. If A and B are sets such that every element of A is also an element of B, then we say
that A is a subset of B and write A ⊆ B.
A is a proper subset of B if it is a subset which is not equal. This can be written A ⊊ B.a
a We will religiously stick to this notation. When reading other texts, note that some authors prefer A ⊂ B for proper
subset. Others use ⊂ for any subset, whether proper or not.
Theorem 3.4. Two sets are equal if and only if they are each a subset of the other. Equivalently
A = B ⇐⇒ A ⊆ B and B ⊆ A.
Proof. Recall that two sets A and B are equal if and only if they have the same elements. But this is if
and only if every element of A is also an element of B and vice versa.
You will often need to prove that two sets are equal: showing that each is a subset of the other is a
very common way to accomplish this.
Venn diagrams are particularly useful for visualizing subset re-
lations. The graphic on the right depicts three sets A, B, C: it
C A B
should be clear that the only valid subset relation between the
three is A ⊆ B.
Set-builder notation implicitly uses the concept of subset: the notation X = {y ∈ Y : P(y)}
describes a set X as the subset of some other set Y, all of whose elements satisfy the property P(y).
The previous section contained many examples that were subsets of the set of real numbers R. Here
are some other examples of subsets.
3.2.2 { x ∈ R : x2 − 1 = 0} ⊆ {y ∈ R : y2 ∈ N}.
To make sense of this relationship, convert to roster notation: we obtain
√ √ √ √
{−1, 1} ⊆ {± 1, ± 2, ± 3, ± 4, . . .}.
3.2.3 If m and n are positive integers, then mZ ⊆ nZ ⇐⇒ n | m. Make sure you’re comfortable with
this! For example, 4Z ⊆ 2Z since every multiple of 4 is also a multiple of 2.
81
Here we collect several results relating to subsets.
3.2.2 For any set A, we have ∅ ⊆ A and A ⊆ A (Trivial and non-proper subsets)
Proof. 3.2.1 Let A be a set with cardinality zero, i.e., with no elements. ∅ has no members, therefore
∅ ⊆ A is trivial: there is nothing to check to see that all elements of ∅ are also elements of A!
The argument for A ⊆ ∅ is identical. By Theorem 3.4 we see that A = ∅.
3.2.2 Let A be any set. ∅ ⊆ A follows by the argument in 1. To prove that A ⊆ A we must show that
all elements of A are also elements of A. But this is completely obvious!
3.2.3 Assume that A is a subset of B and that B is a subset of C. We must show that all elements of A
are also elements of C. Let a ∈ A. Since A ⊆ B we know that a ∈ B. Since B ⊆ C and a ∈ B, we
conclude that a ∈ C. This shows that every element of A belongs to C. Hence A ⊆ C.
As a final observation, to which we will return in Theorem 3.15 and in Chapter 8, your intuition
should tell you that, for finite sets, subsets have smaller cardinality:
A ⊆ B =⇒ | A| ≤ | B| .
More generally, consider replacing the terms in Theorem 3.5 according to the following table:
⊆ ≤
∅ 0
sets A, B, C non-negative integers
cardinality absolute value
The results should seem completely natural! Recognizing the similarities between a new concept and
a familiar one, essentially spotting patterns, is perhaps the most necessary skill in mathematics.
Reading Quiz
3.2.1 True or False: Every set has a proper subset.
(a) 1
(b) 2
(c) 3
(d) 4
82
3.2.4 A = B if and only if
(a) A ⊆ B
(b) A ⊆ B and if x ∈
/ A, then x ∈
/ B.
(c) B ⊆ A
(d) A ⊊ B and B is finite.
Practice Problems
3.2.1 Suppose A ⊆ B ⊆ C and A = C. Show A = B and B = C.
Video Solution
3.2.2 Let
(a) ∅ ⊊ A
(b) {0} ⊆ A
(c) {{0}} ⊆ A
(d) {1, 2} ⊆ A
(e) {{1, 2}} ⊆ A
(f) {0, {0}, {1, 3}} ⊆ A
(g) A ⊊ A
Video Solution
Exercises
3.2.1 Let A, B, C, D be the following sets.
A = {−4, 1, 2, 4, 10}
B = {m ∈ Z : |m| ≤ 12}
C = {n ∈ Z : 3 | (n2 − 1)}
D = {t ∈ Z : t2 + 3 ∈ [4, 20)}
Of the 12 possible subset relations A ⊆ B, A ⊆ C, . . . D ⊆ C, which are true and which false?
3.2.3 (a) Order the following sets according to which are subsets of which:
R, Z, N0 , N, Q, C
83
(b) (Hammack’s Book of Proof , Section 1.3, Exercise 14) True or False? R2 ⊆ R3 . Explain your
answer.
[0, x ] ⊆ [0, x2 ]
3.2.7 Let A = {1, 2, {1, 2}, {3}} and B = {1, 2}. Answer True or False for each of the following:
(a) B ∈ A
(b) B ⊆ A
(c) 3 ∈ A
(d) {3} ⊆ A
(e) {3} ∈ A
(f) ∅ ⊆ A
(g) ∅ ∈ A
3.2.10 Fill in the blanks in the following proof of the fact that A ⊊ B and B ⊊ C implies A ⊊ C.
3.2.11 For the following proof sketch, determine the result that is being proved, and then turn the
sketch into a formal proof.
3.2.12 Given A ⊆ Z and x ∈ Z, we say that x is A-mirrored if and only if − x ∈ A. We also define:
M A := { x ∈ Z : x is A-mirrored}.
84
(a) What is the negation of ‘x is A-mirrored.’
(b) Find MB for B = {0, 1, −6, −7, 7, 100}.
(c) Assume that A ⊆ Z is closed under addition (i.e., for all x, y ∈ A, we have x + y ∈ A).
Show that M A is closed under addition.
(d) In your own words, under which conditions is A = M A ?
[1] = { x ∈ Z : 5 | ( x − 1)}.
3.2.14 (a) Give a formal proof of the fact that A ⊆ B =⇒ | A| ≤ | B| for finite sets. Resist the
temptation to look at Theorem 3.15: it is far more technical than you need for this!
(b) Explain why | A| ≤ | B| =⇒
̸ A ⊆ B.
(a) How many subsets of A are there of cardinality 0, 1, 2, 3, and 4, respectively. Do you notice
any patterns?
(b) Completely expand the polynomial (1 + x )4 . What do you notice about the coefficients?
3.2.16 Let A be a set. We define the power set of A, P ( A), to be the set of all subsets of A:
P ( A ) = { X : X ⊆ A }.
85
3.3 Unions, Intersections, and Complements
In this section we construct new sets from old, modeled precisely on the logical concepts of and, or,
and not. For the duration of this section, suppose that U is some universal set, of which every set
mentioned subsequently is a subset.10
AC = { x ∈ U : x ∈
/ A }. A
B \ A = {x ∈ B : x ∈
/ A }.
B\A
The set B \ A is also called B minus A. For its Venn diagram, we
represent A and B as overlapping circular regions. The comple-
ment B \ A is the green shaded region.
Example. Let U = {1, 2, 3, 4, 5}, A = {1, 2, 3}, and B = {2, 3, 4}. Then
A ∪ B = { x ∈ U : x ∈ A or x ∈ B}.
A\B A∩B B\A
The intersection of A and B is the set
A ∩ B = { x ∈ U : x ∈ A and x ∈ B}.
| {z }
We say that A and B are disjoint if A ∩ B = ∅. A∪B
In the Venn diagram, the sets A and B are again depicted as overlapping circles. Although it doesn’t
10 This is necessary so that the definitions to come made using set-builder notation really define sets.
86
constitute a proof, the diagram makes it clear that
A = ( A \ B) ∪ ( A ∩ B) and B = ( B \ A ) ∪ ( A ∩ B ).
‘Or’ is used in the logical sense: A ∪ B is the collection of all elements that lie in A, in B, or in
both. Now observe the notational pattern: ∪ looks very similar to the logic symbol ∨ from Chapter
2. The symbols ∩ and ∧ are also similar. This should help you remember which symbol to use when!
Examples. 3.3.1 Let U = {fish, dog, cat, hamster}, A = {fish, cat}, and B = {dog, cat}. Then,
3.3.2 Using interval notation, let U = [−4, 5], A = [−3, 2], and B = [−4, 1). Then
AC = [−4, −3) ∪ (2, 5], BC = [1, 5], B \ A = [−4, −3), A \ B = [1, 2].
A [ ]
B [ )
U [ ]
−4 −3 −2 −1 0 1 2 3 4 5
A [
C ) ( ]
BC [ ]
B\A [ )
A\B [ ]
3.3.3 Let A = (−∞, 3) and B = [−2, ∞) in interval notation. Then A ∪ B = R and A ∩ B = [−2, 3).
We didn’t mention the universal set in the final example, though it seems reasonable to assume that
U = R. In practice U is rarely made explicit, and is often assumed to be the smallest suitable uncom-
plicated set. When dealing with sets of real numbers this typically means U = R. In other situations
U = Z or U = {0, 1, 2, 3, . . . , n − 1} might be more appropriate.
3.3.1 ∅ ∪ A = A and ∅ ∩ A = ∅.
3.3.2 A ∩ B ⊆ A ⊆ A ∪ B.
3.3.3 A ∪ B = B ∪ A and A ∩ B = B ∩ A.
3.3.4 A ∪ ( B ∪ C ) = ( A ∪ B) ∪ C and A ∩ ( B ∩ C ) = ( A ∩ B) ∩ C.
3.3.5 A ∪ A = A ∩ A = A.
3.3.6 A ⊆ B =⇒ A ∪ C ⊆ B ∪ C and A ∩ C ⊆ B ∩ C.
87
You should be able to prove each of these properties directly from Definitions 3.3 and 3.7. Don’t
memorize the proofs: with a little practice working with sets, each of these results should feel com-
pletely obvious. It is more important that you are able to vizualize the laws using Venn diagrams.
A Venn diagram does not constitute a formal proof, though it is extremely helpful for clarification.
Here we prove only second result: think about how the Venn diagram in Definition 3.7 illustrates the
result. Some of the other proofs are in the Exercises.
Proof of 2. There are two results here: A ∩ B ⊆ A and A ⊆ A ∪ B. We show each separately, along
with some of our reasoning.
The following theorem describes how complements interact with other set operations.
3.3.1 ( A ∩ B)C = AC ∪ BC .
3.3.2 ( A ∪ B)C = AC ∩ BC . A B
3.3.3 ( AC )C = A.
3.3.4 A \ B = A ∩ BC .
3.3.5 A ⊆ B ⇐⇒ BC ⊆ AC . ( A ∩ B )C = AC ∪ BC
Again: don’t memorize these laws! Draw Venn diagrams to help with visualization.
Proof of 1. We start by trying to show that the left hand side is a subset of the right hand side.
/ A∩B
x ∈ ( A ∩ B)C =⇒ x ∈
=⇒ x is not a member of both A and B
=⇒ x is not in at least one of A and B
/ A or x ∈
=⇒ x ∈ /B
=⇒ x ∈ AC or x ∈ BC
=⇒ x ∈ AC ∪ BC
With a little thinking, we realize that all of the =⇒ arrows may be replaced with if and only if arrows
⇐⇒ without compromising the argument. We’ve therefore shown that the sets ( A ∩ B)C and AC ∪ BC
have the same elements, and are thus equal.
88
We were lucky with our proof. Showing that both sides are subsets of each other would have been
tedious, but we found a quicker proof by carefully laying out one direction. This happens more often
than you might expect. Just be careful: you can’t always make conditional connectives biconditional.
Parts 1. and 2. of the theorem are known as De Morgan’s laws, just as the equivalent statements in
logic: Theorem 2.10. Indeed, we could rephrase our proof in that language.
Alternative Proof of 1.
x ∈ ( A ∩ B)C ⇐⇒ ¬[ x ∈ A ∩ B]
⇐⇒ ¬[ x ∈ A and x ∈ B]
⇐⇒ ¬[ x ∈ A] or ¬[ x ∈ B] (De Morgan’s first law)
⇐⇒ x ∈ A C
or x ∈ B C
⇐⇒ x ∈ AC ∪ BC
Finally, we have two results which describe the interaction of unions and intersections.
3.3.1 A ∩ ( B ∪ C ) = ( A ∩ B) ∪ ( A ∩ C )
3.3.2 A ∪ ( B ∩ C ) = ( A ∪ B) ∩ ( A ∪ C ) C
We prove only the second result. The method is the standard ap-
proach: show that each side is a subset of the other. We do both A B
directions this time, though with a little work and the cost of some
clarity, you might be able to slim down the proof. The Venn di-
agram on the right illustrates the second result: simply add the
colored regions.
In both cases x ∈ ( A ∪ B) ∩ ( A ∪ C ).
In both cases y ∈ A ∪ ( B ∩ C ).
89
Reading Quiz
3.3.1 Let U = Z, A = 2Z, B = {1, 3, 5}. Which of the following statements are true?
(a) B ⊆ AC .
(b) A and B are not disjoint.
(c) A ∪ B = Z.
(d) Z \ B is finite.
(e) AC = 2Z + 1
3.3.3 For sets A and B, the result that ( A ∪ B)C = AC ∩ BC is most similar to which of the following
laws of logic?
(a) A ∩ B ⊆ A \ B.
(b) B = ( A ∩ B) ∪ ( B \ A).
(c) A ∪ B = ( A \ B) ∪ ( A ∩ B) ∪ ( B \ A).
(d) A \ B = B \ A.
Practice Problems
3.3.1 Let a, b, c, d ∈ R. Show
3.3.2 Let U be a universal set and A and B sets. Prove that ( A \ B)C = AC ∪ B.
Video Solution
90
Exercises
3.3.1 Describe each of the following sets in as simple a manner as you can: e.g.,
√
{ x ∈ R : ( x2 > 4 and x3 < 27) or x2 = 15} = (−∞, −2) ∪ (2, 3) ∪ { 15}.
(a) { x ∈ R : x2 ̸= x }
(b) { x ∈ R : x3 − 2x2 − 3x ≤ 0 or x2 = 4}
(c) { x2 ∈ R : x ̸= 1}
(d) {z ∈ Z : z2 is even and z3 is odd}
3.3.2 (a) Let A and B be sets. Use logical connectives to rewrite the following propositions
i. x ∈ A∩B
ii. x ∈ A∪B
iii. x ∈ A \ B‘
iv. x ∈ ( A ∪ B) \ ( A ∩ B)
in terms of the statements P : ‘x ∈ A′ and Q : ‘x ∈ B′ .
(b) For A = {1, 3, 5, 7, 9, 11} and B = {1, 4, 7, 10, 13}, compute the following sets:
i. A∩B
ii. A∪B
iii. A\B
iv. ( A ∪ B ) \ ( A ∩ B ).
3.3.3 Let A ⊆ R, and let x ∈ R. We say that the point x is far away from the set A if and only if:
(a) Draw a picture of a set A and an element x such that is far away from A.
(b) Draw a picture of a set A and an element x such that x is close to A.
(c) Compute the definition of “x is close to A”. [So negate “x is far away from A”.]
(d) Let A = {1, 2, 3}. Show that x = 4 is far away from A, by using definitions.
(e) Let A = {1, 2, 3}. Show that x = 1 is close to A, by using definitions.
(f) Show that if x ∈ A, then x is close to A.
(g) Let A be the open interval ( a, b). Is the end-point a far away from A? What about the
end-point b?
3.3.4 Consider Theorems 3.8 and 3.10. In all seven results, replace the symbols in the first row of the
following table with those in the second. Which of the results seem familar? Which are false?
∅ A, B, C sets ∪ ∩ ⊆
0 A, B, C ∈ N0 + · ≤
91
3.3.6 Practice your proof skills by giving formal proofs of the following results from Theorems 3.8
and 3.9. With practice you should be able to prove all of parts of these theorems (and of Theorem
3.10) these without looking at the arguments in the notes!
(a) ∅ ∩ A = ∅.
(b) A ∩ ( B ∩ C ) = ( A ∩ B) ∩ C.
(c) ( AC )C = A.
(d) A ⊆ B ⇐⇒ BC ⊆ AC .
A = ( A \ B) ∪ ( A ∩ B)
by showing that each side is a subset of the other. Now repeat your argument using only results
from set algebra (Theorems 3.9 and 3.10).
3.3.8 Let U be a universal set and A and B be sets. Prove the following:
(a) A ∩ B = A \ ( A \ B)
(b) A ∪ ( A ∩ B) = A
(c) A \ B = BC \ AC
3.3.9 (a) Let A be a set. Prove A is empty if and only if there exists a set B such that A ⊆ B \ A.
(b) Let A, B and C be sets. Prove or disprove: if A ∩ C ⊆ A ∩ B, then C ⊆ A ∪ B.
(a) Let A and B be sets. Show that A ∪ B is the smallest set containing both A and B, in the
sense that if A ⊆ C and B ⊆ C, then A ∪ B ⊆ C.
(b) Show that A ∩ B is the largest set contained in both A and B, in the sense that if C ⊆ A
and C ⊆ B, then C ⊆ A ∩ B.
3.3.11 Let U be a universal set and A and B be sets. Define the symmetric difference of A and B to be the
set
A∆B = ( A ∪ B) \ ( A ∩ B).
(a) Draw a Venn diagram of A and B and shade in the part of the diagram that comprises
A∆B.
(b) Prove A∆B = ( A \ B) ∪ ( B \ A).
(c) Say we wish to write A∆B in set-builder notation as
A∆B = { x ∈ U : ( x ∈ A) ⊕ ( x ∈ B)}.
92
3.3.12 Let A and B be finite sets. Find necessary and sufficient conditions on A and B such that
| A ∩ B| = | A|. In other words, fill in the blank in the following statement
| A ∩ B| = | A| if and only if .
| A ∪ B | = | A | + | B | − | A ∩ B |.
93
3.4 Introduction to Functions
You have been using functions for a long time. A formal definition in terms of relations will be given
in Section 7.2. For the present, we will just use the following.
Definition 3.11. Let A and B be sets. A function from A to B is a rule f that assigns one (and only
one) element of B to each element of A.
The domain of f , written dom( f ), is the set A. The codomain of f is the set B.
You can think of the domain of f as the set of all inputs for the function and the codomain is the set of
all potential output values the function may take (not all of the values in the codomain are necessarily
achieved).
So the codomain of f is the set of all potential outputs, the range or image of f is the subset of the
codomain consisting of all actual outputs of f .
f ( a1 )
a1 f ( A)
f ( a2 )
a2 f ( a3 ) = f ( a4 )
a3 f
a4
A B
94
For simple real-valued functions, the domain and range are
y
easily seen in a graph. For instance if f : [−3, 2) → R is the 9
square function
6
f : x 7→ x2 ,
range
3
then we have dom( f ) = [−3, 2) and range( f ) = [0, 9], as seen
in the picture. We could also calculate other images, for exam-
ple,
−3 −2 −1 0 1 2
domain x
f [−1, 2) = [0, 4).
There is a dual construction to the image, where we start with a subset of the codomain, and look at
the set of inputs which get mapped into this set.
Definition 3.13. Let f : A → B be a function and V a subset of B. Then the preimage of V (also
called the inverse image of V is the following subset of A,
f −1 ( V ) = { a ∈ A : f ( a ) ∈ V } .
a1 f ( a1 )
f ( a2 )
a2
f − 1 (V ) V
a3 f ( a3 ) = f ( a4 )
f
a4
f ( a5 )
a5
A B
For most functions we will not be able to sketch a graph. Here are several examples where a graph is
either unhelpful, or simply impossible to draw!
n 0 1 2 3 4 5 6 7 8 9 10
f (n) 0 1 1 0 1 1 0 1 1 0 1
It looks like the range is simply {0, 1}. In fact, we have already proved this fact in Theorem
2.27. In other words, f (Z) = range( f ) = ℑ( f ) = {0, 1}. Notice that the range is a proper subset
of the codomain: nothing gets mapped to 2!
95
3.4.2 Let A = {0, 1, 2, . . . , 9} and define f : A → A by in the following way:
n 0 1 2 3 4 5 6 7 8 9
f (n) 0 3 6 9 2 5 8 1 4 7
f (U ) = { f (u) : u ∈ U } = { f (u) : u ∈ {0, 1, 2, 3, 4}} = { f (0), f (1), f (2), f (3), f (4)} = {0, 3, 6, 9, 2}.
3.4.3 With the same notation as the previous example, let g : A → A be given by the following table:
n 0 1 2 3 4 5 6 7 8 9
g(n) 0 4 8 2 6 0 4 8 2 6
This is tricky to read, since B is a set of sets. You should be able to convince yourself that
range( f ) = {1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 1}
If V = {{1, 2}, {5, 1}, {2, 2}, {3, 3}}. Then f −1 (V ) = {1, 5}.
∀ a1 , a2 ∈ A, f ( a1 ) = f ( a2 ) =⇒ a1 = a2 .
∀b ∈ B, ∃ a ∈ A such that f ( a) = b.
96
f : A → B is invertible, bijective, or a bijection if it is both injective and surjective.
a This is the contrapositive: if f never takes the same value twice, then ∀ a1 , a2 ∈ A we have a1 ̸= a2 =⇒ f ( a1 ) ̸= f ( a2 ).
b This is the statement B ⊆ range( f ). The opposite inclusion range( f ) ⊆ B is true for any function.
Since the definitions of injective and surjective are both ‘for all’ statements, to show that a function
is not injective or not surjective you will need counterexamples. For instance, consider the quadratic
function f : [−3, 2) → R : x 7→ x2 seen above. It is straightforward to see that f is neither injective
nor surjective. Indeed we have the following counterexamples:
• f (−1) = f (1). If f were injective, the values at 1 and −1 would have to be different.
With a small change to either the domain or codomain, we can easily create an injective or a surjective
function. For instance we can shrink the domain to obtain two injective functions:
y = g( x ) 6 6 y = h( x )
3 3
−3 −2 −1 0 1 2 −3 −2 −1 0 1 2
x x
g( x1 ) = g( x2 ) =⇒ x12 = x22 =⇒ x1 = ± x2 =⇒ x1 = x2
j : [−3, 2) → [0, 9] : x 7→ x2
Now consider the examples on page 95. The details are provided for example 1. For the others,
make sure you understand why the answer is correct.
3.4.2 This is a bijection. Indeed f is a permutation, a bijection from a set onto itself. To see injectivity,
97
note that in the table
n 0 1 2 3 4 5 6 7 8 9
f (n) 0 3 6 9 2 5 8 1 4 7
none of the values in the second row appears more than once. For surjectivity, observe that
every element in the codomain {0, 1, 2, . . . , 9} appears at least once in the second row. Being
bijective means that each element of the codomain appears exactly once.
1
Example. Prove that f : R \ {1} → R \ {2} defined by f ( x ) = 2 + 1− x is bijective.
1 1 5
2+ = 2+ .
1 − x1 1 − x2 4
A little elementary algebra shows that x1 = x2 , whence 3
f is injective.
2
(Surjectivity) Let y ∈ R \ {2} and define x = 1 − y−1 2 .
1
This makes sense since y ̸= 2. Then
x
1 −2 −1 1 2 3 4
f (x) = 2 + 1
=y −1
1 − (1 − y −2 )
whence f is surjective.
The graphic is colored so that you can see how the different parts of the range and domain corre-
spond. The argument for surjectivity is sneaky: how did we know to choose x = 1 − y−1 2 ? The
1
answer is scratch work: just solve y = 2 + 1− x for x. Essentially we’ve shown that f has the inverse
function f −1 ( x ) = 1 − x−1 2 .
f −1 : B → A : f ( a) 7→ a.
This may appear difficult at the moment but we will return to it in Chapter 7.
98
Instead, recall that in Calculus you saw that any injective function has an inverse. How does this
fit with our definition? Consider, for example, f : [0, 2] → R : x 7→ x4 . This is injective but not
surjective. To fix this, simply define a new function with the same formula but with codomain equal
to the range of f . We obtain the bijective function
with inverse
√
g−1 : [0, 16] → [0, 2] : x 7→ 4
x.
√
In Calculus we didn’t nitpick like this and would simply go straight to f −1 ( x ) = 4
x.
In general, if f : A → B is any injective function, then g : A → f ( A) : x 7→ f ( x ) is automatically
bijective, since we are forcing the codomain of g to match its range.
Theorem 3.15. Let A and B be finite sets. The following are equivalent:
3.4.1 | A| ≤ | B|.
3.4.2 ∃ f : A → B injective.
3.4.3 ∃ g : B → A surjective.
Read the theorem carefully. It is simply saying that, of the three statements, if
any one is true then all are true. Similarly, if one is false then so are the others. It 1
might appear that we require six arguments! Instead we illustrate an important
=⇒
=⇒
technique: when showing that multiple statements are equivalent, it is enough
to prove in a circle. For instance, if we prove the three implications indicated in =⇒
the picture, then ⃝1 ⇒⃝ 3 will be true because both ⃝ 1 ⇒⃝ 2 and ⃝2 ⇒⃝ 3 are true.
3 2
More generally, to show that n statements are equivalent, only n arguments are required.
99
The proof may appear very abstract, but it is motivated by two straightforward pictures. Don’t be
afraid to use pictures to illustrate your proofs if it’s going to make them easier to follow! If | A| = m
and | B| = n, then the two functions can be displayed pictorially. Refer back to these pictures as you
read through the proof.
A = { a1 , a2 , a3 , · · · , a m } A = { a1 , a2 , a3 , · · · , a m }
7→
7→
7→
7→
7→
7→
7→
7→
z }| {
B = {b1 , b2 , b3 , · · · , bm , · · · , bn } B = {b1 , b2 , b3 , · · · , bm , bm+1 , · · · , bn }
The function f The function g
Proof. The proof relies crucially on the fact that A, B are finite. Suppose that | A| = m and | B| = n
throughout and list the elements of A and B as,
A = { a1 , a2 , . . . , a m }, B = {b1 , b2 , . . . , bn }.
1 ⇒⃝
⃝ 2 Assume that m ≤ n. Define f : A → B by f ( ak ) = bk . This is injective since the elements
b1 , . . . , bm are distinct.
2 ⇒⃝
⃝ 3 Suppose that f : A → B is injective. Without loss of generality we may assume that the
elements of A and B are labeled such that f ( ak ) = bk . Now define g : B → A by
(
ak if k ≤ m,
g ( bk ) =
a1 if k > m.
It is worth noting in the proof of ⃝ 3 ⇒⃝ 1 that the elements bm+1 , . . . , bn may be mapped anywhere,
not just to a1 as suggested in the picture above.
If you read the proof carefully, it should be clear that when m = n, the function f is actually a bijection
(with inverse f −1 = g).
100
Composition of functions
Finally, we consider composing function and, more particularly, how injectivity and surjectivity in-
teract with composition.
A B C
f g
a f ( a) g( f ( a))
g◦ f
1
Example. If f ( x ) = x2 and g( x ) = x −1 , then
1 1
( g ◦ f )( x ) = , and ( f ◦ g)( x ) = .
x2 −1 ( x − 1)2
You should be extra careful of ranges and domains when composing functions. The domain and
range are not always explicitly mentioned, and at times some restriction of the domain is implied. In
this example, you might assume that dom( f ) = R and dom( g) = R \ {1}. This is perfectly good if
we are considering f and g separately. However, it should be clear from the formulæ that the implied
domains of the compositions are,
Our first two results on composing injective and surjective functions is easy to remember.
101
Proof. 3.4.1 Suppose that f and g are injective and let a1 , a2 ∈ A satisfy ( g ◦ f )( a1 ) = ( g ◦ f )( a2 ). We
are required to show that a1 = a2 . However,
( g ◦ f )( a1 ) = ( g ◦ f )( a2 ) =⇒ g f ( a1 ) = g f ( a2 )
=⇒ f ( a1 ) = f ( a2 ) (since g is injective)
=⇒ a1 = a2 (since f is injective)
Part 2 is in the Exercises. It is interesting to observe that the converse of this theorem is false. As-
suming that a composition is injective or surjective only forces one of the original functions to be
so.
Before showing the proof, consider the following representation of two functions f and g which
simultaneously illustrate both parts of the theorem. It should be clear that g ◦ f is bijective, f is only
injective, and g is only surjective.
A f B g C
a1 b1 c1
a2 b2 c2
b3
Here is a formulaic example of the same thing. Make sure you’re comfortable with the definitions
and draw pictures or graphs to help make sense of what’s going on.
102
This time we leave part 1 of the proof for the Exercises.
Proof. 3.4.2 Let c ∈ C and assume that g ◦ f is surjective. We wish to prove that ∃b ∈ B such that
g(b) = c.
Since g ◦ f is surjective, ∃ a ∈ A such that ( g ◦ f )( a) = c. But this says that
g( f ( a)) = c.
Reading Quiz
3.4.1 The range of a function f : A → B is (select all that apply)
(a) f is injective.
(b) g is injective.
(c) f is surjective.
(d) g is surjective.
3.4.3 True or False: We can always make a function surjective by making its domain smaller.
Practice Problems
3.4.1 (a) Explain why the map g : {all lines in the planes} → R which sends a line ℓ to the slope of
ℓ is not a function.
Video Solution
(b) Let L be the set of all non-vertical lines in the plane. The map f : L → R defined by
ℓ 7→ slope of ℓ is a well defined function. Find f ( Z ) where Z is the subset of L consisting
of the lines that intersect the line y = 2x + 5 at exactly one point.
Video Solution
(c) Now let U = {−2}. Describe the inverse image f −1 (U ) of U under the function f defined
in part (b).
Video Solution
103
(d) Is the function f bijective?
Video Solution
(e) Find a subset B of L so that the function f : B → R is a bijection.
Video Solution
3.4.2 Suppose f : A → B and g : B → C are functions. For each of the following, either find an
example or explain why no such example exists.
(a) f surjective and g not surjective so that the composition g ◦ f is surjective.
(b) f not surjective and g surjective so that the composition g ◦ f is surjective.
(c) f surjective and g surjective so that the composition g ◦ f is not surjective.
(d) f injective and g not injective so that the composition g ◦ f is injective.
(e) f not injective and g injective so that the composition g ◦ f is injective.
(f) f injective and g injective so that the composition g ◦ f is not injective.
Video Solution (Parts (a)-(c))
3.4.3 Suppose f : A → B is a function. Prove or disprove each of the following statements:
(a) Let X and Y be subsets of A. If X ∩ Y = ∅ then f ( X ) ∩ f (Y ) = ∅.
(b) Let W and Z be subsets of B. If W ∩ Z = ∅ then f −1 (W ) ∩ f −1 ( Z ) = ∅.
Video Solution
Exercises
3.4.1 For each of the following functions f : A → B determine whether f is injective, surjective or
bijective. Prove your assertions.
(a) f : [0, 3] → R where f ( x ) = 2x.
√
(b) f : [3, 12) → [0, 3) where f ( x ) = x − 3.
√
(c) f : (−4, 1] → (−5, −3] where f ( x ) = − x2 + 9.
3.4.2 Suppose that f : [−3, ∞) → [−8, ∞) and g : R → R are defined by
f ( x ) = x2 + 6x + 1, g( x ) = 2x + 3.
Compute g ◦ f and show that g ◦ f is injective.
3.4.3 Find:
(a) A set A so that the function f : A → R : x 7→ cos x is injective.
(b) A set B so that the function f : R → B : x 7→ cos x is surjective.
3.4.4 (If you did Exercise 2.2.7 you should find this easy) Let X be a subset of R. A function f : X → R is
strictly increasing if
∀ a, b ∈ X, a < b =⇒ f ( a) < f (b).
For example, the function f : [0, ∞) → R, x 7→ x2 is increasing because
∀ a, b ∈ [0, ∞), a < b =⇒ f ( a) = a2 < b2 = f (b).
104
(a) Give another example of a function that is increasing. Draw its graph, and prove that the
function is increasing.
(b) By negating the above definition, state what it means for a function not to be strictly increas-
ing.
(c) Give an example of a function that is not strictly increasing. Draw its graph, and prove
that the function is not strictly increasing.
(d) Let f , g : R → R be strictly increasing. Prove or disprove: The function h = f + g is
strictly increasing. Note that the formula for h is h( x ) = f ( x ) + g( x ).
3.4.5 Let L be the set of all non-vertical lines in the plane. Let f : L → R be the function which sends
each line to its y-intercept. Is f injective? Is f surjective? Justify your answers.
√
3.4.6 You may assume that g : [2, ∞) → R : x 7→ x3 − 8 is an injective function. Find a function
f : R → R which is not injective, but for which the composition f ◦ g : [2, ∞) → R is injective.
Justify your answer.
∀ x ∈ R, f (− x ) = f ( x ).
∀ x ∈ R, f (− x ) = (− x )2 = x2 = f ( x ).
Note that f is even if and only if the graph of f is symmetric with respect to the y axis.
(a) Give an example of a function that is even. Draw its graph, and prove that the function is
even.
(b) Define what it means for a function not to be even, by negating the definition above.
(c) Give an example of a function that is not even. Draw its graph, and prove that the function
is not even.
(d) Prove or disprove: for every f , g : R → R even, the composition h = f ◦ g is even. Here h
is the function mapping x to f ( g( x )).
3.4.10 Let f : R → R+ be the function defined by f ( x ) = e x . Explain why the following “proof” that
f is surjective is incorrect. Then, give a correct proof.
105
Proof. Let e x ∈ R+ be arbitrary. Then f ( x ) = e x . So f is surjective.
3.4.13 In the proof of Theorem 3.15 we twice invoked without loss of generality. In both cases explain
why the phrase applies.
(a) X1 ⊆ X2 implies f ( X1 ) ⊆ f ( X2 ).
(b) f ( X1 ∪ X2 ) = f ( X1 ) ∪ f ( X2 ).
(c) f ( X1 ∩ X2 ) ⊆ f ( X1 ) ∩ f ( X2 ).
(d) f ( X1 ) ∩ f ( X2 ) ⊆ f ( X1 ∩ X2 ).
3.4.16 (a) Let A = { a, b, c} and B = {1, 2, 3, 4} and f : A → B be the function given by f ( a) = f (c) =
1 and f (b) = 3. Compute f −1 ({1}), f −1 ({3}), f −1 ({1, 3}), and f −1 ({2, 4}).
(b) Let g : [−1, ∞) → R be g( x ) = x2 + 2x + 1. Compute g−1 ((0, 2)).
(c) Let h : R → R be h( x ) = sin x. Find h−1 ({−1, 1}).
3.4.18 Let f : A → B be a function and let X ⊆ A. Fill in the details in the following to give a proof of
the following two facts:
(a) X ⊆ f −1 ( f ( X )).
(b) If f is injective, X = f −1 ( f ( X )).
3.4.19 Let f : A → B be a function and let Y ⊆ B. Prove the following two facts:
(a) f ( f −1 (Y )) ⊆ Y.
(b) If f is surjective, f ( f −1 (Y )) = Y.
3.4.20 Let A, B, C, and D be sets and f : A → B, g : B → C, and h : C → D be functions. Show that for
all a ∈ A, we have
3.4.21 (Uses calculus) This exercise will give an example of how to use calculus to prove some prop-
erties of (certain) functions. Let f : (−π/2, π/2) → R be defined by f ( x ) = tan x. Recall that f
is differentiable, and hence continuous, on its domain.
106
(a) Compute limx→ π − f ( x ) and limx→ −π + f ( x ).
2 2
(b) Recall the Intermediate Value Theorem: if g : [ a, b] → R is a continuous function, then for
any y between g( a) and g(b), there is x ∈ [ a, b] such that g( x ) = y. Use the Intermediate
Value Theorem and the results of part 1 to prove f is surjective.
(c) Why is a strictly increasing function (see Exercise 4.4.4) injective?
d
(d) Compute dx f ( x ) and use this to show f is strictly increasing, and therefore injective by
part 3.
3.4.23 Let S be the set of all circles in the plane which are centered at the origin. Find a bijection
between S and R+ .
3.4.24 Let A and B be finite sets. If A ⊊ B, is it possible for there to be a bijection between A and B?
107
4 Divisibility and the Euclidean Algorithm
In this section we introduce the notion of congruence: a generalization of the idea of separating all
integers into ‘even’ and ‘odd.’ At its most basic it involves going back to elementary school when
you first learned division and would write something similar to
The study of congruence is of fundamental importance to Number Theory, and provides some of
the most straightforward examples of Groups and Rings. We will cover the basics in this section—
enough to compute with—then return later for more formal observations.
Definition 4.1. Let m and n be integers, with n ̸= 0. We say that n divides m and write n | m if m is
divisible by n: that is if there exists some integer k such that m = kn. Equivalently, we say that n is a
divisor of m, or that m is a multiple of n.
Examples. Since 20 = 4 · 5 we may write 4 | 20. Similarly 17 | 51. We may also use the symbol ∤ for
‘does not divide.’ Thus 12 ∤ 8 and 7 ∤ 9.
When an integer does not divide another, there is a remainder left over.
Theorem 4.2 (The Division Algorithm). Let m be an integer and n a positive integer. Then there exist
unique integers q (the quotient) and r (the remainder) which satisfy the following conditions:
4.1.1 0 ≤ r < n.
4.1.2 m = qn + r.
The theorem should be read as saying that n goes q times into m with r left over.
Examples. 4.1.1 7 goes into 23 three times with 2 left over: an elementary school student would
write ‘23 ÷ 7 = 3 remainder 2.’ In the language of the Division Algorithm, we have m = 23
and n = 7. We look for the smallest integer r ≥ 0 so that 23 − r is divisible by 7: since 7 | 21 we
choose r = 2. The quotient is q = 3 and we write
23 = 3 · 7 + 2
−11 = (−4) · 3 + 1
108
For practice, find a formula for all the integers that have remainder 4 after division by 6.
The proof of the Division Algorithm relies on the development of induction, to which we will return
in Chapter 5. For our purposes, the point of the division algorithm is that every integer m has a
nicely-defined remainder r when divided by n. This allows us to construct an alternative form of
arithmetic.
Definition 4.3. Let a and b be integers, and n a positive integer. We say that a is congruent to b
modulo n and write
a≡b (mod n)
if a and b have the same remainder upon dividing by n. The integer n is called the modulus. When the
modulus is unambiguous we tend simply to write a ≡ b.
Examples. We write 7 ≡ 10 (mod 3), since both 7 and 10 have the same remainder (r = 1) on
division by 3.
Since 6 and 10 do not have the same remainder on division by 3, we would write 6 ̸≡ 10 (mod 3).
Can you find a formula for all the integers that are congruent to 10 modulo 3?
For a little practice with the notation, consider the following conjectures, where a is any integer. Are
they true or false?
The first conjecture is true. Indeed, if a ≡ 8 (mod 6), we can write a = 6k + 8 for some integer k.
Then
a = 6k + 8 = 6k + 6 + 2 = 3(2k + 2) + 2
Reasoning and calculating in the above fashion is tedious. What is useful is to tie the concept of con-
gruence to that of divisibility. The following theorem is crucial, and provides an equivalent definition
of congruence.
109
Theorem 4.6. Let a and b be integers and n a positive integer. Then a ≡ b (mod n) ⇐⇒ n | (b − a).
Proof. There are two separate theorems here, although both rely on the Division Algorithm (Theorem
4.2) to divide both a and b by n. Given a, b, n, the Division Algorithm shows that there exist unique
quotients q1 , q2 and remainders r1 , r2 which satisfy
a = q1 n + r1 , b = q2 n + r2 , 0 ≤ r1 , r2 < n. (∗)
r2 − r1 = ( b − q2 n ) − ( a − q1 n ) = ( b − a ) − ( q2 − q1 ) n
= ( k − q2 + q1 ) n
is also a multiple of n. Now consider the condition on the remainders in (∗): since 0 ≤ r1 , r2 < n, we
quickly see that
(
0 ≤ r2 < n
=⇒ −n < r2 − r1 < n.
− n < −r1 ≤ 0
This says that r2 − r1 is a multiple of n lying strictly between ±n. The only possibility is that r2 − r1 =
0. Otherwise said, r2 = r1 , whence a and b have the same remainder, and so a ≡ b (mod n).
If you are having trouble with the final step, think about an example. Suppose that n = 26 and that
and that x = r2 − r1 is an integer satisfying the two conditions:
(
x is divisible by 26
−26 < x < 26
The strict inequalities should make it obvious that x = 0.
To gain some familiarity with congruence, try using Theorem 4.6 to show that
a≡b (mod n) ⇐⇒ b ≡ a (mod n).
Note that this expression and the theorem both contain a hidden quantifier (∀ a, b ∈ Z), as discussed
in Section 2.2. Moreover, combining the theorem with Definition 4.1 leads to the observation that
a ≡ b (mod n) ⇐⇒ ∃k ∈ Z such that b − a = kn
⇐⇒ b = a + kn for some integer k
110
Congruence and Divisibility
The previous two theorems may appear a little abstract, so it’s a good idea to recap the relationship
between congruence and divisibility. The following observations should be immediate to you.
To test your level of comfort with the definition of congruence, and review some proof techniques,
prove the following theorem.
If you don’t know how to start, try completing the following table before writing a formal proof:
n n2 Is n2 ≡ n (mod 3)?
0 0 Yes
1
2
That the congruence sign ≡ appears similar to the equals sign = is no accident. In many ways it
behaves exactly the same. In Section 7.3 we shall see that congruence is an important example of an
equivalence relation: these generalize the notion of equality. Indeed, two integers are congruent if and
only if something about them is equal, namely their remainders.
Modular Arithmetic
The arithmetic of remainders is almost exactly the same as the more familiar arithmetic of real num-
bers, but comes with all manner of fun additional applications, most importantly cryptography and
data security: cell-phones and computers perform millions of these calculations every day! Here we
spell out the basic rules of congruence arithmetic.11
Theorem 4.8. Suppose that a, b, c, d are integers, and that all congruences are modulo the same integer n.
4.1.1 a ≡ b and c ≡ d =⇒ ac ≡ bd
4.1.2 a ≡ b and c ≡ d =⇒ a ± c ≡ b ± d
all follow because x = y =⇒ x ≡ y (mod n), regardless of n: equal numbers have the same remainder after all!
111
What the theorem says is that the operations of ‘take the remainder’ and ‘add’ (or ‘multiply’) can be
performed in any order or combination, the result will be the same.
Example. Consider a = 29, b = 14 and n = 6. We could add a and b then take the remainder when
dividing by n:
29 + 14 = 43 = 6 · 7 + 1 =⇒ 29 + 14 ≡ 1 (mod 6).
Alternatively we could take the remainders of a and b modulo n and then add these:
29 + 14 ≡ 1 (mod 6).
Proof of Theorem 4.8. Suppose that a ≡ b and c ≡ d. By Theorem 4.6 we have a − b = kn and c − d = ln
for some integers k, l. It follows that
The ability to take remainders before adding and multiplying is remarkably powerful, and allows us
to perform some surprising calculations.
Examples. 4.1.1 What is the remainder when 3923 is divided by 10? At the outset this question
appears impossible to answer. Ask your calculator and it will tell you that 3923 ≈ 3.93 × 1036 ,
which is of no assistance; we need to discover the units digit of 3923 , whereas your calculator
reports only a few of the significant digits at the other end of the number.
Instead of relying on a calculator, we think about the rules of arithmetic modulo 10. Since
39 ≡ 9 ≡ −1 (mod 10), we quickly notice that
whence 392 ≡ 1 (mod 10). Since positive integer exponents signify repeated multiplication,
we can repeat the exercise to obtain
Therefore 3923 has remainder 9 when divided by 10. Otherwise said, the last digit of 3923 is a 9.
If you ask a computer for all the digits you can check this yourself.
112
4.1.2 Now that we understand powers, more complex examples become easy. Here we compute
modulo n = 6.
4.1.3 Find the remainder when 12412 · 6549 is divided by 11. This time we need to perform multiple
calculations to reduce these large numbers to something manageable. Since 124 = 112 + 3 and
65 = 11 · 6 − 1, we write
The remainder is therefore 2. There is no way to do this on a pocket calculator, since the original
number 12412 · 6549 ≈ 9 × 10113 is far too large to work with!
Division and Congruence The primary difference between modular and normal arithmetic is, per-
haps unsurprisingly, with regard to division.
Theorem 4.9. Suppose a and b are integers and k and n are positive integers. If ka ≡ kb (mod kn) then
a ≡ b (mod n).
The modulus is divided by k as well as the terms, so the meaning of ≡ changes. In Exercise 4.1.14
you will prove this theorem, and observe that, in general, we do not expect a ≡ b (mod kn).
Reading Questions
4.1.1 Which of the following connectives makes the following true for any a, b ∈ Z and n ∈ N?
a≡b (mod n) a = b.
(a) =⇒
(b) ⇐=
(c) ⇐⇒
(d) ∧
4.1.2 Let m ∈ Z and n ∈ N. Is it possible that there are multiple pairs of integers q and r such that
m = qn + r and 0 ≤ r < n?
113
(a) It is never possible.
(b) It is sometimes possible, depending on what m and n are.
(c) It is always possible.
4.1.3 Which of the following are true statements for a, b ∈ Z and n ∈ N? Select all that apply.
Practice Problems
4.1.1 Use the Division Algorithm to show that any prime number p ≥ 5 must have remainder 1 or 5
upon division by 6. Use this to show that p2 + 2 is composite for all such primes p.
Video Solution
Exercises
4.1.1 Check explicitly that 323 ̸≡ 32 (mod 7).
4.1.4 Find all integers x which satisfy the congruence equation 5x ≡ 2 mod 8.
4.1.5 Find the remainder when 17251 · 2312 − 1941 is divided by 5. Hint: 17 ≡ 2 and 22 ≡ −1 (mod 5).
4.1.6 Find the remainder when 1210 + 236 · 1812 is divided by 141. Hint: what nice number is close to
141? Use a calculator to help with some of the sums.
4.1.8 Prove the first part of Theorem 4.8: that if a ≡ b (mod n) and c ≡ d (mod n), then a + c ≡ b + d
(mod n).
4.1.9 Let a, b, c ∈ Z and n ∈ N. Prove
(a) a ≡ a (mod n)
114
(b) if a ≡ b (mod n) then b ≡ a (mod n)
(c) if a ≡ b (mod n) and b ≡ c (mod n) then a ≡ c (mod n).
4.1.11 Find a natural number n and integers a, b such that a2 ≡ b2 (mod n) but a ̸≡ b (mod n).
4.1.12 (a) Let n be a positive integer. Prove that n is congruent to the sum of its digits modulo 9.
Hint: first consider an example such as 345 = 3 · 102 + 4 · 10 + 5 . . .
(b) Is the integer 123456789 divisible by 9?
4.1.13 Let p be a prime number greater than or equal to 3. Show that if p ≡ 1 (mod 3), then p ≡ 1
(mod 6). Hint: p is odd.
4.1.14 Suppose that 7x ≡ 28 (mod 42). By Theorem 4.9, it follows that x ≡ 4 (mod 6).
4.1.16 Suppose a, b, c ∈ Z and a | b and a | c. Prove that for any x, y ∈ Z, we have a | (bx + cy).
4.1.18 Decide whether each conjecture is true or false and prove/disprove your assertions.
4.1.19 Fermat’s Little Theorem (to distinguish it from his ‘Last’) states that if p is prime and a ̸≡ 0
mod p, then a p−1 ≡ 1 (mod p).
(a) Use Fermat’s Little Theorem to prove that b p ≡ b (mod p) for any integer b.
(b) Prove that if p is prime then p | (2 p − 2).
(c) Find a counterexample to the converse: some non-prime n such that n | 2n − 2.
4.1.20 Abraham Lincoln was born on February 12th 1809. On what day of the week was this?
More generally, describe how to find the weekday given any date (in the Gregorian calendar).
n(n + 1)(2n + 1)
6
is an integer.
115
4.1.22 Consider numbers of the form
11 · · 11}
| ·{z
n times
for n ≥ 2.
(a) Prove every such number can be written as 4k + 3 for some k ∈ Z. [For example, 11 =
4(2) + 3 and 111 = 4(27) + 3.]
(b) Use part (a) to show that no such number is a square.
4.1.25 Let n ∈ Z.
4.1.26 Let m ∈ Z and n ∈ N. The Division Algorithm states that there exist unique integers q and
r such that m = qn + r and 0 ≤ r < n. While we will wait until the next chapter to see a full
proof, we can give a proof of the uniqueness part now. Fill in the blanks in the following proof
of the uniqueness part of the theorem.
Proof. Replace absolute values with more intuitive approach. The standard proof technique for
uniqueness proofs is to assume there are two objects satisfying the conditions of the statement
under question and proceeding to show that these objects are the same. Towards this goal, sup-
pose that there exist two pairs of integers q, r and q′ , r ′ satisfying the conclusion of the Division
Algorithm:
m = qn + r, m = q′ n + r ′
r − r′ = .
= .
116
n, we have |q′ − q| < 1. But since |q′ − q| is a positive integer, this means that |q′ − q| = .
Thus q = q′ . It then follows that as well.
√
4.1.27 Let n ∈ N. Prove that 4n + 6 is not an integer. Hint. You may use the following lemma
without proof: ∀k ∈ Z, k2 ≡ 0 or 1 (mod 4).
117
4.2 Greatest Common Divisors and the Euclidean Algorithm
At its most basic, Number Theory involves finding integer solutions to equations. Here are two
simple-sounding questions:
4.2.1 The equation 9x − 21y = 6 represents a straight line in the plane. Are there any integer points
on this line? That is, can you find integers x, y satisfying 9x − 21y = 6?
Before you do anything else, try sketching both lines (lined graph paper will help) and try to decide
if there are any integer points. If there are integer points, how many are there? Can you find them all?
In this section we will see how to answer these questions in general: for which lines ax + by = c
with a, b, c ∈ Z, are there integer solutions, and how can we find them all? The method introduces the
appropriately named Euclidean algorithm, a famous procedure dating at least as far back as Euclid’s
Elements (c. 300 BCE.).
Definition 4.10. Let m and n be integers, not both zero. Their greatest common divisor gcd(m, n) is
the largest (positive) divisor of both m and n. We say that m and n are relatively prime (or coprime)
if gcd(m, n) = 1.
Example. Let m = 60 and n = 90. The positive divisors of the two integers are listed in the table:
m 1 2 3 4 5 6 10 12 15 20 30 60
n 1 2 3 5 6 9 10 15 18 30 45 90
The greatest common divisor is the largest number common to both rows: clearly gcd(60, 90) = 30.
Finding the greatest common divisor of two integers by listing all the positive divisors of both
numbers is extremely inefficient, especially when the integers are large. This is where Euclid rides to
the rescue.
(i) Use the Division Algorithm (Theorem 4.2) to write m = q1 n + r1 with 0 ≤ r1 < n.
118
Theorem 4.11. The Algorithm eventually produces a remainder of zero: there exists p such that r p+1 = 0.
The greatest common divisor of m and n is then the last non-zero remainder: gcd(m, n) = r p .
The proof is in the exercises. If m and n are not both positive, take absolute values first and apply the
algorithm. For instance gcd(−6, 45) = 3.
Example. We compute gcd(1260, 750) using the Euclidean Algorithm. Since each line of the algo-
rithm is a single case of the Division Algorithm m = qn + r, you might find it easier to create a table
and observe each remainder moving diagonally left and down at each successive step.
m q n r
1260 = 1 × 750 + 510 1260 1 750 510
750 = 1 × 510 + 240 750 1 510 240
510 = 2 × 240 + 30 510 2 240 30
240 = 8 × 30 + 0 240 8 30 0
Theorem 4.11 says that gcd(1260, 750) = 30, the last non-zero remainder.
30 = 510 − 2 × 240.
Now use the second line of the algorithm to solve for 240 and substitute:
Rearranging this, we see that the integers x = 3 and y = −5 satisfy the equation 1260x + 750y = 30.
Otherwise said, the integer point (3, −5) lies on the line with equation 1260x + 750y = 30.
Note how the process for finding an integer point ( x, y) is twofold: first we compute gcd(m, n) using
the Euclidean Algorithm, then we perform a series of back-substitutions to recover x and y.
119
This process of reversing the algorithm works in general, and we have the following corollary of
Theorem 4.11.
Corollary 4.12 (Bézout’s Identity). Given integers m, n, not both zero, there exist integers x, y such that
gcd(m, n) = mx + ny.
We are now in a position to solve our motivating problem: finding all integer points on the line
ax + by = c where a, b, c are integers. Again we appeal first to our example.
Example (take III). We have already found a single integer solution ( x, y) = (3, −5) to the equa-
tion 1260x + 750y = 30. Notice that the equation is equivalent to dividing through by the greatest
common divisor 30 = gcd(1260, 750):
42x + 25y = 1
Since 42 and 25 have no common factors, it seems that the only way to alter x and y while keeping
the equation in balance is to increase x by a multiple of 25 and decrease y by the same multiple of 42.
For example ( x, y) = (3 + 25, −5 − 42) = (28, −47) is another solution. Indeed, all integer solutions
are given by
Theorem 4.13. Let a, b, c be integers where a, b are non-zero, and let d = gcd( a, b). Then the equation
ax + by = c has an integer solution ( x, y) if and only if d | c.
In such a case, suppose that ( x0 , y0 ) is some fixed solution. Then all integer solutions are given by
b a
x = x0 + t, y = y0 − t, (∗)
d d
where t is any integer.
The general approach is to use the Euclidean Algorithm to find the initial solution ( x0 , y0 ), then to
apply (∗) to obtain all solutions.12 The proof is again in the exercises.
Warning! If c ̸= gcd( a, b), you will need to modify the integers obtained in Bézout’s Identity in order
to find the initial solution ( x0 , y0 ). For example, since 1260 × 3 + 750 × (−5) = 30 we multiply by 3
to see that ( x0 , y0 ) = (9, −15) is an initial solution to 1260x + 750y = 90. All integer points on this
line therefore have the form
12 The
astute observer should recognize the similarity between this and the complementary function/particular integral
method for linear differential equations: ( x0 , y0 ) is a ‘particular solution’ to the full equation ax + by = c, while ( db t, − da t)
comprises all solutions to the ‘homogeneous equation’ ax + by = 0.
120
Examples. 4.2.1 Consider the line 570x − 123y = 7. We calculate the greatest common divisor using
the Euclidean algorithm: note that the negative sign is irrelevant.
570 = 4 × 123 + 78
123 = 1 × 78 + 45
78 = 1 × 45 + 33
45 = 1 × 33 + 12 =⇒ gcd(570, 123) = 3.
33 = 2 × 12 + 9
12 = 1 × 9 + 3
9 = 3×3+0
Since 3 ∤ 7, we conclude that the line 570x − 123y = 7 contains no integer points.
4.2.2 Applied to the line with equation 570x − 123y = −6, we reverse the algorithm to obtain
3 = 12 − 9 = 12 − (33 − 2 × 12)
= 3 × 12 − 33 = 3(45 − 33) − 33
= 3 × 45 − 4 × 33 = 3 × 45 − 4(78 − 45)
= 7 × 45 − 4 × 78 = 7(123 − 78) − 4 × 78
= 7 × 123 − 11 × 78 = 7 × 123 − 11(570 − 4 × 123)
= 570 × (−11) − 123 × (−51)
Multiplying by −2 so that our solution conforms to the desired equation, it follows that ( x0 , y0 ) =
(22, 102) is an initial solution. The general solution is then
123 570
( x, y) = (22, 102) + − ,− t = (22 − 41t, 102 − 190t)
3 3
Reading Quiz
4.2.1 True or False: gcd(−21, −12) = −3.
(a) 0
(b) 1
(c) a
(d) | a|
4.2.3 The sequence of remainders produced by the Euclidean Algorithm when computing gcd(m, n)
(select all that apply)
(a) is decreasing
(b) is increasing
121
(c) has all non-negative terms
(d) is infinite
4.2.4 True or False: If a and b are relatively prime then the equation ax + by = 1 has an integer
solution ( x, y).
Practice Problems
4.2.1 Use the Euclidean Algorithm to compute gcd(260, 816). Then find integers x, y such that 260x +
816y = gcd(260, 816).
Video Solution
4.2.3 Find all integer points on the line 225x + 120y = 15.
Video Solution
4.2.4 Suppose a, b, c ∈ Z are such that a and b are relatively prime, a | c, and b | c. Show ab | c.
[Sketch proof and redo].
Video Solution
Exercises
4.2.1 Use the Euclidean Algorithm to compute the greatest common divisors indicated.
4.2.2 For each part of Question 4.2.1, find integers x, y which satisfy Bézout’s Identity gcd(m, n) =
mx + ny.
4.2.3 (a) Answer our motivating problems from the beginning of the section using the above pro-
cess.
(i) Find all integer points on the line 9x − 21y = 6.
(ii) Show that there are no integer points on the line 4x + 6y = 1.
(b) Can you give an elementary proof as to why there are no integer points on the line 4x +
6y = 1?
4.2.4 Find all the integer points on the following lines, or show that none exist.
4.2.5 Show that there exists no integer x such that 3x ≡ 5 (mod 6).
122
4.2.6 Find all solutions x to the congruence equation 12x ≡ 1 (mod 17)
4.2.7 Five people each take the same number of candies from a jar. Then a group of seven people
does the same: in so doing they empty the jar. If the jar originally contained 239 candies. Can
you be sure how much candies each person took?
4.2.8 Here we sketch a proof that the Euclidean Algorithm (Theorem 4.11) terminates with r p =
gcd(m, n). Note that you cannot use Bézout’s Identity in to prove any of what follows, since it
is a corollary of the algorithm.
of positive integers. Explain why the sequence can only have finitely many terms. This
shows that the Euclidean Algorithm eventually terminates with some r p+1 = 0.
(b) Suppose that m = qn + r for some integers m, n, q, r. Prove that gcd(m, n) | r.
(c) Explain why gcd(m, n) | r p .
(d) Explain why r p divides all of the integers in the sequence (∗), in particular that r p | m and
r p | n.
(e) Explain why r p ≤ gcd(m, n). Why does this force us to conclude that r p = gcd(m, n)?
One direction can be done by applying Bézout’s Identity, but the other direction requires an argument.
4.2.11 Let a, b, c ∈ Z.
4.2.12 Show that if a is relatively prime to b, and a is relatively prime to c, then a is relatively prime to
bc.
4.2.13 In this question we prove the Theorem 4.13 on integer solutions to linear equations. Let a, b, c ∈
Z. Suppose that ( x0 , y0 ) and ( x1 , y1 ) are two integer solutions to the linear Diophantine equa-
tion ax + by = c.
123
(d) Use (a) and (b) to conclude that ( x, y) is an integer solution to ax + by = c if and only if
b a
x = x0 + t y = y0 − t, where t ∈ Z.
d d
4.2.14 Show that gcd(5n + 2, 12n + 5) = 1 for every integer n. There are two ways to approach this: you
can try to use the Euclidean algorithm abstractly, or you can use the result of Exercise 4.2.10.
4.2.15 Use the Euclidean Algorithm to show that for any k ∈ N, we have gcd(ka, kb) = k gcd( a, b).
n 1 2 3 4 5 6
gcd(2n, n + 1)
Now make a conjecture for the value of gcd(2n, n + 1) and prove it.
4.2.17 For nonzero integers a and b, the least common multiple lcm( a, b) is defined to be the least
positive integer m which is a multiple of both a and b.
4.2.18 The set of remainders Zn = {0, 1, 2, . . . , n − 1} is called a ring when equipped with addition
and multiplication modulo n. For example 5 + 6 ≡ 3 (mod 8). We say that b ∈ Zn is an inverse
of a ∈ Zn if
ab ≡ 1 (mod n).
124
5 Mathematical Induction and Well-ordering
In Section 2.3 we discussed three methods of proof: direct, contrapositive, and contradiction. The
fourth standard method of proof, induction, has a very different flavor. In practice it formalizes the
idea of spotting a pattern. Before we give the formal definition of induction, we consider where
induction fits into the investigative process.
x n +1 = f ( x n ),
where some initial value x1 is given. While investigating such recurrences, you might hypothesize a
general formula
x n = g ( n ).
Induction is a method of proof that allows us to prove the correctness of such general formulæ. Here
is a simple example of the process.
Stacking Paper
Consider the operation whereby you take a stack of paper, cut all sheets in half, then stack both halves
together.
If a single sheet of paper has thickness 0.1 mm, how many times would you have to repeat the pro-
cess until the stack of paper reached to the sun? (≈ 150 million kilometers).
The example is describing a recurrence relation. If hn is the height of the stack after n operations,
then we have a sequence (hn )∞
n=0 satisfying
(
hn+1 = 2hn
h0 = 0.1 mm.
n 0 1 2 3 4 5 6 7 8 ···
hn (mm) 0.1 0.2 0.4 0.8 1.6 3.2 6.4 12.8 25.6 · · ·
It is not hard to hypothesize that, after n such operations, the stack of paper will have height
hn = 2n × 0.1 mm.
125
All we have done is to spot a pattern. We can reassure ourselves by checking that the first few terms
of the sequence satisfy the formula: certainly h0 = 20 × 0.1 mm and h1 = 21 × 0.1 mm, etc. Unfor-
tunately the sequence has infinitely many terms, so we need a trick which confirms all of them at once.
Unless we can prove that our formula is correct for all n ∈ N0 it will remain just a guess. This is where
induction steps in.
The trick is called the induction step. We assume that we have already confirmed the formula
for some fixed, but unspecified, value of n and then use what we know (the recurrence relation
hn+1 = 2hn ) to confirm the formula for the next value n + 1. Here it goes:
Induction Step Suppose that hn = 2n × 0.1 mm, for some fixed n ∈ N0 . Then
This is exactly the expression we hoped to find for the (n + 1)th term of the sequence. Think about
what the induction step is doing. By leaving n unspecified, we have proved an infinite collection of
implications at once! Each implication has the form
Since the implications have been proved for all n ∈ N0 , we can string them together:
We have already checked that the first formula h0 = 20 × 0.1 in the implication chain is true. By the
induction step, the entire infinite collection of formulæ must be true. We have therefore proved that
hn = 2n × 0.1 mm = 2n × 10−4 m, ∀n ≥ 0.
Now that we’ve proved the formula for every hn , finishing the original problem is easy: we need to
find n ∈ N0 such that
Since logorithms are increasing functions, they preserve inequalities and we may easily solve to see
that
Thus 51 iterations of the cut-and-stack process are sufficient for the pile of paper to reach the sun!
We will formalize the discussion of induction in the next section so that you will never have to
write as much as we’ve just done. However, it is important to remember how induction fits into
a practical investigation. It is the missing piece of logic that turns a guess into a justified formula.
Before we do so, here is a famous and slightly more complicated problem.
126
The Tower of Hanoi
The Tower of Hanoi is a game involving circular disks of decreasing radii stacked on three pegs. A
‘move’ consists of transferring the top disk in any stack onto a larger disk or an empty peg. If we
start with n disks on the first peg, how many moves are required to transfer all the disks to one of the
other pegs?
The challenge here is that we have no formula to play with, only the variable n for the number
of disks. The first thing to do is to play the game. If the variable rn represents the number of moves
required when there are n disks, then it should be immediately clear that r1 = 1: one disk only
requires one move! The picture below shows that r2 = 3.
With more disks you can keep experimenting and find that r3 = 7, etc. At this point you may be
ready to hypothesize a general formula.
Certainly the conjecture is true for n = 1, 2 and 3. To see that it is true in general, we need to think
about how to move a stack of n + 1 disks. Since the largest disk can only be moved onto an empty
peg, it follows that the n smaller disks must already be stacked on a single peg before the (n + 1)th
disk can move. From the starting position this requires rn moves.
n disks rn moves
1 move
rn moves
The largest disk can now be moved to the final peg, before the original n disks are moved on top of it.
In total this requires rn + 1 + rn moves, as illustrated in the picture. We therefore have a recurrence
relation for rn :
(
rn+1 = 2rn + 1
r1 = 1.
We are now in a position to prove our conjecture. We know that the conjecture is true for n = 1
and we assume that the formula rn = 2n − 1 is true for some fixed but unspecified n. Now we use
127
the recurrence relation to prove that rn+1 = 2n+1 − 1.
r1 = 21 − 1 =⇒ r2 = 22 − 1 =⇒ r3 = 23 − 1 =⇒ r4 = 24 − 1 =⇒ · · ·
Since the first of these statements is true, it follows that all of the others are true. Hence Conjecture 5.1
is true, and becomes a theorem.
As an illustration of how ridiculously time-consuming the Tower becomes, the following table
gives the time taken to complete the Tower if you were able to move one disk per second.
Disks Time
5 31sec
10 17min 3sec
15 9hr 6min 7sec
20 12days 3hrs 16min 15sec
25 ∼ 1yr 23days
30 ∼ 34yrs 9days
Animation of five disks (click)
Exercises
5.1.1 A room contains n people. Everybody wants to shake everyone else’s hand (but not their own).
(a) Suppose that n people require hn handshakes. If an (n + 1)th person enters the room, how
many additional handshakes are required? Obtain a recurrence relation for hn+1 in terms
of hn .
(b) Hypothesize a general formula for hn , and prove it using the method in this section.
5.1.2 Skippy the Kangaroo is playing jump rope, but he tires as the day goes on. The heights hn
(inches) of successive jumps are related by the recurrence
8
h n +1 = hn + 1.
9
(a) Suppose that Skippy’s initial jump has height h1 = 100 in. Show that Skippy fails to jump
above 10in for the first time on the 40th jump.
(b) Find the total height jumped by Skippy in the first n jumps.
You may find it useful to define Hn = hn − 9 and think about the recurrence for Hn . Now guess and
prove a general formula for Hn . Finally, remind yourself about geometric series.)
128
5.2 Proof by Induction
The previous section motivated the need for induction and helped us see where induction fits into a
logical investigation. In this section we formally lay out several induction proofs.
Induction is the mathematical equivalent of a domino rally; toppling the nth domino causes the
(n + 1)th domino to fall, hence to knock all the dominos over it is enough merely to topple the first.
Instead of dominoes, in mathematics we consider a sequence of propositions: P(1), P(2), P(3), etc.
Induction demonstrates the truth of every proposition P(n) by doing two things:
You could think of the base case as knocking over the first domino, and the induction step as the nth
domino knocking over the (n + 1)th, for all n. Both of the examples in the previous section followed
this pattern.13 Unpacking the induction step gives an infinite chain of implications:
The base case says that P(1) is true, and so all of the remaining propositions P(2), P(3), P(4), P(5), . . .
are also true.
Here is a straightforward theorem, where we write the proof in the above language.
Theorem 5.2. The sum of the first n positive integers is given by the formula
n
1
∑ i = 2 n ( n + 1).
i =1
13 In the cut-and-stack example, the initial proposition would be labelled P(0) rather than P(1).
129
Proof. (Set-up) We prove by induction. For each n ∈ N, let P(n) be the proposition
n
1
∑ i = 2 n ( n + 1).
i =1
1
(Base Case) Clearly ∑ i = 1 = 21 1(1 + 1), and so P(1) is true.
i =1
(Induction Step) Assume that P(n) is true for some fixed n ≥ 1. We compute the sum of the first
n + 1 positive integers using our induction hypothesis P(n) to simplify:
n +1 n
1
∑ i = ( n + 1 ) + ∑ i = ( n + 1) + 2 n ( n + 1) (by assumption of P(n))
i =1 i =1
1 1
= 1 + n (n + 1) = (n + 2)(n + 1)
2 2
1
= ( n + 1) ( n + 1) + 1 .
2
This last says that P(n + 1) is true.
(Conclusion) By mathematical induction, we conclude that P(n) is true for all n ∈ N. That is
n
1
∀n ∈ N, ∑ i = 2 n ( n + 1).
i =1
Note how we grouped 12 (n + 1) (n + 1) + 1 so that it is obviously the right hand side of P(n + 1).
Here is another example in the same vein, but done a little faster.
Theorem 5.3. Prove that n(n + 1)(2n + 1) is divisible by 6 for all natural numbers n.
n(n + 1)(2n + 1) = 6k
130
By the induction hypothesis, we have that
(n + 1)(n + 2) 2(n + 1) + 1 = n(n + 1)(2n + 1) + 6(n + 1)2 = 6(k + (n + 1)2 )
is divisible by 6. Thus P(n + 1) is true. By mathematical induction, P(n) is true for all n ∈ N.
Theorem 5.3 is also true for n = 0, and indeed for all integers n. As we shall see in the next section,
induction works perfectly well with any base case (say n = 0): you are not tied to n = 1. We could
even modify the argument to prove the same result when n is a negative integer!
After reading the proof, you are possibly thinking, ‘How would I know to do that calculation?’ The
answer is that you wouldn’t, at least not without experience reading proofs. It is better to think on how
much scratch work was done before the originator stumbled on exactly this argument. Read more
proofs and practice writing them, and you’ll soon find that strategies like these will suggest them-
selves!
Here is another example, written in a more advanced style: we don’t explicitly name the propo-
sitions P(n), and the reader is expected to be familiar enough with induction to realize when we are
covering the base case and the induction step. If you find reading this proof a challenge, you should
rewrite it in the same style as we used previously. Some assistance in this regard is given below.
Proof. For n = 1 we have 2 = 2, hence the proposition holds. Now suppose that the proposition
holds for some fixed n ∈ N. Then
This last example has a different flavor than the ones we have seen so far. The example concerns
a 2n × 2n board of squares. By an L-shaped tromino, we mean three squares arranged in an “L”
shape (though possibly flipped or rotated). For example, the following are examples of L-shaped
trominoes:
131
The result is that if one takes any 2n × 2n board and removes any one square, the rest of the board
may be tiled by L-shaped triominoes. Here is an example of the 4 × 4 case:
Theorem 5.5. Let n ∈ N. Then any 2n × 2n board of squares may be tiled by L-shaped trominoes after
removing any square.
132
chosen corners lie adjacent in the center of the board. These removed corners now form an L-shaped
tromino, and can thus be covered by one more tromino.
Scratch work is your friend! Once you are comfortable with the structure of an induction proof,
the challenge is often in finding a clear argument for the induction step. Don’t dive straight into the
proof! First try some scratch calculations. Be creative, since the same approach will not work for all
proofs.
One of the benefits of explicitly stating P(n) is that it helps you to isolate what you know and to
identify your goal. When stuck, write down both expressions P(n) and P(n + 1) and you will often
see how to proceed. Consider, for example, the proof of Theorem 5.4. We have:
1
P(n) : 2 + 5 + 8 + · · · + (3n − 1) = n(3n + 1).
2
1
P ( n + 1) : 2 + 5 + 8 + · · · + [3( n + 1) − 1] = ( n + 1) 3( n + 1) + 1
2
Simply by writing these down, we know that our goal is to somehow convert the left hand side of
P(n + 1) into the right hand side, using P(n). In this situation it is clear how to proceed, for almost
all of the left hand side of P(n + 1) can be substituted for that of P(n).
As a final comment on scratch work, remember that such is very unlikely to constitute a proof.
Here is a typical attempt at a proof of Theorem 5.4 by someone who is new to induction.
False Proof.
1
P(n + 1) = 2 + 5 + · · · + (3n − 1) +[3(n + 1) − 1] = (n + 1) 3(n + 1) + 1
| {z } 2
= 12 n(3n+1) by P(n) 1
= (n + 1)(3n + 4)
2
3 2 1 1
=⇒ n + n + 3n + 3 − 1 = (3n2 + 7n + 4)
2 2 2
3 2 7 3 7
=⇒ n + n + 2 = n2 + n + 2
2 2 2 2
Such an approach is likely to score very poorly in an exam! Here are some of the reasons why.
• P(n + 1) is the goal, the conclusion of the induction step. You cannot prove P(n) =⇒ P(n + 1)
by starting with P(n + 1)!
• P(n + 1) is a proposition and 2 + 5 + · · · + (3n − 1) + [3(n + 1) − 1] is a number, thus it makes
no sense to write that they are equal! Use words or another symbol to disambiguate the two.
• More subtly: the false proof’s argument says that something we don’t know (P(n) ∧ P(n + 1))
implies something true (the trivial final line). Since the implications T =⇒ T and F =⇒ T
are both true (Definition 2.3), this tells us nothing about whether P(n + 1) is true.
• Reversing the arrows and turning the false proof upside down would be a start. However there
is no explanation as to why the calculation is being done. The induction step is only part of an
induction proof and it needs to be placed and explained in context. More concretely:
133
– There is no set-up. P(n) has not been defined, neither indeed has n. You cannot use the
expression P(n) (or any other symbols) in a proof unless it has been properly defined.
– The base case is missing.
– There is no conclusion. Indeed the word induction isn’t mentioned: is the reader supposed
to guess that we’re doing induction?!
For all this negativity, there are some good things here. If you remove the =⇒ symbols, you are left
with an excellent piece of scratch work. By simplifying both sides of your goal you can more easily
see how to calculate.
Your scratch work may make perfect sense to you, but if a reader cannot follow it without your
assistance, then it isn’t a proof. The moral of the story is to do your scratch work for the induction step
then lay out the structure of the proof (set-up, base case, etc.) before incorporating your calculation
into a coherent and convincing argument.
Reading Questions
5.2.1 In an induction proof of the fact that P(n) is true for all n ∈ N, the base case consists of proving
that
5.2.2 In an induction proof of the fact that P(n) is true for all n ∈ N, the induction hypothesis is the
assumption that
Practice Problems
5.2.1 (a) Prove by induction that ∀n ∈ N we have 3 | (2n + 2n+1 ).
(b) Give a direct proof that 3 | (2n + 2n+1 ) for all integers n ≥ 1 and for n = 0.
(c) Look carefully at your proof for part (a). If you had started with the base case n = 0
instead of n = 1, would your proof still be valid?
Video Solution
134
Exercises
5.2.1 (a) Complete Gauss’ direct proof of Theorem 5.2.
(b) Give a direct proof of Theorem 5.3.
(c) In Theorem 5.3, what is the proposition P(n + 1)?
(d) In the Induction Step of Theorem 5.3, explain why it would be incorrect to write
P(n + 1) − P(n) = (n + 1) (n + 2)(2n + 3) − n(2n + 1)
= (n + 1)(2n2 + 7n + 6 − 2n2 − n)
= 6( n + 1)2 .
n
5.2.2 Prove by induction that for each natural number n, we have ∑ 2j = 2n+1 − 1.
j =0
4
(a) What explicitly is the meaning of ∑ k3 ?
k =1
n n
(b) What would be meant by the expression ∑ n3 , and why is it different to ∑ k3 ?
k =1 k =1
(c) If the Theorem is written in the form ∀n ∈ N, P(n), what is the proposition P(n)?
(d) Give as many reasons as you can as to why the following ‘proof’ of the induction step is
incorrect.
n +1
1
P ( n + 1) = ∑ k3 = 4 (n + 1)2 ((n + 1) + 1)2
k =1
n
1
= ∑ k 3 + ( n + 1)3 = 4 ( n + 1)2 ( n + 2)2
k =1
1 1
= n2 ( n + 1)2 + ( n + 1)3 = ( n + 1)2 ( n + 2)2
4 4
1 1
= ( n + 1)2 n2 + 4( n + 1) = ( n + 1)2 ( n + 2)2
4 4
1 1
= ( n + 1) ( n + 2) = ( n + 1)2 ( n + 2)2
2 2
4 4
(e) Give a correct proof of the Theorem by induction.
135
5.2.6 (a) Show, by induction, that for all n ∈ N, the number 4 divides the integer 11n − 7n .
(b) More generally, use induction to prove that ( a − b) | ( an − bn ) for any positive integers
a, b, n.
5.2.8 (a) Find a formula for the sum of the first n odd natural numbers. Prove your assertion by
induction.
(b) Give an alternative direct proof of your formula from part (a). You may use results such
n
as ∑ i = 12 n(n + 1).
i =1
5.2.9 We mimic the previous question for the sum of the squares of the first n natural numbers.
n
(a) Use the fact that ∑ i2 = 16 n(n + 1)(2n + 1) to compute directly an expression for the sum
i =1
of the squares of the first n odd natural numbers.
n 2n n
Hint: ∑ (2i − 1)2 = ∑ i2 − ∑ (2i )2 . . .
i =1 i =1 i =1
(b) Prove the truth of your formula by induction.
5.2.10 Find the error in the following “proof” by induction of the statement “all cats have the same
color fur”.
Proof. We let P(n) be the proposition “any set of n cats have the same color fur”. The result
will follow if we prove that P(n) holds for all n ∈ N. We proceed by induction on n.
It is clear that the base case n = 1 holds as any cat has the same color fur as itself. For the
induction step, fix n ∈ N and assume P(n) holds. Take any set S = {C1 , C2 , . . . , Cn+1 } of n + 1
cats. Select one cat, say C1 , and put it aside. Now we have a set S \ {C1 } of n cats and by the
induction hypothesis they must all have the same color fur. Now put C1 back select a different
cat C2 . Again by the induction hypothesis, all cats in S \ {C2 } must have the same color fur. But
combining this with the previous sentence means that all cats in S must have the same color
fur. Since S was an arbitrary set of n + 1 cats, this shows P(n + 1) holds. We conclude that P(n)
is true for all n ∈ N by induction.
d
5.2.11 Using only the product rule and the fact that dx x = 1, prove the power rule from calculus: for
all n ≥ 1,
d n
( x ) = nx n−1 .
dx
136
(a) Prove that for all n ∈ N,
d n x2 2
n
e = p( x )e x
dx
where p( x ) is a polynomial.
(b) Strengthen the result in part (a) by proving that for all n ∈ N,
d n x2 2 2
n
e = p( x )e x = pn ( x )e x
dx
where pn ( x ) is a polynomial of degree n.
5.2.13 (Hard) Let p( x ) be a polynomial of degree d ≥ 1. Show p has at most d roots. [Hint: induct on
the degree d.]
5.2.14 Let a, b ∈ Z .
n n
(a) Prove that for all n ∈ N, if a and b are relatively prime, then a2 and b2 are relatively
prime.
(b) Use part (a) to show that for all k ∈ N, if a and b are relatively prime, then ak and bk are
relatively prime.
5.2.15 Consider the following scratch work. Determine what result is being proved, then convert the
scratch work into a formal proof of that result.
(1 + x ) n +1 = (1 + x ) n (1 + x )
≥ (1 + nx )(1 + x )
= 1 + x + nx + nx2
= 1 + (n + 1) x + nx2
≥ 1 + ( n + 1) x
137
5.3 Well-ordering and the Principle of Mathematical Induction
Before seeing more examples, it is worth thinking more carefully about the logic behind induction.
The fact that induction really works depends on a fundamental property of the natural numbers.
Definition 5.6. A set of real numbers A is well-ordered if every non-empty subset of A has a mini-
mum element.
The definition is delicate: to test if a set A is well-ordered, we need to check all of its non-empty
subsets. The definition could be written as follows:
Consequently, to show that a set A is not well-ordered, we need only exhibit a non-empty subset B
which has no minimum.
Examples. 5.3.1 A = {4, −7, π, 19, ln 2} is a well-ordered set. There are 31 non-empty subsets of A,
each of which has a minimum element. Can you justify this fact without listing the subsets?
5.3.2 The interval [3, 10) is not well-ordered. Indeed (3, 4) is a non-empty subset which has no mini-
mum element (see the exercises).
5.3.3 The integers Z are not well-ordered. For instance, Z is a non-empty subset of itself, and there
is no minimum integer.
More generally, every finite set of numbers is well-ordered, while intervals are not. Are there any
infinite sets which are also well-ordered? The answer is yes. Indeed it is part of the standard definition
(Peano’s Axioms) of the natural numbers that N is such a set.
Axiom. N is well-ordered.
Armed with this axiom, we can justify the method of proof by induction.
Theorem 5.7 (Principle of Mathematical Induction). Let P(n) be a proposition for each n ∈ N. Suppose:
14 When the elements are written in increasing order, the set has the form B = {b1 , b2 , b3 , b4 , . . .}.
138
Proof. We argue by contradiction. Assume that conditions (a) and (b) hold and that ∃n ∈ N such
that P(n) is false. Then the set
S := {k ∈ N : P(k ) is false}
is a non-empty subset of the well-ordered set N. It follows that S has a minimum element
m := min(S)
This set is well-ordered, whence the following modification of the induction principle is immediate.
Corollary 5.8. Let m ∈ Z be some fixed integer. Let P(n) be a proposition for each integer n ≥ m. Suppose:
We are simply changing the base case. The induction concept is exactly the same as before:
As long as you explicitly prove the first claim in the sequence, and you show the induction step, then
all the propositions are true.
139
Proof. (Base Case) If n = 4, we have 3n = 81 > 64 = n3 . The proposition is therefore true for n = 4.
(Induction Step) Fix n ∈ Z≥4 and suppose that 3n > n3 . Then
To finish the proof, we want to see that this right hand side is at least (n + 1)3 . Now
3
3 3 1
3n ≥ (n + 1) ⇐⇒ 3 ≥ 1+
n
This is true for n = 3 and, since the right hand side is decreasing as n increases, it is certainly true
when n ≥ 4. We therefore conclude, for n ≥ 4, that
which is the induction step. By induction, we have shown that 3n > n3 whenever n ∈ Z≥4 .
Our next example is reminiscent of sequences and series from elementary calculus. If you follow
a textbook derivation of such a formula, you’ll probably see liberal use of ellipsis dots (. . .). When
you see these, it is often because the author is hiding an induction argument.
3
1 3 5
Proof. (Base Case) When n = 3, (∗) reads ∑ i ( i −2)
= 4 − 12 . Both sides equal 31 , whence (∗) is true.
i =3
(Induction Step) Assume that (∗) is true for some fixed n ≥ 3. Then
n +1 n
1 1 1
∑ i ( i − 2)
=∑ +
i (i − 2) (n + 1)(n − 1)
i =3 i =3
3 2n − 1 1
= − + (by the induction hypothesis)
4 2n(n − 1) (n + 1)(n − 1)
3 (2n − 1)(n + 1) − 2n 3 1 + n − 2n2
= − = −
4 2( n + 1) n ( n − 1) 4 2( n + 1) n ( n − 1)
3 (2n + 1)(1 − n) 3 2n + 1
= + = −
4 2( n + 1) n ( n − 1) 4 2( n + 1) n
∞
1
A calculus discussion would finish by taking the limit as n → ∞ to conclude that ∑ i ( i −2)
= 34 .
i =3
140
Our final example involves a little abstraction.
Theorem 5.11. The interior angles of an n-gon (n-sided polygon) sum to 180(n − 2) degrees.
We will take the initial case (n = 3) that the angles of a triangle sum to 180° as given (can you prove
it?) and merely prove the induction step. The main logical difficulty is that we must consider all
n-gons simultaneously. If we were to write the induction step in the form
To prove our induction step for a fixed integer n, we must show that all (n + 1)-gons have the correct
sum of interior angles. We therefore assume that we are given some (n + 1)-gon Pn+1 and proceed
to compute its interior angles in terms of a related n-gon.
Proof. Fix an integer n ≥ 3, and suppose that all n-gons have interior angles summing to 180(n − 2)°.
Suppose we are given an (n + 1)-gon Pn+1 . Select any vertex A and label the adjacent vertices B and
C. Delete A, and join B and C with a straight edge. The result is an n-gon Pn . There are two cases to
consider.15
Case 1: The deleted point A is outside Pn . The sum
of the interior angles of Pn+1 exceeds those of Pn by A
α + β + γ = 180°. Therefore Pn+1 has interior angles sum- α
ming to 180(n − 2)° + 180° = 180[(n + 1) − 2]°. β γ
B C
Case 2: The deleted point A is inside Pn . To obtain the sum of the
interior angles of Pn+1 , we take the sum of the interior angles of
Pn
Pn and do three things: Case 1: A outside Pn
• Subtract β
• Subtract γ B β γ C
• Add the reflex angle 360°−α at A
α
We are therefore adding an additional Pn A
Case 2: A inside Pn
− β − γ + (360° − α) = 360° − (α + β + γ) = 180°
Pn+1 again has interior angles summing to 180[(n + 1) − 2]°.
15 We are obscuring two subtleties here. It is a fact, though not an obvious one, that it is always possible to choose a
vertex A so that the new polygon Pn doesn’t cross itself. Read about ‘ears’ and ‘mouths’ of polygons and triangulation
if you’re interested. There are also two other, less likely, cases which we didn’t consider: when deleting a point from an
(n + 1)-gon it is possible to obtain an (n − 1)-gon, or even an (n − 2)-gon. To think it out, try drawing a 12-gon in the
shape of a Star of David. Deleting one of the outer corners creates a 9-gon! Dealing with these cases strictly requires strong
induction, so we return to them later.
141
Optional: Density of the Rationals
In our last example, we offer a more direct application of N being well-ordered. One of the key
properties of the rational numbers Q is their density in the real line. Intuitively, the idea is that
no matter how close you ”zoom in” on the real line, you can always locate a rational number. We
formalize this with the following definition.
Definition 5.12. We say a set A ⊆ R is dense (in R) if for any real numbers x and y such that x < y,
there is a ∈ A such that x < a < y.
So if you take two real numbers, you can always find an element from A in between them, no
matter how close the two real numbers are from each other. Our goal will be to prove that the
rational numbers Q are dense in R. For this, we will use the well-orderedness of N along with the
following:
Axiom. The real numbers R have the Archimedean property, that is, for any real numbers x, y > 0,
there is n ∈ N such that nx > y.
It is not really necessary to take this as an axiom as the Archimedean property of R can be proved
from more basic principles. However, this requires some knowledge about how to construct the real
numbers which lies beyond the scope of this course. Back to our goal, we need the following lemma
which states that if two real numbers differ by more than 1, then there must be an integer between
them.
Lemma 5.13. Suppose we have x, y ∈ R with y − x > 1. Then there exists k ∈ Z such that x < k < y.
Proof. The idea is to take k to be the least integer greater than x. We will show such an integer
exists using the fact that N is well-ordered. Let A = {n ∈ Z : n > x }. Then A ̸= ∅ by the
Archimedean property (why?). Let m ∈ Z be a number such that m < x (this is another application
of the Archimedean property), and thus m < n for all n ∈ A, by definition of A. Let
S = { n − m + 1 : n ∈ A }.
142
Proof. Let x, y ∈ R with x < y be arbitrary. We need to find r ∈ Q with x < r < y. Then y − x > 0.
By the Archimedean property, there is n ∈ N such that n(y − x ) > 1. Since ny − nx > 1, we can
apply Lemma 5.13 to get k ∈ Z such that nx < k < ny. As n ≥ 1 > 0, dividing yields x < nk < y.
Take r = nk ∈ Q.
Written in the standard order, Z− = {. . . , −4, −3, −2, −1} is not a well-ordered set. In a more
advanced discussion, one could consider alternative orderings, and the definition of well-ordered
would change accordingly. If we choose the ordering ≺ where
−1 ≺ −2 ≺ −3 ≺ · · · , (∗)
then Z− would be well-ordered using ≺ as the order: if B ⊆ Z− is non-empty and has its elements
listed in the same order as (∗), then B has a minimum element (with respect to ≺). With a little
thinking, we could modify the proof of the principle of mathematical induction to allow us to prove
theorems of the form ∀n ∈ Z− , P(n), by induction. The base case is n = −1 and the induction step
justifies the chain
An extremely important theorem in advanced set theory states that it is possible to well-order every
set. With a slight modification of the process, this massively increases the applicability of induction.
In these notes we keep things simple: well-ordering is always in the sense of Definition 5.6, where we
list the elements of a set in the usual increasing order. For a more esoteric example of a well-ordered
set, see the final Exercise below.
Reading Quiz
5.3.1 Which of the following statements are true? Select all that apply.
143
(a) theorem
(b) opinion
(c) axiom
(d) proof
Practice Problems
5.3.1 Prove that n! > 2n for all n ≥ 4.
Video Solution
Exercises
5.3.1 Prove by contradiction that the interval (3, 4) has no minimum element.
n +1 2
5.3.2 (a) Suppose that n ≥ 3. Prove that n < 2.
(b) Hence or otherwise, prove that n2 < 2n for all natural numbers n ≥ 5.
(a) If the statement is written in the form ∀n ∈ N≥2 , P(n), what is the proposition P(n)?
(b) Π-notation is used for products in the same way as Σ-notation for sums: for example
5
∏ ( k + 1 ) k = 21 · 32 · 43 · 54 · 65
k =1
5.3.4 Show that for any n ≥ 3, there is a set A consisting of n natural numbers such that the sum of
the numbers in A is divisible by every element of A.
5.3.5 Recall the geometric series formula from calculus: if r ̸= 1 is constant, and n ∈ N0 , then
n
1 − r n +1
∑ rk = 1−r
(∗)
k =0
144
n
1 − r n +1
Proof. Let P(n) = ∑ r k = 1−r .
k =0
0
1 − r 0+1
(Base Case n = 0) P (0) = ∑ r k = r 0 = 1 = 1−r is true.
k =0
(Induction Step) Fix n ∈ N0 and assume that P(n) is true. Then
n +1 n
1 − r n +1
P ( n + 1) = ∑ r k = ∑ r k + r n +1 = 1−r
+ r n +1
k =0 k =0
1 − r n +1 r n +1 − r n +2 1 − r n +2
= + = , is true.
1−r 1−r 1−r
By induction, (∗) is true for all n ∈ N0 .
Proof. Assume that the statement is true for some fixed n. Then
n +1 n
1 1
∑ i = ∑ i + (n + 1) = 2 n(n + 1) + 7 + (n + 1) = 2 (n + 1)[(n + 1) + 1] + 7,
i =1 i =1
(a) Assume that m is the smallest natural number such that P(m) is false. Let
A = { n ∈ N : n < m }.
What can you say about the elements in the set A, with respect to the property P?
(b) Assume that a is the smallest natural number such that P( a) ∨ Q( a) is false. Let
B = { n ∈ N : n < a }.
What can you say about the elements in the set B, with respect to the properties P and Q?
(c) Assume that u is the smallest natural number such that P(u) ∧ Q(u) is false. Let
C = { n ∈ N : n < u }.
What can you say about the elements in the set C, with respect to the properties P and Q?
(d) Assume that P(1) is true, but that ‘∀n ∈ N, P(n)’ is false. Show that there exists a natural
number k such that the implication P(k ) =⇒ P(k + 1) is false.
145
5.3.8 Prove that if A ⊆ R is a finite set, then A is well-ordered.
5.3.10 In this question we use the fact that N0 is well-ordered to prove the Division Algorithm (Theo-
rem 4.2).
5.3.11 In the text, we show that the principle of mathematical induction can be proved using the
axiom that N is well-ordered. In fact we show in this exercise that one can go the other way.
That is, one can take the principle of mathematical induction as an axiom, and derive that N is
well-ordered.
(a) Assume that the principle of mathematical induction is true. We aim to show that N is
well-ordered. Write out what this means.
(b) Explain why it is enough to show that if A ⊆ N has no minimum element, then A = ∅.
/ S}. Use induction to show B = N. Conclude that A = ∅.
(c) Let B = {n ∈ N : 1, 2, . . . , n ∈
The successor function f is simply ‘plus one’ in disguise: f (n) = n + 1. Moreover, if you think
carefully about the proof of Theorem 5.7, you should be convinced that the induction axiom is
equivalent to the axiom that N is well-ordered, at least in the presence of the other four axioms.
(a) Suppose you replace N with Z in each of the above axioms. Which axioms are still true
and which are false?
146
(b) Let (m, n) represent an ordered pair of natural numbers. Let T be the set of all pairs
T = {(m, n) : m, n ∈ N}.
Let f : T → T be the function f (m, n) = (m + 1, n). Letting the pair (1, 1) play the role of
‘1’ in Peano’s axioms, and f be the successor function, decide which of the above axioms
are satisfied by the set T.
(c) (Hard!) With the same set T as in part (b), take the successor function f : T → T to be
(
(m − 1, n + 1) if m ≥ 2,
f (m, n) =
(m + n, 1) if m = 1.
5.3.14 (Hard!) You might assume from our earlier discussion that all well-ordered sets must look like
the natural numbers. To disabuse you of this error, consider the set
1 2 3 4 3 5 7 9 n 2n − 1
B = 0, , , , , . . . , 1, , , , , . . . = :n∈N ∪ :n∈N
2 3 4 5 2 3 4 5 n+1 n
16 The principle of mathematical induction does not apply to propositions indexed by this set. The reason is that ‘1’ is
not a successor element in B: there is no element b ∈ B such that 1 is ‘the element after b.’ Happily, there is a more general
notion of transfinite induction which extends induction to propositions indexed by well-ordered sets like B. Transfinite
induction proofs require an additional step in order to deal with limit elements like 1 ∈ B.
147
5.4 Strong Induction
The principle of mathematical induction as stated in Theorem 5.7 is sometimes known as weak induc-
tion. In weak induction, we require only that one proposition P(n) be true in order to demonstrate
the truth of the succeeding proposition P(n + 1). By contrast, the induction step in strong induction
additionally requires that more, perhaps all, of the propositions coming before P(n) are also true.
Theorem 5.15 (Principle of Strong Induction). Let m be an integer and suppose that P(n) is a proposition
for each n ∈ Z≥m . Also fix an integer l ≥ m. Suppose:
The statement is a little complicated: we show in the Exercises that it is equivalent to the earlier
Principle of Mathematical Induction. What matters is that Z≥m is a well-ordered set. In the simplest
examples, we have m = 1 and Z≥1 = N. The challenge in strong induction is identifying how much
you need to assume in order to effect the induction step (b), and then how many base cases l − m + 1
are required.
It is much easier to learn strong induction by seeing it in action. Consider the Fibonacci numbers, an
excellent source of strong induction examples.
Proof. For each natural number n, let P(n) be the proposition f n < 2n .
(Base cases n = 1, 2) f 1 = 1 < 21 and f 2 = 1 < 22 , whence P(1) and P(2) are true.
(Induction step) Fix n ≥ 2 and suppose that P(1), . . . , P(n) are true. Then
f n +1 = f n + f n −1 < 2n + 2n −1 < 2n + 2n = 2n +1
In terms of Theorem 5.15, we have m = 1 and l = 2 with l − m + 1 = 2 base cases. The reason we
need m = 1 is because the first claim in the Theorem is about the integer 1, namely f 1 < 21 . We need
148
two base cases because the recurrence relation defining the Fibonacci numbers requires the previous
two terms of the sequence in order to construct the next.
To help us understand strong induction, it is instructive to see why a proof by weak induction
would fail in this setting.
f n +1 = f n + f n −1 . (∗)
The inductive hypothesis tells us that f n < 2n , but what can we say about f n−1 ? Absolutely nothing!
We are stuck: weak induction fails to prove the theorem.
The incorrect proof tells us why we need strong induction: the recurrence relation defines each Fi-
bonacci number (except f 1 and f 2 ) in terms of the previous two. To make use of the recurrence, our
induction hypothesis must assume something about at least f n and f n−1 . Assuming something about
only f n is insufficient.
From Wrong Proof A we learned that we needed to prove Theorem 5.17 by strong induction. Now
suppose that we try the following, which looks almost identical to the correct proof.
Wrong Proof B. For each n ∈ N, let P(n) be the proposition f n < 2n . We prove that P(n) is true for
all n ∈ N by strong induction.
(Base Case n = 1) By definition, f 1 = 1 < 21 , whence P(1) is true.
(Induction Step) Fix n ∈ N and assume that P(1), . . . , P(n) are all true. We want to show that
f n+1 < 2n+1 . By the recurrence relation, we can write
Where is the problem with this second argument? The recursive formula f n+1 = f n + f n−1 only ap-
plies if n ≥ 2. If we take n = 1, then it reads f 2 = f 1 + f 0 , but f 0 is not defined! In the induction step
of Wrong Proof B, we are letting n be any integer ≥ 1. When n = 1, step (†) is not justified, and so the
proof fails. For (†) to be legitimate, we must have n ≥ 2. This is why, in our correct proof, we had to
prove P(1) and P(2) separately.
The moral here is to try the induction step as scratch work. Your attempt will tell you if you need
strong induction and, if you do, how many base cases are required.
149
Strong Induction on Well-ordered Sets
In the next example the first term is suffixed by n = 0. In the language of Theorem 5.15, we have
m = 0 and l = 1 with l − m + 1 = 2 base cases. Just like the Fibonacci example, two base cases are
required because the defining recurrence relation constructs the next term in the sequence from the
two previous terms.
Think about why we wrote an+1 = 5an − 6an−1 in the induction step, whereas the statement in the Theorem
reads an = 5an−1 − 6an−2 . Does it matter? What does it mean to say that n is a ‘dummy variable’?
In the two previous examples, it might seem that strong induction is something of a logical
overkill. In the induction step we are assuming far more than we need. In both examples, estab-
lishing the truth of P(n + 1) required only the truth of P(n) and P(n − 1). We assumed that the
earlier propositions were also true, but we never used them. Depending on the proof, you might
need two, three or even all of the propositions prior to P(n + 1) to complete the induction step. Once
you are used to strong induction you may feel comfortable slimming a proof down so that you only
mention precisely what you need. For the present, the way we’ve stated the principle is maximally
safe! For some practice with this, see Exercise 5.4.2 where three base cases are needed, and the induc-
tion step requires the three previous propositions P(n), P(n − 1), P(n − 2) in order to prove P(n + 1).
To see strong induction in all its glory, where the induction step requires all of the previous propo-
sitions, we prove part of the famous Fundamental Theorem of Arithmetic, which states that all natu-
ral numbers may be factored (uniquely) into a product of primes: for example 3564 = 22 × 34 × 11.
As you read the proof of the next theorem, think carefully about why only one base case is required.
150
Theorem 5.19. Every natural number n ≥ 2 is either prime, or a product of primes.
First recall Definition 2.34, that p ∈ N≥2 is prime if its only positive divisors are itself and 1.
Otherwise said, if q ∈ N≥2 is not prime, then it is said to be composite: ∃ a, b ∈ N≥2 such that q = ab.
By strong induction we see that all natural numbers n ≥ 2 are either prime, or a product of primes.
Reading Quiz
5.4.1 True or False: in a strong induction proof, we may have more than one base case.
5.4.2 What are some differences between strong induction and weak induction? Select all that apply.
(a) Strong induction has no induction step, but weak induction does.
(b) Both only have one base case.
(c) When proving P(n + 1), strong induction allows one to assume all previous propositions
are true, whereas weak induction only assumes P(n) is true.
(d) Weak induction is equivalent to N being well-ordered, but strong induction is not equiv-
alent.
Practice Problems
5.4.1 Let ( f n )∞
n=1 be the Fibonacci sequence. Prove that f n is even if and only if n ≡ 0 (mod 3).
Video Solution
√
5.4.2 Prove that a composite number a always has a prime factor p such that p ≤ a.
Video Solution
151
Exercises
5.4.1 Define a sequence (bn )∞
n=1 as follows:
(
bn = bn−1 + bn−2 , n ≥ 3,
b1 = 3, b2 = 6.
Prove: ∀ n ∈ N, bn is divisible by 3.
Prove that cn = 5n − 3n for all n ∈ N0 . Hint: you need three base cases!
n = 2k 1 + 2k 2 + · · · + 2k ℓ
(a) If the Theorem is written in the form ∀n ∈ N≥2 , P(n), what is the proposition P(n)?
(b) Explicitly carry out the induction step for the three situations n + 1 = 9, n + 1 = 106
and n + 1 = 45. How many different ways can you perform the calculation for n + 1 =
45? Explain why it is only necessary in the induction step to assume that all integers k
1
satisfying 2 ≤ k ≤ n+2 are prime or products of primes.
(c) Rewrite the proof in the style of Theorem 5.17, explicitly mentioning the propositions P(n),
and thus making the logical flow of strong induction absolutely clear.
Hint: you need to cover two base cases. Why? Think about the induction step first and it will help you
decide how many base cases you need.
5.4.6 The Fundamental Theorem of Arithmetic states that every n ≥ 2 can be written as a product of
prime factors in a unique way (up to reordering of the prime factors). In other words,
the ring of integers, prime and irreducible are synonymous. For the details, take a Number Theory course.
152
(2) if n = q1 q2 · · · qℓ for primes q1 , q2 , . . . , qℓ , then k = ℓ and pi = qi after possibly reordering
the prime factors.
We proved (1) in Theorem 5.19. Supply a proof of (2). [Hint: one way would be to use Exercise
5.]
5.4.7 Prove that the nth Fibonacci number f n is given by the formula
√ √
ϕn − ϕ̂n 1+ 5 1− 5
fn = √ , where ϕ = and ϕ̂ = .
5 2 2
ϕ is the famous Golden ratio. ϕ and ϕ̂ are the two solutions to the equation x2 = x + 1.
√ √
5.4.8 Show that for every positive integer √ n, (3 + 5)n√ + (3 − 5)n is an even integer.
√
Hints: Prove simultaneously that (3 + 5)n − (3 − 5)n is an even multiple of 5.
Subtract the nth expression from the (n + 1)th in both cases. . .
5.4.9 (Hard!) Return to the proof of Theorem 5.11. Can you make a watertight argument using strong
induction that also covers the two missing cases? Draw a picture to illustrate each case.
5.4.10 Suppose that { P(n) : n ≥ m} are a collection of propositions as considered in the Principle of
Strong Induction. For each n ≥ m, let Q(n) be the proposition
Prove that the Principle of Strong Induction is equivalent to the Principle of Induction stated as
follows: Suppose that
153
6 Set Theory, Part II
In this chapter we return to set theory and consider several more-advanced constructions.
Definition 6.1. Let A and B be sets. The Cartesian product of A and B is the set
A × B = {( a, b) : a ∈ A and b ∈ B}.
A × B is simply the set of ordered pairs ( a, b) where a ∈ A and b ∈ B. Two ordered pairs ( a, b) and
(c, d) are equal if and only if their coordinates agree: a = c and b = d.
Examples. 6.1.1 The Cartesian product of the real line R with itself is the xy-plane: rather than
writing R × R which is unwieldy, we write R2 .
R2 = R × R = {( x, y) : x, y ∈ R}.
Rn = {( x1 , x2 , . . . , xn ) : x1 , x2 , . . . , xn ∈ R}.
6.1.2 If A = {1, 2, 3} and B = {α, β}, then the Cartesian product of A and B is
A × B = {(1, α), (1, β), (2, α), (2, β), (3, α), (3, β)}
6.1.3 Suppose you go to a restaurant where you have a choice of one main course and one side. The
menu might be summarized set-theoretically: consider the sets
The Cartesian product Mains × Sides is the set of all possible meals made up of one main and
one side. It should be obvious that there are 4 × 3 = 12 possible meal choices.
These last two examples illustrates the next theorem, which explains the use of the word product.
154
Theorem 6.2. If A and B are finite sets, then | A × B| = | A| · | B|.
Proof. Label the elements of each set and list the elements of A × B lexicographically. If | A| = m and
| B| = n, then we have:
A×B = ( a1 , b1 ), ( a1 , b2 ), ( a1 , b3 ), · · · ( a1 , bn ),
( a2 , b1 ), ( a2 , b2 ), ( a2 , b3 ), · · · ( a2 , bn ),
.. .. .. ..
. . . .
( am , b1 ), ( am , b2 ), ( am , b3 ), · · · ( a m , bn )
It should be clear that every element of A × B is listed exactly once. There are m rows and n columns,
thus | A × B| = mn.
Before we go any further, consider the complement of a Cartesian product A × B. If you had to
guess an expression for ( A × B)C , you might well try AC × BC . Let us think more carefully.
( x, y) ∈ ( A × B)C ⇐⇒ ( x, y) ̸∈ A × B
⇐⇒ ¬(( x, y) ∈ A × B)
⇐⇒ ¬( x ∈ A and y ∈ B)
⇐⇒ x ̸∈ A or y ̸∈ B
Proof. Since we are dealing with Cartesian products, the general element has the form ( x, y).
Let ( x, y) ∈ ( A × B) ∪ (C × D ). Then
( x, y) ∈ A × B or ( x, y) ∈ C × D.
D
But then
B
( x ∈ A and y ∈ B) or ( x ∈ C and y ∈ D ).
Clearly x ∈ A or x ∈ C, so x ∈ A ∪ C.
Similarly y ∈ B or y ∈ D, so y ∈ B ∪ D. C
Therefore ( x, y) ∈ ( A ∪ C ) × ( B ∪ D ), as required. A
155
The picture is an visualization of the theorem, where we assume that the sets A, B, C and D are all
intervals of real numbers. ( A × B) ∪ (C × D ) is the yellow shaded region, while ( A ∪ C ) × ( B ∪ D ) is
the larger dashed square. While helpful, the picture is not a proof! The theorem is a statement about
any sets, whereas the picture implicitly assumes that these sets are intervals.
For an application of the picture, it should be clear that if x ∈ C \ A and y ∈ B \ D, then ( x, y) ∈
( A ∪ C ) × ( B ∪ D ) but ( x, y) ̸∈ ( A × B) ∪ (C × D ). We do not therefore expect these sets to be equal.
Reading Questions
6.1.1 Let A and B be sets. Let ( a, b), (c, d) ∈ A × B. Then ( a, b) = (c, d) if and only if
(a) a = c
(b) b = d
(c) ad = bc
(d) a = c and b = d
6.1.2 True or False: A × B = ∅ if and only if A = B = ∅.
6.1.3 Fill in the blank: If A and B are both finite nonempty sets, then max(| A|, | B|) | A × B |.
(a) =
(b) ≥
(c) ≤
(d) ̸=
Practice Problems
6.1.1 Let A, B, C, D be sets. Prove
( A × B ) ∩ ( C × D ) = ( A ∩ C ) × ( B ∩ D ).
Video Solution
6.1.2 Let A and B be nonempty sets. Define a function π1 : A × B → A by π1 ( a, b) = a. Show π1 is
surjective. Under what conditions is it a bijection?
Video Solution
Exercises
6.1.1 (a) Suppose that A = {1, 2} and B = {3, 4, 5}. State the sets A × B and B × ∅ in roster
notation.
(b) Sketch both A × B and B × A using dots on the plane. What do you observe about your
pictures?
(c) If A, B, C are any sets, we may define the triple Cartesian product as
A × B × C = ( a, b, c) : a ∈ A, b ∈ B, c ∈ C
156
(d) For the sets A, B and C as above, is A × ( B × C ) = A × B × C?
6.1.2 Consider the following subintervals of the real line: A = [2, 5], B = (0, 4).
(a) Express the set ( A \ B)C in interval notation, as a disjoint union of intervals.
(b) Sketch the sets A × B and ( A × B)C on the plane R2 . (Submit two different drawings, one
for the set A × B and one for its complement.)
(c) Sketch the set ( A \ B)C × ( B \ A) on the plane R2 .
( x, y) ∈ ( AC ∪ B) × (C \ D )
x ∈ A, x ̸∈ A, x ∈ B, x ̸∈ B, y ∈ C, y ̸∈ C, y ∈ D, y ̸∈ D.
6.1.4 Let A = [1, 3], B = [2, 4] and C = [2, 3]. Prove or disprove that
( A × B) ∩ ( B × A) = C × C.
Hint: Draw the sets A × B, B × A and C × C in the Cartesian plane. The picture will give you a hint
on whether or not the statement is true, but it does not constitute a proof.
6.1.6 Draw a picture, similar to that in Theorem 6.3, which illustrates the fact that
( A × B )C ̸ = AC × BC .
(C1 × D1 ) ∪ (C2 × D2 ) ∪ · · ·
where each of the unions are disjoint: that is i ̸= j =⇒ (Ci × Di ) ∩ (Cj × D j ) = ∅. You don’t
have to prove your assertion.
(a) A × ( B ∪ C ) = ( A × B) ∪ ( A × C ).
(b) A × ( B ∩ C ) = ( A × B) ∩ ( A × C ).
(c) A × ( B \ C ) = ( A × B) \ ( A × C ).
157
6.1.9 (a) Give an explicit example of sets A, B, C, D such that ( A × B) ∪ (C × D ) ̸= ( A ∪ C ) × ( B ∪
D ).
(b) For sets A, B, C, D, prove that
( A ∪ C ) × ( B ∪ D ) = ( A × B ) ∪ ( A × D ) ∪ ( C × B ) ∪ ( C × D ).
6.1.11 (a) Suppose that | A| = 3, and | B| = 4. What are the minimum and maximum values for the
cardinalities |( A × B) ∩ ( B × A)| and |( A × B) ∪ ( B × A)|?
(b) More generally, suppose that | A| = m, | B| = n and | A ∩ B| = c. What are the above
cardinalities?
6.1.12 Prove the following by induction. For all n ∈ N, if A1 , . . . , An are finite sets, then
| A1 × · · · × A n | = | A1 | · · · | A n |
6.1.13 Let E ⊆ N × N be the smallest subset which satisfies the following conditions:
• Base case: (1, 1) ∈ E
• Generating Rule I: If ( a, b) ∈ E then ( a, a + b) ∈ E
• Generating Rule II: If ( a, b) ∈ E then (b, a) ∈ E
6.1.14 A strict set-theoretic definition requires you to build the ordered pair ( a, b) as a set: typically
( a, b) = { a, { a, b}}. One then proves that ( a, b) = (c, d) ⇐⇒ a = c and b = d.
(a) One of the axioms of set theory (regularity) says that there is no set a for which a ∈ a. Use
this to prove that the cardinality of ( a, b) = { a, { a, b}} is two.
a = c and b = d,
(b) Prove that ( a, b) = (c, d) =⇒ or
a = {c, d} and c = { a, b}.
(c) In the second case, prove that there exists a set S such that a ∈ S ∈ a. The axiom of
regularity also says that this is illegal. Conclude that ( a, b) = (c, d) ⇐⇒ a = c and b = d.
6.1.15 Let A and B be nonempty sets. Define functions π1 : A × B → A and π2 : A × B → B by
π1 ( a, b) = a and π2 ( a, b) = b respectively (these are called the projection maps).
(a) If A = B = R and X = [1, 3], Y = (2, 4], then X × Y ⊆ A × B. Compute the images
π1 ( X × Y ) and π2 ( X × Y ).
(b) Let Z be any set and suppose there are functions ρ1 : Z → A and ρ2 : Z → B. Show there
is a unique function h : Z → A × B such that ρ1 = π1 ◦ h and ρ2 = π2 ◦ h.
158
6.2 Power Sets
Thusfar we have seen how to build new sets from old using the operations of subset, complement,
union, intersection and Cartesian product. There is essentially only one further method whereby we
can produce new sets; given a set A, we consider the collection of all of the subsets of A and we insist
that this collection is a set.
Definition 6.4. The power set of A is the set P ( A) of all subsets of A. That is,
P ( A ) = { B : B ⊆ A }.
Otherwise said: B ∈ P ( A) ⇐⇒ B ⊆ A.
Examples. 6.2.1 Let A = {1, 3, 7}. Then A has the following subsets, listed by how many elements
are in each subset.
0-elements: ∅
1-element: {1}, {3}, {7}
2-elements: {1, 3}, {1, 7}, {3, 7}
3-elements: {1, 3, 7}
n o
6.2.2 Consider B = 1, {2}, 3 . It is essential that you use different size set brackets to prevent
confusion. B has only two elements, namely 1 and {2}, 3 . We can gather the subsets of B in a
table.
0-elements: ∅ n o
1-element: {1}, {2}, 3
n o
2-elements: 1, {2}, 3
In the second line, remember that to make a subset out of a single element you must surround
the element with set brackets. Thus 1 ∈ B =⇒ {1} ⊆ B and
n o
{2}, 3 ∈ B =⇒ {2}, 3 ⊆ B.
159
Notation Be absolutely certain that you understand the difference between ∈ and ⊆. It is easy to
become confused when considering power sets. In the context of the previous examples, here are
eight propositions. Which are true and which are false?18
Proof. Suppose that A ⊆ B and let C ∈ P ( A). We must show that C ∈ P ( B).
By definition, C ∈ P ( A) =⇒ C ⊆ A. Since subset inclusion is transitive (Theorem 3.5), we have
C ⊆ A ⊆ B =⇒ C ⊆ B.
It is very easy to get confused by the proof of this theorem. Exercises 6.2.4 and 6.2.5 discuss things
further.
You should have seen this pattern before: we are looking at the first few lines of Pascal’s Triangle.19
It should be no surprise that if | A| = 4, then |P ( A)| = 1 + 4 + 6 + 4 + 1 = 16. The progression
1, 2, 4, 8, 16, . . . in the final column immediately suggests the following theorem.
Conjuring up a proof may seem daunting given how little we know about A! In fact we have only
one thing to work with: the cardinality of A. Indeed you might find it helpful to rephrase the theorem
as follows:
∀n ∈ N0 , | A| = n =⇒ |P ( A)| = 2n
18 Only(a), (d), and (g) are true. Make sure you understand why!
19 If
you know a little about combinations from probability, it should be clear that a set A with n elements has precisely
n C = (n) = n!
distinct r-element subsets.
r r r!(n−r )!
160
Viewed this way, we see that we want to prove an infinite collection of propositions, indexed by
the set N0 : induction seems like the way forward. What might the induction step look like? The
basic idea is that every set with n + 1 elements is the disjoint union of a set with n elements and a
single-element set. The induction step is essentially the observation that any n + 1-element set B has
twice the number of subsets of some n-element set A. It is instructive to see an example of this before
writing the proof.
Example. Let B = {1, 2, 3}. Now choose the element 3 ∈ B and delete it to create the smaller set
A = {1, 2} = B \ {3}.
We can split the subsets of B into two groups: those which contain 3 and those which do not. In the
following table we list all of the subsets of B. In the first column are those subsets X which do not
contain 3. These are exactly the subsets of A. In the second column are the subsets Y = X ∪ {3} of B
which do contain 3.
X X ∪ {3}
∅ {3}
{1} {1, 3}
{2} {2, 3}
{1, 2} {1, 2, 3}
Proof. We prove by induction on the cardinality of A. For each n ∈ N0 , we consider the proposition
| A| = n =⇒ |P ( A)| = 2n . (∗)
(Base Case) If n = 0, then A = ∅ (Theorem 3.5). But then P ( A) = {∅}, whence |P ( A)| = 1 = 20 .
(Induction Step) Fix n ∈ N0 and assume that (∗) is true for this n. That is, we assume that any set
with n elements has 2n subsets. Now let B be any set with n + 1 elements. Choose one of the elements
b ∈ B and define A = B \ {b}. The subsets of B can then be separated into the following two types:
161
Once you understand the proof, you should compare it to the proof of Theorem 5.11 on the interior
angles of a polygon: the idea is very similar. Exercise 6.2.11 gives an alternative proof of this result.
As a final example, we consider the interaction of power sets and Cartesian products.
A × B = {( a, b), ( a, c)}.
It should be clear from this example not only that P ( A × B) ̸= P ( A) × P ( B), but that the elements
of the two sets are completely different. The elements of P ( A × B) are sets of ordered pairs, while the
elements of P ( A) × P ( B) are ordered pairs of sets.
Reading Questions
6.2.1 Which of the following are true statements. Select all that apply.
(a) 3
(b) 8
(c) 16
(d) 32
162
Practice Problems
6.2.1 Let A = {∅, 1, { a}}. List the elements of P ( A), compute its cardinality. Then answer True or
False for the following:
(a) ∅ ∈ A
(b) ∅ ⊆ A
(c) ∅ ∈ P ( A)
(d) ∅ ⊆ P ( A)
(e) {{ a}} ⊆ P ( A)
(f) {{∅, 1}, {∅}, ∅} ⊆ P ( A)
(g) A ∈ P ( A)
(h) A ⊆ P ( A)
Video Solution
Exercises
6.2.1 Write the following sets in roster notation:
(a) P ( A) for A = {1, 2}. (d) P ( A) for A = {∅, 3, {4}}.
(b) P ( A) for A = {1, 2, 3}. (e) P (P ( A)) for A = {3, 5}.
(c) P ( A) for A = (1, 2), (2, 3) . (f) { X ∈ P ({1, 2, 3, 4}) : | X | = 1}.
6.2.3 Determine whether the following statements are true or false (in (b), the symbol ⊊ means ‘proper
subset’). Justify your answers.
6.2.4 Here are three incorrect proofs of Theorem 6.5. Explain why each fails.
163
(a) Let x ∈ P ( A). Then x ∈ A. Since A ⊆ B, we have x ∈ B. Therefore x ∈ P ( B), and so
P ( A ) ⊆ P ( B ).
(b) Let A = {1, 2} and B = {1, 2, 3}. Then P ( A) = {∅, {1}, {2}, A}, and
P ( B) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, B}. Thus P ( A) ⊆ P ( B).
(c) Let x ∈ A. Since A ⊆ B, we have x ∈ B. Since x ∈ A and x ∈ B, we have { x } ∈ P ( A), and
{ x } ∈ P ( B ).
6.2.5 Consider the converse of Theorem 6.5. Is it true or false? Prove or disprove your conjecture.
6.2.6 (a) Prove that P ( A) ∪ P ( B) ⊆ P ( A ∪ B). Provide a counter-example to show that we do not
expect equality.
(b) Does anything change if you replace ∪ with ∩ in part (a)? Justify your answer.
6.2.8 (a) For any set A, show there is an injection ι : A → P ( A). (Explicitly construct a map, and
show that it is one-to-one.)
(b) Is there any set A such that A ∩ P ( A) ̸= ∅?
6.2.10 Consider the proof of Theorem 6.6. Let B be a set with n + 1 elements, let b ∈ B and let
A = B \ {b}. Prove that the function f : P ( A) × {1, 2} → P ( B) defined by
f ( X, 1) = X, f ( X, 2) = X ∪ {b}
6.2.11 We use the following notation for the binomial coefficient: (nr) = r!(nn!−r)! . This symbol denotes
the number of distinct ways one can choose r objects from a set of n objects.
(a) Use the definition of the binomial coefficient to prove the following:
n+1 n n
If 1 ≤ r ≤ n, then = + .
r r r−1
n
(b) Prove by induction that ∀n ∈ N0 , ∑ (nr) = 2n .
r =0
Hint: Use part (a) in the induction step. Note that the smallest n for which it applies is n = 1 . . .
(c) Explain why part (b) provides an alternative proof of Theorem 6.6.
n
If you found this easy, try proving the binomial theorem: ∀n ∈ N, ( x + y)n = ∑ (nr) xr yn−r .
r =0
6.2.12 Let A and B be nonempty sets. We use the notation A B to denote the set of all functions from B
to A.
164
(c) Let B be a set and Y ⊆ B. Define χY : B → {0, 1} by
(
1 if x ∈ Y
χY ( x ) =
0 if x ∈
/ Y.
6.2.13 Let A, B, C, D be nonempty sets. Suppose that there is a bijection f : A → B and a bijection
g : C → D. Show there is a bijection between C A and D B .
6.2.14 Let X be an infinite set. A collection of sets F ⊆ P ( X ) is called a filter if the following conditions
are satisfied:
(1) ∅ ∈
/ F and X ∈ F ,
(2) if A ⊆ B ⊆ X and A ∈ F , then B ∈ F ,
(3) if A, B ∈ F , then A ∩ B ∈ F .
(a) Show that { A : X \ A is finite} is a filter (this is called the cofinite or Frechét filter).
(b) A filter U ⊆ P ( X ) is called an ultrafilter if it is a filter and for any A ∈ P ( X ), we have
either A ∈ U or X \ A ∈ U . Show that the cofinite filter is not an ultrafilter.
(c) Show that a filter F is an ultrafilter if and only if for any A1 , . . . , An ∈ P ( X ) such that
A1 ∪ · · · ∪ An ∈ F , there is 1 ≤ i ≤ n such that Ai ∈ F .
(d) Let s ∈ X, and define Us = { A ∈ P ( X ) : s ∈ A}. Show Us is an ultrafilter, called the
principal ultrafilter generated by s.
(e) An ultrafilter U is nonprincipal if it is not equal to Us for any s ∈ X. Show an ultrafilter U is
nonprincipal if and only if it contains the cofinite filter (as a subset).
165
6.3 Indexed Collections of Sets
In this section we consider collections of sets An , where each n lies in some indexing set I. It is often
the case that I = N or Z. If I is some other set, for example the real numbers R, the label for the
index may be chosen accordingly: e.g. A x .
Definition 6.7. Given a family of indexed sets { An : n ∈ I }, we may form the union and intersection
of the collection:
[
An = { x : x ∈ An for some n ∈ I },
n∈ I
\
An = { x : x ∈ An for all n ∈ I }.
n∈ I
Otherwise said,
[
x∈ An ⇐⇒ ∃n ∈ I such that x ∈ An
n∈ I
\
x∈ An ⇐⇒ ∀n ∈ I we have x ∈ An
n∈ I
∞
S ∞
T
When the indexing set is N, it is common to use the notations An and An .
n =1 n =1
and
\
A i = A α ∩ A β ∩ A γ = {3}
i∈ I
The following Theorem is almost immediate given the definitions of union and intersection: can you
supply a formal proof?
166
Infinite Unions and Intersections: don’t take limits!
The challenge with indexed sets often involves computing unions and intersections of infinitely many
sets. Be very careful with this: it is very tempting to ‘take limits’ when this doesn’t make sense. With
this in mind, we dissect an important example.
h
For each n ∈ N, consider the interval An = 0 , n1 . We analyze the collection { An : n ∈ N}. First
1 1
observe that m ≤ n =⇒ n ≤ m =⇒ An ⊆ Am ; the sets are therefore nested:
A1 ⊇ A2 ⊇ A3 ⊇ A4 ⊇ · · · (∗)
Since every set in the collection is a subset of A1 , it follows that this is the union,
∞
[
An = A1 = [0, 1).
n =1
Before considering the full intersection, we first compute all finite intersections. Since the sets An are
nested in the form (∗), it follows that any finite intersection is simply the smallest of the listed sets:
i.e., for any constant m ∈ N we have
m
\ h 1
An = Am = 0 , .
n =1
m
Observe that this is non-empty for every m. Now what about the infinite intersection? You might be
tempted to take a limit and make an argument such as
∞
\ m
\ h 1 ? h 1
? ?
An = lim An = lim 0 , = 0 , lim = [0, 0).
n =1
m→∞
n =1
m→∞ m m→∞ m
Quite apart from the issue that [0, 0) is ugly and could only mean the empty set, we should worry
about whether this is a legitimate use of limits. It isn’t! We are only allows to take limits of sequences
of numbers, not of sets. Perhaps you could forgive the abuse of limits if the approach yielded the
correct conclusion. Unfortunately it doesn’t: the infinite intersection is in fact non-empty, and we
claim the following.
∞
T
Theorem 6.9. A n = {0}.
n =1
Before we give a formal proof, it is instructive to see a calculation. Let us show, for example, that
∞
T
2 2
9 ̸∈ An . To prove that 9 is not in the intersection of all the An , it is enough to exhibit a single
n =1
2 1
integer m such that 9 ̸∈ Am . The picture shows that we can choose m = 10: since 10 < 29 , we have
∞
T
2 1 2 2
9 ̸∈ [0, 10 ] = A10 . Since 9 ̸∈ A10 , we conclude that 9 ̸∈ An .
n =1
A10
[ ) |
1 2
0 10 9
167
∞
T
Proof. We prove that x ∈ An ⇐⇒ x = 0.
n =1
∞
T
Suppose that x ∈ An . Then x ∈ 0 , n1 for all n. Otherwise said,
n =1
1
∀n ∈ N, we have 0 ≤ x < . (†)
n
Certainly x = 0 satisfies these inequalities.
1
Now suppose, for a contradiction, that x > 0. Since lim = 0, we can certainly choosea N large
n→∞ n
enough so that N1 ≤ x. But this says that x ̸∈ A N , which contradicts (†).
The intersection contains no positive elements, and we conclude that
∞
\
A n = {0}.
n =1
a Explicitly, you may choose choose N = ⌈ 1 ⌉, or anything larger. Here ⌈ x ⌉ is the ceiling function: the smallest integer
x
greater than or equal to x.
By modifying the sets An to either include or exclude endpoints, we can obtain slightly different
results. Consider each of the following in turn. How would the argument for computing each inter-
section differ from what we did above?
∞
T
• If Bn = 0 , n1 , then Bn = ∅.
n =1
i ∞
T
1
• If Cn = 0 , n , then Cn = ∅.
n =1
h i ∞
T
• If Dn = 0 , n1 , then Dn = { 0 } .
n =1
The moral of these examples is that you cannot naı̈vely apply limits to sequences of sets. Your intu-
ition is often a good guide, but that doesn’t mean you should trust it blindly!
To prove the former, note that ∀ x ∈ R we have x ∈ [n, n + 1) where n = ⌊ x ⌋ is the greatest
integer which is less than or equal to x: i.e. x ∈ A⌊ x⌋ .
168
6.3.2 For each n ∈ N, let An = [−n, n]. Each of the sets An is a closed interval. E.g.,
A1 ⊆ A2 ⊆ A3 ⊆ · · ·
T
It follows immediately that the intersection is An = A1 = [−1, 1].
n ∈N S
With a little thinking you might hypothesize that the union is An = R. To prove this,
n ∈N
assume that x ∈ R is non-zero, and observe that
−⌈| x |⌉ ≤ x ≤ ⌈| x |⌉ =⇒ x ∈ A⌈|x|⌉
S
Since 0 ∈ A1 , it follows that R ⊆ An , whence these sets are equal.
n ∈N
If the notation is causing difficulty, consider for example,
−3.124 ∈ A⌈3.124⌉ = A4 .
6.3.3 For each n ∈ N, let An = { x ∈ R : x2 − 1 < n1 }. Before computing the union and intersection
of these sets, it is helpful to write each set as a pair of intervals. Note that
r r
1 1 1 1 1
x2 − 1 < ⇐⇒ − < x2 − 1 < ⇐⇒ 1 − < |x| < 1 + .
n n n n n
Therefore
q q q q
1 1 1 1
An = − 1 + n , − 1 − n ∪ 1 − n, 1 + n .
169
Indexed Unions: Don’t Confuse Sets and Elements
It is easy to confuse and important to distinguish between the sets
[
{ An : n ∈ I } and An .
n∈ I
The first is a set whose elements are themselves sets. The second is the collection of all elements in any
set An . Consider the following examples.
6.3.2 Let I = R ∪ {∞}. For each m ∈ I, let Am be the linea through the origin in R2 with gradient m.
Each element of { Am : m ∈ I } is a line: there is one for each direction through the origin.
S
The union Am consists of all of the points that lie on any line through the origin. Since any
S
point in the plane lies on some line through the origin, we see that Am = R2 .
T
It should be clear that all the lines intersect at the origin, and so Am = {(0, 0)}.
The collection of lines { Am : m ∈ I } is the famous projective space P(R2 ); this is a very different
set from R2 !
This example also shows that indexing sets don’t have to be simple sets of integers. It is also
possible to index the same set using I = [0, π ). If we define Bθ to be the line through the origin
making an angle θ with the positive x-axis, we would then have Bθ = Atan θ .
a We include the vertical line A∞ .
A −3 A ∞ A 4 A
2
A1
A−0.75
A0.5
A−0.2
A0
170
Finite Decimals
Here is another example where our intuition of ‘taking the limit’ leads us astray. This time it is the
union that behaves surprisingly.
For example 0.134 ∈ A3 . Since 0.134 = 0.1340, we also have 0.134 ∈ A4 . Once again we have a nested
sequence of sets
A1 ⊆ A2 ⊆ A3 ⊆ A4 ⊆ · · ·
At this point, we might be inclined to take the limit as m → ∞ of the property ‘length m decimal.’ If
so, then it would seem that the infinite union should be the entire20 interval [0, 1].
What is wrong with our reasoning? We have again abused the idea of limits: one cannot take the
limit of a property! Instead we use the definition:
[
x∈ An ⇐⇒ ∃n ∈ N such that x ∈ An
n ∈N
⇐⇒ ∃n ∈ N such that x is a decimal of length n.
It follows that
[
An = x ∈ [0, 1) : x has a finite decimal representation
n ∈N
S
In particular, there are no irrational numbers in An :
n ∈N
y
If x ∈ An , then y = 10n x is an integer, whence x = ∈ Q.
10n
1
Many rational numbers are also excluded. For example 3 = 0.3333 · · · is not in any set An and is
therefore not in the union.
20 We would include 1 = 0.9999 · · ·
171
The Cantor Set
We finish this section with a bit of fun. We can use infinite intersections to create self-similar sets,
otherwise known as fractals. The Cantor middle-third set is a famous example.
Staring with the interval C0 = [0, 1], we construct a sequence of sets Cn for each n ∈ N0 by repeatedly
removing the middle third of each of the intervals contained in Cn .
1 2
C0 = [0, 1], 0 3 3 1
C1 = [0, 31 ] ∪ [ 23 , 1],
C2 = [0, 91 ] ∪ [ 29 , 31 ] ∪ [ 23 , 97 ] ∪ [ 89 , 1], etc.
The sequence is drawn up to C9 , with an animation below. To see the detail for the last few sets, try
zooming in as far as you can.
1 2
0 3 3 1
C0
∞
T
Definition 6.10. The Cantor set C is the infinite intersection C = Cn .
n =0
Zero Measure (length) Intuitively, the length of a set of real numbers is the sum of the lengths of all
the intervals contained in the set. Since we start with the interval [0, 1] and remove a third of the set
each time, it should be clear that
2
2 2
length(C0 ) = 1, length(C1 ) = , length(C2 ) = , etc.
3 3
Induction then gives us
n
2
length(Cn ) = .
3
As n → ∞ this goes to zero, so the Cantor set contains no intervals. This at least seems reasonable
from the picture.
Infinite Cardinality The Cantor set C contains the endpoints of every interval removed at any stage
of its construction. In particular, 31n ∈ C for all n ∈ N0 , and so C is an infinite set. Indeed it is more
than merely infinite, it is uncountably so, as we shall see in Chapter 8.
Self-similarity If 31 C means ‘take all the elements of C and divide them by three,’ and 31 C + 23 means
‘take all the elements of 13 C and add 32 ,’ then
C C 2
C= ∪ + . (∗)
3 3 3
172
Otherwise said, C is made up of two shrunken copies of itself, a classic property of fractals. If you
were to zoom into the Cantor set far enough that you couldn’t see the whole set, you would not know
what the scale was. In the following animation we are repeatedly zooming in on the second (of four)
groups of points.
Theorem 6.11. Cn is the set of all numbers x ∈ [0, 1] with a ternary expansion whose first n digits are only
0 or 2. It follows that C is the set of x ∈ [0, 1] with a ternary expansion containing only 0 and 2.
The Theorem tells us that the Cantor set contains a lot of elements. For example:
∞
2/9 1
[0.020202020 · · · ]3 = 2 ∑ 3−2n = 1 − 1/9 = 4
n =1
is an element of the Cantor set! What is strange is that 14 is not the endpoint of any of the open
intervals deleted during the construction of C , and yet we’ve already established that C contains no
intervals! Cantor introduced his set precisely because it was so challenging to the traditional concept
of size: C seems to simultaneously have very few elements and enormously many.
∞
21 Analogous a1 a2 a3
to a decimal representation x = ∑ 10−n an = 10 + 102
+ 103
+ · · · where an ∈ {0, 1, 2, . . . , 9}.
n =1
22 This is ticklish to prove, as is the corresponding result for decimals: compare with 1 = 0.99999999 · · ·
173
Proof. We prove by induction.
(Base Case) The proposition is clearly true for C0 = [0, 1], as there is nothing to check.
(Induction Step) Assume that the proposition is true for some fixed n ∈ N0 . Analogously to (∗)
above, observe that Cn+1 is built from two shrunken copies of Cn :
1 1 2
Cn+1 = Cn ∪ Cn + .
3 3 3
2
Now consider what division by 3 and addition of 3 does to a ternary representation.
• Since 31 ∑∞
n =1 3
−n a = ∞ 3−n−1 a , we see that multiplication by
n ∑ n =1 1
1
3 shifts a ternary representa-
tion one position to the right.a
1
[0.a1 a2 a3 . . .]3 = [0.0a1 a2 a3 . . .]3
3
2
• Since 3 = [0.2]3 we see that
2 1
+ [0.a1 a2 a3 . . .]3 = [0.2a1 a2 a3 . . .]3
3 3
By the induction hypothesis, Cn contains only 0’s and 2’s in its first n entries. By moving ternary
representations one step to the right and inserting 0 or 2 in the first position, we conclude that Cn+1
contains only 0’s and 2’s in its first n + 1 entries.
By induction the proposition is true for all n ∈ N0 .
a Compare 1
to multiplication of a decimal by 10 .
Other fractal sets based on C include the Cantor dust C × C , the Sierpiński carpet and gasket, and the
von Koch snowflake.
Reading Quiz
S
6.3.1 Let I be a set and { An : n ∈ I } a family of sets indexed by I. Then the definition of n∈ I An uses
T
the quantifier and the definition of n∈ I An uses the quantifier.
6.3.2 Let I be a set and { An : n ∈ I } a collection of sets indexed by I which is nested. What can you
conclude? Select all that apply.
T
(a) n∈ I An ̸= ∅.
S
(b) n∈ I A n = A1 .
174
(c) The collection of sets is pairwise disjoint.
(d) Each An must be an interval.
Practice Problems
6.3.1 (From previous exercises) For each non-negative real number r ≥ 0 let
Ar = ( x, y) ∈ R2 : x2 + y2 = r2
Video Solution
(a)
!
[ [
An ∩B= ( An ∩ B)
n∈ I n∈ I
(b)
!
\ \
An ∪B= ( An ∪ B)
n∈ I n∈ I
Video Solution
Exercises
6.3.1 For each integer n, consider the set Bn = {n} × R.
4
S
(a) Draw a picture of Bn (in the Cartesian plane).
n =2
4
S
Hint: Bn = B2 ∪ B3 ∪ B4 .
n =2
(b) Draw a picture of the set C = [1, 5] × {−2, 2}. Careful! [1, 5] is an interval, while {−2, 2} is
a set containing two points.
S4
(c) Compute Bn ∩ C.
n =2
4
S
(d) Compute ( Bn ∩ C ).
n =2
175
4
S 4
S
(e) Compare Bn ∩ C and ( Bn ∩ C ). What do you notice?
n =2 n =2
S T
6.3.2 (a) Determine Sr and Sr , where Sr is the interval [r − 1, r + 3].
r ∈{1,3,4} r ∈{1,3,4}
S T
(b) Determine {i } and { i }.
i ∈N i ∈N
S T
(c) Determine X and X.
X ∈P (Z) X ∈P (Z)
6.3.3 Give an example of four different subsets A, B, C and D of {1, 2, 3, 4} such that all intersections
of two subsets are different.
6.3.4 Find both the union and intersection of the following indexed collections of intervals. (Hint:
Start by drawing a few sets in each collection.)
(a) { An }n∈N = [0, 2 + n] : n ∈ N}
(b) { An }n∈N = [1, 2 + 1), [1, 2 + 21 ), [1, 2 + 13 ), . . .
(c) { An }n∈N = ( −2nn+1 , 2n) : n ∈ N}
(d) { An }n∈N = ( 14 , 1), ( 81 , 12 ), ( 16
1 1 1 1
, 4 ), ( 32 1 1
, 8 ), ( 64 , 16 ), . . .
6.3.7 Use Definition 6.7 to prove the following results about nested sets.
S
(a) A1 ⊇ A2 ⊇ A3 ⊇ · · · =⇒ A n = A1 .
n ∈N
T
(b) A1 ⊆ A2 ⊆ A3 ⊆ · · · =⇒ A n = A1 .
n ∈N
6.3.8 Let C0 (R) denote the set of continuous functions f : R → R which satisfy f (0) = 0.
Let A f = { x ∈ [0, 1] : f ( x ) = 0} (so, for example, if f : R → R, x 7→ x (2x − 1), then
A f = {0, 21 }). Prove that
[ \
A f = [0, 1] and A f = {0}.
f ∈C0 (R) f ∈C0 (R)
176
∞
S
(c) Prove that An ⊆ Q.
n =1
∞
S
1
(d) Prove by contradiction that 3 ̸∈ An .
n =1
• ∀n ∈ N, An ̸= ∅.
• m ≥ n =⇒ Am ⊆ An .
293
T T
(b) An ̸= ∅ (d) An ̸= ∅
n =1 n ∈N
6.3.11 Suppose we are working in a universal set U (so every set is considered a subset of U ). Give an
T
explanation for why it makes sense to define n∈ I An = U when I = ∅.
6.3.12 Let { An : n ∈ I } and { Bn : n ∈ I } be indexed families of sets. Give explicit examples for which
the following hold:
(a)
! !
[ [ [
An ∩ Bn ̸= ( An ∩ Bn )
n∈ I n∈ I n∈ I
(b)
! !
\ \ \
An ∪ Bn ̸= ( An ∪ Bn )
n∈ I n∈ I n∈ I
6.3.13 (De Morgan’s laws) Let { An : n ∈ I } be an indexed family of sets and B a set. Prove
(a)
!
[ \
B\ An = ( B \ An )
n∈ I n∈ I
(b)
!
\ [
B\ An = ( B \ An )
n∈ I n∈ I
177
(a)
!
[ [
An \B= ( An \ B)
n∈ I n∈ I
(b)
!
\ \
An \B= ( An \ B)
n∈ I n∈ I
6.3.15 We can take the Cartesian product of arbitrarily many sets. Let { An : n ∈ I } be a family of sets.
Define
( )
[
∏ An = f :I→ An f (n) ∈ An .
n∈ I n∈ I
(a) If I = N and An = R for each n ∈ N, can you give a more intuitive description of the
elements of ∏n∈N An ?
(b) Suppose we have two families { An : n ∈ I } and { Bn : n ∈ I }. Prove
! !
∏ An ∩ ∏ Bn = ∏ ( An ∩ Bn )
n∈ I n∈ I n∈ I
6.3.17 In this question we construct a fractal shape, similar to the von Koch curve. Let F0 = [0, 1] be a
straight line of length 1. Delete the segment between 12 and 34 to obtain the set
F1 = [0, 21 ] ∪ [ 43 , 1]
Now repeat: delete the third quarter of each of the two line segments in F1 to obtain
F2 = [0, 14 ] ∪ [ 83 , 12 ] ∪ [ 43 , 78 ] ∪ [ 15
16 , 1]
178
∞
T
(b) Prove by contradiction that the intersection Fn does not contain any intervals of posi-
n =1
tive length.
(c) Now suppose that instead of simply deleting the third quarter of each line segment at
each step, we replace it with the other three sides of a square. The first three steps in this
process are shown below.
(e) Repeat parts (c) and (d) for the area under the curve at each step. Prove that the area
between the fractal curve and the x-axis is 18 .
6.3.18 Let X be a set. A collection of sets τ ⊆ P ( X ) is called a topology if the following conditions are
satisfied:
(1) ∅ ∈ τ and X ∈ τ;
(2) τ is closed under arbitrary union. That is, if {Un : n ∈ I } ⊆ τ for any index set I, then
S
n∈ I Un ∈ τ;
(3) τ is closed under finite intersection. That is, if U1 , . . . , Un ∈ τ for any n ∈ N, then U1 ∩
· · · ∩ Un ∈ τ.
Elements of τ are called open sets.
(a) Let X = { a, b, c, d}. Let τ1 = {∅, X }, τ2 = P ( X ), τ3 = {∅, {d}, { a, b}, {b, c}, { a, b, c}, X },
and τ4 = {∅, {b}, { a, b}, {b, c}, { a, b, c}, X }. Show τ1 , τ2 and τ4 are topologies while τ3 is
not.
(b) Let X be an infinite set and define τ = { A ∈ P ( X ) : X \ A is finite} ∪ {∅}. Show τ is a
topology.
179
(c) The standard topology τ on R can be defined by declaring that a set U ⊆ R is open (i.e.
an element of τ) if and only if for every x ∈ U, there is an open interval ( a, b) such that
x ∈ ( a, b) and ( a, b) ⊆ U. Show this defines a topology on R.
6.3.19 Let X be a set and τ a topology on X. A set C ⊆ X is called closed if its complement is open, i.e.,
if X \ C ∈ τ.
180
7 Relations and Partitions
The mathematics of sets is rather basic, at least until one has a notion of how to relate elements of
sets to each other. We are already familiar with examples of this:
7.0.1 The usual order of numbers (e.g. 3 < 7) is a way of relating/comparing two elements of R.
It turns out that the concept of ordered pair (Cartesian product) is essential to relating elements.
7.1 Relations
Definition 7.1. Let A and B be sets. A (binary) relation R from A to B is a set of ordered pairs
R ⊆ A × B.
Examples. 7.1.1 R = {(1, 3), (2, 2), (2, 3), (3, 2), (4, 1), (5, 2)} is a relation from N to N. It is also a
relation from {1, 2, 3, 4, 5} to {1, 2, 3}. Various true statements about this relation include
(2, 2) ∈ R, (4, 2) ̸∈ R, 2R
̸ 5, 3R2
7.1.2 R = [1, 3) × (3, 4] ∪ (2t + 1, t2 ) : t ∈ [ 21 , 2] is a relation from R to R. Be careful: it is easy
to confuse interval notation with the notation for ordered pair!
( x, y) ∈ R ⇐⇒ x = y
defines a relation on any set A. This example is where the term equivalence relation (Section 7.3)
comes from. x R y ⇐⇒ x = y simply says that R is ‘equals.’
In this example, the mathematical use of the word relation is identical to that in English. For
example, I am related to my sister, and my mother is related to me.
181
When R is a relation between sets of numbers, we can often graph the relation. Examples 1 and 2
above would be graphed as follows:
N R
5 5
4 4
3 3
2 2
1 1
0
1 2 3 4 5 0 1 2 3 4 5
N R
Example 1. Example 2.
Not all relations between sets of numbers can be graphed: for example, graphing the relation R =
Q × Q is impossible!
To find the elements of R−1 , you simply switch the components of each ordered pair in R.
Suppose A = B. We say that R is symmetric if R = R−1 .
The following results should seem natural, even if some of the proofs may not be obvious.
182
Theorem 7.3. Given any relations R, S ⊆ A × B:
7.1.2 R ⊆ S ⇐⇒ R−1 ⊆ S −1
Proof. Here are two of the arguments. Try the others yourself.
2. Assume that R ⊆ S , and suppose that ( x, y) ∈ R−1 . We must prove that ( x, y) ∈ S −1 . By the
definition of inverse,
Therefore R−1 ⊆ S −1 . For the converse, suppose that R−1 ⊆ S −1 . Then, by an argument
similar to the above, we see that (R−1 )−1 ⊆ (S −1 )−1 . Now use 1. to see that
R−1 ⊆ S −1 =⇒ R ⊆ S .
5. By 3,
Keep your proof skills sharp! Several parts of Theorem 7.3 look suspiciously similar to earlier
results and it is easy to get confused. For example, 3 and 4 look almost like De Morgan’s laws, except
that ∪ and ∩ do not switch over. This is why it is important to be able to conjure up examples and
prove such statements. There are many facts in mathematics: trying to memorize everything is too
difficult! Instead, you will be forever conjecturing and having to justify your guesses. For example,
suppose that you forget results 3 and 4: it seems reasonable to conjecture that
−1 −1
R ∪ S
(R ∪ S)−1 = or
−1
R ∩ S −1
Now that you have two sensible guesses, you should be able to decide the correct one by thinking
about examples and, if necessary, proving your assertion!
183
Example. Consider Example 1 from before: R = {(1, 3), (2, 2), (2, 3), (3, 2), (4, 1), (5, 2)} ⊆ N × N.
This is not symmetric since, for example, 1 R 3 but 3 R
̸ 1. We compute
R−1 = {(3, 1), (2, 2), (3, 2), (2, 3), (1, 4), (2, 5)},
N N
5 5
4 4
3 3
2 2
1 1
1 2 3 4 5 1 2 3 4 5
N N
The relation R ∩ R−1 The relation R ∪ R−1
These pictures should confirm something intuitive: if you are able to graph a symmetric relation,
then the graph will have symmetry about the line y = x. Indeed, R−1 is obtained by reflecting R in
the line y = x. Recall how to graph an inverse functions from calculus. . .
Reading Questions
7.1.1 A relation R ⊆ A × B is
7.1.2 If A ⊆ R, then the graph of a symmetric relation R ⊆ A × A has what kind of symmetry?
7.1.3 True or False: if R is symmetric, then it must contain an even number of elements.
184
Practice Problems
7.1.1 Let L a,b,c = {( x, y) : ax + by = c} ⊆ R2 .
Exercises
7.1.1 Let R be the relation on {0, 1, 2} defined by
7.1.3 Draw pictures of the following relations on the set of real numbers R.
R = {(1, 3), (1, 4), (2, 2), (2, 4), (3, 1), (3, 2), (4, 4)}.
185
(a) Compute R−1 .
(b) Compute the relations R ∪ R−1 and R ∩ R−1 , and check that they are symmetric.
7.1.7 For the relation R = {( x, y) : x ≤ y} defined on N, what is R−1 , and what is the intersection
R ∩ R −1 ?
7.1.8 Let A be a set with | A| = 4. What is the maximum number of elements that a relation R on A
can contain such that R ∩ R−1 = ∅?
7.1.9 Give formal proofs of the remaining cases (1, 3, 4 & 6) of Theorem 7.3.
7.1.11 Let R be a relation on a set A and define S = R ∪ R−1 . We know that S is symmetric. Prove
that S is the intersection of all symmetric relations on A which contain R. Otherwise said: if
n
T = T ⊆ A × A : T symmetric and R ⊆ T
then
\
S= T
T ∈T
186
7.2 Functions revisited
Now that we have the language of relations, we can properly define functions. Recall that a function
f : A → B is a rule that assigns one, and only one, element of B to each element of A. We may
therefore view f as a collection of ordered pairs in A × B:
( a, f ( a)) : a ∈ A .
This set is nothing more than the graph of the function, and, being a set of ordered pairs, it is a relation.
Definition 7.4. Let R ⊆ A × B be a relation from A to B. The domain and range of R are the sets
7.2.1 dom( f ) = A,
7.2.2 ( a, b1 ), ( a, b2 ) ∈ f =⇒ b1 = b2 .
b2
a A a A
b1 = b2 = f ( a): a function b1 ̸= b2 : not a function
We can also think about injectivity and surjectivity (recall Definition 3.14) in this context. A function
f ⊆ A × B is:
• Injective if no two pairs in f share the same second entry.
• Surjective if every b ∈ B appears as the second entry of at least one pair in f .
• Bijective if every b ∈ B appears as the second entry of one (and only one) ordered pair ( a, b) ∈ f .
187
Example. Let A = B = {1, 2, 3} and consider the relation
id A = {( a, a) : a ∈ A}.
To compute an inverse relation we simply reverse the components of each ordered pair: the following
should therefore be clear.
In general, you should expect the inverse of a function to be merely a relation and not a function in
its own right. We shall shortly (Theorem 7.7) discuss when the inverse relation is a function.
188
The inverse relation A
3
f −1 = {(3, 1), (1, 2), (3, 3)} ⊆ B × A
2
is not a function due to failing both conditions of Definition 7.4.
1
• dom( f −1 ) = {1, 3} is not the whole of B.
Before we consider exactly when the inverse of a function is a function in its own right, we consider
a few more examples.
Examples. 7.2.1 Let A = B = R and f = {( x, x2 ) : x ∈ R}. This is simply the function with formula
f ( x ) = x2 . The inverse relation f −1 ⊆ R × R is then
√
f −1 = ( x2 , x ) : x ∈ R = (y, ± y) : y ≥ 0 .
R 4 R 2
3
1
2
0
1 1 2 3 4
R
−1
−2 −1 0 1 2 −2
R
f :A→B f −1 ⊆ B × A: not a function
It should be obvious that f is neither injective nor surjective: in the language of relations,
Not injective (2, 4) and (−2, 4) are distinct elements of f with the same second entry.
Not surjective For instance, −1 never appears as the second entry of any pair in f .
Observe how these are merely a rewriting of what it means for f −1 to fail to be a function.
189
7.2.2 Let A = B = R and f = {( x, x3 ) : x ∈ R}, so that f has formula f ( x ) = x3 . This time, the
√
inverse is also a function and we could write f −1 (y) = 3 y:
√
f −1 = ( x3 , x ) : x ∈ R = (y, 3 y) : y ∈ R .
R 8 R 2
4 1
−2 −1 1 2 −8 −4 4 8
R R
−4 −1
−8 −2
f :A→B f −1 : B → A is a function
All three of our examples help to illustrate the following important result.
190
The inverse f −1 is not a function, and it fails to be so precisely because f is non-injective. For example
√ √
(0, 2) and (0, 3) are distinct elements of f −1 with the same first component.
Inverse Images Recall that in Section 3.4, we can defined the preimage of a subset V ⊆ B under a
function f : A → B by
f −1 ( V ) = { a ∈ A : f ( a ) ∈ V } .
In particular, if {b} ⊆ B has only one element, then its preimage is
f −1 ({b}) = { a ∈ A : f ( a) = b}.
Both are subsets of A. For instance, in the last example the preimage of {0} consists of zero and all
irrational numbers!
f −1 ({0}) = {0} ∪ (R \ Q)
When f −1 ⊆ B × A is a function, each preimage of a singleton consists of one point of A: thus
f −1 ({b}) = { a}. Only in such a case are we entitled to write f −1 (b) = a.
Same domain, same graph, same codomain f = g means that f and g are the same subset of the
same A × B. This notion is preferred by set theorists because it sticks rigidly to the idea that a
function is a relation, and it requires both the domain A and codomain B to be explicit.
( a, b) ∈ f ⇐⇒ ( a, b) ∈ g.
This notion considers what a function does to be fundamental; if two functions do the same
thing to elements of the same domain then they are the same. This looser notion of equality is
used more often, especially in elementary calculus.
The second conception of equality, while intuitive, has a problem. For example, let
Although f and g have the same graph, the different codomains of f and g mean that these are dif-
ferent functions with respect to the first notion. Under the second notion, they are the same function.
However, g is surjective while f is not, so wouldn’t we prefer f and g to be non-equal?a
The same problem does not arise when considering domains. For example, in calculus you might
have compared functions such as
( x2 + 2)( x − 1)
f ( x ) = x2 + 2, and g( x ) = .
x−1
191
The implied domains of these functions are dom( f ) = R and dom( g) = R \ {1}. Even though these
have the same graph whenever both are defined, regardless of which notion you choose we have
f ̸= g, since the functions have different domains.
a In elementary calculus, we usually say that a function is invertible if it is 1–1. In order for this to make sense, we have
Reading Questions
7.2.1 What does it mean for a relation R ⊆ A × B to be a function? Select all that apply.
(a) dom(R) = A
(b) range(R) = B
(c) for any a ∈ A, if ( a, b1 ), ( a, b2 ) ∈ R, then b1 = b2
(d) for any b ∈ range(R), if ( a1 , b), ( a2 , b) ∈ R, then a1 = a2
(a) injectivity
(b) surjectivity
(c) dom( f ) = A
(d) f is a symmetric relation.
7.2.3 True or False: a relation R has a domain and range if and only if it is a function.
Practice Problems
7.2.1 Let f : A → A be a function. Viewing f as a relation, if f is symmetric, what can be said about
f?
Exercises
7.2.1 Suppose that f ⊆ {1, 2, 3, 4} × {1, 2, 3, 4, 5, 6, 7} is the relation
(a) Show that f is a function f : {1, 2, 3, 4} → {1, 2, 3, 4, 5, 6, 7}. Can you find a concise formula
f ( x ) to describe f ?
(b) Is f injective? Justify your answer.
192
(c) Suppose that g ⊆ {1, 2, 3, 4} × B is another relation so that the graphs of f and g are iden-
tical: i.e.
( a, f ( a)) : a ∈ {1, 2, 3, 4} = ( a, g( a)) : a ∈ {1, 2, 3, 4} .
7.2.2 Decide whether each of the following relations are functions. For those which are, decide
whether the function is injective and/or surjective.
7.2.3 In Example 2 on page 190, explain why the function f is both injective and surjective using the
language of relations: i.e., in the same manner as we analyzed Example 1.
7.2.4 Find a function f : R → R such that simultaneously satisfies: (1) f ( x ) ̸= x for all x ∈ R and (2)
f = f −1 . Is it possible to find such a function from {1, 2, 3} → {1, 2, 3}?
7.2.5 For each of the examples on page 190, compute the following preimages:
(a) Prove that f is surjective if and only if f −1 ({b}) has at least one element, for all b ∈ B.
(b) Prove that f is injective if and only if f −1 ({b}) has at most one element, for all b ∈ B.
(c) Prove that f is bijective if and only if f −1 ({b}) has exactly one element, for all b ∈ B.
f −1 (U ∩ V ) = f −1 (U ) ∩ f −1 ( V )
193
7.2.11 Let A and B be nonempty and f : A → B be a function.
(a) Prove that f is surjective if and only if there is g : B → A such that f ◦ g = idB .
(b) Prove that f is injective if and only if there is h : B → A such that h ◦ f = id A .
(a) Prove that f is surjective if and only if for all sets C and functions g, h : B → C, g ◦ f = h ◦ f
implies g = h.
(b) Prove that f is injective if and only if for all sets C and functions g, h : C → A, f ◦ g = f ◦ h
implies g = h.
194
7.3 Equivalence Relations
In mathematics, the notion of equality is not as simple as one might think. The idea of two numbers
being equal is straightforward, but suppose we want to consider two paths between given points as
‘equal’ if and only if they have the same length? Since two ‘equal’ paths might look very different,
is this a good notion of equality? Mathematicians often want to gather together objects that have a
common property and then treat them as if they were a single object. This is done using equivalence
relations and equivalence classes.
First recall the alternative notation for a relation on a set A: if R ⊆ A × A is a relation on A, then
x R y has the same meaning as ( x, y) ∈ R. We might read x R y as ‘x is R-related to y.’
Examples. 7.3.1 Let A = R and let R be ≤. Thus 2 ≤ 3, but 7 ≰ 4. We check whether R satisfies the
above properties.
Reflexivity True. ∀ x ∈ R, x ≤ x.
Symmetry False. For example, 2 ≤ 3 but 3 ≰ 2.
Transitivity True. ∀ x, y, z ∈ R, if x ≤ y and y ≤ z, then x ≤ z.
7.3.2 Let A be the set of lines in the plane and define ℓ1 R ℓ2 ⇐⇒ ℓ1 and ℓ2 intersect.
Reflexivity True. Every line intersects itself, so ℓ R ℓ for all
ℓ ∈ A.
`3
Symmetry True. For all lines ℓ1 , ℓ2 ∈ A, if ℓ1 intersects ℓ2 ,
then ℓ2 intersects ℓ1 .. `2
Transitivity False. As the picture illustrates, we may let ℓ1 `1
and ℓ3 be parallel lines, and ℓ2 cross both of
these. Then ℓ1 R ℓ2 and ℓ2 R ℓ3 , but ℓ1 R
̸ ℓ3 .
Definition 7.9. An equivalence relation is a relation ∼ which is reflexive, symmetric and transitive.
The symbol ∼ is almost universally used for an abstract equivalence relation. It can be read as ‘related
to,’ ‘tilde,’ or ‘twiddles.’ The two examples above are not equivalence relations because they fail one
of the three conditions. We now exhibit the simplest equivalence relation.
195
Example. Equals ‘=’ is an equivalence relation on any set, hence the name!
Read the definitions of reflexive, symmetric and transitive until you are certain of this fact. There are
countless other equivalence relations: here are a few.
x ∼ y ⇐⇒ x − y is even.
7.3.2 Let A = {all students taking this course}. For all x, y ∈ A, let
∀ x, y ∈ Z, x ∼ y ⇐⇒ x2 ≡ y2 (mod 5).
The most important thing to observe in each of these examples is that an equivalence relation sep-
arates elements of a set into subsets where elements share a common property (even/oddness,
letter-grade, etc.). The next definition formalizes this idea.
196
Definition 7.10. Let ∼ be an equivalence relation on a set X. The equivalence class of an element
x ∈ X is the set
[ x ] = { y ∈ X : y ∼ x }.
Otherwise said, y ∼ x ⇐⇒ y ∈ [ x ]. The set of all equivalence classes is known as the quotient of X
by ∼ or simply ‘X mod ∼,’ and is denoted
n o
X = [ x ] : x ∈ X
∼
Let us think about the definition of equivalence class in the context of our previous examples.
Examples. 7.3.1 [0] = {y ∈ Z : y ∼ 0} = {y ∈ Z : y is even} is the set of even numbers. Note that
[0] = [2] = [4] = [6], etc. The other equivalence class is [1] = {y ∈ Z : y − 1 is even}, which is
the set of odd numbers. The quotient set is
Z = [0], [1] = {even numbers}, {odd numbers} .
∼
7.3.2 There is one equivalence class for each letter grade awarded. Each equivalence class con-
tains all the students who obtain a particular letter-grade. If we call the equivalence classes
A+ , A, A− , B+ , . . . , F, where, say, B = {students obtaining a B-grade}, then
{Students} = {A+ , A, A− , B+ , . . . , F}.
∼
7.3.3 The equivalence classes for this example are a little tricky. First observe that
so that there are at most five equivalence classes; those of 0, 1, 2, 3 and 4. Are they distinct? If
we square each of these and consider the remainder modulo 5, we obtain
x (mod 5) 0 1 2 3 4
x2 (mod 5) 0 1 4 4 1
Notice that 1 ∼ 4, so they share an equivalence class. Similarly 2 ∼ 3. Indeed the distinct
equivalence classes are
197
Here is one further example of an equivalence relation, this time on R2 . Be careful with the notation:
R2 = R × R is already a Cartesian product, so a relation on R2 is a subset of R2 × R2 !
w
This isn’t particularly helpful. Indeed it is easier to think of 1
each of these sets as
n o
(v, w) ∈ R2 : v2 + w2 is constant .
Reading Quiz
7.3.1 True or False: a relation ∼ on a set X is reflexive if ∃ x ∈ X such that x ∼ x.
7.3.2 Suppose that x, y, z ∈ X and ∼ is an equivalence relation on X. Express each of the following
assertions in terms of the properties satisfied by an equivalence relation.
198
(d) (1) is transitivity, (2) is reflexivity, and (3) is symmetry
(a) never
(b) sometimes
(c) always
Practice Problems
7.3.1 Define R on N≥2 by a R b if and only if gcd( a, b) > 1. Determine whether or not R is reflexive,
symmetric, or transitive.
Exercises
7.3.1 A relation R is antisymmetric if (( x, y) ∈ R) ∧ ((y, x ) ∈ R) =⇒ x = y. Give examples of
relations R on A = {1, 2, 3} having the stated property.
7.3.2 A relation R on a set X is called a partial order if it is reflexive, antisymmetric, and transitive.
Show the divisibility relation | is a partial order on N.
7.3.4 Each of the following relations ∼ is an equivalence relation on R2 . Identify the equivalence
classes and draw several of them.
199
7.3.6 For each of the following relations R on Z, decide whether R is reflexive, symmetric, or tran-
sitive, and whether R is an equivalence relation.
7.3.7 For the purposes of this question, we call a real number x small if | x | ≤ 1. Let R be the relation
on the set of real numbers defined by
x R y ⇐⇒ x − y is small.
7.3.8 Let A = {1, 2, 3, 4, 5, 6}. The distinct equivalence classes resulting from an equivalence relation
∼ on A are {1, 4, 5}, {2, 6}, and {3}. What is ∼? Give your answer as a subset of A × A.
7.3.9 ⊆ is a relation on any set of sets. Is ⊆ reflexive, symmetric, transitive? Prove your assertions.
7.3.10 Let S be the set of all polynomials of degree at most 3. An element s ∈ S can then be expressed
as
A relation R on S is defined by
7.3.11 Let A = {2m : m ∈ Z}. A relation ∼ is defined on the set Q+ of positive rational numbers by
a
a ∼ b ⇐⇒ ∈A
b
(a) Show that ∼ is an equivalence relation.
(b) Describe the elements in the equivalence class [3].
√ √ x
7.3.12 A relation is defined on the set A = { a + b 2 : a, b ∈ Q, a + b 2 ̸= 0} by x ∼ y ⇐⇒ y ∈ Q.
Show that ∼ is an equivalence relation and determine the distinct equivalence classes.
200
(b) Describe the equivalence classes of ∼.
(c) Show that f is injective if and only if ∼ is equality.
(a) S is reflexive.
(b) R ⊆ S .
(c) If T is a reflexive relation on X such that R ⊆ T , then S ⊆ T .
7.3.17 Recall the description of the real projective line (page 170): if Am is the line through the origin
with gradient m, then
P(R2 ) = { Am : m ∈ R ∪ {∞}}.
7.3.18 Let X be a set. Suppose we have a function cl : P ( X ) → P ( X ) which satisfies the following
properties:
7.3.19 Suppose that R, S are relations on some set X. Define the composition R ◦ S to be the relation
(a) If R = {(1, 1), (1, 2), (2, 3), (3, 1), (3, 3)} and S = {(1, 2), (1, 3), (2, 1), (3, 3)}, find R ◦ S .
(b) Suppose that R and S are reflexive. Prove that R ◦ S is reflexive.
(c) Suppose that R and S are symmetric. Prove that ( x, y) ∈ R ◦ S ⇐⇒ (y, x ) ∈ S ◦ R.
201
(d) Give an example of symmetric relations R, S such that R ◦ S is not symmetric. Conclude
that if R, S are equivalence relations, then R ◦ S need not be an equivalence relation.
• R1 = R
• R n +1 = R ◦ R n .
Set
[
R+ = Rn .
n ∈N
(a) R+ is transitive.
(b) R ⊆ R+ .
(c) If T is a transitive relation on X such that R ⊆ T , then R+ ⊆ T . [Hint: use induction to
show Rn ⊆ T for all n ∈ N.]
7.3.21 (Only for those who have studied Linear Algebra) Let ∼ be the relation on the set of 2 × 2 real
matrices given by A ∼ B ⇐⇒ ∃ M such that B = MAM−1 .
202
7.4 Partitions
Recall the important observation about our equivalence relation examples: every element of the orig-
inal set of objects ends up in exactly one equivalence class. For instance, every integer is either even or
odd but not both. The equivalence classes partition the original set in the same way that cutting a
cake partitions the crumbs: each crumb ends up in exactly one slice. We shall prove in a moment that
equivalence relations always do this. Before doing so we reverse the discussion.
The conditions can be viewed as saying that every element of X lies in (1.) at least one subset An and
(2.) at most one subset An : otherwise said, every element of X lies in exactly one subset.
R = {(1, 1), (1, 3), (3, 1), (3, 3), (2, 2), (2, 4), (4, 2), (4, 4), (5, 5)}.
What does R have to do with the partition? It should be clear that R could be defined by insisting
that
Run through your mental checklist: is R reflexive? symmetric? transitive? Indeed R is an equiv-
alence relation! Moreover, the equivalence classes of R are precisely the sets A1 , A2 and A3 . For
instance, 1 is related to itself and 3, but isn’t related to anything else. Indeed
The example suggests that partitioning a set defines a natural equivalence relation. Combining this
with our observations in the previous section and you should be starting to believe that partitions and
equivalence relations are essentially the same thing. Before we prove this important fact, here are some
further examples of partitions.
203
Examples. 7.4.1 The integers can be partitioned according to their remainder modulo 3: define
Ar = {z ∈ Z : z ≡ r (mod 3)}.
7.4.2 More generally, if n ∈ N, then the set of integers Z is partitioned into n sets A0 , . . . , An−1 where
Ar = { z ∈ Z : z ≡ r (mod n)}
is the set of integers with remainder r upon dividing by n. We are appealing to the Divi-
sion Algorithm (Theorem 4.2) which tells us that every integer z has a unique remainder r ∈
{0, 1, . . . , n − 1}.
7.4.3 The set of real numbers R is partitioned into the sets of rational and irrational numbers: R =
Q ∪ (R \ Q).
R = {(1, 3), (1, 4), (2, 2), (2, 3), (3, 1), (3, 2), (4, 3), (4, 4)}.
An = { x ∈ X : (n, x ) ∈ R}.
Thus An is the set of all elements of X which are related to n. We quickly see that
where we only have three sets in the collection since A4 = A1 . This collection is not a partition
because, for instance, 2 ∈ {2, 3} ∩ {1, 2}. In the language of Definition 7.11, we have
More importantly, you should convince yourself that R is not an equivalence relation.
204
Equivalence Relations and Partitions
Before we present the fundamental result of the chapter, we prove a helpful lemma.
Proof. (⇐) By reflexivity, x ∈ [ x ]. If [ x ] = [y], then we have x ∈ [y]. Finally, recalling Definition
7.10, we see that that this is the same as saying x ∼ y.
(⇒) Suppose that x ∼ y. We begin by showing the inclusion [ x ] ⊆ [y]. Let z ∈ [ x ], then
Therefore [ x ] ⊆ [y]. By symmetry, we also have y ∼ x: repeating the argument yields [y] ⊆ [ x ],
and thus [ x ] = [y].
is an equivalence relation.
b c b
c A2
A1
a a
X partition A3
A5
A4
Each element of X ends up in exactly one subset. In the language of the Theorem, we have
A1 = [ a ], A2 = [ b ] = [ c ], b ∼ c, a ≁ b, a ≁ c.
• Think about the picture! The result is nothing more than the notion of partitioning a cake by
cutting it into slices. The slices are the equivalence classes of the obvious relation: two crumbs
are related if and only if they lie in the same slice. The algebra that follows merely confirms
that the picture is telling a legitimate story.
205
• In part 1. of the proof, look for where the reflexive, symmetric and transitive assumptions about
∼ are used. Why do we need ∼ to be an equivalence relation? Why does the proof fail if any of
the three assumptions are dropped?
• Similarly, in part 2., look for where we use both parts of the definition of partition. Why are
both assumptions required?
Proof. 7.4.1 Assume that ∼ is an equivalence relation on X. To prove that the equivalence classes of
∼ partition X, we must show two things:
(a) That every element of X is in some equivalence class.
(b) That the distinct equivalence classes are pairwise disjoint: if [ x ] ̸= [y], then [ x ] ∩ [y] = ∅.
For (a), we only need reflexivity: ∀ x ∈ X we have x ∼ x. Otherwise said, x ∈ [ x ], whence every
element of X is in the equivalence class defined by itself.
For (b), we prove by the contrapositive method and show that [ x ] ∩ [y] ̸= ∅ =⇒ [ x ] = [y].
Assume that [ x ] ∩ [y] ̸= ∅. Then ∃z ∈ [ x ] ∩ [y]. This gives
Reading the proof carefully, you should see that reflexivity in part 2. comes from the fact that X =
S
An , while transitivity is due to the pairwise disjointness of the pieces of the partition. Symmetry
n∈ I
is essentially free because the definition of ∼ is symmetric in x and y.
The ability to partition sets and view the resulting subsets as individual objects is crucial to advanced
mathematics. The importance of the Theorem comes from the fact that equivalence relations provide
a straightforward algebraic method of working with partitions.
206
Geometric Examples
The language of equivalence relations and partitions is used heavily in geometry and topology to
describe complex shapes. We finish this section with several examples. Since examples of partitions
are especially easy to visualize with curves in the plane, we first return to the example on page 198
and describe things in our new language.
By Theorem 7.13 this is an equivalence relation. We can also check explicitly: dropping any mention
of the radius r, we see that
( x, y) ∼ (v, w) ⇐⇒ x2 + y2 = v2 + w2 .
This is exactly the equivalence relation described on page 198. The equivalence classes are precisely
the sets Ar . Indeed for a given point (v, w),
The Möbius Strip Take a rectangle, for example X = [0, 6] × [0, 1], and partition into the following
subsets.
• If a point does not lie on the left or right edge of the rectangle, place it in a subset by itself:
{( x, y)} for x ̸= 0, 6,
• If a point does lie on the left or right edge of the rectangle, place it in a subset with one point
from the other edge: {(0, y), (6, 1 − y)} for any y.
The rectangle is drawn below, where the points on the left and right edges are colored red. The ar-
rows indicate how the edges are paired up. For example the point (0, 0.8) (high on the left near the
tip of the arrow) is paired with (6, 0.2) (low on the right edge of the rectangle).
207
These subsets clearly partition the rectangle X. The partitions define an equivalence relation ∼ on
X in accordance with Theorem 7.13. Note that there are infinitely many equivalence classes. The
question is how we should interpret the quotient set X ∼ ?
This is easier to visualize than you might think. Since each point on the left edge of the rectangle lies
in an equivalence class with a point on the right edge, we imagine gluing the two edges together in
such a way that the corresponding points touch. In the picture, we imagine holding X like a strip
of paper, giving it a twist, and then gluing the edges together. This is the classic construction of a
Möbius strip. The advantage of the quotient set calculation is that it is very easy to work with points
in the original rectangle. As long as you permanently assume that equivalent points of the rectangle
correspond to the same point of the Möbius strip you can easily work only in the rectangle.
The Cylinder We could construct a cylinder similarly to the Möbius strip, by identifying edges of
the rectangle but without applying the half-twist. Instead we do something a little different.
( a, b) ∼ (c, d) ⇐⇒ a − c ∈ Z and b = d.
The equivalence classes are horizontal strings of points with the same y co-ordinate. If we imagine
wrapping R2 repeatedly around a cylinder of circumference 1, all of the points in a given equivalence
2
class will now line up. The set of equivalence classes R ∼ can therefore be visualized as a cylinder.
Alternatively, you may imagine piercing a roll of toilet paper and unrolling it. The single punc-
ture now becomes a row of (almost!23 ) equally spaced holes.
In the picture, the left hand side is (part of) the plane R2 , displayed so that points in each equiva-
lence class have the same height and color. The three horizontal dots all lie in the same equivalence
class. When we roll up the plane, all three points end up at the same point on the cylinder.
23 Unfortunately for the analogy, toilet paper has purposeful thickness!
208
y
wrap
around
0 1 x
More complex shapes can be created by other partitions/relations. If you want a challenge in
visualization, consider why the equivalence relation
( a, b) ∼ (c, d) ⇐⇒ a − c ∈ Z and b − d ∈ Z
Reading Quiz
7.4.1 Which of the following statements are true? Select all that apply.
(a) If X is partitioned into the equivalence classes of some equivalence relation ∼, then each
element of X lies in some equivalence class [ x ].
(b) Suppose that X is partitioned into subsets and that x, y, z ∈ X. If x, y lie in the same
subset, and y, z lie in the same subset of the partition, then it is possible for x and z to lie
in different subsets.
(c) {∅, { a}, {b, c}} is a partition of { a, b, c}.
(d) Every subset in a partition of a set must have the same size.
7.4.2 Which of the following describe the relationship between partitions and equivalence relations?
Select all that apply.
209
Practice Problems
7.4.1 Let X be a nonempty set. Then { X } and {{ x } : x ∈ X } are both partitions of X. For both
partitions, determine the equivalence relation whose equivalence classes form the subsets of
the partition.
7.4.2 For each of the collections, determine whether the collections partition R2 . Justify your an-
swers, and sketch several of the sets An .
(a) An = ( x, y) ∈ R2 : y = 2x + n , for n ∈ Z.
(b) An = ( x, y) ∈ R2 : y = x2 + n , for n ∈ R.
(c) An = ( x, y) ∈ R2 : y = cos( x − n) , for n ∈ R.
Exercises
7.4.1 For each of the collections { An : n ∈ R}, determine whether the collections partition R2 . Justify
your answers, and sketch several of the sets An .
(a) An = ( x, y) ∈ R2 : y = 2x + n .
(b) An = ( x, y) ∈ R2 : y = ( x − n)2 .
(c) An = ( x, y) ∈ R2 : xy = n .
(d) An = ( x, y) ∈ R2 : y4 − y2 = x − n .
If Jane and Tom had both had the same breakfast and lunch, then AJane = ATom so there are likely many
fewer distinct sets A x than there are humans!
7.4.3 Let X = {1, 2, 3}. Define the relation R = (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (3, 1), (3, 3) on X.
Some of the sets A1 , A2 , A3 might be the same in each of your examples. If, for example, A1 = A3 , then
the collection { A1 , A2 , A3 } only contains two sets: { A1 , A2 }. Is this a partition? Compare with the
example on page 204.
210
7.4.4 For each of the following, give an example of an infinite set X and an equivalence relation ∼ on
X such that
7.4.6 Using the equivalence relation description of the Möbius strip, prove that you may cut a Möbius
strip round the middle and yet still end up with a single loop.
Where would you cut the defining rectangle and how can you tell that you still have one piece?
7.4.7 (Hard!) A Klein bottle can be visualized as follows. Define an equiva-
lence relation ∼ on the unit square X = [0, 1] × [0, 1] so that:
• ( x, 0) ∼ (1 − x, 1) for 0 ≤ x ≤ 1.
The result is the picture: the blue edges are identified in the same di-
rection and the red edges in the opposite. Attempting to visualize this
in 3D requires a willingness to stretch and distort the square, but re-
sults in the green bottle. The original red and blue arrows have be-
come curves on the bottle. If you are using Acrobat Reader, click on
the bottle and move it around.
(a) Suppose you cut the Klein bottle along the horizontal dashed line
of the defining square. What is the resulting object? What hap-
pens to the green bottle?
(b) Now cut the square along the vertical dashed line. What do you
get this time?
Can you visualize where the two dashed lines are on the green bottle?
211
7.5 Well-definition, Rings and Congruence
We return to our discussion of congruence (recall Section 4.1) in the context of equivalence relations
and partitions. The important observation is that congruence modulo n is an equivalence relation on Z,
each equivalence class being the set of all integers sharing a remainder modulo n.
The theorem is a restatement of Example 2 on page 204, in conjunction with Theorem 7.13. You
should prove this yourself, as practice in using the definition of equivalence relation.
The equivalence classes are precisely those integers which are congruent modulo n: the integers
which share the same remainder.
[ a] = x ∈ Z : x ≡ a (mod n)
= x ∈ Z : x has the same remainder as a when divided by n
= x ∈ Z : x − a is divisible by n
In this language, we can restate what it means for two equivalence classes to be equal.
If the meaning of any of the above is unclear, re-read the previous two sections: they are critically
important!
The equivalence classes of ∼n partition the integers Z. According to Theorem 7.15, there are exactly
n equivalence classes, whence we may describe the quotient set as
Z = [0], [1], . . . , [n − 1] .
∼n
We use this set to define an extremely important object.
Definition 7.16. Define operations +n and ·n on the set Z ∼ as follows:
n
[ x ] + n [ y ] : = [ x + y ], [ x ] · n [ y ] : = [ x · y ].
The ring Zn is the set Z ∼ together with the operations +n and ·n .
n
The operation +n is telling us how to add equivalence classes, that is, how to produce a new equiva-
lence class from two old ones. It is important to understand that +n is not the same operation as +:
we are defining +n using +. The former combines equivalence classes, while the latter sums integers.
The operation ·n similarly tells us how to multiply equivalence classes. The challenge here is that you
have to think of each equivalence class as a single object.
212
Example. When we write
we are thinking about the equivalence classes [3] and [6] as individual objects rather than as collec-
tions of elements: remember that [3] = {. . . , −5, 3, 11, 19, . . .} is an infinite set! There is, moreover, a
matter of choice: since, for example, [3] = [11] and [6] = [22] we should be able to observe that
Is this true? If not, then the operation +8 would not be particularly useful. Thankfully this is not a
problem: according to the definition of +8 , we have
Let us think a little more abstractly. Suppose we are given equivalence classes X and Y, how do
we compute X +n Y? Here is the process.
The issue is that there are infinitely many possibilities for the elements x ∈ X and y ∈ Y chosen at step
1. If +n is to make sense, we must obtain the same equivalence class [ x + y] regardless of our choices
of x ∈ X and y ∈ Y.
Definition 7.17. A concept is well-defined if it is independent of all choices used in the definition.
The choices made in the definitions of +n and ·n were of representative elements x and y of the
equivalence classes [ x ] and [y]. All representatives of these classes have the form
x + kn ∈ [ x ] and y + ln ∈ [y]
213
Proof. We prove that +n is well-defined.
You should re-read Theorem 4.8 until you are comfortable that we are doing the same thing!
When using this description of Zn , you should realize that we are working with equivalence classes,
not numbers. In this context, −3 ∈ Z8 makes perfect sense, for it really means [−3] ∈ Z8 . This
is perfectly fine, since [−3] = [5] as equivalence classes, whence it is legitimate to write −3 = 5
in Z8 . Until you are 100% sure that you know when 3 represents an equivalence class and when it
represents a number, you should keep the brackets in place: in particular it might be a good idea to
keep using them until you have passed this course!
Reading Quiz
7.5.1 Which of the following are true and which false?
[ x ] + [y] = [z] ⇐⇒ x + y = z.
Practice Problems
7.5.1 Suppose gcd( a, n) = 1. Show that there exists b such that [ a] · [b] = [1] in Zn .
7.5.2 (a) Show that gcd( a, n) = 1 if and only if there exist m and k such that ma + kn = 1.
(b) Use part (a) to prove that if there is b such that [ a] · [b] = [1] in Zn , then gcd( a, n) = 1.
214
Exercises
7.5.1 (a) Explicitly check that [7] + [21] = [98] + [−5] in Z13 .
(b) Suppose that [5] · [7] = [8] · [9] makes sense. Find the value of n if we are working in the
ring Zn .
7.5.2 (a) Prove the second half of Theorem 7.18, that ·n is well-defined.
(b) Prove by induction that the operation of raising to the power m ∈ N is well-defined in Zn .
I.e., prove that
∀m ∈ N, ∀[ x ] ∈ Z ∼ we have [ x m ] = [ x ]m .
n
Be careful! n is fixed, your induction variable is m. What base case(s) do you need?
7.5.3 Suppose that p is prime and that in Z p , we have [ a] ̸= [0]. Show [ a]2 ̸= [0]. [Hint: See Exercise
5 in Section 5.4.]
( a, b) ∼ (c, d) ⇐⇒ ad = bc.
[( a, b)] ⊕ [(c, d)] = [( ad + bc, bd)], [( a, b)] ⊗ [(c, d)] = [( ac, bd)].
Try to do this question without using division! We will return to this example in the next section.
215
7.6 Functions and Partitions
To complete our discussion of partitions and equivalence relations, we consider how to define a func-
tion whose domain is a set of equivalence classes. We take congruence as our motivating example.
Suppose we want to define a function f : Z4 → Z6 . Say f ( x ) = 3x (mod 6). This certainly looks
like a function, but is it? Remember that ‘x’ and ‘3x’ are really equivalence classes, so we should say24
f [ x ]4 = [3x ]6 , where [ x ]4 ∈ Z4 and [3x ]6 ∈ Z6 .
Is this a function? To make sure, we need to check that any representative a ∈ [ x ]4 gives the same
result. That is, we need to prove that
But this is simply not true: for example 4 ≡ 0 (mod 4), but 8 ̸≡ 0 (mod 6). It might look like g is a
function, but it is not well-defined because [4] = [0] in Z4 and g [4] ̸= g [0] in Z6 .
Just as in Definition 7.17, the process of verifying that a rule really is a function is called checking
well-definition. In general, if we are defining a function
f :X∼→A
whose domain is a quotient set, then it is usually necessary to construct f by saying what happens to
a representative x of an equivalence class [ x ]:
f [ x ] = ‘do something to x’. (∗)
We need to make sure that the ‘something’ is independent of the choice of element x.
Definition 7.19. Suppose that f : X ∼ → A is a rule of the form (∗). We say that f is a well-defined
function if
[ x ] = [y] =⇒ f [ x ] = f [y] .
If you think carefully, this is nothing more than condition 2. of Definition 7.4.
24 The notation [ x ] is helpful for reminding us which equivalence relation is being applied. When dealing with functions
4
between different quotient sets, it is easy to become confused.
216
Examples. 7.6.1 Show that f : Zn → Zn defined by f ([ x ]) = [ x2 + 4] is well-defined.
We must check that x ≡ y (mod n) =⇒ x2 + 4 ≡ y2 + 4 (mod n). But this is trivial!
The problem is immediately visible! In Z4 we have [0]4 = [4]4 , however f 1 ([0]4 ) = [0]6 and
f 1 ([4]4 ) = [4]6 which are not equal in Z6 ! It follows that f 1 is not a function.
Rather than try out all possible values of k, we proceed systematically. If f k is to be well-defined,
we require x ≡ y (mod 4) =⇒ kx ≡ ky (mod 6). Now
f k is well-defined ⇐⇒ 6 | 4k ⇐⇒ 3 | 2k ⇐⇒ 3 | k.
Given that we want [kx ]6 ∈ Z6 , we need only consider k ∈ {0, 1, 2, 3, 4, 5}: equivalent values
of k modulo 6 won’t change the definition of f k . It follows that there are only two well-defined
functions f k : Z4 → Z6 : x 7→ kx, namely f 0 ([ x ]4 ) = [0]6 and f 3 ([ x ]4 ) = [3x ]6 . Here they are in
tabular form (dropping the brackets):
x 0 1 2 3 4 5 6 7 8 ···
f0 (x) 0 0 0 0 0 0 0 0 0 · · ·
f3 (x) 0 3 0 3 0 3 0 3 0 · · ·
It should be clear that well-defined functions f k produce tables whose f k ( x ) line is periodic with
period four. To ram this point home, here is the table when k = 5:
x 0 1 2 3 4 5 6 7 8 ···
f5 (x) 0 5 4 3 2 1 0 5 4 · · ·
This is palpably not a function! You should compare these examples with those on page 95 and
with Exercise 3.4.??. Are these earlier example still functions when the domains are assumed
to be a ring Zn rather than simply a set of integers?
217
Functions on the Cylinder and Torus
2
Recall our construction on page 208, where we viewed the cylinder as the set R ∼ with respect to
the equivalence relation
( a, b) ∼ (c, d) ⇐⇒ a − c ∈ Z and b = d.
We wish to define a function f whose domain is a cylinder. Using the equivalence relation, this is the
2
same as defining a function f : R ∼ → A where A is our chosen codomain. Well-definition requires
that f satisfy
( a, b) ∼ (c, d) =⇒ f ( a, b) = f (c, d) .
Since ( a, b) ∼ ( a + 1, b), we require f ( a, b) = f ( a + 1, b) , for all a, b ∈ R. Otherwise said,
f ( x, y) must be periodic in x with period one. It is easy to see that
f ( x, y) = y2 sin(2πx )
2
is a suitable choice of function f : R ∼ → R.
is plotted below, with the color on the torus indicating the value of f . It is easier to instead consider
the function
F : R2 → R : ( x, y) 7→ sin(2πx ) cos(2πy).
This is also plotted, with the same color for each value. The point is that F is really f in disguise, but
has the advantage of being much easier to work with.
y +1.0
F ( x, y) = sin(2πx ) cos(2πy)
+0.5
1
2 0.0
−0.5
0
0 1 1 −1.0
2
The function f : domain T2 x
The arrows in the two pictures correspond The function F restricted to [0, 1) × [0, 1)
218
The Canonical Map
To do this justice, and to give you a taste for the details which are necessary in pure mathematics,
here is the important definition.
Definition 7.20. Suppose that ∼ is an equivalence relation on a set X. The function γ : X → X ∼
defined by γ( x ) = [ x ] is the canonical mapa .
a Canonical, in mathematics, just means natural or obvious.
For us, the purpose of the canonical map is to allow us to construct functions f : X ∼ → A.
x ∼ y =⇒ F ( x ) = F (y).
7.6.2 If F : X → A satisfies x ∼ y =⇒ F ( x ) = F (y), then there is a unique function f : X ∼ → A
satisfying F = f ◦ γ.
7.6.2 f : X ∼ → A can only be the function defined by f ([ x ]) = F ( x ). We show that this is well-
defined:
Reading Quiz
7.6.1 Let X be a set and ∼ an equivalence relation on X. What does it mean for a function f : X/ ∼→
B to be well-defined?
219
(a) It means f is an injection.
(b) It means [ x ] = [y] if and only if f ( x ) = f (y).
(c) It means f is a surjection.
(d) It means that x ∼ y implies f ( x ) = f (y).
Practice Problems
7.6.1 Let k be a constant integer. If f : Z5 → Z18 : [ x ]5 7→ [kx ]18 is a well-defined function, what
period must the sequence of values f ([0]5 ), f ([1]5 ), f ([2]5 ), . . . have?
Exercises
7.6.1 (a) Prove or disprove: f : Z3 → Z5 : x 7→ x3 (mod 5) is well-defined.
(b) Prove or disprove: f : Z10 → Z20 : x 7→ x2 (mod 20) is well-defined.
7.6.3 Can we view F ( x, y) = (y2 − 1) sin2 (πx ) as a function whose domain is the cylinder, as de-
scribed on page 218? Explain your answer.
Each subset consists of two points directly opposite each other on the sphere (antipodal points).
Let ∼ be the equivalence relation whose equivalence classes are the above subsets.
220
2
(a) f : S ∼ → R : [( x, y, z)] 7→ xyz is not well-defined. Explain why.
2
(b) Prove that f : S ∼ → R3 : [( x, y, z)] → (yz, xz, xy) is a well-defined function.
The image of this function is Steiner’s famous Roman Surface, another example, like the Klein
Bottle, of a generalization of the Möbius Strip.
7.6.10 Every function can be factored as a composition of a surjection followed by a bijection followed
by an injection. Let f : A → B be a function. We show that f = i ◦ g ◦ γ where i is an injection,
g a bijection, and γ a surjection.
221
8 Cardinalities of Infinite Sets
8.1 Cantor’s Notion of Cardinality
During the late 1800’s a German mathematician named Georg Cantor almost single-handedly over-
turned the foundations of mathematics. Prior to Cantor, mathematicians had understood a set to be
nothing more than a collection of objects. Via the consideration of certain infinite sets (in particular
his middle third set), Cantor showed this naı̈ve idea to be woefully inadequate. Cantor met great
resistance from many famous mathematicians and philosophers who felt his ideas to be unnatural.
He even managed to inflame several religious scholars who believed his investigation of infinity to
be an affront to the divine! Despite strong initial antipathy, Cantor’s notion of cardinality is now
universally accepted by mathematicians. More importantly, by exposing the contradictions inherent
in contemporary set theory, he convinced mathematicians that a rigorous axiomatic approach was
necessary. The result was a revolution in foundational mathematics, now known as axiomatic set the-
ory. Indeed, Cantor’s legacy is arguably the modern axiomatic nature of pure mathematics, where
rigor dominates and mathematicians are obliged to follow logic wherever it leads, regardless of the
bizarre paradoxes which might appear.
In this chapter we consider the basics of Cantor’s contribution, essentially his extension of the
concept of cardinality to infinite sets.
Recall that if A is a finite set, then | A|, the cardinality of A, is simply the number of elements
in A. This definition obviously does not extend to infinite sets. However, cardinality has a stronger
purpose than merely attaching a number to each set: it can be viewed as a relation and used to compare
sets. It is this interpretation that turns out to apply to infinite sets. For example, suppose that
Even though the elements of the sets A and B are completely different, we may use cardinality to
compare the sizes of A and B: since | A| = 2 and | B| = 3, we may write | A| < | B| to indicate that B
has more elements as A: colloquially, “B is larger than A.”
It is at this point that Cantor enters the discussion. By Theorem 3.15 and Corollary 3.16, the
condition | A| < | B| is equivalent to the existence of an injective (one-to-one) function f : A → B and
the non-existence of a bijection g : A → B. For example, the function f : A → B defined by
is clearly injective. In a sense, Theorem 3.15 tells us how to compare the cardinalities of finite sets
without counting their elements. Cantor’s seemingly innocuous idea was to turn this theorem for finite
sets into a definition of cardinality for all sets.
222
Definition 8.1. The cardinalities of two sets A, B are denoted | A| and | B|. We compare cardinalities
as follows:
• | A| ≤ | B| ⇐⇒ ∃ f : A → B injective.
• | A| = | B| ⇐⇒ ∃ f : A → B bijective.
Cardinality is defined as an abstract property whereby two sets can be compared. Otherwise said, it is
a relation. To define a cardinality | A| as an object, we need the following theorem.
The cardinality of a set A can then be defined to be the equivalence class of A with respect to this
relation: | A| := [ A]. It is now clear that cardinality partitions any collection of sets: every set has
a cardinality, and no set has more than one cardinality. We can moreover identify the cardinalities
of finite sets with the cardinal numbers 0, 1, 2, 3, 4, . . . in a natural way. To get further it is useful to
introduce a symbol for the cardinality of the simplest infinite set.
Definition 8.3. The cardinality of the set of natural numbers N is denoted ℵ0 , read aleph-nought or
aleph-null. We say that a set A is countably infinite, or denumerablea if | A| = ℵ0 .
a Sometimesthis is shortened to countable, although some authors use countable to mean ‘finite or denumerable,’ i.e.
any A for which | A| ≤ ℵ0 . Use countably infinite or denumerable to avoid confusion. ℵ is the first letter of the Hebrew
alphabet.
We will discuss in a moment why we need a new symbol, why ∞ doesn’t suffice. First we consider
an example of Definition 8.1 at work.
Example. Let 2N = {2, 4, 6, 8, 10, . . .} be the set of positive even integers. The function
f : N → 2N : n 7→ 2n
is a bijection. It follows that |2N| = |N| = ℵ0 and we say that 2N is countably infinite.
This example immediately demonstrates one of strange properties of infinite sets: 2N is a proper
subset of N, and yet the two sets are in bijective correspondence with one another! You should feel
like you want to say two contradictory things simultaneously:
223
If this doesn’t make you feel uncomfortable, then read it again! The remedy to your discomfort is
to appreciate that cardinality and number of elements are different concepts. Replacing ‘number of el-
ements’ with ‘cardinality’ in the two statements makes both true! Indeed it is completely legitimate
to write 2ℵ0 = ℵ0 . The idea of a set having a proper subset with the same cardinality can be used as
a definition of infinite set (see Exercise 8.1.18).
Here is another example of the same phenomenon; N has one more element than N≥2 and yet
they have the same cardinality: ℵ0 + 1 = ℵ0 .
Proving that a set is countably infinite While it is possible to use any number of clever theorems
to prove the denumerability of a set A, the simplest thing to imagine listing the elements in some
order so that A ‘looks like’ the natural numbers, or some other known countably infinite set. For
instance, the above examples can be summarized by listing the elements of these sets below those of
the natural numbers:
N 1 2 3 4 5 6 7 8 9 10 · · ·
2N 2 4 6 8 10 12 14 16 18 20 · · ·
N≥2 2 3 4 5 6 7 8 9 10 11 · · ·
The required bijective functions are then easy to read off! We use this technique to construct bijections
which show the denumerability of two important examples.
Proof. We must construct a bijective function f : N → Z. By experimenting with listing the integers,
we write down the first few terms of a suitable function in tabular form:
n 1 2 3 4 5 6 7 8 9 10 · · ·
f ( n ) 0 1 −1 2 −2 3 −3 4 −4 5 · · ·
You might object that the above argument is too quick, and perhaps you don’t trust the reasoning.
Does the table really define a function? Is it really obvious that the function is bijective? We can be
more formal and explicit, but the cost is that the big picture becomes less clear. Our function may be
224
written
(
1
2n if n is even,
f (n) =
− 12 (n − 1) if n is odd.
(Injectivity) Let m, n ∈ N, and suppose that f (m) = f (n). Without loss of generality, there are three
cases to consider.
(m, n both even) f (m) = f (n) =⇒ m2 = n2 =⇒ m = n.
(m, n both odd) f (m) = f (n) =⇒ − 12 (m − 1) = − 12 (n − 1) =⇒ m = n.
(m even, n odd) f (m) = f (n) =⇒ m2 = − 12 (n − 1) =⇒ m + n = 1. But m, n ∈ N, so m + n ≥ 2,
which is a contradiction.
Therefore f is injective.
(Surjectivity) With a little calculation, you should be able to see that, for any z ∈ Z, there exists a
positive integer n such that f (n) = z, namely:
(
f (2z) if z > 0,
z=
f (1 − 2z) if z ≤ 0.
Hence f is surjective.
For basic examples you are encouraged to use the listing/pictorial construction rather than explicitly
writing everything out. Training your intuition is more important than the formality here! Indeed
we would likely have been unable to come up with an explicit formula for f without the table, and it
is easier to get a feel for what f is using the table rather than the formula.
As you build up examples, you no longer have to compare countably infinite sets directly to the
natural numbers. A set B is countably infinite if and only if there exists a bijection f : A → B where
A is any countably infinite set. This holds because the composition of bijective function is also bijective
(Theorem 3.18). For instance, we immediately see that the set of even integers 2Z is countably infinite
because
f : Z → 2Z : z 7→ 2z
is a bijection, and because we now know that Z is countably infinite. We use this approach to help
prove the following result, the first of Cantor’s truly counter-intuitive revelations.
We prove the Theorem in stages. First we construct a bijection between the natural numbers N and
the positive rational numbers Q+ . We then modify this to obtain a bijection between the integers Z
and the full set of rational numbers Q. By the previous Theorem, it follows that Q must be countably
infinite.
225
Proof. For each pair of natural numbers a, b, place the fraction ba ∈ Q+ in the ath column and bth row
of an infinite square as shown below. Now list the positive rational numbers by tracing the diagonals
as shown, deleting any number that has already appeared in the list ( 22 = 11 , 46 = 32 , etc.).
1 2 3 4 5 6 7 ··· 1 2 3 4 5 6 7 ···
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 2 3 4 5 6 7 1 2 3 4 5 6 7
2 2 2 2 2 2 2
···
2 ×
2 2 ×
2 2 ×
2 2
···
1 2 3 4 5 6 7 1 2 3 4 5 6 7
3 3 3 3 3 3 3
···
3 3 ×
3 3 3 ×
3 3
···
1 2 3 4 5 6 7 1 2 3 4 5 6 7
4 4 4 4 4 4 4
···
4 ×
4 4 ×
4 4 ×
4 4
···
1 2 3 4 5 6 7 1 2 3 4 5 6 7
5 5 5 5 5 5 5
···
5 5 5 5 ×
5 5 5
···
1 2 3 4 5 6 7 1 2 3 4 5 6 7
6 6 6 6 6 6 6
···
6 × × ×
6 6 6 6 ×
6 6
···
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
. . . . . . . . . . . . . . . .
Now define the function f : N → Q+ by f (n) = an . This is certainly a function. We claim that it is a
bijection.
(Injectivity) Let m, n ∈ N, and suppose that f (n) = f (m). Then am = an . In the above construction
we deleted any rational number which had already appeared in the list. Thus am can only equal an if
m = n.
(Surjectivity) A positive rational number ba appears in the ath column and bth row of the square
2a
(and in many other places, ba = 2b = · · · ). We only delete a fraction ba if it has already appeared in
the list, therefore every positive rational lies in the range of f .
We are merely using f to identify the negative integers with the negative rationals. It is immediate
that g : Z → Q is a bijection. Appealing to Theorem 8.4, we deduce that |Q| = |Z| = ℵ0 , and so Q is
countably infinite.
This result should surprise you! Any sensible person should feel that there are far, far more rational
numbers than integers, and yet the two sets have the same cardinality. Bizarre.
226
There are other countably infinite sets that appear to be even larger than Q. For example, we can
show that the Cartesian product N × N is countably infinite: use almost the same proof as for Q+
except that there are no repeats to delete. For a much larger-seeming yet still countably infinite set,
consider the algebraic numbers:
x ∈ R : p( x ) = 0 for some polynomial p with integer coefficients .
Algebraic numbers are the zeros of polynomials with integer coefficients. Clearly any rational num-
ber ba is algebraic, since it satisfies p( x ) = 0 for p( x ) = bx − a. There are many more algebraic
√
numbers than rational numbers: e.g. 5 2 − 3 is algebraic since it is a root of the polynomial p( x ) =
( x + 3)5 − 2 = 0. Not all real numbers are algebraic however: those which aren’t, such as π and e,
are termed transcendental.
Otherwise said, every infinite set has cardinality at least as large as the natural numbers: ℵ0 may be
considered the least infinite cardinal.
Proof. (=⇒) The n = 0 case is left to the Exercises. Suppose that | A| = n ≥ 1 so that we may list
the elements of A as { a1 , . . . , an }. We must prove two things:
For part 1., simply define f by f ( ak ) = k for each k ∈ {1, 2, 3, . . . , n}. This is injective since the distinct
elements ak of A map to distinct integers.
For part 2., suppose that h : N → A is bijective. Consider the set
h {1, . . . , n + 1} = h(1), . . . , h(n + 1) ⊆ A.
Since A has n elements, by Dirichlet’s box principle, at least two of the values h(1), . . . , h(n + 1) must
be equal. Therefore h is not injective and consequently not bijective. A contradiction.
(⇐=) See Exercise 8.1.18.
a If g : A → N is a bijection, then g−1 : N → A is also a bijection.
Of course, this doesn’t answer the question of whether there exist infinite sets with larger cardinality
than ℵ0 , though we shall answer this in the next section.
227
Aside. ℵ0 versus ∞: what’s the difference?
It can be difficult to grasp why ℵ0 and ∞ are not the same thing. The problem is compounded by
references to an ‘infinite number’ of objects whenever the cardinality of a set is not finite. This loose
phrase is commonly used, but risks conflating the concepts of ‘infinite set’ and ‘infinity.’
So what is the difference between ℵ0 and ∞? If there aren’t an ‘infinite number’ of natural numbers,
how many are there? Theorem 8.6 says that ℵ0 is ‘larger than any natural number.’ Is this not what
we mean by infinity? The reason we need a new symbol ℵ0 , and why it and ∞ are different, is
twofold:
8.1.1 As we shall see shortly, there are infinite sets with greater cardinality than ℵ0 : in a naı̈ve sense,
there are multiple infinities. The single symbol ∞ is insufficient to distinguish sets with differ-
ent infinite cardinalities.
8.1.2 More philosophically, ℵ0 is an object in its own right; an object to which the cardinality of some
set may be equal. Indeed, by Theorem 8.2, ℵ0 is an equivalence class.
By contrast, ∞ is typically not an object. The symbol ∞ is mostly used in interval notation and
when talking about limits: in neither case does the symbol represent an object. For example:
• The interval (2, ∞) is the set of all real numbers greater than 2. We don’t say ‘greater than
2 and less than infinity.’
1 1
• lim 2 = ∞ means that the function f ( x ) = ( x −3)2
gets unboundedly larger as x ap-
x →3 ( x −3)
proaches 3. It is incorrect to say that f ( x ) ‘approaches infinity.’ It is even worse to write
f (3) = (3−13)2 = ∞.
The challenge of Cantor’s notion of cardinality is to appreciate that the question, ‘How many natural
numbers are there?’ is meaningless!
Reading Questions
8.1.1 A set A is countably infinite or denumerable if . Select all that apply.
8.1.2 True or False: if A is a proper subset of B, then A has strictly smaller cardinality than B.
Practice Problems
8.1.1 Suppose that A ̸= ∅. Prove that | A| ≤ | B| if and only if there is a surjection g : B → A.
8.1.2 Let a, b ∈ R with a < b. Show that |( a, b)| = |(0, 1)|. Conclude that any two open intervals in
R have the same cardinality.
228
Exercises
8.1.1 Refresh your proof skills by proving explicitly that the following functions are bijections:
(a) f : N → 2N : n 7→ 2n.
(b) g : N → N≥2 : n 7→ n + 1.
8.1.2 Construct a function f : N → Z≥−3 = {−3, −2, −1, 0, 1, 2, 3, 4, . . .} which proves that the latter
set is countably infinite: you must show that your function is a bijection.
8.1.4 Show that the set of all triples of the form (n2 , 5, n + 2) with n ∈ 3Z is countably infinite by
explicitly providing a bijection with a countably infinite set A. (You must check that the set A is
countably infinite, and that your map is indeed a bijection.)
8.1.5 Imagine a hotel with an infinite number of rooms: Room 1, Room 2, Room 3, Room 4, etc..
Show that, even if the hotel is full, the guests may be re-accommodated so that there is always
a room free for one additional guest.
Hint: consider the function f : N → N : n 7→ n + 1.
8.1.6 Let A be a set, and let B be a subset of A. Suppose B is countably infinite and a ∈ A \ B. Show
B ∪ { a} is countably infinite.
8.1.8 Find an explicit bijection f : [0, 1] → (0, 1). Make sure to show your map is a bijection.
8.1.10 Prove Theorem 8.2. (You need little more than Theorem 3.18 on the composition of bijective functions.)
8.1.11 Prove that the set N × N is countably infinite. You should base your proof on Theorem 8.5.
8.1.12 We know that Q is countably infinite, and we saw (Theorem 8.5) that there must exist a bijective
function f : N → Q. Show that g : N × N → Q × Q defined by g(m, n) = ( f (m), f (n)) is a
bijection. Appeal to the previous question to show that Q × Q is countably infinite.
8.1.13 Here we consider the n = 0 case of Theorem 8.6. Recall the definition of function in Section 7.2.
8.1.14 Let A be a countably infinite set. Show that for any n ∈ N, there is a partition A = { A1 , . . . , An }
of A such that each subset Ai in the partition is also countably infinite.
229
8.1.15 Suppose that the set An is countably infinite for each n ∈ N. We may then list the elements of
each set: An = { an1 , an2 , an3 , an4 , . . .}. Now list the elements of the sets A1 , A2 , A3 , . . . as follows:
8.1.16 Let A = { x ∈ R : p( x ) = 0 for some polynomial p with integer coefficients} be the set of
algebraic numbers. We will show that A is countable.
(a) Let M ∈ N. Prove that there are only finitely many choices of d ∈ N and a0 , . . . , ad ∈ Z
such that M = d + | a0 | + · · · + | ad |.
(b) Let PM = { ad x d + · · · + a1 x + a0 : M = d + | a0 | + · · · + | ad |}. Explain why PM is finite.
(c) Using the fact that a polynomial of degree d can have at most d roots in R, show that
R M = { x ∈ R : p( x ) = 0 for some p ∈ PM }
is finite.
S
(d) Prove that A = M ∈N R M and conclude by Exercise 15 that A must be countably infinite.
8.1.17 (Hard!) In this question we complete the proof of Theorem 8.6 by showing that if | A| < ℵ0 ,
then A is a finite set.
We prove by contradiction. Suppose that A is an infinite set such that | A| < ℵ0 . Then there
exists an injective function f : A → N. List the elements of the image of f in increasing order:
8.1.18 (Hard) Prove that a set A is infinite if and only if it has a proper subset B ⊂ A with the same
cardinality | B| = | A|.
230
8.2 Uncountable Sets
Since Q seems so large, you might think that there cannot be any sets with strictly larger cardinality.
But we haven’t yet thought about the real numbers. . .
Definition 8.7. A set A is uncountable if | A| > ℵ0 , that is if there exists an injection f : N → A but
no bijection g : N → A.
We denote the cardinality of the interval [0, 1] by the symbol c for continuum. The theorem may
therefore be written c > ℵ0 .
1
Proof. First we require an injective function f : N → [0, 1]. The function defined by f (n) = n clearly
fits the bill, for
1 1
f (n) = f (m) =⇒ = =⇒ n = m.
n m
Now we prove that there exists no bijection g : N → [0, 1], arguing by contradiction. Suppose that
g is such a bijection and consider the sequence of values g(1), g(2), g(3), . . . These are real numbers
between 0 and 1, hence they may all be expressed as decimals:a
c is a non-terminating decimal whose digits are 1’s and 2’s, whence it has no other representation.
Since c disagrees with g(n) at the nth decimal place, we have c ̸= g(n), ∀n ∈ N. Hence c is not in the
above list. However c ∈ [0, 1] and g is surjective, whence c ̸= g(n) for some n ∈ N: a contradiction.
We conclude that c ̸= ℵ0 .
Putting this together with the first part of the proof where c ≥ ℵ0 , we conclude that c > ℵ0 .
aA number has two decimal representations if and only if one of them terminates and the other ultimately becomes an
infinite sequence of 9’s. For the purposes of this proof it does not matter which representation is chosen when there is a
choice. We are forced, however, to take 1 = 0.999999 · · · , due to our insistence that all elements be written with zero units.
231
The second part of the proof is known as Cantor’s diagonal argument, since we are comparing the
constructed decimal c with the diagonal of an infinite square of integers. We have proved that the
interval [0, 1] has a strictly larger cardinality than the set of integers. Since [0, 1] ⊆ R, it follows
immediately that the real numbers are also uncountable. Indeed we shall see in a moment that the
real numbers also have cardinality c, as does any interval (of positive width). More amazingly, the
Cantor middle-third set (page 172) also has cardinality c, despite seeming vanishingly small.
The following theorem is very useful for being able to compare cardinalities. It allows us to prove
that two sets have the same cardinality without explicitly constructing bijective functions. Injective
functions are usually much easier to find.
The theorem seems like it should be obvious, but pause for a moment: it is not a result about numbers!
A and B are sets, and so the theorem must be understood in the context of Definition 8.1. In this
language the theorem becomes:
The proof is beautiful, though a little long to reproduce here. If you are interested it can be found in
any text on set theory. The applications of the theorem are more important to our purposes.
It is possible to explicitly define a bijection h : (0, 1) → [0, 1], although it is very messy. Instead we
construct two injections.
Proof. f : (0, 1) → [0, 1] : x 7→ x is clearly an injection, whence |(0, 1)| ≤ |[0, 1]| = c. Now define
1 1
g : [0, 1] → (0, 1) : x 7→ x+ .
2 4
g is certainly injective, and so c ≤ |(0, 1)|.
By the Cantor–Schröder–Bernstein Theorem, the sets (0, 1) and [0, 1] have the same cardinality c.
In case you’re feeling nervous, note that the function g in the proof isn’t surjective: the range of g is
the interval [ 41 , 43 ] ̸= (0, 1). By a similar trick, covered in the Exercises, one can see that R also has
cardinality c.
232
For a final punchline, we prove Cantor’s Theorem, which says that the power set of any set A
always has a strictly larger cardinality than A. In Theorem 6.6 we saw that |P ( A)| = 2| A| for finite
sets A. We therefore already believe that Cantor’s Theorem is true for finite sets. The proof that
follows also works for infinite sets.
• ∃ f : A → P ( A) which is injective.
• ∄ g : A → P ( A) which is bijective.
X = { a ∈ A : a ̸∈ g( a)}.
We pause the proof for a moment, as the set X is somewhat tricky to think about. Before proceeding,
let us consider an example. Suppose that g : {1, 2} → P ({1, 2}) is defined by
Then 1 ∈ g(1) and 2 ̸∈ g(2), whence the above set is X = {2}. Since we are trying to prove that
no bijection g : A → P ( A) exists, it is important to note that the function g in our example is not
bijective!
Proof Continued. By assumption, g is bijective, hence it is certainly surjective. Because the range of
g is the power set P ( A), the set X lies in the image of g. Otherwise said, there exists b ∈ A such
that g(b) = X. We ask whether b is an element of X. Think carefully about the definition of X, and
observe that
The main implication of this is that there is no largest cardinality! We can always construct a larger set
simply by taking the power set of what we already have. For example, P (R) has larger cardinality
than R. If you want a set with even larger cardinality, why not take P (P (R))? Or P (P (P (R))). We
can continue this process indefinitely.
233
Cantor’s Theorem played a large part in pushing set theory towards axiomatization. Here is a
conundrum motivated by the theorem: If a ‘set’ is just a collection of objects, then we may consider
the ‘set of all sets.’ Call this A. Now consider the power set of A. Since P ( A) is a set of sets, it must
be a subset of A, whence |P ( A)| ≤ | A|. However, by Cantor’s Theorem, we have | A| ⪇ |P ( A))|.
The conclusion is the manifest absurdity
| A| ⪇ | A|
The remedy is a thorough definition of ‘set’ which prevents the collection of all sets from being
considered a set. This is where axiomatic set theory begins.
8.2.2 completeness, i.e. all true mathematical statements would be derivable from the axioms.
The hope for such a foundation was crushed in 1931, when a young logician by the name of Kurt
Gödel published his famous Incompleteness Theorems which showed that no such axiomatic system
could exist. Essentially, Gödel showed that in any consistent axiomatic system that was strong
enough to produce some basic arithmetic, there must be statements which are neither derivable nor
refutable from the axioms. Perhaps even worse, no such system can prove its own consistency.
While the strongest aims of some of the early 20th century attempts at an axiomatic foundation
cannot be accomplished, the research of that time was able to provide a foundation that most modern
mathematicians deem adequate for current work. Perhaps the most popular approach is to base all
of mathematics on set theory – you will see as your studies progress that many of the objects you
study can be formalized as sets together with functions and relations between sets. We have seen
in Chapter 7 that functions and relations are just themselves sets. Even numbers like 0, 1, 2 or 12 19 or
3.14 . . . can be thought of as sets, if one desires. In turn, set theory is often axiomatized using the ZFC
axioms (short for Zermelo-Fraenkel set theory with the Axiom of Choice).
While, the ZFC axioms are subject to the limitations imposed by Gödel’s theorems, they have
proven themselves by being able to formalize most of the mathematics actually used by current
mathematicians, and have so far not produced any inconsistencies. Thus most mathematicians feel
little need to dwell on the foundational issues of the previous century.
Reading Questions
8.2.1 A set A is uncountable if and only if .
234
(a) there is a bijection between A and [0, 1].
(b) there is a surjection from R onto A.
(c) there is an injection from N into A.
(d) there exists no injection from A into N.
8.2.2 Which of the following sets are uncountable. Select all that apply.
8.2.3 True or False: there is no set A such that there is a surjection from P ( A) onto A.
Practice Problems
8.2.1 Let {0, 1}N denote the set of all sequences ( x1 , x2 , . . .) such that each xi is 0 or 1. In other words,
A is the set of all functions f : N → {0, 1}. The cardinality of {0, 1}N is often 2ℵ0 . Show 2ℵ0 = c.
[Hint: use the Cantor-Schröder-Bernstein theorem.]
Exercises
8.2.1 You may assume that [0, 1] has cardinality c.
(a) Construct an explicit bijection f : [0, 1] → [3, 8] which proves that the interval [3, 8] also
has cardinality c. Try a linear function mapping the endpoints of [0, 1] to the endpoints of [3, 8].
(b) Let a, b ∈ R with a < b. Generalizing part (a), construct a bijection which proves that the
closed interval [ a, b] has cardinality c.
g(1) = {1, 2, 3}, g(2) = {1, 4}, g(3) = ∅, g(4) = {2, 4}.
Compute the set X = a ∈ {1, 2, 3, 4} : a ̸∈ g( a) .
(b) Repeat part (a) for g : N → P (N) : n 7→ { x ∈ 2N : x ≤ n}.
8.2.4 The proof of Cantor’s Theorem makes use of a construction similar to Russell’s Paradox. Let X
be the set of all sets which are not members of themselves: explicitly
X = { A : A ̸ ∈ A }.
(a) Assume that X is a set, and use it to deduce a contradiction: ask yourself if X is a member
of itself.
235
(b) Russell’s paradox is one avatar of an ancient logical conundrum which appears in many
guises. For example, suppose that a town has one hairdresser, and suppose that the hair-
dresser is the person who cuts the hair of all the people, and only those people, who do not
cut their own hair. Who then cuts the hairdresser’s hair? Can you explain the connection
with Russell’s paradox/Cantor’s Theorem?
The point of Russell’s paradox is that we need a definition of ‘set’ which prevents objects like X from
being considered sets.
8.2.5 Let A = {0, 1}N denote the set of all sequences ( x1 , x2 , . . .) such that each xi is 0 or 1. In other
words, A is the set of all functions f : N → {0, 1}. Use a diagonal argument similar to the proof
of Theorem 8.8 to show A is uncountable.
8.2.6 Recall the Cantor set as described in the notes, where we proved that C is the set of all num-
bers in [0, 1] possessing a ternary expansion consisting only of zeros and twos. Modeling your
answer on the proof that the interval [0, 1] is uncountable, prove that C is uncountable.
It is true, though we haven’t show it, that |I| = c. Doing so is more difficult!
8.2.8 A real number x ∈ R is called transcendental if it is not algebraic, i.e. not the root of any poly-
nomial with integer coefficients. Show there are uncountably many transcendental numbers.
[Hint: see Exercise 16 in Section 8.]
|N × · · · × N| = ℵ0
| {z }
ktimes
8.2.11 Show that the complex numbers C have the cardinality of the continuum |C| = c.
8.2.12 Give an example of an uncountable I and { An : n ∈ I } such that each An is countably infinite,
and the following three conditions hold:
(i) if m ̸= n, then Am ̸= An ,
236
(ii) for all m, n, either Am ⊆ An or Am ⊇ An ,
S
(iii) n∈ I An is countably infinite.
8.2.13 (Hard!) Let x ∈ [0, 1]. The binary expansion of x is the sequence bn of zeros and ones such that
∞
bn
x= ∑ 2 n
.
n =1
Given the choice,25 we choose the terminating binary expansion of x. With such a caveat, you
are given that the binary expansion of x ∈ [0, 1] is unique. Define a function f : [0, 1] → P (N)
by
is a bijection.
(c) Use Cantor–Schröder–Bernstein to conclude that |P (N)| = |C| = c.
(a) Define | A| · | B| to be | A × B|. Note that when A and B are finite, this definition agrees with
our usual notion of multiplication (i.e. if | A| = m and | B| = n, then | A| · | B| = m · n).
(b) Show that if A and B are nonempty and at least one of them is infinite, then | A| · | B| =
max(| A|, | B|).
25 The binary expansion of x is unique unless x has a terminanting expansion, in which case the the other expansion
237