Advanced Logic Notes
Advanced Logic Notes
—-
Lecture Notes
Toby Meadows
E-mail address: [Link]@[Link]
c Toby Meadows
.1 f
t
v1 ra
inDe
nl
O
I would like to thank Aleksi Anttila, Adam George and Justine Retford for
welcome suggestions in making these notes clearer and for their patience in
spotting typos in the document.
c Toby Meadows
.1 f
t
v1 ra
inDe
nl
O
3
READ ME:
t
[Link]
.1 f
v1 ra
this document.
[Link]@[Link].
O
Contents
Chapter 2. Models 18
c Toby Meadows
Chapter 4. Completeness 1 43
4.1. Completeness 43
4.2. Soundness 50
e
4.3. Exercises 54
in
Chapter 5. Completeness 2 55
5.1. Soundness 55
nl
5.2. Completeness 60
5.3. Exercises 66
O
Chapter 9. Arithmetic
.1 f
9.1. Theories and axioms
t 113
113
v1 ra
9.2. A sketch of the incompleteness theorem 113
9.3. A theory of arithmetic - P E 115
9.4. Exercises. 130
D
O
nl
in D
e Part 1
v1 ra
.1 f
Models & Proofs
t
CHAPTER 1
Goals:
Each of the relation and function symbols have an arity which reflects how
e
t
• the logical vocabulary consists of just the symbol ∧.
.1 f
v1 ra
We might then define a well-formed string as follows:
• Let p and q be atoms; thus they are well-formed string.
• If we have two well formed string, say ϕ and χ, then ϕ ∧ χ is a well
formed string; i.e., the string formed by placing the ∧ symbol be-
D
R EMARK 1. Note the use of the symbols ϕ and χ to stand for arbitrary strings.
Are they part of language?
e
in
are well-formed;
• then at the next stage, we form all of the strings that can be formed
O
(1.) just ensures that everything from the previous stages is included in the
next; thus, we accumulate everything we built beforehand as we go.
It turns out that these two definitions are equivalent.
[Link]. First order logic. Using the same process, we now define the
terms and well-formed formulae of first order logic.
Intuitively, a terms is something like a name. We build up the definition of
c Toby Meadows
E XAMPLE 3. Let L have two one function symbol f with arity 2 and a constant
symbol a. Then the following are terms:
D
• a;
• v1 ;
• f (v1 a); and
• f (v1 , f (v1 , a)).
We then set out the process for constructing well formed formulae below:
O
• if ϕ is an atom then ϕ ∈ W F F ;
• if ϕ ∈ {¬ψ, ∀xψ, ∃xψ} where ψ ∈ W F F and x is a variable, then ϕ ∈
WFF;
• if ϕ ∈ {(ψ ∧ χ), (χ ∨ ψ), (ψ → χ), (ψ ↔ χ)} where ψ, χ ∈ W F F , ϕ ∈ W F F ;
1.1. THE LANGUAGE OF FIRST ORDER LOGIC 10
• nothing else is in W F F .
R EMARK 4. The logical vocabulary and individual variables will be the same
for the remainder of this course. Thus when we speak of a language L we
shall often just mean the non-logical vocabulary. This shouldn’t cause too
much confusion. Also observe that we are including brackets around each
of the formulae before when we compose new formulae from them.
We can also define the same set using our stage based approach.
• StageW F F (1) is the set of formulae of the form Rt1 , ..., tn where R is an
n-ary relation symbol and t1 , ..., tn are terms; and
c Toby Meadows
We’ll give some examples of this and leave it as an exercise to define the
relation x is free in ϕ using a recursive definition.
as opposed to
.1 f
t
∀v1 (¬Rv1 v2 → ∃v3 (Hv3 v1 ∧ (∃v2 ¬Gv1 v2 ∧ P v3 )))
ra
∀x(¬Rxy → ∃z(Hzx ∧ ∃y¬Gxy ∧ P x)).
Thus, I’m often going to use a sloppier version of W F F , which allows us to
write formulae in the simpler form above.
D
matter.
1.2. Induction
e
Mathematical induction is, in a sense, the other side of coin for recursive
in
[Link]. The least number principle. If the previous principle isn’t obvi-
ous, the perhaps this one is.
F ACT 13. (LNP) If B ⊆ N is not empty, then there is some n ∈ B such that for
all m < n, m ∈
/ B; i.e., there is some least member of B.
we assume that IND is not true. We’ll show that this leads us to contradict
ourselves: and absurdity. Thus, our assumption that IND is not true, is
.1 f
t
itself wrong. Thus IND is actually correct.
P ROOF. Assume LNP. Now suppose for reductio, that IND is not correct.
v1 ra
Then there is some A ⊆ N, such that:
(1) 0 ∈ A;
(2) ∀n(n ∈ A → n + 1 ∈ A); but
D
• b = n + 1 for some n.
in
n ∈ A, but b = n + 1 ∈
/ A, contradicting (2.).
This tells us that there cannot be such a B; i.e., that for all n, we actually
O
Indeed, we can actually go the other way too. We can prove LNP from IND.
P ROOF. Suppose IND is true, but for a reductio, suppose that LNP is not.
Then there is some subset B ⊆ N such that:
(1) B is not empty; and
(2) B has no least element.
Let A = N\B. Clearly 0 ∈ / B (for then 0 would be the least element), so 0 ∈ A.
Moreover, since B has no least element, this just means that for any n ∈ N,
if n + 1 ∈ B, then n ∈ B; otherwise, such an n would be the least. But this
means that for any n if n + 1 ∈ / A, then n ∈
/ A; and by contraposition, if n ∈ A,
then n + 1 ∈ A. Thus we have both the antecedent conditions of IND and so
for all n, n ∈ A; i.e., n ∈
/ B. But this means B is empty contradicting (1.).
Thus LNP must be true after all.
c Toby Meadows
R EMARK 17. So there is a sense in which they actually both mean the same
thing. .1 f
1.2.2. Using induction.
t
v1 ra
[Link]. A simple mathematical proof. A triangular number n is such that
n = m + (m − 1) + ... + 2 + 1
for some m.
D
We can use induction to prove the following fact about natural numbers.
m(m+1)
T HEOREM 18. For all m, m + (m − 1) + ... + 2 + 1 = 2
.
m(m + 1)
in
m + (m − 1) + ... + 2 + 1 = .
2
That is, every m ∈ A is such that the equation above holds of m.
nl
P ROOF. By induction.
(Base) We need to show that 0 ∈ A. For this to be true we just need
0(0 + 1)
0 =
2
= 0/2
= 0
(n + 1) + n + (n − 1) + ... + 2 + 1.
t
Then with a little bit of simple maths, we get
.1 f
ra
n(n + 1)
(n + 1) + n + (n − 1) + ... + 2 + 1 = (n + 1) +
2
2
n +n
= (n + 1) +
2
D
(2n + 2) + (n2 + n)
=
2
n2 + 3n + 2
v1
=
2
(n + 1)(n + 2)
=
2
(n + 1)((n + 1) + 1)
e
=
2
in
O
But how to do we use induction here? These strings are not natural num-
bers.
Consider Definition 2, which used stages construct all of the well formed
strings. Each stage of the definition was indexed by a particular natural
number n.
We shall use the stage indices to make a proof by by induction. Thus we shall
demonstrate that the proposition holds for every stage n of the construction
and thus for everything in W F S.
Thus we shall make A the set of n such that ϕ ∈ Stage(n) iff either:
c Toby Meadows
• ϕ is atomic; or
.1 f
t
• ϕ is of the form ψ ∧ χ where ψ ∧ χ ∈ Stage(m) for some m < n.
second part. Moreover, since Stage(0) = {p, q}, it is obvious that everything
in Stage(0) is atomic which is sufficient.
(INDUCTION STEP) Suppose n ∈ A. We must show that n+1 ∈ A. Since n ∈ A,
every ϕ ∈ Stage(n) is either atomic or of the form ψ ∧ χ for ψ, χ ∈ Stage(m) for
some m < n. Thus we only need to worry about those strings added at stage
n + 1. Suppose ϕ ∈ Stage(n + 1)\Stage(n); i.e., it’s one of the new things
e
added at stage n + 1. Then by the way we defined the rule of construction for
in
Now this is a very simple proof. In a sense, we used the definition by recur-
sion to construct a set of well formed strings and then we used induction to
show that they indeed were well formed.
We’ll usually, however, be concerned with:
1.2. INDUCTION 16
R EMARK 22. The complexity amounts to much the same thing as the stage
in the construction.
It is conventional in proofs by induction on complexity not to explicitly men-
D
tion the complexity of the formulae. The reason for this is that now we
understand the principles underpinning the induction, we don’t really need
to think about the numbers anymore.
When we make a proof by induction on the complexity/stage of formulae,
we really just need the following steps:
e
(1) (BASE) show that the property holds for the atomic case - this just
in
formed formulae, then it holds for any well formed formula that can
be constructed by the rules from them - this is just showing that we
O
Exercises Week 1
E XERCISE 23. What change in the rules (of the recursive definition) would
you make to W F F in order to formalise the sloppy rules of W F F in such a
way to accommodate the kind of problem illustrated in (1.) and (2.) of 1.1.4?
E XERCISE 25. Are all formulae sentences? Are all sentences formulae?
(1) ∀v1 P v1 v2 ;
(2) ∀v2 (∃v1 P v1 ∧ ∀v2 Rv1 v2 );
(3)
(4)
∀v2 (P v1 → ∃v1 Rv1 v2 );
.1 f
∀v1 (P v1 → ∃v2 Rv1 v2 ). t
v1 ra
E XERCISE 27. Develop a recursive definition for the relation:
• the variable x is free in the formula ϕ.
[Try to do this in stages. Define the atomic case and then rules for getting
D
from one stage to the next. Given an atomic sentence of the form ϕ :=
P t1 , ., tk , .., tn where x = tk is a variable (and a term) we can say that x is free
in P t1 , ..., tn .]
E XERCISE 28. Prove (using induction) that every string of our toy language
W F S contains an odd number of symbols. [Clearly the atoms contain an
e
that will allows to prove the claim for every level of complexity.]
nl
O
CHAPTER 2
Models
Goals:
(1) Define a model.
(2) Describe what it means for a sentence to be true in a model.
(3) To define some important metatheoretic properties: including valid-
ity and satisfiability.
By what of introduction, we might think of a model as something for one
c Toby Meadows
of our languages to talk about. It will consist of things which bear certain
relations to other things in the model. Moreover, we shall be able to use
.1 f
what is going on inside the model. t
sentences in the language to talk about the model: to express things about
v1 ra
2.1. What is a model?
2.1.1. Examples.
(i.e., they have arity 1 and 2 respectively). Let us define a model M for L.
t
• Let the domain M consist of two objects m1 and m2 .
• Let aM (the interpretation of a in M) be the object m1 from the domain
M.
.1 f
v1 ra
• Let P M (the interpretation of the symbol P in M) be the set {m1 }.
• Let RM be the set {hm1 , m1 i, hm1 , m2 i}.
We have given the language an domain and interpretation, so M = hM, P M , RM i.
D
Intuitively speaking, the fact that hm1 , m2 i ∈ RM tells us that m1 bears the
relation RM to m2 . In the next section we are going to show how to use
sentences of the language to express this fact.
R EMARK 31. Note that RM is a set of tuples from the domain, but R is just a
(relation) symbol from the language.
e
in
E XAMPLE 32. Imagine a room full of people: John, Mary, Peter and Dorothy.
We are going to let them from the domain of a model M. Let us have a
language consisting:
nl
R EMARK 33. In the example above, I have used B because it starts with the
same letter as the word “boys”, which makes things easier to remember.
However, there is nothing stopping me from defining a different interpreta-
tion (and thus different model) in which I made B denote (be interpreted as)
the set of girls and G denote the set of boys; or let B denote all of the object
in the domain.
0 and 1 are constant symbols and + and × are function symbols. The stan-
dard model of arithmetic consists of a domain N which consists of all of the
natural numbers and interprets:
Also, while we can say things about a possible world using a language, pos-
sible worlds are supposed to be, in some sense, independent of the language
we use to describe them; a model is not. The language gives the structure
nl
to the model.
O
2.2. Satisfaction
In this section, our goal is to find a way of connecting the sentences of our
language to a model M of that language L. We want to use our language
2.2. SATISFACTION 21
to express facts about what is going on the model. Thus we want to know
when some sentence is true in M.
If a sentence ϕ is true in M, we shall say that M satisfies ϕ, we we abbreviate
M |= ϕ.
We shall do this in stages:
(1) we show how to see when atomic sentences are true in M;
(2) we show how to use the simple connectives like ¬ and ∧;
(3) we encounter a problem with the quantifiers; and
(4) we solve that problem and give our final definition of satisfaction.
E XAMPLE 36. Consider the language and model from Example 30 and the
in
M |= Raa ⇔ haM , aM i ∈ RM
⇔ hm1 , m1 i ∈ {hm1 , m1 i, hm1 , m2 i}.
O
The first ⇔ is obtained by our atomic satisfaction definition and the second
⇔ is obtained by the definition of the interpretations of a and R in M. Since
the last statement is clearly correct, we see that Raa is indeed true in M.
2.2. SATISFACTION 22
With this in mind, we might then say that if ϕ is of the form ¬ψ then:
• M |= ϕ iff M 2 ψ.
.1 f
t
R EMARK 37. Note that we write M 2 ϕ to mean that it is not the case that
v1 ra
M |= ϕ.
E XAMPLE 38. Using the language and model of Example 30 again, consider
the sentences ¬P a and ¬¬Raa. For ¬P a we have the following:
D
M |= ¬P a ⇔ M 2 P a
⇔ aM ∈
/ PM
⇔ m1 ∈
/ {m1 , m2 }.
The first ⇔ is obtained the clause we just provided for negation; the second
e
⇔ is given by the atomic satisfaction clause; and the final ⇔ is given by the
in
M |= ¬¬Raa ⇔ M 2 ¬Raa
⇔ M |= Raa.
• M |= ϕ iff M |= ψ and M |= χ.
.1 f
tence Raa ∧ P a. We have t
E XAMPLE 39. Returning the model and language of 30, consider the sen-
v1 ra
M |= Raa ∧ P a ⇔ M |= Raa & M |= P a
⇔ haM , aM i ∈ RM & aM ∈ P M
⇔ hm1 , m1 i ∈ {hm1 , m1 i, hm1 , m2 i} & m1 ∈ {m1 , m2 }.
D
Since the final clause is clearly correct, we see that we do have M |= Raa∧P a.
To make things faster, I’m going to write ϕ := ... to mean that ϕ is of the form
in
... .
Suppose ϕ ∈ SentL and that M is a model of L. Then
nl
– M |= ϕ iff haM M M
1 , ..., an i ∈ R ;
• if ϕ := ¬ψ, then
– M |= ϕ iff M 2 ψ;
• if ϕ := ψ ∧ χ, then
2.2. SATISFACTION 24
– M |= ϕ iff M |= ψ and M |= χ;
• if ϕ := ψ ∨ χ, then
– M |= ϕ iff M |= ψ or M |= χ;
• if ϕ := ψ → χ, then
– if M |= ψ, then M |= χ;
• if ϕ := ψ ↔ χ, then
– M |= ϕ iff (M |= ψ iff M |= χ)
R EMARK 40. Note that in the last clause we needed to resort to brackets.
This is one of the drawbacks of using the natural language, English, as the
language of the metatheory.
2.2.3. A problem for quantifiers. Observe that the definition above says
nothing about what we should do when we encounter a sentence ϕ ∈ SentL
c Toby Meadows
correct?
.1 f
t
E XAMPLE 41. Using Example 30 again, consider the sentence ∃x¬P x. Is this
v1 ra
To make things clearer we might represent the interpretation of R using a
table as follows (read anti-clockwise):
PM
m1 1
D
m2 0
A 1 in the box for m1 represents the fact that m1 ∈ P M ; and a 0 in the box for
/ P M.
m2 represents the fact that m2 ∈
Now, intuitively speaking, ∃x¬P x says (of the model M) that there is some
object x such that it is not the case that x in P M . This is clearly true: m2
e
/ P M.
suffices since m2 ∈
in
[Link]. The problem. However, the rules we gave in the previous section
nl
don’t tell us how to do this. They only say what to do when we are given a
sentence composed from atomic sentences using ¬, ∧, ∨, → and ↔.
O
So clearly we need to say more about how the satisfaction relation works.
We need to say how it deals with sentences involving quantifiers.
But there is a further problem. We’ll try to extend our characterisation of
satisfaction in an obvious way and the problem will emerge.
2.2. SATISFACTION 25
Let’s consider our sentence ∃x¬P x again. We want to be able to say some-
thing like this.
/ P M.
• M |= ∃x¬P x iff there is some object m ∈ M such that m ∈
We can see that the latter part is true and thus that ∃x¬P x is true in M.
But to do this we’ve had to make a lot of steps at once. In the case of
the connectives we were, so to speak, able to unravel one connective at a
time as we worked our way to facts about the model itself. However, here
we’ve jumped from a complex sentence involving quantification straight to
the model.
While we can see how this works with a relatively simple sentence like
∃x¬P x, it would be much more difficult with a sentence like:
c Toby Meadows
which are used to construct it, then we’ll have the sort of thing we want.
in
Indeed this is how the definition works for the connectives. For example, we
figure out whether M |= ψ ∧ χ by checking whether the sentences ψ and χ
nl
are true in M.
But here’s the problem: if we take pull a quantifier off a sentence, we (may)
O
end up with a formula with a free variable. For example, if we take the ∃x
from the front of ∃x¬P x, we end up up with ¬P x. This has one free variable
(i.e., x) and thus it is not a sentence.
Our characterisation of satisfaction only works for sentences.
2.2. SATISFACTION 26
This might help illustrate the problem. Say we try to make a rule that
unravels sentences of the form ∃xψ(x). We might say something like, if ϕ :=
∃xψ(x) then
For the moment, don’t worry about what the condition is, the problem is the
statement M |= ψ(x). What could it mean to say that M |= ¬P x? Intuitively,
we are supposed to say something like ¬P x is true in M. But x is just a
variable, it doesn’t denote anything in the domain. It’s meaningless to say
that ¬P x is true in M.
2.2.4. Our solution and final satisfaction definition. There are a num-
ber of ways of getting around this. We’ll consider a simple technique for
solving the problem and then make some remarks about other approaches
c Toby Meadows
which are common in the literature. However, there is a sense in which they
all come down to much the same thing in the end.
.1 f
t
[Link]. Something that doesn’t work but points the way to a solution.
So our problem is that we don’t have a way of talking about the truth of
v1 ra
a formula and this makes it difficult to unravel a complex sentence into
simpler parts so that we can figure out whether or not it is true.
So let’s not try to give satisfaction conditions for formulae, let’s stick with
D
• aM = m1 , bM = m2 ; and
in
• P M = {m1 }.
aM = m1 ∈ {m1 } = P M .
2.2. SATISFACTION 27
We might then be tempted to generalise this and make the following attempt
at a rule. If ϕ is of the form ∃xψ(x) then
• M |= ϕ iff for every constant symbol c from L we have M |= ψ(c 7→ x)
where ψ(c 7→ x) means that c has been substituted for x in all of the places
where x was free in ψ.
However, it is easy to see that this approach merely gives us a sufficient
condition for M |= ∃xψ. If there is such a constant symbol, then it clearly
works. However, there may be situation where we do not have enough con-
stant symbols in the language (perhaps we even have none). An example
may illustrate this:
E XAMPLE 43. Let’s use the model and language from Example 30 and con-
c Toby Meadows
sider the sentence ∃x¬P x. Then using the proposed quantifier clause we
get:
t
M |= ∃x¬P x ⇔ there is some cons-sym c such that M |= ¬P c
.1 f
v1 ra
⇔ there is some cons-sym c such that M 2 P c
⇔ there is some cons-sym c such that cM ∈
/ P M.
clause is false; and thus, we are told that M 2 ∃x¬P x, which, as we know
from Example 41, is not correct.
So this doesn’t work, since we might not have enough constant symbols
available.
[Link]. Our solution. But this points the way to an obvious fix. We are
e
What should we use for those constant symbols? Simple! We’ll just use the
objects m ∈ M themselves.
O
With this in hand we can now describe how the satisfaction predicate works
for sentences ϕ ∈ SentL(M ) of the expanded language.
To make this work, we also need to expand the model M in order that it is a
model of the expanded language L(M ). To do this we simply let mM = m for
all m ∈ M . We shall denote the resultant model by M+ .
c Toby Meadows
So putting it all together, we now have the means of telling whether a sen-
tence ϕ ∈ SentL(M ) is true in M+ . But what we really want is a way of telling
whether or not a sentence ϕ ∈ SentL is true in our original model M.
We first observe that:
This tells us that sentence from L are also sentences in L(M ), so it makes
in
R EMARK 47. Strictly, we also need another clause which says that nothing
else is true in M.
2.3. IMPORTANT SEMANTIC PROPERTIES 29
[Link]. = and ⊥. = is a two place relation which says that the object rep-
resented by the first constant symbol is identical to the object represented
by the second constant symbol.
⊥ is a 0-place relation symbol which is false in every model.
See Exercise 53
In this final section, we are going to use models and our satisfaction relation
to define some interesting properties that a sentence might have.
Let us write Γ, ∆ for sets of sentences in some language L; i.e., such that
Γ, ∆ ⊆ SentL .
all of Γ true is a way which also makes ϕ true. Thus, we might say that Γ
implies ϕ.
nl
O
EXERCISES WEEK 2 30
Exercises Week 2
E XERCISE 52. Provide the clause defining the behaviour of sentences of the
form ∀xψ(x) ∈ SentL(M ) for some model M and language L.
(5) M+ |= P m2 m1 ;
(6) M |= ∀x(P x ∨ ¬P x);
(7) M |= ∀xRxx; and
(8) M |= ∀x∃y(Rxy ∧ P y).
E XERCISE 56. Consider the language L from the exercise above and the do-
e
write |M| = n and say that the cardinality of M is n. Suppose the language
consists of one m-place relation symbol R, how many different interpreta-
O
tions (and thus models) are there for such a relation over M?
E XERCISE 57. In Remark 47, we note that a closing off clause is required.
What could happen if we didn’t add one of these.
EXERCISES WEEK 2 31
that sentence is true there; i.e., for each sentence (1.)-(3.), define all of the
interpretations of R such that that sentence would be true. What differences
do you note? Consider the following questions:
• Is there more than one model?
• If there is more than one model, could we add another sentence such
e
E XERCISE 60. Verify Fact 45. [Hint: prove this by induction on the stage
construction of formulae before considering sentences.]
nl
E XERCISE 61. Define satisfiable in terms of validity; i.e., give a simple defi-
nition of what it means for a formula to be satisfiable using the concept of
O
validity.
E XERCISE 62. Consider the following properties a sentence ϕ ∈ SentL and set
of sentence Γ ⊆ SentL might have:
EXERCISES WEEK 2 32
E XERCISE 63. Let M be a model of some language L. Show that for any
sentence ϕ from L that:
M |= ϕ ⇔ M 2 ¬ϕ.
This, in effect, says that every sentence is either true or false in M but not
both. [Hint: Prove this by induction on the complexity of formulae in the
expanded language.]
c Toby Meadows
.1 f
t
v1 ra
inDe
nl
O
CHAPTER 3
Proof Systems
Goals:
(1) To review tableau proof systems.
(2) Review natural deduction proof system.
This is mainly a review week. We’ll move over this material quickly. It is
expected that you already know how to use these systems.
Our goal this week is to explore two proof systems. In each system we want
c Toby Meadows
3.1. Tableau
ϕ ¬ϕ ¬ψ ¬ϕ ϕ ψ ϕ ¬ϕ ψ
ψ ¬ψ ¬ψ
33
3.1. TABLEAU 34
¬¬ϕ (¬¬)
t
If the tableau for ¬ϕ closes, then we have a proof of ϕ, abbreviated `T ab ϕ.
We shall omit the T ab where no confusion can arise.
.1 f
v1 ra
If the tableau commencing with Γ, ¬ϕ closes, then we have derived ϕ from Γ,
which we abbreviate Γ `T ab ϕ.
D
3.1.4. Examples.
¬(∀xP x → ¬∃x¬P x)
e
∀xP x \a
in
¬¬∃x¬P x
nl
∃x¬P x × a
¬P a
O
Pa
¬(¬∃x¬P x → ∀xP x)
¬∃x¬P x \a
¬∀xP x × a
¬P a
¬¬P a
c Toby Meadows
∀xP x ∨ ∀xQx
¬∀x(P x ∨ Qx) × a
D
¬(P a ∨ Qa)
¬P a
¬Qa
H
HH
∀xP x \a ∀xQx \a
e
in
Pa Qa
nl
O
¬Raa
∃yRay × b
Rab
∀y(Ray → Rya) \b
Rab → Rba
HH
c Toby Meadows
H
HH
¬Rab Rba
.1 f
t
∀y∀z((Ray ∧ Ryz) → Raz) \b
∀z((Rab ∧ Rbz) → Raz \a
v1 ra
(Rab ∧ Rba) → Raa)
HH
H
¬(Rab ∧ Rba) Raa
D
HH
¬Rab ¬Rba
e
in
nl
3.1.5. Counterexamples.
O
∀x(P x ∨ Qx){}a, b
¬(∀xP x ∨ ∀xQx)
¬∀xP x × a
¬∀xQx × b
¬P a
¬Qb
P a ∨ Qa
P b ∨ Qb
HH
Pa Qa
c Toby Meadows
H
H
P b Qb
.1 f
t
We have applied all the rules we needed to, but there is still an open branch.
Thus there is no derivation of ∀xP x ∨ ∀xQx from ∀x(P x ∨ Qx).
v1 ra
We now use the open branch to construct a model which witnesses a coun-
terexample to the derivation; i.e., a model in which all of the premises are
D
• M is the set of terms occurring on the open branch (i.e., {a, b});
e
Now it should be clear that we have M |= ∀x(P x ∨ Qx) but M 2 ∀xP x ∨ ∀xQx.
¬∃x∀yRxy{}a, b
¬∀yRay × b
¬Rab
¬∀yRby × c
Rbc
Now it should be clear that this tableau is going to go on forever. This clearly
means that the branch (there’s only one) will remain open. But how do we
describe a model which makes ∀x∃yRxy false.
In this case, we can think up a model which will do the trick without using
the branch. Let M = hM, RM i be such that:
c Toby Meadows
• M = {a}; and
• RM = {} (i.e., nothing is related by R.
3.2.1. Rules. Again, these rules should be familiar from the course on
philosophical logic.
D
ϕ ψ ϕ∧ψ ϕ∧ψ
(∧-I) ϕ (∧-E) (∧-E)
ϕ∧ψ ψ
ϕ ψ (ϕ) (ψ)
(∨-I) (∨-I) ϕ∨ψ χ χ
ϕ∨ψ ϕ∨ψ (∨-E)
χ
e
(ϕ)
in
ϕ ϕ→ψ
ψ (→-E)
(→-I) ψ
ϕ→ψ
nl
(ϕ) ¬ϕ ϕ ¬¬ϕ
⊥ (¬-E) ϕ (DN)
⊥
¬ϕ (¬-I)
O
3.2. NATURAL DEDUCTION 39
ϕ(a) ∀xϕ(x)
(∀-I) (∀-E)
∀xϕ(x) ϕ(t)
ϕ(a)
ϕ(t)
(∃-I) ∃xϕ(x) ψ
∃xϕ(x) (∃-E)
ψ
viated Γ `N at ϕ, when there is natural deduction proof with ϕ on the final line
and whose assumptions are all members of Γ. We say that ϕ is a theorem if
.1 f
t
`N at ϕ: i.e., ϕ can be derived without any assumptions.
3.2.3. Examples.
P a(1) P a → Qa
Qa ¬Qa(2)
⊥ (1)
e
¬P a (2)
¬Qa → ¬P a
in
We can write out the same derivation in the old notation as follows:
1 (1) P a → Qa Premise
nl
2 (2)P a Assumption
1,2 (3) Qa →-E (1, 2)
O
The only difference is that the book-keeping is a little lighter and hopefully,
you’ll see that it’s a lot easier to see what’s going on.
P ROOF. For the tableau systems both proofs start with almost exactly the
same set up. We leave this as an exercise.
Let’s consider the natural deduction system. Suppose that we have a deriva-
tion of Γ ∪ {ϕ} ` ψ. Then clearly we may add another line to the derivation,
c Toby Meadows
R EMARK 74. In other proof systems, the deduction theorem can be quite
painful to prove.
D
→-E.
in
Exercises Week 3
E XERCISE 77. Describe tableau rules and natural deduction rules for iden-
tity =.
(6) P a → Qb a` ¬P a ∨ Qb;
(7) ` P a ∨ ¬P a;
(8)
(9)
¬P a ∧ ¬Qb a` ¬(P a ∨ Qb);
.1 f
¬P a ∨ ¬Qb a` ¬(P a ∧ Qb); t
v1 ra
(10) ∀x(P x ∧ Qx) a` ∀xQx ∧ ∀xP x;
(11) ∀x(P x → Qx), ∀x(Qx → Rx), P a ` Ra;
(12) P a ∧ (Qb ∨ Rc) a` (P a ∧ Qb) ∨ (P a ∧ Rc);
(13) P a ∨ (Qb ∧ Rc) a` (P a ∨ Qb) ∧ (P a ∨ Rc);
D
E XERCISE 80. Prove Theorem 73 and Theorem 76 for the tableau case.
EXERCISES WEEK 3 42
E XERCISE 82. Can you prove Theorem 75 for the tableau case? What goes
wrong?
c Toby Meadows
.1 f
t
v1 ra
in D
e
nl
O
CHAPTER 4
Completeness 1
Goals:
• Prove the soundness of the tableau proof system.
• Prove the completeness of the tableau proof system.
Our goal is to demonstrate the following theorem.
1
T HEOREM 83. `T ab ϕ iff |= ϕ.
c Toby Meadows
The (→) direction is known as soundness; and the (←) direction is known as
completeness. .1 f
t
To keep things simple, we shall not worry (this week) about consequences
and derivations. The theorem is thus often known as weak completeness,
v1 ra
since we have not involved a set Γ of sentences.
We shall also avoid the use of function symbols.
4.1. Completeness
D
• If 0 ϕ, then 2 ϕ
or in other words,
1
For convenience, I’ll stop using the T ab for the remainder of this week’s notes.
43
4.1. COMPLETENESS 44
• if the tableau commencing with ¬ϕ does not close (i.e., it has at least
one open branch), then there is some M such that M |= ¬ϕ.
This kind of thing should be more familiar. We have seen examples of how
to take an open branch of a tableau and define a model from it: this is how
we constructed counterexamples.
Of course, this only worked in finite cases. Our goal in this section will be
to generalise this technique to the case of infinite branches.
[Link]. Overview. At a high level, we are taking the fact that there is no
proof of ϕ and using that fact to make a set of sentences which describes a
model in which ¬ϕ is true.
Our strategy can be described as follows:
(1) Find a special set of sentences B to describe the model (this is the
c Toby Meadows
open branch);
(2) Define a model MB using the special set; and
.1 f
t
(3) Show that ¬ϕ is indeed true in MB .
4.1.2. The Proof. We shall proceed, first, in the language without the
identity relation =.
[Link]. The special set. We start with the fact that 0 ϕ. This means that
the tableau commencing with ¬ϕ does not close. Thus there is at least one
open branch in the tableau. Pick one and call it B.
Our special set is the collection of sentences occurring on B.
e
[Link]. Defining the model. To define a model, we are going to need need:
in
• a language;
• a domain; and
nl
• an interpretation.
O
The language L of the model will be L(C), which is the language from which
ϕ came (i.e., L) augmented with the constant symbols c required for the
construction of the tableau.
We then define our model MB as follows:
4.1. COMPLETENESS 45
These are all the ingredients require for a model, so the job of defining one
is complete. The remaining job is to demonstrate that it does what we want.
R EMARK 85. Note that we have used the constant symbols themselves to
form the domain. The symbols are objects too, so there is nothing wrong
with doing this.
tion technique for tableau, we noted that it worked in specific cases, but we
didn’t really prove that it worked. That is what we’re going to do now.
So our goal is to show that ¬ϕ is true in MB . It’s hard to know how we’d get
straight to such a fact. However, our construction of MB leads to a fact and
a reasonable hypothesis:
e
tence will be true in MB . We shall check this again later, but you
should see that this is just what we’ve ensured by our definition of
nl
the model MB .
• HYPOTHESIS: Perhaps all of the sentences on B are true in MB .
O
We might suppose that the hypothesis is correct given the way that the rules
for the construction of a tableau work. Thus we might propose the following:
Moreover, the way in which the tableau is constructed might hint at a kind
of inductive flavour.
c Toby Meadows
formulae in stages (as we did in Week 1) does not work. In the remainder of
this subsection, I will:
(3) complete the proof of the lemma on the basis of the alternative con-
in
struction.
So suppose we try to use the stage construction from Week 1. Here then is
how the proof might go:
O
(Base) If ψ is atomic and on B, then ψ is of the form Ra1 , ..., an for some n-ary
relation symbol R and constant symbols a1 , ..., an . Then we have
B B B
Ra1 ...an is on B ⇔ haM M
1 , ..., an i ∈ R
M
⇔ MB |= Ra1 ...an
The first ⇔ follows from the definition of MB ; and the second, from the
definition of |=.
R EMARK . So clearly the atomic case works. Let’s try the induction step.
formulae of complexity ≤ n.
.1 f
t
this we consider all of the forms of formulae that could be constructed from
v1 ra
Suppose ψ := χ ∧ δ is on B where χ and δ have complexity ≤ n. Then by the
rules for construction of tableau, both χ and δ occur on B. By our induction
hypothesis, we see that MB |= χ and MB |= δ; and thus by the definition of
|=, we get MB |= χ ∧ δ.
D
R EMARK . Thus the induction step works for conjunction. Perhaps unsur-
prisingly, the problem crops up with negation.
But then what? We cannot make use of the induction hypothesis: it only
in
Fortunately there is a way around things. To get the idea, we might look to
how the case for conjunction worked:
O
(1) We used the tableau rules to observe that less complex sentences
where already on B; and
(2) From there we employed the induction hypothesis and the satisfac-
tion definition.
4.1. COMPLETENESS 48
We were held up because we couldn’t get to another fact about what was
already on B.
We then observe that:
• use of the tableau always takes from facts about what is on B to less
complex things on B; and
• every sentence ψ has the form of the top sentences in one of the
tableau rules.
The first of these suggests that if we only considered sentences of the form
given in tableau rules, our induction would not get stuck. The second sug-
gests that we may be able to define all of the well-formed formulae using
just the forms given in tableau rules. It turns out that this is correct.
We now provide an alternative stage-by-stage construction of W F F and then
c Toby Meadows
show that the kind of complexity it gives, will get us through the proof of
Lemma 86. .1 f
t
Let us define our stages as follows:
ra
• StageW F F + (0) is the set of formulae of the form Rt1 , ...tn or ¬Rt1 , ..., tn
where R is an n-ary relation symbol and t1 , ..., tn are terms of the
language (these formulae are sometimes know as literals);
• StageW F F + (n + 1) is the set of formulae
D
SentW F F + (n);
– ¬(ϕ ∧ χ), ¬(ϕ ∨ ψ), ¬∀ϕ(x) or ¬∃xϕ(x) where ¬ϕ and ¬ψ are in
SentW F F + (n); and
– ¬(ϕ → ψ), ψ → ϕ where ϕ and ¬ψ are in SentW F F + (n).
e
in
We shall then say that the +-complexity of some ϕ is the least n such that
ϕ ∈ StageW F F + (n).
nl
R EMARK 87. Observe that in the first condition in the induction step, each
formula is of the form of the top formulae in a tableau rule. This is where
O
I took them from. You should figure out which rules give rise to to which
clauses in the definition above.
F ACT 88. ϕ is a well formed formula (ϕ ∈ W F F ) iff there is some n such that
ϕ ∈ StageW F F + (n).
With this in hand, we are finally ready to complete the proof of Lemma 86,
which we restate for convenience.
L EMMA . 86 If ψ is on B, then MB |= ψ.
⇔ MB |= Ra1 ...an
definition of |=.
.1 f
t
The first ⇔ follows from the definition of MB ; and the second, from the
v1 ra
(Induction Step) Suppose that for all sentences χ of +-complexity ≤ n we
have established that:
• if χ is on B, then MB |= χ.
D
.1 f
t
4.2. Soundness
M |= ψ.
v1 ra
Then provided there are still rules left to apply, there is some extension B 0 of
branch B in T and expansion M0 of M such that for all ψ on B 0
M0 |= ψ.
D
(∨) Suppose B continues with an application of the (∨) rule. Then B splits
into a χ path and ψ path; and χ ∨ δ occurs at some earlier stage on B. By the
O
(∃) Suppose B continues with an application of the (∃) rule. Then, by the
tableau rules, the next sentence on Bn+1 is something of the form ϕ(a 7→ m)
where a does not occur in any sentence already on B; and ∃xϕ(x) occurs on
B at some earlier stage. By the hypothesis, we have M |= ∃xϕ(x), so there is
some m ∈ M such that M+ |= ϕ(m 7→ x). Let M0 an interpretation of L ∪ {a}
such that aM = m. Then M0 |= ϕ(a 7→ n) as required.
(∀) Suppose Bn continues with an application of the (∀) rule. Then ∀xϕ(x)
occurs on Bn at some earlier stage and the next sentence on Bn is something
of the form ϕ(a) for some constant symbol
In either case, by the hypothesis, we then have that M |= ∀xϕ(x) and thus
c Toby Meadows
M |= ϕ(a 7→ x) for any constant symbol of the language. In the former case,
.1 f
t
we let M0 = M and we are done. In the latter case, we let M0 be a model of
the language L ∪ {a} such that aM = m from some arbitrary m ∈ M . Then we
have M0 |= ϕ(a 7→ x). The cases for (¬∀) and (¬∃) are left as exercises.
v1 ra
L EMMA 90. Suppose M |= ¬ϕ. Then there is an open branch in the tableau T
for ϕ.
D
To construct the open branch we commence the tableau in the usual way
by placing ¬ϕ at the top of the tableau. To find the next stage of the branch
e
we apply the Branch Extension Lemma (89). To find the stage after than we
in
apply the Branch Extension Lemma again and so on. We stop if there are
no more rules left to apply and if this never happens we keep going (thus
nl
system of stages.
Now we show that the branch B resulting from this process is open. Suppose
not. Then B must be closed. Thus at some (finite) stage, say Bn , in the
construction of B we must have both ψ and ¬ψ on Bn . But our use of the
4.2. SOUNDNESS 53
.1 f
t
v1 ra
in D
e
nl
O
4.3. EXERCISES 54
4.3. Exercises
E XERCISE 92. Suppose we are have a language L with two single place re-
lation symbols P and Q; and one constant symbol. Write out the sentences
from the first 3 stages of StageW F F + noting which label each sentence comes
from.
E XERCISE 94. Finish the rest of the cases from the proof Lemma 86.
Completeness 2
Goals:
• Prove the soundness of the natural deduction proof system.
• Prove the completeness of the natural deduction proof system.
1
T HEOREM 97. Γ `N at ϕ iff Γ |= ϕ.
The (→) direction is known as soundness; and the (←) direction is known as
c Toby Meadows
completeness.
This theorem is know as strong completeness, since we are permitted to use
a set of sentences Γ from which to derive ϕ.
.1 f
t
v1 ra
5.1. Soundness
are trying to show that when we construct a proof, the rules of our natural
deduction system don’t get us into any trouble: they don’t derive things that
aren’t consequences.
Now given that we construct proofs in a stage-by-stage kind of fashion, this
suggests that we might use induction to prove this theorem. We want to
demonstrate a fact about all derivations so we might figure out a way of
e
defining the derivations in a stage-by-stage way and then use our induction
in
mulae. We need something different. But the required notion is not difficult
to think up. We just need to think about how a derivation is constructed
O
5.1.2. Proof.
1
We shall omit the N at for the remainder of this week’s notes.
55
5.1. SOUNDNESS 56
Now it’s easy to see what to use for the rules (2.). We are just going to use
the rules of the natural deduction system.
For example, suppose we had derivations of Γ ` ϕ and ∆ ` ψ. Then using
the (∧-I) rule we can clearly get a derivation of Γ, ∆ ` ϕ ∧ ψ. All we are
saying here is that we may put together the derivation dϕ of Γ ` ϕ and the
c Toby Meadows
derivation of dψ ` ψ such that one is above the other. Then the final lines
t
of each derivation can be put together using (∧-I) to get a derivation of ϕ ∧ ψ
from assumptions in Γ, ∆.2 Write this out in the Lemon style to convince
.1 f
yourself of this fact and to get more familiar with the notation.
v1 ra
Similarly, given a derivation of Γ, ϕ ` χ and a derivation of Γ, ψ ` χ, we may
use the (∨-E) rule to construct a derivation of Γ, ϕ ∨ ψ ` χ. Again, write out
the form of this derivation to convince yourself this is correct.
D
This tells us how we may move from one stage of our construction to another,
but what is our base or atomic case. Again the obvious things works. The
simplest derivation is simply the derivation of ϕ from the assumption ϕ itself.
This is the first line of any derivation. We may write this as {ϕ} ` ϕ.
Now let us formally define a derivation in stages as follows. We let StageDer (n)
e
• StageDer (1) is the set of all derivations of the form {ϕ} ` ϕ for some
sentence ϕ of our language; and
nl
We then say that d is a derivation if there is some n such that d ∈ StageDer (n).
Alternatively and equivalently (as we saw in Week 1), we may define a deriva-
tion as follows:
• if d is of the form {ϕ} ` ϕ, then d is a derivation;
• if dϕ is a derivation of Γ ` ϕ and dψ is a derivation of ∆ ` ψ, then the
derivation d formed by combining dϕ and dψ using (∧-I) is a derivation
of Γ, ∆ ` ϕ ∧ ψ;
• ... add a case for each rule for the construction of derivations
(see Exercise 110) ...
• nothing else is a derivation.
With this method of building up derivations using rules we are ready to use
the induction principle to complete a proof about all derivations and how
they preserve truth.
c Toby Meadows
[Link]. Showing that the rules preserve truth. We first note the follow-
significant.
.1 f
t
ing simple (but important fact) which will be helpful in the proof and also
v1 ra
P ROPOSITION 98. (Monotonicity) If Γ ` ϕ and ∆ ⊇ Γ, then ∆ ` ϕ. Moreover, if d
is a derivation witnessing that Γ ` ϕ, then d also witnesses that ∆ ` ϕ.
we show that “atomic” derivations uphold our goal fact and that construc-
tions of new derivations based on the rules also uphold our goal fact.
nl
0
aM be some arbitrary other m0 from the domain M . Since Γ does not contain
in
any sentence with the constant symbol a in it, it is obvious that M0 is still a
model of all of Γ.4 Thus M0 |= ϕ(a).
nl
But the fact that all models M0 whose only difference from M is their inter-
pretation of the symbol a are such that M0 |= ϕ(a) just means that:
O
∀m ∈ M M+ |= ϕ(m) ⇔ M |= ∀xϕ(x).
3
Observe that I am using both interpretations of the |= symbol here. One represents the
satisfaction reading and the other is giving us the consequence reading.
4
Why is it clear? See Exercise 111.
5.1. SOUNDNESS 59
(∨-E) This one is a little more complicated since we have more plugging-in
involved in (∨-E). Suppose:
• dϕ is a derivation of Γ, ϕ ` χ;
• dψ is a derivation of ∆, ψ ` χ; and
• dϕ∨ψ is a derivation of Ξ ` ϕ ∨ ψ.
which are all members of stage n. Then, the (∨ − E) rule tells us that the
n + 1th stage contains a derivation d of Γ, ∆, Ξ ` χ. We must show that that
Γ, ∆, Ξ |= χ.
It will actually suffice to show that Γ, ∆, ϕ ∨ ψ |= χ since if M |= γ for all
γ ∈ Γ ∪ ∆ ∪ Ξ, then M |= γ for all γ ∈ Ξ. Then since dϕ∨ψ is a derivation of
less complexity (i.e., a member of the nth stage) we see that Ξ |= ϕ ∨ ψ. Thus
M |= ϕ ∨ ψ and M |= χ, which is what we need to show.
c Toby Meadows
(1) Γ, ϕ |= χ; and
.1 f
t
v1 ra
(2) ∆, ψ |= χ.
R EMARK 100. Note how this move relies on the assumption that a is not
free in ∀xϕ(x). If it had been, it would end up being bound by the universal
quantifier in the move we make here and we wouldn’t really have ∀xϕ(x) in
e
such a case. For example, if we’d let ϕ(x) be x = a, then we would have
in
0
|= ϕ(a); i.e., every M is such that M |= a = a. Thus every M0 where aM 6= aM
is such that M |= a = a. However, this only tells us that
nl
∀m ∈ M + M |= m = m ⇔ M |= ∀x(x = x).
O
5
Observe that we actually employed a version of the rule (∨-E) in the metalanguage of our
proof, when took up the two suppositions: first, that ϕ is true in M; and second, that ψ is
true in M. This almost circular feature is a characteristic of soundness proofs.
5.2. COMPLETENESS 60
5.2. Completeness
5.2.1. Strategy. At a high level, we are taking the fact that there is no
proof of ϕ from assumptions in Γ and using that fact to make a set of sen-
tences which describes a model in which Γ ∪ {¬ϕ} is true.
As in the previous week, our strategy can be described as follows:
t
[Link]. The special set. In the tableau case, we had an obvious way of
construction a special set: we used the sentences from an open branch.
.1 f
With the natural deduction system, there is no obvious counterpart. We
v1 ra
do not have a canonical means of generating counterexamples with natural
deduction: the system only gives us a means of proving things.
So what can we do? This is our position:
D
could keep on adding more sentences until we did have such a description.
in
we can. By “can” let us mean we add any sentence that is consistent with
Γ ∪ {¬ϕ}. If, on the other hand, we added a sentence ψ to the set which was
O
inconsistent with Γ ∪ {¬ϕ}, then we would know (by soundness) that there
was no model of Γ ∪ {¬ϕ, ψ}. So we certainly don’t want that.
We have no reason to think that adding sentence which are consistent will
stop us from being able to find a model; indeed, by adding sentences which
5.2. COMPLETENESS 61
are consistent with Γ ∪ {¬ϕ}, we hope to be able to pin down one particular
model.
Intuitively speaking our process will be to start with the set Γ ∪ {¬ϕ} and add
as many sentences consistent with it as we can. Such a set will be called
maximal consistent.
D EFINITION 101. A set of sentences ∆ is maximal consistent if:
• ∆ is consistent; and
• if ϕ ∈
/ ∆, then ∆ ∪ {ϕ} is not consistent.
t
A complete set of sentences ∆ is going to be useful for describing a model,
v1 ra
just as with a model M we have M |= ϕ or M |= ¬ϕ for all sentences ϕ
we have ϕ ∈ ∆ or (¬∆). This bivalence-like property gives us, intuitively
speaking, the sufficiency of information to define the model.
T HEOREM 103. If ∆ is maximal consistent, then ∆ is complete.
D
Now we suppose for reductio, that both ϕ and ¬ϕ are not in ∆. By the claim
O
So this is a good start for our special set of sentences ∆. But there is
something else we need. In a similar fashion to the completeness proof for
tableau, we are going to use the constant symbols occurring in sentences of
the set to form our domain.
Now suppose we have the following situation. For some sentence ϕ := ∃xψ(x)
we have:
• ∃xψ(x) is in ∆; but
• for all a ∈ M ∆ (our domain of constant symbols) (¬ψ(a)) ∈ ∆.
There’s something clearly wrong with this. If it’s truth that there is a ψ, then
something from the domain had better be an a.
Now if we only restrict ourselves to consistent extensions of Γ ∪ {¬ϕ}, then
we cannot avoid this problem. To see this observe that there is no way of
c Toby Meadows
• ∃xψ(x); and
• ¬ψ(a) for all a ∈ M ∆ .
.1 f
t
We’ll simply never get into a position where the consistency constraint could
v1 ra
(in general) block the problem.
The simple condition is to add a further condition on the set ∆. We demand
that every existential sentence gets a witness; or more formally:
D
set. Again using the techniques of Week 1, we are going to build up this set
by recursion in stages.
in
We first take an enumeration (ϕn )n∈ω = ϕ1 , ϕ2 , ..., ϕn , .... of all the sentences
from L(C).
nl
R EMARK 104. Observe that we are always able to find a new constant symbol
since there are infinitely many of them and at any stage of the construction
we have only used finitely many.
∆ is then our special set. We then verify that ∆ is indeed maximal consistent
and is existentially witnessed.
In case (i), we see that by how we defined the stage construction that we
only have
Stage∆ (n + 1) = Stage∆ (n) ∪ {ϕn+1 }
when Stage∆ (n) ∪ {ϕn+1 } is consistent. This means that Stage∆ (n + 1) is con-
sistent after all.
e
In case (ii), we see that ϕn+1 must be of the form ∃xψ(x). Supposing that
in
from Stage∆ (n) ∪ {ϕn+1 }. By the same reasoning as for the case (i), this is a
contradiction and will suffice for the Lemma.
Observe that a does not occur in Stage∆ (n + 1). Thus D cannot rely on an
assumption in which a occurs free. But this just means that we can employ
5.2. COMPLETENESS 64
[Link]. Defining the model. We now use ∆ to define a model. We let the
language be L(C).
Let M∆ be such that:
• M ∆ (the domain) is the set of constant symbols a occurring in sen-
tences in ∆;
• for each constant symbol a, let aM = a (i.e., itself);
• for each n-ary relation symbol R of L(C), let RM be the set of n-tuples
ha1 , ..., an i such that Ra1 , ..., an is in ∆.
c Toby Meadows
R EMARK 108. Observe that we have an “iff” here, as opposed to the “if ...,
then ...” from the tableau completeness proof.
D
The first ⇔ is via our claim; the second ⇔ is by induction hypothesis; and
the last ⇔ is from the |= definition.
c Toby Meadows
Suppose ψ := ∃xχ(x). Then we claim that ∃xχ(x) ∈ ∆ iff there is some con-
stant symbol a in L(C) such that χ(a) ∈ ∆. Suppose ∃xχ(x) ∈ ∆. Then
by construction of ∆ (i.e., since it is existentially witnessed) there is some
a ∈ L(C) such that χ(a) ∈ ∆. On the other hand if for some a ∈ L(C), χ(a) ∈ ∆,
then by Claim 109 and (∃-I), ∃xχ(x) ∈ ∆. Then we have
e
The first ⇔ came from our claim; the second ⇔ was via the induction hy-
pothesis; and the final ⇔ was via the |= definition.
O
5.3. Exercises
E XERCISE 110. In Section [Link], our second definition has not been com-
pleted. Complete the definition by adding the appropriate clauses for each
of the other rules in the system.
E XERCISE 111. In the proof of Theorem 99, we make a claim about some-
thing being obvious (there is a footnote highlighting this). Establish the
claim.
E XERCISE 112. Complete the rest of the cases in the proof of 99.
E XERCISE 114. Explain why there is no derivation of ⊥ from the set consist-
ing of:
c Toby Meadows
• ∃xψ(x); and
• ¬ψ(a) for all a ∈ M ∆ .
.1 f
E XERCISE 115. In your own words: t
v1 ra
(1) Explain what the completeness theorem says.
(2) Explain why is interesting and important.
(3) Explain how we proved it.
D
E XERCISE 117. Complete the rest of the cases for the proof of Theorem 107.
e
in
nl
O
CHAPTER 6
Model Theory
Goals:
is some d ∈ D such that σ(d) = c. In other words, the map σ exhausts its
codomain. (Sometimes such maps are called onto.)
in
different object in the codomain. (Sometimes such maps are called one-to-
one.)
O
1
Note that there is no requirement that every object in C the result of σ’s application to
some object d ∈ D. Some c ∈ C may be missed, as it were.
67
6.1. ISOMORPHISM AND ELEMENTARY EQUIVALENCE 68
D EFINITION 118. Let us say that models M and N are isomorphic, abbrevi-
ated M ∼= N , if there is a map σ between M and N (their respective domains)
such that:
• σ is bijective;
• for every constant symbol c from L, we have
σ(cM ) = cN ;
We shall write σ : M ∼
t
= N to indicate that σ is the map described above which
.1 f
witnesses the isomorphism.
v1 ra
R EMARK 119. There is a sense in which isomorphic models are basically
the same. The only thing that distinguishes two isomorphic models is the
material from which they are constructed. However, from the point of view
D
of the language L and what we can express in it, this kind of difference is
invisible, or perhaps better, ineffable.
M |= ϕ ⇔ N |= ϕ.
nl
Thus two models are elementary equivalent, they make exactly the same
O
sentences true.
t
T HEOREM 121. (Compactness) If Γ is finitely satisfiable, the Γ is satisfiable.
.1 f
v1 ra
In other words, if every finite subsets of Γ has a model, then so does Γ itself.
Week 2. For convenience, let’s assume that we have a constant symbol for
every natural number. It could just be our everyday Arabic representation of
O
it. So strictly speaking we have expanded the language of arithmetic and its
standard model to accommodate all these new constant symbols. We shall
only take this approach in this section.
Another definition is helpful at this point.
6.2. THE COMPACTNESS THEOREM 70
D EFINITION 122. Given a model M, let the theory of M, T h(M) be the set of
sentences from L which are true in M.
σ(0M ) = 0N
σ(1M ) = 1N
e
..
in
.
σ(nM ) = nN
nl
..
. .
O
But since M is such that for all n, M |= c 6= n, there is no place for σ to map
cM to in N. Thus σ fails the condition on constant symbols and M ∼ = N.
We now consider some relationships between models which involve less sim-
ilarity. For simplicity, we shall only consider a language with function sym-
bols.
domain M of M.
We now consider the embedding relationship.
.1 f
t
D EFINITION 126. Let N and M be models of some language L. We say that
f embeds N into M, if there is some M0 ⊆ M such that f : N ∼
= M0 ; i.e., N
v1 ra
is isomorphic to a submodel of M.
6.3.1. Putting these notions to work. We now ask ourselves about the
D
• M = {a, b};
in
• P M = ∅ (i.e., P M = {});
• QM = {a, b};
• N = {a, b, c};
nl
• P N = {a}; and
• QN = {a, b};
O
Clearly M ⊆ N .
Consider the sentence ∃xP x. Clearly this sentence is true in N : there is
some n ∈ N (i.e., a) such that n ∈ P N . However, it is not true in M.
6.3. SUBMODELS & EMBEDDINGS 72
ϕ is of the form ∀xψ(x) where ψ(x) is a formula with at most one free variable,
x, containing no quantifiers.
.1 f
T HEOREM 128. SupposeM ⊆ N . Then, t
v1 ra
(1) If ϕ is Σ1 and M |= ϕ, then N |= ϕ;
(2) If ϕ is Π1 and N |= ϕ, then M |= ϕ.
D
L EMMA 129. Let ψ(x) be a formula without quantifiers with one free variable
and let M ⊆ N . Then let L(M ) be the expansion of L with constant symbols
for every member of M and M+ and N † be the appropriate expansions of M
and N . Then for all m ∈ M we have
e
M+ |= ψ(m) ⇔ N † |= ψ(m).
in
2
nl
P ROOF. It should be clear that the formulae of L(M ), which do not involve
quantification can be build up inductively in stages by simply omitting the
O
(Base) Suppose that ψ(x) is atomic. For example, let ψ(x) be Rxc1 ...cn . Take
an arbitrary m ∈ M . Then we have
⇔ hmN , cN N
1 , ..., cn i ∈ R
N
⇔ N + |= Rmc1 ...cn .
The first and third ⇔ are by the satisfaction definition; and the second ⇔
follows from the fact that M+ ⊆ N † .
(Induction step) To save space, we just work through the case for ¬ and ∧.
Suppose ψ(x) is of the form ¬χ(x). Then taking arbitrary m ∈ M , we have
M+ |= ¬χ(m) ⇔ M+ 2 χ(m)
⇔ N † 2 χ(m)
c Toby Meadows
⇔ N † |= ¬χ(m).
.1 f
t
We leave the explanation of the steps as an exercise.
Suppose ψ(x) is of the form χ(x) ∧ δ(x). Then taking an arbitrary m ∈ M , we
v1 ra
have
⇔ N † |= χ(m) ∧ δ(m).
P ROOF. (of Theorem 128) We let L(M ) be the expansion of L with con-
e
(2.) Suppose ϕ is of the form ∀xψ(x) and N |= ∀xψ(x). Then for any m ∈ M ,
we have N † |= ψ(m) (we actually know something stronger than this, but this
is sufficient). Thus by Lemma 129, we see that for all m ∈ M , M+ |= ψ(m);
or in other words, M+ |= ∀xψ(x).
6.4. BASIC SET THEORY 74
R EMARK 130. So the moral of this story is that for very simple formulae,
• if we find a witness then that witness will still be in the bigger model;
and
• if everything in some domain satisfies the formula then this will still
be the case in a smaller model.
Up until now we have been considering two kinds of models: finite models
and infinite models.
The size of a model is known as its cardinality. So if the domain has five
objects in it, then its cardinality is simply five. And so on for any other finite
cardinality.
When we come to an infinite model, perhaps constructed from an open
c Toby Meadows
D EFINITION 131. Let us say that two collections A and B have the same
cardinality, which we abbreviate A ≈ B if there is some map f : A → B which
is a bijection.
(1) every duck d is such that there is a sheep s for which f (s) = d; and
(2) if s1 6= s2 are different sheep then they are mapped to different ducks
nl
D EFINITION 132. We shall say that collection A has less than or the same
cardinality as B, abbreviated A ≺ B, if there is an injection between A and
B.
6.4. BASIC SET THEORY 75
Thus if in the previous example there had been six ducks, we still could have
got a map with (2.) satisfied, but one duck would have to have been left out.
So we should be able to see that these definitions are in accord with our
intuitions about finite sets, but what about infinite ones. The following fact
should be obvious, but it is instructive to prove it from our definitions.
F ACT 133. Let E be the set of even numbers and O be the set of odd numbers.
Then E ≈ O.
f (2n) = 2n + 1.
c Toby Meadows
f (n) = 2n.
f (m) = e = f (n).
in
6.4.2. Cantor’s theorem - the are larger infinities. We are not ready
to prove that there is more than one size of infinite collection. This is known
as Cantor’s theorem.
The proof doesn’t take that long, but we’ll go through it somewhat informally
to make it as clear as possible.
Suppose we had countably many one pound coins (a pleasant thought) and
we lined them all up in a row. Each coin would either be heads-up or tails-
up. Remember that since we have countably many coins, this means we
can enumerate them with a function from N to the coins. Let us call this
function c.
We may then represent this situation in a table as follows:
c(0) c(1) c(2) c(3) c(4) c(5) c(6)
H H T H T H H ...
c Toby Meadows
Now of course there are different ways that the coins could have been laid
out. For example we might switch the third coin c(2) from tails to heads.
.1 f
t
Let us then consider the table which would result by placing each different
arrangement of the coins in new rows of the table. Thus we get something
v1 ra
like:
c(0) c(1) c(2) c(3) c(4) c(5) c(6) ...
H H T H T H H ...
T T T T T T T ...
D
H T T H T T H ...
T H T T T H H ...
.. .. .. .. .. .. .. ...
. . . . . . .
We won’t worry about the order in which the rows are filled in. We just want
to ensure that every (infinite) arrangement of heads and tails is represented
e
Now our claim is that there are more rows than there are columns. Since
there are infinitely many columns, this will suffice to show that there is more
nl
know that the columns are countable, it will suffice to show that the rows
are not countable. In order to do this, we must show that there is no bijective
function r from the naturals to the rows, which provides an enumeration of
them.
6.4. BASIC SET THEORY 77
We shall demonstrate this by reductio. Thus, suppose that there was such
an enumeration. Let us call it r. We might then represent this situation as
follows:
c(0) c(1) c(2) c(3) c(4) c(5) c(6) ...
r(0) H H T H T H H ...
r(1) T T T T T T T ...
r(2) H T T H T T H ...
r(3) T H T T T H H ...
.. .. .. .. .. .. .. ..
r(4) . . . . . . . .
To show that r cannot enumerate all of the rows, we are going to construct
a row r† that the enumeration r must miss. This is an arrangement of the
coins.
We let r† be the row constructed by flipping every coin down the diagonal of
c Toby Meadows
r(0) T H T
.1 f
H T H H ...t
c(0) c(1) c(2) c(3) c(4) c(5) c(6) ...
v1 ra
r(1) T H T T T T T ...
r(2) H T T H T T H ...
r(3) T H T H T H H ...
.. .. .. .. .. .. .. ...
r(4) . . . . . . .
D
Now if r† was in the enumeration, then there would have to be some n such
that r(n) = r† . But this is not possible. We have defined r† so that it is differ-
in
ent from every r(n) at exactly one place. Thus there can be no enumeration
of the rows and there is a infinite cardinality which is not countable. We call
nl
R EMARK 135. More informally, we observe that if there had been the same
number of rows as columns, then the table above would be an infinite
square. We have shown that there must always be an extra row beyond
this.
6.5. LÖWENHEIM-SKOLEM THEOREMS 78
[Link]. This also tells us ... Consider each of the rows of the table. There
is a sense in which each of them represents a particular subset of the natu-
ral numbers.
For example,
c(0) c(1) c(2) c(3) c(4) c(5) c(6)
r(0) H H T H T H H ...
the 0th row could pick used to pick out the set
{0, 1, 3, 5, 6, ...}.
We simply take the set be numbers of those coins which are facing heads-
up. Moreover it should be clear that every set of natural numbers will be
represented by exactly one of these rows.
Thus we have shown:
c Toby Meadows
C OROLLARY 136. There are more sets of natural numbers than there are nat-
ural numbers.
.1 f
t
ra
Moreover, it is possible to represent any real number by an infinitely long
decimal number. We might then replace the coins in the example by a 10-
sided dice. Then each of the rows could represent a real number between 0
and 1. We can then perform much the same trick as before to show that:
D
F ACT 137. There are more real numbers than natural numbers.
v1
The sizes of sets does not stop here either. We can repeat a (slightly more
general) version of our argument above with the coins to get a collection
which is even larger than the sets of all sets of natural numbers. Indeed we
can repeat this indefinitely.
e
A full discussion of this topic would open us up in to the world of set theory
in
But we are going to return to our discussion of models and consider what
impact cardinality has upon it. Our target question here is going to be:
• Given a theory T (i.e. a set of sentence) which has a model M will
there be other models N which have different cardinalities?
6.5. LÖWENHEIM-SKOLEM THEOREMS 79
The answer to this question comes in two theorems which show that in
terms of cardinality, there is a massive amount of freedom here.
In other words, given a model M of some theory and any larger set A, we
c Toby Meadows
6.6. Exercises
E XERCISE 141. If M ≡ N , what can you say about T h(M) and T h(N )?
E XERCISE 143. Explain how each of the ⇔’s are justified in Lemma 129.
E XERCISE 144. Show using counterexamples that Theorem 128 would have
failed if we had used arbitrary sentences beginning with ∃ and ∀ respectively.
c Toby Meadows
t
consequence relation; i.e., if Γ |= ϕ, then ϕ ∈ Γ. Suppose Γ and ∆ are both
theories. For each of the following statements, either prove it or refute it
.1 f
with a counterexample:
v1 ra
(1) {ϕ | ϕ ∈ Γ ∨ ϕ ∈ ∆} is a theory; and
(2) {ϕ | ϕ ∈
/ Γ} is a theory.
D
first order logic we can also show that it has a countable model. What is
in
going on here?
nl
O
Part 2
.1 f
t
v1 ra
inDe
nl
O
CHAPTER 7
Recursion theory 1
In the first half of the course, we almost ignored the case of functions when-
ever they were distracting. In this half of the course, functions are going to
play the starring role.
Recursion theory is the study of functions which are computable. Infor-
mally speaking, these are the functions which we compute in the sense that
given the inputs of the function there is some set of rules for the calcu-
lation/construction such that after a finite amount of time (and perhaps
c Toby Meadows
D EFINITION 148. An algorithm is simply a set of rules which govern the way
we perform some calculation.
the calculation for which it provides instructions. For example, consider the
function of addition. There may be many different ways (i.e., algorithms) of
calculating that function, but the function itself (i.e., addition) remains the
nl
same.
A Turing machine give us a canonical way of recording those instructions.
O
• Image that you have an infinitely long piece of tape that is divided
up into squares which we call cells.
82
7.1. ALGORITHMS & TURING MACHINES 83
At a particular state it will be read what is on the cell below it and depending
on what the cell has in it, the machine must:
.1 f
• move either one cell to the left or right; or t
• place a 1 in the cell below or make it blank; and then
v1 ra
A calculation will terminate or halt when the instructions do not have any-
thing more for it to do.
An example will probably provide the easiest way to see how this might work.
D
E XAMPLE 149. Let us suppose that our tape is such that the only non-blank
cells are a finite string of 1’s, of say length 4 and that the head of the Turing
machine sits under the leftmost 1.
1 1 1 1
qˆ1
e
This gives us the initial condition of the tape. Now let us define an algorithm
in
which the Turing machine will perform. Let us say that we want to make
the tape blank. What needs to happen?
nl
Essentially, we need to move along to the right blanking out all of the ones.
After that we can stop. So let us propose the following instructions:
O
1
qˆ1
.1 f
qˆ1 t
v1 ra
qˆ2
Now at the final line, observe that head is in stage q2 . However, we do not
D
• q1 − −Lq2 .
We shall continue to adopt this system when describing Turing machines.
t
the tape. And if n is the output of the function, let us represent this fact by
having the head of the machine come to a halt over the leftmost 1. Thus if 3
.1 f
were the output of some machine, then this would be represented as:
v1 ra
1 1 1 1
qˆ1
Now say that we wanted to define a function which added two numbers
D
together. We then need to able to present more than one number to the
Turing machine. To represent some n-tuple hm1 , ..., mn i, we shall place
• m1 + 1 many 1s
• followed by a blank
• and then
• m2 + 1 many 1s
e
• ...
• finally mn + 1 many 1s
nl
qˆ1
where the calculation begins in state q0 .
E XAMPLE 150. (+1) This function takes a number and adds 1 to it.
7.1. ALGORITHMS & TURING MACHINES 86
• q1 11Rq1
• q1 − 1Lq2
• q2 11Lq2
• q2 − −Rq3
The idea is that we go to then end of the row, add a new one and then turn
back.
E XAMPLE 151. (m + n) This function takes two values and returns their sum.
• q1 11Rq1
• q1 − 1Rq2
• q2 11Rq2 2
• q2 − −Lq3
• q3 1 − Lq4
c Toby Meadows
• q4 1 − Lq5
• q5 11Lq5
• q5 − −Rq6
.1 f
t
The idea here is that we go through the tuple changing the blank between m
v1 ra
and n into a one. Then we reach the right end, pull two 1’s off it and return
to the left.
Instead of writing qn 1 − qm , we shall now write: n 1 - m. Call this streamlined
D
notation.
E XAMPLE 152. This function takes a number n and returns the tuple hn, ni.
111R1
1--L2
211L3
e
311R4
in
41-R5
5--R6
nl
6-1L7
7--L7
O
711L8
811R9
9 1 - R 10
7.2. GÖDEL’S SCHEMA 87
10 - - R 10
10 1 1 R 11
11 1 1 R 11
11 - 1 L 12
12 - - L 12
12 1 1 L 13
13 1 1 L 13
13 - - L 7
8 - - R 14
14 1 1 R 14
14 - 1 R 15
15 - 1 R 15
c Toby Meadows
15 1 1 L 16
16 1 - R 17
17 1 1 R 17
.1 f
t
v1 ra
17 - 1 L 19
19 1 1 L 19
19 - - L 20
D
20 1 1 L 20
20 - - R 25
3 - - R 25
The idea here is basically a lot of zig-zagging.
e
in
functions.
The next approach was developed by Gödel. It is much easier to define
function using this technique, although the relationship with the intuitive
notion of computability is probably less obvious.
7.2. GÖDEL’S SCHEMA 88
It will turn out that each of these methods of describing algorithms is able
to produce the same function.
This time we are going to build up algorithms using:
Any function that can be defined in this way is said to be a recursive func-
tion.
This should be familiar. This is another example of a definition by recur-
sion, although the sense of recursion is slightly different in the case of the
definition.
c Toby Meadows
that it may not be defined for every natural numbers (n-tuple of natural
numbers); i.e., its domain may be a proper subset of ω (dom(f ) ( ω).
We shall call the functions defined using the schema below, Gödel recursive
functions.
(1) The zero function, z m : ω m → ω is such that z m (hn1 , ..., nm i) = 0 for all
e
n1 , ..., nm , m ∈ ω.
in
None of these function is particularly exciting. They are just the basic cases.
7.2.2. Rules for making new functions. There are three processes for
taking recursive function and constructing more complex recursive func-
tions:
(1) Composition;
(2) Primitive recursion; and
(3) Minimisation.
[Link]. Composition. Suppose we have Gödel recursive f : ω m + and
g1 , ..., gm : ω k + ω. Then there is a Gödel recursive function h : ω k + ω such
that
R EMARK 153. The idea of this function is that it allows us to compose func-
c Toby Meadows
tion so that we may apply the result of a function the result of another
function. .1 f
t
[Link]. Primitive recursion. Suppose we have Gödel recursive f : ω m + ω
and g : ω m+2 + ω. Then there is a Gödel recursive function h : ω m+1 + ω such
v1 ra
that
This one arguably looks more complicated than it really is. An example
might help.
E XAMPLE 154. Let’s define addition. First we observe the following facts
e
about addition:
in
0+n = n
nl
(k + 1) + n = (k + n) + 1.
O
Both of these should be obvious. Moreover, we see that this is quite close to
the form that we have above. The main thing we need is a function which
takes a number an adds 1 to it. And we have one of these: the successor
function. So we get something like this.
7.2. GÖDEL’S SCHEMA 90
Any function that can be described from the basic functions using these
rules is a a Gödel recursive function.
.1 f
t
R EMARK 155. Note that this kind of minimisation is not the one which takes
v1 ra
a tuple hn1 , ..., nk i and returns the least element of that tuple.
E XAMPLE 156. Let’s define the function from Week 1 which took a number n
D
and returned the triangular number with side n. I.e., we want the function
f : ω → ω such that
f (n) = n + (n − 1) + ... + 1.
(We shall take it that f (0) = 0.)
Now we can think of this function as being calculated in stages as follows:
e
in
f (0) = 0
nl
f (n + 1) = (n + 1) + f (n).
This has the right kind of shape for primitive recursion. From here, we can
O
tria(0) = z 0
tria(n + 1) = f (htria(n), ni)
7.2. GÖDEL’S SCHEMA 91
where
f (n, m) = plus(hn, s(m)i).
Note that in defining this function, we have used the function plus which we
have already defined.
pre(0) = z 0
pre(n + 1) = g(hpre(n), ni)
E XAMPLE 158. Let us define a function sub : ω 2 → ω which takes n and m and
c Toby Meadows
E XAMPLE 159. Let’s define the function squ : ω → ω which takes a number
D
02 = 0
and that
(n + 1)2 = n2 + 2n + 1.
e
squ(0) = z 0
nl
.1 f
t
v1 ra
in D
e
nl
O
7.3. EXERCISES. 93
7.3. Exercises.
E XERCISE 163. Step through the first 26 steps of the calculation of the func-
tion in Example 152 given starting condition.
1 1
qˆ1
E XERCISE 164. Write a Turing machine which doubles a number n. Use the
notation system of Example 152. Do not use state 0.
E XERCISE 165. (Harder - well ... tedious) Write a Turing machine which
takes two numbers m and n and returns their product.
E XERCISE 167. Using the result from Week 1, define an alternative algorithm
E XERCISE 169. Using the Gödel notation, describe an algorithm which rep-
D
Recursion theory 2
Last week, we looked at two ways of formalising our intuitive idea of compu-
tation. On the one hand, we looked at Turing machines which were based
on extremely simple rules; and on the other, we looked at the Gödel schema
system which provided an elegant means of representing common functions
from the theory of arithmetic.
c Toby Meadows
To start this week off, we are going to provide an outline of the proof which
t
shows that these two systems are, in some salient sense, equivalent. This
is interesting since it shows us that two, seemingly quite different, means of
.1 f
formalising computation actually end up doing the same thing.
v1 ra
We only provide a sketch because the full details of the proof are quite te-
dious and lengthy.
The first thing we need is a way of comparing the two systems. At face
D
value, this isn’t going to be possible. Turing machines talk about lengths of
tape, while the Gödel schema are concerned with functions on the natural
numbers.
8.1.1. Numbers for Turing machines. Last week, we saw a way of rep-
e
defined using the Gödel schema. Our goal is to find a means of representing
this situation as the starting condition on the tape.
You have probably noticed that constructing Turing machines relies a lot on
counting sequences of blank squares. For example, when we get to the end
94
8.1. EQUIVALENCE OF TURING MACHINES WITH GÖDEL SCHEMA 95
of a tuple representation we can tell that this has occured because we have
more than one consecutive blank square.
With this is mind, we might make a few modications to our representations
of tuples an numbers so that we can get a clearer representation of the
syntax of the Gödel schema.
So first of all, we are going to need some way of representing the primitive
symbols of the Gödel schema. Thus we need ways of representing:
• zm;
• s; and
• πkn .
• composition;
• primitive recursion; and
• minimisation.
.1 f
t
v1 ra
Intuitively speaking, this kind of stuff is obviously different from numbers
and tuples. So it would be convenient if we had a simple way of discerning
the two.
[Link]. A different way of representing numbers and tuples. So our goal
D
here is to make a coding that clearly distinguishes numbers and tuples from
symbols. We are going to make use of multiple blanks for this purpose.
Let us represent a number n on the tape by writing a 1 followed by a blank
and then n + 1 many 1’s after that. So the following diagram represents the
number 2.
e
1 1 1 1
in
qˆ1
Let us represent a tuple of length m by placing a sequence of m number
nl
1 1 1 1 1 1 1
qˆ1
So this makes things a little more complicated for representing numbers,
but in the end it will be easier to represent the Gödel schema.
8.1. EQUIVALENCE OF TURING MACHINES WITH GÖDEL SCHEMA 96
1 1 1
.1 f
t
is no need to deal for further information. Thus we represent it as follows:
v1 ra
qˆ1
And we can represent that function applied to the number 1 as follows:
1 1 1 1 1 1
D
qˆ1
Next we represent the projection function πkn : ω n → ω. We do this by placing
4 1’s on the tape followed by a blank followed by n 10 s followed by a blank
followed by k 1’s. Thus we would represent πk2 (h2, 1i) as follows:
1 1 1 1 1 1 1 1 1 1 1 1 1 1
qˆ1
e
So we now have a way of represting all of the basic function from the Gödel
in
h such that:
h(hn1 , ..., nk i) = f (hgm (hn1 , ..., nk i), ..., gm (hn1 , ..., nk i)i).
such that:
.1 f
t
f : ω m + ω and g : ω n+2 + ω. Then there is a recursive function h : ω m+1 + ω
v1 ra
h(h0, n1 , ..., nm i) = f (hn1 , ..., nm i)
h(hk + 1, n1 , ..., nm i) = g(hh(hk, n1 , ..., nm i), k, n1 , ..., nm i).
followed by:
• m many 1’s followed by 2 blanks; then
• the representation of the function f ; then
• the representation of the function g.
Thus in general, the tape will look like the following diagram.
e
qˆ1
And finally we come to minimisation. Suppose we have a recursive function
nl
• the representation of g.
any function that can be calculated using the Gödel schema. We now have
t
a means of representing any function constructed using the Gödel schema
and in order to present an argument tuple to it, we simply place that tuple
.1 f
two blank cells after the representation of the function.
v1 ra
In order to complete the proof we need to construct a Turing machine which
takes:
• a tuple of numbers,
and then calculates what that Gödel schema algorithm would have done.
So to do this we “simply” need to build a function that will:
tell which part of the Gödel schema has been used. For example, we might
start as follows:
O
111R2
211R3
311R4
8.1. EQUIVALENCE OF TURING MACHINES WITH GÖDEL SCHEMA 99
411R5
511R6
611R7
711R8
8 1 1 R halt ; So we halt if there are more than 7 1’s as we don’t allow for
this in the code.
2 1 1 R halt ; We also halt if there is only 1 1, since then we don’t have a
function code.
3 - - R 31 ; This was the code (i.e. 2 1’s) for the z m function, so we now run
that code.
...
4 - - R 41 ; This was the code (i.e., 3 1’s) for the s function, so we now run
c Toby Meadows
that code.
...
...
.1 f
t
8 - - R 81 ; This was the code for the minimisation function, so now we run
v1 ra
that code.
We now describe how to run the successor function (basically since it’s the
easiest). So suppose we have just gone to state 4 having passed 31’s. We are
D
43 1 1 L 43
in
43 - - R halt ; We reach the end of the 1’s and halt under the leftmost one of
them.
nl
the rest of the tuple. Finally we zig-zag the k th element of the tuple
back to the starting point.
• Composition: We may need some space for this calculation. Thus
for each of the gi where 1 ≤ i ≤ m, we take gi ’s code and a copy of the
tuple n̄ and place them to the right of the initial setup. We then run
gi on n̄. We then leave the output to the right and repeat for each
of the inputs until we have a new tuple. We move this tuple into
position so that we can apply f to it; and we do this.
• Primitive recursion: This is definitely the ugly one. In some sense,
it’s just a more general version of the multiplication algorithm you
have already constructed. Remember that primitive recursion is de-
signed, loosely speaking, so that we can perform k many repetitions
of a certain calculation. Thus we shall keep on, so to speak, unfold-
ing the calculation to the right which will (eventually) reduce the k
c Toby Meadows
t
an output. We then work backwards to the left, putting the input
back through the g function until we get to the beginning again and
.1 f
that gives us our output.
v1 ra
• Minimisation: This time we just keep running the function f on
successively greater inputs. A tally will need to be kept somewhere
to the right on the tape. At each stage we check whether the output
D
is 0. If it is, then the tally is our output and we rearrange the tape
accordingly. If we never reach such a point, then the calculation will
not halt.
Now the full proof of this would take up a great deal more space. Moreover,
I don’t want to trivialise that activity, but (hopefully) you should be able
e
to see that the task can be completed. You should know enough about
in
Turing machines to see that this would be a challenge but one that can be
completed. I won’t set this as an exercise, although it’s certainly a good
thing to try to do at some point.
nl
O
8.1.2. Tapes for Gödel schema. Now we want to show the converse of
the above. We want to show that anything that can be done using a Turing
machine can also be done with the Gödel schema. Again, we’ll only lay the
groundwork for the proof here.
8.1. EQUIVALENCE OF TURING MACHINES WITH GÖDEL SCHEMA 101
10111011
Thus, we take the head and then work our way t the right using a 1 to
represent a 1 on the tape and using a 0 to represent a blank.1 However,
it will actually be convenient to reverse the direction of the representation.
c Toby Meadows
The essential idea we rely on is the following basic fact from number theory:
F ACT 172. Every natural number n is such that it has a unique prime decom-
position; i.e., there is a unique set of prime numbers p1 , ..., pm and k1 , ..., kn ≥ 1
such that:
e
A couple of examples might make this clearer. Consider the number 63. It
should be easy to see that:
nl
63 = 9 × 7
O
32 × 7.
1
Note that we can only represent finite sequences using this technique. To represent infinite
sequences, we’d need the real numbers and we have not designed our Gödel schema to deal
with them.
8.1. EQUIVALENCE OF TURING MACHINES WITH GÖDEL SCHEMA 102
48 = 6 × 8
= 3 × 2 × 23
= 3 × 24
Essentially we go through use the first four prime numbers to code up the
line. It will give us a very big number, but, most importantly, it’s a number
from which we can recover the instructions.
To represent a sequence of lines of code, we simpy repeat the trick. Sup-
pose we have some lines of instructions such that their code is given in the
following table:
e
46 1 2 2 78 c1
67 1 1 1 98 c2
nl
...
98 1 2 1 23 cm
O
So now we have seen two different approaches which formalise our intuitive
(or informal notion) of (effective) computation or calculation. Moreover, we
have seen (at a high level) that these two approaches are actually equivalent.
There have also been other attempts to formalise effective computability.
e
These include:
in
• register machines;
• Markov algorithms; and
O
• combinatorial logics.
We won’t be looking at any of these other systems, although they are easy
enough to find. The interesting thing is that every one of these systems can
be show to be equivalent to every other.
8.2. THE CHURCH-TURING THESIS 104
weeks.
To take an example, however, consider the strings of symbols which we can
nl
form in a finite language and consider how we verify that a such a string is
well-formed or not.
O
Can you think of a pen-and-paper algorithm which would tell you that a
string is well-formed? Hopefully, the answer is yes, but it’s worth thinking
about in detail. In this case, we may use Church’s thesis to assert that
such a function is actually recursive. The more detailed verification of this
8.3. LIMITATIONS IN THE THEORY OF RECURSION 105
fact would involve finding a suitable coding for the strings and then showing
that there is a Gödel schema or Turing machine algorithm which can peform
such a calculation.
F ⊆ ω as follows. We let
n ∈ F ↔ f (n) = 0.
uncountable.
in
gn (m) = f (n, m)
for all m ∈ ω. In other words, for any imput m, gn gives the same output as
f (n, . . . ): they compute the same function.
8.3. LIMITATIONS IN THE THEORY OF RECURSION 106
R EMARK . Observe that the argument used above is basically the same as
the one used in proving Cantor’s theorem. We adjusted the values of the
enumeration function down the diagonal to get a function that could not
e
ϕe (m, n) = m × n
for m, n ∈ ω.
Given that partial recursive functions are not always defined it will be helpful
c Toby Meadows
ϕs ' ϕt if
.1 f
t
D EFINITION 175. Let ϕs and ϕt be partial recursive functions. We say that
v1 ra
• for all m for which ϕs is defined, ϕs (m) = ϕt (m); and
• for all m for which ϕt is defined, ϕs (m) = ϕt (m).
D
So the basic idea here is that we identify two partial recursive function if
they produce outputs for exactly the same domain of natural numbers and
that the produce the same outputs over that domain.
Now we might ask the question: is there a partial recursive function which
enumerates all of the partial recursive functions? In this case the answer is
e
yes.
in
recursive function ϕk (for some k) such that for all ϕe (i.e. partial recursive
functions):
O
ϕk (e, . . . ) ' ϕe .
Or in other words for all m for which ϕe is defined ϕk (e, m) = ϕe (m) and for
other m, ϕk (e, m) is not defined. More formally we might write:
8.3. LIMITATIONS IN THE THEORY OF RECURSION 108
ϕ (m),
e if ϕe (m) halts.
ϕk (e, m) =
undefined, otherwise.
t
otherwise.
undefined, otherwise.
halts.
in
recursive function which can take the code of a partial recursive function
and tell us whether or not the function always halts?
O
Clearly this would be a handy thing to have. Given some set of instructions
(suitably coded) such a function could tell whether or not some programme
would eventually halt. Intuitively speaking, when a computer crashes (or
hangs) this is often because the underlying programme does not halt. It
8.3. LIMITATIONS IN THE THEORY OF RECURSION 109
would be nice to have a special programme that could look at other pro-
grammes and tell you whether or not they hang. This is known as the
halting problem.
Let us call a function f : ω 2 → ω a halt-checker if it takes the codes of partial
recursive functions and tells us whether or not for some input m that partial
recursive function halts on m. More formally,
1 if ϕ (n) halts.
e
f (e, n) =
0 otherwise.
1 if ϕ (e) halts.
e
.1 f f (e) =
t
0 otherwise.
undefined, if f (e) = 1.
ϕk (e) =
0 if f (e) = 0.
nl
Let us see what happens when we present k (the code for ϕk ) to the function
ϕk .
Let us first suppose that ϕk (k) is defined. Then by its definition, ϕk (k) = 0.
Thus f (k) = 0. But this means that ϕk (k) does not halt (by definition of f );
and thus ϕk (k) is not defined. This contradicts our assumption. Thus ϕk (k)
is undefined.
But this means (by definition of ϕk ) that f (k) = 1; and thus by definition of ϕk ,
we see that ϕk (k) halts and is thus defined. This contradicts our assumption
that such a ϕk exists, so there is no such ϕk .
But there was nothing wrong with our definition of the partial recursive ϕk
on the assumption that f is a total recursive function. So our assumption
is wrong; and thus, there is no such total recursive f .
.1 f
t
8.4. Recursive and recursively enumerable sets
n ∈ A ⇔ ϕe (n) halts.
both ϕe (n) and ϕf (n) simultaneously (or perhaps switching back and forth).
Clearly, at most one of them can halt since we cannot have n ∈ A and n ∈ ω\A
(i.e., n ∈
/ A). Moreover, one of the functions must halt, since either n ∈ A or
n∈ / A.
Naturally enough, this might lead us to ask the question: doesn’t the same
apply to recursively enumerable sets? The answer here is no. To see this it
suffices to show the following:
The first ⇔ follows from the definition of ϕj ; the second ⇔ follows from
the definition of K. But this is a contradiction, so there is no such partial
in
recursive function.
nl
R EMARK 181. Note that this proof is very similar to that of Theorem 176.
O
8.5. EXERCISES. 112
8.5. Exercises.
E XERCISE 184. Give a direct Cantorian proof that there are uncountably
many functions f : ω → ω; i.e., use a diagonal argument.
at a time.]
such that:
.1 f
t
E XERCISE 187. Take A ⊆ ω. The characteristic function χA : ω → ω of A is
v1 ra
n ∈ A ⇔ χA (n) = 0.
Show that a set A ⊆ ω is recursive iff ifs characteristic function is total
recursive.
D
E XERCISE 188. Is there a partial recursive function which takes (codes of)
sentences ϕ and returns the value 0 if |= ϕ? How would you show this?
[Please feel free to use Church’s thesis.] What does this say about the set of
valid sentences? What about the set of sentences which are merely satisfi-
able, i.e., 2 ¬ϕ.
e
in
nl
O
CHAPTER 9
Arithmetic
• arithmetic;
• set theory; and
c Toby Meadows
• syntax.
.1 f
t
The axioms are simply sentences of first order logic which:
So we would want our theory of arithmetic to have axioms that are obviously
D
true and which capture everything about the subject matter: arithmetic.
The notion of capturing here is that of proving. We use the axioms as
premises in, say a natural deduction proof. In our informal proof about
triangular numbers in Week 1 we completed our proof on the basis of an
induction axiom and some simple facts about number theory. A good theory
e
would have been able to capture those simple facts and everything else.
in
We are going to learn in the next couple of weeks that the goal (2.) is actually
impossible to achieve in most interesting cases. This phenomena is known
as incompleteness. There are sentences which we can neither prove nor
nl
refute.
O
Before we get into the full detail of this proof, which will take a while, I’ll give
you a quick and simplified sketch of the proof. This will give you an idea of
113
9.2. A SKETCH OF THE INCOMPLETENESS THEOREM 114
the phenomena involved and also allow us to pick out the important parts
of the strategy involved in proving it.
So my goal is to show that there is a sentence γ which I can neither prove
from my axiom system Γ nor refute in it.
But first consider two properties which seem quite clearly desirable for an
axiom system:
• Consistency: we don’t want to be able to prove ⊥ from Γ. Otherwise,
as we know, we could prove anything we liked and the our theory
would not be very interesting.
• Soundness: if we can prove a sentence ϕ, the ϕ is true. Here we are
just saying that if we can prove it then it better not be false. Clearly
a theory of some subject ought to do this.
Now the axiom system Γ that we are going to be concerned with is a theory
c Toby Meadows
t
code up Turing machines using numbers. We can use a similar trick to
code up sentences of arithmetic. Moreover, we shall see today that P E is
.1 f
actually strong enough to represent recursive functions and as we shall see
v1 ra
a predicate B(x) which says, loosely speaking, that x is the code of a provable
sentence. Showing these things is where we need to do most of the work.
However, once these things are established, we can then go on to show
D
that there is a sentence γ which says of itself (in some sense) that it is not
provable. (This is a little like the famous liar sentence: this sentence is not
true.) With this in hand we can complete the argument.
system P E.
in
is a contradiction. Thus P E 0 γ.
Now suppose for reductio that P E ` ¬γ; i.e., ¬γ is a theorem of P E. Then
since P E is consistent γ is not a theorem of P E. But then since P E is
sound, we see that ¬γ is true; and this just says that it’s not the case that
9.3. A THEORY OF ARITHMETIC - P E 115
9.2.2. What we need to formalise it. The argument above is very infor-
mal. Until we’ve seen how the detail works, it could be tempting to see this
as a piece of sophistry. However, it is going to turn out that each of the parts
of the argument can be described very precisely; and thus that the whole
things works.
However, what we do get from the sketch above it a clear list of things we
need to establish:
isn’t true.
∀x∀y(x 6= y → sx 6= sy).
v1 ra
The final axiom is known as an axiom schema. It is actually a representation
of infinitely many axioms, each of which is a substitution of a formula (with
one free variable) from the language of arithmetic.
D
9.3.1. Some simple proofs. As we saw in the first weeks of this module,
numerals like 2 and 63 are not (strictly) part of the language of arithmetic.
However, they are very convenient to use. To facilitate their use we introduce
a metalinguistic function · which takes a number and returns a numeral in
the language of arithmetic. So for example, we have:
e
3 = sss0.
in
n = s....s0
E XAMPLE 189. P E ` 1 + 1 = 2.
Putting this properly into the language we are trying to show that:
s0 + s0 = ss0.
9.3. A THEORY OF ARITHMETIC - P E 117
R EMARK . Observe that in the second use of the identity rules, we substituted
for a subterm of an expression.
c Toby Meadows
ϕ(n) ↔ n + 0 = 0 + n).
D
So once we have shown the first two parts of the antecedent hold, we can
take the consequent of the conditional as our conclusion: which is exactly
e
what we want.
in
Clear we have 0 + 0 = 0 + 0 from the logical rules for identity alone. Now take
an arbitrary x ∈ ω and suppose that x + 0 = 0 + x. Then
nl
sx + 0 = sx
= s(0 + x)
O
= 0 + sx.
The first = exploited axiom (3.); the second exploited our inductive hypothe-
sis; and the third = exploited axiom (4.). This suffices.
9.3. A THEORY OF ARITHMETIC - P E 118
9.3.2. Relating recursion theory back to theories and and logic. Be-
fore we get into the hard work, let’s take a minute to tie some together the
material from this section of the course back to some of the material from
the beginning. We’ll do this with some interesting definitions for theories.
Γ ` ϕ or Γ ` ¬ϕ.
If the goal of our theory is to say everything that we think is true about
some subject matter, then negation completeness is clear a must-have. With
it, any sentence about the subject matter will be such that either it or its
negation will be a theorem. Without it, our theory is incomplete in the sense
c Toby Meadows
that there is a sentence which the theory cannot say anything about.
bers of Turing tapes, but hopefully by now, you could think of some way of
doing this. So let’s exploit Church’s thesis at this point.
Now decidability is clearly a desirable property too. Given any particular
sentence ϕ, decidability tell us that we can tell whether or not ϕ is a theorem;
i.e., there is an algorithm which will terminate after a finite amount of time
telling us that ϕ is either a theorem of Γ or not.
e
in
any of the other sentences may be derived. At the very least, it’s going to be
easier to remember.
Unfortunately, in many interesting cases of theories it is not possible to
get a reasonable theory with only finitely many axioms. Such theories are
9.3. A THEORY OF ARITHMETIC - P E 119
incomplete, not just in the Gödelian way, but in the sense that they miss
out things that are very obviously true.
Fortunately, there is another kind of axiomatisation, which gives, so to
speak, a good compression.
The idea here, is that we there is a recursive function which will tell us
whether or not some sentence is an axiom of Γ or not. So we can always fig-
ure this out in a finite period of time and then try to work out whether other
sentences are theorems of Γ. It’s not as good as finitely axiomatisability, but
it still gives us more realistic grip on Γ.
[Link]. What sort of representation? Our goal here is to show that for
t
any partial recursive function, there is an arithmetic formula which repre-
sents it in the theory P E. Given that we are working with numbers, we shall
.1 f
try to line things up with the Gödel schema approach to algorithms.
v1 ra
Now we don’t have any means of constructing new function symbols in P E,
but we can build up new formulae which represent relations and sets. For
example, the formula:
D
ϕ(x) = ∃y(y × 2 = x)
can be used to represent the even numbers.
So since we know already that functions are just special kinds of relations
we shall represent the partial recursive functions with formulae representing
their corrseponding relations. So given some recursive function f : ω m → ω,
e
we want a formula in the languge of arithemtic such that f (n̄) = k iff ϕ(m̄, k)
is true and we can actually prove that it P E.
in
(1) It is correct: so the formula doesn’t get anything wrong about the
function it represents;
(2) P E can prove those facts: thus, if it’s true then using the proof style
O
functions and (2.) asserts that P E is complete with respect to the recursive
function.
[Link]. Showing P E is strong enough. Let us first show that P E can ac-
tually prove these facts. To do this, we are actually going to prove something
a little stronger than this. We shall do the following:
(1) Define a natural class of formulae in the language or arithmetic; then
(2) Show that P E always gets facts about such formulae right.
In the next section, we shall then show that all of the recursive functions fit
into this category so P E does the job.
We now define this natural class of formulae. First of all, observe the follow-
ing facts about first order logic. First, we observe that it is possible to define
the relation < in the language of arithmetic. We have
c Toby Meadows
x < y ⇔ N |= ∃m(sx + m = y)
.1 f
t
⇔ N |= ∀m(y + m 6= sx).
In fact, as you can see, there are a couple of ways of doing it. We use the
v1 ra
semantic concept of satisfaction |= here to mean that these facts are true
in the standard model of arithmetic, which is what we want. I’ll now start
using the < symbol as if it were in the language, but on the understanding
we could always remove it. [We could also just add a new relation symbol
D
∀x < yϕ(x).
in
We are now going to show that P E is complete for sentences which are ∆0 .
N |= ϕ ⇒ P E ` ϕ.
R EMARK . Observe that we only have one direction ⇒ in this theorem. Thus
it’s probably going to be better to use some kind of positive complexity for
this proof.
N |= ψ ∧ χ ⇔ N |= ψ & N |= χ
⇔ PE ` ψ & PE ` χ
⇔ P E ` ψ ∧ χ.
Now suppose ϕ := ¬(ψ ∧ χ) where ¬ψ and ¬χ are ∆0 with less positive com-
e
N |= ¬(ψ ∧ χ) ⇔ N |= ¬ψ or N |= ¬χ
⇒ P E ` ¬ψ or P E ` ¬χ
nl
⇒ P E ` ¬(ψ ∧ χ).
O
1
I’m just going to deal with conjunction, universal quantification and negation so we can
cut down on the number of cases that we need to prove below. They can be added back
using the usual definitions.
2
The positive complexity of ∆0 sentences is the obvious generalisation of definition we used
in Week 4.
9.3. A THEORY OF ARITHMETIC - P E 122
N |= ¬¬ψ ⇔ N |= ψ
⇒ P E ` ψ.
Suppose ϕ := ∀x < n ψ(x) where ψ(x) is a ∆0 formula with at most one free
variable which has less positive complexity than ϕ. Then
The first ⇔ follows by the satisfaction definition as does the second. At the
.1 f
t
third stage, we now have sentences so we exploit the induction hypothesis.
The rest follows from facts about provability in P E.
v1 ra
Suppose ϕ := ¬∀x < n ψ(x). Then
e
R EMARK 197. Observe that not all of the arrows int he proof above point in
in
both directions. Note that the real trick behind this proof is the fact that we
only end up with finite conjunctions and disjunctions, thus there is always
a way of checking such facts.
nl
Next we define the Σ01 functions. They are simply the ∆0 formulae with
O
of this latter kind than pure Σ01 formulae. But there is a simple way to move
between them. We now define this class of formulae and then show how to
turn them into Σ01 formulae. We shall call this class Σ formulae. We will rely
on these manipulations when we come to represent the process of defining
functions by primitive recursion.
We say that:
• if ϕ is an ∆0 3, then ϕ ∈ Σ;
• if ϕ, ψ ∈ Σ then ϕ ∧ ψ is in Σ;
• if ϕ ∈ Σ, then ¬¬ϕ, ∀x < yϕ, ∃x < yϕ, ¬∀xϕ and ∃xϕ are in Σ;
• if ¬ϕ and ¬ψ are in Σ, then ¬(ϕ ∧ ψ), ¬∀x < yϕ, ¬∃x < yϕ ∈ Σ; and
• nothing else is in Σ.
T HEOREM 198. Any Σ formulae can be converted into an equivalent Σ01 for-
mula.
c Toby Meadows
∃y¬¬ψ2 (y).
e
in
Suppose ϕ := ∀x < yψ(x, y). Then by the indution hypothesis, there is a Σ01
formula ∃zψ2 (x, y, z) which is equivalent to ψ(x, y). We let the following be our
nl
conversion
∃w∀x < y∃z < w ψ2 (x, y, z)
O
such that ψ2 (x, y, zx ). Since there are only finitely many x’s there only finitely
many zx ’s; and thus, there is some w which is greater than all of them.
Thus there is some w such that for every x < y there is a z < w such that
ψ2 (x, y, z) which is exactly what our conversion says.
The rest of the cases are left as an exercise.
we can represent all of the recursive functions using Σ01 formulae. We shall fo-
cus on representing the Gödel schema. We want to show that any recursive
.1 f
t
function (represented by an alogorithm of the Gödel schema) can be cap-
tured using a formula in the language of arithmetic. Now the representation
v1 ra
we want works like this.
Observe that since ϕe is a partial function, it could well be the case that for
some m1 , ..., mn , ϕ(hm1 , ..., mn i) is not defined. The Σ01 aspect of our formula
nl
comes in handy here as this will pan out as a value of m1 , ..., mn for which
there is not z such taht ψ(z, m1 , ..., nn , k) is a truth sentence about the natural
O
numbers.
Now with such a formula in hand, we may then exploit Theorem 199 to go
from a the fact that
N |= ∃zψ(z, m1 , ..., mn , k)
9.3. A THEORY OF ARITHMETIC - P E 125
Thus we capture the partial recursive functions in the sense that for any
partial recursive ϕe there is a Σ01 formula ∃zϕ(z, x1 , ..., xn , y ∈ F ormLAr such
that
c Toby Meadows
Let us attempt the z n function. This is easy. Let ψz (x1 , ..., xn , y) be defined as
follows:
ψz (x1 , ..., xn , y) ↔d y = 0.
Thus no matter what values are used for x1 , ..., xn , the formula is only true if
e
z n (hm1 , ..., mn i) = k ⇔ N |= k = 0.
nl
I’ll leave the other two basic functions (successor and projection) as exer-
cises.
O
I’m only going to do primitive recursion here. This is the most involved case.
The others are left as exercises. So by definition, we know that given recur-
sive function f : ω m → ω and g : ω m+2 → ω there is another recursive function
h : ω n+1 → ω such that
Our goal here is to find a simple way of representing this kind of thing using
the language of arithmetic and P E.
To do this, it will be helpful to have a means of representing sequences.
To see how this is helpful we might express what is going on in primitive
recursion as follows. Considering h as described above we might say:
e
in
h(k, n̄) = m iff there is a sequence hb0 , ..., bk i of k + 1 numbers such that
f (m) = b0 and
nl
You should see that this says the same thing as the definition of h, but we
avoid mentioning h on the right hand side. This means we have a legitimate
definition. Thus if we can represent this statement in arithmetic, then we
9.3. A THEORY OF ARITHMETIC - P E 127
can replace any uses of primitive recursion by this instead. This is what we
want. We’ll finish this off in two stages:
• First, we’ll just suppose that we have a way of simply capturing se-
quences and show that this gives us a simple way of capturing h;
• Then we’ll show how to simply capture sequences.
So let’s suppose we have a Σ01 formula P ro(b, a, m, n) which uses both a and
b to represent the sequence number and says that the mth value of the se-
quence (represented by a and b) is n. With this and the formulas ϕ and γ
capturing f and g, we may now capture h using the following formulae ψ,
which is just a re-writing of the sentence above into the language of arith-
metic:
Since P ro is Σ01 , we see by Theorem 198, that ψ is also Σ01 , which is what we
require.
D
334547
e
F ACT 202. For any sequence of numbers n0 , ..., nk and a such that a > ni for
1 ≤ i ≤ m there is a unique b such that:
b = n0 × a0 + ... + nk × ak .
simply take:
rem(div(b, ai−1 ), a).
.1 f
t
This is just a simple number theoretic fact, but let’s see it in action on a
simple example. Suppose we are representing the sequence 2, 4, 1, 5 using
v1 ra
the number 5142 in base 10. Then we may recover the 3nd element using the
functions above as follows:
= rem(51, 10)
= 1
and
• Quo(x, y, z) which says that z is the result of dividing x by y.
O
R EMARK 203. It actually turns out that we can do this in a simpler axioma-
tisation of arithmetic. It turns out that we can get rid of exponentiation.
Now once we have found the Σ01 formulae which do this, we have basically
proven the following two theorems.
in D
e
nl
O
9.4. EXERCISES. 130
9.4. Exercises.
E XERCISE 210. Represent the functions div and rem by Σ01 formula Div and
Rem in the language of arithmetic.
.1 f
t
E XERCISE 211. Describe a recursive function which lists all the sentence
of some language L(C) which has been appropriately coded. Such a listing
v1 ra
could be used to form an enumeration like the one we used to prove the
completeness of the natural deduction system.
in D
e
nl
O
CHAPTER 10
Incompleteness
We now have the means to show that there is a sentence γ which says of
itself that it is not provable.
• ∃y(y = 2).
• 20 × 313 × 56 × 79 × 119 × 138 × 177 × 196 × 2313 × 296 × 319 × 379 × 418 × 437 ×
4714 × 539 × 599 × 618 × 677 .
O
With a coding system in place, we are now able to express things about
sentence in the language of arithmetic.
For formulae of LAr , we write pϕq to denote the code number of ϕ.
131
10.1. THE DIAGONAL LEMMA 132
R EMARK 213. Assuming our theory is consistent, we can make these arrows
go in both directions. The important thing is that we are getting the ¬ inside
the Γ ` context in the second case; i.e., we aren’t just saying that Γ 0 δ(n)
c Toby Meadows
t
T HEOREM 214. All of the recursively enumerable sets are semnatically repre-
sented by forrmulae of arithmetic in the standard model.
.1 f
v1 ra
P ROOF. Let D ⊆ ω be recursively enumerable. Then there is a partial
recursive function ϕe which is defined only on the elements of D; i.e.,
n ∈ D ⇔ ϕe (n) is defined.
D
We observe that for ϕe (n) to be defined is just to say that there is a k such
that ϕe (n) = k. Now, we know that all of the partial recursive functions can
be semantically represented by formulae of arithmetic; thus, there is some
ψ(x, y) ∈ F ormLAr such that:
forrmulae of arithmetic.
n ∈ D ⇒ Γ ` δ(n)
and
n∈
/ D ⇒ Γ ` ¬δ(n).
Intuitively, this just says that not only can P E capture the function, but it
can also show that the formulae which captures ϕe is a genuine function, in
the sense of giving unique outputs.
c Toby Meadows
and use induction in P E to establish the claim. The proofs for each of these
in
cases is longer than the first case, but involves no further conceptual diffi-
culty.
nl
We now claim that the formula ϕD (x, 0) will suffice to capture D; i.e., we shall
have
n ∈ D ⇒ P E ` ϕD (n, 0)
and
n∈
/ D ⇒ P E ` ¬ϕD (n, 0).
To see the first of these suppose that n ∈ D. From here we see that χD (n) = 0
and by Σ01 completeness, we have P E ` ϕD (n, 0), which is what we want.
On the other hand, let us suppose that n ∈ / D. Then χD (n) = 1 and by
0
Σ1 completeness, we have P E ` ϕD (n, 1). But then since 0 6= 1, we may
prove from the second fact about ϕD , that P E ` ¬ϕ(n, 0), which is what we
c Toby Meadows
wanted.
.1 f
t
[Link]. Provability and substitution. Let is-a-proof-of be the relation be-
v1 ra
tween the code of a sentence pϕq and the code of a derivation d of that
sentence. By Church’s thesis, we claim that the is-a-proof-of relation is re-
cursive. Given any pair of a code for a sentence and a code for a derivation,
we may verify in a finite amount of time whether or not it proves sentence.
D
To see this suppose, we were using a Prawitz proof system. We might de-
code, so to speak, the derivation into its diagramatic form and then verify
that every one (of the finitely many) applications of rules was correctly ap-
plied. If so, then the pair belongs in the set; otherwise not. This algorithm
defines a total recursive function which can be made to give the character-
e
istic function of the set of (codes of) sentences and derviations. Thus by
in
and
B(x, y) will be a Σ01 formula as can be seen from the proof of Theorem218
above.
Let provability be the property of being the code number of a theorem of P E.
With regard to some pϕq, it says that there is some n such that n is a proof
of ϕ. Since Bw represents a recursive set we can see that the set of codes of
provable sentences is recursively enumerable. We claim it is the domain of
a partial recursive function.
To see this, suppose again that we are using a Prawitz proof system and
that we are trying to verify whether or not ϕ is provable. We then let our
algorithm take codes n of proofs and verify whether or not they are proofs of
ϕ. If they are, then the programme is instructed to halt; otherwise, it keeps
looping.
Moreover, we can denote the provability relation by a Σ01 senten B(x) which
c Toby Meadows
is such that:
.1 f
t
B(x) ↔ ∃n Bw (x, n).
can make it so that it defines the characteristic function of the set of such
triples. Thus this set is recursive.
in
P E}
P {pϕq | ϕ is provable in P E} r.e. Σ01 ?? B(x)
Sub{hpϕ(v)q, y, zi| y codes the result of rec Σ01 Σ01 Sub(x, y, z)
substituting y for v in ϕ(v)
10.2. INCOMPLETENESS 136
L EMMA 219. For any arithmetic formula ϕ(x) there is a sentence γ such that
P E ` γ ↔ ϕpγq.
P E ` ∀y(Diag(a, y) ↔ y = g).
c Toby Meadows
By definition we have.1 f
t
P E ` γ ↔ ∃y(Diag(a, y) ∧ ϕ(y)).
v1 ra
But combining these, we see that
P E ` γ ↔ ∃y(y = g ∧ ϕ(y))
and so
D
P E ` γ ↔ ϕ(g)
which, by definition, just means
P E ` γ ↔ ϕpγq
10.2. Incompleteness
in
P E ` γ ↔ ¬Bpγq.
P E ` Bpγq.
P E ` ¬γ
P E ` γ.
The proof is much the same as the last one, so we’ll have less detail this
time.
P E ` Bpγq
or in other words,
P E ` ∃xBw (pγq, x).
Now suppose for reductio that there was some n ∈ ω such that
N |= Bw (pγq, n).
c Toby Meadows
t
which is contrary to our initial assumption. Thus there is no such n; i.e., for
v1 ra
all n we have
N |= ¬Bw (pγq, n)
and since Bw case by case captures this relation, we have
D
P E ` ¬Bw (pγq, n)
for all n ∈ ω. But this, in conjunction with our initial assumption that
P E ` ∃xBw (pγq, x)
N |= Bw (p¬ρq, m)
N |= ∀y(y = m ∨ y < m → ¬Bw (pρq, y).
The first follows since Bw semantically represent the proof-of relation and
the second follows from the consistency of P E.
Thus we have
P E ` Bw (p¬ρq, m)
c Toby Meadows
Thus
P E ` ∀y(Bw (pρq, y) → ∃z < y Bw (p¬ρq, z));
i.e.,
e
PE ` ρ
in
• If P E is consistent, then P E 0 ρ.
1
Prove this.
10.2. INCOMPLETENESS 140
But what does consistency mean? It just says that there is no proof from
P E of both ϕ and ¬ϕ for any sentence. However, we can actually express
this a little more simply by an equivalent statement. We claim that:
To see this, let us first go from left to right, but via contraposition. Thus
we suppose that 0 = 1 is provable from P E. Well we also know that 0 6= 1
is provable from P E. Thus there is some ϕ such that both ϕ and ¬ϕ are
provable from P E. For the other direction, let us suppose that for some ϕ
both ϕ and ¬ϕ are provable from P E. But then we know that any sentence
of LAr is probable in P E; thus 0 = 1 is provable in P E.
Thus we shall let Con(P E) be the sentence ¬∃n Bw (p0 = 1q, n).
c Toby Meadows
But now this puts us in a position to state Theorem 225 in the language of
arithmetic. Thus we write:
.1 f
• Con(P E) → ¬Bpρq. t
v1 ra
Moreover, since B semantically represents provability, we must have:
• N |= Con(P E) → ¬Bpρq;
D
This means that we can not only express Theorem 225 in the language of
in
P ROOF. Suppose for reductio that P E ` Con(P E). Then by Fact 226, we
have P E ` ¬Bpρq. But by the definition of ρ as a diagonal sentence, we also
have P E ` γ. But this contradicts Theorem 225; thus, P E 0 Con(P E).
10.2. INCOMPLETENESS 141
[Link]. What about other theories? In this section, we have only con-
sidered P E, which might lead us to think that the issue of undecidability
can be confined to P E. However, it should be obvious that the arguments
that we have used here will be extendable to any theory which is:
• capable of talking about its own syntax; and
• getting the facts about recursive functions right.
10.2.2. Two more theorems. We have seen last week that a theory is
decidable if it’s theorems form a recursive set. However, we have seen that
some sets are recursively enumerable without being recursive. The following
definition links the recursion theoretic idea with a logical one.
[Link]. The set of the theorems of P E are not recursive; i.e., P E is not
decidable. .1 f
t
T HEOREM 229. Suppose P E is consistent. P E is not decidable.
v1 ra
P ROOF. Suppose for reductio, that P E is decidable. Then Γ = {pϕq | P E `
ϕ} is recursive. Since we can capture every recursive function in the lan-
guage of arithmetic, there must be some (Σ01 ) formula B(x) such that
D
pϕq ∈ Γ ⇒ P E ` Bpϕq
and
pϕq ∈
/ Γ ⇒ P E ` ¬Bpϕq.
Using the diagonal lemma, let γ be such that
e
P E ` γ ↔ ¬Bpγq.
in
γ ∈ Γ ⇒ P E ` Bpγq
O
⇔ P E ` ¬γ
⇒ PE 0 γ
⇒ γ∈
/Γ
10.2. INCOMPLETENESS 142
which is a contradiction, so γ ∈
/ Γ. (Note that for the second ⇒ we appeal to
the consistency of P E.) But then we have
γ∈
/ Γ ⇒ P E ` ¬Bpγq
⇔ PE ` γ
⇔ γ∈Γ
need to get infinite branches. However, the answer in the case of first order
logic is negative. .1 f
t
P ROPOSITION 230. Let P E − Ind be P E without the induction schema. Then
P E − Ind is Σ01 -complete and can prove Lemma 217.
v1 ra
∀x(x + 0 = 0 + x)
following reason.
in
{pϕq | P E − Ind 0 ϕ}
O
P ROOF. The first part is a simple adaptation of the proof of Theorem 229.
Indeed, we could have made more general proof there.
10.2. INCOMPLETENESS 143
{pϕq | P E − Ind ` ϕ}
P ROOF. The first part can be established by Church’s thesis and the
methods discussed at the beginning of this week.
For the second part, we shall suppose for reductio that ω\V is recursively
enumerable.
Let π be the conjunction of the sentences in P E − Ind + T ri.
c Toby Meadows
ψ(n) = m ⇔ ϕe (f (n)) = m.
v1
C = {pϕq | |= ρ → ϕ}
in
= {pϕq | ` ρ → ϕ}
= {pϕq | P E − Ind + T ri ` ϕ}.
nl
However, we know from Proposition 232, that ω\C is not recursively enu-
O
C OROLLARY 234. The set Σ = {pϕq | ϕ is satisfiable.} (i.e., the set of satisfiable
sentences) is not recursively enumerable.
c Toby Meadows
.1 f
t
v1 ra
in D
e
nl
O
10.3. EXERCISES. 145
10.3. Exercises.
E XERCISE 237. Complete the first half of the proof of Theorem 224.
.1 f
t
v1 ra
in D
e
nl
O