Professional Documents
Culture Documents
Institut fur
Mathematische Logik und Grundlagenforschung
An Introduction
to
Mathematical Logic
Lecture given
by
Wolfram Pohlers
worked out and
supplemented
by
Thomas Gla
Wolfram Pohlers
Thomas Gla
Institut fur
Mathematische Logik und Grundlagenforschung
Westfalische Wilhelms-Universitat Munster
Einsteinstrae 62
D 48149 Munster
Typeset AMS-LaTEX
Preface
This text is based on my personal notes for the introductory courses in Mathematical
Logic I gave at the university of Munster in the years 1988 through 1991. They have
been worked out and supplemented by Thomas Gla to whom I express my sincere
thanks for a well done job.
Our courses have been planned for freshmen in Mathematical Logic with a certain
background in Mathematics. Though self contained in principle, this text will therefore
sometimes appeal to the mathematical experience of the reader.
According to the aim of the lectures, to give the student a
rm basis for further
studies, we tried to cover the central parts of Mathematical Logic.
The text starts with a chapter treating
rst order logic. The examples for application of
Gentzen's Hauptsatz in this section give a faint avour how to apply proof theoretical
methods in Mathematical Logic.
Fundamentals of model theory are treated in the second chapter, fundamentals of
recursion theory in chapter 3. We close with an outline of other formulations of (
rst
order and non
rst order) logics.
Nearly nothing, however, is said about set theory. This is usually taught in an
extra course. Thus there is an appendix in which we develop the small part of the
theory of ordinal and cardinal numbers needed for these notes on the basis of a naive
set theory.
One of the highlights of this text are Godel's incompleteness theorems. The true
reason for these theorems is the possibility to code the language of number theory by
natural numbers. Only a few conditions have to be satis
ed by this coding. Since we
believe that a development of such a coding in all its awkward details could mystify
the simple basic idea of Godel's proof, we just required the existence of a suitable
arithmetisation and postponed the details of its development to the appendix.
iv Preface
I want to express my warmest thanks to all persons who helped in
nishing this text.
Besides Thomas Gla { who did the work of a co-author { I want to mention Andreas
Schluter in the
rst place. He did not only most of the exercises but also most of
the proof-reading. Many improvements are due to him. My thanks go also to all our
students who detected and reported errors in a
rst version and gave us many helpful
critical remarks. We do not regard these notes as
nished. Therefore we are still open
for suggestions and criticism and will appreciate all reports about errors, both typing
errors and possible more serious errors.
Last but not least I want to thank our secretary Martina Pfeifer who TEXed the
main bulk of this paper.
Historical Remarks : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1
Notational Conventions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3
1 Pure Logic 5
Heuristical Preliminaries : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5
1.1 First Order Languages : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6
1.2 Truth Functions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 10
1.3 Semantics for First Order Logic : : : : : : : : : : : : : : : : : : : : : : : 17
1.4 Propositional Properties of First Order Logic : : : : : : : : : : : : : : : 27
1.5 The Compactness Theorem for First Order Logic : : : : : : : : : : : : : 35
1.6 Logical Consequence : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 45
1.7 A Calculus for Logical Reasoning : : : : : : : : : : : : : : : : : : : : : : 48
1.8 A Cut Free Calculus for First Order Logic : : : : : : : : : : : : : : : : : 53
1.9 Applications of Gentzen's Hauptsatz : : : : : : : : : : : : : : : : : : : : 66
1.10 First Order Logic with Identity : : : : : : : : : : : : : : : : : : : : : : : 82
1.11 A Tait-Calculus for First Order Logic with Identity : : : : : : : : : : : : 85
2 Fundamentals of Model Theory 93
2.1 Conservative Extensions and Extensions by De
nitions : : : : : : : : : : 93
2.2 Completeness and Categoricity : : : : : : : : : : : : : : : : : : : : : : : 99
2.3 Elementary Classes and Omitting Types : : : : : : : : : : : : : : : : : : 109
3 Fundamentals of the Theory of Decidability 115
3.1 Primitive Recursive Functions : : : : : : : : : : : : : : : : : : : : : : : : 116
3.2 Primitive Recursive Coding : : : : : : : : : : : : : : : : : : : : : : : : : 124
3.3 Partial Recursive Functions and the Normal Form Theorem : : : : : : : 130
3.4 Universal Functions and the Recursion Theorem : : : : : : : : : : : : : 134
3.5 Recursive, Semi-recursive and Recursively Enumerable Relations : : : : 136
3.6 Rice's Theorem : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 142
3.7 Random Access Machines : : : : : : : : : : : : : : : : : : : : : : : : : : 145
3.8 Undecidability of First Order Logic : : : : : : : : : : : : : : : : : : : : : 148
4 Axiom Systems for the Natural Numbers 153
4.1 Peano Arithmetic : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 153
4.2 Godel's Theorems : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 158
v
vi Contents
5 Other Logics 165
5.1 Many-Sorted Logic : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 165
5.2 !-Logic : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 172
5.3 Higher Order Logic : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 175
Appendix 179
A.1 The Arithmetisation of NT : : : : : : : : : : : : : : : : : : : : : : : : : 179
A.2 Naive Theory of the Ordinals : : : : : : : : : : : : : : : : : : : : : : : : 188
A.3 Cardinal Numbers : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 198
Bibliography 203
Historical Texts : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 203
Original Articles : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 203
Text Books : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 206
Glossary 209
Index 215
Historical Remarks
Notational Conventions
i stands for if and only if.
denotes the empty set.
IN is the set of natural numbers 0 1 2 : : :
If f : X ! Y is a function we call X the domain of f, i.e. X = dom(f): The
range of f is the set
rg(f) = fy 2 Y : 9x2X(f(x) = y)g:
If f : X ! Y is a function and Z X, then f Z denotes the restriction of f to
Z, i.e. f Z : Z ! Y
f Z(x) = f(x) for x 2 Z:
X Y is the set of functions f : Y ! X:
Pow(X) denotes the power set of X, i.e. the set of all subsets of X.
X n Y denotes the set X without Y , i.e. the set
fx 2 X : x 2= Y g:
X Y denotes the union of X and Y, i.e. the set
fx : x 2 X or x 2 Y g:
X \ Y denotes the intersection of X and Y, i.e. the set
fx : x 2 X and x 2 Y g:
idX is the identity on X, i.e. dom(idX ) = X and
idX (x) = x for x 2 X:
4 Notational Conventions
Chapter 1
Pure Logic
Heuristical Preliminaries
In the historical remarks we already emphasised that the development of a formal lan-
guage belongs to the main tasks of mathematical logic. To see what will be needed for
a formal language of mathematics we are going to examine examples of mathematical
propositions. Let us start with a simple one
5 j 15
i.e. the natural number 5 divides the natural number 15, or
(3 + 4) = (2 + 5):
These propositions tell us facts about natural numbers. The
rst one tells us that the
two natural numbers 5 and 15 share the property that one (the
rst) divides the other
(the second). Such properties which may be shared by one or more objects (natural
numbers in our example) will be called predicates . The number of objects which may
share a predicate is called the arity of the predicate. The equality of natural numbers,
for instance, is a binary predicate. Whenever we have an n-ary predicate P and n
objects o1 : : : on, then (Po1 : : :on ) is a proposition , something which either can be
true or false.
The second example is a bit more complex. In it we do not longer compare two
objects but two things, 3 + 4 and 2 + 5 which are built up from objects by functions .
Such things will be called terms . Terms can be evaluated and the evaluation will
yield an object. Thus objects in predicates may well be replaced by terms and still
represent a proposition. We may even replace objects occurring in terms by terms
and still obtain a term. To get a uniform de
nition we could say that every object is
a term and that more complex terms are obtained by applying an n-ary function f
to already formed terms t1 : : : tn, i.e. by building (ft1 : : :tn ). Once propositions are
formed, we may compose them to more complex ones by using sentential connectives.
In colloquial language we compose ones by connectives such as
`and'
it is raining and I'm taking my umbrella,
6 I. Pure Logic
`or'
it is raining or the sun is shining,
`if : : : then'
if it is raining, then I'm going to use my umbrella,
`not' etc.
We will use the symbols ^ _ ! : to denote these connectives. Of course we will
have to give them a mathematically exact meaning (which of course should be as close
as possible to their meaning in colloquial language, because it is colloquial language
which conserves our long experience in thinking). This will be done in section 1.2.
The use of sentential connectives, however, does not exhaust all the possibilities of
forming more complex propositions. In mathematics we usually deal with structures.
Let's take the example of a group. A group G consists of a non-empty set G of objects,
together with a binary group operation, say
, a neutral element, say 1, and the equality
relation. The only propositions which are legal with respect to our hitherto collected
rules are equations between terms and their sentential combinations. But this does
not even allow us to express that 1 is the neutral element of G . In order to do that we
have to say something like:
1
x = x and x
1 = x for all objects x in G:
Here x is a symbol for an arbitrary element of G, i.e. x is a variable . This variable
is quantied by saying for all x in G. Thus we also have to introduce the universal
quanti
er 8x (or some other name, say x y : : :, for the variable).
The universal quanti
er alone does not suce to express that G is a group. To
formulate the existence of the inverse object we have to say
8x there exists an object y with x
y = 1:
Thus we need also the dual of the universal quanti
er, the existential quanti
er 9x.
Altogether this means that in order to describe a group in our formal language, we have
to allow object variables replacing objects in the formation for terms and quanti
ers
binding them.
These are all the ingredients for a
rst order language. This language is already
quite powerful. E.g. it suces for the formalisation of group axioms, ring axioms etc.
However, one can imagine much more powerful languages. So we might introduce
variables for predicates and quanti
ers binding them. This would be called a second
order language. Third or even higher order languages languages can be obtained by
iterating this process, i.e. allowing the quanti
cation over predicates on predicates etc.
Now we close our preliminary words and try to put these ideas into mathematical
de
nitions.
Exercises
E 1.1.1. We de
ne the set of permitted words (i.e. non-void
nite strings) over the
alphabet fM U I g by the following inductive de
nition. There x y are words and
concatenated words are denoted by writing them one behind the other.
1. MI is a permitted word.
2. If xI is a permitted word, so is xIU:
3. If Mx is permitted, so is Mxx:
4. If xIIIy is permitted, so is xUy:
5. If xUUy is permitted, so is xy:
Prove the following claims:
a) MUUIU is a permitted word.
b) MU is not permitted.
E 1.1.2. The set M IN is de
ned inductively by:
1. 2 2 M
2. Is n 2 M so n + 3 2 M:
Prove: It is n 2 M i there is an m 2 IN with n = 3m + 2:
1.2 Truth Functions
Up to now we have only developed the syntax of
rst order languages. A term or a
formula is nothing but a well-formed sequence of letters according to the rules of the
respective grammar. Therefore we need to
x the meaning of the letters and of the
expressions formed out of the letters. We start by
xing the meaning of the sentential
connectives. The purpose of sentential connectives is to connect propositions. A
proposition is something which either can be true or false. Thus sentential connectives
can be regarded as syntactical counterpart of truth functions and we have to develop a
theory of truth functions. We represent the truth value `true' by t, f stands for `false'.
1.2. Truth Functions 11
De
nition 1.2.1. An n-ary truth function is a map from ft f gn into ft f g.
Now we have to give a precise meaning to the sentential connectives of colloquial
language. That is easy for negation. We de
ne the truth function : : ft f g ! ft f g
by
: (t) = f and : (f) = t:
It is also easy for ^ and _ . To make their de
nition more visible we arrange it in
form of truth tables.
^ t f _ t f
t t f t t t
f f f f t f
These truth tables are to be read in the following way. ^ and _ are binary truth
functions. The
rst argument is in the vertical column left of the vertical line, the
second in the horizontal row above the horizontal line. The value stands at the crossing
point of the row of the
rst and the column of the second argument.
A bit more subtle to de
ne is the implication ! formalising the colloquial if : : :
then . The truth table of ! is
! t f
t t f
f t t
This is the way how implication is de
ned in classical logic. The controversies about the
meaning of implication reach back to the times of Megarians and Stoics. What people
annoys is the `ex falso quodlibet' saying that ! (f
) is always true independent from
the second argument. However, there are other interpretations of the colloquial if : : :
then statements leading to dierent kinds of logic and thus also to dierent kinds of
mathematics.
One example is intuitionistic logic which interprets if A, then B in such a way that
a proof for fact A can be converted in one for fact B. In this lecture we will restrict
ourselves to the classical interpretation of implication as given in the above truth table.
Usual mathematics is based on classical logic which uses the classical interpretation of
implication.
To study the theory of truth functions more generally we are going to introduce a
formal language. The alphabet consists of
propositional variables, denoted by a b a0 : : :
all connectives, i.e. names for all truth functions.
Now we are able to build up expressions only with respect to their sentential structure.
Think of propositional variables as of variables for propositions (or formulas). The
expressions build up only by this means are called sentential forms.
12 I. Pure Logic
De
nition 1.2.2. We de
ne the sentential forms inductively as follows.
1. Every propositional variable is a sentential form.
2. If A1 : : : An are sentential forms and ' is an n-ary connective (i.e. a name for
an n-ary truth function ' ), then ('A1 : : :An ) is a sentential form.
Sentential forms are denoted by A B C A0 : : :
Think of sentential forms build up by : ^ and _: Then (using in
x notation)
(:a)
(((:a) ^ b) _ a)
are examples for sentential forms.
Now let's make some conventions to spare parentheses:
outer parentheses will be cancelled
: binds more than ^ _ ! and ^ _ more than !, i.e. we will write
:A ^ B ! C _ :C
instead of
(((:A) ^ B) ! (C _ (:C)))
we will write
A1 ! A2 ! : : : ! An
instead of
(A1 ! (A2 ! (: : : ! An) : : : )):
This will also be the case if we replace ! by ^ or _.
Now we want to formalise that we think of propositional variables as variables for
propositions (which either can be true or false). Therefore we think that we have asso-
ciated a truth value with every propositional variable. Then we are able to determine
the truth value of a sentential form by successive application of the corresponding truth
functions.
A boolean assignment is a map B : A ! ft f g where A denotes the set of propositional
variables. Boolean assignments are denoted by B B 0 : : : We de
ne the value B (A) of
a sentential form A induced by a boolean assignment B as follows.
De
nition 1.2.3. We de
ne B (A) for sentential forms A inductively. It is de
ned
according to the de
nition of the sentential forms.
1. If A 2 A , then B (A) is already given by the assignment.
2. If A = ('A1 : : :An ) where ' is a name for the n-ary truth function ' , then
B (A) = ' (B (A1 ) : : : B (An )).
1.2. Truth Functions 13
If B is a boolean assignment with B (a) = f and B (b) = t, then we obtain in the above
example
B (:a) = : B (a) = t
B (((:a ^ b) _ a)) = (( : B (a)) ^ B (b)) _ B (a)
= (( : f) ^ t) _ f
=t
Now we give a
rst example for using `induction on the de
nition'.
Proposition 1.2.4. If A is a sentential form and B is a boolean assignment, then
B (A) 2 ft f g:
Proof by induction on the de
nition of `A is a sentential form'.
1. If A 2 A , then B (A) 2 ft f g according to the de
nition of a boolean assignment.
2. If A = ('A1 : : :An ), then we have (B (A1 ) : : : B (An )) 2 ft f gn by the induc-
tion hypothesis (which applies because A1 : : : An are previously de
ned sen-
tential forms). Since ' is a name for an n-ary truth function ' and B (A) =
' (B (A1 ) : : : B (An )) it is B (A) 2 ft f g.
Let A be a sentential form and fa1 : : : ang the set of propositional variables occurring
in A: It is obvious from De
nition 1.2.3 that B (A) only depends on B fa1 : : : ang
(i.e. B restricted to the
nite set fa1 : : : ang). There are only 2n many boolean as-
signments which dier on fa1 : : : ang. This means that there is an obvious algorithm
for computing B (A) which consists in writing down B (a1 ) : : : B (an ) for the 2n many
assignments which dier on fa1 : : : ang and then computing B (A) according to the
truth tables for the functions represented by the connectives occurring in A. For a
precise formalisation of this fact cf. the appendix (Lemma A.1.11).
De
nition 1.2.5. Let A and B be sentential forms. We say that A and B are sen-
tentially equivalent, written as A B if B (A) = B (B) for any boolean assignment
B.
and since B j (Ajk ) = t we have B i (Ajk ) = f: Fitting parts together we have for the
pure conjunctions
Ci = Ai1 ^ : : : ^ Ain i = 1 : : : 2n
the fact that
B i (Cj ) = t i i = j
since B i (Cj ) = t just in the case if B i (Ajk ) = t for all k = 1 : : : n: Without loss of
generality we may assume that we have numbered the boolean assignments in such a
way that
B i (A) = t for i = 1 : : : m
and
B j (A) = f for j = m + 1 : : : 2n:
If m = 0 de
ne
B = a0 ^ :a0 :
Then we have that B is a disjunctive normal form with
AB
since B (A) = f = B (B) for all boolean assignments B . If m 6= 0 de
ne the disjunctive
normal form
B = C1 _ : : : _ Cm :
Then it is for i = 1 : : : m
B i (B) = B i (Ci ) = t = B i (A)
and for j = m + 1 : : : 2n
B j (B) = f = B j (A)
since it is
B j (C1 ) = : : : = B j (Cm ) = f:
So we have for all i = 1 : : : 2n
B i (A) = B i (B)
and we can conclude A B:
16 I. Pure Logic
Corollary 1.2.10. For any sentential form A there is a conjunctive normal form B
such that A B.
Proof. To prove the corollary we observe that, in view of Proposition 1.2.7 the nega-
tion of a disjunctive normal form is equivalent to a conjunctive normal form and vice
versa. Thus choose a disjunctive normal form B0 equivalent to :A which exists by
1.2.9. Then by 1.2.7 A ::A :B0 which by the above remark is equivalent to a
conjunctive normal form.
De
nition 1.2.11. Let M be a set of connectives, i.e. names for some
xed truth
functions. We call M complete if for every sentential form there is an equivalent
sentential form only containing connectives from M.
So we obtain as another immediate corollary of Theorem 1.2.9:
Theorem 1.2.12. f: ^ _g f: _g and f: ^g are complete sets of connectives.
Proof. From Theorem 1.2.9 we see that f: ^ _g is complete. But according to 1.2.7
we can express ^ by : and _, and _ by : and ^.
At this point we have obtained a justi
cation for taking only the connectives
^ _ : !
into the alphabet of a
rst order language (cf. De
nition 1.1.1) since every other
connective can be represented by them.
Exercises
E 1.2.1 (Sheer stroke). The binary truth function j: ft f g2 ! ft f g is given by:
j t f
t f t
f t t
One may think of j as a connective. Prove that fjg is a complete set of connectives.
De
ne the connectives : ! _ ^ using only j.
E 1.2.2. The binary truth function : ft f g2 ! ft f g is given by:
t f
t f f
f f t
One may think of as a connective. Is fg complete?
E 1.2.3. Let f1 : : : ng be a complete set of connectives. Prove or disprove that
f : 1 : : : : n g is complete.
E 1.2.4. Prove: f^ _g is not complete.
E 1.2.5. Is f^ _ !g a complete set of connectives?
1.3. Semantics for First Order Logic 17
E 1.2.6. A king puts a prisoner to a severe test. He orders the prisoner into a room
with two doors. Behind each door there may be a tiger or a princess. Choosing the
door with the princess the prisoner will be set free. Otherwise he will be torn into
pieces by the tiger. Knowing that the prisoner is a logician, the king has mounted two
signs to the door.
The choice of the room doesn't The princess is in the other room.
make any dierence.
Exercises
E 1.3.1.
a) Prove: j= 8x(F ^ G) ! 8xF ^ 8xG:
b) Let L be a
rst order language including a constant symbol 0: Determine L-
formulas F and G with
6j= 8x(F _ G) ! 8xF _ 8xG:
E 1.3.2. Let L be a
rst order language and P a predicate symbol of L: Which of the
following formulas are valid?
a) (F ! G) ! ((F ! :G) ! :F)
26 I. Pure Logic
b) 8xF ! 9xF
c) 8y9xPyx ! 9x8yPyx
d) 9xF ^ 9xG ! 9x(F ^ G)
E 1.3.3.
a) Let S be an L-structure. Prove that if
S j= G ! F and x 2= FV(G)
so one has
S j= G ! 8xF
b) Is the condition x 2= FV(G) necessary? Prove your claim.
E 1.3.4. Prove Lemma 1.3.5. Hint: Show
rst that for a term s also sx (t) is a term
with
FV(sx (t)) FV(t) (FV(s) n fxg):
Do we have in general
FV(Fx(t)) = FV(t) (FV(F) n fxg)?
E 1.3.5. Let F be an L-formula, S an L-structure and an S -assignment. Prove:
S j= F] , SS j= F]:
E 1.3.6.
a) Determine a
rst order language LV S suited for talking about a vector space and
its
eld.
Hint: use a binary predicate symbol `='.
b) Formulate a theory (a set of sentences) TV S in the language LV S such that for
all LV S I-structures S (i.e. LV S -structures interpreting =S by f(s s) : s 2 S g,
cf. also section 1.10) one has: S j= TV S , S consists of a
eld and vector space
over this
eld.
c) De
ne the LV S I-structure S of the continuous functions over the
eld R of the
real numbers.
d) Determine LV S -formulas F and G such that the following holds in all LV S I-
structures S with S j= TV S :
1. s1 : : : sn 2 S are linear independent , S j= Fs1 : : : sn]:
2. s1 : : : sn 2 S form a vector space basis , S j= Gs1 : : : sn ]:
E 1.3.7.
a) Let S be an L-structure and an S -assignment. Prove:
S j= 9xF] , S j= 9yFx (y)]
if y 2= FV(F) BV(F):
1.4. Propositional Properties of First Order Logic 27
b) Is the condition y 2= FV(F ) BV(F ) in a) necessary? Prove your claim.
c) Let S be an L-structure and a S -assignment. Now let F and F~ be two L-
formulas which are obtained by renaming bounded variables. Prove:
~
S j= F ] , S j= F]:
E 1.3.8. Let F be an L-sentence with FV(F) = fx1 : : : xng. Prove for any L-
structure S it is
S j= F , S j= 8x1 : : : 8xnF:
E 1.3.9. Let LIN = (0 1 +
< =) be the language of number theory and N =
(IN 0 1 +
< =) the LIN -structure of the natural numbers. Determine LIN-formulas
F and G such that
1. N j= Fn] , n 2 IN is prime
2. N j= G , there are in
nitely many prime twins.
2 R is innitesimal if
j
j < r
for all 0 < r 2 R: We say
2 R are in
nitesimally close if j
; j is in
nitesimal.
In this case we write
:
Now we can prove the following result: For every
nite
2 R there is an uniquely
determined r0 2 R with
r0 :
To see that r0 exists we de
ne
r0 = supfr 2 R : r <
g:
Because
is
nite the set
fr 2 R : r <
g
is bounded in R and so the supremum exists in R. This means
r0 2 R:
By the de
nition of r0 it is
; r0 r
for all 0 < r 2 R: Since also
r0 ; r
Exercises
E 1.7.1.
a) Let M be a set of L-formulas with x 2= FV(M) and M ` F: Prove that M ` Fx (t)
for any L-term t with FV(t) \ BV(F) = :
b) Is x 2= FV(M) a necessary condition? Prove your claim.
E 1.7.2. Give derivations ` F of the following formulas where P Q R are predicate
symbols.
a) 9x8yPxy ! 8y9xPxy
b) 8x(Qx ! Rx) ! (8xQx ! 8xRx):
E 1.7.3.
a) ` 9xF $ 9yFx (y) for y 2= FV(F )
b) Let F F~ be two formulas which are obtained by renaming bound variables. Prove:
1) ` F $ F~
2) M ` F i M ` F: ~
c) Mx (c) ` Fx(c) implies M ` F
E 1.7.4. Prove Proposition 1.7.7.
E 1.7.5. In the proof of the completeness theorem we demanded Hk+1 : : : Hm to be
ordered in a certain way. Is this necessary?
1.8. A Cut Free Calculus for First Order Logic 53
1.8 A Cut Free Calculus for First Order Logic
The calculus just developed is usually called a `Hilbert style' calculus because similar
calculi already were proposed by David Hilbert 1862, y1943]. Again we want to
emphasise that developing this calculus we achieved a considerable reduction of the
complexity of the notion of logical validity and logical consequence. In order to check
whether a formula belongs to the set
Con(M) = fF : M j= F g
of logical consequences of a given set M we have, according to the de
nition, to consider
all L-structures S and all S -assignments : Then we have to check S j= M] and in
case that this holds also S j= F]: This seems to be a quite complicated procedure.
For the syntactical calculus, however, this becomes much simpler. We may even
construct a (hypothetical) machine, which works according to the rules of the Hilbert
style calculus, and this machine will, step by step, produce all logical consequences of
M (provided that M is given in a form which allows to be stored in the machine). To
check whether F is a consequence of M we just have to wait until F appears in the
list produced by the calculus. If F really belongs to Con(M) we eventually will get
the answer `Yes'. However, if F 2= Con(M), we don't get any answer. All we know is
that F did not yet show up. But we never can be sure whether F will show up in the
future or not. Thus we do not really have a decision procedure. Later on we will show
that such a decision procedure cannot exist (cf. Theorem 3.8.2).
In this section, however, we want to introduce a calculus which allows us to search
for a proof of F: In order to develop this calculus we need some observations. The
compactness theorem which is a deep theorem for the semantical notion of logical
consequence is obviously trivial for the syntactical notion of logical consequence:
M ` F implies fF1 : : : Fng ` F for some fF1 : : : Fng M:
In a derivation of M ` F we can use only
nitely many M-axioms. This proves that the
compactness theorem also follows from the completeness theorem. We did it the other
way round and deduced the completeness theorem from the compactness theorem (in
fact the compactness theorem for sentential logic was sucient). Thus there is a
nite
subset fF1 : : : Fng M such that M ` F , fF1 : : : Fng ` F: So it would suce
to de
ne fF1 : : : Fng ` F: By the deduction theorem this is equivalent to
fF1 : : : Fk g ` Fk+1 ! : : : ! Fn ! F
or
fF1 : : : Fkg ` :Fk+1 _ : : : _ :Fk _ F:
If we omit the _-symbol on the right hand we obtain
gures of the form
(1.2) A1 : : : An ` S1 : : : Sm
whose semantical interpretation is
A1 ^ : : : ^ An j= S1 _ : : : _ Sm :
54 I. Pure Logic
According to Gerhard Gentzen 1909, y1945]
gures of the form displayed in (1.2)
are called sequents . The formulas A1 : : : An are the antecedents while S1 : : : Sm
are the succedents of the sequent.
Gentzen used the notions of sequents to prove his famous `Hauptsatz' (1935) which
roughly says that for every derivable formula F there is already a derivation without
detours, which means that it only uses sub-formulas of F: Of course this cannot be true
in full generality. Since there are only
nitely many sub-formulas of F this would give
us a decision procedure. We are going to explore what a derivation without detours
really means. We will, however, not do this in the original Gentzen-style, but use a
simpli
cation of the calculus due to William W. Tait (1968). The observation he
made is that
F1 : : : Fm ` G1 : : : Gn
is { according to the deduction theorem { equivalent to
` :F1 : : : :Fm G1 : : : Gn:
So there is indeed no need to distinguish between antecedent and succedent formulas.
All we need is to derive
nite sets of formulas whose semantical meaning is that of the
disjunction of these formulas.
Negated formulas take over the role of antecedents, non-negated that of succedents.
But we can even dispense with the negation symbol and thus completely abolish the
dierence between antecedent and succedent formulas. We will follow this line because
then the calculus gets a beautiful symmetrical formulation which makes it easy to
handle. Thus we have to alter the language for the Tait-calculus a little.
De
nition 1.8.1. Let L = L(C F P ) a
rst order language. The Tait-language LT
for the language L is given by the following alphabet:
1. Variables as usual. (This means as in De
nition 1.1.1)
2. The sets C and F as usual.
3. The set P of predicate symbols together with a set P = fP : P 2 Pg: It is
#P = #P:
4. The sentential connectives ^ _ and the quanti
ers 8 9.
5. Auxiliary symbols as usual.
For example, the Tait-language for group theory obtains a binary predicate symbol =,
too. The intended meaning of = is, that it should be interpreted as 6=.
The grammars for forming terms and formulas are not altered. An L-structure S
is also a structure for the Tait-language for L: The interpretation of the new predicate
symbols is given by
P S = f(s1 : : : sn ) : (s1 : : : sn ) 2= P S g:
Thus P is a symbol for the complement of P: Although negation does not belong to
the alphabet of the Tait-language for L we may de
ne it by the following clauses:
1.8. A Cut Free Calculus for First Order Logic 55
De
nition 1.8.2. For a formula F of a Tait-language F is de
ned by induction on
the de
nition of the formulas.
1. (Pt1 : : : tn) = (Pt1 : : :tn ) (Pt1 : : :tn ) = (Pt1 : : :tn )
2. (F ^ G) = (F _ G) (F _ G) = (F ^ G)
3. (8xF ) = (9xF) (9xF) = (8xF)
As an easy consequence of the de
nition we get the syntactical property
(F) = F:
The intended meaning of F was that of :F: To see that we really met this intention
we prove the following proposition.
Proposition 1.8.3. Let S be an L-structure, an S -assignment and F an L-formula.
Then it is
ValS (F ) = : ValS (F ):
Proof by induction on the de
nition of F:
1. If F = Pt1 : : :tn , then F = Pt1 : : :tn and if F = Pt1 : : :tn , then F =
Pt1 : : :tn : By de
nition it is
ValS (Pt1 : : :tn ) = : ValS (Pt1 : : :tn ):
2. All other cases follow from the induction hypothesis using Proposition 1.3.13.
In the following we are going to denote
nite sets of formulas by capital Greek letters,
$ ; & : : :
De
nition 1.8.4. We de
ne the Tait-calculus for a language L. The relation T ;
is de
ned inductively as follows. Let $ be a set of LT -formulas.
1. If fP P g $ for an atomic LT -formula P, then T $ (L-axiom)
2. T $ F and T $ G imply T $ F ^ G (^-rule)
3. T $ Fi for i = 1 or i = 2 implies T $ F1 _ F2 (_-rule)
S
4. T $ Fx(y) and y 2= FV($) = fFV(F) : F 2 $g implies
T $ 8xF (8-rule)
5. T $ Fx(t) for some term t implies T $ 9xF (9-rule)
The formulas shown explicitly in the conclusion are called the main formulas of the
inferences. Remark that, due to the fact that we derive sets of formulas, two occur-
rences of a particular formula are automatically contracted into one. Especially it is
possible for the main formula to occur in the premise of an inference. The typical
case for this phenomenon, which will become particularly important in the proof of
56 I. Pure Logic
the completeness theorem 1.8.15 and in Herbrand's theorem 1.9.8, is the following: If
we have derived T 9xF Fx(t) we can conclude
T 9xF:
Now we give some technical results about the Tait-calculus which will be proven in the
exercises.
Proposition 1.8.5.
a) T $ F and F~ is obtained from F by renaming bounded variables implies
~
T $ F:
b) T $ implies T $x (t):
c) (Structural rule) T $ implies T $ ;:
d) (_-inversion) T $ F0 _ F1 implies T $ F0 F1:
e) (^-inversion) T $ F0 ^ F1 implies T $ F0 and T $ F1:
In a
rst step we show the soundness of the Tait-calculus. We de
ne
_
:$ = fF : F 2 $g S j= $ i S j= $
and prove the following lemma.
Lemma 1.8.6. If T $, then :$ is inconsistent.
Proof. We prove this lemma by induction on the de
nition of T $: In case of an
L-axiom we have fP P g $: Thus fP P g :$ which entails the inconsistency
of :$: To consider the following cases we
rst have to make some remarks.
Let us assume that the last inference is of the form:
(1.3) T $i Fi for i 2 I ) T $0 F
where F is the main formula of that inference and $ = $0 fF g: We want to restrict
ourselves only to the case that in (1.3) we have $i = $0 = $ which case is possible
by the above mentioned contractions. All the other cases are handled in a similar way
or can be reduced to that case by an application of the structural rule.
In the case of the ^-rule
T $ F and T $ G ) T $ (F ^ G)
we get the inconsistency of :$ F and :$ G by induction hypothesis. Let S be
an L-structure and an S -assignment such that S j= :$]: Then S j= F ] and
S j= G]: Hence S j= (F ^ G)] which entails
S 6j= :$ (F ^ G)]:
1.8. A Cut Free Calculus for First Order Logic 57
So :$ (F ^ G) is inconsistent. In case of the _-rule for i 2 f1 2g
T $ Fi ) T $ F1 _ F2
we have by the induction hypothesis the inconsistency of $ Fi: Thus if S j= :$] we
get S j= Fi] and therefore also S j= (F1 _ F2)]: Hence :$ (F1 _ F2) is inconsistent.
If we have
T $ Fx(y) ) T $ 8xF
according to the 8-rule, then :$ Fx(y) is inconsistent by the induction hypothesis.
Assume S j= :$]: Then we have S j= Fx(y)]: If is any S -assignment with y
we have since y 2= FV($)
S j= :$]
and because :$ Fx(y) is inconsistent it follows
S j= Fx (y)]:
So up to now we have proven
S j= 8yFx (y)]:
Using renaming bounded variables (cf. Exercise E 1.3.7) we obtain S j= 8xF] which
proves the inconsistency of :$ 8xF: Finally assume an instance
T $ Fx(t) ) T $ 9xF
of the 9-rule. Again we have the inconsistency of :$ Fx(t) by induction hypothesis.
If S j= :$] we get S j= Fx (t)]: Put
(
(z) = (z) for z 6= x
S
t ] for z = x:
Then x and (x) = tS ] which entails S j= F]: Thus S j= 9xF] and
:$ 9xF is inconsistent.
Theorem 1.8.7 (Soundness of the Tait-calculus). T F implies j= F:
Corollary 1.8.8.
a) T $ F entails :$ j= F
b) T $ F entails :$ ` F
Proof. We have :$ j= F i :$ fF g is inconsistent by 1.6.3. Thus we get a) by
1.8.6. b) follows from a) by the completeness theorem.
Our next aim is to show that j= F also entails T F i.e. to prove the completeness of
the Tait-calculus. Since we already have a completeness theorem the simplest idea to
do this is to prove ` F ) T F by induction on the derivation of F in the Hilbert-
style calculus. It is not too hard to see that T F1 : : : Fn holds for all boolean valid
58 I. Pure Logic
formulas F1 _ : : : _ Fn : It is also easy to prove T Fx (t) ! 9yFx (y) and to show that
T F _ G entails T 9xF _ G for x 2= FV (G):
However, we cannot yet show that T F T F _ G entails T G: So in order
to carry out this proof we need a rule
(cut) T $ F and T $ F ) T $
known as the cut-rule. The addition of the cut-rule will of course not spoil the correct-
ness of the calculus. Thus one way to get the completeness of T would be
rst to
add the cut-rule and afterwards to try to get rid of it again. This is indeed a tractable
way and we are going to follow it in the exercises. Here we choose the dierent way
to prove directly the completeness of the Tait-calculus. For this we
rst need some
notations. The idea of the proof is to de
ne a search tree which searches for the proof
of a given formula F: Such an idea has been proposed by Kurt Schutte 1909] for
the
rst time.
However, since the Tait-calculus derives sets of formulas we are forced to de
ne
search trees for sets $: The search has of course to follow a certain strategy which
investigates the formulas in the set $: Therefore we need to order the formulas in $
such that we can handle them according to their order. We will therefore, for the
rest of this section, interpret $ as a
nite list. This means that there is a dierence
between $ = (A B C) and $0 = (B A C):
De
nition 1.8.9. Let $ = (F1 : : : Fn) be a
nite list of LT -formulas.
a) A formula F 2 $ is irreducible in $ if it is atomic. Otherwise we call F a redex
of $:
b) A redex in $ is distinguished if it is leftmost, i.e. a redex Fj 2 $ is distinguished
if all Fi with i < j are irreducible.
c) The reductum $r of $ is obtained by cancelling the distinguished redex in $:
To de
ne the search tree for a
nite list $ of formulas we
rst have to de
ne the notion
of a tree. For $ = (x = y 8x(x
1 = x) 9y(y 6= 1)), where we wrote 6= instead of =
we have
x = y irreducible
8x(x
1 = x) the distinguished redex
and
$r = (x = y 9y(y 6= 1))
where 9y(y 6= 1) is the distinguished redex in $r : Here we are going to identify n 2 IN
with the ordinal
n = f0 : : : n ; 1g
as we do in the appendix. Instead of n 2 IN we will often write
n<!
because we identify IN with the least limit ordinal !:
1.8. A Cut Free Calculus for First Order Logic 59
De
nition 1.8.10.
a) A number sequence is a map : n ! ! where f0 : : : n ; 1g = n < !: We call
dom() = n also the length of : By !<! we denote the set of number sequences.
is an initial segment of , written as , if (k) = (k) for all k 2 dom():
Number sequences are denoted by 0 : : :
b) A tree is a nonempty subset T !<! which is closed under initial segments,
i.e. if 2 T , then 2 T: 2 T is called a node in T: A node 2 T
is topmost if _ hni 2= T for all n < !: (_ hni denotes the map with domain
dom()+1 such that _ hni(dom()) = n, i.e. if = hs0 : : : sk i, then _ hni =
hs0 : : : sk ni):hi the empty map, is a member of any tree. We call hi the root
of T:
c) Let f :
! ! be a map with dom(f) =
!: f n is de
ned by f n(k) = f(k)
for k < n: f is a path in T if f n 2 T holds for all n 2 dom(f). T is well-founded
if every path in T is
nite, i.e.
8f 2 !! 9n(f n 2= T):
f is a path through T if the path f is either topmost in T or dom(f) = !:
( x = 1) _ = 1 x x = y h0i h1i ( = 1) _ = 1 = 1
x x x
@@ ;;
hi
The combination of the principal syntactical and semantical lemma yields the com-
pleteness theorem.
Theorem 1.8.15 (Completeness of the Tait-calculus). j= F1 _ : : : _ Fn implies
T F1 : : : Fn:
Proof. First we remark that we need not bother about the restriction of L being
countable in the proof of the principal syntactical and semantical lemma as we can
restrict the language L to those non-logical symbols which occur in F1 : : : Fn. Assume
that T F1 : : : Fn is false. Then, by the principal syntactic lemma, there is a search
path for F1 : : : Fn which does not contain an axiom. This, by the principal semantic
lemma, entails that there is a structure S and an S -assignment with S 6j= Fi ] for
i = 1 : : : n: Hence 6j= F1 _ : : : _ Fn:
Assume that we have any calculus K: We call an inference rule
F1 : : : Fn ) G
admissible for K if K F1 : : : K Fn imply K G:
Theorem 1.8.16 (Weak form of Gentzen's Hauptsatz). The cut rule
F ! G G ! H ) F ! H
is admissible for the Tait-calculus.
Proof. Assume T F _ G and T G _ H: Then we have j= F _ G and j=
G _ H by the soundness theorem 1.8.7. Hence j= F _ H which by the completeness
theorem 1.8.15 entails T F H: By two inferences (_) this entails T F _ H:
We call 1.8.16 the weak form of Gentzen's Hauptsatz, since we did not show that there
is a terminating procedure for the elimination of (cut). In the exercises we indicate
how such a procedure is obtainable. Dealing with cut elimination procedures is the
hard core of proof theoretical research.
Exercises
Let LT be a Tait-language. We de
ne the length l(F) of a formula F inductively:
1. Is F atomic, so let l(F) = 0:
2. Is F = F0 F1 and 2f^ _g, so let l(F) = maxfl(F0) l(F1)g + 1:
3. Is F = QxG and Q2f8 9g so let l(F) = l(G) + 1:
1.8. A Cut Free Calculus for First Order Logic 65
E 1.8.1. Prove l(F ) = l(F):
Now we are going to de
ne a re
nement of the Tait-calculus nk $ for n k2IN induc-
tively.
(Ax) Is P atomic and fP P g $ so nk $ for all n k2IN:
(^) If nk 0 $ F0 and nk 1 $ F1 then nk $ F0 ^ F1 for
n > max(n0 n1):
(_) If nk 0 $ Fi for i = 0 or i = 1 then nk $ F0 _ F1 for n > n0 :
(8) If nk 0 $ Fx(y) and y 2= FV($) then nk $ 8xF for n > n0 :
(9) If nk 0 $ Fx(t) for a term t then nk $ 9xF for n > n0:
(cut) If nk 0 $ F and nk 1 $ F and l(F) < k then nk $
for n > max(n0 n1):
E 1.8.2.
n
a) k $ ) nk $x(t)
n
b) k $ ) nk $ ;
n
c) k $ F0 _ F1 ) nk $ F0 F1:
n
d) k $ F0 ^ F1 ) nk $ F0 and nk $ F1
E 1.8.3.
2l(F )
a) 0 F F:
2l(F ) + 3
b) 0 8xF _ Fx(t) and 20l(F ) + 3 Fx (t) _ 9xF
c) nk 0 $ F _ G and nk 1 $ F and l(F) < k ) nk $ G for
n > max(n0 n1):
d) Let x 2= FV($ G):
1) nk $ G _ F ) nk + 3 $ G _ 8xF
2) nk $ F _ G ) nk + 3 $ 9xF _ G
E 1.8.4.
a) nk 0 $ F and nk 1 ; F and l(F) = k ) nk 0 + n1 $ ;:
Hint: Use induction on n0 + n1:
n
b) nk + 1 $ ) 2k $:
66 I. Pure Logic
(n)
c) (Gentzen's Hauptsatz) De
ne 2(0n) = n and 2(kn+1) = 22k :
(n)
Prove: nk $ ) 20k $:
E 1.8.5. Let F be a boolean valid formula. Prove that there is an n 2 IN such that
n
0 F:
E 1.8.6. Let F be an LT -formula with ` F: Prove that there are n k 2 IN such that
n
k F:
E 1.8.7. Use the preceding exercises to obtain a second prove for the completeness
theorem for the Tait-calculus:
j= F entails T F:
E 1.8.8. Determine the search tree for
$ = ft1 6= t1 9y(y = t1 ^ (Pt5 ^ Pt5))g
where t0 t1 : : : is the
xed enumeration of the terms.
Now we may use Lyndon's interpolation theorem to show that indeed any globally
monotone operator is de
nable by a P-positive formula F:
Theorem 1.9.22. A
rst order de
nable operator is globally monotone i it is de
n-
able by some P -positive formula.
Proof. The one direction of the theorem is Lemma 1.9.21. To prove the opposite
direction let ;F be globally monotone. Then we have
(S P Q) j= 8x1 : : : 8xn(P x1 : : :xn ! Qx1 : : :xn) ! 8x(F ! FP (Q))
for any structure S and any expansion (S P Q) of S : Thus
j= 8x1 : : : 8xn(Px1 : : :xn ! Qx1 : : :xn) ^ F ! FP (Q)
By Lyndon's interpolation theorem we get an interpolation formula E i.e.
(1.19) j= 8x1 : : : 8xn(Px1 : : :xn ! Qx1 : : :xn) ^ F ! E
(1.20) j= E ! FP (Q):
Since Q only occurs positively in
8x1 : : : 8xn (Px1 : : :xn ! Qx1 : : :xn ) ^ F
it can at most occur positively in E: Thus choosing Q as P in (1.19) and (1.20) we get
j= F $ EQ (P ) i.e. F is logically equivalent to a formula EQ (P) which has at most
positive occurrences of P:
Exercises
E 1.9.1. Let F G be quanti
er free formulas of the
rst order language L: Let 0 be a
constant symbol, f and j
j function symbols and < a predicate symbol. Compute a
prenex form of the following formulas:
a) 8xF $ 9xG
1.9. Applications of Gentzen's Hauptsatz 81
b) 8x(0 < x ! 9y(0 < y ^ 8z(jz ; x0j < y ! jf(z) ; f(x0 )j < x))):
E 1.9.2. Let P Q R be binary predicate symbols of the Tait-language LT : Compute
with respect to the proof of the interpolation theorem for the Tait-calculus, an inter-
polation formula for
8x(9yP xy ^ 9yQxy) and 8x9y(Pxy _ Rxy)
Hint: First determine a derivation for
8x(9yP xy ^ 9yQxy) ! 8x9y(P xy _ Rxy)
in the Tait-calculus.
E 1.9.3. Prove that every monotone operator has a least
xed point, i.e. if ; is the
operator the least
xed point is a set s with
a) ;(s) = s
b) 8t(;(t) = t ! s t)
E 1.9.4. Prove or disprove: For every
rst order language L containing only
nitely
many constant and function symbols there is an n 2 IN such that for every L-formula
9xF with T 9xF there are t1 : : : tm m n with
Fx(t1 ) _ : : : _ Fx (tm ):
T
E 1.9.5. Let L(C F P) be a
rst order language with C F P
nite. Let P Q be
unary predicate symbols not in L S a
nite L-structure and R S: We call
R is S -invariant , for all isomorphisms ' : S = S it is R = f'(r) : r 2 Rg
For the notion of an isomorphism cf. De
nition0 2.2.6. We denote the expansions of an
L-structure S 0 to L(P ) and L(P Q) by (S 0 P S ) and (S 0 P S 0 QS 0 ): Now, let P S = R
and F an L(P)-formula, such that for all L-structures S 0
(S 0 P S 0 ) j= F , (S 0 P S 0 )
= (S P S )
Prove the following claims:
a) R is S -invariant and (S 0 P S 0 ) = (S 0 P S 0 ) ) P S 0 is S -invariant.
b) R is S -invariant ) (S 0 P S 0 QS 0 ) j= F ^ FP (Q) ! 8x(Px $ Qx)
c) R is S -invariant , there is an L-formula G with
FV(G) fx0g such that R = fs 2 S : S j= Gs]g:
Hint: Use Beth's de
nability theorem.
d) For any set X S there is an L-formula G with FV(G) fxg such that
f'(s) : s 2 X and ' : S = Sg = fs 2 S : S j= Gs]g:
82 I. Pure Logic
E 1.9.6. Prove Proposition 1.9.17.
E 1.9.7. It is possible to strengthen Herbrand's lemma in the following way:
If T is a theory with
T j= 9xF
then there are
nitely many terms t1 : : : tn such that
T j= Fx (t1) _ : : : _ Fx (tn):
Which restrictions have to be made on T and F that the above strengthing is correct?
E 1.9.8. Do we have in general j= F $ FH i.e. do we have for all LH -structures S
(which are expansions of L-structures) and all S -assignments
S j= F $ FH ]?
(1.27) Id $ t = r
and
(1.28) Id $ s 6= r
From (1.26) and (1.27) we get Id $ s = r by the Id-rule. This together with
(1.28) entails Id $ by Lemma 1.11.4.
4. F = (s1 = t1 ^ : : : ^ sn = tn ! fs1 : : :sn = ft1 : : :tn )
Then we have the premises
(1.29) T :; $ s1 = t1 : : : T :; $ sn = tn
and
(1.30) T :; $ fs1 : : :sn 6= ft1 : : :tn
(where we tacitly use ^-inversion to get (1.29)). By the induction hypothesis
these yield
(1.31) Id $ s1 = t1 : : : Id $ sn = tn
and
(1.32) Id $ fs1 : : :sn 6= ft1 : : :tn:
From (1.29) and the Id-axiom
(1.33) Id $ ft1 : : :tn = ft1 : : :tn
we get
(1.34) Id $ fs1 : : :sn = ft1 : : :tn:
From (1.30) and (1.34) we get
(1.35) Id $
by Lemma 1.11.4.
90 I. Pure Logic
5. F = (s1 = t1 ^ : : : ^ sn = tn ! (Ps1 : : :sn ! Pt1 : : :tn))
i.e.
F = (s1 = t1 ^ : : : ^ sn = tn ^ Ps1 : : :sn ^ Pt1 : : :tn ):
Then we have the premises (again using ^-inversion)
(1.36) T :; $ s1 = t1 : : : T :; $ sn = tn
The objects of interest in model theory are structures and classes of structures. Here
connections to
rst order logic will be studied. Especially it is analysed if and how
structures and classes of structures can be described within
rst order logic.
In this chapter we will only deal with predicate logic with identity. Therefore there
will be no need to emphasise that. So we are just writing j= instead of Id etc.
a) If we have ' : S1 ,! S2 , then it is for all LS1 -terms t and all S1S1 -assignments
'(tS1S1 ]) = tS 0 ' ]:
b) If it is ' : S1 ,! S2 , then we have S 0 j= Diag(S1 ):
c) If it is ' : S1 $ S2 , then we have S 0 j= Th(S1S1 ):
Proof. This is left as an exercise to the reader.
Proposition 2.2.4. Let S1 S2 be two L-structures and S 0 an LS1 -expansion of S2 :
Then de
ne ' : S1 ! S2 by
'(s) = sS :
0
Exercises
E 2.2.1. Prove Proposition 2.2.3.
E 2.2.2. Let L be a
rst order language only with the non-logical symbol =. Deter-
mine easy criteria such that for all L-structures S S 0
2.2. Completeness and Categoricity 107
a) S
= S 0:
b) S S 0 :
E 2.2.3. Let S be an L-structure and X S: De
ne
\
S0 = fS 0 : S 0 S and X S 0 g:
a) Prove that there is a substructure S0 of S with domain S0 :
b) Show that it is S0 = ftS s1 : : : sn] : t L-term and s1 : : : sn 2 X g:
E 2.2.4. If T is a set of 8-formulas, S2 j= T and S1 S2, then it is S1 j= T:
E 2.2.5. If T is a set of 89-formulas (i.e. formulas of the shape
8x1 : : : 8xn9y1 : : : 9ym F
with F quanti
er free) and (Sn )n2IN is a sequence of L-structures with Sn Sn+1 and
Sn j= T for all n 2 IN then one has S j= T where S = Sn2IN Sn is de
ned in the
obvious way.
E 2.2.6. If T is a set of positive formulas (i.e. formulas which are build up from atomic
formulas by ^ _ 8 9) then T will be preserved under epimorphisms. I.e. if
S1 j= Fs1 : : : sn]
and ' is an epimorphism onto S2. So
S2 j= F'(s1) : : : '(sn )]
for all F 2 T:
E 2.2.7. Let S0 S1 S2 be L-structures. Prove or disprove:
a) S0 $ S1 and S1 $ S2 ) S0 $ S2 :
b) S0 $ S1 and S0 $ S2 ) S1 $ S2 :
c) S0 $ S2 and S1 $ S2 ) S0 $ S1 :
E 2.2.8 (Tarski's lemma). Let (Sn )n2IN be a sequence of L-structures with Sn $
Sn+1 for all n 2 IN: Prove that for all n 2 IN
Sn $ Si :
i2IN
E 2.2.9. Let S S 0 be L-structures with S S 0 : Prove that S $ S 0 i for all formulas
F and all s1 : : : sn 2 S one has: if there is an s0 2 S 0 with S 0 j= Fs1 : : : sn s0]
then there is an s 2 S with S 0 j= Fs1 : : : sn s]:
E 2.2.10. Prove that a theory T is categorical i it is complete and has a
nite model.
108 II. Model Theory
E 2.2.11. Let L be a language with equality containing only a unary predicate symbol
P: The theory T should determine that P is true for in
nitely many objects and is
false for in
nitely many objects.
a) Give an exact axiomatisation of T:
b) Prove: T is @0 -categorical (@0 = card(IN)):
c) Prove: T is not
-categorical for all uncountable
:
E 2.2.12. Let S = (Q <Q) and S 0 = (R<R) the L(<)-structures of the rational and
real numbers, respectively. Prove the following claims:
a) Is g : R ! R bijective and strictly monotone increasing, then we have for all
r1 : : : rn 2 R
S 0 j= F r1 : : : rn] , S 0 j= Fg(r1) : : : g(rn)]:
b) For q1 : : : qn 2 Q and r 2 R there is a bijective and strictly monotone increasing
function g : R ! R with
g(r) 2 Q and g(q1 ) = q1 : : : g(qn) = qn:
c) S $ S 0 :
d) S 6= S 0 :
E 2.2.13. A set I 6= of partial isomorphisms from S to S 0 has the `back-and-forth'-
property. I.e.
1. 8f 2I 8x2S 9g2I(f g ^ x 2 dom(g))
2. 8f 2I 8y2S 0 9g2I(f g ^ y 2 rg(g)):
Here f g denotes that g extends f in the following sense:
dom(f) g ^ 8x2 dom(f)(f(x) = g(x)):
Prove: S = S : 0
E 2.2.14. Let DLO be the theory of the dense linear orderings without endpoints,
i.e.
1. 8x8y(x < y ! 9z(x < z ^ z < y))
2. 8x8y(x < y _ x = y _ y < x)
3. 8x8y(x < y ^ y < z ! x < z)
4. 8x(:x < x)
5. 8x9y(x < y)
6. 8x9y(y < x)
Prove:
a) (G. Cantor 1845, y1918], 1895) DLO is @0 -categorical.
b) There are two models of DLO of the same cardinality which are not isomorphic.
Hint: Use E 2.2.13 for a) and take R and R extended by a copy of Q on the left hand
side.
2.3. Elementary Classes and Omitting Types 109
2.3 Elementary Classes and Omitting Types
De
nition 2.3.1. Let K be a collection of L-structures.
a) We call K an elementary class if K = ModL (T ) for some
rst order theory T:
b) We call K
nitely axiomatisable if K = ModL (T) for some
nite set of L-sentences
T.
There is a wide variety of
nitely axiomatisable structures, e.g. groups, Abelian groups,
domains, integral domains,
elds,
elds of
xed characteristic p 6= 0, ordered
elds,
lattices, etc. In fact all these structures are de
ned as the model classes of certain
nite axiom systems. However, there are collections of structures which are not even
elementary let alone
nitely axiomatisable. An easy example is given by the following
lemma.
Lemma 2.3.2. Let K be the collection of structures which are all isomorphic to some
in
nite structure S : Then K is not elementary.
Proof. Assume K = ModL(T) for some theory T: Since S is in
nite we obtain a
elementary extension S 0 % S such that card(S 0 ) > card(S) by the Lowenheim-Skolem
theorem. S 0 and S cannot by isomorphic, hence S 0 2= K,
S 0 j= Th(SS ) and Th(SS ) Th(S ) T
which shows S 0 j= ModL (T ) in contradiction to our assumption.
Indeed we have proven a stronger result than 2.3.2. What we really have shown is:
Theorem 2.3.3. Let K be a class of structures, all having the cardinality
@0 :
Then K is not elementary.
2.3.2 and 2.3.3 already show us some limitations for the characterisation of structures
by
rst order axiom systems. As a corollary of 2.2.10 we also get:
Theorem 2.3.4. Let K be a class of
nite structures of arbitrarily large
nite cardi-
nality. Then K is not an elementary class.
Proof. K = ModL (T ) for some theory T implies by 2.2.10 that there are in
nite struc-
tures in K: This contradicts the hypothesis that K contains only
nite structures.
Thus the classes of the
nite groups or
nite
elds are not elementary.
Lemma 2.3.5. Let K = ModL(T) be
nitely axiomatisable. Then there is a
nite
axiom system Ax which is contained in T, i.e. Ax T:
Proof. Since K is
nitely axiomatisable there is a single sentence F such that K =
ModL (fF g) (e.g. let F be the conjunction of all the sentences of a
nite axiom system
for K). Then T j= F and by the compactness theorem there is a
nite subset Ax T
such that Ax j= F: If G 2 ModL (Ax), then
G 2 ModL (fF g) = ModL (T ) and ModL (T) ModL (Ax)
110 II. Model Theory
holds trivially because of Ax T: Hence
ModL (T ) = ModL (Ax):
Now we will leave the topic of elementary classes and turn to the notion of a type.
The idea of a type is an approach to characterise some given objects (or more precise:
a tuple of objects) by the set of properties which are true of those. Such a set will be
called a type.
De
nition 2.3.6. Let S be an L-structure, s1 : : : sn 2 S and T an L-theory.
a) The type of the n-tuple (s1 : : : sn ) is the set of L-formulas
; = fF : FV(F ) fx1 : : : xng and S j= Fs1 : : : sn]g:
b) An n-type in S is a type for an n-tuple of elements of S:
c) An n-type in T is an n-type in some model of T:
Up to now we have only been concerned with the 0-type in S : This is
Th(S ) = fF : F is L-sentence and S j= F g:
Next we observe some simple facts about types. The
rst fact is that we have either
F 2 ; or :F 2 ; if ; is an n-type in some L-structure and FV(F) fx1 : : : xng:
Proposition 2.3.7. Let ;0 ;1 be n-types in S : ;0 ;1 implies ;0 = ;1:
Proof. If we assume ;0 6= ;1, then there is an F with FV(F) fx1 : : : xng such
that F 2 ;1 and F 2= ;0 : By the above observation it is :F 2 ;0 ;1 : This is a
contradiction.
Proposition 2.3.8. Let ; be an n-type in an L-theory T and let F1 : : : Fk G be
L-formulas with free variables among x1 : : : xn:
a) If T j= F1 _ : : : _ Fk then there is an Fi 1 i k such that Fi 2 ;.
b) If T j= F1 ^ : : : ^ Fk ! G and F1 : : : Fk 2 ;, then it is G 2 ;.
The proofs are obtained by taking a look at the de
nition of an n-type in T:
Proposition 2.3.9. Let T be a countable theory, i.e. card(T) @0 and M 6= a set
of formulas with free variables among x1 : : : xn such that for all formulas F1 : : : Fk 2
M it is
T 6j= :F1 _ : : : _ :Fk :
Then there is an n-type ; in a countable model of T with M ;:
2.3. Elementary Classes and Omitting Types 111
Proof. It is T M consistent since otherwise by the compactness theorem there are
F1 : : : Fk 2 M such that T fF1 : : : Fk g is inconsistent. But then
T j= :F1 _ : : : _ :Fk :
But this is forbidden. By the Lowenheim-Skolem downwards theorem there is a count-
able model S of T and s1 : : : sn 2 S such that
S j= Ms1 : : : sn ]:
But this means, if ; is the type of (s1 : : : sn) M ;:
Corollary 2.3.10. Let T be a countable theory. If ; is an n-type in T , then there is
a countable model S of T such that ; is an n-type in S :
Proof. By Proposition 2.3.9 (with M = ;) and Proposition 2.3.7 we have to prove
T 6j= :F1 _ : : : _ :Fk
for all F1 : : : Fk 2 ;: But if there are F1 : : : Fk 2 ; such that
T j= :F1 _ : : : _ :Fk
then by Proposition 2.3.8 there is an Fi such that :Fi 2 ;. This is not possible.
De
nition 2.3.11. Let T be an L-theory and M a set of L-formulas. The formula F
is a T-generator of M if
1. T fF g is consistent.
2. T fF g j= G for all G 2 M:
So if F is a T-generator of M then it is possible to generate all formulas of M out of
F using T: The next lemma shows that an n-type in T is determined by any generator
if there is one.
Lemma 2.3.12. Let ; be an n-type in T and F a T -generator of ; with free variables
among x1 : : : xn. Then it is
; = fG : FV(G) fx1 : : : xng and T j= F ! Gg:
Proof. We have `' since F is a T-generator of ;. For the other inclusion take a
formula G with FV(G) fx1 : : : xng and
(2.22) T j= F ! G:
Since F is a T -generator of ; we have
F 2;
because otherwise we had :F 2 ; and so
T j= F ! :F:
112 II. Model Theory
This would imply that T j= :F but this means T fF g is inconsistent. Using Propo-
sition 2.3.8 and (2.22) we obtain G 2 ;:
We close this section with a theorem of A. Ehrenfeucht.
Theorem 2.3.13 (Omitting types theorem). Let T be a countable and consistent
theory, and let M be a set of formulas with free variables among x1 : : : xn without a
T-generator. Then there is a countable model S of T such that no n-type in S contains
M.
Proof. Let T 0 = T HL(T ) be the Henkin extension of T: Since T is countable so is
T 0 by Lemma 1.5.11. So there is an enumeration of the n-tuples of Henkin constants.
Now de
ne inductively a sequence of L(T 0)-sentences such that
a) Tk = T 0 fF1 : : :Fk g is consistent.
b) Fk is :Fx1
:::
xn (c1 : : : cn) where F 2 ; and (c1 : : : cn) is the kth n-tuple in
the above enumeration.
First observe that T 0 is consistent by Theorem 1.5.7. Now suppose in step k the
sentences F1 : : : Fk;1 have been de
ned. Let (c1 : : : cn) be the kth n-tuple. Let
$ = fF : F is L(T)-formula,FV(F) fx1 : : : xng
and Tk;1 j= Fx1
:::
xn (c1 : : : cn)g:
For any F 2 $ we have
T 0 j= F1 ^ : : : ^ Fk;1 ! Fx1
:::
xn (c1 : : : cn):
So there is an L(T)-formula G, such that
T j= Gx1
:::
xm (c1 : : : cm ) ! Fx1
:::
xn (c1 : : : cn)
for m n and
(2.23) Tk;1 j= Gx1
:::
xm (c1 : : : cm ):
This implies
T j= 9xn+1 : : : 9xm Gx1
:::
xn (c1 : : : cn) ! Fx1
:::
xn (c1 : : : cn)
and
Tk;1 j= 9xn+1 : : : 9xm Gx1
:::
xn (c1 : : : cn):
Since Tk;1 is consistent we have
Tk;1 6j= :9xn+1 : : : 9xm Gx1
:::
xn (c1 : : : cn)
and this yields by Exercise E 1.6.4
T 6j= :9xn+1 : : : 9xm G:
2.3. Elementary Classes and Omitting Types 113
This means T f9xn+1 : : : 9xm Gg is consistent and since M has no T-generator there
is an F 2 M such that
T 6j= 9xn+1 : : : 9xm G ! F:
By (2.23) and the de
nition of $ we obtain
F 2= $:
De
ne Fk = :F(c1 : : : cn): Then Tk is consistent. This
nishes the construction of
the formulas (Fk )k2IN :
If we set
T~ = T 0 fFk : k 2 INg
then by the compactness theorem T~ is consistent and countable. Now let S be the
model of T~ construed in the proof of the compactness theorem. Then S is countable
and for every t 2 S there is a Henkin constant c such that t = cS because t is a term
and
S j= 9x(x = t):
So for (s1 : : : sn) 2 S we
nd an n-tuple (c1 : : : cn) of Henkin constants with
n
si = cSi for 1 i n: By the above construction we
nd an F 2 M such that
T~ j= :Fx1
:::
xn (c1 : : : cn)
and because of S j= T~
S j= :Fs1 : : : sn ]:
This means that F is not in the n-type of (s1 : : : sn ): This shows that M is not
contained in any n-type in S :
Exercises
E 2.3.1. Prove that K is an elementary class i K is the intersection of a family of
nitely axiomatisable classes.
E 2.3.2. Let (Ki )i2I be a collection of elementary classes and let K Ti2I Ki be a
nitely axiomatisable
T Kclass. Show that there is a
nite subcollection (Ki )i2I0 I0 I
such that K i2I0 i :
E 2.3.3. Let (Kn )n2IN be a sequenceof
nitely axiomatisable
T classes such that for all
n 2 IN Kn+1 is a proper subclass of Kn: Prove that n2IN Kn is not
nitely axiomatis-
able.
114 II. Model Theory
Chapter 3
Fundamentals of the Theory of Decidability
Proof. Since
8x zP(~z x) , :9x z :P (~z x)
and the primitive recursive relations are closed under negations it suces to prove the
closure under bounded existential quanti
cation. Thus let P be primitive recursive
and
Q = f(~z z) : 9x z(~z x) 2 P g:
Then
Q (~z z) = sg(P (~z 0) + xz P(~z x)):
Hence Q is primitive recursive.
Proof. We have
X
n X
n
f(~z ) = gi (~z)
Pi (~z) + gn+1(~z)
sg( Pi (~z)):
i=1 i=1
In the following tabular we give more examples of primitive recursive predicates and
functions.
122 III. Theory of Decidability
Exercises
E 3.1.1. Give a description of the following functions using only basic functions and
basic operations.
a)
: IN2 ! IN (a b) 7! a
b
b) exp : IN2 ! IN (a b) 7! ab
c) pd : IN ! IN a 7! pd(a)
d) ;_ : IN2 ! IN (a b) 7! a;_ b
E 3.1.2. Prove: a;_ a = 0
E 3.1.3. Prove that the following functions are primitive recursive.
a) f1 (x) = log2 (x + 1)]
where r] is the greatest integer r for r 2 R:
3.1. Primitive Recursive Functions 123
p
b) f2 (x y) = 1+y x + 1]
E 3.1.4. Let g : IN ! IN be primitive recursive. De
ne f : IN2 ! IN by
f(x 0) = g(x)
f(x y + 1) = f(f(x y) y):
Prove that f is primitive recursive.
E 3.1.5. The Ackermann-P+eter function f is de
ned by the following recursion equa-
tions:
(I) f(0 y) = y + 1
(II) f(x + 1 0) = f(x 1)
(III) f(x + 1 y + 1) = f(x f(x + 1 y))
Prove:
a) f : IN2 ! IN is a total function.
b) For all x 2 IN the function fx : IN ! IN de
ned by
fx (y) = f(x y)
is primitive recursive.
c) f(1 y) = y + 2
d) f(2 y) = 2y + 3
e) f(x y) > x + y
f) f(x y + 1) > f(x y)
g) f(x + 1 y) f(x y + 1)
h) f(x + 1 y) > f(x y)
i) f(x1 y) + f(x2 y) f(x1 + x2 + 4 y)
j) 8x1 : : : 8xn 9x8y Pni=1 f(xi y) f(x y)
k) For all primitive recursive functions g : INn ! IN there is an x 2 IN such that
X
n
8x1 : : : 8xn g(x1 : : : xn) < f(x xi):
i=1
Hint: Use induction on the de
nition of the primitive recursive functions. If g is
built up by the recursor R, then choose x 2 IN such that
X
n X
n
8x1 : : : 8xn g(x1 : : : xn) + xi < f(x xi)
i=1 i=1
l) f : IN2 ! IN is not primitive recursive.
124 III. Theory of Decidability
E 3.1.6. Prove that every monotone decreasing function f : IN ! IN is primitive
recursive.
E 3.1.7. Let p q 2 IN with p q > 0 and f : IN2 ! IN with
8x8y f(x + p y) = f(x y) = f(x y + q):
Prove that f is primitive recursive.
E 3.1.8. Let f : IN ! IN be primitive recursive and
a) monotone decreasing
b) strictly monotone increasing.
Prove that rg(f) IN is a primitive recursive relation.
E 3.1.9. We are going to de
ne the class of polynomial functions inductively by:
1. Ckn Pkn S +
are polynomial
2. If f g1 : : : gn are polynomial, then so is Sub(f g1 : : : gn):
3. If f g h are polynomial and it is
8~x R(g h)(~x) f(~x)
then so is R(g h):
Prove:
a) Every polynomial function is primitive recursive.
b) There is a primitive recursive function which is not polynomial.
The following result goes back to Thoralf Skolem (1923) and Rosza Peter 1905,
y1977] (1934).
Lemma 3.2.7 (Course-of-values recursion). Let g : INn+2 ! IN be primitive re-
cursive. Then the function h : INn+1 ! IN satisfying
h(~z x) = g(~z x h(~z x))
is uniquely determined and primitive recursive.
Proof. The course-of-values of h is given by
h(~z 0) =<>
h(~z x + 1) = h(~z x)_ hg(~z x h(~z x))i:
Thus h is uniquely determined and primitive recursive. But then the same holds for
h:
Corollary 3.2.8. Let g : INn+k+1 ! IN g0 : INn ! IN and hi : IN ! IN i = 1 : : : k be
primitive recursive functions such that hi(x) < x holds for all x > 0 and i = 1 : : : k:
Then there is a uniquely determined primitive recursive function f : INn+1 ! IN
satisfying (0
f(~z x) = g (~z) if x = 0
g(~z x f(~z h1(x)) : : : f(~z hk (x))) if x 6= 0:
Proof. We have
(0
f(~z x) = g (~z) if x = 0
g(~z x (f(~z x))h1 (x) : : : (f(~z x))hk (x)) if x 6= 0:
Uniqueness holds obviously.
Another application of coding is the principle of simultaneous recursion. This result
was mentioned by David Hilbert and Paul Bernays 1888,y1977] in 1934.
Lemma 3.2.9 (Simultaneous recursion). Let g1 : : : gn and h1 : : : hn be primi-
tive recursive functions. Then there are uniquely determined primitive recursive func-
tions f1 : : : fn satisfying
fi (~z 0) = gi (~z)
and
fi (~z x + 1) = hi (~z x f1(~z x) : : : fn(~z x))
for i = 1 : : : n:
128 III. Theory of Decidability
Proof. De
ne a function f~ by
~ z 0) = hg1 (~z) : : : gn(~z)i
f(~
and
~ z x + 1) = hh1(~z x (f(~
f(~ ~ z x))0 : : : (f(~
~ z x))n;1) : : :
~ z x))0 : : : (f(~
hn (~z x) (f(~ ~ z x)n;1)i:
Then f~ is primitive recursive and we get
~ z x))i;_ 1 for i = 1 : : : n:
fi (~z x) = (f(~
Uniqueness follows straightforward by induction on x:
As another application of coding we will show that there are eectively computable
functions which are not primitive recursive. To get this result we have to code primitive
recursive functions by natural numbers.
De
nition 3.2.10. The Godel number pf q of a primitive recursive function f is de-
ned inductively.
1. pCknq = h0 n ki
2. pPknq = h1 n ki
3. pS q = h2 1i
4. pSub(g h1 : : : hn)q = h3 (ph1q)1 pgq ph1q : : : phnqi
5. pR(g h)q = h4 (pgq)1 + 1 pgq phqi:
Note that we have coded a primitive recursive function f in such way that #f = (pf q)1 :
Put
CPR = fe : e codes a primitive recursive functiong:
Then we observe the following.
Proposition 3.2.11. CP R is primitive recursive.
Proof. We have
e 2 CPR , e 2 Seq ^
((e)0 = 0 ^ lh(e) = 3) _
((e)0 = 1 ^ lh(e) = 3 ^ 0 < (e)2 (e)1 ) _
((e)0 = 2 ^ lh(e) = 2 ^ (e)1 = 1) _
((e)0 = 3 ^ lh(e) 4 ^ 8i < lh(e)((i > 1 ! (e)i 2 CPR)
^ (i > 2 ! _(e)i1 = (e)1 )) ^ (e)21 = lh(e);_ 3) _
((e)0 = 4 ^ lh(e) = 4 ^ (e)2 2 CPR ^ (e)3 2 CPR
^ (e)1 = (e)21 + 1 ^ (e)31 = (e)1 + 1)]:
3.2. Primitive Recursive Coding 129
Lemma 3.2.12.
a) There are exactly @0 (= card(IN)) primitive recursive functions.
b) There are functions which are not primitive recursive.
Proof.
a) All constant functions are primitive recursive. So there are @0 primitive recursive
functions. Since distinct primitive recursive functions have distinct codes in
CPR IN we have at most @0 primitive recursive functions.
b) There are 2@0 (= card(2IN )) functions from IN to IN. As @0 < 2@0 by the
usual Cantor argument, there is function f : IN ! IN which is not primitive
recursive.
One should observe that pf q indeed codes an algorithm for the computation of f: The
leading component tells us whether we have to apply recursion, substitution or if we
have one of the basic functions. Since decoding is primitive recursive we may eectively
construct a primitive recursive function e] out of a code e 2 CPR: Thus the function
(
UPR (e x) = e](x) if e 2 CPR ^ (e)1 = 1
0 otherwise
is eectively computable.
Theorem 3.2.13. UPR is not primitive recursive.
Proof. Towards a contradiction assume that UPR is primitive recursive. Then
x:UPR (x x) + 1 is also primitive recursive. Let e0 be its code. Then
UPR (e0 e0) = e0 ](e0 ) = UPR (e0 e0 ) + 1:
A contradiction.
The diagonalisationargument in the proof of Theorem 3.2.13 reveals a general dilemma.
Whenever we try to de
ne eective computability in some precise way there will be
some algorithm for computing this functions and this algorithm can be coded. Thus
we will get some kind of coding and once we have a class of functions which can be
coded we may use the same diagonalisation argument as in 3.2.13 to show that there
are eectively computable functions not belonging to that class. The way out of this
dilemma is to regard partial functions.
Exercises
E 3.2.1. Prove that the following predicates are primitive recursive.
a) P1 = fn : n is sum of two odd prim numbersg
130 III. Theory of Decidability
b) P2 = fn : n is sum of its divisors 6= ng
E 3.2.2. (Raphael M. Robinson, 1947) We de
ne the iterative functions inductively
by the following clauses:
1. S Ckn Pkn x:(x)i x1 : : :xn :hx1 : : : xni are iterative functions.
2. If f g1 : : : gn are iterative, then so is Sub(f g1 : : : gn):
3. If g is iterative and unary and f : IN2 ! IN is de
ned by:
f(0 x) = x
f(n + 1 x) = g(f(n x))
then f is iterative.
Prove:
a) Every iterative function is primitive recursive.
b) Every primitive recursive function is iterative.
Hint: For f = R(g h) observe the function s : IN2 ! IN with
s(n~x) = hf(~x n) n ~xi
Show that for g h iterative so is s.
E 3.2.3. The Fibonacci-function is de
ned by
f(0) = f(1) = 1
f(n + 2) = f(n) + f(n + 1):
Show that f is primitive recursive.
E 3.2.4. De
ne : IN2 ! IN with (n m) = (m+n)(2m+n+1) + m: Prove that there are
primitive recursive functions 1 2 : IN ! IN such that
(1 (n) 2(n)) = n
using simultaneous recursion.
Here we are going to give an easy example, how to use the recursion theorem. We want
to prove, using the recursion theorem, that there is a recursive function f : IN2 ! IN
with
f(x 0) ' x2
f(x n + 1) ' f(f(x n) n):
Therefore we are going to de
ne h : IN3 ;!P IN by
(2
h(e x n) ' x 2 2 if n = 0
feg (feg (x n;_ 1) n;_ 1) if n 6= 0:
Using Theorem 3.4.2 h is partial recursive. Using the recursion theorem there is an
e 2 IN, such that
8x8n h(e x n) ' feg2(x n):
136 III. Theory of Decidability
Now one can prove by induction on n : 8n8x feg2(x n) #. So de
ne f = feg2, i.e. f is
partial recursive and dom(f) = IN2 , i.e. f is total. So f is recursive.
Exercises
E 3.4.1. Prove that there is a primitive recursive function f : IN2 ! IN, such that
8x ff(e0 e1)g1 (x) ' fe0 g1(fe1 g1(x)):
E 3.4.2. Prove that the Ackermann-P+eter function de
ned in E 3.1.5 is recursive using
the recursion theorem.
E 3.4.3.
a) (R. Peter, 1935) Prove that the function UPR of section 3.2 is recursive.
b) Prove that there is a relation which is recursive (i.e. a relation R such that R
is recursive) but not primitive recursive.
E 3.4.4. Prove that there is no normal form theorem of the following shape: There
is a primitive recursive relation T IN3 such that for all partial recursive functions
f : IN ;!P IN there is an e 2 IN such that
Now we have the means to give a second proof to show that there are universal partial
recursive functions.
Corollary 3.5.10. The function ,n : INn+1 ;! P IN de
ned by ,n(e~z) ' fegn(~z) is
partial recursive.
Proof. For the graph of the function ,n we have ,n(e~z) ' y i fegn(~z) ' y which
means
9u(T n(e~z u) ^ 8z < u:T n(e~z z) ^ U(u) = y):
So Gn is r.e. and by 3.5.9 ,n is partial recursive.
We close this section by a characterisation of recursive relations which is due to
E. L. Post (1943), S. C. Kleene (1943) and A. Mostowski (1947).
Theorem 3.5.11 (Post's theorem). A relation R is recursive i both R and :R
are r.e.
Proof. For the easy direction let R be recursive. Then R and :R are recursive and
hence also r.e. by 3.5.5. For the opposite direction let R and :R be both r.e. Then we
have recursive relations P1 and P2 such that
~x 2 R , 9u((~x u) 2 P1 )
and
~x 2= R , 9v((~x v) 2 P2 ):
Let
f(~x) ' z((~x z) 2 P1 _ (~x z) 2 P2 ):
3.5. Recursive, Semi-recursive and Recursively Enumerable Relations 141
Then f is partial recursive and obviously also total. Hence f is recursive. We claim
~x 2 R , (~x f(~x)) 2 P1
which by the closure of recursive relations under recursive substitutions entails the
recursiveness of R: To prove the claim we observe
~x 2 R ) 9u((~x u) 2 P1) ^ 8u((~x u) 2= P2 ):
Thus (~x f(~x)) 2 P1 and we have the direction from left to right. Conversely if ~x 2= R,
then 8u((~x u) 2= P1 ) which implies (~x f(~x)) 2= P1 :
Post's theorem is easy to visualise if we think in terms of decidability and positive
decidability. If R is decidable, then :R is and thus both are positively decidable.
On the other hand if R and :R are positive decidable we simultaneously apply the
algorithms which decide ~x 2 R and ~x 2= R positively. Since either ~x 2 R or ~x 2= R we
either get an answer assuring ~x 2 R or ~x 2= R: This, however, decides ~x 2 R:
Corollary 3.5.12. A (total) function f : INn ! IN is recursive i its graph is recursive.
Proof. If f is recursive, then Gf is r.e. by Theorem 3.5.9. Because
(~z y) 2= Gf , 9x(f(~z ) = x ^ y 6= x)
, 9x((~z x) 2 Gf ^ y =6 x)
:Gf is r.e., too. So by 3.5.11 Gf is recursive. The second direction follows directly by
3.5.9.
Finally we show that the classes of recursive and r.e. relations are indeed distinct.
The proof is based on a diagonalisation argument and was mentioned by E. L. Post
(1922), K. Godel (1931) and S. C. Kleene (1936)
Theorem 3.5.13. There is a r.e. relation which is not recursive, namely
K = fx : 9zT 1 (x x z)g = fx : x 2 Wx1 g:
Proof. K is r.e. by 3.5.4. Towards a contradiction assume that K is recursive. Then
:K is recursive, too, and there is an e 2 IN such that :K = We1 and we obtain
e 2= K , e 2 We1 , 9yT 1 (e e y) , e 2 K:
Thus K cannot be recursive.
Now we close this section by reviewing the connection between the subsets (unary
relations) of IN we have studied up to now.
142 III. Theory of Decidability
ZZ
Z
: ZZ Xy
ZZ XX
r.e. complements of r.e.
ZZ
ZZ recursive
Z
;;
primitive recursive
We learned that this picture is correct, e.g. by Post's theorem we know that the
recursive subsets of IN are just those subsets which are r.e. and complements of r.e. sets.
Exercises
E 3.5.1. Prove that the class of r.e. relations is not closed under unbounded universal
quanti
cation.
E 3.5.2. (S. C. Kleene, 1936) Let R IN be an in
nite set. Prove:
a) R is r.e. i R is range of a one-one recursive function.
b) R is recursive i R is range of a strictly increasing recursive function.
E 3.5.3.
a) There is an n 2 IN with Wn1 = fng.
b) For any recursive function f there is an n 2 IN with Wf1(n) = Wn1 :
P IN de
ned by
E 3.5.4. Let R IN2 be r.e. Is the function f : IN ;!
f(x) ' yR(x y)
partial recursive?
E 3.5.5. (S. C. Kleene, 1936) Prove that for a r.e. relation P INn+1 there is a
P IN such that
partial recursive function f : INn ;!
9yP (~x y) , f(~x) # ^P(~x f(~x)):
3.6 Rice's Theorem
Up to now we have been mainly concerned with recognising sets to be recursive. This
section is devoted to a theorem which may help us to see that many explicitly given
sets are not recursive. It is due to H. Rice in 1953. The idea behind that theorem
3.6. Rice's Theorem 143
is that it is only positively decidable if two partial recursive functions fe0 g fe1g are
extensionally dierent, i.e. if it is
9x fe0 g(x) 6' fe1g(x):
But now we have to observe the following closure property of partial recursive functions.
Proposition 3.6.1 (De
nition by cases). If P1 : : : Pn are pairwise disjoint r.e.
relations and g1 : : : gn are partial recursive functions, then the function f de
ned by
8
>
> g1 (~z) if P1(~z)
<... ..
.
f(~z ) ' >
>g (~z) if Pn(~z)
:"n otherwise
is partial recursive.
Proof. Using Theorem 3.5.9 we only have to prove that Gf is r.e. It is
(~z y) 2 Gf , f(~z ) ' y
, (P1(~z ) ^ g1(~z ) ' y) _ : : : _ (Pn(~z) ^ gn(~z) ' y):
This representation shows that Gf is r.e. since Ggi is r.e. by Theorem 3.5.9.
Theorem 3.6.2 (Rice's theorem). Let F be a nonempty set of n-ary partial recur-
sive functions such that F 6= ffegn : e 2 CP ^ (e)1 = ng: Then the set
fe : fegn 2 Fg
is not recursive.
Proof. Let M = fe : fegn 2 Fg: To obtain a contradiction assume that M is recursive.
Choose f 2 F and g 2= F but g n-ary partial recursive. Now de
ne h : INn+1 ;! P IN
by (
h(e~z) ' g(~z ) if e 2 M
f(~z ) if e 2= M:
Since M and :M are r.e. h is partial recursive by Proposition 3.6.1. Thus using the
recursion theorem there is an index e0 2 IN, such that
8~z h(e0 ~z) ' fe0 gn (~z):
Now we have
1. e0 2 M ) fe0 gn(~z) ' h(e0 ~z) ' g(~z) so fe0gn = g 2= F i.e. e0 2= M:
2. e0 2= M ) fegn(~z ) ' h(e0 ~z) ' f(~z ) so fe0gn = f 2 F i.e. e0 2 M:
In both cases we have yielded a contradiction.
144 III. Theory of Decidability
Corollary 3.6.3. Let f be partial recursive. Then the set of indices of f, i.e. the set
fe : fegn = f g, is not recursive and thus not
nite.
Corollary 3.6.4. The set of indices of all recursive functions is not recursive.
This result can be improved in the following fashion.
Theorem 3.6.5. The set of indices of all recursive functions is not r.e.
Proof. Let T ot = fe : feg is a recursive functiong. Assume that Tot is r.e. Then
there is a recursive function f, such that Tot = rg(f): Now de
ne g : IN ;! P IN by
g(x) ' ff(x)g1 (x) + 1: Then g is total, since f(n) 2 Tot and so ff(n)g1 is total.
Therefore g has an index in Tot, i.e. there is an e 2 IN such that g = ff(e)g1 : Now we
have
ff(e)g1 (e) = g(e) = ff(e)g1 (e) + 1:
This is a contradiction.
Exercises
E 3.6.1. Prove that P art = fx : Wx1 6= INg is not r.e.
Hint: Construct (using the Snm -theorem) a primitive recursive function f with x 2=
K , f(x) 2 P art where K IN was de
ned in Theorem 3.5.13.
E 3.6.2. De
ne Inf = fx = Wx1 is in
niteg. Prove:
a) Inf is not recursive.
b) Inf is not r.e.
Hint: De
ne a recursive function f with
x 2 Tot , f(x) 2 Inf
where Tot was de
ned in the proof of Theorem 3.6.5
E 3.6.3. De
ne: R IN is extensional if for all e0 e1 2 IN one has
e0 2 R ^ fe0 g1 = fe1 g1 ) e1 2 R:
a) Let 6= R 6= IN be extensional. Prove that there is either a recursive function
f : IN ! IN with
K = fx : f(x) 2 Rg
or a recursion function f : IN ! IN with
:K = fx : f(x) 2 Rg:
Hint: Let e0 2 IN with 8xfe0 g(x) " : If e0 2= R then choose e1 2 R: Observe the
function (
g(x y) ' fe1 g(y) if x 2 K
" otherwise.
For e0 2 R the proof runs similar.
b) Use part a) to prove Theorem 3.6.2.
3.7. Random Access Machines 145
3.7 Random Access Machines
Informally a random access machine is a computing device whose hardware consists of
a memory which is arranged in successively numbered (
nitely many) registers. Each
register is capable of storing an arbitrarily large number. The basic instructions are
INC(r) increase the content of register number r by one,
DEC(r) decrease the content of register number r by one,
BEQ(r) check whether the content of register number r is zero.
Formally we may de
ne a random access machine with n + 1 registers as a tuple
(INn+1 fINC(r) DEC(r) : r ng fBEQ(r) : r ng)
where
INC(r) : INn+1 ! INn+1
INC(r) (z0 : : : zr : : : zn) = (z0 : : : zr + 1 : : : zn )
Exercises
E 3.8.1. Prove that the set
V al = fpF q : F is valid in all structures g IN
is r.e.
E 3.8.2. De
ne Satfin = fpF q : F is valid in some
nite structureg.
Prove:
a) Satfin is r.e.
Hint: Show that without loss of generality L is
nite observing only non-isomor-
phic structures.
b) Satfin is not recursive
Hint: De
ne FP
~x as in the proof of Theorem 3.8.2 but with x < Sx only for
those x which are not maximal w.r.t. < : For the content of the registers one
needs r < Sr:
E 3.8.3. Prove that the set
V alfin = fpF q : F is valid in all
nite structures g
is not r.e.
152 III. Theory of Decidability
Chapter 4
Axiom Systems for the Natural Numbers
The topic of this section is the description of the structure of natural numbers within
the frame of
rst order logic. It will turn out that this structure cannot be categori-
cally described and that there are very interesting phenomena to be observed. These
phenomena incorporate a serious limit to the expressional power of
rst order axiom
systems and are known as Kurt Godel's incompleteness theorems.
Exercises
E 4.1.1. Let T be a r.e. theory, i.e. the set fpF q : F 2 T g is r.e. Then it is
fpF q : T j= F g
a r.e. set. (For the notion pF q cf. section 4.2.)
Now we can prove Godel's second theorem which states that an adequate theory cannot
prove its own consistency. This theorem has also been published in 1931. It destroyed
the so-called Hilbert's programme which was initiated by David Hilbert. Aim of
this programme was that it should be possible to prove the consistency of any given
(mathematical) theory by nite means, i.e. means available in NT:
164 IV. Axiom Systems for the Natural Numbers
Theorem 4.2.9 (Second incompleteness theorem). T 6` con(T):
Proof. By the
rst incompleteness theorem we have
T 6` G1
and by Lemma 4.2.8
T ` con(T) ! G1 :
So we just have T 6` con(T ):
Using the facts which we needed for the proof of the second incompleteness theorem
we can prove a nice result now.
Theorem 4.2.10. NT is !-incomplete.
Proof. By the second incompleteness theorem we have
NT 6` con(NT)
i.e. we have
NT 6` 8x:Proof(x p0 = 1q):
But we also have
NT ` :Proof(n p0 = 1q)
by Theorem A.1.16 since NT is consistent and we have
NT 6` 0 = 1:
Exercises
E 4.2.1. (A. Tarski) Prove that there is no LNT -formula Tr with FV(T r) = fx1g
such that for all sentences F
NT ` F $ Tr(pF q):
Chapter 5
Other Logics
In the
rst four chapters of this book we have been only confronted with one kind of
logic:
rst order logic.
As it is for
rst order logic a (general) logic is given by two aspects: its syntax and
its semantics. In this chapter we will give various modi
cations of the syntax and
semantics of
rst order logic. We learned that
rst order logic has two important
features:
compactness and Lowenheim-Skolem
properties. These give reason for certain limitations of the expressive power of the
rst
order logic. We will try to analyse these properties for other logics.
Exercises
E 5.1.1. Finish the proofs of Theorem 5.1.12 and Theorem 5.1.13.
E 5.1.2. Prove the omitting types theorem for many-sorted logic: let T be a countable
and consistent LI -theory, and let M be a set of formulas with free variables among
xi11 : : : xinn without a T-generator. Then there is a countable model S I of T such that
no (xi11 : : : xinn )-type in S contains M.
5.2 ! -Logic
If we take a two-sorted language and a
xed structure S in which we will interpret one
of the two sorts of variables we obtain so-called S -logic.
In this section we take IN (= !) as the
xed structure. But now we de
ne syntax
and semantics of L! .
De
nition 5.2.1. L! is a two-sorted language with identity. We denote the two sorts
of variables by
n m n0 : : :
x y z : : :
Furthermore, for every n 2 IN we have a constant symbol n in L! . This
nishes the
de
nition of the syntax of L! is a two-sorted language. The dierence to a two-sorted
logic is given by the semantics. Here we want that the
rst sort ranges over the natural
numbers.
De
nition 5.2.2. An L! -structure S! is a structure for the two-sorted language L!
such that
S! = ((IN S) C F P)
and with
nS! = n 2 IN:
Our
rst observation for !-logic is the failure of the compactness property.
Theorem 5.2.3. !-logic does not have the compactness property.
Proof. Let L! have a constant symbol c of the sort of natural numbers and take
M = fn 6= c : n 2 INg:
Then M is
nitely consistent in !-logic as it is in
rst order logic. But in !-logic M
is inconsistent since we have to interpret c by a natural number.
5.2. !-Logic 173
In !-logic we are able to express the torsion property of a group. Remember that due
to the compactness theorem this was not possible in
rst order logic (cf. the end of
section 1.5). In !-logic we have to add some axioms to the list of
rst order axioms of
group theory:
x0 = 1
xn+1 = xn
x
If we have Ax!GT is AxGT plus these axioms, we obtain that
S! j= Ax!GT i S! is a group
and for a structure with S! j= Ax!GT we have
S! j= 8x9n(n 6= 0 ^ xn = 1) i S! has the torsion property.
Theorem 5.2.4. !-logic neither has the Lowenheim-Skolem upward property nor the
Lowenheim-Skolem downward property.
Proof. To refute the Lowenheim-Skolem properties we de
ne a language L! and an
L! -sentence F such that for all L! -structures S! we have
S! j= F ) card(S) = @0 :
Therefore take a function symbol f into L! and de
ne F expressing that f S! is a
one-one map from IN onto S. I.e. let F be the formula
8x9n(f(n) = x) ^ 8n8m(f(n) = f(m) ! n = m):
Now we will introduce a calculus for !-logic. This will be done in the following way:
we de
ne M ! F similarly to section 5.1 where we de
ned a Hilbert style calculus
for many-sorted logic and add the clause
6. M ! Fn(m) for all m 2 IN implies M ! 8nF (!-rule)
Unlike all rules which have been considered previously, the !-rule is not a
nite rule:
it requires in
nitely many premises.
Lemma 5.2.5 (!-soundness theorem). M ! F implies M ! F
Proof. Here by M ! F we denote that for all L! -structures S! with
S! j= M we have S! j= F:
All we have to check is the !-rule. But it is sound since we have
S! j= 8nF i S! j= Fn(m) for all m 2 IN:
A more surprising fact is the completeness of the calculus with !-rule with respect to
!-structures. This was uncovered by L. Henkin (1954) and S. Orey (1956).
174 V. Other Logics
Theorem 5.2.6 (!-completeness theorem). Let L! be countable and M a set of
L! -formulas. Then
M ! F implies M ! F:
Proof. Suppose M 6 ! F: Think of L! as a two-sorted language and denote the
two-sorted calculus by M ` F (as de
ned in section 5.1, but only for the two-sorted
language L! ). Now set
T = fG : M ! G and G is a sentence g:
Since M 6 ! F we have
T 0 = T f:F g
is consistent (in the two-sorted sense) because of
(5.2) T ` G , M ! G:
Now let m be a variable and
; = fm 6= n : n 2 INg:
0
Next we prove that ; has no T -generator (in two-sorted sense). Therefore suppose
G is a T 0 -generator of ;:
Then we have for each n 2 IN
T 0 ` G ! m 6= n:
Substituting n for m and using the identity axioms we obtain
T 0 ` :Gm (n):
But this entails
T ` :F ! :Gm (n):
Using (5.2), the !-rule and (5.2) again we get
T ` :F ! :G
and this implies
(5.3) T 0 ` :G:
But we wanted that G is a T 0-generator, and this means T 0 fGg is consistent contrary
to (5.3). Thus we have proved that ; has no T 0 -generator. By the omitting types
theorem for many-sorted logic (cf. Exercise E 5.1.2) we get a model S of T 0 such that
no 1-type in S contains ;. This means that S is a !-model, say S! , because for every
s 2 S in the sort of the natural numbers there is an n 2 IN such that
S! j= m = ns]:
Furthermore we have
S! j= M and S! j= :F:
But this means M 6 ! F:
Here we close our observations about !-logic.
5.3. Higher Order Logic 175
5.3 Higher Order Logic
In this section we deal with second order logic and mention how to change or extend the
de
nitions to obtain third or even higher order logic. Second order logic is intended
to express properties of elements and subsets (second order objects) of a non-
xed
structure. In addition third order logic includes statements concerning subsets of
subsets (third order objects) of that structure. We will see that second (and of course
higher) order logic is at least as strong as !-logic. That is why we cannot expect to
have the compactness or Lowenheim-Skolem property.
De
nition 5.3.1. L2 is a two-sorted language with identity. We denote the two sorts
of variables by
x y z : : :
X Y Z : : :
Furthermore, we have a binary predicate symbol with # = (1 2), i.e. we have
formulas of kind xX.
In general we will have for nth order logic an n-sorted language Ln containing predicate
symbols 1 : : : n;1 with #i = (i i + 1) i = 1 : : : n ; 1. The semantics will be
declared as follows.
De
nition 5.3.2. An L2-structure S2 is a structure for the two-sorted language L2
such that
S2 = ((S Pow(S)) C F P)
and with S2 =2, i.e. the interpretation of the -symbol is the element relation. S is
called the
rst order part of S2.
For third order logic we consider three-sorted structures of the form
S3 = ((S Pow(S) Pow(Pow(S))) C F P)
and interpret 1 2 by the 2-relation. This means third order logic extends second
order logic, and so we will restrict us to second order logic from now on. All results
obtained for second order logic are valid for all higher order logics.
At
rst we are going to dene the natural numbers in L2PA , where L2PA is the
second order version of LPA (cf. section 1.4.1) with a constant symbol N for the
natural numbers. The axiom system PA2 is formulated in L2PA , comprises PA (with
the induction scheme extended to L2PA formulas) and contains in addition the axioms
(N1) 0N ^ 8x(xN ! S(x)N)
(N2) 8X(0X ^ 8x(xX ! S(x)X) ! 8x(xX ! xN))
These two axioms express that N is a constant symbol for the least set containing 0
which is closed under the successor function, i.e. the set IN.
176 V. Other Logics
Theorem 5.3.3. Let S2 j= PA2. Then the
rst order part S of S2 is isomorphic to
N , the structure of the natural numbers.
Proof. Using the induction scheme and (N1) we obtain
PA2 j= 8x(xN):
But this means S = N S2 . Because of (N2) the
rst order part can be extended to a
(
rst order) NT model satisfying (Ind) of Theorem 4.1.2. By that theorem we get the
isomorphism between S and N .
But this means that second order logic is quite powerful: using second order logic we
can
x the natural numbers. This conicts with the compactness and Lowenheim-
Skolem properties.
Theorem 5.3.4. Second order logic does not have the compactness property.
Theorem 5.3.5. Second order logic neither has the Lowenheim-Skolem upward prop-
erty nor the Lowenheim-Skolem downward property.
Using a certain modi
cation of the semantics of second order logic we will be able to
talk about subsets of a structure without losing a
rst order semantics. We will call
this logic weak second order logic. The syntax of Lw2 is the same as of L2.
De
nition 5.3.6. An Lw2 -structure S2w is a structure for the two-sorted language Lw2
such that
S2w = ((S1 S2) C F P)
with S2 Pow(S1 ) and S2w =2. S1 is called the
rst order part of S2w S2 is the second
order part.
But we can also regard Lw2 simply as a two-sorted language. A two-sorted structure
for Lw2 (viewed not as weak second order logic)
S 2 = ((S1 S2 ) C F P)
is called regular if S2 Pow(S1 ) and S 2 =2. So regular structures are just weak
second order structures.
Theorem 5.3.7. Regard Lw2 as a two-sorted logic. Then every two-sorted structure
S 2 for Lw2 is isomorphic to a regular structure, i.e. to a weak second order structure
for Lw2 .
Proof. We de
ne ' : S2 ! Pow(S1 ) by
'(S) = fs 2 S1 : s S 2 S g:
Furthermore, let S10 = S1 , S20 = f'(s) : s 2 S2 g and C 0 F0 P0 be homomorphic
interpretations of the non-logical symbols under '. Then
S 02 = ((S10 S20 ) C 0 F0 P0)
5.3. Higher Order Logic 177
is a regular structure and ' is a homomorphism onto S20 . ' is one-one since sets are
equal i they have the same elements.
As a corollary to this theorem we can transfer results of many-sorted logic to weak
second order logic.
Theorem 5.3.8 (Compactness for weak second order logic). Let M be a set of
Lw2 -formulas such that every
nite subset of M is consistent, then M is consistent.
Theorem 5.3.9 (Lowenheim-Skolem for weak second order logic). Let S2w be
an Lw2 -structure and = card(S1 S2 ) !:
a) For any in
nite
with card(Lw2 )
and any sets S10 wS1 and S20 S2 with
card(S10 S20 )
, there is an elementary substructure S 0 2 such that S10 S10 ,
S20 S20 and card(S10 S20 ) =
:
b) For any
maxf card(Lw2 )g there is an elementary extension S 0 w2 % S2w such
that card(S10 S20 ) =
:
At last we will mention that the two-sorted calculus, de
ned at the end of section 5.1
is complete for Lw2 , too.
Exercises
E 5.3.1. Prove Theorem 5.3.4 and Theorem 5.3.5.
E 5.3.2. Prove compactness and Lowenheim-Skolem properties for weak second order
logic.
E 5.3.3. Make explicit the complete calculus for weak second order logic, mentioned
at the end of the section.
E 5.3.4. Lfin2 is called
nite second order logic, which is obtained by changing the
semanticsfinof L2 as follows: second order objects are
nite sets of
rst order objects.
I.e. an L2 -structure is given by
S2fin = ((S Fin(S)) C F P)
where Fin(S) is the set of all
nite subsets of S. Prove:
a) For every Lfin
2 -sentence F there is an L2-sentence G with
S2fin j= F i S2 j= G:
b) Lfin
2 does not have the compactness property.
c) Lfin
2 has the Lowenheim-Skolem property.
Remark: This part of the exercise is dicult.
178 V. Other Logics
Appendix A
The last lemma has established the third hypothesis. To de
ne the proof predicate we
have to
x a calculus for
rst order logic. We opt for a Hilbert-style calculus. There
we have the following axioms:
182 Appendix
sententially valid formulas
8xF ! Fx(t)
de
ning axioms for = (cf. 1.10.2)
Non-logical axioms of NT are given by
de
ning axioms for the function symbols of LNT
the induction scheme (IND) (cf. section 4.1)
Proposition A.1.9. The following relations are primitive recursive:
a) PP (n m) , n is code of a propositional part of the formula with code m
b) PA(n m) , n is code of a propositional atom of the formula with code m
c) BA(n m) , m is code of a boolean assignment on the propositional atoms of
the formula with code n
Proof. Parts a) and b) are established easily. For part c) observe that we have
BA(n m) ,F ml(n) ^ Seq(m) ^ lh(m) = n ^
8x n((PA(x n) ! (m)x 1) ^
(:PA(x n) ! (m)x = 2):
Proposition A.1.10. There is a primitive recursive function Bval with
Bval(pF q n) =truth value of the formula F under
the boolean assignment n:
Proof. De
ne by course-of-values recursion on x
8 (y)x if Fml(x) ^ BA(x y) ^ ((x)0 = 9 _ (x)0 = 12)
>
>
>
> 1;_ Bval((x)1 y)
< if Fml(x) ^ BA(x y) ^ (x)0 = 10
Bval(x y) = > Bval((x) y)
Bval((x) y)
1 2
>
> if Fml(x) ^ BA(x y) ^ (x)0 = 11
: 0 otherwise
Now the only hypothesis of the previous section to check is (G4). Therefore we are
going to prove `formalized' versions of Theorem A.1.16.
De
nition A.1.22. We are going to de
ne pF x_ 1 : : : x_ nq recursively on n (outside of
NT) as follows
pF x_ 1q = subst(pF q px1q N(x1))
pF x_ 1 : : : x_ n q = subst(pF x_ 1 : : : x_ n;1q pxnq N(xn)):
I.e. pF x_ 1 : : : x_ n q is a term with free variables x1 : : : xn. It denotes (codes up) the
formula F after replacing the free variables by numerals.
Proposition A.1.23.
F x_ 1 : : : x_ nqx1
:::
xn (k1 : : : kn) = pFx1
:::
xn (k1 : : : kn)q
p
and so + 1 : Contradiction.
3: ) 1: Assume that
is not a limit ordinal. Then there is a such that + 1 =
:
Hence
= supf : <
g =
= + 1:
Contradiction.
At this point we are able to prove the facts for ordinals used in section 1.4.
Theorem A.2.16 (Trans
nite induction). If for all
2 On we have
8<
F() ! F(
)
then we have F (
) for all
2 On:
Proof. This follows directly by Lemma A.2.2 and Lemma A.2.11.
Corollary A.2.17. If we have
1: F(0)
2: 8
(F(
) ! F (
+ 1))
3: for every limit ordinal
8 <
F() ! F(
)
then we have F (
) for all
2 On:
Proof. By trans
nite induction on
we proof 8
F (
): Thus we have
8<
F()
as induction hypothesis. Now we have to show F(
): If
= 0 we have F (
) by 1: If
is a successor, say
= + 1, then it is <
and we have F() by the induction
hypothesis. But then F(
) follows by 2: If
is a limit ordinal F (
) follows directly
from 3: and the induction hypotheses.
Now we turn to de
ne functions by trans
nite recursion. We want to de
ne a function
F on the ordinals in such a way that we are allowed to de
ne F(
) for
2 On in
the terms of
and all the F () for <
: All those F() are contained in the single
object
F
= F f : <
g:
Theorem A.2.18 (Trans
nite recursion). If G is a binary function, then there is
a uniquely determined function F such that
F(
) = G(
F
)
holds for all
2 On:
A.2. Naive Theory of the Ordinals 197
Proof. First we prove that F is uniquely determined. Therefore let F 0 be a function
with
F 0(
) = G(
F 0
)
holds also for all
2 On: We prove
8
(F(
) = F 0(
))
by trans
nite induction on
: By the induction hypothesis we have
8 <
(F() = F 0()):
So it is F
= F 0
and therefore
F(
) = G(
F
) = G(
F 0
) = F 0(
):
This
nishes the induction. It remains to prove the existence of the function F: We
prove that for every
2 On the function F
exists by induction on
: If
= 0, then
it is
F 0=F =
and if
= + 1 we have by induction hypothesis the function F : Now we de
ne
for <
(
F
() = F () if <
G( F ) if = :
And if
is a limit ordinal we have by induction hypothesis for every <
a function
F : Now de
ne for <
F
() = F + 1():
This is de
ned since if it is <
so we have + 1 <
: Now we can prove that the
function F de
ned by
F(
) = F
+ 1(
)
comes up to
F(
) = G(
F
)
by induction on
: This is left to the reader.
Corollary A.2.19. There is a uniquely determined function F such that
1: F(0) = X
2: F(
+ 1) = G(
F(
))
3: F(
) = H(
F
) for limit ordinals
where X is a set and G H are given functions.
198 Appendix
Proof. De
ne for
2 On and functions f de
ne the function G0 by
8
>
<X if
= 0
G0(
f) = >G( f()) if
= + 1
:H(
f
) if
is a limit ordinal
and apply Theorem A.2.18.
By this corollary we have proved all the facts we presented in section 1.4.
A.3 Cardinal Numbers
In section 1.4 we met cardinals in the form of special ordinals. Here we will give a short
introduction to the theory of cardinals and elementary cardinal arithmetic using the
naive theory of the ordinals. Studying cardinals means to study sets with respect to
quantitative aspects. For
nite sets we are used to it. But are there dierent types of
innite sets? This theory is a theory of in
nity. It was developed by Georg Cantor
at the end of the last century.
De
nition A.3.1. The sets A B are called equinumerous if there is a one-one map
from A to B. In this case we write A B.
Proposition A.3.2. is an equivalence relation.
We have the following equinumerous sets.
Lemma A.3.3. Let A B C D be sets. Then it is:
a) If A B and C D, then
AC B D
Pow(A) Pow(B)
C A DB
b) If A \ B = , then C A
B C A C B .
c) It is C AB (C B )A .
d) It is Pow(A) f0 1gA.
Proof. We leave a) and c) to the reader. In b) we have to de
ne a one-one map
onto C A C B :
F : C A
B ;!
So let f 2 C A
B , i.e. f : A B ! C. Then we de
ne F(f) = (f A f B). So F is
one-one and since A \ B = we also have that F is onto. This proves b). In d) we
just have to map every subset to its characteristic function.
To give just one example concerning the real numbers R we have
R Pow(IN) ININ f0 1gIN
and the interested reader is requested to prove this. Using Proposition A.3.2 we can
imagine cardinals as equivalence classes.
A.3. Cardinal Numbers 199
De
nition A.3.4. The equivalence classes of the relation are called cardinals. The
equivalence class of the set A is denoted by card(A).
Now we are going to install an ordering on the class of all cardinals.
De
nition A.3.5. Let A B be sets. Then we de
ne A 4 B if there is a one-one map
from A to B.
Using the well-ordering theorem the following theorem is just a proposition. But it
still remains true if the well-ordering theorem is not available. In that context it is
called Cantor-Bernstein theorem.
Theorem A.3.6. A 4 B and B 4 A imply A B.
Proof. We will only give a sketch of the proof not using the well-ordering theorem.
First we prove a special version of this theorem. Therefore let A B C with A C
be given. Then we will show B C.
Since C A we have a one-one map f from C onto A. Now de
ne
B0 = B Bn+1 = ff(b) : b 2 Bn g
C0 = C Cn+1 = ff(c) : c 2 Cng
with n 2 IN. Then g : C ! B de
ned by
g(x) = f(x) if there is an n 2 IN with x 2 Cn n Bn
x otherwise
is a one-one map from C onto B, i.e. B C.
Now we will prove the general version of the theorem. Since A 4 B and B 4 A we
have one-one maps f : A ! B and g : B ! A. But then
A0 = fg(f(a)) : a 2 Ag fg(b) : b 2 B g A
and A A0 (with g f one-one and onto). So we get by the above observations
A fg(b) : b 2 B g B:
The relation 4 can be transferred to the cardinals.
Proposition A.3.7. The relations 4 and are compatible.
Proof. Let A B C D be sets with A 4 B C 4 D. But then A 4 D using
composition of functions. But we wanted this to be proved.
By the well-ordering theorem there is an ordinal in every equivalence class w.r.t. ,
i.e. in every cardinal. So the least such ordinal will be a canonical representative for
that equivalence class. From now on we will identify a cardinal with its canonical
representative, i.e. the class of all cardinals is a subclass of the ordinals. Furthermore
4 and coincide.
Historical Texts
It follows a list of the books mentioned in the historical remarks.
Boole, G.
1847 The mathematical analysis of logic, reprinted 1947, Blackwell: Oxford, 82 pp
1854 The laws of thought, reprinted 1958, Dover, xi+424 pp
Frege, F.L.G.
1879 Begrisschrift, eine der arithmetischen nachgebildete Formelsprache des rei-
nen Denkens, reprinted 1964 in: Begrisschrift und andere Aufsatze, Olms,
xvi+124 pp
Leibniz, G.W.
1666 De arte combinatoria, reprinted 1858 in: Leibnizens mathematische Schriften,
Halle, pp 7{79
Peano, G.
1897 Formulaire de mathematiques, vol. 2, chap I, Bocca & Clausen, 63 pp
Whitehead, A.N. & Russell, B.
1910 Principia mathematica, vol. I, 2nd ed. reprinted 1957, Cambridge University
Press, xlvi+674 pp
1912 Principia mathematica, vol. II, 2nd ed. reprinted 1957, Cambridge University
Press, xxiv+772 pp
1913 Principia mathematica, vol. III, 2nd ed. reprinted 1957, Cambridge University
Press, x+491 pp
Original Articles
In the following the original papers concerning important theorems of this book are
listed.
Church, A.
1936 A note on the `Entscheidungsproblem', Journal of Symbolic Logic 1, pp 40{41
and pp 101{102
204 Bibliography
Craig, W.
1957 Linear reasoning. A new form of the Herbrand-Gentzen theorem, Journal of
Symbolic Logic 22, pp 250{268
1957 Three uses of the Herbrand-Gentzen theorem in relating model theory and proof
theory, Journal of Symbolic Logic 22, 269{285
Gentzen, G.
1935 Untersuchungen uber das logische Schliessen, I, II, Mathematische Zeitschrift
39, pp 176{210 and pp 405{431
Godel, K.
1930 Die Vollstandigkeit der Axiome des logischen Funktionenkalkuls, Monatshefte
fur Mathematik und Physik 37, pp 349{360
formal unentscheidbare Satze der `Principia Mathematica' und verwand-
1931 Uber
ter Systeme, Monatshefte fur Mathematik und Physik 38, pp 173{198
Henkin, L.
1949 The completeness of the rst-order functional calculus, Journal of Symbolic
Logic 14, 159{166
1954 A generalization of the notion of !-consistency, Journal of Symbolic Logic 19,
pp 183{196
Herbrand, J.
1930 Recherches sur la theorie de la demonstration, Trauvaux de la Societ+e des
Sciences et lettres de Varsovie, Classe III sciences math+ematique et physiques
33, 128 pp
Hilbert, D. & Bernays, P.
1934 Grundlagen der Mathematik, vol. I, 2nd ed. reprinted 1968, Springer0 xv+473
pp
1939 Grundlagen der Mathematik, vol. II, 2nd ed. reprinted 1970, Springer, xiv+561
pp
Kleene, S.C.
1936 A note on recursive functions, Bulletin of the American Mathematical Society
42, pp 544{546
1936 General recursive functions of natural numbers, Mathematische Annalen 112,
pp 727{742
1938 On notations for ordinal numbers, Journal of Symbolic Logic 3, pp 150{155
Lowenheim, L.
Moglichkeiten im Relativkalkul, Mathematische Annalen 76, pp 447{470
1915 Uber
Lyndon, R.C.
1959 Existential Horn sentences, Proceedings of the American Mathematical Society
10, pp 994{998
Original Articles 205
Mal'cev, A.I.
1936 Untersuchungen aus dem Gebiete der mathematischen Logik, Matematicheskij
Sbornik, n.s., Akademiya Nauk SSSR i Moskovskoe Matematicheskoe Obshch-
estvo 1 (43), pp 323{336
Mostowski, A.
1947 On denable sets of positive integers, Fundamenta mathematicae 34, pp 81-112
Orey, S.
1956 On !-consistency and related properties, Journal of Symbolic Logic 21, pp 246{
252
P+eter, R.
den Zusammenhang der verschiedenen Begrie der rekursiven Funktio-
1934 Uber
nen, Mathematische Annalen 110, pp 612{632
1935 Konstruktion nichtrekursiver Funktionen, Mathematische Annalen 111, pp 42{
60
Post, E.L.
1921 Introduction to a general theory of elementary propositions, American Journal
of Mathematics 43, pp 163{185
Robinson, R.M.
1947 Primitive recursive functions, Bulletin of the American Mathematical Society
54, pp 925{942
Rice, H.
1953 Classes of recursively enumerable sets and their decision problems, Transac-
tions of the American Mathematical Society 74, pp 358{366
Rosser, J.B.
1936 Extensions of some theorems of Godel and Church, Journal of Symbolic Logic
1, pp 87{91
Skolem, T.A.
1920 Logisch-kombinatorische Untersuchungen uber die Erfullbarkeit oder Beweis-
barkeit mathematischer Satze nebst einem Theorem uber dichte Mengen, Norske
Videnskaps - Akademi i Oslo, Mathematisk-Naturvidenskapelig Klasse, Skrifter
4, pp 1{36
1923 Begrundung der elementaren Arithmetik durch die rekurrierende Denkweise
ohne Anwendung scheinbarer Veranderlichen mit unendlichem Ausdehnungs-
bereich, Norske Videnskaps - Akademi i Oslo, Mathematisk-Naturvidenskapelig
Klasse, Skrifter 6, pp 1{38
206 Bibliography
Tait, W.W.
1968 Normal derivability in classical logic, in: The Syntax and Semantics of In-
nitary Languages, editor: Barwise, J., Lecture Notes in Mathematics 72,
Springer, pp 204{236
Tarski, A. & Vaught, R.L.
1957 Elementary (arithmetical) extensions, Summaries of Talks Presented at the
Summer Institute for Symbolic Logic, Institute for Defence Analyses, CRD,
pp 160{163
Turing, A.M.
1936 On computable numbers, with an application to the Entscheidungsproblem, Pro-
ceedings of the London Mathematical Society, ser. 2, 42, pp 230{265 and
corrections ibid. 43, pp 544{546
Text Books
Here we list interesting text books for readers who want to learn more about mathemat-
ical logic. Of course, this must be only a collection of some good texts in mathematical
logic.
General Logics
Barwise, J. (ed.)
1977 Handbook of mathematical logic, North-Holland, xi+1165 pp
This book has an encyclopedic character with advanced texts concerning var-
ious topics of all areas of mathematical logic.
Shoen
eld, J.R.
1967 Mathematical logic, Addison-Wesley, vii+344 pp
This is the standard reference for standard theorems in mathematical logic. It
goes far beyond this book and is a good addition to it.
Recursion Theory
Hinman, P.G.
1978 Recursion theoretic hierarchies, Springer, xii+480 pp
This is an advanced text book dealing with de
nability theory and hierarchies.
Odifreddi, P.
1989 Classical recursion theory, North-Holland, xviii+688 pp
This is a comprehensive written survey of recursion theory.
Rogers, H.
1967 Theory of recursive functions and eective computability, McGraw-Hill, xxi+
482 pp
This is the standard reference for recursion theory. It is written quite illustra-
tively.
Text Books 207
Model Theory
Chang, C.C. & Keisler, H.J.
1990 Model theory, 3rd ed., North-Holland, xvi+650 pp
This is the standard text book for model theory. It covers besides pure logic
and advanced set theory.
Set Theory
Jech, Th.
1978 Set theory, Academic Press, xiv+391
This book is the standard reference in set theory.
Levy, A.
1979 Basic set theory, Springer, xiv+391 pp
This is a soft, comprehensive introduction to set theory.
Proof Theory
Girard, J.Y.
1987 Proof theory and logical complexity, vol. I, Bibliopolois, 503 pp
This book is a thorough introduction to proof theory of Peano arithmetic.
Pohlers, W.
1989 Proof theory, Lecture Notes in Mathematics 1407, Springer, vi+213 pp
This is a straight forward introduction to a special
eld of proof theory: im-
predicative proof theory.
Schutte, K.
1977 Proof theory, Springer, xii+299 pp
This book contains the basic proof theoretical results in impredicative proof
theory.
Takeuti, G.
1987 Proof theory, 2nd ed., North-Holland, x+490 pp
This book contains besides hardly readable chapters a good survey of proof
theoretical results about Peano Arithmetic.
Others
Hurd, A.E. & Loeb, P.A.
1985 An introduction to nonstandard real analysis, Academic Press, xii+232 pp
This is as mentioned in the text.
208 Bibliography
Glossary
Notational Conventions
the empty set, 3
IN the natural numbers, 3
dom(f) domain of the function f, 3
rg(f) range of the function f, 3
f Z restriction of f to Z, 3
XY the set of all functions from Y to X, 3
Pow(X) power set of X, 3
X nY the set X without Y , 3
X Y union of X and Y , 3
X \Y intersection of X and Y , 3
idX the identity map on X, 3
Chapter I
^ and, 6,7
_ or, 6,7
: not, 6,7
! implies, 6,7
8 for all, 6,7
9 there is, 6,7
C constant symbols, 7
F function symbols, 7
P predicate symbols, 7
L
rst order language, 7
L(C F P )
rst order language with non-logical symbols speci
ed, 7
FV(t) free variables of the term t, 8
FV(F) free variables of the formula F, 8
BV(F ) bounded variables of the formula F, 8
: truth function for negation, 11
^ truth function for conjunction, 11
_ truth function for disjunction, 11
! truth function for implication, 11
B (A) value of the sentential form A under the boolean assignment B , 12
AB equivalence of sentential forms, 13
210 Glossary
S structure, 17
C constants of a structure, 17
F functions of a structure, 17
P predicates of a structure, 17
V set of all variables, 18
tS ] value of t under the assignment in the structure S , 18
ValS (F ) truth value of F in S under the assignment , 19
x and dier at most at x, 19
S j= F] F is true in S under , 19
S 6j= F] F is false in S under , 19
Fx (t) F with x replaced by t, 20
sx (t) s with x replaced by t, 20
=i:h: is equal to (by the induction hypothesis), 21
LS L extended by constant symbols for elements of S, 22
SS S expanded by constants for S, 22
S j= F F is valid in S , 23
j= F F is valid, 23
AxGT axioms of group theory, 23
S j= Fa1 : : :an] F is valid in S under the assignment a1 : : : an, 24
F S G semantical equivalence of formulas, 24
$ if and only if, 24
PP(F) propositional parts of F, 27
PA(L) propositional parts of L, 27
PA(F ) propositional atoms of F, 27
FB truth value of F under the boolean assignment B , 28
B boolean assignment induced by , 28
BM boolean assignment induced by the set M, 30
!
rst limit ordinal, 32
card(M) cardinality of M, 32
@0 cardinality of the natural numbers, 32
c9xF Henkin constant for 9xF, 35
LH Henkin extension of L, 38
KH Henkin constants, 38
degH (c) Henkin degree of c, 38
degH (F) Henkin degree of F, 38
HL Henkin set, 38
L1 L2 sub-language, 38
SH LH -expansion of S , 49
S j= M S is a model of M, 40
card(L) cardinality of the language L, 40
M j= F F is logical consequence of M, 46
F1 : : : Fn j= F F is logical consequence of F1 : : : Fn, 46
M `F M proofs F, 49
LT Tait-language for L, 54
P predicate symbols in the Tait-language for complements, 54
Glossary 211
F negation of F in the Tait-language, 55
T ; proof of ; in the Tait-calculus, 55
:$ negation of $, 56
S j= $ $ is valid in S , 56
$r reductum of $, 58
dom() length of the sequence , 59
!<! the number sequences, 59
is initial segment of , 59
S search tree for $, 60
FN prenex form of F, 68
FH Herbrand form of F, 69
LH Herbrand language, 69
? empty formula, 74
> dual of ?, 74
>-Ax $ proof in the extended Tait calculus, 74
FT translation of F into the Tait-language, 76
;F operator induced by F, 78
LI language with identity, 82
Id0 open form of the identity axioms, 83
M Id F logical consequence respecting LI-structures, 84
Id $ proof with identity axioms, 86
Idt term form of the identity axioms, 87
Chapter II
L(T) language of T, 93
T(L) extension of T by de
nition, 95
Th(S ) theory of S , 99
' : S1 ,! S2 embedding, 99
' : S1 $ S2 elementary embedding, 99
S1 S2 substructure, 99
S1 $ S2 elementary substructure, 99
Diag(S ) diagram of S , 100
S1 = S2 the structures S1 and S2 are isomorphic, 101
Con(Ax) logical consequences of Ax, 102
ModL (T) model class of T, 102
card(T ) cardinality of T, 103
Chapter III
Ckn constant function with value k, 116
Pkn kth projection, 116
S successor function, 116
Sub(f g1 : : : gn) substitution, 116
R(g h) recursor, 116
212 Glossary
pd predecessor function, 117
;_ arithmetical dierence, 117
~x:f(~x ~y) functions taking arguments for ~x, 118
sg sign function, 119
sg dual function to sg, 119
R characteristic function of R, 119
xz bounded -operator, 120
p(n) nth prime, 125
(x y) multiplicity of p(y) in the factorisation of x, 125
<> code of the empty sequence, 125
hz0 : : : zni coded sequence, 125
(x)i ith component of a coded sequence, 125
Seq coded sequences, 125
lh(x) length of a coded sequence, 126
x_ y concatenation of coded sequences, 126
f course-of-values function, 126
CPR codes of primitive recursive functions, 128
UPR universal function for primitive recursive functions, 129
f : INn ;! P IN partial function, 130
f(x) " f is unde
ned at x, 130
f(x) # f is de
ned at x, 130
f(n) ' g(n) partial equality, 131
f unbounded -operator, 131
P unbounded -operator, 131
CP codes of partial recursive functions, 132
Cmp computation predicate, 132
fegn (~z) partial recursive function with code e, 133
T n (e~z z) Kleene's T -predicate, 133
,n universal partial recursive function, 134
Snm Snm -predicate, 135
Wen recursive enumerable set with index e, 138
Gf graph of f, 140
K diagonal set, 141
INC increase function of a RAM, 145
DEC decrease function of a RAM, 145
BEQ branch function of a RAM, 145
MP marks of the programme P, 145
P transition function, 146
iP iterated transition function, 146
FP
~x formula describing P, 148
Chapter IV
LPA language of Peano Arithmetic, 153
PA Peano Arithmetic, 153
NT number theory, 154
Glossary 213
Chapter V
LI many-sorted language, 165
FV(t) free variables of t, 166
FVi (t) free variables of sort i in t, 166
SI many-sorted structure, 166
t+ translated term, 168
F+ translated formula, 168
OntI ontological axioms, 168
Ont ontological axioms, 169
L! language of !-logic, 172
S! !-structure, 172
! F calculus with !-rule, 173
! F validity in !-structures, 173
L2 second order language, 175
S2 second order structure, 175
L2PA language of second order Peano Arithmetic, 175
N constant symbol for the natural numbers, 175
PA2 second order Peano Arithmetic, 175
Lw2 weak second order language, 176
S2w weak second order structure, 176
214 Glossary
Index