Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Godel & Recursivity
JACQUES DUPARC
Batiment InternefCH - 1015 Lausanne
2
Contents
Introduction 7
I Recursivity 9
1 Towards Turing Machines 11
1.1 Deterministic Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Nondeterministic Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 Non-Regular Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.5 Pushdown Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6 Context-Free Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2 Turing Machines 27
2.1 Deterministic Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2 Non-Deterministic Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.3 The Concept of Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4 Universal Turing Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.5 The Halting Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.6 Turing Machine with Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3 Recursive Functions 51
3.1 Primitive Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.2 Variable Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.3 Bounded Minimisation and Bounded Quantification . . . . . . . . . . . . . . . . 58
3.4 Coding Sequences of Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.5 Partial Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
II Arithmetic 75
4 Representing Functions 77
4.1 Robinson Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.2 Representable Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4 CONTENTS
5 Godel’s First Incompleteness Theorem 111
5.1 Godel Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.2 Coding the Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.3 Undecidability of Robinson Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . 139
6 Godel’s Second Incompleteness Theorem 145
6.1 Peano Arithmetic and IΣ01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.2 The Arithmetical Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6.3 A first glance at Godel’s second incompleteness theorem . . . . . . . . . . . . . . 157
6.4 The core of the proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Introduction
Introduction 7
The basic requirements for this course are contained in the ”Mathematical Logic” course. Among
other things, you should have a clear understanding of each of the following: first order language,
signature, terms, formulas, theory, proof theory, models, completeness theorem, compactness
theorem, Lowenheim-Skolem theorem.
It makes no sense to take this course without this solid background on first order logic.
The title of the course is ”Godel and Recursivity” but it should rather be ”Recursivity and
Godel” since that is the way we are going to go through these topics
(1) Recursivity
(2) Godel’s incompleteness theorems (there are two of them)
Recursivity is at the heart of computer science, it represents the mathematical side of what
computing is like. It is related to arithmetics and to proof theory.
Godel’s incompleteness theorems are concerned with number theory (arithmetics) which itself
lies at the core of mathematics. They contradict the commonly shared idea that everything that
is true can be proved. It ruins the plan, for every mathematical statement ϕ to either prove it
or disprove it (by proving ϕ).
Godel’s first incompleteness theorem says that there exists a formula ϕ from number theory such
that neither ϕ nor ϕ is provable. More precisely, it says that in Peano Arithmetics (which is
a first order axiomatization of arithmetics) there exists a formula ϕ that cannot be proved nor
disproved, and if we were to add this formula to Peano Arithmetics, one would find a second
one that would not be provable nor disprovable inside their first extension of Peano Arithmetics.
And if this new formula would be added again, we could find a third one and so on and so
forth. To put it differently, if we want to extend Peano Arithmetics to a larger theory which is
complete in the sense that it proves or disproves any given formula, there would not have any
understanding of this theory, we would not get hold of it, for it would not be recursive, meaning
that we would not have any efficient way of figuring out whether a given closed formula is part of
the theory or not (not provable from the theory, but simply part of the theory!). This is precisely
where the notion of recursivity plays a crucial role. One does not have the right comprehension
of Godel’s incompleteness theorems without a proper understanding of what recursivity is like.
The formula that we will construct (the one that is not provable nor disprovable in Peano Arith-
metics) is rather odd. There is no chance that one might tumble over such a formula during the
usual mathematical practice.
However, since Godel’s incompleteness theorem was proved, there have been several examples
of real arithmetic mathematical formulas that are not provable nor disprovable in Peano Arith-
metics, although the are formulated in the language of arithmetics.
A good example of such a formula is the one related to Goodstein sequences (1944). A Goodstein
sequence is of the form Gmp0q, G
mp1q, G
mp2q, . . ., etc, where m is a positive integer. It is defined the
following way (we take m “ 4 as an example, the general case being obtained by replacing
G4p0q “ 4 by Gm
p0q “ m and gathering the other values Gmp1q, G
mp2q, etc the same way):
8 Godel & Recursivity
˝ G4p0q “ 4 write 4 in hereditary base 2: 4 “ 22
replace all 2’s by 3’s, then subtract 1: 33 “ 26
˝ G4p1q “ 26 write 26 in hereditary base 3: 26 “ 2 ¨ 32 ` 2 ¨ 312 ¨ 30
replace all 3’s by 4’s, then subtract 1: 2 ¨ 42 ` 2 ¨ 412 ¨ 40 ´ 1 “ 41
˝ G4p2q “ 41 write 41 in hereditary base 4: 41 “ 2 ¨ 42 ` 2 ¨ 412 ¨ 40
replace all 4’s by 5’s, then subtract 1: 2 ¨ 52 ` 2 ¨ 512 ¨ 50 ´ 1 “ 60
˝ G4p3q “ 60 . . . etc
Amazingly, G4pnq increases until n reaches the value 3 ¨ 2402653209 where it reaches the maximum
of 3 ¨ 2402653210´ 1, it stays there for the next 3 ¨ 2402653209 steps then starts its final descent and
eventually reaches 0.
Amazingly, for every integer m, the Goodstein sequence pGmpnqqnPN is ultimately constant with
value 0, i.e.
limnÑ8
Gmpnq “ 0.
However this statement which is easily formalizable in the language of arithmetics is not provable
in Peano Arithmetics (Kirby and Paris 1982). It requires a stronger theory to be proved (for
instance record order arithmetics).
Godel’s second incompleteness theorem than says that mathematics cannot prove its own con-
sistency (unless it is inconsistent in which case it can prove its own consistency for it can prove
everything). More precisely, in any recursive extension J of Peano Arithmetics, the formula
”ConspJq” (which is a formula from number theory that asserts that there is no proof of K from
J) is not provable unless J is inconsistent i.e.
IfJ &c thenJ &c ConspJq
We will present three different approaches:
˝ Computer Science ÝÑ Turing Machine (one of the abstract model of computer)
˝ Arithmetic ÝÑ Recursive functions which are particular functions Nk Ñ N
Part I
Recursivity
Chapter 1
Towards Turing Machines
The whole chapter is highly inspired by Michael Sipser’s book: “Introduction to the Theory of
Computation” [43]. It is a dashing introduction to the notions of Finite Automata, PushDown
Automata, Turing Machines.
We also recommend “Introduction to automata theory, languages, and computation” by John E.
Hopcroft, Rajeev Motwani et Jeffrey D. Ullman [29]; “Computational complexity” by Christos
H. Papadimitriou [36] and “A mathematical introduction to logic” by Herbert B. Enderton [16].
1.1 Deterministic Finite Automata
We will see that any finite automaton can be regarded as a rudimentary Turing machine: a
Turing machine that never writes anything and only goes one direction.
Definition 1 A deterministic finite automaton (DFA) is a 5-tuple pQ,Σ, δ, q0, F q, where
(1) Q is a finite set called the states,
(2) Σ is a finite set called the alphabet,
(3) δ : Qˆ Σ ÝÑ Q is the transition function,
(4) q0 P Q is the initial state, and
(5) F Ď Q is the set of accepting states.1
We denote by Σăω (or equivalently by Σ˚) the set of finite words on Σ and by ε the empty
sequence.
1Accept states sometimes are called final states.
12 Godel & Recursivity
Definition 2 A DFA A “ pQ,Σ, δ, q0, F q on an alphabet Σ accepts the word w P Σăω if and
only if
˝ either w “ ε (the empty sequence) and q0 P F
˝ or w “ xa0, . . . , any with each ai P Σ, and there is a sequence of states r0, . . . , rn`1 such
that:
‚ r0 “ q0
‚ @i ă n, δpri, aiq “ ri`1
‚ rn`1 P F .
Notation 3 Given any DFA A,
LpAq “ tw P Σăω : w is accepted by Au .
LpAq denotes the language accepted by A.
Definition 4 Any language recognised by some deterministic finite automata (DFA) is called
regular.
1.2 Nondeterministic Finite Automata
Given any alphabet Σ, we both assume that ε R Σ holds and write Σε for ΣY tεu.
Definition 5 A nondeterministic finite automaton (NFA) is a 5-tuple pQ,Σ, δ, q0, F q, where
(1) Q is a finite set of states,
(2) Σ is a finite alphabet,
(3) δ : Qˆ Σε ÝÑ PpQq is the transition function,
(4) q0 P Q is the initial state, and
(5) F Ď Q is the set of accepting states.
Definition 6 Let N “ pQ,Σ, δ, q0, F q be an NFA and w P Σăω. We say that N accepts w if
and only if
˝ either w “ ε the empty sequence and q0 P F
˝ or w can be written as w “ xa0, . . . , any with each ai P Σε, and there is and a sequence of
states r0, . . . , rn`1 such that:
‚ r0 “ q0
‚ @i ă n, ri`1 P δpri, aiq,
Recursivity 13
‚ rn`1 P F .
Proposition 7 Every NFA has an equivalent DFA. i.e. given any NFA N there exists some
DFA D such that
LpN q “ LpDq.
Proof of Proposition 7: Given any NFA N “ xQ,Σ, δ, q0, F y, we build some DFA D “
xQ1,Σ, δ1, q10, F1y that recognises the same language.
(1) Q1 “ PpQq
(2) For S Ď Q and a P Σ we set
δ1pS, aq “ tq1 P Q | Dq P S qε˚aε˚ÝÝÝÝÑ q1u
where qε˚aε˚ÝÝÝÝÑ q1 stands for the existence of a path in the graph of N that goes through
exactly one edge labelled with ”a”, the others being labelled with ”ε”.
(3) q10 “ tq0u
(4) F 1 “ tS Ď Q | S X F ‰ Hu.
% 7
Definition 8 Let A and B be languages. We define the regular operations union, concatenation,
and star as follows.
˝ Union: AYB “ tx | x P A or x P Bu.
˝ Concatenation: A ˝B “ txy | x P A and y P Bu.
˝ Star: A˚ “ tx1x2 . . . xk | k ě 0 and each xi P Au.
Theorem 9 Regular languages are closed under union, concatenation and star.
Proof of Theorem 9: Let N 1 “ pQ1,Σ,∆1, q1, F1q, N 2 “ pQ2,Σ,∆2, q2, F2q be two NFAs
recognising respectively A1 and A2.
N1 N2
14 Godel & Recursivity
Union We need an NFA N such that N recognises a string if and only if N 1 or N 2 recognises
it. By working nondeterministically, the automaton N is allowed to split into two copies:
we construct N in such a way that N 1 and N 2 work in parallel at the same time. We
assume Q1 XQ2 “ H and q0 R Q1 YQ2. Define N “ pQ,Σ,∆, q0, F q where
(1) Q “ tq0u YQ1 YQ2.
(2) ∆ Ă Qˆ Σε ˆQ is defined by: pp, s, rq P ∆ if and only if one of the following is true
(a) p “ q0
s “ ε
r P tq1, q2u
(b) p, r P Q1
pp, s, rq P ∆1
(c) p, r P Q2
pp, s, rq P ∆2.
(3) F “ F1 Y F2.
The machine splits immediately into two copies of itself, which work exactly as N 1 and
N 2. It accepts a string if and only if at least one of the two main copies ends up in an
accepting state, i.e. in F1 or in F2, i.e. if and only if N 1 or N 2 accept it.
N
"
"
Concatenation Here we need an NFA N that accepts a word w if and only if w can be broken
into two pieces: a prefix and a suffix w “ wpws such that wp is accepted by N 1 and wsis accepted by N 2. We set q1 as the initial state and let the machine read the same way
N 1 would do. Any time that N 1 finds itself in an accepting state, we want N to non-
deterministically start reading as if it were N 2 but still remaining a copy of itself: so we
make it split any time it comes to some final state of N 1. The reason is that we want
to be able to check longer sub-strings as well, because it might be the case that the first
prefix that is found to be accepted by N 1 corresponds to a suffix that is rejected by N 2,
Recursivity 15
while there is a longer prefix which is also accepted by N 1 that yields a suffix which is this
time also accepted by N 2. Formally, we define ∆ by: pp, s, rq P ∆ if and only if one of the
following is true
(1) p, r P Q1
pp, s, rq P ∆1
(2) p, r P Q2
pp, s, rq P ∆2
(3) p P F1
s “ ε
r “ q2
The third condition guarantees the splitting. Finally, we set the accepting set to be F “ F2.
N
"
""
"
Star Here the machine N should be able to check if a word w can be broken into a finitely
many pieces w “ w1w2 ¨ ¨ ¨wk, each of them being accepted by N 1. So N has to read w1
as if it were N 1, and when it finds itself in an accepting state, it needs to start all over
again and read w2 and so on and so forth. The construction is similar to the one of the
concatenation, but since A˚1 contains the empty string, we want N to accept ε. So we just
add an initial state q0 which is also an accepting state, and from where the initial state of
N 1 is reached by an ε move. % 9
N
"
"
"
1.3 Regular Expressions
Definition 10 We say that R is a regular expression if R is of one the following form:
16 Godel & Recursivity
(1) a (for some a P Σ)
(2) ε
(3) H
(4) R1 YR2
(5) R1 ˝R2
(6) R1˚
where R1 and R2 are regular expressions.
The expression ε represents the language containing a single sequence, namely, the empty se-
quence, whereas H represents the language that doesn’t contain any sequence. Notice that
(1) R ˝ H “ H ˝R “ H (2) H˚ “ tεu.
Definition 11 Let R be a regular expression. We define by induction its associated language
LpRq as follows:
(1) Lpaq “ tau
(2) Lpεq “ tεu
(3) LpHq “ H
(4) LpR1 YR2q “ LpR1q Y LpR2q
(5) LpR1 ˝R2q “ LpR1q ˝ LpR2q
(6) LpR˚1q “ LpR1q˚.
Theorem 12 A language L is regular if and only if there exists a regular expression R such
that L “ LpRq.
Proof of Theorem 12:
(ñ) (1) Lpaq “ tau
(2) Lpεq “ tεu
(3) LpHq “ H
(4) LpR1 YR2q “ LpR1q Y LpR2q
(5) LpR1 ˝R2q “ LpR1q ˝ LpR2q
(6) LpR˚1q “ LpR1q˚
(ð) (1) We go from some n-states DFA to some n` 2-states Generalized-NFA:
(a) we add
(A) an initial state “s”
(B) an accepting state “a”
(C) a transition aεÝÑ q0
(D) a transition qεÝÑ a (each accepting state q ‰ a)
(b) we reduce the set of accepting states to tau.
Recursivity 17
(2) We go from some k`1`2-states Generalized-NFA 2 to some k`2-states Generalized-
NFA by removing one state from the original automaton: qrip R ts, au and for each
states qin R ta, qripu and qout R ts, qripu we set the new transition to be:
qinRinÑrip ˝ pRripÑripq
˚ ˝ RripÑout Y RinÑoutÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÑ qout
where RinÑrip, RripÑrip, RripÑout and RinÑout denote the following transitions:
(a) qinRinÑripÝÝÝÝÝÑ qrip
(b) qripRripÑripÝÝÝÝÝÑ qrip
(c) qripRripÑoutÝÝÝÝÝÝÑ qout
(d) qinRinÑoutÝÝÝÝÝÑ qout.
(3) We end up with a 2-states (“s” and “a”) Generalized-NFA with a single transition of
the form sRÝÑ a. The regular expression R gives the solution.
Example 13
(a)
1
0
0, 1(b)
1
0
0, 1"
"s
a
(c)
0"
s
a
1(0 [ 1)⇤
(d)
s
a
0⇤1(0 [ 1)⇤
An other example with an automaton a bit more complicated.
Example 14
(a)
2an NFA whose transitions are labelled with regular expressions.
18 Godel & Recursivity
1
0
0
0
1
1
(b)
1
0
0
0
1
1
"
"s a
"
(c)
0
1 "
s a"
00 [ 1
01 10 [ 0
11
(d)
s a
(10 [ 00)(00 [ 1)⇤01 [ 11
0(00 [ 1)⇤01 [ b
0(00 [ 1)⇤
(10 [ 0)(00 [ 1)⇤ [ "
(e)
s a
�0(00 [ 1)⇤01 [ b
��(10 [ 00)(00 [ 1)⇤01 [ 11
�⇤�(10 [ 0)(00 [ 1)⇤ [ "
�[�0(00 [ 1)⇤
�
% 12
Recursivity 19
1.4 Non-Regular Languages
Notice that any finite word on Σ can be coded by an integer, so that there are only ℵ0 many
regular languages. But there are 2ℵ0 many languages for there are as many as the number of
subsets of N. Hence most languages are not regular!
Theorem 15 (Pumping Lemma) If A is a regular language, then there is a number p (the
pumping length) where, if s is any sequence in A of length at least p, then s may be divided into
three pieces, s “ xyz, satisfying the following conditions:
(1) for each i ě 0, xyiz P A,
(2) |y| ą 0, and
(3) |xy| ď p
Proof of Theorem 15: Let A be any DFA such that LpAq “ A. Set p to be the number of states
of A. Let s be accepted by A. Then s may be broken into three pieces: s “ xyz. Such that the
path q0xÝÑ q never visits twice the same state. The path q
yÝÑ q visits twice the state q but none
of the others twice. This holds since for every word u of length at least p every path q1uÝÑ q” in
A visits at least twice the same state.
z
y
x
% 15
Example 16 The language t0m1m | n P Nu is not regular.
By contradiction, assume there exists some DFA A “ pQ,Σ, δ, q0, F q which recognises t0m1m |
n P Nu. We consider p “ |Q| the number of states of A. the word 0p1p is accepted by A. By
the previous Pumping Lemma there exist x, y and z such that 0p1p “ xyz and
(1) for each i ě 0, xyiz P t0m1m | n P Nu,
(2) |y| ą 0, and
(3) |xy| ď p
20 Godel & Recursivity
But since |xy| ď p, it turns out that xy P 0˚ and z P 0˚1˚. Therefore, for each integer i ą 1 we
have xyi P 0˚, hence xyiz contains too many 0’s compared to 1’s: a contradiction.
1.5 Pushdown Automata
Definition 17 A pushdown automaton (PDA) is a 6-tuple pQ,Σ,Γ, δ, q0, F q, where Q, Σ, Γ
and F are all finite sets, and
(1) Q is the set of states,
(2) Σ is the input alphabet,
(3) Γ is the stack alphabet,
(4) δ : Qˆ Σε ˆ Γε ÝÑ PpQˆ Γεq is the transition function3,
(5) q0 P Q is the initial state, and
(6) F Ď Q is the set of accepting states.
Definition 18 A pushdown automaton M “ pQ,Σ,Γ, δ, q0, F q computes as follows. It accepts
input w if w can be written as w “ w1w2 . . . wm, where each wi P Σε and sequences of states
r0, r1, . . . , rm P Q and sequences s0, s1, . . . , sm P Γ˚ exist that satisfy the next three conditions.
The sequences si represent the sequence of stack contents that M has on the accepting branch of
the computation.
(1) r0 “ q0 and s0 “ ε. This condition testifies that M starts out properly: both in the initial
state and with an empty stack.
(2) For i “ 0, . . . ,m ´ 1, we have pri`1, bq P δpri, wi`1, aq, where si “ at and si`1 “ bt for
some a, b P Γε and t P Γ˚. This condition states that M moves properly according to the
state, stack, and next input symbol.
(3) rm P F . This condition states that an accepting state occurs right at the end of the reading
of the input.
(1) One step of a computation:
3For a deterministic version, replace PpQˆ Γεq by Qˆ Γε.
Recursivity 21
ri
aec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1ri
bec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1
(2) The special case where a “ ε and b P Γ (the PDA “pushes” b to the top of the stack)
ri
ec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1ri
bec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1
(3) The special case where a P Γ and b “ ε (the PDA “pops off” a from the top of the stack)
ri
aec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1ri
ec
w1w2w3 · · · wi�1wiwi+1 · · · wm
ri+1
Example 19 (1) The language t0m1m | n P Nu is recognised by a PDA.
1, 0 ! "
", "! ?0, "! 0
",? ! "1, 0 ! "
(2) The language t0i1j2k | i, j, k ě 0 and i “ j or i “ ku is recognizable by a PDA, however
it is not recognizable by a deterministic PDA.
22 Godel & Recursivity
1, 0 ! "
", "! ?
0, "! 0
",? ! ?
",? ! ?", "! "
", "!" ", "! "
1, "! " 2, 0 ! "
2, "! "
1.6 Context-Free Grammar
Definition 20 A context-free grammar is a 4-tuple pV,Σ, R, Sq, where
(1) V is a finite set whose elements are called variables,
(2) Σ is a finite set, disjoint from V . Its elements are called terminals,
(3) R is a finite set of rules. Each rule is a couple of the form pξ, uq where ξ P V and
u P pV Y Σq˚.
(4) S P V is the initial variable.
If u, v and w are sequences of variables and terminals, and A Ñ w is a rule of the grammar,
we say that uAv yields uwv (written uAv ñ uwv). We write u ñ˚ v if u “ v or if a sequence
u1, u2, . . . , uk exists for k ą 0 and
uñ u1 ñ u2 ñ . . .ñ uk ñ v.
The language generated by the grammar is tw P Σ˚ | S ñ˚ wu.
Example 21 Consider pV,Σ, R, Sq the context-free grammar where V “ tS,Bu, Σ “ t0, 1, 7u
and R is the following set of production rules:
˝ S ÝÑ 0S1 ˝ S ÝÑ B ˝ B ÝÑ 7
This grammar generates the language t0n71n | n P Nu.
Theorem 22 A language is recognised by a PDA if and only if it is context-free.
Recursivity 23
Proof of Theorem 22:
(ð) Get a context-free grammar. The Pushdown P works as follows:
(1) Places a marker symbol “K” and the start variable on the stack.
(2) Repeat:
(a) If the top stack is a variable A it selects non-deterministically one of the rules
for A and substitutes A by the string on the right hand side of the rule.
(b) If the top stack is a terminal symbol a, it reads the next input symbol from
the input and compares it to a. If they don’t match, rejects (for this branch of
non-deterministic). If they do, repeat.
(c) If the top of stack is the symbol “K” enters the accepting state (If a letter from
the input must be read, it rejects).
(ñ) We start from a PDA and construct P an equivalent one such that
(1) P has a single accepting state qacc.
(2) It empties its stack before accepting
(3) Each transition either pushes a symbol onto the stack or pops one off, but does not
do both at the same time so that the the content of the stack never stays put.
From P “ pQ,Σ,Γ, δ, q0, tqacc.uq we construct G.
(1) V “ tApq | p, q P Qu,
(2) Σ is unchanged,
(3) the start variable is Aq0, qacc..
(4) The set of rule R is:
(a) For each p, q, r, s P Q, t P Γ and a, b P Σε if δpp, a, εq contains pr, tq and δps, b, tq
contains pq, εq put the rule Apq Ñ a Arsb in R.
(b) For each p, q, r P Q put the rule Apq Ñ AprArq in R.
(c) For each p P Q put the rule App Ñ ε in R.
Why is the language recognised by P is the one derived by G?
(ñ) If w is accepted by P , then there exists a computation that accepts it. This compu-
tation goes from q0 ÝÑ qacc.. It determines one derivation.
(ð) Any successful derivation induces an accepting computation.
% 22
Every regular language is context-free. But many languages are neither regular nor context-free.
24 Godel & Recursivity
Theorem 23 (Pumping Lemma for Context-Free Languages) If A is a context-free lan-
guage, then there is a number p (the pumping length) where, if s is any sequence in A of length
at least p, then s may be divided into five pieces, s “ vwxyz, satisfying the following conditions:
(1) for each i ě 0, vwixyiz P A,
(2) |wy| ą 0, and
(3) |wxy| ď p
Proof of Theorem 23: See Theorem 2.19 in [43]. We first fix a grammar. Then we concentrate
on getting a derivation tree4 large enough so that there is one path – from the root to some leaf
– that visits twice the same variable T . For this, if k is the number of variables in the grammar,
we need a tree of height at least k ` 1. We take m to be the maximum number of symbols in
the right hand side of a rule 5, and take n “ maxp2,mq. Every word of height at least nk`1
that is generated by this grammar has a derivation tree with at least one branch whose length
is ě k ` 1. We set p “ nk`1.
Take any word u generated by this grammar such that |u| ď p holds. Consider the smallest –
in terms of nodes – derivation tree that produces u, and consider a node T which repeats only
once and such that there is no other variable that repeats in the subtree induced by this node.
The whole derivation tree is described below:
T
S
T
x y zwv
Notice that |wxy| ď p holds, because the subtree induced by T has never twice the same variable
(except for T itself which appears only twice). Hence every branch on this subtree has length
at most k ` 1, which guarantees that wxy has length at most p “ nk`1.
Notice also that |wy| ą 0 because otherwise, we would have w “ y “ ε. But then the derivation
tree below would also produce the same word which would contradict the minimality of the one
we chose.
4notice that in a derivation tree every leaf is a terminal symbol, and very other node is a variable.5k is the maximum number of immediate successors of a node in the derivation tree.
Recursivity 25
S
T
x
zv
We also clearly have, for each i ě 0, vwixyiz P A:
T
S
T
x y zwv
T
T
x yw
S
z
T
ywv
% 23
Example 24 The following language is not context-free:
tanbncn | n P Nu.
Towards a contradiction we assume that this language is context-free so that there exists some
integer p that verifies the conditions of Theorem 23. We consider the word u “ 0p1p2p P A. By
Theorem 23, there exist words v, w, x, y, z such that u “ vwxyz and
(1) vwixyiz P A (@i ě 0) (2) |wy| ą 0, and (3) |wxy| ď p
Since |wxy| ď p holds, this word cannot contain all three letters 0,1 and 2. We distinguish two
different cases:
(1) if wxy P 0˚1˚, then z P 1˚2˚. Therefore for each i ą 1 vwixyiz contains either more 0’s
than 2’s or 1’s than 2’s.
(2) if wxy P 1˚2˚, then v P 0˚1˚. Therefore for each i ą 1 vwixyiz contains either more 1’s
than 0’s or 2’s than 0’s.
26 Godel & Recursivity
Chapter 2
Turing Machines
A Turing Machine (TM) is a general model of computation introduced in 1936 by Alan Turing
[50]. It consist in an infinite tape and a tape head that can read, write and move around. It can
both read the content of the tape and write on it. The read-write head can move both to the
left and to the right. The tape is infinite. There are special states for rejecting and accepting
which both take immediate effect.
100 01 1
Control
t t t t t
2.1 Deterministic Turing Machines
Definition 25 A (deterministic) TM is a 7-tuple pQ,Σ,Γ, δ, q0, qacc., qrej.q where Q,Σ,Γ are all
finite sets and
(1) Q is the set of states,
(2) Σ is the alphabet not containing the blank symbol, \,
(3) Γ is the tape alphabet where \ P Γ and Σ Ď Γ
(4) δ : Qˆ Γ ÝÑ Qˆ Γˆ tL,Ru is the transition function
(5) q0 is the initial state
(6) qacc. is the accepting state
(7) qrej. is the rejecting state
28 Godel & Recursivity
Clearly qacc. and qrej. must be different states.
Notice that the head cannot move off the left hand end of the tape. If δ says so, it stays put. A
configuration of a TM is a snapshot: it consists in the actual control state (q), the position of the
head and what is written on the tape (w). To indicate the position of the head we consider the
word w0 which is located to the left of the head and slice the tape content w into the w0w1 “ w.
This means that the head is actually positioned on the first letter of w1. Strictly speaking the
content of the tape is an infinite word:
w \\\ . . . . . .\\ . . .
but we forget about the infinite suffix \\\ . . .. We then write w0qw1 to say that
˝ the tape content is w0w1 \\\ . . .
˝ the head is positioned on the first letter of w1 \\\ . . .
˝ the actual control state is q.
The initial configuration on input w P Σăω is q0w.
An halting configuration is
˝ either an accepting configuration of the form w0qacc.w1,
˝ or a rejecting configuration of the form w0qrej.w1.
Given any two configurations C,C 1 we write C ñ C 1 (for C yields C 1 in one step) if there exist
a, b, c P Γ, and u, v P Γ˚ such that
˝ either C “ uaqibv, C 1 “ uqjacv and δpqi, bq “ pqj , c, Lq,
˝ or C “ uaqibv, C 1 “ uacqjv and δpqi, bq “ pqj , c, Rq.
Definition 26 A TM accepts input w if there is a sequence of configuration C0, . . . , Ck such
that
(1) C0 “ q0w
(2) Ci yields Ci`1 (for any 0 ă i ă k)
(3) Ck is an accepting configuration.
Definition 27 The set of all words accepted by a TM M is the language it recognises:
LpMq “ tw P Σ˚ |M accepts wu.
Recursivity 29
Example 28 A Turing machine that recognises tw7w | w P t0, 1u˚u – where w is the mirror of
w (for instance 001011 “ 110100).
pQ,Σ,Γ, δ, q0, qacc., qrej.q where
(1) Q “ tq0, qremember 0 look for \ go right, qremember 1 look for \ go right, qwrite 0, qwrite 1,
qlook for \ go left, qstep rightu
(2) Σ “ t0, 1u
(3) Γ “ t0, 1,\u
(4) δ : Qˆ Γ ÝÑ Qˆ Γˆ tL,Ru is defined by
pq0,\q ÝÑ qacc.pq0, 0q ÝÑ pqremember 0 look for \ go right,\, Rq
pq0, 1q ÝÑ pqremember 1 look for \ go right,\, Rq
pqremember 0 look for \ go right,\q ÝÑ pqwrite 0,\, Lq
pqremember 0 look for \ go right, 0q ÝÑ pqremember 0 look for \ go right, 0, Rq
pqremember 0 look for \ go right, 1q ÝÑ pqremember 0 look for \ go right, 1, Rq
pqremember 1 look for \ go right,\q ÝÑ pqwrite 1,\, Lq
pqremember 1 look for \ go right, 0q ÝÑ pqremember 1 look for \ go right, 0, Rq
pqremember 1 look for \ go right, 1q ÝÑ pqremember 1 look for \ go right, 1, Rq
pqwrite 0,\q ÝÑ qrej.pqwrite 0, 0q ÝÑ pqlook for \ go left,\, Lq
pqwrite 0, 1q ÝÑ qrej.pqwrite 1,\q ÝÑ qrej.pqwrite 1, 0q ÝÑ qrej.pqwrite 1, 1q ÝÑ pqlook for \ go left,\, Lq
pqlook for \ go left,\q ÝÑ pqstep right,\, Rq
pqlook for \ go left, 0q ÝÑ pqlook for \ go left, 0, Lq
pqlook for \ go left, 1q ÝÑ pqlook for \ go left, 1, Lq
pqstep right,\q ÝÑ qacc.pqstep right, 0q ÝÑ pqremember 0 look for \ go right,\, Rq
pqstep right, 1q ÝÑ pqremember 1 look for \ go right,\, Rq
30 Godel & Recursivity
If we rename the states :
q0 ; q0
qremember 0 look for \ go right ; q1
qremember 1 look for \ go right ; q2
qwrite 0 ; q3
qwrite 1 ; q4
qlook for \ go left ; q5
qstep right ; q6
the transition function becomes:
pq0,\q ÝÑ qacc.pq0, 0q ÝÑ pq1,\, Rq
pq0, 1q ÝÑ pq2,\, Rq
pq1,\q ÝÑ pq3,\, Lq
pq1, 0q ÝÑ pq1, 0, Rq
pq1, 1q ÝÑ pq1, 1, Rq
pq2,\q ÝÑ pq4,\, Lq
pq2, 0q ÝÑ pq2, 0, Rq
pq2, 1q ÝÑ pq2, 1, Rq
pq3,\q ÝÑ qrej.pq3, 0q ÝÑ pq5,\, Lq
pq3, 1q ÝÑ qrej.pq4,\q ÝÑ qrej.pq4, 0q ÝÑ qrej.pq4, 1q ÝÑ pq5,\, Lq
pq5,\q ÝÑ pq6,\, Rq
pq5, 0q ÝÑ pq5, 0, Lq
pq5, 1q ÝÑ pq5, 1, Lq
pq6,\q ÝÑ qacc.pq6, 0q ÝÑ pq1,\, Rq
pq6, 1q ÝÑ pq2,\, Rq
Definition 29 A language L is Turing recognizable if there exists a TM M such that
L “ LpMq.
Proposition 30 Turing Machines with bi-infinite tapes are equivalent to Turing machines.
Proof of Proposition 30: Left as an exercise.
% 30
Proposition 31 2 stack Pushdown automata are equivalent to Turing machines.
Proof of Proposition 31: Left as an exercise.
% 31
Definition 32 A Decider is a TM that halts on all inputs.
Recursivity 31
Definition 33 A language is Turing decidable iff there exists a Decider that recognises it.
Turing recognizable is also called recursively enumerable (r.e. for short) and Decidable is also
called recursive.
Example 34 A Decider for tanbncn | n P wu:
˝ Scan the input from left to right to be sure that it is a member of a˚b˚c˚ and reject if it
isn’t.
˝ Return the head to the left and change one c into an x, then one b into x, then one a into
x. Go back to the first blank \.
Repeat again until the tape is only composed of x, in which case accept. Otherwise reject.
Definition 35 A k tape TM is the same as a TM except that is composed of k tapes: 1 ,. . . , k ,
with k independent heads so that the transition function becomes
δ : Qˆ Γk ÝÑ Qˆ Γk ˆ tL,Ruk
Notice that a configuration of a k-tape Turing machine is of the form
´
u1qv1 , u2qv2 , . . . . . . , ukqvk
¯
1 2 k.
Proposition 36 Given any TM there exist
(1) an equivalent TM with a bi-infinite tape,
(2) a multi-tape TM,
(3) a multi-tape with bi-infinite tapes TM.
Proof of Theorem 36: Left as an exercise. % 36
Theorem 37 Every multi-tape TM has an equivalent single tape TM.
Proof of Theorem 37: Let M be a multi-tape TM. We will describe a TM S that recognises
the same language. Let pw1, w2, . . . , wkq be the input of M on its k tapes. The corresponding
input of S will be 7w17w27 . . . 7wk7, where 7 does not belong to the alphabet of M. To simulate a
single move of M, S scans its tape from the first 7 which marks the left-hand end, to the k`1th
7 (which marks the right-hand end) replacing each letter a right after the 7 symbol (except for
the k ` 1th one) by a to indicate the position of the heads. Then S makes a second pass to
32 Godel & Recursivity
update the tapes according to M’s transition functions. If at any point S moves one of the
virtual heads to the right onto a 7, this action signifies that M has moved the corresponding
head onto the previously unread blank portion of that tape. So S writes a blank symbol on this
tape cell and shifts the tape contents from this cell until the rightmost 7, one unit to the right.
Then it continues the simulation as before.
00 01 t t
01 1 t t t
0 01 1
t t t t
]]]] 1 1
t
10 01 1
t
00 01 t t t10 bt
M
S% 37
2.2 Non-Deterministic Turing Machines
Definition 38 A non-deterministic TM (NTM) is the same as a deterministic TM except for
the transition function which is of the form:
δ : Qˆ Γ ÝÑ PpQˆ Γˆ tL,Ruq.
The computation of a (deterministic) TM is a sequence of configurations
C0 ùñ C1 ùñ . . . ùñ Ck ùñ . . .
that may be finite or infinite.
It accepts the input if this sequence is finite and the last configuration is an accepting one.
The computation of a non-deterministic TM is no more a sequence of configurations but a tree
whose nodes are configurations. This tree may have both infinite and finite branches. The
machine accepts the input if and only if there exists some branch that is finite and whose leaf is
an accepting configuration.
Recursivity 33
Theorem 39 For every NTM there exists a deterministic TM that recognises the same lan-
guage.
Proof of Theorem 39:
2434 2 24 t t t2
Mt t t t
t t t
t t
0 0
0 0
1
111
1
1 1 1 176
1
2
3
We consider a 3-tape ( 1 , 2 and 3 ) deterministic TM M to simulate a NTM N :
˝ (1) 1 is the input tape,
(2) 2 is the simulation tape, and
(3) 3 is the address tape.
˝ Initially, 1 contains the input w and 2 and 3 are empty.
˝ 1 always keeps the input w. So the content of 1 is never modified.
˝ 2 simulates N on one – initial segment of a – branch of its non-deterministic computation
tree.
˝ 3 contains a finite word which corresponds to a succession of non deterministic choices.
For instance the word 132 stands for: among the non-deterministic options choose the first
one for the first transition, the third one for the second and the second one for the third.
This means that we consider k P N to be
maxtCardpδpq, γqq | q P Q, γ P Γu
and for each | q P Q, γ P Γ we fix a total ordering of δpq, γq.
Words on 3 all belong to t1, 2, . . . , ku˚. Moreover, during the running time, the content
of 3 changes over and over again until the machine accepts. This series gives rise to an
enumeration of the infinite k-ary tree in a breadth-first search. This means it enumerates
all words in t1, 2, . . . , ku˚ along the following well-ordering:
u ă v ðñ
|u| ă |v|
or
|u| “ |v| and u ălexic. v
34 Godel & Recursivity
Which gives:
ε, 1, 2, . . . , k, 11, 12, . . . , 1k, 21, 22, . . . , 2k, . . . . . . , k1, k2, . . . , kk, 111, 112, . . . , 11k, . . . . . . . . . . . .
˝ At first, M Copies the content of 1 (= the input w) to 2 .
˝ It then uses 2 to simulate N with input w on the branch b of its non-deterministic
computation which is lodged on 3 . In case the word b does not correspond to a real
computation1 or if the simulation of N on 2 either reaches the rejecting state or does not
reach any halting state at all, then M erases completely 2 , replaces b on 3 with its the
immediate ă-successor, and starts all over again – by copying 1 on 2 and simulating Non 2 in accordance with the series of choices recorded on 3 .
% 39
Proposition 40
˝ Recursive languages are closed under union, intersection and complementation.
˝ Recursively enumerable languages are closed under union and intersection.
Proof of Proposition 40: Left as an exercise.
% 40
Definition 41 An enumerator is a TM. We say that it enumerates a language L if the result
of its computation (possibly infinite) is of the form
w0 \ w1 \ w2 \ . . .\ wn \ wn`1 \ . . . . . .
where twi | i P Nu “ L.
We say that a language L is “recursively enumerable” if there is an enumerator that enumerates
L.
Theorem 42 A language is Turing Recognizable if and only if it is recursively enumerable.
Proof of Theorem 42:
(ñ) from M we build E that enumerates LpMq. Fix a recursive enumeration psiqiPN of Σ˚.
(1) Repeat the following for i “ 1, 2, 3, . . .
(2) Run M for i steps on each input s1, s2, . . . , si
(3) If any computation accepts, print out the corresponding sj .
1this is the case for instance if from the initial configuration q0w there are only two control states non-
deterministically available, whereas the word on 3 reads 3 . . ..
Recursivity 35
(ð) From E we build M: on input w: run E , and every time E outputs some word v, find out
whether v “ w or not, and accept if they are the same.
% 42
Proposition 43 For any infinite L Ď Σ˚,
L is Turing decidable ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
there exits E an enumerator that prints out
u0 \ u1 \ u2 \ . . . . . .\ ui \ ui`1 \ . . . . . . . . .
such that
$
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
%
L “ tui | i P Nu
and
i ă j ùñ
$
&
%
|u| ă |v|
or
|u| “ |v| and u ălexic. v.
Proof of Proposition 43: Left as an exercise.
% 43
2.3 The Concept of Algorithm
In 1900, Hilbert gave a list of the main mathematical problems of the time [26, 27]. The 10th
one was the following: given a Diophantine equation with any number of unknown quantities,
and with rational integral numerical coefficients, can we derive a process according to which
it can be determined in a finite number of operations whether the equation admits a rational
integer solution? This corresponds to the intuitive notion of an algorithm. Proving that such an
algorithm does not exist requires a formal definition of the notion of “algorithm”. The “Church-
Turing thesis” states that the informal notion of an algorithm corresponds exactly to the notion
of a λ-calculus formula or equivalently to a Turing machine.
In 1970, Yuri Matijasevic proved2 that the 10th problem of Hilbert is undecidable [33]: assuming
that the notation P px1, . . . , xnq stands for a polynomial with integer coefficients, then there is
no decider for
tP px1, . . . , xnq | Dpa1, . . . anq P Nn P pa1, . . . , anq “ 0u.
Definition 44 A “coding” is a rule for converting a piece of information into another object.
Given any non empty sets E,F , a coding is a one-to-one (total) function
c : E1´1ÝÝÑ F.
2this is combined work of Martin Davis, Yuri Matiyasevich, Hilary Putnam and Julia Robinson
36 Godel & Recursivity
Example 45 E “ t0, 1u˚, F “ N and c : E1´1ÝÝÑ F is a coding defined by:
cpwq “ 1w2p= the word “1w” read in base 2q.
Notation 46 Given any Turing machine M, we write
˝ Mpwq Ó to say that the machine M stops on input w
‚ Mpwq Ó acc
.
means that M stops in an accepting configuration, and
‚ Mpwq Ó rej.
means that M stops in a rejecting configuration.
˝ Mpwq Ò to say that the machine M never stops on input w.
Definition 47 Given any two non-empty finite sets A,B, a partial function f : A˚ ÝÑ B˚ is
“Turing computable” if and only if there exists a Turing machine Mf such that
˝ on input w R dompfq: Mf pwq Ò, and
˝ on input w P dompfq: Mf pwq Ó acc
.
with the word “fpwq” on its tape.
Remarks 48
(1) Given any finite alphabet Σ, and any TM M whose alphabet is Σ, there exists a Turing
computable coding: c : Σ˚ ÝÑ t0, 1,\u˚ and a TM Mc with tape alphabet t0, 1,\u such
that M accepts w if and only if Mc accepts cpwq.
(2) Every regular language is decidable because a DFA is nothing but a deterministic TM that
always goes right.
(3) Every Context-free language is decidable, because any PDA can be easily simulated by
some equivalent non-deterministic TM.
(4) We have the following strict inclusions of languages.
Regular Ĺ Context-Free Ĺ Decidable
“
Recursive
Ĺ Turing Recognizable.
“
Recursively Enumerable
In computer science, a programming language is said be “Turing complete” or “universal” if
it can be used to simulate any single-tape Turing machine. Examples of Turing-complete pro-
gramming languages include:
Recursivity 37
˝ Ada
˝ C
˝ C++
˝ Common Lisp
˝ Java
˝ Lisp
˝ Pascal
˝ Prolog, etc.
2.4 Universal Turing Machine
If we compare a Turing Machine with a computer, on one hand the TM seems much better
because it can compute for ever without any chance to breakdown and it has an infinitely large
storage facility. But on the other hand, a TM seems to be more of a computer with a single
software program, whereas a computer can run different programs. A computer resemble more
of a Turing machine with finite capacity but, a Turing machine that we can modify by changing
its transition function – every program is like a new transition function for the machine.
How are we going to address this issue, since we claimed that a Turing machine is an abstract
model of computation ? This answer to this is the Universal Turing Machine. It is a machine
that can work just like any other machine provided that we feed it with the right code of the
machine.
We will employ Turing machines to obtain:
(1) a languages that is Turing recognizable but not decidable3,
(2) a language that is not Turing recognizable.
From now on, we only consider Turing Machines with fixed alphabets Σ “ t0, 1u,Γ “ t0, 1,\u.
Any such TM is of the form:
M “ xtq0, q1, . . . , qku, t0, 1u, t0, 1,\u, δ, q0, qacc., qrej.y
Where δ is the description of the transition function of M:
δ “ tpq3, 0, q1, 1, Rq, pq8, 1, q4, 0, Lq, pq3, 0, q3, 0, Lq, . . . . . .u
The description of such a machine is a finite sequence M over some finite alphabet A:!
x, y, q, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, \, L, R, t, u, p, q, ,)
“ A.
Since CardpAq ă 28 we can code any letter l P A by a sequence of eight 0’s and 1’s, i.e we take
any 1-1 mapping
C : A ÝÑ t0, 1ur8s
and we define a Turing computable coding
c : A˚ ÝÑ t0, 1u˚
by
cpa0 . . . apq “ Cpa0q Cpa1q Cpa2q . . .ˆCpapq.
3in other words: a non-recursive recursively enumerable language.
38 Godel & Recursivity
We denote by xMy the code of M, i.e.
xMy “ cpMq.
Clearly, the following language is decidable:
txMy : M is a TMu.
Proposition 49 (Universal Turing Machine) There exists a Turing machine4 U such that
on each input of the form vw P t0, 1u˚,
if v “ xMy for some Turing machine5 M, then U works as M on input w.
Notice that for any word u P t0, 1u˚, if there is a prefix of u which is the code of a Turing
Machine, then this prefix is unique 6. Therefore, in case a word u P t0, 1u˚ can be decomposed
into u “ xMyw for some Turing machine M, this decomposition is then unique.
This means for instance that on any input w:
˝ Upwq Ò if and only if Mpwq Ò;
˝ Upwq Ó rej.
with the word w1 on its tape if and only if Mpwq Ó rej.
with the word w1 on its tape;
˝ Upw1q Ó acc.
with w1 on its tape if and only if Mpwq Ó acc.
with w1 on its tape.
(1) on 1 the input xMyw is inserted. It will never be modified during the rest of the compu-
tation. Then U copies the code of
(a) the transition function of M – xδy – on 2 ;
(b) the initial state of M – xq0y – on 3 7;
(c) the accepting state of M – xqacc.y – on 4 8;
(d) the rejecting state of M – xqrej.y – on 5 9.
(2) It then uses 6 to simulate M on input w: for each step of M
(a) U reads a letter – say 0 – on 6 , and
(b) using the code of the actual state – say xq3y – on 3 , U looks in 2 for the code of the
corresponding transition – say xpq3, 0, q1, 1, Rqy – and then
4working on alphabets ΣU “ t0, 1u and ΓU “ t0, 1,\u5also working on alphabets ΣU “ t0, 1u and ΓU “ t0, 1,\u6this comes from the fact the last letter of a word that defines a TM is y. Therefore, reading u from left to
right by blocks of eight 0’s or 1’s, the first block that corresponds to xyy marks the end of the wanted prefix.7later on this tape will store the code of the actual state that M is on.8the content of 4 will never be modified in the future.9the content of 5 will never be modified in the future.
Recursivity 39
(c) U verifies that the code of the new state – here xq1y – is different from the content of
4 and 5 (otherwise if it corresponds to the content of 4 it means that it is xqacc.y,
and U accepts right away, and if it corresponds to the content of 5 it means it is
xqrej.y, in which case U rejects).
(d) If the new state is different from both qacc. and qrej. – in our example q1 is different
from both qacc. and qrej. – U replaces on 6 the letter it just read with the new one
– here it replaces 0 by 1 – and still on tape 6 it makes the move indicated – here it
goes right – and finally,
(e) U replaces on 3 the code of the old state by the new one – here it replaces xq3y by
xq1y.
U
0 01 1 1111 1 1 00 01 t t10 1
M
01 1 01 1
00 01 1 01 1
00 01 00 0 1
00 01 1 01 1
0
0 01 111 1 10
0 01 1 1111 1 1 00 01 t t10 10
4
5
6
1
2
3
% 49
40 Godel & Recursivity
2.5 The Halting Problem
Proposition 50 The following language is Turing recognizable but not decidable:
txMyw P t0, 1u˚ |M is a TM that accepts wu.
Proof of Proposition 50: Towards a contradiction we assume there exists a Decider D that
decides this language. We build a Turing machine H which works the following way:
on input w
˝ if D accepts ww, then H does not halt.
˝ if D rejects ww, then H accepts.
Notice that
H accepts xHy ðñ D rejects xHyxHy ðñ H does not accept xHy.
Or to say it differently
HpxHyq Ó acc.
ðñ DpxHyxHyq Ó rej.
ðñ HpxHyq Ò .
To see things slightly differently, since the machine H only stops when it accepts we can refor-
mulate the contradiction in
HpxHyq Óðñ HpxHyq Ò .
% 50
Proposition 51 The following language is Turing recognizable but not decidable:
txMy P t0, 1u˚ |Mpεq Óu.
Proof of Proposition 51: Left as an exercise.
% 51
Corollary 52 The following languages are not recursively enumerable:
(1) t0, 1u˚z
xMyw P t0, 1u˚ |Mpwq Ó acc
.
(
(2) t0, 1u˚z
xMy P t0, 1u˚ |Mpεq Ó(
(3)
xMyw P t0, 1u˚ |Mpwq Ó rej.
or Mpwq Ò(
(4)
xMy P t0, 1u˚ |Mpεq Ò(
.
Proof of Corollary 52: Left as an exercise.
% 52
Recursivity 41
2.6 Turing Machine with Oracle
A Turing machine with an oracle is one finite object (a Turing machine suitable for any oracle:
an almost regular 2-tape Turing Machine) plus one infinite object so that this TM can have
access to an infinite amount of information – which a normal one never does.
Definition 53
(1) An oracle is any subset O Ď N.
(2) An oracle-compatible-Turing machine (o-c-TM) is a 2-tape Turing machine similar to any
2-tape Turing machine except that it only reads but never writes on tape 2 :
O “ pQ,Σ,Γ, δ, q0, qacc., qrej.q
(3) An oracle-compatible-Turing machine O equipped with the oracle O, on input word w P Σ˚
(in short an oracle TM OO on word w P Σ˚) is nothing but the TM O whose initial
configuration is´
q0w , q0χO
¯
1 2
where χO P t0, 1uω is the infinite word
χOp0qχOp1qχOp2q . . . . . . χOpnqχOpn` 1q . . . . . . . . . . . .
defined by
χOpnq “
$
’
’
&
’
’
%
1 if n P O
and
0 if n R O.
This means that on tape 2 the whole characteristic function of the oracle is already available
once the machine starts. So that the machine is granted access to all of this ”external” infor-
mation: it knows which integers belong to O and which do not. For instance, in case O is the
set of all integers n such that:
(1) n reads “ 1xMyw ” in the decimal numeral system,
(2) Mpεq Ó;
then OO may be able to decide the Halting Problem. Of course this does not lead to a contra-
diction since there is no chance that such a Turing machine 10 ever sees its own code onto tape
2 (although the code of O – or the code of an equivalent TM – does show on 2 ).
10we are talking about OO and not just O!
42 Godel & Recursivity
OO
0 00 01 10
1 111 1 101
2
t t
00 000 0 0 00 0 0 0 0
Example 54 Let O Ď N be the set of all the codes of Turing machines that halt on the empty
input:
O “ t1xMy2P N |Mpεq Óu.
We describe an oracle-compatible-TM O that, once equipped with the oracle O, decides the
language
txMy P t0, 1u˚ |Mpεq Óu.
The machine OO works this way:
(1) on input w P t0, 1u˚, the TM OO checks whether w is the code of a TM
if it is not the case it rejects right away. Otherwise,
(2) it computes n “ 1xMy2, then checks on tape 2 whether χOpnq “ 1 – in which case it
accepts – or χOpnq “ 0 – in which case it rejects.
Notation 55
˝ Notice that the mapping f : t0, 1u˚ ÐÑ Nw ÞÝÑ 1w
2´ 1
is a bijection.
For any word w we write xwy for fpwq, and for any integer k we write xky for f´1k.
For instance x0010y “ 100102´ 1 “ 18 ´ 1 “ 17, and x12y “ 101 since 1101
2´ 1 “
p8` 4` 1q ´ 1 “ 13´ 1 “ 12.
˝ Given any language L Ď t0, 1u˚, we write OL Ď N for the set
OL “
!
xwy P N | w P L)
“
!
k P N | xky P L)
.
˝ Given any subset O Ď N, we write LpOq Ď t0, 1u˚ for the language
LpOq “!
w P t0, 1u˚ | xwy P O)
“
!
xky P t0, 1u˚ | k P O)
.
Recursivity 43
So OL is the oracle associated with the language L, and LpOq is the language associated with
the oracle O.
Notice that the oracle for the empty language is the empty set: OH “ H.
So, we have
(1) a coding for the Turing machines:
tx, y, q, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,\, L,R, t, u, p, q, ,u˚ÐÑ t0, 1u˚
M ÞÝÑ xMy
(2) a coding for the words:
t0, 1u˚ ÐÑ N
w ÞÝÑ xwy
(3) a coding for the integers:
N ÐÑ t0, 1u˚
k ÞÝÑ xky
We will use the notation xMy instead of xxMyy which means we consider first the word in t0, 1u˚
that codes the Turing machine M, then the integer that codes this word. All we mean is that
xMy is an integer that codes the Turing machine M.
Proposition 56 Given any recursive language L Ď t0, 1u˚, and any oracle Turing machine
OOL:
˝ LpOOLq is recursively enumerable, and moreover
˝ if OOL is an oracle Decider11, then LpOOLq is recursive.
Proof of Proposition 56: Left as an exercise.
% 56
Definition 57 (Turing Reducibility) Given any A,B Ď N,
A is “Turing reducible” to B – denoted A ďT B – if there exists an o-c-TM OB which on empty
tape computes χA.
Proposition 58 Given any A,B Ď N, the following are equivalent:
(1) A is Turing reducible to B,
11meaning that OOL halts on every input.
44 Godel & Recursivity
(2) for every o-c-TM M, there exists an o-c-TM N such that L`
MA˘
“ L`
NB˘
.
Moreover, in case MA is an oracle Decider, we may ensure that NB be one too.
Proof of Proposition 58: Left as an easy exercise.
% 58
Notation 59 Given any A,B Ď N, we write
˝ A ďT B if A is Turing reducible to B;
˝ A ”T B if A ďT B and B ďT A;
˝ A ăT B if A ďT B but B ďT A.
Notice that we have
˝ A ďT A`
hence A ”T A˘
;
˝ pA ďT B and B ďT Cq ùñ A ďT C`
hence pA ”T B and B ”T Cq ùñ A ”T C˘
;
˝ A ”T B ðñ B ”T A.
So that ”T is an equivalence relation.
Examples 60 Given any language L Ď t0, 1u˚,
(1) OL ”T OLA “ NrOL,
(2) H ďT OL,
(3) L is recursive ðñ OL ”T H,
(4) L is not recursive ðñ H ăT OL.
(5) OL ”T OLpOLq holds since we have OL “ OLpOLq .
An equivalence class – rAs”T “ tB Ď N | B ”T Au for some A Ď N – is called a Turing degree.
The ordering on oracles induces an ordering on the set TD of all Turing degrees: given any
d, e P TD,
d ď e ðñ A ďT B holds for some A P d and some B P e
or equivalently
d ď e ðñ A ďT B holds for all A P d and all B P e
Recursivity 45
As usual, the notation
d ă e ðñ d ď e but e ę d
Examples 61 We list a few basic facts about Turing degrees.
(1) Given any d P TDcardpdq “ ℵ0.
The reason is that there are countably many Turing machines and always infinitely many
oracle that are Turing equivalent: for instance, given any A Ď N and any k P N form
Ak “ t2n | n P Au Y t2k ` 1u
We have both A ”T Ak (any k P N) and Ak ‰ Al (any k ‰ l P N).
(2) Given any set A Ď N the set
tB Ď N | B ďT Au
is countable for the reason that there are only countably many Turing machines.
(3) Given any d P TDcard
e P TD | e ď d(
ď ℵ0.
(4) Given any d P TDcard
e P TD | d ď e(
“ 2ℵ0 .
To see this, observe that if
d “ rAs”T
then given any B Ď N the set
A‘B “ t2n | n P Au Y t2n` 1 | n P Bu
satisfies
A ďT A‘B.
Moreover,
card
A‘B | B Ď N(
“ 2ℵ0 .
Since every Turing degree is countable, we obtain
card´
A‘B | B Ď N(
L
”T
¯
“ 2ℵ0
which gives the result.
(5) As Sacks showed in 1961 – see [23] p. 157 and also [40, 41] – the ordering pTD,ďq does
not have a familiar shape since every countable partial ordering pP,ďq can be embedded
into pTD,ďq.
46 Godel & Recursivity
Proposition 62
(1)!
LpOq Ď t0, 1u˚ | O ďT H)
is the class Rec. of all recursive languages.
(2)!
L Ď t0, 1u˚ | OL ďT Halt
)
Ľ R.E . (= the class of all r.e. languages)12.
(3)!
LpOq Ď t0, 1u˚ | O ďT Halt
)
Ľ R.E .
Where Halt stands for the set of codes of Turing machines that halt on the empty input:
Halt “ O xMyPt0,1u˚ | MpεqÓ
(
“
xMy P N | Mpεq Ó(
.
Proof of Proposition 62: Left as an exercise.
% 62
We now introduce an operation called the “jump” which shows that there is no maximum Turing
degree, since from any given oracle A it provides us with some oracle A1 that satisfies A ăT A1.
Definition 63 (jump operator) Given any subset A Ď N, the “jump” of A (denoted A1) is
A1 “ O xMyPt0,1u˚ | M an o-c-TM, MA
pεqÓ(
“
xMy P N | MApεq Ó(
.
Example 64
Halt ”T H1.
Proposition 65 For every A Ď N the set
A: “
α2pxMy, xwyq P N | MApwq Ó(
satisfies
A1 ”T A:.
12notice that the inclusion is strict since HAalt satisfies both HAalt ”T Halt and LpHAaltq R Rec.
Recursivity 47
¨
˚
˝
See page 60 for the definition of α2 : Nˆ N bij.ÐÝÑ N
px, yq ÞÝÑpx`yq¨px`y`1q
2 ` y.
˛
‹
‚
Proof of Proposition 65: Left as an easy exercise. % 65
Proposition 66 For every A Ď N,
A ăT A1.
Proof of Proposition 66: We decompose A ăT A1 into first A ďT A
1, then A1 ďT A.
(A ďT A1) We need to find an o-c-TM M that outputs χA while being equipped with the oracle
A1. To compute χApnq this machine proceeds as follows: it computes the code xN ny of any
o-c-TM N n that, no matter what its input w is, proceeds as follows when it is equipped
with the oracle O:
˝ if χOpnq “ 1, then N npwq Ó;
˝ if χOpnq “ 0, then N npwq Ò.
Then MA1 outputs
χApnq “ χA1pxN nyq.
(A1 ďT A) Towards a contradiction, we assume that A1 ďT A holds. Since A: ”T A1 we have
A: ďT A holds as well. So, there exists an o-c-TM N such that NA computes χA: .
We build an o-c-TM H such that HA on every input w P t0, 1u˚:
(1) computes k “ α2pxwy, xwyq, then
(2) by making use of N as a subprogram, computes the value χA:pkq, then
˝ if χA:pkq “ 0, then HApwq Ó;
˝ if χA:pkq “ 1, then HApwq Ò.
We obtain the following contradiction:
HApxHyq Ó ðñ α2pxHy, xHyq R A: ðñ HApxHyq Ò .
Below we show a picture that illustrates this diagonal argument that we have just used. If
pMiqiPN is a enumeration of all the oracle-compatible Turing machines, then we made sure
that the machine H we built is none of them by ensuring that for each i P N, there exists
48 Godel & Recursivity
an input word (its own code xMiy) such that HA has a completely different behaviour
than MAi on this word.
MA0 MA
1 MA2 MA
3 MA4 MA
5 MAn
xM0y 0 1 1 0 1 0 . . . 0 . . .
xM1y 1 1 1 0 0 0 . . . 0 . . .
xM2y 1 0 1 0 0 0 . . . 1 . . .
xM3y 0 0 1 0 1 0 . . . 0 . . .
xM4y 0 1 0 1 1 1 . . . 0 . . .
xM5y 1 1 0 0 0 0 . . . 0 . . .
......
......
......
......
xMny 1 0 0 0 1 1 . . . 1 . . ....
......
......
......
...
Diagonal argument: swap 0’s and 1’s on the diagonal.
% 66
Corollary 67 The following strict ordering between jumps is satisfied:
H ăT H1 ăT H
2 ăT . . . ăT H
nhkkikkj
2 ¨ ¨ ¨ 1 ăT H
n`1hkkikkj
2 ¨ ¨ ¨ 1 ăT . . . ăT H
ωhkkikkj
2 ¨ ¨ ¨ ăT H
ω`1hkkikkj
2 ¨ ¨ ¨ 1 ăT . . . .
where
k P H
ωhkkikkj
2 ¨ ¨ ¨ 1 ðñ
$
’
’
’
’
&
’
’
’
’
%
k “ pn`mqpn`m`1q2 `m
and
m P H
nhkkikkj
2 ¨ ¨ ¨ 1 .
Proof of Corollary 67: Let us use the notations Hpnq for H
nhkkikkj
2 ¨ ¨ ¨ 1 and Hpωq for H
ωhkkikkj
2 ¨ ¨ ¨ .
Recursivity 49
The only thing one needs to prove is that
Hpnq ăT Hpωq
holds for every integer n.
Hpnq ďW Hpωq is almost immediate, since it is straightforward to build an o-c-TM On that
outputs χHpnq when it is equipped with the oracle Hpωq since
χHpnqpmq “ χHpωq
ˆ
pn`mqpn`m` 1q
2`m
˙
.
Hpωq ďW Hpnq it is enough to proceed by contradiction and show that
Hpωq ďW Hpnq
would imply
Hpn`1q ďW Hpnq.
% 67
Iterating the jump operator into the transfinite
Notice that if for every limit countable ordinal λ we fix some bijection
fλ : N ÐÑ λˆ Nk ÞÝÑ pα,mq
we may then define an uncountable sequence of jumps`
Hpαq˘
αăω1by ordinal induction:
˝ Hp0q “ H
˝ Hpα`1q “ Hpαq1
˝ Hpλq “ tfλpα,mq P N | m P Hpαqu.
It is immediate to see that the sequence`
Hpαq˘
αăω1is strictly ăT -increasing, or in other words
Hpαq ăT Hpβq
holds for every α ă β ă ω1.
50 Godel & Recursivity
Chapter 3
Recursive Functions
The whole chapter is highly inspired by Rene Cori and Daniel Lascar book’s book: “Math-
ematical Logic, Part 2, Recursion Theory, Godel Theorems, Set Theory, Model Theory” [9].
Recursive functions are functions from Np to N. We will show that they have a strong relation
with the Turing computable ones.
We define the set of recursive functions by induction. For this purpose, for any integer p, we
denote by NpNpq the set of all mappings of the form Np ÝÑ N. Notice that Np is a notation for
the set of all mappings ti P N | i ă pu ÝÑ N. When p “ 0, the set ti P N | i ă pu becomes
ti P N | i ă 0u “ H. Thus the set N0 only contains one element: the empty function whose
graph is H. Therefore the set of all mappings of the form N0 ÝÑ N contains all mappings that
assign one integer to the empty function:
N0 ÝÑ N “"
f : tHu ÝÑ NH ÝÑ n
ˇ
ˇ
ˇ
ˇ
n P N*
.
So, as may be expected, mappings in NpN0q are identified with elements of N.
3.1 Primitive Recursive Functions
Definition 68
projection: If i is any integer such that 1 ď i ď p holds, the ith projection πpi is the function
of NpNpq defined by
πpi px1, . . . , xpq “ xi
successor: S P NN is the successor function1.
1Spnq “ n` 1.
52 Godel & Recursivity
composition: Given f1, . . . , fn P NpNpq and g P NpNnq, the composition h “ gpf1, . . . , fnq P NpN
pq
is defined by
hpx1, . . . , xpq “ g`
f1px1, . . . , xpq, . . . , fnpx1, . . . , xpq˘
We often make use the notation ÝÑx for px1, . . . , xpq so that for instance g`
f1pÝÑx q, . . . , fnpÝÑx q
˘
stands for g`
f1px1, . . . , xpq, . . . , fnpx1, . . . , xpq˘
.
recursion: Given g P NpNpq and h P NpNp`2q, there exists a unique f P NpNp`1q such that for allÝÑx P Np and y P N satisfies
(1) fpÝÑx , 0q “ gpÝÑx q
(2) fpÝÑx , y ` 1q “ h`
ÝÑx , y, fpÝÑx , yq˘
We say f is defined by recursion on both g (for the initial step) and h (for the successor
steps).
Definition 69 The set of primitive recursive (Prim. Rec.) functions is the least that
(1) contains:
(a) All constants Np ÝÑ N (all i P NpNpq s.t. ipÝÑx q “ i – any i, p P N).
(b) All projections πpi (any p P N, any 1 ď i ď p)
(c) The successor function S P NN.
(2) and is closed under
(a) composition
(b) recursion
We set up these functions in a hierarchy pRnqnPN:
(1) R0 is the set of all functions in (1)(a),(1)(b) and (1)(c).
(2) Rn`1 is the closure2 of Rn under (2)(a) and (2)(b).
Clearly
R “ď
nPNRn.
Example 70
2Rn`1 “ Rn Y th obtained by composition on the basis of functions in Rnu Y th obtained by induction on the
basis of functions in Rnu.
Recursivity 53
(1) Addition: px, yq ÝÑ x` y
We have:"
x` 0 “ x
x` py ` 1q “ px` yq ` 1.(3.1)
Formally:#
addpx, 0q “ π11pxq
addpx, y ` 1q “ S´
π33
`
x, y, addpx, yq˘
¯
.(3.2)
(2) Multiplication: px, yq ÝÑ x ¨ y
We have"
x ¨ 0 “ 0
x ¨ py ` 1q “ x ¨ y ` x.(3.3)
Formally:
#
multpx, 0q “ 0pxq
multpx, y ` 1q “ add´
π33
`
x, y,multpx, yq˘
, π31
`
x, y,multpx, yq˘
¯
.(3.4)
(3) Exponentiation: x ÝÑ nx
We have"
n0 “ 1
nx`1 “ nx ¨ n.(3.5)
Formally:#
expnp0q “ 1
expnpx` 1q “ mult´
π22
`
x, expnpxq˘
, n¯
.(3.6)
(4) Factorial: x ÝÑ x!
We have"
0! “ 1
px` 1q! “ x! ¨ px` 1q.(3.7)
Formally:$
&
%
factp0q “ 1
factpx` 1q “ mult
ˆ
π22
`
x, factpxq˘
, S´
π21
`
x, factpxq˘
¯
˙
.(3.8)
54 Godel & Recursivity
Example 71 We define 9 P NpN2q by
"
x 9 y “ x´ y if x ą y,
“ 0 otherwise.
We show that 9 P NpN2q belongs to Prim. Rec. by first showing that : x ÝÑ x 9 1 belongs to
Prim. Rec."
0 9 1 “ 0
px` 1q 9 1 “ x(3.9)
Formally:"
0 9 1 “ 0pxq
px` 1q 9 1 “ π21
`
x, x 9 1˘ (3.10)
"
x 9 0 “ x
x 9 py ` 1q “`
x 9 y˘
9 1(3.11)
Formally:#
x 9 0 “ π11pxq
x 9 py ` 1q “´
π33
`
x, y, x 9 y˘
¯
9 1(3.12)
Definition 72 A set A Ď Np is primitive recursive (Prim. Rec.) if its characteristic function
(χA P NpNpq) is primitive recursive.
Example 73
(1) The set H is Prim. Rec. since χH “ 0 is Prim. Rec.
(2) The set N is Prim. Rec. since χN “ 1 is Prim. Rec.
(3) The set ăN“ tpx, yq | x ă yu is Prim. Rec. χăNpx, yq “ 1 9 p1 9 py 9 xqq.
On computable and partial functions
Definition 74
(1) pdomf , fq is a partial function Np ÝÑ N if f is a mapping domf ÝÑ N where domf Ď Np.
(2) pdomf , fq is a total function Np ÝÑ N if domf “ Np holds.
Recursivity 55
We say that f is undefined on x – or fpxq is undefined – if x R domf .
Notation 75 We write f P NpdomĎNpq for pdomf , fq is a partial function Np ÝÑ N whose
domain is domf .
Notice that given any two partial functions f, g P NpdomĎNpq,
f “ g ðñ
$
&
%
domf “ domg
and
@x fpxq “ gpxq.
Definition 76 A partial function f P NpdomĎNpq is “Turing Computable” (TC) if there exists
a TM M such that on input ÝÑx “ px1, . . . , xpq:
(1) if fpÝÑx q is not defined, then MpÝÑx q Ò;
(2) if pÝÑx q P domf , MpÝÑx q Ó with fpÝÑx q written on its tape.
Proposition 77 Given any partial function f P NpdomĎNpq,
f is Turing Computable ðñ Gf “ `
ÝÑx , fpxq˘
| ÝÑx P domf
(
is Turing Recognizable.
Proof of Proposition 77:
(ñ) From M that computes f it is immediate to build N that recognises Gf . On input pÝÑx , yq
it simulates M if MpÝÑx , yq Ó acc.
it compares fpxq with y and if fpxq “ y it accepts, otherwise
it rejects.
(ð) From N that recognises Gf , we build M that computes f as follows, on input ÝÑx repeatedly
for i “ 1, 2, 3, . . . it recursively simulates N on pÝÑx , 0q, pÝÑx , 1q, pÝÑx , 2q, . . . , pÝÑx , iq for i many
steps. If N accepts pÝÑx , nq, then M prints out the value n.
% 77
Corollary 78 Given any function f : Np ÝÑ N,
f is both total and Turing Computable ùñ Gf is recursive (decidable).
Proof of Corollary 78: Left as an immediate exercise.
% 78
56 Godel & Recursivity
f P NpNpq f P NpdomĎNpq
Gf Ď Np`1recursive
||
decidable
rec. enum.
||
Turing rec.
Figure 3.1: Relations between Turing computable functions and their graphs
Remark 79 All functions in R0 are total and Turing computable. By induction on n, it is easy
to show that all functions in Rn are also total and Turing computable. Therefore
˝ All Prim. Rec. functions are total and Turing computable.
˝ All graphs of Prim. Rec. functions are recursive
Even though the class of all Prim. Rec. functions is included in the class of total and turing
computable functions, the inverse inclusion does not hold3.
3.2 Variable Substitution
Proposition 80 (PPPrim. RRRec. closed under variable substitution)
If f P NpNpq, is Prim. Rec., then given any σ : t1, . . . , pu ÝÑ t1, . . . , pu, the function g P NpNpqdefined by
gpx1, . . . , xpq “ fpxσp1q, . . . , xσppqq
is also Prim. Rec.
Proof of Proposition 80: The result is proved for all g P Rn by induction on n. Left as an
exercise.
% 80
Proposition 81 If A Ď Nk is Prim. Rec. and f1, . . . , fn P NpNkq are Prim. Rec. then
tÝÑx P Np | pf1pÝÑx q, . . . , fnpÝÑx qq P Au
is Prim. Rec.3see exercise on the Ackermann function A P NpN
2q defined by
Apm,nq “
$
&
%
n` 1 if m “ 0,
Apm´ 1, 1q if m ą 0 and n “ 0,
A`
m´ 1, Apm,n´ 1q˘
if m ą 0 and n ą 0.
Apm,nq is fast growing ; for instance 2 ¨ 1019728ă Ap4, 2q ă 3 ¨ 1019728.
Recursivity 57
Proof of Proposition 81: Set B “ tÝÑx P Np | pf1pÝÑx q, . . . , fnpÝÑx qq P Au. We have
χBpÝÑx q “ χA
´
f1pÝÑx q, . . . , fnpÝÑx q
¯
.
% 81
Example 82 If f, g P NpNpq are Prim. Rec., then the following sets are also Prim. Rec.:
(1) tÝÑx | fpÝÑx q ą gpÝÑx qu (2) tÝÑx | fpÝÑx q “ gpÝÑx qu (3) tÝÑx | fpÝÑx q ă gpÝÑx qu.
Proposition 83 If A,B Ď Np are Prim. Rec. then A Y B,A X B,A r B, A∆B and Np r A
are all Prim. Rec.
Proof of Proposition 83:
χAYB “ 1 9
`
1 9 pχA ` χBq˘
χAXB “ χA ¨ χBχArB “ χA ¨
`
1 9 χB˘
χA∆B “`
1 9 χA ¨ χB˘
¨
ˆ
1 9
´
`
1 9 χA˘
¨`
1 9 χB˘
¯
˙
χAc “ 1 9 χA.
% 83
Proposition 84 (Case study) If f1, . . . , fn`1 P NpNpq and A1, . . . , An P Np are all Prim. Rec.,
then g P NpNpq defined by:
gpÝÑx q “
$
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
%
f1pÝÑx q if ÝÑx P A1
f2pÝÑx q if ÝÑx P A2 rA1
f3pÝÑx q if ÝÑx P A3 r pA1 YA2q...
......
fipÝÑx q if ÝÑx P Ai r pA1 YA2 Y . . .YAi´1q...
......
fn`1pÝÑx q if ÝÑx R pA1 Y . . .YAnq
is also Prim. Rec.
Proof of Proposition 84: g “ f1 ¨ χA1 ` f2 ¨ χpA2rA1q ` . . .` fn`1 ¨ χ`A1YA2Y...YAn
˘A . % 84
Corollary 85 sup(x1, . . . , xn) and inf(x1, . . . , xn) are Prim. Rec.
58 Godel & Recursivity
Proof of Corollary 85: Left as an exercise.
% 85
Proposition 86 f P NpNp`1q is Prim. Rec., then g, h P NpNpq below are Prim. Rec.:
gpx1, . . . , xpq “
t“yÿ
t“0
fpx1, . . . , xp, tq,
hpx1, . . . , xpq “
t“yź
t“0
fpx1, . . . , xp, tq.
Proof of Corollary 86: Left as an exercise(both are easily defined by induction).
% 86
3.3 Bounded Minimisation and Bounded Quantification
Proposition 87 (Bounded minimisation) If A Ď Np`1 is Prim. Rec., then f P NpNp`1q
defined below is also Prim. Rec.:
fpÝÑx , zq “
"
0 if @t ď z pÝÑx , tq R A,
the least t ď z such that pÝÑx , tq P A otherwise.
fpÝÑx , zq is denoted by µt ď z pÝÑx , tq P A.
Proof of Proposition 87: f is defined by:$
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
%
fpÝÑx , 0q “ 0
fpÝÑx , z ` 1q “
$
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
%
fpÝÑx , zq ify“zř
y“0χApÝÑx , yq ě 1
z ` 1 ify“zř
y“0χApÝÑx , yq “ 0 and pÝÑx , z ` 1q P A
0 ify“z`1ř
y“0χApÝÑx , yq “ 0.
% 87
Proposition 88 (PPPrim. RRRec. closed under bounded quantification) The set of all Prim. Rec.predicates is closed under bounded quantification: i.e. If A Ď Np`1 is Prim. Rec., then
˝ tpÝÑx , zq : Dt ď z pÝÑx , tq P Au ˝ tpÝÑx , zq : @t ď z pÝÑx , tq P Au
are both Prim. Rec.
Proof of Proposition 88: Set
Recursivity 59
˝ B “ tpÝÑx , zq : Dt ď z pÝÑx , tq P Au, ˝ C “ tpÝÑx , zq : @t ď z pÝÑx , tq P Au.
We have
˝ χBpÝÑx , zq “ 1 9 p1 9
t“zř
t“0χApÝÑx , tqq, ˝ χCpÝÑx , zq “
t“zś
t“0χApÝÑx , tqq.
% 88
Example 89
˝ t2n : n P Nu is Prim. Rec. It is defined by recursion"
χp0q “ 0
χpn`1q “ 1 9 χpnq
˝ The mapping P NpN2q px, yq ÝÑ
„
x
y
defined below is Prim. Rec.:$
’
&
’
%
„
x
y
“ 0 if y “ 0
“ integer part ofx
yotherwise.
Formally$
&
%
„
x
y
“ 0 if y “ 0
“ µt ď x y ¨ pt` 1q ą x otherwise.
˝
px, yq | y divides x(
P Prim. Rec.:
χpx, yq “ 1 9
˜
x 9
ˆ
y ¨
„
x
y
˙
¸
.
˝ Prime “ tx P N | x is a prime numberu P Prim. Rec.:
x P Prime ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
%
x ą 1
and
@y ď x
$
’
’
’
’
&
’
’
’
’
%
y “ 1
or
y “ x
or
y does not divide x.
60 Godel & Recursivity
˝ Π : N ÝÑ N defined by Π pnq “ n` 1th prime number P Prim. Rec.."
Π p0q “ 2
Π pn` 1q “ µz ď pΠ pnq!` 1q z ą Π pnq and z P Prime.
3.4 Coding Sequences of Integers
We define Prim. Rec. functions that allow to treat finite sequences of integers as integers.
Every sequence xx1, . . . , xpy will be “coded” by a single integer αppx1, . . . , xpq. And from this
single integer αppx1, . . . , xpq one will be able to recover the elements of the original sequence by
having Prim. Rec. functions βip that satisfy
βip
´
αppx1, . . . , xpq¯
“ xi.
Proposition 90 For every non-zero p P N there exists Prim. Rec. functions β1p , β
2p , . . . , β
pp P NN
and αp P NpNpq such that
$
’
’
’
’
’
&
’
’
’
’
’
%
αp : Np 1´1 and ontoÐÝÝÝÝÝÝÝÝÑ N
and
α´1p pxq “
`
β1ppxq, . . . , β
pppxq
˘
.
Proof of Proposition 90: We start by defining α1 “ β11 “ id. Then we move on to
α2px, yq “px` yq ¨ px` y ` 1q
2` y.
This is obtained by looking at the following picture and noticing that
(1) α2px, yq “ α2px` y, 0q ` y, and
(2) α2px` y, 0q “ 1 ` 2 ` ¨ ¨ ¨ ` px` yq
“ 12
˜ 1
`
x` y
`
2
`
x` y ´ 1
` ¨ ¨ ¨ `
x` y
`
1
¸
.
Recursivity 61
0,4
0,3
0,2
0,0
0,1
1,3
1,2
1,0
1,1
3,2
3,0
3,1
2,3
2,2
2,0
2,1
4,0
4,1
5,0
0 1
2
5
9
14
4
8
13
3
7
12
18
6
11
17
10
16
15
19
We have
(1) β12pnq “ µx ď n Dt ď n α2px, tq “ n
(2) β22pnq “ µy ď n Dt ď n α2pt, yq “ n.
Then we define αp`1, β1p`1, β
2p`1, . . . . . . , β
p´1p`1 , β
pp`1 and βp`1
p`1 by induction on p P N:
˝ αp`1px1, . . . , xp, xp`1q “ αp`
x1, . . . , xp´1, α2pxp, xp`1q˘
˝ β1p`1 “ β1
p ;
˝ β2p`1 “ β2
p ;
...
˝ βp´1p`1 “ βp´1
p ;
˝ βpp`1 “ β12 ˝ β
pp ;
˝ βp`1p`1 “ β2
2 ˝ βpp .
% 90
62 Godel & Recursivity
Example 91 A different way of coding sequences of integers:
"
cpεq “ 1
cpx0, . . . , xpq “ Π p0qx0`1¨Π p1qx1`1
¨ ¨ ¨Π ppqxp`1.
From n P Nrt0u we recover the sequence xx0, . . . , xpy such that cpx0, . . . , xpq “ n by considering
the Prim. Rec. function d P NpN2q which yields the exponents of the prime numbers:
dpi, nq “ µx ď n Π piqx`1 does not divide n.
3.5 Partial Recursive Functions
We recall that
(1) pdomf , fq is a partial function Np ÝÑ N if f is a mapping domf ÝÑ N where domf Ď Np.
(2) pdomf , fq is a total function Np ÝÑ N if domf “ Np holds.
We say that f is undefined on x – or fpxq is undefined – if x R domf .
We use the notation f P NpdomĎNpq to signify that pdomf , fq is a partial function Np ÝÑ Nwhose domain is domf .
Notice that for any two partial functions f, g P NpdomĎNpq:
f “ g holds ðñ
$
&
%
domf “ domg
and
@x fpxq “ gpxq.
Definition 92 (composition) Given f1, . . . , fn P NpdomĎNpq and g P NpdomĎNnq, the composi-
tion h “ gpf1, . . . , fnq P NpNpq is defined by
$
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
%
hpÝÑx q is undefined iff
$
’
’
’
’
’
’
&
’
’
’
’
’
’
%
ÝÑx Rč
1ďiďn
domfi
or otherwise
`
f1pÝÑx q, . . . , fnpÝÑx q
˘
R domg.
hpÝÑx q is defined otherwise and hpÝÑx q “ g`
f1pÝÑx q, . . . , fnpÝÑx q
˘
.
“ g`
f1px1, . . . , xpq, . . . , fnpx1, . . . , xpq˘
Recursivity 63
Definition 93 (recursion) Given g P NpdomĎNpq and h P NpdomĎNp`2q, there exists a unique
f P NpdomĎNp`1q such that for all ÝÑx P Np and y P N:
(1)$
&
%
fpÝÑx , 0q is undefined if ÝÑx R domg
and
fpÝÑx , 0q is defined otherwise with fpÝÑx , 0q “ gpÝÑx q.
(2)$
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
%
fpÝÑx , y ` 1q is undefined if
$
’
’
’
’
&
’
’
’
’
%
pÝÑx , yq R domf
or
`
ÝÑx , y, fpÝÑx , yq˘
R domh.
and
otherwise fpÝÑx , y ` 1q is defined and fpÝÑx , y ` 1q “ h`
ÝÑx , y, fpÝÑx , yq˘
.
Definition 94 (minimization) Given f P NpdomĎNp`1q, we define g P NpdomĎNpq by:
gpÝÑx q “ µy fpÝÑx , yq “ 0.
Notice that
gpÝÑx q “ y ðñ
$
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
%
@z ă y
$
’
’
&
’
’
%
fpÝÑx , zq is defined!
and
fpÝÑx , zq ą 0
and
fpÝÑx , yq “ 0.
Definition 95 (partial recursive functions) The set of partial recursive (Part. Rec.) func-
tions is the least that
(1) contains:
(a) All constants Np ÝÑ N (all i P NpNpq s.t. ipÝÑx q “ i – any i, p P N).
(b) All projections πpi (any p P N, any 1 ď i ď p)
(c) The successor function S P NN.
(2) and is closed under
64 Godel & Recursivity
(a) composition
(b) recursion
(c) minimisation.
Our next goal is to show that a function f is in Part. Rec. if and only if it is Turing computable.
One direction is easy, the other one is more involved. One side effect of our proof will show that
every partial recursive function can be obtained by applying the minimisation at most once.
Lemma 96 Every partial recursive function is Turing computable.
Proof of Lemma 96: We need to show that given any p P N r t0u and any f P NpdomĎNpq there
exists some Turing machine M that computes f . This means that on input pn1, . . . , npq it
stops in configuration qacc.fpn1, . . . , npq if pn1, . . . , npq P domf , and it never stops otherwise. Of
course, we need to fix a certain representation of both integers and finite sequence of integers.
For simplicity, let us say that the integers are represented in base-ten and the sequences as
pn1, . . . , npq so that the input alphabet is
Σ “!
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, p, q, ,)
.
So, for instance a TM computes Add if on input word “p385, 218q” it returns the word “603”.
We do the proof by induction on the number of operation among
˝ composition ˝ recursion ˝ minimisation
that are necessary to obtain f P NpdomĎNpq on the basis of
˝ all constants ˝ all projections ˝ the successor function.
(1) It is quite obvious that
˝ if f P NpdomĎNpq is constant, then there exists some basic TM that computes it.
˝ Every projection πpi (any 1 ď i ď p) is also trivially computable.
˝ The successor function is clearly computable as well.
(2) (a) Assume f1, . . . , fn P NpdomĎNpq are computed respectively by Mf1 , . . . ,Mfn and g P
NpdomĎNnq is computed by Mg. Then f “ gpf1, . . . , fnq P NpNpq is computed by Mf
which works as follows:
on input ÝÑx “ pn1, . . . , npq:
successively for each i :“ 1, . . . ,n Mf simulates Mfi on input ÝÑx , if MfipÝÑx q Ó a
cc.
with some output mi it stores mi.
(In case all simulation of machines Mf1 , . . . ,Mfn do stop) Mf finally simulates Mg
on input pm1, . . . ,mnq.
It is clear that if either
Recursivity 65
(A) ÝÑx Rč
1ďiďn
domfi or (B)´
f1pÝÑx q, . . . , fnpÝÑx q
¯
R domg,
then Mf pÝÑx q Ò. In the opposite case, Mf p
ÝÑx q Ó acc.
with the right answer.
(b) Assume g P NpdomĎNpq and h P NpdomĎNp`2q are computed respectively by Mg and
Mh. Then f defined by recursion:
(A) fpÝÑx , 0q “ gpÝÑx q
(B) fpÝÑx , y ` 1q “ h`
ÝÑx , y, fpÝÑx , yq˘
is computed by Mf which works as follows:
˝ on input pÝÑx , 0q it simply simulates Mg on input ÝÑx , and
˝ on input pÝÑx , n ` 1q Mf first simulates Mg on input ÝÑx which gives4 fpÝÑx , 0q.
Then
recursively for i :“ 0, . . . ,n Mf simulates Mh on`
ÝÑx , i, fpÝÑx , iq˘
which yields5
fpÝÑx , i` 1q.
It is clear that Mf brings the result if and only if every step fpÝÑx , iq (i :“ 0, . . . , n`1)
is defined. Otherwise it simply never stops.
(c) Assume g P NpdomĎNp`1q is computed by Mg. We design Mf that on input ÝÑx
computes
µy gpÝÑx , yq “ 0.
set i :“ 0 Mf simulates Mg on input pÝÑx , iq. If Mg stops and outputs the value of
gpÝÑx , iq,
˝ if gpÝÑx , iq “ 0 Mf stops and outputs i,
˝ if gpÝÑx , iq ‰ 0, Mf starts over again with i :“ i` 1.
Notice that Mf stops and outputs n “ µy gpÝÑx , yq “ 0 if and only if
˝ @i ď n pÝÑx , iq P domg,
˝ @i ă n gpÝÑx , iq ą 0 and
˝ gpÝÑx , nq “ 0.
% 96
Lemma 97 Every Turing computable partial function f P NpdomĎNpq is Part. Rec.
Proof of Lemma 97: We show an even stronger result: given any Turing Machine M and any
recursive coding of words on the tape alphabet Γ we show that the partial function Σ˚ ÝÑ Γ˚
which maps v P Σ˚ to w P Γ˚ if and only if the Turing machine from the initial configuration
4in case MgpÝÑx q Ó a
cc.
.
5in case Mh
`
ÝÑx , i, fpÝÑx , iq˘
Ó acc.
.
66 Godel & Recursivity
q0v stops in some configuration w0qacc.w1 with w0w1 “ w is partial recursive in the code. This
means the function f 1 P NpdomĎN1q defined by
#
f 1`
codepvq˘
is undefined if Mpvq Ò or Mpvq Ó rej.
;
f 1`
codepvq˘
“ codepw0w1q if M Ó acc.
in config. w0qacc.w1.
We first choose a coding of the configurations of M: We assume
˝ Σ “ t1, . . . , k ´ 1u and Γ “ t0, . . . , k ´ 1u with k ą 1 and necessarily 0 “ \.
˝ Q “ tq0, . . . , qmu with q0, q1, q2 being respectively the initial state, the rejecting state and
the accepting state.
The coding of a word w “ a0 . . . an that we choose is
xa0 . . . any “ÿ
0ďiďn
ai ¨ ki.
This coding is not injective (this will not matter for our purpose) for any two word which differ
by the tailing blanks in their prefix will have the same encoding:
xa0 . . . any “ xa0 . . . an\y.
But on the other hand, this encoding is surjective.
A configuration w0qrw1 of the Turing machine will be coded by
xw0qrw1y “ α4pr, xw0y, xw1y, |w0|q.
For instance, that the initial configuration of the Turing machine with input w is:
xq0wy “ α4p0, 0, xwy, 0q
“ α2
´
0, α2
`
0, α2pxwy, 0q˘
¯
“ α2
´
0, α2
`
0, xwypxwy`1q2
˘
¯
“ α2
´
0,
`
xwypxwy`1q2
˘`
xwypxwy`1q2
`1˘
2
¯
“
¨
˝
`
xwypxwy`1q2
˘`
xwypxwy`1q2 `1
˘
2
˛
‚¨
¨
˝
`
xwypxwy`1q2
˘`
xwypxwy`1q2 `1
˘
2`1
˛
‚
2 .
To say that w is an input word is to say that w P Σ˚ (we will identify words of the form w P Σ˚
with words of the form w\ . . .\ since our coding will not be able to distinguish them6 and also
because the input word really is the infinite word w \ . . .\ . . .).
6remember that this is the reason why we chose 0 for the coding of the blank symbol.
Recursivity 67
So we see that a word w “ a0 . . . an P Γ˚ is an input word if for no i ă n we have both ai “ \ and
ai`1 ‰ \. This means that xa0 . . . any “ a0 ¨k0`a1 ¨k
1` . . .`an ¨kn satisfies ai “ 0 ñ ai`1 “ 0
(any i ă n). With our coding, we recover the coefficient ai as
ai “
„
xa0 . . . any
ki
9
ˆ„
xa0 . . . any
ki`1
¨ k
˙
.
Therefore the set InputM of all the codes of input words of M is Prim. Rec.:
χInputMpmq “ 1 if @i ď m”m
ki
ı
9
´” m
ki`1
ı
¨ k¯
“ 0 ùñ
” m
ki`1
ı
9
´” m
ki`2
ı
¨ k¯
ą 0
“ 0 otherwise
Since the coding of words that we choose is surjective, it comes that a configuration C is an
initial configuration if and only if there exists m P InputM
xCy “
ˆ`
mpm`1q2
˘`
mpm`1q2
`1˘
2
˙
¨
ˆ`
mpm`1q2
˘`
mpm`1q2
`1˘
2 ` 1
˙
2.
Therefore the set InitM of all the codes of initial configurations of M is Prim. Rec.
χInitMpcq “
$
&
%
1 if Dm ď c`
χInputMpmq “ 1 ^ α4p0, 0,m, 0q “ c˘
,
0 otherwise.
We now describe the transition from a given configuration C to the next configuration C 1
(C ñ C 1), in other words, we analyse the we obtain the code of C 1 on the basis of both the code
of C and the transition function δ.
A transition yields a move of the head either to the right or to the left: δpqr, alq “ pqr1 , al1 , Rq or
δpqr, alq “ pqr1 , al1 , Lq. We need to consider differently these two forms, together with differen-
tiating also whether the head can or cannot move to the left when the transition function says
so7.
When δpqr,alq “ pqr1 ,al1 ,Rq, we have C ñ C 1 is w0qrw1 ñ w10qr1w11 with
(1) w10 “ w0al1 (2) |w10| “ 1` |w0| (3) alw11 “ w1.
so that
(1) xw10y “ xw0y` l1 ¨ k|w0| “ β24pxCyq ` l1 ¨ kβ
44pxCyq
7this means whether or not the head is already in position 0 and the transition is of the form
δpqr, alq “ pqr1 , al1 , Lq.
68 Godel & Recursivity
(2) |w10| “ |w0| ` 1 “ β44pxCyq ` 1
(3) alw11 “ w1 so that xw11y “
„
β34pxCyq
k
.
So, we obtain:
if
$
’
’
’
’
&
’
’
’
’
%
β14pxCyq “ r
and
β34pxCyq 9
ˆ
k ¨
„
β34pxCyq
k
˙
“ l,
then
xC 1y “ α4
ˆ
r1, β24pxCyq ` l1 ¨ kβ
44pxCyq,
„
β34pxCyq
k
, β44pxCyq ` 1
˙
.
When δpqr,alq “ pqr1 ,al1 ,Lq, there are two different cases depending on whether the head can
move to the left or not.
if w0 “ ε, then we have C ñ C 1 is w0qrw1 ñ w10qr1w11 with
(1) w10 “ ε
(2) |w10| “ |w0| “ |ε|
(3) w11 “ al1v and w1 “ alv for some word v.
So that we get
(1) xw10y “ xεy “ 0
(2) |w10| “ |ε| “ 0
(3) xw11y “ l1 `
„
β34pxCyq
k
¨ k.
So, all in all we obtain:
Recursivity 69
if
$
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
%
β14pxCyq “ r
and
β34pxCyq 9
ˆ
k ¨
„
β34pxCyq
k
˙
“ l,
and
β44pxCyq “ 0
then
xC 1y “ α4
ˆ
r1, 0, l1 `
„
β34pxCyq
k
¨ k, 0
˙
.
if w0 ‰ ε, then we have C ñ C 1 is w0qrw1 ñ w10qr1w11 with
(1) w10al “ w0
(2) |w10| “ |w0| ´ 1
(3) w11 “ al1w1.
so that
(1) xw10y “ β24pxCyq 9
„
β24pxCyq
kpβ44pxCyq 9 1q
¨ kpβ44pxCyq 9 1q
(2) |w10| “ β44pxCyq 9 1
(3) xw11y “ l1 ` β34pxCyq ¨ k.
So, we have found:
if
$
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
%
β14pxCyq “ r
and
β34pxCyq 9
ˆ
k ¨
„
β34pxCyq
k
˙
“ l,
and
β44pxCyq ‰ 0
70 Godel & Recursivity
then
xC 1y “ α4
ˆ
r1, β24pxCyq 9
„
β24pxCyq
kpβ44pxCyq 9 1q
¨ kpβ44pxCyq 9 1q, l1 ` β3
4pxCyq ¨ k, β44pxCyq 9 1
˙
.
To wrap up everything that we did so far, we recursively define a mapping f : N2 ÝÑ N such
that if n codes a word on Σ – i.e. n “ xwy for some w P Σ˚ – then fpn, tq “ xCn,ty where Cn,tstands for the configuration that the Turing machine reaches after t-many steps from the initial
configuration q0w.
Since the machine stops if it reaches an accepting or a rejecting configuration, we will simply
assume that in any of these two cases the configuration of the Turing machines remains the
same: if Cn,t is either an accepting or a rejecting configuration, then Cn,t`x “ Cn,t holds for
every x P N.
We set δL and δR are the two following finite – hence Prim. Rec. – subsets of N4:
δL “!
pr, l, r1, l1q P t0, . . .mu ˆ t0 . . . k ´ 1u ˆ t0, . . .mu ˆ t0 . . . k ´ 1u δpr, lq “ pr1, l1, Lq)
and
δR “ t0, . . .mu ˆ t0 . . . k ´ 1u ˆ t0, . . .mu ˆ t0 . . . k ´ 1u r δL.
For our convenience we assume that Γ “ Σ Y t\u. This way the mapping f : N2 ÝÑ N we
currently construct is total (f P NpN2q). For readability we use the notation ki
for βi4pkq (any
k P N, i ď 4).
initial case
fpn, 0q “
$
’
&
’
%
1 if n R InputM
α4p0, 0, n, 0q if n P InputM
successor case
fpn, t`1q “
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
fpn, tq if fpn, tq1“ 1 or fpn, tq
1“ 2;
α4
˜
r1, fpn, tq2` l1 ¨ kfpn,tq
4
,
«
fpn, tq3
k
ff
, fpn, tq4` 1
¸
if
˜
fpn, tq1, fpn, tq
39
˜
k ¨
«
fpn, tq3
k
ff¸
, r1, l1
¸
P δR;
α4
˜
r1, 0, l1 `
«
fpn, tq3
k
ff
¨ k, 0
¸
if
$
’
’
’
’
’
’
&
’
’
’
’
’
’
%
˜
fpn, tq1, fpn, tq
39
˜
k ¨
«
fpn, tq3
k
ff¸
, r1, l1
¸
P δL
and
fpn, tq4“ 0;
α4
˜
r1, fpn, tq2
9
«
fpn, tq2
k
´
fpn,tq4
9 1¯
ff
¨ k
´
fpn,tq4
9 1¯
, l1 ` fpn, tq3¨ k, fpn, tq
49 1
¸
if
$
’
’
’
’
’
’
&
’
’
’
’
’
’
%
˜
fpn, tq1, fpn, tq
39
˜
k ¨
«
fpn, tq3
k
ff¸
, r1, l1
¸
P δL
and
fpn, tq4‰ 0.
72 Godel & Recursivity
Notice that f P NpN2q is Prim. Rec. and that Mpwq Ó acc.
if and only if there exists some t P Nsuch that β1
4
`
fpxwy, tq˘
“ 2.
Moreover, in this case, we recover the code of the content of the tape wt from fpxwy, tq by
xwty “ β24
`
fpxwy, tq˘
` kβ44
`
fpxwy,tq˘
¨ β34
`
fpxwy, tq˘
.
Finally, we only need to fix both (1) a recursive representation of the natural numbers and (2)
what it means for a machine to compute a partial function.
(1) we fix our coding of integers: every integer n is coded by the word 11 . . . 1loomoon
n
. The function
x y : N ÝÑ Nn ÞÝÑ xny
such that xny “ÿ
iăn
1 ¨ ki (i.e. xny is the code of the word 11 . . . 1loomoon
n
) is Prim. Rec.:
$
&
%
x0y “ 0
xn` 1y “ xny` kn.
(2) We only consider Turing machines that on any input words of the form
nhkkikkj
11 . . . 1, provided
they reach an accepting configuration, they reach one of the form 11 . . . 1loomoon
n1
qacc..
We define the function fM P NpdomĎNrq that M computes by:
˝ fMpn1, . . . , nrq is undefined if on input
αrpn1,...,nrqhkkikkj
11 . . . 1 either M Ò or M Ó rej.
;
˝ fMpn1, . . . , nrq “ n if on input
αrpn1,...,nrqhkkikkj
11 . . . 1 M Ó acc.
in configuration 11 . . . 1loomoon
n
qacc..
Then the function leastM P NpdomĎNrq that picks the minimum number of steps – if any
– the machine takes before reaching an accepting configuration when starting from the
initial one q0 11 . . . . . . 1loooomoooon
αrpn1,...,nrq
is defined by
leastMpn1, . . . , nrq “ µt β14 ˝ f
`
xαrpn1, . . . , nrqy, t˘
“ 2.
It is undefined if the machine never halts or halts on the rejecting state.
Recursivity 73
At last, we are ready to provide the desired fM P NpdomĎNrq. We make use of the fact the
position of the head in an accepting configuration indicates precisely the number of 1’s
there are on the tape:
fMpn1, . . . , nrq “ β44 ˝ f
´
xαrpn1, . . . , nrqy, leastMpn1, . . . , nrq¯
.
% 97
Corollary 98
Every partial recursive function admits a construction that requires at most once minimisation.
Proof of Corollary 98: This is an immediate consequence of the whole proof of Lemma 97.
% 98
Theorem 99 For every k ą 0 and every f P NpdomĎNkq the following are equivalent
˝ f is Part. Rec.,
˝ f is Turing computable.
Proof of Theorem 99: Follows immediately from Lemmas 96 and 97. % 99
74 Godel & Recursivity
Part II
Arithmetic
Chapter 4
Representing Functions
4.1 Robinson Arithmetic
We start by describing a first order theory called Robinson Arithmetic. The language we consider
is LA “ t0, S,`, ¨u where
(1) 0 is a constant symbol,
(2) S is a unary function symbol1,
(3) ` and ¨ are binary function symbols2.
The axioms are
axiom 1. @x Sx ‰ 0
axiom 2. @x Dy px ‰ 0 Ñ Sy “ xq
axiom 3. @x @y pSx “ Sy Ñ x “ yq
axiom 4. @x x`0 “ x
axiom 5. @x @y´
x`Sy “ Spx`yq¯
axiom 6. @x x¨0 “ 0
axiom 7. @x @y´
x¨Sy “ px¨yq`x¯
1for any terms of LA t, we use the notation St instead of Sptq.2for any terms of LA t0, t1, we use the notation t0`t1 (respectively t0¨t1) instead of `pt0, t1q (respectively
¨pt0, t1q).
78 Godel & Recursivity
Example 100 The standard model of Robinson Arithmetic is
〈N, 0, S,`, ¨〉
where S is the successor function, ` is the usual addition, and ¨ is the customary multiplication.
By abuse of notation we identify N with the model 〈N, 0, S,`, ¨〉. So that, for instance, we will
write
N |ù φ
instead of the correct notation
〈N, 0, S,`, ¨〉 |ù φ.
Example 101 A very simple non standard model of Robinson arithmetic M in which
˝ SM admits a fixed point.
˝ ¨M is not commutative.
M “ 〈NY tau, 0MSM,`M, ¨M〉Where 0M “ 0 and the operations SM,`M, ¨M are defined the usual way on the integers.
i.e
˝ SM æ N “ S ˝ `M æ N “ ` ˝ ¨M æ N “ ¨
And when the unique non standard integer a is involved:
˝ SMa “ a
˝ a`Mα “ α`Ma “ a (any α P NY tau)
˝ a¨M0 “ 0
˝ α¨Ma “ a (any α P NY tau)
˝ a¨Mα “ a (any α P`
Nr t0u˘
Y tau)
We verify that
M |ù Rob.
axiom 1. since the only non standard integer verifies SMa “ a we have
M |ù @x Sx ‰ 0
Arithmetic 79
axiom 2. since every standard integer from 0 has a predecessor, and SMa “ a, so we have
M |ù @x Dy px ‰ 0 Ñ Sy “ xq
axiom 3. holds for standard integers, and for every n P N we have SMa ‰ SMn, thus
M |ù @x @y pSx “ Sy Ñ x “ yq
axiom 4. holds for standard integers, and we have a`M0 “ a, hence
M |ù @x x`0 “ x
axiom 5. if k, n P N, then k`MSMn “ SMpk`Mnq holds. If α P NY tau, we have
˝ a`MSMα “ a
˝ SMpa`Mαq “ SMa “ a
˝ α`MSMa “ α`Ma “ a
˝ SMpα`Maq “ SMa “ a
therefore we have
M |ù @x @y´
x`Sy “ Spx`yq¯
.
axiom 6. if α P NY tau, we have α¨M0 “ 0. Thus
M |ù @x x¨0 “ 0
axiom 7. if k, n P N and α P NY tau, then
˝ a¨MSMα “ a
˝ α¨MSMa “ a
˝ pa¨Mαq`Ma “ a
˝ pα¨Maq`Mα “ a
˝ k¨MSMn “ pk¨Mnq`Mk
so we have
M |ù @x @y´
x¨Sy “ px¨yq`x¯
.
Notation 102 For any integer n, we write n for the LA-term S . . . Sloomoon
n
0.
Example 103 Let us show that the following holds for all integers k:
Rob. $c @x`
0`x “ k ÝÑ x “ k˘
(4.1)
80 Godel & Recursivity
We will make use of the excluded middle:
$c @x`
x “ 0 _ x ‰ 0˘
and distinguish between the two cases.
The proof is by induction on k:
if k “ 0:
if x “ 0: since $c 0 “ 0 holds, we obtain
Rob. $c 0`0 “ 0 ÝÑ 0 “ 0
if x ‰ 0: by 2 @x Dy px ‰ 0 Ñ Sy “ xq it is enough to show
Rob. $c @y`
0`Sy “ 0 ÝÑ Sy “ 0˘
by 5 @x @y`
x`Sy “ Spx`yq˘
this comes down to establishing
Rob. $c @y`
Sp0`yq “ 0 ÝÑ Sy “ 0˘
which is immediate by 1 @x Sx ‰ 0 .
if k “ n` 1:
if x “ 0: we need to show
Rob. $c 0`0 “ n` 1 ÝÑ 0 “ n` 1.
By 4 @x x`0 “ x this comes down to showing
Rob. $c 0 “ n` 1 ÝÑ 0 “ n` 1.
because of 1 @x Sx ‰ 0 we have
Rob. $c 0 ‰ n` 1
which yields the result.
if x ‰ 0: by 2 @x Dy px ‰ 0 Ñ Sy “ xq it is enough to show
Rob. $c @y`
0`Sy “ n` 1 ÝÑ Sy “ n` 1˘
Arithmetic 81
by 5 @x @y`
x`Sy “ Spx`yq˘
this comes down to establishing
Rob. $c @y`
Sp0`yq “ n` 1 ÝÑ Sy “ n` 1˘
which is exactly
Rob. $c @y`
Sp0`yq “ Sn ÝÑ Sy “ Sn˘
by 3 @x @y pSx “ Sy Ñ x “ yq this amounts to showing
Rob. $c @y`
0`y “ n ÝÑ Sy “ Sn˘
.
The induction hypothesis gives
Rob. $c @y`
0`y “ n ÝÑ y “ n˘
from where we immediately get what we want.
Example 104 Let us show that the following holds for all integers k:
Rob. $c @x@y`
Sy`x “ k ÝÑ Spy`xq “ k˘
. (4.2)
We make use of the excluded middle:
$c @x`
x “ 0 _ x ‰ 0˘
and distinguish between the two cases.
if x “ 0: we need to show
Rob. $c @y`
Sy`0 “ k ÝÑ Spy`0q “ k˘
which is immediate by 4 @x x`0 “ x .
if x ‰ 0: it is enough to show
Rob. $c @y@z`
Sy`Sz “ k ÝÑ Spy`Szq “ k˘
.
The proof goes by induction on k:
if k “ 0: we need to show
Rob. $c @y@z`
Sy`Sz “ 0 ÝÑ Spy`Szq “ 0˘
.
82 Godel & Recursivity
By 5 @x @y`
x`Sy “ Spx`yq˘
this comes down to
Rob. $c @y@z`
SpSy`zq “ 0 ÝÑ Spy`Szq “ 0˘
which trivially holds by 1 @x Sx ‰ 0 .
if k “ n` 1: we need to show
Rob. $c @y@z`
Sy`Sz “ n` 1 ÝÑ Spy`Szq “ n` 1˘
.
By 5 @x @y`
x`Sy “ Spx`yq˘
this comes down to
Rob. $c @y@z`
SpSy`zq “ Sn ÝÑ Spy`Szq “ n` 1˘
.
By 3 @x @y pSx “ Sy Ñ x “ yq this amounts to proving
Rob. $c @y@z`
Sy`z “ n ÝÑ Spy`Szq “ n` 1˘
.
if z “ 0: we need to show
Rob. $c @y`
Sy`0 “ n ÝÑ Spy`S0q “ n` 1˘
.
By 4 @x x`0 “ x and 5 @x @y`
x`Sy “ Spx`yq˘
this comes down to
showing
Rob. $c @y`
Sy “ n ÝÑ SSy “ n` 1˘
.
which holds by definition.
if z ‰ 0: what we need to prove is equivalent to
Rob. $c @y@z1`
Sy`Sz1 “ n ÝÑ Spy`SSz1q “ n` 1˘
.
By 3 @x @y pSx “ Sy Ñ x “ yq this comes down to showing
Rob. $c @y@z1`
Sy`Sz1 “ n ÝÑ y`SSz1 “ n˘
.
The induction hypothesis yields
Rob. $c @y@z1`
Sy`Sz1 “ n ÝÑ Spy`Sz1q “ n˘
.
from where we easily get the result by 5 @x @y`
x`Sy “ Spx`yq˘
.
Arithmetic 83
4.2 Representable Functions
Definition 105 Let f P NpNnq and φpx0, x1, . . . , xnq be any LA-formula whose free variables are
among tx0, x1, . . . , xnu.
φpx0, x1, . . . , xnq represents the function f if for all i1, . . . , in P N
Rob. $c @x0
´
fpi1, . . . , inq “ x0 ÐÑ φpx0, i1, . . . , inq¯
.
Definition 106 Let A Ď Nn and φpx1, . . . , xnq be any LA-formula whose free variables are
among tx1, . . . , xnu.
φpx1, . . . , xnq represents the set A if for all i1, . . . , in P N we have:
˝ if pi1, . . . , inq P A, then Rob. $c φ`
i1, . . . , in˘
;
˝ if pi1, . . . , inq R A, then Rob. $c φ`
i1, . . . , in˘
.
Proposition 107 For any A Ď Nn,
A is representable if and only if χA is representable.
Proof of Proposition 107:
(ñ) If A is represented by φpx1, . . . , xnq, then χA is represented by`
x0 “ 1^ φpx1, . . . , xnq˘
_`
x0 “ 0^ φpx1, . . . , xnq˘
.
(ð) If χA is represented by φpx0, x1, . . . , xnq, then A is represented by
φpS0, x1, . . . , xnq.
% 107
Example 108 The constant function f P NpNnq defined by fpi1, . . . , inq “ k (any i1, . . . , in P N)
is represented by the following formula of the form φpx0, i1, . . . , inq:
x0 “ k.
It is enough to verify
Rob. $c @x0
´
fpi1, . . . , inq “ x0 ÐÑ x0 “ k¯
.
which is exactly
Rob. $c @x0
´
k “ x0 ÐÑ x0 “ k¯
.
84 Godel & Recursivity
Example 109 The projection πnj P NpNnqis represented by the formula:
x0 “ ij .
It is enough to verify
Rob. $c @x0
´
πnj pi1, . . . , inq “ x0 ÐÑ x0 “ ij
¯
.
i.e.
Rob. $c @x0
´
ij “ x0 ÐÑ x0 “ ij
¯
.
Example 110 The successor S P NN is represented by the formula:
x0 “ Sx1.
It is enough to verify
Rob. $c @x0
´
Spiq “ x0 ÐÑ x0 “ Si¯
.
i.e.
Rob. $c @x0
´
Si “ x0 ÐÑ x0 “ Si¯
.
Example 111 The addition ` P NpN2q is represented by the formula:
x0 “ x1`x2.
It is enough to verify
Rob. $c @x0
´
i1 ` i2 “ x0 ÐÑ x0 “ i1`i2
¯
(4.3)
The proof is by induction on i2:
i2 “ 0 because of 4 @x x`0 “ x we have
Rob. $c @x0
´
i1 “ x0 ÐÑ x0 “ i1`0¯
which is
Rob. $c @x0
´
i1 ` 0 “ x0 ÐÑ x0 “ i1`0¯
.
Arithmetic 85
i2 “ i` 1 by 5 @x @y`
x`Sy “ Spx`yq˘
we have
Rob. $c @x0
´
Spi1`iq “ x0 ÐÑ x0 “ i1`Si¯
The induction hypothesis yields
Rob. $c @x0
´
i1 ` i “ x0 ÐÑ x0 “ i1`i¯
hence we obtain
Rob. $c @x0
´
Spi1 ` iq “ x0 ÐÑ x0 “ i1`Si¯
by the very definition of the terms involved we finally have
Rob. $c @x0
´
i1 ` pi` 1q “ x0 ÐÑ x0 “ i1`pi` 1q¯
.
Example 112 The multiplication ¨ P NpN2q is represented by the formula:
x0 “ x1¨x2.
It is enough to verify
Rob. $c @x0
´
i1 ¨ i2 “ x0 ÐÑ x0 “ i1¨i2
¯
. (4.4)
The proof is by induction on i2:
i2 “ 0
because of 6 @x x¨0 “ 0 we have
Rob. $c @x0
´
0 “ x0 ÐÑ x0 “ i1¨0¯
which is
Rob. $c @x0
´
i1 ¨ 0 “ x0 ÐÑ x0 “ i1¨0¯
.
i2 “ i` 1
by 7 @x @y`
x¨Sy “ px¨yq`x˘
we have
Rob. $c @x0
´
i1¨Si “ x0 ÐÑ x0 “ pi1¨iq`i1
¯
86 Godel & Recursivity
which is exactly
Rob. $c @x0
´
i1¨pi` 1q “ x0 ÐÑ x0 “ pi1¨iq`i1
¯
The induction hypothesis yields
Rob. $c @x0
´
i1 ¨ i “ x0 ÐÑ x0 “ i1¨i¯
so we have
Rob. $c @x0
´
i1¨pi` 1q “ x0 ÐÑ x0 “ pi1 ¨ iq`i1
¯
by 7 @x @y`
x¨Sy “ px¨yq`x˘
and (4.3) we have
Rob. $c @x0
´
pi1 ¨ iq ` i1 “ x0 ÐÑ x0 “ pi1 ¨ iq`i1
¯
which is exactly
Rob. $c @x0
´
i1 ¨ pi` 1q “ x0 ÐÑ x0 “ pi1 ¨ iq`i1
¯
and we finally obtain
Rob. $c @x0
´
i1 ¨ pi` 1q “ x0 ÐÑ x0 “ i1¨pi` 1q¯
.
Lemma 113 The set of representable functions is closed under composition.
Proof of Lemma 113: Assume f1, . . . , fn P NpNpq and g P NpNnq are represented respectively
by φf1px0, x1, . . . , xpq, . . . , φfnpx0, x1, . . . , xpq and φgpx0, x1, . . . , xnq. i.e. we have for all integers
i1, . . . , ip, k1, . . . , kn and 1 ď j ď n:
Rob. $c @x0
´
fjpi1, . . . , ipq “ x0 ÐÑ φfj px0, i1, . . . , ipq¯
and
Rob. $c @x0
´
gpk1, . . . , knq “ x0 ÐÑ φgpx0, k1, . . . , knq¯
.
The function
h “ gpf1, . . . , fnq P NpNpq
defined by
hpi1, . . . , ipq “ g`
f1pi1, . . . , ipq, . . . , fnpi1, . . . , ipq˘
Arithmetic 87
is represented by
φhpx0, x1, . . . , xpq “ Dy1 Dy2 . . . Dyn
´
ľ
1ďjďn
φfj pyj , x1, . . . , xpq ^ φgpx0, y1, . . . , ynq¯
.
Indeed, by the very definition of h for every i1, . . . , ip P N we have
$c @x0
ˆ
hpi1, . . . , ipq “ x0 ÐÑ Dy1 Dy2 . . . Dyn
´
ľ
1ďjďn
fjpi1, . . . , ipq “ yj ^ gpy1, . . . , ynq “ x0
¯
˙
.
Therefore
Rob. $c @x0
ˆ
hpi1, . . . , i1q “ x0 ÐÑ Dy1 Dy2 . . . Dyn
´
ľ
1ďjďn
φfj pyj , i1, . . . , i1q ^ φgpx0, y1, . . . , ynq¯
˙
.
% 113
We now turn to minimisation. We need to prove that if A Ď Nn`1 is representable and f P NpNnqis some total function defined by minimisation the following way:
fpi1, . . . , inq “ µk pk, i1, . . . , inq P A,
then f is representable.
This proof requires some good amount of preliminary work.
Example 114 We first notice that
˝ for all non-zero integer i the following holds
Rob. $c i ‰ 0. (4.5)
To see this, let i “ j ` 1, by the very definition of the terms involved we have
$c i “ Sj
hence by 1 @x Sx ‰ 0 we obtain
Rob. $c Sj ‰ 0
which gives the result.
˝ for all integers i, j such that i ‰ j the following holds
Rob. $c i ‰ j. (4.6)
the proof is by induction on minti, ju:
88 Godel & Recursivity
minti, ju “ 0 : this is case 4.5 Rob. $c i ‰ 0 for all i P N, i ‰ 0 .
minti, ju ą 0 : set k ` 1 “ i and n` 1 “ j.
By 3 @x @y pSx “ Sy Ñ x “ yq we have
Rob. $c @x @y px ‰ y Ñ Sx ‰ Syq.
so that we easily obtain
Rob. $c k ‰ nÑ Sk ‰ Sn
which is precisely
Rob. $c k ‰ nÑ k ` 1 ‰ n` 1
i.e.
Rob. $c k ‰ nÑ i ‰ j.
By induction hypothesis we have
Rob. $c k ‰ n,
therefore by modus ponens we finally get
Rob. $c i ‰ j.
˝ The following holds
Rob. $c @x@y`
y ‰ 0 ÝÑ x`y ‰ 0˘
. (4.7)
By 2 @x Dy px ‰ 0 Ñ Sy “ xq 5 @x @y`
x`Sy “ Spx`yq˘
and 1 @x Sx ‰ 0
we obtain
Rob. $c @x@yDz´
y ‰ 0 ÝÑ py “ Sz ^ x`Sz “ Spx`zq ^ Spx`zq ‰ 0˘
¯
which immediately yields the result.
˝ The following holds
Rob. $c @x@y´
x`y “ 0 ÝÑ px “ 0 ^ y “ 0q¯
. (4.8)
By previous result 4.7 Rob. $c @x@y`
y ‰ 0 ÝÑ x`y ‰ 0˘
we see that
Rob. $c @x@y`
x`y “ 0 ÝÑ y “ 0˘
.
and by 4 @x x`0 “ x we obtain immediately the result.
Arithmetic 89
Notation 115 We introduce “ x ď z” to abbreviate the formula “ Dy y`x “ z”. We also
introduce “ x ă z” for the formula “ Dy`
y`x “ z ^ x ‰ z˘
”.
Example 116 We establish
Rob. $c @x x ă 0 (4.9)
We recall that x ă y stands for “ Dz`
z`x “ y ^ x ‰ y˘
”.
So we need to prove
Rob. $c @x Dz`
z`x “ 0 ^ x ‰ 0˘
which is
Rob. $c @x @z`
z`x ‰ 0 _ x “ 0˘
.
This is logically equivalent to
Rob. $c @x @z`
z`x “ 0 ÝÑ x “ 0˘
.
Which is also logically equivalent to 4.7 Rob. $c @x@y`
y ‰ 0 ÝÑ x`y ‰ 0˘
.
Example 117 For all integer n the following holds:
Rob. $c @x”
x ď nÐÑ`
x “ 0 _ x “ S0 _ . . . _ x “ n˘
ı
. (4.10)
The direction
Rob. $c @x´
`
x “ 0 _ x “ S0 _ . . . _ x “ n˘
ÝÑ x ď n¯
First, by making use of 4 @x x`0 “ x and 5 @x @y`
x`Sy “ Spx`yq˘
, the very def-
inition of k “ S . . . Sloomoon
k
0 and “ x ď z”:= “Dy`
y`x “ z ^ x ‰ z˘
”, it is straightforward to
establish by induction on n
Rob. $c @x”
`
x “ 0 _ x “ S0 _ . . . _ x “ n˘
ÝÑ Dy`
y`x “ n˘
ı
.
So it only remains to prove
Rob. $c @x”
x ď n ÝÑ`
x “ 0 _ x “ S0 _ . . . _ x “ n˘
ı
.
The proof is by induction on n:
90 Godel & Recursivity
n “ 0 : we need to show
Rob. $c @x`
x ď 0 ÝÑ x “ 0˘
which is
Rob. $c @x`
Dy y`x “ 0 ÝÑ x “ 0˘
i.e.
Rob. $c @x`
Dy y`x “ 0 _ x “ 0˘
i.e.
Rob. $c @x`
@y y`x ‰ 0 _ x “ 0˘
i.e.
Rob. $c @x@y`
y`x ‰ 0 _ x “ 0˘
i.e.
Rob. $c @x@y`
y`x “ 0 ÝÑ x “ 0˘
.
We easily obtain the result by 4.8 Rob. $c @x@y`
x`y “ 0 ÝÑ px “ 0 ^ y “ 0q˘
n “ k` 1 : we need to show
Rob. $c @x´
x ď k ` 1 ÝÑ`
x “ 0 _ x “ S0 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
which really is
Rob. $c @x´
Dy y`x “ k ` 1 ÝÑ`
x “ 0 _ x “ S0 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
i.e.
Rob. $c @x@y´
y`x “ k ` 1 ÝÑ`
x “ 0 _ x “ S0 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
We make use of the excluded middle:
$c @y`
y “ 0 _ y ‰ 0˘
and distinguish between the two cases:
y “ 0: by 4.1 Rob. $c @x`
0`x “ k ÝÑ x “ k˘
we obtain
Rob. $c @x`
0`x “ k ` 1 ÝÑ x “ k ` 1˘
.
Arithmetic 91
y ‰ 0: by 2 @x Dy px ‰ 0 Ñ Sy “ xq what we need to show comes down to
Rob. $c @x@z´
Sz`x “ k ` 1 ÝÑ`
x “ 0 _ x “ S0 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
by 4.2 Rob. $c @x@y`
Sy`x “ k ÝÑ Spy`xq “ k˘
we already know that
Rob. $c @x@z`
Sz`x “ k ÝÑ Spz`xq “ k˘
so that we need to prove
Rob. $c @x@z´
Spz`xq “ k ` 1 ÝÑ`
x “ 0 _ x “ 1 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
By 3 @x @y pSx “ Sy Ñ x “ yq we only need to prove
Rob. $c @x@z´
z`x “ k ÝÑ`
x “ 0 _ x “ 1 _ . . . _ x “ k _ x “ k ` 1˘
¯
which is
Rob. $c @x´
Dz z`x “ k ÝÑ`
x “ 0 _ x “ 1 _ . . . _ x “ k _ x “ k ` 1˘
¯
i.e.
Rob. $c @x´
x ď k ÝÑ`
x “ 0 _ x “ 1 _ . . . _ x “ k _ x “ k ` 1˘
¯
.
By induction hypothesis gives
Rob. $c @x´
x ď k ÝÑ`
x “ 0 _ x “ 1 _ . . . _ x “ k˘
¯
so that we obtain the result very easily.
So we have proved the following two statements:
(1) Rob. $c @x@y´
y “ 0 ÝÑ`
x`y “ k ` 1 ÝÑ x “ k ` 1˘
¯
and
(2) Rob. $c @x@y
ˆ
y ‰ 0 ÝÑ´
x`y “ k ` 1 ÝÑ`
x “ 0_ x “ 1_ . . ._ x “ k˘
¯
˙
.
Therefore, by an immediate application of the excluded middle we have proved the result.
92 Godel & Recursivity
Example 118 For all integer n the following holds:
Rob. $c @x`
x ď n _ n ď x˘
. (4.11)
What we need to show is
Rob. $c @x`
Dy y`x “ n _ Dy y`n “ x˘
.
We make use of the excluded middle:
$c @x`
x “ 0 _ x ‰ 0˘
and distinguish between the two cases.
if x “ 0: we need to show
Rob. $c Dy y`0 “ n _ Dy y`n “ 0
which is immediate by 4 @x x`0 “ x .
if x ‰ 0: what wee need to prove comes down to
Rob. $c @z`
Dy y`Sz “ n _ Dy y`n “ Sz˘
.
The proof goes by induction on n:
if n “ 0 : we need to prove
Rob. $c @z`
Dy y`Sz “ 0 _ Dy y`0 “ Sz˘
.
By 4 @x x`0 “ x this comes down to
Rob. $c @z`
Dy y`Sz “ 0 _ Dy y “ Sz˘
which is immediate.
if n “ k` 1 : we need to prove
Rob. $c @z`
Dy y`Sz “ k ` 1 _ Dy y`pk ` 1q “ Sz˘
.
By 5 @x @y`
x`Sy “ Spx`yq˘
and 3 @x @y pSx “ Sy Ñ x “ yq this
amounts to proving
Rob. $c @z`
Dy y`z “ k _ Dy y`k “ z˘
which is exactly the induction hypothesis.
Arithmetic 93
We have already proved
p4.1q Rob. $c @x`
0`x “ k ÝÑ x “ k˘
p4.2q Rob. $c @x@y`
Sy`x “ k ÝÑ Spy`xq “ k˘
p4.3q Rob. $c @x0
`
i1 ` i2 “ x0 ÐÑ x0 “ i1`i2˘
p4.4q Rob. $c @x0
`
i1 ¨ i2 “ x0 ÐÑ x0 “ i1¨i2˘
p4.5q Rob. $c i ‰ 0 (any i P N, i ‰ 0)
p4.6q Rob. $c i ‰ j (any i, j P N, i ‰ j)
p4.7q Rob. $c @x@y`
y ‰ 0 ÝÑ x`y ‰ 0˘
p4.8q Rob. $c @x@y`
x`y “ 0 ÝÑ px “ 0 ^ y “ 0q˘
p4.9q Rob. $c @x x ă 0
p4.10q Rob. $c @x`
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq˘
p4.11q Rob. $c @x`
x ď n _ n ď x˘
Lemma 119 Let A Ď Nn`1 be representable. If the following function f P NpNnq is total, then
f is representable.
fpi1, . . . , inq “ µk pk, i1, . . . , inq P A,
Proof of Lemma 119: Assume φpx0, x1, . . . , xnq represents the set A. We claim the function f
is represented by the formula
φpx0, x1, . . . , xnq ^ @y ă x0 φpy, x1, . . . , xnq.
We need to show that for all i1, . . . , in P N
Rob. $c @x0
ˆ
fpi1, . . . , inq “ x0 ÐÑ
´
φpx0, i1, . . . , inq ^ @y ă x0 φpy, i1, . . . , inq¯
˙
.
(We writeÝÑi for i1, . . . , in and
ÝÑi for i1, . . . , in)
(ñ) (1) by the very definition of f and the fact that φpx0, x1, . . . , xnq represents A we trivially
have :
Rob. $c φpfpÝÑi q,ÝÑi q
¯
which is equivalent to
Rob. $c @x0
´
fpÝÑi q “ x0 ÝÑ φpx0,
ÝÑi q
¯
.
94 Godel & Recursivity
(2) To show
Rob. $c @x0
´
fpÝÑi q “ x0 ÝÑ @y ă x0 φpy,
ÝÑi q
¯
we show the equivalent
Rob. $c @y´
y ă fpÝÑi q ÝÑ φpy,
ÝÑi q
¯
We have two cases
if fpÝÑi q “ 0: we make use of 4.9 Rob. $c @x x ă 0 which settles this case.
if fpÝÑi q “ k` 1: by the very definition of f and the fact that φpx0, x1, . . . , xnq rep-
resents A we trivially have :
Rob. $c φp0,ÝÑi q ^ φpS0,
ÝÑi q ^ . . . ^ φpk,
ÝÑi q
which sums up to
Rob. $c @y´
`
y “ 0 _ y “ S0 _ . . . _ y “ k˘
ÝÑ φpy,ÝÑi q
¯
by 4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
we ob-
tain
Rob. $c @y`
y ă k ` 1 ÝÑ py “ 0 _ y “ S0 _ . . . _ y “ kq˘
which yields
Rob. $c @y´
y ă k ` 1 ÝÑ φpy,ÝÑi q
¯
.
(ð) we need to show
Rob. $c @x0
ˆ
´
φpx0,ÝÑi q ^ @y ă x0 φpy,
ÝÑi q
¯
ÝÑ fpÝÑi q “ x0
˙
.
We prove the result by contraposition, which means we prove
Rob. $c @x0
ˆ
fpÝÑi q ‰ x0 ÝÑ
´
φpx0,ÝÑi q ^ @y ă x0 φpy,
ÝÑi q
¯
˙
.
By 4.11 Rob. $c @x`
x ď n _ n ď x˘
we have
Rob. $c @x0
`
x0 ď fpÝÑi q _ fp
ÝÑi q ď x0
˘
Which is also
Rob. $c @x0
`
x0 ă fpÝÑi q _ fp
ÝÑi q ă x0 _ x0 “ fp
ÝÑi q
˘
Arithmetic 95
so that we only need to prove
Rob. $c @x0
ˆ
`
x0 ă fpÝÑi q ^ fp
ÝÑi q ă x0
˘
ÝÑ
´
φpx0,ÝÑi q ^ @y ă x0 φpy,
ÝÑi q
¯
˙
.
We will successively prove
(1) Rob. $c @x0
ˆ
x0 ă fpÝÑi q ÝÑ
´
φpx0,ÝÑi q ^ @y ă x0 φpy,
ÝÑi q
¯
˙
.
We have two cases
if fpÝÑi q “ 0: we make use of 4.9 Rob. $c @x x ă 0 which settles this case.
if fpÝÑi q “ k` 1: by 4.10 Rob. $c @x
“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
Rob. $c @x0
`
x0 ă k ` 1 ÝÑ px0 “ 0 _ x0 “ S0 _ . . . _ x0 “ kq˘
and by the very definition of f :
Rob. $c φp0,ÝÑi q ^ φpS0,
ÝÑi q ^ . . . ^ φpk,
ÝÑi q
which gives
Rob. $c @x0
`
x0 ă k ` 1 ÝÑ φpx0,ÝÑi q
˘
which settles this case.
(2) Rob. $c @x0
ˆ
fpÝÑi q ă x0 ÝÑ
´
φpx0,ÝÑi q ^ @y ă x0 φpy,
ÝÑi q
¯
˙
.
By the very definition of f :
Rob. $c φ`
fpÝÑi q,ÝÑi˘
Thus
Rob. $c @x0
´
fpÝÑi q ă x0 ÝÑ Dy ă x0 φpy,
ÝÑi q
¯
i.e.
Rob. $c @x0
´
fpÝÑi q ă x0 ÝÑ @y ă x0 φpy,
ÝÑi q
¯
which yields what we want.
(1) and(2) finish the proof.
% 119
96 Godel & Recursivity
Theorem 120 (Chinese Remainder Theorem) Suppose n0, n1, . . . , nk are positive integers
which are pairwise co-prime. Then, for any given sequence of integers a0, a1, . . . , ak there exists
an integer x solving the system of simultaneous congruences
$
’
’
’
&
’
’
’
%
x ” a0 mod n0
x ” a1 mod n1...
x ” ak mod nk.
Proof of Theorem 120: We set
α “ź
iďk
ni
and notice that for each i ď k the two integers ni and αni
are co-prime. By Bezout there exist
coefficients ci, di P Z such that
ci ¨ ni ` di ¨α
ni“ 1
if we set
ei “ di ¨α
ni
we see that
#
ei ” 1 mod ni
ei ” 0 mod nj (any j ‰ i)
It follows immediately that
β “ÿ
iďk
ai ¨ ei
is a solution to the system.
% 120
Lemma 121 (Godel β-function) There exists some function β P NpN3q which is both repre-
sentable and Prim. Rec. such that for all k P N and every sequence n0, n1, . . . , nk there exists
a, b P N such that
$
’
’
’
&
’
’
’
%
βp0, a, bq “ n0
βp1, a, bq “ n1...
βpk, a, bq “ nk.
Arithmetic 97
Proof of Lemma 121: The function is defined3 by
βpi, a, bq “ b 9
ˆ„
b
api` 1q ` 1
¨ papi` 1q ` 1q
˙
This shows that it is Prim. Rec.. To show that β is representable we consider the formula
x0 ă Spx2¨Sx1q ^ Dy ď x3
´
y¨Spx2¨Sx1q
¯
`x0 “ x3
To show that this formula represents the function β, we need to show that for all i1, i2, i3 P N
Rob. $c @x0
´
βpi1, i2, i3q “ x0 ÐÑ x0 ă Spi2¨Si1q ^ Dy ď i3`
y¨Spi2¨Si1q˘
`x0 “ i3
¯
which is left as a tedious but straightforward exercise.
Now given n0, n1, . . . , nk, in order to find a and b, we consider any integer m that satisfies both
(1) m ě k ` 1 (2) m! ě maxtn0, n1, . . . , nku.
We set a “ m! so that we make sure that a` 1, a ¨ 2` 1, . . . , a ¨ k` 1, a ¨ pk` 1q` 1 are co-prime.
To see this, we proceed by contradiction and consider there exists some prime number p that
divides both api` 1q ` 1 and apj ` 1q ` 1 for some 0 ď i ă j ď k. Then p also divides
apj ` 1q ` 1 ´`
api` 1q ` 1˘
“ apj ´ iq “ m!pj ´ iq
Since m ą pj ´ iq holds, p divides m! which contradicts p divides m!pi` 1q ` 1.
The Chinese Remainder Theorem (120) guarantees that there exists some integer b that satisfies
$
’
’
’
&
’
’
’
%
b ” n0 mod a` 1
b ” n1 mod a ¨ 2` 1...
b ” nk mod a ¨ pk ` 1q ` 1.
We chose m such that a “ m! ě maxtn0, n1, . . . , nku in order to insure ni ă api ` 1q ` 1 for
every integer i ď k. This makes certain that for each i ď k we have βpi, a, bq “ ni.
% 121
Lemma 122 If both functions g P NpNpq and h P NpNp`2q are representable, then the function
f P NpNp`1q defined by recursion below is also representable.$
&
%
fpÝÑx , 0q “ gpÝÑx q
fpÝÑx , y ` 1q “ h`
ÝÑx , y, fpÝÑx , yq˘
3βpi, a, bq is the remainder of the division of b by api` 1q ` 1.
98 Godel & Recursivity
Proof of Lemma 122: We let ÝÑx stand for x1, . . . , xp and assume g P NpNpq and h P NpNp`2q are
represented respectively by φgpx0,ÝÑx q and φhpx0,ÝÑx , xp`1, xp`2q.
We also consider the following formula that represents the β-function 4 :
φpx0, x1, x2, x3q :“ x0 ă Spx2¨Sx1q ^ Dy ď x3
´
y¨Spx2¨Sx1q
¯
`x0 “ x3
Instead of φpx0, x1, x2, x3q we prefer the formula φβpx0, x1, x2, x3q below which also obviously
represents β but in a strong way.
φβpx0, x1, x2, x3q :“ φpx0, x1, x2, x3q ^ @y ă x0 φpy, x1, x2, x3q
because for any integers i, n we have
Rob. $c @a@b@x0
”
“
φβpk, i, a, bq ^ φβpx0, i, a, bq‰
ÝÑ x0 “ kı
.
This holds because
Rob. $c x0
“
x0 ‰ k ÝÑ px0 ď k _ k ď x0q _ x0 ă k _ k ă x0
‰
and by 4.11 Rob. $c @x`
x ď n _ n ď x˘
, this comes down to
Rob. $c x0
“
x0 ‰ k ÝÑ x0 ă k _ k ă x0
‰
and by the definition of both φβ and k we have
(1) Rob. $c @a@b@x0
”
“
φβpk, i, a, bq ^ x0 ă k‰
ÝÑ φβpx0, i, a,@bqı
(2) Rob. $c @a@b@x0
”
“
φβpk, i, a, bq ^ k ă x0
‰
ÝÑ φβpx0, i, a,@bqı
.
which yields the following which is also logically equivalent to what we want:
Rob. $c @a@b@x0
”
“
x0 ‰ k ^ φβpk, i, a, bq‰
ÝÑ φβpx0, i, a, bqı
.
The formula the we choose to represent f is the following formula φf px0, x1, . . . , xp`1q. We use
the notation ÝÑx “ x1, . . . , xp so that φf px0, x1, . . . , xp`1q :“ φf px0,ÝÑx , xp`1q
4see the proof of Lemma 121.
Arithmetic 99
DaDb@i ď xp`1 Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ 0 ÝÑ φgpy,ÝÑx q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑx , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, xp`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
In order to show that this formula φf px0,ÝÑx , xp`1q represents f , we need to prove that for all
integers i1, . . . , ip, ip`1 (we writeÝÑi for i1, . . . , ip) we have
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb@i ď ip`1 Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
ÐÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
(ð) We first prove
100 Godel & Recursivity
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
fpÝÑi , ip`1q “ x0 ÝÑ DaDb@i ď ip`1 Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
We consider the sequence of integers fpÝÑi , 0q, . . . , fp
ÝÑi , ip`1q. Following the proof of
Lemma 121, we obtain two integers a and b to make the β-function work. Since the
formulas φβ, φg, φh respectively represent the functions β, g, h, we have
Rob. $c φβ`
gpÝÑi q, 0, a, b
˘
^ φg`
gpÝÑi q,ÝÑi˘
together with
Rob. $c φβ`
fpÝÑi , ip`1q, ip`1, a, b
˘
and for each integer n ă ip`1
Rob. $c φβ`
fpÝÑi , nq, n, a, b
˘
^ φh
´
fpÝÑi , n` 1q,
ÝÑi , n, fp
ÝÑi , nq
¯
^ φβ`
fpÝÑi , n` 1q, Sn, a, b
˘
.
hence we have
Arithmetic 101
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
fpÝÑi , ip`1q “ x0 ÝÑ
ľ
kďip`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
k“ 0 ÝÑ φgpgpÝÑi q,ÝÑi q
Ź
φβpfpÝÑi , kq, k, a, bq
Ź
φhpfpÝÑi , k ` 1q,
ÝÑi , k, fp
ÝÑi , kqq
Ź
φβpfpÝÑi , k ` 1q, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
from which we logically derive
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
fpÝÑi , ip`1q “ x0 ÝÑ
ľ
kďip`1
Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
k“ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, k, a, bq
Ź
φhpz,ÝÑi , k, yq
Ź
φβpz, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
Furthermore, we know from 4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
102 Godel & Recursivity
that
Rob. $c @i´
i ď ip`1 ÐÑ“
i “ 0 _ i “ 1 _ . . . _ i “ ip`1
‰
¯
.
Thus we obtain
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
fpÝÑi , ip`1q “ x0 ÝÑ @i ď ip`1 Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
and finally
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
fpÝÑi , ip`1q “ x0 ÝÑ Da Db @i ď ip`1 Dy Dz
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
which completes the first part of the proof.
Arithmetic 103
(ñ) We need to show
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb@i ď ip`1 Dy Dz
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
which is equivalent to
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb@i
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
i ď ip`1 ÝÑ Dy Dz
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
By 4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
this is equiva-
104 Godel & Recursivity
lent to
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb@i
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
¨
˝
ł
kďip`1
i “ k
˛
‚ÝÑ Dy Dz
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
which is equivalent to 5
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb@i
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
ľ
kďip`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
i “ k ÝÑ Dy Dz
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
i “ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, i, a, bq
Ź
φhpz,ÝÑi , i, yq
Ź
φβpz, Si, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
which again is equivalent to
5we have pA_Bq ÝÑ C ” pA_Bq_C ” p A^ Bq_C ” p A_Cq^p B_Cq ” pA ÝÑ Cq^pB ÝÑ Cq.
Arithmetic 105
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
ľ
kďip`1
Dy Dz
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
k“ 0 ÝÑ φgpy,ÝÑi q
Ź
φβpy, k, a, bq
Ź
φhpz,ÝÑi , k, yq
Ź
φβpz, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
which is equivalent to
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb . . . DykDzk . . .loooooomoooooon
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
ľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
k“ 0 ÝÑ φgpyk,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
and also to
106 Godel & Recursivity
Rob. $c @x0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
DaDb . . . DykDzk . . .loooooomoooooon
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
ľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
and also to
Rob. $c @x0@a@b . . .@yk@zk . . .looooooomooooooon
kďip`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
ľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ fpÝÑi , ip`1q “ x0
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
Finally, making use of the following three facts:
(1) φβ represents β in a strong way since we also have for all integers k, n we have
Rob. $c @a@b@x0
”
“
φβpn, k, a, bq ^ φβpx0, k, a, bq‰
ÝÑ x0 “ nı
Arithmetic 107
(2) φg represents g
(3) φh represents h
At last, by induction on ip`1 we show
Rob. $c @a@b . . .@yk@zk . . .looooooomooooooon
kďip`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
ľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
–
y0 “ gpÝÑi q
Ź
yk “ fpÝÑi , kq
Ź
zk “ fpÝÑi , k ` 1q
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
ip`1 “ 0: we only need to prove
Rob. $c @a@b@y0@z0
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpy0, 0, a, bq
Ź
φhpz0,ÝÑi , 0, y0q
Ź
φβpz0, S0, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ
»
—
—
—
—
—
—
—
—
—
—
—
—
–
y0 “ gpÝÑi q
Ź
y0 “ fpÝÑi , 0q
Ź
z0 “ fpÝÑi , 1q
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
which directly follows from the fact that φg and φh represent respectively g and h.
ip`1 “ n` 1: we assume
108 Godel & Recursivity
Rob. $c @a@b . . .@yk@zk . . .looooooomooooooon
kďn
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
ľ
kďn
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑľ
kďn
»
—
—
—
—
—
—
—
—
—
—
—
—
–
y0 “ gpÝÑi q
Ź
yk “ fpÝÑi , kq
Ź
zk “ fpÝÑi , k ` 1q
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
We only need to show
Rob. $c @a@b@zn@yn`1@zn`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
zn “ fpÝÑi , n` 1q
Ź
φβpzn, n` 1, a, bq
Ź
φβpyn`1, n` 1, a, bq
Ź
φhpzn`1,ÝÑi , n` 1, yn`1q
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ
»
—
—
—
—
–
yn`1 “ fpÝÑi , n` 1q
Ź
zn`1 “ fpÝÑi , n` 2q
fi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
which holds because:
(1) since φβ represents β in a strong way we have
Rob. $c @a@b@yn`1
”
“
φβpfpÝÑi , n` 1q, n` 1, a, bq ^ φβpyn`1, n` 1, a, bq
‰
ÝÑ yn`1 “ fpÝÑi , n` 1q
ı
(2) since φh represents h we have
Rob. $c @a@b@yn`1@zn`1
”
“
φhpzn`1,ÝÑi , n` 1, yn`1q ^ yn`1 “ fp
ÝÑi , n` 1q
‰
ÝÑ zn`1 “ fpÝÑi , n` 2q
ı
To sum up things, we have obtained
Arithmetic 109
Rob. $c @x0@a@b . . .@yk@zk . . .looooooomooooooon
kďip`1
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
ľ
kďip`1
»
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
–
φgpy0,ÝÑi q
Ź
φβpyk, k, a, bq
Ź
φhpzk,ÝÑi , k, ykq
Ź
φβpzk, Sk, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
ÝÑ
»
—
—
—
—
—
—
—
—
—
—
—
—
–
yip`1 “ fpÝÑi , ip`1q
Ź
φβpyip`1 , ip`1, a, bq
Ź
φβpx0, ip`1, a, bq
fi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
ffi
fl
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
.
Once again, since φβ strongly represents β we have
Rob. $c @x0@a@b”
“
φβpfpÝÑi , ip`1q, ip`1, a, bq ^ φβpx0, ip`1, a, bq
‰
ÝÑ x0 “ fpÝÑi , n` 1q
ı
which finishes the proof.
% 122
Theorem 123 All total recursive functions are representable.
Proof of Theorem 123: An immediate consequence of Examples 108, 109 and 110 and Lemmas
113 , 119 and 122.
% 123
110 Godel & Recursivity
Chapter 5
Godel’s First IncompletenessTheorem
5.1 Godel Numbers
The idea is the following: intuitively, formulas from arithmetic talk about integers – no matter
whether these are standard or not – we ca turn them into formulas that talk about the arithmetic
itself by encoding formulas, proofs, etc. by integers. This way a formula φpxq may say something
like “x is the code of a closed formula from our language LA “ t0, S,`, ¨u” or ψpx, yq may
eventually say “x is the code of a closed formula θ from our language and y is the code of a
proof of θ in Robinson arithmetic”.
As always we start with the terms: given term t we write xty for its code.
Definition 124 (Godel numbering of the LA-terms) The Godel numbering of the terms
from the language LA “ t0, S,`, ¨u is
t “ 0 ù xty “ α3p0, 0, 0q
t “ xn ù xty “ α3pn` 1, 0, 0q
t “ St0 ù xty “ α3pxty, 0, 1q
t “ t0`t1 ù xty “ α3pxt0y, xt1y, 2q
t “ t0¨t1 ù xty “ α3pxt0y, xt1y, 3q
Lemma 125 The set T of all codes of terms from LA
T “
xty | t is a term from LA(
is Prim. Rec.
112 Godel & Recursivity
To almost immediately show this result we need to prove that some stronger form of construction
by recursion still produces Prim. Rec. functions.
Lemma 126 For all Prim. Rec. functions h P NpNn`p`1q, g P NpNnq, k1, . . . , kp P NN, such that
every integer y ą 0ľ
0ăiďp
kipyq ă y
the function f P NpNn`1q defined by
(1) fpÝÑx , 0q “ gpÝÑx q
(2) fpÝÑx , y ` 1q “ h`
fpÝÑx , k1pyqq, . . . , fpÝÑx , kppyqq,ÝÑx , y, fpÝÑx , yq˘
is also Prim. Rec.
First, notice that the Ackermann function A P NpN2q defined by
Apm,nq “
$
&
%
n` 1 if m “ 0,
Apm´ 1, 1q if m ą 0 and n “ 0,
A`
m´ 1, Apm,n´ 1q˘
if m ą 0 and n ą 0.
is not of this form for Apm,n´ 1q ă n certainly does not hold.
Proof of Lemma 126: The idea of the proof is to define by recursion a function that carries all
the datas fpÝÑx , zq for z ă y when defining fpÝÑx , yq. To achieve this, we make use of the two
Prim. Rec. functions c and d that we defined in Example 91:
(1) the function c : Năω ÝÑ N codes the finite sequences of integers and is defined by
"
cpεq “ 1
cpx0, . . . , xpq “ Π p0qx0`1¨Π p1qx1`1
¨ ¨ ¨Π ppqxp`1.
(2) And the function d P NpN2q that allows, from any integer n, to recover every element of
the sequence xx0, . . . , xpy that c encodes (i.e. cpx0, . . . , xpq “ n) by
dpi, nq “ µx ď n Π piqx`1 does not divide n.
We want to define some Prim. Rec. function θ P NpNn`1q such that
θpÝÑx , yq “ c`
fpÝÑx , 0q, fpÝÑx , 1q, . . . , fpÝÑx , yq˘
This is easily done by recursion:
(1) θpÝÑx , 0q “ 2gpÝÑx q`1
Arithmetic 113
(2) θpÝÑx , y ` 1q “ θpÝÑx , yq ¨Π py ` 1qh“
drk1pyqq,θpÝÑx ,yqs,...,drkppyqq,θpÝÑx ,yqs,ÝÑx ,y,fpÝÑx ,yq‰
`1.
Then, to show that f is also Prim. Rec., it only remains to set
fpÝÑx , yq “ d“
y, θpÝÑx , yq‰
9 1.
% 126
Proof of Lemma 125: Its characteristic function χT : N ÝÑ N is defined by:
if β33pkq “ 0 and β2
3pkq “ 0 and β13pkq “ 0 ù χT pkq “ 1
if β33pkq “ 0 and β2
3pkq “ 0 and β13pkq ą 0 ù χT pkq “ 1
if β33pkq “ 1 and β2
3pkq “ 0 and β13pkq ą 0 ù χT pkq “ χT ˝ β
13pkq
if β33pkq “ 2 ù χT pkq “ χT
`
β13pkq ¨ β
23pkq
˘
if β33pkq “ 3 ù χT pkq “ χT
`
β13pkq ¨ β
23pkq
˘
else ù χT pkq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 125
Definition 127 (Godel numbering of the LA-formulas) The Godel numbering of the LA-
formulas is
φ “ t0 “ t1 ù xφy “ α3pxt0y, xt1y, 4q
φ “ ψ ù xφy “ α3pxψy, 0, 5q
φ “ pφ0 ^ φ1q ù xφy “ α3pxφ0y, xφ1y, 6q
φ “ pφ0 _ φ1q ù xφy “ α3pxφ0y, xφ1y, 7q
φ “ pφ0 ÝÑ φ1q ù xφy “ α3pxφ0y, xφ1y, 8q
φ “ pφ0 ÐÑ φ1q ù xφy “ α3pxφ0y, xφ1y, 9q
φ “ @xn ψ ù xφy “ α3pxψy, n, 10q
φ “ Dxn ψ ù xφy “ α3pxψy, n, 11q.
Notice that for every formula φ, we have xφy ą 0.
Lemma 128 The set of all codes of formulas from LA
xφy | φ is a formula from LA(
is Prim. Rec.
114 Godel & Recursivity
Proof of Lemma 128: Its characteristic function χF : N ÝÑ N is defined by:
if β33pkq “ 4 ù χFpkq “ χT ˝ β
13pkq ¨ χT ˝ β
23pkq
if β33pkq “ 5 and β2
3pkq “ 0 ù χFpkq “ χF ˝ β13pkq
if β33pkq “ 6 ù χFpkq “ χF
`
β13pkq ¨ β
23pkq
˘
if β33pkq “ 7 ù χFpkq “ χF
`
β13pkq ¨ β
23pkq
˘
if β33pkq “ 8 ù χFpkq “ χF
`
β13pkq ¨ β
23pkq
˘
if β33pkq “ 9 ù χFpkq “ χF
`
β13pkq ¨ β
23pkq
˘
if β33pkq “ 10 and β2
3pkq ą 0 ù χFpkq “ χF ˝ β13pkq
if β33pkq “ 11 and β2
3pkq ą 0 ù χFpkq “ χF ˝ β13pkq
else ù χFpkq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 128
Lemma 129 The set of all codes of terms from LA that contain the variable xn
T3x “
pxty, nq | t is a term from LA and t contains xn(
is Prim. Rec.
Proof of Lemma 129: Its characteristic function χT 3xn: N2 ÝÑ N is defined by:
if β33pkq “ 0 and β2
3pkq “ 0 and β13pkq “ n` 1 ù χT 3xn
pk, nq “ 1
if β33pkq “ 1 and β2
3pkq “ 0 ù χT 3xnpk, nq “ χT 3xn
`
β13pkq, n
˘
if β33pkq “ 2 ù χT 3xn
pk, nq “ max´
χT 3xn
`
β13pkq, n
˘
, χT 3xn
`
β23pkq, n
˘
¯
if β33pkq “ 3 ù χT 3xn
pk, nq “ max´
χT 3xn
`
β13pkq, n
˘
, χT 3xn
`
β23pkq, n
˘
¯
else ù χT 3xnpk, nq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 129
Arithmetic 115
Lemma 130 The set of all codes of terms from LA that do not contain the variable xn
T7x “
pxty, nq | t is a term from LA and t does not contain xn(
is Prim. Rec.
Proof of Lemma 130: Its characteristic function χT 7xn: N2 ÝÑ N is defined by :
if β33pkq “ 0 and β2
3pkq “ 0 and β13pkq ‰ n` 1 ù χT 7xn
pk, nq “ 1
if β33pkq “ 1 and β2
3pkq “ 0 ù χT 7xnpk, nq “ χT 7xn
`
β13pkq, n
˘
if β33pkq “ 2 ù χT 7xn
pk, nq “ χT 7xn
`
β13pkq, n
˘
¨ χT 7xn
`
β23pkq, n
˘
if β33pkq “ 3 ù χT 7xn
pk, nq “ χT 7xn
`
β13pkq, n
˘
¨ χT 7xn
`
β23pkq, n
˘
else ù χT 7xnpk, nq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 130
Lemma 131 The set of all codes of formulas from LA that contain the variable xn
F3x “ `
xφy, n˘
| φ is a formula from LA and φ contains xn(
is Prim. Rec.
Proof of Lemma 131: Its characteristic function χF3xn: N2 ÝÑ N is defined by:
if β33pkq “ 4 ù χF3xn
pk, nq “ max´
χT 3xn
`
β13pkq, n
˘
, χT 3xn
`
β23pkq, n
˘
¯
if β33pkq “ 5 and β2
3pkq “ 0 ù χF3xnpk, nq “ χF3xn
`
β13pkq, n
˘
if β33pkq “ 6 ù χF3xn
pk, nq “ max´
χF3xn
`
β13pkq, n
˘
, χF3xn
`
β23pkq, n
˘
¯
if β33pkq “ 7 ù χF3xn
pk, nq “ max´
χF3xn
`
β13pkq, n
˘
, χF3xn
`
β23pkq, n
˘
¯
if β33pkq “ 8 ù χF3xn
pk, nq “ max´
χF3xn
`
β13pkq, n
˘
, χF3xn
`
β23pkq, n
˘
¯
if β33pkq “ 9 ù χF3xn
pk, nq “ max´
χF3xn
`
β13pkq, n
˘
, χF3xn
`
β23pkq, n
˘
¯
if β33pkq “ 10 ù χF3xn
pk, nq “ χF3xn
`
β13pkq, n
˘
if β33pkq “ 11 ù χF3xn
pk, nq “ χF3xn
`
β13pkq, n
˘
else ù χF3xnpk, nq “ 0.
116 Godel & Recursivity
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 131
Lemma 132 The set of all codes of formulas from LA that do not contain the variable xn
F7x “ `
xφy, n˘
| φ is a formula from LA and φ does not contain xn(
is Prim. Rec.
Proof of Lemma 132: Its characteristic function χF7xn: N2 ÝÑ N is defined by :
if β33pkq “ 4 ù χF7xn
pk, nq “ χT 7xn˝ β1
3pkq ¨ χT 7xn˝ β2
3pkq
if β33pkq “ 5 and β2
3pkq “ 0 ù χF7xnpk, nq “ χF7xn
˝ β13pkq
if β33pkq “ 6 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq ¨ χF7xn˝ β2
3pkq
if β33pkq “ 7 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq ¨ χF7xn˝ β2
3pkq
if β33pkq “ 8 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq ¨ χF7xn˝ β2
3pkq
if β33pkq “ 9 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq ¨ χF7xn˝ β2
3pkq
if β33pkq “ 10 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq
if β33pkq “ 11 ù χF7xn
pk, nq “ χF7xn˝ β1
3pkq
else ù χF7xnpk, nq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 132
Lemma 133 The set of all codes of formulas from LA that contain xn as a free variable
F3x free “ `
xφy, n˘
| φ is a formula from LA and xn is free in φ(
is Prim. Rec.
Proof of Lemma 133: Its characteristic function χF3x free: N2 ÝÑ N is defined by:
Arithmetic 117
if β33pkq “ 4 ù χF3x free
pk, nq “ max´
χF3x free
`
β13pkq, n
˘
, χF3x free
`
β23pkq, n
˘
¯
if β33pkq “ 5 and β2
3pkq “ 0 ù χF3x freepk, nq “ χF3x free
`
β13pkq, n
˘
if β33pkq “ 6 ù χF3x free
pk, nq “ max´
χF3x free
`
β13pkq, n
˘
, χF3x free
`
β23pkq, n
˘
¯
if β33pkq “ 7 ù χF3x free
pk, nq “ max´
χF3x free
`
β13pkq, n
˘
, χF3x free
`
β23pkq, n
˘
¯
if β33pkq “ 8 ù χF3x free
pk, nq “ max´
χF3x free
`
β13pkq, n
˘
, χF3x free
`
β23pkq, n
˘
¯
if β33pkq “ 9 ù χF3x free
pk, nq “ max´
χF3x free
`
β13pkq, n
˘
, χF3x free
`
β23pkq, n
˘
¯
if β33pkq “ 10 and β2
3pkq ‰ n ù χF3x freepk, nq “ χF3x free
`
β13pkq, n
˘
if β33pkq “ 11 and β2
3pkq ‰ n ù χF3x freepk, nq “ χF3x free
`
β13pkq, n
˘
else ù χF3x freepk, nq “ 0.
By Lemma 126 this definition by case study yields a Prim. Rec. function.
% 133
Lemma 134 The set of all codes of formulas from LA that contain xn as a bound variable
F3x bound “ `
xφy, n˘
| φ is a formula from LA and xn is bound in φ(
is Prim. Rec.
Proof of Lemma 134: we have
F3x bound “ F3x r F3x free
% 134
Lemma 135 The set of all codes of closed formulas from LA
F3closed “
xφy | φ is a closed formula from LA(
is Prim. Rec.
118 Godel & Recursivity
Proof of Lemma 135: We have
k P F3closed ðñ k P F and @n ď k pk, nq R F3x free.
% 135
Lemma 136 The function STub. P NpN
3q defined below is Prim. Rec.
STub. pnu, nt, nq
$
&
%
xurt{xnsy if nu P T , nt P T and nu “ xuy, nt “ xty
0 otherwise .
Proof of Lemma 136: We first recall the definition of xty:
t “ 0 ù xty “ α3p0, 0, 0q
t “ xn ù xty “ α3pn` 1, 0, 0q
t “ St0 ù xty “ α3pxty, 0, 1q
t “ t0`t1 ù xty “ α3pxt0y, xt1y, 2q
t “ t0¨t1 ù xty “ α3pxt0y, xt1y, 3q
STub. P NpN
3q is defined by
STub. pnu, nt, nq “
$
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
%
0 if nu R T or nt R Tnt if nu, nt P T and β3
3pnuq “ 0 and β23pnuq “ 0 and β1
3pnuq “ n` 1
nu if nu, nt P T and β33pnuq “ 0 and β2
3pnuq “ 0 and β13pnuq ‰ n` 1
α3pSTub.
`
β13pnuq, nt, n
˘
, 0, 1q if nu, nt P T and β33pnuq “ 1 and β2
3pnuq “ 0 and β13pnuq P T
α3pSTub.
`
β13pnuq, nt, n
˘
,STub.
`
β23pnuq, nt, n
˘
, 2q if nu, nt P T and β33pnuq “ 2 and β2
3pnuq P T and β13pnuq P T
α3pSTub.
`
β13pnuq, nt, n
˘
,STub.
`
β23pnuq, nt, n
˘
, 3q if nu, nt P T and β33pnuq “ 3 and β2
3pnuq P T and β13pnuq P T
By Lemma 126 STub. is Prim. Rec.
% 136
Lemma 137 The function SFub. P NpN
3q defined below is Prim. Rec.
SFub. pnu, nt, nq “
$
&
%
xφrt{xnsy if nφ “ xφy P F , nt “ xty P T
0 otherwise .
Proof of Lemma 137: We first recall the definition of xφy:
Arithmetic 119
φ “ t0 “ t1 ù xφy “ α3pxt0y, xt1y, 4q
φ “ ψ ù xφy “ α3pxψy, 0, 5q
φ “ pφ0 ^ φ1q ù xφy “ α3pxφ0y, xφ1y, 6q
φ “ pφ0 _ φ1q ù xφy “ α3pxφ0y, xφ1y, 7q
φ “ pφ0 ÝÑ φ1q ù xφy “ α3pxφ0y, xφ1y, 8q
φ “ pφ0 ÐÑ φ1q ù xφy “ α3pxφ0y, xφ1y, 9q
φ “ @xn ψ ù xφy “ α3pxψy, n, 10q
φ “ Dxn ψ ù xφy “ α3pxψy, n, 11q.
SFub. P NpN
3q is defined by
SFub. pnφ, nt, nq “
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
0 if nφ R F or nt R Tα3pST
ub.
`
β13pnφq, nt, n
˘
,STub.
`
β23pnφq, nt, n
˘
, 4q if nφ P F and nt P T and β33pnφq “ 4
α3pSFub.
`
β13pnφq, nt, n
˘
, 0, 5q if nφ P F and nt P T and β33pnφq “ 5
α3pSFub.
`
β13pnφq, nt, n
˘
,SFub.
`
β23pnφq, nt, n
˘
, 6q if nφ P F and nt P T and β33pnφq “ 6
α3pSFub.
`
β13pnφq, nt, n
˘
,SFub.
`
β23pnφq, nt, n
˘
, 7q if nφ P F and nt P T and β33pnφq “ 7
α3pSFub.
`
β13pnφq, nt, n
˘
,SFub.
`
β23pnφq, nt, n
˘
, 8q if nφ P F and nt P T and β33pnφq “ 8
α3pSFub.
`
β13pnφq, nt, n
˘
,SFub.
`
β23pnφq, nt, n
˘
, 9q if nφ P F and nt P T and β33pnφq “ 9
α3pSFub.
`
β13pnφq, nt, n
˘
, β23pnφq, 10q if nφ P F and nt P T and β3
3pnφq “ 10 and β23pnφq ‰ n
α3pSFub.
`
β13pnφq, nt, n
˘
, β23pnφq, 11q if nφ P F and nt P T and β3
3pnφq “ 11 and β23pnφq ‰ n
β13pnφq if nφ P F and nt P T and β3
3pnφq “ 10 and β23pnφq “ n
β13pnφq if nφ P F and nt P T and β3
3pnφq “ 11 and β23pnφq “ n
By Lemma 126 SFub. is Prim. Rec.
% 137
We will now define a way of coding (finite) sets of formulas. We will note really encode the
set, but some finite sequence of formulas, because we will not care about the ordering of such a
sequence, even if what we really encode is the sequence, we will handle it as if it were a set.
Definition 138 (coding and decoding sequences) We define both x y : Năω ÝÑ N and
z y : N2 ÝÑ N by
"
xεy “ 0
xx0, . . . , xpy “ Π p0qx0 ¨Π p1qx1 ¨ ¨ ¨Π ppqxp .
Where Π piq enumerates the prime numbers1.
And
znyi “ µx ď n Π piqx`1 does not divide n.
1 Π p0q “ 2; Π p1q “ 3; Π p2q “ 5; etc.
120 Godel & Recursivity
Notice that for all i ď p we have zxx0, . . . , xpyyi “ xi. Furthermore, for every formula φ, the inte-
ger xφy is strictly positive. Therefore, given any sequence 〈x0, . . . , xp〉 P Năω if zxx0, . . . , xpyyi “ 0
then we know for sure that xi does not code a formula.
We will say that the integer 1 codes the empty set – which is also an empty set of formulas –
and another integer codes the set ∆ “ tφ0, φ1, . . . , φpu if this integer is of the form Π pi0qxφ0y
¨
Π pi1qxφ1y
¨ ¨ ¨Π pipqxφpy.
Definition 139 (Godel numbering of the LA-finite sets of formulas) The Godel number-
ing of any set ∆ “ tφ0, φ1, . . . , φpu of LA-formulas is any integer of the form#
xHy “ 1
x∆y “ Π pi0qxφ0y
¨Π pi1qxφ1y
¨ ¨ ¨Π pipqxφpy.
We denote CPfin.pFq the set of codes of finite sets of formulas:
CPfin.pFq “ tx∆y | ∆ is some finite set of LA formulasu.
Lemma 140 The set CPfin.pFq of codes of finite sets of formulas is Prim. Rec.
Proof of Lemma 140:
χCPfin.pFqpnq “
$
’
’
&
’
’
%
1 if n “ 1
1 if n ‰ 1 and @i ď n“
znyi ą 0 ÝÑ znyi P F‰
0 else
% 140
Lemma 141 There exist two Prim. Rec. functions Rem. : N2 ÝÑ N and Add. : N2 ÝÑ N such
that
Rem. pn,mq “
$
&
%
x∆Y tφuy if n “ xφy P F and m “ x∆y P CPfin.pFq
0 if n R F or m R CPfin.pFq
Add. pn,mq “
$
&
%
x∆ r tφuy if n “ xφy P F and m “ x∆y P CPfin.pFq
0 if n R F or m R CPfin.pFq
Arithmetic 121
Proof of Lemma 141:
Add. pn,mq “
$
&
%
0 if n R F or m R CPfin.pFq
m ¨Π`
µi ď m zmyi “ 0˘n
if xφy “ n P F and x∆y “ m P CPfin.pFq.
Rem. pn,mq “
$
’
’
’
’
&
’
’
’
’
%
0 if n R F or m R CPfin.pFq
m if n P F and m P CPfin.pFq and @i ď m zmyi ‰ n„
m
¨Π`
µi ď m zmyi “ n˘n
if n P F and m P CPfin.pFq and Di ď m zmyi “ n
% 141
Lemma 142 The following set is Prim. Rec.
Ins. “
!
pxφy, x∆yq P N2 | xφy P F , x∆y P CPfin.pFq and φ P ∆)
.
We will use a relation-like notation and write xφy Ins. x∆y instead of pxφy, x∆yq P Ins..
Proof of Lemma 142:
χIns.pn,mq “
$
’
’
’
’
&
’
’
’
’
%
1 if n P F and m P CPfin.pFq and Di ď m
$
’
’
&
’
’
%
Π piqn divides m
and
Π piqn`1 does not divides m
0 else.
% 142
Lemma 143 The following set is Prim. Rec.
Equ. “!
pxΓy, x∆yq P N2 | xΓy P CPfin.pFq, x∆y P CPfin.pFq and Γ “ ∆)
.
Notice that the equality “ Γ “ ∆” is between two sets, therefore it relies on extensionality. We
will use a relation-like notation and write xφy Equ. x∆y instead of pxφy, x∆yq P Equ..
Proof of Lemma 143: We have
χEqu.pn,mq “#
1 if n,m P CPfin.pFq and @i ď maxpn,mq`
i P F Ñ pi Ins. nØ i Ins. mq˘
0 else.
% 143
122 Godel & Recursivity
Lemma 144 There exists a Prim. Rec. function Union P NpN2q such that
Union pn,mq “
$
&
%
0 if n R CPfin.pFq or m R CPfin.pFq
xΓ1 Y∆1y if n “ xΓy P CPfin.pFq and m “ x∆y P CPfin.pFq and xΓ1 Y∆1y Equ. xΓY∆y
Proof of Lemma 144: We first define f P NpN3q by recursion:
$
&
%
fpγ, δ, 0q “ Π p0qzγy0¨Π p1qzδy0
fpγ, δ, n` 1q “ Π p2nqzγyn¨Π p2n` 1qzδyn
¨ fpγ, δ, nq.
Then we set
Union pγ, δq “ fpγ, δ,maxpγ, δqq.
% 144
Definition 145 (Godel numbering of the LA-sequents from sequent calculus) The Godel
numbering of any sequent Γ $ ∆ is
xΓ $ ∆y “ α2pxΓy, x∆yq
We denote SQ the set of codes of finite sets of formulas:
SQ “ txΓ $ ∆y | Γ, ∆ finite sets of LA formulasu.
Given any integer n we use the notation ln for β12pnq and rn for β2
2pnq. This way,
if n “ xΓ $ ∆y, then ln “ xΓy and rn “ x∆y.
Lemma 146 The set SQ of codes of sequents of sequent calculus is Prim. Rec.
Proof of Lemma 146:
χSQpnq “
$
&
%
1 if ln P CPfin.pFq and rn P CPfin.pFq
0 else
% 146
We will now denote AX the set of codes of axioms of sequent calculus which are not to be
mistaken for the axiom of Robinson arithmetic.
Arithmetic 123
Definition 147 (Godel numbering of the axioms of sequent calculus)
AX “
!
α2
`
2xφy, 2xφy˘
| xφy P F)
.
Lemma 148 The set AX of codes of axioms of sequent calculus is Prim. Rec.
Proof of Lemma 148:
χAX pnq “
$
&
%
1 if β12pnq “ β2
2pnq and zβ12pnqy
0 P F
0 else
5.2 Coding the Proofs
We recall that a proof in Sequent Calculus is a tree of the form
ax
@x pφÑ ψq $ @x pφÑ ψq@e
@x pφ ÝÑ ψq $ φry{xs Ñ ψry{xs
ax
@x φ $ @x φ@e
@x φ $ φry{xsÑ e
@x pφÑ ψq,@x φ $ ψry{xs@i
@x pφÑ ψq,@x φ $ @x ψÑ i
@x pφÑ ψq $ @x φÑ @x ψ
where the shape of the tree is controlled by the rules of Sequent Calculus.
We are now ready to define for each rule of the Sequent Calculus, a set of tuples of codes of
sequents that satisfy the property that the rule defines.
We will successively define
(1) ˝ Rax Ď N
(2) ˝ R^l1 Ď N2
˝ R^l2 Ď N2
˝ R l Ď N2
˝ R@l Ď N2
˝ RDl Ď N2
˝ R_r1 Ď N2
˝ R_r2 Ď N2
˝ R r Ď N2
˝ R@r Ď N2
˝ RDr Ď N2
˝ Rwknl Ď N2
˝ Rwknr Ď N2
˝ Rctr l&r Ď N2
˝ Rcut Ď N2
˝ RRep Ď N2
˝ RRef Ď N2
(3) ˝ R_l Ď N3 ˝ RÑlĎ N3 ˝ R^r Ď N3
and for each of them, the fact that it is Prim. Rec. will derive from its definition. We first recall
what the rules are.
124 Godel & Recursivity
Sequent Calculus
Axioms
ax
φ $ φ
Logical Rules
Γ, φ $ ∆^l1
Γ, φ^ ψ $ ∆
Γ, ψ $ ∆^l2
Γ, φ^ ψ $ ∆
Γ $ φ,∆ Γ $ ψ,∆^r
Γ $ φ^ ψ,∆
Γ, φ $ ∆ Γ, ψ $ ∆_l
Γ, φ_ ψ $ ∆
Γ $ φ,∆_r1
Γ $ φ_ ψ,∆
Γ $ ψ,∆_r2
Γ $ φ_ ψ,∆
Γ $ φ,∆ Γ, ψ $ ∆Ñl
Γ, φÑ ψ $ ∆
Γ, φ $ ψ,∆Ñr
Γ $ φÑ ψ,∆
Γ $ φ,∆ l
Γ, φ $ ∆
Γ, φ $ ∆ r
Γ $ φ,∆
Γ, φrt{xs $ ∆ 1
@l
Γ,@x φ $ ∆
Γ $ φry{xs,∆@r
Γ $ @x φ,∆ 2
Γ, φry{xs $ ∆Dl
Γ, Dx φ $ ∆ 2
Γ $ φrt{xs,∆1
Dr
Γ $ Dx φ,∆
Γ, t “ t $ ∆Ref
Γ $ ∆
Γ, t “ s, φrs{xs, φrt{xs $ ∆Rep
Γ, s “ t, φrt{xs $ ∆
Structural Rules
Γ $ ∆wknl
Γ, φ $ ∆Γ $ ∆
wknr
Γ $ φ,∆
Γ, φ, φ $ ∆ctrl
Γ, φ $ ∆
Γ $ φ, φ,∆ctrr
Γ $ φ,∆
Cut Rule
Γ $ φ,∆ Γ1, φ $ ∆1
cut
Γ,Γ1 $ ∆,∆1
1t a term2y with no free occurrence the sequent concluding the rule (not in Γ, Dx φ nor @x φ, nor ∆)
Arithmetic 125
ax
φ $ φ
U P Rax ðñ U P AX
........................................................................
Γ, φ $ ∆^l1
Γ, φ^ ψ $ ∆
pU,Dq P R^l1ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U P SQand
D P SQand
rU Equ. rDand
Dxφy ď lU Dxψy ď lD
¨
˚
˚
˝
xφy Ins.lU and xφ^ ψy Ins.
lD
and
Rem.
`
xφy, lU˘
Equ. Rem.
`
xφ^ ψy, lD˘
˛
‹
‹
‚
where
˝ “ xφ^ ψy” stands for “ α3pxφy, xψy, 6q”.
˝ “ Dxφy ď k θrxφy{yss” stands for “ Dn ď k`
n P F ^ θrn{ys˘
” and more generally
˝ “ Dxφ1y ď k1 . . . . . . Dxφny ď kn θrxφ1y{y1,...,xφny{yns” stands for
“ Dp ď αnpk1, . . . , knq`
ľ
iďn
`
βinppq P F ^ βinppq ď ki˘
^ θrβ1nppq{y1,...,βnnppq{yns
˘
”.
........................................................................
126 Godel & Recursivity
Γ, ψ $ ∆^l2
Γ, φ^ ψ $ ∆
pU,Dq P R^l2ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U P SQand
D P SQand
rU Equ. rDand
Dxψy ď lU Dxφy ď lD
¨
˚
˚
˝
xψy Ins.lU and xφ^ ψy Ins.
lD
and
Rem.
`
xψy, lU˘
Equ. Rem.
`
xφ^ ψy, lD˘
˛
‹
‹
‚
........................................................................
Γ, φ $ ∆ Γ, ψ $ ∆_l
Γ, φ_ ψ $ ∆
pUl, Ur, dq P R_lðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
%
Ul, Ur, D P SQand
rUl Equ. rUr Equ. rDand
Dxφy ď lUl Dxψy ď lUr
¨
˚
˚
˝
xφy Ins.lUl and xψy Ins.
lUr and xφ^ ψy Ins.lD
and
Rem.
`
xφy, lUl˘
Equ. Rem.
`
xψy, lUr˘
Equ. Rem.
`
xφ^ ψy, lD˘
˛
‹
‹
‚
........................................................................
Arithmetic 127
Γ $ φ,∆ Γ, ψ $ ∆Ñl
Γ, φÑ ψ $ ∆
pUl, Ur, Dq P RÑl
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
Ul, Ur, D P SQand
rUr Equ. rDand
Dxφy ď rUl Dxψy ď lUr
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
xφy Ins.rUl and xψy Ins.
lUr and xφ^ ψy Ins.lD
and
Rem. pxφy, rUlq Equ. rUrand
Rem.
`
xψy, lUr˘
Equ. lUl Equ. Rem.
`
xφÑ ψy, lD˘
and
Rem.
`
xψy, lUr˘
Equ. Rem.
`
xφÑ ψy, lD˘
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˝ where “ A Equ. B Equ. C ” stands for “ A Equ. B and B Equ. C ”
........................................................................
Γ $ φ,∆ l
Γ, φ $ ∆
pU,Dq P R lðñ
$
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
%
U,D P SQand
Dxφy ď rU
¨
˚
˚
˝
xφy Ins.rU and x φy Ins.
lD
and
Rem. pxφy, rUq Equ. Rem.
`
x φy, lD˘
˛
‹
‹
‚
........................................................................
128 Godel & Recursivity
Γ, φrt{xns $ ∆@l
Γ,@xn φ $ ∆
pU,Dq P R@lðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
rU Equ. rDand
Dn ď lD Dx@xnφy ď lD Dxty ď lU
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
¨
˚
˚
˚
˚
˚
˚
˚
˝
x@xnφy Ins.lD and
`
xφy, n˘
P F3x free
and
SFub. pxφy, xty, nq Ins.
lU
and
Rem.
`
SFub. pxφy, xty, nq, lU
˘
Equ. Rem.
`
x@xnφy, lD˘
˛
‹
‹
‹
‹
‹
‹
‹
‚
or
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
x@xnφy Ins.lD
and`
xφy, n˘
P`
F7x Y F3x bound
˘
and
xφy Ins.lU
and
SFub. pxφy, xty, nq Ins.
lU
and
Rem.
`
xφy, lU˘
Equ. Rem.
`
x@xnφy, lD˘
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˝ “ Dn ď rU Dx@xnφy ď rU . . .” stands for
“ Dn ď rU Dm ď rU´
m P F ^ β33pmq “ 10 ^ β2
3pmq “ n ^ β13pmq “ xφy ^ . . .
¯
”
˝ “ xφy stands for “ β13
`
x@xnφy˘
”
˝ “ Dxty ď lU . . .” stands for “ Dv ď lU`
v P T ^ . . .˘
”
........................................................................
Arithmetic 129
Γ, φrxk{xns $ ∆Dl
Γ, Dxn φ $ ∆ 2
pU,Dq P RDlðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
rU Equ. rDand
Dxxny ď lD Dxxky ď lU DxDxnφy ď lD Dxψy ď lU
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
xDxnφy Ins.lD and xψy Ins.
lU
and`
xψy, k˘
P F3x free and´
k ‰ nÑ`
xψy, n˘
P`
F7x Y F3x bound
˘
¯
and
α3pSFub. pxψy, xxny, kq , n, 11q “ xDxnφy
and
Rem.
`
xψy, lU˘
Equ. Rem.
`
xDxnφy, lD˘
and
@xθy ď lD´
xθy Ins.lD Ñ pxθy, kq P
`
F7xk Y F3xk bound
˘
¯
and
@xδy ď rD´
xδy Ins.rD Ñ pxδy, kq P
`
F7xk Y F3xk bound
˘
¯
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
or
¨
˚
˚
˚
˚
˚
˚
˚
˝
xDxnφy Ins.lD and xψy Ins.
lU and
`
xψy, k˘
P`
F7xk Y F3xk bound
˘
and`
xψy, n˘
P`
F7x Y F3x bound
˘
and α3pxψy, n, 11q “ xDxnφy and
Rem.
`
xψy, lU˘
Equ. Rem.
`
xDxnφy, lD˘
˛
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
where
˝ “ Dn ď rU Dx@xnφy ď rU . . .” stands for
“ Dn ď rU Dm ď rU´
m P F ^ β33pmq “ 11 ^ β2
3pmq “ n ^ β13pmq “ xφy ^ . . .
¯
”
˝ “ xφy stands for “ β13
`
x@xnφy˘
”
˝ “ Dxxky ď lU . . .” stands for “ Dk ď lU`
xxky “ α3pk ` 1, 0, 0q ^ . . .˘
”
........................................................................
2xk has no free occurrence in Γ, Dxn φ and ∆
130 Godel & Recursivity
Γ, t “ t $ ∆Ref
Γ $ ∆
pU,Dq P RRef
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
rU Equ. rDand
Dxty ď lU
¨
˚
˚
˝
xt “ ty Ins.lU
and
Rem.
`
xt “ ty, lU˘
Equ. lD
˛
‹
‹
‚
........................................................................
Γ, t “ s, φrs{xns, φrt{xns $ ∆Rep
Γ, s “ t, φrt{xns $ ∆
pU,Dq P RRep
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
rU Equ. rDand
Dxty ď lU Dxsy ď lU Dn ď U Dxφy ď UU
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
xt “ sy Ins.lU
and
SFub. pxφy, xsy, nq Ins.
lU and SFub. pxφy, xty, nq Ins.
lU
and
xs “ ty Ins.lD and SF
ub. pxφy, xty, nq Ins.lD
and
Rem.
`
SFub. pxφy, xty, nq,Rem.
`
xs “ ty, lD˘˘
Equ.Rem.
`
SFub. pxφy, xsy, nq,Rem.
`
SFub. pxφy, xty, nq,Rem.
`
xt “ sy, lU˘˘˘
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
........................................................................
Arithmetic 131
Γ $ φ,∆ Γ $ ψ,∆^r
Γ $ φ^ ψ,∆
pUl, Ur, Dq P R^rðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
%
Ul, Ur, D P SQand
lUl Equ. lUr Equ. lDand
Dxφy ď rUl Dxψy ď rUr
¨
˚
˚
˝
xφy Ins.rUl and xψy Ins.
rUr and xφ^ ψy Ins.rD
and
Rem. pxφy, rUlq Equ. Rem. pxψy, rUrq Equ. Rem. pxφ^ ψy, rDq
˛
‹
‹
‚
........................................................................
Γ $ φ,∆_r1
Γ $ φ_ ψ,∆
pU,Dq P R_r1ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
Dxφy ď rU Dxψy ď rD
¨
˚
˚
˝
xφy Ins.rU and xφ_ ψy Ins.
rD
and
Rem. pxφy, rUq Equ. Rem. pxφ_ ψy, rDq
˛
‹
‹
‚
........................................................................
132 Godel & Recursivity
Γ $ ψ,∆_r2
Γ $ φ_ ψ,∆
pU,Dq P R_r2ðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
Dxψy ď rU Dxφy ď rD
¨
˚
˚
˝
xψy Ins.rU and xφ_ ψy Ins.
rD
and
Rem. pxψy, rUq Equ. Rem. pxφ_ ψy, rDq
˛
‹
‹
‚
........................................................................
Γ, φ $ ψ,∆Ñr
Γ $ φÑ ψ,∆
pUl, Ur, Dq P RÑr
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
Ul, Ur, D P SQand
Dxφy ď lUl Dxψy ď rUr
¨
˚
˚
˚
˚
˚
˚
˚
˚
˝
xφy Ins.lUl and xψy Ins.
rUr and xφÑ ψy Ins.rD
and
Rem. pxψy, rUrq Equ. Rem. pxφÑ ψy, rDq
and
Rem.
`
xφy, lUl˘
Equ. lD
˛
‹
‹
‹
‹
‹
‹
‹
‹
‚
........................................................................
Arithmetic 133
Γ, φ $ ∆ r
Γ $ φ,∆
pU,Dq P R rðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
Dxφy ď lU
¨
˚
˚
˚
˚
˚
˚
˚
˝
xφy Ins.lU and x φy Ins.
rD
and
Rem.
`
xφy, lU˘
Equ. lDand
Rem. px φy, rDq Equ. rU
˛
‹
‹
‹
‹
‹
‹
‹
‚
........................................................................
134 Godel & Recursivity
Γ $ φrxk{xns,∆@r
Γ $ @xn φ,∆2
pU,Dq P R@rðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
Dxxny ď rD Dxxky ď rU DxDxnφy ď rD Dxψy ď rU
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
x@xnφy Ins.rD and xψy Ins.
rU
and`
xψy, k˘
P F3x free and´
k ‰ nÑ`
xψy, n˘
P`
F7x Y F3x bound
˘
¯
and
α3pSFub. pxψy, xxny, kq , n, 11q “ x@xnφy
and
Rem. pxψy, rUq Equ. Rem. px@xnφy, rDq
and
@xθy ď rD´
xθy Ins.rD Ñ pxθy, kq P
`
F7xk Y F3xk bound
˘
¯
and
@xδy ď rD´
xδy Ins.rD Ñ pxδy, kq P
`
F7xk Y F3xk bound
˘
¯
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
or
¨
˚
˚
˚
˚
˚
˚
˚
˝
x@xnφy Ins.rD and xψy Ins.
rU and
`
xψy, k˘
P`
F7xk Y F3xk bound
˘
and`
xψy, n˘
P`
F7x Y F3x bound
˘
and α3pxψy, n, 11q “ x@xnφy and
Rem. pxψy, rUq Equ. Rem. px@xnφy, rDq
˛
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
where
˝ “ Dn ď rU Dx@xnφy ď rU . . .” stands for
“ Dn ď rU Dm ď rU´
m P F ^ β33pmq “ 10 ^ β2
3pmq “ n ^ β13pmq “ xφy ^ . . .
¯
”
˝ “ xφy stands for “ β13
`
x@xnφy˘
”
˝ “ Dxxky ď rU . . .” stands for “ Dk ď rU`
xxky “ α3pk ` 1, 0, 0q ^ . . .˘
”
........................................................................
2xk has no free occurrence in Γ, @xn φ and ∆
Arithmetic 135
Γ $ φrt{xns,∆Dr
Γ $ Dxn φ,∆
pU,Dq P RDrðñ
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
Dn ď rD DxDxnφy ď rD Dxty ď rU
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
¨
˚
˚
˚
˚
˚
˚
˚
˝
xDxnφy Ins.rD and
`
xφy, n˘
P F3x free
and
SFub. pxφy, xty, nq Ins.
rU
and
Rem. pSFub. pxφy, xty, nq, rUq Equ. Rem. pxDxnφy, rDq
˛
‹
‹
‹
‹
‹
‹
‹
‚
or
¨
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˚
˝
xDxnφy Ins.rD
and`
xφy, n˘
P`
F7x Y F3x bound
˘
and
xφy Ins.rU
and
SFub. pxφy, xty, nq Ins.
rU
and
Rem. pxφy, rUq Equ. Rem. pxDxnφy, rDq
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˛
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‹
‚
˝ “ Dn ď rU DxDxnφy ď rU . . .” stands for
“ Dn ď rU Dm ď rU´
m P F ^ β33pmq “ 11 ^ β2
3pmq “ n ^ β13pmq “ xφy ^ . . .
¯
”
˝ “ xφy stands for “ β13
`
xDxnφy˘
”
˝ “ Dxty ď rU . . .” stands for “ Dv ď rU`
v P T ^ . . .˘
”
........................................................................
136 Godel & Recursivity
Γ $ ∆wknl
Γ, φ $ ∆
pU,Dq P Rwknl
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
rU Equ. rDand
Dxφy ď lD
¨
˚
˚
˝
xφy Ins.lD
and
Rem.
`
xφy, lD˘
Equ. lU
˛
‹
‹
‚
........................................................................
Γ $ ∆wknr
Γ $ φ,∆
pU,Dq P Rwknr
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
Dxφy ď rD
¨
˚
˚
˝
xφy Ins.rD
and
Rem. pxφy, rDq Equ. rU
˛
‹
‹
‚
........................................................................
Arithmetic 137
Γ, φ, φ $ ∆ctrl
Γ, φ $ ∆
Γ $ φ, φ,∆ctrr
Γ $ φ,∆
pU,Dq P Rctr l&r ðñ
$
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
%
U,D P SQand
lU Equ. lDand
rU Equ. rD
........................................................................
Γ $ φ,∆ Γ1, φ $ ∆1
cut
Γ,Γ1 $ ∆,∆1
pUl, Ur, Dq P Rcut
ðñ$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
Ul, Ur, D P SQand
Dxφy ď rUl
¨
˚
˚
˚
˚
˚
˚
˚
˚
˝
xφy Ins.rUl and xφy Ins.
lUr
and
Union
`
Rem.
`
xφy, lUr˘
, lUl˘
Equ. lDand
Union pRem. pxφy, rUlq,rUrq Equ. rD
˛
‹
‹
‹
‹
‹
‹
‹
‹
‚
........................................................................
138 Godel & Recursivity
We write
$
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
%
R0 “ Rax
R1 “
$
&
%
R^l1 YR^l2 YR l YR@l YRDl YR_r1YR_r2 YR r YR@r YRDr YRwknlY
Rwknr YRctr l&r YRRep YRRef YRcut
R2 “ R_l YRÑlYR^r
We say an integer codes a proof if it is of the form
α4pnode, left proof-tree, right proof-tree, arity of the ruleq.
Definition 149 The set Proofs of the codes of all possible proofs is defined by
k “ α4pn1, n2, n3, n4q P Proofsðñ
$
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
%
n4 “ 0 and n3 “ 0 and n2 “ 0 and n1 P R0
or
n4 “ 1 and n3 “ 0 and n2 P Proofs and`
β14pn2q, n1
˘
P R1
or
n4 “ 2 and n3 P Proofs and n2 P Proofs and`
β14pn3q, β
14pn2q, n1
˘
P R2.
Notation 150 Given any proof P we write xP y for the integer described above that codes this
proof.
Lemma 151 The set Proofs is Prim. Rec..
Proof of Lemma 151:
χProofspnq “
$
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
%
1 if β44pnq “ 0 and β3
4pnq “ 0 and β24pnq “ 0 and β1
4pnq P R0
1 if β44pnq “ 1 and β3
4pnq “ 0 and χProofs
`
β24pnq
˘
“ 1 and`
β14 ˝ β
24pnq, β
14pnq
˘
P R1
1 if β44pnq “ 2 and χProofs
`
β34pnq
˘
“ χProofs
`
β24pnq
˘
“ 1 and`
β14 ˝ β
34pnq, β
14 ˝ β
24pnq, β
14pnq
˘
P R2
0 otherwise.
Arithmetic 139
By Lemma 126 Proofs is Prim. Rec.% 151
5.3 Undecidability of Robinson Arithmetic
Definition 152
(1) A theory T is recursive if the following set is recursive:!
xφy | φ P T)
.
(2) A theory T is decidable if the following set is recursive:
thms pT q “!
xφy | T $c φ)
.
Informally, this means that a theory is decidable if one has an algorithm which on any input
that represents a formula φ stops and accepts if T proves φ, and stops and rejects if T does not
prove φ.
Theorem 153 Given any theory T , the set!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
is
˝ primitive recursive if T is primitive recursive,
˝ recursive if T is recursive.
Proof of Theorem 153: First, P is proof that T $c φ if P is a proof-tree whose root is some
sequent “∆ $ φ” for some finite ∆ Ď T .
We recall Lemma 135 which stated that the following set is Prim. Rec.
F3closed “
xφy | φ is a closed formula from LA(
Second, let χT P N ÝÑ N be the characteristic function of T . i.e.
χT pnq “
#
1 if n “ xφy P T
0 otherwise.
The characteristic function of
A “!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
140 Godel & Recursivity
is
χApn,mq “
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
1 if
$
’
’
’
’
’
’
’
’
’
’
’
’
’
’
&
’
’
’
’
’
’
’
’
’
’
’
’
’
’
%
n P Proofsand
m P Fand
@i ď lβ14pnq zlβ1
4pnqyi ‰ 0 ÝÑ χT
`
zlβ14pnqy
i˘
“ 1
and
@j ď rβ14pnq
`
zrβ14pnqy
j˘
“ m
0 otherwise.
We see that this function is primitive recursive if χT is primitive recursive, and total recursive
if χT is total recursive.
% 153
Proposition 154 Given any theory T ,
!
xψy | ψ P T)
is recursive ùñ
!
xφy | T $c φ)
is recursively enumerable.
Proof of Proposition 154: We set
A “!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
and B “!
xφy | T $c φ)
.
By Theorem 153, the set A is recursive. Hence the function
χpart
B pnq “ 1 9
´
1 9
`
µk χApk, nq “ 1˘
¯
is also Part. Rec. and it satisfies n P B ðñ χpart
B pnq “ 1. % 154
We recall that a theory is complete if it is both consistent and satisfies for each formula φ either
T $c φ or T $c φ.
Corollary 155 Let T be any recursive theory.
If T is complete, then T is decidable.
Proof of Corollary 155: By Proposition 154 both sets!
xφy | T $c φ)
and!
x φy | T $c φ)
Arithmetic 141
are recursively enumerable. Since T is complete we have
!
xφy | T &c φ)
“
!
x φy | T $c φ)
Hence
Nr!
xφy | T $c φ)
“`
Nr F˘
Y
!
x φy | T $c φ)
is recursively enumerable, which yields the result. % 155
Theorem 156 Let T Ě Rob. be any theory,
T is consistent ðñ T is undecidable.
Proof of Theorem 156:
(ð) T inconsistent ñ T decidable is straightforward since in this case we have
!
xφy | T $c φ)
“ F .
(ñ) Towards a contradiction, we assume that T is decidable. We then consider
F3x0 !free“
xφy | φ is a formula whose only free variable is x0
(
.
Since we already know that the set
F3x free “ `
xφy, n˘
| φ is a formula from LA and xn is free in φ(
is Prim. Rec. (see Lemma 133) and we have
xφy P F3x0 !freeðñ
`
xφy, 0˘
P F3x free and @n ď xφy
´
n ‰ 0 Ñ`
xφy, n˘
R F3x free
¯
.
an immediate consequence is that F3x0 !freeis also Prim. Rec.
Then the set2!
`
xφy, n˘
| xφy P F3x0 !freeand T $c φrn{x0s
)
“!
`
xφy, n˘
| xφy P F3x0 !freeand SF
ub. pxφy, xny, 0q P
xψy | T $c ψ(
)
2we recall that on page 118 we defined SFub. pnu, nt, nq “
$
&
%
xφrt{xnsy if nφ “ xφy P F , nt “ xty P T
0 otherwise .
142 Godel & Recursivity
is recursive.
We then consider the following set
:Diag. “
"
k P N | pk, kq R!
`
xφy, n˘
| xφy P F3x0 !freeand T $c φrn{x0s
)
*
.
:Diag. is clearly recursive, therefore there exists some function φ:px0q that represents:Diag..
This means that for all k P N we have:
˝ k P:Diag. ùñ Rob. $c φrk{x0s
˝ k R:Diag. ùñ Rob. $c φrk{x0s.
It is enough to consider the closed formula φrrxφ:ys{x0s where rxφ:ys stands for the termxφ:y
hkkikkj
S . . . S 0.
As with the Halting problem where we asked the question whether our machine would stop
on its own code as input, here we ask the question whether or not T proves φ:rrxφ:ys{x0s.
This depends on whether xφ:y belongs to:Diag. or not.
˝ xφ:y P:Diag. ùñ Rob. $c φ:rrxφ:ys{x0s
ùñ T $c φ:rrxφ:ys{x0sùñ xφ:y R
:Diag.
˝ xφ:y R:Diag. ùñ Rob. $c φ:rrxφ:ys{x0s
ùñ T $c φ:rrxφ:ys{x0s.
Since T is consistent we cannot have both
T $c φ:rrxφ:ys{x0sand T $c φ:rrxφ:ys{x0s
.
Therefore, we have T &c φ:rrxφ:ys{x0swhich immediately implies xφ:y P
:Diag..
We obtain
xφ:y P:Diag. ðñ xφ:y R
:Diag..
This contradiction finishes the proof that T is undecidable.
% 156
This brings to the mind what we did in the proof of Proposition 66.
We propose again a picture that illustrates this diagonal argument. If pφiqiPN is a enumeration
of all the formulas with x0 as one and only free variable, we make sure to define a formula which
satisfies this requirement although it is none of them.
Arithmetic 143
φ0 φ1 φ2 φ3 φ4 φ5 φn
xφ0y 0 1 1 0 1 0 . . . 0 . . .
xφ1y 1 1 1 0 0 0 . . . 0 . . .
xφ2y 1 0 1 0 0 0 . . . 1 . . .
xφ3y 0 0 1 0 1 0 . . . 0 . . .
xφ4y 0 1 0 1 1 1 . . . 0 . . .
xφ5y 1 1 0 0 0 0 . . . 0 . . .
......
......
......
......
xφny 1 0 0 0 1 1 . . . 1 . . ....
......
......
......
...
There is a 1 on the array – for instance on row 3 and column 2 – if T $c φ2prxφ3ysq, and there
is a 0 – for instance on row 2 and column 5 – if T &c φ5prxφ2ysq.
Now if T is decidable, the whole array is decidable. This means there is a Decider that on any
input pn,mq accepts if there is a 1 on position pn,mq, and rejects if there is a 0. Furthermore,
for the whole array is decidable, its diagonal is also decidable. Hence the complement of the
diagonal is decidable as well. Finally, since all recursive sets are representable, the complement of
the diagonal is represented by some formula among the enumeration – say φn – which inevitably
stumbles on rxφnysq.
144 Godel & Recursivity
Theorem 157 (undecidability of first order logic) The set
!
xφy | $c φ)
.
is not recursive
Proof of Theorem 157: Since Rob. is a finite theory, we let φRob. be the conjunction of the seven
axioms from Rob.. For any formula ψ we have
Rob. $c ψ ðñ φRob. $c ψ ðñ $c φRob. Ñ ψ.
xψy P
!
xφy | Rob. $c φ)
ðñ xφRob. Ñ ψy P
!
xφy | $c φ)
.
Therefore, if the set of codes of universally valid formulas were decidable, then Robinson arith-
metic would also be decidable.
% 157
Theorem 158 (Godel’s first incompleteness theorem) Let T Ě Rob. be any theory both
consistent and recursive.
T is incomplete.
Proof of Theorem 158: By corollary 155 every recursive complete theory is decidable. By
Theorem 156 the theory T is undecidable.
% 158
Another way of stating this theorem that one encounters very frequently among the philosophy
community is the following:
There exists a true sentence that is not provable.
Or even,
There exists a sentence that is true although it is not provable.
“Provable” usually refers to Peano Arithmetic, and “true” means true in the standard model.
And very often people add
Taking this true sentence as an axiom inevitably yields another one that is not provable.
Of course the understatement hidden behind is “the complete theory of the standard model is
not recursive”.
Chapter 6
Godel’s Second IncompletenessTheorem
6.1 Peano Arithmetic and IΣ01
To prove Godel’s second incompleteness theorem we need to work in a theory slightly more
expressive than Rob. For this reason we introduce the theory of Peano arithmetic.
Peano is a theory based on the same language as Robinson arithmetic : LA “ t0, S,`, ¨u
Peano has infinitely many axioms:
axiom 1. @x Sx ‰ 0
axiom 2. @x Dy px ‰ 0 Ñ Sy “ xq
axiom 3. @x @y pSx “ Sy Ñ x “ yq
axiom 4. @x x`0 “ x
axiom 5. @x @y´
x`Sy “ Spx`yq¯
axiom 6. @x x¨0 “ 0
axiom 7. @x @y´
x¨Sy “ px¨yq`x¯
axiom schema (induction) @x0 @x1 . . . @xn
ˆ
´
φr0{x0s ^ @x0
`
φÑ φrSx0{x0s
˘
¯
Ñ @x0 φ
˙
(for any formula φrx0,x1,...,xns)1.
So we see that Peano is nothing but Rob. plus the induction schema for all formulas constructed
on the language of arithmetic. In fact we will not need to work within Peano but only a part of
1the notation φrx0,x1,...,xns means that the free variable of φ are all among x0, x1, . . . , xn.
146 Godel & Recursivity
it formed of Rob. plus the induction schema restricted to the sole Σ01-formulas (see next section).
This theory is called Rob.` IΣ01
Example 159 We saw that Rob. does not prove that the addition is commutative. We want
to prove here that within Rob. ` IΣ01 the addition becomes commutative. For this purpose we
will have to use several instances of the inductions schema.
(1) We first show that
Rob.` IΣ01 $c @x x`0 “ 0`x.
Indeed we have both
˝ $c 0`0 “ 0`0
˝ Rob. $c @x´
`
x`0 “ 0`x˘
Ñ`
Sx`0 “ 0`Sx˘
¯
because we have by
4 @x x`0 “ x and 5 @x @y`
x`Sy “ Spx`yq˘
Rob. $c Sx`0 “ Sx ^ 0`Sx “ Sp0`xq
hence
Rob., x`0 “ 0`x $c Sx`0 “ Sx ^ 0`Sx “ Spx`0q ^ Spx`0q “ Sx
So by applying the induction schema to the ∆00-formula x`0 “ 0`x we obtain the result.
(2) We then show that
Rob.` IΣ01 $c @x @y x`Sy “ Sx`y.
Indeed we have both
˝ Rob. $c @x x`S0 “ Sx`0 by
4 @x x`0 “ x and 5 @x @y`
x`Sy “ Spx`yq˘
˝ Rob. $c @x´
`
x`Sy “ Sx`y˘
Ñ`
x`SSy “ Sx`Sy˘
¯
because we have by
5 @x @y`
x`Sy “ Spx`yq˘
Rob. $c x`SSy “ Spx`Syq
hence
Rob., x`Sy “ Sx`y $c Spx`Syq “ SpSx`yq “ Sx`Sy.
Arithmetic 147
So by applying the induction schema to the ∆00-formula x`Sy “ Sx`y we obtain the
result.
(3) Finally we show that
Rob.` IΣ01 $c @x @y x`y “ y`x.
Indeed we have both
˝ Rob.` IΣ01 $c @x x`0 “ 0`x for this was what we established in case (1).
˝ Rob. $c @x´
`
x`y “ y`x˘
Ñ`
x`Sy “ Sy`x˘
¯
because by
5 @x @y`
x`Sy “ Spx`yq˘
we have
Rob., x`y “ y`x $c x`Sy “ Spx`yq “ Spy`xq “ y`Sx
hence by applying case (2) we obtain
Rob.` IΣ01, x`y “ y`x $c x`Sy “ Sy`x.
So, in the end, by applying the induction schema to the ∆00-formula x`y “ y`x we obtain
the result.
Example 160 We saw that Rob. proves that every integer (standard or non-standard) is always
comparable with any standard integer:
4.11 Rob. $c @x`
x ď n _ n ď x˘
Now we establish that Rob.` IΣ01 proves that any two integers are always comparable:
Rob.` IΣ01 $c @x @y
`
x ď y _ y ď x˘
.
We recall that x ď y stands for Dz z`x “ y. So we consider the instance of the axiom schema
for the Σ01-formula
φrx, ys :“ Dz z`x “ y _ Dz z`y “ x.
@y
¨
˚
˝
¨
˚
˝
`
Dz z`0 “ y _ Dz z`y “ 0˘
^
@x´
`
Dz z`x “ y _ Dz z`y “ x˘
Ñ`
Dz z`Sx “ y _ Dz z`y “ Sx˘
¯
˛
‹
‚
Ñ @x
¨
˝
Dz z`x “ y
_
Dz z`y “ x
˛
‚
˛
‹
‚
148 Godel & Recursivity
(1) By 4 @x x`0 “ x have
Rob. $c Dz z`0 “ y
which takes care of the first part: Dz z`0 “ y _ Dz z`y “ 0.
(2) For the second part we need to distinguish between two cases:
if Dz z`y “ x we distinguish between z “ 0 and z ‰ 0
if 0`y “ x by Example 159, we have
Rob.` IΣ01 $c 0`y “ xÑ x “ y
and
Rob.` IΣ01 $c x “ y Ñ S0`y “ 0`Sy “ Sy “ Sx
if Dz ‰ 0 z`x “ y then
Rob., Dz ‰ 0 z`x “ y $c Dz1 Sz1`x “ y
By Example 159, we obtain what we need:
Rob.` IΣ01, Dz ‰ 0 z`x “ y $c Dz
1 z1`Sx “ y
if Dz z`x “ y By 5 @x @y`
x`Sy “ Spx`yq˘
we have
Rob., z`x “ y $c Spz`yq “ z`Sy “ Sx
and by Example 159, we have
Rob.` IΣ01 $c z`Sy “ SxÑ Sz`y “ Sx
which gives the result we need:
Rob.` IΣ01, Dz z`x “ y $c Dz z`y “ Sx
So, in the end, by applying the induction schema to the Σ01-formula
φrx, ys :“ Dz z`x “ y _ Dz z`y “ x
we obtain the result.
Arithmetic 149
Example 161 We saw that Rob. does not prove that the addition is associative. We show here
that Rob.` IΣ01 proves that the addition is associative:
Rob.` IΣ01 $c @x @y @z px`yq`z “ x`py`zq.
(1) We first show that
Rob. $c @x @y px`yq`0 “ x`py`0q.
Indeed by 4 @x x`0 “ x we have
Rob. $c px`yq`0 “ x`y “ x`py`0q.
(2) We then show that
Rob. $c @x @y @z´
px`yq`z “ x`py`zq¯
Ñ
´
px`yq`Sz “ x`py`Szq¯
.
by 5 @x @y`
x`Sy “ Spx`yq˘
we have
Rob. $c px`yq`Sz “ S`
px`yq`z˘
and also
Rob. $c S`
x`py`zq˘
“ x`Spy`zq “ x`py`Szq
therefore we obtain
Rob., px`yq`z “ x`py`zq $c px`yq`Sz “ x`py`Szq.
(3) Finally, by applying the induction schema to the ∆00-formula px`yq`z “ x`py`zq we
obtain the result.
Example 162 We saw that Rob. does not prove that the multiplication is commutative. We
show here Rob.` IΣ01 proves that the addition is commutative.
(1) We first show that
Rob.` IΣ01 $c @x x¨0 “ 0¨x.
Indeed we have both
150 Godel & Recursivity
˝ $c 0¨0 “ 0¨0
˝ Rob. $c @x´
`
x¨0 “ 0¨x˘
Ñ`
Sx¨0 “ 0¨Sx˘
¯
because we have by
6 @x x¨0 “ 0 and 7 @x @y`
x¨Sy “ px¨yq`x˘
Rob. $c Sx¨0 “ 0 ^ 0¨Sx “ p0¨xq`0
hence
Rob., x¨0 “ 0¨x $c Sx¨0 “ 0 “ 0`0 “ p0¨xq`0.
So by applying the induction schema to the ∆00-formula x¨0 “ 0¨x we obtain the result.
(2) We then show that
Rob.` IΣ01 $c @x @y Sx¨y “ px¨yq`y.
Indeed we have both
˝ Rob. $c @x Sx¨0 “ px¨0q`0 by a simple application of
4 @x x`0 “ x and 6 @x x¨0 “ 0
˝ Rob. $c @x´
`
Sx¨y “ px¨yq`y˘
Ñ`
Sx¨Sy “ px¨Syq`Sy˘
¯
because we have by
7 @x @y`
x¨Sy “ px¨yq`x˘
Rob. $c Sx¨Sy “ pSx¨yq`Sx
hence
Rob., Sx¨y “ px¨yq`y $c Sx¨Sy “`
px¨yq`y˘
`Sx.
but we also know that the addition is associative and commutative, thus we have
Rob.` IΣ01 $c x¨y`
`
y`Sx˘
“ x¨y``
y`Sx˘
“ x¨y``
Sy`x˘
and
Rob.` IΣ01 $c x¨y`
`
Sy`x˘
“ x¨y``
x`Sy˘
“`
x¨y`x˘
`Sy “ x¨Sy`Sy.
So by applying the induction schema to the ∆00-formula Sx¨y “ px¨yq`y we obtain the
result.
(3) Finally we show that
Rob.` IΣ01 $c @x @y x¨y “ y¨x.
Indeed we have both
Arithmetic 151
˝ Rob.` IΣ01 $c @x x¨0 “ 0¨x for this was what we established in case (1).
˝ Rob.` IΣ01 $c @x
´
`
x¨y “ y¨x˘
Ñ`
x¨Sy “ Sy¨x˘
¯
because by
7 @x @y`
x¨Sy “ px¨yq`x˘
we have
Rob., x¨y “ y¨x $c x¨Sy “ px¨yq`x “ py¨xq`x
by case (2) we have
Rob.` IΣ01 $c py¨xq`x “ Sy¨x
which leads to
Rob.` IΣ01, x¨y “ y¨x $c x¨Sy “ Sy¨x
So, in the end, by applying the induction schema to the ∆00-formula x¨y “ y¨x we obtain
the result.
Example 163 We show here that Rob. ` IΣ01 proves that the multiplication distributes over
the addition:
Rob.` IΣ01 $c @x @y @z x¨py`zq “ px¨yq`px¨zq.
(1) We first show that
Rob. $c @x @y x¨py`0q “ px¨yq`px¨0q.
which is immediate by
4 @x x`0 “ x and 6 @x x¨0 “ 0
(2) We then show that
Rob.` IΣ01 $c @x @y @z
´
x¨py`zq “ px¨yq`px¨zq¯
Ñ
´
x¨py`Szq “ px¨yq`px¨Szq¯
.
by 7 @x @y`
x¨Sy “ px¨yq`x˘
we have
Rob. $c px¨yq`px¨Szq “ px¨yq``
px¨zq`x˘
and
Rob.` IΣ01 $c px¨yq`
`
px¨zq`x˘
“`
px¨yq`px¨zq˘
`x
152 Godel & Recursivity
So that we obtain
Rob.` IΣ01, x¨py`zq “ px¨yq`px¨zq $c px¨yq`px¨Szq “
`
x¨py`zq˘
`x.
At last, by
5 @x @y`
x`Sy “ Spx`yq˘
and 7 @x @y`
x¨Sy “ px¨yq`x˘
we have
Rob. $c
`
x¨py`zq˘
`x “`
x¨Spy`zq˘
“`
x¨py`Szq˘
which terminates this proof.
(3) Finally, by applying the induction schema to the ∆00-formula x¨py`zq “ px¨yq`px¨zq we
obtain the result.
Example 164 We show that Rob.` IΣ01 proves that the multiplication is associative:
Rob.` IΣ01 $c @x @y @z px¨yq¨z “ x¨py¨zq.
(1) We first show that
Rob. $c @x @y px¨yq¨0 “ x¨py¨0q.
Indeed by 6 @x x¨0 “ 0 we have
Rob. $c px¨yq¨0 “ 0
and
Rob. $c x¨py¨0q “ x¨0 “ 0
(2) We then show that
Rob. $c @x @y @z`
px¨yq¨z “ x¨py¨zq˘
Ñ`
px¨yq¨Sz “ x¨py¨Szq˘
.
by 7 @x @y`
x¨Sy “ px¨yq`x˘
we have
Rob. $c x¨py¨Szq “ x¨`
py¨zq`y˘
and by Example 163 we also have
Rob.` IΣ01 $c x¨
`
py¨zq`y˘
“`
x¨py¨zq˘
`px¨yq
Arithmetic 153
so that we obtain
Rob.` IΣ01 , px¨yq¨z “ x¨py¨zq $c
`
x¨py¨zq˘
`px¨yq “`
px¨yq¨z˘
`px¨yq “ px¨yq¨Sz
which gives the result.
(3) Finally, by applying the induction schema to the ∆00-formula px¨yq¨z “ x¨py¨zq we obtain
the result.
Proposition 165 The theory Rob.` IΣ01 proves that
(1) ` is commutative,
(2) ` is associative,
(3) ¨ is commutative,
(4) ¨ is associative, and
(5) ¨ distributes over `.
Proof of Proposition 165:
(1) “` is commutative” is Example 159,
(2) “` is associative” is Example 161,
(3) “¨ is commutative” is Example 162,
(4) “¨ is associative” is Example 164,
(5) “¨ distributes over `” is Example 163.
% 165
6.2 The Arithmetical Hierarchy
For the purpose of defining the arithmetical hierarchy we add a binary symbol “ ă” to our
language but essentially for the purpose of denoting bounded formulas such as Dy ď t φ and
@y ď t φ. In a sense, this differs from the use of this same symbol inside Robinson arithmetic
(see page 89) where it was an abbreviation for “ Dy`
y`x “ z ^ x ‰ z˘
”. For the reason that
in what follows we will have
˝ “ Dy`
y`x “ z ^ x ‰ z˘
” is a Σ01-formula, and
˝ “ Dx ď z x ‰ z” is a ∆00-formula.
154 Godel & Recursivity
We will be working with Rob.` IΣ01 so for every x and y we will have both
x ď y _ y ď x
and
Dz z`x “ y ðñ Dz x`z “ y.
Definition 166 (∆00-formulas) The set of ∆0
0-formulas is the least that
(1) contains all atomic formulas: t0 “ t1
(2) is closed under conjunctions, disjunctions and negations
(3) is closed under bounded quantifications
if φ P ∆00 and t is a term, then @x ă t φ and Dx ă t φ both belong to ∆0
0.
Definition 167 (arithmetical hierarchy) The hierarchy of formulas from arithmetic is de-
fined by induction on n P N:
(1) Σ00 “ Π0
0 “ ∆00
(2) Σ0n`1 is the set of all formulas of the form Dx1 . . . Dxk φ where φ P Π0
n.
(3) Π0n`1 is the set of all formulas of the form @x1 . . .@xkφ where φ P Σ0
n.
(4) ∆0n`1 “ Σ0
n`1 XΠ0n`1
Remark 168 All the classes defined above are closed under (finite) conjunctions and disjonc-
tions.
Example 169
(1) x0 ă Spx2¨Sx1q ÝÑ @y ď x3 y`x0 “ x3 P ∆00
(2) @x @y´
x¨Sy “ px¨yq`x¯
P Π01
(3) @x Dy px ‰ 0 Ñ Sy “ xq P Π02
Arithmetic 155
Proposition 170 Given any n P N and any Σ01-formula φ :“ Dx0 Dx1 . . . Dxnψ where ψ is ∆0
0,
there exists some ∆00-formula ψ1 such that
Rob. $c Dx0 Dx1 . . . Dxnψ ÐÑ Dxψ1.
Proof of Proposition 170: We set
ψ1 “ Dx0 ď x Dx1 ď x . . . Dxn ď x´
αn`1
`
x0, x1, . . . , xn˘
“ x ^ ψ¯
where αn`1
`
x0, x1, . . . , xn˘
“ x denotes the ∆00-formula defined by induction on n ą 0 by
˝ “α2
`
x0, x1
˘
“ x” is “Dy ď x px0`x1q¨px0`x1`S0q “ y`y ^ y`x1 “ x”
˝ “αn`1
`
x0, x1, . . . , xn˘
“ x” is “Dz ď x´
α2
`
x0, x1
˘
“ z ^ αn`
x0, x1, . . . , xn´1, z˘
“ x¯
”.
% 170
Proposition 171 Given any n, k1, . . . , kn P N and any Σ0n`1-formula and Π0
n`1-formula respec-
tively
φ :“ Dxn1 Dxn2 . . . Dx
nkn@x
n´11 . . .@xn´1
kn´1Dxn´2
1 . . . Dn´2kn´2
@xn´31 . . . . . . Qx1
1 . . . Qx1k1ψ
where Q is either @ or D depending on the parity of n, and ψ is ∆00, and
θ :“ @xn1 @xn2 . . .@x
nknDx
n´11 . . . Dxn´1
kn´1@xn´2
1 . . .@xn´2kn´2
Dxn´31 . . . . . . Qx1
1 . . . Qx1k1γ
where Q is either @ or D depending on the parity of n, and γ is ∆00,
there exists ∆00-formulas ψ1 and γ1 such that
˝ Rob. $c φ ÐÑ Dyn @yn´1 Dyn´2 . . . Qy1ψ1, and
˝ Rob. $c θ ÐÑ @yn Dyn´1 @yn´2 . . . Qy1γ1.
Proof of Proposition 171: This is an easy exercise based on the same idea as the one used to
prove Proposition 170.
% 171
From now on, Γ stands for any of the classes Σ0n`1, Π0
n`1, ∆0n (any n P N).
Proposition 172 Given any term t that does not contain the variable z, and any formula ψ,
˝ $c Dy ď x Dz ψ ÐÑ Dz Dy ď x ψ
156 Godel & Recursivity
˝ $c @y ď x @z ψ ÐÑ @z @y ď x ψ
Proof of Proposition 172: Immediate. % 172
Proposition 173 Given any n P N, any term t that does not contain the variable z, and any
formula ψ P Γ there exists ψ1 P Γ,
(1) Rob. $c Dy ď t @z ψ ÐÑ @z Dy ď t ψ1
(2) Rob. $c @y ď t Dz ψ ÐÑ Dz @y ď t ψ1.
Proof of Proposition 173:
(1) The idea is to have z encode a sequence of t many integers, and to consider all such
sequences. For this we set
ψ2 “ φβpx0, y, z1, z2q ^ ψrx0{zs
where φβpx0, y, z1, z2q stands for
x0 ă Spz1¨Syq ^ Dθ ď z2´
θ¨Spz1¨Syq¯
`x0 “ z2
so that we obtain
Rob. $c Dy ď t @z ψ ÐÑ @z1 @z2 Dy ď t ψ2
from where we apply Proposition 171 to get the result.
(2) Mutatis mutandis, the same idea works fine.
% 173
We are now able to state a stronger version of Theorem 123:
Theorem 174 Every total recursive function is representable by some Σ01-formula.
Proof of Theorem 174: It is enough to go through the proofs of Examples 108, 109, 110 and
Lemmas 113 , 119, 122, and notice that all formulas we defined were Σ01-formulas. % 174
Arithmetic 157
6.3 A first glance at Godel’s second incompleteness theorem
We first recall that by Theorem 153 the set below is
!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
˝ primitive recursive if T is primitive recursive,
˝ recursive if T is recursive.
We consider any recursive theory T Ě Rob. and consider some Σ01-formula φ
proofTpx1, x2q which
represents the set above. This means that for all i1, i2 P N we have:
˝ if pi1, i2q P!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
, then Rob. $c φproofT
pi1, i2q;
˝ if pi1, i2q R!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
, then Rob. $c φproofTpi1, i2q.
so in particular if T is consistent, we have
P is a proof of T $c φ ðñ Rob. $c φproofT
prxP ys, rxφysq.
We consider the following primitive recursive function diag : N ÝÑ N.
diagpnq “
#
xφrrxφys{x0sy if n “ xφy P F3x0 !free
0 otherwise
together with any Σ01-formula φdiagpx0, x1q that represents diag. This means we have
for all n P NRob. $c @x0
´
diagpnq “ x0 ÐÑ φdiagpx0, nq¯
.
We define the Σ01-formula Ξ px0q by
Ξ px0q :“ Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, x0q˘
Proposition 175 For every integer n we have
N |ù Ξ pnq ðñ Rob. $c Ξ pnq .
Proof of Proposition 175:
(1) if n “ xφy P F3x0 !freeand there is a proof P of T $c φrrxφys{x0s we have both
Rob. $c φdiagprxφrrxφys{x0sys, nq
158 Godel & Recursivity
and
Rob. $c φproofT
`
rxP ys, rxφrrxφys{x0sys˘
therefore
Rob. $c Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, nq˘
which is
Rob. $c Ξ pnq .
(2) if n “ xφy P F3x0 !freeand there is no proof P of T $c φrrxφys{x0s we have for all proofs P
Rob. $c @x2
´
φdiagpx2, nq ÐÑ x2 “ rxφrrxφys{x0sys
¯
and
Rob. $c φproofT
`
rxP ys, rxφrrxφys{x0sys˘
and furthermore for every integer i
Rob. $c φproofT
`
i, rxφrrxφys{x0sys˘
therefore, since N |ù φRob., by the soundness theorem we have
Rob. &c Ξ pnq .
(3) if n R F3x0 !free, then for every integer i1,
Rob. $c φproofTpi1, diagpnqq
for the reason that for all integer i1
pi1, 0q R!
`
xP y, xφy˘
P N2 | P is a proof of T $c φ)
because 0 is never the code of a formula. Hence, by application of the soundness theorem
we have
Rob. &c Ξ pnq .
% 175
So to speak, N |ù Ξ pnq asserts that there exists a proof that there is a 1 on position pin, inq in
the array on page 143, where n is the integer that codes the formula φin .
We now consider the formula Ξ px0q – that we write Ξ – together with the term that represents
its code x Ξy and the term that represents the code of the formula Ξ px0q which “eats up” its
own code x Ξrrx Ξys{x0sy
Arithmetic 159
Claim 176
Rob. $c Ξrrx Ξys{x0s ÐÑ Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
which is precisely
Rob. $c Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, rx Ξysq˘
ÐÑ Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
.
Proof of Claim 176:
(ð) By the very definition of the function diag and that φdiag represents that function we have
Rob. $c φdiagprx Ξrrx Ξys{x0sys, rx Ξysq˘
thus
Rob. $c Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
ÝÑ Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, rx Ξysq˘
.
(ñ) Since φdiag represents the function diag we have
Rob. $c @x2
´
φdiagpx2, rx Ξysq˘
ÐÑ x2 “ rx Ξrrx Ξys{x0sys
¯
hence
Rob. $c
´
Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, rx Ξysq˘
ÝÑ x2 “ rx Ξrrx Ξys{x0sys
¯
therefore
Rob. $c Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, rx Ξysq˘
ÝÑ Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
.
% 176
Claim 177
T &c Ξrrx Ξys{x0s.
Proof of Claim 177: Towards a contradiction, we assume that
T $c Ξrrx Ξys{x0s.
It follows that there exists an integer xP y such that
`
xP y , rx Ξrrx Ξys{x0sys˘
P
!
`
xQy, xφy˘
P N2 | Q is a proof of T $c φ)
.
Therefore, since φproofT
represents the set above, we have
Rob. $c φproofT
`
rxP ys, rx Ξrrx Ξys{x0sys˘
160 Godel & Recursivity
and by Claim 176 we obtain
Rob. $c Ξrrx Ξys{x0s.
Since Rob. Ď T we obtain
T $c Ξrrx Ξys{x0s
which contradicts the fact that T is consistent for we obtain both
T $c Ξrrx Ξys{x0s and T $c Ξrrx Ξys{x0s.
% 177
Claim 178
Rob.
Ξrrx Ξys{x0s ÝÑ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
ff
$c Ξrrx Ξys{x0s ÝÑ conspT q.
Where conspT q stands for the formula2
Dxφy`
Dx0 φproofTpx0, xφyq ^ Dx0 φproofT
px0, x φyq˘
Proof of Claim 178: From Claim 176 we obtain
Rob. $c Ξrrx Ξys{x0s Ñ Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
.
Thus we have both
˝ Ξrrx Ξys{x0s Ñ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
$c Ξrrx Ξys{x0s Ñ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
˝ Rob. $c Ξrrx Ξys{x0s Ñ Dx1φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
which leads to
Rob.
Ξrrx Ξys{x0s Ñ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
+
$c Ξrrx Ξys{x0s Ñ
¨
˚
˚
˚
˝
Dx1 φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
Ź
Dx1 φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
˛
‹
‹
‹
‚
By the very definition3 of φproofT
and φproofRob.
we have
2We recall that we write Dxφy . . . for Dx`
φF pxq ^ . . ..3this means “if we choose wisely the Σ0
1-formulas φproofTand φproofRob.
that represent the two recursive sets
!
`
xP y, xφy˘
P N2| P is a proof of T $c φ
)
and!
`
xP y, xφy˘
P N2| P is a proof of Rob. $c φ
)
.
Arithmetic 161
˝ Rob. $c @x0 @x1
`
φproofRob.
px0, x1q ÝÑ φproofT
px0, x1q˘
.
Therefore we obtain
Rob.
Ξrrx Ξys{x0s Ñ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
+
$c Ξrrx Ξys{x0s Ñ
¨
˚
˚
˚
˝
Dx1 φproofT
`
x1, rxΞrrx Ξys{x0sys˘
Ź
Dx1 φproofT
`
x1, rx Ξrrx Ξys{x0sys˘
˛
‹
‹
‹
‚
which yields the result.
% 178
Lemma 179 Let T Ě Rob. be any consistent recursive theory.
If
T $c Ξrrx Ξys{x0s ÝÑ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
,
then
T &c conspT q.
Proof of Lemma 179: Follows immediately from Claims 177 and 178.
% 179
So we are left with the problem of characterising the consistent theories that both extend Robin-
son arithmetic and prove this very strange formula: Ξrrx Ξys{x0s ÝÑ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
.
Ultimately we will show that Rob.` IΣ01 is a good candidate. That is we will have
Rob.` IΣ01 $c Ξrrx Ξys{x0s ÝÑ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
.
It can easily be seen that this formula is Σ01. We will prove a more general result.
6.4 The core of the proof
We are going to prove the following, and for this we will make use of the completeness theorem.
Lemma 180 Let φ be any closed Σ01-formula.
Rob.` IΣ01 $c φ ÝÑ Dx1φproofRob.
px1, xφyq .
First notice that this lemma is far more involved than
Lemma 181 Let φ be any closed Σ01-formula.
Rob.` IΣ01 $c φ ùñ Rob.` IΣ0
1 $c Dx1φproofRob.px1, xφyq .
162 Godel & Recursivity
Indeed, the difficult part in proving
Rob.` IΣ01 $c φ ÝÑ Dx1φproofRob.
px1, xφyq
is when Rob.` IΣ01 &c φ and even more precisely when N * φ. Because as we will see below,
for a closed Σ01-formula, as soon as N |ù φ holds, N |ù Dx1φproofRob.
px1, xφyq holds as well and
every model M of Rob.` IΣ01 satisfies M |ù Dx1φproofRob.
px1, xφyq.
So, to sum up what we’ve just said, we have
N |ù φ ùñ Rob.` IΣ01 $c φ ÝÑ Dx1φproofRob.
px1, xφyq .
Now assume that N * φ holds and consider any model M of Rob.` IΣ01 such that M |ù φ
holds. Since N * φ, we also have Rob.` IΣ01 &c φ. Now proving
Rob.` IΣ01 $c φ ÝÑ Dx1φproofRob.
px1, xφyq
amounts to proving
M |ù Dx1φproofRob.px1, xφyq .
So, there should be some (necessarily non standard !) integer θ that “codes” a “proof” of the
sequent Rob. $φ. Of course this will not be a proof in the usual sense of a finite tree, but rather
some “non-standard” object.
Definition 182 Let M and N be two models of Rob., such that M is a substructure 4 of N .
N is a final extension of Mðñ
for every a P |M| and b P |N | we have
(1) N |ù b ď a ùñ b P |M|
(2) b R |M| ùñ a ď b.
Lemma 183 If N is a model of Rob., then the substructure M whose domain is
|M| “ tnN | n P Nu
is isomorphic to the standard model N.
4M is a substructure of N iff
˝ |M| Ď |N |˝ for every constant symbol c: cM “ cN
˝ for every function symbol f whose arity is n: fM“ fN
æ |M|n
˝ for every relation symbol R whose arity is n: RM“ RN
X |M|n.
Arithmetic 163
Proof of Lemma 183: Left as a very easy exercise.
% 183
Lemma 184 Up to isomorphism, every model N of Rob. is a final extension of the standard
model N.
Proof of Lemma 184: The mapping f : N ÝÑ |N | defined by fpnq “ nN is an injective
homomorphism that satisfies for every n P N and b P |N |:
(1)
N |ù b ď n ùñ N |ù b “ 0 _ b “ S0 _ . . . _ b “ n ùñ f´1pbq P N.
This is by
4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
.
(2)
b R f rNs ùñ n ď b.
This is by
4.11 Rob. $c @x`
x ď n _ n ď x˘
and
4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
.
This shows that N is a final extension of the structure induced by f rNs which is isomorphic to
the standard model.
% 184
Proof of Lemma 181: We make use of the completeness theorem and of the fact that the
standard model (N) is a model of Rob.` IΣ01.
(ð) Since
Rob.` IΣ01 $c Dx1φproofRob.
px1, xφyq
holds, we also have
N |ù Dx1φproofRob.px1, xφyq .
Therefore, there exists some (standard integer) n that codes a proof of φ in Robinson
arithmetic. Such a proof is also some proof of φ in Rob. ` IΣ01, which witnesses that we
have
Rob.` IΣ01 $c φ.
164 Godel & Recursivity
(ñ) Since
Rob.` IΣ01 $c φ
we also have
N |ù φ.
By induction on the height of φ we show that
N |ù Dx1φproofRob.px1, xφyq .
We recall that since M |ù Rob. is satisfied, the model M is some final extension of a
substructure which is isomorphic to the standard model. Therefore we can easily prove by
induction5:
(1) for every closed terms t1 and t2
N |ù t1 “ t2 ñ N |ù Dx1φproofRob.px1, xt1 “ t2yq .
This is done by induction on the complexity of t1 and t2.
(2) for every closed ∆00-formula φ
N |ù φ ñ N |ù Dx1φproofRob.px1, xφyq .
This is done by induction on the complexity of φ with the help of
4.10 Rob. $c @x“
x ď nÐÑ px “ 0 _ x “ S0 _ . . . _ x “ nq‰
.
(3) for every closed Σ01-formula of the form Dx1 . . . Dxn φ where φ is some ∆0
0-formula,
N |ù Dx1 . . . Dxn φ ñ N |ù Dx1φproofRob.px1, xDx1 . . . Dxn φyq .
This holds for
N |ù Dx1 . . . Dxn φ ùñ for some k1 . . . kn P N, φrk1{x1,...,kn{xns holds in N
ùñ N |ù φrk1{x1,...,kn{xns
ùñ N |ù Dx1φproofRob.
`
x1, xφrk1{x1,...,kn{xnsy˘
ùñ N |ù Dx1φproofRob.px1, xDx1 . . . Dxn φyq
Finally, if N |ù Dx1φproofRob.px1, xφyq holds, then we use the fact that every model M of
Rob.` IΣ01 is a final extension of (a structure isomorphic to) N to ensure that
M |ù Dx1φproofRob.px1, xφyq
holds as well. Once again the proof is straightforward and goes by induction on the
complexity of φ.
5the whole proof involves many cases. It is tedious but straightforward.
Arithmetic 165
% 181
During the course of the proof, we have established:
Proposition 185 Let φ be any closed Σ01-formula.
N |ù φ ÐÑ Dx1φproofRob.px1, xφyq .
Proof of Proposition 185: we distinguish between the two directions of “ÐÑ”.
(ñ) was taken care of during the proof of Lemma 181.
(ð) from the standard integer that codes a proof of φ from Robinson arithmetic, we recover a
proof of Rob. $ φ, which shows that φ holds in all models of Rob., and in particular inside
the standard one (N).
% 185
This proposition yields an easy but amazing corollary.
Corollary 186 If the Goldbach conjecture6 is neither provable nor disprovable, then it holds
true in N.
Proof of Corollary 186: The Goldbach conjecture is some Π01 statement. If the negation of the
Goldbach conjecture were true in N, then by Proposition 185 it would be provable. % 186
Before we come to the proof of Lemma 180 – which will immediately yield Godel’s second
incompleteness theorem – we need to take care of some humongous preliminary work.
Lemma 187 Let trx1,...,xns be any LA-term (where LA “ t0, S,`, ¨u).
Rob.`IΣ01 $c @x1 . . .@xn @xn`1
´
trx1,...,xns “ xn`1 ÝÑ Dx0 φproofRob.
`
x0, xtrx1,...,xns “ xn`1y˘
¯
.7
Proof of Lemma 187: We prove the result by induction on the height of the term trx1,...,xns.
htptq “ 0 we have three cases:
6Goldbach conjecture is: “every even integer strictly greater than 2 is the sum of two prime numbers”.7Where xtrx1,...,xns “ xn`1y stands for the formula xtrxk1
,...,xknvs“ xkn`1 yrxx1y{xk1
,...,xxny{xkn ,xxn`1y{xkn`1s
meaning that xtrxk1,...,xkn s
“ xkn`1 y is a formula whose n ` 1 (necessarily free) variables are
xk1 , . . . , xkn , xkn`1 and xtrx1,...,xns “ xn`1y is this term after the subsequent substitutions have taken place:
SFub.
´
. . .SFub.
´
SFub.
´
xtrxk1,...,xkn s
“ xkn`1 y, xx1y, k1
¯
, xx2y, k2
¯
, . . . , xxn`1y, kn`1
¯
.
166 Godel & Recursivity
t “ 0 we need to show
Rob.` IΣ01 $c @xn`1
´
0 “ xn`1 ÝÑ Dx0 φproofRob.px0, x0 “ xn`1yq
¯
which is
Rob.` IΣ01 $c @xn`1
´
0 ‰ xn`1 _ Dx0 φproofRob.px0, x0 “ xn`1yq
¯
which comes down to proving
Rob.` IΣ01 $c Dx0 φproofRob.
px0, x0 “ 0yq
¯
.
The code of the following proof is just what is needed:
ax
0 “ 0 $ 0 “ 0Ref
$ 0 “ 0
t “ xn`1 we need to show
Rob.` IΣ01 $c @xn`1
´
xn`1 “ xn`1 ÝÑ Dx0 φproofRob.px0, xxn`1 “ xn`1yq
¯
in which case the code of the following proof is what is needed
axxn`1 “ xn`1 $ xn`1 “ xn`1
Ref$ xn`1 “ xn`1
t “ xi pi ‰ n` 1q we need to show
Rob.` IΣ01 $c @xi @xn`1
´
xi “ xn`1 ÝÑ Dx0 φproofRob.px0, xxi “ xn`1yq
¯
which is also
Rob.` IΣ01 $c @xi @xn`1
´
xi ‰ xn`1 _ Dx0 φproofRob.px0, xxi “ xiyq
¯
which comes down to proving
Rob.` IΣ01 $c @xi Dx0 φproofRob.
px0, xxi “ xiyq .
in which case the code of the following proof is what is needed
axxi “ xi $ xi “ xi
Ref$ xi “ xi
htptq “ k` 1 we have three cases:
Arithmetic 167
t “ Su We need to show
Rob.`IΣ01 $c @x1 . . .@xn @xn`1
´
Surx1,...,xns “ xn`1 ÝÑ Dx0 φproofRob.
`
x0, xSurx1,...,xns “ xn`1y˘
¯
.
We proceed by induction on xn`1, which means we need to show
(1) Rob.`IΣ01 $c @x1 . . .@xn
´
Surx1,...,xns “ 0 ÝÑ Dx0 φproofRob.
`
x0, xSurx1,...,xns “ 0y˘
¯
.
The result follows immediately by 1 @x Sx ‰ 0 .
(2) And assuming that
Rob.`IΣ01 $c @x1 . . .@xn
´
Surx1,...,xns “ xn`1 ÝÑ Dx0 φproofRob.
`
x0, xSurx1,...,xns “ xn`1y˘
¯
holds, we need to show
Rob.`IΣ01 $c @x1 . . .@xn
´
Surx1,...,xns “ Sxn`1 ÝÑ Dx0 φproofRob.
`
x0, xSurx1,...,xns “ Sxn`1y˘
¯
.
By 3 @x @y pSx “ Sy Ñ x “ yq together with the induction hypothesis we
obtain
Rob.`IΣ01 $c @x1 . . .@xn
´
Surx1,...,xns “ Sxn`1 ÝÑ Dx0 φproofRob.
`
x0, xurx1,...,xns “ xn`1y˘
¯
.
We notice then that for any term a, b we have the following proof:ax.
Sa “ Sx rb{xs $ Sa “ Sx rb{xswknl
a “ b, Sa “ Sx rb{xs $ Sa “ Sx rb{xswknl
a “ b, Sa “ Sx rb{xs, Sa “ Sx ra{xs $ Sa “ Sx rb{xsRep
a “ b, Sa “ Sa $ Sa “ SbRef
a “ b $ Sa “ SbOr simply
ax.
Sa “ Sb $ Sa “ Sbwknl
a “ b, Sa “ Sb $ Sa “ Sbwknl
a “ b, Sa “ Sb, Sa “ Sa $ Sa “ SbRep
a “ b, Sa “ Sa $ Sa “ SbRef
a “ b $ Sa “ SbThen, we consider one application of the cut rule to get a proof of
Rob. $ Sa “ Sb assuming a proof of Rob. $ a “ b
...Rob. $ a “ b
ax.
Sa “ Sb $ Sa “ Sbwknl
a “ b, Sa “ Sb $ Sa “ Sbwknl
a “ b, Sa “ Sb, Sa “ Sa $ Sa “ SbRep
a “ b, Sa “ Sa $ Sa “ SbRef
a “ b $ Sa “ SbcutRob. $ Sa “ Sb
168 Godel & Recursivity
So, replacing a by urx1,...,xns, and b by xn`1 we obtain
...Rob. $ urx1,...,xns “ xn`1
ax.
Surx1,...,xns “ Sxn`1 $ Surx1,...,xns “ Sxn`1wknl
urx1,...,xns “ xn`1, Surx1,...,xns “ Sxn`1 $ Surx1,...,xns “ Sxn`1wknl
urx1,...,xns “ xn`1, Surx1,...,xns “ Sxn`1, Surx1,...,xns “ Surx1,...,xns $ Surx1,...,xns “ Sxn`1Rep
urx1,...,xns “ xn`1, Surx1,...,xns “ Surx1,...,xns $ Surx1,...,xns “ Sxn`1Ref
urx1,...,xns “ xn`1 $ Surx1,...,xns “ Sxn`1cutRob. $ Surx1,...,xns “ Sxn`1
So, from the code of a “proof” of Rob. $ urx1,...,xns “ xn`1 we easily obtain a
“proof” of Rob. $ Surx1,...,xns “ Sxn`1.
We then make use of the fact that urx1,...,xns “ xn`1 is ∆00 to obtain
Rob.`IΣ01 $c @x1 . . .@xn`1
´
Surx1,...,xns “ xn`1 ÝÑ Dx0 φproofRob.
`
x0, xSurx1,...,xns “ xn`1y˘
¯
.
t “ u`v We need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`vqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`vqrx1,...,xns “ xn`1y˘
¯
.
The proof goes by induction on v.
v “ 0 We need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`0qrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`0qrx1,...,xns “ xn`1y˘
¯
Since by 4 @x x`0 “ x we have
Rob. $c @x1 . . .@xn`1 pu`0qrx1,...,xns “ urx1,...,xns
Since our proof is by induction on the complexity of the term t and u is less
complicated than t “ u`v, we have
Rob.`IΣ01 $c @x1 . . .@xn`1
´
urx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xurx1,...,xns “ xn`1y˘
¯
The “code” of the following “proof” yields the result.
...Rob. $ u “ xn`1
ax.
u`0 “ u $ u`0 “ u@l
@x0 x0`0 “ x0 $ u`0 “ u
ax.
u`0 “ xn`1 $ u`0 “ xn`1wknl
u “ xn`1, u`0 “ xn`1 $ u`0 “ xn`1wknl
u “ u`0, u “ xn`1, u`0 “ xn`1 $ u`0 “ xn`1Rep
u`0 “ u, u “ xn`1 $ u`0 “ xn`1cut
@x0 x0`0 “ x0, u “ xn`1 $ u`0 “ xn`1cutRob. $ u`0 “ xn`1
Arithmetic 169
v “ xi We need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`xiqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`xiqrx1,...,xns “ xn`1y˘
¯
For this purpose we use the fact pu`xiqrx1,...,xns “ xn`1 is ∆00 and proceed by
induction on xn`1:
(1) The initial case is xi “ 0, which we already considered.
(2) Assuming
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`xiqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`xiqrx1,...,xns “ xn`1y˘
¯
we need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`Sxiqrx1,...,xns “ xn`1y˘
¯
Once again, we proceed by induction on xn`1:
(a) The initial case is xn`1 “ 0. We need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ 0 Ñ Dx0 φproofRob.
`
x0, xpu`Sxiqrx1,...,xns “ 0y˘
¯
which follows immediately by 5 @x @y`
x`Sy “ Spx`yq˘
and 1 @x Sx ‰ 0 .
(b) We assume
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu`Sxiqrx1,...,xns “ xn`1y˘
¯
and we need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ Sxn`1 Ñ Dx0 φproofRob.
`
x0, xpu`Sxiqrx1,...,xns “ Sxn`1y˘
¯
By 5 @x @y`
x`Sy “ Spx`yq˘
and 3 @x @y pSx “ Sy Ñ x “ yq
we have
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ Sxn`1 Ñ pu`xiqrx1,...,xns “ xn`1
¯
By the previous induction hypothesis, we have
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu`Sxiqrx1,...,xns “ Sxn`1 Ñ Dx0 φproofRob.
`
x0, xpu`xiqrx1,...,xns “ xn`1y˘
¯
The “code” of the “proof” on next page gives us what we need, which
terminates the proof by induction on xn`1.
So we obtain precisely the formula that we needed to complete the proof by
induction on xi.
170 Godel & Recursivity
Hence the whole result is proved.
v “ v0`v1 is left as a tedious exercise.
v “ v0¨v1 is left as a tedious exercise as well.
t “ u¨v We need to show
Rob.`IΣ01 $c @x1 . . .@xn`1
´
pu¨vqrx1,...,xns “ xn`1 Ñ Dx0 φproofRob.
`
x0, xpu¨vqrx1,...,xns “ xn`1y˘
¯
.
The proof is similar to the case of the addition, and we leave it as a very tedious
exercise.
% 187
We obtain the wanted “proof” by making the following replacement in the “proof” below:
˝ a by urx1,...,xns ˝ b by xirx1,...,xns ˝ c by xn`1
ax.
a`Sb “ Spa`bq $ a`Sb “ Spa`bq@l
@x1 a`Sx1 “ Spa`x1q $ a`Sb “ Spa`bq@l
@x0 @x1 x0`Sx1 “ Spx0`x1q $ a`Sb “ Spa`bq
...Rob. $ a`b “ c
ax.
Spa`bq “ Sc $ Spa`bq “ Scwknl
pa`bq “ c, Spa`bq “ Sc $ Spa`bq “ Scwknl
pa`bq “ c, Spa`bq “ Sc, Spa`bq “ Spa`bq $ Spa`bq “ ScRep
pa`bq “ c, Spa`bq “ Spa`bq $ Spa`bq “ ScRef
pa`bq “ c $ Spa`bq “ Sccut
Rob. $ Spa`bq “ Sc
ax.
a`Sb “ Sc $ a`Sb “ Scwknl
a`Sb “ Sc, Spa`bq “ Sc $ a`Sb “ Scwknl
Spa`bq “ a`Sb, a`Sb “ Sc, Spa`bq “ Sc $ a`Sb “ ScRef
a`Sb “ Spa`bq, Spa`bq “ Sc $ a`Sb “ Sccut
Rob., a`Sb “ Spa`bq $ a`Sb “ SccutRob. $ a`Sb “ Sc
172 Godel & Recursivity
Lemma 188 The set of all formulas φ that satisfies
Rob.` IΣ01 $c @x1 . . .@xn
´
φrx1,...,xns ÝÑ Dx0 φproofRob.
`
x0, xφrx1,...,xnsy˘
¯
.
is closed under
(1) conjunction
(2) disjunction
(3) existential quantification
(4) bounded universal quantification.
Proof of Lemma 188:
conjunction if φ is ψ ^ θ, and
˝ Rob.` IΣ01 $c @x1 . . .@xn
´
ψrx1,...,xns Ñ Dx0 φproofRob.
`
x0, xψrx1,...,xnsy˘
¯
˝ Rob.` IΣ01 $c @x1 . . .@xn
´
θrx1,...,xns Ñ Dx0 φproofRob.
`
x0, xθrx1,...,xnsy˘
¯
.
We consider the “code” of the following “proof”:
...Rob. $ φ
...Rob. $ ψ
^rRob. $ φ^ ψ
which yields
˝ Rob.`IΣ01 $c @x1 . . .@xn
´
pψ^θqrx1,...,xns Ñ Dx0 φproofRob.
`
x0, xpψ ^ θqrx1,...,xnsy˘
¯
.
disjunction this case is similar to the conjuction and left as an exercise.
existential quantification we consider Dxk φ, assuming that the following holds:
˝ Rob.` IΣ01 $c @x1 . . .@xn @xk
´
φrx1,...,xn,xks Ñ Dx0 φproofRob.
`
x0, xφrx1,...,xn,xksy˘
¯
Now we have
˝ $c @x1 . . .@xn @xk
´
φrx1,...,xn,xks Ñ Dxkφrx1,...,xns
¯
by considering the “code” of the following “proof”
...Rob. $ φrx1,...,xn,xks
DrRob. $ Dxk φrx1,...,xns
Arithmetic 173
we obtain
˝ Rob.` IΣ01 $c @x1 . . .@xn @xk
´
φrx1,...,xn,xks Ñ Dx0 φproofRob.
`
x0, xDxk φrx1,...,xnsy˘
¯
which immediately gives
˝ Rob.` IΣ01 $c @x1 . . .@xn
´
Dxk φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, xDxk φrx1,...,xnsy˘
¯
.
bounded universal quantification we consider @xk ă xm φ, assuming that the following
holds:
˝ Rob.` IΣ01 $c @x1 . . .@xn @xk
´
φrx1,...,xn,xks Ñ Dx0 φproofRob.
`
x0, xφrx1,...,xn,xksy˘
¯
.
Strictly speaking, the formula @xk ă xm φ stands for @xk`
xk ă xm ÝÑ φ˘
which is
nothing but @xk`
Dy xk`y “ xm ÝÑ φ˘
and we have
˝ $c @xk`
Dy xk`y “ xm ÝÑ φ˘
ÐÑ @xk @y`
xk`y “ xm ÝÑ φ˘
We need to prove
˝ Rob.`IΣ01 $c @x1 . . .@xn @xm
´
@xk ă xm φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, x@xk ă xm φrx1,...,xnsy˘
¯
We prove the result by induction on xm:
(1) the initial case is
˝ Rob.`IΣ01 $c @x1 . . .@xn
´
@xk ă 0 φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, x@xk ă 0 φrx1,...,xnsy˘
¯
which is easy since the following holds.
˝ Rob.` IΣ01 $c @xk xk ă 0
(2) we assume
˝ Rob.`IΣ01 $c @x1 . . .@xn @xm
´
@xk ă xm φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, x@xk ă xm φrx1,...,xnsy˘
¯
and we show
˝ Rob.`IΣ01 $c @x1 . . .@xn @xm
´
@xk ă Sxm φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, x@xk ă Sxm φrx1,...,xnsy˘
¯
Firstly, notice that we have
˝ Rob. $c @xk @xm
´
xk ă Sxm ÐÑ`
xk ă xm _ xk “ xm˘
¯
Secondly, we have both
˝ Rob.`IΣ01 $c @x1 . . .@xn @xm
´
φrx1,...,xn,xms Ñ Dx0 φproofRob.
`
x0, xφrx1,...,xn,xmsy˘
¯
˝ Rob.`IΣ01 $c @x1 . . .@xn @xm
´
@xk ă xm φrx1,...,xns Ñ Dx0 φproofRob.
`
x0, x@xk ă xm φrx1,...,xnsy˘
¯
By mixing accordingly the two “proofs” we get what we need.
Finally, an instance of the induction schema yields the result.
174 Godel & Recursivity
% 188
We finally come to the proof of the main lemma which stated that
Rob.` IΣ01 $c φ ÝÑ Dx1φproofRob.
px1, xφyq
holds for every closed Σ01-formula.
Proof of Lemma 180: With Lemmas 187 and 188 we have almost everything we need. Because
we know that the result holds for the class that
˝ contains all atomic formulas
˝ and is closed under
(1) conjunction
(2) disjunction
(3) existential quantification
(4) bounded universal quantification.
Unfortunately, the class Σ01 contains all ∆0
0-formulas, and ∆00 is closed under negation. But we
see that if we can show that every formula which is the negations of an atomic formula belongs
to the class that Lemmas 187 and 188 provides, then we will have all Σ01-formulas.
Fortunately enough, given any formula of the form t ‰ u (where t and u are terms) satisfies
˝ Rob.` IΣ01 $c @x1 . . .@xn
´
t “ u ÐÑ`
Dx0 t`Sx0 “ u _ Dx0 u`Sx0 “ t˘
¯
.
Since the formula @x1 . . .@xn`
Dx0 t`Sx0 “ u _ Dx0 u`Sx0 “ t˘
belongs to our class, we
have
˝ Rob.` IΣ01 $c @x1 . . .@xn
´
`
Dx0 t`Sx0 “ u _ Dx0 u`Sx0 “ t˘
Ñ Dx0 φproofRob.
`
x0, x`
Dx0 t`Sx0 “ u _ Dx0 u`Sx0 “ t˘
y˘
¯
then, from the “code” of a “proof” of`
Dx0 t`Sx0 “ u _ Dx0 u`Sx0 “ t˘
we recover the
“code” of a “proof” of t ‰ u.
% 180
Theorem 189 (Godel’s second incompleteness theorem) Let T Ě Rob.`IΣ01 be any con-
sistent recursive theory.
T &c conspT q.
Arithmetic 175
Proof of Theorem 189: Follows immediately from Lemmas 179 and 180. For the condition re-
quired by Lemma 179 on a theory T Ě Rob. to satisfy the conditions of the second incompleteness
theorem was that
T $c Ξrrx Ξys{x0s ÝÑ Dx1φproofRob.
`
x1, rxΞrrx Ξys{x0sys˘
.
And it turns out that the formula Ξrrx Ξys{x0s is both closed and Σ01 for it is the formula
Dx1 Dx2
`
φproofT
px1, x2q ^ φdiagpx2, rx Ξysq˘
where both φproofT
px1, x2q and φdiagpx2, rx Ξysq are formulas that represent primitive recursive
relations, hence Σ01.
% 189
176 Godel & Recursivity
Bibliography
[1] Bezboruah, A., and Shepherdson, J. C. Godel’s second incompleteness theorem for
q. The Journal of Symbolic Logic 41, 02 (1976), 503–512.
[2] Boolos, G. Logic, logic, and logic. Harvard University Press, 1999.
[3] Boolos, G. S. The logic of provability. Cambridge university press, 1995.
[4] Boolos, G. S., Burgess, J. P., and Jeffrey, R. C. Computability and logic. Cam-
bridge University Press, 2002.
[5] Chiswell, I., and Hodges, W. Mathematical logic. Oxford University Press, 2007.
[6] Church, A. Introduction to Mathematical Logic. (Princeton Landmark in Mathematics.
Princeton University Press, 1996.
[7] Cooper, S. B. Computability theory. CRC Press, 2004.
[8] Cori, R., and Lascar, D. Mathematical Logic: Part 1: Propositional Calculus, Boolean
Algebras, Predicate Calculus, Completeness Theorems. Oxford University Press, 2000.
[9] Cori, R., and Lascar, D. Mathematical Logic, Part 2, Recursion Theory, Godel Theo-
rems, Set Theory, Model Theory. Oxford University Press, 2000.
[10] Cori, R., Lascar, D., and Krivine, J.-L. P. Logique mathematique, tome 1 : Calcul
propositionnel; algebre de Boole; calcul des predicats, vol. 1. Dunod, Paris, 2003.
[11] Cori, R., Lascar, D., and Krivine, J.-L. P. Logique mathematique, tome 2 : Fonctions
recursives, theoreme de Godel, theorie des ensembles, theorie des modeles, vol. 2. Dunod,
Paris, 2003.
[12] Cutland, N. Computability: An introduction to recursive function theory. Cambridge
university press, 1980.
[13] Davis, M. Computability & unsolvability. Courier Dover Publications, 1982.
[14] Davis, M. The undecidable: Basic papers on undecidable propositions, unsolvable problems
and computable functions. Courier Dover Publications, 2004.
178 Godel & Recursivity
[15] Ebbinghaus, H.-D., Flum, J., and Thomas, W. Einfuhrung in die mathematische
Logik. Wissenschaftliche Buchgesellschaft Darmstadt, 1978.
[16] Enderton, H. B. A mathematical introduction to logic. Academic Press, 1972.
[17] Enderton, H. B. Computability Theory: An Introduction to Recursion Theory. Academic
Press, 2010.
[18] Fitting, M. Incompleteness in the Land of Sets. College Publications, 2007.
[19] Franzen, T. Godel’s Theorem: an incomplete guide to its use and abuse. AK Peters,
2005.
[20] Godel, K. Die vollstandigkeit der axiome des logischen funktionenkalkuls. Monatshefte
fur Mathematik und Physik 37 (1930), 349–360.
[21] Godel, K. Uber formal unentscheidbare satze der principia mathematica und verwandter
systeme i. Monatshefte fur Mathematik 38, 1 (1931), 173–198.
[22] Grattan-Guinness, I. The search for mathematical roots, 1870-1940: logics, set theo-
ries and the foundations of mathematics from Cantor through Russell to Godel. Princeton
University Press, 2011.
[23] Griffor, E. R. Handbook of computability theory, vol. 140. Elsevier, 1999.
[24] Hardy, G. H., and Wright, E. M. An Introduction to the Theory of Numbers. Oxford
University Press, 1979.
[25] Hedman, S. A first course in logic: an introduction to model theory, proof theory, com-
putability, and complexity. Oxford University Press Oxford, 2004.
[26] Hilbert, D. Mathematische probleme. Archiv der Mathematik und Physik,(3) 1 (1901),
44–63.
[27] Hilbert, D. Mathematical problems. Bull. Amer. Math. Soc 8 (1902), 437–479.
[28] Hilbert, D., and Bernays, P. 1939, Grundlagen der Mathematik, vol. 2. Springer-
Verlag, Berlin, 19341934/39; Zweite Auflage, Springer-Verlag, 1968/70.
[29] Hopcroft, J. E., Motwani, R., and Ullman, J. D. Introduction to automata the-
ory, languages, and computation. Addison-Wesley Publishing Co., Reading, Mass., 2001.
Addison-Wesley Series in Computer Science.
[30] Kaye, R. Models of Peano arithmetic. Clarendon Press Oxford, 1991.
[31] Kleene, S. C. Introduction to Metamathematics. D. Van Nostrand Company, Inc., Prince-
ton, New Jersey, 1952.
[32] Kleene, S. C. Mathematical Logic. John Wiley & Sons, 1967.
Arithmetic 179
[33] Matiyasevich, Y. Hilbert’s tenth problem. MIT press, 1993.
[34] Nagel, E., Newman, J. R., Godel, K., and Girard, J.-Y. Le theoreme de Godel.
Editions du Seuil, 1989.
[35] Odifreddi, P. Classical recursion theory: The theory of functions and sets of natural
numbers. North Holland, 1992.
[36] Papadimitriou, C. H. Computational complexity. John Wiley and Sons Ltd., 2003.
[37] Peter, R., and Foldes, I. Recursive functions, vol. 80. Academic Press New York, 1967.
[38] Robinson, R. M. An essentially undecidable axiom system. In Proceedings of the inter-
national Congress of Mathematics (1950), vol. 1, pp. 729–730.
[39] Rogers Jr, H. Theory of recursive functions and effective computability. MIT press, 1987.
[40] Sacks, G. E. On suborderings of degrees of recursive unsolvability. Mathematical Logic
Quarterly 7, 1-5 (1961), 46–56.
[41] Sacks, G. E. Degrees of unsolvability. No. 55 in Annals of Mathematics Studies. Princeton
University Press, 1963.
[42] Shoenfield, J. R. Mathematical logic, vol. 21. Addison-Wesley Publishing Co., Reading,
Mass., 1967.
[43] Sipser, M. Introduction to the Theory of Computation, vol. 2. Thomson Course Technology
Boston, 2006.
[44] Smith, P. An introduction to Godel’s theorems. Cambridge University Press, 2013.
[45] Smullyan, R. M. Godel’s incompleteness theorems. Oxford University Press New York,
1992.
[46] Smullyan, R. M. Diagonalization and self-reference. Clarendon press Oxford, 1994.
[47] Soare, R. I. The history and concept of computability. Studies in Logic and the Founda-
tions of Mathematics 140 (1999), 3–36.
[48] Stillwell, J. Elements of number theory. Springer, 2003.
[49] Tarski, A., Mostowski, A., and Robinson, R. M. Undecidable theories, vol. 13.
Elsevier, 1953.
[50] Turing, A. M. On computable numbers, with an application to the entscheidungsproblem.
J. of Math 58 (1936), 345–363.
[51] Turing, A. M., and Copeland, B. J. The essential Turing: seminal writings in comput-
ing, logic, philosophy, artificial intelligence, and artificial life, plus the secrets of Enigma.
Oxford University Press, USA, 2004.
180 Godel & Recursivity
[52] van Heijenoort, J. From Freege to Godel: A Source Book in Mathematical Logic, 1879-
1931. Harvard University Press, 1977.