<<

6.5. The Theorem The Recursion . . . The recursion Theorem, due to Kleene, is a fundamental result in recursion Extended Rice . . . . Creative and . . .

Theorem 6.5.1 (Recursion Theorem, Version 1) Let ϕ0, ϕ1,... be any acceptable indexing of the partial recursive functions. For every total re- cursive f, there is some n such that

ϕn = ϕf(n). Home Page

Title Page

The recursion Theorem can be strengthened as follows: JJ II

Theorem 6.5.2 (Recursion Theorem, Version 2) Let ϕ0, ϕ1,... be any J I acceptable indexing of the partial recursive functions. There is a total Page 388 of 405 recursive function h such that for all x ∈ N, if ϕx is total, then Go Back

ϕϕx(h(x)) = ϕh(x). Full Screen

Close

Quit A third version of the recursion Theorem is given below. The Recursion . . . Theorem 6.5.3 (Recursion Theorem, Version 3) For all n ≥ 1, there is Extended Rice . . . a total recursive function h of n + 1 , such that for all x ∈ , if N Creative and . . . ϕx is a total recursive function of n + 1 arguments, then

ϕϕx(h(x,x1,...,xn),x1,...,xn) = ϕh(x,x1,...,xn), for all x1, . . . , xn ∈ N. Home Page

As a first application of the recursion theorem, we can show that there is Title Page an index n such that ϕn is the constant function with output n. JJ II

J I Loosely speaking, ϕn prints its own name. Let f be the recursive function such that Page 389 of 405 f(x, y) = x Go Back for all x, y ∈ N. Full Screen

Close

Quit By the s-m-n Theorem, there is a recursive function g such that The Recursion . . . ϕg(x)(y) = f(x, y) = x Extended Rice . . . Creative and . . . for all x, y ∈ N.

By the recursion Theorem 6.5.1, there is some n such that

ϕg(n) = ϕn, Home Page the constant function with value n. Title Page

As a second application, we get a very short of Rice’s Theorem. JJ II

J I Let C be such that PC 6= ∅ and PC 6= N, and let j ∈ PC and k ∈ N − PC . Page 390 of 405

Go Back

Full Screen

Close

Quit Define the function f as follows: The Recursion . . .  j if x∈ / P , f(x) = C Extended Rice . . . k if x ∈ PC , Creative and . . .

If PC is recursive, then f is recursive. By the recursion Theorem 6.5.1, there is some n such that ϕf(n) = ϕn. Home Page

Title Page But then, we have n ∈ PC iff f(n) ∈/ PC JJ II by definition of f, and thus, J I

ϕf(n) 6= ϕn, Page 391 of 405 a . Go Back

Full Screen

Hence, PC is not recursive. Close

As a third application, we have the following Lemma: Quit The Recursion . . . Lemma 6.5.4 Let C be a of partial recursive functions and let Extended Rice . . . Creative and . . . A = {x ∈ N | ϕx ∈ C}. The set A is not reducible to its complement A.

The recursion Theorem can also be used to show that functions defined by recursive definitions other than primitive recursion are partial recursive. Home Page

This is the case for the function known as Ackermann’s function, defined Title Page recursively as follows: JJ II

f(0, y) = y + 1, J I

f(x + 1, 0) = f(x, 1), Page 392 of 405 f(x + 1, y + 1) = f(x, f(x + 1, y)). Go Back It can be shown that this function is not primitive recursive. Intuitively, Full Screen it outgrows all primitive recursive functions. Close

Quit However, f is recursive, but this is not so obvious. The Recursion . . . We can use the recursion Theorem to prove that f is recursive. Consider Extended Rice . . . the following definition by cases: Creative and . . .

g(n, 0, y) = y + 1,

g(n, x + 1, 0) = ϕuniv(n, x, 1),

g(n, x + 1, y + 1) = ϕuniv(n, x, ϕuniv(n, x + 1, y)). Home Page Clearly, g is partial recursive. By the s-m-n Theorem, there is a recursive Title Page function h such that ϕh(n)(x, y) = g(n, x, y). JJ II

J I By the recursion Theorem, there is an m such that Page 393 of 405 ϕ = ϕ . h(m) m Go Back

Full Screen

Therefore, the partial recursive function ϕm(x, y) satisfies the definition of Close Ackermann’s function.

Quit We showed in a previous Section that ϕm(x, y) is a total function, and thus, Ackermann’s function is a total recursive function. The Recursion . . . Extended Rice . . . Hence, the recursion Theorem justifies the use of certain recursive defini- Creative and . . . tions. However, note that there are some recursive definition that are only satisfied by the completely undefined function.

In the next Section, we prove the extended Rice Theorem. Home Page

Title Page

JJ II

J I

Page 394 of 405

Go Back

Full Screen

Close

Quit 6.6. Extended Rice Theorem The Recursion . . . The extended Rice Theorem characterizes the sets of partial recursive func- Extended Rice . . . tions C such that PC is r.e. Creative and . . .

First, we need to discuss a way of indexing the partial recursive functions that have a finite domain.

Using the uniform projection function Π, we define the primitive recursive Home Page function F such that Title Page F (x, y) = Π(y + 1, Π (x) + 1, Π (x)). 1 2 JJ II

J I We also define the sequence of partial functions P ,P ,... as follows: 0 1 Page 395 of 405 n F (x, y) − 1 if 0 < F (x, y) and y < Π (x) + 1, P (y) = 1 Go Back x undefined otherwise. Full Screen

Close

Quit The Recursion . . . Lemma 6.6.1 Every Px is a partial recursive function with finite domain, Extended Rice . . . and every partial recursive function with finite domain is equal to some P . x Creative and . . .

The easy part of the extended Rice Theorem is the following lemma:

Recall that given any two partial functions f: A → B and g: A → B, we Home Page say that g extends f iff f ⊆ g, which means that g(x) is defined whenever f(x) is defined, and if so, g(x) = f(x). Title Page

JJ II

J I Lemma 6.6.2 Let C be a set of partial recursive functions. If there is an Page 396 of 405 r.e. set A such that, ϕx ∈ C iff there is some y ∈ A such that ϕx extends P , then P = {x | ϕ ∈ C} is r.e. y C x Go Back

Full Screen

Close

Quit Proof . Lemma 6.6.2 can be restated as The Recursion . . . PC = {x | ∃y ∈ A, Py ⊆ ϕx}. Extended Rice . . . Creative and . . . If A is empty, so is PC , and PC is r.e.

Otherwise, let f be a recursive function such that

A = range(f). Home Page

Title Page Let ψ be the following partial recursive function: JJ II n Π (z) if P ⊆ ϕ , ψ(z) = 1 f(Π2(z)) Π1(z) undefined otherwise. J I

Page 397 of 405

Go Back

Full Screen

Close

Quit It is clear that PC = range(ψ). The Recursion . . . Extended Rice . . . Creative and . . . To see that ψ is partial recursive, write ψ(z) as follows:  Π1(z) if ∀w ≤ Π1(f(Π2(z)))  ψ(z) = [F (f(Π2(z)), w) > 0 ⊃ ϕ (w) = F (f(Π (z)), w) − 1],  Π1(z) 2 undefined otherwise. Home Page

Title Page

JJ II

J I

Page 398 of 405

Go Back

Full Screen

Close

Quit To establish the converse of Lemma 6.6.2, we need two Lemmas. The Recursion . . . Extended Rice . . . Creative and . . . Lemma 6.6.3 If PC is r.e. and ϕ ∈ C, then there is some Py ⊆ ϕ such that Py ∈ C.

As a corollary of Lemma 6.6.3, we note that TOTAL is not r.e. Home Page

Lemma 6.6.4 If PC is r.e., ϕ ∈ C, and ϕ ⊆ ψ, where ψ is a partial Title Page recursive function, then ψ ∈ C. JJ II

J I Observe that Lemma 6.6.4 yields a new proof that TOTAL is not r.e. Finally, we can prove the extended Rice Theorem. Page 399 of 405

Go Back

Full Screen

Close

Quit The Recursion . . . Theorem 6.6.5 (Extended Rice Theorem) The set PC is r.e. iff there is Extended Rice . . . an r.e. set A such that Creative and . . .

ϕx ∈ C iff ∃y ∈ A (Py ⊆ ϕx).

Proof . Let PC = dom(ϕi). Using the s-m-n Theorem, there is a recursive function k such that Home Page

ϕk(y) = Py Title Page for all y ∈ N. JJ II

Define the r.e. set A such that J I

Page 400 of 405 A = dom(ϕi ◦ k). Go Back

Full Screen

Close

Quit Then, y ∈ A iff ϕi(k(y)) ↓ iff Py ∈ C. The Recursion . . . Extended Rice . . . Creative and . . . Next, using Lemma 6.6.3 and Lemma 6.6.4, it is easy to see that

ϕx ∈ C iff ∃y ∈ A (Py ⊆ ϕx).

Home Page

Title Page

JJ II

J I

Page 401 of 405

Go Back

Full Screen

Close

Quit 6.7. Creative and Productive Sets The Recursion . . . In this section, we discuss some special sets that have important applica- Extended Rice . . . tions in : creative and productive sets. Creative and . . .

The concepts to be described are illustrated by the following situation: Assume that Wx ⊆ K

Home Page for some x ∈ N.

Title Page We claim that x ∈ K − Wx. JJ II

J I

Indeed, if x ∈ Wx, then ϕx(x) is defined, and by definition of K, we get Page 402 of 405 x∈ / K, a contradiction. Go Back

Therefore, ϕx(x) must be undefined, that is, Full Screen

x ∈ K − Wx. Close

Quit The above situation can be generalized as follows. The Recursion . . . Extended Rice . . . Creative and . . . Definition 6.7.1 A set A is productive iff there is a total recursive func- tion f such that

if Wx ⊆ A then f(x) ∈ A − Wx

Home Page for all x ∈ N. The function f is called the productive function of A. A set A is creative if it is r.e. and if its complement A is productive. Title Page

JJ II As we just showed, K is creative and K is productive. The following are immediate conequences of the definition: J I

Page 403 of 405 (1) A productive set is not r.e. Go Back

(2) A creative set is not recursive. Full Screen

Close

Quit Creative and productive sets arise in logic. The Recursion . . . The set of theorems of a logical theory is often creative. For example, the Extended Rice . . . set of theorems in Peano’s arithmetic is creative. This yields incomplete- Creative and . . . ness results.

Lemma 6.7.2 If a set A is productive, then it has an infinite r.e. . Home Page

Title Page Another important property of productive sets is the following: JJ II

J I

Lemma 6.7.3 If a set A is productive, then K ≤ A. Page 404 of 405

Go Back

Full Screen

Close

Quit Using Lemma 6.7.3, the following results can be shown: The Recursion . . . Extended Rice . . . Creative and . . . Lemma 6.7.4 The following facts hold:

(1) If A is productive and A ≤ B, then B is productive.

(2) A is creative iff A is equivalent to K. Home Page

Title Page (3) A is creative iff A is complete, JJ II

J I

Page 405 of 405

Go Back

Full Screen

Close

Quit