You are on page 1of 147

Mathematical Logic

Hannes Leitgeb
October 2006
These lecture notes follow closely:
Ebbinghaus, H.D., Flum, J., Thomas, W., Mathematical Logic, New York:
Springer, 1984.
1
Contents
1 Introduction 4
2 First-Order Languages 9
2.1 Preliminary Remarks on Formal Languages . . . . . . . . . . . 9
2.2 Vocabulary of First-Order Languages . . . . . . . . . . . . . . 11
2.3 Terms and Formulas of First-Order Languages . . . . . . . . . 14
2.4 Induction over Terms and Formulas . . . . . . . . . . . . . . . 19
2.5 Problem Set 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3 Semantics of First-Order Languages 24
3.1 Models, Variable Assignments, and Semantic Values . . . . . . 24
3.2 Problem Set 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 Some Important Semantic Concepts . . . . . . . . . . . . . . . 34
3.4 Problem Set 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5 Substitution and the Substitution Lemma . . . . . . . . . . . 41
3.6 Problem Set 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4 A Sequent Calculus for First-Order Predicate Logic 50
4.1 Preliminary Remarks on the Sequent Calculus . . . . . . . . . 50
4.2 Basic Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.3 Rules for Propositional Connectives . . . . . . . . . . . . . . . 54
4.4 Rules for Quantiers . . . . . . . . . . . . . . . . . . . . . . . 59
4.5 Rules for Equality . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.6 The Soundness Theorem for the Sequent Calculus . . . . . . . 65
4.7 Some Important Proof-Theoretic Concepts . . . . . . . . . . . 66
4.8 Problem Set 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5 The Completeness Theorem and Its Consequences 73
5.1 The Satisability of Maximally Consistent Sets of Formulas
with Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.2 Extending Consistent Sets of Formulas to Maximally Consis-
tent Sets of Formulas with Instances . . . . . . . . . . . . . . 82
5.3 Consequences and Applications . . . . . . . . . . . . . . . . . 89
5.4 Problem Set 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
2
6 The Incompleteness Theorems for Arithmetic 94
6.1 Preliminary Remarks . . . . . . . . . . . . . . . . . . . . . . . 94
6.2 Formalising Computer in Terms of Register Machine . . . . 96
6.3 Register-Decidability, Register-Enumerability, Register-Computability100
6.4 The Relationship Between Register-Enumerability and Register-
Decidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.5 First-Order Theories and Axiomatizability . . . . . . . . . . . 108
6.6 Arithmetical Representability and the Incompleteness Theorems111
7 Solutions to the Problem Sets 117
7.1 Solutions to Problem Set 1 . . . . . . . . . . . . . . . . . . . . 117
7.2 Solutions to Problem Set 2 . . . . . . . . . . . . . . . . . . . . 122
7.3 Solutions to Problem Set 3 . . . . . . . . . . . . . . . . . . . . 129
7.4 Solutions to Problem Set 4 . . . . . . . . . . . . . . . . . . . . 134
7.5 Solutions to Problem Set 5 . . . . . . . . . . . . . . . . . . . . 138
7.6 Solutions to Problem Set 6 . . . . . . . . . . . . . . . . . . . . 143
3
1 Introduction
What is mathematical logic?
Let us consider a simple theorem in group theory:
A group is a triple (G, , e) with
G is a set, G ,=
: GG G
e G
such that the following axioms are satised:
For all x, y, z : x (y z) = (x y) z (Associative Law) (G1)
For all x : x e = x (Right Neutral Element) (G2)
For all x there is a y such that x y = e (Right Inverse Element) (G3)
Example 1
(R, +, 0) is a group.
(R, , 1) is not a group (there is no y such that 0 y = 1).
We can prove the following theorem:
Theorem 1 Let (G, , e) be an arbitrary group:
For every group element in G there is a left inverse element, i.e.,
for all x there is a y such that y x = e.
Proof.
Let x be an arbitrary member of G:
By (G3), for this x there is a y G such that: x y = e.
4
By (G3), for this y there is a z G such that: y z = e.
Therefore:
y x = (y x) e (G2)
= (y x)
. .
(ab)
(y z)
. .
c
(y z = e)
= y
..
a
(x (y z))
. .
(bc)
(G1)
= y ((x y) z) (G1)
= y (e z)) (x y = e)
= (y e) z (G1)
= y z (G2)
= e (y z = e)
Reconsidering the above we recognize the following three ingredients:
1. a theorem (which is nothing but a sentence in a formalised language)
2. the claim that this theorem is a logical consequence of other sentences
(here: the group axioms)
3. the proof of the theorem
Mathematical logic is the subdiscipline of mathematics which deals with
the mathematical properties of formal languages, logical consequence, and
proofs.
Here is another example:
An equivalence structure is a pair (A, ) where
A is a set, A ,=
A A
5
such that the following axioms are satised:
For all x : x x (Reexivity) (A1)
For all x, y : if x y then y x (Symmetry) (A2)
For all x, y, z : if x y and y z then x z (Transitivity) (A3)
Example 2
If = is the equality relation on a non-empty set A, then (A, =) is an
equivalence structure.
For m, n Z let m n i there is a k Z s.t. mn = 5k.
Then (Z, ) is an equivalence structure.
Consider the following simple theorem on equivalence structures:
Theorem 2 Let (A, ) be an arbitrary equivalence structure:
If two elements of A are equivalent to some common element of A, then they
are equivalent to exactly the same elements of A, i.e.,
for all x, y: if there is some u such that x u, y u, then for all z:
x z i y z
Proof.
Let x, y be arbitrary members of A.
Assume that there is a u such that x u, y u.
It follows:
u x (A2, x u)
u y (A2, y u)
y x (A3, y u, u x)
x y (A2, y x)
Now let z be an arbitrary member of A:
If x z, then y z because of (A3, y x, x z).
If y z, then x z because of (A3, x y, y z).
We recognize the same three ingredients as before:
6
1. a theorem
2. the claim that this theorem is a logical consequence of other sentences
(in this case: the axioms of equivalence structures)
3. the proof of the theorem
More generally: we deal with
1. a set of sentences (axioms), a sentence (theorem)
2. the claim that follows logically from
3. the proof of on the basis of
In mathematical logic this is made precise:
1. sentences: members of so-called rst-order languages
2. consequence: a rst-order sentences follows logically from a set of
rst-order sentences i every model that satises all sentences in also
satises
3. proofs: sequences of rst-order sentences which can be generated eec-
tively on the basis of a particular set of formal rules
We will dene rst-order language, model, proof,. . . and prove theorems
about rst-order languages, models, and proofs. E.g., we will show:
If is derivable from on the basis of the rules in 3, then follows
logically from in the sense of 2 (Soundness Theorem).
If follows logically from in the sense of 2, then is derivable from
on the basis of the rules in 3 (Completeness Theorem).
Historical development:
Aristotle (384322 BC)
G. Frege (AD 18481925)
K. Godel (AD 19061978)
A. Tarski (AD 19021983)
7
G. Gentzen (AD 19091945)
A. Turing (AD 19121954)
.
.
.
Subdisciplines of mathematical logic:
Model theory
Proof theory
Set theory
Computability theory (Recursion theory)
Logic is at the intersection of mathematics, computer science, and philosophy.
References to (good) introductory text books:
Ebbinghaus, H.D., Flum, J., Thomas, W., Mathematical Logic, New
York: Springer, 1984.
Enderton, H.B., A Mathematical Introduction to Logic, San Diego: Har-
court, 2001.
Shoeneld, J.R., Mathematical Logic, Natick: A K Peters, 2000.
In particular, we will make use of Ebbinghaus, Flum, Thomas.
Internet: check out http://world.logic.at/
8
2 First-Order Languages
2.1 Preliminary Remarks on Formal Languages
Alphabet: non-empty set / the members of which are called symbols.
Example 3
/
1
= l
1
, . . . , l
26
, where l
1
= a, . . . , l
26
= z
(if denoted less precisely but more simply: /
1
= a, b, . . . , z)
/
2
= n
0
, n
1
, . . . , n
9
, where n
0
= 0, . . . , n
9
= 9
/
3
= N
/
4
= R
We are going to restrict ourselves to countable alphabets (i.e., nite or count-
ably innite ones); so e.g. /
4
will be excluded.
We recall:
X is countable i
X = x
1
, x
2
, x
3
, . . . i
there is a function f : N X, such that f is surjective (onto) i
there is a function f : X N, such that f is injective (one-to-one).
(Note that for nite sets X it holds that for some n:
x
n+1
= x
n
, x
n+2
= x
n
, . . .)
String over /: nite linear sequence
1
,
2
, . . . ,
n
. .
(
1
,...,n)
of members of /
(i.e.,
i
/ for 1 i n).
Example 4
abudabi, goedel: strings over /
1
4711, 007: strings over /
2
9
123: string over /
3
But which string?
123 (1, 2, 3) or 123 (12, 3) or 123 (1, 23) or 123 (123)?
We have to take care to choose alphabets and notations for strings in a way
such that every string can be reconstructed uniquely as a sequence of mem-
bers of the alphabet.
Let /

be the set of strings over the alphabet /.


Here is a simple lemma on the cardinality of /

:
Lemma 1 If / is countable, then /

is countable as well; indeed /

is
countably innite.
Proof. Recall the fundamental theorem of elementary number theory:
Every natural number n > 1 can be represented uniquely as a product of
prime numbers p
1
, . . . , p
k
with p
1
< . . . < p
k
, such that
n = p
i
1
1
. . . p
i
k
k
, where i
j
> 0 for 1 j k
E.g.: 14 = 2 7 = 2
1
7
1
, 120 = 2 2 2 3 5 = 2
3
3
1
5
1
Now let q
1
be the rst prime number (i.e., 2), q
2
be the second prime number
(i.e., 3),. . ., q
n
the n-th prime number,. . .
Since / is countable by assumption, either of the following is the case:
/ is nite: / = a
1
, . . . , a
n
with pairwise distinct a
i
/ is (countably) innite: / = a
1
, a
2
, a
3
, . . . with pairwise distinct a
i
Let
f : /

N
a
i
1
a
i
2
. . . a
i
k
q
i
1
1
q
i
2
2
. . . q
i
k
k
E.g.: f(a
3
a
2
a
2
) = 2
3
3
2
5
2
= 1800
(coding functions of such a type are often referred to as Godelisations).
Claim: f is injective (hence this coding is unique).
10
For assume f(a
i
1
a
i
2
. . . a
i
k
)
. .
= f(a
j
1
a
j
2
. . . a
j
l
)
. .
q
i
1
1
q
i
2
2
. . . q
i
k
k
= q
j
1
1
q
j
2
2
. . . q
j
l
l
Since the prime factor representation of natural numbers is unique, it follows:
k = l
i
1
= j
1
, . . . , i
k
= j
l
a
i
1
. . . a
i
k
= a
j
1
. . . a
j
l

= according to what we said before about countability: /

is countable.
Indeed, /

is countably innite: a
1
, a
1
a
1
, a
1
a
1
a
1
, . . . /

.
2.2 Vocabulary of First-Order Languages
Now we consider the alphabets of formal languages of a particular kind:
the vocabularies of rst-order languages.
Take our axioms (G3) and (A3) from section 1 as examples:
(G3) For all x there is a y such that x y = e
(A3) For all x, y, z: if x y and y z then x z
In these sentences and in other ones about groups and equivalence structures
we nd symbols of the following types:
Propositional connectives:
and:
if-then:
not:
or:
i (if and only if):
Quantiers:
for all:
there is:
11
Variables:
x,y,z: v
0
, v
1
, v
2
, . . .
Equality sign:
=: (binary predicate)
Predicates:
: P
2
0
(binary predicate)
Function signs:
: f
2
0
(binary function sign)
Constants:
e: c
0
Parentheses are used as auxiliary symbols.
More generally:
Denition 1 The vocabulary or alphabet of a rst-order language contains
the following symbols (and only the following symbols):
1. , , , ,
2. ,
3. v
0
, v
1
, v
2
, . . .
4.
5. for every n 1 a (possibly empty) set of n-ary predicates P
n
i
(i = 0, 1, 2 . . .)
6. for every n 1 a (possibly empty) set of n-ary function signs f
n
i
(i = 0, 1, 2 . . .)
7. a (possibly empty) set of constants c
i
(i = 0, 1, 2, . . .)
and parentheses as auxiliary symbols.
12
Note:
/ = (1), (2), (3), (4) is xed: these symbols are contained in every
rst-order language.
o = (5), (6), (7) is optional: the choice of o determines the specic
character of a rst-order language.
/
S
= / o is the actual alphabet of the rst-order language that is
determined by o.
Example 5
o
Gr
=
..
f
2
0
, e
..
c
0
determines the rst-order language of group theory.
o
Equ
=
..
P
2
0
determines the rst-order language of equivalence struc-
tures.
In future we will use the following conventions for metavariables:
P,Q,R (with or without indices) denote predicates.
f,g,h (with or without indices) denote function signs.
c (with or without indices) denote constants.
x,y,z (with or without indices) denote variables.
Remark 1 Let o be the specic symbol set of a rst-order language
(such that /
S
= / o is the alphabet of that language):
/
S
is countable (in fact countably innite because of v
0
, v
1
, . . . /)
By lemma 1, /

S
is also countably innite.
13
2.3 Terms and Formulas of First-Order Languages
Compare natural languages:
This is lame and extremely boring is well-formed (grammatical).
and extremely this lame is boring is not well-formed.
Accordingly, we will now characterise particular strings over some alphabet
/
S
of a rst-order language as being well-formed. E.g.:
e) : not well-formed, although it is a member of /

S
Gr
.
e v
1
v
2
: well-formed and a member of /

S
Gr
.
We are going to build up well-formed expressions in a step-by-step manner;
e.g.:
e v
1
. .
term
v
2
..
term
. .
formula
/

S
Gr
Denition 2 Let o be the specic symbol set of a rst-order language.
o-terms are precisely those strings over /
S
that can be generated according
to the following rules:
(T1) Every variable is an o-term.
(T2) Every constant in o is an o-term.
(T3) If t
1
, . . . , t
n
are o-terms and f is an n-ary function sign in o,
then f (t
1
, . . . , t
n
) is an o-term.
Abbreviated:
(T1) x
(T2) c
(T3)
t
1
,...,t
n
f(t
1
,...,t
n
)
premises
conclusion
14
This means:
t /

S
is an o-Term i there is a sequence u
1
, . . . , u
k
of elements of /

S
,
such that
u
k
= t
and for all u
i
with 1 i k it is the case that:
u
i
is a variable or
u
i
is a constant in o or
u
i
= f (t
1
, . . . , t
n
) and t
1
, . . . , t
n
u
1
, . . . , u
i1
.
We denote the set of o-terms by: T
S
.
Example 6 Let o = f, g, c where f, g are binary function signs, c is a
constant.
It follows that g
_
f(c, v
0
), c
_
is an o-term:
c (T2) (1)
v
0
(T1) (2)
f(c, v
0
) (T3, with 1., 2.) (3)
g
_
f(c, v
0
), c
_
(T3, with 3., 1.) (4)
Remark 2
In order to denote arbitrary terms we use: t
(with or without an index).
Traditionally, one writes functions signs between terms:
e.g. t
1
+ t
2
:= +(t
1
, t
2
), t
1
t
2
:= (t
1
, t
2
), and so forth.
Denition 3 Let o be the specic symbol set of a rst-order language.
o-formulas are precisely those strings over /
S
that can be generated according
to the following rules:
15
(F1)
(t
1
,t
2
)
(for o-terms t
1
, t
2
)
(F2)
P(t
1
,...,t
n
)
(for o-terms t
1
, . . . , t
n
, for n-ary P o)
(Formulas which can be generated solely on basis of (F1) and (F2) are called
atomic.)
(F3)

..
negation
(F4)
,
( )
. .
disjunction
,
( )
. .
conjunction
,
( )
. .
implication
,
( )
. .
equivalence
(F5)

x
. .
universally quantied

x
. .
existentially quantied
(for arbitrary variables x)
This means: . . . (analogous to the case of terms).
We denote the set of o-formulas by: T
S
.
Example 7 Let o = R where R is a binary predicate.
It follows that
_
_
R(v
0
, v
1
) R(v
1
, v
2
)
_
R(v
0
, v
2
)
_
is an o-term:
R(v
0
, v
1
) (F2) (1)
R(v
1
, v
2
) (F2) (2)
_
R(v
0
, v
1
) R(v
1
, v
2
)
_
(F4, with 1., 2.) (3)
R(v
0
, v
2
) (F2) (4)
_
_
R(v
0
, v
1
) R(v
1
, v
2
)
_
R(v
0
, v
2
)
_
(F4, with 3., 4.) (5)
Remark 3
In order to denote arbitrary formulas we use: ,,,. . .
(with or without an index).
16
Often one writes predicates between terms:
e.g. t
1
t
2
:= (t
1
, t
2
), t
1
t
2
:= (t
1
, t
2
), and so forth.
( , ) are needed in (F4) to guarantee unique readability:
otherwise could either be ( ) or be ( ) !?
Lemma 2 For all symbol sets o that specify rst-order languages:
T
S
, T
S
are countably innite.
Proof. We have already seen that /

S
is countable.
Since T
S
, T
S
/

S
, it follows that T
S
, T
S
are countable, too.
v
0
, v
1
, v
2
, . . . T
S
, thus T
S
is countably innite.
v
0
v
0
, v
1
v
1
, v
2
v
2
, . . . T
S
, therefore T
S
is countably innite.
Remark 4 Our denition of formulas is quite liberal: if o is chosen
accordingly, then
x (P(y) Q(y)) T
S
, although x does not occur in (P(y) Q(y))
x (P(y) Q(y)) T
S
, although y occurs freely in (P(y) Q(y)),
i.e., it occurs not in the range of (bound by) y or y
x(x x x x) T
S
, although this is obviously redundant
xxP(x) T
S
, although the x in xP(x) is bound and therefore the
rst occurrence of x is useless.
But being tolerant in these ways does not do any harm and makes things
much simpler. So lets not care!
At some points we will need to sort out those variables which occur freely in
a formula, i.e., which occur not bound by any quantier:
Denition 4 Let T
S
(for arbitrary symbol set o):
free(), i.e., the set of variables which occur freely in , can be dened
recursively as follows:
free(t
1
t
2
) := var(t
1
) var(t
2
)
(let var(t) be the set of variables in t)
17
free (P(t
1
, . . . , t
n
) := var(t
1
) . . . var(t
n
)
free() := free()
free (( )) := free() free()
(analogously for , , )
free(x ) := free()x
(analogously for ).
Example 8
free (x (P(y) Q(y))) = y
free (xP(x)) =
free ((xP(x) P(x))) = x
We see that according to our denition, free() is the set of variables that
occur freely at some place within .
A formula without free variables, i.e., for which free() = , is called a
sentence.
Remark 5 For simplicity, we will sometimes omit parentheses:
Outer parentheses: e.g., := ( )
binds more strongly than , , i.e.:
:= ( ) [,= ( )]
, bind more strongly than , , i.e.:
:= ( ) ( )
[,= ( ( )) ]
in the case of multiple conjunctions or disjunctions:
= ( )
= ( )
18
2.4 Induction over Terms and Formulas
Throughout this course we will use the following method of proof over and
over again:
1. We show: All terms/formulas with

have the property P.


2. We show: Assume terms/formulas
1
, . . . ,
n
have the property P.
Then all terms/formulas with

1
,...,n

have the property P.


1. and 2. imply: All terms/formulas have the property P.
Remark 6 This is simply a version of proof by complete induction over
natural numbers. One actually shows by complete induction over n:
For all n N: For all :
if is derivable in the term-/formula-calculus in n steps,
then has the property P.
Example 9
Claim: All terms in T
S
contain as many opening parentheses as they contain
closing parantheses; i.e.: all terms have the property of
containing as many opening parentheses as closing parentheses
. .
P
Proof.
Induction basis:
Variables have the property P (since they do not contain parentheses at all).
Constants have the property P (they do not contain parentheses at all).
Inductive assumption:
Assume terms t
1
, . . . , t
n
have the property P.
So t
1
contains as many opening parentheses as closing parentheses, t
2
contains
as many opening parentheses as closing parentheses,. . . But then also
f(t
1
, . . . , t
n
)
does so (where f is an arbitrary function sign in o).
19
In short: f(t
1
, . . . , t
n
. .
IA
)
. .
also has property P
= by induction, we are done.
(Analogously for formulas!)
Now let us consider a slightly more complex application of induction over
terms:
We call X /

S
closed under the rules of the term calculus (for a given
symbol set o) i
1. all variables are contained in X,
2. all constants in o are contained in X,
3. if t
1
, . . . , t
n
are in X, then f(t
1
, . . . , t
n
) is in X
(where f is an arbitrary function sign in o).
Example 10
/

S
is closed under the rules of the term calculus.
T
S
is closed under the rules of the term calculus.
Lemma 3 T
S
is the intersection of all subsets of /

S
that are closed under
the rules of the term calculus, i.e.,
T
S
=

X /

S
,
Xclosed
X
(and thus T
S
is the least subset of /

S
that is closed under the rules of the
term calculus).
Proof.
1. If X is closed under the rules of the term calculus, then T
S
X:
20
Since: all t T
S
are contained in X
. .
property P
, by induction:
(a) variables and constants are contained in X
(b) assume t
1
, . . . , t
n
T
S
are contained in X:
= also f(t
1
, . . . , t
n
) is a member of X
(both by assumption that X is closed under the term rules).
2. Therefore: T
S


X
X closed
3. T
S
is itself closed under the rules of the term calculus.
Since: (a) variables and constants are in T
S

(b) assume t
1
, . . . , t
n
are in T
S
[let us do this very precisely for once. . .]
= there are term derivations of the form
u
1
1
, . . . , u
1
k
1
with u
1
k
1
= t
1
u
2
1
, . . . , u
2
k
2
with u
2
k
2
= t
2
.
.
.
u
n
1
, . . . , u
n
kn
with u
n
kn
= t
n
But then
u
1
1
, . . . , u
1
k
1
..
t
1
, u
2
1
, . . . , u
2
k
2
..
t
2
, . . . , u
n
1
, . . . , u
n
kn
..
tn
, f(t
1
, . . . , t
n
)
is a derivation of f(t
1
, . . . , t
n
) in the term calculus
(where the last derivation step is an application of (T3))
= f(t
1
, . . . , t
n
) is in T
S

4.

X T
S
since 3 implies that T
S
is itself one of the closed sets X.
X closed
From 2 and 4 follows: T
S
=

X
X closed
An analogous statement can be proved for T
S
and the formula calculus.
21
2.5 Problem Set 1
1. (a) Show (this is a recapitulation of something you should know about
countable sets):
If the sets M
0
, M
1
, M
2
, . . . are countable,
then

nN
M
n
is countable as well.
(b) Prove the following lemma (lemma 1 from above) by means of 1a:
If / is a countable alphabet, then the set /

(of nite strings over


/) is countable, too.
2. Let o be an arbitrary symbol set. We consider the following calculus
c of rules:

x x
(for arbitrary variables x)

x t
i
x f(t
1
, . . . , t
n
)
(for arbitrary variables x, for arbitrary o-terms t
1
, . . . , t
n
, for arbitrary
n-ary function signs f o, for arbitrary i 1, . . . , n).
Show that for all variables x and all o-terms t holds: The string
x t
is derivable in c if and only if x var(t) (i.e., x is a variable in t).
3. Prove that the following strings are o-terms (for given o with c, f, g
o, where f is a binary function sign, g is a unary function sign, x and
y are variables):
(a) f(x, c)
(b) g(f(x, c))
(c) f(f(x, c), f(x, f(x, y)))
22
4. Prove that the following strings are o-formulas (with x, y, c, f, g as
in 3 and where P, Q o, such that P is a unary predicate and Q is a
binary predicate):
(a) P(f(x, c))
(b) xy(P(g(f(x, c))) Q(y, y))
(c) (xP(f(x, c)) Q(f(x, c), f(f(x, c), f(x, f(x, y)))))
5. Prove by induction: the string xf(x, c) is not an o-term (where o is
an arbitrary symbol set).
6. Let x, y, z be variables, f o a unary function sign, P, Q, R o
with P being a binary predicate, Q a unary predicate, and R a ternary
predicate. Determine for the following o-formulas the corresponding
set of variables that occur freely in (i.e., the sets free()):
(a) xy(P(x, z) Q(y)) Q(y)
(b) xy(Q(c) Q(f(x))) yx(Q(y) R(x, x, y))
(c) Q(z) z(P(x, y) R(c, x, y))
Which of these formulas are sentences (have no free variables at all)?
[Note that we omitted parentheses in 6 as explained in remark 5.]
23
3 Semantics of First-Order Languages
3.1 Models, Variable Assignments, and Semantic Val-
ues
Example 11 Consider o
Gr
= , e:
The formula xy x y e is a member of T
S
Gr
.
But what does this formula mean?
If x y quantify over the set Z of integers, if stands for addition in
Z, and if e denotes the integer 0, then the formula means:
for every integer there is another integer such that the addition of both
is equal to 0
if interpreted in this way: the formula is true!
If x y quantify over Z, if stands for multiplication in Z, and if e
denotes the integer 1, then the formula means:
for every integer there is another integer such that the product of both
is equal to 1
if interpreted in this way: the formula is false!
Let us now make precise what we understand by such interpretations of
symbol sets of rst-order languages:
Denition 5 Let o be an arbitrary symbol set:
An o-model (or o-structure) is an ordered pair M = (D, I), such that:
1. D is a set, D ,= (domain, universe of discourse, range of
the quantiers)
2. I is dened on o as follows (interpretation of o):
for n-ary predicates P in o: I(P) D . . . D
. .
n times
= D
n
for n-ary function signs f in o: I(f) : D
n
D
(i.e., I(f) is a mapping from D
n
to D)
24
for every constant c in o: I(c) D
Example 12
1. o = o
Gr
= , e,
D = Z,
I() := + on Z, i.e., I() : Z Z Z with (m, n) m + n,
I(e) := 0,
= M = (D, I) is the model of the set of integers viewed as additive
group.
2. o = o
Fie
= +, , 0, 1,
D = R,
I(+) := + on R,
I() := on R,
I(0) := 0,
I(1) := 1,
= M = (D, I) is the model of the real number eld.
3. Now we add < to o
Fie
: o
OrdFie
= +, , 0, 1, < with
D = R, . . . (as in 2)
Moreover: I(<) R R such that (d
1
, d
2
) I(<) d
1
< d
2
(i.e., I(<) is the less-than relation on real numbers).
= M = (D, I) is the model of the ordered real number eld.
Just as an interpretation assigns meaning to predicates, function signs, and
constants, we need a way of assigning values to variables:
Denition 6 A variable assignment over a model M = (D, I) is a function
s : v
0
, v
1
, . . . D.
Remark 7 As we will see, we need variable assignments in order to dene
the truth values of quantied formulas. Here is the idea:
x is true whatever d D a variable assignment assigns to x, turns
out to be true under this assignment.
25
Analogously for x and the existence of an element d D.
It is also useful to have a formal way of changing variable assignments:
Let s be a variable assignment over M = (D, I), let d D:
We dene
s
d
x
: v
0
, v
1
, . . . D
s
d
x
(y) :=
_
d, y = x
s(y), y ,= x
(where x is some variable in v
0
, v
1
, . . .).
E.g., s
4
v
0
(v
0
) = 4, s
4
v
0
(v
1
) = s(v
1
).
Given an o-model together with a variable assignment over this model, we
can dene the semantic value of a term/formula:
Denition 7 Let M = (D, I) be an o-model.
Let s be a variable assignment over M:
V al
M,s
(semantic value function) is dened on T
S
T
S
, such that:
(V1) V al
M,s
(x) := s(x)
(V2) V al
M,s
(c) := I(c)
(V3) V al
M,s
(f(t
1
, . . . , t
n
)) := I(f) (V al
M,s
(t
1
), . . . , V al
M,s
(t
n
))
(V4) V al
M,s
(t
1
t
2
) := 1 V al
M,s
(t
1
) = V al
M,s
(t
2
)
(V5) V al
M,s
(P(t
1
, . . . , t
n
)) := 1 (V al
M,s
(t
1
), . . . , V al
M,s
(t
n
)) I(P)
(V6) V al
M,s
() := 1 V al
M,s
() = 0
(V7) V al
M,s
( ) := 1 V al
M,s
() = V al
M,s
() = 1
(V8) V al
M,s
( ) := 1 V al
M,s
() = 1 or V al
M,s
() = 1 (or both)
(V9) V al
M,s
( ) := 1 V al
M,s
() = 0 or V al
M,s
() = 1 (or both)
(V10) V al
M,s
( ) := 1 V al
M,s
() = V al
M,s
()
26
(V11) V al
M,s
(x ) := 1 for all d D: V al
M,s
d
x
() = 1
(V12) V al
M,s
(x ) := 1 there is a d D, such that: V al
M,s
d
x
() = 1
For (V4)(V12): in case the i condition is not satised, the corresponding
semantic value is dened to be 0.
Terminology:
V al
M,s
(t) and V al
M,s
() are the semantic values of t and respectively
(relative to M, s), where
V al
M,s
(t) D,
V al
M,s
() 1, 0 =T,F.
Instead of writing that V al
M,s
() = 1, we may also say:
is true at M, s
M, s make true
M, s satisfy
briey: M, s ( is called the semantic turnstile)
We will also write for sets of formulas:
M, s for all : M, s
Example 13 Let M be the model of the ordered real number eld
(i.e., o = o
OrdFie
= +, , 0, 1, <, D = R, I is as described on p.25, M =
(D, I)).
Let s be a variable assignment over M, such that s(v
1
) = 3:
V al
M,s
_
v
0
v
1
< v
0
+ 1
_
= 1
there is a d D = R, such that:
V al
M,s
d
v
0
_
v
1
< v
0
+ 1
_
= 1 (V12)
there is a d D = R, such that:
_
V al
M,s
d
v
0
(v
1
), V al
M,s
d
v
0
(v
0
+1)
_
I(<) (V5)
27
there is a d D = R, such that:
_
s
d
v
0
(v
1
), I(+)
_
V al
M,s
d
v
0
(v
0
), V al
M,s
d
v
0
(1)
__
I(<) (V1),(V3)
there is a d D = R, such that:
(s
d
v
0
(v
1
), I(+)(s
d
v
0
(v
0
), I(1))) I(<) (V1),(V2)
there is a d D = R, such that:
(s(v
1
), I(+) (d, 1)) I(<) (Def. s
d
v
0
, I)
there is a d D = R, such that:
(3, d + 1) I(<) (Def. s, I)
there is a d D = R, such that:
3 < d + 1 (Def. I)
Such a d R = D exists: e.g., d = 3, 4, ...
= V al
M,s
_
v
0
v
1
< v
0
+ 1
_
= 1 (equivalently: M, s v
0
v
1
< v
0
+ 1)
Examples like these tell us:
Remark 8
1. The semantic value of a term t only depends (i) on the interpretation of
the constants and functions signs that occur in t and (ii) on the values
the assignment function assigns to the variables that occur in t.
2. The semantic value of a formula only depends (i) on the interpre-
tation of the constants, functions signs, and predicates that occur in
and (ii) on the values the assignment function assigns to the variables
that occur in freely (the assignment of values to bound occurrences of
variables are erased by the quantiers which bind these occurrences).
In formal terms:
28
Lemma 4 (Coincidence Lemma)
Let o
1
, o
2
be two symbol sets. Let M
1
= (D, I
1
) be an o
1
-model, let M
2
=
(D, I
2
) be an o
2
-model.
Let s
1
be a variable assignment over M
1
, s
2
a variable assignment over M
2
.
Finally, let o = o
1
o
2
:
1. For all terms t T
S
:
If I
1
(c) = I
2
(c) for all c in t
I
1
(f) = I
2
(f) for all f in t
s
1
(x) = s
2
(x) for all x in t
then: V al
M
1
,s
1
(t) = V al
M
2
,s
2
(t) (compare 1 in the remark above).
2. For all formulas T
S
:
If I
1
(c) = I
2
(c) for all c in
I
1
(f) = I
2
(f) for all f in
I
1
(P) = I
2
(P) for all P in
s
1
(x) = s
2
(x) for all x free()
then: V al
M
1
,s
1
() = V al
M
2
,s
2
() (compare 2 in the remark above).
Proof. (By standard induction over terms and formulas: see the next prob-
lem sheet!)
Corollary 1 Let be an o-sentence, let s
1
, s
2
be variable assignments over
an o-Modell M:
It follows that V al
M,s
1
() = V al
M,s
2
().
Proof. Since is assumed to be a sentence, free() = . Therefore,
trivially, s
1
(x) = s
2
(x) for all x free().
So we can apply the coincidence lemma, where in this case M
1
= M
2
= M,
and we are done.
29
Remark 9 We see that as far as sentences are concerned, it is irrelevant
which variable assignment we choose in order to evaluate them:
a sentence is true in a model M relative to some variable assignment over
M i is true in M relative to all variable assignments over M.
Therefore we are entitled to write for sentences and sets of sentences:
M and M
without mentioning a variable assignment s at all.
Here is an example of what a typical set of sentences satised by a model
can look like:
Example 14 (We use again o
OrdFie
= +, , 0, 1, < as our symbol set.)
Let be the following set of sentences:
xyz x + (y + z) (x + y) + z
x x + 0 x
xy x + y 0
xy x + y y + x
These axioms describe the Abelian group (R, +).
xyz x (y z) (x y) z
x x 1 x
xy x y y x
x (x 0 y x y 1)
These axioms describe the Abelian group (R0, ).
xyz x (y + z) (x y) + (x z)
30
0 1
All axioms up to here taken together describe the real eld (R, +, ).
x x < x
xyz (x < y y < z x < z)
xy (x < y x y y < x)
xyz (x < y x + z < y + z)
xyz (x < y 0 < z x z < y z)
All axioms taken together describe the real ordered eld (R, +, ).
Now let M be the model of the real ordered eld (see p. 25): then M .
Remark 10 Why are these languages called rst-order?
Because there are also second-order languages:
rst order:
x, x: for all members of D, there is a member of D
second-order:
x, x: for all members of D, there is a member of D
But these languages have additional quantiers of the form:
X, X: for all subsets of D, there is a subset of D.
Final remark: From now on no lines above signs anymore (fortunately. . .).
31
3.2 Problem Set 2
1. Let o = P, R, f, g, c
0
, c
1
, where P is a unary predicate, R is a binary
predicate, and f and g are binary function signs. Let M = (D, I) be
an o-model with D = R, such that I(P) = N, I(R) is the larger
than (>) relation on R, I(f) is the addition mapping on R, I(g) is
the multiplication mapping on R, I(c
0
) = 0, and I(c
1
) = 1. Finally,
let s be a variable assignment over M with the property that s(x) = 5
and s(y) = 3 (where x, y, and z from below, are xed pairwise distinct
variables).
Determine the following semantic values by step-by-step application of
the denition clauses for V al
M,s
; subsequently, translate the terms/for-
mulas into our usual mathematical everyday language:
(a) V al
M,s
(g(x, f(y, c
1
)))
(b) V al
M,s
(f(g(x, y), g(x, c
1
)))
(c) V al
M,s
(xy(R(x, c
0
) z(P(z) R(g(z, x), y))))
For which variable assignments s over M is it the case that
P(z) R(z, c
1
) x(P(x) y(P(y) g(x, y) z) x c
1
x z)
is true at M and s?
2. Let o = P, f, where P is a unary predicate and f is a binary function
sign.
For each of the following formulas in T
S
nd an o-model and a corre-
sponding variable assignment relative to which the formula is true and
nd an o-model and a corresponding variable assignment relative to
which the formula is false:
(a) v
1
f(v
2
, v
1
) v
2
(b) v
2
v
1
f(v
2
, v
1
) v
2
(c) v
2
(P(v
2
) v
1
P(f(v
2
, v
1
)))
3. Let D be nite and non-empty, let o be nite. Show that there are
only nitely many o-models with domain D.
32
4. A formula in which , , do not occur is called positive.
Prove: For every positive formula there is a model and a variable assign-
ment which taken together satisfy the formula (independent of what o
is like).
Hint: You might consider trivial models the domains of which only
have one member.
5. Prove the coincidence lemma by induction over terms and formulas
(see lemma 4).
33
3.3 Some Important Semantic Concepts
For everything that follows we x a symbol set o.
Denition 8 For all T
S
, T
S
:
follows logically from , briey: i
for all o-models M, for all variable assignments s over M:
if M, s , then M, s
We also say equivalently:
logically implies ; is a logical consequence of .
Careful: has dierent meanings in dierent contexts!
Example 15 Let o = o
Gr
= e, :
Let be the set that has the group axioms (G1), (G2), (G3) of p. 4 (for-
malised by means of o
Gr
) as its only members.
It follows that x y y x e.
This is because if M is a model of , i.e., M , then (D, I(), I(e)) is a
group (for the rest of the argument recall p.4f ).
(Note that on p.4f denotes the group multiplication function in a group,
whereas here denotes a function sign. In the present context, it is I()
which denotes a group multiplication function.)
Furthermore:
xy x y y x
Counterexample: any non-Abelian group, e.g. S
3
(the permutation group for
a set with three elements).
xy x y y x
Counterexample: any Abelian group, e.g. (Z, +).
We see that it is not generally the case that: =
BUT: M, s = M, s
Now we single out important semantic concepts that apply to formulas of a
particular type.
34
Some formulas have the property of being true under all interpretations:
Denition 9 For all T
S
:
is logically true i
for all o-models M, for all variable assignments s over M:
M, s
Example 16
(i) , (ii) xy x y are logically true.
(iii) P(c), (iv) xP(x) are not logically true.
Some formulas are true under some interpretation:
Denition 10 For all T
S
, T
S
:
is satisable i
there is an o-model M and a variable assignment s over M, such that:
M, s .
T
S
is (simultaneously) satisable i there are M, s such that M, s .
Example 17
(i) , (ii) P(c), (iii) P(c) are satisable.
(iv) , (v) x x x are not satisable.
P(c), x Q(x, x) is satisable.
P(c), x Q(x, x), P(c) x Q(x, x) is not satisable (i.e., not simulta-
neously satisable).
Logical consequence, logical truth, and satisability are themselves logically
related to each other:
35
Lemma 5 For all T
S
, T
S
:
1. is logically true i .
2. i is not satisable.
3. is logically true i is not satisable.
Proof.
1. for all M, s : if M, s , then M, s
(but M, s is true for trivial reasons, because what it means is
for all : if , then M, s
and the if-part of this sentence is false for all )
for all M, s: M, s
is logically true (by def.)
2. for all M, s: if M, s , then M, s
not there are M, s, such that: M, s , M, s
not there are M, s, such that: M, s , M, s
not there are M, s, such that: M, s
not satisable (by def.)
3. is logically true
(by 1.)
is not satisable (by 2.)
is not satisable
Sometimes two formulas say the same:
Denition 11 For all , T
S
:
is logically equivalent to i and .
36
Example 18
is logically equivalent to ( )
is logically equivalent to
is logically equivalent to ( ) ( )
x is logically equivalent to x
This allows us to focus just on , , in all that follows!
E.g.:
x (P(x) Q(x)) is logically equivalent to
x(P(x) Q(x)) is logically equivalent to
x (P(x) Q(x))
Remark 11 We said that we xed a symbol set o at the beginning of this
subsection. But strictly we have dened o-logically implies, o-logically
true, o-satisable, o-logically equivalent for arbitrary symbol set o (it
is just so awkward to keep the reference to o while using all these notions)!
Fortunately, the particular choice of a symbol set often does not really matter
so much. E.g.:
Let o, o

be symbol sets, such that o o

.
Let be an o-formula (= is also an o

-formula).
Then:
is o-satisable i is o

-satisable.
Proof.
() Assume that is o-satisable.
By denition, there is an o-model M and there is a variable assignment s
over M, such that:
M, s (i.e., V al
M,s
() = 1)
Now we dene an o

-model M

: let D

:= D, I

[
S
I (i.e., I

and I are
identical on o), I

on o

o is chosen arbitrarily.
37
Furthermore, let s

:= s.
By the coincidence lemma (lemma 4) it follows that M

, s

(since is
an o-formula, the symbols in o are interpreted in the same way by I

and I,
and the two models M

and M have the same domain).


Hence, is o

-satisable. (M

is called an expansion of M.)


() Analogously (in this case one simply forgets about the interpretation
of symbols in o

o: this yields a so-called reduct of M

).
By lemma 5: analogously for logical consequence, logical truth, and so forth.
38
3.4 Problem Set 3
1. The convergence of a real-valued sequence (x
n
) to a limit x is usually
dened as follows:
(Conv) For all > 0 there is a natural number n, such that for all
natural numbers m > n it holds that: [x
m
x[ <
Represent (Conv) in a rst-order language by choosing an appropriate
symbol set o and dene the corresponding o-model.
Hint: (i) Real sequences are functions from N to R, i.e., you may con-
sider x
m
as being of the form f(m); f can be regarded as being dened
on R even though only its values for members of N are relevant.
(ii) [x
m
x[ may either be considered as the result of applying a bi-
nary distance function to the arguments x
m
and x or as the result
of applying two functions subtraction and absolute value to these
arguments.
2. (This problem counts for award of CREDIT POINTS.)
Show that for arbitrary o-formulas , , , and arbitrary sets of
o-formulas the following is the case:
(a) ( ) i and .
(b) i ( ).
(c) (i.e., ) i ( ) is logically true.
3. (a) Prove for arbitrary o-formulas , :
xy yx
(b) Show that the following is not the case for all o-formulas , :
yx xy
4. (a) Prove for all o-formulas , :
x( ) is logically equivalent to x x.
(b) Show that the following is not the case for all o-formulas , :
x( ) is logically equivalent to x x.
5. Let be an o-formula set, let und be o-formulas. Show:
If and , then .
39
6. A set of o-sentences is called independent if and only if there is no
such that: (i.e., no is redundant, because it is
impossible to conclude from ).
Prove: (a) the set of the three group axioms and (b) the set of the three
axioms for equivalence structures are both independent (see chapter one
for these axioms).
40
3.5 Substitution and the Substitution Lemma
In the next chapter on the sequence calculus we will consider derivation rules
by which terms t can be substituted for variables x. E.g.:
Example 19
From
x P(x)
one can conclude
P(t) formula that results from P(x) by substituting t for x
From
P(t) formula that results from P(x) by substituting t for x
one can conclude
x P(x)
From
P(t
1
) formula that results from P(x) by substituting t
1
for x
t
1
t
2
one can conclude
P(t
2
) formula that results from P(x) by substituting t
2
for x
But one has to be careful :
Should we be allowed to draw an inference from
x y y < x true in the model of the real ordered eld
to
y y < y false in the model of the real ordered eld
by a substitution of y for x?
No!
41
Why does this last substitution go wrong?
In
y y < x
the variable x occurs freely, but in
y y < y
the second occurrence of y, which was substituted for x, is bound!
= This corresponds to a change of meaning.
Problems like these can be avoided in the following manner:
Draw an inference from xy y < x
. .

convert into: xu u < x


then: substitute y for x
to u u < y
(this last formula is true in the model of the real ordered eld independent
of which real number is chosen to be s(y)).
Wanted:
1. An intelligent substitution function
t
x
by which a term t is substituted
for free occurrences of a variable x (substitutions for bound occurrences
should be prohibited), such that problematic cases as the above one are
avoided by automatic renaming of bound variables.
2. It should be possible to substitute terms t
0
, . . . , t
n
simultaneously for
pairwise distinct variables x
0
, . . . , x
n
(t
0
for x
0
, t
1
for x
1
,. . . ).
E.g.: [P(x, y)]
y,x
x,y
= P(y, x)
(y is substituted for x and simultaneously x is substituted for y.)
BUT: [[P(x, y)
y
x
]
x
y
] = [P(y, y)]
x
y
= P(x, x)!
(So simultaneous substitution cannot be replaced by the iteration of
simple substitutions.)
3. We want:
V al
M,s
_
t
t
0
,...,tn
x
0
,...,xn
_
= V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(t)
42
4. We want:
M, s
t
0
,...,tn
x
0
,...,xn
M, s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn

So we also need a generalized way of manipulating variable assignments; let
x
0
, . . . , x
n
be pairwise distinct variables:
s
d
0
,...,dn
x
0
,...,xn
(y) =
_
s(y) if y ,= x
0
, . . . , x
n
d
i
if y = x
i
(for 0 i n)
This is how a substitution function that satises 1.4. can be dened:
Denition 12 Let o be an arbitrary symbol set.
Let t
0
, . . . , t
n
T
S
, let x
0
, . . . , x
n
be pairwise distinct variables.
We dene the substitution function
t
0
,...,tn
x
0
,...,xn
on T
S
T
S
as follows:
[x]
t
0
,...,tn
x
0
,...,xn
:=
_
t
i
for x = x
i
(0 i n)
x else
[c]
t
0
,...,tn
x
0
,...,xn
:= c
[f(t

1
, . . . , t

m
)]
t
0
,...,tn
x
0
,...,xn
:= f
_
[t

1
]
t
0
,...,tn
x
0
,...,xn
, . . . , [t

m
]
t
0
,...,tn
x
0
,...,xn
_
[t

1
t

2
]
t
0
,...,tn
x
0
,...,xn
:= [t

1
]
t
0
,...,tn
x
0
,...,xn
[t

2
]
t
0
,...,tn
x
0
,...,xn
[P(t

1
, . . . , t

m
)]
t
0
,...,tn
x
0
,...,xn
is dened analogously to the case of
[]
t
0
,...,tn
x
0
,...,xn
:= []
t
0
,...,tn
x
0
,...,xn
[ ]
t
0
,...,tn
x
0
,...,xn
:= ([]
t
0
,...,tn
x
0
,...,xn
[]
t
0
,...,tn
x
0
,...,xn
)
(accordingly for , , )
x:
Let x
i
1
, . . . , x
i
k
be those variables x
i
among x
0
, . . . , x
n
for which it holds
that:
x
i
free(x)
x
i
,= t
i
(Call these variables the relevant variables of the substitution.)
43
[x]
t
0
,...,tn
x
0
,...,xn
:= u []
t
i
1
,...,t
i
k
,u
x
i
1
,...,x
i
k
,x
where u := x, if x does not occur in t
i
1
, . . . , t
i
k
else: let u be the rst variable in v
0
, v
1
, v
2
, . . . that does not occur
in , t
i
1
, . . . , t
i
k
Note that we use [.] in order to make clear to what term or formula we
apply the substitution function
t
0
,...,tn
x
0
,...,xn
.
Remark 12 Consider the substitution case for x:
x is certainly distinct from any of x
i
1
, . . . , x
i
k
, because x / free(x).
Assume there are no variables x
i
with x
i
free(x) and x
i
,= t
i
(so there are no relevant variables)
= k = 0
= there are no t
i
1
, . . . , t
i
k
to consider
= x does not occur within t
i
1
, . . . , t
i
k
= u = x (there is nothing to rename)
= [x]
t
0
,...,tn
x
0
,...,xn
= u[]
u
x
= x[]
x
x
= x
It follows from the denition of our substitution function that u does
not occur within t
i
1
, . . . , t
i
k
.
Example 20 (For two variables x, y with x ,= y:)
[y y < x]
y
x
= u [y < x]
y,u
x,y
(since y occurs within t
i
1
, i.e., within y, it follows from
our denition that u must be distinct from x, y)
= u [y]
y,u
x,y
< [x]
y,u
x,y
= u u < y
The renaming works!
(Later we will use this in order to draw inferences such as the one from
xy y < x to u u < y.)
44
[y y < x]
x
y
(since y is not free in y y < x, only the substitution
for u is going to remain)
= u[y < x]
u
y
(since the number k of relevant variables is in this
case 0, there are no t
i
1
, . . . , t
i
k
in which y could occur, thus it follows
that u = y)
= y[y < x]
y
y
= y y < x
We see that nothing can be substituted for bound variables.
[v
0
P (v
0
, f(v
1
, v
2
))]
v
0
,v
2
,v
4
v
1
,v
2
,v
0
(in the second substitution we have x
1
= t
1
= v
2
and in the third sub-
stitution v
0
is bound in v
0
P(v
0
, f(v
1
, v
2
)), so these two substitutions
are omitted; furthermore, since v
0
occurs within t
i
1
= v
0
, it follows that
u = v
3
because v
3
is the variable with least index that does not occur in
, t
i
1
, . . . , t
i
k
, i.e., in v
0
P (v
0
, f(v
1
, v
2
)) , v
0
)
= v
3
[P (v
0
, f(v
1
, v
2
))]
v
0
,v
3
v
1
,v
0
= v
3
P (v
3
, f(v
0
, v
2
))
Lemma 6 (Substitution Lemma)
Let M be an o-model:
1. For all terms t T
S
:
For all variable assignments s over M, for all terms t
0
, . . . , t
n
T
S
,
for all pairwise distinct variables x
0
, . . . , x
n
:
V al
M,s
(t
t
0
,...,tn
x
0
,...,xn
) = V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(t)
2. For all formulas T
S
:
For all variable assignments s over M, for all terms t
0
, . . . , t
n
T
S
,
for all pairwise distinct variables x
0
, . . . , x
n
:
M, s
t
0
,...,tn
x
0
,...,xn
i M, s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn

Proof. By induction over terms and formulas:
Concerning 1:
45
t = c :
t = x :
a) assume x ,= x
0
, . . . , x
n
= [x]
t
0
,...,tn
x
0
,...,xn
= x
= V al
M,s
(x
t
0
,...,tn
x
0
,...,xn
) = V al
M,s
(x) = s(x)
= s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(x)
= V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(x)
b) assume x = x
i
for 0 i n
= [x]
t
0
,...,tn
x
0
,...,xn
= t
i
= V al
M,s
(x
t
0
,...,tn
x
0
,...,xn
) = V al
M,s
(t
i
)
= s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(x
i
)
= V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(x
i
)
..
= x by ass.

t = f(t

1
, . . . , t

m
): by inductive assumption
Concerning 2:
= P(t

1
, . . . , t

m
):
M, s [P(t

1
, . . . , t

m
)]
t
0
,...,tn
x
0
,...,xn
M, s P
_
[t

1
]
t
0
,...,tn
x
0
,...,xn
, . . . , [t

m
]
t
0
,...,tn
x
0
,...,xn
_

_
V al
M,s
_
[t

1
]
t
0
,...,tn
x
0
,...,xn
_
, . . . , V al
M,s
_
[t

m
]
t
0
,...,tn
x
0
,...,xn
__
I(P)
(def. of V al)

_
V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(t

1
), . . . , V al
M,s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
(t

m
)
_

I(P) (by 1.)
M, s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
P(t

1
, . . . , t

m
)
= (t

1
t

m
): analogously
, : obvious by inductive assumption
46
, , , : need not be treated as extra cases (express them in terms
of , , )
= x: we assume inductively that 2. from above is true of
M, s [x ]
t
0
,...,tn
x
0
,...,xn
M, s u []
t
i
1
,...,t
i
k
,u
x
i
1
,...,x
i
k
,x
(def. of substitution)
there is a d D, such that:
M, s
d
u
[]
t
i
1
,...,t
i
k
,u
x
i
1
,...,x
i
k
,x
(def. of V al)
there is a d D, such that:
M,
_
s
d
u
_ V al
M,s
d
u
(t
i
1
),...,V al
M,s
d
u
(t
i
k
),V al
M,s
d
u
(u)
x
i
1
,...,x
i
k
,x
(by ind. ass.)
there is a d D, such that:
M,
_
s
d
u
_
V al
M,s
(t
i
1
),...,V al
M,s
(t
i
k
),d
x
i
1
,...,x
i
k
,x

(by the coincidence lemma, which we can apply because u not in
t
i
1
, . . . , t
i
k
see p. 44)
there is a d D, such that:
M, s
V al
M,s
(t
i
1
),...,V al
M,s
(t
i
k
),d
x
i
1
,...,x
i
k
,x

(Because:
in case u = x : one of the
d
u
is superuous and can be omitted
in case u ,= x : u / apply coincidence lemma)
there is a d D, such that:
M,
_
s
V al
M,s
(t
i
1
),...,V al
M,s
(t
i
k
)
x
i
1
,...,x
i
k
_
d
x
(x ,= x
i
1
, . . . , x
i
k
see p. 44)
M, s
V al
M,s
(t
i
1
),...,V al
M,s
(t
i
k
)
x
i
1
,...,x
i
k
x (def. of V al(x))
M, s
V al
M,s
(t
0
),...,V al
M,s
(tn)
x
0
,...,xn
x
Since: for i / i
1
, . . . , i
k
(i.e., for the index of an irrelevant variable)
either of the following must be the case:
i) x
i
/ free(x) apply coincidence lemma (V al only depends on
free variables)!
ii) x
i
= t
i
: V al
M,s
(t
i
) = V al
M,s
(x
i
) = s(x
i
)
47
before the equivalence sign: x
i
s(x
i
)
after the equivalence sign: x
i
V al
M,s
(t
i
) = s(x
i
)
Remark 13 It is easy to express unique existence by means of substitution:
!x := x( y(
y
x
y x))
By the substitution lemma:
M, s !x
there is one and only one d D, such that: M, s
d
x

48
3.6 Problem Set 4
1. Show:
(a) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
2
v
2
v
0
v
1
v
3
= v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
2
))
(b) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
3
f(v
2
, v
3
)
v
2
v
3
= v
0
v
1
(P(v
0
, v
3
) P(v
1
, f(v
2
, v
3
)))
(c) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
0
f(v
2
, v
3
)
v
0
v
2
v
3
= v
4
v
1
(P(v
4
, v
0
) P(v
1
, f(v
2
, v
3
)))
(d) [v
0
v
1
(P(v
0
, v
1
) P(v
0
, v
2
)) v
2
f(v
2
, v
2
) v
0
]
v
0
f(v
0
, v
1
)
v
0
v
2
= v
3
v
4
(P(v
3
, v
4
) P(v
3
, f(v
0
, v
1
))) v
2
f(v
2
, v
2
) v
0
2. Let t
0
, . . . , t
n
be o-terms, x
0
, . . . , x
n
pairwise distinct variables, an
o-formula and y a variable.
Prove:
(a) If is a permutation of the numbers 0, . . . , n, then:

t
0
, . . . , t
n
x
0
, . . . , x
n
=
t
(0)
, . . . , t
(n)
x
(0)
, . . . , x
(n)
(b) If y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
), then
i. y var(t
0
) . . . var(t
n
) or
ii. y var(t) and y ,= x
0
, . . . , x
n
.
49
4 A Sequent Calculus for First-Order Predi-
cate Logic
In the following we will make precise what we mean by a mathematical
proof.
4.1 Preliminary Remarks on the Sequent Calculus
(Informal) Mathematical proofs have roughly a structure like this:
_
Assumptions (axioms, denitions, proved theorems,. . .)
_
Derivation steps
_
Theorem
We are going to call sequences of sentences like this sequents. If such
sequents correspond to actual proofs, we will call them correct.
More formally: Let o be an arbitrary symbol set.
An (o-)sequent is a nite sequence

2
. . .
n1

n
of o-formulas (n 1).
We call

1

2
. . .
n1
the antecedent of the sequent (assumptions)

n
the consequent of the sequent (i.e., the formula for which we want
to claim that it follows from the assumptions)
50
While proving theorems informally, we implicitly manipulate sequents in
various ways (we extend sequents, we drop auxiliary assumptions,. . .).
E.g., indirect proofs:
add the negation of what you want to prove;
derive a contradiction;
conclude the sentence you intended to prove.
Formally:
Show that both

1
. . .
k

and

1
. . .
k

are correct.
Conclude that

1
. . .
k
( is dropped because it led to a contradiction)
is correct.
We have to make show and conclude precise. What we need is (i) rules
which introduce sequents that are obviously correct, like

and (ii) rules which lead from correct sequents to further correct sequents,
e.g.,

1
. . .
k

1
. . .
k

_
Premises

1
. . .
k
Conclusion
Rules such as the latter will often be abbreviated, e.g., by



(so we use , ,. . . as variables for sequents).
51
The sequent calculus is a specic set of such rules (some have premises, some
have not). We will see that its premise-free rules only lead to correct sequents
and that its rules with premises lead from correct sequents to other correct
sequent (so these rules are correctness-preserving).
But what is the correctness of a sequent?
Denition 13 For all o-sequents :
is correct :i [ is sequence member of
. .
briey:

(We will exploit the systematic ambiguity of and other capital Greek
letters: in some contexts they will denote sequents of formulas, in other con-
texts they will denote sets of formulas, in particular, sets of members of a
sequent never mind. . .).
Once we are given the rules of the sequent calculus, derivability of sequents
in the sequent calculus can be dened analogously to derivability of terms in
the terms calculus.
Finally, we can dene the derivability of formulas from other formulas on
basis of the derivability of sequents:
Denition 14 Let be a set of o-formulas, let be an o-formula:
is derivable from , briey: :i
there are
1
, . . . ,
n
, such that

1
. . .
n

is derivable in the sequent calculus.


Our goal is to prove:
(Soundness and Completeness Theorem)
=: Soundness of the sequent calculus
=: Completeness of the sequent calculus
Lemma 7 there is a nite set

such that


Proof.
(:) follows from the denition of
(:)
52
Now we are going to introduce the rules of the sequent calculus. These rules
are divided into the following groups: basic rules; rules for propositional
connectives; rules for quantiers; rules for equality.
4.2 Basic Rules
Antecedent rule: (Ant.)

(for

)
(

means: every sequence member of is a sequence member of

)
Explanation:
We are always allowed to add assumptions and we are always allowed to
permute them.
Correctness:
Proof. Assume that is correct, i.e., .
Let

be a set of o-formulas, such that

.
Let M, s be chosen arbitrarily, such that M, s

.
= M, s
= M, s (by assumption)
It follows that

, i.e.,

is correct.
Assumption rule: (Ass.)

(for being a sequence member of )


Explanation:
We are always allowed to conclude assumptions from themselves.
Correctness:
Proof.
If , then certainly ; hence, is correct.
53
4.3 Rules for Propositional Connectives
Proof by cases: (PC)



_
e.g. x 0
x < 0
_
=
_
Explanation:
If we can show both under the assumption and under the assumption
(and since one of these two assumptions must actually be the case), we
are allowed to conclude without assuming anything about or .
Note that this rule allows us to shorten sequents.
Correctness:
Proof. Assume that , are correct, i.e.,
,
Let M, s be chosen arbitrarily such that M, s .
There are two possible cases:
Case 1: M, s
= M, s
= M, s (by assumption)
Case 2: M, s
= M, s
= M, s
= M, s (by assumption)
= = is correct.
54
Contradiction: (CD)


Explanation:
If assuming leads to a contradiction, then we are allowed to infer .
Correctness:
Proof. Assume that , are correct, i.e.,
, .
So for all M, s with M, s it must hold that:
M, s and M, s
. .
M,s
= there are no M, s such that M, s ()
= for all M, s with M, s holds: M, s
Because: otherwise there would exist M, s with M, s and M, s
. .
M,s
But this would contradict ()!
= = is correct.
55
-Introduction in the antecedent: (-Ant.)


( )
. .
antecedent

Explanation:
Disjunctions in the antecedent allow for being treated in terms of two
cases case on the one hand and case on the other.
(Here the sequents in question do not get shorter.)
Correctness: analogous to proof by cases!
-Introduction in the consequent: (-Con.)
(i)

( )
(ii)

( )
Explanation:
We are always allowed to weaken consequents by introducing disjunctions.
Correctness:
Proof. (i) Assume that is correct, i.e. .
= for all M, s with M, s holds:
M, s
. .
M,s
= = ( ) is correct.
(ii) Analogously.
From the rules introduced so far we can derive further rules in the sense
that these latter rules can be regarded as abbreviations of combined appli-
cations of the rules above:
56
Excluded middle: (EM)

Derivation:
1. (Ass.)
2. (-Con.(i)) with 1.
3. (Ass.)
4. (-Con.(ii)) with 3.
5. (PC) with 2., 4.
Triviality: (Triv.)

Derivation:
1. (Premise)
2. (Premise)
3. (Ant.) with 1.
4. (Ant.) with 2.
5. (CD) with 3.,4.
Chain syllogism: (CS)

57
Derivation:
1. (Premise)
2. (Premise)
3. (Ant.) with 2.
4. (Ass.)
5. (Triv.) with 3.,4.
6. (PC) with 1.,5.
Contraposition: (CP)
1.

2.

3.

4.

Derivation:
1. 1. (Premise)
2. (Ant.) with 1.
3. (Ass.)
4. (Triv.) with 2.,3.
5. (Ass.)
6. (PC) with 4.,5.
2.-4. analogously
(Note that we could not have used CD in order to derive 6. directly from 2.
and 3.: is not necessarily a negation formula as demanded by CD!)
Disjunctive syllogism: (DS)
( )

58
Plan of derivation:
First derive and on the basis of .
= will be derivable = using chain syllogism we will be done!
Derivation:
1. (Premise)
2. (Premise)
3. (Ant.) with 2.
4. (Ass.)
5. (Triv.) with 4.,3.
6. (Ass.)
7. (-Ant.) with 5.,6.
8. (CS) with 7.,1.
4.4 Rules for Quantiers
(In the following, x and y are arbitrary variables again.)
-Introduction in the consequent: (-Con.)

t
x
x
Explanation:
If we can conclude from that t has the property expressed by the formula
, then we are also allowed to conclude from that there exists something
which has the property expressed by .
Correctness:
Proof. Assume that
t
x
is correct, i.e.,
t
x
.
Let M, s be arbitrary, such that M, s .
= M, s
t
x
(by assumption)
= M, s
V al
M,s
(t)
x
(substitution lemma)
= there is a d D, such that M, s
d
x
(d = V al
M,s
(t))
59
= M, s x
= x = x is correct.
-Introduction in the antecedent: (-Ant.)

y
x

x
(if y is not free in the sequent x )
Explanation:
Assume that we can derive from and from the fact that y has the property
expressed by the conclusion that is the case. Furthermore assume that
does not include any assumptions on y nor does say anything about y.
Then we are allowed to conclude from together with the assumption that
there exists some x which has the property expressed by .
Compare the proof of For all x there is a y, such that y x = e (theorem
1) in chapter 1: there we had
Proof.
Let x be arbitrary (in G).
By (G3) there is a y, such that x y = e.
Now let y be some group element for which x y = e:
for this y it follows from (G3) that there is a z, such that . . .
.
.
.
= y x = e, which implies that there is a left-inverse element for x.
So we have shown for our arbitrarily chosen y for which x y = e holds that
it is a left-inverse element of x and thus that there is a left-inverse element
for x. But since y was chosen arbitrarily in the sense that we did not assume
anything about y except that it satises x y = e, the same conclusion can
be drawn from the mere existence of a group element that satises xy = e.
Now written in terms of sequents:

..
Group axioms

y
y
..
x y e

..
y y x e
Group axioms
. .

y x y e
. .

y y x e
. .

60
The if-condition (y not free in y) is satised and thus neither y
nor contains any information about y.
Correctness:
Proof. Assume
y
x
is correct,
i.e.,
y
x
() and y is not free in x
Let M, s be arbitrary with M, s x (to show: M, s ).
= M, s x
= there is a d D, such that M, s
d
x

= there is a d D, such that M, (s
d
y
)
d
x

because:
for x = y :
for x ,= y : by assumption, y / free(x )
= y / free() (since y ,= x)
Thus: M, s
d
x
M, (s
d
y
)
d
x

(by the coincidence lemma, for y / free())
= there is a d D, such that M, (s
d
y
)
d
..
V al
M,s
d
y
(y)
x

Hence, by the substitution lemma: M, s
d
y

y
x
Furthermore: by assumption M, s
= M, s
d
y
(from the coincidence lemma y / free())
Thus, for d as above:
M, s
d
y

y
x

= M, s
d
y
(by ())
= M, s (coincidence lemma, for y / free())
= x = x is correct.
Remark 14 Postulating the if condition is necessary:
[P(x, y)]
y
x
P(y, y) (correct by Ass. rule)
x P(x, y)
. .

P(y, y)
. .

(incorrect e.g. <-relation on R)


Not an instance of our rule: y is free in xP(x, y) P(y, y)!
61
4.5 Rules for Equality
Reexivity: (Ref.)
tt
Explanation:
The equality relation on D is reexive (independent of the model).
Correctness:
Proof.
For all M, s holds:
V al
M,s
(t) = V al
M,s
(t)
= M, s t t
Substitution rule: (Sub.)

t
x
t t
/

t
/
x
Explanation:
Substitution of identicals!
Correctness:
Proof. Assume
t
x
is correct, i.e.,
t
x
.
Let M, s be arbitrary with M, s t t

(to show: M, s
t

x
)
= M, s
t
x
(from the assumption)
= M, s
V al
M,s
(t)
x
(substitution lemma)
Since M, s t t

= V al
M,s
(t) = V al
M,s
(t

)
and therefore also: M, s
V al
M,s
(t

)
x

= M, s
t

x
(substitution lemma)
= t t

x
= t t

x
is correct
62
From the rules in sections 4.4 and 4.5 we can derive the following auxiliary
rules:


x
by (-Con.) (t := x;
x
x
= )


x
(if x is not free in )
by (-Ant.) (y := x; note that x is of course bound in x)


x t
/

t
/
x
by (Sub.) (t := x)
Symmetry: (Symm.)
t
1
t
2
t
2
t
1
Since:
1. t
1
t
2
(Premise)
2. t
1
t
1
(Ref.)
3. t
1
t
1
. .
=
t
1
x
(Ant.) with 2.
4. t
1
t
2
t
2
t
1
. .
=
t
2
x
(Sub.) with 3. for = x t
1
=
t
1
x
= t
1
t
1
,
t
2
x
= t
2
t
1
5. t
2
t
1
(CS) with 4.,1.
63
Transitivity: (Trans.)
t
1
t
2
t
2
t
3
t
1
t
3
Since:
1. t
1
t
2
(Premise)
2. t
2
t
3
(Premise)
3. t
2
t
3
t
1
t
3
(Sub.) with 1. for = t
1
x =
t
2
x
= t
1
t
2
,
t
3
x
= t
1
t
3
4. t
1
t
3
(CS) with 3.,2.
P(t
1
, . . . , t
n
)
t
1
t
/
1
.
.
.
t
n
t
/
n
P(t
/
1
, . . . , t
/
n
)
Since: (e.g. for n = 2)
1. P(t
1
, t
2
) (Premise)
2. t
1
t

1
(Premise)
3. t
2
t

2
(Premise)
4. t
1
t

1
P(t

1
, t
2
) (Sub.) with 1. for = P(x, t
2
)
5. P(t

1
, t
2
) (CS) with 4.,2.
6. t
2
t

2
P(t

1
, t

2
) (Sub.) with 5. for = P(t

1
, x)
7. P(t

1
, t

2
) (CS) with 6.,3.
64
Analogously:
t
1
t
/
1
.
.
.
t
n
t
/
n
f(t
1
, . . . , t
n
) f(t
/
1
, . . . , t
/
n
)
For the proof: by Reexivity
f(t
1
,...,tn)f(t
1
,...,tn)
, then add by (Ant.)
Subst. CS (repeat last two steps n times)
4.6 The Soundness Theorem for the Sequent Calculus
It follows:
Theorem 3 (Soundness Theorem)
For all T
S
, for all T
S
, it holds:
If , then .
Proof.
Assume , i.e., there are
1
, . . . ,
n
, such that the sequent
1
. . .
n

is derivable in the sequent calculus.


I.e. 1. . . .
2. . . .
.
.
.
m.
1
. . .
n

We have already shown: each rule of the sequent calculus is correct (premise-
free rules lead to correct sequents, rules with premises preserve correctness).
By induction over the length of derivations in the sequent calculus it follows:
Every sequent that is derivable in the sequent calculus is correct.
So this must hold also for
1
. . .
n
, thus
1
, . . . ,
n

. .


.
65
Remark 15 The sequent calculus does not only contain correct rules for
, , , , but also for , , , by means of the metalinguistic abbre-
viations that we considered in the chapter on semantics.
E.g. :=
Using such abbreviations we get:
Modus Ponens:

..



proof analogous to:



4.7 Some Important Proof-Theoretic Concepts
(Compare section 3.3!)
We have already dened the notion of derivability for formulas ( ).
Some formulas have the property of being derivable without any premises:
Denition 15 For all T
S
:
ist provable :i the (one-element) sequent is derivable in the sequent
calculus (briey: ).
E.g., we know that (for arbitrary T
S
) is provable: see p. 57.
Some formulas have the property of not including (explicitly or implicitly) a
contradiction:
Denition 16 For all T
S
, T
S
:
is consistent :i there is no T
S
with: , .
is consistent :i there is no T
S
with: , .
E.g. P(c) is consistent, because:
assume P(c) , P(c)
= P(c) , P(c) (Soundness theorem)
= there are no M, s with M, s P(c)
But this is false: take e.g. D = 1, I(c) = 1, I(P) = D
M P(c).
66
Lemma 8 is consistent i there is a T
S
, such that .
Proof. We show:
is not consistent there is no T
S
, such that
for all T
S
:
: since , = is not consistent
: assume is not consistent,
i.e., , for some T
S
:
Thus 1. . . . 1. . . .
2. . . . 2. . . .
.
.
.
.
.
.
.
.
.
.
.
.
m. n.

. . . .
derivation 1 ( ) derivation 2 (

)
Now: 1. . . .
.
.
.
.
.
.
m.
_
derivation 1
m + 1. . . .
.
.
.
.
.
.
m + n.

_
derivation 2
m + n + 1.

(Ant.) with m.
m + n + 2.

(Ant.) with m+n.


m + n + 3.

(Triv.) with m+n+1., m+n+2.


Since

= for arbitrary T
S

Moreover:
Lemma 9 is consistent i every nite subset

is consistent.
Proof. Immediate from our denitions.
67
The soundness theorem above was formulated for und . But there is a
corresponding version for consistency and satisabillity (in fact we already
sketched the proof of this second version when we showed that P(c) is
consistent on p. 66):
Corollary 2 (Soundness Theorem: Second Version)
For all T
S
: if is satisable, then is consistent.
Proof.
We show: is not consistent = is not satisable.
Assume that is not consistent:
= , (by denition)
= , (Soundness theorem)
= there are no M, s with M, s ,
i.e., is not satisable.
Furthermore, we can show the proof-theoretic counterpart of lemma 5:
Lemma 10 For all T
S
, T
S
:
1. is provable i .
2. i is not consistent.
3. is provable i is not consistent.
Proof.
1. Follows directly from the denitions.
2. () Assume that :
Obviously, this implies: .
Furthermore: (by the Ass. rule)
= is not consistent.
() Assume that is not consistent:
= every formula is derivable from (Lemma 8)
= ,
i.e., there is a derivation of the following form:
68
1. . . .
.
.
.
.
.
.
m. ( )
Extend: m+1. (Ass.)
m+2. (PC) with m+1., m.
=
=
3. Consider = and apply 2. and 1.
We did not prove the semantic counterpart of the following lemma (since it
would be trivial):
Lemma 11 For all T
S
, T
S
:
If is consistent, then is consistent or is consistent.
Proof.
Assume that , are both not consistent.
is not consistent = (by 2. of lemma 10)
is not consistent = (proof analogous to 2. of lemma 10)
= is not consistent.
Remark 16
We do not consider a proof-theoretic counterpart of the semantic notion
of logical equivalence.
Our proof-theoretic concepts are actually again relativized to a sym-
bol set o (o-sequent calculus, o-derivability,. . .), just as our semantic
concepts.
Here is a lemma where we make this implicit reference to symbol sets explicit
(we need this lemma later in the proof of the completeness theorem):
69
Lemma 12 Let o
0
o
1
o
2
. . . be a chain of symbol sets.
Let
0

1

2
. . . be a chain of sets of formulas, such that:
For all n 0, 1, 2, . . . :
n
is a set of formulas over the symbol set o
n
and

n
is o
n
-consistent (i.e., consistent in the sequent calculus for formulas in
T
Sn
).
Let nally o =

n{0,1,2,...}
o
n
, =

n{0,1,2,...}

n
.
It follows: is o-consistent.
Proof.
Let the symbol sets and formula sets be given as indicated above.
Assume that is not o-consistent:
= there is a with nite, not o-consistent (by lemma 9)
= there is a k 0, 1, 2, . . ., such that
k
(since is nite).
is not o-consistent, therefore for some T
S
: (i) there is an o-derivation
of from , (ii) there is an o-derivation of from .
But in these two sequent calculus derivations only nitely many symbols in
o can occur. Thus there is an m 0, 1, 2, . . ., such that o
m
contains all
the symbols in these two derivations.
Without restricting generality, we can assume that m k:
= is not o
m
-consistent
=
k
is not o
m
-consistent
Since m k it also follows that
k

m
=
m
is not o
m
-consistent: contradiction!
= is o-consistent.
70
4.8 Problem Set 5
1. (This problem counts for award of CREDIT POINTS.)
Are the following rules correct?
(a)

1

1

2

2

1

2

1

2
(b)

1

1

2

2

1

2

1

2
2. Derive the following (auxiliary) rules from the rules of the sequent
calculus:
(a)


(b)


(c)



(d)


(e)


(f)


3. Are the following rules correct?
(a)

x x
(b)

x x
71
4. Derive the following (auxiliary) rules from the rules of the sequent
calculus:
(a)
x

t
x
(b)
x

(c)

t
x

x
(d)

y
x
x
if y is not free in the sequent x.
(e)

x
(f)

x
if x is not free in the sequent .
(Remark: x is to be regarded as x in the problems above.)
72
5 The Completeness Theorem and Its Con-
sequences
Here is the idea of the proof:
Completeness theorem: For all , : if then .
Let , be such that . Assume :
= is consistent (by 2. of lemma 10)
= satisable (from () below)
But: is not satisable by 2. of lemma 5 (since )
Contradiction!
=
So we have to show: For all : if is consistent, then is satisable. ()
This means that for consistent we must prove that M, s exist, such that:
M, s .
We divide this existence proof into two parts:
5.1 The Satisability of Maximally Consistent Sets of Formulas with In-
stances
5.2 The Extension of Consistent Sets of Formulas to Maximally Consistent
Sets of Formulas with Instances
By (i) applying 5.2, then (ii) applying 5.1 which is going to give us ()
and nally (iii) applying the proof strategy from above, we will be done.
73
5.1 The Satisability of Maximally Consistent Sets of
Formulas with Instances
Let o be a symbol set that we keep xed.
Denition 17 Let T
S
:
is maximally consistent i
is consistent and for all T
S
: or
contains instances i
for every formula of the form x T
S
there is a t T
S
, such that:
(x
t
x
)
Now let be maximally consistent with instances (i.e., it is maximally con-
sistent and contains instances).
To show: is satisable.
Let us consider an example rst: let = P(c
1
).
= is consistent (since it is satisable apply corollary 2).
But: is not maximally consistent.
E.g., P(c
2
),
P(c
2
)
because P(c
2
), P(c
2
) are consistent since they are
satisable.
Furthermore: does not contain instances for all formulas (only for some).
E.g., (xP(x) P(t)
. .
P(x)
t
x
) for arbitrary t T
S
Since: choose any model of ( x P(x)
. .
true
P(t)
. .
false
)
. .
false
; such
a model exists and and thus this formula set is consistent.
74
But e.g. (xP(x) P(c
1
)), since P(c
1
) and thus
by the -introduction rule in the consequent: xP(x) P(c
1
)
. .
xP(x)P(c
1
)
Another example:
Let M, s be such that for every d D there is a t T
S
such that:
V al
M,s
(t) = d (which implies that D is countable).
Consider = T
S
[M, s
= is consistent and or for arbitrary T
S
.
(Since: M, s or M, s = or )
= is maximally consistent!
Furthermore:
For all formulas x there is a t, such that: (x
t
x
)
Because:
Case 1: M, s x
M, s x
t
x
. .
for all t T
S
x
t
x

Case 2: M, s x
= there is a d D, such that: M, s
d
x
, and
d = V al
M,s
(t) for some t T
s
(by assumption)
= there is a t T
s
, such that: M, s
V al
M,s
(t)
x

= there is a t T
s
, such that: M, s
t
x
(substitution lemma)
= there is a t T
s
, such that: M, s x
t
x
For such a t it follows: x
t
x

So is actually maximally consistent with instances.
Now we that we have seen an example of a maximally consistent set of
formulas that contains instances, let us consider such sets in general.
We will show that every such set is satisable.
75
So let be a maximally consistent formula set with instances.
Wanted: M, s with M, s
Thus, if e.g. P(f(x))
= M, s P(f(x)) I(f)(s(x)) I(P)
Problems:
1. What should we choose to be the members of the domain D?
2. How shall we dene I, s?
Suggestions:
Let us dene D to be T
S
! (This is about problem 1.)
Every term is assumed to denote itself! (This is about problem 2.)
I(P) is dened in accordance with (This is also about problem 2.)
I.e., rst attempt: let
D := T
S
I(c) := c
I(f)(t
1
, . . . , t
n
) := f(t
1
, . . . , t
n
)
I(P) := (t
1
, . . . , t
n
)[ P(t
1
, . . . , t
n
) (so I(P) = I

(P), i.e., I depends on )


s(x) := x
Assume P(f(x))
P(f(x))
f(x)
..
=I(f)(s(x))
I(P) (by denition of I(P), I(f), and s(x))
M, s P(f(x))
But there is yet another problem:
assume f(x) f(y) (for x ,= y)
V al
M,s
(f(x)) = I(f)(s(x)
..
=x
) = f(x) (for M, s dened as above)
V al
M,s
(f(y)) = I(f)(s(y)
..
=y
) = f(y)
BUT: f(x) ,= f(y)!
M, s f(x) f(y), although f(x) f(y) !
76
Improved attempt:
We must adapt M, s to .
I.e., let us consider equivalence classes of terms rather than terms themselves
as members of our intended domain: for t
1
, t
2
T
S
, let
t
1
t
2
t
1
t
2
(i.e., =

)
It follows:
Lemma 13
1. is an equivalence relation on T
S
.
2. is compatible with functions signs and predicates in o, i.e.,
t
1
t

1
, . . . , t
n
t

n
f(t
1
, . . . , t
n
) f(t

1
, . . . , t

n
)
t
1
t

1
, . . . , t
n
t

n
P(t
1
, . . . , t
n
) P(t

1
, . . . , t

n
)
Proof.
1. t t, since t t (Re.)
Assume t
1
t
2
= t
1
t
2
t
2
t
1
(Symm.) t
2
t
1

Assume t
1
t
2
, t
2
t
3
= t
1
t
2
, t
2
t
3
t
1
t
3
(Trans.) t
1
t
3

2. Assume t
1
t

1
, . . . , t
n
t

n
= t
1
t

1
, . . . , t
n
t

n
f(t
1
, . . . , t
n
) f(t

1
, . . . , t

n
) (see p.65)
f(t
1
, . . . , t
n
) f(t

1
, . . . , t

n
)
Assume t
1
t

1
, . . . , t
n
t

n
.
.
.
analogously for P(t
1
, . . . , t
n
) and P(t

1
, . . . , t

n
) (see p.64)
77
So we dene:
D

:= [t]

[t T
S

(c) := [c]

(f) ([t
1
]

, . . . , [t
n
]

) := [f(t
1
, . . . , t
n
)]

(P) := ([t
1
]

, . . . , [t
n
]

) [ P(t
1
, . . . , t
n
)
M

:= (D

, I

)
s

(x) := [x]

(this is well-dened, since the denitions are independent of the choice of the
representatives t
1
, . . . , t
n
as can be seen from 2. of lemma 13).
One can show:
Lemma 14 For all T
S
:
1. For all t T
S
: V al
M

,s
(t) = [t]

2. For all atomic formulas T


S
:
M

, s

i
3. For all T
S
, for all pairwise distinct variables x
1
, . . . , x
n
:
M

, s

x
1
x
2
. . . x
n
i
there are terms t
1
, . . . , t
n
T
S
such that M

, s


t
1
,...,tn
x
1
,...,xn
.
(Note that our assumption that is maximally consistent and contains in-
stances is not yet needed in order to derive the claims of this lemma.)
Proof.
1. By induction over o-terms:
t = c : V al
M

,s
(c) = I

(c) = [c]

(def.)
t = x : V al
M

,s
(x) = s

(x) = [x]

(def.)
t = f(t
1
, . . . , t
n
)
V al
M

,s
(f(t
1
, . . . , t
n
)) = I

(f)
_
V al
M

,s
(t
1
), . . . , V al
M

,s
(t
n
)
_
= I

(f) ([t
1
]

, . . . , [t
n
]

) (by inductive assumption)


= [f(t
1
, . . . , t
n
)]

(def. of I

)
78
2. M

, s

t
1
t
2
V al
M

,s
(t
1
) = V al
M

,s
(t
2
)
[t
1
]

= [t
2
]

(by 1.)
t
1
t
2
t
1
t
2
(def. of )
/

, s

P(t
1
, . . . , t
n
) (for P ,= )

_
V al
M

,s
(t
1
), . . . , V al
M

,s
(t
n
)
_
I

(P)
([t
1
]

, . . . , [t
n
]

) I

(P) (by 1.)


P(t
1
, . . . , t
n
) (def. of I

)
3. M

, s

x
1
x
2
. . . x
n

there are d
1
..
=[t
1
]
, . . . , d
n
..
=[tn]
D

with
M

, s
d
1
,...,dn
x
1
,...,xn

(the order in which s is manipulated is irrelevant, since x
i
,= x
j
for
i ,= j)
there are t
1
, . . . , t
n
T
S
with
M

, s

[t
1
]

,...,[tn]

x
1
,...,xn

there are t
1
, . . . , t
n
T
S
with
M

, s

V al
M

,s

(t
1
),...,V al
M

,s

(tn)
x
1
,...,xn
(by 1.)
there are t
1
, . . . , t
n
T
S
with
M

, s


t
1
,...,tn
x
1
,...,xn
(substitution lemma)

So now we know:
M

, s

satises all atomic formulas that are derivable from (by 2. of the
last lemma). Let us now extend this to all formulas in T
S
:
Here we use: maximal consistency of in order to derive this for , -formulas
s having instances in order to derive this for -formulas
What we need to show:
Lemma 15 For all maximally consistent T
S
with instances, for all
, T
S
:
79
1. i
2. i or
3. x i there is a t T
S
such that:
t
x
Proof.
1. From being maximally consistent follows: or
From being maximally consistent we have: it is not the case that
both and
So we are done.
2. () Assume
1.) If then we are done.
2.) If , then (by maximal consistency)
(by disjunctive syllogism)
() Assume or
(-Con.)
3. () Assume x
Since contains instances, there is a t with: x
t
x
By modus ponens:
t
x

() Assume
t
x
for some t T
S
x (-Con.)
So nally we have:
Theorem 4 (Henkins Theorem)
For all maximally consistent T
S
with instances, for all T
S
:
M

, s

i
Proof. By induction over o-formulas:
Atomic formulas: (2. of lemma 14)
80
= :
M

, s

, s


(by inductive assumption)
(1. of lemma 15)
= :
M

, s

, s

or M

, s


or (by inductive assumption)
(2. of lemma 15)
= x:
M

, s

x
there is a t T
S
with: M

, s


t
x
(3. of lemma 14)
there is a t T
S
with:
t
x
(by inductive assumption)
x (3. of lemma 15)
81
5.2 Extending Consistent Sets of Formulas to Maxi-
mally Consistent Sets of Formulas with Instances
Idea of the proof:
extend (1st lemma)
consistent (and only nitely many free variables)
consistent with instances ( )
extend (2nd lemma) maximally consistent with instances ( )
conclude (from 5.1) satisable ( satisable)
Afterwards: get rid of restriction to nitely many free variables!
Lemma 16 Let T
S
, such that is consistent and the set of variables
that occur freely in some formula in is nite:
there is a T
S
with , such that constains instances and is
consistent.
Proof. We know: T
S
is countable (lemma 2)
the set of formulas in T
S
that begin with is countable
So let x
0

0
, x
1

1
, x
2

2
, . . . be an enumeration of existentially quantied
formulas in T
S
(note that each x
i
is a metavariable that stands for some of our rst-order
variables v
j
in particular, x
i
is not necessarily identical to v
i
!)
Now we dene instances for this sequence of formulas:

n
:= x
n

n

n
yn
xn
where y
n
is the variable v
k
with the least index k such that
v
k
does not occur freely in
0
, . . . ,
n1

. .
n
x
n

n

Such a variable y
n
i.e., v
k
does exist:
there are only nitely many free variables in
n
x
n

n

(since there are only nitely many variables in )


Now let be dened as follows:
:=
_
nN
0

n
82
T
S

contains instances
is consistent
Because:
( =)
0

1

2
and =

nN
0

n
(Corresponding symbol sets: o
0
o
1
o
2
with o
i
:= o
for all i 0)
= So we can apply lemma 12:
If all formula sets
n
are consistent with respect to o
n
= o, then
the same holds for =

nN
0

n
.
But the sets
n
are indeed consistent as induction over n shows:
induction basis:
0
= is consistent (by assumption)
inductive assumption:
n
is consistent
inductive step (n n + 1):
assume for contradiction that
n+1
is not consistent
(where
n+1
=
n

n
):
= every formula in T
S
is derivable from
n+1
(by
lemma 8)
In particular: let be a sentence in T
S
=
n+1

Thus: there is a
n
, such that the sequent
n

is derivable in the sequent calculus.


Consider such a derivation:
1. . . .
.
.
.
.
.
.
m.
n
..

x
n

n

n
yn
xn
= (x
n

n

n
yn
xn
) by def.
Extend derivation:
m+1. x
n

n
x
n

n
(Ass.)
m+2. x
n

n
(x
n

n

n
yn
xn
) (-Con.) with m+1.
m+3. x
n

n
(x
n

n

n
yn
xn
) (Ant.) with m.
m+4. x
n

n
(CS) with m+3., m+2.
83
.
.
. (analogously)
m+8.
n
yn
xn
. . .
m+9. x
n

n
(-Ant.) with m+8.
since y
n
is not in free( x
n

n
):
y
n
/ free( x
n

n
) by choice of y
n
(
n
)
and y
n
/ free(), since is a sentence
m+10. (PC) with m+9., m+4.
so: for both, say, = v
0
v
0
v
0
and for = v
0
v
0
v
0
we can show: is derivable from
n
=
n
is not consistent, which contradicts the induc-
tive assumption
=
n+1
is consistent
=By induction: every set
n
is consistent = is consistent
Lemma 17 Let T
S
with consistent:
there is a T
S
such that and is maximally consistent.
(Note that there is no assumption on instances.)
Proof.
Let
0
,
1
,
2
, . . . be an enumeration of the formulas in T
S
(such an enumer-
ation exists since T
S
is countable by lemma 2).
Now dene:

0
:=
and for n 0 :
n+1
:=
_

n

n
if
n

n
consistent

n
else
Let :=

nN
0

n
: so
T
S

consistent: analogous to before
(
0

1

2
, =

nN
0
84

n
are consistent by denition
= as before: is consistent by lemma 12)
is maximal:
Since:
Let T
S
be chosen arbitrarily
Case 1:
Case 2:
= is consistent (proof analogous to 2. of lemma
10)
By enumeration there is an n N
0
with =
n
=
n
consistent
=
n

n
consistent (because
n
)
=
n+1
=
n

n
(since consistent)
= =
n

n+1

=
=
In both cases: or
= is maximal
Corollary 3 Let T
S
, consistent with only nitely many free variables
in :
It follows that is satisable.
Proof.
Extend to consistent with instances according to lemma 16,
extend to maximally consistent according to lemma 17
(since = contains instances):
but this implies that is satisable by Henkins theorem.
85
Now we are nally in the position to prove (one version of) the completeness
theorem:
Theorem 5 (Completeness Theorem)
For all T
S
it holds:
If is consistent, then is satisable.
Proof. Since the set of free variables in is perhaps innite, we cannot
apply corollary 3 directly in order to prove the completeness theorem.
So we have to make a small detour:
Let o

:= o c
0
, c
1
, c
2
, . . ., where c
0
, c
1
, c
2
, . . . are pairwise distinct new
constants that are not yet contained in o.
Let furthermore

:=
c
0
,c
1
,...,cn
v
0
,v
1
,...,vn
(for T
S
)
where n

is minimal such that free() v


0
, . . . , v
n

(this substitution obviously has no eect on variables that only occur in


as bound variables).
Finally, let

:=

[ .
Note:

is a set of sentences (over the symbol set o

).
Subsequent proof structure:
is o-consistent by assumption,
=

is o

-consistent
=

is satisable (there is an o

-model)
= is satisable (there is an o-model)
Now we will show these claims in a step-by-step manner:
is by assumption o-consistent, therefore

is o

-consistent,
because:
1. Let

, nite
= =

1
, . . . ,

n
for
1
, . . . ,
n

Since
1
, . . . ,
n

=
1
, . . . ,
n
o-consistent

1
, . . . ,
n
can only contain nitely many variables
(because it is a nite set)
86
=
1
, . . . ,
n
satisable (by corollary 3)
i.e., there is an o-model M and a variable assignment s over M,
such that M, s
1
, . . . ,
n

Now we extend M to an o

-model M

= (D

, I

) where:
D

:= D
I

[
S
I
I

(c
i
) := s(v
i
) (for new c
i
)
It follows that for all T
S
:
M, s M, s
s(v
0
),...,s(vn
)
v
0
,...,vn

M

, s
s(v
0
),...,s(vn
)
v
0
,...,vn
(coincidence lemma)
M

, s
I

(c
0
),...,I

(cn
)
v
0
,...,vn
(def. I

)
M

, s
V al
M

,s
(c
0
),...,V al
M

,s
(cn
)
v
0
,...,vn

M

, s
c
0
,...,cn
v
0
,...,vn
(substitution lemma)
M

, s

(def.

)
Since M, s
1
, . . . ,
n

= M

, s

1
, . . . ,

. .

= is satisable (it has an o

-model)
= is o

-consistent (by corollary 2)


2. We found that every nite subset of

is o

-consistent
=

is o

-consistent (by lemma 9)


Hence,

is o

-consistent and contains only nitely many free variables


(namely 0)
=

is satisable, i.e., there is an o

-model M

, such that M

(as follows from corollary 3).


We do not need to refer to a variable assignment, since

only contains
sentences.
87
Now we restrict M

to a model M over o again:


D := D

I I

[
S
and we set s(v
i
) := I

(c
i
) for all variables v
i
As before it follows that: M, s M

, s

for all T
S
Because M

= M, s , i.e., is satisable.
So we can nalise the plan of our proof and conclude the originally intended
version of the completeness theorem:
Theorem 6 (Completeness Theorem)
For all T
S
, for all T
S
, it holds:
If , then .
I.e.: if follows logically (semantically) from , then is derivable from
on the basis of the sequent calculus; thus the sequent calculus is complete.
This implies immediately:
Remark 17
is provable i is logically true.
is consistent i is satisable.
Since logical consequence and satisability are independent of the par-
ticular choice of o, the same must hold for derivability and consistency.
Isnt that a great result?
88
5.3 Consequences and Applications
We will now turn to two important consequences of the completeness theorem
(and of the methods by which we proved it): the theorem of Loewenheim-
Skolem and the compactness theorem.
Theorem 7 (Loewenheim-Skolem)
For all T
S
:
If is satisable, then there are M, s such that M, s and:
the domain D of M is countable.
Proof.
The proof can be extracted from the proof of the completeness theorem:
is satisable
= consistent
=

is consistent, where

is as in the proof of theorem 5 (consistency


was shown there)
=

has a model M

with a countable domain the members of which are


equivalence classes of the terms of T
S
(by corollary 3 and Henkins theorem)
= is satised by M, s where M has a countable domain (as shown in the
proof of theorem 5)
Theorem 8 (Compactness)
For all T
S
, for all T
S
:
1. if and only if there is a with nite and .
2. is satisable if and only if for all with nite: is satisable.
Proof. We already know that the proof-theoretic analogues to these claims
hold (by lemma 7 and lemma 9). But this means we are done by the sound-
ness and the completeness theorem.
The theorem of Loewenheim-Skolem and the compactness theorem are im-
portant tools in model theory and have several surprising implications and
applications.
89
Example:
Consider the rst-order theory of set theory:
Let o
set
=
..
binary predicate

(+ optional: constant
binary predicate
binary functions signs , , , , . . . )
Set of set-theoretic denitions and axioms:
1. Denitions:
(a) Denition of :
y( = y z z y)
(b) Denition of :
xy(x y z(z x z y))
(c) Denition of , :
xyz(x, y = z
w(w z w = x w = y))
(and let us abbreviate y, y by means of y)
(d) Denition of :
xyz(x y = z
w(w z (w x w y)))
(e) Denition of :
xyz(x y = z
w(w z (w x w y)))
2. Axioms:
(a) Axiom of Extensionality:
xy(z(z x z y) x = y)
(Two sets that have the same members are equal)
90
(b) Axiom Schema of Separation:
x
1
. . . x
n
xyz(z y
z x [z, x
1
, . . . , x
n
])
(For every set x and for every property E that is expressed
by a formula with free variables z, x
1
, . . . , x
n
there is a set
z x [z has the property E)
(c) Axiom of Pairs:
xyzw(w z w = x w = y)
(For every two sets x, y there is the pair set x, y)
(d) Axiom of Unions:
xyz(z y w(w x z w))
(For every set x there is a set y, which contains precisely the
members of the members of x)
(e) Powerset Axiom:
xyz(z y z x)
(For every set x there is the power set y of x)
(f) Axiom of Innity:
x( x y(y x y y x))
(There is an innite set, namely the set that contains , ,
, ,. . . as members)
(g) Axiom of Choice:
x( x uv(u x v x u v u v )
yw(w x !z z w y))
(For every set x that has non-empty and pairwise disjoint sets as
its members there is a (choice) set y that contains for each set in
x precisely one member)
Remark: For some purposes the additional so-called Axiom of Replacement
is needed as well.
91
Practically all theorems of standard mathematics can be derived from this
set of denitions and axioms.
At the same time, Loewenheim-Skolem tells that if this set of denitions and
axioms is consistent, then it has a model with a countable domain!!!!
Another example now we consider arithmetic:
Let o
arith
= 0, 1, +, ;
standard model of arithmetic: (N
0
, I) with I as expected
(so I(0) = 0, I(+) = + on N
0
, . . .).
Let
arith
be the set of o
arith
-sentences that are satised by this model, i.e.:

arith
. .
arithmetic
= T
S
arith
[ sentence, (N
0
, I)
Now consider
=
arith
x 0, x 1, x 1 + 1, x (1 + 1) + 1, . . .
It holds that every nite subset of is satisable:
just take the standard model of artithmetic and choose s in the way that
s(x) is a suciently large natural number (for a given nite subset of , s(x)
has to be large enough to be greater than any number denoted by any of the
right-hand sides of the negated equations in the subset).
By the compactness theorem, this implies: is satisable, i.e., there is a
model M

and a variable assignment s

, such that M

, s

.
It follows:
s

(x) ,= V al
M

,s
(0), since x 0
s

(x) ,= V al
M

,s
(1), since x 1
s

(x) ,= V al
M

,s
(1+1), since x 1+1
.
.
.
If we nally identify the objects V al
M

,s
(1+. . . +1) with our standard natural
numbers, we get:
There exists a model of the set of true arithmetical sentences, such that the
domain of this model contains a new number s

(x) that is dierent from


any of the old natural numbers 0, 1, 2, 3, . . .!!!!
92
5.4 Problem Set 6
1. Let o be an arbitrary symbol set.
Let = v
0
t [t T
S
v
1
v
2
v
1
v
2
.
Show:
is consistent
there is no formula set T
S
with , such that is
consistent and contains instances.
2. (This problem counts for award of CREDIT POINTS.)
Explain why the following logical implication holds:
xy(z(z x z y) x = y)
xy(z(z x z y) x = y)
3. Prove: A map with countably many countries can be coloured by using
at most four colours if and only if each of its nite submaps can be
coloured by using at most four colours.
(Hint: choose a symbol set o in which ever constant represents a coun-
try, in which there are four unary predicates that represent four colours,
and in which there is a binary predicate that stands for the neighbour-
hood relation between countries; represent maps as sets of formulas for
this symbol set; apply the compactness theorem.)
4. Let P be a binary predicate in o.
Prove that the formula
xP(x, x) xyz(P(x, y) P(y, z) P(x, z)) xyP(x, y)
can only be satised by innite models.
5. Prove: there is no formula , such that for all models M = (D, I) and
for all variable assignments s holds:
M, s if and only if D is innite.
(Hint: use the compactness theorem.)
93
6 The Incompleteness Theorems for Arith-
metic
6.1 Preliminary Remarks
Here is a review of what we have achieved so far:
we introduced and studied rst-order languages;
then we considered models of such languages and dened semantic con-
cepts in terms of these models;
we developed the sequent calculus for rst-order languages and dened
proof-theoretic notions on the basis of it;
nally, we proved the soundness and completeness theorems as well as
consequences of the latter (the theorem of L owenheim-Skolem and the
compactness theorem).
In particular, we know (remember the end of subsection 5.2): for all rst-
order formulas ,
is logically true (i.e., true in all models) i
is provable (by means of the sequent calculus)
Is it possible to prove similar results for sets of formulas other than the set
of logically true formulas?
Here is a famous question that was discussed intensively in the 1920s/1930s:
Is there a calculus c of axioms and rules, such that for all arithmetical rst-
order formulas ,
is true in the standard model of arithmetic i
is derivable in the calculus c
As was proved by Kurt G odel in 1931, the answer to this question is NO!
(The same holds for all calculi of axioms and rules that include a sucient
amount of arithmetic.)
94
In a nutshell, the reasons for this fact are as follows:
1. A calculus later we will say: a recursively axiomatized theory yields
a mechanical procedure later we will say: a register program by
which all formulas that are derivable in the calculus can be generated
later we will say: register-enumerated in a systematic manner.
2. If a set of formulas is (i) register-enumerable and (ii) contains for every
formula of a given rst-order language either or , then there is a
mechanical procedure that decides later we will say: register-decides
for every formula of this language whether it is a member of that set
or not.
3. Every register-decidable set of formulas can be represented by an arith-
metical formula (on the basis of coding formulas by natural numbers
in a mechanical as we will say: register-computable way).
4. Assume that the set of arithmetical formulas that are true in the stan-
dard model of arithmetic is identical to the set of formulas that can be
derived in some arithmetical calculus: It follows from 1. that the set of
true arithmetical formulas would be register-enumerable. Furthermore
it is clear that the set of true arithmetical formulas contains for every
arithmetical formula either or , so by 2. the set would have to be
register-decidable. Hence, 3. implies that the set of true arithmetical
formulas would be represented by an arithmetical formula.
5. But the set of formulas that are true in the standard model of arithmetic
is not represented by any arithmetical formula. For otherwise one could
show that there would be an arithmetical sentence that would say about
itself (via coding) I am not true: But that sentence would be true
in the standard model of arithmetic if and only if it is not true in the
standard model of arithmetic (contradiction!).
In order to prove this thoroughly it is necessary to dene the notions of
register-decidability, register-enumerability, register-computability, and re-
cursive axiomatizability precisely and to study their properties. Historically,
this led to the development of a new branch of mathematical logic: com-
putability theory (or recursion theory).
For the purposes of this course, we will restrict ourselves just to a sketch of
the proof of Godels rst incompleteness theorem (the second one will only
be mentioned). Further details can be found in standard textbooks on proof
theory and computability theory.
95
6.2 Formalising Computer in Terms of Register Ma-
chine
Our ultimate goal is to prove that the set of rst-order arithmetical truths
cannot be generated by means of explicitly stated rules which connect nitely
many premises to a conclusion unlike the set of formulas of a rst-order
language, the set of terms of a rst-order language, and the set of logically
true formulas of a rst-order language which can all be generated by means
of such rules. In order to prove this result, we have to determine what all the
sets that can be enumerated on the basis of these mechanical rules have
in common: roughly, the point will be that a program or a procedure on a
computer would in principle be able given unrestricted memory and time
to enumerate the members of any such set in a step-by-step manner. But
in order to do make that precise, we rst need a mathematical denition of
computer program or computer procedure.
Since the 1930s, various such denitions have been put forward in which the
intutive notion of procedure is explained formally in terms of
Turing machines
Register machines
Recursive functions
the Lambda Calculus
.
.
.
As it was proven later, all of these denitions turn out to be essentially
equivalent to each other: if a problem can be solved by a computer procedure
in the one sense, then it can also be solved by a computer procedure in the
other sense, and vice versa; if a set is enumerable by a procedure in the one
sense, then the set is enumerable by a procedure in the other sense, and vice
versa; etc. We are going to focus on one particularly simple formal notion of
computer program or computer procedure: computer programs in the
sense of so-called register programs that are considered to run sequentially
on corresponding register machines (the latter not being actual computers
but mathematical idealisations thereof).
96
We start by xing an alphabet / = a
0
, . . . , a
r
(r N
0
).
Intuitively, our register machines can be thought of as (i) storing words over
the alphabet / in their memory, as well as (ii) manipulating the stored words
by simple operations as being determined by the program. We will regard
the memory of a register machine as consisting of certain units or slots which
are members of the set R
0
, R
1
, R
2
, . . . of so-called registers: at each step of
a computation of the machine each of the machines registers is assumed to
contain exactly one word (such a word may be of arbitrary nite length; the
content of a register may change in the course of the computation). Since
we also want to allow for empty registers, we presuppose that the set /

of
words over / includes an empty word which we will denote by:
Here is the exact statement of what we understand by a register program
(over /):
Denition 18 A (register) program P is a nite sequence
0
,
2
, . . . ,
k
that
satises the following conditions:
For every i with 0 i k,
i
is an instruction that starts with the label
i and the remainder of which is of either of the following ve forms:
1. LET R
m
= R
m
+ a
n
(for m, n N
0
, n r)
This is the Add-Instruction: Add the symbol a
n
on the right-
hand side of the word in register R
m
.
2. LET R
m
= R
m
a
n
(for m, n N
0
, n r)
This is the Subtract-Instruction: If the word stored in register
R
m
ends with the symbol a
n
, then delete a
n
at that position; oth-
erwise leave the word unchanged.
3. IF R
m
= THEN L ELSE L
0
OR . . . OR L
r
(for m N
0
and L, L
0
, . . . , L
r
N
0
with L, L
0
, . . . , L
r
k)
This is the Jump-Instruction: If the register R
m
contains the
empty word, then go to the instruction labelled L; if the word in
register R
m
ends with the symbol a
0
, then go to the instruction
labelled L
0
; . . .; if the word in register R
m
ends with the symbol
a
r
, then go to the instruction labelled L
r
.
97
4. PRINT
The Print-Instruction: Print (as output) the word stored in reg-
ister R
0
.
5. HALT
The Halt-Instruction: Stop the running of the program.

k
, and only
k
, is a Halt-Instruction.
(Note that within the instructions of a register program, + and do not
stand for the usual arithmetical operations but rather for syntactic operations
on words stored in registers.)
Register programs might seem much simpler than programs in standard com-
puter languages and indeed they are but one can nevertheless prove that
register programs are actually just as powerful as the latter.
A register program P determines a computation on a register machine in
the following way: assume a machine that contains all the registers mentioned
in P and whose program is P. At the beginning, all registers except for R
0
contain the empty word; the content of R
0
is regarded as the input (which
can be any word in /

whatsoever, whether empty or non-empty). Then


the register machine works through P in a stepwise fashion, starting with
the instruction with label 0. After having executed an instruction with label
L, the machine moves on to the instruction with label L + 1, except for the
cases of a Jump-Operation (the result of which is a jump to an instruction
with a particular label) or the Halt-Operation (the result of which is the
end of the computation). Whenever a Print-Instruction is encountered, the
content of R
0
at that point of computation is printed out (an output). The
machine will only stop after executing the Halt-Operation with the maximal
instruction label k.
Here is an example of a register program:
Example 21 Let / = [. So /

consists of: , [, [[, [[[, . . .


Call the following program P
0
:
0. IF R
0
= THEN 6 ELSE 1
1. LET R
0
= R
0
[
2. IF R
0
= THEN 5 ELSE 3
98
3. LET R
0
= R
0
[
4. IF R
0
= THEN 6 ELSE 1
5. LET R
0
= R
0
+[
6. PRINT
7. HALT
P
0
successively deletes strokes from the input word in R
0
until nally the
empty word is obtained. The printed output is determined to be in case
R
0
initially included an even number of stokes (where 0 counts as even), and
the output is [ otherwise, i.e., in case R
0
initially consisted of an odd number
of strokes.
Let us introduce a way of expressing such input-output patterns more suc-
cinctly: We say that a program P is started with a word /

if, when P
is initiated on a register machine, is stored in R
0
(and all other registers
contain the empty word). In such a case we will write:
P : . . .
In order to say something about the behaviour of a program given an input
, we can extend this notation in either of the following ways:
If we want to express that P, started with , eventuelly reaches the
Halt-Instruction (rather than running forever), we say
P : halt
If we want to express that P, started with , eventuelly reaches the
Halt-Instruction, but additionally we want to point out that in the
course of the computation P has given exactly one output , then we
say
P :
If we want to express that P, started with , never reaches the Halt-
Instruction (which is possible in light of the Jump-Instructions), then
we say
P :
99
Using this terminology, we can thus describe the input-output pattern of P
0
in example 21 by means of
P
0
: [[ . . . [
. .
n
if n is even
P
0
: [[ . . . [
. .
n
[ if n is odd
So P
0
decides in nitely steps whether the given input stroke sequence en-
codes an even number or not.
Let us consider another example:
Example 22 Let / = a
0
, . . . , a
r
. Call the following program P
1
:
0. PRINT
1. LET R
0
= R
0
+ a
0
2. IF R
0
= THEN 0 ELSE 0 OR 0 . . . OR 0
3. HALT
In this case we have that
P
1
:
If P
1
is started with /

, P
1
prints out successively the words , a
0
, a
0
a
0
, . . .
In other words: P
1
enumerates the set , a
0
, a
0
a
0
, . . . of words over /.
6.3 Register-Decidability, Register-Enumerability, Re-
gister-Computability
We are now able to study the notions of register-decidability, register-enum-
erability, and register-computability which turn out to be necessary for the
proof of the incompleteness theorem for arithmetic in more detail. Let us
start with register-decidability.
We have already seen a decision procedure at work in example 21. Now I
want to present another example program which solves a decision problem,
but instead of formulating in exact terms what the instructions in the cor-
responding register program are like, I will describe the program just on the
100
informal level while counting on your programming abilities being so rened
that you are able to turn this informal description into a register program
the only important point being that this can be done in principle (this is
also how computer scientists rst approach a software problem):
Example 23 It is not dicult to set up a computer procedure that decides
whether an arbitrary natural number n is prime:
1. Given input n.
2. If n = 0 or n = 1 then n is not prime: Output any string distinct from
Yes (e.g., No or Goedel).
3. Otherwise:
(a) Test numbers 2, . . . , n 1 whether they divide n
(this can be programmed easily).
(b) If none of these numbers divides n, then n is prime: Output Yes.
(c) Otherwise: n is not prime. Output any string distinct from Yes.
If this procedure is started with the natural number 7 as an input, its output
is Yes; if it is started with input 12, its output is distinct from Yes,
which is supposed to indicate that the answer to the question Is 12 prime?
is negative.
One step in translating this informal program or algorithm into a proper
register program would be to show that programs which were said to take
natural numbers as their inputs can just as well be regarded as taking strings
of symbols as their inputs (as we have already seen in example 21) e.g.,
use the decimal representation of n, which is a string of numerals out of
0,. . .,9, as the input that corresponds to n. Accordingly, the outputs of
such procedures (such as Yes) are strings of symbols.
We can also always in principle restrict ourselves to nite alphabets, since
countably innite alphabets can be simulated by nite alphabets: e.g., the
innite alphabet
A
0
, A
1
, A
2
, . . .
can replaced by the innite set
A0, A1, A2, . . .
101
of words over the nite alphabet A,0,. . .,9.
Once the informal program from above is spelled out precisely in terms of a
register program, then what the existence of the resulting example decision
procedure shows is that the set of primes (or rather: the set of decimal strings
for primes) is decidable by means of a register machine.
Put slightly more precisely, we can dene:
Denition 19 Let J a set of strings (words) over /, i.e., J /

. Let P
be a register program:
P register-decides J i
for every input /

, P eventually stops, having previously given


exactly one output /

, such that
= , if J
,= , if / J.
In other words:
P : if W
P : for ,= if / W
J is register-decidable i there is a register program which register-
decides J.
Using this terminology, the set of decimal representations of prime numbers
is register-decidable since the informally stated procedure from above can be
turned into a precisely specied register decision procedure for this set over
the given alphabet / = 0,. . .,9 . ( plays the role of Yes in the
original informal program specication.)
Remark 18 In order to save time and space we will keep on presenting
programs in this informal and somewhat sketchy manner, but it will always
be possible to transform such informally stated programs into proper register
programs.
But there are not only procedures that decide sets of natural numbers/sets
of strings but also procedures which enumerate sets of natural numbers/sets
of strings.
Example: Here is an informal computer procedure that enumerates the set
of prime numbers:
102
1. Start with natural number n = 1.
2. Test whether n is prime (as in the example before):
(a) If the test is positive, then: Output n.
(b) Otherwise: No output.
3. Increase n by 1 and go to line 2.
This type of procedure does not need any input. If it is started, it simply
generates all prime numbers, i.e., its overall output is
2, 3, 5, 7, 11, 13, 17, . . .
without ever terminating.
Accordingly, we dene:
Denition 20 Let J a set of strings (words) over /, i.e., J /

. Let P
be a register program:
P register-enumerates J i
P, started with , eventually yields as outputs exactly the words in J
(in some order, possibly with repetitions).
J is register-enumerable i there is a register program which register-
enumerates J.
Remark 19
If P register-enumerates an innite set, then P : .
Do not mix up the notions of an (i) enumerable set in the sense of
countable set and the notion of a (ii) register-enumerable set, i.e., a
set enumerable by a register program: the former is solely about the
cardinality of a set, whereas the latter expresses that the members of a
set can be generated by a register program in a step-by-step manner. Ob-
viously, every register-enumerable set of words over / is countable, but
one can show that not every countable set of words over / is register-
enumerable.
103
So the set of decimal representations of prime numbers is not only decidable
but also enumerable since the informally stated procedure from above can be
turned into a precisely specied register program for this set over the given
alphabet / = 0,. . .,9.
More interesting examples of enumerable sets are given by the following lit-
tle theorems (in the proofs of which we will only sketch the corresponding
enumerating register programs):
Theorem 9 Let / be a nite alphabet.
Then /

is register-enumerable.
Proof. Assume / = a
0
, . . . , a
n
. The strings over / can be ordered as
follows: for ,

, dene
<

i
the length of is less than the length of

or
the length of is identical to the length of

and
precedes

lexicographically, i.e.:
is of the form a
i
,

is of the form a
j

,
where i < j (and /

or empty, ,

or empty).
It is easy to set up a procedure that enumerates the members of /

according
to this order. This procedure can then be turned into a proper register-
program.
Theorem 10 Let o be a nite symbol set (which determines the correspond-
ing rst-order alphabet /
S
that can be simulated by a nite alphabet / as
explained above).
Then the set of sequents that are derivable in the sequent calculus over the
symbol set o is register-enumerable.
Proof. First of all, order the set T
S
of terms and the set T
S
of formulas
as in the proof of theorem 9.
Now for n = 1, 2, 3, . . . enumerate
104
the rst n terms and the rst n formulas according to this order,
the nitely many sequent calculus derivations of length n (i) which
use only these formulas and terms and (ii) which only consist of se-
quents containing at most n formulas as members (this can be done by
a procedure).
Every derivation in the sequent calculus is reached by this enumeration for
some natural number n. For every enumerated derivation, output the last
sequent of the derivation. This informal procedure can be transformed into
a register-program.
Theorem 11 Let o be a nite symbol set (which determines the correspond-
ing rst-order alphabet /
S
that can again be simulated by a nite alphabet
/ as explained above).
Then T
S
[ [= is register-enumerable.
Proof. By the completeness theorem, it is sucient to show that
T
S
[ is enumerable. An enumeration procedure for T
S
[
can be set up in the following way:
Enumerate the set of sequents that are derivable in the sequent calculus
over the symbol set o as explained in the proof of theorem 10: if such an
enumerated sequent consists only of a single formula, output the formula.
Once, again, this procedure can be turned into a register-program.
Finally, we can dene a notion of register-computability for functions:
Denition 21 Let / and B be alphabets. Let f be a function that maps
every string (word) over / to a string (word) over B, i.e., f : /

. Let
P be a register program (over / B):
P register-computes f i
P computes for every input /

exactly one output B

(and
stops afterwards), such that = f().
In other words: For all /

: P : f()
f is register-computable i there is a register-program P which register-
computes f.
Since we will concentrate on decidability and enumerability in the following,
we do not go into more details about computability.
105
6.4 The Relationship Between Register-Enumerability
and Register-Decidability
Theorem 11 told us that the set of logically true formulas (for a given nite
symbol set) is register-enumerable. Question: Is it also register-decidable?
Certainly, this does not follow from its register-enumerability in any obvi-
ous manner: let be an arbitrary formula (the input); now consider the
enumeration procedure that we sketched in the proof of theorem 11:
If is logically true, then there is computation step at which it is
enumerated.
Therefore, there is a computation step at which we will know that is
logically true the logical truth of will be positively decided.
But if is not logically true, then the procedure will go on forever
without ever enumerating . There will not be a computation step at
which we could negatively decide the logical truth of (at least not by
inspecting the list of formulas enumerated so far).
In fact one can show that the set of logically true formulas for a rst-order
language is register-enumerable but not register-decidable (Church 1936)!
What can be shown, however, is that every register-decidable set is register-
enumerable, which follows from our next theorem:
Theorem 12 Let / be an alphabet. Let J /

:
J is register-decidable if and only if both J and /

J are register-
enumerable.
Proof.
() Assume J is register-decidable:
This implies that J is register-enumerable, because:
By the register-decidability of J, there is a decision register program
P for J. From P we can set up an enumeration procedure P

for J: (i)
let P

register-enumerate the strings of /

according to the order that


we dened in the proof of theorem 9; (ii) for each enumerated word let
P

apply P to decide whether this word is in J: if yes, output the word


(otherwise let the program do nothing).
106
Furthermore, /

J is register-enumerable:
As before there is by assumption a decision register program P for J.
But from P we can easily construct a decision procedure P

for /

J:
simply let P

be like P except that whenever P is dened to yield output


then P

is chosen to have an output dierent from , while whenever


P is dened to output a string distinct from then P

is chosen to
have as its output. Hence, /

J is register-decidable. By the same


reasoning as for J, this implies that /

J is register-enumerable.
() Assume J and /

J are register-enumerable: So there are enumer-


ation register programs P and P

for J and /

J, respectively. We can
combine P and P

in order to determine a decision register program P

for J:
let be an arbitrary input; let P

run P and P

alternately in a step-by-step
manner: rst step of P, rst step of P

, second step of P, second step of P

,. . .
Eventually, since either J or /

J, either P or P

must enumerate
: if P enumerates then let the output of P

be ; if P

enumerates then
let P

output any string distinct from .


Remark 20 Register-decidability and register-enumerability were dened with
an implicit reference to an underlying alphabet /. However, it is easy to see
that register-decidability and register-enumerability are not really sensitive to
the specic choice of this alphabet: consider alphabets /
1
, /
2
, such that /
1

/
2
, and assume J /

1
; then it holds that J is register-decidable/register-
enumerable with respect to /
1
i J is register-decidable/register-enumerable
with respect to /
2
.
107
6.5 First-Order Theories and Axiomatizability
In the following we will presuppose symbol sets o that are nite (actually, it
would suce to focus on symbol sets that are register-decidable over a given
nite alphabet).
Here is what we want to understand by a theory:
Denition 22 T
S
is a theory i
is a set of sentences,
is satisable,
is closed under logical consequence, i.e., for all sentences T
S
:
if [= then .
(Actually, we should speak of an o-theory, but as usual we will often suppress
the reference to a symbol set.)
Models determine theories in the following sense:
Example 24 For every o-model M the set
Th(M) = T
S
[ is a sentence, M [=
is a theory the theory of the model M.
In particular, reconsider rst-order arithmetic:
Let o
arith
= 0, 1, +, ;
standard model of arithmetic: M
arith
= (N
0
, I) with I as expected
(so I(0) = 0, I(+) = + on N
0
, . . .).
Remark: From now on we will omit bars over signs again!
We once called
arith
the set of o
arith
-sentences that are satised by this model,
i.e.:

arith
. .
arithmetic
= T
S
arith
[ sentence, (N
0
, I)
In the terminology from above:
arith
= Th(M
arith
).
A dierent way of determining a theory is by means of a set of formulas:
108
Example 25 Let be a set of sentences over a symbol set o.
We dene:

|=
= T
S
[ is a sentence, [=
Obviously, by the denitions above it holds that:
If T is a theory, then T
|=
= T .
If is a satisable set of o-sentences, then
|=
is a theory.
So theories can also be generated on the basis of satisable sets of sentence
by means of logical consequence.
In particular, consider the following theory T
PA
which is called (rst-order)
Peano arithmetic:
Let T
PA
=
|=
PA
, where
PA
is the following (innite) set of sentences:
1. x x + 1 0
2. xy(x + 1 y + 1 x y)
3. x x + 0 x
4. xy x + (y + 1) (x + y) + 1
5. x x 0 0
6. xy x (y + 1) x y + x
7. Induction:
x
0
. . . x
n1
__

0
y
y
_

y + 1
y
__
y
_
(for all variables x
0
, . . . , x
n1
, y, for all T
S
with free() x
0
, . . . , x
n1
, y)
Since M
arith
is a model for
PA
,
PA
is satisable and thus T
PA
is a theory.
Many theorems in number theory can actually be derived from
PA
, i.e.,
are members of rst-order Peano arithmetic T
PA
. As we will see, it follows
nevertheless from Godels Incompleteness Theorems that
T
PA
Th(M
arith
) =
arith
So why should we be interested in theories such as T
PA
at all? Because they
are axiomatizable:
109
Denition 23
A theory T is axiomatizable i there there is a register-decidable set
of o-sentences such that T =
|=
.
A theory T is nitely axiomatizable i there there is a nite set of
o-sentences such that T =
|=
.
So e.g. the set of logically true o-sentences is nitely axiomatizable (for
= ). T
PA
is axiomatizable (but one can show that it is not nitely
axiomatizable).
Axiomatizable theories are important because they can be generated by a
computer program:
Theorem 13 Every axiomatizable theory is register-enumerable.
Proof. Let T be a theory and let be a register-decidable set of o-sentences
such that T =
|=
. The sentences of T can be register-enumerated as follows:
let a register program generate systematically (as sketched in section 6.3) all
sequents that are derivable in the sequent calculus and let the program check
in each case whether all members of the antecedent of the generated sequent
belong to ; this can be done by means of a register-decision program for
which exists by assumption. If all members of the antecedent belong to , let
the program check whether the consequent of the sequent is a sentence (this
can obviously be decided as well): if yes, let the register program output the
consequent of the sequent.
An axiomatizable theory is not necessarily register-decidable (the set of log-
ically true o-sentences is a counterexample; compare the last section). For
special theories, however, the situation is dierent:
Denition 24 A theory T (of o-sentences) is complete i for every o-
sentence: T or T .
Obviously, every theory of the form Th(M) is complete (for arbitrary models
M). Note that complete theories are still theories and thus cannot contain
both and for any sentence , for otherwise they would not be satisable.
Complete theories have the following nice property with regard to register-
decidability:
110
Theorem 14
1. Every axiomatizable and complete theory is register-decidable.
2. Every enumerable and complete theory is register-decidable.
Proof. By theorem 13 it is sucient to prove 2. So let T be a register-
enumerable complete theory. A decision register program for T can be set
up as follows: some o-string is given as an input. At rst the program de-
cides whether is an o-sentence (the set of o-sentences is of course register-
decidable). If yes, let the program enumerate the members of T (such an
enumeration procedure exists by assumption). Since T is complete, eventu-
ally either or is enumerated: in the rst case let the procedure output
, in the second case any string distinct from .
6.6 Arithmetical Representability and the Incomplete-
ness Theorems
In the following, let be a set of o
arith
-sentences, i.e., sentences of rst-order
arithmetic. On the basis of o
arith
= 0, 1, +, we can build up o
arith
-
terms that can be used as standard names (numerals) for natural numbers:
0, 1, (1+1), (1+1)+1,. . . Let us abbreviate the standard name for the natural
number n by means of n (so n is an o
arith
-term that denotes n according to
the standard interpretation of o
arith
).
In certain cases, a set may be shown to know something about particular
relations or functions of natural numbers in the sense that facts about these
relations or functions are represented in by means of formulas:
Denition 25
A relation R N
r
0
is representable in i there is an o
arith
-formula
(the free variables of which are among v
0
, . . . , v
r1
) such that for all
n
0
, . . . , n
r1
N
0
:
1. if R(n
0
, . . . , n
r1
) then
n
0
,...,n
r1
v
0
,...,v
r1
2. if not R(n
0
, . . . , n
r1
) then
n
0
,...,n
r1
v
0
,...,v
r1
(we also say that in such a case represents R in ).
111
A function F : N
r
0
N
0
is representable in i there is an o
arith
-
formula (the free variables of which are among v
0
, . . . , v
r
) such
that for all n
0
, . . . , n
r
N
0
:
1. if F(n
0
, . . . , n
r1
) = n
r
then
n
0
,...,nr
v
0
,...,vr
2. if F(n
0
, . . . , n
r1
) ,= n
r
then
n
0
,...,nr
v
0
,...,vr
3. !v
r

n
0
,...,n
r1
v
0
,...,v
r1
(we also say that in such a case represents F in ).
In some cases a set may be shown to know something about procedures
and computation in the sense that all register-decidable relations and all
register-computable functions on N
0
are represented in by means of for-
mulas. It is useful to introduce an abbreviation for this type of property of
a set of arithmetical sentences:
Denition 26
Repr i all register-decidable relations R N
r
0
(for r = 1, 2, . . .) and all
register-computable functions F : N
r
0
N
0
are representable in .
Remark: The register-decidability or register-enumerability of a relation R
N
r
0
for r > 1 and the register-computability of a function F : N
r
0
N
0
for r > 1 is dened analogously to our denitions of register-decidability,
register-enumerability, and register-computability for sets of signs or natural
numbers in section 6.3.
What examples of sets of sentences that have this property Repr do we know?
Here are two important ones:
Theorem 15
Repr Th(M
arith
), i.e., the set of true arithmetical rst-order sentences
has the property Repr.
Repr T
PA
, i.e., the set of arithmetical sentences derivable in rst-order
Peano arithmetic has the property Repr.
Proof. Without proof. (Note that the proof is highly non-trivial and needs
a lot of work a big part of G odels proof is devoted to these matters.)
112
For all further considerations we x a register-computable coding of o
arith
-
formulas by natural numbers (a Godel numbering) such that every number
is the G odel number of a (unique) formula. So we can write
g

for the G odel number of (hence g

N
0
)
Via this encoding it is possible to translate statements about formulas into
statements about natural numbers and vice versa. Some statements about
natural numbers even turn out to be equivalent to statements about their
own G odel numbers these sentences speak about their codes and thus, in
some sense, about themselves. Indeed one can show that there are many
such sentences:
Lemma 18 (Fixed Point Lemma)
Assume that Repr : Then for every o
arith
-formula in which precisely the
variable v
0
occurs freely there is an o
arith
-sentence (=

) such that

g

v
0
(hence, up to provable equivalence, expresses about itself : my code has
the property expressed by ; g

is the numeral of the code of ).


Proof.
Let F : N
0
N
0
N
0
be dened as follows: if n is the Godel number of
some arithmetical formula in which precisely the variable v
0
occurs freely,
then let F(n, m) = g

m
v
0
; otherwise, let F(n, m) = 0.
Since we presuppose a register-computable coding function, the function F
itself can easily be seen to be register-computable as well. Furthermore,
for every o
arith
-formula in which precisely the variable v
0
occurs freely it
follows that:
F(g

, m) = g

m
v
0
Since Repr , this function F can be represented in by a formula (the
free variables of which are among v
0
, v
1
, v
2
, where v
0
and v
1
stand for the
two arguments of F and v
2
stands for the corresponding function value of
F).
Now let be given with precisely v
0
free in it. We introduce the following
abbreviation: let
113
= v
2
(
v
0
,v
0
,v
2
v
0
,v
1
,v
2

v
2
v
0
)
= v
2
(
g

,g

,v
2
v
0
,v
1
,v
2

v
2
v
0
)
Since is an arithmetical formula in which precisely v
0
is free and since
=
g

v
0
, it follows that F(g

, g

) = g

and therefore by the representation


of F in terms of :

g

, g

, g

v
0
, v
1
, v
2
Now we can nally show that
g

v
0
:
1. By denition of ,

g

, g

, g

v
0
, v
1
, v
2

g

v
0
Since we already know that the antecedent of this implication formula
is derivable from , it follows that

g

v
0
But by the sequent calculus this implies that
g

v
0
.
2. Because F is represented in by , it must hold that
!v
2

, g

, v
2
v
0
, v
1
, v
2
We aready know that
g

,g

,g

v
0
,v
1
,v
2
, so it follows that
v
2
(
g

, g

, v
2
v
0
, v
1
, v
2
v
2
g

)
which entails (by the equality in the then part) that

g

v
0
v
2
(
g

, g

, v
2
v
0
, v
1
, v
2

v
2
v
0
)
But this is just

g

v
0

So we have implications in both directions and thus we are done.
114
This xed point lemma has grave consequences:
Lemma 19
Assume that Repr and let be a consistent set of arithmetical sentences:
If the set of Godel numbers of sentences in

(=
|=
) is representable in
(briey: if

is representable in ), then there is an o


arith
-sentence such
that neither nor .
(For the denition of
|=
see the last section; note that by soundness and
completeness we can write

instead of
|=
.)
Proof. Suppose (in which precisely v
0
is free) represents the set

in .
Then it follows that for arbitrary arithmetical sentences :
1. if g

is a member of the set of codes of sentences in

, then
g

v
0
2. if g

is not a member of the set of codes of sentences in

, then

g

v
0
.
By the consistency of this entails

g

v
0
i
Now let = : by lemma 18 there is a xed point sentence for such
that

g

v
0
(so expresses: my code is not a member of the codes of sentences in

,
i.e., I am not derivable from ).
But now we can conclude:
If , then
g

v
0
and hence by the xed point property (and
applying negation) , contradicting the consistency of .
If , then by the xed point property (and applying negation)

g

v
0
and thus , again contradicting the consistency of .
So neither nor .
But now we can nally put things together in order to derive:
115
Theorem 16 (Godels First Incompleteness Theorem)
1. Let be a consistent and register-decidable set of arithmetical sentences
for which it is the case that Repr : then there is an o
arith
-sentence
such that neither nor .
2. Th(M
arith
) is not axiomatizable.
Proof.
1. Let be described above and assume that for every o
arith
-sentence
either or . So by section 6.5,

(=
|=
) is a complete ax-
iomatizable theory which, by theorem 14, is register-decidable. Hence,
by Repr , the set (of codes of members of)

is representable in ,
which contradicts lemma 19.
2. If Th(M
arith
) were axiomatizable, then it would be a complete ax-
iomatizable theory, which, by the same argument as before, would be
register-decidable. Moreover, Th(M
arith
) has the property Repr. But
as we have just seen this would contradict lemma 19.
Remark: Actually, this is a version of G odels First Incompleteness Theorem
G odels original First Incompleteness Theorem is slightly stronger and uses
more ne-grained assumptions.
G odels Second Incompleteness Theorem extends this result by showing that
consistent axiomatizable theories that contain enough arithmetic (e.g.,
rst-order Peano arithmetic) cannot prove their own consistency, where the
corresponding consistency statement can be expressed as an arithmetical
sentence that speaks about the codes of arithmetical sentences.
Thats it. . . hope you liked it!! (Stay logical!)
116
7 Solutions to the Problem Sets
7.1 Solutions to Problem Set 1
1. (a) Show (this is a recapitulation of something you should know about
countable sets):
If the sets M
0
, M
1
, M
2
, . . . are countable,
then

nN
M
n
is countable as well.
Proof.
Without restriction of generality, we may assume that M
n
,=
for all n N = 0, 1, 2, . . . (otherwise simply omit all empty sets
M
n
from our countable sequence of sets and reenumerate them).
Furthermore, we may assume that each set M
n
is of the form
a
n
0
, a
n
1
, a
n
2
, . . ..
Now we can think of the sets M
n
as being listed as rows of an
array of the following kind:
M
0
: a
0
0
a
0
1
a
0
2
. . .
M
1
: a
1
0
a
1
1
a
1
2
. . .
M
2
: a
2
0
a
2
1
a
2
2
. . .
.
.
.
.
.
.
.
.
.
.
.
.
The entries of this array can be enumerated in the following diag-
onal manner: (1.)a
0
0
, (2.)a
0
1
, (3.)a
1
0
, (4.)a
2
0
, (5.)a
1
1
, (6.)a
0
2
, (7.)a
0
3
, . . .
Since every member of

nN
M
n
occurs in this array, this proves
that there is an onto mapping from N to

nN
M
n
. Therefore,

nN
M
n
is countable (compare p. 8 in the lecture notes).
(b) Prove the following lemma by means of 1a:
If / is a countable alphabet, then the set /

(of nite strings over


/) is countable, too.
Proof.
/ is of the form a
0
, a
1
, a
2
, . . .. Since /

is the set of strings over


/ with nite length n = 1, 2, 3, . . ., we can regard /

as the union

n
/
n
= /
1
/
2
/
3
. . .
Each of the sets /
n
is countable, because: / is countable by
assumption. If /
n
is countable, then of course also a
k
/
n
is
countable for arbitrary k = 0, 1, 2, . . ., and since /
n+1
=

kN
(a
k

117
/
n
) it follows from 1a that also /
n+1
is countable. Hence, by
induction over n, each set /
n
is countable.
Thus, by 1a again, since every /
n
is countable, their union

nN
/
n
is countable and we are done.
2. Let o be an arbitrary symbol set. We consider the following calculus
c of rules:

x x
(for arbitrary variables x)

x t
i
x f(t
1
, . . . , t
n
)
(for arbitrary variables x, for arbitrary o-terms t
1
, . . . , t
n
, for arbitrary
n-ary function signs f o, for arbitrary i 1, . . . , n).
Show that for all variables x and all o-terms t holds: The string
x t
is derivable in c if and only if x var(t) (i.e., x is a variable in t).
Proof. () Let x be an arbitrary variable. We show that if the string
x t is derivable on the basis of the rules of c, then x is a variable in
t. This is proven by induction over the strings x t that can be derived
in c (the property P that we prove such strings x t to have is in this
case: the variable x occurs somewhere in t, i.e., the string before the
blank occurs somewhere in the string after the blank):
Induction basis:
All strings x t with
x t
have the property P. This is because the
only such strings are of the form x x and x occurs in x.
Induction step:
Assume the string x t
i
has the property P, i.e., x occurs in the o-term
t
i
. But then x certainly also occurs in the o-term f(t
1
, . . . , t
n
), since t
i
is a substring of f(t
1
, . . . , t
n
) and x is a substring of t
i
by the inductive
assumption. So f(t
1
, . . . , t
n
) has the propery P as well.
118
() We x an arbitrary variable x and prove by induction over o-terms
t that if x occurs in t then the string x t is derivable by means of the
rules of c (so the property P that we prove terms t to have is in this
case: if x occurs in t, then the string x t is derivable in the calculus c
of rules):
Induction basis:
Variables have the property P: if x occurs in t, (i) then in the case
where t = x, it is indeed the case that the string x x is derivable in c,
(ii) while the other case, i.e., where t is a variable dierent from x, is
excluded, since x does not occur in any variable dierent from x.
Constants satisfy the property P vacuously (x does not occur in any
constant t).
Induction step:
Assume o-terms t
1
, . . . , t
n
have the property P.
So if x occurs in t
1
then the string x t
1
is derivable in the calculus
c, and the same holds for t
2
, . . . , t
n
. Now consider any string of the
form f(t
1
, . . . , t
n
) where f is an arbitrary n-ary function sign in o:
if x occurs in f(t
1
, . . . , t
n
), then it must occur in one of the terms
t
1
, . . . , t
n
, say in t
i
: by the inductive assumption, it follows that the
string x t
i
is derivable in c. But then the second rule of c can be used
to derive the string x f(t
1
, . . . , t
n
). So we have shown that if x occurs
in f(t
1
, . . . , t
n
), then x f(t
1
, . . . , t
n
) is derivable in c. This means that
f(t
1
, . . . , t
n
) has the property P.
3. Prove that the following strings are o-terms (for given o with c, f, g
o, where f is a binary function sign, g is a unary function sign, x and
y are variables):
(a) f(x, c):
x (T1) (6)
c (T2) (7)
f(x, c) (T3, with 1., 2.) (8)
(b) g(f(x, c)):
f(x, c) (see 3a) (1)
g(f(x, c)) (T3, with 1.) (2)
119
(c) f(f(x, c), f(x, f(x, y))):
f(x, c) (see 3a) (1)
x (T1) (2)
y (T1) (3)
f(x, y) (T3, with 2., 3.) (4)
f(x, f(x, y)) (T3, with 2.,4.) (5)
f(f(x, c), f(x, f(x, y))) (T3, with 1.,5.) (6)
4. Prove that the following strings are o-formulas (with x, y, c, f, g as
in 3 and where P, Q o, such that P is a unary predicate and Q is a
binary predicate):
(a) P(f(x, c)):
P(f(x, c)) (F2; use 3a) (1)
P(f(x, c)) (F3, with 1.) (2)
(b) xy(P(g(f(x, c))) Q(y, y)):
P(g(f(x, c))) (F2; use 3b) (1)
Q(y, y) (F2) (2)
(P(g(f(x, c))) Q(y, y)) (F4, with 1., 2.) (3)
y(P(g(f(x, c))) Q(y, y)) (F5, with 3.) (4)
xy(P(g(f(x, c))) Q(y, y)) (F5, with 4.) (5)
(c) (xP(f(x, c)) Q(f(x, c), f(f(x, c), f(x, f(x, y))))):
P(f(x, c)) (use 4a) (1)
xP(f(x, c)) (F5, with 1.) (2)
Q(f(x, c), f(f(x, c), f(x, f(x, y)))) (F2; use 3a, 3c) (3)
(xP(f(x, c)) Q(f(x, c), f(f(x, c), f(x, f(x, y))))) (F4, with 2., 3.)
(4)
5. Prove by induction: the string xf(x, c) is not an o-term (where o is
an arbitrary symbol set).
120
Proof. We prove this (as I told you rather trivial) statement by in-
duction over o-terms t (the property P which we show terms have is
in this case: t is dierent from the string xf(x, c)):
Induction basis:
Every variable and every o-constant is certainly dierent fromxf(x, c).
Induction step:
Assume o-terms t
1
, . . . , t
n
are dierent from xf(x, c).
It is certainly the case that f(t
1
, . . . , t
n
) is dierent from xf(x, c),
since the former begins with a function sign while the latter begins
with a quantier.
(The triviality of the result shows up in the way that we did not even
have to use the inductive assumption in order to prove that f(t
1
, . . . , t
n
)
diers from xf(x, c).)
6. Let x, y, z be variables, f o a unary function sign, P, Q, R o
with P being a binary predicate, Q a unary predicate, and R a ternary
predicate. Determine for the following o-formulas the corresponding
set of variables that occur freely in (i.e., the sets free()):
(We state 6a in detail but for 6b and 6c only the nal solutions.)
(a) xy(P(x, z) Q(y)) Q(y):
free(xy(P(x, z) Q(y)) Q(y)) =
free(xy(P(x, z) Q(y))) free(Q(y)) =
[free(y(P(x, z) Q(y))) x] free(Q(y)) =
[[free((P(x, z) Q(y))) y] x] y =
[free((P(x, z) Q(y))) x, y] y =
[[free(P(x, z)) free(Q(y))] x, y] y =
[[x, z free(Q(y))] x, y] y =
[[x, z y] x, y] y =
[x, y, z x, y] y =
z y =
y, z (so this formula is not a sentence)
(b) xy(Q(c) Q(f(x))) yx(Q(y) R(x, x, y)):
free(xy(Q(c) Q(f(x))) yx(Q(y) R(x, x, y))) =
(so this formula is a sentence)
(c) Q(z) z(P(x, y) R(c, x, y)):
free(Q(z) z(P(x, y) R(c, x, y))) = x, y, z
(so this formula is not a sentence)
121
7.2 Solutions to Problem Set 2
1. Let o = P, R, f, g, c
0
, c
1
, where P is a unary predicate, R is a binary
predicate, and f and g are binary function signs. Let M = (D, I) be
an o-model with D = R, such that I(P) = N, I(R) is the larger
than (>) relation on R, I(f) is the addition mapping on R, I(g) is
the multiplication mapping on R, I(c
0
) = 0, and I(c
1
) = 1. Finally,
let s be a variable assignment over M with the property that s(x) = 5
and s(y) = 3 (where x, y, and z from below, are xed pairwise distinct
variables).
Determine the following semantic values by step-by-step application of
the denition clauses for V al
M,s
; subsequently, translate the terms/for-
mulas into our usual mathematical everyday language:
(a) V al
M,s
(g(x, f(y, c
1
))):
V al
M,s
(g(x, f(y, c
1
))) = 5 (3 + 1) = 20
(b) V al
M,s
(f(g(x, y), g(x, c
1
))):
V al
M,s
(f(g(x, y), g(x, c
1
))) = 5 3 + 5 1 = 20
(c) V al
M,s
(xy(R(x, c
0
) z(P(z) R(g(z, x), y)))):
Here we take a more detailed look:
V al
M,s
(xy(R(x, c
0
) z(P(z) R(g(z, x), y)))) = 1 i
for all d D:
V al
M,s
d
x
(y(R(x, c
0
) z(P(z) R(g(z, x), y)))) = 1 i
for all d D, for all d

D:
V al
M,s
d
x
d

y
(R(x, c
0
) z(P(z) R(g(z, x), y))) = 1 i
for all d D, for all d

D:
V al
M,s
d
x
d

y
(R(x, c
0
)) = 0 or
V al
M,s
d
x
d

y
(z(P(z) R(g(z, x), y))) = 1 i
122
for all d D, for all d

D:
it is not the case that (s
d
x
d

y
(x), I(c
0
)) I(R) or
there is a d

D, s.t. V al
M,s
d
x
d

y
d

z
(P(z) R(g(z, x), y)) = 1 i
for all d D, for all d

D:
it is not the case that d > 0 or
there is a d

D, s.t.
V al
M,s
d
x
d

y
d

z
(P(z)) = 1 and V al
M,s
d
x
d

y
d

z
(R(g(z, x), y)) = 1
i
for all d D, for all d

D:
d 0 or
there is a d

D, s.t.
s
d
x
d

y
d

z
(z) I(P) and
(V al
M,s
d
x
d

y
d

z
(g(z, x)), s
d
x
d

y
d

z
(y)) I(R)
i
for all d D, for all d

D:
d 0 or
there is a d

D, s.t. d

N and d

d > d

(For all x R with x > 0 and all y R there is an n N, such


that nx > y)
For which variable assignments s over M is it the case that
P(z) R(z, c
1
) x(P(x) y(P(y) g(x, y) z) x c
1
x z)
is true at M and s:
For those variable assignments s for which s(z) is a prime number!
2. Let o = P, f, where P is a unary predicate and f is a binary function
sign.
For each of the following formulas in T
S
nd an o-model and a corre-
sponding variable assignment relative to which the formula is true and
nd an o-model and a corresponding variable assignment relative to
which the formula is false:
123
(a) v
1
f(v
2
, v
1
) v
2
:
For D = N, I(f) = , s(v
2
) = 0: true
For D = N, I(f) = +, s(v
2
) = 0: false
(b) v
2
v
1
f(v
2
, v
1
) v
2
: analogous to 2a
(c) v
2
(P(v
2
) v
1
P(f(v
2
, v
1
))):
For D = N, I(f) = , I(P) = set of even natural numbers: true
For D = N, I(f) = , I(P) = set of odd natural numbers: false
3. Let D be nite and non-empty, let o be nite. Show that there are
only nitely many o-models with domain D.
Proof. Let k be the cardinality of D. For every constant c in o there
are k possible ways of choosing I(c). For every n-ary predicate P in
o there are 2
(k
n
)
possible ways of choosing I(P). Finally, for every
n-ary function sign f in o there are k
(k
n
)
possible ways of choosing
I(f). Since there are only nitely many symbols in o, the numbers
of possible interpretations mappings I on o (and thus the number of
o-models M) is a nite product of nite numbers of the form k or 2
(k
n
)
or k
(k
n
)
; but such a product is of course nite.
4. A formula in which , , do not occur is called positive.
Prove: For every positive formula there is a model and a variable assign-
ment which taken together satisfy the formula (independent of what o
is like).
Hint: You might consider trivial models the domains of which only
have one member.
Proof. Let D = 1.
Let I(P) = D
n
= (1, 1, . . . , 1
. .
n
) (for n-ary predicates P).
Let I(f) : D
n
D s.t. (1, 1, . . . , 1
. .
n
) 1 (for n-ary function signs f).
Let M = (D, I).
124
By the denition of positive formula, all and only positive formulas can
be derived in the following positive-formula calculus of rules:
(P1)
(t
1
,t
2
)
(for o-terms t
1
, t
2
)
(P2)
P(t
1
,...,t
n
)
(for o-terms t
1
, . . . , t
n
, for n-ary P o)
(P3)
,
( )
. .
disjunction
,
( )
. .
conjunction
(P4)

x
. .
universally quantied

x
. .
existentially quantied
(for arbitrary variables x)
By induction over positive formulas we can show that for every positive
formula it holds that:
For every variable assignment s over M, V al
M,s
() = 1.
(Note that there is actually just one variable assignment s over M!)
P1&P2: V al
M,s
(P(t
1
, . . . , t
n
)) = 1 because
(V al
M,s
(t
1
), . . . , V al
M,s
(t
n
))
. .
(1,1,...,1)
I(P)
. .
D
n

(analogously for )
P3: Assume that V al
M,s
() = V al
M,s
() = 1:
but then it follows that V al
M,s
() = 1 and V al
M,s
() = 1
(for arbitrary s).
P4: Assume that V al
M,s
() = 1:
V al
M,s
(x) = 1 i
for all d D V al
M,s
d
x
() = 1 i (since s
d
x
= s)
for all d D V al
M,s
() = 1 i
V al
M,s
() = 1, which is the case by inductive assumption.
So we are done (analogously for ).
125
5. Prove the coincidence lemma by induction over terms and formulas:
Let o
1
, o
2
be two symbol sets. Let M
1
= (D, I
1
) be an o
1
-model, let
M
2
= (D, I
2
) be an o
2
-model.
Let s
1
be a variable assignment over M
1
, s
2
a variable assignment over
M
2
.
Finally, let o = o
1
o
2
:
(a) For all terms t T
S
:
If I
1
(c) = I
2
(c) for all c in t
I
1
(f) = I
2
(f) for all f in t
s
1
(x) = s
2
(x) for all x in t
then: V al
M
1
,s
1
(t) = V al
M
2
,s
2
(t)
(b) For all formulas T
S
:
If I
1
(c) = I
2
(c) for all c in
I
1
(f) = I
2
(f) for all f in
I
1
(P) = I
2
(P) for all P in
s
1
(x) = s
2
(x) for all x free()
then: V al
M
1
,s
1
() = V al
M
2
,s
2
()
Proof. By induction over terms and formulas.
First we show that all o-terms t have the following property P:
For all M
1
= (D, I
1
), M
2
= (D, I
2
), s
1
, s
2
:
If I
1
(c) = I
2
(c) for all c in t
I
1
(f) = I
2
(f) for all f in t
s
1
(x) = s
2
(x) for all x in t
then: V al
M
1
,s
1
(t) = V al
M
2
,s
2
(t)
This can be proven as follows:
t = c: If I
1
(c) = I
2
(c) for all c in t, I
1
(f) = I
2
(f) for all f in t,
s
1
(x) = s
2
(x) for all x in t, then
V al
M
1
,s
1
(c) = I
1
(c) = I
2
(c) = V al
M
2
,s
2
(c).
t = x: If I
1
(c) = I
2
(c) for all c in t, I
1
(f) = I
2
(f) for all f in t,
s
1
(x) = s
2
(x) for all x in t, then
V al
M
1
,s
1
(x) = s
1
(x) = s
2
(x) = V al
M
2
,s
2
(x).
126
t = f(t
1
, . . . , t
n
): Assume that t
1
, . . . , t
n
have property P:
If I
1
(c) = I
2
(c) for all c in t, I
1
(f) = I
2
(f) for all f in t,
s
1
(x) = s
2
(x) for all x in t, then
V al
M
1
,s
1
(f(t
1
, . . . , t
n
)) =
I
1
(f)(V al
M
1
,s
1
(t
1
), . . . , V al
M
1
,s
1
(t
n
)) =
(by the if-part and by the inductive assumption)
I
2
(f)(V al
M
2
,s
2
(t
1
), . . . , V al
M
2
,s
2
(t
n
)) =
V al
M
2
,s
2
(f(t
1
, . . . , t
n
)).
Next we show that all o-formulas have the following property P:
For all M
1
= (D, I
1
), M
2
= (D, I
1
), s
1
, s
2
:
If I
1
(c) = I
2
(c) for all c in
I
1
(f) = I
2
(f) for all f in
I
1
(P) = I
2
(P) for all P in
s
1
(x) = s
2
(x) for all x free()
then: V al
M
1
,s
1
() = V al
M
2
,s
2
()
This can be proven as follows (we show it for representative cases):
= P(t
1
, . . . , t
n
): If I
1
(c) = I
2
(c) for all c in , I
1
(f) = I
2
(f) for all f in , I
1
(P) =
I
2
(P) for all P in , s
1
(x) = s
2
(x) for all x free() then
V al
M
1
,s
1
(P(t
1
, . . . , t
n
)) = 1 i
(V al
M
1
,s
1
(t
1
), . . . , V al
M
1
,s
1
(t
n
)) I
1
(P) i
(by the if-part and by what we have shown before for terms t;
note that free() = var() for atomic )
(V al
M
2
,s
2
(t
1
), . . . , V al
M
2
,s
2
(t
n
)) I
2
(P) i
V al
M
2
,s
2
(P(t
1
, . . . , t
n
)) = 1.
= : Assume that has the property P:
If I
1
(c) = I
2
(c) for all c in , I
1
(f) = I
2
(f) for all f in , I
1
(P) =
I
2
(P) for all P in , s
1
(x) = s
2
(x) for all x free() then
V al
M
1
,s
1
() = 1 i
V al
M
1
,s
1
() = 0 i
(by the inductive assumption)
V al
M
2
,s
2
() = 0 i
V al
M
2
,s
2
() = 1.
127
= x: Assume that has the property P:
If I
1
(c) = I
2
(c) for all c in , I
1
(f) = I
2
(f) for all f in , I
1
(P) =
I
2
(P) for all P in , s
1
(x) = s
2
(x) for all x free() then
V al
M
1
,s
1
(x) = 1 i
there is a d D, such that V al
M
1
,s
1
d
x
() = 1 i
(by the inductive assumption)
there is a d D, such that V al
M
2
,s
2
d
x
() = 1 i
V al
M
2
,s
2
(x) = 1.
128
7.3 Solutions to Problem Set 3
1. The convergence of a real-valued sequence (x
n
) to a limit x is usually
dened as follows:
(Conv) For all > 0 there is a natural number n, such that for all
natural numbers m > n it holds that: [x
m
x[ <
Represent (Conv) in a rst-order language by choosing an appropriate
symbol set o and dene the corresponding o-model.
Hint: (i) Real sequences are functions from N to R, i.e., you may con-
sider x
m
as being of the form f(m); f can be regarded as being dened
on R even though only its values for members of N are relevant.
(ii) [x
m
x[ may either be considered as the result of applying a bi-
nary distance function to the arguments x
m
and x or as the result
of applying two functions subtraction and absolute value to these
arguments.
Answer: We choose o = 0, d, >, N, f.
Let D = R, I(0) = 0, I(d) : R R R with I(d)(a, b) = [a b[,
I(>) is the >-relation on R, I(N) = N, I(f) is a function from R to
R; note that with regard to arguments n N, the function I(f) is a
real-valued sequence on N that maps n to I(f)(n).
So we can represent (Conv) from above as:
v
0
(v
0
> 0 v
1
(N(v
1
) v
2
(N(v
2
) v
2
> v
1
v
0
> d(f(v
2
), x))))
(where x is a variable distinct from v
0
, v
1
, v
2
).
2. (This problem counts for award of CREDIT POINTS.)
Show that for arbitrary o-formulas , , , and arbitrary sets of
o-formulas the following is the case:
(a) ( ) i and :
() Assume that ( ) .
So for all M, s: if M, s [= then M, s [= .
Now suppose M, s [= : then M, s [= and thus by assump-
tion M, s [= . It follows that .
(Analogously for ).
129
() Assume that and , i.e., for all M, s: if M, s [=
then M, s [= , and for all M, s: if M, s [= then M, s [= .
Now suppose M, s [= : then either (i) M, s [= or (ii)
M, s [= ; in either case, by assumption, M, s [= .
It follows that .
(b) i ( ):
() Assume that . So for all M, s: if M, s [=
then M, s [= .
Now suppose M, s [= ; then there are two possible cases:
Case 1: M, s ,[= . But then M, s [= .
Case 2: M, s [= . But then M, s [= , which implies by
assumption that M, s [= and thus M, s [= .
In either case, M, s [= .
So it follows that .
() Assume that . Hence, for all M, s: if M, s [=
then M, s [= .
Now suppose M, s [= ; then M, s [= , so by assumption
M, s [= . Since both M, s [= and M, s [= , it
follows that M, s [= .
But that means .
(c) (i.e., ) i ( ) is logically true:
By 2b, i , i.e.,
i .
But by the lemma in our section on semantic concepts, the latter
is equivalent to saying that is logically true.
3. (a) Prove for arbitrary o-formulas , :
xy yx
Proof. Strictly, we have to deal with two cases: (i) the variables
x and y being distinct, or (ii) x = y.
Case 1: Let x ,= y and M, s [= xy:
By the denition of V al it follows that
there is a d
1
D, such that M, s
d
1
x
[= y, which in turn implies
that there is a d
1
D, such that for all d
2
D: M, (s
d
1
x
)
d
2
y
[= .
Not let d
4
D be chosen arbitrarily. Furthermore, let d
3
be such
that for all d
2
D: M, (s
d
3
x
)
d
2
y
[= (such a d
3
must exist by what
we said before).
130
But then it must also be the case that M, (s
d
3
x
)
d
4
y
[= .
So we found that for all d
4
D there is a d
3
D with:
M, (s
d
3
x
)
d
4
y
[= .
Since x ,= y, we can also write this as follows:
for all d
4
D there is a d
3
D with M, (s
d
4
y
)
d
3
x
[= .
By the denition of V al again, we have:
for all d
4
D, M, s
d
4
y
[= x, and thus M, s [= yx.
Case 2: Let x = y and M, s [= xy:
As above it follows that there is a d
1
D, such that for all d
2
D:
M, (s
d
1
x
)
d
2
y
[= .
Because of x = y, (s
d
1
x
)
d
2
y
= s
d
2
x
.
So we actually have that for all d
2
D: M, s
d
2
y
[= .
Therefore, since D ,= , there is a d
2
D such that M, s
d
2
y
[= ,
which implies trivially that
for all d
1
D there is a d
2
D such that M, (s
d
1
x
)
d
2
y
[= , i.e.,
M, s [= yx.
Summing up both cases, we nd that xy yx.
(b) Show that the following is not the case for all o-formulas , :
yx xy
Proof. Consider = P(x, y), D = N, I(P) = >-relation on N,
M = (D, I):
then M [= yxP(x, y), but M ,[= xyP(x, y).
4. (a) Prove for all o-formulas , :
x( ) is logically equivalent to x x.
(Proof: Immediate from the denition of V al.)
(b) Show that the following is not the case for all o-formulas , :
x( ) is logically equivalent to x x.
Proof. Consider = P(x), = Q(x), D = N, let I(P) be the set
of even natural numbers, I(Q) be the set of odd natural numbers,
M = (D, I):
then M [= xP(x) xQ(x), but M ,[= x(P(x) Q(x)).
5. Let be an o-formula set, let und be o-formulas. Show:
If and , then .
131
Proof. Assume that and :
let M, s [= ; then by the second assumption M, s [= , hence M, s [=
, which implies by the rst assumption that M, s [= .
It follows that .
6. A set of o-sentences is called independent if and only if there is no
such that: (i.e., is not redundant, because it is
impossible to conclude from ).
Prove: (a) the set of the three group axioms and (b) the set of the three
axioms for equivalence structures are both independent (see chapter one
for these axioms).
Proof. Concerning (a):
G1 xyz (x y) z = x (y z)
G2 x x e = x
G3 xy x y = e
(i) G1, G2 ,[= G3: consider D = Z, I() = multiplication in Z, I(e) = 1;
then M = (D, I) [= G1, G2, but M = (D, I) ,[= G3.
(ii) G1, G3 ,[= G2: consider D = Q 0, I() = multiplication in Q,
I(e) = 5; then M = (D, I) [= G1, G3, but M = (D, I) ,[= G2.
(iii) G2, G3 ,[= G1: consider D = d
0
, d
1
, d
2
for pairwise distinct d
0
, d
1
, d
2
,
I(e) = d
0
, such that I() is given by the following multiplication table:
I() d
0
d
1
d
2
d
0
d
0
d
1
d
2
d
1
d
1
d
0
d
1
d
2
d
2
d
2
d
0
then M = (D, I) [= G2, G3, but M = (D, I) ,[= G1 (to see the latter,
consider a multiplication of d
2
, d
1
, and d
2
).
132
Concerning (b):
A1 x x x
A2 xy (x y y x)
A3 xyz (x y y z x z)
(i) A1, A2 ,[= A3: consider D = d
0
, d
1
, d
2
for pairwise distinct d
0
, d
1
, d
2
,
I() = (d
0
, d
0
), (d
1
, d
1
), (d
2
, d
2
), (d
0
, d
1
), (d
1
, d
0
), (d
1
, d
2
), (d
2
, d
1
);
then M = (D, I) [= A1, A2, but M = (D, I) ,[= A3.
(ii) A1, A3 ,[= A2: consider D = d
0
, d
1
for distinct d
0
, d
1
, with
I() = (d
0
, d
0
), (d
1
, d
1
), (d
0
, d
1
);
then M = (D, I) [= A1, A3, but M = (D, I) ,[= A2.
(iii) A2, A3 ,[= A1: consider D = d
0
, I() = ;
then M = (D, I) [= A2, A3, but M = (D, I) ,[= A1.
133
7.4 Solutions to Problem Set 4
1. (a) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
2
v
2
v
0
v
1
v
3
= v
0
[v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
0
v
3
v
0
= v
0
v
1
[(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
1
v
3
v
1
= v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
2
))
(b) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
3
f(v
2
, v
3
)
v
2
v
3
= v
0
[v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
3
f(v
2
, v
3
) v
0
v
2
v
3
v
0
= v
0
v
1
[(P(v
0
, v
2
) P(v
1
, v
3
))]
v
3
f(v
2
, v
3
) v
1
v
2
v
3
v
1
= v
0
v
1
(P(v
0
, v
3
) P(v
1
, f(v
2
, v
3
)))
(c) [v
0
v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
2
v
0
f(v
2
, v
3
)
v
0
v
2
v
3
= v
4
[v
1
(P(v
0
, v
2
) P(v
1
, v
3
))]
v
0
f(v
2
, v
3
) v
4
v
2
v
3
v
0
= v
4
v
1
[(P(v
0
, v
2
) P(v
1
, v
3
))]
v
0
f(v
2
, v
3
) v
4
v
1
v
2
v
3
v
0
v
1
= v
4
v
1
(P(v
4
, v
0
) P(v
1
, f(v
2
, v
3
)))
(d) [v
0
v
1
(P(v
0
, v
1
) P(v
0
, v
2
)) v
2
f(v
2
, v
2
) v
0
]
v
0
f(v
0
, v
1
)
v
0
v
2
:
At rst we consider the left part of the given -formula:
[v
0
v
1
(P(v
0
, v
1
) P(v
0
, v
2
))]
v
0
f(v
0
, v
1
)
v
0
v
2
= v
3
[v
1
(P(v
0
, v
1
) P(v
0
, v
2
))]
f(v
0
, v
1
) v
3
v
2
v
0
= v
3
v
4
[(P(v
0
, v
1
) P(v
0
, v
2
))]
f(v
0
, v
1
) v
3
v
4
v
2
v
0
v
1
= v
3
v
4
(P(v
3
, v
4
) P(v
3
, f(v
0
, v
1
)))
Secondly, we consider the right part of the given -formula:
134
[v
2
f(v
2
, v
2
) v
0
]
v
0
f(v
0
, v
1
)
v
0
v
2
= v
2
[f(v
2
, v
2
) v
0
]
v
2
v
2
= v
2
f(v
2
, v
2
) v
0
By connecting the two partial solutions by means of we get the
nal result, i.e.:
v
3
v
4
(P(v
3
, v
4
) P(v
3
, f(v
0
, v
1
))) v
2
f(v
2
, v
2
) v
0
2. Let t
0
, . . . , t
n
be o-terms, x
0
, . . . , x
n
pairwise distinct variables, an
o-formula and y a variable.
Prove:
(a) If is a permutation of the numbers 0, . . . , n, then:

t
0
, . . . , t
n
x
0
, . . . , x
n
=
t
(0)
, . . . , t
(n)
x
(0)
, . . . , x
(n)
Proof. Strictly, this is shown rst by induction over terms t and
then by induction over formulas (the latter yields the proof of
the claim above). But this time instead of writing down all
the details of the two inductive proofs we will just informally
check whether the order of terms/variables can have any eect
on the outcome of a substitution. [If you have done so using just
two or three lines of comment, thats ne.]
In the basic cases of substitution within terms, there is no such
eect, i.e.:
[x]
t
0
,...,tn
x
0
,...,xn
:=
_
t
i
for x = x
i
(0 i n)
x else
= [x]
t
(0)
,...,t
(n)
x
(0)
,...,x
(n)
[c]
t
0
,...,tn
x
0
,...,xn
:= c = [c]
t
(0)
,...,t
(n)
x
(0)
,...,x
(n)
Therefore, the order in which terms are substituted for variables
cannot aect the outcome of a substitution within a function term
(using the inductive assumption for its subterms) and thus it does
not have any eect within any term whatsoever. Because the
substitution of terms for variables within atomic formulas is by
denition given by the substitution of terms for variables within
135
terms, the order also does not play a role for substitutions within
atomic formulas. Moreover, since the substitution of terms for
variables within negation, disjunction, conjunction, implication,
and equivalence formulas is by denition reduced to the substi-
tution of terms for variables within their subformulas, the order
of variables does not play a role for substitution within them as
long as it does not play a role for the subformulas (this is where
the inductive assumption on subformulas would be applied). The
remaining case is the case for quantied formulas: there we have
[x]
t
0
,...,tn
x
0
,...,xn
:= u []
t
i
1
,...,t
i
k
,u
x
i
1
,...,x
i
k
,x
= [x]
t
(0)
,...,t
(n)
x
(0)
,...,x
(n)
given that the order in which terms are substituted for variables
within the subformula is irrelevant, which is guaranteed by the
inductive assumption again (accordingly for universally quantied
formulas). So we are done.
(b) If y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
), then
i. y var(t
0
) . . . var(t
n
) or
ii. y var(t) and y ,= x
0
, . . . , x
n
.
Proof. By induction over terms t:
Induction basis:
t = x:
Case 1: x ,= x
0
, . . . , x
n
.
Then [t]
t
0
,...,tn
x
0
,...,xn
= x, so if y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
) then y must
be identical to x and thus y ,= x
0
, . . . , x
n
.
Case 2: x = x
i
(for some i 0, . . . , n).
Then [t]
t
0
,...,tn
x
0
,...,xn
= t
i
; therefore, if y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
) then
y var(t
i
) var(t
0
) . . . var(t
n
).
t = c:
there is no y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
), so we are done (trivially).
Now consider t = f(t

1
, . . . , t

m
) and assume that t

1
, . . . , t

m
have
the property stated in 2a.
136
Suppose y var(t
t
0
, . . . , t
n
x
0
, . . . , x
n
):
It follows that y var
_
f
_
[t

1
]
t
0
,...,tn
x
0
,...,xn
, . . . , [t

m
]
t
0
,...,tn
x
0
,...,xn
__
, and hence
that y var([t

1
]
t
0
,...,tn
x
0
,...,xn
) . . . var([t

m
]
t
0
,...,tn
x
0
,...,xn
).
By the inductive assumption, it follows that
(y var(t
0
) . . . var(t
n
) or y var(t

1
) and y ,= x
0
, . . . , x
n
) or
.
.
.
(y var(t
0
) . . . var(t
n
) or y var(t

m
) and y ,= x
0
, . . . , x
n
),
which nally implies:
y var(t
0
) . . . var(t
n
) or
y var(t) and y ,= x
0
, . . . , x
n
(since t = f(t

1
, . . . , t

m
)).
137
7.5 Solutions to Problem Set 5
1. (This problem counts for award of CREDIT POINTS.)
Are the following rules correct?
(a)

1

1

2

2

1

2

1

2
This rule is correct:
Assume that
1

1
,
2

2
are correct, i.e.,
1
[=
1
and

2
[=
2
. Now we show that in this case also
1

2

1

2
is correct, i.e.,
1

2
[=
1

2
. For consider arbitrary
M, s with M, s [=
1

2
: it follows that either (i) M, s [=

1
or (ii) M, s [=
2
. Since
1
[=
1
and

2
[=
2
it must be the case that either (i) M, s [=
1

or (ii) M, s [=
2
. In either case, M, s [=
1

2
and
thus we are done.
(b)

1

1

2

2

1

2

1

2
This rule is not correct:
Consider the following exemplary instance of the rule:
P(c) P(c)
P(c) P(c)
P(c) P(c) P(c) P(c)
( is chosen to be empty).
Obviously, both premises are correct while the conclusion is not
(as far as the latter is concerned, any model whatsoever for the
symbol set o = P, c is a counterexample).
2. Derive the following (auxiliary) rules from the rules of the sequent
calculus:
(a)


138
1. (Premise)
2. (Ass.)
3. (CP 2) with 2.
4. (CS) with 1., 3.
(b)


1. (Premise)
2. (Ass.)
3. (Ant.) with 1.
4. (CD) with 2., 3.
(c)



1. (Premise)
2. (Premise)
3. (Ass.)
4. (Ant.) with 1.
5. (2a) with 4.
6. (DS) with 3., 5.
7. (Ant.) with 2.
8. ( ) (Triv.) with 7., 6.
9. ( ) ( ) (Ant.)
10.( )
. .

(PC) with 8., 9.


(d)


139
1. (Premise)
2. (-Con.) with 1.
3. (Ass.)
4. (-Con.) with 3.
5.
. .

(PC) with 2., 4.


(e)


1. ( )
. .

(Premise)
2. (Ass.)
3. (-Con.) with 2.
4. ( ) (Ant.) with 1.
5. (Triv.) with 3., 4.
6. (Ass.)
7. (PC) with 6., 5.
(f)


Analogous to 2e!
3. Are the following rules correct?
(a)

x x
This rule is correct:
Assume that is correct, i.e., [= . We show that in this
case also xx is correct, i.e., x [= x. For consider
arbitrary M, s with M, s [= x: it follows that there is a d in
the domain of M, such that M, s
d
x
[= . Since [= , we have
M, s
d
x
[= and hence M, s [= x.
140
(b)

x x
This rule is correct:
Assume that is correct, i.e., [= . We prove that this
implies that xx is correct, i.e., x [= x. Consider
arbitrary M, s with M, s [= x: it follows that for all d in
the domain of M: M, s
d
x
[= . Therefore, it is of course also the
case that M, s [= (simply take d := s(x)). So M, s [=
and by [= it follows that M, s [= . So there must
also be a d in the domain of M, such that M, s
d
x
[= (namely
d := s(x)). We conclude that M, s [= x and we are done.
4. Derive the following (auxiliary) rules from the rules of the sequent
calculus:
(a)
x

t
x
1. x
. .
x
(Premise)
2.
t
x

t
x
(Ass.)
3.
t
x
x (-Con.) with 2.
4.
t
x
x (Ant.) with 1.
5.
t
x
(CD) with 3., 4.
(b)
x

Use 4a with t := x!
(c)

t
x

x
1.
t
x
(Premise)
2. x
t
x

t
x
(Ass.)
3. x
t
x
x (-Con.) with 2.
141
4. x
t
x
x (Ass.)
5. x
t
x
(CD) with 3., 4.
6. x
t
x
(Ant.) with 1.
7. x
. .
x
(CS) with 6., 5.
(d)

y
x
x
if y is not free in the sequent x.
1.
y
x
(Premise)
2.
y
x

y
x
(Ass.)
3.
y
x

y
x
(Ant.) with 1.
4.
y
x
x (Triv.) with 3., 2.
5. x x (-Ant.) with 4.
6. x x (Ass.)
7. x
. .
x
(PC) with 5., 6.
(e)

x
1. (Premise)
2. (Ass.)
3. x (-Con.) with 2.
4. x (CP 3) with 3.
5. x (Ant.) with 1.
6. x
. .
x
(CS) with 4., 5.
(f)

x
if x is not free in the sequent .
Use 4d with y := x!
142
7.6 Solutions to Problem Set 6
1. Let o be an arbitrary symbol set.
Let = v
0
t [t T
S
v
1
v
2
v
1
v
2
.
Show:
is consistent
there is no formula set T
S
with , such that is
consistent and contains instances.
Proof.
(a) is consistent as it is satised by e.g. the following model M =
(D, I):
Let D = 1, 2; let I(c) = 1 for all constants c in o, let s(x) = 1
for all variables x, and for all n-ary function signs f in o let
I(f) : D
n
D with I(f)(d) = 1 for arbitrary d D. Since
obviously V al
M,s
(t) = 1 for all terms t and since D contains more
than just one element, it follows that M, s [= .
(b) Consider an arbitrary formula set T
S
with , such that
contains instances:
Because contains instances, there must be o-terms t, t

, such
that
v
1
v
2
v
1
v
2
v
2
t v
2
v
2
t v
2
t t

Since v
1
v
2
v
1
v
2
, it follows that t t

is derivable
from (by two applications of modus ponens).
But at the same time v
0
t and v
0
t

are members of by
assumption. By applying the rules Symm. (symmetry of identity)
and Trans. (transitivity of identity) of the sequent calculus (or
alternatively the rule Sub. of substitution of identicals), we can
thus derive t t

from . But this means that is inconsistent


and so we are done.
143
2. (This problem counts for award of CREDIT POINTS.)
Explain why the following logical implication holds:
xy(z(z x z y) x = y)
xy(z(z x z y) x = y)
Answer: xy(x = y z(z x z y)) is logically true, i.e., sat-
ised in every model whatsoever! Therefore, it is also logically implied
by every formula, which means that
xy(z(z x z y) x = y)
xy(z(z x z y) x = y)xy(x = y z(z x z y))
is the case. But the latter formula is obviously logically equivalent to
xy(z(z x z y) x = y)
(Note that strictly we should have used again instead of =, but never
mind. . .)
3. Prove: A map with countably many countries can be coloured by using
at most four colours if and only if each of its nite submaps can be
coloured by using at most four colours.
(Hint: choose a symbol set o in which ever constant represents a coun-
try, in which there are four unary predicates that represent four colours,
and in which there is a binary predicate that stands for the neighbour-
hood relation between countries; represent maps as sets of formulas for
this symbol set; apply the compactness theorem.)
Proof. Let a map M with countably many countries be given. We
can concentrate on the interesting case, i.e., where M has a countably
innite set of countries 0, 1, 2, . . ..
Choose o = o
M
as follows:
c
0
, c
1
, c
2
, . . .: constants representing countries 0, 1, 2, . . . in M
R, B, G, W: unary predicates representing colours
N: binary predicate representing the neighbourhood of countries
in M
144
Let
M
T
S
be dened as follows:
c
i
c
j

M
for all pairwise distinct indices i, j N
0
N(c
i
, c
j
)
M
i
the i-th country is a neighbour of the j-th country in M
N(c
i
, c
j
)
M
i
the i-th country is not a neighbour of the j-th country in M
The following sentence is a member of
M
:
x((R(x) B(x) G(x) W(x))
(R(x) B(x) G(x) W(x))
(R(x) B(x) G(x) W(x))
(R(x) B(x) G(x) W(x)))
The following sentence is a member of
M
:
xy(N(x, y)
((R(x) R(y))
(B(x) B(y))
(G(x) G(y))
(W(x) W(y))))

M
does not have any further members.
Then M is represented by
M
, every nite submap M
n
of M with
countries 0, . . . , n is represented by the set of sentences of
Mn
in which
none of the constants c
n+1
, c
n+2
, . . . occurs.
So we can prove the right-to-left direction of the statement above (the
other direction is trivial): assume every nite submap M
n
can be
coloured by means of four colours (or less). Translated into sets of
formulas, this means that every subset of
M
that is of the form
Mn
is satisable. Since every nite subset of
M
is a subset of a set of
the form
Mn
for some n, it follows that every nite subset of
M
is
satisable. Hence, by the compactness theorem,
M
is satisable and
thus M can be coloured by means of four colours (or less).
145
4. Let P be a binary predicate in o.
Prove that the formula
xP(x, x) xyz(P(x, y) P(y, z) P(x, z)) xyP(x, y)
can only be satised by innite models.
Proof. Assume M = (D, I) satises this formula:
D ,= (by denition of model ), so there is a d
0
D which think
of held xed.
Since M [= xyP(x, y) there must be a d
1
D such that
(d
0
, d
1
) I(P). d
1
cannot be identical to d
0
because M [=
xP(x, x).
Let us assume it is true that there are pairwise distinct d
0
, . . . , d
n
(for 0 n) which are members of D and for which it is the case
that (d
0
, d
1
), (d
1
, d
2
), . . . , (d
n1
, d
n
) I(P):
Since M [= xyP(x, y) there must be a d
n+1
D such that
(d
n
, d
n+1
) I(P).
d
n+1
cannot be identical to any of the d
k
for k n+1 for otherwise
it would follow that (d
k
, d
k+1
), (d
k+1
, d
k+2
), . . . , (d
n1
, d
n
), (d
n
, d
k
)
I(P): but then by M [= xyz(P(x, y) P(y, z) P(x, z)) it
would be the case that (d
k
, d
k
) I(P), which would contradict
M [= xP(x, x).
It follows that there are pairwise distinct d
0
, . . . , d
n+1
which are
members of D and for which it is the case that (d
0
, d
1
), (d
1
, d
2
), . . . ,
(d
n
, d
n+1
) I(P).
But this implies that for every n there are pairwise distinct members
d
0
, . . . , d
n
of D. Hence, D is innite.
5. Prove: there is no formula , such that for all models M = (D, I) and
for all variable assignments s holds:
M, s if and only if D is innite.
(Hint: use the compactness theorem.)
Proof. Assume for contradiction that there is such a :
so, M, s [= i D is nite (for arbitrary M, s).
146
Now consider the formula set =
n
[n 2, where

n
:= v
1
. . . v
n
(v
1
v
2
. . . v
i
v
j
. . . v
n1
v
n
)
(for i ,= j with 1 i, j, n).
Note that M, s
n
if and only if D has n or more members (for
arbitrary M, s).
It follows that every nite subset of is satisable (by choosing a model
with a suciently large domain). Therefore, the compactness theorem
implies that is satisable. So there are M, s which satisfy ; x one
such model M = (D, I):
Since M, s [= , D must be nite, i.e., for some n the set D is of
cardinality n: but then M, s ,[=
n+1
. However,
n+1
and is
satised by M, s, which implies M, s [=
n+1
. Contradiction.
147