Open Logic Debug
Open Logic Debug
Debug Build
1 Sets 20
1.1 Extensionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2 Subsets and Power Sets . . . . . . . . . . . . . . . . . . . . . . 21
1.3 Some Important Sets . . . . . . . . . . . . . . . . . . . . . . . 23
1.4 Unions and Intersections . . . . . . . . . . . . . . . . . . . . . 24
1.5 Pairs, Tuples, Cartesian Products . . . . . . . . . . . . . . . . 27
1.6 Russell’s Paradox . . . . . . . . . . . . . . . . . . . . . . . . . 28
2 Relations 30
2.1 Relations as Sets . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2 Philosophical Reflections . . . . . . . . . . . . . . . . . . . . . 32
2.3 Special Properties of Relations . . . . . . . . . . . . . . . . . . 33
2.4 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . 34
2.5 Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.6 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.7 Operations on Relations . . . . . . . . . . . . . . . . . . . . . 38
3 Functions 39
3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Kinds of Functions . . . . . . . . . . . . . . . . . . . . . . . . 41
3.3 Functions as Relations . . . . . . . . . . . . . . . . . . . . . . 43
3.4 Inverses of Functions . . . . . . . . . . . . . . . . . . . . . . . 44
3.5 Composition of Functions . . . . . . . . . . . . . . . . . . . . . 46
3.6 Partial Functions . . . . . . . . . . . . . . . . . . . . . . . . . 47
1
CONTENTS
5 Arithmetization 72
5.1 From N to Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.2 From Z to Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.3 The Real Line . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.4 From Q to R . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.5 Some Philosophical Reflections . . . . . . . . . . . . . . . . . . 78
5.6 Ordered Rings and Fields . . . . . . . . . . . . . . . . . . . . . 80
5.7 Appendix: the Reals as Cauchy Sequences . . . . . . . . . . . 83
6 Infinite Sets 87
6.1 Hilbert’s Hotel . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
6.2 Dedekind Algebras . . . . . . . . . . . . . . . . . . . . . . . . 88
6.3 Arithmetical Induction . . . . . . . . . . . . . . . . . . . . . . 90
6.4 Dedekind’s “Proof” . . . . . . . . . . . . . . . . . . . . . . . . 91
6.5 Appendix: Proving Schröder-Bernstein . . . . . . . . . . . . . 93
II Propositional Logic 95
11 Tableaux 147
11.1 Rules and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . 147
11.2 Propositional Rules . . . . . . . . . . . . . . . . . . . . . . . . 148
11.3 Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
11.4 Examples of Tableaux . . . . . . . . . . . . . . . . . . . . . . . 150
11.5 Proof-Theoretic Notions . . . . . . . . . . . . . . . . . . . . . 155
11.6 Derivability and Consistency . . . . . . . . . . . . . . . . . . . 158
11.7 Derivability and the Propositional Connectives . . . . . . . . . 159
11.8 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
21 Tableaux 292
21.1 Rules and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . 292
21.2 Propositional Rules . . . . . . . . . . . . . . . . . . . . . . . . 293
21.3 Quantifier Rules . . . . . . . . . . . . . . . . . . . . . . . . . . 294
21.4 Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
21.5 Examples of Tableaux . . . . . . . . . . . . . . . . . . . . . . . 296
21.6 Tableaux with Quantifiers . . . . . . . . . . . . . . . . . . . . 301
21.7 Proof-Theoretic Notions . . . . . . . . . . . . . . . . . . . . . 305
21.8 Derivability and Consistency . . . . . . . . . . . . . . . . . . . 308
21.9 Derivability and the Propositional Connectives . . . . . . . . . 309
21.10 Derivability and the Quantifiers . . . . . . . . . . . . . . . . . 312
21.11 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
21.12 Tableaux with Identity predicate . . . . . . . . . . . . . . . . 316
V Computability 398
32 Undecidability 470
32.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
32.2 Enumerating Turing Machines . . . . . . . . . . . . . . . . . . 472
32.3 Universal Turing Machines . . . . . . . . . . . . . . . . . . . . 474
35 Representability in Q 522
35.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
35.2 Functions Representable in Q are Computable . . . . . . . . . 525
35.3 The Beta Function Lemma . . . . . . . . . . . . . . . . . . . . 526
35.4 Simulating Primitive Recursion . . . . . . . . . . . . . . . . . 529
35.5 Basic Functions are Representable in Q . . . . . . . . . . . . . 530
35.6 Composition is Representable in Q . . . . . . . . . . . . . . . 532
35.7 Regular Minimization is Representable in Q . . . . . . . . . . 534
35.8 Computable Functions are Representable in Q . . . . . . . . . 537
35.9 Representing Relations . . . . . . . . . . . . . . . . . . . . . . 538
35.10 Undecidability . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
41 Introduction 581
41.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
41.2 The Syntax of the Lambda Calculus . . . . . . . . . . . . . . . 582
41.3 Reduction of Lambda Terms . . . . . . . . . . . . . . . . . . . 584
42 Syntax 593
42.1 Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
42.2 Unique Readability . . . . . . . . . . . . . . . . . . . . . . . . 594
42.3 Abbreviated Syntax . . . . . . . . . . . . . . . . . . . . . . . . 595
42.4 Free Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
42.5 Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
42.6 α-Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
42.7 The De Bruijn Index . . . . . . . . . . . . . . . . . . . . . . . 604
42.8 Terms as α-Equivalence Classes . . . . . . . . . . . . . . . . . 605
42.9 β-reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
42.10 η-conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
55 Introduction 741
55.1 Constructive Reasoning . . . . . . . . . . . . . . . . . . . . . . 741
55.2 Syntax of Intuitionistic Logic . . . . . . . . . . . . . . . . . . . 743
55.3 The Brouwer–Heyting–Kolmogorov Interpretation . . . . . . . 744
55.4 Natural Deduction . . . . . . . . . . . . . . . . . . . . . . . . 746
55.5 Axiomatic Derivations . . . . . . . . . . . . . . . . . . . . . . 749
56 Semantics 750
56.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
56.2 Relational models . . . . . . . . . . . . . . . . . . . . . . . . . 752
56.3 Semantic Notions . . . . . . . . . . . . . . . . . . . . . . . . . 753
56.4 Topological Semantics . . . . . . . . . . . . . . . . . . . . . . 754
XIIICounterfactuals 777
59 Introduction 777
59.1 The Material Conditional . . . . . . . . . . . . . . . . . . . . . 777
59.2 Paradoxes of the Material Conditional . . . . . . . . . . . . . 779
59.3 The Strict Conditional . . . . . . . . . . . . . . . . . . . . . . 779
59.4 Counterfactuals . . . . . . . . . . . . . . . . . . . . . . . . . . 782
63 Ordinals 808
63.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
63.2 The General Idea of an Ordinal . . . . . . . . . . . . . . . . . 808
63.3 Well-Orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
63.4 Order-Isomorphisms . . . . . . . . . . . . . . . . . . . . . . . . 810
63.5 Von Neumann’s Construction . . . . . . . . . . . . . . . . . . 812
63.6 Basic Properties of the Ordinals . . . . . . . . . . . . . . . . . 813
63.7 Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
63.8 ZF− : a milestone . . . . . . . . . . . . . . . . . . . . . . . . . 817
63.9 Ordinals as Order-Types . . . . . . . . . . . . . . . . . . . . . 817
63.10 Successor and Limit Ordinals . . . . . . . . . . . . . . . . . . 818
65 Replacement 828
65.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
65.2 The Strength of Replacement . . . . . . . . . . . . . . . . . . 828
65.3 Extrinsic Considerations . . . . . . . . . . . . . . . . . . . . . 829
65.4 Limitation-of-size . . . . . . . . . . . . . . . . . . . . . . . . . 831
65.5 Replacement and “Absolute Infinity” . . . . . . . . . . . . . . 832
65.6 Replacement and Reflection . . . . . . . . . . . . . . . . . . . 834
65.7 Appendix: Results surrounding Replacement . . . . . . . . . . 834
65.8 Appendix: Finite axiomatizability . . . . . . . . . . . . . . . . 837
67 Cardinals 846
67.1 Cantor’s Principle . . . . . . . . . . . . . . . . . . . . . . . . . 846
67.2 Cardinals as Ordinals . . . . . . . . . . . . . . . . . . . . . . . 847
67.3 ZFC: A Milestone . . . . . . . . . . . . . . . . . . . . . . . . 849
67.4 Finite, Enumerable, Non-enumerable . . . . . . . . . . . . . . 849
67.5 Appendix: Hume’s Principle . . . . . . . . . . . . . . . . . . . 851
69 Choice 862
69.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
69.2 The Tarski–Scott Trick . . . . . . . . . . . . . . . . . . . . . . 862
69.3 Comparability and Hartogs’ Lemma . . . . . . . . . . . . . . . 863
69.4 The Well-Ordering Problem . . . . . . . . . . . . . . . . . . . 865
69.5 Countable Choice . . . . . . . . . . . . . . . . . . . . . . . . . 866
69.6 Intrinsic Considerations about Choice . . . . . . . . . . . . . . 868
69.7 The Banach–Tarski Paradox . . . . . . . . . . . . . . . . . . . 869
69.8 Appendix: Vitali’s Paradox . . . . . . . . . . . . . . . . . . . 871
XV Methods 875
70 Proofs 875
70.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875
70.2 Starting a Proof . . . . . . . . . . . . . . . . . . . . . . . . . . 876
70.3 Using Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 877
70.4 Inference Patterns . . . . . . . . . . . . . . . . . . . . . . . . . 878
70.5 An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
70.6 Another Example . . . . . . . . . . . . . . . . . . . . . . . . . 887
70.7 Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . 889
70.8 Reading Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . 892
70.9 I Can’t Do It! . . . . . . . . . . . . . . . . . . . . . . . . . . . 894
70.10 Other Resources . . . . . . . . . . . . . . . . . . . . . . . . . . 895
71 Induction 895
71.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895
71.2 Induction on N . . . . . . . . . . . . . . . . . . . . . . . . . . 896
71.3 Strong Induction . . . . . . . . . . . . . . . . . . . . . . . . . 898
71.4 Inductive Definitions . . . . . . . . . . . . . . . . . . . . . . . 899
71.5 Structural Induction . . . . . . . . . . . . . . . . . . . . . . . 902
71.6 Relations and Functions . . . . . . . . . . . . . . . . . . . . . 903
XVIHistory 906
72 Biographies 906
72.1 Georg Cantor . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
72.2 Alonzo Church . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
72.3 Gerhard Gentzen . . . . . . . . . . . . . . . . . . . . . . . . . 908
72.4 Kurt Gödel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
72.5 Emmy Noether . . . . . . . . . . . . . . . . . . . . . . . . . . 910
72.6 Rózsa Péter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
72.7 Julia Robinson . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
72.8 Bertrand Russell . . . . . . . . . . . . . . . . . . . . . . . . . . 915
72.9 Alfred Tarski . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
72.10 Alan Turing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
72.11 Ernst Zermelo . . . . . . . . . . . . . . . . . . . . . . . . . . . 918
XVII
Reference 930
Bibliography 933
This file loads all content included in the Open Logic Project. Editorial
notes like this, if displayed, indicate that the file was compiled without any
thought to how this material will be presented. If you can read this, it is
probably not advisable to teach or study from this PDF.
The Open Logic Project provides many mechanisms by which a text
can be generate which is more appropriate for teaching or self-study. For
instance, by default, the text will make all logical operators primitives and
carry out all cases for all operators in proofs. But it is much better to
leave some of these cases as exercises. The Open Logic Project is also a
work in progress. In an effort to stimulate collaboration and improvement,
material is included even if it is only in draft form, is missing exercises,
etc. A PDF produced for a course will exclude these sections.
To find PDFs more suitable for teaching and studying, have a look at
the sample courses available on the OLP website. To make your own, you
might start from the sample driver file or look at the sources of the derived
textbooks for more fancy and advanced examples.
Chapter 1
Sets
content/sets-functions-relations/sets/basics.tex
1.1 Extensionality
A set is a collection of objects, considered as a single object. The objects sfr:set:bas:
sec
making up the set are called elements or members of the set. If x is an element
of a set A, we write x ∈ A; if not, we write x ∈ / A. The set which has no
elements is called the empty set and denoted “∅”.
explanation It does not matter how we specify the set, or how we order its elements, or
indeed how many times we count its elements. All that matters are what its
elements are. We codify this in the following principle.
Definition 1.1 (Extensionality). If A and B are sets, then A = B iff every
element of A is also an element of B, and vice versa.
20
1.2. SUBSETS AND POWER SETS
This delivers on the point that, when we consider sets, we don’t care about the
order of their elements, or how many times they are specified.
Example 1.2. Whenever you have a bunch of objects, you can collect them
together in a set. The set of Richard’s siblings, for instance, is a set that
contains one person, and we could write it as S = {Ruth}. The set of positive
integers less than 4 is {1, 2, 3}, but it can also be written as {3, 2, 1} or even as
{1, 2, 1, 2, 3}. These are all the same set, by extensionality. For every element
of {1, 2, 3} is also an element of {3, 2, 1} (and of {1, 2, 1, 2, 3}), and vice versa.
Frequently we’ll specify a set by some property that its elements share.
We’ll use the following shorthand notation for that: {x : φ(x)}, where the
φ(x) stands for the property that x has to have in order to be counted among
the elements of the set.
Example 1.3. In our example, we could have specified S also as
S = {x : x is a sibling of Richard}.
Example 1.4. A number is called perfect iff it is equal to the sum of its
proper divisors (i.e., numbers that evenly divide it but aren’t identical to the
number). For instance, 6 is perfect because its proper divisors are 1, 2, and 3,
and 6 = 1 + 2 + 3. In fact, 6 is the only positive integer less than 10 that is
perfect. So, using extensionality, we can say:
We read the notation on the right as “the set of x’s such that x is perfect and 0 ≤
x ≤ 10”. The identity here confirms that, when we consider sets, we don’t care
about how they are specified. And, more generally, extensionality guarantees
that there is always only one set of x’s such that φ(x). So, extensionality
justifies calling {x : φ(x)} the set of x’s such that φ(x).
Extensionality gives us a way for showing that sets are identical: to show
that A = B, show that whenever x ∈ A then also x ∈ B, and whenever y ∈ B
then also y ∈ A.
Problem 1.1. Prove that there is at most one empty set, i.e., show that if A
and B are sets without elements, then A = B.
content/sets-functions-relations/sets/subsets.tex
Example 1.6. Every set is a subset of itself, and ∅ is a subset of every set.
The set of even numbers is a subset of the set of natural numbers. Also,
{a, b} ⊆ {a, b, c}. But {a, b, e} is not a subset of {a, b, c}.
Example 1.7. The number 2 is an element of the set of integers, whereas the
set of even numbers is a subset of the set of integers. However, a set may happen
to both be an element and a subset of some other set, e.g., {0} ∈ {0, {0}} and
also {0} ⊆ {0, {0}}.
℘(A) = {B : B ⊆ A}
Example 1.11. What are all the possible subsets of {a, b, c}? They are: ∅,
{a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}. The set of all these subsets is
℘({a, b, c}):
℘({a, b, c}) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, {a, b, c}}
Problem 1.3. Show that if A has n elements, then ℘(A) has 2n elements.
content/sets-functions-relations/sets/important-sets.tex
N = {0, 1, 2, 3, . . .}
the set of natural numbers
Z = {. . . , −2, −1, 0, 1, 2, . . .}
the set of integers
Q= {m/n : m, n ∈ Z and n ̸= 0}
the set of rationals
R = (−∞, ∞)
the set of real numbers (the continuum)
These are all infinite sets, that is, they each have infinitely many elements.
As we move through these sets, we are adding more numbers to our stock.
Indeed, it should be clear that N ⊆ Z ⊆ Q ⊆ R: after all, every natural number
is an integer; every integer is a rational; and every rational is a real. Equally,
it should be clear that N ⊊ Z ⊊ Q, since −1 is an integer but not a natural
number, and 1/2 is rational but not integer. It is less obvious that Q ⊊ R, i.e.,
that there are some real numbers which are not rational.
We’ll sometimes also use the set of positive integers Z+ = {1, 2, 3, . . . } and
the set containing just the first two natural numbers B = {0, 1}.
Example 1.14 (Infinite sequences). For any set A we may also consider
the set Aω of infinite sequences of elements of A. An infinite sequence a1 a2 a3 a4 . . .
consists of a one-way infinite list of objects, each one of which is an element
of A.
Figure 1.1: The union A ∪ B of two sets is set of elements of A together with
those of B.
sfr:set:uni:
fig:union
content/sets-functions-relations/sets/unions-and-intersections.tex
A ∪ B = {x : x ∈ A ∨ x ∈ B}
Example 1.16. Since the multiplicity of elements doesn’t matter, the union
of two sets which have an element in common contains that element only once,
e.g., {a, b, c} ∪ {a, 0, 1} = {a, b, c, 0, 1}.
The union of a set and one of its subsets is just the bigger set: {a, b, c} ∪
{a} = {a, b, c}.
The union of a set with the empty set is identical to the set: {a, b, c} ∪ ∅ =
{a, b, c}.
explanation We can also consider a “dual” operation to union. This is the operation
that forms the set of all elements that are elements of A and are also elements
Figure 1.2: The intersection A ∩ B of two sets is the set of elements they have
in common.
sfr:set:uni:
fig:intersection
of B. This operation is called intersection, and can be depicted as in Figure 1.2.
A ∩ B = {x : x ∈ A ∧ x ∈ B}
Two sets are called disjoint if their intersection is empty. This means they
have no elements in common.
We can also form the union or intersection of more than two sets. An explanation
elegant way of dealing with this in general is the following: suppose you collect
all the sets you want to form the union (or intersection) of into a single set.
Then we can define the union of all our original sets as the set of all objects
which belong to at least one element of the set, and the intersection as the set
of all objects which belong to every element of the set.
S
Definition 1.19. If A is a set of sets, then A is the set of elements of
elements of A:
[
A = {x : x belongs to an element of A}, i.e.,
= {x : there is a B ∈ A so that x ∈ B}
Figure 1.3: The difference A \ B of two sets is the set of those elements of A
which are not also elements of B.
sfr:set:uni:
T difference
Definition 1.20. If A is a set of sets, then A is the set of objects which all
elements of A have in common:
\
A = {x : x belongs to every element of A}, i.e.,
= {x : for all B ∈ A, x ∈ B}
S
Example
T 1.21. Suppose A = {{a, b}, {a, d, e}, {a, d}}. Then A = {a, b, d, e}
and A = {a}.
S
Problem 1.6. Show that if A is a set and A ∈ B, then A ⊆ B.
When we have an index of sets, i.e., some set I such that we are considering
Ai for each i ∈ I, we may also use these abbreviations:
[ [
Ai = {Ai : i ∈ I}
i∈I
\ \
Ai = {Ai : i ∈ I}
i∈I
Finally, we may want to think about the set of all elements in A which are
not in B. We can depict this as in Figure 1.3.
Definition 1.22 (Difference). The set difference A \ B is the set of all ele-
ments of A which are not also elements of B, i.e.,
A \ B = {x : x ∈ A and x ∈
/ B}.
content/sets-functions-relations/sets/pairs-and-products.tex
We can define ordered pairs in set theory using the Wiener–Kuratowski defini-
tion.
sfr:set:pai: Definition 1.23 (Ordered pair). ⟨a, b⟩ = {{a}, {a, b}}.
wienerkuratowski
Problem 1.8. Using Definition 1.23, prove that ⟨a, b⟩ = ⟨c, d⟩ iff both a = c
and b = d.
Having fixed a definition of an ordered pair, we can use it to define further explanation
sets. For example, sometimes we also want ordered sequences of more than
two objects, e.g., triples ⟨x, y, z⟩, quadruples ⟨x, y, z, u⟩, and so on. We can
think of triples as special ordered pairs, where the first element is itself an
ordered pair: ⟨x, y, z⟩ is ⟨⟨x, y⟩, z⟩. The same is true for quadruples: ⟨x, y, z, u⟩
is ⟨⟨⟨x, y⟩, z⟩, u⟩, and so on. In general, we talk of ordered n-tuples ⟨x1 , . . . , xn ⟩.
Certain sets of ordered pairs, or other ordered n-tuples, will be useful.
Definition 1.24 (Cartesian product). Given sets A and B, their Cartesian
product A × B is defined by
Example 1.25. If A = {0, 1}, and B = {1, a, b}, then their product is
A × B = {⟨0, 1⟩, ⟨0, a⟩, ⟨0, b⟩, ⟨1, 1⟩, ⟨1, a⟩, ⟨1, b⟩}.
A1 = A
Ak+1 = Ak × A
Proof. For every element x in A, there are m elements of the form ⟨x, y⟩ ∈
A × B. Let Bx = {⟨x, y⟩ : y ∈ B}. Since whenever x1 ̸= x2 , ⟨x1 , y⟩ = ̸ ⟨x2 , y⟩,
Bx1 ∩ Bx2 = ∅. But if A = {x1 , . . . , xn }, then A × B = Bx1 ∪ · · · ∪ Bxn , and so
has n · m elements.
To visualize this, arrange the elements of A × B in a grid:
Since the xi are all different, and the yj are all different, no two of the pairs in
this grid are the same, and there are n · m of them.
A∗ = {∅} ∪ A ∪ A2 ∪ A3 ∪ . . .
content/sets-functions-relations/sets/russells-paradox.tex
R = {x : x ∈
/ x}
Proof. If R = {x : x ∈
/ x} exists, then R ∈ R iff R ∈
/ R, which is a contradic-
tion.
explanation
Let’s run through this proof more slowly. If R exists, it makes sense to ask
whether R ∈ R or not. Suppose that indeed R ∈ R. Now, R was defined as the
set of all sets that are not elements of themselves. So, if R ∈ R, then R does
not itself have R’s defining property. But only sets that have this property are
in R, hence, R cannot be an element of R, i.e., R ∈ / R. But R can’t both be
and not be an element of R, so we have a contradiction.
Since the assumption that R ∈ R leads to a contradiction, we have R ∈ / R.
But this also leads to a contradiction! For if R ∈
/ R, then R itself does have
R’s defining property, and so R would be an element of R just like all the other
non-self-membered sets. And again, it can’t both not be and be an element
of R.
digression
How do we set up a set theory which avoids falling into Russell’s Paradox,
i.e., which avoids making the inconsistent claim that R = {x : x ∈ / x} exists?
Well, we would need to lay down axioms which give us very precise conditions
for stating when sets exist (and when they don’t).
The set theory sketched in this chapter doesn’t do this. It’s genuinely naı̈ve.
It tells you only that sets obey extensionality and that, if you have some sets,
you can form their union, intersection, etc. It is possible to develop set theory
29
CHAPTER 2. RELATIONS
Chapter 2
Relations
content/sets-functions-relations/relations/relations-as-sets.tex
Indeed, without any loss of information, we can consider the set R to be the
<-relation on N.
In the same way we can construct a subset of N2 for any relation between
numbers. Conversely, given any set of pairs of numbers S ⊆ N2 , there is a
corresponding relation between numbers, namely, the relationship n bears to
m if and only if ⟨n, m⟩ ∈ S. This justifies the following definition:
Definition 2.1 (Binary relation). A binary relation on a set A is a subset
of A2 . If R ⊆ A2 is a binary relation on A and x, y ∈ A, we sometimes write
Rxy (or xRy) for ⟨x, y⟩ ∈ R.
sfr:rel:set: Example 2.2. The set N2 of pairs of natural numbers can be listed in a
relations
2-dimensional matrix like this:
⟨0, 0⟩ ⟨0, 1⟩ ⟨0, 2⟩ ⟨0, 3⟩ ...
⟨1, 0⟩ ⟨1, 1⟩ ⟨1, 2⟩ ⟨1, 3⟩ ...
⟨2, 0⟩ ⟨2, 1⟩ ⟨2, 2⟩ ⟨2, 3⟩ ...
⟨3, 0⟩ ⟨3, 1⟩ ⟨3, 2⟩ ⟨3, 3⟩ ...
.. .. .. .. ..
. . . . .
We have put the diagonal, here, in bold, since the subset of N2 consisting of
the pairs lying on the diagonal, i.e.,
is the identity relation on N. (Since the identity relation is popular, let’s define
IdA = {⟨x, x⟩ : x ∈ A} for any set A.) The subset of all pairs lying above the
diagonal, i.e.,
L = {⟨0, 1⟩, ⟨0, 2⟩, . . . , ⟨1, 2⟩, ⟨1, 3⟩, . . . , ⟨2, 3⟩, ⟨2, 4⟩, . . .},
is the less than relation, i.e., Lnm iff n < m. The subset of pairs below the
diagonal, i.e.,
G = {⟨1, 0⟩, ⟨2, 0⟩, ⟨2, 1⟩, ⟨3, 0⟩, ⟨3, 1⟩, ⟨3, 2⟩, . . . },
is the greater than relation, i.e., Gnm iff n > m. The union of L with I, which
we might call K = L ∪ I, is the less than or equal to relation: Knm iff n ≤ m.
Similarly, H = G ∪ I is the greater than or equal to relation. These relations
L, G, K, and H are special kinds of relations called orders. L and G have
the property that no number bears L or G to itself (i.e., for all n, neither Lnn
nor Gnn). Relations with this property are called irreflexive, and, if they also
happen to be orders, they are called strict orders.
Although orders and identity are important and natural relations, it should explanation
be emphasized that according to our definition any subset of A2 is a relation
on A, regardless of how unnatural or contrived it seems. In particular, ∅ is a
relation on any set (the empty relation, which no pair of elements bears), and
A2 itself is a relation on A as well (one which every pair bears), called the
universal relation. But also something like E = {⟨n, m⟩ : n > 5 or m × n ≥ 34}
counts as a relation.
Problem 2.1. List the elements of the relation ⊆ on the set ℘({a, b, c}).
content/sets-functions-relations/relations/reflections.tex
a simple version of Frege’s concept horse paradox, and a famous objection that
Wittgenstein once raised against Russell.)
So where does this leave us? Well, there is nothing wrong with our saying
that the relations on the numbers are sets. We just have to understand the
spirit in which that remark is made. We are not stating a metaphysical identity
fact. We are simply noting that, in certain contexts, we can (and will) treat
(certain) relations as certain sets.
content/sets-functions-relations/relations/special-properties.tex
In a symmetric relation, Rxy and Ryx always hold together, or neither explanation
holds. In an anti-symmetric relation, the only way for Rxy and Ryx to hold
together is if x = y. Note that this does not require that Rxy and Ryx
holds when x = y, only that it isn’t ruled out. So an anti-symmetric relation
can be reflexive, but it is not the case that every anti-symmetric relation is
reflexive. Also note that being anti-symmetric and merely not being symmetric
are different conditions. In fact, a relation can be both symmetric and anti-
symmetric at the same time (e.g., the identity relation is).
Problem 2.2. Give examples of relations that are (a) reflexive and symmetric
but not transitive, (b) reflexive and anti-symmetric, (c) anti-symmetric, tran-
sitive, but not reflexive, and (d) reflexive, symmetric, and transitive. Do not
use relations on numbers or sets.
content/sets-functions-relations/relations/equivalence-relations.tex
the equivalence class of x in A is the set [x]R = {y ∈ A : Rxy}. The quotient def:equivalenceclass
of A under R is A/R = {[x]R : x ∈ A}, i.e., the set of these equivalence classes.
Proof. For the left-to-right direction, suppose Rxy, and let z ∈ [x]R . By defi-
nition, then, Rxz. Since R is an equivalence relation, Ryz. (Spelling this out:
as Rxy and R is symmetric we have Ryx, and as Rxz and R is transitive we
have Ryz.) So z ∈ [y]R . Generalising, [x]R ⊆ [y]R . But exactly similarly,
[y]R ⊆ [x]R . So [x]R = [y]R , by extensionality.
content/sets-functions-relations/relations/orders.tex
2.5 Orders
sfr:rel:ord: Many of our comparisons involve describing some objects as being “less than”, explanation
sec
“equal to”, or “greater than” other objects, in a certain respect. These involve
order relations. But there are different kinds of order relations. For instance,
some require that any two objects be comparable, others don’t. Some include
identity (like ≤) and some exclude it (like <). It will help us to have a taxonomy
here.
Definition 2.14 (Preorder). A relation which is both reflexive and transi-
tive is called a preorder.
sfr:rel:ord: Definition 2.16 (Linear order). A partial order which is also connected is
def:linearorder
called a total order or linear order.
Example 2.17. Every linear order is also a partial order, and every partial
order is also a preorder, but the converses don’t hold. The universal relation
on A is a preorder, since it is reflexive and transitive. But, if A has more than
one element, the universal relation is not anti-symmetric, and so not a partial
order.
Definition 2.22 (Strict linear order). A strict order which is also con- sfr:rel:ord:
def:strictlinearorder
nected is called a strict total order or strict linear order.
Example 2.23. ≤ is the linear order corresponding to the strict linear order <.
⊆ is the partial order corresponding to the strict order ⊊.
Any strict order R on A can be turned into a partial order by adding the
diagonal IdA , i.e., adding all the pairs ⟨x, x⟩. (This is called the reflexive closure
of R.) Conversely, starting from a partial order, one can get a strict order by
removing IdA . These next two results make this precise.
The following simple result establishes that strict linear orders satisfy an
extensionality-like property:
Proof. Suppose (∀x ∈ A)(x < a ↔ x < b). If a < b, then a < a, contradicting
the fact that < is irreflexive; so a ≮ b. Exactly similarly, b ≮ a. So a = b, as <
is connected.
content/sets-functions-relations/relations/graphs.tex
2.6 Graphs
sfr:rel:grp: A graph is a diagram in which points—called “nodes” or “vertices” (plural of
sec
“vertex”)—are connected by edges. Graphs are a ubiquitous tool in discrete
mathematics and in computer science. They are incredibly useful for repre-
senting, and visualizing, relationships and structures, from concrete things like
networks of various kinds to abstract structures such as the possible outcomes
of decisions. There are many different kinds of graphs in the literature which
differ, e.g., according to whether the edges are directed or not, have labels or
not, whether there can be edges from a node to the same node, multiple edges
between the same nodes, etc. Directed graphs have a special connection to
relations.
According to our definition, a graph just is a set together with a relation explanation
on that set. Of course, when talking about graphs, it’s only natural to expect
that they are graphically represented: we can draw a graph by connecting two
vertices v1 and v2 by an arrow iff ⟨v1 , v2 ⟩ ∈ E. The only difference between a
relation by itself and a graph is that a graph specifies the set of vertices, i.e., a
graph may have isolated vertices. The important point, however, is that every
relation R on a set X can be seen as a directed graph ⟨X, R⟩, and conversely, a
directed graph ⟨V, E⟩ can be seen as a relation E ⊆ V 2 with the set V explicitly
specified.
Example 2.28. The graph ⟨V, E⟩ with V = {1, 2, 3, 4} and E = {⟨1, 1⟩, ⟨1, 2⟩,
⟨1, 3⟩, ⟨2, 3⟩} looks like this:
1 2 4
This is a different graph than ⟨V ′ , E⟩ with V ′ = {1, 2, 3}, which looks like this:
1 2
content/sets-functions-relations/relations/operations.tex
Chapter 3
Functions
content/sets-functions-relations/functions/function-basics.tex
3.1 Basics
sfr:fun:bas: A function is a map which sends each element of a given set to a specific explanation
sec
element in some (other) given set. For instance, the operation of adding 1
defines a function: each number n is mapped to a unique number n + 1.
More generally, functions may take pairs, triples, etc., as inputs and return
some kind of output. Many functions are familiar to us from basic arithmetic.
For instance, addition and multiplication are functions. They take in two
numbers and return a third.
In this mathematical, abstract sense, a function is a black box : what matters
is only what output is paired with what input, not the method for calculating
the output.
Definition 3.1 (Function). A function f : A → B is a mapping of each ele-
ment of A to an element of B.
We call A the domain of f and B the codomain of f . The elements of A
are called inputs or arguments of f , and the element of B that is paired with
an argument x by f is called the value of f for argument x, written f (x).
The range ran(f ) of f is the subset of the codomain consisting of the values
of f for some argument; ran(f ) = {f (x) : x ∈ A}.
39
CHAPTER 3. FUNCTIONS
Example 3.4. The relation that pairs each student in a class with their final
grade is a function—no student can get two different final grades in the same
class. The relation that pairs each student in a class with their parents is not
a function: students can have zero, or two, or more parents.
explanation We can define functions by specifying in some precise way what the value
of the function is for every possible argument. Different ways of doing this are
by giving a formula, describing a method for computing the value, or listing
the values for each argument. However functions are defined, we must make
sure that for each argument we specify one, and only one, value.
Example 3.5. Let f : N → N be defined such that f (x) = x + 1. This is a
definition that specifies f as a function which takes in natural numbers and
outputs natural numbers. It tells us that, given a natural number x, f will
output its successor x + 1. In this case, the codomain N is not the range of f ,
since the natural number 0 is not the successor of any natural number. The
range of f is the set of all positive integers, Z+ .
Example 3.6. Let g : N → N be defined such that g(x) = x + 2 − 1. This tells sfr:fun:bas:
examplefunext
us that g is a function which takes in natural numbers and outputs natural
Figure 3.2: A surjective function has every element of the codomain as a value.
sfr:fun:kin:
fig:surjective
numbers. Given a natural number n, g will output the predecessor of the
successor of the successor of x, i.e., x + 1.
We just considered two functions, f and g, with different definitions. How- explanation
ever, these are the same function. After all, for any natural number n, we have
that f (n) = n + 1 = n + 2 − 1 = g(n). Otherwise put: our definitions for f
and g specify the same mapping by means of different equations. Implicitly,
then, we are relying upon a principle of extensionality for functions,
if ∀x f (x) = g(x), then f = g
provided that f and g share the same domain and codomain.
Example 3.7. We can also define functions by cases. For instance, we could
define h : N → N by (
x
2 if x is even
h(x) = x+1
2 if x is odd.
Since every natural number is either even or odd, the output of this function
will always be a natural number. Just remember that if you define a function
by cases, every possible input must fall into exactly one case. In some cases,
this will require a proof that the cases are exhaustive and exclusive.
content/sets-functions-relations/functions/function-kinds.tex
Figure 3.3: An injective function never maps two different arguments to the
same value.
sfr:fun:kin:
fig:injective
We call such a function a surjection from A to B.
explanation If you want to show that f is a surjection, then you need to show that every
object in f ’s codomain is the value of f (x) for some input x.
Note that any function induces a surjection. After all, given a function
f : A → B, let f ′ : A → ran(f ) be defined by f ′ (x) = f (x). Since ran(f ) is
defined as {f (x) ∈ B : x ∈ A}, this function f ′ is guaranteed to be a surjection
explanation Now, any function maps each possible input to a unique output. But there
are also functions which never map different inputs to the same outputs. Such
functions are called injective, and can be pictured as in Figure 3.3.
Definition 3.9 (Injective function). A function f : A → B is injective iff
for each y ∈ B there is at most one x ∈ A such that f (x) = y. We call such a
function an injection from A to B.
explanation If you want to show that f is an injection, you need to show that for any
elements x and y of f ’s domain, if f (x) = f (y), then x = y.
Example 3.10. The constant function f : N → N given by f (x) = 1 is neither
injective, nor surjective.
The identity function f : N → N given by f (x) = x is both injective and
surjective.
The successor function f : N → N given by f (x) = x + 1 is injective but not
surjective.
The function f : N → N defined by:
(
x
2 if x is even
f (x) = x+1
2 if x is odd.
explanation Often enough, we want to consider functions which are both injective and
surjective. We call such functions bijective. They look like the function pic-
tured in Figure 3.4. Bijections are also sometimes called one-to-one correspon-
dences, since they uniquely pair elements of the codomain with elements of the
domain.
Figure 3.4: A bijective function uniquely pairs the elements of the codomain
with those of the domain.
sfr:fun:kin:
fig:bijective
Definition 3.11 (Bijection). A function f : A → B is bijective iff it is both
surjective and injective. We call such a function a bijection from A to B (or
between A and B).
content/sets-functions-relations/functions/functions-relations.tex
Proof. Suppose there is a y such that Rxy. If there were another z ̸= y such
that Rxz, the condition on R would be violated. Hence, if there is a y such
that Rxy, this y is unique, and so f is well-defined. Obviously, Rf = R.
explanation It follows from these definitions that ran(f ) = f [dom(f )], for any func-
tion f . These notions are exactly as one would expect, given the definitions
in section 2.7 and our identification of functions with relations. But two other
operations—inverses and relative products—require a little more detail. We
will provide that in section 3.4 and section 3.5.
content/sets-functions-relations/functions/inverses.tex
But the scare quotes around “defined by” (and “the”) suggest that this is
not a definition. At least, it will not always work, with complete generality.
For, in order for this definition to specify a function, there has to be one and
only one x such that f (x) = y—the output of g has to be uniquely specified.
Moreover, it has to be specified for every y ∈ B. If there are x1 and x2 ∈ A
with x1 ̸= x2 but f (x1 ) = f (x2 ), then g(y) would not be uniquely specified
for y = f (x1 ) = f (x2 ). And if there is no x at all such that f (x) = y, then
g(y) is not specified at all. In other words, for g to be defined, f must be both
injective and surjective.
Let’s go slowly. We’ll divide the question into two: Given a function f : A →
B, when is there a function g : B → A so that g(f (x)) = x? Such a g “undoes”
what f does, and is called a left inverse of f . Secondly, when is there a function
h : B → A so that f (h(y)) = y? Such an h is called a right inverse of f —f
“undoes” what h does.
Proposition 3.16. If f : A → B is injective, then there is a left inverse g : B →
A of f so that g(f (x)) = x for all x ∈ A.
It is defined for all y ∈ B, since for each such y ∈ ran(f ) there is exactly one
x ∈ A such that f (x) = y. By definition, if y = f (x), then g(y) = x, i.e.,
g(f (x)) = x.
of h requires that we choose a single x from each of these sets. That this is always possible is
actually not obvious—the possibility of making these choices is simply assumed as an axiom.
In other words, this proposition assumes the so-called Axiom of Choice, an issue we will
revisit in chapter 69. However, in many specific cases, e.g., when A = N or is finite, or when
f is bijective, the Axiom of Choice is not required. (In the particular case when f is bijective,
for each y ∈ B the set {x : f (x) = y} has exactly one element, so that there is no choice to
make.)
explanation By combining the ideas in the previous proof, we now get that every bijec-
tion has an inverse, i.e., there is a single function which is both a left and right
inverse of f .
Proposition 3.18. If f : A → B is bijective, there is a function f −1 : B → A sfr:fun:inv:
so that for all x ∈ A, f −1 (f (x)) = x and for all y ∈ B, f (f −1 (y)) = y. prop:bijection-inverse
Proof. Exercise.
Problem 3.3. Prove Proposition 3.18. You have to define f −1 , show that
it is a function, and show that it is an inverse of f , i.e., f −1 (f (x)) = x and
f (f −1 (y)) = y for all x ∈ A and y ∈ B.
explanation There is a slightly more general way to extract inverses. We saw in sec-
tion 3.2 that every function f induces a surjection f ′ : A → ran(f ) by letting
f ′ (x) = f (x) for all x ∈ A. Clearly, if f is injective, then f ′ is bijective, so that
it has a unique inverse by Proposition 3.18. By a very minor abuse of notation,
we sometimes call the inverse of f ′ simply “the inverse of f .”
Proposition 3.19. Show that if f : A → B has a left inverse g and a right sfr:fun:inv:
prop:left-right
inverse h, then h = g.
Proof. Exercise.
content/sets-functions-relations/functions/composition.tex
Example 3.22. Consider the functions f (x) = x + 1, and g(x) = 2x. Since
(g ◦ f )(x) = g(f (x)), for each input x you must first take its successor, then
multiply the result by two. So their composition is given by (g◦f )(x) = 2(x+1).
content/sets-functions-relations/functions/partial-functions.tex
Proof. Suppose there is a y such that Rxy. If there were another y ′ ̸= y such
that Rxy ′ , the condition on R would be violated. Hence, if there is a y such
that Rxy, that y is unique, and so f is well-defined. Obviously, Rf = R and f
is total if R is serial.
Chapter 4
48
4.1. INTRODUCTION
content/sets-functions-relations/size-of-sets/introduction.tex
4.1 Introduction
sfr:siz:int: When Georg Cantor developed set theory in the 1870s, one of his aims was
sec
to make palatable the idea of an infinite collection—an actual infinity, as the
medievals would say. A key part of this was his treatment of the size of different
sets. If a, b and c are all distinct, then the set {a, b, c} is intuitively larger than
{a, b}. But what about infinite sets? Are they all as large as each other? It
turns out that they are not.
The first important idea here is that of an enumeration. We can list every
finite set by listing all its elements. For some infinite sets, we can also list
all their elements if we allow the list itself to be infinite. Such sets are called
enumerable. Cantor’s surprising result, which we will fully understand by the
end of this chapter, was that some infinite sets are not enumerable.
content/sets-functions-relations/size-of-sets/enumerability.tex
We’ve already given examples of sets by listing their elements. Let’s discuss explanation
in more general terms how and when we can list the elements of a set, even if
that set is infinite.
Definition 4.1 (Enumeration, informally). Informally, an enumeration of
a set A is a list (possibly infinite) of elements of A such that every element of
A appears on the list at some finite position. If A has an enumeration, then A
is said to be enumerable.
A couple of points about enumerations: explanation
2. We can have different enumerations of the same set A which differ by the
order in which the elements appear: 4, 1, 25, 16, 9 enumerates the (set
of the) first five square numbers just as well as 1, 4, 9, 16, 25 does.
3. Redundant enumerations are still enumerations: 1, 1, 2, 2, 3, 3, . . . enu-
merates the same set as 1, 2, 3, . . . does.
4. Order and redundancy do matter when we specify an enumeration: we
can enumerate the positive integers beginning with 1, 2, 3, 1, . . . , but
the pattern is easier to see when enumerated in the standard way as 1,
2, 3, 4, . . .
5. Enumerations must have a beginning: . . . , 3, 2, 1 is not an enumeration
of the positive integers because it has no first element. To see how this
follows from the informal definition, ask yourself, “at what position in
the list does the number 76 appear?”
6. The following is not an enumeration of the positive integers: 1, 3, 5, . . . ,
2, 4, 6, . . . The problem is that the even numbers occur at places ∞ + 1,
∞ + 2, ∞ + 3, rather than at finite positions.
7. The empty set is enumerable: it is enumerated by the empty list!
Proposition 4.2. If A has an enumeration, it has an enumeration without
repetitions.
The last argument shows that in order to get a good handle on enumerations
and enumerable sets and to prove things about them, we need a more precise
definition. The following provides it.
Definition 4.3 (Enumeration, formally). An enumeration of a set A ̸= ∅
is any surjective function f : Z+ → A.
explanation Let’s convince ourselves that the formal definition and the informal defini-
tion using a possibly infinite list are equivalent. First, any surjective function
from Z+ to a set A enumerates A. Such a function determines an enumeration
as defined informally above: the list f (1), f (2), f (3), . . . . Since f is surjective,
every element of A is guaranteed to be the value of f (n) for some n ∈ Z+ .
Hence, every element of A appears at some finite position in the list. Since the
function may not be injective, the list may be redundant, but that is acceptable
(as noted above).
On the other hand, given a list that enumerates all elements of A, we can
define a surjective function f : Z+ → A by letting f (n) be the nth element of
the list, or the final element of the list if there is no nth element. The only
case where this does not produce a surjective function is when A is empty,
and hence the list is empty. So, every non-empty list determines a surjective
function f : Z+ → A.
f (n) = 2n and
g(n) = 2n − 1
enumerate the even positive integers and the odd positive integers, respectively.
However, neither function is an enumeration of Z+ , since neither is surjective.
Example 4.7. The function f (n) = (−1)n ⌈ (n−1) 2 ⌉ (where ⌈x⌉ denotes the
ceiling function, which rounds x up to the nearest integer) enumerates the set
of integers Z. Notice how f generates the values of Z by “hopping” back and
forth between positive and negative integers:
−⌈ 20 ⌉ ⌈ 12 ⌉ −⌈ 22 ⌉ ⌈ 32 ⌉ −⌈ 42 ⌉ ⌈ 25 ⌉ −⌈ 62 ⌉ ...
0 1 −1 2 −2 3 ...
g : N → A. prop:enum-shift
Z+ .
Proof. We define the function g recursively: Let g(1) = f (1). If g(i) has already
been defined, let g(i + 1) be the first value of f (1), f (2), . . . not already among
g(1), . . . , g(i), if there is one. If A has just n elements, then g(1), . . . , g(n)
are all defined, and so we have defined a function g : {1, . . . , n} → A. If A has
infinitely many elements, then for any i there must be an element of A in the
enumeration f (1), f (2), . . . , which is not already among g(1), . . . , g(i). In this
case we have defined a function g : Z+ → A.
The function g is surjective, since any element of A is among f (1), f (2), . . .
(since f is surjective) and so will eventually be a value of g(i) for some i. It is
also injective, since if there were j < i such that g(j) = g(i), then g(i) would
already be among g(1), . . . , g(i − 1), contrary to how we defined g.
content/sets-functions-relations/size-of-sets/zig-zag.tex
⟨0, 0⟩, ⟨0, 1⟩, ⟨1, 0⟩, ⟨0, 2⟩, ⟨1, 1⟩, ⟨2, 0⟩, ⟨0, 3⟩, ⟨1, 2⟩, ⟨2, 1⟩, ⟨3, 0⟩, . . .
explanation This technique also generalises rather nicely. For example, we can use it to
enumerate the set of ordered triples of natural numbers, i.e.:
N × N × N = {⟨n, m, k⟩ : n, m, k ∈ N}
N3 = (N × N) × N = {⟨⟨n, m⟩, k⟩ : n, m, k ∈ N}
and thus we can enumerate N3 with an array by labelling one axis with the
enumeration of N, and the other axis with the enumeration of N2 :
0 1 2 3 ...
⟨0, 0⟩ ⟨0, 0, 0⟩ ⟨0, 0, 1⟩ ⟨0, 0, 2⟩ ⟨0, 0, 3⟩ ...
⟨0, 1⟩ ⟨0, 1, 0⟩ ⟨0, 1, 1⟩ ⟨0, 1, 2⟩ ⟨0, 1, 3⟩ ...
⟨1, 0⟩ ⟨1, 0, 0⟩ ⟨1, 0, 1⟩ ⟨1, 0, 2⟩ ⟨1, 0, 3⟩ ...
⟨0, 2⟩ ⟨0, 2, 0⟩ ⟨0, 2, 1⟩ ⟨0, 2, 2⟩ ⟨0, 2, 3⟩ ...
.. .. .. .. .. ..
. . . . . .
Thus, by using a method like Cantor’s zig-zag method, we may similarly obtain
an enumeration of N3 . And we can keep going, obtaining enumerations of Nn
for any natural number n. So, we have:
Problem 4.7. Show that (Z+ )∗ is enumerable. You may assume Problem 4.6.
content/sets-functions-relations/size-of-sets/pairing.tex
This would enable us to calculate exactly where ⟨n, m⟩ will occur in our enu-
meration.
In fact, we can define g directly by making two observations. First: if the
nth row and mth column contains value v, then the (n + 1)st row and (m − 1)st
column contains value v + 1. Second: the first row of our enumeration consists
of the triangular numbers, starting with 0, 1, 3, 6, etc. The kth triangular
number is the sum of the natural numbers < k, which can be computed as
k(k + 1)/2. Putting these two observations together, consider this function:
(n + m + 1)(n + m)
g(n, m) = +n
2
We often just write g(n, m) rather that g(⟨n, m⟩), since it is easier on the eyes.
This tells you first to determine the (n + m)th triangle number, and then add
n to it. And it populates the array in exactly the way we would like. So in
particular, the pair ⟨1, 2⟩ is sent to 4×3
2 + 1 = 7.
This function g is the inverse of an enumeration of a set of pairs. Such
functions are called pairing functions.
We can use pairing functions to encode, e.g., pairs of natural numbers; or, explanation
in other words, we can represent each pair of elements using a single number.
Using the inverse of the pairing function, we can decode the number, i.e., find
out which pair it represents.
Problem 4.9. Show that Q is enumerable. Recall that any rational number
can be written as a fraction z/m with z ∈ Z, m ∈ N+ .
Problem 4.11. Recall from your introductory logic course that each possible
truth table expresses a truth function. In other words, the truth functions are
all functions from Bk → B for some k. Prove that the set of all truth functions
is enumerable.
Problem 4.12. Show that the set of all finite subsets of an arbitrary infinite
enumerable set is enumerable.
Problem 4.14. Show that the enumerable union of enumerable sets is enu-
merable. That S
is, whenever A1 , A2 , . . . are sets, and each Ai is enumerable,
∞
then the union i=1 Ai of all of them is also enumerable. [NB: this is hard!]
content/sets-functions-relations/size-of-sets/pairing-alt.tex
1 2 3 4 5 6 7 8 9 10 ...
Repeat this with pairs ⟨1, m⟩ for the place that still remain empty, again skip-
ping every other empty place:
1 2 3 4 5 6 7 8 9 10 ...
Enter pairs ⟨2, m⟩, ⟨2, m⟩, etc., in the same way. Our completed enumeration
thus starts like this:
1 2 3 4 5 6 7 8 9 10 ...
⟨0, 0⟩ ⟨1, 0⟩ ⟨0, 1⟩ ⟨2, 0⟩ ⟨0, 2⟩ ⟨1, 1⟩ ⟨0, 3⟩ ⟨3, 0⟩ ⟨0, 4⟩ ⟨1, 2⟩ ...
If we number the cells in the array above according to this enumeration, we
will not find a neat zig-zag line, but this arrangement:
0 1 2 3 4 5 ...
0 1 3 5 7 9 11 ...
1 2 6 10 14 18 ... ...
2 4 12 20 28 ... ... ...
3 8 24 40 ... ... ... ...
4 16 48 ... ... ... ... ...
5 32 ... ... ... ... ... ...
.. .. .. .. .. .. .. ..
. . . . . . . .
We can see that the pairs in row 0 are in the odd numbered places of our
enumeration, i.e., pair ⟨0, m⟩ is in place 2m + 1; pairs in the second row,
⟨1, m⟩, are in places whose number is the double of an odd number, specifically,
2 · (2m + 1); pairs in the third row, ⟨2, m⟩, are in places whose number is four
times an odd number, 4 · (2m + 1); and so on. The factors of (2m + 1) for
each row, 1, 2, 4, 8, . . . , are exactly the powers of 2: 1 = 20 , 2 = 21 , 4 = 22 ,
8 = 23 , . . . In fact, the relevant exponent is always the first member of the pair
in question. Thus, for pair ⟨n, m⟩ the factor is 2n . This gives us the general
formula: 2n · (2m + 1). However, this is a mapping of pairs to positive integers,
i.e., ⟨0, 0⟩ has position 1. If we want to begin at position 0 we must subtract 1
from the result. This gives us:
Example 4.15. The function h : N2 → N given by
h(n, m) = 2n (2m + 1) − 1
is a pairing function for the set of pairs of natural numbers N2 .
Accordingly, in our second enumeration of N2 , the pair ⟨0, 0⟩ has code explanation
h(0, 0) = 20 (2 · 0 + 1) − 1 = 0; ⟨1, 2⟩ has code 21 · (2 · 2 + 1) − 1 = 2 · 5 − 1 = 9;
⟨2, 6⟩ has code 22 · (2 · 6 + 1) − 1 = 51.
Sometimes it is enough to encode pairs of natural numbers N2 without
requiring that the encoding is surjective. Such encodings have inverses that
are only partial functions.
Example 4.16. The function j : N2 → N+ given by
j(n, m) = 2n 3m
is an injective function N2 → N.
content/sets-functions-relations/size-of-sets/non-enumerability.tex
Some sets, such as the set Z+ of positive integers, are infinite. So far we’ve
seen examples of infinite sets which were all enumerable. However, there are
also infinite sets which do not have this property. Such sets are called non-
enumerable.
First of all, it is perhaps already surprising that there are non-enumerable
sets. For any enumerable set A there is a surjective function f : Z+ → A. If a
set is non-enumerable there is no such function. That is, no function mapping
the infinitely many elements of Z+ to A can exhaust all of A. So there are
“more” elements of A than the infinitely many positive integers.
How would one prove that a set is non-enumerable? You have to show that
no such surjective function can exist. Equivalently, you have to show that the
elements of A cannot be enumerated in a one way infinite list. The best way
to do this is to show that every list of elements of A must leave at least one
element out; or that no function f : Z+ → A can be surjective. We can do this
using Cantor’s diagonal method. Given a list of elements of A, say, x1 , x2 , . . . ,
we construct another element of A which, by its construction, cannot possibly
be on that list.
Our first example is the set Bω of all infinite, non-gappy sequences of 0’s
and 1’s.
We may arrange this list, and the elements of each sequence si in it, in an
array:
1 2 3 4 ...
1 s1 (1) s1 (2) s1 (3) s1 (4) . . .
2 s2 (1) s2 (2) s2 (3) s2 (4) . . .
3 s3 (1) s3 (2) s3 (3) s3 (4) . . .
4 s4 (1) s4 (2) s4 (3) s4 (4) . . .
.. .. .. .. .. ..
. . . . . .
The labels down the side give the number of the sequence in the list s1 , s2 , . . . ;
the numbers across the top label the elements of the individual sequences. For
instance, s1 (1) is a name for whatever number, a 0 or a 1, is the first element
in the sequence s1 , and so on.
Now we construct an infinite sequence, s, of 0’s and 1’s which cannot pos-
sibly be on this list. The definition of s will depend on the list s1 , s2 , . . . . Any
infinite list of infinite sequences of 0’s and 1’s gives rise to an infinite sequence s
which is guaranteed to not appear on the list.
To define s, we specify what all its elements are, i.e., we specify s(n) for all
n ∈ Z+ . We do this by reading down the diagonal of the array above (hence
the name “diagonal method”) and then changing every 1 to a 0 and every 0
to a 1. More abstractly, we define s(n) to be 0 or 1 according to whether the
n-th element of the diagonal, sn (n), is 1 or 0.
(
1 if sn (n) = 0
s(n) =
0 if sn (n) = 1.
If you like formulas better than definitions by cases, you could also define
s(n) = 1 − sn (n).
Clearly s is an infinite sequence of 0’s and 1’s, since it is just the mirror
sequence to the sequence of 0’s and 1’s that appear on the diagonal of our
array. So s is an element of Bω . But it cannot be on the list s1 , s2 , . . . Why
not?
It can’t be the first sequence in the list, s1 , because it differs from s1 in the
first element. Whatever s1 (1) is, we defined s(1) to be the opposite. It can’t be
the second sequence in the list, because s differs from s2 in the second element:
if s2 (2) is 0, s(2) is 1, and vice versa. And so on.
More precisely: if s were on the list, there would be some k so that s = sk .
Two sequences are identical iff they agree at every place, i.e., for any n, s(n) =
sk (n). So in particular, taking n = k as a special case, s(k) = sk (k) would
have to hold. sk (k) is either 0 or 1. If it is 0 then s(k) must be 1—that’s how
we defined s. But if sk (k) = 1 then, again because of the way we defined s,
s(k) = 0. In either case s(k) ̸= sk (k).
We started by assuming that there is a list of elements of Bω , s1 , s2 , . . .
From this list we constructed a sequence s which we proved cannot be on the
list. But it definitely is a sequence of 0’s and 1’s if all the si are sequences of
0’s and 1’s, i.e., s ∈ Bω . This shows in particular that there can be no list of
all elements of Bω , since for any such list we could also construct a sequence s
guaranteed to not be on the list, so the assumption that there is a list of all
sequences in Bω leads to a contradiction.
This proof method is called “diagonalization” because it uses the diagonal explanation
Proof. We proceed in the same way, by showing that for every list of subsets
of Z+ there is a subset of Z+ which cannot be on the list. Suppose the following
is a given list of subsets of Z+ :
Z1 , Z2 , Z3 , . . .
Z = {n ∈ Z+ : n ∈
/ Zn }
Z is clearly a set of positive integers, since by assumption each Zn is, and thus
Z ∈ ℘(Z+ ). But Z cannot be on the list. To show this, we’ll establish that for
each k ∈ Z+ , Z ̸= Zk .
So let k ∈ Z+ be arbitrary. We’ve defined Z so that for any n ∈ Z+ , n ∈ Z
iff n ∈
/ Zn . In particular, taking n = k, k ∈ Z iff k ∈/ Zk . But this shows that
Z ̸= Zk , since k is an element of one but not the other, and so Z and Zk have
different elements. Since k was arbitrary, Z is not on the list Z1 , Z2 , . . .
explanation The preceding proof did not mention a diagonal, but you can think of it as
involving a diagonal if you picture it this way: Imagine the sets Z1 , Z2 , . . . ,
written in an array, where each element j ∈ Zi is listed in the j-th column.
Say the first four sets on that list are {1, 2, 3, . . . }, {2, 4, 6, . . . }, {1, 2, 5}, and
{3, 4, 5, . . . }. Then the array would begin with
Z1 = {1, 2, 3, 4, 5, 6, . . . }
Z2 ={ 2, 4, 6, . . . }
Z3 = {1, 2, 5 }
Z4 ={ 3, 4, 5, 6, . . . }
.. ..
. .
Then Z is the set obtained by going down the diagonal, leaving out any numbers
that appear along the diagonal and include those j where the array has a gap in
the j-th row/column. In the above case, we would leave out 1 and 2, include 3,
leave out 4, etc.
content/sets-functions-relations/size-of-sets/reduction.tex
4.7 Reduction
sfr:siz:red:
sec
Proof of Theorem 4.18 by reduction. Suppose that ℘(Z+ ) were enumerable, and
thus that there is an enumeration of it, Z1 , Z2 , Z3 , . . .
Define the function f : ℘(Z+ ) → Bω by letting f (Z) be the sequence sk
such that sk (n) = 1 iff n ∈ Z, and sk (n) = 0 otherwise. This clearly defines
a function, since whenever Z ⊆ Z+ , any n ∈ Z+ either is an element of Z or
isn’t. For instance, the set 2Z+ = {2, 4, 6, . . . } of positive even numbers gets
mapped to the sequence 010101 . . . , the empty set gets mapped to 0000 . . . and
the set Z+ itself to 1111 . . . .
It also is surjective: Every sequence of 0s and 1s corresponds to some set
of positive integers, namely the one which has as its members those integers
corresponding to the places where the sequence has 1s. More precisely, suppose
s ∈ Bω . Define Z ⊆ Z+ by:
Z = {n ∈ Z+ : s(n) = 1}
explanation It is easy to be confused about the direction the reduction goes in. For
instance, a surjective function g : Bω → B does not establish that B is non-
enumerable. (Consider g : Bω → B defined by g(s) = s(1), the function that
maps a sequence of 0’s and 1’s to its first element. It is surjective, because
some sequences start with 0 and some start with 1. But B is finite.) Note also
that the function f must be surjective, or otherwise the argument does not go
through: f (x1 ), f (x2 ), . . . would then not be guaranteed to include all the
elements of B. For instance,
h(n) = 000
| {z. . . 0}
n 0’s
Problem 4.20. Show that the set of all sets of pairs of positive integers is
non-enumerable by a reduction argument.
Problem 4.22. Show that Nω , the set of infinite sequences of natural num-
bers, is non-enumerable by a reduction argument.
Problem 4.23. Let P be the set of functions from the set of positive integers
to the set {0}, and let Q be the set of partial functions from the set of positive
integers to the set {0}. Show that P is enumerable and Q is not. (Hint: reduce
the problem of enumerating Bω to enumerating Q).
Problem 4.24. Let S be the set of all surjective functions from the set of
positive integers to the set {0,1}, i.e., S consists of all surjective f : Z+ → B.
Show that S is non-enumerable.
Problem 4.25. Show that the set R of all real numbers is non-enumerable.
content/sets-functions-relations/size-of-sets/equinumerous-sets.tex
4.8 Equinumerosity
sfr:siz:equ: We have an intuitive notion of “size” of sets, which works fine for finite sets.
sec
But what about infinite sets? If we want to come up with a formal way of
comparing the sizes of two sets of any size, it is a good idea to start by defining
when sets are the same size. Here is Frege:
The insight of this passage can be brought out through a formal definition:
The following proof uses Definition 4.4 if section 4.2 is included and
Definition 4.27 otherwise.
content/sets-functions-relations/size-of-sets/comparing-size.tex
It is clear that this is a reflexive and transitive relation, but that it is not
symmetric (this is left as an exercise). We can also introduce a notion, which
states that one set is (strictly) smaller than another.
content/sets-functions-relations/size-of-sets/schroder-bernstein.tex
The following section 4.11, section 4.12, section 4.13 are alternative
versions of section 4.2, section 4.6, section 4.7 due to Tim Button for use
in his Open Set Theory text. They are slightly more advanced and use a
difference definition of enumerability more suitable in a set theory context
(i.e., bijection with N or an initial segment, rather than being listable or
being the range of a surjective function from Z+ ).
content/sets-functions-relations/size-of-sets/enumerability-alt.tex
1 For more on the history, see e.g., Potter (2004, pp. 165–6).
A = {a1 , a2 , . . . , an }.
Assuming that the elements a1 , . . . , an are all distinct, this gives us a bijection
between A and the first n natural numbers 0, . . . , n−1. Conversely, since every
finite set has only finitely many elements, every finite set can be put into such
a correspondence. In other words, if A is finite, there is a bijection between A
and {0, . . . , n − 1}, where n is the number of elements of A.
If we allow for certain kinds of infinite sets, then we will also allow some
infinite sets to be enumerated. We can make this precise by saying that an
infinite set is enumerated by a bijection between it and all of N.
Definition 4.26 (Enumeration, set-theoretic). An enumeration of a set
A is a bijection whose range is A and whose domain is either an initial set of
natural numbers {0, 1, . . . , n} or the entire set of natural numbers N.
There is an intuitive underpinning to this use of the word enumeration. For explanation
to say that we have enumerated a set A is to say that there is a bijection f
which allows us to count out the elements of the set A. The 0th element is
f (0), the 1st is f (1), . . . the nth is f (n). . . .2 The rationale for this may be
made even clearer by adding the following:
sfr:siz:enm-alt: Definition 4.27. A set A is enumerable iff either A = ∅ or there is an enu-
defn:enumerable
meration of A. We say that A is non-enumerable iff A is not enumerable.
f (n) = 2n and
g(n) = 2n + 1
respectively enumerate the even natural numbers and the odd natural numbers.
But neither is surjective, so neither is an enumeration of N.
2 Yes, we count from 0. Of course we could also start with 1. This would make no big
Example 4.30. Let ⌈x⌉ be the ceiling function, which rounds x up to the
nearest integer. Then the function f : N → Z given by:
f (n) = (−1)n n2
0 −1 1 −2 2 −3 3 ...
Notice how f generates the values of Z by “hopping” back and forth between
positive and negative integers. You can also think of f as defined by cases as
follows: (
n
if n is even
f (n) = 2 n+1
− 2 if n is odd
content/sets-functions-relations/size-of-sets/non-enumerability-alt.tex
explanation The set N of natural numbers is infinite. It is also trivially enumerable. But
the remarkable fact is that there are non-enumerable sets, i.e., sets which are
not enumerable (see Definition 4.27).
This might be surprising. After all, to say that A is non-enumerable is
to say that there is no bijection f : N → A; that is, no function mapping the
infinitely many elements of N to A exhausts all of A. So if A is non-enumerable,
there are “more” elements of A than there are natural numbers.
To prove that a set is non-enumerable, you have to show that no appropriate
bijection can exist. The best way to do this is to show that every attempt to
enumerate elements of A must leave at least one element out; this shows that
no function f : N → A is surjective. And a general strategy for establishing
this is to use Cantor’s diagonal method. Given a list of elements of A, say, x1 ,
x2 , . . . , we construct another element of A which, by its construction, cannot
possibly be on that list.
But all of this is best understood by example. So, our first example is the
set Bω of all infinite strings of 0’s and 1’s. (The ‘B’ stands for binary, and we
can just think of it as the two-element set {0, 1}.)
0 1 2 3 ...
0 s0 (0) s0 (1) s0 (2) s0 (3) ...
1 s1 (0) s1 (1) s1 (2) s1 (3) ...
2 s2 (0) s2 (1) s2 (2) s2 (3) ...
3 s3 (0) s3 (1) s3 (2) s3 (3) ...
.. .. .. .. .. ..
. . . . . .
We will now construct an infinite string, d, of 0’s and 1’s which is not on this
list. We will do this by specifying each of its entries, i.e., we specify d(n) for
all n ∈ N. Intuitively, we do this by reading down the diagonal of the array
above (hence the name “diagonal method”) and then changing every 1 to a 0
and every 1 to a 0. More abstractly, we define d(n) to be 0 or 1 according to
whether the n-th element of the diagonal, sn (n), is 1 or 0, that is:
(
1 if sn (n) = 0
d(n) =
0 if sn (n) = 1
This proof method is called “diagonalization” because it uses the diagonal explanation
of the array to define d. However, diagonalization need not involve the presence
of an array. Indeed, we can show that some set is non-enumerable by using
a similar idea, even when no array and no actual diagonal is involved. The
following result illustrates how.
Proof. We proceed in the same way, by showing that every list of subsets of N
omits some subset of N. So, suppose that we have some list N0 , N1 , N2 , . . . of
subsets of N. We define a set D as follows: n ∈ D iff n ∈
/ Nn :
D = {n ∈ N : n ∈
/ Nn }
explanation The preceding proof did not mention a diagonal. Still, you can think of it
as involving a diagonal if you picture it this way: Imagine the sets N0 , N1 ,
. . . , written in an array, where we write Nn on the nth row by writing m in
the mth column iff if m ∈ Nn . For example, say the first four sets on that list
are {0, 1, 2, . . . }, {1, 3, 5, . . . }, {0, 1, 4}, and {2, 3, 4, . . . }; then our array would
begin with
N0 = {0, 1, 2, ...}
N1 = { 1, 3, 5, . . . }
N2 = {0, 1, 4 }
N3 = { 2, 3, 4, ...}
.. ..
. .
Then D is the set obtained by going down the diagonal, placing n ∈ D iff n
is not on the diagonal. So in the above case, we would leave out 0 and 1, we
would include 2, we would leave out 3, etc.
content/sets-functions-relations/size-of-sets/reduction-alt.tex
4.13 Reduction
sfr:siz:red-alt:
sec
Proof of Theorem 4.32 by reduction. For a reduction, suppose that ℘(N) is enu-
merable, and thus that there is an enumeration of it, N1 , N2 , N3 , . . .
Define the function f : ℘(N) → Bω by letting f (N ) be the string sk such
that sk (n) = 1 iff n ∈ N , and sk (n) = 0 otherwise.
This clearly defines a function, since whenever N ⊆ N, any n ∈ N either
is an element of N or isn’t. For instance, the set 2N = {2n : n ∈ N} =
{0, 2, 4, 6, . . . } of even naturals gets mapped to the string 1010101 . . . ; ∅ gets
mapped to 0000 . . . ; N gets mapped to 1111 . . . .
It is also surjective: every string of 0s and 1s corresponds to some set
of natural numbers, namely the one which has as its members those natural
numbers corresponding to the places where the string contains a 1s. More
precisely, if s ∈ Bω , then define N ⊆ N by:
N = {n ∈ N : s(n) = 1}
Problem 4.36. Show that the set of all sets of pairs of natural numbers, i.e.,
℘(N × N), is non-enumerable by a reduction argument.
Problem 4.38. Let S be the set of all surjections from N to the set {0, 1},
i.e., S consists of all surjections f : N → B. Show that S is non-enumerable.
Problem 4.39. Show that the set R of all real numbers is non-enumerable.
Chapter 5
Arithmetization
content/sets-functions-relations/arithmetization/integers.tex
5.1 From N to Z
Here are two basic realisations: sfr:arith:int:
sec
We already know that the ordered pairs of natural numbers are the elements of
N2 . And we are assuming that we understand N. So here is a naı̈ve suggestion,
based on the two realisations we have had: let’s treat integers as ordered pairs
of natural numbers.
In fact, this suggestion is too naı̈ve. Obviously we want it to be the case
that 0 − 2 = 4 − 6. But evidently ⟨0, 2⟩ ≠ ⟨4, 6⟩. So we cannot simply say that
N2 is the set of integers.
72
5.1. FROM N TO Z
a − b = c − d iff a + d = c + b
(It should be obvious that this is how integers are meant to behave: just add
b and d to both sides.) And the easy way to guarantee this behaviour is just
to define an equivalence relation between ordered pairs, ∼, as follows:
Now, one might have plenty of different philosophical reactions to this stip-
ulative definition. Before we consider those reactions, though, it is worth con-
tinuing with some of the technicalities.
Having said what the integers are, we shall need to define basic functions
and relations on them. Let’s write [m, n]∼ for the equivalence class under ∼
with ⟨m, n⟩ as an element.1 That is:
(As is common, I’m using ‘ab’ stand for ‘(a × b)’, just to make the axioms easier
to read.) Now, we need to make sure that these definitions behave as they ought
to. Spelling out what this means, and checking it through, is rather laborious;
we relegate the details to section 5.6. But the short point is: everything works!
1 Note: using the notation introduced in Definition 2.11, we would have written [⟨m, n⟩]
∼
for the same thing. But that’s just a bit harder to read.
One final thing remains. We have constructed the integers using natural
numbers. But this will mean that the natural numbers are not themselves
integers. We will return to the philosophical significance of this in section 5.5.
On a purely technical front, though, we will need some way to be able to
treat natural numbers as integers. The idea is quite easy: for each n ∈ N,
we just stipulate that nZ = [n, 0]∼ . We need to confirm that this definition is
well-behaved, i.e., that for any m, n ∈ N
(m + n)Z = mZ + nZ
(m × n)Z = mZ × nZ
m ≤ n ↔ mZ ≤ nZ
But this is all pretty straightforward. For example, to show that the second
of these obtains, we can simply help ourselves to the behaviour of the natural
numbers and reason as follows:
(m × n)Z = [m × n, 0]∼
= [m × n + 0 × 0, m × 0 + 0 × n]∼
= [m, 0]∼ × [n, 0]∼
= mZ × nZ
content/sets-functions-relations/arithmetization/rationals.tex
5.2 From Z to Q
We just saw how to construct the integers from the natural numbers, using sfr:arith:rat:
sec
some naı̈ve set theory. We shall now see how to construct the rationals from
the integers in a very similar way. Our initial realisations are:
1. Every rational can be written in the form i/j , where both i and j are
integers but j is non-zero.
The obvious approach would be to think of the rationals as ordered pairs drawn
from Z × (Z \ {0Z }). As before, though, that would be a bit too naı̈ve, since we
want 3/2 = 6/4, but ⟨3, 2⟩ =
̸ ⟨6, 4⟩. More generally, we will want the following:
We must check that this is an equivalence relation. This is very much like the
case of ∼, and we will leave it as an exercise.
Problem 5.2. Show that ∽ is an equivalence relation.
But it allows us to say:
Definition 5.3. The rationals are the equivalence classes, under ∽, of pairs of
integers (whose second element is non-zero). That is, Q = (Z × (Z \ {0Z }))/∽ .
As with the integers, we also want to define some basic operations. Where
[i, j]∽ is the equivalence class under ∽ with ⟨i, j⟩ as an element, we say:
[a, b]∽ ≤ [c, d]∽ iff [c, d]∽ − [a, b]∽ = [iZ , jZ ]∽
content/sets-functions-relations/arithmetization/reals.tex
√ √
Proof. Suppose, for reductio, that 2 is rational. So 2 = m/n for some natural
numbers m and n. Indeed, we can choose m and n so that the fraction cannot
be reduced any further. Re-organising, m2 = 2n2 . From here, we can complete
the proof in two ways:
First, geometrically (following Tennenbaum).2 Consider these squares:
n
m
Since m2 = 2n2 , the region where the two squares of side n overlap has the
same area as the region which neither of the two squares cover; i.e., the area
of the orange square equals the sum of the area of the two unshaded squares.
So where the orange √ square has side p, and each unshaded square has side q,
p2 = 2q 2 . But now 2 = p/q, with p < m and q < n and p, q ∈ N. This
contradicts the fact that m and n were chosen to be as small as possible.
Second, formally. Since m2 = 2n2 , it follows that m is even. (It is easy to
show that, if x is odd, then x2 is odd.) So m = 2r, for some r ∈ N. Rearranging,
2r2 = n2 , so n is also even. So both m and n are even, and hence the fraction
m/n can be reduced further. Contradiction!
{p ∈ Q : p2 < 2 or p < 0}
This has an upper bound in the rationals; its elements are all smaller
√ than 3,
for example. But what
√ is its least upper bound? We want to say ‘ 2’; but we
have just seen√that 2 is not rational. And there is no least rational number
greater than 2. So the set has an upper bound but no least upper bound.
Hence the rationals lack the Completeness Property.
2 This proof is reported by Conway (2006).
content/sets-functions-relations/arithmetization/cuts.tex
5.4 From Q to R
sfr:arith:cuts: In essence, the Completeness Property shows that any point α of the real line
sec
divides that line into two halves perfectly: those for which α is the least upper
bound, and those for which α is the greatest lower bound. To construct the
real numbers from the rational numbers, Dedekind suggested that we simply
think of the reals as the cuts that partition the rationals.
√ √ That is, we identify
√
2 with the cut which separates the rationals < 2 from the rationals > 2.
Let’s tidy this up. If we cut the rational numbers into two halves, we can
uniquely identify the partition we made just by considering its bottom half. So,
getting precise, we offer the following definition:
1. non-empty, proper : ∅ =
̸ α⊊Q
α ≤ β iff α ⊆ β
This definition of an order allows to state the central result, that the set of
cuts has the Completeness Property. Spelled out fully, the statement has this
shape. If S is a non-empty set of cuts with an upper bound, then S has a least
upper bound. In more detail: there is a cut, λ, which is an upper bound for
S, i.e. (∀α ∈ S)α ⊆ λ, and λ is the least such cut, i.e. (∀β ∈ R)((∀α ∈ S)α ⊆
β → λ ⊆ β). Now here is the proof of the result:
sfr:arith:cuts: Theorem 5.6. The set of cuts has the Completeness Property.
realcompleteness
S
Proof. Let S be any non-empty set of cuts with an upper bound. Let λ = S.
We first claim that λ is a cut:
α + β = {p + q : p ∈ α ∧ q ∈ β}
α × β = {p × q : 0 ≤ p ∈ α ∧ 0 ≤ q ∈ β} ∪ 0R if α, β ≥ 0R
−α = {p − q : p < 0 ∧ q ∈
/ α}
We then need to check that each of these definitions always yields a cut. And
finally, we need to go through an easy (but long-winded) demonstration that
the cuts, so defined, behave exactly as they should. But we relegate all of this
to section 5.6.
content/sets-functions-relations/arithmetization/reflections.tex
content/sets-functions-relations/arithmetization/checking-details.tex
Associativity a + (b + c) = (a + b) + c
(a × b) × c = a × (b × c)
Commutativity a+b=b+a
a×b=b×a
Identities a+0=a
a×1=a
Additive Inverse (∃b ∈ S)0 = a + b
Distributivity a × (b + c) = (a × b) + (a × c)
Implicitly, these are all bound with universal quantifiers restricted to S. And
note that the elements 0 and 1 here need not be the natural numbers with the
same name.
So, to check that the integers form a commutative ring, we just need to
check that we meet these eight conditions. None of the conditions is difficult
to establish, but this is a bit laborious. For example, here is how to prove
Associativity, in the case of addition:
But our task is not over. As well as defining addition and multiplication
over Z, we defined an ordering relation, ≤, and we must check that this behaves
as it should. In more detail, we must show that Z constitutes an ordered ring.3
3 Recall from Definition 2.16 that a total order is a relation which is reflexive, transitive,
a≤b→a+c≤b+c
(a ≤ b ∧ 0 ≤ c) → a × c ≤ b × c
Definition 5.9. An ordered field is an ordered ring which also satisfies: sfr:arith:check:
orderedfield
Once you have shown that Z constitutes an ordered ring, it is easy but
laborious to show that Q constitutes an ordered field.
Having dealt with the integers and the rationals, it only remains to deal with
the reals. In particular, we need to show that R constitutes a complete ordered
field, i.e., an ordered field with the Completeness Property. Now, Theorem 5.6
established that R has the Completeness Property. However, it remains to run
through the (tedious) of checking that R is an ordered field.
Before tearing off into that laborious exercise, we need to check some more
“immediate” things. For example, we need a guarantee that α + β, as defined,
is indeed a cut, for any cuts α and β. Here is a proof of that fact:
But here
√ is a small loose end to tidy up. In section 5.4, we suggest that we
can take 2 = {p ∈ Q : p < 0 or p2 < 2}. But we do need to show that this
set is a cut. Here is a proof of that fact:
p2 < 2
p2 + 2p < 2 + 2p
p(p + 2) < 2 + 2p
2+2p
p< p+2 =q
p2 < 2
2p2 + 4p + 2 < p2 + 4p + 4
4p2 + 8p + 4 < 2(p2 + 4p + 4)
(2p + 2)2 < 2(p + 2)2
(2p+2)2
(p+2)2 <2
2
q <2
content/sets-functions-relations/arithmetization/cauchy.tex
1.41421356237 . . .
The idea that reals can be considered via “increasingly good approximations”
provides us with the basis for another sequence of insights (akin to the reali-
sations that we used when constructing Q from Z, or Z from N). The basic
insights are these:
Of course, not just any function from N to Q will give us a real number. For
instance, consider this function:
(
1 if n is odd
f (n) =
0 if n is even
The general idea of a limit is the same as before: if you want a certain
level of precision (measured by ε), there is a “region” to look in (any input
greater than ℓ). And it is easy to see that our sequence
√ 1, 1.4, 1.414, 1.4142,
1.41421. . . has a limit: if you want to approximate 2 to within an error of
1/10n , then just look to any entry after the nth.
The obvious thought, then, would be to say that a real number just is
any Cauchy sequence. But, as in the constructions of Z and Q, this would
be too naı̈ve: for any given real number, multiple different Cauchy sequences
indicate that real number. A simple way to see this as follows. Given a Cauchy
sequence f , define g to be exactly the same function as f , except that g(0) ̸=
f (0). Since the two sequences agree everywhere after the first number, we will
(ultimately) want to say that they have the same limit, in the sense employed
in Definition 5.10, and so should be thought of “defining” the same real. So,
we should really think of these Cauchy sequences as the same real number.
Consequently, we again need to define an equivalence relation on the Cauchy
sequences, and identify real numbers with equivalence relations. First we need
the idea of a function which tends to 0 in the limit. For any function h : N → Q,
say that h tends to 0 iff for any positive ε ∈ Q we have that (∃ℓ ∈ N)(∀n >
ℓ)|f (n)| < ε.4 Further, where f and g are functions N → Q, let (f − g)(n) =
f (n) − g(n). Now define:
f ≎ g iff (f − g) tends to 0.
are Cauchy sequences, and indeed that the limit of both functions is 0, so that
also f ∼R g.
Having done this, we shall as usual write [f ]≎ for the equivalence class with
f as an element. However, to keep things readable, in what follows we will
drop the subscript and write just [f ]. We also stipulate that, for each q ∈ Q,
we have qR = [cq ], where cq is the constant function cq (n) = q for all n ∈ N.
We then define basic relations and operations on the reals, e.g.:
Proof. Exercise.
4 Compare this with the definition of limx→∞ f (x) = 0 in section 73.2.
Theorem 5.12. Every non-empty set of Cauchy sequences with an upper bound
has a least upper bound.
Proof sketch. Let S be any non-empty set of Cauchy sequences with an upper
bound. So there is some p ∈ Q such that pR is an upper bound for S. Let
r ∈ S; then there is some q ∈ Q such that qR < r. So if a least upper bound
on S exists, it is between qR and pR (inclusive).
We will hone in on the l.u.b., by approaching it simultaneously from below
and above. In particular, we define two functions, f, g : N → Q, with the aim
that f will hone in on the l.u.b. from above, and g will hone on in it from
below. We start by defining:
f (0) = p
g(0) = q
f (n)+g(n)
Then, where an = 2 , let:5
(
an if (∀h ∈ S)[h] ≤ (an )R
f (n + 1) =
f (n) otherwise
(
an if (∃h ∈ S)[h] ≥ (an )R
g(n + 1) =
g(n) otherwise
Both f and g are Cauchy sequences. (This can be checked fairly easily; but we
leave it as an exercise.) Note that the function (f − g) tends to 0, since the
difference between f and g halves at every step. Hence [f ] = [g].
We will show that (∀h ∈ S)[h] ≤ [f ], invoking Theorem 5.11 as we go. Let
h ∈ S and suppose, for reductio, that [f ] < [h], so that 0R < [(h − f )]. Since f
is a monotonically decreasing Cauchy sequence, there is some n ∈ N such that
[(cf (n) − f )] < [(h − f )]. So:
5 This is a recursive definition. But we have not yet given any reason to think that
86
Chapter 6
Infinite Sets
This chapter on infinite sets is taken from Tim Button’s Open Set
Theory.
content/sets-functions-relations/infinite/hilberts-hotel.tex
1 2 3 4 5 6 7 8 9 ...
1 2 3 4 5 6 7 8 9 ...
The crucial point is that Hilbert’s Hotel has infinitely many rooms; and we
can take his explanation to define what it means to say this. Indeed, this was
Dedekind’s approach (presented here, of course, with massive anachronism;
Dedekind’s definition is from 1888):
Definition 6.1. A set A is Dedekind infinite iff there is an injection from A to sfr:infinite:hilbert:
a proper subset of A. That is, there is some o ∈ A and an injection f : A → A defn:DedekindInfinite
such that o ∈
/ ran(f ).
content/sets-functions-relations/infinite/dedekind-algebra.tex
The first two conditions are easy to deal with using first-order logic (see above).
But we cannot deal with (3) just using first-order logic. Dedekind’s break-
through was to reformulate condition (3), set-theoretically, as follows:
3′ . The natural numbers are the smallest set that is closed under the succes-
sor function: that is, if we apply s to any element of the set, we obtain
another element of the set.
Definition 6.2. For any function f , the set X is f -closed iff (∀x ∈ X)f (x) ∈ sfr:infinite:dedekind:
Closure
X. Now define, for any o:
\
clof (o) = {X : o ∈ X and X is f -closed}
So clof (o) is the intersection of all the f -closed sets with o as an element.
Intuitively, then, clof (o) is the smallest f -closed set with o as an element. This
next result makes that intuitive thought precise;
sfr:infinite:dedekind: Lemma 6.3. For any function f and any o ∈ A:
closureproperties
sfr:infinite:dedekind: 1. o ∈ clof (o); and
closurehaselem
sfr:infinite:dedekind: 2. clof (o) is f -closed; and
closureclosed
sfr:infinite:dedekind: 3. if X is f -closed and o ∈ X, then clof (o) ⊆ X
closuresmallest
Proof. Note that there is at least one f -closed set with o as an element, namely
ran(f ) ∪ {o}. So clof (o), the intersection of all such sets, exists. We must now
check (1)–(3).
Concerning (1): o ∈ clof (o) as it is an intersection of sets which all have o
as an element.
Concerning (2): suppose x ∈ clof (o). So if o ∈ X and X is f -closed, then
x ∈ X, and now f (x) ∈ X as X is f -closed. So f (x) T ∈ clof (o).
Concerning (3): quite generally, if X ∈ C then C ⊆ X.
Since A = clof (o), our earlier result tells us that A is the smallest f -closed
set with o as an element. Clearly a Dedekind algebra is Dedekind infinite; just
look at clauses (1) and (2) of the definition. But the more exciting fact is that
any Dedekind infinite set can be turned into a Dedekind algebra.
sfr:infinite:dedekind: Theorem 6.5. If there is a Dedekind infinite set, then there is a Dedekind
thm:DedekindInfiniteAlgebra
algebra.
content/sets-functions-relations/infinite/dedekind-induction.tex
Corollary 6.7. Let N, s, o comprise a Dedekind algebra. Then for any for- sfr:infinite:induction:
natinductionschema
mula φ(x), which may have parameters:
content/sets-functions-relations/infinite/dedekinds-proof.tex
Dedekind’s bold idea is this. We have just shown how to build the natural
numbers using (naı̈ve) set theory alone. In chapter 5, we saw how to construct
the reals given the natural numbers and some set theory. So, perhaps, “arith-
metic (algebra, analysis)” turn out to be “merely a part of logic” (in Dedekind’s
extended sense of the word “logic”).
That’s the idea. But hold on for a moment. Our construction of a Dedekind
algebra (our surrogate for the natural numbers) is conditional on the existence
of a Dedekind infinite set. (Just look back to Theorem 6.5.) Unless the ex-
istence of a Dedekind infinite set can be established via “logic” or “the pure
laws of thought”, the project stalls.
So, can the existence of a Dedekind infinite set be established by “the pure
laws of thought”? Here was Dedekind’s effort:
My own realm of thoughts, i.e., the totality S of all things which can
be objects of my thought, is infinite. For if s signifies an element
of S, then the thought s′ that s can be an object of my thought,
is itself an element of S. If we regard this as an image φ(s) of the
element s, then . . . S is [Dedekind] infinite, which was to be proved.
(Dedekind, 1888, §66)
This is quite an astonishing thing to find in the middle of a book which largely
consists of highly rigorous mathematical proofs. Two remarks are worth mak-
ing.
First: this “proof” scarcely has what we would now recognize as a “math-
ematical” character. It speaks of psychological objects (thoughts), and merely
possible ones at that.
Second: at least as we have presented Dedekind algebras, this “proof” has
a straightforward technical shortcoming. If Dedekind’s argument is successful,
it establishes only that there are infinitely many things (specifically, infinitely
many thoughts). But Dedekind also needs to give us a reason to regard S as
a single set, with infinitely many elements, rather than thinking of S as some
things (in the plural).
The fact that Dedekind did not see a gap here might suggest that his use
of the word “totality” does not precisely track our use of the word “set”.1
But this would not be too surprising. The project we have pursued in the last
two chapters—a “construction” of the naturals, and from them a “construc-
tion” of the integers, reals and rationals—has all been carried out naı̈vely. We
have helped ourselves to this set, or that set, as and when we have needed
them, without laying down many general principles concerning exactly which
sets exist, and when. But we know that we need some general principles, for
otherwise we will fall into Russell’s Paradox.
The time has come for us to outgrow our naı̈vety.
1 Indeed, we have other reasons to think it did not; see Potter (2004, p. 23).
content/sets-functions-relations/infinite/card-sb.tex
for each set B and function f . Defined thus, Clof (B) is the smallest f -closed
set containing B, in that:
We’ll show that g is a bijection from C → B, from which it will follow that
g ◦ f −1 : A → B is a bijection, completing the proof.
First we claim that if x ∈ F but y ∈ / F then g(x) ̸= g(y). For reductio
suppose otherwise, so that y = g(y) = g(x) = f (x). Since x ∈ F and F is
f -closed by Lemma 6.8, we have y = f (x) ∈ F , a contradiction.
Finally, here is the proof of the main result. Recall that given a function h
and set D, we define h[D] = {h(x) : x ∈ D}.
Propositional Logic
This part contains material on classical propositional logic. The first
chapter is relatively rudimentary and just lists definitions and results, many
proofs are not carried out but are left as exercises. The material on proof
systems and the completeness theorem is included from the part on first-
order logic, with the “FOL” tag set to false. This leaves out everything
related to predicates, terms, and quantifiers, and replaces talk of struc-
tures M with talk about valuations v.
It is planned to expand this part to include more detail, and to add
further topics and results, such as truth-functional completeness.
Chapter 7
content/propositional-logic/syntax-and-semantics/introduction.tex
7.1 Introduction
pl:syn:int: Propositional logic deals with formulas that are built from propositional vari-
sec
ables using the propositional connectives ¬, ∧, ∨, →, and ↔. Intuitively,
a propositional variable p stands for a sentence or proposition that is true or
false. Whenever the “truth value” of the propositional variable in a formula
95
CHAPTER 7. SYNTAX AND SEMANTICS
is determined, so is the truth value of any formulas formed from them using
propositional connectives. We say that propositional logic is truth functional,
because its semantics is given by functions of truth values. In particular, in
propositional logic we leave out of consideration any further determination of
truth and falsity, e.g., whether something is necessarily true rather than just
contingently true, or whether something is known to be true, or whether some-
thing is true now rather than was true or will be true. We only consider two
truth values true (T) and false (F), and so exclude from discussion the possibil-
ity that a statement may be neither true nor false, or only half true. We also
concentrate only on connectives where the truth value of a formula built from
them is completely determined by the truth values of its parts (and not, say, on
its meaning). In particular, whether the truth value of conditionals in English
is truth functional in this sense is contentious. The material conditional → is;
other logics deal with conditionals that are not truth functional.
In order to develop the theory and metatheory of truth-functional propo-
sitional logic, we must first define the syntax and semantics of its expressions.
We will describe one way of constructing formulas from propositional variables
using the connectives. Alternative definitions are possible. Other systems will
choose different symbols, will select different sets of connectives as primitive,
and will use parentheses differently (or even not at all, as in the case of so-called
Polish notation). What all approaches have in common, though, is that the
formation rules define the set of formulas inductively. If done properly, every
expression can result essentially in only one way according to the formation
rules. The inductive definition resulting in expressions that are uniquely read-
able means we can give meanings to these expressions using the same method—
inductive definition.
Giving the meaning of expressions is the domain of semantics. The central
concept in semantics for propositional logic is that of satisfaction in a valuation.
A valuation v assigns truth values T, F to the propositional variables. Any
valuation determines a truth value v(φ) for any formula φ. A formula is satisfied
in a valuation v iff v(φ) = T—we write this as v ⊨ φ. This relation can also
be defined by induction on the structure of φ, using the truth functions for the
logical connectives to define, say, satisfaction of φ ∧ ψ in terms of satisfaction
(or not) of φ and ψ.
On the basis of the satisfaction relation v ⊨ φ for sentences we can then
define the basic semantic notions of tautology, entailment, and satisfiability.
A formula is a tautology, ⊨ φ, if every valuation satisfies it, i.e., v(φ) = T for
any v. It is entailed by a set of formulas, Γ ⊨ φ, if every valuation that satisfies
all the formulas in Γ also satisfies φ. And a set of formulas is satisfiable if
some valuation satisfies all formulas in it at the same time. Because formulas
are inductively defined, and satisfaction is in turn defined by induction on the
structure of formulas, we can use induction to prove properties of our semantics
and to relate the semantic notions defined.
content/propositional-logic/syntax-and-semantics/formulas.tex
we use above. Logic texts (and teachers) commonly use either ∼, ¬, and ! for
“negation”, ∧, ·, and & for “conjunction”. Commonly used symbols for the
“conditional” or “implication” are →, ⇒, and ⊃. Symbols for “biconditional,”
“bi-implication,” or “(material) equivalence” are ↔, ⇔, and ≡. The ⊥ symbol
is variously called “falsity,” “falsum,” “absurdity,” or “bottom.” The ⊤ symbol
is variously called “truth,” “verum,” or “top.”
1. ⊥ is an atomic formula.
2. ⊤ is an atomic formula.
content/propositional-logic/syntax-and-semantics/preliminaries.tex
7.3 Preliminaries
pl:syn:pre:
sec
Theorem 7.3 (Principle of induction on formulas). If some property P pl:syn:pre:
thm:induction
holds for all the atomic formulas and is such that
Proof. By induction on φ. For instance, suppose that φ has two distinct read-
ings as (ψ → χ) and (ψ ′ → χ′ ). Then ψ and ψ ′ must be the same (or else one
would be a proper initial segment of the other); so if the two readings of φ are
distinct it must be because χ and χ′ are distinct readings of the same sequence
of symbols, which is impossible by the inductive hypothesis.
Problem 7.3. For each of the five formulas below determine whether the for-
mula can be expressed as a substitution φ[ψ/pi ] where φ is (i) p0 ; (ii) (¬p0 ∧p1 );
and (iii) ((¬p0 → p1 ) ∧ p2 ). In each case specify the relevant substitution.
1. p1
2. (¬p0 ∧ p0 )
3. ((p0 ∨ p1 ) ∧ p2 )
4. ¬((p0 → p1 ) ∧ p2 )
content/propositional-logic/syntax-and-semantics/formation-sequences.tex
1. φi ≡ ¬φj .
2. φi ≡ (φj ∧ φk ).
3. φi ≡ (φj ∨ φk ).
4. φi ≡ (φj → φk ).
5. φi ≡ (φj ↔ φk ).
Example 7.9.
As can be seen from the second example, formation sequences may contain
‘junk’: formulas which are redundant or do not contribute to the construction.
We can also prove the converse. This is important because it shows that
our two ways of defining formulas are equivalent: they give the same results.
It also means that we can prove theorems about formulas by using ordinary
induction on the length of formation sequences.
pl:syn:fseq: Lemma 7.11. Suppose that ⟨φ0 , . . . , φn ⟩ is a formation sequence for φn , and
lem:fseq-init
that k ≤ n. Then ⟨φ0 , . . . , φk ⟩ is a formation sequence for φk .
Proof. Exercise.
pl:syn:fseq: Theorem 7.12. Frm(L0 ) is the set of all strings of symbols in the language L0
thm:fseq-frm-equiv
with a formation sequence.
Proof. Let F be the set of all strings of symbols in the language L0 that have
a formation sequence. We have seen in Proposition 7.10 that Frm(L0 ) ⊆ F , so
now we prove the converse.
Suppose φ has a formation sequence ⟨φ0 , . . . , φn ⟩. We prove that φ ∈
Frm(L0 ) by strong induction on n. Our induction hypothesis is that every
string of symbols with a formation sequence of length m < n is in Frm(L0 ).
By the definition of a formation sequence, either φn is atomic or there must
exist j, k < n such that one of the following is the case:
1. φn ≡ ¬φj .
2. φn ≡ (φj ∧ φk ).
3. φn ≡ (φj ∨ φk ).
4. φn ≡ (φj → φk ).
5. φn ≡ (φj ↔ φk ).
content/propositional-logic/syntax-and-semantics/valuations-sat.tex
v(⊥) = F;
v(⊤) = T;
v(pn ) = v(pn );
(
T if v(φ) = F;
v(¬φ) =
F otherwise.
(
T if v(φ) = T and v(ψ) = T;
v(φ ∧ ψ) =
F if v(φ) = F or v(ψ) = F.
(
T if v(φ) = T or v(ψ) = T;
v(φ ∨ ψ) =
F if v(φ) = F and v(ψ) = F.
(
T if v(φ) = F or v(ψ) = T;
v(φ → ψ) =
F if v(φ) = T and v(ψ) = F.
(
T if v(φ) = v(ψ);
v(φ ↔ ψ) =
F if v(φ) ̸= v(ψ).
φ ψ φ∧ψ φ ψ φ∨ψ
φ ¬φ T T T T T T
T F T F F T F T
F T F T F F T T
F F F F F F
φ ψ φ→ψ φ ψ φ↔ψ
T T T T T T
T F F T F F
F T T F T F
F F T F F T
pl:syn:val: Theorem 7.15 (Local Determination). Suppose that v1 and v2 are valu-
thm:LocalDetermination
ations that agree on the propositional variables occurring in φ, i.e., v1 (pn ) =
v2 (pn ) whenever pn occurs in some formula φ. Then v1 and v2 also agree on φ,
i.e., v1 (φ) = v2 (φ).
Proof. By induction on φ.
pl:syn:val: Definition 7.16 (Satisfaction). We can inductively define the notion of sat-
defn:satisfaction
isfaction of a formula φ by a valuation v, v ⊨ φ, as follows. (We write v ⊭ φ
to mean “not v ⊨ φ.”)
1. φ ≡ ⊥: v ⊭ φ.
2. φ ≡ ⊤: v ⊨ φ.
3. φ ≡ pi : v ⊨ φ iff v(pi ) = T.
4. φ ≡ ¬ψ: v ⊨ φ iff v ⊭ ψ.
Proof. By induction on φ.
content/propositional-logic/syntax-and-semantics/semantic-notions.tex
Problem 7.7. For each of the following four formulas determine whether it is
(a) satisfiable, (b) tautology, and (c) contingent.
1. (p0 → (¬p1 → ¬p0 )).
2. ((p0 ∧ ¬p1 ) → (¬p0 ∧ p2 )) ↔ ((p2 → p0 ) → (p0 → p1 )).
3. (p0 ↔ p1 ) → (p2 ↔ ¬p1 ).
4. ((p0 ↔ (¬p1 ∧ p2 )) ∨ (p2 → (p0 ↔ p1 ))).
Proof. Exercise.
Proof. Exercise.
Proof. Exercise.
Chapter 8
Derivation Systems
content/propositional-logic/../first-order-logic/proof-systems/introduction.tex
8.1 Introduction
pl:prf:int: Logics commonly have both a semantics and a derivation system. The seman-
sec
tics concerns concepts such as truth, satisfiability, validity, and entailment.
The purpose of derivation systems is to provide a purely syntactic method of
establishing entailment and validity. They are purely syntactic in the sense
that a derivation in such a system is a finite syntactic object, usually a se-
quence (or other finite arrangement) of sentences or formulas. Good derivation
systems have the property that any given sequence or arrangement of sentences
or formulas can be verified mechanically to be “correct.”
105
CHAPTER 8. DERIVATION SYSTEMS
The simplest (and historically first) derivation systems for first-order logic
were axiomatic. A sequence of formulas counts as a derivation in such a sys-
tem if each individual formula in it is either among a fixed set of “axioms”
or follows from formulas coming before it in the sequence by one of a fixed
number of “inference rules”—and it can be mechanically verified if a formula
is an axiom and whether it follows correctly from other formulas by one of the
inference rules. Axiomatic derivation systems are easy to describe—and also
easy to handle meta-theoretically—but derivations in them are hard to read
and understand, and are also hard to produce.
Other derivation systems have been developed with the aim of making it
easier to construct derivations or easier to understand derivations once they
are complete. Examples are natural deduction, truth trees, also known as
tableaux proofs, and the sequent calculus. Some derivation systems are de-
signed especially with mechanization in mind, e.g., the resolution method is
easy to implement in software (but its derivations are essentially impossible to
understand). Most of these other derivation systems represent derivations as
trees of formulas rather than sequences. This makes it easier to see which parts
of a derivation depend on which other parts.
So for a given logic, such as first-order logic, the different derivation systems
will give different explications of what it is for a sentence to be a theorem and
what it means for a sentence to be derivable from some others. However that is
done (via axiomatic derivations, natural deductions, sequent derivations, truth
trees, resolution refutations), we want these relations to match the semantic
notions of validity and entailment. Let’s write ⊢ φ for “φ is a theorem” and
“Γ ⊢ φ” for “φ is derivable from Γ .” However ⊢ is defined, we want it to match
up with ⊨, that is:
1. ⊢ φ if and only if ⊨ φ
2. Γ ⊢ φ if and only if Γ ⊨ φ
The “only if” direction of the above is called soundness. A derivation system is
sound if derivability guarantees entailment (or validity). Every decent deriva-
tion system has to be sound; unsound derivation systems are not useful at all.
After all, the entire purpose of a derivation is to provide a syntactic guarantee
of validity or entailment. We’ll prove soundness for the derivation systems we
present.
The converse “if” direction is also important: it is called completeness.
A complete derivation system is strong enough to show that φ is a theorem
whenever φ is valid, and that Γ ⊢ φ whenever Γ ⊨ φ. Completeness is harder
to establish, and some logics have no complete derivation systems. First-order
logic does. Kurt Gödel was the first one to prove completeness for a derivation
system of first-order logic in his 1929 dissertation.
Another concept that is connected to derivation systems is that of consis-
tency. A set of sentences is called inconsistent if anything whatsoever can be
derived from it, and consistent otherwise. Inconsistency is the syntactic coun-
terpart to unsatisfiablity: like unsatisfiable sets, inconsistent sets of sentences
do not make good theories, they are defective in a fundamental way. Consis-
tent sets of sentences may not be true or useful, but at least they pass that
minimal threshold of logical usefulness. For different derivation systems the
specific definition of consistency of sets of sentences might differ, but like ⊢, we
want consistency to coincide with its semantic counterpart, satisfiability. We
want it to always be the case that Γ is consistent if and only if it is satisfi-
able. Here, the “if” direction amounts to completeness (consistency guarantees
satisfiability), and the “only if” direction amounts to soundness (satisfiability
guarantees consistency). In fact, for classical first-order logic, the two versions
of soundness and completeness are equivalent.
content/propositional-logic/../first-order-logic/proof-systems/sequent-calculus.tex
the sequent calculus, but these derivations are often hard to read and their
connection to proofs are sometimes not easy to see. It has proved to be a very
elegant approach to derivation systems, however, and many logics have sequent
calculus systems.
content/propositional-logic/../first-order-logic/proof-systems/natural-deduction.tex
[φ ∧ ψ]1
φ ∧Elim
1 →Intro
(φ ∧ ψ) → φ
content/propositional-logic/../first-order-logic/proof-systems/tableaux.tex
8.4 Tableaux
pl:prf:tab: While many derivation systems operate with arrangements of sentences, tableaux
sec
operate with signed formulas. A signed formula is a pair consisting of a truth
value sign (T or F) and a sentence
T φ or F φ.
1. F (φ ∧ ψ) → φ Assumption
2. Tφ ∧ ψ →F 1
3. Fφ →F 1
4. Tφ →T 2
5. Tψ →T 2
⊗
content/propositional-logic/../first-order-logic/proof-systems/axiomatic-deduction.t
1. φ is an axiom, or
φ → (ψ → φ) ψ → (ψ ∨ χ) (ψ ∧ χ) → ψ
are common axioms that govern →, ∨ and ∧. Some axiom systems aim at a
minimal number of axioms. Depending on the connectives that are taken as
primitives, it is even possible to find axiom systems that consist of a single
axiom.
A rule of inference is a conditional statement that gives a sufficient condition
for a sentence in a derivation to be justified. Modus ponens is one very common
such rule: it says that if φ and φ → ψ are already justified, then ψ is justified.
This means that a line in a derivation containing the sentence ψ is justified,
provided that both φ and φ → ψ (for some sentence φ) appear in the derivation
before ψ.
The ⊢ relation based on axiomatic derivations is defined as follows: Γ ⊢ φ
iff there is a derivation with the sentence φ as its last formula (and Γ is taken
as the set of sentences in that derivation which are justified by (2) above). φ
is a theorem if φ has a derivation where Γ is empty, i.e., every sentence in the
derivation is justified either by (1) or (3). For instance, here is a derivation
that shows that ⊢ φ → (ψ → (ψ ∨ φ)):
1. ψ → (ψ ∨ φ)
2. (ψ → (ψ ∨ φ)) → (φ → (ψ → (ψ ∨ φ)))
3. φ → (ψ → (ψ ∨ φ))
111
CHAPTER 9. THE SEQUENT CALCULUS
However, they are very hard to use in practice, i.e., it is difficult to find and
write proofs.
Chapter 9
content/propositional-logic/../first-order-logic/sequent-calculus/rules-and-proofs.t
Γ ⇒∆
where Γ and ∆ are finite (possibly empty) sequences of sentences of the lan-
guage L. Γ is called the antecedent, while ∆ is the succedent.
explanation The intuitive idea behind a sequent is: if all of the sentences in the an-
tecedent hold, then at least one of the sentences in the succedent holds. That
is, if Γ = ⟨φ1 , . . . , φm ⟩ and ∆ = ⟨ψ1 , . . . , ψn ⟩, then Γ ⇒ ∆ holds iff
(φ1 ∧ · · · ∧ φm ) → (ψ1 ∨ · · · ∨ ψn )
holds. There are two special cases: where Γ is empty and when ∆ is empty.
When Γ is empty, i.e., m = 0, ⇒ ∆ holds iff ψ1 ∨ · · · ∨ ψn holds. When ∆
is empty, i.e., n = 0, Γ ⇒ holds iff ¬(φ1 ∧ · · · ∧ φm ) does. We say a sequent
is valid iff the corresponding sentence is valid.
1. φ ⇒ φ
2. ⇒⊤
3. ⊥ ⇒
Derivations in the sequent calculus are certain trees of sequents, where the
topmost sequents are initial sequents, and if a sequent stands below one or two
other sequents, it must follow correctly by a rule of inference. The rules for LK
are divided into two main types: logical rules and structural rules. The logical
rules are named for the main operator of the sentence containing φ and/or ψ in
the lower sequent. Each one comes in two versions, one for inferring a sequent
with the sentence containing the logical operator on the left, and one with the
sentence on the right.
content/propositional-logic/../first-order-logic/sequent-calculus/propositional-rules.tex
Γ ⇒ ∆, φ φ, Γ ⇒ ∆
¬L ¬R
¬φ, Γ ⇒ ∆ Γ ⇒ ∆, ¬φ
Rules for ∧
φ, Γ ⇒ ∆
∧L
φ ∧ ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ ∧ ψ
∧L
φ ∧ ψ, Γ ⇒ ∆
Rules for ∨
Γ ⇒ ∆, φ
∨R
φ, Γ ⇒ ∆ ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ ∨ ψ
∨L
φ ∨ ψ, Γ ⇒ ∆ Γ ⇒ ∆, ψ
∨R
Γ ⇒ ∆, φ ∨ ψ
Rules for →
Γ ⇒ ∆, φ ψ, Π ⇒ Λ φ, Γ ⇒ ∆, ψ
→L →R
φ → ψ, Γ, Π ⇒ ∆, Λ Γ ⇒ ∆, φ → ψ
content/propositional-logic/../first-order-logic/sequent-calculus/structural-rules.t
Weakening
Γ ⇒ ∆ Γ ⇒ ∆
WL WR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
Contraction
φ, φ, Γ ⇒ ∆ Γ ⇒ ∆, φ, φ
CL CR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
Exchange
Γ, φ, ψ, Π ⇒ ∆ Γ ⇒ ∆, φ, ψ, Λ
XL XR
Γ, ψ, φ, Π ⇒ ∆ Γ ⇒ ∆, ψ, φ, Λ
Γ ⇒ ∆, φ φ, Π ⇒ Λ
Cut
Γ, Π ⇒ ∆, Λ
content/propositional-logic/../first-order-logic/sequent-calculus/derivations.tex
9.4 Derivations
pl:seq:der: We’ve said what an initial sequent looks like, and we’ve given the rules of explanation
sec
inference. Derivations in the sequent calculus are inductively generated from
these: each derivation either is an initial sequent on its own, or consists of one
or two derivations followed by an inference.
We then say that S is the end-sequent of the derivation and that S is derivable
in LK (or LK-derivable).
Γ ⇒ ∆
WL
φ, Γ ⇒ ∆
The rule, however, is meant to be general: we can replace the φ in the rule
with any sentence, e.g., also with θ. If the premise matches our initial sequent
χ ⇒ χ, that means that both Γ and ∆ are just χ, and the conclusion would
then be θ, χ ⇒ χ. So, the following is a derivation:
χ ⇒ χ
WL
θ, χ ⇒ χ
We can now apply another rule, say XL, which allows us to switch two sentences
on the left. So, the following is also a correct derivation:
χ ⇒ χ
WL
θ, χ ⇒ χ
XL
χ, θ ⇒ χ
both Γ and Π were empty, ∆ is χ, and the roles of φ and ψ are played by θ
and χ, respectively. In much the same way, we also see that
θ ⇒ θ
WL
χ, θ ⇒ θ
is a derivation. Now we can take these two derivations, and combine them
using ∧R. That rule was
Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
Γ ⇒ ∆, φ ∧ ψ
In our case, the premises must match the last sequents of the derivations ending
in the premises. That means that Γ is χ, θ, ∆ is empty, φ is χ and ψ is θ. So
the conclusion, if the inference should be correct, is χ, θ ⇒ χ ∧ θ.
χ ⇒ χ
WL
θ, χ ⇒ χ θ ⇒ θ
XL WL
χ, θ ⇒ χ χ, θ ⇒ θ
∧R
χ, θ ⇒ χ ∧ θ
Of course, we can also reverse the premises, then φ would be θ and ψ would
be χ.
χ ⇒ χ
WL
θ ⇒ θ θ, χ ⇒ χ
WL XL
χ, θ ⇒ θ χ, θ ⇒ χ
∧R
χ, θ ⇒ θ ∧ χ
content/propositional-logic/../first-order-logic/sequent-calculus/proving-things.tex
φ∧ψ ⇒ φ
Next, we need to figure out what kind of inference could have a lower sequent
of this form. This could be a structural rule, but it is a good idea to start by
looking for a logical rule. The only logical connective occurring in the lower
sequent is ∧, so we’re looking for an ∧ rule, and since the ∧ symbol occurs in
the antecedent, we’re looking at the ∧L rule.
∧L
φ∧ψ ⇒ φ
There are two options for what could have been the upper sequent of the ∧L
inference: we could have an upper sequent of φ ⇒ φ, or of ψ ⇒ φ. Clearly,
φ ⇒ φ is an initial sequent (which is a good thing), while ψ ⇒ φ is not
derivable in general. We fill in the upper sequent:
φ ⇒ φ
∧L
φ∧ψ ⇒ φ
¬φ ∨ ψ ⇒ φ → ψ
To find a logical rule that could give us this end-sequent, we look at the logical
connectives in the end-sequent: ¬, ∨, and →. We only care at the moment
about ∨ and → because they are main operators of sentences in the end-sequent,
while ¬ is inside the scope of another connective, so we will take care of it later.
Our options for logical rules for the final inference are therefore the ∨L rule
and the →R rule. We could pick either rule, really, but let’s pick the →R rule
(if for no reason other than it allows us to put off splitting into two branches).
According to the form of →R inferences which can yield the lower sequent, this
must look like:
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ→ψ
Remember that we are trying to wind our way up to initial sequents; we seem
to be pretty close! The right branch is just one weakening and one exchange
away from an initial sequent and then it is done:
ψ ⇒ ψ
WL
φ, ψ ⇒ ψ
XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
Now looking at the left branch, the only logical connective in any sentence
is the ¬ symbol in the antecedent sentences, so we’re looking at an instance of
the ¬L rule.
ψ ⇒ ψ
WL
φ ⇒ ψ, φ φ, ψ ⇒ ψ
¬L XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
Similarly to how we finished off the right branch, we are just one weakening
and one exchange away from finishing off this left branch as well.
φ ⇒ φ
WR
φ ⇒ φ, ψ ψ ⇒ ψ
XR WL
φ ⇒ ψ, φ φ, ψ ⇒ ψ
¬L XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
The available main connectives of sentences in the end-sequent are the ∨ symbol
and the ¬ symbol. It would work to apply either the ∨L or the ¬R rule here,
but we start with the ¬R rule because it avoids splitting up into two branches
for a moment:
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
Now we have a choice of whether to look at the ∧L or the ∨L rule. Let’s see
what happens when we apply the ∧L rule: we have a choice to start with either
the sequent φ, ¬φ ∨ ψ ⇒ or the sequent ψ, ¬φ ∨ ψ ⇒ . Since the derivation
is symmetric with regards to φ and ψ, let’s go with the former:
φ, ¬φ ∨ ¬ψ ⇒
∧L
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
Continuing to fill in the derivation, we see that we run into a problem:
?
φ ⇒ φ φ ⇒ ψ
¬L ¬L
¬φ, φ ⇒ ¬ψ, φ ⇒
∨L
¬φ ∨ ¬ψ, φ ⇒
XL
φ, ¬φ ∨ ¬ψ ⇒
∧L
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
The top of the right branch cannot be reduced any further, and it cannot be
brought by way of structural inferences to an initial sequent, so this is not the
right path to take. So clearly, it was a mistake to apply the ∧L rule above.
Going back to what we had before and carrying out the ∨L rule instead, we
get
¬φ, φ ∧ ψ ⇒ ¬ψ, φ ∧ ψ ⇒
∨L
¬φ ∨ ¬ψ, φ ∧ ψ ⇒
XL
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
Completing each branch as we’ve done before, we get
φ ⇒ φ ψ ⇒ ψ
∧L ∧L
φ∧ψ ⇒ φ φ∧ψ ⇒ ψ
¬L ¬L
¬φ, φ ∧ ψ ⇒ ¬ψ, φ ∧ ψ ⇒
∨L
¬φ ∨ ¬ψ, φ ∧ ψ ⇒
XL
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
(We could have carried out the ∧ rules lower than the ¬ rules in these steps
and still obtained a correct derivation).
Example 9.8. So far we haven’t used the contraction rule, but it is sometimes
required. Here’s an example where that happens. Suppose we want to prove
⇒ φ ∨ ¬φ. Applying ∨R backwards would give us one of these two derivations:
φ ⇒
⇒ φ ⇒ ¬φ ¬R
⇒ φ ∨ ¬φ ∨R ⇒ φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ, φ
⇒ φ ∨ ¬φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ CR
Now we can apply ∨R a second time, and also get ¬φ, which leads to a complete
derivation.
φ ⇒ φ
⇒ φ, ¬φ ¬R
⇒ φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ, φ XR
⇒ φ ∨ ¬φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ CR
1. φ ∧ (ψ ∧ χ) ⇒ (φ ∧ ψ) ∧ χ.
2. φ ∨ (ψ ∨ χ) ⇒ (φ ∨ ψ) ∨ χ.
3. φ → (ψ → χ) ⇒ ψ → (φ → χ).
4. φ ⇒ ¬¬φ.
1. (φ ∨ ψ) → χ ⇒ φ → χ.
2. (φ → χ) ∧ (ψ → χ) ⇒ (φ ∨ ψ) → χ.
3. ⇒ ¬(φ ∧ ¬φ).
4. ψ → φ ⇒ ¬φ → ¬ψ.
5. ⇒ (φ → ¬φ) → ¬φ.
6. ⇒ ¬(φ → ψ) → ¬ψ.
7. φ → χ ⇒ ¬(φ ∧ ¬χ).
8. φ ∧ ¬χ ⇒ ¬(φ → χ).
9. φ ∨ ψ, ¬ψ ⇒ φ.
This section collects the definitions of the provability relation and con-
sistency for natural deduction.
content/propositional-logic/../first-order-logic/sequent-calculus/proof-theoretic-notions.tex
Because of the contraction, weakening, and exchange rules, the order and
number of sentences in Γ0′ does not matter: if a sequent Γ0′ ⇒ φ is derivable,
then so is Γ0′′ ⇒ φ for any Γ0′′ that contains the same sentences as Γ0′ . For
instance, if Γ0 = {ψ, χ} then both Γ0′ = ⟨ψ, ψ, χ⟩ and Γ0′′ = ⟨χ, χ, ψ⟩ are
sequences containing just the sentences in Γ0 . If a sequent containing one is
derivable, so is the other, e.g.:
ψ, ψ, χ ⇒ φ
CL
ψ, χ ⇒ φ
XL
χ, ψ ⇒ φ
WL
χ, χ, ψ ⇒ φ
π0 π1
Γ0 ⇒ φ φ, ∆0 ⇒ ψ
Cut
Γ0 , ∆0 ⇒ ψ
Proof. Exercise.
content/propositional-logic/../first-order-logic/sequent-calculus/provability-consistency.tex
π0 π1
Γ0 ⇒ φ φ, Γ1 ⇒
Cut
Γ0 , Γ1 ⇒
Since Γ0 ⊆ Γ and Γ1 ⊆ Γ , Γ0 ∪ Γ1 ⊆ Γ , hence Γ is inconsistent.
π1
φ ⇒ φ
⇒ φ, ¬φ ¬R ¬φ, Γ ⇒
Cut
Γ ⇒ φ
π φ ⇒ φ
¬φ, φ ⇒ ¬L
Γ0 ⇒ φ φ, ¬φ ⇒ XL
Cut
Γ0 , ¬φ ⇒
Since ¬φ ∈ Γ and Γ0 ⊆ Γ , this shows that Γ is inconsistent.
Proposition 9.20. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ is pl:seq:prv:
prop:provability-exhaustive
inconsistent.
π0
π1
φ, Γ0 ⇒
¬R
Γ0 ⇒ ¬φ ¬φ, Γ1 ⇒
Cut
Γ0 , Γ1 ⇒
Since Γ0 ⊆ Γ and Γ1 ⊆ Γ , Γ0 ∪ Γ1 ⊆ Γ . Hence Γ is inconsistent.
content/propositional-logic/../first-order-logic/sequent-calculus/provability-propos
pl:seq:ppr: 2. φ, ψ ⊢ φ ∧ ψ.
prop:provability-land-right
φ ⇒ φ ψ ⇒ ψ
∧L ∧L
φ∧ψ ⇒ φ φ∧ψ ⇒ ψ
φ ⇒ φ ψ ⇒ ψ
∧R
φ, ψ ⇒ φ ∧ ψ
1. φ ∨ ψ, ¬φ, ¬ψ is inconsistent.
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
φ ⇒ φ ψ ⇒ ψ
¬L ¬L
¬φ, φ ⇒ ¬ψ, ψ ⇒
φ, ¬φ, ¬ψ ⇒ ψ, ¬φ, ¬ψ ⇒
∨L
φ ∨ ψ, ¬φ, ¬ψ ⇒
φ ⇒ φ ψ ⇒ ψ
∨R ∨R
φ ⇒ φ∨ψ ψ ⇒ φ∨ψ
pl:seq:ppr: 1. φ, φ → ψ ⊢ ψ.
prop:provability-lif-left
φ ⇒ φ ψ ⇒ ψ
→L
φ → ψ, φ ⇒ ψ
φ ⇒ φ
¬φ, φ ⇒ ¬L
φ, ¬φ ⇒ XL ψ ⇒ ψ
WR WL
φ, ¬φ ⇒ ψ φ, ψ ⇒ ψ
→R →R
¬φ ⇒ φ→ψ ψ ⇒ φ→ψ
content/propositional-logic/../first-order-logic/sequent-calculus/soundness.tex
9.9 Soundness
explanation A derivation system, such as the sequent calculus, is sound if it cannot derive pl:seq:sou:
sec
things that do not actually hold. Soundness is thus a kind of guaranteed safety
property for derivation systems. Depending on which proof theoretic property
is in question, we would like to know for instance, that
1. every derivable φ is a tautology;
2. if a sentence is derivable from some others, it is also a consequence of
them;
3. if a set of sentences is inconsistent, it is unsatisfiable.
These are important properties of a derivation system. If any of them do
not hold, the derivation system is deficient—it would derive too much. Con-
sequently, establishing the soundness of a derivation system is of the utmost
importance.
Because all these proof-theoretic properties are defined via derivability in
the sequent calculus of certain sequents, proving (1)–(3) above requires proving
something about the semantic properties of derivable sequents. We will first
define what it means for a sequent to be valid, and then show that every
derivable sequent is valid. (1)–(3) then follow as corollaries from this result.
Definition 9.24. A valuation v satisfies a sequent Γ ⇒ ∆ iff either v ⊭ φ for
some φ ∈ Γ or v ⊨ φ for some φ ∈ ∆.
A sequent is valid iff every valuation v satisfies it.
Γ ⇒ ∆ Γ ⇒ ∆
WL WR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
2. The last inference is ¬L: Then the premise of the last inference is Γ ⇒
∆, φ and the conclusion is ¬φ, Γ ⇒ ∆, i.e., the derivation ends in
Γ ⇒ ∆, φ
¬L
¬φ, Γ ⇒ ∆
4. The last inference is ∧L: There are two variants: φ ∧ ψ may be inferred
on the left from φ or from ψ on the left side of the premise. In the first
case, the π ends in
φ, Γ ⇒ ∆
∧L
φ ∧ ψ, Γ ⇒ ∆
5. The last inference is ∨R: There are two variants: φ ∨ ψ may be inferred
on the right from φ or from ψ on the right side of the premise. In the
first case, π ends in
Γ ⇒ ∆, φ
∨R
Γ ⇒ ∆, φ ∨ ψ
φ, Γ ⇒ ∆, ψ
→R
Γ ⇒ ∆, φ → ψ
Again, the induction hypothesis says that the premise is valid; we want
to show that the conclusion is valid as well. Let v be arbitrary. Since
φ, Γ ⇒ ∆, ψ is valid, at least one of the following cases obtains: (a) v ⊭ φ,
(b) v ⊨ ψ, (c) v ⊭ χ for some χ ∈ Γ , or (d) v ⊨ χ for some χ ∈ ∆. In
cases (a) and (b), v ⊨ φ → ψ and so there is a χ ∈ ∆, φ → ψ such that
v ⊨ χ. In case (c), for some χ ∈ Γ , v ⊭ χ. In case (d), for some χ ∈ ∆,
v ⊨ χ. In each case, v satisfies Γ ⇒ ∆, φ → ψ. Since v was arbitrary,
Γ ⇒ ∆, φ → ψ is valid.
Γ ⇒ ∆, φ φ, Π ⇒ Λ
Cut
Γ, Π ⇒ ∆, Λ
Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
Γ ⇒ ∆, φ ∧ ψ
Γ ⇒ ∆, φ ψ, Π ⇒ Λ
→L
φ → ψ, Γ, Π ⇒ ∆, Λ
Chapter 10
Natural Deduction
content/propositional-logic/../first-order-logic/natural-deduction/rules-and-proofs.
130
10.2. PROPOSITIONAL RULES
content/propositional-logic/../first-order-logic/natural-deduction/propositional-rules.tex
φ∧ψ
φ ∧Elim
φ ψ
∧Intro
φ∧ψ φ∧ψ
∧Elim
ψ
Rules for ∨
φ [φ]n [ψ]n
∨Intro
φ∨ψ
ψ
∨Intro φ∨ψ χ χ
φ∨ψ n ∨Elim
χ
Rules for →
[φ]n
φ→ψ φ
→Elim
ψ
ψ
n →Intro
φ→ψ
Rules for ¬
[φ]n
¬φ φ
¬Elim
⊥
⊥
n
¬φ ¬Intro
Rules for ⊥
[¬φ]n
⊥ ⊥
φ I
n
⊥ ⊥
φ C
Note that ¬Intro and ⊥C are very similar: The difference is that ¬Intro derives
a negated sentence ¬φ but ⊥C a positive sentence φ.
Whenever a rule indicates that some assumption may be discharged, we
take this to be a permission, but not a requirement. E.g., in the →Intro rule,
we may discharge any number of assumptions of the form φ in the derivation
of the premise ψ, including zero.
content/propositional-logic/../first-order-logic/natural-deduction/derivations.tex
10.3 Derivations
explanation We’ve said what an assumption is, and we’ve given the rules of inference. pl:ntd:der:
sec
Derivations in natural deduction are inductively generated from these: each
derivation either is an assumption on its own, or consists of one, two, or three
derivations followed by a correct inference.
Definition 10.2 (Derivation). A derivation of a sentence φ from assump-
tions Γ is a finite tree of sentences satisfying the following conditions:
We then say that φ is the conclusion of the derivation and Γ its undischarged
assumptions.
If a derivation of φ from Γ exists, we say that φ is derivable from Γ , or
in symbols: Γ ⊢ φ. If there is a derivation of φ in which every assumption is
discharged, we write ⊢ φ.
These rules are meant to be general: we can replace the φ and ψ in it with any
sentences, e.g., by χ and θ. Then the conclusion would be χ ∧ θ, and so
χ θ
∧Intro
χ∧θ
ψ
1 →Intro
φ→ψ
content/propositional-logic/../first-order-logic/natural-deduction/proving-things.te
(φ ∧ ψ) → φ
Next, we need to figure out what kind of inference could result in a sentence
of this form. The main operator of the conclusion is →, so we’ll try to arrive at
the conclusion using the →Intro rule. It is best to write down the assumptions
involved and label the inference rules as you progress, so it is easy to see whether
all assumptions have been discharged at the end of the proof.
[φ ∧ ψ]1
φ
1 →Intro
(φ ∧ ψ) → φ
[φ ∧ ψ]1
φ ∧Elim
1 →Intro
(φ ∧ ψ) → φ
(¬φ ∨ ψ) → (φ → ψ)
To find a logical rule that could give us this conclusion, we look at the logical
connectives in the conclusion: ¬, ∨, and →. We only care at the moment about
the first occurrence of → because it is the main operator of the sentence in the
end-sequent, while ¬, ∨ and the second occurrence of → are inside the scope
of another connective, so we will take care of those later. We therefore start
with the →Intro rule. A correct application must look like this:
[¬φ ∨ ψ]1
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
This leaves us with two possibilities to continue. Either we can keep working
from the bottom up and look for another application of the →Intro rule, or we
can work from the top down and apply a ∨Elim rule. Let us apply the latter.
We will use the assumption ¬φ ∨ ψ as the leftmost premise of ∨Elim. For a
valid application of ∨Elim, the other two premises must be identical to the
conclusion φ → ψ, but each may be derived in turn from another assumption,
namely one of the two disjuncts of ¬φ ∨ ψ. So our derivation will look like this:
[¬φ]2 [ψ]2
ψ ψ
3 →Intro 4 →Intro
[¬φ ∨ ψ]1 φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
For the two missing parts of the derivation, we need derivations of ψ from
¬φ and φ in the middle, and from φ and ψ on the left. Let’s take the former
first. ¬φ and φ are the two premises of ¬Elim:
[¬φ]2 [φ]3
¬Elim
⊥
[ψ]2 , [φ]4
[¬φ]2 [φ]3
⊥Intro
⊥ ⊥
I
ψ ψ
3 →Intro 4 →Intro
[¬φ ∨ ψ]1 φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
Let’s now look at the rightmost branch. Here it’s important to realize
that the definition of derivation allows assumptions to be discharged but does
not require them to be. In other words, if we can derive ψ from one of the
assumptions φ and ψ without using the other, that’s ok. And to derive ψ
from ψ is trivial: ψ by itself is such a derivation, and no inferences are needed.
So we can simply delete the assumption φ.
[¬φ]2 [φ]3
¬Elim
⊥ ⊥
I
ψ [ψ]2
3 →Intro →Intro
[¬φ ∨ ψ]1 φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
Note that in the finished derivation, the rightmost →Intro inference does not
actually discharge any assumptions.
Example 10.6. So far we have not needed the ⊥C rule. It is special in that it
allows us to discharge an assumption that isn’t a sub-formula of the conclusion
of the rule. It is closely related to the ⊥I rule. In fact, the ⊥I rule is a special
case of the ⊥C rule—there is a logic called “intuitionistic logic” in which only
⊥I is allowed. The ⊥C rule is a last resort when nothing else works. For
instance, suppose we want to derive φ ∨ ¬φ. Our usual strategy would be to
attempt to derive φ ∨ ¬φ using ∨Intro. But this would require us to derive
either φ or ¬φ from no assumptions, and this can’t be done. ⊥C to the rescue!
[¬(φ ∨ ¬φ)]1
1
⊥ ⊥
φ ∨ ¬φ C
Now we’re looking for a derivation of ⊥ from ¬(φ ∨ ¬φ). Since ⊥ is the
conclusion of ¬Elim we might try that:
¬φ φ
¬Elim
1
⊥ ⊥
φ ∨ ¬φ C
⊥
2
¬φ ¬Intro φ
¬Elim
1
⊥ ⊥C
φ ∨ ¬φ
Here, we can get ⊥ easily by applying ¬Elim to the assumption ¬(φ ∨ ¬φ) and
φ ∨ ¬φ which follows from our new assumption φ by ∨Intro:
[¬(φ ∨ ¬φ)]1
[φ]2
[¬(φ ∨ ¬φ)]1 φ ∨ ¬φ ∨Intro
¬Elim
⊥
2
¬φ ¬Intro φ
¬Elim
1
⊥ ⊥
φ ∨ ¬φ C
1. φ ∧ (ψ ∧ χ) ⊢ (φ ∧ ψ) ∧ χ.
2. φ ∨ (ψ ∨ χ) ⊢ (φ ∨ ψ) ∨ χ.
3. φ → (ψ → χ) ⊢ ψ → (φ → χ).
4. φ ⊢ ¬¬φ.
1. (φ ∨ ψ) → χ ⊢ φ → χ.
2. (φ → χ) ∧ (ψ → χ) ⊢ (φ ∨ ψ) → χ.
3. ⊢ ¬(φ ∧ ¬φ).
4. ψ → φ ⊢ ¬φ → ¬ψ.
5. ⊢ (φ → ¬φ) → ¬φ.
6. ⊢ ¬(φ → ψ) → ¬ψ.
7. φ → χ ⊢ ¬(φ ∧ ¬χ).
8. φ ∧ ¬χ ⊢ ¬(φ → χ).
9. φ ∨ ψ, ¬ψ ⊢ φ.
1. ¬(φ → ψ) ⊢ φ.
2. ¬(φ ∧ ψ) ⊢ ¬φ ∨ ¬ψ.
3. φ → ψ ⊢ ¬φ ∨ ψ.
4. ⊢ ¬¬φ → φ.
5. φ → ψ, ¬φ → ψ ⊢ ψ.
6. (φ ∧ ψ) → χ ⊢ (φ → χ) ∨ (ψ → χ).
7. (φ → ψ) → φ ⊢ φ.
8. ⊢ (φ → ψ) ∨ (ψ → χ).
content/propositional-logic/../first-order-logic/natural-deduction/proof-theoretic-n
This section collects the definitions the provability relation and consis-
tency for natural deduction.
Just as we’ve defined a number of important semantic notions (validity, en- explanation
tailment, satisfiability), we now define corresponding proof-theoretic notions.
These are not defined by appeal to satisfaction of sentences in structures, but
by appeal to the derivability or non-derivability of certain sentences from oth-
ers. It was an important discovery that these notions coincide. That they do
is the content of the soundness and completeness theorems.
Definition 10.7 (Theorems). A sentence φ is a theorem if there is a deriva-
tion of φ in natural deduction in which all assumptions are discharged. We
write ⊢ φ if φ is a theorem and ⊬ φ if it is not.
δ1 Γ
δ0
ψ
1 →Intro
φ→ψ φ
→Elim
ψ
1. Γ is inconsistent.
Proof. Exercise.
content/propositional-logic/../first-order-logic/natural-deduction/provability-consi
Γ, [φ]1
Γ
δ2
δ1
⊥
1
¬φ ¬Intro φ
¬Elim
⊥
In the new derivation, the assumption φ is discharged, so it is a derivation
from Γ .
δ1
1
⊥ ⊥
φ C
δ
¬φ φ
¬Elim
⊥
Since ¬φ ∈ Γ , all undischarged assumptions are in Γ , this shows that Γ ⊢ ⊥.
pl:ntd:prv: Proposition 10.18. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ
prop:provability-exhaustive
is inconsistent.
Proof. There are derivations δ1 and δ2 of ⊥ from Γ ∪{φ} and ⊥ from Γ ∪{¬φ},
respectively. We can then derive
Γ, [¬φ]2 Γ, [φ]1
δ2 δ1
⊥ ⊥
2
¬¬φ ¬Intro 1
¬φ ¬Intro
¬Elim
⊥
content/propositional-logic/../first-order-logic/natural-deduction/provability-propo
2. φ, ψ ⊢ φ ∧ ψ. pl:ntd:ppr:
prop:provability-land-right
φ∧ψ φ∧ψ
∧Elim ∧Elim
φ ψ
2. We can derive:
φ ψ
∧Intro
φ∧ψ
1. φ ∨ ψ, ¬φ, ¬ψ is inconsistent.
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
¬φ [φ]1 ¬ψ [ψ]1
¬Elim ¬Elim
φ∨ψ ⊥ ⊥
1 ∨Elim
⊥
φ ψ
∨Intro ∨Intro
φ∨ψ φ∨ψ
φ→ψ φ
→Elim
ψ
¬φ [φ]1
¬Elim
⊥ ⊥
I
ψ ψ
1 →Intro →Intro
φ→ψ φ→ψ
Note that →Intro may, but does not have to, discharge the assumption φ.
content/propositional-logic/../first-order-logic/natural-deduction/soundness.tex
10.8 Soundness
pl:ntd:sou: A derivation system, such as natural deduction, is sound if it cannot derive explanation
sec
things that do not actually follow. Soundness is thus a kind of guaranteed
safety property for derivation systems. Depending on which proof theoretic
property is in question, we would like to know for instance, that
1. Suppose that the last inference is ¬Intro: The derivation has the form
Γ, [φ]n
δ1
⊥
n
¬φ ¬Intro
Γ
δ1
φ∧ψ
φ ∧Elim
Γ
δ1
φ
∨Intro
φ∨ψ
Γ, [φ]n
δ1
ψ
n →Intro
φ→ψ
Γ
δ1
⊥ ⊥
φ I
Now let’s consider the possible inferences with several premises: ∨Elim,
∧Intro, and →Elim.
1. The last inference is ∧Intro. φ ∧ ψ is inferred from the premises φ and ψ
and δ has the form
Γ1 Γ2
δ1 δ2
φ ψ
∧Intro
φ∧ψ
Chapter 11
Tableaux
content/propositional-logic/../first-order-logic/tableaux/rules-and-proofs.tex
147
CHAPTER 11. TABLEAUX
content/propositional-logic/../first-order-logic/tableaux/propositional-rules.tex
T ¬φ F ¬φ
¬T ¬F
Fφ Tφ
Rules for ∧
Tφ ∧ ψ
∧T Fφ∧ψ
Tφ ∧F
Fφ | Fψ
Tψ
Rules for ∨
Fφ∨ψ
Tφ ∨ ψ ∨F
∨T Fφ
Tφ | Tψ
Fψ
Rules for →
Fφ→ψ
Tφ → ψ →F
→T Tφ
F φ | Tψ
Fψ
Cut
Tφ | Fφ
The Cut rule is not applied “to” a previous signed formula; rather, it allows
every branch in a tableau to be split in two, one branch containing T φ, the
other F φ. It is not necessary—any set of signed formulas with a closed tableau
has one not using Cut—but it allows us to combine tableaux in a convenient
way.
content/propositional-logic/../first-order-logic/tableaux/derivations.tex
11.3 Tableaux
pl:tab:der: We’ve said what an assumption is, and we’ve given the rules of inference. explanation
sec
Tableaux are inductively generated from these: each tableau either is a single
branch consisting of one or more assumptions, or it results from a tableau by
applying one of the rules of inference on a branch.
1. The n topmost signed formulas of the tree are Siφi , one below the other.
2. Every signed formula in the tree that is not one of the assumptions results
from a correct application of an inference rule to a signed formula in the
branch above it.
Example 11.3. Every set of assumptions on its own is a tableau, but it will
generally not be closed. (Obviously, it is closed only if the assumptions already
contain a pair of signed formulas T φ and F φ.)
From a tableau (open or closed) we can obtain a new, larger one by applying
one of the rules of inference to a signed formula φ in it. The rule will append
one or more signed formulas to the end of any branch containing the occurrence
of φ to which we apply the rule.
For instance, consider the assumption T φ ∧ ¬φ. Here is the (open) tableau
consisting of just that assumption:
1. T φ ∧ ¬φ Assumption
1. T φ ∧ ¬φ Assumption
2. Tφ ∧T 1
3. T ¬φ ∧T 1
When we write down tableaux, we record the rules we’ve applied on the right
(e.g., ∧T1 means that the signed formula on that line is the result of applying
the ∧T rule to the signed formula on line 1). This new tableau now contains
additional signed formulas, but to only one (T ¬φ) can we apply a rule (in this
case, the ¬T rule). This results in the closed tableau
1. T φ ∧ ¬φ Assumption
2. Tφ ∧T 1
3. T ¬φ ∧T 1
4. Fφ ¬T 3
⊗
content/propositional-logic/../first-order-logic/tableaux/proving-things.tex
1. F (φ ∧ ψ) → φ Assumption
There is only one assumption, so only one signed formula to which we can
apply a rule. (For every signed formula, there is always at most one rule that
can be applied: it’s the rule for the corresponding sign and main operator of
the sentence.) In this case, this means, we must apply →F.
1. F (φ ∧ ψ) → φ ✓ Assumption
2. Tφ ∧ ψ →F 1
3. Fφ →F 1
1. F (φ ∧ ψ) → φ ✓ Assumption
2. Tφ ∧ ψ ✓ →F 1
3. Fφ →F 1
4. Tφ ∧T 2
5. Tψ ∧T 2
⊗
Since the branch now contains both T φ (on line 4) and F φ (on line 3), the
branch is closed. Since it is the only branch, the tableau is closed. We have
found a closed tableau for (φ ∧ ψ) → φ.
Example 11.5. Now let’s find a closed tableau for (¬φ ∨ ψ) → (φ → ψ).
We begin with the corresponding assumption:
1. F (¬φ ∨ ψ) → (φ → ψ) Assumption
The one signed formula in this tableau has main operator → and sign F, so we
apply the →F rule to it to obtain:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ →F 1
3. F (φ → ψ) →F 1
will be the new signed formulas added to the two new branches. This results
in:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) →F 1
4. T ¬φ Tψ ∨T 2
We have not applied the →F rule to line 3 yet: let’s do that now. To save
time, we apply it to both branches. Recall that we write a checkmark next to
a signed formula only if we have applied the corresponding rule in every open
branch. So it’s a good idea to apply a rule at the end of every branch that
contains the signed formula the rule applies to. That way we won’t have to
return to that signed formula lower down in the various branches.
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) ✓ →F 1
4. T ¬φ Tψ ∨T 2
5. Tφ Tφ →F 3
6. Fψ Fψ →F 3
⊗
The right branch is now closed. On the left branch, we can still apply the ¬T
rule to line 4. This results in F φ and closes the left branch:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) ✓ →F 1
4. T ¬φ Tψ ∨T 2
5. Tφ Tφ →F 3
6. Fψ Fψ →F 3
7. Fφ ⊗ ¬T 4
⊗
Example 11.6. We can give tableaux for any number of signed formulas as
assumptions. Often it is also necessary to apply more than one rule that allows
branching; and in general a tableau can have any number of branches. For
instance, consider a tableau for {T φ ∨ (ψ ∧ χ), F (φ ∨ ψ) ∧ (φ ∨ χ)}. We start
by applying the ∨T to the first assumption:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) Assumption
3. Tφ Tψ ∧ χ ∨T 1
Now we can apply the ∧F rule to line 2. We do this on both branches simul-
taneously, and can therefore check off line 2:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
Note that we moved the result of applying ∨F a second time below for clarity.
In this instance it would not have been needed, since the justifications would
have been the same.
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ✓ ∨T 1
For comparison, here’s a closed tableau for the same set of assumptions in
which the rules are applied in a different order:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Fφ∨ψ ✓ Fφ∨χ ✓ ∧F 2
4. Fφ Fφ ∨F 3
5. Fψ Fχ ∨F 3
6. Tφ Tψ ∧ χ ✓ Tφ Tψ ∧ χ ✓ ∨T 1
7. ⊗ Tψ ⊗ Tψ ∧T 6
8. Tχ Tχ ∧T 6
⊗ ⊗
4. T ψ → φ, F ¬φ → ¬ψ.
5. F (φ → ¬φ) → ¬φ.
6. F ¬(φ → ψ) → ¬ψ.
7. T φ → χ, F ¬(φ ∧ ¬χ).
8. T φ ∧ ¬χ, F ¬(φ → χ).
9. T φ ∨ ψ, ¬ψ, F φ.
10. T ¬φ ∨ ¬ψ, F ¬(φ ∧ ψ).
11. F (¬φ ∧ ¬ψ) → ¬(φ ∨ ψ).
12. F ¬(φ ∨ ψ) → (¬φ ∧ ¬ψ).
content/propositional-logic/../first-order-logic/tableaux/proof-theoretic-notions.tex
This section collects the definitions of the provability relation and con-
sistency for tableaux.
Just as we’ve defined a number of important semantic notions (validity, en- explanation
tailment, satisfiability), we now define corresponding proof-theoretic notions.
These are not defined by appeal to satisfaction of sentences in structures, but
by appeal to the existence of certain closed tableaux. It was an important dis-
covery that these notions coincide. That they do is the content of the soundness
and completeness theorems.
{T ψ1 , . . . , T ψn }.
1. Fφ Assumption
2. Tφ Assumption
⊗
is closed.
{F ψ,T φ, T χ1 , . . . , T χn }
{F φ,T θ1 , . . . , T θm }
F ψ, T χ1 , . . . , T χn , T θ1 , . . . , T θm .
Apply the Cut rule on φ. This generates two branches, one has T φ in it, the
other F φ. Thus, on the one branch, all of
{F ψ, T φ, T χ1 , . . . , T χn }
are available. Since there is a closed tableau for these assumptions, we can
attach it to that branch; every branch through T φ closes. On the other branch,
all of
{F φ, T θ1 , . . . , T θm }
are available, so we can also complete the other side to obtain a closed tableau.
This shows Γ ∪ ∆ ⊢ ψ.
Proof. Exercise.
content/propositional-logic/../first-order-logic/tableaux/provability-consistency.tex
pl:tab:prv: Proposition 11.18. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ
prop:provability-exhaustive
is inconsistent.
{T φ,T ψ1 , . . . , T ψn } and
{T ¬φ,T χ1 , . . . , T χm }
both have closed tableaux, we can construct a single, combined tableau that
shows that Γ is inconsistent by using as assumptions T ψ1 , . . . , T ψn together
with T χ1 , . . . , T χm , followed by an application of the Cut rule. This yields
two branches, one starting with T φ, the other with F φ.
On the left left side, add the part of the first tableau below its assumptions.
Here, every rule application is still correct, since each of the assumptions of the
first tableau, including T φ, is available. Thus, every branch below T φ closes.
On the right side, add the part of the second tableau below its assumption,
with the results of any applications of ¬T to T ¬φ removed. The conclusion of
¬T to T ¬φ is F φ, which is nevertheless available, as it is the conclusion of the
Cut rule on the right side of the combined tableau.
If a branch in the second tableau was closed because it contained the as-
sumption T ¬φ (which no longer appears as an assumption in the combined
tableau) as well as F ¬φ, we can applying ¬F to F ¬φ to obtain T φ. Now
the corresponding branch in the combined tableau also closes, because it con-
tains the right-hand conclusion of the Cut rule, F φ. If a branch in the second
tableau closed for any other reason, the corresponding branch in the combined
tableau also closes, since any signed formulas other than T ¬φ occurring on the
branch in the old, second tableau also occur on the corresponding branch in
the combined tableau.
content/propositional-logic/../first-order-logic/tableaux/provability-propositional.tex
pl:tab:ppr: 2. φ, ψ ⊢ φ ∧ ψ.
prop:provability-land-right
1. Fφ Assumption
2. Tφ ∧ ψ Assumption
3. Tφ ∧T 2
4. Tψ ∧T 2
⊗
1. Fψ Assumption
2. Tφ ∧ ψ Assumption
3. Tφ ∧T 2
4. Tψ ∧T 2
⊗
1. Fφ∧ψ Assumption
2. Tφ Assumption
3. Tψ Assumption
4. Fφ Fψ ∧F 1
⊗ ⊗
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
1. Tφ ∨ ψ Assumption
2. T ¬φ Assumption
3. T ¬ψ Assumption
4. Fφ ¬T 2
5. Fψ ¬T 3
6. Tφ Tψ ∨T 1
⊗ ⊗
1. Fφ∨ψ Assumption
2. Tφ Assumption
3. Fφ ∨F 1
4. Fψ ∨F 1
⊗
1. Fφ∨ψ Assumption
2. Tψ Assumption
3. Fφ ∨F 1
4. Fψ ∨F 1
⊗
1. Fψ Assumption
2. Tφ → ψ Assumption
3. Tφ Assumption
4. Fφ Tψ →T 2
⊗ ⊗
1. Fφ→ψ Assumption
2. T ¬φ Assumption
3. Tφ →F 1
4. Fψ →F 1
5. Fφ ¬T 2
⊗
1. Fφ→ψ Assumption
2. Tψ Assumption
3. Tφ →F 1
4. Fψ →F 1
⊗
content/propositional-logic/../first-order-logic/tableaux/soundness.tex
11.8 Soundness
explanation A derivation system, such as tableaux, is sound if it cannot derive things that pl:tab:sou:
sec
do not actually hold. Soundness is thus a kind of guaranteed safety property
for derivation systems. Depending on which proof theoretic property is in
question, we would like to know for instance, that
Proof. Let’s call a branch of a tableau satisfiable iff the set of signed formulas
on it is satisfiable, and let’s call a tableau satisfiable if it contains at least one
satisfiable branch.
We show the following: Extending a satisfiable tableau by one of the rules
of inference always results in a satisfiable tableau. This will prove the theo-
rem: any closed tableau results by applying rules of inference to the tableau
consisting only of assumptions from Γ . So if Γ were satisfiable, any tableau
for it would be satisfiable. A closed tableau, however, is clearly not satisfiable:
every branch contains both T φ and F φ, and no structure can both satisfy and
not satisfy φ.
Suppose we have a satisfiable tableau, i.e., a tableau with at least one
satisfiable branch. Applying a rule of inference either adds signed formulas
to a branch, or splits a branch in two. If the tableau has a satisfiable branch
which is not extended by the rule application in question, it remains a satisfiable
branch in the extended tableau, so the extended tableau is satisfiable. So we
only have to consider the case where a rule is applied to a satisfiable branch.
Let Γ be the set of signed formulas on that branch, and let S φ ∈ Γ be the
signed formula to which the rule is applied. If the rule does not result in a split
branch, we have to show that the extended branch, i.e., Γ together with the
conclusions of the rule, is still satisfiable. If the rule results in a split branch,
we have to show that at least one of the two resulting branches is satisfiable.
First, we consider the possible inferences that do not result in a split branch.
Now let’s consider the possible inferences that result in a split branch.
4. The branch is expanded by Cut: This results in two branches, one con-
taining T ψ, the other containing F ψ. Since v ⊨ Γ and either v ⊨ ψ or
v ⊭ ψ, v satisfies either the left or the right branch.
Chapter 12
Axiomatic Derivations
No effort has been made yet to ensure that the material in this chap-
ter respects various tags indicating which connectives and quantifiers are
primitive or defined: all are assumed to be primitive, except ↔ which is
assumed to be defined. If the FOL tag is true, we produce a version with
quantifiers, otherwise without.
content/propositional-logic/../first-order-logic/axiomatic-deduction/rules-and-proof
164
12.1. RULES AND DERIVATIONS
1. φi ∈ Γ ; or
2. φi is an axiom; or
It gets more interesting if the rule of inference appeals to formulas that appear
before the step considered. The following rule is called modus ponens:
If this is the only rule of inference, then our definition of derivation above
amounts to this: φ1 , . . . , φn is a derivation iff for each i ≤ n one of the
following holds:
1. φi ∈ Γ ; or
2. φi is an axiom; or
The last clause says that φi follows from φj (ψ) and φk (ψ → φi ) by modus
ponens. If we can go from 1 to n, and each time we find a formula φi that is
either in Γ , an axiom, or which a rule of inference tells us that it is a correct
inference step, then the entire sequence counts as a correct derivation.
content/propositional-logic/../first-order-logic/axiomatic-deduction/axioms-rules-pr
(φ ∧ ψ) → φ (12.1) pl:axd:prp:
ax:land1
(φ ∧ ψ) → ψ (12.2) pl:axd:prp:
ax:land2
φ → (ψ → (φ ∧ ψ)) (12.3) pl:axd:prp:
ax:land3
φ → (φ ∨ ψ) (12.4) pl:axd:prp:
ax:lor1
φ → (ψ ∨ φ) (12.5) pl:axd:prp:
ax:lor2
(φ → χ) → ((ψ → χ) → ((φ ∨ ψ) → χ)) (12.6) pl:axd:prp:
ax:lor3
φ → (ψ → φ) (12.7) pl:axd:prp:
ax:lif1
(φ → (ψ → χ)) → ((φ → ψ) → (φ → χ)) (12.8) pl:axd:prp:
ax:lif2
(φ → ψ) → ((φ → ¬ψ) → ¬φ) (12.9) pl:axd:prp:
ax:lnot1
¬φ → (φ → ψ) (12.10) pl:axd:prp:
ax:lnot2
⊤ (12.11) pl:axd:prp:
ax:ltrue
⊥→φ (12.12) pl:axd:prp:
ax:lfalse1
(φ → ⊥) → ¬φ (12.13) pl:axd:prp:
ax:lfalse2
¬¬φ → φ (12.14) pl:axd:prp:
ax:dne
content/propositional-logic/../first-order-logic/axiomatic-deduction/proving-things.
strategy would be to use eq. (12.6) with φ being ¬θ, ψ being α, and χ being
θ → α, i.e., the instance
(¬θ → (θ → α)) → ((α → (θ → α)) → ((¬θ ∨ α) → (θ → α))).
Why? Two applications of MP yield the last part, which is what we want. And
we easily see that ¬θ → (θ → α) is an instance of eq. (12.10), and α → (θ → α)
is an instance of eq. (12.7). So our derivation is:
1. ¬θ → (θ → α) eq. (12.10)
2. (¬θ → (θ → α)) →
((α → (θ → α)) → ((¬θ ∨ α) → (θ → α))) eq. (12.6)
3. ((α → (θ → α)) → ((¬θ ∨ α) → (θ → α)) 1, 2, mp
4. α → (θ → α) eq. (12.7)
5. (¬θ ∨ α) → (θ → α) 3, 4, mp
1. φ→ψ Hyp
2. ψ→χ Hyp
3. (ψ → χ) → (φ → (ψ → χ)) eq. (12.7)
4. φ → (ψ → χ) 2, 3, mp
5. (φ → (ψ → χ)) →
((φ → ψ) → (φ → χ)) eq. (12.8)
6. ((φ → ψ) → (φ → χ)) 4, 5, mp
7. φ→χ 1, 6, mp
The lines labelled “Hyp” (for “hypothesis”) indicate that the formula on that
line is an element of Γ .
Problem 12.1. Show that the following hold by exhibiting derivations from
the axioms:
1. (φ ∧ ψ) → (ψ ∧ φ)
2. ((φ ∧ ψ) → χ) → (φ → (ψ → χ))
3. ¬(φ ∨ ψ) → ¬φ
content/propositional-logic/../first-order-logic/axiomatic-deduction/proof-theoretic
content/propositional-logic/../first-order-logic/axiomatic-deduction/deduction-theorem.tex
1. φ Hyp.
2. φ→ψ Hyp.
3. ψ 1, 2, MP
By Proposition 12.16, Γ ⊢ ψ.
The most important result we’ll use in this context is the deduction theorem:
Γ ⊢ φ → (χ → ψ);
Γ ⊢ φ → χ.
But also
Γ ⊢ (φ → (χ → ψ)) → ((φ → χ) → (φ → ψ)),
by eq. (12.8), and two applications of Proposition 12.19 give Γ ⊢ φ → ψ, as
required.
Notice how eq. (12.7) and eq. (12.8) were chosen precisely so that the De-
duction Theorem would hold.
The following are some useful facts about derivability, which we leave as
exercises.
pl:axd:ded: Proposition 12.21.
prop:derivfacts
pl:axd:ded: 1. ⊢ (φ → ψ) → ((ψ → χ) → (φ → χ);
derivfacts:a
pl:axd:ded: 2. If Γ ∪ {¬φ} ⊢ ¬ψ then Γ ∪ {ψ} ⊢ φ (Contraposition);
derivfacts:b
pl:axd:ded: 3. {φ, ¬φ} ⊢ ψ (Ex Falso Quodlibet, Explosion);
derivfacts:c
pl:axd:ded: 4. {¬¬φ} ⊢ φ (Double Negation Elimination);
derivfacts:d
pl:axd:ded: 5. If Γ ⊢ ¬¬φ then Γ ⊢ φ;
derivfacts:e
content/propositional-logic/../first-order-logic/axiomatic-deduction/provability-consistency.t
Proposition 12.25. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ pl:axd:prv:
prop:provability-exhaustive
is inconsistent.
Proof. Exercise.
content/propositional-logic/../first-order-logic/axiomatic-deduction/provability-pro
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
pl:axd:ppr: 1. φ, φ → ψ ⊢ ψ.
prop:provability-lif-left
pl:axd:ppr: 2. Both ¬φ ⊢ φ → ψ and ψ ⊢ φ → ψ.
prop:provability-lif-right
1. φ Hyp
2. φ→ψ Hyp
3. ψ 1, 2, mp
2. By eq. (12.10) and eq. (12.7) and the deduction theorem, respectively.
content/propositional-logic/../first-order-logic/axiomatic-deduction/soundness.tex
12.8 Soundness
pl:axd:sou: A derivation system, such as axiomatic deduction, is sound if it cannot derive explanation
sec
things that do not actually hold. Soundness is thus a kind of guaranteed safety
property for derivation systems. Depending on which proof theoretic property
is in question, we would like to know for instance, that
1. every derivable φ is valid;
2. if φ is derivable from some others Γ , it is also a consequence of them;
3. if a set of formulas Γ is inconsistent, it is unsatisfiable.
These are important properties of a derivation system. If any of them do
not hold, the derivation system is deficient—it would derive too much. Con-
sequently, establishing the soundness of a derivation system is of the utmost
importance.
Proposition 12.29. If φ is an axiom, then v ⊨ φ for each valuation v.
Proof. Do truth tables for each axiom to verify that they are tautologies.
Chapter 13
content/propositional-logic/../first-order-logic/completeness/introduction.tex
13.1 Introduction
The completeness theorem is one of the most fundamental results about logic. pl:com:int:
sec
It comes in two formulations, the equivalence of which we’ll prove. In its
first formulation it says something fundamental about the relationship between
semantic consequence and our derivation system: if a sentence φ follows from
some sentences Γ , then there is also a derivation that establishes Γ ⊢ φ. Thus,
the derivation system is as strong as it can possibly be without proving things
that don’t actually follow.
In its second formulation, it can be stated as a model existence result: every
consistent set of sentences is satisfiable. Consistency is a proof-theoretic notion:
it says that our derivation system is unable to produce certain derivations. But
who’s to say that just because there are no derivations of a certain sort from Γ ,
it’s guaranteed that there is valuation v with v ⊨ Γ ? Before the completeness
theorem was first proved—in fact before we had the derivation systems we
now do—the great German mathematician David Hilbert held the view that
consistency of mathematical theories guarantees the existence of the objects
they are about. He put it as follows in a letter to Gottlob Frege:
If the arbitrarily given axioms do not contradict one another with
all their consequences, then they are true and the things defined by
the axioms exist. This is for me the criterion of truth and existence.
174
13.2. OUTLINE OF THE PROOF
content/propositional-logic/../first-order-logic/completeness/outline.tex
content/propositional-logic/../first-order-logic/completeness/complete-consistent-se
explanation Complete sets of sentences leave no questions unanswered. For any sen-
tence φ, Γ “says” if φ is true or false. The importance of complete sets extends
beyond the proof of the completeness theorem. A theory which is complete and
axiomatizable, for instance, is always decidable.
explanation Complete consistent sets are important in the completeness proof since we
can guarantee that every consistent set of sentences Γ is contained in a com-
plete consistent set Γ ∗ . A complete consistent set contains, for each sentence φ,
either φ or its negation ¬φ, but not both. This is true in particular for proposi-
tional variables, so from a complete consistent set, we can construct a valuation
where the truth value assigned to propositional variables is defined according
to which propositional variables are in Γ ∗ . This valuation can then be shown
to make all sentences in Γ ∗ (and hence also all those in Γ ) true. The proof of
pl:com:ccs: 1. If Γ ⊢ φ, then φ ∈ Γ .
prop:ccs-prov-in
pl:com:ccs: 2. φ ∧ ψ ∈ Γ iff both φ ∈ Γ and ψ ∈ Γ .
prop:ccs-and
pl:com:ccs: 3. φ ∨ ψ ∈ Γ iff either φ ∈ Γ or ψ ∈ Γ .
prop:ccs-or
Proof. Let us suppose for all of the following that Γ is complete and consistent.
1. If Γ ⊢ φ, then φ ∈ Γ .
Suppose that Γ ⊢ φ. Suppose to the contrary that φ ∈ / Γ . Since Γ
is complete, ¬φ ∈ Γ . By Propositions 9.19, 10.17, 11.17 and 12.24, Γ
is inconsistent. This contradicts the assumption that Γ is consistent.
Hence, it cannot be the case that φ ∈
/ Γ , so φ ∈ Γ .
4. For the forward direction, suppose φ→ψ ∈ Γ , and suppose to the contrary
that φ ∈ Γ and ψ ∈ / Γ . On these assumptions, φ → ψ ∈ Γ and φ ∈ Γ .
By Propositions 9.23, 10.21, 11.21 and 12.28, item (1), Γ ⊢ ψ. But then
by (1), ψ ∈ Γ , contradicting the assumption that ψ ∈
/ Γ.
For the reverse direction, first consider the case where φ ∈
/ Γ . Since Γ
is complete, ¬φ ∈ Γ . By Propositions 9.23, 10.21, 11.21 and 12.28, item
(2), Γ ⊢ φ → ψ. Again by (1), we get that φ → ψ ∈ Γ , as required.
Now consider the case where ψ ∈ Γ . By Propositions 9.23, 10.21, 11.21
and 12.28, item (2) again, Γ ⊢ φ → ψ. By (1), φ → ψ ∈ Γ .
content/propositional-logic/../first-order-logic/completeness/lindenbaums-lemma.tex
complete.
content/propositional-logic/../first-order-logic/completeness/construction-of-model.
content/propositional-logic/../first-order-logic/completeness/completeness-thm.tex
Proof. Note that the Γ ’s in Corollary 13.7 and Theorem 13.6 are universally
quantified. To make sure we do not confuse ourselves, let us restate Theo-
rem 13.6 using a different variable: for any set of sentences ∆, if ∆ is con-
sistent, it is satisfiable. By contraposition, if ∆ is not satisfiable, then ∆ is
inconsistent. We will use this to prove the corollary.
Suppose that Γ ⊨ φ. Then Γ ∪ {¬φ} is unsatisfiable by Proposition 7.20.
Taking Γ ∪ {¬φ} as our ∆, the previous version of Theorem 13.6 gives us that
Γ ∪{¬φ} is inconsistent. By Propositions 9.18, 10.16, 11.16 and 12.23, Γ ⊢ φ.
Problem 13.2. Use Corollary 13.7 to prove Theorem 13.6, thus showing that
the two formulations of the completeness theorem are equivalent.
Problem 13.3. In order for a derivation system to be complete, its rules must
be strong enough to prove every unsatisfiable set inconsistent. Which of the
rules of derivation were necessary to prove completeness? Are any of these rules
not used anywhere in the proof? In order to answer these questions, make a
list or diagram that shows which of the rules of derivation were used in which
results that lead up to the proof of Theorem 13.6. Be sure to note any tacit
uses of rules in these proofs.
content/propositional-logic/../first-order-logic/completeness/compactness.tex
pl:com:com: Theorem 13.9 (Compactness Theorem). The following hold for any sen-
thm:compactness
tences Γ and φ:
content/propositional-logic/../first-order-logic/completeness/compactness-direct.tex
2. (φ ∨ ψ) ∈ Γ iff either φ ∈ Γ or ψ ∈ Γ .
3. (φ → ψ) ∈ Γ iff either φ ∈
/ Γ or ψ ∈ Γ .
pl:com:cpd: Lemma 13.11. Every finitely satisfiable set Γ can be extended to a complete
lem:fsat-lindenbaum
and finitely satisfiable set Γ ∗ .
Problem 13.6. Prove Lemma 13.11. (Hint: the crucial step is to show that
if Γn is finitely satisfiable, then either Γn ∪ {φn } or Γn ∪ {¬φn } is finitely
satisfiable.)
Problem 13.7. Write out the complete proof of the Truth Lemma (Lemma 13.5)
in the version required for the proof of Theorem 13.12.
First-order Logic
This part covers the metatheory of first-order logic through complete-
ness. Currently it does not rely on a separate treatment of propositional
logic; everything is proved. The source files will exclude the material on
quantifiers (and replace “structure” with “valuation”, M with v, etc.) if
the “FOL” tag is false. In fact, most of the material in the part on propo-
sitional logic is simply the first-order material with the “FOL” tag turned
off.
If the part on propositional logic is included, this results in a lot of
repetition. It is planned, however, to make it possible to let this part take
into account the material on propositional logic (and exclude the material
already covered, as well as shorten proofs with references to the respective
places in the propositional part).
Chapter 14
content/first-order-logic/introduction/first-order-logic.tex
183
CHAPTER 14. INTRODUCTION TO FIRST-ORDER LOGIC
possible, if, and only if, ∀x (φ(x) → ψ(x)) and ∃x φ(x) together entail ∃x ψ(x).
Before this can be done, however, a lot of painstaking work has to be carried
out to get the definitions of syntax and semantics correct.
content/first-order-logic/introduction/syntax.tex
14.2 Syntax
fol:int:syn: We first must make precise what strings of symbols count as sentences of first-
sec
order logic. We’ll do this later; for now we’ll just proceed by example. The basic
building blocks—the vocabulary—of first-order logic divides into two parts.
The first part is the symbols we use to say specific things or to pick out specific
things. We pick out things using constant symbols, and we say stuff about the
things we pick out using predicate symbols. E.g, we might use a as a constant
symbol to pick out a single thing, and then say something about it using the
sentence P (a). If you have meanings for “a” and “P ” in mind, you can read
P (a) as a sentence of English (and you probably have done so when you first
learned formal logic). Once you have such simple sentences of first-order logic,
you can build more complex ones using the second part of the vocabulary: the
logical symbols (connectives and quantifiers). So, for instance, we can form
expressions like (P (a) ∧ Q(b)) or ∃x P (x).
In order to provide the precise definitions of semantics and the rules of
our derivation systems required for rigorous meta-logical study, we first of all
have to give a precise definition of what counts as a sentence of first-order
logic. The basic idea is easy enough to understand: there are some simple
sentences we can form from just predicate symbols and constant symbols, such
as P (a). And then from these we form more complex ones using the connectives
and quantifiers. But what exactly are the rules by which we are allowed to
form more complex sentences? These must be specified, otherwise we have
not defined “sentence of first-order logic” precisely enough. There are a few
issues. The first one is to get the right strings to count as sentences. The
second one is to do this in such a way that we can give mathematical proofs
about all sentences. Finally, we’ll have to also give precise definitions of some
rudimentary operations with sentences, such as “replace every x in φ by b.”
The trouble is that the quantifiers and variables we have in first-order logic
make it not entirely obvious how this should be done. E.g., should ∃x P (a)
count as a sentence? What about ∃x ∃x P (x)? What should the result of
“replace x by b in (P (x) ∧ ∃x P (x))” be?
content/first-order-logic/introduction/formulas.tex
14.3 Formulas
Here is the approach we will use to rigorously specify sentences of first-order
logic and to deal with the issues arising from the use of variables. We first
define a different set of expressions: formulas. Once we’ve done that, we can
consider the role variables play in them—and on the basis of some other ideas,
namely those of “free” and “bound” variables, we can define what a sentence
is (namely, a formula without free variables). We do this not just because it
makes the definition of “sentence” more manageable, but also because it will
be crucial to the way we define the semantic notion of satisfaction.
Let’s define “formula” for a simple first-order language, one containing only
a single predicate symbol P and a single constant symbol a, and only the logical
symbols ¬, ∧, and ∃. Our full definitions will be much more general: we’ll allow
infinitely many predicate symbols and constant symbols. In fact, we will also
consider function symbols which can be combined with constant symbols and
variables to form “terms.” For now, a and the variables will be our only terms.
We do need infinitely many variables. We’ll officially use the symbols v0 , v1 ,
. . . , as variables.
Definition 14.1. The set of formulas Frm is defined as follows:
1. P (a) and P (vi ) are formulas (i ∈ N). fol:int:fml:
fmls-atom
2. If φ is a formula, then ¬φ is formula. fol:int:fml:
fmls-not
3. If φ and ψ are formulas, then (φ ∧ ψ) is a formula.
4. If φ is a formula and x is a variable, then ∃x φ is a formula. fol:int:fml:
fmls-ex
5. Nothing else is a formula. fol:int:fml:
fmls-limit
(1) tells us that P (a) and P (vi ) are formulas, for any i ∈ N. These are
the so-called atomic formulas. They give us something to start from. The
other clauses give us ways of forming new formulas from ones we have already
formed. So for instance, by (2), we get that ¬P (v2 ) is a formula, since P (v2 )
is already a formula by (1). Then, by (4), we get that ∃v2 ¬P (v2 ) is another
formula, and so on. (5) tells us that only strings we can form in this way count
as formulas. In particular, ∃v0 P (a) and ∃v0 ∃v0 P (a) do count as formulas, and
(¬P (a)) does not, because of the extraneous outer parentheses.
This way of defining formulas is called an inductive definition, and it allows
us to prove things about formulas using a version of proof by induction called
structural induction. These are discussed in a general way in section 71.4 and
section 71.5, which you should review before delving into the proofs later on.
Basically, the idea is that if you want to give a proof that something is true for
all formulas, you show first that it is true for the atomic formulas, and then
that if it’s true for any formula φ (and ψ), it’s also true for ¬φ, (φ ∧ ψ), and
∃x φ. For instance, this proves that it’s true for ∃v2 ¬P (v2 ): from the first part
you know that it’s true for the atomic formula P (v2 ). Then you get that it’s
true for ¬P (v2 ) by the second part, and then again that it’s true for ∃v2 ¬P (v2 )
itself. Since all formulas are inductively generated from atomic formulas, this
works for any of them.
content/first-order-logic/introduction/satisfaction.tex
14.4 Satisfaction
fol:int:sat: We can already skip ahead to the semantics of first-order logic once we know
sec
what formulas are: here, the basic definition is that of a structure. For our
simple language, a structure M has just three components: a non-empty set
|M| called the domain, what a picks out in M, and what P is true of in M.
The object picked out by a is denoted aM and the set of things P is true of
by P M . A structure M consists of just these three things: |M|, aM ∈ |M| and
P M ⊆ |M|. The general case will be more complicated, since there will be
many predicate symbols and constant symbols, the constant symbols can have
more than one place, and there will also be function symbols.
This is enough to give a definition of satisfaction for formulas that don’t
contain variables. The idea is to give an inductive definition that mirrors the
way we have defined formulas. We specify when an atomic formula is satisfied
in M, and then when, e.g., ¬φ is satisfied in M on the basis of whether or not
φ is satisfied in M. E.g., we could define:
1. P (a) is satisfied in M iff aM ∈ P M .
2. ¬φ is satisfied in M iff φ is not satisfied in M.
3. (φ ∧ ψ) is satisfied in M iff φ is satisfied in M, and ψ is satisfied in M as
well.
Let’s say that |M| = {0, 1, 2}, aM = 1, and P M = {1, 2}. This definition would
tell us that P (a) is satisfied in M (since aM = 1 ∈ {1, 2} = P M ). It tells
us further that ¬P (a) is not satisfied in M, and that in turn ¬¬P (a) is and
(¬P (a) ∧ P (a)) is not satisfied, and so on.
The trouble comes when we want to give a definition for the quantifiers:
we’d like to say something like, “∃v0 P (v0 ) is satisfied iff P (v0 ) is satisfied.”
But the structure M doesn’t tell us what to do about variables. What we
actually want to say is that P (v0 ) is satisfied for some value of v0 . To make
this precise we need a way to assign elements of |M| not just to a but also
to v0 . To this end, we introduce variable assignments. A variable assignment
is simply a function s that maps variables to elements of |M| (in our example,
to one of 1, 2, or 3). Since we don’t know beforehand which variables might
appear in a formula we can’t limit which variables s assigns values to. The
simple solution is to require that s assigns values to all variables v0 , v1 , . . .
We’ll just use only the ones we need.
Instead of defining satisfaction of formulas just relative to a structure, we’ll
define it relative to a structure M and a variable assignment s, and write
M, s ⊨ φ for short. Our definition will now include an additional clause to deal
with atomic formulas containing variables:
1. M, s ⊨ P (a) iff aM ∈ P M .
2. M, s ⊨ P (vi ) iff s(vi ) ∈ P M .
3. M, s ⊨ ¬φ iff not M, s ⊨ φ.
4. M, s ⊨ (φ ∧ ψ) iff M, s ⊨ φ and M, s ⊨ ψ.
Ok, this solves one problem: we can now say when M satisfies P (v0 ) for the
value s(v0 ). To get the definition right for ∃v0 P (v0 ) we have to do one more
thing: We want to have that M, s ⊨ ∃v0 P (v0 ) iff M, s′ ⊨ P (v0 ) for some way
s′ of assigning a value to v0 . But the value assigned to v0 does not necessarily
have to be the value that s(v0 ) picks out. We’ll introduce a notation for that:
if m ∈ |M|, then we let s[m/v0 ] be the assignment that is just like s (for all
variables other than v0 ), except to v0 it assigns m. Now our definition can be:
Does it work out? Let’s say we let s(vi ) = 0 for all i ∈ N. M, s ⊨ ∃v0 P (v0 ) iff
there is an m ∈ |M| so that M, s[m/v0 ] ⊨ P (v0 ). And there is: we can choose
m = 1 or m = 2. Note that this is true even if the value s(v0 ) assigned to v0
by s itself—in this case, 0—doesn’t do the job. We have M, s[1/v0 ] ⊨ P (v0 )
but not M, s ⊨ P (v0 ).
If this looks confusing and cumbersome: it is. But the added complexity is
required to give a precise, inductive definition of satisfaction for all formulas,
and we need something like it to precisely define the semantic notions. There
are other ways of doing it, but they are all equally (in)elegant.
content/first-order-logic/introduction/sentences.tex
14.5 Sentences
Ok, now we have a (sketch of a) definition of satisfaction (“true in”) for struc- fol:int:snt:
sec
tures and formulas. But it needs this additional bit—a variable assignment—
and what we wanted is a definition of sentences. How do we get rid of assign-
ments, and what are sentences?
You probably remember a discussion in your first introduction to formal
logic about the relation between variables and quantifiers. A quantifier is al-
ways followed by a variable, and then in the part of the sentence to which that
quantifier applies (its “scope”), we understand that the variable is “bound”
by that quantifier. In formulas it was not required that every variable has a
matching quantifier, and variables without matching quantifiers are “free” or
“unbound.” We will take sentences to be all those formulas that have no free
variables.
Again, the intuitive idea of when an occurrence of a variable in a formula φ
is bound, which quantifier binds it, and when it is free, is not difficult to get.
You may have learned a method for testing this, perhaps involving counting
parentheses. We have to insist on a precise definition—and because we have
defined formulas by induction, we can give a definition of the free and bound
occurrences of a variable x in a formula φ also by induction. E.g., it might
look like this for our simplified language:
content/first-order-logic/introduction/semantic-notions.tex
to do so, we’ll also have to define (precisely, i.e., by induction) some syntactic
notions and operations we haven’t mentioned yet.
content/first-order-logic/introduction/substitution.tex
14.7 Substitution
We’ll discuss an example to illustrate how things hang together, and how the fol:int:sub:
sec
development of syntax and semantics lays the foundation for our more advanced
investigations later. Our derivation systems should let us derive P (a) from
∀v0 P (v0 ). Maybe we even want to state this as a rule of inference. However,
to do so, we must be able to state it in the most general terms: not just for
P , a, and v0 , but for any formula φ, and term t, and variable x. (Recall that
constant symbols are terms, but we’ll consider also more complicated terms
built from constant symbols and function symbols.) So we want to be able
to say something like, “whenever you have derived ∀x φ(x) you are justified
in inferring φ(t)—the result of removing ∀x and replacing x by t.” But what
exactly does “replacing x by t” mean? What is the relation between φ(x)
and φ(t)? Does this always work?
To make this precise, we define the operation of substitution. Substitution is
actually tricky, because we can’t just replace all x’s in φ by t, and not every t
can be substituted for any x. We’ll deal with this, again, using inductive
definitions. But once this is done, specifying an inference rule as “infer φ(t)
from ∀x φ(x)” becomes a precise definition. Moreover, we’ll be able to show
that this is a good inference rule in the sense that ∀x φ(x) entails φ(t). But to
prove this, we have to again prove something that may at first glance prompt
you to ask “why are we doing this?” That ∀x φ(x) entails φ(t) relies on the fact
that whether or not M ⊨ φ(t) holds depends only on the value of the term t,
i.e., if we let m be whatever element of |M| is picked out by t, then M, s ⊨ φ(t)
iff M, s[m/x] ⊨ φ(x). This holds even when t contains variables, but we’ll have
to be careful with how exactly we state the result.
content/first-order-logic/introduction/models-theories.tex
and only they, are true in them? These kinds of questions are the domain of
model theory. They also underlie the axiomatic method : describing a collection
of structures by a set of sentences, the axioms of a theory. This is made possible
by the observation that exactly those sentences entailed in first-order logic by
the axioms are true in all models of the axioms.
As a very simple example, consider preorders. A preorder is a relation R
on some set A which is both reflexive and transitive. A set A with a two-place
relation R ⊆ A × A on it is exactly what we would need to give a structure for
a first-order language with a single two-place relation symbol P : we would set
|M| = A and P M = R. Since R is a preorder, it is reflexive and transitive, and
we can find a set Γ of sentences of first-order logic that say this:
∀v0 P (v0 , v0 )
∀v0 ∀v1 ∀v2 ((P (v0 , v1 ) ∧ P (v1 , v2 )) → P (v0 , v2 ))
These sentences are just the symbolizations of “for any x, Rxx” (R is reflexive)
and “whenever Rxy and Ryz then also Rxz” (R is transitive). We see that
a structure M is a model of these two sentences Γ iff R (i.e., P M ), is a preorder
on A (i.e., |M|). In other words, the models of Γ are exactly the preorders. Any
property of all preorders that can be expressed in the first-order language with
just P as predicate symbol (like reflexivity and transitivity above), is entailed
by the two sentences in Γ and vice versa. So anything we can prove about
models of Γ we have proved about all preorders.
For any particular theory and class of models (such as Γ and all preorders),
there will be interesting questions about what can be expressed in the corre-
sponding first-order language, and what cannot be expressed. There are some
properties of structures that are interesting for all languages and classes of mod-
els, namely those concerning the size of the domain. One can always express,
for instance, that the domain contains exactly n elements, for any n ∈ Z+ . One
can also express, using a set of infinitely many sentences, that the domain is
infinite. But one cannot express that the domain is finite, or that the domain
is non-enumerable. These results about the limitations of first-order languages
are consequences of the compactness and Löwenheim–Skolem theorems.
content/first-order-logic/introduction/soundness-completeness.tex
Chapter 15
192
15.1. INTRODUCTION
content/first-order-logic/syntax-and-semantics/intro-syntax.tex
15.1 Introduction
fol:syn:itx: In order to develop the theory and metatheory of first-order logic, we must
sec
first define the syntax and semantics of its expressions. The expressions of
first-order logic are terms and formulas. Terms are formed from variables,
constant symbols, and function symbols. Formulas, in turn, are formed from
predicate symbols together with terms (these form the smallest, “atomic” for-
mulas), and then from atomic formulas we can form more complex ones using
logical connectives and quantifiers. There are many different ways to set down
the formation rules; we give just one possible one. Other systems will chose
different symbols, will select different sets of connectives as primitive, will use
parentheses differently (or even not at all, as in the case of so-called Polish nota-
tion). What all approaches have in common, though, is that the formation rules
define the set of terms and formulas inductively. If done properly, every expres-
sion can result essentially in only one way according to the formation rules. The
inductive definition resulting in expressions that are uniquely readable means
we can give meanings to these expressions using the same method—inductive
definition.
content/first-order-logic/syntax-and-semantics/first-order-languages.tex
1. Logical symbols
a) Logical connectives: ¬ (negation), ∧ (conjunction), ∨ (disjunction),
→ (conditional), ↔ (biconditional), ∀ (universal quantifier), ∃ (ex-
istential quantifier).
b) The propositional constant for falsity ⊥.
c) The propositional constant for truth ⊤.
d) The two-place identity predicate =.
Most of our definitions and results will be formulated for the full standard
language of first-order logic. However, depending on the application, we may
also restrict the language to only a few predicate symbols, constant symbols,
and function symbols.
Example 15.2. The language of set theory LZ contains only the single two-
place predicate symbol ∈.
Example 15.3. The language of orders L≤ contains only the two-place pred-
icate symbol ≤.
Again, these are conventions: officially, these are just aliases, e.g., <, ∈,
and ≤ are aliases for A20 , 0 for c0 , ′ for f01 , + for f02 , × for f12 .
.
intro You may be familiar with different terminology and symbols than the ones
we use above. Logic texts (and teachers) commonly use ∼, ¬, or ! for “nega-
tion”, ∧, ·, or & for “conjunction”. Commonly used symbols for the “con-
ditional” or “implication” are →, ⇒, and ⊃. Symbols for “biconditional,”
“bi-implication,” or “(material) equivalence” are ↔, ⇔, and ≡. The ⊥ sym-
bol is variously called “falsity,” “falsum,”, “absurdity,” or “bottom.” The ⊤
symbol is variously called “truth,” “verum,” or “top.”
It is conventional to use lower case letters (e.g., a, b, c) from the beginning
of the Latin alphabet for constant symbols (sometimes called names), and lower
case letters from the end (e.g., x, y, z) for variables. Quantifiers combine V with
variables, e.g., x; notational variations include W ∀x, (∀x), (x), Πx, x for the
universal quantifier and ∃x, (∃x), (Ex), Σx, x for the existential quantifier.
explanation We might treat all the propositional operators and both quantifiers as prim-
itive symbols of the language. We might instead choose a smaller stock of
primitive symbols and treat the other logical operators as defined. “Truth
functionally complete” sets of Boolean operators include {¬, ∨}, {¬, ∧}, and
{¬, →}—these can be combined with either quantifier for an expressively com-
plete first-order language.
You may be familiar with two other logical operators: the Sheffer stroke |
(named after Henry Sheffer), and Peirce’s arrow ↓, also known as Quine’s dag-
ger. When given their usual readings of “nand” and “nor” (respectively), these
operators are truth functionally complete by themselves.
content/first-order-logic/syntax-and-semantics/terms-formulas.tex
The constant symbols appear in our specification of the language and the explanation
terms as a separate category of symbols, but they could instead have been
included as zero-place function symbols. We could then do without the second
clause in the definition of terms. We just have to understand f (t1 , . . . , tn ) as
just f by itself if n = 0.
fol:syn:frm: Definition 15.5 (Formulas). The set of formulas Frm(L) of the language L
defn:formulas
is defined inductively as follows:
1. ⊥ is an atomic formula.
2. ⊤ is an atomic formula.
3. If R is an n-place predicate symbol of L and t1 , . . . , tn are terms of L,
then R(t1 , . . . , tn ) is an atomic formula.
4. If t1 and t2 are terms of L, then =(t1 , t2 ) is an atomic formula.
5. If φ is a formula, then ¬φ is a formula.
6. If φ and ψ are formulas, then (φ ∧ ψ) is a formula.
7. If φ and ψ are formulas, then (φ ∨ ψ) is a formula.
explanation The definitions of the set of terms and that of formulas are inductive defi-
nitions. Essentially, we construct the set of formulas in infinitely many stages.
In the initial stage, we pronounce all atomic formulas to be formulas; this
corresponds to the first few cases of the definition, i.e., the cases for ⊤, ⊥,
R(t1 , . . . , tn ) and =(t1 , t2 ). “Atomic formula” thus means any formula of this
form.
The other cases of the definition give rules for constructing new formulas
out of formulas already constructed. At the second stage, we can use them to
construct formulas out of atomic formulas. At the third stage, we construct
new formulas from the atomic formulas and those obtained in the second stage,
and so on. A formula is anything that is eventually constructed at such a stage,
and nothing else.
By convention, we write = between its arguments and leave out the paren-
theses: t1 = t2 is an abbreviation for =(t1 , t2 ). Moreover, ¬=(t1 , t2 ) is ab-
breviated as t1 ̸= t2 . When writing a formula (ψ ∗ χ) constructed from ψ, χ
using a two-place connective ∗, we will often leave out the outermost pair of
parentheses and write simply ψ ∗ χ.
intro Some logic texts require that the variable x must occur in φ in order for
∃x φ and ∀x φ to count as formulas. Nothing bad happens if you don’t require
this, and it makes things easier.
If we work in a language for a specific application, we will often write two-
place predicate symbols and function symbols between the respective terms,
e.g., t1 < t2 and (t1 + t2 ) in the language of arithmetic and t1 ∈ t2 in the
language of set theory. The successor function in the language of arithmetic
is even written conventionally after its argument: t′ . Officially, however, these
are just conventional abbreviations for A20 (t1 , t2 ), f02 (t1 , t2 ), A20 (t1 , t2 ) and f01 (t),
respectively.
Definition 15.6 (Syntactic identity). The symbol ≡ expresses syntactic iden-
tity between strings of symbols, i.e., φ ≡ ψ iff φ and ψ are strings of symbols
of the same length and which contain the same symbol in each place.
As terms and formulas are built up from basic elements via inductive def-
initions, we can use the following induction principles to prove things about
them.
(assuming t1 , . . . , tn are terms of L), then P holds for every term in Trm(L).
(assuming φ and ψ are formulas of L), then P holds for all formulas in Frm(L).
content/first-order-logic/syntax-and-semantics/unique-readability.tex
Perhaps the best way to make this clear is to see what would happen if we
had given bad rules for forming formulas that would not guarantee unique read-
ability. For instance, we could have forgotten the parentheses in the formation
rules for connectives, e.g., we might have allowed this:
If φ and ψ are formulas, then so is φ → ψ.
Starting from an atomic formula θ, this would allow us to form θ → θ. From
this, together with θ, we would get θ → θ → θ. But there are two ways to do
this:
1. We take θ to be φ and θ → θ to be ψ.
2. We take φ to be θ → θ and ψ is θ.
Correspondingly, there are two ways to “read” the formula θ → θ → θ. It is of
the form ψ → χ where ψ is θ and χ is θ → θ, but it is also of the form ψ → χ
with ψ being θ → θ and χ being θ.
If this happens, our definitions will not always work. For instance, when we
define the main operator of a formula, we say: in a formula of the form ψ → χ,
the main operator is the indicated occurrence of →. But if we can match the
formula θ → θ → θ with ψ → χ in the two different ways mentioned above,
then in one case we get the first occurrence of → as the main operator, and
in the second case the second occurrence. But we intend the main operator to
be a function of the formula, i.e., every formula must have exactly one main
operator occurrence.
Lemma 15.9. The number of left and right parentheses in a formula φ are
equal.
Proof. Exercise.
fol:syn:unq: Proposition 15.12. If φ is an atomic formula, then it satisfies one, and only
prop:unique-atomic
one of the following conditions.
1. φ ≡ ⊥.
2. φ ≡ ⊤.
3. φ ≡ R(t1 , . . . , tn ) where R is an n-place predicate symbol, t1 , . . . , tn are
terms, and each of R, t1 , . . . , tn is uniquely determined.
4. φ ≡ t1 = t2 where t1 and t2 are uniquely determined terms.
Proof. Exercise.
Problem 15.4. Prove Proposition 15.12 (Hint: Formulate and prove a version
of Lemma 15.11 for terms.)
Proof. The formation rules require that if a formula is not atomic, it must
start with an opening parenthesis (, ¬, or a quantifier. On the other hand,
every formula that starts with one of the following symbols must be atomic:
a predicate symbol, a function symbol, a constant symbol, ⊥, ⊤.
So we really only have to show that if φ is of the form (ψ ∗ χ) and also of
the form (ψ ′ ∗′ χ′ ), then ψ ≡ ψ ′ , χ ≡ χ′ , and ∗ = ∗′ .
So suppose both φ ≡ (ψ ∗ χ) and φ ≡ (ψ ′ ∗′ χ′ ). Then either ψ ≡ ψ ′ or not.
If it is, clearly ∗ = ∗′ and χ ≡ χ′ , since they then are substrings of φ that begin
in the same place and are of the same length. The other case is ψ ̸≡ ψ ′ . Since
ψ and ψ ′ are both substrings of φ that begin at the same place, one must be
a proper prefix of the other. But this is impossible by Lemma 15.11.
content/first-order-logic/syntax-and-semantics/main-operator.tex
In each case, we intend the specific indicated occurrence of the main oper-
ator in the formula. For instance, since the formula ((θ → α) → (α → θ)) is of
the form (ψ → χ) where ψ is (θ → α) and χ is (α → θ), the second occurrence
of → is the main operator.
This is a recursive definition of a function which maps all non-atomic formu- explanation
las to their main operator occurrence. Because of the way formulas are defined
inductively, every formula φ satisfies one of the cases in Definition 15.14. This
guarantees that for each non-atomic formula φ a main operator exists. Because
each formula satisfies only one of these conditions, and because the smaller for-
mulas from which φ is constructed are uniquely determined in each case, the
main operator occurrence of φ is unique, and so we have defined a function.
We call formulas by the names in Table 15.1 depending on which symbol
their main operator is.
Main operator Type of formula Example
none atomic (formula) ⊥, ⊤, R(t1 , . . . , tn ), t1 = t2
¬ negation ¬φ
∧ conjunction (φ ∧ ψ)
∨ disjunction (φ ∨ ψ)
→ conditional (φ → ψ)
↔ biconditional (φ ↔ ψ)
∀ universal (formula) ∀x φ
∃ existential (formula) ∃x φ
Table 15.1: Main operator and names of formulas
fol:syn:mai:
tab:main-op content/first-order-logic/syntax-and-semantics/subformulas.tex
15.6 Subformulas
fol:syn:sbf: It is often useful to talk about the formulas that “make up” a given formula. explanation
sec
We call these its subformulas. Any formula counts as a subformula of itself; a
subformula of φ other than φ itself is a proper subformula.
Definition 15.15 (Immediate Subformula). If φ is a formula, the imme-
diate subformulas of φ are defined inductively as follows:
1. Atomic formulas have no immediate subformulas.
2. φ ≡ ¬ψ: The only immediate subformula of φ is ψ.
3. φ ≡ (ψ ∗ χ): The immediate subformulas of φ are ψ and χ (∗ is any one
of the two-place connectives).
4. φ ≡ ∀x ψ: The only immediate subformula of φ is ψ.
5. φ ≡ ∃x ψ: The only immediate subformula of φ is ψ.
explanation Note the subtle difference in how we have defined immediate subformulas
and proper subformulas. In the first case, we have directly defined the imme-
diate subformulas of a formula φ for each possible form of φ. It is an explicit
definition by cases, and the cases mirror the inductive definition of the set of
formulas. In the second case, we have also mirrored the way the set of all
formulas is defined, but in each case we have also included the proper subfor-
mulas of the smaller formulas ψ, χ in addition to these formulas themselves.
This makes the definition recursive. In general, a definition of a function on
an inductively defined set (in our case, formulas) is recursive if the cases in the
definition of the function make use of the function itself. To be well defined,
we must make sure, however, that we only ever use the values of the function
for arguments that come “before” the one we are defining—in our case, when
defining “proper subformula” for (ψ ∗ χ) we only use the proper subformulas
of the “earlier” formulas ψ and χ.
content/first-order-logic/syntax-and-semantics/formation-sequences.tex
Example 15.21. For any first-order language L, all L-formulas are L-strings,
but not conversely. For example,
)(v0 → ∃
1. φi ≡ ¬φj .
2. φi ≡ (φj ∧ φk ).
3. φi ≡ (φj ∨ φk ).
4. φi ≡ (φj → φk ).
5. φi ≡ (φj ↔ φk ).
6. φi ≡ ∀x φj .
7. φi ≡ ∃x φj .
When it is necessary to distinguish, we will refer to formation sequences for
formulas as formula formation sequences.
Example 15.25.
⟨A10 (v0 ), A11 (c1 ), (A11 (c1 ) ∧ A10 (v0 )), ∃v0 (A11 (c1 ) ∧ A10 (v0 ))⟩
⟨A10 (v0 ), A11 (c1 ), (A11 (c1 ) ∧ A10 (v0 )), A11 (c1 ),
∀v1 A10 (v0 ), ∃v0 (A11 (c1 ) ∧ A10 (v0 ))⟩.
As can be seen from the second example, formation sequences may contain
“junk”: formulas which are redundant or do not contribute to the construction.
We can also prove the converse. This is important because it shows that
our two ways of defining formulas are equivalent: they give the same results.
It also means that we can prove theorems about formulas by using ordinary
induction on the length of formation sequences.
Proof. Exercise.
fol:syn:fseq: Theorem 15.28. Frm(L) is the set of all L-strings φ such that there exists
thm:fseq-frm-equiv
a formula formation sequence for φ.
Proof. Let F be the set of all strings of symbols in the language L that have a
formation sequence. We have seen in Proposition 15.26 that Frm(L) ⊆ F , so
now we prove the converse.
Suppose φ has a formation sequence ⟨φ0 , . . . , φn ⟩. We prove that φ ∈
Frm(L) by strong induction on n. Our induction hypothesis is that every
string of symbols with a formation sequence of length m < n is in Frm(L). By
the definition of a formation sequence, either φ ≡ φn is atomic or there must
exist j, k < n such that one of the following is the case:
1. φ ≡ ¬φj .
2. φ ≡ (φj ∧ φk ).
3. φ ≡ (φj ∨ φk ).
4. φ ≡ (φj → φk ).
5. φ ≡ (φj ↔ φk ).
6. φ ≡ ∀x φj .
7. φ ≡ ∃x φj .
Now we reason by cases. If φ is atomic then φn ∈ Frm(L0 ). Suppose in-
stead that φ ≡ (φj ∧ φk ). By Lemma 15.27, ⟨φ0 , . . . , φj ⟩ and ⟨φ0 , . . . , φk ⟩
are formation sequences for φj and φk , respectively. Since these are proper
initial subsequences of the formation sequence for φ, they both have length
less than n. Therefore by the induction hypothesis, φj and φk are in Frm(L0 ),
and by the definition of a formula, so is (φj ∧ φk ). The other cases follow by
parallel reasoning.
Formation sequences for terms have similar properties to those for formulas.
fol:syn:fseq: Proposition 15.29. Trm(L) is the set of all L-strings t such that there exists
prop:fseq-trm-equiv
a term formation sequence for t.
Proof. Exercise.
Problem 15.8. Prove Proposition 15.29. Hint: use a similar strategy to that
used in the proof of Theorem 15.28.
There are two types of “junk” that can appear in formation sequences:
repeated elements, and elements that are irrelevant to the construction of the
formation or term. We can eliminate both by looking at minimal formation
sequences.
Definition 15.30 (Minimal formation sequences). A formation sequence fol:syn:fseq:
⟨φ0 , . . . , φn ⟩ for a formula φ is a minimal formation sequence for φ if for ev- defn:minimal-fseq
ery other formation sequence s for φ, the length of s is greater than or equal
to n + 1.
Similarly, a formation sequence ⟨t0 , . . . , tn ⟩ for a term t is a minimal for-
mation sequence for t if for every other formation sequence s for t, the length
of s is greater than or equal to n + 1.
Note that a formula or term can have more than one minimal formation
sequence, but they will contain exactly the same strings.
Proposition 15.31. The following are equivalent: fol:syn:fseq:
prop:subformula-equivs
1. ψ is a sub-formula of φ.
2. ψ occurs in every formation sequence of φ.
3. ψ occurs in a minimal formation sequence of φ.
Proof. Exercise.
content/first-order-logic/syntax-and-semantics/free-vars-sentences.tex
ψ is the scope of the first ∀v0 , χ is the scope of ∃v1 , and θ is the scope of
the second ∀v0 . The first ∀v0 binds the occurrences of v0 in ψ, ∃v1 binds the
occurrence of v1 in χ, and the second ∀v0 binds the occurrence of v0 in θ. The
first occurrence of v1 and the fourth occurrence of v0 are free in φ. The last
occurrence of v0 is free in θ, but bound in χ and φ.
content/first-order-logic/syntax-and-semantics/substitution.tex
15.9 Substitution
fol:syn:sub:
sec
Definition 15.37 (Substitution in a term). We define s[t/x], the result of
substituting t for every occurrence of x in s, recursively:
1. s ≡ c: s[t/x] is just s.
2. s ≡ y: s[t/x] is also just s, provided y is a variable and y ̸≡ x.
3. s ≡ x: s[t/x] is t.
4. s ≡ f (t1 , . . . , tn ): s[t/x] is f (t1 [t/x], . . . , tn [t/x]).
Example 15.39.
1. v8 is free for v1 in ∃v3 A24 (v3 , v1 )
2. f12 (v1 , v2 ) is not free for v0 in ∀v2 A24 (v0 , v2 )
explanation Note that substitution may be vacuous: If x does not occur in φ at all, then
φ[t/x] is just φ.
The restriction that t must be free for x in φ is necessary to exclude cases like
the following. If φ ≡ ∃y x < y and t ≡ y, then φ[t/x] would be ∃y y < y. In this
case the free variable y is “captured” by the quantifier ∃y upon substitution,
and that is undesirable. For instance, we would like it to be the case that
whenever ∀x ψ holds, so does ψ[t/x]. But consider ∀x ∃y x < y (here ψ is
Chapter 16
content/first-order-logic/syntax-and-semantics/intro-semantics.tex
16.1 Introduction
fol:syn:its: Giving the meaning of expressions is the domain of semantics. The central
sec
concept in semantics is that of satisfaction in a structure. A structure gives
meaning to the building blocks of the language: a domain is a non-empty
set of objects. The quantifiers are interpreted as ranging over this domain,
constant symbols are assigned elements in the domain, function symbols are
assigned functions from the domain to itself, and predicate symbols are as-
signed relations on the domain. The domain together with assignments to the
basic vocabulary constitutes a structure. Variables may appear in formulas,
and in order to give a semantics, we also have to assign elements of the do-
main to them—this is a variable assignment. The satisfaction relation, finally,
brings these together. A formula may be satisfied in a structure M relative
to a variable assignment s, written as M, s ⊨ φ. This relation is also defined
by induction on the structure of φ, using the truth tables for the logical con-
nectives to define, say, satisfaction of (φ ∧ ψ) in terms of satisfaction (or not)
of φ and ψ. It then turns out that the variable assignment is irrelevant if
209
CHAPTER 16. SEMANTICS OF FIRST-ORDER LOGIC
the formula φ is a sentence, i.e., has no free variables, and so we can talk of
sentences being simply satisfied (or not) in structures.
On the basis of the satisfaction relation M ⊨ φ for sentences we can then de-
fine the basic semantic notions of validity, entailment, and satisfiability. A sen-
tence is valid, ⊨ φ, if every structure satisfies it. It is entailed by a set of
sentences, Γ ⊨ φ, if every structure that satisfies all the sentences in Γ also
satisfies φ. And a set of sentences is satisfiable if some structure satisfies all
sentences in it at the same time. Because formulas are inductively defined, and
satisfaction is in turn defined by induction on the structure of formulas, we can
use induction to prove properties of our semantics and to relate the semantic
notions defined.
content/first-order-logic/syntax-and-semantics/structures.tex
2. 0N = 0
Example 16.3. A structure M for the language LZ of set theory requires just
a set and a single-two place relation. So technically, e.g., the set of people plus
the relation “x is older than y” could be used as a structure for LZ , as well as
N together with n ≥ m for n, m ∈ N.
A particularly interesting structure for LZ in which the elements of the
domain are actually sets, and the interpretation of ∈ actually is the relation
“x is an element of y” is the structure HF of hereditarily finite sets:
logic. For example, the choice to prevent empty domains ensures, given the
usual account of satisfaction (or truth) for quantified sentences, that ∃x (φ(x)∨
¬φ(x)) is valid—that is, a logical truth. And the stipulation that all constant
symbols must refer to an object in the domain ensures that the existential
generalization is a sound pattern of inference: φ(a), therefore ∃x φ(x). If we
allowed names to refer outside the domain, or to not refer, then we would be on
our way to a free logic, in which existential generalization requires an additional
premise: φ(a) and ∃x x = a, therefore ∃x φ(x).
content/first-order-logic/syntax-and-semantics/covered-structures.tex
maps to 5, and similarly for the binary function symbol ×. Hence, the value of
f our is just 4, and the value of ×(tw o, +(thr ee, z er o)) (or in infix notation,
tw o × (thr ee + z er o)) is
content/first-order-logic/syntax-and-semantics/satisfaction.tex
states when atomic formulas are satisfied, and we define when a complex for-
mula is satisfied depending on the main connective or quantifier and whether
or not the immediate subformulas are satisfied.
The case of the quantifiers here is a bit tricky, as the immediate subformula
of a quantified formula has a free variable, and structures don’t specify the
values of variables. In order to deal with this difficulty, we also introduce
variable assignments and define satisfaction not with respect to a structure
alone, but with respect to a structure plus a variable assignment.
Definition 16.7 (Variable Assignment). A variable assignment s for a struc-
ture M is a function which maps each variable to an element of |M|, i.e.,
s : Var → |M|.
A structure assigns a value to each constant symbol, and a variable assign- explanation
ment to each variable. But we want to use terms built up from them to also
name elements of the domain. For this we define the value of terms induc-
tively. For constant symbols and variables the value is just as the structure
or the variable assignment specifies it; for more complex terms it is computed
recursively using the functions the structure assigns to the function symbols.
Definition 16.8 (Value of Terms). If t is a term of the language L, M is
a structure for L, and s is a variable assignment for M, the value ValM
s (t) is
defined as follows:
1. t ≡ c: ValM M
s (t) = c .
2. t ≡ x: ValM
s (t) = s(x).
3. t ≡ f (t1 , . . . , tn ):
ValM M M M
s (t) = f (Vals (t1 ), . . . , Vals (tn )).
Note that an x-variant of an assignment s does not have to assign something explanation
different to x. In fact, every assignment counts as an x-variant of itself.
Definition 16.10. If s is a variable assignment for a structure M and m ∈ |M|,
then the assignment s[m/x] is the variable assignment defined by
(
m if y ≡ x
s[m/x](y) =
s(y) otherwise.
1. φ ≡ ⊥: M, s ⊭ φ.
2. φ ≡ ⊤: M, s ⊨ φ.
4. φ ≡ t1 = t2 : M, s ⊨ φ iff ValM M
s (t1 ) = Vals (t2 ).
5. φ ≡ ¬ψ: M, s ⊨ φ iff M, s ⊭ ψ.
explanation The variable assignments are important in the last two clauses. We cannot
define satisfaction of ∀x ψ(x) by “for all m ∈ |M|, M ⊨ ψ(m).” We cannot
define satisfaction of ∃x ψ(x) by “for at least one m ∈ |M|, M ⊨ ψ(m).” The
reason is that if m ∈ |M|, it is not a symbol of the language, and so ψ(m) is
not a formula (that is, ψ[m/x] is undefined). We also cannot assume that
we have constant symbols or terms available that name every element of M,
since there is nothing in the definition of structures that requires it. In the
standard language, the set of constant symbols is denumerable, so if |M| is not
enumerable there aren’t even enough constant symbols to name every object.
We solve this problem by introducing variable assignments, which allow us
to link variables directly with elements of the domain. Then instead of saying
that, e.g., ∃x ψ(x) is satisfied in M iff for at least one m ∈ |M|, we say it is
satisfied in M relative to s iff ψ(x) is satisfied relative to s[m/x] for at least
one m ∈ |M|.
1. |M| = {1, 2, 3, 4}
2. aM = 1
3. bM = 2
ValM M M M
s (f (a, b)) = f (Vals (a), Vals (b)).
ValM M
s (f (a, b)) = f (1, 2) = 1 + 2 = 3.
ValM M M M M
s (f (f (a, b), a)) = f (Vals (f (a, b)), Vals (a)) = f (3, 1) = 3,
ValM M M M M
s (f (f (a, b), x)) = f (Vals (f (a, b)), Vals (x)) = f (3, 1) = 3,
s1 = s[1/x], s2 = s[2/x],
s3 = s[3/x], s4 = s[4/x].
So, e.g., s2 (x) = 2 and s2 (y) = s(y) = 1 for all variables y other than x. These
are all the x-variants of s for the structure M, since |M| = {1, 2, 3, 4}. Note,
in particular, that s1 = s (s is always an x-variant of itself).
To determine if an existentially quantified formula ∃x φ(x) is satisfied, we
have to determine if M, s[m/x] ⊨ φ(x) for at least one m ∈ |M|. So,
since M, s[1/x] ⊨ R(b, x) ∨ R(x, b) (s[3/x] would also fit the bill). But,
Since M, s[3/x] ⊭ R(a, x) and M, s[4/x] ⊭ R(a, x), the interesting cases where
we have to worry about the consequent of the conditional are only m = 1
and = 2. Does M, s[1/x] ⊨ ∃y R(x, y) hold? It does if there is at least one
n ∈ |M| so that M, s[1/x][n/y] ⊨ R(x, y). In fact, if we take n = 1, we have
s[1/x][n/y] = s[1/y] = s. Since s(x) = 1, s(y) = 1, and ⟨1, 1⟩ ∈ RM , the
answer is yes.
To determine if M, s[2/x] ⊨ ∃y R(x, y), we have to look at the variable
assignments s[2/x][n/y]. Here, for n = 1, this assignment is s2 = s[2/x], which
does not satisfy R(x, y) (s2 (x) = 2, s2 (y) = 1, and ⟨2, 1⟩ ∈ / RM ). However,
consider s[2/x][3/y] = s2 [3/y]. M, s2 [3/y] ⊨ R(x, y) since ⟨2, 3⟩ ∈ RM , and so
M, s2 ⊨ ∃y R(x, y).
Problem 16.2. Let L = {c, f, A} with one constant symbol, one one-place
function symbol and one two-place predicate symbol, and let the structure M
be given by
1. |M| = {1, 2, 3}
2. cM = 3
3. f M (1) = 2, f M (2) = 3, f M (3) = 2
4. AM = {⟨1, 2⟩, ⟨2, 3⟩, ⟨3, 3⟩}
(a) Let s(v) = 1 for all variables v. Find out whether
content/first-order-logic/syntax-and-semantics/assignments.tex
Proof. By induction on the complexity of t. For the base case, t can be a con-
stant symbol or one of the variables x1 , . . . , xn . If t = c, then ValM
s1 (t) = c
M
=
M
Vals2 (t). If t = xi , s1 (xi ) = s2 (xi ) by the hypothesis of the proposition, and
so ValM M
s1 (t) = s1 (xi ) = s2 (xi ) = Vals2 (t).
For the inductive step, assume that t = f (t1 , . . . , tk ) and that the claim
holds for t1 , . . . , tk . Then
ValM M
s1 (t) = Vals1 (f (t1 , . . . , tk ))
= f M (ValM M
s1 (t1 ), . . . , Vals1 (tk )).
ValM M
s1 (t) = Vals1 (f (t1 , . . . , tk ))
= f M (ValM M
s1 (t1 ), . . . , Vals1 (tk ))
= f M (ValM M
s2 (t1 ), . . . , Vals2 (tk ))
= ValM M
s2 (f (t1 , . . . , tk )) = Vals2 (t).
For i = 1, . . . , k, ValM M
s1 (ti ) = Vals2 (ti ) by Proposition 16.13. So we also
have ⟨ValM M M
s2 (ti ), . . . , Vals2 (tk )⟩ ∈ R , and hence M, s2 ⊨ φ.
ValM M
s2 (t1 ) = Vals1 (t1 ) (by Proposition 16.13)
= ValM
s1 (t2 ) (since M, s1 ⊨ t1 = t2 )
= ValM
s2 (t2 ) (by Proposition 16.13),
so M, s2 ⊨ t1 = t2 .
3. φ ≡ ψ ∨ χ: if M, s1 ⊨ φ, then M, s1 ⊨ ψ or M, s1 ⊨ χ. By induction
hypothesis, M, s2 ⊨ ψ or M, s2 ⊨ χ, so M, s2 ⊨ φ.
explanation Sentences have no free variables, so any two variable assignments assign the
same things to all the (zero) free variables of any sentence. The proposition
just proved then means that whether or not a sentence is satisfied in a structure
relative to a variable assignment is completely independent of the assignment.
We’ll record this fact. It justifies the definition of satisfaction of a sentence in
a structure (without mentioning a variable assignment) that follows.
Corollary 16.15. If φ is a sentence and s a variable assignment, then M, s ⊨ fol:syn:ass:
Proof. Exercise.
Proposition 16.19. Suppose φ(x) only contains x free, and M is a structure. fol:syn:ass:
prop:sat-quant
Then:
1. M ⊨ ∃x φ(x) iff M, s ⊨ φ(x) for at least one variable assignment s.
2. M ⊨ ∀x φ(x) iff M, s ⊨ φ(x) for all variable assignments s.
Proof. Exercise.
4. φ ≡ d1 = d2 : M ||= φ iff dM M
1 = d2 .
10. φ ≡ ∀x ψ: M ||= φ iff for all a ∈ |M|, M[a/c] ||= ψ[c/x], if c does not
occur in ψ.
11. φ ≡ ∃x ψ: M ||= φ iff there is an a ∈ |M| such that M[a/c] ||= ψ[c/x],
if c does not occur in ψ.
Problem 16.7. Suppose that f is a function symbol not in φ(x, y). Show that
there is a structure M such that M ⊨ ∀x ∃y φ(x, y) iff there is an M′ such that
M′ ⊨ ∀x φ(x, f (x)).
(This problem is a special case of what’s known as Skolem’s Theorem;
∀x φ(x, f (x)) is called a Skolem normal form of ∀x ∃y φ(x, y).)
content/first-order-logic/syntax-and-semantics/extensionality.tex
16.6 Extensionality
fol:syn:ext: Extensionality, sometimes called relevance, can be expressed informally as fol- explanation
sec
lows: the only factors that bear upon the satisfaction of formula φ in a struc-
ture M relative to a variable assignment s, are the size of the domain and the
assignments made by M and s to the elements of the language that actually
appear in φ.
One immediate consequence of extensionality is that where two structures M
and M′ agree on all the elements of the language appearing in a sentence φ
and have the same domain, M and M′ must also agree on whether or not φ
itself is true.
Proof. First prove (by induction on t) that for every term, ValM 1 M2
s (t) = Vals (t).
Then prove the proposition by induction on φ, making use of the claim just
proved for the induction basis (where φ is atomic).
Proof. By induction on t.
′
ValM
s (t[t /x]) =
′ ′
= ValM
s (f (t1 [t /x], . . . , tn [t /x]))
by definition of t[t′ /x]
′ ′
= f M (ValM M
s (t1 [t /x]), . . . , Vals (tn [t /x]))
by definition of ValM
s (f (. . . ))
= f M (ValM
s[ValM ′
s (t )/x]
(t1 ), . . . , ValM
s[ValM ′
s (t )/x]
(tn ))
by induction hypothesis
= ValM
s[ValM ′
s (t )/x]
(t) by definition of ValM
s[ValM ′
s (t )/x]
(f (. . . ))
Proof. Exercise.
The point of Propositions 16.22 and 16.23 is the following. Suppose we explanation
have a term t or a formula φ and some term t′ , and we want to know the
value of t[t′ /x] or whether or not φ[t′ /x] is satisfied in a structure M relative
to a variable assignment s. Then we can either perform the substitution first
and then consider the value or satisfaction relative to M and s, or we can first
determine the value m = ValM ′ ′
s (t ) of t in M relative to s, change the variable
assignment to s[m/x] and then consider the value of t in M and s[m/x], or
whether M, s[m/x] ⊨ φ. Propositions 16.22 and 16.23 guarantee that the
answer will be the same, whichever way we do it.
content/first-order-logic/syntax-and-semantics/semantic-notions.tex
Proof. For the forward direction, let φ be valid, and let Γ be a set of sentences.
Let M be a structure so that M ⊨ Γ . Since φ is valid, M ⊨ φ, hence Γ ⊨ φ.
For the contrapositive of the reverse direction, let φ be invalid, so there is
a structure M with M ⊭ φ. When Γ = {⊤}, since ⊤ is valid, M ⊨ Γ . Hence,
there is a structure M so that M ⊨ Γ but M ⊭ φ, hence Γ does not entail φ.
Proof. For the forward direction, suppose Γ ⊨ φ and suppose to the contrary
that there is a structure M so that M ⊨ Γ ∪ {¬φ}. Since M ⊨ Γ and Γ ⊨ φ,
M ⊨ φ. Also, since M ⊨ Γ ∪ {¬φ}, M ⊨ ¬φ, so we have both M ⊨ φ and
M ⊭ φ, a contradiction. Hence, there can be no such structure M, so Γ ∪ {¬φ}
is unsatisfiable.
For the reverse direction, suppose Γ ∪ {¬φ} is unsatisfiable. So for every
structure M, either M ⊭ Γ or M ⊨ φ. Hence, for every structure M with
M ⊨ Γ , M ⊨ φ, so Γ ⊨ φ.
Proof. For the forward direction, let Γ ∪ {φ} ⊨ ψ and let M be a structure so
that M ⊨ Γ . If M ⊨ φ, then M ⊨ Γ ∪ {φ}, so since Γ ∪ {φ} entails ψ, we get
M ⊨ ψ. Therefore, M ⊨ φ → ψ, so Γ ⊨ φ → ψ.
For the reverse direction, let Γ ⊨ φ → ψ and M be a structure so that
M ⊨ Γ ∪ {φ}. Then M ⊨ Γ , so M ⊨ φ → ψ, and since M ⊨ φ, M ⊨ ψ. Hence,
whenever M ⊨ Γ ∪ {φ}, M ⊨ ψ, so Γ ∪ {φ} ⊨ ψ.
Proposition 16.31. Let M be a structure, and φ(x) a formula with one free fol:syn:sem:
prop:quant-terms
variable x, and t a closed term. Then:
1. φ(t) ⊨ ∃x φ(x)
2. ∀x φ(x) ⊨ φ(t)
224
Problem 16.11. Complete the proof of Proposition 16.31.
Chapter 17
content/first-order-logic/models-theories/introduction.tex
17.1 Introduction
fol:mat:int: The development of the axiomatic method is a significant achievement in the explanation
sec
history of science, and is of special importance in the history of mathematics.
An axiomatic development of a field involves the clarification of many questions:
What is the field about? What are the most fundamental concepts? How are
they related? Can all the concepts of the field be defined in terms of these
fundamental concepts? What laws do, and must, these concepts obey?
The axiomatic method and logic were made for each other. Formal logic
provides the tools for formulating axiomatic theories, for proving theorems
from the axioms of the theory in a precisely specified way, for studying the
properties of all systems satisfying the axioms in a systematic way.
We can think of an axiomatic theory as the set of sentences that is ax- explanation
The important logical facts that make this formal approach to the axiomatic
method so important are the following. Suppose Γ is an axiom system for a
theory, i.e., a set of sentences.
2. We may fail in this respect because there are M such that M ⊨ Γ , but M
is not one of the structures we intend. This may lead us to add axioms
which are not true in M.
3. If we are successful at least in the respect that Γ is true in all the intended
structures, then a sentence φ is true in all intended structures whenever
Γ ⊨ φ. Thus we can use logical tools (such as derivation methods) to
show that sentences are true in all intended structures simply by showing
that they are entailed by the axioms.
content/first-order-logic/models-theories/expressing-props-of-structures.tex
{ ∀x x ≤ x,
∀x ∀y ((x ≤ y ∧ y ≤ x) → x = y),
∀x ∀y ∀z ((x ≤ y ∧ y ≤ z) → x ≤ z) }
content/first-order-logic/models-theories/theories.tex
Example 17.4. The theory of strict linear orders in the language L< is ax-
iomatized by the set
{ ∀x ¬x < x,
∀x ∀y ((x < y ∨ y < x) ∨ x = y),
∀x ∀y ∀z ((x < y ∧ y < z) → x < z) }
∀x (x · 1) = x
∀x ∀y ∀z (x · (y · z)) = ((x · y) · z)
∀x ∃y (x · y) = 1
∀x ∀y (x′ = y ′ → x = y)
∀x 0 ̸= x′
∀x (x + 0) = x
∀x ∀y (x + y ′ ) = (x + y)′
∀x (x × 0) = 0
∀x ∀y (x × y ′ ) = ((x × y) + x)
∀x ∀y (x < y ↔ ∃z (z ′ + x) = y)
Since there are infinitely many sentences of the latter form, this axiom system
is infinite. The latter form is called the induction schema. (Actually, the
induction schema is a bit more complicated than we let on here.)
The last axiom is an explicit definition of <.
Example 17.7. The theory of pure sets plays an important role in the foun-
dations (and in the philosophy) of mathematics. A set is pure if all its elements
are also pure sets. The empty set counts therefore as pure, but a set that has
something as an element that is not a set would not be pure. So the pure sets
are those that are formed just from the empty set and no “urelements,” i.e.,
objects that are not themselves sets.
∃x ¬∃y y ∈ x
∀x ∀y (∀z(z ∈ x ↔ z ∈ y) → x = y)
∀x ∀y ∃z ∀u (u ∈ z ↔ (u = x ∨ u = y))
∀x ∃y ∀z (z ∈ y ↔ ∃u (z ∈ u ∧ u ∈ x))
∃x ∀y (y ∈ x ↔ φ(y))
The first axiom says that there is a set with no elements (i.e., ∅ exists); the
second says that sets are extensional; the third that for any sets X and Y , the
set {X, Y } exists; the fourth that for any set X, the set ∪X exists, where ∪X
is the union of all the elements of X.
The sentences mentioned last are collectively called the naive comprehen-
sion scheme. It essentially says that for every φ(x), the set {x : φ(x)} exists—so
at first glance a true, useful, and perhaps even necessary axiom. It is called
“naive” because, as it turns out, it makes this theory unsatisfiable: if you take
φ(y) to be ¬y ∈ y, you get the sentence
∃x ∀y (y ∈ x ↔ ¬y ∈ y)
∀x P (x, x)
∀x ∀y ((P (x, y) ∧ P (y, x)) → x = y)
∀x ∀y ∀z ((P (x, y) ∧ P (y, z)) → P (x, z))
Moreover, any two objects have a mereological sum (an object that has these
two objects as parts, and is minimal in this respect).
These are only some of the basic principles of parthood considered by meta-
physicians. Further principles, however, quickly become hard to formulate or
write down without first introducing some defined relations. For instance, most
metaphysicians interested in mereology also view the following as a valid prin-
ciple: whenever an object x has a proper part y, it also has a part z that has
no parts in common with y, and so that the fusion of y and z is x.
content/first-order-logic/models-theories/expressing-relations.tex
Note that we have to involve variable assignments here: we can’t just say “Rab
iff M ⊨ A20 (a, b)” because a and b are not symbols of our language: they are
elements of |M|.
Since we don’t just have atomic formulas, but can combine them using the
logical connectives and the quantifiers, more complex formulas can define other
relations which aren’t directly built into M. We’re interested in how to do that,
and specifically, which relations we can define in a structure.
This idea is not just interesting in specific structures, but generally when- explanation
1. n is between i and j;
3. n is a prime number (i.e., no number other than 1 and n evenly divides n).
2
Problem 17.2. Suppose the formula φ(v1 , v2 ) expresses the relation R ⊆ |M|
in a structure M. Find formulas that express the following relations:
1. {0} is definable in N;
2. {1} is definable in N;
3. {2} is definable in N;
content/first-order-logic/models-theories/set-theory.tex
∀z (z ∈ x → z ∈ y)
∃x (¬∃y y ∈ x ∧ ∀z x ⊆ z)
∀u ((u ∈ x ∨ u ∈ y) ↔ u ∈ z)
∀u (u ⊆ x ↔ u ∈ y)
since the elements of X ∪Y are exactly the sets that are either elements of X or
elements of Y , and the elements of ℘(X) are exactly the subsets of X. However,
this doesn’t allow us to use x ∪ y or ℘(x) as if they were terms: we can only use
the entire formulas that define the relations X ∪ Y = Z and ℘(X) = Y . In fact,
we do not know that these relations are ever satisfied, i.e., we do not know that
unions and power sets always exist. For instance, the sentence ∀x ∃y ℘(x) = y
is another axiom of ZFC (the power set axiom).
Now what about talk of ordered pairs or functions? Here we have to explain
how we can think of ordered pairs and functions as special kinds of sets. One
way to define the ordered pair ⟨x, y⟩ is as the set {{x}, {x, y}}. But like before,
we cannot introduce a function symbol that names this set; we can only define
the relation ⟨x, y⟩ = z, i.e., {{x}, {x, y}} = z:
∀u (u ∈ z ↔ (∀v (v ∈ u ↔ v = x) ∨ ∀v (v ∈ u ↔ (v = x ∨ v = y))))
This says that the elements u of z are exactly those sets which either have x
as its only element or have x and y as its only elements (in other words, those
sets that are either identical to {x} or identical to {x, y}). Once we have this,
we can say further things, e.g., that X × Y = Z:
∀z (z ∈ Z ↔ ∃x ∃y (x ∈ X ∧ y ∈ Y ∧ ⟨x, y⟩ = z))
∀u (u ∈ f → ∃x ∃y (x ∈ X ∧ y ∈ Y ∧ ⟨x, y⟩ = u)) ∧
∀x (x ∈ X → (∃y (y ∈ Y ∧ maps(f, x, y)) ∧
(∀y ∀y ′ ((maps(f, x, y) ∧ maps(f, x, y ′ )) → y = y ′ )))
f : X → Y ∧ ∀x ∀x′ ((x ∈ X ∧ x′ ∈ X ∧
∃y (maps(f, x, y) ∧ maps(f, x′ , y))) → x = x′ )
content/first-order-logic/models-theories/size-of-structures.tex
Chapter 18
Derivation Systems
235
CHAPTER 18. DERIVATION SYSTEMS
content/first-order-logic/proof-systems/introduction.tex
18.1 Introduction
Logics commonly have both a semantics and a derivation system. The seman- fol:prf:int:
sec
tics concerns concepts such as truth, satisfiability, validity, and entailment.
The purpose of derivation systems is to provide a purely syntactic method of
establishing entailment and validity. They are purely syntactic in the sense
that a derivation in such a system is a finite syntactic object, usually a se-
quence (or other finite arrangement) of sentences or formulas. Good derivation
systems have the property that any given sequence or arrangement of sentences
or formulas can be verified mechanically to be “correct.”
The simplest (and historically first) derivation systems for first-order logic
were axiomatic. A sequence of formulas counts as a derivation in such a sys-
tem if each individual formula in it is either among a fixed set of “axioms”
or follows from formulas coming before it in the sequence by one of a fixed
number of “inference rules”—and it can be mechanically verified if a formula
is an axiom and whether it follows correctly from other formulas by one of the
inference rules. Axiomatic derivation systems are easy to describe—and also
easy to handle meta-theoretically—but derivations in them are hard to read
and understand, and are also hard to produce.
Other derivation systems have been developed with the aim of making it
easier to construct derivations or easier to understand derivations once they
are complete. Examples are natural deduction, truth trees, also known as
tableaux proofs, and the sequent calculus. Some derivation systems are de-
signed especially with mechanization in mind, e.g., the resolution method is
easy to implement in software (but its derivations are essentially impossible to
understand). Most of these other derivation systems represent derivations as
trees of formulas rather than sequences. This makes it easier to see which parts
of a derivation depend on which other parts.
So for a given logic, such as first-order logic, the different derivation systems
will give different explications of what it is for a sentence to be a theorem and
what it means for a sentence to be derivable from some others. However that is
done (via axiomatic derivations, natural deductions, sequent derivations, truth
trees, resolution refutations), we want these relations to match the semantic
notions of validity and entailment. Let’s write ⊢ φ for “φ is a theorem” and
“Γ ⊢ φ” for “φ is derivable from Γ .” However ⊢ is defined, we want it to match
up with ⊨, that is:
1. ⊢ φ if and only if ⊨ φ
2. Γ ⊢ φ if and only if Γ ⊨ φ
The “only if” direction of the above is called soundness. A derivation system is
sound if derivability guarantees entailment (or validity). Every decent deriva-
tion system has to be sound; unsound derivation systems are not useful at all.
content/first-order-logic/proof-systems/sequent-calculus.tex
content/first-order-logic/proof-systems/natural-deduction.tex
content/first-order-logic/proof-systems/tableaux.tex
18.4 Tableaux
fol:prf:tab: While many derivation systems operate with arrangements of sentences, tableaux
sec
operate with signed formulas. A signed formula is a pair consisting of a truth
value sign (T or F) and a sentence
T φ or F φ.
which result from one of the signed formulas above it by applying one of the
rules of inference. Each rule allows us to add one or more signed formulas to
the end of a branch, or two signed formulas side by side—in this case a branch
splits into two, with the two added signed formulas forming the ends of the
two branches.
A rule applied to a complex signed formula results in the addition of signed
formulas which are immediate sub-formulas. They come in pairs, one rule for
each of the two signs. For instance, the ∧T rule applies to T φ ∧ ψ, and allows
the addition of both the two signed formulas T φ and T ψ to the end of any
branch containing T φ ∧ ψ, and the rule φ ∧ ψF allows a branch to be split by
adding F φ and F ψ side-by-side. A tableau is closed if every one of its branches
contains a matching pair of signed formulas T φ and F φ.
The ⊢ relation based on tableaux is defined as follows: Γ ⊢ φ iff there is
some finite set Γ0 = {ψ1 , . . . , ψn } ⊆ Γ such that there is a closed tableau for
the assumptions
{F φ, T ψ1 , . . . , T ψn }
For instance, here is a closed tableau that shows that ⊢ (φ ∧ ψ) → φ:
1. F (φ ∧ ψ) → φ Assumption
2. Tφ ∧ ψ →F 1
3. Fφ →F 1
4. Tφ →T 2
5. Tψ →T 2
⊗
content/first-order-logic/proof-systems/axiomatic-deduction.tex
1. φ is an axiom, or
φ → (ψ → φ) ψ → (ψ ∨ χ) (ψ ∧ χ) → ψ
are common axioms that govern →, ∨ and ∧. Some axiom systems aim at a
minimal number of axioms. Depending on the connectives that are taken as
primitives, it is even possible to find axiom systems that consist of a single
axiom.
A rule of inference is a conditional statement that gives a sufficient condition
for a sentence in a derivation to be justified. Modus ponens is one very common
such rule: it says that if φ and φ → ψ are already justified, then ψ is justified.
This means that a line in a derivation containing the sentence ψ is justified,
provided that both φ and φ → ψ (for some sentence φ) appear in the derivation
before ψ.
The ⊢ relation based on axiomatic derivations is defined as follows: Γ ⊢ φ
iff there is a derivation with the sentence φ as its last formula (and Γ is taken
as the set of sentences in that derivation which are justified by (2) above). φ
is a theorem if φ has a derivation where Γ is empty, i.e., every sentence in the
derivation is justified either by (1) or (3). For instance, here is a derivation
that shows that ⊢ φ → (ψ → (ψ ∨ φ)):
1. ψ → (ψ ∨ φ)
2. (ψ → (ψ ∨ φ)) → (φ → (ψ → (ψ ∨ φ)))
3. φ → (ψ → (ψ ∨ φ))
Chapter 19
content/first-order-logic/sequent-calculus/rules-and-proofs.tex
Γ ⇒∆
where Γ and ∆ are finite (possibly empty) sequences of sentences of the lan-
guage L. Γ is called the antecedent, while ∆ is the succedent.
explanation
242
19.2. PROPOSITIONAL RULES
The intuitive idea behind a sequent is: if all of the sentences in the an-
tecedent hold, then at least one of the sentences in the succedent holds. That
is, if Γ = ⟨φ1 , . . . , φm ⟩ and ∆ = ⟨ψ1 , . . . , ψn ⟩, then Γ ⇒ ∆ holds iff
(φ1 ∧ · · · ∧ φm ) → (ψ1 ∨ · · · ∨ ψn )
holds. There are two special cases: where Γ is empty and when ∆ is empty.
When Γ is empty, i.e., m = 0, ⇒ ∆ holds iff ψ1 ∨ · · · ∨ ψn holds. When ∆
is empty, i.e., n = 0, Γ ⇒ holds iff ¬(φ1 ∧ · · · ∧ φm ) does. We say a sequent
is valid iff the corresponding sentence is valid.
If Γ is a sequence of sentences, we write Γ, φ for the result of appending φ
to the right end of Γ (and φ, Γ for the result of appending φ to the left end
of Γ ). If ∆ is a sequence of sentences also, then Γ, ∆ is the concatenation of
the two sequences.
1. φ ⇒ φ
2. ⇒⊤
3. ⊥ ⇒
Derivations in the sequent calculus are certain trees of sequents, where the
topmost sequents are initial sequents, and if a sequent stands below one or two
other sequents, it must follow correctly by a rule of inference. The rules for LK
are divided into two main types: logical rules and structural rules. The logical
rules are named for the main operator of the sentence containing φ and/or ψ in
the lower sequent. Each one comes in two versions, one for inferring a sequent
with the sentence containing the logical operator on the left, and one with the
sentence on the right.
content/first-order-logic/sequent-calculus/propositional-rules.tex
Γ ⇒ ∆, φ φ, Γ ⇒ ∆
¬L ¬R
¬φ, Γ ⇒ ∆ Γ ⇒ ∆, ¬φ
Rules for ∧
φ, Γ ⇒ ∆
∧L
φ ∧ ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ ∧ ψ
∧L
φ ∧ ψ, Γ ⇒ ∆
Rules for ∨
Γ ⇒ ∆, φ
∨R
φ, Γ ⇒ ∆ ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ ∨ ψ
∨L
φ ∨ ψ, Γ ⇒ ∆ Γ ⇒ ∆, ψ
∨R
Γ ⇒ ∆, φ ∨ ψ
Rules for →
Γ ⇒ ∆, φ ψ, Π ⇒ Λ φ, Γ ⇒ ∆, ψ
→L →R
φ → ψ, Γ, Π ⇒ ∆, Λ Γ ⇒ ∆, φ → ψ
content/first-order-logic/sequent-calculus/quantifier-rules.tex
φ(t), Γ ⇒ ∆ Γ ⇒ ∆, φ(a)
∀L ∀R
∀x φ(x), Γ ⇒ ∆ Γ ⇒ ∆, ∀x φ(x)
Rules for ∃
φ(a), Γ ⇒ ∆ Γ ⇒ ∆, φ(t)
∃L ∃R
∃x φ(x), Γ ⇒ ∆ Γ ⇒ ∆, ∃x φ(x)
Again, t is a closed term, and a is a constant symbol which does not occur
in the lower sequent of the ∃L rule. We call a the eigenvariable of the ∃L
inference.
The condition that an eigenvariable not occur in the lower sequent of the
∀R or ∃L inference is called the eigenvariable condition.
Recall the convention that when φ is a formula with the variable x free, we explanation
indicate this by writing φ(x). In the same context, φ(t) then is short for φ[t/x].
So we could also write the ∃R rule as:
Γ ⇒ ∆, φ[t/x]
∃R
Γ ⇒ ∆, ∃x φ
Note that t may already occur in φ, e.g., φ might be P (t, x). Thus, inferring
Γ ⇒ ∆, ∃x P (t, x) from Γ ⇒ ∆, P (t, t) is a correct application of ∃R—you
may “replace” one or more, and not necessarily all, occurrences of t in the
premise by the bound variable x. However, the eigenvariable conditions in ∀R
and ∃L require that the constant symbol a does not occur in φ. So, you cannot
correctly infer Γ ⇒ ∆, ∀x P (a, x) from Γ ⇒ ∆, P (a, a) using ∀R.
In ∃R and ∀L there are no restrictions on the term t. On the other hand, explanation
in the ∃L and ∀R rules, the eigenvariable condition requires that the constant
symbol a does not occur anywhere outside of φ(a) in the upper sequent. It is
necessary to ensure that the system is sound, i.e., only derives sequents that
are valid. Without this condition, the following would be allowed:
φ(a) ⇒ φ(a) φ(a) ⇒ φ(a)
*∃L *∀R
∃x φ(x) ⇒ φ(a) φ(a) ⇒ ∀x φ(x)
∀R ∃L
∃x φ(x) ⇒ ∀x φ(x) ∃x φ(x) ⇒ ∀x φ(x)
However, ∃x φ(x) ⇒ ∀x φ(x) is not valid.
content/first-order-logic/sequent-calculus/structural-rules.tex
Weakening
Γ ⇒ ∆ Γ ⇒ ∆
WL WR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
Contraction
φ, φ, Γ ⇒ ∆ Γ ⇒ ∆, φ, φ
CL CR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
Exchange
Γ, φ, ψ, Π ⇒ ∆ Γ ⇒ ∆, φ, ψ, Λ
XL XR
Γ, ψ, φ, Π ⇒ ∆ Γ ⇒ ∆, ψ, φ, Λ
Γ ⇒ ∆, φ φ, Π ⇒ Λ
Cut
Γ, Π ⇒ ∆, Λ
content/first-order-logic/sequent-calculus/derivations.tex
19.5 Derivations
explanation We’ve said what an initial sequent looks like, and we’ve given the rules of fol:seq:der:
sec
inference. Derivations in the sequent calculus are inductively generated from
these: each derivation either is an initial sequent on its own, or consists of one
or two derivations followed by an inference.
Of course, we can also reverse the premises, then φ would be θ and ψ would
be χ.
χ ⇒ χ
WL
θ ⇒ θ θ, χ ⇒ χ
WL XL
χ, θ ⇒ θ χ, θ ⇒ χ
∧R
χ, θ ⇒ θ ∧ χ
content/first-order-logic/sequent-calculus/proving-things.tex
φ∧ψ ⇒ φ
Next, we need to figure out what kind of inference could have a lower sequent
of this form. This could be a structural rule, but it is a good idea to start by
looking for a logical rule. The only logical connective occurring in the lower
sequent is ∧, so we’re looking for an ∧ rule, and since the ∧ symbol occurs in
the antecedent, we’re looking at the ∧L rule.
∧L
φ∧ψ ⇒ φ
There are two options for what could have been the upper sequent of the ∧L
inference: we could have an upper sequent of φ ⇒ φ, or of ψ ⇒ φ. Clearly,
φ ⇒ φ is an initial sequent (which is a good thing), while ψ ⇒ φ is not
derivable in general. We fill in the upper sequent:
φ ⇒ φ
∧L
φ∧ψ ⇒ φ
We now have a correct LK-derivation of the sequent φ ∧ ψ ⇒ φ.
¬φ ∨ ψ ⇒ φ → ψ
To find a logical rule that could give us this end-sequent, we look at the logical
connectives in the end-sequent: ¬, ∨, and →. We only care at the moment
about ∨ and → because they are main operators of sentences in the end-sequent,
while ¬ is inside the scope of another connective, so we will take care of it later.
Our options for logical rules for the final inference are therefore the ∨L rule
and the →R rule. We could pick either rule, really, but let’s pick the →R rule
(if for no reason other than it allows us to put off splitting into two branches).
According to the form of →R inferences which can yield the lower sequent, this
must look like:
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ→ψ
Remember that we are trying to wind our way up to initial sequents; we seem
to be pretty close! The right branch is just one weakening and one exchange
away from an initial sequent and then it is done:
ψ ⇒ ψ
WL
φ, ψ ⇒ ψ
XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
Now looking at the left branch, the only logical connective in any sentence
is the ¬ symbol in the antecedent sentences, so we’re looking at an instance of
the ¬L rule.
ψ ⇒ ψ
WL
φ ⇒ ψ, φ φ, ψ ⇒ ψ
¬L XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ → ψ
Similarly to how we finished off the right branch, we are just one weakening
and one exchange away from finishing off this left branch as well.
φ ⇒ φ
WR
φ ⇒ φ, ψ ψ ⇒ ψ
XR WL
φ ⇒ ψ, φ φ, ψ ⇒ ψ
¬L XL
¬φ, φ ⇒ ψ ψ, φ ⇒ ψ
∨L
¬φ ∨ ψ, φ ⇒ ψ
XR
φ, ¬φ ∨ ψ ⇒ ψ
→R
¬φ ∨ ψ ⇒ φ→ψ
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
The available main connectives of sentences in the end-sequent are the ∨ symbol
and the ¬ symbol. It would work to apply either the ∨L or the ¬R rule here,
but we start with the ¬R rule because it avoids splitting up into two branches
for a moment:
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
Now we have a choice of whether to look at the ∧L or the ∨L rule. Let’s see
what happens when we apply the ∧L rule: we have a choice to start with either
the sequent φ, ¬φ ∨ ψ ⇒ or the sequent ψ, ¬φ ∨ ψ ⇒ . Since the derivation
is symmetric with regards to φ and ψ, let’s go with the former:
φ, ¬φ ∨ ¬ψ ⇒
∧L
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
?
φ ⇒ φ φ ⇒ ψ
¬L ¬L
¬φ, φ ⇒ ¬ψ, φ ⇒
∨L
¬φ ∨ ¬ψ, φ ⇒
XL
φ, ¬φ ∨ ¬ψ ⇒
∧L
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
The top of the right branch cannot be reduced any further, and it cannot be
brought by way of structural inferences to an initial sequent, so this is not the
right path to take. So clearly, it was a mistake to apply the ∧L rule above.
Going back to what we had before and carrying out the ∨L rule instead, we
get
¬φ, φ ∧ ψ ⇒ ¬ψ, φ ∧ ψ ⇒
∨L
¬φ ∨ ¬ψ, φ ∧ ψ ⇒
XL
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
φ ⇒ φ ψ ⇒ ψ
∧L ∧L
φ∧ψ ⇒ φ φ∧ψ ⇒ ψ
¬L ¬L
¬φ, φ ∧ ψ ⇒ ¬ψ, φ ∧ ψ ⇒
∨L
¬φ ∨ ¬ψ, φ ∧ ψ ⇒
XL
φ ∧ ψ, ¬φ ∨ ¬ψ ⇒
¬R
¬φ ∨ ¬ψ ⇒ ¬(φ ∧ ψ)
(We could have carried out the ∧ rules lower than the ¬ rules in these steps
and still obtained a correct derivation).
Example 19.8. So far we haven’t used the contraction rule, but it is some-
times required. Here’s an example where that happens. Suppose we want to
prove ⇒ φ ∨ ¬φ. Applying ∨R backwards would give us one of these two
derivations:
φ ⇒
⇒ φ ⇒ ¬φ ¬R
⇒ φ ∨ ¬φ ∨R ⇒ φ ∨ ¬φ ∨R
Neither of these of course ends in an initial sequent. The trick is to realize
that the contraction rule allows us to combine two copies of a sentence into
one—and when we’re searching for a proof, i.e., going from bottom to top, we
can keep a copy of φ ∨ ¬φ in the premise, e.g.,
⇒ φ ∨ ¬φ, φ
⇒ φ ∨ ¬φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ CR
Now we can apply ∨R a second time, and also get ¬φ, which leads to a complete
derivation.
φ ⇒ φ
⇒ φ, ¬φ ¬R
⇒ φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ, φ XR
⇒ φ ∨ ¬φ, φ ∨ ¬φ ∨R
⇒ φ ∨ ¬φ CR
2. (φ → χ) ∧ (ψ → χ) ⇒ (φ ∨ ψ) → χ.
3. ⇒ ¬(φ ∧ ¬φ).
4. ψ → φ ⇒ ¬φ → ¬ψ.
5. ⇒ (φ → ¬φ) → ¬φ.
6. ⇒ ¬(φ → ψ) → ¬ψ.
7. φ → χ ⇒ ¬(φ ∧ ¬χ).
8. φ ∧ ¬χ ⇒ ¬(φ → χ).
9. φ ∨ ψ, ¬ψ ⇒ φ.
1. ¬(φ → ψ) ⇒ φ.
2. ¬(φ ∧ ψ) ⇒ ¬φ ∨ ¬ψ.
3. φ → ψ ⇒ ¬φ ∨ ψ.
4. ⇒ ¬¬φ → φ.
5. φ → ψ, ¬φ → ψ ⇒ ψ.
6. (φ ∧ ψ) → χ ⇒ (φ → χ) ∨ (ψ → χ).
7. (φ → ψ) → φ ⇒ φ.
8. ⇒ (φ → ψ) ∨ (ψ → χ).
content/first-order-logic/sequent-calculus/proving-things-quant.tex
We could either carry out the ∃L rule or the ¬R rule. Since the ∃L rule is
subject to the eigenvariable condition, it’s a good idea to take care of it sooner
rather than later, so we’ll do that one first.
∀x φ(x) ⇒ φ(a)
¬L
¬φ(a), ∀x φ(x) ⇒
XL
∀x φ(x), ¬φ(a) ⇒
¬R
¬φ(a) ⇒ ¬∀xφ(x)
∃L
∃x¬φ(x) ⇒ ¬∀xφ(x)
At this point, our only option is to carry out the ∀L rule. Since this rule is not
subject to the eigenvariable restriction, we’re in the clear. Remember, we want
to try and obtain an initial sequent (of the form φ(a) ⇒ φ(a)), so we should
choose a as our argument for φ when we apply the rule.
φ(a) ⇒ φ(a)
∀L
∀x φ(x) ⇒ φ(a)
¬L
¬φ(a), ∀x φ(x) ⇒
XL
∀x φ(x), ¬φ(a) ⇒
¬R
¬φ(a) ⇒ ¬∀x φ(x)
∃L
∃x ¬φ(x) ⇒ ¬∀x φ(x)
3. ∀x (φ(x) → ψ) ⇒ ∃y φ(y) → ψ.
3. ⇒ ∃x (φ(x) → ∀y φ(y)).
This section collects the definitions of the provability relation and con-
sistency for natural deduction.
content/first-order-logic/sequent-calculus/proof-theoretic-notions.tex
Because of the contraction, weakening, and exchange rules, the order and
number of sentences in Γ0′ does not matter: if a sequent Γ0′ ⇒ φ is derivable,
then so is Γ0′′ ⇒ φ for any Γ0′′ that contains the same sentences as Γ0′ . For
instance, if Γ0 = {ψ, χ} then both Γ0′ = ⟨ψ, ψ, χ⟩ and Γ0′′ = ⟨χ, χ, ψ⟩ are
sequences containing just the sentences in Γ0 . If a sequent containing one is
derivable, so is the other, e.g.:
ψ, ψ, χ ⇒ φ
CL
ψ, χ ⇒ φ
XL
χ, ψ ⇒ φ
WL
χ, χ, ψ ⇒ φ
π0 π1
Γ0 ⇒ φ φ, ∆0 ⇒ ψ
Cut
Γ0 , ∆0 ⇒ ψ
Since Γ0 ∪ ∆0 ⊆ Γ ∪ ∆, this shows Γ ∪ ∆ ⊢ ψ.
Proof. Exercise.
content/first-order-logic/sequent-calculus/provability-consistency.tex
π0 π1
Γ0 ⇒ φ φ, Γ1 ⇒
Cut
Γ0 , Γ1 ⇒
π1
φ ⇒ φ
⇒ φ, ¬φ ¬R ¬φ, Γ ⇒
Cut
Γ ⇒ φ
π φ ⇒ φ
¬φ, φ ⇒ ¬L
Γ0 ⇒ φ φ, ¬φ ⇒ XL
Cut
Γ0 , ¬φ ⇒
fol:seq:prv: Proposition 19.21. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ
prop:provability-exhaustive
is inconsistent.
π0
π1
φ, Γ0 ⇒
¬R
Γ0 ⇒ ¬φ ¬φ, Γ1 ⇒
Cut
Γ0 , Γ1 ⇒
content/first-order-logic/sequent-calculus/provability-propositional.tex
φ ⇒ φ ψ ⇒ ψ
∧L ∧L
φ∧ψ ⇒ φ φ∧ψ ⇒ ψ
φ ⇒ φ ψ ⇒ ψ
∧R
φ, ψ ⇒ φ ∧ ψ
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
φ ⇒ φ ψ ⇒ ψ
¬L ¬L
¬φ, φ ⇒ ¬ψ, ψ ⇒
φ, ¬φ, ¬ψ ⇒ ψ, ¬φ, ¬ψ ⇒
∨L
φ ∨ ψ, ¬φ, ¬ψ ⇒
φ ⇒ φ ψ ⇒ ψ
∨R ∨R
φ ⇒ φ∨ψ ψ ⇒ φ∨ψ
φ ⇒ φ ψ ⇒ ψ
→L
φ → ψ, φ ⇒ ψ
content/first-order-logic/sequent-calculus/provability-quantifiers.tex
φ(t) ⇒ φ(t)
∃R
φ(t) ⇒ ∃x φ(x)
φ(t) ⇒ φ(t)
∀L
∀x φ(x) ⇒ φ(t)
content/first-order-logic/sequent-calculus/soundness.tex
19.12 Soundness
explanation A derivation system, such as the sequent calculus, is sound if it cannot derive fol:seq:sou:
sec
things that do not actually hold. Soundness is thus a kind of guaranteed safety
property for derivation systems. Depending on which proof theoretic property
is in question, we would like to know for instance, that
1. every derivable φ is valid;
2. if a sentence is derivable from some others, it is also a consequence of
them;
3. if a set of sentences is inconsistent, it is unsatisfiable.
These are important properties of a derivation system. If any of them do
not hold, the derivation system is deficient—it would derive too much. Con-
sequently, establishing the soundness of a derivation system is of the utmost
importance.
Because all these proof-theoretic properties are defined via derivability in
the sequent calculus of certain sequents, proving (1)–(3) above requires proving
something about the semantic properties of derivable sequents. We will first
define what it means for a sequent to be valid, and then show that every
derivable sequent is valid. (1)–(3) then follow as corollaries from this result.
Definition 19.27. A structure M satisfies a sequent Γ ⇒ ∆ iff either M ⊭ φ
for some φ ∈ Γ or M ⊨ φ for some φ ∈ ∆.
A sequent is valid iff every structure M satisfies it.
Γ ⇒ ∆ Γ ⇒ ∆
WL WR
φ, Γ ⇒ ∆ Γ ⇒ ∆, φ
2. The last inference is ¬L: Then the premise of the last inference is Γ ⇒
∆, φ and the conclusion is ¬φ, Γ ⇒ ∆, i.e., the derivation ends in
Γ ⇒ ∆, φ
¬L
¬φ, Γ ⇒ ∆
4. The last inference is ∧L: There are two variants: φ ∧ ψ may be inferred
on the left from φ or from ψ on the left side of the premise. In the first
case, the π ends in
φ, Γ ⇒ ∆
∧L
φ ∧ ψ, Γ ⇒ ∆
5. The last inference is ∨R: There are two variants: φ ∨ ψ may be inferred
on the right from φ or from ψ on the right side of the premise. In the
first case, π ends in
Γ ⇒ ∆, φ
∨R
Γ ⇒ ∆, φ ∨ ψ
φ, Γ ⇒ ∆, ψ
→R
Γ ⇒ ∆, φ → ψ
Again, the induction hypothesis says that the premise is valid; we want
to show that the conclusion is valid as well. Let M be arbitrary. Since
φ, Γ ⇒ ∆, ψ is valid, at least one of the following cases obtains: (a)
M ⊭ φ, (b) M ⊨ ψ, (c) M ⊭ χ for some χ ∈ Γ , or (d) M ⊨ χ for some
χ ∈ ∆. In cases (a) and (b), M ⊨ φ → ψ and so there is a χ ∈ ∆, φ → ψ
such that M ⊨ χ. In case (c), for some χ ∈ Γ , M ⊭ χ. In case (d), for
some χ ∈ ∆, M ⊨ χ. In each case, M satisfies Γ ⇒ ∆, φ → ψ. Since M
was arbitrary, Γ ⇒ ∆, φ → ψ is valid.
7. The last inference is ∀L: Then there is a formula φ(x) and a closed term t
such that π ends in
φ(t), Γ ⇒ ∆
∀L
∀x φ(x), Γ ⇒ ∆
Γ ⇒ ∆, φ(a)
∀R
Γ ⇒ ∆, ∀x φ(x)
Γ ⇒ ∆, φ φ, Π ⇒ Λ
Cut
Γ, Π ⇒ ∆, Λ
Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
Γ ⇒ ∆, φ ∧ ψ
Γ ⇒ ∆, φ ψ, Π ⇒ Λ
→L
φ → ψ, Γ, Π ⇒ ∆, Λ
content/first-order-logic/sequent-calculus/identity.tex
t1 = t2 , Γ ⇒ ∆, φ(t1 ) t1 = t2 , Γ ⇒ ∆, φ(t2 )
= =
t1 = t2 , Γ ⇒ ∆, φ(t2 ) t1 = t2 , Γ ⇒ ∆, φ(t1 )
φ(s) ⇒ φ(s)
WL
s = t, φ(s) ⇒ φ(s)
=
s = t, φ(s) ⇒ φ(t)
t1 = t2 ⇒ t1 = t2
⇒ t1 = t1 t2 = t3 , t1 = t2 ⇒ t1 = t2 WL
=
t1 = t2 ⇒ t1 = t1 WL t2 = t3 , t1 = t2 ⇒ t1 = t3
=
t1 = t2 ⇒ t2 = t1 t1 = t2 , t2 = t3 ⇒ t1 = t3 XL
In the derivation on the left, the formula x = t1 is our φ(x). On the right, we
take φ(x) to be t1 = x.
content/first-order-logic/sequent-calculus/soundness-identity.tex
Chapter 20
Natural Deduction
content/first-order-logic/natural-deduction/rules-and-proofs.tex
266
20.2. PROPOSITIONAL RULES
content/first-order-logic/natural-deduction/propositional-rules.tex
φ∧ψ
φ ∧Elim
φ ψ
∧Intro
φ∧ψ φ∧ψ
∧Elim
ψ
Rules for ∨
φ [φ]n [ψ]n
∨Intro
φ∨ψ
ψ
∨Intro φ∨ψ χ χ
φ∨ψ n ∨Elim
χ
Rules for →
[φ]n
φ→ψ φ
→Elim
ψ
ψ
n →Intro
φ→ψ
Rules for ¬
[φ]n
¬φ φ
¬Elim
⊥
⊥
n
¬φ ¬Intro
Rules for ⊥
[¬φ]n
⊥ ⊥
φ I
n
⊥ ⊥
φ C
Note that ¬Intro and ⊥C are very similar: The difference is that ¬Intro derives
a negated sentence ¬φ but ⊥C a positive sentence φ.
Whenever a rule indicates that some assumption may be discharged, we
take this to be a permission, but not a requirement. E.g., in the →Intro rule,
we may discharge any number of assumptions of the form φ in the derivation
of the premise ψ, including zero.
content/first-order-logic/natural-deduction/quantifier-rules.tex
φ(a) ∀x φ(x)
∀Intro ∀Elim
∀x φ(x) φ(t)
In the rules for ∀, t is a closed term (a term that does not contain any variables),
and a is a constant symbol which does not occur in the conclusion ∀x φ(x), or
in any assumption which is undischarged in the derivation ending with the
premise φ(a). We call a the eigenvariable of the ∀Intro inference.1
Rules for ∃
[φ(a)]n
φ(t)
∃Intro
∃x φ(x)
∃x φ(x) χ
n
χ ∃Elim
Again, t is a closed term, and a is a constant which does not occur in the
premise ∃x φ(x), in the conclusion χ, or any assumption which is undischarged
in the derivations ending with the two premises (other than the assumptions
φ(a)). We call a the eigenvariable of the ∃Elim inference.
The condition that an eigenvariable neither occur in the premises nor in
any assumption that is undischarged in the derivations leading to the premises
for the ∀Intro or ∃Elim inference is called the eigenvariable condition.
Recall the convention that when φ is a formula with the variable x free, we explanation
indicate this by writing φ(x). In the same context, φ(t) then is short for φ[t/x].
So we could also write the ∃Intro rule as:
φ[t/x]
∃Intro
∃x φ
Note that t may already occur in φ, e.g., φ might be P (t, x). Thus, inferring
∃x P (t, x) from P (t, t) is a correct application of ∃Intro—you may “replace” one
or more, and not necessarily all, occurrences of t in the premise by the bound
variable x. However, the eigenvariable conditions in ∀Intro and ∃Elim require
that the constant symbol a does not occur in φ. So, you cannot correctly infer
∀x P (a, x) from P (a, a) using ∀Intro.
In ∃Intro and ∀Elim there are no restrictions, and the term t can be any- explanation
thing, so we do not have to worry about any conditions. On the other hand,
in the ∃Elim and ∀Intro rules, the eigenvariable condition requires that the
constant symbol a does not occur anywhere in the conclusion or in an undis-
charged assumption. The condition is necessary to ensure that the system is
sound, i.e., only derives sentences from undischarged assumptions from which
they follow. Without this condition, the following would be allowed:
1 We use the term “eigenvariable” even though a in the above rule is a constant. This
[φ(a)]1
*∀Intro
∃x φ(x) ∀x φ(x)
∃Elim
∀x φ(x)
content/first-order-logic/natural-deduction/derivations.tex
20.4 Derivations
explanation We’ve said what an assumption is, and we’ve given the rules of inference. fol:ntd:der:
sec
Derivations in natural deduction are inductively generated from these: each
derivation either is an assumption on its own, or consists of one, two, or three
derivations followed by a correct inference.
We then say that φ is the conclusion of the derivation and Γ its undischarged
assumptions.
If a derivation of φ from Γ exists, we say that φ is derivable from Γ , or
in symbols: Γ ⊢ φ. If there is a derivation of φ in which every assumption is
discharged, we write ⊢ φ.
These rules are meant to be general: we can replace the φ and ψ in it with any
sentences, e.g., by χ and θ. Then the conclusion would be χ ∧ θ, and so
χ θ
∧Intro
χ∧θ
content/first-order-logic/natural-deduction/proving-things.tex
(φ ∧ ψ) → φ
Next, we need to figure out what kind of inference could result in a sentence
of this form. The main operator of the conclusion is →, so we’ll try to arrive at
the conclusion using the →Intro rule. It is best to write down the assumptions
involved and label the inference rules as you progress, so it is easy to see whether
all assumptions have been discharged at the end of the proof.
[φ ∧ ψ]1
φ
1 →Intro
(φ ∧ ψ) → φ
[φ ∧ ψ]1
φ ∧Elim
1 →Intro
(φ ∧ ψ) → φ
(¬φ ∨ ψ) → (φ → ψ)
To find a logical rule that could give us this conclusion, we look at the logical
connectives in the conclusion: ¬, ∨, and →. We only care at the moment about
the first occurrence of → because it is the main operator of the sentence in the
end-sequent, while ¬, ∨ and the second occurrence of → are inside the scope
of another connective, so we will take care of those later. We therefore start
with the →Intro rule. A correct application must look like this:
[¬φ ∨ ψ]1
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
This leaves us with two possibilities to continue. Either we can keep working
from the bottom up and look for another application of the →Intro rule, or we
can work from the top down and apply a ∨Elim rule. Let us apply the latter.
We will use the assumption ¬φ ∨ ψ as the leftmost premise of ∨Elim. For a
valid application of ∨Elim, the other two premises must be identical to the
conclusion φ → ψ, but each may be derived in turn from another assumption,
namely one of the two disjuncts of ¬φ ∨ ψ. So our derivation will look like this:
[¬φ]2 [ψ]2
ψ ψ
1 3 →Intro 4 →Intro
[¬φ ∨ ψ] φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
For the two missing parts of the derivation, we need derivations of ψ from
¬φ and φ in the middle, and from φ and ψ on the left. Let’s take the former
first. ¬φ and φ are the two premises of ¬Elim:
[¬φ]2 [φ]3
¬Elim
⊥
[ψ]2 , [φ]4
[¬φ]2 [φ]3
⊥Intro
⊥ ⊥
I
ψ ψ
3 →Intro 4 →Intro
[¬φ ∨ ψ]1 φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
Let’s now look at the rightmost branch. Here it’s important to realize
that the definition of derivation allows assumptions to be discharged but does
not require them to be. In other words, if we can derive ψ from one of the
assumptions φ and ψ without using the other, that’s ok. And to derive ψ
from ψ is trivial: ψ by itself is such a derivation, and no inferences are needed.
So we can simply delete the assumption φ.
[¬φ]2 [φ]3
¬Elim
⊥ ⊥
I
ψ [ψ]2
3 →Intro →Intro
[¬φ ∨ ψ]1 φ→ψ φ→ψ
2 ∨Elim
φ→ψ
1 →Intro
(¬φ ∨ ψ) → (φ → ψ)
Note that in the finished derivation, the rightmost →Intro inference does not
actually discharge any assumptions.
Example 20.6. So far we have not needed the ⊥C rule. It is special in that it
allows us to discharge an assumption that isn’t a sub-formula of the conclusion
of the rule. It is closely related to the ⊥I rule. In fact, the ⊥I rule is a special
case of the ⊥C rule—there is a logic called “intuitionistic logic” in which only
⊥I is allowed. The ⊥C rule is a last resort when nothing else works. For
instance, suppose we want to derive φ ∨ ¬φ. Our usual strategy would be to
attempt to derive φ ∨ ¬φ using ∨Intro. But this would require us to derive
either φ or ¬φ from no assumptions, and this can’t be done. ⊥C to the rescue!
[¬(φ ∨ ¬φ)]1
1
⊥ ⊥
φ ∨ ¬φ C
Now we’re looking for a derivation of ⊥ from ¬(φ ∨ ¬φ). Since ⊥ is the
conclusion of ¬Elim we might try that:
¬φ φ
¬Elim
1
⊥ ⊥
φ ∨ ¬φ C
⊥
2
¬φ ¬Intro φ
¬Elim
1
⊥ ⊥C
φ ∨ ¬φ
Here, we can get ⊥ easily by applying ¬Elim to the assumption ¬(φ ∨ ¬φ) and
φ ∨ ¬φ which follows from our new assumption φ by ∨Intro:
[¬(φ ∨ ¬φ)]1
[φ]2
[¬(φ ∨ ¬φ)]1 φ ∨ ¬φ ∨Intro
¬Elim
⊥
2
¬φ ¬Intro φ
¬Elim
1
⊥ ⊥
φ ∨ ¬φ C
[φ]2 [¬φ]3
[¬(φ ∨ ¬φ)] 1
φ ∨ ¬φ ∨Intro [¬(φ ∨ ¬φ)]1
φ ∨ ¬φ ∨Intro
¬Elim ¬Elim
⊥ ⊥ ⊥
2
¬φ ¬Intro 3
φ C
¬Elim
1
⊥ ⊥C
φ ∨ ¬φ
6. (φ ∧ ψ) → χ ⊢ (φ → χ) ∨ (ψ → χ).
7. (φ → ψ) → φ ⊢ φ.
8. ⊢ (φ → ψ) ∨ (ψ → χ).
content/first-order-logic/natural-deduction/proving-things-quant.tex
We start by writing down what it would take to justify that last step using the
→Intro rule.
[∃x ¬φ(x)]1
¬∀x φ(x)
1 →Intro
∃x ¬φ(x) → ¬∀x φ(x)
Since there is no obvious rule to apply to ¬∀x φ(x), we will proceed by setting
up the derivation so we can use the ∃Elim rule. Here we must pay attention
to the eigenvariable condition, and choose a constant that does not appear in
∃x φ(x) or any assumptions that it depends on. (Since no constant symbols
appear, however, any choice will do fine.)
[¬φ(a)]2
In order to derive ¬∀x φ(x), we will attempt to use the ¬Intro rule: this re-
quires that we derive a contradiction, possibly using ∀x φ(x) as an additional
assumption. Of course, this contradiction may involve the assumption ¬φ(a)
which will be discharged by the ∃Elim inference. We can set it up as follows:
⊥
3 ¬Intro
[∃x ¬φ(x)]1 ¬∀x φ(x)
2 ∃Elim
¬∀x φ(x)
1 →Intro
∃x ¬φ(x) → ¬∀x φ(x)
It looks like we are close to getting a contradiction. The easiest rule to apply is
the ∀Elim, which has no eigenvariable conditions. Since we can use any term
we want to replace the universally quantified x, it makes the most sense to
continue using a so we can reach a contradiction.
[∀x φ(x)]3
2 ∀Elim
[¬φ(a)] φ(a)
¬Elim
⊥
3 ¬Intro
[∃x ¬φ(x)]1 ¬∀x φ(x)
2 ∃Elim
¬∀x φ(x)
1 →Intro
∃x ¬φ(x) → ¬∀x φ(x)
∃x χ(x, b)
We have two premises to work with. To use the first, i.e., try to find
a derivation of ∃x χ(x, b) from ∃x (φ(x) ∧ ψ(x)) we would use the ∃Elim rule.
Since it has an eigenvariable condition, we will apply that rule first. We get
the following:
[φ(a) ∧ ψ(a)]1
The two assumptions we are working with share ψ. It may be useful at this
point to apply ∧Elim to separate out ψ(a).
[φ(a) ∧ ψ(a)]1
∧Elim
ψ(a)
The second assumption we have to work with is ∀x (ψ(x) → χ(x, b)). Since
there is no eigenvariable condition we can instantiate x with the constant sym-
bol a using ∀Elim to get ψ(a) → χ(a, b). We now have both ψ(a) → χ(a, b) and
ψ(a). Our next move should be a straightforward application of the →Elim
rule.
∀x (ψ(x) → χ(x, b)) [φ(a) ∧ ψ(a)]1
∀Elim ∧Elim
ψ(a) → χ(a, b) ψ(a)
→Elim
χ(a, b)
We are so close! One application of ∃Intro and we have reached our goal.
Since we ensured at each step that the eigenvariable conditions were not vio-
lated, we can be confident that this is a correct derivation.
Example 20.9. Give a derivation of the formula ¬∀x φ(x) from the assump-
tions ∀x φ(x) → ∃y ψ(y) and ¬∃y ψ(y). Starting as usual, we write the target
formula at the bottom.
¬∀x φ(x)
The last line of the derivation is a negation, so let’s try using ¬Intro. This will
require that we figure out how to derive a contradiction.
[∀x φ(x)]1
⊥
1 ¬Intro
¬∀x φ(x)
So far so good. We can use ∀Elim but it’s not obvious if that will help us get to
our goal. Instead, let’s use one of our assumptions. ∀x φ(x) → ∃y ψ(y) together
with ∀x φ(x) will allow us to use the →Elim rule.
∀x φ(x) → ∃y ψ(y) [∀x φ(x)]1
→Elim
∃y ψ(y)
⊥
1 ¬Intro
¬∀x φ(x)
We now have one final assumption to work with, and it looks like this will help
us reach a contradiction by using ¬Elim.
∀x φ(x) → ∃y ψ(y) [∀x φ(x)]1
→Elim
¬∃y ψ(y) ∃y ψ(y)
¬Elim
⊥
1 ¬Intro
¬∀x φ(x)
3. ∀x (φ(x) → ψ) ⊢ ∃y φ(y) → ψ.
3. ⊢ ∃x (φ(x) → ∀y φ(y)).
content/first-order-logic/natural-deduction/proof-theoretic-notions.tex
This section collects the definitions the provability relation and consis-
tency for natural deduction.
explanation Just as we’ve defined a number of important semantic notions (validity, en-
tailment, satisfiability), we now define corresponding proof-theoretic notions.
These are not defined by appeal to satisfaction of sentences in structures, but
by appeal to the derivability or non-derivability of certain sentences from oth-
ers. It was an important discovery that these notions coincide. That they do
is the content of the soundness and completeness theorems.
∆, [φ]1
δ1 Γ
δ0
ψ
1 →Intro
φ→ψ φ
→Elim
ψ
1. Γ is inconsistent.
Proof. Exercise.
content/first-order-logic/natural-deduction/provability-consistency.tex
Γ, [φ]1
Γ
δ2
δ1
⊥
1
¬φ ¬Intro φ
¬Elim
⊥
Γ, [¬φ]1
δ1
1
⊥ ⊥
φ C
δ
¬φ φ
¬Elim
⊥
Since ¬φ ∈ Γ , all undischarged assumptions are in Γ , this shows that Γ ⊢ ⊥.
fol:ntd:prv: Proposition 20.21. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ
prop:provability-exhaustive
is inconsistent.
Proof. There are derivations δ1 and δ2 of ⊥ from Γ ∪{φ} and ⊥ from Γ ∪{¬φ},
respectively. We can then derive
Γ, [¬φ]2 Γ, [φ]1
δ2 δ1
⊥ ⊥
2
¬¬φ ¬Intro 1
¬φ ¬Intro
¬Elim
⊥
Since the assumptions φ and ¬φ are discharged, this is a derivation of ⊥ from Γ
alone. Hence Γ is inconsistent.
content/first-order-logic/natural-deduction/provability-propositional.tex
φ∧ψ φ∧ψ
∧Elim ∧Elim
φ ψ
2. We can derive:
φ ψ
∧Intro
φ∧ψ
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
¬φ [φ]1 ¬ψ [ψ]1
¬Elim ¬Elim
φ∨ψ ⊥ ⊥
1 ∨Elim
⊥
φ ψ
∨Intro ∨Intro
φ∨ψ φ∨ψ
φ→ψ φ
→Elim
ψ
¬φ [φ]1
¬Elim
⊥ ⊥
I
ψ ψ
1 →Intro →Intro
φ→ψ φ→ψ
Note that →Intro may, but does not have to, discharge the assumption φ.
content/first-order-logic/natural-deduction/provability-quantifiers.tex
φ(t)
∃Intro
∃x φ(x)
∀x φ(x)
∀Elim
φ(t)
content/first-order-logic/natural-deduction/soundness.tex
20.11 Soundness
fol:ntd:sou: A derivation system, such as natural deduction, is sound if it cannot derive explanation
sec
things that do not actually follow. Soundness is thus a kind of guaranteed
safety property for derivation systems. Depending on which proof theoretic
property is in question, we would like to know for instance, that
1. every derivable sentence is valid;
2. if a sentence is derivable from some others, it is also a consequence of
them;
3. if a set of sentences is inconsistent, it is unsatisfiable.
These are important properties of a derivation system. If any of them do
not hold, the derivation system is deficient—it would derive too much. Con-
sequently, establishing the soundness of a derivation system is of the utmost
importance.
1. Suppose that the last inference is ¬Intro: The derivation has the form
Γ, [φ]n
δ1
⊥
n
¬φ ¬Intro
Γ
δ1
φ∧ψ
φ ∧Elim
Γ
δ1
φ
∨Intro
φ∨ψ
Γ, [φ]n
δ1
ψ
n →Intro
φ→ψ
Γ
δ1
⊥ ⊥
φ I
Γ
δ1
φ(a)
∀Intro
∀x φ(x)
Now let’s consider the possible inferences with several premises: ∨Elim,
∧Intro, →Elim, and ∃Elim.
Γ1 Γ2
δ1 δ2
φ ψ
∧Intro
φ∧ψ
3. The last inference is →Elim. ψ is inferred from the premises φ→ψ and φ.
The derivation δ looks like this:
Γ1 Γ2
δ1 δ2
φ→ψ φ
→Elim
ψ
content/first-order-logic/natural-deduction/identity.tex
t1 = t2 φ(t1 )
=Elim
φ(t2 )
t = t =Intro
t1 = t2 φ(t2 )
=Elim
φ(t1 )
In the above rules, t, t1 , and t2 are closed terms. The =Intro rule allows us
to derive any identity statement of the form t = t outright, from no assump-
tions.
s=t φ(s)
=Elim
φ(t)
Problem 20.9. Prove that = is both symmetric and transitive, i.e., give
derivations of ∀x ∀y (x = y → y = x) and ∀x ∀y ∀z((x = y ∧ y = z) → x = z)
∀x ∀y ((φ(x) ∧ φ(y)) → x = y)
∃x ∀y (φ(y) → y = x)
a=b
1 →Intro
((φ(a) ∧ φ(b)) → a = b)
∀Intro
∀y ((φ(a) ∧ φ(y)) → a = y)
∀Intro
∀x ∀y ((φ(x) ∧ φ(y)) → x = y)
We’ll now have to use the main assumption: since it is an existential formula,
we use ∃Elim to derive the intermediary conclusion a = b.
∃x ∀y (φ(y) → y = x) a=b
2 ∃Elim
a=b
1 →Intro
((φ(a) ∧ φ(b)) → a = b)
∀Intro
∀y ((φ(a) ∧ φ(y)) → a = y)
∀Intro
∀x ∀y ((φ(x) ∧ φ(y)) → x = y)
content/first-order-logic/natural-deduction/soundness-identity.tex
Proof. Any formula of the form t = t is valid, since for every structure M,
M ⊨ t = t. (Note that we assume the term t to be closed, i.e., it contains no
variables, so variable assignments are irrelevant).
Suppose the last inference in a derivation is =Elim, i.e., the derivation has
the following form:
Γ1 Γ2
δ1 δ2
t1 = t2 φ(t1 )
=Elim
φ(t2 )
Chapter 21
Tableaux
content/first-order-logic/tableaux/rules-and-proofs.tex
292
21.2. PROPOSITIONAL RULES
and one for the case where the sign is F. Some rules allow the tree to branch,
and some only add signed formulas to the branch. A rule may be (and often
must be) applied not to the immediately preceding signed formula, but to any
signed formula in the branch from the root to the place the rule is applied.
A branch is closed when it contains both T φ and F φ. A closed tableau
is one where every branch is closed. Under the intuitive interpretation, any
branch describes a joint possibility, but T φ and F φ are not jointly possible.
In other words, if a branch is closed, the possibility it describes has been ruled
out. In particular, that means that a closed tableau rules out all possibilities
of simultaneously making every assumption of the form T φ true and every
assumption of the form F φ false.
A closed tableau for φ is a closed tableau with root F φ. If such a closed
tableau exists, all possibilities for φ being false have been ruled out; i.e., φ
must be true in every structure.
content/first-order-logic/tableaux/propositional-rules.tex
T ¬φ F ¬φ
¬T ¬F
Fφ Tφ
Rules for ∧
Tφ ∧ ψ
∧T Fφ∧ψ
Tφ ∧F
Fφ | Fψ
Tψ
Rules for ∨
Fφ∨ψ
Tφ ∨ ψ ∨F
∨T Fφ
Tφ | Tψ
Fψ
Rules for →
Fφ→ψ
Tφ → ψ →F
→T Tφ
F φ | Tψ
Fψ
Cut
Tφ | Fφ
The Cut rule is not applied “to” a previous signed formula; rather, it allows
every branch in a tableau to be split in two, one branch containing T φ, the
other F φ. It is not necessary—any set of signed formulas with a closed tableau
has one not using Cut—but it allows us to combine tableaux in a convenient
way.
content/first-order-logic/tableaux/quantifier-rules.tex
T ∀x φ(x) F ∀x φ(x)
∀T ∀F
T φ(t) F φ(a)
Rules for ∃
T ∃x φ(x) F ∃x φ(x)
∃T ∃F
T φ(a) F φ(t)
1 We use the term “eigenvariable” even though a in the above rule is a constant symbol.
Again, t is a closed term, and a is a constant symbol which does not occur in
the branch above the ∃T rule. We call a the eigenvariable of the ∃T inference.
The condition that an eigenvariable not occur in the branch above the ∀F
or ∃T inference is called the eigenvariable condition.
Recall the convention that when φ is a formula with the variable x free, we explanation
indicate this by writing φ(x). In the same context, φ(t) then is short for φ[t/x].
So we could also write the ∃F rule as:
F ∃x φ
∃F
F φ[t/x]
Note that t may already occur in φ, e.g., φ might be P (t, x). Thus, inferring
F P (t, t) from F ∃x P (t, x) is a correct application of ∃F. However, the eigen-
variable conditions in ∀F and ∃T require that the constant symbol a does not
occur in φ. So, you cannot correctly infer F P (a, a) from F ∀x P (a, x) using ∀F.
In ∀T and ∃F there are no restrictions on the term t. On the other hand, in explanation
the ∃T and ∀F rules, the eigenvariable condition requires that the constant sym-
bol a does not occur anywhere in the branches above the respective inference.
It is necessary to ensure that the system is sound. Without this condition, the
following would be a closed tableau for ∃x φ(x) → ∀x φ(x):
content/first-order-logic/tableaux/derivations.tex
21.4 Tableaux
fol:tab:der: We’ve said what an assumption is, and we’ve given the rules of inference. explanation
sec
Tableaux are inductively generated from these: each tableau either is a single
branch consisting of one or more assumptions, or it results from a tableau by
applying one of the rules of inference on a branch.
Definition 21.2 (Tableau). A tableau for assumptions S1φ1 , . . . , Snφn (where
each Si is either T or F) is a finite tree of signed formulas satisfying the following
conditions:
1. The n topmost signed formulas of the tree are Siφi , one below the other.
2. Every signed formula in the tree that is not one of the assumptions results
from a correct application of an inference rule to a signed formula in the
branch above it.
Example 21.3. Every set of assumptions on its own is a tableau, but it will
generally not be closed. (Obviously, it is closed only if the assumptions already
contain a pair of signed formulas T φ and F φ.)
From a tableau (open or closed) we can obtain a new, larger one by applying
one of the rules of inference to a signed formula φ in it. The rule will append
one or more signed formulas to the end of any branch containing the occurrence
of φ to which we apply the rule.
For instance, consider the assumption T φ ∧ ¬φ. Here is the (open) tableau
consisting of just that assumption:
1. T φ ∧ ¬φ Assumption
1. T φ ∧ ¬φ Assumption
2. Tφ ∧T 1
3. T ¬φ ∧T 1
When we write down tableaux, we record the rules we’ve applied on the right
(e.g., ∧T1 means that the signed formula on that line is the result of applying
the ∧T rule to the signed formula on line 1). This new tableau now contains
additional signed formulas, but to only one (T ¬φ) can we apply a rule (in this
case, the ¬T rule). This results in the closed tableau
1. T φ ∧ ¬φ Assumption
2. Tφ ∧T 1
3. T ¬φ ∧T 1
4. Fφ ¬T 3
⊗
content/first-order-logic/tableaux/proving-things.tex
1. F (φ ∧ ψ) → φ Assumption
There is only one assumption, so only one signed formula to which we can
apply a rule. (For every signed formula, there is always at most one rule that
can be applied: it’s the rule for the corresponding sign and main operator of
the sentence.) In this case, this means, we must apply →F.
1. F (φ ∧ ψ) → φ ✓ Assumption
2. Tφ ∧ ψ →F 1
3. Fφ →F 1
1. F (φ ∧ ψ) → φ ✓ Assumption
2. Tφ ∧ ψ ✓ →F 1
3. Fφ →F 1
4. Tφ ∧T 2
5. Tψ ∧T 2
⊗
Since the branch now contains both T φ (on line 4) and F φ (on line 3), the
branch is closed. Since it is the only branch, the tableau is closed. We have
found a closed tableau for (φ ∧ ψ) → φ.
Example 21.5. Now let’s find a closed tableau for (¬φ ∨ ψ) → (φ → ψ).
We begin with the corresponding assumption:
1. F (¬φ ∨ ψ) → (φ → ψ) Assumption
The one signed formula in this tableau has main operator → and sign F, so we
apply the →F rule to it to obtain:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ →F 1
3. F (φ → ψ) →F 1
will be the new signed formulas added to the two new branches. This results
in:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) →F 1
4. T ¬φ Tψ ∨T 2
We have not applied the →F rule to line 3 yet: let’s do that now. To save
time, we apply it to both branches. Recall that we write a checkmark next to
a signed formula only if we have applied the corresponding rule in every open
branch. So it’s a good idea to apply a rule at the end of every branch that
contains the signed formula the rule applies to. That way we won’t have to
return to that signed formula lower down in the various branches.
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) ✓ →F 1
4. T ¬φ Tψ ∨T 2
5. Tφ Tφ →F 3
6. Fψ Fψ →F 3
⊗
The right branch is now closed. On the left branch, we can still apply the ¬T
rule to line 4. This results in F φ and closes the left branch:
1. F (¬φ ∨ ψ) → (φ → ψ) ✓ Assumption
2. T ¬φ ∨ ψ ✓ →F 1
3. F (φ → ψ) ✓ →F 1
4. T ¬φ Tψ ∨T 2
5. Tφ Tφ →F 3
6. Fψ Fψ →F 3
7. Fφ ⊗ ¬T 4
⊗
Example 21.6. We can give tableaux for any number of signed formulas as
assumptions. Often it is also necessary to apply more than one rule that allows
branching; and in general a tableau can have any number of branches. For
instance, consider a tableau for {T φ ∨ (ψ ∧ χ), F (φ ∨ ψ) ∧ (φ ∨ χ)}. We start
by applying the ∨T to the first assumption:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) Assumption
3. Tφ Tψ ∧ χ ∨T 1
Now we can apply the ∧F rule to line 2. We do this on both branches simul-
taneously, and can therefore check off line 2:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ∨T 1
Note that we moved the result of applying ∨F a second time below for clarity.
In this instance it would not have been needed, since the justifications would
have been the same.
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Tφ Tψ ∧ χ ✓ ∨T 1
For comparison, here’s a closed tableau for the same set of assumptions in
which the rules are applied in a different order:
1. T φ ∨ (ψ ∧ χ) ✓ Assumption
2. F (φ ∨ ψ) ∧ (φ ∨ χ) ✓ Assumption
3. Fφ∨ψ ✓ Fφ∨χ ✓ ∧F 2
4. Fφ Fφ ∨F 3
5. Fψ Fχ ∨F 3
6. Tφ Tψ ∧ χ ✓ Tφ Tψ ∧ χ ✓ ∨T 1
7. ⊗ Tψ ⊗ Tψ ∧T 6
8. Tχ Tχ ∧T 6
⊗ ⊗
4. T ψ → φ, F ¬φ → ¬ψ.
5. F (φ → ¬φ) → ¬φ.
6. F ¬(φ → ψ) → ¬ψ.
7. T φ → χ, F ¬(φ ∧ ¬χ).
9. T φ ∨ ψ, ¬ψ, F φ.
1. T ¬(φ → ψ), F φ.
3. T φ → ψ, F ¬φ ∨ ψ.
4. F ¬¬φ → φ.
5. T φ → ψ, T ¬φ → ψ, F ψ.
6. T (φ ∧ ψ) → χ, F (φ → χ) ∨ (ψ → χ).
7. T (φ → ψ) → φ, F φ.
8. F (φ → ψ) ∨ (ψ → χ).
content/first-order-logic/tableaux/proving-things-quant.tex
The next line to deal with is 2. We use ∃T. This requires a new constant
symbol; since no constant symbols yet occur, we can pick any one, say, a.
Example 21.8. Let’s see how we’d give a tableau for the set
1. F ∃x χ(x, b) Assumption
2. T ∃x (φ(x) ∧ ψ(x)) Assumption
3. T ∀x (ψ(x) → χ(x, b)) Assumption
We should always apply a rule with the eigenvariable condition first; in this
case that would be ∃T to line 2. Since the assumptions contain the constant
symbol b, we have to use a different one; let’s pick a again.
1. F ∃x χ(x, b) Assumption
2. T ∃x (φ(x) ∧ ψ(x)) ✓ Assumption
3. T ∀x (ψ(x) → χ(x, b)) Assumption
4. T φ(a) ∧ ψ(a) ∃T 2
1. F ∃x χ(x, b) Assumption
2. T ∃x (φ(x) ∧ ψ(x)) ✓ Assumption
3. T ∀x (ψ(x) → χ(x, b)) Assumption
4. T φ(a) ∧ ψ(a) ∃T 2
5. F χ(a, b) ∃F 1
6. T ψ(a) → χ(a, b) ∀T 3
We don’t check the signed formulas in lines 1 and 3, since we may have to use
them again. Now apply ∧T to line 4:
1. F ∃x χ(x, b) Assumption
2. T ∃x (φ(x) ∧ ψ(x)) ✓ Assumption
3. T ∀x (ψ(x) → χ(x, b)) Assumption
4. T φ(a) ∧ ψ(a) ✓ ∃T 2
5. F χ(a, b) ∃F 1
6. T ψ(a) → χ(a, b) ∀T 3
7. T φ(a) ∧T 4
8. T ψ(a) ∧T 4
1. F ∃x χ(x, b) Assumption
2. T ∃x (φ(x) ∧ ψ(x)) ✓ Assumption
3. T ∀x (ψ(x) → χ(x, b)) Assumption
4. T φ(a) ∧ ψ(a) ✓ ∃T 2
5. F χ(a, b) ∃F 1
6. T ψ(a) → χ(a, b) ✓ ∀T 3
7. T φ(a) ∧T 4
8. T ψ(a) ∧T 4
9. F ψ(a) T χ(a, b) →T 6
⊗ ⊗
1. T ∀x φ(x) Assumption
2. T ∀x φ(x) → ∃y ψ(y) Assumption
3. T ¬∃y ψ(y) Assumption
1. T ∀x φ(x) Assumption
2. T ∀x φ(x) → ∃y ψ(y) Assumption
3. T ¬∃y ψ(y) ✓ Assumption
4. F ∃y ψ(y) ¬T 3
The new line 4 requires ∃F, a quantifier rule without the eigenvariable condi-
tion. So we defer this in favor of using →T on line 2.
1. T ∀x φ(x) Assumption
2. T ∀x φ(x) → ∃y ψ(y) ✓ Assumption
3. T ¬∃y ψ(y) ✓ Assumption
4. F ∃y ψ(y) ¬T 3
5. F ∀x φ(x) T ∃y ψ(y) →T 2
Both new signed formulas require rules with eigenvariable conditions, so these
should be next:
1. T ∀x φ(x) Assumption
2. T ∀x φ(x) → ∃y ψ(y) ✓ Assumption
3. T ¬∃y ψ(y) ✓ Assumption
4. F ∃y ψ(y) ¬T 3
5. F ∀x φ(x) ✓ T ∃y ψ(y) ✓ →T 2
6. F φ(b) T ψ(c) ∀F 5; ∃T 5
To close the branches, we have to use the signed formulas on lines 1 and 3.
The corresponding rules (∀T and ∃F) don’t have eigenvariable conditions, so
we are free to pick whichever terms are suitable. In this case, that’s b and c,
respectively.
1. T ∀x φ(x) Assumption
2. T ∀x φ(x) → ∃y ψ(y) ✓ Assumption
3. T ¬∃y ψ(y) ✓ Assumption
4. F ∃y ψ(y) ¬T 3
5. F ∀x φ(x) ✓ T ∃y ψ(y) ✓ →T 2
6. F φ(b) T ψ(c) ∀F 5; ∃T 5
7. T φ(b) F ψ(c) ∀T 1; ∃F 4
⊗ ⊗
content/first-order-logic/tableaux/proof-theoretic-notions.tex
This section collects the definitions of the provability relation and con-
sistency for tableaux.
Just as we’ve defined a number of important semantic notions (validity, en- explanation
tailment, satisfiability), we now define corresponding proof-theoretic notions.
These are not defined by appeal to satisfaction of sentences in structures, but
by appeal to the existence of certain closed tableaux. It was an important dis-
covery that these notions coincide. That they do is the content of the soundness
and completeness theorems.
{T ψ1 , . . . , T ψn }.
1. Fφ Assumption
2. Tφ Assumption
⊗
is closed.
{F ψ,T φ, T χ1 , . . . , T χn }
{F φ,T θ1 , . . . , T θm }
F ψ, T χ1 , . . . , T χn , T θ1 , . . . , T θm .
Apply the Cut rule on φ. This generates two branches, one has T φ in it, the
other F φ. Thus, on the one branch, all of
{F ψ, T φ, T χ1 , . . . , T χn }
are available. Since there is a closed tableau for these assumptions, we can
attach it to that branch; every branch through T φ closes. On the other branch,
all of
{F φ, T θ1 , . . . , T θm }
are available, so we can also complete the other side to obtain a closed tableau.
This shows Γ ∪ ∆ ⊢ ψ.
Proof. Exercise.
content/first-order-logic/tableaux/provability-consistency.tex
fol:tab:prv: Proposition 21.21. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ
prop:provability-exhaustive
is inconsistent.
{T φ,T ψ1 , . . . , T ψn } and
{T ¬φ,T χ1 , . . . , T χm }
both have closed tableaux, we can construct a single, combined tableau that
shows that Γ is inconsistent by using as assumptions T ψ1 , . . . , T ψn together
with T χ1 , . . . , T χm , followed by an application of the Cut rule. This yields
two branches, one starting with T φ, the other with F φ.
On the left left side, add the part of the first tableau below its assumptions.
Here, every rule application is still correct, since each of the assumptions of the
first tableau, including T φ, is available. Thus, every branch below T φ closes.
On the right side, add the part of the second tableau below its assumption,
with the results of any applications of ¬T to T ¬φ removed. The conclusion of
¬T to T ¬φ is F φ, which is nevertheless available, as it is the conclusion of the
Cut rule on the right side of the combined tableau.
If a branch in the second tableau was closed because it contained the as-
sumption T ¬φ (which no longer appears as an assumption in the combined
tableau) as well as F ¬φ, we can applying ¬F to F ¬φ to obtain T φ. Now
the corresponding branch in the combined tableau also closes, because it con-
tains the right-hand conclusion of the Cut rule, F φ. If a branch in the second
tableau closed for any other reason, the corresponding branch in the combined
tableau also closes, since any signed formulas other than T ¬φ occurring on the
branch in the old, second tableau also occur on the corresponding branch in
the combined tableau.
content/first-order-logic/tableaux/provability-propositional.tex
fol:tab:ppr: 2. φ, ψ ⊢ φ ∧ ψ.
prop:provability-land-right
1. Fφ Assumption
2. Tφ ∧ ψ Assumption
3. Tφ ∧T 2
4. Tψ ∧T 2
⊗
1. Fψ Assumption
2. Tφ ∧ ψ Assumption
3. Tφ ∧T 2
4. Tψ ∧T 2
⊗
1. Fφ∧ψ Assumption
2. Tφ Assumption
3. Tψ Assumption
4. Fφ Fψ ∧F 1
⊗ ⊗
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
1. Tφ ∨ ψ Assumption
2. T ¬φ Assumption
3. T ¬ψ Assumption
4. Fφ ¬T 2
5. Fψ ¬T 3
6. Tφ Tψ ∨T 1
⊗ ⊗
1. Fφ∨ψ Assumption
2. Tφ Assumption
3. Fφ ∨F 1
4. Fψ ∨F 1
⊗
1. Fφ∨ψ Assumption
2. Tψ Assumption
3. Fφ ∨F 1
4. Fψ ∨F 1
⊗
1. Fψ Assumption
2. Tφ → ψ Assumption
3. Tφ Assumption
4. Fφ Tψ →T 2
⊗ ⊗
1. Fφ→ψ Assumption
2. T ¬φ Assumption
3. Tφ →F 1
4. Fψ →F 1
5. Fφ ¬T 2
⊗
1. Fφ→ψ Assumption
2. Tψ Assumption
3. Tφ →F 1
4. Fψ →F 1
⊗
content/first-order-logic/tableaux/provability-quantifiers.tex
{F φ(c),T ψ1 , . . . , T ψn }.
{F ∀x φ(x),T ψ1 , . . . , T ψn }.
Take the closed tableau and replace the first assumption with F ∀x φ(x), and
insert F φ(c) after the assumptions.
F φ(c) F ∀x φ(x)
Tψ.. 1 Tψ.. 1
. .
T ψn T ψn
F φ(c)
The tableau is still closed, since all sentences available as assumptions before
are still available at the top of the tableau. The inserted line is the result of
a correct application of ∀F, since the constant symbol c does not occur in ψ1 ,
. . . , ψn or ∀x φ(x), i.e., it does not occur above the inserted line in the new
tableau.
1. F ∃x φ(x) Assumption
2. T φ(t) Assumption
3. F φ(t) ∃F 1
⊗
1. F φ(t) Assumption
2. T ∀x φ(x) Assumption
3. T φ(t) ∀T 2
⊗
content/first-order-logic/tableaux/soundness.tex
21.11 Soundness
fol:tab:sou: A derivation system, such as tableaux, is sound if it cannot derive things that explanation
sec
do not actually hold. Soundness is thus a kind of guaranteed safety property
for derivation systems. Depending on which proof theoretic property is in
question, we would like to know for instance, that
Proof. Let’s call a branch of a tableau satisfiable iff the set of signed formulas
on it is satisfiable, and let’s call a tableau satisfiable if it contains at least one
satisfiable branch.
We show the following: Extending a satisfiable tableau by one of the rules
of inference always results in a satisfiable tableau. This will prove the theo-
rem: any closed tableau results by applying rules of inference to the tableau
consisting only of assumptions from Γ . So if Γ were satisfiable, any tableau
Now let’s consider the possible inferences that result in a split branch.
4. The branch is expanded by Cut: This results in two branches, one con-
taining T ψ, the other containing F ψ. Since M ⊨ Γ and either M ⊨ ψ or
M ⊭ ψ, M satisfies either the left or the right branch.
content/first-order-logic/tableaux/identity.tex
T t1 = t2 T t1 = t2
= T φ(t1 ) F φ(t1 )
Tt = t
=T =F
T φ(t2 ) F φ(t2 )
Note that in contrast to all the other rules, =T and =F require that two
signed formulas already appear on the branch, namely both T t1 = t2 and
S φ(t1 ).
1. F φ(t) Assumption
2. Ts = t Assumption
3. T φ(s) Assumption
4. T φ(t) =T 2, 3
⊗
1. F s2 = s1 Assumption
2. T s1 = s2 Assumption
3. T s1 = s1 =
4. T s2 = s1 =T 2, 3
⊗
1. F s1 = s3 Assumption
2. T s1 = s2 Assumption
3. T s2 = s3 Assumption
4. T s1 = s3 =T 3, 2
⊗
content/first-order-logic/tableaux/soundness-identity.tex
Proof. We just have to show as before that if a tableau has a satisfiable branch,
the branch resulting from applying one of the rules for = to it is also satisfiable.
Let Γ be the set of signed formulas on the branch, and let M be a structure
satisfying Γ .
Suppose the branch is expanded using =, i.e., by adding the signed for-
mula T t = t. Trivially, M ⊨ t = t, so M also satisfies Γ ∪ {T t = t}.
If the branch is expanded using =T, we add a signed formula S φ(t2 ), but Γ
contains both T t1 = t2 and T φ(t1 ). Thus we have M ⊨ t1 = t2 and M ⊨ φ(t1 ).
Let s be a variable assignment with s(x) = ValM (t1 ). By Proposition 16.18,
M, s ⊨ φ(t1 ). Since s ∼x s, by Proposition 16.23, M, s ⊨ φ(x). since M ⊨ t1 =
t2 , we have ValM (t1 ) = ValM (t2 ), and hence s(x) = ValM (t2 ). By applying
Proposition 16.23 again, we also have M, s ⊨ φ(t2 ). By Proposition 16.18,
M ⊨ φ(t2 ). The case of =F is treated similarly.
317
CHAPTER 22. AXIOMATIC DERIVATIONS
Chapter 22
Axiomatic Derivations
No effort has been made yet to ensure that the material in this chap-
ter respects various tags indicating which connectives and quantifiers are
primitive or defined: all are assumed to be primitive, except ↔ which is
assumed to be defined. If the FOL tag is true, we produce a version with
quantifiers, otherwise without.
content/first-order-logic/axiomatic-deduction/rules-and-proofs.tex
It gets more interesting if the rule of inference appeals to formulas that appear
before the step considered. The following rule is called modus ponens:
If this is the only rule of inference, then our definition of derivation above
amounts to this: φ1 , . . . , φn is a derivation iff for each i ≤ n one of the
following holds:
1. φi ∈ Γ ; or
2. φi is an axiom; or
The last clause says that φi follows from φj (ψ) and φk (ψ → φi ) by modus
ponens. If we can go from 1 to n, and each time we find a formula φi that is
either in Γ , an axiom, or which a rule of inference tells us that it is a correct
inference step, then the entire sequence counts as a correct derivation.
content/first-order-logic/axiomatic-deduction/axioms-rules-propositional.tex
(φ ∧ ψ) → φ (22.1) fol:axd:prp:
ax:land1
(φ ∧ ψ) → ψ (22.2) fol:axd:prp:
ax:land2
φ → (ψ → (φ ∧ ψ)) (22.3) fol:axd:prp:
ax:land3
φ → (φ ∨ ψ) (22.4) fol:axd:prp:
ax:lor1
φ → (ψ ∨ φ) (22.5) fol:axd:prp:
ax:lor2
(φ → χ) → ((ψ → χ) → ((φ ∨ ψ) → χ)) (22.6) fol:axd:prp:
ax:lor3
φ → (ψ → φ) (22.7) fol:axd:prp:
ax:lif1
(φ → (ψ → χ)) → ((φ → ψ) → (φ → χ)) (22.8) fol:axd:prp:
ax:lif2
(φ → ψ) → ((φ → ¬ψ) → ¬φ) (22.9) fol:axd:prp:
ax:lnot1
¬φ → (φ → ψ) (22.10) fol:axd:prp:
ax:lnot2
⊤ (22.11) fol:axd:prp:
ax:ltrue
⊥→φ (22.12) fol:axd:prp:
ax:lfalse1
(φ → ⊥) → ¬φ (22.13) fol:axd:prp:
ax:lfalse2
¬¬φ → φ (22.14) fol:axd:prp:
ax:dne
content/first-order-logic/axiomatic-deduction/axioms-rules-quantifiers.tex
content/first-order-logic/axiomatic-deduction/proving-things.tex
Why? Two applications of MP yield the last part, which is what we want. And
we easily see that ¬θ → (θ → α) is an instance of eq. (22.10), and α → (θ → α)
is an instance of eq. (22.7). So our derivation is:
1. ¬θ → (θ → α) eq. (22.10)
2. (¬θ → (θ → α)) →
((α → (θ → α)) → ((¬θ ∨ α) → (θ → α))) eq. (22.6)
3. ((α → (θ → α)) → ((¬θ ∨ α) → (θ → α)) 1, 2, mp
4. α → (θ → α) eq. (22.7)
5. (¬θ ∨ α) → (θ → α) 3, 4, mp
θ → (θ → θ)
In order to apply mp, we would also need to justify the corresponding second
premise, namely φ. But in our case, that would be θ, and we won’t be able to
derive θ by itself. So we need a different strategy.
The other axiom involving just → is eq. (22.8), i.e.,
We could get to the last nested conditional by applying mp twice. Again, that
would mean that we want an instance of eq. (22.8) where φ → χ is θ → θ, the
formula we are aiming for. Then of course, φ and χ are both θ. How should
we pick ψ so that both φ → (ψ → χ) and φ → ψ, i.e., in our case θ → (ψ → θ)
and θ → ψ, are also derivable? Well, the first of these is already an instance of
eq. (22.7), whatever we decide ψ to be. And θ → ψ would be another instance
of eq. (22.7) if ψ were (θ → θ). So, our derivation is:
1. θ → ((θ → θ) → θ) eq. (22.7)
2. (θ → ((θ → θ) → θ)) →
((θ → (θ → θ)) → (θ → θ)) eq. (22.8)
3. (θ → (θ → θ)) → (θ → θ) 1, 2, mp
4. θ → (θ → θ) eq. (22.7)
5. θ→θ 3, 4, mp
Example 22.11. Sometimes we want to show that there is a derivation of fol:axd:pro:
ex:chain
some formula from some other formulas Γ . For instance, let’s show that we
can derive φ → χ from Γ = {φ → ψ, ψ → χ}.
1. φ→ψ Hyp
2. ψ→χ Hyp
3. (ψ → χ) → (φ → (ψ → χ)) eq. (22.7)
4. φ → (ψ → χ) 2, 3, mp
5. (φ → (ψ → χ)) →
((φ → ψ) → (φ → χ)) eq. (22.8)
6. ((φ → ψ) → (φ → χ)) 4, 5, mp
7. φ→χ 1, 6, mp
The lines labelled “Hyp” (for “hypothesis”) indicate that the formula on that
line is an element of Γ .
Proposition 22.12. If Γ ⊢ φ → ψ and Γ ⊢ ψ → χ, then Γ ⊢ φ → χ fol:axd:pro:
prop:chain
Proof. Suppose Γ ⊢ φ → ψ and Γ ⊢ ψ → χ. Then there is a derivation of φ → ψ
from Γ ; and a derivation of ψ → χ from Γ as well. Combine these into a single
derivation by concatenating them. Now add lines 3–7 of the derivation in the
preceding example. This is a derivation of φ → χ—which is the last line of the
new derivation—from Γ . Note that the justifications of lines 4 and 7 remain
valid if the reference to line number 2 is replaced by reference to the last line
of the derivation of φ → ψ, and reference to line number 1 by reference to the
last line of the derivation of B → χ.
Problem 22.1. Show that the following hold by exhibiting derivations from
the axioms:
1. (φ ∧ ψ) → (ψ ∧ φ)
2. ((φ ∧ ψ) → χ) → (φ → (ψ → χ))
3. ¬(φ ∨ ψ) → ¬φ
content/first-order-logic/axiomatic-deduction/proving-things-quant.tex
∀x φ(x) → φ(a)
content/first-order-logic/axiomatic-deduction/proof-theoretic-notions.tex
φ1 , . . . , φk = φ, ψ1 , . . . , ψl = ψ.
Proof. Exercise.
content/first-order-logic/axiomatic-deduction/deduction-theorem.tex
The most important result we’ll use in this context is the deduction theorem:
fol:axd:ded: Theorem 22.23 (Deduction Theorem). Γ ∪ {φ} ⊢ ψ if and only if Γ ⊢
thm:deduction-thm
φ → ψ.
For the inductive step, suppose a derivation of ψ from Γ ∪ {φ} ends with
a step ψ which is justified by modus ponens. (If it is not justified by modus
ponens, ψ ∈ Γ , ψ ≡ φ, or ψ is an axiom, and the same reasoning as in the
induction basis applies.) Then some previous steps in the derivation are χ → ψ
and χ, for some formula χ, i.e., Γ ∪ {φ} ⊢ χ → ψ and Γ ∪ {φ} ⊢ χ, and the
respective derivations are shorter, so the inductive hypothesis applies to them.
We thus have both:
Γ ⊢ φ → (χ → ψ);
Γ ⊢ φ → χ.
But also
Γ ⊢ (φ → (χ → ψ)) → ((φ → χ) → (φ → ψ)),
by eq. (22.8), and two applications of Proposition 22.22 give Γ ⊢ φ → ψ, as
required.
Notice how eq. (22.7) and eq. (22.8) were chosen precisely so that the De-
duction Theorem would hold.
The following are some useful facts about derivability, which we leave as
exercises.
content/first-order-logic/axiomatic-deduction/deduction-theorem-quantifiers.tex
For the inductive step, suppose again that the derivation of ψ from Γ ∪ {φ}
ends with a step ψ which is justified by an inference rule. If the inference rule
is modus ponens, we proceed as in the proof of Theorem 22.23. If the inference
rule is qr, we know that ψ ≡ χ → ∀x θ(x) and a formula of the form χ → θ(a)
appears earlier in the derivation, where a does not occur in χ, φ, or Γ . We
thus have that
Γ ∪ {φ} ⊢ χ → θ(a),
Γ ⊢ φ → (χ → θ(a)).
By
Γ ⊢ (φ ∧ χ) → θ(a).
Since the eigenvariable condition still applies, we can add a step to this deriva-
tion justified by qr, and get
Γ ⊢ (φ ∧ χ) → ∀x θ(x).
We also have
so by modus ponens,
Γ ⊢ φ → (χ → ∀x θ(x)),
i.e., Γ ⊢ ψ.
We leave the case where ψ is justified by the rule qr, but is of the form
∃x θ(x) → χ, as an exercise.
content/first-order-logic/axiomatic-deduction/provability-consistency.tex
Proposition 22.29. If Γ ∪ {φ} and Γ ∪ {¬φ} are both inconsistent, then Γ fol:axd:prv:
prop:provability-exhaustive
is inconsistent.
Proof. Exercise.
content/first-order-logic/axiomatic-deduction/provability-propositional.tex
2. Both φ ⊢ φ ∨ ψ and ψ ⊢ φ ∨ ψ.
1. φ Hyp
2. φ→ψ Hyp
3. ψ 1, 2, mp
2. By eq. (22.10) and eq. (22.7) and the deduction theorem, respectively.
content/first-order-logic/axiomatic-deduction/provability-quantifiers.tex
2. ∀x φ(x) ⊢ φ(t).
content/first-order-logic/axiomatic-deduction/soundness.tex
22.12 Soundness
explanation A derivation system, such as axiomatic deduction, is sound if it cannot derive fol:axd:sou:
sec
things that do not actually hold. Soundness is thus a kind of guaranteed safety
property for derivation systems. Depending on which proof theoretic property
is in question, we would like to know for instance, that
Proof. We have to verify that all the axioms are valid. For instance, here is the
case for eq. (22.15): suppose t is free for x in φ, and assume M, s ⊨ ∀x φ. Then
by definition of satisfaction, for each s′ ∼x s, also M, s′ ⊨ φ, and in particular
this holds when s′ (x) = ValM s (t). By Proposition 16.23, M, s ⊨ φ[t/x]. This
shows that M, s ⊨ (∀x φ → φ[t/x]).
content/first-order-logic/axiomatic-deduction/identity.tex
fol:axd:ide: t = t, (22.17)
ax:id1
fol:axd:ide: t1 = t2 → (ψ(t1 ) → ψ(t2 )), (22.18)
ax:id2
Proof. Exercise.
Chapter 23
content/first-order-logic/completeness/introduction.tex
23.1 Introduction
The completeness theorem is one of the most fundamental results about logic. fol:com:int:
sec
It comes in two formulations, the equivalence of which we’ll prove. In its
first formulation it says something fundamental about the relationship between
semantic consequence and our derivation system: if a sentence φ follows from
some sentences Γ , then there is also a derivation that establishes Γ ⊢ φ. Thus,
the derivation system is as strong as it can possibly be without proving things
that don’t actually follow.
In its second formulation, it can be stated as a model existence result: every
consistent set of sentences is satisfiable. Consistency is a proof-theoretic notion:
it says that our derivation system is unable to produce certain derivations. But
who’s to say that just because there are no derivations of a certain sort from Γ ,
it’s guaranteed that there is a structure M? Before the completeness theorem
was first proved—in fact before we had the derivation systems we now do—the
great German mathematician David Hilbert held the view that consistency of
332
23.2. OUTLINE OF THE PROOF
mathematical theories guarantees the existence of the objects they are about.
He put it as follows in a letter to Gottlob Frege:
content/first-order-logic/completeness/outline.tex
we know what kind of structure we are looking for: one that is as Γ describes
it!
If Γ contains only atomic sentences, it is easy to construct a model for it.
Suppose the atomic sentences are all of the form P (a1 , . . . , an ) where the ai
are constant symbols. All we have to do is come up with a domain |M| and
an assignment for P so that M ⊨ P (a1 , . . . , an ). But that’s not very hard: put
|M| = N, ciM = i, and for every P (a1 , . . . , an ) ∈ Γ , put the tuple ⟨k1 , . . . , kn ⟩
into P M , where ki is the index of the constant symbol ai (i.e., ai ≡ cki ).
Now suppose Γ contains some formula ¬ψ, with ψ atomic. We might worry
that the construction of M interferes with the possibility of making ¬ψ true.
But here’s where the consistency of Γ comes in: if ¬ψ ∈ Γ , then ψ ∈ / Γ , or else
Γ would be inconsistent. And if ψ ∈ / Γ , then according to our construction
of M, M ⊭ ψ, so M ⊨ ¬ψ. So far so good.
What if Γ contains complex, non-atomic formulas? Say it contains φ ∧ ψ.
To make that true, we should proceed as if both φ and ψ were in Γ . And if
φ ∨ ψ ∈ Γ , then we will have to make at least one of them true, i.e., proceed
as if one of them was in Γ .
This suggests the following idea: we add additional formulas to Γ so as to
(a) keep the resulting set consistent and (b) make sure that for every possible
atomic sentence φ, either φ is in the resulting set, or ¬φ is, and (c) such that,
whenever φ ∧ ψ is in the set, so are both φ and ψ, if φ ∨ ψ is in the set, at least
one of φ or ψ is also, etc. We keep doing this (potentially forever). Call the
set of all formulas so added Γ ∗ . Then our construction above would provide
us with a structure M for which we could prove, by induction, that it satisfies
all sentences in Γ ∗ , and hence also all sentence in Γ since Γ ⊆ Γ ∗ . It turns
out that guaranteeing (a) and (b) is enough. A set of sentences for which (b)
holds is called complete. So our task will be to extend the consistent set Γ to
a consistent and complete set Γ ∗ .
There is one wrinkle in this plan: if ∃x φ(x) ∈ Γ we would hope to be able
to pick some constant symbol c and add φ(c) in this process. But how do we
know we can always do that? Perhaps we only have a few constant symbols
in our language, and for each one of them we have ¬φ(c) ∈ Γ . We can’t also
add φ(c), since this would make the set inconsistent, and we wouldn’t know
whether M has to make φ(c) or ¬φ(c) true. Moreover, it might happen that
Γ contains only sentences in a language that has no constant symbols at all
(e.g., the language of set theory).
The solution to this problem is to simply add infinitely many constants at
the beginning, plus sentences that connect them with the quantifiers in the right
way. (Of course, we have to verify that this cannot introduce an inconsistency.)
Our original construction works well if we only have constant symbols in the
atomic sentences. But the language might also contain function symbols. In
that case, it might be tricky to find the right functions on N to assign to these
function symbols to make everything work. So here’s another trick: instead of
using i to interpret ci , just take the set of constant symbols itself as the domain.
Then M can assign every constant symbol to itself: ciM = ci . But why not go
all the way: let |M| be all terms of the language! If we do this, there is an
obvious assignment of functions (that take terms as arguments and have terms
as values) to function symbols: we assign to the function symbol fin the function
which, given n terms t1 , . . . , tn as input, produces the term fin (t1 , . . . , tn ) as
value.
The last piece of the puzzle is what to do with =. The predicate symbol =
has a fixed interpretation: M ⊨ t = t′ iff ValM (t) = ValM (t′ ). Now if we set
things up so that the value of a term t is t itself, then this structure will make
no sentence of the form t = t′ true unless t and t′ are one and the same term.
And of course this is a problem, since basically every interesting theory in a
language with function symbols will have as theorems sentences t = t′ where t
and t′ are not the same term (e.g., in theories of arithmetic: (0 + 0) = 0). To
solve this problem, we change the domain of M: instead of using terms as the
objects in |M|, we use sets of terms, and each set is so that it contains all those
terms which the sentences in Γ require to be equal. So, e.g., if Γ is a theory of
arithmetic, one of these sets will contain: 0, (0 + 0), (0 × 0), etc. This will be
the set we assign to 0, and it will turn out that this set is also the value of all
the terms in it, e.g., also of (0 + 0). Therefore, the sentence (0 + 0) = 0 will
be true in this revised structure.
So here’s what we’ll do. First we investigate the properties of complete
consistent sets, in particular we prove that a complete consistent set contains
φ ∧ ψ iff it contains both φ and ψ, φ ∨ ψ iff it contains at least one of them,
etc. (Proposition 23.2). Then we define and investigate “saturated” sets of
sentences. A saturated set is one which contains conditionals that link each
quantified sentence to instances of it (Definition 23.5). We show that any
consistent set Γ can always be extended to a saturated set Γ ′ (Lemma 23.6).
If a set is consistent, saturated, and complete it also has the property that
it contains ∃x φ(x) iff it contains φ(t) for some closed term t and ∀x φ(x) iff
it contains φ(t) for all closed terms t (Proposition 23.7). We’ll then take the
saturated consistent set Γ ′ and show that it can be extended to a saturated,
consistent, and complete set Γ ∗ (Lemma 23.8). This set Γ ∗ is what we’ll
use to define our term model M(Γ ∗ ). The term model has the set of closed
terms as its domain, and the interpretation of its predicate symbols is given
by the atomic sentences in Γ ∗ (Definition 23.9). We’ll use the properties of
saturated, complete consistent sets to show that indeed M(Γ ∗ ) ⊨ φ iff φ ∈ Γ ∗
(Lemma 23.12), and thus in particular, M(Γ ∗ ) ⊨ Γ . Finally, we’ll consider
how to define a term model if Γ contains = as well (Definition 23.16) and show
that it satisfies Γ ∗ (Lemma 23.19).
content/first-order-logic/completeness/complete-consistent-sets.tex
explanation Complete sets of sentences leave no questions unanswered. For any sen-
tence φ, Γ “says” if φ is true or false. The importance of complete sets extends
beyond the proof of the completeness theorem. A theory which is complete and
axiomatizable, for instance, is always decidable.
explanation Complete consistent sets are important in the completeness proof since we
can guarantee that every consistent set of sentences Γ is contained in a complete
consistent set Γ ∗ . A complete consistent set contains, for each sentence φ,
either φ or its negation ¬φ, but not both. This is true in particular for atomic
sentences, so from a complete consistent set in a language suitably expanded
by constant symbols, we can construct a structure where the interpretation of
predicate symbols is defined according to which atomic sentences are in Γ ∗ .
This structure can then be shown to make all sentences in Γ ∗ (and hence also
all those in Γ ) true. The proof of this latter fact requires that ¬φ ∈ Γ ∗ iff
φ∈ / Γ ∗ , (φ ∨ ψ) ∈ Γ ∗ iff φ ∈ Γ ∗ or ψ ∈ Γ ∗ , etc.
In what follows, we will often tacitly use the properties of reflexivity, mono-
tonicity, and transitivity of ⊢ (see sections 19.8, 20.7, 21.7 and 22.6).
Proposition 23.2. Suppose Γ is complete and consistent. Then: fol:com:ccs:
prop:ccs
1. If Γ ⊢ φ, then φ ∈ Γ . fol:com:ccs:
prop:ccs-prov-in
2. φ ∧ ψ ∈ Γ iff both φ ∈ Γ and ψ ∈ Γ . fol:com:ccs:
prop:ccs-and
3. φ ∨ ψ ∈ Γ iff either φ ∈ Γ or ψ ∈ Γ . fol:com:ccs:
prop:ccs-or
4. φ → ψ ∈ Γ iff either φ ∈
/ Γ or ψ ∈ Γ . fol:com:ccs:
prop:ccs-if
Proof. Let us suppose for all of the following that Γ is complete and consistent.
1. If Γ ⊢ φ, then φ ∈ Γ .
Suppose that Γ ⊢ φ. Suppose to the contrary that φ ∈ / Γ . Since Γ
is complete, ¬φ ∈ Γ . By Propositions 19.20, 20.20, 21.20 and 22.28,
Γ is inconsistent. This contradicts the assumption that Γ is consistent.
Hence, it cannot be the case that φ ∈/ Γ , so φ ∈ Γ .
2. φ ∧ ψ ∈ Γ iff both φ ∈ Γ and ψ ∈ Γ :
For the forward direction, suppose φ∧ψ ∈ Γ . Then by Propositions 19.22,
20.22, 21.22 and 22.30, item (1), Γ ⊢ φ and Γ ⊢ ψ. By (1), φ ∈ Γ and
ψ ∈ Γ , as required.
For the reverse direction, let φ ∈ Γ and ψ ∈ Γ . By Propositions 19.22,
20.22, 21.22 and 22.30, item (2), Γ ⊢ φ ∧ ψ. By (1), φ ∧ ψ ∈ Γ .
3. First we show that if φ ∨ ψ ∈ Γ , then either φ ∈ Γ or ψ ∈ Γ . Suppose
φ ∨ ψ ∈ Γ but φ ∈ / Γ and ψ ∈ / Γ . Since Γ is complete, ¬φ ∈ Γ and
¬ψ ∈ Γ . By Propositions 19.23, 20.23, 21.23 and 22.31, item (1), Γ is
inconsistent, a contradiction. Hence, either φ ∈ Γ or ψ ∈ Γ .
For the reverse direction, suppose that φ ∈ Γ or ψ ∈ Γ . By Proposi-
tions 19.23, 20.23, 21.23 and 22.31, item (2), Γ ⊢ φ∨ψ. By (1), φ∨ψ ∈ Γ ,
as required.
4. For the forward direction, suppose φ→ψ ∈ Γ , and suppose to the contrary
that φ ∈ Γ and ψ ∈ / Γ . On these assumptions, φ → ψ ∈ Γ and φ ∈ Γ .
By Propositions 19.24, 20.24, 21.24 and 22.32, item (1), Γ ⊢ ψ. But then
by (1), ψ ∈ Γ , contradicting the assumption that ψ ∈/ Γ.
For the reverse direction, first consider the case where φ ∈
/ Γ . Since Γ is
complete, ¬φ ∈ Γ . By Propositions 19.24, 20.24, 21.24 and 22.32, item
(2), Γ ⊢ φ → ψ. Again by (1), we get that φ → ψ ∈ Γ , as required.
Now consider the case where ψ ∈ Γ . By Propositions 19.24, 20.24, 21.24
and 22.32, item (2) again, Γ ⊢ φ → ψ. By (1), φ → ψ ∈ Γ .
content/first-order-logic/completeness/henkin-expansions.tex
The following definition will be used in the proof of the next theorem.
Lemma 23.6. Every consistent set Γ can be extended to a saturated consis- fol:com:hen:
tent set Γ ′ . lem:henkin
explanation We’ll now show that complete, consistent sets which are saturated have the
property that it contains a universally quantified sentence iff it contains all its
instances and it contains an existentially quantified sentence iff it contains at
least one instance. We’ll use this to show that the structure we’ll generate from
a complete, consistent, saturated set makes all its quantified sentences true.
Proposition 23.7. Suppose Γ is complete, consistent, and saturated. fol:com:hen:
prop:saturated-instances
1. ∃x φ(x) ∈ Γ iff φ(t) ∈ Γ for at least one closed term t.
2. ∀x φ(x) ∈ Γ iff φ(t) ∈ Γ for all closed terms t.
is inconsistent.)
For the reverse direction, we do not need saturation: Suppose ∀x φ(x) ∈
Γ . Then Γ ⊢ φ(t) by Propositions 19.26, 20.26, 21.26 and 22.34, item (2).
We get φ(t) ∈ Γ by Proposition 23.2.
content/first-order-logic/completeness/lindenbaums-lemma.tex
Let Γ ∗ = n≥0 Γn .
S
Each Γn is consistent: Γ0 is consistent by definition. If Γn+1 = Γn ∪ {φn },
this is because the latter is consistent. If it isn’t, Γn+1 = Γn ∪ {¬φn }. We
have to verify that Γn ∪ {¬φn } is consistent. Suppose it’s not. Then both
Γn ∪ {φn } and Γn ∪ {¬φn } are inconsistent. This means that Γn would be
inconsistent by Propositions 19.21, 20.21, 21.21 and 22.29, contrary to the
induction hypothesis.
For every n and every i < n, Γi ⊆ Γn . This follows by a simple induction
on n. For n = 0, there are no i < 0, so the claim holds automatically. For
the inductive step, suppose it is true for n. We show that if i < n + 1 then
Γi ⊆ Γn+1 . We have Γn+1 = Γn ∪ {φn } or = Γn ∪ {¬φn } by construction. So
complete.
content/first-order-logic/completeness/construction-of-model.tex
Definition 23.9 (Term model). Let Γ ∗ be a complete and consistent, sat- fol:com:mod:
urated set of sentences in a language L. The term model M(Γ ∗ ) of Γ ∗ is the defn:termmodel
∗
We will now check that we indeed have ValM(Γ ) (t) = t.
∗
fol:com:mod: Lemma 23.10. Let M(Γ ∗ ) be the term model of Definition 23.9, then ValM(Γ ) (t) =
lem:val-in-termmodel
t.
Proof. The proof is by induction on t, where the base case, when t is a con-
stant symbol, follows directly from the definition of the term model. ∗
For the
induction step assume t1 , . . . , tn are closed terms such that ValM(Γ ) (ti ) = ti
and that f is an n-ary function symbol. Then
∗ ∗ ∗ ∗
ValM(Γ ) (f (t1 , . . . , tn )) = f M(Γ ) (ValM(Γ ) (t1 ), . . . , ValM(Γ ) (tn ))
∗
= f M(Γ ) (t1 , . . . , tn )
= f (t1 , . . . , tn ),
without there being an instance φ(t) that it makes true. A structure M may
make all instances φ(t) of a universally quantified sentence ∀x φ(x) true, with-
out making ∀x φ(x) true. This is because in general not every element of |M|
is the value of a closed term (M may not be covered). This is the reason the
satisfaction relation is defined via variable assignments. However, for our term
model M(Γ ∗ ) this wouldn’t be necessary—because it is covered. This is the
content of the next result.
fol:com:mod: Proposition 23.11. Let M(Γ ∗ ) be the term model of Definition 23.9.
prop:quant-termmodel
1. M(Γ ∗ ) ⊨ ∃x φ(x) iff M(Γ ∗ ) ⊨ φ(t) for at least one closed term t.
Proof. 1. By Proposition 16.19, M(Γ ∗ ) ⊨ ∃x φ(x) iff for at least one variable
assignment s, M(Γ ∗ ), s ⊨ φ(x). As |M(Γ ∗ )| consists of the closed terms
of L, this is the case iff there is at least one closed term t such that
s(x) = t and M(Γ ∗ ), s ⊨ φ(x). By Proposition 16.23, M(Γ ∗ ), s ⊨ φ(x) iff
M(Γ ∗ ), s ⊨ φ(t), where s(x) = t. By Proposition 16.18, M(Γ ∗ ), s ⊨ φ(t)
iff M(Γ ∗ ) ⊨ φ(t), since φ(t) is a sentence.
fol:com:mod: Lemma 23.12 (Truth Lemma). Suppose φ does not contain =. Then M(Γ ∗ ) ⊨
lem:truth
φ iff φ ∈ Γ ∗ .
content/first-order-logic/completeness/identity.tex
23.7 Identity
explanation The construction of the term model given in the preceding section is enough fol:com:ide:
sec
to establish completeness for first-order logic for sets Γ that do not contain =.
The term model satisfies every φ ∈ Γ ∗ which does not contain = (and hence
all φ ∈ Γ ). It does not work, however, if = is present. The reason is that Γ ∗
then may contain a sentence t = t′ , but in the term model the value of any
term is that term itself. Hence, if t and t′ are different terms, their values in
the term model—i.e., t and t′ , respectively—are different, and so t = t′ is false.
We can fix this, however, using a construction known as “factoring.”
Definition 23.16. Let M = M(Γ ∗ ) be the term model for Γ ∗ from Defini- fol:com:ide:
defn:term-model-factor
tion 23.9. Then M/≈ is the following structure:
1. |M/≈ | = Trm(L)/≈ .
2. cM/≈ = [c]≈
explanation Note that we have defined f M/≈ and RM/≈ for elements of Trm(L)/≈ by
referring to them as [t]≈ , i.e., via representatives t ∈ [t]≈ . We have to make
sure that these definitions do not depend on the choice of these representatives,
i.e., that for some other choices t′ which determine the same equivalence classes
([t]≈ = [t′ ]≈ ), the definitions yield the same result. For instance, if R is a one-
place predicate symbol, the last clause of the definition says that [t]≈ ∈ RM/≈
iff M ⊨ R(t). If for some other term t′ with t ≈ t′ , M ⊭ R(t), then the definition
would require [t′ ]≈ ∈ / RM/≈ . If t ≈ t′ , then [t]≈ = [t′ ]≈ , but we can’t have both
M/≈
[t]≈ ∈ R and [t]≈ ∈/ RM/≈ . However, Proposition 23.14 guarantees that
this cannot happen.
and
As in the case of the term model, before proving the truth lemma we need
the following lemma.
Proof. By induction on φ, just as in the proof of Lemma 23.12. The only case
that needs additional attention is when φ ≡ t = t′ .
Note that while M(Γ ∗ ) is always enumerable and infinite, M/≈ may be digression
finite, since it may turn out that there are only finitely many classes [t]≈ . This
is to be expected, since Γ may contain sentences which require any structure
in which they are true to be finite. For instance, ∀x ∀y x = y is a consistent
sentence, but is satisfied only in structures with a domain that contains exactly
one element.
content/first-order-logic/completeness/completeness-thm.tex
Proof. Note that the Γ ’s in Corollary 23.21 and Theorem 23.20 are univer-
sally quantified. To make sure we do not confuse ourselves, let us restate
Theorem 23.20 using a different variable: for any set of sentences ∆, if ∆ is
consistent, it is satisfiable. By contraposition, if ∆ is not satisfiable, then ∆ is
inconsistent. We will use this to prove the corollary.
Suppose that Γ ⊨ φ. Then Γ ∪ {¬φ} is unsatisfiable by Proposition 16.28.
Taking Γ ∪ {¬φ} as our ∆, the previous version of Theorem 23.20 gives us
that Γ ∪ {¬φ} is inconsistent. By Propositions 19.19, 20.19, 21.19 and 22.27,
Γ ⊢ φ.
Problem 23.4. Use Corollary 23.21 to prove Theorem 23.20, thus showing
that the two formulations of the completeness theorem are equivalent.
Problem 23.5. In order for a derivation system to be complete, its rules must
be strong enough to prove every unsatisfiable set inconsistent. Which of the
rules of derivation were necessary to prove completeness? Are any of these rules
not used anywhere in the proof? In order to answer these questions, make a
list or diagram that shows which of the rules of derivation were used in which
results that lead up to the proof of Theorem 23.20. Be sure to note any tacit
uses of rules in these proofs.
content/first-order-logic/completeness/compactness.tex
Theorem 23.23 (Compactness Theorem). The following hold for any sen- fol:com:com:
thm:compactness
tences Γ and φ:
Example 23.26. We know that first-order logic with identity predicate can
express that the size of the domain must have some minimal size: The sen-
tence φ≥n (which says “there are at least n distinct objects”) is true only in
structures where |M| has at least n objects. So if we take
∆ = {φ≥n : n ≥ 1}
then any model of ∆ must be infinite. Thus, we can guarantee that a theory
only has infinite models by adding ∆ to it: the models of Γ ∪ ∆ are all and
only the infinite models of Γ .
So first-order logic can express infinitude. The compactness theorem shows
that it cannot express finitude, however. For suppose some set of sentences Λ
were satisfied in all and only finite structures. Then ∆ ∪ Λ is finitely satisfiable.
Why? Suppose ∆′ ∪ Λ′ ⊆ ∆ ∪ Λ is finite with ∆′ ⊆ ∆ and Λ′ ⊆ Λ. Let n be the
largest number such that φ≥n ∈ ∆′ . Λ, being satisfied in all finite structures,
has a model M with finitely many but ≥ n elements. But then M ⊨ ∆′ ∪ Λ′ .
By compactness, ∆ ∪ Λ has an infinite model, contradicting the assumption
that Λ is satisfied only in finite structures.
content/first-order-logic/completeness/compactness-direct.tex
2. (φ ∨ ψ) ∈ Γ iff either φ ∈ Γ or ψ ∈ Γ .
3. (φ → ψ) ∈ Γ iff either φ ∈
/ Γ or ψ ∈ Γ .
Lemma 23.28. Every finitely satisfiable set Γ can be extended to a saturated fol:com:cpd:
finitely satisfiable set Γ ′ . lem:fsat-henkin
Problem 23.9. Prove Lemma 23.28. (Hint: The crucial step is to show that
if Γn is finitely satisfiable, so is Γn ∪ {θn }, without any appeal to derivations
or consistency.)
fol:com:cpd: Lemma 23.30. Every finitely satisfiable set Γ can be extended to a complete
lem:fsat-lindenbaum
and finitely satisfiable set Γ ∗ .
Problem 23.11. Prove Lemma 23.30. (Hint: the crucial step is to show that
if Γn is finitely satisfiable, then either Γn ∪ {φn } or Γn ∪ {¬φn } is finitely
satisfiable.)
Problem 23.12. Write out the complete proof of the Truth Lemma (Lemma 23.12)
in the version required for the proof of Theorem 23.31.
content/first-order-logic/completeness/downward-ls.tex
Chapter 24
This chapter, adapted from Jeremy Avigad’s logic notes, gives the
briefest of glimpses into which other logical systems there are. It is in-
tended as a chapter suggesting further topics for study in a course that does
350
24.1. OVERVIEW
not cover them. Each one of the topics mentioned here will—hopefully—
eventually receive its own part-level treatment in the Open Logic Project.
content/first-order-logic/beyond/introduction.tex
24.1 Overview
fol:byd:int: First-order logic is not the only system of logic of interest: there are many
sec
extensions and variations of first-order logic. A logic typically consists of the
formal specification of a language, usually, but not always, a deductive system,
and usually, but not always, an intended semantics. But the technical use of
the term raises an obvious question: what do logics that are not first-order
logic have to do with the word “logic,” used in the intuitive or philosophical
sense? All of the systems described below are designed to model reasoning of
some form or another; can we say what makes them logical?
No easy answers are forthcoming. The word “logic” is used in different
ways and in different contexts, and the notion, like that of “truth,” has been
analyzed from numerous philosophical stances. For example, one might take
the goal of logical reasoning to be the determination of which statements are
necessarily true, true a priori, true independent of the interpretation of the
nonlogical terms, true by virtue of their form, or true by linguistic convention;
and each of these conceptions requires a good deal of clarification. Even if
one restricts one’s attention to the kind of logic used in mathematics, there is
little agreement as to its scope. For example, in the Principia Mathematica,
Russell and Whitehead tried to develop mathematics on the basis of logic,
in the logicist tradition begun by Frege. Their system of logic was a form
of higher-type logic similar to the one described below. In the end they were
forced to introduce axioms which, by most standards, do not seem purely logical
(notably, the axiom of infinity, and the axiom of reducibility), but one might
nonetheless hold that some forms of higher-order reasoning should be accepted
as logical. In contrast, Quine, whose ontology does not admit “propositions”
as legitimate objects of discourse, argues that second-order and higher-order
logic are really manifestations of set theory in sheep’s clothing; in other words,
systems involving quantification over predicates are not purely logical.
For now, it is best to leave such philosophical issues for a rainy day, and
simply think of the systems below as formal idealizations of various kinds of
reasoning, logical or otherwise.
content/first-order-logic/beyond/many-sorted-logic.tex
In first-order logic, variables and quantifiers range over a single domain. But
it is often useful to have multiple (disjoint) domains: for example, you might
want to have a domain of numbers, a domain of geometric objects, a domain
of functions from numbers to numbers, a domain of abelian groups, and so on.
Many-sorted logic provides this kind of framework. One starts with a list
of “sorts”—the “sort” of an object indicates the “domain” it is supposed to
inhabit. One then has variables and quantifiers for each sort, and (usually)
an identity predicate for each sort. Functions and relations are also “typed”
by the sorts of objects they can take as arguments. Otherwise, one keeps the
usual rules of first-order logic, with versions of the quantifier-rules repeated for
each sort.
For example, to study international relations we might choose a language
with two sorts of objects, French citizens and German citizens. We might have
a unary relation, “drinks wine,” for objects of the first sort; another unary
relation, “eats wurst,” for objects of the second sort; and a binary relation,
“forms a multinational married couple,” which takes two arguments, where
the first argument is of the first sort and the second argument is of the second
sort. If we use variables a, b, c to range over French citizens and x, y, z to
range over German citizens, then
asserts that if any French person is married to a German, either the French
person drinks wine or the German doesn’t eat wurst.
Many-sorted logic can be embedded in first-order logic in a natural way,
by lumping all the objects of the many-sorted domains together into one first-
order domain, using unary predicate symbols to keep track of the sorts, and
relativizing quantifiers. For example, the first-order language corresponding
to the example above would have unary predicate symbols “Ger man” and
“F r ench,” in addition to the other relations described, with the sort require-
ments erased. A sorted quantifier ∀x φ, where x is a variable of the German
sort, translates to
∀x (Ger man(x) → φ).
We need to add axioms that insure that the sorts are separate—e.g., ∀x ¬(Ger man(x)∧
F r ench(x))—as well as axioms that guarantee that “drinks wine” only holds
of objects satisfying the predicate F r ench(x), etc. With these conventions
and axioms, it is not difficult to show that many-sorted sentences translate
to first-order sentences, and many-sorted derivations translate to first-order
derivations. Also, many-sorted structures “translate” to corresponding first-
order structures and vice-versa, so we also have a completeness theorem for
many-sorted logic.
content/first-order-logic/beyond/second-order-logic.tex
φ(R) ⊢ ∃R φ(R)
But if L is the language of arithmetic with a constant relation symbol <, one
would also expect the following inference to be valid:
x < y ⊢ ∃R R(x, y)
φ(x1 , . . . , xk ) ⊢ ∃R R(x1 , . . . , xk )
φ[λ⃗x. ψ(⃗x)/R] ⊢ ∃R φ
where φ[λ⃗x. ψ(⃗x)/R] denotes the result of replacing every atomic formula of
the form Rt1 , . . . , tk in φ by ψ(t1 , . . . , tk ). This last rule is equivalent to having
a comprehension schema, i.e., an axiom of the form
one for each formula φ in the second-order language, in which R is not a free
variable. (Exercise: show that if R is allowed to occur in φ, this schema is
inconsistent!)
When logicians refer to the “axioms of second-order logic” they usually
mean the minimal extension of first-order logic by second-order quantifier rules
together with the comprehension schema. But it is often interesting to study
weaker subsystems of these axioms and rules. For example, note that in its full
generality the axiom schema of comprehension is impredicative: it allows one to
When logicians do not specify the derivation system or the semantics they have
in mind, they are usually referring to the second item on each list. The ad-
vantage to using this semantics is that, as we will see, it gives us categorical
descriptions of many natural mathematical structures; at the same time, the
derivation system is quite strong, and sound for this semantics. The drawback
is that the derivation system is not complete for the semantics; in fact, no
effectively given derivation system is complete for the full second-order seman-
tics. On the other hand, we will see that the derivation system is complete for
the weakened semantics; this implies that if a sentence is not provable, then
there is some structure, not necessarily the full one, in which it is false.
The language of second-order logic is quite rich. One can identify unary
relations with subsets of the domain, and so in particular you can quantify over
these sets; for example, one can express induction for the natural numbers with
a single axiom
∀R ((R(0) ∧ ∀x (R(x) → R(x′ ))) → ∀x R(x)).
If one takes the language of arithmetic to have symbols 0, ′, +, × and <, one
can add the following axioms to describe their behavior:
1. ∀x ¬x′ = 0
2. ∀x ∀y (s(x) = s(y) → x = y)
3. ∀x (x + 0) = x
4. ∀x ∀y (x + y ′ ) = (x + y)′
5. ∀x (x × 0) = 0
6. ∀x ∀y (x × y ′ ) = ((x × y) + x)
7. ∀x ∀y (x < y ↔ ∃z y = (x + z ′ ))
It is not difficult to show that these axioms, together with the axiom of induc-
tion above, provide a categorical description of the structure N, the standard
model of arithmetic, provided we are using the full second-order semantics.
Given any structure M in which these axioms are true, define a function f
from N to the domain of M using ordinary recursion on N, so that f (0) = 0M
and f (x + 1) = ′M (f (x)). Using ordinary induction on N and the fact that
axioms (1) and (2) hold in M, we see that f is injective. To see that f is
surjective, let P be the set of elements of |M| that are in the range of f . Since
M is full, P is in the second-order domain. By the construction of f , we know
that 0M is in P , and that P is closed under ′M . The fact that the induction
axiom holds in M (in particular, for P ) guarantees that P is equal to the entire
first-order domain of M. This shows that f is a bijection. Showing that f is a
homomorphism is no more difficult, using ordinary induction on N repeatedly.
In set-theoretic terms, a function is just a special kind of relation; for ex-
ample, a unary function f can be identified with a binary relation R satisfying
∀x ∃!y R(x, y). As a result, one can quantify over functions too. Using the full
semantics, one can then define the class of infinite structures to be the class of
structures M for which there is an injective function from the domain of M to
a proper subset of itself:
∃f (∀x ∀y (f (x) = f (y) → x = y) ∧ ∃y ∀x f (x) ̸= y).
The negation of this sentence then defines the class of finite structures.
In addition, one can define the class of well-orderings, by adding the follow-
ing to the definition of a linear ordering:
∀P (∃x P (x) → ∃x (P (x) ∧ ∀y (y < x → ¬P (y)))).
This asserts that every non-empty set has a least element, modulo the identifi-
cation of “set” with “one-place relation”. For another example, one can express
the notion of connectedness for graphs, by saying that there is no nontrivial
separation of the vertices into disconnected parts:
For yet another example, you might try as an exercise to define the class of
finite structures whose domain has even size. More strikingly, one can pro-
vide a categorical description of the real numbers as a complete ordered field
containing the rationals.
In short, second-order logic is much more expressive than first-order logic.
That’s the good news; now for the bad. We have already mentioned that
there is no effective derivation system that is complete for the full second-order
semantics. For better or for worse, many of the properties of first-order logic
are absent, including compactness and the Löwenheim–Skolem theorems.
On the other hand, if one is willing to give up the full second-order semantics
in terms of the weaker one, then the minimal second-order derivation system
is complete for this semantics. In other words, if we read ⊢ as “proves in
the minimal system” and ⊨ as “logically implies in the weaker semantics”,
we can show that whenever Γ ⊨ φ then Γ ⊢ φ. If one wants to include
specific comprehension axioms in the derivation system, one has to restrict the
semantics to second-order structures that satisfy these axioms: for example, if
∆ consists of a set of comprehension axioms (possibly all of them), we have
that if Γ ∪ ∆ ⊨ φ, then Γ ∪ ∆ ⊢ φ. In particular, if φ is not provable using
the comprehension axioms we are considering, then there is a model of ¬φ in
which these comprehension axioms nonetheless hold.
The easiest way to see that the completeness theorem holds for the weaker
semantics is to think of second-order logic as a many-sorted logic, as follows.
One sort is interpreted as the ordinary “first-order” domain, and then for each
k we have a domain of “relations of arity k.” We take the language to have
built-in relation symbols “tr ue k (R, x1 , . . . , xk )” which is meant to assert that
R holds of x1 , . . . , xk , where R is a variable of the sort “k-ary relation” and
x1 , . . . , xk are objects of the first-order sort.
With this identification, the weak second-order semantics is essentially the
usual semantics for many-sorted logic; and we have already observed that
many-sorted logic can be embedded in first-order logic. Modulo the trans-
lations back and forth, then, the weaker conception of second-order logic is
really a form of first-order logic in disguise, where the domain contains both
“objects” and “relations” governed by the appropriate axioms.
content/first-order-logic/beyond/higher-order-logic.tex
Think of types as syntactic “labels,” which classify the objects we want in our
domain; σ → τ describes those objects that are functions which take objects
of type σ to objects of type τ . For example, we might want to have a type
Ω of truth values, “true” and “false,” and a type N of natural numbers. In
that case, you can think of objects of type N → Ω as unary relations, or
subsets of N; objects of type N → N are functions from natural numbers to
natural numbers; and objects of type (N → N) → N are “functionals,” that is,
higher-type functions that take functions to numbers.
As in the case of second-order logic, one can think of higher-order logic as a
kind of many-sorted logic, where there is a sort for each type of object we want
to consider. But it is usually clearer just to define the syntax of higher-type
logic from the ground up. For example, we can define a set of finite types
inductively, as follows:
1. N is a finite type.
2. 0 is a term of type N
Rst (0) = s
Rst (x + 1) = t(x, Rst (x)),
⟨s, t⟩ denotes the pair whose first component is s and whose second component
is t, and p1 (s) and p2 (s) denote the first and second elements (“projections”)
of s. Finally, λx. s denotes the function f defined by
f (x) = s
content/first-order-logic/beyond/intuitionistic-logic.tex
Theorem 24.1. There are irrational numbers a and b such that ab is rational.
√ √2 √
Proof. Consider 2 . If this is rational, we are done: we can let a = b = 2.
Otherwise, it is irrational. Then we have
√ √ √
√ 2 √2 √ 2· 2 √ 2
( 2 ) = 2 = 2 = 2,
√
√ 2 √
which is certainly rational. So, in this case, let a be 2 , and let b be 2.
Does this constitute a valid proof? Most mathematicians feel that it does.
But again, there is something a little bit unsatisfying here: we have proved
the existence of a pair of real numbers with a certain property, without being
able to say which pair of numbers it is. It is possible to prove the same√result,
but in such a way that the pair a, b is given in the proof: take a = 3 and
b = log3 4. Then
√ log3 4
ab = 3 = 31/2·log3 4 = (3log3 4 )1/2 = 41/2 = 2,
since 3log3 x = x.
Intuitionistic logic is designed to model a kind of reasoning where moves
like the one in the first proof are disallowed. Proving the existence of an x
satisfying φ(x) means that you have to give a specific x, and a proof that it
satisfies φ, like in the second proof. Proving that φ or ψ holds requires that
you can prove one or the other.
Formally speaking, intuitionistic first-order logic is what you get if you
restrict a derivation system for first-order logic in a certain way. Similarly,
there are intuitionistic versions of second-order or higher-order logic. From the
mathematical point of view, these are just formal deductive systems, but, as
already noted, they are intended to model a kind of mathematical reasoning.
One can take this to be the kind of reasoning that is justified on a certain
philosophical view of mathematics (such as Brouwer’s intuitionism); one can
take it to be a kind of mathematical reasoning which is more “concrete” and
satisfying (along the lines of Bishop’s constructivism); and one can argue about
whether or not the formal description captures the informal motivation. But
whatever philosophical positions we may hold, we can study intuitionistic logic
as a formally presented logic; and for whatever reasons, many mathematical
logicians find it interesting to do so.
There is an informal constructive interpretation of the intuitionist connec-
tives, usually known as the BHK interpretation (named after Brouwer, Heyting,
and Kolmogorov). It runs as follows: a proof of φ ∧ ψ consists of a proof of
φ paired with a proof of ψ; a proof of φ ∨ ψ consists of either a proof of φ,
or a proof of ψ, where we have explicit information as to which is the case;
a proof of φ → ψ consists of a procedure, which transforms a proof of φ to a
proof of ψ; a proof of ∀x φ(x) consists of a procedure which returns a proof of
φ(x) for any value of x; and a proof of ∃x φ(x) consists of a value of x, together
with a proof that this value satisfies φ. One can describe the interpretation in
computational terms known as the “Curry–Howard isomorphism” or the “for-
mulas-as-types paradigm”: think of a formula as specifying a certain kind of
data type, and proofs as computational objects of these data types that enable
us to see that the corresponding formula is true.
Intuitionistic logic is often thought of as being classical logic “minus” the
law of the excluded middle. This following theorem makes this more precise.
1. (¬φ → ⊥) → φ.
2. φ ∨ ¬φ
3. ¬¬φ → φ
Obtaining instances of one schema from either of the others is a good exercise
in intuitionistic logic.
The first deductive systems for intuitionistic propositional logic, put forth
as formalizations of Brouwer’s intuitionism, are due, independently, to Kol-
mogorov, Glivenko, and Heyting. The first formalization of intuitionistic first-
order logic (and parts of intuitionist mathematics) is due to Heyting. Though
a number of classically valid schemata are not intuitionistically valid, many
are.
The double-negation translation describes an important relationship be-
tween classical and intuitionist logic. It is defined inductively follows (think of
φN as the “intuitionist” translation of the classical formula φ):
the following distinction. In the case of classical logic, the semantics was the
“obvious” one, in a sense implicit in the meaning of the connectives. Though
one can provide some intuitive motivation for Kripke semantics, the latter does
not offer the same feeling of inevitability. In addition, the notion of a classical
structure is a natural mathematical one, so we can either take the notion of
a structure to be a tool for studying classical first-order logic, or take classical
first-order logic to be a tool for studying mathematical structures. In contrast,
Kripke structures can only be viewed as a logical construct; they don’t seem
to have independent mathematical interest.
A Kripke structure M = ⟨W, R, V ⟩ for a propositional language consists
of a set W , partial order R on W with a least element, and an “monotone”
assignment of propositional variables to the elements of W . The intuition is
that the elements of W represent “worlds,” or “states of knowledge”; an element
v ≥ u represents a “possible future state” of u; and the propositional variables
assigned to u are the propositions that are known to be true in state u. The
forcing relation M, w ⊩ φ then extends this relationship to arbitrary formulas
in the language; read M, w ⊩ φ as “φ is true in state w.” The relationship is
defined inductively, as follows:
2. M, w ⊮ ⊥.
3. M, w ⊩ (φ ∧ ψ) iff M, w ⊩ φ and M, w ⊩ ψ.
4. M, w ⊩ (φ ∨ ψ) iff M, w ⊩ φ or M, w ⊩ ψ.
It is a good exercise to try to show that ¬(p ∧ q) → (¬p ∨ ¬q) is not intuitionis-
tically valid, by cooking up a Kripke structure that provides a counterexample.
content/first-order-logic/beyond/modal-logics.tex
take the assertion to mean that the claim is true not just in this world, but in
any “possible” world; or that it is necessarily true, as opposed to just true in
this particular world.
Modal logic was designed to make sense of this kind of necessity. One
obtains modal propositional logic from ordinary propositional logic by adding
a box operator; which is to say, if φ is a formula, so is □φ. Intuitively, □φ
asserts that φ is necessarily true, or true in any possible world. ♢φ is usually
taken to be an abbreviation for ¬□¬φ, and can be read as asserting that φ is
possibly true. Of course, modality can be added to predicate logic as well.
Kripke structures can be used to provide a semantics for modal logic; in
fact, Kripke first designed this semantics with modal logic in mind. Rather than
restricting to partial orders, more generally one has a set of “possible worlds,”
P , and a binary “accessibility” relation R(x, y) between worlds. Intuitively,
R(p, q) asserts that the world q is compatible with p; i.e., if we are “in” world p,
we have to entertain the possibility that the world could have been like q.
Modal logic is sometimes called an “intensional” logic, as opposed to an
“extensional” one. The intended semantics for an extensional logic, like classi-
cal logic, will only refer to a single world, the “actual” one; while the semantics
for an “intensional” logic relies on a more elaborate ontology. In addition to
structureing necessity, one can use modality to structure other linguistic con-
structions, reinterpreting □ and ♢ according to the application. For example:
One would like to augment logic with rules and axioms dealing with modal-
ity. For example, the system S4 consists of the ordinary axioms and rules of
propositional logic, together with the following axioms:
♢φ → □♢φ
Variations of these axioms may be suitable for different applications; for ex-
ample, S5 is usually taken to characterize the notion of logical necessity. And
the nice thing is that one can usually find a semantics for which the derivation
system is sound and complete by restricting the accessibility relation in the
Kripke structures in natural ways. For example, S4 corresponds to the class
content/first-order-logic/beyond/other-logics.tex
Model Theory
Material on model theory is incomplete and experimental. It is cur-
rently simply an adaptation of Aldo Antonelli’s notes on model theory, less
those topics covered in the part on first-order logic (theories, completeness,
compactness). It requires much more introduction, motivation, and expla-
nation, as well as exercises, to be useful for a textbook. Andy Arana is at
planning to work on this part specifically (issue #65).
Chapter 25
content/model-theory/basics/reducts-and-expansions.tex
1. |M| = |M′ |
365
CHAPTER 25. BASICS OF MODEL THEORY
′
2. For every constant symbol c ∈ L, cM = cM .
′
3. For every function symbol f ∈ L, f M = f M .
′
4. For every predicate symbol P ∈ L, P M = P M .
M ⊨ φ iff M′ ⊨ φ.
Proof. Exercise.
content/model-theory/basics/substructures.tex
25.2 Substructures
The domain of a structure M may be a subset of another M′ . But we should mod:bas:sub:
sec
obviously only consider M a “part” of M′ if not only |M| ⊆ |M′ |, but M and
M′ “agree” in how they interpret the symbols of the language at least on the
shared part |M|.
Definition 25.4. Given structures M and M′ for the same language L, we say mod:bas:sub:
that M is a substructure of M′ , and M′ an extension of M, written M ⊆ M′ , defn:substructure
iff
1. |M| ⊆ |M′ |,
′
2. For each constant c ∈ L, cM = cM ;
′
3. For each n-place function symbol f ∈ L f M (a1 , . . . , an ) = f M (a1 , . . . , an )
for all a1 , . . . , an ∈ |M|.
4. For each n-place predicate symbol R ∈ L, ⟨a1 , . . . , an ⟩ ∈ RM iff ⟨a1 , . . . , an ⟩ ∈
′
RM for all a1 , . . . , an ∈ |M|.
Remark 1. If the language contains no constant or function symbols, then any mod:bas:sub:
N ⊆ |M| determines a substructure N of M with domain |N| = N by putting rem:substructure
RN = RM ∩ N n .
content/model-theory/basics/overspill.tex
25.3 Overspill
mod:bas:ove:
sec
mod:bas:ove: Theorem 25.5. If a set Γ of sentences has arbitrarily large finite models,
overspill
then it has an infinite model.
Proof. If there were such a φ, its negation ¬φ would be true in all and only
the finite structures, and it would therefore have arbitrarily large finite models
but it would lack an infinite model, contradicting Theorem 25.5.
content/model-theory/basics/isomorphism.tex
mod:bas:iso: Definition 25.8. Given two structures M and M′ for the same language L,
defn:isomorphism
we say that M is isomorphic to M′ , written M ≃ M′ , if and only if there is a
function h : |M| → |M′ | such that:
1. h is injective: if h(x) = h(y) then x = y;
2. h is surjective: for every y ∈ |M′ | there is x ∈ |M| such that h(x) = y;
′
3. for every constant symbol c: h(cM ) = cM ; mod:bas:iso:
defn:iso-const
4. for every n-place predicate symbol P : mod:bas:iso:
defn:iso-pred
′
⟨a1 , . . . , an ⟩ ∈ P M iff ⟨h(a1 ), . . . , h(an )⟩ ∈ P M ;
b. M, s ⊨ φ iff M′ , h ◦ s ⊨ φ.
3. If t ≡ f (t1 , . . . , tn ), then
ValM M M M
s (t) = f (Vals (t1 ), . . . , Vals (tn )) and
′ ′ ′
ValM M M M
h◦s (t) = f (Valh◦s (t1 ), . . . , Valh◦s (tn )).
′
The induction hypothesis is that for each i, h(ValM M
s (ti )) = Valh◦s (ti ). So,
h(ValM M M M
s (t)) = h(f (Vals (t1 ), . . . , Vals (tn ))
′ ′
= h(f M (ValM M
h◦s (t1 ), . . . , Valh◦s (tn )) (25.1) mod:bas:iso:
′ iso-1
M′ M′
=f (ValM
h◦s (t1 ), . . . , Valh◦s (tn )) (25.2) mod:bas:iso:
′ iso-2
= ValM
h◦s (t)
Here, eq. (25.1) follows by induction hypothesis and eq. (25.2) by (5) of
Definition 25.8.
Problem 25.2. Carry out the proof of (b) of Theorem 25.9 in detail. Make
sure to note where each of the five properties characterizing isomorphisms of
Definition 25.8 is used.
content/model-theory/basics/theory-of-m.tex
We also use the term “theory” informally to refer to sets of sentences having
an intended interpretation, whether deductively closed or not.
mod:bas:thm: Remark 2. Consider R = ⟨R, <⟩, the structure whose domain is the set R of
remark:R
the real numbers, in the language comprising only a 2-place predicate sym-
bol interpreted as the < relation over the reals. Clearly R is non-enumerable;
however, since Th(R) is obviously consistent, by the Löwenheim–Skolem the-
orem it has an enumerable model, say S, and by Proposition 25.13, R ≡ S.
Moreover, since R and S are not isomorphic, this shows that the converse of
Theorem 25.9 fails in general.
content/model-theory/basics/partial-iso.tex
1. p is injective;
Definition 25.15. Two structures M and N, are partially isomorphic, written mod:bas:pis:
M ≃p N, if and only if there is a non-empty set I of partial isomorphisms defn:partialisom
Proof. Since M and N are enumerable, let |M| = {a0 , a1 , . . .} and |N| =
{b0 , b1 , . . .}. Starting with an arbitrary p0 ∈ I, we define an increasing se-
quence of partial isomorphisms p0 ⊆ p1 ⊆ p2 ⊆ · · · as follows:
1. if n + 1 is odd, say n = 2r, then using the Forth property find a pn+1 ∈ I
such that pn ⊆ pn+1 and ar is in the domain of pn+1 ;
If we now put: [
p= pn ,
n≥0
mod:bas:pis: Theorem 25.17. Suppose M and N are structures for a purely relational lan-
thm:p-isom2
guage (a language containing only predicate symbols, and no function symbols
or constants). Then if M ≃p N, also M ≡ N.
Remark 3. If function symbols are present, the previous result is still true, but
one needs to consider the isomorphism induced by p between the substructure
of M generated by a1 , . . . , an and the substructure of N generated by b1 , . . . ,
bn .
mod:bas:pis: Proposition 25.19. Let L be a finite purely relational language, i.e., a lan-
prop:qr-finite
guage containing finitely many predicate symbols and constant symbols, and no
function symbols. Then for each n ∈ N there are only finitely many first-order
sentences in the language L that have quantifier rank no greater than n, up to
logical equivalence.
Proof. By induction on n.
<ω
Definition 25.20. Given a structure M, let |M| be the set of all finite
sequences over |M|. We use a, b, c, . . . to range over finite sequences of elements.
<ω
If a ∈ |M| and a ∈ |M|, then aa represents the concatenation of a with a.
<ω
Definition 25.21. Given structures M and N, we define relations In ⊆ |M| ×
<ω
|N| between sequences of equal length, by recursion on n as follows:
1. I0 (a, b) if and only if a and b satisfy the same atomic formulas in M and
N; i.e., if s1 (xi ) = ai and s2 (xi ) = bi and φ is atomic with all variables
among x1 , . . . , xn , then M, s1 ⊨ φ if and only if N, s2 ⊨ φ.
Theorem 25.23. Let L be a purely relational language. Then In (a, b) implies mod:bas:pis:
that for every φ such that qr(φ) ≤ n, we have M, a ⊨ φ if and only if N, b ⊨ φ thm:b-n-f
(where again a satisfies φ if any s such that s(xi ) = ai satisfies φ). Moreover,
if L is finite, the converse also holds.
Proof. The proof that In (a, b) implies that a and b satisfy the same formulas
of quantifier rank no greater than n is by an easy induction on φ. For the
converse we proceed by induction on n, using Proposition 25.19, which ensures
that for each n there are at most finitely many non-equivalent formulas of that
quantifier rank.
For n = 0 the hypothesis that a and b satisfy the same quantifier-free
formulas gives that they satisfy the same atomic ones, so that I0 (a, b).
For the n + 1 case, suppose that a and b satisfy the same formulas of
quantifier rank no greater than n + 1; in order to show that In+1 (a, b) suffices
to show that for each a ∈ |M| there is a b ∈ |N| such that In (aa, bb), and by
the inductive hypothesis again suffices to show that for each a ∈ |M| there is
a b ∈ |N| such that aa and bb satisfy the same formulas of quantifier rank no
greater than n.
Given a ∈ |M|, let τna be set of formulas ψ(x, y) of rank no greater than
n satisfied by aa in M; τna is finite, so we can assume it is a single first-order
formula. It follows that a satisfies ∃x τna (x, y), which has quantifier rank no
greater than n + 1. By hypothesis b satisfies the same formula in N, so that
there is a b ∈ |N| such that bb satisfies τna ; in particular, bb satisfies the same
formulas of quantifier rank no greater than n as aa. Similarly one shows that
for every b ∈ |N| there is a ∈ |M| such that aa and bb satisfy the same formulas
of quantifier rank no greater than n, which completes the proof.
content/model-theory/basics/dlo.tex
1. ∀x ¬x < x;
4. ∀x ∃y x < y;
5. ∀x ∃y y < x;
mod:bas:dlo: Theorem 25.26. Any two enumerable dense linear orderings without end-
thm:cantorQ
points are isomorphic.
3. if ai <1 a <1 ai+1 for some i, then let b ∈ |M2 | be such that bi <2 b <2
bi+1 .
373
CHAPTER 26. MODELS OF ARITHMETIC
Chapter 26
Models of Arithmetic
content/model-theory/models-of-arithmetic/introduction.tex
26.1 Introduction
The standard model of arithmetic is the structure N with |N| = N in which 0,
′, +, ×, and < are interpreted as you would expect. That is, 0 is 0, ′ is the
successor function, + is interpreted as addition and × as multiplication of the
numbers in N. Specifically,
0N = 0
′N (n) = n + 1
+N (n, m) = n + m
×N (n, m) = nm
Of course, there are structures for LA that have domains other than N. For
instance, we can take M with domain |M| = {a}∗ (the finite sequences of the
single symbol a, i.e., ∅, a, aa, aaa, . . . ), and interpretations
0M = ∅
′M (s) = s ⌢ a
+M (n, m) = an+m
×M (n, m) = anm
These two structures are “essentially the same” in the sense that the only
difference is the elements of the domains but not how the elements of the
domains are related among each other by the interpretation functions. We say
that the two structures are isomorphic.
It is an easy consequence of the compactness theorem that any theory true
in N also has models that are not isomorphic to N. Such structures are called
non-standard. The interesting thing about them is that while the elements of a
standard model (i.e., N, but also all structures isomorphic to it) are exhausted
by the values of the standard numerals n, i.e.,
|N| = {ValN (n) : n ∈ N}
that isn’t the case in non-standard models: if M is non-standard, then there is
at least one x ∈ |M| such that x ̸= ValM (n) for all n.
These non-standard elements are pretty neat: they are “infinite natural
numbers.” But their existence also explains, in a sense, the incompleteness
phenomena. Consider an example, e.g., the consistency statement for Peano
arithmetic, ConPA , i.e., ¬∃x Prf PA (x, ⌜⊥⌝). Since PA neither proves ConPA
nor ¬ConPA , either can be consistently added to PA. Since PA is consis-
tent, N ⊨ ConPA , and consequently N ⊭ ¬ConPA . So N is not a model
of PA ∪ {¬ConPA }, and all its models must be nonstandard. Models of
PA ∪ {¬ConPA } must contain some element that serves as the witness that
makes ∃x Prf PA (⌜⊥⌝) true, i.e., a Gödel number of a derivation of a contradic-
tion from PA. Such an element can’t be standard—since PA ⊢ ¬Prf PA (n, ⌜⊥⌝)
for every n.
content/model-theory/models-of-arithmetic/standard-models.tex
mod:mar:stm: Proposition 26.2. If a structure M is standard, then its domain is the set
prop:standard-domain
of values of the standard numerals, i.e.,
|M| = {ValM (n) : n ∈ N}
Proof. Clearly, every ValM (n) ∈ |M|. We just have to show that every x ∈ |M|
is equal to ValM (n) for some n. Since M is standard, it is isomorphic to N.
Suppose g : N → |M| is an isomorphism. Then g(n) = g(ValN (n)) = ValM (n).
But for every x ∈ |M|, there is an n ∈ N such that g(n) = x, since g is
surjective.
If a structure M for LA is standard, the elements of its domain can all be explanation
named by the standard numerals 0, 1, 2, . . . , i.e., the terms 0, 0′ , 0′′ , etc. Of
course, this does not mean that the elements of |M| are the numbers, just that
we can pick them out the same way we can pick out the numbers in |N|.
Problem 26.1. Show that the converse of Proposition 26.2 is false, i.e., give
an example of a structure M with |M| = {ValM (n) : n ∈ N} that is not
isomorphic to N.
5. ⟨n, m⟩ ∈ <N iff n < m. If n < m, then Q ⊢ n < m, and also M ⊨ n < m.
Thus ⟨ValM (n), ValM (m)⟩ ∈ <M , i.e., ⟨g(n), g(m)⟩ ∈ <M . If n ̸< m,
then Q ⊢ ¬n < m, and consequently M ⊭ n < m. Thus, as before,
/ <M . Together, we get: ⟨n, m⟩ ∈ <N iff ⟨g(n), g(m)⟩ ∈
⟨g(n), g(m)⟩ ∈
M
< .
explanation The function g is the most obvious way of defining a mapping from N to the
domain of any other structure M for LA , since every such M contains elements
named by 0, 1, 2, etc. So it isn’t surprising that if M makes at least some
basic statements about the n’s true in the same way that N does, and g is
also bijective, then g will turn into an isomorphism. In fact, if |M| contains no
elements other than what the n’s name, it’s the only one.
Proposition 26.4. If M is standard, then g from the proof of Proposition 26.3 mod:mar:stm:
prop:thq-unique-iso
is the only isomorphism from N to M.
For any denumerable set M , there’s a bijection between N and M , so every explanation
such set M is potentially the domain of a standard model M. In fact, once you
pick an object z ∈ M and a suitable function s as 0M and ′M , the interpreta-
tions of +, ×, and < is already fixed. Only functions s : M → M \ {z} that
are both injective and surjective are suitable in a standard model as ′M . The
range of s cannot contain z, since otherwise ∀x 0 ̸= x′ would be false. That
sentence is true in N, and so M also has to make it true. The function s has
to be injective, since the successor function ′N in N is, and that ′N is injective
is expressed by a sentence true in N. It has to be surjective because otherwise
there would be some x ∈ M \ {z} not in the domain of s, i.e., the sentence
∀x (x = 0 ∨ ∃y y ′ = x) would be false in M—but it is true in N.
content/model-theory/models-of-arithmetic/non-standard-models.tex
By Proposition 26.2, any standard structure for LA contains only stan- explanation
Proof. Expand LA by a new constant symbol c and consider the set of sentences
Γ = TA ∪ {c ̸= 0, c ̸= 1, c ̸= 2, . . . }
Any model Mc of Γ would contain an element x = cM which is non-standard,
since x ̸= ValM (n) for all n ∈ N. Also, obviously, Mc ⊨ TA, since TA ⊆ Γ . If
we turn Mc into a structure M for LA simply by forgetting about c, its domain
still contains the non-standard x, and also M ⊨ TA. The latter is guaranteed
since c does not occur in TA. So, it suffices to show that Γ has a model.
We use the compactness theorem to show that Γ has a model. If every
finite subset of Γ is satisfiable, so is Γ . Consider any finite subset Γ0 ⊆ Γ . Γ0
includes some sentences of TA and some of the form c ̸= n, but only finitely
many. Suppose k is the largest number so that c ̸= k ∈ Γ0 . Define Nk by
expanding N to include the interpretation cNk = k + 1. Nk ⊨ Γ0 : if φ ∈ TA,
Nk ⊨ φ since Nk is just like N in all respects except c, and c does not occur
in φ. And Nk ⊨ c ̸= n, since n ≤ k, and ValNk (c) = k + 1. Thus, every finite
subset of Γ is satisfiable.
content/model-theory/models-of-arithmetic/models-of-q.tex
26.4 Models of Q
We know that there are non-standard structures that make the same sentences explanation
mod:mar:mdq: Example 26.8. Consider the structure K with domain |K| = N ∪ {a} and
ex:model-K-of-Q
interpretations
0K = 0
(
K x + 1 if x ∈ N
′ (x) =
a if x = a
(
x + y if x, y ∈ N
+K (x, y) =
a otherwise
xy if x, y ∈ N
×K (x, y) = 0 if x = 0 or y = 0
a otherwise
x⊕y 0 m a x⊗y 0 m a
x x∗
0 0 m a 0 0 0 0
n n+1
n n n+m a n 0 nm a
a a
a a a a a 0 a a
we have:
(n ⊕ m∗ ) = (n + (m + 1)) = (n + m) + 1 = (n ⊕ m)∗
∗
since ⊕ and agree with + and ′ on standard numbers. Now suppose x ∈ |K|.
Then
(x ⊕ a∗ ) = (x ⊕ a) = a = a∗ = (x ⊕ a)∗
(a ⊕ n∗ ) = (a ⊕ (n + 1)) = a = a∗ = (a ⊕ n)∗
(a ⊕ a∗ ) = (a ⊕ a) = a = a∗ = (a ⊕ a)∗
This is of course a bit more detailed than needed. For instance, since a ⊕ z = a
whatever z is, we can immediately conclude a ⊕ a∗ = a. The remaining axioms
can be verified the same way.
K is thus a model of Q. Its “addition” ⊕ is also commutative. But there
are other sentences true in N but false in K, and vice versa. For instance, a 4 a,
so K ⊨ ∃x x < x and K ⊭ ∀x ¬x < x. This shows that Q ⊬ ∀x ¬x < x.
Problem 26.3. Prove that K from Example 26.8 satisfies the remaining ax-
ioms of Q,
∀x (x × 0) = 0 (Q6 )
∀x ∀y (x × y ′ ) = ((x × y) + x) (Q7 )
′
∀x ∀y (x < y ↔ ∃z (z + x) = y) (Q8 )
Find a sentence only involving ′ true in N but false in K.
Example 26.9. Consider the structure L with domain |L| = N ∪ {a, b} and mod:mar:mdq:
x x∗ x⊕y m a b
n n+1 n n+m b a
a a a a b a
b b b b b a
Since ∗ is injective, 0 is not in its range, and every x ∈ |L| other than 0 is,
axioms Q1 –Q3 are true in L. For any x, x ⊕ 0 = x, so Q4 is true as well. For
Q5 , consider x ⊕ y ∗ and (x ⊕ y)∗ . They are equal if x and y are both standard,
since then ∗ and ⊕ agree with ′ and +. If x is non-standard, and y is standard,
we have x ⊕ y ∗ = x = x∗ = (x ⊕ y)∗ . If x and y are both non-standard, we
have four cases:
a ⊕ a∗ = b = b∗ = (a ⊕ a)∗
b ⊕ b∗ = a = a∗ = (b ⊕ b)∗
b ⊕ a∗ = b = b∗ = (b ⊕ y)∗
a ⊕ b∗ = a = a∗ = (a ⊕ b)∗
n ⊕ a∗ = n ⊕ a = b = b∗ = (n ⊕ a)∗
n ⊕ b∗ = n ⊕ b = a = a∗ = (n ⊕ b)∗
∀x (x × 0) = 0 (Q6 )
′
∀x ∀y (x × y ) = ((x × y) + x) (Q7 )
′
∀x ∀y (x < y ↔ ∃z (z + x) = y) (Q8 )
ments live “beyond” the standard elements. In fact, that much is required by
the axioms. A non-standard element x cannot be 40, since Q ⊢ ∀x ¬x < 0 (see
Lemma 35.23). Also, for every n, Q ⊢ ∀x (x < n′ →(x = 0∨x = 1∨· · ·∨x = n))
(Lemma 35.24), so we can’t have a 4 n for any n > 0.
content/model-theory/models-of-arithmetic/models-of-pa.tex
26.5 Models of PA
Any non-standard model of TA is also one of PA. We know that non-standard explanation
models of TA and hence of PA exist. We also know that such non-standard
models contain non-standard “numbers,” i.e., elements of the domain that are
“beyond” all the standard “numbers.” But how are they arranged? How many
are there? We’ve seen that models of the weaker theory Q can contain as few
as a single non-standard number. But these simple structures are not models
of PA or TA.
The key to understanding the structure of models of PA or TA is to see
what facts are derivable in these theories. For instance, already PA proves
that ∀x x ̸= x′ and ∀x ∀y (x + y) = (y + x), so this rules out simple structures
(in which these sentences are false) as models of PA.
Suppose M is a model of PA. Then if PA ⊢ φ, M ⊨ φ. Let’s again use z
for 0M , ∗ for ′M , ⊕ for +M , ⊗ for ×M , and 4 for <M . Any sentence φ then
states some condition about z, ∗, ⊕, ⊗, and 4, and if M ⊨ φ that condition
must be satisfied. For instance, if M ⊨ Q1 , i.e., M ⊨ ∀x ∀y (x′ = y ′ → x = y),
then ∗ must be injective.
Proposition 26.10. In M, 4 is a linear strict order, i.e., it satisfies:
1. Not x 4 x for any x ∈ |M|.
2. If x 4 y and y 4 z then x 4 z.
3. For any x ̸= y, x 4 y or y 4 x
Proof. PA proves:
1. ∀x ¬x < x
Proposition 26.11. z is the least element of |M| in the 4-ordering. For any mod:mar:mpa:
x, x 4 x∗ , and x∗ is the 4-least element with that property. For any x, there prop:M-discrete
Proof. Exercise.
Proof. We’ll use n as short for ValM (n), a standard element of M. Already
Q proves that, for any n ∈ N, ∀x (x < n′ → (x = 0 ∨ x = 1 ∨ · · · ∨ x = n)).
There are no elements that are 4z. So if n is standard and x is non-standard,
we cannot have x 4 n. By definition, a non-standard element is one that isn’t
ValM (n) for any n ∈ N, so x ̸= n as well. Since 4 is a linear order, we must
have n 4 x.
Proof. Clearly, such a set [x] always exists since every element y of |M| has
a unique successor y ∗ and unique predecessor ∗ y. For successive elements y,
y ∗ we have y 4 y ∗ and y ∗ is the 4-least element of |M| such that y is 4-less
than it. Since always ∗ y 4 y and y 4 y ∗ , [x] has no least or greatest element. If
y ∈ [x] then x ∈ [y], for then either y ∗...∗ = x or x∗...∗ = y. If y ∗...∗ = x (with
n ∗’s), then y ⊕ n = x and conversely, since PA ⊢ ∀x x′...′ = (x + n) (if n is the
number of ′’s).
Proposition 26.14. If [x] ̸= [y] and x 4 y, then for any u ∈ [x] and any
v ∈ [y], u 4 v.
This means that the blocks themselves can be ordered in a way that respects explanation
4: [x]4[y] iff x4y, or, equivalently, if u4v for any u ∈ [x] and v ∈ [y]. Clearly,
the standard block [0] is the least block. It intersects with no non-standard
block, and no two non-standard blocks intersect either. Specifically, you cannot
“reach” a different block by taking repeated successors or predecessors.
Proof. PA ⊢ ∀x ∃y ((y +y) = x∨(y +y)′ = x), i.e., that every x is divisible by 2
(possibly with remainder 1). If x is non-standard, so is y. By the preceding
/ [y]. Then also y 4 (y ⊕ y)∗ and (y ⊕ y)∗ ∈
proposition, y 4 y ⊕ y and y ⊕ y ∈ / [y].
∗
But x = y ⊕ y or x = (y ⊕ y) , so y 4 x and y ∈ / [x].
Proof. Exercise.
Proposition 26.19. The ordering of the blocks is dense. That is, if x 4 y mod:mar:mpa:
and [x] ̸= [y], then there is a block [z] distinct from both that is between them. prop:blocks-dense
Problem 26.8. Write out a detailed proof of Proposition 26.19. Which sen-
tence must PA derive in order to guarantee the existence of z? Why is x 4 z
and z 4 y, and why is [x] ̸= [z] and [z] ̸= [y]?
explanation The non-standard blocks are therefore ordered like the rationals: they form
a denumerable dense linear ordering without endpoints. One can show that
any two such denumerable orderings are isomorphic. It follows that for any
two enumerable non-standard models M1 and M2 of true arithmetic, their
reducts to the language containing < and = only are isomorphic. Indeed, an
isomorphism h can be defined as follows: the standard parts of M1 and M2
are isomorphic to the standard model N and hence to each other. The blocks
making up the non-standard part are themselves ordered like the rationals
and therefore isomorphic; an isomorphism of the blocks can be extended to
an isomorphism within the blocks by matching up arbitrary elements in each,
and then taking the image of the successor of x in M1 to be the successor
of the image of x in M2 . Note that it does not follow that M1 and M2 are
isomorphic in the full language of arithmetic (indeed, isomorphism is always
relative to a language), as there are non-isomorphic ways to define addition and
multiplication over |M1 | and |M2 |. (This also follows from a famous theorem
due to Vaught that the number of countable models of a complete theory cannot
be 2.)
content/model-theory/models-of-arithmetic/computable-models.tex
In such models M, of course, at least some numbers cannot play the roles they
usually play, since some k must be different from ValM (n) for all n ∈ N.
Definition 26.20. A structure M for LA is computable iff |M| = N and ′M ,
+M , ×M are computable functions and <M is a decidable relation.
mod:mar:cmp: Example 26.21. Recall the structure K from Example 26.8. Its domain was
ex:comp-model-q
|K| = N ∪ {a} and interpretations
0K = 0
(
K x + 1 if x ∈ N
′ (x) =
a if x = a
(
x + y if x, y ∈ N
+K (x, y) =
a otherwise
xy if x, y ∈ N
×K (x, y) = 0 if x = 0 or y = 0
a otherwise
′
And we have ⟨x, y⟩ ∈ <K iff x < y and x > 0 and y > 0, or if y = 0.
′
All of these functions are computable functions of natural numbers and <K
is a decidable relation on N—but they are not the same functions as successor,
′
addition, and multiplication on N, and <K is not the same relation as < on N.
Chapter 27
content/model-theory/interpolation/introduction.tex
27.1 Introduction
The interpolation theorem is the following result: Suppose ⊨ φ → ψ. Then mod:int:int:
sec
there is a sentence χ such that ⊨ φ → χ and ⊨ χ → ψ. Moreover, every constant
symbol, function symbol, and predicate symbol (other than =) in χ occurs
both in φ and ψ. The sentence χ is called an interpolant of φ and ψ.
The interpolation theorem is interesting in its own right, but its main im-
portance lies in the fact that it can be used to prove results about definability
in a theory, and the conditions under which combining two consistent theories
results in a consistent theory. The first result is known as the Beth definability
theorem; the second, Robinson’s joint consistency theorem.
content/model-theory/interpolation/separation.tex
386
27.2. SEPARATION OF SENTENCES
Γ ∆
¬χ
mod:int:sep: Lemma 27.3. Suppose that Γ ∪ {∃x σ} and ∆ are inseparable, and c is a new
lem:sep2
constant symbol not in Γ , ∆, or σ. Then Γ ∪ {∃x σ, σ[c/x]} and ∆ are also
inseparable.
2. c does occur in χ so that χ has the form χ[c/x]. Then we have that
Γ ∪ {∃x σ, σ[c/x]} ⊨ χ[c/x],
whence Γ, ∃x σ ⊨ ∀x (σ → χ) by the Deduction Theorem and Generaliza-
tion, and finally Γ ∪ {∃x σ} ⊨ ∃x χ. On the other hand, ∆ ⊨ ¬χ[c/x] and
hence by Generalization ∆ ⊨ ¬∃x χ. So Γ ∪ {∃x σ} and ∆ are separable,
a contradiction.
content/model-theory/interpolation/interpolation-proof.tex
The basis for (1) is given by Lemma 27.2. For part (2), we need to distinguish
three cases:
This completes the basis of the induction for (1) and (2) above. Now for
the inductive step. For (1), if ∆n+1 = ∆n ∪ {ψn } then Γn+1 and ∆n+1 are
inseparable by construction (even when ψn is existential, by Lemma 27.3);
if ∆n+1 = ∆n (because Γn+1 and ∆n ∪ {ψn } are separable), then we use
the induction hypothesis on (2). For the inductive step for (2), if Γn+2 =
Γn+1 ∪ {φn+1 } then Γn+2 and ∆n+1 are inseparable by construction (even
when φn+1 is existential, by Lemma 27.3); and if Γn+2 = Γn+1 then we use
the inductive case for (1) just proved. This concludes the induction on (1) and
(2).
It follows that Γ ∗ and ∆∗ are inseparable; if not, by compactness, there
is n ≥ 0 that separates Γn and ∆n , against (1). In particular, Γ ∗ and ∆∗
are consistent: for if the former or the latter is inconsistent, then they are
separated by ∃x x ̸= x or ∀x x = x, respectively.
We now show that Γ ∗ is maximally consistent in L′1 and likewise ∆∗ in
′
L2 . For the former, suppose that φn ∈ / Γ ∗ and ¬φn ∈/ Γ ∗ , for some n ≥ 0. If
φn ∈ / Γ then Γn ∪ {φn } is separable from ∆n , and so there is χ ∈ L′0 such
∗
that both:
Γ ∗ ⊨ φn → χ, ∆∗ ⊨ ¬χ.
Γ ∗ ⊨ ¬φn → χ′ , ∆∗ ⊨ ¬χ′ .
content/model-theory/interpolation/definability.tex
But an explicit definition is only one way of defining—in the sense of determin-
ing completely—a relation. A theory may also be such that the interpretation
of P is fixed by the interpretation of the rest of the language in any model. The
definability theorem states that whenever a theory fixes the interpretation of P
in this way—whenever it implicitly defines P —then it also explicitly defines it.
Definition 27.5. Suppose L is a language not containing the predicate sym-
bol P . A set Σ(P ) of sentences of L ∪ {P } explicitly defines P if and only if
there is a formula χ(x1 , . . . , xn ) of L such that
and the conclusion follows. For the converse: assume that Σ(P ) implicitly
defines P . First, we add constant symbols c1 , . . . , cn to L. Then
By compactness, there are finite sets ∆0 ⊆ Σ(P ) and ∆1 ⊆ Σ(P ′ ) such that
∆0 ∪ ∆1 ⊨ P (c1 , . . . , cn ) → P ′ (c1 , . . . , cn ).
Let θ(P ) be the conjunction of all sentences φ(P ) such that either φ(P ) ∈ ∆0
or φ(P ′ ) ∈ ∆1 and let θ(P ′ ) be the conjunction of all sentences φ(P ′ ) such
that either φ(P ) ∈ ∆0 or φ(P ′ ) ∈ ∆1 . Then θ(P ) ∧ θ(P ′ ) ⊨ P (c1 , . . . , cn ) →
P ′ c1 . . . cn . We can re-arrange this so that each predicate symbol occurs on
one side of ⊨:
Chapter 28
Lindström’s Theorem
content/model-theory/lindstrom/introduction.tex
28.1 Introduction
In this chapter we aim to prove Lindström’s characterization of first-order logic
as the maximal logic for which (given certain further constraints) the Compact-
ness and the Downward Löwenheim–Skolem theorems hold (Theorem 23.23 and
Theorem 23.32). First, we need a more general characterization of the general
class of logics to which the theorem applies. We will restrict ourselves to re-
lational languages, i.e., languages which only contain predicate symbols and
individual constants, but no function symbols.
content/model-theory/lindstrom/abstract-logics.tex
392
28.2. ABSTRACT LOGICS
Notice that we are still employing the same notion of structure for a given
language as for first-order logic, but we do not presuppose that sentences are
build up from the basic symbols in L in the usual way, nor that the rela-
tion |=L is recursively defined in the same way as for first-order logic. So for
instance the definition, being completely general, is intended to capture the
case where sentences in ⟨L, |=L ⟩ contain infinitely long conjunctions or disjunc-
tion, or quantifiers other than ∃ and ∀ (e.g., “there are infinitely many x such
that . . . ”), or perhaps infinitely long quantifier prefixes. To emphasize that
“sentences” in L(L) need not be ordinary sentences of first-order logic, in this
chapter we use variables α, β, . . . to range over them, and reserve φ, ψ, . . . for
ordinary first-order formulas.
Definition 28.2. Let ModL (α) denote the class {M : M |=L α}. If the lan-
guage needs to be made explicit, we write ModL L (α). Two structures M and
N for L are elementarily equivalent in ⟨L, |=L ⟩, written M ≡L N, if the same
sentences from L(L) are true in each.
Definition 28.3. An abstract logic ⟨L, |=L ⟩ for the language L is normal if it
satisfies the following properties:
1. (L-Monotonicity) For languages L and L′ , if L ⊆ L′ , then L(L) ⊆ L(L′ ).
2. (Expansion Property) For each α ∈ L(L) there is a finite subset L′ of L
such that the relation M |=L α depends only on the reduct of M to L′ ;
i.e., if M and N have the same reduct to L′ then M |=L α if and only if
N |=L α.
3. (Isomorphism Property) If M |=L α and M ≃ N then also N |=L α.
4. (Renaming Property) The relation |=L is preserved under renaming: if the
language L′ is obtained from L by replacing each symbol P by a symbol
P ′ of the same arity and each constant c by a distinct constant c′ , then
for each structure M and sentence α, M |=L α if and only if M′ |=L α′ ,
where M′ is the L′ -structure corresponding to L and α′ ∈ L(L′ ).
5. (Boolean Property) The abstract logic ⟨L, |=L ⟩ is closed under the Boolean
connectives in the sense that for each α ∈ L(L) there is a β ∈ L(L) such
that M |=L β if and only if M ̸|=L α, and for each α and β there is a γ
such that ModL (γ) = ModL (α)∩ModL (β). Similarly for atomic formulas
and the other connectives.
6. (Quantifier Property) For each constant c in L and α ∈ L(L) there is a
β ∈ L(L) such that
′
ModL L
L (β) = {M : (M, a)} ∈ ModL (α) for some a ∈ |M|},
Definition 28.4. Given two abstract logics ⟨L1 , |=L1 ⟩ and ⟨L2 , |=L2 ⟩ we say
that the latter is at least as expressive as the former, written ⟨L1 , |=L1 ⟩ ≤
⟨L2 , |=L2 ⟩, if for each language L and sentence α ∈ L1 (L) there is a sentence β ∈
L2 (L) such that ModL L
L1 (α) = ModL2 (β). The logics ⟨L1 , |=L1 ⟩ and ⟨L2 , |=L2 ⟩
are equivalent if ⟨L1 , |=L1 ⟩ ≤ ⟨L2 , |=L2 ⟩ and ⟨L2 , |=L2 ⟩ ≤ ⟨L1 , |=L1 ⟩.
Remark 5. First-order logic, i.e., the abstract logic ⟨F, |=⟩, is normal. In fact,
the above properties are mostly straightforward for first-order logic. We just
remark that the expansion property comes down to extensionality, and that
the relativization of a sentence α to R(x, c1 , . . . , cn ) is obtained by replacing
each subformula ∀x β by ∀x (R(x, c1 , . . . , cn ) → β). Moreover, if ⟨L, |=L ⟩ is
normal, then ⟨F, |=⟩ ≤ ⟨L, |=L ⟩, as can be can shown by induction on first-
order formulas. Accordingly, with no loss in generality, we can assume that
every first-order sentence belongs to every normal logic.
content/model-theory/lindstrom/ls-property.tex
Definition 28.5. An abstract logic ⟨L, |=L ⟩ has the Compactness Property
if each set Γ of L(L)-sentences is satisfiable whenever each finite Γ0 ⊆ Γ is
satisfiable.
applies to the case of abstract logics. In case of first-order logic, we know from
Theorem 25.17 that if two structures are partially isomorphic then they are
elementarily equivalent. That proof does not carry over to abstract logics, for
induction on formulas need not be available for arbitrary α ∈ L(L), but the
theorem is true nonetheless, provided the Löwenheim–Skolem property holds.
mod:lin:lsp: Theorem 28.7. Suppose ⟨L, |=L ⟩ is a normal logic with the Löwenheim–
thm:abstract-p-isom
Skolem property. Then any two structures that are partially isomorphic are
elementarily equivalent in ⟨L, |=L ⟩.
Proof. Suppose M ≃p N, but for some α also M |=L α while N ̸|=L α. By the
Isomorphism Property we can assume that |M| and |N| are disjoint, and by
the Expansion Property we can assume that α ∈ L(L) for a finite language L.
Let I be a set of partial isomorphisms between M and N, and with no loss of
generality also assume that if p ∈ I and q ⊆ p then also q ∈ I.
<ω
|M| is the set of finite sequences of elements of |M|. Let S be the ternary
<ω <ω
relation over |M| representing concatenation, i.e., if a, b, c ∈ |M| then
S(a, b, c) holds if and only if c is the concatenation of a and b; and let T be
<ω
the ternary relation such that T (a, b, c) holds for b ∈ M and a, c ∈ |M|
if and only if a = a1 , . . . an and c = a1 , . . . an , b. Pick new 3-place predicate
<ω
symbols P and Q and form the structure M∗ having the universe |M| ∪ |M| ,
having M as a substructure, and interpreting P and Q by the concatenation
relations S and T (so M∗ is in the language L ∪ {P, Q}).
<ω
Define |N| , S ′ , T ′ , P ′ , Q′ and N∗ analogously. Since by hypothesis
<ω <ω
M ≃p N, there is a relation I between |M| and |N| such that I(a, b)
holds if and only if a and b are isomorphic and satisfy the back-and-forth
condition of Definition 25.15. Now, let M be the structure whose domain is
the union of the domains of M∗ and N∗ , having M∗ and N∗ as substructures,
in the language with one extra binary predicate symbol R interpreted by the
∗
relation I and predicate symbols denoting the domains |M| and |N| ∗.
I
M N
M∗ N∗
content/model-theory/lindstrom/lindstrom-proof.tex
Proof. Let n be such that any two n-equivalent structures M and N agree on
the value assigned to α. Recall Proposition 25.19: there are only finitely many
first-order sentences in a finite language that have quantifier rank no greater
than n, up to logical equivalence. Now, for each fixed structure M let θM
be the conjunction of all first-order sentences α true in M with qr(α) ≤ n
(thisWconjunction is finite), so that N |= θM if and only if N ≡n M. Then put
θ = {θM : M |=L α}; this disjunction is also finite (up to logical equivalence).
The conclusion ModL (α) = ModL (θ) follows. In fact, if N |=L θ then for
some M |=L α we have N |= θM , whence also N |=L α (by the hypothesis of the
lemma). Conversely, if N |=L α then θN is a disjunct in θ, and since N |= θN ,
also N |=L θ.
Theorem 28.9 (Lindström’s Theorem). Suppose ⟨L, |=L ⟩ has the Com- mod:lin:prf:
pactness and the Löwenheim–Skolem Properties. Then ⟨L, |=L ⟩ ≤ ⟨F, |=⟩ (so thm:lindstrom
Proof. By Lemma 28.8, it suffices to show that for any α ∈ L(L), with L finite,
there is n ∈ N such that for any two structures M and N: if M ≡n N then M
and N agree on α. For then α is equivalent to a first-order sentence, from which
⟨L, |=L ⟩ ≤ ⟨F, |=⟩ follows. Since we are working in a finite, purely relational
language, by Theorem 25.23 we can replace the statement that M ≡n N by
the corresponding algebraic statement that In (∅, ∅).
Given α, suppose towards a contradiction that for each n there are struc-
tures Mn and Nn such that In (∅, ∅), but (say) Mn |=L α whereas Nn ̸|=L α.
By the Isomorphism Property we can assume that all the Mn ’s interpret the
constants of the language by the same objects; furthermore, since there are
only finitely many atomic sentences in the language, we may also assume that
they satisfy the same atomic sentences (we can take a subsequence of the M’s
otherwise). Let M be the union of all the Mn ’s, i.e., the unique minimal struc-
ture having each Mn as a substructure. As in the proof of Theorem 28.7, let
<ω
M∗ be the extension of M with domain |M| ∪ |M| , in the expanded language
comprising the concatenation predicates P and Q.
Similarly, define Nn , N and N∗ . Now let M be the structure whose domain
comprises the domains of M∗ and N∗ as well as the natural numbers N along
with their natural ordering ≤, in the language with extra predicates represent-
<ω <ω
ing the domains |M|, |N|, |M| and |N| as well as predicates coding the
domains of Mn and Nn in the sense that:
The structure M also has a ternary relation J such that J(n, a, b) holds if and
only if In (a, b).
Now there is a sentence θ in the language L augmented by R, S, J, etc.,
saying that ≤ is a discrete linear ordering with first but no last element and
such that Mn |= α, Nn ̸|= α, and for each n in the ordering, J(n, a, b) holds if
and only if In (a, b).
Using the Compactness Property, we can find a model M∗ of θ in which
the ordering contains a non-standard element n∗ . In particular then M∗ will
contain substructures Mn∗ and Nn∗ such that Mn∗ |=L α and Nn∗ ̸|=L α. But
now we can define a set I of pairs of k-tuples from |Mn∗ | and |Nn∗ | by putting
⟨a, b⟩ ∈ I if and only if J(n∗ − k, a, b), where k is the length of a and b.
Since n∗ is non-standard, for each standard k we have that n∗ − k > 0, and
the set I witnesses the fact that Mn∗ ≃p Nn∗ . But by Theorem 28.7, Mn∗ is
L-equivalent to Nn∗ , a contradiction.
Computability
This part is based on Jeremy Avigad’s notes on computability theory.
Only the chapter on recursive functions contains exercises yet, and every-
thing could stand to be expanded with motivation, examples, details, and
exercises.
Chapter 29
Recursive Functions
content/computability/recursive-functions/introduction.tex
29.1 Introduction
In order to develop a mathematical theory of computability, one has to, first of cmp:rec:int:
sec
all, develop a model of computability. We now think of computability as the
kind of thing that computers do, and computers work with symbols. But at the
beginning of the development of theories of computability, the paradigmatic
example of computation was numerical computation. Mathematicians were
always interested in number-theoretic functions, i.e., functions f : Nn → N that
can be computed. So it is not surprising that at the beginning of the theory
of computability, it was such functions that were studied. The most familiar
398
29.2. PRIMITIVE RECURSION
content/computability/recursive-functions/primitive-recursion.tex
h(0) = 1
h(x + 1) = 2 · h(x)
If we already know how to multiply, then these equations give us the infor-
mation required for (a) and (b) above. By successively applying the second
equation, we get that
h(1) = 2 · h(0) = 2,
h(2) = 2 · h(1) = 2 · 2,
h(3) = 2 · h(2) = 2 · 2 · 2,
..
.
add(x, 0) = x
add(x, y + 1) = add(x, y) + 1
These equations specify the value of add for all x and y. To find add(2, 3),
for instance, we apply the defining equations for x = 2, using the first to find
add(2, 0) = 2, then using the second to successively find add(2, 1) = 2 + 1 = 3,
add(2, 2) = 3 + 1 = 4, add(2, 3) = 4 + 1 = 5.
In the definition of add we used + on the right-hand-side of the second
equation, but only to add 1. In other words, we used the successor function
succ(z) = z+1 and applied it to the previous value add(x, y) to define add(x, y+
1). So we can think of the recursive definition as given in terms of a single
function which we apply to the previous value. However, it doesn’t hurt—
and sometimes is necessary—to allow the function to depend not just on the
previous value but also on x and y. Consider:
mult(x, 0) = 0
mult(x, y + 1) = add(mult(x, y), x)
mult(2, 3) is determined by successively computing mult(2, 0), mult(2, 1), mult(2, 2),
and mult(2, 3):
mult(2, 0) = 0
mult(2, 1) = mult(2, 0 + 1) = add(mult(2, 0), 2) = add(0, 2) = 2
mult(2, 2) = mult(2, 1 + 1) = add(mult(2, 1), 2) = add(2, 2) = 4
mult(2, 3) = mult(2, 2 + 1) = add(mult(2, 2), 2) = add(4, 2) = 6
The general pattern then is this: to give a primitive recursive definition of
a function h(x0 , . . . , xk−1 , y), we provide two equations. The first defines the
value of h(x0 , . . . , xk−1 , 0) without reference to h. The second defines the value
of h(x0 , . . . , xk−1 , y + 1) in terms of h(x0 , . . . , xk−1 , y), the other arguments x0 ,
. . . , xk−1 , and y. Only the immediately preceding value of h may be used in
that second equation. If we think of the operations given by the right-hand-
sides of these two equations as themselves being functions f and g, then the
general pattern to define a new function h by primitive recursion is this:
h(x0 , . . . , xk−1 , 0) = f (x0 , . . . , xk−1 )
h(x0 , . . . , xk−1 , y + 1) = g(x0 , . . . , xk−1 , y, h(x0 , . . . , xk−1 , y))
In the case of add, we have k = 1 and f (x0 ) = x0 (the identity function), and
g(x0 , y, z) = z + 1 (the 3-place function that returns the successor of its third
argument):
add(x0 , 0) = f (x0 ) = x0
add(x0 , y + 1) = g(x0 , y, add(x0 , y)) = succ(add(x0 , y))
In the case of mult, we have f (x0 ) = 0 (the constant function always return-
ing 0) and g(x0 , y, z) = add(z, x0 ) (the 3-place function that returns the sum
of its last and first argument):
mult(x0 , 0) = f (x0 ) = 0
mult(x0 , y + 1) = g(x0 , y, mult(x0 , y)) = add(mult(x0 , y), x0 )
content/computability/recursive-functions/composition.tex
29.3 Composition
cmp:rec:com: If f and g are two one-place functions of natural numbers, we can compose
sec
them: h(x) = g(f (x)). The new function h(x) is then defined by composition
from the functions f and g. We’d like to generalize this to functions of more
than one argument.
Here’s one way of doing this: suppose f is a k-place function, and g0 , . . . ,
gk−1 are k functions which are all n-place. Then we can define a new n-place
function h as follows:
h(x0 , . . . , xn−1 ) = f (g0 (x0 , . . . , xn−1 ), . . . , gk−1 (x0 , . . . , xn−1 ))
content/computability/recursive-functions/pr-functions.tex
for each natural number n and i < n, we will include among the primitive
recursive functions the function zero(x) = 0.
Definition 29.3. The set of primitive recursive functions is the set of functions
from Nn to N, defined inductively by the following clauses:
Put more concisely, the set of primitive recursive functions is the smallest explanation
set containing zero, succ, and the projection functions Pjn , and which is closed
under composition and primitive recursion.
Another way of describing the set of primitive recursive functions is by
defining it in terms of “stages.” Let S0 denote the set of starting functions:
zero, succ, and the projections. These are the primitive recursive functions of
stage 0. Once a stage Si has been defined, let Si+1 be the set of all functions
add(x0 , 0) = f (x0 ) = x0
add(x0 , y + 1) = g(x0 , y, add(x0 , y)) = succ(add(x0 , y))
So add is primitive recursive provided f and g are as well. f (x0 ) = x0 = P01 (x0 ),
and the projection functions count as primitive recursive, so f is primitive
recursive. The function g is the three-place function g(x0 , y, z) defined by
g(x0 , y, z) = succ(z).
This does not yet tell us that g is primitive recursive, since g and succ are not
quite the same function: succ is one-place, and g has to be three-place. But
we can define g “officially” by composition as
Since succ and P23 count as primitive recursive functions, g does as well, since
it can be defined by composition from primitive recursive functions.
Proof. Exercise.
Problem 29.1. Prove Proposition 29.5 by showing that the primitive recur-
sive definition of mult can be put into the form required by Definition 29.1 and
showing that the corresponding functions f and g are primitive recursive.
Example 29.6. Here’s our very first example of a primitive recursive defini-
tion:
h(0) = 1
h(y + 1) = 2 · h(y).
This function cannot fit into the form required by Definition 29.1, since k = 0.
The definition also involves the constants 1 and 2. To get around the first
problem, let’s introduce a dummy argument and define the function h′ :
h′ (x0 , 0) = f (x0 ) = 1
h (x0 , y + 1) = g(x0 , y, h′ (x0 , y)) = 2 · h′ (x0 , y).
′
The function f (x0 ) = 1 can be defined from succ and zero by composition:
f (x0 ) = succ(zero(x0 )). The function g can be defined by composition from
g ′ (z) = 2 · z and projections:
g(x0 , y, z) = g ′ (P23 (x0 , y, z))
and
content/computability/recursive-functions/notation-pr-functions.tex
Here the role of f is played by P01 , and the role of g is played by succ(P23 (x0 , y, z)),
which is assigned the notation Comp1,3 [succ, P23 ] as it is the result of defining a
function by composition from the 1-ary function succ and the 3-ary function P23 .
With this setup, we can denote the addition function by
Having these notations sometimes proves useful, e.g., when enumerating prim-
itive recursive functions.
Problem 29.2. Give the complete primitive recursive notation for mult.
content/computability/recursive-functions/pr-functions-computable.tex
h(⃗x, 0) = f (⃗x)
h(⃗x, y + 1) = g(⃗x, y, h(⃗x, y))
and suppose the functions f and g are computable. (We use ⃗x to abbreviate x0 ,
. . . , xk−1 .) Then h(⃗x, 0) can obviously be computed, since it is just f (⃗x) which
we assume is computable. h(⃗x, 1) can then also be computed, since 1 = 0 + 1
and so h(⃗x, 1) is just
Thus, to compute h(⃗x, y) in general, successively compute h(⃗x, 0), h(⃗x, 1), . . . ,
until we reach h(⃗x, y).
Thus, a primitive recursive definition yields a new computable function if
the functions f and g are computable. Composition of functions also results in
a computable function if the functions f and gi are computable.
Since the basic functions zero, succ, and Pin are computable, and com-
position and primitive recursion yield computable functions from computable
functions, this means that every primitive recursive function is computable.
content/computability/recursive-functions/examples.tex
exp(x, 0) = 1
exp(x, y + 1) = mult(x, exp(x, y)).
exp(x, 0) = f (x)
exp(x, y + 1) = g(x, y, exp(x, y)).
where
f (x) = succ(zero(x)) = 1
g(x, y, z) = mult(P03 (x, y, z), P23 (x, y, z)) = x · z
is primitive recursive.
pred(0) = 0 and
pred(y + 1) = y.
This is almost a primitive recursive definition. It does not, strictly speaking, fit
into the pattern of definition by primitive recursion, since that pattern requires
at least one extra argument x. It is also odd in that it does not actually use
pred(y) in the definition of pred(y + 1). But we can first define pred′ (x, y) by
and then define pred from it by composition, e.g., as pred(x) = pred′ (zero(x), P01 (x)).
fac(0) = 1
fac(y + 1) = fac(y) · (y + 1).
where g(x, y, z) = mult(P23 (x, y, z), succ(P13 (x, y, z))) and then let
From now on we’ll be a bit more laissez-faire and not give the official definitions
by composition and primitive recursion.
is primitive recursive.
Proof. We have:
x −̇ 0 = x
x −̇ (y + 1) = pred(x −̇ y)
max(x, y) = x + (y −̇ x).
cmp:rec:exa: Proposition 29.13. The minimum of x and y, min(x, y), is primitive recur-
prop:min-pr
sive.
Proof. Exercise.
is primitive recursive.
Problem 29.5. Show that integer division d(x, y) = ⌊x/y⌋ (i.e., division,
where you disregard everything after the decimal point) is primitive recur-
sive. When y = 0, we stipulate d(x, y) = 0. Give an explicit definition of d
using primitive recursion and composition.
Proof. For example, finite sums are defined recursively by the equations
g(⃗x, 0) = f (⃗x, 0)
g(⃗x, y + 1) = g(⃗x, y) + f (⃗x, y + 1).
content/computability/recursive-functions/pr-relations.tex
cond(0, y, z) = y,
cond(x + 1, y, z) = z.
One can use this to justify definitions of primitive recursive functions by cases
from primitive recursive relations:
Proposition 29.18. If g0 (⃗x), . . . , gm (⃗x) are primitive recursive functions,
and R0 (⃗x), . . . , Rm−1 (⃗x) are primitive recursive relations, then the function f
defined by
g0 (⃗x) if R0 (⃗x)
g (⃗x) if R1 (⃗x) and not R0 (⃗x)
1
..
f (⃗x) = .
gm−1 (⃗x) if Rm−1 (⃗x) and none of the previous hold
gm (⃗x) otherwise
For m greater than 1, one can just compose definitions of this form.
content/computability/recursive-functions/bounded-minimization.tex
Proof. Note than there can be no z < 0 such that R(⃗x, z) since there is no
z < 0 at all. So mR (⃗x, 0) = 0.
In case the bound is of the form y + 1 we have three cases:
1. There is a z < y such that R(⃗x, z), in which case mR (⃗x, y+1) = mR (⃗x, y).
2. There is no such z < y but R(⃗x, y) holds, then mR (⃗x, y + 1) = y.
3. There is no z < y + 1 such that R(⃗x, z), then mR (⃗z, y + 1) = y + 1.
So we can define mR (⃗x, 0) by primitive recursion as follows:
mR (⃗x, 0) = 0
mR (⃗x, y)
if mR (⃗x, y) ̸= y
mR (⃗x, y + 1) = y if mR (⃗x, y) = y and R(⃗x, y)
y+1 otherwise.
content/computability/recursive-functions/primes.tex
29.10 Primes
cmp:rec:pri: Bounded quantification and bounded minimization provide us with a good
sec
deal of machinery to show that natural functions and relations are primitive
recursive. For example, consider the relation “x divides y”, written x | y. The
relation x | y holds if division of y by x is possible without remainder, i.e., if y
is an integer multiple of x. (If it doesn’t hold, i.e., the remainder when dividing
x by y is > 0, we write x ∤ y.) In other words, x | y iff for some z, x · z = y.
Obviously, any such z, if it exists, must be ≤ y. So, we have that x | y iff for
some z ≤ y, x · z = y. We can define the relation x | y by bounded existential
quantification from = and multiplication by
x | y ⇔ (∃z ≤ y) (x · z) = y.
Prime(x) ⇔ x ≥ 2 ∧ (∀y ≤ x) (y | x → y = 1 ∨ y = x)
p(0) = 2
p(x + 1) = nextPrime(p(x))
Since nextPrime(x) is the least y such that y > x and y is prime, it can be
easily computed by unbounded search. But it can also be defined by bounded
minimization, thanks to a result due to Euclid: there is always a prime number
between x and x ! + 1.
This shows, that nextPrime(x) and hence p(x) are (not just computable but)
primitive recursive.
(If you’re curious, here’s a quick proof of Euclid’s theorem. Suppose pn
is the largest prime ≤ x and consider the product p = p0 · p1 · · · · · pn of all
primes ≤ x. Either p + 1 is prime or there is a prime between x and p + 1.
Why? Suppose p + 1 is not prime. Then some prime number q | p + 1 where
q < p + 1. None of the primes ≤ x divide p + 1. (By definition of p, each of the
primes pi ≤ x divides p, i.e., with remainder 0. So, each of the primes pi ≤ x
divides p + 1 with remainder 1, and so pi ∤ p + 1.) Hence, q is a prime > x and
< p + 1. And p ≤ x !, so there is a prime > x and ≤ x ! + 1.)
content/computability/recursive-functions/sequences.tex
29.11 Sequences
The set of primitive recursive functions is remarkably robust. But we will be cmp:rec:seq:
sec
able to do even more once we have developed a adequate means of handling
sequences. We will identify finite sequences of natural numbers with natural
numbers in the following way: the sequence ⟨a0 , a1 , a2 , . . . , ak ⟩ corresponds to
the number
pa0 0 +1 · pa1 1 +1 · pa2 2 +1 · · · · · pakk +1 .
We add one to the exponents to guarantee that, for example, the sequences
⟨2, 7, 3⟩ and ⟨2, 7, 3, 0, 0⟩ have distinct numeric codes. We can take both 0
and 1 to code the empty sequence; for concreteness, let Λ denote 0.
The reason that this coding of sequences works is the so-called Fundamental
Theorem of Arithmetic: every natural number n ≥ 2 can be written in one and
only one way in the form
Proposition 29.20. The function len(s), which returns the length of the se-
quence s, is primitive recursive.
We can use bounded minimization, since there is only one i that satisfies R(s, i)
when s is a code of a sequence, and if i exists it is less than s itself.
Proposition 29.21. The function append(s, a), which returns the result of
appending a to the sequence s, is primitive recursive.
Proposition 29.22. The function element(s, i), which returns the ith element
of s (where the initial element is called the 0th), or 0 if i is greater than or
equal to the length of s, is primitive recursive.
Proof. Note that a is the ith element of s iff pa+1 i is the largest power of pi
that divides s, i.e., pa+1
i | s but p a+2
i ∤ s. So:
(
0 if i ≥ len(s)
element(s, i) = a+2
(min a < s) (pi ∤ s) otherwise.
Instead of using the official names for the functions defined above, we intro-
duce a more compact notation. We will use (s)i instead of element(s, i), and
⟨s0 , . . . , sk ⟩ to abbreviate
append(append(. . . append(Λ, s0 ) . . . ), sk ).
Proposition 29.23. The function concat(s, t), which concatenates two se-
quences, is primitive recursive.
hconcat(s, t, 0) = s
hconcat(s, t, n + 1) = append(hconcat(s, t, n), (t)n )
then the numeric code of the sequence s described above is at most sequenceBound(x, k).
Having such a bound on sequences gives us a way of defining new functions
using bounded search. For example, we can define concat using bounded search.
All we need to do is write down a primitive recursive specification of the object
(number of the concatenated sequence) we are looking for, and a bound on how
far to look. The following works:
sconcat(⟨s0 , . . . , sk ⟩) = s0 ⌢ . . . ⌢ sk .
Problem 29.10. Show that there is a primitive recursive function tail(s) with
the property that
tail(Λ) = 0 and
tail(⟨s0 , . . . , sk ⟩) = ⟨s1 , . . . , sk ⟩.
Proposition 29.24. The function subseq(s, i, n) which returns the subse- cmp:rec:seq:
prop:subseq
quence of s of length n beginning at the ith element, is primitive recursive.
Proof. Exercise.
content/computability/recursive-functions/trees.tex
29.12 Trees
cmp:rec:tre: Sometimes it is useful to represent trees as natural numbers, just like we can
sec
represent sequences by numbers and properties of and operations on them by
primitive recursive relations and functions on their codes. We’ll use sequences
and their codes to do this. A tree can be either a single node (possibly with a
label) or else a node (possibly with a label) connected to a number of subtrees.
The node is called the root of the tree, and the subtrees it is connected to its
immediate subtrees.
We code trees recursively as a sequence ⟨k, d1 , . . . , dk ⟩, where k is the num-
ber of immediate subtrees and d1 , . . . , dk the codes of the immediate subtrees.
If the nodes have labels, they can be included after the immediate subtrees. So
a tree consisting just of a single node with label l would be coded by ⟨0, l⟩, and
a tree consisting of a root (labelled l1 ) connected to two single nodes (labelled
l2 , l3 ) would be coded by ⟨2, ⟨0, l2 ⟩, ⟨0, l3 ⟩, l1 ⟩.
cmp:rec:tre: Proposition 29.25. The function SubtreeSeq(t), which returns the code of
prop:subtreeseq
a sequence the elements of which are the codes of all subtrees of the tree with
code t, is primitive recursive.
g(s, 0) = f ((s)0 )
g(s, k + 1) = g(s, k) ⌢ f ((s)k+1 )
For instance, if s is a sequence of trees, then h(s) = gISubtrees (s, len(s)) gives
the sequence of the immediate subtrees of the elements of s. We can use it to
define hSubtreeSeq by
hSubtreeSeq(t, 0) = ⟨t⟩
hSubtreeSeq(t, n + 1) = hSubtreeSeq(t, n) ⌢ h(hSubtreeSeq(t, n)).
The maximum level of subtrees in a tree coded by t, i.e., the maximum distance
between the root and a leaf node, is bounded by the code t. So a sequence of
codes of all subtrees of the tree coded by t is given by hSubtreeSeq(t, t).
content/computability/recursive-functions/other-recursions.tex
h0 (⃗x, 0) = f0 (⃗x)
h1 (⃗x, 0) = f1 (⃗x)
h0 (⃗x, y + 1) = g0 (⃗x, y, h0 (⃗x, y), h1 (⃗x, y))
h1 (⃗x, y + 1) = g1 (⃗x, y, h0 (⃗x, y), h1 (⃗x, y))
h(⃗x, 0) = f (⃗x)
h(⃗x, y + 1) = g(⃗x, y, ⟨h(⃗x, 0), . . . , h(⃗x, y)⟩).
with the understanding that the last argument to g is just the empty sequence
when y is 0. In either formulation, the idea is that in computing the “successor
step,” the function h can make use of the entire sequence of values computed
so far. This is known as a course-of-values recursion. For a particular example,
it can be used to justify the following type of definition:
(
g(⃗x, y, h(⃗x, k(⃗x, y))) if k(⃗x, y) < y
h(⃗x, y) =
f (⃗x) otherwise
You should think about how to obtain these functions using ordinary prim-
itive recursion. One final version of primitive recursion is more flexible in that
one is allowed to change the parameters (side values) along the way:
h(⃗x, 0) = f (⃗x)
h(⃗x, y + 1) = g(⃗x, y, h(k(⃗x), y))
content/computability/recursive-functions/non-pr-functions.tex
h(x) = g(x, x) + 1
= fx (x) + 1.
g0 (x) = x+1
gn+1 (x) = gnx (x)
You can confirm that each function gn is primitive recursive. Each successive
function grows much faster than the one before; g1 (x) is equal to 2x, g2 (x) is
equal to 2x · x, and g3 (x) grows roughly like an exponential stack of x 2’s. The
Ackermann–Péter function is essentially the function G(x) = gx (x), and one
can show that this grows faster than any primitive recursive function.
#(0) = ⟨0⟩
#(S) = ⟨1⟩
#(Pin ) = ⟨2, n, i⟩
#(Compk,l [H, G0 , . . . , Gk−1 ]) = ⟨3, k, l, #(H), #(G0 ), . . . , #(Gk−1 )⟩
#(Recl [G, H]) = ⟨4, l, #(G), #(H)⟩
Here we are using the fact that every sequence of numbers can be viewed as
a natural number, using the codes from the last section. The upshot is that
every code is assigned a natural number. Of course, some sequences (and
hence some numbers) do not correspond to notations; but we can let fi be the
unary primitive recursive function with notation coded as i, if i codes such a
notation; and the constant 0 function otherwise. The net result is that we have
an explicit way of enumerating the unary primitive recursive functions.
(In fact, some functions, like the constant zero function, will appear more
than once on the list. This is not just an artifact of our coding, but also a result
of the fact that the constant zero function has more than one notation. We
will later see that one can not computably avoid these repetitions; for example,
there is no computable function that decides whether or not a given notation
represents the constant zero function.)
We can now take the function g(x, y) to be given by fx (y), where fx refers
to the enumeration we have just described. How do we know that g(x, y) is
computable? Intuitively, this is clear: to compute g(x, y), first “unpack” x,
and see if it is a notation for a unary function. If it is, compute the value of
that function on input y.
digression You may already be convinced that (with some work!) one can write a
program (say, in Java or C++) that does this; and now we can appeal to the
Church–Turing thesis, which says that anything that, intuitively, is computable
can be computed by a Turing machine.
Of course, a more direct way to show that g(x, y) is computable is to de-
scribe a Turing machine that computes it, explicitly. This would, in particular,
avoid the Church–Turing thesis and appeals to intuition. Soon we will have
built up enough machinery to show that g(x, y) is computable, appealing to a
model of computation that can be simulated on a Turing machine: namely, the
recursive functions.
content/computability/recursive-functions/partial-functions.tex
To motivate the definition of the recursive functions, note that our proof that
there are computable functions that are not primitive recursive actually estab-
lishes much more. The argument was simple: all we used was the fact that it
is possible to enumerate functions f0 , f1 , . . . such that, as a function of x and
y, fx (y) is computable. So the argument applies to any class of functions that
can be enumerated in such a way. This puts us in a bind: we would like to
describe the computable functions explicitly; but any explicit description of a
collection of computable functions cannot be exhaustive!
The way out is to allow partial functions to come into play. We will see
that it is possible to enumerate the partial computable functions. In fact, we
already pretty much know that this is the case, since it is possible to enumerate
Turing machines in a systematic way. We will come back to our diagonal
argument later, and explore why it does not go through when partial functions
are included.
The question is now this: what do we need to add to the primitive recursive
functions to obtain all the partial recursive functions? We need to do two
things:
2. Add something to the definition, so that some new partial functions are
included.
The first is easy. As before, we will start with zero, successor, and projec-
tions, and close under composition and primitive recursion. The only difference
is that we have to modify the definitions of composition and primitive recur-
sion to allow for the possibility that some of the terms in the definition are not
defined. If f and g are partial functions, we will write f (x) ↓ to mean that f
is defined at x, i.e., x is in the domain of f ; and f (x) ↑ to mean the opposite,
i.e., that f is not defined at x. We will use f (x) ≃ g(x) to mean that either
f (x) and g(x) are both undefined, or they are both defined and equal. We
will use these notations for more complicated terms as well. We will adopt the
convention that if h and g0 , . . . , gk all are partial functions, then
the least x such that f (0, ⃗z), f (1, ⃗z), . . . , f (x, ⃗z) are all defined, and
f (x, ⃗z) = 0, if such an x exists
with the understanding that µx f (x, ⃗z) is undefined otherwise. This defines
µx f (x, ⃗z) uniquely.
explanation Note that our definition makes no reference to Turing machines, or al-
gorithms, or any specific computational model. But like composition and
primitive recursion, there is an operational, computational intuition behind
unbounded search. When it comes to the computability of a partial func-
tion, arguments where the function is undefined correspond to inputs for which
the computation does not halt. The procedure for computing µx f (x, ⃗z) will
amount to this: compute f (0, ⃗z), f (1, ⃗z), f (2, ⃗z) until a value of 0 is returned.
If any of the intermediate computations do not halt, however, neither does the
computation of µx f (x, ⃗z).
If R(x, ⃗z) is any relation, µx R(x, ⃗z) is defined to be µx (1 −̇ χR (x, ⃗z)). In
other words, µx R(x, ⃗z) returns the least value of x such that R(x, ⃗z) holds.
So, if f (x, ⃗z) is a total function, µx f (x, ⃗z) is the same as µx (f (x, ⃗z) = 0).
But note that our original definition is more general, since it allows for the
possibility that f (x, ⃗z) is not everywhere defined (whereas, in contrast, the
characteristic function of a relation is always total).
Definition 29.26. The set of partial recursive functions is the smallest set of
partial functions from the natural numbers to the natural numbers (of various
arities) containing zero, successor, and projections, and closed under composi-
tion, primitive recursion, and unbounded search.
Definition 29.27. The set of recursive functions is the set of partial recursive cmp:rec:par:
defn:recursive-fn
functions that are total.
content/computability/recursive-functions/normal-form.tex
for every x.
explanation The proof of the normal form theorem is involved, but the basic idea is
simple. Every partial recursive function has an index e, intuitively, a number
content/computability/recursive-functions/halting-problem.tex
is not computable.
In the context of partial recursive functions, the role of the specification of a
program may be played by the index e given in Kleene’s normal form theorem.
If f is a partial recursive function, any e for which the equation in the normal
form theorem holds, is an index of f . Given a number e, the normal form
theorem states that
φe (x) ≃ U (µs T (e, x, s))
is partial recursive, and for every partial recursive f : N → N, there is an e ∈ N
such that φe (x) ≃ f (x) for all x ∈ N. In fact, for each such f there is not just
one, but infinitely many such e. The halting function h is defined by
(
1 if φe (x) ↓
h(e, x) =
0 otherwise.
Note that h(e, x) = 0 if φe (x) ↑, but also when e is not the index of a partial
recursive function at all.
1. If h(ed , ed ) = 1 then φed (ed ) ↓. But φed ≃ d, and d(ed ) is defined iff
h(ed , ed ) = 0. So h(ed , ed ) ̸= 1.
The upshot is that ed cannot, after all, be the index of a partial recursive
function. But if h were partial recursive, d would be too, and so our definition
of ed as an index of it would be admissible. We must conclude that h cannot
be partial recursive.
content/computability/recursive-functions/general-recursive-functions.tex
Definition 29.30. The set of general recursive functions is the smallest set cmp:rec:gen:
defn:general-recursive
of functions from the natural numbers to the natural numbers (of various ari-
ties) containing zero, successor, and projections, and closed under composition,
primitive recursion, and unbounded search applied to regular functions.
Chapter 30
Computability Theory
content/computability/computability-theory/introduction.tex
30.1 Introduction
cmp:thy:int: The branch of logic known as Computability Theory deals with issues having
sec
to do with the computability, or relative computability, of functions and sets.
It is a evidence of Kleene’s influence that the subject used to be known as
Recursion Theory, and today, both names are commonly used.
Let us call a function f : N → 7 N partial computable if it can be computed
in some model of computation. If f is total we will simply say that f is
computable. A relation R with computable characteristic function χR is also
called computable. If f and g are partial functions, we will write f (x) ↓ to
mean that f is defined at x, i.e., x is in the domain of f ; and f (x) ↑ to mean
the opposite, i.e., that f is not defined at x. We will use f (x) ≃ g(x) to mean
that either f (x) and g(x) are both undefined, or they are both defined and
equal.
One can explore the subject without having to refer to a specific model
of computation. To do this, one shows that there is a universal partial com-
425
CHAPTER 30. COMPUTABILITY THEORY
putable function, Un(k, x). This allows us to enumerate the partial computable
functions. We will adopt the notation φk to denote the k-th unary partial
computable function, defined by φk (x) ≃ Un(k, x). (Kleene used {k} for this
purpose, but this notation has not been used as much recently.) Slightly more
generally, we can uniformly enumerate the partial computable functions of ar-
bitrary arities, and we will use φnk to denote the k-th n-ary partial recursive
function.
Recall that if f (⃗x, y) is a total or partial function, then µy f (⃗x, y) is the
function of ⃗x that returns the least y such that f (⃗x, y) = 0, assuming that all of
f (⃗x, 0), . . . , f (⃗x, y − 1) are defined; if there is no such y, µy f (⃗x, y) is undefined.
If R(⃗x, y) is a relation, µy R(⃗x, y) is defined to be the least y such that R(⃗x, y) is
true; in other words, the least y such that one minus the characteristic function
of R is equal to zero at ⃗x, y.
To show that a function is computable, there are two ways one can proceed:
1. Rigorously: describe a Turing machine or partial recursive function ex-
plicitly, and show that it computes the function you have in mind;
2. Informally: describe an algorithm that computes it, and appeal to Church’s
thesis.
There is no fine line between the two; a detailed description of an algorithm
should provide enough information so that it is relatively clear how one could,
in principle, design the right Turing machine or sequence of partial recursive
definitions. Fully rigorous definitions are unlikely to be informative, and we
will try to find a happy medium between these two approaches; in short, we
will try to find intuitive yet rigorous proofs that the precise definitions could
be obtained.
content/computability/computability-theory/coding-computations.tex
content/computability/computability-theory/normal-form.tex
for every x.
Proof Sketch. For any model of computation one can rigorously define a de-
scription of the computable function f and code such description using a nat-
ural number k. One can also rigorously define a notion of “computation se-
quence” which records the process of computing the function with index k for
input x. These computation sequences can likewise be coded as numbers s.
This can be done in such a way that (a) it is decidable whether a number s
codes the computation sequence of the function with index k on input x and
(b) what the end result of the computation sequence coded by s is. In fact, the
relation in (a) and the function in (b) are primitive recursive.
In order to give a rigorous proof of the Normal Form Theorem, we would explanation
have to fix a model of computation and carry out the coding of descriptions of
computable functions and of computation sequences in detail, and verify that
the relation T and function U are primitive recursive. For most applications,
it suffices that T and U are computable and that U is total.
It is probably best to remember the proof of the normal form theorem in
slogan form: µs T (k, x, s) searches for a computation sequence of the function
with index k on input x, and U returns the output of the computation sequence
if one can be found.
T and U can be used to define the enumeration φ0 , φ1 , φ2 , . . . . From now
on, we will assume that we have fixed a suitable choice of T and U , and take
the equation
φe (x) ≃ U (µs T (e, x, s))
to be the definition of φe .
Here is another useful fact:
Theorem 30.2. Every partial computable function has infinitely many in-
dices.
content/computability/computability-theory/s-m-n.tex
Theorem 30.3. For each pair of natural numbers n and m, there is a prim- cmp:thy:smn:
itive recursive function sm
n such that for every sequence x, a0 , . . . , am−1 , y0
thm:s-m-n
,. . . , yn−1 , we have
φnsm
n (x,a0 ,...,am−1 )
(y0 , . . . , yn−1 ) ≃ φm+n
x (a0 , . . . , am−1 , y0 , . . . , yn−1 ).
content/computability/computability-theory/universal-part-function.tex
Proof. Let Un(k, x) ≃ U (µs T (k, x, s)) in Kleene’s normal form theorem.
This is just a precise way of saying that we have an effective enumeration of explanation
the partial computable functions; the idea is that if we write fk for the function
defined by fk (x) = Un(k, x), then the sequence f0 , f1 , f2 , . . . includes all the
partial computable functions, with the property that fk (x) can be computed
“uniformly” in k and x. For simplicity, we are using a binary function that
is universal for unary functions, but by coding sequences of numbers we can
easily generalize this to more arguments. For example, note that if f (x, y, z) is
a 3-place partial recursive function, then the function g(x) ≃ f ((x)0 , (x)1 , (x)2 )
is a unary recursive function.
content/computability/computability-theory/no-universal-function.tex
Proof. This theorem says that there is no total computable function that is
universal for the total computable functions. The proof is a simple diagonal-
ization: if Un′ (k, x) were total and computable, then
would also be total and computable. However, for every k, d(k) is not equal to
Un′ (k, k).
Theorem Theorem 30.4 above shows that we can get around this diagonal- explanation
ization argument, but only at the expense of allowing partial functions. It is
worth trying to understand what goes wrong with the diagonalization argu-
ment, when we try to apply it in the partial case. In particular, the function
h(x) = Un(x, x) + 1 is partial recursive. Suppose h is the k-th function in the
enumeration; what can we say about h(k)?
content/computability/computability-theory/halting-problem.tex
But now Un′ (k, x) is a total function, and is computable if h is. For instance,
we could define g using primitive recursion, by
g(0, k, x) ≃ 0
g(y + 1, k, x) ≃ Un(k, x);
then
Un′ (k, x) ≃ g(h(k, x), k, x).
And since Un′ (k, x) agrees with Un(k, x) wherever the latter is defined, Un′ is
universal for those partial computable functions that happen to be total. But
this contradicts Theorem 30.5.
The function g is partial computable; for example, one can define it as µy h(x, x) =
0. So, for some k, g(x) ≃ Un(k, x) for every x. Is g defined at k? If it is, then,
by the definition of g, h(k, k) = 0. By the definition of f , this means that
Un(k, k) is undefined; but by our assumption that g(k) ≃ Un(k, x) for every
x, this means that g(k) is undefined, a contradiction. On the other hand, if
g(k) is undefined, then h(k, k) ̸= 0, and so h(k, k) = 1. But this means that
Un(k, k) is defined, i.e., that g(k) is defined.
We can describe this argument in terms of Turing machines. Suppose there explanation
content/computability/computability-theory/russells-paradox.tex
1. computable functions
To sort this out, it might help to draw a big square representing all the partial
functions from N to N, and then mark off two overlapping regions, correspond-
ing to the total functions and the computable partial functions, respectively.
It is a good exercise to see if you can describe an object in each of the resulting
regions in the diagram.
content/computability/computability-theory/computable-sets.tex
content/computability/computability-theory/ce-sets.tex
content/computability/computability-theory/equiv-ce-defs.tex
cmp:thy:eqc: Theorem 30.9. Let S be a set of natural numbers. Then the following are
thm:ce-equiv
equivalent:
1. S is computably enumerable.
explanation The first three clauses say that we can equivalently take any non-empty
computably enumerable set to be enumerated by either a computable function,
a partial computable function, or a primitive recursive function. The fourth
clause tells us that if S is computably enumerable, then for some index e,
S = {x : φe (x) ↓}.
In other words, S is the set of inputs on for which the computation of φe
halts. For that reason, computably enumerable sets are sometimes called semi-
decidable: if a number is in the set, you eventually get a “yes,” but if it isn’t,
you never get a “no”!
Proof. Since every primitive recursive function is computable and every com-
putable function is partial computable, (3) implies (1) and (1) implies (2).
(Note that if S is empty, S is the range of the partial computable function that
is nowhere defined.) If we show that (2) implies (3), we will have shown the
first three clauses equivalent.
So, suppose S is the range of the partial computable function φe . If S is
empty, we are done. Otherwise, let a be any element of S. By Kleene’s normal
form theorem, we can write
φe (x) = U (µs T (e, x, s)).
In particular, φe (x) ↓ and = y if and only if there is an s such that T (e, x, s)
and U (s) = y. Define f (z) by
(
U ((z)1 ) if T (e, (z)0 , (z)1 )
f (z) =
a otherwise.
Then g is a partial computable function, and g(y) is defined if and only if for
some x, f (x) = y. In other words, the domain of g is the range of f . Expressed
in terms of Turing machines: given a Turing machine F that enumerates the
elements of S, let G be the Turing machine that semi-decides S by searching
through the outputs of F to see if a given element is in the set.
Finally, to show (4) implies (1), suppose that S is the domain of the partial
computable function φe , i.e.,
S = {x : φe (x) ↓}.
Then, as above, a number x is in the range of f if and only if φe (x) ↓, i.e., if and
only if x ∈ S. Expressed in terms of Turing machines: given a machine Me that
semi-decides S, enumerate the elements of S by running through all possible
Turing machine computations, and returning the inputs that correspond to
halting computations.
S = {x : ∃y R(x, y)}.
S = {x : ∃y T (e, x, y)}.
f (x) ≃ µy AtomRx, y.
content/computability/computability-theory/ce-closed-cup-cap.tex
Then k enumerates A ∪ B; the idea is that k just alternates between the enu-
merations offered by f and g. Enumerating A ∩ B is tricker. If A ∩ B is empty,
it is trivially computably enumerable. Otherwise, let c be any element of A∩B,
and define l by (
f ((x)0 ) if f ((x)0 ) = g((x)1 )
l(x) =
c otherwise.
In computational terms, l runs through pairs of elements in the enumerations of
f and g, and outputs every match it finds; otherwise, it just stalls by outputting
c.
For the last proof, suppose A is the domain of the partial function m(x)
and B is the domain of the partial function n(x). Then A ∩ B is the domain
of the partial function m(x) + n(x).
explanation In computational terms, if A is the set of values for which m halts and B
is the set of values for which n halts, A ∩ B is the set of values for which both
procedures halt.
Expressing A ∪ B as a set of halting values is more difficult, because one
has to simulate m and n in parallel. Let d be an index for m and let e be an
content/computability/computability-theory/complement-ce.tex
cmp:thy:cmp: Theorem 30.12. Let A be any set of natural numbers. Then A is computable
thm:ce-comp
if and only if both A and A are computably enumerable.
content/computability/computability-theory/reducibility.tex
30.14 Reducibility
explanation We now know that there is at least one set, K0 , that is computably enumerable cmp:thy:red:
sec
but not computable. It should be clear that there are others. The method of
reducibility provides a powerful method of showing that other sets have these
properties, without constantly having to return to first principles.
Generally speaking, a “reduction” of a set A to a set B is a method of
transforming answers to whether or not elements are in B into answers as to
whether or not elements are in A. We will focus on a notion called “many-
one reducibility,” but there are many other notions of reducibility available,
with varying properties. Notions of reducibility are also central to the study
of computational complexity, where efficiency issues have to be considered as
well. For example, a set is said to be “NP-complete” if it is in NP and every
NP problem can be reduced to it, using a notion of reduction that is similar to
the one described below, only with the added requirement that the reduction
can be computed in polynomial time.
We have already used this notion implicitly. Define the set K by
K = {x : φx (x) ↓},
i.e., K = {x : x ∈ Wx }. Our proof that the halting problem in unsolvable,
Theorem 30.6, shows most directly that K is not computable. Recall that K0
is the set
K0 = {⟨e, x⟩ : φe (x) ↓}.
i.e. K0 = {⟨x, e⟩ : x ∈ We }. It is easy to extend any proof of the uncomputabil-
ity of K to the uncomputability of K0 : if K0 were computable, we could decide
whether or not an element x is in K simply by asking whether or not the pair
⟨x, x⟩ is in K0 . The function f which maps x to ⟨x, x⟩ is an example of a
reduction of K to K0 .
Definition 30.14. Let A and B be sets. Then A is said to be many-one
reducible to B, written A ≤m B, if there is a computable function f such that
for every natural number x,
x∈A if and only if f (x) ∈ B.
If A is many-one reducible to B and vice-versa, then A and B are said to be
many-one equivalent, written A ≡m B.
content/computability/computability-theory/prop-reduce.tex
cmp:thy:ppr: Proposition 30.16. Let A and B be any sets, and suppose A is many-one
prop:reduce
reducible to B.
1. If B is computably enumerable, so is A.
2. If B is computable, so is A.
Proof. Let f be a many-one reduction from A to B. For the first claim, just
check that if B is the domain of a partial function g, then A is the domain
of g ◦ f :
x ∈ Aiff f (x) ∈ B
iff g(f (x)) ↓ .
complexity, with the added requirement that the Turing machines run in poly-
nomial time: the complexity version of many-one reducibility is known as Karp
reducibility, while the complexity version of Turing reducibility is known as
Cook reducibility.
content/computability/computability-theory/complete-ce-sets.tex
B = We = {x : φe (x) ↓}.
Let f be the function f (x) = ⟨e, x⟩. Then for every natural number x, x ∈ B
if and only if f (x) ∈ K0 . In other words, f reduces B to K0 .
To see that K1 is complete, note that in the proof of Proposition 30.19 we
reduced K0 to it. So, by Proposition 30.15, any computably enumerable set
can be reduced to K1 as well.
K can be reduced to K0 in much the same way.
digression So, it turns out that all the examples of computably enumerable sets that
we have considered so far are either computable, or complete. This should
seem strange! Are there any examples of computably enumerable sets that
are neither computable nor complete? The answer is yes, but it wasn’t until
the middle of the 1950s that this was established by Friedberg and Muchnik,
independently.
content/computability/computability-theory/k-1.tex
content/computability/computability-theory/total.tex
Note that h(x, y) does not depend on y at all. It should not be hard to see that
h is partial computable: on input x, y, the we compute h by first simulating
the function φx on input x; if this computation halts, h(x, y) outputs 0 and
halts. So h(x, y) is just Z(µs T (x, x, s)), where Z is the constant zero function.
Using the s-m-n theorem, there is a primitive recursive function k(x) such
that for every x and y,
(
0 if x ∈ K
φk(x) (y) =
undefined otherwise
digression It turns out that Tot is not even computably enumerable—its complexity
lies further up on the “arithmetic hierarchy.” But we will not worry about this
strengthening here.
content/computability/computability-theory/rice-theorem.tex
An index set is a set A with the property that if n and m are indices which
“compute” the same function, then either both n and m are in A, or neither is.
It is not hard to see that the set A in the theorem has this property. Conversely,
if A is an index set and C is the set of functions computed by these indices,
then A = {n : φn ∈ C}.
With this terminology, Rice’s theorem is equivalent to saying that no non- explanation
trivial index set is decidable. To understand what the theorem says, it is helpful
to emphasize the distinction between programs (say, in your favorite program-
ming language) and the functions they compute. There are certainly questions
about programs (indices), which are syntactic objects, that are computable:
does this program have more than 150 symbols? Does it have more than 22
lines? Does it have a “while” statement? Does the string “hello world” every
appear in the argument to a “print” statement? Rice’s theorem says that no
nontrivial question about the program’s behavior is computable. This includes
questions like these: does the program halt on input 0? Does it ever halt?
Does it ever output an even number?
Proof of Rice’s theorem. Suppose C is neither ∅ nor the set of all the partial
computable functions, and let A be the set of indices of functions in C. We
will show that if A were computable, we could solve the halting problem; so
A is not computable.
Without loss of generality, we can assume that the function f which is
nowhere defined is not in C (otherwise, switch C and its complement in the
argument below). Let g be any function in C. The idea is that if we could
decide A, we could tell the difference between indices computing f , and in-
dices computing g; and then we could use that capability to solve the halting
problem.
Here’s how. Using the universal computation predicate, we can define a
function (
undefined if φx (x) ↑
h(x, y) ≃
g(y) otherwise.
where P02 (z0 , z1 ) = z0 is the 2-place projection function returning the 0-th
argument, which is computable.
Then h is a composition of partial computable functions, and the right side
is defined and equal to g(y) just when Un(x, x) and g(y) are both defined.
Notice that for a fixed x, if φx (x) is undefined, then h(x, y) is undefined for
every y; and if φx (x) is defined, then h(x, y) ≃ g(y). So, for any fixed value
of x, either h(x, y) acts just like f or it acts just like g, and deciding whether or
not φx (x) is defined amounts to deciding which of these two cases holds. But
content/computability/computability-theory/fixed-point-thm.tex
1. For every partial computable function g(x, y), there is an index e such
that for every y,
φe (y) ≃ g(e, y).
2. For every computable function f (x), there is an index e such that for
every y,
φe (y) ≃ φf (e) (y).
Proof. (1) ⇒ (2): Given f , define g by g(x, y) ≃ Un(f (x), y). Use (1) to get
an index e such that for every y,
(2) ⇒ (1): Given g, use the s-m-n theorem to get f such that for every x
and y, φf (x) (y) ≃ g(x, y). Use (2) to get an index e such that
Before showing that statement (1) is true (and hence (2) as well), consider explanation
how bizarre it is. Think of e as being a computer program; statement (1) says
that given any partial computable g(x, y), you can find a computer program
e that computes ge (y) ≃ g(e, y). In other words, you can find a computer
program that computes a function that references the program itself.
Theorem 30.24. The two statements in Lemma 30.23 are true. Specifically,
for every partial computable function g(x, y), there is an index e such that for
every y,
φe (y) ≃ g(e, y).
Proof. The ingredients are already implicit in the discussion of the halting
problem above. Let diag(x) be a computable function which for each x returns
an index for the function fx (y) ≃ φx (x, y), i.e.
and let ⌜l⌝ be an index for l. Finally, let e = diag(⌜l⌝). Then for every y, we
have
as required.
explanation What’s going on? Suppose you are given the task of writing a computer
program that prints itself out. Suppose further, however, that you are working
with a programming language with a rich and bizarre library of string functions.
In particular, suppose your programming language has a function diag which
works as follows: given an input string s, diag locates each instance of the
symbol ‘x’ occurring in s, and replaces it by a quoted version of the original
string. For example, given the string
hello x world
as output. In that case, it is easy to write the desired program; you can check
that
print(diag(’print(diag(x))’))
does the trick. For more common programming languages like C++ and Java,
the same idea (with a more involved implementation) still works.
We are only a couple of steps away from the proof of the fixed-point theo-
rem. Suppose a variant of the print function print(x, y) accepts a string x and
another numeric argument y, and prints the string x repeatedly, y times. Then
the “program”
getinput(y); print(diag(’getinput(y); print(diag(x), y)’), y)
prints itself out y times, on input y. Replacing the getinput—print—diag
skeleton by an arbitrary function g(x, y) yields
g(diag(’g(diag(x), y)’), y)
which is a program that, on input y, runs g on the program itself and y.
Thinking of “quoting” with “using an index for,” we have the proof above.
For now, it is o.k. if you want to think of the proof as formal trickery, or
black magic. But you should be able to reconstruct the details of the argument
given above. When we prove the incompleteness theorems (and the related
“fixed-point theorem”) we will discuss other ways of understanding why it
works.
The same idea can be used to get a “fixed point” combinator. Suppose you digression
have a lambda term g, and you want another term k with the property that k
is β-equivalent to gk. Define terms
diag(x) = xx
and
l(x) = g(diag(x))
using our notational conventions; in other words, l is the term λx. g(xx). Let
k be the term ll. Then we have
k = (λx. g(xx))(λx. g(xx))
→
−
→ g((λx. g(xx))(λx. g(xx)))
= gk.
If one takes
Y = λg. ((λx. g(xx))(λx. g(xx)))
then Y g and g(Y g) reduce to a common term; so Y g ≡β g(Y g). This is known
as “Curry’s combinator.” If instead one takes
Y = (λxg. g(xxg))(λxg. g(xxg))
then in fact Y g reduces to g(Y g), which is a stronger statement. This latter
version of Y is known as “Turing’s combinator.”
content/computability/computability-theory/application-fixed-point.tex
As another example, one can use the proof of the fixed-point theorem to design
a program in Java or C++ that prints itself out.
Remember that if for each e, we let We be the domain of φe , then the
sequence W0 , W1 , W2 , . . . enumerates the computably enumerable sets. Some
of these sets are computable. One can ask if there is an algorithm which takes
as input a value x, and, if Wx happens to be computable, returns an index for
its characteristic function. The answer is “no,” there is no such algorithm:
content/computability/computability-theory/def-functions-self-reference.tex
and then using the fixed-point lemma to find an index e such that φe (y) =
g(e, y).
For a concrete example, the “greatest common divisor” function gcd(u, v)
can be defined by
(
v if 0 = 0
gcd(u, v) ≃
gcd(mod(v, u), u) otherwise
content/computability/computability-theory/minimization-lambda.tex
g(x) ≃ µy f (x, y) = 0.
Proof. The idea is roughly as follows. Given x, we will use the fixed-point
lambda term Y to define a function hx (n) which searches for a y starting at n;
then g(x) is just hx (0). The function hx can be expressed as the solution of a
fixed-point equation:
(
n if f (x, n) = 0
hx (n) ≃
hx (n + 1) otherwise.
We can do this using the fixed-point term Y . First, let U be the term
and then let H be the term Y U . Notice that the only free variable in H is x.
Let us show that H satisfies the equation above.
By the definition of Y , we have
H = Y U ≡ U (Y U ) = U (H).
H(n) ≡ U (H, n)
→
−
→ D(n, H(S(n)), F (x, n)),
as required. Notice that if you substitute a numeral m for x in the last line,
the expression reduces to n if F (m, n) reduces to 0, and it reduces to H(S(n))
if F (m, n) reduces to any other numeral.
To finish off the proof, let G be λx. H(0). Then G represents g; in other
words, for every m, G(m) reduces to reduces to g(m), if g(m) is defined, and
has no normal form otherwise.
Turing Machines
Chapter 31
content/turing-machines/machines-computations/introduction.tex
31.1 Introduction
tur:mac:int: What does it mean for a function, say, from N to N to be computable? Among
sec
the first answers, and the most well known one, is that a function is computable
if it can be computed by a Turing machine. This notion was set out by Alan
Turing in 1936. Turing machines are an example of a model of computation—
they are a mathematically precise way of defining the idea of a “computational
procedure.” What exactly that means is debated, but it is widely agreed that
Turing machines are one way of specifying computational procedures. Even
though the term “Turing machine” evokes the image of a physical machine
with moving parts, strictly speaking a Turing machine is a purely mathematical
construct, and as such it idealizes the idea of a computational procedure. For
instance, we place no restriction on either the time or memory requirements
of a Turing machine: Turing machines can compute something even if the
computation would require more storage space or more steps than there are
atoms in the universe.
It is perhaps best to think of a Turing machine as a program for a special explanation
451
CHAPTER 31. TURING MACHINE COMPUTATIONS
of squares which contain the input. At any time, the mechanism is in one of a
finite number of states. At the outset, the head scans the leftmost square and
in a specified initial state. At each step of the mechanism’s run, the content
of the square currently scanned together with the state the mechanism is in
and the Turing machine program determine what happens next. The Turing
machine program is given by a partial function which takes as input a state q
and a symbol σ and outputs a triple ⟨q ′ , σ ′ , D⟩. Whenever the mechanism is in
state q and reads symbol σ, it replaces the symbol on the current square with
σ ′ , the head moves left, right, or stays put according to whether D is L, R, or
N , and the mechanism goes into state q ′ .
For instance, consider the situation in Figure 31.1. The visible part of the
tape of the Turing machine contains the end-of-tape symbol ▷ on the leftmost
square, followed by three 1’s, a 0, and four more 1’s. The head is reading the
third square from the left, which contains a 1, and is in state q1 —we say “the
machine is reading a 1 in state q1 .” If the program of the Turing machine
returns, for input ⟨q1 , 1⟩, the triple ⟨q2 , 0, N ⟩, the machine would now replace
the 1 on the third square with a 0, leave the read/write head where it is, and
switch to state q2 . If then the program returns ⟨q3 , 0, R⟩ for input ⟨q2 , 0⟩, the
machine would now overwrite the 0 with another 0 (effectively, leaving the
content of the tape under the read/write head unchanged), move one square
to the right, and enter state q3 . And so on.
We say that the machine halts when it encounters some state, qn , and sym-
bol, σ such that there is no instruction for ⟨qn , σ⟩, i.e., the transition function
for input ⟨qn , σ⟩ is undefined. In other words, the machine has no instruction
to carry out, and at that point, it ceases operation. Halting is sometimes rep-
resented by a specific halt state h. This will be demonstrated in more detail
later on.
digression The beauty of Turing’s paper, “On computable numbers,” is that he presents
not only a formal definition, but also an argument that the definition captures
the intuitive notion of computability. From the definition, it should be clear
that any function computable by a Turing machine is computable in the intu-
itive sense. Turing offers three types of argument that the converse is true, i.e.,
that any function that we would naturally regard as computable is computable
by such a machine. They are (in Turing’s words):
content/turing-machines/machines-computations/representing-tms.tex
0, 1, R
start q0 q1
Recall that the Turing machine has a read/write head and a tape with the
input written on it. The instruction can be read as if reading a 0 in state q0 ,
write a 1, move right, and move to state q1 . This is equivalent to the transition
function mapping ⟨q0 , 0⟩ to ⟨q1 , 1, R⟩.
Example 31.1. Even Machine: The following Turing machine halts if, and
only if, there are an even number of 1’s on the tape (under the assumption
that all 1’s come before the first 0 on the tape).
0, 0, R
1, 1, R
start q0 q1
1, 1, R
▷111100 . . .
The machine is now in state q0 scanning a 0. Based on the transition diagram,
we can easily see that there is no instruction to be carried out, and thus the
machine has halted. This means that the input has been accepted.
Suppose next we start the machine with an input of three 1’s. The first few
configurations are similar, as the same instructions are carried out, with only
a small difference of the tape input:
▷10 110 . . .
▷111 10 . . .
▷1110 0 . . .
▷11101 . . .
The machine has now traversed past all the 1’s, and is reading a 0 in state q1 . As
shown in the diagram, there is an instruction of the form δ(q1 , 0) = ⟨q1 , 0, R⟩.
Since the tape is filled with 0 indefinitely to the right, the machine will continue
to execute this instruction forever, staying in state q1 and moving ever further
to the right. The machine will never halt, and does not accept the input.
It is important to note that not all machines will halt. If halting means that explanation
the machine runs out of instructions to execute, then we can create a machine
that never halts simply by ensuring that there is an outgoing arrow for each
symbol at each state. The even machine can be modified to run indefinitely by
adding an instruction for scanning a 0 at q0 .
Example 31.2.
0, 0, R 0, 0, R
1, 1, R
start q0 q1
1, 1, R
Machine tables are another way of representing Turing machines. Machine explanation
tables have the tape alphabet displayed on the x-axis, and the set of machine
states across the y-axis. Inside the table, at the intersection of each state and
symbol, is written the rest of the instruction—the new state, new symbol, and
direction of movement. Machine tables make it easy to determine in what
state, and for what symbol, the machine halts. Whenever there is a gap in the
table is a possible point for the machine to halt. Unlike state diagrams and
instruction sets, where the points at which the machine halts are not always
immediately obvious, any halting points are quickly identified by finding the
gaps in the machine table.
1, 1, R 1, 1, R
1, 0, R 0, 0, R
start q0 q1 q2
0, 0, R 0, 1, R
q5 q4 q3
0, 0, L 1, 1, L
1, 1, L 1, 1, L 0, 1, L
explanation So far we have only considered machines that read and accept input. How-
ever, Turing machines have the capacity to both read and write. An example
of such a machine (although there are many, many examples) is a doubler. A
doubler, when started with a block of n 1’s on the tape, outputs a block of 2n
1’s.
Example 31.4. Before building a doubler machine, it is important to come tur:mac:rep:
ex:doubler
up with a strategy for solving the problem. Since the machine (as we have
formulated it) cannot remember how many 1’s it has read, we need to come
up with a way to keep track of all the 1’s on the tape. One such way is to
separate the output from the input with a 0. The machine can then erase the
first 1 from the input, traverse over the rest of the input, leave a 0, and write
two new 1’s. The machine will then go back and find the second 1 in the input,
and double that one as well. For each one 1 of input, it will write two 1’s of
output. By erasing the input as the machine goes, we can guarantee that no
1 is missed or doubled twice. When the entire input is erased, there will be
2n 1’s left on the tape. The state diagram of the resulting Turing machine is
depicted in Figure 31.2.
Problem 31.1. Choose an arbitrary input and trace through the configura-
tions of the doubler machine in Example 31.4.
content/turing-machines/machines-computations/turing-machines.tex
3. an initial state q0 ∈ Q,
explanation We assume that the tape is infinite in one direction only. For this reason
it is useful to designate a special symbol ▷ as a marker for the left end of the
tape. This makes it easier for Turing machine programs to tell when they’re
“in danger” of running off the tape. We could assume that this symbol is never
overwritten, i.e., that δ(q, ▷) = ⟨q ′ , ▷, x⟩ if δ(q, ▷) is defined. Some textbooks
do this, we do not. You can simply be careful when constructing your Turing
machine that it never overwrites ▷. Moreover, there are cases where allowing
such overwriting provides some convenient flexibility.
Example 31.6. Even Machine: The even machine is formally the quadruple
⟨Q, Σ, q0 , δ⟩ where
Q = {q0 , q1 }
Σ = {▷, 0, 1},
δ(q0 , 1) = ⟨q1 , 1, R⟩,
δ(q1 , 1) = ⟨q0 , 1, R⟩,
δ(q1 , 0) = ⟨q1 , 0, R⟩.
content/turing-machines/machines-computations/configuration.tex
3. q ∈ Q
Intuitively, the sequence C is the content of the tape (symbols of all squares
from the leftmost square to the last non-blank or previously visited square),
m is the number of the square the read/write head is scanning (beginning with
0 being the number of the leftmost square), and q is the current state of the
machine.
The potential input for a Turing machine is a sequence of symbols, usually explanation
other than 0, or, if at time k the entire tape is filled with 0 (except for the
leftmost ▷), O is the empty string.
content/turing-machines/machines-computations/unary-numbers.tex
1, 1, R 1, 1, R 1, 0, N
0, 1, N 0, 0, L
start q0 q1 q2
Problem 31.6. Give a definition for when a Turing machine M computes the
function f : Nk → Nm .
Example 31.12. Addition: Let’s build a machine that computes the function tur:mac:una:
ex:adder
f (n, m) = n + m. This requires a machine that starts with two blocks of 1’s of
length n and m on the tape, and halts with one block consisting of n + m 1’s.
The two input blocks of 1’s are separated by a 0, so one method would be to
write a stroke on the square containing the 0, and erase the last 1.
Problem 31.7. Trace through the configurations of the machine from Exam-
ple 31.12 for input ⟨3, 2⟩. What happens if the machine computes 0 + 0?
1, 1, R 1, 1, L
0, 1, L
q2 q3
q6
0, 0, R 0, 0, L
R
1,
0,
0, 1, R
1, 1, R q1 q4
q7 1, 1, R
1, 0, R 1, 1, L
0, 0, L
start q0 q5
0, 1, R
q8 1, 0, N
1, 1, L
0, 0, R 1, 1, R
0, 0, R 1, 1, R
start q6 q7 q8
0, 0, L 0, ▷, L
1, 0, L
q11 q10 q9 1, 1, L
0, 0, R
1,
▷, ▷, R 0,
L
1, 1, R
0, 1, R ▷, 0, N
q12 q13 q14
0, 0, R
where n and m ∈ Z+ .
The function min selects the smallest value from its arguments, so min(3, 5) =
3, min(20, 16) = 16, and min(4, 4) = 4, and so on.
2. M does not halt at all, or with an output that is not a single block of 1’s
if f (n1 , . . . , nk ) is undefined.
content/turing-machines/machines-computations/halting-states.tex
Example 31.16. Halting States. To elucidate this concept, let us begin with
an alteration of the even machine. Instead of having the machine halt in
state q0 if the input is even, we can add an instruction to send the machine
into a halting state.
0, 0, R
1, 1, R
start q0 q1
1, 1, R
0, 0, N
Let us further expand the example. When the machine determines that
the input is odd, it never halts. We can alter the machine to include a reject
start q0 q1
1, 1, R
0, 0, N 0, 0, N
h r
explanation Adding a dedicated halting state can be advantageous in cases like this,
where it makes explicit when the machine accepts/rejects certain inputs. How-
ever, it is important to note that no computing power is gained by adding
a dedicated halting state. Similarly, a less formal notion of halting has its
own advantages. The definition of halting used so far in this chapter makes
the proof of the Halting Problem intuitive and easy to demonstrate. For this
reason, we continue with our original definition.
content/turing-machines/machines-computations/disciplined-machines.tex
0, 1, N
start q0 q1
0, 0, L
1, 1, R 1, 1, R
q2
1, 1, L
1, 0, L
h q3
▷, ▷, R
We have already discussed that any Turing machine can be changed into explanation
one with the same behavior but with a designated halting state. This is done
simply by adding a new state h, and adding an instruction δ(q, σ) = ⟨h, σ, N ⟩
for any pair ⟨q, σ⟩ where the original δ is undefined. It is true, although tedious
to prove, that any Turing machine M can be turned into a disciplined Turing
machine M ′ which halts on the same inputs and produces the same output.
For instance, if the Turing machine halts and is not on square 1, we can add
some instructions to make the head move left until it finds the tape-end marker,
then move one square to the right, then halt. We’ll leave you to think about
how the other conditions can be dealt with.
Example 31.18. In Figure 31.6, we turn the addition machine from Exam-
ple 31.12 into a disciplined machine.
tur:mac:dis: Proposition 31.19. For every Turing machine M , there is a disciplined Tur-
prop:disciplined
ing machine M ′ which halts with output O if M halts with output O, and does
not halt if M does not halt. In particular, any function f : Nn → N computable
by a Turing machine is also computable by a disciplined Turing machine.
content/turing-machines/machines-computations/combining-machines.tex
the doubler. We begin by drawing a state diagram for the addition machine.
1, 1, R 1, 1, R 1, 0, N
0, 1, N 0, 0, L
start q0 q1 q2
0, 1, N 0, 0, L
start q0 q1 q2
1, 0, L
1, 1, L q3
▷, ▷, R
q4
content/turing-machines/machines-computations/variants.tex
1, 1, R 1, 1, R
0, 1, N 0, 0, L
start q0 q1 q2
1, 0, L
1, 1, L q3
1, 1, R 1, 1, R
▷, ▷, R
1, 0, R 0, 0, R
q4 q5 q6
0, 0, R 0, 1, R
q9 q8 q7
0, 0, L 1, 1, L
1, 1, L 1, 1, L 0, 1, L
what the new symbol, state, and tape head position is. But if we allow the
instruction set to be a relation between current state-symbol pairs ⟨q, σ⟩ and
new state-symbol-direction triples ⟨q ′ , σ ′ , D⟩, the action of the Turing machine
may not be uniquely determined—the instruction relation may contain both
⟨q, σ, q ′ , σ ′ , D⟩ and ⟨q, σ, q ′′ , σ ′′ , D′ ⟩. In this case we have a non-deterministic
Turing machine. These play an important role in computational complexity
theory.
There are also different conventions for when a Turing machine halts: we
say it halts when the transition function is undefined, other definitions require
the machine to be in a special designated halting state. We have explained in
section 31.6 why requiring a designated halting state is not a restriction which
impacts what Turing machines can compute. Since the tapes of our Turing
machines are infinite in one direction only, there are cases where a Turing
machine can’t properly carry out an instruction: if it reads the leftmost square
and is supposed to move left. According to our definition, it just stays put
instead of “falling off”, but we could have defined it so that it halts when that
happens. This definition is also equivalent: we could simulate the behavior
of a Turing machine that halts when it attempts to move left from square 0
by deleting every transition δ(q, ▷) = ⟨q ′ , σ, L⟩—then instead of attempting to
move left on ▷ the machine halts.1
There are also different ways of representing numbers (and hence the input-
output function computed by a Turing machine): we use unary representation,
but you can also use binary representation. This requires two symbols in
addition to 0 and ▷.
Now here is an interesting fact: none of these variations matters as to which
functions are Turing computable. If a function is Turing computable according
to one definition, it is Turing computable according to all of them.
We won’t go into the details of verifying this. Here’s just one example: we
gain no additional computing power by allowing a tape that is infinite in both
directions, or multiple tapes. The reason is, roughly, that a Turing machine
with a single one-way infinite tape can simulate multiple or two-way infinite
tapes. E.g., using additional states and instructions, we can “translate” a
program for a machine with multiple tapes or two-way infinite tape into one
with a single one-way infinite tape. The translated machine can use the even
squares for the squares of tape 1 (or the “positive” squares of a two-way infinite
tape) and the odd squares for the squares of tape 2 (or the “negative” squares).
content/turing-machines/machines-computations/church-turing-thesis.tex
other than square 0 (see Example 31.14). We can get around that by adding a second ▷′
symbol to use instead for such a purpose.
Chapter 32
Undecidability
content/turing-machines/undecidability/introduction.tex
470
32.1. INTRODUCTION
32.1 Introduction
tur:und:int: It might seem obvious that not every function, even every arithmetical func-
sec
tion, can be computable. There are just too many, whose behavior is too
complicated. Functions defined from the decay of radioactive particles, for
instance, or other chaotic or random behavior. Suppose we start counting 1-
second intervals from a given time, and define the function f (n) as the number
of particles in the universe that decay in the n-th 1-second interval after that
initial moment. This seems like a candidate for a function we cannot ever hope
to compute.
But it is one thing to not be able to imagine how one would compute such
functions, and quite another to actually prove that they are uncomputable.
In fact, even functions that seem hopelessly complicated may, in an abstract
sense, be computable. For instance, suppose the universe is finite in time—
some day, in the very distant future the universe will contract into a single
point, as some cosmological theories predict. Then there is only a finite (but
incredibly large) number of seconds from that initial moment for which f (n)
is defined. And any function which is defined for only finitely many inputs is
computable: we could list the outputs in one big table, or code it in one very
big Turing machine state transition diagram.
We are often interested in special cases of functions whose values give the
answers to yes/no questions. For instance, the question “is n a prime number?”
is associated with the function
(
1 if n is prime
isprime(n) =
0 otherwise.
We can also define specific functions and problems which we can prove to be
uncomputable and undecidable, respectively. One such problem is the so-called
Halting Problem. Turing machines can be finitely described by listing their
instructions. Such a description of a Turing machine, i.e., a Turing machine
program, can of course be used as input to another Turing machine. So we can
consider Turing machines that decide questions about other Turing machines.
One particularly interesting question is this: “Does the given Turing machine
eventually halt when started on input n?” It would be nice if there were a
Turing machine that could decide this question: think of it as a quality-control
Turing machine which ensures that Turing machines don’t get caught in infinite
loops and such. The interesting fact, which Turing proved, is that there cannot
be such a Turing machine. There cannot be a single Turing machine which,
when started on input consisting of a description of a Turing machine M and
some number n, will always halt with either output 1 or 0 according to whether
M machine would have halted when started on input n or not.
Once we have examples of specific undecidable problems we can use them to
show that other problems are undecidable, too. For instance, one celebrated un-
decidable problem is the question, “Is the first-order formula φ valid?”. There is
no Turing machine which, given as input a first-order formula φ, is guaranteed
to halt with output 1 or 0 according to whether φ is valid or not. Historically,
the question of finding a procedure to effectively solve this problem was called
simply “the” decision problem; and so we say that the decision problem is un-
solvable. Turing and Church proved this result independently at around the
same time, so it is also called the Church–Turing Theorem.
content/turing-machines/undecidability/enumerating-tms.tex
0, 0, R
1, 1, R
start q0 q1
1, 1, R
0, 0, R
A, A, R
start s h
A, A, R
2, 2, R
3, 3, R
start 1 2
3, 3, R
finite, since Q and Σ are finite. So the information in δ is simply the finite list
of all 5-tuples ⟨q, σ, q ′ , σ ′ , d⟩ where δ(q, σ) = ⟨q ′ , σ ′ , D⟩, and d is a number that
codes the direction D (say, 1 for L, 2 for R, and 3 for N ).
In this way, every standard Turing machine can be described by a finite list
of positive integers, i.e., as a sequence sM ∈ (Z+ )∗ . For instance, the standard
Even machine is coded by the sequence
Σ δ(2,2)=⟨2,2,R⟩
z }| { z }| {
2, 1, 2 , 3, 1, 2, 3, 1, 1, 3, 2, 3, 2 , 2, 2, 2, 2, 2 , 2, 3, 1, 3, 2 .
|{z} | {z } | {z }
Q δ(1,3)=⟨2,3,R⟩ δ(2,3)=⟨1,3,R⟩
Theorem 32.1. There are functions from N to N which are not Turing com-
putable.
Proof. We know that the set of finite sequences of positive integers (Z+ )∗ is
enumerable (Problem 4.7). This gives us that the set of descriptions of stan-
dard Turing machines, as a subset of (Z+ )∗ , is itself enumerable. Every Turing
computable function N to N is computed by some (in fact, many) Turing ma-
chines. By renaming its states and symbols to positive integers (in particular,
▷ as 1, 0 as 2, and 1 as 3) we can see that every Turing computable function is
computed by a standard Turing machine. This means that the set of all Turing
computable functions from N to N is also enumerable.
On the other hand, the set of all functions from N to N is not enumerable
(Problem 4.35). If all functions were computable by some Turing machine, we
could enumerate the set of all functions by listing all the descriptions of Turing
machines that compute them. So there are some functions that are not Turing
computable.
Problem 32.1. Can you think of a way to describe Turing machines that does
not require that the states and alphabet symbols are explicitly listed? You may
define your own notion of “standard” machine, but say something about why
every Turing machine can be computed by a “standard” machine in your new
sense.
content/turing-machines/undecidability/universal-tm.tex
Turing machines. If we fix one such enumeration, it now makes sense to talk
of the 1st, 2nd, . . . , eth Turing machine. These numbers are called indices.
Definition 32.2. If M is the eth Turing machine (in our fixed enumeration),
we say that e is an index of M . We write Me for the eth Turing machine.
A machine may have more than one index, e.g., two descriptions of M
may differ in the order in which we list its instructions, and these different
descriptions will have different indices.
Importantly, it is possible to give the enumeration of Turing machine de-
scriptions in such a way that we can effectively compute the description of M
from its index, and to effectively compute an index of a machine M from its
description. By the Church–Turing thesis, it is then possible to find a Turing
machine which recovers the description of the Turing machine with index e
and writes the corresponding description on its tape as output. The descrip-
tion would be a sequence of blocks of 1’s (representing the positive integers in
the sequence describing Me ).
Given this, it now becomes natural to ask: what functions of Turing machine
indices are themselves computable by Turing machines? What properties of
Turing machine indices can be decided by Turing machines? An example: the
function that maps an index e to the number of states the Turing machine with
index e has, is computable by a Turing machine. Here’s what such a Turing
machine would do: started on a tape containing a single block of e 1’s, it
would first decode e into its description. The description is now represented by
a sequence of blocks of 1’s on the tape. Since the first element in this sequence
is the number of states. So all that has to be done now is to erase everything
but the first block of 1’s and then halt.
A remarkable result is the following:
tur:und:uni: Theorem 32.3. There is a universal Turing machine U which, when started
thm:universal-tm
on input ⟨e, n⟩
1. halts iff Me halts on input n, and
2. if Me halts with output m, so does U .
U thus computes the function f : N × N →
7 N given by f (e, n) = m if Me started
on input n halts with output m, and undefined otherwise.
1’s (remember, the number of the 1 symbol is 3, 1 being the number of ▷ and
2 being the number of 0). At the left end of this sequence of blocks (separated
by 0 symbols on the tape of U ), it writes a single 1, the code for ▷.
U now has on its tape: the index e, the number n, the code number of the
start state (the “current state”), the number of the initial head position 1 (the
“current head position”), and the initial contents of the “tape” (a sequence
of blocks of 1’s representing the code numbers of the symbols of Me —the
“symbols”—separated by 0’s).
It now simulates what Me would do if started on input n, by doing the
following:
1. Find the number k of the “current head position” (at the beginning,
that’s 1),
2. Move to the kth block in the “tape” to see what the “symbol” there is,
3. Find the instruction matching the current “state” and “symbol,” tur:und:uni:
find-inst
4. Move back to the kth block on the “tape” and replace the “symbol” there
with the code number of the symbol Me would write,
5. Move the head to where it records the current “state” and replace the
number there with the number of the new state,
6. Move to the place where it records the “tape position” and erase a 1 or
add a 1 (if the instruction says to move left or right, respectively).
7. Repeat.2
If Me started on input n never halts, then U also never halts, so its output is
undefined.
If in step (3) it turns out that the description of Me contains no instruction
for the current “state”/“symbol” pair, then Me would halt. If this happens, U
erases the part of its tape to the left of the “tape.” For each block of three 1’s
(representing a 1 on Me ’s tape), it writes a 1 on the left end of its own tape,
and successively erases the “tape.” When this is done, U ’s tape contains a
single block of 1’s of length m.
If U encounters something other than a block of three 1’s on the “tape,” it
immediately halts. Since U ’s tape in this case does not contain a single block
of 1’s, its output is not a natural number, i.e., f (e, n) is undefined in this case.
content/turing-machines/undecidability/halting-problem.tex
2 We’re glossing over some subtle difficulties here. E.g., U may need some extra space
when it increases the counter where it keeps track of the “current head position”—in that
case it will have to move the entire “tape” to the right.
tion, s, is not Turing-computable. This proof relies on the fact that anything
that can be computed by a Turing machine can be computed by a disciplined
Turing machine (section 31.7), and the fact that two Turing machines can be
hooked together to create a single machine (section 31.8).
Problem 32.2. The Three Halting (3-Halt) problem is the problem of giving
a decision procedure to determine whether or not an arbitrarily chosen Turing
Machine halts for an input of three 1’s on an otherwise blank tape. Prove that
the 3-Halt problem is unsolvable.
Problem 32.3. Show that if the halting problem is solvable for Turing ma-
chine and input pairs Me and n where e ̸= n, then it is also solvable for the
cases where e = n.
Problem 32.4. We proved that the halting problem is unsolvable if the input
is a number e, which identifies a Turing machine Me via an enumeration of all
Turing machines. What if we allow the description of Turing machines from
section 32.2 directly as input? Can there be a Turing machine which decides
the halting problem but takes as input descriptions of Turing machines rather
than indices? Explain why or why not.
is Turing computable.
content/turing-machines/undecidability/decision-problem.tex
The bulk of our proof will consist in describing these sentences τ (M, w) and α(M, w)
and in verifying that τ (M, w) → α(M, w) is valid iff M halts on input w.
content/turing-machines/undecidability/representing-tms.tex
In order to express the positions of the tape head and the number of steps
executed, we need a way to express numbers. This is done using a constant
symbol 0, and a 1-place function ′, the successor function. By convention it is
written after its argument (and we leave out the parentheses).
For each number n there is a canonical term n, the numeral for n, which
represents it in LM . 0 is 0, 1 is 0′ , 2 is 0′′ , and so on. More formally:
0=0
n + 1 = n′
The term 0, i.e., 0 names the leftmost position on the tape as well as the time
before the first execution step (the initial configuration). The term 1, i.e., 0′
names the square to the right of the leftmost square, and the time after the
first execution step, and so on.
We also introduce a predicate symbol < to express both the ordering of
tape positions (when it means “to the left of”) and execution steps (then it
means “before”).
Once we have the language in place, we list the “axioms” of τ (M, w), i.e.,
the sentences which, taken together, describe the behavior of M when run on
input w. There will be sentences which lay down conditions on 0, ′, and <,
sentences that describes the input configuration, and sentences that describe
what the configuration of M is after it executes a particular instruction.
Definition 32.9. Given a Turing machine M = ⟨Q, Σ, q0 , δ⟩, the language LM tur:und:rep:
defn:tm-descr
consists of:
3. A constant symbol 0
a) A sentence that says that every number is less than its successor:
∀x x < x′
This says that if, after y steps, the machine is in state qi scanning
square x which contains symbol σ, then after y+1 steps it is scanning
square x+1, is in state qj , square x now contains σ ′ , and every square
other than x contains the same symbol as it did after y steps.
tur:und:rep: b) For every instruction δ(qi , σ) = ⟨qj , σ ′ , L⟩, the sentence:
rep-left
Take a moment to think about how this works: now we don’t start
with “if scanning square x . . . ” but: “if scanning square x+1 . . . ” A
move to the left means that in the next step the machine is scanning
square x. But the square that is written on is x + 1. We do it this
way since we don’t have subtraction or a predecessor function.
Let τ (M, w) be the conjunction of all the above sentences for Turing machine M
and input w.
In order to express that M eventually halts, we have to find a sentence that
says “after some number of steps, the transition function will be undefined.”
Let X be the set of all pairs ⟨q, σ⟩ such that δ(q, σ) is undefined. Let α(M, w)
then be the sentence
_
∃x ∃y ( (Qq (x, y) ∧ Sσ (x, y)))
⟨q,σ⟩∈X
∃x ∃y Qh (x, y)
Proof. Exercise.
content/turing-machines/undecidability/verification.tex
The strategy for proving these is very different. For the first result, we have
to show that a sentence of first-order logic (namely, τ (M, w) → α(M, w)) is
valid. The easiest way to do this is to give a derivation. Our proof is supposed
to work for all M and w, though, so there isn’t really a single sentence for which
we have to give a derivation, but infinitely many. So the best we can do is to
prove by induction that, whatever M and w look like, and however many steps
it takes M to halt on input w, there will be a derivation of τ (M, w) → α(M, w).
Naturally, our induction will proceed on the number of steps M takes before
it reaches a halting configuration. In our inductive proof, we’ll establish that
for each step n of the run of M on input w, τ (M, w) ⊨ χ(M, w, n), where
χ(M, w, n) correctly describes the configuration of M run on w after n steps.
Now if M halts on input w after, say, n steps, χ(M, w, n) will describe a
halting configuration. We’ll also show that χ(M, w, n) ⊨ α(M, w), whenever
χ(M, w, n) describes a halting configuration. So, if M halts on input w, then for
some n, M will be in a halting configuration after n steps. Hence, τ (M, w) ⊨
χ(M, w, n) where χ(M, w, n) describes a halting configuration, and since in
that case χ(M, w, n) ⊨ α(M, w), we get that T (M, w) ⊨ α(M, w), i.e., that
⊨ τ (M, w) → α(M, w).
The strategy for the converse is very different. Here we assume that ⊨
τ (M, w) → α(M, w) and have to prove that M halts on input w. From the hy-
pothesis we get that τ (M, w) ⊨ α(M, w), i.e., α(M, w) is true in every structure
in which τ (M, w) is true. So we’ll describe a structure M in which τ (M, w)
is true: its domain will be N, and the interpretation of all the Qq and Sσ
will be given by the configurations of M during a run on input w. So, e.g.,
M ⊨ Qq (m, n) iff T , when run on input w for n steps, is in state q and scanning
square m. Now since τ (M, w) ⊨ α(M, w) by hypothesis, and since M ⊨ τ (M, w)
by construction, M ⊨ α(M, w). But M ⊨ α(M, w) iff there is some n ∈ |M| = N
so that M , run on input w, is in a halting configuration after n steps.
Proof. Suppose that M halts for input w after n steps. There is some state q,
square m, and symbol σ such that:
χ(M, w, n) is the description of this configuration and will include the clauses
Qq (m, n) and Sσ (m, n). These clauses together imply α(M, w):
_
∃x ∃y ( (Qq (x, y) ∧ Sσ (x, y)))
⟨q,σ⟩∈X
as ⟨q ′ , σ ′ ⟩ ∈ X.
W
since Qq′ (m, n) ∧ Sσ′ (m, n) ⊨ ⟨q,σ⟩∈X (Qq (m, n) ∧ Sσ (m, n)),
explanation So if M halts for input w, then there is some n such that χ(M, w, n) ⊨
α(M, w). We will now show that for any time n, τ (M, w) ⊨ χ(M, w, n).
Lemma 32.13. For each n, if M has not halted after n steps, τ (M, w) ⊨ tur:und:ver:
lem:config
χ(M, w, n).
1. δ(q, σ) = ⟨q ′ , σ ′ , R⟩ tur:und:ver:
right
2. δ(q, σ) = ⟨q ′ , σ ′ , L⟩ tur:und:ver:
left
3. δ(q, σ) = ⟨q ′ , σ ′ , N ⟩ tur:und:ver:
stay
Qq (m, n) ∧ Sσ (m, n)
We now get
as follows: The first line comes directly from the consequent of the pre-
ceding conditional, by modus ponens. Each conjunct in the middle
line—which excludes Sσm (m, n′ )—follows from the corresponding con-
junct in χ(M, w, n) together with φ(m, n).
If m < k, τ (M, w) ⊢ m < k (Proposition 32.10) and by transitivity of <,
we have ∀x (k < x → m < x). If m = k, then ∀x (k < x → m < x) by
logic alone. The last line then follows from the corresponding conjunct
in χ(M, w, n), ∀x (k < x → m < x), and φ(m, n). If m < k, this already
is χ(M, w, n + 1).
Now suppose m = k. In that case, after n + 1 steps, the tape head has
also visited square k + 1, which now is the right-most square visited. So
′
χ(M, w, n + 1) has a new conjunct, S0 (k , n′ ), and the last conjunct is
′
∀x (k < x → S0 (x, n′ )). We have to verify that these two sentences are
also implied.
We already have ∀x (k < x → S0 (x, n′ )). In particular, this gives us
′ ′ ′
k < k → S0 (k , n′ ). From the axiom ∀x x < x′ we get k < k . By modus
′
ponens, S0 (k , n′ ) follows.
′
Also, since τ (M, w) ⊢ k < k , the axiom for transitivity of < gives us
′
∀x (k < x → S0 (x, n′ )). (We leave the verification of this as an exercise.)
2. Suppose there is an instruction of the form (2). Then, by Definition 32.9(3b),
′
as before. (Note that in the first case, l ≡ l + 1 ≡ m and in the second
case l ≡ 0.) But this just is χ(M, w, n + 1).
Problem 32.8. Give a derivation of Sσi (i, n′ ) from Sσi (i, n) and φ(m, n) (as-
suming i ̸= m, i.e., either i < m or m < i).
′
Problem 32.9. Give a derivation of ∀x (k < x → S0 (x, n′ )) from ∀x (k <
x → S0 (x, n′ )), ∀x x < x′ , and ∀x ∀y ∀z ((x < y ∧ y < z) → x < z).)
Proof. By Lemma 32.13, we know that, for any time n, the description χ(M, w, n)
of the configuration of M at time n is entailed by τ (M, w). Suppose M halts af-
ter k steps. At that point, it will be scanning square m, for some m ∈ N. Then
χ(M, w, k) describes a halting configuration of M , i.e., it contains as conjuncts
both Qq (m, k) and Sσ (m, k) with δ(q, σ) undefined. Thus, by Lemma 32.12,
χ(M, w, k) ⊨ α(M, w). But since τ (M, w) ⊨ χ(M, w, k), we have τ (M, w) ⊨
α(M, w) and therefore τ (M, w) → α(M, w) is valid.
explanation To complete the verification of our claim, we also have to establish the
reverse direction: if τ (M, w) → α(M, w) is valid, then M does in fact halt when
started on input w.
content/turing-machines/undecidability/unsolvability-decision-problem.tex
Proof. Suppose the decision problem were solvable, i.e., suppose there were a
Turing machine D. Then we could solve the halting problem as follows. We
construct a Turing machine E that, given as input the number e of Turing
machine Me and input w, computes the corresponding sentence τ (Me , w) →
α(Me , w) and halts, scanning the leftmost square on the tape. The machine
E ⌢ D would then, given input e and w, first compute τ (Me , w) → α(Me , w)
and then run the decision problem machine D on that input. D halts with out-
put 1 iff τ (Me , w)→α(Me , w) is valid and outputs 0 otherwise. By Lemma 32.15
and Lemma 32.14, τ (Me , w) → α(Me , w) is valid iff Me halts on input w. Thus,
E ⌢ D, given input e and w halts with output 1 iff Me halts on input w and
halts with output 0 otherwise. In other words, E ⌢ D would solve the halting
problem. But we know, by Theorem 32.8, that no such Turing machine can
exist.
explanation So there is no Turing machine which always gives a correct “yes” or “no”
answer to the question “Is ψ a valid sentence of first-order logic?” However,
there is a Turing machine that always gives a correct “yes” answer—but simply
does not halt if the answer is “no.” This follows from the soundness and
completeness theorem of first-order logic, and the fact that derivations can be
effectively enumerated.
Proof. All possible derivations of first-order logic can be generated, one after
another, by an effective algorithm. The machine E does this, and when it finds
a derivation that shows that ⊢ ψ, it halts with output 1. By the soundness
theorem, if E halts with output 1, it’s because ⊨ ψ. By the completeness the-
orem, if ⊨ ψ there is a derivation that shows that ⊢ ψ. Since E systematically
generates all possible derivations, it will eventually find one that shows ⊢ ψ, so
will eventually halt with output 1.
content/turing-machines/undecidability/trakhtenbrot.tex
satisfiable in a finite structure (or valid in all finite structures). We can adapt
the proof of the unsolvability of the decision problem so that it shows this is
not the case.
First, if you go back to the proof of Lemma 32.15, you’ll see that what
we did there is produce a model M of τ (M, w) which describes exactly what
machine M does when started on input w. The domain of that model was N,
i.e., infinite. But if M actually halts on input w, we can build a finite model M′
in the same way. Suppose M started on input w halts after k steps. Take as
domain |M′ | the set {0, . . . , n}, where n is the larger of k and the length of w,
and let (
M′ x + 1 if x < n
′ (x) =
n otherwise,
′
and ⟨x, y⟩ ∈ <M iff x < y or x = y = n. Otherwise M′ is defined just like M.
By the definition of M′ , just like in the proof of Lemma 32.15, M′ ⊨ τ (M, w).
And since we assumed that M halts on input w, M′ ⊨ α(M, w). So, M′ is a
finite model of τ (M, w) ∧ α(M, w) (note that we’ve replaced → with ∧).
We are halfway to a proof: we’ve shown that if M halts on input w, then
τ (M, w) ∧ α(M, w) has a finite model. Unfortunately, the converse of this does
not hold, i.e., there are Turing machines that don’t halt on some input w,
but τ (M, w) ∧ α(M, w) still has a finite model. For instance, consider the ma-
chine M with the single state q0 and instruction δ(q0 , 0) = ⟨q0 , 0, N ⟩. Started
on empty input w = Λ, this machine never halts: it is in an infinite loop, but
does not change the tape or move the head. All configurations are the same
(same state, same head position, same tape contents). We can define a finite
structure M′′ that satisfies τ (M, Λ) ∧ α(M, Λ) (exercise). We can, however,
change τ (M, w) in a suitable way so that such structures are ruled out.
Problem 32.10. Let M be a Turing machine with the single state q0 and
′′ ′
single instruction δ(q0 , 0) = ⟨q, 0, N ⟩. Let |M′′ | = {0, 1, 2}, ′M (0) = ′M (1) =
′′ ′′ ′′ ′′
1 and ′M (2) = 2, and <M = {⟨0, 1⟩, ⟨1, 1⟩, ⟨2, 2⟩}. Define QM M
q0 , S0 , and
M′′
S▷ so that τ (M, Λ) and α(M, Λ) become true and explain why they are.
Hint: Observe that δ(q0 , ▷) is undefined. Ensure that
As you can see, the sentences describing the transitions of M are the
same as the corresponding sentence in τ (M, w), except we add ψ(y ′ ) at
the end. ψ(y ′ ) ensures that the number y ′ of the “next” configuration is
different from all previous numbers 0, 0′ , . . . .
Let τ ′ (M, w) be the conjunction of all the above sentences for Turing ma-
chine M and input w.
Lemma 32.19. If M started on input w halts, then τ ′ (M, w) ∧ α(M, w) has tur:und:tra:
lem:halts-sat
a finite model.
where n = max(k, len(w)) and k is the least number such that M started
on input w has halted after k steps. We leave the verification that M′ ⊨
τ ′ (M, w) ∧ E(M, w) as an exercise.
tur:und:tra: Lemma 32.20. If τ ′ (M, w) ∧ α(M, w) has a finite model, then M started on
lem:sat-halts
input w halts.
Proof. Suppose there were a Turing machine F that decides the finite satis-
fiability problem. Then given any Turing machine M and input w, we could
compute the sentence τ ′ (M, w) ∧ α(M, w), and use F to decide if it has a finite
model. By Lemmata 32.19 and 32.20, it does iff M started on input w halts.
So we could use F to solve the halting problem, which we know is unsolvable.
tur:und:tra: Corollary 32.22. There can be no derivation system that is sound and com-
cor:fproof-incomp
plete for finite validity, i.e., a derivation system which has ⊢ ψ iff M ⊨ ψ for
every finite structure M.
Proof. Exercise.
Incompleteness
Material in this part covers the incompleteness theorems. It depends
on material in the parts on first-order logic (esp., the proof system), the
material on recursive functions (in the computability part). It is based on
Jeremy Avigad’s notes with revisions by Richard Zach.
Chapter 33
Introduction to Incompleteness
content/incompleteness/introduction/historical-background.tex
492
33.1. HISTORICAL BACKGROUND
was perfect and in no need of revision. But the theory of the syllogism is far
too limited to model anything but the most superficial aspects of mathematical
reasoning. A century earlier, Leibniz, a contemporary of Newton’s, imagined
a complete “calculus” for logical reasoning, and made some rudimentary steps
towards designing such a calculus, essentially describing a version of proposi-
tional logic.
The nineteenth century was a watershed for logic. In 1854 George Boole
wrote The Laws of Thought, with a thorough algebraic study of propositional
logic that is not far from modern presentations. In 1879 Gottlob Frege pub-
lished his Begriffsschrift (Concept writing) which extends propositional logic
with quantifiers and relations, and thus includes first-order logic. In fact,
Frege’s logical systems included higher-order logic as well, and more. In his
Basic Laws of Arithmetic, Frege set out to show that all of arithmetic could
be derived in his Begriffsschrift from purely logical assumption. Unfortunately,
these assumptions turned out to be inconsistent, as Russell showed in 1902.
But setting aside the inconsistent axiom, Frege more or less invented modern
logic singlehandedly, a startling achievement. Quantificational logic was also
developed independently by algebraically-minded thinkers after Boole, includ-
ing Peirce and Schröder.
Let us now turn to developments in the foundations of mathematics. Of
course, since logic plays an important role in mathematics, there is a good
deal of interaction with the developments just described. For example, Frege
developed his logic with the explicit purpose of showing that all of mathematics
could be based solely on his logical framework; in particular, he wished to show
that mathematics consists of a priori analytic truths instead of, as Kant had
maintained, a priori synthetic ones.
Many take the birth of mathematics proper to have occurred with the
Greeks. Euclid’s Elements, written around 300 B.C., is already a mature repre-
sentative of Greek mathematics, with its emphasis on rigor and precision. The
definitions and proofs in Euclid’s Elements survive more or less intact in high
school geometry textbooks today (to the extent that geometry is still taught
in high schools). This model of mathematical reasoning has been held to be a
paradigm for rigorous argumentation not only in mathematics but in branches
of philosophy as well. (Spinoza even presented moral and religious arguments
in the Euclidean style, which is strange to see!)
Calculus was invented by Newton and Leibniz in the seventeenth century.
(A fierce priority dispute raged for centuries, but most scholars today hold that
the two developments were for the most part independent.) Calculus involves
reasoning about, for example, infinite sums of infinitely small quantities; these
features fueled criticism by Bishop Berkeley, who argued that belief in God was
no less rational than the mathematics of his time. The methods of calculus
were widely used in the eighteenth century, for example by Leonhard Euler,
who used calculations involving infinite sums with dramatic results.
In the nineteenth century, mathematicians tried to address Berkeley’s crit-
icisms by putting calculus on a firmer foundation. Efforts by Cauchy, Weier-
strass, Bolzano, and others led to our contemporary definitions of limits, conti-
content/incompleteness/introduction/definitions.tex
33.2 Definitions
In order to carry out Hilbert’s project of formalizing mathematics and showing inc:int:def:
sec
that such a formalization is consistent and complete, the first order of busi-
ness would be that of picking a language, logical framework, and a system of
axioms. For our purposes, let us suppose that mathematics can be formalized
in a first-order language, i.e., that there is some set of constant symbols, func-
tion symbols, and predicate symbols which, together with the connectives and
quantifiers of first-order logic, allow us to express the claims of mathematics.
Most people agree that such a language exists: the language of set theory, in
which ∈ is the only non-logical symbol. That such a simple language is so
expressive is of course a very implausible claim at first sight, and it took a
lot of work to establish that practically of all mathematics can be expressed
in this very austere vocabulary. To keep things simple, for now, let’s restrict
our discussion to arithmetic, so the part of mathematics that just deals with
the natural numbers N. The natural language in which to express facts of
arithmetic is LA . LA contains a single two-place predicate symbol <, a single
constant symbol 0, one one-place function symbol ′, and two two-place function
symbols + and ×.
There are two easy ways to specify theories. One is as the set of sentences
true in some structure. For instance, consider the structure for LA in which the
domain is N and all non-logical symbols are interpreted as you would expect.
Definition 33.2. The standard model of arithmetic is the structure N defined inc:int:def:
def:standard-model
as follows:
1. |N| = N
2. 0N = 0
Definition 33.3. The theory of true arithmetic is the set of sentences satisfied
in the standard model of arithmetic, i.e.,
TA = {φ : N ⊨ φ}.
Γ = {φ : Γ0 ⊨ φ}
∀x ∀y (x′ = y ′ → x = y) (Q1 )
′
∀x 0 ̸= x (Q2 )
′
∀x (x = 0 ∨ ∃y x = y ) (Q3 )
∀x (x + 0) = x (Q4 )
∀x ∀y (x + y ′ ) = (x + y)′ (Q5 )
∀x (x × 0) = 0 (Q6 )
′
∀x ∀y (x × y ) = ((x × y) + x) (Q7 )
∀x ∀y (x < y ↔ ∃z (z ′ + x) = y) (Q8 )
Q = {φ : {Q1 , . . . , Q8 } ⊨ φ}.
explanation Every instance of the induction schema is true in N. This is easiest to see
if the formula φ only has one free variable x. Then φ(x) defines a subset Xφ
of N in N. Xφ is the set of all n ∈ N such that N, s ⊨ φ(x) when s(x) = n.
The corresponding instance of the induction schema is
2. Γ ⊢ ∀y(φ(n1 , . . . , nk , y) → y = m).
content/incompleteness/introduction/overview.tex
To say that Γ is not complete is to say that for at least one sentence φ,
Γ ⊬ φ and Γ ⊬ ¬φ. Such a sentence is called independent (of Γ ). We can in
fact relatively quickly prove that there must be independent sentences. But
the power of Gödel’s proof of the theorem lies in the fact that it exhibits a
specific example of such an independent sentence. The intriguing construction
produces a sentence γΓ , called a Gödel sentence for Γ , which is unprovable
because in Γ , γΓ is equivalent to the claim that γΓ is unprovable in Γ . It does
so constructively, i.e., given an axiomatization of Γ and a description of the
derivation system, the proof gives a method for actually writing down γΓ .
The construction in Gödel’s proof requires that we find a way to express
in LA the properties of and operations on terms and formulas of LA itself.
These include properties such as “φ is a sentence,” “δ is a derivation of φ,”
and operations such as φ[t/x]. This way must (a) express these properties and
relations via a “coding” of symbols and sequences thereof (which is what terms,
formulas, derivations, etc. are) as natural numbers (which is what LA can talk
about). It must (b) do this in such a way that Γ will prove the relevant facts,
so we must show that these properties are coded by decidable properties of
natural numbers and the operations correspond to computable functions on
natural numbers. This is called “arithmetization of syntax.”
content/incompleteness/introduction/undecidability.tex
D = {n : Γ ⊢ ¬φn (n)}
The set D is decidable, since we can test if n ∈ D by first computing φn (x), and
from this ¬φn (n). Obviously, substituting the term n for every free occurrence
The preceding theorem shows that no consistent theory that represents all explanation
decidable relations can be decidable. We will show that Q does represent all
decidable relations; this means that all theories that include Q, such as PA
and TA, also do, and hence also are not decidable. (Since all these theories
are true in the standard model, they are all consistent.)
We can also use this result to obtain a weak version of the first incomplete-
ness theorem. Any theory that is axiomatizable and complete is decidable.
Consistent theories that are axiomatizable and represent all decidable proper-
ties then cannot be complete.
Chapter 34
Arithmetization of Syntax
content/incompleteness/arithmetization-syntax/introduction.tex
34.1 Introduction
In order to connect computability and logic, we need a way to talk about the ob- inc:art:int:
sec
jects of logic (symbols, terms, formulas, derivations), operations on them, and
their properties and relations, in a way amenable to computational treatment.
We can do this directly, by considering computable functions and relations on
symbols, sequences of symbols, and other objects built from them. Since the
objects of logical syntax are all finite and built from an enumerable sets of
symbols, this is possible for some models of computation. But other models
of computation—such as the recursive functions—-are restricted to numbers,
their relations and functions. Moreover, ultimately we also want to be able to
deal with syntax within certain theories, specifically, in theories formulated in
504
34.1. INTRODUCTION
content/incompleteness/arithmetization-syntax/coding-symbols.tex
⊥ ¬ ∨ ∧ → ∀ ∃ = ( ) ,
together with enumerable sets of variables and constant symbols, and enumer-
able sets of function symbols and predicate symbols of arbitrary arity. We can
assign codes to each of these symbols in such a way that every symbol is as-
signed a unique number as its code, and no two different symbols are assigned
the same number. We know that this is possible since the set of all symbols is
enumerable and so there is a bijection between it and the set of natural num-
bers. But we want to make sure that we can recover the symbol (as well as
some information about it, e.g., the arity of a function symbol) from its code
in a computable way. There are many possible ways of doing this, of course.
Here is one such way, which uses primitive recursive functions. (Recall that
⟨n0 , . . . , nk ⟩ is the number coding the sequence of numbers n0 , . . . , nk .)
⊥ ¬ ∨ ∧ → ∀
⟨0, 0⟩ ⟨0, 1⟩ ⟨0, 2⟩ ⟨0, 3⟩ ⟨0, 4⟩ ⟨0, 5⟩
∃ = ( ) ,
⟨0, 6⟩ ⟨0, 7⟩ ⟨0, 8⟩ ⟨0, 9⟩ ⟨0, 10⟩
1. Fn(x, n) iff x is the code of fin for some i, i.e., x is the code of an n-ary
function symbol.
2. Pred(x, n) iff x is the code of Pin for some i or x is the code of = and
n = 2, i.e., x is the code of an n-ary predicate symbol.
Definition 34.3. If s0 , . . . , sn−1 is a sequence of symbols, its Gödel number is
⟨cs0 , . . . , csn−1 ⟩.
Note that codes and Gödel numbers are different things. For instance, the explanation
variable v5 has a code cv5 = ⟨1, 5⟩ = 22 · 36 . But the variable v5 considered as
a term is also a sequence of symbols (of length 1). The Gödel number # v5 # of
2 6
the term v5 is ⟨cv5 ⟩ = 2cv5 +1 = 22 ·3 +1 .
Example 34.4. Recall that if k0 , . . . , kn−1 is a sequence of numbers, then the
code of the sequence ⟨k0 , . . . , kn−1 ⟩ in the power-of-primes coding is
k
2k0 +1 · 3k1 +1 · · · · · pn−1
n−1
,
where pi is the i-th prime (starting with p0 = 2). So for instance, the formula
v0 = 0, or, more explicitly, =(v0 , c0 ), has the Gödel number
⟨c= , c( , cv0 , c, , cc0 , c) ⟩.
0+1 7+1
Here, c= is ⟨0, 7⟩ = 2 ·3 , cv0 is ⟨1, 0⟩ = 21+1 · 30+1 , etc. So # = (v0 , c0 )#
is
content/incompleteness/arithmetization-syntax/coding-terms.tex
Proposition 34.5. The relations Term(x) and ClTerm(x) which hold iff x inc:art:trm:
prop:term-primrec
is the Gödel number of a term or a closed term, respectively, are primitive
recursive.
1. si is a variable vj , or
2. si is a constant symbol cj , or
1. Var((y)i ), or
2. Const((y)i ), or
Problem 34.1. Show that the function flatten(z), which turns the sequence
⟨# t1 # , . . . , # tn # ⟩ into # t1 , . . . , tn # , is primitive recursive.
num(0) = # 0#
num(n + 1) = # ′(# ⌢ num(n) ⌢ # )# .
content/incompleteness/arithmetization-syntax/coding-formulas.tex
Proof. The number x is the Gödel number of an atomic formula iff one of the
following holds:
1. There are n, j < x, and z < x such that for each i < n, Term((z)i ) and
x=
# n #
Pj ( ⌢ flatten(z) ⌢ # )# .
3. x = # ⊥# .
4. x = # ⊤# .
inc:art:frm: Proposition 34.8. The relation Frm(x) which holds iff x is the Gödel number
prop:frm-primrec
of a formula is primitive recursive.
Problem 34.2. Give a detailed proof of Proposition 34.8 along the lines of
the first proof of Proposition 34.5.
inc:art:frm: Proposition 34.9. The relation FreeOcc(x, z, i), which holds iff the i-th sym-
prop:freeocc-primrec
bol of the formula with Gödel number x is a free occurrence of the variable with
Gödel number z, is primitive recursive.
Proof. Exercise.
Problem 34.3. Prove Proposition 34.9. You may make use of the fact that
any substring of a formula which is a formula is a sub-formula of it.
Proposition 34.10. The property Sent(x) which holds iff x is the Gödel num-
ber of a sentence is primitive recursive.
content/incompleteness/arithmetization-syntax/substitution.tex
34.5 Substitution
Recall that substitution is the operation of replacing all free occurrences of inc:art:sub:
sec
a variable u in a formula φ by a term t, written φ[t/u]. This operation, when
carried out on Gödel numbers of variables, formulas, and terms, is primitive
recursive.
Proposition 34.11. There is a primitive recursive function Subst(x, y, z) inc:art:sub:
prop:subst-primrec
with the property that
Subst(# φ# , # t# , # u# ) = # φ[t/u]# .
hSubst(x, y, z, 0) = Λ
hSubst(x, y, z, i + 1) =
(
hSubst(x, y, z, i) ⌢ y if FreeOcc(x, z, i)
append(hSubst(x, y, z, i), (x)i ) otherwise.
Proposition 34.12. The relation FreeFor(x, y, z), which holds iff the term inc:art:sub:
prop:free-for
with Gödel number y is free for the variable with Gödel number z in the formula
with Gödel number x, is primitive recursive.
Proof. Exercise.
content/incompleteness/arithmetization-syntax/proofs-in-lk.tex
34.6 Derivations in LK
inc:art:plk: In order to arithmetize derivations, we must represent derivations as numbers. explanation
sec
Since derivations are trees of sequents where each inference carries also a la-
bel, a recursive representation is the most obvious approach: we represent a
derivation as a tuple, the components of which are the end-sequent, the label,
and the representations of the sub-derivations leading to the premises of the
last inference.
⟨0, # Γ ⇒ ∆# ⟩.
⟨1, # π1 # , # Γ ⇒ ∆# , k⟩ or
⟨2, # π1 # , # π2 # , # Γ ⇒ ∆# , k⟩,
Rule: ¬L ¬R ∧L ∧R ∨L ∨R
k: 7 8 9 10 11 12
Rule: →L →R ∀L ∀R ∃L ∃R
k: 13 14 15 16 17 18
Rule: Cut =
k: 19 20
Proposition 34.15. The property Correct(p) which holds iff the last inference inc:art:plk:
prop:followsby
in the derivation π with Gödel number p is correct, is primitive recursive.
We also have to show that for each rule of inference R the relation FollowsByR (p)
is primitive recursive, where FollowsByR (p) holds iff p is the Gödel number of
derivation π, and the end-sequent of π follows by a correct application of R
from the immediate sub-derivations of π.
A simple case is that of the ∧R rule. If π ends in a correct ∧R inference, it
looks like this:
π1 π2
Γ ⇒ ∆, φ Γ ⇒ ∆, ψ
∧R
Γ ⇒ ∆, φ ∧ ψ
So, the last inference in the derivation π is a correct application of ∧R iff there
are sequences of sentences Γ and ∆ as well as two sentences φ and ψ such
that the end-sequent of π1 is Γ ⇒ ∆, φ, the end-sequent of π2 is Γ ⇒ ∆, ψ,
(∃g < p) (∃d < p) (∃a < p) (∃x < p) (∃t < p)
EndSequent(p) = ⟨g, d ⌢ ⟨# ∃# ⌢ x ⌢ a⟩⟩ ∧
EndSequent((p)1 ) = ⟨g, d ⌢ ⟨Subst(a, t, x)⟩⟩ ∧
(p)0 = 1 ∧ LastRule(p) = 18.
Sequent(EndSequent(p)) ∧
[(LastRule(p) = 1 ∧ FollowsByWL (p)) ∨ · · · ∨
(LastRule(p) = 20 ∧ FollowsBy= (p)) ∨
(p)0 = 0 ∧ InitialSeq(EndSequent(p))]
The first line ensures that the end-sequent of d is actually a sequent consisting
of sentences. The last line covers the case where p is just an initial sequent.
1. FollowsByCut (p),
2. FollowsBy→L (p),
3. FollowsBy= (p),
4. FollowsBy∀R (p).
For the last one, you will have to also show that you can test primitive recur-
sively if the last inference of the derivation with Gödel number p satisfies the
eigenvariable condition, i.e., the eigenvariable a of the ∀R does not occur in
the end-sequent.
Proposition 34.16. The relation Deriv(p) which holds if p is the Gödel num- inc:art:plk:
prop:deriv
ber of a correct derivation π, is primitive recursive.
content/incompleteness/arithmetization-syntax/proofs-in-nd.tex
⟨1, # δ1 # , # φ# , n, k⟩,
⟨2, # δ1 # , # δ2 # , # φ# , n, k⟩, or
⟨3, # δ1 # , # δ2 # , # δ3 # , # φ# , n, k⟩,
2. All assumptions in δ with label n are of the form φ (i.e., we can discharge
the assumption φ using label n in δ).
Proof. We have to show that the corresponding relations between Gödel num-
bers of formulas and Gödel numbers of derivations are primitive recursive.
1. We want to show that Assum(x, d, n), which holds if x is the Gödel num-
ber of an assumption of the derivation with Gödel number d labelled n,
is primitive recursive. This is the case if the derivation with Gödel num-
ber ⟨0, x, n⟩ is a sub-derivation of d. Note that the way we code deriva-
tions is a special case of the coding of trees introduced in section 29.12, so
the primitive recursive function SubtreeSeq(d) gives a sequence of Gödel
numbers of all sub-derivations of d (of length a most d). So we can define
Proposition 34.21. The property Correct(d) which holds iff the last inference inc:art:pnd:
prop:followsby
in the derivation δ with Gödel number d is correct, is primitive recursive.
Proof. Here we have to show that for each rule of inference R the relation
FollowsByR (d) is primitive recursive, where FollowsByR (d) holds iff d is the
Gödel number of derivation δ, and the end-formula of δ follows by a correct
application of R from the immediate sub-derivations of δ.
A simple case is that of the ∧Intro rule. If δ ends in a correct ∧Intro
inference, it looks like this:
δ1 δ2
φ ψ
∧Intro
φ∧ψ
Another simple example if the =Intro rule. Here the premise is an empty
derivation, i.e., (d)1 = 0, and no discharge label, i.e., n = 0. However, φ must
be of the form t = t, for a closed term t. Here, a primitive recursive definition
is
For a more complicated example, FollowsBy→Intro (d) holds iff the end-
formula of δ is of the form (φ → ψ), where the end-formula of δ1 is ψ, and
any assumption in δ labelled n is of the form φ. We can express this primitive
recursively by
(d)0 = 1 ∧
(∃a < d) (Discharge(a, (d)1 , DischargeLabel(d)) ∧
EndFmla(d) = (# (# ⌢ a ⌢ # →# ⌢ EndFmla((d)1 ) ⌢ # )# ))
(d)0 = 1 ∧ DischargeLabel(d) = 0 ∧
(∃a < d) (∃x < d) (∃t < d) (ClTerm(t) ∧ Var(x) ∧
Subst(a, t, x) = EndFmla((d)1 ) ∧ EndFmla(d) = (# ∃# ⌢ x ⌢ a)).
Sent(EndFmla(d)) ∧
(LastRule(d) = 1 ∧ FollowsBy∧Intro (d)) ∨ · · · ∨
(LastRule(d) = 16 ∧ FollowsBy=Elim (d)) ∨
(∃n < d) (∃x < d) (d = ⟨0, x, n⟩).
The first line ensures that the end-formula of d is a sentence. The last line
covers the case where d is just an assumption.
1. FollowsBy→Elim (d),
2. FollowsBy=Elim (d),
3. FollowsBy∨Elim (d),
4. FollowsBy∀Intro (d).
For the last one, you will have to also show that you can test primitive recur-
sively if the last inference of the derivation with Gödel number d satisfies the
eigenvariable condition, i.e., the eigenvariable a of the ∀Intro inference occurs
neither in the end-formula of d nor in an open assumption of d. You may use
the primitive recursive predicate OpenAssum from Proposition 34.23 for this.
Proposition 34.22. The relation Deriv(d) which holds if d is the Gödel num- inc:art:pnd:
prop:deriv
ber of a correct derivation δ, is primitive recursive.
content/incompleteness/arithmetization-syntax/proofs-in-ax.tex
Proof. We have to show that the corresponding relations between Gödel num-
bers of formulas and Gödel numbers of derivations are primitive recursive.
1. We have a given list of axiom schemas, and φ is an axiom if it is of the
form given by one of these schemas. Since the list of schemas is finite,
it suffices to show that we can test primitive recursively, for each axiom
schema, if φ is of that form. For instance, consider the axiom schema
ψ → (χ → ψ).
All of these can be tested primitive recursively, since the Gödel numbers
of ψ, φ(x), and x are less than the Gödel number of the formula on line i,
and that of a less than the Gödel number of the formula on line j:
QR1 (d, i) ⇔ (∃b < (d)i ) (∃x < (d)i ) (∃a < (d)i ) (∃c < (d)j ) (
Var(x) ∧ Const(c) ∧
(d)i = ( ⌢ b ⌢ # →# ⌢ # ∀# ⌢ x ⌢ a ⌢ # )# ∧
# #
(d)j = # (# ⌢ b ⌢ # →# ⌢ Subst(a, c, x) ⌢ # )# ∧
Sent(b) ∧ Sent(Subst(a, c, x)) ∧ (∀k < len(b)) (b)k ̸= (c)0 )
Here we assume that c and x are the Gödel numbers of the variable and
constant considered as terms (i.e., not their symbol codes). We test that
x is the only free variable of φ(x) by testing if φ(x)[c/x] is a sentence,
and ensure that c does not occur in ψ by requiring that every symbol
of ψ is different from c.
We leave the other version of qr as an exercise.
1. IsAxφ→(ψ→(φ∧ψ)) (n),
Chapter 35
Representability in Q
content/incompleteness/representability-in-q/introduction.tex
522
35.1. INTRODUCTION
35.1 Introduction
inc:req:int: The incompleteness theorems apply to theories in which basic facts about com-
sec
putable functions can be expressed and proved. We will describe a very minimal
such theory called “Q” (or, sometimes, “Robinson’s Q,” after Raphael Robin-
son). We will say what it means for a function to be representable in Q, and
then we will prove the following:
A function is representable in Q if and only if it is computable.
For one thing, this provides us with another model of computability. But we
will also use it to show that the set {φ : Q ⊢ φ} is not decidable, by reducing
the halting problem to it. By the time we are done, we will have proved much
stronger things than this.
The language of Q is the language of arithmetic; Q consists of the following
axioms (to be used in conjunction with the other axioms and rules of first-order
logic with identity predicate):
∀x ∀y (x′ = y ′ → x = y) (Q1 )
∀x 0 ̸= x′ (Q2 )
′
∀x (x = 0 ∨ ∃y x = y ) (Q3 )
∀x (x + 0) = x (Q4 )
′ ′
∀x ∀y (x + y ) = (x + y) (Q5 )
∀x (x × 0) = 0 (Q6 )
′
∀x ∀y (x × y ) = ((x × y) + x) (Q7 )
′
∀x ∀y (x < y ↔ ∃z (z + x) = y) (Q8 )
For each natural number n, define the numeral n to be the term 0′′...′ where
there are n tick marks in all. So, 0 is the constant symbol 0 by itself, 1 is 0′ , 2
is 0′′ , etc.
As a theory of arithmetic, Q is extremely weak; for example, you can’t even
prove very simple facts like ∀x x ̸= x′ or ∀x ∀y (x + y) = (y + x). But we will
see that much of the reason that Q is so interesting is because it is so weak.
In fact, it is just barely strong enough for the incompleteness theorem to hold.
Another reason Q is interesting is because it has a finite set of axioms.
A stronger theory than Q (called Peano arithmetic PA) is obtained by
adding a schema of induction to Q:
where φ(x) is any formula. If φ(x) contains free variables other than x, we add
universal quantifiers to the front to bind all of them (so that the corresponding
instance of the induction schema is a sentence). For instance, if φ(x, y) also
contains the variable y free, the corresponding instance is
Using instances of the induction schema, one can prove much more from the
axioms of PA than from those of Q. In fact, it takes a good deal of work to
find “natural” statements about the natural numbers that can’t be proved in
Peano arithmetic!
Definition 35.1. A function f (x0 , . . . , xk ) from the natural numbers to the inc:req:int:
natural numbers is said to be representable in Q if there is a formula φf (x0 , . . . , xkdefn:representable-fn
, y)
such that whenever f (n0 , . . . , nk ) = m, Q proves
1. φf (n0 , . . . , nk , m) inc:req:int:
defn:rep:a
There are other ways of stating the definition; for example, we could equiv-
alently require that Q proves ∀y (φf (n0 , . . . , nk , y) ↔ y = m).
There are two directions to proving the theorem. The left-to-right direc-
tion is fairly straightforward once arithmetization of syntax is in place. The
other direction requires more work. Here is the basic idea: we pick “general
recursive” as a way of making “computable” precise, and show that every gen-
eral recursive function is representable in Q. Recall that a function is general
recursive if it can be defined from zero, the successor function succ, and the
projection functions Pin , using composition, primitive recursion, and regular
minimization. So one way of showing that every general recursive function is
representable in Q is to show that the basic functions are representable, and
whenever some functions are representable, then so are the functions defined
from them using composition, primitive recursion, and regular minimization.
In other words, we might show that the basic functions are representable, and
that the representable functions are “closed under” composition, primitive re-
cursion, and regular minimization. This guarantees that every general recursive
function is representable.
It turns out that the step where we would show that representable func-
tions are closed under primitive recursion is hard. In order to avoid this step,
we show first that in fact we can do without primitive recursion. That is, we
show that every general recursive function can be defined from basic functions
using composition and regular minimization alone. To do this, we show that
primitive recursion can actually be done by a specific regular minimization.
However, for this to work, we have to add some additional basic functions:
addition, multiplication, and the characteristic function of the identity rela-
tion χ= . Then, we can prove the theorem by showing that all of these basic
functions are representable in Q, and the representable functions are closed
under composition and regular minimization.
content/incompleteness/representability-in-q/representable-comp.tex
Proof. The “if” part is Definition 35.1(1). The “only if” part is seen as follows:
Suppose Q ⊢ φf (n0 , . . . , nk , m) but m ̸= f (n0 , . . . , nk ). Let l = f (n0 , . . . , nk ).
By Definition 35.1(1), Q ⊢ φf (n0 , . . . , nk , l). By Definition 35.1(2), ∀y (φf (n0 , . . . , nk , y)→
l = y). Using logic and the assumption that Q ⊢ φf (n0 , . . . , nk , m), we get
that Q ⊢ l = m. On the other hand, by Lemma 35.14, Q ⊢ l ̸= m. So Q is
inconsistent. But that is impossible, since Q is satisfied by the standard model
(see Definition 33.2), N ⊨ Q, and satisfiable theories are always consistent by
the Soundness Theorem (Corollaries 19.31, 20.29, 21.31 and 22.38).
Proof. Let’s first give the intuitive idea for why this is true. To compute f , we
do the following. List all the possible derivations δ in the language of arith-
metic. This is possible to do mechanically. For each one, check if it is a deriva-
tion of a formula of the form φf (n0 , . . . , nk , m) (the formula representing f in Q
from Lemma 35.3). If it is, m = f (n0 , . . . , nk ) by Lemma 35.3, and we’ve found
the value of f . The search terminates because Q ⊢ φf (n0 , . . . , nk , f (n0 , . . . , nk )),
so eventually we find a δ of the right sort.
This is not quite precise because our procedure operates on derivations
and formulas instead of just on numbers, and we haven’t explained exactly
why “listing all possible derivations” is mechanically possible. But as we’ve
seen, it is possible to code terms, formulas, and derivations by Gödel numbers.
We’ve also introduced a precise model of computation, the general recursive
functions. And we’ve seen that the relation Prf Q (d, y), which holds iff d is the
Gödel number of a derivation of the formula with Gödel number y from the
axioms of Q, is (primitive) recursive. Other primitive recursive functions we’ll
need are num (Proposition 34.6) and Subst (Proposition 34.11). From these,
it is possible to define f by minimization; thus, f is recursive.
First, define
A(n0 , . . . , nk , m) =
Subst(Subst(. . . Subst(# φf # , num(n0 ), # x0 # ),
. . . ), num(nk ), # xk # ), num(m), # y # )
This looks complicated, but it’s just the function A(n0 , . . . , nk , m) = # φf (n0 , . . . , nk , m)# .
Now, consider the relation R(n0 , . . . , nk , s) which holds if (s)0 is the Gödel
number of a derivation from Q of φf (n0 , . . . , nk , (s)1 ):
R(n0 , . . . , nk , s) iff Prf Q ((s)0 , A(n0 , . . . , nk , (s)1 ))
content/incompleteness/representability-in-q/beta-function.tex
Lemma 35.5. There is a function β(d, i) such that for every sequence a0 , inc:req:bet:
. . . , an there is a number d, such that for every i ≤ n, β(d, i) = ai . Moreover, lem:beta
β can be defined from the basic functions using just composition and regular
minimization.
Definition 35.6. Two natural numbers a and b are relatively prime iff their
greatest common divisor is 1; in other words, they have no other divisors in
common.
z ≡ y0 mod x0
z ≡ y1 mod x1
..
.
z ≡ yn mod xn .
j = max(n, y0 , . . . , yn ) + 1,
and let
x0 = 1 + j !
x1 = 1 + 2 · j !
x2 = 1 + 3 · j !
..
.
xn = 1 + (n + 1) · j !
To see that (1) is true, note that if p is a prime number and p | xi and p | xk ,
then p | 1 + (i + 1)j ! and p | 1 + (k + 1)j !. But then p divides their difference,
Now let us prove the β function lemma. Remember that we can use 0,
successor, plus, times, χ= , projections, and any function defined from them
using composition and minimization applied to regular functions. We can also
use a relation if its characteristic function is so definable. As before we can
show that these relations are closed under Boolean combinations and bounded
quantification; for example:
not(x) = χ= (x, 0)
(min x ≤ z) R(x, y) = µx (R(x, y) ∨ x = z)
(∃x ≤ z) R(x, y) ⇔ R((min x ≤ z) R(x, y), y)
We can then show that all of the following are also definable without primitive
recursion:
1. The pairing function, J(x, y) = 21 [(x + y)(x + y + 1)] + x;
2. the projection functions
K(z) = (min x ≤ z) (∃y ≤ z) z = J(x, y),
L(z) = (min y ≤ z) (∃x ≤ z) z = J(x, y);
Problem 35.1. Show that the relations x < y, x | y, and the function rem(x, y)
can be defined without primitive recursion. You may use 0, successor, plus,
times, χ= , projections, and bounded minimization and quantification.
content/incompleteness/representability-in-q/prim-rec.tex
h(⃗x, 0) = f (⃗x)
h(⃗x, y + 1) = g(⃗x, y, h(⃗x, y)).
We need to show that h can be defined from f and g using just composition
and regular minimization, using the basic functions and functions defined from
them using composition and regular minimization (such as β).
inc:req:pri: Lemma 35.9. If h can be defined from f and g using primitive recursion, it
lem:prim-rec
can be defined from f , g, the functions zero, succ, Pin , add, mult, χ= , using
composition and regular minimization.
Proof. First, define an auxiliary function ĥ(⃗x, y) which returns the least num-
ber d such that d codes a sequence which satisfies
where now (d)i is short for β(d, i). In other words, ĥ returns the sequence
⟨h(⃗x, 0), h(⃗x, 1), . . . , h(⃗x, y)⟩. We can write ĥ as
content/incompleteness/representability-in-q/basic-representable.tex
n + m = n + m and
∀y ((n + m) = y → y = n + m).
Proposition 35.12. The projection function Pin (x0 , . . . , xn−1 ) = xi is repre- inc:req:bre:
prop:rep-proj
sented in Q by
φPin (x0 , . . . , xn−1 , y) ≡ y = xi .
is represented in Q by
In the induction step, we can assume the claim is true for n, and consider
n + 1. Let m be any natural number. There are two possibilities: either m = 0
or for some k we have m = k + 1. The first case is handled as above. In the
second case, suppose n + 1 ̸= k + 1. Then n ̸= k. By the induction hypothesis
for n we have Q ⊢ n ̸= k. We have an axiom that says ∀x ∀y x′ = y ′ → x = y.
′
Using a quantifier axiom, we have n′ = k → n = k. Using propositional logic,
′
we can conclude, in Q, n ̸= k → n′ ̸= k . Using modus ponens, we can conclude
′ ′
n′ ̸= k , which is what we want, since k is m.
Note that the lemma does not say much: in essence it says that Q can explanation
prove that different numerals denote different objects. For example, Q proves
0′′ ̸= 0′′′ . But showing that this holds in general requires some care. Note also
that although we are using induction, it is induction outside of Q.
Proof of Proposition 35.13. If n = m, then n and m are the same term, and
χ= (n, m) = 1. But Q ⊢ (n = m ∧ 1 = 1), so it proves φ= (n, m, 1). If n ̸= m,
then χ= (n, m) = 0. By Lemma 35.14, Q ⊢ n ̸= m and so also (n ̸= m ∧ 0 = 0).
Thus Q ⊢ φ= (n, m, 0).
For the second part, we also have two cases. If n = m, we have to show
that Q ⊢ ∀y (φ= (n, m, y) → y = 1). Arguing informally, suppose φ= (n, m, y),
i.e.,
(n = n ∧ y = 1) ∨ (n ̸= n ∧ y = 0)
The left disjunct implies y = 1 by logic; the right contradicts n = n which is
provable by logic.
Suppose, on the other hand, that n ̸= m. Then φ= (n, m, y) is
(n = m ∧ y = 1) ∨ (n ̸= m ∧ y = 0)
Q ⊢ (n + m) = n + m,
we can replace the left side with n + m and get n + m = y, for arbitrary y.
Proof. Exercise.
Proof. Exercise.
explanation Recall that we use × for the function symbol of the language of arithmetic,
and · for the ordinary multiplication operation on numbers. So · can appear
between expressions for numbers (such as in m·n) while × appears only between
terms of the language of arithmetic (such as in (m×n)). Even more confusingly,
+ is used for both the function symbol and the addition operation. When it
appears between terms—e.g., in (n + m)—it is the 2-place function symbol
of the language of arithmetic, and when it appears between numbers—e.g., in
n + m—it is the addition operation. This includes the case n + m: this is the
standard numeral corresponding to the number n + m.
content/incompleteness/representability-in-q/composition-representable.tex
where we have already found formulas φf , φg0 , . . . , φgk−1 representing the func-
tions f , and g0 , . . . , gk−1 , respectively. We have to find a formula φh repre-
senting h.
Let’s start with a simple case, where all functions are 1-place, i.e., consider
h(x) = f (g(x)). If φf (y, z) represents f , and φg (x, y) represents g, we need
a formula φh (x, z) that represents h. Note that h(x) = z iff there is a y such
that both z = f (y) and y = g(x). (If h(x) = z, then g(x) is such a y; if such a
y exists, then since y = g(x) and z = f (y), z = f (g(x)).) This suggests that
∃y (φg (x, y) ∧ φf (y, z)) is a good candidate for φh (x, z). We just have to verify
that Q proves the relevant formulas.
Q ⊢ φg (n, k)
Q ⊢ φf (k, m)
Q ⊢ φg (n, k) ∧ φf (k, m)
Q ⊢ ∀y (φg (n, y) → y = k)
Q ⊢ ∀z (φf (k, z) → z = m)
since φf represents f . Using just a little bit of logic, we can show that also
The same idea works in the more complex case where f and gi have arity
greater than 1.
content/incompleteness/representability-in-q/minimization-representable.tex
It is again worth mentioning that this is weaker than saying that Q proves
∀x ∀y (x′ + y) = (x + y)′ . Although this sentence is true in N, Q does not prove
it.
Proof. We give the proof informally (i.e., only giving hints as to how to con-
struct the formal derivation).
We have to prove ¬a < 0 for an arbitrary a. By the definition of <, we
need to prove ¬∃y (y ′ + a) = 0 in Q. We’ll assume ∃y (y ′ + a) = 0 and prove a
contradiction. Suppose (b′ + a) = 0. Using Q3 , we have that a = 0 ∨ ∃y a = y ′ .
We distinguish cases.
Case 1: a = 0 holds. From (b′ + a) = 0, we have (b′ + 0) = 0. By axiom Q4
of Q, we have (b′ + 0) = b′ , and hence b′ = 0. But by axiom Q2 we also have
b′ ̸= 0, a contradiction.
Case 2: For some c, a = c′ . But then we have (b′ + c′ ) = 0. By axiom Q5 ,
we have (b′ + c)′ = 0, again contradicting axiom Q2 .
Q ⊢ ∀x (x < n + 1 → (x = 0 ∨ · · · ∨ x = n)).
m′ ≡ m + 1, (c′ + m + 1) = a. By Q8 , m + 1 < a.
Finally, assume b = m. Then, by logic, b′ = m′ , and so a = m + 1.
Hence, from each disjunct of the case for m and b, we can obtain the
corresponding disjunct for for m + 1 and a.
Q ⊢ φg (m, n, 0).
We get that
content/incompleteness/representability-in-q/comp-representable.tex
Proof. For definiteness, and using the Church–Turing Thesis, let’s say that a
function is computable iff it is general recursive. The general recursive func-
tions are those which can be defined from the zero function zero, the successor
function succ, and the projection function Pin using composition, primitive re-
cursion, and regular minimization. By Lemma 35.9, any function h that can
be defined from f and g can also be defined using composition and regular
minimization from f , g, and zero, succ, Pin , add, mult, χ= . Consequently, a
function is general recursive iff it can be defined from zero, succ, Pin , add, mult,
χ= using composition and regular minimization.
We’ve furthermore shown that the basic functions in question are repre-
sentable in Q (Propositions 35.10 to 35.13, 35.15 and 35.17), and that any
function defined from representable functions by composition or regular min-
imization (Proposition 35.21, Proposition 35.26) is also representable. Thus
every general recursive function is representable in Q.
We have shown that the set of computable functions can be characterized as explanation
the set of functions representable in Q. In fact, the proof is more general. From
the definition of representability, it is not hard to see that any theory extending
Q (or in which one can interpret Q) can represent the computable functions.
But, conversely, in any derivation system in which the notion of derivation
is computable, every representable function is computable. So, for example,
the set of computable functions can be characterized as the set of functions
representable in Peano arithmetic, or even Zermelo–Fraenkel set theory. As
Gödel noted, this is somewhat surprising. We will see that when it comes to
provability, questions are very sensitive to which theory you consider; roughly,
the stronger the axioms, the more you can prove. But across a wide range
of axiomatic theories, the representable functions are exactly the computable
ones; stronger theories do not represent more functions as long as they are
axiomatizable.
content/incompleteness/representability-in-q/representing-relations.tex
content/incompleteness/representability-in-q/undecidability.tex
35.10 Undecidability
We call a theory T undecidable if there is no computational procedure which, inc:req:und:
sec
after finitely many steps and unfailingly, provides a correct answer to the ques-
tion “does T prove φ?” for any sentence φ in the language of T. So Q would
be decidable iff there were a computational procedure which decides, given a
sentence φ in the language of arithmetic, whether Q ⊢ φ or not. We can make
this more precise by asking: Is the relation ProvQ (y), which holds of y iff y is
the Gödel number of a sentence provable in Q, recursive? The answer is: no.
Chapter 36
539
CHAPTER 36. THEORIES AND COMPUTABILITY
content/incompleteness/theories-computability/introduction.tex
36.1 Introduction
inc:tcp:int:
sec
content/incompleteness/theories-computability/q-is-ce.tex
36.2 Q is C.e.-Complete
inc:tcp:qce:
sec
Theorem 36.1. Q is c.e. but not decidable. In fact, it is a complete c.e. set.
Proof. It is not hard to see that Q is c.e., since it is the set of (codes for)
sentences y such that there is a proof x of y in Q:
But we know that Prf Q (x, y) is computable (in fact, primitive recursive), and
any set that can be written in the above form is c.e.
Saying that it is a complete c.e. set is equivalent to saying that K ≤m Q,
where K = {x : φx (x) ↓}. So let us show that K is reducible to Q. Since
x ∈ K → ∃s T (x, x, s)
→ ∃s (Q ⊢ φT (x, x, s))
→ Q ⊢ ∃s φT (x, x, s).
Conversely, if Q ⊢ ∃s φT (x, x, s), then, in fact, for some natural number n the
formula φT (x, x, n) must be true. Now, if T (x, x, n) were false, Q would prove
¬φT (x, x, n), since φT represents T . But then Q proves a false formula, which
is a contradiction. So T (x, x, n) must be true, which implies φx (x) ↓.
In short, we have that for every x, x is in K if and only if Q proves
∃s T (x, x, s). So the function f which takes x to (a code for) the sentence
∃s T (x, x, s) is a reduction of K to Q.
content/incompleteness/theories-computability/oconsis-ext-of-q-undec.tex
content/incompleteness/theories-computability/extensions-of-q-not-decidable.tex
content/incompleteness/theories-computability/computably-axiomatizable.tex
content/incompleteness/theories-computability/complete-decidable.tex
content/incompleteness/theories-computability/first-incompleteness.tex
explanation This theorems is not that far from Gödel’s original 1931 formulation of the
First Incompleteness Theorem. Aside from the more modern terminology, the
key differences are this: Gödel has “ω-consistent” instead of “consistent”; and
he could not say “axiomatizable” in full generality, since the formal notion of
computability was not in place yet. (The formal models of computability were
developed over the following decade, including by Gödel, and in large part to
be able to characterize the kinds of theories that are susceptible to the Gödel
phenomenon.)
The theorem says you can’t have it all, namely, completeness, consistency,
and axiomatizability. If you give up any one of these, though, you can have the
other two: Q is consistent and computably axiomatized, but not complete; the
inconsistent theory is complete, and computably axiomatized (say, by {0 ̸= 0}),
but not consistent; and the set of true sentence of arithmetic is complete and
consistent, but it is not computably axiomatized.
content/incompleteness/theories-computability/inseparability.tex
content/incompleteness/theories-computability/consis-with-q.tex
C = {φ : T ⊢ α → φ}.
Corollary 36.12. First-order logic for the language of arithmetic (that is, the
set {φ : φ is provable in first-order logic}) is undecidable.
content/incompleteness/theories-computability/interpretability.tex
The proof is just a small modification of the proof of the last theorem;
one could use a counterexample to get a separation of Q and Q̄. One can
take ZFC, Zermelo–Fraenkel set theory with the axiom of choice, to be an
axiomatic foundation that is powerful enough to carry out a good deal of ordi-
nary mathematics. In ZFC one can define the natural numbers, and via this
interpretation, the axioms of Q are true. So we have
Corollary 36.14. There is no decidable extension of ZFC.
The language of ZFC has only a single binary relation, ∈. (In fact, you
don’t even need equality.) So we have
Corollary 36.16. First-order logic for any language with a binary relation
symbol is undecidable.
This result extends to any language with two unary function symbols, since
one can use these to simulate a binary relation symbol. The results just cited
are tight: it turns out that first-order logic for a language with only unary
relation symbols and at most one unary function symbol is decidable.
One more bit of trivia. We know that the set of sentences in the language
0, ′ , +, ×, < true in the standard model is undecidable. In fact, one can
define < in terms of the other symbols, and then one can define + in terms of
× and ′ . So the set of true sentences in the language 0, ′ , × is undecidable.
On the other hand, Presburger has shown that the set of sentences in the
language 0, ′ , + true in the language of arithmetic is decidable. The procedure
is computationally infeasible, however.
Chapter 37
546
37.1. INTRODUCTION
content/incompleteness/incompleteness-provability/introduction.tex
37.1 Introduction
inc:inp:int: Hilbert thought that a system of axioms for a mathematical structure, such
sec
as the natural numbers, is inadequate unless it allows one to derive all true
statements about the structure. Combined with his later interest in formal
systems of deduction, this suggests that he thought that we should guarantee
that, say, the formal systems we are using to reason about the natural numbers
is not only consistent, but also complete, i.e., every statement in its language
is either derivable or its negation is. Gödel’s first incompleteness theorem
shows that no such system of axioms exists: there is no complete, consistent,
axiomatizable formal system for arithmetic. In fact, no “sufficiently strong,”
consistent, axiomatizable mathematical theory is complete.
A more important goal of Hilbert’s, the centerpiece of his program for the
justification of modern (“classical”) mathematics, was to find finitary consis-
tency proofs for formal systems representing classical reasoning. With regard
to Hilbert’s program, then, Gödel’s second incompleteness theorem was a much
bigger blow. The second incompleteness theorem can be stated in vague terms,
like the first incompleteness theorem. Roughly speaking, it says that no suffi-
ciently strong theory of arithmetic can prove its own consistency. We will have
to take “sufficiently strong” to include a little bit more than Q.
The idea behind Gödel’s original proof of the incompleteness theorem can
be found in the Epimenides paradox. Epimenides, a Cretan, asserted that all
Cretans are liars; a more direct form of the paradox is the assertion “this sen-
tence is false.” Essentially, by replacing truth with derivability, Gödel was able
to formalize a sentence which, in a roundabout way, asserts that it itself is not
derivable. If that sentence were derivable, the theory would then be inconsis-
tent. Gödel showed that the negation of that sentence is also not derivable from
the system of axioms he was considering. (For this second part, Gödel had to
assume that the theory T is what’s called “ω-consistent.” ω-Consistency is
related to consistency, but is a stronger property.1 A few years after Gödel,
Rosser showed that assuming simple consistency of T is enough.)
The first challenge is to understand how one can construct a sentence that
refers to itself. For every formula φ in the language of Q, let ⌜φ⌝ denote the
numeral corresponding to # φ# . Think about what this means: φ is a formula in
the language of Q, # φ# is a natural number, and ⌜φ⌝ is a term in the language
of Q. So every formula φ in the language of Q has a name, ⌜φ⌝, which is a
term in the language of Q; this provides us with a conceptual framework in
which formulas in the language of Q can “say” things about other formulas.
The following lemma is known as the fixed-point lemma.
1 That is, any ω-consistent theory is consistent, but not vice versa.
Lemma 37.1. Let T be any theory extending Q, and let ψ(x) be any formula
with only the variable x free. Then there is a sentence φ such that T ⊢ φ ↔
ψ(⌜φ⌝).
The lemma asserts that given any property ψ(x), there is a sentence φ that
asserts “ψ(x) is true of me,” and T “knows” this.
How can we construct such a sentence? Consider the following version of
the Epimenides paradox, due to Quine:
“Yields falsehood when preceded by its quotation” yields falsehood
when preceded by its quotation.
This sentence is not directly self-referential. It simply makes an assertion about
the syntactic objects between quotes, and, in doing so, it is on par with sen-
tences like
1. “Robert” is a nice name.
2. “I ran.” is a short sentence.
3. “Has three words” has three words.
But what happens when one takes the phrase “yields falsehood when preceded
by its quotation,” and precedes it with a quoted version of itself? Then one
has the original sentence! In short, the sentence asserts that it is false.
content/incompleteness/incompleteness-provability/fixed-point-lemma.tex
of α(x) is α(n), where n = # α(x)# . (From now on, let’s abbreviate # α(x)# as
⌜α(x)⌝.) So if ψ(x) is “is a falsehood,” then “yields a falsehood if preceded by
its own quotation,” would be “yields a falsehood when applied to the Gödel
number of its diagonalization.” If we had a symbol di ag for the function diag(n)
which computes the Gödel number of the diagonalization of the formula with
Gödel number n, we could write α(x) as ψ(di ag(x)). And Quine’s version of
the liar sentence would then be the diagonalization of it, i.e., α(⌜α(x)⌝) or
ψ(di ag(⌜ψ(di ag(x))⌝)). Of course, ψ(x) could now be any other property, and
the same construction would work. For the incompleteness theorem, we’ll take
ψ(x) to be “x is not derivable in T.” Then α(x) would be “yields a sentence
not derivable in T when applied to the Gödel number of its diagonalization.”
To formalize this in T, we have to find a way to formalize diag. The function
diag(n) is computable, in fact, it is primitive recursive: if n is the Gödel number
of a formula α(x), diag(n) returns the Gödel number of α(⌜α(x)⌝). (Recall,
⌜α(x)⌝ is the standard numeral of the Gödel number of α(x), i.e., # α(x)# ).
If di ag were a function symbol in T representing the function diag, we could
take φ to be the formula ψ(di ag(⌜ψ(di ag(x))⌝)). Notice that
diag(# ψ(di ag(x))# ) = # ψ(di ag(⌜ψ(di ag(x))⌝))#
= # φ# .
Assuming T can derive
di ag(⌜ψ(di ag(x))⌝) = ⌜φ⌝,
it can derive ψ(di ag(⌜ψ(di ag(x))⌝)) ↔ ψ(⌜φ⌝). But the left hand side is, by
definition, φ.
Of course, di ag will in general not be a function symbol of T, and cer-
tainly is not one of Q. But, since diag is computable, it is representable in Q
by some formula θdiag (x, y). So instead of writing ψ(di ag(x)) we can write
∃y (θdiag (x, y) ∧ ψ(y)). Otherwise, the proof sketched above goes through, and
in fact, it goes through already in Q.
inc:inp:fix: Lemma 37.2. Let ψ(x) be any formula with one free variable x. Then there
lem:fixed-point
is a sentence φ such that Q ⊢ φ ↔ ψ(⌜φ⌝).
Proof. Given ψ(x), let α(x) be the formula ∃y (θdiag (x, y) ∧ ψ(y)) and let φ be
its diagonalization, i.e., the formula α(⌜α(x)⌝).
Since θdiag represents diag, and diag(# α(x)# ) = # φ# , Q can derive
inc:inp:fix: θdiag (⌜α(x)⌝, ⌜φ⌝) (37.1)
repdiag1
inc:inp:fix: ∀y (θdiag (⌜α(x)⌝, y) → y = ⌜φ⌝). (37.2)
repdiag2
Now we show that Q ⊢ φ ↔ ψ(⌜φ⌝). We argue informally, using just logic and
facts derivable in Q.
First, suppose φ, i.e., α(⌜α(x)⌝). Going back to the definition of α(x), we
see that α(⌜α(x)⌝) just is
∃y (θdiag (⌜α(x)⌝, y) ∧ ψ(y)).
Consider such a y. Since θdiag (⌜α(x)⌝, y), by eq. (37.2), y = ⌜φ⌝. So, from
ψ(y) we have ψ(⌜φ⌝).
Now suppose ψ(⌜φ⌝). By eq. (37.1), we have
It follows that
digression You should compare this to the proof of the fixed-point lemma in com-
putability theory. The difference is that here we want to define a statement in
terms of itself, whereas there we wanted to define a function in terms of itself;
this difference aside, it is really the same idea.
content/incompleteness/incompleteness-provability/first-incompleteness-thm.tex
Proof. Suppose T derives γT . Then there is a derivation, and so, for some
number m, the relation Prf T (m, # γT # ) holds. But then Q derives the sen-
tence Prf T (m, ⌜γT ⌝). So Q derives ∃x Prf T (x, ⌜γT ⌝), which is, by definition,
ProvT (⌜γT ⌝). By eq. (37.3), Q derives ¬γT , and since T extends Q, so does T.
We have shown that if T derives γT , then it also derives ¬γT , and hence it
would be inconsistent.
Note that every ω-consistent theory is also consistent. This follows simply
from the fact that if T is inconsistent, then T ⊢ φ for every φ. In particular, if
T is inconsistent, it derives both ¬φ(n) for every n and also derives ∃x φ(x). So,
if T is inconsistent, it is ω-inconsistent. By contraposition, if T is ω-consistent,
it must be consistent.
inc:inp:1in: Lemma 37.5. If T is an ω-consistent, axiomatizable theory extending Q,
lem:omega-cons-G-unref
then T ⊬ ¬γT .
Problem 37.2. Every ω-consistent theory is consistent. Show that the con-
verse does not hold, i.e., that there are consistent but ω-inconsistent theories.
Do this by showing that Q ∪ {¬γQ } is consistent but ω-inconsistent.
content/incompleteness/incompleteness-provability/rosser-thm.tex
but that’s just RProvT (⌜ρT ⌝). By eq. (37.4), Q ⊢ ¬ρT . Since T extends Q, also
T ⊢ ¬ρT . We’ve assumed that T ⊢ ρT , so T would be inconsistent, contrary
to the assumption of the theorem.
Now, let’s show that T ⊬ ¬ρT . Again, suppose it did, and suppose n is the
Gödel number of a derivation of ¬ρT . Then Ref T (n, # ρT # ) holds, and since
Ref T represents Ref T in Q, Q ⊢ Ref T (n, ⌜ρT ⌝). We’ll again show that T would
then be inconsistent because it would also derive ρT . Since
is logically equivalent to
We argue informally using logic, making use of facts about what Q derives.
Suppose x is arbitrary and Prf T (x, ⌜ρT ⌝). We already know that T ⊬ ρT ,
and so for every k, Q ⊢ ¬Prf T (k, ⌜ρT ⌝). Thus, for every k it follows that
x ̸= k. In particular, we have (a) that x ̸= n. We also have ¬(x = 0 ∨ x =
1 ∨ · · · ∨ x = n − 1) and so by Lemma 35.24, (b) ¬(x < n). By Lemma 35.25,
n < x. Since Q ⊢ Ref T (n, ⌜ρT ⌝), we have n < x ∧ Ref T (n, ⌜ρT ⌝), and from
that ∃z (z < x ∧ Ref T (z, ⌜ρT ⌝)). Since x was arbitrary we get, as required, that
Problem 37.3. Two sets A and B of natural numbers are said to be com-
putably inseparable if there is no decidable set X such that A ⊆ X and B ⊆ X
(X is the complement, N \ X, of X). Let T be a consistent axiomatizable
extension of Q. Suppose A is the set of Gödel numbers of sentences provable
in T and B the set of Gödel numbers of sentences refutable in T. Prove that
A and B are computably inseparable.
content/incompleteness/incompleteness-provability/godels-paper.tex
paper, it is easy to see what is going on at each stage: first Gödel describes the
formal system P (syntax, axioms, proof rules); then he defines the primitive
recursive functions and relations; then he shows that xBy is primitive recursive,
and argues that the primitive recursive functions and relations are represented
in P. He then goes on to prove the incompleteness theorem, as above. In
Section 3, he shows that one can take the unprovable assertion to be a sentence
in the language of arithmetic. This is the origin of the β-lemma, which is what
we also used to handle sequences in showing that the recursive functions are
representable in Q. Gödel doesn’t go so far to isolate a minimal set of axioms
that suffice, but we now know that Q will do the trick. Finally, in Section 4,
he sketches a proof of the second incompleteness theorem.
content/incompleteness/incompleteness-provability/provability-conditions.tex
for every formula φ. Notice that this is really a schema, which is to say,
infinitely many axioms (and it turns out that PA is not finitely axiomatizable).
But since one can effectively determine whether or not a string of symbols is
an instance of an induction axiom, the set of axioms for PA is computable.
PA is a much more robust theory than Q. For example, one can easily prove
that addition and multiplication are commutative, using induction in the usual
way. In fact, most finitary number-theoretic and combinatorial arguments can
be carried out in PA.
Since PA is computably axiomatized, the derivability predicate Prf PA (x, y)
is computable and hence represented in Q (and so, in PA). As before, we will
take Prf PA (x, y) to denote the formula representing the relation. Let ProvPA (y)
be the formula ∃x Prf PA (x, y), which, intuitively says, “y is derivable from the
axioms of PA.” The reason we need a little bit more than the axioms of Q
is we need to know that the theory we are using is strong enough to derive a
few basic facts about this derivability predicate. In fact, what we need are the
following facts:
P1. If PA ⊢ φ, then PA ⊢ ProvPA (⌜φ⌝).
P2. For all formulas φ and ψ,
The only way to verify that these three properties hold is to describe the
formula ProvPA (y) carefully and use the axioms of PA to describe the relevant
formal derivations. Conditions (1) and (2) are easy; it is really condition (3)
that requires work. (Think about what kind of work it entails . . . ) Carrying
out the details would be tedious and uninteresting, so here we will ask you to
take it on faith that PA has the three properties listed above. A reasonable
choice of ProvPA (y) will also satisfy
of the 1931 paper, he sketches the proof of the second incompleteness theorem,
and promises the details in a later paper. He never got around to it; since
everyone who understood the argument believed that it could be carried out
(he did not need to fill in the details.)
content/incompleteness/incompleteness-provability/second-incompleteness-thm.tex
inc:inp:2in: Theorem 37.8. Assuming PA is consistent, then PA does not derive ConPA .
thm:second-incompleteness
ConPA → γPA . This will show that PA doesn’t derive ConPA . Here is a sketch
of the proof, in PA. (For simplicity, we drop the PA subscripts.)
The use of logic in the above just elementary facts from propositional logic,
e.g., eq. (37.7) uses ⊢ ¬φ ↔ (φ → ⊥) and eq. (37.12) uses φ → (ψ → χ), φ → ψ ⊢
φ → χ. The use of condition P2 in eq. (37.9) and eq. (37.10) relies on instances
of P2, Prov(⌜φ → ψ⌝) → (Prov(⌜φ⌝) → Prov(⌜ψ⌝)). In the first one, φ ≡ γ and
ψ ≡ Prov(⌜γ⌝) → ⊥; in the second, φ ≡ Prov(⌜G⌝) and ψ ≡ ⊥.
The more abstract version of the second incompleteness theorem is as fol-
lows:
digression The moral of the story is that no “reasonable” consistent theory for math-
ematics can derive its own consistency statement. Suppose T is a theory of
mathematics that includes Q and Hilbert’s “finitary” reasoning (whatever that
may be). Then, the whole of T cannot derive the consistency statement of T,
and so, a fortiori, the finitary fragment can’t derive the consistency statement
of T either. In that sense, there cannot be a finitary consistency proof for “all
of mathematics.”
There is some leeway in interpreting the term “finitary,” and Gödel, in the
1931 paper, grants the possibility that something we may consider “finitary”
may lie outside the kinds of mathematics Hilbert wanted to formalize. But
Gödel was being charitable; today, it is hard to see how we might find something
that can reasonably be called finitary but is not formalizable in, say, ZFC,
Zermelo–Fraenkel set theory with the axiom of choice.
content/incompleteness/incompleteness-provability/lob-thm.tex
2. Suppose X is true.
3. Then what it says holds; i.e., we have: if X is true, then Santa Claus
exists.
4. Since we are assuming X is true, we can conclude that Santa Claus exists,
by modus ponens from (2) and (3).
5. We have succeeded in deriving (4), “Santa Claus exists,” from the as-
sumption (2), “X is true.” By conditional proof, we have shown: “If X
is true, then Santa Claus exists.”
A formalization of this idea, replacing “is true” with “is derivable,” and “Santa
Claus exists” with φ, yields the proof of Löb’s theorem. The trick is to apply
the fixed-point lemma to the formula ProvT (y) → φ. The fixed point of that
corresponds to the sentence X in the preceding sketch.
Proof of Theorem 37.10. Suppose φ is a sentence such that T derives ProvT (⌜φ⌝)→
φ. Let ψ(y) be the formula ProvT (y) → φ, and use the fixed-point lemma to
find a sentence θ such that T derives θ ↔ ψ(⌜θ⌝). Then each of the following
is derivable in T:
With Löb’s theorem in hand, there is a short proof of the second incomplete-
ness theorem (for theories having a derivability predicate satisfying conditions
P1–P3): if T ⊢ ProvT (⌜⊥⌝) → ⊥, then T ⊢ ⊥. If T is consistent, T ⊬ ⊥. So,
T ⊬ ProvT (⌜⊥⌝) → ⊥, i.e., T ⊬ ConT . We can also apply it to show that δ, the
fixed point of ProvT (x), is derivable. For since
T ⊢ ProvT (⌜δ⌝) ↔ δ
in particular
T ⊢ ProvT (⌜δ⌝) → δ
2. T ⊢ φ → ProvT (⌜φ⌝).
4. T ⊢ ProvT (⌜φ⌝) → φ
content/incompleteness/incompleteness-provability/tarski-thm.tex
Now one can ask, is the converse also true? That is, is every relation
definable in N computable? The answer is no. For example:
so ∃s θT (z, x, s) defines H in N.
inc:inp:tar: Theorem 37.14. The set of true sentences of arithmetic is not definable in
thm:tarski
arithmetic.
Proof. Suppose θ(x) defined it, i.e., N ⊨ φ iff N ⊨ θ(⌜φ⌝). By the fixed-
point lemma, there is a formula φ such that Q ⊢ φ ↔ ¬θ(⌜φ⌝), and hence
N ⊨ φ ↔ ¬θ(⌜φ⌝). But then N ⊨ φ if and only if N ⊨ ¬θ(⌜φ⌝), which
contradicts the fact that θ(y) is supposed to define the set of true statements
of arithmetic.
Second-order Logic
This is the beginnings of a part on second-order logic.
Chapter 38
Basic syntax and semantics for SOL covered so far. As a chapter it’s
too short. Substitution for second-order variables has to be covered to be
able to talk about derivation systems for SOL, and there’s some subtle
issues there.
content/second-order-logic/syntax-and-semantics/introduction.tex
38.1 Introduction
In first-order logic, we combine the non-logical symbols of a given language, i.e., sol:syn:int:
sec
its constant symbols, function symbols, and predicate symbols, with the logical
symbols to express things about first-order structures. This is done using the
notion of satisfaction, which relates a structure M, together with a variable
assignment s, and a formula φ: M, s ⊨ φ holds iff what φ expresses when its
constant symbols, function symbols, and predicate symbols are interpreted as
M says, and its free variables are interpreted as s says, is true. The interpre-
tation of the identity predicate = is built into the definition of M, s ⊨ φ, as is
the interpretation of ∀ and ∃. The former is always interpreted as the identity
relation on the domain |M| of the structure, and the quantifiers are always
interpreted as ranging over the entire domain. But, crucially, quantification
562
38.2. TERMS AND FORMULAS
is only allowed over elements of the domain, and so only object variables are
allowed to follow a quantifier.
In second-order logic, both the language and the definition of satisfac-
tion are extended to include free and bound function and predicate variables,
and quantification over them. These variables are related to function sym-
bols and predicate symbols the same way that object variables are related
to constant symbols. They play the same role in the formation of terms
and formulas of second-order logic, and quantification over them is handled
in a similar way. In the standard semantics, the second-order quantifiers
range over all possible objects of the right type (n-place functions from |M|
to |M| for function variables, n-place relations for predicate variables). For
instance, while ∀v0 (P01 (v0 ) ∨ ¬P01 (v0 )) is a formula in both first- and second-
order logic, in the latter we can also consider ∀V01 ∀v0 (V01 (v0 ) ∨ ¬V01 (v0 )) and
∃V01 ∀v0 (V01 (v0 ) ∨ ¬V01 (v0 )). Since these contain no free variables, they are
sentences of second-order logic. Here, V01 is a second-order 1-place predicate
variable. The allowable interpretations of V01 are the same that we can assign
to a 1-place predicate symbol like P01 , i.e., subsets of |M|. Quantification over
them then amounts to saying that ∀v0 (V01 (v0 ) ∨ ¬V01 (v0 )) holds for all ways
of assigning a subset of |M| as the value of V01 , or for at least one. Since ev-
ery set either contains or fails to contain a given object, both are true in any
structure.
content/second-order-logic/syntax-and-semantics/terms-formulas.tex
way a first-order language is: by listing its constant symbols, function symbols,
and predicate symbols.
explanation So, a second-order term looks just like a first-order term, except that where
a first-order term contains a function symbol fi n , a second-order term may
contain a function variable uin in its place.
content/second-order-logic/syntax-and-semantics/satisfaction.tex
38.3 Satisfaction
explanation To define the satisfaction relation M, s ⊨ φ for second-order formulas, we have sol:syn:sat:
sec
to extend the definitions to cover second-order variables. The notion of a struc-
ture is the same for second-order logic as it is for first-order logic. There is
only a difference for variable assignments s: these now must not just provide
values for the first-order variables, but also for the second-order variables.
A structure assigns a value to each constant symbol and function symbol, explanation
and a second-order variable assignment assigns objects and functions to each
object and function variable. Together, they let us assign a value to every
term.
Definition 38.4 (Value of a Term). If t is a term of the language L, M is
a structure for L, and s is a variable assignment for M, the value ValM
s (t) is
defined as for first-order terms, plus the following clause:
t ≡ u(t1 , . . . , tn ):
ValM M M
s (t) = s(u)(Vals (t1 ), . . . , Vals (tn )).
n
2. φ ≡ ∀X ψ: M, s ⊨ φ iff for every M ⊆ |M| , M, s[M/X] ⊨ ψ.
n
3. φ ≡ ∃X ψ: M, s ⊨ φ iff for at least one M ⊆ |M| so that M, s[M/X] ⊨
ψ.
n
4. φ ≡ ∀u ψ: M, s ⊨ φ iff for every f : |M| → |M|, M, s[f /u] ⊨ ψ.
n
5. φ ≡ ∃u ψ: M, s ⊨ φ iff for at least one f : |M| → |M| so that
M, s[f /u] ⊨ ψ.
is never satisfied: For any structure M, the assignment s(X) = |M| will make
the sentence false. On the other hand, the sentence
is satisfied relative to any assignment s, since we can always find M ⊆ |M| but
M ̸= |M| (e.g., M = ∅).
Problem 38.1. Show that in second-order logic ∀ and → can define the other
connectives:
content/second-order-logic/syntax-and-semantics/semantic-notions.tex
content/second-order-logic/syntax-and-semantics/expressive-power.tex
In first-order logic, we can only say that the subsets, relations, or functions
assigned to one of the non-logical symbols of the language have a property.
And when we say that subsets, relations, functions exist that have a property,
or that all of them have it, we can use second-order quantification in specifying
this property as well. This lets us define relations not definable in first-order
logic, and express properties of the domain not expressible in first-order logic.
2
Definition 38.14. If M is a structure for a language L, a relation R ⊆ |M| is
definable in L if there is some formula φR (x, y) with only the variables x and y
free, such that R(a, b) holds (i.e., ⟨a, b⟩ ∈ R) iff M, s ⊨ φR (x, y) for s(x) = a
and s(y) = b.
Example 38.15. In first-order logic we can define the identity relation Id|M|
(i.e., {⟨a, a⟩ : a ∈ |M|}) by the formula x = y. In second-order logic, we can
define this relation without =. For if a and b are the same element of |M|, then
they are elements of the same subsets of |M| (since sets are determined by their
elements). Conversely, if a and b are different, then they are not elements of
the same subsets: e.g., a ∈ {a} but b ∈ / {a} if a ̸= b. So “being elements of
the same subsets of |M|” is a relation that holds of a and b iff a = b. It is a
relation that can be expressed in second-order logic, since we can quantify over
all subsets of |M|. Hence, the following formula defines Id|M| :
∀X (X(x) ↔ X(y))
Problem 38.2. Show that ∀X (X(x)→X(y)) (note: → not ↔!) defines Id|M| .
content/second-order-logic/syntax-and-semantics/inf-count.tex
M ⊨ Inf iff |M| is infinite. We can then define Fin ≡ ¬Inf; M ⊨ Fin iff |M| is
finite. No single sentence of pure first-order logic can express that the domain
is infinite although an infinite set of them can. There is no set of sentences of
pure first-order logic that is satisfied in a structure iff its domain is finite.
m0 , m1 , m2 , . . .
for some s. Let m = s(z) and f = s(u) and consider M = {m, f (m), f (f (m)), . . . }.
M so defined is clearly enumerable. Then
Problem 38.3. The sentence Inf ∧ Count is true in all and only denumerable
domains. Adjust the definition of Count so that it becomes a different sentence
that directly expresses that the domain is denumerable, and prove that it does.
Chapter 39
Metatheory of Second-order
Logic
content/second-order-logic/metatheory/introduction.tex
570
39.1. INTRODUCTION
39.1 Introduction
sol:met:int: First-order logic has a number of nice properties. We know it is not decidable,
sec
but at least it is axiomatizable. That is, there are proof systems for first-
order logic which are sound and complete, i.e., they give rise to a derivability
relation ⊢ with the property that for any set of sentences Γ and sentence Q,
Γ ⊨ φ iff Γ ⊢ φ. This means in particular that the validities of first-order logic
are computably enumerable. There is a computable function f : N → Sent(L)
such that the values of f are all and only the valid sentences of L. This is so
because derivations can be enumerated, and those that derive a single sentence
are then mapped to that sentence. Second-order logic is more expressive than
first-order logic, and so it is in general more complicated to capture its validities.
In fact, we’ll show that second-order logic is not only undecidable, but its
validities are not even computably enumerable. This means there can be no
sound and complete proof system for second-order logic (although sound, but
incomplete proof systems are available and in fact are important objects of
research).
First-order logic also has two more properties: it is compact (if every finite
subset of a set Γ of sentences is satisfiable, Γ itself is satisfiable) and the
Löwenheim–Skolem Theorem holds for it (if Γ has an infinite model it has
a denumerable model). Both of these results fail for second-order logic. Again,
the reason is that second-order logic can express facts about the size of domains
that first-order logic cannot.
content/second-order-logic/metatheory/second-order-arithmetic.tex
∀x x′ ̸= 0
∀x ∀y (x′ = y ′ → x = y)
∀x (x = 0 ∨ ∃y x = y ′ )
∀x (x + 0) = x
∀x ∀y (x + y ′ ) = (x + y)′
∀x (x × 0) = 0
∀x ∀y (x × y ′ ) = ((x × y) + x)
∀x ∀y (x < y ↔ ∃z (z ′ + x) = y)
It says that if a subset X of the domain contains 0M and with any x ∈ |M|
also contains ′M (x) (i.e., it is “closed under successor”) it contains everything
in the domain (i.e., X = |M|).
The induction axiom guarantees that any structure satisfying it contains
only those elements of |M| the axioms require to be there, i.e., the values of n
for n ∈ N. A model of PA2 contains no non-standard numbers.
Proof. Let N = {ValM (n) : n ∈ N}, and suppose M ⊨ PA2 . Of course, for any
n ∈ N, ValM (n) ∈ |M|, so N ⊆ |M|.
Now for inclusion in the other direction. Consider a variable assignment s
with s(X) = N . By assumption,
Above we defined PA2 as the theory that contains the first eight arith-
metical axioms plus the second-order induction axiom. In fact, thanks to the
expressive power of second-order logic, only the first two of the arithmetical
axioms plus induction are needed for second-order Peano arithmetic.
Proposition 39.3. Let PA2† be the second-order theory containing the first sol:met:spa:
prop:sol-pa-definable
two arithmetical axioms (the successor axioms) and the second-order induction
axiom. Then ≤, +, and × are definable in PA2† .
content/second-order-logic/metatheory/undecidability-and-axiomatizability.tex
sol:met:nax: Theorem 39.5. There is no sound and complete derivation system for second-
cor:sol-not-axiomatizable
order logic.
content/second-order-logic/metatheory/compactness.tex
content/second-order-logic/metatheory/loewenheim-skolem.tex
Proof. Count ∧ Inf is true in N but not in any structure M with |M| non-
enumerable.
Chapter 40
This section deals with coding powersets and the continuum in second-
order logic. The results are stated but proofs have yet to be filled in. There
are no problems yet—and the definitions and results themselves may have
problems. Use with caution and report anything that’s false or unclear.
content/second-order-logic/sol-and-set-theory/introduction.tex
40.1 Introduction
sol:set:int:
sec
575
CHAPTER 40. SECOND-ORDER LOGIC AND SET THEORY
Since second-order logic can quantify over subsets of the domain as well as
functions, it is to be expected that some amount, at least, of set theory can be
carried out in second-order logic. By “carry out,” we mean that it is possible
to express set theoretic properties and statements in second-order logic, and is
possible without any special, non-logical vocabulary for sets (e.g., the member-
ship predicate symbol of set theory). For instance, we can define unions and
intersections of sets and the subset relationship, but also compare the sizes of
sets, and state results such as Cantor’s Theorem.
content/second-order-logic/sol-and-set-theory/comparing-sets.tex
Proposition 40.2. The formula ∀x (X(x)↔Y (x)) defines the identity relation
on sets, i.e., M, s ⊨ ∀x (X(x) ↔ Y (x)) iff s(X) = s(Y ).
Proposition 40.3. The formula ∃x X(x) defines the property of being non-
empty, i.e., M, s ⊨ ∃x X(x) iff s(X) ̸= ∅.
Two sets are the same size, or “equinumerous,” X ≈ Y , iff there is a bijec-
tive function f : X → Y .
Proof. The sentence is satisfied in a structure M if, for any subsets X ⊆ |M|
and Y ⊆ |M|, if X ⪯ Y and Y ⪯ X then X ≈ Y . But this holds for any sets
X and Y —it is the Schröder-Bernstein Theorem.
content/second-order-logic/sol-and-set-theory/cardinalities.tex
We know from Cantor’s Theorem that there are non-enumerable sets, and
in fact, that there are infinitely many different levels of infinite sizes. Set
theory develops an entire arithmetic of sizes of sets, and assigns infinite cardinal
numbers to sets. The natural numbers serve as the cardinal numbers measuring
the sizes of finite sets. The cardinality of denumerable sets is the first infinite
cardinality, called ℵ0 (“aleph-nought” or “aleph-zero”). The next infinite size
is ℵ1 . It is the smallest size a set can be without being countable (i.e., of
size ℵ0 ). We can define “X has size ℵ0 ” as Aleph0 (X) ↔ Inf(X) ∧ Count(X).
X has size ℵ1 iff all its subsets are finite or have size ℵ0 , but is not itself
of size ℵ0 . Hence we can express this by the formula Aleph1 (X) ≡ ∀Y (Y ⊆
content/second-order-logic/sol-and-set-theory/power-of-continuum.tex
Pow(Y, R, X) ≡
∀Z (Z ⊆ X → ∃x (Y (x) ∧ Codes(x, R, Z))) ∧
∀x (Y (x) → ∀Z (Codes(x, R, Z) → Z ⊆ X)
expresses that s(Y ) s(R)-codes the power set of s(X), i.e., the elements of s(Y )
s(R)-code exactly the subsets of s(X).
With this trick, we can express statements about the power set by quantify- explanation
ing over the codes of subsets rather than the subsets themselves. For instance,
Cantor’s Theorem can now be expressed by saying that there is no injective
function from the domain of any relation that codes the power set of X to X
itself.
∀X ∀Y ∀R (Pow(Y, R, X)→
¬∃u (∀x ∀y (u(x) = u(y) → x = y) ∧
∀x (Y (x) → X(u(x)))))
is valid.
The power set of a denumerable set is non-enumerable, and so its cardinality explanation
is larger than that of any denumerable set (which is ℵ0 ). The size of ℘(N) is
called the “power of the continuum,” since it is the same size as the points on
the real number line, R. If the domain is large enough to code the power set
of a denumerable set, we can express that a set is the size of the continuum
by saying that it is equinumerous with any set Y that codes the power set of
set X of size ℵ0 . (If the domain is not large enough, i.e., it contains no subset
equinumerous with R, then there can also be no relation that codes ℘(X).)
Proof. Pow(Y, R, X) expresses that s(Y ) s(R)-codes the power set of s(X),
which Aleph0 (X) says is countable. So s(Y ) is at least as large as the power
of the continuum, although it may be larger (if multiple elements of s(Y ) code
the same subset of X). This is ruled out be the last conjunct, which requires
the association between elements of s(Y ) and subsets of s(Z) via s(R) to be
injective.
explanation The Continuum Hypothesis is the statement that the size of the continuum
is the first non-enumerable cardinality, i.e, that ℘(N) has size ℵ1 .
Proposition 40.14. The Continuum Hypothesis is true iff
is valid.
Note that it isn’t true that ¬CH is valid iff the Continuum Hypothesis is
false. In an enumerable domain, there are no subsets of size ℵ1 and also no
subsets of the size of the continuum, so CH is always true in an enumerable do-
main. However, we can give a different sentence that is valid iff the Continuum
Hypothesis is false:
is valid.
Chapter 41
Introduction
content/lambda-calculus/introduction/overview.tex
41.1 Overview
lam:int:ovr: The lambda calculus was originally designed by Alonzo Church in the early
sec
1930s as a basis for constructive logic, and not as a model of the computable
functions. But it was soon shown to be equivalent to other definitions of com-
putability, such as the Turing computable functions and the partial recursive
functions. The fact that this initially came as a small surprise makes the char-
acterization all the more interesting.
Lambda notation is a convenient way of referring to a function directly
by a symbolic expression which defines it, instead of defining a name for it.
581
CHAPTER 41. INTRODUCTION
Instead of saying “let f be the function defined by f (x) = x + 3,” one can
say, “let f be the function λx. (x + 3).” In other words, λx. (x + 3) is just a
name for the function that adds three to its argument. In this expression, x
is a dummy variable, or a placeholder: the same function can just as well be
denoted by λy. (y +3). The notation works even with other parameters around.
For example, suppose g(x, y) is a function of two variables, and k is a natural
number. Then λx. g(x, k) is the function which maps any x to g(x, k).
This way of defining a function from a symbolic expression is known as
lambda abstraction. The flip side of lambda abstraction is application: assum-
ing one has a function f (say, defined on the natural numbers), one can apply
it to any value, like 2. In conventional notation, of course, we write f (2) for
the result.
What happens when you combine lambda abstraction with application?
Then the resulting expression can be simplified, by “plugging” the applicand
in for the abstracted variable. For example,
(λx. (x + 3))(2)
can be simplified to 2 + 3.
Up to this point, we have done nothing but introduce new notations for
conventional notions. The lambda calculus, however, represents a more radical
departure from the set-theoretic viewpoint. In this framework:
1. Everything denotes a function.
2. Functions can be defined using lambda abstraction.
3. Anything can be applied to anything else.
For example, if F is a term in the lambda calculus, F (F ) is always assumed
to be meaningful. This liberal framework is known as the untyped lambda
calculus, where “untyped” means “no restriction on what can be applied to
what.”
digression There is also a typed lambda calculus, which is an important variation on the
untyped version. Although in many ways the typed lambda calculus is similar
to the untyped one, it is much easier to reconcile with a classical set-theoretic
framework, and has some very different properties.
Research on the lambda calculus has proved to be central in theoretical
computer science, and in the design of programming languages. LISP, designed
by John McCarthy in the 1950s, is an early example of a language that was
influenced by these ideas.
content/lambda-calculus/introduction/syntax.tex
The system without any constants at all is called the pure lambda calculus.
We’ll mainly be working in the pure λ-calculus, so all lowerce letters will stand
for variables. We use uppercase letters (M , N , etc.) to stand for terms of the
λ-calculus.
We will follow a few notational conventions:
For example,
λxy. xxyxλz. xz
abbreviates
λx. λy. ((((xx)y)x)(λz. (xz))).
You should memorize these conventions. They will drive you crazy at first, but
you will get used to them, and after a while they will drive you less crazy than
having to deal with a morass of parentheses.
Two terms that differ only in the names of the bound variables are called
α-equivalent; for example, λx. x and λy. y. It will be convenient to think of
these as being the “same” term; in other words, when we say that M and N are
the same, we also mean “up to renamings of the bound variables.” Variables
that are in the scope of a λ are called “bound”, while others are called “free.”
There are no free variables in the previous example; but in
(λz. yz)x
content/lambda-calculus/introduction/reduction.tex
digression Alternative notations for substitution are [N/x]M , [x/N ]M , and also M [x/N ].
Beware!
Intuitively, (λx. M )N and M [N/x] have the same meaning; the act of re-
placing the first term by the second is called β-contraction. (λx. M )N is called
a redex and M [N/x] its contractum. Generally, if it is possible to change a
term P to P ′ by β-contraction of some subterm, we say that P β-reduces to P ′
in one step, and write P →− P ′ . If from P we can obtain P ′ with some number
of one-step reductions (possibly none), then P β-reduces to P ′ ; in symbols,
P →→ P ′ . A term that cannot be β-reduced any further is called β-irreducible,
−
or β-normal. We will say “reduces” instead of “β-reduces,” etc., when the
context is clear.
Let us consider some examples.
1. We have
(λx. xxy)λz. z →
− (λz. z)(λz. z)y
→
− (λz. z)y
→
− y.
4. Also, some terms can be reduced in more than one way; for example,
by contracting the innermost one. Note, in this case, however, that both
terms further reduce to the same term, zv.
The final outcome in the last example is not a coincidence, but rather
illustrates a deep and important property of the lambda calculus, known as
the “Church–Rosser property.”
content/lambda-calculus/introduction/church-rosser.tex
Corollary 41.2. Suppose M can be reduced to normal form. Then this normal
form is unique.
Proof. If M →−
→ N1 and M → −
→ N2 , by the previous theorem there is a term P
such that N1 and N2 both reduce to P . If N1 and N2 are both in normal form,
this can only happen if N1 ≡ P ≡ N2 .
Finally, we will say that two terms M and N are β-equivalent, or just
equivalent, if they reduce to a common term; in other words, if there is some P
β
such that M → −
→ P and N → −
→ P . This is written M = N . Using Theorem 41.1,
β
you can check that = is an equivalence relation, with the additional property
β
that for every M and N , if M → −→ N or N → −
→ M , then M = N . (In fact, one
β
can show that = is the smallest equivalence relation having this property.)
content/lambda-calculus/introduction/currying.tex
41.5 Currying
lam:rep:cur: A λ-abstract λx. M represents a function of one argument, which is quite a
sec
limitation when we want to define function accepting multiple arguments. One
way to do this would be by extending the λ-calculus to allow the formation
of pairs, triples, etc., in which case, say, a three-place function λx. M would
expect its argument to be a triple. However, it is more convenient to do this
by Currying.
Let’s consider an example. We’ll pretend for a moment that we have a
+ operation in the λ-calculus. The addition function is 2-place, i.e., it takes
two arguments. But a λ-abstract only gives us functions of one argument: the
syntax does not allow expressions like λ(x, y). (x+y). However, we can consider
the one-place function fx (y) given by λy. (x + y), which adds x to its single
argument y. Actually, this is not a single function, but a family of different
functions “add x,” one for each number x. Now we can define another one-place
function g as λx. fx . Applied to argument x, g(x) returns the function fx —so
its values are other functions. Now if we apply g to x, and then the result to y
β
(λx1 . λx2 . . . . λxn . N )M1 . . . Mn −
→
β
−
→ ((λx2 . . . . λxn . N )[M1 /x1 ])M2 . . . Mn
≡ (λx2 . . . . λxn . N [M1 /x1 ])M2 . . . Mn
..
.
β
−
→ P [M1 /x1 ] . . . [Mn /xn ]
The last line literally means substituting Mi for xi in the body of the function
definition, which is exactly what we want when applying multiple arguments
to a function.
content/lambda-calculus/introduction/lambda-definability.tex
Definition 41.3. For each natural number n, define the Church numeral n to
be the lambda term λx. λy. (x(x(x(. . . x(y))))), where there are n x’s in all.
content/lambda-calculus/introduction/lambda-computable.tex
content/lambda-calculus/introduction/computable-lambda.tex
We will use a more conventional notation to make the rest of the proof more
readable. For example, we will write M (x, y, z) instead of M xyz. While this
is suggestive, you should remember that terms in the untyped lambda calculus
do not have associated arities; so, for the same term M , it makes just as much
sense to write M (x, y) and M (x, y, z, w). But using this notation indicates
that we are treating M as a function of three variables, and helps make the
intentions behind the definitions clearer. In a similar way, we will say “define
M by M (x, y, z) = . . . ” instead of “define M by M = λx. λy. λz. . . ..”
content/lambda-calculus/introduction/basic-pr-lambda.tex
content/lambda-calculus/introduction/composition.tex
In other words, the language of the lambda calculus is well suited to represent
composition.
content/lambda-calculus/introduction/primitive-recursion.tex
So, in general, given lambda terms G′ and H ′ , it suffices to find a term F such
that
for every natural number n; the fact that G′ and H ′ λ-define g and h means
that whenever we plug in numerals m ⃗ for ⃗z, F (n + 1, m)
⃗ will normalize to the
right answer.
But for this, it suffices to find a term F satisfying
F (0) ≡ G
F (n + 1) ≡ H(n, F (n))
In other words, with lambda trickery, we can avoid having to worry about the
extra parameters ⃗z—they just get absorbed in the lambda notation.
Before we define the term F , we need a mechanism for handling ordered
pairs. This is provided by the next lemma.
Lemma 41.10. There is a lambda term D such that for each pair of lambda
terms M and N , D(M, N )(0) →
−
→ M and D(M, N )(1) →
−
→ N.
K(y) = λx. y.
In other words, K is the term λy. λx. y. Looking at it differently, for every M ,
K(M ) is a constant function that returns M on any input.
Now define D(x, y, z) by D(x, y, z) = z(K(y))x. Then we have
D(M, N, 0) →
−
→ 0(K(N ))M →
−
→ M and
D(M, N, 1) →
−
→ 1(K(N ))M →
−
→ K(N )M →
−
→ N,
as required.
The idea is that D(M, N ) represents the pair ⟨M, N ⟩, and if P is assumed
to represent such a pair, P (0) and P (1) represent the left and right projections,
(P )0 and (P )1 . We will use the latter notations.
Lemma 41.11. The λ-definable functions are closed under primitive recur-
sion.
Proof. We need to show that given any terms, G and H, we can find a term F
such that
F (0) ≡ G
F (n + 1) ≡ H(n, F (n))
for every natural number n. The idea is roughly to compute sequences of pairs
using numerals as iterators. Notice that the first pair is just ⟨0, G⟩. Given a
pair ⟨n, F (n)⟩, the next pair, ⟨n + 1, F (n + 1)⟩ is supposed to be equivalent to
⟨n + 1, H(n, F (n))⟩. We will design a lambda term T that makes this one-step
transition.
The details are as follows. Define T (u) by
T (⟨n, M ⟩) →
−
→ ⟨n + 1, H(n, M )⟩.
In other words, on input n, F iterates T n times on ⟨0, G⟩, and then returns
the second component. To start with, we have
content/lambda-calculus/introduction/fixed-point-combinator.tex
If one takes
Y = λg. ((λx. g(xx))(λx. g(xx)))
then Y g and g(Y g) reduce to a common term; so Y g ≡β g(Y g). This is known
as “Curry’s combinator.” If instead one takes
then in fact Y g reduces to g(Y g), which is a stronger statement. This latter
version of Y is known as “Turing’s combinator.”
content/lambda-calculus/introduction/minimization.tex
Then g is λ-definable.
Proof. The idea is roughly as follows. Given x, we will use the fixed-point
lambda term Y to define a function hx (n) which searches for a y starting at n;
then g(x) is just hx (0). The function hx can be expressed as the solution of a
fixed-point equation:
(
n if f (x, n) = 0
hx (n) ≃
hx (n + 1) otherwise.
We can do this using the fixed-point term Y . First, let U be the term
and then let H be the term Y U . Notice that the only free variable in H is x.
Let us show that H satisfies the equation above.
By the definition of Y , we have
H = Y U ≡ U (Y U ) = U (H).
H(n) ≡ U (H, n)
→
−
→ D(n, H(S(n)), F (x, n)),
as required. Notice that if you substitute a numeral m for x in the last line,
the expression reduces to n if F (m, n) reduces to 0, and it reduces to H(S(n))
if F (m, n) reduces to any other numeral.
To finish off the proof, let G be λx. H(0). Then G λ-defines g; in other
words, for every m, G(m) reduces to reduces to g(m), if g(m) is defined, and
has no normal form otherwise.
Chapter 42
Syntax
content/lambda-calculus/syntax/terms.tex
42.1 Terms
lam:syn:trm: The terms of the lambda calculus are built up inductively from an infinite
sec
supply of variables v0 , v1 , . . . , the symbol “λ”, and parentheses. We will use
x, y, z, . . . to designate variables, and M , N , P , . . . to desginate terms.
lam:syn:trm: Definition 42.1 (Terms). The set of terms of the lambda calculus is defined
defn:term
inductively by:
lam:syn:trm: 1. If x is a variable, then x is a term.
defn:term-var
lam:syn:trm: 2. If x is a variable and M is a term, then (λx. M ) is a term.
defn:term-abs
lam:syn:trm: 3. If both M and N are terms, then (M N ) is a term.
defn:term-app
593
CHAPTER 42. SYNTAX
content/lambda-calculus/syntax/unique-readability.tex
Lemma 42.3. The result of an application starts with either two parentheses lam:syn:unq:
lem:app-start
or a parenthesis and a variable.
content/lambda-calculus/syntax/abbreviated-syntax.tex
1. When parentheses are left out, application takes place from left to right.
For example, if M , N , P , and Q are terms, then M N P Q abbreviates
(((M N )P )Q).
2. Again, when parentheses are left out, lambda abstraction is given the
widest scope possible. From example, λx. M N P is read as (λx. M N P ).
3. A lambda can be used to abstract multiple variables. For example,
λxyz. M is short for λx. λy. λz. M .
For example,
λxy. xxyxλz. xz
abbreviates
(λx. (λy. ((((xx)y)x)(λz. (xz))))).
Problem 42.3. Expand the abbreviated term λg. (λx. g(xx))λx. g(xx).
content/lambda-calculus/syntax/free-variables.tex
Example 42.9. In λx. xy, both x and y are in the scope of λx, so x is bound
by λx. Since y is not in the scope of any λy, it is free. In λx. xx, both
occurrences of x are bound by λx, since both are free in xx. In ((λx. xx)x), the
last occurrence of x is free, since it is not in the scope of a λx. In λx. (λx. x)x,
the scope of the first λx is (λx. x)x and the scope of the second λx is the
second-to-last occurrence of x. In (λx. x)x, the last occurrence of x is free,
and the second-to-last is bound. Thus, the second-to-last occurrence of x in
λx. (λx. x)x is bound by the second λx, and the last occurrence by the first λx.
For a term P , we can check all variable occurrences in it and get a set of free
variables. This set is denoted by FV(P ) with a natural definition as follows:
Definition 42.10 (Free variables of a term). The set of free variables of lam:syn:fv:
def:fv
a term is defined inductively by:
1. FV(x) = {x} lam:syn:fv:
def:fv1
2. FV(λx. N ) = FV(N ) \ {x} lam:syn:fv:
def:fv2
3. FV(P Q) = FV(P ) ∪ FV(Q) lam:syn:fv:
def:fv3
Problem 42.4. 1. Identify the scopes of λg and the two λx in this term:
λg. (λx. g(xx))λx. g(xx).
2. In λg. (λx. g(xx))λx. g(xx), are all occurrences of variables bound? By
which abstractions are they bound respectively?
A free variable is like a reference to the outside world (the environment), explanation
and a term containing free variables can be seen as a partially specified term,
since its behaviour depends on how we set up the environment. For example, in
the term λx. f x, which accepts an argument x and returns f of that argument,
the variable f is free. This value of the term is dependent on the environment
it is in, in particular the value of f in that environment.
If we apply abstraction to this term, we get λf. λx. f x. This term is no
longer dependent on the environment variable f , because it now designates a
function that accepts two arguments and returns the result of applying the
first to the second. Changing f in the environment won’t have any effect on
the behavior of this term, as the term will only use whatever is passed as an
argument, and not the value of f in the environment.
Proof. Exercise.
content/lambda-calculus/syntax/substitution.tex
42.5 Substitution
lam:syn:sub: Free variables are references to environment variables, thus it makes sense to explanation
sec
actually use a specific value in the place of a free variable. For example, we
may want to replace f in λx. f x with a specific term, like the identity function
λy. y. This results in λx. (λy. y)x. The process of replacing free variables with
lambda terms is called substitution.
lam:syn:sub: 1. x[N/x] = N .
defn:substitution-1
lam:syn:sub: 2. y[N/x] = y if x ̸= y.
defn:substitution-2
Theorem 42.14. If x ∈ / FV(M ), then FV(M [N/x]) = FV(M ), if the left- lam:syn:sub:
thm:notinfv
hand side is defined.
1. M is a variable: exercise.
FV(λy. P [N/x]) =
= FV(λy. P [N/x]) by (4)
= FV(P [N/x]) \ {y} by Definition 42.10(2)
= FV(P ) \ {y} by inductive hypothesis
= FV(λy. P ) by Definition 42.10(2)
Theorem 42.15. If x ∈ FV(M )), then FV(M [N/x]) = (FV(M ) \ {x}) ∪ lam:syn:sub:
thm:infv
FV(N ), provided the left hand is defined.
FV((λy. P )[N/x]) =
= FV(λy. P [N/x])
= FV(P [N/x]) \ {y}
= ((FV(P ) \ {y}) ∪ (FV(N ) \ {x}) by inductive hypothesis
= (FV(P ) \ {x, y}) ∪ FV(N ) x∈
/ FV(N )
= (FV(λy. P ) \ {x}) ∪ FV(N )
Proof. Exercise.
content/lambda-calculus/syntax/alpha.tex
42.6 α-Conversion
What is the relation between λx. x and λy. y? They both represent the identity lam:syn:alp:
sec
function. They are, of course, syntactically different terms. They differ only in
the name of the bound variable, and one is the result of “renaming” the bound
variable in the other. This is called α-conversion.
α
Definition 42.18 (Change of bound variable, − →). If a term M contains
an occurrence of λx. N , y ∈
/ FV(N ), and N [y/x] is defined, then replacing this
occurrence by
λy. N [y/x]
α
resulting in M ′ is called a change of bound variable, written as M −
→ M ′.
“Smallest” here means the relation contains only pairs that are required by
compatibility and the additional condition, and nothing else. Thus this relation
can also be defined as follows:
α
Definition 42.21 (Change of bound variable, −
→). Change of bound vari- lam:syn:alp:
α defn:aconvone
able (−
→) is inductively defined as follows:
α α
→ N ′ then λx. N −
1. If N − → λx. N ′ lam:syn:alp:
defn:aconvone1
α α
→ P ′ then (P Q) −
2. If P − → (P ′ Q) lam:syn:alp:
defn:aconvone2
α α
→ Q′ then (P Q) −
3. If Q − → (P Q′ ) lam:syn:alp:
defn:aconvone3
α
lam:syn:alp: 4. If x ̸= y, y ∈
/ FV(N ) and N [y/x] is defined, then λx. N −
→ λy. N [y/x].
defn:aconvone4
The definitions are equivalent, but we leave the proof as an exercise. From
now on we will use the inductive definition.
α α
Definition 42.22 (α-conversion, − →
→). α-conversion (−
→
→) is the smallest re-
α
flexitive and transitive relation on terms containing −
→.
b) If x ∈
/ F V (N ), then:
Proof. Exercise.
1. M is a variable z: Exercise.
lam:syn:alp: Corollary 42.31. For any M , R, and y, there exists a pair of M ′ and R′ such
cor:sub α α
that M ′ = M , R = R′ and M ′ [R′ /y] is defined. Moreover, if there is another
α α
pair M ′′ = M and R′′ with M ′ [R′ /y] defined, then M ′ [R′ /y] = M ′′ [R′′ /y].
content/lambda-calculus/syntax/de-bruijn.tex
content/lambda-calculus/syntax/term-revisited.tex
It is not hard to see that they are well defined, because α-conversion is
compatible.
content/lambda-calculus/syntax/beta.tex
42.9 β-reduction
When we see (λm. (λy. y)m), it is natural to conjecture that it has some connec- lam:int:bet:
sec
tion with λm. m, namely the second term should be the result of “simplifying”
the first. The notion of β-reduction captures this intuition formally.
β β
Definition 42.39 (β-contraction, − →). The β-contraction (− →) is the small- lam:int:bet:
defn:betacontr
est compatible relation on terms satisfying the following condition:
β
(λx. N )Q −
→ N [Q/x]
β
We say P is β-contracted to Q if P −
→ Q. A term of the form (λx. N )Q is
called a redex.
Problem 42.16. Spell out the equivalent inductive definitions of β-contraction lam:int:bet:
prob:def
as we did for change of bound variable in Definition 42.21.
β β
Definition 42.40 (β-reduction, −
→
→). β-reduction (−
→
→) is the smallest re- lam:int:bet:
β defn:betared
flexive, transitive relation on terms containing −
→. We say P is β-reduced to
β
Q if P − →
→ Q.
β β
We will write →− instead of −→, and →−
→ instead of −
→
→ when context is clear.
β
Informally speaking, M − →
→ N if and only if M can be changed to N by
zero or several steps of β-contraction.
Definition 42.41 (β-normal). A term that cannot be β-contracted any fur-
ther is said to be β-normal.
β
If M −→→ N and N is β-normal, then we say N is a normal form of M . One
may ask if the normal form of a term is unique, and the answer is yes, as we
will see later.
Let us consider some examples.
1. We have
(λx. xxy)λz. z →
− (λz. z)(λz. z)y
→
− (λz. z)y
→
− y
4. Also, some terms can be reduced in more than one way; for example,
(λx. (λy. yx)z)v →
− (λy. yv)z
by contracting the outermost application; and
(λx. (λy. yx)z)v →
− (λx. zx)v
by contracting the innermost one. Note, in this case, however, that both
terms further reduce to the same term, zv.
The final outcome in the last example is not a coincidence, but rather
illustrates a deep and important property of the lambda calculus, known as
the Church–Rosser property.
In general, there is more than one way to β-reduce a term, thus many digression
reduction strategies have been invented, among which the most common is the
natural strategy. The natural strategy always contracts the left-most redex,
where the position of a redex is defined as its starting point in the term. The
natural strategy has the useful property that a term can be reduced to a normal
form by some strategy iff it can be reduced to normal form using the natural
strategy. In what follows we will use the natural stratuegy unless otherwise
specified.
1. M = M .
2. If M = N , then N = M .
3. If M = N , N = O, then M = O.
4. If M = N , then P M = P N .
5. If M = N , then M Q = N Q.
7. (λx. N )Q = N [Q/x].
The first three rules make the relation an equivalence relation; the next
three make it compatible; the last ensures that it contains β-contraction.
Informally speaking, two terms are β-equivalent if and only if one of them
can be changed to the other in zero or more steps of β-contraction, or “inverse”
of β-contraction. The inverse of β-contraction is defined so that M inverse-β-
contracts to N iff N β-contracts to M .
Besides the above rules, we will extend the relation with more rules, and
X
denote the extended equivalence relation as =, where X is the extending rule.
content/lambda-calculus/syntax/eta.tex
42.10 η-conversion
There is another relation on λ terms. In section 42.4 we used the example lam:syn:eta:
sec
λx. (f x), which accepts an argument and applies f to it. In other words, it
is the same function as f : λx. (f x)N and f N both reduce to f N . We use
η-reduction (and η-extension) to capture this idea.
η η
Definition 42.43 (η-contraction, − →). η-contraction (− →) is the smallest lam:syn:eta:
defn:beredone
compatible relation on terms satisfying the following condition:
η
λx. M x −
→ M provided x ∈
/ F V (M )
βη βη
Definition 42.44 (βη-reduction, −−→
→). βη-reduction (−−→
→) is the smallest lam:syn:eta:
β η defn:bered
reflexive, transitive relation on terms containing −→ and −
→, i.e., the rules of
reflexivity and transitive plus the following two rules:
β βη
1. If M −
→ N then M −−→
→ N. lam:syn:eta:
defn:bered3
η βη
2. If M −
→ N then M −−→
→ N. lam:syn:eta:
defn:bered4
Roughly speaking, the rule states that two terms, viewed as functions,
should be considered equal if they behave the same for the same argument.
We now prove that the η rule provides exactly the extensionality, and noth-
ing else.
ext η
Theorem 42.47. M = N if and only if M = N .
η
Proof. First we prove that = is closed under the extensionality rule. That
η η ext
is, ext rule doesn’t add anything to =. We then have = contains = , and if
ext η
M = N , then M = N .
η
To prove = is closed under ext, note that for any M = N derived by the
η η
ext rule, we have M x = N x as premise. Then we have λx. M x = λx. N x by a
η
rule of =, applying η on both side gives us M = N .
ext
Similarly we prove that the η rule is contained in = . For any λx. M x and
ext ext
M with x ∈ / F V (M ), we have that (λx. M x)x = M x, giving us λx. M x = M
by the ext rule.
Chapter 43
content/lambda-calculus/church-rosser/definitions-and-properties.tex
609
CHAPTER 43. THE CHURCH–ROSSER PROPERTY
X
Definition 43.1 (Church–Rosser property, CR). A relation −→ on terms
X X
is said to satisfy the Church–Rosser property iff, whenever M −→ P and M −→
X X
Q, then there exists some N such that P −→ N and Q −→ N .
X
Theorem 43.2. If a relation −→ satisfies the Church–Rosser property, and lam:cr:dap:
X X X thm:str
−→
→ is the smallest transitive relation containing −→, then −→
→ satisfies the
Church–Rosser property too.
Proof. Suppose
X X X
M −→ P1 −→ . . . −→ Pm and
X X X
M −→ Q1 −→ . . . −→ Qn .
X X
We construct N in such a way that Ni,j −→ Ni+1,j and Ni,j −→ Ni,j+1 . It
is defined as follows:
N0,0 = M
Ni,0 = Pi if 1 ≤ i ≤ m
N0,j = Qj if 1 ≤ j ≤ n
and otherwise:
Ni,j = R
X X
where R is a term such that Ni−1,j −→ R and Ni,j−1 −→ R. By the Church–
X
Rosser property of −→, such a term always exists.
X X X X
Now we have Nm,0 −→ . . . −→ Nm,n and N0,n −→ . . . −→ Nm,n . Note Nm,0
X
is P and N0,n is Q. By definition of −→
→ the theorem follows.
content/lambda-calculus/church-rosser/parallel-beta-reduction.tex
Proof. Exercise.
β β β
Lemma 43.6. If M =⇒ M ′ and R =⇒ R′ , then M [R/y] =⇒ M ′ [R′ /y]. lam:cr:pb:
lem:comp
β
Proof. By induction on the derivation of M =⇒ M ′ .
1. The last step is (1): Exercise.
β
2. The last step is (2): Then M is λx. N and M ′ is λx. N ′ , where N =⇒ N ′ .
β β
We want to prove that (λx. N )[R/y] =⇒ (λx. N ′ )[R′ /y], i.e., λx. N [R/y] =⇒
λx. N ′ [R/y]. This follows immediately by (2) and the induction hypoth-
esis.
3. The last step is (3): Exercise.
4. The last step is (4): M is (λx. N )Q and M ′ is N ′ [Q′ /x]. We want to prove
β β
that ((λx. N )Q)[R/y] =⇒ N ′ [Q′ /x][R′ /y], i.e., (λx. N [R/y])Q[R/y] =⇒
N ′ [R′ /y][Q′ [R′ /y]/x]. This follows by (4) and the induction hypothesis.
content/lambda-calculus/church-rosser/beta-reduction.tex
43.3 β-reduction
lam:cr:b:
sec β β
lam:cr:b: → M ′ , then M =⇒ M ′ .
Lemma 43.9. If M −
lem:one-par
β
→ M ′ , then M is (λx. N )Q, M ′ is N [Q/x], for some x, N ,
Proof. If M −
β β
and Q. Since N =⇒ N and Q =⇒ Q by Theorem 43.4, we immediately
β
have (λx. N )Q =⇒ N [Q/x] by Definition 43.3(4).
β β
lam:cr:b: Lemma 43.10. If M =⇒ M ′ , then M −
→ M ′.
→
lem:par-red
β
Proof. By induction on the derivation of M =⇒ M ′ .
β
1. The last rule is (1): Then M and M ′ are just x, and x −
→
→ x.
2. The last rule is (2): M is λx. N and M ′ is λx. N ′ for some x, N , N ′ ,
β β
where N =⇒ N ′ . By induction hypothesis we have N − →→ N ′ . Then
β β β
→ λx. N ′ (by the same series of −
λx. N −
→ → N ′ ).
→ contractions as N −
→
3. The last rule is (3): M is P Q and M ′ is P ′ Q′ for some P , Q, P ′ , Q′ , where
β β β
P =⇒ P ′ and Q =⇒ Q′ . By induction hypothesis we have P −→ P ′ and
→
β β β
Q− → Q′ . So P Q −
→ → P ′ Q′ by the reduction sequence P −
→ → P ′ followed
→
β ′
by the reduction Q −→
→Q.
4. The last rule is (4): M is (λx. N )Q and M ′ is N ′ [Q′ /x] for some x, N ,
β β
M ′ , Q, Q′ , where N =⇒ N ′ and Q =⇒ Q′ . By induction hypothesis
β β β β
we get Q −→ → Q′ and N −
→→ N ′ . So (λx. N )Q −
→ N ′ [Q′ /x] by N −
→ → N′
→
β
→ Q′ and finally contraction of (λx. N ′ )Q′ to N ′ [Q′ /x].
followed by Q −
→
β β
Lemma 43.11. −
→
→ is the smallest transitive relation containing =⇒. lam:cr:b:
lem:str
X β
Proof. Let −→→ be the smallest transitive relation containing =⇒.
β X β β β
−→→⊆−→ →: Suppose M − →→ M ′ , i.e., M ≡ M1 − → ... − → Mk ≡ M ′ . By
β β X β
Lemma 43.9, M ≡ M1 =⇒ . . . =⇒ Mk ≡ M ′ . Since is −→ → contains =⇒ and is
X
→ M ′.
transitive, M −→
X β X β β
−→ →⊆− →→: Suppose M −→ → M ′ , i.e., M ≡ M1 =⇒ . . . =⇒ Mk ≡ M ′ .
β β β
By Lemma 43.10, M ≡ M1 − →
→ ... − →→ Mk ≡ M ′ . Since − →→ is transitive,
β ′
M− →→M .
β
Theorem 43.12. −
→
→ satisfies the Church–Rosser property. lam:cr:b:
thm:cr
Proof. Immediate from Theorem 43.2, Theorem 43.8, and Lemma 43.11.
content/lambda-calculus/church-rosser/parallel-beta-eta-reduction.tex
β βη
lam:cr:pbe: → N ′ then λx. N =
2. If N − =⇒ λx. N ′ .
defn:beredpar2
βη βη βη
lam:cr:pbe: =⇒ P ′ and Q =
3. If P = =⇒ Q′ then P Q =
=⇒ P ′ Q′ .
defn:beredpar3
βη βη βη
lam:cr:pbe: =⇒ N ′ and Q =
4. If N = =⇒ Q′ then (λx. N )Q =
=⇒ N ′ [Q′ /x].
defn:beredpar4
βη βη
lam:cr:pbe: =⇒ N ′ then λx. N x =
5. If N = =⇒ N ′ , provided x ∈
/ F V (N ).
defn:beredpar5
βη
lam:cr:pbe: Theorem 43.14. M =
=⇒ M .
thm:refl
Proof. Exercise.
βη βη βη
lam:cr:pbe: =⇒ M ′ and R =
Lemma 43.16. If M = =⇒ R′ , then M [R/y] =
=⇒ M ′ [R′ /y].
lem:comp
βη
Proof. By induction on the derivation of M = =⇒ M ′ .
The first four cases are exactly like those in Lemma 43.6. If the last rule
is (5), then M is λx. N x, M ′ is N ′ for some x and N ′ where x ∈ / F V (N ),
βη βη
=⇒ N ′ . We want to show that (λx. N x)[R/y] =
and N = =⇒ N ′ [R′ /y], i.e.,
βη
=⇒ N ′ [R′ /y]. It follows by Definition 43.13(5) and the induction
λx. N [R/y]x =
hypothesis.
βη βη
lam:cr:pbe: =⇒ M ′ then M ′ =
Lemma 43.17. If M = =⇒ M ∗βη .
lem:cont
βη
Proof. By induction on the derivation of M ==⇒ M ′ .
The first four cases are like those in Lemma 43.7. If the last rule is (5),
then M is λx. N x and M ′ is N ′ for some x, N , N ′ where x ∈/ F V (N ) and
βη βη ∗βη βη
N ==⇒ N ′ . We want to show that N ′ ==⇒ (λx. N x) , i.e., N ′ =
=⇒ N ∗βη ,
which is immediate by induction hypothesis.
βη
lam:cr:pbe: Theorem 43.18. =
=⇒ has the Church-Rosser property.
thm:cr
content/lambda-calculus/church-rosser/beta-eta-reduction.tex
43.5 βη-reduction
βη lam:cr:be:
The Church–Rosser property holds for βη-reduction (−−→
→). sec
βη βη
Lemma 43.19. If M −−→ M ′ , then M =
=⇒ M ′ . lam:cr:be:
lem:one-par
βη β
Proof. By induction on the derivation of M −−→ M ′ . If M − → M ′ by η-
conversion (i.e., Definition 42.43), we use Theorem 43.14. The other cases are
as in Lemma 43.9.
βη βη
=⇒ M ′ , then M −−→
Lemma 43.20. If M = → M ′. lam:cr:be:
lem:par-red
βη
Proof. Induction on the derivation of M = =⇒ M ′ .
If the last rule is (5), then M is λx. N x and M ′ is N ′ for some x, N , N ′
βη
where x ∈ =⇒ N ′ . Thus we can first reduce λx. N x to N by
/ F V (N ) and N =
βη βη
→ N ′,
η-conversion, followed by the series of −−→ steps that show that N −−→
which holds by induction hypothesis.
βη βη
Lemma 43.21. −−→
→ is the smallest transitive relation containing =
=⇒. lam:cr:be:
lem:str
βη
Theorem 43.22. −−→
→ satisfies Church–Rosser property. lam:cr:be:
thm:cr
616
Chapter 44
Lambda Definability
content/lambda-calculus/lambda-definability/introduction.tex
44.1 Introduction
lam:ldf:int: At first glance, the lambda calculus is just a very abstract calculus of expres-
sec
sions that represent functions and applications of them to others. Nothing in
the syntax of the lambda calculus suggests that these are functions of partic-
ular kinds of objects, in particular, the syntax includes no mention of natural
numbers. Its basic operations—application and lambda abstractions—are op-
erations that apply to any function, not just functions on natural numbers.
Nevertheless, with some ingenuity, it is possible to define arithmetical func-
tions, i.e., functions on the natural numbers, in the lambda calculus. To do
this, we define, for each natural number n ∈ N, a special λ-term n, the Church
numeral for n. (Church numerals are named for Alonzo Church.)
n ≡ λf x. f n (x)
Here, f n (x) stands for the result of applying f to x n times. For example, 0 is
λf x. x, and 3 is λf x. f (f (f x)).
A very simple example are the constant functions. The term Ck ≡ λx. k
λ-defines the function ck : N → N such that c(n) = k. For Ck n ≡ (λx. k)n →
− k
for any n. The identity function is λ-defined by λx. x. More complex functions
are of course harder to define, and often require a lot of ingenuity. So it is
perhaps surprising that every computable function is λ-definable. The converse
is also true: if a function is λ-definable, it is computable.
content/lambda-calculus/lambda-definability/arithmetical-functions.tex
→ λf x. f (f n (x)),
Succ n →
−
i.e., n + 1.
Example 44.4. Let’s look at what happens when we apply Succ to 0, i.e.,
λf x. x. We’ll spell the terms out in full:
Succ′ ≡ λn. λf x. nf (f x)
or, alternatively,
The first addition works as follows: Add first accept two numbers a and b.
The result is a function that accepts f and x and returns af (bf x). If a and b
are Church numerals n and m, this reduces to f n+m (x), which is identical to
f n (f m (x)). Or, slowly:
Add′ n m →
− n Succ m.
→ Succn (m).
n Succ m →
−
And since Succ λ-defines the successor function, and the successor function
applied n times to m gives n + m, this in turn reduces to n + m.
Proof. To see how this works, suppose we apply Mult to Church numerals n
and m: Mult n m reduces to λf x. n(m f )x. The term mf defines a function
which applies f to its argument m times. Consequently, n(mf )x applies the
function “apply f m times” itself n times to x. In other words, we apply f
to x, n · m times. But the resulting normal term is just the Church numeral
nm.
The first argument b is the base and the second e is the exponent. Intuitively,
ef is f e by our encoding of numbers. If you find it hard to understand, we can
still define exponentiation also by iterated multiplication:
content/lambda-calculus/lambda-definability/pairs.tex
⟨M, N ⟩ ≡ λf. f M N.
Given a pair, we also want to recover its elements. For this we need two access
functions, which accept a pair as argument and return the first or second
elements in it:
Problem 44.3. Explain why the access functions Fst and Snd work.
content/lambda-calculus/lambda-definability/truth-values.tex
Truth values are represented as selectors, i.e., functions that accept two
arguments and returning one of them. The truth value true selects its first
argument, and false its second. For example, true M N always reduces to M ,
while false M N always reduces to N .
β
R n1 . . . nk −
→
→ false
otherwise.
For instance, the relation IsZero = {0} which holds of 0 and 0 only, is
λ-definable by
IsZero ≡ λn. n(λx. false) true.
How does it work? Since Church numerals are defined as iterators (functions
which apply their first argument n times to the second), we set the initial
value to be true, and for every step of iteration, we return false regardless of
the result of the last iteration. This step will be applied to the initial value n
times, and the result will be true if and only if the step is not applied at all,
i.e., when n = 0.
On the basis of this representation of truth values, we can further define
some truth functions. Here are two, the representations of negation and con-
junction:
The function “Not” accepts one argument, and returns true if the argument is
false, and false if the argument is true. The function “And” accepts two truth
values as arguments, and should return true iff both arguments are true. Truth
values are represented as selectors (described above), so when x is a truth value
and is applied to two arguments, the result will be the first argument if x is
true and the second argument otherwise. Now And takes its two arguments x
and y, and in return passes y and false to its first argument x. Assuming x is
a truth value, the result will evaluate to y if x is true, and to false if x is false,
which is just what is desired.
Note that we assume here that only truth values are used as arguments to
And. If it is passed other terms, the result (i.e., the normal form, if it exists)
may well not be a truth value.
Problem 44.4. Define the functions Or and Xor representing the truth func-
tions of inclusive and exclusive disjunction using the encoding of truth values
as λ-terms.
content/lambda-calculus/lambda-definability/primitive-recursive-functions.tex
lam:ldf:prf: Lemma 44.9. The basic primitive recursive functions zero, succ, and projec-
lem:basic
tions Pin are λ-definable.
Zero ≡ λa. λf x. x
Succ ≡ λa. λf x. f (af x)
Projni ≡ λx0 . . . xn−1 . xi
lam:ldf:prf: Lemma 44.10. Suppose the k-ary function f , and n-ary functions g0 , . . . , gk−1 ,
lem:comp
are λ-definable by terms F , G0 , . . . , Gk , and h is defined from them by com-
position. Then H is λ-definable.
Problem 44.5. Complete the proof of Lemma 44.10 by showing that Hn0 . . . nn−1 →
−
→
h(n0 , . . . , nn−1 ).
Note that Lemma 44.10 did not require that f and g0 , . . . , gk−1 are primitive
recursive; it is only required that they are total and λ-definable.
h(x1 , . . . , xn , 0) = f (x1 , . . . , xn )
h(x1 , . . . , xn , y + 1) = h(x1 , . . . , xn , y, h(x1 , . . . , xn , y)).
where
Proof. By Lemma 44.9, all basic functions are λ-definable, and by Lemma 44.10
and Lemma 44.11, the λ-definable functions are closed under composition and
primitive recursion.
content/lambda-calculus/lambda-definability/fixpoints.tex
44.6 Fixpoints
lam:ldf:fp: Suppose we wanted to define the factorial function by recursion as a term Fac
sec
with the following property:
only involves previously defined terms in the right-hand side, such as Add. We
can always remove Add by replacing it with its defining term. This would give
the term Mult as a pure lambda term; if Add itself involved defined terms (as,
e.g., Add′ does), we could continue this process and finally arrive at a pure
lambda term.
However this is not true in the case of recursive definitions like the one of
Fac above. If we replace the occurrence of Fac on the right-hand side with the
definition of Fac itself, we get:
and we still haven’t gotten rid of Fac on the right-hand side. Clearly, if we
repeat this process, the definition keeps growing longer and the process never
results in a pure lambda term. Thus this way of defining factorial (or more
generally recursive functions) is not feasible.
The recursive definition does tell us something, though: If f were a term
representing the factorial function, then the term
applied to the term f , i.e., Fac′ f , also represents the factorial function. That
is, if we regard Fac′ as a function accepting a function and returning a function,
the value of Fac′ f is just f , provided f is the factorial. A function f with the
β
property that Fac′ f = f is called a fixpoint of Fac′ . So, the factorial is a
′
fixpoint of Fac .
There are terms in the lambda calculus that compute the fixpoints of a
given term, and these terms can then be used to turn a term like Fac′ into the
definition of the factorial.
Y g ≡ (λux. x(uux))U g
→
−
→ (λx. x(U U x))g
→
−
→ g(U U g) ≡ g(Y g).
β
Since g(Y g) and Y g both reduce to g(Y g), g(Y g) = Y g, so Y g is a fixpoint
of g.
Yg →
−
→ g(Y g)
→
−
→ g(g(Y g))
→
−
→ g(g(g(Y g)))
...
→ Y Fac′ 3
Fac 3 →
−
→ Fac′ (Y Fac′ ) 3
→
−
≡ (λx. λn. IsZero n 1 (Mult n (x(Pred n)))) Fac 3
→
−
→ IsZero 3 1 (Mult 3 (Fac(Pred 3)))
→
−
→ Mult 3 (Fac 2).
Similarly,
Fac 2 →
−
→ Mult 2 (Fac 1)
Fac 1 →
−
→ Mult 1 (Fac 0)
but
→ Fac′ (Y Fac′ ) 0
Fac 0 →
−
≡ (λx. λn. IsZero n 1 (Mult n (x(Pred n)))) Fac 0
→
−
→ IsZero 0 1 (Mult 0 (Fac(Pred 0))).
→
−
→ 1.
So together
Fac 3 →
−
→ Mult 3 (Mult 2 (Mult 1 1)).
What goes for Fac′ goes for any recursive definition. Suppose we have a
recursive equation
β
g x1 . . . xn = N
G ≡ (Y λg. λx1 . . . xn . N ) →
−
→ λg. λx1 . . . xn . N (Y λg. λx1 . . . xn . N )
≡ (λg. λx1 . . . xn . N ) G
and consequently
G x1 . . . xn →
−
→ (λg. λx1 . . . xn . N ) G x1 . . . xn
→
−
→ (λx1 . . . xn . N [G/g]) x1 . . . xn
→
−
→ N [G/g].
The Y combinator of Definition 44.13 is due to Alan Turing. Alonzo Church
had proposed a different version which we’ll call YC :
YC ≡ λg. (λx. g(xx))(λx. g(xx)).
β
Church’s combinator is a bit weaker than Turing’s in that Y g = g(Y g) but not
β
Yg −
→
→ g(Y g). Let V be the term λx. g(xx), so that YC ≡ λg. V V . Then
V V ≡ (λx. g(xx))V →
−
→ g(V V ) and thus
YC g ≡ (λg. V V )g →
−
→VV → −→ g(V V ), but also
g(YC g) ≡ g((λg. V V )g) →
−
→ g(V V ).
β
In other words, YC g and g(YC g) reduce to a common term g(V V ); so YC g =
g(YC g). This is often enough for applications.
content/lambda-calculus/lambda-definability/minimization.tex
44.7 Minimization
The general recursive functions are those that can be obtained from the basic lam:ldf:min:
sec
functions zero, succ, Pin by composition, primitive recursion, and regular min-
imization. To show that all general recursive functions are λ-definable we have
to show that any function defined by regular minimization from a λ-definable
function is itself λ-definable.
Proof. Suppose the lambda term F λ-defines the regular function f (⃗x, y). To
λ-define h we use a search function and a fixpoint combinator:
(Y Search)F n1 . . . nk m →
−
→m
if f (n1 , . . . , nk , m) = 0, or
→
−
→ (Y Search)F n1 . . . nk m + 1
(Y Search)F n1 . . . nk 0 →
−
→ h(n1 , . . . , nk ).
Proof. By Lemma 44.9, all basic functions are λ-definable, and by Lemma 44.10,
Lemma 44.11, and Lemma 44.15, the λ-definable functions are closed under
composition, primitive recursion, and regular minimization.
content/lambda-calculus/lambda-definability/partial-recursive-functions.tex
content/lambda-calculus/lambda-definability/lambda-definable-recursive.tex
Proof. We only sketch the proof. First, we arithmetize λ-terms, i.e., systema-
tially assign Gödel numbers to λ-terms, using the usual power-of-primes coding
of sequences. Then we define a partial recursive function normalize(t) operat-
ing on the Gödel number t of a lambda term as argument, and which returns
the Gödel number of the normal form if it has one, or is undefined otherwise.
Then define two partial recursive functions toChurch and fromChurch that
maps natural numbers to and from the Gödel numbers of the corresponding
Church numeral.
Using these recursive functions, we can define the function f as a par-
tial recursive function. There is a λ-term F that λ-defines f . To compute
f (n1 , . . . , nk ), first obtain the Gödel numbers of the corresponding Church nu-
merals using toChurch(ni ), append these to # F # to obtain the Gödel number of
the term F n1 . . . nk . Now use normalize on this Gödel number. If f (n1 , . . . , nk )
normalize(# F n1 . . . nk # )
Many-valued Logic
This part contains draft material on propositional many-valued logics.
Chapter 45
content/many-valued-logic/syntax-and-semantics/introduction.tex
45.1 Introduction
mvl:syn:int: In classical logic, we deal with formulas that are built from propositional vari-
sec
ables using the propositional connectives ¬, ∧, ∨, →, and ↔. When we define
a semantics for classical logic, we do so using the two truth values T and F.
We interpret propositional variables in a valuation v, which assigns these truth
values T, F to the propositional variables. Any valuation then determines a
truth value v(φ) for any formula φ, and A formula is satisfied in a valuation v,
v ⊨ φ, iff v(φ) = T.
Many-valued logics are generalizations of classical two-valued logic by allow-
ing more truth values than just T and F. So in many-valued logic, a valuation v
is a function assigning to every propositional variable p one of a range of possible
truth values. We’ll generally call the set of allowed truth values V . Classical
logic is a many-valued logic where V = {T, F}, and the truth value v(φ) is
computed using the familiar characteristic truth tables for the connectives.
Once we add additional truth values, we have more than one natural option
for how to compute v(φ) for the connectives we read as “and,” “or,” “not,” and
“if—then.” So a many-valued logic is determined not just by the set of truth
values, but also by the truth functions we decide to use for each connective.
Once these are selected for a many-valued logic L, however, the truth value
631
CHAPTER 45. SYNTAX AND SEMANTICS
vL (φ) is uniquely determined by the valuation, just like in classical logic. Many-
valued logics, like classical logic, are truth functional.
With this semantic building blocks in hand, we can go on to define the
analogs of the semantic concepts of tautology, entailment, and satisfiability. In
classical logic, a formula is a tautology if its truth value v(φ) = T for any v. In
many-valued logic, we have to generalize this a bit as well. First of all, there is
no requirement that the set of truth values V contains T. For instance, some
many-valued logics use numbers, such as all rational numbers between 0 and 1
as their set of truth values. In such a case, 1 usually plays the rule of T. In
other logics, not just one but several truth values do. So, we require that every
many-valued logic have a set V + of designated values. We can then say that
a formula is satisfied in a valuation v, v ⊨L φ, iff vL (φ) ∈ V + . A formula φ is
a tautology of the logic, ⊨L φ, iff v(φ) ∈ V + for any v. And, finally, we say
that φ is entailed by a set of formulas, Γ ⊨L φ, if every valuation that satisfies
all the formulas in Γ also satisfies φ.
content/many-valued-logic/syntax-and-semantics/connectives.tex
content/many-valued-logic/syntax-and-semantics/formulas.tex
45.3 Formulas
mvl:syn:fml:
sec
mvl:syn:fml: Definition 45.3 (Formula). The set Frm(L) of formulas of a propositional
defn:formulas
language L is defined inductively as follows:
content/many-valued-logic/syntax-and-semantics/matrices.tex
45.4 Matrices
mvl:syn:mat: A many-valued logic is defined by its language, its set of truth values V , a subset
sec
of designated truth values, and truth functions for its connective. Together,
these elements are called a matrix.
mvl:syn:mat: Definition 45.5 (Matrix). A matrix for the logic L consists of:
defn:matrix
¬
e ∧
e T F ∨
e T F →
f T F
T F T T F T T T T T F
F T F F F F T F F T T
4. For ⊥, we have ⊥ e = F. The other truth functions are given by the usual
truth tables (see Figure 45.1).
content/many-valued-logic/syntax-and-semantics/valuations-sat.tex
Definition 45.8. Given a valuation v into the set of truth values V of a many- mvl:syn:val:
valued logic L, define the evaluation function v : Frm(L) → V inductively by: defn:pValue
1. v(pn ) = v(pn );
2. If ⋆ is a 0-place connective, then v(⋆) = e
⋆L ;
3. If ⋆ is an n-place connective, then
v(⋆(φ1 , . . . , φn )) = e
⋆L (v(φ1 ), . . . , v(φn )).
content/many-valued-logic/syntax-and-semantics/semantic-notions.tex
We have some of the same facts for these notions as we do for the case of
classical logic:
mvl:syn:sem: Proposition 45.11.
prop:semanticalfacts
1. φ is a tautology if and only if ∅ ⊨ φ;
2. If Γ is satisfiable then every finite subset of Γ is also satisfiable;
mvl:syn:sem: 3. Monotonicity: if Γ ⊆ ∆ and Γ ⊨ φ then also ∆ ⊨ φ;
def:monotonicity
mvl:syn:sem: 4. Transitivity: if Γ ⊨ φ and ∆ ∪ {φ} ⊨ ψ then Γ ∪ ∆ ⊨ ψ;
def:Cut
Proof. Exercise.
In classical logic we can connect entailment and the conditional. For in-
stance, we have the validity of modus ponens: If Γ ⊨ φ and Γ ⊨ φ → ψ then
Γ ⊨ ψ. Another important relationship between ⊨ and → in classical logic is
the semantic deduction theorem: Γ ⊨ φ → ψ if and only if Γ ∪ {φ} ⊨ ψ. These
results do not always hold in many-valued logics. Whether they do depends
on the truth function f→.
content/many-valued-logic/syntax-and-semantics/sublogics.tex
1. ¬
e L (x) = ¬
e C (x) if x = T or x = F; mvl:syn:sub:
prop:not
2. ∧
e L (x, y) = ∧
e C (x, y), mvl:syn:sub:
prop:land
3. ∨
e L (x, y) = ∨
e C (x, y), mvl:syn:sub:
prop:lor
→L (x, y) = f
4. f →C (x, y), if x, y ∈ {T, F}. mvl:syn:sub:
prop:lif
Then, for any valuation v into V such that v(p) ∈ {T, F}, vL (φ) = vC (φ).
Proof. By induction on φ.
2. If φ ≡ ¬B, we have
vL (φ) = ¬
e L (vL (ψ)) by Definition 45.8
=¬
e L (vC (ψ)) by inductive hypothesis
=¬
e C (vC (ψ)) by assumption (1),
since vC (ψ) ∈ {T, F},
= vC (φ) by Definition 45.8.
3. If φ ≡ (ψ ∧ χ), we have
vL (φ) = ∧
e L (vL (ψ), vL (χ)) by Definition 45.8
=∧e L (vC (ψ), vC (χ)) by inductive hypothesis
=∧
e C (vC (ψ), vC (χ)) by assumption (2),
since vC (ψ), vC (χ) ∈ {T, F},
= vC (φ) by Definition 45.8.
636
Chapter 46
Three-valued Logics
content/many-valued-logic/three-valued-logics/introduction.tex
46.1 Introduction
mvl:thr:int: If we just add one more value U to T and F, we get a three-valued logic. Even
sec
though there is only one more truth value, the possibilities for defining the
truth-functions for ¬, ∧, ∨, and → are quite numerous. Then a logic might use
any combination of these truth functions, and you also have a choice of making
only T designated, or both T and U.
We present here a selection of the most well-known three-valued logics, their
motivations, and some of their properties.
content/many-valued-logic/three-valued-logics/lukasiewicz.tex
∧
e (T, U) = ∧
e (U, T) = U.
∧
e (F, U) = ∧
e (F, U) = F.
The other values (if the arguments are settled truth values, T or F, are like in
classical logic.
For the conditional, the situation is a little trickier. Suppose q is a future
contingent statement. If p is false, then p → q will be true, regardless of how
q turns out, so we should set f →(F, U) = T. And if p is true, then q → p will
be true, regardless of what q turns out to be, so f →(U, T) = T. If p is true,
then p → q might turn out to be true or false, so f →(T, U) = U. Similarly, if p
is false, then q → p might turn out to be true or false, so f →(U, F) = U. This
leaves the case where p and q are both future contingents. On the basis of the
motivation, we should really assign U in this case. However, this would make
φ → φ not a tautology. Lukasiewicz had not trouble giving up φ ∨ ¬φ and
¬(φ ∧ ¬φ), but balked at giving up φ → φ. So he stipulated f →(U, U) = T.
Definition 46.1. Three-valued Lukasiewicz logic is defined using the matrix: mvl:thr:luk:
def:lukasiewicz
¬
e ∧
e L3 T U F
T F T T U F
U U U U U F
F T F F F F
∨
e L3 T U F →
fL3 T U F
T T T T T T U F
U T U U U T T U
F T U F F T T T
Proposition 46.2. If v(p) ∈ {T, F} for all p in φ, then vL3 (φ) = vC (φ).
1. p → (q → p)
Problem 46.3. Show that the following classical tautologies are not tautolo-
gies in L3 :
1. (¬p ∧ p) → q)
2. ((p → q) → p) → p
3. (p → (p → q)) → (p → q)
One might therefore perhaps think that although not all classical tautologies
are tautologies in L3 , they should at least take either the value T or the value U
on every valuation. This is not the case. A counterexample is given by
which is F if p is U.
Problem 46.4. Which of the following relations hold in Lukasiewicz logic?
Give a truth table for each.
1. p, p → q ⊨ q
2. ¬¬p ⊨ p
3. p ∧ q ⊨ p
4. p ⊨ p ∧ p
5. p ⊨ p ∨ q
♢
e □
e
T T T T
U T U F
F F F F
In other words, p is possible iff it is not already settled as false; and p is
necessary iff it is already settled as true.
Problem 46.5. Show that □p ↔ ¬♢¬p and ♢p ↔ ¬□¬p are tautologies in L3 ,
extended with the truth tables for □ and ♢.
However, the shortcomings of this proposed modal logic soon became ev-
ident: However things turn out, p ∧ ¬p can never turn out to be true. So
even if it is not now settled (and therefore undetermined), it should count as
impossible, i.e., ¬♢(p ∧ ¬p) should be a tautology. However, if v(p) = U, then
v(¬♢(p ∧ ¬p)) = U. Although Lukasiewicz was correct that two truth values
will not be enough to accommodate modal distinctions such as possiblity and
necessity, introducing a third truth value is also not enough.
content/many-valued-logic/three-valued-logics/kleene.tex
¬
e ∧
e Ks T U F
T F T T U F
U U U U U F
F T F F F F
∨
e Ks T U F →
fKs T U F
T T T T T T U F
U T U U U T U U
F T U F F T T T
¬
e ∧
e Kw T U F
T F T T U F
U U U U U U
F T F F U F
∨
e Kw T U F →
fKw T U F
T T U T T T U F
U U U U U U U U
F T U F F T U T
Proof. If v(p) = U for all propositional variables p, then any formula φ will
have truth value v(φ) = U, since
¬
e (U) = ∨
e (U, U) = ∧ →(U, U) = U
e (U, U) = f
Although both weak and strong Kleene logic have no tautologies, they have
non-trivial consequence relations.
Problem 46.6. Which of the following relations hold in (a) strong and (b)
weak Kleene logic? Give a truth table for each.
1. p, p → q ⊨ q
2. p ∨ q, ¬p ⊨ q
3. p ∧ q ⊨ p
4. p ⊨ p ∧ p
5. p ⊨ p ∨ q
∼
e +
e
T F T F
U T U T
F T F F
Problem 46.7. Can you define ∼ in Bochvar’s logic in terms of ¬ and +, i.e.,
find a formula with only the propositional variable p and not involving ∼ which
always takes the same truth value as ∼p? Give a truth table to show you’re
right.
content/many-valued-logic/three-valued-logics/goedel.tex
mvl:thr:god: Definition 46.6. 3-valued Gödel logic G is defined using the matrix:
defn:goedel
¬
eG ∧
eG T U F
T F T T U F
U F U U U F
F T F F F F
∨
eG T U F →
fG T U F
T T T T T T U F
U T U U U T T F
F T U F F T T T
You’ll notice that the truth tables for ∧ and ∨ are the same as in Lukasiewicz
and strong Kleene logic, but the truth tables for ¬ and → differ for each. In
Gödel logic, ¬e (U) = F. In contrast to Lukasiewicz logic and Kleene logic,
→(U, F) = F; in contrast to Kleene logic (but as in Lukasiewicz logic), f
f →(U, U) =
T.
As the connection to intuitionistic logic alluded to above suggests, G3 is
close to intuitionistic logic. All intuitionistic truths are tautologies in G3 , and
many classical tautologies that are not valid intuitionistically also fail to be
tautologies in G3 . For instance, the following are not tautologies:
p ∨ ¬p (p → q) → (¬p ∨ q)
¬¬p → p ¬(¬p ∧ ¬q) → (p ∨ q)
((p → q) → p) → p ¬(p → q) → (p ∧ ¬q)
Problem 46.8. Give truth tables to show that the following are tautologies
of G3 :
¬¬p ∨ ¬p
(p → q) ∨ (q → p)
¬(p ∧ q) → (¬p ∨ ¬q)
(p → q) ∨ (q → r) ∨ (r → s)
Problem 46.9. Give truth tables that show that the following are not tau-
tologies of G3
(p → q) → (¬p ∨ q)
¬(¬p ∧ ¬q) → (p ∨ q)
((p → q) → p) → p
¬(p → q) → (p ∧ ¬q)
Problem 46.10. Which of the following relations hold in Gödel logic? Give
a truth table for each.
1. p, p → q ⊨ q
2. p ∨ q, ¬p ⊨ q
3. p ∧ q ⊨ p
4. p ⊨ p ∧ p
5. p ⊨ p ∨ q
content/many-valued-logic/three-valued-logics/multiple-designation.tex
Definition 46.8. Halldén’s logic of nonsense Hal is defined using the matrix:
1. The standard propositional language L0 with ¬, ∧, ∨, → and a 1-place
connective +.
2. The set of truth values V = {T, U, F}.
3. T and U are designated, i.e., V + = {T, U}.
4. Truth functions are the same as weak Kleene logic, plus the “is meaning-
less” operator:
+
e
T F
U T
F F
By contrast to the Kleene logics with which they share truth tables, these
do have tautologies.
mvl:thr:mul: Proposition 46.9. The tautologies of LP are the same as the tautologies of
prop:LP-taut-CL
classical propositional logic.
We now show by induction on φ that (a) if vKs (φ) = F then v′ C (φ) = F, and
(b) if vKs (φ) = T then v′ C (φ) = T
1. Induction basis: φ ≡ p. By Definition 45.8, vKs (φ) = v(p) = v′ C (φ),
which implies both (a) and (b).
For the induction step, consider the cases:
2. φ ≡ ¬ψ.
a) Suppose vKs (¬ψ) = F. By the definition of ¬ e Ks , vKs (ψ) = T. By
inductive hypothesis, case (b), we get v′ C (ψ) = T, so v′ C (¬ψ) = F.
b) Suppose vKs (¬ψ) = T. By the definition of ¬ e Ks , vKs (ψ) = F. By
inductive hypothesis, case (a), we get v′ C (ψ) = F, so v′ C (¬ψ) = T.
3. φ ≡ (ψ ∧ χ).
a) Suppose vKs (ψ ∧ χ) = F. By the definition of ∧e Ks , vKs (ψ) = F or
vKs (ψ) = F. By inductive hypothesis, case (a), we get v′ C (ψ) = F
or v′ C (χ) = F, so v′ C (ψ ∧ χ) = F.
b) Suppose vKs (ψ ∧ χ) = T. By the definition of ∧
e Ks , vKs (ψ) = T and
vKs (ψ) = T. By inductive hypothesis, case (b), we get v′ C (ψ) = T
and v′ C (χ) = T, so v′ C (ψ ∧ χ) = T.
The other two cases are similar, and left as exercises. Alternatively, the
proof above establishes the result for all formulas only containing ¬ and ∧.
One may now appeal to the facts that in both Ks and C, for any v, v(ψ ∨ χ) =
v(¬(¬ψ ∧ ¬χ)) and v(ψ → χ) = v(¬(ψ ∧ ¬χ)).
Problem 46.11. Complete the proof Proposition 46.9, i.e., establish (a) and (b)
for the cases where φ ≡ (ψ ∨ χ) and φ ≡ (ψ → χ).
Although they have the same tautologies as classical logic, their consequence
relations are different. LP, for instance, is paraconsistent in that ¬p, p ⊭ q,
and so the principle of explosion ¬φ, φ ⊨ ψ does not hold in general. (It holds
for some cases of φ and ψ, e.g., if ψ is a tautology.)
Problem 46.13. Which of the following relations hold in (a) LP and in
(b) Hal? Give a truth table for each.
1. p, p → q ⊨ q
2. ¬q, p → q ⊨ ¬p
3. p ∨ q, ¬p ⊨ q
4. ¬p, p ⊨ q
5. p ⊨ p ∨ q
Definition 46.10. The logic 3-valued R-Mingle RM3 is defined using the ma-
trix:
1. p, p → q ⊨ q
2. p ∨ q, ¬p ⊨ q
3. ¬p, p ⊨ q
4. p ⊨ p ∨ q
Different truth tables can sometimes generate the same logic (entailment
relation) just by changing the designated values. E.g., this happens if in Gödel
logic we take V + = {T, U} instead of {T}.
mvl:thr:mul: Proposition 46.11. The matrix with V = {F, U, T}, V + = {T, U}, and the
prop:gl-udes
truth functions of 3-valued Gödel logic defines classical logic.
Proof. Exercise.
Problem 46.15. Prove Proposition 46.11 by showing that for the logic L de-
fined just like Gödel logic but with V + = {T, U}, if Γ ⊭L ψ then Γ ⊭C ψ. Use
the ideas of Proposition 46.9, except instead of proving properties (a) and (b),
show that vG (φ) = F iff v′ C (φ) = F (and hence that vG (φ) ∈ {T, U} iff
v′ C (φ) = T). Explain why this establishes the proposition.
647
CHAPTER 47. INFINITE-VALUED LOGICS
Chapter 47
Infinite-valued Logics
content/many-valued-logic/infinite-valued-logics/introduction.tex
47.1 Introduction
The number of truth values of a matrix need not be finite. An obvious choice mvl:inf:int:
sec
for a set of infinitely many truth values is the set of rational numbers between
0 and 1, V∞ = [0, 1] ∩ Q, i.e.,
n
V∞ = { : n, m ∈ N and n ≤ m}.
m
When considering this infinite truth value set, it is often useful to also consider
the subsets
n
Vm = { : n ∈ N and n ≤ m}
m−1
1 1 3
V5 = {0, , , , 1}.
4 2 4
In logics based on these truth value sets, usually only 1 is designated, i.e.,
V + = {1}. In other words, we let 1 play the role of (absolute) truth, 0 as
absolute falsity, but formulas may take any intermediate value in V .
One can also consider the set V[0,1] = [0, 1] of all real numbers between 0
and 1, or other infinite subsets of [0, 1], however. Logics with this truth value
set are often called fuzzy.
content/many-valued-logic/infinite-valued-logics/lukasiewicz.tex
¬
e L (x) = 1 − x
∧L (x, y) = min(x, y)
e
∨
e L (x, y) = max(x, y)
(
1 if x ≤ y
→L (x, y) = min(1, 1 − (x − y)) =
f
1 − (x − y) otherwise.
Proof. This can be seen by comparing the truth tables for the connectives
given in Definition 46.1 with the truth tables determined by the equations in
Definition 47.1:
¬
e ∧
e L3 1 1/2 0
1 0 1 1 1/2 0
1/2 1/2 1/2 1/2 1/2 0
0 1 0 0 0 0
∨
e L3 1 1/2 0 →
fL3 1 1/2 0
1 1 1 1 1 1 1/2 0
1/2 1 1/2 1/2 1/2 1 1 1/2
0 1 1/2 0 0 1 1 1
Proof. Exercise.
content/many-valued-logic/infinite-valued-logics/goedel.tex
Definition 47.4. Infinite-valued Gödel logic G∞ is defined using the matrix: mvl:inf:god:
def:goedel
1. The standard propositional language L0 with ⊥, ¬, ∧, ∨, →.
⊥e =0
(
1 if x = 0
¬
e G (x) =
0 otherwise
∧
e G (x, y) = min(x, y)
∨
e G (x, y) = max(x, y)
(
1 if x ≤ y
→G (x, y) =
f
y otherwise.
Proof. This can be seen by comparing the truth tables for the connectives
given in Definition 46.6 with the truth tables determined by the equations in
Definition 47.4:
∨
eG 1 1/2 0 →
fG 1 1/2 0
1 1 1 1 1 1 1/2 0
1/2 1 1/2 1/2 1/2 1 1 0
0 1 1/2 0 0 1 1 1
Chapter 48
Sequent Calculus
651
CHAPTER 48. SEQUENT CALCULUS
content/many-valued-logic/sequent-calculus/introduction.tex
48.1 Introduction
The sequent calculus for classical logic is an efficient and simple derivation mvl:seq:int:
sec
system. If a many-valued logic is defined by a matrix with finitely many truth
values, i.e., V is finite, it is possible to provide a sequent calculus for it. The
idea for how to do this comes from considering the meanings of sequents and
the form of inference rules in the classical case.
Now recall that a sequent
φ1 , . . . , φn ⇒ ψ1 , . . . , ψn
(φ1 ∧ · · · ∧ φm ) → (ψ1 ∨ · · · ∨ ψn )
In other words, A valuation v satisfies a sequent Γ ⇒ ∆ iff either v(φ) = F
for some φ ∈ Γ or v(φ) = T for some φ ∈ ∆. On this interpretation, initial
sequents φ ⇒ φ are always satisfied, because either v(φ) = T or (φ) = F.
Here are the inference rules for the conditional in LK, with side formulas
Γ , ∆ left out:
⇒ φ ψ ⇒ φ ⇒ ψ
→L →R
φ→ψ ⇒ ⇒ φ→ψ
φ, ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ, ψ
∧L ∨R
φ ∧ ψ, Γ ⇒ ∆ Γ ⇒ ∆, φ ∨ ψ
content/many-valued-logic/sequent-calculus/rules-and-proofs.tex
Γ1 | . . . | Γn
For each connective of an n-valued logic L, there is a logical rule for each
truth value that this connective can take in L. Derivations in an n-sided
sequent calculus for L are trees of sequents, where the topmost sequents are
initial sequents, and if a sequent stands below one or more other sequents, it
must follow correctly by a rule of inference for the connectives of L.
content/many-valued-logic/sequent-calculus/structural-rules.tex
Γ1 | . . . | Γi | . . . | Γn
Wi
Γ1 | . . . | φ, Γi | . . . | Γn
Γ1 | . . . | φ, φ, Γi | . . . | Γn
Ci
Γ1 | . . . | φ, Γi | . . . | Γn
Γ1 | . . . | Γi , φ, ψ, Γi′ | . . . | Γn
Xi
Γ1 | . . . | Γi , ψ, φ, Γi′ | . . . | Γn
Γ1 | . . . | φ, Γi | . . . | Γn ∆1 | . . . | φ, ∆j | . . . | ∆n
Cuti, j
Γ1 , ∆1 | . . . | Γn , ∆n
content/many-valued-logic/sequent-calculus/propositional-rules.tex
Rules for ¬
The following rules for ¬ apply to Lukasiewicz and Kleene logics, and their
variants.
Γ | Π | ∆, φ
¬F
¬φ, Γ | Π | ∆
Γ | φ, Π | ∆
¬U
Γ | ¬φ, Π | ∆
φ, Γ | Π | ∆
¬T
Γ | Π | ∆, ¬φ
Γ | φ, Π | ∆, φ φ, Γ | Π | ∆
¬G F ¬G T
¬φ, Γ | Π | ∆ Γ | Π | ∆, ¬φ
(In Gödel logic, ¬φ can never take the value U, so there is no rule for the
middle position.)
Rules for ∧
These are the rules for ∧ in Lukasiewicz, strong Kleene, and Gödel logic.
φ, ψ, Γ | Π | ∆
∧F
φ ∧ ψ, Γ | Π | ∆
Γ | φ, Π | φ, ∆ Γ | ψ, Π | ψ, ∆ Γ | φ, ψ, Π | ∆
∧U
Γ | φ ∧ ψ, Π | ∆
Γ | Π | ∆, φ Γ | Π | ∆, ψ
∧T
Γ | Π | ∆, φ ∧ ψ
Rules for ∨
These are the rules for ∨ in Lukasiewicz, strong Kleene, and Gödel logic.
φ, Γ | Π | ∆ ψ, Γ | Π | ∆
∨F
φ ∨ ψ, Γ | Π | ∆
φ, Γ | φ, Π | ∆ ψ, Γ | ψ, Π | ∆ Γ | φ, ψ, Π | ∆
∨U
Γ | φ ∨ ψ, Π | ∆
Γ | Π | ∆, φ, ψ
∨T
Γ | Π | ∆, φ ∨ ψ
Rules for →
These are the rules for → in Lukasiewicz logic.
Γ | Π | ∆, φ ψ, Γ | Π | ∆
→L3 F
φ → ψ, Γ | Π | ∆
Γ | φ, ψ, Π | ∆ ψ, Γ | Π | ∆, φ
→L3 U
Γ | φ → ψ, Π | ∆
φ, Γ | ψ, Π | ∆, ψ φ, Γ | φ, Π | ∆, ψ
→L3 T
Γ | Π | ∆, φ → ψ
Γ | Π | ∆, φ ψ, Γ | Π | ∆
→Ks F
φ → ψ, Γ | Π | ∆
ψ, Γ | ψ, Π | ∆ Γ | φ, ψ, Π | ∆ Γ | φ, Π | ∆, φ
→Ks U
Γ | φ → ψ, Π | ∆
φ, Γ | Π | ∆, ψ
→Ks T
Γ | Π | ∆, φ → ψ
Γ | φ, Π | ∆, φ ψ, Γ | Π | ∆
→ G3 F
φ → ψ, Γ | Π | ∆
Γ | ψ, Π | ∆ Γ | Π | ∆, φ
→ G3 U
Γ | φ → ψ, Π | ∆
φ, Γ | ψ, Π | ∆, ψ φ, Γ | φ, Π | ∆, ψ
→G3 T
Γ | Π | ∆, φ → ψ
657
Part XI
Chapter 49
content/normal-modal-logic/syntax-and-semantics/introduction.tex
49.1 Introduction
Modal logic deals with modal propositions and the entailment relations among nml:syn:int:
sec
them. Examples of modal propositions are the following:
1. It is necessary that 2 + 2 = 4.
Possibility and necessity are not the only modalities: other unary connectives
are also classified as modalities, for instance, “it ought to be the case that φ,”
“It will be the case that φ,” “Dana knows that φ,” or “Dana believes that φ.”
Modal logic makes its first appearance in Aristotle’s De Interpretatione: he
was the first to notice that necessity implies possibility, but not vice versa; that
possibility and necessity are inter-definable; that If φ ∧ ψ is possibly true then
φ is possibly true and ψ is possibly true, but not conversely; and that if φ → ψ
is necessary, then if φ is necessary, so is ψ.
658
49.1. INTRODUCTION
The first modern approach to modal logic was the work of C. I. Lewis, cul-
minating with Lewis and Langford, Symbolic Logic (1932). Lewis & Langford
were unhappy with the representation of implication by means of the mate-
rial conditional: φ → ψ is a poor substitute for “φ implies ψ.” Instead, they
proposed to characterize implication as “Necessarily, if φ then ψ,” symbolized
as φ J ψ. In trying to sort out the different properties, Lewis identified five
different modal systems, S1, . . . , S4, S5, the last two of which are still in use.
The approach of Lewis and Langford was purely syntactical : they identified
reasonable axioms and rules and investigated what was provable with those
means. A semantic approach remained elusive for a long time, until a first
attempt was made by Rudolf Carnap in Meaning and Necessity (1947) using
the notion of a state description, i.e., a collection of atomic sentences (those
that are “true” in that state description). After lifting the truth definition to
arbitrary sentences φ, Carnap defines φ to be necessarily true if it is true in all
state descriptions. Carnap’s approach could not handle iterated modalities, in
that sentences of the form “Possibly necessarily . . . possibly φ” always reduce
to the innermost modality.
The major breakthrough in modal semantics came with Saul Kripke’s article
“A Completeness Theorem in Modal Logic” (JSL 1959). Kripke based his
work on Leibniz’s idea that a statement is necessarily true if it is true “at
all possible worlds.” This idea, though, suffers from the same drawbacks as
Carnap’s, in that the truth of statement at a world w (or a state description
s) does not depend on w at all. So Kripke assumed that worlds are related by
an accessibility relation R, and that a statement of the form “Necessarily φ”
is true at a world w if and only if φ is true at all worlds w′ accessible from
w. Semantics that provide some version of this approach are called Kripke
semantics and made possible the tumultuous development of modal logics (in
the plural).
When interpreted by the Kripke semantics, modal logic shows us what
relational structures look like “from the inside.” A relational structure is just
a set equipped with a binary relation (for instance, the set of students in
the class ordered by their social security number is a relational structure).
But in fact relational structures come in all sorts of domains: besides relative
possibility of states of the world, we can have epistemic states of some agent
related by epistemic possibility, or states of a dynamical system with their state
transitions, etc. Modal logic can be used to model all of these: the first gives
us ordinary, alethic, modal logic; the others give us epistemic logic, dynamic
logic, etc.
We focus on one particular angle, known to modal logicians as “correspon-
dence theory.” One of the most significant early discoveries of Kripke’s is that
many properties of the accessibility relation R (whether it is transitive, sym-
metric, etc.) can be characterized in the modal language itself by means of
appropriate “modal schemas.” Modal logicians say, for instance, that the re-
flexivity of R “corresponds” to the schema “If necessarily φ, then φ”. We
explore mainly the correspondence theory of a number of classical systems of
modal logic (e.g., S4 and S5) obtained by a combination of the schemas D, T,
B, 4, and 5.
content/normal-modal-logic/syntax-and-semantics/language-modal-logic.tex
Definition 49.2. Formulas of the basic modal language are inductively de-
fined as follows:
1. ⊥ is an atomic formula.
2. ⊤ is an atomic formula.
content/normal-modal-logic/syntax-and-semantics/substitution.tex
content/normal-modal-logic/syntax-and-semantics/relational-models.tex
content/normal-modal-logic/syntax-and-semantics/truth-at-w.tex
p
w2
q
p
w1
¬q
¬p
w3
¬q
Problem 49.1. Consider the model of Figure 49.1. Which of the following
hold?
1. M, w1 ⊩ q;
2. M, w3 ⊩ ¬q;
3. M, w1 ⊩ p ∨ q;
4. M, w1 ⊩ □(p ∨ q);
5. M, w3 ⊩ □q;
6. M, w3 ⊩ □⊥;
7. M, w1 ⊩ ♢q;
8. M, w1 ⊩ □q;
9. M, w1 ⊩ ¬□□¬q.
content/normal-modal-logic/syntax-and-semantics/truth-in-model.tex
Problem 49.5. Consider the following model M for the language comprising
p1 , p2 , p3 as the only propositional variables:
p1 p1
¬p2 w1 w3 p2
¬p3 p3
p1
w2 p2
¬p3
Are the following formulas and schemas true in the model M, i.e., true at every
world in M? Explain.
1. p → ♢p (for p atomic);
2. φ → ♢φ (for φ arbitrary);
3. □p → p (for p atomic);
content/normal-modal-logic/syntax-and-semantics/modal-validity.tex
49.7 Validity
explanation Formulas that are true in all models, i.e., true at every world in every model, nml:syn:val:
sec
are particularly interesting. They represent those modal propositions which are
true regardless of how □ and ♢ are interpreted, as long as the interpretation
is “normal” in the sense that it is generated by some accessibility relation on
possible worlds. We call such formulas valid. For instance, □(p ∧ q) → □p is
valid. Some formulas one might expect to be valid on the basis of the alethic
interpretation of □, such as □p → p, are not valid, however. Part of the interest
of relational models is that different interpretations of □ and ♢ can be captured
by different kinds of accessibility relations. This suggests that we should define
validity not just relative to all models, but relative to all models of a certain
kind. It will turn out, e.g., that □p → p is true in all models where every world
is accessible from itself, i.e., R is reflexive. Defining validity relative to classes
of models enables us to formulate this succinctly: □p → p is valid in the class
of reflexive models.
1. □p → □(q → p);
2. □¬⊥;
3. □p → (□q → □p).
content/normal-modal-logic/syntax-and-semantics/tautological-instances.tex
Proof. By induction on φ.
1. φ ≡ ⊥: Both v ⊭ ⊥ and M, w ⊮ ⊥.
2. φ ≡ ⊤: Both v ⊨ ⊤ and M, w ⊩ ⊤.
3. φ ≡ pi :
v ⊨ pi ⇔ v(pi ) = T
by definition of v ⊨ pi
⇔ M, w ⊩ θi
by assumption
⇔ M, w ⊩ pi [θ1 /p1 , . . . , θn /pn ]
since pi [θ1 /p1 , . . . , θn /pn ] ≡ θi .
4. φ ≡ ¬ψ:
v ⊨ ¬ψ ⇔ v ⊭ ψ
by definition of v ⊨;
⇔ M, w ⊮ ψ[θ1 /p1 , . . . , θn /pn ]
by induction hypothesis
⇔ M, w ⊩ ¬ψ[θ1 /p1 , . . . , θn /pn ]
by definition of v ⊨.
5. φ ≡ (ψ ∧ χ):
v ⊨ ψ ∧ χ ⇔ v ⊨ ψ and v ⊨ χ
by definition of v ⊨
⇔ M, w ⊩ ψ[θ1 /p1 , . . . , θn /pn ] and
M, w ⊩ χ[θ1 /p1 , . . . , θn /pn ]
by induction hypothesis
⇔ M, w ⊩ (ψ ∧ χ)[θ1 /p1 , . . . , θn /pn ]
by definition of M, w ⊩.
6. φ ≡ (ψ ∨ χ):
v ⊨ ψ ∨ χ ⇔ v ⊨ ψ or v ⊨ χ
by definition of v ⊨;
⇔ M, w ⊩ ψ[θ1 /p1 , . . . , θn /pn ] or
M, w ⊩ χ[θ1 /p1 , . . . , θn /pn ]
by induction hypothesis
⇔ M, w ⊩ (ψ ∨ χ)[θ1 /p1 , . . . , θn /pn ]
by definition of M, w ⊩.
7. φ ≡ (ψ → χ):
v ⊨ ψ → χ ⇔ v ⊭ ψ or v ⊨ χ
by definition of v ⊨
⇔ M, w ⊮ ψ[θ1 /p1 , . . . , θn /pn ] or
M, w ⊩ χ[θ1 /p1 , . . . , θn /pn ]
by induction hypothesis
⇔ M, w ⊩ (ψ → χ)[θ1 /p1 , . . . , θn /pn ]
by definition of M, w ⊩.
8. φ ≡ (ψ ↔ χ):
v ⊨ ψ → χ ⇔ either v ⊨ ψ and v ⊨ χ
or v ⊭ ψ and v ⊭ χ
by definition of v ⊨
⇔ either M, w ⊩ ψ[θ1 /p1 , . . . , θn /pn ] and
M, w ⊩ χ[θ1 /p1 , . . . , θn /pn ]
or M, w ⊮ ψ[θ1 /p1 , . . . , θn /pn ] and
M, w ⊮ χ[θ1 /p1 , . . . , θn /pn ]
by induction hypothesis
⇔ M, w ⊩ (ψ ↔ χ)[θ1 /p1 , . . . , θn /pn ]
by definition of M, w ⊩.
content/normal-modal-logic/syntax-and-semantics/schemas.tex
Definition 49.17. A schema is true in a model if and only if all of its instances
are; and a schema is valid if and only if it is true in every model.
Proof. We need to show that all instances of the schema are true at every world
in every model. So let M = ⟨W, R, V ⟩ and w ∈ W be arbitrary. To show that a
conditional is true at a world we assume the antecedent is true to show that the
consequent is true as well. In this case, let M, w ⊩ □(φ → ψ) and M, w ⊩ □φ.
We need to show M, w ⊩ □ψ. So let w′ be arbitrary such that Rww′ . Then by
the first assumption M, w′ ⊩ φ → ψ and by the second assumption M, w′ ⊩ φ.
It follows that M, w′ ⊩ ψ. Since w′ was arbitrary, M, w ⊩ □ψ.
♢φ ↔ ¬□¬φ. (dual)
Proof. Exercise.
Proposition 49.21. A formula φ is valid iff all its substitution instances are. nml:syn:sch:
prop:valid-instances
In other words, a schema is valid iff its characteristic formula is.
Problem 49.9. Prove the claim in the “only if” part of the proof of Proposi-
tion 49.21. (Hint: use induction on φ.)
Note, however, that it is not true that a schema is true in a model iff its
characteristic formula is. Of course, the “only if” direction holds: if every
instance of φ is true in M, φ itself is true in M. But it may happen that φ is
true in M but some instance of φ is false at some world in M. For a very simple
counterexample consider p in a model with only one world w and V (p) = {w},
so that p is true at w. But ⊥ is an instance of p, and not true at w.
Problem 49.10. Show that none of the following formulas are valid:
D: □p → ♢p;
Problem 49.11. Prove that the schemas in the first column of Table 49.1 are
valid and those in the second column are not valid.
Problem 49.12. Decide whether the following schemas are valid or invalid:
1. (♢φ → □ψ) → (□φ → □ψ);
2. ♢(φ → ψ) ∨ □(ψ → φ).
Problem 49.13. For each of the following schemas find a model M such that
every instance of the formula is true in M:
1. p → ♢♢p;
2. ♢p → □p.
content/normal-modal-logic/syntax-and-semantics/entailment.tex
49.10 Entailment
nml:syn:ent: With the definition of truth at a world, we can define an entailment relation explanation
sec
between formulas. A formula ψ entails φ iff, whenever ψ is true, φ is true as
well. Here, “whenever” means both “whichever model we consider” as well as
“whichever world in that model we consider.”
Definition 49.22. If Γ is a set of formulas and φ a formula, then Γ entails φ,
in symbols: Γ ⊨ φ, if and only if for every model M = ⟨W, R, V ⟩ and world
w ∈ W , if M, w ⊩ ψ for every ψ ∈ Γ , then M, w ⊩ φ. If Γ contains a single
formula ψ, then we write ψ ⊨ φ.
w1 ¬p
Chapter 50
Frame Definability
672
50.1. INTRODUCTION
content/normal-modal-logic/frame-definability/introduction.tex
50.1 Introduction
nml:frd:int: One question that interests modal logicians is the relationship between the
sec
accessibility relation and the truth of certain formulas in models with that ac-
cessibility relation. For instance, suppose the accessibility relation is reflexive,
i.e., for every w ∈ W , Rww. In other words, every world is accessible from
itself. That means that when □φ is true at a world w, w itself is among the
accessible worlds at which φ must therefore be true. So, if the accessibility
relation R of M is reflexive, then whatever world w and formula φ we take,
□φ → φ will be true there (in other words, the schema □p → p and all its
substitution instances are true in M).
The converse, however, is false. It’s not the case, e.g., that if □p → p is
true in M, then R is reflexive. For we can easily find a non-reflexive model M
where □p → p is true at all worlds: take the model with a single world w,
not accessible from itself, but with w ∈ V (p). By picking the truth value of p
suitably, we can make □φ → φ true in a model that is not reflexive.
The solution is to remove the variable assignment V from the equation. If
we require that □p→p is true at all worlds in M, regardless of which worlds are
in V (p), then it is necessary that R is reflexive. For in any non-reflexive model,
there will be at least one world w such that not Rww. If we set V (p) = W \{w},
then p will be true at all worlds other than w, and so at all worlds accessible
from w (since w is guaranteed not to be accessible from w, and w is the only
world where p is false). On the other hand, p is false at w, so □p → p is false
at w.
This suggests that we should introduce a notation for model structures with-
out a valuation: we call these frames. A frame F is simply a pair ⟨W, R⟩ con-
sisting of a set of worlds with an accessibility relation. Every model ⟨W, R, V ⟩
is then, as we say, based on the frame ⟨W, R⟩. Conversely, a frame determines
the class of models based on it; and a class of frames determines the class of
models which are based on any frame in the class. And we can define F ⊨ φ,
the notion of a formula being valid in a frame as: M ⊩ φ for all M based on F.
With this notation, we can establish correspondence relations between for-
mulas and classes of frames: e.g., F ⊨ □p → p if, and only if, F is reflexive.
content/normal-modal-logic/frame-definability/properties-accessibility.tex
If R is . . . then . . . is true in M:
serial : ∀u∃vRuv □p → ♢p (D)
reflexive: ∀wRww □p → p (T)
symmetric: p → □♢p (B)
∀u∀v(Ruv → Rvu)
transitive: □p → □□p (4)
∀u∀v∀w((Ruv ∧ Rvw) → Ruw)
euclidean: ♢p → □♢p (5)
∀w∀u∀v((Rwu ∧ Rwv) → Ruv)
Table 50.1: Five correspondence facts.
nml:frd:acc:
tab:five
w w′
⊩φ ⊩ ♢φ
⊩ □♢φ
Proof. Here is the case for B: to show that the schema is true in a model we
need to show that all of its instances are true at all worlds in the model. So
let φ → □♢φ be a given instance of B, and let w ∈ W be an arbitrary world.
Suppose the antecedent φ is true at w, in order to show that □♢φ is true at
w. So we need to show that ♢φ is true at all w′ accessible from w. Now, for
any w′ such that Rww′ we have, using the hypothesis of symmetry, that also
Rw′ w (see Figure 50.1). Since M, w ⊩ φ, we have M, w′ ⊩ ♢φ. Since w′ was
an arbitrary world such that Rww′ , we have M, w ⊩ □♢φ.
We leave the other cases as exercises.
Notice that the converse implications of Theorem 50.1 do not hold: it’s not
true that if a model verifies a schema, then the accessibility relation of that
model has the corresponding property. In the case of T and reflexive models, it
is easy to give an example of a model in which T itself fails: let W = {w} and
V (p) = ∅. Then R is not reflexive, but M, w ⊩ □p and M, w ⊮ p. But here we
have just a single instance of T that fails in M; other instances, e.g., □¬p → ¬p
are true. It is harder to give examples where every substitution instance of T
is true in M and M is not reflexive. But there are such models, too:
If R is . . . then . . . is true in M:
partially functional :
♢p → □p
∀w∀u∀v((Rwu ∧ Rwv) → u = v)
functional : ∀w∃v∀u(Rwu ↔ u = v) ♢p ↔ □p
weakly dense:
□□p → □p
∀u∀v(Ruv → ∃w(Ruw ∧ Rwv))
weakly connected :
□((p ∧ □p) → q) ∨
∀w∀u∀v((Rwu ∧ Rwv) → (L)
□((q ∧ □q) → p)
(Ruv ∨ u = v ∨ Rvu))
weakly directed :
∀w∀u∀v((Rwu ∧ Rwv) → ♢□p → □♢p (G)
∃t(Rut ∧ Rvt))
Table 50.2: Five more correspondence facts.
nml:frd:acc:
tab:anotherfive
nml:frd:acc: Proposition 50.2. Let M = ⟨W, R, V ⟩ be a model such that W = {u, v},
prop:reflexive
where worlds u and v are related by R: i.e., both Ruv and Rvu. Suppose that
for all p: u ∈ V (p) ⇔ v ∈ V (p). Then:
Since M is not reflexive (it is, in fact, irreflexive), the converse of Theorem 50.1
fails in the case of T (similar arguments can be given for some—though not
all—the other schemas mentioned in Theorem 50.1).
content/normal-modal-logic/frame-definability/frames.tex
50.3 Frames
nml:frd:fra:
sec
Definition 50.3. A frame is a pair F = ⟨W, R⟩ where W is a non-empty set
of worlds and R a binary relation on W . A model M is based on a frame
F = ⟨W, R⟩ if and only if M = ⟨W, R, V ⟩ for some valuation V .
content/normal-modal-logic/frame-definability/definability.tex
nml:frd:def: Theorem 50.6. If the formula on the right side of Table 50.1 is valid in a
thm:fullCorrespondence
frame F, then F has the property on the left side.
You’ll notice a difference between the proof for D and the other cases: no
mention was made of the valuation V . In effect, we proved that if M ⊩ D then
M is serial. So D defines the class of serial models, not just frames.
Corollary 50.8. Each formula on the right side of Table 50.1 defines the class
of frames which have the property on the left side.
Proof. In Theorem 50.1, we proved that if a model has the property on the
left, the formula on the right is true in it. Thus, if a frame F has the property
on the left, the formula on the right is valid in F. In Theorem 50.6, we proved
the converse implications: if a formula on the right is valid in F, F has the
property on the left.
Problem 50.4. Show that if the formula on the right side of Table 50.2 is valid
in a frame F, then F has the property on the left side. To do this, consider a
frame that does not satisfy the property on the left, and define a suitable V
such that the formula on the right is false at some world.
Theorem 50.6 also shows that the properties can be combined: for instance
if both B and 4 are valid in F then the frame is both symmetric and transitive,
etc. Many important modal logics are characterized as the set of formulas valid
in all frames that combine some frame properties, and so we can characterize
them as the set of formulas valid in all frames in which the corresponding
defining formulas are valid. For instance, the classical system S4 is the set of
all formulas valid in all reflexive and transitive frames, i.e., in all those where
both T and 4 are valid. S5 is the set of all formulas valid in all reflexive,
symmetric, and euclidean frames, i.e., all those where all of T, B, and 5 are
valid.
Logical relationships between properties of R in general correspond to re-
lationships between the corresponding defining formulas. For instance, every
reflexive relation is serial; hence, whenever T is valid in a frame, so is D. (Note
that this relationship is not that of entailment. It is not the case that whenever
M, w ⊩ T then M, w ⊩ D.) We record some such relationships.
Proposition 50.9. Let R be a binary relation on a set W ; then: nml:frd:def:
prop:relation-facts
1. If R is reflexive, then it is serial.
2. If R is symmetric, then it is transitive if and only if it is euclidean.
3. If R is symmetric or euclidean then it is weakly directed (it has the “di-
amond property”).
4. If R is euclidean then it is weakly connected.
5. If R is functional then it is serial.
content/normal-modal-logic/frame-definability/first-order-definability.tex
It turns out that the properties and modal formulas that define them con-
sidered so far are exceptional. Not every formula defines a first-order definable
class of frames, and not every first-order definable class of frames is definable
by a modal formula.
A counterexample to the first is given by the Löb formula:
(Q(a1 , a2 ) ∧ · · · ∧ Q(an−1 , an ))
Γ = {β, φ1 , φ2 , . . . }.
content/normal-modal-logic/frame-definability/equivalence-S5.tex
Proof. Exercise.
2. If R is reflexive, it is serial.
content/normal-modal-logic/frame-definability/second-order-definability.tex
[w]
[z]
[u]
[v]
1. φ ≡ ⊥: STx (φ) = ⊥.
2. φ ≡ ⊥: STx (φ) = ⊤.
For instance, STx (□p → p) is ∀y (Q(x, y) → P (y)) → P (x). Any structure for
the language of STx (φ) requires a domain, a two-place relation assigned to Q,
and subsets of the domain assigned to the one-place predicate symbols Pi .
In other words, the components of such a structure are exactly those of a
model for φ: the domain is the set of worlds, the two-place relation assigned
to Q is the accessibility relation, and the subsets assigned to Pi are just the
assignments V (pi ). It won’t surprise that satisfaction of φ in a modal model
and of STx (φ) in the corresponding structure agree:
nml:frd:st: Proposition 50.16. Let M = ⟨W, R, V ⟩, M′ be the first-order structure with
prop:st ′ ′
|M′ | = W , QM = R, and PiM = V (pi ), and s(x) = w. Then
Proof. By induction on φ.
F ⊨ φ iff F′ ⊨ φ′
′
Proof. F′ ⊨ φ′ iff for every structure M′ where PiM ⊆ W for i = 1, . . . , n, and
for every s with s(x) ∈ W , M′ , s ⊨ STx (φ). By Proposition 50.16, that is the
case iff for all models M based on F and every world w ∈ W , M, w ⊩ φ, i.e.,
F ⊨ φ.
Proof. The monadic second-order sentence φ′ of the preceding proof has the
required property.
Chapter 51
Axiomatic Derivations
content/normal-modal-logic/axioms-systems/introduction.tex
51.1 Introduction
We have a semantics for the basic modal language in terms of modal models, nml:axs:int:
sec
and a notion of a formula being valid—true at all worlds in all models—or valid
with respect to some class of models or frames—true at all worlds in all models
in the class, or based on the frame. Logic usually connects such semantic
characterizations of validity with a proof-theoretic notion of derivability. The
aim is to define a notion of derivability in some system such that a formula is
derivable iff it is valid.
The simplest and historically oldest derivation systems are so-called Hilbert-
type or axiomatic derivation systems. Hilbert-type derivation systems for many
modal logics are relatively easy to construct: they are simple as objects of
metatheoretical study (e.g., to prove soundness and completeness). However,
684
51.1. INTRODUCTION
they are much harder to use to prove formulas in than, say, natural deduction
systems.
In Hilbert-type derivation systems, a derivation of a formula is a sequence
of formulas leading from certain axioms, via a handful of inference rules, to
the formula in question. Since we want the derivation system to match the
semantics, we have to guarantee that the set of derivable formulas are true
in all models (or true in all models in which all axioms are true). We’ll first
isolate some properties of modal logics that are necessary for this to work: the
“normal” modal logics. For normal modal logics, there are only two inference
rules that need to be assumed: modus ponens and necessitation. As axioms we
take all (substitution instances) of tautologies, and, depending on the modal
logic we deal with, a number of modal axioms. Even if we are just interested
in the class of all models, we must also count all substitution instances of K
and Dual as axioms. This alone generates the minimal normal modal logic K.
We say the formula ψ follows from the formulas φ by necessitation iff ψ ≡ □φ.
With this definition, it will turn out that the set of derivable formulas forms
a normal modal logic, and that any derivable formula is true in every model
in which every axiom is true. This property of derivations is called soundness.
The converse, completeness, is harder to prove.
content/normal-modal-logic/axioms-systems/normal-logics.tex
In order to use the relational semantics for modal logics, we also have to
require that all formulas valid in all modal models are included. It turns
out that this requirement is met as soon as all instances of K and dual are
derivable, and whenever a formula φ is derivable, so is □φ. A modal logic that
satisfies these conditions is called normal. (Of course, there are also non-normal
modal logics, but the usual relational models are not adequate for them.)
Proposition 51.6. Every normal modal logic is closed under rule rk, nml:prf:nor:
prop:rk
φ1 → (φ2 → · · · (φn−1 → φn ) · · · )
rk
□φ1 → (□φ2 → · · · (□φn−1 → □φn ) · · · ).
Proof. By induction on n: If n = 1, then the rule is just nec, and every normal
modal logic is closed under nec.
Now suppose the result holds for n − 1; we show it holds for n.
Assume
φ1 → (φ2 → · · · (φn−1 → φn ) · · · ) ∈ Σ
content/normal-modal-logic/axioms-systems/logics-proofs.tex
4. We have Kφ1 . . . φn ⊢ K, so K ∈ Σ.
content/normal-modal-logic/axioms-systems/proofs-in-K.tex
51.4 Proofs in K
nml:prf:prk: In order to practice proofs in the smallest modal system, we show the valid
sec
formulas on the left-hand side of Table 49.1 can all be given K-proofs.
Proof.
1. φ → (ψ → φ) taut
2. □(φ → (ψ → φ)) nec, 1
3. □(φ → (ψ → φ)) → (□φ → □(ψ → φ)) K
4. □φ → □(ψ → φ) mp, 2, 3
Proof.
1. (φ ∧ ψ) → φ taut
2. □((φ ∧ ψ) → φ) nec
3. □((φ ∧ ψ) → φ) → (□(φ ∧ ψ) → □φ) K
4. □(φ ∧ ψ) → □φ mp, 2, 3
5. (φ ∧ ψ) → ψ taut
6. □((φ ∧ ψ) → ψ) nec
7. □((φ ∧ ψ) → ψ) → (□(φ ∧ ψ) → □ψ) K
8. □(φ ∧ ψ) → □ψ mp, 6, 7
9. (□(φ ∧ ψ) → □φ) →
((□(φ ∧ ψ) → □ψ) →
(□(φ ∧ ψ) → (□φ ∧ □ψ))) taut
10. (□(φ ∧ ψ) → □ψ) →
(□(φ ∧ ψ) → (□φ ∧ □ψ)) mp, 4, 9
11. □(φ ∧ ψ) → (□φ ∧ □ψ) mp, 8, 10.
(p → q) → ((p → r) → (p → (q ∧ r))).
Proof.
1. φ → (ψ → (φ ∧ ψ)) taut
2. □(φ → (ψ → (φ ∧ ψ))) nec, 1
3. □(φ → (ψ → (φ ∧ ψ))) → (□φ → □(ψ → (φ ∧ ψ))) K
4. □φ → □(ψ → (φ ∧ ψ)) mp, 2, 3
5. □(ψ → (φ ∧ ψ)) → (□ψ → □(φ ∧ ψ)) K
6. (□φ → □(ψ → (φ ∧ ψ))) →
(□(ψ → (φ ∧ ψ)) → (□ψ → □(φ ∧ ψ))) →
(□φ → (□ψ → □(φ ∧ ψ)))) taut
7. (□(ψ → (φ ∧ ψ)) → (□ψ → □(φ ∧ ψ))) →
(□φ → (□ψ → □(φ ∧ ψ))) mp, 4, 6
8. □φ → (□ψ → □(φ ∧ ψ))) mp, 5, 7
9. (□φ → (□ψ → □(φ ∧ ψ)))) →
((□φ ∧ □ψ) → □(φ ∧ ψ)) taut
10. (□φ ∧ □ψ) → □(φ ∧ ψ) mp, 8, 9
The formulas on lines 6 and 9 are instances of the tautologies
(p → q) → ((q → r) → (p → r))
(p → (q → r)) → ((p ∧ q) → r)
Proof.
1. ♢¬p ↔ ¬□¬¬p dual
2. (♢¬p ↔ ¬□¬¬p) →
(¬□¬¬p → ♢¬p) taut
3. ¬□¬¬p → ♢¬p mp, 1, 2
4. ¬¬p → p taut
5. □(¬¬p → p) nec, 4
6. □(¬¬p → p) → (□¬¬p → □p) K
7. (□¬¬p → □p) mp, 5, 6
8. (□¬¬p → □p) → (¬□p → ¬□¬¬p) taut
9. ¬□p → ¬□¬¬p mp, 7, 8
10. (¬□p → ¬□¬¬p) →
((¬□¬¬p → ♢¬p) → (¬□p → ♢¬p)) taut
11. (¬□¬¬p → ♢¬p) → (¬□p → ♢¬p) mp, 9, 10
12. ¬□p → ♢¬p mp, 3, 11
The formulas on lines 8 and 10 are instances of the tautologies
(p → q) → (¬q → ¬p)
(p → q) → ((q → r) → (p → r)).
content/normal-modal-logic/axioms-systems/derived-rules.tex
(φ → ψ) → ((ψ → χ) → (φ → χ))
φ1 → (φ2 → · · · (φn → ψ) . . . )
We will indicate use of this proposition by rk. Let’s illustrate how these
results help establishing derivability results more easily.
Proposition 51.18. K ⊢ (□φ ∧ □ψ) → □(φ ∧ ψ)
Proof.
1. K ⊢ φ → (ψ → (φ ∧ ψ)) taut
2. K ⊢ □φ → (□ψ → □(φ ∧ ψ))) rk, 1
3. K ⊢ (□φ ∧ □ψ) → □(φ ∧ ψ) pl, 2
Proof.
1. K ⊢ ♢¬p ↔ ¬□¬¬p dual
2. K ⊢ ¬□¬¬p → ♢¬p pl, 1
3. K ⊢ ¬□p → ♢¬p p for ¬¬p
In the above derivation, the final step “p for ¬¬p” is short for
K ⊢ ¬□¬¬p → ♢¬p
K ⊢ ¬¬p ↔ p taut
K ⊢ ¬□p → ♢¬p by Proposition 51.19
The roles of χ(q), φ, and ψ in Proposition 51.19 are played here, respectively,
by ¬□q → ♢¬p, ¬¬p, and p.
When a formula contains a sub-formula ¬♢φ, we can replace it by □¬φ
using Proposition 51.19, since K ⊢ ¬♢φ ↔ □¬φ. We’ll indicate this and similar
replacements simply by “□¬ for ¬♢.”
The following proposition justifies that we can establish derivability results
schematically. E.g., the previous proposition does not just establish that K ⊢
¬□p → ♢¬p, but K ⊢ ¬□φ → ♢¬φ for arbitrary φ.
Proposition 51.21. If φ is a substitution instance of ψ and K ⊢ ψ, then
K ⊢ φ.
Proof. It is tedious but routine to verify (by induction on the length of the
derivation of ψ) that applying a substitution to an entire derivation also re-
sults in a correct derivation. Specifically, substitution instances of tautolog-
ical instances are themselves tautological instances, substitution instances of
instances of dual and K are themselves instances of dual and K, and appli-
cations of mp and nec remain correct when substituting formulas for proposi-
tional variables in both premise(s) and conclusion.
content/normal-modal-logic/axioms-systems/more-proofs-in-K.tex
Proof.
1. K ⊢ (φ → ψ) → (¬ψ → ¬φ) pl
2. K ⊢ □(φ → ψ) → (□¬ψ → □¬φ) rk, 1
3. K ⊢ (□¬ψ → □¬φ) → (¬□¬φ → ¬□¬ψ) taut
4. K ⊢ □(φ → ψ) → (¬□¬φ → ¬□¬ψ) pl, 2, 3
5. K ⊢ □(φ → ψ) → (♢φ → ♢ψ) ♢ for ¬□¬.
Proof.
1. K ⊢ φ → (¬ψ → ¬(φ → ψ)) taut
2. K ⊢ □φ → (□¬ψ → □¬(φ → ψ)) rk, 1
3. K ⊢ □φ → (¬□¬(φ → ψ) → ¬□¬ψ) pl, 2
4. K ⊢ □φ → (♢(φ → ψ) → ♢ψ) ♢ for ¬□¬.
Proof.
1. K ⊢ ¬(φ ∨ ψ) → ¬φ taut
2. K ⊢ □¬(φ ∨ ψ) → □¬φ rk, 1
3. K ⊢ ¬□¬φ → ¬□¬(φ ∨ ψ) pl, 2
4. K ⊢ ♢φ → ♢(φ ∨ ψ) ♢ for ¬□¬
5. K ⊢ ♢ψ → ♢(φ ∨ ψ) similarly
6. K ⊢ (♢φ ∨ ♢ψ) → ♢(φ ∨ ψ) pl, 4, 5.
Proof.
1. K ⊢ ¬φ → (¬ψ → ¬(φ ∨ ψ) taut
2. K ⊢ □¬φ → (□¬ψ → □¬(φ ∨ ψ) rk
3. K ⊢ □¬φ → (¬□¬(φ ∨ ψ) → ¬□¬ψ)) pl, 2
4. K ⊢ ¬□¬(φ ∨ ψ) → (□¬φ → ¬□¬ψ) pl, 3
5. K ⊢ ¬□¬(φ ∨ ψ) → (¬¬□¬ψ → ¬□¬φ) pl, 4
6. K ⊢ ♢(φ ∨ ψ) → (¬♢ψ → ♢φ) ♢ for ¬□¬
7. K ⊢ ♢(φ ∨ ψ) → (♢ψ ∨ ♢φ) pl, 6.
content/normal-modal-logic/axioms-systems/duals.tex
p → ♢p (T♢ )
♢□p → p (B♢ )
♢♢p → ♢p (4♢ )
♢□p → □p (5♢ )
Each of the above dual formulas is obtained from the corresponding formula
by substituting ¬p for p, contraposing, replacing ¬□¬ by ♢, and replacing ¬♢¬
by □. D, i.e., □φ → ♢φ is its own dual in that sense.
Proof. Exercise.
content/normal-modal-logic/axioms-systems/proofs-modal-systems.tex
2. KT5 ⊢ 4;
3. KDB4 ⊢ T;
4. KB4 ⊢ 5;
5. KB5 ⊢ 4;
nml:prf:prs: 6. KT ⊢ D.
prop:S5facts-KT-D
1. KT5 ⊢ B:
1. KT5 ⊢ ♢φ → □♢φ 5
2. KT5 ⊢ φ → ♢φ T♢
3. KT5 ⊢ φ → □♢φ pl.
2. KT5 ⊢ 4:
3. KDB4 ⊢ T:
1. KDB4 ⊢ ♢□φ → φ B♢
2. KDB4 ⊢ □□φ → ♢□φ D with □φ for p
3. KDB4 ⊢ □□φ → φ pl1, 2
4. KDB4 ⊢ □φ → □□φ 4
5. KDB4 ⊢ □φ → φ pl, 1, 4.
4. KB4 ⊢ 5:
5. KB5 ⊢ 4:
6. KT ⊢ D:
1. KT ⊢ □φ → φ T
2. KT ⊢ φ → ♢φ T♢
3. KT ⊢ □φ → ♢φ pl, 1, 2
The following proposition shows that the classical system S5 has several
equivalent axiomatizations. This should not surprise, as the various combina-
tions of axioms all characterize equivalence relations (see Proposition 50.12).
Proposition 51.30. KTB4 = KT5 = KDB4 = KDB5. nml:prf:prs:
prop:S5
Proof. Exercise.
content/normal-modal-logic/axioms-systems/soundness.tex
51.9 Soundness
A derivation system is called sound if everything that can be derived is valid. nml:prf:snd:
sec
When considering modal systems, i.e., derivations where in addition to K we
can use instances of some formulas φ1 , . . . , φn , we want every derivable formula
to be true in any model in which φ1 , . . . , φn are true.
Theorem 51.31 (Soundness Theorem). If every instance of φ1 , . . . , φn nml:prf:snd:
is valid in the classes of models C1 , . . . , Cn , respectively, then Kφ1 . . . φn ⊢ ψ thm:soundness
content/normal-modal-logic/axioms-systems/systems-distinct.tex
Proof. This is the syntactic counterpart to the semantic fact that all reflexive
relations are serial. To show KD ⊆ KT we need to see that KD ⊢ ψ implies
KT ⊢ ψ, which follows from KT ⊢ D, as shown in Proposition 51.28(6). To
show that the inclusion is proper, by Soundness (Theorem 51.31), it suffices
to exhibit a model of KD where T, i.e., □p → p, fails (an easy task left as an
exercise), for then by Soundness KD ⊬ □p → p.
Proof. By Theorem 50.1 we know that all instances of T and B are true in
every reflexive symmetric model (respectively). So by soundness, it suffices to
find a reflexive symmetric model containing a world at which some instance
of 4 fails, and similarly for 5. We use the same model for both claims. Consider
the symmetric, reflexive model in Figure 51.2. Then M, w1 ⊮ □p → □□p, so 4
fails at w1 . Similarly, M, w2 ⊮ ♢¬p → □♢¬p, so the instance of 5 with φ = ¬p
fails at w2 .
Proof. By Theorem 50.1 we know that all instances of D and 5 are true in all
serial euclidean models. So it suffices to find a serial euclidean model containing
a world at which some instance of 4 fails. Consider the model of Figure 51.3,
and notice that M, w1 ⊮ □p → □□p.
w1 p w2 p w3 ¬p
⊩ □p ⊩ ♢¬p
⊮ □□p ⊮ □♢¬p
⊮ ♢¬p
Figure 51.2: The model for Theorem 51.34.
nml:prf:dis:
fig:KTBnot45
w4 ¬p
p p
w2 w3
w1 ¬p
⊩ □p, ⊮ □□p
Figure 51.3: The model for Theorem 51.35.
nml:prf:dis:
fig:KD5not4
Problem 51.7. Give an alternative proof of Theorem 51.35 using a model
with 3 worlds.
Problem 51.8. Provide a single reflexive transitive model showing that both
KT4 ⊬ B and KT4 ⊬ 5.
content/normal-modal-logic/axioms-systems/provability-from-set.tex
Σ ⊢ ψ1 → (ψ2 → · · · (ψn → φ) · · · ).
content/normal-modal-logic/axioms-systems/provability-properties.tex
The proof is an easy exercise. Part (5) of Proposition 51.37 gives us that,
for instance, if Γ ⊢Σ φ ∨ ψ and Γ ⊢Σ ¬φ, then Γ ⊢Σ ψ. Also, in what follows,
we write Γ, φ ⊢Σ ψ instead of Γ ∪ {φ} ⊢Σ ψ.
Definition 51.38. A set Γ is deductively closed relatively to a system Σ if
and only if Γ ⊢Σ φ implies φ ∈ Γ .
content/normal-modal-logic/axioms-systems/consistency.tex
51.13 Consistency
nml:prf:con: Consistency is an important property of sets of formulas. A set of formulas is
sec
inconsistent if a contradiction, such as ⊥, is derivable from it; and otherwise
consistent. If a set is inconsistent, its formulas cannot all be true in a model at
a world. For the completeness theorem we prove the converse: every consistent
set is true at a world in a model, namely in the “canonical model.”
Definition 51.39. A set Γ is consistent relatively to a system Σ or, as we
will say, Σ-consistent, if and only if Γ ⊬Σ ⊥.
So for instance, the set {□(p→q), □p, ¬□q} is consistent relatively to propo-
sitional logic, but not K-consistent. Similarly, the set {♢p, □♢p → q, ¬q} is not
K5-consistent.
nml:prf:con: Proposition 51.40. Let Γ be a set of formulas. Then:
prop:consistencyfacts
1. Γ is Σ-consistent if and only if there is some formula φ such that Γ ⊬Σ φ.
nml:prf:con: 2. Γ ⊢Σ φ if and only if Γ ∪ {¬φ} is not Σ-consistent.
prop:consistencyfacts-b
nml:prf:con: 3. If Γ is Σ-consistent, then for any formula φ, either Γ ∪ {φ} is Σ-
prop:consistencyfacts-c
consistent or Γ ∪ {¬φ} is Σ-consistent.
Chapter 52
content/normal-modal-logic/completeness/introduction.tex
52.1 Introduction
If Σ is a modal system, then the soundness theorem establishes that if Σ ⊢ φ, nml:com:int:
sec
then φ is valid in any class C of models in which all instances of all formulas
in Σ are valid. In particular that means that if K ⊢ φ then φ is true in all
models; if KT ⊢ φ then φ is true in all reflexive models; if KD ⊢ φ then φ is
true in all serial models, etc.
Completeness is the converse of soundness: that K is complete means that
if a formula φ is valid, ⊢ φ, for instance. Proving completeness is a lot harder to
do than proving soundness. It is useful, first, to consider the contrapositive: K
is complete iff whenever ⊬ φ, there is a countermodel, i.e., a model M such that
M ⊮ φ. Equivalently (negating φ), we could prove that whenever ⊬ ¬φ, there
is a model of φ. In the construction of such a model, we can use information
contained in φ. When we find models for specific formulas we often do the
same: e.g., if we want to find a countermodel to p → □q, we know that it has to
contain a world where p is true and □q is false. And a world where □q is false
means there has to be a world accessible from it where q is false. And that’s
all we need to know: which worlds make the propositional variables true, and
which worlds are accessible from which worlds.
In the case of proving completeness, however, we don’t have a specific for-
mula φ for which we are constructing a model. We want to establish that a
700
52.2. COMPLETE Σ-CONSISTENT SETS
model exists for every φ such that ⊬Σ ¬φ. This is a minimal requirement, since
if ⊢Σ ¬φ, by soundness, there is no model for φ (in which Σ is true). Now
note that ⊬Σ ¬φ iff φ is Σ-consistent. (Recall that Σ ⊬Σ ¬φ and φ ⊬Σ ⊥ are
equivalent.) So our task is to construct a model for every Σ-consistent formula.
The trick we’ll use is to find a Σ-consistent set of formulas that contains φ,
but also other formulas which tell us what the world that makes φ true has
to look like. Such sets are complete Σ-consistent sets. It’s not enough to
construct a model with a single world to make φ true, it will have to contain
multiple worlds and an accessibility relation. The complete Σ-consistent set
containing φ will also contain other formulas of the form □ψ and ♢χ. In all
accessible worlds, ψ has to be true; in at least one, χ has to be true. In order
to accomplish this, we’ll simply take all possible complete Σ-consistent sets
as the basis for the set of worlds. A tricky part will be to figure out when a
complete Σ-consistent set should count as being accessible from another in our
model.
We’ll show that in the model so defined, φ is true at a world—which is
also a complete Σ-consistent set—iff φ is an element of that set. If φ is Σ-
consistent, it will be an element of at least one complete Σ-consistent set (a
fact we’ll prove), and so there will be a world where φ is true. So we will have
a single model where every Σ-consistent formula φ is true at some world. This
single model is the canonical model for Σ.
content/normal-modal-logic/completeness/complete-consistent-sets.tex
2. Σ ⊆ Γ . nml:com:ccs:
prop:ccs-sigma
3. ⊥ ∈
/Γ nml:com:ccs:
prop:ccs-lfalse
4. ⊤ ∈ Γ nml:com:ccs:
prop:ccs-ltrue
5. ¬φ ∈ Γ if and only if φ ∈
/ Γ. nml:com:ccs:
prop:ccs-lnot
6. φ ∧ ψ ∈ Γ iff φ ∈ Γ and ψ ∈ Γ nml:com:ccs:
prop:ccs-land
7. φ ∨ ψ ∈ Γ iff φ ∈ Γ or ψ ∈ Γ nml:com:ccs:
prop:ccs-lor
8. φ → ψ ∈ Γ iff φ ∈
/ Γ or ψ ∈ Γ nml:com:ccs:
prop:ccs-lif
9. φ ↔ ψ ∈ Γ iff either φ ∈ Γ and ψ ∈ Γ , or φ ∈
/ Γ and ψ ∈
/Γ nml:com:ccs:
prop:ccs-liff
content/normal-modal-logic/completeness/lindenbaums-lemma.tex
set ∆ extending Γ (including when Γ = ∅, in which case we get another char- cor:provability-characterization
content/normal-modal-logic/completeness/modalities-ccs.tex
□Γ = {□ψ : ψ ∈ Γ }
♢Γ = {♢ψ : ψ ∈ Γ }
and
□−1 Γ = {ψ : □ψ ∈ Γ }
♢−1 Γ = {ψ : ♢ψ ∈ Γ }
content/normal-modal-logic/completeness/canonical-models.tex
content/normal-modal-logic/completeness/truth-lemma.tex
Proof. By induction on φ.
1. φ ≡ ⊥: MΣ , ∆ ⊮ ⊥ by Definition 49.6, and ⊥ ∈
/ ∆ by Proposi-
tion 52.2(3).
2. φ ≡ ⊤: MΣ , ∆ ⊩ ⊤ by Definition 49.6, and ⊤ ∈ ∆ by Proposi-
tion 52.2(4).
3. φ ≡ p: MΣ , ∆ ⊩ p iff ∆ ∈ V Σ (p) by Definition 49.6. Also, ∆ ∈ V Σ (p)
iff p ∈ ∆ by definition of V Σ .
4. φ ≡ ¬ψ: MΣ , ∆ ⊩ ¬ψ iff MΣ , ∆ ⊮ ψ (Definition 49.6) iff ψ ∈
/ ∆ (by
inductive hypothesis) iff ¬ψ ∈ ∆ (by Proposition 52.2(5)).
5. φ ≡ ψ ∧ χ: MΣ , ∆ ⊩ ψ ∧ χ iff MΣ , ∆ ⊩ ψ and MΣ , ∆ ⊩ χ (by
Definition 49.6) iff ψ ∈ ∆ and χ ∈ ∆ (by inductive hypothesis) iff ψ ∧ χ ∈
∆ (by Proposition 52.2(6)).
6. φ ≡ ψ ∨ χ: MΣ , ∆ ⊩ ψ ∨ χ iff MΣ , ∆ ⊩ ψ or MΣ , ∆ ⊩ χ (by Defini-
tion 49.6) iff ψ ∈ ∆ or χ ∈ ∆ (by inductive hypothesis) iff ψ ∨ χ ∈ ∆ (by
Proposition 52.2(7)).
7. φ ≡ ψ → χ: MΣ , ∆ ⊩ ψ → χ iff MΣ , ∆ ⊮ ψ or MΣ , ∆ ⊩ χ (by
Definition 49.6) iff ψ ∈
/ ∆ or χ ∈ ∆ (by inductive hypothesis) iff ψ→χ ∈ ∆
(by Proposition 52.2(8)).
8. φ ≡ ψ ↔ χ: MΣ , ∆ ⊩ ψ ↔ χ iff either MΣ , ∆ ⊩ ψ and MΣ , ∆ ⊩ χ or
MΣ , ∆ ⊮ ψ and MΣ , ∆ ⊮ χ (by Definition 49.6) iff either ψ ∈ ∆ and
χ ∈ ∆ or ψ ∈/ ∆ and χ ∈
/ ∆ (by inductive hypothesis) iff ψ ↔ χ ∈ ∆ (by
Proposition 52.2(9)).
9. φ ≡ □ψ: First suppose that MΣ , ∆ ⊩ □ψ. By Definition 49.6, for every
∆′ such that RΣ ∆∆′ , MΣ , ∆′ ⊩ ψ. By inductive hypothesis, for every
∆′ such that RΣ ∆∆′ , ψ ∈ ∆′ . By definition of RΣ , for every ∆′ such
that □−1 ∆ ⊆ ∆′ , ψ ∈ ∆′ . By Proposition 52.8, □ψ ∈ ∆.
Now assume □ψ ∈ ∆. Let ∆′ ∈ W Σ be such that RΣ ∆∆′ , i.e., □−1 ∆ ⊆
∆′ . Since □ψ ∈ ∆, ψ ∈ □−1 ∆. Consequently, ψ ∈ ∆′ . By inductive
hypothesis, MΣ , ∆′ ⊩ ψ. Since ∆′ is arbitrary with RΣ ∆∆′ , for all ∆′ ∈
W Σ such that RΣ ∆∆′ , MΣ , ∆′ ⊩ ψ. By Definition 49.6, MΣ , ∆ ⊩ □ψ.
10. φ ≡ ♢ψ: First suppose that MΣ , ∆ ⊩ ♢ψ. By Definition 49.6, for some
∆′ such that RΣ ∆∆′ , MΣ , ∆′ ⊩ ψ. By inductive hypothesis, for some
∆′ such that RΣ ∆∆′ , ψ ∈ ∆′ . By definition of RΣ , for some ∆′ such
that □−1 ∆ ⊆ ∆′ , ψ ∈ ∆′ . By Proposition 52.10, for some ∆′ such that
♢∆′ ⊆ ∆, ψ ∈ ∆′ . Since ψ ∈ ∆′ , ♢ψ ∈ ♢∆′ , so ♢ψ ∈ ∆.
Now assume ♢ψ ∈ ∆. By Proposition 52.10, there is a complete Σ-
consistent ∆′ ∈ W Σ such that ♢∆′ ⊆ ∆ and ψ ∈ ∆′ . By Lemma 52.9,
there is a ∆′ ∈ W Σ such that □−1 ∆ ⊆ ∆′ , and ψ ∈ ∆′ . By definition of
RΣ , RΣ ∆∆′ , so there is a ∆′ ∈ W Σ such that RΣ ∆∆′ and ψ ∈ ∆′ . By
Definition 49.6, MΣ , ∆ ⊩ ♢ψ.
content/normal-modal-logic/completeness/completeness-K.tex
Corollary 52.15. The basic modal logic K is complete with respect to the nml:com:cmk:
class of all models, i.e., if ⊨ φ then K ⊢ φ. cor:Kcomplete
content/normal-modal-logic/completeness/frame-completeness.tex
nml:com:fra: Theorem 52.16. If a normal modal logic Σ contains one of the formulas
thm:completeframeprops
on the left-hand side of Table 52.1, then the canonical model for Σ has the
corresponding property on the right-hand side.
nml:com:fra: Theorem 52.17. Let CD , CT , CB , C4 , and C5 be the class of all serial, re-
thm:generaldet
flexive, symmetric, transitive, and euclidean models (respectively). Then for
2. This follows immediately from part (1) and the seriality proof in Theo-
rem 52.16.
Γ = □−1 ∆1 ∪ ♢∆2 .
φ1 , . . . , φn , ♢ψ1 , . . . , ♢ψm ⊢Σ ⊥.
Chapter 53
711
CHAPTER 53. FILTRATIONS AND DECIDABILITY
content/normal-modal-logic/filtrations/introduction.tex
53.1 Introduction
One important question about a logic is always whether it is decidable, i.e., if nml:fil:int:
sec
there is an effective procedure which will answer the question “is this formula
valid.” Propositional logic is decidable: we can effectively test if a formula is
a tautology by constructing a truth table, and for a given formula, the truth
table is finite. But we can’t obviously test if a modal formula is true in all
models, for there are infinitely many of them. We can list all the finite models
relevant to a given formula, since only the assignment of subsets of worlds to
propositional variables which actually occur in the formula are relevant. If the
accessibility relation is fixed, the possible different assignments V (p) are just
all the subsets of W , and if |W | = n there are 2n of those. If our formula φ
contains m propositional variables there are then 2nm different models with n
worlds. For each one, we can test if φ is true at all worlds, simply by computing
the truth value of φ in each. Of course, we also have to check all possible
accessibility relations, but there are only finitely many relations on n worlds
2
as well (specifically, the number of subsets of W × W , i.e., 2n .
If we are not interested in the logic K, but a logic defined by some class of
models (e.g., the reflexive transitive models), we also have to be able to test
if the accessibility relation is of the right kind. We can do that whenever the
frames we are interested in are definable by modal formulas (e.g., by testing if
T and 4 valid in the frame). So, the idea would be to run through all the finite
frames, test each one if it is a frame in the class we’re interested in, then list
all the possible models on that frame and test if φ is true in each. If not, stop:
φ is not valid in the class of models of interest.
There is a problem with this idea: we don’t know when, if ever, we can stop
looking. If the formula has a finite countermodel, our procedure will find it.
But if it has no finite countermodel, we won’t get an answer. The formula may
be valid (no countermodels at all), or it may have only an infinite countermodel,
which we’ll never look at. This problem can be overcome if we can show that
every formula that has a countermodel has a finite countermodel. If this is the
case we say the logic has the finite model property.
But how would we show that a logic has the finite model property? One
way of doing this would be to find a way to turn an infinite (counter)model
of φ into a finite one. If that can be done, then whenever there is a model in
which φ is not true, then the resulting finite model also makes φ not true. That
finite model will show up on our list of all finite models, and we will eventually
determine, for every formula that is not valid, that it isn’t. Our procedure
won’t terminate if the formula is valid. If we can show in addition that there
is some maximum size that the finite model our procedure provides can have,
and that this maximum size depends only on the formula φ, we will have a size
up to which we have to test finite models in our search for countermodels. If
we haven’t found a countermodel by then, there are none. Then our procedure
will, in fact, decide the question “is φ valid?” for any formula φ.
A strategy that often works for turning infinite structures into finite struc-
tures is that of “identifying” elements of the structure which behave the same
way in relevant respects. If there are infinitely many worlds in M that behave
the same in relevant respects, then we may be able to collect all worlds in
finitely many (possibly infinite) “classes” of such worlds. In other words, we
should partition the set of worlds in the right way, i.e., in such a way that each
partition contains infinitely many worlds, but there are only finitely many par-
titions. Then we define a new model M∗ where the worlds are the partitions.
Finitely many partitions in the old model give us finitely many worlds in the
new model, i.e., a finite model. Let’s call the partition a world w is in [w].
We’ll want it to be the case that M, w ⊩ φ iff M∗ , [w] ⊩ φ, since we want the
new model to be a countermodel to φ if the old one was. This requires that
we define the partition, as well as the accessibility relation of M∗ in the right
way.
To see how this would go, first imagine we have no accessibility relation.
M, w ⊩ □ψ iff for some v ∈ W , M, v ⊩ □ψ, and the same for M∗ , except with
[w] and [v]. As a first idea, let’s say that two worlds u and v are equivalent
(belong to the same partition) if they agree on all propositional variables in M,
i.e., M, u ⊩ p iff M, v ⊩ p. Let V ∗ (p) = {[w] : M, w ⊩ p}. Our aim is to show
that M, w ⊩ φ iff M∗ , [w] ⊩ φ. Obviously, we’d prove this by induction: The
base case would be φ ≡ p. First suppose M, w ⊩ p. Then [w] ∈ V ∗ by
definition, so M∗ , [w] ⊩ p. Now suppose that M∗ , [w] ⊩ p. That means that
[w] ∈ V ∗ (p), i.e., for some v equivalent to w, M, v ⊩ p. But “w equivalent to v”
means “w and v make all the same propositional variables true,” so M, w ⊩ p.
Now for the inductive step, e.g., φ ≡ ¬ψ. Then M, w ⊩ ¬ψ iff M, w ⊮ ψ iff
M∗ , [w] ⊮ ψ (by inductive hypothesis) iff M∗ , [w] ⊩ ¬ψ. Similarly for the other
non-modal operators. It also works for □: suppose M∗ , [w] ⊩ □ψ. That means
that for every [u], M∗ , [u] ⊩ ψ. By inductive hypothesis, for every u, M, u ⊩ ψ.
Consequently, M, w ⊩ □ψ.
In the general case, where we have to also define the accessibility relation
for M∗ , things are more complicated. We’ll call a model M∗ a filtration if its
accessibility relation R∗ satisfies the conditions required to make the inductive
proof above go through. Then any filtration M∗ will make φ true at [w] iff
M makes φ true at w. However, now we also have to show that there are
filtrations, i.e., we can define R∗ so that it satisfies the required conditions.
In order for this to work, however, we have to require that worlds u, v count
as equivalent not just when they agree on all propositional variables, but on
all sub-formulas of φ. Since φ has only finitely many sub-formulas, this will
still guarantee that the filtration is finite. There is not just one way to define
a filtration, and in order to make sure that the accessibility relation of the
filtration satisfies the required properties (e.g., reflexive, transitive, etc.) we
have to be inventive with the definition of R∗ .
content/normal-modal-logic/filtrations/preliminaries.tex
53.2 Preliminaries
Filtrations allow us to establish the decidability of our systems of modal logic nml:fil:pre:
sec
by showing that they have the finite model property, i.e., that any formula that
is true (false) in a model is also true (false) in a finite model. Filtrations are
defined relative to sets of formulas which are closed under subformulas.
For instance, given a formula φ, the set of all its sub-formulas is closed
under sub-formulas. When we’re defining a filtration of a model through the
set of sub-formulas of φ, it will have the property we’re after: it makes φ true
(false) iff the original model does.
The set of worlds of a filtration of M through Γ is defined as the set of all
equivalence classes of the following equivalence relation.
The equivalence class [w]≡ of a world w, or [w] for short, is the set of all worlds
≡-equivalent to w:
[w] = {v : v ≡ w}.
Proof. The relation ≡ is reflexive, since w makes exactly the same formulas
from Γ true as itself. It is symmetric since if u makes the same formulas
from Γ true as v, the same holds for v and u. It is also transitive, since if u
makes the same formulas from Γ true as v, and v as w, then u makes the same
formulas from Γ true as w.
The relation ≡, like any equivalence relation, divides W into partitions, i.e.,
subsets of W which are pairwise disjoint, and together cover all of W . Every
w ∈ W is an element of one of the partitions, namely of [w], since w ≡ w. So
the partitions [w] cover all of W . They are pairwise disjoint, for if u ∈ [w] and
u ∈ [v], then u ≡ w and u ≡ v, and by symmetry and transitivity, w ≡ v, and
so [w] = [v].
content/normal-modal-logic/filtrations/filtrations-def.tex
53.3 Filtrations
nml:fil:fil: Rather than define “the” filtration of M through Γ , we define when a model M∗
sec
counts as a filtration of M. All filtrations have the same set of worlds W ∗ and
the same valuation V ∗ . But different filtrations may have different accessibility
relations R∗ . To count as a filtration, R∗ has to satisfy a number of conditions,
however. These conditions are exactly what we’ll require to prove the main
result, namely that M, w ⊩ φ iff M∗ , [w] ⊩ φ, provided φ ∈ Γ .
nml:fil:fil: Definition 53.4. Let Γ be closed under subformulas and M = ⟨W, R, V ⟩. A
defn:filtration
filtration of M through Γ is any model M∗ = ⟨W ∗ , R∗ , V ∗ ⟩, where:
1. W ∗ = {[w] : w ∈ W };
nml:fil:fil: 2. For any u, v ∈ W :
defn:filtration-R
nml:fil:fil: a) If Ruv then R∗ [u][v];
defn:filtration-R1
nml:fil:fil: b) If R∗ [u][v] then for any □φ ∈ Γ , if M, u ⊩ □φ then M, v ⊩ φ;
defn:filtration-R2
nml:fil:fil: c) If R∗ [u][v] then for any ♢φ ∈ Γ , if M, v ⊩ φ then M, u ⊩ ♢φ.
defn:filtration-R3
3. V ∗ (p) = {[u] : u ∈ V (p)}.
It’s worthwhile thinking about what V ∗ (p) is: the set consisting of the
equivalence classes [w] of all worlds w where p is true in M. On the one hand,
if w ∈ V (p), then [w] ∈ V ∗ (p) by that definition. However, it is not necessarily
the case that if [w] ∈ V ∗ (p), then w ∈ V (p). If [w] ∈ V ∗ (p) we are only
guaranteed that [w] = [u] for some u ∈ V (p). Of course, [w] = [u] means that
w ≡ u. So, when [w] ∈ V ∗ (p) we can (only) conclude that w ≡ u for some
u ∈ V (p).
nml:fil:fil: Theorem 53.5. If M∗ is a filtration of M through Γ , then for every φ ∈ Γ
thm:filtrations
and w ∈ W , we have M, w ⊩ φ if and only if M∗ , [w] ⊩ φ.
What holds for truth at worlds in a model also holds for truth in a model
and validity in a class of models.
Corollary 53.6. Let Γ be closed under subformulas. Then:
1. If M∗ is a filtration of M through Γ then for any φ ∈ Γ : M ⊩ φ if and
only if M∗ ⊩ φ.
2. If C is a class of models and Γ (C) is the class of Γ -filtrations of models
in C, then any formula φ ∈ Γ is valid in C if and only if it is valid in
Γ (C).
content/normal-modal-logic/filtrations/examples-of-filtrations.tex
Proof. Given the definition of R∗ , the only condition that is left to verify is
the implication from Ruv to R∗ [u][v]. So assume Ruv. Suppose □φ ∈ Γ and
M, u ⊩ □φ; then obviously M, v ⊩ φ, and (1) is satisfied. Suppose ♢φ ∈ Γ
and M, v ⊩ φ. Then M, u ⊩ ♢φ since Ruv, and (2) is satisfied.
1 2 3 4
¬p p ¬p p
Now let Γ be the set of sub-formulas of □p→p, i.e., {p, □p, □p→p}. p is true
at all and only the even numbers, □p is true at all and only the odd numbers,
so □p → p is true at all and only the even numbers. In other words, every odd
number makes □p true but p and □p → p false; every even number makes p
and □p → p true, but □p false. So W ∗ = {[1], [2]}, where [1] = {1, 3, 5, . . . } and
[2] = {2, 4, 6, . . . }. Since 2 ∈ V (p), [2] ∈ V ∗ (p); since 1 ∈ / V ∗ (p). So
/ V (p), [1] ∈
∗
V (p) = {[2]}.
{⟨[1], [2]⟩, ⟨[2], [1]⟩} and {⟨[1], [2]⟩, ⟨[2], [1]⟩, ⟨[2], [2]⟩}.
In either case, p and □p → p are false and □p is true at [1]; p and □p → p are
true and □p is false at [2].
000
p
00
¬q
p
¬q 001
¬p
0 q
p
¬q 010
p
01
¬q
¬p
q 011
¬p
q
content/normal-modal-logic/filtrations/finite.tex
Proof. The size of W ∗ is the number of different classes [w] under the equiva-
lence relation ≡. Any two worlds u, v in such class—that is, any u and v such
that u ≡ v—agree on all formulas φ in Γ , φ ∈ Γ either φ is true at both u and
v, or at neither. So each class [w] corresponds to subset of Γ , namely the set
of all φ ∈ Γ such that φ is true at the worlds in [w]. No two different classes
[u] and [v] correspond to the same subset of Γ . For if the set of formulas true
at u and that of formulas true at v are the same, then u and v agree on all
formulas in Γ , i.e., u ≡ v. But then [u] = [v]. So, there is an injective function
from W ∗ to ℘(Γ ), and hence |W ∗ | ≤ |℘(Γ )|. Hence if Γ contains n sentences,
the cardinality of W ∗ is no greater than 2n .
content/normal-modal-logic/filtrations/S5-fmp.tex
To show that a logic L has the finite model property via filtrations it is
essential that the filtration of an L-model is itself a L-model. Often this re-
quires a fair bit of work, and not any filtration yields a L-model. However, for
universal models, this still holds.
Proposition 53.15. Let U be the class of universal models (see Proposi- nml:fil:fmp:
tion 50.14) and UFin the class of all finite universal models. Then any for- prop:univ-fin
Proof. Finite universal models are universal models, so the left-to-right direc-
tion is trivial. For the right-to left direction, suppose that φ is false at some
world w in a universal model M. Let Γ contain φ as well as all of its sub-
formulas; clearly Γ is finite. Take a filtration M∗ of M; then M∗ is finite by
Proposition 53.12, and by Theorem 53.5, φ is false at [w] in M∗ . It remains to
observe that M∗ is also universal: given u and v, by hypothesis Ruv and by
Definition 53.4(2), also R∗ [u][v].
Problem 53.4. Show that any filtration of a serial or reflexive model is also
serial or reflexive (respectively).
content/normal-modal-logic/filtrations/S5-decidable.tex
53.7 S5 is Decidable
nml:fil:dec: The finite model property gives us an easy way to show that systems of modal
sec
logic given by schemas are decidable (i.e., that there is a computable procedure
to determine whether a formula is derivable in the system or not).
The above proof works for S5 because filtrations of universal models are
automatically universal. The same holds for reflexivity and seriality, but more
work is needed for other properties.
content/normal-modal-logic/filtrations/more-filtrations.tex
content/normal-modal-logic/filtrations/euclidean-filtrations.tex
¬p w3 w4 p w5 ¬p
⊩ □p ⊮ □p ⊮ □p
Figure 53.2: A serial and euclidean model.
nml:fil:euc:
fig:ser-eucl
[w2 ] p
⊩ □p
¬p [w1 ] [w1 ] = [w3 ]
⊩ □p
[w4 ] p [w5 ] ¬p
⊮ □p ⊮ □p
Figure 53.3: The filtration of the model in Figure 53.2.
nml:fil:euc: In particular, to obtain a euclidean filtration it is not enough to consider
fig:ser-eucl2 filtrations through arbitrary Γ ’s closed under sub-formulas. Instead we need
to consider sets Γ that are modally closed (see Definition 53.1). Such sets of
sentences are infinite, and therefore do not immediately yield a finite model
property or the decidability of the corresponding system.
nml:fil:euc: Theorem 53.19. Let Γ be modally closed, M = ⟨W, R, V ⟩, and M∗ = ⟨W ∗ , R∗ , V ∗ ⟩
thm:modal-closed-filt
be a coarsest filtration of M.
1. If M is symmetric, so is M∗ .
2. If M is transitive, so is M∗ .
3. If M is euclidean, so is M∗ .
2. Exercise. Use the fact that both 5 and 5♢ are valid in all euclidean
models.
3. Exercise. Use the fact that B and B♢ are valid in all symmetric models.
Chapter 54
Modal Tableaux
Draft chapter on prefixed tableaux for modal logic. Needs more exam-
ples, completeness proofs, and discussion of how one can find countermod-
els from unsuccessful searches for closed tableaux.
content/normal-modal-logic/tableaux/introduction.tex
54.1 Introduction
Tableaux are certain (downward-branching) trees of signed formulas, i.e., pairs nml:tab:int:
sec
consisting of a truth value sign (T or F) and a sentence
T φ or F φ.
724
54.2. RULES FOR K
{F φ, T ψ1 , . . . , T ψn }.
For modal logics, we have to both extend the notion of signed formula
and add rules that cover □ and ♢ In addition to a sign(T or F), formulas in
modal tableaux also have prefixes σ. The prefixes are non-empty sequences of
positive integers, i.e., σ ∈ (Z+ )∗ \ {Λ}. When we write such prefixes without
the surrounding ⟨ ⟩, and separate the individual elements by .’s instead of ,’s.
If σ is a prefix, then σ.n is σ ⌢ ⟨n⟩; e.g., if σ = 1.2.1, then σ.3 is 1.2.1.3. So
for instance,
1.2 T □φ → φ
is a prefixed signed formula (or just a prefixed formula for short).
Intuitively, the prefix names a world in a model that might satisfy the
formulas on a branch of a tableau, and if σ names some world, then σ.n names
a world accessible from (the world named by) σ.
content/normal-modal-logic/tableaux/rules-for-K.tex
σ T φ and σ F φ
σ T ¬φ σ F ¬φ
¬T ¬F
σFφ σ Tφ
σ Tφ ∧ ψ
∧T σFφ∧ψ
σ Tφ ∧F
σFφ | σFψ
σ Tψ
σFφ∨ψ
σ Tφ ∨ ψ ∨F
∨T σFφ
σ Tφ | σ Tψ
σFψ
σFφ→ψ
σ Tφ → ψ →F
→T σ Tφ
σ F φ | σ Tψ
σFψ
prefix we use, as long as it’s the same for all assumptions.) So, e.g., we say
that
ψ1 , . . . , ψn ⊢ φ
1 T ψ1 , . . . , 1 T ψn , 1 F φ.
For the modal operators □ and ♢, the prefix of the conclusion of the rule
applied to a formula with prefix σ is σ.n. However, which n is allowed depends
on whether the sign is T or F.
The □T rule extends a branch containing σ T □φ by σ.n T φ. Similarly,
the ♢F rule extends a branch containing σ F ♢φ by σ.n F φ. They can only
be applied for a prefix σ.n which already occurs on the branch in which it is
applied. Let’s call such a prefix “used” (on the branch).
The □F rule extends a branch containing σ F □φ by σ.n F φ. Similarly, the
♢T rule extends a branch containing σ T ♢φ by σ.n T φ. These rules, however,
can only be applied for a prefix σ.n which does not already occur on the branch
in which it is applied. We call such prefixes “new” (to the branch).
The rules are given in Table 54.2.
The requirement that the restriction that the prefix for □T must be used
is necessary as otherwise we would count the following as a closed tableau:
σ T □φ σ F □φ
□T □F
σ.n T φ σ.n F φ
σ T ♢φ σ F ♢φ
♢T ♢F
σ.n T φ σ.n F φ
1. 1 T □φ Assumption
2. 1 F ♢φ Assumption
3. 1.1 T φ □T 1
4. 1.1 F φ ♢F 2
⊗
1. 1 T ♢φ Assumption
2. 1 F □φ Assumption
3. 1.1 T φ ♢T 1
4. 1.1 F φ □F 2
⊗
content/normal-modal-logic/tableaux/proofs-in-K.tex
7. 1.1 F φ 1.1 F ψ ∧F 6
8. 1.1 T φ 1.1 T ψ □T 4; □T 5
⊗ ⊗
Example 54.2. We give a closed tableau that shows ⊢ ♢(φ ∨ ψ) → (♢φ ∨ ♢ψ):
7. 1.1 T φ 1.1 T ψ ∨T 6
8. 1.1 F φ 1.1 F ψ ♢F 4; ♢F 5
⊗ ⊗
1. □¬p → □(p → q)
3. ♢p → ♢(p ∨ q)
4. □(p ∧ q) → □p
content/normal-modal-logic/tableaux/soundness.tex
This soundness proof reuses the soundness proof for classical proposi-
tional logic, i.e., it proves everything from scratch. That’s ok if you want
a self-contained soundness proof. If you already have seen soundness for
ordinary tableau this will be repetitive. It’s planned to make it possi-
ble to switch between self-contained version and a version building on the
non-modal case.
In order to show that prefixed tableaux are sound, we have to show that if explanation
1 T ψ1 , . . . , 1 T ψn , 1 F φ
Definition 54.3. Let P be some set of prefixes, i.e., P ⊆ (Z+ )∗ \ {Λ} and
let M be a model. A function f : P → W is an interpretation of P in M if,
whenever σ and σ.n are both in P , then Rf (σ)f (σ.n).
Relative to an interpretation of prefixes P we can define:
Proof. We call a branch of a tableau satisfiable iff the set of signed formulas
on it is satisfiable, and let’s call a tableau satisfiable if it contains at least one
satisfiable branch.
We show the following: Extending a satisfiable tableau by one of the rules
of inference always results in a satisfiable tableau. This will prove the theo-
rem: any closed tableau results by applying rules of inference to the tableau
consisting only of assumptions from Γ . So if Γ were satisfiable, any tableau
for it would be satisfiable. A closed tableau, however, is clearly not satisfiable,
since all its branches are closed and closed branches are unsatisfiable.
Suppose we have a satisfiable tableau, i.e., a tableau with at least one
satisfiable branch. Applying a rule of inference either adds signed formulas
to a branch, or splits a branch in two. If the tableau has a satisfiable branch
which is not extended by the rule application in question, it remains a satisfiable
branch in the extended tableau, so the extended tableau is satisfiable. So we
only have to consider the case where a rule is applied to a satisfiable branch.
Let Γ be the set of signed formulas on that branch, and let σ S φ ∈ Γ be
the signed formula to which the rule is applied. If the rule does not result in a
split branch, we have to show that the extended branch, i.e., Γ together with
the conclusions of the rule, is still satisfiable. If the rule results in split branch,
we have to show that at least one of the two resulting branches is satisfiable.
First, we consider the possible inferences with only one premise.
content/normal-modal-logic/tableaux/more-rules.tex
σ T □φ σ F ♢φ
T□ T♢
σ Tφ σFφ
σ T □φ σ F ♢φ
D□ D♢
σ T ♢φ σ F □φ
σ.n T □φ σ.n F ♢φ
B□ B♢
σ Tφ σFφ
σ T □φ σ F ♢φ
4□ 4♢
σ.n T □φ σ.n F ♢φ
σ.n T □φ σ.n F ♢φ
4r□ 4r♢
σ T □φ σ F ♢φ
Logic R is . . . Rules
T = KT reflexive T□, T♢
D = KD serial D□, D♢
K4 transitive 4□, 4♢
B = KTB reflexive, T□, T♢
symmetric B□, B♢
S4 = KT4 reflexive, T□, T♢,
transitive 4□, 4♢
S5 = KT4B reflexive, T□, T♢,
transitive, 4□, 4♢,
euclidean 4r□, 4r♢
1. 1 F □φ → □♢φ Assumption
2. 1 T □φ →F 1
3. 1 F □♢φ →F 1
4. 1.1 F ♢φ □F 3
5. 1 F ♢φ 4r♢ 4
6. 1.1 F φ ♢F 5
7. 1.1 T φ □T 2
⊗
1. KT5 ⊢ B;
2. KT5 ⊢ 4;
3. KDB4 ⊢ T;
4. KB4 ⊢ 5;
5. KB5 ⊢ 4;
6. KT ⊢ D.
content/normal-modal-logic/tableaux/more-soundness.tex
nml:tab:msn: Proposition 54.14. 4r□ and 4r♢ are sound for euclidean models.
prop:soundness-4r
nml:tab:msn: Corollary 54.15. The tableau systems given in Table 54.4 are sound for the
cor:soundness-logics
respective classes of models.
content/normal-modal-logic/tableaux/simple-S5.tex
1. 1 F ♢φ → □♢φ Assumption
2. 1 T ♢φ →F 1
3. 1 F □♢φ →F 1
4. 2 F ♢φ □F 3
5. 3T φ ♢T 2
6. 3F φ ♢F 4
⊗
n T □φ n F □φ
□T □F
mTφ mFφ
m is used m is new
n T ♢φ n F ♢φ
♢T ♢F
mTφ mFφ
m is new m is used
content/normal-modal-logic/tableaux/completeness.tex
nml:tab:cpl: Proposition 54.18. Every finite Γ has a tableau in which every branch is
prop:complete-tableau
complete.
Proof. Consider an open branch in a tableau for Γ . There are finitely many
prefixed formulas in the branch to which a rule could be applied. In some fixed
order (say, top to bottom), for each of these prefixed formulas for which the
conditions (1)–(4) do not already hold, apply the rules that can be applied to it
to extend the branch. In some cases this will result in branching; apply the rule
at the tip of each resulting branch for all remaining prefixed formulas. Since the
number of prefixed formulas is finite, and the number of used prefixes on the
branch is finite, this procedure eventually results in (possibly many) branches
extending the original branch. Apply the procedure to each, and repeat. But
by construction, every branch is closed.
and
V (p) = {σ : σ T p ∈ ∆}.
We show by induction on φ that if σ T φ ∈ ∆ then M(∆), σ ⊩ φ, and if
σ F φ ∈ ∆ then M(∆), σ ⊮ φ.
Since Γ ⊆ ∆, M(∆) ⊩ Γ .
content/normal-modal-logic/tableaux/countermodels.tex
The tableau is of course not finished yet. In the next step, we consider the
only line without a checkmark: the prefixed formula 1 T □(p ∨ q) on line 2. The
construction of the closed tableau says to apply the □T rule for every prefix
used on the branch, i.e., for both 1.1 and 1.2:
¬p p
1.1 q 1.2 ¬q
¬p
1 ¬q
There is one remaining open branch, and it is complete. From it we define the
model with worlds W = {1, 1.1, 1.2} (the only prefixes appearing on the open
branch), the accessibility relation R = {⟨1, 1.1⟩, ⟨1, 1.2⟩}, and the assignment
V (p) = {1.2} (because line 11 contains 1.2 T p) and V (q) = {1.1} (because
line 10 contains 1.1 T q). The model is pictured in Figure 54.1, and you can
verify that it is a countermodel to □(p ∨ q) → (□p ∨ □q).
Intuitionistic Logic
This is a brief introduction to intuitionistic logic produced by Zesen
Qian and revised by RZ. It is not yet well integrated with the rest of the
text and needs examples and motivations.
Chapter 55
Introduction
content/intuitionistic-logic/introduction/constructive-reasoning.tex
741
CHAPTER 55. INTRODUCTION
Theorem 55.1. There are irrational numbers a and b such that ab is rational.
√ √2 √
Proof. Consider 2 . If this is rational, we are done: we can let a = b = 2.
Otherwise, it is irrational. Then we have
√ √2 √ √ √2·√2 √ 2
( 2 ) 2= 2 = 2 = 2,
√
√ 2 √
which is rational. So, in this case, let a be 2 , and let b be 2.
Does this constitute a valid proof? Most mathematicians feel that it does.
But again, there is something a little bit unsatisfying here: we have proved
the existence of a pair of real numbers with a certain property, without being
able to say which pair of numbers it is. It is possible to prove the same√result,
but in such a way that the pair a, b is given in the proof: take a = 3 and
b = log3 4. Then
√ log3 4
ab = 3 = 31/2·log3 4 = (3log3 4 )1/2 = 41/2 = 2,
since 3log3 x = x.
Intuitionistic logic is designed to capture a kind of reasoning where moves
like the one in the first proof are disallowed. Proving the existence of an x
satisfying φ(x) means that you have to give a specific x, and a proof that it
satisfies φ, like in the second proof. Proving that φ or ψ holds requires that
you can prove one or the other.
Formally speaking, intuitionistic logic is what you get if you restrict a deriva-
tion system for classical logic in a certain way. From the mathematical point
of view, these are just formal deductive systems, but, as already noted, they
are intended to capture a kind of mathematical reasoning. One can take this
to be the kind of reasoning that is justified on a certain philosophical view of
mathematics (such as Brouwer’s intuitionism); one can take it to be a kind
of mathematical reasoning which is more “concrete” and satisfying (along the
lines of Bishop’s constructivism); and one can argue about whether or not
the formal description captures the informal motivation. But whatever philo-
sophical positions we may hold, we can study intuitionistic logic as a formally
presented logic; and for whatever reasons, many mathematical logicians find it
interesting to do so.
content/intuitionistic-logic/introduction/syntax.tex
1. ⊥ is an atomic formula.
1. ¬φ abbreviates φ → ⊥.
2. φ ↔ ψ abbreviates (φ → ψ) ∧ (ψ → φ).
content/intuitionistic-logic/introduction/bhk-interpretation.tex
p1 (⟨N1 , N2 ⟩) = N1
p2 (⟨N1 , N2 ⟩) = N2
Here is what f does: First it applies p1 to its input M . That yields a construc-
tion of φ. Then it applies p2 to M , yielding a construction of φ → ⊥. Such a
construction, in turn, is a function p2 (M ) which, if given as input a construction
of φ, yields a construction of ⊥. In other words, if we apply p2 (M ) to p1 (M ),
we get a construction of ⊥. Thus, we can define f (M ) = p2 (M )(p1 (M )).
As you can see, using the BHK interpretation to show the intuitionistic
validity of formulas quickly becomes cumbersome and confusing. Luckily, there
are better derivation systems for intuitionistic logic, and more precise semantic
interpretations.
content/intuitionistic-logic/introduction/natural-deduction.tex
Conjunction
φ∧ψ
φ ∧Elim
φ ψ
∧Intro
φ∧ψ φ∧ψ
∧Elim
ψ
Conditional
[φ]u
φ→ψ φ
→Elim
ψ
ψ
u →Intro
φ→ψ
Disjunction
φ [φ]n [ψ]n
∨Intro
φ∨ψ
ψ
∨Intro φ∨ψ χ χ
φ∨ψ n ∨Elim
χ
Absurdity
⊥ ⊥
φ I
Rules for ¬
Since ¬φ is defined as φ → ⊥, we strictly speaking do not need rules for ¬. But
if we did, this is what they’d look like:
[φ]n
¬φ φ
¬Elim
⊥
⊥
n
¬φ ¬Intro
Examples of Derivations
1. ⊢ φ → (¬φ → ⊥), i.e., ⊢ φ → ((φ → ⊥) → ⊥)
[φ]2 [φ → ⊥]1
→Elim
⊥
1 →Intro
(φ → ⊥) → ⊥
2 →Intro
φ → (φ → ⊥) → ⊥
2. ⊢ ((φ ∧ ψ) → χ) → (φ → (ψ → χ))
[φ]2 [ψ]1
∧Intro
[(φ ∧ ψ) → χ]3 φ∧ψ
χ →Elim
1 →Intro
ψ→χ
2 →Intro
φ → (ψ → χ)
3 →Intro
((φ ∧ ψ) → χ) → (φ → (ψ → χ))
[φ ∧ (φ → ⊥)]1 [φ ∧ (φ → ⊥)]1
∧Elim ∧Elim
φ→⊥ φ
→Elim
⊥
1 →Intro
(φ ∧ (φ → ⊥)) → ⊥
[φ]1
2 ∨Intro
[(φ ∨ (φ → ⊥)) → ⊥] φ ∨ (φ → ⊥)
→Elim
⊥
1 →Intro
φ→⊥
2 ∨Intro
[(φ ∨ (φ → ⊥)) → ⊥] φ ∨ (φ → ⊥)
→Elim
⊥
2 →Intro
((φ ∨ (φ → ⊥)) → ⊥) → ⊥
Proof. Every natural deduction rule is also a rule in classical natural deduction,
so every derivation in intuitionistic logic is also a derivation in classical logic.
1. (¬φ ∨ ψ) → (φ → ψ)
2. ¬¬¬φ → ¬φ
content/intuitionistic-logic/introduction/axiomatic-derivations.tex
1. φi ∈ Γ ; or
2. φi is an axiom; or
3. φi follows from some φj and φk with j < i and k < i by modus ponens,
i.e., φk ≡ φj → φi .
(φ ∧ ψ) → φ (55.1) int:int:axd:
ax:land1
(φ ∧ ψ) → ψ (55.2) int:int:axd:
ax:land2
φ → (ψ → (φ ∧ ψ)) (55.3) int:int:axd:
ax:land3
φ → (φ ∨ ψ) (55.4) int:int:axd:
ax:lor1
φ → (ψ ∨ φ) (55.5) int:int:axd:
ax:lor2
(φ → χ) → ((ψ → χ) → ((φ ∨ ψ) → χ)) (55.6) int:int:axd:
ax:lor3
φ → (ψ → φ) (55.7) int:int:axd:
ax:lif1
(φ → (ψ → χ)) → ((φ → ψ) → (φ → χ)) (55.8) int:int:axd:
ax:lif2
⊥→φ (55.9) int:int:axd:
ax:lfalse1
Chapter 56
Semantics
750
56.1. INTRODUCTION
content/intuitionistic-logic/semantics/introduction.tex
56.1 Introduction
int:sem:int: No logic is satisfactorily described without a semantics, and intuitionistic logic
sec
is no exception. Whereas for classical logic, the semantics based on valuations is
canonical, there are several competing semantics for intuitionistic logic. None of
them are completely satisfactory in the sense that they give an intuitionistically
acceptable account of the meanings of the connectives.
The semantics based on relational models, similar to the semantics for
modal logics, is perhaps the most popular one. In this semantics, proposi-
tional variables are assigned to worlds, and these worlds are related by an
accessibility relation. That relation is always a partial order, i.e., it is reflexive,
antisymmetric, and transitive.
Intuitively, you might think of these worlds as states of knowledge or “evi-
dentiary situations.” A state w′ is accessible from w iff, for all we know, w′ is
a possible (future) state of knowledge, i.e., one that is compatible with what’s
known at w. Once a proposition is known, it can’t become un-known, i.e.,
whenever φ is known at w and Rww′ , φ is known at w′ as well. So “knowl-
edge” is monotonic with respect to the accessibility relation.
If we define “φ is known” as in epistemic logic as “true in all epistemic
alternatives,” then φ ∧ ψ is known at w if in all epistemic alternatives, both φ
and ψ are known. But since knowledge is monotonic and R is reflexive, that
means that φ ∧ ψ is known at w iff φ and ψ are known at w. For the same
reason, φ ∨ ψ is known at w iff at least one of them is known. So for ∧ and ∨,
the truth conditions of the connectives coincide with those in classical logic.
The truth conditions for the conditional, however, differ from classical logic.
φ → ψ is known at w iff at no w′ with Rww′ , φ is known without ψ also being
known. This is not the same as the condition that φ is unknown or ψ is known
at w. For if we know neither φ nor ψ at w, there might be a future epistemic
state w′ with Rww′ such that at w′ , φ is known without also coming to know ψ.
We know ¬φ only if there is no possible future epistemic state in which
we know φ. Here the idea is that if φ were knowable, then in some possible
future epistemic state φ becomes known. Since we can’t know ⊥, in that future
epistemic state, we would know φ but not know ⊥.
On this interpretation the principle of excluded middle fails. For there are
some φ which we don’t yet know, but which we might come to know. For such
a formula φ, both φ and ¬φ are unknown, so φ ∨ ¬φ is not known. But we do
know, e.g., that ¬(φ ∧ ¬φ). For no future state in which we know both φ and
¬φ is possible, and we know this independently of whether or not we know φ
or ¬φ.
Relational models are not the only available semantics for intuitionistic
logic. The topological semantics is another: here propositions are interpreted
content/intuitionistic-logic/semantics/relational-models.tex
Proof. Exercise.
content/intuitionistic-logic/semantics/semantic-notions.tex
Ww = {u ∈ W : Rwu},
Rw = R ∩ (Ww )2 , and
Vw (p) = V (p) ∩ Ww .
content/intuitionistic-logic/semantics/topological-semantics.tex
Open sets are closed under arbitrary unions: if Ui ∈ O for all i ∈ I, then
3. S
{Ui : i ∈ I} ∈ O.
We may write X for a topology if the collection of open sets can be inferred
from the context; note that, still, only after X is endowed with open sets can
it be called a topology.
1. [⊥]]X = ∅
2. [p]]X = V (p)
Here, Int(V ) is the function that maps a set V ⊆ X to its interior, that is, the
union of all open sets it contains. In other words,
[
Int(V ) = {U : U ⊆ V and U ∈ O}.
Note that the interior of any set is always open, since it is a union of open
sets. Thus, [φ]]X is always an open set.
Although topological semantics is highly abstract, there are ways to think
about it that might motivate it. Suppose that the elements, or “points,” of X
are points at which statements can be evaluated. The set of all points where φ
is true is the proposition expressed by φ. Not every set of points is a potential
proposition; only the elements of O are. φ ⊨ ψ iff ψ is true at every point at
which φ is true, i.e., [φ]]X ⊆ [ψ]]X , for all X. The absurd statement ⊥ is never
true, so [⊥]]X = ∅.
Chapter 57
content/intuitionistic-logic/soundness-completeness/soundness-axd.tex
The soundness proof relies on the fact that all axioms are intuitionisti-
cally valid; this still needs to be proved, e.g., in the Semantics chapter.
755
CHAPTER 57. SOUNDNESS AND COMPLETENESS
content/intuitionistic-logic/soundness-completeness/soundness-nd.tex
Problem 57.1. Complete the proof of Theorem 57.2. For the cases for ¬Intro
and ¬Elim, use the definition of M, w ⊩ ¬φ in Definition 56.2, i.e., don’t treat
¬φ as defined by φ → ⊥.
Problem 57.2. Show that the following formulas are not derivable in intu-
itionistic logic:
1. (φ → ψ) ∨ (ψ → φ)
2. (¬¬φ → φ) → (φ ∨ ¬φ)
3. (φ → ψ ∨ χ) → (φ → ψ) ∨ (φ → χ)
content/intuitionistic-logic/soundness-completeness/lindenbaum.tex
int:sc:lin: 1. Γn ⊢ ψi ∨ χi
gamma-1
int:sc:lin: 2. ψi ∈
/ Γn and χi ∈
/ Γn
gamma-2
We add to Γn either ψi if Γn ∪ {ψi } ⊬ φ, or χi otherwise. We’ll have to show
that this works. For now, let’s define i(n) as the least i such that (1) and (2)
hold.
Define Γ0 = Γ and
(
Γn ∪ {ψi(n) } if Γn ∪ {ψi(n) } ⊬ φ
Γn+1 =
Γn ∪ {χi(n) } otherwise
content/intuitionistic-logic/soundness-completeness/canonical-model.tex
Here by (∆(σ) ∪ {ψn })∗ we mean the prime set of formulas which exists by
Lemma 57.4 applied to the set ∆(σ) ∪ {ψn } and the formula χn . Note that by
this definition, if ∆(σ) ∪ {ψn } ⊬ χn , then ∆(σ.n) ⊢ ψn and ∆(σ.n) ⊬ χn . Note
also that ∆(σ) ⊆ ∆(σ.n) for any n. If ∆ is prime, then ∆(σ) is prime for all σ.
Definition 57.5. Suppose ∆ is prime. Then the canonical model M(∆) for int:sc:mod:
defn:canonical-model
∆ is defined by:
1. W = N∗ , the set of finite sequences of natural numbers.
2. R is the partial order according to which Rσσ ′ iff σ is an initial segment
of σ ′ (i.e., σ ′ = σ ⌢ σ ′′ for some sequence σ ′′ ).
3. V (p) = {σ : p ∈ ∆(σ)}.
content/intuitionistic-logic/soundness-completeness/truth-lemma.tex
Proof. By induction on φ.
3. φ ≡ ¬ψ: exercise.
content/intuitionistic-logic/soundness-completeness/completeness-thm.tex
Problem 57.6. Show that if M is a relational model using a linear order then
M ⊩ (φ → ψ) ∨ (ψ → φ).
content/intuitionistic-logic/soundness-completeness/decidability.tex
57.7 Decidability
Observe that the proof of the completeness theorem gives us for every Γ ⊬ φ a int:sc:dec:
sec
model with an infinite number of worlds witnessing the fact that Γ ⊭ φ. The
following proposition shows that to prove ⊨ φ it is enough to prove that M ⊩ φ
for all finite models (i.e., models with a finite set of worlds).
M, w ⊩ φ iff M′ , [w] ⊩ φ
for all formulas φ with only propositional variables from P . This is left as an
exercise for the reader.
762
From Theorem 57.8 it follows that there is an algorithm to decide whether ⊨
φ.
Chapter 58
Propositions as Types
content/intuitionistic-logic/propositions-as-types/introduction.tex
58.1 Introduction
int:pty:int:
sec
Historically the lambda calculus and intuitionistic logic were developed sepa-
rately. Haskell Curry and William Howard independently discovered a close
similarity: types in a typed lambda calculus correspond to formulas in intu-
itionistic logic in such a way that a derivation of a formula corresponds directly
to a typed lambda term with that formula as its type. Moreover, beta reduc-
tion in the typed lambda calculus corresponds to certain transformations of
derivations.
For instance, a derivation of φ→ψ corresponds to a term λxφ . N ψ , which has
the function type φ → ψ. The inference rules of natural deduction correspond
to typing rules in the typed lambda calculus, e.g.,
[φ]x
ψ x:φ ⇒ N :ψ
x →Intro λ
φ→ψ corresponds to ⇒ λxφ . N ψ : φ → ψ
where the rule on the right means that if x is of type φ and N is of type ψ,
then λxφ . N is of type φ → ψ.
The →Elim rule corresponds to the typing rule for composition terms, i.e.,
φ→ψ φ
→Elim
ψ corresponds to
⇒ P :φ→ψ ⇒ Q:φ
app
⇒ P φ→ψ Qφ : ψ
If a →Intro rule is followed immediately by a →Elim rule, the derivation
can be simplified:
[φ]x
φ
→
−
ψ
x →Intro
φ→ψ φ
→Elim
ψ ψ
(λxφ . P ψ )Q →
− P [Q/x].
Similar correspondences hold between the rules for ∧ and “product” types,
and between the rules for ∨ and “sum” types.
This correspondence between terms in the simply typed lambda calculus
and natural deduction derivations is called the “Curry–Howard”, or “proposi-
tions as types” correspondence. In addition to formulas (propositions) corre-
sponding to types, and proofs to terms, we can summarize the correspondences
as follows:
logic program
proposition type
proof term
assumption variable
discharged assumption bind variable
not discharged assumption free variable
implication function type
conjunction product type
disjunction sum type
absurdity bottom type
content/intuitionistic-logic/propositions-as-types/sequent-natural-deduction.tex
The label ∧Elim hints at the relation with the rule of the same name in natural
deduction.
Likewise, suppose we have Γ, φ ⇒ ψ, meaning we have a derivation with
undischarged assumptions Γ, φ and end-formula ψ. If we apply the →Intro
rule, we have a derivation with Γ as undischarged assumptions and φ → ψ as
the end-formula, i.e., Γ ⇒ φ → ψ. Note how this has made the discharge of
assumptions more explicit.
Γ, φ ⇒ ψ
→Intro
Γ ⇒ φ→ψ
We can draw conclusions from other rules in the same fashion, which is
spelled out as follows:
Γ ⇒ φ ∆ ⇒ ψ
∧Intro
Γ, ∆ ⇒ φ ∧ ψ
Γ ⇒ φ∧ψ Γ ⇒ φ∧ψ
∧Elim1 ∧Elim2
Γ ⇒ φ Γ ⇒ ψ
Γ ⇒ φ Γ ⇒ ψ
∨Intro1 ∨Intro2
Γ ⇒ φ∨ψ Γ ⇒ φ∨ψ
Γ ⇒ φ∨ψ ∆, φ ⇒ χ ∆′ , ψ ⇒ χ
∨Elim
Γ, ∆, ∆′ ⇒ χ
Γ, φ ⇒ ψ ∆ ⇒ φ→ψ Γ ⇒ φ
→Intro →Elim
Γ ⇒ φ→ψ Γ, ∆ ⇒ ψ
Γ ⇒ ⊥ ⊥
I
Γ ⇒ φ
φ ⇒ φ
Together, these rules can be taken as a calculus about what natural de-
duction derivations exist. They can also be taken as a notational variant of
natural deduction, in which each step records not only the formula derived but
also the undischarged assumptions from which it was derived.
φ ⇒ φ
φ ⇒ φ ∨ (φ → ⊥) ψ ⇒ ψ
φ, ψ→ ⇒ ⊥
(ψ ⇒ φ → ⊥
(ψ ⇒ φ ∨ (φ → ⊥) (ψ ⇒ ψ
(ψ ⇒ ⊥
⇒ ψ→⊥
content/intuitionistic-logic/propositions-as-types/proof-terms.tex
Since in general terms only make sense with specific contexts, we will speak
simply of “terms” from now on instead of “typing pair”; and it will be apparent
when we are talking about the literal term M .
content/intuitionistic-logic/propositions-as-types/proofs-to-terms.tex
deduction rules taking into account context and proof terms are given below.
Given the proof terms for the premise(s), we obtain the corresponding proof
term for conclusion.
M1 : φ 1 M2 : φ2
∧Intro
⟨M1 , M2 ⟩ : φ1 ∧ φ2
M : φ1 ∧ φ2 M : φ1 ∧ φ2
∧Elim1 ∧Elim2
pi (M ) : φ1 pi (M ) : φ2
In ∧Intro we assume we have φ1 witnessed by term M1 and φ2 witnessed
by term M2 . We pack up the two terms into a pair ⟨M1 , M2 ⟩ which witnesses
φ1 ∧ φ2 .
In ∧Elimi we assume that M witnesses φ1 ∧ φ2 . The term witnessing φi
is pi (M ). Note that M is not necessary of the form ⟨M1 , M2 ⟩, so we cannot
simply assign M1 to the conclusion φi .
Note how this coincides with the BHK interpretation. What the BHK
interpretation does not specify is how the function used as proof for φ → ψ is
supposed to be obtained. If we think of proof terms as proofs or functions of
proofs, we can be more explicit.
[x : φ]
P :φ→ψ Q:φ
→Elim
PQ : ψ
N :ψ
→Intro
λxφ . N : φ → ψ
The λ notation should be understood as the same as in the lambda calculus,
and P Q means applying P to Q.
M1 : φ1 M2 : φ2
φ1 ∨Intro1 φ2 ∨Intro2
in1 (M1 ) : φ1 ∨ φ2 in2 (M2 ) : φ1 ∨ φ2
[x1 : φ1 ] [x2 : φ2 ]
M : A1 ∨ φ2 N1 : χ N2 : χ
∨Elim
case(M, x1 .N1 , x2 .N2 ) : χ
The proof term inφ1 (M1 ) is a term witnessing φ1 ∨ φ2 , where M1 witnesses φ1 .
1
The term case(M, x1 .N1 , x2 .N2 ) mimics the case clause in programming
languages: we already have the derivation of φ∨ψ, a derivation of χ assuming φ,
and a derivation of χ assuming ψ. The case operator thus select the appropriate
proof depending on M ; either way it’s a proof of χ.
N :⊥ ⊥I
contrφ (N ) : φ
[x : φ]1
[y : (φ ∨ (φ → ⊥)) → ⊥]2 inφ→⊥
1 (x) : φ ∨ (φ → ⊥)
y(inφ→⊥
1 (x)) : ⊥
1
λxφ . y(inφ→⊥
1 (x)) : φ → ⊥
[y : (φ ∨ (φ → ⊥)) → ⊥]2 inφ φ φ→⊥
2 (λx . y(in1 (x))) : φ ∨ (φ → ⊥)
y(inφ φ φ→⊥
2 (λx . yin1 (x))) : ⊥
2
λy (φ∨(φ→⊥))→⊥ . y(inφ φ φ→⊥
2 (λx . yin1 (x))) : ((φ ∨ (φ → ⊥)) → ⊥) → ⊥
The tree has no assumptions, so the context is empty; we get:
⊢ λy (φ∨(φ→⊥))→⊥ . y(inφ φ φ→⊥
2 (λx . yin1 (x))) : ((φ ∨ (φ → ⊥)) → ⊥) → ⊥
If we leave out the last →Intro, the assumptions denoted by y would be in the
context and we would get:
y : ((φ ∨ (φ → ⊥)) → ⊥) ⊢ y(inφ φ φ→⊥
2 (λx . yin1 (x))) : ⊥
Another example: ⊢ φ → (φ → ⊥) → ⊥
[x : φ]2 [y : φ → ⊥]1
yx : ⊥
1
φ→⊥
λy . yx : (φ → ⊥) → ⊥
2
λxφ . λy φ→⊥ . yx : φ → (φ → ⊥) → ⊥
Again all assumptions are discharged and thus the context is empty, the re-
sulting term is
⊢ λxφ . λy φ→⊥ . yx : φ → (φ → ⊥) → ⊥
If we leave out the last two →Intro inferences, the assumptions denoted by
both x and y would be in context and we would get
x : φ, y : φ → ⊥ ⊢ yx : ⊥
content/intuitionistic-logic/propositions-as-types/terms-to-proofs.tex
For each natural deduction rule, the term in the conclusion is always formed
by wrapping some operator around the terms assigned to the premise(s). Rules
correspond uniquely to such operators. For example, from the structure of the
S we infer that the last rule applied must be →Intro, since it is of the form
λy ... . . . ., and the λ operator corresponds to →Intro. In general we can recover
the skeleton of the derivation solely by the structure of the term, e.g.,
[x]1
∨Intro1
[y :]2 inφ→⊥
1 (x) :
→Elim
y(inφ→⊥
1 (x)) :
1 →Intro
λxφ . y(inφ→⊥
1 (x)) :
∨Intro2
[y :]2 inφ φ φ→⊥
2 (λx . yin1 (x)) :
→Elim
y(inφ φ φ→⊥
2 (λx . yin1 (x))) :
2 →Intro
λy (φ∨(φ→⊥))→⊥ . y(inφ φ φ→⊥
2 (λx . y(in1 (x)))) :
Our next step is to recover the formulas these terms witness. We define a
function F (Γ, M ) which denotes the formula witnessed by M in context Γ , by
induction on M as follows:
F (Γ, x) = Γ (x)
F (Γ, ⟨N1 , N2 ⟩ = F (Γ, N1 ) ∧ F (Γ, N2 )
F (Γ, pi (N ) = φi if F (Γ, N ) = φ1 ∧ φ2
(
φ F (N ) ∨ φ if i = 1
F (Γ, ini (N ) =
φ ∨ F (N ) if i = 2
F (Γ, case(M, x1 .N1 , x2 .N2 )) = F (Γ ∪ {xi : F (Γ, M )}, Ni )
F (Γ, λxφ . N ) = φ → F (Γ ∪ {x : φ}, N )
F (Γ, N M ) = ψ if F (Γ, N ) = φ → ψ
3. In the third line, its only defined when F (Γ, M ) is of the form φ1 ∨ φ2 ,
and the right hand is independent on i.
φ→ψ φ
→Elim
ψ
Γ ⊢ M1 : φ1 ∆ ⊢ M2 : φ2 Γ ⊢ M : φ1 ∧ φ2
∧Intro ∧Elimi
Γ, ∆ ⊢ ⟨M1 , M2 ⟩ : φ1 ∧ φ2 Γ ⊢ pi (M ) : φi
Γ ⊢ M1 : φ1 Γ ⊢ M2 : φ 2
∨Intro1 ∨Intro2
Γ ⊢ inφ1
2
(M ) : φ 1 ∨ φ 2 Γ ⊢ inφ1
2 (M ) : φ1 ∨ φ2
Γ ⊢M :φ∨ψ ∆1 , x1 : φ1 ⊢ N1 : χ ∆2 , x2 : φ2 ⊢ N2 : χ
′ ∨Elim
Γ, ∆, ∆ ⊢ case(M, x1 .N1 , x2 .N2 ) : χ
Γ, x : φ ⊢ N : ψ Γ ⊢Q:φ ∆⊢P :φ→ψ
φ →Intro →Elim
Γ ⊢ λx . N : φ → ψ Γ, ∆ ⊢ P Q : ψ
Γ ⊢M :⊥
⊥Elim
Γ ⊢ contrφ (M ) : φ
These are the typing rules of the simply typed lambda calculus extended
with product, sum and bottom.
In addition, the F (Γ, M ) is actually a type checking algorithm; it returns
the type of the term with respect to the context, or is undefined if the term is
ill-typed with respect to the context.
content/intuitionistic-logic/propositions-as-types/reduction.tex
58.6 Reduction
In natural deduction derivations, an introduction rule that is followed by an int:pty:red:
sec
elimination rule is redundant. For instance, the derivation
φ φ→ψ
→Elim
ψ [χ]
∧Intro
ψ∧χ
∧Elim
ψ
→Intro
χ→ψ
φ φ→ψ
→Elim
ψ
→Intro
χ→ψ
D1 D2
φ1 φ2 Di
φ1 ∧ φ2 ∧Intro
φi ∧Elimi →
− φi
In the typed lambda calculus, this is the beta reduction rule for the product
type.
Note the type annotation on M1 and M2 : while in the standard term syntax
only λxφ . N has such notion, we reuse the notation here to remind us of the
formula the term is associated with in the corresponding natural deduction
derivation, to reveal the correspondence between the two kinds of syntax.
In natural deduction, a pair of inferences such as those on the left, i.e., a
pair that is subject to cancelling is called a cut. In the typed lambda calculus
the term on the left of →
− is called a redex, and the term to the right is called the
reductum. Unlike untyped lambda calculus, where only (λx. N )Q is considered
to be redex, in the typed lambda calculus the syntax is extended to terms
involving ⟨N, M ⟩, pi (N ), inφ
i (N ), case(N, x1 .M1 , x2 .M2 ), and contrN (), with
corresponding redexes.
Similarly we have reduction for disjunction:
D
[φ1 ]u [φ2 ]u
D φi
D1 D2
φi Di
φ1 ∨ φ2 ∨Intro χ χ
u
χ ∨Elim →
− χ
This corresponds to a reduction on proof terms:
(Γ, case(inφi φi φ1 χ φ2 χ
− (Γ, Niχ [M φi /xφ
i (M ), x1 .N1 , x2 .N2 )) →
i
i ])
This is the beta reduction rule of for sum types. Here, M [N/x] means replacing
all assumptions denoted by variable x in M with N ,
It would be nice if we pass the context Γ to the substitution function so
that it can check if the substitution makes sense. For example, xy[ab/y] does
not make sense under the context {x : φ → θ, y : φ, a : ψ → χ, b : ψ} since then
we would be substituting a derivation of χ where a derivation of φ is expected.
However, as long as our usage of substitution is careful enough to avoid such
errors, we won’t have to worry about such conflicts. Thus we can define it
recursively as we did for untyped lambda calculus as if we are dealing with
untyped terms.
Finally, the reduction of the function type corresponds to removal of a
detour of a →Intro followed by a →Elim.
[φ]u
D′
D φ
ψ D′
u →Intro D
φ→ψ φ
→Elim
ψ →
− ψ
For proof terms, this amounts to ordinary beta reduction:
(Γ, (λxφ . N ψ )Qφ ) →
− (Γ, N ψ [Qφ /xφ ])
Absurdity has only an elimination rule and no introduction rule, thus there
is no such reduction for it.
Note that the above notion of reduction concerns only deductions with a cut
at the end of a derivation. We would of course like to extend it to reduction
of cuts anywhere in a derivation, or reductions of subterms of proof terms
which constitute redexes. Note that, however, the conclusion of the reduction
does not change after reduction, thus we are free to continue applying rules to
both sides of →− . The resulting pairs of trees constitutes an extended notion of
reduction; it is analogous to compatibility in the untyped lambda calculus.
It’s easy to see that the context Γ does not change during the reduction
(both the original and the extended version), thus it’s unnecessary to mention
the context when we are discussing reductions. In what follows we will assume
that every term is accompanied by a context which does no change during
reduction. We then say “proof term” when we mean a proof term accompanied
by a context which makes it well-typed.
As in lambda calculus, the notion of normal-form term and normal deduc-
tion is given:
content/intuitionistic-logic/propositions-as-types/normalization.tex
58.7 Normalization
In this section we prove that, via some reduction order, any deduction can int:pty:nor:
sec
be reduced to a normal deduction, which is called the normalization property.
We will make use of the propositions-as-types correspondence: we show that
every proof term can be reduced to a normal form; normalization for natural
deduction derivations then follows.
Firstly we define some functions that measure the complexity of terms. The
length len(φ) of a formulas is defined by
len(p) = 0
len(φ ∧ ψ) = len(φ) + len(ψ) + 1
len(φ ∨ ψ) = len(φ) + len(ψ) + 1
len(φ → ψ) = len(φ) + len(ψ) + 1.
The complexity of a proof term is measured by the most complex redex in it,
and 0 if it is normal:
int:pty:nor: Lemma 58.6. If M [N φ /xφ ] is a redex and M ̸≡ x, then one of the following
lem:subst
cases holds:
1. M is itself a redex, or
3. M is of the form case(i, x1 .P1 , x2 .P2 ), and N is of the form ini (Q)
In the first case, cr(M [N/x]) = cr(M ); in the other cases, cr(M [N/x]) =
len(φ)).
which is pi (⟨P1 , P2 ⟩). Its cut rank is equal to cr(x), which is len(φ).
Lemma 58.7. If M contracts to M ′ , and cr(M ) > cr(N ) for all proper redex
sub-terms N of M , then cr(M ) > mr(M ′ ).
case(ini (N φi ), xφ1 χ φ2 χ
1 .N1 , x2 .N2 ),
then M ′ ≡ Ni [N/xφ i ′
i ]. Consider a redex in M . Either there is corre-
sponding redex in Ni with equal cut rank, which is less than cr(M ) by
assumption; or the cut rank equals len(φi ), which by definition is less
than cr(case(ini (N φi ), xφ1 χ φ2 χ
1 .N1 , x2 .N2 )).
Theorem 58.8. All proof terms reduce to normal form; all derivations reduce
to normal derivations.
Proof. The second follows from the first. We prove the first by complete in-
duction on m = mr(M ), where M is a proof term.
1. If m = 0, M is already normal.
2. Otherwise, we proceed by induction on n, the number of redexes in M
with cut rank equal to m.
a) If n = 1, select any redex N such that m = cr(N ) > cr(P ) for any
proper sub-term P which is also a redex of course. Such a redex
must exist, since any term only has finitely many subterms.
Let N ′ denote the reductum of N . Now by the lemma mr(N ′ ) <
mr(N ), thus we can see that n, the number of redexes with cr(=)m
is decreased. So m is decreased (by 1 or more), and we can apply
the inductive hypothesis for m.
b) For the induction step, assume n > 1. the process is similar, except
that n is only decreased to a positive number and thus m does not
change. We simply apply the induction hypothesis for n.
Counterfactuals
Chapter 59
Introduction
content/counterfactuals/introduction/material-conditional.tex
If Γ, φ ⊨ ψ then Γ ⊨ φ → ψ (59.1)
φ → ψ ⊨ ¬φ ∨ ψ (59.2)
¬φ ∨ ψ ⊨ φ → ψ (59.3)
777
CHAPTER 59. INTRODUCTION
ψ ⊨φ→ψ (59.4)
¬φ ⊨ φ → ψ (59.5)
¬(φ → ψ) ⊨ φ ∧ ¬ψ (59.6)
φ ∧ ¬ψ ⊨ ¬(φ → ψ) (59.7)
φ, φ → ψ ⊨ ψ (59.8)
φ → ψ, φ → χ ⊨ φ → (ψ ∧ χ) (59.9)
φ → ψ ⊨ (φ ∧ χ) → ψ (59.10)
φ → ψ, ψ → χ ⊨ φ → χ (59.11)
φ → ψ ⊨ ¬ψ → ¬φ (59.12)
¬ψ → ¬φ ⊨ φ → ψ (59.13)
content/counterfactuals/introduction/paradoxes-material.tex
content/counterfactuals/introduction/strict-conditional.tex
scientists, although philosophers try to avoid the confusions Lewis highlighted by pronouncing
it as “only if.”
φ J ψ ⊨ ¬φ ∨ ψ but: (59.14)
¬φ ∨ ψ ⊭ φ J ψ (59.15)
ψ⊭φJψ (59.16)
¬φ ⊭ φ J ψ (59.17)
¬(φ → ψ) ⊭ φ ∧ ¬ψ but: (59.18)
φ ∧ ¬ψ ⊨ ¬(φ J ψ) (59.19)
φ, φ J ψ ⊨ ψ (59.20)
φ J ψ, φ J χ ⊨ φ J (ψ ∧ χ) (59.21)
φ J ψ ⊨ (φ ∧ χ) J ψ (59.22)
φ J ψ, ψ J χ ⊨ φ J χ (59.23)
φ J ψ ⊨ ¬ψ J ¬φ (59.24)
¬ψ J ¬φ ⊨ φ J ψ (59.25)
Problem 59.2. Show that the valid entailment relations hold for the strict
conditional by giving S5-proofs of:
1. □(φ → ψ) ⊨ ¬φ ∨ ψ
2. φ ∧ ¬ψ ⊨ ¬□(φ → ψ)
3. φ, □(φ → ψ) ⊨ ψ
5. □(φ → ψ) ⊨ □((φ ∧ χ) → ψ)
However, the strict conditional still has its own “paradoxes.” Just as a
material conditional with a false antecedent or a true consequent is true, a strict
conditional with a necessarily false antecedent or a necessarily true consequent
is true. Moreover, any true strict conditional is necessarily true, and any false
strict conditional is necessarily false. In other words, we have
□¬φ ⊨ φ J ψ (59.26)
□ψ ⊨ φ J ψ (59.27)
φ J ψ ⊨ □(φ J ψ) (59.28)
¬(φ J ψ) ⊨ □¬(φ J ψ) (59.29)
1. □¬φ ⊨ φ J ψ
2. φ J ψ ⊨ □(φ J ψ)
3. ¬(φ J ψ) ⊨ □¬(φ J ψ)
content/counterfactuals/introduction/counterfactuals.tex
59.4 Counterfactuals
A very common and important form of “if . . . then . . . ” constructions in En- cnt:int:cnt:
sec
glish are built using the past subjunctive form of to be: “if it were the case that
. . . then it would be the case that . . . ” Because usually the antecedent of such
a conditional is false, i.e., counter to fact, they are called counterfactual con-
ditionals (and because they use the subjunctive form of to be, also subjunctive
conditionals. They are distinguished from indicative conditionals which take
the form of “if it is the case that . . . then it is the case that . . . ” Counterfac-
tual and indicative conditionals differ in truth conditions. Consider Adams’s
famous example:
The first is indicative, the second counterfactual. The first is clearly true: we
know President John F. Kennedy was killed by someone, and if that someone
wasn’t (contrary to the Warren Report) Lee Harvey Oswald, then someone
else killed Kennedy. The second one says something different. It claims that
if Oswald hadn’t killed Kennedy, i.e., if the Dallas shooting had been avoided
or had been unsuccessful, history would have subsequently unfolded in such
a way that another assassination would have been successful. In order for it
to be true, it would have to be the case that powerful forces had conspired to
ensure JFK’s death (as many JFK conspiracy theorists believe).
It is a live debate whether the indicative conditional is correctly captured
by the material conditional, in particular, whether the paradoxes of the mate-
rial conditional can be “explained” in a way that is compatible with it giving
the truth conditions for English indicative conditionals. By contrast, it is un-
controversial that counterfactual conditionals cannot be symbolized correctly
by the material conditionals. That is clear because, even though generally the
antecedents of counterfactuals are false, not all counterfactuals with false an-
tecedents are true—for instance, if you believe the Warren Report, and there
was no conspiracy to assassinate JFK, then Adams’s counterfactual conditional
is an example.
Counterfactual conditionals play an important role in causal reasoning: a
prime example of the use of counterfactuals is to express causal relationships.
E.g., striking a match causes it to light, and you can express this by saying
“if this match were struck, it would light.” Material, and generally indicative
conditionals, cannot be used to express this: “the match is struck → the match
lights” is true if the match is never struck, regardless of what would happen if
it were. Even worse, “the match is struck → the match turns into a bouquet
of flowers” is also true if it is never struck, but the match would certainly not
turn into a bouquet of flowers if it were struck.
It is still debated What exactly the correct logic of counterfactuals is. An
influential analysis of counterfactuals was given by Stalnaker and Lewis. Ac-
cording to them, a counterfactual “if it were the case that S then it would be
Chapter 60
content/counterfactuals/minimal-change-semantics/introduction.tex
60.1 Introduction
cnt:min:int: Stalnaker and Lewis proposed accounts of counterfactual conditionals such as
sec
“If the match were struck, it would light.” Their accounts were proposals for
how to properly understand the truth conditions for such sentences. The idea
behind both proposals is this: to evaluate whether a counterfactual conditional
is true, we have to consider those possible worlds which are minimally differ-
ent from the way the world actually is to make the antecedent true. If the
consequent is true in these possible worlds, then the counterfactual is true.
For instance, suppose I hold a match and a matchbook in my hand. In the
actual world I only look at them and ponder what would happen if I were to
strike the match. The minimal change from the actual world where I strike the
match is that where I decide to act and strike the match. It is minimal in that
nothing else changes: I don’t also jump in the air, striking the match doesn’t
also light my hair on fire, I don’t suddenly lose all strength in my fingers, I am
not simultaneously doused with water in a SuperSoaker ambush, etc. In that
alternative possibility, the match lights. Hence, it’s true that if I were to strike
the match, it would light.
This intuitive account can be paired with formal semantics for logics of
counterfactuals. Lewis introduced the symbol “” for the counterfactual
783
CHAPTER 60. MINIMAL CHANGE SEMANTICS
while Stalnaker used the symbol “>”. We’ll use , and add it as a binary
connective to propositional logic. So, we have, in addition to formulas of the
form φ → ψ also formulas of the form φ ψ. The formal semantics, like the
relational semantics for modal logic, is based on models in which formulas are
evaluated at worlds, and the satisfaction condition defining M, w ⊩ φ ψ is
given in terms of M, w′ ⊩ φ and M, w′ ⊩ ψ for some (other) worlds w′ . Which
w′ ? Intuitively, the one(s) closest to w for which it holds that M, w′ ⊩ φ. This
requires that a relation of “closeness” has to be included in the model as well.
Lewis introduced an instructive way of representing counterfactual situa-
tions graphically. Each possible world is at the center of a set of nested spheres
containing other worlds—we draw these spheres as concentric circles. The
worlds between two spheres are equally close to the world at the center as each
other, those contained in a nested sphere are closer, and those in a surrounding
sphere further away.
w φ
The closest φ-worlds are those worlds w′ where φ is satisfied which lie in the
smallest sphere around the center world w (the gray area). Intuitively, φ ψ
is satisfied at w if ψ is true at all closest φ-worlds.
content/counterfactuals/minimal-change-semantics/sphere-models.tex
1. Ow is centered on w: {w} ∈ Ow .
w1 w7
w5
w p
w6
w2
w3
w4
The intuition behind Ow is that the worlds “around” w are stratified ac-
cording to how far away they are from w. The innermost sphere is just w by
itself, i.e., the set {w}: w is closer to w than the worlds in any other sphere. If
S ⊊ S ′ , then the worlds in S ′ \ S are further way from w than the worlds in S:
S ′ \ S is the “layer” between the S and the worlds outside of S ′ . In particular,
we have to think of the spheres as containing all the worlds within their outer
surface; they are not just the individual layers.
The diagram in Figure 60.1 corresponds to the sphere model with W =
{w, w1 , . . . , w7 }, V (p) = {w5 , w6 , w7 }. The innermost sphere S1 = {w}. The
closest worlds to w are w1 , w2 , w3 , so the next larger sphere is S2 = {w, w1 , w2 , w3 }.
The worlds further out are w4 , w5 , w6 , so the outermost sphere is S3 =
{w, w1 , . . . , w6 }. The system of spheres around w is Ow = {S1 , S2 , S3 }. The
world w7 is not in any sphere around w. The closest worlds in which p is true
are w5 and w6 , and so the smallest p-admitting sphere is S3 .
To define satisfaction of a formula φ at world w in a sphere model M,
M, w ⊩ φ, we expand the definition for modal formulas to include a clause for
ψ χ:
w φ
content/counterfactuals/minimal-change-semantics/true-false.tex
w φ
w φ
w φ
u v
content/counterfactuals/minimal-change-semantics/antecedent-strengthening.tex
Example 60.3. The sphere semantics invalidates the inference, i.e., we have
p r ⊭ (p ∧ q) r. Consider the model M = ⟨W, O, V ⟩ where W =
{w, w1 , w2 }, Ow = {{w}, {w, w1 }, {w, w1 , w2 }}, V (p) = {w1 , w2 }, V (q) =
{w2 }, and V (r) = {w1 }. There is a p-admitting sphere S = {w, w1 } and p → r
is true at all worlds in it, so M, w ⊩ p r. There is also a (p ∧ q)-admitting
sphere S ′ = {w, w1 , w2 } but M, w2 ⊮ (p ∧ q) → r, so M, w ⊮ (p ∧ q) r (see
Figure 60.7).
content/counterfactuals/minimal-change-semantics/transitivity.tex
w1
w
w2
q
60.5 Transitivity
cnt:min:tra: For the material conditional, the chain rule holds: φ → ψ, ψ → χ ⊨ φ → χ.
sec
In other words, the material conditional is transitive. Is the same true for
counterfactuals? Consider the following example due to Stalnaker.
If J. Edgar Hoover had been born a Russian, he would have been a
Communist.
If J. Edgar Hoover were a Communist, he would have been be a
traitor.
Therefore, If J. Edgar Hoover had been born a Russian, he would
have been be a traitor.
If Hoover had been born (at the same time he actually did), not in the United
States, but in Russia, he would have grown up in the Soviet Union and become
a Communist (let’s assume). So the first premise is true. Likewise, the second
premise, considered in isolation is true. The conclusion, however, is false: in all
likelihood, Hoover would have been a fervent Communist if he had been born in
the USSR, and not been a traitor (to his country). The intuitive assignment of
truth values is borne out by the Stalnaker–Lewis account. The closest possible
world to ours with the only change being Hoover’s place of birth is the one
where Hoover grows up to be a good citizen of the USSR. This is the closest
possible world where the antecedent of the first premise and of the conclusion is
true, and in that world Hoover is a loyal member of the Communist party, and
so not a traitor. To evaluate the second premise, we have to look at a different
world, however: the closest world where Hoover is a Communist, which is one
where he was born in the United States, turned, and thus became a traitor.1
1 Of course, to appreciate the force of the example we have to take on board some meta-
physical and political assumptions, e.g., that it is possible that Hoover could have been born
Problem 60.1. Find a convincing, intuitive example for the failure of transi-
tivity of counterfactuals.
Example 60.4. The sphere semantics invalidates the inference, i.e., we have cnt:min:tra:
ex:trans-counterex
p q, q r ⊭ p r. Consider the model M = ⟨W, O, V ⟩ where W =
{w, w1 , w2 }, Ow = {{w}, {w, w1 }, {w, w1 , w2 }}, V (p) = {w2 }, V (q) = {w1 , w2 },
and V (r) = {w1 }. There is a p-admitting sphere S = {w, w1 , w2 } and p → q is
true at all worlds in it, so M, w ⊩ p q. There is also a q-admitting sphere
S ′ = {w, w1 } and M ⊮ q → r is true at all worlds in it, so M, w ⊩ q r. How-
ever, the p-admitting sphere {w, w1 , w2 } contains a world, namely w2 , where
M, w2 ⊮ p → r.
content/counterfactuals/minimal-change-semantics/contraposition.tex
60.6 Contraposition
Material and strict conditionals are equivalent to their contrapositives. Coun- cnt:min:cpo:
sec
terfactuals are not. Here is an example due to Kratzer:
The first sentence is true: humans don’t live hundreds of years. The second
is clearly false: if Goethe weren’t dead now, he would be still alive, and so
couldn’t have died in 1832.
Example 60.5. The sphere semantics invalidates contraposition, i.e., we have cnt:min:cpo:
ex:contraposition-counterex
p q ⊭ ¬q ¬p. Think of p as “Goethe didn’t die in 1832” and q as
“Goethe is dead now.” We can capture this in a model M1 = ⟨W, O, V ⟩
with W = {w, w1 , w2 }, O = {{w}, {w, w1 }, {w, w1 , w2 }}, V (p) = {w1 , w2 } and
V (q) = {w, w1 }. So w is the actual world where Goethe died in 1832 and is still
dead; w1 is the (close) world where Goethe died in, say, 1833, and is still dead;
and w2 is a (remote) world where Goethe is still alive. There is a p-admitting
sphere S = {w, w1 } and p → q is true at all worlds in it, so M, w ⊩ p q.
to Russian parents, or that Communists in the US of the 1950s were traitors to their country.
¬q
q
w w1
w2
p
¬p
Set Theory
Chapter 61
content/set-theory/story/extensionality.tex
61.1 Extensionality
The very first thing to say is that sets are individuated by their elements. More sth:story:extensionality:
sec
precisely:
Axiom (Extensionality). If sets A and B have the same elements, then A
and B are the same set.
∀A ∀B (∀x (x ∈ A ↔ x ∈ B) → A = B)
We assumed this throughout part I. But it bears repeating. The Axiom of
Extensionality expresses the basic idea that a set is determined by its elements.
(So sets might be contrasted with concepts, where precisely the same objects
might fall under many different concepts.)
Why embrace this principle? Well, it is plausible to say that any denial of
Extensionality is a decision to abandon anything which might even be called set
theory. Set theory is no more nor less than the theory of extensional collections.
The real challenge in part XIV, though, is to lay down principles which tell
us which sets exist. And it turns out that the only truly “obvious” answer to
this question is provably wrong.
content/set-theory/story/russells-paradox-again.tex
792
61.2. RUSSELL’S PARADOX (AGAIN)
In part I, we worked with a naı̈ve set theory. But according to a very naı̈ve
conception, sets are just the extensions of predicates. This naı̈ve thought would
mandate the following principle:
Proof. If R = {x : x ∈
/ x} exists, then R ∈ R iff R ∈
/ R, which is a contradic-
tion.
Russell discovered this result in June 1901. (He did not, though, put the
paradox in quite the form we just presented it, since he was considering Frege’s
set theory, as outlined in Grundgesetze. We will return to this in section 61.6.)
Russell wrote to Frege on June 16, 1902, explaining the inconsistency in Frege’s
system. For the correspondence, and a bit of background, see Heijenoort (1967,
pp. 124–8).
It is worth emphasising that this two-line proof is a result of pure logic.
Granted, we implicitly used a (non-logical?) axiom, Extensionality, in our no-
tation {x : x ∈/ x}; for {x : φ(x)} is to be the unique (by Extensionality) set
of the φs, if one exists. But we can avoid even the hint of Extensionality, just
by stating the result as follows: there is no set whose members are exactly the
non-self-membered sets. And this has nothing much to do with sets. As Russell
himself observed, exactly similar reasoning will lead you to conclude: no man
shaves exactly the men who do not shave themselves. Or: no pug sniffs exactly
the pugs which don’t sniff themselves. And so on. Schematically, the shape of
the result is just:
¬∃x∀z(Rzx ↔ ¬Rzz).
And that’s just a theorem (scheme) of first-order logic. Consequently, we can’t
avoid Russell’s Paradox just by tinkering with our set theory; it arises before
we even get to set theory. If we’re going to use (classical) first-order logic, we
simply have to accept that there is no set R = {x : x ∈/ x}.
The upshot is this. If you want to accept Naı̈ve Comprehension whilst
avoiding inconsistency, you cannot just tinker with the set theory. Instead,
you would have to overhaul your logic.
Of course, set theories with non-classical logics have been presented. But
they are—to say the least—non-standard. The standard approach to Russell’s
Paradox is to treat it as a straightforward non-existence proof, and then to try
to learn how to live with it. That is the approach we will follow.
content/set-theory/story/predicativity.tex
and it is not clear, in the end, that impredicative definitions are even all that
bad.
To bring out the last point, consider this remark from Ramsey:
content/set-theory/story/cumulative-approach.tex
Sets are formed in stages. For each stage S, there are certain stages
which are before S. At stage S, each collection consisting of sets
formed at stages before S is formed into a set. There are no sets
other than the sets which are formed at stages. (Shoenfield, 1977,
p. 323)
1 For more, see Linnebo (2010).
6
5
4
3
2
1
0
RS = {x : x ∈
/ x and x was available before S}
The reasoning involved in proving Russell’s Paradox will now establish that RS
itself is not available before stage S. And that’s not a contradiction. Moreover,
if we embrace the cumulative-iterative conception of set, then we shouldn’t even
have expected to be able to form the Russell set itself. For that would be the
set of all non-self-membered sets that “will ever be available”. In short: the
fact that we (provably) can’t form the Russell set isn’t surprising, given the
cumulative-iterative story; it’s what we would predict.
2 Why should we assume that there is a first stage? See the footnote to Stages-are-ordered
in section 62.1.
content/set-theory/story/urelements.tex
6
5
4
3
2
1
0
just talking about sets, so our variable should not range over objects
like cows and pigs. (Kunen, 1980, p. 8)
content/set-theory/story/grundgesetze.tex
roughly: a ∈ b iff a falls under a concept whose extension is b. (Note that the
quantifier “∃G” is second-order.) Frege also maintained the following principle,
known as Basic Law V :
roughly: concepts have identical extensions iff they are coextensive. (Again,
both “F ” and “G” are in predicate position.) Now a simple principle connects
membership with property-satisfaction:
of a function. Extensions of concepts are a special case of the more general notion. See Heck
(2012, pp. 8–9) for the details.
Proof. Fix F ; now Lemma 61.2 yields ∀a(a ∈ ϵx F (x) ↔ F a); so ∃s∀a(a ∈
s↔F a) by existential generalisation. The result follows since F was arbitrary.
Chapter 62
Steps towards Z
content/set-theory/z/story.tex
Stages-accumulate. For any stage S, and for any sets which were formed
before stage S: a set is formed at stage S whose members are exactly
those sets. Nothing else is formed at stage S.
1 We will actually assume—tacitly—that the stages are well-ordered. What this amounts
to is explained in chapter 63. This is a substantial assumption. In fact, using a very clever
technique due to Scott (1974), this assumption can be avoided and then derived. (This will
also explain why we should think that there is an initial stage.) We cannot go into that here;
for more, see Button (2021).
799
CHAPTER 62. STEPS TOWARDS Z
These are informal principles, but we will be able to use them to vindicate
several of the axioms of Zermelo’s set theory.
(We should offer a word of caution. Although we will be presenting some
completely standard axioms, with completely standard names, the italicized
principles we have just presented have no particular names in the literature.
We simply monikers which we hope are helpful.)
content/set-theory/z/separation.tex
62.2 Separation
We start with a principle to replace Naı̈ve Comprehension: sth:z:sep:
sec
Note that this is not a single axiom. It is a scheme of axioms. There are
infinitely many Separation axioms; one for every formula φ(x). The scheme
can equally well be (and normally is) written down as follows:
For any formula φ(x) which does not contain “S”, this is an axiom:
In keeping with the convention noted at the start of part XIV, the formu-
las φ in the Separation axioms may have parameters.2
Separation is immediately justified by our cumulative-iterative conception
of sets we have been telling. To see why, let A be a set. So A is formed
by some stage S (by Stages-are-key). Since A was formed at stage S, all
of A’s members were formed before stage S (by Stages-accumulate). Now in
particular, consider all the sets which are members of A and which also satisfy
φ; clearly all of these sets, too, were formed before stage S. So they are formed
into a set {x ∈ A : φ(x)} at stage S too (by Stages-accumulate).
Unlike Naı̈ve Comprehension, this avoid Russell’s Paradox. For we cannot
simply assert the existence of the set {x : x ∈
/ x}. Rather, given some set A, we
can assert the existence of the set RA = {x ∈ A : x ∈ / x}. But all this proves
is that RA ∈/ RA and RA ∈ / A, none of which is very worrying.
However, Separation has an immediate and striking consequence:
Theorem 62.1. There is no universal set, i.e., {x : x = x} does not exist. sth:z:sep:
thm:NoUniversalSet
lary 6.7.
Proof. A \ B = {x ∈ A : x ∈
/ B} exists by Separation.
content/set-theory/z/union.tex
62.3 Union
sth:z:union: Proposition 62.4 gave us intersections. But if we want arbitrary unions to exist,
sec
we need to lay down another axiom:
S
Axiom (Union). For any set A, the set A = {x : (∃b ∈ A)x ∈ b} exists.
content/set-theory/z/pairs.tex
62.4 Pairs
The next axiom to consider is the following: sth:z:pairs:
sec
Here is how to justify this axiom, using the iterative conception. Suppose
a is available at stage S, and b is available at stage T . Let M be whichever of
stages S and T comes later. Then since a and b are both available at stage M ,
the set {a, b} is a possible collection available at any stage after M (whichever
is the greater).
But hold on! Why assume that there are any stages after M ? If there are
none, then our justification will fail. So, to justify Pairs, we will have to add
another principle to the story we told in section 62.1, namely:
Proposition 62.5. For any sets a and b, the following sets exist: sth:z:pairs:
prop:pairsconsequences
1. {a} sth:z:pairs:
singleton
2. a ∪ b sth:z:pairs:
binunion
3. ⟨a, b⟩ sth:z:pairs:
tuples
Problem 62.1. Show that, for any sets a, b, c, the set {a, b, c} exists.
Problem 62.2. Show that, for any sets a1 , . . . , an , the set {a1 , . . . , an } exists.
content/set-theory/z/powerset.tex
62.5 Powersets
sth:z:power: We will proceed with another axiom:
sec
Proposition 62.6. Given any sets A, B, their Cartesian product A×B exists.
Proof. The set ℘(℘(A ∪ B)) exists by Powersets and Proposition 62.5. So by
Separation, this set exists:
Now, for any x ∈ A and y ∈ B, the set ⟨x, y⟩ exists by Proposition 62.5.
Moreover, since x, y ∈ A ∪ B, we have that {x}, {x, y} ∈ ℘(A ∪ B), and ⟨x, y⟩ ∈
℘(℘(A ∪ B)). So A × B = C.
Problem 62.3. Show that, for any sets A, B: (i) the set of all relations with
domain A and range B exists; and (ii) the set of all functions from A to B
exists.
content/set-theory/z/infinity-again.tex
62.6 Infinity
sth:z:infinity-again: We already have enough axioms to ensure that there are infinitely many sets
sec
(if there are any). For suppose some set exists, and so ∅ exists (by Proposi-
tion 62.2). Now for any set x, the set x ∪ {x} exists by Proposition 62.5. So,
applying this a few times, we will get sets as follows:
0. ∅
1. {∅}
2. {∅, {∅}}
∃I((∃o ∈ I)∀x x ∈
/ o∧
(∀x ∈ I)(∃s ∈ I)∀z(z ∈ s ↔ (z ∈ x ∨ z = x)))
Definition 62.7. Let I be any set given to us by the Axiom of Infinity. Let sth:z:infinity-again:
s be the function s(x) = x ∪ {x}. Let ω = clos (∅). We call the members of ω defnomega
the natural numbers, and say that n is the result of n-many applications of s
to ∅.
You can now look back and check that the set labelled “n”, a few paragraphs
earlier, will be treated as the number n.
We will discuss this significance of this stipulation in section 62.8. For now,
it enables us to prove an intuitive result:
The question remains, though, of how we might justify the Axiom of Infinity.
The short answer is that we will need to add another principle to the story we
have been telling. That principle is as follows:
Stages-hit-infinity. There is an infinite stage. That is, there is a stage
which (a) is not the first stage, and which (b) has some stages before it,
but which (c) has no immediate predecessor.
The Axiom of Infinity follows straightforwardly from this principle. We know
that natural number n is formed at stage n. So the set ω is formed at the first
infinite stage. And ω itself witnesses the Axiom of Infinity.
This, however, simply pushes us back to the question of how we might
justify Stages-hit-infinity. As with Stages-keep-going, it was not an explicit
part of the story we told about the cumulative-iterative hierarchy. But more
than that: nothing in the very idea of an iterative hierarchy, in which sets are
formed stage by stage, forces us to think that the process involves an infinite
stage. It seems perfectly coherent to think that the stages are ordered like the
natural numbers.
This, however, gives rise to an obvious problem. In section 6.4, we con-
sidered Dedekind’s “proof” that there is a Dedekind infinite set (of thoughts).
This may not have struck you as very satisfying. But if Stages-hit-infinity is
not “forced upon us” by the iterative conception of set (or by “the laws of
thought”), then we are still left without an intrinsic justification for the claim
that there is a Dedekind infinite set.
There is much more to say here, of course. But hopefully you are now at
a point to start thinking about what it might take to justify an axiom (or
principle). In what follows we will simply take Stages-hit-infinity for granted.
content/set-theory/z/milestone.tex
62.7 Z− : a Milestone
sth:z:milestone:
sec
We will revisit Stages-hit-infinity in the next section. However, with the Axiom
of Infinity, we have reached an important milestone. We now have all the
axioms required for the theory Z− . In detail:
The name stands for Zermelo set theory (minus something which we will
come to later). Zermelo deserves the honour, since he essentially formulated
this theory in his 1908a.3
This theory is powerful enough to allow us to do an enormous amount of
mathematics. In particular, you should look back through part I, and con-
vince yourself that everything we did, naı̈vely, could be done more formally
within Z− . (Once you have done that for a bit, you might want to skip ahead
and read section 62.9.) So, henceforth, and without any further comment, we
will take ourselves to be working in Z− (at least).
content/set-theory/z/nat.tex
content/set-theory/z/arbintersections.tex
But this should ring alarm bells: since Naı̈ve Comprehension fails, there is
no guarantee that {X : φ(X)} exists. It looks dangerously, then, like such
definitions are cheating.
Fortunately, they are not cheating; or rather, if they are cheating as they
stand, then we can engage in some honest toil to render them kosher. That T
honest toil was foreshadowed in Proposition 62.4, when we explained why A
exists for any A ̸= ∅. But we will spell it out explicitly.
T
Given Extensionality, if we attempt to define C as {X : φ(X)}, all we are
really asking is for an object C which obeys the following:
Now, suppose there is some set, S, such that φ(S). Then to deliver eq. (*), we
can simply define C using Separation, as follows:
C = {x ∈ S : ∀X(φ(X) → x ∈ X)}.
Chapter 63
Ordinals
content/set-theory/ordinals/introduction.tex
63.1 Introduction
In chapter 62, we postulated that there is an infinite-th stage of the hierarchy, sth:ordinals:intro:
sec
in the form of Stages-hit-infinity (see also our axiom of Infinity). However,
given Stages-keep-going, we can’t stop at the infinite-th stage; we have to keep
going. So: at the next stage after the first infinite stage, we form all possible
collections of sets that were available at the first infinite stage; and repeat; and
repeat; and repeat; . . .
Implicitly what has happened here is that we have started to invoke an
“intuitive” notion of number, according to which there can be numbers after all
the natural numbers. In particular, the notion involved is that of a transfinite
ordinal. The aim of this chapter is to make this idea more rigorous. We will
explore the general notion of an ordinal, and then explicitly define certain sets
to be our ordinals.
content/set-theory/ordinals/idea.tex
808
63.3. WELL-ORDERINGS
We call this, in the jargon, an ω-sequence. And indeed, this general ordering
is mirrored in our initial construction of the stages of the set hierarchy. But,
now suppose we move 0 to the end of this sequence, so that it comes after all
the other numbers:
1 < 2 < 3 < 4 < 5 < ... < 0
We have the same entities here, but ordered in a fundamentally different way:
our first ordering had no last element; our new ordering does. Indeed, our
new ordering consists of an ω-sequence of entities (1, 2, 3, 4, 5, . . .), followed by
another entity. It will be an ω + 1-sequence.
We can generate even more types of ordering, using just these entities. For
example, consider all the even numbers (in their natural order) followed by all
the odd numbers (in their natural order):
content/set-theory/ordinals/wo.tex
63.3 Well-Orderings
sth:ordinals:wo: The fundamental notion is as follows:
sec
Definition 63.1. The relation < well-orders A iff it meets these two condi-
tions:
It is easy to see that three examples we just considered were indeed well-
ordering relations.
Problem 63.1. Section 63.2 presented three example orderings on the natural
numbers. Check that each is a well-ordering.
sth:ordinals:wo: Proposition 63.2. If < well-orders A, then every non-empty subset of A has
wo:strictorder
a unique <-least member, and < is irreflexive, asymmetric and transitive.
Proposition 63.3. If < well-orders A, then for any formula φ(x): sth:ordinals:wo:
propwoinduction
Proof. We will prove the contrapositive. Suppose ¬(∀a ∈ A)φ(a), i.e., that
X = {x ∈ A : ¬φ(x)} ̸= ∅. Then X has an <-minimal element, a. So
(∀b < a)φ(b) but ¬φ(a).
This last property should remind you of the principle of strong induction on
the naturals, i.e.: if (∀n ∈ ω)((∀m < n)φ(m) → φ(n)), then (∀n ∈ ω)φ(n). And
this property makes well-ordering into a very robust notion.1
content/set-theory/ordinals/iso.tex
63.4 Order-Isomorphisms
To explain how robust well-ordering is, we will start by introducing a method sth:ordinals:iso:
sec
for comparing well-orderings.
Definition 63.4. A well-ordering is a pair ⟨A, <⟩, such that < well-orders A.
The well-orderings ⟨A, <⟩ and ⟨B, ⋖⟩ are order-isomorphic iff there is a bi-
jection f : A → B such that: x < y iff f (x) ⋖ f (y). In this case, we write
⟨A, <⟩ ∼
= ⟨B, ⋖⟩, and say that f is an order-isomorphism.
Corollary 63.6. X ∼
= Y is an equivalence relation. sth:ordinals:iso:
ordisoisequiv
Proposition 63.7. If ⟨A, <⟩ and ⟨B, ⋖⟩ are isomorphic well-orderings, then sth:ordinals:iso:
ordisounique
the isomorphism between them is unique.
1A reminder: all formulas can have parameters (unless explicitly stated otherwise).
This gives some sense that well-orderings are robust. But to continue explaining
this, it will help to introduce some more notation.
Using this notation, we can state and prove that no well-ordering is isomorphic
to any of its proper initial segments.
sth:ordinals:iso: Lemma 63.9. If ⟨A, <⟩ is a well-ordering with a ∈ A, then ⟨A, <⟩ ≇ ⟨Aa , <a ⟩
wellordnotinitial
Our next result shows, roughly put, that an “initial segment” of an isomor-
phism is an isomorphism:
Our next two results establish that well-orderings are always comparable:
Lemma 63.11. Let ⟨A, <⟩ and ⟨B, ⋖⟩ be well-orderings. If ⟨Aa1 , <a1 ⟩ ∼= sth:ordinals:iso:
⟨Bb1 , ⋖b1 ⟩ and ⟨Aa2 , <a2 ⟩ ∼
= ⟨Bb2 , ⋖b2 ⟩, then a1 < a2 iff b1 ⋖ b2 lemordsegments
Proof. We will prove left to right; the other direction is similar. Suppose both
⟨Aa1 , <a1 ⟩ ∼
= ⟨Bb1 , ⋖b1 ⟩ and ⟨Aa2 , <a2 ⟩ ∼ = ⟨Bb2 , ⋖b2 ⟩, with f : Aa2 → Bb2 our
isomorphism. Let a1 < a2 ; then ⟨Aa1 , <a1 ⟩ ∼ = ⟨Bf (a1 ) , ⋖f (a1 ) ⟩ by Lemma 63.10.
So ⟨Bb1 , ⋖b1 ⟩ ∼
= ⟨Bf (a1 ) , ⋖f (a1 ) ⟩, and so b1 = f (a1 ) by Lemma 63.9. Now b1 ⋖b2
as f ’s domain is Bb2 .
Theorem 63.12. Given any two well-orderings, one is isomorphic to an ini- sth:ordinals:iso:
thm:woalwayscomparable
tial segment (not necessarily proper) of the other.
Proof. Let ⟨A, <⟩ and ⟨B, ⋖⟩ be well-orderings. Using Separation, let
By Lemma 63.11, a1 < a2 iff b1 ⋖b2 for all ⟨a1 , b1 ⟩, ⟨a2 , b2 ⟩ ∈ f . So f : dom(f ) →
ran(f ) is an isomorphism.
If a2 ∈ dom(f ) and a1 < a2 , then a1 ∈ dom(f ) by Lemma 63.10; so dom(f )
is an initial segment of A. Similarly, ran(f ) is an initial segment of B. For
reductio, suppose both are proper initial segments. Then let a be the <-least
element of A \ dom(f ), so that dom(f ) = Aa , and let b be the ⋖-least element
of B \ ran(f ), so that ran(f ) = Bb . So f : Aa → Bb is an isomorphism, and
hence ⟨a, b⟩ ∈ f , a contradiction.
content/set-theory/ordinals/vn.tex
In what follows, we will use Greek letters for ordinals. It follows immediately
from the definition that, if α is an ordinal, then ⟨α, ∈α ⟩ is a well-ordering,
where ∈α = {⟨x, y⟩ ∈ α2 : x ∈ y}. So, abusing notation a little, we can just say
that α itself is a well-ordering.
Here are our first few ordinals:
∅, {∅}, {∅, {∅}}, {∅, {∅}, {∅, {∅}}}, . . .
You will note that these are the first few ordinals that we encountered in
our Axiom of Infinity, i.e., in von Neumann’s definition of ω (see section 62.6).
This is no coincidence. Von Neumann’s definition of the ordinals treats natural
numbers as ordinals, but allows for transfinite ordinals too.
As always, we can now ask: are these the ordinals? Or has von Neumann
simply given us some sets that we can treat as the ordinals? The kinds of
discussions one might have about this question are similar to the discussions
we had in section 2.2, section 5.5, section 6.4, and section 62.8, so we will not
belabour the point. Instead, in what follows, we will simply use “the ordinals”
to speak of “the von Neumann ordinals”.
content/set-theory/ordinals/basic.tex
The rough gist of the next two main results, Theorem 63.16 and Theo-
rem 63.17, is that the ordinals themselves are well-ordered by membership:
sth:ordinals:basic: Theorem 63.16 (Transfinite Induction). For any formula φ(x):
ordinductionschema
if ∃αφ(α), then ∃α(φ(α) ∧ (∀β ∈ α)¬φ(β))
where the displayed quantifiers are implicitly restricted to ordinals.
Proof. Suppose φ(α), for some ordinal α. If (∀β ∈ α)¬φ(β), then we are done.
Otherwise, as α is an ordinal, it has some ∈-least element which is φ, and this
is an ordinal by Lemma 63.14.
just by taking ¬φ(α) in Theorem 63.16, and then performing elementary logical
manipulations.
Theorem 63.17 (Trichotomy). α ∈ β ∨ α = β ∨ β ∈ α, for any ordinals α sth:ordinals:basic:
ordtrichotomy
and β.
Proof. The proof is by double induction, i.e., using Theorem 63.16 twice. Say
that x is comparable with y iff x ∈ y ∨ x = y ∨ y ∈ x.
For induction, suppose that every ordinal in α is comparable with every
ordinal. For further induction, suppose that α is comparable with every ordinal
in β. We will show that α is comparable with β. By induction on β, it will
follow that α is comparable with every ordinal; and so by induction on α, every
ordinal is comparable with every ordinal, as required. It suffices to assume that
α∈ / β and β ∈/ α, and show that α = β.
To show that α ⊆ β, fix γ ∈ α; this is an ordinal by Lemma 63.14. So by
the first induction hypothesis, γ is comparable with β. But if either γ = β or
β ∈ γ then β ∈ α (invoking the fact that α is transitive if necessary), contrary
to our assumption; so γ ∈ β. Generalising, α ⊆ β.
Exactly similar reasoning, using the second induction hypothesis, shows
that β ⊆ α. So α = β.
Problem 63.3. Complete the “exactly similar reasoning” in the proof of The-
orem 63.17.
sth:ordinals:basic: Theorem 63.20 (Burali-Forti Paradox). There is no set of all the ordi-
buraliforti
nals
This result is named after Burali-Forti. But, it was Cantor in 1899—in a letter
to Dedekind—who first saw clearly the contradiction in supposing that there
is a set of all the ordinals. As van Heijenoort explains:
Proof. Any infinite strictly descending sequence of ordinals α0 > α1 > α2 > . . .
has no <-minimal member, contradicting Theorem 63.16.
content/set-theory/ordinals/replacement.tex
63.7 Replacement
In section 63.5, we motivated the introduction of ordinals by suggesting that sth:ordinals:replacement:
sec
we could treat them as order-types, i.e., canonical proxies for well-orderings.
In order for that to work, we would need to prove that every well-ordering is
isomorphic to some ordinal. This would allow us to define ord(A, <) as the
ordinal α such that ⟨A, <⟩ ∼
= α.
Unfortunately, we cannot prove the desired result only the Axioms we pro-
vided introduced so far. (We will see why in section 65.2, but for now the point
is: we can’t.) We need a new thought, and here it is:
Axiom (Scheme of Replacement). For any formula φ(x, y), the following
is an axiom:
for any A, if (∀x ∈ A)∃!y φ(x, y), then {y : (∃x ∈ A)φ(x, y)} exists.
As with Separation, this is a scheme: it yields infinitely many axioms, for each
of the infinitely many different φ’s. And it can equally well be (and normally
is) written down thus:
For any formula φ(x, y) which does not contain “B”, the following is an
axiom:
Corollary 63.24. For any term τ (x), and any set A, this set exists:
This suggests that “Replacement” is a good name for the Axiom: given a set
A, you can form a new set, {τ (x) : x ∈ A}, by replacing every member of A
with its image under τ . Indeed, following the notation for the image of a set
under a function, we might write τ [A] for {τ (x) : x ∈ A}.
Crucially, however, τ is a term. It need not be (a name for) a function, in
the sense of section 3.3, i.e., a certain set of ordered pairs. After all, if f is a
function (in that sense), then the set f [A] = {f (x) : x ∈ A} is just a particular
subset of ran(f ), and that is already guaranteed to exist, just using the axioms
content/set-theory/ordinals/milestone.tex
Definition 63.25. The theory ZF− has these axioms: Extensionality, Union,
Pairs, Powersets, Infinity, and all instances of the Separation and Replacement
schemes. Otherwise put, ZF− adds Replacement to Z− .
This stands for Zermelo–Fraenkel set theory (minus something which we will
come to later). Fraenkel gets the honour, since he is credited with the formu-
lation of Replacement in 1922, although the first precise formulation was due
to Skolem (1922).
content/set-theory/ordinals/ordtype.tex
f = {⟨β, b⟩ : b ∈ B and β ∼
= ⟨Bb , ⋖b ⟩}
This result licenses the following definition, which we have wanted to offer
since section 63.5:
Definition 63.27. If ⟨A, <⟩ is a well-ordering, then its order type, ord(A, <),
is the unique ordinal α such that ⟨A, <⟩ ∼
= α.
Corollary 63.28. Where ⟨A, <⟩ and ⟨B, ⋖⟩ are well-orderings: sth:ordinals:ordtype:
ordtypesworklikeyouwant
Proof. The identity holds by Proposition 63.23. To prove the second claim, let
ord(A, <) = α and ord(B, ⋖) = β, and let f : β → ⟨B, ⋖⟩ be our isomorphism.
Then:
content/set-theory/ordinals/opps.tex
The following result shows that this is the right notion of successor :
1. α ∈ α+ ;
2. α+ is an ordinal;
1. φ(∅); and
Then ∀αφ(α).
Proof. We prove the contrapositive. So, suppose there is some ordinal which
is ¬φ; let γ be the least such ordinal. Then either γ = ∅, or γ = α+ for some
α such that φ(α); or γ is a limit ordinal and (∀β ∈ γ)φ(β).
α+ .
S
sth:ordinals:opps: Definition 63.32. If X is a set of ordinals, then lsub(X) = α∈X
defsupstrict
Here, “lsub” stands for “least strict upper bound”.4 The following result ex-
plains this:
819
CHAPTER 64. STAGES AND RANKS
Chapter 64
content/set-theory/spine/idea.tex
V∅ = ∅
Vα+ = ℘(Vα ) for any ordinal α
[
Vα = Vγ when α is a limit ordinal
γ<α
content/set-theory/spine/recursion.tex
1 Cf. the definitions of addition, multiplication, and exponentiation in section 6.2.
sth:spine:recursion: Lemma 64.3 (Bounded Recursion). For any term τ (x) and any ordinal
transrecursionfun
α, there is a unique α-approximation for τ .
sth:spine:recursion: Theorem 64.4 (General Recursion). For any term τ (x), we can explicitly
transrecursionschema
define a term σ(x), such that σ(α) = τ (σ↾α ) for any ordinal α.
2 A reminder: all formulas and terms can have parameters (unless explicitly stated oth-
erwise).
noting that fβ + (β) = fα+ (β) for all β < α, as in Lemma 64.3.
Theorem 64.5 (Simple Recursion). For any terms τ (x) and θ(x) and any sth:spine:recursion:
simplerecursionschema
set A, we can explicitly define a term σ(x) such that:
σ(∅) = A
σ(α+ ) = τ (σ(α)) for any ordinal α
σ(α) = θ(ran(σ↾α )) when α is a limit ordinal
By Theorem 64.4, there is a term σ(x) such that σ(α) = ξ(σ↾α ) for every
ordinal α; moreover, σ↾α is a function with domain α. We show that σ has the
required properties, by simple transfinite induction (Theorem 63.31).
First, σ(∅) = ξ(∅) = A.
Next, σ(α+ ) = ξ(σ↾α+ ) = τ (σ↾α+ (α)) = τ (σ(α)).
Last, σ(α) = ξ(σ↾α ) = θ(ran(σ↾α )), when α is a limit.
Now, toS vindicate Definition 64.1, just take A = ∅ and τ (x) = ℘(x) and
θ(x) = x. At long last, this vindicates the definition of the Vα s!
content/set-theory/spine/stagesbasics.tex
All of this allows us to think of each Vα as the αth stage of the hierarchy. Here
is why.
Certainly our Vα s can be thought of as being formed in an iterative process,
for our use of ordinals tracks the notion of iteration. Moreover, if one stage
3 There’s no standard terminology for “potent”; this is the name used by Button (2021).
content/set-theory/spine/foundation.tex
64.4 Foundation
We are only almost done—and not quite finished—because nothing in ZF− sth:spine:foundation:
sec
guarantees that every set is in some Vα , i.e., that every set is formed at some
stage.
Now, there is a fairly straightforward (mathematical) sense in which we
don’t care whether there are sets outside the hierarchy. (If there are any
there, we can simply ignore them.) But we have motivated our concept of set
with the thought that every set is formed at some stage (see Stages-are-key
in section 62.1). So we will want to preclude the possibility of sets which fall
outside of the hierarchy. Accordingly, we must add a new axiom, which ensures
that every set occurs somewhere in the hierarchy.
Since the Vα s are our stages, we might simply consider adding the following
as an axiom:
Regularity. ∀A∃α A ⊆ Vα
With some effort, we can show (in ZF− ) that Foundation entails Regularity:
cl0 (A) = A,
[
cln+1 (A) = cln (A),
[
trcl(A) = cln (A).
n<ω
sth:spine:foundation: Lemma 64.12. If A is a transitive set, then there is some α such that A ⊆ Vα .
lem:TransitiveWellFounded
Proof. Recalling the definition of “lsub(X)” from Definition 63.32, define two
sets:
D = {x ∈ A : ∀δ x ⊈ Vδ }
α = lsub{δ : (∃x ∈ A)(x ⊆ Vδ ∧ (∀γ ∈ δ)x ⊈ Vγ )}
Suppose D = ∅. So if x ∈ A, then there is some δ such that x ⊆ Vδ and, by
the well-ordering of the ordinals, (∀γ ∈ δ)x ⊈ Vγ ; hence δ ∈ α and so x ∈ Vα
by Lemma 64.7. Hence A ⊆ Vα , as required.
So it suffices to show that D = ∅. For reductio, suppose otherwise. By
Foundation, there is some B ∈ D ⊆ A such that D ∩ B = ∅. If x ∈ B then
x ∈ A, since A is transitive, and since x ∈/ D, it follows that ∃δ x ⊆ Vδ . So
now let
β = lsub{δ : (∃x ∈ b)(x ⊆ Vδ ∧ (∀γ < δ)x ⊈ Vγ )}.
As before, B ⊆ Vβ , contradicting the claim that B ∈ D.
These results show that ZF− proves the conditional Foundation ⇒ Regularity.
In Proposition 64.22, we will show that ZF− proves Regularity ⇒ Foundation.
As such, Foundation and Regularity are equivalent (modulo ZF− ). But this
means that, given ZF− , we can justify Foundation by noting that it is equiva-
lent to Regularity. And we can justify Regularity immediately on the basis of
Stages-are-key.
content/set-theory/spine/zf.tex
content/set-theory/spine/rank.tex
64.6 Rank
Now that we have defined the stages as the Vα ’s, and we know that every set sth:spine:rank:
sec
is a subset of some stage, we can define the rank of a set. Intuitively, the rank
of A is the first moment at which A is formed. More precisely:
Definition 64.15. For each set A, rank(A) is the least ordinal α such that sth:spine:rank:
A ⊆ Vα . defnsetrank
Using this fact, we can establish a result which allows us to prove things about
all sets by a form of induction:
Here is an informal way to gloss this powerful result. Say that φ is hereditary
iff whenever every element of a set is φ, the set itself is φ. Then ∈-Induction
tells you the following: if φ is hereditary, every set is φ.
To wrap up the discussion of ranks (for now), we’ll prove a few claims which
we have foreshadowed a few times.
Proof. Suppose for transfinite induction that rank(β) = β for all β ∈ α. Now
rank(α) = lsubβ∈α rank(β) = lsubβ∈α β = α by Proposition 64.20.
Finally, here is a quick proof of the result promised at the end of section 64.4,
that ZF− proves the conditional Regularity ⇒ Foundation. (Note that the
notion of “rank” and Proposition 64.18 are available for use in this proof since—
as mentioned at the start of this section—they can be presented using ZF− +
Regularity.)
827
CHAPTER 65. REPLACEMENT
Chapter 65
Replacement
content/set-theory/replacement/introduction.tex
65.1 Introduction
Replacement is the axiom scheme which makes the difference between ZF sth:replacement:intro:
sec
and Z. We helped ourselves to it throughout chapters 63 to 64. In this chapter,
we will finally consider the question: is Replacement justified?
To make the question sharp, it is worth observing that Replacement is really
rather strong. We will get a sense of just how strong it is, during this chapter
(and again in section 68.5). But this will suggest that justification really is
required.
We will discuss two kinds of justification. Roughly: an extrinsic justification
is an attempt to justify an axiom by its fruits; an intrinsic justification is
an attempt to justify an axiom by suggesting that it is vindicated by the
mathematical concepts in question. We will get a greater sense of what this
means during this chapter, but it is just the tip of an iceberg. For more, see in
particular Maddy (1988a and 1988b).
content/set-theory/replacement/strength.tex
sth:replacement:strength: Definition 65.1. For any set M , and any formula φ, let φM be the formula
formularelativization
which results by restricting all of φ’s quantifiers to M . That is, replace “∃x”
with “(∃x ∈ M )”, and replace “∀x” with “(∀x ∈ M )”.
It can be shown that, for every axiom φ of Z, we have that ZF ⊢ φVω+ω .
But ω + ω is not in Vω+ω , by Corollary 64.21. So Z is consistent with the
non-existence of ω + ω.
This is why we said, in section 63.7, that Theorem 63.26 cannot be proved
without Replacement. For it is easy, within Z, to define an explicit well-
ordering which intuitively should have order-type ω + ω. Indeed, we gave an
informal example of this in section 63.2, when we presented the ordering on
the natural numbers given by:
But if ω + ω does not exist, this well-ordering is not isomorphic to any ordinal.
So Z does not prove Theorem 63.26.
Flipping things around: Replacement allows us to prove the existence of
ω + ω, and hence must allow us to prove the existence of Vω+ω . And not just
that. For any well-ordering we can define, Theorem 63.26 tells us that there
is some α isomorphic with that well-ordering, and hence that Vα exists. In a
straightforward way, then, Replacement guarantees that the hierarchy of sets
must be very tall.
Over the next few sections, and then again in section 68.5, we’ll get a better
sense of better just how tall Replacement forces the hierarchy to be. The simple
point, for now, is that Replacement really does stand in need of justification!
content/set-theory/replacement/extrinsic.tex
also allowed us to define the Vα s, establish the notion of rank, and prove ∈-
Induction (this amounts to our “theorems about the iterative conception”).
Finally, Replacement allows us to prove the Transfinite Recursion Theorem
(this is the “inductive definitions on well-founded relations”).
These are, indeed, desirable consequences. But do these desirable conse-
quences suffice to justify Replacement? No. Or at least, not straightforwardly.
Here is a simple problem. Whilst we have stated some desirable conse-
quences of Replacement, we could have obtained many of them via other means.
This is not as well known as it ought to be, though, so we should pause to ex-
plain the situation.
There is a simple theory of sets, Level Theory, or LT for short.1 LT’s axioms
are just Extensionality, Separation, and the claim that every set is a subset of
some level, where “level” is cunningly defined so that the levels behave like our
friends, the Vα s. So ZF proves LT; but LT is much weaker than ZF. In fact,
LT does not give you Pairs, Powersets, Infinity, or Replacement. Let Zr be
the result of adding Infinity and Powersets to LT; this delivers Pairs too, so,
Zr is at least as strong as Z. But, in fact, Zr is strictly stronger than Z, since
it adds the claim that every set has a rank (hence my suggestion that we call
it Zr). Indeed, Zr delivers: a perfectly satisfactory theory of ordinals; results
which stratify the hierarchy into well-ordered stages; a proof of ∈-Induction;
and a version of Transfinite Recursion.
In short: although Boolos didn’t know this, all of the desirable consequences
which he mentions could have been arrived at without Replacement; he simply
needed to use Zr rather than Z.
(Given all of this, why did we follow the conventional route, of teaching
you ZF, rather than LT and Zr? There are two reasons. First: for purely
historical reasons, starting with LT is rather nonstandard; we wanted to equip
you to be able to read more standard discussions of set theory. Second: when
you are ready to appreciate LT and Zr, you can simply read Potter 2004 and
Button 2021.)
Of course, since Zr is strictly weaker than ZF, there are results which
ZF proves which Zr leaves open. So one could try to justify Replacement on
extrinsic grounds by pointing to one of these results. But, once you know how
to use Zr, it is quite hard to find many examples of things that are (a) settled
by Replacement but not otherwise, and (b) are intuitively true. (For more on
this, see Potter 2004, §13.2.)
The bottom line is this. To provide a compelling extrinsic justification for
Replacement, one would need to find a result which cannot be achieved without
Replacement. And that’s not an easy enterprise.
Let’s consider a further problem which arises for any attempt to offer a
purely extrinsic justification for Replacement. (This problem is perhaps more
fundamental than the first.) Boolos does not just point out that Replace-
1 The first versions of LT are offered by Montague (1965) and Scott (1974); this was
simplified, and given a book-length treatment, by Potter (2004); and Button (2021) has
recently simplified LT further.
ment has many desirable consequences. He also states that Replacement has
“(apparently) no undesirable” consequences. But this parenthetical caveat,
“apparently,” is surely absolutely crucial.
Recall how we ended up here: Naı̈ve Comprehension ran into inconsistency,
and we responded to this inconsistency by embracing the cumulative-iterative
conception of set. This conception comes equipped with a story which, we hope,
assures us of its consistency. But if we cannot justify Replacement from within
that story, then we have (as yet) no reason to believe that ZF is consistent.
Or rather: we have no reason to believe that ZF is consistent, apart from the
(perhaps merely contingent) fact that no one has discovered a contradiction
yet. In exactly that sense, Boolos’s comment seems to come down to this:
“(apparently) ZF is consistent”. We should demand greater reassurance of
consistency than this.
This issue will affect any purely extrinsic attempt to justify Replacement,
i.e., any justification which is couched solely in terms of the (known) conse-
quences of ZF. As such, we will want to look for an intrinsic justification of
Replacement, i.e., a justification which suggests that the story which we told
about sets somehow “already” commits us to Replacement.
content/set-theory/replacement/limofsize.tex
65.4 Limitation-of-size
sth:replacement:limofsize: Perhaps the most common attempt to offer an “intrinsic” justification of Re-
sec
placement comes via the following notion:
Limitation-of-size. Any things form a set, provided that there are not
too many of them.
This principle will immediately vindicate Replacement. After all, any set
formed by Replacement cannot be any larger than any set from which it was
formed. Stated precisely: suppose you form a set τ [A] = {τ (x) : x ∈ A} using
Replacement; then τ [A] ⪯ A; so if the elements of A were not too numerous to
form a set, their images are not too numerous to form τ [A].
The obvious difficulty with invoking Limitation-of-size to justify Replace-
ment is that we have not yet laid down any principle like Limitation-of-size.
Moreover, when we told our story about the cumulative-iterative conception of
set in chapters 61 to 62, nothing ever hinted in the direction of Limitation-of-
size. This, indeed, is precisely why Boolos at one point wrote: “Perhaps one
may conclude that there are at least two thoughts ‘behind’ set theory” (1989,
p. 19). On the one hand, the ideas surrounding the cumulative-iterative con-
ception of set are meant to vindicate Z. On the other hand, Limitation-of-size
is meant to vindicate Replacement.
But the issue it is not just that we have thus far been silent about Limitation-
of-size. Rather, the issue is that Limitation-of-size (as just formulated) seems
to sit quite badly with the cumulative-iterative notion of set. After all, it
mentions nothing about the idea of sets as formed in stages.
This is really not much of a surprise, given the history of these “two
thoughts” (i.e., the cumulative-iterative conception of set, and Limitation-of-
size). These “two thoughts” ultimately amount to two rather different projects
for blocking the set-theoretic paradoxes. The cumulative-iterative notion of set
blocks Russell’s paradox by saying, roughly: we should never have expected a
Russell set to exist, because it would not be “formed” at any stage. By contrast,
Limitation-of-size is meant to rule out the Russell set, by saying, roughly: we
should never have expected a Russell set to exist, because it would have been
too big.
Put like this, then, let’s be blunt: considered as a reply to the paradoxes,
Limitation-of-size stands in need of much more justification. Consider, for
example, this version of Russell’s Paradox: no pug sniffs exactly the pugs which
don’t sniff themselves (see section 61.2). If you ask “why is there no such pug?”,
it is not a good answer to be told that such a pug would have to sniff too many
pugs. So why would it be a good intuitive explanation, of the non-existence of
a Russell set, that it would have to be “too big” to exist?
In short, it’s forgivable if you are a bit mystified concerning the “intuitive”
motivation for Limitation-of-size.
content/set-theory/replacement/absinf.tex
cofinal, since Z on its own is not strong enough to define the stages, so it is not clear how one
would formalise Stages-are-super-cofinal. One option, though, is to work in some extension
of LT, as discussed in section 65.3.
i.e., we have a map τ such that for any stage S there is some x ∈ A such that
S ∈ τ (x). In that case, we do have a way to get a handle on the supposed “ab-
solute infinity” of the hierarchy: it is exhausted by the range of τ applied to A.
And that compromises the thought that the hierarchy is “absolutely infinite”.
Contraposing: Stages-are-inexhaustible entails Stages-are-super-cofinal, which
in turn justifies Replacement.
This represents a genuinely promising attempt to provide an intrinsic jus-
tification for Replacement. But whether it ultimately works, or not, we will
have to leave to you to decide.
content/set-theory/replacement/ref.tex
content/set-theory/replacement/refproofs.tex
To use this to prove Replacement, we will first follow Lévy (1960, first part
of Theorem 2) and show that we can “reflect” two formulas at once:
(∀z, x ∈ S)(φ ↔ φS )
i.e. (∀z, x ∈ S)(((z = 0 ∧ ψ) ∨ (z = 1 ∧ χ)) ↔
((z = 0 ∧ ψ) ∨ (z = 1 ∧ χ))S )
i.e. (∀z, x ∈ S)(((z = 0 ∧ ψ) ∨ (z = 1 ∧ χ)) ↔
((z = 0 ∧ ψ S ) ∨ (z = 1 ∧ χS )))
i.e. (∀x ∈ S)((ψ ↔ ψ S ) ∧ (χ ↔ χS ))
The second claim entails the third because “z = 0” and “z = 1” are absolute
for S; the fourth claim follows since 0 ̸= 1.
We can now obtain Replacement, just by following and simplifying Lévy (1960,
Theorem 6):
Theorem 65.5 (in Z + Weak-Reflection). For any formula φ(v, w), and
any A, if (∀x ∈ A)∃!y φ(x, y), then {y : (∃x ∈ A)φ(x, y} exists.
6 More formally, letting ξ be either of these formulas, ξ(z) ↔ ξ S (z).
Proof. Fix A such that (∀x ∈ A)∃!y φ(x, y), and define formulas:
ψ is (φ(x, z) ∧ A = A)
χ is ∃y φ(x, y)
(∀x, z ∈ S)((ψ ↔ ψ S ) ∧ (χ ↔ χS ))
So in particular:
Now (∀x ∈ A)(∃!y ∈ S)φ(x, y), because (∀x ∈ A)∃!y φ(x, y). Now Separation
yields {y ∈ S : (∃x ∈ A)φ(x, y)} = {y : (∃x ∈ A)φ(x, y)}.
content/set-theory/replacement/finiteaxiomatizability.tex
In particular, then:
So that T is inconsistent.7
Proposition 65.7. Let T extend Z with finitely many new axioms. If T ⊢ sth:replacement:finiteaxiomatizabi
finiteextensionofZ
ZF, then T is inconsistent. (Here we use the same tacit restrictions as for
Theorem 65.6.)
Proof. Use θ for the conjunction of all of T’s axioms except for the (infinitely
many) instances of Separation. Defining ψ from θ as in Theorem 65.6, we can
show that T ⊢ ∃M ψ(M ).
As in Theorem 65.6, we can establish the schema that, whenever T ⊢ σ,
we have that T ⊢ ∀X(ψ(X) → σ X ). We then finish our proof, exactly as in
Theorem 65.6.
However, establishing the schema involves a little more work than in The-
orem 65.6. After all, the Separation-instances are in T, but they are not
conjuncts of θ. However, we can overcome this obstacle by proving that
T ⊢ ∀X(X is transitive → σ X ), for every Separation-instance σ. We leave
this to the reader.
Problem 65.4. Confirm the remaining schematic results invoked in the proofs
of Theorem 65.6 and Proposition 65.7.
7 This “elementary reasoning” involves proving certain “absoluteness facts” for transitive
sets.
838
As remarked in section 65.5, this shows that Replacement is strictly stronger
than Theorem 63.26. Or, slightly more strictly: if Z + “every well-ordering
is isomorphic to a unique ordinal” is consistent, then it fails to prove some
Replacement-instance.
Chapter 66
Ordinal Arithmetic
content/set-theory/ord-arithmetic/introduction.tex
66.1 Introduction
sth:ord-arithmetic:intro: In chapter 63, we developed a theory of ordinal numbers. We saw in chapter 64
sec
that we can think of the ordinals as a spine around which the remainder of the
hierarchy is constructed. But that is not the only role for the ordinals. There
is also the task of performing ordinal arithmetic.
We already gestured at this, back in section 63.2, when we spoke of ω, ω + 1
and ω + ω. At the time, we spoke informally; the time has come to spell it out
properly. However, we should mention that there is not much philosophy in
this chapter; just technical developments, coupled with a (mildly) interesting
observation that we can do the same thing in two different ways.
content/set-theory/ord-arithmetic/addition.tex
This is a reverse lexicographic ordering, since you order by the second ele-
ment, then by the first. Now recall that we wanted to define α + β as the order
type of a copy of α followed by a copy of β. To achieve that, we say:
Definition 66.3. For any ordinals α, β, their sum is α + β = ord(α ⊔ β, ∢). sth:ord-arithmetic:add:
defordplus
Note that we slightly abused notation here; strictly we should write “{⟨x, y⟩ ∈
α ⊔ β : x ∢ y}” in place of “∢”. For brevity, though, we will continue to abuse
notation in this way in what follows.
The following result, together with Theorem 63.26, confirms that our defi-
nition is well-formed:
α+0=α
α + (β + 1) = (α + β) + 1
α + β = lsub(α + δ) if β is a limit ordinal
δ<β
(α + β) + γ = lsub((α + β) + δ)
δ<γ
= lsub(α + (β + δ))
δ<γ
= α + lsub(β + δ)
δ<γ
= α + (β + γ)
In these ways, ordinal addition should be very familiar. But, there is a cru-
cial way in which ordinal addition is not like addition on the natural numbers.
Proposition 66.8. Ordinal addition is not commutative; 1 + ω = ω < ω + 1. sth:ord-arithmetic:add:
ordsumnotcommute
Whilst this may initially come as a surprise, it shouldn’t. On the one hand,
when you consider 1 + ω, you are thinking about the order type you get by
putting an extra element before all the natural numbers. Reasoning as we did
with Hilbert’s Hotel in section 6.1, intuitively, this extra first element shouldn’t
make any difference to the overall order type. On the other hand, when you
consider ω + 1, you are thinking about the order type you get by putting an
extra element after all the natural numbers. And that’s a radically different
beast!
content/set-theory/ord-arithmetic/using-addition.tex
content/set-theory/ord-arithmetic/multiplication.tex
α·0=0
α · (β + 1) = (α · β) + α
α · β = lsub(α · δ) when β is a limit ordinal.
δ<β
Indeed, just as in the case of addition, we could have defined ordinal multi-
plication via these recursion equations, rather than offering a direct definition.
Equally, as with addition, certain behaviour is familiar:
You can prove (or look up) other results, to your heart’s content. But,
given Proposition 66.8, the following should not come as a surprise:
Problem 66.3. Prove Lemma 66.12, Lemma 66.13, and Lemma 66.14
content/set-theory/ord-arithmetic/exponentiation.tex
α(0) = 1
α(β+1) = α(β) · α
[
α(β) = α(δ) when β is a limit ordinal
δ<β
Chapter 67
Cardinals
content/set-theory/cardinals/cp.tex
Cast your mind back even further, to section 4.8. There, working naı̈vely, we
introduced the notion of the “size” of a set. Specifically, we said that two
sets are equinumerous, A ≈ B, just in case there is a bijection f : A → B.
This is an intrinsically simpler notion than that of a well-ordering: we are
only interested in bijections, and not (as with order-isomorphisms) whether
the bijections “preserve any structure”.
This all gives rise to an obvious thought. Just as we introduced certain
objects, ordinals, to calibrate well-orders, we can introduce certain objects,
cardinals, to calibrate size. That is the aim of this chapter.
Before we say what these cardinals will be, we should lay down a principle
which they ought to satisfy. Writing |X| for the cardinality of the set X, we
846
67.2. CARDINALS AS ORDINALS
We’ll call this Cantor’s Principle, since Cantor was probably the first to have it
very clearly in mind. (We’ll say more about its relationship to Hume’s Principle
in section 67.5.) So our aim is to define |X|, for each X, in such a way that it
delivers Cantor’s Principle.
content/set-theory/cardinals/cardsasords.tex
sth:cardinals:cardsasords: Definition 67.1. If A can be well-ordered, then |A| is the least ordinal γ such
defcardinalasordinal
that A ≈ γ. For any ordinal γ, we say that γ is a cardinal iff γ = |γ|.
sth:cardinals:cardsasords: 2. |A| ≈ A;
cardaapprox
The next result guarantees Cantor’s Principle, and more besides. (Note
that cardinals inherit their ordering from the ordinals, i.e., a < b iff a ∈ b. In
formulating this, we will use Fraktur letters for objects we know to be cardinals.
This is fairly standard. A common alternative is to use Greek letters, since
cardinals are ordinals, but to choose them from the middle of the alphabet,
e.g.: κ, λ.):
Proof. We will prove the left-to-right direction of the second claim (the other
cases are similar, and left as an exercise). So, consider the following diagram:
A B
|A| |B|
We can also use Lemma 67.3 to re-prove Schröder–Bernstein. This is the claim
that if A ⪯ B and B ⪯ A then A ≈ B. We stated this as Theorem 4.25, but
first proved it—with some effort—in section 6.5. Now consider:
Whilst this is a very simple proof, it implicitly relies on both Replacement (to
secure Theorem 63.26) and on Well-Ordering (to guarantee Lemma 67.3). By
contrast, the proof of section 6.5 was much more self-standing (indeed, it can
be carried out in Z− ).
content/set-theory/cardinals/milestone.tex
Definition 67.4. The theory ZFC has these axioms: Extensionality, Union,
Pairs, Powersets, Infinity, Foundation, Well-Ordering and all instances of the
Separation and Replacement schemes. Otherwise put, ZFC adds Well-Ordering
to ZF.
ZFC stands for Zermelo–Fraenkel set theory with Choice. Now this might
seem slightly odd, since the axiom we added was called “Well-Ordering”, not
“Choice”. But, when we later formulate Choice, it will turn out that Well-
Ordering is equivalent (modulo ZF) to Choice (see Theorem 69.6). So which
to take as our “basic” axiom is a matter of indifference. And the name “ZFC”
is entirely standard in the literature.
content/set-theory/cardinals/classing.tex
Proof. Immediate.
It also follows that several reasonable notions of what it might mean to describe
a cardinal as “finite” or “infinite” coincide:
sth:cardinals:classing: Theorem 67.7. For any set A, the following are equivalent:
generalinfinitycharacter
sth:cardinals:classing: 1. |A| ∈
/ ω, i.e., A is not a natural number;
card:notinomega
sth:cardinals:classing: 2. ω ≤ |A|;
card:omegaplus
sth:cardinals:classing: 3. A is Dedekind infinite.
card:infinite
This licenses the following definition of some notions which we used rather
informally in part I:
Definition 67.8. We say that A is finite iff |A| is a natural number, i.e., sth:cardinals:classing:
But note that this definition is presented against the background of ZFC. After
all, we needed Well-Ordering to guarantee that every set has a cardinality. And
indeed, without Well-Ordering, there can be a set which is neither finite nor
Dedekind infinite. We will return to this sort of issue in chapter 69. For now,
we continue to rely upon Well-Ordering.
Let us now turn from the finite cardinals to the infinite cardinals. Here are
two elementary points:
Indeed, ω has a special place. Whilst there are many countable ordinals:
Proof. For any cardinal a, Cantor’s Theorem (Theorem 4.24) and Lemma 67.2
entail that a < |℘(a)|.
You should compare this with both Russell’s Paradox and Burali-Forti.
content/set-theory/cardinals/hp.tex
This is very similar to what is now called Hume’s Principle, which says:
where ‘F ∼ G’ abbreviates that there are exactly as many F s as Gs, i.e., the
F s can be put into a bijection with the Gs, i.e.:
∃R(∀v∀y(Rvy → (F v ∧ Gy)) ∧
∀v(F v → ∃!y Rvy) ∧
∀y(Gy → ∃!v Rvy))
When two numbers are so combined as that the one has always an
unit answering to every unit of the other, we pronounce them equal.
(Hume, 1740, Pt.III Bk.1 §1)
Chapter 68
Cardinal Arithmetic
content/set-theory/card-arithmetic/opps.tex
a ⊕ b = |a ⊔ b|
a ⊗ b = |a × b|
ab = b
a
Problem 68.1. Prove in Z− that X Y exists for any sets X and Y . Work-
ing in ZF, compute rank(X Y ) from rank(X) and rank(Y ), in the manner of
Lemma 66.9.
853
CHAPTER 68. CARDINAL ARITHMETIC
It might help to explain this definition. Concerning addition: this uses the
notion of disjoint sum, ⊔, as defined in Definition 66.1; and it is easy to see that
this definition gives the right verdict for finite cases. Concerning multiplica-
tion: Proposition 1.27 tells us that if A has n members and B has m members
then A × B has n · m members, so our definition simply generalises the idea
to transfinite multiplication. Exponentiation is similar: we are simply gener-
alising the thought from the finite to the transfinite. Indeed, in certain ways,
transfinite cardinal arithmetic looks much more like “ordinary” arithmetic than
does transfinite ordinal arithmetic:
This explains why we need to use different symbols for ordinal versus car-
dinal addition/multiplication: these are genuinely different operations. This
next pair of results shows that ordinal versus cardinal exponentiation are also
different operations. (Recall that Definition 62.7 entails that 2 = {0, 1}):
A A
Now let f (B) = χB ; this defines a bijection f : ℘(A) → 2. So ℘(A) ≈ 2.
Hence ℘(A) ≈ |A| 2, so that |℘(A)| = |A| 2 = 2|A| .
This snappy proof essentially subsumes the discussion of section 4.13. There,
we showed how to “reduce” the uncountability of ℘(ω) to the uncountability
of the set of infinite binary strings, Bω . In effect, Bω is just ω 2; and the pre-
ceding proof showed that the reasoning we went through in section 4.13 will
go through using any set A in place of ω. The result also yields a quick fact
about cardinal exponentiation:
Proof skeleton. There are plenty of ways to prove this. The most straightfor-
ward is to argue that ℘(ω) ⪯ R and R ⪯ ℘(ω), and then use Schröder-Bernstein
to infer that R ≈ ℘(ω), and Lemma 68.4 to infer that |R| = 2ω . We leave it as
an (illuminating) exercise to define injections f : ℘(ω) → R and g : R → ℘(ω).
Problem 68.3. Complete the proof of Theorem 68.6, by showing that ℘(ω) ⪯
R and R ⪯ ℘(ω).
content/set-theory/card-arithmetic/simp.tex
And now we will put all this to work, in proving a crucial lemma:
Proof. For reductio, let α be the least infinite ordinal for which this is false.
Proposition 4.12 shows that ω ≈ ω × ω, so ω ∈ α. Moreover, α is a cardinal:
suppose otherwise, for reductio; then |α| ∈ α, so that |α| ≈ |α| × |α|, by
hypothesis; and |α| ≈ α by definition; so that α ≈ α × α by Proposition 68.9.
Now, for each ⟨γ1 , γ2 ⟩ ∈ α × α, consider the segment:
a ⊗ b = a ⊕ b = max(a, b).
Proposition 68.12. Let a be an infinite cardinal. For each ordinal β ∈ a, let sth:card-arithmetic:simp:
S kappaunionkappasize
Xβ be a set with |Xβ | ≤ a. Then β∈a Xβ ≤ a.
1
S For each β ∈ a, fix an injection fβ : Xβ → a. Define an injection
Proof.
→ a × a by g(v) = ⟨β, fβ (v)⟩, where v ∈ Xβ and v ∈
g : β∈a Xβ S / Xγ for any
γ ∈ β. Now β∈a Xβ ⪯ a × a ≈ a by Theorem 68.11.
content/set-theory/card-arithmetic/expotough.tex
1 How are these “fixed”? See section 69.5.
sth:card-arithmetic:expotough: Proposition 68.13. ab⊕c = ab ⊗ac and (ab )c = ab⊗c , for any cardinals a, b, c.
simplecardexpo
Proof. For the first claim, consider a function f : (b ⊔ c) → a. Now “split this”,
by defining fb (β) = f (β, 0) for each β ∈ b, and fc (γ) = f (γ, 1) for each γ ∈ c.
The map f 7→ (fb × fc ) is a bijection b⊔c a → (b a × c a).
For the second claim, consider a function f : c → (b a); so for each γ ∈ c
we have some function f (γ) : b → a. Now define f ∗ (β, γ) = (f (γ))(β) for each
⟨β, γ⟩ ∈ b × c. The map f 7→ f ∗ is a bijection c (b a) → b⊗c a.
Now, what we would like is an easy way to compute ab when we are dealing
with infinite cardinals. Here is a nice step in this direction:
Proof.
2b ≤ ab , as 2 ≤ a
≤ (2a )b , by Lemma 68.4
= 2a⊗b , by Proposition 68.13
= 2b , by Theorem 68.11
We should not really expect to be able to simplify this any further, since
b < 2b by Lemma 68.4. However, this does not tell us what to say about ab
when b < a. Of course, if b is finite, we know what to do.
content/set-theory/card-arithmetic/ch.tex
The definition of a⊕ is in order, since Theorem 67.14 tells us that, for each
cardinal a, there is some cardinal greater than a, and Transfinite Induction
guarantees that there is a least cardinal greater than a. The rest of the defini-
tion of a is provided by transfinite recursion.
Cantor introduced this “ℵ” notation; this is aleph, the first letter in the
Hebrew alphabet and the first letter in the Hebrew word for “infinite”. Peirce
introduced the “ℶ” notation; this is beth, which is the second letter in the
Hebrew alphabet.2 Now, these notations provide us with infinite cardinals.
Proposition 68.18. ℵα and ℶα are cardinals, for every ordinal α.
also gave a bad argument there that ℶα does not exist for α ≥ ω.
content/set-theory/card-arithmetic/fix.tex
κ0 = 0
κn+1 = ℵκn
[
κ= κn
n<ω
Boolos once wrote an article about exactly the ℵ-fixed-point we just con-
structed. After noting the existence of κ, at the start of his article, he said:
If we have, indeed, outrun “anything that is the case”, then we must point the
finger of blame directly at Replacement. For it is this axiom which allows our
proof to work. In which case, one assumes, Boolos would need to revisit the
claim he made, a few decades earlier, that Replacement has “no undesirable”
consequences (see section 65.3).
But is the existence of κ so bad? It might help, here, to consider Russell’s
Tristram Shandy paradox. Tristram Shandy documents his life in his diary, but
it takes him a year to record a single day. With every passing year, Tristram
falls further and further behind: after one year, he has recorded only one day,
and has lived 364 days unrecorded days; after two years, he has only recorded
two days, and has lived 728 unrecorded days; after three years, he has only
recorded three days, and lived 1092 unrecorded days . . . 5 Still, if Tristram is
immortal, Tristram will manage to record every day, for he will record the nth
day on the nth year of his life. And so, “at the end of time”, Tristram will
have a complete diary.
Now: why is this so different from the thought that α is smaller than ℵα —
and indeed, increasingly, desperately smaller—up until κ, at which point, we
catch up, and κ = ℵκ ?
Setting that aside, and assuming we accept ZFC, let’s close with a little
more fun concerning fixed-point constructions. The next three results establish,
intuitively, that there is a (non-trivial) point at which the hierarchy is as wide
as it is tall:
sth:card-arithmetic:fix: Proposition 68.21. There is a ℶ-fixed-point, i.e., a κ such that κ = ℶκ .
bethfixed
Proof. The first claim holds by a simple transfinite induction. The second
claim follows, since if ω · ω ≤ α then ω + α = α. To establish this, we use facts
about ordinal arithmetic from chapter 66. First note that ω · ω = ω · (1 + ω) =
(ω · 1) + (ω · ω) = ω + (ω · ω). Now if ω · ω ≤ α, i.e., α = (ω · ω) + β for some
β, then ω + α = ω + ((ω · ω) + β) = (ω + (ω · ω)) + β = (ω · ω) + β = α.
Proof. Let κ be a ℶ-fixed point, as given by Proposition 68.21. Clearly ω·ω < κ.
So |Vκ | = ℶκ = κ by Proposition 68.22.
τ0 (A) = |A|
τn+1 (A) = ℶτn (A)
[
τ (A) = τn (A)
n<ω
W0 = 0
Wα+1 = τ (Wα )
[
Wα = Wβ , when α is a limit
β<α
The construction is defined for all ordinals. Intuitively, then, W is “an injec-
tion” from the ordinals to ℶ-fixed points. And, exactly as before, VWα is as
wide as it is tall, for any α.
Chapter 69
Choice
content/set-theory/choice/introduction.tex
69.1 Introduction
In chapters 67 to 68, we developed a theory of cardinals by treating cardinals sth:choice:intro:
sec
as ordinals. That approach depends upon the Axiom of Well-Ordering. It
turns out that Well-Ordering is equivalent to another principle—the Axiom of
Choice—and there has been serious philosophical discussion of its acceptability.
Our question for this chapter are: How is the Axiom used, and can it be
justified?
content/set-theory/choice/tarskiscott.tex
862
69.3. COMPARABILITY AND HARTOGS’ LEMMA
{x : A ≈ x}.
You might want to compare this with Frege’s definition of #xF x, sketched
at the very end of section 67.5. And, for reasons we gestured at there, this
definition fails. Any singleton set is equinumerous with {∅}. But new singleton
sets are formed at every successor stage of the hierarchy (just consider the
singleton of the previous stage). So {x : A ≈ x} does not exist, since it cannot
have a rank.
To get around this problem, we use a trick due to Tarski and Scott:1
Definition 69.1 (Tarski–Scott). For any formula φ(x), let [x : φ(x)] be the
set of all x, of least possible rank, such that φ(x) (or ∅, if there are no φs).
content/set-theory/choice/hartogs.tex
B = ran(f )
R = {⟨f (α), f (β)⟩ ∈ A × A : α ∈ β}.
Proof. (1) ⇒ (2). Fix A and B. Invoking (1), there are well-orderings ⟨A, R⟩
and ⟨B, S⟩. Invoking Theorem 63.26, let f : α → ⟨A, R⟩ and g : β → ⟨B, S⟩ be
isomorphisms. By Proposition 63.22, either α ⊆ β or β ⊆ α. If α ⊆ β, then
g ◦ f −1 : A → B is an injection, and hence A ⪯ B; similarly, if β ⊆ α then
B ⪯ A.
(2) ⇒ (1). Fix A; by Lemma 69.3 there is some ordinal β such that β ⪯̸ A.
Invoking (2), we have A ⪯ β. So there is some injection f : A → β, and we
can use this injection to well-order the elements of A, by defining an order
{⟨a, b⟩ ∈ A × A : f (a) ∈ f (b)}.
content/set-theory/choice/wellorderingproblem.tex
sth:choice:woproblem: Theorem 69.6 (in ZF). Well-Ordering and Choice are equivalent.
thmwochoice
S
Proof. Left-to-right. Let A be a set of sets. Then A exists by theSAxiom of
Union, and so by Well-Ordering there is some < which well-orders A. Now
let f (x) = the <-least member of x. This is a choice function for A.
Right-to-left. Fix A. By Choice, there is a choice function, f , for ℘(A)\{∅}.
Using Transfinite Recursion, define a function:
g(0) = f (A)
(
stop! if A = g[α]
g(α) =
f (A \ g[α]) otherwise
α ≺ ℘(A) \ {∅} for every ordinal α, contradicting Lemma 69.3. Hence also
ran(g) = A.
Assembling these facts, g is a bijection from some ordinal to A. Now g can
be used to well-order A.
So Well-Ordering and Choice stand or fall together. But the question re-
mains: do they stand or fall?
content/set-theory/choice/countablechoice.tex
But matters get murkier as soon as we consider infinite sets. For example,
consider this “minimal” extension to the above:
This is a special case of Choice. And it transpires that this principle was
invoked fairly frequently, without an obvious awareness of its use. Here are two
nice examples.2
Example 69.8. Here is a natural thought: for any set A, either ω ⪯ A, or
A ≈ n for some n ∈ ω. This is one way to state the intuitive idea, that every set
is either finite or infinite. Cantor, and many other mathematicians, made this
claim without proving it. Cautious as we are, we proved this in Theorem 67.7.
But in that proof we were working in ZFC, since we were assuming that any
set A can be well-ordered, and hence that |A| is guaranteed to exist. That is:
we explicitly assumed Choice.
In fact, Dedekind (1888) offered his own proof of this claim, as follows:
Theorem 69.9 (in Z− + Countable Choice). For any A, either ω ⪯ A or
A ≈ n for some n ∈ ω.
Proof. Suppose A ̸≈ n for all n ∈ ω. Then in particular for each n < ω there is
subset An ⊆ A with exactly 2n elements. Using this sequence A0 , A1 , A2 , . . .,
we define for each n: [
B n = An \ Ai .
i<n
2 Due to Potter (2004, §9.4) and Luca Incurvati.
[
An ≤ |A0 | + |A1 | + . . . + |An−1 |
i<n
= 1 + 2 + . . . + 2n−1
= 2n − 1
< 2n = |An |
Hence each Bn has at least one member, cn . Moreover, the Bn s are pairwise
disjoint; so if cn = cm then n = m. But every cn ∈ A. So the function
f (n) = cn is an injection ω → A.
Dedekind did not flag that he had used Countable Choice. But, did you spot
its use? Look again. (Really: look again.)
The proof used Countable Choice twice. We used it once, to obtain our
sequence of sets A0 , A1 , A2 , . . . We then used it again to select our elements
cn from each Bn . Moreover, this use of Choice is ineliminable. Cohen (1966,
p. 138) proved that the result fails if we have no version of Choice. That is: it
is consistent with ZF that there are sets which are incomparable with ω.
Proof. Without loss of generality, suppose that each AnS̸= ∅. So for each n ∈ ω
there is a surjection fn : ω → An . Define f : ω × ω → n<ω An by f (m, n) =
fn (m). The result follows because ω × ω is countable (Proposition 4.12) and f
is a surjection.
Did you spot the use of the Countable Choice? It is used to choose our sequence
of functions f0 , f1 , f2 , . . . 3 And again, the result fails in the absence of any
Choice principle. Specifically, Feferman and Levy (1963) proved that it is
consistent with ZF that a countable union of countable sets has cardinality ℶ1 .
But here is a much funnier statement of the point, from Russell:
This is illustrated by the millionaire who bought a pair of socks
whenever he bought a pair of boots, and never at any other time,
and who had such a passion for buying both that at last he had
ℵ0 pairs of boots and ℵ0 pairs of socks. . . Among boots we can
3 A similar use of Choice occurred in Proposition 68.12, when we gave the instruction
In short, some form of Choice is needed to prove the following: If you have
countably many pairs of socks, then you have (only) countably many socks.
And in fact, without Countable Choice (or something equivalent), a countable
union of countable sets can fail to be countable.
The moral is that Countable Choice was used repeatedly, without much
awareness of its users. The philosophical question is: How could we justify
Countable Choice?
An attempt at an intuitive justification might invoke an appeal to a super-
task. Suppose we make the first choice in 1/2 a minute, our second choice in
1/4 a minute, . . . , our n-th choice in 1/2n a minute, . . . Then within 1 minute,
content/set-theory/choice/justifications.tex
Stages-accumulate. For any stage S, and for any sets which were formed
before stage S: a set is formed at stage S whose members are exactly
those sets. Nothing else is formed at stage S.
In fact, many authors have suggested that the Axiom of Choice can be justified
via (something like) this principle. We will briefly provide a gloss on that
approach.
We will start with a simple little result, which offers yet another equivalent
for Choice:
sth:choice:justifications: Theorem 69.12 (in ZF). Choice is equivalent to the following principle. If
choiceset
the elements of A are disjoint and non-empty, then there is some C such that
C ∩ x is a singleton for every x ∈ A. (We call such a C a choice set for A.)
Problem 69.1. Prove Theorem 69.12. If you struggle, you can find a proof
in (Potter, 2004, pp. 242–3).
The essential point is that a choice set for A is just the range of a choice
function for A. So, to justify Choice, we can simply try to justify its equivalent
formulation, in terms of the existence of choice sets. And we will now try to
do exactly that.
Let A’s elements be disjoint and non-empty. By Stages-are-key (see S sec-
tion 62.1), A is formed at some stage S. Note that all the elements of A
are available before stage S. Now, by Stages-accumulate, for any sets which
were formed before S, a set is formed whose members are exactly those sets.
Otherwise put: every possible collections of earlier-available sets will exist at S.
But it is certainly possible to select objects which could
S be formed into a choice
set for A; that is just some very specific subset of A. So: some such choice
set exists, as required.
Well, that’s a very quick attempt to offer a justification of Choice on intrin-
sic grounds. But, to pursue this idea further, you should read Potter’s (2004,
§14.8) neat development of it.
content/set-theory/choice/banach.tex
Theorem 69.13 (Banach–Tarski Paradox (in ZFC)). Any ball can be de-
composed into finitely many pieces, which can be reassembled (by rotation and
transportation) to form two copies of that ball.
At first glance, this is a bit amazing. Clearly the two balls have twice the
volume of the original ball. But rigid motions—rotation and transportation—
do not change volume. So it looks as if Banach–Tarski allows us to magick new
matter into existence.
It gets worse.4 Similar reasoning shows that a pea can be cut into finitely
many pieces, which can then be reassembled (by rotation and transportation)
to form an entity the shape and size of Big Ben.
None of this, however, holds in ZF on its own.5 So we face a decision:
reject Choice, or learn to live with the “paradox”.
We’re going to suggest that we should learn to live with the “paradox”.
Indeed, we don’t think it’s much of a paradox at all. In particular, we don’t
see why it is any more or less paradoxical than any of the following results:6
None of these three results require Choice. Indeed, we now just regard them
as surprising, lovely, bits of mathematics. Maybe we should adopt the same
attitude to the Banach–Tarski Paradox.
To be sure, a technical observation is required here; but it only requires
keeping a level head. Rigid motions preserve volume. Consequently, the five7
pieces into which the ball is decomposed cannot all be measurable. Roughly
put, then, it makes no sense to assign a volume to these individual pieces. You
should think of these as unpicturable, “infinite scatterings” of points. Now,
maybe it is “weird” to conceive of such “infinitely scattered” sets. But their
existence seems to fall out from the injunction, embodied in Stages-accumulate,
that you should form all possible collections of earlier-available sets.
If none of that convinces, here is a final (extrinsic) argument in favour of
embracing the Banach–Tarski Paradox. It immediately entails the best math
joke of all time:
content/set-theory/choice/vitali.tex
4 See Tomkowicz and Wagon (2016, Theorem 3.12).
5 Though Banach–Tarski can be proved with principles which are strictly weaker than
Choice; see Tomkowicz and Wagon (2016, 303).
6 Potter (2004, 276–7), Weston (2003, 16), Tomkowicz and Wagon (2016, 31, 308–9),
proved that the decomposition can be achieved with five pieces (but no fewer). For a proof,
see Tomkowicz and Wagon (2016, pp. 66–7).
sth:choice:vitali: Theorem 69.14 (Vitali’s Paradox (in ZFC)). Any circle can be decom-
vitaliparadox
posed into countably many pieces, which can be reassembled (by rotation and
transportation) to form two copies of that circle.
Proof. Writing 0R for the rotation by 0 radians, this is an identity element for
R, since ρ ◦ 0R = 0R ◦ ρ = ρ for any ρ ∈ R.
Every element has an inverse. Where ρ ∈ R rotates by r radians, ρ−1 ∈ R
rotates by 2π − r radians, so that ρ ◦ ρ−1 = 0R .
Composition is associative: (τ ◦ σ) ◦ ρ = τ ◦ (σ ◦ ρ) for any ρ, σ, τ ∈ R
Composition is commutative: σ ◦ ρ = ρ ◦ σ for any ρ, σ ∈ R.
In fact, we can split our group R in half, and then use either half to recover
the whole group:
sth:choice:vitali: Lemma 69.16. There is a partition of R into two disjoint sets, R1 and R2 ,
disjointgroup
both of which are a basis for R.
Proof. Let R1 consist of the rotations by rational radian values in [0, π); let
R2 = R \ R1 . By elementary algebra, {ρ ◦ ρ : ρ ∈ R1 } = R. A similar result
can be obtained for R2 .
8 For a much fuller treatment, see Weston (2003) or Tomkowicz and Wagon (2016).
We will use this fact about groups to establish Theorem 69.14. Let S be
the unit circle, i.e., the set of √
points exactly 1 unit away from the origin of
the plane, i.e., {⟨r, s⟩ ∈ R2 : r2 + s2 = 1}. We will split S into parts by
considering the following relation on S:
That is, the points of S are linked by this relation iff you can get from one to
the other by a rational-valued rotation about the origin. Unsurprisingly:
E = {[r]∼ : r ∈ S},
and let C = ran(f ). For each rotation ρ ∈ R, the set ρ[C] consists of the points
obtained by applying the rotation ρ to each point in C. These next two results
show that these sets cover the circle completely and without overlap:
S
Lemma 69.18. S = ρ∈R ρ[C]. sth:choice:vitali:
vitalicover
Lemma 69.20. There is a partition of S into two disjoint sets, D1 and D2 , sth:choice:vitali:
pseudobanachtarski
such that D1 can be partitioned into countably many sets which can be rotated
to form a copy of S (and similarly for D2 ).
9 Since R is enumerable, each element of E is enumerable. Since S is non-enumerable, it
follows from Lemma 69.18 and Proposition 68.12 that E is non-enumerable. So this is a use
of uncountable Choice.
This immediately entails Vitali’s Paradox. For we can generate two copies
of S from S, just by splitting it up into countably many pieces (the various
ρ[C]’s) and then rigidly moving them (simply rotate each piece of D1 , and first
transport and then rotate each piece of D2 ).
Let’s recap the proof-strategy. We started with some algebraic facts about
the group of rotations on the plane. We used this group to partition S into
equivalence classes. We then arrived at a “paradox”, by using Choice to select
elements from each class.
We use exactly the same strategy to prove Banach–Tarski. The main dif-
ference is that the algebraic facts used to prove Banach–Tarski are significantly
more complicated than those used to prove Vitali’s Paradox. But those alge-
braic facts have nothing to do with Choice. We will summarise them quickly.
To prove Banach–Tarski, we start by establishing an analogue of Lemma 69.16:
any free group can be split into four pieces, which intuitively we can “move
around” to recover two copies of the whole group.10 We then show that we can
use two particular rotations around the origin of R3 to generate a free group of
rotations, F .11 (No Choice yet.) We now regard points on the surface of the
sphere as “similar” iff one can be obtained from the other by a rotation in F .
We then use Choice to select exactly one point from each equivalence class of
“similar” points. Applying our division of F to the surface of the sphere, as
in Lemma 69.20, we split that surface into four pieces, which we can “move
around” to obtain two copies of the surface of the sphere. And this establishes
(Hausdorff, 1914):
Theorem 69.21 (Hausdorff ’s Paradox (in ZFC)). The surface of any sphere
can be decomposed into finitely many pieces, which can be reassembled (by ro-
tation and transportation) to form two disjoint copies of that sphere.
A couple of further algebraic tricks are needed to obtain the full Banach-
Tarski Theorem (which concerns not just the sphere’s surface, but its interior
too). Frankly, however, this is just icing on the algebraic cake. Hence Weston
writes:
10 The fact that we can use four pieces is due to Robinson (1947). For a recent proof, see
Tomkowicz and Wagon (2016, Theorem 5.2). We follow Weston (2003, p. 3) in describing
this as “moving” the pieces of the group.
11 See Tomkowicz and Wagon (2016, Theorem 2.1).
[. . . ] the result on free groups is the key step in the proof of the
Banach-Tarski paradox. From this point of view, the Banach-Tarski
paradox is not a statement about R3 so much as it is a statement
about the complexity of the group [of translations and rotations in
R3 ]. (Weston, 2003, p. 16)
Corollary 69.22 (Vitali). Let µ be a measure such that µ(S) = 1, and such
that µ(X) = µ(Y ) if X and Y are congruent. Then ρ[C] is unmeasurable for
all ρ ∈ R.
Methods
This part covers general and methodological material, especially ex-
planations of various proof methods a non-mathematics student may be
unfamiliar with. It currently contains a chapter on how to write proofs,
and a chapter on induction, but additional sections for those, exercises,
and a chapter on mathematical terminology is also planned.
Chapter 70
Proofs
content/methods/proofs/introduction.tex
70.1 Introduction
mth:prf:int: Based on your experiences in introductory logic, you might be comfortable with
sec
a derivation system—probably a natural deduction or Fitch style derivation
system, or perhaps a proof-tree system. You probably remember doing proofs
in these systems, either proving a formula or show that a given argument is
valid. In order to do this, you applied the rules of the system until you got
the desired end result. In reasoning about logic, we also prove things, but in
most cases we are not using a derivation system. In fact, most of the proofs we
consider are done in English (perhaps, with some symbolic language thrown
in) rather than entirely in the language of first-order logic. When constructing
such proofs, you might at first be at a loss—how do I prove something without
a derivation system? How do I start? How do I know if my proof is correct?
Before attempting a proof, it’s important to know what a proof is and how
to construct one. As implied by the name, a proof is meant to show that
something is true. You might think of this in terms of a dialogue—someone
875
CHAPTER 70. PROOFS
asks you if something is true, say, if every prime other than two is an odd
number. To answer “yes” is not enough; they might want to know why. In this
case, you’d give them a proof.
In everyday discourse, it might be enough to gesture at an answer, or give
an incomplete answer. In logic and mathematics, however, we want rigorous
proof—we want to show that something is true beyond any doubt. This means
that every step in our proof must be justified, and the justification must be
cogent (i.e., the assumption you’re using is actually assumed in the statement
of the theorem you’re proving, the definitions you apply must be correctly
applied, the justifications appealed to must be correct inferences, etc.).
Usually, we’re proving some statement. We call the statements we’re prov-
ing by various names: propositions, theorems, lemmas, or corollaries. A propo-
sition is a basic proof-worthy statement: important enough to record, but
perhaps not particularly deep nor applied often. A theorem is a significant,
important proposition. Its proof often is broken into several steps, and some-
times it is named after the person who first proved it (e.g., Cantor’s Theorem,
the Löwenheim–Skolem theorem) or after the fact it concerns (e.g., the com-
pleteness theorem). A lemma is a proposition or theorem that is used in the
proof of a more important result. Confusingly, sometimes lemmas are impor-
tant results in themselves, and also named after the person who introduced
them (e.g., Zorn’s Lemma). A corollary is a result that easily follows from
another one.
A statement to be proved often contains assumptions that clarify which
kinds of things we’re proving something about. It might begin with “Let φ be
a formula of the form ψ → χ” or “Suppose Γ ⊢ φ” or something of the sort.
These are hypotheses of the proposition, theorem, or lemma, and you may
assume these to be true in your proof. They restrict what we’re proving, and
also introduce some names for the objects we’re talking about. For instance,
if your proposition begins with “Let φ be a formula of the form ψ → χ,”
you’re proving something about all formulas of a certain sort only (namely,
conditionals), and it’s understood that ψ → χ is an arbitrary conditional that
your proof will talk about.
content/methods/proofs/starting-proofs.tex
section). Write these at the top of the page and make sure to flag that they are
assumptions (i.e., if you are assuming p, write “assume that p,” or “suppose
that p”). Finally, there might be some definitions in the question that you
need to know. You might be told to use a specific definition, or there might
be various definitions in the assumptions or conclusion that you are working
towards. Write these down and ensure that you understand what they mean.
How you set up your proof will also be dependent upon the form of the
question. The next section provides details on how to set up your proof based
on the type of sentence.
content/methods/proofs/using-definitions.tex
In order to even start the proof, we need to know what it means for two sets
to be identical; i.e., we need to know what the “=” in that equation means for
sets. Sets are defined to be identical whenever they have the same elements.
So the definition we have to unpack is:
Definition 70.2. Sets A and B are identical, A = B, iff every element of A is
an element of B, and vice versa.
one and the same set, even though we use different letters for it on the left and the right side.
But the ways in which that set is picked out may be different, and that makes the definition
non-trivial.
Problem 70.1. Suppose you are asked to prove that A ∩ B ̸= ∅. Unpack all
the definitions occurring here, i.e., restate this in a way that does not mention
“∩”, “=”, or “∅”.
content/methods/proofs/inference-patterns.tex
The inference often relies on one or two facts we already have available in
our proof—it may be something we have assumed, or something that we’ve
concluded by an inference already. To be clear, we may label these things, and
in the inference we indicate what other statements we’re using in the inference.
An inference will often also contain an explanation of why our new conclusion
follows from the things that come before it. There are some common patterns
of inference that are used very often in proofs; we’ll go through some below.
Some patterns of inference, like proofs by induction, are more involved (and
will be discussed later).
We’ve already discussed one pattern of inference: unpacking, or applying,
a definition. When we unpack a definition, we just restate something that
involves the definiendum by using the definiens. For instance, suppose that we
have already established in the course of a proof that D = E (a). Then we
may apply the definition of = for sets and infer: “Thus, by definition from (a),
every element of D is an element of E and vice versa.”
Somewhat confusingly, we often do not write the justification of an inference
when we actually make it, but before. Suppose we haven’t already proved that
D = E, but we want to. If D = E is the conclusion we aim for, then we
can restate this aim also by applying the definition: to prove D = E we have
to prove that every element of D is an element of E and vice versa. So our
proof will have the form: (a) prove that every element of D is an element of E;
(b) every element of E is an element of D; (c) therefore, from (a) and (b) by
definition of =, D = E. But we would usually not write it this way. Instead
we might write something like,
We want to show D = E. By definition of =, this amounts to
showing that every element of D is an element of E and vice versa.
(a) . . . (a proof that every element of D is an element of E) . . .
(b) . . . (a proof that every element of E is an element of D) . . .
Using a Conjunction
Perhaps the simplest inference pattern is that of drawing as conclusion one of
the conjuncts of a conjunction. In other words: if we have assumed or already
proved that p and q, then we’re entitled to infer that p (and also that q). This
is such a basic inference that it is often not mentioned. For instance, once
we’ve unpacked the definition of D = E we’ve established that every element
of D is an element of E and vice versa. From this we can conclude that every
element of E is an element of D (that’s the “vice versa” part).
Proving a Conjunction
Sometimes what you’ll be asked to prove will have the form of a conjunction;
you will be asked to “prove p and q.” In this case, you simply have to do
two things: prove p, and then prove q. You could divide your proof into two
sections, and for clarity, label them. When you’re making your first notes, you
might write “(1) Prove p” at the top of the page, and “(2) Prove q” in the
middle of the page. (Of course, you might not be explicitly asked to prove a
conjunction but find that your proof requires that you prove a conjunction. For
instance, if you’re asked to prove that D = E you will find that, after unpacking
the definition of =, you have to prove: every element of D is an element of E
and every element of E is an element of D).
Proving a Disjunction
When what you are proving takes the form of a disjunction (i.e., it is an state-
ment of the form “p or q”), it is enough to show that one of the disjuncts is
true. However, it basically never happens that either disjunct just follows from
the assumptions of your theorem. More often, the assumptions of your theorem
are themselves disjunctive, or you’re showing that all things of a certain kind
have one of two properties, but some of the things have the one and others
have the other property. This is where proof by cases is useful (see below).
Conditional Proof
Many theorems you will encounter are in conditional form (i.e., show that
if p holds, then q is also true). These cases are nice and easy to set up—
simply assume the antecedent of the conditional (in this case, p) and prove the
conclusion q from it. So if your theorem reads, “If p then q,” you start your
proof with “assume p” and at the end you should have proved q.
Conditionals may be stated in different ways. So instead of “If p then q,”
a theorem may state that “p only if q,” “q if p,” or “q, provided p.” These all
mean the same and require assuming p and proving q from that assumption.
Recall that a biconditional (“p if and only if (iff) q”) is really two conditionals
put together: if p then q, and if q then p. All you have to do, then, is two
instances of conditional proof: one for the first conditional and another one for
the second. Sometimes, however, it is possible to prove an “iff” statement by
chaining together a bunch of other “iff” statements so that you start with “p”
an end with “q”—but in that case you have to make sure that each step really
is an “iff.”
Universal Claims
Using a universal claim is simple: if something is true for anything, it’s true for
each particular thing. So if, say, the hypothesis of your proof is A ⊆ B, that
means (unpacking the definition of ⊆), that, for every x ∈ A, x ∈ B. Thus, if
you already know that z ∈ A, you can conclude z ∈ B.
Proving a universal claim may seem a little bit tricky. Usually these state-
ments take the following form: “If x has P , then it has Q” or “All P s are Qs.”
Of course, it might not fit this form perfectly, and it takes a bit of practice
to figure out what you’re asked to prove exactly. But: we often have to prove
that all objects with some property have a certain other property.
Proof by Cases
Suppose you have a disjunction as an assumption or as an already established
conclusion—you have assumed or proved that p or q is true. You want to prove
r. You do this in two steps: first you assume that p is true, and prove r, then
you assume that q is true and prove r again. This works because we assume
or know that one of the two alternatives holds. The two steps establish that
either one is sufficient for the truth of r. (If both are true, we have not one
but two reasons for why r is true. It is not necessary to separately prove that
r is true assuming both p and q.) To indicate what we’re doing, we announce
that we “distinguish cases.” For instance, suppose we know that x ∈ B ∪ C.
B ∪ C is defined as {x : x ∈ B or x ∈ C}. In other words, by definition,
x ∈ B or x ∈ C. We would prove that x ∈ A from this by first assuming that
x ∈ B, and proving x ∈ A from this assumption, and then assume x ∈ C, and
again prove x ∈ A from this. You would write “We distinguish cases” under
the assumption, then “Case (1): x ∈ B” underneath, and “Case (2): x ∈ C
halfway down the page. Then you’d proceed to fill in the top half and the
bottom half of the page.
Proof by cases is especially useful if what you’re proving is itself disjunctive.
Here’s a simple example:
have to go into all this detail when you write down your own proofs.
Since x ∈ A, A ̸= ∅.
This relies on the definition of A as {x} and the obvious facts that
x ∈ {x} and x ∈ / ∅.
Let a ∈ A.
It’s maybe good practice to keep bound variables like “x” separate from
hypothetical names like a, like we did. In practice, however, we often don’t
and just use x, like so:
Suppose A ̸= ∅, i.e., there is an x ∈ A. By definition of ∪, x ∈ A∪B.
So A ∪ B ̸= ∅.
However, when you do this, you have to be extra careful that you use different
x’s and y’s for different existential claims. For instance, the following is not a
correct proof of “If A ̸= ∅ and B ̸= ∅ then A ∩ B ̸= ∅” (which is not true).
Suppose A ̸= ∅ and B ̸= ∅. So for some x, x ∈ A and also for some
x, x ∈ B. Since x ∈ A and x ∈ B, x ∈ A ∩ B, by definition of ∩.
So A ∩ B ̸= ∅.
Can you spot where the incorrect step occurs and explain why the result does
not hold?
content/methods/proofs/example-1.tex
70.5 An Example
Our first example is the following simple fact about unions and intersections of mth:prf:ex1:
sec
sets. It will illustrate unpacking definitions, proofs of conjunctions, of universal
claims, and proof by cases.
Proposition 70.8. For any sets A, B, and C, A∪(B ∩C) = (A∪B)∩(A∪C)
This completes the first case of the proof by cases. Now we want
to derive the conclusion in the second case, where z ∈ B ∩ C.
Again, we are working with the intersection of two sets. Let’s apply
the definition of ∩:
Now we just want to show the other direction, that every element of
(A ∪ B) ∩ (A ∪ C) is an element of A ∪ (B ∩ C). As before, we prove
this universal claim by assuming we have an arbitrary element of
the first set and show it must be in the second set. Let’s state what
we’re about to do.
Now for the second case, z ∈ B. Here we’ll unpack the second ∪
and do another proof-by-cases:
Ok, this was a bit weird. We didn’t actually need the assumption
that z ∈ B for this case, but that’s ok.
content/methods/proofs/example-2.tex
We’ve unpacked all the definitions that are given to us in the as-
sumption. Now we can move onto the conclusion. We want to show
that A ∪ (C \ A) = C, and so we set up a proof similarly to the
last example: we show that every element of A ∪ (C \ A) is also
an element of C and, conversely, every element of C is an element
of A ∪ (C \ A). We can shorten this to: A ∪ (C \ A) ⊆ C and
C ⊆ A ∪ (C \ A). (Here we’re doing the opposite of unpacking a
definition, but it makes the proof a bit easier to read.) Since this is
a conjunction, we have to prove both parts. To show the first part,
Here we’ve used the fact recorded earlier which followed from the
hypothesis of the proposition that A ⊆ C. The first case is com-
plete, and we turn to the second case, z ∈ (C \A). Recall that C \A
denotes the difference of the two sets, i.e., the set of all elements
of C which are not elements of A. But any element of C not in A
is in particular an element of C.
Great, we’ve proved the first direction. Now for the second direc-
tion. Here we prove that C ⊆ A ∪ (C \ A). So we assume that z ∈ C
and prove that z ∈ A ∪ (C \ A).
Either z ∈ A or z ∈
/ A. In the former case, z ∈ A ∪ (C \ A). In the latter case,
z ∈ C and z ∈
/ A, so z ∈ C \ A. But then z ∈ A ∪ (C \ A).
content/methods/proofs/proof-by-contradiction.tex
A has no elements iff it’s not the case that there is an x such that x ∈ A.
Since A ⊆ B, x ∈ B.
Proposition 70.11. A ⊆ A ∪ B.
content/methods/proofs/reading-proofs.tex
A ∩ (A ∪ B) = A
This is the first half of the proof of the identity: it establishes that if an
arbitrary z is an element of the left side, it is also an element of the right, i.e.,
A ∩ (A ∪ B) ⊆ A. Assume that z ∈ A ∩ (A ∪ B). Since z is an element of the
intersection of two sets iff it is an element of both sets, we can conclude that
z ∈ A and also z ∈ A ∪ B. In particular, z ∈ A, which is what we wanted
to show. Since that’s all that has to be done for the first half, we know that
the rest of the proof must be a proof of the second half, i.e., a proof that
A ⊆ A ∩ (A ∪ B).
content/methods/proofs/cant-do-it.tex
content/methods/proofs/resources.tex
Motivational Videos
Feel like you have no motivation to do your homework? Feeling down? These
videos might help!
• https://www.youtube.com/watch?v=ZXsQAXx_ao0
• https://www.youtube.com/watch?v=BQ4yd2W50No
• https://www.youtube.com/watch?v=StTqXEQ2l-Y
Chapter 71
Induction
content/methods/induction/introduction.tex
71.1 Introduction
mth:ind:int: Induction is an important proof technique which is used, in different forms, in
sec
almost all areas of logic, theoretical computer science, and mathematics. It is
needed to prove many of the results in logic.
895
CHAPTER 71. INDUCTION
content/methods/induction/induction-on-N.tex
71.2 Induction on N
In its simplest form, induction is a technique used to prove results for all natural mth:ind:inN:
sec
numbers. It uses the fact that by starting from 0 and repeatedly adding 1 we
eventually reach every natural number. So to prove that something is true
for every number, we can (1) establish that it is true for 0 and (2) show that
whenever it is true for a number n, it is also true for the next number n + 1.
If we abbreviate “number n has property P ” by P (n) (and “number k has
property P ” by P (k), etc.), then a proof by induction that P (n) for all n ∈ N
consists of:
1. a proof of P (0), and
2. a proof that, for any k, if P (k) then P (k + 1).
To make this crystal clear, suppose we have both (1) and (2). Then (1) tells us
that P (0) is true. If we also have (2), we know in particular that if P (0) then
P (0 + 1), i.e., P (1). This follows from the general statement “for any k, if P (k)
then P (k + 1)” by putting 0 for k. So by modus ponens, we have that P (1).
From (2) again, now taking 1 for n, we have: if P (1) then P (2). Since we’ve
just established P (1), by modus ponens, we have P (2). And so on. For any
number n, after doing this n times, we eventually arrive at P (n). So (1) and (2)
together establish P (n) for any n ∈ N.
Let’s look at an example. Suppose we want to find out how many different
sums we can throw with n dice. Although it might seem silly, let’s start with
0 dice. If you have no dice there’s only one possible sum you can “throw”:
no dots at all, which sums to 0. So the number of different possible throws
is 1. If you have only one die, i.e., n = 1, there are six possible values, 1
through 6. With two dice, we can throw any sum from 2 through 12, that’s
11 possibilities. With three dice, we can throw any number from 3 to 18, i.e.,
16 different possibilities. 1, 6, 11, 16: looks like a pattern: maybe the answer
is 5n + 1? Of course, 5n + 1 is the maximum possible, because there are only
5n + 1 numbers between n, the lowest value you can throw with n dice (all 1’s)
and 6n, the highest you can throw (all 6’s).
Theorem 71.1. With n dice one can throw all 5n + 1 possible values between
n and 6n.
Proof. Let P (n) be the claim: “It is possible to throw any number between n
and 6n using n dice.” To use induction, we prove:
1. The induction basis P (1), i.e., with just one die, you can throw any
number between 1 and 6.
(1) Is proved by inspecting a 6-sided die. It has all 6 sides, and every
number between 1 and 6 shows up one on of the sides. So it is possible to
throw any number between 1 and 6 using a single die.
To prove (2), we assume the antecedent of the conditional, i.e., P (k). This
assumption is called the inductive hypothesis. We use it to prove P (k + 1). The
hard part is to find a way of thinking about the possible values of a throw of
k + 1 dice in terms of the possible values of throws of k dice plus of throws of
the extra k + 1-st die—this is what we have to do, though, if we want to use
the inductive hypothesis.
The inductive hypothesis says we can get any number between k and 6k
using k dice. If we throw a 1 with our (k + 1)-st die, this adds 1 to the total.
So we can throw any value between k + 1 and 6k + 1 by throwing k dice and
then rolling a 1 with the (k + 1)-st die. What’s left? The values 6k + 2 through
6k + 6. We can get these by rolling k 6s and then a number between 2 and 6
with our (k + 1)-st die. Together, this means that with k + 1 dice we can throw
any of the numbers between k + 1 and 6(k + 1), i.e., we’ve proved P (k + 1)
using the assumption P (k), the inductive hypothesis.
s0 = 0
sn+1 = sn + (n + 1)
s0 = 0,
s1 = s0 + 1 = 1,
s2 = s1 + 2 =1+2=3
s3 = s2 + 3 = 1 + 2 + 3 = 6, etc.
Proof. We have to prove (1) that s0 = 0 · (0 + 1)/2 and (2) if sk = k(k + 1)/2
then sk+1 = (k + 1)(k + 2)/2. (1) is obvious. To prove (2), we assume the
inductive hypothesis: sk = k(k + 1)/2. Using it, we have to show that sk+1 =
(k + 1)(k + 2)/2.
What is sk+1 ? By the definition, sk+1 = sk + (k + 1). By inductive
hypothesis, sk = k(k + 1)/2. We can substitute this into the previous equation,
and then just need a bit of arithmetic of fractions:
k(k + 1)
sk+1 = + (k + 1) =
2
k(k + 1) 2(k + 1)
= + =
2 2
k(k + 1) + 2(k + 1)
= =
2
(k + 2)(k + 1)
= .
2
The important lesson here is that if you’re proving something about some
inductively defined sequence an , induction is the obvious way to go. And even if
it isn’t (as in the case of the possibilities of dice throws), you can use induction
if you can somehow relate the case for k + 1 to the case for k.
content/methods/induction/strong-induction.tex
In the principle of induction discussed above, we prove P (0) and also if P (k),
then P (k + 1). In the second part, we assume that P (k) is true and use this
assumption to prove P (k+1). Equivalently, of course, we could assume P (k−1)
and use it to prove P (k)—the important part is that we be able to carry out
the inference from any number to its successor; that we can prove the claim in
question for any number under the assumption it holds for its predecessor.
There is a variant of the principle of induction in which we don’t just assume
that the claim holds for the predecessor k − 1 of k, but for all numbers smaller
than k, and use this assumption to establish the claim for k. This also gives
us the claim P (n) for all n ∈ N. For once we have established P (0), we have
thereby established that P holds for all numbers less than 1. And if we know
that if P (l) for all l < k, then P (k), we know this in particular for k = 1. So
we can conclude P (1). With this we have proved P (0) and P (1), i.e., P (l) for
all l < 2, and since we have also the conditional, if P (l) for all l < 2, then P (2),
we can conclude P (2), and so on.
In fact, if we can establish the general conditional “for all k, if P (l) for all
l < k, then P (k),” we do not have to establish P (0) anymore, since it follows
from it. For remember that a general claim like “for all l < k, P (l)” is true if
there are no l < k. This is a case of vacuous quantification: “all As are Bs” is
true if there are no As, ∀x (φ(x) → ψ(x)) is true if no x satisfies φ(x). In this
case, the formalized version would be “∀l (l < k → P (l))”—and that is true if
there are no l < k. And if k = 0 that’s exactly the case: no l < 0, hence “for
all l < 0, P (0)” is true, whatever P is. A proof of “if P (l) for all l < k, then
P (k)” thus automatically establishes P (0).
This variant is useful if establishing the claim for k can’t be made to just
rely on the claim for k − 1 but may require the assumption that it is true for
one or more l < k.
content/methods/induction/inductive-definitions.tex
We would like to precisely specify what counts as a “nice term.” First of all,
every letter by itself is nice. Anything that’s not just a letter by itself should
be of the form “[t ◦ s]” where s and t are themselves nice. Conversely, if t and
s are nice, then we can form a new nice term by putting a ◦ between them and
surround them by a pair of brackets. We might use these operations to define
the set of nice terms. This is an inductive definition.
Definition 71.3 (Nice terms). The set of nice terms is inductively defined
as follows:
1. Any letter a, b, c, d is a nice term.
2. If s1 and s2 are nice terms, then so is [s1 ◦ s2 ].
3. Nothing else is a nice term.
This definition tells us that something counts as a nice term iff it can be
constructed according to the two conditions (1) and (2) in some finite number
of steps. In the first step, we construct all nice terms just consisting of letters
by themselves, i.e.,
a, b, c, d
In the second step, we apply (2) to the terms we’ve constructed. We’ll get
for all combinations of two letters. In the third step, we apply (2) again, to
any two nice terms we’ve constructed so far. We get new nice term such as
[a◦[a◦a]]—where t is a from step 1 and s is [a◦a] from step 2—and [[b◦c]◦[d◦b]]
constructed out of the two terms [b ◦ c] and [d ◦ b] from step 2. And so on.
Clause (3) rules out that anything not constructed in this way sneaks into the
set of nice terms.
Note that we have not yet proved that every sequence of symbols that
“feels” nice is nice according to this definition. However, it should be clear that
everything we can construct does in fact “feel nice”: brackets are balanced, and
◦ connects parts that are themselves nice.
The key feature of inductive definitions is that if you want to prove some-
thing about all nice terms, the definition tells you which cases you must con-
sider. For instance, if you are told that t is a nice term, the inductive definition
tells you what t can look like: t can be a letter, or it can be [s1 ◦s2 ] for some pair
of nice terms s1 and s2 . Because of clause (3), those are the only possibilities.
When proving claims about all of an inductively defined set, the strong form
of induction becomes particularly important. For instance, suppose we want
to prove that for every nice term of length n, the number of [ in it is < n/2.
This can be seen as a claim about all n: for every n, the number of [ in any
nice term of length n is < n/2.
Proposition 71.4. For any n, the number of [ in a nice term of length n is
< n/2.
Proof. To prove this result by (strong) induction, we have to show that the
following conditional claim is true:
If for every l < k, any nice term of length l has < l/2 [’s, then any
nice term of length k has < k/2 [’s.
To show this conditional, assume that its antecedent is true, i.e., assume that
for any l < k, nice terms of length l contain < l/2 [’s. We call this assumption
the inductive hypothesis. We want to show the same is true for nice terms of
length k.
So suppose t is a nice term of length k. Because nice terms are inductively
defined, we have two cases: (1) t is a letter by itself, or (2) t is [s1 ◦ s2 ] for some
nice terms s1 and s2 .
2. t is [s1 ◦ s2 ] for some nice terms s1 and s2 . Let’s let l1 be the length
of s1 and l2 be the length of s2 . Then the length k of t is l1 + l2 + 3 (the
lengths of s1 and s2 plus three symbols [, ◦, ]). Since l1 + l2 + 3 is always
greater than l1 , l1 < k. Similarly, l2 < k. That means that the induction
hypothesis applies to the terms s1 and s2 : the number m1 of [ in s1 is
< l1 /2, and the number m2 of [ in s2 is < l2 /2.
The number of [ in t is the number of [ in s1 , plus the number of [ in s2 ,
plus 1, i.e., it is m1 + m2 + 1. Since m1 < l1 /2 and m2 < l2 /2 we have:
l1 l2 l1 + l2 + 2 l1 + l2 + 3
m1 + m2 + 1 < + +1= < = k/2.
2 2 2 2
In each case, we’ve shown that the number of [ in t is < k/2 (on the basis of
the inductive hypothesis). By strong induction, the proposition follows.
content/methods/induction/structural-induction.tex
Proof. We use structural induction. Nice terms are inductively defined, with
letters as initial objects and the operation o for constructing new nice terms
out of old ones.
1. The claim is true for every letter, since the number of [ in a letter by
itself is 0 and the number of ] in it is also 0.
2. Suppose the number of [ in s1 equals the number of ], and the same is
true for s2 . The number of [ in o(s1 , s2 ), i.e., in [s1 ◦ s2 ], is the sum of
the number of [ in s1 and s2 plus one. The number of ] in o(s1 , s2 ) is the
sum of the number of ] in s1 and s2 plus one. Thus, the number of [ in
o(s1 , s2 ) equals the number of ] in o(s1 , s2 ).
Problem 71.2. Prove by structural induction that no nice term starts with ].
mth:ind:sti: Proposition 71.6. Every proper initial segment of a nice term t has more
prop:initial
[’s than ]’s.
Proof. By induction on t:
content/methods/induction/relations.tex
This definition, for instance, will tell us that a ⊑ [b ◦ a]. For (2) says that
a ⊑ [b ◦ a] iff a = [b ◦ a], or a ⊑ b, or a ⊑ a. The first two are false: a clearly
isn’t identical to [b◦a], and by (1), a ⊑ b iff a = b, which is also false. However,
also by (1), a ⊑ a iff a = a, which is true.
It’s important to note that the success of this definition depends on a fact
that we haven’t proved yet: every nice term t is either a letter by itself, or there
are uniquely determined nice terms s1 and s2 such that t = [s1 ◦ s2 ]. “Uniquely
determined” here means that if t = [s1 ◦ s2 ] it isn’t also = [r1 ◦ r2 ] with s1 ̸= r1
or s2 ̸= r2 . If this were the case, then clause (2) may come in conflict with
itself: reading t2 as [s1 ◦ s2 ] we might get t1 ⊑ t2 , but if we read t2 as [r1 ◦ r2 ]
we might get not t1 ⊑ t2 . Before we prove that this can’t happen, let’s look at
an example where it can happen.
Definition 71.8. Define bracketless terms inductively by
1. Every letter is a bracketless term.
2. If s1 and s2 are bracketless terms, then s1 ◦ s2 is a bracketless term.
3. Nothing else is a bracketless term.
s1 = b and s2 = a ◦ b.
r1 = b ◦ a and r2 = b.
We can also define functions inductively: e.g., we can define the function f
that maps any nice term to the maximum depth of nested [. . . ] in it as follows:
mth:ind:rel: Definition 71.10. The depth of a nice term, f (t), is defined inductively as
defn:depth
follows: (
0 if t is a letter
f (t) =
max(f (s1 ), f (s2 )) + 1 if t = [s1 ◦ s2 ].
For instance
f ([a ◦ b]) = max(f (a), f (b)) + 1 =
= max(0, 0) + 1 = 1, and
f ([[a ◦ b] ◦ c]) = max(f ([a ◦ b]), f (c)) + 1 =
= max(1, 0) + 1 = 2.
Here, of course, we assume that s1 an s2 are nice terms, and make use of
the fact that every nice term is either a letter or of the form [s1 ◦ s2 ]. It is again
important that it can be of this form in only one way. To see why, consider
again the bracketless terms we defined earlier. The corresponding “definition”
would be: (
0 if t is a letter
g(t) =
max(g(s1 ), g(s2 )) + 1 if t = s1 ◦ s2 .
Now consider the bracketless term a ◦ b ◦ c ◦ d. It can be read in more than one
way, e.g., as s1 ◦ s2 with
s1 = a and s2 = b ◦ c ◦ d,
or as r1 ◦ r2 with
r1 = a ◦ b and r2 = c ◦ d.
Calculating g according to the first way of reading it would give
g(s1 ◦ s2 ) = max(g(a), g(b ◦ c ◦ d)) + 1 =
= max(0, 2) + 1 = 3
History
Chapter 72
Biographies
content/history/biographies/georg-cantor.tex
906
72.2. ALONZO CHURCH
life, Cantor suffered from mental illness. Beginning in 1894, and more fre-
quently towards his later years, Cantor was hospitalized. The heavy criticism
of his work, including a falling out with the mathematician Leopold Kronecker,
led to depression and a lack of interest in mathematics. During depressive
episodes, Cantor would turn to philosophy and literature, and even published
a theory that Francis Bacon was the author of Shakespeare’s plays.
Cantor died on January 6, 1918, in a sanatorium in Halle.
Further Reading For full biographies of Cantor, see Dauben (1990) and
Grattan-Guinness (1971). Cantor’s radical views are also described in the
BBC Radio 4 program A Brief History of Mathematics (du Sautoy, 2014). If
you’d like to hear about Cantor’s theories in rap form, see Rose (2012).
content/history/biographies/alonzo-church.tex
Church continued his work into old age. In 1967 he left Princeton for UCLA,
where he was professor until his retirement in 1990. Church passed away on
August 1, 1995 at the age of 92.
content/history/biographies/gerhard-gentzen.tex
loyalties lay with the Nazi party, or whether he joined the party in order to
ensure academic success.
In 1943, Gentzen was offered an academic position at the Mathematical
Institute of the German University of Prague, which he accepted. However, in
1945 the citizens of Prague revolted against German occupation. Soviet forces
arrived in the city and arrested all the professors at the university. Because of
his membership in Nazi organizations, Gentzen was taken to a forced labour
camp. He died of malnutrition while in his cell on August 4, 1945 at the age
of 35.
content/history/biographies/kurt-goedel.tex
1929). Only a year later, he obtained his most famous results—the first and
second incompleteness theorems (published in Gödel 1931). During his time
in Vienna, Gödel was heavily involved with the Vienna Circle, a group of
scientifically-minded philosophers that included Carnap, whose work was espe-
cially influenced by Gödel’s results.
In 1938, Gödel married Adele Nimbursky. His parents were not pleased: not
only was she six years older than him and already divorced, but she worked as
a dancer in a nightclub. Social pressures did not affect Gödel, however, and
they remained happily married until his death.
After Nazi Germany annexed Austria in 1938, Gödel and Adele emigrated
to the United States, where he took up a position at the Institute for Advanced
Study in Princeton, New Jersey. Despite his introversion and eccentric nature,
Gödel’s time at Princeton was collaborative and fruitful. He published essays
in set theory, philosophy and physics. Notably, he struck up a particularly
strong friendship with his colleague at the IAS, Albert Einstein.
In his later years, Gödel’s mental health deteriorated. His wife’s hospi-
talization in 1977 meant she was no longer able to cook his meals for him.
Having suffered from mental health issues throughout his life, he succumbed
to paranoia. Deathly afraid of being poisoned, Gödel refused to eat. He died
of starvation on January 14, 1978, in Princeton.
content/history/biographies/emmy-noether.tex
in 1904, when their policy was updated to allow female students. She received
her doctorate in mathematics in 1907.
Despite her qualifications, Noether
experienced much resistance during her
career. From 1908–1915, she taught
at Erlangen without pay. During this
time, she caught the attention of David
Hilbert, one of the world’s foremost
mathematicians of the time, who invited
her to Göttingen. However, women were
prohibited from obtaining professorships,
and she was only able to lecture under
Hilbert’s name, again without pay. Dur-
ing this time she proved what is now
known as Noether’s theorem, which is
still used in theoretical physics today.
Noether was finally granted the right to
teach in 1919. Hilbert’s response to con-
tinued resistance of his university col-
leagues reportedly was: “Gentlemen, the
faculty senate is not a bathhouse.” Figure 72.5: Emmy Noether
In the later 1920s, she concentrated
on work in abstract algebra, and her contributions revolutionized the field.
In her proofs she often made use of the so-called ascending chain condition,
which states that there is no infinite strictly increasing chain of certain sets.
For instance, certain algebraic structures now known as Noetherian rings have
the property that there are no infinite sequences of ideals I1 ⊊ I2 ⊊ . . . . The
condition can be generalized to any partial order (in algebra, it concerns the
special case of ideals ordered by the subset relation), and we can also consider
the dual descending chain condition, where every strictly decreasing sequence
in a partial order eventually ends. If a partial order satisfies the descending
chain condition, it is possible to use induction along this order in a similar way
in which we can use induction along the < order on N. Such orders are called
well-founded or Noetherian, and the corresponding proof principle Noetherian
induction.
Noether was Jewish, and when the Nazis came to power in 1933, she was
dismissed from her position. Luckily, Noether was able to emigrate to the
United States for a temporary position at Bryn Mawr, Pennsylvania. During
her time there she also lectured at Princeton, although she found the university
to be unwelcoming to women (Dick, 1981, 81). In 1935, Noether underwent an
operation to remove a uterine tumour. She died from an infection as a result
of the surgery, and was buried at Bryn Mawr.
Further Reading For a biography of Noether, see Dick (1981). The Perime-
ter Institute for Theoretical Physics has their lectures on Noether’s life and
influence available online (Institute, 2015). If you’re tired of reading, Stuff You
Missed in History Class has a podcast on Noether’s life and influence (Frey
and Wilson, 2015). The collected works of Noether are available in the original
German (Jacobson, 1983).
content/history/biographies/rozsa-peter.tex
properly, the Ackermann–Péter function. She wrote the first book on recursive
function theory (Péter, 1951).
Despite the importance and influence of her work, Péter did not obtain a
full-time teaching position until 1945. During the Nazi occupation of Hungary
during World War II, Péter was not allowed to teach due to anti-Semitic laws.
In 1944 the government created a Jewish ghetto in Budapest; the ghetto was
cut off from the rest of the city and attended by armed guards. Péter was
forced to live in the ghetto until 1945 when it was liberated. She then went on
to teach at the Budapest Teachers Training College, and from 1955 onward at
Eötvös Loránd University. She was the first female Hungarian mathematician
to become an Academic Doctor of Mathematics, and the first woman to be
elected to the Hungarian Academy of Sciences.
Péter was known as a passionate teacher of mathematics, who preferred
to explore the nature and beauty of mathematical problems with her students
rather than to merely lecture. As a result, she was affectionately called “Aunt
Rosa” by her students. Péter died in 1977 at the age of 71.
Further Reading For more biographical reading, see (O’Connor and Robert-
son, 2014) and (Andrásfai, 1986). Tamassy (1994) conducted a brief interview
with Péter. For a fun read about mathematics, see Péter’s book Playing With
Infinity (Péter, 2010).
content/history/biographies/julia-robinson.tex
awards in mathematics and the sciences. She started her university career
at San Diego State College, and transferred to the University of California,
Berkeley, as a senior. There she was influenced by the mathematician Raphael
Robinson. They became good friends, and married in 1941. As a spouse of a
faculty member, Robinson was barred from teaching in the mathematics de-
partment at Berkeley. Although she continued to audit mathematics classes,
she hoped to leave university and start a family. Not long after her wedding,
however, Robinson contracted pneumonia. She was told that there was sub-
stantial scar tissue build up on her heart due to the rheumatic fever she suffered
as a child. Due to the severity of the scar tissue, the doctor predicted that she
would not live past forty and she was advised not to have children (Reid, 1986,
13).
Robinson was depressed for a long time, but eventually decided to continue
studying mathematics. She returned to Berkeley and completed her PhD in
1948 under the supervision of Alfred Tarski. The first-order theory of the real
numbers had been shown to be decidable by Tarski, and from Gödel’s work
it followed that the first-order theory of the natural numbers is undecidable.
It was a major open problem whether the first-order theory of the rationals is
decidable or not. In her thesis (1949), Robinson proved that it was not.
Interested in decision problems, Robinson next attempted to find a solu-
tion to Hilbert’s tenth problem. This problem was one of a famous list of
23 mathematical problems posed by David Hilbert in 1900. The tenth prob-
lem asks whether there is an algorithm that will answer, in a finite amount of
time, whether or not a polynomial equation with integer coefficients, such as
3x2 − 2y + 3 = 0, has a solution in the integers. Such questions are known
as Diophantine problems. After some initial successes, Robinson joined forces
with Martin Davis and Hilary Putnam, who were also working on the problem.
They succeeded in showing that exponential Diophantine problems (where the
unknowns may also appear as exponents) are undecidable, and showed that
a certain conjecture (later called “J.R.”) implies that Hilbert’s tenth problem
is undecidable (Davis et al., 1961). Robinson continued to work on the prob-
lem throughout the 1960s. In 1970, the young Russian mathematician Yuri
Matijasevich finally proved the J.R. hypothesis. The combined result is now
called the Matijasevich–Robinson–Davis–Putnam theorem, or MRDP theorem
for short. Matijasevich and Robinson became friends and collaborated on sev-
eral papers. In a letter to Matijasevich, Robinson once wrote that “actually I
am very pleased that working together (thousands of miles apart) we are obvi-
ously making more progress than either one of us could alone” (Matijasevich,
1992, 45).
Robinson was the first female president of the American Mathematical So-
ciety, and the first woman to be elected to the National Academy of Science.
She died on July 30, 1985 at the age of 65 after being diagnosed with leukemia.
content/history/biographies/bertrand-russell.tex
survivors were those sitting in the smoking section. As such, Russell claimed
that he owed his life to smoking. Russell was married four times, but had a
reputation for carrying on extra-marital affairs. He died on February 2, 1970
at the age of 97 in Penrhyndeudraeth, Wales.
content/history/biographies/alfred-tarski.tex
Before emigrating to the United States in 1939, Tarski completed some of his
most important work while working as a secondary school teacher in Warsaw.
His work on logical consequence and logical truth were written during this
time. In 1939, Tarski was visiting the United States for a lecture tour. During
his visit, Germany invaded Poland, and because of his Jewish heritage, Tarski
could not return. His wife and children remained in Poland until the end of the
war, but were then able to emigrate to the United States as well. Tarski taught
at Harvard, the College of the City of New York, and the Institute for Advanced
Study at Princeton, and finally the University of California, Berkeley. There
he founded the multidisciplinary program in Logic and the Methodology of
Science. Tarski died on October 26, 1983 at the age of 82.
Further Reading For more on Tarski’s life, see the biography Alfred Tarski:
Life and Logic (Feferman and Feferman, 2004). Tarski’s seminal works on
logical consequence and truth are available in English in (Corcoran, 1983). All
of Tarski’s original works have been collected into a four volume series, (Tarski,
1981).
content/history/biographies/alan-turing.tex
content/history/biographies/ernst-zermelo.tex
The later years of Zermelo’s life were marked by isolation. After his dis-
missal in 1935, he abandoned mathematics. He moved to the country where
he lived modestly. He married in 1944, and became completely dependent on
his wife as he was going blind. Zermelo lost his sight completely by 1951. He
passed away in Günterstal, Germany, on May 21, 1953.
919
CHAPTER 73. HISTORY AND MYTHOLOGY OF SET THEORY
Chapter 73
This chapter includes the historical prelude from Tim Button’s Open
Set Theory text.
content/history/set-theory/infinitesimals.tex
Here is a vivid way to illustrate the idea. Consider the function f (x) =
x2/4 + 1/2, depicted in black below:
f (x)
5
x
1 2 3 4
f (1/2 + β) − f (1/2)
.
β
So the gradient of our red triangle, with base length 3, is exactly 1. The
hypotenuse of a smaller triangle, the blue triangle with base length 2, gives
a better approximation; its gradient is 3/4. A yet smaller triangle, the green
triangle with base length 1, gives a yet better approximation; with gradient
1/2.
f (c + β) − f (c)
f ′ (c) = where β is infinitesimal.
β
I admit that signs may be made to denote either any thing or noth-
ing: and consequently that in the original notation c + β, β might
content/history/set-theory/limits.tex
In the 19th century, building upon earlier work by Cauchy, Weierstrass offered
a perfectly rigorous definition of this expression. The idea is indeed that we
can make g(x) as close as we like to ℓ, by making x suitably close to c. More
precisely, we stipulate that limx→c g(x) = ℓ will mean:
(∀ε > 0)(∃δ > 0)∀x (|x − c| < δ → |g(x) − ℓ| < ε) .
The vertical bars here indicate absolute magnitude. That is, |x| = x when
x ≥ 0, and |x| = −x when x < 0; you can depict that function as follows:
|x|
x
−2 −1 1 2
So the definition says roughly this: you can make your “error” less than ε (i.e.,
|g(x) − ℓ| < ε) by choosing arguments which are no more than δ away from c
(i.e., |x − c| < δ).
Having defined the notion of a limit, we can use it to avoid infinitesimals
altogether, stipulating that the gradient of f at c is given by:
′ f (c + x) − f (c)
f (c) = lim where a limit exists.
x→0 x
It is important, though, to realise why our definition needs the caveat “where
a limit exists”. To take a simple example, consider f (x) = |x|, whose graph we
just saw. Evidently, f ′ (0) is ill-defined: if we approach 0 “from the right”, the
gradient is always 1; if we approach 0 “from the left”, the gradient is always
−1; so the limit is undefined. As such, we might add that a function f is
differentiable at x iff such a limit exists.
We have seen how to handle differentiation using the notion of a limit. We
can use the same notion to define the idea of a continuous function. (Bolzano
had, in effect, realised this by 1817.) The Cauchy–Weierstrass treatment of
continuity is as follows. Roughly: a function f is continuous (at a point)
provided that, if you demand a certain amount of precision concerning the
output of the function, you can guarantee this by insisting upon a certain
amount of precision concerning the input of the function. More precisely: f
is continuous at c provided that, as x tends to zero, the difference between
f (c + x) and f (c) itself tends to 0. Otherwise put: f is continuous at c iff
f (c) = limx→c f (x).
To go any further would just lead us off into real analysis, when our subject
matter is set theory. So now we should pause, and state the moral. During
the 19th century, mathematicians learnt how to do without infinitesimals, by
invoking a rigorously defined notion of a limit.
content/history/set-theory/pathologies.tex
73.3 Pathologies
his:set:pathology: However, the definition of a limit turned out to allow for some rather “patho-
sec
logical” constructions.
But, in 1877, Cantor proved that he had been wrong. In fact, a line and a square
have exactly the same number of points. He wrote on 29 June 1877 to Dedekind
“je le vois, mais je ne le crois pas”; that is, “I see it, but I don’t believe it”.
In the “received history” of mathematics, this is often taken to indicate just
how literally incredible these new results were to the mathematicians of the
time. (The correspondence is presented in Gouvêa (2011), and we return to it
in section 73.4. Cantor’s proof is outlined in section 73.5.)
Inspired by Cantor’s result, Peano started to consider whether it might be
possible to map a line smoothly onto a plane. This would be a curve which
fills space. In 1890, Peano constructed just such a curve. This is truly counter-
intuitive: Euclid had defined a line as “breadthless length” (Book I, Definition
2), but Peano had shown that, by curling up a line appropriately, its length
can be turned into breadth. In 1891, Hilbert described a slightly more intuitive
space-filling curve, together with some pictures illustrating it. The curve is
constructed in sequence, and here are the first six stages of the construction:
content/history/set-theory/mythology.tex
Cantor knew his result was “so unexpected, so new”. But it is doubtful that he
ever found his result unbelievable. As Gouvêa points out, he was simply asking
Dedekind to check the proof he had offered.
On the question of geometric intuition: Peano published his space-filling
curve without including any diagrams. But when Hilbert published his curve,
he explained his purpose: he would provide readers with a clear way to un-
derstand Peano’s result, if they “help themselves to the following geometric
intuition”; whereupon he included a series of diagrams just like those provided
in section 73.3.
More generally: whilst diagrams have fallen rather out of fashion in pub-
lished proofs, there is no getting round the fact that mathematicians frequently
use diagrams when proving things. (Roughly put: good mathematicians know
when they can rely upon geometric intuition.)
In short: don’t believe the hype; or at least, don’t just take it on trust. For
more on this, you could read Giaquinto (2007).
content/history/set-theory/cantor-plane.tex
Proof: first part.. Fix a, b ∈ L. Write them in binary notation, so that we have
infinite sequences of 0s and 1s, a1 , a2 , . . . , and b1 , b2 , . . . , such that:
a = 0.a1 a2 a3 a4 . . .
b = 0.b1 b2 b3 b4 . . .
f (a, b) = 0.a1 b1 a2 b2 a3 b3 a4 b4 . . .
Unfortunately, as Dedekind pointed out to Cantor, this does not answer the
original question. Consider 0.1̇0̇ = 0.1010101010 . . .. We need that f (a, b) =
0.1̇0̇, where:
a = 0.1̇1̇ = 0.111111 . . .
b=0
But of course, Cantor could not complete the last line in these terms, for
the Schröder-Bernstein Theorem was not yet proved. Indeed, although Cantor
would subsequently formulate this as a general conjecture, it was not satisfac-
torily proved until 1897. (And so, later in 1877, Cantor offered a different proof
of Theorem 73.1, which did not go via Schröder–Bernstein.)
content/history/set-theory/hilbert-curve.tex
of the red parts of the curves below. This makes it slightly easier to check that the curve is
continuous.
The different colours will help explain how h2 was constructed. We first place
scaled-down copies of the non-red bit of h1 into the bottom left, top left, top
right, and bottom right of our square (drawn in black). We then connect these
four figures (with green lines). Finally, we connect our figure to the boundary
of the square (with red lines).
Now to h3 . Just as h2 was made from four connected, scaled-down copies
of the non-red bit of h1 , so h3 is made up of four scaled-down copies of the
non-red bit of h2 (drawn in black), which are then joined together (with green
lines) and finally connected to the boundary of the square (with red lines).
And now we see the general pattern for defining hn+1 from hn . At last we define
the curve h itself by considering the point-by-point limit of these successive
functions h1 , h2 , . . . That is, for each x ∈ S:
We now show that this curve fills space. When we draw the curve hn , we
impose a 2n × 2n grid onto S. By Pythagoras’s Theorem, the diagonal of each
grid-location is of length:
q
2 2 1
(1/2n ) + (1/2n ) = 2( 2 −n)
That is: every point in S is 0 distance from h. In other words, every point of
S lies on the curve. So h fills space!
It remains to show that h is, indeed, a curve. To show this, we must define
the notion. The modern definition builds on one given by Jordan in 1887 (i.e.,
only a few years before the first space-filling curve was provided):
This is fairly intuitive: a curve is, intuitively, a “smooth” map which takes
a canonical line onto the plane R2 . Our function, h, is indeed a map from L
to R2 . So, we just need to show that h is continuous. We defined continuity
in section 73.2 using ε/δ notation. In the vernacular, we want to establish
the following: If you specify a point p in S, together with any desired level of
precision ε, we can find an open section of L such that, given any x in that
open section, h(x) is within ε of p.
So: assume that you have specified p and ε. This is, in effect, to draw a
circle with centre p and radius ε on S. (The circle might spill off the edge of S,
but that doesn’t matter.) Now, recall that, when describing the function hn ,
we drew a 2n × 2n grid upon S. It is obvious that, no matter how small ε is,
there is some n such that some individual grid-location of the 2n × 2n grid on
S lies wholly within the circle with centre p and radius ε.
So, take that n, and let I be the largest open part of L which hn maps
wholly into the relevant grid location. (It is clear that (a, b) exists, since we
already noted that hn passes through every grid-location in the 2n × 2n grid.)
It now suffices to show to show that, whenever x ∈ I the point h(x) lies in that
same grid-location. And to do this, it suffices to show that hm (x) lies in that
same grid location, for any m > n. But this is obvious. If we consider what
happens with hm for m > n, we see that exactly the “same part” of the unit
interval is mapped into the same grid-location; we just map it into that region
in an increasingly stretched-out, wiggly fashion.
Reference
Chapter 74
Alpha α A Nu ν N
Beta β B Xi ξ Ξ
Gamma γ Γ Omicron o O
Delta δ ∆ Pi π Π
Epsilon ε E Rho ρ P
Zeta ζ Z Sigma σ Σ
Eta η H Tau τ T
Theta θ Θ Upsilon υ Υ
Iota ι I Phi φ Φ
Kappa κ K Chi χ X
Lambda λ Λ Psi ψ Ψ
Mu µ M Omega ω Ω
930
Chapter 75
A A a a N N n n
B B b b O O o o
C C c c P P p p
D D d d Q Q q q
E E e e R R r r
F F f f S S s s
G G g g T T t t
H H h h U U u u
I I i i V V v v
J J j j W W w w
K K k k X X x x
L L l l Y Y y y
M M m m Z Z z z
Photo Credits
931
any other use.
Gerhard Gentzen, p. 908: Portrait of Gerhard Gentzen playing ping-pong
courtesy of Ekhart Mentzler-Trott.
Kurt Gödel, p. 909: Portrait of Kurt Gödel, ca. 1925, photographer un-
known. From the Shelby White and Leon Levy Archives Center, Institute for
Advanced Study, Princeton, NJ, USA, on deposit at Princeton University Li-
brary, Manuscript Division, Department of Rare Books and Special Collections,
Kurt Gödel Papers, (C0282), Box 14b, #110000. The Open Logic Project has
obtained permission from the Institute’s Archives Center to use this image
for inclusion in non-commercial OLP-derived materials. Permission from the
Archives Center is required for any other use.
Emmy Noether, p. 911: Portrait of Emmy Noether, ca. 1922, courtesy of
the Abteilung für Handschriften und Seltene Drucke, Niedersächsische Staats-
und Universitätsbibliothek Göttingen, Cod. Ms. D. Hilbert 754, Bl. 14 Nr. 73.
Restored from an original scan by Joel Fuller.
Rózsa Péter, p. 912: Portrait of Rózsa Péter, undated, photographer un-
known. Courtesy of Béla Andrásfai.
Julia Robinson, p. 913: Portrait of Julia Robinson, unknown photographer,
courtesy of Neil D. Reid. The Open Logic Project has obtained permission to
use this image for inclusion in non-commercial OLP-derived materials. Per-
mission is required for any other use.
Bertrand Russell, p. 915: Portrait of Bertrand Russell, ca. 1907, courtesy of
the William Ready Division of Archives and Research Collections, McMaster
University Library. Bertrand Russell Archives, Box 2, f. 4.
Alfred Tarski, p. 916: Passport photo of Alfred Tarski, 1939. Cropped and
restored from a scan of Tarski’s passport by Joel Fuller. Original courtesy
of Bancroft Library, University of California, Berkeley. Alfred Tarski Papers,
Banc MSS 84/49. The Open Logic Project has obtained permission to use
this image for inclusion in non-commercial OLP-derived materials. Permission
from Bancroft Library is required for any other use.
Alan Turing, p. 918: Portrait of Alan Mathison Turing by Elliott & Fry, 29
March 1951, NPG x82217, © National Portrait Gallery, London. Used under
a Creative Commons BY-NC-ND 3.0 license.
Ernst Zermelo, p. 919: Portrait of Ernst Zermelo, ca. 1922, courtesy of the
Abteilung für Handschriften und Seltene Drucke, Niedersächsische Staats- und
932
BIBLIOGRAPHY
Bibliography
Banach, Stefan and Alfred Tarski. 1924. Sur la décomposition des ensembles
de points en parties respectivement congruentes. Fundamenta Mathematicae
6: 244–77.
Benacerraf, Paul. 1965. What numbers could not be. The Philosophical Review
74(1): 47–73.
Boolos, George. 1971. The iterative conception of set. The Journal of Philos-
ophy 68(8): 215–31.
Boolos, George. 2000. Must we believe in set theory? In Between Logic and
Intuition: Essays in Honor of Charles Parsons, eds. Gila Sher and Richard
Tieszen, 257–68. Cambridge: Cambridge University Press.
Button, Tim. 2021. Level theory, part 1: Axiomatizing the bare idea of a
cumulative hierarchy of sets. The Bulletin of Symbolic Logic 27(4): 436–460.
Cantor, Georg. 1878. Ein Beitrag zur Mannigfaltigkeitslehre. Journal für die
reine und angewandte Mathematik 84: 242–58.
Feferman, Anita and Solomon Feferman. 2004. Alfred Tarski: Life and Logic.
Cambridge: Cambridge University Press.
Feferman, Solomon. 1994. Julia Bowman Robinson 1919–1985. Biograph-
ical Memoirs of the National Academy of Sciences 63: 1–28. URL
http://www.nasonline.org/publications/biographical-memoirs/
memoir-pdfs/robinson-julia.pdf.
Feferman, Solomon, John W. Dawson Jr., Stephen C. Kleene, Gregory H.
Moore, Robert M. Solovay, and Jean van Heijenoort. 1986. Kurt Gödel:
Collected Works. Vol. 1: Publications 1929–1936. Oxford: Oxford Univer-
sity Press.
Frege, Gottlob. 1884. Die Grundlagen der Arithmetik: Eine logisch mathema-
tische Untersuchung über den Begriff der Zahl. Breslau: Wilhelm Koebner.
Translation in Frege (1953).
Frege, Gottlob. 1953. Foundations of Arithmetic, ed. J. L. Austin. Oxford:
Basil Blackwell & Mott, 2nd ed.
Frey, Holly and Tracy V. Wilson. 2015. Stuff you missed in history class:
Emmy Noether, mathematics trailblazer. URL https://www.iheart.
com/podcast/stuff-you-missed-in-history-cl-21124503/episode/
emmy-noether-mathematics-trailblazer-30207491/. Podcast audio.
Gödel, Kurt. 1929. Über die Vollständigkeit des Logikkalküls [On the com-
pleteness of the calculus of logic]. Dissertation, Universität Wien. Reprinted
and translated in Feferman et al. (1986), pp. 60–101.
Gödel, Kurt. 1931. über formal unentscheidbare Sätze der Principia Mathe-
matica und verwandter Systeme I [On formally undecidable propositions of
Principia Mathematica and related systems I]. Monatshefte für Mathematik
und Physik 38: 173–198. Reprinted and translated in Feferman et al. (1986),
pp. 144–195.
Gödel, Kurt. 1938. The consistency of the axiom of choice and the generalized
continuum hypothesis. Proceedings of the National Academy of Sciences of
the United States of America 50: 1143–8.
Hausdorff, Felix. 1914. Bemerkung über den Inhalt von Punktmengen. Math-
ematische Annalen 75: 428–34.
Heijenoort, Jean van. 1967. From Frege to Gödel: A Source Book in Mathe-
matical Logic, 1879–1931. Cambridge, MA: Harvard University Press.
Hilbert, David. 1891. Über die stetige Abbildung einer Linie auf ein
Flächenstück. Mathematische Annalen 38(3): 459–460.
Maddy, Penelope. 1988b. Believing the axioms II. The Journal of Symbolic
Logic 53(3): 736–64.
Montague, Richard. 1965. Set theory and higher-order logic. In Formal systems
and recursive functions, eds. John Crossley and Michael Dummett, 131–48.
Amsterdam: North-Holland. Proceedings of the Eight Logic Colloquium,
July 1963.
O’Connor, John J. and Edmund F. Robertson. 2014. Rózsa Péter. URL http:
//www-groups.dcs.st-and.ac.uk/~history/Biographies/Peter.html.
Peano, Giuseppe. 1890. Sur une courbe, qui remplit toute une aire plane.
Mathematische Annalen 36(1): 157–60.
Péter, Rózsa. 1935a. Über den Zusammenhang der verschiedenen Begriffe der
rekursiven Funktion. Mathematische Annalen 110: 612–632.
Potter, Michael. 2004. Set Theory and its Philosophy. Oxford: Oxford Univer-
sity Press.
Scott, Dana. 1974. Axiomatizing set theory. In Axiomatic Set Theory II, ed.
Thomas Jech, 207–14. American Mathematical Society. Proceedings of the
Symposium in Pure Mathematics of the American Mathematical Society,
July–August 1967.
Segal, Sanford L. 2014. Mathematicians under the Nazis. Princeton: Princeton
University Press.
Shoenfield, Joseph R. 1977. Axioms of set theory. In Handbook of Mathematical
Logic, ed. Jon Barwise, 321–44. London: North-Holland.
Sigmund, Karl, John Dawson, Kurt Mühlberger, Hans Magnus Enzensberger,
and Juliette Kennedy. 2007. Kurt Gödel: Das Album–The Album. The
Mathematical Intelligencer 29(3): 73–76.
Skolem, Thoralf. 1922. Einige Bemerkungen zur axiomatischen Begründung
der Mengenlehre. In Wissenschaftliche Vorträge gehalten auf dem fünften
Kongress der skandanivschen Mathematiker in Helsingfors vom 4. bis zum
7. Juli 1922, 137–52. Akademiska Bokhandeln.
Solow, Daniel. 2013. How to Read and Do Proofs. Hoboken, NJ: Wiley.
Steinhart, Eric. 2018. More Precisely: The Math You Need to Do Philosophy.
Peterborough, ON: Broadview, 2nd ed.
Sykes, Christopher. 1992. BBC Horizon: The strange life and death of Dr. Tur-
ing. URL https://www.youtube.com/watch?v=gyusnGbBSHE.
Szabo, Manfred E. 1969. The Collected Papers of Gerhard Gentzen. Amster-
dam: North-Holland.
Takeuti, Gaisi, Nicholas Passell, and Mariko Yasugi. 2003. Memoirs of a Proof
Theorist: Gödel and Other Logicians. Singapore: World Scientific.
Tamassy, Istvan. 1994. Interview with Róza Péter. Modern Logic 4(3): 277–
280.
Tarski, Alfred. 1981. The Collected Works of Alfred Tarski, vol. I–IV. Basel:
Birkhäuser.