Computational Complexity Theory, Fall 2008 September 10 Lecture 1: Oracle Turing Machines Lecturer: Kristoffer Arnsfelt Hansen Scribe: Casper Kejlberg-Rasmussen Oracle TM Definition 1 Let A Σ. Then a Oracle Turing Machine (OTM) M is a k-tape Turing Machine with a query tape and special states q O?, q O Y es and q O No, that: runs as a usual TM, but when moving to state q O? the oracle A is consulted with query y (on a separate tape) and if y A, M is restarted at state q O Y es else at state q O No 1. Definition 2 Let B Σ be an oracle and C a class of languages. Then define P B = class of languages computed by polytime oracle TM with oracle B N P B = class of languages computed by nondeterministic polytime oracle TM with oracle B and further more define P C = B C P B N P C = B C N P B Side-Remark We say A P T B iff A PB, read A reduces to B via a polytime oracle TM with oracle B. Characterisation of PH Recap that we defined Σ P k = {L(M) M is a polytime Σ k machine} now we want to characterize Σ P k in terms of oracle TM s, which the following theorem captures. Theorem 3 Formally define N P = N P 1 and N P k+1 = N P N P k for k 1, then Σ P k = N PN P...N P = N P k Proof We are gonna make the proof by induction in k, for the base case k = 1 let L Σ P 1 definition we have R P and p a polynomial such that then by [x L p y 1 : R(x, y 1 )] L N P. So we have Σ P 1 = N P 1. The induction hypothesis is Σ P h = N P h for h k, and we are gonna prove it for k + 1. 1 Note that we always get a reply from A, that means we could also choose A to be the language deciding the halting-problem or any other language. 1
: Let L Σ P k+1, by definition we have x L p y 1 p y 2... Q p k y k+1 : R(x, y 1,..., y k+1 ), where p is polynomial and R P. Now define: L Π P k so (x, y) L p y 2 p y 3... Q p k y k+1 : R(x, y, y 2,..., y k+1 ), by the induction hypothesis L Σ P k = N P k. Now we can decide L by a nondeterministic polytime Turing machine with oracle L, that guesses y 1 and then ask the oracle L for the rest. So Σ P k+1 N P k+1. : Assume M is a polytime nondeterministic OTM with oracle N P k = Σ P k. We now want to construct a Σ k+1 -machine M that has operation: M guesses a computation path for M that leads to acceptance, all the queries that M makes on this path to acceptance is y 1,..., y m, z 1,..., z l where y i is yes-queries and z i is no-queries. M guesses the first part that means M guesses the first -quantifier for Σ k of the Σ k - verifications of the y i s. now M makes m+l universal branches that verify the z i guesses by Π k = co Σ k computation and verify the rest of the y i guesses by Π k 1 -computation. M accepts iff it s guesses for y 1,..., y m, z 1,..., z l was right, and M is accepting. Notice that all the guesses is done by the first -quantifier of the Σ k+1 machine M we are building, the universal branches is done by the first -quantifier of M, and then the rest of the computation is done by the Π k /Π k 1 machine for the oracle of M by the induction hypothesis, see figur 1. So Σ P k+1 N P k+1. M M Oracle queries Oracle guesses Accepting path Verification of queries Accepting Figure 1: 2
Alternative proof Definition 4 Let C be a complexity class and L a language, then Note that and.l = {x p y : (x, y) L}.C = {.L L C}.L = {x p y : (x, y) L}.C = {.L L C} co.c = {Σ.L L C} = {Σ {x p y : (x, y) L } L C} = {{x p y : (x, y) L } L C} = {.L L coc} =.coc..p = {.L L {.L L P}} = {..L L P} = {.{x p y : (x, y) L } L P} = {{x p y : (x, y) {(x, y) p z : ((x, y), z) L }} L P} = {{x p y p z : ((x, y), z) L } L P} = Σ P 2 and by expanding this argument with induction we have......q k.p = Σ P k. Proof [of theorem 3] Claim 1: A : N P A =.P A : The N P machine guesses the and then runs P A. : Let L = L(M A ) N P A and y 1,..., y k be the queries that M makes to the oracle. Construct M that simulates M but guesses an answer for each query y i. If M accepts we ask the oracle A of all the queries y i and accept iff i : y i A. Claim 2: A : N P.PA =..P A : The N P machine can guess the string and then use it s oracle.p A =.cop A = co.p A to answer.p A queries 2. : Let M B be a N P machine with oracle B = {x p y : D(x, y)}.p A. In..P A we use the -quantifier to: guess a accepting path p of M, the answers b 1,..., b m {0, 1} to the oracle queries w 1,..., w m along the path p and the verification certificate y i for D(w i, y i ) = 1 when b i = 1 now use -quantifier over all z i on the predicate R that is true iff i v i is true and M accepts, where: v i = D(w i, y i ) when b i = 1, and 2 This is a consequence of the fact that A an oracle: x A iff x / A. 3
v i = D(w i, z i ) when b i = 0. We now have N P.PA..P A. Now define notation N P A 1 = N P A and for k > 1, N P A k = N PN PA k 1. Claim 3: A, an oracle : N P A k (ΣP k )A. Make induction in k, claim 1 proves k = 1. Let k > 1, then N P A k+1 Claim1 Claim2 N P.PN PA k 1..P N PA k 1 ( )..(Π P k )A = (Σ P k+1 )A ( ): P N P A k 1 PN P also have P N PA k 1 (Π P k ) A. N P N IH PA k 1 (Σ P k ) A, but because P N PA k 1 is closed under complement we Here note that the in the last part collapses with the first in (Π P k 1 )A. Claim 4: A, an oracle : N P A k (ΣP k )A. Make induction in k, for k = 1 we have N P A 1 = N P A Claim 1 (Σ P by def. k+1 )A =.(Π P k )A IH N P co(n P A k ).P A = (Σ P 1 )A. Let k > 1, then ( ) N P N PA k = N P A k+1 ( ): because an oracle B and it s complement B is equally powerful. Now claims 3 and 4 proves the theorem with oracle A =, because for a complexity class C we have C A = C if A =. Completeness Definition 5 T BQF = {ρ ρ = [ x 1 x 2... Q k x k : F (x 1,..., x k )] ρ = 1}, where F (x 1,..., x k ) is a CNF -formula and x i {0, 1}. Theorem 6 T BQF is PSPACE-complete. Proof From the definition of T BQF we see that T BQF PSPACE. Let L PSPACE = AP 3 be given, L is computed by a polytime ATM M, we now introduce dummy states such that: all nondeterministic choices are always binary and 3 We have this equality from lecture 4 4
Before... q 1 q 2 q 3 q l... q 1 q 2 q 3 q l q 1 q 1 After q 2... q 2... q l 1 q l q l 1 q l Figure 2: s are converted as done in the left, and s are converted as done in the right. If in M there is a followed by a, or vice versa, we just delete some of the dummy states to keep the alternation between and in the modified M machine. The states with striped lines are the dummy states and are not used in the computation of F. states and alternate, see figure 2, and we now have that x L(M) y 1 y 2... Q k y k : R(x, y 1,..., y k ) where R is polytime computable. Now we want a CNF -formula F for R, we get this from the completeness proof of SAT. Now R(x, y 1,..., y k ) = 1 iff z : F (x, y 1,..., y k, z) = 1, and the final T QBF -formula is ρ = y 1 y 2... Q k y k z : F (x, y 1,..., y k, z) where ρ T QBF iff x L(M), so T QBF is PSPACE-complete. Definition 7 (Generalized Geography) Given directed graph G = (V, A) and start node s V two players alternately move a pebble from node to node. A player loses if he can only move to a previously visited node. Now define GG = {G G = (V, A) where player I has a winning strategi} Theorem 8 GG is PSPACE-complete. Proof Given a GG instance G = (V, A) with start node s V, a ATM M can decide GG by the following procedure 1, v is visited p = 2 W in(v, p) = 0, v is visited p = 1 u succ(v) W in(u, p + 1 mod 2), p = 1 W in(u, p + 1 mod 2), p = 2 u succ(v) 5
so G GG iff W in(s, 1) = 1, and given a path through the - and -quantifiers we can decide W in(s, 1) in polynomial time, so therefore GG AP = PSPACE. Let ρ T QBF where: ρ = x 1 x 2... Q k x k : C 1... C u, and C i = (l i1... l ih ) and l ij {x 1,..., x k, x 1,..., x k }. Make graph G = (V, A) such that for each variable x i make the gadget from figure 3 and make the edges (t i, s i+1 ) for 1 i k 1. Now make nodes C 1,..., C u and edges 4 (C i, l ij ) for 1 i u and i 1 j i h. Now if k is equal then make edges (t k, C i ) for 1 i u, if k is unequal then make an edge (t k, t) and edges ( t, C i ) for 1 i u. x 1 x 2 s i x i t i s I I II II I II C 1 I C 2 x i x 1 x 2 Figure 3: x 1 x 2 : (x 1 x 2 ) (x 1 x 2 ) Figure 4: Now if ρ T QBF we see that first player I moves and uses the first, then player II and I moves deterministic, and now player II moves and uses the first, and so on. Now because ρ is true, C 1... C u is true and no matter which of the edges (t, C i ) (where t = t k if k is equal and t = t if k is unequal) II chooses, I can choose a edge (C i, l ij ) and hit node l ij that is not visited yet, and now player II can only reach node t ij that is visited so player I wins. Now if player I has a winning strategy we know that for each gadget of figure 3 if i is unequal it is player I s turn and he is to choose x i or x i, so x i has quantifier. If i is equal it is player II s turn and he is free to choose x i or x i and player I still wins, so x i has quantifier. Because player I wins we know that no matter which of the edges (t, C i ) player II chooses (where t = t k if k is equal and t = t if k is unequal), player I can choose an edge (C i, l ij ) where node l ij is not visited and therefore the clause C i is true, so therefore C 1... C u is true and ρ T QBF. And we now have that GG is PSPACE-hard and therefore PSPACE-complete, see figure 4 for an example of the reduction of a T QBF -formula, here the striped lines are the winning strategies, note that a walk through x i puts x i = 1 and a walk through x i puts x i = 0. 4 Important, note that we connect a clause to the negated version of their literals 6