You are on page 1of 10

CS6014: Computability and Complexity

Aug 25-26, 2016

Lecture 14-15 : Quantifier Characterization of Arithmetic Hierarchy


Lecturer: Jayalal Sarma

Scribe: Jayalal Sarma

Contents
1 Introduction

14-15-1

2 Definitions

14-15-2

3 The Characterization and Corollaries

14-15-3

4 Proof of the Characterization : The Base Case

14-15-4

5 Proof of the Characterization : The 2 case

14-15-6

6 Proof of the Characterization : The Induction

14-15-9

Introduction

How does the landscape outside the set of semi-decidable languages look like? This
lecture is devoted to discuss this question. But mind-block upfront : how do even
address these languages? They dont have Turing machines accepting them.
Here is a line of thought: assume for a moment that Halting problem(HP) was decidable. This means, that entire semi-decidable languages (and their complements)
are now decidable. Are there still undecidable languages? Yes, diagonalisation is
applicable even in this setting (now enumerate all oracle Turing machines). It will
give a language HP HP which is semi-decidable (with an oracle access to HP) and is
undecidable (even with oracle access to HP). The above imagination leads us to the
notion of relative computation. To take it further, what are the languages which will
be semi-decidable now? A natural answer to this question is : the set of languages

14-15-1

which are accepted by an oracle TM with queries to HP. Let us call this set 1 . But
are there languages outside 1 ? Yes, HP HP . Suppose HP HP was decidable, are there
still undecidable and semi-decidable languages. Yes, this argument can be applied
any number of times.
These can be formalized to get a hierarchy of classes of languages outside the class of
semi-decidable languages.
0 =
1 =

The class of semi-decidable languages


The class of languages that are semi-decidable if given oracle access to 0
... and in general and more formally ..

Definitions

We will first define the oracle Turing machines in a slightly different way from what we
did in class. Formally, an oracle Turing machine can be represented by 10 components
(Q, , , , s, q? , qY , qN , t, r). There is an extra tape called the Query Tape the
contents of which is supposed to be the questions that the oracle TM asks.
Informally, the ideas is as follows. When the Turing machine wants to ask a query to
the oracel, it will write the query string (say w to the query tape and move to the
query state q? indicating the same. According to the answer (of whether the string
w is in the oracle language or not) the oracle teleports the machine to either qY or
qN . We leave it as an exercise to formalize this and also show that it is equvialent to
the oracle tape model that we described in class. For convenience we work with this
new model in this writeup.
Definition 1 (i ). For i 0, A language L i if and only if there is an oracle
Turing machine M with access to a language L0 i1 as oracle, such that L = L(M ).
Let us define:
L i L i
We prove the following quantifier characterization for the above classes of languages,
which is the main purpose of this note.

14-15-2

The Characterization and Corollaries

Theorem 2. For k 0, a language A is in k if and only if there exist another


language B k1 such that for every x ,
x A y : (x, y) B
Corollary 3. For k 0, a language A is in k if and only if there exist another
language B k1 such that for every x ,
x A y : (x, y) B
Proof. We prove the corollary first. Let A k . That is, A k . Now we apply the
above theorem. There is a B 0 in k1 such that for every x ,
x A y : (x, y) B 0
By logically negating on both sides:
x
/ A y : (x, y)
/ B0
Let B = B 0 , B k1 .
x A y : (x, y) B
Thus the corollary.
Corollary 4. For k 0, a language A is in k if and only if there exist a decidable
language B such that for every x ,
x A y1 y2 y3 . . . Qk yk : (x, y1 , y2 , y3 , . . . , yk ) B
where Qk is if k even, and if k is odd.
Proof. Let A k if and only if there exists a B k1 such that for every x ,
x A y1 : (x, y1 ) B
Now we apply the corollary3 for B k1 to get a B 0 k2 such that
(x, y1 ) B y2 : (x, y1 , y2 ) B 0
Combining the two,
x A y1 , y2 : (x, y1 , y2 ) B 0
We apply the theorem 2 to get a language B 00 k2 and then corollary 3 to get a
language B 000 k3 ... again and again (this can be turned into an inductive proof)
to get to a decidable language in the end and the quantifier form in the corollary.

14-15-3

Proof of the Characterization : The Base Case

We prove this by induction on k. The base case, the case when k = 0, will be the
following lemma.
Lemma 5. A language A is semi-decidable if and only if there exist a decidable
language B such that for every x ,
x A y : (x, y) B
Proof. () Language A is semi-decidable via a Turing machine M . The set B is
defined as:
B = {(x, y) : y is a finite string that encodes the computation history of M on input x}
It is easy to see that x L y : (x, y) B. Now we need to argue that B
is decidable. We design a total Turing machine N which, given x and y, accepts if
and only if the string y encodes the computation history of M on input x. Without
loss of generality, y can be viewed as a sequence of configurations (corresponding
to the computation history), y0 , y1 , . . . yk . Each configuration contains, a tape-head
position, the current contents of the tape (upto the leftmost blank symbol), and the
current state. N on input x and y (and knows M ) checks the following:
1. Check if y0 is the initial configuration. That is the tape contents are of the form
xB where B is the blank symbol, the head position is in the left-most position
and whether the state is the start-state of M . Note that N needs x in this step.
2. Check if yk is a halting configuration. That is if the state encoded there is the
final state.
3. Check if for all 0 i k 1, yi+1 follows from the configuration yi according
to M s transition function.
Given y, checking (1) and (2) are straightforward. To check condition (3) for each
0 i k 1, extract yi and yi+1 from y, and then check the head position at
configuration yi . If this is j, then we know that the contents of the tape can change
only at position j between yi and yi+1 . Let yi,j denote the alphabet written as position
j in the configuration yi . In yi , let qi and hi be the state and head-position respectively.
With this in mind, we rewrite (3) and write the full algorithm (algorithm 1) now.
We leave it to the reader to argue that N is a total Turing machine which accepts
(x, y) such that y corresponds to an accepting computation of M on x. This proves
that the set B is decidable.

14-15-4

Algorithm 1 Total Turing Machine for B in the base-case


Input: x, y (M is known).
Output: Accept if y = y0 , y1 . . . yk encodes the computation of M on x.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:

if ((q0 = s) (j (y0,j = xj )) h0 = 0) then


Reject (x, y).{because y0 is not the correct initial configuration.}
end if
if (qk = t) then
Reject (x, y). {because yk is not an accepting configuration.}
end if
for each i : 1 i k do
for each j : 1 j n do
if hi = j {in yi , head is at position j} then
(q 0 , b, m) = M (qi , yi,j ). {m is +1 for R and 1 for L}
if ((yi+1,j = b) (qi+1 = q 0 ) (hi+1 = hi + m)) then
Reject (x, y). {because yi 6 yi+1 }
end if
else
{Head is not at position j, so tape content should not change at j.}
If (yi+1,j = yi,j ) then Reject (x, y). {because yi 6 yi+1 }
end if
end for
end for
Accept (x, y) {All checks went through}

14-15-5

Proof of the Characterization : The 2 case

For understanding the difficulties in the induction step. Let us do the proof for 2 .
() Let there be B 1 (that is B is semi-decidable) such that x A y :
(x, y) B. We use it to prove that A 2 . We give the following Turing machine
for A, with query access to B which is in 1 . Refer algorithm 2.
Algorithm 2 TM for A given B as the oracle
Input : x
Output : Accept if x A.
Oracle : B.
1: for each y do
2:
Ask the query is (x, y) B?.
3:
Accept if answer is no, try next y otherwise.
4: end for
if there is a y such that (x, y) B, then the above algorithm will find it, and otherwise it will keep searching for the y and hence loop for ever. By the characterization
x A (x, y) B N 0 accepts x L(N ). Hence A is semi-decidable
in B 1 . Thus A 2 .
() Let A be in 2 . By definition, there is a A0 1 such that A is semi-decidable
in A0 . That is, there is an oracle TM, M which on input x makes queries to A0 and
0
accepts if and only if x A. That is, L(M A ) = A.
Attempt #1: A natural generalization of what we did in the base case (previous
section).
0

B = {(x, y) : y encodes the computation history of M A on x}


Again, it is easy to see that x L y : (x, y) B. But then we need to argue
that B k .
Remark 6. Is B decidable? Why would not Turing Machine 1 work? Indeed, the
trouble is since M is now an oracle machine, it has the query state, in addition
to the normal states. The transitions from the query state depends on the oracle
answer to the query. Hence in step 10 of the Turing machine1 we will not be able

14-15-6

to determine from M itself, the triplet (q, b, m) when if qi happens to be the query
state. To understand whether q is qY or qN (the query answer states), we need to
check whether the query tape contents in the configuration yi (let us call it i ) is in
A0 or not). Since A0 is in 1 , it is too ambitious to expect B to be decidable.
Our aim is to prove that B 1 . Can we design an oracle TM N with oracle access
to in B 0 0 (that is, decidable) such that (x, y) B N accepts (x, y). First
let us do something slightly weaker than that.
Remark 7. What can we put B in? We can put B in 1 . That is we can decide
B (using a total Oracle Turing machine N ) which has access to A0 (which is in
1 ). Indeed, if we have to design a machine for B and are given an oracle access
to A0 1 the above mind-block will be settled - and we result in a total Turing
machine N which, with oracle access to a language in 1 accepting B. Thus B 1 .
Indeed, this also means that B is decidable by a total Turing machine given oracle
access to a language in 1 . But does this mean B 1 ? And are we done? No1 !.
We need to do this with a less powerful oracle (namely a language in 0 ), but with
the relaxation that our machine now need not be total.

Attempt #2: It looks like we are not working with the right B. Remember, we have
the freedom to design B such that B 1 and that x A y, (x, y) B. Let
us add more information to B so that we can verify information about the compuation
history encoded by the string y. Whenever x A, in addition to the fact that there
0
is an accepting computation path for M A on x, we know that this path also has a
set of query answers which helps it to proceed in the computation path.
With this in mind, let us modify our set B:



y encodes the computation history of M A0 on input x
B1 = (x, y, a)
when the correct answers to the query asked during y are a.
Again it is easy to check (left as an exercise): x A (y, a) : (x, y, a) B1 .

Did it help? Can B1 be decided in 1 ? We can definitely check given the answers to
the queries, whether y encodes a valid computation history or not, but then how do
we check if the answers themselves are correct or not?
1

Here is a counter example : M P XOR can be accepted by a total TM with a query to M P 1 ,


but we know that M P XOR
/ 1 .

14-15-7

To handle the verification of the query answers, let us label the queries first. For a
configuration yi for which the state is the query state, q? , let i be the contents of
the query tape, that is, the query string that is being asked to A0 .
The set of queries could be of two kinds, the ones which gets yes answers and the
ones which gets no answers. Let us them.
P OS = {i : i A0 }
N EG = {i : i
/ A0 }
Our task now is to check membership in P OS and N EG (because if we could, then
we essentially have the query answers in hand). Given an i , checking membership
in N EG is is in 1 because i
/ A0 i A0 and A0 is in 1 . Thus i
0
N EG i A . Hence whenever, we see a NO answer to a query, there is a
machine in 1 that you can run and figure out this answer.
Checking membership in Y may not be doable directly in 1 , because A0 1 . But
here is where we apply the base case: A0 1 if and only there is a B 0 0 (that
is, decidable) such that i A0 zi : (i , zi ) B 0 . Hence i Y zi :
(i , zi ) B 0 .
Thus the vector z = z1 , z2 . . . zn (some of the zi s may be unused) form the certificates
for the i Y and these certificates along with their correpsonding zi (as the pair
(i , zi ) can be verified in 0 (that is, they can be verified by a Total Turing Machine).
Final Solution : Let us modify our B1 to include these zi s too. Thus, the new
language B2 that we work with is:

y encodes the computation history of M A0 on input x when

the correct answers to the query asked during y are



B2 = (x, y, a, z)

in the vector a, and the vector z forms the certificates

for the yes answers in a.


Again it is easy to check: x A (y, a, z) : (x, y, a, z) B2 . We show the
following claim:
Claim 8. B2 1 .
Proof. We argued essentially that the sets :



y encodes the computation history of M A0 on input x
1 = (x, y, a, z)
assuming the query answers are in the vector a

14-15-8




the no answers in a to the queries are correct.
2 = (x, y, a, z)
That is, 1 i k : (qi = q? ai = 0) i
/ A0

3 =



the yes answers in a to the queries are correct.
(x, y, a, z)
That is, 1 i k : (qi = q? ai = 1) (i , zi ) B 0 .

Notice that B2 = 1 2 3 . We have argued that the sets 1 , 2 and 3 are all
in 1 .2 . Since this implies that their intersection is also in 1 (argue this !), we have
that B2 1 .

Proof of the Characterization : The Induction

As inductive hypothesis, let us assume that the statement of Theorem2 is true for k
and we prove it for k + 1 for which we need to prove two implications.
() Let there be B k such that x A y : (x, y) B. We use it to prove
that A k+1 . We give the following Turing machine for A, with query access to
B which is in k . Refer to the algorithm 1 again. Similar to the 2 case, if there
is a y such that (x, y) B, then the above algorithm will find it, and otherwise
it will keep searching for the y and hence loop for ever. By the characterization
x A (x, y) B N 0 accepts x L(N ). Hence A is semi-decidable
in B k . Thus A k+1 .
() Let A be in k+1 . By definition, there is a A0 k such that A is semi-decidable
in A0 . That is there is an oracle TM, M which on input x makes queries to A0 and
0
accepts if and only if x A. That is, L(M A ) = A.
We will apply the thought process developed in the previous sections and directly
jump to the definition of the B.





B = (x, y, a, z)

y encodes the computation history of M A on input x when


the correct answers to the query asked during y are
in the vector a, and the vector z forms the certificates
for the yes answers in a.

In fact, 1 and 3 are decidable, 2 is in 1

14-15-9

Again it is easy to check: x A (y, a, z) : (x, y, a, z) B2 .


We show the following claim:
Claim 9. B2 k .
Proof. We argued essentially that the sets :



y encodes the computation history of M A0 on input x

1 = (x, y, a, z)
assuming the query answers are in the vector a



the no answers in a to the queries are correct.
2 = (x, y, a, z)
That is, 1 i k : (qi = q? ai = 0) i
/ A0
Since A0 k1 by induction hypothesis, there is a language in B 0 k1 such that
: i A0 if and only if (i , zi ) B 0 .


the yes answers in a to the queries are correct.


3 = (x, y, a, z) That is, 1 i k : (qi = q? ai = 1) i A0

That is, 1 i k : (qi = q? ai = 1) (i , zi ) B 0 .

Notice that B2 = 1 2 3 . We have argued that the sets 1 , 2 and 3 are all
in k .3 . Since this implies that their intersection is also in k (argue this !), we have
that B2 k .
QED(Quod Erat Demonstrandum.)

In fact, 1 is decidable, 2 is in k and 3 k1 .

14-15-10

You might also like