<<

Class Definitions

L = DSPACE(log n) NL = NSPACE(log n) ∞ P = DTIME( ) Repeating Structural Results 8c=1 ∞ NP = NTIME(nc ) 8c=1 ∞ = DSPACE(nc ) PSPACE 8c=1 ∞ = NSPACE(nc ) NPSPACE 8c=1

∞ c = DTIME(2n ) EXP 8c=1

∞ c = NTIME(2n ) NEXP 8c=1

Relationships Three Structural Theorems (By Definition)

L ⊆ NL L ⊆ PSPACE NTIME( f (n)) ⊆ DSPACE( f (n))

P ⊆ NP NL ⊆ NPSPACE NSPACE( f (n)) ⊆ DTIME(clogn+ f (n) ) PSPACE ⊆ NSPACE P ⊆ EXP

EXP ⊆ NEXP NP ⊆ NEXP NSPACE( f (n)) ⊆ DSPACE( f 2 (n)) ≥ Determinism f (n) log n Exponentially vs. Higher Bound Nondeterminism f time/space constructible

NTIME vs. DSPACE: Proof I NTIME vs. DSPACE: Proof II

Thus, M enumerates possible choices, taking space cM f (n). NTIME( f (n)) ⊆ DSPACE( f (n)) This string is then used by M as a lookup - table whenever M is taking a nondet. choice.

Let M be an NTM running in time f (n). For each enumerated choice- string, M simulates M. In each step, M can make a single nondeterministic decision. If M aceepts in one of these simulations, M accepts, too.

However, M can only chose out of cM continuations in a step. Otherwise, M rejects. Thus, M enumerates all possible choices, taking space c f (n). M + ∈ M requires cM f (n) f (n) space, i.e. M DSPACE( f (n)). • This string is then used by M as a lookup - table whenever M is taking a nondet. choice.

1 NSPACE vs. DTIME: Proof I NSPACE vs. DTIME: Proof II

logn+ f (n) Using CM we find at most CM configs. NSPACE( f (n)) ⊆ DTIME(clogn+ f (n) ) M =< > = Now we define Gx V , E with V {configs. of M} < >∈ Let M be an NTM running in space f (n). and u,v E iff there is a direct transition from u to v A configuration of M has the following parts : on input x. the state k ∈ K of M M ∈ the cursor position 1 ≤ i ≤ n +1 of M Define s V to be the initial config of M and < > ∈Σ f (n) t ∈V to be the final config of M (normalization). the contents s1,..., of the tapes of M : si + Σ lf (n) Thus, there are | K M | (n 1) | | different configs. < M > log n+ f (n) Gx , s,t is a REACH instance with CM nodes. Using C we find at most C logn+ f (n) configs. M M < M >∈ = Gx , s,t REACH iff M (x) 1

NSPACE vs. DTIME NSPACE vs. DTIME: Proof III A Note on the Proof < G M , s,t > is a REACH instance with C log n+ f (n) nodes. x M < G M , s,t > is a REACH instance with C log n+ f (n) nodes. < G M , s,t >∈ REACH iff M (x) =1 x M x < M >∈ = Gx , s,t REACH iff M (x) 1 REACH ∈ P. Thus we can decide < G M ,s,t >∈ REACH x The method of representing a space -bounded logn+ f(n) k in DTIME((CM ) ) for some constant k. M computation by a graph Gx is called the logn+ f(n) k = log n+ f (n) "Reachability -Method". DTIME((CM ) ) DTIME(c ) • Effectively, this is a generic reduction! REACH is NL − hard.

We will come back to this issue – and clarify in detail!

NSPACE vs. DSPACE: Proof I NSPACE vs. DSPACE: Proof II

NSPACE( f (n)) ⊆ DSPACE( f 2 (n)) < M > f (n) Gx , s,t is a REACH instance with C nodes. ≥ f (n) log n < M >∈ = Gx , s,t REACH iff M (x) 1

< M > log n+ f (n) Gx , s,t is a REACH instance with CM nodes. < G M , s,t >∈ REACH iff M (x) =1 We cannot compute the graph – it is exponential! x So how to access it? since f (n) ≥ log n We can compute the configuartions s and t. < M > f (n) Gx , s,t is a REACH instance with C nodes. < M >∈ = Having two nodes u and v, we check < u,v >∈ E Gx , s,t REACH iff M (x) 1 by simulating M on u with input string x.

2 NSPACE vs. DSPACE: Proof III NSPACE vs. DSPACE: Proof IV

PATH(G,i, j,d) PATH(G,i, j,d) if < i, j >∈ E then return true; if < i, j >∈ E then return true; if d = 0 then return false; if d = 0 then return false; for(z = 1; z <|V |;+ + z) for(z = 1; z <|V |;+ + z) if PATH(G,i, z,d −1) and PATH(G, z, j,d −1) then if PATH(G,i, z,d −1) and PATH(G, z, j,d −1) then return true; return true; return false; return false;

∃ ≤ d PATH(G,i, j,d) is true iff a path from i to j of length 2 Recursive depth of at most d PATH(G,s,t,»log |V |ÿ) iff < G, s,t >∈ REACH Each "stack - frame" has size 3log |V | PATH(G, s,t, »log |V |ÿ) requires 3log 2 |V | space

Three Structural Theorems: NSPACE vs. DSPACE: Proof V Consequences

< G M , s,t > is a REACH instance with C f (n) nodes. x M NTIME( f (n)) ⊆ DSPACE( f (n)) NP ⊆ PSPACE < M >∈ = Gx , s,t REACH iff M (x) 1 < >∈ PATH(G,s,t,»log |V |ÿ) iff G, s,t REACH logn+ f (n) NL ⊆ P NSPACE( f (n)) ⊆ DTIME(c ) NPSPACE ⊆ EXP PATH(G,s,t, »log |V |ÿ) requires 3log 2 |V | space

2 = NSPACE( f (n)) ⊆ DSPACE( f (n)) Taken together : M (x) 1 can be decided in ⊆ f (n) ≥ log n NPSPACE PSPACE DSPACE(3log 2 (C f (n) )) = DSPACE( f 2 (n)) • M

f time/space constructible

Relationships Relationships

L ⊆ NL L ⊆ PSPACE L ⊆ NL NL ⊆ P

P ⊆ NP NL ⊆ NPSPACE P ⊆ NP NP ⊆ PSPACE

PSPACE ⊆ NSPACE P ⊆ EXP PSPACE ⊆ NSPACE NPSPACE ⊆ PSPACE

EXP ⊆ NEXP NP ⊆ NEXP EXP ⊆ NEXP NPSPACE ⊆ EXP

Determinism Determinism Exponentially vs. vs. The three Theorems Higher Bound Nondeterminism Nondeterminism

3 Relationships

L ⊆ NL NL ⊆ P

P ⊆ NP NP ⊆ PSPACE Diagonalization

PSPACE ⊆ NSPACE NPSPACE ⊆ PSPACE

EXP ⊆ NEXP NPSPACE ⊆ EXP

L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP

Time Hierarchy Theorem Bounded Simulation

⊂ c DTIME( f (n)) DTIME( f (n) ) DTIME = {< > = } Let B f M , x | M (x) 1 within DTIME( f (| x |)) f (n) ≥ n, time constr., for some c >1 DTIME ∈ B f DTIME(s[ f ](n))

f (n) ≥ n, time constr.

Time Hierarchy: Proof I Time Hierarchy: Proof II

DTIME = {< > = } DTIME = {< > = } Let B f M , x | M (x) 1 within DTIME( f (| x |)) Let B f M , x | M (x) 1 within DTIME( f (| x |)) DTIME ∈ DTIME ∈ B f DTIME(s[ f ](n)) (Bounded Simulation) B f DTIME(s[ f ](n)) (Bounded Simulation) DTIME ∉ DTIME ∈ + D f DTIME( f (n)) D f DTIME(s[ f ](2n 1)) Set D DTIME = {M |< M , M >∉ B DTIME } f f DTIME( f (n)) ⊂ DTIME(s[ f ](2n +1)) Let N be an arbitrary Machine in DTIME( f (n)) There are several bounded simulation results. It is N ∈ L ⇔ < N, N >∈ B DTIME N f important to us that s[ f ](n) is bounded by a polynomial in f . ∈ ⇔ ∉ DTIME 3 N LN N D f E.g., s[ f ](n) = f (n), for f (n) ≥ n

DTIME ∉ DTIME ∈ + D f DTIME( f (n)) D f DTIME(s[ f ](2n 1)) DTIME( f (n)) ⊂ DTIME( f 3 (2n +1))

4 Hierarchy Theorem: Reusing the Proof

D RES ∉ RES( f (n)) D RES ∈ RES(s[ f ](2n +1)) DTIME( f (n)) ⊂ DTIME( f (n)c ) f f f (n) ≥ n, time constr., for some c >1 The last proof was generic – every deterministic bounded simulation can be substituted. DSPACE ∈ B f DSPACE( f (n)log f (n)) .... constants do not matter, only the polynomial relationsship is important DSPACE( f (n)) ⊂ DSPACE( f (n) log f (n))

Also possible to prove a hierarchy for NTIME, NSPACE….

Hierarchy Theorems: Relationships Relativization

RES ∉ RES ∈ + D f RES( f (n)) D f RES(s[ f ](2n 1)) L ⊆ PSPACE

... holds with respect to any oracle A, i.e., NL ⊆ NPSPACE

P ⊆ EXP DTIME A( f (n)) ⊂ DTIME A ( f c (n)) NP ⊆ NEXP

DSPACE A( f (n)) ⊂ DSPACE A( f (n)log f (n)) L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP

Relationships Relationships

⊆ ⊆ ⊆ ⊆ ⊆ ⊆ L ⊂ PSPACE L NL P NP PSPACE EXP NEXP

NL ⊂ NPSPACE

P ⊂ EXP NL ⊂ PSPACE P ⊂ EXP NP ⊂ NEXP NP ⊂ NEXP

Thus there must be proper inclusions. But nobody L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP was able to find them…

5 Time Constructible Time Constructible Definition • computing f should be easy

• more precisely doable in DTIME(f) Let f be a function N → N with • a machine should be able to measure f (n +1) ≥ f (n) the “time” f (n) • “yard-stick” machines If there is a DTM M which ouputs 1 on input x (| x |= n) and runs within DTIME(n + f (n))

then f is time constructible

Space Constructible Time/Space Constructible Definition Functions: Examples

f (n) = c f (n) = n! Let f be a function N → N with f (n) = log(n) f (n) = n = f (n +1) ≥ f (n) f (n) n f (n) + g(n)¤ f (n) Œ If there is a DTM M which ouputs 1 on input f (n)g(n) ‹ f (n) and g(n) proper = g (n) Œ x (| x | n) and runs within DSPACE( f (n)) f (n) › then f is space constructible Important proper complexity functions

Time/Space Constructible What for?

Where did we need them? Gap-Theorem Hierarchy Theorems Theorem of Immerman

6 An Anomaly: Gap-Theorem The Gap-Theorem Proof I

g(n +1) > g(n) = Let g be a recursive function N → N with G[0](x) g(x) + = g(n +1) > g(n). Then there is a recursive function G[i 1](x) g(G[i](x)) f : N → N with DTIME( f (n)) = DTIME(g( f (n)). P(n,k) ⇔ ∀0 ≤ i ≤ n ∀x ∈Σn M[i] (x) in DTIME(G[k]) or Gap Theorem for DTIME M[i](x) notin DTIME(G[k +1])

Same for DSPACE, NTIME, NSPACE… M[i] enumerates the DTMs.

Gap-Theorem Gap-Theorem Proof II Proof III

g(n +1) > g(n) P(n,k) ⇔ ∀0 ≤ i ≤ n ∀x ∈Σn G[0](x) = g(x) M[i] (x) in DTIME(G[k]) or G[i +1](x) = g(G[i](x)) M[i](x) notin DTIME(G[k +1]) P(n,k) ⇔ ∀0 ≤ i ≤ n ∀x ∈Σn M[i] (x) in DTIME(G[k]) or f (n) = G[k] where k min. with P(n,k) = T M[i](x) notin DTIME(G[k +1])

G[0] G[1] G[2] G[3] G[0] G[1] G[2] G[3]

M[0](x) M[1](x) P(1,2) = T M[0]( y) M[0](x) M[1](x) P(1,2) = T M[0]( y) M[1](y) M[1](y)

Gap-Theorem Proof IV

f (n) = G[k] where k min. with P(n,k) = T

M[i] in DTIME(g( f (n))) then M[i](x) for | x |≥ i in DTIME( f (n)) •

G[0] G[1] G[2] G[3]

M[0](x) M[1](x) P(1,2) = T M[0]( y) M[1](y)

7