Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen...

53
Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems The main theorems of this part of the course are associated with the names of G¨ odel, Church, and Tarski. §1 Hilbert’s Program Foundational Crisis The end of the nineteenth century and the first three decades of the twentieth was a period of great philosophical ferment amongst some of the most distinguished mathematicians of the day. Mathematics was afflicted with problems ranging from paradoxes to antinomies. Moreover, new methods of proof introduced into mathematics precipitated an atmosphere of uncertainty regarding the foundations of mathematics. Inconsistencies in Cantor’s and Frege’s set theories: Russell’s Paradox (1901) Unrestricted comprehension principle allows one to build sets by collecting all the sets having in common a property P to form a new set R := {x|P (x)}. Define R := {x|x x}. Then : R R R R. Non-constructive proof methods Indirect existence proofs (Hilbert’s Basis Theorem) Zermelo’s proof that R (the reals) can be well-ordered (1904) 1

Transcript of Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen...

Page 1: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Logic II, Math 3102

Michael Rathjen

partly typed by Sara Eklund

Semester II 2006/2007

Part 1. Incompleteness Theorems

The main theorems of this part of the course are associated with the names of Godel, Church,and Tarski.

§1 Hilbert’s Program

Foundational Crisis

The end of the nineteenth century and the first three decades of the twentieth was a periodof great philosophical ferment amongst some of the most distinguished mathematicians ofthe day. Mathematics was afflicted with problems ranging from paradoxes to antinomies.Moreover, new methods of proof introduced into mathematics precipitated an atmosphereof uncertainty regarding the foundations of mathematics.

Inconsistencies in Cantor’s and Frege’s set theories: Russell’s Paradox (1901) Unrestrictedcomprehension principle allows one to build sets by collecting all the sets having in commona property P to form a new set

R := {x|P (x)}.

Define R := {x|x 6∈ x}. Then : R ∈ R↔ R 6∈ R.

Non-constructive proof methods

• Indirect existence proofs (Hilbert’s Basis Theorem)

• Zermelo’s proof that R (the reals) can be well-ordered (1904)

1

Page 2: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

• Abstract notion of function (In Euler’s time functions were explicitly defined via ananalytic expression)

• Brouwer (1908) rejects the law of excluded middle (A ∨ ¬A for arbitrary statementsA )

• Weyl(1918) criticizes impredicative set formation principles as, e.g., Every boundednon-empty set of reals has a least upper bound.

Hilbert’s Program (1922,1925)

• (i) Codify the whole of mathematical reasoning in a formal theory T .

• (ii) Prove the consistency of T by finitistic means.

The exact meaning of finitistic means was not delineated by Hilbert. Finitistic meansform the basis of any scientific reasoning. They do not refer to the actual infinite and donot include any of the objectionable proof methods mentioned above.

Of course mathematics should be consistent, but why is (ii) sufficient for justifying non-constructive mathematics? Here I have to say a few words about Hilbert’s ontology:

Real objects: Natural numbers, finite strings of symbols(something a computer can deal with?)

Ideal objects: The other objects in mathematics.

Method of ideal elements

Solve a mathematical problem concerning a specific structure (realm of objects) by adjoiningnew ideal objects to the structure.

example

Elementary Geometry → {points and lines at infinity}→ Projective GeometryElementary Number Theory → { Number ideals }→ Algebraic Number TheoryAnalysis → { Choice functions }→ Set Theory

Hilbert

Hilbert considered the method of ideal elements as vital for progress in mathematics. Dif-ferent reading of Hilbert’s program: Elimination of ideal elements.

2

Page 3: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Mathematical propositions

��

��

AAAA

Real propositions Ideal propositions

Real propositions are of one of the following forms:

∀x1 · · · ∀xr f(x1, .., xr) = g(x1, .., xr);∀x1 · · · ∀xr f(x1, .., xr) 6= g(x1, .., xr);∀x1 · · · ∀xr f(x1, .., xr) ≤ g(x1, .., xr)

for reasonably simple number-theoretic functions, where the quantifiers range over the nat-ural numbers.

Examples

• Goldbach’s conjecture (Every even number n > 2 can be expressed as the sum of twoprimes.)

• Fermat’s conjecture (Wiles’ theorem ) :“For all a, b, c, n ∈ N such that a · b · c 6= 0 and n > 2 we have an + bn 6= cn ”

• Riemann’s conjecture

• the four colour theorem

Hilbert’s Conservation Program

(Consequence of Hilbert’s program)If a real statement ϕ is provable in non-constructive mathematics, then ϕ is provable by

finitistic means.

Theorem

Let ϕ be a real statement. FR := Finitistic reasoning.

T ` ϕ =⇒ FR+ ConT ` ϕ.

3

Page 4: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

The most important structure in mathematics is

N =(N; 0N, SN,+N, ·N, <N

),

where 0N denotes zero, SN,+N, ·N denote the successor, addition and multiplication func-tion, respectively, and <N stands for the less-than relation on the natural numbers.

Many of the famous theorems and problems of mathematics (including the above exam-ples) can be formalized as a sentence ϕ of the language of N and thus are equivalent to thequestion whether N |= ϕ.

1.1 Definition

A theory that aims at axiomatizing the structure N is Peano arithmetic, PA.

Language of PA :=

Predicate symbols : =, <Function symbols : +, ·, S (Successor)Constant symbols : 0

Axioms of PA

(N1) ∀x(Sx 6= 0)

(N2) ∀xy[Sx = Sy → x = y]

(N3) ∀x[x+ 0 = x]

(N4) ∀xy[x+ Sy = S(x+ y)]

(N5) ∀x[x · 0 = 0]

(N6) ∀xy[x · Sy = (x · y) + x]

(N7) ∀x¬(x < 0)

(N8) ∀xy[x < Sy ↔ x < y ∨ x = y]

(N9) ∀xy[x < y ∨ x = y ∨ y < x]

(IND) ϕ(0) ∧ ∀x[ϕ(x)→ ϕ(Sx)]→ ∀xϕ(x)for all formulas ϕ.

IND is called the induction schema.

4

Page 5: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

First Incompleteness Theorem

Let T be a formal theory (with a decidable set of axioms) containing enough of PA. Thenthere is a true sentence ϕ (real) such that:

• (i) If T is consistent, then T 6` ϕ.

• (ii) If T satisfies an extra condition called ω-consistency, then T 6` ¬ϕ.

Second Incompleteness Theorem

Let T be a consistent formal theory containing arithmetic. Then

T 6` ConT

where ConT is the sentence asserting the consistency of T .

The First Incompleteness Theorem shows that part (i) of Hilbert’s program can only bepartially realized. But this may be not so important. Maybe the mathematical statementswe are really interested in do not fall under the First Incompleteness Theorem. However,the statement ϕ is real. But the second Theorem clearly destroys the Consistency Pro-gram. Finitistic reasoning should be formalizable in PA. But if PA cannot prove it’s ownconsistency, then the consistency of PA is not provable by finitistic means.

However, a Modified Hilbert Program has been very successful. Replace “FinitisticReasoning” by “Constructive Reasoning”

Ordinary classical mathematics is consistent from a constructive point of view.

5

Page 6: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§2 Recursive Functions

We will start with an informal notion of computability. A function F : Nk → N is said to becomputable if there is a method by which given any n1, .., nk ∈ N, we can obtain F (n1, .., nk)in finitely many steps. A method must be mechanical.

Excluded are : Tossing a coin, magic, fortune teller insights.In the following we introduce a collection of functions which are clearly computable.

Conventions

Number means natural number and set means set of natural numbers; by function we meana function F of the form

F : Nk → N

Variables a, b, c, . . . , x, y, z, . . . range over N. Tuples of numbers we abbreviate by ~a, ~x, etc.

2.1 Definition

K<(x, y) ={

0 if x < y1 otherwise.

If 1 ≤ j ≤ n, we define the function Inj by

Inj (a1, .., an) = aj .

If P (x0) is a sentence which is true for some x0, then

µxP (x)

denotes the smallest x for which P (x) is true.

2.2 Definition

A function on natural numbers is recursive if it can be generated after finitely many stepsby means of the following rules:

(R1) The functions Inj , +, ·, and K< are recursive.

(R2) If G,H1, ..,Hk are recursive and F is defined by

F (~x) = G(H1(~x), ..,Hk(~x))

then F is recursive.

6

Page 7: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(R3) If G is recursive and ∀~y ∃x(G(~y, x) = 0) and F is defined by

F (~y) = µx(G(~y, x) = 0),

then F is recursive.

2.3 Corollary

Every recursive function is computable.

Proof

By induction on the generation of recursive functions.

1 Ini ,+, · and K< are clearly computable (elementary school arithmetic).

2 Let F (~x) = G(H1(~x), ..,Hk(~x)) and suppose G,H1, ..,Hk are computable. Then wefirst compute the values b1, .., bk of H1(~x), ..,Hk(~x) and then compute G(b1, .., bk).

3 Let F (~y) = µx(G(~y, x) = 0). Suppose G is computable and ∀~y ∃x(G(~y, x) = 0). Thenwe compute F (~y) by computing successively G(~y, 0), G(~y, 1), .. until we obtain a zerovalue.

2

2.4 Definition

A predicate P of numbers is recursive if it’s representing function

KP (~y) ={

0 if P (~y)1 if ¬P (~y)

is recursive

2.5 Lemma

(i) If Q,H1, ..,Hk are recursive and P is defined by

P (~x) :⇔ Q(H1(~x), ..,Hk(~x)),

then P is recursive.

(ii) F is defined explicitly from F1, .., Fr if F (~x) = t(~x) where t is a term that containsonly (symbols for) F1, .., Fr.

If F is explicitly defined from recursive functions F1, .., Fr , then F is recursive.

7

Page 8: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Proof

• (i) We haveKP (~x) = KQ(H1(~x), ..,Hk(~x)).

• (ii) Suppose F (a, b, c) = G(H(b, c),K(G(b, c, c), a), c) where G,H,K are recursivefunctions. We want to show that F is recursive too. Define

F1(a, b, c) = I31 (a, b, c) = a

F2(a, b, c) = I32 (a, b, c) = b

F3(a, b, c) = I33 (a, b, c) = c

F4(a, b, c) = H(b, c)

F5(a, b, c) = G(b, c, c)

F6(a, b, c) = K(G(b, c, c), a)

F1, F2, F3 are recurse by (R1)

– F4 is recursive as F4(a, b, c) = H(F2(a, b, c), F3(a, b, c)).

– F5 is recursive as F5(a, b, c) = G(F2(a, b, c), F3(a, b, c), F3(a, b, c)).

– F6 is recursive as F6(a, b, c) = K(F5(a, b, c), F1(a, b, c)).

NowF (a, b, c) = G(F4(a, b, c), F6(a, b, c), F3(a, b, c)),

showing that F is recursive.

2

2.6 Lemma

If P is recursive and ∀~y ∃xP (~y, x), and F is defined by

F (~y) = µxP (~y, x),

then F is recursive.

Proof

F (~y) = µx(KP (~y, x) = 0)

2

8

Page 9: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

2.7 Example

Suppose Q,R, F are recursive and ∀y ∃xR(x, y). If P is defined by

P (a, b) :⇔ Q(b, µxR(x, F (b, a)))

then P is recursive

Proof

DefineF1(a, b, x) = F (b, a) = F (I3

2 (a, b, x), I31 (a, b, x)),

P1(a, b, x) ↔ R(x, F (b, a)) ↔ R(I33 (a, b, x), F1(a, b, x)),

F2(a, b) = µxP1(a, b, x) = µxR(x, F (b, a)).Then P (a, b) ↔ Q(I2

2 (a, b), F2(a, b)). 2

2.7 Lemma

Every constant function Fk(~x) = k is recursive.

Proof

By induction on k. Let ~x = x1, .., xn.For k = 0 we have F0(~x) = µy(In+1

n+1 (~x, y) = 0). For k = m + 1, we have Fk(~x) =µy(Fm(~x) < y) by induction hypothesis. 2

2.8 Lemma

Suppose P,Q are recursive. Then

¬P, P ∨Q,P ∧Q,P → Q,P ↔ Q

are recursive as well.

Proof

This can be seen as follows:

K¬P (~x) = K<(0,KP (~x))KP∨Q(~x) = KP (~x) ·KQ(~x)

KP∧Q = K¬(¬P∨¬Q)

KP→Q = K¬P∨Q

KP↔Q = K(P→Q)∧(Q→P ).

9

Page 10: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

2

2.9 Lemma

The predicates <,≤, >,≥,= are recursive.

Proof

K< is recursive by (R1) and we have

a ≤ b ↔ ¬(b < a)a > b ↔ (b < a)a ≥ b ↔ (b ≤ a)a = b ↔ (a ≤ b) ∧ (a ≤ b).

2

2.10 Definition and Lemma

(bounded µ-operator, bounded quantifiers)

For P ⊆ Nn+1 define

µx < aP (~y, x) :={

the least x < a such that P (~y, x) if ∃x[x < a ∧ P (~y, x)]a otherwise

We also define∃x < aP (~y, x) := ∃x[x < a ∧ P (~y, x)],

∀x < aP (~y, x) := ∀x[x < a→ P (~y, x)].

Let P ⊆ Nn+1 be recursive. Letting

F (~y, a) := µx < aP (~y, x),

R(~y, a) := ∃x < aP (~y, x),

Q(~y, a) := ∀x < aP (~y, x),

it holds that F,R,Q are recursive.

10

Page 11: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Proof

This follows from the following equivalences:

F (~y, a) = µx[(x < a ∧ P (~y, x)) ∨ x = a],R(~y, a) ↔ F (~y, a) < a,

Q(~y, a) ↔ ¬∃x < a¬P (~y, x).

2

2.11 Lemma

Define

n−m :={n−m if m ≤ n

0 if m > n

− is recursive.

Proof

a−b = µx[b+ x = a ∨ b > a].

2

2.12 Lemma (Case Distinction)

Let G1, .., Gk be recursive functions and Q1, .., Qk be recursive predicates. Further let R1, .., Rk

be recursive predicates such that, for each ~x, exactly one of R1(~x), .., Rk(~x) holds. Let

F (~x) :=

G1(~x) if R1(~x)

· ·· ·· ·

Gk(~x) if Rk(~x)

P (~x) iff

Q1(~x) if R1(~x)

· ·· ·· ·

Qk(~x) if Rk(~x)

then F and P are recursive.

11

Page 12: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Proof

F (~x) = G1(~x) ·K¬R1(~x) + . . .+Gk(~x) ·K¬Rk(~x).

KP (~x) :=

KQ1(~x) if R1(~x)

· ·· ·

KQk(~x) if Rk(~x)

2

Example

F (a, b) :=

a if a < b

b+ 2 b ≤ a ∧ a = 172 otherwise.

12

Page 13: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§3 Coding in the natural numbers and primitive recursion

Every finite piece of information can be encoded in a natural number. First we want toencode pairs of numbers.

3.1 Lemma

Let

π(x, y) = (x+ y)2 + x+ 1.

Examples: π(0, 0) = 1, π(0, 1) = 2, π(1, 0) = 3, π(1, 1) = 6.Note that by definition of π, x, y < π(x, y).

Claim: π : N2 → N is injective.

Proof.

If x+ y < a+ b, then

π(x, y) ≤ (x+ y + 1)2 < (a+ b)2 + a+ 1 = π(a, b).

Thus, assuming that π(x, y) = π(a, b), we must have x+ y = a+ b. Whence, as (x+ y)2 +x+ 1 = (a+ b)2 + a+ 1, this yields x = a and consequently y = b. 2

Obviously π is recursive. We want to define recursive functions π0, π1 (the inverses of π)such that π0(π(a, b)) = a and π1(π(a, b)) = b:

π0(s) = µx < s [∃y < sπ(x, y) = s] ,π1(s) = µy < s [∃x < sπ(x, y) = s] .

To encode finite sequences of numbers, we use the Fundamental Theorem of Arithmetic,whereby every natural number ≥ 2 has a unique representation:

a = pn0i0· . . . · pnk

ik,

where pi0 , . . . , pik are distinct primes and all ni > 0.

13

Page 14: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

3.2 Definition

a | b :⇔ ∃x ≤ b (a · x = b) (a divides b).a - b ⇔ ¬ a | b.

x is prime :⇔ x 6= 0 ∧ x 6= 1 ∧∀z ≤ x [z | x→ z = 1 ∨ z = x].

pn := n-th prime : p0 := 2pn+1 = µx ≤ pn! + 1 [pn < x ∧ x is prime]

a ∈ Seq :⇔ a = 1 ∨ (a > 1 ∧ ∀x ≤ a [px+1 | a→ px | a])

lh(a) :={

0 if a /∈ Seq ∨ a = 1µx ≤ a [px | a ∧ px+1 - a] if a ∈ Seq ∧ a 6= 1

(a)x := µy ≤ a[py+1

x | a ∧ py+2x - a

]

a ∗ b :=

a ·

∏x≤lh(b)

p(b)x+1lh(a)+x+1

if a 6= 1 ∧ b 6= 1

a if a 6= 1 ∧ b = 1b if a = 1.

I should perhaps comment on these coding gadgets. Seq denotes the set of sequence numbers,i.e. those numbers with no gap in their list of prime divisors. For such numbers we have

a =∏

i≤lh(a)

p(a)i+1i

.

If a, b are sequence numbers encoding (a0, . . . , ak), (b0, . . . , bn), respectively, then a ∗ b is asequence number encoding the concatenation (a0, . . . , ak, b0, . . . , bn).

We write〈a0, . . . , ak〉

for pa0+10 · . . . · pan+1

n . In particular, 〈a〉 = 2a+1 and 〈〉 = 1.

We want to show that all the functions and predicates of Definition 3.2 are recursive. Tothis end, we shall require some notions and results from number theory.

Numbers d0, . . . , dn are said to be relatively prime in pairs if no prime divides bothdi and dj for i 6= j.

For numbers a, b let

Rem(a, b) := µx < b [∃q ≤ a a = b · q + x].

Note that if b 6= 0, then Rem(a, b) is the remainder of a divided by b.

14

Page 15: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

3.3 The Chinese Remainder Theorem

Let d0, . . . , dn be relatively prime in pairs; let a0, . . . , an be numbers with ai < di. Thenwe can find a number c such that for all i ≤ n,

ai = Rem(c, di).

Proof

Let e =∏i≤n

di = d0 · . . . · dn, and for any number b let

F (b) := (Rem(b, d0), . . . ,Rem(b, dn));

in particular F : N→ Nn+1. We claim that

(∗) 0 ≤ b1, b2 < e ∧ F (b1) = F (b2)⇒ b1 = b2.

So assume 0 ≤ b1, b2 < e and F (b1) = F (b2). Then Rem(b1, di) = Rem(b2, di) for all i ≤ n.Hence, each di divides |b1 − b2|. Since the di’s are relatively prime in pairs, e must divide|b1 − b2|. But |b1 − b2| < e, which implies |b1 − b2| = 0, whence b1 = b2.

(∗) implies that the tuples F (0), . . . , F (e− 1) are distinct. As there are exactly e manytuples of the form (x0, . . . , xn) with xi < di, there must be a number c < e such thatF (c) = (a0, . . . , an). 2

3.4 Lemma

For any s ≥ 0, the s+ 1 numbers 1 + 1 · s!, 1 + 2 · s!, . . . , 1 + (s+ 1) · s! are relatively primein pairs.

Proof

All the numbers have the property that any prime factor q cannot divide s!, whence q > s.If the prime q divides both 1+j ·s! and 1+k ·s!, then it divides their difference s! · |j−k|.

Since q does not divide s!, it must divide |j − k|. But |j − k| ≤ s < q. This is possible onlyif j = k. 2

3.5 Lemma (Godel)

There is a binary recursive function β such that for any numbers n, a0, a1, .., an there is anumber a such that

β(a, i) = ai

15

Page 16: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

for all i ≤ n.Moreover, for all x and i,

β(x, i) ≤ x−1.

Proof

Assume we are given a0, . . . , an. Let s be the largest of {n, a0, . . . , an} and let d := s!.Then by Lemma 3.4, the numbers di := 1 + (i+ 1) · d are relatively prime in pairs for i ≤ n.So by the Chinese Remainder Theorem there is a c <

∏i≤n

di such that Rem(c, di) = ai for

i ≤ n.Now define

β(x, i) := Rem (π0(x), 1 + (i+ 1) · π1(x)) .

If we let a := π(c, d), we have π0(a) = c, π1(a) = d, and thus β(a, i) = Rem(c, di) = ai. 2

With the aid of the β-function we can code tuples of natural numbers. This will enableus to show that the collection of recursive functions is closed under defining functions byprimitive recursion.

3.6 Definition

Let β be the function defined in 3.5. For each n-tuple a1, . . . , an define its sequencenumber with respect to β:

[a1, .., an] := µa (β(a, 0) = n ∧ β(a, 1) = a1 ∧ . . . ∧ β(a, n) = an)

We allow n = 0, i.e the empty tuple. Then [ ] = µa(β(a, 0) = 0). Since β(x, i) ≤ x−1 by3.5, we have [ ] = 0.

Note that [a1, . . . , an] is always defined by 3.5. (a1, . . . , an) 7→ [a1, . . . , an] is a recursivefunction for fixed n. From [a1, . . . , an] we can retrieve n, a1, .., an via recursive functions.Define

lhβ(a) = β(a, 0),

[a]i = β(a, i+ 1).

Then lhβ([b0, .., bn−1]) = n and [[b0, .., bn−1]]i = bi for all i < n (or, equivalently, lhβ([b1, .., bn]) =n and [[b1, .., bn]]j = bj+1 for all j ≤ n).

Note thata 6= [ ] ⇒ lhβ(a) < a ∧ [a]i < a.

16

Page 17: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

The set Seqβ

of sequence numbers with respect to β, i.e numbers of the form [a1, .., an],is recursive since

a ∈ Seqβ⇔ ∀x < a(lhβ(x) 6= lhβ(a) ∨ ∃i < lhβ(a)[[x]i 6= [a]i]).

DefineIn([a1, . . . , an], i) = [a1, . . . , ai]

for i ≤ n. Then we have

In(a, i) = µx(lhβ(x) = i ∧ ∀j < i [x]j = [a]j

).

Define ~ so that

[a1, . . . , an] ~ [b1, . . . , bm] = [a1, . . . , an, b1, . . . , bm]

by letting

a ~ b = µx(lhβ(x) = lhβ(a) + lhβ(b) ∧

∀i < lhβ(a) [x]i = [a]i ∧∀i < lhβ(b) [x]lhβ(a)+i = [b]i

).

3.7 Definition (Contraction)

Let F, P be n+ 1-ary. We intend to make them 1-ary, so that

[F ]([a0, .., an]) = F (a0, .., an),

[P ]([a0, .., an]) ⇔ P (a0, .., an).

This can be achieved by defining

[F ](a) := F ([a]0, . . . , [a]n),[P ](a) :⇔ P ([a]0, . . . , [a]n).

Obviously we have that F is recursive iff [F ] is recursive and P is recursive iff [P ] is recursive.

3.8 Definition (Course-of-values)

Let F be n+ 1-ary. Define F by

F (~y, x) := [F (~y, 0), .., F (~y, x− 1)] if x > 0,

F (~y, 0) := [ ] = 0.

The explicit definition of F in terms of F is as follows:

F (~y, x) = µz [ lhβ(z) = x ∧ ∀i < x [z]i = F (~y, i) ] .

17

Page 18: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

3.9 Lemma

F is recursive iff F is recursive

Proof

If F is recursive, then, by the explicit definition of F , F is recursive. Conversely, if F isrecursive, then so is F as

F (~y, x) =[F (~y, x+ 1)

]x.

3.10 Lemma (Course-of-values recursion)

Let G be recursive and F be defined via

F (~y, x) = G(F (~y, x), ~y, x).

Then F is recursive.

Proof

Let

H(~y, x) = µz[z ∈ Seq

β∧ lhβ(z) = x ∧ ∀i < x ( [z]i = G(In(z, i), ~y, i) )

].

Then H = F . Thus F (~y, x) = G(H(~y, x), ~y, x). 2

3.11 Lemma (Primitive recursion)

We say that F is defined from G and H by primitive recursion if

F (~y, 0) = G(~y),

F (~y, x+ 1) = H(F (~y, x), ~y, x).

If G and H are recursive, then F is recursive.

Proof

We have

F (~y, z) :={

G(~y) if z = 0H([F (~y, z)]z−1, ~y, z−1) if z > 0

since [F (~y, x+ 1)]x = F (~y, x). Thus F is recursive by 3.10. 2

From Lemma 3.11 it follows that all the the functions and predicates introduced in Definition3.2 are recursive.

18

Page 19: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

3.12 Definition (Primitive recursive functions)

A function is primitive recursive if it can be generated by the following rules.

(P1) The functions Ini , F0, Suc are primitive recursive, where F0(x) = 0 and Suc(x) = x+1.

(P2) If G,H1, ..,Hk are primitive recursive and F (~x) = G(H1(~x), ..,Hk(~x)), then F is prim-itive recursive.

(P3) If G and H are primitive recursive and

F (~y, 0) = G(~y)

F (~y, x+ 1) = H(F (~y, x), ~y, x),

then F is primitive recursive.

A relation R ⊆ Nk is primitive recursive if KR is primitive recursive.

3.13 Corollary

Every primitive recursive function is recursive.

Proof

Previous results, in particular 3.11. 2

Remark In actual fact, the set of primitive recursive functions is only a small subset of theset of recursive functions.

An example of a recursive function that is not primitive recursive is furnished by theAckermann function A : N× N→ N. It is defined by the following recursion equations:

A(0, y) = y + 1A(x+ 1, 0) = A(x, 1)

A(x+ 1, y + 1) = A(x,A(x+ 1, y)).

3.14 Definition

(predecessor) pd(0) = 0, pd(x+ 1) = x.

(sign) sg(0) = 0, sg(x+ 1) = 1.(complement sign) sg(0) = 1, sg(x+ 1) = 0.

19

Page 20: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

3.15 Lemma

(i) +, ·, −, pd, sg, sg are primitive recursive.

(ii) The primitive recursive functions are closed under case distinction (cf. 2.12).

(iii) = is primitive recursive.

(iv) If P,Q are primitive recursive, so are K¬P ,KP∨Q,KP∧Q.

(v) If G is primitive recursive, then F1, F2 are primitive recursive, where

F1(~y, x) =∑u<x

G(~y, u),

F2(~y, x) =∏u<x

G(~y, u).

The convention here is that∑

u<0G(~y, u) := 0 and∏

u<0G(~y, u) := 1.

(vi) The primitive recursive functions are closed under the bounded µ-operator (cf. 2.10).

(vii) The primitive recursive predicates are closed under bounded quantification (cf. 2.10).

Proof

(i) Set G(y) = y = I11 (y) and H(z, y, x) = z+1 = I3

1 (z, y, x)+1. Then G,H are primitiverecursive. Since y+0 = G(y) and y+(x+1) = H(y+x, y, x), + is primitive recursiveby (P3).

Note that y · 0 = 0 and y · (x+ 1) = y · x+ y. So · can be defined from + by primitiverecursion. pd, sg, sg are clearly (by definition) primitive recursive.

As y−0 = y and y−(x+ 1) = pd(y−x), − is primitive recursive.

(ii) Suppose

F (~y) :={G1(~y) if R(~y)G2(~y) if ¬R(~y).

Then F (~y) = G1(~y) · sg(KR((~y)) + G2(~y)sg(KR((~y)), so F is primitive recursive ifG1, G2, R are.

(iii) K=(x, y) = sg(|x− y|) = sg((x−y) + (y−x)).

20

Page 21: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(iv) K¬P = sg(KP (~y)).

KP∨Q(~y) = KP (~y) ·KP (~y).

(v) Exercise.

(vii) Suppose R(~y, x) ⇔ ∃u < xP (~y, u). Then KR(~y, x) =∏

u<xKP (~y, u).

Also a < b ⇔ ∃u < b(a+ u+ 1 = b).

If S(~y, x)⇔ ∀u < xP (~y, u), then KS(~y, x) = sg(∑

u<xKP (~y, u)).

(vi) Let F (~y, x) = µu < x.P (~y, u). Define

H(~y, u) :={

0 if ∃z ≤ uP (~y, z)1 if ∀z ≤ u¬P (~y, z).

Then F (~y, x) =∑

u<xH(~y, u).

3.16 Lemma

Each of the functions n 7→ pn, lh, a, i 7→ (a)i, (a0, . . . , ak) 7→ 〈a0, . . . , ak〉 (for fixed k), and∗ as well the predicate Seq of Definition 3.2 is primitive recursive.

The following functions and predicates are are also primitive recursive (cf. 3.6):β, lhβ, Seqβ, In,~, g, fn, where g(x, i) = [x]i and fn(x1, .., xn) = [x1, .., xn].

Proof

Exercise.

3.17 Lemma

The primitive recursive functions are closed under course-of-values recursion (cf. 3.10).

Proof

Suppose F (~y, x) = G(F (~y, x), ~y, x) with G recursive. Define

∼F (~y, 0) = [ ],

∼F (~y, x+ 1) =

∼F (~y, x) ~ [G(

∼F (~y, x), ~y, x)].

Then∼F is primitive recursive and

∼F= F . Moreover, F (~y, x) = [F (~y, x+ 1)]x.

21

Page 22: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Homework 1

1. Verify that each of the functions n 7→ pn, lh, a, i 7→ (a)i, (a0, . . . , ak) 7→ 〈a0, . . . , ak〉(for fixed k), and ∗ as well the predicate Seq of Definition 3.2 is primitive recursive.

2. Show that the functions and predicates Seqβ, In,~ of 3.6 are correctly defined; i.e,

they have the asserted properties.

Show that

[a1, .., an] = [b1, .., bm] ⇒ n = m ∧ a1 = b1 ∧ . . . ∧ an = bm.

2. Prove 3.15 (i),(v) in detail.

3. Prove 3.16.

Church’s Thesis

A predicate P ⊆ Nr is said to be decidable if its representing functions is computable, orput differently if there is a method by which we can determine, given n1, .., nr ∈ N whetherP (n1, .., nr) or ¬P (n1, .., nr) holds. In the following we want to show that certain predicatesare undecidable. The problem is here that we have no mathematical definition of what itmeans to be computable. One way to discuss decision problems in mathematical preciseterms is to identify the notions of computable function and recursive function. This is knownas:

3.18 Church’s Thesis

Every computable function or predicate is recursive.

Evidence for Church’s Thesis

There have been many suggestions for making the notion of computable function mathe-matically precise:

- Turing computable functions

- Register machine computable functions

- Recursive functions

- λ-defined functions

22

Page 23: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

They have been shown to define the same class of function. Moreover, nobody has beenable to provide an example of an intuitively computable function which didn’t turn out tobe recursive. In what follows we shall assume Church’s Thesis.

Some intuitive evidence for Church’s thesis will be provided in §5 where the notion ofRegister machine computable function is introduced.

23

Page 24: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§4 Representability

The important thing about PA is that it has the ability to “talk about itself” in the sensethat we can express provability in PA by a formula of PA. In point of fact, already theweaker theory ROB has this ability. To establish this fact, we shall show that the graphof any computable function can be defined by a formula of PA and, moreover, that thecomputations pertaining to this function can be emulated by derivations in ROB. In thisway every computable function is representable in ROB.

In the following we assume that the language of any formal theory T , L(T ), comprises thelanguage of PA. In that language any natural number n has a name n, the nth numeral,where 0 = 0 and n+ 1 = Sn. Thus n is a closed term of L(PA).

We will use Greek letters ϕ,ψ, θ, ϕ0, ϕ1, . . . for formulas. We write ϕ(u1, .., ur) to indicatethat the free variables of ϕ are among u1, .., ur.

For terms t1, .., tr, the formula ϕ(t1/u1, .., tr/ur) results from ϕ by simultaneously replac-ing all the free occurrences of ui by ti . More simply, we write ϕ(t1, .., tr) for ϕ(t1/u1, .., tr/ur).

We will always assume that none of the variables in the ti occur as bound variables inϕ .

A theory T is consistent if for no formula ψ, T ` ψ ∧ ¬ψ.Note that for a theory T that comprises ROB its consistency is equivalent to the non-

provability of 0 = 1 in T .

4.1 Definition

A relation P ⊆ Nr is represented by ϕ(u1, .., ur) in T if for every n1, .., nr ∈ N:

If P (n1, .., nr), then T ` ϕ(n1, .., nr).

If ¬P (n1, .., nr), then T ` ¬ϕ(n1, .., nr).

P is representable in T if P is represented by ϕ in T for some formula ϕ .A function F : Nr → N is represented by ψ(u1, .., ur, v) in T if for all n1, .., nr,m ∈ N,

F (n1, .., nr) = m ⇒ T ` ∀v [ψ(n1, .., nr, v)↔ v = m ] .

F is representable in T if F is represented in T by some formula ψ.

4.2 Corollary

If T is consistent, then P is represented by ψ in T iff the following hold for all n1, . . . , nr ∈ N :

(a) P (n1, .., nr) iff T ` ψ(n1, . . . , nr).

(b) ¬P (n1, . . . , nr) iff T ` ¬ψ(n1, . . . , nr).

24

Page 25: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Proof

From (a) and (b) it follows that P is representable in T by ϕ.Now assume that P is represented by ϕ in T . Then P (n1, . . . , nr) implies T ` ϕ(n1, . . . , nr).

Suppose T ` ϕ(n1, .., nr). If ¬P (n1, . . . , nr) then T ` ¬ϕ(n1, . . . , nr), contradicting T ’sconsistency. This shows (a). Similary one verifies (b).

4.3 Lemma

Suppose T ` 0 6= 1. Then P is representable in T iff KP is representable in T .

Proof

Suppose ϕ(u1, . . . , ur) represents P in T . Let ψ(~u, v) be the formula

(ϕ(~u) ∧ v = 0) ∨ (¬ϕ(~u) ∧ v = 1).

Suppose KP (n1, . . . , nr) = m. Then m = 0 or m = 1.If m = 0, then P (n1, . . . , nr) and henceT ` ϕ(n1, . . . , nr). Therefore T ` ψ(n1, . . . , nr, v)↔ v = 0, thus

T ` ∀v[ψ(n1, . . . , nr, v)↔ v = 0].

If m = 1, then ¬P (n1, . . . , nr), and hence T ` ¬ϕ(n1, . . . , nr). Consequently we haveT ` ∀v[ψ(n1, . . . , nr, v)↔ v = 1].

Now suppose KP is represented by ψ. Set

ϕ(u1, . . . , ur) := ψ(u1, . . . , ur, 0).

If P (n1, . . . , nr), then KP (n1, . . . , nr) = 0, hence

T ` ∀v[ψ(n1, . . . , nr, v)↔ v = 0],

which implies T ` ϕ(n1, . . . , nr) by substituting 0 for v.If ¬P (n1, . . . , nr) then KP (n1, . . . , nr) = 1, hence T ` ∀v[ψ(n1, . . . , nr, v) ↔ v = 1].

ThereforeT ` ϕ(n1, . . . , nr)↔ 0 = 1.

Since T ` ¬0 = 1, the latter yields T ` ¬ϕ(n1, . . . , nr).

4.4 Definition

Let ROB (Robinson’s Arithmetic) be the restriction of PA (cf. 3.1) which has the axioms(N1) - (N9) but not the induction schema IND.

25

Page 26: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

4.5 Theorem (Representability Theorem)

Every recursive function and predicate is representable in ROB.

The proof of Theorem 4.5 requires several Lemmas.

4.6 Lemma

ROB ` ϕ(0) ∧ . . . ∧ ϕ(n− 1) ∧ x < n → ϕ(x).

Proof

By induction on n.First assume n = 0. By (N7) we have ` ¬x < 0, from which ` x < 0→ ϕ(x) follows by

propositional logic.Now let n = m+ 1. By the induction hypothesis,

ROB ` ϕ(0) ∧ .. ∧ ϕ(m− 1) ∧ x < m → ϕ(x),

hence(∗) ROB ` ϕ(0) ∧ .. ∧ ϕ(m) ∧ (x < m ∨ x = m) → ϕ(x).

But by (N8) we have

(∗∗) ROB ` x < n↔ x < m ∨ x = m.

So (*) and (**) yield ROB ` ϕ(0) ∧ .. ∧ ϕ(n− 1) ∧ x < n → ϕ(x).

4.7 Lemma

If ROB ` ¬ψ(k) for every k < n and ROB ` ψ(n) then

ROB ` [ψ(x) ∧ ∀y(y < x→ ¬ψ(y))]↔ x = n.

Proof

Let “`” mean “ROB `”. By 4.6 we have

` ¬ψ(0) ∧ . . . ∧ ¬ψ(n− 1) ∧ y < n → ¬ψ(y).

Hence as ` ¬ψ(0) ∧ .. ∧ ¬ψ(n− 1), we get

(#) ` y < n → ¬ψ(y)

and thus ` ∀y(y < n → ¬ψ(y)), so

26

Page 27: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(1) ` ψ(n) ∧ ∀y(y < n→ ¬ψ(y)). Hence

(2) ` x = n→ [ψ(x) ∧ ∀y(y < x→ ¬ψ(y))]. Further we have` n < x → [∀y(y < x→ ¬ψ(y)) → ¬ψ(n)], thus

(3) ` ∀y(y < x→ ¬ψ(y))→ ¬n < x because of ` ψ(n). We also have` x < n→ ¬ψ(x) by (#), thus

(4) ` ψ(x)→ ¬x < n. (3) and (4) yield

(5) ` ψ(x) ∧ ∀y(y < x→ ¬ψ(y)) → ¬n < x ∧ ¬x < n. By (N9) we have

(6) ` n < x ∨ x < n ∨ x = n. Hence (5) and (6) yield

(7) ` ψ(x) ∧ ∀y(y < x→ ¬ψ(y)) → x = n.

From (2) and (7) we get the desired assertion.

4.8 Lemma

(i) n = m⇒ ROB ` n = m

(ii) n 6= m⇒ ROB ` n 6= m

(iii) ROB ` n+m = n+m.

(iv) ROB ` n ·m = n·m.

(v) n < m⇒ ROB ` n < m.

(vi) n ≥ m⇒ ROB ` ¬(n < m).

Proof

(i) If n = m, then n and m are the same terms.

(ii) Suppose n < m. We proceed by induction on n. If n = 0, then ` n 6= m follows from(N1).

Now let n = k + 1. (N2) implies

` n = m→ n− 1 = m− 1.

But ` n− 1 6= m− 1 holds by induction hypothesis. Hence ` n 6= m.

If m < n, then ` m 6= n by the previous proof, thus ` n 6= m.

27

Page 28: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(iii) We proceed by induction on m. ` n+ 0 = n+ 0 holds by (N3). Let m = k+ 1. Then,by the inductive assumption,

` n+ k = n+ k.

Thus ` S(n + k) = S(n+ k). Note that S(n+ k) ≡ n+m . By (N4) we also have` S(n+ k) = n+ Sk. Now Sk ≡ m. Hence ` n+m = n+m.

(iv) Similar to (iii) by induction on m (homework).

(v),(vi) We prove these simultaneously by induction on m. If m = 0, then not n < m, andROB ` ¬(n < m) follows from (N7). Now suppose m = k + 1 and (v) , (vi) are truefor k, i.e

n < k ⇒ ` n < k,

n ≥ k ⇒ ` ¬(n < k).

By (N8) we have(#) ` n < m↔ (n < k ∨ n = k).

Suppose n < m. If n < k, then ` n < k, and thus ` n < m by (#). If n = k, then` n = k by (i), and thus ` n < m by (#). So in any case ` n < m.

Now assume n ≥ m. Then ` ¬(n < k). Also ` n 6= k by (ii). Thus from (#) we get` ¬(n < m).

Proof of 4.5

Initial functions Set

ψIri(u1, ..., ur, v) := ui = v;ψ+(x, y, v) := x+ y = v;ψ·(x, y, v) := x · y = v.

We have

Iri (n1, .., nr) = m ⇒ ni = m ⇒ ` ∀v[ni = v ↔ v = m];

n+ k = m ⇒ ` n+ k = m ⇒ ` ∀v[n+ k = v ↔ v = m];n · k = m ⇒ ` n · k = m ⇒ ` ∀v[n · k = v ↔ v = m],

owing to 4.8 (iii) and 4.8 (iv).Note that by 4.8 (v), (vi), < is representable ; thus K< is representable by 4.3.

28

Page 29: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(R2): Suppose G,H1, ..,Hs are representable. Let ψG(x1, .., xs, y) represent G and letψi(u1, . . . , ur, vi) represent Hi. Set

s∧i=1

ψi(~u, vi) := ψ1(~u, v1) ∧ . . . ∧ ψs(~u, vs).

Put

ψF (u1, .., ur, v) := ∃v1 . . .∃vr[s∧

i=1

ψi(~u, vi) ∧ ψG(v1, .., vs, v)].

Let F be given by F (~n) = G(H1(~n), ..,Hs(~n)) and suppose F (~n) = m. Let H1(~n) =k1, . . . , Hs(~n) = ks. Then G(k1, .., ks) = m. By the inductive assumptions we have

(#) ` ψi(n1, .., nr, vi)↔ vi = ki

for 1 ≤ i ≤ s, and(##) ` ψG(k1, .., ks, v)↔ v = m.

Therefore we get

`s∧

i=1

ψi(n1, . . . , nr, vi) ∧ ψG(v1, .., vs, v) → v = m,

thus` ψF (n1, . . . , nr, v) → v = m.

From (#) and (##) we also get

` v = m → ψG(k1, .., ks, v) ∧s∧

i=1

ψi(n1, .., nr, ki),

hence` v = m → ψF (n1, .., nr, v).

As a result,` ∀v [ψF (n1, .., nr, v) ↔ v = m].

(R3): Suppose F (~n) = µx(G(~n, x) = 0) and ∀~n∃xG(~n, x) = 0, where G is recursive. LetψG(u1, .., ur, v, w) represent G using the inductive assumption. Set

ψF (u1, .., ur, v) := ψG(~u, v, 0) ∧ ∀y [y < v → ¬ψG(~u, y, 0)],

29

Page 30: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

where ~u := u1, . . . , ur.Suppose F (n1, .., nr) = m. Then we have G(n1, .., nr,m) = 0 and for all k < m,

G(n1, .., nr, k) 6= 0. Setmk := G(u1, .., ur, k)

for k < m. From` ψG(n1, .., nr, k, w) ↔ w = mk

we get` ¬ψG(n1, .., nr, k, 0)

for k < m. Furthermore,` ψG(n1, .., nr,m, 0).

So by 4.7 we get` ψF (n1, .., nr, v)↔ v = m.

30

Page 31: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§5 Church’s Thesis and Register Machines1

Recall that evidence for Church’s thesis comes from the fact that all notions of machinecomputability that have been suggested yield the same collection of computable function.This section introduces one such notion.

5.2 Register Machines

What is a register machine? A register is a storage area that can store any natural number.A register machine has a finite number of registers and contains methods of retrieving andstoring the contents of those registers. The methods of retrieving and storing are donethrough a series of instructions called a program. The instructions of the program providemeans to manipulate the contents of the registers as well as telling the machine whichinstruction to look at next.

This is a list of valid instructions for register machines withK registers labelled 1, . . . ,K:

• Ir (where 1 ≤ r ≤ K): This instruction increases the content of register r by 1. Thenext instruction to execute is the next instruction in the program after this currentinstruction.

• Dr (where 1 ≤ r ≤ K): If the current content of the register is greater than 0, thenthis instruction decreases the content of register r by 1 and the next instruction toexecute is the 2nd instruction in the program after this current instruction.

If the current content of the register is zero, then this instruction does not change thecontent of the register and the next instruction to execute is the next instruction inthe program after this current instruction.

• Tq (where q is any integer that could be positive, negative or zero): This instructiondoes not change the content of the register and the next instruction to execute is the|q|th instruction after the current instruction if q > 0; and the |q|th instruction beforethe current instruction if q < 0. If q = 0, then the next instruction to execute isthe same as the current instruction (which results in executing the current instructioninfinitely many times).

1This section is not part of Math 3102. Its purpose is to provide some background information.

31

Page 32: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

5.2.1 Example Programs

Clear register

the program puts the value of 0 in register r.

Dr

T2T − 2

Add register

The program adds the value of register r to s and places the result in register s while clearingregister r.

Dr

T3Is

T − 3

Add registers

The program adds the value of register r to s and t and places the result in registers s andt while clearing register r.

Dr

T4Is

It

T − 4

5.2.2 A “proper” Program

We say that a register machine M with program A calculates a partial function2 f : Nn → Nif the program A does the following:

• If f(a1, . . . , an) is defined, then the calculation eventually will terminate with the valueof f(a1, . . . , an) in register n+ 1. If the program contains p number of instructions, itmust terminate by trying to execute the p+ 1’th instruction.

2The notion of a partial function on Nr is given in Definition 11.1.

32

Page 33: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

• If f(a1, . . . , an) is undefined, then the program will never terminate.

5.2.3 Formulating a Program

Concatenating programs

We would like to say that if we have a program that does A, and have another program thatdoes B, we can construct a program that does A, and then B. To do this, we restrict theprograms we are concatenating to follow the rule that when it terminates, it must terminateby trying to execute the p+ 1th instruction, where p is the length of the program.

Then we can concatenate program A and B by placing instructions for program B rightafter the instructions for program A.

This way, after program A finished executing, it will begin the execution of programB. Also note that the constructed program A+B also follows this rule, so that this newlyconstructed program can also be used to construct another program.

Temporary registers

Sometimes, we may have a need to use a temporary storage space to store the intermediateresult in constructing a program form sub-programs. In doing so, we must make sure thatwe do not corrupt the content of other registers that may contain important data. We canalways find a temporary register by looking at the program at hand and find the largestregister d it will access. Then we can use any registers that are larger than d as temporaryregisters. Note that we will also need a machine with at least d+ t registers to run this newprogram. (t signifies the number of temporary registers we will need.)

Example: Copying registers

Say we want to copy the content of register r to s. we will need 1 temporary register, sayt. The copy register program can be constructed by concatenating these programs:

Clear register s.Clear register t.Add register r to s and t.Move register t to r.

Example: If s then B else A

We want a program to check register s, and if the content of register s is 0, then executeprogram A, otherwise execute program B. This can be done with the following instructions:

33

Page 34: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

DsT p+ 2Program AT q + 2Program B

5.3 Theorem

A function is register machine calculable if and only if it is recursive.

Proof

A sketch of proof will be given at the end of §12 (cf. Theorems 12.16 and 12.17).

34

Page 35: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§6 Primitive recursive encoding of syntax

For the encoding of the syntax of a theory T we make some additional inessential assump-tions. Their only use is to reduce the number of cases that need to be considered when wedefine various functions representing syntactic operations. They are:

(i) The only logical connectives and quantifiers are ¬,→,∀

(ii) T has infinitely many constants and

(iii) For each n, T contains infinitely many n-ary functions and relation symbols.

(iv) Formulas are considered to be in so-called Polish notation, where the leading symbolscomes first; e.g. φ → ψ is rendered → φψ. This has the advantage of simplifyingthe definitions of operations on codes that correspond to syntactic operations such assubstitutions. But it is of course not essential.

In detail, the language of T consists of:

• constants: c0, c1, c2, ...

• n-ary function symbols: fn0 , f

n1 , ...

• n-ary relation symbols: Rn0 , R

n1 , ...

• connectives: ¬,→

• quantifiers: ∀

• variables: v0, v1, v2, ...

The other connectives and quantifiers are considered to be abbreviations. Rememberalso that we assumed L(PA) ⊆ L(T ). We will assume that

0 ≡ c0, f10 ≡ S, f2

0 ≡ +, f30 ≡ ·, R2

0 ≡= and R21 ≡< .

We use the binary function π : N2 → N with

π(x, y) = (x+ y)(x+ y) + x+ 1

(see Definition 3.5) to assign a code #A to any symbol A of L(T ):

• #ci := π(0, i)

35

Page 36: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

• #fni := π(2, π(n, i))

• #¬ := π(4, 4)

• #∀ := π(6, 6)

• #vi := π(1, i)

• #Rni := π(3, π(n, i))

• #→:= π(5, 5)

Note that codes correspond to closed terms of L(PA).

6.1 Definition

We use the coding introduced in Definition 3.2.Firstly, we generate codes for terms and formulas as follows:

(i) pcq := < #c > if c is a constant or a variable.

(ii) if t1, . . . , tn are terms that have codes pt1q, . . . , ptnq, then

pfni t1, . . . , tnq := < #fn

i , pt1q, . . . , ptnq >;pRn

i t1, . . . , tnq := < #Rni , pt1q, . . . , ptnq > .

(iii) If ϕ,ψ have codes pϕq, pψq, respectively, then

p¬ϕq :=< #¬, pϕq >;

pϕ→ ψq :=< #→, pϕq, pψq > .

(iv) If ϕ has code pϕq and vi is a variable, then

p∀viϕq :=< #∀,#vi, pϕq >

(v) Set

Term(x) :={

0 : if x is the code of a term1 : otherwise

Form(x) :={

0 : if x is the code of a formula1 : otherwise

36

Page 37: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

6.2 Lemma

The representing functions for the codes of terms, Term, and for codes of formulas Form,are primitive recursive.

Proof

We have

Term(x) :=

0 if Seq(x) ∧ lh(x) = 1 ∧ ∃i < x (x)0 = #ci0 if Seq(x) ∧ lh(x) = 1 ∧ ∃i < x (x)0 = #vi

0 if Seq(x) ∧ ∃n < x ∃i < x [lh(x) = n+ 1∧ (x)0 = #fn

i ∧ ∀y < nTerm((x)y+1) = 0]1 otherwise

Form(x) :=

0 if Seq(x) ∧ ∃n < x∃i < x [lh(x) = n+ 1 ∧ (x)0 = #Rni

∧ ∀y < nTerm((x)y+1) = 0]0 if Seq(x) ∧ lh(x) = 2 ∧ (x)0 = #¬

∧ Form((x)1) = 00 if Seq(x) ∧ lh(x) = 3 ∧ (x)0 = #→

∧ Form((x)1) = 0 ∧ Form((x)2) = 00 if Seq(x) ∧ lh(x) = 3 ∧ (x)0 = #∀

∧ ∃i < x (x)1 = #vi ∧ Form((x)2) = 01 otherwise

6.3 Definition (Substitution functions)

First, we need a function sub such for any formula ϕ(vi) and term t, we have

sub(pϕ(vi)q, i, ptq) = pϕ(t)q.

Define this function as follows:

sub(pviq, i, y) = y,

sub(pvjq, i, y) = pvjq, if j 6= i,

sub(pcjq, i, y) = pcjq,

sub(pfnj t1...tnq, i, y) = < #fn

j , sub(pt1q, i, y), .., sub(ptnq, i, y) >,sub(pRn

j t1...tnq, i, y) = < #Rnj , sub(pt1q, i, y), ..., sub(ptnq, i, y) >,

sub(p¬ϕq, i, y) = < #¬, sub(pϕq, i, y) >,sub(pϕ→ ψq, i, y) = < #→, sub(pϕq, i, y), sub(pψq, i, y) >,sub(p∀viϕq, i, y) = p∀viϕq

sub(p∀vjϕq, i, y) = < #∀,#vj , sub(pϕq, i, y) > if j 6= i,

sub(x, i, y) = 0 if x is not of the above forms.

37

Page 38: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

The definition of sub falls under the scope of course-of-values recursion, and therefore subis primitive recursive.

Second, we’d like to define a substitution function subn such that

subn(pϕ(vi)q, n) = pϕ(n)q

if ϕ has only vi free.There is a primitive recursive function sub such that

sub(pϕq, y) :={sub(pϕq, i, y) if i = µj < pϕq [vj occurs free in ϕ]

pϕq if no such i exists.

Now letsubn(x, y) = sub(x, num(y)),

where

num(0) = p0q,

num(k + 1) = < #S, num(k) >

(note that 0 ≡ c0 and f10 ≡ S). num has the effect that

num(n) = p n q.

Then next step is define a predicate ProvT such that

ProvT (x, y)⇔ x is a code of a proof in T of a formula whose code is y.

Thereby a proof of ϕ in T is a sequence of formulas ϕ0, . . . , ϕn such that ϕ ≡ ϕn andeach element of the sequence is either an axiom of T , a logical axiom, or a consequence bysome logical rule of earlier members of the sequence.

But before we can define ProvT , we have to choose a complete set of axioms and rulesfor first order logic.

Homework

The definition of sub involved an additional function. Define a function Free(u,w) suchthat Free(pvjq, pϕq) = 0 iff vj occurs free in ϕ. Moreover, show that Free is primitiverecursive.

38

Page 39: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

6.4 Definition

A Hilbert-style complete set of axioms and rules is the following:

(A1) ϕ→ (ψ → ϕ)

(A2) (ϕ→ (ψ → θ))→ [(ϕ→ ψ)→ (ϕ→ θ)]

(A3) ¬¬ϕ→ ϕ

(A4) ∀vϕ→ ϕ(t/v) if t is substitutable for v in ϕ.

(A5) t = t

(A6) s1 = t1 → . . .→ sn = tn → fni s1..sn = fn

i t1..tn

(A7) s1 = t1 → . . .→ sn = tn → (Rni s1..sn ↔ Rn

i t1..tn)

(MP) ϕ→ ψ ϕψ

(∀R) ϕ→ ψϕ→ ∀vψ if v does not occur free in ϕ.

6.5 Lemma

Set

AxT (y) :⇔ y is the code of an axiom of T ;:⇔ y = pψq for some axiom ψ of T .

If AxT is recursive (primitive recursive), then ProvT (x, y) is recursive (primitive recursive).

Proof

First we define

imp(u,w) := < #→, u, w >;neg(u) := < #¬, u > .

39

Page 40: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Now we set

Ax1(y) :⇔ ∃u < y∃w < y [Form(u) = 0 ∧ Form(w) = 0 ∧ y = imp(u, imp(w, u))];Ax2(y) :⇔ ∃u < y∃w < y∃z < y

[Form(u) = 0 ∧ Form(w) = 0 ∧ Form(z) = 0

∧ y = imp(imp(u, imp(w, z)), imp(imp(u,w), imp(u, z)))];

Ax3(y) :⇔ ∃u < y [Form(u) = 0 ∧ y = imp(neg(neg(u)), u)];Ax4(y) :⇔ ∃u < y∃w < y∃z < y∃i < y[u = #vi ∧ Form(z) = 0 ∧

Term(w) = 0 ∧ subtl(z, i, w) = 0 ∧ y = imp(< #∀,#vi, z >, sub(z, i, w))],

where subtl(pϕq, i, ptq) = 0 iff t is substitutable for vi in ϕ. subtl is defined below.

Definition of subtl

subtl(pRnj t1, ..., tnq, i, ptq) = 0subtl(p¬ϕq, i, ptq) = subtl(pϕq, i, ptq)

subtl(pϕ→ ψq, i, ptq) = subtl(pϕq, i, ptq) + subtl(pψq, i, ptq)subtl(p∀vjϕq, i, ptq) = 0 if ¬Free(pvjq, ptq) ∧ subtl(pϕq, i, ptq) = 0

subtl(z, i, w) = 1 if z or w are not of the above forms.

Ax5(y) :⇔ ∃u < y [Term(u) = 0 ∧ y =< # =, u, u >]Ax6(y) :⇔ ∃i, n, u, w < y ∃a [Seq(u) ∧ Seq(w) ∧ Seq(a)

∧ lh(u) = lh(w) = n+ 1 ∧ lh(a) = n+ 1 ∧ (u)0 = (w)0 = #fni

∧ ∀k < n Term((u)k+1) = 0 ∧ Term((w)k+1) = 0 ∧ (a)0 =< # =, u, w >

∧ ∀k < n [(a)k+1 = imp(< # =, (u)n−k, (w)n−k >, (a)k)] ∧ (a)n = y].

40

Page 41: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

To ensure that Ax6 is primitive recursive, we have to find a primitive recursive bound for∃a as a function of y, for instance p(y) = < y, . . . , y >︸ ︷︷ ︸

y times

(homework).

Ax7(y) :⇔ .. this is similar to Ax6.MP (x, y, z) :⇔ x = imp(y, z)Forall(x, y) :⇔ ∃u,w, i < y [y = imp(u,< #∀,#vi, w >)

∧ x = imp(u,w) ∧ Free(pviq, u) 6= 0]ProvT (x, y) :⇔ Seq(x) ∧ ∃n < x [lh(x) = n+ 1 ∧

y = (x)n ∧ ∀k ≤ n[AxT ((x)k) ∨ Ax1((x)k) ∨ . . . ∨ Ax7((x)k)∨∃i, j < k MP ((x)i, (x)j , (x)k)∨∃i < k Forall((x)i, (x)k)] ∧ ∀k ≤ n Form((x)k) = 0].

6.6 Definition

LetPrT (y) :⇔ ∃xProvT (x, y).

Obviously we have for a formula ϕ,

PrT (pϕq) ⇔ T ` ϕ.

A predicate P on natural numbers is said to be recursively enumerable if there is arecursive predicate Q such that for all ~x,

P (~x) ⇔ ∃yQ(y, ~x).

In particular, if AxT is recursive, then PrT is recursively enumerable.

41

Page 42: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

§7 Church’s Theorem and Godel’s First Incompleteness The-orem

7.1 Definition

T is said to be decidable if PrT is recursive.

7.2 Diagonal Lemma (Cantor)

Let P be a binary predicate. For each number n define P(n) by

P(n)(m) :⇔ P (n,m).

Let Q be the unary predicate defined by

Q(x) :⇔ ¬P(x)(x).

Then Q is distinct from all the P(n).

Proof

For a contradiction, suppose Q = P(n). Then

P(n)(n) ⇔ Q(n) ⇔ ¬P(n)(n)

leads to a contradiction.

7.3 Church’s Theorem

If T is a consistent extension of ROB, then T is undecidable.

Proof

SetP (a, b) :⇔ PrT (subn(a, b))

and letQ(a) :⇔ ¬P (a, a).

For a contradiction, assume that PrT is recursive. Then Q is recursive, too. Since T is anextension of ROB and is also consistent, we can employ the Representability Theorem 4.5and Corollary 4.2 to obtain a formula ϕ such that for all n:

(∗) Q(n) ⇔ T ` ϕ(n).

42

Page 43: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Put n0 := pϕq. Then we get

Q(n0) ⇔ T ` ϕ(n0)⇔ PrT (pϕ(n0)q)⇔ PrT (subn(pϕq, n0))⇔ P (pϕq, n0)⇔ P (n0, n0)⇔ ¬Q(n0),

thereby yielding a contradiction. 2

7.4 Corollary

If T is a consistent extension of ROB, then PrT is not recursive.

7.5 Corollary

ROB and PA are undecidable.

7.6 Definition

T is said to be axiomatized if AxT is recursive. T is complete if T is consistent and for eachclosed formula θ of L(T ), T ` θ or T ` ¬θ.

7.7 Lemma

A predicate P is recursive iff P and ¬P are recursively enumerable.

Proof

If P is recursive then so is ¬P . Suppose P and ¬P are recursively enumerable. Then thereare recursive predicates Q and R such that for all ~x,

P (~x) ⇔ ∃yQ(~x, y);

¬P (~x) ⇔ ∃yR(~x, y).

Obviously, ∀~x∃y[Q(~x, y) ∨R(~x, y)]. Thus

F (~x) = µy[Q(~x, y) ∨R(~x, y)]

43

Page 44: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

defines a recursive function. As we have

P (~x) ⇔ Q(~x, F (~x)),

P is recursive. 2

7.8 Lemma

If T is axiomatized and complete, then T is decidable.

Proof

Define primitive recursive functions G and unicl via

G(x, 0) = x

G(x, n+ 1) = < #∀,#vn, G(x, n) >unicl(x) = G(x, x+ 1).

Let ϕ be a formula and set rϕ := pϕq. We then have

unicl(pϕq) = p∀v0 . . .∀vrϕ ϕq

and ∀v0 . . .∀vrϕ ϕ is a closed formula, for if vi occurs in ϕ, then pviq < pϕq. Thus i < #vi <pϕq. Moreover, we have

T ` ϕ ⇔ T ` ∀v0 . . .∀vrϕ ϕ

and thus, using the completeness of T ,

T 6` ϕ ⇔ T 6` ∀v0 . . .∀vrϕ ϕ

⇔ T ` ¬∀v0 . . .∀vrϕ ϕ.

As a result,

¬PrT (pϕq) ⇔ PrT(neg(unicl(pϕq))

).(1)

Since T is axiomatized, PrT is recursively enumerable. Furthermore, by (1),

¬PrT (x) ⇔ Form(x) 6= 0 ∨ PrT(neg(unicl(x))

).

Thus ¬PrT is also recursively enumerable. Hence, by 7.7, PrT is recursive. 2

44

Page 45: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

7.9 Godel’s First Incompleteness Theorem

If T is an axiomatized extension of ROB, then T is not complete.

Proof

This follows from 7.3 and 7.8. 2

The first incompleteness theorem has important implications concerning the axiomaticmethod. If we develop an axiom system for the natural numbers whose language includessymbols for number theoretic functions then we should be able to recognize an axiom ofthat system when we see one, and the axioms have to be true. Thus an axiom system forthe natural numbers gives rise to a formal theory T that is axiomatized and proves only truestatements about natural numbers. In particular, such a theory T is consistent. But then,by the incompleteness theorem, there is a true statement θ about the natural numbers suchthat T does not prove θ.

Hence, in general, given a statement θ about natural numbers it is not decidable whetherθ is true.

§8 Sharper versions of the First Incompleteness Theorem andthe Hilbert Bernays Derivability Conditions

The First Incompleteness Theorem as stated in the previous section is not very informative.It says that for every reasonable theory T (i.e. a consistent and axiomatized theory thatcomprises ROB) there exists a true arithmetic statement that is not derivable in T . In thissection we show that such a statement can be effectively produced from T .

Convention

To render formulas more readable, we shall often write ϕ(pθq) where the correct notationwould have been ϕ(pθq ).

8.1 Diagonalization Lemma

Let T be a theory that contains ROB. Let ϕ(v) be a formula of the language of T in whichat most the variable v occurs free. Then there is a sentence ψ such that

T ` ψ ↔ ϕ(pψq)

45

Page 46: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Proof

Let Subn(u0, u1, u2) be a formula that represents the function subn of Definition 6.3 inROB. Note that the proof of the Representability Theorem 4.5 shows us how to constructSubn(u0, u1, u2). Set

θ := ∀v [Subn(u, u, v) → ϕ(v)] .

Then u is the only variable that occurs free in θ. Put m = pθq and

ψ := θ(u/m) ≡ ∀v [Subn(m,m, v) → ϕ(v)] .

Thensubn(pθq,m) = pψq.

As subn is represented by Subn in ROB and ROB ⊆ T we arrive at

(∗) T ` ∀v [Subn(m,m, v)↔ v = pψq] .

Thus

T ` ψ ↔ ∀v [Subn(m,m, v) → ϕ(v)](∗)↔ ϕ(pψq).

2

8.2 Definition

If T is an axiomatized extension of ROB then the predicate ProvT is representable in ROB.Henceforth we shall denote the representing formula by ProvT . By PrT (u) we shall denotethe formula ∃wProvT (w, u).

We shall discern three properties of theories.

• T satisfies D1 if whenever T ` θ then T ` PrT (pθq).

• T satisfies the condition D1c if if the following holds:

T ` PrT (pϕq) ⇒ T ` ϕ.

• T is ω-consistent if the following holds:

If T ` ¬ψ(n) for all n ∈ N, then T 6` ∃vψ(v).

46

Page 47: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

8.3 Lemma

If T is an axiomatized extension of ROB then T satisfies D1.

Proof

If T is an axiomatized extension of ROB then the predicate ProvT is representable inROB by ProvT (w, u). Now, if T ` θ, then ProvT (m, pθq), where m codes a proof ofθ in T . Consequently, ROB ` ProvT (m, pθq) so that ROB ` ∃wProvT (w, pθq), i.e.ROB ` PrT (pθq). Since ROB ⊆ T we get T ` PrT (pθq). 2

8.4 Incompleteness Theorem ( Sharper form)

Suppose T is a consistent axiomatized extension of ROB and

T ` θ ↔ ¬PrT (pθq).

Then

(i) T 6` θ

(ii) If T satisfies D1c or is ω-consistent, then

T 6` ¬θ.

Proof

Note that by 8.1 there is a closed formula θ such that

(∗) T ` θ ↔ ¬PrT (pθq).

(i) If T ` θ, then, since T satisfies D1, T ` PrT (pθq).Hence T ` ¬θ by (∗). But then T would be inconsistent.

(ii) If T ` ¬θ, then T ` PrT (pθq) by (∗). Using D1c this implies T ` θ, and thus T wouldbe inconsistent.

Now assume that T is ω-consistent.If T ` ¬θ, then T 6` θ as T is consistent. Hence for all n, ¬ProvT (n, pθq). By theRepresentability Theorem, we get

T ` ¬ProvT (n, pθq)

47

Page 48: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

for all n, and hence, by ω-consistency,

T 6` ∃xProvT (x, pθq)

which is T 6` PrT (pθq). Therefore T 6` ¬θ holds owing to (∗).

2

8.5 Remark

Note that we can effectively produce the formula θ of 8.4. Moreover, 8.4 shows that θ istrue (in the standard model).

Its complexity is∏0

1, that is a real statements in Hilbert’s terminology.

Theorem 8.4 (ii) requires more than just the consistency of T in that T has to satisfy D1c orto be ω-consistent. There is however a variant of Godel’s Incompleteness due to J.B. Rosserwhich only requires T to be consistent.

8.6 Rosser’s Incompleteness Theorem

Let T be a consistent axiomatized extension of ROB. Then there exists a sentence θ suchthat neither θ nor ¬θ are provable in T .

Proof

By the Diagonalization Lemma, we choose θ such that

T ` θ ↔ ∀x[ProvT (x, pθq)→ ∃y

(y ≤ x ∧ ProvT (y, p¬θq)

)].(2)

Well, the Diagonalization Lemma does not directly furnish us with such a formula θ sincethe right hand side of the above equivalence contains both pθq and p¬θq. To remedy this,let Num(u, v) be a formula which represents the primitive recursive function neg (withneg(pψq) = p¬ψq) in ROB and let ϕ(u) be the formula

∀x[ProvT (x, pθq)→ ∃y

(y ≤ x ∧ ∃z(Neg(pθq, z) ∧ ProvT (y, z))

)].

By the Diagonalization Lemma there exists a sentence θ such that

ROB ` θ ↔ ϕ(pθq).

Since ROB ` Neg(pθq, z)↔ z = p¬θq, it follows that (2) holds.

48

Page 49: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

We want to show that T 6` θ and T 6` ¬θ.For a contradiction assume that T ` θ. Then there exists a natural number n such that

ProvT (n, pθq). Since ProvT represents ProvT in ROB and thence in T , we get

T ` ProvT (n, pθq).(3)

From (2) and the assumption T ` θ we get that

T ` ∀x[ProvT (x, pθq)→ ∃y

(y ≤ x ∧ ProvT (y, p¬θq)

)].(4)

(3) and (4) imply

T ` ∃y[y ≤ n ∧ ProvT (y, p¬θq)].(5)

On the other hand, since T ` θ and T is consistent we have ¬ProvT (k, p¬θq) for all naturalnumbers k, and therefore

T ` ¬ProvT (k, p¬θq)(6)

holds for all k. Since for any formula ψ(y) and any n ∈ N,

ROB ` [ψ(0) ∧ . . . ∧ ψ(n)] → ∀y[y ≤ n→ ψ(y)]

holds by Lemma 4.6, it follows from (6) that

T ` ∀y [y ≤ n→ ¬ProvT (y, p¬θq)].(7)

But (5) and (7) entail that T is inconsistent, contrary to our main assumption. As a result,T does not prove θ.

Next, aiming at a contradiction, assume that T ` ¬θ. Then ProvT (m, p¬θq) holds forsome m, so

T ` ProvT (m, p¬θq).(8)

Since T is consistent we also have T 6` θ, yielding ¬ProvT (k, pθq) and thus

T ` ¬ProvT (k, pθq)(9)

for all k. Lemma 4.6 implies that T ` x ≤ m → (x = 0 ∨ x = 1 ∨ . . . ∨ x = m), so that(9) yields

T ` ProvT (x, pθq)→ m < x.(10)

49

Page 50: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

(10) and (8) entail that

T ` ProvT (x, pθq)→ ∃y[y ≤ x ∧ ProvT (y, p¬θq)],

and hence

T ` ∀x[ProvT (x, pθq)→ ∃y[y ≤ x ∧ ProvT (y, p¬θq)]

].(11)

In view of (2), from (11) we infer that T ` θ, and thus T would be inconsistent. Conse-quently, T cannot prove ¬θ either.

8.7 Derivability Conditions

Several so-called derivability conditions were singled out by the German mathematiciansHilbert and Bernays. We have already considered D1 and D1c.

D1 T ` ϕ ⇒ T ` PrT (pϕq)

D2 T ` PrT (pϕq)→ PrT (pPrT (pϕq)q)

D3 T ` PrT (pϕq) ∧ PrT (pϕ→ ψq)→ PrT (pψq)

D1c T ` PrT (pϕq) ⇒ T ` ϕ

§9 The second incompleteness theorem

Next we shall prove Godel’s Second Incompleteness. The second incompleteness theoremdoes not come so cheaply. It holds for theories that satisfy D2 and D3. For D3, one mustshow

T ` ProvT (u, pϕq) ∧ ProvT (v, pϕ→ ψq)→ ProvT (u ∗ v ∗ pψq, pψq)

with free variables u, v. To do this requires more than representability of primitive recursiverelations: The representations must be correct with free variables.

The theory PA satisfies D2 and D3. Henceforth we shall assume this fact.

9.1 Definition

SetConT := ¬PrT (p⊥q)

where ⊥ stands for 0 = 1.

50

Page 51: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

9.2 Second incompleteness theorem

Let T satisfy D1, D2, D3. If T is consistent, then

T 6` ConT .

Proof

By the Diagonalization Lemma, pick θ such that

T ` θ ↔ ¬PrT (pθq).(12)

We shall show that

T ` θ ↔ ConT .(13)

“→ ”: Note that T `⊥→ θ, and hence, by D1,

T ` PrT (p⊥→ θq).

Since by D3,T ` PrT (p⊥→ θq) ∧ PrT (p⊥q)→ PrT (pθq),

we getT ` PrT (p⊥q)→ PrT (pθq)

and henceT ` ¬PrT (pθq)→ ¬PrT (p⊥q)︸ ︷︷ ︸

≡ConT

.

Thus by (12) , we getT ` θ → ConT .

“← ”: By D2,

T ` PrT (pθq)→ PrT (pPrT (pθq)q).(14)

By (12) and D1, we have T ` PrT (pPrT (pθq)→ ¬θq), and hence

T ` PrT (pPrT (pθq)q)→ PrT (p¬θq)

by D3. The latter and (14) yield

T ` PrT (pθq)→ PrT (p¬θq).(15)

51

Page 52: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

Furthermore, T ` θ → (¬θ →⊥), which implies

T ` PrT (pθ → (¬θ →⊥)q),

yielding

T ` PrT (pθq) ∧ PrT (p¬θq)→ PrT (p⊥q)(16)

by two applications of D3. (15) and (16) yield

T ` PrT (pθq)→ ¬ConT ,

whence, by (12),T ` ConT → θ.

9.3 Remark

By the proof of 9.2, any θ satisfying (12) is provably equivalent to ConT .

9.4 Lob’s Theorem

Let θ be closed. ThenT ` PrT (pθq)→ θ ⇔ T ` θ.

Proof

“⇐ ”: is obvious.

“⇒ ”:

By the Diagonalization Lemma, pick ψ such that

T ` ψ ↔(PrT (pψq)→ θ

).(17)

Then we have

T ` ψ →(PrT (pψq)→ θ

)(18)

T ` PrT

(pψ →

(PrT (pψq)→ θ

)q)

by D1 and (18)(19)T ` PrT (pψq) → PrT

(pPrT (pψq)→ θq

)by D3 and (19)(20)

T ` PrT

(pPrT (pψq)→ θq

)→

[PrT (pPrT (pψq)q)→ PrT (pθq)

]by D3(21)

T ` PrT (pψq) →[PrT (pPrT (pψq)q)→ PrT (pθq)

]by (20), (21)(22)

T ` PrT (pψq) → PrT (pPrT (pψq)q) by D2(23)T ` PrT (pψq) → PrT (pθq) by (22), (23).(24)

52

Page 53: Logic II, Math 3102 - University of Leedsrathjen/LogicII.pdf · Logic II, Math 3102 Michael Rathjen partly typed by Sara Eklund Semester II 2006/2007 Part 1. Incompleteness Theorems

By assumption we have T ` PrT (pθq) → θ. Thus, by (24), T ` PrT (pψq) → θ. By thechoice of ψ, i.e. (17), this implies T ` ψ. Hence T ` PrT (pψq) by D1. As we have alreadyshown that T ` PrT (pψq)→ θ, we arrive at T ` θ.

Another proof of “ ⇒ ” can be obtained from Godel’s second incompleteness theorem asfollows:

“⇒ ”: For a contradiction assume T 6` θ. Let T ∗ be the theory

T + ¬θ.

Then T ∗ is consistent, since T + ¬θ `⊥ would give T ` ¬θ →⊥, and consequentlyT ` θ.By the second incompleteness theorem for T ∗, we conclude

T ∗ 6` ConT ∗ .

HenceT ∗ 6` ¬PrT (p¬θ →⊥q).

Thence, using D3,T ∗ 6` ¬PrT (pθq),

and soT 6` ¬θ → ¬PrT (pθq).

Contraposition yieldsT 6` PrT (pθq)→ θ,

which is a contradiction.

9.4 Remark

Lob’s Theorem can also be used to prove the Second Incompleteness Theorem: Since T isassumed to be consistent, T 6`⊥, and hence by Lob’s Theorem, T 6` PrT (p⊥q) →⊥, thusT 6` ¬PrT (p⊥q), i.e. T 6` ConT . 2

53