Contents
1 Notes on Quantifiers and Identity 2
1.1 Quantifier Scope: some tricky facts . . . . . . . . . . . . . . . 2
1.2 Identity, Quantifiers and “at least / at most” . . . . . . . . . . 8
1.2.1 At most n F’s . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.2 At least n F’s . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.3 Exactly n F’s . . . . . . . . . . . . . . . . . . . . . . . 11
2 Enumerability 12
2.1 Size of infinite sets . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 Definition of size/cardinality . . . . . . . . . . . . . . . . . . . 24
2.3 Proof that the power set of N has a greater cardinality than N 30
3 The Real Numbers R are Uncountable. Why They Call it a
“Diagonal Argument” 40
4 The Countability of the Language of First-Order Logic 45
4.1 A Useful Coding Tool: The Prime Decomposition Theorem
and Coding Arbitrarily Long Finite Sequences . . . . . . . . . 45
4.1.1 Sequences of sentences in a language with a denumer-
able vocabulary . . . . . . . . . . . . . . . . . . . . . . 51
5 Counting argument to prove the existence of transcendental
numbers 53
5.1 Proof that there is at least one real number that is not alge-
braic. (Skipped for time, but included here for the curious.) . 56
1
1 Notes on Quantifiers and Identity
After some emails and discussion with students, I thought
it would be a good idea to add a couple more bits of in-
formation to the background briefing/review of predicate
logic. After this, we’ll turn to enumerability.
1.1 Quantifier Scope: some tricky facts
In certain cases you can “bring a quantifier inside the
parentheses”, in other times you cannot.
For example, all of these are equivalent, in the sense that
they are true in exactly the same circumstances:
(∀x)(F x → (∀y)Gy)
(∀x)(∀y)(F x → Gy)
(∀y)(∀x)(F x → Gy)
Similarly these are true under the same circumstances:
(∃x)(∃y)(F x → Gy)
(∃y)(∃x)(F x → Gy)
(∃x)(F x → (∃y)Gy)
2
Comment 1: The first equivalence on the last slide will
not hold if there is a y in the antecedent.
For example - this inference is a mistake:
(∀x)(∀y)(F xy → Gy)
(∀x)(F xy → (∀y)Gy)
(In fact, the second formula isn’t even a sentence, because
the first y is not bound by any quantifier.)
3
Here is a simple case of failed equivalence:
(∃x)(F x & Gx) is not equivalent to (∃x)F x & (∃x)Gx
The first says that there is a single thing that is both F
and G, the second that there is something that is F and
that there is something that is G. They need not be the
same thing.
For example, there are horses and there are stars, but
there is nothing that is both a horse and a star.
But the inference holds one way:
(∃x)(F x & Gx) entails (∃x)F x & (∃x)Gx though not the
other way around
However, with ∨ you do get this equivalence:
(∃x)(F x ∨ Gx) is equivalent to (∃x)F x ∨ (∃x)Gx
4
It is the dual situation with ∀:
(∀x)(F x ∨ Gx) is not equivalent to (∀x)F x ∨ (∀x)Gx
The first says that everything is either F or G, the second
says that everything is F or everything is G. They need
not be the same thing.
For example, let “F x” be “x is even” and Gx be “x is
odd”, with the universe of discourse the natural numbers.
Every natural number is even or odd, but it is not the
case that all natural numbers are even, and it is not the
case that all natural numbers are odd.
5
But the inference holds one way:
(∀x)F x ∨ (∀x)Gx) entails (∀x)(F x ∨ Gx) though not
the other way around
However, with & you do get the equivalence:
(∀x)(F x & Gx) is equivalent to (∀x)F x & (∀x)Gx
As a general rule of thumb, ∀ behaves a bit like “&” and
∃ behaves a bit like “∨”.
6
Among the trickiest of the quantifier equivalences are
these:
(∀x)(P x → Q) is equivalent to (∃x)P x → Q and:
(∃x)(P x → Q) is equivalent to (∀x)P x → Q and:
If x doesn’t occur free in Q (Crucial condition).
The easiest way to see why these equivalences hold is to
translate (∀x)(P x → Q) into (∀x)(∼ P x∨Q), and then,
after doing some reasoning, translating the resulting ∨
statement back into an → statement. (And similarly for
the second.) If you don’t already see how to do this, try
thinking it through as an exercise.
You will want to use, among others, the equivalences:
(∀x) ∼ P is equivalent to ∼ (∃x)P and
(∃x) ∼ P is equivalent to ∼ (∀x)P
(Do you see why these two equivalences hold? Think
them through.)
7
1.2 Identity, Quantifiers and “at least / at most”
1.2.1 At most n F’s
There are many reasons why is useful to add a predicate
“x = y” to mean “x equals y” or “x is identical to y”,
and treat it as a logical constant.
This will allow us to say, for example, not only that there
is at least one object that is F , but that there is exactly
one object that is F .
There is exactly one queen of England: Let Qx be “x is
queen of England” and we can write this as:
(∃x)[Qx & (∀y)(Qy → x = y)]
More literally: There is a thing x that is queen of Eng-
land, and for any other thing y, if y is a queen of England
then x = y.
8
Similarly, we can say “there are at most two F’s”:
(∀x)(∀y)(∀z)[(F x&F y&F z) → (x = y ∨ x = z ∨ y = z)]
This says roughly, “if there are three F ’s then at least
two of them are identical”.
We can obviously modify this to say that there are at
most n F’s for any n.
First write n + 1 universal quantifiers, then say that “if
all these things are F, at least two are identical”:
(∀x1 )(∀x2 ) . . . (∀xn+1 )[(F x1 &F x2 & . . . & F xn+1 )
→ (x1 = x2 ∨ x1 = x3 ∨ . . . ∨ xn = xn+1 )]
9
1.2.2 At least n F’s
To say that there are at least n F’s, you will use n exis-
tential quantifiers, but also you must explicitly say that
each variable designates something different.
For example: (∃x)(∃z)[F x&F z] does not say that there
are two F’s, since the x and z can be the same thing.
(∃x)(∃z)[F x & F z & x ̸= z] does say that there are at
least 2 F’s.
More generally, to say that there are at least n F’s, we
write:
(∃x1 )(∃x2 ) . . . (∃xn )[F x1 &F x2 & . . . & F xn & x1 ̸= x2 & x1 ̸= x3 & x1 ̸=
x2 & . . . & xn−1 ̸= xn ]
The conjoined sentences at the end include xi ̸= xj for
every i and j with 1 ≤ i < j ≤ n.
The reason for the i < j requirement is that we need to
ensure that i ̸= j, and we also want to avoid duplicates,
like xa ̸= xb and xb ̸= xa.
10
1.2.3 Exactly n F’s
To say that there are exactly n F’s, add sentences stat-
ing explicitly that the things that are said to be F by the
quantifiers are not identical.
Example for the case n = 2:
(∃x)(∃z)[F x&F z & x ̸= z & (∀y)(F y → (x = y ∨ z = y))]
For n = 3:
(∃x)(∃z)(∃w)[F x&F z&F w & x ̸= z & x ̸= w & z ̸= w &
(∀y)(F y → (x = y ∨ z = y ∨ w = y))]
11
2 Enumerability
It will be important in proofs and in our understanding
of what is going on to be able to count infinite sets as
well as finite ones.
Among the reasons for caring is a kind of argument we
call a “counting argument”.
Such arguments are so familiar in everyday life that we
hardly notice them.
12
If we count five people in the party and we have only four
hamburgers then we know that at least one person won’t
get a whole hamburger.
In a room with 367 people, we can be absolutely sure
that at least one pair of people in the room have the
same birthday.
The underlying principle here is sometimes called the
Pigeonhole Principle:
If you have n + 1 pigeons and and you are assigning them
to n pigeonholes, then at least one pigeonhole will get
more than one pigeon.
13
Many simple facts about abstract languages can be worked
out just by appealing to more general versions of the Pi-
geonhole Principle.
Finite Case: Say that I have a language containing just 5
letters, and I want to talk about 15 objects. I know just
by counting that some object won’t be named by a single
letter.
Infinite Case: Say that I have a language containing just
5 letters, and I want to talk about all of N. I know just
by “counting” that there are finitely many letters and in-
finitely many objects to be named, so some object won’t
be named by a single letter.
Last lecture, I mentioned an another infinite version of
this argument where we compare two infinite sets: if we
have a language that is “as infinite as” the natural num-
bers N and our domain is the real numbers R we won’t
have enough names to name every real number.
In a few slides, we’ll see the argument for this, called
“the diagonal argument” — the basic pattern will under-
lie much of what we do for the rest of the class.
14
Sometimes, with counting arguments, we can assign pre-
cise numbers, as in the case of 367 people in the room,
versus 366 days in a leap year.
In other cases, we may count in a more general way: We
know that at least one A isn’t a B if we have n A’s and
m B’s and we know that m < n, even if we don’t know
what specific numbers m and n are.
In some cases, the counting is even more approximate:
if we can attach a precise sense to “not very many” and
“lots”, we can establish that at least one A isn’t a B if we
can establish that there are “lots” of A’s but “not very
many” B’s.
15
In mathematics the “lots” versus “not very many” (or
“big” / “small” etc.) can be made rigorous in lots of dif-
ferent ways, depending on the context.
Examples (I don’t expected that all of you will know what
all of these are):
Finite / infinite
Set of measure 0 / Set of positive measure
First Baire Category (aka Meagre set) / Second Baire
Category (aka non-meagre set)
members of an ultrafilter / non-members of that ultrafil-
ter
...
Mathematicians often say “Almost all...” when they mean
“Except for at most finitely many exceptions”, no matter
how large the finite number of exceptions might be.
(And, depending on the context, “Almost all” can also
mean “Except for a set of exceptions that has measure
0 / Except for a meagre set of exceptions / . . . But we
won’t use those concepts in this class.)
16
We’ll have two “lots” versus “not very many” contrasts
we’ll consider:
Finite / Infinite and The size of N / The size of R
Arguments appealing to these contrasts can seem disori-
entingly extravagant: You want to prove that there is
one counterexample, and you prove it by showing that
there are lots of counterexamples. (Indeed, that “al-
most everything” is a counterexample.)
But there you go: sometimes it’s easier to show that there
is at least one thing that has a property by showing that
i) very few things don’t have the property, and ii) there
are lots of things.
17
OK, so:
Central for us will be counting arguments that involve
finite and infinite collections:
i) we know that at least one A is not a B if we can show
that there are infinitely many A’s but only finitely many
B’s.
ii) We can be sure that some A is not a B if there are
infinitely many B’s but the set of A’s is - so to speak -
even more infinite.
To understand this last point, I’ll have to explain what
is meant by ”more infinite”, or as we’ll put it from now
on: “is larger”, or “is bigger” or (more exactly): “has a
greater cardinality”.
18
2.1 Size of infinite sets
First for some conceptual analysis:
Many ideas that clump together when we deal with sim-
ple everyday concepts come apart when we consider infi-
nite sets.
So, for example, there are several different senses of “size”
when we’re speaking of collections, so the first job is to
be clear about what we mean.
When are two collections “the same size” or “different
sizes” in the relevant sense? When is one set “bigger”
than another?
This can require some delicate surgery on ordinary con-
cepts.
19
One natural candidate (not the one we’ll use) is given
by the subset relation: we might naturally say that A is
bigger than B if B ⊂ A and A ̸⊂ B.
But there are other ways to productively understand “big-
ger” and “smaller”; which works best will depend on the
topic and the problems being addressed.
Here we’ll be considering the size of sets in a sense de-
fined by the possibilities of pairing up members of sets
into something like a list indexed by one of the sets.
20
The core idea is simple enough: you can tell if you have
(say) more knives than forks if you pair them up, setting
each knife beside exactly one fork.
If you can match them up exactly, with no forks or knives
left over, then you have the same number of knives as
forks. If you can’t set up such a one-to-one pairing, then
there is more in the set with a few things left over.
21
Preliminary Definitions:
We say f is 1-1 (aka injective) iff f maps every element
of the domain onto a distinct value in the range.
That is: if ∀x∀y(x ̸= y → f (x) ̸= f (y))
When every member of the range R has some element
of the domain D paired to it by f , we say f is an onto
function (aka surjective) and that it maps D onto R.
That is: f is onto if ∀y ∈ R ∃x ∈ D (f (x) = y).
A function that is both 1-1 and onto is called in the cur-
rent terminology bijective.
22
Here’s a handy picture I found online to illustrate:
The first two diagrams illustrate that an onto/surjective
function need not be 1-1/injective, and a 1-1/injective
function need not be onto/surjective.
23
2.2 Definition of size/cardinality
Z and Y are the same size (or: have the same number
of elements or have the same cardinality) if there is a
one-to-one function mapping Z onto Y so that every ele-
ment of Y is the partner of some element of Z.
Z is bigger than Y (or: has more elements than Y, or
has a greater cardinality) if:
i) there is a one-to-one and onto function mapping some
subset of Z onto Y so that every element of Y is the part-
ner of some element of Z, but
ii) there is no one-to-one and onto function mapping all
of Z onto Y so that every element of Y is the partner of
some element of Z.
24
This fits with the way we would use these words with
everyday finite sets:
If you can set every fork beside a unique knife, but you
can’t pair up every knife beside a unique fork without
having some knives left over, then you have more knives
than forks.
These definitions also apply to infinite sets.
25
With this understanding of the relevant concepts, any in-
finite set has more members than any finite set, which is
what we would want.
It also turns out that many infinite sets have “the same
size” in the one-to-one function sense, even if they have
different sizes in some other senses.
An easy, familiar example is that the even numbers have
the same size as the natural numbers N. Let f be the
function f (x) = 2x. This pairs up the even and natural
numbers like this:
0↔0
1↔2
2↔4
3↔6
4↔8
...... ↔ ......
26
Since {x/x is even} ⊂ N, but {x/x is even} ̸⊃ N this is
an example of two sets which are different sizes in one
sense, but the same size in the sense we are currently us-
ing.
Some terminology will be useful: if a set S is finite or
the same size as the natural numbers N, we say that S is
countable. (BJB also use “enumerable”.)
A set that isn’t countable, we’ll call uncountable (or:
non-enumerable).
When an enumerable set is infinite, we call it “denumer-
able” or “enumerably infinite”.
NOTATION:
When we want to have an expression for the cardinality
of a set A in symbols, we write: |A|
27
It might be a little surprizing to learn that the positive
rational numbers (standardly written as Q+, for “quo-
tients”, the “+” indicating the positive ones) are the same
size as the natural numbers N.
It’s easy to show this. Every rational number can be
written as a fraction m
n.
To avoid duplicates like 12 and 42 , say that we consider
only the fraction in which the numerator and denomina-
tor are in lowest terms.
Then we can define: f ( m m n +
n ) = 2 · 3 . f maps Q 1-1 into
N.
The image of f is a proper subset of N - it contains just
natural numbers that are only evenly divisible by 2 or 3
- but it is easy to use f to define the function f ′ onto the
whole set N:
f ′( m m
n ) = the number k such that f ( n ) is the k’th number
in the image of f .
28
On reflection, it might seem not so surprizing after all
that Q+ and N have the same size.
After all, they are infinite. Infinite is as big as you can
get, right? You can’t get bigger than infinity, right? So
you might want to say: shouldn’t all infinite sets be the
same size?
Well, I’ve been giving spoilers all along and ruining the
suspense: as I mentioned above, some infinite sets are
bigger than others.
29
2.3 Proof that the power set of N has a greater cardinality than
N
In a few slides I will show that the set of real numbers R
is bigger than N and even that the set of real numbers
between zero and one is bigger than N.
But first I’ll consider a related argument; for which I’ll
first need some some terminology:
The power set P(X) of a set X is the set of subsets of X.
In symbols, P(X) = {Y |Y ⊆ X}.
For example, the power set of the set {0, 1, 2} is:
P({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}
Note that the power set includes the empty set ∅ and the
entire set {0, 1, 2}.
30
For finite sets, P(X) always has a greater cardinality
than X.
(In symbols: |X| < |P(X)|)
Examples:
|∅| = 0; |P(∅)| = |{∅}| = 1
|{0}| = 1; |P({0})| = |{∅, {0}}| = 2
|{0, 1}| = 2; |P({0, 1})| = |{∅, {0}, {1}, {0, 1}}| = 4
|{0, 1, 2}| = 3;
|P({0, 1, 2})| = |{∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}|
=8
In fact, you can give a precise numerical relationship in
the finite case: |P(X)| = 2|X|
31
Likewise, in the infinite case, |X| < |P(X)|
I’ll prove this for the particular infinite set that most in-
terests us, N.
Claim: There is no 1 - 1, onto function f mapping N
onto P(N).
Proof of the claim:
Here is how this proof works: you assume that there is
such a function f and you derive a contradiction from
that assumption. Thus you can conclude the original
assumption is untrue. (This is known as a proof by con-
tradiction, or, to use the classical phrase, Reductio ad
absurdum).
32
Assumption (To be reduced to a contradiction): Say
that there is a one-one, onto function f , such that:
f : N → P(N).
Every set in P(N) is therefore assigned exactly one, unique,
number in N.
To choose an arbitrary example for illustration, the first
few entries of such a list might be:
0↔∅
1 ↔ {1, 3}
2 ↔ {2, 3, 5}
3 ↔ {x| x is even}
4 ↔ {x| x is odd}
...... ↔ ......
33
Since each number n is assigned a subset f (n) ⊂ N, we
can separate N into two categories: those numbers n that
are members of f (n), and those numbers n that are not
members of f (n).
Let’s look more closely at the set of numbers n that are
not in the corresponding f (n).
That is, let’s look at the set we’ll call D (for “diagonal
set”):
D = {n | n ∈ N & n ∈
/ f (n)}
34
D is a set of numbers; that is, D ⊆ N.
In other words, D is a member of P(N).
So D must be paired with some number k by f . (That
is: f (k) = D for some k ∈ N.)
Let k̃ be the number such that:
f (k̃) = D = {n| n ∈ N & n ∈
/ f (n)}.
We get the contradiction we are looking for if we ask the
obvious question:
Is k̃ an element of {n | n ∈ N & n ∈
/ f (n)}? That is: is
k̃ ∈ f (k̃)?
35
(Carrying over from last slide:) Is k̃ an element of
{n | n ∈ N & n ∈
/ f (n)}? That is: is k̃ ∈ f (k̃)?
If we say yes, then we have to say no, and if we say no,
then we have to say yes! More explicitly:
Possibility 1: Say that k̃ ∈ f (k̃).
(In other words: k̃ ∈ {n | n ∈ N & n ∈
/ f (n)})
That means, it is not true that k̃ ∈
/ f (k̃)
But then, by the definition of the set
{n |n ∈ N & n ∈/ f (n)}, we know that:
k̃ ∈
/ {n | n ∈ N & n ∈
/ f (n)}
But f (k̃) = {n | n ∈ N & n ∈
/ f (n)}, so:
k̃ ∈
/ f (k̃), which contradicts what we assumed.
36
Possibility 2: On the other hand, say that k̃ ̸∈ f (k̃).
(In other words: k̃ ∈
/ {n | n ∈ N & n ∈
/ f (n)})
But then, by the definition of the set {n | n ∈ N & n ∈
/
f (n)}, we know that:
k̃ ∈ {n | n ∈ N & n ∈
/ f (n)}
But f (k̃) = {n | n ∈ N & n ∈
/ f (n)}, so:
k̃ ∈ f (k̃), which contradicts what we assumed.
So it is impossible for k̃ to be either a member or not a
member of {n | n ∈ N & n ∈ / f (n)}
This is the contradiction we’ve been looking for.
37
We got this contradiction by assuming that we could find
some 1-1, onto function f from N to P(N).
We can therefore conclude that there is no such func-
tion.
It’s easy to find a 1-1, onto function from a subset of
P(N) onto N so:
We can conclude that in the relevant sense, P(N) has a
greater cardinality (“is bigger”) than N.
38
An aside about generality:
To be properly aware of the logical structure of an argu-
ment, you need to always ask yourself “Where does this
particular fact get used?” Perhaps the argument is more
general than you realize.
If you think that way about the argument we’ve just
looked at, you’ll ask “Where do we use the fact that the
set we are dealing with is N?”
In fact, we don’t use that fact anywhere: this argument
gives a general proof, for any set X (finite or infinite),
that P(X) is bigger than X.
39
3 The Real Numbers R are Uncountable. Why They Call it a
“Diagonal Argument”
The name “diagonal argument” was originally prompted
the picture that emerges when you represent the key con-
struction of this proof visually.
I will show not just that R is uncountable, but that a
part of R - the real numbers in the interval (0, 1) - is
uncountable.
Using standard notation, (0, 1) = {x ∈ R | 0 < x < 1}
(The uncountability of R obviously follows from the un-
countability of a subset of R.)
40
We proceed as before. First: Assume (in order to pro-
duce a contradiction) that there is a 1-1, onto function f
with:
1−1
f : N −−→ (0, 1)
onto
We can represent any real number between 0 and 1 as an
infinite decimal expansion r = 0.a0a1a2a3 . . . an . . ..
To avoid duplicate representations, exclude all expansions
that end in an infinite string of 9’s; the decimal represen-
tation is therefore unique.
41
We can visualize the function f as an infinite list, with
all the natural numbers on the left, and all the decimal
expansions representing real numbers between 0 and 1 on
the right:
0 ↔ 0.a00a10a20a30a40 . . . an0 . . .
1 ↔ 0.a01a11a21a31a41 . . . an1 . . .
2 ↔ 0.a02a12a22a32a42 . . . an2 . . .
3 ↔ 0.a03a13a23a33a43 . . . an3 . . .
4 ↔ 0.a04a14a24a34a44 . . . an4 . . .
...... ↔ ...... ...
n ↔ 0.a0na1na2na3na4n . . . ann . . .
...... ↔ ...... ...
42
Now we want to produce a real number between 0 and 1
that isn’t on the list.
First let’s single out all the digits of the form aii. That
would trace out the diagonal in the picture, as indicated
by the highlighted digits in the diagram below.
0 ↔ 0.a00a10a20a30a40 . . . an0 . . .
1 ↔ 0.a01a11a21a31a41 . . . an1 . . .
2 ↔ 0.a02a12a22a32a42 . . . an2 . . .
3 ↔ 0.a03a13a23a33a43 . . . an3 . . .
4 ↔ 0.a04a14a24a34a44 . . . an4 . . .
...... ↔ ...... ...
n ↔ 0.a0na1na2na3na4n . . . ann . . .
...... ↔ ...... ...
We’ll produce a number that will differ from the nth real
number on the list, at the nth place.
43
Our number is b = 0.b0b1b2b3b4 . . . bn . . ., where:
For every i, (
6 if aii = 5
bi =
5 if aii ̸= 5
b cannot be on the list given by f , since for every n, b
would differ from f (n) at the nth place.
1−1
Therefore there can be no such f : N −−→ (0, 1)
onto
We can find many 1-1 functions f that map N onto a
1
subset of (0,1), for example f (x) = x+2 .
and (0,1) is a subset of R, |N| < |(0, 1)| ≤ |R|.
Therefore, R has a larger cardinality than N.
44
4 The Countability of the Language of First-Order Logic
4.1 A Useful Coding Tool: The Prime Decomposition Theorem
and Coding Arbitrarily Long Finite Sequences
At various points in the course it will be important to
know that certain sets are enumerable, notably the set of
formulae in a first order language (particularly the lan-
guage of arithmetic) and the set of all possible Turing
machines.
This is crucial because one of the core strategies for rea-
soning about arithmetic will be to assign natural number
codes to every formula in the language of arithmetic, so
that we can express facts about the language of arith-
metic as statements about natural numbers that can be
proven or disproven.
Similarly, we’ll assign numerical codes to every Turing
machine program, so that operations that take Turing
machines and make other Turing machines out of them
can be duplicated by Turing machines operating on codes.
How can we show such a coding to be possible?
45
The strategy will be simple: first, the relevant language
(for arithemetic, or for Turing machine programs) will
have an enumerable vocabulary.
I’ll keep the story simple right now, and we can refine it
later for specific problems.
To illustrate, I’ll use a very simple language: The set of
all strings of letters from a given alphabet.
I’ll assume the alphabet is countably infinite:
{a1, a2, a3, . . . , an, . . .}
(The same tricks work for a finite alphabet.)
46
So we first create an initial, preliminary coding: Assign
a number > 0 to every symbol in the vocabulary.
(In this example, each symbol ai is coded by its subscript
i.)
(The restriction “> 0” isn’t essential, but it avoids some
unneeded complications.)
Then we can associate strings of symbols by sequences of
numbers:
ai1 ai2 ai3 . . . ain ↔ < i1, i2, i3, . . . in >
So for example a2a2a15a8 is assigned
< 2, 2, 15, 8 >
This assigns every string a unique sequence of natural
numbers.
To get the coding we want we just need to have a way of
coding finite sequences of numbers (of arbitrary length).
47
BJB p. 12-13 discuss a few ways to do this coding; I’ll
use the simplest of their alternatives here.
Let f¯ associate with every sequence of natural numbers
a product of prime powers this way:
f¯ :< i1, i2, i3, . . . in >= 2i1 × 3i2 × 5i3 × . . . × pinn
where pn is the nth prime number in order of size.
Since every natural number has a unique representation
in terms of prime powers, f¯ assigns each sequence a
unique code.
For example, f¯(< 2, 2, 15, 8 >) = 22 × 32 × 515 × 78
48
f¯ as defined isn’t an onto function, since there are prod-
ucts of prime powers that don’t correspond under f¯ to
sequences of natural numbers greater than 0.
However, it is easy to use f¯ to define a 1-1, onto func-
tion that assigns every natural number a unique sequence
and conversely. I’ll leave it to you to think about how this
might be done: there are a bunch of different ways.
For our purposes here it will suffice to know that it can
be done.
49
A key fact: not only does the procedure prove that there
is a function
1−1
f : {< m1, m2, . . . mn > |n ∈ N, ∀i, mi ∈ N} −−→ N,
onto
the procedure allows you to mechanically produce the
code of a given n-tuple of natural numbers, and mechan-
ically produce the coded n-tuple if you are given a natural
number.
(From the point of view of practical computation, this
procedure is unfeasibly slow, but we’re concerned here
just with what can be done in principle by a machine,
ignoring limitations of time and practical computational
resources.)
We can use this technique to code up the descriptions of
machines, and then we not only have a way of assigning
numbers to machines: we will have a way of moving from
a given number to a description of the program of the
machine it codes, and back again, in a way that the ma-
chine itself can carry out.
50
4.1.1 Sequences of sentences in a language with a denumerable
vocabulary
If we have numerical codes for formulae, we can then use
the trick for coding arbitrarily long finite sequences to
code up sequences of formulae.
Since a proof is a sequence of formulae satisfying certain
conditions, that means we will be able to code up the
proofs in a theory formulated in that language.
If the conditions for a sequence to be a proof are formal,
and simple enough, we can also do this mechanically.
51
Care with the bookkeeping will be needed if you want to
code up both formulae and sequences of them.
You could, for example, use a marker at the beginning,
to indicate whether or not the number is meant as a code
of a formula or a sequence.
For example, you might make the exponent on 2 the
marker: if the code’s prime factorization begins with 21,
it will count as the code of a formula/string of symbols
and if it begins with 22 it will count as the code of a se-
quence of formulae/strings of symbols.
52
5 Counting argument to prove the existence of transcendental
numbers
I want to give an example of how we can prove non-trivial
things with counting arguments (where those “non-trivial
things” don’t obviously have anything to do with cardi-
nality).
First some definitions.
An “algebraic number” is a real number that is the so-
lution to a polynomial:
anxn + an−1xn−1 + an−2xn−2 + . . . + a1x + a0 = 0,
where the coefficients (i.e. the ai’s for i = 0 to n) are ra-
tional numbers and the polynomial isn’t zero everywhere.
Recall that rational numbers are the members of the set
Q = { ab | a, b ∈ Z}, where Z is the integers.
Every rational number is algebraic, √ but not all algebraic
numbers are rational. For example, 2 is algebraic, since
it’s a solution to x2 = 2 but it isn’t rational.
53
Terminology: a non-algebraic real number is called tran-
scendental.
The mathematician Liouville produced the first exam-
ples of transcendental numbers in the 1840s. These were
specifically designed to be transcendental, and the proofs
that they are transcendental are quite intricate.
The first numbers arising “in nature” to be proved tran-
scendental were e and π. Both of these proofs are also
quite intricate.
I will give a really quite simple proof that there are tran-
scendental numbers.
54
The proof is “non-constructive”, which means that it
proves something exists, but it doesn’t provide a way to
produce an example of it.
I’ll show that the set of real numbers is bigger than the
set of algebraic numbers, which means there is at least
one real number that isn’t algebraic.
(It often turns out to be easier to prove the existence of
lots of things of a given type than it is to find just one.)
55
5.1 Proof that there is at least one real number that is not alge-
braic. (Skipped for time, but included here for the curious.)
Prove: There is at least one real number that is not
algebraic.
Proof:
Since we already know the real numbers are uncountable,
we only need to prove that the set of algebraic numbers
is countable. Then we know that the algebraic numbers
can’t be all the real numbers.
First strategy you try: is to take the polynomials to
be determined by the (n+1)-tuple of their coefficients:
< a0, a1, . . . an > and count those n-tuples, in the way
we counted such sequences in the previous subsection.
56
But this requires some finesse, since:
i) many (in fact, most) such polynomials with rational co-
efficients will have several solutions in the real numbers
(though a polynomial of degree n has at most n distinct
solutions in R)
ii) a given algebraic number will be the solution to several
different polynomials and
iii) some polynomials ((x2 + 1 = 0, for example) have no
real number solution.
So we need to take some care with the bookkeeping - just
counting the polynomials won’t be quite enough.
57
There are a bunch of ways to fix this little bump in the
road. The strategy I’ll use is one that can be put to use
in a lot of different problems.
You can, so to speak, catch the number you want in a
vice, by showing that there are at most that number,
and also at least that number.
Specifically, we’ll show that the set of algebraic numbers
has at least as many elements as N and at most as many
elements as N, which will let us conclude it must have ex-
actly the same number of elements as N.
The “at least” part is trivial, since every natural number
n is the solution to x − n = 0, so each natural number
is algebraic and corresponds to a unique polynomial with
rational coefficients.
58
Now for the “at most” part.
You you can allow for the fact that most of the polyno-
mials will have several solutions by counting each poly-
nomial of degree n as really n separate objects, because
it could correspond to as many as n distinct algebraic
numbers.
That is, we count each polynomial as having the maxi-
mum number of distinct real solutions.
In most cases, this will be an over-estimate, but that is
OK. The point is that there are no more algebraic num-
bers than there are n + 2 tuples of this type.
It will turn out that even by massively overshooting, we’ll
get an estimate that is at most the size of N.
It’s easy enough to do this: Instead of the (n+1)-tuple
< a0, a1, . . . an >, consider the n (n + 2)-tuples
< a0, a1, . . . an, i > for 1 ≤ i ≤ n.
59
So let’s count all the (n + 2)−tuples. Again there are lots
of ways you might do this.
One simple way is to replace each rational number with a
unique natural number (to avoid complications with frac-
tional and negative exponents) and then count the tuples
of natural numbers using unique prime decomposition of
natural numbers.
60
First step: Let every rational number be written as ab ,
in lowest terms, and associate every ab with the (unique)
natural number 2|a| × 3|b| × 5c where c = 0 if ab is positive
and c = 1 if it is negative.
(Recall that |a| means “the absolute value of a”.)
It will be convenient to have a short way of referring to
the natural number associated with a given rational num-
ber r, so let’s call it nr .
Now we repeat the trick for coding up arbitrarily long
finite sequences of numbers:
Associate with each (n + 2)−tuple < r0, r1, . . . rn, i >
the natural number.
2nr0 × 3nr1 × 5nr2 × . . . × prn+1
n
× pin+2
(Where, again, pi is the ith prime number.)
61
This associates a unique natural number to each (n + 2)-
tuple, and hence n distinct natural numbers to each poly-
nomial with rational coefficients. (Where each of the n
are assigned only to that polynomial.)
Hence the set of such polynomials (counted n times) has
the same cardinality as a subset of N, so it must be at
most as large as N.
Since there are at most as many algebraic numbers as
there are polynomials with coefficients in Q counted n
times, that means there are at most as many algebraic
numbers as natural numbers.
Since, as we showed above, there are also at least as
many algebraic numbers as natural numbers, that means
there are exactly as many natural numbers as algebraic
numbers.
Since there are uncountably many real numbers, there
must be at least one real number that is not an algebraic
number.
Q.E.D.
62