Notes On Mathematical Proofs
Notes On Mathematical Proofs
Logical Connectives
Mathematics works according to the laws of logic, which specify how to make valid deductions. In order
to apply the laws of logic to mathematical statements, you need to understand their logical forms.
If you take a course in mathematical logic, you will see a formal discussion of proofs. You start with a
formal language, which describes the symbols you’re allowed to use and how to combine them, and rules
of inference, which describe the valid ways of making steps in a proof. Everything is symbols! If I did that
here you would probably find it hard to follow. So the discussion here will be informal (though you might
not think it is!).
Proofs are composed of statements. A statement is a declarative sentence that can be either true or
false.
Remark. Many real proofs contain things which aren’t really statements — questions, descriptions, and so
on. They’re there to help to explain things for the reader. When I say “Proofs are composed of statements”,
I’m referring to the actual mathematical content with the explanatory material removed.
Example. Which of the following are statements? If it is a statement, determine if possible whether it’s
true or false.
“0 = 1.”
“The diameter of the earth is 1 inch or I ate a pizza.”
“1 + 1 = 2.”
“1 + 1.”
“Calvin Butterball is a math major” is a statement. You’d need to know more about Calvin and math
majors to know whether the statement is true or false.
“0 = 1” is a statement which is false (assuming that “0” and “1” refer to the real numbers 0 and 1).
“The diameter of the earth is 1 inch or I will have a pizza” is a statement. The first part (“The
diameter of the earth is 1 inch”) is false, but you would need to know something about my recent meals to
know whether “I ate a pizza” is true or false. Nevertheless, it’s reasonable to suppose that you could figure
out whether “I ate a pizza” is true or false — and hence, whether the original “or” statement is true or false.
“Do you have a pork barbecue sandwich?” is not a statement — it’s a question.
Likewise, “Give me a cafe mocha!” is not a statement — it’s an imperative sentence, i.e. an order to
do something.
“1 + 1 = 2” is a statement. An easy way to tell is to read it and see if it’s a complete declarative sentence
which is either true or false. This statement would read (in words):
1
On the other hand, “1 + 1” is not a statement. It would be read “One plus one”, which is not a sentence
since it doesn’t have a verb. (Things like “1 + 1” are referred to as terms or expressions.)
Since proofs are composed of statements, you should never have isolated phrases (like 1+1 or “(a+b)2 ”)
in your proofs. Be sure that every line of a proof is a statement. Read each line to yourself to be sure.
In terms of logical form, statements are built from simpler statements using logical connectives.
Definition. The logical connectives of sentential logic are:
(a) Negation (“not”), denoted ¬.
(b) Conjunction (“and”), denoted ∧.
(c) Disjunction (“or”), denoted ∨.
(d) Conditional (“if-then” or “implication”), denoted →.
(e) Biconditional (“if and only if” or “double implication”), denoted ↔.
Later I’ll discuss the quantifiers “for all” (denoted ∀) and “there exists” (denoted ∃).
Remark. You may see different symbols used by other people. For example, some people use ∼ for negation.
And ⇒ is sometimes used for the conditional, in which case ⇔ is used for the biconditional.
(a) P or not Q.
(b) If P and R, then Q.
(c) P if and only if (Q and R).
(d) Not P and not Q.
(e) It is not the case that if P, then Q.
(f) If P and Q, then R or S.
(a)
P ∨ ¬Q
(b)
(P ∧ R) → Q
(c)
P ↔ (Q ∧ R)
(d)
¬P ∧ ¬Q
(e)
¬(P → Q)
(f)
(P ∧ Q) → (R ∨ S)
2
Remark. You might object that (for instance) “P ∨ Q”, which you would read as “P or Q” does not seem
like a statement (a complete English sentence). However, in the context of a proof, the symbols P and Q
would stand for statements, and replacing P and Q with the statements they stand for result in a complete
English sentence (for example, “The diameter of the earth is 1 inch or I ate a pizza”).
Other words or phrases may occur in statements. Here’s a table of some of them and how they are
translated.
This is a good time to discuss the way the word “or” is used in mathematics. When you say “I’ll have
dinner at MacDonald’s or at Pizza Hut”, you probably mean “or” in its exclusive sense: You’ll have dinner
at MacDonald’s or you’ll have dinner at Pizza Hut, but not both. The “but not both” is what makes this an
exclusive or.
Mathematicians use “or” in the inclusive sense. When “or” is used in this way, “I’ll have dinner at
MacDonald’s or at Pizza Hut” means you’ll have dinner at MacDonald’s or you’ll have dinner at Pizza Hut,
or possibly both. Obviously, I’m not guaranteeing that both will occur; I’m just not ruling it out.
The reason for this choice is probably that, when the word “or” comes up in math, it usually comes up
in an inclusive way. For example, if X and Y are sets, their union consists of things which are in X or in Y
or in both. So if we chose to use “or” in the exclusive way, I have to say “or in both”. With the inclusive
“or”, I can just say “in X or in Y ”, since the “in both” is assumed. As with many conventions in math, it’s
the way it is because we’re lazy and it saves writing.
Example. Translate the following statements into logical notation, using the following symbols:
(a) “The stromboli is hot and the pizza will not be delivered.”
(b) “If the lasagne is cold, then the pizza will be delivered.”
3
(c) “Either the lasagne is cold or the pizza won’t be delivered.”
(d) “If the pizza won’t be delivered, then both the stromboli is hot and the lasagne is cold.”
(e) “The lasagne isn’t cold if and only if the stromboli isn’t hot.”
(g) “The stromboli is hot and the lasagne isn’t cold, but the pizza will be delivered.”
(a)
S ∧ ¬P
(b)
L→P
(c)
L ∨ ¬P
(d)
¬P → (S ∧ L)
(e)
¬L ↔ ¬S
(f)
P →L
(g)
S ∧ ¬L ∧ P
1. Negation
2. Conjunction
3. Disjunction
4. Implication
5. Double implication
(P ∧ Q) ∨ R rather than P ∧ Q ∨ R.
Precedence would group P and Q anyway, but the first expression is clearer.
It’s not common practice to use parentheses for grouping in ordinary sentences. Therefore, when you’re
translating logical statements into words, you may need to use certain expressions to indicate grouping.
(a) The combination “Either . . . or . . . ” is used to indicate that everything between the “either” and
the “or” is the first part of the “or” statement.
(b) The combination “Both . . . and . . . ” is used to indicate that everything between the “both” and the
“and” is the first part of the “and” statement.
4
In some cases, the only way to say something unambiguously is to be a bit wordy. Fortunately, mathe-
maticians find ways to express themselves which are clear, yet avoid excessive linguistic complexity.
Translate the following logical statements into words (with no logical symbols):
(a) (¬C ∧ F ) → W
(b) ¬(C ∨ W )
(c) ¬(¬W ∧ C)
(d) ¬(¬F ).
(a) “If the cheesesteak isn’t good and the french fries are greasy, then the wings are spicy.”
(b) If I say “It’s not the case that the cheesesteak is good or the wings are spicy”, it might not be clear
whether the negation applies only to “the cheesesteak is good” or to the disjunction “the cheesesteak is good
or the wings are spicy”.
So it’s better to say “It’s not the case that either the cheesesteak is good or the wings are spicy”, since
the “either” implies that “the cheesesteak is good” or “the wings are spicy” are grouped together in the
or-statement.
In this case, the “either” blocks the negation from applying to “the cheesesteak is good”, so the negation
has to apply to the whole “or” statement.
(c) “It’s not the case that both the wings aren’t spicy and the cheesesteak is good.” As with the use of
the word “either” in (b), I’ve added the word “both” to indicate that the initial negation applies to the
conjunction “the wings aren’t spicy and the cheesesteak is good”.
In this case, the “both” blocks the negation from applying to “the wings aren’t spicy”, so the negation
has to apply to the whole “and” statement.
(d) The literal translation is “It’s not the case that the french fries aren’t greasy”. Or (more awkwardly)
you could say “It’s not the case that it’s not the case that the french fries are greasy”.
Of course, this means the same thing as “The french fries are greasy”.
To answer this kind of question, you should probably ask whether it’s to be translated literally by
symbols (“syntactically”) or by meaning (“semantically”). In practice, mathematicians would almost always
simplify to remove a double negation.
Our earlier examples have used real-world statements. What about actual mathematics?
Example. Express the following examples of actual mathematical text using logical symbols. (You do not
need to know what these statements are talking about!)
(a) ([1], Theorem 25.11) In the semi-simple ring R, let L = Re be a left ideal with generating idempotent e.
Then L is a minimal left ideal if and only if eRe is a skew field.
(b) ([2], Proposition 14.11) Let X and Y be CW -complexes. Then X × Y (with the compactly generated
topology) is a CW complex, and X ∨ Y is a subcomplex.
5
(The numbers in square brackets are references (like foonotes). I’ll say something about them at the
end of this section.)
(a) You could express this using logical connectives in the following way. Let
A = “R is a semi-simple ring”.
(b) Let
R = “X ∨ Y is a subcomplex”.
A = “X is a CW -complex”.
B = “Y is a CW -complex”.
D = “X ∨ Y is a subcomplex”.
Now the proposition becomes (A ∧ B) → (C ∧ D). There is no difference in mathematical content, and
no difference in terms of how you would prove it.
Note: It would be better to express the statements above using quantifiers, which we will discuss later.
By the way, mathematicians usually do not translate mathematical statements into logical notation in
doing mathematics (unless they happen to be working the in area of mathematical logic). Logical formalism
serves as a foundation for math — and when, at the start, you get confused about a point of logic, it can be
helpful to think of things in terms of logical notation. After a point, mathematicians gain an intuitive sense
for correct logic as it is needed for their work. Then translating the math into logic is just extra work and
can make things harder to comprehend.
We learn how to read, write, and speak using words early in our lives. It’s the natural way for people
to communicate and to understand. Symbols compress a log of meaning into small spaces, so they are good
for short bursts of computation. But like packing lots of stuff in a box, compression hides meaning, which
is why wading through solid pages of symbols in math papers can be so intimidating.
It’s true that some people have suggested that mathematics should be written in a more formal way (for
instance, to facilitate computer-aided proofs), but at the moment math is generally written in a combination
of words and symbols. You should learn to use both appropriately.
As the last example shows, logical implications often arise in mathematical statements.
6
Definition. If P → Q is an implication, then:
(a) P is the antecedent or hypothesis and Q is the consequent or conclusion.
(b) The converse is the conditional Q → P .
(c) The inverse is the conditional ¬P → ¬Q.
(d) The contrapositive is the conditional ¬Q → ¬P .
I will often use “if-part” instead of “antecedent” or “hypothesis”, and “then-part” instead of “con-
sequent” or “conclusion”. While the terms in the definition are more traditional, I think “if-part” and
“then-part” are clearer for people nowadays.
Example. Find the antecedent (if-part) and the consequent (then-part) of the following conditional state-
ment:
“If x > y, then y > Calvin.”
Construct the converse, the inverse, and the contrapositive.
The antecedent is “x > y” and the consequent is “y > Calvin”.
The converse is “If y > Calvin, then x > y”.
The inverse is “If x 6> y, then y 6> Calvin.”
The contrapositive is “If y 6> Calvin, then x 6> y”.
Later on, I’ll show that a conditional statement and its contrapositive are logically equivalent.
Example. Construct the converse, the inverse, and the contrapositive of the following conditional statement:
“If Calvin gets a hot dog, then Calvin doesn’t get a soda.”
The converse is “If Calvin doesn’t get a soda, then Calvin gets a hot dog”.
The inverse is “If Calvin doesn’t get a hot dog, then Calvin gets a soda”. (Note that the literal negation
of the consequent is “It is not the case that Calvin doesn’t get a soda”. But the two negations cancel out
— this is called double negation — so I get “Calvin gets a soda”.)
The contrapositive is “If Calvin gets a soda, then Calvin doesn’t get a hot dog”.
Different fields use different formats for citing sources. For instance, you may have seen books which
referred to sources using footnotes. Mathematicians often use numbers in square brackets (like “[1]” or “[2]”)
for citations. The numbers refer to the references, which are listed at the end of the paper or book. Among
other things, it makes for less clutter on the text pages, and is easier to typeset.
Some authors prefer to use abbreviations involving the name of the author or the date of publication
instead of numbers. If you’re publishing an article in a journal, the journal will usually have a style that
you’re expected to follow. I think the important things are to give complete references so that a reader can
look them up, and to make it clear what reference in the bibliography you’re referring to.
Here are the references which I cited in the example above.
[1] Charles W. Curtis and Irving Reiner, Representation theory of finite groups and associative algebras. New
York: Interscience Publishers, 1962. [ISBN 0-470-18975-4]
[2] Brayton Gray, Homotopy theory. New York: Academic Press, 1975. [ISBN 0-12-296050-5]
This table is easy to understand. If P is true, its negation ¬P is false. If P is false, then ¬P is true.
P ∧ Q should be true when both P and Q are true, and false otherwise:
P Q P ∧Q
T T T
T F F
F T F
F F F
P ∨ Q is true if either P is true or Q is true (or both — remember that we’re using “or” in the inclusive
sense). It’s only false if both P and Q are false.
P Q P ∨Q
T T T
T F T
F T T
F F F
P Q P →Q
T T T
T F F
F T T
F F T
To understand why this table is the way it is, consider the following example:
“If you get an A, then I’ll give you a dollar.”
1
The statement will be true if I keep my promise and false if I don’t.
Suppose it’s true that you get an A and it’s true that I give you a dollar. Since I kept my promise, the
implication is true. This corresponds to the first line in the table.
Suppose it’s true that you get an A but it’s false that I give you a dollar. Since I didn’t keep my promise,
the implication is false. This corresponds to the second line in the table.
What if it’s false that you get an A? Whether or not I give you a dollar, I haven’t broken my promise.
Thus, the implication can’t be false, so (since this is a two-valued logic) it must be true. This explains the
last two lines of the table.
P ↔ Q means that P and Q are equivalent. So the double implication is true if P and Q are both
true or if P and Q are both false; otherwise, the double implication is false.
P Q P ↔Q
T T T
T F F
F T F
F F T
You should remember — or be able to construct — the truth tables for the logical connectives. You’ll
use these tables to construct tables for more complicated sentences. It’s easier to demonstrate what to do
than to describe it in words, so you’ll see the procedure worked out in the examples.
Remark. (a) When you’re constructing a truth table, you have to consider all possible assignments of True
(T) and False (F) to the component statements. For example, suppose the component statements are P , Q,
and R. Each of these statements can be either true or false, so there are 23 = 8 possibilities.
When you’re listing the possibilities, you should assign truth values to the component statements in a
systematic way to avoid duplication or omission. The easiest approach is to use lexicographic ordering.
Thus, for a compound statement with three components P , Q, and R, I would list the possibilities this way:
P Q R
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
(b) There are different ways of setting up truth tables. You can, for instance, write the truth values “under”
the logical connectives of the compound statement, gradually building up to the column for the “primary”
connective.
I’ll write things out the long way, by constructing columns for each “piece” of the compound statement
and gradually building up to the compound statement. Any style is fine as long as you show enough work
to justify your results.
Example. Construct a truth table for the formula ¬P ∧ (P → Q).
First, I list all the alternatives for P and Q.
Next, in the third column, I list the values of ¬P based on the values of P . I use the truth table for
negation: When P is true ¬P is false, and when P is false, ¬P is true.
2
In the fourth column, I list the values for P → Q. Check for yourself that it is only false (“F ”) if P is
true (“T ”) and Q is false (“F ”).
The fifth column gives the values for my compound expression ¬P ∧ (P → Q). It is an “and” of ¬P
(the third column) and P → Q (the fourth column). An “and” is true only if both parts of the “and” are
true; otherwise, it is false. So I look at the third and fourth columns; if both are true (“T ”), I put T in the
fifth column, otherwise I put F .
P Q ¬P P →Q ¬P ∧ (P → Q)
T T F T F
T F F F F
F T T T T
F F T T T
A tautology is a formula which is “always true” — that is, it is true for every assignment of truth
values to its simple components. You can think of a tautology as a rule of logic.
The opposite of a tautology is a contradiction, a formula which is “always false”. In other words, a
contradiction is false for every assignment of truth values to its simple components.
P Q P →Q Q→P (P → Q) ∨ (Q → P )
T T T T T
T F F T T
F T T F T
F F T T T
The last column contains only T’s. Therefore, the formula is a tautology.
P Q R P →Q Q→R (P → Q) ∧ (Q → R)
T T T T T T
T T F T F F
T F T F T F
T F F F T F
F T T T T T
F T F T F F
F F T T T T
F F F T T T
3
You can see that constructing truth tables for statements with lots of connectives or lots of simple
statements is pretty tedious and error-prone. While there might be some applications of this (e.g. to digital
circuits), at some point the best thing would be to write a program to construct truth tables (and this has
surely been done).
The point here is to understand how the truth value of a complex statement depends on the truth
values of its simple statements and its logical connectives. In most work, mathematicians don’t normally
use statements which are very complicated from a logical point of view.
Example. (a) Suppose that P is false and P ∨ ¬Q is true. Tell whether Q is true, false, or its truth value
can’t be determined.
(b) Suppose that (P ∧ ¬Q) → R is false. Tell whether Q is true, false, or its truth value can’t be determined.
(a) Since P ∨ ¬Q is true, either P is true or ¬Q is true. Since P is false, ¬Q must be true. Hence, Q must
be false.
(b) An if-then statement is false when the “if” part is true and the “then” part is false. Since (P ∧ ¬Q) → R
is false, P ∧ ¬Q is true. An “and” statement is true only when both parts are true. In particular, ¬Q must
be true, so Q is false.
Example. Suppose
“x > y” is true.
Z
“ f (x) dx = g(x) + C” is false.
P Q R P →Q ¬R (P → Q) → ¬R
T F T F F T
4
The statement “10 > 42” is false. You can’t tell whether the statement “Ichabod Xerxes eats chocolate
cupcakes” is true or false — but it doesn’t matter. If the “if” part of an “if-then” statement is false, then
the “if-then” statement is true. (Check the truth table for P → Q if you’re not sure about this!) So the
given statement must be true.
Two statements X and Y are logically equivalent if X ↔ Y is a tautology. Another way to say this
is: For each assignment of truth values to the simple statements which make up X and Y , the statements
X and Y have identical truth values.
From a practical point of view, you can replace a statement in a proof by any logically equivalent
statement.
To test whether X and Y are logically equivalent, you could set up a truth table to test whether X ↔ Y
is a tautology — that is, whether X ↔ Y “has all T’s in its column”. However, it’s easier to set up a table
containing X and Y and then check whether the columns for X and for Y are the same.
P Q P →Q ¬P ¬P ∨ Q
T T T F T
T F F F F
F T T T T
F F T T T
Since the columns for P → Q and ¬P ∨ Q are identical, the two statements are logically equivalent.
This tautology is called Conditional Disjunction. You can use this equivalence to replace a conditional
by a disjunction.
There are an infinite number of tautologies and logical equivalences; I’ve listed a few below; a more
extensive list is given at the end of this section.
Double negation ¬(¬P ) ↔ P
DeMorgan’s Law ¬(P ∨ Q) ↔ (¬P ∧ ¬Q)
DeMorgan’s Law ¬(P ∧ Q) ↔ (¬P ∨ ¬Q)
Contrapositive (P → Q) ↔ (¬Q → ¬P )
Modus ponens [P ∧ (P → Q)] → Q
Modus tollens [¬Q ∧ (P → Q)] → ¬P
When a tautology has the form of a biconditional, the two statements which make up the biconditional
are logically equivalent. Hence, you can replace one side with the other without changing the logical meaning.
You will often need to negate a mathematical statement. To see how to do this, we’ll begin by showing
how to negate symbolic statements.
Example. Write down the negation of the following statements, simplifying so that only simple statements
are negated.
(a) (P ∨ ¬Q)
(b) (P ∧ Q) → R
5
(a) I negate the given statement, then simplify using logical equivalences. I’ve given the names of the logical
equivalences on the right so you can see which ones I used.
(b)
¬[(P ∧ Q) → R] ↔ ¬[¬(P ∧ Q) ∨ R] Conditional Disjunction
↔ ¬¬(P ∧ Q) ∧ ¬R DeMorgan’s law
↔ (P ∧ Q) ∧ ¬R Double negation
I showed that (A → B) and (¬A ∨ B) are logically equivalent in an earlier example.
In the following examples, we’ll negate statements written in words. This is more typical of what you’ll
need to do in mathematics. The idea is to convert the word-statement to a symbolic statement, then use
logical equivalences as we did in the last example.
Example. Use DeMorgan’s Law to write the negation of the following statement, simplifying so that only
simple statements are negated:
Let C be the statement “Calvin is home” and let B be the statement “Bonzo is at the moves”. The
given statement is ¬C ∨ B. I’m supposed to negate the statement, then simplify:
Example. Use DeMorgan’s Law to write the negation of the following statement, simplifying so that only
simple statements are negated:
Let P be the statement “Phoebe buys a pizza” and let C be the statement “Calvin buys popcorn”.
The given statement is P → C. To simplify the negation, I’ll use the Conditional Disjunction tautology
which says
(P → Q) ↔ (¬P ∨ Q)
That is, I can replace P → Q with ¬P ∨ Q (or vice versa).
Here, then, is the negation and simplification:
The result is “Phoebe buys the pizza and Calvin doesn’t buy popcorn”.
Next, we’ll apply our work on truth tables and negating statements to problems involving constructing
the converse, inverse, and contrapositive of an “if-then” statement.
6
“If x and y are rational, then x + y is rational.”
By the contrapositive equivalence, this statement is the same as “If x + y is not rational, then it is not
the case that both x and y are rational”.
This answer is correct as it stands, but we can express it in a slightly better way which removes some of
the explicit negations. Most people find a positive statement easier to comprehend than a negative statement.
By definition, a real number is irrational if it is not rational. So I could replace the “if” part of the
contrapositive with “x + y is irrational”.
The “then” part of the contrapositive is the negation of an “and” statement. You could restate it as
“It’s not the case that both x is rational and y is rational”. (The word “both” ensures that the negation
applies to the whole “and” statement, not just to “x is rational”.)
By DeMorgan’s Law, this is equivalent to: “x is not rational or y is not rational”. Alternatively, I could
say: “x is irrational or y is irrational”.
Putting everything together, I could express the contrapositive as: “If x + y is irrational, then either x
is irrational or y is irrational”.
(As usual, I added the word “either” to make it clear that the “then” part is the whole “or” statement.)
Example. Show that the inverse and the converse of a conditional are logically equivalent.
Let P → Q be the conditional. The inverse is ¬P → ¬Q. The converse is Q → P .
I could show that the inverse and converse are equivalent by constructing a truth table for (¬P →
¬Q) ↔ (Q → P ). I’ll use some known tautologies instead.
Start with ¬P → ¬Q:
Remember that I can replace a statement with one that is logically equivalent. For example, in the last
step I replaced ¬¬Q with Q, because the two statements are equivalent by Double negation.
7
List of Tautologies
These problems will illustrate some of the logical concepts we’ve looked at, as well as illustrating some
proof techniques that we’ll look at in more detail later. These proofs are written entirely in words, so for
the moment we don’t need to worry about the presentation details associated with mathematical symbols.
The general setup: You’re on an island where each inhabitant is a truth-teller or a liar. Truth-tellers
always tell the truth; liars always lie. You’re given some information about some people, usually in the form
of statements they make. You’re asked to determine whether each person is a truth-teller or a liar. In some
cases, it may be impossible to determine what everyone is, or the situation may be impossible.
Example. You’re on an island where each inhabitant is a truth-teller or a liar. Truth-tellers always tell
the truth; liars always lie. Calvin and Phoebe are on the island.
(In this problem, I notice that I can determine the truth or falsity of the statement “34 is odd” without
knowing anything about Phoebe or Calvin. So I’ll start with it and see what follows from it.)
Since “34 is odd” is false, the “if” part of Phoebe’s statement is false. Hence, Phoebe’s statement is
true. Therefore, Phoebe must be a truth-teller.
Now Calvin says “Phoebe is a liar”, and that is false, since I just showed that Phoebe is a truth-teller.
Therefore, Calvin is a liar.
Thus, Phoebe is a truth-teller and Calvin is a liar.
Here are some general ideas about how you might approach a problem like this. Pick a character in the
problem — let’s say you pick “Leopold”. Consider the two cases: “Leopold is a truth-teller” or “Leopold is
a liar”. You can picture the reasoning process as a tree:
Leopold Leopold
truth-teller liar
You can start with either case — let’s suppose you start with “Leopold is a truth-teller”. (Note that
this means anything he said is true.) Reason from this until you get a contradiction, a solution (that is,
you know what all the characters are), or no conclusion.
I’ll consider the first of these three cases in more detail, but similar ideas hold for the other two cases.
Thus, suppose “Leopold is a truth-teller” gives a contradiction. Then he can’t be a truth-teller, so he
must be a liar. The “Leopold is a truth-teller” branch of the tree is finished: Switch to the “Leopold is a
liar” branch and start reasoning there.
Leopold Leopold
truth-teller liar
contradiction
(a) If “Leopold is a liar” gives a contradiction, then both cases have given a contradiction and the
1
original problem is impossible.
Leopold Leopold
truth-teller liar
contradiction contradiction
I
(b) If “Leopold is a liar” gives a solution, then that’s the answer to the original problem.
Leopold Leopold
truth-teller liar
contradiction s
T s
(c) If “Leopold is a liar” gives no conclusion, then you need to take cases on another character. Let’s
say Molly is another character. Then we have the cases “Molly is a truth-teller” and “Molly is a liar”, and
they are sub-cases of “Leopold is a liar”.
Leopold Leopold
truth-teller liar
contradiction
Now you have to continue reasoning with the two branches “Molly is a truth-teller” and “Molly is a
liar”.
If at some point all the branches end in contradictions, then the problem is impossible. If all the branches
end in contradictions but one ends in a solution, then the solution is the answer to the problem. If more
than one branch ends in a solution, the problem has multiple answers. If any of the branches ends in no
conclusion, and you have no more characters with which to take cases, then again the problem has multiple
answers.
Similar things would happen if our original choice (“Leopold is a truth-teller”) gave a solution, or no
conclusion.
It may also be that you should have started reasoning with another character — so in the example I
just went through, maybe you should have started by taking cases on Molly instead of Leopold. As with a
lot of problem-solving and proof-writing, you should become accustomed to working on scratch paper and
possibly throwing away early attempts in favor of later ones.
Example. You’re on an island where each inhabitant is a truth-teller or a liar. Truth-tellers always tell
the truth; liars always lie. Calvin and Phoebe are on the island.
Calvin says: “One or both of us is a liar.”
Determine whether each person is a truth-teller or a liar.
2
Suppose Calvin is a liar. Then the statement “One or both of us is a liar” is true, contradicting the fact
that Calvin is a liar.
Hence, Calvin is a truth-teller. Therefore, his statement is true, and at least one of them is a liar. Since
it isn’t Calvin, it must be Phoebe.
Thus, Calvin is a truth-teller and Phoebe is a liar.
1. If there are statements whose truth value you know (like “34 is odd”), begin with that information
and see what you can conclude. For example, if Phoebe says “34 is odd”, then (since the statement is false)
I know Phoebe is a liar.
2. You must take cases in pairs, e.g. “Calvin is a liar” and “Calvin is a truth teller”. And once you
take cases, you must consider both.
3. Don’t take cases unless you have to — that is, unless you can’t go any further with the information
you know.
4. Observe that these solutions are written entirely in words: We aren’t using truth tables here. You
should avoid using symbols unless they are necessary. Mathematics does not necessarily require the use of
symbols!
It’s okay to use pictures (like the trees I drew above) to clarify your reasoning, but a picture is not a
substitute for a verbal proof.
Example. You’re on an island where each inhabitant is a truth-teller or a liar. Truth-tellers always tell
the truth; liars always lie. Calvin and Phoebe are on the island.
Suppose Calvin is a liar. Then his statement is false. Since it’s an if-then statement, the if-part must
be true and the then-part must be false. The if-part is “I am a liar”, which is indeed true (by assumption).
Then then-part must be false, so “Phoebe is a liar” is false, and hence Phoebe is a truth-teller. This means
Phoebe’s statement “Calvin is a truth-teller” is true, which contradicts our assumption that Calvin is a liar.
Since “Calvin is a liar” led to a contradiction, Calvin must be a truth-teller. Now Phoebe says “Calvin
is a truth-teller”, so she is telling the truth, and she is a truth-teller. Calvin’s statement is “If I am a liar,
then Phoebe is a liar”. Both parts (“I am a liar” and “Phoebe is a liar”) are false, so the if-then statement
is true, consistent with Calvin being a truth-teller.
Since “Calvin is a liar” led to a contradiction and “Calvin is a truth-teller” led to a solution (consistent
with both characters’ statements), we find that Calvin is a truth-teller and Phoebe is a truth-teller.
I noted that it’s possible that a problem like this can’t be solved, for either of the following reasons:
(a) There isn’t enough information to determine what all the characters are.
(b) The given situation is impossible: All the cases lead to contradictions.
Truth-teller and liar problems (and more complicated variants) were popularized by the logician Ray-
mond Smullyan, who wrote a number of books with problems like this (see [1], for example).
3
[1] Raymond Smullyan, What is the name of this book. New York: Dover Publications, 2011.
P = “x is an integer”
Q = “x is even”
R = “x is odd”
The statement can be expressed as the implication P → (Q ∨ R).
The simple statements contain a variable x, and you might find it difficult to translate these statements
without using a variable (or, what is the same thing, a pronoun). The reason is that the original statement
is meant to apply to every element of a set — in this case, every element of the set of integers.
You can see that I’m cheating in making my translation: “x is an integer” is not a single statement
about a uniquely specified object “x”. It is a different kind of statement than “42 is an integer”, which talks
about a specific integer 42.
I can use quantifiers to translate statements like these so as to capture this meaning. Mathematicians
use two quantifiers:
(a) ∀, the universal quantifier, which is read “for all”, “for every”, or “for each”.
(b) ∃, the existential quantifier, which is read “there is” or “there exists”.
Here are some examples which show how they’re used. Let P (x) mean “x likes pizza”. Then:
Note that if “Someone likes pizza” is true, it may be true that “Everyone likes pizza”. On the other
hand, if “Everyone likes pizza” — and assuming that the set of people is nonempty — it must be true that
“Someone likes pizza”.
Here are how the negations of the statements come out in words:
¬∀x(P (x)) means “Not everyone likes pizza”.
Example. Translate each statement using universal or existential quantifiers. Then determine whether the
statement is true or false.
(a) Every real number is either rational or irrational.
(b) There is a real number in the interval [0, 1] which is a root of the equation x7 + x − 1 = 0.
(c) Every real number is smaller than another real number.
1
R(x) = “x is rational”
I(x) = “x is irrational”
The statement may be translated as ∀x(R(x) ∨ I(x)). (Some people prefer to write the initial x as a
subscript: ∀x (R(x) ∨ I(x)). Use whichever form you prefer.) Here are the details.
First, when you use a quantifier you do so within the context of some universe of applicable objects.
For this statement, the universe would be the set of real numbers. (It would be of little use to let x be a
car, or an orange, or the right to freedom of speech.)
How do you know what the universe is for a given quantified statement? Sometimes, it is apparent
from the context: In a mathematical discussion, it would probably be clear that the statement above was
intended to apply to real numbers. In any case where confusion might arise, you should name the universe
for quantification explicitly. In this case, the first part of the statement (“Every real number”) makes it clear
that the universe is the set of real numbers.
Notice that there is no conditional (“→”) in the quantified translation.
√The statements R(x)
√ and I(x) depend on the variable x. That is, R(2) would mean “2 is rational”,
R( 5) would mean “ 5 is rational” and so on. R(x) and I(x) are called one-place predicates or single
variable predicates.
Finally, note that while this statement happens to be true, truth value is distinct from how you translate
the statement.
(b) In this case, the universe would be the set of real numbers. I’ll use the following predicates:
P(x) = “0 ≤ x ≤ 1”
Q(x) = “x7 + x − 1 = 0”
2. The statement doesn’t say that there is only one x that works. “There exists” means “there exists
at least one” — but there may be more than one.
(c) The universe is the set of real numbers. The translation is ∀x∃y(x < y).
x < y is an example of a two-place or two-variable predicate, since it involves the variables x and
y.
(d) The universe is the set of real numbers. The translation is ∀x∃y(y < x).
Example. Let P (x) mean “x likes pepperoni”, O(x) mean “x likes onions”, N A(x) mean “x does not want
anchovies”, A(x, y) mean “x is afraid of y”, and let c stand for Calvin Butterball. Translate each statement
into English.
(a) ∀x(P (x) → ¬N A(x)) means “Everyone who likes pepperoni wants anchovies”.
(b) ∃x(P (x) ∧ N A(x)) means “Someone who likes pepperoni does not want anchovies”.
2
(c) ∀x∃y(P (x) ∧ A(x, y)) means “Everyone likes pepperoni and is afraid of someone”.
(d) ¬∃x[∀y(O(x) ∧ N A(y) ∧ A(x, y))] means “No one who likes onions is afraid of everyone who doesn’t want
anchovies”.
Example. Let P (x) mean “x likes pepperoni”, O(x) mean “x likes onions”, N A(x) mean “x does not want
anchovies”, A(x, y) mean “x is afraid of y”, and let c stand for Calvin Butterball. Translate each statement
into logical symbols.
(a) The statement is that there are people who don’t like pepperoni. In logical symbols, this is ∃x¬P (x).
(b) The statement means that if someone likes pepperoni, then the person likes onions. In logical symbols,
this is ∀x(P (x) → O(x).
(c) The statement means that everybody likes both pepperoni and onions. In logical symbols, this is ∀x(P (x)∧
O(x)).
Do you understand the difference between the statements in (b) and (c)? In (b), you know that if
there is a person who likes pepperoni, then the person likes onions. But there might not be anyone who
likes pepperoni! In (c), everyone likes both pepperoni and onions, so in particular, there are certainly many
people who like pepperoni.
Let P (x) mean “x likes pizza”. The statement may be written in quantified form as ∀x(P (x)). The
negation is (literally) ¬∀x(P (x)): “It is not the case that everyone likes pizza”. What does this mean?
A common mistake is to think that this means “No one likes pizza”. However, ask yourself what it
would take to show that the original statement was false. If I knew, for instance, that Calvin Butterball
doesn’t like pizza, that’s enough to prove that “Everyone likes pizza” is false.
In other words, for “Everyone likes pizza” to be false — or equivalently, for “It is not the case that
everyone likes pizza” to be true — it’s enough if I find someone who doesn’t like pizza. So the negation
actually means “There exists someone who doesn’t like pizza” — in symbols, ∃x(¬P (x)).
Let Q(x) mean “x likes lasagne”. What is the negation of “Someone likes lasagne”?
In symbols, “Someone likes lasagne” becomes ∃x(Q(x)). The negation is ¬∃x(Q(x)). In words, this
is: “It is not the case that someone likes lasagne”. This is the same as “No one likes lasagne”, which is
∀x(¬Q(x)).
To summarize:
In other words, to negate a quantified statement, change the quantifier to the “other” quantifier — ∀
to ∃ and ∃ to ∀ — and negate the “stuff inside”.
Example. Negate the following quantified statements. Simplify your answers so that only simple statements
are negated.
3
(a) ∀x(P (x) → Q(x))
(b) ∀x∀y [x < y → (∃z(x < z < y))]
(a)
¬ [∀x(P (x) → Q(x))] ↔ ∃x¬ [P (x) → Q(x)] (Negate a quantifier)
↔ ∃x¬ [¬P (x) ∨ Q(x)] (Conditional disjunction)
↔ ∃x [¬¬P (x) ∧ ¬Q(x)] (DeMorgan)
↔ ∃x [P (x) ∧ ¬Q(x)] (Double negation)
Suppose P (x) means “x is a dog” and Q(x) means “x has four legs”. Then ∀x(P (x) → Q(x)) means
“All dogs have four legs”.
The literal negation is “It is not the case that all dogs have four legs”. What would you need to do to
show that this statement is true? You’d need to produce a dog that does not have four legs: That is, there
exists a dog that does not have four legs. In symbols, this is ∃x(P (x) ∧ ¬Q(x)).
(b)
¬ (∀x∀y [x < y → (∃z(x < z < y))]) ↔ ∃x∃y¬ [x < y → (∃z(x < z < y))] (Negate quantifiers)
↔ ∃x∃y¬ [x ≥ y ∨ (∃z(x < z < y))] (Conditional disjunction)
↔ ∃x∃y [x < y ∧ ¬ (∃z(x < z < y))] (DeMorgan)
↔ ∃x∃y [x < y ∧ (∀z[¬(x < z < y)])] (Negate a quantifier)
In a couple of the steps, I used the fact that the negation of x < y is x ≥ y, and vice versa.
Example. Negate the following quantified statements. Simplify your answers so that only simple statements
are negated.
(a) Every student sleeps late on Saturdays.
(b) There is a professor who is afraid of the ducks.
(a) The negation is “Some students do not sleep late on Saturdays”.
To see this symbolically, let S(x) mean “x is a student” and let L(x) mean “x sleeps late on Saturdays”.
The given statement is ∀x[S(x) → L(x)]. Negate it:
(I omitted a double negation step, and will often do this in the future.) In words, this says “There is a
student who does not sleep late on Saturdays”.
(b) Let P (x) mean “x is a professor” and let D(x) mean “x is afraid of the ducks”. The given statement is
∃x(P (x) ∧ D(x)). Negate it:
The last statement is correct — only simple statements are negated — but clumsy to read in words.
It would say “Every person is either not a professor or not afraid of the ducks”. I could make this a little
better by using conditional disjunction:
This reads literally as “If x is a professor, then x is not afraid of the ducks”. I can remove the “x” by
saying “Every professor is not afraid of the ducks”.
4
If you know a quantified statement is true, you can draw certain conclusions.
Universal Quantifiers. If you know ∀xP (x), then for any element c in the universe, P (c) is true. Thus,
if a and b are elements of the universe, P (a) is true and P (b) is also true.
∀x(x ≤ x2 ).
If I know this is true, then I can specialize it to any particular natural number. So “1 ≤ 12 ” is true,
“2 ≤ 22 ” is true, “3 ≤ 32 ” is true, and so on.
Existential Quantifiers. If you know ∃xP (x), then you can say there is an element c such that P (c).
In a proof, you will usually say something like: “Let c satisfy P (c)”, or “Let c be such that P (c)”. When
you say “Let c . . . ”, you create an element named c — in this case, satisfying P (c). From then on, c acts
like a constant. In particular, you can’t assign a value to it arbitrarily.
In addition, the existence statement only guarantees the existence of at least one thing satisfying P (x).
So having said “Let c satisfy P (c)”, you can’t say in addition “And let d satisfy P (d)”, since this creates
another thing d which satisfies P (x). On the other hand, you can’t assume that c is the only thing which
satisfies P (x). Thus, there might be an element d such that P (d) — but you’re not justified in saying there
is.
∃f (f (x) = f ′ (x)).
If I know this is true and I want to use it in a proof, I might say: “Let f be a differentiable function
from R to R such that f (x) = f ′ (x).” √
Once I’ve done this, f comes into existence and acts like a constant — like 17, or π, or 2. The difference
between f and other constant things is that at the moment, all I know about f is that f (x) = f ′ (x). But
being “constant”, I can’t later say “Let f (x) = x2 ”, because that would assign “x2 ” to f (x).
I also can’t reuse the existence statement and now say: “Let g be a differentiable function from R to R
such that g(x) = g ′ (x).” I’m only entitled to one such function, and I already “let” it be f . At the same
time, there might be another function g such that g(x) = g ′ (x) — I just can’t assume there is.
We will spend some time doing formal logic proofs involving logical connectives and rules for inference,
but will not do formal logic proofs involving quantifiers. You can find proofs of that kind in books on classical
or formal logic.
On the other hand, the proofs which we do involving quantifiers will be ordinary proofs in mathematics.
Example. (a) (Proving a statement with an existential quantifier) Prove that
(b) (Disproving a statement with a universal quantifier) Show that the following statement is false:
(a) To show that an existence statement is true, I only need to find one case where it is true. The given
statement says in words that there is a real number x such that x2 − 2x < 0.
The graph of y = x2 − 2x is a parabola with roots at 0 and 2, so between 0 and 2 the parabola will
be below the x-axis. There are an infinite number of real numbers for which this is the case. For example,
x = 1 works: 12 − 2 · 1 = −1 < 0.
5
(b) To disprove a universal statement, I only need to find one case where it is false. The given statement
says in words that for every real number x, I have (x − 1)2 > 0. But this is false for x = 1: (1 − 1)2 = 02 = 0,
and 0 6 >0.
Note the parallel between (a) and (b). Also, note that disproving an existence statement or proving a
universal statement is more work than what we did here.
1. P Premise
2. P → Q Premise
3. Q Modus ponens (1, 2)
I’ll write logic proofs in 3 columns. The statements in logic proofs are numbered so that you can refer
to them, and the numbers go in the first column. The actual statements go in the second column. The third
column contains your justification for writing down the statement.
Thus, statements 1 (P ) and 2 (P → Q) are premises, so the rule of premises allows me to write them
down. Modus ponens says that if I’ve already written down P and P → Q — on any earlier lines, in either
order — then I may write down Q. I did that in line 3, citing the rule (“Modus ponens”) and the lines (1
and 2) which contained the statements I needed to apply modus ponens.
As I noted, the “P ” and “Q” in the modus ponens rule can actually stand for compound statements —
they don’t have to be “single letters”. For example:
1. (A ∨ ¬B) → ¬C Premise
2. ¬D Premise
3. A ∨ ¬B Premise
4. ¬C Modus ponens (1, 3)
There are several things to notice here. First, A ∨ ¬B is taking the place of P in the modus ponens rule,
and ¬C is taking the place of Q. That is, A ∨ ¬B and ¬C are compound statements which are substituted
for “P ” and “Q” in modus ponens.
Notice also that the if-then statement (A ∨ ¬B) → ¬C is listed first and the “if”-part ¬C is listed
second. It doesn’t matter which one has been written down first, and long as both pieces have already been
written down, you may apply modus ponens.
1
Finally, the statement ¬D didn’t take part in the modus ponens step. Perhaps this is part of a bigger
proof, and ¬D will be used later. The fact that it came between the two modus ponens pieces doesn’t make
a difference.
As usual in math, you have to be sure to apply rules exactly. For example, this is not a valid use of
modus ponens:
1. P Premise
2. (P ∧ Q) → R Premise
3. R INVALID modus ponens!
Do you see why? To use modus ponens on the if-then statement (P ∧ Q) → R, you need the “if”-part,
which is P ∧ Q. You only have P , which is just part of the “if”-part. That’s not good enough.
Double Negation. In any statement, you may substitute P for ¬¬P or ¬¬P for P (and write down the
new statement).
For example, in this case I’m applying double negation with P replaced by A → ¬C:
1. A → ¬¬B Premise
2. A → B Double negation (1)
Double negation comes up often enough that, we’ll bend the rules and allow it to be used without doing
so as a separate step or mentioning it explicitly. I’ll demonstrate this in the examples for some of the other
rules of inference.
Modus Tollens. If you know ¬Q and P → Q, you may write down ¬P .
1. ¬Q Premise
2. P → Q Premise
3. ¬P Modus tollens (1, 2)
In the next example, I’m applying modus tollens with P replaced by C and Q replaced by A → B:
1. ¬(A → B) Premise
2. C → (A → B) Premise
3. ¬C Modus tollens (1, 2)
The last example shows how you’re allowed to “suppress” double negation steps. Do you see how this
was done? If I wrote the double negation step explicitly, it would look like this:
1. ¬(A → B) Premise
2. C → (A → B) Premise
3. C → ¬¬(A → B) Double negation (2)
4. ¬C Modus tollens (1, 3)
When you apply modus tollens to an if-then statement, be sure that you have the negation of the
“then”-part. The following derivation is incorrect:
1. Q Premise
2. P → Q Premise
3. ¬P INVALID modus tollens!
2
To use modus tollens, you need ¬Q, not Q.
This is also incorrect:
1. Q Premise
2. P → Q Premise
3. P INVALID modus tollens!
This looks like modus ponens, but backwards. There is no rule that allows you to do this: The deduction
is invalid.
Disjunctive Syllogism. If you know ¬P and P ∨ Q, you may write down Q.
Here’s a simple example of disjunctive syllogism:
1. ¬P Premise
2. P ∨ Q Premise
3. Q Disjunctive syllogism (1, 2)
In the next example, I’m applying disjunctive syllogism with A ∨ B replacing P and D replacing Q in
the rule:
1. ¬(A ∨ B) Premise
2. (A ∨ B) ∨ D Premise
3. D Disjunctive syllogism (1, 2)
In the next example, notice that P is the same as ¬¬P , so it’s the negation of ¬P .
1. P Premise
2. ¬P ∨ (Q → R) Premise
3. Q → R Disjunctive syllogism (1, 2)
This is another case where I’m skipping a double negation step. Without skipping the step, the proof
would look like this:
1. P Premise
2. ¬P ∨ (Q → R) Premise
3. ¬¬P Double negation (1)
4. Q→R Disjunctive syllogism (2, 3)
Notice that a literal application of DeMorgan would have given ¬¬P ∧ ¬¬Q. I changed this to P ∧ Q,
once again suppressing the double negation step.
3
Conditional Disjunction. If you know P → Q, you may write down ¬P ∨ Q.
If you know ¬P ∨ Q, you may write down P → Q.
1. ¬P ∨ Q Premise
2. P → Q Conditional disjunction (1)
In additional, we can solve the problem of negating a conditional that we mentioned earlier.
1. ¬(P → Q) Premise
2. ¬(¬P ∨ Q) Conditional disjunction (1)
3. P ∧ ¬Q DeMorgan (2)
Negating a Conditional. If you know ¬(P → Q), you may write down P ∧ ¬Q.
If you know P ∧ ¬Q, you may write down ¬(P → Q).
The first direction is more useful than the second. Personally, I tend to forget this rule and just apply
conditional disjunction and DeMorgan when I need to negate a conditional. But you may use this if you
wish.
Think about this to ensure that it makes sense to you. If P ∧ Q is true, you’re saying that P is true and
that Q is true. So on the other hand, you need both P true and Q true in order to say that P ∧ Q is true.
Here’s an example. Notice that I put the pieces in parentheses to group them after constructing the
conjunction.
1. P ↔ Q Premise
2. P ∨ Q Premise
3. (P ↔ Q) ∧ (P ∨ Q) Constructing a conjunction (1, 2)
Rule of Syllogism. If you know P → Q and Q → R, then you may write down P → R.
The Rule of Syllogism says that you can “chain” syllogisms together. For example:
1. P → (Q ∨ R) Premise
2. (Q ∨ R) → ¬S Premise
3. P → ¬S Rule of syllogism (1, 2)
Definition of Biconditional. If you know P ↔ Q, you may write down P → Q and you may write down
Q → P . If you know P → Q and Q → P , you may write down P ↔ Q.
4
First, a simple example:
1. P ↔ Q Premise
2. Q → P Definition of biconditional (1)
By the way, a standard mistake is to apply modus ponens to a biconditional (“↔”). Modus ponens
applies to conditionals (“→”). So this isn’t valid:
1. P ↔ Q Premise
2. Q Premise
3. P INVALID - Not modus ponens!
1. P ↔Q Premise
2. Q Premise
3. Q→P Definition of biconditional (1)
4. P Modus ponens (2, 3)
Decomposing a Conjunction. If you know P ∧ Q, you may write down P and you may write down Q.
This rule says that you can decompose a conjunction to get the individual pieces:
1. P ∧ (Q ↔ ¬R) Premise
2. P Decomposing a conjunction (1)
2. Q ↔ ¬R Decomposing a conjunction (1)
1. P ∨ Q Premise
2. P INVALID!
What’s wrong with this? If you know that P ∨ Q is true, you know that one of P or Q must be true.
The problem is that you don’t know which one is true, so you can’t assume that either one in particular is
true.
On the other hand, it is easy to construct disjunctions.
Constructing a Disjunction. If you know P , and Q is any statement, you may write down P ∨ Q.
This says that if you know a statement, you can “or” it with any other statement to construct a
disjunction.
1. P Premise
2. P ∨ “Calvin sleeps with a night light.” Constructing a disjunction (1)
Notice that it doesn’t matter what the other statement is! Once you know that P is true, any “or”
statement with P must be true: An “or” statement is true if at least one of the pieces is true.
The next two rules are stated for completeness. They are easy enough that, as with double negation,
we’ll allow you to use them without a separate step or explicit mention.
Commutativity of Conjunctions. In any statement, you may substitute P ∧ Q for Q ∧ P (and write
down the new statement).
Commutativity of Disjunctions. In any statement, you may substitute P ∨ Q for Q ∨ P (and write down
the new statement).
5
Here is commutativity for a conjunction:
1. P ∧ ¬Q Premise
2. ¬Q ∧ P Commutativity (1)
1. (Q → P ) ∨ R Premise
2. R ∨ (Q → P ) Commutativity (1)
Before I give some examples of logic proofs, I’ll explain where the rules of inference come from. You’ve
probably noticed that the rules of inference correspond to tautologies. In fact, you can start with tautologies
and use a small number of simple inference rules to derive all the other inference rules.
Three of the simple rules were stated above: The Rule of Premises, Modus Ponens, and Constructing a
Conjunction. Here are two others. We’ve been using them without mention in some of our examples if you
look closely.
Equivalence You may replace a statement by another that is logically equivalent. (Recall that P and Q
are logically equivalent if and only if P ↔ Q is a tautology.)
For instance, since P and ¬¬P are logically equivalent, you can replace P with ¬¬P or ¬¬P with P .
This is Double Negation. As I mentioned, we’re saving time by not writing out this step.
Substitution. You may take a known tautology and substitute for the simple statements.
This amounts to my remark at the start: In the statement of a rule of inference, the simple statements
(“P ”, “Q”, and so on) may stand for compound statements. “May stand for” is the same as saying “may
be substituted with”. We’ve been doing this without explicit mention.
Here’s an example. The Disjunctive Syllogism tautology says
(¬P ∧ (P ∨ Q)) → Q.
Suppose you have ¬(A ∧ D) and (A ∧ D) ∨ C as premises. Here’s how you’d apply the simple inference
rules and the Disjunctive Syllogism tautology:
1. ¬(A ∧ D) Premise
2. (A ∧ D) ∨ C Premise
3. ¬(A ∧ D) ∧ ((A ∧ D) ∨ C) Constructing a conjunction (1, 3)
4. ¬(A ∧ D) ∧ ((A ∧ D) ∨ C) → C Substitution (Disjunctive Syllogism)
5. C Modus ponens (3, 4)
Notice that I used four of the five simple inference rules: the Rule of Premises, Modus Ponens, Construct-
ing a Conjunction, and Substitution. In line 4, I used the Disjunctive Syllogism tautology (¬P ∧(P ∨Q)) → Q
by substituting
A ∧ D for P and C for Q.
(Some people use the word “instantiation” for this kind of substitution.)
The advantage of this approach is that you have only five simple rules of inference. The disadvantage
is that the proofs tend to be longer. With the approach I’ll use, Disjunctive Syllogism is a rule of inference,
and the proof is:
1. ¬(A ∧ D) Premise
2. (A ∧ D) ∨ C Premise
3. C Disjunctive syllogism (1,2)
The approach I’m using turns the tautologies into rules of inference beforehand, and for that reason you
won’t need to use the Equivalence and Substitution rules that often. But you are allowed to use them, and
here’s where they might be useful. Suppose you’re writing a proof and you’d like to use a rule of inference —
6
but it wasn’t mentioned above. Write down the corresponding logical statement, then construct the truth
table to prove it’s a tautology (if it isn’t on the tautology list). Then use Substitution to use your new
tautology.
If you go to the market for pizza, one approach is to buy the ingredients — the crust, the sauce, the
cheese, the toppings — take everything home, assemble the pizza, and put it in the oven. Using tautologies
together with the five simple inference rules is like making the pizza from scratch. But you could also go to
the market and buy a frozen pizza, take it home, and put it in the oven. Using lots of rules of inference that
come from tautologies — the approach I’ll use — is like getting the frozen pizza.
Here are some proofs which use the rules of inference. In each case, some premises — statements that
are assumed to be true — are given, as well as a statement to prove. A proof consists of using the rules of
inference to produce the statement to prove from the premises.
¬A → (C ∧ D)
Example. Premises: A→B .
¬B
Prove: C.
1. A→B Premise
2. ¬B Premise
3. ¬A Modus tollens (1,2)
4. ¬A → (C ∧ D) Premise
5. C ∧D Modus ponens (3,4)
6. C Decomposing a conjunction (5)
It is one thing to see that the steps are correct; it’s another thing to see how you would think of making
them. I used my experience with logical forms combined with working backward.
I’m trying to prove C, so I looked for statements containing C. Only the first premise contains C. I
saw that C was contained in the consequent of an if-then; by modus ponens, the consequent follows if you
know the antecedent.
The “if”-part of the first premise is ¬A. Hence, I looked for another premise containing A or ¬A. The
only other premise containing A is the second one. In this case, A appears as the “if”-part of an if-then.
By modus tollens, ¬A follows from the negation of the “then”-part B. But I noticed that I had ¬B as a
premise, so all that remained was to run all those steps forward and write everything up.
It’s common in logic proofs (and in math proofs in general) to work backwards from what you want on
scratch paper, then write the real proof forward. The second part is important!
In order to do this, I needed to have a hands-on familiarity with the basic rules of inference: Modus
ponens, modus tollens, and so forth. You’ll acquire this familiarity by writing logic proofs.
You also have to concentrate in order to remember where you are as you work backwards. You may
need to scribble stuff on scratch paper to avoid getting confused. Keep practicing, and you’ll find that this
gets easier with time.
P ∧Q
Example. Premises: P → ¬(Q ∧ R) .
S→R
Prove: ¬S.
7
1. P ∧Q Premise
2. P Decomposing a conjunction (1)
3. Q Decomposing a conjunction (1)
4. P → ¬(Q ∧ R) Premise
5. ¬(Q ∧ R) Modus ponens (3,4)
6. ¬Q ∨ ¬R DeMorgan (5)
7. ¬R Disjunctive syllogism (3,6)
8. S→R Premise
9. ¬S Modus tollens (7,8)
¬(A ∨ B) → C
Example. Premises: ¬A .
¬C
Prove: B.
1. ¬(A ∨ B) → C Premise
2. ¬C Premise
3. A∨B Modus tollens (1,2)
4. ¬A Premise
5. B Disjunctive syllogism (3,4)
Notice that in step 3, I would have gotten ¬¬(A ∨ B). I omitted the double negation step, as I have in
other examples.
Modus ponens
1
2
c 2020 by Bruce Ikenaga 3
Direct Proof
A direct proof uses the facts of mathematics, the rules of inference, and any special assumptions
(premises or hypotheses) to draw a conclusion.
In contrast, an indirect proof (or proof by contradiction) starts by assuming in addition the
negation of the desired conclusion. When you reach a contradiction, you know that the negation of the
conclusion must be false, so the conclusion must be true.
We’ll consider direct proofs in this section and some that follow; proof by contradiction will be discussed
later.
Example. Prove that the product of two consecutive integers plus the larger of the two integers is a perfect
square.
For example, 5 and 6 are consecutive integers. Their product, plus the larger of the two, is 5 · 6 + 6 = 36,
which is 62 .
An example is not a proof. All my example has shown is that the statement is true for 5 and 6. It gives
me no particular reason for believing that the statement will be true for 293841 and 293842.
How can I represent two consecutive integers in symbolic form? Suppose n is the smaller of the two
integers. Then the next integer after n is n + 1. Now I have names for my integers: n and n + 1.
Next, I’ll translate the given statement into symbols.
the product of two consecutive integers plus the larger of the two integers is a perfect square
n · (n + 1) + (n + 1) = a perfect square
I could make a symbol for the right side — “m2 ”, for instance. (If I do this, I must not use “n2 ”,
because n already has a meaning.) But since I have an equation to prove, I’ll just start on the left side and
do algebra and see if I can get to the right side.
n · (n + 1) + (n + 1) = n2 + n + n + 1 = n2 + 2n + 1 = (n + 1)2 .
(n + 1)2 is a perfect square, since it is the square of the integer n + 1. That’s what I want.
If I clean up my proof, here is how it would look.
A pair of consecutive integers has the form n, n + 1, where n is an integer. The product of the two
consecutive integers plus the larger of the two integers is n(n + 1) + (n + 1). I want to show that this is a
perfect square.
By elementary algebra,
n · (n + 1) + (n + 1) = n2 + n + n + 1 = n2 + 2n + 1 = (n + 1)2 .
1
Notice that I was careful to state what the symbol n stood for when I introduced it. In the next sentence,
I explained how I was getting the expression n(n + 1) + (n + 1). I also stated what I was planning to prove.
The computation involves elementary algebra, so it isn’t necessary to explain each individual step. But I
did say that it was just elementary algebra, so a reader would know that there’s nothing fancy or complicated
going on.
When I got (n + 1)2 , I explained why it was what I wanted.
Finally, I indicated that the proof was finished by stating what I had proved, and tacking on the
end-of-proof symbol ( ).
You can often discover proofs by working backwards from what you want to prove, but you should be
careful not to work backwards in presenting a proof.
Example. Prove that if x is a nonzero real nuber, then
16
x6 + ≥ 8.
x6
On scratch paper, I might work backwards to figure out what to do:
16
x6 + ≥8
x6
16
x6 − 8 + 6 ≥ 0
x
2
4
x3 − 3 ≥0
x
The last line is true, because squares are always nonnegative. But what I just wrote is scratch work,
not a proof. You can’t start a proof by assuming what you want to prove.
I’ll discuss this in more detail below, but here’s one way to think about it: If you’re trying to show that
6 16
“x + 6 ≥ 8” is true and I start with it, then it’s true — so why do I need to write anything else?
x
Maybe you would say: “It’s only conditionally true until it’s confirmed by getting something true”. But
math doesn’t work that way — something is either true or false, and we don’t prove things by “confirmation”.
(This is a big difference from everyday life.)
Here is how I would write the proof correctly. I start with something I know is true, then work till I get
the thing I’m trying to prove. So:
Since squares are nonnegative,
2
3 4
x − 3 ≥0
x
16
x6 − 8 + ≥0
x6
16
x6 + 6 ≥ 8
x
There are others ways to write this proof. For instance, you could have started with (x6 − 4)2 ≥ 0. If
you do this, you will need to use the fact that x 6= 0 and the fact that x6 ≥ 0 to justify all the steps. (See if
you can tell why.)
2
When you’re writing a proof, don’t start with what you want to prove.
Assuming what you want to prove is known as begging the question. It is a very easy mistake to make,
because in everyday life you often reason by confirmation. That is, you make a guess, then collect evidence
and see if your guess is confirmed. However, logic doesn’t support this kind of reasoning.
Suppose that you know that P → Q is true, and you also know that Q is true. Do you know that P is
true?
P Q P →Q
? T T
If you examine the truth table for P → Q, you can see that in this case P could be either true or false.
In other words, if an implication (P → Q) is true and the conclusion (Q) is true, you can’t conclude that
the premise (P ) is true.
For instance, this is a valid sequence of algebra steps:
1=2
0·1 =0·2
0=0
I’ll let you try to work backwards to discover the proof that I’ll present.
We will use a combination of mathematical facts.
From trigonometry,
sin x ≥ −1, so 4 sin x ≥ −4.
Since the exponential function is always positive,
(x + 1)2 ≥ 0, so x2 + 2x + 1 ≥ 0.
3
Example. Prove that if x and y are nonnegative real numbers, then
x+y √
≥ xy.
2
(This is called the Arithmetic-Geometric Mean Inequality.)
I’ll try to figure out the proof by working backwards from what I want to prove. (So all of this is
scratchwork!)
x+y √
≥ xy
2
2
x+y √
≥ ( xy)2
2
x2 + 2xy + y 2
≥ xy
4
2 2
x + 2xy + y ≥ 4xy
x2 − 2xy + y 2 ≥ 0
(x − y)2 ≥ 0
At this point, I notice that I’ve obtained a true statement: A square must be greater than or equal to
0. To write the “real” proof, I’ll just reverse the steps I did, checking at each point that the algebra is still
valid.
(The real proof.) Suppose x and y are nonnegative real numbers. Since a square must be greater
than or equal to 0, I have
(x − y)2 ≥ 0
x2 − 2xy + y 2 ≥ 0
x2 + 2xy + y 2 ≥ 4xy
x2 + 2xy + y 2
≥ xy
4
2
x+y √
≥ ( xy)2
2
x+y √
≥ xy
2
In taking the square root of both sides in the last step, I didn’t need to use absolute values, because x
x+y √
and y (and hence and xy) are nonnegative.
2
When you write a proof, you usually omit any scratchwork that you used to discover it. It is like
removing the scaffolding after you’ve constructed a building. However, it can make proofs look mysterious
— if you only saw the real proof above, you might have wondered how anyone would have thought to start
with (x − y)2 ≥ 0. So it’s worthwhile when you’re teaching to let people in on the secret and show how the
proof was discovered — as long as you don’t substitute scratchwork for the real thing.
4
I’ll give the proof in finished form before I discuss it.
Now |x| + |y| is bigger than a number (x + y) and the negative of the number (−(x + y)), so it must be
bigger than the absolute value of the number:
When I started to write down this proof, I had what I thought was a neat idea. I don’t remember what
it was, but I wanted to use the inequality |x||y| ≥ xy. After a while, I decided that |x||y| ≥ xy was wrong,
and wrote down the proof above instead. I even remarked on my “mistake” in an earlier version of these
notes, as an example of a false start at a proof.
Later, a student asked why |x||y| ≥ xy was wrong. I stared at it for a while, then realized it was right!
I still don’t remember the neat idea I had for using it to do the proof, however.
In most math books and papers, you’ll see proofs written down like the one above. Rarely do you
read a discussion of the author’s false starts and confusions. But math is a human activity, and people
are imperfect. In writing proofs, you may often make mistakes — hopefully, better mistakes than the one
I made! — and you will often get stuck. Don’t let the polished proofs that you see in books lead you to
believe that writing proofs is supposed to be easy — or that, if it isn’t, then there’s something wrong with
you. Writing proofs is one of the most difficult mental activities anyone can attempt.
Now that you know the Triangle Inequality, you can use it to prove other results.
Example. Use the Triangle Inequality to prove:
(a) If x ∈ R, then |x2 + x| + |x − 1| ≥ |x2 + 1|.
(b) If a, b, c, d ∈ R, then |a − b| + |c − b| + |c − d| ≥ |a − d|.
(a) Note that |x − 1| = |1 − x|. So
|x2 + x| + |x − 1| = |x2 + x| + |1 − x|
≥ |(x2 + x) + (1 − x)|
= |x2 + 1|
|a − b| + |c − b| + |c − d| = |a − b| + |b − c| + |c − d|
≥ |(a − b) + (b − c) + (c − d)|
= |a − d|
5
Sometimes proofs use facts that you’ve seen in basic algebra. For example, squares are nonnegative: If
u ∈ real, then
u2 ≥ 0.
You may need to use facts from trigonometry. If u ∈ R, then you have inequalities
x2 − 8x + 5 cos 3x + 21 ≥ 0.
Example. Discuss the following “proof by picture”: You are trying to show that the angles in a triangle
add up to 180◦ .
180 o
Take the triangle and fold the top down as shown in the second picture so that the top vertex just
touches the base with the fold parallel to the base. Then fold the other two corners in from the left and
right.
The original angles of the triangle have been folded together into a straight angle (180◦ ). Therefore,
the angles in a triangle add up to 180◦ .
6
A picture can be helpful in understanding something. It can even be so convincing that it seems like a
“proof by picture”.
This looks very convincing, and it’s actually a good thing to show students in geoemtry class. But as a
proof, it has difficulties.
For one thing, I did the construction for a specific triangle. How do I know it will work with any triangle?
What if the triangle is obtuse, for example? What if it’s a right triangle with one side perpendicular to the
base?
Moreover, I asserted that the corners would fit together as shown, but I didn’t prove that it would work.
In general, you should be very careful in your use of pictures. You can (and should) use them to clarify
your explanations. But a picture is not a substitute for a rigorous argument.
There’s an obvious sense in which the “if” part of the second statement has more content that the “if”
part of the first statement. In the first statement, the “if” part doesn’t give you much to go on. In the
second statement, you would suspect that the number 3 is somehow related to the “then” part.
In this section, I’ll look at proofs of conditional statements where the “if” part carries that kind of
significant information.
x > 3, so x2 > 9.
Likewise,
x > 3, so 5x > 15.
If I add x2 > 9 and 5x > 15, I get x2 + 5x > 24. I compare this inequality to the target inequality, and
I see that I’m missing a “2” on the left and a “1” on the right. Well, 2 > 1, so adding this inequality to
x2 + 5x > 24, I obtain
x2 + 5x + 2 > 25.
Notice the conditional nature of the conclusion. It’s certainly not true that x2 + 5x + 2 > 25 for any
real number x. (For example, it’s false if x = 0.) The conclusion is true if the assumption x > 3 is true.
The last example shows how you write a conditional proof. In this situation, you’re trying to prove a
statement of the form P → Q, where P is the set of assumptions — it may be one statement, or several
statements — and Q is the conclusion. You assume P and try to derive Q. If you succeed, then P → Q is
true.
Example. (a) Prove that if x is a real number and x > 2, then x3 − 3x2 + 2x > 0.
(b) Give a specific example to show that the converse is false.
1
However, 0.5 6> 2.
For the next few examples, recall that an integer n is even if it can be written as n = 2m for some
integer m.
An integer n is odd if it can be written as n = 2m + 1 for some integer m.
Example. (Proving the contrapositive) Let n be an integer. Prove that if 3n2 + 5n + 18 is not even,
then n is not even.
Recall that the conditional P → Q is logically equivalent to its contrapositive ¬Q → ¬P . In some cases,
you use this to prove a conditional statement by replacing it with its contrapositive.
In this example, the given conditional statement is kind of awkward: Both the “if” and “then” parts
are negative statements. And if I try to prove this conditional statement by assuming the “if” part — that
is, assuming that 3n2 + 5n + 18 is not even — it isn’t obvious how to proceed.
Instead, I replace the statement with its contrapositive: “If n is even, then 3n2 + 5n + 18 is even.”
Begin by assuming the “if” part: Suppose n is even. By definition, this means that n = 2m, where m
is an integer. Then
3n2 + 5n + 18 = 3(2m)2 + 5(2m) + 18
= 12m2 + 10m + 18
= 2(6m2 + 5m + 9)
Now 6m2 +5m+9 is an integer, so 2(6m2 +5m+9) is even (by definition of “even”). Hence, 3n2 +5n+18
is even.
Since I’ve proved the contrapositive, this proves the original statement.
If a and b are integers, a divides b means that there is an integer c such that ac = b. a divides b is
written a | b for short.
For example, 6 | 18 because 6 · 3 = 18, 10 | 0 because 10 · 0 = 0, and −6 | 6 since (−6) · (−1) = 6.
On the other hand, 3 does not divide 5, since there is no integer c such that 3 · c = 5. “3 does not divide
5” is written 3 6 | 5.
Note that an integer n is even if and only if 2 | n.
Example. Prove that if n is an integer and n is divisible by 3, then 2n2 + 5n + 12 is divisible by 3.
Note that you have to prove this directly from the definition and rules of algebra; you can’t assume
“obvious” things like “the sum of numbers divisible by 3 is divisible by 3” (unless you prove these “obvious”
things first!).
Suppose n is divisible by 3. Then n = 3m for some integer m. So
I assume that n is an odd number. I want to prove that n2 leaves a remainder of 1 when it is divided
by 4.
2
An odd number is an integer which can be written in the form 2m + 1 for some integer m. Since n is
odd, n = 2m + 1 for some m.
Squaring n, I get
n2 = (2m + 1)2 = 4m2 + 4m + 1 = 4(m2 + m) + 1.
A conditional proof in logic will be a proof of a statement of the form “P → Q”. To do this:
(c) Prove Q from P and the given premises using rules of inference as usual.
(d) Conclude “P → Q”. Label it “Conditional proof”, and include the numbers of the statements for
P and for Q.
(A ∨ ¬C) → B
Example. Premises:
¬D → ¬B
Prove: A → D.
To prove the conditional statement A → D, I assume the “if” part A and try to prove the “then” part
D.
1. (A ∨ ¬C) → B Premise
2. ¬D → ¬B Premise
3. A Premise for conditional proof
4. A ∨ ¬C Constructing a disjunction
5. B Modus ponens (1, 4)
6. D Modus tollens (2, 5)
7. A→D Conditional proof (3, 6)
The then-part D was proved in line 6. Together with the if-part A in line 3, this proves the conditional
A → D.
A ∧ ¬D
Example. Premises:
B → (C → D)
Prove: (A → B) → ¬C.
To prove the conditional statement (A → B) → ¬C, I assume the “if” part A → B and try to prove
the “then” part ¬C.
1. A ∧ ¬D Premise
2. B → (C → D) Premise
3. A→B Premise for conditional proof
4. A Decomposing a conjunction (1)
5. B Modus ponens (1,3)
6. C→D Modus ponens (2,5)
7. ¬D Decomposing a conjunction (1)
8. ¬C Modus tollens (6,7)
9. (A → B) → ¬C Conditional proof (3,8)
3
The then-part ¬C was deduced on line 8. Together with the if-part A → B in line 3, this proves the
conditional (A → B) → ¬C.
Example. Show that there is a real number x such that sin x > 0 but cos x < 0.
There are many possibilities; for example,
√ √
3π 2 3π 2
sin = , but cos =− .
4 2 4 2
Example. Show that there is a real number x such that x2 + 30 < 11x.
Rewrite the inequality as
x
5 6
The graph lies below the x-axis between x = 5 and x = 6. So, for example, x = 5.5 meets the conditions:
In some cases, you can know that an object exists without having any way of finding it (or finding it
exactly). By analogy:
(a) If you throw your keys into a corn field, you know your keys are in the field — but you may have
trouble finding them!
(b) You know that Calvin Butterball has a birthday, even though you don’t know what day it is.
You’ve seen results of this kind in calculus. One such result is:
Theorem. (The Intermediate Value Theorem:) Let f be a continuous function on the interval [a, b].
Suppose that c is a number between f (a) and f (b). Then f (x) = c for some x in the interval [a, b].
The Intermediate Value Theorem does not tell you how to find an x such that f (x) = c — it simply
guarantees that such an x exists.
1
Example. Show that there is a real number x such that x = cos x.
The assertion means that the graphs of y = x and y = cos x intersect:
4
-6 -4 -2 2 4 6
-2
-4
It looks like they do. Note, however, that a picture is not a proof.
Let f (x) = cos x − x. Then
Since f (0) is positive and f (π) is negative, and since f is continuous for all x, the Intermediate Value
Theorem implies that there is an x between 0 and π for which f (x) = 0. Then cos x − x = 0, so cos x = x.
Notice that the Intermediate Value Theorem doesn’t tell you what x is, or how to find it. (It’s approx-
imately 0.73909.)
3c + f (c) = 10.
To say that there is an x satisfying a certain property does not mean that there is only one x satisfying
the property. If that is what is meant, it has to be stated explicitly. Hence, there might be many values
which satisfy the conclusion of the Intermediate Value Theorem.
Here’s another existence theorem from calculus:
Theorem. (Mean Value Theorem) Suppose f is function which is continuous on the closed interval
a ≤ x ≤ b and differentiable on the open interval a < x < b. Then there is a number c such that a < c < b
and
f (b) − f (a)
f ′ (c) = .
b−a
2
Example. Find a number c which satisfies the conclusion of the Mean Value Theorem when it is applied
to f (x) = x3 on the interval 1 ≤ x ≤ 3.
Note that
f (3) − f (1)
= 13.
3−1
r
′ 2 2 13
Now f (x) = 3x , so setting 3c = 13, I find that c = ± . Both of these values satisfy the conclusion
3
of the Mean Value Theorem.
Rolle’s theorem is special case of the Mean Value Theorem: With the assumptions of the theorem, if
f (a) = f (b), then there is a number c such that a < c < b and
f ′ (c) = 0.
In the last example, I found numbers satisfying the conclusion of the theorem — but again, there is
no guarantee that I can find such numbers explicitly. The theorem just says that at least one such number
exists.
Limits
The definition of a limit involves both universal and existential quantifiers.
Let f be a function from the real numbers to the real numbers, and let c be a real number. Assume
that f is defined on a open interval containing c. The statement lim f (x) = L means:
x→c
For every ǫ > 0, there is a δ > 0, such that if δ > |x − c| > 0, then ǫ > |f (x) − L|.
Think of δ as a thermostat, f (x) as the actual temperature in a room, and L as the ideal temperature.
Someone challenges you to make the actual temperature f (x) fall within a certain tolerance ǫ of the ideal
temperature L. You must do that by setting your δ-thermostat appropriately (so that x is sufficiently close
to c).
Moreover, note that it says “for every ǫ > 0”. It’s isn’t enough for you to say what you’d do if you were
challenged with ǫ = 0.1 or ǫ = 0.000004. You must prove that you can meet the challenge no matter what ǫ
you’re challenged with.
Finally, note the stipulation “|x − c| > 0”. This implies that x 6= c, since x = c gives |x − c| = 0. Thus,
the conclusion “ǫ > |f (x) − L|” must hold only for x’s close to c, but not necessarily for x = c. (It may hold
for x = c, but it doesn’t have to.)
What does this mean? It’s a precise way of saying that the value of the limit of f (x) as x approaches c
does not depend on what f (x) does at x = c — over even whether f (c) is defined.
For example, consider the functions whose graphs are shown below.
y = f(x) y = f(x)
x=3 x=3
In both cases,
lim f (x) = 4.
x→3
In the first case, f (3) = 2: The value of the function at x = 3 is different from the value of the limit.
In the second case, f (3) is undefined.
The fact that lim f (x) 6= f (3) means that f is not continuous at x = 3.
x→3
1
I’ll show how to find δ by working backwards; then I’ll write the proof “forwards”, the way you should
write it.
I want
ǫ
ǫ > |(5x + 4) − 14|, or ǫ > |5x − 10|, or > |x − 2|.
5
ǫ
It looks like I should set δ = .
5
All of this has been on “scratch paper”; now here’s the real proof.
ǫ
Suppose ǫ > 0. Let δ = . If δ > |x − 2| > 0, then
5
ǫ
> |x − 2|, so ǫ > |5x − 10|, or ǫ > |(5x + 4) − 14|.
5
ǫ
Thus, if δ = and δ > |x − 2| > 0, then ǫ > |(5x + 4) − 14|. This proves that lim (5x + 4) = 14.
5 x→2
Example. Let
3x + 4 if x < 1
f (x) = .
9 − 2x if x ≥ 1
Use the ǫ-δ definition of the limit to prove that
lim f (x) = 7.
x→1
Let ǫ > 0. I must find δ > 0 such that if δ > |x − 1| > 0, then ǫ > |f (x) − 7|.
Here’s my scratch work. First, for x < 1,
ǫ
ǫ > |f (x) − 7|, ǫ > |(3x + 4) − 7|, ǫ > |3x − 3|, > |x − 1|.
3
ǫ
It looks like I should take δ = .
3
For x > 1,
ǫ
ǫ > |f (x) − 7|, ǫ > |(9 − 2x) − 7|, ǫ > |2 − 2x| = |2x − 2|, > |x − 1|.
2
ǫ
It looks like I should take δ = .
2
In order to ensure that both the x < 1 and x > 1 requirements are satisfied, I’ll take δ to be the smaller
ǫ
of the two: δ = .
3
Now here’s the proof written out correctly.
ǫ
Suppose ǫ > 0. Let δ = , and assume that δ > |x − 1| > 0.
3
If x < 1, then
ǫ
> |x − 1|, so ǫ > |3x − 3| = |(3x + 4) − 7| = |f (x) − 7|.
3
ǫ ǫ ǫ ǫ
Now consider the case x > 1. Since > |x − 1|, and since > , I have > |x − 1|. Therefore,
3 2 3 2
2
(The case x = 1 is ruled out because |x − 1| > 0.)
ǫ
Thus, taking δ = guarantees that if δ > |x−1| > 0, then ǫ > |f (x)−7|. This proves that lim f (x) = 7.
3 x→1
lim x2 = 4.
x→2
Let ǫ > 0. I want to find δ > 0 such that if δ > |x − 2| > 0, then ǫ > |x2 − 4|.
I start out as usual with my scratch work:
Now I have a problem. I can use δ to control |x − 2|, but what do I do about |x + 2|?
The idea is this: Since I have complete control over δ, I can assume δ ≤ 1. When I finally set δ, I can
make it smaller if necessary to ensure that this condition is met.
Now if δ ≤ 1, then |x − 2| < 1, so 1 < x < 3, and 3 < x + 2 < 5. In particular, the biggest |x + 2| could
be is 5. So now
ǫ
ǫ > |x − 2||x + 2| becomes ǫ > |x − 2| · 5, so > |x − 2|.
5
ǫ
This inequality suggests that I set δ = — but then I remember that I needed to assume δ ≤ 1. I can
5
ǫ ǫ
meet both of these conditions by setting δ to the smaller of 1 and : that is, δ = min 1, .
5 5
That was scratchwork; now here’s the real proof.
ǫ
Let ǫ > 0. Set δ = min 1, . Suppose δ > |x − 2| > 0.
5
Since δ ≤ 1, I have
1 > |x − 2|
1<x<3
3< x+2<5
Therefore, 5 > |x + 2|.
ǫ ǫ
Now δ ≤ , so > |x − 2|.
5 5
ǫ
Now multiply the inequalities 5 > |x + 2| and > |x − 2|:
5
ǫ
ǫ= · 5 > |x − 2||x + 2| = |x2 − 4|.
5
ǫ
Thus, if δ = min 1, and δ > |x − 2| > 0, then ǫ > |x2 − 4|. This proves that lim x2 = 4.
5 x→2
x2 + 11
Example. Prove that lim = 3.
x→2 x + 3
x2 + 11
Let ǫ > 0. I must find δ such that if δ > |x − 2| > 0, then ǫ > −3 .
x+3
I’ll start with some scratchwork.
x2 + 11 x2 + 11 − 3(x + 3) x2 − 3x + 2 (x − 2)(x − 1) x−1
−3 = = = = |x − 2| .
x+3 x+3 x+3 x+3 x+3
3
x−1
I can use δ to control |x − 2| directly. I need to control the size of . It’s important to think of
x+3
1
this as |x − 1| · , not as |x − 1| and |x + 3|!
x+3
Assume 1 ≥ δ. Then 1 > |x − 2|, so 1 < x < 3.
For x − 1, 0 < x − 1 < 2, so |x − 1| < 2.
1 1 1 1 1 1
For , 4 < x + 3 < 6, so > > , and < .
x+3 4 x+3 6 x+3 4
Since all the number involved are positive, I can multiply the inequalities to obtain
1 1 1 1
2· > |x − 1| · , or > |x − 1| · .
4 x+3 2 x+3
x−1 1
Thus, I’ll get ǫ > |x − 2| if I have ǫ > |x − 2| · , or 2ǫ > |x − 2|. Here’s the proof.
x+3 2
1 1 x2 + 11
ǫ > |x − 2| · > |x − 2| · |x − 1| · = −3 .
2 x+3 x+3
x2 + 11
This proves that lim = 3.
x→2 x + 3
(¬B ∨ C) → A
Example. Premises: B→D
C ∨ ¬D
Prove: A.
Since I want to prove A by contradiction, I begin by assuming the negation ¬A. I’m trying to construct
a contradiction of the form FOO ∧ ¬FOO.
1. (¬B ∨ C) → A Premise
2. B→D Premise
3. C ∨ ¬D Premise
4. ¬A Premise - proof by contradiction
5. ¬(¬B ∨ C) Modus tollens (1, 4)
6. B ∧ ¬C DeMorgan (5)
7. B Decomposing a conjunction (6)
8. ¬C Decomposing a conjunction (6)
9. D Modus ponens (2, 7)
10. C Disjunctive syllogism (3, 9)
11. C ∧ ¬C Constructing a conjunction (8, 10)
12. A Proof by contradiction (4, 11)
I arrived at the contradiction C ∧ ¬C at line 11. Therefore, I conclude that my premise ¬A was false,
so A must be true (line 12).
In the next example, I’ll look at Euclid’s proof that there are infinitely many prime numbers; it occurs
in Book IX of Euclid’s Elements, which was composed around 300 B.C. and is arguably the most famous
math textbook of all time.
Example. Prove that there are infinitely many prime numbers. (An integer n > 1 is prime if its only
positive divisors are 1 and n.)
Suppose that there are not infinitely many prime numbers. That means there are finitely many prime
numbers — suppose they are
p1 , p2 , . . . , pn .
(It’s the product of all of the p’s, plus one. Notice that the product of the p’s wouldn’t make sense if
there were infinitely many p’s.)
x leaves a remainder of 1 when it’s divided by p1 , since p1 divides evenly into the p1 p2 · · · pn term.
Likewise, x leaves a remainder of 1 when it’s divided by p2 , . . . , pn . Therefore, x is not divisible by any of
the p’s — that is, x is not divisible by any prime number.
1
However, every integer greater than 1 is divisible by some prime number. A precise proof of this fact
requires induction, which I’ll discuss later. But you can see that it’s reasonable. If a number z is prime,
it’s divisible by a prime, namely z. Otherwise, you can factor z into a product of two smaller numbers. If
either factor is prime, then the prime factor is a prime which divides z. If neither factor of z is prime, you
can factor them, and so on. Eventually, the process must stop, because the factors always get smaller.
Returning to my proof, I’ve found that x isn’t divisible by any prime number, which I’ve just noted is
impossible. This contradiction shows that there must be infinitely many prime numbers.
Example. Prove that the following system of equations has no real solutions:
x2 − 10 + ey + sin y − 10x + 37 = 0
(x − 5)2 + ey + sin y + 2 = 0
The next example is another “classical” result. The discovery that there are quantities which can’t be
expressed in terms of whole numbers or their ratios was known to the ancient Greeks; Boyer and Mertzbach
[1] place the discovery prior
√ to 410 B.C.
Example. Prove that 2 is irrational. (A rational number is a real number which can be written in the
m
form , where m and n are integers. A real number which is not rational is irrational.)
n
√ √ m
Suppose on the contrary that 2 is rational. Then I can write 2 = , where m, n ∈ Z. (Remember
n
m
that Z stands for the set of integers.) By dividing out any common factors, I can assume that is in lowest
n
terms (that is, m and n have no common factors besides 1 and −1).
Clear the denominator, then square both sides:
√
2n = m, 2n2 = m2 .
Since 2 divides the left side, it must divide the right side. But if 2 divides m2 , it must in fact divide m.
So suppose m = 2k, where k ∈ Z. Substitute in the previous equation and cancel a factor of 2:
2n2 = (2k)2 = 4k 2 , n2 = 2k 2 .
2
Now 2 divides the right side, so it must divide the left side. But if 2 divides n2 , it must divide n.
However, I already showed that 2 divides m, so 2 divides both m and n. This contradicts my assumption
m
that the fraction was in lowest terms.
√n
Therefore, 2 must be irrational.
The preceding examples give situations in which proof by contradiction might be useful:
A proof by contradiction might be useful if the statement of a theorem is a negation — for example,
the theorem says that a certain thing doesn’t exist, that an object doesn’t have a certain property, or that
something can’t happen. In these cases, when you assume the contrary, you negate the original negative
statement and get a positive statement, which gives you something to work with.
Having said this, I should note that it is considered bad style to write a proof by contradiction when you
can give a direct proof. In those situations, the proof by contradiction often looks awkward. Moreover, the
direct proof will often tell you more. For example, a direct proof that something exists will often work by
constructing the object. This is better than simply knowing that the object exists on logical grounds.
In some cases, proof by contradiction is used as part of a larger proof — for instance, to eliminate
certain possibilities.
Example. Prove that the function f (x) = x5 + 6x3 + 17x + 1 cannot have more than one root.
In this proof, I’ll use Rolle’s Theorem, which says: If f is continuous on the interval [a, b], differentiable
on the interval (a, b), and f (a) = f (b), then f ′ (c) = 0 for some c ∈ (a, b).
Suppose on the contrary that f (x) = x5 + 6x3 + 17x + 1 has more than one root. Then f has at least
two roots. Suppose that a and b are (different) roots of f with a < b.
Since f is a polynomial, it is continuous and differentiable for all x. Since a and b are roots, I have
Example. On a certain island, each inhabitant always lies or always tells the truth. Calvin and Phoebe
live on the island.
Calvin says: “Exactly one of us is lying.”
Phoebe says: “Calvin is telling the truth.”
Determine who is telling the truth and who is lying.
Suppose Calvin is a truth teller. Then “Exactly one of us is lying” is true, and since Calvin is a truth
teller, Phoebe is a liar. Therefore, “Calvin is telling the truth” is a lie, so Calvin must be lying. This is a
contradiction, because I assumed he was telling the truth.
3
Hence, I’ve proved by contradiction that Calvin must be a liar. Hence, “Exactly one of us is lying” is
false. This gives two possibilities: Either both are telling the truth, or both are lying.
Suppose both are telling the truth. This contradicts the fact that Calvin is lying.
The only other possibility is that both are lying. Then Calvin’s statement “Exactly one of us is lying”
should be false (and it is), and Phoebe’s statement “Calvin is telling the truth” should be false (and it is).
Thus, this is the only possibility, and it’s consistent with the given statements.
Therefore, Calvin and Phoebe are both liars.
[1] Carl Boyer, A History of Mathematics (2nd edition) (revised by Uta Merzbach), New York: John Wiley
& Sons, Inc., 1991.
1. Dividing the situation into cases which exhaust all the possibilities; and
It’s important to cover all the possibilities. And don’t confuse this with trying examples; an example is
not a proof.
Note that there are usually many ways to divide a situation into cases. For example, if I know that x
is a real number and I’m proving something about x, here are some ways I could take cases:
(c) x ≥ π or x < π
There are an infinite number of ways to divide up the real numbers to take cases; how you do it depends
on what you’re trying to prove. In general, you should try to use a small number of cases — and in particular,
you should see if you can give a proof without taking cases at all!
I’ll begin with a logic proof. In this situation, your cases are usually P and ¬P , where P is a statement.
A → (B ∧ ¬D)
Example. Premises: C→A
C ∨ ¬D
Prove: ¬D.
I can divide the situation into two cases: Either C is true, or ¬C is true. These exhaust the possibilities,
by the Law of the Excluded Middle. I’ll assume each in turn and show that I can derive ¬D.
1. A → (B ∧ ¬D) Premise
2. C→A Premise
3. C ∨ ¬D Premise
4. C Premise - Case 1
5. A Modus ponens (2,4)
6. B ∧ ¬D Modus ponens (1,5)
7. ¬D Decomposing a conjunction (6)
8. ¬C Premise - Case 2
9. ¬D Disjunctive syllogism (3,8)
10. ¬D Proof by cases (4,7,8,9)
Since both of my cases led to the conclusion ¬D, and since my cases exhausted the possibilities, I’ve
proved ¬D.
In logic proofs, cases of the form P and ¬P where P is some statement will cover all possibilities, since
one of P or ¬P must be true. So these are the natural cases to take in logic proofs.
How did I know to use C and ¬C rather than (say) B and ¬B? I looked at my premises and noticed
that I could do something with each of those assumptions: C could be used for modus ponens, and ¬C could
1
be used for disjunctive syllogism. As with many logic proofs, it was a matter of looking ahead or working
backward.
Note: You may use the premises for the proof in either case, but you may not use a statement derived
for one case in the other case.
For example, in the first case, I derived the statement A at line 5. I may not use A anywhere in the
second case.
Let f be a function which is continuous on the interval a ≤ x ≤ b and is differentiable on the interval
a < x < b. Suppose f (a) = f (b) = 0. Then there is a real number c such that a < c < b and f ′ (c) = 0.
In other words (to put it roughly), between two roots there must be a horizontal tangent.
horizontal tangent
y = f(x)
a c b
horizontal tangent
There are three cases: f is never positive or negative on the interval a ≤ x ≤ b, f is positive somewhere
on the interval a ≤ x ≤ b, or f is negative somewhere on the interval a ≤ x ≤ b.
Suppose first that f is never positive or negative on the interval a ≤ x ≤ b. Then f = 0, a constant
function, and f ′ (x) = 0 for all x in the interval a < x < b.
Suppose that f is positive at some point of the interval a ≤ x ≤ b. A continuous function on a closed
interval attains a maximum value on the interval; since I already know f is positive somewhere, the maximum
value of f must be positive. Since f is 0 at the endpoints, it must attain the maximum value at some point
c in the open interval a < x < b.
horizontal tangent
y = f(x)
a c b
Since a < c < b, f is differentiable at c. But at a point where a differentiable function attains a
maximum, the derivative is 0. Therefore, f ′ (c) = 0.
Suppose that f is negative at some point of the interval a ≤ x ≤ b. A continuous function on a closed
interval attains a minimum value on the interval; since I already know f is negative somewhere, the minimum
value of f must be negative. Since f is 0 at the endpoints, it must attain the minimum value at some point
2
c in the open interval a < x < b.
a b
y = f(x)
horizontal tangent
Since a < c < b, f is differentiable at c. But at a point where a differentiable function attains a
minimum, the derivative is 0. Therefore, f ′ (c) = 0.
Since the three cases exhaust all the possibilities, this proves that f ′ (c) = 0 for some c in the interval
a < x < b.
Many problems involving divisibility of integers use the Division Algorithm. It is a consequence of
the Well-Ordering Axiom for the positive integers, which is also the basis for mathematical induction.
Theorem. (Division Algorithm) Let m and n be integers, where n > 0. Then there are unique integers
q and r such that
m = nq + r, where 0 ≤ r < n.
(“q” stands for “quotient” and “r” stands for “remainder”.)
I won’t give a proof of this, but here are some examples which show how it’s used.
(a) Divide 31 by 8.
−31 = 8 · (−4) + 1.
In this case, q = −4 and r = 1. Again, 0 ≤ 1 < 8 holds. Note that if I wrote “−31 = 8 ·(−3)+ (−7)”, the
equation is true, but the numbers aren’t the ones produced by the Division Algorithm — r is not allowed
to be negative.
m = 2q + r, where 0 ≤ r < 2.
m = 2q or m = 2q + 1.
3
Of course, the first case occurs when m is even, and the second case occurs when m is odd. If a problem
involves odd or even integers, you might consider taking cases in this way.
A similar situation occurs when n is any positive integer. For example, if m ∈ Z and n = 5, then
m = 5q + r, where 0 ≤ r < 5.
m = 5q, m = 5q + 1, m = 5q + 2, m = 5q + 3, or m = 5q + 4.
If a problem involves divisibility by 5 you might consider taking cases in this way.
(When I discuss modular arithmetic, there will be an easier way to deal with these cases.)
3n2 + n + 14 = 3(2k)2 + 2k + 14
= 12k 2 + 2k + 14
= 2(6k 2 + k + 7)
4
The last expression shows that in this case when 2n2 + n + 1 is divided by 3, the remainder is 1. Hence,
2
2n + n + 1 is not divisible by 3.
Case 2. When n is divided by 3, the remainder is 1.
Then n = 3q + 1 for some integer q. So
The last expression shows that in this case when 2n2 + n + 1 is divided by 3, the remainder is 1. Hence,
2
2n + n + 1 is not divisible by 3.
Case 3. When n is divided by 3, the remainder is 2.
The last expression shows that in this case when 2n2 + n + 1 is divided by 3, the remainder is 2. Hence,
2
2n + n + 1 is not divisible by 3.
Since in every case 2n2 + n + 1 is not divisible by 3, it follows that 2n2 + n + 1 is not divisible by 3 for
any integer n.
−5 ≤ |x + 2| − |x − 3| ≤ 5.
You often think of taking cases in dealing with absolute values. I have
x+2 if x + 2 > 0
|x + 2| = .
−(x + 2) if x + 2 ≤ 0
5
Case 2. −2 < x ≤ 3. In this case,
|x + 2| − |x − 3| = (x + 2) − [−(x − 3)] = 2x − 1.
I have to do some additional work to see whether the target inequality holds. I have
−2 < x ≤ 3
−4 < 2x ≤ 6
−5 < 2x − 1 ≤ 5
n(n + 1)
1 + 2 + 3 + ··· + n = for n ≥ 1.
2
This is actually an infinite set of statements, one for each integer n ≥ 1:
1(1 + 1)
1=
2
2(2 + 1)
1+2=
2
3(3 + 1)
1+2+3=
2
4(4 + 1)
1+2+3+4=
2
..
.
You might think of proving this result by induction — and in fact, I’ll do so below.
On the other hand, this statement is also an infinite set of statements:
x2 + 1 ≥ 2x for all x ∈ R.
However, there is one for each real number. You are unlikely to prove this by induction.
The fact that a statement involves integers does not mean induction is appropriate. For example,
consider the statement
“The sum of two even numbers is even.”
It’s true that this is a statement about an infinite set of pairs of integers.
2+2 is even
6 + (−14) is even
112 + 64 is even
..
.
However, the problem with using induction here is that there isn’t an obvious way to arrange the
statements in a sequence.
Likewise, consider the statement
“If n is an integer, then 4n + 1 is odd.”
While it’s conceivable that you could give an induction proof, it would be overkill: 4n + 1 = 2(2n) + 1
expresses 4n + 1 as 2 times something plus 1, so it must be odd.
How does induction work? Suppose you have a sequence of statements P (1), P (2), . . . , P (n), . . . , one
for each positive integer. (There’s no harm in starting your numbering with 0 if it’s convenient.) In the
simplest case, to give a proof by induction:
1. Prove P1 .
1
2. Let n > 1, and assume Pn−1 is true.
3. Using the assumption that Pn−1 is true, prove that Pn must be true.
If you can complete these steps, you can conclude that Pn is true for all n ≥ 1, by induction.
The assumption that Pn−1 is true is often called the induction hypothesis, or the inductive as-
sumption.
Why does it work? Induction follows from a fundamental fact about the positive integers called the
Well-Ordering Axiom.
Well-Ordering Axiom. Every nonempty subset of the positive integers has a smallest element.
The Well-Ordering Axiom is an axiom for the positive integers, so there’s no question of proving it.
Example. Verify the Well-Ordering Axiom for the following subsets of positive integers:
(a) The positive even integers: {2, 4, 6, . . .}.
(b) The subset of the positive integers which consists of positive integers whose decimal representations begin
and end with “1”. For example, 101, 128391, and 1651 are elements of this set.
(a) The smallest element of this set is 2.
(b) The smallest element of this set is 1.
Assumption (a) says that P1 is true. Assumption (b) says that if a statement is true, the next statement
below it is true. I’ve represented this with a “C-shaped” arrow connector from the known true statement to
the next one. As you move the connector down, you find that P1 being true makes P2 true, P2 being true
makes P3 true, and so on. Thus, all the statements are true.
Proof. I’ll prove the result by contradiction.
Assume that P1 is true, and for every n > 1, if Pn−1 is true, then Pn is true. Suppose that it isn’t true
that Pn is true for all n ≥ 1.
Consider the set of integers n ≥ 1 such that Pn is false. Since Pn is not true for all n ≥ 1, there must
be some n for which Pn is false. Hence, the set of integers n ≥ 1 such that Pn is false is nonempty.
2
Since this is a nonempty subset of the positive integers, by Well-Ordering it contains a smallest element
MIN. Thus, PMIN is false, and Pn is not false (i.e. Pn is true) for all n < MIN.
Now MIN can’t be 1, because P1 is true by assumption. Thus, MIN > 1. So MIN − 1 is a positive
integer, and PMIN−1 must be true.
But now my second assumption — if a statement in the sequence is true, the following statement is true
— shows that PMIN−1+1 = PMIN must be true. This contradicts the fact that PMIN is false.
This contradiction proves that Pn is true for all n ≥ 1.
Remark. You can also do the induction step by assuming the result for n, and proving it for n + 1, and I
will often do this. Usually, there is no difference in the difficulty, so you should use whichever approach you
find comfortable.
Also, some inductions begin with a statement numbered “0” — or “42”. The numbering doesn’t matter.
The formula is true for n = 1, since the left side is 1 and the right side is
1·2
= 1.
2
Suppose the formula holds for n. This means that
n(n + 1)
1 + 2 + 3 + ···+ n = .
2
I want to prove that the formula holds for n + 1.
Suggestion: You might want to write the formula for n + 1 out on scratch paper so you know what you’re
trying to prove. You get it by replacing “n” with “n + 1” in the formula for n:
(n + 1)[(n + 1) + 1] (n + 1)(n + 2)
1 + 2 + 3 + · · · + n + (n + 1) = = .
2 2
Don’t start with this equation! — that would be assuming what you want to prove. Instead, start
with the left side and work until you get the right side.
n(n + 1)
1 + 2 + 3 + · · · + n + (n + 1) = + (n + 1) Induction hypothesis
2
n
= (n + 1) +1 Algebra
2
n+2
= (n + 1) Common denominator
2
(n + 1)(n + 2)
= Algebra
2
This proves the formula for n + 1. Hence, the result is true for all n ≥ 1, by induction.
Notice that when I wrote out the left side of the formula for n + 1 I put in both the final term “n + 1”
and the term before it, which is “n”. In that way, I could see the expression “1 + 2 + 3 + · · · + n” which is
the left side of my induction assumption — so I knew to begin by substituting. This trick is often useful in
the induction step.
3
Example. Prove that for n ≥ 1
n(11n + 17)
14 + 25 + · · · + (11n + 3) = .
2
The formula is true for n = 1, since the left side is 14 and the right side is
1 · (11 + 17)
= 14.
2
Suppose the formula holds for n. This means that
n(11n + 17)
14 + 25 + · · · + (11n + 3) = .
2
I need to prove the formula for n + 1.
On scratch paper, I write out the formula for n + 1; it is
n(11n + 17)
14 + 25 + · · · + (11n + 3) + (11n + 14) = + (11n + 14)
2
n(11n + 17) 2(11n + 14)
= +
2 2
n(11n + 17) + 2(11n + 14)
=
2
2
(11n + 17n) + (22n + 28)
=
2
2
11n + 39n + 28
=
2
(n + 1)(11n + 28)
=
2
This proves the result for n + 1, so the result is true for all n ≥ 1 by induction.
Are you wondering how I made the final step?
(n + 1)(11n + 28)
The idea is that I knew from my scratch work that the final answer had to be . So I
2
2
wrote it down, then checked that it worked by multiplying out (n+1)(11n+28) to see if I got 11n +39n+28.
Nobody “knows” how you got the final step — the question is whether it’s true!
4
Example. Let x ∈ R, x 6= 1. Prove that
1 − xn+1
1 + x + x2 + · · · + xn = for n ≥ 0.
1−x
You’re allowed to “begin” an induction with n = 0 — or any other integer — if it’s convenient to do so.
For n = 0,
1 − xn+1 1−x
1 + x + x2 + · · · + xn = 1, while = = 1.
1−x 1−x
The result is true for n = 0.
(For variety, I’ll do this induction step by assuming the result for n− 1 and proving it for n. The amount
of work is about the same as assuming it for n and proving it for n + 1.)
Assume that n > 0, and that the result holds for n − 1:
1 − xn
1 + x + x2 + · · · + xn−1 = .
1−x
This proves the result for n, so the result is true for all n ≥ 0, by induction.
1 1 1 1
+ + ···+ =1− .
1·2 2·3 n(n + 1) n+1
You may have seen this idea when you learned about infinite series; it’s called telescoping:
1 1 1 1 1 1 1 1 1
+ + ···+ = − + − + ···+ − .
1·2 2·3 n(n + 1) 1 2 2 3 n n+1
1
The “argument” is that the terms cancel in pairs, leaving 1 − .
n+1
Arguments where you say “and so on” are often justified rigorously by induction. That’s what I’ll do
here.
For n = 1,
1 1 1 1 1 1 1
+ + ···+ = = , while = .
1·2 2·3 n(n + 1) 1·2 2 n(n + 1) 2
The result is true for n = 1.
Assume that the result is true for n:
1 1 1 1
+ + ···+ =1− .
1·2 2·3 n(n + 1) n+1
5
I want to show that the result holds for n + 1.
1 1 1 1 1 1
+ + ··· + + =1− +
1·2 2·3 n(n + 1) (n + 1)(n + 2) n + 1 (n + 1)(n + 2)
1 1
=1− 1−
n+1 n+2
1 (n + 2) − 1
=1−
n+1 n+2
1 n+1
=1−
n+1n+2
1
=1−
n+2
This proves the result for n + 1, so the result is true for all n ≥ 1, by induction.
In some situations, it’s convenient to give an induction proof in the following form:
1. Prove P1 .
3. Using the assumption that Pk is true for all k < n, prove that Pn must be true.
In other words, you can take as your induction hypothesis the truth of all the statements prior to the
nth statement, which you are trying to prove. This is sometimes called generalized induction or strong
induction.
Prove that
xn = 4 · 7n + 5 · (−2)n for n ≥ 0.
To get the induction started, I have to verify the formula xn = 4 · 7n + 5 · (−2)n for both n = 0 and
n = 1. The reason is that the recursion formula doesn’t kick in till n = 2.
For n = 0, the formula gives
4 · 70 + 5 · (−2)0 = 9 = x0 .
For n = 1, the formula gives
4 · 71 + 5 · (−2)1 = 18 = x1 .
The formula holds for n = 0 and n = 1.
Now assume that n ≥ 2 and the formula holds for all k < n, i.e. for all numbers less than n. In
particular, since n − 1 and n − 2 are less than n, I have
The fact that I need both of these formulas to do the induction step is why I’m using a generalized or
strong induction. If I did a standard induction where I just assumed the result for n − 1, I would not have
it for n − 2.
6
I have to show that the formula holds for n. I start with the recursion formula that defines xn , substitute
the results for xn−1 and xn−2 , and do some algebra:
xn = 5xn−1 + 14xn−2
= 5 4 · 7n−1 + 5 · (−2)n−1 + 14 4 · 7n−2 + 5 · (−2)n−2
This proves the result for n, so the result holds for all n ≥ 0 by induction.
Here are some remarks about the algebra I did. My target expression 4 · 7n + 5 · (−2)n has a power of
7 and a power of −2. So I began by grouping terms into powers of 7 and powers of −2.
Next, to try to make what I had look like what I wanted, I factor out 4 · 7n−2 and 5 · (−2)n−2 . Then
simplifying what was left produced the powers (72 and (−2)2 ) that I needed to finish. Perhaps it looks like
magic, but as we’ve seen in other proofs, if your steps are correct, it has to work — you know what the final
expression should be.
In the examples that follow, I use induction to prove inequalities and a divisibility result. The general
setup for the inductions remains the same — it’s just the specific work that differs.
Example. Prove that
8n ≥ 6n + 28 for n ≥ 2.
For n = 2,
8n = 82 = 64 while 6n + 28 = 62 + 28 = 64.
The result holds for n = 2.
Assume that the result holds for n:
8n ≥ 6n + 28.
I’ll prove it for n + 1. To get the proof started, I make a “8n ” term appear using algebra, so I can use
the induction assumption.
8n+1 = 8 · 8n
≥ 8 · (6n + 28)
= 8 · 6n + 224
> 6 · 6n + 28
= 6n+1 + 28
(In the inequality which gave the second-to-the-last line, I used the facts that 8 > 6 and 224 > 28 to
replace the existing terms so I could match the target.)
This proves the result for n + 1, so the result is true for all n ≥ 2 by induction.
In this case, the basis step is n = 6, because the result is to be proved for n ≥ 6. (Try some numbers
and you’ll find the 2n3 can be bigger than 3n for some numbers smaller than 6 .)
7
For n = 6,
3n = 36 = 729 while 2n3 = 2 · 63 = 432.
The result is true for n = 6.
Assume that the result holds for n:
3n > 2n3 .
I have to prove the result for n + 1.
3n+1 = 3 · 3n
> 3 · 2n3
= 6n3
Thus, I have
3n+1 > 6n3 .
On scratch paper, I see that my target inequality is
So my strategy will be to break up the 6n3 that I have so far into 4 pieces, each of which will be greater
than or equal to one of the 4 pieces of 2n3 + 6n2 + 6n + 2. I will do this in steps.
Since n ≥ 6 and 3 > 2, I have
3n3 > 2n3 . (1)
Again, since n ≥ 6, multiplying both sides by n2 , I get
n3 ≥ 6n2 . (2)
Since n ≥ 6 > 0, it follows that n2 ≥ 6n > n. So taking the last inequality and adding another term, I
have
n3 ≥ 6n2 > 6n. (3)
Finally, n ≥ 6 gives
n3 ≥ 216 > 2. (4)
Adding the inequalities (1), (2), (3), and (4), I have
This proves the result for n + 1, so the result is true for all n ≥ 6 by induction.
There are other ways to prove the key inequality 6n3 > 2n3 + 6n2 + 6n + 2. For example, you could use
calculus: After some algebra, you get the inequality 2n3 − 3n2 − 3n − 1 > 0. Take f (n) = 2n3 − 3n2 − 3n − 1.
Note that f (6) > 0, and show that f ′ (n) > 0 for n ≥ 6, so the function increases.
This proof is a little involved, so for starters try to understand why each step is correct before trying to
grasp the whole. Don’t feel bad if you think that you wouldn’t have figured this out by yourself! There are
8
math problems that stump even the best mathematicians. The more experience you get, the more you will
be able to do by yourself.
For the next example, remember that if m and n are integers, m divides n (in symbols, m | n) if mk = n
for some integer n.
You can do this proof directly, without induction. But I’ll give an induction proof by way of example.
For n = 0, I have
52n − 1 = 50 − 1 = 0.
52n = 6k + 1.
I must prove the result for n + 1. As usual, the first thing I’ll do is to work on the given expression to
get (part of) the induction assumption to appear.
52(n+1) − 1 = 5(2n+2) − 1
= 52n · 52 − 1
I have the “52n ” which is part of the induction assumption. Now 6 | 52n − 1 means 6k = 52n − 1 for
some integer k, or
52n = 6k + 1.
52n · 52 − 1 = (6k + 1) · 25 − 1
= 6(25k) + 25 − 1
= 6(25k) + 24
= 6(25k + 4)
All together,
52(n+1) − 1 = 6(25k + 4).
Therefore, 6 | 52(n+1) − 1. This proves the result for n + 1, so the result holds for n ≥ 0 by induction.
Here’s a sketch of a direct proof: Write 52n − 1 = (52 )n − 1 = 25n − 1. Then use the formula
Lines and regions in the plane. This is an extended example which illustrates how you might “guess” a
formula, then confirm it using induction.
9
Suppose we draw lines in the plane, one after another:
Try it yourself (maybe with a drawing program on a computer). It starts to become a little tricky to
get the next line to cross all of the previous lines. Imagine that you had 100 lines and you were trying to
draw one more!
I’ll prove this is possible by induction.
Proposition. Suppose there are n lines in the plane, each of which intersects all the others, and such that
no three lines intersect. Then there is a line which intersects all n lines, and does not go through any of
their intersections.
Proof. From geometry, two lines are parallel if and only if they have the same slope. So if two lines have
different slopes, they aren’t parallel, and they must intersect. We’ll use this to give an induction proof.
We can get started and draw the first line wherever we want.
Then suppose we’ve draw lines L1 , L2 , and so on, all the way up to Ln . We want to draw the (n + 1)st
line so that it intersects the n previous lines.
Suppose the slope of L1 is m1 , the slope of L2 is m2 , and so on. We have n slopes:
m1 , m2 , ... mn .
These are n different numbers (where a “number” could include the designation “undefined” if one of
the lines is vertical). The numbers are different because these n lines intersect, and these numbers are their
slopes.
10
Pick a number mn+1 which is different from all of these m’s. To make the arguments that follow easier,
I’ll also assume mn+1 is not “undefined”. I can pick such a number mn+1 because there are infinitely many
real numbers, so there are real numbers different from the previous m’s and “undefined”.
Consider a line Ln+1 with slope mn+1 . Since mn+1 is different from all the other m’s, the line Ln+1
must intersect the n previous lines.
How can we ensure that this new line does not go through the intersections of any of the previous lines?
The n previous lines intersect in a finite number of points. Consider the lines with slope mn+1 which go
through these intersection points.
In the picture above, the dots represent the intersection point of the previous lines, and the lines I’ve
drawn show the lines with slope mn+1 which pass through them.
Each of those lines has a y-intercept, so there are finitely many such y-intercepts.
Let’s say the y-intercepts are b1 , b2 , and so on. Because there are only finitely many b’s, I can choose a
number b different from all of them.
Consider the line y = mn+1 x+ b. It has slope mn+1 , so it intersects all the previous lines. Its y-intercept
is different from the y-intercepts of all the intersection point lines, so it does not pass through any of the
intersection points.
This proves the result for n lines, so it’s true for any number of lines, by induction.
At this point, we know our question makes sense, so we can think about answering it. Let’s see if we
can see a pattern.
1 line,
2 regions 3 lines,
2 lines, 7 regions
4 regions
11
We go from 2 regions to 4 regions, and 2 + 2 = 4. We go from 4 regions to 7 regions, and 4 + 3 = 7.
If you draw a picture, you’ll find that with 4 lines there are 11 regions, and 7 + 4 = 11. Let’s set up some
notation. Let xn be the number of regions made by n lines. It appears that
xn+1 = xn + (n + 1) for n ≥ 1.
As the new line crosses L1 , it splits the region on the left of L1 , and one new region is added. As the
new line crosses L2 , it splits the region between L1 and L2 , and one new region is added. And so on. All
together, n + 1 new regions are added. That is, n + 1 regions are added to xn to get xn+1 .
This recursion isn’t bad, but it would be nice to have a “closed-form” expression which gives xn in terms
of n. We’ll show how to go from the recursion to such an expression in the next theorem.
xn+1 = xn + (n + 1) for n ≥ 1.
Then for n ≥ 1,
n(n + 1)
xn = + 1.
2
Proof. Method 1. This method doesn’t use induction, but I’ll point out afterward some details which it
omits.
Write out the recursion xn = xn−1 + n for n = 2, 3, . . . n, then add the equations:
x2 = x1 + 2
x3 = x2 + 3
x4 = x3 + 4
..
.
xn = xn−1 + n
x2 + x3 + x4 + · · · + xn = x1 + x2 + x3 + · · · + xn−1 + (2 + 3 + 4 + · · · + n)
xn = x1 + (2 + 3 + 4 + · · · + n).
Now
n(n + 1) n(n + 1)
1 + 2 + 3 + 4 + ···+ n = , so 2 + 3 + 4 + · · · + n = − 1.
2 2
12
Also, x1 = 2. Plugging these into the equation for xn , I get
n(n + 1) n(n + 1)
xn = 2 + −1 = + 1.
2 2
Method 2. For n = 1, the formula gives
1·2
x1 = + 1 = 2.
2
The result holds for n = 1.
Assume that the result is true for n:
n(n + 1)
xn = + 1.
2
I will prove it for n + 1:
xn+1 = xn + (n + 1)
n(n + 1)
= + 1 + (n + 1)
2
n(n + 1) 2(n + 1)
= + +1
2 2
n+1
= · (n + 2) + 1
2
(n + 1)(n + 2)
= +1
2
This proves the result for n + 1, so the result is true for all n ≥ 1 by induction.
The first method may seem pretty appealing — you may have seen similar techniques used in computing
values of infinite series (“telescoping”). Depending on what you’re willing to assume, this may be adequate
as a proof. Let’s note a couple of things.
First, what does “x2 + x3 + x4 + · · · + xn ” mean? Maybe it’s obvious to you: It means “add up the
numbers x2 , x3 , and so on up to xn . However, addition is a binary operation: It tells you how to add 2
numbers at a time, not 100 numbers or n − 1 numbers. Adding more than two numbers at a time actually
requires a definition.
Well, you might say: Just add the numbers two at a time. And in fact, you can define a sum of more
than 2 numbers recursively in this way: If you already know how to add n numbers, then to add n + 1
numbers, you can make the following definition:
x1 + x2 + · · · + xn + xn+1 = (x1 + x2 + · · · + xn ) + xn+1 .
The right side is a sum of two numbers, so this works.
But a second issue arises, and that is that the definition above picks a particular way of grouping the
numbers when you add. Now the associative law for addition tells you that you get the same thing when
you group 3 numbers for addition in two different ways:
a + (b + c) = (a + b) + c.
However, when I write “x2 + x3 + x4 + · · · + xn ” I’m implying that if I add any number of numbers, I
get the same result regardless of how I group the additions. For example,
(a + b) + (c + (d + e)) = a + (b + (c + (d + e))).
Try deriving the last line using associativity for just three numbers. We’re saying that the same thing
works for any grouping, and any number of numbers. And it’s true! How do you prove it? You use induction!
I won’t give the proof here, but you might try it yourself as a challenge.
In other math courses, you didn’t worry about these issues, and things work the way you’d expect. But
as you’ve already noticed, proving things is a lot harder than simply know or believing that they’re true.
In words, the second quantified statement says: “There is an x which does not satisfy property P”. In
other words, to prove that “All x’s satisfy property P” is false, you must find an x which does not satisfy
property P.
(a) To disprove “All professors like pizza”, you must find a professor who does not like pizza.
(b) To disprove the statement “For every real number x, (x + 1)2 = x2 + 1”, you must find a real number x
for which (x + 1)2 6= x2 + 1.
(c) To disprove the statement “x3 + 5x + 3 has a root between x = 0 and x = 1”, it’s not enough to say
“x = 0.5 is between x = 0 and x = 1, but (0.5)3 + 5(0.5) + 3 = 5.625 6= 0”. The statement to be disproved
is an existence statement:
“For all x, it is not the case that both 0 < x < 1 and x3 + 5x + 3 = 0.”
To disprove the original statement is to prove its negation, but a single example will not prove this “for
all” statement.
The point made in the last example illustrates the difference between “proof by example” — which is
usually invalid — and giving a counterexample.
(a) A single example can’t prove a universal statement (unless the universe consists of only one case!).
In many cases where you need a counterexample, the statement under consideration is an if-then state-
ment.So how do you give a counterexample to a conditional statement P → Q? By basic logic, P → Q is
1
false when P is true and Q is false. Therefore:
To give a counterexample to a conditional statement P → Q, find a case where P is true but Q is false.
¬(P → Q) ↔ (P ∧ ¬Q)
Again, you need the “if-part” P to be true and the “then-part” Q to be false (that is, ¬Q must be true).
To give a counterexample, I have to find an integer n such n2 is divisible by 4, but n is not divisible
by 4 — the “if” part must be true, but the “then” part must be false. Consider n = 6. Then n2 = 36 is
divisible by 4, but n = 6 is not divisible by 4. Thus, n = 6 is a counterexample to the statement.
On the other hand, consider n = 5. While n = 5 is not divisible by 4, n2 = 25 is also not divisible
by 4. For n = 5, the “if” and “then” parts of the statement are both false. Therefore, n = 5 is not a
counterexample to the statement.
Example. Consider real-valued functions defined on the interval 0 ≤ x ≤ 1. Give a counterexample to the
following statement:
“If the product of two functions is the zero function, then one of the functions is the zero function.”
(The zero function is the function which produces 0 for all inputs — i.e. the constant function f = 0.)
Here are two functions whose product is the zero function, neither of which is the zero function:
1 1 1
−x
if 0 ≤ x ≤ 0
if 0 ≤ x ≤
2 2 2
f (x) = g(x) = .
1 1 1
0
if < x ≤ 1 x −
if < x ≤ 1
2 2 2
0 1
0 1
fg
0 1
2
Example. Give a counterexample to the following statement:
∞
X
“If lim an = 0, then an converges.”
n→∞
n=1
3n2 + 1 3
lim = 6= 0.
n→∞ 4n2 − 3 4
An algebraic identity is an equation which is true for all values of the variables for which both sides
of the equation are defined.
For example, here is an algebraic identity for real numbers:
1 x+1
+1= .
x x
It is true for all x 6= 0.
Since an algebraic identity is a statement about all numbers in a certain set, you can prove that a
statement is not an identity by producing a counterexample.
Example. Prove that “(a + b)2 = a2 + b2 ” is not an algebraic identity, where a, b ∈ R.
I need to find specific real numbers a and b for which the equation is false.
If an equation is not an identity, you can usually find a counterexample by trial and error. In this case,
if a = 1 and b = 2, then
3
To disprove an identity, you should always give a specific numerical counterexample.
1 1 1
Example. Give a counterexample which shows that “ = + ” is not an identity.
x+2 x 2
An identity is only asserted for values of the variables for which both sides are defined. So the assertion
here is actually
1 1 1
“ = + for x 6= 0 and x 6= −2.”
x+2 x 2
Thus, x = 1 is a counterexample, since
1 1 1 1 1 1 3
= , while + = + = .
x+2 3 x 2 1 2 2
You should not give x = 0 or x = −2 as a counterexample. For these values of x, one side of the
purported identity is undefined. Therefore, these cases are not part of what is claimed, so they can’t be
counterexamples.
Finally, do not confuse giving a counterexample with proof by contradiction. A counterexample disproves
a statement by giving a situation where the statement is false; in proof by contradiction, you prove a statement
by assuming its negation and obtaining a contradiction.
{1, 2, 3, Calvin}.
x∈
/ S means that x is not an element of S.
The order of the elements in the list of elements of a set is irrelevant. Thus,
Definition. Let X and Y be sets. Then X = Y if and only if X and Y have the same elements.
It’s understood when you list the elements of a set that no duplicates are allowed: You don’t write
things like “{1, 2, 3, 3}”.
You can also define a set using set constructor notation. Here’s an example:
{n ∈ Z | n = m2 for m ∈ Z}.
The set constructor consists of two statements separated by a “|”, contained in curly brackets. The two
statements together give the properties which must be satisfied by an element of the set. (Thus, the “|”
functions like a logical “and”.)
Some people prefer to follow the rule used above: The statement to the left of the “|” says what big set
the constructed set is a subset of, while the statement to the right of the “|” gives the membership criteria
for the subset.
However, it is common to write the preceding set as
{m2 | m ∈ Z}.
This is simpler to write, and avoids the introduction of the unnecssary variable n in the first definition.
I’ll usually use the second version wherever possible.
This set consists of all integers which are perfect squares. I could write this more explicitly (but less
precisely) as
{0, 1, 4, 9, . . .}.
This is less precise because the “. . . ” assumes that it is clear what the pattern is. However, seeing a
number of “sample” elements can make it more obvious what members of the set look like. There’s no harm
in doing this as long as there’s no chance of confusion.
Here’s an example using two variables:
{(x, y) | x, y ∈ R and y = x2 }.
1
I could also write this as
{(x, x2 ) | x ∈ R}.
This set consists of pairs of real numbers such that the second is the square of the first. (By the way,
the last sentence gives a verbal description of the set. It’s useful to say things in words when the symbols
get confusing.) Here are some elements of the set:
√
(−1, 1), (0, 0), ( 3, 3), (1.1, 1.21), . . . .
This is a set with three elements, two of which are sets with two elements.
Definition. Let X be a set. The cardinality of X is denoted |X|. For a finite set, it is the number of
elements in X.
We’ll leave aside for the moment what cardinality means for infinite sets. However, I’ll note that there
are different kinds of “infinite”!
Thus,
|{1, 4, −19}| = 3, and |{0}| = 1.
Definition. The set with no elements is called the empty set, and is denoted ∅ or { }.
Note that |∅| = 0: The empty set is the only set with zero elements.
Remark. You have to be careful in constructing sets in order to avoid set-theoretic paradoxes. For example,
here is Russell’s paradox. Consider “the set S of all sets which are not members of themselves”. Is S an
element of S?
We’ve been using some standard notations for certain sets that occur often in mathematics. Here’s a
recap:
If you just want the positive integers (also known as the natural numbers, use Z+ or N; if you want
the nonnegative integers (sometimes called the whole numbers), use Z≥0 . Note that some people include
2
0 in N (so by the “natural numbers” they mean Z≥0 ). To avoid confusion, it’s probably better to refer to
the “positive integers” or “nonnegative integers”.
Definition. Let S and T be sets. T is a subset of S if and only if x ∈ T implies x ∈ S. T ⊂ S means that
T is a subset of S, and T 6⊂ S means that T is not a subset of S.
This picture illustrates T ⊂ S:
S
The picture above is called a Venn diagram. Venn diagrams are often useful for picturing sets and
relationships among sets. Be careful not to substitute diagrams for proofs, however!
Remarks. (a) Some people use “T ⊂ S” to mean that T is a subset of S, but is not equal to S. A subset
of S other than S itself is called a proper subset of S. With this convention, you write T ⊆ S to mean
that T is a subset of S, possibly S itself.
I prefer to write T ⊂ S to mean T is any subset of S. If I want T to be a proper subset of S, I’ll write
T ( S. Reason: More often than not, you want to include the possibility that T = S, and you should use
the simpler notation (⊂ rather than ⊆) for the case that occurs more often.
On the other hand, some people prefer T ⊆ S because it is analogous to writing x ≤ y when x and y
are numbers.
(b) S = T if and only if S ⊂ T and T ⊂ S.
To see this, note that the relations S ⊂ T and T ⊂ S means that every element of S is an element of T ,
and every element of T is an element of S — that is, S and T have the same elements.
We’ll often prove that two sets are equal by showing that each is a subset of the other.
(c) If |X| = n (that is, X is a set with n elements) and S is a subset of X, then each element of X can either
be an element of S or not. Thus, there are 2 choices for each element. It follows that X has 2n subsets.
(Remember that this includes both the empty set and X itself.)
{∅, {a}, {f }, {g}, {a, f }, {a, g}, {f, g}, {a, f, g}}.
Notice that you must write “{a}”, not “a”. It is the set with the single element a, whereas a by itself
is not a set.
(b) The set has 2 elements, namely a and {f, g}. Notice that you don’t “unpack” {f, g}.
Think of a set as a bag. The set {a, {f, g}} contains a single element a and another bag (which happens
to contain two elements f and g). The number of things in {a, {f, g}} “at the outer level” is 2.
It follows that the set has 22 = 4 subsets:
3
Notice that “{{f, g}}” got “double-bagged: It is a set containing a set.
Example. Let
Prove that B ⊂ A.
To prove that B ⊂ A, I must show that if n ∈ B, then n ∈ A. You can often prove set inclusion or
equality by considering elements.
Let n ∈ B. By definition of B, I have n = 6m for some m ∈ Z. Now
n = 6m = 2(3m).
Since m is an integer, so is 3m. Therefore, n has the form 2 · (an integer), so by definition n ∈ A.
Hence, B ⊂ A.
(a) ∅ ⊂ S.
(b) S ⊂ S.
Proof. (a) To prove that ∅ ⊂ S, I have to prove that if x ∈ ∅, then x ∈ S. But x ∈ ∅ is false for all x, so
the conditional statement must be true. (In this situation, you often say that the statement is vacuously
true — the condition is satisfied because there are no cases!)
(b) To prove that S ⊂ S, I must show that if x ∈ S, then x ∈ S. This is trivially true — P → P is a
tautology — so S ⊂ S.
When one is discussing sets, there is usually a “big set” which contains all the sets under discussion.
This “big set” is usually called the universe; usually, it will be clear from the context what it is. For
example, if I’m discussing sets of integers, the universe is the set of integers Z. If I’m discussing sets of real
numbers, the universe is the set of real numbers R.
Definition. (a) Let S and T be sets in the universe X. The complement of S is the set of elements of the
universe which are not contained in S; it is denoted S or X − S. Thus,
S = {x ∈ X | x ∈
/ S}.
(b) The (relative) complement of S in T is the set of elements of T which are not elements of S; it is
denoted T − S. Thus,
T − S = {x ∈ T | x ∈/ S}.
Here’s a picture; the shaded area is T − S.
T
S
T-S
4
Set complements function likes logical negations; the analogy even extends to DeMorgan’s Laws, as I’ll
show below.
Definition. Let S and T be sets. The union of S and T is the set whose elements are elements of S or
elements of T ; it is denoted S ∪ T . That is,
S ∪ T = {x | x ∈ S or x ∈ T }.
Picture:
T
S
SUT
Definition. Let S and T be sets. The intersection of S and T is the set whose elements are elements of
both S and T ; it is denoted S ∩ T . That is,
S ∩ T = {x | x ∈ S and x ∈ T }.
Picture:
T
S
U
S T
Note that the “or” and “and” in the last two definitions are the logical “or” and “and”.
X = {1, 2, 3, 4, . . .}.
Suppose
A = {1, 2, 3, 4, 6, 8} and B = {4, 6, 8, 10, 12}.
Find the elements of the following sets:
(a) A.
(b) A − B.
(c) B − A.
(d) A ∪ B.
(e) A ∩ B.
(a) A = {5, 7, 9, 10, 11, 12, 13, . . .}. That is, the set consisting of 5, 7, and all integers greater than or equal
to 9.
(b) A − B = {1, 2, 3}.
(c) B − A = {10, 12}.
5
(d) A ∪ B = {1, 2, 3, 4, 6, 8, 10, 12}.
(e) A ∩ B = {4, 6, 8}.
You’ve probably seen interval notation in other courses (for example, in writing solutions to inequal-
ities). Suppose a and b are real numbers, where a ≤ b.
[a, b] = {x ∈ R | a ≤ x ≤ b}
[a, b) = {x ∈ R | a ≤ x < b}
(a, b] = {x ∈ R | a < x ≤ b}
(a, ∞) = {x ∈ R | x > a}
[a, ∞) = {x ∈ R | x ≥ a}
(−∞, a) = {x ∈ R | x < a}
(−∞, a] = {x ∈ R | x ≤ a}
In some cases, we’ll need to “take apart” a compound inequality like “a < x < b” in order to do a proof.
A compound inequality is a conjunction (an “and”) of two inequalities:
As I noted above, each of these compound inequalities can be broken down into two simple inequalities.
Doing so, I get
1 < x and x < 4 and 3 ≤ x and x ≤ 10.
6
In particular, I have 3 ≤ x and x < 4. These simple inequalities are the same as 3 ≤ x < 4. But this
implies that x ∈ [3, 4).
I’ve shown that if x ∈ (1, 4) ∩ [3, 10], then x ∈ [3, 4). This proves that (1, 4) ∩ [3, 10] ⊂ [3, 4).
Next, I’ll show that [3, 4) ⊂ (1, 4) ∩ [3, 10].
Let x ∈ [3, 4). This means that 3 ≤ x < 4, or
−3 6
1 8
Example. Let
R≥0 = {x ∈ R | x ≥ 0} and R≤0 = {x ∈ R | x ≤ 0}.
Prove that R≥0 ∩ R≤0 = {0}.
I’ll prove the result by showing that {0} ⊂ R≥0 ∩ R≤0 and that R≥0 ∩ R≤0 ⊂ {0}.
To prove that {0} ⊂ R≥0 ∩ R≤0 , I begin by taking an element of {0} — but the only element of {0} is
0. So I have to show that 0 ∈ R≥0 ∩ R≤0 .
7
First, 0 ∈ R≥0 because 0 ≥ 0. Next, 0 ∈ R≤0 because 0 ≤ 0. Since 0 ∈ R≥0 and 0 ∈ R≤0 , it follows that
0 ∈ R≥0 ∩ R≤0 . Hence, {0} ⊂ R≥0 ∩ R≤0 .
Now I have to show that R≥0 ∩ R≤0 ⊂ {0}. Let x ∈ R≥0 ∩ R≤0 . By definition of intersection, this means
that x ∈ R≥0 and x ∈ R≤0 .
Since x ∈ R≥0 , I have x ≥ 0. Since x ∈ R≤0 , I have x ≤ 0. This means that x = 0, so x ∈ {0}.
Therefore, R≥0 ∩ R≤0 ⊂ {0}.
This proves that R≥0 ∩ R≤0 = {0}.
We’ll see in doing set algebra proofs that Venn diagrams useful in checking that a set relationship is
true. However, they become too complicated once there are more than 3 sets.
This is the general Venn diagram for three sets:
B
A
Here are the Venn diagrams for some set constructed using complements, unions, and intersection:
A
B
B
A
C C
A∩B ∩C (A ∩ B) ∪ C
A
B
B
A
C C
C − (A ∪ B) B − (A ∩ C)
Try to construct a general Venn diagram for 4 or 5 sets!
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
1
Since I know x ∈ A, the definition of intersection gives x ∈ A ∩ (B ∪ C).
Since in both cases I have x ∈ A∩(B∪C), I have shown that if x ∈ (A∩B)∪(A∩C), then x ∈ A∩(B∪C).
By definition of subset, this means that (A ∩ B) ∪ (A ∩ C) ⊂ A ∩ (B ∪ C).
Finally, since I’ve shown that A ∩ (B ∪ C) and (A ∩ B) ∪ (A ∩ C) are each contained in the other, they
must be equal: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
You can see that the first proof is shorter, but sometimes shorter proofs require more thinking to
understand: The proof is shorter because the reasoning is compressed. The second proof is much longer, but
maybe the words make more sense to you.
Note: It’s also true that
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).
I’ll just prove the first statement; the second is similar. This proof will illustrate how you can work with
complements. I’ll use the logical version of DeMorgan’s law to do the proof.
Let x be an arbitrary element of the universe.
x∈ A∪B ↔ x ∈ / A∪B Definition of complement
↔ ¬(x ∈ A ∪ B) Definition of ∈ /
↔ ¬(x ∈ A ∨ x ∈ B) Definition of ∪
↔ ¬(x ∈ A) ∧ ¬(x ∈ B) DeMorgan’s law
↔ (x ∈ / A) ∧ (x ∈/ B) Definition of ∈ /
↔ (x ∈ A) ∧ (x ∈ B) Definition of complement
↔ x∈A∩B Definition of ∩
Therefore, A ∪ B = A ∩ B.
The procedure I’ve followed is so common that it’s worth pointing it out: To prove a subset relationship
(an inclusion) X ⊂ Y , take an arbitrary element of X and prove that it must be in Y .
In the next example, I’ll need the following facts from logic. First, P ∨ ¬P is a tautology:
P ¬P P ∨ ¬P
T F T
F T T
2
Also, P ∧ (a tautology) ↔ P :
P a tautology P ∧ (a tautology)
T T T
F T F
In effect, this means that I can drop tautologies from “and” statements. I’ll just call this “Dropping
tautologies” in the proof below.
x ∈ (A − B) ∪ (B − A) ↔
x ∈ (A − B) ∨ x ∈ (B − A) ↔ Definition of union
(x ∈ A ∧ x ∈
/ B) ∨ (x ∈ B ∧ x ∈ / A) ↔ Definition of complement
[x ∈ A ∨ (x ∈ B ∧ x ∈/ A)] ∧ [x ∈
/ B ∨ (x ∈ B ∧ x ∈/ A)] ↔ Distributivity
(x ∈ A ∨ x ∈ B) ∧ (x ∈ A ∨ x ∈/ A)] ∧ (x ∈/ B ∨ x ∈ B) ∧ (x ∈
/ B∨x∈ / A) ↔ Distributivity
(x ∈ A ∨ x ∈ B) ∧ (x ∈/ B∨x∈ / A) ↔ Dropping tautologies
(x ∈ A ∨ x ∈ B) ∧ (¬x ∈ B ∨ ¬x ∈ A) ↔ Definition of “not in”
(x ∈ A ∨ x ∈ B) ∧ ¬(x ∈ B ∧ x ∈ A) ↔ DeMorgan
(x ∈ A ∪ B) ∧ ¬(x ∈ A ∩ B) ↔ Definition of union and
intersection
x ∈ (A ∪ B) − (A ∩ B) Definition of complement
Therefore, (A − B) ∪ (B − A) = (A ∪ B) − (A ∩ B).
A ∪ ∅ = A and A ∩ ∅ = ∅.
This example will show how you can deal with the empty set.
To prove A ∪ ∅ = A, let x be an arbitrary element of the universe. First, by definition of ∪,
x ∈ A ∪ ∅ ↔ (x ∈ A) ∨ (x ∈ ∅).
I’ll show that [(x ∈ A) ∨ (x ∈ ∅)] ↔ (x ∈ A). To prove P ↔ Q, I must prove P → Q and Q → P .
First, if x ∈ A, then (x ∈ A) ∨ (x ∈ ∅) (constructing a disjunction).
Next, suppose (x ∈ A) ∨ (x ∈ ∅). The second statement x ∈ ∅ is false for all x, by definition of ∅. But
the ∨-statement is true by assumption, so x ∈ A must be true by disjunctive syllogism. This proves that if
(x ∈ A) ∨ (x ∈ ∅), then x ∈ A.
This completes my proof that [(x ∈ A) ∨ (x ∈ ∅)] ↔ (x ∈ A). So
x∈ A∪∅ ↔ (x ∈ A) ∨ (x ∈ ∅) Definition of ∪
↔ x∈A Proved above
Therefore, A ∪ ∅ = A.
To prove that A ∩ ∅ = ∅, I must prove that for all x, x ∈ A ∩ ∅ if and only if x ∈ ∅.
As usual, x be an arbitrary element of the universe. To prove x ∈ A ∩ ∅ if and only if x ∈ ∅, I must
prove that the following implications:
(x ∈ A ∩ ∅) → x ∈ ∅ and x ∈ ∅ → (x ∈ A ∩ ∅)
3
I’ll do this by showing that, in each case, the antecedent (i.e. the “if” part of the statement) is false —
since by basic logic, if P is false, then P → Q is true.
For the first implication, consider the statement x ∈ A ∩ ∅. By definition of intersection,
x ∈ A ∩ ∅ ↔ (x ∈ A ∧ x ∈ ∅).
Now x ∈ ∅ is false, by definition of the empty set. Therefore, the conjunction x ∈ A ∧ x ∈ ∅ is also false.
Hence, x ∈ A ∩ ∅ is false.
It follows that the implication x ∈ A ∩ ∅ → x ∈ ∅ is true, because the “if” part is false.
Likewise, the second implication x ∈ ∅ → (x ∈ A ∩ ∅) is true because x ∈ ∅ is false, by definition of the
empty set.
Since both implications are true, x ∈ A ∩ ∅ if and only if x ∈ ∅. And this in turn proves that A ∩ ∅ = ∅.
Definition. lim f (x) = L means that for every ǫ > 0, there is an M such that if
x→∞
In other words, I can make f (x) as close to L as I please by making x sufficiently large.
Remarks. Limits at infinity often occur as limits of sequences, such as
1 1 1 1
, , ,..., ,....
2 3 4 n
1
In this case, lim = 0. I won’t make a distinction between the limit at infinity of a sequence and the
n→∞ n
limit at infinity of a function; the proofs you do are essentially the same in both cases.
There is s similar definition for lim f (x) = L, and the proofs are similar as well. I’ll stick to lim f (x)
x→−∞ x→∞
here.
1
Example. Prove that lim = 0.
n→∞ n
As with ǫ-δ proofs, I do some scratch work, working backwards from what I want. Then I write the
“real proof” in the forward direction.
Scratch work. I want
1 1 1
ǫ> −0 = = .
n n n
1
I want to drop the absolute values, so I’ll assume n > 0. Rearranging the inequality, I get n > .
ǫ
1 1
Here’s the real proof. Let ǫ > 0. Set M = . Since ǫ > 0, I have M = > 0. Suppose n > M . Then
ǫ ǫ
n > M > 0, and
1
n>M =
ǫ
1
ǫ>
n
1
ǫ>
n
1
ǫ> −0
n
1
This proves that lim = 0.
n→∞ n
1
6x + 1
Example. Prove that lim = 3.
x→∞ 2x + 1
Scratch work. I want
6x + 1 6x + 1 − 3(2x + 1) −2 2 2
ǫ> −3 = = = = .
2x + 1 2x + 1 2x + 1 2x + 1 2x + 1
Therefore,
6x + 1
lim = 3.
x→∞ 2x + 1
2−ǫ 2−ǫ
Note that the expression would be negative if ǫ > 2. So I took M to be the max of 0 and
2ǫ 2ǫ
to ensure that if x > M , then x would be positive. Now you actually need 2x + 1 to be positive in order to
1 2−ǫ 1
put on the absolute values, and 2x + 1 > 0 if x > − . It isn’t hard to prove that > − , so in fact I
2 2ǫ 2
2−ǫ 1
don’t need to take the max with 0 — provided that I’m willing to prove that > − . I decided to take
2ǫ 2
the easy way out!
2
Example. Prove that lim (−1)n is undefined.
n→∞
lim (−1)n = L.
n→∞
1 1
Taking ǫ = in the definition, I can find M such that if n > M , then > |(−1)n − L|.
2 2
Choose p to be an even number greater than M . Then
1
> |(−1)p − L| = |1 − L|.
2
1
This says that the distance from L to 1 is less than , so
2
1 3
<L< .
2 2
Choose q to be an odd number greater than M . Then
1
> |(−1)q − L| = | − 1 − L|.
2
1
This says that the distance from L to −1 is less than , so
2
3 1
− <L<− .
2 2
1 3 3 1
This is a contradiction, since L can’t be in , and in − , − at the same time.
2 2 2 2
Hence, lim (−1) is undefined.
n
n→∞
a=c and b = d.
(b) You can define an ordered pair using sets. For example, the ordered pair (x, y) can be defined as the set
{x, {x, y}}.
Example. Let S = {a, b, c} and T = {1, 2}. List the elements of S × T and sketch the set.
S × T = {(a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2)}.
Notice that S and T are not subsets of S × T . There are subset which “look like” S and T ; for example,
here’s a subset that “looks like” S:
U = {(a, 1), (b, 1), (c, 1)}.
But this is not S: The elements of S are a, b, and c, whereas the elements of the subset U are pairs.
Here’s a picture of S × T . The elements are points in the grid:
a b c S
R × R consists of all pairs (x, y), where x, y ∈ R. This is the same thing as the the x-y-plane:
y
RxR
(2,1)
1
Example. Consider the following subset of R × R:
S = {(2x, 5x) | x ∈ R}.
(a) Prove that (−14, −35) ∈ S.
(b) Prove that (18, 50) ∈
/ S.
(a)
(−14, −35) = (2 · (−7), 5 · (−7)) ∈ S.
(b) Suppose (18, 50) ∈ S. Then for some x ∈ R, I have
(18, 50) = (2x, 5x).
Equating the first components, I get 2x = 18, so x = 9. But equating the second components, I get
5x = 50, so x = 10. This is a contradiction, so (18, 50) ∈
/ S.
Example. Z × Z is the set of pairs (m, n) of integers. Consider the following subsets of Z × Z:
A = {(3n + 5, 9n + 10) | n ∈ Z} and B = {(s, t) ∈ Z × Z | s + t is odd}.
Prove that A ⊂ B.
Let (3n + 5, 9n + 10) ∈ A. B consists of pairs whose components add to an odd number. So I add the
components of (3n + 5, 9n + 10):
(3n + 5) + (9n + 10) = 12n + 15 = 2(6n + 7) + 1.
Since 2(6n + 7) + 1 is odd, (3n + 5) + (9n + 10) is odd. This proves that (3n + 5, 9n + 10) ∈ B.
You can take the product of more than 2 sets — even an infinite number of sets, though I won’t consider
infinite products here.
For example, Z × Z × Z consists of ordered triples (a, b, c), where a, b, and c are integers.
Example. Consider the following subset of Z × Z × Z:
W = {(a, b, a + 2b) | a, b ∈ Z}.
(a) Show that (−3, 5, 7) ∈ W .
(b) Show that (2, −4, 6) ∈
/ W.
(a)
(−3, 5, 7) = (−3, 5, −3 + 2 · 5) ∈ W.
(b) Suppose (2, −4, 6) ∈ W . Then for some integers a and b, I have
(2, −4, 6) = (a, b, a + 2b).
Equating components, I get three equations:
a = 2, b = −4, a + 2b = 6.
But substituting a = 2 and b = −4 into a + 2b gives
a + 2b = 2 + 2 · (−4) = −6 6= 6.
This contradiction proves that (2, −4, 6) ∈
/ W.
This would not be very interesting if I were only considering finite collections of sets. Here are some
infinite collections of sets.
Let I = N = {1, 2, 3, . . .}. A collection of sets indexed by I is an infinite collection of sets S1 , S2 , S3 ,
S4 , . . . .
Here is a collection of sets indexed by N:
1 1
S1 = (0, 1), S2 = 0, , S3 = 0, ,....
2 3
1
In general, if n is a positive integer, then Sn = 0, .
n
Here’s another collection of sets indexed by N:
For instance, I have sets S3 , S−117/13 , Sπ , and so on, one for every real number.
Since R is uncountable, I can’t list the sets in this collection the way I could list collections of sets
indexed by N.
Here are a couple of the sets:
√ √
S√2 = { 2, − 2}, S42 = {42, −42}.
1
Here’s another collection of sets indexed by R:
Sx = [x, ∞) for x ∈ R.
Each set in this collection is an interval consisting of all real numbers greater than or equal to x. So,
for example,
S1 = [1, ∞), Sπ = [π, ∞).
T
(b) The intersection i∈I Si of the Si is the set
\
Si = {s | s ∈ Si for all i ∈ I}.
i∈I
Remark. For a collection of sets S1 , S2 , S3 , . . . indexed by the natural numbers, you usually write the union
and intersection this way:
[∞ ∞
\
Sn and Sn .
n=1 n=1
The collection of intervals is shown below. They actually lie on top of one another on the x-axis; I’ve
“pulled them up” so you can see them separately.
(0.1/10)
(0.1/9)
(0.1/8)
(0,1/7)
(0,1/6)
(0.1/5)
(0,1.4)
(0.1/3)
(0,1/2)
(0,1)
2
∞
[ 1 1
(a) I will show each set is contained in the other. Let x ∈ 0, . Then x ∈ 0, for some n > 1.
n=1
n n
1
This means that 0 < x < .
n
1
Now n > 1 implies < 1, so 0 < x < 1. Hence, x ∈ (0, 1).
n
∞
[ 1
This proves that 0, ⊂ (0, 1).
n=1
n
∞
[ 1
Conversely, suppose x ∈ (0, 1). Now S1 = (0, 1), so by the definition of union, x ∈ 0, . This
n=1
n
∞
[ 1
proves that (0, 1) ⊂ 0, .
n=1
n
∞
[ 1
Hence, 0, = (0, 1).
n=1
n
∞
\ 1
(b) Since the empty set is a subset of any set, I have ∅ ⊂ 0, .
n=1
n
∞ ∞
\ 1 \ 1
The opposite inclusion is 0, ⊂ ∅. To show this means to show that 0, contains no
n=1
n n=1
n
elements. I’ll give a proof by contradiction.
∞
\ 1
Suppose on the contrary that c ∈ 0, . By the definition of intersection, this means that
n=1
n
1
c ∈ 0, for every positive integer n.
n
Note that
1
lim = 0.
n→∞ n
In the limit definition, choose ǫ = c. Then there is a number M such that for all n > M , I have
1 1
c=ǫ> −0 = .
n n
Choose a positive integer n such that n > M . Then
1
0< < c.
n
1 1
But this means that c ∈
/ 0, , contradicting the fact that c ∈ 0, for every positive integer n.
n n
This shows that there is no such element c, so the intersection is empty.
∞
[ n
Example. Prove that 0, = [0, 1).
n=1
n+1
∞
[ n
First, I’ll show that the left side is contained in the right side. Let x ∈ 0, . I have to show
n=1
n+1
that x ∈ [0, 1).
∞
[ n n
Since x ∈ 0, , I know that x ∈ 0, for some n ≥ 1. This means that
n=1
n+1 n+1
n
0≤x≤ .
n+1
3
But
1>0
n+1>n
n
1>
n+1
∞
[n
Therefore, 0 ≤ x < 1. This means that x ∈ [0, 1). Hence, 0, ⊂ [0, 1).
n=1
n+1
Next, I’ll show that the right side is contained in the left side. Suppose x ∈ [0, 1). I have to show that
∞
[ n
x∈ 0, .
n=1
n+1
Since x ∈ [0, 1), I have 0 ≤ x < 1. Note that
n
lim = 1.
n→∞ n+1
n
I’ll pause to give a picture of what I’ll do next. The idea is that since is approaching 1, and since
n+1
n
x < 1, eventually the terms must become larger than x:
n+1
| |
x 1
n
Intuitively, if all the ’s stayed to the left of x, then their limit couldn’t be greater than x, so the
n+1
limit couldn’t be 1.
Continuing the proof, in the limit definition, let ǫ = 1 − x. Then there is a number M such that if
n > M,
n
1−x=ǫ> −1 .
n+1
n
Since < 1, the absolute value becomes
n+1
n n
− −1 =1− .
n+1 n+1
4
∞
[ n
Since I’ve proved both inclusions, I have 0, = [0, 1).
n=1
n+1
∞
\ 1
I’ll show that each of the sets 1, 3 + and [1, 3] is contained in the other.
n=1
n
I’ll do the easy inclusion first. Let x ∈ [1, 3]. Then 1 ≤ x ≤ 3.
1
For all n ≥ 1, I have 3 < 3 + . Hence,
n
1
1≤x≤3<3+ .
n
∞
1 \ 1
Therefore, x ∈ 1, 3 + for all n ≥ 1. By definition of intersection, x ∈ 1, 3 + .
n n=1
n
∞
\ 1
Thus, [1, 3] ⊂ 1, 3 + .
n=1
n
∞
\ 1 1
Next, let x ∈ 1, 3 + . This means that x ∈ 1, 3 + for all n ≥ 1 — that is,
n=1
n n
1
1≤x≤3+ for all n ≥ 1.
n
1 1 1
ǫ=x−3> 3+ −3 = = .
n n n
| |
3 x
5
If all of them stayed to the right of x, the limit would be greater than or equal to x, so it couldn’t be 3.
This proves by contradiction that x ≤ 3. Since I already know that 1 ≤ x, I have 1 ≤ x ≤ 3, or x ∈ [1, 3].
∞
\ 1
Thus, 1, 3 + ⊂ [1, 3].
n=1
n
∞
\ 1
Together with the first inclusion, this proves that 1, 3 + = [1, 3].
n=1
n
You can see that these are ordered pairs — elements of the Cartesian product
people × people.
And a little thought shows that any binary (two-element) relationship can be defined in this way. That’s
why the formal definition I gave above makes sense.
Example. Suppose S = {1, 2, 3, 4}. List the elements of the relation x < y on S, then draw a picture of the
relation.
S = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}.
For example, (1, 4) is in the set, because 1 < 4.
The picture of the points in a relation is called its graph. Here’s the graph of x < y on S:
1
1 2 3 4
As usual, I’m using the horizontal axis for the first component and the vertical axis for the second
component.
1
Example. A relation R is defined on R by
(x, y) ∈ R means xy 3 − x3 y = 6.
Show that (1, 2) ∈ R. Sketch the graph of R. (You might need a computer to do this.)
(1, 2) is in the relation, because
1 · 23 − 13 · 2 = 6.
The graph of the relation looks something like this
3
-1
-2
-3
-3 -2 -1 0 1 2 3
Example. List the elements of the relation on the set S = {a, b, c, d} whose graph is shown below:
a
a b c d
{(b, a), (b, c), (c, b), (c, c), (c, d), (d, b), (d, d)}.
It’s common in math to use infix notation for relations. This means that instead of writing an ordered
pair (x, y), you put a relation symbol between x and y — for example,
xRy, or x ⊕ y, or x ⊲⊳ y, or x ∼ y.
It’s best to avoid symbols like “=” or “>” which have special meanings — unless that special meaning
is what you want.
For example, consider the relation in the previous example:
{(b, a), (b, c), (c, b), (c, c), (c, d), (d, b), (d, d)}.
2
Using ∼ as the infix relation symbol, you’d write
b ∼ a, b ∼ c, c ∼ b, c ∼ c, c ∼ d, d ∼ b, d ∼ d.
x∼y means x2 + x ≥ y 2 + y.
Very often additional axioms or assumptions are added to the definition of binary relation in order to
obtain useful structures. Here are some that we’ll consider in detail.
Definition. A relation ∼ on a set S is an equivalence relation if:
1. (Reflexivity) s ∼ s for all s ∈ S.
2. (Symmetry) For all s, t ∈ S, if s ∼ t, then t ∼ s.
3. (Transitivity) For all s, t, u ∈ S, if s ∼ t and t ∼ u, then s ∼ u.
An equivalence relation is meant to capture the idea of things “being the same” for the purposes of a
given discussion. Here’s a real-world example. Suppose you plan to drive to the movies. With that intention
alone in mind, there are many things about the car you drive that aren’t important — what color it is, how
many miles it’s been driven, whether the windshield is tinted, and so on. You care only about the car being
suitable for transporting you to the movies. So any two cars — whatever their color, mileage, or windshield
tint, for instance — are the same for your purposes if either will get you to the movies. The equivalence
relation on the set of cars is that two cars are equivalent if both will get you to the movies or both will not
get you to the movies.
“Equality” is an obvious example of “being the same”. Thus, equality of integers, rational numbers,
real numbers, or complex numbers is an equivalence relation.
Definition. Let n be a positive integer. Integers x and y are congruent mod n if x − y is divisible by n.
Notation: x = y (mod n).
Congruence mod n is an equivalence relation on Z. Another way to express congruence mod n is: x
and y are congruent mod n if x and y leave the same remainder on division by n. But the first definition
is easier to use.
3
For example, 37 = 13 (mod 8), because 37 − 13 = 24, and 8 | 24. And −50 = 14 (mod 16), because
−50 − 14 = −64 and 16 (mod −) 64.
Most of the earlier examples been examples of relations on a single set; that is, subsets of a X × X for
some set X. Here’s an important example of a relation from a set X to a set Y where X and Y might be
different.
Definition. A function is a relation f from a set X to a set Y which satisfies the following property: If
(x, y1 ) and (x, y2 ) are elements of f , then y1 = y2 .
You may have a little trouble telling how this is the definition of a function you’re accustomed to. First,
this is a case where we usually use prefix notation for the relation. So instead of writing “(x, y) ∈ f ” or
even “x ∼ y”, we write “f (x) = y”.
Using prefix notation, the defining condition can be translated to this: If f (x) = y1 and f (x) = y2 , then
y1 = y2 . This is the familiar idea that a function produces a single output for each input. Graphically, this
is the “vertical line test”.
It’s interesting to note that, since a function is a relation, and a relation is a set of ordered pairs (i.e.
“points” in the product X × Y ), a function has actually been defined as its graph.
Example. Show that the less-than relation < on the set of real numbers is not an equivalence relation.
What about the relation ≤? For no real number x is it true that x < x, so reflexivity never holds.
If x and y are real numbers and x < y, it is false that y < x. For example, 3 < 4 is true, but 4 < 3 is
false.
It is true that if x < y and y < z, then x < z. Thus, < is transitive.
Suppose instead I consider less-than-or-equal-to, the relation ≤ on R.
Reflexivity now holds, since for any x ∈ R it is true that x ≤ x. Transitivity holds just as before.
However, symmetry still doesn’t hold: 3 ≤ 4, but 4 6≤ 3. Thus, ≤ is not an equivalence relation.
Example. (a) Is the relation whose graph is drawn below an equivalence relation?
d
a
a b c d
(b) Is the relation whose graph is drawn below an equivalence relation?
d
a
a b c d
1
(c) Is the relation whose graph is drawn below an equivalence relation?
a
a b c d
(a) The relation is not an equivalence relation. (b, b) is not in the relation, so the relation is not reflexive.
(b) (c, b) is in the relation, but (b, c) is not. Therefore, the relation is not symmetric, so it’s not an equivalence
relation.
(c) This relation is reflexive and symmetric. However, (b, c) and (c, a) are in the relation, but (b, a) is not.
The relation is not transitive, and therefore it’s not an equivalence relation.
Check each axiom for an equivalence relation. If the axiom holds, prove it. If the axiom does not hold,
give a specific counterexample.
(1 + 1)2 = 4 but 12 + 12 = 2, and 4 6= 2. Hence, 1 6∼ 1 and the relation is not reflexive.
Suppose x ∼ y. Then (x + y)2 = x2 + y 2 , so (y + x)2 = y 2 + x2 . Hence, y ∼ x. The relation is symmetric.
1 ∼ 0, because (1 + 0)2 = 1 and 12 + 02 = 1.
0 ∼ 1, because (0 + 1)2 = 1 and 02 + 12 = 1.
However, 1 6∼ 1, as I showed above. Hence, the relation is not transitive.
Check each axiom for an equivalence relation. If the axioms holds, prove it. If the axiom does not hold,
give a specific counterexample.
For all x ∈ R,
|x| + |x| = 2|x| = |2x| = |x + x|.
Therefore, x ∼ x for all x, and ∼ is reflexive.
Suppose x ∼ y. This means that |x| + |y| = |x + y|. By commutativity of addition, |y| + |x| = |y + x|.
Hence, y ∼ x. Therefore, ∼ is symmetric.
Transitivity does not hold.
|1| + |0| = |1 + 0|, so 1 ∼ 0.
|0| + | − 1| = |0 + −1|, so 0 ∼ −1.
However, 1 6∼ −1, because
|1| + | − 1| 6= |1 + (−1)|.
2
Therefore, 1 ∼ 0 and 0 ∼ −1 do not imply 1 ∼ −1.
Check each axiom for an equivalence relation. If the axiom holds, prove it. If the axiom does not hold,
give a specific counterexample.
In words, the definition says two pairs are related if either their first components are equal or their
second components are equal.
(a, b) ∼ (a, b), because the first components are both a and hence equal.
Suppose (a, b) ∼ (c, d). Then either a = c or b = d. In the first case, if a = c, then (c, d) ∼ (a, b), because
their first components are equal: a = c implies c = a. In the second case, if b = d, then (c, d) ∼ (a, b),
because their second components are equal: b = d implies d = b.
(1, 2) ∼ (1, 3), because their first components are equal. And (1, 3) ∼ (2, 3), because their second
components are equal. But (1, 2) 6∼ (2, 3), because neither their first nor their second components are equal.
Since the “then” part of what I want to prove involves y + 2x, I’ll solve the last equation for y + 2x:
3
And there’s the equation I started with.
Now suppose x, y, and z are integers. Assume x ∼ y and y ∼ z. This means that x + 2y is divisible by
3, and y + 2z is divisible by 3. I’ll express these as equations:
x + 2y = 3m for some m ∈ Z.
y + 2z = 3n for some n ∈ Z.
I want to show that x + 2z is divisible by 3. My proof looks like this so far, with the assumptions at
the top and the conclusion at the bottom.
x∼y y∼z
3 | x + 2y 3 | y + 2z
x + 2y = 3m y + 2z = 3n
..
.
x + 2z = 3(something)
3 | x + 2z
x∼z
How can I get from x + 2y = 3m and y + 2z = 3n to x + 2z = 3(something)? Make what you’ve got
look like what you want. What I have involves x, y, and z, but what I want seems to involve only x and z.
It looks like I want to get rid of the y’s. How can I do that? One way is to solve the second equation for y:
y + 2z = 3n
y = 3n − 2z
x + 6n − 4z = 3m
x = 3m − 6n + 4z
x + 2z = 3m − 6n + 6z
The left side is what I want (x + 2z), but I need 3(something) on the right . . . oh, just factor out 3:
x + 2z = 3(m − 2n + 2z).
4
This is a complete proof of transitivity, though some people might prefer more words. Thus, ∼ is an
equivalence relation.
Notice that if you were presented with this proof without any of the scratchwork or backward reasoning,
it might look a little mysterious: You can see each step is correct, but you might wonder how anyone would
think of doing those things in that order. This is an unfortunate consequence of the way math is often
presented: After the building is finished, the scaffolding is removed, and you may then wonder how the
builders managed to get the materials up to the roof!
The lesson here is that you should not look at a finished proof and assume that the person who wrote
it had a flash of genius and then wrote the thing down from start to finish. While that can happen, more
often proofs involve messing around and attempts that don’t work and lots of scratch paper!
Equivalence relations give rise to partitions. As a real-world example, consider a deck of playing cards.
It is divided into 4 suits: spades, hearts, diamonds, and clubs. Define two cards in the deck to be equivalent
if they belong to the same suit. This is an equivalence relation. Every card in the deck belongs to one and
only one suit, which is the set of all cards in the same suit as the given card.
Definition. Let X be a set. A partition of X is a collection of subsets {Xi }i∈I of X such that:
[
1. X = Xi .
i∈I
Thus, the elements of a partition are like the pieces of a jigsaw puzzle:
X2 X3
X1
X4
X
Example. Why don’t the following sets partition the set of integers Z?
(a)
{0, 1, 2, 3, . . .} and {. . . , −3, −2, −1, 0}
(b)
{1, 2, 3, . . .} and {. . . , −4, −3, −2, 0}
(a) Every integer is in one of these sets, but the two sets overlap (at 0).
5
(b) The sets don’t overlap, but −1 is not contained in either set.
S(x) = {y ∈ X | y ∼ x}.
[
Thus, S(x) is the equivalence class of x. Now x ∼ x, so x ∈ S(x). Clearly, X = S(x).
x∈X
Now some of the S(x)’s may be identical; throw out the duplicates. This means that I have S(x)’s
where x ∈ Y , and Y is a subset of[X — and if x, y ∈ Y and x 6= y, then S(x) 6= S(y). Since I’ve just thrown
out duplicates, I still have X = S(x). I will have a partition if I show that the remaining S(x)’s don’t
x∈Y
intersect.
Suppose x, y ∈ Y and x 6= y, but z ∈ S(x)∩S(y). I’ll show that this gives a contradiction. By definition,
z ∼ x and z ∼ y, so by symmetry and transitivity, x ∼ y.
S(x)
S(y)
x
z y
Now I’ll show S(x) = S(y). I’ll show each is contained in the other. Suppose w ∈ S(x). Then w ∼ x,
but x ∼ y, so w ∼ y, and w ∈ S(y).
S(x)
y
w
S(y)
6
This shows S(x) ⊂ S(y). But the argument clearly works the other way around, so S(y) ⊂ S(x). Hence,
S(x) = S(y).
Since I threw out all the duplicates earlier, this is a contradiction. Hence, there is no such z, which
means S(x) ∩ S(y) = ∅. This means that the S(x)’s for x ∈ Y partition X.
Conversely, suppose {Xi }i∈I is a partition of X. Define a relation on X by saying x ∼ y if and only if
x, y ∈ Xi for some i ∈ I. S
If x ∈ X, then x ∈ Xi for some i because X = i∈I Xi — to be in the union means you’re in one of the
sets in the union. Now x is in the same Xi as itself — x, x ∈ Xi — so x ∼ x. It’s reflexive.
If x ∼ y, then x, y ∈ Xi for some i. Obviously, y, x ∈ Xi , so y ∼ x. It’s symmetric.
Finally, if x ∼ y and y ∼ z, then x, y ∈ Xi and y, z ∈ Xj for some i and j. Now y ∈ Xi ∩ Xj , but this
can only happen if Xi = Xj . Then x, z ∈ Xi , so x ∼ z.
y
x
1
2
5
4 6
1 ∼ 4 ∼ 5, 2 ∼ 6.
In other words, 1, 4, and 5 are equivalence to each other, 2 and 6 are equivalent, and 3 is only equivalent
to itself.
7
Let x ∈ R. Then x − x = 0 ∈ Z. Therefore, x ∼ x, and ∼ is reflexive.
Suppose x ∼ y, so x − y ∈ Z. Since the negative of an integer is an integer, y − x ∈ Z. Hence, y ∼ x,
and ∼ is symmetric.
Suppose x ∼ y and y ∼ z. Then x − y ∈ Z and y − z ∈ Z. But the sum of integers is an integer, so
x − z = (x − y) + (y − z) ∈ Z.
A little thought shows that all the equivalence classes look like like one: All real numbers with the same
“decimal part”. Each class will contain one element — 0.3942 in the case of the class above — in the interval
0 ≤ x < 1. Therefore, the set of equivalence classes of ∼ looks like 0 ≤ x < 1. Moreover, since 0 ∼ 1, it’s as
if this interval had its ends “glued together”:
glue ends
0 1
This is an important use of equivalence relations in mathematics — to “glue together” or identify parts
of a set to create a new set.
Example. Let X = R2 , the x-y plane. Define (a, b) ∼ (c, d) to mean that
a2 + b2 = c2 + d2 .
In words, this means that (a, b) and (c, d) are the same distance from the origin.
Show that this is an equivalence relation, and sketch the partition of R2 into equivalence classes that it
determines.
Since x2 + y 2 = x2 + y 2 , it follows that (x, y) ∼ (x, y). Hence, the relation is reflexive.
Suppose (a, b) ∼ (c, d), so
a2 + b2 = c2 + d2 .
Then
c2 + d2 = a2 + b2 .
Hence, (c, d) ∼ (a, b). Hence, the relation is symmetric.
Suppose (a, b) ∼ (c, d) and (c, d) ∼ (e, f ). Then
a2 + b2 = c2 + d2 and c2 + d2 = e2 + f 2 .
Hence,
a2 + b 2 = e 2 + f 2 .
Therefore, (a, b) ∼ (e, f ). Hence, the relation is transitive. This show that ∼ is an equivalence relation.
8
The resulting partition of R2 into equivalence classes consists of circles centered at the origin. The origin
is in an equivalence class by itself.
Notice that the axioms for a partition are satisfied: Every point in the plane lies in one of the circles,
and no point lies in two of the circles.
Example. An equivalence relation is defined on the set S = {0, 1, 2, 3, 4, 5, 6, 7, 11, 12} by:
x∼y means 3 | x − y.
Here are some things to keep in mind when writing proofs involving divisibility:
(a) It’s often useful to translate divisibility statements (like a | b) into equations using the definition.
(b) Do not use fractions or the division operation (“/” or “÷”) in your proofs!
Proof. (a) Suppose a | b and b | c. Now a | b means that am = b for some m and b | c means that bn = c
for some n. Hence, amn = c, so a | c.
(b) Suppose a | x and a | y. Now a | x means that am = x for some m and a | y means that an = y for some
n. Then
bx + cy = bam + can = a(bm + cn), so a | bx + cy.
In the first case, apply (b) with b = 1 and c = 1 (and b = 1 and c = −1). In the second case, apply (b)
c = 0.
Example. Suppose n is an integer. Prove that the only positive integer that divides both 2n + 3 and 3n + 4
is 1.
Suppose k is a positive integer and k | 2n + 3 and k | 3n + 4. Then by part (b) of the preceding
proposition, k divides any linear combination of 2n + 3 and 3n + 4. I’ll choose a combination so that the
n-terms cancel:
k | 3 · (2n + 3) − 2 · (3n + 4) = 1.
So k is a positive integer which divides 1 — but the only positive integer which divides 1 is 1. Hence,
k = 1.
1
Definition. An integer n > 1 is prime if the only positive divisors of n are 1 and n. An integer n > 1
which is not prime is composite.
For example, the first few primes are
2, 3, 5, 7, 11, 13, . . . .
4, 6, 8, 9, 10, . . . .
Proposition. If n is composite, then there are integers a and b such that 1 < a, b < n and n = ab.
Proof. Since n is composite, it is not prime. Therefore, n has a positive divisor a other than 1 and n.
Suppose n = ab. I still have to show that 1 < a, b < n.
Note that if b = 1, then a = n (contradiction), and if b = n, then a = 1 (contradiction). So a and b are
both different from 1 and n.
Suppose on the contrary that a > n. Since b > 1, it follows that
n = ab > n · 1 = n.
This is a contradiction.
Likewise, if b > n, then since a > 1, I have
n = ab > 1 · n = n.
This is a contradiction.
Now I know that a and b are positive integers which are not greater than n, and neither is 1 or n. This
implies that 1 < a, b < n.
Proposition. Every integer n > 1 has a prime factor.
Proof. I’ll use induction, starting with n = 2. In fact, 2 has a prime factor, namely 2.
Suppose that n > 2, and that every integer k less than n has a prime factor. I must show that n has a
prime factor.
If n is prime, then n has a prime factor, namely itself. So assume n is composite.
By the last lemma, there are integers a and b such that 1 < a, b < n and n = ab. If either a or b is
prime, then I have a prime factor of n. Suppose then that a and b are both composite. In this case, since
a < n, I know that a must have a prime factor, by induction. But a prime factor of a is a prime factor of n,
by transitivity of divisibility. This completes the induction step, and the proof.
I sketched the proof of the following result when I discuss proof by contradiction. Having proved the
last two results, the proof is now complete — but I’ll repeat it here. It is essentially the proof in Book IX
of Euclid’s Elements.
Theorem. There are infinitely many primes.
Proof. Suppose on the contrary that there are only finitely many primes
p1 , p2 , . . . , pn .
2
The situation changes greatly if you consider primes of a restricted form. For example, it’s not known
whether there are infinitely many Mersenne primes — primes of the form 2n − 1, where n > 1.
√
Proposition. If n is composite, then it has a prime factor p such that p ≤ n.
There are simple tests for divisibility by small numbers based on the decimal representation of a number.
If an an−1 . . . a1 a0 is the decimal representation of a number, its digital sum is
Proposition. (a) A number is even (divisible by 2) if and only if its units digit is 0, 2, 4, 6, or 8.
(b) A number is divisible by 5 if and only if its unit digit is 0 or 5.
(c) A number is divisible by 3 if and only if its digital sum is divisible by 3.
(d) A number is divisible by 9 if and only if its digital sum is divisible by 9.
Proof. Suppose x = an an−1 . . . a1 a0 is the decimal representation of a positive integer x. Then
All of the results can be proved by using this representation (and where appropriate, the digital sum).
For example, here’s a sketch of the proof of (a). Note that since 2 | 10,
3
For (c) and (d), note that
Hence, 9 | 10k − 1.
For example, 9183 is divisible by 3, since 9 + 1 + 8 + 3 = 21 is divisible by 3. And 725 is not divisible
by 9, because 7 + 2 + 5 = 14 is not divisible by 9.
Remark. The Fundamental Theorem of Arithmetic states that every positive integer greater than
1 can be expressed as a product of powers of primes, and this expression is unique up to the order of the
factors.
For example,
720 = 24 · 32 · 5.
Here is a sketch of the proof that every positive integer greater than 1 can be expressed as a product
of powers of primes. Do a generalized induction: n = 2 is a product of a single prime (namely 2), and that
is the basis step. Take an integer n > 2, and suppose every integer greater than 1 and less than n can be
written as a product of powers of primes. If n is prime, we’re done (since a prime is product of a single prime,
namely itself). If n is not prime, an earlier result show it can be factored as n = ab, where 1 < a, b < n. By
the induction hypothesis, factor a and b into products of powers of primes. Then putting their factorizations
together shows n factors into a product of powers of primes.
The proof that a factorization into a product of powers of primes is unique up to the order of factors
uses additional results on divisibility (e.g. Euclid’s lemma), so I will omit it.
While this result is very important, overuse of the Fundamental Theorem in divisibility proofs often
results in sloppy proofs which obscure important ideas. Try to write your proofs in other ways.
Definition. Let m and n be integers, not both 0. The greatest common divisor (m, n) of m and n is
the largest integer which divides both m and n.
The reason for not defining “(0, 0)” is that any integer divides both 0 and 0 (e.g. 4571 | 0 because
4571 · 0 = 0), so there is no largest integer which divides both 0 and 0.
Here are some numerical examples:
Proof. (a) 1 is a common divisor of any two integers m and n. Since (m, n) is the greatest common divisor,
(m, n) ≥ 1.
4
(In particular, (m, n) must be positive.)
(b) First, I’ll show m and |m| have the same divisors. If k | m, then m = ak for some integer a. So
−m = (−a)k, and hence k | −m. But |m| is either m or −m, and hence k | |m|.
Conversely, suppose k | |m| — say |m| = ak for some integer a. If |m| = m, then k | m. And if
|m| = −m, then ak = −m, so (−a)k = m, and k | m.
Thus, m and |m| have the same divisors, and likewise n and |n| have the same divisors. It follows that
the common divisors of m and n are the same as the common divisors of |m| and |n|. Since the sets of
common divisors are the same, their largest elements must be the same — that is, (m, n) = (|m|, |n|).
(This means that when you compute the greatest common divisor of two numbers, you can take absolute
values to get two positive numbers.)
(c) This follows from the definition: (m, n) (is the largest integer which) divides both m and n.
(d) Since (m, n) | m and (m, n) | n, we have (m, n) | am + bn by an earlier divisibility result.
You might be able find the greatest common divisor of two relatively small numbers by factoring. But
what if the numbers are too big to be factored? The Euclidean algorithm gives a method for computing
the greatest common divisor of two positive integers using only integer division.
113 = 2 · 45 + 23.
271 −
113 2
45 2
23 1
22 1
1 22
The table stops when you get an a first column number “divides evenly into” the one above it. The the
remainder is 0, and since you can’t divide by 0, the process must stop. The last nonzero remainder is the
greatest common divisor. So
(271, 113) = 1.
You can at least see from this example why the process has to stop. When you divide, the remainder is
always less that the thing you divided by. So the remainders in the first column are positive numbers that
keep getting smaller — and since the process can’t go on forever (reason: the Well-Ordering Axiom for the
positive integers), it must end in the only way possible with a remainder of 0.
I won’t prove that this algorithm gives the greatest common divisor, but here’s the idea: The greatest
common divisor of any two consecutive numbers in the first column remains the same. Check it yourself in
the table above.
5
Example. Show that if n is an integer, then (n, n + 2) is either 1 or 2.
(n, n + 2) divides both n and n + 2, so it divides any linear combination of n and n + 2. In particular,
(n, n + 2) | (n + 2) − n = 2.
Now (n, n + 2) ≥ 1; the only positive integers which divide 2 are 1 and 2. Therefore, (n, n + 2) is either
1 or 2.
Notice that both of these cases can occur: If n = 1, then (n, n + 2) = (1, 3) = 1, and if n = 2,
(n, n + 2) = (2, 4) = 2.
n -5 -4 -3 -2 -1 0 1 2 3 4 5
4n + 3 -17 -13 -9 -5 -1 3 7 11 15 19 23
6n + 4 -26 -20 -14 -8 -2 4 10 16 22 28 34
To prove it, I’ll use part (a). I want numbers a and b such that
a(4n + 3) + b(6n + 4) = 1.
Since there are no n’s on the right side, I want to choose a and b to make the n’s on the left cancel out.
One way to do this is
3 · (4n + 3) + (−2)(6n + 4) = 1.
This linear combination is equal to 1, so by (a), (4n + 3, 6n + 4) = 1.
As the example shows, one way of showing that two integers are relatively prime is to find a linear
combination of them that equals 1. The converse is true: If two integers are relatively prime, then some
linear combination of the integers equals 1.
In fact, more is true: The greatest common divisor (m, n) of m and n can always be written as a linear
combination am + bn of m and n. An extended version of the Euclidean algorithm finds a linear combination
am+ bn such that (m, n) = am+ bn. You’ll probably see this result in a course in abstract algebra or number
theory; I won’t prove it here.
Notation: a = b (mod m) means that a is congruent to b mod m. m is called the modulus of the
congruence; I will almost always work with positive moduli.
Note that a = 0 (mod m) if and only if m | a. Thus, modular arithmetic gives you another way of
dealing with divisibility relations.
For example:
101 = 3 (mod 2) because 2 | 101 − 3 = 98.
19 = −17 (mod 12) because 12 | 19 − (−17) = 36.
Example. (a) List the elements of the equivalence classes relative to congruence mod 3.
(b) Using 0, 1, and 2 to represent these equivalence classes, construct addition and multiplication tables mod
3.
(a) The equivalence classes are the 3 congruence classes:
{. . . , −3, 0, 3, 6, . . .}, {. . . − 4, −1, 2, 5, . . .}, {. . . − 5, −2, 1, 4, . . .}.
Each integer belongs to exactly one of these classes. Two integers in a given class are congruent mod 3.
(If you know some group theory, you probably recognize this as constructing Z3 from Z.)
(b)
+ 0 1 2
0 0 1 2
1 1 2 0
2 2 0 1
1
· 0 1 2
0 0 0 0
1 0 1 2
2 0 2 1
I could have chosen different representatives for the classes — say 3, −4, and 4. A choice of repre-
sentatives, one from each class, is called a complete system of residues mod 3. But working mod 3
it’s natural to use the numbers 0, 1, and 2 as representatives — and in general, if I’m working mod n, the
obvious choice of representatives is the set {0, 1, 2, . . . , n − 1}. This set is called the standard residue
system mod n, and it is the set of representatives I’ll usually use. Thus, the standard residue system mod
6 is {0, 1, 2, 3, 4, 5}.
Theorem. Suppose a = b (mod m) and c = d (mod m). Then:
(a) a + c = b + d (mod m) and a − c = b − d (mod m).
(a + c) − (b + d) = jm − km = (j − k)m.
4 · 3x = 4 · 4 (mod 11)
12x = 16 (mod 11)
x = 5 (mod 11)
2
Definition. x and y are multiplicative inverses mod n if xy = 1 (mod n).
Notation: x = y −1 (mod n) or y = x−1 (mod n). Do not use fractions.
Example. (a) Find 6−1 (mod 17).
(b) Prove that 6 does not have a multiplicative inverse mod 8.
(a) 6 · 3 = 18 = 1 (mod 17), so 6−1 = 3 (mod 17).
(b) Suppose 6x = 1 (mod 8). Then
4 · 6x = 4 · 1 (mod 8)
24x = 4 (mod 8)
0 = 4 (mod 8)
This contradiction shows that 6 does not have a multiplicative inverse mod 8.
Example. Reduce 996 · 997 · 998 · 999 (mod 1000) to a number in {0, 1, . . . , 999}.
(x + y)p = xp + y p (mod p) .
The result is not true if the modulus is not prime. For example,
Instead of writing (x, y) ∈ f , you usually write f (x) = y. In ordinary terms, to say that an ordered pair
(x, y) is in f means that x is the “input” to f and y is the corresponding “output”.
The requirement that (x, y1 ), (x, y2 ) ∈ f implies y1 = y2 means that there is a unique output for each
input. (It’s what is referred to as the “vertical line test” for a graph to be a function graph.)
(Why not say, as in precalculus or calculus classes, that a function is a rule that assigns a unique element
of Y to each element of X? The problem is that the word “rule” is ambiguous. The definition above avoids
this by identifying a function with its graph.)
The notation f : X → Y means that f is a function from X to Y .
X is called the domain, and Y is called the codomain. The image (or range) of f is the set of all
outputs of the function:
im f = {y ∈ Y | y = f (x) for some x ∈ X}.
Note that the domain and codomain are part of the definition of a function. For example, consider the
following functions:
f : R → R given by f (x) = x2 .
g : R → R≥0 given by g(x) = x2 .
h : R≥0 → R given by h(x) = x2 .
These are different functions; they’re defined by the same rule, but they have different domains or
codomains.
Is this a function?
This does not define a function. For example, f (2.6) could be 3, since 3 is an integer bigger than 2.6.
But it could also be 4, or 67, or 101, or . . . . This “rule” does not produce a unique output for each input.
Mathematicians say that such a function — or such an attempted function — is not well-defined.
In basic algebra and calculus, functions R → R are often given by rules, without mention of a domain
and codomain. In this case, the natural domain (“domain” for short) is the largest subset of R consisting
of numbers which can be “legally” plugged into the function.
Example. Find the natural domain of √
x
f (x) = .
x−2
√
(i) I must have x ≥ 0 in order for x to be defined.
(ii) I must have x 6= 2 in order to avoid division by zero.
1
Example. Define f : R − {2} → R by
3x
f (x) = .
x−2
Prove that im f = {y | y 6= 3}.
In words, the claim is that the outputs of y consist of all numbers other than 3. To see why 3 might be
omitted, note that
3x
lim = 3.
x→∞ x − 2
That is, y = 3 is a horizontal asymptote for the graph. Now this isn’t a proof, because a graph can
cross a horizontal asymptote; it just provides us with a “guess”.
To prove im f = {y | y 6= 3}, I’ll show each set is contained in the other.
3x 2y
Suppose y 6= 3. On scratch paper, I solve y = for x in terms of y and get x = . (This is
x−2 3−y
defined, since y 6= 3.) Now I prove that this input produces y as an output:
2y
3·
2y 3−y
f =
3−y 2y
−2
3−y
6y
=
2y − 2(3 − y)
6y
=
6
=y
Definition. Let A, B, and C be sets, and let f : A → B and g : B → C be functions. The composite of f
and g is the function g ◦ f : A → C defined by
In my opinion, the notation “g◦f ” looks a lot like multiplication, so (at least when elements are involved)
I prefer to write “g(f (x))” instead. However, the composite notation is used often enough that you should
be familiar with it.
2
(g ◦ f )(x) = g(f (x)) = g(x3 ) = x3 + 1,
(f ◦ g)(x) = f (g(x)) = f (x + 1) = (x + 1)3 .
Find:
(a) f (g(x, y)).
(b) f (f (x, y)).
(a)
f (g(x, y)) = f (y 3 , x + y) = (y 3 + (x + y), (y 3 )2 + (x + y)) = (x + y + y 3 , x + y + y 6 ).
(b)
f (f (x, y)) = f (x + y, x2 + y) = ((x + y) + (x2 + y), (x + y)2 + (x2 + y)) = (x2 + 2x + y, 2x2 + 2xy + y 2 + y).
3
(b) Prove that f : R → R≥0 given by f (x) = x2 is not injective, but it is surjective.
(c) Prove that f : R≥0 → R≥0 given by f (x) = x2 is injective and surjective.
(a) It is not injective, since f (−3) = 9 and f (3) = 9: Different inputs may give the same output.
It is not surjective, since there is no x ∈ R such that f (x) = −1.
(b) It is not injective, since f (−3) = 9 and f (3) = 9: Different inputs may give the same output.
√
It is surjective, since if y ≥ 0, y is defined, and
√ √
f ( y) = ( y)2 = y.
(c) It is injective, since if f (a) = f (b), then a2 = b2 . But in this case, a, b ≥ 0, so a = b by taking square
roots.
√
It is surjective, since if y ≥ 0, then y is defined, and
√ √
f ( y) = ( y)2 = y.
Notice that in this example, the same “rule” — f (x) = x2 — was used, but whether the function was
injective or surjective changed. The domain and codomain are part of the definition of a function.
x+1
f (x) = .
x
Prove that f is injective.
Suppose a, b ∈ R − {0} and f (a) = f (b). I must prove that a = b.
a+1 b+1
f (a) = f (b) means that = . Clearing denominators and doing some algebra, I get
a b
b(a + 1) = a(b + 1), ba + b = ab + a, a = b.
Therefore, f is injective.
Since the derivative is always positive, f is always increasing, and hence f is injective.
4
Proposition. Suppose f : R → R is differentiable, and that f ′ (x) > 0 for all x or f ′ (x) < 0 for all x. Then
f is injective.
Proof. Suppose that f is differentiable and always increasing. Suppose that f (a) = f (b). I want to prove
that a = b.
Suppose on the contrary that a 6= b. There’s no harm in assuming a < b (otherwise, switch them). By
the Mean Value Theorem, there is a number c such that a < c < b and
f (b) − f (a)
= f ′ (c).
b−a
0
= f ′ (c) > 0
b−a
0>0
x+1
f (x) = .
x
The last line tells me what I need to use for “x”. To prove surjectivity, I plug it in and verify that it
works. Remember that at this point, I’ve been given y. So
1 1
+1 +1
1 y−1 y−1 y−1 1 + (y − 1)
f = = · = = y.
y−1 1 1 y−1 1
y−1 y−1
Thus, given y ∈ R − {1}, I have found an input to f which produces y as an output. Therefore, f is
surjective.
5
The preceding example relied on being able to solve for x in terms of y. In general, you can’t expect
to solve an arbitrary equation for one variable in terms of another. In some cases, it’s possible to prove
surjectivity indirectly.
Example. Define f : R → R by f (x) = x2 (x − 1). Show that f is not injective, but that f is surjective. f
is not injective, since f (0) = 0 and f (1) = 0.
The graph suggests that f is surjective. To say that every y ∈ R is an output of f means graphically
that every horizontal line crosses the graph at least once (whereas injectivity means that every horizontal
line crosses that graph at most once).
-4 -2 2 4
-1
-2
To prove that f is surjective, take y ∈ R. I must find x ∈ R such that f (x) = y, i.e. such that
x2 (x − 1) = y.
The problem is that finding x in terms of y involves solving a cubic equation. This is possible, but it’s
easy to change the example to produce a function where solving algebraically is impossible in principle.
Instead, I’ll proceed indirectly.
It follows from the definition of these infinite limits that there are numbers a and b such that
The existence of a comes from lim x2 (x − 1) = −∞, which means that f (x) must eventually become
x→−∞
smaller than any number y as x → −∞. Likewise, the existence of b comes from lim x2 (x − 1) = +∞,
x→+∞
which means that f (x) must eventually become larger than any number y as x → ∞.
But f is continuous — it’s a polynomial — so by the Intermediate Value Theorem, there is a point c
such that a < c < b and f (c) = y. This proves that f is surjective.
Note, however, that I haven’t found c; I’ve merely shown that such a value c must exist.
Example. Define
x+1 if x < 0
f (x) = .
x2 if x ≥ 0
6
2
-3 -2 -1 1 2 3
-1
-2
f (y − 1) = (y − 1) + 1 = y.
√ √
If y ≥ 0, then y is defined and y ≥ 0, so
√ √
f ( y) = ( y)2 = y.
f (x, y) = (ex + y, y 3 ).
7
Is f injective? Is f surjective?
First, I’ll show that f is injective. Suppose f (a, b) = f (c, d). I have to show that (a, b) = (c, d).
f (a, b) = f (c, d)
(e + b, b3 ) = (ec + d, d3 )
a
Equating the second components, I get b3 = d3 . By taking cube roots, I get b = d. Equating the first
components, I get ea + b = ec + d. But b = d, so subtracting b = d I get ea = ec . Now taking the log of both
sides gives a = c. Thus, (a, b) = (c, d), and f is injective.
I’ll show that f is not surjective by showing that there is no input (x, y) which gives (−1, 0) as an
output. Suppose on the contrary that f (x, y) = (−1, 0). Then
f (x, y) = (−1, 0)
x
(e + y, y 3 ) = (−1, 0)
Equating the second components gives y 3 = 0, so y = 0. Equating the first components gives ex +y = −1.
But y = 0, so I get ex = −1. This is impossible, since ex is always positive. Therefore, f is not surjective.
Not all functions have inverses; if the inverse of f exists, it’s denoted f −1 . (Despite the crummy notation,
1
“f −1 ” does not mean “ ”.)
f
You’ve undoubtedly seen inverses of functions in other courses; for example, the inverse of f (x) = x3 is
f −1 (x) = x1/3 . However, the functions I’m discussing may not have anything to do with numbers, and may
not be defined using formulas.
x
Example. Define f : R − {−1} → R − {1} by f (x) = . Find the inverse of f .
x+1
x
To find the inverse of f (if there is one), set y = . Swap the x’s and y’s, then solve for y in terms
x+1
of x:
y x
x= , x(y + 1) = y, xy + x = y, x = y − xy, x = y(1 − x), y= .
y+1 1−x
x
Thus, f −1 (x) = . To prove that this works using the definition of an inverse function, do this:
1−x
x
−1 −1 x x + 1 x x
f (f (x)) = f = x = (x + 1) − x = 1 = x,
x+1 1−
x+1
x
x 1 − x x
−1
= x x =
f f (x) = f = = x.
1−x +1 x + (1 − x) 1
1−x
8
Recall that the graphs of f and f −1 are mirror images across the line y = x:
10
-10 -5 5 10
-5
-10
I’m mentioning this to connect this discussion to things you’ve already learned. However, you should
not make the mistake of equating this special case with the definition. The inverse of a function is not defined
by “swapping x’s and y’s and solving” or “reflecting the graph about y = x”. A function might not involve
numbers or formulas, and a function might not have a graph. The inverse of a function is what the definition
says it is — nothing more or less.
Lemma. Let f : X → Y and g : Y → Z be invertible functions. Then g ◦ f is invertible, and its inverse is
(g ◦ f )−1 = f −1 ◦ g −1 .
f f −1 (t) = f (s) = t.
9
To show that f is surjective, take t ∈ T . Then f f −1 (t) = t, so I’ve found an element of S — namely
f −1 (t) — which f maps to t. Therefore, f is surjective.
To show that f is injective, suppose s1 , s2 ∈ S and f (s1 ) = f (s2 ). Then
f −1 (f (s1 )) = f −1 (f (s2 )) , so s1 = s2 .
Therefore, f is injective.
Corollary. The composite of bijective functions is bijective.
Proof. Since a function is bijective if and only if it has an inverse, the corollary follows from the fact that
the composite of invertible functions is invertible.
This gives
u = 2x + y 3 and v = x + 1.
I want the formula for g(u, v) = (x, y), which means I want to find x and y in terms of u and v. Thus,
I solve the two equations above simultaneously. From v = x + 1, I get
x = v − 1.
u = 2(v − 1) + y 3
u = 2v − 2 + y 3
u − 2v + 2 = y 3
(u − 2v + 2)1/3 = y
10
First,
g(f (x, y)) = g 2x + y 3 , x + 1
As in the previous derivation, I got the second equality by plugging v − 1 in for x and (u − 2v + 2)1/3
in for y in f (x, y) = (2x + y 3 , x + 1).
By analogy with the first derivation, when you do f (g(u, v)), there should only be u’s and v’s in your
work — you can’t have any x’s and y’s.
The two equations above show that f and g are inverses. Therefore, f is bijective.
Example. Let
S = {a, b, c, d} and T = {1, 2, 3, Calvin}.
Define f : S → T by
f (a) = 1, f (b) = 2, f (c) = 3, f (d) = Calvin.
Show that f is bijective.
I’ll construct an inverse for f . The inverse should “undo” the effect of f :
f f -1
a 1 a
b 2 b
c 3 c
d Calvin d
1
As you can see, I need to define
I’ve constructed f −1 so that f −1 (f (s)) = s for all s ∈ S. To be complete, I should check that it works
the other way, too:
f f −1 (1) = f (a) = 1, f f −1 (2) = f (b) = 2, f f −1 (3) = f (c) = 3,
f f −1 (Calvin) = f (d) = Calvin.
So f −1 really is the inverse of f , and f is a bijection. (For that matter, f −1 is a bijection as well,
because the inverse of f −1 is f .)
Notice that this function is also a bijection from S to T :
If there is one bijection from a set to another set, there are many (unless both sets have a single element).
I introduced bijections in order to be able to define what it means for two sets to have the same number
of elements. The number of elements in a set is called the cardinality of the set.
Definition. (a) Let S and T be sets. S and T have the same cardinality if there is a bijection f from S
to T .
Notation: |S| = |T | means that S and T have the same cardinality.
(b) A set S is finite if it is empty, or if there is a bijection f : {1, 2, 3, . . . , n} → S for some integer n ≥ 1.
A set which is not finite is infinite.
(c) If S is a nonempty finite set and there is a bijection f : {1, 2, 3, . . . , n} → S for some integer n ≥ 1, I’ll
say that S has cardinality n or that S has n elements. In this case, I’ll write |S| = n.
At this point, there is an apparently silly issue that needs to be resolved: Could a finite set be bijective
with both {1, 2, 3} and {1, 2, 3, 4} (say)? Of course, everyday experience says that this is impossible. However,
mathematicians always take the point of view that if something is really obvious, then it ought to be easy
to justify.
Actually, this particular point isn’t that simple to justify — try to prove it yourself! — but it’s true,
and I’ll omit the proof.
Example. Prove that the set of natural numbers N = {1, 2, 3, 4, . . .} has the same cardinality as the set
E = {2, 4, 6, 8, . . .} of positive even integers.
Define f : N → E by
f (n) = 2n.
This function has an inverse f −1
: E → N given by
m
f −1 (m) = .
2
m
Note that since m ∈ E, m is even, so m is divisible by 2 and is actually a positive integer.
2
Here’s the proof that f and f −1 are inverses:
m m
f f −1 (m) = f =2· =m for m ∈ E,
2 2
2
2n
f −1 (f (n)) = f −1 (2n) = =n for n ∈ N.
2
This situation looks a little strange. E is contained in N, but I’ve just shown that the two sets “have the
same number of elements”. The only reason this looks funny is that it contradicts your real world experience
— which only deals with finite objects. In fact, it’s characteristic of infinite sets that they have the same
number of elements as some of their proper subsets.
Informally, a set has the same cardinality as the natural numbers if the elements of an infinite set can
be listed:
a1 , a2 , a3 , . . . .
In fact, to define listable precisely, you’d end up saying “the set has the same cardinality as the natural
numbers”. But this is a good picture to keep in mind. I’ll show that the real numbers, for instance, can’t be
arranged in a list in this way.
The next part of this discussion points out that the notion of cardinality behaves the way “the number
of things in a set” ought to behave.
Proof. (a) The identity function has an inverse, namely itself. Therefore, the identity function is a bijection.
But these equation also say that f is the inverse of f −1 , so it follows that f −1 is a bijection.
Proof. (a) By the lemma, the identity function id : S → S is a bijection, so |S| = |S|.
3
(b) If |S| = |T |, then there is a bijection f : S → T . By the lemma, f −1 : T → S is a bijection. Therefore,
|T | = |S|.
(c) If |S| = |T | and |T | = |U |, then there are bijections f : S → T and g : T → U . By the lemma,
g · f : S → U is a bijection, so |S| = |U |.
Example. Prove that the interval (0, 1) has the same cardinality as R.
π π
First, notice that the open interval − , has the same cardinality as the real line. To prove this, I
π π 2 2
have to construct a bijection f : − , → R. It’s easy: just define
2 2
f (x) = tan x.
To show that f is bijective, I have to show that it has an inverse; the inverse is f −1 (x) = arctan
x.
π π π π
Now I know that − , and R have the same cardinality. Next, I’ll show that (0, 1) and − ,
2 2 2 2
have the same cardinality.
π π π
The idea is to multiply by π to stretch (0, 1) to (0, π). Then I subtract to shift (0, π) to − , .
2 2 2
0 1
π π
All together, I define g : (0, 1) → − , by
2 2
π
g(x) = πx − .
2
π π π
First, if 0 < x < 1, then 0 < πx < π, so − < πx − < . This shows that g takes inputs in (0, 1)
π π 2 2 2
and produces outputs in − , .
2 2
To show that g is bijective, I have to produce an inverse. The standard “swap the x’s and y’s” procedure
works; you get
π
x+
g (x) =
−1 2.
π
Here’s the proof that g and g −1 are inverses:
π π
x+ x+
g g −1
(x) = g 2=π· 2 − π = x + π − π = x,
π π 2 2 2
π π
π πx − +
2 = πx = x.
g −1 (g(x)) = g −1 πx − = 2
2 π π
π π
Therefore, g is a bijection, so (0, 1) and − , have the same cardinality. By transitivity, (0, 1) and
2 2
R have the same cardinality.
4
Example. Prove that (0, 1) has the same cardinality as R+ = (0, ∞).
Define f : (0, 1) → (1, ∞) by
1
f (x) = .
x
Note that if
1
0 < x < 1, then > 1.
x
Therefore, f does map (0, 1) to (1, ∞).
0 1
1 1
I claim that f −1 (x) = . If x > 1, then 0 < < 1, so f −1 maps (1, ∞) to (0, 1). Moreover,
x x
1 1
f f −1 (x) = f = = x,
x 1
x
1 1
f −1
(f (x)) = f −1
= = x.
x 1
x
Thus, f is a bijection.
Define g : (1, ∞) → (0, ∞) by
g(x) = x − 1.
If x > 1, then x − 1 > 0. Therefore, g does map (1, ∞) to (0, ∞).
I claim that g −1 (x) = x + 1. If x > 0, then x + 1 > 1, so g −1 maps (0, ∞) to (1, ∞). Moreover,
g g −1 (x) = g(x + 1) = (x + 1) − 1 = x,
g −1 (g(x)) = g −1 (x − 1) = (x − 1) + 1 = x.
Therefore, g is a bijection.
With the bijections f and g, I have |(0, 1)| = |(1, ∞)| = |(0, ∞)|, so (0, 1) and (0, ∞) have the same
cardinality.
Example. Prove that the intervals [0, 4] and [−3, 5] have the same cardinality by constructing a bijection
from one to the other.
It’s important that both of these intervals are closed intervals. If both were open — say (−3, 5) and
(0, 4) — we can still take the approach we’ll take in this example. We would have some difficulty, however,
if the intervals were (say) [−3, 5] and (0, 4). We’ll see how to handle that kind of situation later.
The interval [−3, 5] has length 8 and the interval [0, 4] has length 4. Since 2 · 4 = 8, I’ll define a bijection
f : [0, 4] → [−3, 5] by “scaling up by a factor of 2”. So I start this way:
f (x) = 2x . . . .
5
As it stands, this doesn’t work, because f (0) = 2 · 0 = 0, and I’d like 0 to go to −3 in [−3, 5]. I fix this
by subtracting 3:
f (x) = 2x − 3.
First, I need to show that f actually takes [0, 4] to [−3, 5]. Suppose x ∈ [0, 4]. Then
0≤x≤4
0 ≤ 2x ≤ 8
−3 ≤ 2x − 3 ≤ 5
−3 ≤ f (x) ≤ 5
Hence, f (x) ∈ [−3, 5]. Therefore, it’s valid to write f : [0, 4] → [−3, 5].
As usual, I’ll show f is bijective by constructing an inverse g : [−3, 5] → [0, 4]. You can do this by
working backward on scratch paper, or by doing a scaling argument like the one I used to construct f .
Either way, I get
1
g(x) = (x + 3).
2
As I did with f , I need show that g takes its supposed domain [−3, 5] into its supposed codomain [0, 4].
Suppose x ∈ [−3, 5]. Then
−3 ≤ x ≤ 5
0≤ x+3≤8
1
0≤ (x + 3) ≤ 4
2
0 ≤ g(x) ≤ 4
Thus, g(x) ∈ [0, 4]. Therefore, it’s valid to write g : [−3, 5] → [0, 4].
Finally, I need to show f and g are inverses.
1 1
f (g(x)) = f (x + 3) = 2 · (x + 3) − 3 = (x + 3) − 3 = x.
2 2
1 1
g(f (x)) = g(2x − 3) = [(2x − 3) + 3] = · 2x = x.
2 2
Hence, f and g are inverses. Therefore, f and g are bijections. This proves that [−3, 5] and [0, 4] have
the same cardinality.
In many situations, it’s difficult to show that two sets have the same cardinality by actually constructing
a bijection between them. The theorem that follows gives an indirect way to show that two sets have the
same cardinality.
Theorem. (Schröder-Bernstein) Let S and T be sets. Suppose there are injective functions f : S → T and
g : T → S. Then S and T have the same cardinality.
6
same cardinality as a subset of S, then S and T must have the same cardinality.
S T
S T
It is a powerful tool for showing that sets have the same cardinality. Here are some examples.
Example. Show that the open interval (0, 1) and the closed interval [0, 1] have the same cardinality.
The open interval 0 < x < 1 is a subset of the closed interval 0 ≤ x ≤ 1. In this situation, there is an
“obvious” injective function f : (0, 1) → [0, 1], namely the function f (x) = x for all x ∈ (0, 1). (f is called
an inclusion map.) If f (x1 ) = f (x2 ), then x1 = x2 , so f is injective.
Next, I’ll construct an injective function g : [0, 1] → (0, 1). The idea is to find a “copy” of [0, 1] in (0, 1),
then do some scaling and translation to map [0, 1] onto the copy. I’ll use the interval [0.25, 0.75] as my target
in (0, 1). The target has length 0.5, so I’ll multiply by 0.5 to shrink [0, 1] to [0, 0.5]. Next, I’ll add 0.25 to
shift [0, 0.5] to [0.25, 0.75]. All together, I get
First, if 0 ≤ x ≤ 1, then 0 ≤ 0.5x ≤ 0.5, so 0.25 ≤ 0.5x + 0.25 ≤ 0.75. This proves that g is a function
from [0, 1] to [0.25, 0.75].
Next, I need to show that g is injective. Suppose that g(a) = g(b), I must prove that a = b. Now
g(a) = g(b) means that
0.5a + 0.25 = 0.5b + 0.25
0.5a = 0.5b
a=b
Therefore, g is injective. (In fact, g is bijective, and you could prove injectivity by constructing g −1 —
though it would be overdoing it a bit.)
Now I have injective functions (0, 1) → [0, 1] and [0, 1] → (0, 1). By Schröder-Bernstein, |(0, 1)| = |[0, 1]|.
Example. Prove that [−1, 1] has the same cardinality as (1, 3) ∪ (4, 6).
-1 1
1 3 4 6
The two sets don’t “look alike” — the first set is a single interval which is closed on both ends, while
the second set consists of two open intervals. When two sets don’t look alike but you think they have the
7
same cardinality, consider using the Schröder-Bernstein theorem. I’ll define injective functions going from
each set into the other.
I’ll describe in words how I’m getting the definitions of the functions. (Note that there are many
functions you could use to do this!)
The first set is an interval of length 2, which (because of its endpoints) won’t fit in either of the intervals
that make up the second set. Since the second set’s intervals don’t have endpoints, if I just slide [−1, 1] over,
its endpoints will stick out of the ends of either (1, 3) or (4, 6). So the idea is to shrink [−1, 1] first, then
slide it inside either (1, 3) or (4, 6).
If I multiply [−1, 1] by 0.5, I get [−0.5, 0.5], an interval of length 1. This will surely fit inside (1, 3)
(say), and I can slide [−0.5, 0.5] into (1, 3) by adding 2. This takes [−0.5, 0.5] to [1.5, 2.5]. I just have to do
the two steps one after the other. So define f : [−1, 1] → (1, 3) ∪ (4, 6) by
f (x) = 0.5x + 2.
First, I have to show that this makes sense — that is, that f really takes [−1, 1] into (1, 3) ∪ (4, 6).
Suppose x ∈ [−1, 1]. Then
−1 ≤ x ≤ 1
−0.5 ≤ 0.5x ≤ 0.5
−0.5 + 2 ≤ 0.5x + 2 ≤ 0.5 + 2
1.5 ≤ f (x) ≤ 2.5
Since 1.5 ≤ f (x) ≤ 2.5, obviously 1 < f (x) < 3, so f does map [−1, 1] into (1, 3) ∪ (4, 6).
Next, I have to show that f is injective. Suppose f (a) = f (b). Then
0.5a + 2 = 0.5b + 2
0.5a = 0.5b
a=b
Hence, f is injective.
Next, I have to define an injective function g : (1, 3) ∪ (4, 6) → [−1, 1]. Now (1, 3) ∪ (4, 6) occupies a
1
total length of 6 − 1 = 5, whereas the target interval [−1, 1] has length 2. If I multiply by = 0.2, I’ll shrink
5
(1, 3) ∪ (4, 6) to (0.2, 0.6) ∪ (0.8, 1.2), which has a total length of 1. Next, I can slide (0.2, 0.6) ∪ (0.8, 1.2)
inside [−1, 1] by subtracting 0.7, which should give (−0.5, −0.1) ∪ (0.1, 0.5).
Thus, define g : (1, 3) ∪ (4, 6) → [−1, 1] by
I need to check that g maps (1, 3) ∪ (4, 6) into [−1, 1]. Let x ∈ (1, 3) ∪ (4, 6). Then certainly x is between
1 and 6, i.e. 1 < x < 6. (Of course, 1 < x < 6 does not imply that x ∈ (1, 3) ∪ (4, 6). Do you see why?) So
1<x<6
0.2 < 0.2x < 1.2
0.2 − 0.7 < 0.2x − 0.7 < 1.2 − 0.7
−0.5 < g(x) < 0.5
Since −0.5 < g(x) < 0.5, obviously −1 ≤ g(x) ≤ 1, so g does map (1, 3) ∪ (4, 6) into [−1, 1].
Next, I have to show that g is injective. Suppose g(a) = g(b). Then
8
Therefore, g is injective.
Hence, [−1, 1] and (1, 3) ∪ (4, 6) have the same cardinality, by the Schröder-Bernstein theorem.
I’ve already noted that it’s easy to find finite sets of different cardinalities: for example, a set with
three elements does not have the same cardinality as a set with 42 elements. I’ve also given examples of
infinite sets which have the same cardinality. It’s an important fact that not all infinite sets have the same
cardinality — there are different kinds of “infinity”! Here’s some terminology which I’ll used to describe the
situation.
Definition. A set is countably infinite if it has the same cardinality as the natural numbers N =
{1, 2, 3, . . .}. An infinite set which is not countably infinite is uncountably infinite or uncountable.
A set is countable if it is either finite or countably infinite.
I know that some infinite sets — the even integers, for instance — are countably infinite. I know of
other infinite sets, such as the real numbers. Is the set of real numbers countably infinite? The answer is
no; the proof is due to Georg Cantor (1845–1918), and is called the diagonalization argument.
Proof. I’m going to be a little informal in this proof so that the main idea isn’t lost in a lot of notation.
Suppose on the contrary that (0, 1) is countably infinite. Represent numbers in the interval as decimals
0.a1 a2 a3 . . .. (If a number ends in an infinite sequence of 9’s, rewrite it as a finite decimal — so, for instance,
0.134999 . . . becomes 0.135.) Since (0, 1) is countably infinite by assumption, I can arrange the numbers in
(0, 1) in a list:
. 3 6 8 9 7 3 4 8
. 5 0 4 1 8 5 6 3
. 0 2 4 7 3 5 9 6
. 2 1 7 6 1 4 0 7 . . .
. 4 4 2 0 5 9 3 1
. 7 9 6 9 3 2 1 5
. 7 1 8 1 8 0 4 2
. 1 3 5 4 6 7 6 3
.
.
.
I emphasize that, by assumption, this list contains all of the numbers in the interval (0, 1).
Now go down the diagonal and make a number using the digits. In this case, I get the number
0.30465243 . . ..
Take each of the digits in this number and change it to any other digit except 9. For example, you could
add 1 to each digit from 0 to 7 and change 8 or 9 to 0. This would produce the number 0.41576354 . . ..
(The reason you do not want to change digits to 9 is so that you don’t wind up with a number that
ends in an infinite sequence of 9’s.)
The number 0.41576354 . . . differs from each of the numbers in my list. Specifically, the nth digit of
0.41576354 . . . is different from the nth digit in the nth number on the list. This means that 0.41576354 . . .
is not in my list — which is a contradiction, because I assumed that my list contained all of the numbers in
the interval (0, 1).
Therefore, the interval (0, 1) must be uncountably infinite.
Since the interval (0, 1) has the same cardinality as R, it follows that R is uncountably infinite as well.
Notice that Z (which is countably infinite) is a subset of R. Are there any sets which are “between” Z and
R in cardinality?
The Continuum Hypothesis states that there are no sets which are “between” Z and R in cardinality;
it was first stated by Cantor, who was unable to construct a proof. Kurt Gödel [2] proved around 1940 that
9
the Continuum Hypothesis was consistent relative to the standard axioms of set theory. Paul Cohen [1]
proved in 1963 that the Continuum Hypothesis is undecidable: It is independent of the standard axioms for
set theory.
In other words, the question of the existence of a subset of R which has cardinality different from either
Z or R can’t be settled without adding assumptions to standard mathematics — and you can assume either
that such a set exists, or that it doesn’t, without causing a contradiction.
Definition. Let S be a set. The power set P (S) of S is the set of all subsets of S.
P (S) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
Notice that the power set includes the empty set and the set S itself.
If you’re constructing a subset of a set, there are two alternatives for each element: Either it is in the
subset, or it is not. So if the set has n elements, the two alternatives for each element give 2n possibilities
in all. Therefore, if S is finite and |S| = n, then | P (S)| = 2n .
In this example, |S| = 3, and | P (S)| = 23 = 8.
Theorem. If S is a set, then S and P (S) do not have the same cardinality.
Proof. Suppose first that S = ∅. Now ∅ ⊂ ∅, so P (∅) = {∅}. Hence, |∅| = 0 while |P (∅)| = 1, and the result
is true in this case.
Now suppose that S 6= ∅. I’ll prove the result by contradiction. Suppose that |S| = | P (S)|. This means
that there is a bijection f : S → P (S).
Since f is a bijection, every element of the power set — that is, every subset of S — is paired up with
an element of S. For example, there must be an element s ∈ S for which f (s) = ∅.
Of course, s ∈ / ∅. So s is an element which is paired up with a subset that doesn’t contain it. And in
general, f takes an element of S to a subset of S, and that subset either contains the element or it doesn’t.
Here’s a particular example to help you get your bearings. In the picture below, the set is S = {a, b, c, d}
and the function f is depicted by the arrows.
{a,c}
{b,d}
f {d}
b {b,c}
{a}
a
{a,b,d} {a,c,d}
d {a,d}
{b}
{b,c,d}
c {a,b,c,d} {a,b}
S
{c}
{c,d}
{a,b,c}
P(S)
In this example, f takes b and c to subsets that contain them; f takes a and d to subsets which don’t
contain them.
Continuing with the proof, let
T = {s ∈ S | s ∈
/ f (s)}.
10
That is, T is the subset of elements of S which f takes to subsets which don’t contain them. I know
there is at least one such element, namely the element which f takes to the empty set.
Now f is bijective, and T is a subset of S, so there is an element s0 ∈ S such that f (s0 ) = T . Question:
Is s0 ∈ T ?
If s0 ∈ T , then by definition of T , s0 ∈
/ f (s0 ) = T . This is a contradiction.
If s0 ∈
/ T , then s0 ∈
/ T = f (s0 ), so s0 satisfies the defining condition for T — which means s0 ∈ T . This
is a contradiction.
Since s0 ∈ T and s0 ∈ / T both lead to contradictions, I’ve actually contradicted my first assumption —
that |S| = | P (S)|. Therefore, |S| 6= | P (S)|, as I wanted to prove.
As an example, the power set of the natural numbers N has the same cardinality as R.
I showed earlier that N is countably infinite, whereas R is uncountably infinite, so this confirms the
theorem in this particular case.
I’m going to list the pairs starting with (1, 1) in the order shown by the grey line. This means I’m
constructing a function f : N × N → N. Here it is:
(m + n − 2)(m + n − 1)
f (m, n) = + m.
2
11
Here is why this works. (m, n) is the mth element on the diagonal line whose elements add up to m + n.
Previous to that, the number of element I’ve gone through is
(m + n − 2)(m + n − 1)
0 + 1 + 2 + · · · + (m + n − 2) = .
2
(m + n − 2)(m + n − 1)
That gives + m.
2
It’s a little tricky to show f is injective, so I’ll omit the proof here. There is an obvious way to make an
injective function from N to N × N:
g(n) = (1, n).
If g(n1 ) = g(n2 ), then (n1 , 1) = (n2 , 1), so n1 = n2 , and hence g is injective. By the Schröder-Bernstein
theorem, N and N × N have the same cardinality.
[1] Paul J. Cohen, Set Theory and the Continuum Hypothesis, Reading, Massachusetts: The Benjamin-
Cummings Publishing Company, Inc., 1966 [ISBN 0-8053-2327].
[2] Kurt Gödel, Consistency-proof for the generalized continuum hypothesis, Proc. Nat. Acad. Sci. U.S.A.,
25(1939), 220-204.
Example. For each relation, check each axiom for a partial order. If the axiom holds, prove it. If the axiom
does not hold, give a specific counterexample.
Example. Let X be a set and let P (X) be the power set of X — i.e. the set of all subsets of X. Show that
the relation of set inclusion is a partial order on P (X).
1
Here’s a particular example. Let X = {a, b, c}. This is a picture of the set inclusion relation on P (X):
{a, b, c}
{}
Definition. Let (X, ≤) be a partially ordered set. The lexicographic order (or dictionary order) on
X × X is defined as follows: (x1 , y1 ) ∼ (x2 , y2 ) means that
(a) x1 < x2 , or
(b) x1 = x2 and y1 ≤ y2 .
Note that (x1 , y1 ) ∼ (x2 , y2 ) implies x1 ≤ x2 .
You can extend the definition to two different partially ordered sets X and Y , or a sequence X1 , X2 ,
. . . , Xn of partially ordered sets in the same way. The name dictionary order comes from the fact that it
describes the way words are ordered alphabetically in a dictionary. For instance, “aardvark” comes before
“banana” because “a” comes before “b”. If the first letters are the same, as with “mystery” and “meat”,
then you look at the second letters: “e” comes before “y”, so “meat” comes before “mystery”.
y
(2,4)
(-2,2)
(2,1)
(-1,-2)
In the picture above, (−2, 2) ∼ (−1, −2), because −2 < −1. And (2, 1) ∼ (2, 4) because the x-
coordinates are equal and 1 < 4.
Proposition. The lexicographic order on X × X is a partial order.
Proof. First, (x, y) ∼ (x, y), since x = x and y ≤ y. ∼ is reflexive.
Next, suppose (x1 , y1 ) ∼ (x2 , y2 ) and (x2 , y2 ) ∼ (x1 , y1 ). Now (x1 , y1 ) ∼ (x2 , y2 ) means that either
x1 < x2 or x1 = x2 . The first case x1 < x2 is impossible, since this would contradict (x2 , y2 ) ∼ (x1 , y1 ).
Therefore, x1 = x2 . Then (x1 , y1 ) ∼ (x2 , y2 ) implies y1 ≤ y2 and (x2 , y2 ) ∼ (x1 , y1 ) implies y2 ≤ y1 . Hence,
y1 = y2 . Therefore, (x1 , y1 ) = (x2 , y2 ). ∼ is antisymmetric.
Finally, suppose (x1 , y1 ) ∼ (x2 , y2 ) and (x2 , y2 ) ∼ (x3 , y3 ). To keep things organized, I’ll consider the
four cases.
2
(a) If x1 < x2 and x2 < x3 , then x1 < x3 , so (x1 , y1 ) ∼ (x3 , y3 ).
Hence, ∼ is transitive, and this completes the proof that ∼ is a partial order.
A common mistake in working with partial orders — and in real life — consists of assuming that if
you have two things, then one must be bigger than the other. When this is true about two things, the
things are said to be comparable. However, in an arbitrary partially ordered set, some pairs of elements
are comparable and some are not.
Here’s a pictorial example to illustrate the idea. You can sometimes describe an order relation by
drawing a graph like the one below:
c d e
g
f
h i
S = {a, b, c, d, e, f, g, h, i}.
Two elements are comparable if they’re joining by a sequence of edges that goes upward “without
reversing direction”. (Think of “bigger” elements being above and “smaller” elements being below.) It’s also
understood that every element satisfies x ∼ x.
For example, f ∼ c, since there’s an upward segment connecting f to c. And f ∼ a, since there’s an
upward path of segments f → c → b → a connecting f to a.
On the other hand, there are elements which are not comparable. For example, d and e are not
comparable, because there is no upward path of segments connecting one to the other. Likewise, g ∼ h and
g ∼ i, but h and i are not comparable.
Notice that a is comparable to every element of the set, and that x ∼ a for all x ∈ S.
(a) An element x ∈ X which is comparable to every other element of X and satisfies x ≥ y for all y ∈ X is
the largest element of the set.
(b) An element x ∈ X which is comparable to every other element of X and satisfies x ≤ y for all y ∈ X is
the smallest element of the set.
3
In some cases, we only care that an element be “bigger than” or “smaller than” elements to which it is
comparable.
Definition. Let X be a partially ordered set. If an element x satisfies x ≥ y for all y to which it is
comparable, then x is a maximal element. Likewise, if an element x satisfies x ≤ y for all y to which it is
comparable, then x is a minimal element.
Note that a largest or smallest element, if it exists, is unique. On the other hand, there may be many
maximal or minimal elements.
Check each axiom for a partial order. If the axiom holds, prove it. If the axiom does not hold, give a
specific counterexample.
Check each axiom for a partial order. If the axiom holds, prove it. If the axiom does not hold, give a
specific counterexample.
Since |ab| ≥ |ab| for all (a, b) ∈ R2 , it follows that (a, b) ∼ (a, b) for all (a, b) ∈ R2 . Therefore, ∼ is
reflexive.
(1, 2) ∼ (−1, 2), since |1 · 2| ≥ |(−1) · 2|. Likewise, (−1, 2) ∼ (1, 2), since |(−1) · 2| ≥ |1 · 2|. However,
(1, 2) 6= (−1, 2). Therefore, ∼ is not antisymmetric.
Finally, suppose (a, b) ∼ (c, d) and (c, d) ∼ (e, f ). Then |ab| ≥ |cd| and |cd| ≥ |ef |. Hence, |ab| ≥ |ef |.
Therefore, (a, b) ∼ (e, f ). Hence, ∼ is transitive.
The usual less than relation < is a total order on Z, on Q, and on R. Likewise, you can use the total
order relation on Z to define a lexicographic order on Z × Z which is a total order. Specifically, define a total
order ∼ on Z × Z as follows: (x1 , y1 ) ∼ (x2 , y2 ) means that
(a) x1 < x2 , or
4
(b) x1 = x2 and y1 < y2 .
You can check that the axioms for a total order hold.
Example. Consider the relation defined by the graph below:
a
d e
Thus, x < y means that x 6= y, and there is an upward path of segments from x to y.
Is this relation a total order? You can check cases, using the picture, that the relation is transitive.
(This amounts to saying that if there’s an upward path from x to y and one from y to z, then there’s such a
path from x to z. In fact, if you define a relation using a graph in this way, the relation will be transitive.)
However, this graph does not define a total order. Trichotomy fails for d and e, since d < e, e < d, and
d = e are all false.
For instance, consider the subset T = (0, 1] of R. 2 is an upper bound for T , since 2 ≥ x for all x ∈ T .
1 is also an upper bound for T . Note that 2 is not an element of T while 1 is an element of T . In fact, any
real number greater than or equal to 1 is an upper bound for T .
Likewise, any real number less than or equal to 0 is a lower bound for T .
T has a largest element, namely 1. It does not have a smallest element; the obvious candidate 0 is not
in T .
This example shows that a subset may have many — even infinitely many — upper or lower bounds.
Among all the upper bounds for a set, there may be one which is smallest.
Definition. Let S be a partially ordered set, and let T be a subset of S. An element s0 ∈ S is a least
upper bound for T if:
(a) s0 is an upper bound for T .
(b) If s is an upper bound for T , then s0 ≤ s.
The idea is that s0 is an upper bound by (a); it’s the least upper bound, since (b) says s0 is smaller
than any other upper bound.
Definition. Let S be a partially ordered set, and let T be a subset of S. An element s0 ∈ S is a greatest
lower bound for T if:
5
(a) s0 is an lower bound for T .
(b) If s is an lower bound for T , then s0 ≥ s.
The concepts of least upper bound and greatest lower bound come up often in analysis. I’ll give a simple
example.
Example. Determine the least upper bound and greatest lower bound for the following sets (if they exist):
(a) The subset S = (0, 1] of R.
(b) The subset T = (0, +∞) of R. (Thus, T is the positive real axis, not including 0.)
(a) Any real number greater than or equal to 1 is an upper bound for T . Among the upper bounds for S,
it’s clear that 1 is the smallest, so 1 is the least upper bound for S.
Likewise, any real number less than or equal to 0 is a lower bound for S. But among the lower bounds
for S, it’s clear that 0 is the largest, so 0 is the greatest lower bound for S.
Notice that 1 ∈ S, but 0 ∈ / S. The least upper bound and greatest lower bound may be contained, or
not contained, in the set.
(b) T has no least upper bound in R; in fact, T has no upper bound in R.
0 is the greatest lower bound for T in R.
Inequalities
We’ve already seen examples of proofs of inequalities as examples of various proof techniques. In this
section, we’ll discuss assorted inequalities and the heuristics involved in proving them. The subject of
inequalities is vast, so our discussion will barely scratch the surface.
Here are a couple of basic rules which I’ll use constantly.
2. You can multiply an inequality by a nonzero number — but if the number you multiply by is negative,
the inequality is reversed.
The x4 + · · · + 4y 2 looks like it came from (x2 ± 2y)2 . I know that even powers are always ≥ 0. I’ll start
with (x2 − 2y)2 ≥ 0 and see if I can get the desired inequality:
(x2 − 2y)2 ≥ 0
x4 − 4x2 y + 4y 2 ≥ 0
x4 + x2 y + 4y 2 ≥ 5x2 y
Example. If a, b > 0, then ab > 0. And if a = b and c = d, then ac = bd. Is it true that if a > b and c > d,
then ac > bd?
The statement is false. For example, 2 > 1 and −1 > −2, but 2 · (−1) 6> 1 · (−2).
This result shows that you have to be careful in the rules you use to work with inequalities. Some
“rules” which look obvious aren’t correct.
In fact, the false result in the example can be “fixed” by placing additional assumptions on a, b, c, and
d. To prove the correct result, I’ll have to use very basic facts about inequalities involving real numbers.
Here are some axioms for the standard order relation on R. Everything is defined in terms of a subset
R+ , the positive real numbers.
The order relation > is defined in terms of R+ . Think about a statement like “7 > 3”. Another way to
say this is: You add a positive number (namely 4) to 3 to get 7.
Here is a “fixed” version of the incorrect rule in the last example. The proof illustrates a standard
approach in inequality proofs involving the basic axioms: Convert inequality statements to equations and
work with the equations.
Lemma. Suppose a, b, c, and d are positive real numbers, a > b, and c > d. Then ac > bd.
1
Proof. Suppose a, b, c, d > 0, a > b, and c > d. Write
Then
ac = (b + p)(d + q) = bd + pd + bq + pq.
pd, bq, and pq are positive, because each is the product of positive numbers. Hence, pd + bq + pq is
positive. The equation above therefore shows that ac > bd.
a + c = (b + c) + p.
1
Example. (Using a known trig inequality) Prove that for all x ∈ R, 1 ≤ (sin x + 3) ≤ 2.
2
The “· ≤ · ≤ ·” form of the inequality and the presence of the sin x in the middle remind me of
−1 ≤ sin x ≤ 1, so I’ll start with that and do some algebra:
−1 ≤ sin x ≤ 1
2 ≤ sin x + 3 ≤ 4
1
1≤ (sin x + 3) ≤ 2
2
Example. (Using an integral inequality) From calculus, you know that if f and g are integrable functions
and f (x) ≥ g(x) on [a, b], then
Z b Z b
f (x) dx ≥ g(x) dx.
a a
I have
1≥0
x + 1 ≥ x4
4
x4
1≥
x4 + 1
Applying the integral inequality, I get
0.1 0.1 0.1
x4 x4
Z Z Z
1 dx ≥ 4
dx so 0.1 ≥ dx.
0 0 x +1 0 x4+1
2
You can often “see” that an inequality is true by drawing a picture. For example, draw the graph of
1
y = for 1 ≤ x ≤ n, where n is an integer greater than 1.
x
.....
1 2 3 4
.....
n-3 n-2 n-1 n
Divide the interval [1, n] up into n equal pieces, and build a rectangle on each piece, using the left-hand
endpoints of each subinterval to get the heights. As you can see from the picture, the rectangles all lie above
the curve, so the sum of the rectangle areas will be greater than the area under the curve.
The first rectangle has base 1 and height 1, so its area is 1. The second rectangle has base 1 and height
1 1 1
, so its area is . Continuing in this way, the last rectangle has base 1 and height , so its area is
2 2 n−1
1
.
n−1 Z n
dx
The area under the curve is .
1 x
Therefore, Z n
1 1 1 dx
1 + + + ··· + ≥ = ln n.
2 3 n−1 1 x
∞
X 1
This inequality is correct (and by the way, you can use it to see that the harmonic series diverges).
n=1
n
But the argument I gave is not a completely rigorous proof.
I’m assuming that the picture accurately represents the situation. To prove that this is the case takes
some work. For example, I’d need to prove that each rectangle really does lie above the curve. This would
1
involve noting that y ′ = − 2 < 0 shows that the graph is decreasing, then using this to prove that the
x
1
left-hand endpoints give the maximum value of y = on each subinterval.
x
Pictures can help you see or remember that something is true, and sometimes a picture or a heuristic
argument is useful in teaching — to avoid obscuring the idea with technicalities. But you should never
confuse a picture with a rigorous proof!
Example. (Using the Mean Value Theorem) Prove that for all x > 0, ex > x + 1.
Let f (x) = ex − x − 1. Take x > 0 and apply the Mean Value Theorem to f on the interval [0, x]. The
Mean Value Theorem implies that there is a number c such that 0 < c < x and
f (x) − f (0)
= f ′ (c).
x−0
3
Now f ′ (c) = ec − 1, and c > 0, so f ′ (c) = ec − 1 > 1 − 1 = 0. Thus,
f (x) − f (0)
>0
x−0
f (x)
>0
x
f (x) > 0
In some cases, you can use a known inequality to prove other inequalities. Here are some well-known
inequalities.
The name “Triangle Inequality” comes from the corresponding inequality when x and y are vectors. In
that case, it says that the sum of the lengths of two sides of a triangle (|x| + |y|) is greater than or equal to
the length of the third side (|x + y|).
You may have seen this inequality in a vector calculus course or a linear algebra course. Let
(The product on the left side is the dot product of the two vectors.)
Example. (Using the Triangle Inequality) Prove that if a and b are real numbers, then
|a − b| ≥ ||a| − |b||.
|a − b| + |b| ≥ |(a − b) + b|
|a − b| + |b| ≥ |a|
|a − b| ≥ |a| − |b|
4
Apply the Triangle Inequality with x = b − a and y = a:
|b − a| + |a| ≥ |(b − a) + a|
|b − a| + |a| ≥ |b|
|b − a| ≥ |b| − |a|
|a − b| ≥ |b| − |a|
n
! n
!
X X 1
ak ≥ n2 .
ak
k=1 k=1
√ √ 1 1
x1 = a1 , . . . x n = an , y1 = √ , . . . yn = √ .
a1 an
I get
n
!2 n
! n 2 !
X √ 1 X √ X 1
ak · √ ≤ ( ak )2 √ .
ak ak
k=1 k=1 k=1
This simplifies to
n
!2 n
! n
!
X X X 1
1 ≤ ak .
ak
k=1 k=1 k=1
n
X
But 1 = n, so
k=1 ! !
n n
2
X X 1
n ≤ ak .
ak
k=1 k=1
As in this example, the trick to applying known inequalities is figuring out what substitutions to make.