tttp-Preface
tttp-Preface
Peter B. Andrews
CONTENTS
Preface viii
Chapter 0 Introduction 1
1
§54. Semantics of Q 0.....................................................238
§55. Completeness of Q 0 ..................................................248
Bibliography 371
Index 383
2
PREFACE TO THE SECOND EDITION
For the benefit of readers who are already familiar with the first (1986)
edition of this book, we briefly explain here how this edition differs from that
one.
The basic structure of the book is unchanged, but improvements and enhancements
may be found throughout the text. There is more introductory material and
motivation. Historical notes and bibliographic references have been added. The
discussion of vertical paths and normal forms in §14 is now much more
comprehensive. A number of consequences of Gödel's Second Incompleteness
Theorem are now discussed in §71.
Many exercises have been added, and at the end of the book there is a new
collection of Supplementary Exercises which are not explicitly tied to any
particular section. Information about obtaining the ETPS program, which
facilitates work on exercises which consist of proving theorems in the object
language, will be found near the end of the Preface.
PREFACE
The first part of the book (Chapters 1 and 2, supplemented by parts of Chapters
3 and 4) is suitable for use as a text in a one-semester introduction to
mathematical logic, and the second part (Chapters 5 - 7) for a second semester
course which introduces type theory (more specifically, typed -calculus) as a
language for formalizing mathematics and proves the classical incompleteness and
undecidability theorems in this context. Persons who wish to learn about type
theory and have had a prior introduction to logic will have no difficulty
starting with Chapter 5.
The book is oriented toward persons who wish to study logic as a vehicle for
formal reasoning. It may be particularly useful to those who are interested in
issues related to the problem of constructing formal proofs as models of
informal reasoning or for use in computerized systems which involve automated
deduction. Proofs, which are often the chief end products and principal
manifestations of mathematical reasoning, constitute highly significant pathways
to truth and are a central concern of this book. Our choice of the title To
Truth Through Proof is motivated by the consideration that while in most realms
one needs more than logic to achieve an understanding of what is true, in
mathematics the primary and ultimate tool for establishing truth is logic.
Of course, the study of logic involves reasoning about reasoning, and it is not
surprising that complex questions arise. To achieve deep understanding and
proper perspective, one must study a variety of logical systems as mathematical
objects and look at them from a variety of points of view. We are thus led to
3
study the interplay between syntax and semantics, questions of consistency and
independence, formal rules of reasoning, various formats for proofs and
refutations, ways of representing basic mathematical concepts in a formal
system, the notion of computability, and the completeness, incompleteness, and
undecidability theorems which illuminate both the power and the limitations of
logic.
One's choice of a formal language will generally depend on what one wishes to do
with it. If one is choosing a language for expressing mathematics in
computerized systems which deal with mathematics on a theoretical level (such as
mathematically sophisticated information retrieval systems, proof checkers, or
deductive aids), there are several reasons why type theory may be preferable to
set theory. First, the primitive notation of set theory is so economical that
this language is only practical to actually use if one expands it by introducing
various abbreviations. This is usually done in an informal way (i.e., in the
meta-language), but in an automated system it is important that the formal
language be the one actually used to express mathematical statements, since this
is the language which must be studied rigorously and manipulated systematically.
Thus, the formal language should not only be adequate in principle for
expressing mathematical ideas, but it should also be convenient in practice.
Indeed, the translation from familiar mathematical notations to the formal
language should be as simple and direct as possible. Second, in set theory one
can write all sorts of expressions which are not legal in type theory, and which
a mathematician would reject as nonsense almost instinctively. A computer
4
program for manipulating mathematical expressions would certainly be very
awkward and inefficient if it did not have some way of distinguishing between
different types of mathematical objects and rejecting nonsensical expressions.
Third, one of the basic operations in automated theorem proving is that of
finding appropriate substitutions for variables, and an understanding of the
types of various entities allows one to avoid much useless search. Finally, it
has been found (see [Andrews et al., 1984] [Andrews et al., 1996]) that
unification algorithms for type theory (such as [Huet, 1975] and [Jensen and
Pietrzykowski, 1976]) are powerful tools in automating the proofs of simple
mathematical theorems.
As noted in [Hanna and Daeche, 1985], [Hanna and Daeche, 1986], and [Gordon,
1986], typed -calculus is particularly well suited for specifying and verifying
hardware and software. Familiarity with typed -calculus also provides
fundamental background for the study of denotational semantics for functional
programming languages.
While Gödel's Completeness Theorem guarantees that all valid wffs of first-order
logic have proofs in first-order logic, extraordinary reductions in the lengths
of such proofs can sometimes be achieved by using higher-order logic. (See §54.)
It is easy to discuss the semantics of type theory, and to explain the crucial
distinction between standard and nonstandard models which sheds so much light on
the mysteries associated with the incompleteness theorems, Skolem's paradox,
etc. As will be seen in Chapter 7, in the context of the language Q 0 it is easy
to present the incompleteness theorems very elegantly and to show that their
significance extends far beyond the realm of formalizing arithmetic.
Obviously, serious students of mathematical logic ought to know about both type
theory and axiomatic set theory. Pedagogically, it makes good sense to introduce
them to elementary logic (prepositional calculus and first-order logic), then
type theory, then set theory. In spite of the superficial appearance of
simplicity possessed by set theory, its models are more complicated, and from a
logical point of view it is a more powerful and complex language. In [Marshall
and Chuaqui, 1991] it is argued that the set-theoretical sentences which are
preserved under isomorphisms are of fundamental importance, and it is shown that
these are the sentences which are equivalent to sentences of type theory.
A brief explanation of the labeling system used in this book may be helpful. The
sections in Chapter 1 (for example) are labeled §10, §11, ... , §16. Of course,
an alternative labeling would be §1.0, §1.1, ... , §1.6, but the periods are
quite redundant once one understands the labeling system. These tags should be
regarded as labels, not numbers, although they do have a natural ordering.
Similarly, the theorems in §11 (for example) are labeled 1100, 1101, 1102, ... ,
rather than 1.1.00, 1.1.01, 1.1.02, ... . Exercises are labeled in a similar
way, but their labels start with an X. Thus, the exercises for section 11 are
labeled X1100, X1101, X1102, ... . Labeling starts with 0 rather than 1 because
0 is the initial ordinal. (Chapter 0 is the Introduction.)
The reader should examine the table of contents in parallel with the discussion
of the individual chapters below. Much that is in this book is simply what one
would expect in an introductory text on mathematical logic, so the discussion
will concentrate on features one might not expect.
5
In §14 a convenient two-dimensional notation is introduced to represent wffs in
negation normal form. This enables one to readily comprehend the structure of
such wffs, find disjunctive and conjunctive normal forms by inspection, and
check whether the wffs are contradictory by examining the “vertical paths”
through them.
Chapter 2 contains what everyone ought to know about first-order logic. Students
can learn a great deal about how to construct proofs by doing the exercises at
the end of §21. The discussion of prenex normal form in §22 shows students how
to pull out the quantifiers of a wff all at once as well as how to bring them
out past each connective one step at a time. This discussion is facilitated by
the use of a special notation for the ambiguous quantifier. In Gödel's
Completeness Theorem is proved by an elegant generalization of Henkin's method
due to Smullyan. The notion of consistency in Henkin's proof is replaced by
abstract consistency, and with very little extra effort a proof is obtained for
Smullyan's Unifying Principle, from which readily follow Gödel's Completeness
Theorem in §25, Gentzen's Cut-Elimination Theorem in §31, the completeness of
the method of semantic tableaux in §32, the completeness of a method for
refuting universal sentences in §34, and the Craig-Lyndon Interpolation Theorem
in §41. In their first encounter with the proof of Gödel's
Completeness Theorem, students may need a less abstract approach than that of
Smullyan's Unifying Principle, so as an alternative in §25A an elegant and
direct simplified proof of the Completeness Theorem is given. It actually
parallels the abstract approach very closely and provides a good introduction to
the abstract approach. The Löwenheim-Skolem Theorem and the Compactness Theorem
are derived in the usual way from the Completeness Theorem. It is shown how the
Compactness Theorem can be applied to extend the Four Color Theorem of graph
theory from finite to infinite graphs and to prove the existence of nonstandard
models for number theory.
§34 introduces a method for refuting universal sentences which avoids the
branching on disjunctions of semantic tableaux and uses the cut rule to reduce
formulas to the contradictory empty disjunction. This method has many elements
in common with the resolution method [Robinson, 1965] of automated theorem-
proving. Students are often successful at establishing theorems by this method
even though they were unable to find proofs for them in natural deduction
format.
The proof methods just discussed all yield highly redundant proof structures in
which various subformulas may occur many times. §35 introduces a version of
6
Herbrand's Theorem which enables one to establish that a wff is contradictory
simply by displaying a suitable compound instance of it.
7
should have no difficulty providing formal justifications for each step.
Naturally, each teacher will decide how (or whether) to treat these proofs in
class. It is good experience for students to present some proofs, or parts of
proofs, in class. By the end of this chapter students should have a firm grasp
of the connection between abbreviated formal proofs and the informal proofs seen
in other mathematics courses, and should therefore be much more confident in
dealing with such proofs.
The exercises at the end of each section generally provide opportunities for
using material from that section. However, students need to learn how to decide
for themselves what techniques to use to solve problems. Therefore, at the end
of the book there is a collection of Supplementary Exercises which are not
explicitly tied to any particular section. Some exercises (see §21 and §52, for
example) involve applying rules of inference to prove theorems of the formal
system being discussed. A computer program called ETPS (which is reviewed in
[Goldson and Reeves, 1993] and [Goldson et al., 1993]) has been developed to
facilitate work on such exercises. The student using ETPS issues commands to
apply rules of inference in specified ways, and the computer handles the details
of writing the appropriate lines of the proof and checking that the rules can be
used in this way. Proofs, and the active lines of the proof, are displayed using
the special symbols of logic in proof windows which are automatically updated as
the proof is constructed. The program thus allows students to concentrate on
the essential logical problems underlying the proofs, and it gives them
immediate feedback for both correct and incorrect actions. Experience shows that
ETPS enables students to construct rigorous proofs of more difficult theorems
than they would otherwise find tractable.
8
http://www.cs.cmu.edu/afs/cs/project/pal/www/pal.html for CMU's Pure and Applied
Logic Program and from there find the author's web page.
I have used versions of this book for a course in mathematical logic at Carnegie
Mellon University for about thirty years. Experience has shown that students
are best prepared for the course if they have had at least one rigorous
mathematics course or a course in philosophy or computer science that has
prepared them to appreciate the importance of understanding the nature of
deductive reasoning and the art of proving theorems. I have found that if one
covers the material rather thoroughly in class, it is difficult to cover all of
Chapters 1 - 4 in the first semester, so I normally cover Chapter 1, most of
Chapter 2 (using §25A and omitting §24 and most of §26), and also §30, §33, and
§34. Naturally, in a course primarily composed of graduate students, or students
with more previous exposure to logic, one could move faster, ask students to
read some material outside class, and cover all of Chapters 1 - 4 in one
semester. In the second semester I normally cover Chapters 5 - 7 fairly
completely. A few comments about notation may be helpful. ``U is a subset of V"
is written as “U V", and “U is a proper subset of V” as “U V”. The
composition of functions f and g is written f o g. “iff” is an abbreviation for
“if and only if”. Ends of proofs are marked with the sign .
I wish to thank the many people who contributed directly or indirectly to the
development of this book. Alonzo Church, John Kemeny, Raymond Smullyan, and
Abraham Robinson taught me logic. It will be obvious to all who have read them
that this book has been deeply influenced by [Church, 1940] and [Church, 1956].
Numerous students at Carnegie Mellon helped shape the book with their questions,
comments, and interests. Special thanks go to Ferna Hartman for her heroic work
typing the difficult manuscript.
Bibliography
[Andrews et al., 1984] Peter B. Andrews, Dale A. Miller, Eve Longini Cohen, and
Frank Pfenning Automating Higher-Order Logic. In W. W. Bledsoe and D. W.
Loveland, editors, Automated Theorem Proving: After 25 Years, Contemporary
Mathematics series, vol. 29, pages 169-192, American Mathematical Society, 1984.
[Andrews et al., 1996] Peter B. Andrews, Matthew Bishop, Sunil Issar, Dan
Nesmith, Frank Pfenning, and Hongwei Xi, TPS: A Theorem Proving System for
Classical Type Theory, Journal of Automated Reasoning, 16:321-353, 1996.
[Goldson and Reeves, 1993] Doug Goldson and Steve Reeves, Using Programs to
Teach Logic to Computer Scientists, Notices of the American Mathematical
Society, 40:143-148, 1993.
9
[Goldson et al., 1993] Douglas Goldson, Steve Reeves, and Richard Bornat, A
Review of Several Programs for the Teaching of Logic, The Computer Journal,
36:373-386, 1993.
[Gordon, 1986] Mike Gordon, Why higher-order logic is a good formalism for
specifying and verifying hardware. In G. J. Milne and P. A. Subrahmanyam,
editors, Formal Aspects of VLSI Design, pages 153-177. North-Holland, 1986.
[Marshall and Chuaqui, 1991] M. Victoria Marshall and Rolando Chuaqui, Sentences
of type theory: the only sentences preserved under isomorphisms, Journal of
Symbolic Logic, 56:932-948, 1991.
10