Recursive Functions and the Arithmetical Hierarchy
Total Page:16
File Type:pdf, Size:1020Kb
Tom Bogue, tbogue2 CS 579 Final Project Recursive Functions and the Arithmetical Hierarchy In this presentation, I will give a (very) brief introduction to the theory of recursive functions, describe the arithmetical hierarchy, and prove that it does not collapse. I will draw connections to decision theory and the polynomial hierarchy in the process. Many of the definitions, examples, and proofs I will use are thanks to Anush Tserunyan’s course notes1. Recursive Functions We will begin by defining the search operator µ: Definition 1: (Search Operator) For a relation R Nk+1, and for each a Nk,definethesearch operator ✓ 2 µx(R(a, x)) = min x N : R(a, x) holds . If, for every a Nk,thereisax N such that R(a, x) holds, we say the search is{ well-defined2 . } 2 2 This is enough to allow us now to define recursive functions. Definition 2: (Recursive Functions) Consider a function f : Nk N.Wesayf is recursive if it can be obtained inductively from the following rules: ! (1. Primitives) The following functions are recursive: Addition and multiplication, that is, + : N2 N, and : N2 N, • ! · ! 1ifx y χ : N2 N,whereχ (x, y)= • ! 0 otherwise ⇢ k k k Projections P : N N defined as P (x1,...,xk)=xi, for each i 1,...,k . • i ! i 2{ } m k (2. Composition) If g : N N and h1,...,hm : N N are all recursive functions, then so is their ! k ! composition f = g(h1,...,hm): N N,definedbyf(a)=g(h1(a),...,hm(a)). ! (3. Well-defined search) If g : Nk+1 N is recursive, and for every a Nk, there is an x N such that ! 2 2 g(a, x) = 0, then f : Nk N defined by f(a)=µx(g(a, x) = 0) is recursive. ! k k A relation R N is called recursive if its characteristic function χR : N 0, 1 is recursive. Let Rec be the class containing✓ all recursive relations. !{ } To get a feel for the power of recursive functions, we will show the following: Lemma 1.a: The relations N2 and = N2 are recursive. ✓ ✓ 2 2 Proof: χ (x, y)=χ (P2 (x, y),P1 (x, y)). χ=(x, y)=χ (x, y) χ (x, y). ⌅ ≥ · ≥ Lemma 1.b: The constant functions Ck : Nk N,definedbyCk(a)=n for all a Nk, are recursive. n ! n 2 k k+1 k k+1 k+1 Proof: By induction. C0 (a)=µx(P (a, x) = 0). Cn+1(a)=µx(χ (Cn (a, x),P (a, x)) = 0). ⌅ k+1 ≥ k+1 1http://www.math.uiuc.edu/~anush/2015F:Math570--Logic/logic_lectures.pdf particularly sections 6.C, 7.A, and 7.B 1 Lemma 1.c: If P, Q Nk are recursive relations, then so are P = Nk P and P Q = P Q. ✓ ¬ \ ^ \ k Proof: χ P (a)=χ=(χP (a),C0 (a)). χP Q(a)=χP (a) χQ(a). ⌅ ¬ ^ · Lemma 1.c shows us that Rec is closed under complementation and intersections (and thus unions.) Notice that this allows us to put any relation in the search operator as long as the search is well-defined. k+1 Lemma 1.d: (Bounded quantification) If R N is recursive, then so is Q(a, y)= x<yR(a, x). ✓ 8 Proof: χ (a, y)=(µx( R(a, x) x = y)=y). Q ¬ _ ⌅ As it turns out, in fact, Rec is exactly equal to the set of decidable languages Dec. One direction is fairly straightforward: Lemma 2: Rec Dec ✓ Proof: Let R Nk be a recursive relation. We need only show that a Turing Machine can simulate any ✓ recursive function, and thus χR. It is easy to see that a TM can simulate the primitives in rule (1). A TM can simulate composition by simulating the h1,...,hm, and then simulating the g on the results. For rule (3), we can just try increasing values for x until g(a, x) = 0. This is guaranteed to halt because the search is well-defined. ⌅ The other direction takes quite a bit more to prove. We will not see a complete proof here, only a brief sketch. The following result from Number Theory is a key player in many proofs involving recursive functions: Lemma 3: (G¨odel’s β-function) There is a recursive function β : N2 N with the property that, for every ! sequence of natural numbers (w0,...,wn), there is a w N such that for every i n, β(w, i)=wi. 2 What this means is that if w is the an encoding of a sequence, we can decode it with a recursive function. n n n We can also use it to encode sequences: consider code : N N defined as code (w0,...,wn 1)= ! − µw( i<nβ(w, i)=wi). We may wish to encode extra information such as the length of the sequence so that we decode,8 we can check that we are not trying to read past the end of the sequence. Notice that this gives us the power to encode more complicated objects as well, such as matrices of natural numbers, and graphs. Using this idea, we can sketch a proof of the following: Lemma 4: Dec Rec ✓ Proof (sketch): Let R Nk be decided by some TM M. We can encode the state machine into a single number, and we can encode✓ any state of M (finite contents of the tapes, head position, etc.) We can define a recursive transition relation δ(si,si+1) which unpacks si, si+1 and M’s state machine, and checks that si+1 is indeed the next step after si. Let Start(a, s1) be a recursive relation checking that the input tape in state s1 contains a, and let Accept(sn) and Reject(sn) be recursive relations checking if sn is an accepting or rejecting state, respectively. Then we can define χ (a) = Accept(last(µs(length(s)=n Start(a, s ) ( i δ(s ,s )) (Accept(s ) Reject(s ))))) R ^ 1 ^ 8 <n i i+1 ^ n _ n We note that the search is well-defined because M is guaranteed to halt. Thus we can simulate M with a recursive function. ⌅ Theorem 1: Rec = Dec Proof: Follows immediately from Lemmas 2 and 4. ⌅ 2 Arithmetical Hierarchy We start this section by defining the beginning of the Arithmetical Hierarchy. Definition 3: (⌃0, ⇧0, ∆0) A relation A Nk is said to be ⌃0 if there is a recursive relation R Nk+1 such 1 1 1 ✓ 1 ✓ that for all a Nk, a A yR(a, y). We also call the class of all ⌃0 relations ⌃0. 2 2 () 9 1 1 A relation A Nk is said to be ⇧0 if there is a recursive relation R Nk+1 such that for all a Nk, ✓ 1 ✓ 2 a/A yR(a, y). Equivalently, A Nk is said to be ⇧0 if there is a recursive relation R Nk+1 such 2 () 9 ✓ 1 ✓ that for all a Nk, a A yR(a, y). We call the class of such sets ⇧0. Notice that ⇧0 = A : A ⌃0 2 2 () 8 1 1 {¬ 2 1} Finally, ∆0 =⌃0 ⇧0. 1 1 \ 1 0 0 Notice here that ⌃1 is to Rec as NP is to P .⇧1 corresponds to co-NP. 0 Example: The Halting Problem is ⌃1. Proof: The Halting Problem can be stated as follows: Halt(M,a) a sequence of states of M such that the sequence starts from the state with a on the input tape, each() state 9 follows from the previous, and the last state is an accepting or rejecting one. As we saw before, the sequence of states can be represented as a 0 single number, and checking the rest of the claim is recursive. Thus the Halting Problem is ⌃1. 0 Since the Halting Problem is not decidable, this means that ⌃1 is already bigger than the class of decidable relations. In fact, it is, perhaps unsurprisingly, equal to the set of semi-decidable relations. 0 Theorem 2: ⌃1 = Semi-Dec Proof: Recall that the semi-decidable relations are recursively enumerable. Given a TM M that enumerates 0 a relation R, a R astepinM such that M outputs a. Stated this way, it is clear that R is ⌃1.On 2 () 90 the other hand, if R is ⌃1, we can enumerate it using dovetailing. ⌅ The following theorem may be surprising considering the truth of NP co-NP = P is unknown. Nonetheless, we can prove a similar claim for Rec. \ 0 Theorem 3: (Kleene’s Theorem) ∆1 = Rec. 0 k Proof: ( ) Rec ⌃1 since we can add dummy quantifiers. For example, for recursive R N , consider k◆+1 ✓ 0 ✓ R0 N defined as R0(a, y) R(a). Then R(a) yR0(a, y), so R is ⌃1. Recall from Lemma 1.c that✓Rec is closed under complementation.() Thus we have() 9 R Rec = R Rec = R ⌃0 = R ⇧0 2 )¬ 2 )¬ 2 1 ) 2 1 and so Rec ⇧0. Therefore Rec ∆0. ✓ 1 ✓ 1 ( ) Suppose R ∆0 where R Nk. Then there are recursive relations P, Q Nk+1 such that for all a Nk, ✓ 2 1 ✓ ✓ 2 a R xP (a, x) and a/R xQ(a, x). Then χR(a)=χP (a, µx((P Q)(a, x))) is recursive, and a 2 R ()χ 9 (a) = 1. So R is2 recursive,() 9 and thus ∆0 Rec. _ 2 () R 1 ✓ 0 Therefore ∆1 = Rec. ⌅ We now introduce a relation that will be key in proving the non-collapse of the arithmetical Hierarchy.