Complexity Theory WS 2009/10
Prof. Dr. Erich Grädel
Mathematische Grundlagen der Informatik RWTH Aachen
cbnd
This work is licensed under:http://creativecommons.org/licenses/by-nc-nd/3.0/de/
Dieses Werk ist lizensiert uter:
http://creativecommons.org/licenses/by-nc-nd/3.0/de/
© 2009 Mathematische Grundlagen der Informatik, RWTH Aachen.
http://www.logic.rwth-aachen.de
Contents
1 Deterministic Turing Machines and Complexity Classes 1
1.1 Turing machines . . . 1
1.2 Time and space complexity classes . . . 4
1.3 Speed-up and space compression . . . 7
1.4 The Gap Theorem . . . 9
1.5 The Hierarchy Theorems . . . 11
2 Nondeterministic complexity classes 17 2.1 Nondeterministic Turing machines . . . 17
2.2 Elementary properties of nondeterministic classes . . . 19
2.3 The Theorem of Immerman and Szelepcsényi . . . 21
3 Completeness 27 3.1 Reductions . . . 27
3.2 NP-complete problems: Satand variants . . . 28
3.3 P-complete problems . . . 34
3.4 NLogspace-complete problems . . . 38
3.5 A Pspace-complete problem . . . 42
4 Oracles and the polynomial hierarchy 47 4.1 Oracle Turing machines . . . 47
4.2 The polynomial hierarchy . . . 49
4.3 Relativisations . . . 52
5 Alternating Complexity Classes 55 5.1 Complexity Classes . . . 56
5.2 Alternating Versus Deterministic Complexity . . . 57
5.3 Alternating Logarithmic Time . . . 61
6 Complexity Theory for Probabilistic Algorithms 63 6.1 Examples of probabilistic algorithms . . . 63 6.2 Probabilistic complexity classes and Turing machines . . . 72 6.3 Probabilistic proof systems and Arthur-Merlin games . . . . 81
4 Oracles and the polynomial hierarchy
4.1 Oracle Turing machines
Definition 4.1. A deterministic (respectively nondeterministic)oracle Turing machineis a Turing machine with a designated oracle tape and three special states ? (query), Y (yes) and N (no).
A configurationCof an Oracle Turing machine withkworking tapes and a distinguished oracle tape is a tuple
C= (q,p0,· · ·,pk,w0,· · ·,wk), where
•qis the state of the Turing machine,
•p0, . . . ,pk are the head positions (p0 is the head position of the oracle tape), and
•w0. . . ,wk are the head inscriptions (w0 is the inscription of the oracle tape).
The computation (respectively the computation tree) of an oracle Turing machine depends on a previously defined oracle set A ⊆Σ∗ (where Σ is the alphabet of M). The successor configurations of a configurationC are defined as usual for q ̸= ? while the successor configurationC′forq=? is defined as :
C′=
(Y, 0,p1, . . . ,pk,ε,w1, . . .wk) ifw0∈A (N, 0,p1, . . . ,pk,ε,w1, . . . ,wk) ifw0̸∈A
whereεis the empty word. The oracle therefore determines whether or not w0 (the inscription of the oracle tape) is in A. The machine consequently enters the corresponding state (Y or N) and the inscription of the oracle tape is erased.
47
4.1 Oracle Turing machines
Definition 4.2. Let Mbe an Oracle Turing machine and A ⊆Σ∗ be some oracle set. Then the accepted language is
L(MA):={x:Maccepts the inputxwith oracleA}.
Based on the oracle set A, we define the following complexity classes:
(i) PA:={L: there is a deterministic Oracle TMM
that decidesLusing oracleAin polynomial time}. (ii) NPA:={L: there is a nondeterministic Oracle TMM
that decidesLusing oracleAin polynomial time}. LetCbe some class of languages, e.g., a complexity class. Then PC= [
A∈C
PA and NPC= [
A∈C
NPA.
Example4.3.
(a) LetB ∈ NP. Then B ∈ Psat. Since satis NP-hard, there is a polynomially computable function f withx∈B⇐⇒ f(x)∈sat.
The following oracle algorithm then decidesB:
Input:x Compute f(x)
Query the oracle whether f(x)∈sat ifYthenaccept
ifNthenreject
(b) It is likely that NP(Psatas everyB∈coNP is in Psat. One can use the preceding algorithm and interchange the behaviour for the answers Yes and No.
(c) LetB:={(G,k): Ga graph,ω(G) =k}whereω(G)is the max- imal number of nodes of cliques inG. Reminder: The problem clique:={(G,k) : k≤ ω(G)}is NP-complete. It is straightfor- ward to see thatB∈Pclique:
4 Oracles and the polynomial hierarchy
Input: G,k
Query the oracle whether(G,k)∈clique ifNthenrejectelse
Query the oracle whether(G,k+1)∈clique ifNthenaccept
ifYthenreject endif
4.2 The polynomial hierarchy
Definition 4.4. We define the complexity classesΣkp,Πpk, and∆kpfor allk∈N:
•Σp0:=Πp0:=∆0p:=P
•Σpk+1:=NPΣpk
•Πkp:=coΣkp={A: A∈Σkp}
•∆k+1p :=PΣkp
Theorem 4.5. The classesΣkp,Πkp, and∆kphave the following elemen- tary properties:
(i)∆1p=P.
(ii)Σp1=NP,Π1p=coNP.
(iii)Σpk+1=NPΠpk =NP∆pk+1. (iv) P∆pk =∆kp.
Proof. (i)∆1p=PP=P.
(ii)Σp1=NPP=NP,Πp1=coΣp1=coNP.
(iii) LetB ∈ Σk+1p , B = L(MA) and A ∈ Σkp. Further, letM′ be the machine obtained from Mby interchanging the states Y and N.
Obviously, B = L(M′A) and therefore B ∈ NPΠkp. In addition, NP∆k+1p =NPPΣpk =NPΣpk =Σpk+1holds.
(iv) k=0: P∆p0 =PP=P=∆p0.
k>0: P∆pk =PPΣk−1p =PΣk−1p =∆kp. q.e.d.
4.2 The polynomial hierarchy
Theorem 4.6. For allk,Σkp∪Πpk⊆∆pk+1⊆Σk+1p ∩Πpk+1.
Proof. For k = 0, the theorem states P ⊆ P ⊆ NP∩coNP. This is obviously true.
Fork>0:
•Σkp⊆PΣkpand therefore alsoΠpk⊆PΣpk because PΣpk is closed under complement. Hence,Σkp∪Πkp⊆∆k+1p .
•∆k+1p =PΣkp=coPΣkp⊆coNPΣpk =Πk+1p .
∆k+1p = PΣkp ⊆ NPΣnp = Σk+1p . Therefore, ∆pk+1 ⊆ Σk+1p ∩Πk+1p . q.e.d.
Theorem 4.7. If there is aksuch thatΣk+1p =Σkp, thenΣpk+i=Πpk+i= Σpkfor alli>0.
Proof. For i = 1, Σpk+i = Σk+1p = Σkp by assumption. By induction hypothesis, assumeΣk+ip =Σpk. Then,
Σk+i+1p =NPΣk+ip =NPΣpk =Σk+1p =Σpk, and therefore also
Πpk+i⊆Σk+i+1p =Σpk for alli.
In particular, Πkp ⊆ Σpk holds. It remains to show thatΣpk ⊆ Πkp. If B∈Σpk, thenB∈Πpk⊆Σpkand, hence,B∈Πpk. q.e.d.
Corollary 4.8. If there is ak>0 withΣpk̸=P, then P̸=NP.
Definition 4.9. PH :=Sk∈NΣpkis called thepolynomial hierarchy.
In caseΣk+ip =Σkp, we say that the polynomial hierarchy collapses at levelk.
Theorem 4.10. PH⊆Pspace.
Proof. By induction overkwe show thatΣkp⊆Pspacefor allk∈N:
Σ0p=P⊆Pspace
Σk+1p =NPΣkp⊆NPPspace⊆PspacePspace=Pspace.
50
4 Oracles and the polynomial hierarchy Here, PspacePspaceis the class of languages that can be decided by a deterministic polynomially-space bounded Oracle Turing machine with some oracle in Pspace. When we speak about space complexity, we also count the space used on the oracle tape. q.e.d.
If PH=Pspace, the polynomial hierarchy collapses:
Theorem 4.11. If PH=Pspace, there is somekwith PH=Σpk. Proof. If PH=Pspace, thenqbf∈ PH holds. Consequently, there is someksuch thatqbf∈Σkp. For eachA∈Pspace, we haveA≤pmqbf, i.e.,A∈Σkp. Thus, we obtain PH=Σpk. q.e.d.
It is assumed thatΣpk(Σk+1p for allk, the polynomial hierarchy is strict and therefore, PH(Pspace.
4.2.1 Additions
There are two natural complete problems forΣkpandΠkp:
Σk-QBF={ψ= (∃X1)(∀X2). . .(QkXk)ϕ : ϕquantifier free, ψtrue} Here,Qkis the universal quantifier ifkis even and the existential quantifier otherwise.Πk-QBF is defined analogously but the formulae begin with universal quantifiers. The problemΣk-QBF isΣkp-complete and, analogously,Πk-QBF is Πkp-complete. This generalises the NP- completeness ofsat.
Recall the definition of NP. A problem A ∈ NP if, and only if, there is someB∈ P and some polynomial p(n) such thatA ={x :
∃py(x#y∈B)}where∃pyis an abbreviation for∃y : |y| ≤p(|x|). We can generalise this definition to obtain a characterisation ofΣkpandΠkp as follows:
•A∈Σpk if, and only if, there is someB∈P and some polynomial p(n)such that
A={x : (∃py1)(∀py2)(∃py3). . .(Qkpyk)x#y1#y2# . . . #yk∈B}.
51
4.3 Relativisations
Here,Qkis the existential quantifier ifkis odd and the universal quantifier otherwise.
•Πpk can be characterised analogously, using formulae that begin with universal quantifiers.
4.3 Relativisations
To approach the P=NP question, it is interesting to see whether there are oraclesA,Bsuch that
• PA=NPA
• PB ̸=NPB.
The first question is easy to answer since Pqbf=NPqbf=Pspace.
The answer to the second question is not as straightforward.
Theorem 4.12. There is an oracleBsuch that PB ̸=NPB.
Proof. Just as Turing machines, polynomially time-bounded oracle Tur- ing machines can also be enumerated recursively (exercise). We choose one such recursive enumeration{Mi :i ∈N}of deterministic poly- nomial oracle Turing machines such that the following holds for all oraclesA:
(1) PA={L(MiA):i∈N}.
(2) There is a sequence{pi(n):i∈N}of polynomials with:
(i)Miispi-time bounded, (ii)pi(n)≤pi+1(n)for alli,n.
Any given sequence{qi(n):i∈N}of time bounds for{Mi:i∈N} can be modified to such a sequencepi+1(n)by setting:
• p0(n):=q0(n),
• pi+1(n):=max(pi(n),qi+1(n)).
For everyC⊆ {0, 1}∗, letS(C) ={0n: there is anx∈Cwith|x|=n}. We obviously have:
Lemma 4.13. S(B)∈NPBfor allB.
4 Oracles and the polynomial hierarchy The goal now is to find some Bsuch thatS(B) ̸∈PB. This Bis constructed as follows: At the beginning, initialiseB0:=∅andk0:=0.
Forn>0, constructBn,knas follows:
• Setkn so it is the smallest integer with 2kn > pn(kn) andkn >
pn−1(kn−1).
• If 0kn ∈ L(MBnn−1), then setBn := Bn−1. Otherwise, letw(n)be the lexicographically first word in{0, 1}k(n)for which the oracle is not queried during the computation ofMnBn−1on input 0kn. Such a word exists sincepn(kn)<2kn. SetBn=Bn−1∪ {w(n)}.
SetB:=Sn∈NBn.
Lemma 4.14. 0kn∈L(MnB) ⇐⇒ 0kn ∈L(MnBn−1)for alln.
The oracle is never queried forw∈B\Bn−1during the computa- tion ofMBnon 0kn:
• forw=w(n)by construction and
• forw=w(m)withm>nbecause|w(m)|=k(m)>pn(kn). Lemma 4.15. S(B)̸∈PB.
Otherwise, there would be some n ∈ N with S(B) = L(MnB). However, this cannot be the case since, by definition, 0kn ∈S(B)if, and only if, there is somewsuch that|w|=knandw∈B. By construction, this is the case if, and only if, 0kn̸∈L(MBnn−1). This follows from the fact that a word of lengthknis added toBif, and only if, 0kn ̸∈L(MnBn−1). By Lemma 4.14, 0kn ̸∈ L(MnBn−1) is equivalent to 0kn ̸∈ L(MBn), and
therefore,S(B)̸=L(MBn). q.e.d.
The problem whether C1 = C2 remains open for many pairs of complexity classesC1andC2. In most cases, there are oraclesAandB such that:
C1A=C2A and C1B̸=C2B.
It has further been shown that for almost all oracles D: C1D ̸= C2D. Contradictory relativisations of this kind show that, with respect to the
4.3 Relativisations
problemC1̸=C2, proof techniques that ‘relativise’ (i.e., techniques that are independent of oracles) fail.
54