程序代写代做代考 algorithm Notes on Complexity Theory

Notes on Complexity Theory
Jonathan Katz
Last updated: September, 2011
Lecture 8
1 The Polynomial Hierarchy
We have seen the classes NP and coNP, which are defined as follows:
L ∈ NP if there is a (deterministic) Turing machine M running in time polynomial in its first
input, such that
x ∈ L ⇔ ∃wM(x,w) = 1.
L ∈ coN P if there is a (deterministic) Turing machine M running in time polynomial in its first
input, such that
x ∈ L ⇔ ∀wM(x,w) = 1.
It is natural to generalize the above; doing so allows us to capture problems that are “more
difficult” than N P ∪ coN P . As an example, consider the language IND-SET: def
IND-SET = {(G, k) : G has an independent set of size ≥ k} .
We know that IND-SET ∈ NP; a certificate is just an independent set of vertices of size at least k
(that the vertices are independent can easily be verified). How about the following language?
def
This language does not appear to be in NP: we can certify that some graph G has an independent set of size k, but how do we certify that this is the largest independent set in G? The language does not appear to be in coNP, either: although we could prove that (G,k) ̸∈ MAX-IND-SET if G happened to have an independent set of size larger than k, there is no easy way to prove that (G, k) ̸∈ MAX-IND-SET in case its largest independent set has size smaller than k.
As another example, consider the problem of CNF-formula minimization. A CNF formula φ on n variables naturally defines a function fφ : {0,1}n → {0,1}, where fφ(x) = 1 iff the given assignment x satisfies φ. Can we tell when a given formula is minimal? Consider the language
def
This language does not appear to be in NP or coNP, either. (Even if I give you a smaller formula φ′ that computes fφ, there is no obvious way for you to verify that fact efficiently.)
The above examples motivate the following definition:
Definition 1 Let i be a positive integer. L ∈ Σi if there is a (deterministic) Turing machine M
running in time polynomial in its first input, such that
x ∈ L ⇔ ∃w1∀w2 ···Qiwi M(x,w1,…,wi) = 1. 􏰆 􏰅􏰄 􏰇
i times
8-1
MAX-IND-SET = {(G, k) : the largest independent set in G has size exactly k} .
MIN-CNF = {φ : no formula with fewer clauses than φ computes fφ}.

whereQi =∀ifiiseven,andQi =∃ifiisodd.
L ∈ Πi if there is a (deterministic) Turing machine M running in time polynomial in its first
input, such that
x ∈ L ⇔ ∀w1∃w2 ···Qiwi M(x,w1,…,wi) = 1. 􏰆 􏰅􏰄 􏰇
i times whereQi =∀ifiisodd,andQi =∃ifiiseven.
As in the case of NP, we may assume without loss of generality that the wi each have length polynomial in x. Note also the similarity to TQBF. The crucial difference is that TQBF allows an unbounded number of alternating quantifiers, whereas Σi,Πi each allow (at most) i quantifiers. Since TQBF is PSPACE-complete, this implies that Σi,Πi ∈ PSPACE for all i. (One could also prove this directly, via a PSPACE algorithm just like the one used to solve TQBF.)
Returning to our examples, note that MAX-IND-SET ∈ Σ2 since (G, k) ∈ MAX-IND-SET iff there exists a set of vertices S such that for all sets of vertices S′ the following (efficiently verifiable) predicate is true:
|S| = k and S is an independent set of G; moreover, either |S′| ≤ k or S′ is not an independent set of G.
(It is easier to express the above in English as: “there exists a set S of k vertices, such that for all sets S′ containing more than k vertices, S is an independent set and S′ is not an independent set”. But one has to be careful to check that anytime the quantification is limited [e.g., by quantifying over all sets of size greater than k, rather than all sets], the limitation is efficient to verify.) We also have MAX-IND-SET ∈ Π2 since we can swap the order of quantifiers in this case (since S′ does not depend on S, above). Turning to the second example, note MIN-CNF ∈ Π2 since φ ∈ MIN-CNF iff for all formulas φ′ that are smaller than φ there exists an input x for which φ(x) ̸= φ(x′). Here, however, we cannot just swap the order of quantifiers (do you see why?), and so we do not know, or believe, that MIN-CNF ∈ Σ2.
We make some relatively straightforward observations, leaving their proofs as exercises. • Σ1 = NP and Π1 = coNP.
• Foralli,wehavecoΣi =Πi (andcoΠi =Σi).
• For all i, we have Σi,Πi ⊆ Πi+1 and Σi,Πi ⊆ Σi+1.
The polynomial hierarchy PH consists of all those languages of the form defined above; that is,
def 􏷴 􏷴
PH = iΣi = iΠi. SinceΣi ⊆PSPACEforalli,wehavePH⊆PSPACE. EachΣi (resp.,Πi)is
called a level in the hierarchy.
As in the case of NP and coNP, we believe
Conjecture 1 Σi ̸= Πi for all i.
If the above conjecture is not true, then the polynomial hierarchy collapses in the following sense: Theorem 2 If Σi =Πi for some i, then PH=Σi.
8-2

Proof We show that for all j > i, we have Σj = Σj−1. Let L ∈ Σj. So there is a polynomial-time Turing machine M such that
x ∈ L ⇔ ∃wj∀wj−1 ···Qw1 M(x,wj,…,w1) = 1,
where we have numbered the variables in descending order for clarity in what follows. Assume j − i
is even. (A symmetric argument works if j − i is odd.) Define language L′ as (x,wj,…,wi+1) ∈ L′ ⇔ ∃wi∀wi−1 ···Qw1 M(x,wj,…,w1) = 1,
and note that L′ ∈ Σi. By the assumption of the theorem, L′ ∈ Πi and so there is some machine M′ running in time polynomial in |x|+|wj|+···+|wi+1| (and hence polynomial in |x|) such that
(x,wj,…,wi+1) ∈ L′ ⇔ ∀wi′∃wi′−1 ···Q′w1′ M′(x,wj,…,wi+1,wi′,…,w1′ ) = 1. (Note that the {wi′, . . . , w1′ } need not have any relation with the {wi, . . . , w1}.) But then
∃wj∀wj−1 ···∀wi+1 (x,wj,…,wi+1) ∈ L′
j j−1 i+1 i i−1 1 j 1
x ∈ L ⇔
⇔ ∃w ∀w ···∀w 􏰠∀w′∃w′ ···Q′w′ M′(x,w ,…,w′ ) = 1􏰡
⇔ ∃wj∀wj−1 ···∀wi+1wi′∃wi′−1 ···Q′w1′ M′(x,wj,…,w1′ ) = 1, and there are only j − 1 quantifiers in the final expression. Thus, L ∈ Σj−1.
A similar argument gives:
Theorem 3 If P = NP then PH = P.
Each Σi has the complete problem Σi-SAT, where this language contains all true expressions of the form ∃w1∀w2 ···Qwi φ(w1,…,wi) = 1 for φ a boolean formula in CNF form. However, if PH has a complete problem, the polynomial hierarchy collapses: If L were PH-complete then L ∈ Σi for some i; but then every language L′ ∈ Σi+1 ⊆ PH would be reducible to L, implying Σi+1 = Σi. Since PSPACE has complete languages, this indicates that PH is strictly contained in PSPACE.
1.1 Alternating Turing Machines
The polynomial hierarchy can also be defined using alternating Turing machines. An alternating Turing machine (ATM) is a non-deterministic Turing machine (so it has two transition functions, one of which is non-deterministically chosen in each step of its computation) in which every state is labeled with either ∃ or ∀. To determine whether a given ATM M accepts an input x, we look at the configuration graph of M(x) and recursively mark the configurations of M(x) as follows:
• The accepting configuration is marked “accept”.
• A configuration whose state is labeled ∃ that has an edge to a configuration marked “accept”
is itself marked “accept”.
• A configuration whose state is labeled ∀, both of whose edges are to configurations marked “accept,” is itself marked “accept”.
8-3

M(x) accepts iff the initial configuration of M(x) is marked “accept”.
We can define classes atime(t(n)) and aspace(s(n)) in the natural way. We can also define
Σitime(t(n)) (resp., Πitime(t(n))) to be the class of languages accepted by an ATM running in time O(t(n)), whose initial state is labeled ∃ (resp., ∀), and that makes at most i − 1 alternations between states labeled ∃ and states labeled ∀. Note that L ∈ Σ2time(t(n)) iff
x∈L⇔∃w1∀w2 M(x,w1,w2),
where M is a deterministic Turing machine running in time t(|x|). (The situation for space-bounded
ATMs is tricker, since the length of the certificates themselves must be accounted for.) Given the
definitions, it should not be surprising that Σi = 􏷴 Σitime(nc) and Πi = 􏷴 Πitime(nc). We also 􏷴ccc
have PSPACE = c atime(n ) (this follows readily from the fact that TQBF is PSPACE-complete). Defining the polynomial hierarchy in terms of ATMs may seem more cumbersome, but has some advantages (besides providing another perspective). Perhaps the main advantage is that it allows
for studying more refined notions of complexity, e.g., Σitime(n2) vs. Σitime(n). It is known that
Theorem 4
• nspace(s(n)) ⊆ atime(s(n)2) ⊆ space(s(n)2) for time/space-constructible s(n) ≥ n. • aspace(s(n)) = time(2O(s(n))) for time/space-constructible s(n) ≥ log n.
Proof See [2].
We now show an application of ATMs to proving a result about standard non-deterministic machines. Let TimeSpc(t(n),s(n)) be the class of languages that can be decided by a (de- terministic) Turing machine M that runs in time O(t(n)) and uses space O(s(n)). (Note that TimeSpc(t(n), s(n)) is not the same as time(t(n)) ∩ space(s(n)).)
Theorem 5 SAT ̸∈ TimeSpc(n1.1, n0.1).
Proof We show that ntime(n) ̸⊆ TimeSpc(n1.2,n0.2), which implies the theorem because (by the strong version of the Cook-Levin theorem proved in [1]) deciding membership of x ∈ {0, 1}n in some language L ∈ ntime(n) can be reduced to solving SAT on an instance of length O(n log n).
We begin with the following claim (which is of independent interest).
Claim 6 TimeSpc(n12, n2) ⊆ Σ2time(n8).
Proof Let L ∈ TimeSpc(n12,n2), and let M be a machine deciding L in time O(n12) and space O(n2). Considering the configuration graph of M(x), we see that M(x) accepts iff there exist a sequence of configurations c0, . . . , cn6 such that (1) c0 is the initial configuration and cn6 is the (unique) accepting configuration, and (2) for all i, machine M(x) goes from configuration ci to configuration ci+1 in at most O(n6) steps. Each configuration can be specified using O(n2) bits, and so the sequence c1, . . . , cn6 can be written down in O(n8) time. Moreover, existence of a path of length O(n6) from ci to ci+1 can be verified in O(n8) time.
The above claim was unconditional. The next claim uses the assumption that ntime(n) ⊆ TimeSpc(n1.2, n0.2).
8-4

Claim 7 If ntime(n) ⊆ TimeSpc(n1.2, n0.2), then Σ2time(n8) ⊆ ntime(n9.6).
Proof Since TimeSpc(n1.2, n0.2) ⊆ time(n1.2) and time(s(n)) is closed under complementation,
the condition of the claim implies contime(n) ⊆ time(n1.2). If L ∈ Σ2time(n8) then x ∈ L ⇔ ∃w1∀w2 M(x,w1,w2) = 1,
where M is a deterministic machine running in time O(|x|8). But then
′ def 8 􏰒􏰉 8􏰈1.2􏰓 9.6
)
and hence L ∈ ntime(n9.6).
We now put everything together to prove the theorem. Assume toward a contradiction that
ntime(n) ⊆ TimeSpc(n1.2, n0.2). Then
ntime(n10) ⊆ TimeSpc(n12, n2) ⊆ Σ2time(n8) ⊆ ntime(n9.6),
using Claim 6 for the second inclusion, and Claim 7 for the last inclusion. But this contradicts the non-deterministic time-hierarchy theorem.
References
[1] S. Arora and B. Barak. Computational Complexity: A Modern Approach. Cambridge University Press, 2009.
[2] A. Chandra, D. Kozen, and L. Stockmeyer. Alternation. J. ACM 28(1): 114–133, 1981.
L = {(x,w1) : ∀w2 M(x,w1,w2)} ⊆ contime(n ) ⊆ time n = time(n
where n denotes the length of x. If we let M′ be a deterministic machine deciding L′, where
M(x, w1) runs in time O(|x|9.6), then
x∈L⇔∃w1 M′(x,w1)=1
8-5