Math 13 An Introduction to Abstract Mathematics
Neil Donaldson and Alessandra Pantano
With contributions from:
Michael Hehmann, Christopher Davis, Liam Hardiman, and Ari Rosenfield
September 7, 2023
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
1
Contents
1 A Paradigm Shift 4
1.1 Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Theorem and Conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Planning and Writing a Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Logic and the Language of Proofs 23
2.1 Propositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Propositional Functions and Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.3 Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.4 More Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3 Sets and Functions 73
3.1 Set Notation and Describing a Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2 Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.3 Unions, Intersections, and Complements . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.4 Introduction to Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4 Divisibility and the Euclidean Algorithm 109
4.1 Remainders and Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.2 Greatest Common Divisors and the Euclidean Algorithm . . . . . . . . . . . . . . . . . 119
5 Mathematical Induction and Well-ordering 126
5.1 Investigating Recursive Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5.2 Proof by Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.3 Well-ordering and the Principle of Mathematical Induction . . . . . . . . . . . . . . . . 139
5.4 Strong Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6 Set Theory, Part II 155
6.1 Cartesian Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.2 Power Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
6.3 Indexed Collections of Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
7 Relations and Partitions 182
7.1 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
7.2 Functions revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
7.3 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
7.4 Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
7.5 Well-definition, Rings and Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
7.6 Functions and Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
8 Cardinalities of Infinite Sets 223
8.1 Cantor’s Notion of Cardinality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
8.2 Uncountable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
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?
3
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.
Theorem 1.1. If a b c are the side lengths of a right triangle, then a
2
+ b
2
= c
2
.
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 + c
2
.
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 + a
2
+ b
2
.
But the area of the whole square hasn’t changed, so we must have that
2ab + c
2
= 2ab + a
2
+ b
2
.
When we subtract 2ab from both sides, we arrive at the desired conclusion.
4
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
Figure 1: Square of side length a + b.
Discussion Questions
1. Are you convinced by this proof? If so, why? If not, what feels off?
2. Would this proof work without the picture?
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
5
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.
Definition 1.3. An integer is even if it is divisible by two.
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.
Definition 1.4. An integer a is divisible by the integer b if a = bc for some integer c.
So for example, 2 itself is even since 2 = 2 ·1. So is 50 = 2 ·(25).
Only once we have our definitions straight can we start proving things. For example, consider
the following theorem:
Theorem 1.5. The sum of any two even integers is even.
The proof of this theorem flows straight from the definition.
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:
x + y = 2m + 2n = 2(m + n). ()
Because m + n is an integer, this shows that x + y is an even integer.
There are several important observations:
‘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.
6
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 x
1
< x
2
in
the domain A, f (x
1
) < f (x
2
).
Definition. A function from a set A to a set B is called “strictly decreasing” if for all x
1
< x
2
in
the domain A, f (x
1
) > f (x
2
).
Give an example of a function which is neither strictly increasing nor strictly decreasing. Ex-
plain your answer.
1.2.2 Consider the following definition.
Definition. A sequence {a
n
} “goes to if for all number M, there exist a natural number N,
such that a
n
> 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?
1.2.3 Let’s say an integer to be “nearly a square” if it is of the form:
2 = 2 ·1, 6 = 3 ·2, 12 = 4 ·3, 20 = 5 ·4, 30 = 6 ·5, 42 = 7 ·6, . . .
Give a (formal) definition for a ”nearly a square” integer.
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
(a) n = 2k + 1 for every integer k.
(b) n = 2k + 1 for some number k.
(c) there is some integer k such that k = 2n + 1.
7
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.
1.3 Theorem and Conjecture
Theorems are true mathematical statements that we can prove. These include important and widely
applicable “named theorems” like the Pythagorean theorem, the fundamental theorem of calculus,
and the rank-nullity theorem as well as simpler ones like Theorem 1.5. Essentially, if you can prove
it, then it’s a theorem.
But what if we’re confronted with a statement that we don’t know how to prove? It would be a
bit arrogant of us to conclude that the statement is false just because we don’t know how to prove
it. Statements that we believe to be true, but don’t yet know how to prove are called conjectures.
Conjectures push the boundaries of math as we know it. Much of the creativity in mathematics
comes from the pursuit of proving or disproving conjectures. When you think about it, we can’t lose
we learn something new if we prove the conjecture true or false.
A conjecture is the mathematician’s equivalent of the experimental scientist’s hypothesis: a state-
ment that one would like to be true. The difference lies in what comes next. The mathematician
will try to prove that a conjecture is undeniably true by relying on logic, while the scientist will ap-
ply the scientific method, conducting experiments attempting, and hopefully failing, to show that a
hypothesis is incorrect. To get a taste, consider the following.
Conjecture 1.6. If n is any odd integer, then n
2
1 is a multiple of 8.
Conjecture 1.7. For every positive integer n, the integer n
2
+ n + 41 is prime.
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
2
1 0 8 24 48 80 120 168
n 1 2 3 4 5 6 7
n
2
+ n + 41 43 47 53 61 71 83 97
8
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 n
2
1 a
multiple of 8 for every odd integer n? Is n
2
+ 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:
Prove it by showing it must be true in all cases, or,
Disprove it by finding at least one instance in which the conjecture is false.
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
n
2
1 = ( 2k + 1)
2
1 = ( 4k
2
+ 1 + 4k) 1 = 4k
2
+ 4k.
We need to investigate whether this is always a multiple of 8. Since
4k
2
+ 4k = 4(k
2
+ k)
is already a multiple of 4, it all comes down to deciding whether or not k
2
+ k contains a factor 2 for
all possible choices of k; i.e. is k
2
+ 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
k
2
+ 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
k
2
+ k is always even. Factoring out k, we get:
k
2
+ k = k(k + 1).
We have therefore expressed k
2
+ 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.
Theorem 1.8. If n is any odd integer, then n
2
1 is a multiple of 8.
Proof. Let n be any odd integer; we want to show that n
2
1 is a multiple of 8. By the definition of
odd integer, we may write n = 2k + 1 for some integer k. Then
n
2
1 = ( 2k + 1)
2
1 = ( 4k
2
+ 1 + 4k) 1 = 4k
2
+ 4k = 4k(k + 1).
We distinguish two cases. If k is even, then k(k + 1) is even and so 4k(k + 1) is divisible by 8.
If k is odd, then k + 1 is even. Therefore k(k + 1) is again even and 4k(k + 1) divisible by 8.
9
In both cases n
2
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 n
2
+ 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 n
2
+ 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
41
2
+ 41 + 41 = 41(41 + 1 + 1) = 41 ·43.
Our counterexample shows that there exists at least one value of n for which n
2
+ n + 41 is not prime.
We have therefore disproved the conjecture that ‘for all positive integers n, n
2
+ 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.
Conjectures: True or False?
Do your best to prove or disprove the following conjectures. Then revisit these problems at the end
of the course to realize how much your proof skills have improved.
1. The sum of any three consecutive integers is even.
2. There exist integers m and n such that 7m + 5n = 4.
3. Every common multiple of 6 and 10 is divisible by 60.
4. There exist integers x and y such that 6x + 9y = 10.
5. For every positive real number x, x +
1
x
is greater than or equal to 2.
6. If x is any real number, then x
2
x.
7. If n is any integer, n
2
+ 5n must be even.
8. If x is any real number, then |x| x.
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 : n
2
< 25} and B = {n
2
: 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
greater than one.
10
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.
Definition. A real number r is a “rational number if r =
p
q
for some integer p and for some
non-zero integer q.
(a) Are integers rational numbers?
(b) True or false: Each rational number r has a non-zero integer n so that rn is an integer.
1.3.2 Consider the following definitions.
Definition. An integer is “super-odd” if it is the product of an odd integer times itself (that is,
it is the square of an odd integer).
Definition. An integer is “super-even” if it is the product of an even integer times itself (that
is, it is the square of an even integer).
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.
1.4 Planning and Writing a Proof
Your main responsibility for the rest of this course is to write proofs. If you look back at any of the
conjectures on page 10, there might be a question on your mind how do I prove (or disprove) this? If
you read a proof (or disproof) written by someone else, you might have the related question how
did they ever come up with this proof?
The source of a proof is often less magical than it appears: usually the original author of the proof
experimented until they found something that worked. Most of that experimentation gets hidden in
the final written proof. The proof itself should be written in the way that is easiest to read.
In order to bridge the gap between what goes into thinking about a proof and what the proof
actually looks like, we recommend splitting the proof writing process into the following four steps.
11
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.
12
Let’s use this framework to prove the following theorem.
Theorem 1.11. A positive integer n is divisible by 5 when its last digit is 5.
First, we need to make sense of the statement of the 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 n
0
, n
1
, . . . , n
k1
, then
n = n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + n
0
. (1.1)
Thus, “last digit 5” means n
0
= 5.
Do we believe this statement is true? Let’s try out some examples.
15 = 3 ·5 is divisible by 5.
13
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.
Sketch. Our examples:
15 = 1 ·10 + 5 = 1 · 2 · 5
|{z}
10
+5 = 5 · (2 + 1) (a multiple of 5).
245 = 2 ·10
2
+ 4 · 10
1
+ 5 = 2 ·10 · 2 · 5
|{z}
10
+4 · 2 · 5
|{z}
10
+5 = 5 · (40 + 8 + 1) (a multiple of 5).
(Commentary, not part of the sketch.
The key idea here is that we can pull out a 5 from each power of 10 and from the last digit (which
is a 5). This will be our general strategy.
We now explore the general case, using the strategy suggested by the previous examples. At this
stage, we focus on outlining the main ideas, and do not bother about writing down a formal proof.
The bullet points here aren’t essential; they are just there to make it a little easier for you to read.
End of commentary, back to the sketch.)
14
n = n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + 5 (last digit 5)
10, 10
2
, 10
3
, ... are all multiples of 5.
n
1
, n
2
, n
3
, ... are not multiples of 5 (in general), but this is irrelevant to us.
n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 is a multiple of 5.
n is a multiple of 5 because
n = n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10
| {z }
5· (an integer)
+ 5
|{z}
5·1
(last digit 5)
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:
n = n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + n
0
= n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + 5.
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
k1
·(a
k1
·5) + n
k2
·(a
k2
·5) + ··· + n
1
·(a
1
·5) + 5
(by associativity of multiplication)
= (n
k1
· a
k1
) · 5 + (n
k2
· a
k2
) · 5 + ··· + (n
1
· a
1
) · 5 + 1 ·5
(by distributivity)
= (n
k1
· a
k1
+ n
k2
· a
k2
+ ··· + n
1
· a
1
+ 1) · 5.
15
Because the quantity n
k1
· a
k1
+ n
k2
· a
k2
+ ··· + n
1
· a
1
+ 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:
n = n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + n
0
= n
k1
·10
k1
+ n
k2
·10
k2
+ ··· + n
1
·10 + 5.
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 n
k1
· 10
k1
to n
1
· 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.
Example. Consider the following proposition:
Every function f : R R represented by a degree 2 polynomial is non-constant.
1. [Interpret] We rewrite this statement as an if-then statement. The result is quite similar to the
16
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 n
2
x
2
+ n
1
x + n
0
, where
n
2
= 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) = n
2
x
2
+ n
1
x + n
0
with n
2
= 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.
f (x) = x
2
+ 1 is a degree 2 polynomial. It is not constant because f (0) = 1 but f (1) = 2.
(A less formal justification that it’s non-constant: the graph of f (x) is not a horizontal line.)
f (x) = x
2
x is a degree 2 polynomial. It is not constant because f (0) = 0 but f (1) = 2.
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.)
3. [Sketch] Let’s try plugging in 0, 1, and 1 to our general polynomial n
2
x
2
+ n
1
x + n
0
. We get:
f (0) = n
0
f (1) = n
2
+ n
1
+ n
0
f (1) = n
2
n
1
+ n
0
.
Can we find two values that have different outputs?
Answer: If f (1) = f (0), we are done. Otherwise, if f ( 1) = f (0), consider f (1). We will show
that f (1) = f (1), because if f (1) = f (1) = f (0), then f cannot have degree 2.
Here are the details: suppose f (1) = f (0), then n
2
+ n
1
= 0. If f (1) = f (1), then n
1
= n
1
,
so n
1
= 0. So if f (0) = f (1) = f (1), then n
2
= 0, but that means f is not a degree 2
polynomial. Since we assumed f is a degree 2 polynomial, we know that f (0) = f (1) = f (1)
is impossible, so f is not a constant polynomial.
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).
Example. Consider the same statement as above.
17
Every function f : R R represented by a degree 2 polynomial is non-constant.
Are the following arguments valid proofs? If not, why not?
“Proof”: Consider the degree 2 polynomial f (x) = 3x
2
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”: Let f (x) = ax
2
+ bx + c be represented by a degree 2 polynomial (thus a = 0), and
assume it is constant. Because f is constant, then its derivative is zero, so 2ax + b = 0 for all x.
But this is only possible if a = b = 0. Given that a = 0, f is not a degree 2 polynomial.
Is it a valid proof?
Answer. Assuming we are allowed to use properties of derivatives in our proof, then this is a
correct and complete proof. (Ask your professor if you’re unsure what tools you are allowed
to use in a proof.)
You may be surprised by the approach we took in this proof: the way we proved that f is not
constant is by showing that it cannot be otherwise; indeed, if we assumed that f were constant,
we would reach some nonsense. As we will see shortly, this is an example of a “proof by
contradiction”.
“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.)
18
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) It is never acceptable to use shorthand when writing a proof.
(b) It is always acceptable to use shorthand when writing a proof.
(c) The sketching phase.
(d) The proof phase.
2. True or False: Your proof sketch is for your eyes only.
3. Most of the hard work happens during the phase.
(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.
Theorem 1.13. If n is an integer greater than 2, then n
2
1 is composite.
Sketch. n
2
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.
19
Theorem 1.14. If n 3 is an integer, then n
2
> 2n + 1.
Proof. Let n
2
> 2n + 1. Then 0 < n
2
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.
1.4.5 Consider the following definition.
Definition: For integers n, a, and a positive integer d, we write n a (mod d) if n is the sum
of a and an integer multiple of d.
Now consider the statement:
If n 1 (mod 2) and m 1 (mod 4), then n
2
m is divisible by 4.
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 + 4k
2
(1 + 4k),
n
2
m = 4k
2
, 4 divides 4(k
2
).
1.4.6 Consider the following claim:
Claim: There are infinitely many prime numbers.
The claim is true, but the proof given below contains one extraneous statement. Such a state-
ment is a sentence that, if deleted, does not change the validity of the proof. Find the extraneous
statement and briefly justify why it does not change the proof.
Proof. Assume there are exactly n prime numbers 2 p
1
, ..., p
n
and consider the integer
N = p
1
··· p
n
+ 1.
N is an odd number since p
1
= 2 and N = 2(p
2
··· p
n
) + 1. Certainly N is divisible by some
prime p
j
in the list since we are assuming that the list p
1
, ..., p
n
contains all primes. Thus
N p
1
p
2
··· p
n
= 1
is divisible by that p
j
. This is a contradiction since 1 is not divisible by an integer p
j
2.
1.4.7 We give three attempts to prove the following statement:
20
For any positive real numbers a and b,
a+b
2
ab.
Below, three attempts of a proof are given.
Attempt 1: Assuming that
a+b
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
a
2
+ 2ab + b
2
4ab
a
2
2ab + b
2
0
(a b)
2
0
Since we have arrived at a true statement, the initial assumption must be true. Thus,
a+b
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+b
2
ab,
as desired.
Attempt 3: Let a = 18 and b = 2. Then
a+b
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
m = (m n) + n = (2t + 1) + (2s + 1) = 2(t + s + 1).
Because t + s + 1 is an integer, this shows that m is even.
If n is even, then n = 2s for some integer s. Thus
m = (m n) + n = (2t + 1) + 2(s) = 2(t + s) + 1.
Because t + s is an integer, this shows that m is odd.
21
Hence m and n have opposite parity.
1.4.9 Consider the following definition.
Definition: Let f real-valued function on the set of real numbers. If f (z) = 0, then we call z a
zero of f .
Suppose f is a function and S is your favorite subset of the real numbers. If we want to prove
that the set of all zeros of f is contained in a set S, what can we assume and what do we want
to show?
22
7
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
Definition 2.1. A proposition or statement is an expression that is either true or false.
Examples. 1. 17 24 = 7.
2. 39
2
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 1
st
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
T T
T F
F T
F F
P Q R
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
23
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 2
n
: induction (Chapter 5) makes this very easy.
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
T T T
T F F
F T F
F F F
P Q P Q
T T T
T F T
F T T
F F F
P ¬P
T F
F T
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!
Example. Let P, Q and R be the following propositions:
P. Irvine is a city in California.
Q. Irvine is a town in Ayrshire, Scotland.
R. Irvine has seven letters.
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
24
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?
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
T T T
T F F
F T T
F F T
P Q P Q
T T T
T F F
F T F
F F T
For the proposition P = Q, we call P the hypothesis and Q the conclusion.
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:
If you are born in Rome, then you are Italian.
You are Italian if you are born in Rome.
You are born in Rome only if you are Italian.
Being born in Rome is sufficient to be Italian.
Being Italian is necessary for being born in Rome.
Are you comfortable with what P and Q are here?
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
25
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.
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.
7 = 3 = 0 ·7 = 0 ·3 (If 7 = 3, then 0 times 7 equals 0 times 3)
= 0 = 0 (then 0 equals 0)
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.
Theorems and Direct Proofs
Truth tables and connectives are very abstract. To apply them to mathematics we need the following
basic notions of theorem and proof.
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.
Theorem 2.5. The product of two odd integers is odd.
The first thing to do is to write the theorem in terms of propositions and connectives: that is, in the
form P = Q.
P is x and y are odd integers.’ This is our assumption, the hypothesis.
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.
26
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:
x ·y = (2n + 1)(2m + 1) = 4mn + 2n + 2m + 1 = 2(2mn + n + m) + 1.
Because 2mn + n + m is an integer, this shows that x ·y is an odd integer.
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!
The Converse and Contrapositive
The following constructions are used continually in mathematics: it is vitally important to know the
difference between them.
Definition 2.6. The converse of an implication P = Q is the reversed implication Q = P.
The contrapositive of P = Q is ¬Q = ¬P.
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.
Example. We prove that the expressions (P = Q) (Q = P) and P Q are logically
equivalent by computing their truth tables:
P Q P = Q Q = P (P = Q) (Q = P)
T T T T T
T F F T F
F T T F F
F F T T T
P Q P Q
T T T
T F F
F T F
F F T
27
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.
Example. Let P and Q be the following statements:
P. Claudia is holding a peach.
Q. Claudia is holding a piece of fruit.
The implication P = Q is true, since all peaches are fruit. As a sentence, we have:
If Claudia is holding a peach, then Claudia is holding a piece of fruit.
The converse of P = Q is the sentence:
If Claudia is holding a piece of fruit, then Claudia is holding a peach.
This is palpably false: Claudia could be holding an apple!
The contrapositive of P = Q is the following sentence:
If Claudia is not holding any fruit, then she is not holding a peach.
This is clearly true.
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.
28
Theorem 2.9. Let x and y be integers. If x + y is odd, then exactly one of x or y is odd.
The theorem is an implication of the form P = Q where
P. The sum x + y of integers x and y is odd.
Q. Exactly one of x or y is odd.
A direct proof would require that we assume P to be true and logically deduce the truth of Q. For
instance we might start our argument with:
Suppose that x + y = 2n + 1 for some integer n
The problem is that this doesn’t really tell us anything about x and y, which we need to think about
in order to demonstrate the truth of Q. Instead we consider the negations of our propositions:
¬Q. x and y are both even or both odd (they have the same parity).
¬P. The sum x + y of integers x and y is even.
Since P = Q is logically equivalent to the seemingly simpler contrapositive (¬Q) = (¬P),
we choose to prove the latter. This is, by Theorem 2.8, equivalent to proving the original implication.
Proof. Assume that x and y have the same parity. There are two cases: x and y are both even, or both
odd.
Case 1: Let x = 2m and y = 2n be even. Then x + y = 2(m + n) is even.
Case 2: Let x = 2m + 1 and y = 2n + 1 be odd. Then x + y = 2(m + n + 1) is even.
In both cases x + y is even, and the result is proved.
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
29
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:
I rode the subway and I had coffee.
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:
I didn’t ride the subway or I didn’t have coffee.
Note that the mathematical use of or includes the possibility that you neither rode the subway nor
had coffee.
You will see de Morgan’s laws again when we encounter sets.
Aside. Think about the meaning!
In the previous example we saw how negation switches and to or. This is true only when and
denotes a conjunction between two propositions. Before applying De Morgan’s laws, think about
the meaning of the sentence. For example, the negation of
Mark and Mary have the same height.
is the proposition:
Mark and Mary do not have the same height.
If you blindly appeal to De Morgan’s laws you might end up with the following piece of nonsense:
Mark or Mary do not have the same height.
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
30
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:
Theorem 2.11. ¬(P = Q) is logically equivalent to P ¬Q (read P and not Q’).
Now think in words rather than calculate. What is the negation of the following implication?
It’s the morning therefore I’ll have coffee.
Hopefully it is clear that the negation is:
It’s the morning and I won’t have coffee.
The implication ‘therefore’ has disappeared and the expression ‘and won’t’ is in its place.
Warning! The negation of P = Q is not a conditional. In particular it is neither of the following:
The converse, Q = P.
The contrapositive of the converse, ¬P = ¬Q.
If you are unsure about this, write down the truth tables and compare.
Example. Let x be an integer. What is the negation of the following sentence?
If x is even, then x
2
is even.
Written in terms of propositions, we wish to negate P = Q , where P and Q are:
P. x is even.
Q. x
2
is even.
The negation of P = Q is P ¬Q, namely:
x is even and x
2
is odd.
This is very different to ¬P = ¬Q (if x is odd then x
2
is odd).
Keep yourself straight by thinking about the meaning of these sentences. It should be obvious that x
even = x
2
even’ is true. It negation should therefore be false. The fact that it is false should make
reading the negation feel a little uncomfortable.
Tautologies and Contradictions
We finish this section with two related concepts that are helpful for understanding proofs.
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.
31
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.
Examples. 1. P (¬P) is a very simple contradiction:
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.
2. (P (P = Q)) = Q is a tautology. This is essentially how we understand a direct proof:
if P is true and we have a correct argument P = Q, then Q must also be true.
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
Aside. Algebraic Logic
One can study logic in a more algebraic manner. De Morgan’s Laws are algebraic. Here are a few
of the other basic laws of logic.
Law of Double Negation :
¬(¬P) is logically equivalent to P
Commutative laws :
P Q is logically equivalent to Q P
P Q is logically equivalent to Q P
Associative laws :
(P Q) R is logically equivalent to P (Q R)
(P Q) R is logically equivalent to P (Q R)
Distributive laws :
(P Q) R is logically equivalent to (P R) (Q R)
(P Q) R is logically equivalent to (P R) (Q R)
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
32
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 , .
2. A contradiction 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 false.
(c) is never false, no matter what the truth value of its component propositions.
(d) is built only using the connective ¬.
3. The contrapositive of the conditional P = Q is the conditional
(a) ¬P = Q
(b) ¬Q = ¬P
(c) Q = P
(d) P = ¬Q
4. True or False: The converse of P = Q is always logically equivalent to 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
(a) “I study at least 25 hours per week, but I am not successful.”
(b) “Either I study less than 25 hours per week, or I am successful.”
(c) “Either I study at least 25 hours per week, or I am not successful.”
(d) ‘If I am successful, then I will study at least 25 hours per week.”
6. De Morgan’s laws state that:
¬(P Q) is logically equivalent to (1)
¬(P Q) is logically equivalent to (2)
(a) (1) ¬(P = Q), (2) (¬P ¬Q)
(b) (1) (¬P ¬Q), (2) (P Q)
(c) (1) (¬P Q), (2) (P ¬Q)
(d) (1) (¬P ¬Q), (2) (¬P ¬Q)
33
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.2 Prove that P ¬Q is logically equivalent to ¬P = (¬P ¬Q).
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
(a) Prove P Q is logically equivalent to ¬(P Q).
(b) Find an expression built using only P and the connective which is logically equivalent
to ¬P.
(c) Find an expression built using only P, Q, and the connective which is logically equivalent
to P Q.
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.
34
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.
Write your answers in sentences, like the original.
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. . . )
2.1.5 Consider the proposition P given below:
If the integer m is greater than 3, the integer 2m is not prime.
(a) Rewrite P using the word ‘necessary.’
(b) Rewrite P using the word ‘sufficient.’
(c) Write the negation, the converse and the contrapositive of P.
Write your answers in sentences, like the originals.
2.1.6 Let A be a square matrix. Consider the proposition Q given below:
For A to be invertible, it is necessary and sufficient that A is non-singular.
(a) Rewrite Q as a biconditional.
(b) Write the negation of Q. (Hint: Your answer should be the disjunction of two sentences.)
2.1.7 Let m and n be two integers. Consider the statement:
m and n are not both even.
(a) Your friend writes this statement as
m n are not both even.
What are some issues with what your friend wrote, if any?
35
(b) Then your friend claims that the negation of this statement is
m or n is odd.
Is this the correct negation? If not, what is the correct negation?
2.1.8 Construct the truth tables for the propositions P (Q R) and (P Q) R. Are they the same?
2.1.9 Complete the truth table for the following proposition.
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.11 Prove the law of double negation, i.e., that
¬(¬P) is logically equivalent to P.
2.1.12 Prove that
(a) (P P) is logically equivalent to P
(b) (P P) is logically equivalent to P
This is known as idempotence for and , respectively.
2.1.13 Prove that
(a) P (P Q) is logically equivalent to P
(b) P (P Q) is logically equivalent to P
These are known as the absorption laws.
2.1.14 Prove or disprove: ¬P ¬Q is logically equivalent to P = (P ¬Q).
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.
(a) Is (P ¬P) = Q a tautology, a contradiction, or neither?
(b) Prove that ((P Q) ¬P) ¬Q is a contradiction.
(c) Prove that (¬P Q) (P ¬Q) ¬(P Q) is a tautology.
36
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.
2.1.18 Suppose that the following statements are true:
Every octagon is magical.
If a polygon is not a rectangle, then is it not a square.
A polygon is a square, if it is magical.
Is it true that ‘Octagons are rectangles’? Explain your answer.
(Hint: try rewriting each of the statements as an implication.)
2.1.19 (a) Use a truth table to prove the distributive law:
(P Q) R is logically equivalent to (P R) (Q R)
(b) Use logical algebra (see the aside on page 33) to prove that
(
(P = R) (Q = R)
)
(
(P Q) = R
)
is a tautology. (Hint: start by using the result of question 10)
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).
37
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.
(a) What can you say about S?
(b) What if, instead, (R S) (R S) is true?
Hopefully it is obvious to you that R is false. . .
2.1.24 Complete the following.
(a) Let F be a contradiction and R any proposition. Prove F R is a contradiction.
(b) Fill in the following proof of the fact that Q ¬(P = Q) is a contradiction.
Proof. We give a chain of logical equivalences which simplifies the statement:
Q ¬(P = Q) is logically equivalent to Q (P ¬Q) ( )
is logically equivalent to (Commutative law)
is logically equivalent to (Q ¬Q) P ( )
By part (a), since is a contradiction, so is (Q ¬Q) P. Hence Q ¬(P =
Q) is a contradiction.
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
(a) Prove P Q is logically equivalent to ¬(P Q).
(b) Find an expression built using only P and the connective which is logically equivalent
to ¬P.
(c) Find an expression built using only P, Q, and the connective which is logically equivalent
to P Q. [Hint: do the problem for P Q first, then use De Morgan’s laws.]
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?
38
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 x
2
> 4.
In this example P(5) is true, whilst P(1) is false. More generally, P(x) is true for some values of
39
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”).
Let P(x) be a propositional function. Then
x P(x) (read: for all x, P(x) is true)
is a proposition which is true if and only if P(x
0
) is true for all x
0
in the domain of P.
Definition 2.15. The existential quantifier is denoted (read “there exists”).
Let P(x) be a propositional function. Then
x P(x) (read: there is an x, such that P(x) is true)
is a proposition which is true if and only if there exists some x
0
in the domain of P such that P(x
0
) 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.
40
Example. Recall the above example where, for each real number x, P(x) is the proposition x
2
> 4.
Consider the quantified propositions:
x P(x) is false, since P(x) is not true for all x R. In particular P(1) is false.
x P(x) is true, since there is at least one x R for which P(x) is true, namely x = 5.
Definition 2.16. A counterexample to x P(x) is a single element x
0
in the domain of P such that
P(x
0
) is false.
An example of x P(x) is a single element x
0
in the domain of P such that P(x
0
) is true.
Clearly x
0
= 1 is a counterexample to x (x
2
> 4), while x
0
= 5 is an example of x (x
2
> 4).
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.
Two Common Translations
There are two constructions involving quantifiers which are common enough that we point them out
here. It can be useful to understand the underlying logical structure of statements of the form “all
A’s are B’s” and “there is an A which is a B”. The sentences “all primes greater than 2 are odd” and
“there exists an odd prime” are somewhat natural examples of these types of statements.
Remark. Let P(x) and Q(x) be propositional functions. The statement
All A’s are B’s
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”:
Everything which satisfies P(x) also satisfies Q(x)
41
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)).
Example. “All humans are mortal” is written in logic as x (P(x) = Q(x)) where P(x) is x is a
human” and Q(x) is x is mortal”.
Example. We let P(x) be x is a prime number”, Q(x) be x > 2, and O(x) be x is odd”. Then “all
primes greater than 2 are odd” can be written as
x [ (P(x) Q(x)) = O(x)].
“There is an odd prime” can be written as
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 numbers
a
. 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 = y
3
). So “every real number is a cube” is
x R y R (x = y
3
).
42
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 = y
2
).
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.
Aside. Clarity versus Concision
As with all forms of art, different practitioners of mathematics have different tastes. Some write
very concisely, keeping words to a minimum. Some write almost entirely in English. Some use a
hybrid of quantifiers and English, aiming for a balance between brevity and clarity. For example,
consider the famous sum of four squares theorem:
English Every positive integer may be written as the sum of the squares
of four integers
Extreme Logic (n N)(a, b, c, d Z)(n = a
2
+ b
2
+ c
2
+ d
2
)
Hybrid n N, a, b, c, d Z such that n = a
2
+ b
2
+ c
2
+ d
2
The purpose of writing mathematics is to help the reader understand what you’ve written without
you being there to explain it. Your presentation style has an enormous effect on whether you are
successful! A good rule is to write in sentences, replacing words with symbols only when it makes
things more readable while simultaneously preserving the flow of the sentence.
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.
Negating Quantified Propositions
Perhaps the most important skill to have regarding quantifiers (in this course) is knowing how to
negate them.
43
Theorem 2.17. For any propositional function P(x), we have:
1. ¬(x P(x)) is logically equivalent to x ¬P(x).
2. ¬(x P(x)) is logically equivalent to x ¬P(x).
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.
1. The negation of the statement, ‘Everyone owns a bicycle’ is:
Somebody does not own a bicycle.
It is extremely pedantic, but symbolically we might write:
¬
h
people x, x owns a bicycle
i
a person x such that x does not own a bicycle.
2. Suppose that x is a real number and consider the quantified proposition:
x such that sin x = 4.
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:
x, such that y we have xy = 3.
It is easy to see that the negated statement is true:
44
Proof. Let x = 0, then, regardless of y, we have xy = 0 = 3.
Because the negation is true, the original statement is false.
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 = y
2
).
Note that this is a true statement and so its negation must be false. So something like
x 0 y R (x = y
2
)
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 = y
2
).
Advice when Negating: Hidden and Excess Quantifiers
Theorem 2.17 seems very simple, but it is easy to misuse. Here are some points to consider when
negating quantifiers.
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.
If n is an odd integer, then n
2
is odd. ()
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 = n
2
is odd).
45
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 n
2
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.
Putting it all together: the definition of continuity
You might have seen the strict definition of continuity in a calculus class.
4
It combines multiple
quantifiers, a hidden quantifier and an implication. The purpose of this example isn’t to teach you
the subtleties of continuity. Just as with the linear independence example, we simply want to be able
to read and negate such expressions.
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,
ε > 0 δ > 0 such that |x a| < δ = |f (x) f (a)| < ε. ()
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 proposition
5
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)| < ε.
46
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:
1. For every person x, there exists a person y such that y is a friend of x.
2. There exists a person y such that, for every person x, y is a friend of x.
Assuming that x and y always represent people, we can rewrite the sentences as follows:
1. x y such that y is a friend of x.
2. y such that x we have that y is a friend of x.
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:
1. Everyone has at least one friend.
2. There is someone who is friends with everybody.
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?
days x, a person y such that y was born on day x.
a person y such that, days x, y was born on day x.
circles x, a point y such that y is the center of x.
a point y such that, circles x, y is the center of x.
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 x
2
1 = 0 with domain all real numbers. 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)
47
(f) x P(x)
(g) ¬x P(x)
2. A value x
0
for which P(x
0
) is false is known as a(n)
(a) example.
(b) counterexample.
(c) realization.
(d) solution.
3. Which of the following are equivalent to the given expression?
¬x y P(x, y)
(a) x y P(x, y)
(b) ¬x y P(x, y)
(c) x y ¬P(x, y)
(d) x y ¬P(x, y)
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.
(a) Every class has an instructor.
(b) For all real numbers x and y, if x and y are positive, then there exists a positive integer n
such that nx > y.
(c) There exists a real number which is positive, and is less than 1/n, for each positive integer
n.
Video Solution
2.2.2 Negate the following.
(a) Every class has an instructor.
(b) For all real numbers x and y, if x and y are positive, then there exists a positive integer n
such that nx > y.
(c) There exists a real number which is positive, and is less than 1/n, for each positive integer
n.
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 y
4
= 4x.
48
(b) y R such that x R we have y
4
= 4x.
(c) y R, x R such that y
4
= 4x.
(d) x R such that y R we have y
4
= 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)
2.2.3 Suppose someone claims that the negation of
x
2
> 0 = x > 0
is x
2
> 0 and x 0.’ Why is this incorrect? What is the correct negation?
2.2.4 Consider the propositional function
P(x, y, z) : (x 3)
2
+ (y 2)
2
+ (z 7)
2
> 0
where the domain of each of the variables x, y and z is R.
(a) Express the quantified statement x R, y R, z R, P(x, y, z) in words.
(b) Is the quantified statement in (a) true or false? Explain.
(c) Express the negation of the quantified statement in (a) in symbols.
(d) Express the negation of the quantified statement in (a) in words.
(e) Is the negation of the quantified statement in (a) true or false? Explain.
2.2.5 The following statements are about positive real numbers. Which one is true? Explain your
answer.
(a) x y such that xy < y
2
.
(b) x such that y xy < y
2
.
2.2.6 Which of the following statements are true? Explain.
(a) a married person x such that married people y, x is married to y.
(b) married people x, a married person y such that x is married to y.
49
2.2.7 A function f is said to be decreasing if:
x y = f (x) f (y).
(a) There is a hidden quantifier in the definition: what is it?
(b) State what it means for f not to be decreasing.
(c) Give an example to demonstrate the fact that not decreasing and increasing do not mean the
same thing!
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).
Let x be an element of a field F. An inverse of x is an element y in F such that xy = 1.
Consider the following proposition:
All non-zero elements in a field have an inverse.
(a) Restate the proposition using both of the quantifiers and .
(b) Find the negation of the proposition, again using quantifiers.
2.2.10 Consider the following proposition.
m, n R, m > n = m
2
> n
2
. (†)
(a) What is the negation of (†)?
(b) Prove that (†) is false.
(c) Suppose you rewrite the proposition as follows
m, n A, m > n = m
2
> n
2
.
What is the largest collection (set) of real numbers A for which the proposition is true?
Justify your answer.
2.2.11 Let P(x) be a propositional function and n a positive integer.
(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 (x
n
) = (x
1
, x
2
, x
3
, . . .).
50
x
n
diverges to means: M > 0, N N such that n > N = x
n
> M.
x
n
converges to L means: ε > 0, N N such that n > N =
|
x
n
L
|
< ε.
Here we assume that all elements of (x
n
) are real numbers.
(a) State what it means for a sequence x
n
not to diverge to . Beware of the hidden quantifier!
(b) State what it means for a sequence x
n
not to converge to L.
(c) State what it means for a sequence x
n
not to converge at all.
(d) (Hard) Prove, using the definition, that the sequence defined by x
n
= n diverges to .
(e) (Hard) Prove that the sequence defined by x
n
=
1
n
converges to zero.
[You may want to revisit the last two parts after reading the following sections.]
51
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.
Direct Assume P is true and deduce that Q is true.
Contrapositive Assume ¬Q and deduce ¬P. This is enough since the contrapositive ¬Q = ¬P
is logically equavalent to P = Q.
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.
Induction This has a completely different flavor: we will consider it in Chapter 5.
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.
Theorem 2.20. Suppose that x is an integer. If 3x + 5 is even, then 3x is odd.
Direct Proof. We show that if 3x + 5 is even then 3x is odd.
Assume that 3x + 5 is even, then 3x + 5 = 2n for some integer n. Hence
3x = 2n 5 = 2(n 3) + 1.
This is clearly odd, because it is of the form ‘an even integer plus one.’
Contrapositive Proof. We show that if 3x is even then 3x + 5 is odd.
Assume that 3x is even, and write 3x = 2n for some integer n. Then
3x + 5 = 2n + 5 = 2(n + 2) + 1.
This is odd, because n + 2 is an integer.
52
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
5 = (3x + 5) 3x = 2m 2n = 2(m n).
Since m n is an integer, this says that 5 is even: a contradiction.
Some simple proofs
Theorem 2.21. Let m, n Z. Both m and n are odd if and only if the product mn is odd.
There are really two theorems here:
() If m and n are both odd integers, then the product mn is odd.
() If the product mn of two integers is odd, then both m and n are odd.
Often when there are two directions you’ll have to prove them separately. Here we give a direct proof
for () and a contapositive proof for ().
Proof. () Let m and n be odd. Then m = 2k + 1 and n = 2l + 1 for some k, l Z. Then
mn = (2k + 1)(2l + 1) = 4kl + 2k + 2l + 1 = 2(2kl + k + l) + 1.
This is odd, because 2kl + k + l Z.
() 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,
mn = m(2k) = 2(mk) is even.
a
See ‘Potential Mistakes’ below for what this means.
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:
Assume that mn is odd, then mn = 2k + 1 for some integer k. Then. . .
We are stuck!
Theorem 2.22. If 3x + 5 is even, then x is odd.
We can prove this directly, by the contrapositive method, or by contradiction. We’ll do all of them,
so you can appreciate the difference.
53
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.
Because 3m + 2 Z, we have 3x + 5 odd.
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.
Alternative Direct Proof. Suppose 3x + 5 is even, so 3x + 5 = 2n for some integer n. Then
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!
Common Mistake 1. Generality and ‘Without Loss of Generality’
There are many common mistakes in the writing of proofs that you should be careful to avoid. Here
are two incorrect ‘proofs’ of the = direction of Theorem 2.21.
6
The Hungarian mathematician Paul Erd
˝
os 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. . .
54
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.
Fake Proof 2. Let m = 2k + 1 and n = 2k + 1 be odd. Then,
mn = (2k + 1)(2k + 1) = 2(2k
2
+ 2k) + 1
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
m is odd = m = 2k + 1 for some integer k
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
m is odd m = 2k + 1 for some integer k
Common Mistake 3. Becoming distracted by algebra Here is a palpably ludicrous ‘theorem’
which illustrates another potential mistake.
55
Theorem (Fake Theorem). The only number is zero.
Fake Proof. Let x be any number and let y = x, then
x = y = x
2
= xy (Multiply both sides by x)
= x
2
y
2
= xy y
2
(Subtract y
2
from both sides)
= (x y)(x + y) = (x y)y (Factorize)
= x + y = y (Divide both sides by x y)
= x = 0
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.
More simple proofs
We continue with more straightforward proofs. None of these results are particularly important, they
are just exercises in deciding how to present an argument.
Theorem 2.23. Suppose that x R. Then x
3
+ 2x
2
3x 10 = 0 = x = 2.
We can prove this theorem using any of the three methods. All rely on your ability to factorize the
polynomial:
x
3
+ 2x
2
3x 10 = (x 2)(x
2
+ 4x + 5) = (x 2)
h
(x + 2)
2
+ 1
i
,
and partly on your knowledge that ab = 0 a = 0 or b = 0 (proof in the exercises).
Direct Proof. If x
3
+ 2x
2
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.
Contrapositive Proof. Suppose that x = 2. Then x
3
+ 2x
2
3x 10 = (x 2)[(x + 2)
2
+ 1] = 0 since
neither of the factors is zero.
56
Contradiction Proof. Suppose that x
3
+ 2x
2
3x 10 = 0 and x = 2. Then
0 = x
3
+ 2x
2
3x 10 = (x 2)[(x + 2)
2
+ 1].
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. x
3
+ 2x
2
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 of P = Q, we assume that (1) and deduce that
(2) .
(a) (1) ¬Q is true, (2) P is true
(b) (1) Q is false, (2) P is true
(c) (1) ¬P is true, (2) ¬Q is true
(d) (1) ¬Q is true, (2) ¬P is true
2. A proof by contradiction of P = Q begins by assuming that .
(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.
57
(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 x
2
+ y
2
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 + b
2
+ 4 is
odd.
2.3.2 Augustus de Morgan satisfied his own problem:
I turn(ed) x years of age in the year x
2
.
(a) Given that de Morgan died in 1871, and that he wasn’t the beneficiary of some miraculous
anti-aging treatment, find the year in which he was born.
(b) Suppose you have an acquaintance who satisfies the same problem. How old will they
turn this year?
Give a formal argument which justifies that you are correct.
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?
2.3.4 Prove that if n is a positive integer greater than 1, then n! + 2 is even.
Here n! denotes the factorial of the integer n. Look up the definition if you forgot about it.
2.3.5 Consider the following proposition, where x is assumed to be a real number.
x
3
3x
2
2x + 6 = 0 = x = 3 ()
(a) Is the proposition () true or false? Justify your answer. Is its converse true?
58
(b) Repeat part (a) for the proposition
x
3
3x
2
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.6 (a) Let x Z. Prove that
5x + 3 is even if and only if 7x 2 is odd.
Can you conclude anything about 7x 2 if 5x + 3 is odd?
(b) Prove or disprove: An integer n is even if and only if n
3
is even.
2.3.7 Let n and m be positive integers. Prove n
2
m is even if and only if n and m are not both odd.
2.3.8 Let x and y be integers. Prove x
2
+ y
2
is even if and only if x and y have the same parity (i.e.
both even or both odd).
2.3.9 Let n be an integer. Prove n
2
+ n + 58 is even.
2.3.10 Below is the proof of a result. What result is being proved?
Proof. Assume that x is odd. Then x = 2k + 1 for some integer k. Then
2x
2
3x 4 = 2(2k + 1)
2
3(2k + 1) 4 = 8k
2
+ 2k 5 = 2( 4k
2
+ k 3) + 1.
Since 4k
2
+ k 3 is an integer, 2x
2
3x 4 is odd.
2.3.11 Here is another proof. What is the result this time?
Proof. Assume, without loss of generality, that x and y are even. Then x = 2a and y = 2b for
some integers a, b. Therefore,
xy + xz + yz = (2a)(2b) + (2a)z + (2b)z = 2(2ab + az + bz).
Since 2ab + az + bz is an integer, xy + xz + yz is even.
2.3.12 Consider the following proof of the fact that (for m an integer) if m
2
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 m
2
is even, but m is odd. Say m = 2k + 1 for some
integer k. Then
m
2
= (2k + 1)
2
= 4k
2
+ 4k + 1 = 2( 2k
2
+ 2k) + 1
59
is odd, contradicting that m
2
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.14 Prove that ab = 0 a = 0 or b = 0.
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.
(a) Find the contrapositive of P.
(b) Find the converse of P.
(c) Find the negation of P.
(d) Imagine you are a detective and want to find the truth value of P. Describe your action-
strategy in full detail.
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.
2.3.18 Numbers of the form
k(k+1)
2
, where k is a positive integer, are called triangular numbers. Prove
that n is the square of an odd number if and only if
n1
8
is triangular.
60
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.
Now we can present a theorem.
Theorem 2.25. If n Z is divisible by p N, then n
2
is divisible by p
2
.
Proof. We prove directly. Let n be divisible by p. Then n = pk for some k Z. Then n
2
= p
2
k
2
, and
so n
2
is divisible by p
2
.
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.
Definition 2.26. An integer n is said to have remainder r = 0, 1, or 2 upon division by 3 if we can
write n = 3k + r for some integer k.
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.
Theorem 2.27. If n is an integer, then n
2
has remainder 0 or 1 upon dividing by 3.
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 n
2
= 9m
2
= 3(3m
2
) has remainder 0.
(b) If n has remainder 1, then n = 3m + 1 for some m Z and so
n
2
= 9m
2
+ 6m + 1 = 3(3m
2
+ 2m) + 1 has remainder 1.
(c) If n has remainder 2, then n = 3m + 2 for some m Z and so
n
2
= 9m
2
+ 12m + 4 = 3(3m
2
+ 4m + 1) + 1 has remainder 1.
61
Thus n
2
has remainder 0 or 1.
Proving Universal Statements
You have already seen many examples of proving universal statements in Section 2.3, albeit where
the universal quantifier was hidden. For example, Theorem 2.22 could be written explicitly with the
universal quantifier: x Z, if x is odd, then 3x + 5 is odd. Proving this version with the explicit
universal quantifier would go much the same way as with the version with the hidden quantifier.
Sometimes theorems are not written explicitly in the form x (P(x) = Q(x)). Here is one
example, called the Arithmetic Mean - Geometric Mean Inequality, or AM-GM for short.
Theorem 2.28. For all positive real numbers x and y, we have
x + y
2
xy.
This theorem is written in the form x, y > 0, P(x, y) where P(x, y) is the statement
x+y
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:
If x, y > 0, then
x + y
2
xy.
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:
x
2
2xy + y
2
0 (x
2
+ 2xy + y
2
) 4xy 0
x
2
+ 2xy + y
2
4xy
(x + y)
2
4xy
x + y 2
xy ()
x + y
2
xy.
The square-root in () is well-defined because x + y is positive, which is true because we assumed x
and y are positive.
a
a
Moreover, the inequality is preserved since the function f (t) = t
2
is increasing when t is positive.
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 > 0,
x + y
2
xy
62
is true. Pushing the negation through, our contradiction assumption becomes
x, y > 0,
x + y
2
<
xy.
Contradiction Proof. Suppose that
x+y
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:
(x + y)
2
< 4xy x
2
+ 2xy + y
2
< 4xy
x
2
2xy + y
2
< 0
(x y)
2
< 0.
Since squares of real numbers are non-negative, this is a contradiction. Thus
x+y
2
xy.
Proving Existential Statements
Now we look at proving existential statements of the form x P(x). The most simple approach is to
come up with some object x
0
such that P(x
0
) is true. Such an x
0
is called an example or witness of P(x).
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.
Disproving Universal Statements
What does it take to show that some universal statement is false? If a statement has the form x P(x),
then by Theorem 2.17, its negation is x ¬P(x). In other words, disproving the universal statement
x P(x) is the same as proving the existential statement x ¬P(x). This amounts to providing a coun-
terexample, i.e., finding some x
0
such that P(x
0
) is false.
Example. Disprove the following statement. If all four sides of a quadrilateral have the same length,
then the quadrilateral must be a square.
63
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.
A
B
C
A
Figure 2: Square of side length a + b.
Disproving Existential Statements: Non-existence Proofs
When a theorem claims that something does not exist, it is generally a good idea to try a contra-
positive or a contradiction proof. This is since ‘does not exist’ is already a negative statement. A
contradiction or contrapositive proof of a theorem P = Q already involves the negated state-
ment ¬Q. If Q states that something does not exist, then ¬Q states that it does, which often gives
you something to play with! To see this in action, consider the following result.
Theorem 2.30. The equation x
17
+ 12x
3
+ 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.
For all x, if x
17
+ 12x
3
+ 13x + 3 = 0, then x 0.
The theorem is now in the form x( P(x) = Q(x) ), with:
P(x) : x
17
+ 12x
3
+ 13x + 3 = 0, Q(x) : x 0.
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.
64
Proof. Assume that a real number x satisfies x
17
+ 12x
3
+ 13x + 3 = 0, and that x > 0. Because all
terms on the left hand side are positive, we have x
17
+ 12x
3
+ 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.
Combining and Subdividing Theorems
Sometimes it is useful to break a proof into pieces, akin to viewing a computer program as a collection
of subroutines that you combine for some greater purpose. Usually the intention is to make the proof
of a difficult result more readable, but you may also wish to emphasize the importance of certain
aspects of your work. Mathematics does this by using lemmas and corollaries.
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.
Lemma 2.31. Suppose that n Z. Then n
2
is even n is even.
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 N. Thus saying that
2 is irrational is equivalent to saying that there are no m, n N such that
2 =
m
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.
65
Proof. Suppose that
2 =
m
n
for some m, n N. Without loss of generality, we may assume that m, n
have no common factors.
Then m
2
= 2n
2
which says that m
2
is even.
By Lemma 2.31 we have that m is even.
Thus m = 2k for some k Z.
But now, n
2
= 2k
2
, 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 =
m
n
,
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!
m
2
= 2n
2
= n
2
= 2k
2
= k
2
= 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 a
b
is a rational number.
Proof. By Theorem 2.32, we know that
2 is irrational. Consider the number (
2)
2
. There are two
possibilities. If (
2)
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 a
b
is rational.
66
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 a
b
rational. Instead, we have shown that the
theorem is true whether or not (
2)
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 follows
7
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.
Theorem 2.35. There are infinitely many prime numbers.
Proof. We prove by contradiction. Assume there are exactly n prime numbers p
1
, . . . , p
n
and consider
the integer
Π := p
1
··· p
n
+ 1.
Certainly Π is divisible by some prime: since we are assuming that the list p
1
, . . . , p
n
contains all the
primes, Π must be divisible by some prime p
i
in the list. However, the product p
1
··· p
n
is clearly
divisible by p
i
, whence so is the difference
a
Π p
1
··· p
n
= 1.
We conclude that 1 is divisible by the prime p
i
, contradicting
b
the fact that p
i
2.
a
Is this obvious? Can you prove it?!
b
Euclid’s original argument was not strictly by contradiction. Instead he asserted that, given any list of primes
p
1
, . . . , p
n
, the number Π must be divisible by a new prime not in his list.
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 .
(a) contradiction is more powerful than a direct proof.
(b) direct and contrapositive proofs are too complicated.
7
This is not completely obvious: we will prove it much later in Theorem 5.19.
67
(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 True or False: When proving an existential statement like x P(x), it suffices to give an explicit
example of an x for which P(x) holds.
2.4.4 In the proof that
2 is irrational, we started by assuming that
2 =
m
n
for integers m and n with
no common factors. Why is this justified?
(a) Because no pair of two integers ever has a common factor.
(b) Because any rational number
m
n
can be seen, by canceling the common factors of m and n,
to be equal to a rational
m
n
where m
and n
have no common factors.
(c) It is not justified, we have lost generality by making this assumption.
(d) Because
2 is irrational.
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
68
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.
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.2 Let P be the proposition: ‘Every positive integer is divisible by thirteen.’
(a) Write P using quantifiers.
(b) What is the negation of P?
(c) Is P true or false? Prove your assertion.
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 R
2
such that, for all points A, B R
2
, we have A, B
lie on L.
2.4.5 Prove that between any two distinct rational numbers there exists another rational number.
2.4.6 Consider the statement:
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.7 Let p be an odd integer. Prove that x
2
x p = 0 has no integer solutions.
2.4.8 Prove: For every positive integer n, n
2
+ n + 3 is an odd integer greater than or equal to 5.
There are two claims here: n
2
+ n + 3 is odd, and n
2
+ n + 3 5.
2.4.9 In this question, you should use the following definition of the rational numbers.
Definition. A real number x is rational if it may be written in the form x =
p
q
where p is an
integer and q is a positive integer. x is irrational if it is not rational.
Prove or disprove the following conjectures.
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.
Conjecture (2). If x and y are rational numbers, then 3x + 4xy + 2y is rational.
Conjecture (3). If x and y are irrational numbers, then 3x + 4xy + 2y is irrational.
69
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.
(a) Give three examples and three non-examples of Snake-like integers.
(b) Given y Z, compute the negation of the statement, y is Snake-like.’
(c) Show that every Snake-like integer is a multiple of 9.
(d) Show that the statements, n is Snake-like,’ and, n is a multiple of nine,’ are not equivalent.
2.4.11 Prove that it is never the case that x
2
= 2y
2
for integers x and y.
2.4.12 Here is an alternative argument that
2 is irrational. Suppose that
2 =
m
n
where m, n N.
This time we don’t assume that m, n have no common factors.
(a) m, n satisfy the equation m
2
= 2n
2
. Prove that there exist positive integers m
1
, n
1
which
satisfy the following three conditions:
m
2
1
= 2n
2
1
, m
1
< m, n
1
< n.
(b) Show that there exist two sequences of decreasing positive integers m > m
1
> m
2
> ···
and n > n
1
> n
2
> ··· which satisfy m
2
i
= 2n
2
i
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.
70
2.4.16 Suppose that x, y, z are real numbers such that x + y + z = 1. Prove
(1 x)(1 y)(1 z) 8xyz.
[Hint: find a way to apply the AM-GM inequality.]
2.4.17 You are given the following facts.
(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 x
17
+ 12x
3
+ 13x + 3 = 0 has exactly one solution x,
and that x lies in the interval (1, 0).
2.4.18 (Hard) This question uses Definition 2.19.
(a) Prove, directly from the definition, that f (x) = x
2
is continuous at x = 0. If you are given
ϵ > 0, what should δ be?
(b) Prove that g(x) =
(
1 + x if x 0,
x if x < 0,
is discontinuous at x = 0.
(c) (Very hard) Let h(x) =
(
x if x is rational,
0 if x is irrational.
Prove that f is continuous only at x = 0.
2.4.19 (Hard) In this question we prove Rolle’s Theorem from calculus:
Suppose f is continuous on [a, b], differentiable on (a, b), and f (a) = f (b) = 0, then
c (a, b) such that f
( c) = 0.
As you work through the question, think about where the hypotheses are used and why we
need them.
(a) Recall the Extreme Value Theorem. The function f is continuous on [a, b], so f is bounded
and attains its bounds. Otherwise said,
m, M [a, b] such that x [a, b] we have f (m) f (x) f (M).
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:
f (M) > 0 or f (m) < 0.
(c) Without loss of generality, we may assume that f (M) > 0. By considering the function
f , explain why.
71
(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).
(e) Suppose that 0 < h < b M. Show that
f (M + h) f (M)
h
0.
How do we know that L
+
:= lim
h0
+
f (M+h)f (M)
h
exists? What can you conclude about L
+
?
(f) Repeat part (d) for L
:= lim
h0
f (M+h)f (M)
h
.
(g) Conclude that L
+
= L
= 0. Why have we completed the proof?
72
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.
3.1 Set Notation and Describing a Set
We start with a na
¨
ıve notion: a set is a collection of objects.
8
Definition 3.1. A set is a collection of objects.
If x is an object in a set A, we write x A and say that x is an element or member of A. On the
other hand, if x is a member of some other set B, but not of A, we write x / A.
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
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
represents a set A with at least three elements a
1
, a
2
, a
3
. The element x
does not lie in A.
A
a
1
a
2
a
3
x
Notation and Conventions
We use capital letters for sets, e.g. A, B, C, S, and lower-case letters for elements. It is conventional,
though not required, to denote an abstract element of a set by the corresponding lower-case letter:
thus a A, b B, etc.
Curly brackets {, } are used to bookend the elements of a set: for instance, if we wrote
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}.
Listing all the elements in such a fashion is known as roster notation.
By contrast, set-builder notation describes the elements of a set by starting with a larger set and
restricting to those elements which satisfy some property. The symbols | or : are used as a short-hand
8
For this course, our notion is enough. It eventually became clear that some collections of objects cannot be considered
sets, and the search for a completely rigorous definition began; thus was Axiomatic Set Theory born.
73
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,
{s S | s is a Greek letter} = {s S : s is a Greek letter} = {α, β}
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
A = {2n Z : n = 1, 2 or 3} and B = {n Z | 1 n 6 and n = 3, 4}.
We now practice the opposite skill by converting five sets from set-builder to roster notation.
S
1
= {a A : a is divisible by 4} = {4}
S
2
= {b B : b is odd} = {1, 5}
S
3
= {a A | a B} = {2, 6}
S
4
= {a A : a ∈ B} = {4}
S
5
= {b B | b is odd and b 1 A} = {5}
Take your time getting used to this notation. Can you find an alternative description in set-builder
notation for the sets S
1
, . . . , S
5
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.
N = Z
+
= natural numbers = {1, 2, 3, 4, . . .}
N
0
= {0, 1, 2, 3, 4, . . .}
Z = integers = {. . . , 3, 2, 1, 0, 1, 2, 3, . . .}
Q = rational numbers = {
m
n
: m Z and n N} = {
a
b
: a, b Z and b = 0}
R = real numbers
R \Q = irrational numbers (read R minus Q’)
C = complex numbers = {x + iy : x, y R, where i =
1}
Z
n
= integers n = {n, n + 1, n + 2, n + 3, . . .}
9
See Choice of Notation, below.
74
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 N
0
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.
2Z = {2n Z : n Z} (The set of integers of the form 2n such that n is an integer)
= {n Z : k Z, n = 2k} (The set of integers which are a multiple of 2)
= {n Z : 2 |n} (The set of integers which are divisible by 2)
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
2
Z =
1
2
x : x Z
=
m, m +
1
2
: m Z
is the set of multiples of
1
2
(comprising the integers and half-integers). The notation can also be
extended: for example 2Z + 1 would denote the odd integers.
Aside. Choice of Notation
The notations | and : for ‘such that’ give you leeway in case one these symbols is being used
to mean something else. For example, the final expression (above) for the even numbers is much
cleaner than the alternative
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)}.
In this case the latter notation is clearly superior.
Examples. 3.1.1 Write the set A = {x R : x
2
+ 3x + 2 = 0} in roster notation.
We are looking for the set of all real number solutions to the quadratic equation x
2
+ 3x + 2 = 0.
A simple factorization tells us that x
2
+ 3x + 2 = (x + 1)(x + 2), whence A = {−1, 2}.
3.1.2 Use the set B = {0, 1, 2, 3, . . . , 24} to describe C = {n Z : n
2
3 B} in roster notation.
75
We see that
n
2
3 B n
2
{3, 4, 5, . . . , 25, 26, 27}
Since n must be an integer in order to be an element of C, it follows that
C = 2, ±3, ±4, ±5}.
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
D =
1
6
,
1
20
,
1
42
,
1
72
,
1
110
,
1
156
, . . .
,
you might consider it reasonable to write
D =
1
2n(2n + 1)
: n N
.
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!
3.1.4 Are the following sets equal?
E = {n
2
+ 2 Z : n is an odd integer}, F = {n Z : n
2
+ 2 is an odd integer}.
It may help to first construct a table listing some of the values of n
2
+ 2:
n n
2
n
2
+ 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 n
2
+ 2 where n is an odd integer. By the table,
E = {3, 11, 27, 51, 83, . . .}.
76
On the other hand, F includes all those integers n such that n
2
+ 2 is odd. It is easy to see that
n
2
+ 2 is odd n
2
is odd n is odd.
Thus F is simply the set of all odd integers:
F = 1, ±3, ±5, ±7, . . .} = 2Z + 1.
Plainly the two sets are not equal.
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,
(0, 1) = {x R : 0 < x < 1}, (Open interval)
[0, 1] = {x R : 0 x 1}, (Closed interval)
(0, 1] = {x R : 0 < x 1}. (Half-open interval)
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 =
1
2
where x lies in the interval [0, 4π]. This set can be written in set-builder and roster notation as
x [0, 4π] : cos x =
1
2
=
2π
3
,
4π
3
,
8π
3
,
10π
3
1
0
1
y
x
π 2π 3 π 4π
2π
3
4π
3
8π
3
10π
3
1
2
Cardinality and the Empty Set
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.
77
Examples. 3.1.1 Let A = {a, b, α, γ,
2}, then
|
A
|
= 5.
3.1.2 Let B =
n
4, {1, 2}, {3}
o
. 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 : x
2
+ 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? Select all that apply.
{0, 1, 2, 3, 4}
(a) {x N
0
: 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}?
78
(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 : x
2
5x + 4 = 2}
(b) {x Q : 2x Z}
(c) {n
2
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}
(c) {1,
1
4
,
1
16
,
1
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
79
Exercises
3.1.1 Describe the following sets in roster notation: that is, list their elements.
(a) {x N : x
2
5x}.
(b) {x
2
R : x
2
3x + 2 = 0}.
(c)
n {4, 3, 2, 1, 0, 1, . . . , 21} : 4 |n
2
(does : or | denote the condition?)
(d) {x
1
2
Z : 0 x 4 and 4x
2
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,
1
3
,
1
7
,
1
15
,
1
31
, . . .}
3.1.3 Let
A =
B = {A}
C = {{A}}
D = {A, {0}, {0, 1}}
Answer True or False for each of the following:
(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.
(a) {x R : x > 5 and x 19}
(b) {x R : x 5 or x 19}
(c) {x
2
R : x = 0}
(d) {x R
: x
2
16 and x
3
27}
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?
80
3.1.7 What is the cardinality of the following set? What are the elements?
n
,
,
, {}
o
.
3.1.8 Let A = {1,2,3,4}, and let B be the set
B =
n
{x, y} : x, y A
o
.
(a) Describe B in roster notation.
(b) Now compute the cardinality of the sets
C =
n
x, {y}
: x, y A
o
and
D =
n
x, {y}
: x, y A
o
.
Compare them to
|
B
|
.
3.1.9 Prove or disprove the following conjectures.
(a) There exists x R \Q such that x
2
Q.
(b) For all x R \Q we have x
2
Q.
81
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.
The concept of subset provides us with an extremely important characterization of equality.
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
should be clear that the only valid subset relation between the
three is A B.
A
B
C
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.
Examples. 3.2.1 N = {n Z : n > 0}. This is clearly a subset of Z.
3.2.2 {x R : x
2
1 = 0} {y R : y
2
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.
82
Here we collect several results relating to subsets.
Theorem 3.5. 3.2.1 If
|
A
|
= 0, then A = (Uniqueness of the empty set)
3.2.2 For any set A, we have A and A A (Trivial and non-proper subsets)
3.2.3 If A B and B C, then A C (Transititvity of 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.
3.2.2 True or False: {R } {{R}}.
3.2.3 How many subsets does the set A = {0, 1} have?
(a) 1
(b) 2
(c) 3
(d) 4
83
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 = {0, {0}, {1, 2}, {0, {1, 3}}}
Answer True or False for each of the following:
(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 | (n
2
1) }
D = {t Z : t
2
+ 3 [ 4, 20)}
Of the 12 possible subset relations A B, A C, . . . D C, which are true and which false?
3.2.2 (a) Let A = {x R : x
3
+ x
2
x 1 = 0} and B = {x R : x
4
5x
2
+ 4 = 0}. Are either of
the relations A B or B A true? Explain.
(b) Let A = {4n : n Z} and B = {k Z : 3k + 5 is odd}. Prove or disprove: A B.
3.2.3 (a) Order the following sets according to which are subsets of which:
R, Z, N
0
, N, Q, C
84
(b) (Hammack’s Book of Proof , Section 1.3, Exercise 14) True or False? R
2
R
3
. Explain your
answer.
3.2.4 For which values of x > 0 is the following claim true?
[0, x] [0, x
2
]
Prove your assertion.
3.2.5 (a) Write down all proper subsets of {1, 2, 3}
(b) (Hammack’s Book of Proof, Section 1.3, Exercise 6) List all subsets of {R, Q, N}.
3.2.6 Write down all subsets of {, {}, {, {}}}.
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.8 Let A = {0, 2, 4, 6, 8, 10}. Write the set {X A : |X| = 2} in roster notation.
3.2.9 Suppose A B C A. Show A = B = C.
3.2.10 Fill in the blanks in the following proof of the fact that A B and B C implies A C.
Proof. Recall that X Y means X Y and . So A B and B C means
and which by Theorem 3.5 (insert ref here) gives A C. All that remains to show
is that A C. But if this is not true, then . But this would mean A = B because
, contradicting the fact that . Thus we conclude that
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.
Proof. () If m = nk k Z, then x mZ, we have x = mj = (nk)j nZ. Thus mZ nZ.
( ) Suppose mZ nZ, then m nZ, i.e. n | m.
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}.
85
(a) What is the negation of x is A-mirrored.’
(b) Find M
B
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
?
3.2.13 Define the set [1] by:
[1] = {x Z : 5 | (x 1)}.
(a) Describe the set [1] in roster notation.
(b) Compute the set M
[1]
, as defined in Exercise 3.2.12
(c) Are the sets [1] and M
[1]
equal? Prove/Disprove.
(d) Now consider the set [10] = {x Z: 5 | (x 10)}. Are the sets [10] and M
[10]
equal?
Prove/Disprove.
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.
3.2.15 Consider the set A = {a, b, c, d}.
(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}.
(a) Compute P(A) where A = {1, a, 5}.
(b) Prove or disprove: for any set A, A P(A).
(c) Prove or disprove: for any set A, A P(A).
(d) Give an explicit example of a set A such that A = and A P(A).
86
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
First we consider the set construction modeled on not.
Definition 3.6. Let A U be a set. The complement of A is the set
A
C
= {x U : x / A}.
This can also be written U \ A, U A, A
, or
A.
The Venn diagram is drawn on the right: A is represented by a
circular region, while the rectangle represents the universal set U.
The complement A
C
is the blue shaded region.
If B U is some other set, then the complement of A relative B is
B \ A = {x B : x / 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.
Note that A
C
= U \ A, so that the two definitions correspond.
A
A
C
A
C
: everything not in A
B \ A
A
B
U
B \ A: everything in B but
not in A
Example. Let U = {1, 2, 3, 4, 5}, A = {1, 2, 3}, and B = {2, 3, 4}. Then
A
C
= {4, 5}, B
C
= {1, 5}, B \ A = {4}, A \B = {1}.
Now we construct sets based on or and and.
Definition 3.7. The union of A and B is the set
A B = {x U : x A or x B}.
The intersection of A and B is the set
A B = {x U : x A and x B}.
We say that A and B are disjoint if A B = .
A \ B B \ A
A
B
A B
| { z }
A B
U
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.
87
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,
A B = {fish, dog, cat}, A B = {cat}.
3.3.2 Using interval notation, let U = [4, 5], A = [3, 2], and B = [4, 1). Then
A
C
= [4, 3) (2, 5], B
C
= [1, 5], B \ A = [4, 3), A \ B = [1, 2].
4 3 2 1 0 1 2 3 4 5
U
[ ]
A
[ ]
B
[ )
A
C
[ ) ( ]
B
C
[ ]
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.
The next theorem comprises the basic rules of set algebra.
Theorem 3.8. Let A, B, C be sets. Then:
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.
88
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.
Suppose that x A B. (Must show x A B x A)
Then x A and x B. (Definition of intersection)
But then x A, whence A B A (Definition of subset)
Now let y A. (Must show y A y A B)
Then y A or y B is true, from which we conclude that y A B.
Thus A A B.
The following theorem describes how complements interact with other set operations.
Theorem 3.9. Let A, B be sets. Then:
3.3.1 (A B)
C
= A
C
B
C
.
3.3.2 (A B)
C
= A
C
B
C
.
3.3.3 (A
C
)
C
= A.
3.3.4 A \ B = A B
C
.
3.3.5 A B B
C
A
C
.
A
B
(A B)
C
= A
C
B
C
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.
x (A B)
C
= x / A B
= x is not a member of both A and B
= x is not in at least one of A and B
= x / A or x / B
= x A
C
or x B
C
= x A
C
B
C
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 A
C
B
C
have the same elements, and are thus equal.
89
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 A
C
B
C
Finally, we have two results which describe the interaction of unions and intersections.
Theorem 3.10 (Distributive laws). For any sets A, B, C:
3.3.1 A (B C) = (A B) (A C)
3.3.2 A (B C) = (A B) (A 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
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.
Proof. () Let x A (B C). Then x A or x B C. There are two cases:
(a) If x A, then x A B and x A C by Theorem 3.8, part 2.
(b) If x B C, then x B and x C. It follows that x A B and x A C, again by
Theorem 3.8.
In both cases x (A B) (A C).
() Let y (A B) (A C). Then y A B and y A C. There are again two cases:
(a) If y A, then we are done, for then y A (B C).
(b) If y / A, then y B and y C. Hence y B C. In particular y A (B C).
In both cases y A (B C).
90
Reading Quiz
3.3.1 Let U = Z, A = 2Z, B = {1, 3, 5}. Which of the following statements are true?
(a) B A
C
.
(b) A and B are not disjoint.
(c) A B = Z.
(d) Z \ B is finite.
(e) A
C
= 2Z + 1
3.3.2 True or False: if A and B are sets, then B A B.
3.3.3 For sets A and B, the result that (A B)
C
= A
C
B
C
is most similar to which of the following
laws of logic?
(a) Law of double negation.
(b) Law of absorption.
(c) De Morgan’s laws.
(d) Law of associativity.
3.3.4 For sets A and B, which of the following are true?
(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
(a, b) (c, d) = (max{a, c}, min{b, d})
where we take the convention that (α, β) = if β < α.
Video Solution
3.3.2 Let U be a universal set and A and B sets. Prove that (A \B)
C
= A
C
B.
Video Solution
3.3.3 Let A be a set. Prove that if A B B for every set B, then A = .
Video Solution
91
Exercises
3.3.1 Describe each of the following sets in as simple a manner as you can: e.g.,
{x R : (x
2
> 4 and x
3
< 27) or x
2
= 15} = (, 2) (2, 3) {
15}.
(a) {x R : x
2
= x}
(b) {x R : x
3
2x
2
3x 0 or x
2
= 4}
(c) {x
2
R : x = 1}
(d) {z Z : z
2
is even and z
3
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:
d > 0: No element of A belongs to the set [x d, x].
Equivalently, A [x d, x] = . If this does not happen, we say that x is close to A.
(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 N
0
+ ·
3.3.5 Prove that B \ A = B A B = .
92
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) (A
C
)
C
= A.
(d) A B B
C
A
C
.
3.3.7 Write out a formal proof of the set identity
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 = B
C
\ A
C
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.
3.3.10 Let A and B be sets.
(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
AB = (A B) \(A B).
(a) Draw a Venn diagram of A and B and shade in the part of the diagram that comprises
AB.
(b) Prove AB = (A \ B) (B \ A).
(c) Say we wish to write AB in set-builder notation as
AB = {x U : ( x A) (x B)}.
Construct the truth table for .
93
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 .
Prove this statement is true.
3.3.13 Let A and B be finite sets.
(a) Find and example of A and B for which |A B| = |A| + |B|.
(b) Find an example of A and B for which |A B| = |A| + |B|. What do you notice about
A B in this example?
(c) The inclusion-exclusion principle says that, in general, we have
|A B| = |A| + |B| |A B|.
Looking at a Venn diagram, why does this make sense?
(d) Consider a calculus class with 100 students. Suppose that 85 of the students are either
math majors or engineering majors, 78 are only majoring in engineering, and 3 are double
majoring in both math and engineering. How many math majors are in the class?
(e) Formulate a similar expression for the cardinality of the union of three sets A B C (you
do not have to prove your assertion is correct).
(f) Using your answer to the previous part, find the number of integers between 1 and 100
which are not divisible by 2, 5, or 7.
94
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.
If f is a function from A to B we write f : A B. If a A, we write b = f (a) for the the element of
B assigned to a by the function f . We can also write f : a 7 b, which is read f maps a to 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).
Definition 3.12. If f : A B is a function and U is a subset of A. Then the image of U is the
following subset of B,
f (U) = {f (u) B : u U}.
The image of A is called the range or image of f ,
f (A) = range( f ) = Im( f ) = {f (a) B : a A}.
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
a
1
f (a
1
)
a
2
f (a
2
)
a
3
f (a
3
) = f (a
4
)
a
4
A
B
f (A)
95
For simple real-valued functions, the domain and range are
easily seen in a graph. For instance if f : [3, 2) R is the
square function
f : x 7 x
2
,
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,
f
[1, 2)
= [0, 4).
3
6
9
y
3 2 1 0 1 2
x
range
domain
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}.
f
a
1
f (a
1
)
a
2
f (a
2
)
a
3
f (a
3
) = f (a
4
)
a
4
a
5
f (a
5
)
A
B
V
f
1
(V)
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!
Examples. 3.4.1 Define f : Z {0, 1, 2} by f : n 7→ r, where r is the remainder of n
2
upon division
by 3. Here dom( f ) = Z and the codomain is {0, 1, 2}, but what is the range? Trying a few
examples, we see the following:
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!
96
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
It should be obvious that f (A) = range( f ) = A. Let U = {0, 1, 2, 3, 4}. Then
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}.
Let V = {0, 1, 2, 3, 4}. Then
f
1
(V) = {a A : f (a) V} = {a A : f (a) {0, 1, 2, 3, 4}} = {0, 1, 4, 7, 8}.
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
with range(g) = {0, 2, 4, 6, 8}.
3.4.4 Let A = {1, 2, 3, 4, 5} and let B = {two-element subsets of A}. We define
f : A B : a 7
(
{a, a + 1} if a = 5,
{5, 1} if a = 5.
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}
and, for example, that
f
1, 4
=
f (1), f (4)
=
{1, 2}, {4, 5}
.
If V = {{1, 2}, {5, 1}, {2, 2}, {3, 3}}. Then f
1
(V) = {1, 5}.
Injections, surjections and bijections
Definition 3.14. A function f : A B is one-to-one, injective, or an injection if it never takes the
same value twice. Equivalently,
a
a
1
, a
2
A, f (a
1
) = f (a
2
) = a
1
= a
2
.
f : A B is onto, surjective, or a surjection if it takes every value in the codomain: i.e., B =
range( f ). Equivalently,
b
b B, a A such that f (a) = b.
97
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 a
1
, a
2
A we have a
1
= a
2
= f (a
1
) = f (a
2
).
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 x
2
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.
81 R, yet there is no x [3, 2) such that f (x) = 81. Thus f is not surjective.
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:
g : [0, 2) R : x 7→ x
2
and h : [3, 0] R : x 7→ x
2
3
6
9
y
3 2 1 0 1 2
x
y = g(x)
3
6
9
y
3 2 1 0 1 2
x
y = h(x)
To see this, note that
g(x
1
) = g(x
2
) = x
2
1
= x
2
2
= x
1
= ±x
2
= x
1
= x
2
since both must be non-negative. The argument for h is similar.
By shrinking the codomain to equal the range we immediately create a surjective function:
j : [3, 2) [0, 9] : x 7→ x
2
Now consider the examples on page 96. The details are provided for example 1. For the others,
make sure you understand why the answer is correct.
Examples. 3.4.1 f : Z {0, 1, 2} : n 7 n
2
(mod 3) is neither injective nor surjective.
If f were injective, then we could not have f (1) = f (2).
2 is in the codomain {0, 1, 2} of f , yet 2 / range( f ), so f is not surjective.
3.4.2 This is a bijection. Indeed f is a permutation, a bijection from a set onto itself. To see injectivity,
98
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.
3.4.3 Neither injective, nor surjective.
3.4.4 Injective, but not surjective.
Here is a more complicated example.
Example. Prove that f : R \ {1} R \ {2} defined by f (x) = 2 +
1
1x
is bijective.
(Injectivity) Suppose that x
1
and x
2
are in R \ {1},
and f (x
1
) = f (x
2
). Then
2 +
1
1 x
1
= 2 +
1
1 x
2
.
A little elementary algebra shows that x
1
= x
2
, whence
f is injective.
(Surjectivity) Let y R \{2} and define x = 1
1
y2
.
This makes sense since y = 2. Then
f (x) = 2 +
1
1 (1
1
y2
)
= y
whence f is surjective.
y
x
2
1
1
1
1
2
2
3
3
4
4
5
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
1
y2
? The
answer is scratch work: just solve y = 2 +
1
1x
for x. Essentially we’ve shown that f has the inverse
function f
1
(x) = 1
1
x2
.
Aside. Inverse Functions
The word invertible is a synonym for bijective because bijective functions really have inverses!
Indeed, suppose that f : A B is bijective. Since f is surjective, we know that B = range( f ) and so
every element of B has the form f (a) for some a A. Moreover, since f is injective, the a in question
is unique. The upshot is that, when f is bijective, we can construct a new function
f
1
: B A : f (a) 7→ a.
This may appear difficult at the moment but we will return to it in Chapter 7.
99
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 x
4
. 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
g : [0, 2] [0, 16] : x 7→ x
4
,
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.
Functions and Cardinality
Injective and surjective functions are intimately tied to the notion of cardinality. Indeed, in Chapter
8, we will use such functions to give a definition of cardinality for infinite sets. For the present we
stick to finite sets.
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
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.
1
2
3
=
=
=
More generally, to show that n statements are equivalent, only n arguments are required.
100
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 = {a
1
, a
2
, a
3
, ··· , a
m
}
7
7
7
7
B = {b
1
, b
2
, b
3
, ··· , b
m
, ··· , b
n
}
A = {a
1
, a
2
, a
3
, ··· , a
m
}
7
7
7
7
B = {b
1
, b
2
, b
3
, ··· , b
m
,
z }| {
b
m+1
, ··· , b
n
}
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 = {a
1
, a
2
, . . . , a
m
}, B = {b
1
, b
2
, . . . , b
n
}.
1
2
Assume that m n. Define f : A B by f (a
k
) = b
k
. This is injective since the elements
b
1
, . . . , b
m
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 (a
k
) = b
k
. Now define g : B A by
g(b
k
) =
(
a
k
if k m,
a
1
if k > m.
Then g is surjective since every element a
k
is in the image of g.
3
1
Finally suppose that g : B A is surjective. Without loss of generality we may assume
that a
k
= g(b
k
) for 1 k m. Thus n m.
It is worth noting in the proof of
3
1
that the elements b
m+1
, . . . , b
n
may be mapped anywhere,
not just to a
1
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).
Corollary 3.16. If A, B are finite sets, then
|
A
|
=
|
B
|
f : A B bijective.
Proof. Suppose that m = n. The argument
1
2
creates an injective function f : A B. However
every element b
k
B is in the image of f , so this function is also surjective. Hence f is a bijection.
Conversely, if f : A B is a bijection, then it is injective, whence m n. It is also surjective, from
which n m. Therefore m = n.
101
Composition of functions
Finally, we consider composing function and, more particularly, how injectivity and surjectivity in-
teract with composition.
Definition 3.17. Suppose that f : A B and g : B C are functions. The composition g f : A C
is the function defined by (g f )(a) = g( f (a)) .
Note the order: to compute (g f )(x), you apply f first, then g.
f g
g f
a
f (a)
g( f (a))
A
B
C
Example. If f (x) = x
2
and g(x) =
1
x1
, then
(g f )(x) =
1
x
2
1
, and ( f g)(x) =
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,
dom(g f ) = R \ {±1}, and dom( f g) = R \ {1}.
Our first two results on composing injective and surjective functions is easy to remember.
Theorem 3.18. Let f : A B and g : B C be functions. Then:
3.4.1 If f and g are injective, then g f is injective.
3.4.2 If f and g are surjective, then g f is surjective.
It follows that the composition of bijective functions is also bijective.
102
Proof. 3.4.1 Suppose that f and g are injective and let a
1
, a
2
A satisfy (g f )(a
1
) = (g f )(a
2
). We
are required to show that a
1
= a
2
. However,
(g f )(a
1
) = (g f )(a
2
) = g
f (a
1
)
= g
f (a
2
)
= f (a
1
) = f (a
2
) (since g is injective)
= a
1
= a
2
(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.
Theorem 3.19. Suppose that f : A B and g : B C are functions.
3.4.1 If g f is injective, then f is injective.
3.4.2 If g f is surjective, then g is surjective.
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.
f g
a
2
a
1
b
2
b
1
b
3
c
2
c
1
A
B
C
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.
f : [0, 2] [4, 4] : x 7→ x
2
(injective only)
g : [4, 4] [0, 16] : x 7→ x
2
(surjective only)
g f : [0, 2] [0, 16] : x 7 x
4
(bijective!)
103
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.
Hence b = f (a) is an element of B for which g(b) = c. Thus g is surjective.
Reading Quiz
3.4.1 The range of a function f : A B is (select all that apply)
(a) a subset of the domain.
(b) a subset of the codomain.
(c) always equal to the codomain.
(d) also called the image of the function.
(e) equal to f (A).
3.4.2 Suppose f : A B and g : B C are functions. If g f is bijective, which of the following
must be true?
(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.
3.4.4 True or False: If A B, there is an injective function f : A B.
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
104
(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) =
x
2
+ 9.
3.4.2 Suppose that f : [3, ) [8, ) and g : R R are defined by
f (x) = x
2
+ 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 x
2
is increasing because
a, b [0, ), a < b = f (a) = a
2
< b
2
= f (b).
105
(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
x
3
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.
3.4.7 A function f : R R is even if
x R, f (x) = f (x).
For example, the function f : R R, x 7 x
2
is even because
x R, f (x) = (x)
2
= x
2
= 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.8 Define f : (, 0] R and g : [0, ) R by
f (x) = x
2
, g(x) =
(
x
1x
x < 1,
1 x x 1.
Does g f map (, 0] onto R? Justify your answer.
3.4.9 Express, using quantifiers, what it means for a function to be
(a) Not injective.
(b) Not surjective.
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.
106
Proof. Let e
x
R
+
be arbitrary. Then f (x) = e
x
. So f is surjective.
3.4.11 Prove that the composition of two surjective functions is surjective.
3.4.12 Suppose that g f is injective. Prove that f is injective.
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.
3.4.14 Let f : A B be a function. Let X
1
, X
2
A. Prove or disprove the following:
(a) X
1
X
2
implies f (X
1
) f (X
2
).
(b) f (X
1
X
2
) = f (X
1
) f (X
2
).
(c) f (X
1
X
2
) f (X
1
) f (X
2
).
(d) f (X
1
) f (X
2
) f (X
1
X
2
).
3.4.15 Let f : A B be a function. Suppose that f (X
1
X
2
) = f (X
1
) f (X
2
) for all X
1
, X
2
A.
Show f is injective.
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) = x
2
+ 2x + 1. Compute g
1
((0, 2)).
(c) Let h : R R be h(x) = sin x. Find h
1
( {1, 1}).
3.4.17 Let f : A B be a function and Y
1
, Y
2
B.
(a) Prove f
1
(Y
1
Y
2
) = f
1
(Y
1
) f
1
(Y
2
).
(b) Prove f
1
(Y
1
Y
2
) = f
1
(Y
1
) f
1
(Y
2
).
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
( f (g h))(a) = (( f g) h)(a).
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.
107
(a) Compute lim
x
π
2
f (x) and lim
x
π
2
+
f (x).
(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) Compute
d
dx
f (x) and use this to show f is strictly increasing, and therefore injective by
part 3.
3.4.22 Show there is a bijection between Z and 2Z.
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?
108
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
33 ÷5 = 6 r 3 and read ‘6 remainder 3.’
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.
4.1 Remainders and Congruence
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 128 and 79.
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
4.1.2 Similarly, if m = 11 and n = 3, then q = 4 and r = 1, since
11 = (4) ·3 + 1
109
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?
Conjecture 4.4. a 8 (mod 6) = a 2 (mod 3).
Conjecture 4.5. a 2 (mod 3) = a 8 (mod 6).
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
and so a has remainder 2 upon division by 3, showing that a is congruent to 2 modulo 3.
On the other hand, the second conjecture is false. All we need is a counterexample. Consider a = 5:
clearly a is congruent to 2 modulo 3. However a has remainder 5 on division by 6, whereas 8 has
remainder 2. Therefore a and 8 do not have the same remainder and are not congruent modulo 6.
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.
110
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 q
1
, q
2
and remainders r
1
, r
2
which satisfy
a = q
1
n + r
1
, b = q
2
n + r
2
, 0 r
1
, r
2
< n. ( )
Now we perform both directions of the proof.
() Suppose that a b (mod n). By definition, this means that a and b have the same remainder
when divided by n. That is, r
1
= r
2
. Subtracting a from b gives us
b a = (q
2
q
1
) n + (r
2
r
1
) = (q
2
q
1
) n,
which is divisible by n. Therefore n |(b a).
() This direction is a more subtle. We assume that b a is divisible by n. Thus b a = kn for some
integer k. Invoking (), we see that
r
2
r
1
= (b q
2
n) (a q
1
n) = (b a) (q
2
q
1
) n
= (k q
2
+ q
1
) n
is also a multiple of n. Now consider the condition on the remainders in (): since 0 r
1
, r
2
< n, we
quickly see that
(
0 r
2
< n
n < r
1
0
= n < r
2
r
1
< n.
This says that r
2
r
1
is a multiple of n lying strictly between ±n. The only possibility is that r
2
r
1
=
0. Otherwise said, r
2
= r
1
, 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 = r
2
r
1
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
111
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.
Let a be any integer and let n be a positive integer. Then
a is congruent to exactly one of the integers 0, 1, 2, . . . , n 1 modulo n.
a is divisible by n if and only if a 0 (mod n).
a is not divisible by n if and only if a 1, 2, 3, . . . , or n 1 modulo n.
To test your level of comfort with the definition of congruence, and review some proof techniques,
prove the following theorem.
Theorem 4.7. Suppose that n is an integer. Then
n
2
n (mod 3) n 2 (mod 3) .
If you don’t know how to start, try completing the following table before writing a formal proof:
n n
2
Is n
2
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
11
The usual associative, commutative and distributive laws of arithmetic
a + (b + c) (a + b) + c, a(bc) (ab)c, a + b b + a, ab ba, a(b + c) ab + ac
all follow because x = y = x y (mod n), regardless of n: equal numbers have the same remainder after all!
112
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:
5 + 2 = 7, which has the same remainder 1 modulo 6.
Either way, we may write the result as a congruence,
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
ac = (b + kn)(d + ln) = bd + n(bl + kd + kln)
= ac bd = n(bl + kd + kln)
which is divisible by n. Hence ac bd.
Try the second argument yourself.
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 39
23
is divided by 10? At the outset this question
appears impossible to answer. Ask your calculator and it will tell you that 39
23
3.93 ×10
36
,
which is of no assistance; we need to discover the units digit of 39
23
, 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
39 ·39 (1) ·(1) 1 (mod 10),
whence 39
2
1 (mod 10). Since positive integer exponents signify repeated multiplication,
we can repeat the exercise to obtain
39
23
(1) · (1) ···(1)
| {z }
23 times
= (1)
23
1 9 (mod 10)
Therefore 39
23
has remainder 9 when divided by 10. Otherwise said, the last digit of 39
23
is a 9.
If you ask a computer for all the digits you can check this yourself.
113
4.1.2 Now that we understand powers, more complex examples become easy. Here we compute
modulo n = 6.
7
9
+ 14
3
1
9
+ 2
3
1 + 8 9 3 (mod 6).
Hence 7
9
+ 14
3
= 40356351 has remainder 3 when divided by 6.
4.1.3 Find the remainder when 124
12
·65
49
is divided by 11. This time we need to perform multiple
calculations to reduce these large numbers to something manageable. Since 124 = 11
2
+ 3 and
65 = 11 ·6 1, we write
124
12
·65
49
3
12
·(1)
49
27
4
·(1) 5
4
·(1)
(25
2
) (3
2
) 2 (mod 11)
The remainder is therefore 2. There is no way to do this on a pocket calculator, since the original
number 124
12
·65
49
9 ×10
113
is far too large to work with!
There are two points to stress when performing these calculations:
4.1.1 You are trying to replace each integer with something which has the same remainder and is
small: thus 124 3 (mod 11) is more helpful than 124 8 (mod 11), since powers of 3 are
easier to work with than powers of 8.
4.1.2 You may only reduce the base of an exponential expression modulo n, not the exponent! It is
correct to write 17
23
3
23
(mod 7), but you cannot claim that this is congruent to 3
2
.
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?
114
(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.
(a) a is congruent to exactly one of 0, 1, . . . , n 1 modulo n.
(b) a can be congruent to more than one of 0, 1, . . . , n 1 modulo n.
(c) a is divisible by n if and only if a 0 (mod n).
(d) n 0 (mod n).
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 p
2
+ 2 is composite for all such primes p.
Video Solution
4.1.2 Find the remainder of 57
33
+ 42
100
upon division by 6.
Video Solution
4.1.3 Prove that n
2
0 (mod 4) or n
2
1 (mod 4) for all n Z.
Video Solution
Exercises
4.1.1 Check explicitly that 3
23
3
2
(mod 7).
4.1.2 Find the remainder when 22
9
+ 29
24
is divided by 10.
4.1.3 Compute the remainder when 43
10
is divided by 13.
4.1.4 Find all integers x which satisfy the congruence equation 5x 2 mod 8.
4.1.5 Find the remainder when 17
251
·23
12
19
41
is divided by 5. Hint: 17 2 and 2
2
1 (mod 5).
4.1.6 Find the remainder when 12
10
+ 2
36
· 18
12
is divided by 141. Hint: what nice number is close to
141? Use a calculator to help with some of the sums.
4.1.7 Is the following statement identical to Theorem 4.7? Why/why not?
n
2
n (mod 3) n 0 (mod 3) or n 1 (mod 3),
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)
115
(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.10 Prove that if a b (mod n) and c d (mod n) then 3a c
2
3b d
2
(mod n).
4.1.11 Find a natural number n and integers a, b such that a
2
b
2
(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 · 10
2
+ 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).
(a) Check this explicitly using Theorem 4.6.
(b) If 7x 28 (mod 42), is it possible that x 4 (mod 42)?
(c) Is it always the case that 7x 28 (mod 42) = x 4 (mod 42)? Why/why not?
(d) Prove Theorem 4.9.
4.1.15 If a |b and b |c, prove that a |c.
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.17 Let a, b be positive integers. Prove that a = b a |b and b |a.
4.1.18 Decide whether each conjecture is true or false and prove/disprove your assertions.
Conjecture 1: a |b and a |c = a |bc.
Conjecture 2: a |c and b |c = ab |c.
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
p1
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 |2
n
2.
4.1.20 Abraham Lincoln was born on February 12
th
1809. On what day of the week was this?
More generally, describe how to find the weekday given any date (in the Gregorian calendar).
4.1.21 For n N, show
n(n + 1)(2n + 1)
6
is an integer.
116
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.23 Prove that 3 | (4
n
1) for all n 1.
4.1.24 Prove that for any integer n, one of n, n + 2, n + 4 is divisible by 3.
4.1.25 Let n Z.
(a) Find all possible remainders of n
2
upon division by 7.
(b) Find all possible remainders of n
3
upon division by 7.
(c) Use parts (a) and (b) to show that any number which is simultaneously a square and a
cube must be of the form 7k or 7k + 1 for some integer k.
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
and 0 r, r
< n. We show q = q
and r = r
.
Then
r r
= .
Taking absolute values of both sides, we have
= .
Since 0 r
< n, we have n < 0. Adding this inequality to 0 r < n, we get
n < < n. In other words, |r r
| < n. Hence n|q
q| < n as well. Dividing by
117
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, k
2
0 or 1 (mod 4).
118
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?
4.2.2 What about on the line 4x + 6y = 1?
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.
Euclidean Algorithm. To find gcd(m, n) for two positive integers m > n:
(i) Use the Division Algorithm (Theorem 4.2) to write m = q
1
n + r
1
with 0 r
1
< n.
(ii) If r
1
= 0, then n divides m and so gcd(m, n) = n. Otherwise, repeat:
If r
1
> 0, divide n by r
1
to obtain n = q
2
r
1
+ r
2
with 0 r
2
< r
1
.
(iii) If r
2
= 0, then gcd(m, n) = r
1
. Otherwise, repeat:
If r
2
> 0, divide r
1
by r
2
to obtain r
1
= q
3
r
2
+ r
3
with 0 r
3
< r
2
.
(iv) Repeat the process, obtaining a decreasing sequence of non-negative integers
r
1
> r
2
> r
3
> . . . 0
119
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.
1260 = 1 ×750 + 510
750 = 1 ×510 + 240
510 = 2 ×240 + 30
240 = 8 ×30 + 0
m q n r
1260 1 750 510
750 1 510 240
510 2 240 30
240 8 30 0
Theorem 4.11 says that gcd(1260, 750) = 30, the last non-zero remainder.
As you can see, the Euclidean Algorithm is very efficient.
Reversing the Algorithm: Integer Points on Lines
To apply the Euclidean Algorithm to the problem of finding integer points on lines, we must reverse
it. We start with the penultimate line of the algorithm and substitute the remainders from the previ-
ous lines one at a time: the result is an expression of the form gcd(m, n) = mx + ny for some integers
x, y. This is easiest to demonstrate by continuing our example.
Example (continued). We find integers x, y such that 1260x + 750y = 30.
Solve for 30 (the gcd of 1260 and 750) using the third step of the algorithm:
30 = 510 2 × 240.
Now use the second line of the algorithm to solve for 240 and substitute:
30 = 510 2 × (750 510) = 3 ×510 2 × 750.
Finally, substitute for 510 using the first line:
30 = 3 ×(1260 750) 2 ×750 = 3 × 1260 5 ×750.
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.
120
This process of reversing the algorithm works in general, and we have the following corollary of
Theorem 4.11.
Corollary 4.12 (B
´
ezout’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
(x, y) = (3, 5) + (25, 42)t, where t is any integer.
In general, we have the following result.
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 (x
0
, y
0
) is some fixed solution. Then all integer solutions are given by
x = x
0
+
b
d
t, y = y
0
a
d
t, ()
where t is any integer.
The general approach is to use the Euclidean Algorithm to find the initial solution (x
0
, y
0
), 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
´
ezout’s Identity in order
to find the initial solution (x
0
, y
0
). For example, since 1260 ×3 + 750 ×(5) = 30 we multiply by 3
to see that (x
0
, y
0
) = (9, 15) is an initial solution to 1260x + 750y = 90. All integer points on this
line therefore have the form
(x, y) = (9 + 25t, 15 42t), where t Z
12
The astute observer should recognize the similarity between this and the complementary function/particular integral
method for linear differential equations: (x
0
, y
0
) is a ‘particular solution’ to the full equation ax + by = c, while (
b
d
t,
a
d
t)
comprises all solutions to the ‘homogeneous equation’ ax + by = 0.
121
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
33 = 2 ×12 + 9
12 = 1 ×9 + 3
9 = 3 ×3 + 0
= gcd(570, 123) = 3.
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 (x
0
, y
0
) =
(22, 102) is an initial solution. The general solution is then
(x, y) = (22, 102) +
123
3
,
570
3
t = (22 41t, 102 190t)
Reading Quiz
4.2.1 True or False: gcd(21, 12) = 3.
4.2.2 Suppose that a = 0. Then gcd(a, 0) is equal to which number?
(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
122
(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.2 Find solutions to the congruence 5x 1 (mod 6).
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.
(a) gcd( 20, 12) (b) gcd(100, 36) (c) gcd(207, 496)
4.2.2 For each part of Question 4.2.1, find integers x, y which satisfy B
´
ezout’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.
(a) 16x 33y = 2.
(b) 122x + 36y = 3.
(c) 303x + 204y = 6.
(d) 324x 204y = 12.
4.2.5 Show that there exists no integer x such that 3x 5 (mod 6).
123
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
´
ezout’s Identity in to prove any of what follows, since it
is a corollary of the algorithm.
(a) Suppose you have a decreasing sequence
m > n > r
1
> r
2
> ··· 0 ()
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)?
4.2.9 Suppose that d |m and d |n. Prove that d |gcd(m, n).
4.2.10 Prove the following:
gcd(m, n) = 1 x, y Z such that mx + ny = 1.
One direction can be done by applying ezout’s Identity, but the other direction requires an argument.
4.2.11 Let a, b, c Z.
(a) Suppose a | bc and gcd(a, b) = 1. Show a | c.
(b) Use part (a) to show that if p is a prime and p | ab, then either p | a or p | b.
(c) Show that if n > 1 is a number with the property that for any a, b, n | ab implies n | a or
n | b, then n is a prime number.
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 (x
0
, y
0
) and (x
1
, y
1
) are two integer solutions to the linear Diophantine equa-
tion ax + by = c.
(a) Show that (x
0
x
1
, y
0
y
1
) satisfies the equation ax + by = 0.
(b) Suppose that gcd(a, b) = d. Prove that gcd(
a
d
,
b
d
) = 1. (Use Question 4.2.10)
(c) Find all integer solutions (x, y) to ax + by = 0 (Don’t use the Theorem, it’s what you’re trying
to prove! Think about part (b) and divide through by d first.).
124
(d) Use (a) and (b) to conclude that (x, y) is an integer solution to ax + by = c if and only if
x = x
0
+
b
d
t y = y
0
a
d
t, where t Z.
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).
4.2.16 Let n be a positive integer. Complete the table
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.
(a) If m = lcm(a, b), a | c, and b | c, show m | c.
(b) If a and b are both positive, show gcd(a, b) lcm(a, b) = ab.
4.2.18 The set of remainders Z
n
= {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 Z
n
is an inverse
of a Z
n
if
ab 1 (mod n).
(a) Show that 2 has no inverse modulo 6.
(b) Show that if n = n
1
n
2
is composite ( integers n
1
, n
2
2) then there exist elements of the
ring Z
n
which have no inverses.
(c) Prove that a has an inverse modulo n if and only if gcd(a, n) = 1. Conclude that the only
sets Z
n
for which all non-zero elements have inverses are those for which n is prime.
You will find Exercise 4.2.10 helpful.
125
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.
5.1 Investigating Recursive Processes
In applications of mathematics, one often has a simple recurrence relation but no general formula.
For instance, a process might be described by an expression of the form
x
n+1
= f (x
n
),
where some initial value x
1
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.
Cut and stack
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 h
n
is the height of the stack after n operations,
then we have a sequence (h
n
)
n=0
satisfying
(
h
n+1
= 2h
n
h
0
= 0.1 mm.
It is easy to compute the first few terms of the sequence:
n 0 1 2 3 4 5 6 7 8 ···
h
n
(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
h
n
= 2
n
×0.1 mm.
126
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 h
0
= 2
0
× 0.1 mm and h
1
= 2
1
× 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 N
0
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
h
n+1
= 2h
n
) to confirm the formula for the next value n + 1. Here it goes:
Induction Step Suppose that h
n
= 2
n
×0.1 mm, for some fixed n N
0
. Then
h
n+1
= 2h
n
= 2(2
n
×0.1) = 2
n+1
×0.1 mm.
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
h
n
= 2
n
×0.1 = h
n+1
= 2
n+1
×0.1.
Since the implications have been proved for all n N
0
, we can string them together:
h
0
= 2
0
×0.1 = h
1
= 2
1
×0.1 = h
2
= 2
2
×0.1 = h
3
= 2
3
×0.1 = ···
We have already checked that the first formula h
0
= 2
0
×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
h
n
= 2
n
×0.1 mm = 2
n
×10
4
m, n 0.
Now that we’ve proved the formula for every h
n
, finishing the original problem is easy: we need to
find n N
0
such that
h
n
= 2
n
×10
4
150 ×10
9
m 2
n
15 ×10
14
.
Since logorithms are increasing functions, they preserve inequalities and we may easily solve to see
that
n log
2
(15 × 10
14
) = log
2
15 + 14 log
2
10 50.4.
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.
127
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 r
n
represents the number of moves
required when there are n disks, then it should be immediately clear that r
1
= 1: one disk only
requires one move! The picture below shows that r
2
= 3.
With more disks you can keep experimenting and find that r
3
= 7, etc. At this point you may be
ready to hypothesize a general formula.
Conjecture 5.1. The Tower of Hanoi with n disks requires r
n
= 2
n
1 moves.
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 r
n
moves.
n disks
r
n
moves
1 move
r
n
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 r
n
+ 1 + r
n
moves, as illustrated in the picture. We therefore have a recurrence
relation for r
n
:
(
r
n+1
= 2r
n
+ 1
r
1
= 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 r
n
= 2
n
1 is true for some fixed but unspecified n. Now we use
128
the recurrence relation to prove that r
n+1
= 2
n+1
1.
Induction Step Suppose that r
n
= 2
n
1 for some fixed n N. Then
r
n+1
= 2r
n
+ 1 = 2( 2
n
1) + 1 (since we are assuming r
n
= 2
n
1)
= 2
n+1
2 + 1 = 2
n+1
1
Exactly as in the paper-stacking example, we have simultaneously proved an infinite collection of
implications:
r
1
= 2
1
1 = r
2
= 2
2
1 = r
3
= 2
3
1 = r
4
= 2
4
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 h
n
handshakes. If an (n + 1)th person enters the room, how
many additional handshakes are required? Obtain a recurrence relation for h
n+1
in terms
of h
n
.
(b) Hypothesize a general formula for h
n
, 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 h
n
(inches) of successive jumps are related by the recurrence
h
n+1
=
8
9
h
n
+ 1.
(a) Suppose that Skippy’s initial jump has height h
1
= 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 H
n
= h
n
9 and think about the recurrence for H
n
. Now guess and
prove a general formula for H
n
. Finally, remind yourself about geometric series.)
129
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:
5.2.1 Proving that P(1) is true (Base Case)
5.2.2 Proving that n N P(n) = P(n + 1) is true (Induction Step)
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:
P(1) = P(2) = P(3) = P( 4) = P(5) = ··· .
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.
All induction proofs have the same formal structure:
(Set-up) Define the propositional function P(n), set-up notation and orient the reader as
to what you are about to prove.
(Base Case) Prove that P(1) is true.
(Induction Step) Let n N be fixed and assume that P(n) is true. This assumption is the in-
duction hypothesis. Perform calculations or other reasoning to conclude that
P(n + 1) is true.
(Conclusion) Remind the reader what it is that you have proved.
As you read more mathematics, you will find that the induction step is typically the most in-
volved part of the proof. The set-up stage is often no more than a sentence: ‘We prove by induction,’
and the explicit definition of P(n) is commonly omitted. These are the only shortcuts that it is sensi-
ble to take until you are extremely comfortable with induction. Practice making it completely clear
what you are doing at each juncture.
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
i=1
i =
1
2
n(n + 1).
13
In the cut-and-stack example, the initial proposition would be labelled P(0) rather than P(1).
130
Proof. (Set-up) We prove by induction. For each n N, let P(n) be the proposition
n
i=1
i =
1
2
n(n + 1).
(Base Case) Clearly
1
i=1
i = 1 =
1
2
1( 1 + 1), and so P(1) is true.
(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
i=1
i = (n + 1) +
n
i=1
i = (n + 1) +
1
2
n(n + 1) (by assumption of P(n))
=
1 +
1
2
n
( n + 1) =
1
2
( n + 2)(n + 1)
=
1
2
( n + 1)
( n + 1) + 1
.
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 N,
n
i=1
i =
1
2
n(n + 1).
Note how we grouped
1
2
( 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.
Proof. We prove by induction. For each n N, let P(n) be the proposition
n(n + 1)(2n + 1) is divisible by 6.
(Base Case) Clearly 1 · (1 + 1) ·(2 · 1 + 1) = 6 is divisible by 6, hence P(1) is true.
(Induction Step) Assume that P(n) is true for some fixed n N. Then
n(n + 1)(2n + 1) = 6k
for some k Z. But now we have
( n + 1)(n + 2)
2(n + 1) + 1
n(n + 1)(2n + 1) = (n + 1)
( n + 2)(2n + 3) n(2n + 1)
= (n + 1)(2n
2
+ 7n + 6 2n
2
n)
= 6(n + 1)
2
.
131
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.
Theorem 5.4. For all n N, 2 + 5 + 8 + ··· + (3n 1) =
1
2
n(3n + 1).
Proof. For n = 1 we have 2 = 2, hence the proposition holds. Now suppose that the proposition
holds for some fixed n N. Then
2 + 5 + ··· + [3(n + 1) 1] =
[
2 + 5 + ··· + (3n 1)
]
+ 3n + 2
=
1
2
n(3n + 1) + 3n + 2 =
1
2
(3n
2
+ 7n + 4)
=
1
2
( n + 1)(3n + 4) =
1
2
( n + 1)
3(n + 1) + 1
which says that the proposition holds for n + 1. By mathematical induction the proposition holds for
all n N.
This last example has a different flavor than the ones we have seen so far. The example concerns
a 2
n
× 2
n
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:
132
The result is that if one takes any 2
n
×2
n
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 2
n
× 2
n
board of squares may be tiled by L-shaped trominoes after
removing any square.
Proof. We proceed by induction on n. For n = 1, we look at a 2 × 2 board. It should be clear that
no matter which of the four squares we choose to exclude, the remaining three squares form an
L-shaped tromino (if you are unsure, try to draw the board).
Now fix n N and suppose that given a 2
n
× 2
n
board and any choice of one of the squares to
exclude, we can tile the rest of the board with trominoes. Now take a 2
n+1
× 2
n+1
board and pick
an arbitrary square to remove. Divide the board into four quadrants Q
1
, Q
2
, Q
3
, Q
4
, where each of
which are boards of size 2
n
× 2
n
. The removed square must lie in one of these quadrants, without
loss of generality say it is in quadrant Q
1
. By the induction hypothesis, it is possible to tile Q
1
minus
the removed square by trominoes. Now consider the other three quadrants and choose one corner
of each. Again by the induction hypothesis, it is possible to tile each of these quandrants with the
chosen corner removed by trominoes. Finally, rotate the three remaining quadrants so that their
133
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:
P(n) : 2 + 5 + 8 + ···+ (3n 1) =
1
2
n(3n + 1).
P(n + 1) : 2 + 5 + 8 + ··· + [3(n + 1) 1] =
1
2
( n + 1)
3(n + 1) + 1
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.
P(n + 1) = 2 + 5 + ··· + (3n 1)
| {z }
=
1
2
n(3n+1) by P(n)
+[3(n + 1) 1] =
1
2
( n + 1)
3(n + 1) + 1
=
1
2
( n + 1)(3n + 4)
=
3
2
n
2
+
1
2
n + 3n + 3 1 =
1
2
(3n
2
+ 7n + 4)
=
3
2
n
2
+
7
2
n + 2 =
3
2
n
2
+
7
2
n + 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:
134
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
(a) P(1) is false.
(b) P(1) is true.
(c) for all n, P(n) = P(n + 1).
(d) P(1) = P(2).
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
(a) P(1) is true.
(b) for all n, P(n) = P(n + 1).
(c) P(n) is true for some fixed n N.
(d) P(n) is true for all n N.
5.2.3 True or False: in our formal proofs, it is acceptable to write
P(n) =
n
i=1
i =
1
2
n(n + 1)
as shorthand for P(n) is the proposition
n
i=1
i =
1
2
n(n + 1)”.
Practice Problems
5.2.1 (a) Prove by induction that n N we have 3 | (2
n
+ 2
n+1
).
(b) Give a direct proof that 3 | (2
n
+ 2
n+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
135
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)(2n
2
+ 7n + 6 2n
2
n)
= 6(n + 1)
2
.
5.2.2 Prove by induction that for each natural number n, we have
n
j=0
2
j
= 2
n+1
1.
5.2.3 Consider the following Theorem: If n is a natural number, then
n
k=1
k
3
=
1
4
n
2
( n + 1)
2
(a) What explicitly is the meaning of
4
k=1
k
3
?
(b) What would be meant by the expression
n
k=1
n
3
, and why is it different to
n
k=1
k
3
?
(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.
P(n + 1) =
n+1
k=1
k
3
=
1
4
( n + 1)
2
((n + 1) + 1)
2
=
n
k=1
k
3
+ (n + 1)
3
=
1
4
( n + 1)
2
( n + 2)
2
=
1
4
n
2
( n + 1)
2
+ (n + 1)
3
=
1
4
( n + 1)
2
( n + 2)
2
=
1
4
( n + 1)
2
n
2
+ 4(n + 1)
=
1
4
( n + 1)
2
( n + 2)
2
=
1
4
( n + 1)
2
( n + 2)
2
=
1
4
( n + 1)
2
( n + 2)
2
(e) Give a correct proof of the Theorem by induction.
5.2.4 Show by induction that for every n N we have: n 5 (mod 3) or n 6 (mod 3) or n 7
(mod 3).
5.2.5 Prove by induction that, for all n N,
1 ·2 + 2 ·3 + 3 · 4 + ···+ n(n + 1) =
1
3
n(n + 1)(n + 2)
136
5.2.6 (a) Show, by induction, that for all n N, the number 4 divides the integer 11
n
7
n
.
(b) More generally, use induction to prove that (a b) | (a
n
b
n
) for any positive integers
a, b, n.
5.2.7 Prove that for all k N, we have that 8
k
1 is a multiple of 7.
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
as
n
i=1
i =
1
2
n(n + 1).
5.2.9 We mimic the previous question for the sum of the squares of the first n natural numbers.
(a) Use the fact that
n
i=1
i
2
=
1
6
n(n + 1)(2n + 1) to compute directly an expression for the sum
of the squares of the first n odd natural numbers.
Hint:
n
i=1
(2i 1)
2
=
2n
i=1
i
2
n
i=1
(2i)
2
. . .
(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 = {C
1
, C
2
, . . . , C
n+1
} of n + 1
cats. Select one cat, say C
1
, and put it aside. Now we have a set S \ {C
1
} of n cats and by the
induction hypothesis they must all have the same color fur. Now put C
1
back select a different
cat C
2
. Again by the induction hypothesis, all cats in S \{C
2
} 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.
5.2.11 Using only the product rule and the fact that
d
dx
x = 1, prove the power rule from calculus: for
all n 1,
d
dx
(x
n
) = nx
n1
.
5.2.12 Recall that a polynomial is a function R R of the form p(x) = a
d
x
d
+ a
d1
x
d1
+ ···+ a
2
x
2
+
a
1
x + a
0
. The numbers a
i
are called the coefficients and the degree of p is the largest d such that
the coefficient a
d
= 0.
137
(a) Prove that for all n N,
d
n
dx
n
e
x
2
= p(x)e
x
2
where p(x) is a polynomial.
(b) Strengthen the result in part (a) by proving that for all n N,
d
n
dx
n
e
x
2
= p(x)e
x
2
= p
n
(x)e
x
2
where p
n
(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 .
(a) Prove that for all n N, if a and b are relatively prime, then a
2
n
and b
2
n
are relatively
prime.
(b) Use part (a) to show that for all k N, if a and b are relatively prime, then a
k
and b
k
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 + nx
2
= 1 + (n + 1)x + nx
2
1 + (n + 1)x
5.2.16 Prove that for any n 1,
n
i=1
1
i
2
< 2.
[Hint: prove the stronger fact that
n
i=1
1
i
2
< 2
1
n
for all n 1.]
138
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:
B A such that B = , we have that min(B) exists.
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.
Any set that ‘looks like’ N is automatically well-ordered.
14
For example
B =
0,
1
2
,
2
3
,
3
4
,
4
5
, . . .
=
n
n + 1
: n N
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:
(a) P(1) is true.
(b) n N P(n) = P(n + 1).
Then P(n) is true for all n N.
14
When the elements are written in increasing order, the set has the form B = {b
1
, b
2
, b
3
, b
4
, . . .}.
139
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)
Note that P(m) is false.
By condition (a), P(1) is true, and so m = 1. Therefore m 2 from which we see that m 1 N.
Since m = min(S) it follows that m 1 ∈ S and so P(m 1) must be true.
However, by condition (b), we see that P(m 1) = P(m), whence P(m) is true.
This is a contradiction. In addition to properties (a) and (b), our only assumption was that at least one
proposition P(n) was false, therefore this is what we have contradicted. We conclude that conclude
that P(n) is true for all n N.
Different Base Cases for Induction
An induction argument need not begin with the case n = 1. By proving Theorem 5.7 it should be clear
where we used the well-ordering of N in order to justify induction. Now fix an integer m (positive,
negative or zero) and consider the set
Z
m
= {n Z : n m} = {m, m + 1, m + 2, m + 3, . . .}.
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:
(a) P(m) is true.
(b) n m P(n) = P(n + 1).
Then P(n) is true for all n m.
We are simply changing the base case. The induction concept is exactly the same as before:
P(m) = P(m + 1) = P(m + 2) = P(m + 3) = ···
As long as you explicitly prove the first claim in the sequence, and you show the induction step, then
all the propositions are true.
Here is an example where the induction argument begins with m = 4.
Theorem 5.9. For all integers n 4, we have 3
n
> n
3
.
140
Proof. (Base Case) If n = 4, we have 3
n
= 81 > 64 = n
3
. The proposition is therefore true for n = 4.
(Induction Step) Fix n Z
4
and suppose that 3
n
> n
3
. Then
3
n+1
= 3 ·3
n
> 3n
3
.
To finish the proof, we want to see that this right hand side is at least (n + 1)
3
. Now
3n
3
(n + 1)
3
3
1 +
1
n
3
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
3
n
> n
3
= 3
n+1
> (n + 1)
3
which is the induction step. By induction, we have shown that 3
n
> n
3
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.
Theorem 5.10. For all integers n 3, we have
n
i=3
1
i(i 2)
=
3
4
2n 1
2n(n 1)
. ()
Proof. (Base Case) When n = 3, () reads
3
i=3
1
i(i2)
=
3
4
5
12
. Both sides equal
1
3
, whence () is true.
(Induction Step) Assume that () is true for some fixed n 3. Then
n+1
i=3
1
i(i 2)
=
n
i=3
1
i(i 2)
+
1
( n + 1)(n 1)
=
3
4
2n 1
2n(n 1)
+
1
( n + 1)(n 1)
(by the induction hypothesis)
=
3
4
(2n 1)( n + 1) 2n
2(n + 1)n(n 1)
=
3
4
1 + n 2n
2
2(n + 1)n(n 1)
=
3
4
+
(2n + 1)(1 n)
2(n + 1)n(n 1)
=
3
4
2n + 1
2(n + 1)n
which is exactly () when n is replaced by n + 1.
By induction () holds for all integers n 3.
A calculus discussion would finish by taking the limit as n to conclude that
i=3
1
i(i2)
=
3
4
.
141
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
n Z
3
, P(n) = P(n + 1) ,
then the proposition P(n) would be
P(n) : n-gons P
n
, the sum of the interior angles of P
n
is 180(n 2)°.
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 P
n+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 P
n+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 P
n
. There are two cases to
consider.
15
Case 1: The deleted point A is outside P
n
. The sum
of the interior angles of P
n+1
exceeds those of P
n
by
α + β + γ = 180°. Therefore P
n+1
has interior angles sum-
ming to 180(n 2)° + 180° = 180[(n + 1) 2]°.
Case 2: The deleted point A is inside P
n
. To obtain the sum of the
interior angles of P
n+1
, we take the sum of the interior angles of
P
n
and do three things:
Subtract β
Subtract γ
Add the reflex angle 360°α at A
We are therefore adding an additional
β γ + (360° α) = 360° (α + β + γ) = 180°
A
B
C
P
n
γ
β
α
Case 1: A outside P
n
A
B
C
P
n
γ
β
α
Case 2: A inside P
n
P
n+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 P
n
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.
142
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}.
So S N and since A = , we have S = . Since N is well-ordered, S has a minimum element s.
Then k = s + m 1 is the minimum element of A (why?).
By definition x < k. But by minimality of k, k 1 / A, i.e., x k 1. Thus x < k x + 1. Finally,
since y x > 1, we have x + 1 < y. All together, x < k x + 1 < y. So k is as required.
Now we can prove our main result.
Theorem 5.14. The rational numbers Q are dense in R.
143
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 <
k
n
< y.
Take r =
k
n
Q.
Aside. Well-ordering more generally
Well-ordering is a fundamental concept whose implications are far beyond what we’re discussing
here. Informally speaking, well-ordering a set A involves listing the elements of A in some order so
that every non-empty subset of A has a first element with respect to that order.
Consider, for example, the set of negative integers Z
. For the purposes of these notes we will always
consider the standard ordering:
··· < 4 < 3 < 2 < 1.
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
P(1) = P(2) = P(3) = ···
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.
(a) Every well-ordered set of real numbers has a minimum element.
(b) If a set of real numbers has a minimum element, then it is well-ordered.
(c) Any finite set of real numbers is well-ordered.
(d) Induction proofs must have a base case of 0 or 1.
5.3.2 The fact that N is well-ordered is considered a(n)
144
(a) theorem
(b) opinion
(c) axiom
(d) proof
5.3.3 True or False: a finite set can be dense in R.
Practice Problems
5.3.1 Prove that n! > 2
n
for all n 4.
Video Solution
5.3.2 Fill in the details in the proof of Lemma 5.13.
Video Solution
Exercises
5.3.1 Prove by contradiction that the interval (3, 4) has no minimum element.
5.3.2 (a) Suppose that n 3. Prove that
n+1
n
2
< 2.
(b) Hence or otherwise, prove that n
2
< 2
n
for all natural numbers n 5.
5.3.3 Consider the following result. For every natural number n 2,
1
1
4
1
1
9
1
1
16
···
1
1
n
2
=
n + 1
2n
(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 + 1)
k
= 2
1
·3
2
·4
3
·5
4
·6
5
Rewrite the statement using Π-notation.
(c) Prove the result by induction (you may use whatever notation you wish).
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 N
0
, then
n
k=0
r
k
=
1 r
n+1
1 r
( )
(a) Here is an incorrect proof by induction. Explain why it is incorrect.
145
Proof. Let P(n) =
n
k=0
r
k
=
1r
n+1
1r
.
(Base Case n = 0) P(0) =
0
k=0
r
k
= r
0
= 1 =
1r
0+1
1r
is true.
(Induction Step) Fix n N
0
and assume that P(n) is true. Then
P(n + 1) =
n+1
k=0
r
k
=
n
k=0
r
k
+ r
n+1
=
1 r
n+1
1 r
+ r
n+1
=
1 r
n+1
1 r
+
r
n+1
r
n+2
1 r
=
1 r
n+2
1 r
, is true.
By induction, () is true for all n N
0
.
(b) Give a correct proof of ().
5.3.6 Here is an argument attempting to justify
n
i=1
i =
1
2
n(n + 1) + 7. What is wrong with it?
Proof. Assume that the statement is true for some fixed n. Then
n+1
i=1
i =
n
i=1
i + (n + 1) =
1
2
n(n + 1) + 7 + (n + 1) =
1
2
( n + 1)[(n + 1) + 1] + 7,
hence the statement is true for n + 1 and, by induction, for all n N.
5.3.7 Let P(n) and Q(n) be propositions for each n N.
(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.
146
5.3.8 Prove that if A R is a finite set, then A is well-ordered.
5.3.9 Show Q is not well-ordered.
5.3.10 In this question we use the fact that N
0
is well-ordered to prove the Division Algorithm (Theo-
rem 4.2).
Theorem: If m Z and n N, then unique q, r Z such that m = qn + r and 0 r < n.
Let m Z and n N be given, and define S = {k N
0
: k = m qn for some q Z}.
(a) Show that S is a non-empty subset of N
0
.
(b) N
0
is well-ordered. By part (a), S has a minimal element r. Prove that 0 r < n.
(c) Suppose that there are two pairs of integers (q
1
, r
1
) and (q
2
, r
2
) which satisfy m = q
i
n + r
i
.
Prove that r
1
= r
2
and, consequently, that the division algorithm is true.
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 = .
(c) Let B = {n N : 1, 2, . . . , n / S}. Use induction to show B = N. Conclude that A = .
5.3.12 We consider Peano’s five axioms for the natural numbers:
Initial element: 1 N
Successor elements: There is a successor function f : N N. For each n N, the successor
f (n) is also a natural number.
No predecessor of the initial element: n N, f (n) = 1 is false.
Unique predecessor: f is injective: f (n) = f (m) = m = n.
Induction: If A N has the following properties:
1 A,
a A, f (a) A,
then A = 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?
147
(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
f (m, n) =
(
( m 1, n + 1) if m 2,
( m + n, 1) if m = 1.
Which of the above axioms are satisfied by T and f ?
5.3.13 (Ignore this question if you haven’t studied matrices) Suppose that A =
7 12
2 3
. We prove that
n Z, A
n
=
2 6
1 3
+ 3
n
3 6
1 2
. (†)
Here A
n
= (A
n
)
1
is the inverse of A
n
, and we follow the convention that A
0
=
1 0
0 1
is the
identity matrix.
(a) Prove by induction that () holds n N
0
.
(b) Modify your argument in part (a) to prove that () holds n Z
0
. (Use the fact that, when
written in reverse order, Z
0
= {0, 1, 2, 3, 4, . . .} is a well-ordered set.)
(c) Using what you know about matrix inverses, give a direct proof that () holds n Z
0
.
(If C and D are 2 ×2 matrices such that CD =
1 0
0 1
, then D = C
1
.)
(d) Diagonalize the matrix A and thereby give a direct proof of () for all integers n.
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
B =
0,
1
2
,
2
3
,
3
4
,
4
5
, . . . , 1,
3
2
,
5
3
,
7
4
,
9
5
, . . .
=
n
n + 1
: n N
2n 1
n
: n N
Prove that B is well-ordered.
16
Hint: If C B is non-empty, consider the cases where c < 1 and when all c 1 separately.
5.3.15 (a) If r Q and r = 0 and α R \Q, show αr R \ Q.
(b) Use part (a), along with the density of Q, to show that the irrational numbers R \Q is also
dense in R.
5.3.16 Show that if x 0 and x < 1/n for all n N, then x = 0.
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.
148
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:
(a) P(m), P(m + 1), . . . , P(l) are true.
(b) n l, (P(m) P(m + 1) ··· P( n)) = P(n + 1).
Then P(n) is true for all n Z
m
.
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.
Definition 5.16. The Fibonacci numbers are the sequence ( f
n
)
n=1
= (1, 1, 2, 3, 5, 8, 13, 21, . . .) defined
by the recurrence relation
(
f
n+1
= f
n
+ f
n1
if n 2
f
1
= f
2
= 1
Theorem 5.17. For all natural numbers n we have f
n
< 2
n
.
Proof. For each natural number n, let P(n) be the proposition f
n
< 2
n
.
(Base cases n = 1, 2) f
1
= 1 < 2
1
and f
2
= 1 < 2
2
, 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
n1
< 2
n
+ 2
n1
< 2
n
+ 2
n
= 2
n+1
which says that P(n + 1) is true.
By strong induction P(n) is true for all n N, and so f
n
< 2
n
.
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
< 2
1
. We need
149
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.
Wrong Proof A. We show, by weak induction, that n N, f
n
< 2
n
.
(Base Case n = 1) By definition, f
1
= 1 < 2
1
, whence the claim is true for n = 1.
(Induction Step) Fix n N and assume that f
n
< 2
n
. We want to show that f
n+1
< 2
n+1
. By the
recurrence relation, we can write
f
n+1
= f
n
+ f
n1
. ()
The inductive hypothesis tells us that f
n
< 2
n
, but what can we say about f
n1
? 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
n1
. 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
< 2
n
. We prove that P(n) is true for
all n N by strong induction.
(Base Case n = 1) By definition, f
1
= 1 < 2
1
, 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
< 2
n+1
. By the recurrence relation, we can write
f
n+1
= f
n
+ f
n1
< 2
n
+ 2
n1
< 2 ·2
n
= 2
n+1
. (†)
Hence P(n) is true for all n 1.
Where is the problem with this second argument? The recursive formula f
n+1
= f
n
+ f
n1
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.
150
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.
Theorem 5.18. A sequence of integers (a
n
)
n=0
is defined by
(
a
n
= 5a
n1
6a
n2
, n 2,
a
0
= 0, a
1
= 1.
Then a
n
= 3
n
2
n
for all n N
0
.
Proof. We prove by strong induction.
(Base cases n = 0, 1) The formula is true in both cases: a
0
= 0 = 3
0
2
0
and a
1
= 1 = 3
1
2
1
.
(Induction step) Fix an integer n 1 and suppose that a
k
= 3
k
2
k
for all k n. Then
a
n+1
= 5a
n
6a
n1
= 5(3
n
2
n
) 6(3
n1
2
n1
)
= (15 6)3
n1
+ (10 6)2
n1
= 3
n+1
2
n+1
.
By strong induction a
n
= 3
n
2
n
is true for all n N
0
.
Think about why we wrote a
n+1
= 5a
n
6a
n1
in the induction step, whereas the statement in the Theorem
reads a
n
= 5a
n1
6a
n2
. 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 = 2
2
×3
4
×11.
As you read the proof of the next theorem, think carefully about why only one base case is required.
151
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.
Proof. We prove by strong induction.
(Base case n = 2) The only positive divisors of 2 are itself and 1, hence 2 is prime.
(Induction step) Fix n N
2
and assume that every natural number k satisfying 2 k n is either
prime or a product of primes. There are two possibilities:
n + 1 is prime. In this case we are done.
n + 1 is composite. Thus n + 1 = ab for some natural numbers a, b 2. Clearly a, b n, and
so, by the induction hypothesis, both are prime or the product of primes. Therefore n + 1 is also
the product of primes.
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.
5.4.3 True or False: there is a number which is not a product of primes.
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
152
Exercises
5.4.1 Define a sequence (b
n
)
n=1
as follows:
(
b
n
= b
n1
+ b
n2
, n 3,
b
1
= 3, b
2
= 6.
Prove: n N, b
n
is divisible by 3.
5.4.2 Define a sequence (c
n
)
n=0
as follows:
(
c
n+1
=
49
8
c
n
225
8
c
n2
, n 2,
c
0
= 0, c
1
= 2, c
2
= 16.
Prove that c
n
= 5
n
3
n
for all n N
0
. Hint: you need three base cases!
5.4.3 Prove that every n N can be written as
n = 2
k
1
+ 2
k
2
+ ··· + 2
k
for some N and k
1
, k
2
, . . . k
0 such that all of the k
i
are distinct.
5.4.4 Consider the proof of Theorem 5.19.
(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
satisfying 2 k
n+1
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.
5.4.5 In this question we use recall an alternative definition of prime.
17
Definition. p N
2
is prime if a, b N, p |ab = p |a or p |b.
Let p be prime, let n N, and let a
1
, . . . , a
n
be natural numbers such that p divides the product
a
1
a
2
···a
n
. Prove by induction that,
i {1, 2, . . . , n} such that p |a
i
.
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,
(1) n = p
1
p
2
··· p
k
for some primes p
1
, p
2
, . . . , p
k
and,
17
This is the strict definition of what it means for p to be prime, while Definition 2.34 is what is meant by irreducible. In
the ring of integers, prime and irreducible are synonymous. For the details, take a Number Theory course.
153
(2) if n = q
1
q
2
···q
for primes q
1
, q
2
, . . . , q
, then k = and p
i
= q
i
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
f
n
=
ϕ
n
ˆ
ϕ
n
5
, where ϕ =
1 +
5
2
and
ˆ
ϕ =
1
5
2
.
ϕ is the famous Golden ratio. ϕ and
ˆ
ϕ are the two solutions to the equation x
2
= 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
Q(n) P(m) P(m + 1) ··· P(n)
Prove that the Principle of Strong Induction is equivalent to the Principle of Induction stated as
follows: Suppose that
(a) Q(l) is true.
(b) n l, Q(n) = Q(n + 1).
Then Q(n) is true for all n Z
l
.
154
6 Set Theory, Part II
In this chapter we return to set theory and consider several more-advanced constructions.
6.1 Cartesian Products
You have been working with Cartesian products for years, referring to a point in the plane R
2
by its
Cartesian coordinates (x, y). The basic idea is that each of the coordinates x and y is a member of the
set R. The same approach can be used for any two sets.
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 R
2
.
R
2
= R ×R = {(x, y) : x, y R}.
More generally, R
n
= R ×R ×···R
| {z }
n times
is the set of n-tuples of real numbers:
R
n
= {(x
1
, x
2
, . . . , x
n
) : x
1
, x
2
, . . . , x
n
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, β)}
Notice that this is a different set to the Cartesian product of B and A:
B × A = {(α, 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
Mains = {fish, steak, eggplant, pasta}
Sides = {asparagus, salad, potatoes}
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.
155
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 =
(a
1
, b
1
), (a
1
, b
2
), (a
1
, b
3
), ··· (a
1
, b
n
),
(a
2
, b
1
), (a
2
, b
2
), (a
2
, b
3
), ··· (a
2
, b
n
),
.
.
.
.
.
.
.
.
.
.
.
.
(a
m
, b
1
), (a
m
, b
2
), (a
m
, b
3
), ··· (a
m
, b
n
)
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 A
C
× B
C
. 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
However (x, y) A
C
× B
C
x ∈ A and x ∈ B. Since the definition of Cartesian product
involves and, its negation, by De Morgan’s laws, involves or. It follows that the complement of a
Cartesian product is not a Cartesian product! For more on this, see Exercise 6.1.6.
As an example of a basic set relationship involving Cartesian products, we prove a theorem.
Theorem 6.3. Let A, B, C, D be any sets. Then (A × B) (C ×D) (A C) × (B D).
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.
But then
(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.
Therefore (x, y) (A C) × (B D), as required.
A
C
B
D
156
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
If C = {6, 7} and A, B are as above, state the set A × B ×C in roster notation.
157
(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 R
2
. (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 R
2
.
6.1.3 Rewrite the condition
(x, y) (A
C
B) × (C \ D)
in terms of (some of) the following propositions:
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.5 A straight line subset of the plane R
2
is a subset of the form
A
a,b,c
= {(x, y) : ax + by = c}, for some constants a, b, c, with ab = 0.
(a) Draw the set A
1,2,3
. Is it a Cartesian product?
(b) Which straight line subsets in the plane R
2
are Cartesian products? Otherwise said, find a
condition on the constants a, b, c for which the set A
a,b,c
is a Cartesian product.
6.1.6 Draw a picture, similar to that in Theorem 6.3, which illustrates the fact that
(A × B)
C
= A
C
× B
C
.
Using your picture, write the set (A × B)
C
in the form
(C
1
× D
1
) (C
2
× D
2
) ···
where each of the unions are disjoint: that is i = j = (C
i
× D
i
) (C
j
× D
j
) = . You don’t
have to prove your assertion.
6.1.7 Prove that A B = (A ×B) (B × A) = .
6.1.8 Let A, B, C be sets. Prove
(a) A ×(B C) = (A × B) (A ×C).
(b) A ×(B C) = (A × B) (A ×C).
(c) A ×(B \C) = (A × B) \(A ×C).
158
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.10 Let A and B be sets. Prove
(A × B)
C
= (A
C
× B
C
) (A
C
× B) (A ×B
C
).
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 A
1
, . . . , A
n
are finite sets, then
|
A
1
×··· × A
n
|
=
|
A
1
|
···
|
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
(a) Show in detail that ( 4, 3) E.
(b) Show by induction that for every n N, (1, n) E.
(c) (Very hard!!!) Show that E = {(a, b) N × N : gcd(a, b) = 1}. Think carefully about how
the Euclidean algorithm works, and what the generating rules might have to do with it. . .
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.
(b) Prove that (a, b) = (c, d) =
a = c and b = 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.
159
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}
Gathering these together, we have the power set:
P(A) =
n
, {1}, {3}, {7}, {1, 3}, {1, 7}, {3, 7}, {1, 3, 7}
o
.
6.2.2 Consider B =
n
1,
{2}, 3
o
. 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:
1-element: {1},
n
{2}, 3
o
2-elements:
n
1,
{2}, 3
o
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
{2}, 3
B =
n
{2}, 3
o
B.
The power set of B is therefore
P(B) =
, {1},
n
{2}, 3
o
,
n
1,
{2}, 3
o
.
160
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
(a) 1 A (b) 1 P(A) (c) {1} A (d) {1} P(A)
(e) 1 A (f) 1 P(A) (g) {1} A (h) {1} P(A)
As a further exercise in being careful with notation, consider the following theorem.
Theorem 6.5. If A B, then P(A) P(B) .
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.
This says that C P(B). Therefore P(A) P(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.
Cardinality and Power Sets
Let’s investigate how the cardinality of a set and its power set are related. Consider a few basic
examples where we list all of the subsets, grouped by cardinality.
Set A 0-elements 1-element 2-elements 3-elements
|
P(A)
|
1
{a} {a} 1 + 1 = 2
{a, b} {a}, {b} {a, b} 1 + 2 + 1 = 4
{a, b, c} {a}, {b}, {c} {a, b}, {a, c}, {b, c} {a, b, c} 1 + 3 + 3 + 1 = 8
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.
Theorem 6.6. Suppose that A is a finite set. Then
|
P(A)
|
= 2
|
A
|
.
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 N
0
,
|
A
|
= n =
|
P(A)
|
= 2
n
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
r
=
(
n
r
)
=
n!
r!(nr)!
distinct r-element subsets.
161
Viewed this way, we see that we want to prove an infinite collection of propositions, indexed by
the set N
0
: 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}
It is clear that B has twice the number of subsets of A.
This method of pairing is exactly mirrored in the proof.
Proof. We prove by induction on the cardinality of A. For each n N
0
, we consider the proposition
|
A
|
= n =
|
P(A)
|
= 2
n
. ()
(Base Case) If n = 0, then A = (Theorem 3.5). But then P(A) = {}, whence
|
P(A)
|
= 1 = 2
0
.
(Induction Step) Fix n N
0
and assume that () is true for this n. That is, we assume that any set
with n elements has 2
n
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:
6.2.1 Subsets X B which do not contain b.
6.2.2 Subsets Y B which contain b.
In the first case, X is really a subset of A.
In the second case we can write Y = X {b}, where X is again a subset of A.
Each subset X A therefore corresponds to precisely two subsets X and X {b} of B. Since
|
A
|
= n,
the induction hypothesis tells us that there are 2
n
subsets X A, whence
|
P(B)
|
= 2
|
P(A)
|
= 2
n+1
.
By induction, () is true for all n N
0
.
162
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.
Example. Suppose that A = {a} and B = {b, c}. Then
A × B = {(a, b), (a, c)}.
The power set P(A ×B) therefore contains 2
2
= 4 elements: indeed
P(A × B) =
n
, {(a, b)}, {(a, c)}, {(a, b), (a, c)}
o
.
The power sets of A and B have 2 and 4 elements respectively:
P(A) =
, {a}
, P(B) =
, {b}, {c}, {b, c}
.
The Cartesian product of the power sets therefore has 2 ×4 = 8 elements:
P(A) ×P(B) =
n
,
,
, {b}
,
, {c}
,
, {b, c}
,
{a},
,
{a}, {b}
,
{a}, {c}
,
{a}, {b, c}
o
.
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) [0, 1) P(R)
(b) 7 P(N)
(c) {(3, 5), (2, 9)} P(N × N)
(d) {4, π} P(R)
6.2.2 Let A = {(1, 2), 3, (4, {5})}. What is |P(A)|?
(a) 3
(b) 8
(c) 16
(d) 32
163
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
6.2.2 Prove that A B if and only if P(A) P(B).
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.2 Let A = {1, 3} and B = {2, 4}.
(a) Draw a picture of the set A × B.
(b) Compute P(A ×B).
(c) What is the cardinality of P(A) ×P(B)? Don’t compute the set!
6.2.3 Determine whether the following statements are true or false (in (b), the symbol means ‘proper
subset’). Justify your answers.
(a) If {7} P(A), then 7 A and {7} / A.
(b) Suppose that A, B and C are sets such that A P(B) C and
|
A
|
= 2. Then
|
C
|
can be 5,
but
|
C
|
cannot be 4.
(c) If a set B has one more element than a set A, then P(B) has at least two more elements
than P(A).
(d) Suppose that the sets A, B, C and D are all subsets of {1, 2, 3} with cardinality two. Then
at least two of these sets are equal.
6.2.4 Here are three incorrect proofs of Theorem 6.5. Explain why each fails.
164
(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.7 Let A and B be sets. Prove or disprove: A B = P(A) P(B).
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.9 If we define an ordered pair (a, b) as {{a}, {a, b}}, show that A × B P(P(A B)).
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}
is a bijection, and that consequently, by Theorem 3.15,
|
P(A) ×{1, 2}
|
=
|
P(B)
|
.
6.2.11 We use the following notation for the binomial coefficient:
(
n
r
)
=
n!
r!(nr)!
. 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:
If 1 r n, then
n + 1
r
=
n
r
+
n
r 1
.
(b) Prove by induction that n N
0
,
n
r=0
(
n
r
)
= 2
n
.
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.
If you found this easy, try proving the binomial theorem: n N, (x + y)
n
=
n
r=0
(
n
r
)
x
r
y
nr
.
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.
(a) If A = {0, 1} and B = {a, b, c}, list all elements of A
B
. What is |A
B
|?
(b) If A and B are finite sets, show |A
B
| = |A|
|B|
.
165
(c) Let B be a set and Y B. Define χ
Y
: B {0, 1} by
χ
Y
(x) =
(
1 if x Y
0 if x / Y.
We call χ
Y
the characteristic function of Y. By definition, χ
Y
{0, 1}
B
for any Y B. Show
every element of {0, 1}
B
is the characteristic function of some subset of B. In other words,
prove that for all f {0, 1}
B
, there exists Y B such that f = χ
Y
.
(d) Let B be a set. Define Φ : P(B) {0, 1}
B
by Φ(Y) = χ
Y
. Show that Φ is a bijection.
(e) If B is finite, conclude that |P(B)| = |{0, 1}
B
| = 2
|B|
.
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.
Filters are meant to capture a notion of largeness for sets.
(a) Show that {A : X \ A is finite} is a filter (this is called the cofinite or Frech´et 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 A
1
, . . . , A
n
P(X) such that
A
1
··· A
n
F, there is 1 i n such that A
i
F.
(d) Let s X, and define U
s
= {A P(X) : s A}. Show U
s
is an ultrafilter, called the
principal ultrafilter generated by s.
(e) An ultrafilter U is nonprincipal if it is not equal to U
s
for any s X. Show an ultrafilter U is
nonprincipal if and only if it contains the cofinite filter (as a subset).
166
6.3 Indexed Collections of Sets
In this section we consider collections of sets A
n
, 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 {A
n
: n I}, we may form the union and intersection
of the collection:
[
nI
A
n
= {x : x A
n
for some n I},
\
nI
A
n
= {x : x A
n
for all n I}.
Otherwise said,
x
[
nI
A
n
n I such that x A
n
x
\
nI
A
n
n I we have x A
n
A indexed collection {A
n
: n I} is pairwise disjoint if A
m
A
n
= whenever m = n.
When the indexing set is N, it is common to use the notations
S
n=1
A
n
and
T
n=1
A
n
.
Example. Let the indexing set be I = {α, β, γ}, and let
A
α
= {1, 3, 5}, A
β
= {2, 3, 4, 6}, A
γ
= {1, 2, 3, 6}.
It should be clear that
[
iI
A
i
= A
α
A
β
A
γ
= {1, 2, 3, 4, 5, 6}
and
\
iI
A
i
= A
α
A
β
A
γ
= {3}
The following Theorem is almost immediate given the definitions of union and intersection: can you
supply a formal proof?
Theorem 6.8. Let {A
n
: n I} be an indexed collection of sets, and let m I. Then
A
m
[
nI
A
n
and
\
nI
A
n
A
m
.
167
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.
For each n N, consider the interval A
n
=
h
0 ,
1
n
. We analyze the collection {A
n
: n N}. First
observe that m n =
1
n
1
m
= A
n
A
m
; the sets are therefore nested:
A
1
A
2
A
3
A
4
··· ()
Since every set in the collection is a subset of A
1
, it follows that this is the union,
[
n=1
A
n
= A
1
= [0, 1).
Before considering the full intersection, we first compute all finite intersections. Since the sets A
n
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
\
n=1
A
n
= A
m
=
h
0 ,
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
\
n=1
A
n
?
= lim
m
m
\
n=1
A
n
?
= lim
m
h
0 ,
1
m
?
=
h
0 , lim
m
1
m
= [0, 0).
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.
Theorem 6.9.
T
n=1
A
n
= {0}.
Before we give a formal proof, it is instructive to see a calculation. Let us show, for example, that
2
9
T
n=1
A
n
. To prove that
2
9
is not in the intersection of all the A
n
, it is enough to exhibit a single
integer m such that
2
9
A
m
. The picture shows that we can choose m = 10: since
1
10
<
2
9
, we have
2
9
[0,
1
10
] = A
10
. Since
2
9
A
10
, we conclude that
2
9
T
n=1
A
n
.
)[
|
0
1
10
2
9
A
10
168
Proof. We prove that x
T
n=1
A
n
x = 0.
Suppose that x
T
n=1
A
n
. Then x
0 ,
1
n
for all n. Otherwise said,
n N, we have 0 x <
1
n
. (†)
Certainly x = 0 satisfies these inequalities.
Now suppose, for a contradiction, that x > 0. Since lim
n
1
n
= 0, we can certainly choose
a
N large
enough so that
1
N
x. But this says that x A
N
, which contradicts (†).
The intersection contains no positive elements, and we conclude that
\
n=1
A
n
= {0}.
a
Explicitly, you may choose choose N =
1
x
, or anything larger. Here x is the ceiling function: the smallest integer
greater than or equal to x.
By modifying the sets A
n
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?
If B
n
=
0 ,
1
n
, then
T
n=1
B
n
= .
If C
n
=
0 ,
1
n
i
, then
T
n=1
C
n
= .
If D
n
=
h
0 ,
1
n
i
, then
T
n=1
D
n
= {0}.
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!
Here are a few more examples.
Examples. 6.3.1 Let A
n
= [n, n + 1) R, for each n Z. For example,
A
3
= [3, 4), and A
17
= [17, 16).
In this case the sets A
n
are pairwise disjoint, and we have
[
nZ
A
n
= R, and
\
nZ
A
n
= .
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
.
169
6.3.2 For each n N, let A
n
= [n, n]. Each of the sets A
n
is a closed interval. E.g.,
A
1
= [1, 1], A
2
= [2, 2], A
3
= [3, 3].
It should be clear that n m = A
n
A
m
so that we have a nested sequence of sets:
A
1
A
2
A
3
···
It follows immediately that the intersection is
T
nN
A
n
= A
1
= [1, 1].
With a little thinking you might hypothesize that the union is
S
nN
A
n
= R. To prove this,
assume that x R is non-zero, and observe that
|
x
|
x
|
x
|
= x A
|
x
|
Since 0 A
1
, it follows that R
S
nN
A
n
, whence these sets are equal.
If the notation is causing difficulty, consider for example,
3.124 A
3.124
= A
4
.
6.3.3 For each n N, let A
n
= {x R :
x
2
1
<
1
n
}. Before computing the union and intersection
of these sets, it is helpful to write each set as a pair of intervals. Note that
x
2
1
<
1
n
1
n
< x
2
1 <
1
n
r
1
1
n
<
|
x
|
<
r
1 +
1
n
.
Therefore
A
n
=
q
1 +
1
n
,
q
1
1
n
q
1
1
n
,
q
1 +
1
n
.
As the picture suggests, the sets A
n
are nested: A
1
A
2
A
3
A
4
···.
Since A
1
is the largest of the nested sets, we see
that
[
nN
A
n
= A
1
= (
2, 0) (0,
2) .
For the intersection, note that
n N, x A
n
n N,
x
2
1
<
1
n
x
2
1 = 0.
It follows that
T
nN
A
n
= {1, 1}.
)( )(
2
2
0
A
1
)( ) (
q
3
2
q
3
2
q
1
2
q
1
2
A
2
)( ) (
q
4
3
q
4
3
q
2
3
q
2
3
A
3
)( ) (
A
4
)( ) (
A
5
170
Indexed Unions: Don’t Confuse Sets and Elements
It is easy to confuse and important to distinguish between the sets
{A
n
: n I} and
[
nI
A
n
.
The first is a set whose elements are themselves sets. The second is the collection of all elements in any
set A
n
. Consider the following examples.
Examples. 6.3.1 For each n {1, 2, 3}, let A
n
be the plane {(x, y, z) : x + ny + n
2
z = 1} R
3
.
The indexed collection {A
1
, A
2
, A
3
} has three elements: each of the planes A
1
, A
2
, A
3
is an ele-
ment in its own right.
The union A
1
A
2
A
3
is an infinite set consisting of all the points lying on any of the three
planes.
For the intersection, a little work with simultaneous equations should convince you that
(x, y, z)
\
n{1,2,3}
A
n
x + y + z = 1
x + 2y + 4z = 1
x + 3y + 9z = 1
(x, y, z) = (1, 0, 0).
Thus
T
A
n
= {(1, 0, 0)}. The planes are drawn below.
6.3.2 Let I = R {}. For each m I, let A
m
be the line
a
through the origin in R
2
with gradient m.
Each element of {A
m
: m I} is a line: there is one for each direction through the origin.
The union
S
A
m
consists of all of the points that lie on any line through the origin. Since any
point in the plane lies on some line through the origin, we see that
S
A
m
= R
2
.
It should be clear that all the lines intersect at the origin, and so
T
A
m
= {(0, 0)}.
The collection of lines {A
m
: m I} is the famous projective space P(R
2
); this is a very different
set from R
2
!
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
θ
= A
tan θ
.
a
We include the vertical line A
.
Example 1: Three elements, or an infinite
number?
A
1
A
2
A
4
A
0.5
A
3
A
0.75
A
0.2
A
0
A
Example 2: Elements in P(R
2
)
171
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 each n N, let A
n
be the set of decimals of length n. That is
A
n
=
0.a
1
a
2
. . . a
n
: where each a
i
{0, 1, . . . , 9}
.
For example 0.134 A
3
. Since 0.134 = 0.1340, we also have 0.134 A
4
. Once again we have a nested
sequence of sets
A
1
A
2
A
3
A
4
···
The infinite intersection is therefore simply
\
nN
A
n
= A
1
= {0, 0.1, . . . , 0.9}.
Now consider a finite union: if m N, then
m
[
n=1
A
n
= A
m
=
x [0, 1) : x has a decimal representation of length m
.
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 entire
20
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
[
nN
A
n
n N such that x A
n
n N such that x is a decimal of length n.
It follows that
[
nN
A
n
=
x [0, 1) : x has a finite decimal representation
In particular, there are no irrational numbers in
S
nN
A
n
:
If x A
n
, then y = 10
n
x is an integer, whence x =
y
10
n
Q.
Many rational numbers are also excluded. For example
1
3
= 0.3333 ··· is not in any set A
n
and is
therefore not in the union.
20
We would include 1 = 0.9999 ···
172
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 C
0
= [0, 1], we construct a sequence of sets C
n
for each n N
0
by repeatedly
removing the middle third of each of the intervals contained in C
n
.
C
0
= [0, 1],
C
1
= [0,
1
3
] [
2
3
, 1],
C
2
= [0,
1
9
] [
2
9
,
1
3
] [
2
3
,
7
9
] [
8
9
, 1], etc.
0
1
3
2
3
1
The sequence is drawn up to C
9
, with an animation below. To see the detail for the last few sets, try
zooming in as far as you can.
Definition 6.10. The Cantor set C is the infinite intersection C =
T
n=0
C
n
.
This set has several interesting properties.
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
length(C
0
) = 1, length(C
1
) =
2
3
, length(C
2
) =
2
3
2
, etc.
Induction then gives us
length(C
n
) =
2
3
n
.
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,
1
3
n
C for all n N
0
, 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
1
3
C means ‘take all the elements of C and divide them by three,’ and
1
3
C +
2
3
means
‘take all the elements of
1
3
C and add
2
3
,’ then
C =
C
3
C
3
+
2
3
. ()
173
0
1
3
2
3
1
C
0
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.
Optional: Analyzing the Cantor Set
To get further with the Cantor set, it is necessary to explicitly describe the elements of the set. This
can be accomplished using the ternary representation. It can be shown that every number x [0, 1]
may be written in the form
21
x =
n=1
3
n
a
n
=
a
1
3
+
a
2
3
2
+
a
3
3
3
+ ···
where each a
n
{0, 1, 2}. We write x = [0.a
1
a
2
a
3
···]
3
. For example:
[0.12]
3
=
1
3
+
2
3
2
=
5
9
,
64
243
=
2
3
2
+
1
3
3
+
1
3
5
= [0.02101]
3
, 1 = [0.22222 ···]
3
.
For this last, use the formula for the sum of a geometric series to calculate
n=1
2
1
3
n
= 2 ·
1/3
11/3
= 1.
To convince yourself of the existence of a ternary representation, note that if 0 x < 1 it follows that
x < 3 and so, we can take
a
1
= 3x {0, 1, 2}
Now repeat, with a
2
= x
a
1
3
, etc. It can also be shown that the only possibility whereby x can have
two ternary expansions is if one of them terminates. The other will eventually become a sequence of
repeating 2’s. For example:
22
[0.0222222 ···]
3
= [0.1]
3
=
1
3
and [0.10122222 ···]
3
= [0.102]
3
=
1
3
+
2
27
=
11
27
.
We can now describe precisely the elements of each of the sets C
n
and consequently the Cantor set.
Theorem 6.11. C
n
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:
[0.020202020 ···]
3
= 2
n=1
3
2n
=
2/9
1 1/9
=
1
4
is an element of the Cantor set! What is strange is that
1
4
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 to a decimal representation x =
n=1
10
n
a
n
=
a
1
10
+
a
2
10
2
+
a
3
10
3
+ ··· where a
n
{0, 1, 2, . . . , 9}.
22
This is ticklish to prove, as is the corresponding result for decimals: compare with 1 = 0.99999999 ···
174
Proof. We prove by induction.
(Base Case) The proposition is clearly true for C
0
= [0, 1], as there is nothing to check.
(Induction Step) Assume that the proposition is true for some fixed n N
0
. Analogously to ()
above, observe that C
n+1
is built from two shrunken copies of C
n
:
C
n+1
=
1
3
C
n
1
3
C
n
+
2
3
.
Now consider what division by 3 and addition of
2
3
does to a ternary representation.
Since
1
3
n=1
3
n
a
n
=
n=1
3
n1
a
1
, we see that multiplication by
1
3
shifts a ternary representa-
tion one position to the right.
a
1
3
[0.a
1
a
2
a
3
. . .]
3
= [0.0a
1
a
2
a
3
. . .]
3
Since
2
3
= [0.2]
3
we see that
2
3
+
1
3
[0.a
1
a
2
a
3
. . .]
3
= [0.2a
1
a
2
a
3
. . .]
3
By the induction hypothesis, C
n
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 C
n+1
contains only 0’s and 2’s in its first n + 1 entries.
By induction the proposition is true for all n N
0
.
a
Compare to multiplication of a decimal by
1
10
.
Other fractal sets based on C include the Cantor dust C ×C, the Sierpi
´
nski carpet and gasket, and the
von Koch snowflake.
Reading Quiz
6.3.1 Let I be a set and {A
n
: n I} a family of sets indexed by I. Then the definition of
S
nI
A
n
uses
the quantifier and the definition of
T
nI
A
n
uses the quantifier.
(a) existential; existential
(b) existential; universal
(c) universal; existential
(d) universal; universal
6.3.2 Let I be a set and {A
n
: n I} a collection of sets indexed by I which is nested. What can you
conclude? Select all that apply.
(a)
T
nI
A
n
= .
(b)
S
nI
A
n
= A
1
.
175
(c) The collection of sets is pairwise disjoint.
(d) Each A
n
must be an interval.
6.3.3 True or False:
B
[
nI
A
n
n I, B A
n
Practice Problems
6.3.1 (From previous exercises) For each non-negative real number r 0 let
A
r
=
(x, y) R
2
: x
2
+ y
2
= r
2
(a) Describe each of the sets A
r
geometrically.
(b) Prove that
S
rR
+
0
A
r
= R
2
.
Video Solution
6.3.2 Let I be a set, {A
n
: n I} a family of sets indexed by I and B a set. Prove:
(a)
[
nI
A
n
!
B =
[
nI
(A
n
B)
(b)
\
nI
A
n
!
B =
\
nI
(A
n
B)
Video Solution
Exercises
6.3.1 For each integer n, consider the set B
n
= {n} ×R.
(a) Draw a picture of
4
S
n=2
B
n
(in the Cartesian plane).
Hint:
4
S
n=2
B
n
= B
2
B
3
B
4
.
(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.
(c) Compute
4
S
n=2
B
n
C.
(d) Compute
4
S
n=2
(
B
n
C
)
.
176
(e) Compare
4
S
n=2
B
n
C and
4
S
n=2
(
B
n
C
)
. What do you notice?
6.3.2 (a) Determine
S
r∈{1,3,4}
S
r
and
T
r∈{1,3,4}
S
r
, where S
r
is the interval [r 1, r + 3].
(b) Determine
S
iN
{i} and
T
iN
{i}.
(c) Determine
S
XP(Z)
X and
T
XP(Z)
X .
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) {A
n
}
nN
=
[0, 2 + n] : n N}
(b) {A
n
}
nN
=
[1, 2 + 1), [1, 2 +
1
2
), [1, 2 +
1
3
), . . .
(c) {A
n
}
nN
=
(
2n+1
n
, 2n) : n N}
(d) {A
n
}
nN
=
(
1
4
, 1), (
1
8
,
1
2
), (
1
16
,
1
4
), (
1
32
,
1
8
), (
1
64
,
1
16
), . . .
6.3.5 For each non-negative real number r 0 let
A
r
=
(x, y) R
2
: x
2
+ y
2
= r
2
(a) Describe each of the sets A
r
geometrically.
(b) Prove that
S
rR
+
0
A
r
= R
2
.
6.3.6 For each real number x, let A
x
= {3, 2} {y R : y > x}. Find
S
xR
A
x
and
T
xR
A
x
.
6.3.7 Use Definition 6.7 to prove the following results about nested sets.
(a) A
1
A
2
A
3
··· =
S
nN
A
n
= A
1
.
(b) A
1
A
2
A
3
··· =
T
nN
A
n
= A
1
.
6.3.8 Let C
0
(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,
1
2
}). Prove that
[
f C
0
(R)
A
f
= [0, 1] and
\
f C
0
(R)
A
f
= {0}.
6.3.9 Let A
n
be the set of decimals of length n, as described on page 172.
(a) Prove directly that the cardinality of A
n
is 10
n
.
(b) Prove by induction that
|
A
n
|
= 10
n
.
177
(c) Prove that
S
n=1
A
n
Q.
(d) Prove by contradiction that
1
3
S
n=1
A
n
.
6.3.10 Suppose that the following are true:
n N, A
n
= .
m n = A
m
A
n
.
Prove or disprove the following conjectures:
(a)
293
S
n=1
A
n
=
(b)
293
T
n=1
A
n
=
(c)
S
nN
A
n
=
(d)
T
nN
A
n
=
6.3.11 Suppose we are working in a universal set U (so every set is considered a subset of U). Give an
explanation for why it makes sense to define
T
nI
A
n
= U when I = .
6.3.12 Let {A
n
: n I} and {B
n
: n I} be indexed families of sets. Give explicit examples for which
the following hold:
(a)
[
nI
A
n
!
[
nI
B
n
!
=
[
nI
(A
n
B
n
)
(b)
\
nI
A
n
!
\
nI
B
n
!
=
\
nI
(A
n
B
n
)
6.3.13 (De Morgan’s laws) Let {A
n
: n I} be an indexed family of sets and B a set. Prove
(a)
B \
[
nI
A
n
!
=
\
nI
(B \ A
n
)
(b)
B \
\
nI
A
n
!
=
[
nI
(B \ A
n
)
6.3.14 Let {A
n
: n I} be an indexed family of sets and B a set. Prove
178
(a)
[
nI
A
n
!
\ B =
[
nI
(A
n
\ B)
(b)
\
nI
A
n
!
\ B =
\
nI
(A
n
\ B)
6.3.15 We can take the Cartesian product of arbitrarily many sets. Let {A
n
: n I} be a family of sets.
Define
nI
A
n
=
(
f : I
[
nI
A
n
f (n) A
n
)
.
(a) If I = N and A
n
= R for each n N, can you give a more intuitive description of the
elements of
nN
A
n
?
(b) Suppose we have two families {A
n
: n I} and {B
n
: n I}. Prove
nI
A
n
!
nI
B
n
!
=
nI
(A
n
B
n
)
6.3.16 (Hard) Let A
n
= {
m
n
Q : 0 < m < n, m N}, for each n N.
(a) Write down A
1
, A
2
, A
3
, A
4
explicitly.
(b) Prove that A
m
A
pm
for any p N.
(c) Argue that
S
nN
A
n
= Q (0, 1).
(d) Argue that further
S
nN
A
2n
= Q (0, 1).
(e) Extend your proof to show that, for any fixed p N,
S
nN
A
pn
= Q (0, 1).
6.3.17 In this question we construct a fractal shape, similar to the von Koch curve. Let F
0
= [0, 1] be a
straight line of length 1. Delete the segment between
1
2
and
3
4
to obtain the set
F
1
= [0,
1
2
] [
3
4
, 1]
Now repeat: delete the third quarter of each of the two line segments in F
1
to obtain
F
2
= [0,
1
4
] [
3
8
,
1
2
] [
3
4
,
7
8
] [
15
16
, 1]
Suppose we repeat this process to create an infinite sequence of sets F
0
, F
1
, F
2
, F
3
, F
4
, . . .
(a) Prove that the total length of all of the line segments making up the set F
n
is
3
4
n
.
179
(b) Prove by contradiction that the intersection
T
n=1
F
n
does not contain any intervals of posi-
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.
Step 1 Step 2 Step 3
After each step, we are left with a curve. After step 1 the curve has length
1
=
3
2
. After
step 2 the length is
2
=
9
4
. What is the length
n
of the curve after n steps? Prove your
assertion.
(d) Below is the result of repeating the steps in part 3 infinitely many times. What is the
‘length’ of the resulting fractal curve?
(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
1
8
.
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 {U
n
: n I} τ for any index set I, then
S
nI
U
n
τ;
(3) τ is closed under finite intersection. That is, if U
1
, . . . , U
n
τ for any n N, then U
1
··· U
n
τ.
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.
180
(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 τ.
(a) Show the following properties of closed sets:
(i) and X are both closed.
(ii) If {A
n
: n I} is an arbitrary collection of closed sets, then
T
nI
A
n
is closed.
(iii) If A
1
, . . . , A
n
are closed sets, then A
1
··· A
n
is closed.
(b) In the standard topology on R, show that a closed interval [a, b] is a closed set but that a
half-open interval [a, b) is neither open nor closed.
181
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.
7.0.2 A function f : A B relates elements in a set A with those in B.
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.
A relation on A is a relation from A to itself.
If (x, y) R we can also write x Ry, and say x is related to y.’ Similarly x Ry means (x, y) ∈ R.
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, 2 R5, 3 R2
7.1.2 R =
[1, 3) × (3, 4]
(2t + 1, t
2
) : t [
1
2
, 2]
is a relation from R to R. Be careful: it is easy
to confuse interval notation with the notation for ordered pair!
7.1.3 The set R = {(a, a) : a A} is a relation on A, indeed
(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 Ry x = y simply says that R is ‘equals.’
7.1.4 If A = {all humans}, we may define R A × A by
(a
1
, a
2
) R a
1
, a
2
have a parent-child, or a sibling relationship.
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.
7.1.5 If A is a set, then is a relation on the power set P(A).
For example, if A = {1, 2, 3} then {1} P(A) and {1, 3} P(A). We’d say that {1} is related
to {1, 3} since {1} {1, 3}.
It should be clear that, under the relation , that {1, 3} is not related to {1}.
182
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:
1
2
3
4
5
N
1 2 3 4 5
N
Example 1.
0
1
2
3
4
5
R
0 1 2 3 4 5
R
Example 2.
Not all relations between sets of numbers can be graphed: for example, graphing the relation R =
Q ×Q is impossible!
To refer to the introduction, the standard ordering < on N is
a relation, and we can graph it: for all x, y N, we define
x Ry x < y
or equivalently,
R = {(x, y) N ×N : x < y}
1
2
3
4
5
6
N
1 2 3 4 5 6
N
We can also think about functions in this language: if f : R R is a function, then we could define
x Ry y = f (x)
or equivalently
R = {(x, y) R
2
: y = f (x)}
We will return to this viewpoint on function in the Section 7.2.
Basic results regarding relations
With abstract relations, there are only a small number of things we can do.
Definition 7.2. If R A × B is a relation, then its inverse R
1
B × A is the set
R
1
= {(y, x) B × A : (x, y) R}.
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.
183
Theorem 7.3. Given any relations R, S A × B:
7.1.1 (R
1
)
1
= R
7.1.2 R S R
1
S
1
7.1.3 (R S)
1
= R
1
S
1
7.1.4 (R S)
1
= R
1
S
1
7.1.5 If A = B, then R R
1
is symmetric
7.1.6 If A = B, then R R
1
is symmetric
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,
(x, y) R
1
= (y, x) R = (y, x) S
= (x, y) S
1
.
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,
( R R
1
)
1
= R
1
(R
1
)
1
= R
1
R = R R
1
,
and so R R
1
is symmetric.
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
( R S)
1
=
R
1
S
1
or
R
1
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!
184
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 R3 but 3 R1. We compute
R
1
= {(3, 1), (2, 2), (3, 2), (2, 3), (1, 4), (2, 5)},
and observe that
RR
1
= {(2, 2), (2, 3), (3, 2)} and
RR
1
= {(1, 3), (3, 1), (2, 2), (2, 3), (3, 2), (4, 1), (1, 4), (5, 2), (2, 5)}
are both symmetric.
1
2
3
4
5
N
1 2 3 4 5
N
The relation R R
1
1
2
3
4
5
N
1 2 3 4 5
N
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
(a) a nonempty subset of A × B
(b) a proper subset of A × B
(c) a function from A to B
(d) a subset of A × B
7.1.2 If A R, then the graph of a symmetric relation R A × A has what kind of symmetry?
(a) symmetric about the x-axis
(b) symmetric about the y-axis
(c) symmetric about the line y = x
(d) symmetric across the origin
7.1.3 True or False: if R is symmetric, then it must contain an even number of elements.
185
Practice Problems
7.1.1 Let L
a,b,c
= {(x, y) : ax + by = c} R
2
.
(a) Describe L
a,b,c
geometrically.
(b) Let A = R
2
and B = {L
a,b,c
: a, b, c R}. Define R A × B by (x, y) R L
a,b,c
if and only if
ax + by = c. For each of the following, determine if it is true or false.
(i) ( 1, 0) R L
1,1,1
(ii) ( 3, 2) R L
1,1,1
(iii) if (x, y) R L
a,b,c
and (x, y) R L
d,e, f
for some (x, y) then L
a,b,c
= L
d,e, f
(iv) suppose (x, y) RL
a,b,c
, then there exists d, e, f R such that (x, y) R L
d,e, f
and L
a,b,c
L
d,e, f
=
7.1.2 Let X be a set. Let R P(X) ×P(X) be the relation A RB A B.
(a) Show that A (R R
1
) B implies A = B.
(b) If X = {a, b}, compute R
1
explicitly as a set of ordered pairs.
Exercises
7.1.1 Let R be the relation on {0, 1, 2} defined by
0 R0 0 R1 2 R1
(a) Write R as a set of ordered pairs.
(b) What is the inverse of R?
7.1.2 (a) Let R be the relation on R defined by a Rb
|
a b
|
= 1. Is this relation symmetric?
(b) Let be the relation on R defined by
a b x Q \{0} such that a = x
2
b.
Is this relation symmetric?
7.1.3 Draw pictures of the following relations on the set of real numbers R.
(a) R = {(x, y) : y x and y 2 and y 2 x}.
(b) S = {(x, y) : (x 4)
2
+ (y 1)
2
9}.
Also draw the inverse of each relation.
7.1.4 A relation is defined on N by a Rb
a
b
N. Let c, d N. Under what conditions is it
permissable to write c R
1
d?
7.1.5 Let R N
2
be the relation m Rn iff m | n. Compute RR
1
.
7.1.6 Let R {1, 2, 3, 4} ×{1, 2, 3, 4} be the relation
R = {(1, 3), (1, 4), (2, 2), (2, 4), ( 3, 1), (3, 2), (4, 4)}.
186
(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.10 Let R and S be two symmetric relations on a set A.
(a) Show R S is symmetric.
(b) Does R S have to be symmetric? Give a proof or counterexample.
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
T =
n
T A × A : T symmetric and R T
then
S =
\
T T
T
S is known as the symmetric closure of R.
187
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
dom(R) = {a A : (a, b) R for some b B},
range(R) = {b B : (a, b) R for some a A}.
A function from A to B is a relation f A × B satisfying the following conditions:
7.2.1 dom( f ) = A,
7.2.2 (a, b
1
), (a, b
2
) f = b
1
= b
2
.
The two conditions can be thought of as saying:
7.2.1 Every element of A is related to at least one element of B.
7.2.2 Every element of A is related to at most one element of B.
Putting these together, we see that a relation f A × B is a function if every a A is the first entry
of one (and only one) ordered pair (a, b) f . The second condition is the vertical line test, familiar
from calculus.
B
A
a
f (a)
b
1
= b
2
= f (a): a function
B
A
a
b
1
b
2
b
1
= b
2
: 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 .
188
Example. Let A = B = {1, 2, 3} and consider the relation
f = {(1, 3), (2, 1), (3, 3)}.
Observe that dom( f ) = {1, 2, 3} = A, and that each element
of A appears exactly once as the first element in a pair (a, b)
f . The relation therefore satisfies both conditions necessary to
be a function. In more elementary language we would write
f (1) = 3, f (2) = 1 and f (3) = 3.
Since 3 appears twice as a second entry of an ordered pair in f
we see that f is not injective.
Since 2 never appears as the second entry of an ordered pair in
f we see that f is not surjective.
1
2
3
B
1 2 3
A
A function f : A B
Example. Let A be any set and define a relation id
A
: A A by
id
A
= {(a, a) : a A}.
Then id
A
is a bijective function (check this!) called the identity function on A.
The Inverse of a Function
Since every function is a relation, it is a straightforward business to define the inverse of a function.
Definition 7.5. The inverse of a function f A × B is the inverse relation f
1
B × A.
To compute an inverse relation we simply reverse the components of each ordered pair: the following
should therefore be clear.
Theorem 7.6. dom( f
1
) = range( f ) and range( f
1
) = dom( f ).
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.
Example (cont.). Consider the above example.
189
The inverse relation
f
1
= {(3, 1), (1, 2), (3, 3)} B × A
is not a function due to failing both conditions of Definition 7.4.
dom( f
1
) = {1, 3} is not the whole of B.
( 3, 1) f
1
and ( 3, 3) f
1
, but 1 = 3.
Both failures are clearly visible in the picture.
1
2
3
A
1 2 3
B
f
1
B × A: not a function
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, x
2
) : x R}. This is simply the function with formula
f (x) = x
2
. The inverse relation f
1
R ×R is then
f
1
=
(x
2
, x) : x R
=
( y, ±
y) : y 0
.
In this case, f
1
is not a function. In the language of Definition 7.4:
dom( f
1
) = R
+
0
= B. E.g., 1 B but 1 dom( f
1
).
( 4, 2) and ( 4, 2) are distinct elements of f
1
with the same first entry.
1
2
3
4
R
2 1 0 1 2
R
f : A B
2
1
0
1
2
R
1 2 3 4
R
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.
190
7.2.2 Let A = B = R and f = {(x, x
3
) : x R}, so that f has formula f (x) = x
3
. This time, the
inverse is also a function and we could write f
1
( y) =
3
y:
f
1
=
(x
3
, x) : x R
=
( y,
3
y) : y R
.
8
4
4
8
R
2 1 1 2
R
f : A B
2
1
1
2
R
8 4 4 8
R
f
1
: B A is a function
All three of our examples help to illustrate the following important result.
Theorem 7.7. A relation f
1
B × A is a function f is bijective (both injective and surjective).
Proof. Recalling Definition 7.4, we see that
f
1
is a function
dom( f
1
) = B,
and
( b, a
1
), (b, a
2
) f
1
= a
1
= a
2
.
The first of these is equivalent to range( f ) = B, which says that f is surjective.
The second is equivalent to (a
1
, b), (a
2
, b) f = a
1
= a
2
, which says that f is injective.
Here is a final example, where the function f is harder to visualize.
Example. Let A = R, B = Q and define f using the formula
f (x) =
(
x if x Q,
0 if x Q.
In the language of relations, this is f =
(x, x) : x Q
(x, 0) : x ∈ Q
.
This is a surjective function since every element of B = Q appears as the second entry in an ordered
pair (a, b) f . It is not injective since zero appears more than once in the second entry. For example,
(
2, 0), (
3, 0) f .
Written in the more common manner, we are observing that f (
3) = f (
2) .
191
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.
Aside. Equality of functions
There are two competing notions of what it means for two functions to be equal.
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.
Same domain, same graph f = g means that f A × B, g A ×C, and
(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
f : R R, and g : R [1, 1] satisfy f (x) = g(x) = sin x.
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
f (x) = x
2
+ 2, and g(x) =
(x
2
+ 2)(x 1)
x 1
.
192
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
to ignore surjectivity and use the second notion of functional equality.
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, b
1
), (a, b
2
) R, then b
1
= b
2
(d) for any b range(R), if (a
1
, b), (a
2
, b) R, then a
1
= a
2
7.2.2 Let f : A B be a function. If f
1
: B A is a function, this means in particular that
dom( f
1
) = B. This is equivalent to what property of f ?
(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 ?
7.2.2 (a) Express the function f : R R : x 7→ x
2
as a relation.
(b) What is the inverse relation f
1
?
(c) Use Definition 7.4 to prove that the relation f
1
is not a function.
(d) Prove directly from Definition 3.14 that f is not injective and not surjective. Compare your
arguments with your answer to part (c).
Exercises
7.2.1 Suppose that f {1, 2, 3, 4} × {1, 2, 3, 4, 5, 6, 7} is the relation
f = {(1, 1), (2, 3), (3, 5), (4, 7)}.
(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.
193
(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}
.
as sets. If g is a bijective function, what is B?
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.
(a) R = {(x, y) [1, 1] ×[1, 1] : x
2
+ y
2
= 1}
(b) S = {(x, y) [1, 1] × [0, 1] : x
2
+ y
2
= 1}
(c) T = {(x, y) [0, 1] × [1, 1] : x
2
+ y
2
= 1}
(d) U = {(x, y) [0, 1] × [0, 1] : x
2
+ y
2
= 1}
7.2.3 In Example 2 on page 191, 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 191, compute the following preimages:
(a) f
1
( {0, 1})
(b) f
1
[0, 1)
(c) f
1
( , 0]
(d) f
1
{8} [ 7, 2] (3, 9)
7.2.6 Let A and B be nonempty and f : A B be a function.
(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.
7.2.7 (a) Express the function f : R R : x 7→ x
4
+ 3 as a relation.
(b) What is the inverse relation f
1
?
(c) Use Definition 7.4 to prove that the relation f
1
is not a function.
(d) Prove directly from Definition 3.14 that f is not injective and not surjective. Compare your
arguments with your answer to part (c).
7.2.8 Repeat the previous question for f : R R : x 7
x
2
4x + 5.
7.2.9 Give a formal proof of Theorem 7.6.
7.2.10 Prove or disprove the following: if f : A B is a function, and U, V B, then
f
1
(U V) = f
1
(U) f
1
(V)
194
7.2.11 Let A and B be nonempty and f : A B be a function.
(a) Suppose f is a bijection. Show that f
1
satisfies f f
1
= id
B
and f
1
f = id
A
.
(b) Suppose that there is a function g : B A such that f g = id
B
and g f = id
A
. Show f
is a bijection and that g = f
1
.
(c) Suppose there are functions g : B A and h : B A such that f g = id
B
and h f =
id
A
. Show that g = h and that both are also equal to f
1
.
7.2.12 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 = id
B
.
(b) Prove that f is injective if and only if there is h : B A such that h f = id
A
.
7.2.13 Let A and B be nonempty and f : A B be a function.
(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.
195
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 Ry has the same meaning as (x, y) R. We might read x Ry as x is R-related to y.’
Definition 7.8. A relation R on a set A may be described as reflexive, symmetric or transitive if it
satisfies the following properties:
Reflexivity x A, x Rx (every element of A is related to itself)
Symmetry x, y A, x Ry = y R x (if x is related to y, then y is related to x)
Transitivity x, y, z A, x Ry and y Rz = x Rz (if x is related to y, and y is related to z,
then x is related to z)
Symmetry is exactly the same notion as in Definition 7.2.
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.
Symmetry True. For all lines
1
,
2
A, if
1
intersects
2
,
then
2
intersects
1
..
Transitivity False. As the picture illustrates, we may let
1
and
3
be parallel lines, and
2
cross both of
these. Then
1
R
2
and
2
R
3
, but
1
R
3
.
`
1
`
3
`
2
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.
196
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.
Examples. 7.3.1 For all x, y Z, we define the relation by
x y x y is even.
We claim that is an equivalence relation on Z.
Reflexivity x Z, x x = 0 is even, hence x x.
Symmetry x, y Z, x y = x y is even = y x is even = y x.
Transitivity x, y, z Z, if x y and y z, then x y and y z are even. But the sum of two
even numbers is even, hence x z = (x y) + (y z) is even, and so x z.
7.3.2 Let A = {all students taking this course}. For all x, y A, let
x y x achieves the same letter-grade as y.
Then is an equivalence relation on A; here is the proof.
Reflexivity x A, x x since everyone scores the same as themself!
Symmetry x, y A, x y = x achieves the same letter-grade as y
= y achieves the same letter-grade as x
= y x
Transitivity x, y, z A, if x y and y z, then x achieves the same as y who achieves the
same as z, whence x achieves the same as z. Thus x z.
7.3.3 We define an equivalence relation on Z by
x, y Z, x y x
2
y
2
(mod 5).
Reflexivity x Z, x x since x
2
is always congruent to itself!
Symmetry x, y Z, x y = x
2
y
2
(mod 5)
= y
2
x
2
(mod 5)
= y x
Transitivity x, y, z Z, if x y and y z, then x
2
y
2
and y
2
z
2
(mod 5). But then
x
2
z
2
(mod 5) and so x z.
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.
197
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
X
=
n
[x] : x X
o
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
x y (mod 5) = x
2
y
2
(mod 5),
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
x
2
(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
[0] = {x Z : x 0 (mod 5)}
[1] = {x Z : x 1, 4 (mod 5)}
[2] = {x Z : x 2, 3 (mod 5)}
In this case the quotient is the set
Z
=
n
[0], [1], [2]
o
.
198
Here is one further example of an equivalence relation, this time on R
2
. Be careful with the notation:
R
2
= R ×R is already a Cartesian product, so a relation on R
2
is a subset of R
2
×R
2
!
Example. Let be the relation on R
2
defined by (x, y) (v, w) x
2
+ y
2
= v
2
+ w
2
. We claim
that this is an equivalence relation.
Reflexivity (x, y) R
2
, x
2
+ y
2
= x
2
+ y
2
.
Symmetry (x, y), (v, w) R
2
, (x, y) (v, w) = x
2
+ y
2
= v
2
+ w
2
= v
2
+ w
2
= x
2
+ y
2
= (v, w) (x, y)
Transitivity (x, y), (v, w), (p, q) R
2
, if (x, y) (v, w) and (v, w) (p, q), then x
2
+ y
2
=
v
2
+ w
2
and v
2
+ w
2
= p
2
+ q
2
. But then x
2
+ y
2
= p
2
+ q
2
and so (x, y) (p, q).
is therefore an equivalence relation. But what are the equivalence classes? By definition,
[(x, y)] =
n
( v, w) R
2
: v
2
+ w
2
= x
2
+ y
2
o
.
This isn’t particularly helpful. Indeed it is easier to think of
each of these sets as
n
( v, w) R
2
: v
2
+ w
2
is constant
o
.
Each equivalence class is therefore a circle centered at the ori-
gin! Some of the equivalence classes are drawn in the pic-
ture: the class [(1, 0)] is highlighted. Moreover, the quotient
set is
R
2
= {circles centered at the origin}.
1
1
w
1 1
v
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.
(1) x [y] and y [z] = x [z].
(2) x [x].
(3) x [y] y [x].
(a) (1) is reflexivity, (2) is symmetry, and (3) is transitivity
(b) (1) is transitivity, (2) is symmetry, and (3) is reflexivity
(c) (1) is transitivity, (2) is reflexivity, and (3) is antisymmetry
199
(d) (1) is transitivity, (2) is reflexivity, and (3) is symmetry
7.3.3 Suppose R is an equivalence relation on a set X. Then R
1
is also an equivalence
relation.
(a) never
(b) sometimes
(c) always
Practice Problems
7.3.1 Define R on N
2
by a Rb if and only if gcd(a, b) > 1. Determine whether or not R is reflexive,
symmetric, or transitive.
7.3.2 Let be the relation on R defined by x y if and only if x y Z.
(a) Prove that is an equivalence relation.
(b) List three distinct elements of the equivalence class [5/2]. In general, what is an equiva-
lence class [x] as a set?
(c) Describe the quotient R/ .
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.
(a) R is both symmetric and antisymmetric.
(b) R is neither symmetric nor antisymmetric.
(c) R is transitive but R R
1
is not transitive.
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.3 Let S = {(x, y) R
2
: sin
2
x + cos
2
y = 1}.
(a) Give an example of two real numbers x, y such that x S y.
(b) Is S reflexive? Symmetric? Transitive? Justify your answers.
7.3.4 Each of the following relations is an equivalence relation on R
2
. Identify the equivalence
classes and draw several of them.
(a) (a, b) (c, d) ab = cd.
(b) (v, w) (x, y) v
2
w = x
2
y.
7.3.5 (a) Let be the relation defined on Z by a b a + b is even. Show that is an
equivalence relation and determine the distinct equivalence classes.
(b) Suppose that ‘even’ is replaced by ‘odd’ in part (a). Which of the properties reflexive,
symmetric, transitive does possess?
200
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.
(a) a Rb a b (mod 3) or a b (mod 4).
(b) a Rb a b (mod 3) and a b (mod 4).
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 Ry x y is small.
Prove or disprove: R is an equivalence relation on R.
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
s(x) = ax
3
+ bx
2
+ cx + d, where a, b, c, d R.
A relation R on S is defined by
p Rq p and q have a common root.
For example p(x) = (x 1)
2
and q(x) = x
2
1 have the root 1 in common so that p Rq.
Determine which of the properties reflexive, symmetric and transitive are possessed by R.
7.3.11 Let A = {2
m
: m Z}. A relation is defined on the set Q
+
of positive rational numbers by
a b
a
b
A
(a) Show that is an equivalence relation.
(b) Describe the elements in the equivalence class [3].
7.3.12 A relation is defined on the set A = {a + b
2 : a, b Q, a + b
2 = 0} by x y
x
y
Q.
Show that is an equivalence relation and determine the distinct equivalence classes.
7.3.13 Let R and S be equivalence relations on a set X.
(a) Show that R S is an equivalence relation.
(b) Does R S have to be an equivalence relation? Prove or give counterexample.
(c) Determine what the equivalence classes of R S are in terms of the equivalence classes
for R and S individually.
7.3.14 Let f : A B be a function. Define on A by a b if and only if f (a) = f (b).
(a) Show is an equivalence relation.
201
(b) Describe the equivalence classes of .
(c) Show that f is injective if and only if is equality.
7.3.15 Let X be a set and an equivalence relation on X. Define π : X X/ by π(x) = [x]. Show
that π is a surjection. Prove that π is an injection if and only if is equality.
7.3.16 Let R be a relation on a set X. Show that S = R {(x, x) : x X} is the smallest reflexive
relation on X containing R. That is,
(a) S is reflexive.
(b) R S.
(c) If T is a reflexive relation on X such that R T , then S T .
We call S the reflexive closure of R.
7.3.17 Recall the description of the real projective line (page 171): if A
m
is the line through the origin
with gradient m, then
P( R
2
) = {A
m
: m R {}}.
Define a relation on R
2
= R
2
\{(0, 0)} by (a, b) (c, d) ad = bc.
(a) Prove that is an equivalence relation.
(b) Find the equivalence classes of . How do the equivalence classes differ from the lines
A
m
?
7.3.18 Let X be a set. Suppose we have a function cl : P(X) P(X) which satisfies the following
properties:
(i) (Reflexivity) A cl(A) for all A P(X);
(ii) (Monotonicity) if A B, then cl(A) cl(B) for all A, B P(X);
(iii) (Idempotence) cl( cl(A)) = cl(A) for all A P(X);
(iv) (Exchange) if a cl(A {b}) \cl(A), then b cl(A {a}) for all a, b X.
Define on X \cl() by a b if and only if a cl({b}).
(a) Show is an equivalence relation.
(b) Show a b if and only if cl({a}) = cl({b}).
(c) Prove that [a] = cl({a}) \cl().
7.3.19 Suppose that R, S are relations on some set X. Define the composition RS to be the relation
(a, c) R S b X such that (a, b) R and (b, c) S.
(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.
202
(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.
7.3.20 Let R be a relation on a set X. Inductively define R
n
for n N as follows:
R
1
= R
R
n+1
= R R
n
.
Set
R
+
=
[
nN
R
n
.
Show that R
+
is the smallest transitive relation on X containing R. That is,
(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 R
n
T for all n N.]
We call R
+
the transitive closure of R.
(d) Let X = {a, b, c, d} and R = {(a, b), (b, c), (c, d)}. Compute R
+
.
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
.
(a) Prove that is an equivalence relation.
(b) What is the equivalence class of the identity matrix?
(c) Show that
11 15
5 9
4 10
0 6
(Hint: think about diagonalizing)
(d) (Hard) Suppose that L : R
2
R
2
is a linear map and β, γ are bases of R
2
. Suppose that
A = [L]
β
and B = [L]
γ
are the matrix representations of L with respect to the two bases.
Prove that A B.
(e) (Hard) Suppose that A, B have the same, but distinct, eigenvalues λ
1
= λ
2
. Prove that
A B. Again use diagonalization, the challenge here is to make your proof work even when the
eigenvalues are complex numbers.
203
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.
Definition 7.11. Let X be a set and {A
n
: n I} be a collection of non-empty subsets A
n
X. We
say that X is partitioned by the collection of subsets if
7.4.1 X =
S
nI
A
n
. (the A
n
together make up X)
7.4.2 If A
m
= A
n
, then A
m
A
n
= . (distinct A
n
are pairwise disjoint
a
)
We describe the collection A as a partition of X.
a
Recall that two sets A, B are disjoint if A B = : see Definition 3.7. In this definition we don’t require the sets A
n
all
to be different, some could be identical to each other.
The conditions can be viewed as saying that every element of X lies in (1.) at least one subset A
n
and
(2.) at most one subset A
n
: otherwise said, every element of X lies in exactly one subset.
Example. Partition the set X = {1, 2, 3, 4, 5} into subsets
A
1
= {1, 3}, A
2
= {2, 4}, A
3
= {5}.
Now consider the relation R on X, defined by
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
x Ry x and y are in the same subset A
n
.
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 A
1
, A
2
and A
3
. For
instance, 1 is related to itself and 3, but isn’t related to anything else. Indeed
[1] = [3] = {1, 3} = A
1
, [2] = [4] = {2, 4} = A
2
, [5] = {5} = A
5
.
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.
204
Examples. 7.4.1 The integers can be partitioned according to their remainder modulo 3: define
A
r
= {z Z : z r (mod 3)}.
Then Z = A
0
A
1
A
2
. This is certainly a partition:
Every integer z has remainder of 0, 1 or 2 after division by 3, and so every integer is in
some set A
r
.
No integer has two distinct remainders modulo 3, so the sets A
0
, A
1
, A
2
are disjoint.
7.4.2 More generally, if n N, then the set of integers Z is partitioned into n sets A
0
, . . . , A
n1
where
A
r
= {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).
Finally, here is an example of a relation which doesn’t produce a partition.
Example. Let X = {1, 2, 3, 4} and define a relation R on X by
R = {(1, 3), (1, 4), (2, 2), (2, 3), ( 3, 1), (3, 2), (4, 3), (4, 4)}.
Also define the subsets
A
n
= {x X : (n, x) R}.
Thus A
n
is the set of all elements of X which are related to n. We quickly see that
A
1
= {3, 4}, A
2
= {2, 3}, A
3
= {1, 2}, A
4
= {3, 4}.
The collection of sets A
n
is as follows:
{A
n
}
nX
=
A
1
, A
2
, A
3
, A
4
=
n
{3, 4}, {2, 3}, {1, 2}
o
,
where we only have three sets in the collection since A
4
= A
1
. This collection is not a partition
because, for instance, 2 {2, 3} {1, 2}. In the language of Definition 7.11, we have
{2, 3} = {1, 2} but {2, 3} {1, 2} = .
More importantly, you should convince yourself that R is not an equivalence relation.
205
Equivalence Relations and Partitions
Before we present the fundamental result of the chapter, we prove a helpful lemma.
Lemma 7.12. Suppose that is an equivalence relation. Then x y [x] = [y].
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
z x and x y = z y = z [y]. (Transitivity)
Therefore [x] [y]. By symmetry, we also have y x: repeating the argument yields [y] [x],
and thus [x] = [y].
Theorem 7.13. Let X be any set.
7.4.1 If is an equivalence relation on X, then X is partitioned by the equivalence classes of .
7.4.2 If {A
n
: n I} is a partition of X, then the relation on X defined by
x y n I such that x A
n
and y A
n
is an equivalence relation.
XXXXX
a
a
b
b
c
c
partition
A
1
A
2
A
3
A
4
A
5
Each element of X ends up in exactly one subset. In the language of the Theorem, we have
A
1
= [ a], A
2
= [b] = [c], b c, a b, a c.
Some things to consider while reading the proof:
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.
206
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
z x and z y = x z and z y (Symmetry)
= x y (Transitivity)
= [x] = [y] (Lemma 7.12)
We have proved (b) and therefore part 1. of the theorem.
7.4.2 Now suppose that {A
n
: n I} is a partition of X and define by
x y n I such that x A
n
and y A
n
.
We must prove the reflexivity, symmetry and transitivity of .
Reflexivity Every x X is in some A
n
. Thus x x for all x X.
Symmetry If x y, then n I such that x, y A
n
. But then y, x A
n
and so y x.
Transitivity Let x y and y z. Then p, q I such that x, y A
p
and y, z A
q
. Since
{A
n
: n I} is a partition and y A
p
A
q
, we necessarily have A
p
= A
q
. Thus
x, z A
p
and so x z.
We have shown is an equivalence relation, and the proof is complete.
Reading the proof carefully, you should see that reflexivity in part 2. comes from the fact that X =
S
nI
A
n
, while transitivity is due to the pairwise disjointness of the pieces of the partition. Symmetry
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.
207
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 199
and describe things in our new language.
Example. For each real number r 0, define the set
A
r
=
(x, y) R
2
: x
2
+ y
2
= r
2
.
This is simply the circle of radius r centered at the origin. We
check that {A
r
: r R
+
0
} is a partition of R
2
.
Every point of the plane lies on some circle. Precisely,
(x, y) A
x
2
+y
2
since
p
x
2
+ y
2
is the distance of (x, y)
from the origin. Thus R
2
=
S
rR
+
0
A
r
.
If r
1
= r
2
, then the concentric circles A
r
1
and A
r
2
do not
intersect. Thus A
r
1
A
r
2
= .
1
1
y
1 1
x
Now define a relation on R
2
via
(x, y) (v, w) r 0 such that (x, y), (v, w) both lie on the circle A
r
.
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) x
2
+ y
2
= v
2
+ w
2
.
This is exactly the equivalence relation described on page 199. The equivalence classes are precisely
the sets A
r
. Indeed for a given point (v, w),
[(v, w)] = {(x, y) R
2
: x
2
+ y
2
= v
2
+ w
2
} = A
v
2
+w
2
is just the circle of radius
v
2
+ w
2
.
The M¨obius 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).
208
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
¨
obius 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
¨
obius strip you can easily work only in the rectangle.
Rectangle Half twist
Glue arrows to obtain M
¨
obius strip
The Cylinder We could construct a cylinder similarly to the M
¨
obius strip, by identifying edges of
the rectangle but without applying the half-twist. Instead we do something a little different.
Let X = R
2
with equivalence relation defined by
(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 R
2
repeatedly around a cylinder of circumference 1, all of the points in a given equivalence
class will now line up. The set of equivalence classes
R
2
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 R
2
, 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!
209
wrap
around
x
y
0
1
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
on R
2
defines a torus (the surface of a ring-doughnut).
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.
(a) Equivalence relations have nothing to do with partitions in general.
(b) For any set X and equivalence relation on X, the quotient set X/ is a partition of X.
(c) There exists an infinite set X and a partition A of X such that for any equivalence relation
on X, there is A A for which A = [x] for any x X.
(d) Given any partition A of X, there is an equivalence relation whose equivalence classes are
exactly the subsets of X in A.
210
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 R
2
. Justify your an-
swers, and sketch several of the sets A
n
.
(a) A
n
=
(x, y) R
2
: y = 2x + n
, for n Z.
(b) A
n
=
(x, y) R
2
: y = x
2
+ n
, for n R.
(c) A
n
=
(x, y) R
2
: y = cos(x n)
, for n R.
Exercises
7.4.1 For each of the collections {A
n
: n R}, determine whether the collections partition R
2
. Justify
your answers, and sketch several of the sets A
n
.
(a) A
n
=
(x, y) R
2
: y = 2x + n
.
(b) A
n
=
(x, y) R
2
: y = (x n)
2
.
(c) A
n
=
(x, y) R
2
: xy = n
.
(d) A
n
=
(x, y) R
2
: y
4
y
2
= x n
.
7.4.2 Let X be the set of all humans. If x X, we define the set
A
x
= {people who had the same breakfast or lunch as x}.
(a) Does the collection {A
x
: x X} partition X? Explain your answer.
(b) Is your answer different if the or in the definition of A
x
is changed to and?
If Jane and Tom had both had the same breakfast and lunch, then A
Jane
= A
Tom
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.
(a) Which of the properties reflexive, symmetric, transitive are satisfied by R?
(b) Compute the sets A
1
, A
2
, A
3
where A
n
= {x X : x Rn}. Show that {A
1
, A
2
, A
3
} do not
form a partition of X.
(c) Repeat parts (a) and (b) for the relations S and T on X, where
S = {(1, 1), (1, 3), (3, 1), (3, 3)}
T = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 3)}
Some of the sets A
1
, A
2
, A
3
might be the same in each of your examples. If, for example, A
1
= A
3
, then
the collection {A
1
, A
2
, A
3
} only contains two sets: {A
1
, A
2
}. Is this a partition? Compare with the
example on page 205.
211
7.4.4 For each of the following, give an example of an infinite set X and an equivalence relation on
X such that
(a) has finitely many equivalence classes.
(b) has infinitely many classes, each of which have finitely many elements.
(c) has infinitely many classes, each of which have infinitely many elements.
(d) has a class of size n for each n N.
7.4.5 Let A and B be nonempty sets and f : A B be a function.
(a) Show that {f
1
( {b}) : b range( f )} forms a partition of A.
(b) Determine the equivalence relation associated to this partition (in the sense of Theorem
7.13).
7.4.6 Using the equivalence relation description of the M
¨
obius strip, prove that you may cut a M
¨
obius
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:
( 0, y) (1, y) for 0 y 1.
(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?
212
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.
Theorem 7.14. For a fixed n N, define x
n
y x y (mod n). Then
n
is an equivalence
relation on Z.
The theorem is a restatement of Example 2 on page 205, 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.
Theorem 7.15. [a] = [b] a b (mod n) k Z such that b = a + kn.
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
n
=
[0], [1], . . . , [n 1]
.
We use this set to define an extremely important object.
Definition 7.16. Define operations +
n
and ·
n
on the set
Z
n
as follows:
[x] +
n
[y] := [x + y], [x] ·
n
[y] := [x ·y].
The ring Z
n
is the set
Z
n
together with the operations +
n
and ·
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.
213
Example. When we write
[3] +
8
[6] = [3 + 6] = [9] = [1],
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
[3] +
8
[6] = [11] +
8
[22].
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
[11] +
8
[22] = [11 + 22] = [33] = [1],
exactly as we would wish.
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.
7.5.1 Choose elements x X and y Y so that X = [x] and Y = [y].
7.5.2 Add x and y to get a new element x + y Z.
7.5.3 Then X +
n
Y is the equivalence class [x + y].
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.
Theorem 7.18. The operations +
n
and ·
n
are well-defined.
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]
for some integers k, l. It therefore suffices to prove that
k, l Z, [x + kn] +
n
[y + ln] = [x] +
n
[y] and [x + kn] ·
n
[y + ln] = [x] ·
n
[y].
We are now in a position to prove the Theorem.
214
Proof. We prove that +
n
is well-defined.
[x + kn] +
n
[y + ln] = [(x + kn) + (y + ln)] (by definition of +
n
)
= [x + y + (k + l)n]
= [x + y] (by Theorem 7.15)
= [x] +
n
[y] (by definition of +
n
)
The argument for ·
n
is similar.
You should re-read Theorem 4.8 until you are comfortable that we are doing the same thing!
Aside. Aside: Ugly notation
Given the usefulness of Z
n
and the cumbersome nature of the above notation, it is customary to
drop the square brackets and subscripts and simply write
Z
n
= {0, 1, 2, . . . , n 1}, x + y := x + y (mod n), x · y := xy (mod n).
When using this description of Z
n
, you should realize that we are working with equivalence classes,
not numbers. In this context, 3 Z
8
makes perfect sense, for it really means [3] Z
8
. This
is perfectly fine, since [3] = [5] as equivalence classes, whence it is legitimate to write 3 = 5
in Z
8
. 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?
(a) [28] = [5] in Z
6
.
(b) [24] +
[3] + [17]
= [10] in Z
9
.
(c) [2]
3
+ [3]
3
= [4]
3
in Z
29
.
7.5.2 Is the following True or 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 Z
n
.
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 Z
n
, then gcd(a, n) = 1.
215
Exercises
7.5.1 (a) Explicitly check that [7] + [21] = [98] + [5] in Z
13
.
(b) Suppose that [5] · [7] = [8] · [9] makes sense. Find the value of n if we are working in the
ring Z
n
.
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 Z
n
.
I.e., prove that
m N, [x]
Z
n
we have [x
m
] = [x]
m
.
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.]
7.5.4 Give an explicit proof of Theorem 7.14.
7.5.5 Consider the relation defined on Z × N = {(x, y) : x Z, and y N} by
(a, b) (c, d) ad = bc.
(a) Prove that is an equivalence relation.
(b) List several elements of the equivalence class of (2, 3). Repeat for the equivalence class of
( 3, 7). What do the equivalence classes have to do with the set of rational numbers Q?
(c) Define operations and on
Z ×N
by
[(a, b)] [(c, d)] = [(ad + bc, bd)], [(a, b)] [(c, d)] = [(ac, bd)].
Prove that and are well-defined.
Try to do this question without using division! We will return to this example in the next section.
216
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 : Z
4
Z
6
. 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 say
24
f
[x]
4
= [3x]
6
, where [x]
4
Z
4
and [3x]
6
Z
6
.
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
a b (mod 4) = 3a 3b (mod 6).
This is not so hard:
a b (mod 4) = n Z such that a = b + 4n
= 3a = 3b + 12n = 3a 3b (mod 6).
It might appear to be a minor difference, but attempting to define g : Z
4
Z
6
by g(x) = 2x (mod 6)
does not result in a function. If it were, then we should have
a b (mod 4) = 2a 2b (mod 6).
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 Z
4
and g
[4]
= g
[0]
in Z
6
.
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]
4
is helpful for reminding us which equivalence relation is being applied. When dealing with functions
between different quotient sets, it is easy to become confused.
217
Examples. 7.6.1 Show that f : Z
n
Z
n
defined by f ([x]) = [x
2
+ 4] is well-defined.
We must check that x y (mod n) = x
2
+ 4 y
2
+ 4 (mod n). But this is trivial!
7.6.2 For which integers k is the rule f
k
: Z
4
Z
6
defined by f
k
([x]
4
) = [kx]
6
a well-defined
function?
We start with a special case. If k = 1, then we can attempt to construct a table of values for
f
1
([x]
4
):
[x]
4
[0]
4
[1]
4
[2]
4
[3]
4
[4]
4
[5]
4
[6]
4
[7]
4
[8]
4
···
f
1
([x]
4
) [0]
6
[1]
6
[2]
6
[3]
6
[4]
6
[5]
6
[0]
6
[1]
6
[2]
6
···
The problem is immediately visible! In Z
4
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 Z
6
! 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
x y (mod 4) = n Z such that x y = 4n
= kx ky = 4kn.
For f
k
to be well-defined, we need to see that k(x y) = 4kn is a multiple of 6 independently of
x and y. Thus f
k
is well-defined if and only if 6 |4kn for all n Z. This is the case if and only if
6|4k. Otherwise said,
f
k
is well-defined 6 |4k 3 |2k 3|k.
Given that we want [kx]
6
Z
6
, 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
: Z
4
Z
6
: 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 ···
f
0
(x) 0 0 0 0 0 0 0 0 0 ···
f
3
(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 ···
f
5
(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 96 and
with Exercise 3.4.??. Are these earlier example still functions when the domains are assumed
to be a ring Z
n
rather than simply a set of integers?
218
Functions on the Cylinder and Torus
Recall our construction on page 209, where we viewed the cylinder as the set
R
2
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
same as defining a function f :
R
2
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)
= y
2
sin( 2πx)
is a suitable choice of function f :
R
2
R.
More generally, to define a function whose domain is the torus
T
2
=
R
2
where (a, b) (c, d) a c Z and b d Z,
requires a function which is periodic in both x and y. The function
f
(x, y)
= sin(2πx) cos(2πy)
is plotted below, with the color on the torus indicating the value of f . It is easier to instead consider
the function
F : R
2
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.
The function f : domain T
2
The arrows in the two pictures correspond
0
1
y
0 1
x
1.0
0.5
0.0
+0.5
+1.0
F(x , y) = sin(2πx) cos(2πy)
1
2
1
2
The function F restricted to [0, 1) ×[0, 1)
219
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 map
a
.
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.
Theorem 7.21. Suppose that is an equivalence relation on X.
7.6.1 If f :
X
A is a function, then F : X A defined by F = f γ satisfies
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 γ.
Proof. 7.6.1
This is trivial: x y = [x] = [y] = γ(x) = γ(y)
= f (γ(x)) = f (γ(y)) = F(x) = F(y).
7.6.2 f :
X
A can only be the function defined by f ([x]) = F(x). We show that this is well-
defined:
[x] = [y] = x y = F(x) = F(y) = f ( [x]) = f ([y]).
The proof, like much of mathematics, is a masterpiece in concision
that seems to be doing nothing at all. The point is that functions
of the form f :
X
A are difficult to work with. The Theorem
says that we never need to explicitly use such functions, and can
instead work with simpler functions of the form F : X A. The
only condition is that we must have x y = F(x) = F(y).
Essentially, F is f in disguise!
X
A
X
F
γ
f
This result will be resurrected when you study Groups, Rings & Fields as part of the famous First
Isomorphism Theorem.
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?
220
(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).
7.6.2 True or False: the rule [x] 7 x : Z
n
Z is not well-defined.
Practice Problems
7.6.1 Let k be a constant integer. If f : Z
5
Z
18
: [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?
7.6.2 In Theorem 7.21 show that F is a surjection if and only if f is a bijection.
Exercises
7.6.1 (a) Prove or disprove: f : Z
3
Z
5
: x 7→ x
3
(mod 5) is well-defined.
(b) Prove or disprove: f : Z
10
Z
20
: x 7→ x
2
(mod 20) is well-defined.
7.6.2 Determine whether the following are well-defined.
(a) Define f : Z
8
Z
16
by f ([a]
8
) = [2a]
16
.
(b) Define g : Z
8
Z
12
by g([a]
8
) = [2a]
12
.
7.6.3 Can we view F(x, y) = (y
2
1) sin
2
( πx) as a function whose domain is the cylinder, as de-
scribed on page 219? Explain your answer.
7.6.4 (a) Compute (x + 4n)
2
.
(b) Suppose that n Z, we have (x + 4n)
2
x
2
(mod m). Find all the integers m for which
this is a true statement.
(c) For what m N
2
is the function f : Z
4
Z
m
: x 7→ x
2
(mod m) well-defined.
7.6.5 A rule f :
X
A is well-defined if [x] = [y] = f
[x]
= f
[y]
.
(a) State what it means for f :
X
A to be injective. What do you observe?
(b) Prove that f : Z
7
Z
35
: x 7→ 15x is a well-defined, injective function.
(c) Repeat part (b) for the function f : Z
100
Z
300
: x 7 9x. Compare your arguments for
well-definition and injectivity.
This forces you to write your argument abstractly, rather than using a table! You may find it useful
that 9 · (11) 1 (mod 100).
7.6.6 Define a partition of the sphere S
2
=
(x, y, z) : x
2
+ y
2
+ z
2
= 1
into subsets of the form
(x, y, z), (x, y, z)
.
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.
221
(a) f :
S
2
R : [(x, y, z)] 7 xyz is not well-defined. Explain why.
(b) Prove that f :
S
2
R
3
: [(x, y, z)] (yz, xz, xy) is a well-defined function.
The image of this function is Steiners famous Roman Surface, another example, like the Klein
Bottle, of a generalization of the M¨obius Strip.
7.6.7 Recall Exercise 7.5.5, where we defined an equivalence relation on Z ×N.
(a) Prove that the function f :
Z ×N
Q defined by f
(x, y)
=
x
y
is a well-defined
bijection.
(b) Prove that f transforms the operations and into the usual addition and multiplication
of rational numbers. That is:
f
(a, b)
( c, d)
= f
(a, b)
+ f
( c, d)
f
(a, b)
( c, d)
= f
(a, b)
· f
( c, d)
The technical term for this is that f :
Z ×N
, ,
(Q, +, ·) is an isomorphism of rings.
7.6.8 Let C = {circles centered at the origin} {(0, 0)}.
(a) Find an equivalence relation on R
2
such that R
2
/ = C.
(b) Let f : C R by f (C) = radius of C. Theorem 7.21 says there is a function F : R
2
R
such that F = f γ where γ is the canonical map. Determine an explicit formula for F.
7.6.9 Define on R by x y if and only if x y Z.
(a) Show is an equivalence relation on R.
(b) Find a function F : R [0, 1) such that x y implies F(x) = F(y).
(c) Use part (b) to find a well-defined function f : R/ ∼→ [0, 1). Is f a bijection?
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.
(a) Define on A by a b if and only if f (a) = f (b). Show is an equivalence relation on
A.
(b) Let γ : A A/ be the canonical projection. Show there is a well-defined function
g : A/ ∼→ range( f ) such that f
= g γ where f
: A range( f ) is the function
f
(a) = f (a).
(c) Show that g is a bijection.
(d) Let i : range( f ) B be the inclusion map i(b) = b. Show f = i f
, and conclude that
f = i g γ.
222
8 Cardinalities of Infinite Sets
8.1 Cantors 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
A = {fish, dog}, and B = {α, β , γ}.
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
fish 7 α, dog 7− β,
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.
223
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.
We write
|
A
|
<
|
B
|
|
A
|
|
B
|
and
|
A
|
=
|
B
|
. That is f : A B injective but g : 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.
Theorem 8.2. On any collection of sets, the relation A B
|
A
|
=
|
B
|
is an equivalence relation.
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.
Countably Infinite Sets
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 denumerable
a
if
|
A
|
=
0
.
a
Sometimes this 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:
N has the same ‘number of elements’ as 2N.
N has twice the ‘number of elements’ as 2N.
224
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
.
Example. The function g : N N
2
: n 7→ n + 1 is a bijection, whence N
2
= {2, 3, 4, 5, . . .} is
countably infinite.
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.
Theorem 8.4. The integers Z are countably infinite.
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 ···
Two things should be clear from the table:
Surjectivity Every integer appears at least once in the second row.
Injectivity No integer appears more than once in the second row.
It follows that the function f is bijective.
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
225
written
f (n) =
(
1
2
n if n is even,
1
2
( n 1) if n is odd.
Now we check that this is bijective:
(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) =
m
2
=
n
2
= m = n.
(m, n both odd) f (m) = f (n) =
1
2
( m 1) =
1
2
( n 1) = m = n.
(m even, n odd) f (m) = f (n) =
m
2
=
1
2
( 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:
z =
(
f (2z) if z > 0,
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.
Theorem 8.5. The rational numbers Q are countably infinite.
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.
226
Proof. For each pair of natural numbers a, b, place the fraction
a
b
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 (
2
2
=
1
1
,
6
4
=
3
2
, etc.).
1
1
.
.
.
2
1
.
.
.
3
1
.
.
.
4
1
.
.
.
5
1
.
.
.
6
1
.
.
.
7
1
.
.
.
···
1
2
2
2
3
2
4
2
5
2
6
2
7
2
···
1
3
2
3
3
3
4
3
5
3
6
3
7
3
···
1
4
2
4
3
4
4
4
5
4
6
4
7
4
···
1
5
2
5
3
5
4
5
5
5
6
5
7
5
···
1
6
2
6
3
6
4
6
5
6
6
6
7
6
···
.
.
.
The infinite square
1
1
.
.
.
2
1
.
.
.
3
1
.
.
.
4
1
.
.
.
5
1
.
.
.
6
1
.
.
.
7
1
.
.
.
···
1
2
2
2
3
2
4
2
5
2
6
2
7
2
···
1
3
2
3
3
3
4
3
5
3
6
3
7
3
···
1
4
2
4
3
4
4
4
5
4
6
4
7
4
···
1
5
2
5
3
5
4
5
5
5
6
5
7
5
···
1
6
2
6
3
6
4
6
5
6
6
6
7
6
···
.
.
.
××
×
×
×
×
×
×
×
×
×
×
×
×
Trace diagonals and delete repeats
We obtain the ordered set
{a
1
, a
2
, a
3
, a
4
, . . .} =
1
1
,
2
1
,
1
2
,
1
3
,
3
1
,
4
1
,
3
2
,
2
3
,
1
4
,
1
5
, . . .
.
Now define the function f : N Q
+
by f (n) = a
n
. 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 a
m
= a
n
. In the above construction
we deleted any rational number which had already appeared in the list. Thus a
m
can only equal a
n
if
m = n.
(Surjectivity) A positive rational number
a
b
appears in the ath column and bth row of the square
(and in many other places,
a
b
=
2a
2b
= ···). We only delete a fraction
a
b
if it has already appeared in
the list, therefore every positive rational lies in the range of f .
To finish things off, we extend the function to all rational numbers by
g : Z Q : n 7→
f (n) if n > 0,
0 if n = 0,
f (n) if n < 0.
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.
227
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
a
b
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.
The least infinite cardinal?
We originally introduced the symbol
0
to represent the cardinality of the ‘simplest’ infinite set.
While the natural numbers are certainly infinite and straightforward, is there any more compelling
reason why we should consider them to be the most simple infinite set? One reason lies in the follow-
ing result.
Theorem 8.6. A is a finite set if and only if
|
A
|
<
0
.
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 {a
1
, . . . , a
n
}. We must prove two things:
8.1.1
|
A
|
0
. That is, f : A N which is injective.
8.1.2
|
A
|
=
0
. That is, g : A N which is bijective. By symmetry this is equivalent to showing
that there is no bijective function h : N A.
a
For part 1., simply define f by f (a
k
) = k for each k {1, 2, 3, . . . , n}. This is injective since the distinct
elements a
k
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.
228
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.
lim
x3
1
(x3)
2
= means that the function f (x) =
1
(x3)
2
gets unboundedly larger as x ap-
proaches 3. It is incorrect to say that f (x) ‘approaches infinity.’ It is even worse to write
f (3) =
1
(33)
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.
(a) There exists a surjection from N onto A.
(b) There exists an injection from N into A.
(c) There exists a bijection between A and Q.
(d) There exists an injection from A into N and no injection from A into any finite set.
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.
229
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.3 Prove that the set 3Z + 2 = {3n + 2 : n Z} is countably infinite.
8.1.4 Show that the set of all triples of the form (n
2
, 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.7 Find an injection f : Z (0, 1).
8.1.8 Find an explicit bijection f : [0, 1] (0, 1). Make sure to show your map is a bijection.
8.1.9 Prove that A B =
|
A
|
|
B
|
. (You need an injective function f : A B)
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.
(a) If
|
A
|
= 0, then A = . Suppose that f : N is a function. Use Definition 7.4 to prove
that f = .
(b) State what it means, in the language of Definition 7.4, for a function f : A N to be
injective. Show that f = is an injective function.
(c) Suppose that B is a set with
|
B
|
1. Prove by contradiction that there are no functions
h : B . Conclude that 0 <
0
.
8.1.14 Let A be a countably infinite set. Show that for any n N, there is a partition A = {A
1
, . . . , A
n
}
of A such that each subset A
i
in the partition is also countably infinite.
230
8.1.15 Suppose that the set A
n
is countably infinite for each n N. We may then list the elements of
each set: A
n
= {a
n1
, a
n2
, a
n3
, a
n4
, . . .}. Now list the elements of the sets A
1
, A
2
, A
3
, . . . as follows:
A
1
= {a
11
, a
12
, a
13
, a
14
, . . .}
A
2
= {a
21
, a
22
, a
23
, a
24
, . . .}
A
3
= {a
31
, a
32
, a
33
, a
34
, . . .}
.
.
.
Use this construction to prove that
S
nN
A
n
is a countably infinite set.
This result is often stated, ‘A countable union of countable sets is countable.’
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 a
0
, . . . , a
d
Z
such that M = d + |a
0
|+ ··· + |a
d
|.
(b) Let P
M
= {a
d
x
d
+ ··· + a
1
x + a
0
: M = d + |a
0
|+ ··· + |a
d
|}. Explain why P
M
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 P
M
}
is finite.
(d) Prove that A =
S
MN
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:
range( f ) = {n
1
, n
2
, n
3
, . . .}.
(a) Prove that Im f is an infinite set.
(b) Show that for all k N, there exists a unique a
k
A satisfying f (a
k
) = n
k
.
(c) Define g : N A by g( k) = a
k
. Prove that g is a bijection.
(d) Why do we obtain a contradiction?
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
|
.
231
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.
Theorem 8.8. The interval [0, 1] of real numbers is uncountable.
We denote the cardinality of the interval [0, 1] by the symbol c for continuum. The theorem may
therefore be written c >
0
.
Proof. First we require an injective function f : N [0, 1]. The function defined by f (n) =
1
n
clearly
fits the bill, for
f (n) = f (m) =
1
n
=
1
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
g(1) = 0.b
11
b
12
b
13
b
14
b
15
b
16
···
g(2) = 0.b
21
b
22
b
23
b
24
b
25
b
26
···
g(3) = 0.b
31
b
32
b
33
b
34
b
35
b
36
···
g(4) = 0.b
41
b
42
b
43
b
44
b
45
b
46
···
g(5) = 0.b
51
b
52
b
53
b
54
b
55
b
56
···
.
.
.
where each b
ij
{0, . . . , 9}.
Since g is bijective, it is certainly surjective. It follows that all of the values c [0, 1] appear in the
above list of decimals. Now define a new decimal
c = 0.c
1
c
2
c
3
c
4
c
5
··· where c
n
=
(
1 if b
nn
= 1,
2 if b
nn
= 1.
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
.
a
A 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.
232
The second part of the proof is known as Cantors 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 173) also has cardinality c, despite seeming vanishingly small.
More advanced ideas
Our countable and uncountable examples are merely scratching the surface of a truly weird subject.
We conclude these notes with a couple more ideas.
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.
Theorem 8.9 (Cantor–Schr
¨
oder–Bernstein). If
|
A
|
|
B
|
and
|
B
|
|
A
|
, then
|
A
|
=
|
B
|
.
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:
Suppose there exist injective functions f : A B and g : B A.
Then there exists a bijective function h : A B.
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.
Theorem 8.10. The interval (0, 1) has cardinality c.
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
g : [0, 1] (0, 1) : x 7→
1
2
x +
1
4
.
g is certainly injective, and so c
|
(0, 1)
|
.
By the Cantor–Schr
¨
oder–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 [
1
4
,
3
4
] = (0, 1). By a similar trick, covered in the Exercises, one can see that R also has
cardinality c.
233
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.
Theorem 8.11 (Cantor). If A is any set, then
|
A
|
|
P(A)
|
.
Proof. If A = , the result is trivial. Otherwise, we must show two things:
f : A P(A) which is injective.
g : A P(A) which is bijective.
For the first, note that f : a 7→ {a} is a suitable injective function.
Now suppose for a contradiction that g : A P(A) which is bijective. That is, g(a) is a subset of
A for each a A. Consider the set
X = {a A : a g(a)}.
It is important to note that X is a subset of 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
g(1) = {1, 2}, g(2) = {1}.
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
b X b ∈ g(b) (by the definition of X)
b ∈ X (since X = g(b))
Look at what we have concluded: b X b ∈ X. This is clearly a contradiction!
It follows that there exists no bijection g : A P(A), and so
|
A
|
|
P(A)
|
.
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.
234
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.
A word on the limits of proof
Throughout this course we have learned about some of the basic methods and and concepts used
by the mathematician. In particular, we learned about various types of proof and how to use these
proofs to demonstrate the truth of statements about mathematical objects. As we finish the course, it
makes sense to reflect on the limits of our methods.
In the early 20th century, the discovery of various paradoxes and contradictions led to a foun-
dational crises in mathematics. After all, it is difficult to build a house if you have cracks in your
foundation! The result was an effort to put all of mathematics on a rigorous axiomatic basis by for-
mulating a list of reasonable axioms from which all of mathematics could be derived, using basic
logical reasoning. This axiomatic foundation ideally would satisfy the following conditions:
8.2.1 consistency, i.e. no contradiction would be derivable from the axioms;
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
¨
odel published his famous Incompleteness Theorems which showed that no such axiomatic system
could exist. Essentially, G
¨
odel 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
¨
odel’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 .
235
(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.
(a) ( 1, 2] {3}
(b) N × [1, 2]
(c) R \
1
n
: n N
(d) Q [1, 2]
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 (x
1
, x
2
, . . .) such that each x
i
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
¨
oder-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.
8.2.2 (a) Suppose that g : {1, 2, 3, 4} P({1, 2, 3, 4}) is defined by
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.3 Let A be a countably infinite set. For any n N, prove A
n
= A × ···× A
| {z }
n times
is countably infinite.
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.
236
(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 (x
1
, x
2
, . . .) such that each x
i
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.
8.2.7 Let I = R \Q be the set of irrational numbers.
(a) Prove that
|
I
|
c.
(b) Prove that x Q = x +
2 I. Hence conclude that
0
|
I
|
.
(c) Appeal to Exercise 8.1.15 to argue that the irrational numbers are 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.]
8.2.9 (a) Prove that f : N ×N N defined by f (m, n) = 2
m
3
n
is injective.
(b) Use part (a) and the Cantor–Schr
¨
oder–Bernstein Theorem to conclude that
|
N ×N
|
=
0
.
(c) Extend your argument to conclude that, for any k N,
|
N × ···× N
|
|
{z }
ktimes
=
0
(d) Use part (b) to provide an alternative proof that
|
Q
+
|
=
0
.
8.2.10 (a) Show that
|
(0, 1)
|
|
R \N
|
|
R
|
.
(b) Construct a bijection f : (0, 1) (
π
2
,
π
2
). (Try a linear function)
(c) Show that g : (
π
2
,
π
2
) R : x 7 tan x is a bijection.
(d) Use the Cantor–Schr
¨
oder–Bernstein Theorem to conclude that
|
R \N
|
=
|
R
|
= c.
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 {A
n
: n I} such that each A
n
is countably infinite,
and the following three conditions hold:
(i) if m = n, then A
m
= A
n
,
237
(ii) for all m, n, either A
m
A
n
or A
m
A
n
,
(iii)
S
nI
A
n
is countably infinite.
8.2.13 (Hard!) Let x [0, 1]. The binary expansion of x is the sequence b
n
of zeros and ones such that
x =
n=1
b
n
2
n
.
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
f (x) = {n N : b
n
= 1 in the binary expansion of x}.
(a) Prove that f is an injection, and that, consequently, c
|
P(N)
|
.
(b) Prove that the function g : P(N) C (the Cantor set) defined by
g(X) =
nX
2
3
n
is a bijection.
(c) Use Cantor–Schr
¨
oder–Bernstein to conclude that
|
P(N)
|
=
|
C
|
= c.
8.2.14 Let A and B be sets.
(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|}.
8.2.15 Let A and B be sets.
(a) Show max{|A|, |B|} |A B|.
(b) Define |A| + |B| to be |(A × {0}) (B × {1})|. Show that when A and B are finite, this
definition agrees with our usual notion of addition (i.e. if |A| = m and |B| = n, then
|A|+ |B| = m + n).
(c) Show |A B| |A| + |B|.
(d) If at least one of A or B is infinite, show |A| + |B| max{|A|, |B|}. Conclude that |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
involves an infinite sequence of ones: e.g. [0.011111 ···]
2
= [0.1]
2
in binary.
238