IAS/PCMI Summer Sessio 2000 Clay Mathematics Udergraduate Program Basic Course o Computatioal Complexity Lecture 9: Hierarchy Theorems David Mix Barrigto ad Alexis Maciel July 27, 2000 Most of this lecture will be devoted to hierarchy theorems that will allow us to separate some of our complexity classes. At the ed of the lecture, we preset a example of a probabilistic argumet. This type of argumet will be used i the ext lecture to separate two more classes. 1. The Space Hierarchy Theorem If a machie is allowed to use a sigificatly larger amout of resources, it would seem like it should be able to decide more laguages. I this lecture, we show that this ituitio is right. For example, we show that i space O(s()) we ca decide a laguage that caot be decided i space o(s()), provided that s is space costructible. (Recall that a fuctio s is space costructible if give 1, the biary represetatio of s() ca be computed i space O(s()).) Oe cosequece is that L DSPACE(), which implies that oe of the followig iclusios must be strict: L NL AC 1 NC P NP PSPACE. Note, however, that we curretly do ot kow which iclusio that might be. (It is geerally believed that all these iclusios are strict.) Theorem 1 If s is space costructible, the there is a laguage that is decided i space O(s()) but ot i space o(s()). Proof What we are goig to do is desig a machie D that rus i space O(s()) ad we are goig to make sure that if M is ay machie that rus i space o(s()), the D ad M disagree o some iput. The laguage decided by D will the satisfy the coditios i the statemet of the theorem. To desig D we will use the importat techique of diagoalizatio. First, fix some ecodig of machies over some alphabet ad let M deote the ecodig of 1
M. Give the ecodig of some machie M, D will simulate M o the iput strig M ad accept if ad oly if M rejects. The if M is ay machie ruig i space o(s()), M ad D will disagree o M. More precisely, D first verifies that its iput is the ecodig of some machie M. If ot, it rejects. Secod, D computes the space boud s(). Third, D simulates M o M. Durig this simulatio, D will store i its ow memory the cotets of M s memory. If at ay momet the amout of space eeded to store M s memory cotets exceeds s(), the simulatio is halted ad D rejects. Otherwise, if the simulatio completes with M havig either accepted or rejected, the D will do the opposite. Now if M is ay machie ruig i space o(s()), we would like to claim that D disagrees with M o M. To do this, we ru D o M, which causes D to simulate M o M ad output the opposite. If M uses space f() ad if storig each memory symbol of M requires b symbols i D s memory, the we eed to esure that bf() s() so the simulatio ca be guarateed to fid whether M accepts or rejects. However, we oly kow that f() = o(s()), which implies that bf() s() but oly for sufficietly large, ot for all. For small iputs, simulatig M could use too much space. To fix this, we modify D so that wheever it gets a iput of the form M 1 k for some k, D simulates M o M 1 k. Whe k is sufficietly large, we will have bf() s() ad D will have eough space to simulate M ad output the opposite. So we have established that D disagrees o some iput with ay machie M ruig i space o(s()). It is clear that D rus i space O(s()). But we also wat D to decide a laguage, so we eed to make sure that D always halts. If M is a machie decidig a laguage i space o(s()), the we kow that M always halts, so the simulatio will always termiate. But D s iput ca be ay machie whatsoever, so we eed to take care of the possibility that M uses a small amout of space but does ot halt. Now ay machie ruig i space o(s()) also rus i time 2 o(s()), which is less tha 2 s() whe is large eough. So we will add to the simulatio a couter ad stop the simulatio ad reject if we fid that M s computatio has take more tha 2 s() steps. This will esure that D always halts while still allowig the complete simulatio of ay machie that rus i space o(s()). A immediate corollary of this result is that if s 1 = o(s 2 ) ad s 2 is space costructible, the DSPACE(s 1 ) DSPACE(s 2 ). I particular, L DSPACE(), which implies that L PSPACE. But we ca say more, by usig Savitch s Theorem. Corollary 2 NL PSPACE. 2
Proof NL DSPACE(log 2 ) DSPACE(). 2. The Time Hierarchy Theorem We just proved that icreasig the amout of space from o(s()) to O(s()) allows machies to decide more laguages. The same is true for time, though we defer the proof to the exercises. Theorem 3 If t is time costructible, the there is a laguage that is decided i time O(t()) but ot i time o(t()). Corollary 4 P EXP. Proof For every k, DTIME( k ) DTIME( log ), which implies that P DTIME( log ). The result follows sice DTIME( log ) DTIME(2 ). A cosequece of this is that oe of the followig iclusios must be strict: P NP PSPACE EXP. Oce agai, we do ot kow which oe. For aother cosequece, the exercises ask you to show that there are problems that caot be solved by ay machie whatsoever. From the Time Hierarchy Theorem, we ow kow that there are laguages that ca be solved by machies but ot by efficiet machies (i.e., machies that ru i polyomial time). Note that the proof of the above theorem relies o the fact that our machies have a costat umber of memory heads, ot just oe. For machies that have oly oe memory head, we could have proved a separatio betwee time O(t()) ad time o(t()/ log t()). It is ot kow if the separatio holds with o(t()) for machies with a sigle memory head. 3. A Probabilistic Argumet We ed this lecture with a result about graphs that will serve as our itroductio to probabilistic argumets. A argumet of this type will be used i the ext lecture. I a udirected graph, a aticlique or idepedet set is a set of odes i which every two odes are ot coected by a edge. For example, a petago has aticliques of size 2 but ot of size 3. It may seem reasoable to thik that as the 3
umber of odes i a graph becomes very large, the chaces icrease that it will cotai either a large clique or a large aticlique. I fact, Ramsey s Theorem states that every graph of size at least 2 2k cotais either a clique of size k or a aticlique of size k. Let R(k) be the miimum umber such that every graph with R(k) odes is guarateed to cotai either a clique or a aticlique of size k. Ramsey s Theorem gives a upper boud o this umber: R(k) 2 2k. What about a lower boud? R(k) k is trivial ad, for k 3, R(k) 2k is easy: cosider a polygo with 2k 1 sides. However, these umbers are very far from the upper boud of 2 2k. Ca we get closer? The followig theorem, due to Erdös, shows that we ca. Its proof is a example of a probabilistic argumet: we show that a object of a certai type with a certai property exists by showig that the probability that a radom object of the same type does ot have the property is less tha 1. Theorem 5 R(k) 2 k/2 1. Proof Let ad k be arbitrary. Choose a graph with odes at radom by decidig whether each of the possible ( ) 2 edges is i or out. For ay set A of k odes, the probability that A is a clique is 2 (k 2). The probability that A is a aticlique is the same. Therefore, the probability that there is a set of k odes i the graph that is either a clique or a aticlique is o more tha 2 ( ) k 2 ( k 2). If R(k), the every graph with odes has a clique or aticlique of size k, so this probability is 1 ad this implies that 2 ( ( ) k) 2 ( k 2) 1. Therefore, if 2 k 2 ( k 2) < 1, the some graph with odes must have o cliques or aticliques of size k, which implies that < R(k). A straightforward calculatio shows that satisfies the coditio if < 2 k/2 1. The lower boud follows. 4. Exercises 1. Show that for every ratioal umber r, the fuctio r is space costructible. 2. Show that the followig problem caot be decided by ay machie whatsoever: give a machie M ad a iput x, determie whether M halts o x. This problem is usually referred to as the haltig problem. It is the typical example of a udecidable problem. 4
3. Show that the followig problem is udecidable: give a machie M, does M halt o the empty iput? (Hit: Give a iput M, x to the haltig problem, cosider a machie M x that igores its iput ad simply simulates M o x.) 4. Show that NP DTIME(). 5. Show that NP DSPACE(). 6. Prove the Time Hierarchy Theorem. 7. Prove Ramsey s Theorem. That is, show that R(k) 2 2k. (Hit: Let R(i, j) be the miimum umber such that every graph with R(i, j) odes is guarateed to cotai either a clique of size i or a aticlique of size j. Show that R(i, j) R(i, j 1) + R(i 1, j).) 5