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 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 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 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

Lemma 2: Rec Dec ✓ Proof: Let R Nk be a recursive relation. We need only show that a 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

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

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 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.

Definition 4: (Universal relations) For sets A, B, and R A B, for any a A,defineR(a)= b B : ✓ ⇥ 2 { 2 (a, b) R . Let (Nk) be a class of k-ary relations. We say relation U Nk+1 is universal for if for 2 } C✓P ⇢ C every R there is an e N such that R = U(e). 2C 2

3 Lemma 5: For every k,thereisa⌃0 relation U (k) Nk+1 that is universal for the k-ary recursive relations. 1 ✓ The construction of such a relation would require a fairly lengthy detour into first order logic, so I will omit it. However, assuming its existence, we get the following results:

Lemma 6: For every k, U (k) is not recursive.

Proof: Suppose U (k) were recursive. Then its anti-diagonal D Nk defined by D = (a, . . . , a): U (k)(a, . . . , a) would be recursive as well. Since U (k) is universal✓ for k-ary recursive relations,{ there ¬ } is an a N such that D = U (k)(a). Thus U (k)(a, . . . , a) D(a, . . . , a) U (k)(a, . . . , a). This is a 2 (k) ¬ () () contradiction, so U is not recursive. ⌅

Lemma 7: For every k, U (k) is a ⇧0 relation, and it is universal for the k-ary recursive relations. ¬ 1 Proof: U (k) ⌃0 so U (k) ⇧0. Let R Rec.SinceRec is closed under complements, R Rec.Then 2 1 ¬ 2 1 2 ¬ 2 there is an e N such that R = U (k)(e). Thus, R = (U (k)(e)) = ( U (k))(e), so we have found the needed 2 ¬ ¬ ¬ e. ⌅

Since U (k) is universal for recursive relations, as in Lemma 6, it cannot be recursive. ¬ 0 0 0 0 Corollary 1: 1 ( ⌃1 and 1 ( ⇧1.

Proof: The inclusions hold by definition, and the universal relations of Lemmas 6 and 7 stand as examples of the strictness. ⌅

Finally, we can build the Arithmetical Hierarchy.

k 0 0 Definition 5: (Arithmetical Hierarchy) For n>1, a relation A N is said to be ⌃n if there is a ⇧n 1 k+1 k ✓ 0 relation R N such that for all a N , a A yR(a, y). We also call the class of all ⌃n relations 0 ✓ 2 2 () 9 ⌃n. For any n,let⇧0 = R : R ⌃0 and let 0 =⌃0 ⇧0 . n {¬ 2 n} n n \ n As with the polynomial hierarchy, we can view these classes as having n alternating quantifiers in front of a recursive relation. However, unlike the polynomial hierarchy, we have a proof of the following:

0 0 0 0 0 0 Theorem 4: For all n,n ( ⌃n ( n+1 and n ( ⇧n ( n+1. Thus, the Arithmetical Hierarchy does not collapse.

0 0 0 0 0 0 Proof: n ⌃n by definition. ⌃n ⌃n+1 and ⌃n ⇧n+1 since we can add dummy quantifiers, so 0 0 ✓ ✓ ✓ ⌃n n+1. We note (unfortunately without proof) that the construction of the universal relations allows ✓ 0 0 us to similarly define, for any n,a⌃n relation that is universal for n. By the same diagonalization 0 0 0 argument as in Lemma 6, we can show that this universal relation is not in n, and thus ⌃n ( n.Sowe have 0 ( ⌃0 0 . n n ✓ n+1 Similarly, we can show that 0 ( ⇧0 0 . The remaining strictness is all that is left to show. n n ✓ n+1 0 0 0 0 0 0 0 0 Suppose ⌃n =n+1.Then⇧n ⌃n, and thus ⇧n =n which is a contradiction. So ⌃n ( n+1. Similarly 0 0 ✓ ⇧n ( n+1.

Therefore, the Arithmetical Hierarchy does not collapse. ⌅

4