A Gentle Introduction To The Art of Mathematics
A Gentle Introduction To The Art of Mathematics
A Gentle Introduction To The Art of Mathematics
Mathematics
Joseph Fields
iii
iv CONTENTS
4 Sets 159
4.1 Basic notions of set theory . . . . . . . . . . . . . . . . . . . . 159
4.2 Containment . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.3 Set operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
4.4 Venn diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 179
4.5 Russell’s Paradox . . . . . . . . . . . . . . . . . . . . . . . . . 188
8 Cardinality 337
8.1 Equivalent sets . . . . . . . . . . . . . . . . . . . . . . . . . . 337
8.2 Examples of set equivalence . . . . . . . . . . . . . . . . . . . 343
8.3 Cantor’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . 355
8.4 Dominance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
8.5 CH and GCH . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
References 402
Index 404
vi CONTENTS
List of Figures
vii
viii LIST OF FIGURES
ix
x LIST OF TABLES
To the student
You are at the right place in your mathematical career to be reading this
book if you liked Trigonometry and Calculus, were able to solve all the prob-
lems, but felt mildly annoyed with the text when it put in these verbose,
incomprehensible things called “proofs.” Those things probably bugged you
because a whole lot of verbiage (not to mention a sprinkling of epsilons and
deltas) was wasted on showing that a thing was true, which was obviously
true! Your physical intuition is sufficient to convince you that a statement
like the Intermediate Value Theorem just has to be true – how can a function
move from one value at a to a different value at b without passing through
all the values in between?
Mathematicians discovered something fundamental hundreds of years be-
fore other scientists – physical intuition is worthless in certain extreme sit-
uations. Probably you’ve heard of some of the odd behavior of particles
in Quantum Mechanics or General Relativity. Physicists have learned, the
hard way, not to trust their intuitions. At least, not until those intuitions
have been retrained to fit reality! Go back to your Calculus textbook and
look up the Intermediate Value Theorem. You’ll probably be surprised to
find that it doesn’t say anything about all functions, only those that are
continuous. So what, you say, aren’t most functions continuous? Actually,
the number of functions that aren’t continuous represents an infinity so huge
that it outweighs the infinity of the real numbers!
xi
xii TO THE STUDENT
The point of this book is to help you with the transition from doing math
at an elementary level (which is concerned mostly with solving problems)
to doing math at an advanced level (which is much more concerned with
axiomatic systems and proving statements within those systems). There are
several books that already propose to aid with this transition, all have various
strengths and weaknesses. In this text we hope to avoid some of those pitfalls
by keeping certain major themes in mind:
3. Good proofs are everything! No matter how important a fact one dis-
covers, if others don’t become convinced of the truth of the statement
it does not become a part of the edifice of human knowledge. It’s been
said that a proof is simply an argument that convinces. In mathe-
matics, one “convinces” by using one of a handful of argument forms
and developing one’s argument in a clear, step-by-step fashion. Within
those constraints there is actually quite a lot of room for individual
style – there is no one right way to write a proof.
At many universities and colleges in the United States a course which pro-
vides a transition from lower-level mathematics courses to those in the major
has been adopted. Some may find it hard to believe that a course like Calcu-
lus II is considered “lower-level” so let’s drop the pejoratives and say what’s
really going on. Courses for Math majors, and especially those one takes
in the Junior and Senior years, focus on proofs — students are expected to
learn why a given statement is true, and be able to come up with their own
convincing arguments concerning such “why”s. Mathematics courses that
precede these typically focus on “how.” How does one find the minimum
value a continuous function takes on an interval? How does one determine
the arclength along some curve. Et cetera. The essential raison d’etre of this
text and others like it is to ease this transition from “how” courses to “why”
courses. In other words, our purpose is to help students develop a certain
facility with mathematical proof.
It should be noted that helping people to become good proof writers –
the primary focus of this text – is, very nearly, an impossible task. Indeed,
it can be argued that the best way to learn to write proofs is by writing a lot
of proofs. Devising many different proofs, and doing so in various settings,
definitely develops the facility we hope to engender in a so-called “transitions”
course. Perhaps the pedagogical pendulum will swing back to the previous
tradition of essentially throwing students to the wolves. That is, students
xv
xvi FOR INSTRUCTORS
might be expected to learn the art of proof writing while actually writing
proofs in courses like algebra and analysis1 . Judging from the feedback I
receive from students who have completed our transitions course at Southern
Connecticut State University, I think such a return to the methods of the
past is unlikely. The benefits of these transitions courses are enormous, and
even though the curriculum for undergraduate Mathematics majors is an
extremely full one, the place of a transition course is, I think, assured.
What precisely are the benefits of these transitions courses? One of my
pet theories is that the process one goes through in learning to write and
understand proofs represents a fundamental reorganization of the brain. The
only evidence for this stance, albeit rather indirect, are the almost universal
reports of “weird dreams” from students in these courses. Our minds evolved
in a setting where inductive reasoning is not only acceptable, but advisable in
coping with the world. Imagine some Cro Magnon child touching a burning
branch and being burned by it. S/He quite reasonably draws the conclusion
that s/he should not touch any burning branches, or indeed anything that is
on fire. A Mathematician has to train him or herself to think strictly by the
rules of deductive reasoning – the above experience would only provide the
lesson that at that particular instant of time, that particular burning branch
caused a sensation of pain. Ideally, no further conclusions would be drawn
– obviously this is an untenable method of reasoning for an animal driven
by the desire to survive to adulthood, but it is the only way to think in the
artificial world of Mathematics.
While a gentle introduction to the art of reading and writing proofs is the
primary focus of this text, there are other subsidiary goals for a transitions
course that we hope to address. Principle among these is the need for an
introduction to the “culture” of Mathematics. There is a shared mythos
1
At the University of Maryland, Baltimore County, where I did my undergraduate
work, these courses were actually known as the “proofs” courses.
xvii
bit of intuition regarding the subject material. Another reason for providing
a crude introduction to a topic before giving rigorous detail revolves around
the way human memory works. Unlike computer memory, which (excluding
the effects of the occasional cosmic ray) is essentially perfect, animal memory
is usually imperfect and mechanisms have evolved to ensure that data that
are important to the individual are not lost. Repetition and rote learning
are often derided these days, but the importance of multiple exposures to a
concept in “anchoring” it in the mind should not be underestimated.
A theme that has recurred over and over in my own thinking about the
transitions course is that the “transition” is that from inductive to deductive
mental processes. Yet, often, we the instructors of these courses are ourselves
so thoroughly ingrained with the deductive approach that the mode of in-
struction presupposes the very transition we hope to facilitate! In this book I
have, to a certain extent, taken the approach of teaching deductive methods
using inductive ones. The first few times a concept is encountered should
only be viewed as providing evidence that lends credence to some mathe-
matical truth. Most concepts that are introduced in this intuitive fashion
are eventually exposited in a rigorous manner – there are exceptions though,
ideas whose scope is beyond that of the present work which are nonetheless
presented here with very little concern for precision. It should not be forgot-
ten that a good transition ought to blend seamlessly into whatever follows.
The courses that follow this material should be proof-intensive courses in ge-
ometry, analysis and algebra. The introduction of some material from these
courses without the usual rigor is intentional. Despite the intentionality, I
should note that this is, quite frankly, an experiment. Nevertheless, it is an
experiment that I am convinced will be beneficial.
Chapter 1
Wisdom is the quality that keeps you from getting into situations where you
need it. –Doug Larson
1
2 CHAPTER 1. INTRODUCTION AND NOTATION
N = {1, 2, 3, 4, . . .}
Perhaps the best way of saying what a set is, is to do as we have above.
List all the elements. Of course, if a set has an infinite number of things in
it, this is a difficult task – so we satisfy ourselves by listing enough of the
elements that the pattern becomes clear.
Taking N for granted, what is meant by the “all else” that humankind
is responsible for? The basic sets of different types of “numbers” that every
mathematics student should know are: N, Z, Q, R and C. Respectively: the
naturals, the integers, the rationals, the reals, and the complex numbers.
The use of N, R and C is probably clear to an English speaker. The integers
are denoted with a Z because of the German word zahlen which means “to
count.” The rational numbers are probably denoted using Q, for “quotients.”
Etymology aside, is it possible for us to provide precise descriptions of the
remaining sets?
The integers (Z) are just the set of natural numbers together with the
negatives of naturals and zero. We can use a doubly infinite list to denote
this set.
Z = {. . . − 3, −2, −1, 0, 1, 2, 3, . . .}
To describe the rational numbers precisely we’ll have to wait until Sec-
tion 1.6. In the interim, we can use an intuitively appealing, but somewhat
imprecise definition for the set of rationals. A rational number is a fraction
built out of integers. This also provides us with a chance to give an example
of using the main other way of describing the contents of a set – so-called
set-builder notation.
a
Q={ a ∈ Z and b ∈ Z and b 6= 0}
b
1.1. BASIC SETS 3
Q = {
a
b
fractions of the form a over b such that
2
Some Mathematicians contend that only the “equality test” meaning of the equals
sign is real, that by writing the mathematical sentence above we are asserting the truth
of the equality test. This may be technically correct but it isn’t how most people think of
things.
4 CHAPTER 1. INTRODUCTION AND NOTATION
and b 6= 0 }
pure Mathematician, believed that every real quantity was in fact rational, a
√
belief that we now know to be false. The numbers π and 2 mentioned above
are not rational numbers. For the moment it is useful to recall a practical
method for distinguishing between rational numbers and real quantities that
are not rational – consider their decimal expansions. If the reader is unfamil-
iar with the result to which we are alluding, we urge you to experiment. Use
a calculator or (even better) a computer algebra package to find the decimal
√
expansions of various quantities. Try π, 2, 1/7, 2/5, 16/17, 1/2 and a few
other quantities of your own choice. Given that we have already said that
the first two of these are not rational, try to determine the pattern. What is
it about the decimal expansions that distinguishes rational quantities from
reals that aren’t rational?
Given that we can’t give a precise definition of a real number at this point
it is perhaps surprising that we can define the set C of complex numbers with
precision (modulo the fact that we define them in terms of R).
C = {
a + bi
and i2 = −1 }
(3 − 2i) · (4 + 3i)
= (3 · 4) + (3 · 3i) + (−2i · 4) + (−2i · 3i)
= 12 + 9i − 8i − 6i2
= 12 + i + 6
= 18 + i
The real numbers have a natural ordering, and hence, so do the other
sets that are contained in R. The complex numbers can’t really be put into
a well-defined order — which should be bigger, 1 or i? But we do have a
way to, at least partially, accomplish this task. The modulus of a complex
number is a real number that gives the distance from the origin (0 + 0i) of
the complex plane, to a given complex number. We indicate the modulus
using absolute value bars, and you should note that if a complex number
happens to be purely real, the modulus and the usual notion of absolute
value coincide. If z = a + bi is a complex number, then its modulus, ka + bik,
√
is given by the formula a2 + b2 .
Several of the sets of numbers we’ve been discussing can be split up based
on the so-called trichotomy property: every real number is either positive,
negative or zero. In particular, Z, Q and R can have modifiers stuck on so
that we can discuss (for example) the negative real numbers, or the positive
rational numbers or the integers that aren’t negative. To do this, we put
superscripts on the set symbols, either a + or a − or the word “noneg.”
So
Z+ = {x ∈ Z x > 0}
and
Z− = {x ∈ Z x < 0}
8 CHAPTER 1. INTRODUCTION AND NOTATION
and
Znoneg = {x ∈ Z x ≥ 0}.
Exercises — 1.1
1. Each of the quantities indexing the rows of the following table is in one
or more of the sets which index the columns. Place a check mark in a
table entry if the quantity is in the set.
N Z Q R C
17
π
22/7
−6
e0
1+i
√
3
i2
5. Consider the process of long division. Does this algorithm give any in-
sight as to why rational numbers have terminating or repeating decimal
expansions? Explain.
(b) (1 + i) + (1 − i)
(c) (1 + i) · (1 − i)
You may have noticed that in Section 1.1 an awful lot of emphasis was placed
on whether we had good, precise definitions for things. Indeed, more than
once apologies were made for giving imprecise or intuitive definitions. This
is because, in Mathematics, definitions are our lifeblood. More than in any
other human endeavor, Mathematicians strive for precision. This precision
comes with a cost – Mathematics can deal with only the very simplest of
phenomena4 . To laypeople who think of math as being a horribly difficult
subject, that last sentence will certainly sound odd, but most professional
Mathematicians will be nodding their heads at this point. Hard questions
are more properly dealt with by Philosophers than by Mathematicians. Does
a cat have a soul? Impossible to say, because neither of the nouns in that
question can be defined with any precision. Is the squareroot of 2 a rational
number? Absolutely not! The reason for the certainty we feel in answering
this second question is that we know precisely what is meant by the phrases
“squareroot of 2” and “rational number.”
We often need to first approach a topic by thinking visually or intuitively,
but when it comes to proving our assertions, nothing beats the power of hav-
ing the “right” definitions around. It may be surprising to learn that the
“right” definition often evolves over the years. This happens for the simple
reason that some definitions lend themselves more easily to proving asser-
tions. In fact, it is often the case that definitions are inspired by attempts to
prove something that fail. In the midst of such a failure, it isn’t uncommon
for a Mathematician to bemoan “If only the definition of (fill in the blank)
were . . . ”, then to realize that it is possible to use that definition or a modi-
fication of it. But! When there are several definitions for the same idea they
4
For an intriguing discussion of this point, read Gian Carlo Rota’s book Indiscrete
Thoughts [14].
12 CHAPTER 1. INTRODUCTION AND NOTATION
You probably first heard this definition in Middle School, if not earlier.
It is a perfectly valid definition of what it means for an integer to be prime.
In more advanced mathematics, it was found that it was necessary to define
a notion of primality for objects other than integers. It turns out that the
following statement is equivalent to the definition of “prime” we’ve just given
(when dealing with integers), but that it can be applied in more general
settings.
Sun and Moon that were remarkably accurate, but probably his most re-
membered achievement is the “sieve” method for finding primes. Indeed, the
sieve of Eratosthenes is still of importance in mathematical research. Basi-
cally, the sieve method consists of creating a very long list of natural numbers
and then crossing off all the numbers that aren’t primes (a positive integer
that isn’t 1, and isn’t a prime is called composite). This process is carried
out in stages. First we circle 2 and then cross off every number that has 2 as
a factor – thus we’ve identified 2 as the first prime number and eliminated
a whole bunch of numbers that aren’t prime. The first number that hasn’t
been eliminated at this stage is 3, we circle it (indicating that 3 is the sec-
ond prime number) and then cross off every number that has 3 as a factor.
Note that some numbers (for example, 6 and 12) will have been crossed off
more than once! In the third stage of the sieve process, we circle 5, which
is the smallest number that hasn’t yet been crossed off, and then cross off
all multiples of 5. The first three stages in the sieve method are shown in
Figure 1.1.
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
Figure 1.1: The first three stages in the sieve of Eratosthenes. What is the
smallest composite number that hasn’t been crossed off?
14 CHAPTER 1. INTRODUCTION AND NOTATION
It is interesting to note that the sieve gives us a means of finding all the
primes up to p2 by using the primes up to (but not including) p. For example,
to find all the primes less than 132 = 169, we need only use 2, 3, 5, 7 and 11
in the sieve.
Despite the fact that one can find primes using this simple mechanical
method, the way that prime numbers are distributed amongst the integers
is very erratic. Nearly any statement that purports to show some regularity
in the distribution of the primes will turn out to be false. Here are two such
false conjectures regarding prime numbers.
In the exercises for this section, you will be asked to explore these state-
ments further.
Prime numbers act as multiplicative building blocks for the rest of the
integers. When we disassemble an integer into its building blocks we are
finding the prime factorization of that number. Prime factorizations are
unique. That is, a number is either prime or it has prime factors (possibly
raised to various powers) that are uniquely determined – except that they
may be re-ordered.
On the next page is a table that contains all the primes that are less than
5000. Study this table and discover the secret of its compactness!
1.2. DEFINITIONS: PRIME NUMBERS 15
T 0 1 2 3 4 5 6 7 8 9
H
0 2 3 5 7 1 3 7 9 3 9 1 7 1 3 7 3 9 1 7 1 3 9 3 9 7
1 1 3 7 9 3 7 1 7 9 9 1 7 3 7 3 9 1 1 3 7 9
2 1 3 7 9 3 9 1 1 7 3 9 1 7 1 3 3
3 7 1 3 7 1 7 7 9 3 9 7 3 9 3 9 7
4 1 9 9 1 1 3 9 3 9 7 1 3 7 9 7 1 9
5 3 9 1 3 1 7 7 3 9 1 7 7 3 9
6 1 7 3 7 9 1 1 3 7 3 9 1 3 7 3 1
7 1 9 9 7 3 9 3 1 7 1 9 3 7 7
8 9 1 1 3 7 9 9 3 7 9 3 7 1 3 7
9 7 1 9 9 7 1 7 3 7 1 7 3 1 7
10 9 3 9 1 1 3 9 9 1 1 3 9 7 1 3 7
11 3 9 7 3 9 1 3 3 1 1 7 3
12 1 3 7 3 9 1 7 9 9 7 9 3 9 1 7
13 1 3 7 9 1 7 1 7 3 1 9
14 9 3 7 9 3 9 7 1 3 9 1 1 3 7 9 3 9
15 1 3 1 3 9 3 9 7 1 9 3 7
16 1 7 9 3 9 1 7 7 7 3 7 9 3 7 9
17 9 1 3 3 1 7 3 9 7 3 7 9
18 1 1 3 1 7 1 7 1 3 7 9 9
19 1 7 3 1 3 9 1 3 9 7 3 7 9
20 3 1 7 7 9 9 3 3 9 1 3 7 9 9
21 1 3 9 1 7 1 3 3 1 9
22 3 7 3 1 7 9 3 1 7 9 3 1 7 3 7
23 9 1 3 9 1 7 1 7 1 7 1 3 9 3 9
24 1 7 3 7 1 7 9 7 3 7
25 3 1 1 9 3 9 1 7 9 1 3
26 9 7 1 3 7 7 9 3 1 7 3 7 9 3 9
27 7 1 3 9 9 1 1 9 3 7 7 9 1 7
28 1 3 9 3 7 3 1 7 1 9 7 7
29 3 9 7 7 9 3 7 3 9 1 9
30 1 1 9 3 7 1 9 1 7 9 3 9
31 9 9 1 7 3 7 9 1 7 1
32 3 9 7 1 9 1 3 7 9 1 9
33 1 7 3 9 3 9 1 3 7 9 1 1 3 9 1
34 7 3 3 9 7 1 3 7 9 1 9
35 1 7 7 9 3 9 1 7 7 9 1 1 3 3
36 7 3 7 3 1 7 3 9 1 3 7 1 7
37 1 9 9 7 3 9 1 7 9 9 3 7
38 3 1 3 3 7 1 3 3 7 1 9
39 7 1 7 9 3 9 1 3 7 7 9
40 1 3 7 3 9 1 7 9 1 7 3 9 1 3 9
41 1 7 9 3 9 3 7 9 7
42 1 1 7 9 9 1 1 3 3 9 1 1 3 3 9 7
43 7 7 9 9 7 3 3 1 7
44 9 1 3 1 7 1 7 3 1 3 3
45 7 3 7 9 3 7 9 1 7 3 1 7
46 3 1 7 9 3 9 1 7 3 3 9 1
47 3 1 3 9 3 1 9 3 7 9 3 9
48 1 3 7 1 1 1 7 9
49 3 9 9 1 3 7 3 1 7 7 9 3 7 3 9
16 CHAPTER 1. INTRODUCTION AND NOTATION
1.2. DEFINITIONS: PRIME NUMBERS 17
Exercises — 1.2
(a) 105
(b) 414
(c) 168
(d) 1612
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
3. What would be the largest prime one would sieve with in order to find
all primes up to 400?
p 2p − 1 prime? factors
2 3 yes 1 and 3
3 7 yes 1 and 7
5 31 yes
7 127
11
5. Characterize the prime factorizations of numbers that are perfect squares.
It is often the case that we want to prove statements that assert something
is true for every element of a set. For example, “Every number has an addi-
tive inverse.” You should note that the truth of that statement is relative,
it depends on what is meant by “number.” If we are talking about natural
numbers it is clearly false: 3’s additive inverse isn’t in the set under con-
sideration. If we are talking about integers or any of the other sets we’ve
considered, the statement is true. A statement that begins with the English
words “every” or “all” is called universally quantified. It is asserted that the
statement holds for everything within some universe. It is probably clear
that when we are making statements asserting that a thing has an additive
inverse, we are not discussing human beings or animals or articles of clothing
– we are talking about objects that it is reasonable to add together: numbers
of one sort or another. When being careful – and we should always strive to
be careful! – it is important to make explicit what universe (known as the
universe of discourse) the objects we are discussing come from. Furthermore,
we need to distinguish between statements that assert that everything in the
universe of discourse has some property, and statements that say something
about a few (or even just one) of the elements of our universe. Statements
of the latter sort are called existentially quantified.
∀x ∈ Z, ∃y ∈ Z, x + y = 0.
∀x ∈Z ∃y
∈Z x+y =0
A couple of the examples in the exercise above actually have two quanti-
fiers in them. When there are two or more (different) quantifiers in a sentence
you have to be careful about keeping their order straight. The following two
sentences contain all the same elements except that the words that indicate
quantification have been switched. Do they have the same meaning?
Exercises — 1.3
1. How many quantifiers (and what sorts) are in the following sentence?
“Everybody has some friend that thinks they know everything about
some sport.”
3. The sentence “For every pair of (distinct) real numbers there is another
real number between them.” is true. Why?
If you divide a number by 2 and it comes out even (i.e. with no remainder)
the number is said to be even. So the word even is related to division. It
turns out that the concept even is better understood through thinking about
multiplication.
You should note that there is a “two-way street” sort of quality to this
definition – indeed with most, if not all, definitions. If a number is even, then
we are guaranteed the existence of another integer half as big. On the other
hand, if we can show that another integer half as big exists, then we know
the original number is even. This two-wayness means that the definition is
what is known as a biconditional, a concept which we’ll revisit in Section 2.2.
A lot of people don’t believe that 0 should be counted as an even number.
Now that we are armed with a precise definition, we can answer this question
easily. Is there an integer x such that 0 = 2x ? Certainly! let x also be 0.
(Notice that in the definition, nothing was said about m and n being distinct
from one another.)
An integer is odd if it isn’t even. That is, amongst integers, there are only
two possibilities: even or odd. We can also define oddness without reference
to “even.”
Theorem 1.4.1. An integer is even if the units digit in its decimal repre-
sentation is one of 0, 2, 4, 6 or 8.
Theorem 1.4.2. An integer is even if the units digit in its binary represen-
tation is 0.
1.4.3 Divisibility
• d is a divisor of n.
• d divides n evenly.
• d is a factor of n.
• n is an integer multiple of d.
26 CHAPTER 1. INTRODUCTION AND NOTATION
Basically, the definition of floor says that y is an integer that is less than
or equal to x, but y + 1 definitely exceeds x. The definition of ceiling can be
paraphrased similarly.
1.4. DEFINITIONS OF ELEMENTARY NUMBER THEORY 27
Theorem 1.4.3. Given integers n and d, there are unique integers q and r
such that n = qd + r and 0 ≤ r < d.
The words “div” and “mod” that appear in the title of this subsection
provide mathematical shorthand for q and r. Namely, “n mod d” is a way of
expressing the remainder r, and “n div d” is a way of expressing the quotient
q.
If two numbers, m and n, leave the same remainder when you divide them
by d, we say that they are congruent modulo d. One could express this by
writing n mod d = m mod d, but usually we adopt a shorthand notation
and
These rules mean that we can either do the operations first, then reduce
the answer mod d or we can do the reduction mod d first and then do the
operations (although we may have to do one more round of reduction mod
d).
For example, if we are working mod 10, and want to compute 87·96 mod
10, we can instead just compute 7 · 6 mod 10, which is 2.
(a + b)0 = 1
(a + b)1 = a + b
(a + b)2 = a2 + 2ab + b2
To go much further than the second power requires a bit of work, but try
the following
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Figure 1.2: The first 5 rows of Pascal’s triangle (which are numbered 0
through 4 . . . ).
5
This triangle was actually known well before Blaise Pascal began to study it, but it
carries his name today.
30 CHAPTER 1. INTRODUCTION AND NOTATION
Notice that in the triangle there is a border on both sides containing 1’s
and that the numbers on the inside of the triangle are the sum of the two
numbers above them. You can use these facts to extend the triangle.
Exercise. Add the next two rows to the Pascal triangle in Figure 1.2.
52 52! 1 · 2 · 3 · · · · 52
= =
5 5! · (52 − 5)! (1 · 2 · 3 · 4 · 5) · (1 · 2 · 3 · · · · 47)
48 · 49 · 50 · 51 · 52
= = 2598960.
1·2·3·4·5
The reason that a gambler might be interested in the number we just cal-
culated is that binomial coefficients do more than just give us the coefficients
in the expansion of a binomial. They also can be used to compute how many
ways one can choose a subset of a given size from a set. Thus 52
5
is the
number of ways that one can get a 5 card hand out of a deck of 52 cards.
Exercise. There are seven days in a week. In how many ways can one choose
a set of three days (per week)?
32 CHAPTER 1. INTRODUCTION AND NOTATION
Exercises — 1.4
7. For conversion between the three bases used most often in Computer
Science we can take binary as the “standard” base and convert using a
table look-up. Each octal digit will correspond to a binary triple, and
each hexadecimal digit will correspond to a 4-tuple of binary numbers.
Complete the following tables. (As a check, the 4-tuple next to A in
the table for hexadecimal should be 1010 – which is nice since A is
really 10 so if you read that as “ten-ten” it is a good aid to memory.)
hexadecimal binary
0 0000
1 0001
2 0010
octal binary 3
0 000 4
1 001 5
2 6
3 7
4 8
5 9
6 A
7 B
C
D
E
F
34 CHAPTER 1. INTRODUCTION AND NOTATION
10. Suppose that 340 pounds of sand must be placed into bags having a
50 pound capacity. Write an expression using either floor or ceiling
notation for the number of bags required.
11. Assuming the symbols n,d,q and r have meanings as in the quotient-
remainder theorem (Theorem 1.4.3). Write expressions for q and r, in
terms of n and d using floor and/or ceiling notation.
(a) 3 mod 5
(b) 37 mod 7
(c) 1000001 mod 100000
(d) 6 div 6
(e) 7 div 6
(f) 1000001 div 2
1.5. SOME ALGORITHMS 35
3
(a) 0
7
(b) 7
13
(c) 5
13
(d) 8
52
(e) 7
14. An ice cream shop sells the following flavors: chocolate, vanilla, straw-
berry, coffee, butter pecan, mint chocolate chip and raspberry. How
many different bowls of ice cream – with three scoops – can they make?
• Assignment statements
• Goto statements
• Return
much the way scrap paper is used in a hand calculation – intermediate calcu-
lations are written on them, but they are tossed aside once the final answer
has been calculated.
Assignment statements allow us to do all kinds of arithmetic operations
(or rather to think of these types of operations as being atomic.) In actuality
even a simple procedure like adding two numbers requires an algorithm of
sorts, we’ll avoid such a fine level of detail. Assignments consist of evaluating
some (possibly quite complicated) formula in the inputs and local variables
and assigning that value to some local variable. The two uses of the phrase
“local variable” in the previous sentence do not need to be distinct, thus
x = x + 1 is a perfectly legal assignment.
If-then control statements are decision makers. They first calculate a
Boolean expression (this is just a fancy way of saying something that is either
true or false), and send program flow to different locations depending on
that result. A small example will serve as an illustration. Suppose that in
the body of an algorithm we wish to check if 2 variables, x and y are equal,
and if they are, increment x by 1. This is illustrated in Figure 1.3 both in
pseudocode and as a flowchart.
Notice the use of indentation in the pseudocode example to indicate the
statements that are executed if the Boolean expression is true. These ex-
amples also highlight the difference between the two senses that the word
“equals” (and the symbol =) has. In the Boolean expression the sense is
that of testing equality, in the assignment statements (as the name implies)
an assignment is being made. In many programming languages this dis-
tinction is made explicit, for instance in the C language equality testing is
done via the symbol “==” whereas assignment is done using a single equals
sign (=). In Mathematics the equals sign usually indicates equality testing,
when the assignment sense is desired the word “let” will generally precede
the equality.
38 CHAPTER 1. INTRODUCTION AND NOTATION
No
Is x equal to y?
If x = y then
x=x+1
Yes
End If
.
.
.
Let x = x + 1.
Algorithm: Division
Inputs: integers n and d.
Local variables: q and r.
Let q = 0.
Let r = n.
Label 1.
If r < d then
Return q and r.
End If
Let q = q + 1.
Let r = r − d.
Goto 1.
Let q = 0 and r = n.
No
Is r > d?
Yes
Let r = r − d. Return:
Let q = q + 1. q&r
Goto
ab
lcm(a, b) = ,
gcd(a, b)
Algorithm: Euclidean
Inputs: integers a and b.
Local variables: q and r.
Label 1.
Let (q, r) = Division(a, b).
If r = 0 then
Return b.
End If
Let a = b.
Let b = r.
Goto 1.
42 CHAPTER 1. INTRODUCTION AND NOTATION
Yes
Is r = 0?
No
Let a = b. Return:
Let b = r. b
Goto
It should be noted that for small numbers one can find the gcd and lcm
quite easily by considering their factorizations into primes. For the moment
consider numbers that factor into primes but not into prime powers (that
is, their factorizations don’t involve exponents). The gcd is the product of
the primes that are in common between these factorizations (if there are no
primes in common it is 1). The lcm is the product of all the distinct primes
that appear in the factorizations. As an example, consider 30 and 42. The
factorizations are 30 = 2 · 3 · 5 and 42 = 2 · 3 · 7. The primes that are
common to both factorizations are 2 and 3, thus gcd(30, 42) = 2 · 3 = 6.
The set of all the primes that appear in either factorization is {2, 3, 5, 7} so
lcm(30, 42) = 2 · 3 · 5 · 7 = 210.
The technique just described is of little value for numbers having more
than about 50 decimal digits because it rests a priori on the ability to find
the prime factorizations of the numbers involved. Factoring numbers is easy
enough if they’re reasonably small, especially if some of their prime factors
are small, but in general the problem is considered so difficult that many
cryptographic schemes are based on it.
44 CHAPTER 1. INTRODUCTION AND NOTATION
Exercises — 1.5
a
Q={ a ∈ Z and b ∈ Z and b 6= 0}
b
We are now in a position to fix the problem.
So what was the problem after all? Essentially this: there are many ex-
pressions formed with one integer written above another (with an intervening
fraction bar) that represent the exact same rational number. For example
3 14
6
and 28
are distinct things that appear in the set defined above, but we
all know that they both represent the rational number 21 . To eliminate this
problem with our definition of the rationals we need to add an additional
condition that ensures that such duplicates don’t arise. It turns out that
what we want is for the numerators and denominators of our fractions to
have no factors in common. Another way to say this is that the a and b
from the definition above should be chosen so that gcd(a, b) = 1. A pair of
numbers whose gcd is 1 are called relatively prime.
We’re ready, at last, to give a good, precise definition of the set of rational
numbers. (Although it should be noted that we’re not quite done fiddling
around; an even better definition will be given in Section 6.3.)
a
Q={ a, b ∈ Z and b 6= 0 and gcd(a, b) = 1}.
b
As we have in the past, let’s parse this with an English translation in
parallel.
Q = {
a
a, b ∈ Z
b
fractions of the form a over b such that a and b are integers
Lemma 1.6.2. If the square of an integer is even, then the original integer
is even.
√
Proof: Suppose to the contrary that 2 is a rational number.
Then by the definition of the set of rational numbers, we know
that there are integers a and b having the following properties:
√ a
2 = and gcd(a, b) = 1.
b
√ a
Consider the expression 2 = . By squaring both sides of this
b
we obtain
a2
2= .
b2
a2 = 2b2
48 CHAPTER 1. INTRODUCTION AND NOTATION
(2m)2 = 2b2 ,
thus,
4m2 = 2b2 ,
so
2m2 = b2 .
This tells us that b2 is even, and hence (by the lemma), b is even.
Finally, we have arrived at the desired absurdity because if a and
b are both even then gcd(a, b) ≥ 2, but, on the other hand, one
of our initial assumptions is that gcd(a, b) = 1.
Q.E.D.
1.6. RATIONAL AND IRRATIONAL NUMBERS 49
Exercises — 1.6
√ √
4. The proof that 2 is irrational can be generalized to show that p is
irrational for every prime number p. What statement would be equiva-
lent to the lemma about the parity of x and x2 in such a generalization?
√
5. Write a proof that 3 is irrational.
50 CHAPTER 1. INTRODUCTION AND NOTATION
1.7 Relations
One of the principle ways in which mathematical writing differs from ordinary
writing is in its incredible brevity. For instance, a Ph.D. thesis for someone
in the humanities would be very suspicious if its length were less than 300
pages, whereas it would be quite acceptable for a math doctoral student to
submit a thesis amounting to less than 100 pages. Indeed, the usual criteria
for a doctoral thesis (or indeed any scholarly work in mathematics) is that
it be “new, true and interesting.” If one can prove a truly interesting, novel
result in a single page – they’ll probably hand over the sheepskin.
How is this great brevity achieved? By inserting single symbols in place
of a whole paragraph’s worth of words! One class of symbols in particular has
immense power – so-called relational symbols. When you place a relational
symbol between two expressions, you create a sentence that says the relation
holds. The period at the end of the last sentence should probably be pro-
nounced! “The relation holds, period!” In other words when you write down
a mathematical sentence involving a relation, you are asserting the relation
is True (the capital T is intentional). This is why it’s okay to write “2 < 3”
but it’s not okay to write “3 < 2.” The symbol < is a relation symbol and
you are only supposed to put it between two things when they actually bear
this relation to one another.
The situation becomes slightly more complicated when we have variables
in relational expressions, but before we proceed to consider that complication
let’s make a list of the relations we’ve seen to date:
the relation symbol (often by drawing a slash through it, but some of the
symbols above are negations of others).
So what about expressions involving variables and these relation symbols?
For example what does x < y really mean? Okay, I know that you know
what x < y means but, philosophically, a relation symbol involving variables
is doing something that you may have only been vaguely aware of in the past
– it is introducing a supposition. Watch out for relation symbols involving
variables! Whenever you encounter them it means the rules of the game are
being subtly altered – up until the point where you see x < y, x and y are
just two random numbers, but after that point we must suppose that x is
the smaller of the two.
The relations we’ve discussed so far are binary relations, that is, they go
in between two numbers. There are also higher order relations. For example,
a famous ternary relation (a relationship between three things) is the notion
of “betweenness.” If A, B and C are three points which all lie on a single
line, we write A ? B ? C if B falls somewhere on the line segment AC. So the
symbol A ? B ? C is shorthand for the sentence “Point B lies somewhere in
between points A and C on the line determined by them.”
There is a slightly silly tendency these days to define functions as being
a special class of relations. (This is slightly silly not because it’s wrong –
indeed, functions are a special type of relation – but because it’s the least
intuitive approach possible, and it is usually foisted-off on middle or high
school students.) When this approach is taken, we first define a relation to
be any set of ordered pairs and then state a restriction on the ordered pairs
that may be in a relation if it is to be a function. Clearly what these Algebra
textbook authors are talking about are binary relations, a ternary relation
would actually be a set of ordered triples, and higher order relations might
involve ordered 4-tuples or 5-tuples, etc. A couple of small examples should
help to clear up this connection between a relation symbol and some set of
52 CHAPTER 1. INTRODUCTION AND NOTATION
tuples.
Consider the numbers from 1 to 5 and the less-than relation, <. As a set
of ordered pairs, this relation is the set
{(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}.
The pairs that are in the relation are those such that the first is smaller
than the second.
An example involving the ternary relation “betweenness” can be had from
the following diagram.
A
F B
C
E D
{(A, B, C), (A, G, D), (A, F, E), (B, G, E), (C, B, A), (C, G, F ), (C, D, E),
(D, G, A), (E, D, C), (E, G, B), (E, F, A), (F, G, C)}.
Exercises — 1.7
1. Consider the numbers from 1 to 10. Give the set of pairs of these
numbers that corresponds to the divisibility relation.
Consider the set {0, 1, 2, 3, 4, 5, 6} and the function f (x) = x2 (mod 7).
Express this function as a relation by explicitly writing out the set of
ordered pairs it contains. What is the range of this function?
{(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10),
(2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), (2, 10),
(3, 3), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10),
(4, 4), (4, 5), (4, 6), (4, 7), (4, 8), (4, 9), (4, 10),
(5, 5), (5, 6), (5, 7), (5, 8), (5, 9), (5, 10),
(6, 6), (6, 7), (6, 8), (6, 9), (6, 10),
(7, 7), (7, 8), (7, 9), (7, 10),
(8, 8), (8, 9), (8, 10),
(9, 9), (9, 10),
(10, 10)}
If at first you don’t succeed, try again. Then quit. There’s no use being a
damn fool about it. –W. C. Fields
57
58 CHAPTER 2. LOGIC AND QUANTIFIERS
The atomic concepts in Set Theory are “set”, “element” and “member-
ship”. The atomic concepts in Logic are “true”, “false”, “sentence” and
“statement”.
Regarding true and false, we hope there is no uncertainty as to their
meanings. Sentence also has a well-understood meaning that most will agree
on – a syntactically correct ordered collection of words such as “Johnny was
a football player.” or “Red is a color.” or “This is a sentence which does
not refer to itself.” A statement is a sentence which is either true or false.
In other words, a statement is a sentence whose truth value is definite, in
more other words, it is always possible to decide – one way or the other –
whether a statement is true or false. The first example of a sentence given
above (“Johnny was a football player”) is not a statement – the problem is
that it is ambiguous unless we know who Johnny is. If it had said “Johnny
Unitas was a football player.” then it would have been a statement. If it
had said “Johnny Appleseed was a football player.” it would also have been
a statement, just not a true one.
Ambiguity is only one reason that a sentence may not be a statement.
As we consider more complex sentences, it may be the case that the truth
value of a given sentence simply cannot be decided. One of the most cel-
ebrated mathematical results of the 20th century is Kurt Gödel’s “Incom-
pleteness Theorem.” An important aspect of this theory is the proof that in
any axiomatic system of mathematical thought there must be undecidable
sentences – statements which can neither be proved nor disproved from the
axioms2 . Simple sentences (e.g. those of the form subject-verb-object) have
little chance of being undecidable for this reason, so we will next look at ways
of building more complex sentences from simple components.
Let’s start with an example. Suppose I come up to you in some window-
2
There are trivial systems that are complete, but if a system is sufficiently complicated
that it contains “interesting” statements it can’t be complete.
2.1. PREDICATES AND LOGICAL CONNECTIVES 59
less room and make the statement: “The sun is shining but it’s raining!” You
decide to investigate my claim and determine its veracity. Upon reaching a
room that has a view of the exterior there are four possible combinations
of sunniness and/or precipitation that you may find. That is, the atomic
predicates “The sun is shining” and “It is raining” can each be true or false
independently of one another. In the following table we introduce a con-
vention used throughout the remainder of this book – that true is indicated
with a capital letter T and false is indicated with the Greek letter φ (which
is basically a Greek F, and is a lot harder to mistake for a T than an F is.)
Each row of the above table represents a possible state of the outside
world. Suppose you observe the conditions given in the last row, namely
that it is neither sunny, nor is it raining – you would certainly conclude
that I am not to be trusted. I.e. my statement, the compounding of “The
sun is shining” and “It is raining” (with the word “but” in between as a
connector) is false. If you think about it a bit, you’ll agree that this so-called
compound sentence is true only in the case that both of its component pieces
are true. This underscores an amusing linguistic point: “but” and “and”
have exactly the same meaning! More precisely, they denote the same thing,
they have subtly different connotations however – “but” indicates that both
of the statements it connects are true and that the speaker is surprised by
this state of affairs.
In Mathematics we distinguish two main connectives for hooking-up sim-
ple sentences into compound ones. The conjunction of two sentences is the
60 CHAPTER 2. LOGIC AND QUANTIFIERS
compound sentence made by sticking the word “and” between them. The
disjunction of two sentences is formed by placing an “or” between them.
Conjunctions are true only when both components are true. Disjunctions
are false only when both components are false.
As usual, mathematicians have developed an incredibly terse, compact
notation for these ideas.3 First, we represent an entire sentence by a single
letter – traditionally, a capital letter. This is called a predicate variable. For
example, following the example above, we could denote the sentence “The
sun is shining” by the letter S. Similarly, we could make the assignment
R = “It is raining.” The conjunction and disjunction of these sentences can
then be represented using the symbols S ∧ R and S ∨ R, respectively. As a
mnemonic, note that the connective in S ∧ R looks very much like the capital
letter A (as in And).
To display, very succinctly, the effect of these two connectives we can use
so-called truth tables. In a truth table we list all possible truth values of
the predicate variables and then enumerate the truth values of some com-
pound sentence. For the conjunction and disjunction connectors we have
(respectively):
A B A∧B A B A∨B
T T T T T T
T φ φ and T φ T .
φ T φ φ T T
φ φ φ φ φ φ
of a sentence is also known as the denial of a sentence. A truth table for the
negation operator is somewhat trivial but we include it here for completeness.
A ¬A
T φ
φ T
These three simple tools (and, or & not) are sufficient to create extraor-
dinarily complex sentences out of basic components. The way these pieces
interrelate is a bit reminiscent of algebra, in fact the study of these logical
operators (or any operators that act like them) is called Boolean Algebra4 .
There are distinct differences between Boolean and ordinary algebra however.
In regular algebra we have the binary connectors + (plus) and · (times), and
the unary negation operator −, these are certainly analogous to ∧, ∨ & ¬,
but there are certain consequences of the fact that multiplication is effec-
tively repeated addition that simply don’t hold for the Boolean operators.
For example, there is a well-defined precedence between · and +. In parsing
the expression 4 · 5 + 3 we all know that the multiplication is to be done first.
There is no such rule governing order of operations between ∧ and ∨, so an
expression like A ∧ B ∨ C is simply ambiguous – it must have parentheses
inserted in order to show the order, either (A∧B)∨C or A∧(B ∨C). Another
distinction between ordinary and Boolean algebra is exponentiation. If there
were exponents in Boolean algebra, we’d need two different kinds – one for
repeated conjunction and another for repeated disjunction.
While there are many differences between Boolean algebra and the usual,
garden-variety algebra, there are also many similarities. For instance, the
4
In honor of George Boole, whose 1854 book An investigation into the Laws of Thought
inaugurated the subject.
62 CHAPTER 2. LOGIC AND QUANTIFIERS
x y
Suppose that two transistor are connected as in Figure 2.2 (this is called
a series connection). In order for current to flow from x to y we must have
voltage applied to both the wires labeled z and w. In other words, this circuit
effectively creates the and operation – assuming voltage is always applied to
x, if z and w are energized then the output at y will be energized.
When two transistors are connected in parallel (this is illustrated in Fig-
ure 2.3) current can flow from x to y when either (or both) of the wires at
z and w have voltage applied. This brings up a point which is confusing
for some: in common speech the use of the word “or” often has the sense
known as exclusive or (a.k.a. xor), when we say “X or Y” we mean “Either
2.1. PREDICATES AND LOGICAL CONNECTIVES 63
z w
x y
z w
x y
Not (¬)
B
((A ∧ B) ∧ (C ∧ D))
C
C
(((A ∧ B) ∧ C) ∧ D)
D
Figure 2.4: Two of the possible ways to parenthesize the conjunction of four
statement variables – expressed as digital logic circuits.
66 CHAPTER 2. LOGIC AND QUANTIFIERS
x y z out
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
A systematic method for accomplishing such a design task involves a
notion called disjunctive normal form. A Boolean expression is in disjunctive
normal form if it consists of the disjunction of one or more statements, each
of which consists entirely of conjunctions of predicate variables and/or their
negations. In other words, the or of a bunch of ands. In terms of digital logic
circuits, the ands we’re talking about are called recognizers. For example,
the following 3-input and gates recognize the input states in the 4th, 7th and
8th rows of the i/o table above. (These are the rows where the output is
supposed to be 1.)
x x
y y
z z
z
2.1. PREDICATES AND LOGICAL CONNECTIVES 67
out
Figure 2.5: A digital logic circuit built using disjunctive normal form. The
output of this circuit is (¬x ∧ y ∧ z) ∨ (x ∧ y ∧ ¬z) ∨ (x ∧ y ∧ z).
68 CHAPTER 2. LOGIC AND QUANTIFIERS
Exercises — 2.1
1. Design a digital logic circuit (using and, or & not gates) that imple-
ments an exclusive or.
2. Consider the sentence “This is a sentence which does not refer to itself.”
which was given in the beginning of this chapter as an example. Is this
sentence a statement? If so, what is its truth value?
4. Complete truth tables for each of the sentences (A∧B)∨C and A∧(B ∨
C). Does it seem that these sentences have the same logical content?
2.1. PREDICATES AND LOGICAL CONNECTIVES 69
5. There are two other logical connectives that are used somewhat less
commonly than ∨ and ∧. These are the Scheffer stroke and the Peirce
arrow – written | and ↓, respectively — they are also known as NAND
and NOR.
The truth tables for these connectives are:
A B A|B A B A↓B
T T φ T T φ
T φ T and T φ φ
φ T T φ T φ
φ φ T φ φ T
2.2 Implication
Suppose a mother makes the following statement to her child: “If you finish
your peas, you’ll get dessert.”
This is a compound sentence made up of the two simpler sentences P =
“You finish your peas” and D = “You’ll get dessert.” It is an example of
a type of compound sentence called a conditional. Conditionals are if-then
type statements. In ordinary language the word “then” is often elided (as is
the case with our example above). Another way of phrasing the “If P then
D.” relationship is to use the word “implies” — although it would be a rather
uncommon mother who would say “Finishing your peas implies that you will
receive dessert.”
As was the case in the previous section, there are four possible situations
and we must consider each to decide the truth/falsity of this conditional
statement. The peas may or may not be finished, and independently, the
dessert may or may not be proffered.
Suppose the child finishes the peas and the mother comes across with the
dessert. Clearly, in this situation the mother’s statement was true. On the
other hand, if the child finishes the hated peas and yet does not receive a
treat, it is just as obvious that the mother has lied! What do we say about
the mother’s veracity in the case that the peas go unfinished? Here, Mom
gets a break. She can either hold firm and deliver no dessert, or she can
be a softy and give out unearned sweets – in either case, we can’t accuse
her of telling a falsehood. The statement she made had to do only with the
eventualities following total pea consumption, she said nothing about what
happens if the peas go uneaten.
A conditional statement’s components are called the antecedent (this is
the “if” part, as in “finish your peas”) and the consequent (this is the “then”
part, as in “get dessert”). The discussion in the last paragraph was intended
2.2. IMPLICATION 71
to make the point that when the antecedent is false, we should consider the
conditional to be true. Conditionals that are true because their antecedents
are false are said to be vacuously true. The conditional involving an an-
tecedent A and a consequent B is expressed symbolically using an arrow:
A =⇒ B. Here is a truth table for this connective.
A B A =⇒ B
T T T
T φ φ
φ T T
φ φ T
Exercise. Note that this truth table is similar to the truth table for A ∨ B
in that there is only a single row having a φ in the last column. For A ∨
B the φ occurs in the 4th row and for A =⇒ B it occurs in the 2nd
row. This suggests that by suitably modifying things (replacing A or B by
their negations) we could come up with an “or” statement that had the same
meaning as the conditional. Try it!
reflection of what the mother intended. The problem really is that people are
incredibly sloppy with their conditional statements! A lot of people secretly
want the 3rd row of the truth table for =⇒ to have a φ in it, and it
simply doesn’t! The operator that results if we do make this modification is
called the biconditional, and is expressed in English using the phrase “if and
only if” (which leads mathematicians to the abbreviation “iff” much to the
consternation of spell-checking programs everywhere). The biconditional is
denoted using an arrow that points both ways. Its truth table follows.
A B A ⇐⇒ B
T T T
T φ φ
φ T φ
φ φ T
Please note, that while we like to strive for precision, we do not necessarily
recommend the use of phrases such as “You will receive dessert if, and only
if, you finish your peas.” with young children.
Since conditional sentences are often confused with the sentence that
has the roles of antecedent and consequent reversed, this switched-around
sentence has been given a name: it is the converse of the original statement.
Another conditional that is distinct from (but related to) a given conditional
is its inverse. This sort of sentence probably had to be named because of a
very common misconception, many people think that the way to negate an
if-then proposition is to negate its parts. Algebraically, this looks reasonable
– sort of a distributive law for logical negation over implications – ¬(A =⇒
B) = ¬A =⇒ ¬B. Sadly, this reasonable looking assertion can’t possibly
be true; since implications have just one φ in a truth table, the negation of
an implication must have three – but the statement with the ¬’s on the parts
of the implication is going to only have a single φ in its truth table.
2.2. IMPLICATION 73
converses
A =⇒ B B =⇒ A
inverses
¬A =⇒ ¬B ¬B =⇒ ¬A
One final piece of advice about conditionals: don’t confuse logical if-then
relationships with causality. Many of the if-then sentences we run into in
ordinary life describe cause and effect: “If you cut the green wire the bomb
will explode.” (Okay, that one is an example from the ordinary life of a
bomb squad technician, but . . . ) It is usually best to think of the if-then
relationships we find in Logic as divorced from the flow of time, the fact that
A =⇒ B is logically the same as ¬A ∨ B lends credence to this point of
view.
74 CHAPTER 2. LOGIC AND QUANTIFIERS
Exercises — 2.2
4. Determine a sentence using the and connector (∧) that gives the nega-
tion of A =⇒ B.
5. Rewrite the sentence “Fix the toilet or I won’t pay the rent!” as a
conditional.
6. Why is it that the sentence “If pigs can fly, I am the king of Mesopotamia.”
true?
(c) If you wish others to treat you in a certain way, you must treat
others in that fashion.
9. What are the converse and inverse of “If you watch my back, I’ll watch
your back.”?
∞
X Z ∞
f (n) < f (x).
n=1 0
A =⇒ B = ¬B =⇒ ¬A
Well, one pretty serious objection to doing that is that the equals sign
(=) has already got a job; it is used to indicate that two numerical quanti-
ties are the same. What we’re doing here is really sort of a different thing!
Nevertheless, there is a concept of “sameness” between certain compound
statements, and we need a symbolic way of expressing it. There are two no-
tations in common use. The notation that seems to be preferred by logicians
is the biconditional ( ⇐⇒ ). The notation we’ll use in the rest of this book
is an equals sign with a bit of extra decoration on it (∼
=).
Thus we can can either write
(A =⇒ B) ⇐⇒ (¬B =⇒ ¬A)
or
A =⇒ B ∼
= ¬B =⇒ ¬A.
I like the latter, but use whichever form you like – no one will have any
problem understanding either.
The formal definition of logical equivalence, which is what we’ve been
describing, is this: two compound sentences are logically equivalent if in a
truth table (that contains all possible combinations of the truth values of
the predicate variables in its rows) the truth values of the two sentences are
equal in every row.
2.3. LOGICAL EQUIVALENCES 77
A B A∨B A ∨ (¬A ∧ B)
T T
T φ
φ T
φ φ
One could, in principle, verify all logical equivalences by filling out truth
tables. Indeed, in the exercises for this section we will ask you to develop a
certain facility at this task. While this activity can be somewhat fun, and
many of my students want the filling-out of truth tables to be a significant
portion of their midterm exam, you will probably eventually come to find it
somewhat tedious. A slightly more mature approach to logical equivalences
is this: use a set of basic equivalences – which themselves may be verified via
truth tables – as the basic rules or laws of logical equivalence, and develop
a strategy for converting one sentence into another using these rules. This
process will feel very familiar, it is like “doing” algebra, but the rules one is
allowed to use are subtly different.
First we have the commutative laws, one each for conjunction and disjunc-
tion. It’s worth noting that there isn’t a commutative law for implication.
The commutative property of conjunction says that A ∧ B ∼ = B ∧ A. This
is quite an apparent statement from the perspective of linguistics. Surely it’s
the same thing to say “the weather is cold and snowy” as it is to say “the
weather is snowy and cold.” This commutative property is also clear from
the perspective of digital logic circuits.
78 CHAPTER 2. LOGIC AND QUANTIFIERS
A
A∧B
B
A
B∧A
B
A
A∨B
B
A
B∨A
B
The associative laws also have something to do with what order oper-
ations are done. One could think of the difference in the following terms:
Commutative properties involve spatial or physical order and the associative
properties involve temporal order. The associative law of addition could be
used to say we’ll get the same result if we add 2 and 3 first, then add 4, or if
we add 2 to the sum of 3 and 4 (i.e. that (2+3)+4 is the same as 2+(3+4).)
Note that physically, the numbers are in the same order (2 then 3 then 4) in
both expressions but that the parentheses indicate a precedence in when the
plus signs are evaluated.
2.3. LOGICAL EQUIVALENCES 79
B (A ∧ B) ∧ C
B A ∧ (B ∧ C)
B (A ∨ B) ∨ C
B A ∨ (B ∨ C)
C
80 CHAPTER 2. LOGIC AND QUANTIFIERS
The next type of basic logical equivalences we’ll consider are the so-called
distributive laws. Distributive laws involve the interaction of two operations,
when we distribute multiplication over a sum, we effectively replace one in-
stance of an operand and the associated operator, with two instances, as is
illustrated below.
2*(3+4)=(2*3)+(2*4)
The logical operators ∧ and ∨ each distribute over the other. Thus we
have the distributive law of conjunction over disjunction, which is expressed
in the equivalence A ∧ (B ∨ C) ∼ = (A ∧ B) ∨ (A ∧ C) and in the following
digital logic circuit diagram.
2.3. LOGICAL EQUIVALENCES 81
B A ∧ (B ∨ C)
B
(A ∧ B) ∨ (A ∧ C)
B A ∨ (B ∧ C)
B
(A ∨ B) ∧ (A ∨ C)
C
82 CHAPTER 2. LOGIC AND QUANTIFIERS
The next set of laws we’ll consider come from trying to figure out what
the distribution of a minus sign over a sum (−(x + y) = −x + −y) should
correspond to in Boolean algebra. At first blush one might assume the analo-
gous thing in Boolean algebra would be something like ¬(A ∧ B) ∼= ¬A ∧ ¬B,
but we can easily dismiss this by looking at a truth table.
A B ¬(A ∧ B) ¬A ∧ ¬B
T T φ φ
T φ T φ
φ T T φ
φ φ T T
¬(A ∧ B) ∼
= ¬A ∨ ¬B
and
¬(A ∨ B) ∼
= ¬A ∧ ¬B.
x + −x = 0
and
1
x· = 1.
x
Boolean algebra only has one “inverse” concept, the denial of a predicate
(i.e. logical negation), but the equations above have analogues, as do the
symbols 0 and 1 that appear in them. First, consider the Boolean expression
A ∨ ¬A. This is the logical or of a statement and its exact opposite; when
one is true the other is false and vice versa. But, the disjunction A ∨ ¬A, is
always true! We use the symbol t (which stands for tautology) to represent a
compound sentence whose truth value is always true. A tautology (t) is to
Boolean algebra something like a zero (0) is to arithmetic. Similar thinking
about the Boolean expression A ∧ ¬A leads to the definition of the symbol c
(which stands for contradiction) to represent a sentence that is always false.
The rules we have been discussing are known as complementarity laws:
A ∨ ¬A ∼
= t and A ∧ ¬A ∼
= c
there isn’t a dominance rule that involves 1. On the Boolean side, both the
symbols t and c have related domination rules.
A∨t∼
=t and A∧c∼
=c
A∨A∼
=A and A∧A∼
=A
¬(¬A) ∼
=A and ¬t ∼
=c
A ∧ (A ∨ B) ∼
=A and A ∨ (A ∧ B) ∼
=A
Commutative
A∧B ∼
=B∧A A∨B ∼
=B∨A 2+3=3+2
laws
Associative A ∧ (B ∧ C) A ∨ (B ∨ C) 2 + (3 + 4)
∼
= (A ∧ B) ∧ C ∼
= (A ∨ B) ∨ C = (2 + 3) + 4
laws
Distributive A ∧ (B ∨ C) ∼
= A ∨ (B ∧ C) ∼
= 2 · (3 + 4)
laws (A ∧ B) ∨ (A ∧ C) (A ∨ B) ∧ (A ∨ C) = (2 · 3 + 2 · 4)
Complementarity A ∧ ¬A ∼
= c A ∨ ¬A ∼
= t 2 + (−2) = 0
Identity
A∧t∼
=A A∨c∼
=A 7+0=7
laws
Domination A∧c∼
=c A∨t∼
=t 7·0=0
Idempotence A∧A∼
=A A∨A∼
=A 1·1=1
Absorption A ∧ (A ∨ B) ∼
=A A ∨ (A ∧ B) ∼
=A none
Exercises — 2.3
(a) (A ∧ B) ∨ B ∼
= (A ∨ B) ∧ B
(b) A ∧ (B ∨ ¬A) ∼
= A∧B
(c) (A ∧ ¬B) ∨ (¬A ∧ ¬B) ∼
= ((A ∨ ¬B) ∧ (¬A ∨ ¬B)
(d) The absorption laws.
(a) “One should not behave towards others in a way which is disagree-
able to oneself.” Mencius Vii.A.4 (Hinduism)
(b) “None of you [truly] believes until he wishes for his brother what
he wishes for himself.” Number 13 of Imam “Al-Nawawi’s Forty
Hadiths.” (Islam)
(c) “And as ye would that men should do to you, do ye also to them
likewise.” Luke 6:31, King James Version. (Christianity)
(d) “What is hateful to you, do not to your fellow man. This is the law:
all the rest is commentary.” Talmud, Shabbat 31a. (Judaism)
(e) “An it harm no one, do what thou wilt” (Wicca)
(f) “What you would avoid suffering yourself, seek not to impose on
others.” (the Greek philosopher Epictetus – first century A.D.)
(g) “Do not do unto others as you expect they should do unto you.
Their tastes may not be the same.” (the Irish playwright George
Bernard Shaw – 20th century A.D.)
88 CHAPTER 2. LOGIC AND QUANTIFIERS
If you’ve ever spent much time trying to check someone else’s work in solving
an algebraic expression, you’d probably agree that it would be a help to know
what they were trying to do in each step. Most people have this fairly vague
notion that they’re allowed to “do the same thing on both sides” and they’re
allowed to simplify the sides of the equation separately – but more often than
not, several different things get done on a given line, mistakes get made, and
it can be nearly impossible to figure out what went wrong and where.
Now, after all, the beauty of math is supposed to lie in its crystal clarity,
so this sort of situation is really unacceptable. It may be an impossible goal
to get “the average Joe” to perform algebraic manipulations with clarity,
but those of us who aspire to become mathematicians must certainly hold
ourselves to a higher standard. Two-column proofs are usually what is meant
by a “higher standard” when we are talking about relatively mechanical
manipulations – like doing algebra, or more to the point, proving logical
equivalences. Now don’t despair! You will not, in a mathematical career, be
expected to provide two-column proofs very often, in fact, in more advanced
work one tends to not give any sort of proof for a statement that lends itself
to a two-column approach. But, if you find yourself writing “As the reader
can easily verify, Equation 17 holds. . . ” in a paper, or making some similar
remark to your students, you are morally obligated to being able to produce
a two-column proof.
So what, exactly, is a two-column proof? In the left column you show
your work, being careful to go one step at a time. In the right column you
provide a justification for each step.
We’re going to go through a couple of examples of two-column proofs
in the context of proving logical equivalences. One thing to watch out for:
if you’re trying to prove a given equivalence, and the first thing you write
2.4. TWO-COLUMN PROOFS 89
down is that very equivalence, it’s wrong! This would constitute the logical
error known as “begging the question” also known as “circular reasoning.”
It’s clearly not okay to try to demonstrate some fact by first asserting the
very same fact. Nevertheless, there is (for some unknown reason) a powerful
temptation to do this very thing. To avoid making this error, we will not
put any equivalences on a single line. Instead we will start with one side or
the other of the statement to be proved, and modify it using known rules of
equivalence, until we arrive at the other side.
Without further ado, let’s provide a proof of the equivalence A ∧ (B ∨
¬A) ∼
= A ∧ B.5
A ∧ (B ∨ ¬A)
distributive law
∼
= (A ∧ B) ∨ (A ∧ ¬A)
complementarity
∼
= (A ∧ B) ∨ c
identity law
∼
= (A ∧ B)
(A ∧ (B ∨ C)) ∨ (A ∧ C)
distributive law
∼
= ((A∧B)∨(A∧C))∨(A∧C)
associative law
∼
= (A∧B)∨((A∧C)∨(A∧C))
idempotence
∼
= (A ∧ B) ∨ (A ∧ C)
distributive law
∼
= A ∧ (B ∨ C)
Note that in the example we’ve just done, the two applications of the
distributive law go in opposite directions as far as their influence on the
complexity of the expressions are concerned.
2.4. TWO-COLUMN PROOFS 91
Exercises — 2.4
1. Write two-column proofs that verify each of the following logical equiv-
alences.
(a) A ∨ (A ∧ B) ∼
= A ∧ (A ∨ B)
(b) A ∨ B ∼
= A ∨ (¬A ∧ B)
(c) A ∼
= A ∧ ((A ∨ ¬B) ∨ (A ∨ B))
(d) A ∼
= A ∧ (A ∨ (A ∧ (B ∨ C)))
(e) ¬(A ∧ B) ∧ ¬(A ∧ C) ∼
= ¬A ∨ (¬B ∧ ¬C)
92 CHAPTER 2. LOGIC AND QUANTIFIERS
x
i) P (x) = “22 + 1 is a prime.”
iii) L(f, c, l) = “The function f has limit l at c, if and only if, for every
2.5. QUANTIFIED STATEMENTS 93
0
F0 = 22 + 1 = 3
1
F1 = 22 + 1 = 5
6
Fermat’s more famous conjecture, that xn +y n = z n has no non-trivial integer solutions
if n is an integer with n > 2 was discovered after his death.
2.5. QUANTIFIED STATEMENTS 95
2
F2 = 22 + 1 = 17
3
F3 = 22 + 1 = 257
4
F4 = 22 + 1 = 65537
∀x ∈ R+ , x > ln x ∼
^
= x > ln x
x∈R+
_
∃k ∈ Z, abcd = k · dcba.
1000≤abcd≤9999
¬(∀x ∈ U, P (x)) ∼
= ∃x ∈ U, ¬P (x)
8
The Pep Boys – Manny, Moe and Jack – are hopefully known to some readers as the
mascots of a chain of automotive supply stores.
98 CHAPTER 2. LOGIC AND QUANTIFIERS
and
¬(∃x ∈ U, P (x)) ∼
= ∀x ∈ U, ¬P (x).
It’s equally valid to think of these rules in a way that’s divorced from
DeMorgan’s laws. To show that a universal sentence is false, it suffices to
show that an existential sentence involving a negation of the original is true.9
9
To show that it is not the case that every Pep boy’s name starts with ‘M’, one only
needs to demonstrate that there is a Pep boy (Jack) whose name doesn’t start with ‘M’.
2.5. QUANTIFIED STATEMENTS 99
Exercises — 2.5
10
Marie-Sophie Germain (1776 - 1831) was a French mathematician who made major
contributions to number theory, acoustics and elasticity [12].
100 CHAPTER 2. LOGIC AND QUANTIFIERS
The word “argument” has a negative connotation for many people be-
cause it seems to have to do with disagreement. Arguments within math-
ematics (as well as many other scholarly areas), while they may be impas-
sioned, should not involve discord. A mathematical argument is a sequence
of logically connected statements designed to produce agreement as to the
validity of a proposition. This “design” generally follows one of two possibil-
ities, inductive reasoning or deductive reasoning. In an inductive argument a
long list of premises is presented whose truths are considered to be apparent
to all, each of which provides evidence that the desired conclusion is true.
So an inductive argument represents a kind of statistical thing, you have all
these statements that are true each of which indicates that the conclusion is
most likely true. . . A strong inductive argument amounts to what attorneys
call a “preponderance of the evidence.” Occasionally a person who has been
convicted of a crime based on a preponderance of the evidence is later found
2.6. DEDUCTIVE REASONING AND ARGUMENT FORMS 101
probably won’t actually have been written, hypotheses and all the deductions
made up to this point) by one of the so-called rules of inference.
Each of the rules of inference actually amounts to a logical tautology that
has been re-expressed as a sort of re-writing rule. Each rule of inference will
be expressed in the sequel as a list of logical sentences that are assumed to
be among the premises of the argument, a horizontal bar, followed by the
symbol ∴ (which is usually voiced as the word “therefore”) and then a new
statement that can be placed among the deductions.
For example, one (very obvious) rule of inference is
A∧B
∴B
A
A =⇒ B
∴B
¬B
A =⇒ B
∴ ¬A
11
Latin for “method of affirming”, the related modus tollens rule means “method of
denying.”
2.6. DEDUCTIVE REASONING AND ARGUMENT FORMS 103
A crocodile captures a little boy who has strayed too near the
river. The child’s father appears and the crocodile tells him
“Don’t worry, I shall either release your son or I shall eat him.
If you can say, in advance, which I will do, then I shall release
him.” The father responds, “You will eat my son.” What should
the crocodile do?
104 CHAPTER 2. LOGIC AND QUANTIFIERS
A =⇒ B
C =⇒ D
A∨C
∴ B∨D
Destructive dilemma is often not listed among the rules of inference be-
cause it can easily be obtained by using the constructive dilemma and re-
placing the implications with their contrapositives.
A =⇒ B
C =⇒ D
¬B ∨ ¬D
∴ ¬A ∨ ¬C
In Table 2.3, the ten most common rules of inference are listed. Note
that all of these are equivalent to tautologies that involve conditionals (as
opposed to biconditionals), every one of the basic logical equivalences that
we established in Section 2.3 is really a tautology involving a biconditional,
collectively these are known as the “rules of replacement.” In an argument,
any statement allows us to infer a logically equivalent statement. Or, put
differently, we could replace any premise with a different, but logically equiv-
alent, premise. You might enjoy trying to determine a minimal set of rules
of inference, that together with the rules of replacement would allow one to
form all of the same arguments as the ten rules in Table 2.3.
2.6. DEDUCTIVE REASONING AND ARGUMENT FORMS 105
Name Form
A
Modus ponens A =⇒ B
∴B
¬B
Modus tollens A =⇒ B
∴ ¬A
A =⇒ B
Hypothetical syllogism B =⇒ C
∴ A =⇒ C
A∨B
Disjunctive syllogism ¬B
∴A
A =⇒ B
C =⇒ D
Constructive dilemma
A∨C
∴ B∨D
Name Form
A =⇒ B
C =⇒ D
Destructive dilemma
¬B ∨ ¬D
∴ ¬A ∨ ¬C
A∧B
Conjunctive simplification
∴A
A
Conjunctive addition B
∴ A∧B
A
Disjunctive addition
∴ A∨B
A =⇒ B
Absorption
∴ A =⇒ (A ∧ B)
Exercises — 2.6
1. In the movie “Monty Python and the Holy Grail” we encounter a me-
dieval villager who (with a bit of prompting) makes the following ar-
gument.
(a) You are either with us, or you’re against us. And you don’t
appear to be with us. So, that means you’re against us!
(b) All those who had cars escaped the flooding. Sandra had a car –
therefore, Sandra escaped the flooding.
(c) When Johnny goes to the casino, he always gambles ’til he goes
broke. Today, Johnny has money, so Johnny hasn’t been to the
casino recently.
This argument is not sound (thank goodness!) because one of the premises
– actually the bad premise appears as one of the justifications of a step – is
110 CHAPTER 2. LOGIC AND QUANTIFIERS
false. You can argue with perfect logic to achieve complete nonsense if you
include false premises.
Exercise. It is not true that you can always cancel the same thing from
both sides of an equation. Under what circumstances is such cancellation
disallowed?
So, how can you tell if an argument has a valid form? Use a truth table.
As an example, we’ll verify that the rule of inference known as “destructive
dilemma” is valid using a truth table. This argument form contains 4 pred-
icate variables so the truth table will have 16 rows. There is a column for
each of the variables, the premises of the argument and its conclusion.
A B C D A =⇒ B C =⇒ D ¬B ∨ ¬D ¬A ∨ ¬C
T T T T T T φ φ
T T T φ T φ T φ
T T φ T T T φ T
T T φ φ T T T T
T φ T T φ T T φ
T φ T φ φ φ T φ
T φ φ T φ T T T
T φ φ φ φ T T T
φ T T T T T φ T
φ T T φ T φ T T
φ T φ T T T φ T
φ T φ φ T T T T
φ φ T T T T T T
φ φ T φ T φ T T
φ φ φ T T T T T
φ φ φ φ T T T T
2.7. VALIDITY OF ARGUMENTS AND COMMON ERRORS 111
Now, mark the lines in which all of the premises of this argument form
are true. You should note that in every single situation in which all the
premises are true the conclusion is also true. That’s what makes “destructive
dilemma” – and all of its friends – a rule of inference. Whenever all the
premises are true so is the conclusion. You should also notice that there are
several rows in which the conclusion is true but some one of the premises isn’t.
That’s okay too, isn’t it reasonable that the conclusion of an argument can be
true, but at the same time the particulars of the argument are unconvincing?
As we’ve noted earlier, an argument by deductive reasoning can go wrong
in only certain well-understood ways. Basically, either the form of the ar-
gument is invalid, or at least one of the premises is false. Avoiding false
premises in your arguments can be trickier than it sounds – many state-
ments that sound appealing or intuitively clear are actually counter-factual.
The other side of the coin, being sure that the form of your argument is valid,
seems easy enough – just be sure to only use the rules of inference as found
in Table 2.3. Unfortunately most arguments that you either read or write
will be in prose, rather than appearing as a formal list of deductions. When
dealing with that setting – using natural rather than formalized language –
making errors in form is quite common.
Two invalid forms are usually singled out for criticism, the converse error
and the inverse error. In some sense these two apparently different ways
to screw up are really the same thing. Just as a conditional statement and
its contrapositive are known to be equivalent, so too are the other related
statements – the converse and the inverse – equivalent. The converse error
consists of mistaking the implication in a modus ponens form for its converse.
The converse error:
B
A =⇒ B
∴A
112 CHAPTER 2. LOGIC AND QUANTIFIERS
Suppose that we try changing the major premise of that last argument
to something more believable.
If you read Dr. Fields’ book, you will pass your Foundations class.
You did not read Dr. Fields’ book.
Therefore, you will not pass Foundations.
2.7. VALIDITY OF ARGUMENTS AND COMMON ERRORS 113
¬A
A =⇒ B
∴ ¬B
Exercises — 2.7
(b) If one eats oranges one will have high levels of vitamin C.
You do have high levels of vitamin C.
Therefore, you must eat oranges.
Love is a snowmobile racing across the tundra and then suddenly it flips over,
pinning you underneath. At night, the ice weasels come. –Matt Groening
1 · 2 · 3 · 4 = 24 = 52 − 1
2 · 3 · 4 · 5 = 120 = 112 − 1
3 · 4 · 5 · 6 = 360 = 192 − 1
It always works!
117
118 CHAPTER 3. PROOF TECHNIQUES I
The three calculations that we’ve carried out above constitute an induc-
tive argument in favor of the result. If you like we can try a bunch of further
examples,
13 · 14 · 15 · 16 = 43680 = 2092 − 1
14 · 15 · 16 · 17 = 571200 = 2392 − 1
but really, no matter how many examples we produce, we haven’t proved the
statement — we’ve just given evidence.
Generally, the first thing to do in proving a universal statement like this
is to rephrase it as a conditional. The resulting statement is a Universal
Conditional Statement or a UCS. The reason for taking this step is that the
hypotheses will then be clear – they form the antecedent of the UCS. So,
while you won’t have really made any progress in the proof by taking this
advice, you will at least know what tools you have at hand. Taking the
example we started with, and rephrasing it as a UCS we get
Theorem 3.1.1.
k 2 − 1 = (a2 + 3a + 1)2 − 1
= (a4 + 6a3 + 11a2 + 6a + 1) − 1
= a4 + 6a3 + 11a2 + 6a.
Q.E.D.
Now, if you followed the algebra above, (none of which was particularly
difficult) the proof stands as a completely valid argument showing the truth of
our proposition, but this is very unsatisfying! All the real work was concealed
in one stark little sentence: “Let k be a2 + 3a + 1.” Where on Earth did
that particular value of k come from? The answer to that question should
hopefully convince you that there is a huge difference between devising a
proof and writing one. A good proof can sometimes be somewhat akin to a
120 CHAPTER 3. PROOF TECHNIQUES I
a2 5a 6
a2
a
Now, fill in the entries of the table by multiplying the corresponding row
and column headers.
3.1. DIRECT PROOFS OF UNIVERSAL STATEMENTS 121
a2 5a 6
2 4 3
a a 5a 6a2
a a3 5a2 6a
Finally add up all the entries of the table, combining any like terms.
You should note that the F.O.I.L rule is just a mnemonic for the case
when the table has 2 rows and 2 columns.
Okay, let’s get back to doing proofs. We are going to do a lot of proofs
involving the concepts of elementary number theory so, as a convenience,
all of the definitions that were made in Chapter 1 are gathered together in
Table 3.1.
122 CHAPTER 3. PROOF TECHNIQUES I
Even
n is even ⇐⇒ ∃k ∈ Z, n = 2k
Odd
n is odd ⇐⇒ ∃k ∈ Z, n = 2k + 1
Divisibility
d|n ⇐⇒ ∃k ∈ Z, n = kd
Floor
y = bxc ⇐⇒ y ∈Z ∧ y ≤x<y+1
Ceiling
y = dxe ⇐⇒ y ∈Z ∧ y−1<x≤y
Prime
∀ p > 1 ∈ Z+ , p is prime ⇐⇒
∀x, y ∈ Z+ , p = xy =⇒ x = 1 ∨ y = 1
versus
These two forms can readily be transformed one into the other, so we will
always concentrate on the later. A direct proof of a UCS always follows a
form known as “generalizing from the generic particular.” We are trying to
prove that ∀x ∈ U, P (x) =⇒ Q(x). The argument (in skeletal outline) will
look like:
Okay, so this outline is pretty crappy. It tells you how to start and end a
direct proof, but those obnoxious dot-dot-dots in the middle are where all the
real work has to go. If I could tell you (even in outline) how to fill in those
dots, that would mean mathematical proof isn’t really a very interesting ac-
tivity to engage in. Filling in those dots will sometimes (rarely) be obvious,
more often it will be extremely challenging; it will require great creativity,
124 CHAPTER 3. PROOF TECHNIQUES I
There is a sad tendency for people to apply old rules in new situations
just because of a chance similarity in the notation. The brackets used in
notating the floor function look very similar to ordinary parentheses, so the
following “rule” is often proposed
bx + yc = bxc + byc
Theorem 3.1.2.
∀x ∈ R, ∀n ∈ Z, bx + nc = bxc + bnc
a = bxc ⇐⇒ a ∈ Z ∧ a ≤ x < a + 1.
The only other floor function that appears in the statement of the theorem
(perhaps even more prominently) is bx + nc, here, the definition gives us
b = bx + nc ⇐⇒ b ∈ Z ∧ b ≤ x + n < b + 1.
These definitions are our only available tools so we’ll certainly have to
make use of them, and it’s important to notice that that is a good thing; the
definitions allow us to work with something well-understood (the inequalities
that appear within them) rather than with something new and relatively
suspicious (the floor notation). Putting the proof of this statement together
is an exercise in staring at the two definitions above and noting how one can
be converted into the other. It is also a testament to the power of naming
things.
bx + nc = bxc + n.
Q.E.D.
126 CHAPTER 3. PROOF TECHNIQUES I
• Before anything else, determine precisely what hypotheses you can use.
• There are 26 letters at your disposal (and even more if you know Greek)
(and you can always throw on subscripts!) don’t be stingy with letters.
The nastiest mistake you can make is to use the same variable for two
different things.
• Please write a rough draft first. Write two drafts! Even if you can write
beautiful, lucid prose on the first go around, it won’t fly when it comes
to organizing a proof.
• Don’t say “if” when you mean “since.” Really! If you start a proof
about rational numbers like so:
people are going to look at you funny. What’s the point of supposing
that x is rational, then acting as if you’re in doubt of that fact by
writing “if”? You mean “since.”
3.1. DIRECT PROOFS OF UNIVERSAL STATEMENTS 127
• Mark off the beginning and the end of your proofs as a hint to your
readers. In this book we start off a proof by writing Proof: in italics
and we end every proof with the abbreviation Q.E.D.1
1
Quod erat demonstrandum or “(that) which was to be demonstrated.” some authors
prefer placing a small rectangle at the end of their proofs, but Q.E.D. seems more pompous.
128 CHAPTER 3. PROOF TECHNIQUES I
Exercises — 3.1
3. Prove that if the sum of two integers is even, then so is their difference.
evenness(n) = k ⇐⇒ 2k | n ∧ 2k+1 - n
6. Suppose that a, b and c are integers such that a | b and b | c. Prove that
a | c.
ax + b
= 1.
cx + d
Show that x is rational. Where is the hypothesis a 6= c used?
2 9 16 23 37 44
and
3 6 12 24 96 192.
a+b √
∀a, b ∈ R, a, b ≥ 0 =⇒ ≥ ab
2
In proving this statement we have little choice but to work backwards
from the conclusion because the only hypothesis we have to work with is
that a and b are non-negative real numbers – which isn’t a particularly potent
tool. But what should we do? There isn’t a good response to that question,
we’ll just have to try a bunch of different things and hope that something
will work out. When we finally get around to writing up our proof though,
we’ll have to rearrange the statements in the opposite order from the way
they were discovered. This means that we would be ill-advised to make any
uni-directional inferences, we should strive to make biconditional connections
between our statements (or else try to intentionally make converse errors).
The first thing that appeals to your humble author is to eliminate both
the fractions and the radicals. . .
a+b √
≥ ab
2
√
⇐⇒ a + b ≥ 2 ab
⇐⇒ (a + b)2 ≥ 4ab
⇐⇒ a2 + 2ab + b2 ≥ 4ab
3.2. MORE DIRECT PROOFS 131
√ √
∀x, y ∈ Rnoneg , x ≥ y =⇒ x≥ y
What should we try next? There’s really no good justification for this
but experience working with quadratic polynomials either in equalities or
inequalities leads most people to try “moving everything to one side,” that
is, manipulating things so that one side of the equation or inequality is zero.
a2 + 2ab + b2 ≥ 4ab
⇐⇒ a2 − 2ab + b2 ≥ 0
Whoa! We’re done! Do you see why? If not, I’ll give you one hint: the
square of any real number is greater than or equal to zero.
Exercise. Re-assemble all of the steps taken in the previous few paragraphs
into a proof of the arithmetic-geometric mean inequality.
132 CHAPTER 3. PROOF TECHNIQUES I
Exercises — 3.2
1
4. Show that if x is a positive real number, then x + x
≥ 2.
3.3. CONTRADICTION AND CONTRAPOSITION 133
{p1 , p2 , p3 , . . . , pn }
n
Y
N =1+ pk
k=1
2
Both of these strange sounding words represent real mathematical concepts, however,
they don’t have anything to do with one another.
134 CHAPTER 3. PROOF TECHNIQUES I
Q.E.D.
If you are working on proving a UCS and the direct approach seems to be
failing you may find that another indirect approach, proof by contraposition,
will do the trick. In one sense this proof technique isn’t really all that indirect;
what one does is determine the contrapositive of the original conditional and
then prove that directly. In another sense this method is indirect because
a proof by contraposition can usually be recast as a proof by contradiction
fairly easily.
The easiest proof I know of using the method of contraposition (and
possibly the nicest example of this technique) is the proof of the lemma we
√
stated in Section 1.6 in the course of proving that 2 wasn’t rational. In case
you’ve forgotten we needed the fact that whenever x2 is an even number, so
is x.
Let’s first phrase this as a UCS.
∀x ∈ Z, x2 even =⇒ x even
Perhaps you tried to prove this result earlier. If so you probably came
across the conceptual problem that all you have to work with is the evenness
3.3. CONTRADICTION AND CONTRAPOSITION 135
Now, since x and x2 are integers, there is only one alternative to being
even – so we can re-express the contrapositive as
∀x ∈ Z, x odd =⇒ x2 odd.
Theorem 3.3.2.
∀x ∈ Z, x2 even =⇒ x even
∀x ∈ Z, x odd =⇒ x2 odd
∀x ∈ Z, x2 even =⇒ x even.
136 CHAPTER 3. PROOF TECHNIQUES I
Q.E.D.
Theorem 3.3.3. Among all triangles inscribed in a fixed circle, the one with
maximum area is equilateral.
A C
138 CHAPTER 3. PROOF TECHNIQUES I
Exercises — 3.3
1. Prove that if the cube of an integer is odd, then that integer is odd.
2. Prove that whenever a prime p does not divide the square of an integer,
it also doesn’t divide the original integer. (p - x2 =⇒ p - x)
Conjecture 3.
∀a, b, c ∈ Z, a | bc =⇒ a | b ∨ a | c.
a b c a|b ∨ a|c ?
2 7 6 yes
2 4 5 yes
3 12 11 yes
3 5 15 yes
5 4 15 yes
5 10 3 yes
7 2 14 yes
140 CHAPTER 3. PROOF TECHNIQUES I
There can be times when the search for a counterexample starts to feel re-
ally futile. Would you think it likely that a statement about natural numbers
could be true for (more than) the first 50 numbers a yet still be false?
Conjecture 4.
∀n ∈ Z+ n2 − 79n + 1601 is prime.
n
Y
N =1+ pk .
k=1
Define a sequence by
n
Y
Nn = 1 + pk ,
k=1
where {p1 , p2 , . . . , pn } are the actual first n primes. The first several values
of this sequence are:
n Nn
1 1 + (2) = 3
2 1 + (2 · 3) = 7
3 1 + (2 · 3 · 5) = 31
4 1 + (2 · 3 · 5 · 7) = 211
5 1 + (2 · 3 · 5 · 7 · 11) = 2311
.. ..
. .
3.4. DISPROOFS OF UNIVERSAL STATEMENTS 141
Exercises — 3.4
1! = 1
2! − 1! = 1
3! − 2! + 1! = 5
4! − 3! + 2! − 1! = 19
et cetera
6. True of false: There are two irrational numbers whose sum is rational.
Prove your answer.
8. True or false: There are two irrational numbers whose product is ra-
tional. Prove your answer.
are always colored differently. Figure 3.1 shows one instance of an arrange-
ment of nations that requires at least four different colors, the theorem says
that four colors are always enough. It should be noted that real cartogra-
phers usually reserve a fifth color for oceans (and other water) and that it is
possible to conceive of a map requiring five colors if one allows the nations to
be non-contiguous. In 1977, Kenneth Appel and Wolfgang Haken proved the
four color theorem by reducing the infinitude of possibilities to 1,936 sepa-
rate cases and analyzing each of these with a computer. The inelegance of a
proof by cases is probably proportional to some power of the number of cases,
but in any case, this proof is generally considered somewhat inelegant. Ever
since the proof was announced there has been an ongoing effort to reduce the
number of cases (currently the record is 633 cases – still far too many to be
checked through without a computer) or to find a proof that does not rely
on cases. For a good introductory article on the four color theorem see[6].
yet the statement has been checked for a large number of cases. Goldbach’s
conjecture is one such statement. Christian Goldbach [4] was a mathemati-
cian born in Königsberg Prussia, who, curiously, did not make the conjecture5
which bears his name. In a letter to Leonard Euler, Goldbach conjectured
that every odd number greater than 5 could be expressed as the sum of three
primes (nowadays this is known as the weak Goldbach conjecture). Euler
apparently liked the problem and replied to Goldbach stating what is now
known as Goldbach’s conjecture: Every even number greater than 2 can be
expressed as the sum of two primes. This statement has been lying around
since 1742, and a great many of the world’s best mathematicians have made
their attempts at proving it – to no avail! (Well, actually a lot of progress
has been made but the result still hasn’t been proved.) It’s easy to verify
the Goldbach conjecture for relatively small even numbers, so what has been
done is/are proofs by exhaustion of Goldbach’s conjecture restricted to finite
universes. As of this writing, the conjecture has been verified to be true of
all even numbers less than 2 × 1017 .
Whenever an exhaustive proof, or a proof by cases exists for some state-
ment it is generally felt that a direct proof would be more esthetically pleas-
ing. If you are in a situation that doesn’t admit such a direct proof, you
should at least seek a proof by cases using the minimum possible number of
cases. For example, consider the following theorem and proof.
Since these four cases exhaust the possibilities and since the de-
sired result holds in each case, our proof is complete.
Q.E.D.
While the proof just stated is certainly valid, the argument is inelegant
since a smaller number of cases would suffice.
Exercise. The previous theorem can be proved using just two cases. Do so.
Exercise. Show that player Zero can always win a game of binary determi-
nant tic-tac-toe by the method of exhaustion.
3.5. BY CASES AND BY EXHAUSTION 149
1 2 3
4 5 6
7 8 9
1 2 3 1 2
4 5 6 4 5
7 8 9 7 8
1 2 3 1 2
4 5 6 4 5
7 8 9 7 8
105 96
48 84
72 45
Exercises — 3.5
2. Prove that every prime number other than 2 and 3 has the form 6q + 1
or 6q + 5 for some integer q. (Hint: this problem involves thinking
about cases as well contrapositives.)
7. The trichotomy property of the real numbers simply states that every
real number is either positive or negative or zero. Trichotomy can be
used to prove many statements by looking at the three cases that it
guarantees. Develop a proof (by cases) that the square of any real
number is non-negative.
3.6. EXISTENTIAL STATEMENTS 151
From a certain point of view, there is no need for the current section. If
we are proving an existential statement we are disproving some universal
statement. (Which has already been discussed.) Similarly, if we are trying
to disprove an existential statement, then we are actually proving a related
universal statement. Nevertheless, sometimes the way a theorem is stated
emphasizes the existence question over the corresponding universal – and so
people talk about proving and disproving existential statements as a separate
issue from universal statements.
Exercise. The Fibonacci numbers are defined by the initial values F (0) = 1
and F (1) = 1 and the recursive formula F (n + 1) = F (n) + F (n − 1) (to get
the next number in the series you add the last and the penultimate).
152 CHAPTER 3. PROOF TECHNIQUES I
n F (n)
0 1
1 1
2 2
3 3
4 5
5 8
.. ..
. .
Prove that there is a Fibonacci number that is a perfect square.
Q.E.D.
kind one hoists water out of with a bucket on a rope. You needn’t be con-
cerned with WOP in general at this point, but notice that the subsets of the
natural numbers have a particularly nice property – any non-empty set of
natural numbers must have a least element (much like every water well has
a bottom).
Because the natural numbers have the well-ordering principle we can
prove that there is a least natural number with property X by simply finding
any natural number with property X – by doing that we’ve shown that the
set of natural numbers with property X is non-empty and that’s the only
hypothesis the WOP needs.
For example, in the exercises in Section 3.5 we introduced vampire num-
bers. A vampire number is a 2n digit number v that factors as v = xy where
x and y are n digit numbers and the digits of v are the union of the digits in
x and y in some order. The numbers x and y are known as the “fangs” of v.
To eliminate trivial cases, pairs of trailing zeros are disallowed.
There are quite a few occasions when we need to prove statements in-
volving the unique existence quantifier (∃!). In such instances we need to do
just a little bit more work. We need to show existence – either constructively
or non-constructively – and we also need to show uniqueness. To give an
example of a unique existence proof we’ll return to a concept first discussed
in Section 1.5 and finish-up some business that was glossed-over there.
Recall the Euclidean algorithm that was used to calculate the greatest
common divisor of two integers a and b (which we denote gcd(a, b)). There
is a rather important question concerning algorithms known as the “halting
problem.” Does the program eventually halt, or does it get stuck in an
infinite loop? We know that the Euclidean algorithm halts (and outputs the
correct result) because we know the following unique existence result.
Now, before we can prove this result, we’ll need a precise definition for
gcd(a, b). Firstly, a gcd must be a common divisor which means it needs to
divide both a and b. Secondly, among all the common divisors, it must be the
largest. This second point is usually addressed by requiring that every other
common divisor divides the gcd. Finally we should note that a gcd is always
positive, for whenever a number divides another number so does its negative,
and whichever of those two is positive will clearly be the greater! This allows
us to extend the definition of gcd to all integers, but things are conceptually
easier if we keep our attention restricted to the positive integers.
∀a, b, c, d ∈ Z+ d = gcd(a, b) ⇐⇒ d | a ∧ d | b ∧ (c | a ∧ c | b =⇒ c | d)
3.6. EXISTENTIAL STATEMENTS 155
Armed with this definition, let’s return our attention to proving the
unique existence of the gcd. The uniqueness part is easier so we’ll do that
first. We argue by contradiction. Suppose that there were two different num-
bers d and d0 satisfying the definition of gcd(a, b). Put d0 in the place of c
in the definition to see that d0 | d. Similarly, we can deduce that d | d0 and
if two numbers each divide into the other, they must be equal. This is a
contradiction since we assumed d and d0 were different.
For the existence part we’ll need to define a set – known as the Z-module
generated by a and b – that consists of all numbers of the form xa + yb where
x and y range over the integers.
This set has a very nice geometric character that often doesn’t receive the
attention it deserves. Every element of a Z-module generated by two numbers
(15 and 21 in the example) ) corresponds to a point in the Euclidean plane.
As indicated in Figure 3.3 there is a dividing line between the positive and
negative elements in a Z-module. It is also easy to see that there are many
repetitions of the same value at different points in the plane.
Exercise. The value 0 clearly occurs in a Z-module when both x and y are
themselves zero. Find another pair of (x, y) values such that 21x + 15y is
zero. What is the slope of the line which separates the positive values from
the negative in our Z-module?
In thinking about this Z-module, and perusing Figure 3.3, you may have
noticed that the smallest positive number in the Z-module is 3. If you hadn’t
noticed that, look back and verify that fact now.
Figure 3.3: The Z-module generated by 21 and 15. The number 21x + 15y
is printed by the point (x, y).
3.6. EXISTENTIAL STATEMENTS 157
Exercises — 3.6
1. Show that there is a perfect square that is the sum of two perfect
squares.
2. Show that there is a perfect cube that is the sum of three perfect cubes.
3. Show that the WOP doesn’t hold in the integers. (This is an existence
proof, you show that there is a subset of Z that doesn’t have a smallest
element.)
scissors
cuts
paper
smashes
covers
rock
Chapter 4
Sets
No more turkey, but I’d like some more of the bread it ate. –Hank Ketcham
159
160 CHAPTER 4. SETS
you can make sense of their categorical correspondences. Also, there are a
good many mathematicians who deride category theory as “abstract non-
sense” and the whole field has fallen out of favor in recent years. But, as
someone interested in developing a facility with proofs, you should be on
the lookout for categorical correspondences. If you ever hear yourself utter
a sentence like “Well, the proof of that goes just like the proof of the (insert
weird technical-sounding name here) theorem.” you are probably noticing a
categorical correspondence.
Okay, so category theory is currently somewhat unpopular, won’t be of
much use to you until much later in your mathematical career (if at all), and
doesn’t really save that much effort (Why not just do two or three different
proofs instead of learning a whole new field so we can combine them into
one?) And yet, category theory is being mentioned here at the beginning of
the chapter on sets. Why?
We are about to see our first example of a categorical correspondence.
Logic and Set theory are different aspects of the same thing. To describe a
set people usually quote Kurt Gödel – “A set is a Many that allows itself to
be thought of as a One.” (Note how the attempt at defining what is really an
elemental, undefinable concept ends up sounding rather mystical.) A more
practical approach is to think of a set as the collection of things that make
some open sentence true.2
Recall that in Logic the atomic concepts were “true”, “false”, “sentence”
and “statement.” In Set theory, they are “set”, “element” and “member-
ship.” These concepts (more or less) correspond to one another. In most
books, a set is denoted either using the letter M (which stands for the Ger-
man word “menge”) or early alphabet capital roman letters – A, B, C, et
2
This may sound less metaphysical, but this statement is also faulty because it defines
“set” in terms of “collection” – which will of course be defined elsewhere as “the sort of
things of which sets are one example.”
4.1. BASIC NOTIONS OF SET THEORY 161
cetera. Here, we will often emphasize the connection between sets and open
sentences in Logic by using a subscript notation. The set that corresponds to
the open sentence P (x) will be denoted SP , we call SP the truth set of P (x).
SP = {x P (x)}
On the other hand, when we have a set given in the absence of any open
sentence, we’ll be happy to use the early alphabet, capital roman letters
convention – or frankly, any other letters we feel like! Whenever we have a
set A given, it is easy to state a logical open sentence that would correspond
to it. The membership question: MA (x) = “Is x in the set A?” Or, more
succinctly, MA (x) = “x ∈ A”. Thus the atomic concept “true” from Logic
corresponds to the answer “yes” to the membership question in Set theory
(and of course “false” corresponds to “no”).
There are many interesting foundational issues that are going to be sidestepped
in our current development of Set theory. For instance, recall that in Logic
we always worked inside some “universe of discourse.” As a consequence of
the approach we are taking now, all of our set theoretic work will be done
within some unknown “universal” set. Attempts at specifying (a priori ) a
universal set for doing mathematics within are doomed to failure. In the
early days of the twentieth century they attempted to at least get Set theory
itself on a firm footing by defining the universal set to be “the set of all sets”
– an innocuous sounding idea that had funny consequences (we’ll investigate
this in Section 4.5).
In Logic we had “sentences” and “statements,” the latter were distin-
guished as having definite truth values. The corresponding thing in Set
theory is that sets have the property that we can always tell whether a given
object is or is not in them. If it ever becomes necessary to talk about “sets”
where we’re not really sure what’s in them we’ll use the term collection.
You should think of a set as being an unordered collection of things, thus
162 CHAPTER 4. SETS
{popover, 1, froggy} and {1, froggy, popover} are two ways to represent the
same set. Also, a set either contains, or doesn’t contain, a given element. It
doesn’t make sense to have an element in a set multiple times. By conven-
tion, if an element is listed more than once when a set is listed we ignore
the repetitions. So, the sets {1, 1} and {1} are really the same thing. If the
notion of a set containing multiple instances of its elements is needed there is
a concept known as a multiset that is studied in Combinatorics. In a multi-
set, each element is preceded by a so-called repetition number which may be
the special symbol ∞ (indicating an unlimited number of repetitions). The
multiset concept is useful when studying puzzles like “How many ways can
the letters of MISSISSIPPI be rearranged?” because the letters in MISSIS-
SIPPI can be expressed as the multiset {1 · M, 4 · I, 2 · P, 4 · S}. With the
exception of the following exercise, in the remainder of this chapter we will
only be concerned with sets, never multisets.
Exercise. (Not for the timid!) How many ways can the letters of MISSIS-
SIPPI be arranged?
S2 = {A, 1, , π, e, s, ⊕, ♠, Ω, ♦}
4.1. BASIC NOTIONS OF SET THEORY 163
If instead we compare them after they’ve been sorted, the job is much easier.
S1 = {1, A, ♦, e, , h, Ω, ⊕, π, ♠}
S2 = {1, A, ♦, e, , Ω, ⊕, π, s, ♠}
are elements in your universe. They aren’t the same though, for example
1 6= {1}. There is only one empty set and it is denoted ∅ – irrespective of
the universe we are working in.
Let’s have a look at a small example, suppose we have a universal set with
3 elements, without loss of generality, {1, 2, 3}. It’s possible to construct a
set, whose elements are all the possible sets in this universe. This set is
known as the power set of the universal set. Indeed, we can construct the
power set of any set A and we denote it with the symbol P(A). Returning
to our example we have
P({1, 2, 3}) = ∅,
{1}, {2}, {3},
{1, 2}, {1, 3}, {2, 3},
{1, 2, 3} .
Exercise. Find the power sets P({1, 2}) and P({1, 2, 3, 4}). Conjecture a
formula for the number of elements (these are, of course, sets) in P({1, 2, . . . n}).
Hint: If your conjectured formula is correct you should see why these sets are
named as they are.
4.1. BASIC NOTIONS OF SET THEORY 165
Exercises — 4.1
1. What is the power set of ∅? Hint: if you got the last exercise in the
chapter you’d know that this power set has 20 = 1 element.
6. Find a logical open sentence such that {0, 1, 4, 9, . . .} is its truth set.
7. How many singleton sets are there in the power set of {1, 2, 3, . . . n}?
166 CHAPTER 4. SETS
4.2 Containment
There are two notions of being “inside” a set. A thing may be an element
of a set, or may be contained as a subset. Distinguishing these two notions
of inclusion is essential. One difficulty that sometimes complicates things is
that a set may contain other sets as elements. For instance, as we saw in the
previous section, the elements of a power set are themselves sets.
A set A is a subset of another set B if all of A’s elements are also in B.
The terminology superset is used to refer to B in this situation, as in “The set
of all real-valued functions in one real variable is a superset of the polynomial
functions.” The subset/superset relationship is indicated with a symbol that
should be thought of as a stylized version of the less-than-or-equal sign, when
A is a subset of B we write A ⊆ B. We say that A is a proper subset of B if
B has some elements that aren’t in A, and in this situation we write A ⊂ B
or if we really want to emphasize the fact that the sets are not equal we can
write A ( B.
As we’ve seen earlier, the symbol ∈ is used between an element of a set
and the set that it’s in. The following exercise is intended to clarify the
distinction between ∈ and ⊆.
Exercise. Let A = 1, 2, {1}, {a, b} . Which of the following are true?
i) {a, b} ⊆ A. vi) {1} ⊆ A.
ii) {a, b} ∈ A. vii) {1} ∈ A.
iii) a ∈ A. viii) {2} ∈ A.
iv) 1 ∈ A. ix) {2} ⊆ A.
v) 1 ⊆ A. x) {{1}} ⊆ A.
Another perspective that may help clear up the distinction between ∈ and
⊆ is to consider what they correspond to in Logic. The “element of” symbol
∈ is used to construct open sentences that embody the membership question
– thus it corresponds to single sentences in Logic. The “set containment”
4.2. CONTAINMENT 167
F = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50}
Hopefully it is clear that ⊆ can be inserted between these two sets like
so: T ⊆ F . On the other hand we can re-express the sets T and F using
set-builder notation in order to see clearly what their membership questions
are.
T = {x ∈ U 10 | x}
F = {x ∈ U 5 | x}
Exercise. Consider S, the set of perfect squares and F , the set of perfect
fourth powers. Which is contained in the other? Can you prove it?
We’ll end this section with a fairly elementary proof – mainly just to
illustrate how one should proceed in proving that one set is contained in
another.
Let D represent the set of all integers that are divisible by 9,
D = {x ∈ Z ∃k ∈ Z, x = 9k}.
Let C represent the set of all integers that are divisible by 3,
C = {x ∈ Z ∃k ∈ Z, x = 3k}.
The set D is contained in C. Let’s prove it!
Exercises — 4.2
6. Prove that the set of perfect fourth powers is contained in the set of
perfect squares.
4.3. SET OPERATIONS 171
SP ∪ SQ = {x ∈ U P (x) ∨ Q(x)}.
Exercise. Suppose two sets A and B are given. Re-express the previous
definition of “union” using their membership criteria, MA (x) = “x ∈ A” and
MB (x) = “x ∈ B.”
The union of more than two sets can be expressed using a big union
symbol. For example, consider the family of real intervals defined by In =
(n, n + 1].3 There’s an interval for every integer n. Also, every real number
is in one of these intervals. The previous sentence can be expressed as
[
R = In .
n∈Z
A ∩ B = {x ∈ U x ∈ A ∧ x ∈ B}.
3
The elements of In can also be distinguished as the solution sets of the inequalities
n < x ≤ n + 1.
172 CHAPTER 4. SETS
Exercise. With reference to two open sentences P (x) and Q(x), define the
intersection of their truth sets, SP ∩ SQ .
There is also a “big” version of the intersection symbol. Using the same
family of intervals as before,
\
∅ = In .
n∈Z
was writing the last paragraph, this text was nothing more than a very long
sequence of zeros and ones in the memory of my computer. . .
Every rule that we learned in Chapter 2 (see Table 2.2) has a set-theoretic
equivalent. These set-theoretic versions are expressed using equalities (i.e.
the symbol = in between two sets) which is actually a little bit funny if you
think about it. We normally use = to mean that two numbers or variables
have the same numerical magnitude, as in 122 = 144, we are doing some-
thing alltogether different when we use that symbol between two sets, as in
√ √ √
{1, 2, 3} = { 1, 4, 9}, but people seem to be used to this so there’s no
sense in quibbling.
Exercise. Develop a useful definition for set equality. In other words, come
up with a (quantified) logical statement that means the same thing as “A =
B” for two arbitrary sets A and B.
In Table 4.1 the rules governing the interactions between the set theoretic
operations are collected.
We are now in a position somewhat similar to when we jumped from
proving logical assertions with truth tables to doing two-column proofs. We
have two different approaches for showing that two sets are equal. We can
do a so-called “element chasing” proof (to show A = B, assume x ∈ A and
prove x ∈ B and then vice versa). Or, we can construct a proof using the
basic set equalities given in Table 4.1. Often the latter can take the form of
a two-column proof.
174 CHAPTER 4. SETS
Intersection Union
version version
Commutative
A∩B =B∩A A∪B =B∪A
laws
Associative A ∩ (B ∩ C) A ∪ (B ∪ C)
laws = (A ∩ B) ∩ C = (A ∪ B) ∪ C
Distributive A ∩ (B ∪ C) = A ∪ (B ∩ C) =
laws (A ∩ B) ∪ (A ∩ C) (A ∪ B) ∩ (A ∪ C)
Identity
A∩U =A A∪∅=A
laws
Absorption A ∩ (A ∪ B) = A A ∪ (A ∩ B) = A
There are some notions within Set theory that don’t have any clear par-
allels in Logic. One of these is essentially a generalization of the concept of
“complements.” If you think of the set A as being the difference between
the universal set U and the set A you are on the right track. The difference
between two sets is written A \ B (sadly, sometimes this is denoted using the
ordinary subtraction symbol A − B) and is defined by
A \ B = A ∩ B.
A4B = (A \ B) ∪ (B \ A).
Come on! You read right past that exercise without even pausing!
What? You say you did try it and it was too hard?
Okay, just for you (and this time only) I’ve prepared an aid to help you
through. . .
On the next page is a two-column proof of the result you need to prove,
but the lines of the proof are all scrambled. Make a copy and cut out all the
pieces and then glue them together into a valid proof.
So, no more excuses, just do it!
176 CHAPTER 4. SETS
= (A ∩ B) ∪ (B ∩ A) identity law
(A ∪ B) \ (A ∩ B) Given
Exercises — 4.3
1. Let A = {1, 2, {1, 2}, b} and let B = {a, b, {1, 2}}. Find the following:
(a) A ∩ B
(b) A ∪ B
(c) A \ B
(d) B \ A
(e) A4B
(a) A ∩ ♥
(b) A ∪ ♥
(c) J ∩ (♠ ∩ ♥)
(d) K ∩ ♥
(e) A ∩ K
(f) A ∪ K
In = [−n, 1/n).
Find the union and intersection of all the intervals in this infinite family.
[
In =
n∈N
178 CHAPTER 4. SETS
\
In =
n∈N
4. There is a set X such that, for all sets A, we have X4A = A. What
is X?
Hopefully, you’ve seen Venn diagrams before, but possibly you haven’t thought
deeply about them. Venn diagrams take advantage of an obvious but impor-
tant property of closed curves drawn in the plane. They divide the points
in the plane into two sets, those that are inside the curve and those that
are outside! (Forget for a moment about the points that are on the curve.)
This seemingly obvious statement is known as the Jordan curve theorem,
and actually requires some details. A Jordan curve is the sort of curve you
might draw if you are required to end where you began and you are required
not to cross-over any portion of the curve that has already been drawn. In
technical terms such a curve is called continuous, simple and closed. The
Jordan curve theorem is one of those statements that hardly seems like it
needs a proof, but nevertheless, the proof of this statement is probably the
best-remembered work of the famous French mathematician Camille Jordan.
The prototypical Venn diagram is the picture that looks something like
the view through a set of binoculars.
A B
180 CHAPTER 4. SETS
C D
Exercise. Verify that the diagram above has regions representing all 16 pos-
sible intersections of 4 sets.
relationships between sets. The main deal is that the points inside of one
of the simple closed curves are not necessarily in the set – only some of the
points inside a simple closed curve are in the set, and we don’t know precisely
where they are! The various simple closed curves in a Venn diagram divide
the universe up into a bunch of regions. It might be best to think of these
regions as fenced-in areas in which the elements of a set mill about, much
like domesticated animals in their pens. One of our main tools in working
with Venn diagrams is to deduce that certain of these regions don’t contain
any elements – we then mark that region with the emptyset symbol (∅).
Snowball
Shadowfax
Ren
Heckle
Silver
Tweety Bird
Misty
Wile E. Coyote
Secretariat
And here is the same universe with some Jordan curves used to encircle two
subsets.
182 CHAPTER 4. SETS
Snowball
Shadowfax
Ren
Heckle
Silver
Tweety Bird
Misty
Wile E. Coyote
H
Secretariat C
This picture might lead us to think that the set of cartoon characters and
the set of horses are disjoint, so we thought it would be nice to add one more
element to our universe in order to dispel that notion.
Snowball
Shadowfax
Night Mare Ren
Heckle
Silver
Tweety Bird
Misty
Wile E. Coyote
H
Secretariat C
4.4. VENN DIAGRAMS 183
Suppose we have two sets A and B and we’re interested in proving that
B ⊆ A. The job is done if we can show that all of B’s elements are actually in
the eye-shaped region that represents the intersection A ∩ B. It’s equivalent
if we can show that the region marked with ∅ in the following diagram is
actually empty.
A B
One can use information that is known a priori when drawing a Venn
diagram. For instance if two sets are known to be disjoint, or if one is known
to be contained in the other, we can draw Venn diagrams like the following.
184 CHAPTER 4. SETS
A B
However, both of these situations can also be dealt with by working with
Venn diagrams in which the sets are in general position – which in this
situation means that every possible intersection is shown – and then marking
any empty regions with ∅.
Exercise. On a Venn diagram for two sets in general position, indicate the
empty regions when
b) A is contained in B.
4.4. VENN DIAGRAMS 185
A B
A B
A∩B∩C A∩B∩C
A∩B∩C
A∩B∩C
A∩B∩C A∩B∩C
A∩B∩C
A∩B∩C
C
4.4. VENN DIAGRAMS 187
Exercises — 4.4
1. Venn diagrams are usually made using simple closed curves with no
further restrictions. Try creating Venn diagrams for 3, 4 and 5 sets (in
general position) using rectangular simple closed curves.
3. Argue as to why rectilinear curves will suffice to build any Venn dia-
gram.
6. The prototypes for the modus ponens and modus tollens argument
forms are the following:
All men are mortal. All men are mortal.
Socrates is a man. Zeus is not mortal.
and
Therefore Socrates is Therefore Zeus is not a
mortal. man.
Illustrate these arguments using Venn diagrams.
(A ∩ B) ∪ (C ∩ D) ⊆ (A ∪ C) ∩ (B ∪ D).
A = {1, 2, A}.
and then
and then
et cetera.
This obviously seems like a problem. Indeed, often paradoxes seem to be
caused by self-reference of this sort. Consider The sentence in this box is false.
So a reasonable alternative is to “do” math among the sets that don’t exhibit
this particular pathology.
Thus, inside the set of all sets we are singling out a particular subset that
consists of sets which don’t contain themselves.
S = {A A is a set ∧ A ∈
/ A}
Now within the universal set we’re working in (the set of all sets) there
are only two possibilities: a given set is either in S or it is in its complement
S. Russell’s paradox comes about when we try to decide which of these
alternatives pertains to S itself, the problem is that each alternative leads us
to the other!
If we assume that S ∈ S, then it must be the case that S satisfies the
membership criterion for S. Thus, S ∈
/ S.
On the other hand, if we assume that S ∈
/ S, then we see that S does
indeed satisfy the membership criterion for S. Thus S ∈ S.
Russell himself developed a workaround for the paradox which bears his
name. Together with Alfred North Whitehead he published a 3 volume
work entitled Principia Mathematica 5 [17]. In the Principia, Whitehead and
Russell develop a system known as type theory which sets forth principles for
avoiding problems like Russell’s paradox. Basically, a set and its elements
are of different “types” and so the notion of a set being contained in itself
(as an element) is disallowed.
5
Isaac Newton also published a 3 volume work which is often cited by this same title,
Philosophiae Naturalis Principia Mathematica.
4.5. RUSSELL’S PARADOX 191
Exercises — 4.5
2. One way out of Russell’s paradox is to declare that the collection of sets
that don’t contain themselves as elements is not a set itself. Explain
how this circumvents the paradox.
3. On the TV show Star Trek (this is the original 1960’s incarnation with
William Shatner playing Captain Kirk, and Leonard Nimoy playing
Mr. Spock), the lead characters manage to foil an evil robot who has
taken over their spaceship by catching it in a paradox very similar to
the form of Russell’s paradox. Captain Kirk and Mr. Spock both
approach the robot and Kirk says “You know, everything Mr. Spock
says is truthful.” Mr. Spock catches on quickly and makes a statement
that causes the robot to become increasingly agitated – eventually its
head begins smoking and sparking and the crew is able to “transport”
it off of the ship just prior to its explosion. (See the power of a good
paradox?)
What did Mr. Spock say to the robot?
192 CHAPTER 4. SETS
Chapter 5
Proof techniques II —
Induction
Who was the guy who first looked at a cow and said, ”I think I’ll drink
whatever comes out of these things when I squeeze ’em!”? –Bill Watterson
193
194 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
v) If a subset of the natural numbers contains 0 and also has the property
that whenever a ∈ S it follows that s(a) ∈ S, then the subset S is
actually equal to N.
The last axiom is the one that justifies PMI. Basically, if 0 is in a subset,
and the subset has this property about successors1 , then 1 must be in it. But
if 1 is in it, then 1’s successor (2) must be in it. And so on . . .
The subset ends up having every natural number in it.
Exercise. Verify that the following symbolic formulation has the same con-
tent as the version of the 5th Peano axiom given above.
∀S ⊆ N (0 ∈ S) ∧ (∀a ∈ N, a ∈ S =⇒ s(a) ∈ S) =⇒ S = N
This is the model one should keep in mind when thinking about PMI:
domino toppling. In setting up a line of dominoes, what do we need to do in
order to ensure that they will all fall when the toppling begins? Every domino
must be placed so that it will hit and topple its successor. This is exactly
analogous to (a ∈ S =⇒ s(a) ∈ S). (Think of S having the membership
criterion, x ∈ S = “x will have fallen when the toppling is over.”) The other
thing that has to happen (barring the action of cockroaches) is for someone
to knock over the first domino. This is analogous to 0 ∈ S.
Rather than continuing to talk about subsets of the naturals, it will be
convenient to recast our discussion in terms of infinite families of logical state-
ments. If we have a sequence of statements, (one for each natural number)
P0 , P1 , P2 , P3 , . . . we can prove them all to be true using PMI. We have to
do two things. First – and this is usually the easy part – we must show that
P0 is true (i.e. the first domino will get knocked over). Second, we must
196 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
show, for every possible value of k, Pk =⇒ Pk+1 (i.e. each domino will
knock down its successor). These two parts of an inductive proof are known,
respectively, as the basis and the inductive step.
An outline for a proof using PMI:
Theorem ∀n ∈ N, Pn
Inductive step:
Q.E.D.
|A| = 0 =⇒ |P(A)| = 20 ,
|A| = 1 =⇒ |P(A)| = 21 ,
|A| = 2 =⇒ |P(A)| = 22 ,
|A| = 3 =⇒ |P(A)| = 23 ,
et cetera.
This is exactly the sort of situation in which we use induction.
Q.E.D.
• Statements that can be proved inductively don’t always start out with
P0 . Sometimes P1 is the first statement in an infinite family. Sometimes
its P5 . Don’t get hung up about something that could be handled by
renumbering things.
• In your final write-up you only need to prove the initial case (whatever
it may be) for the basis, but it is a good idea to try the first several
cases while you are in the “draft” stage. This can provide insights into
how to prove the inductive step, and it may also help you avoid a classic
error in which the inductive approach fails essentially just because there
is a gap between two of the earlier dominoes.2
it might have been nice to start the inductive step with a comment
along the following lines, “What we need to show is that under the
assumption that any set of size k has a power set of size 2k , it follows
that a set of size k + 1 will have a power set of size 2k+1 .”
200 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
Exercises — 5.1
The sum of the first several numbers in this sequence can be expressed
as a polynomial.
n
X
4j + 1 = 2n2 + 3n + 1
j=0
2. What is wrong with the following inductive proof of “all horses are the
same color.”?
Theorem Let H be a set of n horses, all horses in H are the same
color.
Q.E.D.
3. For each of the following theorems, write the statement that must be
proved for the basis – then prove it, if you can!
(c) If n coins are flipped, the probability that all of them are “heads”
is 1/2n
(d) Every 2n ×2n chessboard – with one square removed – can be tiled
perfectly3 by L-shaped trominoes. (A tromino is like a domino
but made up of 3 little squares. There are two kinds, straight
4. Suppose that the rules of the game for PMI were changed so that one
did the following:
Explain why this would not constitute a valid proof that Pn holds for
all natural numbers n. How could we change the basis in this outline
to obtain a valid proof?
n
X n(n + 1)
j=
j=1
2
n
X n(n + 1)(2n + 1)
j2 =
j=1
6
n
X n2 (n + 1)2
j3 = .
j=1
4
5.2. FORMULAS FOR SUMS AND PRODUCTS 203
A really industrious author might also include the sum of the fourth pow-
ers. Jacob Bernoulli (a truly industrious individual) got excited enough to
find formulas for the sums of the first ten powers of the naturals. Actually,
Bernoulli went much further. His work on sums of powers lead to the def-
inition of what are now known as Bernoulli numbers and let him calculate
P1000 10
j=1 j in about seven minutes – long before the advent of calculators! In
[16, p. 320], Bernoulli is quoted:
With the help of this table it took me less than half of a quarter
of an hour to find that the tenth powers of the first 1000 numbers
being added together will yield the sum
91, 409, 924, 241, 424, 243, 424, 241, 924, 242, 500.
n n
!2
X X
j3 = j .
j=1 j=1
The sum of the cubes of the first n numbers is the square of their sum.
For completeness we should include the following formula which should
be thought of as the sum of the zeroth powers of the first n naturals.
204 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
n
X
1=n
j=1
Exercise. Write down the k + 1–th version of the formula for the sum of the
first n naturals. (You have to replace every n with a k + 1.)
Theorem 5.2.1.
n
X n(n + 1)
∀n ∈ N, j=
j=1
2
Basis: Notice that when n = 0 the sum on the left-hand side has
no terms in it! This is known as an empty sum, and by definition,
an empty sum’s value is 0. Also, when n = 0 the formula on the
right-hand side becomes (0 · 1)/2 and this is 0 as well.4
4
If you’d prefer to avoid the “empty sum” argument, you can choose to use n = 1 as
the basis case. The theorem should be restated so the universe of discourse is positive
naturals.
5.2. FORMULAS FOR SUMS AND PRODUCTS 205
k+1
X
j
j=1
k
X
= (k + 1) + j
j=1
Next, we can use the inductive hypothesis to replace the sum (the
part that goes from 1 to k) with a formula.
k(k + 1)
= (k + 1) +
2
From here on out it’s just algebra . . .
2(k + 1) k(k + 1)
= +
2 2
2(k + 1) + k(k + 1)
=
2
(k + 1) · (k + 2)
= .
2
Q.E.D.
Notice how the inductive step in this proof works. We start by writing
down the left-hand side of Pk+1 , we pull out the last term so we’ve got the left-
hand side of Pk (plus something else), then we apply the inductive hypothesis
206 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
and do some algebra until we arrive at the right-hand side of Pk+1 . Overall,
we’ve just transformed the left-hand side of the statement we wish to prove
into its right-hand side.
There is another way to organize the inductive steps in proofs like these
that works by manipulating entire equalities (rather than just one side or the
other of them).
k
X k(k + 1)
j= .
j=1
2
k+1
X k(k + 1)
j = (k + 1) + .
j=1
2
k+1
X (k + 1)(k + 2)
j= .
j=1
2
Q.E.D.
that in writing-up your proof you need to make it look as if you reasoned di-
rectly from the premises to the conclusion. We’ll illustrate what we’ve been
discussing in this paragraph while proving the formula for the sum of the
squares of the first n naturals.
Theorem 5.2.2.
n
X n(n + 1)(2n + 1)
∀n ∈ N, j2 =
j=1
6
(k + 1)((k + 1) + 1)(2(k + 1) + 1)
6
(k + 1)(k + 2)(2k + 3)
=
6
(k 2 + 3k + 2)(2k + 3)
=
6
2k 3 + 9k 2 + 13k + 6
= .
6
k
X k(k + 1)(2k + 1)
j2 = .
j=1
6
208 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
k
2
X k(k + 1)(2k + 1)
(k + 1) + j2 = + (k + 1)2 .
j=1
6
Thus,
k+1
X k(k + 1)(2k + 1) 6(k + 1)2
j2 = + .
j=1
6 6
Therefore,
k+1
X (k 2 + k)(2k + 1) 6(k 2 + 2k + 1)
j2 = +
j=1
6 6
(2k 3 + 3k 2 + k) + (6k 2 + 12k + 6)
=
6
2k 3 + 9k 2 + 13k + 6
=
6
(k 2 + 3k + 2)(2k + 3)
=
6
(k + 1)(k + 2)(2k + 3)
=
6
(k + 1)((k + 1) + 1)(2(k + 1) + 1)
= .
6
Q.E.D.
Notice how the last four lines of the proof are the same as those in the
box above containing our scratch work? (Except in the reverse order.)
We’ll end this section by demonstrating one more use of this technique.
This time we’ll look at a formula for a product rather than a sum.
5.2. FORMULAS FOR SUMS AND PRODUCTS 209
Theorem 5.2.3.
n
Y 1 n+1
∀n ≥ 2 ∈ Z, 1− 2 = .
j=2
j 2n
Before preceeding with the proof let’s look at an example (although this
has nothing to do with proving anything, it’s really not a bad idea – it can
keep you from wasting a lot of time trying to prove something that isn’t
actually true!) When n = 4 the product is
1 1 1
1− 2 · 1− 2 · 1− 2 .
2 3 4
This simplifies to
1 1 1 3 8 15 360
1− · 1− · 1− = · · = .
4 9 16 4 9 16 576
4+1 5
= .
2·4 8
Well! These two expressions are clearly not equal to one another. . . What?
You say they are? Just give me a second with my calculator. . .
Alright then. I guess we can’t dodge doing the proof. . .
Inductive step:
k
Y 1 k+1
1− 2 = .
j=2
j 2k
k
1 Y 1 k+1 1
1− · 1− 2 = · 1− .
(k + 1)2 j=2
j 2k (k + 1)2
Thus
k+1
Y
1 k+1 1
1− 2 = · 1−
j=2
j 2k (k + 1)2
k+1 (k + 1)
= −
2k 2k(k + 1)2
k+1 (1)
= −
2k 2k(k + 1)
(k + 1)2 − 1
=
2k(k + 1)
k 2 + 2k
=
2k(k + 1)
k(k + 2)
=
2k(k + 1)
5
Really, the only reason I’m doing this silly proof is to point out to you that when
you’re doing the inductive step in a proof of a formula for a product, you don’t add to
both sides anymore, you multiply. You see that, right? Well, consider yourself to have
been pointed out to or . . . oh, whatever.
5.2. FORMULAS FOR SUMS AND PRODUCTS 211
k+2
= .
2(k + 1)
Q.E.D.
212 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
Exercises — 5.2
1. Write an inductive proof of the formula for the sum of the first n cubes.
3. The sum of the first n natural numbers is sometimes called the n-th
triangular number Tn . Triangular numbers are so-named because one
can represent them with triangular shaped arrangements of dots.
1
1 − 4 = −3
1−4+9=6
1 − 4 + 9 − 16 = −10
et cetera
Guess a general formula for ni=1 (−1)i−1 i2 , and prove it using PMI.
P
n
Y 1 1
1− =
i=2
i n
5.2. FORMULAS FOR SUMS AND PRODUCTS 213
Fn+2 = Fn + Fn+1
The first two Fibonacci numbers (actually the zeroth and the first) are
both 1.
Thus, the first several Fibonacci numbers are
n
X
(Fi )2 = Fn · Fn+1
i=0
214 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
In English:
Wiles of Princeton announced a proof of FLT, but in Wiles’s own words, his
is “a twentieth century proof” it can’t be the proof Fermat had in mind.
These days most people believe that Fermat was mistaken. Probably he
thought a proof technique that works for small values of n could be gen-
eralized. It remains a tantalizing question, can a proof of FLT using only
methods available in the 17th century be accomplished?
Part of the reason that so many people spent so much effort on FLT over
the centuries is that Fermat had an excellent record as regards being correct
about his theorems and proofs. The result known as Fermat’s little theorem
is an example of a theorem and proof that Fermat got right. It is probably
known as his “little” theorem because its statement is very short, but it is
actually a fairly deep result.
Theorem 5.3.1 (Fermat’s Little Theorem). For every prime number p, and
for all integers x, the p-th power of x and x itself are congruent mod p.
Symbolically:
xp ≡ x (mod p)
∀n ∈ N, 3 | (n3 + 2n + 6).
This is really just the p = 3 case of Fermat’s little theorem with a little
camouflage added (n3 + 2n + 6) = (n3 − n) + 3(n + 2)). But let’s have a look
at proving this statment using PMI.
(k + 1)3 + 2(k + 1) + 6
= (k 3 + 3k 2 + 3k + 1) + (2k + 2) + 6
= (k 3 + 2k + 6) + 3k 2 + 3k + 3
= (k 3 + 2k + 6) + 3(k 2 + k + 1)
(k + 1)3 + 2(k + 1) + 6
= 3m + 3(k 2 + k + 1)
= 3(m + k 2 + k + 1).
clear. Notice that 7 is equivalent to 1 (mod 6), it follows that any power of
7 is also 1 (mod 6). So, if we subtract 1 from some power of 7 we will have
a number that is divisible by 6.
The proof (by PMI) of a statement like this requires another subtle little
trick. Somewhere along the way in the proof you’ll need the identity 7 = 6+1.
Theorem 5.3.3.
∀n ∈ N, 6 | 7n − 1
7k+1 − 1 = 7 · 7k − 1
= (6 + 1) · 7k − 1
= 6 · 7k + 1 · 7k − 1
= 6(7k ) + (7k − 1)
Q.E.D.
218 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
n 0 1 2 3
n
2 1 2 4 8
n! 1 1 2 6
As the table illustrates, for small values of n, 2n > n!. But from n = 4
onward the inequality is reversed.
Theorem 5.3.4.
∀n ≥ 4 ∈ N, 2n < n!
2 · 2k < (k + 1) · k!.
7
It might be smoother to justify this step by first proving the lemma that ∀a, b, c, d ∈
+
R , a < b ∧ c < d =⇒ ac < bd.
5.3. OTHER PROOFS USING PMI 219
So
Q.E.D.
The observant Calculus student will certainly be aware of the fact that,
assymptotically, exponential functions grow faster than polynomial functions.
That is, if you have a base b which is greater than 1, the function bx is eventu-
ally larger than any polynomial p(x). This may seem a bit hard to believe if
b = 1.001 and p(x) = 500x10 . The graph of y = 1.001x is practically indistin-
guishable from the line y = 1 (at first), whereas the graph of y = 500x10 has
already reached the astronomical value of five trillion (5, 000, 000, 000, 000)
when x is just 10. Nevertheless, the exponential will eventually outstrip the
polynomial. We can use the methods of this section to get started on proving
the fact mentioned above. Consider the two sequences n2 and 2n .
n 0 1 2 3 4 5 6
n2 0 1 4 9 16 25 36
2n 1 2 4 8 16 32 64
Proof:
Basis: When n = 4 we have 42 ≤ 24 , which is true since both
numbers are 16.
Inductive step: (In the inductive step we assume that k 2 ≤ 2k
and then show that (k + 1)2 ≤ 2k+1 .)
The inductive hypothesis tells us that
k 2 ≤ 2k .
Q.E.D.???
Exercises — 5.3
Give inductive proofs of the following
1. ∀x ∈ Z, 3 | x3 − x
2. ∀x ∈ Z, 3 | x3 + 5x
3. ∀x ∈ Z, 11 | x11 + 10x
4. ∀n ∈ N, 3 | 4n − 1
5. ∀n ∈ N, 7 | 8n + 6
7. ∀n > 3 ∈ N, n3 < 3n
222 CHAPTER 5. PROOF TECHNIQUES II — INDUCTION
∀k(P0 ∧ P1 ∧ . . . ∧ Pk−1 ) =⇒ Pk .
Theorem ∀n ∈ N, Pn
Inductive step:
Q.E.D.
5.4. THE STRONG FORM OF MATHEMATICAL INDUCTION 223
It’s fairly common that we won’t truly need all of the statements from P0
to Pk−1 to be true, but just one of them (and we don’t know a priori which
one). The following is a classic result; the proof that all numbers greater
than 1 have prime factors.
Theorem 5.4.1. For all natural numbers n, n > 1 implies n has a prime
factor.
Exercises — 5.4
Give inductive proofs of the following
∀n ∈ N, n ≥ 12 =⇒ ∃x, y ∈ N, n = 3x + 7y.
√
1+ 5
2. The polynomial equation x2 = x + 1 has two solutions, α = 2
and
√
1− 5
β= 2
. Show that the Fibonacci number Fn is less than or equal to
αn for all n ≥ 0.
Chapter 6
If evolution really works, how come mothers only have two hands? –Milton
Berle
6.1 Relations
A relation in mathematics is a symbol that can be placed between two num-
bers (or variables) to create a logical statement (or open sentence). The main
point here is that the insertion of a relation symbol between two numbers
creates a statement whose value is either true or false. For example, we have
previously seen the divisibility symbol (|) and noted the common error of
mistaking it for the division symbol (/); one of these tells us to perform an
arithmetic operation, the other asks us whether if such an operation were
performed there would be a remainder. There are many other symbols that
we have seen which have this characteristic, the most important is probably
=, but there are lots: 6=, <, ≤, >, ≥ all work this way – if we place them
between two numbers we get a Boolean thing, it’s either true or false. If, in-
stead of numbers, we think of placing sets on either side of a relation symbol,
then =, ⊆ and ⊇ are valid relation symbols. If we think of placing logical
225
226 CHAPTER 6. RELATIONS AND FUNCTIONS
expressions on either side of a relation then, honestly, any of the logical sym-
bols is a relation, but we normally think of ∧ and ∨ as operators and give
things like ≡, =⇒ and ⇐⇒ the status of relations.
In the examples we’ve looked at the things on either side of a relation are
of the same type. This is usually, but not always, the case. The prevalence
of relations with the same kind of things being compared has even lead to
the aphorism “Don’t compare apples and oranges.” Think about the symbol
∈ for a moment. As we’ve seen previously, it isn’t usually appropriate to put
sets on either side of this, we might have numbers or other objects on the left
and sets on the right. Let’s look at a small example. Let A = {1, 2, 3, a, b}
and let B = {{1, 2, a}, {1, 3, 5, 7, . . .}, {1}}. The “element of” relation, ∈, is
a relation from A to B.
2 {1, 2, a}
3 {1, 3, 5, 7, . . .}
a {1}
Figure 6.1: The “element of” relation is an example of a relation that goes
from one set to a different set.
A diagram such as we have given in Figure 6.1 seems like a very natural
thing. Such pictures certainly give us an easy visual tool for thinking about
6.1. RELATIONS 227
relations. But we should point out certain hidden assumptions. First, they’ll
only work if we are dealing with finite sets, or sets like the odd numbers in
our example (sets that are infinite but could in principle be listed). Second,
by drawing the two sets separately, it seems that we are assuming they are
not only different, but disjoint. The sets not only need not be disjoint, but
often (most of the time!) we have relations that go from a set to itself so
the sets in a picture like this may be identical. In Figure 6.2 we illustrate
the divisibility relation on the set of all divisors of 6 — this is an example in
which the sets on either side of the relation are the same. Notice the linguistic
distinction, we can talk about either “a relation from A to B” (when there
are really two different sets) or “a relation on A” (when there is only one).
1 1
2 2
3 3
6 6
Figure 6.2: The “divides” relation is an example of a relation that goes from
a set to itself. In this example we say that we have a relation on the set of
divisors of 6.
Purists will note that it is really inappropriate to represent the same set
in two different places in a Venn diagram. The diagram in Figure 6.2 should
228 CHAPTER 6. RELATIONS AND FUNCTIONS
A × B = {(a, b) a ∈ A ∧ b ∈ B}
From here on out in your mathematical career you’ll need to take note of
the context that the symbol × appears in. If it appears between numbers go
ahead and multiply, but if it appears between sets you’re doing something
different – forming the Cartesian product.
The familiar x–y plane, is often called the Cartesian plane. This is done
for two reasons. Rene Descartes, the famous mathematician and philosopher,
was the first to consider coordinatizing the plane and thus is responsible for
our current understanding of the relationship between geometry and algebra.
Rene Descartes’ name is also memorialized in the definition of the Cartesian
product of sets, and the plane is nothing more than the product R × R.
Indeed, the plane provided the very first example of the concept that was
later generalized to the Cartesian product of sets.
< = {(x, y) ∈ R × R y − x ∈ R+ }.
aRb.
R = {(a, s), (a, t), (a, n), (e, t), (e, l), (e, n), (i, s), (i, t), (o, r), (o, n), (u, s)}.
Then, for example, because (e, t) ∈ R we can write eRt. We indicate the
negation of the concept that two elements are related by drawing a slash
through the name of the relation, for example the notation 6= is certainly
familiar to you, as is ≮ (although in this latter case we would normally write
≥ instead). We can denote the fact that (a, l) is not a pair that makes the
relation true by writing a6 Rl.
We should mention another way of visualizing relations. When we are
dealing with a relation on R, the relation is actually a subset of R × R, that
means we can view the relation as a subset of the x–y plane. In other words,
we can graph it. The graph of the “<” relation is given in Figure 6.3.
A relation on any set that is a subset of R can likewise be graphed. The
graph of the “|” relation is given in Figure 6.4.
Eventually, we will get around to defining functions as relations that have
a certain nice property. For the moment, we’ll just note that some of the op-
erations that you are used to using with functions also apply with relations.
When one function “undoes” what another function “does” we say the func-
tions are inverses. For example, the function f (x) = 2x (i.e. doubling) and
the function g(x) = x/2 (halving) are inverse functions because, no matter
what number we start with, if we double it and then halve that result, we
6.1. RELATIONS 231
Figure 6.3: The “less than” relation can be viewed as a subset of R × R, i.e.
it can be graphed.
Figure 6.4: The divisibility relation can be graphed. Only those points (as
indicated) with integer coordinates are in the graph.
232 CHAPTER 6. RELATIONS AND FUNCTIONS
end up with the original number. The inverse of a relation R is written R−1
and it consists of the reversals of the pairs in R,
bR−1 a ⇐⇒ aRb.
The process of “doing one function and then doing another” is known as
√
functional composition. For instance, if f (x) = 2x + 1 and g(x) = x, then
we can compose them (in two different orders) to obtain either f (g(x)) =
√ √
2 x + 1 or g(f (x)) = 2x + 1. When composing functions there is an
“intermediate result” that you get by applying the first function to your
input, and then you calculate the second function’s value at the intermediate
result. (For example, in calculating g(f (4)) we get the intermediate result
f (4) = 9 and then we go on to calculate g(9) = 3.)
The definition of the composite of two relations focuses very much on this
idea of the intermediate result. Suppose R is a relation from A to B and S
is a relation from B to C then the composite S ◦ R is given by
symbols f and g appear in the same order. But beware! there are atavists
out there who write their compositions the other way around.
You should probably have a diagram like the following in mind while
thinking about the composition of relations. Here, we have the set A =
{1, 2, 3, 4}, the set B is {a, b, c, d} and C = {w, x, y, z}. The relation R goes
from A to B and consists of the following set of pairs,
R = {(1, a), (1, c), (2, d), (3, c), (3, d)}.
And
1 a w
2 b x
3 c y
4 d z
Exercises — 6.1
4. The “socks and shoes” rule is a very silly little mnemonic for remem-
bering how to invert a composition. If we think of undoing the process
of putting on our socks and shoes (that’s socks first, then shoes) we
have to first remove our shoes, then take off our socks.
The socks and shoes rule is valid for relations as well.
Prove that (S ◦ R)−1 = R−1 ◦ S−1 .
6.2. PROPERTIES OF RELATIONS 235
1. reflexivity
2. symmetry
3. transitivity
1. reflexivity
2. anti-symmetry
3. transitivity
Table 6.1: Properties that relations may (or may not) have.
The digraph of a relation that is reflexive will have little loops at every
vertex. The digraph of a relation that is irreflexive will contain no loops
at all. Hopefully it is clear that these concepts represent extreme opposite
possibilities – they are not however negations of one another.
Exercise. Find the logical denial of the property that says a relation is re-
flexive
¬(∀a ∈ S, aRa).
How does this differ from the defining property for “irreflexive”?
6.2. PROPERTIES OF RELATIONS 237
c
a
d
b
It may be hard at first to understand why the definition we use for anti-
symmetry is the one above. If one wanted to insure that there were never
two-way connections between elements of the set it might seem easier to
define anti-symmetry as follows:
This definition may seem more straight-forward, but it turns out the
original definition is easier to use in proofs. We need to convince ourselves
that the (first) definition really accomplishes what we want. Namely, if a
relation R satisfies the property that ∀a, b ∈ S, aRb ∧ bRa =⇒ a=
b, then there will not actually be any pair of elements that are related in
both orders. One way to think about it is this: suppose that a and b are
distinct elements of S and that both aRb and bRa are true. The property now
guarantees that a = b which contradicts the notion that a and b are distinct.
This is a miniature proof by contradiction; if you assume there are a pair of
6.2. PROPERTIES OF RELATIONS 239
distinct elements that are related in both orders you get a contradiction, so
there aren’t!
A funny thing about the anti-symmetry property is this: When it is true
of a relation it is always vacuously true! The property is engineered in such a
way that when it is true, it forces that the statement in its antecedent never
really happens.
Transitivity is an extremely useful property as witnessed by the fact that
both equivalence relations and ordering relations must have this property.
When speaking of the transitive property of equality we say “Two things that
are equal to a third, are equal to each other.” When dealing with ordering
we may encounter statements like the following. “Since ’Aardvark’ precedes
’Bulwark’ in the dictionary, and since ’Bulwark’ precedes ’Catastrophe’, it is
plainly true that ’Aardvark’ comes before ’Catastrophe’ in the dictionary.”
Again, the definition of transitivity involves a conditional. Also, transi-
tivity may be viewed as the most complicated of the properties we’ve been
studying; it takes three universally quantified variables to state the property.
Exercise. Find logical negations for the formal properties defining each of
the five properties.
6.2. PROPERTIES OF RELATIONS 241
c
a
d
b
If a relation R is irreflexive we will never see a node that does have a loop!
c
a
d
b
c
a
b d
c
a
d
b
c
a
b d
6.2. PROPERTIES OF RELATIONS 243
Exercises — 6.2
2. Consider the relation A defined by A = {(x, y) x has the same astrological sign as y}.
Is A symmetric or anti-symmetric? Explain.
3. Explain why both of the relations just described (in problems 1 and 2)
have the transitive property.
4. For each of the five properties, name a relation that has it and a relation
that doesn’t.
244 CHAPTER 6. RELATIONS AND FUNCTIONS
It’s easy to see that we will get the exact same set if we choose any other
6.3. EQUIVALENCE RELATIONS 245
element of the equivalence class (in place of 11), which leads us to an infinite
list of set equalities,
1 = 6 = 11 = . . .
And similarly,
2 = 7 = 12 = . . .
In fact, there are really just 5 different sets that form the equivalence classes
mod 5: 0, 1, 2, 3, and 4. (Note: we have followed the usual convention of
using the smallest possible non-negative integers as the representatives for
our equivalence classes.)
What we’ve been discussing here is one of the first examples of a quo-
tient structure. We start with the integers and “mod out” by an equivalence
relation. In doing so, we “move to the quotient” which means (in this in-
stance) that we go from Z to a much simpler set having only five elements:
{0, 1, 2, 3, 4}. In moving to the quotient we will generally lose a lot of in-
formation, but greatly highlight some particular feature – in this example,
properties related to divisibility by 5.
Given some equivalence relation R defined on a set S the set of equiva-
lence classes of S under R is denoted S/R (which is read “S mod R”). This
use of the slash – normally reserved for division – shouldn’t cause any con-
fusion since those aren’t numbers on either side of the slash but rather a set
and a relation. This notation may also clarify why some people denote the
equivalence classes above by 0/ ≡5 , 1/ ≡5 , 2/ ≡5 , 3/ ≡5 and 4/ ≡5 .
The set of equivalence classes forms a partition of the set S.
Definition. A partition P of a set S is a set of sets such that
[
S= X and ∀X, Y ∈ P, X 6= Y =⇒ X ∩ Y = ∅.
X∈P
246 CHAPTER 6. RELATIONS AND FUNCTIONS
In words, if you take the union of all the pieces of the partition you’ll
get the set S, and any pair of sets from the partition that aren’t identical
are disjoint. Partitions are an inherently useful way of looking at things,
although in the real world there are often problems (sets we thought were
disjoint turn out to have elements in common, or we discover something that
doesn’t fit into any of the pieces of our partition), in mathematics we usually
find that partitions do just what we would want them to do. Partitions divide
some set up into a number of convenient pieces in such a way that we’re
guaranteed that every element of the set is in one of the pieces and also so
that none of the pieces overlap. Partitions are a useful way of dissecting sets,
and equivalence relations (via their equivalence classes) give us an easy way
of creating partitions – usually with some additional structure to boot! The
properties that make a relation an equivalence relation (reflexivity, symmetry
and transitivity) are designed to ensure that equivalence classes exist and do
provide us with the desired partition. For the beginning proof writer this all
may seem very complicated, but take heart! Most of the work has already
been done for you by those who created the general theory of equivalence
relations and quotient structures. All you have to do (usually) is prove
that a given relation is an equivalence relation by verifying that it is indeed
reflexive, symmetric and transitive. Let’s have a look at another example.
In Number Theory, the square-free part of an integer is what remains
after we divide-out the largest perfect square that divides it. (This is also
known as the radical of an integer.) The following table gives the square-free
part, sf (n), for the first several values of n.
n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
sf (n) 1 2 3 1 5 6 7 2 1 10 11 3 13 14 15 1 17 2 19 5
It’s easy to compute the square-free part of an integer if you know its
prime factorization – just reduce all the exponents mod 2. For example1
1
This is the size of largest sporadic finite simple group, known as “the Monster.”
6.3. EQUIVALENCE RELATIONS 247
808017424794512875886459904961710757005754368000000000
= 246 · 320 · 59 · 76 · 112 · 133 · 17 · 19 · 23 · 29 · 31 · 41 · 47 · 59 · 71
5 · 13 · 17 · 19 · 23 · 29 · 31 · 41 · 47 · 59 · 71
= 3504253225343845
which, while it is still quite a large number, is certainly a good bit smaller
than the original!
We will define an equivalence relation S on the set of natural numbers by
using the square-free part:
In other words, two natural numbers will be S-related if they have the
same square-free parts.
is an equivalence relation on N.
Q.E.D.
Two graphs are said to be isomorphic if they represent the same connec-
tions. There must first of all be a one-to-one correspondence between the
vertices of the two graphs, and further, a pair of vertices in one graph are
connected by some number of edges if and only if the corresponding vertices
in the other graph are connected by the same number of edges.
2
Technically, E is a so-called multiset in many instances – there may be several edges
that connect the same pair of vertices.
250 CHAPTER 6. RELATIONS AND FUNCTIONS
Exercise. The four examples of graphs above actually are two pairs of iso-
morphic graphs. Which pairs are isomorphic?
Exercises — 6.3
1. Consider the relation A defined by A = {(x, y) x has the same astrological sign as y}.
Show that A is an equivalence relation. What equivalence class under
A do you belong to?
3. The two diagrams below both show a famous graph known as the Pe-
tersen graph. The picture on the left is the usual representation which
emphasizes its five-fold symmetry. The picture on the right highlights
the fact that the Petersen graph also has a three-fold symmetry. Label
the right-hand diagram using the same letters (A through J) in order
to show that these two representations are truly isomorphic.
F
E B
J G
I H
D C
5. The relation Q defined in the previous problem partitions the set of all
pairs of integers into an interesting set of equivalence classes. Explain
why
Q = (Z × Z)/Q.
1 2 3 4 6 12
On the other hand, perhaps you noticed these numbers are the divisors of
12. The divisibility relation will give us our first example of a partial order.
2 4
1 12
3 6
12
12
6
4 6
2 3
2
1
1
Figure 6.5: Hasse diagrams of the set {1, 2, 3, 4, 6, 12} totally ordered by ≤
and partially ordered by |.
6.4. ORDERING RELATIONS 257
Figure 6.6: Hasse diagram for the power set of {1, 2, 3} partially ordered by
set containment.
Exercise. Try drawing a Hasse diagram for the partially ordered set
Posets like (P({1, 2, 3}), ⊆) that can be layed out in ranks are known as
graded posets. Things in a graded poset that have the same rank are always
incomparable.
72 = 23 · 32 5
24 = 23 · 31 36 = 22 · 32 4
8 = 23 12 = 22 · 31 18 = 21 · 32 3
4 = 22 6 = 21 · 31 9 = 32 2
21 31 1
1 0
Figure 6.7: Hasse diagram for the divisors of 72, partially ordered by divisi-
bility. This is a graded poset.
which are comparable. Thus, for example, a subset of elements having the
same rank (in a graded poset) is an antichain. Chains and antichains are said
to be maximal if it is not possible to add further elements to them (whilst
maintaining the properties that make them chains and/or antichains). An
element x, that appears above another element y – and connected to it –
in a Hasse diagram is said to cover it. In this situation you may also say
that x is an immediate successor of y. A maximal element is an element
that is not covered by any other element. Similarly, a minimal element is
an element that is not a cover of any other element. If a chain is maximal,
it follows that it must contain both a maximal and a minimal element (with
respect to the surrounding poset). The collection of all maximal elements
forms an antichain, as does (separately) the collection of all minimal elements.
Finally, we have the notions of greatest element (a.k.a. top) and least element
(a.k.a. bottom) – the greatest element is greater than every other element in
the poset, the least element is smaller than every other element. Please be
careful to distinguish these concepts from maximal and minimal elements –
a greatest element is automatically maximal, and a least element is always
minimal, but it is possible to have a poset with no greatest element that
nevertheless has one or more maximal elements, and it is possible to have a
poset with no least element that has one or more minimal elements.
In the poset of divisors of 72, {2, 6, 12, 24} is a chain. Since it would be
possible to add both 1 and 72 to this chain and still have a chain, this chain
is not maximal. (But, of course, {1, 2, 6, 12, 24, 72} is.) On the other hand,
{8, 12, 18} is an antichain (indeed, this is a maximal antichain). This poset
has both a top and a bottom – 1 is the least element and 72 is the greatest
element. Notice that the elements which cover 1 (the least element) are the
prime divisors of 72.
260 CHAPTER 6. RELATIONS AND FUNCTIONS
Exercises — 6.4
Fox Alligator
Cow
Duck Robin
Goose
Grass Worms
1. An (non-maximal) an-
tichain a. Grass
6.5 Functions
The concept of a function is one of the most useful abstractions in mathemat-
ics. In fact it is an abstraction that can be further abstracted! For instance
an operator is an entity which takes functions as inputs and produces func-
tions as outputs, thus an operator is to functions as functions themselves
are to numbers. There are many operators that you have certainly encoun-
tered already – just not by that name. One of the most famous operators is
“differentiation,” when you take the derivative of some function, the answer
you obtain is another function. If two different people are given the same
differentiation problem and they come up with different answers, we know
that at least one of them has made a mistake! Similarly, if two calculations
of the value of a function are made for the same input, they must match.
The property we are discussing used to be captured by saying that a
function needs to be “well-defined.” The old school definition of a function
was:
a v B
A b w
B0
0
A c x = f (c)
d y = f (d)
e z = f (e)
Sadly, only three of the sets we have just discussed are known to the
mathematical world. The set we have denoted A0 is called the domain of
the function f . The set we have denoted B 0 is known as the range of the
function f . The set we have denoted B is called the codomain of the function
6.5. FUNCTIONS 265
f . The set we have been calling A does not have a name. In fact, the formal
definition of the term “function” has been rigged so that there is no difference
between the sets A and A0 . This seems a shame, if you think of range and
domain as being primary, doesn’t it seem odd that we have a way to refer
to a superset of the range (i.e. the codomain) but no way of referring to a
superset of the domain?
Nevertheless, this is just the way it is . . . There is only one set on the
input side – the domain of our function.
The domain of any relation is expressed by writing Dom(R). Which is
defined as follows.
Dom(R) = {a ∈ A ∃b ∈ B, (a, b) ∈ R}
We should point out that the notation just given for the domain of a
relation R, (Dom(R)) has analogs for the other sets that are involved with
a relation. We write Cod(R) to refer the the codomain of the relation, and
Rng(R) to refer to the range.
Since we are now thinking of functions as special classes of relations, it
follows that a function is just a set of ordered pairs. This means that the
identity of a function is tied up, not just with a formula that gives the output
for a given input, but also what values can used for those inputs. Thus the
function f (x) = 2x defined on R is a completely different animal from the
function f (x) = 2x defined on N. If you really want to specify a function
precisely you must give its domain as well as a formula for it. Usually, one
does this by writing a formula, then a semicolon, then the domain. (E.g.
f (x) = x2 ; x ≥ 0.)
Okay, so, finally, we are prepared to give the real definition of a function.
266 CHAPTER 6. RELATIONS AND FUNCTIONS
Recapping, a function must have its domain equal to the set A where its
inputs come from. This is sometimes expressed by saying that a function is
defined on its domain. A function’s range and codomain may be different
however. In the event that the range and codomain are the same (Cod(R) =
Rng(R)) we have a rather special situation and the function is graced by the
appellation “surjection.” The term “onto” is also commonly used to describe
a surjective function.
In terms of graphs, the inverse and the original relation are related by
being reflections in the line y = x. It is possible for one, both, or neither of
these to be functions. The canonical example to keep in mind is probably
f (x) = x2 and its inverse.
of a function doesn’t necessarily pass the vertical line test, and it turns out
that that is the predominant issue. So, under what circumstances does the
inverse pass the vertical line test? When the original function passes the so-
called horizontal line test (every horizontal line intersects the graph at most
once). Thinking again about f (x) = x2 , there are some horizontal lines that
miss the graph entirely, but all horizontal lines of the form y = c where c
is positive will intersect the graph twice. There are many functions that do
pass the horizontal line test, for instance, consider f (x) = x3 . Such functions
are known as injections, this is the same thing as saying a function is “one-to-
one.” Injective functions can be inverted – the domain of the inverse function
of f will only be the range, Rng(f ), which as we have seen may fall short of
the being the entire codomain, since Rng(f ) ⊆ Cod(f ).
Let’s first define injections in a way that is divorced from thinking about
their graphs.
Definition. A function f (x) is an injection iff for all pairs of inputs x1 and
x2 , if f (x1 ) = f (x2 ) then x1 = x2 .
maps between sets and then proving that they are bijections, so we will start
practicing that skill now. . .
Ordinarily, we will show that a function is a bijection by proving sepa-
rately that it is both a surjection and an injection.
To show that a function is surjective we need to show that it is possible
to find a preimage for every element of the codomain. If we happen to know
what the inverse function is, then it is easy to find a preimage for an arbi-
trary element. In terms of the taxonomy for proofs that was introduced in
Chapter 3, we are talking about a constructive proof of an existential state-
ment. A function f is surjective iff ∀y ∈ Cod(f ), ∃x ∈ Dom(f ), y = f (x), so
to prove surjectivity is to find the x that “works” for an arbitrary y. If this
is done by literally naming x, we have proved the statement constructively.
To show that a function is an injection, we traditionally prove that the
property used in the definition of an injective function is true. Namely, we
suppose that x1 and x2 are distinct elements of Dom(f ) and that f (x1 ) =
f (x2 ) and then we show that actually x1 = x2 . This is in the spirit of a proof
by contradiction – if there were actually distinct elements that get mapped to
the same value then f would not be injective, but by deducing that x1 = x2
we are contradicting that presumption and so, are showing that f is indeed
an injection.
Let’s start by looking at a very simple example, f (x) = 2x − 1; x ∈ N.
Clearly this function is not a surjection if we are thinking that Cod(f ) = N
since the outputs are always odd. Let O = {1, 3, 5, 7, . . .} be the set of odd
naturals.
Since the cases y > 0 and y ≤ 0 are exhaustive (that is, every y
in Z falls into one or the other of these cases), and we have found
a preimage for y in both cases, it follows that f is surjective.
x2 − 1 ≥ 0
(x2 − 1)/2 ≥ 0
−(x2 − 1)/2 ≤ 0
f (x2 ) ≤ 0
Q.E.D.
We’ll conclude this section by mentioning that the ideas of “image” and
“preimage” can be extended to sets. If S is a subset of Dom(f ) then the
image of S under f is denoted f (S) and
f −1 (T ) = {x ∃y ∈ Cod(f ), y ∈ T ∧ y = f (x)}.
Exercises — 6.5
1. Find a bijection from the set of odd squares, {1, 9, 25, 49, . . .}, to the
non-negative integers, Znoneg = {0, 1, 2, 3, . . .}. Prove that the function
you just determined is both injective and surjective. Find the inverse
function of the bijection above.
Z x
1
ln(x) = dt.
t=1 t
We can use the above definition with x = 2 to find the value of ln(2) ≈
.693. We will also take as given the following rule (which is valid for
all logarithmic functions).
ln(ab ) = b ln(a)
Use the above information to show that there is neither an upper bound
nor a lower bound for the values of the natural logarithm. These facts
together with the information that ln is strictly increasing show that
Rng(ln) = R.
0 1 2 3 4 5 6 7 8
1 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1
f D
= {(x, y) x ∈ D ∧ (x, y) ∈ f }.
If we restrict the domain of the sine function to the closed interval [−π/2, π/2],
we have an invertible function. The inverse of this restricted function is the
function we know as sin−1 (x) or arcsin(x). The domain and range of sin−1 (x)
are (respectively) the intervals [−1, 1] and [−π/2, π/2].
Notice that if we choose a number x in the range −1 ≤ x ≤ 1 and apply
the inverse sine function to it, we will get a number between −π/2 and π/2
278 CHAPTER 6. RELATIONS AND FUNCTIONS
The winding map is a function that goes from R to the unit circle in the
x–y plane, defined by
One can think of this map as literally winding the infinitely long real line
around and around the circle. Obviously, this is not an injection – there are
an infinite number of values of t that get mapped to (for instance) the point
(1, 0), t can be any integer multiple of 2π.
Exercise. Suppose (x, y) represents a point on the unit circle. If (x, y) hap-
pens to lie on one of the coordinate axes we have
6.6. SPECIAL FUNCTIONS 279
W −1 ((1, 0)) = 0
W −1 ((0, 1)) = π/2
W −1 ((−1, 0)) = π
W −1 ((0, −1)) = 3π/2.
This last example that we have done (the winding map) was unusual in
that the outputs were ordered pairs. In thinking of this map as a relation
(that is, as a set of ordered pairs) we have an ordered pair in which the second
element is an ordered pair! Just for fun, here is another way of expressing
the winding map:
π1 ((x, y)) = x.
1S : D −→ {0, 1}
(
1 if x ∈ S
1S (x) =
0 otherwise
Exercise. If you have the characteristic function of a subset S, how can you
create the characteristic function of its complement, S.
(
1 if P (x)
[P (x)] =
0 otherwise
24
X
[2 | i] + [3 | i] − [6 | i]
i=1
282 CHAPTER 6. RELATIONS AND FUNCTIONS
(
1 if i = j
δij =
0 otherwise
number .01 is the base-2 representation of 1/3, from this it is easy to see that
.01 is the image of the set of odd naturals, {1, 3, 5, . . .}.
Exercise. Find the binary representation for the real number which is the
image of the set of even numbers under φ.
Exercise. Find the binary representation for the real number which is the
image of the set of triangular numbers under φ. (Recall that the triangular
numbers are T = {1, 3, 6, 10, 15, . . .}.)
284 CHAPTER 6. RELATIONS AND FUNCTIONS
Exercises — 6.6
2. The usual algebraic procedure for inverting T (x) = (x2 +x)/2 fails. Use
your knowledge of the geometry of functions and their inverses to find
a formula for the inverse. (Hint: it may be instructive to first invert
the simpler formula S(x) = x2 /2 — this will get you the right vertical
scaling factor.)
3. What is π2 (W (t))?
10
X 1
· [i is prime].
i=1
i
286 CHAPTER 6. RELATIONS AND FUNCTIONS
Chapter 7
Tragedy is when I cut my finger. Comedy is when you fall into an open sewer
and die. –Mel Brooks
7.1 Counting
Many results in mathematics are answers to “How many . . . ” questions.
“How many subsets does a finite set have?”
“How many handshakes will transpire when n people first meet?”
“How many functions are there from a set of size n to a set of size m?”
The title of this section, “Counting,” is not intended to evoke the usual
process of counting sheep, or counting change. What we want is to be able
to count some collection in principle so that we will be able to discover a
formula for its size.
There are two principles that will be indispensible in counting things.
These principles are simple, yet powerful, and they have been named in the
most unimaginative way possible. The “multiplication rule” which tells us
287
288 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
when we should multiply, and the “addition rule” which tells us when we
should add.
Before we describe these principles in detail, we’ll have a look at a simpler
problem which is most easily described by an example: How many integers
are there in the list (7, 8, 9, . . . 44)? We could certainly write down all the
integers from 7 to 44 (inclusive) and then count them – although this wouldn’t
be the best plan if the numbers 7 and 44 were replaced with (say) 7, 045, 356
and 22, 355, 201. A method that does lead to a generalized ability to count
the elements of a finite sequence arises if we think carefully about what
exactly a finite sequence is.
Now it is easy to see that there are n+1 elements in the set {0, 1, 2, . . . , n}
so counting the elements of a finite sequence will be easy if we can determine
the function involved and figure out what n is by inverting it (n is an inverse
image for the last element in a listing of the sequence).
In the example that we started with, the function is f (x) = x + 7. We
can sum up the process that allows us to count the sequence by saying “there
is a one-to-one correspondence between the lists
(7, 8, 9, . . . , 44)
and
(0, 1, 2, . . . , 37)
Exercise. How many integers are in the list (25, 36, 49, . . . , 10000) ?
We will have a lot more practice with counting the elements of sequences
in the exercises at the end of this section, let’s continue on our tour of count-
ing by having a look at the addition rule.
The addition rule says that it is appropriate to add if we can partition a
collection into disjoint pieces. In other words, if a set S is the union of two
or more subsets and these subsets are mutually disjoint, we can find the size
of S by adding the sizes of the subsets.
In the game Yahtzee, one rolls 5 dice and (optionally) performs a second
roll of some or all of the dice. The object is to achieve several final con-
figurations that are modelled after the hands in Poker. In particular, one
configuration, known as a “full house,” is achieved by having two of one
number and three of another. (Colloquially, we say “three-of-a-kind plus a
pair is a full house.”)
Now, we could use Yahtzee “hands” to provide us with a whole collection
of counting problems once we have our basic counting principles, but for
the moment we just want to make a simple (and obvious) point about “full
houses” – the pair is either smaller or larger than the three-of-a-kind. This
means we can partition the set of all possible full houses into two disjoint
sets – the full houses consisting of a small pair and a larger three-of-a-kind
and those where the pair is larger than the three-of-a-kind. If we can find
some way of counting these two cases seperately, then the total number of
full houses will be the sum of these numbers.
290 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Figure 7.1: In Yahtzee, a full house may consist of a pair and a larger three-
of-a-kind, or vice versa.
there is just one number remaining to put in the third position1 . Thus there
are 3 · 2 · 1 = 6 permutations of a 3 element set.
The general rule is that there are n! permutations of {1, 2, . . . , n}.
There are times when configurations that are like permutations (in that
they are ordered and have no duplicates) but don’t consist of all n numbers
are useful.
There are certain natural limitations on the value of k, for instance k can’t
be negative – although (arguably) k can be 0, it makes more sense to think
of k being at least 1. Also, if k exceeds n we won’t be able to find any k-
permutations, since it will be impossible to meet the “distinct” requirement.
If k and n are equal, there is no difference between a k-permutation and an
ordinary permutation. Therefore, we ordinarily restrict k to lie in the range
0 < k < n.
The notation P (n, k) is used for the total number of k-permutations of
a set of size n. For example, P (4, 2) is 12, since there are twelve different
ordered pairs having distinct entries where the entries come from {1, 2, 3, 4}.
Exercise. Write down all twelve 2-permutations of the 4-set {1, 2, 3, 4}.
(n, n − 1, n − 2, . . . n − k + 1).
(n − 0, n − 1, n − 2, . . . n − (k − 1)).
Let’s have a look at another small example – P (8, 4). There will be 8
choices for the first entry in a 4-tuple, 7 choices for the second entry, 6 choices
for the third entry and 5 choices for the last entry. (Note that 5 = 8 − 4 + 1.)
Thus P (8, 4) = 8 · 7 · 6 · 5 = 1680.
Finally, we should take note that it is relatively easy to express P (n, k)
using factorials. If we divide a number factorialized by some smaller number
factorialized, we will get a descending product just like those above.
n!
The general rule is that P (n, k) = (n−k)!
.
If we were playing a card game in which we were dealt 5 cards from a deck
of 52, we would receive our cards in the form of P (52, 5) = 52·51·50·49·48 =
311875200 ordered 5-tuples. Normally, we don’t really care about what order
the cards came to us in. In a card game one ordinarily begins sorting the
cards so as to see what hand one has – this is a sure sign that the order the
cards were dealt is actually immaterial. How many different orders can five
cards be put in? The answer to this question is 5! = 120 since what we are
discussing is nothing more than a permutation of a set of size 5. Thus, if we
say that there are 311,875,200 different possible hands in 5-card poker, we
are overcounting things by quite a bit! Any given hand will appear 120 times
in that tabulation, which means the right value is 311875200/120 = 2598960.
7.1. COUNTING 293
Okay, so there around 2.6 million different hands in 5-card poker. Unless
you plan to become a gambler this isn’t really that useful of a piece of in-
formation – but if you generalize what we’ve done in the paragraph above,
you’ll have found a way to count unordered collections of a given size taken
from a set.
A k-combination from an n-set is an unordered selection, without rep-
etitions, of k things out of n. This is the exact same thing as a subset of
size k of a set of size n, and the number of
such
things is denoted by several
n
different notations – C(n, k), nCk and among them2 . We can come
k
up with a formula for C(n, k) by a slightly roundabout argument. Suppose
we think of counting the k-permutations of n things using the multiplicaton
rule in a different way then we have previously. We’ll build a k-permutation
in two stages. First we’ll choose k symbols to put into our permutation –
which can be done in C(n, k) ways. And second, we’ll put those k sym-
bols into a particular order – which can be accomplished in k! ways. Thus
n!
P (n, k) = C(n, k) · k!. Since we already know that P (n, k) = (n−k)!
, we can
substitute and solve to obtain
n!
C(n, k) = .
k! · (n − k)!
It is possible to partition many counting problems into 4 “types” based
on the answers to two questions:
Is order important in the configurations being counted?
Are we allowed to have repeated elements in a configuration?
Suppose that we are in the general situation of selecting k things out of
a set of size n. It should be possible to write formulas involving n and k in
the four cells of the following table.
n n
2
Watch out for the notation, it is easy to confuse it with the fraction
k k . They
are not the same — the fraction bar is supposed to be missing in nk .
294 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
so it would seem that we’re claiming that this problem is really unordered
selection without repetition of 6 things out of 20. Well, actually, some parts
of this are clearly right – we are selecting 6 things from a set of size 20, and
because our sequences are supposed to be strictly increasing there will be no
repetitions – but, a strictly increasing sequence is clearly ordered and the
formula we are using is for unordered collections.
By specifying a particular ordering (strictly increasing) on the sequences
we are counting above, we are actually removing the importance of order.
Put another way: if order really mattered, the symbols 1 through 6 could
be put into 720 differenct orders – but we only want to count one of those
possibilities. Put another other way: there is a one-to-one correspondence
between a 6-subset of {1, 2, 3, . . . 20} and a strictly increasing sequence. Just
make sure the subset is written in increasing order!
Okay, at this point we have filled-in three out of the four cells in our table.
Yes No
No
Are repeats okay?
n! n!
P (n, k) = (n−k)!
C(n, k) = k!(n−k)!
Yes
nk
7.1. COUNTING 297
What kinds of things are we counting in the lower right part of the table?
Unordered selections of k things out of n possibilities where there may (or
may not!) be repetitions. The game Yahtzee provides a nice example of
this type of configuration. When we roll 5 dice, we do not do so one-at-
a-time, rather, we roll them as a group – the dice are indistinguishable so
there is no way to order our set of 5 outcomes. In fact, it would be quite
reasonable to, after one’s roll, arrange the die in (say) increasing order. We’ll
repeat a bit of advice that was given previously: if one is free to rearrange a
configuration to suit one’s needs, that is a clue that order is not important
in the configurations under consideration. Finally, are repetitions allowed?
The outcomes in Yahtzee are 5 numbers from the set {1, 2, 3, 4, 5, 6}, and
while it is possible to have no repetitions, that is a pretty special outcome!
In general, the same number can appear on two, or several, or even all 5 of
the die4 .
So, how many different outcomes are there when one rolls five dice? To
answer this question it will be helpful to think about how we might express
such an outcome. Since order is unimportant, we can choose to put the
numbers that appear on the individual die in whatever order we like. We
may as well place them in increasing order. There will be 5 numbers and
each number is between 1 and 6. We can list the outcomes systematically by
starting with an all-ones Yahtzee:
rangements?
, , , , , , ,,,, ,,,,,
What blank-comma arrangements correspond to the following Yahtzee out-
comes?
{2, 3, 4, 5, 6} {3, 3, 3, 3, 4} {5, 5, 6, 6, 6}
It may seem at first that this blank-comma thing is okay, but that we’re
still no closer to answering the question we started with. It may seem that
way until you realize how easy it is to count these blank-comma arrange-
ments! You see, there are 10 symbols in one of these blank-comma arrange-
ments and if we choose positions for (say) the commas, the blanks will have to
go into the other positions – thus every 5-subset of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
gives us a blank-comma arrangement and every one of them gives us a Yahtzee
outcome. That is why there are C(10, 5) = 252 outcomes listed in the giant
tabulation above.
In general, when we are selecting k things from a set of size n (with repeti-
tion and without order) we will need to consider blank-comma arrangements
having k blanks and n−1 commas. As an aid to memory, consider that when
you actually write-out the elements of a set it takes one fewer commas than
there are elements – for example {1, 2, 3, 4} has 4 elements but we only need
3 commas to separate them. The general answer to our problem is either
C(k + n − 1, k) or C(k + n − 1, n − 1), depending on whether you want to
think about selecting positions for the k blanks or for the n − 1 commas.
It turns out that these binomial coefficients are equal so there’s no problem
with the apparent ambiguity.
So, finally, our table of counting formulas is complete. We’ll produce it
here one more time and, while we’re at it, ditch the C(n, k) notation in favor
of the more usual “binomial coefficient” notation nk .
7.1. COUNTING 301
Yes No
No
Are repeats okay?
n! n n!
Yes P (n, k) = (n−k)! k
= k!(n−k)!
n+k−1
nk k
302 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Exercises — 7.1
2. How many “full houses” are there in Yahtzee? (A full house is a pair
together with a three-of-a-kind.)
6. How many “words” are there of length 4, with distinct letters from the
Cryptographer’s alphabet, in which the letters appear in increasing
order alphabetically? (“Acef” would be one such word, but “cafe”
would not.)
7.1. COUNTING 303
10. How many functions are there from a set of size n to a set of size m?
11. How many relations are there from a set of size n to a set of size m?
304 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
This section is concerned with two very powerful elements of the proof-
making arsenal: “Parity” is a way of referring to the result of an even/odd
calculation; Counting arguments most often take the form of counting some
collection in two different ways – and then comparing those results. These
techniques have little to do with one another, but when they are applicable
they tend to produce really elegant little arguments.
In (very) early computers and business machines, paper cards were used
to store information. A so-called “punch card” or “Hollerith card” was used
to store binary information by means of holes punched into it. Paper tape
was also used in a similar fashion. A typical paper tape format would involve
8 positions in rows across the tape that might or might not be punched,
often a column of smaller holes would appear as well which did not store
information but were used to drive the tape through the reading mechanism
on a sprocket. Tapes and cards could be “read” either by small sets of
electrical contacts which would touch through a punched hole or be kept
separate if the position wasn’t punched, or by using a photo-detector to sense
whether light could pass through the hole or not. The mechanisms for reading
and writing on these paper media were amazingly accurate, and allowed early
data processing machines to use just a couple of large file cabinets to store
what now fits in a jump drive one can wear on a necklace. (About 10 or 12
cabinets could hold a gigabyte of data).
Paper media was ideally suited to storing binary information, but of
course most of the real data people needed to store and process would be
alphanumeric5 . There were several encoding schemes that served to trans-
late between the character sets that people commonly used and the binary
5
“Alphanumeric” is a somewhat antiquated term that refers to information containing
both alphabetic characters and numeric characters – as well as punctuation marks, etc.
7.2. PARITY AND COUNTING ARGUMENTS 305
numerals that could be stored on paper. One of these schemes still survives
today – ASCII. The American Standard Code for Information Interchange
uses 7-bit binary numerals to represent characters, so it contains 128 different
symbols. This is more than enough to represent both upper- and lower-case
letters, the 10 numerals, and the punctuation marks – many of the remaining
spots in the ASCII code were used to contain so-called “control characters”
that were associated with functionality that appeared on old-fashioned tele-
type equipment – things like “ring the bell,” “move the carriage backwards
one space,” “move the carriage to the next line,” etc. These control charac-
ters are why modern keyboards still have a modifier key labelled “Ctrl” on
them. The following listing gives the decimal and binary numerals from 0 to
127 and the ASCII characters associated with them – the non-printing and
control characters have a 2 or 3 letter mnemonic designation.
0 0000 0000 NUL 64 0100 0000 @
1 0000 0001 SOH 65 0100 0001 A
2 0000 0010 STX 66 0100 0010 B
3 0000 0011 ETX 67 0100 0011 C
4 0000 0100 EOT 68 0100 0100 D
5 0000 0101 ENQ 69 0100 0101 E
6 0000 0110 ACK 70 0100 0110 F
7 0000 0111 BEL 71 0100 0111 G
8 0000 1000 BS 72 0100 1000 H
9 0000 1001 TAB 73 0100 1001 I
10 0000 1010 LF 74 0100 1010 J
11 0000 1011 VT 75 0100 1011 K
12 0000 1100 FF 76 0100 1100 L
13 0000 1101 CR 77 0100 1101 M
14 0000 1110 SO 78 0100 1110 N
15 0000 1111 SI 79 0100 1111 O
16 0001 0000 DLE 80 0101 0000 P
17 0001 0001 DC1 81 0101 0001 Q
18 0001 0010 DC2 82 0101 0010 R
19 0001 0011 DC3 83 0101 0011 S
20 0001 0100 DC4 84 0101 0100 T
21 0001 0101 NAK 85 0101 0101 U
22 0001 0110 SYN 86 0101 0110 V
306 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Now it only takes 7 bits to encode the 128 possible values in the ASCII
system, which can easily be verified by noticing that the left-most bits in all
of the binary representations above are 0. Most computers use 8 bit words
or “bytes” as their basic units of information, and the fact that the ASCII
code only requires 7 bits lead someone to think up a use for that additional
bit. It became a “parity check bit.” If the seven bits of an ASCII encoding
have an odd number of 1’s, the parity check bit is set to 1 — otherwise, it is
set to 0. The result of this is that, subsequently, all of the 8 bit words that
encode ASCII data will have an even number of 1’s. This is an example of a
so-called error detecting code known as the “even code” or the “parity check
code.” If data is sent over a noisy telecommunications channel, or is stored
in failable computer memory, there is some small but calculable probability
that there will be a “bit error.” For instance, one computer might send
10000111 (which is the ASCII code that says “ring the bell”) but another
machine across the network might receive 10100111 (the 3rd bit from the left
has been received in error) now if we are only looking at the rightmost seven
bits we will think that the ASCII code for a single quote has been received,
but if we note that this piece of received data has an odd number of ones
we’ll realize that something is amiss. There are other more advanced coding
schemes that will let us not only detect an error, but (within limits) correct
it as well! This rather amazing feat is what makes wireless telephony (not
to mention communications with deep space probes — whoops! I mentioned
it) work.
The concept of parity can be used in many settings to prove some fairly
remarkable results.
In Section 6.3 we introduced the idea of a graph. This notion was first
used by Leonhard Euler to solve a recreational math problem posed by the
citizens of Königsberg, Prussia (this is the city now known as Kaliningrad,
Russia.) Königsberg was situated at a place where two branches of the
308 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Pregel river6 come together – there is also a large island situated near this
confluence. By Euler’s time, the city of Königsberg covered this island as well
as the north and south banks of the river and also the promontory where the
branches came together. A network of seven bridges had been constructed
to connect all these land masses. The townsfolk are alleged to have become
enthralled by the question of whether it was possible to leave one’s home
and take a walk through town which crossed each of the bridges exactly once
and, finally, return to one’s home.
Euler settled the question (it can’t be done) be converting the map of
Königsberg into a graph and then making some simple observations about
the parities of the nodes in this graph. The degree of a node in a graph is the
number of edges that are incident with it (if a so-called “loop edge” is present
it adds two to the node’s degree). The “parity of a node” is shorthand for
6
Today, this river is known as the Pregolya.
7.2. PARITY AND COUNTING ARGUMENTS 309
The graph of Königsberg has 4 nodes: one of degree 5 and three of degree
3. All the nodes are odd. Would it be possible to either modify Königsberg
or come up with an entirely new graph having some even nodes? Well,
the answer to that is easy – just tear down one of the bridges, and two of
the nodes will have their degree changed by one; they’ll both become even.
Notice that, by removing one edge, we effected the parity of two nodes. Is
it possible to create a graph with four nodes in which just one of them is
even? More generally, given any short list of natural numbers, is it possible
to draw a graph whose degrees are the listed numbers?
Exercise. Try drawing graphs having the following lists of vertex degrees.
(In some cases it will be impossible. . . )
- {1, 1, 2, 3, 3}
- {1, 2, 3, 5}
- {1, 2, 3, 4}
310 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
- {4, 4, 4, 4, 5}
- {3, 3, 3, 3}
- {3, 3, 3, 3, 3}
Exercise. (If you didn’t do the last exercise, stop being such a lame-o and
try it now. BTW, if you did do it, good for you! You can either join with
me now in sneering at all those people who are scurrying back to do the last
one, or try the following:)
Figure out a way to distinguish a sequence of numbers that can be the
degree sequence of some graph from the sequences that cannot be.
Okay, now if you’re reading this sentence you should know that every
other list of vertex degrees above is impossible, you should have graphs drawn
in the margin here for the 1st, 3rd and 5th degree sequences, and you may
have discovered some version of the following
A slightly pithier statement is: All graphs have an even number of odd
nodes.
We’ll leave the proof of this theorem to the exercises but most of the work
is done in proving the following equivalent result.
7.2. PARITY AND COUNTING ARGUMENTS 311
Theorem 7.2.2. In an undirected graph the sum of the degrees of the vertices
is even.
X
deg(v),
v∈V (G)
Thus,
X
deg(v) = 2 · |E(G)|.
v∈V (G)
Q.E.D.
The question of whether a graph having a given list of vertex degrees can
exist comes down to an elegant little argument using both of the techniques
in the title of this section. We count the edge set of the graph in two ways –
once in the usual fashion and once by summing the vertex degrees; we also
note that since this latter count is actually a double count we can bring in
the concept of parity.
Another perfectly lovely argument involving parity arises in questions
concerning whether or not it is possible to tile a pruned chessboard with
dominoes. We’ve seen dominoes before in Section 5.1 and we’re just hoping
you’ve run across chessboards before. Usually a chessboard is 8 × 8, but we
would like to adopt a more liberal interpretation that a chessboard can be
312 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Both of these situations satisfy the basic necessary condition that the
number of squares on the board must be even. You may be able to deter-
mine another “parity” approach to these tiling problems by attempting the
following
7
The game known as “draughts” in the UK and “checkers” in the US is played on an
8 × 8 board, but (for example) international draughts is played on a 10 × 10 board and
Canadian checkers is played on a 12 × 12 board.
7.2. PARITY AND COUNTING ARGUMENTS 313
Exercise. Below are two five-by-five chessboards each having a single square
pruned. One can be tiled by dominoes and the other cannot. Which is which?
1 6 8
5 7 3
9 2 4
The definition of a magic square requires that the rows and columns sum
to the same number but says nothing about what that number must be.
It is conceivable that we could produce magic squares (of the same order)
having different magic sums. This is conceivable, but in fact the magic sum
is determined completely by n.
n3 + n
Theorem 7.2.3. A magic square of order n has a magic sum equal to .
2
S = 1 + 2 + 3 + . . . + n2 .
Pk
Using the formula for the sum of the first k naturals ( i=1 i=
k2 +k
2
) and evaluating at n2 gives
n4 + n2
S= .
2
S = nM.
n4 + n2
nM = ,
2
therefore
n3 + n
M= .
2
Q.E.D.
316 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Exercises — 7.2
2. Complete the proof of the fact that “Every graph has an even number
of odd nodes.”
5. The five tetrominoes (familiar to players of the video game Tetris) are
relatives of dominoes made up of four small squares.
pigeonholes
Q.E.D.
7.3. THE PIGEONHOLE PRINCIPLE 323
Exercises — 7.3
1. The statement that there are two non-bald New Yorkers with the same
number of hairs on their heads requires some careful estimates to justify
it. Please justify it.
2. A mathematician, who always rises earlier than her spouse, has de-
veloped a scheme – using the pigeonhole principle – to ensure that
she always has a matching pair of socks. She keeps only blue socks,
green socks and black socks in her sock drawer – 10 of each. So as
not to wake her husband she must select some number of socks from
her drawer in the early morning dark and take them with her to the
adjacent bathroom where she dresses. What number of socks does she
choose?
4. Given any set of 53 integers, show that there are two of them having
the property that either their sum or their difference is evenly divisible
by 103.
5. Prove that if 10 points are placed inside a square of side length 3, there
√
will be 2 points within 2 of one another.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
et cetera.
The thing that makes this triangle so nice and that leads to the strange
name “binomial coefficients” for the number of k-combinations of a n-sets is
that you can use the triangle to (very quickly) compute powers of binomials.
A binomial is a polynomial with two terms. Things like (x + y), (x + 1)
and (x7 + x3 ) all count as binomials but to keep things simple just think
about (x + y). If you need to compute a large power of (x + y) you can just
multiply it out, for example, think of finding the 6th power of (x + y).
We can use the F.O.I.L rule to find (x + y)2 = x2 + 2xy + y 2 . Then
(x + y)3 = (x + y) · (x + y)2 = (x + y) · (x2 + 2xy + y 2 ).
You can compute that last product either by using the distributive law
or the table method:
x2 +2xy +y 2
x
+y
For this product I wouldn’t even think about the distributive law, I’d
jump to the table method right away:
x3 +3x2 y +3xy 2 +y 3
x3
+3x2 y
+3xy 2
+y 3
Now all of this is a lot of work and it’s really much easier to notice the
form of the answer: The exponent on x starts at 6 and descends with each
successive term down to 0. The exponent on y starts at 0 and ascends to 6.
The coefficients in the answer are the numbers in the sixth row of Pascal’s
triangle.
Finally, the form of Pascal’s triangle makes it really easy to extend. A
number in the interior of the triangle is always the sum of the two above
it (on either side). Numbers that aren’t in the interior of the triangle are
always 1.
We showed rows 0 through 6 above. Rows 7 and 8 are
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1.
7.4. THE ALGEBRA OF COMBINATIONS 327
Exercise. Given the method using Pascal’s triangle for computing (x + y)n
we can use substitution to determine more general binomial powers.
Find (x4 + x2 )5 .
All of the above hinges on the fact that one can compute a binomial
coefficient by summing the two that appear to either side and above it in
Pascal’s triangle. This fact is the fundamental relationship between binomial
coefficients – it is usually called Pascal’s formula.
will partition these k-subsets into two disjoint cases: those that
contain the final number, n, and those that do not.
Let
A = {S ⊆ N |S| = k ∧ n ∈
/ S}
and, let
B = {S ⊆ N |S| = k ∧ n ∈ S}.
328 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
n
= |A| + |B|.
k
The set A is really just the set of all k-subsets of the (n − 1)-set
{1, 2, 3, . . . , n − 1}, so |A| = n−1
k
.
n−1 n−1
+ .
k k−1
n−1 n−1
+
k k−1
(n − 1)! (n − 1)!
= +
k!(n − 1 − k)! (k − 1)!((n − 1) − (k − 1))!
(n − 1)! (n − 1)!
= +
k!(n − k − 1)! (k − 1)!(n − k)!
7.4. THE ALGEBRA OF COMBINATIONS 329
(n − k + k)(n − 1)!
=
k!(n − k)!
(n)(n − 1)!
=
k!(n − k)!
n!
= .
k!(n − k)!
n
We recognize the final expression as the definition of k
, so we
have proved that
n−1 n−1 n
+ = .
k k−1 k
Q.E.D.
330 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Proof:
n n!
k· =k· .
k k!(n − k)!
n n!
k· = .
k (k − 1)!(n − k)!
n (n − 1)!
k· =n· ,
k (k − 1)!(n − k)!
n (n − 1)! n−1
k· =n· =n·
k (k − 1)!((n − 1) − (k − 1))! k−1
Q.E.D.
7.4. THE ALGEBRA OF COMBINATIONS 331
tion.
Thus,
n n−1
k· =n·
k k−1
Q.E.D.
9
For example, a committee of k individuals one of whom has been chosen as chairper-
son, is an example of the kind of entity we are discussing.
332 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
The final result that we’ll talk about actually has (at least) three proofs.
One of which suffers from the fault that it is “like swatting a fly with a sledge
hammer.”
The result concerns the sum of all the numbers in some row of Pascal’s
triangle.
n
X n
= 2n
k=0
k
Theorem 7.4.4 (The Binomial Theorem). For all natural numbers n, and
real numbers x and y,
n
n
X n n−k k
(x + y) = x y .
k=0
k
We won’t be proving this result just now. But, the following proof is a
proof of the previous theorem using this more powerful result.
P(N ) = S0 ∪ S1 ∪ S2 ∪ . . . ∪ Sn ,
n n n n n
2 = + + + ... + .
0 1 2 n
Q.E.D.
334 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Exercises — 7.4
3. Find (x2 + y 2 )6 .
1 1
1
2 1
1
2
2 1
3 1
3
1 3
6
3 3
3 1
combinatorially.
n
n
X n
∀n ∈ N, ∀x, y ∈ R, (x + y) = xn−k y k
k=0
k
336 CHAPTER 7. PROOF TECHNIQUES III — COMBINATORICS
Chapter 8
Cardinality
337
338 CHAPTER 8. CARDINALITY
• Since the empty set is unique – ; is the only set having 0 elements – it
follows that there are no other sets equivalent to it.
Definition. (Well . . . not quite.) For all sets A and B, we say A and B
are equivalent, and write A ≡ B iff |A| = |B|.
Consider the solmization syllables used for the notes of the major scale in
music; they form the set {do, re, mi, fa, so, la, ti}. What are we doing when
we count this set (and presumably come up with a total of 7 notes)? We first
point at ‘do’ while saying ‘one,’ then point at ‘re’ while saying ‘two,’ et cetera.
In a technical sense we are creating a one-to-one correspondence between the
set containing the seven syllable and the special set {1, 2, 3, 4, 5, 6, 7}. You
should notice that this one-to-one correspondence is by no means unique. For
instance we could have counted the syllables in reverse — a descending scale,
or in some funny order – a little melody using each note once. The fact that
there are seven syllables in the solmization of the major scale is equivalent
to saying that there exists a one-to-one correspondence between the syllables
and the special set {1, 2, 3, 4, 5, 6, 7}. Saying “there exists” in this situation
may seem a bit weak since in fact there are 7! = 5040 correspondences, but
“there exists” is what we really want here. What exactly is a one-to-one
correspondence? Well, we’ve actually seen such things before – a one-to-one
correspondence is really just a bijective function between two sets. We’re
finally ready to write a definition that Georg Cantor would approve of.
Definition. For all sets A and B, we say A and B are equivalent, and write
A ≡ B iff there exists a one-to-one (and onto) function f , with Dom(f ) = A
and Rng(f ) = B.
Somewhat more succinctly, one can just say the sets are equivalent iff
there is a bijection between them.
We are going to ask you to prove that the above definition defines an
equivalence relation in the exercises for this section. In order to give you a
bit of a jump start on that proof we’ll outline what the proof that the relation
is symmetric should look like.
The above is just a sketch of a proof. In the exercise you’ll need to fill
in the rest of the details as well as provide similar arguments for reflexivity
and transitivity. For each possible finite cardinality k, there are many, many
sets having that cardinality, but there is one set that stands out as the most
basic – the set of numbers from 1 to k. For each cardinality k > 0, we use
the symbol Nk to indicate this set:
Nk = {1, 2, 3, . . . , k}.
The finite cardinalities are the equivalence classes (under the relation of
set equivalence) containing the empty set and the sets Nk . Of course there
are also infinite sets! The prototype for an infinite set would have to be
N. The long-standing tradition is to use the symbol ℵ0 3 for the cardinality
of sets having the same size as N, alternatively, such sets are known as
“countable.” One could make a pretty good argument that it is the finite sets
that are actually countable! After all it would literally take forever to count
3
The Hebrew letter (capital) aleph with a subscript zero – usually pronounced “aleph
naught.”
8.1. EQUIVALENT SETS 341
the natural numbers! We have to presume that the people who instituted
this terminology meant for “countable” to mean “countable, in principle”
or “countable if you’re willing to let me keep counting forever” or maybe
“countable if you can keep counting faster and faster and are capable of
ignoring the speed of light limitations on how fast your lips can move.” Worse
yet, the term “countable” has come to be used for sets whose cardinalities are
either finite or the size of the naturals. If we want to refer specifically to the
infinite sort of countable set most mathematicians use the term denumerable
(although this is not universal) or countably infinite. Finally, there are sets
whose cardinalities are bigger than the naturals. In other words, there are
sets such that no one-to-one correspondence with N is possible. We don’t
mean that people have looked for one-to-one correspondences between such
sets and N and haven’t been able to find them – we literally mean that it
can’t be done; and it is has been proved that it can’t be done! Sets having
cardinalities that are this ridiculously huge are known as uncountable.
342 CHAPTER 8. CARDINALITY
Exercises — 8.1
Point three, “who cares?” is in some sense the toughest of all to deal with.
Hopefully you’ll enjoy the clever arguments to come for their own intrinsic
beauty. But, if you can figure a way to make big piles of money using this
stuff that would be nice too.
Let’s get started.
Which set is bigger – the natural numbers, N or the set, Enoneg , of non-
negative even numbers? Both are clearly infinite, so the “infinity is infinity”
camp might be lead to the correct conclusion through invalid reasoning. On
the other hand, the even numbers are contained in the natural numbers so
there’s a pretty compelling case for saying the evens are somehow smaller
than the naturals. The mathematically rigorous way to show that these
sets have the same cardinality is by displaying a one-to-one correspondence.
Given an even number how can we produce a natural to pair it with? And,
given a natural how can we produce an even number to pair with it? The
map f : N −→ Enoneg defined by f (x) = 2x is clearly a function, and just
about as clearly, injective4 . Is the map f also a surjection? In other words, is
every non-negative even number the image of some natural under f ? Given
some non-negative even number e we need to be able to come up with an
x such that f (x) = e. Well, since e is an even number, by the definition of
“even” we know that there is an integer k such that e = 2k and since e is
either zero or positive it follows that k must also be either 0 or positive. It
turns out that k is actually the x we are searching for. Put more succinctly,
every non-negative even number 2k has a preimage, k, under the map f . So
f maps N surjectively onto Enoneg . Now the sets we’ve just considered,
N = {0, 1, 2, 3, 4, 5, 6, . . .}
and
4
If x and y are different numbers that map to the same value, then f(x) = f(y) so 2x =
2y. But we can cancel the 2’s and derive that x = y, which is a contradiction.
8.2. EXAMPLES OF SET EQUIVALENCE 345
both have the feature that they can be listed – at least in principle. There
is a first element, followed by a second element, followed by a third element,
et cetera, in each set. The next set we’ll look at, Z, can’t be listed so easily.
To list the integers we need to let the dot-dot-dots go both forward (towards
positive infinity) and backwards (towards negative infinity),
To show that the integers are actually equinumerous with the natural num-
bers (which is what we’re about to do – and by the way, isn’t that pretty
remarkable?) we need, essentially, to figure out a way to list the integers in
a singly infinite list. Using the symbol ± we can arrange for a singly infinite
listing, and if you think about what the symbol ± means you’ll probably
come up with
This singly infinite listing of the integers does the job we’re after in a sense
– it displays a one-to-one correspondence with N. In fact any singly infinite
listing can be thought of as displaying a one-to-one correspondence with N
– the first entry (or should we say zeroth entry?) in the list is corresponded
with 0, the second entry is corresponded with 1, and so on.
0 1 2 3 4 5 6 7 ...
l l l l l l l
0 1 −1 2 −2 3 −3 4 ...
To make all of this precise we need to be able to explicitly give the one-
to-one correspondence. It isn’t enough to have a picture of it – we need a
formula. Notice that the negative integers are all paired with even naturals
346 CHAPTER 8. CARDINALITY
and the positive integers are all paired with odd naturals. This observation
leads us to a piecewise definition for a function that gives the bijection we
seek
−x/2 if x is even
f (x) = .
(x + 1)/2 if x is odd
By the way, notice that since 0 is even it falls into the first case, and
fortunately that formula gives the “right” value.
The examples we’ve done so far have shown that the integers, the natural
numbers and the even naturals all have the same cardinality. This is the
first infinite cardinal number, known as ℵ0 . In a certain sense we could view
both of the equivalences we’ve shown as demonstrating that 2 · ∞ = ∞. Our
next example will lend credence to the rule: ∞ · ∞ = ∞. The Cartesian
product of two finite sets (the set of all ordered pairs with entries from the
sets in question) has cardinality equal to the product of the cardinalities of
the sets. What do you suppose will happen if we let the sets be infinite?
For instance, what is the cardinality of N × N? Consider this: the subset of
ordered pairs that start with a 0 can be thought of as a copy of N sitting
inside this Cartesian product. In fact the subset of ordered pairs starting
with any particular number gives another copy of N inside N × N. There are
infinitely many copies of N sitting inside of N × N! This just really ought to
get us to a larger cardinality. The surprising result that it doesn’t involves an
idea sometimes known as “Cantor’s Snake” – a trick that allows us to list the
elements of N × N in a singly infinite list5 . You can visualize the set N × N
as the points having integer coordinates in the first quadrant (together with
5
Cantor’s snake was originally created to show that Qnoneg and N are equinumerous.
8.2. EXAMPLES OF SET EQUIVALENCE 347
Figure 8.1: Cantor’s snake winds through the set N × N encountering its
elements one after the other.
the origin and the positive x and y axes). This set of points and the path
through them known as Cantor’s snake is shown in Figure 8.1.
This function was introduced in the exercises for Section 6.5. The version we are presenting
here avoids certain complications.
348 CHAPTER 8. CARDINALITY
The diagram in Figure 8.1 gives a visual form of the one-to-one correspon-
dence we seek. In tabular form we would have something like the following.
0 1 2 3 4 5 6 7 8 ...
l l l l l l l l l
(0, 0) (0, 1) (1, 0) (0, 2) (1, 1) (2, 0) (0, 3) (1, 2) (2, 1) . . .
We need to produce a formula. In truth, we should really produce two
formulas. One that takes an ordered pair (x, y) and produces a number n.
Another that takes a number n and produces an ordered pair (x, y) The
number n tells us where the pair (x, y) lies in our infinite listing. There is a
problem though: the second formula (that gives the map from N to N × N)
is really hard to write down – it’s easier to describe the map algorithmically.
A simple observation will help us to deduce the various formulas. The or-
dered pairs along the y-axis (those of the form (0, something)) correspond to
triangular numbers. In fact the pair (0, n) will correspond to the n-th trian-
gular number, T (n) = (n2 + n)/2. The ordered pairs along the descending
slanted line starting from (0, n) all have the feature that the sum of their
coordinates is n (because as the x-coordinate is increasing, the y-coordinate
is decreasing). So, given an ordered pair (x, y), the number corresponding
to the position at the upper end of the slanted line it is on (which will have
coordinates (0, x+y)) will be T (x+y), and the pair (x, y) occurs in the listing
exactly x positions after (0, x + y). Thus, the function f : N × N −→ N is
given by
(x + y)2 + (x + y)
f (x, y) = x + T (x + y) = x + .
2
To go the other direction – that is, to take a position in the listing and derive
an ordered pair – we need to figure out where a given number lies relative
to the triangular numbers. For instance, try to figure out what (x, y) pair
position number 13 will correspond with. Well, the next smaller triangular
8.2. EXAMPLES OF SET EQUIVALENCE 349
p
T −1 (x) = 2x + 1/4 − 1/2.
p
So, given n, a position in the listing, we calculate A = b 2n + 1/4−1/2c.
The x-coordinate of our ordered pair is n−T (A) and the y-coordinate is A−x.
It is not pretty, but the above discussion can be translated into a formula for
f −1 .
−1 (p p
f (n) = 2n + 1/4 − 1/2c2 + b 2n + 1/4 − 1/2c2,
n−
b
p p !
p b 2n + 1/4 − 1/2c2 + b 2n + 1/4 − 1/2c
b 2n + 1/4 − 1/2c − n + .
2
(x − a)(d − c)
f (x) = c +
(b − a)
There are other geometric constructions which we can use to show that
there are the same number of points in a variety of entities. For example,
consider the upper half of the unit circle (Remember the unit circle from
Trig? All points (x, y) satisfying x2 + y 2 = 1.) This is a semi-circle having a
radius of 1, so the arclength of said semi-circle is π. It isn’t hard to imagine
that this semi-circular arc contains the same number of points as an interval
of length π, and we’ve already argued that all intervals contain the same
8.2. EXAMPLES OF SET EQUIVALENCE 351
Figure 8.2: Projection from a point can be used to show that intervals of
different lengths contain the same number of points.
f (x, y) = x.
√
f −1 (x) = (x, 1 − x2 ).
Now we’re ready to put some of these ideas together in order to prove
352 CHAPTER 8. CARDINALITY
something really quite remarkable. It may be okay to say that line segments
of different lengths are equinumerous – although ones intuition still balks
at the idea that a line a mile long only has the same number of points on
it as a line an inch long (or, if you prefer, make that a centimeter versus
a kilometer). Would you believe that the entire line – that is the infinitely
extended line – has no more points on it than a tiny little segment? You
should be ready to prove this one yourself.
Exercise. Find a point such that projection from that point determines a
one-to-one correspondence between the portion of the unit circle in the upper
half plane and the line y = 1.
In the exercises from Section 8.1 you were supposed to show that set
equivalence is an equivalence relation. Part of that proof should have been
showing that the relation is transitive, and that really just comes down to
showing that the composition of two bijections is itself a bijection. If you
didn’t make it through that exercise give it another try now, but whether
or not you can finish that proof it should be evident what that transitivity
8.2. EXAMPLES OF SET EQUIVALENCE 353
means to us in the current situation. Any pair of line segments are the same
size – a line segment (i.e. an interval) and a semi-circle are the same size –
the semi-circle and an infinite line are the same size – transitivity tells us that
an infinitely extended line has the same number of points as (for example)
the interval (0, 1).
354 CHAPTER 8. CARDINALITY
Exercises — 8.2
3. Prove that any two circles are equinumerous (as sets of points).
Many people believe that the result known as Cantor’s theorem says that
the real numbers, R, have a greater cardinality than the natural numbers, N.
That isn’t quite right. In fact Cantor’s theorem is a much broader statement,
one of whose consequences is that |R| > |N|. Before we go on to discuss
Cantor’s theorem in full generality, we’ll first explore it, essentially, in this
simplified form. Once we know that |R| 6= |N|, we’ll be in a position to
explore a lot of interesting issues relative to the infinite. In particular, this
result means that there are at least two cardinal numbers that are infinite –
thus the “infinity is infinity” idea will be discredited. Once we have the full
power of Cantor’s theorem, we’ll see just how completely wrong that concept
is.
To show that some pair of sets are not equivalent it is necessary to show
that there cannot be a one-to-one correspondence between them. Ordinarily,
one would try to argue by contradiction in such a situation. That is what
we’ll need to do to show that the reals and the naturals are not equinumer-
ous. We’ll presume that they are in fact the same size and try to reach a
contradiction.
What exactly does the assumption that R and N are equivalent mean?
It means there is a one-to-one correspondence, that is, a bijective function
from R to N. In a nutshell, it means that it is possible to list all the real
numbers in a singly-infinite list. Now, it is certainly possible to make an
infinite list of real numbers (since N ⊆ R, by listing the naturals themselves
we are making an infinite list of reals!). The problem is that we would need
to be sure that every real number is on the list somewhere. In fact, since
we’ve used a geometric argument to show that the interval (0, 1) and the set
R are equinumerous, it will be sufficient to presume that there is an infinite
list containing all the numbers in the interval (0, 1).
356 CHAPTER 8. CARDINALITY
Exercise. Notice that, for example, π − 3 is a real number in (0, 1). Make
a list of 10 real numbers in the interval (0, 1). Make sure that at least 5 of
them are not rational.
In the previous exercise, you’ve started the job, but we need to presume
that it is truly possible to complete this job. That is, we must presume that
there really is an infinite list containing every real number in the interval
(0, 1).
Once we have an infinite list containing every real number in the inter-
val (0, 1) we have to face up to a second issue. What does it really mean
to list a particular real number? For instance if e − 2 is in the seventh
position on our list, is it OK to write “e − 2” there or should we write
“0.7182818284590452354. . . ”? Clearly it would be simpler to write “e − 2”
but it isn’t necessarily possible to do something of that kind for every real
number – on the other hand, writing down the decimal expansion is a prob-
lem too; in a certain sense, “most” real numbers in (0, 1) have infinitely long
decimal expansions. There is also another problem with decimal expansions;
they aren’t unique. For example, there is really no difference between the
finite expansion 0.5 and the infinitely long expansion 0.49.
Rather than writing something like “e−2” or “0.7182818284590452354. . . ”,
we are going to in fact write “.1011011111100001010100010110001010001010
. . . ” In other words, we are going to write the base-2 expansions of the real
numbers in our list. Now, the issue of non-uniqueness is still there in binary,
and in fact if we were to stay in base-10 it would be possible to plug a certain
gap in our argument – but the binary version of this argument has some es-
pecially nice features. Every binary (or for that matter decimal) expansion
corresponds to a unique real number, but it doesn’t work out so well the
other way around — there are sometimes two different binary expansions
that correspond to the same real number. There is a lovely fact that we
are not going to prove (you may get to see this result proved in a course in
8.3. CANTOR’S THEOREM 357
Real Analysis) that points up the problem. Whenever two different binary
expansions represent the same real number, one of them is a terminating ex-
pansion (it ends in infinitely many 0’s) and the other is an infinite expansion
(it ends in infinitely many 1’s). We won’t prove this fact, but the gist of the
argument is a proof by contradiction — you may be able to get the point by
studying Figure 8.4. (Try to see how it would be possible to find a number
in between two binary expansions that didn’t end in all-zeros and all-ones.)
.0 .1
Figure 8.4: The base-2 expansions of reals in the interval [0, 1] are the leaves
of an infinite tree.
So, instead of showing that the set of reals in (0, 1) can’t be put in one-to-
one correspondence with N, what we’re really going to do is show that their
binary expansions can’t be put in one-to-one correspondence with N. Since
there are an infinite number of reals that have two different binary expansions
this doesn’t really do the job as advertised at the beginning of this section.
(Perhaps you are getting used to our wily ways by now — yes, this does mean
that we’re going to ask you to do the real proof in the exercises.) The set of
358 CHAPTER 8. CARDINALITY
This argument has been generalized many times, so this is the first in a
class of things known as diagonal arguments. Diagonal arguments have been
used to settle several important mathematical questions. There is a valid
diagonal argument that even does what we’d originally set out to do: prove
8.3. CANTOR’S THEOREM 359
that N and R are not equinumerous. Strangely, the argument can’t be made
to work in binary, and since you’re going to be asked to write it up in the
exercises, we want to point out one of the potential pitfalls. If we were to
use a diagonal argument to show that (0, 1) isn’t countable, we would start
by assuming that every element of (0, 1) was written down in a list. For
most real numbers in (0, 1) we could write out their binary representation
uniquely, but for some we would have to make a choice: should we write down
the representation that terminates, or the one that ends in infinitely-many
1’s? Suppose we choose to use the terminating representations, then none
of the infinite binary strings that end with all 1’s will be on the list. It’s
possible that the thing we get when we complement the diagonal is one of
these (unlisted) binary strings so we don’t necessarily have a contradiction.
If we make the other choice – use the infinite binary representation when we
have a choice – there is a similar problem. You may think that our use of
binary representations for real numbers was foolish in light of the failure of
the argument to “go through” in binary. Especially since, as we’ve alluded to,
it can be made to work in decimal. The reason for our apparent stubbornness
is that these infinite binary strings do something else that’s very nice. An
infinitely long binary sequence can be thought of as the indicator function of
a subset of N. For example, .001101010001 is the indicator of {2, 3, 5, 7, 11}.
The set, F∞
2 , we’ve been working with is in one-to-one correspondence
with the power set of the natural numbers, P(N). When viewed in this
light, the proof we did above showed that the power set of N has an infinite
cardinality strictly greater than that of N itself. In other words, P(N) is
uncountable.
What Cantor’s theorem says is that this always works. If A is any set,
and P(A) is its power set then |A| < |P(A)|. In a way, this more general
theorem is easier to prove than the specific case we just handled.
Exercises — 8.3
6. Verify that the final deduction in the proof of Cantor’s theorem, “(y ∈
S =⇒ y ∈
/ S) ∧ (y ∈
/ S =⇒ y ∈ S),” is truly a contradiction.
364 CHAPTER 8. CARDINALITY
8.4 Dominance
We’ve said a lot about the equivalence relation determined by Cantor’s defini-
tion of set equivalence. We’ve also, occasionally, written things like |A| < |B|,
without being particularly clear about what that means. It’s now time to
come clean. There is actually a (perhaps) more fundamental notion used
for comparing set sizes than equivalence — dominance. Dominance is an
ordering relation on the class of all sets. One should probably really define
dominance first and then define set equivalence in terms of it. We haven’t
followed that plan for (at least) two reasons. First, many people may want
to skip this section — the results of this section depend on the difficult
Cantor-Bernstein-Schröder theorem6 . Second, we will later take the view
that dominance should really be considered to be an ordering relation on the
set of all cardinal numbers – i.e. the equivalence classes of the set equiva-
lence relation – not on the collection of all sets. From that perspective, set
equivalence really needs to be defined before dominance.
One set is said to dominate another if there is a function from the latter
into the former. More formally, we have the following
Definition. If A and B are sets, we say “A dominates B” and write |A| >
|B| iff there is an injective function f with domain B and codomain A.
It is easy to see that this relation is reflexive and transitive. The Cantor-
Bernstein-Schröder theorem proves that it is also anti-symmetric — which
means dominance is an ordering relation. Be advised that there is an abuse
of terminology here that one must be careful about — what are the domain
and range of the “dominance” relation? The definition would lead us to
6
This theorem has been known for many years as the Schröder-Bernstein theorem, but,
lately, has had Cantor’s name added as well. Since Cantor proved the result before the
other gentlemen this is fitting. It is also known as the Cantor-Bernstein theorem (leaving
out Schröder) which doesn’t seem very nice.
8.4. DOMINANCE 365
think that sets are the things that go on either side of the “dominance”
relation, but the notation is a bit more honest, “|A| > |B|” indicates that
the things really being compared are the cardinal numbers of sets (not the
sets themselves). Thus anti-symmetry for this relation is
in town. He rushes out and says “My friend, have no fear! Even though we
have no vacancies, there is always room for one more at our establishment.”
He goes into the office and makes the following announcement on the PA
system. “Ladies and Gentlemen, in order to accommodate an incoming guest,
please vacate your room and move to the room numbered one higher. Thank
you.” There is an infinite amount of grumbling, but shortly you find yourself
occupying room number 1.
system. If it’s possible to construct a proof for a given theorem without using
the axiom of choice, almost everyone would agree that that is preferable. On
the other hand, a proof of the C-B-S theorem, which necessarily must be able
to deal with uncountably infinite sets, will have to depend on some sort of
notion that will allow us to deal with huge infinities.
The proof we will present here7 is attributed to Julius König. König
was a contemporary of Cantor’s who was (initially) very much respected by
him. Cantor came to dislike König after the latter presented a well-publicized
(and ultimately wrong) lecture claiming the continuum hypothesis was false.
Apparently the continuum hypothesis was one of Cantor’s favorite ideas,
because he seems to have construed König’s lecture as a personal attack.
Anyway. . .
König’s proof of C-B-S doesn’t use the axiom of choice, but it does have
its own strangeness: a function that is not necessarily computable — that is,
a function for which (for certain inputs) it may not be possible to compute
an output in a finite amount of time! Except for this oddity, König’s proof
is probably the easiest to understand of all the proofs of C-B-S. Before we
get too far into the proof it is essential that we understand the basic setup.
The Cantor-Bernstein-Schröder theorem states that whenever A and B are
sets and there are injective functions f : A −→ B and g : B −→ A, then it
follows that A and B are equivalent. Saying A and B are equivalent means
that we can find a bijective function between them. So, to prove C-B-S, we
hypothesize the two injections and somehow we must construct the bijection.
Figure 8.5 has a presumption in it — that A and B are countable — which
need not be the case. Nevertheless, it gives us a good picture to work from.
The basic hypotheses, that A and B are sets and we have two functions,
one from A into B and another from B into A, are shown. We will have to
build our bijective function in a piecewise manner. If there is a non-empty
7
We first encountered this proof in a Wikipedia article[3].
368 CHAPTER 8. CARDINALITY
A B
a1 b1
a2 b2
a3 b3
a4 b4
a5 b5
a6 b6
a7 b7
a8 b8
a9 b9
a10 b10
a11 b11
a12 b12
intersection between A and B, we can use the identity function for that part
of the domain of our bijection. So, without loss of generality, we can presume
that A and B are disjoint. We can use the functions f and g to create infinite
sequences, which alternate back and forth between A and B, containing any
particular element. Suppose a ∈ A is an arbitrary element. Since f is defined
on all of A, we can compute f (a). Now since f (a) is an element of B, and g
is defined on all of B, we can compute g(f (a)), and so on. Thus, we get the
infinite sequence
defined within a given sequence there are also two possibilities; the sequence
may be finite (and so it must be cyclic in nature) or the sequence may be
truly infinite.
Finally, here is a definition for φ.
g −1 (x) if x is in a B-stopper
φ(x) =
f (x) otherwise
Notice that if a sequence is either cyclic or infinite it doesn’t matter
whether we use f or g −1 since both will be defined for all elements of such
sequences. Also, certainly f will work if we are in an A-stopper. The function
we’ve just created is perfectly well-defined, but it may take arbitrarily long
to determine whether we have an element of a B-stopper, as opposed to an
element of an infinite sequence. We cannot determine whether we’re in an
infinite versus a finite sequence in a prescribed finite number of steps.
8.4. DOMINANCE 371
A B
a1 b1
a2 b2
a3 b3
a4 b4
a5 b5
a6 b6
a7 b7
a8 b8
a9 b9
a10 b10
a11 b11
a12 b12
Exercises — 8.4
a = 0.a1 a2 a3 a4 a5 . . .
b = 0.b1 b2 b3 b4 b5 . . .
s = 0.a1 b1 a2 b2 a3 b3 . . .
be the image of (a, b). If two different points get mapped to the same value
s then both points have x and y coordinates that agree in every position of
their decimal expansion (so they must really be equal). It is a little bit
harder to create a bijective function from S to I (and thus to show the
equivalence directly, without appealing to C-B-S). The problem is that, once
again, we need to deal with the non-uniqueness of decimal representations
of real numbers. If we make the choice that, whenever there is a choice to
be made, we will use the non-terminating decimal expansions for our real
numbers there will be elements of I not in the image of the map determined
by interleaving digits (for example 0.15401050902060503 is the interleaving
of the digits after the decimal point in π = 3.141592653 . . . and 1/2 = 0.5,
this is clearly an element of I but it cant be in the image of our map since 1/2
should be represented by 0.49 according to our convention. If we try other
conventions for dealing with the non-uniqueness it is possible to find other
examples that show simple interleaving will not be surjective. A slightly
more subtle approach is required.
Presume that all decimal expansions are non-terminating (as we can,
WLOG) and use the following approach: Write out the decimal expansion
of the coordinates of a point (a, b) in S. Form the digits into blocks with as
8.5. CH AND GCH 375
a = 0.124520047019902 . . .
and
b = 0.004015648000031 . . .
a = 0.1 2 4 5 2 004 7 01 9 9 02 . . .
and
b = 0.004 01 5 6 4 8 00003 1 . . .
s = 0.10042014556240048 . . .
We’ve shown that the unit square, S, and the unit interval, I, have the
same cardinality. These arguments can be extended to show that all of R×R
also has this cardinality (c).
So now let’s turn to the continuum hypothesis.
We mentioned earlier in this chapter that the cardinality of N is denoted
ℵ0 . The fact that that capital letter aleph is wearing a subscript ought to
make you wonder what other aleph-sub-something-or-others there are out
there. What is ℵ1 ? What about ℵ2 ? Cantor presumed that there was a
sequence of cardinal numbers (which is itself, of course, infinite) that give
all of the possible infinities. The smallest infinite set that anyone seems
376 CHAPTER 8. CARDINALITY
ℵ1 = c.
There really should be a big question mark over that. A really big ques-
tion mark. It turns out that the continuum hypothesis lives in a really weird
world. . . To this day, no one has the least notion of whether it is true or false.
But wait! That’s not all! The real weirdness is that it would appear to be
impossible to decide. Well, that’s not so bad – after all, we talked about
undecidable sentences way back in the beginning of Chapter 2. Okay, so
here’s the ultimate weirdness. It has been proved that one can’t prove the
continuum hypothesis. It has also been proved that one can’t disprove the
continuum hypothesis.
Having reached this stage in a book about proving things I hope that the
last two sentences in the previous paragraph caused some thought along the
lines of “well, ok, with respect to what axioms?” to run through your head.
So, if you did think something along those lines pat yourself on the back.
And if you didn’t then recognize that you need to start thinking that way
8.5. CH AND GCH 377
∀n ∈ N, ℵn+1 = 2ℵn .
I’d really rather not bring this text to a close with that monstrosity so
instead I think I’ll just say
Paul Cohen.
Hah! I did it! I ended the book by sayi. . . Hunh? Oh.
378 CHAPTER 8. CARDINALITY
Paul Cohen.
Chapter 9
If you can keep your head when all about you are losing theirs, it’s just
possible you haven’t grasped the situation. –Jean Kerr
The famous mathematician Paul Erdös is said to have believed that God
has a Book in which all the really elegant proofs are written. The greatest
praise that a collaborator1 could receive from Erdös was that they had dis-
covered a “Book proof.” It is not easy or straightforward for a mere mortal
to come up with a Book proof but notice that, since the Book is inaccessible
to the living, all the Book proofs of which we are aware were constructed by
ordinary human beings. In other words, it’s not impossible!
The title of this final chapter is intended to be whimsical – there is no real
magic involved in any of the arguments that we’ll look at. Nevertheless, if you
reflect a bit on the mental processes that must have gone into the development
of these elegant proofs, perhaps you’ll agree that there is something magical
there. At a minimum we hope that you’ll agree that they are beautiful –
they are proofs from the Book2 .
1
The collaborators of Paul Erdös were legion. His collaborators, and their collaborators,
and their collaborators, etc. are organized into a tree structure according to their so-called
Erdös number, see [5].
2
There is a lovely book entitled “Proofs from the Book” [2] that has a nice collection
379
380 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
of Book proofs.
9.1. MORLEY’S MIRACLE 381
3
Duplicating the cube is also known as the Delian problem – the problem comes from
a pronouncement by the oracle of Apollo at Delos that a plague afflicting the Athenians
would be lifted if they built an altar to Apollo that was twice as big as the existing altar.
The existing altar was a cube, one meter on a side, so they carefully built a two meter cube
– but the plague raged on. Apparently what Apollo wanted was a cube that had double
√
the volume of the present altar – it’s side length would have to be 3 2 ≈ 1.25992 and since
this was Greece and it was around 430 B.C. and there were no electronic calculators, they
were basically just screwed.
382 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
A B
Figure 9.1: The setup for Morley’s Miracle – start with an arbitrary triangle
and trisect each of its angles.
The six angle trisectors that we’ve just drawn intersect one another in
quite a few points.
Exercise. You could literally count the number of intersection points between
the angle trisectors on the diagram, but you should also be able to count them
(perhaps we should say “double-count them”) combinatorially. Give it a try!
Among the points of intersection of the angle trisectors there are three
that we will single out – the intersections of adjacent trisectors. In Figure 9.2
the intersection of adjacent trisectors are indicated, additionally, we have
connected them together to form a small triangle in the center of our original
triangle.
9.1. MORLEY’S MIRACLE 383
A B
Figure 9.2: A triangle is formed whose vertices are the intersections of the
adjacent trisectors of the angles of 4ABC.
Are you ready for the miraculous part? Okay, here goes!
In other words, that little blue triangle in Figure 9.2 that kind of looks
like it might be equilateral actually does have all three sides equal to one
another. Furthermore, it doesn’t matter what triangle we start with, if we
do the construction above we’ll get a perfect 60◦ − 60◦ − 60◦ triangle in the
middle!
Sources differ, but it is not clear whether Morley ever proved his theorem.
The first valid proof (according to R. K. Guy in [8] was published in 1909 by
M. Satyanarayana [15]. There are now many other proofs known, for instance
the cut-the-knot website (http://www.cut-the-knot.org/) exposits no less
than nine different proofs. The proof by Satyanarayana used trigonometry.
The proof we’ll look at here is arguably the shortest ever produced and it is
384 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
a? = a + π/3
and
a?? = a + 2π/3.
4
In Geometry, two objects are said to be similar if one can be made to exactly coincide
with the other after a series of rigid translations, rotations and scalings. In other words,
they have the same shape if you allow for differences in scale and are allowed to slide them
around and spin them about as needed.
9.1. MORLEY’S MIRACLE 385
Exercise. What would a triangle whose vertex angles are (0? , 0? , 0? ) be?
c c c
b?? a? b ?
a??
c? c?
b? a? b
a
??
c b
a
a b
Figure 9.3: Conway’s proof involves putting these pieces together to obtain
a triangle (with an equilateral Morley triangle) that is similar to 4ABC.
(a, b? , c? ) and (a? , b, c? ) inside of triangle (a, b, c?? ). To do this just construct
two lines that go through the top vertex (where the angle c?? is) that cut the
opposite edge at the angle c? in the two possible senses – these two lines will
coincide if it should happen that c? is precisely π/2 but generally there will
be two and it is evident that the two line segments formed have the same
length. We scale the purple triangle so that this common length will be 1.
See Figure 9.4.
Of course the other two obtuse triangles can be handled in a similar way.
9.1. MORLEY’S MIRACLE 387
b ? a?
a c? c? b
Figure 9.4: The scaling factor for the obtuse triangles in Conway’s puzzle
proof is determined so that the segments constructed in there midsts have
unit length.
388 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Exercises — 9.1
1. What value should we get if we sum all of the angles that appear around
one of the interior vertices in the finished diagram? Verify that all three
have the correct sum.
c c c
b?? a? b? a??
c? c?
b ? a?
c?? b
a
a b
a b
S = {(x, y) x ∈ Z ∧ y ∈ Z ∧ y ≤ 0}.
Exercise. The strategy just stated uses 4 men (in the sense that they are
removed from the board – 5 if you count the one who ends up two steps into
enemy territory as well). Find a strategy for moving someone two steps into
enemy territory that is more efficient – that is, involves fewer jumps.
Exercise. Determine the most efficient way to get a man three steps into
390 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Figure 9.5: An infinite number of checkers occupying the integer lattice points
such that y ≤ 0.
9.2. FIVE STEPS INTO THE VOID 391
enemy territory. An actual checkers board and pieces (or some coins, or
rocks) might come in handy.
We’ll count the man who ends up some number of steps above the x-axis,
as well as all the pieces who get jumped and removed from the board as a
measure of the efficiency of a strategy. If you did the last exercise correctly
you should have found that eight men are the minimum required to get 3
steps into enemy territory. So far, the number of men required to get a given
distance into enemy territory seems to always be a power of 2.
# of steps # of men
1 2
2 4
3 8
The real surprise is that it is simply impossible to get a man five steps
into enemy territory. So the sequence we’ve been looking at actually goes
2, 4, 8, 20, ∞.
392 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Figure 9.6: One man is sacrificed in order to move a scout one step into
enemy territory.
9.2. FIVE STEPS INTO THE VOID 393
2
1
Figure 9.7: Three man are sacrificed in order to move a scout two steps into
enemy territory.
394 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
1 2 3 4
Figure 9.8: Eight men are needed to get a scout 3 steps into the void.
9.2. FIVE STEPS INTO THE VOID 395
The proof of this surprising result works by using a fairly simple, but
clever, strategy. We assign a numerical value to a set of men that is dependent
on their positions – then we show that this value never increases when we
make “checker jumping” moves – finally we note that the value assigned to
a man in position (0, 5) is greater than the value of the entire original set of
men (that is, with all the positions in the lower half-plane occupied). This is
a pretty nice strategy, but how exactly are we going to assign these numerical
values?
A man’s value is related to his distance from the point (0, 5) in what is
often called “the taxicab metric.” We don’t use the straight-line distance,
but rather determine the number of blocks we will have to drive in the north-
south direction and in the east-west direction and add them together. The
value of a set of men is the sum of their individual values. Since we need to
deal with the value of the set of men that completely fills the lower half-plane,
we are going to have to have most of these values be pretty tiny! To put it
in a more mature and dignified manner: the infinite sum of the values of the
men in our army must be convergent.
396 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
8 7 6 5 6 7 8
9 8 7 6 7 8 9
10 9 8 7 8 9 10
11 10 9 8 9 10 11
Exercises — 9.2
1.
398 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Exercises — 9.3
1.
400 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Exercises — 9.4
1.
402 CHAPTER 9. PROOF TECHNIQUES IV — MAGIC
Bibliography
[2] Martin Aigner and Gunter M. Ziegler. Proofs from THE BOOK.
Springer-Verlag, 2nd edition, 2001.
[6] Wikipedia contributors. The four color theorem. Wikipedia, the free
encyclopedia. http://en.wikipedia.org/wiki/Four color theorem.
403
404 BIBLIOGRAPHY
[8] Richard K. Guy. The lighthouse theorem, Morley & Malfatti – a budget
of paradoxes. American Mathematical Monthly, 2007.
[9] Bjorn Poonen Kiran S. Kedlaya and Ravi Vakil. The William Lowell
Putnam Mathematical Competition 1985-2000: Problems Solutions, and
Commentary. The Mathematical Association of America, 2002.
[10] C. W. H. Lam. The search for a finite projective plane of order 10.
http://www.www.cecm.sfu.ca/organics/papers/lam/paper/html/paper.html.
[15] M. Satyanarayana. none given. Math. Quest. Educ. Times (New Series),
1909.
405
406 INDEX
transistor, 62
transitivity, 235
triangular numbers, 212
trichotomy, 7
trichotomy property, 150
truth table, 60
Twin Prime conjecture, 18
two-column proof, 88
uncountable, 341
union, 171
unique existence, 99, 154
universal conditional statement, 118
universal quantification, 19
universal set, 161
universe of discourse, 19, 161, 180
vacuous truth, 71
valid argument form, 109
vampire number, 150, 153
Venn diagram, 179
Yahtzee, 289
Z-module, 155