* PSPACE * PSPACE-complete problems PSPACE SPACE(T(n)) = {L: L is decided by a deterministic TM in space O(T(n))} PSPACE = U_k SPACE(n^k) The following relationships follow from previous theorems. P and NP are both in PSPACE (since NTIME(T(n)) is in SPACE(T(n))). PSPACE = NPSPACE by Savitch. Furthermore, NPSPACE is in EXPTIME (since NSPACE(T(n)) is in TIME(2^{O(T(n))}). P subset of NP subset of PSPACE = NPSPACE subset of EXPTIME. The first and last will be shown to be different. PSPACE-Completeness A language B is PSPACE-complete if (a) B is in PSPACE and (b) for every A in PSPACE, A <=p B. Could also use the weaker reduction <=l to make the notion of completeness stronger. Does not make sense to use polynomial-space in the reduction because then every problem in PSPACE would be PSPACE-complete. QBF (quantified Boolean formula) is a generalization of satisfiability. QBF is the problem of determining whether the expression Q_1 x_1 Q_2 x_2 ... Q_nx_n B(x_1,x_2,...,x_n) is true where B(x_1,x_2,...,x_n) is a Boolean formula over the variables x_1,...,x_n and Q_i is either \exists or \forall. Note that a SAT formula is a QBF with all existential quantifiers. So what makes QBF different from SAT is the presence of universal quantifiers. Theorem: QBF is PSPACE-complete. Proof: First we show QBF is in PSPACE. There are n variables. We check the truth of a QBF formula f using recursion. For each quantifier (and hence each variable) we add a level of recursion. -- if f has no quantifiers, then this is simply evaluation which can be easily done in linear-time -- if f is of the form \forall x f', then we recurse to f', once for each possible value of x (in sequence) and accept only if f' is true for each value of x (0 or 1) -- if f is of the form \exists x f', then we recurse to f', once for each possible value of x (in sequence) and accept only if f' is true for some value of x Note that the stack for each level of recursion just needs to store the current value of x being used. We next show that for any A in PSPACE, A <=p QBF. Fix an A in PSPACE. Then, there exists a DTM M that decides A in space n^k for some k. Just as in the proof of the completeness of SAT or that of the circuit value problem, we will encode the computation of M on a given string w using a formula. What size tableau should we consider? n^k columns per row, but 2^{O(n^k)} rows since an n^k-space machine may run for 2^{n^k} steps. For each pair of configurations c_1, c_2, we can write a formula f(c_1,c_2) which is true if c_1 yields c_2 in one step. We can start with the start configuration and write the formula: \exists c_1 \exists c_2 ...\exists c_t f(c_0,c_1) AND f(c_1,c_2) AND ... f(c_{t-1},c_t). A major problem is that this is expontential size, and hence will take exponential time. But note that it does not use the universal quantifier. We do not want to explicitly list all intermediate configurations at any time. So we use an idea similar to Savitch's theorem. We define the formula f_{c_1,c_2,t} which is true if c_1 yields c_2 in at most t steps. Now, we can write f(c_1,c_2,t) = \exists m_1 [f(c_1,m_1,t/2) AND f(m_1,c_2,t/2)] Clearly this is not buying us anything since when we expand all of this we get exactly the same formula as the one that takes exponential time. Writing the formula this way, however allows us to use the universal quantifier. f(c_1,c_2,t) = \exists m_1 \forall (c_3,c_4) in {(c_1,m_1), (m_1,c_2)} f(c_3,c_4,t/2) Expanding we get f(c_1,c_2,t) = \exists m_1 \forall (c_3,c_4) in {(c_1,m_1), (m_1,c_2)} [((c_3 = c_1) AND (c_4 = m_1)) OR ((c_3 = m_1) AND (c_4 = c_2)) => f(c_3,c_4,t/2)] f(c_1,c_2,t) = \exists m_1 \forall (c_3,c_4) [(~(c_3 = c_1) OR ~(c_4 = m_1)) AND (~(c_3 = m_1) OR (c_4 = c_2)) OR f(c_3,c_4,t/2)] Now, note that the above recursive construction yields a formula that takes O(n^k) space and can be computed in O(n^k) time since we only add a constant number of expressions in each level of the recursion. We need to quantify each variable over {0,1}. We can replace each configuration variable c by O(n^k) Boolean variables, one for each of the tape cells and tape letter, and one for each state. Thus, the total size of the Boolean formula is O(n^{2k}), and so is the time to construct it. End Proof GAMES AND GENERALIZED GEOGRAPHY Two-player games. Two players E and A. E goes first, makes a move. A responds, then E goes. And so on. Question: is there a choice for E of the first move such that E is guaranteed to win. This translates to: \exists E_1 \forall A_1 \exists E_2 \forall A_2 ... WinForE(E_1,A_1,E_2,...,) Of course, something like this can be written only if the game is finite. We will not allow loops. In games like chess, these are explicitly avoided. Assume that \exists is the first quantifier. Geography: Players take turns naming world cities. Player A's city should start with a letter that ends player E's city in the previous move and vice versa. And no cities are repeated. The aim is to ensure that your opponent is stuck at a node with no possible edge to take (since all of the nodes to which it has edges are taken). Easily visualized as a directed graph in which the nodes of the graph are the world cities. We have an edge from X to Y if the first letter of Y is the last letter of X. Each move corresponds to taking an edge. The first move is a start node. GG = {: Player I has a winning strategy for the generalized geography game played on graph G starting on nobe b}. Theorem: GG is PSPACE-complete. Proof: We first show that GG is in PSPACE. As in QBF, we consider three cases: -- if no more moves can be taken, then we determine who wins -- if it is Player I's move, then we go through all choices in sequence, recurse for each, and determine whether at least one of these lead to a win -- if it is Player II's move, then we go through all choices in sequence, recurse for each, and determine whether all of these lead to a win For PSPACE-hardness, we reduce QBF to GG. Given a QBF formula F, we map it to a GG instance as follows. Suppose the formula F is of the form: F = Ex_1 Ax_2 Ex_3 ... Qx_k S A few assumptions above: (1) the first quantifier is E; (2) the quantifiers alternate; and (3) S is in CNF form. The first two can be assumed since we can always add quantifiers with dummy variables. The third can be assumed since QBF with CNF formula is also PSPACE-complete. We will add pieces of the game to correspond to the variables and clauses. Player I's moves correspond to settings of E variables and player II's moves correspond to settings of A variables. We have player I and II go through the variable settings. Then, we go through the clauses. We set it up so that the if and only if any clause is unsatisfied there is a way for player I to get stuck. For each variable, we have a diamond (like in the reduction for Hamiltonian path). Each path in the diamond provides a truth assignment. We add an additional edge connecting two diamonds to switch roles in selecting the assignment. The two players traverse the diamond gadgets setting the variable values. Then, we switch to the clauses. Here player II needs to select a clause. And player II points to a node that has a single outgoing edge to the literal that asserts the clause. Since this literal has already been set, player II loses if all clauses are satisfied. Clearly the reduction is in poly-time, in fact, even in log-space. End Proof