Notes on Recursion Theory by Yurii Khomskii

Notes on Recursion Theory by Yurii Khomskii

Notes on Recursion Theory by Yurii Khomskii This is a concise set of notes for the course Recursion Theory. It's not meant to replace any textbook, but rather as an additional guide for a better orientation in the material. {Yurii 1. Models of Computation. 1.1. Introduction. We are looking at the collection of natural numbers, denoted by N := f0; 1; 2; 3; : : : g. Consider all f : N −! N, or in general f : Nn −! N, i.e., all functions that take some natural numbers as input and likewise output a natural number. Intuitively, some of these functions are computable, that is, for a given input (x0; : : : ; xn) there is a mechanical, algorithmic process for com- puting f(x0; : : : ; xn). For example, the function f defined by f(x) := x · 2 + 5 is computable, because the following algorithm computes it: \take the input x, multiply it by 2 and then add 5, and output the result." In general, there is a huge amount of functions from Nn to N (uncountably many) and not all of them can be computable. The essential point of Recur- sion Theory is to study this notion of computability, e.g. which functions are computable, \how" computable they are etc. So far, the concept of \computability" was intuitive and, even though most of us have a good intuition about what qualifies as an algorithm, we still need to make the notion precise if we want to develop a mathematical theory about it. In other words, we need to give a formal definition capturing the intuitive notion of \algorithmically computable". As it turns out, there are many equivalent definitions of this concept, the so-called models of computation, and we shall present the main candidates in the following sections. All of these define precisely the same class of computable functions, which we will denote by Comp. Comp := ff : Nn −! N j f is computableg The postulation that the class defined by one of those mathematical for- malisms is indeed the class of functions we would intuitively call \computable", is usually called the Church-Turing Thesis. 1 Note that the class Comp may also contains partial functions, i.e., functions whose value is not defined for every x 2 N. This is an essential feature of Recursion Theory, and it is not possible to give a satisfactory definition of computability which would avoid it (otherwise one could produce a contradiction by a diagonal argument.) 1.1. Definitions and Notation. Let f be a function from Nn to N. 1. We denote a sequence (x0; : : : ; xn) by ~x. 2. If f(~x) is defined then we write f(~x) #. Otherwise we write f(~x) ". 3. The domain of f is dom(f) := f~x 2 Nn j f(~x) #g. 4. The range of f is ran(f) := fy 2 N j y = f(~x) for some ~x 2 Ng. 5. If f and g are two functions then f◦g is the function defined by (f◦g)(x) := f(g(x)). 6. A function f is total if dom(f) = N and partial otherwise. 7. If A ⊆ Nn is a set then we use the notation A for the complement of A, i.e., Nn n A. C 1.2. The Recursive Model. Our first model of computability, namely the \recursive functions"-model, is based on the mathematical notion of definitions by recursion. We divide the definition into two steps: first, we define the simpler class of primitive recursive functions, denoted by PrimRec, and later we will extend it to the class of recursive functions, denoted by Rec. 1.2. Definition. The class PrimRec of primitive recursive functions is defined by induction as follows: 1. The constant zero function f : ~x 7! 0 is primitive recursive. We will denote this function by 0. 2. The successor function S : x 7! x + 1 is primitive recursive. 3. The i-th projection function ei : (x0; : : : ; xn) 7! xi is primitive recur- sive. 4. If g; h0; : : : ; hn are primitive recursion then the substitution function f defined by f(~x) := g(h0(~x); : : : ; hn(~x)) is primitive recursive. 2 5. If g and h are primitive recursive, then f defined as follows is primitive recursive: f(~x; 0) := g(~x) f(~x; y + 1) := h(y; f(~x; y); ~x)1 In this case, f is a definition by primitive recursion based on initial function g and recursion function h. C Examples: • Suppose we want to prove that the identity function id defined by id(x) := x is primitive recursive. Simply write id = e1 and we are done. • Suppose we want to prove that the function f defined by f(x) := 3 is primitive recursive. Then we can write f = S ◦ S ◦ S ◦ 0 The equality clearly holds because for all x we have S(S(S(0)))(x) = S(S(S(0))) = S(S(1)) = S(2) = 3. And, by the inductive definition, this function is primitive recursive. • Suppose we want to prove that addition, i.e. the function mapping (x; y) to x + y, is primitive recursive. First, note that the intuitive recursion involved is the following: x + 0 = x x + (y + 1) = (x + y) + 1 Formally, then, we need the initial function g := id, and the recursion function h = S ◦ e2. Clearly, g and h are primitive recursive. But then, so is f defined by f(x; 0) := g(x) = x f(x; y + 1) := h(y; f(x; y); x) = S(f(x; y)) = f(x; y) + 1 Clearly, f is the addition function, since the formal definition corresponds precisely to the intuitive one. Note that all functions in PrimRec are total. Although many simple arith- metical functions are primitive recursive, this notion is not sufficient to formalize the intuitive concept of computability. Therefore, we expand the class of primi- tive recursive functions to the class of recursive (sometimes called µ-recursive) functions, denoted by Rec, by adding the µ-operator. 1.3. Definition. If P (x) is any predicate (relation), then µi (P (i)) is defined to be the least i 2 N such that P (i) holds. Now the class Rec is defined by induction: 1To avoid confusion, note that different textbooks use a different order here. This will be important when using projection functions: e1, e2 or e3. 3 1. If g is primitive recursive then it is recursive. 2. If g is recursive then so is f defined by f(~x) := µi[g(~x; i) = 0 ^ 8j < i [g(~x; j) #6= 0] C Essentially, the idea of point 2. above is the mathematical simulation of the following algorithm: \If g is a recursive function, compute the value of g(~x; i) for incre- menting i (i.e. i = 0, then i = 1, then i = 2 etc.) As soon as you find g(~x; i) = 0, output i." N.B. f(x) is only defined if there exists a i such that g(~x; i) = 0 and for all j < i, g(~x; j) is defined and 6= 0. This corresponds to the intuition of µ being an algorithmic process computing the value of g(~x; i) for incrementing i, which may get stuck while trying to compute an undefined value of g(~x; j). 1.3. The Turing Machine Model. Another model of computation is the Turing Machine. This is a formalism based not on an arithmetical notion like the recursive functions, but rather on the notion of an actual algorithmic process. Abstracting itself from a real computer on one hand, and a real mathematician with pen and paper on the other, it is arguably the strongest model of computation. 1.4. Definition. A Turing Machine is a device with a two-way infinite tape divided into cells, a reading and writing head and an internal finite set of states Q := fq0; q1; : : : ; qng. On the tape can be written two symbols: 0 (for \blank") or 1. The head can read one symbol at a time, write a new symbol on its place, and move left, right, or stay where it is. The actions of this machine are controlled by a Turing program, which is a finite sequence of quintuples of the following kind: (q; s; q0; s0; X) 2 Q × f0; 1g × Q × f0; 1g × fL; R; Cg Such a quintuple is interpreted as the following instruction to the Turing ma- chine: \If you are in state q and you read an s, go to state q0, write an s0, and move the head left, right, or nowhere, depending on whether X = L; R or C respectively."2 2Note that many texts give slightly different versions of the Turing machine. For example, in some cases the alphabet for the tape can consist not only of f0; 1g but all natural numbers etc. In some cases (Soares) X = C is prohibited, while in yet other presentations (Cooper) the machine can either print a new symbol or move to the right or left, in each step. These details, however, are irrelevant and it is easy to translate a program from one style to another. 4 By convention, every Turing machine starts in state q1 (the initial state) and halts if and only if it reaches state q0 (the halting state). C By convention, an input x 2 N is represented by x + 1 consecutive 1's and the output is the total number of 1's on the tape. 1.5. Definition. If T is a Turing machine then the corresponding function fT is defined as follows: N −! N f : y if on input x, T halts with output y T x 7−! " if T never halts on input x A function f is Turing computable if f = fT for a Turing machine T .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    17 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us