Almost-Everywhere Complexity Hierarchies for



Nondeterministic Time

y

Eric Allender

Department of Computer Science, Rutgers University

New Brunswick, NJ, USA 08903

z

Richard Beigel

Department of Computer Science, Yale University

51 Prosp ect St.

P.O.Box 2158, Yale Station

New Haven, CT, USA 06520-2158

Ulrich Hertrampf

Institut fur  Informatik, Universitat Wurzburg 

D-8700 Wurzburg,  Federal Republic of Germany

x

Steven Homer

Department of Computer Science, Boston University

Boston, MA, USA 02215



A preliminary version of this work app eared as [2].

y

Supp orted in part by National Science Foundation grant CCR-9000045. Some of this researchwas

p erformed while the author was a visiting professor at Institut fur  Informatik, Universitat Wurzburg, 

D-8700 Wurzburg,  Federal Republic of Germany.

z

Supp orted in part by the National Science Foundation grants CCR-8808949 and CCR-8958528.

Work done in part while at the Johns Hopkins University.

x

Supp orted in part by National Science Foundation grants MIP-8608137 and CCR-8814339, Na-

tional Security Agency grantMDA904-87-H, and a Fulbright-Hays research fellowship. Some of this

researchwas p erformed while the author was a Guest Professor at Mathematisches Institut, Universitat

Heidelb erg. 1

SUMMARY

We present an a.e. complexity hierarchy for nondeterministic time, and show that

it is essential ly the best result of this sort that can beproved using relativizable proof

techniques.

1 Intro duction

The hierarchy theorems for time and space are among the oldest and most basic results

in complexity theory. One of the very rst pap ers in the eld of complexity theory

2

was [14], in whichitwas shown that if tn = oT n, then DTIMET n prop erly

1

contains DTIMEtn, for any time-constructible functions t and T . This result was

2

later improved by Hennie and Stearns [15 ], who proved a similar result, with \tn "

replaced by\tn log tn". Still later, Co ok and Reckhow [8] and Furer  [10] proved

tighter results for RAM's and Turing machines with a xed numb er of tap es, resp ectively.

The time hierarchy theorems proved in this series of pap ers may b e describ ed as

\in nitely often" or \i.o." time hierarchies, b ecause they assert the existence of a set

L 2 DTIMET n that requires more than time tn for in nitely many inputs. Note,

however, that it may b e the case that for all n, memb ership in L for ninety-nine p ercent

of the inputs of length n can b e decided in linear time. That is, the i.o. time hierarchy

theorems assert the existence of sets that are hard in nitely often, although it is p ossible

that the \hard inputs" for these sets form an extremely sparse set.

However it turns out that much stronger time hierarchy theorems can b e proved. One

can show the existence of sets L in DTIMET n that require more than time tn for

al l large inputs. This notion is called \almost everywhere" or a.e. complexity, and has

1

A function T is time-constructible if there is a deterministic that, for all inputs of

length n, runs for exactly T n steps. For the purp oses of this pap er, if T is time-constructible, then

T n  n for all n. 2

b een investigated in [11, 12 , 25]. The following de nitions make this precise.

De nitions:



 For anyTuring machine M , the partial function T : ! N is the time function

M

of M. T x is the numb er of steps that M uses on input x if this numb er exists;

M

T x is unde ned if M do es not halt on input x.

M



 For functions f and g mapping either  or N to N, wesay that f = ! g  i , for

all r>0 and for all but nitely many x,if f x is de ned, then f x >rgx.

 Wesay that an in nite set L is a.e. complex for DTIMEt i for all deterministic

Turing machines M , LM =L = T x=! tjxj.

M

One of the a.e. time hierarchy theorems of [12 ] can now b e stated:

Theorem 1 [12] If T is a time-constructible function and tn log tn=oT n, then

there is a set in DTIMET n that is a.e. complex for DTIMEtn.

Thus for deterministic time complexity classes, the a.e. hierarchy is just as tightas

the i.o. hierarchy.However much less is known ab out hierarchies for probabilistic and

nondeterministic time.

The b est i.o. time hierarchy theorem for probabilisti c time that has app eared in

the literature is due to Karpinski and Verb eek [16]; however they are only able to show

that BPTIMEtn is prop erly contained in BPTIMET n when T n grows very

much more quickly than tn. On the other hand, a recent oracle result of Fortnow

and Sipser [9] shows that it is not p ossible to provea very tight time hierarchy theorem 3

for probabilistic time using relativizable techniques; they present an oracle according to

which BPP = BPTIMEO n. Clearly the [9] result also shows that there is no tight

a.e. time hierarchy for probabilistic time that holds for all oracles.

An early i.o. hierarchy theorem for nondeterministic time was given by Co ok [7]. The

strongest such theorem that is currently known is due to [23]. It is shown there that if

t and T are time-constructible functions such that tn +1= oT n, then there is a

set L in NTIMET n NTIMEtn. Furthermore, it is shown in [27, 17 ] that L



can even b e chosen to b e a subset of 0 . When t and T are b ounded by p olynomials,

this result is even tighter than the b est known results for deterministic time. However,

when T and t are very large, the gap b etween tn and tn + 1 is also quite large, and

thus the nondeterministic time hierarchy seems not to b e very tight. On the other hand,

Racko and Seiferas show in [21] that the i.o. time hierarchy theorem for nondeterministic

time cannot b e improved signi cantly using relativizable techniques. For example, they

n+1 n



A 2 A 2

= log n. Note on the  = NTIME 2 present an oracle A such that NTIME 2

n n+1



A 2 A 2

other hand that for al l oracles A, DTIME 2  6= DTIME 2 = log n.

Surprisingly, it seems that no results concerning an a.e. hierarchy for nondeterministic

time have app eared. Geske, Huynh, and Seiferas explicitly raise the question of an a.e.

hierarchy for nondeterministic time as an op en problem in [12].

This pap er essentially settles this question. We present an a.e. hierarchy theorem

for nondeterministic time, and we present an oracle relative to which the given theorem

cannot b e signi cantly improved.

It is necessary to discuss the interpretation that should b e a orded our oracle con-

structions, in light of the fact that comp elling examples of nonrelativizing pro of tech-

niques do exist [3, 19 , 24 ]. We maintain that it is useful to know what sort of hierarchies 4

hold relativetoal l oracles. Note that many imp ortant complexity classes are de ned in

terms of relativized nondeterministic computation; the levels of the p olynomial hierarchy

are the most obvious examples. For example, although it is a standard fact that there are

SAT 3 SAT 2

sets in DTIME n  that are a.e. complex for DTIME n  where the pro of of this

fact makes no use of any prop erties of SAT, the results of this pap er show that there are

Y 3 Y 2

oracles Y such that NTIME n  contains no sets a.e. complex for NTIME n . Thus

SAT 3 SAT 2

any pro of that NTIME n  contains sets a.e. complex for NTIME n  will have

to make essential use of certain prop erties of the oracle SAT. A longer discussion along

these lines may b e found in [1].

In this pap er we consider only time complexity.Aninvestigation of almost-everywhere

complexity hierarchies for nondeterministic space has b een carried out by Geske and

Kakihara [13]. They prove almost-everywhere hierarchy theorems for nondeterministic

space that are quite similar to those for deterministic space.

The organization of the pap er is as follows. In Section 2 we de ne precisely what

we mean by almost everywhere complexity for nondeterministic time. In this section

we also relate almost everywhere complexity to the concept of immunity. In Section

3we present our main results. In section 4 we turn to the questions of bi-immunity

and co-immunity, which also are relevant to almost everywhere complexity. The results

we prove concerning immunity, co-immunity and bi-immunity are the b est that can b e

proved using relativizable pro of techniques. 5

2 A. E. Complexity and Immunity

In order to talk ab out an a.e. complexity hierarchy for nondeterministic time, wemust

rst agree on the notion of running time for nondeterministic Turing machines. For

deterministic Turing machines, it is clear how to de ne the running time. However there

are at least two de nitions that are commonly used in de ning the running time of a

nondeterministic Turing machine:

 NTM M runs in time t on input x if every computation path of M on input x has

length  t.

 NTM M runs in time t on input x if [M accepts x implies there is an accepting

computation path of length at most t].

Note that for time-constructible T , the class NTIMET n is the same, no matter

whichchoice is made in de ning the running time of an NTM. That is, when one is

concerned mainly with placing an upper b ound on the running time of an NTM, it makes

little di erence how one de nes the running time.

However, in de ning an a.e. complexity hierarchy for nondeterministic time, it is

necessary to talk ab out lower b ounds on the running time of an NTM. We feel that an

a.e. complexity hierarchy de ned in terms of the rst notion would b e unsatisfactory,

since using that de nition, the running time of M can b e large, even when there is a

very short accepting computation of M on input x. If there is a short computation of M

accepting x, then our intuition tells us that x is an easy input for M to accept. Therefore

we de ne our a.e. complexity hierarchy using the second notion of running time. Note

that this de nition do es not dep end on the b ehavior of M for strings x=2 L. 6

De nition:



 Let M b e a NTM. Then the partial function T from  into N is de ned by:

M

T x = minft : there is an accepting path of M on x of length tg.

M

 An in nite set L is a.e. complex for NTIMEt i for all nondeterministic Turing

machines M , LM =L = T x= ! tjxj.

M

A concept that is closely related to a.e. complexityisimmunity. Let L b e a language

and let C b e a class of languages. Then L is immune to C if L is in nite and L has no

in nite subset in C . L is co-immune to C if L is immune to C . L is bi-immune to C if L

is b oth immune and co-immune to C .

In [4], Balc azar and Schoning noted the following relationship b etween almost-everywhere

complexity and immunity for deterministic classes.

Theorem 2 [4] Let t b e a time-constructible function. Then L is a.e. complex for

DTIMEtn i L is bi-immune to DTIMEtn.

The forward implication in this theorem is in fact true for al l functions t.However

we note that time-constructibility is necessary for the reverse implication.

Theorem 3 There is a non-time-constructible function t and a set L that is bi-immune

to DTIMEtn and not a.e. complex for DTIMEtn.

Pro of: Sketch Using diagonalizati on, one can construct a function t that oscillates

2 4

back and forth b etween tn=n and tn=n , such that every Turing machine that 7

2

runs in time tn actually runs in time n .Now using the a.e. complexity hierarchy for

4 2

deterministic time, let L b e a set in DTIMEn  that is a.e. complex for DTIMEn . It

4

follows that L is bi-immune to DTIMEtn, although L can b e recognized in time n ,

which is less than or equal to tn for in nitely many n.

Although a.e. complexity for deterministic time is related to bi-immunity,we showbe-

low that a.e. complexity for nondeterministic time is related to immunity. This di erence

comes ab out b ecause the de nitions of running time and a.e. complexity for nondeter-

ministic Turing machines are asymmetric, dep ending on the length of only the accepting

computations. In section 4 we return to this p oint again, and discuss bi-immunityin

more depth. The next prop osition is immediate from the ab ove de nitions.

Prop osition 4 Let t b e a time-constructible function, and let L b e a language. Then L

is a.e. complex for NTIMEtn i L is immune to NTIMEtn.

3 Main Results

In this section we prove some results concerning immunity among nondeterministic time

classes. Because of the results of the preceding section, these results maybeinterpreted

in terms of a.e. complexity.

We will need the following notational conventions:

k 

 For any function T and any natural number k , let T denote T comp osed with

itself k times.

 For any monotone nondecreasing unb ounded function t de ned on the natural num-

1

b ers, let t denote the function that maps y to the unique number x such that 8

tx  y and tx +1 >y, or to 1if tx >y for all x. In particular, note that

1 1

tt y   y , and tt y + 1 >y. It is imp ortant to give a precise de nition

of the intuitive notion of inverse, b ecause for very rapidly growing functions T , the

1 1

function T  t is very sensitive to the particular way in which t is de ned.

Our rst main result is an a.e. complexity hierarchy theorem for nondeterministic

time. Although this is proved using known translational metho ds see, e.g. [22 ], it

app ears to b e a new result. Later on in the pap er, we show that this hierarchy theorem

cannot b e improved substantially using relativizable techniques.

Our a.e. hierarchy theorem dep ends on the following lemma, which extends Theorem

0

2 of [23] in several small but technically necessary ways. Wesay that a function T is

-constructible on S if there is a nondeterministic Turing machine accepting S such

that all accepting computations on any input x 2 S have length exactly T jxj. Also,

O tn

given two functions T and t,wesay that T n 6=2 on S if for all c there exist

ctjxj

in nitely many x 2 S such that T jxj > 2 .

Lemma 5 Let t b e a time-constructible function, let T b e a function that is ntime-

O tn

constructible on some in nite set S , and assume that T n 6=2 on S . Then there

is a subset of S that b elongs to NTIMET n and is immune to NTIMEtn.

Pro of: We construct the desired language L by a priority argument. Let M ;M ;:::

1 2

b e an indexing of all nondeterministic Turing machines, clo cked to run in time tn. The

requirements are

N : M accepts a nite set or a string that is not in L,

i i

P : L contains at least i strings :

i

The priority order is N ;P ;N ;P ;:::: Initially, let L = ;, and say that all requirements

1 1 2 2

are unsatis ed. 9

Stage x:

Step 1: If x=2 S then reject x. Let n = jxj.

Step 2: Deterministically, sp end T n time simulating the construction sequen-

tially for short strings and verifying that certain requirements have b een sat-

is ed. Say that the remaining requirements need attention. In particular, let

j b e minimum such that P needs attention.

j

i

Step 3: Deterministically, for all i such that 1  i  log T n, sp end 2 T n steps

checking if M accepts x by simulating all computations of M on input x.

i i

Step 4: Based on Steps 2 and 3, nd the least i such that N needs attention and

i

M accepts x.Ifi exists and i  j then reject x; N is satis ed. Otherwise

i i

accept x; P is satis ed.

j

The correctness of the priority argument follows by standard techniques see [23].

Theorem 6 Let T and t b e monotone nondecreasing time-constructible functions such

1 k  O n

that, for some k ,T  t  n 6=2 . Then there is a set in NTIMET n that is

immune to NTIMEtn.

Before we present the pro of of Theorem 6, let us present a few concrete examples

of time b ounds to which the theorem applies. For example, if tn=n, then T n



n

maybechosen to b e any \nearly exp onential" function suchas2 for some ,oreven



1= log log n log n

n 2

2 or 2 , etc. as well as functions that growmuch more slowly, but cannot b e

represented quite so conveniently. In fact, for any of these choices of T , there are sets

in NTIMET n that are immune to NTIMEtn, where t may b e a function suchas 10

20

8

log log n

log n 2

n or 2 , etc. However, for these \nearly p olynomial" functions t, Theorem 6

do es not show the existence of sets in NTIMEtn that are immune to NTIMEn.

1 l O tn

Pro of: Note rst that there is some l such that T  t  T  n 6=2 .

1 k  O tn

Let k b e the least numb er such that the hyp othesis T  t  T  n 6=2 is

true. Let S equal the set of natural numb ers. For 1  i  k , let

0

1 i 1 i1

S = S \fn :t  T  n > t  T  ng:

i i1

1 i 1 i1

Note that each S is in nite, for otherwise t  T   t  T  almost everywhere,

i

1 k  1 k 1

and hence t  T   t  T  almost everywhere, so k could not b e minimal.

~

Let S denote the class of languages containing only strings whose length b elongs to the

i

set S .

i

The pro of pro ceeds by establishing the following two claims, which clearly suce to

prove the theorem.

1 k 

~

Claim 1: There is a set in S \NTIMET t T  n that is immune to NTIMEtn.

k

Claim 2: If every in nite set in NTIMET n has an in nite subset in NTIMEtn,

1 i

~

then for all i  k ,every in nite set in S \ NTIMET  t  T  n has an in nite

i

subset in NTIMEtn.

Pro of of Claim 1: By Lemma 5 it suces to show that the set of all strings with

1 k  1 k 

lengths in S b elongs to NTIMET  t  T  n and that T  t  T  is ntime-

k

constructible on that set. One can see by induction that for all n 2 S , there is a simple

k

1 i

nondeterministic strategy for guessing and then verifying the value of t  T  n that

1 i

can b e accomplished in time T  t  T  n. This involves guessing the value of

1

t T m for various m, and then verifying in time T m that this guess is correct. 11

1 k 

This strategy suces for testing memb ership in S and for computing T  t  T  n.

k

Pro of of Claim 2: The pro of of this claim pro ceeds by induction on i. For i =0

~

it is true by assumption. Assume therefore that every in nite set in S \ NTIMET 

i

1 i

t  T  n has an in nite subset in NTIMEtn, and let L b e an in nite set in

1 i+1

~

S \ NTIMET  t  T  n.

i+1

0 j j 1 0

~

Let L = fx10 : x 2 L and jx10 j = t T jxjg. Then L is an in nite set in S .To

i

j 0

test memb ership of x10 in L it suces to

j j

 test that tjx10 j  T jxj and tjx10 j +1 >Tjxj, which takes time  T jxj 

1 i+1 1 i j

T  t  T  jxj= T  t  T  jx10 j, and

1 i+1 1 i 1

 test if x 2 L, in time T  t  T  jxj= T  t  T  t T jxj =

1 i j

T  t  T  jx10 j.

0 1 i

Thus L 2 NTIMET  t  T  n.

0 0

By the inductivehyp othesis, L has an in nite subset A 2 NTIMEtn. Let A =

j j 1 0

fx : x10 2 A; where jx10 j = t T jxjg. Note that A is an in nite subset of L.

0

To test if x 2 A it suces to

1

 guess the value of t T jxj, which can b e checked in time T jxj; compute j such

j 1

that jx10 j = t T jxj.

j j 1

 check that x10 2 A, which can b e done in time tjx10 j=tt T jxj  T jxj.

0 0

Thus A 2 NTIMET n, and by assumption A and hence L has an in nite subset

in NTIMEtn. 12

Corollary 7 Let T b e a monotone nondecreasing time-constructible function such that,

k  n

for some k and almost all n, T n  2 . Then there is a set in NTIMET n that is

a.e. complex for NTIMEn.

Remark: The pro of of Theorem 6 makes use of nondeterminism only in order to

1

compute the function t in linear time. Because the inverse is unique, \NTIME" in

that theorem could just as well b e replaced by \UTIME," \TIME," or various other

1

counting classes. If we assume outright that t is computable in linear time, then

essentially the same pro of yields analogous hierarchy theorems with immunity for classes

like \BPTIME" and \RTIME" as well. Furthermore, it should b e noted that if t is any

1

time-constructible function, then t n can b e computed in time n log n viaana ve

binary search strategy.For essentially all \natural" time-constructible functions, there is

1

enough additional structure available to allow t to b e computable in linear time; thus

1

the condition that t b e computable in linear time is not very restrictive.

In particular, Corollary 8 b elow strengthens the hierarchy theorem for probabilistic

computation classes proved by Karpinski and Verb eek [16, Theorem 2] in twoways: it

presents a set in BPTIMET n that is immune for BPTIMEtn, and it allows the

2

di erence in the growth rates of T and t to b e smaller .

Corollary 8 Let T and t b e monotone nondecreasing time-constructible functions such

1 1 k  O n

that t is computable in linear time. Assume that, for some k ,T  t  n 6=2 .

Then there is a set in BPTIMET n that is immune to BPTIMEtn.

For the particular case of NTIME, the next result and its corollaries show that the

2

We leave it as an exercise to show that if T and t are monotone increasing functions satisfying the

1 3 O n

conditions of Theorem 2 in [16], then T  t  n 6=2 . 13

almost-everywhere complexity hierarchy theorem given by Theorem 6 cannot b e improved

byany relativizable pro of technique.

k 

Theorem 9 Let T b e a monotone nondecreasing function such that for every k , T n=

n

o2 . Then there is an oracle A relative to whichevery in nite set in NTIMET n has

an in nite subset in NTIMEO n.

Corollary 10 Let T and t b e monotone nondecreasing functions such that for every k ,

1 k  n

T  t  n=o2 . Then there is an oracle A relative to whichevery in nite set in

NTIMET n has an in nite subset in NTIMEO tn.

1

Pro of of Corollary 10: Let T and t b e given, and note that T  t satis es the

conditions of Theorem 9. Let A b e the oracle guaranteed by Theorem 9, and let L be

0 i i 0

any in nite set in NTIMET n, and let L =fx10 : x 2 L and jx10 j = tjxjg. L can

1 i

b e recognized relativeto A in time T jxj=T t jx10 j, and thus by the choice of A

0 A 0 i

there is an in nite set B L in NTIME O n. Thus the set B = fx : 9ix10 2 B g

A

is in NTIME O tn.

Pro of of Theorem: Let fM ;M ;:::g b e an indexing of nondeterministic oracle

1 2

Turing machines.

A

We will build A so that, for every machine M ,if M accepts in nitely many strings in

i

i

time T n, then there are in nitely many strings of the form hi; x; y i in A with jxj = jy j.

Furthermore, we guarantee that, for all i; x, and y ,if hi; x; y i2A, then jxj = jy j and M

i

accepts x with oracle A in time T jxj. De ne L = fx : 9y jy j = jxj and hi; x; y i2Ag.

i

A

 is in nite then clearly L is an in nite If A satis es the prop erties ab ove and LM

i

i

A A

subset of LM O n.  in NTIME

i 14

Here is a brief outline of the pro of strategy, whichisintended to make the pro of itself

easier to follow. The oracle A is constructed by an initial segment argument. During

stage s +1 we attempt to add one element to eachof L ;L ; :::; L . Of course this may

1 2 s

not b e p ossible, since for example it may b e the case that one of the machines M for

i

i< s accepts no strings at all, which makes it imp ossible to add any strings to L sub ject

i

to the conditions outlined ab ove. Supp ose that j is the smallest index such that it is

p ossible to add an elementto L during stage s. When such a string hj; x; y i is added to

j

A, this change in the oracle set may make it p ossible to add an element to some other

L for k

k k

accepted relative to the old oracle. In order to add elements to as many di erent L as

i

p ossible at stage s +1,we rep eat our attempts up to s times during that stage.

Our assumptions ab out T imply that for every k , there exists a number N [k ] such that,

k +1 n

for all n  N [k ]; k +1T n < 2 . The construction de nes an increasing sequence

of integers n with the prop erty that all elements of A of length  n are determined by

s s

the end of stage s. A set S is used to keep track of which L have b een augmented in the

i

current stage; k will denote the cardinalityofS ; d ;d ;::: is a nondecreasing sequence

0 1

of numb ers denoting the lengths of strings that have b een considered during the current

stage. A is a global variable in the following construction.

Stage 0: Set n = 0 and set A to ;.

0

s s+1

Stage s + 1: Set S = ;, k =0,and d = 1 + maxT N [s];T n .

0 s

LOOP

Among all i  s; i 62 S satisfying 15

A k 

M accepts some string u with T juj  d in time T juj, *

k

i

cho ose i such that i + jL j is minimized, and denote it by i . If no such i exists

i k

then exit the LOOP. If more than one such i exists then it do es not matter which

one wecho ose, so cho ose the least such i.

Then cho ose the lexicographically least string u satisfying *, and call this string

A

u . Select an accepting path of M u . Reserve for A all strings queried negatively

k k

i

k

in this path.

Cho ose a string v such that jv j = ju j and hi ;u ;v i is not reserved for A, and

k k k k k k

add hi ;u ;v i to A.We will prove shortly that such a string v exists.

k k k k

Add i to S , set d = maxju j;d  and set k to k +1.

k k +1 k k

END OF LOOP

A. Reserve Set n = the length of the longest string so far put into A or reserved for

s+1

for A all strings of length  n that have not b een placed into A.

s+1

End of Stage s +1.

We rst prove a simple claim relating ju j and d .

k k +1

k 

Claim 1: In stage s,if u is de ned, then T ju j  d .

k k k +1

k 

Pro of: If u is de ned, it is b ecause it satis es *, and hence T ju j  d .Now

k k k

k 

either d = d or d = ju j. In either case T ju j  d . This completes the

k +1 k k +1 k k k +1

pro of of Claim 1.

We next prove that, in the lo op of the construction, when a string u is found, it is

k

p ossible to nd a triple hi ;u ;v i to add to A. This follows from the following claim.

k k k 16

Claim 2: When a string u is found satisfying * during stage s + 1, the number of

k

ju j

k

strings of length greater than n reserved for A is < 2 .

s

Pro of: Note that for jn

j k s

reserved for A through the part of stage s + 1 where u is found and acted up on is

k

P

k

k  s+1 ju j

k

 T ju j  k +1T d   k +1T T ju j  s +1T ju j < 2 .

j k k k

j =0

s s

Toverify this last inequality note that d >T N [s] and T ju j  d , hence

k k k

s s

T ju j >T N [s], which implies ju j >N[s]. The inequalitynow follows, by the

k k

prop erties of N [s]. This completes the pro of of Claim 2.

It is clear from the construction that for all i; x, and y ,ifhi; x; y i2 A, then M accepts

i

A

x with oracle A and jxj = jy j. It remains only to show that if M accepts in nitely many

i

strings in time T n, then L is in nite.

i

For the sakeofacontradiction, assume that this is not the case, and let i b e the least

A

index such that M accepts in nitely many strings in time T n, but L is nite. Let t

i

i

b e a stage by which, for every j  i + jL j

i

 if L is nite, then every string of the form hj; x; y i in A is in A by stage t, and

j

 if L is in nite, then there are more than i + jL jj elements in L by stage t.

j i j

Note in particular that no element is added to L after stage t.

i

A

Let m b e the value of d at the b eginning of stage t + 1. Since M accepts in nitely

0

i

A

many strings, let x b e the lexicographically least string of length  m accepted by M

i

in time T jxj. Let A denote the partial oracle constructed by the end of stage t.From

t

A

t

the construction of A and the choice of stage t, one can see that if M accepted x, then

i 17

x would b e placed in L in stage t + 1, contrary to our choice of t.Thus,

i

M , on input x with oracle A, queries a string in A A along every accepting path since

i t

it accepts x with oracle A but rejects with oracle A . Cho ose one such path and let z

t

b e the string that is added to A last among all the strings queried along that path.

Let s b e the stage in which z is put into A. Let B denote the partial oracle that has

0

b een constructed by the b eginning of stage s. In stage s,we build a sequence of partial

oracles B ;B ;:::, where for all k =1; 2;::: there exists a string hi ;u ;v i, such that

1 2 k k k

B = B [fhi ;u ;v ig.

k k 1 k 1 k 1 k 1

Note that z = hi ;u ;v i for some k ; that is, there is some k such that B [

k 1 k 1 k 1 k 1

fz g = B . Since M , on input x, queries z , it is clear that T jxj jz jju j.By

k i k 1

B

k 1

k

Claim 1, T ju j  d . But now it follows that M accepts the string x with

k 1 k

i

k  k 1

T jxj  T ju j  d , and thus the next time through the LOOP in stage s we

k 1 k

add x to L ,incontradiction to our assumption that L has reached its nal value.

i i

The argument given in the pro of of Theorem 9 is nonconstructive. It is p ossible to

construct a recursive oracle A with the desired prop erties, but that construction is more

n

complicated. We also note that the b ound \2 " in the statement of Corollary 10 comes

only from the fact that we consider only oracles over the alphab et f0; 1g and thus there

n

are 2 p ossible queries of length n.Ifwewere to consider oracles enco ded over arbitrary

alphab ets, then the condition on t and T could b e weakened to \there exists a c such

1 k  cn

that for all k ,T  t  n=o2 ," which comes closer to matching the negation of

the hyp othesis of Theorem 6.

Note that in this oracle construction, we actually prove that there are oracles relative

to whichevery in nite set in NTIMET n has an in nite subset in UTIMEtn.

Similarly, as Rutger Verb eek [26] has suggested, the same arguments could b e used to 18

pro duce an in nite subset in RTIMEtn.

On the other hand, it should b e mentioned that there are oracles relative to which

NTIMEO t = DTIMEO t for all time-constructible t, and thus relative to these

oracles, the a.e. hierarchy theorem for deterministic time carries over to nondeterministic

time as well.

4 Consistent Nondeterministic Turing Machines

Although we showed ab ove that immunity is the natural notion to consider when de ning

an almost-everywhere complexity notion for nondeterministic time complexity,itmust

b e admitted that there is something unsatisfying ab out our de nition of a.e. NTIME

p

n

complexity.For example, Theorem 6 shows the existence of a set in NTIME2  that

j j

has no in nite subset in NTIMEn. This set is a subset of Z = fx10 : jx10 j =

p

jxj

g. Thus every input that is not in Z can b e rejected immediately. It would b e 2

more satisfactory if our notion of almost-everywhere complexity precluded the p ossibili ty

that in nitely many inputs could b e rejected easily. This section intro duces consistent

nondeterministic Turing machines, in order to form a more acceptable notion of a.e.

complexity for nondeterministic time.

Consistent NTMs were considered by Buntro ck [6]. We are unaware of any earlier

mention of this notion in the literature. ConsistentTuring machines are very similar

in some resp ects to the strong nondeterministic Turing machines that were de ned by

Long [18]. Among other uses, strong nondeterministic Turing machines provide a nice

characterization of NP \ coNP.

De nition: A nondeterministic Turing machine M is consistent if, on every input x, 19

either all halting computation paths are accepting or all halting computation paths are

rejecting.

Note that Long's strong nondeterministic Turing machines [18] are simply consistent

Turing machines such that there is a halting path for each input.

Given a consistent nondeterministic Turing machine M ,we de ne the \consistent"

running time of M on input x as follows: CT x = minft : there is a halting path of

M

M on input x of length tg.

Wesay that L is a.e. complex for consistent NTIMET n i [LM =L and M a

consistent NTM implies CT x=! T jxj]. The next theorem follows immediately

M

from these de nitions.

Theorem 11 Let T b e a time-constructible function. Then L has consistent a.e. NTIME

complexity T i L is bi-immune with resp ect to NTIMET n.

! tn

Prop osition 12 If T n= 2 , then there is a set in NTIMET n that is bi-immune

to NTIMEtn.

Pro of: By diagonalizati on.

The following theorem shows that this bi-immunity result cannot b e improved using

relativizable pro of techniques.

Theorem 13 Let T and t b e time-constructible functions such that for all large n,

tn

T n < 2 . Then there is an oracle A relative to which, for every in nite set L in

NTIMET n, either L has an in nite subset in NTIMEtn, or L has an in nite

subset in DTIMEn. 20

Corollary 14 Let T and t b e time-constructible functions such that for all large n,

tn

T n < 2 . Then there is an oracle A relative to which no set in NTIMET n is

bi-immune to NTIMEtn.

Pro of of Theorem: The oracle is built via a stage construction. At stage 0, A = ;.

Stage hi; l i. Let A b e the nite oracle constructed so far, and let n b e the length of

the longest string in A. If there exists any string x of length longer than n so that M

i

rejects x with oracle A [fhi; xig, then let A b e extended to A [fhi; xig, and reserve all

A. strings shorter than hi; xi for

Else, if no such string x exists, then for all large strings x, there is an accepting com-

putation of M on x with oracle A [fhi; xig. \Reserve" one such accepting computation.

i

tjxj

Note that along this path, at most T jxj < 2 strings are queried. Let y b e a string

of length tjxj such that hi; x; y i is not queried along this path, and extend A to the new

oracle A [fhi; xi; hi; x; y ig.

That completes the construction.

A

Let L b e an in nite set in NTIME T n, where L is accepted by M with oracle

i

A. If for all large l , case 1 is used in stage hi; l i, then the following algorithm accepts an

in nite set that contains only nitely many elements of L: On input x, accept i hi; xi

2 A.

If this is not the case, then for in nitely many l , case 2 is used in stage hi; l i. In this

case, the following algorithm accepts in nitely many elements of L: on input x, accept

i hi; xi2A and there exists a string y of length tjxj such that hi; x; y i2 A.

Remark: Note that the complement of the set we constructed in Theorem 6 contains 21

an in nite subset that is very easy to recognize, b ecause of the waywe used padding in the

translational argument. Theorem 13 is evidence that this is no accident, and it suggests

that any pro of of our a.e. hierarchy theorem may actually require translational techniques

in some fundamental way.To see what we mean, consider for example the case when

n1

2 n

T n= 2 and tn= 2 . The translational metho ds used in proving Theorem 6 show

that there is a set L 2 NTIMET n that is immune to NTIMEtn, but as we observed

at the start of Section 4, any string that is not \padded" is trivially in L , and thus L has

an in nite subset in deterministic linear time. Furthermore, Theorem 13 shows that any

set in NTIMET n that can b e shown to b e immune to NTIMEtn via relativizable

pro of techniques must have an in nite subset of its complement in deterministic linear

time.

Having settled the questions of immunity and bi-immunity,itnow remains only to

consider co-immunity.

Theorem 15 Let T and t b e time-constructible functions with T monotone and tn=

oT n. Then there is a set in NTIMET n that is co-immune with resp ect to

NTIMEtn.

Pro of: What is needed is to construct a set L 2 NTIMET n that is co-in nite

and intersects every in nite set in NTIMEtn.

Cho ose an unb ounded nondecreasing function r such that r n is computable in time

2 T log r n

T n, and such that r n 2  T n. For example r n can b e de ned to b e the

2

T log i

largest i  log n such that 2  T n= log n.

Let M ;M ::: b e an enumeration of nondeterministic two-tap e Turing machines that

1 2

run in time tn. By [5], for every set L 2 NTIMEtn, there is a machine M in this

i 22

enumeration such that L = LM .

i

Consider the following program P , which has a parameter M :

On input z of length n:

PART1: Run M on inputs x 2f1;:::;rng, and let OUTz  = the numb er of these

inputs that M do es not accept within T jxj time. This can b e determined using

exhaustive search of the computation tree. Note that x is viewed as a number

written in binary.

Let LIST = f1, 2, :::, OUTz g

For all i 2 LIST

For all y 2f1, 2, :::, r ng, using exhaustive search of the computation trees,

determine if y 2 LM  \ LM . Here, we consider y to b e in LM  only if

i

there is an accepting computation of M on y of length at most T jy j. If so,

remove i from LIST.

Let LISTz  denote the current contents of LIST.

PART2: Nondeterministically guess i 2 LISTz . Use T n time to simulate M on

i

input z .

For any xed Turing machine M , the running time of this nondeterministic program

T log r n 2 T log r n

P is r n2 +r n 2 + T n= O T n. Also, if P is run on a three-

tap e nondeterministic Turing machine, then for each i, for all large inputs z , T jz j time

is sucient to simulate tjz j steps of M on input z in PART2.

i

By the time-b ounded version of the recursion theorem see e.g. Theorem 6.1.8 in 23

[20], there is a nondeterministic Turing machine M that executes P with parameter

M,having time complexity O T n. We claim that LM is co-immune with resp ect

to NTIMEtn. That is, we need to show that M rejects in nitely many strings, and

that LMintersects every set in NTIMEtn.

In order to do this, rst we argue that OUTz  is a monotone nondecreasing, un-

b ounded function. It is obvious that OUTz  is monotone nondecreasing. Assume for

the sakeofacontradiction that OUTz 

a subset of f1; 2;:::;kg. Note also that x> z= LISTx LISTz . Thus there is

some set S f1; 2;:::;kg such that for all large z , LISTz =S .

Wenow claim that i 2 S = LM  is nite. This is the case, since if 1 i 2 LISTz 

i

and 2 M accepts z and 3 the computation of M on z can b e simulated in T jz j

i i

steps, then z 2 LM. Thus on inputs of length n such that log log n>jz j, it will b e

discovered that z 2 LM  \ LM, and thus i will b e removed from S , contrary to our

i

choice of S . This establishes our claim that i 2 S = LM  is nite.

i

Thus for all large inputs z , none of the simulations carried out in PART 2 lead to

acceptance, and thus LM is nite. But then for all large z there are more than k

strings of length r jz j that are rejected by M, and thus OUTz  >k for all large z .

Thus wehave proved that OUTz isanunb ounded function. And thus M rejects

in nitely many strings.

Now let L be any in nite set in NTIMEtn. Then L = LM  for some i. Let z

i

b e a string in L such that OUTz  >i and such that a simulation of M on input z can

i

b e carried out in time T jz j. It is clear from the construction that either z 2 LM, or

there is some x< z such that x 2 LM  \ LM. The theorem follows.

i 24

5 Conclusions

Wehave considered the question of whether one can prove a tight a.e. hierarchy theorem

for nondeterministic time. Wehave considered di erentways in which one might de ne

what is meantby a.e. complexity for nondeterministic Turing machines, and in all cases we

have presented hierarchies that are close to the b est that can b e proved using relativizable

pro of techniques.

One way to view these results is as an exploration of the strengths and weaknesses of

translational metho ds. Wehave proved essentially the strongest immunity results that

can b e proved using translational metho ds, and wehave also shown that any relativizing

pro of showing the existence of immune sets in NTIME classes has a characteristic of a

\padding" argument. See the remarks after the pro of of Theorem 13.

The i.o. time hierarchy for nondeterministic time is also proved by translational meth-

o ds, but in that setting a more sophisticated argument allows a tighter hierarchytobe

proved. Up to now, the b est i.o. time hierarchy for probabilistic time classes is the same

as the a.e. time hierarchy mentioned after the pro of of Theorem 6. It would b e inter-

esting to know if the oracle construction of [9] can b e improved to show that the i.o.

probabilistic time hierarchy given by Theorem 6 is optimal.

6 Acknowledgments

We thank the authors of [12] for sharing this pap er with us, and John Geske, Jo el Seiferas,

Alan Selman and Jie Wang for helpful discussions. 25

References

[1] E. Allender, Oracles vs Pro of techniques that do not relativize, in: Proc. SIGAL

International Symposium on Algorithms, Lecture Notes in Computer Science 450

Springer, Berlin, 1990 39{52.

[2] E. Allender, R. Beigel, U. Hertrampf, and S. Homer, A note on the almost-

everywhere hierarchy for nondeterministic time, in: Proc. 7th Symposium on The-

oretical Aspects of Computer Science, Lecture Notes in Computer Science 415

Springer, Berlin, 1990 1{11.

[3] L. Babai, L. Fortnow, and C. Lund, Non-deterministic exp onential time has two-

prover interactive proto cols, in: Proc. 31st IEEE Symposium on Foundations of

Computer Science 1990 16{25.

[4] J. Balc azar and U. Schoning, Bi-immune sets for complexity classes, Mathematical

Systems Theory 18 1985 1{10.

[5] R. Bo ok, S. Greibach, and B. Wegbreit, Time- and tap e-b ounded Turing acceptors

and AFL's, J. Computer and System Sciences 4 1970 606{621.

[6] G. Buntro ck, Logarithmisch platzbeschrankte Simulationen Do ctoral Dissertation,

Technische Universitat Berlin, 1989.

[7] S. Co ok, A hierarchy for nondeterministic time complexity, Journal of Computer

and System Sciences 7 1973 343{353.

[8] S. Co ok and R. Reckhow, Time-b ounded random access machines, Journal of Com-

puter and System Sciences 7 1973 354{375. 26

[9] L. Fortnow and M. Sipser, Probabilistic computation and linear time, in: Proc. 21st

IEEE Symposium on Foundations of Computer Science 1989 148{156.

[10] M. Furer,  Data structures for distributed counting, Journal of Computer and System

Sciences 28 1984 231{243.

[11] J. Geske, D. Huynh, and A. Selman, A hierarchy theorem for almost everywhere

complex sets with application to p olynomial complexity degrees, in: Proc. 4th Sym-

posium on Theoretical Aspects of Computer Science, Lecture Notes in Computer

Science 247 Springer, Berlin, 1987 125{135.

[12] J. Geske, D. Huynh, and J. Seiferas, A note on almost-everywhere-complex sets and

separating deterministic-time-complexity classes, Information and Computation 92

1991 97{104.

[13] J. Geske and D. Kakihara, Almost-everywhere complexity, bi-immunity, and nonde-

terministic space, in: Advances in Computing and Information { ICCI '90, Lecture

Notes in Computer Science 468, Springer, Berlin, 1990 44{51.

[14] J. Hartmanis and R. Stearns, On the computational complexity of algorithms, Trans-

actions of the AMS 117 1965 285{306.

[15] F. Hennie and R. Stearns, Two-tap e simulation of multitap e Turing machines, J.

ACM 13 1966 533{546.

[16] M. Karpinski and R. Verb eek, Randomness, provability, and the separation of Monte

Carlo time and space, in: E. Borger, ed, Computation Theory and Logic, Lecture

Notes in Computer Science 270 Springer, Berlin, 1987 189{207.

[17] Ming Li, Lower Bounds in Computational Complexity, Do ctoral Dissertation, Cor-

nell University, 1985. 27

[18] T. Long, Strong nondeterministic p olynomial-ti me reductions, Theoretical Computer

Science 21 1982 1{25.

[19] C. Lund, L. Fortnow, H. Karlo , and N. Nisan, Algebraic metho ds for interactive

pro of systems, in: Proc. 31st IEEE Symposium on Foundations of Computer Science

1990 2{10.

[20] M. Machtey and P.Young, An Introduction to the General Theory of Algorithms

Elsevier North-Holland, Inc., New York, 1978.

[21] C. Racko and J. Seiferas, Limitations on separating nondeterministic complexity

classes, SIAM J. Comp. 10 1981 742{745.

[22] S. Ruby and P. Fischer, Translational metho ds and computational complexity, in:

Proc. 6th IEEE Symposium on Switching Circuit Theory and Logical Design 1965

173{178.

[23] J. Seiferas, M. Fischer, and A. Meyer, Separating nondeterministic time complexity

classes, J. ACM 25 1978 146{167.

[24] A. Shamir, IP = PSPACE, in: Proc. 31st IEEE Symposium on Foundations of

Computer Science 1990 11{15.

[25] C. Smith, A note on arbitrarily complex recursive functions, Notre Dame Journal

of Formal Logic 29 1988 198{207.

[26] R. Verb eek, p ersonal communication.

[27] S. Z ak,ATuring machine hierarchy, Theoretical Computer Science 26 1983 327{

333. 28