Table Of ContentI n t r oducti
y o
l n
d
t
n
o
e
i
r
F
Mathematical
A
Logic
2nd Edition
Christopher C. Leary
Lars Kristiansen
A Friendly Introduction
to Mathematical Logic
A Friendly Introduction
to Mathematical Logic
2nd Edition
Second printing
With corrections and some renumbered exercises
Christopher C. Leary
State University of New York
College at Geneseo
Lars Kristiansen
The University of Oslo
Milne Library, SUNY Geneseo, Geneseo, NY
(cid:13)c2015 Christopher C. Leary and Lars Kristiansen
ISBN: 978-1-942341-07-9
Milne Library
SUNY Geneseo
One College Circle
Geneseo, NY 14454
Lars Kristiansen has received financial support from the Norwegian Non-fiction
Literature Fund
Contents
Preface ix
1 Structures and Languages 1
1.1 Na¨ıvely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Terms and Formulas . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5 Sentences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6 Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.7 Truth in a Structure . . . . . . . . . . . . . . . . . . . . . . 27
1.8 Substitutions and Substitutability . . . . . . . . . . . . . . 33
1.9 Logical Implication . . . . . . . . . . . . . . . . . . . . . . . 36
1.10 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 38
2 Deductions 41
2.1 Na¨ıvely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.2 Deductions . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.3 The Logical Axioms . . . . . . . . . . . . . . . . . . . . . . 48
2.4 Rules of Inference. . . . . . . . . . . . . . . . . . . . . . . . 50
2.5 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.6 Two Technical Lemmas . . . . . . . . . . . . . . . . . . . . 58
2.7 Properties of Our Deductive System . . . . . . . . . . . . . 62
2.8 Nonlogical Axioms . . . . . . . . . . . . . . . . . . . . . . . 66
2.9 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 71
3 Completeness and Compactness 73
3.1 Na¨ıvely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.3 Compactness . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.4 Substructures and the Lo¨wenheim–Skolem Theorems . . . . 94
3.5 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 102
v
vi CONTENTS
4 Incompleteness from Two Points of View 103
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4.2 Complexity of Formulas . . . . . . . . . . . . . . . . . . . . 105
4.3 The Roadmap to Incompleteness . . . . . . . . . . . . . . . 108
4.4 An Alternate Route . . . . . . . . . . . . . . . . . . . . . . 109
4.5 How to Code a Sequence of Numbers . . . . . . . . . . . . . 109
4.6 An Old Friend . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.7 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 115
5 Syntactic Incompleteness—Groundwork 117
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.2 The Language, the Structure, and the Axioms of N . . . . . 118
5.3 Representable Sets and Functions . . . . . . . . . . . . . . . 119
5.4 Representable Functions and Computer Programs . . . . . 129
5.5 Coding—Na¨ıvely . . . . . . . . . . . . . . . . . . . . . . . . 133
5.6 Coding Is Representable . . . . . . . . . . . . . . . . . . . . 136
5.7 G¨odel Numbering . . . . . . . . . . . . . . . . . . . . . . . . 139
5.8 G¨odel Numbers and N . . . . . . . . . . . . . . . . . . . . . 142
5.9 Num and Sub Are Representable . . . . . . . . . . . . . . . 147
5.10 Definitions by Recursion Are Representable . . . . . . . . . 153
5.11 The Collection of Axioms Is Representable. . . . . . . . . . 156
5.12 Coding Deductions . . . . . . . . . . . . . . . . . . . . . . . 158
5.13 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 167
6 The Incompleteness Theorems 169
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
6.2 The Self-Reference Lemma. . . . . . . . . . . . . . . . . . . 170
6.3 The First Incompleteness Theorem . . . . . . . . . . . . . . 174
6.4 Extensions and Refinements of Incompleteness . . . . . . . 182
6.5 Another Proof of Incompleteness . . . . . . . . . . . . . . . 185
6.6 Peano Arithmetic and the Second Incompleteness Theorem 187
6.7 Summing Up, Looking Ahead . . . . . . . . . . . . . . . . . 193
7 Computability Theory 195
7.1 The Origin of Computability Theory . . . . . . . . . . . . . 195
7.2 The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
7.3 Primitive Recursion . . . . . . . . . . . . . . . . . . . . . . 204
7.4 Computable Functions and Computable Indices . . . . . . . 215
7.5 The Proof of Kleene’s Normal Form Theorem.. . . . . . . . 225
7.6 Semi-Computable and Computably Enumerable Sets . . . 235
7.7 Applications to First-Order Logic . . . . . . . . . . . . . . . 244
7.8 More on Undecidability . . . . . . . . . . . . . . . . . . . . 254
CONTENTS vii
8 Summing Up, Looking Ahead 265
8.1 Once More, With Feeling . . . . . . . . . . . . . . . . . . . 266
8.2 The Language and the Structure B. . . . . . . . . . . 266
BT
L
8.3 Nonstandard -structures . . . . . . . . . . . . . . . . . 271
BT
L
8.4 The Axioms of B . . . . . . . . . . . . . . . . . . . . . . . . 271
8.5 B extended with an induction scheme . . . . . . . . . . . . 274
8.6 Incompleteness . . . . . . . . . . . . . . . . . . . . . . . . . 276
8.7 Off You Go . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Appendix: Just Enough Set Theory to Be Dangerous 279
Solutions to Selected Exercises 283
Bibliography 359
Preface
Preface to the First Edition
Thisbookcoversthecentraltopicsoffirst-ordermathematicallogicinaway
thatcanreasonablybecompletedinasinglesemester. Fromthecoreideas
oflanguages,structures,anddeductionswemoveontoprovetheSoundness
andCompletenessTheorems,theCompactnessTheorem,andG¨odel’sFirst
and Second Incompleteness Theorems. There is an introduction to some
topics in model theory along the way, but I have tried to keep the text
tightly focused.
One choice that I have made in my presentation has been to start right
in on the predicate logic, without discussing propositional logic first. I
present the material in this way as I believe that it frees up time later
in the course to be spent on more abstract and difficult topics. It has
beenmyexperienceinteachingfrompreliminaryversionsofthisbookthat
studentshaverespondedwelltothischoice. Studentshaveseentruthtables
before, and what is lost in not seeing a discussion of the completeness of
the propositional logic is more than compensated for in the extra time for
G¨odel’s Theorem.
I believe that most of the topics I cover really deserve to be in a first
course in mathematical logic. Some will question my inclusion of the
Lo¨wenheim–Skolem Theorems, and I freely admit that they are included
mostly because I think they are so neat. If time presses you, that sec-
tion might be omitted. You may also want to soft-pedal some of the more
technical results in Chapter 5.
The list of topics that I have slighted or omitted from the book is de-
pressingly large. I do not say enough about recursion theory or model
theory. I say nothing about linear logic or modal logic or second-order
logic. All of these topics are interesting and important, but I believe that
they are best left to other courses. One semester is, I believe, enough time
to cover the material outlined in this book relatively thoroughly and at a
reasonable pace for the student.
Thanks for choosing my book. I would love to hear how it works for
you.
ix