A Primer For Logic and Proof
A Primer For Logic and Proof
) we have
NEW
L
A. By the Deduction Theorem,
L
NEW
A. Since NEW
. We can put
together a short proof of
L
A.
1. NEW Axiom NEW
2. NEW A Lemma from preceding paragraph
3. A Modus Ponens, lines 1 and 2
So far, anything provable with the new axiom is provable in the original
axiom system. Also, anything provable in L must be provable in the new axiom
system. Thus, the new axiom system has exactly the same theorems as L.
What does this do for us? The new axiom system satises the completeness
and soundness theorems. Its another reasonable axiom system. In reality, its
just L with a lemma disguised as an axiom. Big deal.
Suppose now that we add a formula that isnt a tautology as a new axiom.
Remember that since we want to treat this new formula just like any other
axiom, we have to allow any instance of the new formula to appear as a line in a
proof. This always results in an inconsistent theory. (And inconsistent theories
dont satisfy the Soundness Theorem.) Lets look at a particular example.
Consider adding A B to L as a new axiom. We can show that the resulting
theory is inconsistent: Notice that a particular instance of this new axiom is
26 CHAPTER 1. PROPOSITIONAL CALCULUS
A A (where A is substituted for B. However, A A is not a tautology,
so this new theory is not sound:
A A
T F F
F T T
Lets summarize. If we add a tautology to L, we get L. If we add a non-
tautology to L, we get garbage. It looks like adding axioms is not very protable.
Discarding an axiom
Axiom 3 is particularly ugly. Can we throw it away? Unfortunately, the re-
sulting theory doesnt satisfy the Completeness Theorem. Heres another way
to descibe the situation. Axiom 3 cant be proved from Axiom 1 and Axiom 2.
Also, since L is consistent, Axiom 1 and Axiom 2 cant prove the negation of
Axiom 3. Logicians would say, Axiom 3 is independent of Axiom 1 and Axiom
2. Independence statements of this sort are often very challenging to prove.
Overall, discarding axioms yields systems that dont satisfy the Complete-
ness Theorem. This isnt such a hot way to modify L.
Starting from scratch
So far, we havent had much luck. Maybe the best thing is to dump L, and start
with a brand new axiom system. Lots of people have done this. Here are two
examples.
Axiom System. Kleenes Axiom System for Propositional Calculus [6].
The axioms:
A (B A)
(A (B C)) ((A B) (A C))
(A B) A
(A B) B
A (B (A B))
A (A B)
B (A B)
(A C) ((B C) ((A B) C))
(A B) ((A B) A)
A A
Use the above axioms with Modus Ponens. The theorems of this system are
exactly the tautologies. In other words, completeness and soundness theorems
hold for this system. By using this system, we could avoid using abbreviations
to deal with conjunction and disjunction. If we wanted, we could add more
axioms to deal with biconditional or any other connectives we might like to
append.
Axiom System. Merediths Axiom System for Propositional Calculus [9].
1.11. ASSESSING PROPOSITIONAL CALCULUS 27
Heres the (only!) axiom:
((((A B) (C D)) C) E) ((E A) (D A))
Using the above axiom with Modus Ponens. The theorems of this system are
exactly the tautologies. Merediths system is very elegant with its single axiom
and single rule of inference. Unfortunately, it is not so easy to prove theorems
in this system or even to recognize instances of the axiom. For an exceptionally
challenging exercise, try proving L1 in Merediths system.
Exercises.
1. Show that Merediths axiom is a tautology
2. Write down two instances of Merediths axiom.
3. Prove the following using Kleenes axiom system:
(a) A A
(b) A B, B C A C
(c) A B B A
1.11 Assessing Propositional Calculus
Propositional calculus is pretty nice. Weve managed to talk about a lot of logic
without being terribly technical. Our proof system, L, is slick. Its consistent,
and has a deduction theorem, a soundness theorem, and a completeness theorem.
Propositional calculus is useful for analyzing lots of dierent sorts of ar-
guments. In particular, we can use it to understand the structure of lots of
mathematical proofs. For example, we know that mathematicians use the De-
duction Theorem every day to prove implications. Also, mathematicians follow
the format of L25 to prove biconditional statements.
The big disadvantage of propositional calculus is that it glosses over any ne
distinctions. Its just not very expressive. For example, suppose we want to use
propositional calculus to formalize the statement if n > 0 then n + 1 > 0. If
we let P denote n > 0 and Q denote n+1 > 0, then our formalization is P Q.
This certainly shows us that the statement is an implication, but it hides the
fact that the hypothesis and the conclusion are both talking about n. In order
to overcome this limitation, we need a logical system that includes variables.
Exercises.
1. Use propositional calculus to formalize the following argument.
Socrates is a man.
All men have ugly feet.
Socrates has ugly feet.
28 CHAPTER 1. PROPOSITIONAL CALCULUS
2. Is the argument in exercise 1 valid? Should it be?
Chapter 2
Predicate Calculus
Propositional calculus can express only the simplest of statements. Predicate
calculus overcomes this diculty by introducing variables and quantiers. Vari-
ables will be used to represent an arbitrary object in the set of objects being
studied, called the universe. Quantiers will allow us to talk about a property
holding for all objects or that there exists an object for which the property holds.
The addition of quantied variables makes the language of predicate calculus
suciently rich to express almost any mathematical notion.
Well use our study of propositional calculus as a map for our study of
predicate calculus. As before, we need to start by specifying what the formulas
look like. Then we can talk about some semantics, looking for a notion that
parallels the idea of tautologies. Well do some formula rewriting, and then turn
to proofs. The proof system we concoct will be consistent and have a deduction
theorem, a soundness theorem, and a completeness theorem. Well also cook up
some shortcuts to make proofs easier to write. By then, it will be time to start
a new chapter.
2.1 Building Blocks
What sort of symbols are used in predicate calculus? Roughly, what do the
symbols represent? Here are the answers:
Predicates
We use capital letters, (A, B, C, etc.) to represent predicates. A predicate
letter will usually be associated with a list of at least one variable. For example,
A(x) B(x, y, z) Q(n)
are all acceptable constructions. A predicate is used to represent a property
of its variable(s) or a relationship between its variables. For example, P(x, y)
29
30 CHAPTER 2. PREDICATE CALCULUS
might represent the statement x < y or the statement x and y are kinds of
sh.
Sometimes, well use special predicate symbols like =, , or >. Rather than
writing the symbol in front of the variables, well put it between the variables.
Thus, we would write x = y rather than = (x, y). Writing the predicate in front
is called prex notation. Writing it in the middle is called inx notation. No
matter which notation we use or which symbols we use, we should specify any
intended meaning of the predicate symbols.
Terms
The list after a predicate symbol can include more than just variables. Any
term can be used in the list. Terms are either variables, constants, or functions
applied to terms.
Variables are small letters (like x, y, and z) representing an arbitrary
object from the universe.
Constants are underlined letters (like a, b, and c) representing a particular
object from the universe.
Functions are small letters (like f, g, and h); functions take as input a list
of terms and have a unique output.
Despite the fact that functions and variables are both denoted by small
letters, it is easy to keep them straight. Functions have lists associated with
them, just like predicates. For example, f(x, y) is a function f applied to
the variables x and y. Functions can act on other terms, too. For example,
g(x, a, h(z)) is the function g applied to the variable x, the constant a, and the
function h, where h is a function applied to z.
Functions and predicates dier in one very important respect. The value
of a function is an object, while the value of a predicate is a truth value. For
example, if we want to represent the father of x, it makes sense to use a
function like f(x). On the other hand, if we want to say x is a father, we
would use a predicate symbol, like P(x). If f(Chelsea) is Bill, then P(Bill) is
true.
What sort of objects these terms represents depend upon the context, i.e.,
the universe of objects that we are examining. If were talking about numbers,
x would represent a number. If were talking about milkmen, x would represent
a milkman. A variable represents a non-specic object, like some milkman.
A constant represents a particular object, like Waldo the milkman who lives
up the street. A function represents an object that is somehow related to the
objects in its variable list. For example, if x represents a milkman in the universe
of milkmen, then f(x) could represent the milkman who took over xs old route.
If w represents Waldo the milkman, then f(w) represents the milkman who took
over Waldos old route.
2.2. TRANSLATIONS 31
Connectives
The connectives are , , , , and . These are the same connectives we
used in propositional calculus, and they mean exactly the same thing.
Quantiers
Well use and as our quantier symbols. Quantier symbols must be followed
by a single variable (never a constant or a function).
x is read as for all x.
x is read as there exists an x.
Well build all our formulas from the sorts of symbols listed above, inserting
parentheses where we need them. If we need to represent an entire formula with
a single letter, well just use a capital letter (A, B, C, etc.). If there is any
possibility confusing a whole formula with a predicate, well be sure to include
extra explanation. Usually, we will use A(x, y, z) to represent a formula that
includes the variables x, y, and z.
Rather than being really technical about what constitutes a properly con-
structed formula, lets look at some examples.
2.2 Translations
We can translate English statements into predicate calculus, and vice versa. In
either case, we must be careful to specify what the symbols represent.
Predicate calculus into English.
Example. Assuming that the universe consists of the real numbers, and that
, , 0, 1, and = have their usual meaning, well translate the following into
English.
(a) x(x 0 = 0)
For all real numbers x, x times 0 equals 0.
(b) x(x x x = 0 (x = 0 x = 1))
For all real numbers x, if x x x = 0 then either x = 0 or x = 1.
(c) xy(x y = 1)
For all real numbers x, there is a real number y such that x y = 1.
Example. Assuming that the universe consists of the natural numbers N =
0, 1, 2, ..., f(x) means x + 1, and B(x) means x = 0, translate the following
into English.
(a) xB(f(x))
For all natural numbers x, it is not true that x + 1 = 0.
We can make it sound more natural: For all natural numbers x, x+1 ,= 0.
32 CHAPTER 2. PREDICATE CALCULUS
(b) xB(f(x))
There is a natural number x, such that x + 1 = 0.
(c) xB(f(x))
There is a natural number x, such that x + 1 ,= 0.
Most of the translations we have done to this point involved one quantier.
Before proceeding lets consider the following example, which will clarify the
convention on how to interpret multiple quantiers:
Example. Let the universe be the set of all people, and the predicate L(x, y)
stand for x loves y (and equivalently, y is loved by x). Here are all of the possible
versions with x and y quantied. Notice the careful treatment of the translation
in each case. Loves is not assumed to be reexive here.
Both variables quantied with :
xyL(x, y): Everyone loves everyone.
yxL(x, y): Everyone is loved by everyone.
These sentences mean the same thing, and this will be true for all interpreta-
tions, as we will prove more formally later.
Both variables quantied with :
xyL(x, y): Someone loves someone.
yxL(x, y): Someone is loved by someone.
Again, these sentences mean the same thing, and this will be true for all inter-
pretations, as we will prove more formally later.
First variable quantied with :
xyL(x, y): Everyone loves someone.
yxL(x, y): Everyone is loved by someone.
These sentences do not mean the same thing. In the rst case a more formal
translation would be Every person has someone that they love. In the second
case, Every person has someone who loves them. The order of the variables
is important here.
First variable quantied with :
xyL(x, y): Someone loves everyone.
yxL(x, y): Someone is loved by everyone.
Again, these sentences do not mean the same thing. In the rst case we have
there is someone who loves all people. In the second case, there is someone
who is loved by everyone. Notice also that none of the four alternations of
quantiers means the same thing. Order is extremely important!
English into predicate calculus
Example. Lets begin by formalizing: For all natural numbers n, n n
2
.
We have several choices for formalizing this statement. Let the universe be all
2.2. TRANSLATIONS 33
natural numbers. Let s(x) be the function x
2
and P(x, y) be the predicate for
x y. We can formalize the statement as:
x P(x, s(x)).
On the other hand, we can use the and square symbols with their usual
meanings directly and use n as our variable name:
n(n n
2
).
What if we needed the universe to be all real numbers rather than all natural
numbers? How could we adapt the rst version to handle this? We would need
to have a new predicate for x is a natural number. Let N(x) stand for this:
x(N(x) P(x, s(x))).
Example. Now lets try a more complex example: Socrates is a man. All men
have ugly feet. Socrates has ugly feet. Again, we can proceed in several ways.
Let the universe be the set of all people. Let U(x) be the predicate x has ugly
feet. Let M(x) be the predicate x is a man. Let s be the constant in the universe
representing the man Socrates. Then the three statements above translate as
follows.
M(s) x(M(x) U(x)) U(s)
Example. Lets look at a statement that uses a function in a non-mathematical
universe. Translate: Each man has a father. There are a variety of ways proceed.
Let the universe be all men. Let f(x) be the function father of x. Let S(x, y)
mean is that x same person as y. Then we can formalize the statement as
xyS(y, f(x)).
Exercises.
1. Assuming that the universe consists of all people, f(x) means father of
x, and B(x) means x is the chancellor, translate the following into
English.
(a) xB(f(x))
(b) xB(x)
(c) xB(x)
2. Assuming that the universe consists of all people, f(x) means father of x,
D(x) means x is tiny, and w represents Waldo, translate the following
into English.
(a) x(D(x))
(b) D(w)
(c) x(D(f(x)) D(x))
34 CHAPTER 2. PREDICATE CALCULUS
(d) x(D(x))
3. Assuming that the universe is the set of natural numbers, E(x) means x
is even, O(x) means x is odd, and S(x) means x is a multiple of 3,
translate the following into English.
(a) x(E(x) O(x))
(b) x(S(x) O(x))
(c) x(S(x) E(x))
(d) x(O(x)) x(E(x))
4. Assume the universe is all real numbers and L(x, y) means x is less than
y. Match each formula in the rst list with a translation in the second
list.
(a) xyL(x, y)
(b) yxL(x, y)
(c) xyL(x, y)
(d) yxL(x, y)
(e) xyL(x, y)
(f) yxL(x, y)
(g) xyL(x, y)
(h) yxL(x, y)
i. There is a real number that is greater than any real number.
ii. There is a real number that is less than any real number.
iii. Given any real number, we can nd a greater real number.
iv. Given any real number, we can nd a lesser real number.
v. If x and y are reals, then x is less than y.
vi. There are reals x and y such that x is less than y.
5. Formalize: No elbow is an ankle.
6. Assume that the universe is the set of all sh. Using the information
below, formalize each of the given statements.
T(x) means x is a trout
S(x) means x is shiny
J(x) means x jumps
(a) Formalize: All sh are trout.
(b) Formalize: Some trout are shiny.
(c) Formalize: Not all trout jump.
(d) Formalize: No trout jump.
2.3. A BRIEF INTERLUDE: TRUTH 35
7. Formalize: If x is a non-zero real number, then for some y, x y = 1.
8. Formalize the four statements below, assuming that the universe is all
men.
(a) All men are giants.
(b) No men are giants.
(c) Some men are giants.
(d) Some men are not giants.
9. Repeat exercise 8 assuming that the universe is all living things.
10. Formalize the following:
(a) Everyone is respected by someone.
(b) Someone is respected by everyone.
(c) No one is respected by everyone.
(d) Someone is respected by no one.
(e) Everyone should help her neighbors or her neighbors will not help
her.
(f) All parents love their children.
(g) No number is divisible by zero.
2.3 A brief interlude: Truth
What is truth? Nice question; lets ignore it.
When is a formula true? This seems like an easier question. When we were
translating formulas into English, it seemed like it would be easy to assign a
truth value to the translated formulas. This is a good observation. A formula
might be true or false, depending on how we interpret the symbols. Before we
can nail down the notion of truth, we need to talk some more about interpreta-
tions.
Heres another problem. Suppose our universe is the real numbers and the
symbols = and 2 have their usual meaning. Is the formula x(x = 2) true? Its
reasonable to say no. We know that 3 ,= 2, so it is not the case that for all real
numbers x, x = 2. Now consider the formula x(x = 2). Is this formula true?
Its reasonable to say yes, this time. There is a real number x, such that x = 2.
What about the formula x = 2? Is x = 2 true or false? Its reasonable to say
none of the above. The truth value of x = 2 depends on what you plug in for
x. So, we had no problems with truth values for x(x = 2) and x(x = 2), but
x = 2 gives us ts. Truth must have something to do with quantiers. Wed like
a way to tell if a formula is going to cause problems, just by looking at where
the quantiers are.
36 CHAPTER 2. PREDICATE CALCULUS
So now we have two tasks. First, lets look at how quantiers act on for-
mulas. Then well specify exactly what information we need to generate good
translations of formulas. Thats what is in the next two sections. Once we have
the tools we need, well talk about truth.
2.4 Free variables
Usually, when we write quantiers, we put a pair of parentheses afterwards
indicating the part of the formula that the quantier aects. The stu in the
parentheses is called the scope of the quantier. Lets look at some examples.
Example. Indicate the scope of x in the formula:
x(P(x) y(R(x) Q(y))) B(x)
Because of the parentheses, the scope of x in this example stops just before
the :
x(P(x) y(R(x) Q(y))) B(x)
Example. Indicate the scope of y in the formula:
x(P(x) y(R(x) Q(y))) B(x)
This time, we can just match the parentheses following the y quantier.
x(P(x) y(R(x) Q(y))) B(x)
Sometimes, if there are several quantiers, we leave out some parentheses.
If we put the parentheses back in, its easy to nd the scopes.
Example. Indicate the scope of x in the formula:
xy(D(x, y)) B(x)
Again, the B(x) is not within the scope of the x:
xy(D(x, y)) B(x)
Whenever a variable occurs in the scope of a quantier on that variable, we
say that the occurrence of the variable is bound. Any occurrence of a variable
which is not bound is called free. We could also say this as follows. The
quantier x captures all the xs in its scope. (It ignores any ys or other variables,
and it ignores everything thats not in its scope.) Any x that is captured is
bound. Any x that isnt bound is free. The terminology is the same for other
quantier and variable combinations, like y or z.
Example. Underline the free occurrences of variables in the formula:
x(P(x) y(R(x) Q(y))) B(x)
Since P(x) and Q(x) occur in the scope of the rst x and Q(y) is within
the scope of y, only the x in B(x) is free. Thus, our answer is:
x(P(x) y(R(x) Q(y))) B(x)
2.4. FREE VARIABLES 37
Example. Underline the free occurrences of variables in the formula:
xyM(x, y, f(x, z)) G(x, y, z)
The predicate M(x, y, f(x, z)) is included in the scope of quantiers on the
variables x and y. The predicate G(x, y, z) is not in the scope of any quantier.
Underlining the free variables gives us:
xyM(x, y, f(x, z)) G(x, y, z)
One more piece of terminology. A formula with no free variables is called
closed. (Some people call closed formulas sentences.) Using this terminology,
we can see that x(x = 2) is closed, x(x = 2) is closed, and x = 2 is not closed.
Exercises.
1. Underline the free occurrences of variables in the following formulas.
(a) x(P(x, y) z(P(x, z)))
(b) xy(P(x, y) P(y, x) Q(z, z))
(c) y(P(x, y) x(P(x, y)))
(d) Q(z, 0) x(Q(z, x))
(e) P(f(x), x) y(P(f(y), y))
(f) y(P(x, y) x(P(x, z)))
(g) zw(R(x, y, z))
(h) B(x) x(P(x, y))
(i) z(P(z, f(z)) P(z, y))
(j) x(P(x, g(0, x, y)) B(y) y(B(y)))
2. Which of the following formulas are sentences?
(a) xP(x, y)
(b) yxP(x, y)
(c) yxP(0, y)
(d) yxP(z, y)
(e) yP(0, y)
(f) yP(x, 0)
(g) xP(x, 0)
(h) xP(0, y)
38 CHAPTER 2. PREDICATE CALCULUS
2.5 Models
Back in section 2, we were given information that we used to translate formulas
into English. A list of information used in translations is called a model. Our
models must include:
a universe,
interpretations of all predicate symbols,
interpretations of all function symbols, and
interpretations of all constant symbols.
There are a few rules. The interpretations of the predicate symbols must make
sense for everything in the universe. The interpretations of the function symbols
must be functions that are dened for everything in the universe and take values
in the universe. Finally, the constants must be specic elements of the universe.
There is a lot of freedom in dening a model. We can make the predicates,
functions, and constants mean pretty much whatever we like. Notice that we
dont get to redene the quantiers or connectives, though. x always means
for all x, and always means or. Some things never change.
Example. Construct three dierent models where the formula
xy(P(x, y) B(x))
can be interpreted. Give three corresponding translations of the formula.
1. Let the universe be all real numbers, let P(x, y) represent x is greater than
y, and let B(x) represent x is rational. A translation in this model is:
For all real numbers x, there is a corresponding real number y where either
x is greater than y or x is rational.
2. Let the universe be all people, let P(x, y) represent x is ys father, and let
B(x) represent x is deceased. A translation in this model is:
For all people x, there is a corresponding person y where either x is ys
father or x is deceased.
3. Let the universe be cans of soup, let P(x, y) represent x was canned after
y, and let B(x) represent x is too old to eat. A translation in this model
is:
For all cans of soup x, there is a corresponding can y where either x was
canned after y or x is too old to eat.
Example. Construct three dierent models where the formula
xyL(f(x, 0), y)
can be interpreted. Give three corresponding translations of the formula.
2.5. MODELS 39
1. Let the universe be real numbers, f(x, y) denote xy (usual multiplication),
0 denote 0, and L(x, y) denote x > y (usual inequality). A translation in
this model is:
For every real number x, we can nd a real number y such that x 0 > y.
(Note that this statement is true in this model.)
2. Let the universe be 0, 1, 2, 3, (natural numbers), and f(x, y) denote x
y (usual multiplication). Note that for every pair of natural numbers, this
function gives a natural number value. We couldnt have picked something
like xy here. Let 0 denote 0, and L(x, y) denote x > y (usual inequality).
A translation in this model is:
For every natural number x, we can nd a natural number y such that
x 0 > y. (Note that this statement is false in this model.)
3. Let the universe be all people and suppose f(x, y) denotes the youngest
person in the set y, the father of x. Note that for any pair of people
chosen, the function yields a person. Let 0 denote Zeno, and let L(x, y)
denote x was born before y was born. A translation in this model is:
For every person x, we can nd a person y such that the younger of xs
father and Zeno was born before y was born. (This statement is true in
this model, since if xs father is younger than Zeno we can set y to be x,
and otherwise we can let y be Einstein.)
Exercises.
1. Construct three dierent models where the formula
x(S(x) y(C(x, y)))
can be interpreted. Give three corresponding translations of the formula.
2. Construct three dierent models where the formula
xy(x = y x + 1 > y)
can be interpreted. Be sure to indicate meanings for the predicate =, the
predicate >, the function x + y, and the constant symbol 1. Give three
corresponding translations of the formula.
3. Construct three dierent models where the formula
xy(x = y f(x) = y)
can be interpreted. Give three corresponding translations of the formula.
40 CHAPTER 2. PREDICATE CALCULUS
2.6 Truth and Sentences
Recall that a sentence is a formula with no free variables. Generally speaking,
it is easy to determine if a sentence is true provided that we are told what the
various symbols represent. We say that a sentence A is true in the model M,
if the translation of A using the information from M is true. Similarly, we say
that a sentence B is false in the model M, if the translation of B using the
information from M is false.
Remember, the denitions above only work for sentences, so any free vari-
ables could throw a serious kink in things. Also, its good to note that these
denitions always work, so given any sentence A and any model M, either A is
true in M, or A is false in M.
You may feel that these denitions are too informal. Thats reasonable.
Tarskis truth denition is a much more precise way of presenting the same
concept. Good sources for more information on Tarskis denition include [8]
and [11].
Here are some examples.
Example. Let M be the model where the universe is the collection of people,
C(x) means x is a chancellor, and L(x) means x lives on a university campus.
Decide if the following sentences are true in M or false in M.
1. xC(x)
All people are chancellors is false.
2. xL(x)
All people live on university campuses is false.
3. x(C(x) L(x))
There is someone who is both a university chancellor and lives on a
campus is true.
4. x(L(x) C(x))
There is someone who both lives on a campus and is not a chancellor is
true.
5. x(L(x) C(x))
Living on a campus implies one is a chancellor is false.
Alternately, every person who lives on a campus is a chancellor is false.
Example. Let M be the model where the universe is the natural numbers,
C(x) means x is a multiple of 10, and L(x) means x is even. Decide if the
following sentences are true in M or false in M.
1. xC(x)
All natural numbers are multiples of 10 is false, since 9 is not a multiple
of 10.
2.6. TRUTH AND SENTENCES 41
2. xL(x)
All natural numbers are even is false, since 3 is not even.
3. x(C(x) L(x))
There is a natural number that is both even and a multiple of 10 is true.
For example, 20 is such a number.
4. x(L(x) C(x))
There is a natural number that is both even and not a multiple of 10 is
true. For example, 4 is such a number.
5. x(L(x) C(x))
For all natural numbers, being even implies being a multiple of 10 is
false, since 4 is even but not a multiple of 10.
Exercises.
1. Let K be the model where the universe is the natural numbers, G(x, y)
means x is greater than y and h(x) represents the function x+1. Decide if
the following sentences are true in K or false in K. Justify your answers.
(a) xyG(x, y)
(b) xG(h(x), x)
(c) xyG(x, y)
(d) yxG(x, y)
(e) xy(G(x, y) z(G(x, z) G(z, y)))
2. Let K be the model where the universe is the real numbers, G(x, y) means
x is greater than y and h(x) represents the function x + 1. Decide if the
following sentences are true in K or false in K. Justify your answers.
(a) xyG(x, y)
(b) xG(h(x), x)
(c) xyG(x, y)
(d) yxG(x, y)
(e) xy(G(x, y) z(G(x, z) G(z, y)))
3. Find a model M where the sentence xyA(x, y) is true, and the sentence
yxA(x, y) is false.
4. Can you nd a model M where the sentence xyA(x, y) is false, and the
sentence yxA(x, y) is true? Explain.
42 CHAPTER 2. PREDICATE CALCULUS
2.7 Truth and free variables
Our denitions of true and false in models only apply to sentences. Now we
want to extend these denitions to formulas with free variables. Suppose that
A(x) is a formula with the free variable x. Suppose that M is a model.
We say that A(x) is true in M if xA(x) is true in M.
We say that A(x) is satisable in M if xA(x) is true in M.
We say that A(x) is false in M if xA(x) is false in M.
Note that if A(x) is true in M, then A(x) is satisable in M. The con-
verse of this statement is not always true. In cases where our formulas have
more than one free variable, we just tack more quantiers on the front. For
example, A(x, y, z) is true in M if xyzA(x, y, z) is true in M, A(x, y, z) is
satisable in M if xyzA(x, y, z) is true in M, and A(x, y, z) is false in M if
xyzA(x, y, z) is false in M.
Example. Let M be the model where the universe is the real numbers, G(x, y)
means x > y, and h(x) represents the function x + 1. Classify the following
formulas as true in M, false in M, or satisable in M.
1. G(x, x)
This is false in the model, because there does not exist a real number that
is less than itself.
2. G(x, h(x))
This is false in the model, because there does not exist a real number that
is greater than one plus itself.
3. G(0, x)
This is satisable in the model, because 0 is greater than negative two
plus one, so there is a number for which the formula is true. Also, not all
real numbers work, so the formula is satisable but not true.
4. G(h(x), 0)
This is satisable in the model, because one plus one is greater than zero,
so there is a number for which the formula is true. Also, not all real
numbers work, so this formula is satisable but not true.
5. G(x, y)
This is satisable in the model, because we can nd numbers x and y
where x < y. Also, not all real numbers would work, so the formula is
satisable but not true.
2.7. TRUTH AND FREE VARIABLES 43
Example. Let K be the model where the universe is the natural numbers
N = 0, 1, 2, ..., G(x, y) means x > y, and h(x) represents the function x + 1.
Classify the following formulas as true in K, false in K, or satisable in K.
This is the same set of formulas as in the previous example; note how the truth
values are dierent.
1. G(x, x)
False same as part 1 above.
2. G(x, h(x))
False same as part 2 above.
3. G(0, x)
False not the same as part 3 above because we are now looking at the
natural numbers, which do not include the negative numbers.
4. G(h(x), 0)
True not the same as part 4 above because we are now looking at the
natural numbers, which do not include the negative numbers.
5. G(x, y)
Satisable but not true same as part 5 above.
Exercises.
1. Consider the formula P(x, 0). Find a model where this formula is true, a
model where it is satisable but not true, and a model where it is false.
2. Consider the formula xS(x, y). Find a model where this formula is true,
a model where it is satisable but not true, and a model where it is false.
3. Consider the formula yR(x, y). Find a model where this formula is true,
a model where it is satisable but not true, and a model where it is false.
4. Consider the formula x = 2. Find a model where this formula is true,
a model where it is satisable but not true, and a model where it is
false. (Hint: Every model in which this statement can be interpreted
must contain an element which is represented by the constant symbol 2.
Consequently, in a model where the formula is false, the meaning assigned
to the predicate symbol = must be dierent from equality. Some logicians
feel that = is such a special symbol that this sort of redenition should
never be allowed.)
44 CHAPTER 2. PREDICATE CALCULUS
2.8 Logical validity
As we have seen, many formulas are true in some models and false in others.
Heres a reasonable question: Are some formulas true in every model? The
examples considered in the preceding sections tend to indicate that the answer
is no. We have always been able to contrive models where our formulas are
false. However, the examples that we looked at were not a random sample.
Consider the formula:
xA(x) xA(x)
It is true in all models because without specifying the formula interpretations
we can still determine the truth value. The left formula, xA(x), is always going
to be translated as property A is true for all x. The right formula, xA(x), is
always going to be translated as property A is not true for all x which covers
the case that property A is never true as well as the case that property A doesnt
hold in some cases. It is clear that either the left disjunct or the right disjunct
must be true, regardless of the particular interpretations in a given model.
Formulas like the one above are very important. From just the structure of
the formula (syntax), we can draw conclusions about the truth of the formula
(semantics). It would be nice to have some good vocabulary for talking about
these formulas.
We say that a formula is logically valid (or just valid) if it is true in every
model. We say that a formula is contradictory if it is false in every model. Note
that some formulas are neither logically valid nor contradictory.
The notion of a logically valid formula is particularly important for us. Re-
call that tautologies were formulas of propositional calculus which were true no
matter what truth assignments we made to the statement letters. Similarly, log-
ically valid formulas are true no matter which model we consider. The logically
valid formulas play the same role in predicate calculus that the tautologies play
in propositional calculus. We have found the parallel to tautologies that was
promised at the beginning of the chapter.
In one way, tautologies and logically valid formulas are very dierent. To
show that a formula is a tautology, all we need to do is construct the truth table.
To show that a formula is logically valid, we must show that it is true in every
possible model, regardless of the choice of the universe or however bizarre the
interpretations of the predicates might be. This sounds like a challenging job.
Here are two more denitions that will help us experiment with logically
valid formulas. We say that a formula A logically implies a formula B if the
formula A B is logically valid. We say that a formula A is logically equivalent
to a formula B if the formula A B is logically valid.
Using the preceding denitions, we can show that if A logically implies B
and B logically implies A, then A and B are logically equivalent. Suppose that
A logically implies B and B logically implies A. Then the formulas A B and
B A are logically valid. Pick any model M. Because they are logically valid
formulas, both A B and B A must be true in M. On the basis of the
truth table for A B, it follows that A B is true in M. This reasoning
2.9. FORMULAS THAT ARENT LOGICALLY VALID 45
holds for any model M we might select, so A B is true in every model. By
the denition of logical equivalence, this shows that A is logically equivalent to
B.
Exercises.
1. Give an example of a logically valid formula.
2. Give an example of two logically equivalent formulas.
3. Give an example of formulas A and B such that A logically implies B, but
B does not logically imply A.
2.9 Formulas that arent logically valid
As noted in the previous section, to show that a formula is logically valid, we
must show that it is true in every possible model. Consequently, to show that
a formula is not logically valid, all we need to do is construct one model where
the formula is not true. We already know how to build models, so this task is
not so dicult.
Before doing some examples, we should compare this to our experience with
propositional logic. Note that constructing a model to show that a formula is
not logically valid corresponds roughly to nding one line in a truth table that
shows that a propositional formula is not a tautology. Thus the model building
in the following examples is like the line building we did in Chapter 1.
Example. Show that x(A(x) B(x)) is not logically valid.
Consider the universe of natural numbers, and let A(x) mean x is odd and
B(x) mean x is an integer multiple of 10. All natural numbers are either odd or
an integer multiple of 10 is false. For example, 4 is neither odd nor an integer
multiple of 10. We have found a model in which the sentence is false, so the
sentence is not logically valid.
Example. Show that xyC(x, y) does not logically imply yxC(x, y).
We will need to construct a model where xyA(x, y) is true, but yxA(x, y)
is false. Here is an entertaining graphical technique for building nite models.
Let the universe be 0, 1. Draw an arrow from from 0 to 1 and a second arrow
from 1 to 0. Let A(x, y) mean that there is an arrow fromx to y. For every choice
of x, there is an arrow that starts at x, so xyA(x, y) is true in this model.
On the other hand, A(0, 0) and A(1, 1) are both false, so yxA(x, y) is false.
46 CHAPTER 2. PREDICATE CALCULUS
Exercises.
1. Show that x(A(x) B(x)) is not logically valid.
2. Show that xyC(x, y) is not logically valid.
3. Show that x(A(x) B(x)) does not logically imply (xA(x)) (xB(x)).
4. Show that xyC(x, y) does not logically imply zC(z, z).
5. Show that (xA(x)) (xB(x)) is not logically equivalent to x(A(x)
B(x)).
6. Show that the formula
xy((C(x, y) C(y, x)) (C(x, x) C(y, y)))
is not logically valid. (Warning: This one is tough.)
2.10 Some logically valid formulas
In the previous section, we found a method for showing that a formula is not
logically valid. Our model theoretic method works on any formula, provided
that its not logically valid. This is not very satisfying. What we would really
like is a method for showing that a formula is logically valid. Eventually, we
will develop a technique for doing just that. In the mean time, it would be nice
to have a method for showing that some formulas are logically valid. In this
section, we will list (an innite number of) logically valid formulas.
We say that a formula is an instance of a tautology if it is the result of
uniformly replacing the statement letters in a propositional tautology with for-
mulas of predicate calculus. Note that determining whether or not a formula is
an instance of a tautology depends only on its structure. We only consider the
shape of the formula, ignoring meaning and models.
The formula p p is a tautology, so anything with this pattern is. Here are
two instances of tautologies based upon this pattern:
xyQ(x, y) xyQ(x, y)
A(x) A(x)
Similarly, A (B A) is a tautology, so
xyC(x, y) (xA(x) xyC(x, y))
is an instance of a tautology.
Here is the fact that makes instances of tautologies interesting. Every in-
stance of a tautology is logically valid. Since we can easily construct instances
of tautologies, we can easily list lots of logically valid formulas. Weve already
seen three:
xyQ(x, y) xyQ(x, y)
2.10. SOME LOGICALLY VALID FORMULAS 47
A(x) A(x)
xyC(x, y) (xA(x) xyC(x, y))
Note that the formula A(x) A(x) has a free variable. Since we know it
is logically valid, we know it is true in every model. Now A(x) A(x) is true
in a model M exactly when x(A(x) A(x)) is true in M. Formulas that are
true in every model are logically valid, so x(A(x) A(x)) is logically valid.
The reasoning of the preceding paragraph works for any formula and any
variable. If we know that P is a logically valid formula, then so are the formulas
xP, yP, xyP, and so on. We can use this rule to build logically valid
formulas that are not instances of tautologies. For example, A(x) A(x) is an
instance of a tautology, x(A(x) A(x)) is not an instance of a tautology, but
both are logically valid.
Heres another way to build more logically valid formulas. If a formula P
is true in a model M, then it is satisable in M. Since P is satisable in M,
the formula xP is true in M. Consequently, if P is logically valid, then so is
xP. As with adding universal quantiers, this works for any formula P and
any variable x. We can combine this with our previous work to build more
complicated logically valid formulas. For example, xy(C(x, y) C(x, y))
is logically valid, but not an instance of a tautology.
Summarizing, any instance of a tautology is logically valid. Any formula got-
ten by stringing quantiers in front of a logically valid formula is logically valid.
Not every logically valid formula is an instance of a tautology. Indeed there are
logically valid formulas that simply cannot be built using the techniques of this
section.
Exercises.
1. Each of the following formulas is logically valid. Mark those that are
instances of tautologies.
(a) A(x) (yB(y) A(x))
(b) x(A(x) (yB(y) A(x)))
(c) A(x) (B(y) B(y))
(d) x(A(x)) (B(y) B(y))
(e) x(A(x) (B(y) B(y)))
(f) yx(A(x) (B(y) B(y)))
2. Each of the following formulas is logically valid. Mark those that are
instances of tautologies.
(a) C(x, y) C(x, y)
(b) xy(C(x, y) C(x, y))
(c) xyC(x, y) xyC(x, y)
(d) xyC(x, y) xyC(x, y)
48 CHAPTER 2. PREDICATE CALCULUS
(e) A(x) A(x)
(f) x(A(x) A(x))
2.11 Free for...
Here is a summary of what we can do so far. If someone says, Here is a
formula which is not logically valid; show that this is the case, then we build a
model where the formula isnt true. If someone says, Here is a formula which
is logically valid; show that this is the case, then we check if the formula is an
instance of a tautology. If it isnt, we try to build the formula by tacking some
quantiers onto an instance of a tautology. If this works, were done. Otherwise,
were stuck.
We would like some guaranteed method of showing that a formula is logically
valid. We know that logically valid formulas are predicate calculus analogs of
tautologies. We can show that a formula is a tautology by checking the truth
table or writing a proof in L. If we had a proof system for predicate calculus,
we could show that a formula is logically valid just by writing a proof.
In order for this scheme to work, our proof system for predicate calculus must
have two properties. First, every formula that is provable must be logically valid.
In other words, our proof system must be sound. This ensures that we dont
get wrong answers. Secondly, every logically valid formula must be provable in
the system. In other words, our proof system must be complete. This ensures
that we can always get an answer.
In order to even state the axioms we need, we will need to elaborate on our
notions of free and bound variables. We need a more sophisticated notion of
when a variable is free. In particular, we need to know when we can substitute
one variable (or term) for another variable.
Recall that in section 2.4, we said that an occurrence of a variable is free if
it is not in the scope of a quantier on that variable. An occurrence which isnt
free is called bound. Also, recall that a term is part of a formula which refers
to an object in a model. That is, a term may be a variable, a constant, or the
result of applying a function to terms.
Heres the question that we want to answer: When is it O.K. to plug in a
given term for a particular variable in a given formula? What sort of situations
might cause problems? Consider the formula xP(x, y). Note that y is a free
variable in this formula, while x is not. We cannot substitute something for x,
since the quantier indicates that the formula must be true for all x. But,
since y is free, we have exibility and should be able to substitute a term in for
y.
Here are some examples of substitutions.
xP(x, z) another variable is allowed. As with any mathematical vari-
able, the particular name is unimportant.
xP(x, f(c, z, w)) a function of several constants and variables is also
allowed. Think of it as an analogy to a composition of functions.
2.11. FREE FOR... 49
xP(x, x) This substitution is not as general as the last. Substituting x
in for y changes the meaning of this formula since we now have bound a
variable that was previously free.
xP(x, h(x)) As with the last substitution, this one binds a variable
that was previously free.
When working with formulas in predicate calculus, we will not allow substi-
tutions like the last two. The rst two are ne. We can nail this concept down
with a single denition. Its a little technical, but thats what makes it precise
and useful.
Denition. A term t is free for a variable x in the formula P if x does not
occur free within the scope of a quantier on a variable in t.
We can approximate this denition as follows. Its ne to plug in a term for
a free variable if none of the variables in the term are accidentally captured by
quantiers.
Example. Consider the terms x, y, f(x, y), and 3. Determine which of these
terms are free for x in each formula below.
1. y(A(x, y) B(z))
(a) x is free for x in y(A(x, y) B(z)); x is always free for itself.
(b) y is not free for x in y(A(x, y) B(z)); it would be in the scope of
the y.
(c) f(x, y) is not free for x in y(A(x, y)B(z)); it would be in the scope
of the y.
(d) 3 is free for x in y(A(x, y) B(z)); constants can never be captured
by quantiers.
2. A(x) z(C(z, z) A(z, y))
Terms:
(a) x is free for x in A(x) z(C(z, z) A(z, y)); A(x) is not in the scope
of any quantiers and x is always free for x in any formula anyway.
(b) y is free for x in A(x) z(C(z, z) A(z, y)); A(x) is not in the scope
of any quantiers.
(c) f(x, y) is free for x in A(x) z(C(z, z) A(z, y)); A(x) is not in the
scope of any quantiers.
(d) 3 is free for x in A(x) z(C(z, z) A(z, y)); A(x) is not in the scope
of any quantiers, and constants can never be captured by quantiers
anyway.
3. B(y) y(A(x, z) xC(x, y))
50 CHAPTER 2. PREDICATE CALCULUS
Terms:
(a) x is free for x in the formula B(y) y(A(x, z) xC(x, y)); the
only free occurrence of x is in the A(x, z) predicate, and x is always
free for x.
(b) y is not free for x in the formula B(y) y(A(x, z) xC(x, y)); x
occurs free in the A(x, z) predicate, and y will be captured by the y
quantier.
(c) f(x, y) is not free for x in the formula B(y) y(A(x, z)xC(x, y));
x occurs free in the A(x, z) predicate, and the y in f(x, y) will be
captured by the y quantier.
(d) 3 is free for x in the formula B(y) y(A(x, z) xC(x, y)); con-
stants can never be captured
4. d) xyD(x, y, z)
Terms: There are no free occurrences of x to plug in for in this formula.
Consequently, every term is free for x in xyD(x, y, z). This is a weird
case, but the idea is not too hard. If there is no place to plug in, then you
can plug in anything safely.
(a) x is free for x in xyD(x, y, z).
(b) y is free for x in xyD(x, y, z).
(c) f(x, y) is free for x in xyD(x, y, z).
(d) 3 is free for x in xyD(x, y, z).
Heres a summary of all the work done above. In the table below, an OK appears
if the term is free for x in the formula. If not, then an X appears.
x y f(x,y) 3
y(A(x, y) B(z)) OK X X OK
A(x) z(C(z, z) A(z, y)) OK OK OK OK
B(y) y(A(x, z) xC(x, y)) OK X X OK
xyD(x, y, z) OK OK OK OK
Lets summarize some shortcuts. We can plug x in for x in any formula,
and not worry. We can plug a constant symbol in for x in any formula, and not
worry. Note that we only ever plug terms into free occurrences of variables. We
never plug terms of any sort into bounded occurrences of variables.
Exercises.
1. Use the following lists of formulas and terms to solve the exercises below.
Formulas: Terms
1. y(A(x, y) B(z)) (a) x
2. A(x) z(C(z, z) A(z, y)) (b) y
3. B(y) z(A(x, z) xC(x, y)) (c) f(x, y)
4. xyD(x, y, z) (d) 3
2.12. A PROOF SYSTEM FOR PREDICATE CALCULUS 51
(a) Determine which of the terms are free for y in each formula.
(b) Determine which of the terms are free for z in each formula.
2. Use the following lists of formulas and terms to solve the exercises below.
Formulas: Terms
1. xA(x, y, z) (a) x
2. yB(x, y) zC(z, y) (b) y
3. y(B(x, y) zC(z, y)) (c) h(z, 3)
4. yz(B(x, y) C(z, y)) (d) g(x, y, z)
(a) Determine which of the terms are free for x in each formula.
(b) Determine which of the terms are free for y in each formula.
(c) Determine which of the terms are free for z in each formula.
2.12 A proof system for predicate calculus
Now were ready to dene our proof system for predicate calculus. Our proofs
will consist of sequences of formulas of the sort weve been using, with justi-
cations for each line. We need to specify the axioms, the rules of inference, and
any abbreviations that we want to use. Since our new axiom system looks a
little like L, well call it K.
Axioms
Any formulas of predicate calculus may be substituted for A, B, and C in the
following schemes. Also, other variables may be substituted for the use of x in
Axiom 4 and Axiom 5.
Axiom 1: A (B A)
Axiom 2: (A (B C)) ((A B) (A C))
Axiom 3: (B A) ((B A) B)
Axiom 4: (xA(x)) A(t), provided that t is free for x in A(x).
Axiom 5: x(A B) (A xB), provided that x does not occur free
in A.
Rules of inference
Modus Ponens (MP): From A and A B, deduce B.
Generalization (GEN): From A, deduce xA.
52 CHAPTER 2. PREDICATE CALCULUS
Abbreviations and Notation
We will use xA to abbreviate xA. The connectives , , and are
rewritten using the equivalent and formulations. We will write A if there
is a proof of A in the proof system K.
Before we go any further, we should construct enough instances of axioms
that we get a good feel for what axioms are available.
Axiom 1: A(x) (xA(x) A(x))
Axiom 1: xA(x) (xA(x) xA(x))
Axiom 1: (xA(x) yC(y)) ((xB(x) (xA(x) yC(y)))
Axiom 2:(A(x) (yC(y) zW(z)))
((A(x) yC(y)) (A(x) zW(z)))
Axiom 3: (xC(x) A(x)) ((xC(x) A(x)) xC(x))
Axiom 4: xyB(x, y, z) yB(x, y, z)
Axiom 4: xyB(x, y, z) yB(t, y, z)
Axiom 5: x(yB(y) yC(x, y)) (yB(y) xyC(x, y))
Be careful with Axioms 4 and 5. Its vital to pay attention to the extra
conditions on free occurrences of x. Here are two examples of common mis-
takes. First, the formula xyB(x, y, z) yB(y, y, z) is not a correct instance
of Axiom 4 because the variable y is not free for x in yB(x, y, z). Second,
the formula x(yA(x, y) B(x)) (yA(x, y) xB(x)) is not a correct
instance of Axiom 5 because x occurs free in yA(x, y).
Proofs in K look a lot like proofs in L. Here is an example of a short proof.
Theorem K 1. x(A(x) (B(x) A(x))).
1. A(x) (B(x) A(x)) Axiom 1
2. x(A(x) (B(x) A(x))) GEN, line 1
Before we do any more proofs, lets remember why we were interested in a
proof system. We wanted a good way to show that formulas were logically valid.
The following two very important theorems say that this is the proof system
that we want.
Theorem. [Completeness Theorem for Predicate Calculus] (Godel 1930) If A
is logically valid, then A.
Theorem. [Soundness Theorem for Predicate Calculus] (Godel 1930) If A,
then A is logically valid.
2.12. A PROOF SYSTEM FOR PREDICATE CALCULUS 53
Summarizing, we can prove a formula A if and only if it is logically valid.
The relationship between K and the logically valid formulas is exactly the same
as the relationship between L and the tautologies.
The proof of the soundness theorem for K is very much like the proof of
the soundness theorem for L. One shows that all the axioms are logically valid
and that applying MP and GEN to logically valid formulas always yields more
logically valid formulas. Then given a proof in K, we can step through line by
line, showing that each line in turn is logically valid. In particular, the last line
is logically valid, so if a formula can be proved in K, then it is logically valid.
The proof of the completeness theorem for K is completely dierent from the
proof of the completeness theorem for L. Rather than proving the result directly,
it is best to prove the contrapositive. Consequently, we would assume that there
is no proof of A in K, and then show that A is not logically valid by constructing
a model where A is true. Many proofs of the completeness theorem (e.g. [2],
[6], [8], and [4]) dier primarily on the method of this construction. The method
employed by Henkin [4] actually uses a set of terms as the universe for the model.
This is a delightfully twisted idea.
In our discussion of the completeness theorem for L, we noted that it is
possible to write a computer program that accepts formulas of L as input,
determines whether or not they are tautologies, and then outputs either a row
of the truth table showing that the formula is not a tautology or a proof in
L of the formula. This is not the case for K. Indeed, there is no computer
program that can accept formulas of K as input and determine whether or not
they are logically valid. This situation is not due to a lack of talent on the
part of programmers. There is a proof that predicate calculus is undecidable,
that is no decision program can be created [10]. While there is no program for
deciding which formulas are logically valid, we do have a method for supporting
our conclusions. Given a logically valid formula we can nd a proof of it in K,
and given a formula that isnt logically valid we can nd a model in which it is
not true.
Exercises.
1. Build two instances for each of the axioms, showing the substitution made
in each case.
2. Are the following instances of one of the axioms? If so, show the substi-
tution made.
(a) xyA(x, y) (xB(x) yA(x, y)).
(b) xyA(x, y) yA(y, y).
(c) xyA(x, y) yA(x, y).
(d) xB(x) ((xyC(x, y) A(x)) xB(x)).
In order to make ecient use of our new proof system, K, we could use some
shortcuts. When we learned to write proofs in L, progress was painful until
54 CHAPTER 2. PREDICATE CALCULUS
we learned the Deduction Theorem for L. One of the shortcuts we will learn
is a Deduction Theorem for Predicate Calculus. The next four sections consist
entirely of shortcuts and proof strategies for our new proof system.
2.13 Dealing with
Here is a strategy for manipulating universal quantiers. To add x to the
beginning of a formula, use GEN. To rip x o the front of a formula, use
Axiom 4. Here is an easy proof that illustrates both halves of the strategy.
Theorem K 2. xyA(x, y) yxA(x, y).
1. xyA(x, y) Given
2. xyA(x, y) yA(x, y) Axiom 4
3. yA(x, y) MP, lines 1. and 2.
4. yA(x, y) A(x, y) Axiom 4
5. A(x, y) MP, lines 3. and 4.
6. xA(x, y) GEN, line 5.
7. yxA(x, y) GEN, line 6.
Be careful! Our strategy only works on leading quantiers whose scope is
the whole formula. Other situations require gyrations of a dierent sort. The
next shortcut will make these gyrations easier.
2.14 Rule T
Since Axiom 1, Axiom 2, Axiom 3 and MP are all included in K, every proof
in L is also a proof in K. The following rule lets us use all the results we could
have proved in L, even if we didnt actually do the proof.
RULE T: Any instance of a tautology may be inserted as a line in a predicate
calculus proof.
Theorem K 3. A(x) B(x) A(x).
1. A(x) B(x) Given
2. (A(x) B(x)) A(x) Rule T
3. A(x) MP, lines 1. and 2.
2.15. THE DEDUCTION THEOREM 55
Any time we introduce a shortcut rule, we need to consider one question.
Can every proof done using the shortcut be done without using it? If the answer
to the question is no, then proofs done via the shortcut may not be sound. For
Rule T, the answer to the question is yes. Actually, any line invoking Rule T
can be replaced by a proof using only Axiom 1, Axiom 2, Axiom 3, and MP.
This follows immediately from the completeness theorem for L. Roughly, since
every tautology can be proved in L, every formula that looks like a tautology
(i.e. every instance of a tautology) can be proved using axioms that look like
axioms of L (i.e. Axioms 1 through 3.)
The previous paragraph indicates why Rule T is such a powerful shortcut.
When we use Rule T, we are making full use of our understanding of L, including
the Completeness Theorem for L. On the other hand, misapplications of Rule
T are very undesirable. Rule T only allows insertion of instances of tautologies.
It does not allow us to insert other logically valid formulas. This is a very good
time to review section 2.10 and make sure that you understand exactly what
constitutes an instance of a tautology.
2.15 The Deduction Theorem
One of our nicest shortcuts in L was the deduction theorem. We can state (and
use) a deduction theorem for predicate calculus, too. Well state the theorem,
give two quick applications, and then discuss its proof a little.
Theorem (Deduction Theorem for K). If there is a proof of A B with no
applications of generalization to any variables that occur free in A, then there
is a proof of A B.
Theorem K 4. xyA(x, y) yxA(x, y)
We have already proved K2: xyA(x, y) yxA(x, y). The proof, which
appears on page 54, contains no applications of GEN to a variable appearing
free in xyA(x, y). Actually, you dont need to look at the proof, since there
are no free variables in xyA(x, y). Theorem K4 follows by one application of
the deduction theorem for K.
Theorem K 5. x(A(x) B(x)) xA(x)
This time, we will formally prove x(A(x)B(x)) xA(x), and then apply
the deduction theorem.
1. x(A(x) B(x)) Given
2. x(A(x) B(x)) (A(x) B(x)) Axiom 4
3. A(x) B(x) MP, lines 1 and 2
4. (A(x) B(x)) A(x) Rule T
5. A(x) MP, lines 3 and 4
56 CHAPTER 2. PREDICATE CALCULUS
6. xA(x) GEN, line 5
The only use of GEN in this proof is on the variable x, which does not occur
free in the hypothesis. Thus, we can apply the deduction theorem to obtain
x(A(x) B(x)) xA(x), as desired.
In the preceding proof, we actually used the following restricted version of
the deduction theorem:
Corollary. If A B and A has no free variables, then A B.
The restriction on applications of generalization to variables not occurring
free in the hypothesis is a vital part of the statement of the deduction theorem.
Without it, our proofs would not be sound. For example, consider the following
correct proof of x = y x = 0.
1. x = y Given
2. y(x = y) GEN, line 1
3. y(x = y) x = 0 Axiom 4
4. x = 0 MP, lines 2 and 3
Note that the application of GEN in line 2 to the variable x, which occurs free
in x = y, precludes us from applying the deduction theorem. This is a good
thing, because if we incorrectly applied the deduction theorem, we could deduce
x = y x = 0, which could be generalized to xy(x = y x = 0). This
formula is not logically valid, since in the model with the natural numbers as
its universe and the usual interpretation of = and 0, the implication 1 = 1
1 = 0 is false. Just one misapplication of the deduction theorem destroys the
soundness of our proof system. Always check for uses of GEN before applying
the deduction theorem.
Can every proof done using the deduction theorem be done without using
the deduction theorem? Sure! Thats essentially what the deduction theorem
says. At this point, we have enough tools to do a lot of proofs without too much
eort.
Exercises.
Prove the following in K. You may use any theorem with a lower number in
your proof.
Theorem K 6. (xA(x)) x(A(x) B(x))
Theorem K 7. x(A(x) B(x)) (xA(x) xB(x))
2.16. ADDING X 57
Theorem K 8. xB(x) x(A(x) B(x))
Theorem K 9. xyA(x, y) yxA(y, x)
Theorem K 10. x(A(x) B(x)) (xA(x) xB(x))
2.16 Adding x
If we have xA(x), we ought to be able to prove xA(x). In order to do this,
we need to be able to add x to a formula. Heres an example of how to do this
using the shortcuts we have so far.
Theorem K 11. A(x) xA(x)
1. A(x) Given
2. xA(x) A(x) Axiom 4
3. (xA(x) A(x)) (A(x) xA(x)) Rule T
4. A(x) xA(x) MP, lines 2 and 3
5. xA(x) MP, lines 1 and 4
6. xA(x) Abbreviation of line 5
We can extract the content of the proof of Theorem K11, and create an
Add-x Rule that handles even more cases. We need to be careful that the
hidden use of Axiom 4 is acceptable. In the following, the clauses requiring that
A(t) is the result of replacing every free occurrence of x in A(x) with t and t is
free for x in A(x) insure that xA(x) A(t) is a correct instance of Axiom
4. This allows us to modify the proof of K11 to obtain a proof of xA(x) from
A(t). Stating the rule will save us from having to mess with contrapositives
every time we want to tack on an existential quantier.
Add x Rule: If A(t) is the result of replacing every free occurrence of x in A(x)
with t, and t is free for x in A(x), then from A(t) we may deduce xA(x).
In short, if xA(x) A(t) is a correct instance of Axiom 4, then from
A(t) we may deduce xA(x).
Here is an application of the Add x Rule that makes use of the ability to
substitute for a term. In the following, A(y, y) is the result of replacing every
free occurrence of x in A(x, y) with y, and y is free for x in A(x, y). Thus the
Add x Rule allows us to deduce xA(x, y) from A(y, y).
Theorem K 12. A(y, y) yxA(x, y)
58 CHAPTER 2. PREDICATE CALCULUS
1. A(y, y) Given
2. xA(x, y) Add x Rule, line 1
3. yxA(x, y) GEN, line 2
Exercises.
1. Prove:
Theorem K 13. xA(x) xA(x)
2. Consider the theorem:
Theorem K 14. yA(y) xA(x)
(a) Prove K14 using the deduction theorem, Axiom 4 and K13.
(b) Prove K14 using the Add x Rule.
3. Prove:
Theorem K 15. x(A(x) B(x)) (xA(x) xB(x))
4. Prove the following theorems. Like the proof of Theorem K11, these re-
sults use the fact that xA(x) is an abbreviation for xA(x). Math-
ematicians use results like these whenever they push negations past a
quantier.
(a)
Theorem K 16. xA(x) xA(x)
(b)
Theorem K 17. xA(x) xA(x)
(c)
Theorem K 18. xA(x) xA(x)
(d)
Theorem K 19. xA(x) xA(x)
2.17 Removing x
So far, we have strategies for adding and removing x, and a rule for adding
x. To complete our survey of techniques for manipulating quantiers, we need
a rule for removing x.
Informally, if we have xA(x), we should be able to nd some element to
plug in for x. If we give that element a temporary name, we could proceed
with our proof. The best thing to use as a name is a constant symbol. If we
2.17. REMOVING X 59
use a constant symbol that already appears in the proof (or appears in some
weird axioms that we plan to use later), we will be implicitly making additional
assumptions about the element. Consequently, we want to use a new constant
symbol. Heres the rule, presented more formally.
Rule C: If xA(x) is a previous line in a proof, we may write A(c) as a line,
provided that the following two conditions hold.
1. c is a new constant symbol. (That is c doesnt show up in any earlier
lines of the proof, of in any proper axioms we ever plan to use.)
2. If some variable (say y) appears free in the formula xA(x), then
GEN is never applied to y in the proof.
Here is an example of using Rule C in a proof.
Theorem K 20. x(A(x) B(x)) xA(x)
1. x(A(x) B(x)) Given
2. A(c) B(c) Rule C, line 1
3. (A(c) B(c)) A(c) Rule T
4. A(c) MP, lines 2 and 3
5. xA(x) Add x Rule, line 4
Why do we need the second condition in Rule C? We need to worry about
GEN and Rule C for the same reason that we worry about GEN and the De-
duction Theorem. If we do a proof with Rule C and break the second condition,
our conclusion may not be sound. For example, consider the following incorrect
proof of xy(x = y) from y(y = y).
1. y(y = y) Given
2. y(y = y) y = y Axiom 4
3. y = y MP, lines 1 and 2
4. x(x = y) Add x Rule, line 3
5. c = y Rule C, line 4
6. y(c = y) Illegal use of GEN
7. xy(x = y) Add x Rule, line 6
In line 4, y = y is the result of substituting y for every free occurrence of x
in x = y, and y is free for x in x = y, so this line is a legal application of the
Add x Rule. Indeed, this is just like the second line in the proof of K12 with
x = y substituted for A(x, y). We pull the substitution trick with the Add x
60 CHAPTER 2. PREDICATE CALCULUS
Rule again in line 7. It is legal there, too. The only illegal step is in line 6,
where we apply GEN to a variable that appears free in line 4, the formula to
which we applied Rule C. That violates the second condition of Rule C, and it
is a very bad idea. There is a model where y(y = y) is true, but xy(x = y)
is false, so y(y = y) does not logically imply xy(x = y). The illegal use of
GEN with Rule C has destroyed the soundness of our proof system.
Weve seen the bad eects of violating the conditions of Rule C. However,
if we can prove A using Rule C correctly, then we can prove A without using
Rule C. Consequently, correct uses of the shortcut Rule C do not mess up the
completeness and soundness theorems for our proof system. One way to prove
this is to construct an algorithm that converts proofs that use the shortcut
to proofs that do not. This sort of argument closely resembles a proof of the
deduction theorem, and is used in [8].
Exercises.
Use Rule C to prove the following:
Theorem K 21. xA(x) x(A(x) B(x))
Theorem K 22. xyA(x, y) yxA(x, y)
Theorem K 23. x(A(x) B(x)) (xA(x) xB(x))
Theorem K 24. xB(x) x(A(x) B(x))
Theorem K 25. xA(x) x(A(x) B(x)) (Hint: Use K19)
Theorem K 26. (xA(x) xB(x)) x(A(x) B(x)) (Hint: Use
K24 and K25, rather than Rule C.)
2.18 Proof strategies in predicate calculus
Predicate calculus looks a lot like propositional calculus, except for the addition
of quantiers. We have some excellent tools for dealing with quantiers. To
add x we use GEN, and to add x we use the aptly named Add x Rule. To
remove x we use Axiom 4, and to remove x we use Rule C. A very rough
overall strategy for doing proofs in predicate calculus is:
2.18. PROOF STRATEGIES IN PREDICATE CALCULUS 61
Rip o the quantiers.
Use Rule T (or whatever) to mess with the guts of the formula.
Glue the quantiers back on.
Of course, we also can use techniques from propositional calculus like apply-
ing the deduction theorem or proving the contrapositive as a lemma. Here are
some problems that use a variety of methods.
Exercises.
Theorem K 27. xA(x, x) xyA(x, y)
Theorem K 28. yx(A(y, x) A(y, y))
Theorem K 29. x(A(x) B(x)) (xA(x) xB(x))
Theorem K 30. (xA(x) xB(x)) x(A(x) B(x)).
Theorem K 31. x(A(x) B(x)) (xA(x) xB(x))
Theorem K 32. (xA(x) xB(x)) x(A(x) B(x))
Theorem K 33. (xA(x) xB(x)) x(A(x) B(x))
Theorem K 34. x(A(x) B(x)) (xA(x) xB(x))
Theorem K 35. (xA(x) xB(x)) x(A(x) B(x))
Theorem K 36. (xA(x) xB(x)) x(A(x) B(x))
Hints: You may nd the following strategies useful for the preceding exercises.
K27: Deduction theorem.
62 CHAPTER 2. PREDICATE CALCULUS
K28: Rule T, followed by Add x Rule.
K29: P Q abbreviates P Q.
K30: Prove the contrapositive.
K31: Deduction theorem and Rule C.
K32: Deduction theorem and Rule C.
K33: Prove the contrapositive.
K34: Deduction theorem.
K35: Deduction theorem.
K36: Prove the contrapositive.
Chapter 3
Transition to Informal
Proofs
We just spent the whole last chapter talking about predicate calculus. Two of
the important theorems we discussed were the Completeness Theorem and the
Soundness Theorem. These two theorems can be summarized as follows: The
formulas that are provable in predicate calculus are exactly the logically valid
formulas.
These results indicate both the main weakness and the main strength of
predicate calculus. On the one hand, the only formulas we can prove are the
logically valid formulas, which will always be true in every model. However, most
of the interesting formulas in mathematics state properties that are peculiar to
the integers, or the reals, or to some other entertaining specic model. For
example,
x(P(x) P(x))
is true in absolutely every model, but
x((P(x) B(x)) O(x))
is not logically valid. However, consider the following model:
Universe := natural numbers
P(x) := x is prime
B(x) := x is bigger than 2
O(x) := x is odd
In this model (a particular model), the second statement above translates to:
All prime natural numbers bigger than 2 are odd. This is a true statement, but
since it is not logically valid, we need new axioms in order to prove it.
63
64 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
Now we want to address a new question: What additional axioms do math-
ematicians use? In a sense, we are asking about what sort of objects mathe-
maticians work on, and what properties of these objects they use to describe
them. By considering important properties, we are avoiding some pithy philo-
sophical questions, and asking some more pragmatic questions. For example,
rather than asking What is a natural number?, we will ask What important
properties of natural numbers are useful in mathematical proofs? The philo-
sophical questions are very interesting, but, after all, our goal is to write better
proofs.
If we actually knew all along that predicate calculus could not prove mathe-
matically interesting statements and that we would eventually tack on bunches
of new axioms, why did we spend a whole chapter on predicate calculus? Re-
member that any formula provable in predicate calculus is provable in any theory
with added axioms. Thus, the theorems of predicate calculus are the common
core of rst order mathematical theories. Also, the shortcut methods we used
dont exclude the use of additional axioms, so the proof techniques we learned
in the last chapter will apply to all sorts of interesting mathematical proofs.
Predicate calculus is a sort of scaold on which we can hang any axiom systems
that interest us.
Any theory that consists of the axioms of K together with additional (often
called non-logical) axioms using predicates and variables from K is called a rst
order theory. In the next two sections, we will take a look at rst order theories
describing the nature of equality and the natural numbers.
3.1 The Theory of Equality
Here is a simple example of a rst order theory. The goal is to describe our
understanding of what equality means. Suppose that we use the symbol x = y
to represent some binary predicate (like A(x, y)). Let E denote the axioms of
predicate calculus (K) together with the following axioms (numbered to avoid
confusion with Axioms 1 through 5 in k):
Axiom 6 (Reexivity of equality) x(x = x)
Axiom 7 (Substitutivity of equality) For every formula A(x, y), with free vari-
able x, if y is free for x in A(x, x) then
x = y (A(x, x) A(x, y)).
If we can prove a formula B in predicate calculus using the additional axioms 6
and 7, we will write
E
B. In this case, we say that B is a theorem of E, and
that E proves B. Its interesting to note that these two axioms actually do a
pretty good job of describing the way that equality acts. In particular, Axiom
7 captures the sort of substitution steps that are commonly used in elementary
algebra. In this sense, a lot of elementary algebra has more to do with the
equality predicate than with functions or numbers. Here are several instances
of Axiom 7.
3.1. THE THEORY OF EQUALITY 65
x = y (P(x, x, z) P(x, y, z))
y = z (R(y) R(z))
y = z (x = y x = z)
x = y (x = x y = x)
x = 2 (x y = 6 2 y = 6)
x = y (x + 2 = x + 2 x + 2 = y + 2)
Note that Axiom 7 cant be used on quantied variables, so the following
statement is not an instance of Axiom 7: x = y (xP(x, x, z) xP(x, y, z)).
Remember that all the axioms of L and K are axioms of E. Consequently, all of
the theorems we proved using L and K are theorems of E. Now it is time to try
our hand at a proof that uses the new axioms.
Theorem E 1.
E
xy(x = y y = x) (Mathematicians would paraphrase
this by saying equality is symmetric.)
Proof:
1. x = y (x = x y = x) Axiom 7
2. x = x (x = y y = x) L7, line 1
3. x(x = x) Axiom 6
4. x(x = x) x = x Axiom 4
5. x = x MP, lines 3 and 4
6. x = y y = x MP, lines 2 and 5
7. y(x = y y = x) GEN, line 6
8. xy(x = y y = x) GEN, line 7
Exercises.
Prove the following in E.
Theorem E 2.
E
x = y (y = z x = z) (This is often called the transitive
law of equality.)
Theorem E 3.
E
(x = y x = z) y = z (This is an axiom of Euclid:
things equal to the same thing are equal to each other.)
Theorem E 4.
E
x = y z(f(z, x) = f(z, y))
Note that Theorem E4 holds regardless of the choice of f(x, z). For example,
we could replace f(x, z) by x + z, x z, x z, x
z
, z
x
, or any other two place
function.
66 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
3.2 Formal Number Theory
In this section, we will discuss an axiom system for formal number theory.
By formal number theory, we mean a theory that describes arithmetic on the
natural numbers. The mathematical objects we are trying to describe with our
new axioms are the counting numbers 0, 1, 2, ... and various familiar functions
on them, like addition and multiplication.
Rather than trying to cook up a reasonable set of axioms from scratch, we
can rely on the expertise of some other mathematicians. The following axioms
were used by Kleene [6] and Mendelson [8]. Well call our axiom system PA,
short for Peanos Axioms for Arithmetic. The function x
is read as successor
and is intended to represent x + 1.
The axiom system PA consists of the axioms of E and the eight following
axioms.
Axiom 8: xy(x = y x
= y
)
Axiom 9: x(0 ,= x
)
Axiom 10: xy(x
= y
x = y)
Axiom 11: x(x + 0 = x)
Axiom 12: xy(x + (y
) = (x +y)
)
Axiom 13: x(x 0 = 0)
Axiom 14: xy(x (y
) = (x y) +x)
Axiom 15: If A(x) is a formula of PA, then
A(0) (n(A(n) A(n
)) nA(n)).
We can easily paraphrase what these axioms say. Axioms 8, 9 and 10 say
that equality acts the way we expect equality to act related to numbers and
successors. Axiom 9 says that 0 is the least counting number. Axiom 10 says
that 0 is the additive identity. Axioms 11 and 12 outline the behavior of addition,
and Axioms 13 and 14 do the same for multiplication. Axiom 15 says that we
can use induction to prove facts about the counting numbers. All in all, this
seems like a very reasonable list of properties of the natural numbers.
The language of PA is very expressive. That is, lots of properties of the
natural numbers can be written as formulas of PA. Here are some examples.
Example. Each of the following mathematical concepts is presented with its
formalization in PA. Note that these are just formulas representing properties
of natural numbers, not provable statements.
1. x is even: k(x = 2 k)
(2 is an abbreviation for 0
.)
3.2. FORMAL NUMBER THEORY 67
2. x is odd: k(x = 2 k + 1)
(1 is an abbreviation for 0
.)
3. y[x (y divides x evenly): k(x = y k) )
4. x y (x is less than or equal to y): k(x +k = y)
5. x < y (x is strictly less than y): k(x +k = y k ,= 0)
(k ,= 0 is an abbreviation for (k = 0.)
6. x is a prime number: 1 < x y(y[x (y = 1 y = x))
(y[x is an abbreviation for k(x = y k), as shown in part 3.)
Besides being able to express a multitude of number theoretical concepts,
PA can actually prove gobs of facts about the natural numbers. Here are some
additional statements and their formalizations, each of which can be proved in
PA.
Example. Each of the following mathematical statements is presented with its
formalization in PA. Each of these properties of natural numbers can be proved
from the axioms of PA. Since GEN is included in PA, we can also prove closed
versions of these statements with universal quantiers in the front.
1. Addition is commutative: x +y = y +x
2. Addition is associative: x + (y +z) = (x +y) +z
3. Multiplication is distributive over addition: x (y +z) = x y +x z
4. Strict inequality is transitive: x < y (y < z x < z)
5. Inequality is preserved by addition: x y x +z y +z
6. Strict inequality is preserved by addition: x < y x +z < y +z
7. Inequality is preserved by multiplication: x y x z y z
8. Strict inequality is preserved by nonzero multiplication:
z ,= 0 (x < y x z < y z)
9. Inequalities can be added: (w x y z) w +y x +z
10. Inequalities can be multiplied: (w x y z) w y x z
We keep asserting that statements can be proved in PA without providing the
proof. There is a reason for this. Generally speaking, the proofs are somewhat
long and complicated, though the next two examples arent too bad.These rst
two results give a formal proof that 0 n = 0. From Axiom 13, we know that
n 0 = 0, but since commutativity of multiplication is not one of our axioms, we
have the prove the new statement. Indeed, this can be used as an initial step
in a proof that multiplication is commutative. (See the exercises.) Remember
that in our proofs in PA, we can use axioms of PA, and results from L, K and
E.
68 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
Theorem PA 1.
PA
n(0 n = 0 0 (n
) = 0).
Proof: We will prove that 0 n = 0
PA
0 (n
) = (x y) +x) Axiom 14
3. xy(x (y
) = (x y) +x) y(0 (y
) = (0 y) + 0) Axiom 4
4. y(0 (y
) = (0 y) + 0) (0 (n
) = (0 n) + 0) Axiom 4
6. 0 (n
) = (0 n) +0) ((0 n) +0 = 0 n 0 (n
) = 0 n) Theorem E2
12. (0 n) + 0 = 0 n 0 (n
) = 0 n) (0 n = 0 0 (n
) = 0) Theorem E2
15. 0 n = 0 0 (n
) = 0 MP lines 1 and 15
Our proof of 0 n = 0
PA
0 (n
) = 0. Using this as
a lemma and applying GEN to n, we obtain a proof of Theorem PA1.
Theorem PA 2.
PA
n(0 n = 0).
Proof: Our proof will use Theorem PA1 and the induction axiom from PA.
In informal terms, line 3 of the following proof is the base case and line 4 is the
induction step.
1. x(x 0 = 0) Axiom 13
2. x(x 0 = 0) 0 0 = 0 Axiom 4
3. 0 0 = 0 MP, lines 1 and 2
4. n(0 n = 0 0 (n
) = 0) Theorem PA1
5. 0 0 = 0 (n(0 n = 0 0 (n
= 0. This proof
was actually carried out in Theorem PA1, and then used in the proof of
Theorem PA2.
70 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
3. Conclusion: By virtue of the induction axiom (Axiom 15), we concluded
that 0 n = 0 for all n.
In the induction step, the assumed statement 0 n = 0 is called the induction
hypothesis. If we rewrite the proof in a less formal fashion, we can include the
main steps of the proof of Theorem PA1 and still give the reader a good idea of
the overall structure of the argument.
Theorem. n(0 n = 0).
Proof. We will use induction and axioms of PA.
Base case: 0 0 = 0 by Axiom 13 of PA.
Induction step: Assume 0 n = 0. We will prove that 0 (n
) = 0.
0 (n
) = 0 n + 0 Axiom 14
= 0 n Axiom 11
= 0 Induction hypothesis
By the transitivity of equality, we have shown 0 (n
) = 0, as desired.
Conclusion: By induction, it follows that n(0 n = 0).
Note that this proof has signicant advantages over the proof in the previous
section. It contains both the proof of Theorem PA1 and Theorem PA2, but
is much shorter. It is much easier to read than the formal proof, but still
highlights the main axioms used in the formal proof. By suppressing some of
the logical machinations of the formal proof, it actually reveals more of the
unalloyed mathematical content of PA.
Clearly, less formal proofs do a better job of serving the interests of math-
ematicians. On the other hand, it is also much more dicult to spot errors in
informal proofs. Whenever we are unsure of a step, it is nice to be able to rely
on the technical precision of formal proof to verify the correctness of details.
The format of an induction argument can be modied in a variety of ways.
For example, the following theorem of PA essentially says that we can shift the
starting point of an induction argument.
Theorem PA 6. If A(x) is a formula of PA, then
A(k) (n(k n (A(n) A(n
).
3. Conclusion: By induction, we conclude that n(k n A(n)).
This type of induction argument is particularly handy for proving results
about summations. You may have seen the following notation in a calculus
course.
k
i=0
f(i) = f(0) +f(1) +f(2) + +f(k).
The starting point of the summation can be a value other than 0. For example,
5
i=2
1
i
=
1
2
+
1
3
+
1
4
+
1
5
.
Shifting the starting points and endpoints allow us to rewrite sums in various
convenient formats. For example,
n
i=1
i = 1 +
n
i=2
i = 1 + 2 +
n
i=3
i = (n 1) +n +
n2
i=1
i.
Note that for nite summations, any rearrangement of the terms yields the same
nal sum.
Using our new notation, we can state a nice theorem which we will then
prove by an informal induction argument with a shifted starting point. Since
this is the rst result that we will prove using strictly informal methods, we will
call it Theorem 1.
Theorem 1. For all n 1,
n
i=1
i =
n(n + 1)
2
.
Before writing the proof, we should do some scratch work. We will need
to use induction with the starting point k = 1. In the induction step, our
induction hypothesis will be that n 1 and
n
i=1
i = n(n + 1)/2. We will want
to prove that
i=1
i = n
(n
n+1
i=1
i = (n + 1)(n + 2)/2. Now
n+1
i=1
i = (
n
i=1
i) +(n+1), so after applying the induction hypothesis we just
need to show that n(n + 1)/2 + (n + 1) = (n + 1)(n + 2)/2. We can prove this
by rewriting the second (n + 1) on the left side of the equation as 2(n + 1)/2
to achieve a common denominator, and then adding fractions and simplifying.
Now we have all the elements of the proof. A little reorganization and we will
have a nice informal proof. We are done with the scratch work; here we go with
the proof.
Proof. We will use induction with a shifted starting point.
Base case: Note that
1
i=1
i = 1 =
1(1 + 1)
2
, so the theorem holds for n = 1.
72 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
Induction step: Suppose that 1 n, and
n
i=1
i =
n(n + 1)
2
. Then,
n+1
i=1
i =
_
n
i=1
i
_
+n + 1
=
n(n + 1)
2
+n + 1 (by the induction hypothesis)
=
n(n + 1)
2
+
2(n + 1)
2
=
n(n + 1) + 2(n + 1)
2
=
(n + 1)(n + 2)
2
.
Conclusion: By induction, we have shown
n
i=1
i =
n(n + 1)
2
for all n 1.
It is possible to formalize and prove Theorem 1 in PA. This would be a
very involved process. First, we would have to nd a formula in the language
of PA that asserts that x is the sum of the natural numbers between 1 and n.
this is no trivial feat in itself. Then we would have to decide how to formalize
division by 2. Once we had a proper formalization of the theorem, we would
still need to carry out the shifted induction argument. The induction step uses
some algebra that we would need to backtrack and prove. This could all be
done, but the insight gained by this process is not terribly interesting to the
typical mathematician. Our informal proof does a good job of justifying the
result without drowning us in the details.
Exercises.
1. Prove the following using informal induction arguments. You may use any
previously proved theorems of PA, the algebraic properties in the example
on page 67, and basic high school algebra facts.
Theorem 2.
n
k=0
2
k
= 2
n+1
1
Theorem 3.
n
k=1
2k = n
2
+n
Theorem 4. k 1 8[(9
k
1)
Theorem 5. n 3 n
2
5n!
2. Consider the theorem:
Theorem 6. The sum of the rst n odd numbers is n
2
.
3.4. INDUCTIVE PITFALLS 73
(a) Rewrite Theorem 6 using summation notation. (Hint: Every odd
number is of the form 2k + 1 for some k.)
(b) Prove Theorem 6 using an informal induction argument.
3. Find a formula in the language of PA with the free variables n and x that
formalizes the statement x is the sum of the natural numbers less than
or equal to n.
4. Strong induction consists of the axiom scheme
A(0) (n(x(x n A(x)) A(n
)) nA(n)).
The only dierence from a standard induction argument is that in the
induction step we are allowed to use all the preceding cases as the induction
hypothesis. Thus, in proving A(n
n
i=1
i = n(n + 1)/2. It is possible to prove this theorem without using in-
duction. Supposedly Gauss cooked up the following proof in order to solve a
problem in elementary school.
Alternate Proof. Let S
n
=
k
i=1
i. This sum can be written from smallest to
largest or from largest to smallest:
S
n
=1+ 2+3 +...+ n
S
n
=n+ (n 1)+(n 2) +...+ 1
Adding these two equations term by term gives:
2S
n
= (1 +n) + (2 + (n 1)) + (3 + (n 2)) +... + (n + 1)
which is the same as
2S
n
= (n + 1) + (n + 1) + (n + 1) +... + (n + 1) = n(n + 1).
74 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
Dividing both sides by 2, gives our result:
S
n
=
k(k + 1)
2
.
Very clever boy, that Gauss! His use of dots in the middle of a sum is
acceptable. Using dots as part of the argument can lead to diculties. Here is
an example of a bad use of dots.
Non-Theorem 1. 3
n
n!.
Non-Proof. Consider the following cases:
n=0: 1 = 3
0
0! = 1
n=1: 3 = 3
1
1! = 1
n=2: 9 = 3
2
2! = 2
n=3: 27 = 3
3
3! = 6
.
.
.
Proceeding in this fashion yields our result.
Not!!! In fact, this statement is also true for n = 4, 5, and 6. At n = 7 it
fails, since 2187 = 3
7
< 7! = 5040. Indeed, the theorem is false for all numbers
above 6. Beware the abuse of dots. A collection of base cases does not make
a valid argument. On the other hand, leaving out the base case can also cause
diculties, as shown by the next erroneous example.
Non-Theorem 2.
n
i=1
i =
n
2
+n+2
2
Non-Proof. Assume the statement is true for n = k, so
k
i=1
i =
k
2
+k+2
2
, and
consider
k+1
i=1
i = (k + 1) +
k
i=1
i = (k + 1) +
k
2
+k + 2
2
.
Expanding out the binomials and combining terms over the common denomi-
nator gives:
k+1
i=1
i =
2k + 2 +k
2
+k + 2
2
=
(k + 1)
2
+ (k + 1) + 2
2
We know this is not correct! We proved the correct statement as Theorem
1. What went wrong? No base case. One last non-theorem will show us that
not only must we consider the base case, but we must be sure we have the right
base case.
Non-Theorem 3. All horses are the same color.
3.5. PROOFS BY CONTRADICTION 75
Non-Proof. We prove this theorem by induction on the number of horses.
Base case: One horse is the same color as itself.
Induction step: Assume that any set of k horses contains horses of one color.
Consider a set, S, of k + 1 horses. Choose any two horses x and y from S with
x ,= y. To nish we must show x and y are the same color.
To accomplish this, look at the sets:
A = S ,x
B = S ,y
A and B are sets of k horses, and thus by the induction hypothesis each contains
horses of one color. Now choose any z contained in A B. z and y are both
in A and are therefore the same color. z and x are both in B and are therefore
the same color as well. Thus x is the same color as y.
What is wrong here? We know that the statement is false! Somehow induc-
tion was not properly done. The error is a subtle one. We chose horses x ,= y
out of our set of horses S thats two horses and then we chose another horse
z from S. That makes three horses in the smallest S possible for the induction
step to make sense. So the base case should have been two horses, which is
false! The moral of this example is: Think very carefully about the base step.
Now that we have mastered induction and seen some errors to avoid, it
is very tempting to use our new hammer on every nail we see. Induction is
not always the most direct approach to proving a theorem. In an induction
proof, if the induction hypothesis is not used in the proof of the induction step,
then induction can be avoided. The direct proof will resemble the proof of
the induction step with the base case omitted. The next exercise illustrates
this situation. Our erroneous proof of Non-theorem 2 looked like an induction
step with the base case omitted, but in that argument we used the induction
hypothesis. In the exercise, we can shorten the proof while avoiding the error.
Exercise.
1. Consider the theorem:
Theorem 10. n is odd n
2
1 is divisible by 4.
(a) Prove this theorem by induction. (Your induction step will not re-
quire the use of the induction hypothesis.)
(b) Prove this theorem without using induction.
3.5 Proofs by Contradiction
Sometimes when we want to prove P Q, the easiest thing to do is to assume
that P Q is false, and derive a contradiction. By assuming the negation of
76 CHAPTER 3. TRANSITION TO INFORMAL PROOFS
P Q, we are actually assuming both P and Q, so we have two hypotheses to
get us started. The fact that deducing a contradiction suces to prove P Q
is a consequence of the following theorem about proofs in K.
Theorem (Proof by Contradiction). If is a collection of formulas with no
free variables, and for some formula B there is a proof of , A B B, and
if that proof contains no applications of generalization to variables that occur
free in A, then A.
Proof. If there is a proof of , A BB with no inappropriate uses of GEN,
then by the deduction theorem A (B B). Using this as a lemma,
we have the following formal proof of A.
1. A (B B) Lemma
2. (A (B B)) ((B B) A) Rule T
3. (B B) A MP, lines 1 and 2
4. (B B) Rule T
5. A MP, lines 3 and 4
Thus, given the deduction of the contradiction B B from the assumption of
A, we may deduce that A holds.
The inclusion of in the theorem allows us to apply proof by contradiction
in systems with additional axioms, like E and PA. Note that whenever we do
proofs by contradiction, we must exhibit the same care concerning generalization
that we use in applications of the deduction theorem. To see the importance
of this, consider the following incorrect proof of 0
,= 0
. We begin by giving a
correct formal proof of (x ,= 0
)
PA
0 = 0
0 ,= 0
.
1. (x ,= 0
) Given
2. (x ,= 0
) x = 0
Rule T
3. x = 0
) GEN, line 3
5. x(x = 0
) 0 = 0
Axiom 4
6. 0 = 0
) Axiom 9 of PA
8. x(0 ,= x
) 0 ,= 0
Axiom 4
9. 0 ,= 0
0 ,= 0
) and 0
,= 0
k=1
k k! = (n + 1)! 1.
Theorem 43. n 5 (2
n
> n
2
).
Theorem 44. If a[b and b[a then a = b.
Theorem 45.
n
k=1
k
3
=
n
2
(n+1)
2
4
.
2. The greatest common divisor of m and n, denoted by gcd(m, n), is the
largest number that divides both m and n. The least common multiple of
m and n, denoted by lcm(m, n) is the smallest number that both m and
n divide. Prove:
Theorem 46. For all a and b, if a ,= 0 and b ,= 0 then lcm(a, b) =
ab
gcd(a,b)
.
Chapter 4
Alternation of Quantiers
Sequences
In this section we will study sequences and sequence convergence. The state-
ments in this chapter will involve the alternation of quantiers, so lets review
some of what we did formally.
Remember that xy has a dierent meaning from yx. In the rst, we
are required to produce for each x, a corresponding y, and in the second we are
required to produce a single y that works for every x. Lets review this idea
with an example:
Let the universe be the set of people Tom, Dick and Harry. Consider the
predicate P(x, y) = x likes y. Then all possible alternating quantiers are:
xy(P(x, y)) which translates to everyone likes someone.
In particular for our universe we would have to identify someone Tom likes,
someone Dick likes and someone Harry likes. The someones could all be the
same or dierent - doesnt matter.
yx(P(x, y)) which translates to everyone is liked by someone.
Now we have to identify someone who likes Tom, someone who likes Dick,
and someone who likes Harry. The someones could all be the same or dierent
- it still doesnt matter.
xy(P(x, y)) which translates to someone likes everyone.
We have to identify one person who likes everyone of Tom, Dick and Harry.
yx(P(x, y)) which translates to someone is liked by everyone.
We have to identify one person who is liked by all of Tom, Dick and Harry.
Having this under our belts, notice the occurances of alternating quantiers
in the basic denitions about sequences below.
83
84 CHAPTER 4. ALTERNATION OF QUANTIFIERS SEQUENCES
4.1 Sequences, Bounds and Convergence
We start with a denition of sequence.
Denition. A sequence is a mapping from N R, for which every n in N is
mapped to a unique a
n
in R, i.e., the sequence is a function from N into R.
When a
n
is the n-th term, we write the sequence as
a
n
1
:
1
2
,
1
4
,
1
8
, ...,
1
2
n
, . . .
(1)
n
0
: 1, 1, 1, 1, 1, 1, 1, . . .
n
3
: 3, 4, 5, 6, . . . , n, . . .
Lets start by investigating convergence of sequences. What does this mean?
We say that a sequence converges if it eventually settles down to some real value,
L. By this we mean that we want the sequence to stay close to L after it settles
down, i.e., it cant start to drift away again. We dont care how far out in the
sequence we have to look before we see this trend.
In calculus we used a simple approach for estimating L for a given series.
We looked at the dominating terms:
a
n
=
n
2n+1
is about the same as
n
2n
when n is really large, so we expect the
series to settle down near
1
2
for large n.
a
n
=
n
n
2
+1
is about the same as
n
n
2
when n is really large, so we expect the
series to behave like
1
n
as n gets really large. Thus this sequence is getting really
close to 0.
a
n
= n grows larger and larger, so it never settles down to a nite number.
In this case, we could say that a
n
doesnt converge or that a
n
.
a
n
= sin(n) oscillates back and forth, so it never settles down to any number,
and it doesnt grow larger and larger. Here we would say that a
n
doesnt
converge.
How can we say this mathematically and precisely?
Denition. a
n
converges to L < , written a
n
L, if and only if
> 0 N N m > N ([a
m
L[ < ).
4.1. SEQUENCES, BOUNDS AND CONVERGENCE 85
Notice the alternation of quantiers . We are required for a given to
produce an index N after which the terms in the sequence are within of L.
Well use this idea to build some proofs later in this section.
The last example above doesnt converge, but it does stay trapped between
1 and -1. This leads to another denition (actually three denitions in one).
Denition. a
n
is bounded from above if and only if U n (a
n
U). The
sequence a
n
is bounded from below if and only if L n (a
n
L). The
sequence a
n
is bounded if and only if U L n (L a
n
U).
Notice the alternation of quantiers here again, this time . So we are
required to produce a bounding number that works for all elements of the se-
quence. Lets use the denitions to prove some convergence results:
Theorem 1.
n
2n+1
converges to
1
2
.
So how do we get started? Suppose we have the . Then we need to give an
N so that m > N gives:
m
2m+ 1
1
2
<
Working backwards from here, we see that
2m(2m+ 1)
2(2m+ 1)
<
1
2(2m+ 1)
<
Solving this for gives
1
2
< 2m+ 1
So it looks like
m >
1
2
1
2
would give us what we need.
How do we write this up in a proper proof?
Proof. Fix > 0, and suppose N is an integer with N
1
2
1
2
. Let m > N.
Then
[a
m
L[ =
m
2m+ 1
1
2
1
2(2m+ 1)
=
1
2(2m+ 1)
<
1
2
_
2
_
1
2
1
2
_
+ 1
_
=
1
1
= .
86 CHAPTER 4. ALTERNATION OF QUANTIFIERS SEQUENCES
Thus, for any given > 0, we have shown how to produce an N such that if
m > N then [a
m
L[ < .
Theorem 2.
n
2n+1
is bounded.
This is an easy theorem to prove; we simply have to come up with two
numbers, a lower bound and an upper bound, for the sequence. Looking at the
rst few numbers in the sequence gives:
n
2n + 1
: 0,
1
3
,
2
5
,
3
7
, ...
Notice that this peaks at 1 and then the numbers are all less than 1 and
greater than 0. So the proof is going to be quite simple:
Proof. Consider the sequence
n
2n+1
, and let U = 1 and L = 0. Clearly, for
every n, 0
n
2n+1
1, so L
n
2n+1
U and thus the sequence is bounded.
Theorem 3. If a
n
=
_
2
n
if n is even
3
n
if n is odd
then a
n
converges to 0.
This sequence is more complicated. How do we handle this case? First of
all, what does this sequence look like?
1,
1
3
,
1
2
2
,
1
3
3
,
1
2
4
,
1
3
5
, ...
So its components of the two sequences:
1,
1
2
,
1
2
2
,
1
2
3
,
1
2
4
,
1
2
5
, ...
1,
1
3
,
1
3
2
,
1
3
3
,
1
3
4
,
1
3
5
, ...
Lets look at the convergence of these two sequences rst. Clearly they both
converge to 0. Starting with 2
n
lets work backwards again to see if we can
write N in terms of . Well come back to theorem 3 afterwards.
Theorem 4. 2
n
converges to 0.
2
N
0
<
2
N
<
One way to solve for N would be to take the log
2
of both sides:
N < log
2
N > log
2
2
N
0
<
Lets write this out formally, just to be sure:
Proof. (Theorem 4) Choose an arbitrary > 0, and let N be an integer with
N log
2
. For the sequence 2
n
and m > N, we need to show that
2
m
0
< .
We have
2
m
0
= 2
m
.
Since m > N and N = log
2
, we have that m > log
2
, so:
2
m
0
< 2
log
2
= .
The proof for convergence of 3
n
should work the same way using an N
of at least log
3
. How do we combine these to prove Theorem 2? We need to
nd an N that works regardless of whether the later term is 2
m
or 3
m
.
So what we really need to do is to choose the larger N given , i.e., choose
the larger of log
2
and log
3
. This will guarantee that we are far enough
out on the sequence so that the terms are within of 0. Which if these two logs
is larger? That depends on , and since we dont want to make any assumptions
regarding , we will simply let N maxlog
2
, log
3
.
Here is the proof of Theorem 3:
Proof. (Theorem 3) Choose an arbitrary > 0, and choose an integer N so
that N maxlog
2
, log
3
. For the sequence a
n
and m > N, we need
to show that
[a
m
0[ < .
Consider the following cases:
When m is even, we can say that N log
2
, so we have that m > N
implies m > log
2
. Thus
[a
m
0[ =
2
m
0
< 2
log
2
= .
When m is odd, we can say that N log
3
, so we have that m > N
implies m > log
3
. Thus
[a
m
0[ =
3
m
0
< 3
log
3
= .
In the proofs above, simple algebra allowed us to solve for N in terms of
. Sometimes bounding the sequence by another, simpler sequence is a better
approach.
88 CHAPTER 4. ALTERNATION OF QUANTIFIERS SEQUENCES
Theorem 5.
2n
2
n
3
+1
converges to 0.
How should we proceed? We could try to solve
2N
2
N
3
+1
< for N in terms of
. This would be very messy:
2N
2
N
3
+ 1
<
2N
2
< (N
3
+ 1)
2N
2
(N
3
+ 1) < 0
Yuk! Its cubic in N.
A better approach: Note that
2N
2
N
3
+ 1
<
2N
2
N
3
=
2
N
because we have made the denominator smaller by subtracting 1, and hence the
fraction is larger.
This implies that if we nd an N that works for the series with general
term
2
N
then it will also work for the series with general term
2N
2
N
3
+1
. Why?
The inequality tells us that no matter what index we are interested in,
2N
2
N
3
+1
is
below
2
N
, so if we nd the place on
2
N
where all subsequent terms are within
of L, all subsequent terms of
2N
2
N
3
+1
will also be within of L.
So we have a new question: What N works for
2
N
? Lets try the algebraic
way of getting N in terms of :
2
N
0 <
2
< N
How do we put this all together in our proof?
Proof. Choose an arbitrary > 0, and let N be an integer with N
2
. For
the sequence
2n
2
n
3
+1
and m > N, we need to show that
2m
2
m
3
+ 1
0
< .
We have
2m
2
m
3
+ 1
0
=
2m
2
m
3
+ 1
<
2
m
.
Since m > N and N
2
, so:
2m
2
m
3
+ 1
0
<
2
m
<
2
2
= .
4.2. MORE ON CONVERGENCE AND BOUNDEDNESS 89
Exercise 4.1. Do the following sequences converge? If so, to what? Are they
bounded? If so, by what? Provide proofs for those that converge and/or are
bounded.
a. a
n
= 1 +
1
n
b. a
n
=
1+(1)
n
2
c. a
n
= 1 +
1
2
+
1
3
+... +
1
n
d. a
n
=
2n
3n+1
e. a
n
=
3n+7
n
f. a
n
=
n
2
n+1
g. a
n
=
n
2
2n
2
+1
h. a
n
= (1)
n
2
n
i. a
n
=
sin(n)
n
j. a
n
=
n!
2
n
k. a
n
=
5n
4n
(where n 5)
4.2 More on Convergence and Boundedness
Now that you have worked with some specic sequences, we will think about
general properties of sequences. To start, try to nd examples for the following
exercises.
Exercise 4.2. Find examples for each, if possible:
a. A sequence that is bounded but does not converge.
b. a
n
and b
n
do not converge but a
n
+b
n
does.
c. a
n
and b
n
do not converge but a
n
b
n
does.
d. A sequence that is not bounded.
e. [a
n
[ converges to A but a
n
does not converge.
f. Is there a sequence that converges to two dierent numbers?
g. Is there a convergent sequence that is not bounded?
These ideas lead to us to conjecture some theorems:
Theorem 6. Every convergent sequence is bounded.
90 CHAPTER 4. ALTERNATION OF QUANTIFIERS SEQUENCES
How shall we start this one? Let the limit be A and note that eventually
(for ms greater than some N) [a
m
A[ < 1, or
A1 < a
m
< A+ 1.
Why? We are using the denition for the specic case of = 1. Thus a lower
bound can be found by choosing the smallest number from the set a
1
, a
2
, ..., a
n
, A
1 and an upper bound can be found by choosing the largest number from the
set a
1
, a
2
, ..., a
n
, A+ 1.
Proof. Suppose [a
n
[ converges to A. Choose = 1; then there is an N such
that m > N implies
A1 < a
m
< A+ 1.
Let L = mina
1
, a
2
, ..., a
n
, A1 and U = maxa
1
, a
2
, ..., a
n
, A+ 1. Then for
all n, L < a
n
< U.
Theorem 7. The limit of a convergent sequence is unique.
So how will we prove this? In the standard way: Assume there are 2 limits
and show that they must be equal. This is not so easy as it sounds. Here is a
proof. Notice that we are using a specic again.
Proof. We will prove this by contradiction. Assume a
n
converges to A and
also to B, and assume that A < B. Let =
1
2
(B A). Since a
n
converges to
A, we know that there is an N
1
such that for all m > N
1
we have [a
m
A[ <
or
A < a
m
< A+.
Similarly, since a
n
converges to B, we know that there is an N
2
such that
for all m > N
2
we have [a
m
B[ < or
B < a
m
< B +.
As long as we are beyond both N
1
and N
2
, we have:
A+ = A+
1
2
(B A) = B
1
2
(B A) = B
This is a contradiction, since B < a
m
< A+.
This is not the only way to prove this theorem. Can you develop another
proof?
Theorem 8. If a
n
converges to A and b
n
converges to B then a
n
+ b
n
converges to A+B.
So how do we approach this? We need
[(a
N
+b
N
) (A+B)[ <
or
[(a
N
A) + (b
n
B)[ < .
Can we say that [a
N
A[ <
2
and [b
N
B[ <
2
? Sure! The denition says
that we have the result for all , so we also have it for any
2
. Here is the proof:
4.3. A NOTE ON DIVERGENT SEQUENCES 91
Proof. Choose > 0. Since a
n
converges to A, we know that there is an N
1
such that for all m > N
1
we have [a
m
A[ <
2
.
Similarly, since b
n
converges to B, we know that there is an N
2
such that
for every m > N
2
we have [b
m
B[ <
2
.
Let N = maxN
1
, N
2
. Then for all m > N, we have
[(a
m
+b
m
) (A+B)[ [a
m
A[ +[b
m
B[ < .
Here are some more theorems to prove.
Theorem 9. If a
n
converges to A then c a
n
converges to cA.
Theorem 10. If a
n
converges to A then c +a
n
converges to c +A.
Theorem 11. a
n
converges to A i a
n
A converges to 0.
Theorem 12. If a
n
converges to A, b
n
converges to A and for all n the
inequality a
n
c
n
b
n
holds, then c
n
converges to A as well.
Theorem 13. If a
n
converges to A, b
n
converges to B and for all n the
inequality a
n
b
n
holds, then A B.
Theorem 14. a
n
converges to A inplies that [a
n
[ converges to [A[.
Theorem 15. If a
n
converges to 0 and b
n
is bounded, then a
n
b
n
converges
to 0.
Theorem 16. If a
n
converges to A and b
n
converges to B then a
n
b
n
converges to A B.
Theorem 17. If a
n
converges to A and b
n
converges to B, with B ,= 0 and
n, b
n
,= 0, then
an
bn
converges to
A
B
.
4.3 A Note on Divergent Sequences
Are there sequences that dont converge? Yes! We already saw that n diverges
to and that sin(n) doesnt ever settle down. How can we prove that a
sequence diverges? To understand this, we need to examine the negation of
the denition of convergence. Lets start with a more formal version of the
denition:
a
n
converges i L > 0 N N m > N ([a
m
L[ < ).
The negation is:
a
n
diverges i L > 0 N N m > N ([a
m
L[ < ).
Now lets use our knowledge of negation and quantiers to push the negation
all the way to the interior of the formula:
a
n
diverges i L > 0 N N m > N ([a
m
L[ ).
92 CHAPTER 4. ALTERNATION OF QUANTIFIERS SEQUENCES
So we need to show that if we choose an arbitrary L, there is an that works
for all N. Lets try a simple one:
Theorem 18. The sequence n diverges.
To do this proof, choose an arbitrary L. We need nd an so that we end
up with
[N L[ ,
and it needs to work for some m > N no matter what N is chosen. If we
choose =
1
2
and we pick an arbitrary N we can nd a number m > N, namely
m N+1+L so that [mL[ , since [a
m
L[ = [mL[ [N+1+LL[ =
N + 1
1
2
.
Proof. Choose an arbitrary L, let =
1
2
, and choose an arbitrary N. Let m be
an integer with m N + 1 +L. Then
[mL[ [N + 1 +L L[ = N + 1
1
2
= .
When a bounded sequence diverges, its values tend to oscillate within a
restricted range. It is often easiest to start the proof by selecting a value b and
a quantity such the sequence bounces above b + innitely many times and
below b innitely many times. For any L there are two possible cases. If
L b (so L is high), then for any N there is an m > N such that b > a
m
(so a
m
is low) and consequently, [a
m
L[ b a
m
> . On the other hand, if
L < b (so L is low), then for any N there is an m > N such that b + < a
m
(so a
m
is high) and consequently, [a
m
L[ a
m
b > . Of course, the initial
choices of b and will depend on the sequence.
Exercise 4.3. Prove that the following sequences diverge.
a. a
n
= n + 5
b. a
n
= n
2
c. a
n
= n!
Exercise 4.4. Prove that the following bounded sequences diverge.
a. a
n
= (1)
n
b. a
n
= cos(n/2)
c. a
n
= sin(n)
Hint: For any N, obtain m by rounding N 2 up to the next largest
integer (i.e. m = ,N 2|). If we view m as an angle in radians it will
correspond to an angle between 0 and 1 radians. Thus m + 1 will be an
angle between 1 and 2 radians, so sin(m + 1) .8. Also, m + 4 will be
between 4 and 5 radians, so sin(m+ 4) .75.
Exercise 4.5. Prove that the sequence a
n
= nsin(n) diverges. (Hint: Use the
hint from exercise 4.4c.)
Chapter 5
Introduction to set theory
Most upper level mathematics courses use at least some notation from set theory
and many apply results and techniques from set theory. The logical expertise
that you have gained in the preceding chapters is directly applicable to the study
of sets.
Nave set theory and axiomatic set theory are the Scylla and Charybdis of
this topic. On the one hand, nave set theory concentrates on the portion of
set theory that is most frequently applied by mathematicians. Unfortunately,
it glosses over some problems with existence of sets that can lead to paradoxes.
Axiomatic set theory is engineered specically to address these existence prob-
lems. As appealing as a purely axiomatic approach is, the usual formulation of
the axioms treats many of the central constructs of set theory as abbreviations,
sidestepping the material which is most useful in everyday practice.
We will try to thread a course between the two extremes, mentioning axioms
when they are pertinent and introducing many of the concepts you will need for
your future courses. With any luck, we wont be drawn down or chewed up.
5.1 Familiar sets and symbols
We can start our discussion of sets by listing a few very familiar concrete exam-
ples. Attaching a nice symbol to each of these sets will make it easier to talk
about them later.
Natural numbers: N = 0, 1, 2 . . .
Integers: Z = 1, 2, 0, 1, 2 . . .
Rational numbers: Q =
a
b
[ a Z b N b ,= 0.
A few rational numbers:
1
3
,
2
6
,
1
12
, 0, 7
Real numbers: R
A few real numbers: 0, 6,
1
3
,
3,
93
94 CHAPTER 5. INTRODUCTION TO SET THEORY
In our denition of the rationals, we used the following set builder notation:
Q =
a
b
[ a Z b N b ,= 0. Informally, we would read this as Q is
the set of all fractions of the form
a
b
, where a is an integer and b is a postive
natural number. In general, we write X = x [ (x) for X is the set of all
objects x that satisfy the formula (x). The notation is handy, but can lead
to diculties. For more on this, see section 5.6.
The fancy script used for these set symbols is called blackboard bold. The
idea is that it is easier to draw two close lines with a piece of chalk than it
is to draw one wide line. The particular letters seem to make some sense. N
for natural numbers and R for real numbers are obvious choices. Since every
rational number can be written as a quotient, Q seems reasonable. Finally, the
german word for number is Zahl, so Z fur die Zahlen steht.
Various authors may or may not include 0 in the set of natural numbers.
Since we would like N to be a model of the Peano axioms, and those axioms
include a constant symbol for 0, we should denitely include 0. People who
dont care about the Peano axioms will sometimes leave it out. It is always
safest to double check what the particular book says.
The formula x y means x is an element of y. We will also write x / y
as an abbreviation for (x y). Combined with our letters for common sets,
this notation provides a very convenient shorthand. Rather than saying 2 is a
natural number and is not a natural number, we can write 2 N and / N.
The formula A B is read A is a subset of B. A B means that
every element of A is also an element of B. More formally, A B means
t(t A t B). Note that this tells us that to prove that A B, we should
start with an arbitrary element t and prove the implication t A t B.
Depending on the situation, we might prove the implication directly, prove the
contrapositive, or do a proof by contradiction.
Notation for subsets varies from book to book. Some books use A B to
denote A B and then use A B for A B A ,= B. We will use A B
to denote A B A ,= B. The formula A B is read A is a proper subset
of B. All these symbols can be reversed in the same fashion as < and >, so
A B means exactly the same thing as B A. We can also write A , B as an
abbreviation of (A B), and make similar negated forms of all the preceding
notation.
Although both and denote forms of containment, they denote dierent
sorts of containment. Consider the set A = 1, 2, 1, 2. The set A has
exactly three elements. We can see that 1 A and 1, 2 A, since 1 is the
rst element in our listing of A and 1, 2 is the third. While 2 A (look
for it in the list), 2 / A (its not in the list). Here 2 and 2 are very dierent
objects. We can also say that 1, 2 A, because each element of 1, 2
(namely 1 and 2) is also an element of A. On the other hand, 1, 2 , A,
because 2 / A.
The formula A = B is read A equals B. We are not monkeying with
the meaning of equality here. That is, equality is assumed to be the familiar
relationship satisfying the axioms of E. In particular, substitutivity of equality
holds, so A = B implies t(t A t B). Furthermore, we will adopt the
5.1. FAMILIAR SETS AND SYMBOLS 95
following axiom asserting the converse of the preceding implication.
Axiom of Extensionality: For all sets A and B, if A and B have the same
elements, then A = B. Formally, t(t A t B) A = B.
We can use the axiom of extensionality as a blueprint for proofs involving
equality. The proof of the next theorem illustrates this and also provides us
with new tools for dealing with set equality.
Theorem 47. A = B if and only if both A B and B A.
Proof. First, suppose A = B. By substitutivity of equality, t(t A t B).
Thus t(t A t B), so A B. Similarly, B A. Summarizing, we have
shown that A = B implies A B B A.
Now suppose that A B B A. Fix t. Since A B, we know that
t A t B. Since B A, we know that t B t A. Thus,
t(t A t B). By the Axiom of Extensionality, A = B. Summarizing, we
have shown that A B B A implies A = B.
We have one last bit of notation to introduce in this section. The set con-
taining no elements is called the empty set, and is denoted by . We have an
axiom that says exactly this.
Empty Set Axiom: The empty set contains no elements. Formally, t(t / ).
Here are three little brain teasers involving the empty set.
Theorem 48. For every set A, A.
Proof. Fix t. Since t / , we know that t t A. Thus, t(t t A),
which is the denition of A.
Theorem 49. , = .
Proof. Note that , but by the Empty Set Axiom, / . Thus and
dont have the same elements, so by the contrapositive of substitutivity of
equality, they are not equal.
The method used in proof of Theorem 49 is useful in many situations. By
substitutivity of equality, A = B implies t(t A t B). The contrapositive
of this is that t(t A t B) implies A ,= B. Of course, the formula
t(t A t B) is equivalent to t(t A , t B), which is the same
as saying that there is a t such that t is in one of the sets but not the other.
Summarizing, to prove that two sets are not equal, we just need to nd one
element that is in one of the sets but not in the other.
Theorem 50. is unique. That is, for any set A, if t(t / A), then A = .
Proof. If t(t / A), then t(t A t ). By the Axiom of Extensionality,
A = .
96 CHAPTER 5. INTRODUCTION TO SET THEORY
Exercises.
1. Prove: For all A and B, if A B then B ,= . (Hint: A B means that
A B and A ,= B. In light of the Axiom of Extensionality, what does
A ,= B imply?)
2. Prove: For all A, if A then A = .
3. The subset relation is almost, but not quite, an equivalence relation. The
three parts of this exercise ll in the details.
(a) Prove that is a reexive relation. (That is, show that for all A,
A A.)
(b) Prove that is a transitive relation. (That is, show that if A B
and B C, then A C, for all A, B, and C.)
(c) Prove that is not a symmetric relation. (That is, show that it is
not the case that for all sets A and B, if A B then B A. Your
proof should consist of two concrete sets that violate symmetry.)
5.2 Operators on sets
In this section, we will explore the set theoretic operations of union, intersection
and power set. Union and intersection can be treated as the familiar operations
on two sets, or they can be generalized to operations on many sets. These
generalized forms are frequently useful in the study of algebra and analysis. We
will start with the binary union operator.
Denition. The union of two sets consists of all the elements that are in either
set (or both). More formally, A B = x [ x A x B. This is the union
operator that you probably saw the rst time you learned any set theory.
Example. The binary union operator is the one that you probably saw the
rst time you learned any set theory. If A = 0, 2 and B = 2, 3, 4, then
A B = 0, 2, 3, 4.
Denition. The union of a collection of sets consists of all the elements that
are in at least one of the sets in the collection. More formally, if I is a set of
sets, then I = x [ y(y I x y).
Example. We can rewrite the previous example using the unary union oper-
ator. If A = 0, 2 and B = 2, 3, 4 and I = A, B, then I = A B =
0, 2, 3, 4.
The unary union operator can be used to nd the union of one set. The
set A consists of all those those x such that there is a y A such that
x y. Since the only y satisfying y A is A itself, A consists of all those
x such that x A. That is, A = A. One slick way to think about this is to
5.2. OPERATORS ON SETS 97
write A = AA = A. Repeating the A in the middle expression is perfectly
acceptable here.
The unary operator can also be used to nd the union of zero sets. The
set consists of all those x such that there is a y such that x y.
Since there is no y , no x can satisfy these requirements. Consequently,
= . You might think that as in the previous paragraph, we could just write
= = . These equations are true, but highly misleading. If we really
imitate the preceding paragraph, we would write = = . (Note the
change in the rst in the rst term.) Since we know that is also empty, we
have = . In general, for a set A, the union A may or may not be A.
For more on this, see exercise 13.
The big advantage of the unary union operator is that it allows us to avoid
dots. Given a sequence of sets A
1
, A
2
, A
3
, . . . , we could write the union of all
these sets as either A
1
A
2
A
3
. . . (using binary union and nasty dots) or as
A
i
[ i N (using the more elegant unary union). The two notations describe
the same set, but the one without dots relies less on our intuitive understanding
of the underlying pattern in the sequence of sets.
Example. For each n N, dene Z
n
= i Z [ n i n. For example,
Z
0
= 0, Z
1
= 1, 0, 1, Z
2
= 2, 1, 0, 1, 2, and so on. Well call each
Z
n
a balanced interval , and let B = Z
n
[ n N be the set of all balanced
intervals. Note that B is a set of sets of integers, so it makes sense to take its
union.
Theorem. B = Z.
Proof. To prove the equality, well prove containment in each direction. First,
suppose j B. Then for some n N, j Z
n
. Since Z
n
Z, we must have
j Z. Summarizing, we have shown that B Z. To complete the proof,
suppose k Z. Since [k[ k [k[, we know that k Z
|k|
. Since Z
|k|
B, we
must have k B. Consequently Z S. By Theorem 47, the claim holds.
The intersection symbol can also be used as either the traditional binary
operator or as a unary operator. The following denitions and examples closely
parallel those for unions
Denition. The intersection of two sets consists of all the elements that are in
both sets. More formally, A B = x [ x A x B.
Example. With this intersection symbol, we are back to something you prob-
ably saw a long time ago. If A = 0, 2 and B = 2, 3, 4, then A B = 2.
Denition. The intersection of a nonempty collection of sets consists of all the
elements that are in every one of the sets in the collection. More formally, if I
is a set of sets, then I = x [ y(y I x y).
Example. We can rewrite the preceding example using the unary notation. If
A = 0, 2 and B = 2, 3, 4 and I = A, B, then I = A B = 2.
98 CHAPTER 5. INTRODUCTION TO SET THEORY
We can use the unary notation to take the intersection of one set. The
intersection A consists of all those elements x that are elements of every
y A. Since the only y in A is A itself, this simplies to the collection of
those elements x that are in A. Thus A = A. As we did with union, we
could write A = A A = A.
The denition of the unary intersection species that the collection of sets
that we are intersecting is nonempty. Consequently, we cant take the intersec-
tion of zero sets. This turns out to be a good thing. Suppose we think of V as
being the collection of all those elements x such that y(y x y). Since
y is false for every y, the implication y x y is true, regardless of the
choice of x and y. Consequently, V would contain every set x and be a so-called
universal set. Axiomatic set theory denies the existence of a universal set in
order to avoid a paradox. We should follow suit, avoid universal sets, and avoid
trying to nd the intersection of zero sets. For more about axiomatic set theory,
see section 5.6.
As with the unary union operator, the unary intersection operator really
shines when we want to take intersections of large collections of sets. As an
example, we will return to our consideration of balanced intervals.
Example. Let B be the set of balanced intervals in Z used in the example for
unions.
Theorem. B = 0.
Proof. To prove the equality, well prove containment in each direction. First
suppose that t B. Then for every Z
n
B, t must be an element of Z
n
.
In particular, t Z
0
= 0. Thus t = 0, and so t is an element of the set on
the right side of the equality. To prove the reverse containment, suppose t is an
element of the set on the right side of the equality. Clearly, t = 0. For every
n N, we know n 0 n, so 0 Z
n
. Since 0 Z
n
for every Z
n
B, we
have 0 B. Since t = 0, we also have t B.
There are some very nice connections between union and intersection. For
example, the binary operators dier only in their logical operator. Compare
these equations:
A B = x [ x A x B
A B = x [ x A x B
The unary operators have a similar connection. This is especially notable if
we switch to bounded quantier notation.
I = x [ y(y I x y) = x [ y I(x y)
I = x [ y(y I x y) = x [ y I(x y)
We complete this section with one more unary set operator. Here is the
denition followed by two short examples.
5.2. OPERATORS ON SETS 99
Denition. The power set of a set X is denoted by T(X) and is the set of all
subsets of X. Formally, T(X) = y [ y X.
Example. If A = 0, 2, then T(A) = , 0, 2, 0, 2. It is not too hard
to show that if X has n elements, then T(X) has 2
n
elements. We are lucky
that A was a pretty small set.
Example. Suppose B is the set of balanced intervals fromZ as described earlier.
Theorem. B T(Z).
Proof. For each n, Z
n
T(Z), so B T(Z). Additionally, 0, 3, 5 Z and
0, 3, 5 / B, so B ,= T(Z).
Exercises.
1. Prove: For all A, B, and C, A (B C) = (A B) (A C).
2. Prove: For all sets of sets A, t(t A t A).
3. Suppose that for all n N, X
n
= n, n + 1, n + 2, . . . . Let A = X
n
[
n N.
(a) Find A.
(b) Find A.
4. Prove: For all A, B, and C, A (B C) = (A B) (A C).
5. Prove: For all nonempty sets of sets A, t(t A A t).
6. Prove: X(T(X) = X).
7. (a) Prove if A is a set of sets and A then A = .
(b) Prove X(T(X) = ).
8. Prove: X(X T(X)).
9. Find a set X such that X = T(X).
10. Find T().
11. Prove that = .
12. Find the following sets: T(), T(T()), T(T(T()))
13. A set S is called transitive if xy((x y y S) x S). (So S is
transitive if is a transitive relation on the elements of S.)
(a) Prove that S is transitive if and only if S S.
(b) Prove that is transitive. (Hint: You could use the denition or part
13a.)
(c) Prove that , , , . . . is transitive.
(d) Prove that , is not transitive.
100 CHAPTER 5. INTRODUCTION TO SET THEORY
5.3 Cartesian products and functions
The notation (a, b) is used to denote an ordered pair of objects. We say that
(a, b) = (x, y) if and only if a = x and b = y. Note that ordered pairs are dierent
from sets with two elements. While 0, 1 = 1, 0 because the sets have the
same elements, (0, 1) ,= (1, 0) because the rst components dont match. In
axiomatic set theory, ordered pairs are encoded by sets. For more about this,
see exercise 4.
Sets of ordered pairs are used to represent a myriad of constructs in math-
ematics. We can think of the points in the real plane as a set of ordered pairs
of coordinates. We can also view the graph of a function or even the function
itself as a set ordered pairs.
Denition. If X and Y are sets, then the cartesian product XY is the set of
all ordered pairs with a rst coordinate from X and a second component from
Y . More formally, X Y = (x, y) [ x X y Y .
Denition. We say a set f of ordered pairs is single-valued if and only if
xy
1
y
2
(((x, y
1
) f (x, y
2
) f) y
1
= y
2
).
A function is a set of ordered pairs that is single valued. Rather than writing
(x, y) f, we often use the convenient abbreviation f(x) = y.
Requiring f to be single-valued insures that the equality in the abbreviation
is transitive, as we would expect. In particular, if f(x) = y
1
and f(x) = y
2
, then
y
1
= y
2
holds. For any function f from R to R, the fact that f is single-valued
is equivalent to saying that every vertical line in the plane hits the graph of f
in at most one point. So for functions on the reals, the preceding denition says
functions must satisfy the vertical line test. On the other hand, for functions
of other sorts, the vertical line test makes less sense. For functions that are
(for example) linear transformations on R
3
, or complex valued holomorphisms,
or automorphisms on nite groups, the idea of a vertical line doesnt make
a lick of sense. However, we can certainly talk about all these functions being
single-valued.
Example. Consider the set F = (0, 1), (1, 2), (2, 1). Since each rst coordi-
nate appears in only one ordered pair, F is a function. Because (0, 1) F, we
can write F(0) = 1. Similarly we can write F(1) = 2 and F(2) = 1. If you plot
the three pairs in F as points in the real plane, you will see that they satisfy
the vertical line test.
Example. Consider X = (1, 0), (2, 1), (1, 2). X is not a function, because
(1, 0) and (1, 2) witness that X is not single-valued. These pairs indicate that
X(1) = 0 and X(1) = 2, and that would cause problems. As in the previous
example, you could draw a picture here to illustrate the situation.
Example. Consider Y = (a, b), (b, c), (a, c), where none of the letters are
equal. Since this is practically identical to the preceding example, Y is not a
5.3. CARTESIAN PRODUCTS AND FUNCTIONS 101
function. We can demonstrate this by just pointing out that Y (a) = b and
Y (a) = c, so Y is not single-valued. Since were not dealing with numbers here,
drawing a picture would require making some assumptions about a, b, and c.
Unless we identify the letters with numbers, the vertical line test doesnt make
much sense.
Example. Suppose S = (x, x
2
) [ x R. S is the familiar squaring function
on the real numbers, often described using the equation S(x) = x
2
.
Example. Consider T = (x
2
, x) [ x R. Since (1, 1) and (1, 1) are both
elements of T, T is not single-valued. Because we are working in the reals, we
could say that T fails the vertical line test.
When we think of functions as sets of ordered pairs, the concepts of domain
and range become completely transparent. Consider the following denition.
Denition. If f is a function, the domain of f is dened by the equation
dom(f) = x [ y(x, y) f.
The range of f is dened by the equation
ran(f) = y [ x(x, y) f.
If X is the domain of f and Y is any set containing the range of f, then we
often write f : X Y , which is read f maps X to Y . In this case, the set Y
is referred to as the codomain of f.
Example. If S = (x, x
2
) [ x R, then dom(S) = R, and ran(S) = y
R [ y 0. We could write S : R R. Note that in this case, the indicated
codomain is R even though the range is a smaller set.
Notation alert: Consider the familiar square root function on the real num-
bers. We can dened it by g = (x,
x) [ x R x 0. If were working
on the reals, then the square root is not dened on negative numbers and so
dom(g) = x R [ x 0. Despite this, it is not too unusual to see someone
write
g : R R is dened by g(x) =
x
and claim that the implicit domain is dom(g) = x R [ x 0. In other words,
guring out the actual domain and the precise denition of the function is left up
to the reader. Implicit domains can be very handy for working with partially
dened functions. For our immediate purposes, its nicer to have everything
explicitly dened.
Using ordered pairs to dene functions also cleans up the notion of what it
means for functions to be onto and/or one to one. The relevant denitions and
some examples follow.
Denition. If f : X Y (where dom(f) = X and Y is a codomain of f), and
T Y , we say f maps X onto T if ran(f) = T.
102 CHAPTER 5. INTRODUCTION TO SET THEORY
Note: To prove that ran(f) = T, we could prove containment both directions.
In practice, one direction is almost always given to us. See the next example.
Example. Suppose S : R [0, ) is dened by S(x) = x
2
. Prove that S maps
R onto [0, ). (Here [0, ) is the interval notation for the set y R [ y 0.)
Proof. Since [0, ) is the codomain of S, we know ran(S) [0, ). It remains to
show the opposite containment. Suppose t [0, ). Then
t is a well-dened
real number . Since
S(
t) = (
t)
2
= t,
t ran(S). Thus t [0, ) implies t ran(S), and so [0, ) ran(S). By
Theorem 1, ran(S) = [0, ), so S maps R onto [0, ).
Denition. Suppose f : X Y . We say f is one to one (also written 11)
when no two distinct range elements are mapped to the same range element.
More formally, f is one to one means
x
1
x
2
(x
1
,= x
2
f(x
1
) ,= f(x
2
)).
Any one to one function from a set X into a set Y matches each element of
X with a unique partner in Y . When we match students with student identier
numbers, or match books with call numbers, or give everyone an individual
bag of chips for their lunch, we are implementing one to one functions. In
applying the denition, generally it is easiest to prove the contrapositive of the
implication. In practice, to prove that f is one to one, we usually prove
x
1
x
2
(f(x
1
) = f(x
2
) x
1
= x
2
)
Example. Consider f : [0, ) R dened by f(x) =
x. Prove that f is one
to one.
Proof. Suppose x
1
and x
2
are elements of [0, ) such that f(x
1
) = f(x
2
). By
the denition of f,
x
1
=
x
2
. Squaring both sides of the equation shows that
x
1
= x
2
. Since x
1
and x
2
are both nonnegative, x
1
= x
2
.
Example. Consider S : R [0, ) dened by S(x) = x
2
. Show that S is not
one to one.
Proof. Note that S(1) = 1 = S(1). Thus S is not one to one.
Concrete constructions (like the one in the preceding example) are the best
possible approach to proving many existential statements. It is much better to
write S(1) = 1 = S(1) rather than S(x) = x
2
= S(x), because when x = 0,
S(0) = 0
2
= S(0) fails to show that S is not one to one.
The denitions of one to one functions and single-valued are suciently
similar to cause some confusion. When you write them next to each other, they
look very dierent:
f is one to one: x
1
x
2
y((f(x
1
) = y f(x
2
) = y) x
1
= x
2
)
f is single-valued: x y
1
y
2
((f(x) = y
1
f(x) = y
2
) y
1
= y
2
)
5.3. CARTESIAN PRODUCTS AND FUNCTIONS 103
We have slightly modied the formula for one to one here, but this version is
equivalent to the one above. Note that the denition of one to one has two
xs and one y, while the denition of single-valued has one x and two ys. A
relation (from R to R) that is not single-valued fails the vertical line test, while
a function that is not one to one fails a horizontal line test.
Exercises
The following problems use these sets of ordered pairs:
f = (n, n
2
) [ n N
g = (x, x
2
) [ x Z
h = (x
2
, x) [ x Z
r = (n, n + 3) [ n N
s = (x, x + 3) [ x Z
1. (a) Prove that f is single-valued.
(b) Prove that h is not single-valued. (Use a concrete example.)
2. (a) Prove that f is one to one.
(b) Prove that g is not one to one. (Use a concrete example.)
3. Both r and s are functions.
(a) Find the domain and range of r.
(b) Is r one to one and onto N? Justify your answer.
(c) Find the domain and range of s.
(d) Is s one to one and onto Z? Justify your answer.
4. In axiomatic set theory, (see section 5.6) we encode ordered pairs by sets.
This amounts to asserting that the ordered pair notation is just a short-
hand for a particular set. An encoding suggested by Kuratowski [7] is
(a, b) = a, b, a.
(a) Using Kuratowskis encoding and the Axiom of Extensionality, prove
that (a, b) = (c, d) if and only if a = c and b = d. (That is, show
that the set encoding (a, b) has exactly the same elements as the set
encoding (c, d) if and only if a = c and b = d.)
(b) Using Kuratowskis encoding, prove that XY T(XT(XY )).
5. The Axiom of Regularity (see section 5.6) implies that x(x / x). Show
that the Axiom of Regularity implies that no set with exactly one element
can represent an ordered pair in the Kuratowski encoding.
6. Find an example of sets a, b, c, and d such that a, b = c, d but it
is not the case that a = b and c = d. (This shows that (a, b) = a, b
doesnt work as an encoding of ordered pairs.)
104 CHAPTER 5. INTRODUCTION TO SET THEORY
5.4 Inverse functions, images, and pre-images
In this section, we will use our set theoretic representation of functions to explore
the the concept of inverse functions. We start with a traditional denition of
an inverse function and a couple of examples.
Denition. Suppose that f is a function with dom(f) = X and ran(f) = Y .
We say that the function g : Y X is the inverse of f and write g = f
1
provided that the following hold:
x X(g(f(x)) = x) and y Y (f(g(y)) = y).
It is easy to see that this denition is symmetric. That is, f = g
1
if and
only if g = f
1
. It is also possible to prove that if f has an inverse, then that
inverse is unique. See exercise 1.
Example. Let R
+
= x R [ x 0 and consider the function f : R
+
R
+
dened by f(x) = x
2
. Let g : R
+
R
+
be dened by g(x) =
x. (Note that
x
2
= [x[ = x
f(g(y)) = f(
y) = (
y)
2
= y
Example. Suppose f : R R
+
is dened by f(x) = x
2
, and g : R
+
R is
dened by g(x) =
x. Since
g(f(1)) = g((1)
2
) = g(1) =
1 = 1,
g(f(1)) ,= 1, so g is not f
1
. If we redened g as the negative square root,
g(f(1)) would not equal 1, so we still would not have an inverse. Indeed, the fact
that f(1) = 1 = f(1) bars us from being able to nd an inverse for f(x) = x
2
on this domain.
The preceding example has two morals. First, domains matter in nding
inverses. Second, functions that are not one to one dont have inverses. Maybe
we should stir in some set theory. If we think of the function f as a set of
ordered pairs, we can build a new set g by ipping the order of all the pairs.
If this new set is a function, then it ought to be the inverse of f. Our second
moral gives us an indication of when the ipped set is a function. The next
theorem says that this is a very good indication indeed.
Theorem 51. Suppose that f is a function with dom(f) = X and ran(f) = Y .
Dene g = (y, x) [ (x, y) f. Then g is a function if and only if f is one to
one.
Proof. Suppose that f and g are as in the theorem. Then f is not one to one if
and only if there are values x
1
and x
2
in X such that x
1
,= x
2
and f(x
1
) = f(x
2
).
This holds if and only if there is a y Y such that x
1
,= x
2
, (x
1
, y) f, and
(x
2
, y) f. By the denition of g, this is equivalent to x
1
,= x
2
, (y, x
1
) g,
and (y, x
2
) g. But this is equivalent to asserting that g is not single-valued,
i.e. that g is not a function.
5.4. INVERSE FUNCTIONS, IMAGES, AND PRE-IMAGES 105
Before the last theorem, we said that the ipped set should be the inverse
function, provided that it is a function at all. We still need to prove that.
Theorem 52. Suppose f is a function. Dene g = (y, x) [ (x, y) f. Then
g is a function if and only if g = f
1
.
Proof. Suppose f is a function with with dom(f) = X and ran(f) = Y . Also
suppose g is the set of pairs dened above. If g is the inverse function of f,
then g is certainly a function. Consequently, we need only prove the converse.
Suppose g is a function. Note that (x, y) f if and only if (y, x) g. In function
notation, this means f(x) = y if and only if g(y) = x. First, suppose x X
and f(x) = y. Then g(f(x)) = g(y) = x. Similarly, if y Y and g(y) = x, then
f(g(y)) = f(x) = y. Summarizing, g is the inverse of f.
Sometimes we want to apply a function to every element of a set. As a slick
shorthand, rather than writing f(x) [ x X, we can just write f(X). People
also have a shorthand for all the elements that f maps into a set. Here are both
of these shorthand notations in one denition.
Denition. Suppose f : X Y is a function. If U X, the image of U under
f is dened by f(U) = f(x) [ x U. If V ran(f), then the pre-image of V
under f is dened by f
1
(V ) = x X [ f(x) V .
Notation alert: The pre-image of a set under f is often dened even when
the inverse function f
1
does not exist. Consequently, f
1
(V ) (for a set V )
may denote a perfectly well dened set even when f
1
(y) (for an element y of
ran(f)) may be complete gibberish.
Example: Dene the function f : 0, 1, 2, 3 a, b, c by the set of ordered
pairs f = (0, a), (1, c), (2, c), (3, b). So f(0) = a, f(1) = c, and so on. Then
f(0, 1) = f(0), f(1) = a, c
and
f
1
(b, c) = x [ f(x) b, c = x [ f(x) = b f(x) = c = 1, 2, 3.
Exercises
1. Prove that if an inverse exists for a function, it must be unique.
2. Suppose f : Z Z is dened by f(x) = 3x + 2.
(a) Prove that f is one to one.
(b) Prove that f does not map Z onto Z.
(c) Find a formula for f
1
, the inverse of f. Your formula should be of
the form f
1
(x) = some algebraic expression involving x.
(d) Find the domain of f
1
.
106 CHAPTER 5. INTRODUCTION TO SET THEORY
3. Prove that if f is a function and U dom(f), then f
1
(f(U)) U. (Note
that f
1
is denoting a pre-image in this problem, not an inverse function.)
4. Show that in problem 3, we cant replace the subset symbol by equality.
Do this by giving an example of a function f and a set U dom(f) for
which f
1
(f(U)) U.
5. Prove that if f is a function and V ran(f), then f(f
1
(V )) = V .
5.5 Sizes of sets
Consider the following tables, which dene the functions f and g.
x 1 2 5 7
f(x) t a r e
x 1 2 5
g(x) t a r
Note that the function f is one to one and maps the set 1, 2, 5, 7 onto
the set t, a, r, e. So f matches each element of 1, 2, 5, 7 with an element of
t, a, r, e. As a consequence of this, it is reasonable to conclude that the set
1, 2, 5, 7 is the same size as the set t, a, r, e.
Why bother with f? Each of these sets contains four elements, so of course
they are the same size. Note that in counting the elements, we actually match
each element with one of the numbers 1, 2, 3, and 4. Consequently, as we count
the elements in each set, we are actually dening a one to one and onto map
between the set and 1, 2, 3, 4. When we count the elements in the two sets, we
are actually constructing two functions. If we compose one of those functions
with the inverse of the other, we get a one to one function mapping one of the
sets onto the other. In some sense, counting the elements is just a process for
constructing a function like f.
Now g witnesses that the sets 1, 2, 5 and t, a, r are the same size. Since
g can also be viewed as a one to one map from 1, 2, 5 into t, a, r, e, this also
shows us that the set t, a, r, e is at least as big as the set 1, 2, 5. Note that
in the previous sentence, when we expand the codomain of g, we get a function
into t, a, r, e, not onto t, a, r, e.
The next denition sets up some nice shorthand notation for this notion of
size of sets.
Denition. Let A and B be sets. If there is a one to one function from A into
B, we say that B is at least as big as A, and write A B (or B A). If there
is a one to one function from A onto B, then we say that A and B are the same
size, and write A B.
The really beautiful thing about this denition is that it allows us to compare
the sizes of innite sets. Here are two examples.
5.5. SIZES OF SETS 107
Theorem 53. N Z, that is, the integers are at least as big as the natural
numbers.
Proof. The function f : N Z dened by the equation f(n) = n is a one to
one map of N into Z. Verication that this function is one to one is left as an
easy exercise.
Theorem 54. N Z, that is, the integers and the natural numbers are the
same size.
Proof. The function g : N Z dened by the formula below is a one to one
map of N onto Z.
g(n) =
_
n
2
if n is even
n+1
2
if n is odd
Verication that this function is one to one and onto is left as an exercise.
Sometimes cooking up these one to one and onto functions is quite challeng-
ing. The next theorem provides perhaps one of the most useful shortcuts in the
set theory literature. Unfortunately, the proof of this theorem is beyond the
scope of this book, but you can nd a proof in [3], if you are interested.
Theorem 55 (Cantor-Berstein Theorem). If A B and B A, then A B.
Although the Cantor-Berstein Theorem looks like a trivial statement about
inequalities, the notation is hiding its remarkable power. It really says that
there is some systematic method for converting a pair of one to one functions
into a single function that is one to one and onto. Very handy indeed. Here is
an example.
Alternate proof of Theorem 54. The function f : N Z dened by the equation
f(n) = n is a one to one map of N into Z. Let h : Z N be the function dened
by:
h(z) =
_
2
z
if z 0
3
|z|
if z < 0
Then h is a one to one map of Z into N. By the Cantor-Berstein Theorem,
N Z.
So far, all the innite sets that we have examined were the same size. This
is a complete uke. In the case of nite sets, the power set of a set is always
larger than the original set. Cantor proved that this is true for innite sets, too!
If we write X Y for (X Y X , Y ), we can state the next theorem very
elegantly.
Theorem 56. X(X T(X)). That is, for every set X, the power set of X is
strictly larger than X.
108 CHAPTER 5. INTRODUCTION TO SET THEORY
Proof. Fix a set X. We need to show that X T(X) X , T(X). To prove
the rst conjunct, note that the function f : X T(X) dened by f(x) = x
for each x X is a one to one function.
It remains to show that X , T(X). Suppose that g : X T(X) is one to
one. We will show that g cannot be onto. Let y = t X [ t / g(t). Note that
y T(X). However, y cannot be in the range of g. To see this, suppose for a
moment that there is some x X such that g(x) = y. Then x g(x) if and only
if x y. By the denition of y, x y if and only if x / g(x). Concatenating the
biconditionals, we have x g(x) if and only if x / g(x), a clear contradiction.
Thus y is not in the range of g, and so g is not onto. Since g was an arbitrary
one to one function, there can be no function mapping X into T(X) which is
both one to one and onto. That is, X , T(X).
If we plug the natural numbers in for X in the preceding theorem and then
iterate this process, we get a nice chain of innite sets of strictly increasing sizes.
N T(N) T(T(N)) T(T(T(N))) . . .
We say that a set X is countable if X N. All the sets to the right of N in
the list are uncountable. It is possible to prove that T(N) R, so the real
numbers are uncountable. For details of that proof, see Corollary 3.23 in [3].
For a direct argument that N , R, see exercise 6. By contrast, Theorem 54
shows that the integers are countable and exercise 4 shows that the rationals
are countable. Summarizing, there are innitely many dierent sizes of innite
sets, and familiar innite sets include both countable and uncountable examples.
Exercises
1. Give a proof that the function dened in the proof of Theorem 53 is one
to one.
2. Give a detailed proof that the function dened in the rst proof of Theorem
54 is indeed one to one and onto.
3. Give a detailed proof that the function h dened in the alternate proof of
Theorem 54 (following the statement of the Cantor-Berstein theorem) is
one to one.
4. Prove that the rationals are countable. (Hint: It is easiest to use the
Cantor-Berstein Theorem to prove that Q N.)
5. Prove that the function f in the proof of Theorem 56 is one to one.
6. Use a proof by contradiction to show that N , R. Assume that N R
and so there a function f that maps N one to one onto R. Describe a
method of constructing a single real number r that diers from each f(n)
in the n + 1
st
decimal place. Since this real is not in the range of f, this
contradicts the claim that f is onto.
5.6. DANGERS OF NA