<<

Math 280 Incompleteness 1. Definability, Representability and

We will work with the language of arithmetic: 0˙, S,˙ +˙ , ·˙, <˙ . We will be sloppy and won’t write dots. When we say “formula,”“satisfaction,”“proof,”everything will refer to this language. We will use the standard model of arithmetic N = (ω, 0, S, +, ·, <).

1.1 Definition:

(i) A bounded existential quantification is a quantification of the form

(∃z)(z < x ∧ φ)

which we will abbreviate by (∃z < x)φ.

(ii) A bounded universal quantification has the form

(∀z)(z < x → φ)

which we will abbreviate by (∀z < x)φ.

1.2 Fact: The formulae (∀z < x)φ ↔ ¬(∃z < x)¬φ (∃z < x)φ ↔ ¬(∀z < x)¬φ are provable in predicate calculus. Proof: Exercise.

1.3 Definition:

(i) A formula is bounded iff all definitions of this formula are bounded. We also say “Σ0”or “∆0”for bounded.

(ii) A formula is Σn iff it has the form

(∃x1, ..., x1 )(∀x2, ..., x2 )(∃x3, ..., x3 ) ··· (Q(xn, ..., xn ))ψ 1 l1 1 l2 1 l3 1 ln where ψ is bounded.

(iii) Πn formulae are defined dually. Here we start with a block of universal quantifiers.

(iv) So Σn and Πn can be defined inductively:

φ is Σn+1 iff φ has the form (∃x1) ··· (∃xl)ψ where ψ is Πn. Dually for Πn+1.

1.4 Definition: n A relation R(x1, ..., xn) ⊆ ( N) is Σl−definable iff R has a Σl−definition over N i.e. iff there is a Σl n formula φ(x1, ..., xl) such that for all a1, ..., an ∈ ( N),

R(a1, ..., an) iff N  φ[a1, ..., an].

Similarly: R is Πl iff it has a Πl definition over N.

1 We also say that R is ∆l iff R is both Σl and Πl.

1.5 Definition: is the following of axioms:

(S1)¬S(x) = 0 (S2)S(x) = S(y) → x = y (L1)¬x < 0 (L2)x < S(y) ↔ (x < y ∨ x = y) (L3)x < y ∨ x = y ∨ y < x (A1)x + 0 = x (A2)x + S(y) = S(x + y) (M1)x · 0 = 0 (M2)x · S(y) = x · y + x

We denote these axioms by RA. We view these axioms as sentences, i.e. we frequently replace them by their universal closures.

1.6 Definition: Let Σ be a set of sentences. We say that a relation R ⊆ (nN) is representable in Σ iff there is a a1 a formula φ(x1, ..., xl) such that for all a1, ..., an ∈ N : if R(a1, ..., an) then Σ ` φ(S (0), ..., S l (0)); if a1 a ¬R(a1, ..., an) then Σ ` ¬φ(S (0), ..., S l (0)). In this situation we say that φ represents R in Σ. Here Sa(0) is the term S(S(··· S(0) ··· )). Obviously (Sa(0))N = a. | {z } a n We say that a formula φ(x1, ..., xn) weakly represents R in Σ iff R = {ha1, ..., ani ∈ ( N)|Σ ` a1 an a1 an φ(S (0), ..., S (0))}. So in the above format: If R(a1, ..., an) then Σ ` φ(S (0), ..., S (0)). If a1 an ¬R(a1, ...an) then Σ 0 φ(S (0), ..., S (0)). n Given a f :( N) → N we say that a formula φ(x0, x1, ..., xn) represents/weakly represents f in Σ iff φ represents/weakly represents the relation R(y, x1, ..., xn) ≡ y = f(x1, ..., xn). n A formula φ(x1, ..., xn) is numeralwise determined in Σ iff for every a1, ..., an ∈ ( N) either Σ ` φ(Sa1 (0), ..., San (0)) or else Σ ` ¬φ(Sa1 (0), ..., San (0)).

1.7 Remarks: Assume Σ ⊆Th(N), in particular this applies to RA.

n (i) If φ(x1, ..., xn) is numeralwise determined, then φ represents a relation R ⊆ ( N). (This actually holds for any Σ.) (ii) If φ represents R then φ weakly represents R. (Because Σ is consistent.) This actually is true for any consistent Σ.

n (iii) If φ weakly represents R in Σ then φ defines R in N. R = {ha1, ..., ani ∈ ( N)|N  φ[a1, ..., an]}.

1.8 Definition:

2 (a) The following functions are called basic:

c0 : N → N defined by c0(x) = 0 S : N → N defined by S(x) = x + 1 n n n For each 1 ≤ k ≤ n : Pk :( N) → N defined by Pk (x1, ..., xn) = xk These functions are called projections. (b) We introduce the following operators on partial functions:

n k - Composition: If we have functions g :( N) → N and f1, ..., fn :( N) → N then the composition k h is a function h :( N) → N defined by h(x1, ..., xk) = g(f1(x1, ..., xk), ..., fn(x1, ..., xk)). - Primitive Recursion: Given functions f :(nN) → N and g :(n+2N) → N we define a function h :(n+1N) → N by h(0, x1, ..., xn) = f(x1, ..., xn)

h(y + 1, x1, ..., xn) = g(y, h(y, x1, ..., xn), x1, ..., xn).

- µ−operator. Given a partial function g :(n+1N) → N we define a partial function f :(nN) → N by f(x1, ..., xn) =the least y such that

(i) all values g(0, x1, ..., xn), ..., g(y, x1, ..., xn) are defined. 0 0 (ii) g(y , x1, ..., xn) 6= 0 for all y < y.

(iii) g(y, x1, ..., xn) = 0.

1.9 Remark: From the point of view of programming:

- Composition corresponds to calling subroutines. - Primitive recursion corresponds to cycles. - µ−operator corresponds to search.

1.10 Definition: A partial function is recursive iff it can be finitely generated from basic functions using the three operators: composition, primitive recursion and the µ−operator. A partial function is primitive recursive iff it can be finitely generated from the basic functions using the operators composition and primitive recursion. For “primitive recursive, ”we write briefly “p.i.” Note: As all basic functions are total and the operators composition and primitive recursion preserve totality, all primitive recursive functions are total.

1.11 Main Theorem:

(a) Let f be a partial function. TFAE:

(i) f is Σ1−definable in N. (ii) f is weakly representable in RA. (iii) f is recursive.

1+n (b) For each n > 0 there is a partial recursive function Φn :( N) → N which is universal for all partial recursive functions with n arguments. This means: if f :(nN) → N is a partial recursive function then there is a number e ∈ N such that for all a1, ..., an ∈ N : f(a1, ..., an) ' Φn(e, a1, ..., an).

3 n 1+m (c) For 1 ≤ m < n there are primitive recursive functions sm :( N) → N such that for every e, a1, ..., an ∈ N :

n Φn(e, a1, ..., an) ' Φn−m(sm(e, a1, ..., am), am+1, ...an).

n Moreover, the functions sm are injective in each coordinate. (c) is called the s-m-n-theorem or the parameter theorem.

1.12 Definition: n Let Φn be the universal function from T.1.11. If f :( N) → N is a partial recursive function, and e ∈ N is such that f(x1, ..., xn) ' φn(e, x1, ..., xn) then e is called a G¨odelnumber of f.

1.13 Corollary:

(a) The functions Φn are not total.

(b) Any partial recursive function f :(nN) → N has infinitely many G¨odelnumbers.

Proof. Do this for n = 1 :

(a) Since Φ1(x0, xn) is recursive, so is the function f(x0) ' Φ1(x0, x0) + 1. This is because f(x0) ' 1 Φ1(x0, p1(x0)) + 1. Now let e be a G¨odelnumber for f. So: f(x0) ' Φ1(e, x0) for all x0.

That is, Φ1(x0, x0)+1 ' Φ(e, x0) for all x0, so in particular x0 = e. Therefore, Φ1(e, e)+1 ' Φ(e, e). (b) Given f : N → N recursive, consider the function g : N × N → N defined by g(x1, x2) ' f(x2). 2 This is again recursive, as g(x1, x2) ' f(p2(x1, x2)). Let e be a G¨odel number for g. So

2 f(x2) ' g(x1, x2) ' Φ2(e, x1, x2) ' Φ1(S1 (e, x1), x2).

2 2 So each S1 (e, x1) is a G¨odelnumber for f. But we also said that S1 is injective in each coordinate. 2 So the set {S1 (e, x1)|x1 ∈ N} is an infinite set of G¨odelnumbers for f.

2. From Σ1−Definability to Representability

2.1 Lemma: For each n > 0: RA` x < Sn+1(0) ↔ x = 0 ∨ x = S(0) ∨ · · · ∨ x = Sn(0).

Proof. Induction on n: for n = 0, the axiom L2 says that x < S(y) ↔ x < y ∨ x = y. Since 0 is substitutable for y in this formula, RA` x < S(0) ↔ (x < 0 ∨ x = 0), using a lemma from predicate logic. But axiom L1 says ¬x < 0. Using propositional logic, we arrive at RA` x < S(0) ↔ x = 0. n → n + 1: This time we substitute Sn+1(0) for y in L2, we get RA` x < Sn+2(0) ↔ (x < Sn+1(0) ∨ x = Sn+1(0)). By the IH: RA` x < Sn(0) ↔ (x = 0 ∨ · · · ∨ x = Sn(0)). Using predicate logic, we can replace x < Sn+1(0) by (x = 0 ∨ · · · ∨ x = Sn(0)).

2.2 Theorem:

a1 an Let φ(x1, ..., xn) be a bounded formula and a1, ..., an ∈ N. If N  φ[a1, ..., an] then RA` φ(S (0), ..., S (0)) (∗).

4 Proof. Induction on complexity of φ. We will be showing that (∗) holds at φ and ¬φ at each step of induction. Claim 1: (i) If m = n, then RA` Sm(0) = Sn(0). (ii)If m 6= n, then RA` ¬Sm(0) = Sn(0).

Proof of Claim: (i) is the equality axiom E1 of predicate calculus, as Sm(0),Sn(0) is the same term in this case. (ii) Axiom S1 says ¬S(x) = 0. Now the term Sm−1(0), m > 0, is substitutable for x in S1. So by predicate calculus: (1) RA` ¬Sm(0) = 0. Now assume WLOG that n > m and Let k = n − m. Axiom S2 says: S(x) = S(y) → x = y. So RA` ¬x = y → ¬S(x) = S(y). By substituting Sk(0) for x and 0 for y: RA` ¬Sk(0) = 0 → ¬Sk+1(0) = 0. Using this, (1), and MP: RA` ¬Sk+1(0) = S(0). Repeat this another m times and get RA` ¬Sn(0) = Sm(0).

Claim 2: (i) If m < n then RA` Sm(0) < Sn(0) (ii) If ¬m < n then RA` ¬Sm(0) < Sn(0).

Proof of Claim 2: (i) We already know RA` Sm(0) = Sm(0), hence Sm(0) = 0 ∨ · · · ∨ Sm(0) = Sn−1(0). By L.2.1, RA` (x = 0 ∨ · · · ∨ x = Sn−1(0)) ↔ x < Sn(0). So using predicate logic we can substitute Sm(0) for x. That gives RA` (Sm(0) = 0 ∨ · · · ∨ Sm(0) = Sn−1(0)) ↔ Sm(0) < Sn(0). Now apply (1) and MP to this. (ii) If m < n then m 6= k for all k < n, so by Claim 1 RA` ¬Sk(0) = Sm(0) for all k < m. So RA proves the conjunction of these inequalities, but this conjunction is equivalent to ¬(Sm(0) = 0 ∨ · · · ∨ Sm(0) = Sm−1(0)). By L.2.1, RA` ¬(Sm(0) = 0 ∨ · · · ∨ Sm(0) = Sm−1(0)) → ¬Sm(0) < Sn(0). Apply the above two plus MP to get RA` ¬Sm(0) < Sn(0)

Claim 3: (i) RA` Sn+m(0) = Sn(0) + Sm(0). (ii) RA` Snm(0) = Sn(0) · Sm(0).

Proof: Exercise: induction on m using axioms A1, A2 for (i) and M1, M2 for (ii).

N a1 an Claim 4: If t(x1, ..., xn) is a term, a1, ..., an ∈ N and b = t (a1, ..., an) then RA` t(S (0), ..., S (0)) = Sb(0).

Proof: Exercise: induction on complexity of t.

By induction on complexity of bounded formulae we prove that if φ(x1, ..., xn) is a bounded formulae and a1, ..., an ∈ N then (*):

a1 an IfN  φ[a1, ..., an] then RA ` φ(S (0), ..., S (0)).

a1 an IfN  ¬φ[a1, ..., an] then RA ` ¬φ(S (0), ..., S (0)).

Atomic formulae: They are of the form t1 = t2 or t1 < t2 where t1, t2 are terms. As an example, we prove:

N N a1 an a1 an ¬t1 [a1, ..., an] < t2 [a1, ..., an] then RA ` ¬t1(S (0), ..., S (0)) < t2(S (0), ..., S (0)).

N N Let b1 = t1 [a1, ..., an] and b2 = t2 [a1, ..., an]. By Claim 4,

5 b1 a1 an (1) RA` S (0) = t1(S (0), ..., S (0))

b2 a1 an (2) RA` S (0) = t2(S (0), ..., S (0)).

b1 b2 By assumption, ¬b1 < b2 so by Claim 2, RA` ¬S (0) < S (0). Then we use the equality axiom (E2) a1 an in predicate logic and (1), (2) to substitute in the above statement. So RA` ¬t1(S (0), ..., S (0)) < a1 an t2(S (0), ..., S (0)).

Induction step: Negation: we assume (*) holds for φ. Want to get (*) for ¬φ. Notice: the second line in (*) for φ is the corresponding first line in (*) for ¬φ. Regarding the second line in (*) for ¬φ: this would read a1 an “If N  ¬¬φ[a1, ..., al] then RA` ¬¬φ(S (0), ..., S (0)).”This almost corresponds to the first line. We need to use: ` φ ↔ ¬¬φ.

Conjunction: The first line in (*) is straightforward. The second line in (*): Assume N ` ¬(φ1 ∧ φ2)[a1, ..., an]. By the definition of : N  ¬φi[a1, ..., an] for at least one i. By IH, (*) holds for φi, hence a1 an RA` ¬φi(S (0), ..., S (0)) for at least one i. The rest follows from the fact that ` ¬φi → ¬(φ1 ∧ φ2) for i = 1, 2.

Bounded existential quantifier: Assume φ is (∃z < x0)ψ(z, x1, ..., xn). First line: we actually ¯ prove the first line holds for unbounded existential quantifier: if φ has the form (∃z)φ(z, x0, ..., xn) ¯ and we assume that the conclusion holds for φ. If N  φ[a1, ..., an] then there is some a0 ∈ N ¯ ¯ a0 an such that N  φ[a0, ..., an]. Then by IH, RA` φ(S (0), .., S (0)). Then use the quantifier axiom: φ¯(z/Sa0 (0),Sa1 (0), ..., San (0)) → (∃z)φ¯(z, Sa1 (0), ..., San (0)). By MP, RA` (∃z)φ¯(z, Sa1 (0), ..., San (0)). Now if φ is of the form (∃z < x0)ψ(z, x1, ..., xn) and the conclusion already holds for ψ: notice φ is the formula (∃z)(z < x0 ∧ ψ(z, x1, ..., xn)). Then the conclusion also holds for the formula z < x0, as it is an atomic formula. By the above, the conclusion also holds for their conjunction. Then apply what we just proved about existential quantification.

Second line: Now assume N  ¬φ[a0, ..., an] i.e., N  ¬(∃z < a0)ψ(z, a1, ..., an). This means (by looking at the definition of ): for every b < a0 : N  ¬ψ[b, a1, ..., an]. So by the IH: for each such b we have (1) RA` ¬ψ(Sb(0),Sa1 (0), ..., San (0)). Point: we need to replace “Sb(0)”in the above formula by the variable z, so that we can quantify over it. Here we used the “generalized form”of the equality axiom (E2). We proved: if t1, t2 are substitutable for z in φ: ` t1 = t2 → (φ(z/t1) → φ(z/t2)). We apply this to ψ, z and Sb(0). Notice: obviously z is substitutable for z in ψ. Also, Sb(0) is substitutable for z in ¬ψ as Sb(0) does not involve any variables. So (2) ` Sb(0) = z → (¬ψ(Sb(0),Sa1 (0), ..., San (0)) → ¬ψ(z, Sa1 (0), ..., San (0))). Now, (P → (Q → R)) → (Q → (P → R)) is a tautology. So we have a proof in predicate logic which turns (2) into (3) ¬ψ(Sb(0),Sa1 (0), ..., San (0)) → (Sb(0) = z → ¬ψ(z, Sa1 (0), ..., San (0))). By (1), (3) and MP: (and switching from Sb(0) = z toz = Sb(0)),

b a1 an (4) z = S (0) → ¬ψ(z, S (0), ..., S (0)). Recall again (4) holds for every b < a0. Now in proposi- tional logic, if we have P0 → Q, ..., Pa0−1 → Q then we can derive P0 ∨ · · · ∨ Pa0−1 → Q. If we apply this to (4), we get:

RA ` (z = S0(0) ∨ · · · ∨ z = Sa−1(0)) → ¬ψ(z, Sa1 (0), ..., San (0)).

Now by L.2.1: RA` (z = S0(0) ∨ · · · ∨ z = Sa0−1(0)) ↔ z < Sa0 . Combining these two we can get a proof in RA:

RA ` z < Sa0 → ¬ψ(z, Sa1 (0), ..., San (0)).

Now in predicate logic ra` (∀z)(z < Sa0 (0) → ¬ψ(z, Sa1 (0), ..., San (0))). Therefore RA` ¬(∃z < Sa0 (0))ψ(z, Sa1 (0), ..., San (0)).

6 2.3 Corollary:

a1 an Assume φ(x1, ..., xn) is a Σ1−formula and a1, ..., an ∈ N. If N ` φ[a1, ..., an], then RA` φ(S (0), ..., S (0)). This was essentially proved in the first line of the proof for bounded existential quantifier, where we saw that it holds even for unbounded existential quantifier.

2.4 Corollary: n If a partial function f :( N) → N is Σ1−definable, then it is weakly representable in RA. This means: there is a formula φ(x0, ..., xn) such that for all a0, ..., an ∈ N: a0 = f(a1, ..., an) iff RA` φ(Sa1 (0), ..., San (0)). Proof: Exercise.

2.5 Remark: In this section we did not use the full strength of Robinson Arithmetic, namely we did not use axiom (L3).

2.6 Remark: The axioms of RA cannot prove that < is an ordering relation. On the other hand, it is provable in RA that < is a linear ordering on standard numbers, but this fact connot be expressed by a single formula.

3. Recursive Functions

We develop some basic facts about recursive functions.

3.1 Definition: n n If R ⊆ ( N), the characteristic function of R is the function χR :( N) → N defined by

χR = 1, hx1, ..., xni ∈ R; 0, ow

∗ n The partial characteristic function of R is the partial function χR :( N) → N such that dom(χR) = R ∗ and χR(x1, ..., xn) = 1 for all hx1, ..., xni ∈ R.

3.2 Remark:

∗ (a) The point of D.3.1: it may (and will) happen that χR is recursive while χR not.

(b) It would simplify some computations if we defined χR(~x) = 0 for ~x ∈ R and χR(~x) = 1 for ~x/∈ R, ∗ and similarly χR(~x) = 0 for ~x ∈ R, but we rather stick to general conventions.

3.3 Definition: n A relation R ⊆ ( N) → N is recursive (primitive recursive) iff χR is a recursive (primitive recursive) ∗ function. R is called recursively enumerable iff χR is a partial recursive function.

3.4 Remark: We will show later that R is recursively enumerable ⇐⇒ there is a total recursive function f s.t. R = rng(f).

In the following, we give a list of primitive recursive functions/relations and basic procedures for constructing them.

7 (1) For each n ∈ N the constant function cn : N → N defined by cn(x) = n is primitive recursive.

Proof: Induction on n. c0 is basic. If cn is primitive recursive, then so is cn+1 since cn+1(x) = (S ◦ cn)(x). (2) The two place functions x + y, x · y and xy are primitive recursive. + is defined by primitive recursion: x + 0 = x. x + y + 1 = S(x + y). The identity function is primitive recursive, as it is 1 basic: it’s p1. Primitive recursion works as follows: h(y, ~x) is defined for f(~x) and g(u, v, ~x) by g(0, ~x) = f(~x) 1 and g(y + 1, ~x) = h(y, g(y, ~x), ~x). In our case: f(x) = p1(x), h(u, v, x) = S(v). Similarly for and . (3) The function x−˙ y defined by x−˙ y = x − y if x ≥ y, 0 x < 0 is primitive recursive. First observe: g(x) = x−˙ 1 is primitive recursive: 0 · −1 = 0, (x + 1)−˙ 1 = x. Then x−˙ y is defined by primitive recursion as follows: x−˙ 0 = x, xy +˙ 1 = (x−˙ y)−˙ 1.

(4) The function sg: N → N defined by sg(x) = 1 if x > 0, 0 if x = 0 is primitive recursive. Proof: sg(x)= 1−˙ (1−˙ x).

(5) The binary relations < and = are primitive recursive. Why: χ<(x, y) =sg(y−˙ x). χ=(x, y) = (1 − χ<(x, y))(1 − χ<(y, x)).

n N (6) If t(x1, ..., xn) is a term then the function ft :( N) → N defined by ft(x1, ..., xn) = t [x1, ..., xn]. Proof by induction on complexity of t using the fact that S, +, · are primitive recurstive.

c (7) If R is primitive recursive then so is R . Also if R1,R2 are primitive recursive then so is R1 ∩ R2.

c ˙ Proof: χR (~x) = 1−χR(~x), χR1∩R2 (~x) = χR1 (~x) · χR2 (~x). P (8) Let f(y, x1, ..., xn) the primitive recursive. Then so are sf (y, ~x) = f(z, ~x), sf (0, ~x) = 0; Q z

Proof: For sums: sf (0, ~x) = 0, sf (y + 1, ~x) = sf (y, ~x) + f(y, ~x).

n (9) Let φ(x1, ..., xn) be a bounded formula. Then Rφ = {hx1, ..., xni ∈ ( N)|N  φ[x1, ..., xn]} is primitive recursive.

Proof by induction on complexity of φ. Atomic φ: say φ is t1(~x) < t2(~x). χRφ (~x) = χ<(ft1 (~x), ft2 (~x)). Induction step: For propositional connectives this follows from (7). Bounded quantifiers, Say   φ(~x) ≡ (∃z < x )ψ(z, x , ..., x ). χ (x , ..., x ) =sg P χ (z, x , ..., x ) . So this follows 0 1 n Rφ 0 n z

n (10) Definition by cases. If R1, ..., Rk ⊆ ( N) are (primitive) recursive relations that are mutually n distinct and R1 ∪ · · · ∪ Rk = ( N) and if f1, ..., fk are (primitive) recursive functions then the n function g :( N) → N defined by g(x1, ..., xn) = fi(x1, ..., xn) if Ri(x1, ..., xn) is primitive recursive.

Proof: g(~x) = f1(~x) · χR1 (~x) + ··· + fk(~x) · χRk (~x). (11) Bounded µ−operator. Let f(y, ~x) be a primitive recursive function. Then function g(y, ~x) =the least z < y such that f(z, ~x) = 0 if there is one, y otherwise is primitive recursive. Proof: g(0, ~x) = 0. g(y + 1, ~x) = g(y, ~x) if g(y, ~x) < y or f(y, ~x) = 0, y + 1 otherwise. This is a definition by primitive recursion which relies on (10). Exercise: find the function h from the definition by primitive recursion.

We are going to code finite of numbers by numbers. Let p0, p1, ..., pn, ... be the increasing enumeration of primes. The codes are as follows: ∅ is coded by 1.

8 s(0)+1 s(n−1)+1 If length(s) = n then s is coded by the product p0 ··· pn−1 . This coding is injective, because all exponents are > 0. So if a is a code, we can retrieve s from a. Note: this coding is not surjective. H is called G¨odelcoding. In the following we show that certain manipulations with finite sequencese can be represented as primitive recursive functions on codes. (10a) If R(y, ~x) is primitive recursive then also the relations

R1(y, ~x) ⇐⇒ (∃z < y)R(z, ~x)

R2(y, ~x) ⇐⇒ (∀z < y)R(z, ~x)

The proof of (10) proves this.

The we get G¨odel’scoding of finite sequences. We had hpn|n ∈ Ni the increasing enumeration of a0+1 an−1+1 primes. Then the code of ∅ is 1, the code of ha0, ..., ani is p0 ··· pn−1 . We now show that certain manipulations with codes are primitive recursive. (12) The relation x|y (x divides y) is primitive recursive:

x|y ⇐⇒ (∃z < y + 1)(y = x · z)

Q(u, y, x) ≡ (∃z < u)(y = x · z)

x|y ≡ Q(y + 1, y, x).

(13) The relation “p is prime ”is primitive recursive:

PRIME(x) ⇐⇒ (∀z < x)(z|x → z = 1) ∧ 1 < x.

That is because “z|x”is primitive recursive and the rest is just obtained by Boolean combinations and bounded quantification.

(14) The set of codes of all finite sequences is primitive recursive.

SEQ(s) ⇐⇒ s 6= 0 ∧ (∀z < s)(∀z0 < z)[(PRIME(z) ∧ PRIME(z0))] → (z|s → z0|s).

th (15) The function i 7→ pi “pi is the i prime”is primitive recursive. If we have primes p0, ..., pi we Q i+1 know pi+1 ≤ ( j≤i pi + 1) ≤ pi + 1. So: i 7→ pi is defined by primitive recursion: p0 = 2, i+1 pi+1 = (µx < pi + 1)(pi < x ∧ PRIME(x)). (16) There is a primitive recursive function lh such that whenever s is a code for a :

lh(s)= the length of the sequence coded by s.

lh(s) = (µx < s)(px 6 |s).

th (17) There is a primitive recursive function ()i such that if s is a code for a sequence then (s)i =the i of the sequence coded by s.

z+2 (s)i = (µz < s)(pi 6 |s).

9 (18) There is a primitive recursive function ∗ such that if s, t code sequences then s ∗ t = the code of the a0+1 an−1+1 b0+1 bm−1+1 concatenation s ∧ t. If s = p0 ··· pn−1 and t = p0 ··· pm−1 then

a0+1 an−1+1 b0+1 bm−1+1 s ∗ t = p0 ··· pn−1 pn ··· pn+m−1 . So Y (t)i+1 s ∗ t = s · plh(s)+i. i

(19) Let f(y, ~x) be a function. We define f¯(y, ~x) as follows:

f¯(0, ~x) = 1

f¯(y + 1, ~x) = f¯(y, ~x) ∗ #hf(y, ~x)i

where the last term is the code of the one element sequence hf(y, ~x)i. Notice that f¯(y, ~x) is the code of the sequence hf(0, ~x), ..., f(y − 1, ~x)i. Then f is primitive recursive iff f¯ is. (20) Assume g(u, v, ~x) is a primitive recursive function. Then there is a unique primitive recursive function f(y, ~x) such that f(y, ~x) = g(y, f¯(y, ~x), x). This is because f¯ is defined by primitive recursion: f¯(0, ~x) = 1, f¯(y + 1, ~x) = f¯(y, ~x) ∗ g(y, f¯(y, ~x), x). Then f is p.r. by (19). Also f is unique by definition. 4. Arithmetrization of Syntax

We code the syntax of the first order logic using the tools in Section 3. We work with our language of arithmetic {0, S, +, ·, <}. We first choose codes for symbols:

Variables: #vi = 2i. Logical symbols: #(=) = 3; #(∧) = 5; #(∃) = 7; #(() = 9; #()) = 11; #(¬) = 13. L−symbols: #(0) = 15; #(S) = 17; #(+) = 19; #(·) = 21; #(<) = 23.

(1) The relation VBL(x): “x codes a variable”is primitive recursive.

(2) The relation TERM(x): “x codes a term”is primitive recursive.

TERM(x) ⇐⇒ (∃z < x)(VBL(z) ∧ x = #hzi) ∨ x = #h0i ∨(∃z, z0 < x)[TERM(z)∧TERM(z0)∧(x = #iSh∗#h(i∗z ∗#h)i∨x = #h+i∗#(h(i)∗z ∗z0 ∗#h)i)].

This gives a primitive recursive relation TERM(s) by Section 3, item (20). Another explanation: There are primitive recursive functions Succ, Sum and Prod such that for each s, s1, s2 ∈ N,

Succ(s) = #hS(i ∗ s ∗ #h)i

Sum(s1, s2) = #h+(i ∗ s1 ∗ s2 ∗ #h)i

Prod(s1, s2) = #h·()i ∗ s1 ∗ s2 ∗ #h)i

Informally: if s is a code for a term t then Succ(s) is a code for S(t) and similarly for Sum, Prod. Now we can write:

10 TERM(s) iff Seq(s) ∧ [lh(s) = 1 ∧ ((s)0 = #0 ∨ VBL((s)0))

∨(∃s1, s2 < s)(TERM(s1) ∧ TERM(s2) ∧ (s = Succ(s1) ∨ s = Sum(s1, s2) ∨ s = Prod(s1, s2)))]

We need to see that this gives us a primitive recursive definition of the relation TERM. This follows from (20): consider the following relation:

¯ ∗ Q(s, u) = Seq(s) ∧ [Q(s) ∨ (∃s1, s2 < s)((u)s1 = 1 ∧ (u)s2 = 1 ∧ Q (s, s1, s2))].

Then TERM(s) iff Q(s, χ¯T ERM (s)). Actually in (20),

χT ERM = χQ(s, χ¯T ERM (s)).

(3) There is a primitive recursive relation FML(x) such that FML(x) iff x is a code for a formula. First, there is a primitive recursive relation AFML(x) and primitive recursive functions Neg(x), Conj(x1, x2), Eq(x, v) such that

- AFML(x) iff x is a code for an atomic formula, - Neg(x) = #h¬i ∗ x,

- Conj(x1, x2) = #h(i ∗ x1 ∗ #h∧i ∗ x2 ∗ #h)i, - Eq(x, v) = #h(∃i ∗ v ∗ #h)i ∗ x.

Then

FML(x) iff AFML(x) ∨ (∃x1, x2 < x)(∃v < x) [FML(x1) ∧ FML(x2)]  ∧[x = Neg(x1) ∨ x = Conj(x1, x2) ∨ (VBL(v) ∧ x = Eq(x1, v))] .

(4) There is a primitive recursive function Sub(x, u, s) such that: if x is a code for a formula, u is a code for a variable, s is a code for a term substitutable for the variable with code u in the formula with code x then Sub(x, u, s) is a code for the result of the substitution. We first consider the function Repl(x, u, s) which: if x, s are codes for sequences, u is a number, then Repl(x, u, s) is the result of replacing all occurences of u in x by s. Repl(x, u, s) is primitive recursive, because Repl(0, u, s) = 0 and Repl(x + 1, u, s) =Repl(x, u, s) ∗ s if Seq(x) ∧ Last(x) = u, and x + 1 otherwise, where the function Last(x) returns the last element of the sequence coded by

x (if x is such a code) and is primitive recursive since Last(x) = (x)lh(x)−˙ 1.  Repl(x, u, s) if AFML(x)   ∗ 0 0 Neg(Neg (x), u, s) if (∃x < x)(x = Neg(x ))  1 2 Sub(x, u, s) = Conj(Conj (x), u, s), Conj (x), u, s) if (∃x1, x2 < x)(x = Conj(x1, x2))  2 1 Eq(Sub(Eq (x), u, s), Eq (x)) iff (∃x0, v < x)(VBL(v) ∧ FML(x0)u 6= v)  x otherwise This copies the definition of substitution.

- If φ is of the form ¬ψ then Neg∗(#φ) = #ψ. This is primitive recursive: Neg∗(x) = (µz < x)(x =Neg(z)). i 2 - Similarly: if φ is φ1 ∧ φ2 then Conj (#φ) = #φi. If φ is (∃v)ψ then Eq(#φ) = #v, Eq (#φ) = #ψ.

Notice: constant terms are always substitutable. Hence: if t is a constant term, φ is a formula and v is a variable then Sub(#φ, #v, #t) always gives the code for the resulting substitution.

11 (5) There is a relation FR(x, v) such that for any formula φ and variable v:

FR(#φ, #v) iff v has a free occurence in φ.

FR(x, u) ≡ Sub(x, u, #hoi) = x.

So in particular: the set of all sentences is primitive recursive:

SENT(x) ≡ (∀v < x)(VBL(v) → ¬FR(x, v)).

(6) There is a primitive recursive relation SBL(x, u, s) such that for every formula φ, every variable v and every term t:

SBL(#φ, #v, #t) iff t is substitutable for v in φ.

This imitates the recursive definition of substitutability: t is substitutable for v in φ iff

- either φ is atomic - or φ is a Boolean combination of formulae in which t is substitutable for v - or φ has the form (∃w)ψ, and either w = v and we don’t perform any substitution (in which case we don’t perform any substitution) or else t is substitutable for v in ψ And w has no occurence in ψ.

Now say this in a primitive recursive way in codes: SBL(x, u, s) iff

AFML(x) or (∃x1, x2 < x)[SBL(x1, u, s) ∧ SBL(x2, u, s) ∧ (x = Neg(x1) ∨ x = Conj(x1, x2))]

0 0 0 or (∃x , v < x)[(x = Eq(x , v) ∧ (u 6= v ∨ (SBL(x , u, s) ∧ (∀i < lh(s))(v 6= (s)1))))]

Now we will code the notion of a proof.

(7) There is a primitive recursive relation APL(x) such that APL(x) holds iff x is a code of an axiom of predicate logic. For this, we introduce primitive recursive relations TAUT(x) iff x is a code of a tautology; EQ1(x) iff x is a cde of an axiom EQ1; EQ2(x) iff x is a cde of an axiom EQ2; Q(x) iff x is a code of a quantifier axiom. Then

APL(x) iff TAUT(x) ∨ EQ1(x) ∨ EQ2Q(x).

EQ1 is an axiom of the form t = t where t is a term. So we can write EQ1(x) iff (∃s < x)(TERM(s)∧ x = s ∗ #h=i ∗ s).

EQ2 is an axiom of the form t1 = t2 → (φ(v/t1) → φ(v/t2)) where φ is atomic. Note: when we see the axiom we don’t know what φ is, i.e. we don’t know what v is. But the point: v can be replaced by any variable which has no occurence in the axiom. The code of such a variable is easily seen to be bounded by code of the axiom +2. We also introduce a primitive recursive function Impl(x, y) such that for any formula φ, ψ: Impl(#φ, #ψ) = #(φ → ψ). Then

x+2 EQ2(x) iff (∃s1, s2, y, u < (x + 2) )

[TERM(s1)∧TERM(s2)∧AFML(y)∧VBL(u)∧y = Impl(s1∗#h=i∗s2, Impl(Sub(y, v, s1), Sub(y, v, s2)))]

Explanation: Obviously #t1, #t2 < # the axiom= x. For the variable v we take the least variable max φ x+2 with no occurence in the axiom; then #v < x+2. Then the code of such φ ≤ Plh(φ)−1 < (x+2) .

12 ¯ ¯ Tautologies. φ is a tautology iff there is a list of formulae hφ0, ..., φki and a schema hφ0, ..., φni such ¯ that each φi is either some φj or φj1 ∧ φj2 or ¬φj1 for some j1, j2 < i and φn is φ. ¯ ¯ AND for every sequence hl0, .., lki of 0 and 1 and any sequence hl0, ..., lni of 0 and 1 such that if ¯ ¯ φi is φj then li = lj. If φ1 is φj1 ∧ φj2 for j1, j2 < i then l1 = lj1 · lj2 if φi is ¬φj for j < i, then li = 1−˙ lj. We have ln = 1. So:

x+1 ¯ x+1 ¯ ¯ ˙  TAUT(x) iff (∃s,¯ s < (x+1) )(∀t, t < (x+1) )Seq(¯s)Seq(s)∧(∀i < lh(¯s)FML((¯s)i)∧(∀i < lh(s))[(∃j < lh(¯s))((s)i = (¯s)j)∨(∃j < i)((si) = Neg((sj)))∨(∃j1, j2 < j)((si)) = Conj(s)j1 , (s)j2 ]∧Last(s) = x∧ (∀i < lh(t))((t)i = 0∨(t)i = 1)∧(∀i < lh(t))[(∃y < lh(¯s))((s)i = (¯s)j∧(t)i = (t)j)∨(∃j < i)((s)i = Neg((s)j)∧(t)i = 1−(t)j)∨(∃j1, j2 < i)((s)i = Con((s)j1 , (s)j2 )∧(t)i = (t)j1 ·(t)j2 )] → Last(t) = 1

Quantifier Axiom: φ(v/t) → (∃v)φ where t is substitutable for v in φ. Q(x) iff (∃x0, v, t < xx)(FML(x0)∧VBL(v)∧TERM(t)∧SBL(x0, v, t)∧x = Impl(Sub(x0, v, t), Eq(x0, v)))

(8) Rules of inference: There are primitive recursive relations MP(y, x1, x2) and QR(y, x) such that for every formula φ, ψ1, ψ2: MP(#φ, #ψ1, #ψ2) iff φ follows from ψ1, ψ2 by MP; QR(#φ, ψ#) iff φ follows from ψ by the quantifier rule. (Exercise)

4.1 Definition: Let A ⊆ N. A partial function f is recursive in A (primitive recursive in A) iff f can be obtained by the basic functions and from χA using the −−− operators /using composition and primitive recursion. A set B ⊆ N is recursive in A (primitive recursive in A) iff χB is a recursive (primitive recursive) function. ∗ B is recursively enumrable in A iff χB is recursive.

4.2 Definition Let A be a set of L−sentences and #A be the set of all codes of sentences from A. There is a relation PRFA(s, #φ) that is primitive recursive in A such that for every formula φ and every s ∈ N: PRFA(s, #φ) iff s is the code of a proof of φ for A.

Proof: PRF(s, x) iff Seq(s)∧Last(s) = x ∧ (∀i < lh(s))[APL((s)i) ∨ χ#A((s)i) ∨ (∃j1, j2 < i)

MP((s)i, (s)j1 , (s)j2 ) ∨ (∃j < i) QR((s)i, (s)j)].

4.3 Proposition:

(a) If R(y, ~x) is recursive in A, then R0(~x) ≡ (∃y)R(y, ~x) is recursively enumerable in A. (b) If f(~x) is a function that is partial recursive in A and A is recursively enumerable then f(~x) is partial recursive. (c) If both R(~x) and ¬R(~x) are recursively enumerable in A then R(~x) is recursive in A.

∗ Proof. (a) χR0 (~x) 'sg(1 + µyχR(y, ~x) = 1) (b) Immediately from the definition of primitive recursive: notice χA is partial recursive.

(c) χR(~x) = µz[(χR(~x) ' z ∧ z = 1) ∨ (χ¬R(~x) ' z ∧ z = 0)]

4.4 Theorem:

There is a recursively enumerable relation (in #A) PRBA(x), where A is a set of L−sentences, such that for every L−formula φ :

PRBA(φ) iff A ` φ.

In particular, if A is a set of L−sentences such that #A is recursive, then PRBA is recursively enumerable.

13 Proof. PRBA(x) iff (∃s)PRFA(s, x).

4.5 Proposition:

#RA, #PA, #ACFp any p ∈Prime∪{0} are recursive. Actually, all are primitive recursive.

4.6 Corollary:

PRBRA, PRBPA, PRBACFp are recursively enumerable.

4.7 Proposition:

PRBACFp is recursive. That is, there is a computer program that decides if a sentence is a theorem of ACFp.

Proof. We proved that ACFp is complete. This means:

¬PRBACFp (#φ) iff PRBACFp (#¬φ).

This means that ¬PRBACFp is partial recursive. By L.4.3(c), PRBACFp is recursive.

4.8 Proposition:

(a) There is a primitive recursive function Num(x) such that for every x ∈ N, Num(x) = #Sx(0). n (b) For each n ∈ N there is a primitive resursive function Sub (z, x0, ..., xn) such that

If φ is an L−formula, for each i ∈ {0, ..., n}: ti is an L−term substitutable for vi in φ (recall vi th is the i canonical variable with code 2i) and such that vi has no occurence in tj whenever j < i then Sub(#φ, #t0, ..., #tn) = #φ(v0/t0, ..., vn/tn).

Proof. (a) By primitive recursion: Num(0) = #0, Num(x + 1) = #hs(i∗Num(x) ∗ #h)i. (b) We apply the function Sub inductively- that is why we need the “and”closure.

0 Sub (z, x0) = Sub(z, v0, x0)

n+1 n Sub (z, x0, ..., xn+1) = Sub(Sub (z, x0, ..., xn), vn+1, xn+1).

4.9 Theorem: If f(~x) is weakly representable in RA then f(~x) is partial recursive.

Proof. Let φ(y, x0, ..., xn−1) be a formula that weakly represents f in RA. So:

b a0 an−1 b = f(a0, ..., an−1) iff RA ` φ(S (0),S (0), ..., S (0))

n+1 iff (∃s)PRFRA(s, Sub (#φ, Num(b), ..., Num(An−1))).

So how do we find f(~a)? We will search both for the value and the proof that it is the value. We will search for the pair hs, f(~a)i. Now recall that ()i is the primitive recursive function such that for every z th that codes a sequence (z)i i number of the sequence. So

14 n+1 f(a0, ...an−1) ' (µzPRFRA((z)0, Sub (#φ, Num((z)1), Num(a0), ..., Num(an−1))))1.

where that z has the form hs, f(a)i. Where s is the shortest possible proof. This also gives a normal form for partial recursive functions: there is a single primitive recursive function, namely χPRFRA such that f is obtained by plugging in the codes for the formula and arguments, then performing one application of the µ−operator and finally perfoming a primitive recursive operation of extracting a coordinate.

4.10 Theorem: For each n ∈ N the function

n+1 (∗)Φn(x0, ..., xn) ' (µzPRFRA((z)0, Sub (x0, Num((z)1), Num(x1), ..., Num(xn))))1 is a universal partial recursive function for all partial recursive functions with n arguments.

Proof. Follows from the proof of T.4.9.

Now let m < n. Notice that if φ(v0, ..., vn) is a formula then

y x1 xn φ(v0/S (0), v1/S (0), ..., vn/S (0))

x1 xm y xm+1 xn is φ(v0/v0, v1/S (0), ..., vm/S (0), vm+1/v1, ..., vn/vn−m)(v0/S (0), v1/S (0), ..., vn−m/S (0)).

I.e.

n+1 Sub (#φ, Num(y), Num(x1), ..., Num(xn)) m+1 n+1 is Sub (Sub (#φ, #v0, Num(x1), ..., Num(xm), #v1, ..., #vn−m), Num(y), Num(xm+1), ..., Num(xn)).

From this we get

m+1 n+1 The right side of (*) ' µz(PRFRA((z)0, Sub (Sub (x0, #v0, Num(x1), ..., Num(xm).#v1, ..., #vn−m), Num((z)1), Num(xm+1), ..., Num(xn))))1

n ' µz(PRFRA((z)0, PRFRA((z)0, sm(x0, ..., xm), Num((z)1), Num(xm+1), ..., Num(xn))))1

n ' Φn−m(sm(x0, ..., xm), xm+1, ..., xn). This proves the s − m − n theorem. It tells us that we can take finitely many arguments and build them into the program by fixing them. n Also notice sm is monotonic in each coordinate xi, i ∈ {1, ..., m} because if we substitute a term (numeral) with bigger code, the code of the formula after the substitution increases.

Recall: we let PRBA(x) ≡ (∃s)PRFA(s, x). We saw that if A is recursively enumerable, then so is PRBA.

4.11 Theorem:

Assume RA⊆ A ⊆Th(N) and A is recursive. Then PRBA is not recursive.

15 Why: If PRBA were recursive then for every partial recursive function f(x) we would have some formula φ(v0, v1, v2) such that

y = f(x) ∼ PRBA(#φ, Num(y), Num(x)).

Here we are using the fact every recursive function is representable in RA, which is the only part of the main theorem we haven’t proved yet. This would mean that dom(f) would be recursive:

x ∈ dom(f) ⇐⇒ sg(f(x)) ' 1,

So 0 (∗∗)χdom(f)(x) ' (µw < 2)PRBA(#φ , Num(w), Num(x)) where φ0 is the formula which represents the composition sg ◦ f in RA. But the right side of (*) is defined for every x ∈ N. So we can replace “'”in (∗∗) by “=.”This would mean that every partial recursive function is recursive. Contradiction. We have see that, for example, f(x) = Φ1(x, x) + 1 is not defined everywhere.

4.12 Theorem: G¨odel’s First Incompleteness Theorem If A is a recursive set of sentences such that RA⊆ A ⊆TH(N) then A is incomplete, i.e. there is a sentence σ such that A 0 σ and A 0 ¬σ. Notice at least one of σ, ¬σ is true in N.

Proof. We proved that if A is a complete recursive set of axioms then PRBA is recursive.

4.13 Proposition:

Assume A ⊆Th(N) is a set of axioms such that PRBA is recursive. Let τ be a sentence true in N. Then PRBA∪{τ} is recursive.

Proof. PRBA∪{τ}(#σ) ⇐⇒ PRBA(#τ → σ) This follows from the deduction theorem.

Looking at the contraposition: if PRBA∪{τ} is not recursive then PRBA is not recursive.

4.14 Theorem:

PRB∅ = the set of all codes of formulae provable from the axioms of predicate calculus alone.

Then PRB∅ is not recursive.

Proof. RA is finite and PRFRA is not recursive. Apply 4.13 nine times. 5. More on Incompleteness

We found a sequence Φn(x0, ..., xn) of universal partial recursive functions. From these we can get a sequence of universal recursively enumerable relations Tn(x0, ..., xn) which are of the “normal form”

∗ Tn(x0, ..., xn) ⇐⇒ (∃z)Tn (z, x0, ..., xn) where T ∗ is primitive recursive.

5.1 Definition: Diophantine relation

16 n A relation R ⊆ ( N) is Diophantine iff there is a polynomial p(x1, ..., xn, z1, ..., zm) such that

R(x1, ..., xn) ⇐⇒ (∃z1) ··· (∃zm)p(x1, ..., xn, z1, ..., zm) = 0. So obviously: any Diophantine set is recursively enumerable. 5.2 Theorem:(Dans-Putnam-Mahjansec-Robinson Every recursively enumerable relation is Diophantine.

5.3 Corollary:

There is a polynomial p(x0, ..., xn) ∈ Z[x0, ..., xn] such that the set A = {a ∈ N|p(a, x1, ..., xn) has an integral root} is not recursive. So for this polynomial p there is no algorithm that would decide if the equation p(a, x1, ..., xn) has an integral solution.

We need to finish the proof of the main theorem. Missing part:

If f(x1, ..., xn) is partial recursive, then f is Σn(N).

This is induction on complexity of f.

- Basic functions are easily seen to be definable by atmoic formulae.

- Composition: if f(~x) is of the form g(f1(~x), ..., fk(~x)) and the conclusion already holds for f1, ..., fk and g, we have Σ0 formulae φ1, ..., φk and φ such that

z = g(y1, ..., yk) ⇐⇒ (∃v)(φ(v, z, y1, ..., yk)).

Similarly

y = fi(~x) ⇐⇒ (∃u)φi(u, y, ~x).

Vk Then z = f(~x) ⇐⇒ z = g(f1(~x), ..., fk(~x)) ⇐⇒ (∃y1) ··· (∃yk)(∃u1) ··· (∃uk)(∃u)[ i=1 φi(ui, yi, ~x)∧ φ(u, z, y1, ..., yk)] which is Σ0.

- Primitive recursion. We define h(y, x1, ..., xn) by h(0, ~x) = f(~x) and h(y + 1, ~x) = g(y, h(y, ~x), ~x) where we assume that f, g are Σ1. In order to write a definition of h in a Σn−way. We have to keep track of all values h(0, ~x), ..., h(y, ~x). For this we need to code finite of numbers. But we cannot use the method we used before, because that is based on exponentiation, which in turn is defined by primitive recursion. We use the Chinese Remainder Theorem.

If ha0, ..., ak−1i is a finite sequence, find some numbers b0, ..., bk−1 that are relatively prime in pairs Q and bi > ai for all i. Then we can find some d < i

β(e, i, d) = rm(i · e + 1, d). Q So given a sequence ha0, ..., ak−1i we pick any c > max{ai}, let e = c!. Then there is d < i

ai = β(e, i, d)

for all i. This way we manage to code the sequence ha0, ..., ak−1i into a pair he, di. Now we code the pair into a single number. Let f : N × N → N be a bijection defined by

17 (m + n + 1)(m + n) op(m, n) = + m. 2 So there are functions l(x), r(x) such that l(op(m, n)) = m and r(op(m, n)) = n. G¨odel’s δ−function is defined by δ(x, i) = β(l(x), i, r(x)). And it follows from above that for any sequence ha0, ..., an−1i we can find x ∈ N such that ai = β(x, i) for all i < n.

Main point: the function δ is Σ0(N).

Proof. Exercise. One has to show that the functions rm, δ, op, l, r, are Σ0−definable first.

Let φf , φg be Σ0−formulae such that

z = f(~x) ⇐⇒ (∃u)φf (u, z, ~x)

and similarly with φg. To say “z = h(y, ~x)”we say: there is a sequence of numbers ha0, ..., ayi such that a0 = f(~x) and for every i < y,(ai+1 = h(i, ai, x)) and z = ay.

The point: say this in a Σ1 way.

(∃s)[δ(s, 0) = f(~x) ∧ (∀i < y)(δ(s, i + 1) = g(i, δ(s, i)~x)) ∧ δ(s, y) = z].

In order to see that the above formula is equivalent to Σ1 formula, we need to prove a lemma on bounded quantification:

If φ(z, y, ~x) is a Σ0 formula then the formula

(∀z < w)(∃y)φ(z, y~x)

is equivalent to a Σ1 formula. Why: to each z < w we have some yz such that φ(z, yz, ~x). The sequence hy0, ..., yw−1 is finite, so we can code it via the δ−function by some number t. So the above formula is equivalent to

(∃t)(∀z < w)(∃y < t)(y = δ(t, z) ∧ φ(z, y, ~x)).

The formulae on the right side are both Σ0. The last quantifier: y is one of the yzs so y must be smaller than t. This ends the proof for primitive recursion. - µ−operator. Exercise. Similarly as in the case of primitive recursion. Use the δ−function to keep track of f(0, ~x), ..., f(y, ~x) and this way define the least y such that f(y, ~x) = 0.

18