













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The equivalence of general recursive and register-machine computable partial functions, providing evidence for a natural class of computable functions. It includes the enumeration theorem, which establishes a relationship between computable partial functions and the diagonal function. The document also discusses the relationship between computable partial functions and recursively enumerable sets, as well as many-one reducibility.
Typology: Papers
1 / 21
This page cannot be seen from the preview
Don't miss anything!














First of all, let’s summarize some of the results of the preceding chapters, and establish the terminology that will be used henceforth. We have seen that the class of general recursive partial functions is exactly the same as the class of register-machine computable partial functions. The fact that two such different approaches yield the same class of functions is evidence that we have here a “natural” class. The members of this class will be called computable partial functions (or recursive partial functions—the two names are both in common use). The adjective “partial” covers both the total and non- total functions; it can be omitted in cases where we know that the function is total. Church’s thesis is the assertion that the concept of being a computable partial function is the correct formalization of the informal idea of being an effectively calculable partial function. The class of computable partial functions includes all of the primitive recur- sive functions. Moreover, the class is closed under composition, the μ-operator, and definition by cases, among other things. We define a relation R on N to be a computable relation (or a recursive relation) if its characteristic function (which is always total) is a computable function. The class of computable relations includes all of the primitive recur- sive relations. Moreover, the class is closed under unions, intersections, comple- ments, and bounded quantification. Church’s thesis tells us that the concept of being a computable relation corresponds to the informal idea of being a decid- able relation. Moreover, we have found the following basic result. Enumeration theorem: For each positive n, there is an (n + 1)-place computable partial function Φ(n)^ with the property that for every n-place com- putable partial function f there exists a number e such that
Φ(n)(e, ~x) = f (~x)
for all n-tuples ~x, where ‘=’ has the usual meaning—either both sides are un- defined or they are both defined and are the same.
Consequently, we can let [e]^ be the n-place partial function defined by the equation [e](~x) = Φ(n)(e, ~x)
and obtain a complete enumeration (with repetitions)
[0], [1], [2],...
of all of the n-place computable partial functions. When n = 1, we can omit the superscript.
The enumeration theorem lets us define the “diagonal” partial function
d(x) = [x] + 1.
This is a 1-place computable partial function; its domain is the set
K = {x | [x] ↓}.
Because the diagonal function d is a computable partial function, we know that d = [[e]] for some index e. That is, [x] + 1 = d(x) = [e] for all x. In particular, taking x = e, we have [e] + 1 = d(e) = [e]. This looks like bad news; we almost have proved that 1 = 0. But remember that ‘=’ means that either both sides are defined and equal, or both sides are undefined. Here it is the latter. A modification of the argument gives us the following result:
Theorem: The diagonal function d has no extension to a computable total function. (That is, there is no computable total function f with the property that whenever d(x) is defined then f (x) = d(x).)
Proof: Suppose that [[e]] is a computable partial function extending d. (Maybe it even is d.) We will show that e /∈ dom [[e]], thereby showing that [[e]] is not total. If to the contrary e ∈ dom [[e]], then e ∈ K and d(e) ↓. But then we have
[e] = d(e) because [[e]] extends d = [e] + 1 by the definition of d
and these are defined. Hence 0 = 1, a contradiction. a
The same argument would apply to the function dˆ(x) = 1 −·^ [x]. Corollary: The set K is not a computable set. Proof: The function
f (x) =
d(x) if x ∈ K 0 if x /∈ K
is a total extension of d and therefore is not a computable function. But if K were a computable set, then f would have been a computable function (by definition by cases). a
Unsolvability of the halting problem: The relation
H = {〈x, y〉 | [x] ↓}
is not a computable relation.
Proof: We have x ∈ K ⇐⇒ 〈x, x〉 ∈ H. a
Theorem: For an m-ary relation R on N, the following conditions are equivalent: (a) The semi-characteristic function of R
cR(~x) =
1 if ~x ∈ R ↑ if ~x /∈ R
is a computable partial function. (Informally, this condition tells us that we have an effective “acceptance procedure” for R, so that R is an effectively recognizable relation.) (b) R is the domain of some computable partial function. (c) For some (m + 1)-ary computable relation Q,
~x ∈ R ⇐⇒ ∃y Q(~x, y).
(We say that R is a Σ 1 relation if this condition holds. We can think of y as providing “evidence” that ~x belongs to R.) (d) For some k and some (m + k)-ary computable relation Q,
~x ∈ R ⇐⇒ ∃y 1 · · · ∃yk Q(~x, y 1 ,... , yk).
Proof: To show equivalence of the conditions, it suffices to obtain four implications, forming a loop. But instead, we will obtain six. (a) ⇒ (b): Easy; R = dom cR. (b) ⇒ (a): c (^) dom f (~x) = 0 · f (~x) + 1. That is, whenever f is a computable partial function, then the function mapping ~x to 0 · f (~x) + 1 is a computable partial function with the same domain and with range at most { 1 }. (By the rules for composition of partial functions, a product such as 0 · f (~x) is defined only if both factors are defined.) (b) ⇒ (c): Assume that R is the domain of the computable partial function [e]. Apply the normal form theorem:
~x ∈ dom [e]^ ⇐⇒ ∃t [[e](~x) ↓ in ≤ t steps] ⇐⇒ ∃t T (n)(e, ~x, t)
This shows a bit more than (c) states: It shows that in (c) we can get Q to be not only computable but even primitive recursive. And later on, we will want to make use of this extra bit of information. (Here the “evidence” that ~x belongs to R is the time at which we discover the fact.) (c) ⇒ (b): Assume that R(~x) ⇔ ∃y Q(~x, y) and define
f (~x) = μy Q(~x, y).
Then f is a computable partial function and its domain is R. (c) ⇒ (d): Obvious.
(d) ⇒ (c): We use the following technique to “collapse quantifiers”:
∃y 1 · · · ∃yk Q(~x, y 1 ,... , yk) ⇐⇒ ∃y Q(~x, (y) 1 ,... , (y)k).
The (m + 1)-ary relation
{〈~x, y〉 | Q(~x, (y) 1 ,... , (y)k)}
is computable by the substitution property from page 218. a
If R meets the conditions listed in this theorem, we say that R is computably enumerable, abbreviated c.e., or that R is recursively enumerable, abbreviated r.e. Both the “c.e.” and the “r.e.” terminologies are in common use. When said aloud, the phrase “r.e.” is more euphonious than the phrase “c.e.” is. Church’s thesis tells us the concept of being a recursively enumerable relation corresponds to the informal idea of being a semi-decidable relation. Whenever x belong to an r.e. set We, then we can effectively verify this fact by running program number e on input x until it halts, as it eventually must. (But if x /∈ We, this procedure will run forever, leaving us waiting in vain for an answer, never sure whether to give up or to wait just a bit more.) For example, any computable relation (and by now we know many of these) is also recursively enumerable. (It might be a good idea to stop and check that for a computable relation R, each of the conditions (a)–(d) of the preceding theorem holds.) Beyond that, the set K is a recursively enumerable set, and the halting relation H is a recursively enumerable binary relation. (Right?) The enumeration theorem gives us an enumeration of the r.e. relations. That is, define W (^) e( n)= dom [e].
Then W (n) 0 ,^ W^
(n) 1 ,^ W^
(n) 2 ,^...
is a complete list (with repetitions) of all the recursively enumerable n-ary relations. As usual, when n = 1, we can omit the superscript. Thus
W 0 , W 1 , W 2 ,...
is a complete list of all the recursively enumerable sets of natural numbers. For a non-example, consider the set
K = {x | [x] ↑}.
The set K is not recursively enumerable.
Proposition: For any recursively enumerable subset We of K, we have e ∈ K \ We.
That is, whenever We ⊆ K, then the number e itself is a witness to the fact that equality does not hold. So the proposition immediately implies that K is not r.e.
graph of cK , the semi-characteristic function of K, is a non-computable binary relation, because
x ∈ K ⇐⇒ 〈x, 1 〉 ∈ the graph of cK.
Proof: In one direction, assume that f is a partial function whose graph is the Σ 1 relation {〈~x, y〉 | ∃z R(~x, y, z)}
where R is a computable relation. Then given ~x, we need a “two-dimensional” search: we want to locate both the answer y and the evidence z. The μ-operator does the search; the dimensionality is easy to deal with:
f (~x) = (μt R(~x, (t) 0 , (t) 1 )) 0
That is, we search for y and z, and then we ignore z and return y. This equation shows that f is a computable partial function. In the other direction, consider the computable partial function [e]. We apply the normal form theorem:
〈~x, y〉 ∈ the graph of [e]^ ⇐⇒ ∃t[[e](~x) = y in ≤ t steps] ⇐⇒ ∃t[T (n)(e, ~x, t) & ((snap(e, ~x, t) 1 ))∗ 0 = y]
Observe that this relation is Σ 1. a
In the foregoing proof, we have made use of the fact that
T (n)(e, ~x, t) & ((snap(e, ~x, t) 1 ))∗ 0 = y
is a primitive recursive condition on e, ~x, t, y that says “[e](~x) = y in ≤ t steps.” The fact that this condition is primitive recursive will be useful later, as well.
We know that the domain of a computable partial function is r.e. The same is true of the range:
Theorem: The range of any computable partial function is a recursively enumerable subset of N.
Proof 1: The range of a function f is the set
{y | ∃~x 〈~x, y〉 ∈ the graph of f }.
By the preceding theorem, we can express the graph of f as a Σ 1 relation
{〈~x, y〉 | ∃t Q(~x, y, t)}
where Q is a computable relation. Then
y ∈ ran f ⇐⇒ ∃~x ∃t Q(~x, y, t)
which shows that the range is r.e. a
Proof 2: The same argument can be condensed into one line:
y ∈ ran f ⇐⇒ ∃~x ∃t[f (~x) = y in ≤ t steps].
a
What is especially “enumerable” about recursively enumerable sets? The following theorem (which also provides a converse to the preceding theorem) gives an answer.
Theorem: A subset of N is recursively enumerable if and only if it either is empty or is the range of a total computable 1-place function.
Proof: In one direction, the preceding theorem applies: The range of a total computable 1-place function is r.e., as is the range of any computable partial function. And the empty set is both computable and recursively enumerable. It is the other direction that requires proof. Assume that A is a non-empty computable enumerable subset of N; say c is some particular member of A. Then A is Σ 1 ; say x ∈ A ⇐⇒ ∃y Q(x, y)
for computable Q. Then a two-place function with range equal to A is the function f 2 :
f 2 (x, y) =
x if Q(x, y) c otherwise But we want a one-place function. Define
f (t) =
(t) 0 if Q((t) 0 , (t) 1 ) c otherwise.
(Informally, if t says to us, “I have found a member of A and here it is and here is the evidence,” then we act accordingly.) Then f is a total computable function (by definition-by-cases) and its range is A. In fact, because we can get Q to be primitive recursive, we can get f to be a primitive recursive function. (In particular, this shows that the range of a primitive recursive function need not be a primitive recursive set, or even a computable set.) a
In this theorem (in the more interesting direction), we have
A = {f (0), f (1), f (2),.. .}.
That is, the function f gives us an effective enumeration of the set A. (Julia Robinson suggested using the word “listable” instead of “enumerable.”) It is not, in general, possible to get f to enumerate the members of A in increasing order, unless A is computable. (See the exercises.) The preceding theorems show that
ran [[0]], ran [[1]], ran [[2]],...
as we coded programs by numbers. Suppose that we have formalized a notion of “proof of totality” in such a way that the following two assumptions are met.
{(y, z) | z codes a proof that program y is total}
is recursively enumerable. (The idea behind this assumption is that if a proof is to convince someone, then that person must be able to verify the proof in an effective way.)
Then apply the theorem to the set
B = {y | ∃z(z codes a proof that program y is total)}
of provably total programs. By the first assumption, B ⊆ Tot. By the second assumption, B is recursively enumerable. We conclude that there exist total computable functions such that no programs for those functions are provably total! (The fact that Tot is not r.e. implies that some total programs are not provably total. The result here is stronger. It states that there are computable total functions all of whose programs fail to be provably total.) There is a connection here to G¨odel’s incompleteness theorem, which we will encounter in Chapter 5.
Next we want to show that the class of recursively enumerable relations is closed under substitution of computable functions.
Proposition: (a) If A is a recursively enumerable subset of N and f is a total computable function, then {x | f (x) ∈ A} is also recursively enumerable. (b) If R is a recursively enumerable n-ary relation and f 1 ,... , fn are total computable m-place functions, then the m-ary relation
{~x | R(f 1 (~x),... , fn(~x))}
is also recursively enumerable.
In fact, the functions here do not even need to be total, if, for example, {x | f (x) ∈ A} is understood as the set of x’s for which f (x) is defined and belongs to A. So let’s restate the proposition of greater generality. We write “f (x) ↓” to indicate that f (x) is defined (i.e., x ∈ dom f ).
Proposition: (a) If A is a recursively enumerable subset of N and f is a computable partial function, then {x | f (x) ↓ and f (x) ∈ A} is also recursively enumerable. (b) If R is a recursively enumerable n-ary relation and f 1 ,... , fn are com- putable partial m-place functions, then the m-ary relation
{~x | 〈f 1 (~x),... , fn(~x)〉 ↓ and belongs to R}
is also recursively enumerable.
Proof: (b) We know that the semi-characteristic function cR of R is a com- putable partial function. The semi-characteristic function of the new relation is ~x 7 → cR(f 1 (~x),... , fn(~x))
which is a composition of computable partial functions. a
But note that for a computable set A and a computable partial function f , the set {x | f (x) ↓ and f (x) ∈ A} is not computable in general. For example, if A = N, then this set is simply the domain of f , which might not be computable. For a computable relation Q and a computable partial function g, we have seen that the partial function gQ^ defined by cases
gQ(~x) =
g(~x) if ~x ∈ Q 0 if ~x /∈ Q
is again a computable partial function. If we weaken the assumption on Q to assume only that Q is recursively enumerable, then gQ^ might fail to be a computable partial function (for example, if Q = K and g(x) = 1). But we do have the following result.
Proposition (Definition by semi-cases): Assume that g is a computable partial n-place function and Q is a recursively enumerable n-ary relation. Then the function
(g Q)(~x) =
g(~x) if ~x ∈ Q ↑ if ~x /∈ Q
is a computable partial function.
Note that (g Q)(~x) is undefined unless both ~x ∈ Q and g(~x) ↓. Informally, the procedure for computing (g Q)(~x) involves first trying to verify that ~x ∈ Q, and then computing g(~x).
Proof 1: (g Q)(~x) = g(~x) + 0 · cQ(~x). a
Proof 2: (g Q)(~x) = y ⇔ ~x ∈ Q & g(~x) = y, so the graph of g Q is the intersection of two (n + 1)-ary r.e. relations a
All of the non-computable sets are non-computable, but some are more non- computable than others. One way to make sense out of that statement is to look at ways in which membership questions about one set might be “reduced” to membership questions about another. More specifically, for sets A and B of natural numbers, we say that A is many-one reducible to B (in symbols, A ≤m B) if there exists some total com- putable function such that
x ∈ A ⇐⇒ f (x) ∈ B
n∈N
Wf (n)
is recursively enumerable. (That is, a computably indexed union of r.e. sets is r.e.)
Next we want to turn our attention to the subject of calculating programs. That is, suppose we want a program that will meet some particular need. Possi- bly we have good reason to know that a program exists that meets the need. But we might want more than that; we might want actually to find such a program. For example, we know that every total constant function is computable. (As noted in item 2 in Chapter 2, every such function is primitive recursive.) But even more is true. Given a constant k, we can actually compute an index of the one-place function that is constantly equal to k. See Exercise 4 in Chapter 3. For another example, we have seen recently that the range of any computable partial 1-place function [[e]] is an r.e. set, and therefore is Wy for some y. That is, there exists some index y of a function whose domain is the set we want. But a stronger fact is true: Given e, we can actually compute such a number y. (We will see a proof of this later.) That is, there is a computable function f such that ran [[e]] = Wf (e)
for every e. For a third example, suppose we have a two-place computable partial func- tion f. Then clearly the one-place function g obtained by holding the second variable fixed as a parameter, say
g(x) = f (x, 3),
is a computable partial function; we have merely applied composition with a computable (and constant) function. Or in terms of register machines, we can make a program for g that increments register 2 three times, and then follows the program for f. But by standing back and looking at the previous paragraph, we perceive a more subtle fact. We were able to find explicitly a program for g, given the parameter 3 and a program for f. So there should be a computable function ρ that, given an index e for f and given the parameter 3, will compute an index of the function g: f (x, 3) = [ρ(e, 3)]
Not only does there exist a program to compute g, but, given the parameter 3, we can actually lay our hands on such a program.
Parameter theorem: There is a primitive recursive function ρ such that the equation [e](x, y) = [ρ(e, y)]
holds for all e, x, and y. (Here equality has the usual meaning: either both sides are undefined, or both sides are defined and are the same.) Moreover, ρ is one-to-one.
The idea is that if we have a computable partial two-place function [e] and we want to hold the last variable fixed as a parameter, then ρ will actually calculate an index for the resulting one-place function.
holds. The function ρ is one-to-one, because different values of e and y will result in different programs, and hence different G¨odel numbers. a
As an example of an application of the parameter theorem, we can “uni- formize” an earlier result. We have seen that the range of any computable partial function [[r]] is an r.e. set. The “uniformized” version of this statement is that there is some total computable (in fact primitive recursive) function f such that ran [[r]] = Wf (r)
for every r. That is, the function f goes out and finds an r.e. index for the range of [[r]]. We know that
y ∈ ran [[r]] ⇐⇒ ∃x[r] = y ⇐⇒ ∃x∃t[r] = y in t steps.
Look at the function that searches for x and t here:
g(y, r) = μs[[[r]]((s) 0 ) = y in (s) 1 steps].
Then g is a computable partial function, so it is [e]^ for some e. Parameterize out r:
[ρ(e, r)] = [e](y, r) = g(y, r) = μs[[[r]]((s) 0 ) = y in (s) 1 steps].
This quantity is defined if and only if there is some s to be found, which happens if and only if y ∈ ran [[r]]. That is,
ran [[r]] = Wρ(e,r)
which is what we wanted.
Here is another application of the parameter theorem: Lemma: Assume that S is an r.e. set of natural numbers, and that f is a computable partial one-place function. Then there is a one-to-one primitive recursive function g such that for any y: (i) If y ∈ S, then [[g(y)]] is the partial function f. (ii) If y /∈ S, then [[g(y)]] is the empty function, that is, the function that is undefined for all inputs.
So the function g produces indices of functions. In fact, g(y) is an index either for f or for the empty function. And which is these two alternatives occurs is determined by whether or not y ∈ S. The proof involves looking at the two-place partial function
h(x, y) =
f (x) if y ∈ S ↑ if y /∈ S
which can be computed by the one-line instruction,
“First verify that y ∈ S and secondly find f (x).”
The point is that given y, we can effectively find the above one-line instruction. There is a primitive recursive function that, given y, produces the above line with the value y filled in. The actual proof cleans this argument up.
Proof: Applying definition by semi-cases, we obtain a two-place computable partial function h:
h(x, y) =
f (x) if y ∈ S ↑ if y /∈ S
So h is [e]^ for some number e. Now parameterize out the y. We get
[ρ(e, y)] = [e](x, y) =
f (x) if y ∈ S ↑ if y /∈ S.
Now let g(y) = ρ(e, y) for this number e. Then g is primitive recursive, one-to- one, and
[g(y)] = [ρ(e, y)] =
f (x) if y ∈ S ↑ if y /∈ S.
Thus the partial function [[g(y)]] either is f (if y ∈ S) or else is the empty func- tion (if y /∈ S). a
Application: We can show that K ≤m Tot. In the lemma, take S to K and take f to the identity function I^11 (or any total computable function). We obtain a primitive recursive function g such that whenever y ∈ K then g(y) ∈ Tot, because g(y) is an index of the total function I 11. And whenever y /∈ K then g(y) ∈/ Tot, because g(y) is an index of the empty function, which is certainly not total. It follows that K ≤m Tot under this function g. And so automatically K ≤m Tot under the same function. Consequently, Tot is not recursively enumerable. (We saw earlier that Tot itself is not recursively enumerable.) Similarly, the set of indices of the empty function
{e | [[e]] is empty} = {e | We = ∅}
is not recursively enumerable, because K is many-one reducible to it by the same function g.
Application: We can show that S ≤m K for any r.e. set S. Apply the lemma where f again is I 11 or some other total computable function. We obtain a one-to-one primitive recursive function g such that for any y,
y ∈ S ⇒ [[g(y)]] total ⇒ g(y) ∈ K y /∈ S ⇒ [[g(y)]] empty ⇒ g(y) ∈/ K.
Thus S ≤m K under g.
The property we need h to satisfy is
[h(x, y)] = [x]
for all t. So look at the right-hand side as a function all the variables: it is a computable partial function of t, x, and y. So there is some e for which
[e](t, x, y) = [x]
for all t, x, and y. We proceed to parameterize out the x and y:
[e](t, x, y) = [ρ 12 (e, x, y)].
So we can take h(x, y) = ρ 12 (e, x, y) for this e. Then h is a primitive recursive function. The following result was published by H. Gordon Rice in 1953. Rice’s theorem: Let C be a set of one-place computable partial functions and let IC = {e | [[e]] ∈ C} be the set of all indices of members of C. Then IC is non-computable except in the two trivial cases: C = ∅ (in which case IC = ∅) or C is the set of all one-place computable partial functions (in which case IC = N).
Proof: First we look to see where the empty function (the function that is undefined everywhere), call it ∅, is. Case I: The empty function ∅ is not in C. We are given that C has some function in it; say ψ ∈ C. We can apply a recent lemma to obtain a computable total function g with the following properties: (i) Whenever y ∈ K, then [[g(y)]] is the function ψ. (ii) Whenever y /∈ K, then [[g(y)]] is the empty function ∅. Then K ≤m IC under the function g:
y ∈ K ⇐⇒ g(y) ∈ IC
Hence IC is not computable. Case II: The empty function ∅ is in C. We proceed much as before. We are given that not everything is in C; say ψ is a computable partial function not in C. As before, we can get a computable total function g with the following properties: (i) Whenever y ∈ K, then [[g(y)]] is the function ψ. (ii) Whenever y ∈ K, then [[g(y)]] is the empty function ∅. Then K ≤m IC under the function g:
y ∈ K ⇐⇒ g(y) ∈ IC
Hence IC is not recursively enumerable. a
For example, suppose we focus attention on a particular computable func- tion, such as the doubling function x 7 → 2 x. The doubling function can be
computed by a very simple program, but it is also computed by some convo- luted programs. Rice’s theorem tells us that we cannot always decide of a given number whether it is an index of the doubling function or not. (And in partic- ular, this shows that the doubling function has infinitely many indices, which is not surprising.) For another example, Rice’s theorem shows that
{x | Wx is the set of primes}
is not computable. We take C to be the set of computable partial functions f for which dom f is the set of primes.
Another consequence of the parameter theorem is the following result, which is due to Kleene.
Recursion theorem: For any computable partial function g, we can find an e such that [e] = g(e, x)
for all x.
Again, x can the replaced by an n-tuple ~x. The proof of the recursion theorem is very like the argument generally used in logic to prove G¨odel’s in- completeness theorem. We will not pursue any of these topics right now.
Exercises
[h(x, y)] = [x] · [y]
holds for all t, x and y.
Wg(x,y) = Wx ∪ Wy
for all x and y.
{t | [t] = 0} ≤m {y | [y] = 7}.
〈x, y〉 ∈ Q ⇐⇒ [[x]] and [[y]] are the same function