Chapter 3 Blum's Complexity Theory

Chapter 3 Blum's Complexity Theory

207 CHAPTER 3 8. BLUM’S COMPLEXITY THEORY In this chapter we study the computational complexity of algorithmically computable functions in terms of...

3MB Sizes 2 Downloads 111 Views

207

CHAPTER 3

8. BLUM’S COMPLEXITY THEORY

In this chapter we study the computational complexity of algorithmically computable functions in terms of the algorithms needed to compute them. To this aim we use the axiomatic system due to M.BLUM. It should be emphasized that in this approach the input/output processes do not contribute to the computational complexity measures; the complexity of these processes will be analysed in the next chapter.

&I. EXAMPLES

The present section is focused on questions of the type “how many steps are needed to compute...?”, with respect to the time-complexity. Recall that (w i)i>,, is the acceptable gGdelisatioh of unary p.r. functions induced by the arithmetisation of formal equations (see Section 2.3), and that (Qi)i2a is a sequence of p.r. functions satisfying the following two conditions: For every natural number i,dom(wi) = dom(Ri) The predicate M : N 3 -+ {O,l},

.

(1.1)

(1.21

defmed for all i,z and y in QV by

i

1 , ifni(z) < _ Y M(i,z,y) = 0 , otherwise,

9

ia (primitive) recursive (see Theorem (2.3.27)). We interpret hng(fli(z)) to be the length of the shortest derivation of the value w i ( z ) from the i t h set of equations, provided ui(z) $ c q Qi(z) = ccj i the opposite case. Thus, Q,(z)gives a reasonable measure of the number of steps required by the computation of w i ( z ) , in cme this

208

Calude

computation eventually halts. We give a "time-relativization" defmed by

i

of the function d i a g : N

1, ifw,(z)

,

diag(z) = 0

for every t in natural number

f

N

x,

otherwise,

IN, namely the function f , : N t

-

+

by

I d.1

1 9 ifn*(t)

RV

defined for every

1

where r :hT -- RV is a fmed recursive function. The function diag is not recursive (Theorem (2.5.3)), while f, is recursive (because f,(z)= M(z,z,r(z)), for every z in RV). Hence, a natural question may be raised: How many steps are necessary to compute f,? We begin with a lower bound.

(1.1) Theorem. (BLUM [1966]) For every natural number i such that f, = w , , we have for infmitely many natural numbers

2.

Proof. Assume, for the sake of a contradiction, that there exist two natural numbers j and n such that f , = w j , and fl,(z) < r(z),for every t > n. Defme the p.r. function 4:RV 3 R V by

d(2) for every that

t

in

RV.

0 =

if fr(z) = 0

7

7

, otherwise,

x'

Let k be an index for nk(z)

=

q5

nj(Z)

in the enumeration (wi) such

9

for every t satisfying the inequality n,(z) > r ( t ) . By means of the Lemma (2.4.12) we can effectively find an index /I > n satisfying the following two conditions:

4=w,

n"(Z)= n,(z)

for every z such that

(1.3)

1

7

n,(z) > r ( t ) .

Two cases must be analyced according to the relation between

(1.4)

no(()

209

Chapter 3

and r(z). If $I 5, r ( t( ), ! then ) f,(t) = 1. Hence d(t) = x, i.e. w ( ( ! ) = xj so, by (1.1), n , ( t )= q a contradiction. If n , ( t ) r(!), then n , fl,(t) r ( t ) . In view of the hypothesis and of f,(t) = 0. Since t the construction of k and ! we have: r(!) a,(!) = n,(t) = $I,([).

>

>

<

>

Again we reach a contradiction.

Remark. Theorem (1.1) furnishes examples of recursive functions which intrinsically require a large amount of computation time. In particular, if r b not primitive recursive, then f, cannot be primitive recursive. (1.2) Definition. (YAMADA [1962]) A recursive function f :N--c N is said to be real-time computable if there exist two naturals i , j such that f = w and for each z 2 j,

n,(Z) 5 z

a

(1.8) Example. The successor function is real-time computable.

(1.4) Example. An application of Theorem (1.1) to the identity function shows that the recursive function f : N --c N defmed by

for every z in N , is not real-time computable. 0

Remark. An obvious extension of Defmitiorr (1.2) for recursive functions of 1~ variables shows that the predicate M, defmed by (1.2), is not realtime computable because for every z in RV,

i

1,

M ( z , z , z )= 0

ifn,(.)s

Z

9

, otherwise.

To obtain an upper bound on the number of steps which are necessary to compute f, we fm an index j for r . (1.6) Theorem. There exist two recursive functions 8 : N --c N and IV such that f,(z) = u,(,)(z), for every t in N , and g:nv?

2 10

Cllude

for every z

2 j.

Proof. The recursive function a b supplied by the a-m-n Theorem. TO obtain the inequality (1.5) we consider the auxiliary recursive function t :lV3 lV given by --+

r;(il(z) t(z,i,l/) = 0

9

if ni(z) I Y 9 otherwise.

Next we defme the recursive function g by g(z,y) = max(t(z,i,y) li 5 2). Since t ( z , j , n j ( z ) )= fl,(j)(z), it follows that for every z 2 j we have:

g(z,nj(z)) = m a ( l ( z , i , n j ( z ) )t i

5 z)2 n , ( j ) ( z )

-

0

We close t h b series of examples with a general negative result following from Theorem (1.1).

(1.8) Theorem. There b no recursive function 6:IP -+ N such that for all natural numbers i and 2 , if w i ( z ) # .xj then ni(z) 5 b ( z , w i ( z ) ) .

Proof. For the sake of a contradiction, assume that such a recursive bound b exists and defme the recursive function H : N + JV by

H ( z ) = b ( z , O ) + b(z,l)

,

for every natural number z. have

For every recursive predicate w i and for every natural number z,we ni(z) I b(z,wi(z))

I H(z)

We get the desired contradiction if we take

*

w i = fSuccoH, as

in Theorem

(1.1). 0

211

Chapter 3

8.2. BLUM SPACES

This section introduces the BLUM general axiomatics for the quantitative study of computational complexity and gives the introductory results. In Section 3.1 we have obtained some “asymptotic evaluations” for the time-complexity of certain recursive functions which bear a resemblance to non-computable functions. These complexity-theoretic results can be obtained, in a general manner, using the axiomatics proposed by M. BLUM. (2.1) Definition. (BLUM [1967a]) A BLUM space is a couple where (di)ilo is an acceptable gGdelisation of all unary p.r. functions and (9i)ilois a sequence of p.r. functions satisfying the following two axioms (called BLUM aziorne):

2 = ((#i),(*i)),

For every natural number i,dom(bi) = dom(ai) The predicate M : N 3 + {O,l}, defined by

i 1

M(i,z,y)

=

0

7

,

if*i(z)

.

(2.1) (2.2)

LY ,

for all i,z and y in A?,is recursive. BLUM [1967a] calls the p.r. functions ai, satisfying axioms (2.1) and (2.2), etep-counting functions or, Computational complezity meaeuree; the predicate M is called a measure of cornputation. It should be emphasized that the stepcounting functions are associated to the algorithms and not directly to the p.r. functions. There are two major reasons which motivate this construction: a) each p.r. function has an infinity (not r.e.) of algorithms which compute it, and b) each effective computation of a p.r. function deals with some algorithm specifying that function. Later, we shall see that complexity-theoretic studies provide a decisiie argument in this direction by showing that the complexity of a p.r. function cannot be defined as the complexity of its “best” algorithm since there are certain p.r. functions having no “best” algorithm.

Axiom (2.1) says that we get a value of the stepcounting function iff the computation of the corresponding algorithm produces a value for the p.r. function being computed. Axiom (2.2) expresses the possibility to determine if a particular computation halts within a certain bound. An an immediate consequence of axiom (2.2) we deduce that the ternary predicates “ai(.) < y”, “@i(z) = y”, and “*i(z) > y” are rccursive. Furthermore, for all natural numbers i,2, @i(z)= miff (@i(z) > y,

212

Cdudc

for every y

20 ) .

(2.2) Example. The time-complexity R i associated to w i is our basic example of BLUM space ((wi),(ni)). 0

(2.3) Example. Every acceptable giidelisation

(c$~) can

be equipped with (n,)and ROGERS' Isomorphism Theorem, i.e. by defining for all i and z in N , a set of step-counting functions by means of the time-complexity

where t : N

(wi):bi

-. fV

@ i ( z )= nt(i)(z)

9

is a bijective recursive function which ties (4,) and

= "+).

0

(2.4) Example. Let ( z , ) ~ ?be~ an acceptable giidelication of TURING machines (see DAVIS [1958]) and defme a,(.) = y iff z, with input z ultimately halts and uses precisely y squares of the tape for computation. Clearly, (a,)satisfies (2.1). To see that (2.2) equally holds we notice that either the number of the tape squares used in computation increases as the computation proceeds or the TURING machine enters a loop. To end this sketch proof notice that the number of TURING machine operations occurring before entering a loop or using a new square on the tape can be effectively determined. This is a standard example of memory-complezity, 3

Remark. Some related examples of BLUM spaces are the number of

.U.,GOL instruction executions, the amount of space used for the execution of

ALGOL programs, etc.

(2.6) Example. (BLUM [1967a]) Let Q - = ((4,),(@,)) be a and put, for all i and z in N ,

a;(.),

if i

f

BLUM space

i,,

i f i = i,, where i , is a fixed index for some recursive function. @= is also a BLUM space.

((si),(i,))

It is seen that 0

213

Chapter 3

Remark. Example (2.5) is pathological since the step-counting functions cannot distingubh the relative complexity of particular recursive functions. For example, the complexity of di0 WM decreed to be the constant zero function, in spite of the fact that ai0could be a very large function,

6i

say I

Oi,(Z) = 2

I.''

}

z times

.

In fact, as we shall prove in the following example, we can arbitrarily modify the complexity of an infmity of algorithm. (2.6) Example. Let Q = ((t$i),(@i)) be a BLUM space, and let f ,g:N -+ RV be two recursive functions satisfying the following two conditions: The function f is strictly increasing.

(2.3)

For every natural number i,t$f(i)and 6g(i)are recursive.

(2.4)

Then there is a sequence of step-counting functions (6i) such that for every natural number i there exists a j in nV such that t$j = t$f(i) and Q j = 9g(i)*

In view of (2.3) the range of f is recursive and the equation f ( 2 ) = i has at most a solution, for each fued i . We put

i

,

t$g(j)(z) if i = f ( j ) ,for some j in

'i(')

for all i and z in

= Oi(z)

,

N ,

otherwise,

N.

It is clear that 4 - = ((t$i),(6i)) is also a BLUM space, and for every natural number i , j = f ( i )works. 0

We stress the discrepancy between the elegance and the generality of

thia approach on one hand, and its weakness as coneerna the poaaibilities of distinguishing among different modela of computation, or among d i f ferent types of resources used for the same model, on the other.

(2.7) Example. Let (di) be an acceptable g6deliration. Then the p.r. functions ai, Oi(z) = 0, for all natural numbers i and 2, fail to satisfy condition (2.1). 0

214

Cdude

(2.8) Example. Let (di) be an acceptable gGdeliration. The p.r. functions ai, cb,(z) = Si(z), for all natural numbers i and 2 , fail to satisfy condition (2.2) (otherwise we would be solving the Halting Problem). 0

Remark. Examples (2.7) and (2.8) show that BLUM a x i o m are indepcn-

dent.

(2.9) Example. Let Q = ((di),(ai)) be a BLUM space and let f :pV + RV be a recursive-function such that f (z)> z,for every z in N . Then 9 , = ((Si,(foai)) is a h a BLUM space. The axiom (2.2) holds since the measure of computation of 9 - , can be written as:

a =O

for ail natural numbers i,z and y . U

The next result gives a method, based on the minimization operator, for recognizing when a given sequence of p.r. functions is a sequence of stepcounting functions for some acceptable gGdeliaation. (2.10) Proposition. Let (di) be an acceptable gGdeliaation. A sequence (ei) of p.r. functions is a computational complexity measure for (Si) iff (ai) satisfies condition (2.1) and in addition there exists a recursive predicate R : N 3--* (0,l) such that for all i and z in LV we have

a;(.)

= PY[R(i,Z,ar)= 11

*

(2.5)

Proof. Take R = M , for the direct implication, and notice that for all natural numbers i, t, and z , t=o

for the converse implication. 0

Remarke. a) Using Proposition (2.10) we can prove that from every recursive function g:N3 N which ia strictly increasing in the last variable, and from every BLUM space Q = ((+i),(@i)), we can obtain a new BLUM spsce - = ((4),(4,))by the-defmition

-.

8

215

Chapter 3

di(z) = g(i,z,*i(z))

for all natural numbers i and

9

Z.

Indeed, for all i and z in

N,

&i-(z)= C C Y [ R ( ~ ,=~ 1 ,1Y ) 9

where R : N 3+ {0,1} is the recursive predicate given by: ~(ivz =

9 eq(g(i,z ,k

k 4

*eq (@i (2

*

b) There exists a p.r. function w :nV *nV which does not belong to any complexity measure. For example, let

(2.11) Theorem. For every acceptable gGdelization (4,) we can fmd a

BLUM space 9 - such that for all i and z in PI we have: di(z) = P(@i(z))

(2.6)

2

where p :N+ Bv is some fmed recursive function.

Proof. KLEENE's Normal-Form Theorem furnishes the recursive functions p : N + N,T : N 3--+ (0,l) such that for all i and z in N , Wi(z) = P(PY[T(~,~,Y) = 11)

For every acceptable g6delisation

a,(.)

(2.7)

(si) we put

~ ~ [ T ( t ( i ) , z=, y11) 9 where t : N + RV ia a recursive bijection, supplied by ROGERS' Isomorphism Theorem, satisfying the equation 4i = w t ( i ) . In view of Proposition (2.10), 9 - is a BLUM space; formula (2.6) follows directly from (2.7). =

0 Fix an acceptable 86delization (4i). For all computational complexity meaeares (ai) and (+i)lfor (4i), we defrne two sequences of p.r. funct b n s (ei Q&i) and (aj @Oi) 811 €allows: (@i QQi)(z)

(4i O&i)(z)= mu(ai(z),ei(z)) for all i and z in

N.

(2.8)

= h(@i(Z),&i(z))

,

(2.9)

216

Caludc

(2.12) Theorem. (ADRIANOPOLI and DE LUCA [1974]) The set of computational complexity measures associated to (#i) is a noncomplemented lattice under the operations Q a n d 0.

Proof.

First we prove that

((4i),(aiQdi)) and (f4i),(ai04,)are )

BLUM spaces. From Proposition (2.10) there exist two recursive predicates R , R : N 3-* (0,lj satisfying the equalities

a,(.)

= P Y [ R ( ~ , ~= , u 1)1

9

ii(Z)

= p * [ d ( i , z , z ) = 11

,

for all i and z in N. It is seen that for all natural numbers i and z, ( 0 , O i i ) ( z ) = r v [ m a x ( R ( i , z , ~ ) ~ ( i ,= z , 11 ~))

and

(ai Oii)(z) = ~ y i ~ * ( i , z , y=) 11

9

where R*(i,Z,Y) = m a x ( R ( i , z , Y ) . d g ( ~ ~ ( i , z , t ) ) , t

4

%i 3 2 $3).88(r5R(i,z t

4

,m

*

Since condition (2.1) is obviously fulfilled, we can apply Proposition

(2.10) t o decide that Q and @are internal operations. Furthermore, from

(2.8) and (2.9) it follows t ha t the operations Q a n d @satisfy the axioms of a distributive lattice. We fmish the proof by showing that the resulting lattice has neither

a maximum nor a minimum (with respect to the induced order i.e. (ai) <(4i) iff Oi(z) 5 8i(z), for all i and z in N).The first assertion (the lattice hss no maximum) follows directly from Example (2.9) by taking f to be strictly increasing. Hence, we have to check the existence of a

minimum. We prove the following: Intermediate step. If Q = ((4i),(ai)) is a BLUM space and g : f l --.* Bv is a recursive function satisfying the inequality @i(z)2 g(i,z)

(2.10)

9

for all natural numbers i and z,then the sequence

a:(,)

=

ai(z) A g ( i , z ) ,

is a computational complexity measure for (&).

(a:), (2.11)

Indeed, if for all i and z

217

Chapter 3

we have +i(z) = P Y [ R ( ~ , z ,= Y )11

9

for some recursive predicate R : N 3-+ {O,l}, then

@I(.) = rY[R(i,z,g(i,z)+Y)= 11 , for all natural numbers i and z, which shows that the axiom (2.2) holds; obviously (2.1) holds too. For the consistency of the Intermediate step we need an example of a recursive function g satisfying (2.10). To this aim we associate to every recursive function f :N-+ IV the recursive function gf :nV2 N given by

-

@ i ( z )9

if +i(z)

I f (2)

g,(i,z) = f(z), otherwise.

9

Clearly, gf works. Now let (a,.)be an arbitrary computational complexity measure and consider the recursive function 91, where f = Succ. Let (a:) be the sequence of p.r. functions defmed by (2.11). Clearly, for all i and z in N, a:(=)5 Oi(z). Moreover, the equality cannot occur since it would give g(i,z) = 0, for all i and z Edom(q$), i.e. ai(z) = 0, for all i and z Edom(#i). In this way we contradict axiom (2.2) (for, in this case the recursive function 1 , if z E dom(di)

,

would solve the Halting Problem). 0

(2.18) Corollary. Let (0 be a BLUM space. Then, there is no recursive function g :N2 nV satisfying the equality -+

a,(.)

for all i and z in

= g(i,z)

,

(2.12)

N such that z E dom(di).

Proof. The existence of a recursive function g satisfying (2.12) contradicts the Intermediate step in the proof of Theorem (2.12) (because in this = 0 , for all i and z E dom(9i)). case (2.10) holds and

).(I@

0

218

Cdudc

(2.14) Corollary. Let be a BLUM space. Then there is no recursive function f :hV -+ UV sueh that for all natural numbers i and z, if z E dom(4i), then @i(z)<

f(z)

(2.13)

Proof. From the existence of a recursive function f satisfying (2.13) it follows that for all natural numbers i and z, if z Edom(4i), then g,(i,z) = +i(z), thus contradicting Corollary (2.13). 0

(2.16) Corollary. The lattice of all sets of step-counting functions asaociated to a futed acceptable giideliration is not dense.

Proof. Let Q be a BLUM space. Fix a pair of natural numbers (i,,z,), such that 4,7z0) # x, and consider the recursive function g : N 3 -c N defmed by

i

y+l

g ( i 9 z 7 y )= y

,

, if i

=

i , and z = I , ,

otherwise.

(2.14)

In view of the Remark a) following Proposition (2.10), we can consider the set of step-counting functions (&,), such that for all i and z in N we have &i(z) = g ( i , z , a i ( z ) )

Furthermore, &i(z) 2 4i(z), for all i and z in 8i,(zo) =

Qi,(zo)

+

1

.

N ,and, by (2.141, 7

so that ( 0 , )and (8,)are distinct. Nevertheless, there is no computational complexity measure associated to (4,) which can be interspersed between (ai) and (6i). 0

11.8. RECURSIVE DEPENDENCE OF COMPLEXITY M E A S

URES

The pathological examples of BLUM spaces discussed in Section 3.2

219

Chapter 3

lead to the question whether any interesting consequences can follow from

BLUM’s axiomatic defmition of computational complexity. The present section is dealing with such a result. We show that all computational com-

plexity measures are ‘‘aeymptotically the same” within some recursive factor. In other words, if a function can be “easily” computed with respect to a certain computational measure, then it can be “easily” computed, modulo some recursive factor, in all measures. We begin with the announced result.

(3.1) Theorem. (BLUM [1967a]) Let = ((4i),(@i)) and = ((6i),(&i)) be two BLUM spaces. Then there exists an increasing recursive function h : I @ RV such that for all naturals i and z,if z 2 i , then

-.

2 h(z,&i(z))

9

(34

and

Proof. For all z and y in RV, put h(z,y) = rnax(O,ai(z),6i(z) l i I z and (ai(.) 5 y or &i(z)I 0)). Since the condition (ai(.) 5 y or 6,.(z)I y ) can be equivalently written aa M(i,z,y) + $(i,z,y) 2 1, and dom(6i) = d o m ( a i ) = dom(6i), it follows that h is recursive. Ciearly, for every z 2 i , we have:

Remarke. a) If h satisfies the statement of Theorem (3.1), and f:N-., RV is a strictly increasing recursive function, then the recursive function H = f o b also works.

b) The weakness of Theorem (3.1) haa two sources: 1) the possibility that the recursive factor h be arbitrarily large, and 2) the inequalities (3.1) and (3.2) hold for all but fmitely many values of z (and they cannot be made to hold for all values of 2). So, there exiats a fmite aet, possibly very large, where we cannot “manage” relatedness. This type of asymptotic

220

Cduda

evaluation is specific to this axiomatic approach. c) An a consequence of Theorem (3.1), we notice that the computational complexity of any class of recursive functions which is recursively bounded in one measure (for example, by polynomials) is recursively bounded in every measure.

d) An obvious application of ROGERS’Isomorphism Theorem shows that in Theorem (3.1) we can work with completely different BLUM spaces (i.e., the recursive dependence of measures holds even when we are dealing with diierent computation models).

4

(a.2) Scholium. Let 2 = ((di),(ai))and = ((di),(&,)) be two BLUM spaces such that for naturals i and z , ai(z) 2 z, and bi(z) 2 2. Then there exists a recursive function g : N -P N such that for all naturah i and 2 , if z 2 i , then +,(2)

L giii(z))

7

(3.3)

-

(3.4)

and

I g(ai(z))

Proof. It is seen that the recursive function g defrned by g(z) = h ( z , z ) , for every z in N (here h is the increasing recursive function furnished by Theorem (3.1)), works. 0

Remar ke. a) The quite realistic hypothesis @i(z)2 z requires that the stepcounting function increases with the input size. Although this condition can be easily realized, there exist infmitely many BLUM spaces which fail to satisfy it (see in this respect the proof to Theorem (2.12)). b) A minor modification in the above proof shows that Scholium (3.2) equally holds if we replace the condition a,(.) 2 z by a,(.) 2 f ( z ) , where f is an increasing recursive function (for example, f(z)= [log2z]).

Notation. We shall often prove statements which hold for all but finitely many natural numbers z (almost everywhere) or for infrnitely many z. Hence, we introduce abbreviations: a) If the statement S, involving the variable z, holds for all but finitely many z, then we shall write “S(z)u.c.”; b) If the statement S holds for infmitely many z,then we shall write “S(z) i.0.”.

In contrast to Corollary (2.13), we shall prove that in every BLUM space the set of step-counting functions is r.e.

22 1

Chapter 3

(9.3) Proposition. Let 9 be a B L W space. Then there exists a recur- ) such that for every i in sive function d : N -* N (which depends upon 9

IN, @i = 4d(i)

Proof. Let w

(3.5)

*

:w 3 N be the p.r. function given by w ( i , z ) = rar[R(i,z,ar)= 1 1

for all i and 2 in N (here Proposition (2.10)).

,

R is the recursive predicate which comes from

A n 8-m-n construction produces the required recursive function d which satisfies the statement: dd(i)(z) =

for all i and z in

~ ( i , . )= @i(z)

9

IN.

Remark. The recursive function d in Proposition (3.3) is not surjective (see Remark b) following Proposition (2.10)). (8.4) Proposition. Let Q be a BLUM space, and let r : N -* RV be a recursive function, T h e n t h e r e exists a recursive function f :N-* N such that for every natural number i with f = di we have

a,(.) > r(z)

(34

i.0.

Proof. Let h :nV -* IN be a recursive function such that for every n in N ,the equation h ( z ) = n has an infmity of solutions in PV (for example, take h = K, the fvst component of the inverse of CANTOR’S bijection J). Defme f by

i

4h(Z)k)+ 1 9

if @h(r)(Z) I

P

otherwise,

f(z)= 0 ,

for every z in N,and notice that for every natural i with f = $yi) we have: @,qi)(i)> r(i). Now let f = dj, for some natural j. We have:

f = f$h(i) Lo., so

a j ( i )=

> r ( i ) i.0. 0

222

Cdude

Actually, Proposition (3.4) can be strengthened as follows:

-

(8.5) Theorem. ( W I N [1980), €€ARTMANIS and HOPCROFT 119711) Let 9 be a BLUM space, and let F:N LV be a recursive function. Thenthere exists a recursive predicate

f:N

-

{0,1)

1

such that for every natural i with f = +i, we have

ai(z) > F ( z )

I

0

f (a) =

,

= 1 and

ax.

k

= pm!(m
A (0, (ra )
\


if Q , ( t ) L F ( t ) , then f ( t ) = &,(t))l1

1 , otherwise,

for some index j for f.

(3.7)

223

Chapter 3

Claim I. There exists an infmity of natural numbers n ~ ( n#) cq and ~ ( n5) j . To prove Claim 1 we consider the infmite set

Nj =

{m E RV Irn

>j

such that

> j and Qj(rn) 5 F(m)} ,

and we notice that every element of Nj satisfies the required properties (since f = dj).

Claim 2. There exists an n such that ~ ( n=) j . For, in the contrary j. case, for every m in Nj, oo# ~ ( m< ) Finally, let n be such that ~ ( n=) j and notice that

a contradiction.

Remsr ks. a) Theorem (3.5) shows that from the fact that a recursive function is dificult to compute we cannot infer that it is large. b) A simpler argument suffices to prove the existence of arbitrarily complex recursive functions. Indeed, the function f :RV + RV defmed, for every z in N ,by

f(z) = max(6j(z)+1 l ( i I z ) A (Oj(z)

IF(z)))

9

works, since in case Oi(z) 5 F ( z ) , for some z 2 i,then for the smallest such 2, f(z)2 di(~) 1 > Theorem (1.6) can now be extended to all BLUM spaces.

+

+;(.)a

(8.6) Theorem. Let Q be a BLUM space. Then there is no recursive function b:N2+ JV such that for every natural number i,

@)i(z)I b(zdi(z))

(3.8)

Proof. AE in the proof of Theorem (1.6) we can easily show that from (3.8) we can obtain a global recursive bound on the complexities of all recursive predicates, thus contradicting Theorem (3.5). 0

Theorem (3.6) has proved that the complexity of any recursive function cannot be bounded recursively by its eke. The next result asoerta that this is possible if in the above phrase we interchange the words

224

Caludc

“complexity” and “sire”. (8.7) Theorem. For every BLUM space 9 - there exists a recursive function b :fl--c N such that for every a ,

4i(z) I ‘(z,*i(z)) Proof. Let a :JV3

--+

(3.9)

N be the recursive function given by

.(;,.,Y)

=

i

if

bi(z) 0 ,

=Y

t

otherwise.

The recursive bound b can be defmed by b(z,ar)= max(a(i,z,v) for all t

t

1; 5 2 ) ,

and y.

It is seen that for all i and z, a(i,z,ai(z)) = 4i(z), when E dom(di). Consequently, for all i and z,if z 2 i and 4i(z) # + then ‘(z,@i(z))

<_

a(icz,@i(z)) =

bi(z)

.

0

Remark. Theorem (3.7) says that as a recursive function grows, its complexity also grows by a recursive factor b.

4 be a BLUM space, and let f:P+ IN be a recursive function such h a t for all i , j, and 2, if di(z) and -#j(z) # ‘qthen d,(i,jl(z) + XL Then there exists a recursive function h :nV3 4 Q? (which depends upon f ) such that for all a and j , (3.8) Proposition. Let

+

@,(i,j)(z)

I h(z,@i(z),@j(z))a.e.

-.

Proof. We define the auxiliary recursive function p : N b

i

+,(;,j)(z)

P(i,j,Z,Y,Z) = 0 ,

,

if

a,(%) =y

JV by

and Q j ( z )= z

otherwise.

Then we apply a maximiation to obtain h: h(z,ar,z) = m=(p(i,j,z,y,z) Ii,j 5.1

.

,

225

Chapter 3

(8.9) Example. There exists a recursive function for all i and j

c:N3+ N such that

I c(z,@i(z),*j(z))

*cmp(i,j)(z)

7

(recall that dcmp(i,j)= di O d j ) . 0

(1.10) Theorem. (ADRIANOPOLI [1976]) Let (di) be an acceptable g6delisation. Then, there exist two complexity measures (Gi) and (al*) associated to (di) such that Qll

Proof. Consider the and z,

=

*i

4 .

(3.10)

KLEENE Normal-Form Theorem and write for all i

di(z)= ~ ( ~ ~ [ T ( t ( i ) = , z 11) ,y)9 where t : N -+ N is a recursive bijection given by ROGERS' Ieomorphism Theorem (di = uqi)). Recall that for all i , z,and y,

T ( i , z , y )=

l

1

, if $Ii(.) 5 ezp (O,y+l)

and

ui(z) = ezp(l,y+1),

(3.11)

0 , otherwise,

and put

Qi(z) = ~ ~ ( T ( t ( i ) , z=, y11)

9

(3.12) In view of Theorem (2.11), all we have to prove reduces to the recursiveness of the predicate M*:QV3+ {0,1},given by 1,

if 4,%) 5 Y

,

But,

M * ( i , z , v )= 1 w

(a,(.) 5 3'+

and

since, by (3.11), if z E dom(bi) and Oi(z)

ai(z) Adi(z) I

> 3'+',

then

y)

,

226

Calude

Finally, from (3.12) and (3.11) we obtain (3.10).

a.4. COMPLEXITY CLASSES

We are going to tackle the quantitative aspects of computations by means of complexity classes which consist of recursive functions sets that can be computed by algorithm whose complexity is bounded by certain recursive factors.

Fix a BLUM space (p -

=

((di),(Qi)).

(4.1) Definition. (HARTMANIS and STEARNS (196S]; McCREIGHT and MEYER [1969]) Let

f:N-+N, be a recursive function. The complezity elass of f is

Cp

= {g

E R 1 there exists an i such that

bi and ai(z) 5 f (z) a.e.} . The recursive function f is called a name of the complexity class.

(44

g =

Intuitively, a complexity class Cp is the class of all recursive functions which have at least an algorithm of evaluation whose computational complexity is bounded by f . Some further explanations turn to be useful.

Comments. a) In the defmition of the complexity class we do not require that all algorithms evaluating g work within the complexity of f . The motivation of this fact ia simple: a badly designed algorithm can waste a huge number of steps even in the computation of simple functions. More formally, let f ,g:N --t N be two recursive functions. Then, there exists an index a for f such that for every z,

227

Chapter 3

@i(z)> g(2)

(4.2)

*

To prove the inequality (4.2) we consider the recursive function h :#-+ N defmed by diagonalisation as follows:

(””

>gb)

if @&)

1

h ( y 9 z ) = l+d,(z)

, otherwise,

9

for all z and y. By an 8-m-n construction we get the recursive function

s : N + nV satisfying the equation

h(y,z) =

d,(,)(Z)

-

The Recursion Theorem furnishes a fied-point i of 8, di = d, g(z), which ensures that t$i = f .

b) The “almost all” condition is consistent with the bounding properties of ACKERMANN-PETER and S U D A N functions and with the recursive dependence among complexity measures. Furthermore, the Speed-Up results (which will be presented in the next section) hold for aU but finitely many arguments.

Remark. From Theorem (3.5) it follows that there is no recursive function f : N + N satisfying the equality Cp = R (or, Cp = R.J. Notation. When it causes no confusion we shall simply write C, instead of

cp.

(4.2) Lemma. For every recursive function recursive function g : N 4 N such that

c,

C

#

f:N-+ JV there exists a

c, .

Proof. By Theorem (3.5) we find a recursive function that for every index i for F, @i(z)> f ( z ) 0.c. g =

(4.3)

F:N-+ N

such

Let i be an index for F, and define the recursive function g by C, c C, and F C,. To fmish, notice that F E C.,

@i.Clearly,

0

Thus starting with a recursive function we can construct a new complexity claas which ia a strict enlargement of the first class, and thia process continues indefinitely. We may ask whether we can construct uniformly larger and larger complexity classes.

228

Calude

(4.8) Theorem. There exist two recursive functions h : N 2+ N and

t :fi -+ N such that for every recursive function f : N + N and every index i for f we have

h(i)p c, and

6t(i)

E

clo(pI'),o;)-

(4.4)

Proof. Let r : N N be a recursive function for which the equation r(z) = n has an infinity of solutions for every fmed n , and define (using the s-m-n Theorem) the recursive function t by the equation dr(z)(z)+1

9

if @ r ( z ) ( z ) otherwise.

I di(z)

9

Clearly, for every recursive 9; , q5t(i) is also recursive. Furthermore, we ftu an index i for f .Ind we show that d t ( , ) C,. If there exists an index k such tha t dt(,) = # k and # t ( z ) 5 f ( z ) a e . , then for an hfmity of n,

and a contradiction! To construct the recursive function h we use the constant function k, for all z and y; here k is an arbitrary index for dt(;). In view of Proposition (3.8) there exists a recursive function h * : N 3 N such that for all z and y , Cd2)(z,y)=

-+

%p(J In particular, if z = y

=

n)

< - h*(n,@z(n),@y(n)) a.c.

i , then

~ k ( n=) +cp)(,,;fin)

I h*(a,+i(n),+i(n)) a-e.

Finally, put h(z,y) = h.(z,y,y)

,

(4.5)

for all z and y . I t is easy to see that dt(i) E CLo(pp),9i),thus ending the

proof. 0

We can easily simplify the formula (4.4), by deleting the fvst argument, in case of sufficiently difficult recursive functions.

229

Chapter 3

-

(4.4) Scholium. There exist two recursive functions H,t :I? -P N such N and every index i for f , for which that for every recursive f : N ai(z) 2 z,for all 2 , we have dt(i)

E C/ and

dt(i) E

C H ~ O ;*

(4.8)

Proof. We use the proof of Theorem (4.3) before the formula (4.5) which

ia to be replaced by

H ( z )=

h*(Z,Z,Z)

,

for all 2.

(4.6) Corollary.

P:N

4

There exist two recursive functions p : @

PI such that for every recursive function d,,

c,i and, in case

C

+

ai(z) 2 z,for all z,

c,;

-

0

N and

cpo(Pt'),*i) ' C f GOOi

(4.7)

*

Proof. Let h:w-P N be the recursive function furnished by Theorem (4.3), and put P ( Z , Y ) = 2* ( z * w ) + * ,

P ( 2 )= p ( z , z )

,

for all z and y. 0

The next result shows that the step-counting functions are sparse relative to recursive functions. As a consequence we deduce that there is no recursive function q : N IN such that

-

,-

Chi # L

coo,;

9

for all sufficiently large recursive functions die In other words, if we replace the complexity ai by +itthen the formula (4.7) fails to hold, for every recursive function P. (4.6) Theorem. (Gap Theorem; TRAKHTENBROT [1967] and BORO-P N such that t ( z ) 2 z, for all z,there exieta an increasing recursive function t :RV + RV such that

DIN [1969]) For every recursive function r:RV

2 30

Calude

-

= Crct

ct

Proof. Defme the p.r. function t :PI

(4.8)

N as follows:

,

t(0)= 1

t ( z + l )= t ( z ) + m ,

,

where

5 2 , either

m, = ptn [ for every i

Oi(z+l) for every

> r ( t ( z ) + m ) , or @;(z+l)5 t ( z ) + m ] ,

2.

First we show that t is in fact recursive. Indeed, all predicates involved in the scope of the minimbation operator are recursive; we examine only a finite number of conditions, and for every i z there exist only two possibilities:

<

rn,

or

a) Oi(z+l) = zq and in this case Oi(z+1)

> r ( t ( z ) + m ) , for

every

b) O i ( z + l ) # zq and in this case ai(z+1) 5 t ( z ) + @ i ( z + l ) .

Since for all z, r ( z ) 2 z,it follows that C, c Ctot. The proof of the converse inclusion will be by rcductio ad abeurduna. Assume that there exists a recursive function f : N P/ such that f E Grot, and f 4 Ct. This means that, on one hand, there exists a natural number j such that f = +i,and

-

Oj(2)

<_

‘(t(2))

,

U.C.

and, on the other hand, Oi(z)

> t(z)

i.0.

,

for every index i for f , Eventually, there must exist a natural number n > j such that t ( n ) < aj(n) 5 r(t(n)). We have arrived at a contradiction since for every i <_ n - I , either Oi(n) > r ( t ( n ) )or Oi(n) t(n).

<

0

Remark. The formula (4.8) occurring in the Gap Theorem c a n be restated as follows: N o index i of a recursive function satisfies the relation t(z)

< Oi(z) 5 r ( t ( z ) ) i.0.

Next we present a slight variation of the Gap Theorem together with

a proof which can be easily generalired to obtain an Operator Gap

Theorem.

231

Chapter 3

(4.7) Theorem. (Revisited Gap Theorem; YOUNG [1973]) Let a :Pi --c N and t:d-c Pi be two recursive functions such that r ( z , y ) 2 y, for all z and y . Then we can effectively fmd a recursive function t :Pi4 N such that t ( z ) 2 a(.)

and for all j and z with z (@j(z)

> j, 2

t(z)

0.c.

,

(4.9)

* @j(z)> r ( z , t ( z ) ) ) .

(4.10)

Proof. To defme t ( z ) we set h t l = a(.) t2

9

= r ( z $,-el)+ 1

t , = r(z,tz)+l

,

t o = r(z,t,)+l

,

9

< i 2 z + I , ti-, = r ( z , t i ) + l 2 ti+I > t i . t o > t , >...> t, > f + l .

Clearly, for every O

...,

So, (4.11)

Among the ( z + l ) intervals [ti,ti-,), i = 1,2, z , z + l , we can fmd at least one, say [tio,ti0-,), such that there is no j < z for which the statement (4.12)

holds. Indeed, suppose by absurd, that for every i E {1,2,...,z , z + l } we can find a ji < z such that

< Oji(z) I r(z,ti) < ti-, It follows that there exist 1 5 n < n 2 z+1 {jili=1,2 ,...,z , z + l } c { O , l , ...,z-1). We arrived ti

ictory relation:

.

(4.13)

such that , j = in, for at the following contrad-

For every z we set where i , is the smallest natural number satisfying (4.12). Clearly t b recursive; moreover, (4.11) guarantees the inequality (4.9). Finally, (4.10) is a consequence of the defmition of t and of (4.13).

232

Calude

Remark. It is worth noticing that under the hypothesis of Theorem (4.7), Ct

=

Only the inclusion Ct 3

C r o(pf),tl

*

Cro(Pp~,tlmust

be proved.

Assume, by

absurd, that for some j , Q j ( z )5 r ( z , t ( z ) )

U.C.

,

and Qj(z) > t ( z )

i.0.

Let z > j be such that aj(z) > t ( z ) . From Theorem (4.7) we derive the inequality O j ( z ) > r(z,t(z)),a contradiction. (4.8) Example. Take cP,,(z) = 2

8.'

e '

}

z times

,

and r ( z , g ) = 2', for all z and y. In view of Theorem (4.7) there exists a recursive function t : N 4 N such that t ( z ) 2 a ( . ) u.c., and there is no recursive function f :lN -+ IN satbfying simultaneously, for every index j for f , the following two conditions:

a,(.) > 2=

,

ia.

and

aj(z) 5 2'(")

a.e.

Remark. The proof of Theorem (4.7) indicates a recursive bound of function t size. Indeed, t ( z ) = ti < t o = r(z,t,)+I = r(z,r(z,tz)+l)+l =...= r(z,r(z,...,r(z,a(z))+l)+.,.+l)+l)+l; here the symbol r appears (z+1) times.

6 ((+i),(6i))be

(4.9) Corollary. Let 9 - = ((+i),(@i)) and - = spaces such that @i(z)< & i ( z )

9

for all i and z with z E dorn(di). that

Then we can effectively find a recureive function t :RV

two BLUM

-

(4.14)

N such

233

Chapter 3

c$=

ct .

(4.15)

Moreover, t can be taken to satisEy the additional property: t(z)

where o : N

-c

N

2 a(.)

0.e.

,

is an arbitrary fured recursive function.

Proof. In view of Theorem (3.1) there exists a recursive function h :fl--* RV such that for all i,

ai(z) 5 h(z,di(z))

a.e.

,

and

6i(z) 5 h(z,@,(z)) a.e. Moreover, h can be taken to satisfy the condition: h ( z , y ) 2 y, for all z and I. Theorem (4.7) furnishes a recursive function t:N -c N which satisfies the conditions (4.9) and (4.10), with r = h. We shall prove that the equality (4.15) holds for this t . J3 a,(.)

5 t ( z ) a.e., then & j ( z ) 1. h(z,c~,(z)) 2 h(z,t(z)) a.e.

so,

< t(z)

a.e.

,

because the inequalit J

d,(z) 2 t(z) i.0. , (4.10). Hence Cp C C$.

contradicts condition The converse inclusion follows from the inequality (4.14). 0

Comment. According to Corollary (4.9) no matter how two arbitrary universal computers are selected, one much faster than the other, there exists a recursive bound t , arbitrarily large, such that every program which runs within the complexity of t on the fast computer also runs within the same bound on the slow computer. In particular, the same phenomenon occurs if we use only one computer and we analyse the complexity of program in two different ways (for example, time and memory) so that the inequality (4.14) holds. The above ideas can be generaliced to obtain an Operator Gap Theorem.

234

Calude

(4.10) Theorem. (Operator Gap Theorem; CONSTABLE [1972], YOUNG 119731) For every recursive function a :IN + IN and every total effective operator

,

[:PR-PR such that for all i and z,

f(+i)(z) 2 #i(zf

1

we can effectively find an increasing recursive function t : N 4 Pi such that t(z)

2 a(.)

1

for all z,and { j€oV I@,(z)5 t ( z ) 4.e.) = { j ~ n V 1 0 j ( z )5 F ( t ) ( z )a.e.}

.

Proof. We try to exploit YOUNG'S proof of the Gap Theorem for defming the required recursive function t by stages. tion

Assume that f :IN

-

nV is a

Graph(ET(di)) =

recursive function satisfying the equa-

U Graph(*j(j))

I Ec;

for all recursive di (see ij€oV !Graph(*,) C P u t t ( 0 ) = a ( 0 ) and d o = 0.

Theorem

At Stage z > 0 in the computation of already defined for z < d,, where d , 2 x which will be further effectively determined. t will be denoted by t ( ' ) , i.e. t('):IN O I N d e f - e d by t"'(.)

t(z) =

X ,

,

for z

t

(2.8.27));

here

t suppose that t ( z ) has been

is a certain natural number

This finite initial segment of is the p.r. function which is

< d, ,

otherwise,

for all z .

Next we defme (z+ 1) recursive extensions of t('), namely t,,t

where for every z ,

*-,,...,t , : N

Ci =

PJ

,

235

Chapter 3

t"'(2) = t ( z ) ,

for z

< d, ,

rnax(a(z),t,(z-l)+I),

for z

2 d, ,

and for i E {z-l,,..,O), ti(Z)

=

Finally we construct the following (zil)finite p.r. functions: lFJollF'l

given by

,...,AJ, :I?2%

I

to(.)

do(.)= co, and

9

N

,

I d, , otherwise, if

t j ( z ) , for t <_A, . J i ( t= )

,

otherwise,

00,

for every i E {1,...,z} and all z . Here and

U Graph(r/(,))] ,

A,+l = P [ Z 2 A, and Graph(*',) C

Ya i , i

where Ba,i = i E {0,...,z-I}.

{gemIry(n)= ti+l(n), for every n 5 z } , for every

-

In view of the monotonicity of the operator F we can prove, stepby-step, that for every i € {ZJ-1, ...,l},if t':m N is a recursive extension of some finite p.r. function di, then F(t')(z)

for every z such that A,

I ti-l(z)

5 z 5 A,.-1.

Let z 2 1. For all j E (0,...,z-l}, and i E (0 ,...,z},we say that di is unsafe for j if *'i(Z)

for ~ o m et with A, 2

t

5 A,, and

< @j(z)

9

(4.16)

238

Calude

i = 0, or ( O , ( z ' ) I A ' ~ - ~ ( Z ' )i , > 0)

for all z' with A,

5

(4.17)

5 A,-,.

z'

Claim 1. For every j

k

,

E {0,...,z-I}, at most one di is unsafe for j .

To prove Claim 1 we notice that if d , is unsafe for j, then for all

< i,we have:

@j(z)I r'i-l(z)

9

for every z with A, 5 z <_ Ah (since A, 5 A,, by construction, and (4.17) works with the clause i > 0). Furthermore, for all k 2 i,the relation

5 , A, 5 z' 5 Ah-,, thus

aj(Zt)

fails to hold for every z' with Claim 1.

.'I(.')

ending the proof of

Claim 2. For all z 2 1, j f {0,...,z-l}, and a E {0,...,z } , the property ,'di is unsafe for J'" is recursive, because the natural numbers Ao,...,A= and the finite p.r.. functions do, ...,dzcan be effectively computed.

< z, 5 z Idi is safe for j } 2 z ,

In view of Claim 1, for all z card{i

2 1 and

j

a cardinality argument shows that at least one of the finite recursive functions H',,...,K~, must be eafe for all j < z. By C l a h 2 we are able to extend the fmite p.r. function t ( + ) to a certain d,*which is safe for every

90,

j <

t.

We conclude with the following procedure for the step-by-step construction of t . Initially, t ( 0 ) = a(O), and d o = 0. For every z > 0, Stage L in the computation of t is the following: 1. Construct ( z + l ) recursive extensions t = ,...,t o of the finite p.r. function t(').

2. Construct the ( z + l ) pairs of finite p.r. functions and natural numbers (d,,A,), ...,(dt,A, ). 3. Find the least i , 4. P u t t ( % + ' )= 7r'i

5 . P u t d,+, =

Our procedure grows faster than a , z > j, the extension means that either f ( t ) ( z ' )< aj(t'), for

.

I z for which

A',

is safe for all j

< 2.

A0+1,and go to next stage. constructs a monotonous recuraive function t which and has the following property: For all z and j , if constructed at Stage z, i.e. t('+'), is safe for j . Thin for every z' E dom(t('+')), a,(.') 5 t ( t ' ) or else, . some z' f dom(t('+')). It follows that when

237

Chapter 3

t(2)

< Oj(2)

i.0.

,

we have [(t)(z)

< Oj(z)

,

i.0.

thus ending our proof. 0

The next result analyses the possibility to replace 4i by its complexity Qi in the formula (4.7).

h:M

(4.11) Theorem. There exists a recursive function that for all recursive functions di,

4

RV such

C

C@i

# ch(Pp,*i)

*

Proof. Let d : N -P RV be a recursive function which enumerates the step-counting functions Qi:t$d(i) = Qi, for all i (Proposition (3.3)), and define the recursive function r : N 3 -., nV by

1

4d(i)(Z)

.(i,.,v)

= 0 ,

I

if 4d(i)t2)

=y

?

otherwise,

for all i , z, and y. Notice that the totality of r follows from the recursiveness of the ternary predicate g d ( i ) ( z ) = y (which is in fact @i(z)= y ) and from the axiom (2.2). The recursive function g:I@ + - N defined for all z and y by g(z,y) = l+max(r(j,z,y) l j 5 z),satisfies the inequality g(zt@i(z))

> r(i,z,@i(z))

=

Qd(i)(Z)

9

for all i and z with 2 2 i . Furthermore, in view of Corollary (4.5), there exists a recursive function p : N 2 + N such that for every recursive function di,



C

=

‘#d[i)

cpO(pp),@d(i$

cpO(Pp),#O(pp)8*,)) ’

So, the recursive function h :@ -+ N d e f i e d by

h(s,ar) = P ( Z , d Z , Y ) )

?

for all z and y, works. 0

The above proof relies on axiom (2.2) and Proposition (3.3). We can use thin observation to obtain further generalieations.

238

Calude

(4.12) Definition. (BLUM [1967a]) A r.e. set of p.r. functions yi ;NA N for which the ternary predicate 7;(n) = m is recursive, is called a measured set. (4.18) Example. The step-counting functions of a measured set.

BLUM space form

a 13

(4.14) Example. (BLUM [1967ai) A measured set of functions (7,)can be defined by

1

+;(n), i f + ; ( n ) # x a n d

7iCn) =

41(n)

x,

< i.#i(n)

9

otherwise.

It is seen that this measured set contains all the real-time computable functions.

(4.16) Example. The set of all primitive recursive functions is measured. To see this recall the enumeration of all primitive recursive functions given in Example (2.8.21). More generally, every r.e. set of recursive functions is measured.

(4.16) Example. The set of all recursive predicates is not measured since it is not r.e. (see Example (2.8.22)). @

(4.17) Example. The set of all p.r. functions is not measured since the ternary predicate bi(n) = m is not recursive. 0

(4.18) Lemma. A p.r. function B belongs to some measured set iff the graph of B is recursive.

-

Proof. The direct implication is obvious. To prove the converse, let a' be an index for 6 and let h : N IV be defmed by h ( z ) = i , for every 2 . Clearly, the measured set (dh(,,))contains B . 3

239

Chapter 3

(4.19) Theorem. (Compression Theorem; BLUM [1967a]) Let (ri) be a measured set. Then we can effectively find a recursive function h :@ + N such that for every recursive function ri, C

c7i

+ c”(Py.7i)

*

More precisely, we can effectively find a recursive function

k :pV + N such that for every recursive function ri, the following two

properties hold:

If 4 j

=

, then @k(i)(z)

> ri(z)

L h(z,ri(z))

,

(4.18) (4.19)

0.e.

Proof. The recursive function k follows from an +yi)(z) = PY[Y # dj(z) 7 for all

a.c.

8-m-n construction:

i L 2 with @j(z)I ri(z)]

for all i and z. It is seen that if ri(z) # co, then total, then t$h(i) is also total.

g k ( i ) ( ~ ) # CQ.

9

Moreover, if ri is

h a m e now that we fu a recursive ri. If dt(i) = Qr, for some t , then for all J’ and z, z 2 j, @j(z) 5 ri(z) implies #k(i)(z) Z + j ( z ) . So, at(.) > 7i(z) Q.C. (i.e. (4.18)); moreover, dk(i)

c,;.

We pass to the definition of h: h ( z , ~=) m=(O,@L(j)(z)Irj(z) = Y $ and

i I z)

1

for all z and y. Clearly, k ie recursive and satisfies (4.19) since for every z 2 i , we have: h(z,ri(z)) =

m=(@k(j)(Z)

2 @k(i)(z)

-

Irj(z) = Ti(%) and

i 5.1

Comment. The Compression Theorem asserts that, though there is no uniform way to obtain larger complexity classes for all recursive functions, we can find interesting classes of recursive functions which have “optimal” algorithms for computing them modulo some recursive factor h. An we shall see in Section 3.9, every such claw of recursive functions is “recursively small”.

One essential feature of the p.r. functions occurring in a measured set is that their values re fleet their complexity. Such functions are .called

240

Calude

honest by MEYER and RITCHIE [19681.

:w

lV be two p.r. functions, g (4.20) Definition. Let f :N N ,g - )if there exists an total. We say that f is g-honed (with respect to 9 index i for f such that

(4.21) Example. The recursive function f in Theorem (3.5) is essentially dishonest. 0

(4.22) Lemma. a) For every recursive function g:M -+ lV the set of all g-honest functions is r.e. b) Every measured set can be embedded into the set of all g-honest functions, for a suitable recursive g.

di(z)

, if (z y , exists

&(&)

=

I

\

x,

t

then there

such that Oi(z)
and z = di(z)) otherwise.

We shall prove that

!d,+)

In

2 01 =

where h : R

4

{ f E PJf

=

di, and ei(z) 5 g ( z , f ( z )a.c., ) for some :}

,

N is the recursive function d e f i e d for all z by h ( z )=

8(K(Z)J(Z))*

Assume fust that f is 9-honest and that i is an index for f such for all z 2 z,. P u t IL = J(itz,,). We shall prove bh(n)= f . Let z be arbitrary. If z < z,, then O~(~)(Z =) ~ ~ (=zf ()z ) . In the opposite case, two situations may occur according to the convergence of #i(z). If &(z) = X , then Q i ( t> ) g(z,z), for every z , so 4+)(z) = x . If di(z) z 33, then + i ( z ) I g(z,di(z))t SO bh(n)(z) = f ( z ) . To prove the converse inclusion we show that for every n, that that

ai(z) 5 g(z,f(z)),

241

Chapter 3

@h(n)(4

for

every

z 2 L(n).

If

Ig(z,h(n)(z)) dh(n)(Z) #

and

dh(ts)(s) = +#(K(n)J.(a))(z) = 4 K ( n ) ( Z ) ,

Hence,

x

?

and

E

@K(n)(z)

2 L(n),

then

5 g(z,dK(n)(Z))*

= @K(n)(z)

I g(Ec+K(n)(z)) = g(zdh(n)(Z))

-

b) If f : N + N is a recursive function and { 4 1 ( ~In) 2 0) is a measured set, then the Compression Theorem furnishes a recursive function h :hr? + N such that for every @ f ( i ) ( zI ) h(z,df(i)(z)) a*c.

So, the recursive function g = h works.

Is1

Remark. Though the notions of honest function and measured set are “almost the same” by Lemma (4.22), they are not exactly equivalent since an honest function may exist not in the measured set. The Operator Gap Theorem says that there is no effective operator which, on the basis of a recursive bound, produces a larger recursive bound which allows us to run new algorithms. The Compression Theorem says that there ia such an uniform method provided we restrict our initial recursive bounds to a measured set. The next deep result asserts the existence of a fiied measured set which contains names for any complexity class. In view of Lemma (4.22), this means that there exists a fued binary recursive function g such that every complexity class can be named by a g-honest function. (4.2a) Definition. A measured set 7;S said to be a elam determining for the BLUM space 9 if for every recursive function f :N-t N there exists a recursive function g : N + N in Tsuch that C, = C,. Roughly speaking, Tis a class determining for 9 - if it is measured and contains a name for every complexity class in 2. (4.24) Theorem. (Honesty Theorem; McCREIGHT and MEYER [1969])

Every BLUM space has a class determining set. Moreover, there exists a recursive function g : N + N such that for every total qje, #,(*I is also recursive and

242

Cdudc

In other words, there exists a total effective operator such that for every total 9,,

Before passing to the proof of the announced theorem we shall briefly describe a method for building hierarchies of recursive functions based on Honesty and Compression Theorems. We start with a recursive function 4g(i,) in the measured set furnished by the Honesty Theorem and then we use the Compression Theorem to obtain the larger bound defmed by q i l ( z )= h ( ~ , d ~ ( ~ ~for ) ( all z ) z. ) , We obtain the enlargement C

C*,(iJ

+

CQ,1

*

Then we apply the Honesty Theorem to obtain the index i i such that

The

Compression

Theorem

gives

us

an

index

di2(z) = h ( z , dO(’11.I (z)),for all z,which ensures that

i,

such

that

C

We can continue with this method to obtain a strictly increasing hierarchy of recursive functions.

Proof of Theorem (4.24): We begin with an uniform procedure which for every p.r. function w :N3 N produces a p.r. function with a recursive graph w * :lV 3 N satisfying for every i the equivalence:

5 w ( z ) a.e.

w

ai(z) 5 w * ( z ) 0.c.

(4.20)

(recall that qbi(z) 5 I$,(.) iff q5,(z) = 3 0 , or &(z) # 30, dj(z) # 3 0 , and 5 t#j(z)). Since the resulting p.r. function W * is not necessarily recursive even if w is total, next we transform W * into another p.r. function which preserves all previous properties of w ’ and, additionally, is total when w ia total. Globally, we shall obtain a measured set. qbi(z)

To describe the initial procedure we shall use two arrays: queue and The queue array contains the indices for the p.r. functions analyaed. The cancel array reflects the “time” evolution of the property 0 , f z ) > w ( z ) , for some 2. cancel.

243

Chapter 3

Assume that e is an index for a given unary p.r. function w . We display the Stage n in the computation of w *: 1. Put queue(n) = n, z = K(n),y = t(n). 2. If Ge(z) # y, then go to step 6.

3. P u t i = 0.

4. If @i(z) > w (z),then put eancel(i) = 1. 5. Put i = i + l .

If i 5 R , then

go to step 4.

6. If w * ( z ) has already been defmed at an earlier stage, then go to the next stage of computation.

7. If there exists a natural number k properties:

2 n having the following three

eancci(qucue(k))= 1 @qWI.(C)(4

for every j

>I

,

9

(4.21) (4.22)

< k,if cancel(queue(j)) = 0,

then

IY ,

@qwse(j)(z)

(4.23)

then fmd the least such k, and put: w * ( z ) = y , cancel(queue(k)) = 0,

queue (n) = queue (k).

8. Go to the next stage of computation.

The following comments will ensure that the above procedure is effective and eventually terminates. At any Stagen = 0,1,2, ... the procedure assigns certain values to queue and cancel; so, the tests involving earlier values of these arrays are effective. The only problem can appear at step 4, since w may be undefmed at certain points. But, to arrive at step 4 we must pass the test in step 2, i.e. decide that Qe(z)= y < x. In view of BLUM axioms, in this case we have w ( z ) = #,(z)# x;sa, the test Gi(z) > w ( 2 ) can be effectively performed. The condition in step 6 guarantees that w * ( z ) is well defmed. Finally, if for some 2 , w * ( z ) f x, then w * ( z ) is defmed at Stugen = Jfz,w*(z)). Consequently, to decide whether w * ( z ) = y, for arbitrarily given z and y, we must simply run the procedure until Stuge J(z,y); this shows that the graph of w is recursive. Furthermore, since the above procedure is uniform in w , it follows that the resulting set of p.r. functions is measured. Next we pass to the proof of (4.20). Our proof will be by c u e s according to the “stability” of the involved index i with respect to queue (we say that i is stable if it reaches a fmal location in queue; in the contrary, i ia unetable). Fix an arbitrary i .

244

Cdudc

Case 1. (The index i is unstdfe.) In view of the hypothesis, queue(n) = i,for infmitely many n, by means of step 7. This means that all conditions involved in step 7 are fulfiied, and additionally, in this step one assigns the value y to w * ( z ) , and y < ai(z),by (4.22). So,

ai(z) > w * ( z )

i.a.

In case queuetn) = i,by step 7 one sets cancef(i) = 0. At a certain next move we must have - due to the unstability hypothesis an assignment cancel(i) = 1 to ensure that the conditions in step 7 are fulfilled again. This possibility occurs only if for some z,ai(z) > ~ ( z(see ) in this respect step 4). For every z, there is an unique poseibility to discover the inequality Oi(z) > w (z), namely a t Stage J(z,@,(z))(see step 2). So,

-

*

Oi(z)

>~

,

( z i.0. )

and this completes the proof in this case. Case 2. (The index i

a,(.) <_ w ( z )

is etable.) We shall prove the equivalences: a.e. H i

is stable

e a&) 5 /(z)

(4.24)

a.e.

We divide the proof into two subcases depending upon the value 0 or

1 when cancel(i) must ultimately stabilize.

Subcaee 2.1. (cancef(i) sta b-he s at 0.) We begin by noticing that the procedure assigns the value 1 to cancel(i) only fmitely many times (see the conditions in step 2 and step 4). Consequently, in view of the hypothesis, Q,(z)

5~

,

( z a) x .

since both queue and cancel are stable on i,for all but a finite number of z E dom(w') and w * ( z ) is defined by step 7 using an earlier index. By (4.23), for every such z,

@,(z)I W * ( Z ) so,

1

globally, ~ , ( z5 ) w * ( z ) 0.e.

Subcase 2.2. (cancel(i) stabilizes at 1.) Consider z such that at Stage J(z,O) and all later stages the index i as well as all indices above a in the array queue and their corresponding values in cancel are stable. Let

M

= max(o,(z) /cancel(j) = 0 and for some

k


245

Chapter 3

qucue(k) = j,queue(m) = i )

.

It ia seen that in view of the analysis made at the preceding subcaee,

M

5 min(w (Z),U*(Z)).

M=3 so occur. Firstly, In view of the monotonicity of J, it fohwe that J ( z , M ) ia the earlier stage at which w * ( z ) could be defmed. In the contrary, we would violate the hypothesis and (4.23). Indeed, if w *(z)were defmed at some Stage J ( z , n ) with n < M, then we would have Two

poesibilities

may

w (2) = w * ( z ) = 30. Secondly,

M

< 30.

aj(z) > m

,

= w*(z)

for certain j = queue(k) and i = queue(!) with k < t ; furthermore, since eancel(j) = 0, we violate (4.23). Finally, we notice that W * cannot be defmed before Stage J(z,O), thus completing our argument. Since the index i haa stabilised at StageJ(z,O), and eaneel(i) is stable at 1, we deduce that (4.22) must fail to hold at Stage J ( z , M ) ,i.e.

.

a,(.) 5 M 5 m i n ( W ( Z ) , W * ( Z ) )

The above statement is based on a hypothesis which turns to hold almost everywhere, thus

a,(.) 5 w ( z )

a.e.

,

and

ai(z) <_ w * ( z )

a.e.

The fmal task of our proof is to modify the initial procedure and to get a new one which preserves the above properties and, additionally, produces a total function when it receives a recursive one. Since the initial procedure is uniform in the indices of w it follows that there exists a recursive function G :N+ RV such that w *(z)= & ( j ) ( ~ ) , for all j and z. By an 8-m-n construction we get a recursive function g:N 4 RV which satisfies the equation (4.25)

If 4j is total, then d#(j)(z)= then

#g(j)

#G(j)(.)

is also total because if for some

> dj(z)+4j(z)

2,

9

and the right-hand side of the inequality is fmite; remember, Graph(&(j)) is recursive. Furthermore, the ternary predicates ~G(,,(z) = y, (Dj(z) = z , and dj(z)+(Dj(z) = y are obviouely recursive. So, the graph of dr(j) ia

246

CJudt

recursive, thus proving that the set {do(,, 1 j E PJ} is measured. Finally, we shall prove t ha t for every total de,

a,(.) <_

de(2) a.e.

* a,(.) I # v ( e ) ( z )

a.e*

1

thus showing the equality

C*< =

c &,(el

*

We shall use the relation (4.24) and the defmition (4.25). Assume that for every z 2 zo, (4.24) holds: in particular, ai(z) 5 d,(z), For such an z two possibilities may occur: a) el(^) 5 +,(z)+CP,(z), and in this case by (4.24)i *i(z) I ’#G(e)(z) = #p(e)(s); b) d ~ ( r ) ( z> ) +e(z)+#e(z), and in this case Oi(z) 5 be(z) 5 ~ $ ~ ( z ) + a ~=( zdq(el(z). ) Conversely, if the equivalence (4.24) and the inequality a,(.) 5 I $ ~ ( ~ ) ( Zhold ) for every 2 20, then @if.)i bg(e)(z)5 d G ( e ) ( z ) , hence +i(z) I 4e(s)* Next we study the recursive enumerabitity of complexity classes. First we shall prove the existence of a BLUM space which has a non-r.e. complexity class. (4.26) Theorem. (LEWIS [1971], LANDWEBER and ROBERTSON !1972)) For every recursive function f:oV + PJ there exists a BLUM

space 9’ - (which depends upon f ) such that

&FI is not r.e.

Proof. Let 9 - = ((6,),(ei))be an arbitrary BLUM space, and let f be an unary recursive function. We choose a recursive set I = (io,il, ...,i,, ...} of indices such that dij(z) = for all lows:

j’ and

i

(4.28)

9

z . We defme now the step-counting functions

(a;)

i f n = i j and

T ( j , j , g )= 0, for all y otherwise.

5z,

as fol-

(4.27)

In the above formula T is KLEENE’s predicate.

It is easy to aee that 9’ = ((d,),(@{)) ie a BLUM space (the fvst axiom follows from (4.26), and the proof of the second axiom involves the recursiveness of I). Then, by (4.27), CP!(z) <_ f ( z ) a.e. iff there exist two naturals j and

247

Chapter 3

2,

such that n = ijand @ j ( z )= f(z),for all 2 ‘i

4 p )=

2

But

2,.

f (z),for each z 2 z, w T(j ,j , p ) = 0, for all p

5 2, and z 2 2,

w T(j,j,p) = 0, for all y w Hence

a!(.) I f ( z ) a.e.

i 4 dom(dj)

n

4 K, for some natural j ,

w n = i, and j

and

Cf

I

= {g E R 1g =

n

6, and 4{(z) I f ( z ) a.e.1

=

{dij Ii 4 K )

-

n (Recall that K = {z E RV ]q5z(z)# x}= {z E IV IT(z,z,y) = 1, for some Y

E W)

If CF’ were r.e., then the set { j E RV Idi. E Cf’}

=

n

IV - K would be

r.e., contradicting Theorem (2.5.3) (see also Example 2.5.16)). 0

Comment. Theorem (4.25) implies the existence of a complexity class for which there is no effective method of describing what recursive functions are contained in it. Furthermore, from Theorem (2.6.15) we deduce that the problem of deciding whether a recursive function belongs to such a “bad” complexity class has independent instances with respect to every GODEL theory.

7 be a r.e. set of unary recursive functions. Then there exist two recursive functions B, b :IV + N such that the following (4.26) Lemma. Let

two conditions hold:

For every f E

Proof. Let 7 = function. Put

{dh(i) l i

>O},

5 f ( z ) 5 B ( z ) a.e. ,

(4.28)

7cc,

(4.29)

*

where h : N

+

IV is

B ( z )= mx(dh(i)(z) t i I 2) and

9

a suitable recursive

248

Caludc

(4.27) Corollary. Every measured set containing only recursive functions can be embedded into a complexity class. in particular, the set of primitive recursive functions and the set of ultimately zero functions can be embedded into suitable complexity classes.

(4.28) Theorem. If t:N

0

-

N is a recursive function such that Ct contains all ultimately zero recursive functions, then C, is r.e., for every recursive function f : N RV such that f(z)2 t ( z ) , for all 2.

Proof. Assume that t and f satisfy the hypothesis of the theorem. Employ the s-m-n Theorem to get a recursive function s:N3 4 N satisfying the equation

1

+i(z)

#,(i,x,H)(z) =

0 ,

, if

5 .z,ai(k) 5 y ) and < k 2 z,ai(k)5 f(k)) ,

(for each k

(for each z otherwise,

and then construct the r.e. set

1=

{+h(i)

Ii 2 0)

9

) ) . shall prove that where for all i , h ( i ) = ~ ( I \ ~ ) ( i ) , I i ~ ) ( i ) , @ ( iWe

Cf =

x.

If dj is recursive and a,(%) 5 f(z),for all z 2 z,, for suitable z,, then $j = q5h(i), where i = J(4 (j,z0,max(aj(z)Iz 5 ZJ). Conversely, for every i t 4h(i)E C,, since all ultimately zero recursive functions are in C 0

Comment. The above result can be strengthened, with essentially the same proof, by requiring Ct to contain all fmite restrictions of some fEed recursive function.

249

Chapter 3

-

(4.29) Theorem. Let (0 - be a BLUM space with the property that for all recursive functions f,g:nV A', if f ( z ) = g(z) a c . , then CF = . C; Then every complexity class is r.e.

Proof. Let t : N -4 N be a recursive function such that Cf # 0.Pick g in C$, and construct, by the s-m-n Theorem, the recursive function h :oV3 -+ N satisfying the equation qbi(z)

,

if (for every y

5 k 5 z,

9,(k)5 t ( k ) )and (for every bh(i,s,#)(z) =

g(z) \

C;.

=

,

k

< Y,@i(k) < 2)

9

otherwise.

A similar argument as in the proof of Theorem (4.28) shows that {q5,(il Ii 2 0}, where r ( i ) = for all i, thus

ending the proof.

~(~~3)(;),~~3)(;),~4~)(;)),

0

Notice that the BLUM space ((ui),(Ri)) satisfies the above condition of “complexity fmite invariance”. Furthermore, Theorem (4.25) says that the complexity finite invariance property is not a consequence of BLUM axioms.

Final Comment. The existence of non-r.e. complexity classes suggests the existence of pathological BLUM spaces. Therefore, new conditions should be added to BLUM axioms to eliminate these “bad situations”. See in this respect HARTMANIS 119731.

a.6.

THE SPEED-UP PHENOMENON

Can we classify the recursive functions according to their “best” algorithms with respect to a given BLUM space? The answer ia negative. It relies upon the fact that best algorithms need not always exist. This is one of the main achievements of BLUM’e theory of computational complexity. We begin with two illuminating examples.

250

Caludc

(6.1) Example. (BLUM [1967a]) Consider the recursive predicate f:RV -+ { O , l } given by

{ ,, 1

f ( z )= 0

if 2 is a palindrome, otherwise,

for every 2 . The function f checks whether an arbitrary natural number written in base 10 reads the same forward as backward. So, f(31) = 0, b u t f(37873) = I.

A typical algorithm computing f will work as follows: sequentially, the opposed digits are compared until a pair of distinct digits is reached, and in this case the result is 0. In the opposite case, the result is 1. .Measuring the complexity of such an algorithm by the number of comparisons, we can find a quicker algorithm (taking approximately half comparisons for almost all palindromes) simply by comparing simultaneously pairs of two digits. And the process continues indefmitely. No matter what algorithm is chosen to compute f , another can be found which computes the same function by means of half comparisons, for infmitely many inputs. 0

(6.2) Example. (VAN EMDE BOAS (19751) Let 9 be a BLUM space, and let q,w :PI 3 N be two p.r. functions such that dom(7) C dom(w), and the set dom(w)-dom(q) is not r.e. Then for every pair of indices (i,j),q = di and w = +j, and for every recursive function R:PI --t RV one has

<

R ( @ j ( z ) ) @i(z)

9

for infmitely many z in dom(q).

Proof. For the sake of a contradiction assume that there exist di = q , Q , = w , and a recursive R such that for almost all z in dom(9),

R(@j ( z ) ) 2 @i(2)

-

Then, for almost all z,

z

E dom(w)-dom(9) e (z E dom(w) and

Oi(z)

> R(@,(z))),

which shows that the difference between the set dom(w)-dom(9) and a certain fmite set is r.e. Consequently, dom(w)-dom(q) is also r.e., thus contradicting the hypothesis. 0

251

Chapter 3

Comment. Let T be a GODEL theory. Adding to the axioms of T an undecidable sentence, i.e. extending T,we get not only new theorema but also much shorter proofs for the theorems in T (GODEL [1936]). The origin of this “logic speed-up” is the phenomenon described in Example (5.2) (here dom(q) ia the set of the theorems of T,dom(w) is the enlarged set of theorems, and the length of the proof gives the complexity). The following deep result asserts that a stronger version of the above phenomenon is generally true.

-

(6.1) Theorem. (Speed-Up Theorem; BLUM [1967a], YOUNG [1973]) Let (s be a BLUM space and let g:ov2 N be a recursive function satisfyingthe condition

g(zd

I !dZ,Y+1)

9

for all z and y. Then there exists a recursive function f : N for all z,and for every

di

=

-

(5.1)

Wr such that

f there exists a j with

f = di, and

5 ai(z) a x . respect to g.) -

g(z,@,(z))

(We say that f has a g-speed-up with

(5.3)

Proof. We recall that (ri)i~o ie an enumeration of all fmite functions defmed exactly on some initial segment {O,l,...,n }; furthermore, dom(ri) = {O,l,...&(i ) } .

Let t : N z-+ Al be a recursive function satisfying the equation

I

.&)

4t(inu)(Z)

= q5i(z)

if 2 I W Y ) , otherwise. 9

9

(5.4)

For all n , m and z we define the s e t of indice8 cancelled at Stage z by n and m ,C(n,rn,z), to be

252

Cdude

Furthermore, for all n, m, and

y

2,

< 2 , and

if C(n,rn,y) is d e f i e d for all

+x

@t(,(n,e+i),s)(z)

9

for all m <_ a’ < z and 0 5 t 5 z, then C(n,m,z) is also d e f i e d and its members can be effectively determined. *i(.)

If C ( n , m , z ) is defined and i is in the fmite set C(n,m,z), then P x ,so di(t)f x .

We are now ready to use the s-m-n Theorem in order to obtain a recursive function H:IN -+ IN satisfying the equation

* bi (z),for every Clearly, if for some n , m, and z, $kl,)(rn,z)z +aln)(mtz

E c(n,m

= PY[Y

d&(n)(miz) 5 z

X,

, then

11

.

7

since the set C(n,rn,z) - which must be defined in this case the initial segment {Oil,..+ W}.

(5.6)

(5.7)

- is included in

By the Recursion Theorem, there exists a fixed-point q of H, i.e. @)(m,z) = &l,)(m,.)

(5.8)

9

for all m and z . Notice that in view of (5.5), @(m,z) = 0

for every m

,

2 2.

Intermediate step.

op(rn,o)

f

If for some rn and z

x , $j2’(m,l) # x

> rn,

,...,@(m,z&l)

# m,

(5.9)

and dt(,(q,,+*),*)k)#

for allm

< i < z and 0 5 t <_ z,then @(m,z)

* 23 .

7

(5.10) (5.11)

To show that (5.11) holds it is sufficient to prove that C(qirn,z)is defmed, i.e. C(q,m,y) is defmed for all y < z (we have used the relation (5.10)). We proceed sequentially. Clearly, C(q,rn,O) = @. Since df)(rn,l) z x , it follows that C(y,rn,l) is defmed (for if C( q, m, l) is undefined, then +f)(m,l) = x). An analogue argument can be employed to show that C(q,m,y) is defmed for all y < z. every

We now use the Intermediate step to prove that 462) is total. For m, df)(m,O) = 0. Assume that for all m and 0 5 y < 2,

253

Chapter 3

.

.

dp)(m,y) # x We shall prove that for every m, dp)(m,z) # x The interesting case is when m < z (for in the contrary df)(m,z) = 0). For m = z-l,z-2 ,...,1,0, we verify the conditions (5.9) and (5.10). If m = 2-1, then (5.9) becomes q5f)(z-1,0) f x, q5f)(z-1,1) # X , z-1,z-1) # x which are true in view of the inductive hypothesis. The condition (5.10)reduces to

...,#PI(

dt(,(q,z)&)

for every

t

#

x

7

z. But,

=I

if 2 I K(49

+),

d e ( q , s ) ( z,) otherwise,

,

if z 5 K ( z )

, otherwise, .

#f)(z,z)

- [O

, if 2 I K(z)

,

7

9

otherwise.

Step-by-step we can prove that dp)(m,z)# q for every m

> 0, C(n,m,z) = C(n,O,z)-{O,l,...,m-1) . For z = 0 , C(n,m,O) = C(n,0,0) = 0.Assume that We prove by induction on

2,

that for all n, m

c ( n , m , i l ) = C(n,O,y)-tO,1I..., m-1)

for all n, m

> 0 , and y 5 2 . If i E

(5.12)

9

E C(n,m,z+l), then

m
i

< z.

,

(5.13)

u C(n,n,y) ,

(5.14)

v
and @i(z+l)< g ( z + l , m a x ( ~ t ( e ( n , i + l ) , r ) ( Z + 1 l2 )

I z+1))

*

(5.15)

In view of the induction hypothesis, condition (5.14) can be equivalently written as

254

Cdudc

(5.16)

Finally, from i f C(n,O,z+l)-{0,l,

(5.13),

...,m - I ) ,

(5.16) and (5.15) we deduce thus ending the proof of (5.12).

that

For all n and i,there exists at most one y such that i EC(n,O,y). So, for every m there exists a natural number M (depending upon n) such that i f i < m and W

i E UC(",O,V) Y

Y

d

then (5.17)

We prove that for every z

> M,

C(n,O,z) = C(n,m,z) -

(5.18)

From (5.12) it follows that we need to prove only the inclusion C(n,O,z)

c C(n,m,z)

'

An inspection of the defmition of the sets C(n,m,z) shows that all we have to prove is the inequality i 2 rn, for i E C(n,O,z). Assume, by contrary, that i

< m.

Since

z-3

i E C(n,o,z) c uC(n,O,z) a =O

,

it follows from (5.17) that M

i E UC("'0,Z)

9

a -0

i E C(n,O,z), for some t 5 M < z. i E C(n,O,z) f! C(n,O,z),for some I < 2, a contradiction. On the baaia of (5.18), (for n = q ) , we deduce that

so,

df)(m,z) = d H ( , ) ( W ) =

&&,4

Consequently,

9

for all m , and z > M (where M i3 a constant depending upon m). Notice that we have only proved the existence of M ;the conatant M WM not effectively constructed, and, as we shall later prove, it cannot be effectively computed! We are now able to defme the required recursive function f :N RV by the formula '-c

255

Chapter 3

f(.) for every

=

#)(OlZ)

(5.19)

9

Clearly, (5.2) follows directly from the definition and (5.7). We note that for all i and 2 , if z > i , and 2.

9(2,rnax(@t(r(p,i+1),.)(2)

then f #

Iz

5 4)> @1(4 9

(5.20)

4;. Indeed, i E C(q,0,zo)

1

where z, > i is the smallest natural number for which (5.20) holds, and consequently

r ( 4 = dp)(o,zO)

= djr2l,)(o1Zo) = PY[Y # 4 j ( z o ) ,

#

di(Z0)

for every j€C(q,O,zo)]

*

Therefore, for all indices i for f ,

@ib) 2 9(z,max(~t(r(p,i+1),.)(2) l z s 2))

9

(5.21)

for all z > i . Let i be an index for f. Consider the constant M associated to q . Clearly, for every z,

-i

f ( z )= #(o,z)

-

= {

5M, b p ) ( i + l , z ) , for z > M ,

#)(o,z)

~

~

,

for z

,

for z

5M ,

~ for ~ z ~> M ~

where w = J ( M , P + ' ) (t$p)(O,O)

,)

~

z

)

,...,bp)(O,M))) .

Put j = t(s(q,i+l),w)

.

First of all we notice that for every z in

N

we have:

256

Caludc

Example. Take g(z,y) = 2’, for all 2 and y . The Speed-Up Theorem asserts the existence of a recursive function f such that for every index i for f we c a n find another index i for f such that (6.4)

2q=1 2

a,(,)

a.e.

,

or

a j ( z )5 10g~(*~ ( z)a.e. ) This logarithmic speed-up can be indefmitely corresponds an index k for f such that +t(z)

iterated:

I logZ(Qj(z)) I logdlogZ(+s(z)))

to

each j

a.e*

aa.0. 0

Comments. a) The “almost all” condition in the statement of the Speed-Up Theorem cannot be dropped since for every recursive function we can construct a computing algorithm having an auxiliary computation table which produces finitely many outputs in a minimum complexity. b) Condition (5.2) shows that the speed-up phenomenon is not a consequence of growth. Moreover, it is not difficult to modify the above proof of the Speed-Up Theorem to obtain a recursive predicate which sathfies condition (5.3). c ) Theorem (3.5) says tha t not all recursive functions can be speedup. Furthermore, in the context of Corollary (4.9), every recursive function f with an h-speed-up (here h is the binary recursive function which satisfies the relations (3.1) and (3.2) in Theorem (3.1)) in the BLUM space 4 has the following property: for every index i for f we can find an index ;for f such that

257

Chapter 3

In other worda, for the computation of f the faster computer is not better than the slow one. d) We stress the asymptotic character of the Speed-Up phenomenon. The practical significaqce of this result is not so strong since all real computations deal only with finite initial segments of functions. The above proof of the Speed-Up Theorem does not provide an uniform way to obtain an index for the faster algorithm for f on the basis of an earlier index of f , A first non-uniformity result is given in the next theorem. (6.6) Theorem. recursive function recursive function recursive function

(BLUM [1967a]) Let g:nv? --c RV be a sufficiently large satisfying (5.1) and let f:RV -+ RV be the corresponding furnished by the Speed-Up Theorem. Then there is no k :RV --c Pi such that

f = Qt(i),for all i

,

(5.22)

and for every index i for f there exists an index k(j) such that g(z,*k(j)(Z))

I *i(z)

(5.23)

Q.C.

Proof. Let p:RV N be a recursive function such that for every n, the equation p ( z ) = n has an infmity of solutions. By the 8-m-n Theorem we get a recursive function s :RV + IV satisfying the equation dm(i)(z)= dbj(p(s))(z)

-

(5.24)

Intermediate step. There exists a recursive function h :nv? + IV such that (5.25)

for all i and

2.

First of all, in view of (5.24), we notice the existence of a recursive function R : W 4 RV such that for all i and 2 . We shall prove the existence of a binary recursive function h satisfying the inequality

R ( z , i , t , t )< h ( z , t ) + h ( i , t )

,

for all 2, i , z , and t . We begin with a binary recursive function a : #

-+

RV and we

258

Caludc

To the r e c u r s i v e function R corresponds the recursive function T:w-+ N given by

T(z,r) = max(R(i,j,k,t) li,e

< z;j,k 5 y ) + l ,

for all z and y . Now, for all

t, i , z ,

R( 2 ,i ,z,t)

and t we have:

< T(max(z ,t ),mu(;, t ) ) 5 b,(max(z,t))+b~max(i,z)) .

So, we can take h ( z , y ) = b,(max(z,y)), thus completing the proof of the Intermediate step.

Assume, for the sake of a contradiction, that we can fmd an unary recursive function k = q5t satisfying (5.22) and (5.23). Then by (5.24) A ( t ) ( Z ) = 66,(p(r))(4 = h(p(r))(Z)

for all

2,

so ~ ( t ki)

an index for f . In view of (5.25),

@a(,)(.)

for all

2.

9

5

(2 t4k(p(s))(z

))+a(t,9t(p(z)))

For every n and for infinitely many %(t)(Z)

2,p

f

(5.26)

( z ) = n and

I h ( z , 0 , ( " ) ( 2 ) ) + h ( t , 4 t ( n ) )-

(5.27)

Now assume that the recursive function g satisfies the inequality 9(t,Y)

for all t and y. of 9 . Putting y

(5.28)

1

because the definition of h is independent O+)(z) in (5.28) we get:

This is possible =

g(Z,*i(n)(Z))

so, by (5.27)

> z+h(z,y)

> z+h(zt@L(n)(z))

>

259

Chapter 3

@8(t)(Z)

< g(z ,@ k(n)(2 ))-z+h (t,4r(n))

7

for every n and for an infmity of x . Hence, for every n, @8(t)(z)

< g(z,@k(n)(Z))

T

a contradiction since f = q5,(t). 0

Comment. A stronger result (see BLUM I19691 and SCHNORR [1973)) concerning the non-effectiveness of speed-up can be proved: Let f and g be unary and, respectively, binary recursive functions. Then there does not exist a p.r. function T :RV a Hv such that for every index i for f , ~ ( iZ) and g(z,@r(i)(z))I @i(z)4.eWe close this section with the operatorial form of speed-up. Furthermore, the speedable function will be zero-one valued. (6.6) Theorem. (Operator Speed-Up Theorem; [1972]) Let

-

F:PR + P R

h4EYER and FISCHER

,

be a total effective operator. Then, there exists a recursive predicate

f :Iv

+

(04)

9

such that for every index i for f , there is an index j for f such that

F ( Q j ) ( z )< ai(z)

‘v

ox.

(5.29)

Proof. We begin with a r.e. sequence (pi) of unary recursive functions which will be later defmed. Assume that 4( is an enumeration of this sequence, i.e.

dt(J(i,z))= Pi(%)

9

for all i and z. Let be a recursive enumeration of all aero-one valued functions with fmite domain. We s h d construct, by stages, the recursive predicate f on the basis of a ternary p.r. function B ( , and of the unary recursive predicate cancel. Put caneeZ(0) = 0 and defme the Stage x in the computation of e .( ,u,2 88 mows: 1. P u t ecmeel(x+l) = 0.

(ei)

2. If z E dom(eW),then put Be(u,u,z) = eW(z), and STOP. 3. If z

< u, then put

Bt(u,u,z) = 0, and

STOP.

260

Cdude

4. Repeat all previous Stages q < z in the computation of B((u,u,z), and determine all rn < z with eaneel(rn) = 1. 5 . If there is an i , u 5 i 5 z, such that e a n c e l ( i ) = 0 and Oi(z) 5 p i ( z ) , then find the smallest i with these properties and put cancd(i) = 1, e1(u,o,z) = l + ( z ) , and STOP. 8. P u t B,(u,u,z) = 0, and

STOP.

Some remarks seem to be urreful: a) The binary predicate z Edom(e,,) is recursive, so the test in step 2 can be effectively performed.

b) FI $[ is total, then the binary predicate Oi(z) 5 pi(.) is recursive since pi is total. If ai(z) 5 pi(z), then #i(z) # zq so in step 5 , B[(u,v,z) # x, if all hypotheses hold. c) Once eaneel(i) = 1 at some stage, then the value of eaneel(i) remains unchanged at all later stages. d) In step 4, Bt(s,u,z) = x if any of the previous computations is undefmed. It should be clear from the construction and the above comments is total. that B 1 is a rero-one valued recursive function when We shall consQruct a suitable sequence (pi) satisfying the condition at the beginning of the proof and we shall put f t ( z ) = B ( ( O , O , z ) , for all z.

Claim 1. For every index

a

for f c ,

Gi(z)

> pi(z)

0.c.

,

(5.30)

in case #! is total. If, for some i , ai(z) 5 pi(z) i.o., then at some Stage z in the computation of f , (2) = B , (O,O,z), step 5 will determine the assignment c a n c c f ( i ) = 1, and hence will guarantee the relations: /,(z) = e,(o,o,z) = I++) # g,(.).

Claim 2. If dt is total, then for every u there is a u such that f , ( z ) = Br(u,u,z), for all z. For every u, we choose u such that

Iz < u, or coneel(i) = 1 in the computation of B((O,O,z),for some i < u } ,

d om(e o) = (z E IV and

(5.31)

26 1

Chapter 3

fe(n) = ~ O ( n )

(5.32)

for every n E dorn(C6).

Only the case u > 0 is interesting. We prove by induction on z that { i E N Ii 2 u, cancel(i) = 1 in the computation of Bt(O,O,z)} = {i E N l i 2 u , eaneel(i) = 1 in the computation of Bt(u,e,z)}.

For z = 0 both sets are empty since the only possibility to obtain caneel(i) = 1 in the computation of 6,(0,0,0) (or e,(u,w,O)) is to pass the test in step 5, in particular the inequalities: 0 u <_ i 5 z = 0. It should

<

be easy to see that supposing the equality holds for certain 2 > 0, then it remains true when replacing 2 by (z+l), since the test in step 5 is “hereditary

”.

By an s-m-n construction we get a recursive function t : N 34 satisfying the equation dt(r,o,r.)(~ =)

Be(u,v,z)

Claim 8 . For every total effective operator u and u ,

d,, such that for all

EPt(s+l,o,n))(4

5 Pub)

-

there is a recursive function (5.33)

=.I?.

To prove (5.33) we consider the p.r. function w the equation

w

N

:N2 aN

given by

(e , J( i , z))=

for all L , i , and z. The Recursion Theorem gives a fmed-point n : dn(w)= w ( n , w ) , for all w . We are now into a position to defme the required sequence (pi). For every i , consider the p.r. function p i : N defmed for all z by pi(.) = w ( n , J ( i , z ) ) i.e. ,

262

Cdudc

Intermediate Hypothesicr (IH): Aesume po to be recursive.

Claim 4. From (IH) we deduce that for all i and y (5.35)

Claim 6. From (M) we deduce that 4, is recursive.

If po is total, then p o ( z ) is given by the second clause in the defmition (5.34) for almost all z. Consequently, +"(J(j,y)) z cq for every j > 0 and all y , i.e. pj is total for every j 2 0, thus proving that 9, is total. Claim 6. For all u , u , l , and z , 9t(u,o,r)(4

+

* .( <

or .( E d o m ( C ) )

or ( d t ( J ( i , m ) ) #

30,

allu
for

.

(5.36)

The above equivalence fallows directly, by kiductbn an 2 , on the basis of the construction of the algorithm which computes the p.r. function fit(aYuY=) = 4t(u,a,t)(4.

If for every i > m, pi is total, then by (5.36) it follows that 4q,+l,a,n) total, and hence +'t(m+i,o,n) and E(@t(m+l,o,nl) are also total. So, if p,(m) = KI, for some rn, then for all i > m , pi(z) = 0, for every z (by virtue of the fvst clause in (5.34)). Hence po is total, thus ending the proof of Claim 3. We are now able to fmish the proof. P u t f = f , = dt(o,o,n),where n is taken from Claim 3. By Claim 3 and the remarks preceding Claim 1 we

263

Chapter 3

know that f is a recursive predicate. If i is an index for f , then j = t ( i + l , u , n ) is also an index for f when u is taken (not necessarily effectively) by Claim 2. So, by (5.301, Oi(z) > p i ( . )

use.

,

and by (5.33), E(@tt(i+l,u,n))(z)I Pi(z) a*e.

Consequently,

f ( 4 j(z)) < Pi (z)

a*e.

9

which proves that f satisfies (5.29).

Remarks.

is the following: a) An example of a total effective operator = rot$;, where r : N RV is a fued recursive function (BLUM [1967a]).

F(di)

Y

b) Take the total effective operator F in such a way that for the recursive d,, F(&) majoriees almost everywhere every primitive recursive function in di; then it follows that bi majorizes almost everywhere every primitive recursive function in O j . (The set of all primitive recursive functions in di - where di is a fured recursive function - consists of all functions which can be obtained from the base functions and di, by means of functional composition and primitive recursion.) c) A significantly speedable predicate is dishonest.

8.6. THE

UNION THEOREM

The basic result of this section asserts that the union of a recursively enumerable sequence of increasing complexity classes is itself a complexity class. This theorem provides a deep link between eome problems concerning the structural hierarchies and the complexity theory. As a coneequence, we shall prove that the set of primitive recursive functions is a complexity class with respect to certain BLUM spaces.

Fix 9 a BLUM space. Let (f;);Zo functions &h that for all i and 2,

be a r.e. set of unary recursive

264

Caludc

Our aim is to prove the following result:

(6.1) Theorem. (Union Theorem; McCREIGHT and MEYER [1969]) Under the above assumptions, we can effectively find a recursive function g : N -+ Bv such that

c,

uc,; x)

=

i=O

Proof. Since ( f i ) ia r.e., we can find a recursive function H : N -+ N such that fi = +H(i), for all i. We shall define g by means of a course-of-values recursion using a “priority method” which uses some unary recursive function guess. We display the procedure for computing the values g(O),g(l), ...,g( z), for some z. 1. Put y = 0. 2. Put

gU1?88(y) =

y.

3. P u t A = +H(,)(Y). 4. Put i = 0. 5-

If @i(v) I * ~ ( m r r ( i ) ) ( ~ )then , go to step 7.

6. Compute A = min(A,4H(grcrr(i))(y)) and put guess(i) = y.

7. Put i = ;+I. If i 5 y , then go to step 5. 8. Put g(v) = A. 9. Put y = y+l. If y

5 z,then go to step 2.

10. STOP. Some comments will be helpful. First, notice that equality (6.2) h equivalent to the condition: For all i,

(aj(,)5 g(z) ax.)

w

(a,(.) 2 ji(z)

ax.,

for some i)

.

(6.3)

It follows that the fnst candidate for g is the diagonal function fs(z). Clearly, G(z) = f,(z) is greater than fi(z), for aU i and almost all 2. However, thie function does not work since there may exist a recursive dj such that

a,(.) < f , ( z ) a.e. , and for every i,

(6.4)

265

Chapter 3

a j ( z )> fi(z) a.e.

(6.5)

In other words, 4 j is in the complexity class of G but not in the union of C f i , thus showing that G is too large! To avoid this difficulty start with the value j s ( z ) ,and then “guess” for every j a certain function in the sequence that majorises Q j . More precisely, for all i and z with i <_ 2 , the value guess(i) represents the “guess” that the inequality ai(y)

I dH(gwrr(i))(y)

a*e*

9

holds. It should be clear from the construction that for every z,

1; 5

and

g(z) = min(4H(r)(z ) d H ( g ~ c r r ( i ) ) ( ~ Qi(z)

> 4H(prrr(i))(z)) -

(6-6)

Once convincing that the procedure works we shall simply use the shorter notation f i instead of Claim 1. For every j,

f j ( z ) I g ( z ) 0.e-

(6.7)

Let j be fmed and consider an z 2 j. For every y such that j 5 y 2 z we have guess(y) 2 j and, by (6.1), fgrcr,(,)(z)2 fj(z). Indeed, an inspection of the procedure shows that, by step 2, gueee(y) = y 2 3, and then the value of gucse(y) can be modified only in the computation of g ( z ) , for some z 2 y. Two possibilities of modifkation may occur: a) z = y, and in this case, by step 6, guess(y) = y 2 j , b) z > y, and in. this caae, again by step 6, gUe88(y) = 2 > y 2 j.

For every y < j 2 2 , 8 guces(y) 5 j , and fw,r(r)(z)is used in the and the test in step 5 fails computation of g(z), then fw,,(,,(z) < aY(z), to hold, i.e. gueee(y) = z 2 j. We continue the proof of Claim 1 with Claim 2. There e h t s an z,* 2 j such that no f, with y < j is used in the computation of g(z), for all z 2 zf. We proceed by rcductio ad abeurdum. Assume that for every z 2 j there exiets an y < j such that f, is used in the computation of g(z), i.e. there exists an i 5 z with y = gucas(i) and Oi(z1 > fmr,(i)(z) =

We

4

*

(6.8)

to analyse two situations. If j 5 i <_ z, then 2 j > y , a contradiction! If i < j 5 2 , then, on one hand,

have

y = gueae(i)

fy(

266

Calude

guess(i) =

z

2 j , and,

obtain a contradiction. that

on another, by (6.8), g u e s s ( i ) = y

< j. Again

we

We can reformulate Claim 2 as follows: There exists an zf 2 j such for all t 2 zf and y < j , i 5 2 , if g U e 8 8 ( i ) = y, then <_ fmr,,(,)(z).Consequently, we can write g(z) = mh(fz(z),jguei,(i)(z)

I; 5 %and

a;(.) > f p e i , ( i ) ( z ) , f i C 8 8 ( i ) 2 j )

7

since in case i 5 z and g u e s s ( i ) < j we have, by the above formulation of Claim 2, ai(2) <_ fgw,,(il(z). To fmish the proof of Claim 1 we note that if g ( z ) = fz(z),then 2 j, and if g ( z ) = fgre,,(i)(z), then again g ( z ) 2 fj(z), for all z 2 g(z) 2 fj(z), for all z 2 zj,since pess(i) 2 j. Claim 3. If Qi(z)

5

g ( z ) o x . , then there exist a j with

ai(z) <_

(6-9)

f j ( z ) a.c.

From the hypothesis, there is a t with the property: ai(z) 5 g(z), for every t 2 t . Now let z 2 max(t,z.) 2 i (here 2 i is the natural number furnished by Claim 2 with j = i ) .

ti'

We have

ail.) I g ( 2 )

=

mh(fz(z),fgw,,(j)Iz) lj I 2 and @j(z)

> fgse,,(j)(z))

*

In the computation of g ( z ) the inequality Qi(z) hold since it would imply @i(z)>

fgwr,(i)(z)

2 g(2)

> fpc,,(,)(z)

cannot

7

which contradicts the hypothesis of Claim 3. So, for every z 2 max(t,z;), g u e s s ( i ) does not change the value. Putting j = g u e s s ( i ) we obtain (6.9). U +i N such that the set of all unary primitive recursive functions coincides with the complexity class of g in the BLUM space ( ( u , ) , ( f l i ) ) .

(6.2) Corollary. There exists a recursive function g:N

Proof. First let ( f i ) be a r.e. enumeration of all unary primitive recursive functions and for every i put

267

Chapter 3

f;(x)

i

=

C fj(z)

3

j-0

for every x . Clearly, f:(x) 5 f:+l(z), for all i and 2 . Consequently, the Union Theorem says that in the BLUM space ((ui),(fli)), 30

where g :PI-+

N

ia a suitable recursive function.

To fmish the proof we notice that for every unary primitive recursive function f , an unary primitive recursive function F corresponds such that in the BLUM space ((ui),(fli)),f E CF. The argument proving the above statement follows from the inductive definition of the set of primitive recursive functions. The base functions are complexity classes named by primitive recursive functions and the closure operations respect thin property. 0

Remarks. a) All usual BLUM spaces have the property stated in Corollary (6.2). More precisely, every BLUM measure which is related by a primitive recursive function to (ai) haa the above mentioned property. See also the Remarks following Defmition (5.5.6) in Section 5.5.

b) Corollary (6.2) and the preceding remark show that there exist strong arguments for considering the class of primitive recursive functions to be the least complex class of recursive functions. c) The recursive function g which names the complexity class of all primitive recursive functions cannot be made primitive recursive. For, if g were primitive recursive, then g would belong to a certain class in the primitive recursive hierarchies (see Chapter 1) and so C, would not include higher classes. However, by the Honesty Theorem, g can be taken to belong to some measured set. d ) We can easily construct a BLUM space for which Corollary (6.2) fa& to hold.

268

a.7.

Caludc

BARD RECURSIVE FUNCTIONS

This section is dealing with “hard” recursive functions, i.e. recursive functions which are arbitraryly difficult to compute (see the Theorem (3.5)). We shall show that, under reaaonable assumptions it is impossible t o prove that “hard” recursive functions are really difficult to compute. Finally, the sufficiently hard recursive functions cannot be recursively enumerated. Again fur a

BLUM space Z - = ((4i),(*,)).

-

(7.1) Definition. (GILL and BLUM [1974]) Let h : N N be a recursive function. A p.r. function w :nV 3 RV is i.0. h-eomputable (with respect to 9 - ) if there is an index i for w such that

a,(.) 5 h ( 2 )

(7.1)

i.0.

We say that w is a x . h-hard if it is not i.0. h-computable.

Remark. In Defmition (7.1) the p.r. function w is not necessarily total, but in view of (7.1), w has an infmite domain. (7.2) Definition. A sequence (Ri), recursive provided the set

of subsets of

N is called uniformly

{ J ( i , z )I2 E R,,i EN) , is recursive.

Remark. If ( R i ) i2o is uniformly recursive, then each set Ri is recursive. (7.a) Example. For every i , put

Rl

=

{z E N 1 2

>l}

.

It should be clear that the sequence (R,); Lo is uniformly recursive. 0

The fust result asserts that if a p.r. function w vanishes for every element of a certain “easy-to-decide” recursive set R , then w is “easy-tocompute” on R. (7.4) Lemma. If (Ri)i20is uniformly recursive, then there is a recursive function B:JN + N such that every p.r. function which vanishes on some Ri has an index j such that on Ri,

269

Chapter 3

Proof. Let

:p N

be a recursive function supplied by the Theorem which satisfies the equation 8

4

,

8-m-n

ifzERi,

4*(idz) = (ooj(z) , otherwise.

(7.3)

We claim that the class {4,(i,,)l i , j EN} ia exactly the set of all unary p.r. functions identical zero on some set Ri. Indeed, from (7.3), every d,(i,jl vanishes on Ri; conversely, if qbh(z) = 0, for every z E Ri, then 4,(i,k) = 4 k We defme the recursive function B as follows:

ifz

4 Ri,

for all i

i,j

2x ,

5 z,and z E Ri) , otherwise,

for every z. If z E Ri, and z 2 m a [ i , j ) , then @,(i,j)(z) 2 B ( z ) . If d j ( z )= 0, for all z E Ri, then (as we have already seen) 4, = +,(i,j), and, on Ri,

iB(z)

@,(i,j)(z)

n

(7.6) Corollary. There is a recursive function b:N --c lV such that every ultimately zero p.r. function d j satiefies the condition Gj(z)

5 b(z)

0.c.

(7.4)

Proof. We use the sequence (Ri)i20in Example (7.3) and Lemma (7.4). 0

We are now into the position to analyse the possibilities to prove that a recursive function is a.e. h-hard. As expected, we shall prove that if the unary recursive function h ia sufficiently large, then we can construct a recursive predicate f which cannot, under reasonable assumptions, be proved to be o.e. h-hard, in spite of the fact that it is. F i x T a GODEL theory and suppose that for every unary recursive function h there exists in T a formula H ( i ) ,which can be effectively constructed on the basis of an index i , and has the following meaning: ‘‘#i ia a d . h-hard”. Since T is consistent, it follows that if H ( i ) ia a theorem of T,then 4i is use.h-hard.

270

Caludc

(7.6) Theorem. For each sufficiently large recursive function R , there is n o GODEL theory T which contains all true formulas H ( i ) as theorems. Moreover, we can effectively fmd an index i , such that H ( i , ) is true, but independent of T.

Proof. Assume, for the sake of a contradiction, that there exists a as theorems all true H ( i ) , for certain recursive function h. Then the r.e. set

GODEL theory T which contains S, = { i E

N I H ( i ) is a theorem in T} ,

consists of all indices for a.e. h-hard recursive functions. Furthermore, the totally undefmed p.r. function is ax. h-hard, so all its indices are in S,. By RICE’S Theorem, S, = N. Now, it is enough to get a sufficiently large h in order to ensure that there exist8 an a.0. h-computable p.r. function and fmally S, z RV. So, if h is large enough, then not all true H ( i ) are theorems of T. The last assertion in the statement of the theorem follows from Theorem (2.6.19). 0

The following question seems to be natural: Has every recursive function an “exceptional” algorithm about which we can certify that the function is a.e. hard? The next theorem answers this question in the negative. (7.7) Theorem. (GILL and BLUM [1974]) For every sufficiently large recursive function h , every r.e. class of a x . h-hard partial recursive functions omits arbitrarily hard recursive predicates.

-

Proof. Our aim is to construct, for every recursive enumeration (+,(i))i20 N ,a recursive function f : N (0,lj which is 0.e. t-hard but does not belong to {#,(i) li E N}.Formally, f must satisfy, for all i,the conditions:

-

of a.e. h-hard p.r. functions and every recursive function t : N

If

a,(.) 5 t ( z ) f

i.o., then f f (bi

d,(i)

,

*

(7.5)

(7.6)

The construction of f will be given on the basis of an uniformly recursive sequence (R,(a)(i,m,w)),which is independent of h . Every R,(a)(i,m,wl is given by stages. Stage n in the defmition of R,p)(i,m,g)is the following: 1. P u t

2. If n

2

= y.

< rn, then go to the next stage.

3. I f + i ( z )

I n, then R j i ~ ) ( i ,=~ {n)U , ~ ) R j ~ \ i , ~ ,and ~ ) yE

4. Go to next stage.

= z+l.

271

Chapter 3

We use Lemma (7.4) to obtain the recursive bound B for the complexity of the p.r. functions which vanish on some RJqi,m,,l. Since the construction of R J ~ ~ , is~independent ,,) of h, we can take h to satisfy the inequality: h ( z ) 2 B ( z ) ,for all 2. We construct the recursive function f by stages. We use two auxiliary unary arrays u and cancel. We say that the requirement 2i is outstanding at Stage n if canccl(i) = 0, and @;(n) t(n); the requirement 2i+l is outstanding at Stage n if @,(i)(u(i)) 5 n, and 4,ti)(u(i)) = f(u(i)), for the current value u ( i ) a t Stage n. The requirements are ordered according to the following rule: the requirement i has higher priority than the requirement j whenever a < j . Initially u ( i ) = canccl(i) = 0, for all i . We display the Stage n in the computation of f :

<

I. If there is no outstanding requirement with the number j < 2n, then put f (n) = 0. STOP. 2. Compute the number j < 2n of the outstanding requirement of highest priority. 3. If j = 2 i , for some i , and eancel(i) = 0, then put eancel(i) = 1 and defme

{

1 , if&(n)=O,

f ( n )= 0 , otherwise.

STOP. 4. If j = 2 i + l , for some i , then put u ( i ) = u ( i ) + l , and define f ( n ) = 0. STOP.

The above procedure works since: a) step 1 can be effectively performed; b) if j = 2 i , then chi(n) t(n), so #;(n) # 0s. Claim 1. For every

i', f

<

# 4,(i).

h s u m e , for the sake of a contradiction, that f = d,(k), for some 1; furthermore, suppose that k is the smallest possible. Each even numbered requirement is examined at most once, since by step 3, canccl(i) = 1 in case the number of the requirement is 2i. In view of the miniiality of the index k, it follows that u ( i ) 5 pu[f(g) Z 4,(i1(u)], for every i < k. The operation of adding an unity to u( i) is performed only when an odd numbered requirement is examined (by step 4). So, the odd numbered requirements are examined only finitely many times. We conclude that each requirement numbered by j < 2k+l is attacked only fiitely many times. On this basis we can take a sufficiently large m in such a way that no requirement numbered by j < 2k+1 is attacked at any Stage n 2 rn. Let y be the value wigned to u(k) at the beginning of

272

Calude

Stage m.

Returning to the construction of R J ~ ( ~ , we ~ , ,notice ) ~ that is an infmite set of zeros of f (n is placed into R,(a)(,(k),m,,) only by step 3, i.e. only in case f(n) = 0, because %8)(,(k),m.,)

%(k)(4k))

5n

9

and see in this respect step 4 in the construction of f and the defmition of an outstanding odd numbered requirement). Consequently,

f

=

4,(k) and on RJ(ak,(kj,m,,),

4,(k)k) L =-e. In particular, it follows that q5+) is i.0. E-computable, a conclusion which contradicts the hypothesis ({d,(,j I i E RV} contains only U . C . h-hard func-

tions) since h ( z ) 2 B ( z ) , for all z.

It remains t o prove that f is a.e. t-hard. Again we proceed by cont ( z ) i.0. In view of the tradiction. Suppose that f = & and @ k ( z ) above argument, f # q5,(i), for all i . We deduce that eventually we shall find an n such that ek(n)5 tfn) and the requirement 2k will have highest priority (every requirement is attacked only finitely many times). So, cancel(k) = 1 a t this stage, and, by step 3, f # &. We have obtained a contradiction.

<

0

Comment. Returning to the question raised in the paragraph preceding Theorem (7.7), we notice that there is no GODEL theory T which, for a sufficiently large recursive function h , produces a sequence of theorems ( H ( s ( i ) ) ) ,such that every U . C . h-hard recursive function has at least an index i for which H ( i ) is a theorem in T. For, if there were such a GODEL theory T, then (q5,(i$ would be a r.e. class of p.r. functions, containing only u.e. h-hard recursive functions thus contradicting Theorem (7.7).

Chapter 3

273

8.8. COMPLEXITY SEQUENCES

Each recursive function satisfying the Speed-Up Theorem fails to have a “best” algorithm. The complexity of functions of this type must be analysed in terms of infinite sets of algorithms. In this section we develop such an analysis using the tool of “complexity sequences”.

(8.1) Definition. (MEXER and FISCHER [1972]) A sequence of unary p.r. functions is called a eomplezity sequence for the BLUM space (p - = ((di),(ai))and the p.r. function q5:RV S N ,if

For every a, dom(pi) = dom(4) , For every di = 4, there exists a j such that Oi(z)

2 pj(z)

For every pi, there is a

dk

at(.) 5 Pi(.)

0.c.

=

(8.1)

(8.2)

4 such that a-e.

(8.3)

(8.2) Example. If (p is a BLUM space and 4:RV *RV is a fmed p.r. function, then the sequence {Oi 14i = d} is a complexity sequence for 9 and (p. - This complexity sequence is not r.e. 0

(8.1) Example. The sequence (pi)ilo constructed in the proof of the Operator Speed-Up Theorem is a r.e. complexity sequence for the speedable function. 0

(8.4) Example. A sequence (pi);?,, of unary p.r. functions satisfying (8.1), for certain fured p.r. function 4, is a complexity sequence for 9 and d provided it is cofrnal with the elements of the set {Qi = (6) under the relation “greater than or equal almost everywhere”. 0

In the following theorem we describe a method of determining, up to composition with a fEed recursive factor, for every recursive function, a r.e. sequence which “approximates” a complexity sequence.

Fix a BLUM space 9 - = ((q5i),(@i)).

274

Calude

(8.6) Theorem. There exist two recursive functions a & : @ --c N such for all i and z,then we have: that for every e l if we put pi(z) = @a(e,i)(z),

dom(#4(e,i)) = dom(pi) 2 dom(de)

(8.4)

9

for every i, 44(c,s)(4 =

for every

a,

A(2)

(8-5)

7

and for almost all z E dam(#,),

and

there is a k such that #k(z) = #e(z), for all z

E dam(#,), and for every i , h(z#i(z)) 2 @k(z) a.e.

Proof. Defiie the recursive predicate E : N 3--c (0,l) by I

~ (i i e, ~=) n ( g r (@i (Y),z)+gr('oe (Y),z Y=O

+ eq (de (Y Mi(Y 1))

9

for all e , i and z (in other words, for all y 5 z, if @ i ( y ) * e ( ~ ) I ~9 then +,(Y) = 4i(Y)). We construct the p.r. function w :N3 3 N by cases:

1

q$(z)

, if

E ( e , i , z )= 1 and

u ( e , i , z )= # e ( z ) , otherwise.


a,(.) < ae(z),

and

-

The 8-m-n Theorem furnishes the recursive function a : p PI satisfying the equation w ( e , i , z )=

#a(e,i)(z)

-

If be(z)f cr, then @,(z) # q so, if O i ( z ) < O,(z), and E ( e , i , z ) = 1 we have #a(e,i)(z)= di(z) # q in the opposite case ~ u ( e , s )= ( z#,(z) ) # x, thus proving (8.4). Since if E ( c , i , z ) = 0, then E(e , i , y ) = 0, for every y 2 z,it follows that (8.5) also holds.

-

To construct the recursive function h we begin with the auxiliary recursive function H :N4 N d e f i e d for all e , i , z , and z by

275

Chapter 3

L

Oace,i)(z),

H ( e , i , z , z )=

if E(c,i,z) = 1 and Oi(z)

=z

,

otherwise.

One can see that if E ( e , i , z )= 1 , then H(C,i,z,@i(z)) =

@ a ( a , i ) ( z)

= pifz)

Now put for all z and z

h * ( z , t )= max(H(rn,n,z,z) Im,n

5 Z) ,

and suppose that # e = #i. Since E ( c , i , z ) = 1 for every z,it follows that H ( e , i , z , a i ( z ) )= pi(z), for every z,so

2 pi(z)

h*(z,*i(z))

(8.8)

9

for every z 2 max(e,i). For the last condition we use the enumeration recursive function b :fl-c N by the condition

i

( r i ) i z oand

rj(z), if z E dom(rj)

‘b(nd(z) = #,(z)

, otherwise.

define the

,

We define now the recursive function G :N4 -c N by

L

*b(n,j)(z)

G(n,j,z,z) =

9

if @ n ( z ) =

1

otherwise,

for all n, j, z , and 2. Again we notice that G(n,j,z,O,(z)) = * b ( n , j ) ( ~ ) . On this basis we put for all z and z ,

h**(z,s)= max(G(n,j,z,t) Jn,i5 Z )

.

It follows that h**(z,Qn(Z))

2 #b(r,j)(z)

7

for all n, j , and z 2 max(n,j). Finally, we define h by h ( z , z ) = max(h*(z,z),h**(z,z))

,

for all z and z. Clearly h satisfies both (8.8) and (8.9) almost everywhere. In view of (8.4) we have: #a(e,i)(z)

=

be(%)

9

for every i and almost all z E dom(4,). Consequently, for every i , there exiata a natural number w (which depends upon i)such that

276

Calude

(8.6) Corollary. (MEYER and FISCHER [1972!) There exists a recursive function h --* N such that if

:w

,

C:PR-PR

is a total effective operator satisfying the condition

F(di)(z) 2 h ( z , b i ( z ) )

(8.10)

1

for every total qbi and all 2, then every recursive function satisfying the Operator Speed-Up Theorem (for this )F' has a r.e. complexity sequence. Proof. Our h will be produced by Theorem (8.5). Let 4, be the recursive function which satisfies the Operator Speed-Up Theorem, i.e. if bi = be, then there exists a bj = &c such that

F ( o i ) ( z )< ai(z)

a.e.

We consider the r.e. sequence (pi)iLo furnished by Theorem (8.5) for the

above fmed e and we shall prove that it ie a complexity sequence for 4,. From (8.4) it follows (8.1). From (8.7) and the totality of 4, we deduce the existence of a k such that be = @k and for every h( z, pi( z) ) 2 @ k ( z ) a.e.

(8.1 1)

We use now (8.10) and the property of 4, to be C-speedable: to the algorithm C$k corresponds an algorithm bn such that b,, = b k = 4, and

h(z,an(z)) 5

F(an)(2)

<@k(Z)

a.e.

From (8.11) we deduce the inequality h(z,@n(z)) I h(z,pi(z)) a.e.

which enables us to write the relation

a n ( , ) I Pi(z)

a*e.

(8.12)

since we can assume, without loss of generality, that h ia increasing in the second argument (see the proof of Theorem (8.5)). So, (8.12) shows that

277

Chapter 3

(8.3) holds.

Finally, condition (8.2) follows from (8.6).

Let i be such that

4e. Since 4, is E-speedable, it followr that there exists a j such that dj = di = de and

4i

=

f(@,)(z)< ai(z) a.c. By (8.10) and (8.6) we deduce that Pj(z)

I h(z,Oj(z)) I z(@j)(z)< a,(.)

a*c* 0

The above corollary shows that the recursive functions poesessing a sufficient speed-up have r.e. complexity sequences. The next result goes deeper into this phenomenon. (8.7) Theorem. (MEYER and FISCHER I197211 There exists a recursive function h :@ -* RV such that for every nondecreasing total effective operator

E:PR-.PR

,

satisfying condition (8.10) and for every recursive function f : N the following two statements are equivalent:

f satisfies the Operator Speed-Up Theorem for [

.

-.+

RV,

(8.13)

One can effectively fmd a r.e. sequence (pi)i20 for

f such that for every pi there exists a pi with F(Pj)(z)< Pi(z) a-e. Here

f

(8.14)

nondecreasing means that for then [(+i)(z) 2 F(dj)(z)a.c*

4il.I 2 4j(z) Q.c.,

all

i

and

j, if

Proof. We take h as in Theorem (8.5). For the direct implication we assume that f has an [-speed-up. In view of Corollary (8.6), f possesses a r.e. complexity sequence (pi)i20. For every pi we can fmd an index k of f such that @k(z) 5 pi(%) a.c. (see (8.3)). Furthermore, we can fmd another index t for f such that [(at)(.)< cPk(z) 0.c. By (8.2), we have a j such that p i ( z ) 5 Ot(z) a.c. Now, since f is nondecreaeing, we can write E(Pj)(Z)

I E ( @ t ) ( zI ) pi(%)

a*c.

Conversely, amume that (8.14) holds. By (8.2), if di = f , then there exists a j such that (oi(z) 2 pj(z) 0.c. In view of (8.14), we can find a t with the property: pj(z) > e(pt)(z) a.c. Returning to (8.3), we get an

278

Coiude

index k for f such t h a t p t ( z ) 2 ak(z) o x . Finally, since is nondecreasing, we can write f(pt)(z) 2 [ ( a k ) ( zu.c., ) a,(.) > [(@h)(z) o.e., thus proving that f has a [-speed-up.

a Remarks. a) The pathological behaviour of total effective operators has been investigated by HELM !1971]. One constructs a total effective operator which is not bounded by any nondecreaaing total effective operator.

b) Operator Gap Theorem shows that not every r.e. sequence of recursive functions is a complexity sequence. More precisely, if F is a nondecreasing total effective operator and t :N-+ N is a recursive function satisfying Theorem (4.10), then no sequence of recursive functions (pi), 2o satisfying the inequalities for aU i , is a complexity sequence.

a.9.

the

A TOPOLOGICAL ANALYSIS

In this section we investigate, by means of a constructive version of Theorem, the size of classes of p.r. functions.

BAIRE Category

The set of recursive functions which are ultimately sero R ( 0 ) is r.e. (see Example (2.8.20)). We shall adopt the following complexity-theoretic enumeration of R(0). Let 9 = ((4;),(ai))be a BLUM space and let s :RV3 IV be a recursive fu&tion, furnished by an a-m-n construction, which satisfies the equation:

-.

4i(z)

, if

+,(i,r,z)(s) = 0 ,

for every z in

5 Y,

and

a,(.) I

otherwise.

Iz EN),where h : N + IV is the

We prove that R ( 0 ) = {++) recursive function given by h(z)=

2

a(rIS)(Z),r43)(Z),r433)(2))

Y

N.

For every natural number

2,

dr(.) in in R(0) (because for every

279

Chapter 3

3 @$)c,t(i) 5 I!%”((.) < 3o f and 4+)(i) = 0, in other cases). Conversely, if f = 4, is in R(O), and i

I l p ) ( z ) , 6A(s)ti) = # ~ f j ( ~ ) ( ~f)

4,(i) for every i

OC)

r

,

=0

> i,, then take 2

= ~(~),(z,i,,max(@,(y) I0 5

I I io)) ,

and notice that f = 4 h ( # ) (because dA( ( i ) = 0, for every i =! 4h(#)(i)= # s ( i )= f ( i ) ,for every i I i,, smce @ , ( i )I m=(@,(ar)

> i,,

and

lo 5 Y I io)).

If 4 is an unary p.r. function, then supp(4) = {z E N I#(.) Z o , ~ is the eupport of 4. If t E R(O), then t ( t ) = card(eupp(t)). From the above construction it follows that for every natural number z , auPP(+h(s)) c {0919--9143)((.)}

(9.1) Definition. For every p.r. functions 4:nV A N ,w that w eztendo 4 on the support, and we write

dcw

(94

*

:nV

we say

9

in case 8uPP(b) c dom(w) and for every z

E 8Upp(d) we have: w ( 4 =

If4 C w , and 4

f w,

4(4

J

-

(9.3)

C

then we write 4 z w .

Remark. It is seen that C is a quasi-order relation on P R. We defrne a system of basic open neighborhoods which induces a topology in P R. For every t E R(O), put

u, = (9 E P R It c 4)

(9.4)

Remark. In view of Corollary (7.5), it follows that the complexity of the functions in R(0) is bounded a.c. by some recursive factor. Hence, the sets U,are constructed by means of some “emy-tecompute” functions.

}

280

Cdudc

(9.2) Lemma. For every t l , t 2 in R ( O ) , if Ut, n Ut, f exists t , E R ( 0 ) such that

Ut, = UtI n ut,

I

t3(z)

there

*

h(z)(=t2(z)) i if z EX

9

if 2 E 8uPp(t,)-X if 2 E 8'PP(tJ-X

tl(4 1 = t2(4 , 0,

0,then

9 9

otherwise. 0

Lemma (9.2) guarantees that (U,),,=J(~) is a system of basic neighborhoods in P R . We shall work with the induced topology r . The next result is immediate. (9.8) Lemma. equivalent :

Let

I C P R.

Then the following statements are

X is open For every

.

(9.5)

6 f 1,and every w E P R , if

4' E X there exists t E X n R ( 0 ) such that t C 4' q5 C w , then w E X , and for every

Remark. The topology

r

.

(9.6)

is not separated and quasi-compact.

(9.4) Definition. (CALUDE [1982a]) A set c P R is said to be a reeursively nowhere denre set with respect to the recursive functions f :N Bv, g :N-* Bv if the following four conditions hold: .-+

For every n

E IN,6!(,,) E R ( 0 )

(94

281

Chapter 3

For all m,n in

N ,if

m

> g(n),

d/(n)(4 = 0

then (9.9)

9

For every n Em?dh(n) c +I(,)

(9.10)

f

There exiats a natural number i such that for every n in

RV for which

!(d,,(,,))> i,we have X

n

U+,(n)=

0 .

(9.11)

Remark. Defmition (9.4) is simply a constructive version of the usual defmition of a nowhere dense set (see OXTOBY [1971]). Particularly, condition (9.9) is motivated by the necessity that the support of every function df(,,)should be recursively determined.

We continue with an useful technical result. (9.6) Lemma. equivalent:

Let

Xc PR. Then the following statements are

-

X is a recursively nowhere dense set. There exist two recursive functions f ' : N

i:RV + RV

(9.12)

N,

such that X together with f ' and

81 satisfy conditions (9.%),(9.9), (9.11), and (9.10') For every n E m,d h ( n ) C+ 6,1(,)

(9.13) (9.lo')

Proof. Clearly, only the direct implication must be proved. Let X be a recursively nowhere dense set with respect to the recursive functions f and g. First, let us construct the auxiliary recursive function p:@ -* lV defmed for all i and z in RV by

I

d,(i)(z)

P(i,.)

= 1 ,

9

if 2

I g(i)

9

if2 = g(i)+l otherwise.

,

We use an 8-m-n construction to get a recursive function a : N satisfying the equation ~(i,.) = d,(i)(Z) and we put

9

-.+

RV

282

Caludc

f(i) =

8(i)

, ,

g’(i) = g ( i ) + l

for every natural number i. The above defmitions ensure the recursiveness of the functions f’ and 9’. By construction, for every i EN,p ( i , z ) = 0 a.e., hence is in R(0). If rn and n are arbitrary natural numbers such that m > g(n), then = +,(,,)(m) = p(n,m) = 0. For every n in IN, +A(,,) C #/(n) C * d,(n] = #,.(,), so 4A(n) C d{(,,). Finally, in view of (9.11), for the triple X , f , g there exists a natural number i such that for every n in RV C with e (4A(,,))> i,we have X n U, = 8.Since I$,(,,) z Qi(,,) we deduce !In) the inclusion +,I(~)

+fl(n,(m)

which ensures the required relation: 1n

U,

J’kl

=

0.

Remark. By Lemma (9.5) it follows that we may equally use either conin the context of Definition dition (9.10) or condition (9.10’), i.e. c or

s,

(9.4).

c

P R is said to be recureiucly meagre (or, a (9.6) Definition. A set X set of the recureively first BAIRE category) if there exist a sequence (Xi)i?o, X i C P R, and two r.e. sets (fi)i20, (gi)i2a of recursive functions f i : N+ PI,g; :RV fded:

-

RV such that the following two conditions are ful-

r=uxi ,

(9.14)

i20

For every natural number ;,Xi is a recursively nowhere dense set with respect to (9.7) Definition. If X C

fi

and gi

.

(9.15)

P R ia not recursively meagre, then X in called a

set of recursively second BAIRE category.

Remarks. a) Intuitively, the recursively meagre sets are “recursively small”

sets, in opposition to the sets of the recursively second BAIRE category

which are “recursively big”.

b) Every recursively nowhere dense set ia recursively meagre, but

283

Chapter 3

the converse implication fails. (9.8) Propoeition. The f a m of ~ recursively meagre sets is closed under subset. Proof. Let

9

be a subset of a recursively meagre set

sively meagre under the decomposition

=

x.

If 1is recur-

U &, where

i2 0

every Xi is

recursively nowhere dense with respect to fi and gi, then putting pi = Xi n y, becomes recursively meagre under the decomposition

y = U Yi to

Y

(since, obviously,

IJi

is recursively nowhere dense with respect

i>O

fi

and gi). 0

(9.9) Corollary. The family of sets of recursively second category is closed under superset.

BAIRE

Proof. Directly from Definition (9.7) and Proposition (9.8). 0

(9.10) Propoeitlon. Let

1 C P R be a set which can be written as

X=U& , i2 0

and for which there edst the recursive functions f ,g:@ the following two conditions: For every i E N,Xi =

UYi,, ,

-

nV satisfying (9.16)

i 20

For all i , j f Bv, Pi ,J is recursively nowhere dense with respect to qb,(i,j) and 40(i,j)

.

(9.17)

Under these circumstances 1is recursively meagre.

Proof. From the hypothesis it follows that every set Xi is recursively meagre. For every natural number rn put: cm

= YK(m)C(m)

rm

= b/(K(m)C(m))

9



204

Calude

Pm = 4g(K(rn),L(m))

*

Clearly, for every rn in RV, C, is recursively nowhere dense with respect to rm and pm. Furthermore, since

Uri =

i20

it follows that

IJ

U(IJYi,j)= I

m

>O j > _ O

Cm

1

20

1 is recursively meagre.

(9.11) Corollary. The family of recursively meagre sets is closed under

union.

Proof. Directly from Proposition (9.10).

(CALUDE [1982a]) For every recursively meagre set and every t E R ( O ) , there exists a recursive function f :N4 RV such that f E Ut-X. (9.12) Theorem.

K cPR

Proof. Since X ia meagre it follows that X can be written as

r=uxi , 120

where Xi is recursively nowhere dense with respect to f i and gi, for every natural i . Furthermore, the sets {fiJiZO and {gi}i20 are r.e. In view of for all n anl; i in RV. Lemma (9.5) we can suppose that dh(,,)F Let us notice that for fured natural numbers n, i , and j the functional equality d!,(n) =

dh(j)

7

is equivalent to the following two conditions: for every z

I gi(n),

z E sup~(4j,(n)) (9.18)

(9.19) Consequently, the predicate Q : l V 3 -c {0,1} defmed for all natural numbers i, j, and n by

285

Chapter 3

is recursive. Moreover, since 4fi(,,) is in R ( O ) , for ail natural numbers i and n , then for futed such i and n there exists a natural number j (depending upon i and n ) such that Q(i,j,n) = 1. By means of the natural number q satisfying the equality t = dh(q) and of the predicate Q we construct the recursive function r:m -c IV defined by primitive recursion: r(0) = 0

4) =4 r ( z + l ) = r j [ Q ( K ( z ) , j , r ( z )= ) 11, z

, f

>0 ,

and the sequence (tm>,,,2o of functions in R(0): to(.) = tm(4

=

+)

9

21 #fKlm)(r("))(4 t

*

We notice that in view of the relation Q ( K ( m ) , r ( m + l ) , r ( m ) ) = 1 , rn

21,

we deduce the functional equality h K , m ) ( ' ( m ) )= h r ( m + l ) )

for every rn

'

(9.20)

2 1.

We show that for every natural number n , C

tm + k + 1

Indeed, for m

= 0,

to = t

= C +

and

4") df K(&)

-

dfK(l)('(l))

-

tl

9

*

(9.21)

286

Calude

tm =

df,,,fiW

= dh(r(m+l))

* 4fK,m*,p+1))

C

=

fn+1

by (9.20).

f

On the basis of (9.21) we can defme the recursive function 4 nv by

:N

f(z) =

if

trn(2)

Y

= I iIK(m)(+4).

By construction, for every natural number m , t, cf f ; in particular, t = t o c f , i.e. f E U,. We must prove that f $! X . For the sake of a contradiction, assume that f E X , i.e. f E Xi, for some i E IN. Since, by hypothesis, Xi is recursively nowhere dense with respect to f i and gi we can use the property (9.11) to fmd a natural number ni such that for all n in N with t‘(4qn1)> ni we have

Xi n u+,ii,,l =0 We choose m to satisfy the conditions

K ( m + l ) = i , and [ ( t , )

(9.22)

> ni .

The existence of such an m foIlows from the fact that for every natural number j the equation K ( z )= j has an infmity of solutions and from the monotonicity property (9.21). Finally set n = r ( m + l ) . We have (by (9.20)): twa

= dJK,,,,fi(m))= Qh(r(m+l)) = dh(n)

f

and

(fin) =

(dh(n))

> ni

*

On the other hand,

(9.23)

Since f E Xi, it follows that (9.23) contradicts (9.22), and this completes the proof. 0

287

Chapter 3

(9.18) Corollary. The set of unary recursive functions recursively second BAIRE category.

R is

a set of

Proof. Suppose, by contrary, that R is recursively meagre. By Theorem (9.12) we get the following contradictory relation: for every t E R(O), there exists a recursive function f E R such that t C f , and f 4 R. 0

Remark. The relation between the classical BAIRE Category Theorem and Corollary (9.13) is more profound. Every irrational 0 < a < 1 haa a continued fraction expansion nopa,, given by the relations

...

ni = [l/ri], if ti # O

,

where r,=a

,

ritl = l/ri-ni

.

Hence every function

f:nv-,nv

(9.24)

can be identified with the expansion

f (O)+l,f (1)+1, ...,r(.)+l)... and this correspondence yields a homeomorphism between the set of irrational numbers between 0 and 1, and the set of functions (9.24). T h b homeomorphism preserves the correspondence between recursive functions and irrational recursive real numbers in [O,l]. Via the above identifick tions, Corollary (9.13) and Corollary (9.9) give: (9.14) Corollary. The set of all recursive real numbers in [0,1] ia a aet of recursively second BAIRE category. (9.16) Corollary. The set of unary partial recursive functions P R is a set of recursively second B A R E category.

Proof. Directly from Corollaries (9.13) and (9.9). 0

288

CJudc

(9.16) Corollary. Every non-empty open set is a set of recursively second BAtRE category.

Proof. From Theorem (9.12) it follows that every basic open neighborhood U,ie a set of recursively second BAIRE category. Finally we apply

Corollary (9.9).

0

(9.17) Theorem. (CALUDE [1982a]) Every measured set i~ recursively meagre.

-

-.

Proof. Let X c P R be a measured set, i.e. 1 = {$qi)l i E N } ; here h :IN N is a recursive function, and the predicate ME : I N 3 {0,1} defmed for all i , z and y in RV by

is recursive.

We shall prove the existence of two r.e. sets of recursive functions 2o such that the singleton {bG(il}is recursively nowhere (di)i Lo and dense with respect to di and gi, for every i E N. First we construct the recursive functions di and gi. recursive function p :aV3 -+ RV by Q)(n)'

if z 5Zh3)(n), and

rt"]c,,,(z5 1,

z+3,

for all i , n , and

2

-

in RV.

c. .

We define the

if

2

V

d

IF)( n 1,

= ZQ)(n)+l, and

if z = Z431(n)+l, and Y

d

otherwise,

By two fold applications of the e-m-n Theorem we get a recursive function e :RV N which satisfies the equation

289

Chapter 3

Put:

for every n in RV. Obviously, the sets of recursive functions (di)i20 and (gi)i20 are r.e. To frnieh the proof we verify conditions (9.8)-(9.11) for the triple dh(i), di and gi, where i ian arbitrary fmed natural number. The conditions (9.8) and (9.9) are clearly fulfilled: dd,.(,,)(z) = p(i,n,z) = 0 a.c. for each fued natural number n , and 6di(,,)(m) = 0, for all n and m with rn > gi(n) = 1p)(n)+1. For every n in RV, C

#A(n)

f

#+,(i)(”) = ddi(n)

t

because dh(n)(Z) =

d4a1(n)(z)

9

for every z E e ~ p p ( + n ( ~n , ) {0,1,...,@1(n)}. To verify condition (9.11) we set ni = 0 and we show that for every natural number n with t(4h(nl)> 0, we have:

Suppoae, by contrary, that for some natural number n, with drfi)is in the open set U+ai(n,, i.e. ddi(n)

Thie means that for every 2,

= @)(n)+l.

2

It k seen that

c dA(i)

E a u ~ p ( d d ~ ( ~ ) dh(i)(z) ), = 2,

f supp(#,+)). S,+2

caaes, according to the value of the sum

c MW,Z,,Y)

s,+2

Y d

we have

Let w e must analyae two

ME(i,z.,y). U d

A) Incaae

> 0,

=0

9

6di(n)(Z).

290

Crlude

ME(i,Z0,Y) = 0

7

or, equivalently, #h(i)(zo)

for every

# Y

?

0'5y 5 z0+2. Consequently, 4d,(n)(Zo)

= 1< zo+2

,

and hence

B) Incase

it follows that and consequently

In both cases we have arrived at a contradiction,

proved.

so (9.11) was 0

Remark. The proof of Theorem (9.17) shows that { # } is recursively nowhere dense if 4 is an unary partial function with a recursive graph. In particular, { f } ia recursively nowhere dense in case f is an unary recursive

function.

(9.18) Corollary. Every r e . set of recursive functions is recursively

meagre.

Proof. Every r.e. set of recursive functions is measured, so, by Theorem (9.17), it iS recursively meagre. 0

Chapter 3

291

(g.19) Corollary. The following sets are recursively meagre:

a) The set of primitive recursive functions. b) Every subeet of the set of primitive recursive functions, in particular, every c h in the GRZEGORCZYK (or any equivalent) hierarchy, the set of KALMAR elementary functions. c) The set of real-time computable functions. d) Every r.e. complexity c h . Proof. Directly from Theorem (9.17) and Corollary (9.18). 0

If we combine the Honesty Theorem and Corollary (9.18) we get (9.20) Corollary. There exists a recursively meagre set S C R such that for every recursive function j : N + RV we can effectively fmd a recursive function f':N + N in S such that Cf = C.I, 0

We may ask whether the converse implication in Theorem (9.17) holds. The answer is negative and it will be obtained by strengthening Corollary (9.19), d). (9.21) Corollary. Every complexity class iS recursively meagre.

Proof. Let f :N+ I? be a recursive function. We can fmd a recursive function g:N + RV such that C, U R(0) C :C, It follows that C, is r.e., hence, by Corollary (9.19), it is recursively meagre. Finally, we use Proposition (9.8) to see that Cf c C, is recursively meagre. 0

The existence of complexity classes which are not r.e. (see Theorem

4.25)) shows that the converse of Theorem (9.17) fails.

(9.22) Corollary. The set of algebraic numbers (and, in particular, the set of rational numbers) is recursively meagre. Proof. In view of a well-known result of HARTMANIS and STEARNS [1965] (proved by means of multi-tape TURING machines and the timecomplexity) the set of algebraic numbers is contained in a complexity class, so, by Corollary (9.21), it b recursively meagre. 0

292

Cdude

Remark. Corollaries (9.14) and (9.22) reinforce the classical result on the real line: in the set of all recursive real numbers only a few numbers are algebraic. (9.28) Corollary. In every BLUM space the set of step-counting func. tions is recursively meagre.

Proof. We apply Theorem (9.17) to the measured set of the step-counting functions. 0

Remark. Corollaries (9.20) and (9.23) show that the sets occurring in the Honesty and Gap Theorems are sparse relative to recursive functions not only in the algebraic sense, but also in a recursively topological sense. Furthermore, Corollary (9.23) shows that the Gap Phenomenon ia not a consequence of the distribution of the step-counting functions between all p.r. functions.

a.io. HISTORY The rapid developments of mathematical logic, constructive mathematics and computer science were followed by a considerable interest in the construction of algorithms, in the analysis of their efficiency (see, for example, GODEL’s speed-up theorem for proofs in recursive logics, GODEL (19361, ARBIB [1969]). The first attempt to develop a systematic approach to a theory of computational complexity for the study of quantitative problems in computing was made by W I N [1959], [1960]. The study of specific time and memory complexities was a milestone in the development of ths area (see in this respect the papers of HART.MANIS and STEARNS [1964], [1965], HENNIE and STEARNS [1966], STEARNS, HARTMANIS and LEWIS [1965], HARTMANIS [1968]). The name “computational complexity” was given by HARTMANIS and STEARNS [1965]. Other three pioneering papers influencing much the growth of the field at its beginnings are: YAMADA [1962], RABIN [1963], and COBHAM j1964].

293

Chapter 3

The axiomatic approach waa introduced by BLUM [1967a]; his wonderful work WM written along the idem of RABIN [1980] and HARTMANIS and STEARNS [1965]. The recursive dependence of complexity measures, the Speed-Up Theorem (also a Speed-Up Theorem for total effective operators of the form f’(4) = r 04, where r is a fmed unary recursive function), and the Compression Theorem are due to M. BLUM. The algebraic study of BLUM spaces WM undertaken by ADRLANOPOL1 and DE LUCA [1974], and ADRIANOPOLI [1976]. The complexity classes were introduced by HARTMANIS and STEARNS [1965] and McCREIGHT and MEYER [1969]. The Gap Theorem waa derived independently by TRAKHTENBROT [1967] and BORODIN [1969]; the Operator Gap Theorem WM proved by CONSTABLE [1972]. The proofs of the last two theorems come from YOUNG [1973] (see alao, MACHTEY and YOUNG [1978]). The honesty property waa introduced by MEYER and RITCHIE [1968]. The Honesty Theorem appears in McCREIGHT and MEYER [1969]; it is one of the fvst examples of a result in computational complexity, whose proof is given by a “priority method”. The proof of the Honesty Theorem comes from MEYER and MOLL [1972]. The existence of non-r.e. complexity classes W M proved by LEWIS [1971], and LANDWBER and ROBERTSON [1972]; these papers include a detailed study of complexity clssses. BLUM’s Speed-Up Theorem proof is taken from YOUNG [1973] and MACHTEY and YOUNG [1978]. The Operator Speed-Up Theorem belongs to MEYER and FISCHER [1972]; another proof of this theorem can be found in YOUNG [1973]. An interesting survey on the speed-up phenomenon is VAN EMDE BOA3 [1975]. The proof of the Union Theorem (which belongs to McCREIGHT and MEYECR [1969]) was taken from BRAINERD and LANDWEBER [1974]. The material of Section 3.7 wad essentially taken from GILL and BLUM [1974]. The analysis of the complexity of recursive functions by EmR and FISCHhR means of complexity sequences was initiated by M [1972]; see also SCHNORR and STUMPE [1975]. A general result concerning the possibility of describing the complexity of recursive functions by a recursive sequence of honest functions wad explored in MEYER and W ” N [1979]; they have obtained a strong result from which we can derive the Compression Theorem and the Operator Speed-Up Throrem. Section 3.9 follows the MEHLHORN [1973].

paper

CALUDE

[1982a]; see

abo

294

Cdudc

The excellent survey paper of HARTMANIS and HOPCROFT [1971] contains many fundamental resulta in this field. The following b o o b contain chapters dedicated to BLUM’s axiomatic theory: ARBIB [1969], AZRA and JAULIN [1973], BRAINERD and LANDWEBER [1974], SCHNORR [1974], MACHTEY and YOUNG [1978],

CALUDE !1982b].

Useful bibliographies are included in BOOK [1969], IRLAND and FISCHER [1970], HARTMANIS and HOPCROFT [1971], USPENSKY and SEMENOV [1981].

9.11. EXERCISES AND PROBLEMS

Section 9.1 (11.1) (Open) (COOK (19831) Is any irrational algebraic number real-time computable in the sense of Definition (1.2)?

Section 9.2 (11.2) Defme a “memory-complexity” associated to the acceptable g6deliaation (w !‘I). (11.3) Use Theorem (2.11) to obtain Theorem (2.6.3).

Section a.8

9

be a BLUM space. Prove that for all recursive funcwe can effectively fmd an index j for g such that tions f ,g:N --* aj(z) > f ( z ) , for ull z E AT. (11.4) Let

Section a.4 (11.5) (BLUM; McCREIGHT and MEYER [1969]) Let ((di),(cD,)) and 4 = ((di),(6i)) be two BLUM spaces. We say that 4 iB a refinement of-+, if for all sufficiently large recursive functions t :nV --nV we can -fmd a recursive function r:HV -+ IN such that Cp =

C p = Cp. Show that for every BLUM space 9 , we can construct a BLUM 4, - such that neither 9- nor 4 - is a refmement of the other.

space

(11.6) Are the complexity c h s e s closed under intersection? But under union?

295

Chapter 3

(11.7) Show that every r.e. set of recursive functions is a complexity class in a suitable BLUM space.

(11.8) Show that for each recursive real e > 0 and every recursive function f :N--., N we can frnd a recursive predicate F : N + (0,l)such that for each index i for F,ai(z) 2 f (2) a.c. and

(kF(j))AZ+l) < I 4

for all z EN.

(11.9) (CONSTABLE [1972])Show that in the context of Theorem (4.10) there ia no recursive function t * : N-+ N such that if a,(.) 2 t o ( = )i.o., then ai(z)2 J’(t*)(=) i.0. Section S.6

(11.10)Give a direct proof of BLUM’s Speed-Up Theorem for recursive predicates. (11.11) (BLUM [1969])Prove that no recursive function has an effective sufficiently large speed-up (see the comment following Theorem (5.5)). (11.12) (SCHNORR [1973])There is no recursive function which has

a sufficiently large speed-up, such that both the index of the faster pro-

gram and the number of points where the speed-up fails to hold can be recursively bounded by the index of the slower program.

(11.13)(MEYER and FISCHER [1972])Let

E:PR+PR

,

be a total effective operator. Prove the existence of two recursive func{0,1}, b:N + N such that if +i= f , then there exists a tions f :RV j 5 b ( i ) such that = f and f‘(Qj)(z) < Qi(z) a.c. -+

(11.14) (HELM and YOUNG [1971])Prove that the statement in Exercise (11.13) fails to hold for all recursive functions with speed-up. Section S.6

(11.15) (McCREIGHT and MEYER [1969])For each recursive function t :N-+ N ,put 1, = {iE N 146 is total and Qi(z) 2 t ( z ) a.c.}. Does the Union Theorem remain true when replacing “Ctl’ by “It”? (11.16) Let t :N+ N be a recursive function such that Ct is precisely the set of all primitive recursive functions with respect to the BLUM space ((ui),(fli)). Show that t grows more slowly than the A C K E R W N - P E T E R diagonal function A, though both functions majorise almost everywhere each primitive recursive function.

296

Cdude

Seetion 8.7

A systematic interchange of “a.e.” and “i.0.” in Definition (7.1) leads to the notions of u.e. h-cornputable and i.0. h-hard functions. (11.17) (LANDWEBER and ROBERTSON [1972]) Prove the existence of a r.e. set of i.0. h-hard p.r. functions, which includes every i.0. h-hard recursive function; here h is an arbitrary recursive function. (11.18) (ROBERTSON11971)) Prove that for every sufficiently large recursive function h :N+ RV, the claes of a.e. h-computable p.r. functions is r.e.

Section a.8 (11.19) (MEYER and FISCHER [1972])Prove the existence of a recursive function h :@ * RV, such that for each recursive 4e, if a) pi(z)= + t ( J ( i , z ) ) for , all i and z,and b) for all i, there in an u, such that pi(z) 2 li(z,max(@I(J(j,n))Iu < j 5 n 5 2 ) ) a.e., then (pi) ia a complexity sequence for a recursive predicate f :N+ {O,l}, and if di = f , then +i(z)

> pi(z)

4.e.

Sectlon 8.9 (11.20) (ZIMAND [1983b](Added in proof. I have learned through Professor G. ASSER that the same results have been reached by G. SCHAFER (A note on conjectures of Calude about the topological sise of sets of partial recursive functions, 2. Math. Logik Grundlag. Math. 91 (1985), 279-280).) Show that the set of all recursive predicates is recursively meagre. Extend the result to recursive functions with fmite range. (11.21) (ZIMAND [1983b])Show that the set of non-total p.r. functions is recursively meagre, i.e. the set of all recursive functions is a “recursive residual”. (11.22) (Open) Is the set of speedable recursive functions recursively meagre? (11.23) (Open) Give a topological version of the Compression Theorem.