Elementary Recursive Function Theory

Similar documents
Elementary Recursive Function Theory

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

Universal RAM Programs and Undecidability of the Halting Problem

Computability Summary

Recursively Enumerable Languages, Turing Machines, and Decidability

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems

Lecture 5: The Halting Problem. Michael Beeson

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Comparing sizes of sets

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.

The Structure of Bull-Free Perfect Graphs

CHAPTER 4. COMPUTABILITY AND DECIDABILITY

2 A topological interlude

CS 531: Notes II. January 31, 2014

Tutorial: Computable Model Theory and Differential Algebra

(a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the

EDAA40 At home exercises 1

Computability Theory XI

Enumerations and Turing Machines

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

MITOCW watch?v=4dj1oguwtem

Generalizations of Rice s Theorem, Applicable to Executable and Non-Executable Formalisms

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

English for Computer Science

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

Notes on Turing s Theorem and Computability

Infinite locally random graphs

MA651 Topology. Lecture 4. Topological spaces 2

6c Lecture 3 & 4: April 8 & 10, 2014

Lecture 17: Continuous Functions

RAM Programs, Turing Machines, and the Partial Recursive Functions

Does this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is

Material from Recitation 1

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005

Math 170- Graph Theory Notes

Lecture 7: the quotient topology

Computer Sciences Department

3 No-Wait Job Shops with Variable Processing Times

Reducibilities relations with applications to symbolic dynamics

Reflection in the Chomsky Hierarchy

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

Lecture 7: Primitive Recursion is Turing Computable. Michael Beeson

Discrete Mathematics Lecture 4. Harper Langston New York University

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

More intensional versions of Rice s Theorem

Rice s Theorem and Enumeration

PCP and Hardness of Approximation

The generalized Schoenflies theorem

Theory of Computer Science. D2.1 Introduction. Theory of Computer Science. D2.2 LOOP Programs. D2.3 Syntactic Sugar. D2.

751 Problem Set I JWR. Due Sep 28, 2004

Introduction to Sets and Logic (MATH 1190)

Lecture 4: 3SAT and Latin Squares. 1 Partial Latin Squares Completable in Polynomial Time

Formalizing the Halting Problem in a Constructive Type Theory

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

Regular Languages (14 points) Solution: Problem 1 (6 points) Minimize the following automaton M. Show that the resulting DFA is minimal.

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

DISTINGUISHING NUMBER AND ADJACENCY PROPERTIES

Outline. Language Hierarchy

Safe Stratified Datalog With Integer Order Does not Have Syntax

Functions. How is this definition written in symbolic logic notation?

n λxy.x n y, [inc] [add] [mul] [exp] λn.λxy.x(nxy) λmn.m[inc]0 λmn.m([add]n)0 λmn.n([mul]m)1

In this section we will study problems for which we can prove that there is no algorithm solving them.

EMBEDDING INTO l n. 1 Notation and Lemmas

A Reduction of Conway s Thrackle Conjecture

Bipartite Roots of Graphs

1. [5 points each] True or False. If the question is currently open, write O or Open.

Treewidth and graph minors

ARTIN S THEOREM: FOR THE STUDENT SEMINAR

Pebble Sets in Convex Polygons

Module 11. Directed Graphs. Contents

Recursive and Recursively Enumerable Languages

CS61A Lecture 38. Robert Huang UC Berkeley April 17, 2013

On the Recursion-Theoretic Complexity of Relative Succinctness of Representations of Languages

Lecture 11 COVERING SPACES

SECTION A (40 marks)

Computer Science 236 Fall Nov. 11, 2010

By taking products of coordinate charts, we obtain charts for the Cartesian product of manifolds. Hence the Cartesian product is a manifold.

Hardness of Subgraph and Supergraph Problems in c-tournaments

Paths, Flowers and Vertex Cover

ON UNIVERSAL FUNCTIONS

Testing Isomorphism of Strongly Regular Graphs

machines. 1. INTRODUCTION

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

Complexity of Disjoint Π-Vertex Deletion for Disconnected Forbidden Subgraphs

Turing Machine Languages

Don t just read it; fight it! Ask your own questions, look for your own examples, discover your own proofs. Is the hypothesis necessary?

Lecture 1. 1 Notation

Formal semantics of loosely typed languages. Joep Verkoelen Vincent Driessen

A note on the subgraphs of the (2 )-grid

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Lecture 15: The subspace topology, Closed sets

On the subgraphs of the (2 )-grid

Chapter 6. Curves and Surfaces. 6.1 Graphs as Surfaces

CSE200: Computability and complexity Interactive proofs

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Database Theory VU , SS Codd s Theorem. Reinhard Pichler


From Theorem 8.5, page 223, we have that the intersection of a context-free language with a regular language is context-free. Therefore, the language

On the computability of graph Turing machines

Towards the Proof of the PCP Theorem

Transcription:

Chapter 6 Elementary Recursive Function Theory 6.1 Acceptable Indexings In a previous Section, we have exhibited a specific indexing of the partial recursive functions by encoding the RAM programs. Using this indexing, we showed the existence of a universal function ϕ univ and of a recursive function c, with the property that for all x, y N, ϕ c(x,y) = ϕ x ϕ y. 373

374 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY It is natural to wonder whether the same results hold if a different coding scheme is used or if a different model of computation is used, for example, Turing machines. What we are aiming at is to find some simple properties of nice coding schemes that allow one to proceed without using explicit coding schemes, as long as the above properties hold. Remarkably, such properties exist. Furthermore, any two coding schemes having these properties are equivalent in a strong sense (effectively equivalent), and so, one can pick any such coding scheme without any risk of losing anything else because the wrong coding scheme was chosen. Such coding schemes, also called indexings, or Gödel numberings, or even programming systems, are called acceptable indexings.

6.1. ACCEPTABLE INDEXINGS 375 Definition 6.1.1 An indexing of the partial recursive functions is an infinite sequence ϕ 0,ϕ 1,...,of partial recursive functions that includes all the partial recursive functions of one argument (there might be repetitions, this is why we are not using the term enumeration). An indexing is universal if it contains the partial recursive function ϕ univ such that ϕ univ (i, x) =ϕ i (x) for all i, x N. An indexing is acceptable if it is universal and if there is a total recursive function c for composition, such that for all i, j N. ϕ c(i,j) = ϕ i ϕ j A very useful property of acceptable indexings is the so-called s-m-n Theorem.

376 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Using the slightly loose notation ϕ(x 1,...,x n )for ϕ( x 1,...,x n ), the s-m-n theorem says the following. Given a function ϕ considered as having m+n arguments, if we fix the values of the first m arguments and we let the other n arguments vary, we obtain a function ψ of n arguments. Then, the index of ψ depends in a recursive fashion upon the index of ϕ and the first m arguments x 1,...,x m. We can pull the first m arguments of ϕ into the index of ψ. Theorem 6.1.2 (The s-m-n Theorem ) For any acceptable indexing ϕ 0,ϕ 1,..., there is a total recursive function s, such that, for all i, m, n 1, for all x 1,...,x m and all y 1,...,y n, we have ϕ s(i,m,x1,...,x m )(y 1,...,y n )=ϕ i (x 1,...,x m,y 1,...,y n ).

6.1. ACCEPTABLE INDEXINGS 377 As a first application of the s-m-n Theorem, we show that any two acceptable indexings are effectively inter-translatable. Theorem 6.1.3 Let ϕ 0,ϕ 1,..., be a universal indexing, and let ψ 0,ψ 1,..., be any indexing with a total recursive s-1-1 function, that is, a function s such that ψ s(i,1,x) (y) =ψ i (x, y) for all i, x, y N. Then, there is a total recursive function t such that ϕ i = ψ t(i). Using Theorem 6.1.3, if we have two acceptable indexings ϕ 0,ϕ 1,..., and ψ 0,ψ 1,..., there exist total recursive functions t and u such that for all i N. ϕ i = ψ t(i) and ψ i = ϕ u(i)

378 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Also note that if the composition function c is primitive recursive, then any s- m-n function is primitive recursive, and the translation functions are primitive recursive. Actually, a stronger result can be shown. It can be shown that for any two acceptable indexings, there exist total recursive injective and surjective translation functions. In other words, any two acceptable indexings are recursively isomorphic (Roger s isomorphism theorem). Next, we turn to algorithmically unsolvable, or undecidable, problems.

6.2. UNDECIDABLE PROBLEMS 379 6.2 Undecidable Problems We saw in Section 5.2 that the halting problem for RAM programs is undecidable. In this section, we take a slightly more general approach to study the undecidability of problems, and give some tools for resolving decidability questions. First, we prove again the undecidability of the halting problem, but this time, for any indexing of the partial recursive functions. Theorem 6.2.1 (Halting Problem, Abstract Version) Letψ 0,ψ 1,..., be any indexing of the partial recursive functions. Then, the function f defined such that { 1 if ψx (y) is defined, f(x, y) = 0 if ψ x (y) is undefined, is not recursive.

380 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Proof. Assume that f is recursive, and let g be the function defined such that g(x) =f(x, x) for all x N. Then g is also recursive. Let θ be the function defined such that { 0 if g(x) =0, θ(x) = undefined if g(x) = 1. We claim that θ is not even partial recursive. Observe that θ is such that { 0 if ψx (x) is undefined, θ(x) = undefined if ψ x (x) is defined.

6.2. UNDECIDABLE PROBLEMS 381 If θ was partial recursive, it would occur in the list as some ψ i, and we would have θ(i) =ψ i (i) =0 iff ψ i (i) is undefined, a contradiction. Therefore, f and g can t be recursive. The function g defined in the proof of Theorem 6.2.1 is the characteristic function of a set denoted as K, where K = {x ψ x (x) is defined}. The set K is an example of a set which is not recursive. Since this fact is quite important, we give the following definition.

382 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Definition 6.2.2 A subset of Σ (or a subset of N) isrecursive iff its characteristic function is a total recursive function. Using Definition 6.2.2, Theorem 6.2.1 can be restated as follows. Lemma 6.2.3 For any indexing ϕ 0,ϕ 1,... of the partial recursive functions (over Σ or N), the set K = {x ϕ x (x) is defined} is not recursive. Recursive sets allow us to define the concept of a decidable (or undecidable) problem. The idea is to generalize the situation described in Section 5.2 and Section 5.3, where a set of objects, the RAM programs, is encoded into a set of natural numbers, using a coding scheme.

6.2. UNDECIDABLE PROBLEMS 383 Definition 6.2.4 Let C be a countable set of objects, and let P be a property of objects in C. WeviewP as the set {a C P (a)}. A coding-scheme is an injective function #: C N that assigns a unique code to each object in C. The property P is decidable (relative to #) iff the set is recursive. {#(a) a C and P (a)} The property P is undecidable (relative to #) iff the set is not recursive. {#(a) a C and P (a)}

384 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Observe that the decidability of a property P of objects in C depends upon the coding scheme #. Thus, if we are cheating in using a non-effective coding scheme, we may declare that a property is decidabe even though it is not decidable in some reasonable coding scheme. Consequently, we require a coding scheme # to be effective in the following sense. Given any object a C, we can effectively (i.e.. algorithmically) determine its code #(a). Conversely, given any integer n N, we should be able to tell effectively if n is the code of some object in C, and if so, to find this object.

6.2. UNDECIDABLE PROBLEMS 385 In practice, it is always possible to describe the objects in C as strings over some (possibly complex) alphabet Σ (sets of trees, graphs, etc). For example, the equality of the partial functions ϕ x and ϕ y can be coded as the set { x, y x, y N, ϕ x = ϕ y }. We now show that most properties about programs (except the trivial ones) are undecidable. First, we show that it is undecidable whether a RAM program halts for every input. In other words, it is undecidable whether a procedure is an algorithm. We actually prove a more general fact.

386 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Lemma 6.2.5 For any acceptable indexing ϕ 0,ϕ 1,... of the partial recursive functions, the set is not recursive. TOTAL = {x ϕ x is a total function} Proof. The proof uses a technique known as reducibility. We try to reduce a set A known to be nonrecursive to TOTAL via a recursive function f: A TOTAL, so that x A iff f(x) TOTAL.

6.2. UNDECIDABLE PROBLEMS 387 If TOTAL were recursive, its characteristic function g would be recursive, and thus, the function g f would be recursive, a contradiction, since A is assumed to be nonrecursive. In the present case, we pick A = K. To find the recursive function f: K TOTAL, we use the s-m-n Theorem. Let θ be the function defined below: for all x, y N, { ϕx (x) if x K, θ(x, y) = undefined if x/ K. Note that θ does not depend on y.

388 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY The function θ is partial recursive. Indeed, we have θ(x, y) =ϕ x (x) =ϕ univ (x, x). Thus, θ has some index j, sothatθ = ϕ j, and by the s-m-n Theorem, we have ϕ s(j,1,x) (y) =ϕ j (x, y) =θ(x, y). Let f be the recursive function defined such that for all x N. Then, we have f(x) =s(j, 1,x) for all y N. { ϕx (x) if x K, ϕ f(x) (y) = undefined if x/ K

6.2. UNDECIDABLE PROBLEMS 389 Thus, observe that ϕ f(x) is a total function iff x K, thatis, x K iff f(x) TOTAL, where f is recursive. As we explained earlier, this shows that TOTAL is not recursive. The above argument can be generalized to yield a result known as Rice s Theorem. Let ϕ 0,ϕ 1,... be any indexing of the partial recursive functions, and let C be any set of partial recursive functions. We define the set P C as P C = {x N ϕ x C}.

390 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY We can view C as a property of some of the partial recursive functions. For example C = {all total recursive functions}. We say that C is nontrivial if C is neither empty nor the set of all partial recursive functions. Equivalently C is nontrivial iff P C and P C N. Theorem 6.2.6 (Rice s Theorem) For any acceptable indexing ϕ 0,ϕ 1,... of the partial recursive functions, for any set C of partial recursive functions, the set P C = {x N ϕ x C} is nonrecursive unless C is trivial.

6.2. UNDECIDABLE PROBLEMS 391 Proof. Assume that C is nontrivial. A set is recursive iff its complement is recursive (the proof is trivial). Hence, we may assume that the totally undefined function is not in C, and since C, letψ be some other function in C. We produce a recursive function f such that { ψ(y) if x K, ϕ f(x) (y) = undefined if x/ K, for all y N. We get f by using the s-m-n Theorem. Let ψ = ϕ i, and define θ as follows: θ(x, y) =ϕ univ (i, y)+(ϕ univ (x, x) ϕ univ (x, x)), where is the primitive recursive function for truncated subtraction. Clearly, θ is partial recursive, and let θ = ϕ j.

392 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY By the s-m-n Theorem, we have ϕ s(j,1,x) (y) =ϕ j (x, y) =θ(x, y) for all x, y N. Letting f be the recursive function such that by definition of θ, weget ϕ f(x) (y) =θ(x, y) = f(x) =s(j, 1,x), { ψ(y) if x K, undefined if x/ K. Thus, f is the desired reduction function.

6.2. UNDECIDABLE PROBLEMS 393 Now, we have x K iff f(x) P C, and thus, the characteristic function C K of K is equal to C P f, where C P is the characteristic function of P C. Therefore, P C is not recursive, since otherwise, K would be recursive, a contradiction. Rice s Theorem shows that all nontrivial properties of the input/output behavior of programs are undecidable! In particular, the following properties are undecidable.

394 CHAPTER 6. ELEMENTARY RECURSIVE FUNCTION THEORY Lemma 6.2.7 The following properties of partial recursive functions are undecidable. (a) A partial recursive function is a constant function. (b) Given any integer y N, isy in the range of some partial recursive function. (c) Two partial recursive functions ϕ x and ϕ y are identical. (d) A partial recursive function ϕ x is equal to a given partial recursive function ϕ a. (e) A partial recursive function yields output z on input y, for any given y, z N. (f) A partial recursive function diverges for some input. (g) A partial recursive function diverges for all input.

6.2. UNDECIDABLE PROBLEMS 395 A property may be undecidable although it is partially decidable. By partially decidable, we mean that there exists a recursive function g that enumerates the set P C = {x ϕ x C}. This means that there is a recursive function g whose range is P C. We say that P C is recursively enumerable. Indeed, g provides a recursive enumeration of P C, with possible repetitions.