THEORIES OF COMPUTATIONAL COMPLEXITY
ANNALS OF DISCRETE MATHEMATICS
General Editor: Peter L. HAMMER Rutgers University,New Brunswick, NJ, U.S.A.
Advisory Editors: C. BERGE, Universitede Paris, France M. A. HARRISON, University of California, Berkeley, CA, U.S.A. V. KLEE, University of Washington,Seattle, WA, U.S.A. J.H. VAN LINT CaliforniaInstitute of Technology,Pasadena, CA, U.S.A. G.C. ROTA, MassachusettsInstitute of Technology,Cambridge, MA, U.S.A.
NORTHHOLLAND AMSTERDAM
NEW YORK
0
OXFORD 0 TOKYO
35
THEORIES OF COMPUTATIONAL COMPLEXITY
Cristian CALUDE Department of Mathematics University of Bucharest Bucharest, Rumania
1988
Elsevier Science Publishers B.V., 1988
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owner.
ISBN: 0 444 70356 X
Publishers:
ELSEVIER SCIENCE PUBLISHERS B.V. P.O. BOX 1991 1000 BZ AMSTERDAM THE NETHERLANDS
Sole distributors for the U.S.A.and Canada:
ELSEVIER SCIENCE PUBLISHING COMPANY, INC. 52 VAN DER BILT AV EN U E NEW YORK, N.Y. 10017 U.S.A.
LIBRARY OF CONGRESS L i b r a r y of C o n g r e s s C a t a l o g i n g  i n  P u b l i c a t i o n
Data
C a l u d e , C r i s t i a n . 1952Theories o f computational complexity / Cristian Calude. p. cm.  ( A n n a l s o f d i s c r e t e m a t h e m a t i c s ; 35) B1b:iography. p . I n c l u d e s indexes. 199; 044470356X 1. C o m p u t a t i o n a l c o m p l e x i t y . I. T i t l e . 11. S e r f e s . QA267. C34 1988 511dC19
PRINTED IN THE NETHERLANDS
8730864
CIP
TO ELENA AND ANDREEA
This Page Intentionally Left Blank
PREFACE
During the 1890’s, when PEANO’s five axioms were set afloat, a great effort was done to establish what functions are or are not what we call today algorithmically computable functions. DEDEKIND and PEANO have been the fvst to use functions defined by induction, an important preliminary stage of the recursive function theory. The foundational problems arising from CANTOR’S development of the set theory have led to an increasing interest in the two millenia old intuitive notion of algorithm. Some forms close to the modern use of algorithms can be found in the works written in the fvst quarter of the 20th century by BOREL and WEYL. Around 1930’s, GODEL, CHURCH, KLEENE and TURING have provided different, but equivalent, formalisms for characterizing the numbertheoretic functions computable by algorithms, i.e. the algorithmically computable (effectively calculable) functions. The deep understanding of algorithmic computability as well as the spectacular growth of computer technology gave rise to a new, large and active field which basically refers to the question “how difficult to compute is a given algorithmically computable function”; this question was fvst explicitly posed by RABIN in 19591960. The computational complexity studies fall into a variety of directions, some of which are now available in monographs (AHO, HOPCROFT and ULLMAN 119741, for the complexity of specific functions, BORODIN and MUNRO [1975], for algebraic complexity, GAREY and JOHNSON [1978], for NPcomplete problems), or in sections of some books on computation theory (see, for example, BRAINERD and LANDWEBER [1974], or MACHTEY and YOUNG [19781). A thorough going look into the field is provided by the overviews of HARTMANIS and HOPCROFT [1971], W I N [1977] and COOK [1983]. Our attempt ia not to give a comprehensive description of the field, but rather to present, in a rigorous and unitary form, four machineindependent theories of computational complexity, whose selection is motivated by their intrinsic importance and practical relevance. One of them (i.e. the KOLMOGOROV and MARTINLOF theory) wan never synthesised in a separate monograph or as chapter of one. The others are presented sometimes, but in a very telegraphic form. The book includes a wealth of results, classical, new and others which have not been published before. In developing the mathematics underlying the sise, dynamic and structural complexity measures, various connexions with mathematical
Viii
Caludc
logic, constructive topology, probability and programming theories are established. The book ie organiced in five chapters. The rust chapter is devoted to a complexitytheoretic analysis of the class of primitive recursive func
tions, along the way initiated by GRZEGORCZYK. We are dealing with hierarchies of primitive recursive functions built, on the rate of growth, by algebraic methods. Chapter 2 is a selfcontained and complexityoriented presentation of the basic recursive function theory. Chapter 3 presents the BLUM abstract theory of computational complexity. It contains a detailed algebraic and topological study of dynamic complexity measures. Chapter 4 is dealing with the KOLMOGOROV and MARTINLOF theory of complexity. This theory, referring to the complexity of “algorithmic descriptions”, is developed within a nonbinary framework. It allows a satisfactory definition of “random strings”, which turns out to have many interesting applications. The last chapter goes into the direction initiated, among others, by MEYER and RITCHIE; it contains an analysis of some subrecursive hierarchies built on the restricted use of a few natural programming schemes. In this more intuitive chapter we make use of all type of complexity measures, previously discussed. Prior to 1930 mathematicians were able to prove the algorithmic computability of some particular functions; but, the lack of a general representation of algorithmic computability made impossible the detection of noncomputable functions. The mid 60’s marked a similar situation as concerns the diffkultp of computations. Hence, most of results are negative. But, as MACHTEY and YOUNG said a t the beginning of Chapter 5 of their book, “these results point the way to, and underscore the necessity for, developing approaches to programming which overcome these limitations”. We have tried to present facts in detail. Extensive examples are included, to motivate and clarify notions and constructions. The lists of exercises and problems contain routine exercises, further interesting results, as well as some open problems. The book is primarily written for mathematicians and computer scientists; it may be of interest, t o logicians and philosophers.
I express my profound gratitude t o Professor S. MARCUS whose stimulating idem and encouragements have influenced much my scientific activity. I warmly thank Professor S. RUDEANU, without whose support and encouragement the present book could not have appeared. I am very grateful t o Professor P.L. HAMMER for advising the book
Preface
ix
and for much help and a variety of suggestions. The book has benefitted from my discussions, over the years, with D. VAIDA, V.E. CAZANESCU, S. ISTRAIL, and Gh. PAUN; I thank all of them. I am particularly indebted to I. CHITESCU for fruitful discussions in the field; Chapter 4 mainly follows from our joint results. I owe a special debt to S. BUZETEANU and M. ZIMAND for their careful reading of most parts of the original versions of the manuscript. It is a pleasant duty to me to acknowledge that my professional activity was strongly influenced by the excellent books written by H. ROGERS, and M.MACHTEY and P. YOUNG. I am also indebted to F. ADRIANOPOLI, G. ASSER, M. BLUM, R.V. BOOK, R. FRETVALDS, N. GEORGIEVA, J. GILL, G. GOETZE, J. HARTMANIS, H. JURGENSEN, H.P. KATSEFF, L. LOFGREN, P. MARTINLOF, K. MEHLHORN, A.R. MEYER, C.P. SCHNORR, L. STAIGER, H.R. STRONG, R. VERBEEK, E.G. WAGNER, K. WEIHRAUCH and P. YOUNG for their kindness in sending me copies of their own work and others’. Many thanks are due to the staff of NorthHolland, especially to A. SEVENSTER and J. BUTTERFIELD, for efficient support. Many thanks are also due to Mies D. RUSU and B. LAW for special assistance in preparing the manuscript. No words could ever express my gratitude to my family. Cristian Calude
This Page Intentionally Left Blank
TABLE OF CONTENTS
PREFACE INTRODUCTION
Yii
1
CHAPTER 1 1. 1.1. 1.2. 1.3. 1.4. 1.5. 1.6. 1.7. 1.8. 1.9. 1.10.
Primitive Recursive Hierarchies Examples ACKERMANNPETER’S Hierarchy Primitive Recursive Functions Primitive Recursive Invariants Primitive Recursive Enumerations SUDAN’S Hierarchy Universal Sequences of Primitive Recursive Functions Primitive Recursive Stringfunctions History Exercises and Problem
3 3 7 22 26 32 45 62 71 77 79
CHAPTER 2 2. 2.1. 2.2. 2.3. 2.4. 2.5. 2.6. 2.7. 2.8. 2.9. 2.10. 2.11.
Recursive Functions Examples Arithmetiration of Computation: An Example Equational Characterbation of Partial Recursive Functions GODEL Numbering8 Recursively Enumerable Sets Undecidability and Independence Uniformity Operators Recursive Real Numbers History Exercises and Problems
CHAPTER BLUM’s Complexity Theory
3. 3.1. 3.2. 3.3. 3.4.
Examples BLUM Spaces Recursive Dependence of Complexity Measures Complexity Classes 3.5. The Speedup Phenomenon
87 87 92 99 129 144 159 171 178 195 201 203
207 207 211 218 226 249
Calude
xii 3.6. 3.7. 3.8. 3.9. 3.10. 3.11.
The Union Theorem Hard Recursive Functions Complexity Sequences A Topological Analysis History Exercises and Problems
CHAPTER 4 KOLMOGOROV and MARTINLOF’s Complexity Theory 4. 4.1. Examples 4.2. KOLMOGOROV’s Complexity 4.3. MARTINLOF Tests 4.4. Undecidability Theorems 4.5. Representability Theorems 4.6. Recursive MARTINLOF Tests 4.7. Infinite Oscillations 4.8. Probabilistic Algorithm 4.9. History 4.10. Exercises and Problems
263 268 273 278 292 294
297 297 303 313 330 340 352 361 388 376 377
CHAPTER 6. 5. 5.1. 5.2. 5.3. 5.4. 5.5. 5.8. 5.7. 5.8. 5.9. 5.10.
Subrecursive Programming Hierarchies Examples The LOOP Language LOOP Hierarchies A Universal Language A Dynamic Characterisation of LOOP Classes Augmented LOOP Languages Simple Functions Program Sire History Exercises and Problems
383 383 384 391 402 407 416 427 440 446 447
BIBLIOGRAPHY
453
INDEX OF NOTATIONS
469
SUBJECT INDEX
475
AUTHOR INDEX
481
1
INTRODUCTION
This book is essentially selfcontained. The literature on complexity questions has a fascinating growth in the last years and therefore lacks a common terminology and notation. We outline here our choice.
JV
The set of natural numbers will be denoted by RV, i.e. = {0,1,2, ...};Z is the set of integers and R is the set of real numbers.
The settheoretical formalism is the following. The equality of sets is denoted by the sign "=": A = B means that A and B have the same elements. By A # B we understand that A and B are not equal. By z E A we indicate that z is an element of A; its negation is written z 4A. The notation {...I...} designates set formation. By A c B we understand that A is a subset of B. The set A is proper eubeet of B if A C B and A # B; sometimes we write A % B. The union of sets A and B is indicated by A u B; the intereection is written by A n B;A  B is the difference; A x B is the earteeian product. A set A c B is cofinite with respect to B if B  A ia fmite. The Cartesian product of A with itself i times (iE IV  (0)) is denoted by A'. A subset R C A x B is called a relation from A to B. A subset R c A' is called an i  a r i relation on A. If A and B are nonempty sets, then by f :A + B we designate an arbitrary function from A to B. Every function d : A ' + B (where A' c A) is called a partial function from A to B; we write 4 : A 8. We consider that 4(z)= 00 in case z € A  A' and we say that 4 is not de fined at z. In the opposite case, i.e. 4 (2) # 00, we say that 4 is defined at z. In the particular case A = A' we simply write 4 : A 4 B and we say AIV will be called numberthat 4 ie total. A partial function 4:" theoretic partial function.
Let d:A S , B be a partial function. Then dom (4) =
[email protected]) = {z EA l4(z) f 4, range (4) = 0 can be obtained, via the previously known function h , from its value at ( a l t...,a,,zl), and so inductively from its values at ( a ,,...,a , , z  2 ) , ( a ,,...,a,,z3) ,...,(ol ,...,4,,O); the last value comes by (1.1) from the previously known value of the function g . / ( a l,...,%,z+ 1) =
( a 1t...,a,,,z
For example, in case of the sum function f ( a , z ) = a + z, we have a , = a , and the previously known functions are g (4) = a , h ( a , z , y ) = y + 1. n = 1,
Some further particularizations of the scheme of primitive recursion will be considered. In case n > 0, we have a p u r e p r i m i t i v e r e c u r e i o n when the equation (1.2) ie replaced by
Chapter 1
f ( a 1 , * . . ~,z n+ I ) =
where hl:RV"+'
+
3
hl(al,*..,an,f (a1,**yan ,z))
y
(1.3)
IN.
If the equation (1.2) is replaced by f ( ~ 1 , .  , a n , z + l )= h d z , f ( a I ,   * , a n , z ) ) 9
(1.3')
we say that we have a definition by iteration. Furthermore, if the function h in the righthand member of (1.2) does not depend on u l ,...,a,, and 2 , i.e. it can be written as
f (a 1,van ,z+ 1) = h 3( f ( alvyan ,z1) for some function h 3 : N tion.

7
(1.4)
N , then we have a definition by pure iteru
In the case with no parameters (i.e. n = 0) there is only one particularization, since there is no distinction between primitive recursion and iteration. We have a definition of f by pure primitive recursion (or pure iteration) if
f(0) = a f(z+l)=
for
some
fmed
natural number
H(f(4) a
(1.5)
f
7
and numbertheoretic
(1.6)
function
H : N + N . Since the working mathematician is acquainted with various contexts where defiditions by induction are commonly used, three examples will be enough. (1.1) Example. L. COLLATZ (see GUY [1981]) wondered the sequence of natural numbers ao,al,...,a, ,... defined by pure iteration ao=a
a,/?, an+1
, if an is even,
= {3u,,+l, if a, is odd,
has the property that for every natural a , there is an index n such that a, = 1. This has been tested for all naturals a less than 7.10" (see GUY [198l], p. 120), but no one has proved or disproved COLLATZ's statement.
a (1.2) Example. PARIS and HARRINGTON 119773 have proved that a certain variant of RAMSEY's Theorem cannot be proved in fvst order PEANO arithmetic although it is in fact a true statement. KETONEN and SOLOVAY [1981] have discovered the reason of this
6
Caludc
unprovability result by establishing some bounds for the RAMSEYPARISHARRINGTON numbers associated to the involved variant of RAMSEY’s Theorem. For every finite set X and every natural p , [XIpdenotes the set of all pelement subsets of X. RAMSEY’s Theorem asserts that for all natural numbers k , m , p , there exists a natural n such that for every set X with a t least n elements the following statement holds: For every partition of the set iX]P into k classes, there exists an mclement subset I’ X , all of whose pelement subsets belong to one of the classes of the f’ed partition. The validity of RAMSEY’s Theorem (for a fmed choice of the naturals k , m , p ) is denoted by n
and this
is
(rn)l
7
a statement provable in PEANO arithmetic.
The PARISHARRINGTON Theorem asserts that for all naturals k . m , p , there exists a natural n, such that for every partition of the set ,Y’p into k classes, there exists an rnelement, relatively large subset k’C X,all of whose pelement subsets belong to one of the classes of the fured partition. Here we say that a finite set Y is relatively large if card Y is greater than the minimum element of Y. The P A R I S  W R I N G T O N statement is denoted by 7%
dm)P
*
Finally denote by Rl(rn) the smallest n with n +(m)P. vability of the statement
The unpro
Y mV ptt k 3 n (n ;*(m)P)
in PEANO arithmetic relies on the fact that R[(m) grows too faster for PEANO arithmetic. For example, ERDOS and MILLS [1981]have proved that R i ( m ) grows faster than any “primitive recursive function”; see in this respect the Remarks following Theorem (2.35). Nevertheless, for a futed p , the statement V mY k 3 n ( n ~ ( m ) l )
is provable in PEANO arithmetic. This means that the separate proofs for each instance cannot be “aggregated” into an one single proof! 0
(1.3) Example. Man has always been fascinated by huge numbers. In antiquity, ARCHIMEDES has invented a method to describe a number which exceeds the number of sand grains needed to fd the universe.
Chapter 1
,o18.00’
ARCHIMEDES’ number is about 10
7
(SMORYNSKI [1983]).
KNUTH j1976) has introduced a felicitous notation for describing huge numbers. KNUTH starts with the following expressions:
B(B(...(B )...))
=
B tT ,
t ( B t (.t(B)...)) = B tt T , tt ( B tt (...tt(B)...)) = B ttt T
B
?
a.s.0. In the lefthand side of every equation above there are exactly T copies of B (here T and B are nonnull naturals). We interpret B 1 T as BT, B tt T as B B . . ~( B appears T times), a.s.0. Using KNUTH’s notation we can write ARCHIMEDES’ number as
(( 1OO,OOO,OOO)tt2) 1(100,000,000);see BLAKLEY and BOROSH [1979]. The expressions above can be written systematically as:
B 1 T = Bt’T
= k(B,l,T)
BttT = Bt2T= k(B,2,T)
Bt“T= k(B,fl,T)
, ,
,
thus arriving at the following “recursion defmition”:
BT ,T 2 1 , k(B,n,I)= B ,n 2 1 ,
k ( B , l , T )=
k(B,n+I,T+l) = k(B,n,k(B,n+l,T)) . The definition above, called “nested recursion”, differs from the primitive recursion and, as we shall later see, there is a sense in which the former is not reducible to the latter. 0
1.2. ACKERMANNPETER’S HIERARCHY
T o tackle the question “what oneargument numbertheoretic functions are definable by induction?” we introduce the class of oneargument primitive recursive functions. Then we construct a hierarchy of oneargument primitive recursive functions by means of the ACKERMANNPETER function.
8
Caludc
In Example (1.1), COLLATZ’s sequence corresponds to an oneargument function which is defmed by pure iteration. The following examples suggest the interest of the class of oneargument functions defmed by induction.
(2.1)Example. The geometric progression u0,u
where uo = a, un+,
= q
*
u,,
,,...,u, ,...
is a sequence defined by pure iteration.
(2.2) Example. The arithmetic progression u0,u
where uo = u , u , + ~= u,
,,...,u, ,...
+ d , is also a sequence
defmed by pure iteration. 0
(2.8) Example. The FIBONACCI sequence u0,u
,,...,u, ,...
given by uo = u 1 = 1, u , + ~= u,+, + u,, is defined by means of a sort of “recursion” which, at fwst sight, looks more complicated than iteration. Indeed, the value at point ( n + 2 ) depends upon two preceding values, i.e. the values at points ( n + l ) and n . 0
(2.4) Example. All previous examples can be obtained as particular cases of the secalled “recursion sequences of order k”, which play an important part in the calculus of finite d i ffetences. A recursion sequence u0,u
* ,...,u, ,...
is characterized by a natural number k 2 1 and the (real or imaginary) numbers izl,...&, such that uo = al,...,ukl = u k , and for every n 2 0, ‘Ln+h = 0 1 ’ ~ , r k  1 T ~ 2 ’ ~ n + k  2 + . . . + ~ ~
(In
*
The reader can easily check that the geometric progression is a recursion sequence of thefiret order (i.e. k = I), while the arithmetic progression and FIBONACCI’S sequence are recursion sequences of the second order. 0
Chapter 1
9
(2.6) Example. A more sophisticated defmition by induction occurs in the uniform presentation of the solutions to PELL’s equation (see in this
respect MORDELL [1969), DAVIS [19731). The diophantine equation
1
2 0,
z 2  d y 2 = 1,
z,y
d=a21,
a>l,
called PELL’s equation, has the obvious solutions: 2 0 = 1 ,
yo=o
.
(2.1)
Furthermore, every solution (z,y) to PELL’s equation is of the form (zn , I n 1, where z,
+ynvz= (atfly
.
The last equality enables us to write the following defmition: zm+1
= azm
ymcl = z,
+
dym,
+
any,,,.
Formulas (2.1) and (2.2) define simultaneously two sequences of natural numbers in a “recursive” form which differs from all the above definitions. 0
We shall see later that all previous defmitions can be reduced to iteration under suitable conditions. To this end we give the formal defmition of the class of oneargument primitive recursive functions. AU functions will be numbertheoretic, i.e. functions whose domain is the set of natural numbers and whose values are natural numbers as well. Our defmition will be inductive in that we start with a set of base functions and then specify what operations are allowed in defming further functions. The set of base functions consists of two functions: the euccessor function, S u c c : N + N , Succ (2) = z+1, and the ezceesoverasquare function, E:lN + N , E ( z ) = z P[z1/’I2; here z e y = max(zy,O) is the arithmetical difference and [z‘/’] is the largest natural number y , such that y2 5 2 . (2.6) Definition. The class of oneargument primitive recursive functions is the smallest class of oneargument numbertheoretic functions
which contains the functions Succ and E, and which is closed under sum, product, composition and pure iteration. In more detailed way, a) the functions Succ and E are declared primitive recursive, b) for all primitive recursive functions
Calude
10
g , h : N + UV the functions
f i : N+ N , ;=1,2,3 defined by sum, product and composition from g and h , respectively (i.e. f1(z) = 9 ( 2 ) + h ( z ) , f & ) = !?(z) h ( z ) , f d z ) = !?(h(z)), for all z in N )are also primitive recursive, c ) for every a in N and every primitive recursive function

g:N

N
the function
f:N+UV defined by pure iteration from a and g (i.e. the function which satisfies the equations f(0) = a , f(z+L) = g(f (z))) is also primitive recursive, d ) no oneargument functions other than those that can be defined by means of a finite number of applications of the rules a), b) and c ) are primitive recursive.

(2.7) Example. The function f : N UV given by f ( z ) = z + 4, for all E, is primitive recursive since it can be written as f ( z ) = Succ (Succ (Succ (Succ (2)))).

The function C o : N N defined by Co(z)= 0, for all is primitive recursive. Indeed, Co follows from 0 and E by pure iteration: Co(0)= 0 , Co(z+I)= E ( C o ( z ) ) .
(2.8) Example. E ,
3
The identity function P:N + N ,P ( z ) = 2, for all z , is primitive recursive. Again a definition by pure iteration yields: P(0) = 0 , P ( z + l ) = Succ (P(2)).
i2.9) Example.

i l
The constant function C , : N N , C,(z) = a, for all a = 0 was presented in Example (2.8). Let 4 f 0, and consider the function f :UV 4 UV defined by pure iteration: f ( 0 ) = a , f ( z + I ) = Succ ( f (2)). Finally write C,(z) = f (Co(z)). (2.10) Example. E ,
is primitive recursive. The case
1
The reader can easily verify that the following oneargument numbertheoretic functions are also primitive recursive:
11
Chapter 1
Sq(2)
=0
q(z) = 1 2
if 2
= 0,
89(2)
= 1,
if Z
> 0;
&8g(2);
+ a;
z a; a’;
a o z (here a is a natural fmed parameter).
It is worth noticing that the inductive definition of oneargument primitive recursive functions provides a useful method to construct algorithmically computable functions. Indeed, it is easily seen that the base functions are algorithmically computable and the composition rules preserve this property. Furthermore, every oneargument primitive recursive function is everywhere defined on the set of natural numbers. Keeping in mind the former fact let us pass to a fvst “complexitytheoretic” problem, namely to measure how complicate it is to perform the computation necessary to get the value of an arbitrary oneargument primitive recursive function for a given input. We measure the complexity of these functions by means of their asymptotic growth, using operations which are “bounded” in some manner and a fured devastating increasing function. To this aim we use the ACKERMANNPETER binary function, which is the numbertheoretic function A : N 2+ N defined by means of the following three equations
A ( 0 , z )= z
+1 ,
A(n+l,O) = A ( n , l )
(2.3)
,
A ( n + l , z + l ) = A(n,A(n+l,z))
(2.4)
(2.5)
The following technical results concern the monotonicity properties of the function A.
(2.11) Lemma. For all naturals n, z we have: A ( n , z ) > z. Proof. We proceed by induction on n. For n = 0 we have: A(0,z) = z + 1 > z. We assume that A ( n , z ) > 2, and we prove the inequality A ( n + l , z ) > z, by induction on z. For z = 0, A(n+l,O) = A ( n , l ) > 1 > 0. Suppose now that A ( n + l , z ) > z. We use (2.5) and the fvst induction hypothesis to get A ( n + l , z + l ) = A(n,A(n+l,z)) > A ( n + l , z ) . Finally, by the second A ( n + l , z ) 2 z + 1, we obtain induction hypothesis, A ( n + l , z + l ) > z + 1. 0
12
Caludc
(2.12) Lemma. For all naturals n, z we have: A(n,z) < A(n,z+l).
A ( n t 1 , z ) . 3
(2.19) Lemma. For all naturals n, z we have: A(n,z)
< A(n+l,z).
Proof. We proceed by double induction on n and z. For n = 0 , A(0,z) = z + 1 < 2 + 2 = A(1,z). Suppose that A(n,z) < A ( n + l , z ) . Then, A(n+l,O) = A ( n , l ) < A ( n + l , l ) = A(n+2,0). In view of a new induction hypothesis, A ( n + 1,z) < A(n+2,2), we deduce the relations: A(n+2,2+1) = A(n+l,.A(n+2,2)) > A ( n + l , A ( a + l , z ) ) > .4(nA(n+l,z)) = A ( n + l , z + l ) ; we have used equation (2.5), both induction hypotheses and Lemma (2.12).
(2.14) Lemma. For all 2 . A ( n , z ) < A(n,A(n,z)).
naturals
n,
2,
if
n
2 2,
then

we have: 2 A(2,z) = 2(2.2+3) < 2(2*z+3)+3 A(n,z) < A(n,A(n,z)), then by Lemmas (2.11) and (2.13) we have: 2 * A(n+l,O) = 2 A(n,l) < A(n,A(n,l)) = A(n,A(n+l,O)) < A(n+l,A(n+l,O)), and 2 A(n+l,z+l) = 2 . A(n,A(n+l,z)) < A(n,A(n,A(n+l,z))) = A(n,A(n+l,z+l)) < A ( PI 1,A (n+ 1,Z + 1)).
Proof.
For
n
=
= A(ZA(2,z)). If 2
2


+
3
For all naturals n 2 1 and k, there exists a natural i (which depends upon k), such that A ( n , z + k ) < A ( n + l , z % ) , for all (2.16) Lemma. z
:
1.
Proof. It is seen that t + k < A(2,zIkel) 5 A ( n + l , z  L l ) , for all 3k4. Consequently, A ( n , z + k ) < A ( n , A A ( n + l , z n k L l ) )=
t

A (n 1,t a).
a
(2.16) Lemma. For all naturals n, k we have: A ( n t 1 , z ) = A(n,A(n, ...y4(n,1)...)), where the symbol A appears ( z + 1 ) times.
13
Chapter 1
Proof. For z = 0, A(n+l,O) = A(n,l) is just (2.4). If A ( n + l , z ) = A(n,A(n ,...,A(n,l )...)) [(z+l)times ]
,
then
A(n,A(n,...,A( n,1)...)) [(z+2) times ] = A ( n, A ( n+ l, z ) ) =
A(t~+l,z+lf
. 3
The monotonicity properties of the A C K E R W N  P E T E R function will be freely used in what follows. We are going to define an increasing sequence (G,),Lo of functions classes whose union equals the class of oneargument primitive recursive functions. For all naturals n, z , put A,,(z) = A(n,z). Thus A,, becomes an oneargument function.
(2.17) Definition. We say that the function
f:N+N is defined by limited pure iteration at zero (shortly, limited iteration) from the functions g : N + N ,
h : N +N
if it satisfies the following three conditions:
f(O)=O
,
(2.6)
f ( z + l )= g ( f ( z ) )
f ( z ) lw
!
7
(2.7) (2.8)
for all naturals z.
(2.18) Definition. (GEORGIEVA [1976a]) For every natural n define G , as the smallest class of oneargument numbertheoretic functions which contains the functions A, and A,,, and which is closed under arithmetical difference, composition and limited iteration. (2.19) Lemma. Each class G,, n and 89, for arbitrary natural a .
2 0 , contains
the functions C,,P,sg
14
Caludc
Proof.
Firstly,
we
notice
C,(z)
that
=
A,(%)"Aa(z),
and
C,(z) = Ao(Ao(...(Aa(Co(z))) ...)), (the symbol A, appears a 2 1 times) are in G,. Secondly, P ( z ) = A,(z) "Cl(z), G(z)= C,(z) "P(z), and sg(z) = C,(z) "ss(z), are also in C , . 0
(2.20) Proposition. For all naturals n, G ,
c G,,,.
Proof. We shall prove that for all naturals n and k we have A,, E Gn+b. Clearly, by defmition, A, E G,, for every rn 2 0. Assume that ,4,, E GncL. We shall show that A,,+l can be defmed by means of composition and limited iteration within the class G,+C+l. Indeed, it is seen that 4 + l ( . ) = /(z+l), where f(0)= 0, f ( z + l ) = A,(g(f(z))), dz)= ( z + l ) ".4z), and f ( z ) 5 A,+l(.) .L A , + k + l ( Z ) . 3
For every function f :N f i + ' ( z ) =; i ( f ' ( z ) ) ,for all z and i.
+
N,
we
put
fo(z)= z, and
(2.21) Lemms. For every natural n and for every function f in G,, there exists a natural k (which depends upon f ) such that f ( z ) < g ( z ) ,
for all z.
Proof. We employ the inductive definition of G,. For f ( z ) = A o ( z )< A,(A,(z)) 5 A,(A,,(z)), the inequality holds for k = 2. If f ( z ) = &(z), then k = 2 works too. If f(z)< #(z), and g(z) < x ( z ) , then f ( x ) " g f t ) 5 f ( z ) < A,p(z), f ( g ( z ) ) < x + q ( z ) . Finally, if f is obtained by limited iteration from the functions g and h (see (2.6)(2.8)) and h ( z ) f ( z ) + g(z) is the function supplied by Corollary (2.22). Hence, if f and g are in G,,ta 2 2, then their sum lies also in C , .
x(z)
0
(2.24) Lemma. If g is in G,, n from 0 and g, then f lies in G,+l.
2 2, and f is obtained by pure iteration
f ( 0 )= 0 and f ( z + l ) = g ( f ( z ) ) , then f ( z )= g'(0) 5 some k 2 2. Since A,,+,(kz) is in G,,+,, it follows that f can be defined by limited iteration within Gn+l, i.e., f E G,+l. We have used Lemmas (2.21) and (2.16).
Proof.
@(O)
If
< &+l(kz), for
0
A function f :PI (0,l) is called a predicate since it can be viewed the characteristic function of the property defining the set E lv I f ( 2 ) = 1). +
a8 (2
(2.26) Proposition. The family of predicates in every class
G,,a _> 2, is
a Boolean algebra.
Proof. Immediate, in view of the fact that the predicates ag(f(z)+g(z)), (f(z)+g(z)) e l , and G ( f ( z ) )are , in G, whenever f and g are predi
cates in G,.
0
(2.26) Theorem. (GEORGEVA [1976a!) For every class G,, n 2 1, and every f in G,, there exists a natural i (depending upon f ) such that f ( z )< A,,+l(z), for every z 2 i.
Proof. Assume that f is a function in C,, n 2 1. In view of Lemma (2.21) we find a natural k 2 2 (depending upon f ) such that for every z the inequality f(z)< &(z) holds. We shall prove that the constant i = 3k works. From the monotonicity properties of ACKERMANNPETER'S function m e derives the inequalities: &)
5 &'(An(z+(kw) < &  ' ( ~ , , + ~ ( z P ( k q ) ) for ) , all z 2 i
Intermediate etep: For all naturals n
2
1, k
.
2 2, we have:
(2.9)
16
Calude
(2.10)
We proceed by induction using extensively the equation (2.5) and For z = k, 4  ' ( A , + l ( k q k 4 ) ) ) = &'(A,+1(1)) Lemma (2.16). = &'(4*(1)) = A,,+l(k). If the equality (2.10) holds, then
+ 1) q k  1))) = 4YA,(A,+1bq
&'(4+I(b
=
k "1))))
&(&lPn+l(=+w))
= A,(A,+l(Z)) = 4,+1(Z+l)
From f ( z )
0 and 1 5 i 5 n A .
...,
(8.1) Definition. The clase of primitive recureiue functions is the smallest class of functionsf :W+ N ,n 2 l, which contains the functions Succ, Ct),and @", and which is closed under the operations of primitive recursion and functional composition. First of all we shall prove the coherence of Defmition (3.1) with respect to Definition (2.6), i.e. we shall show that the functions z + y , z 1 and E ( z ) = 24z1/'I2 are primitive recursive (since the iteration and composition are particular c w s of primitive recursion and functional composition, respectively). To t h b aim we display a sequence of primitive recursive functions whose climax b example (3.7).

(8.2) Example. The eum function z + y , the product function z y , and
the ezponentiation function zy are all defined by primitive recursion: 2 2
+ 0 = P{l)(Z) ,
+ (ar+l)= h ( w , z + y )
7
where h(z,y,z) = Succ (ps")(z,y,z)), 2 2 '
0=
cp(2) ,
( Y + l ) = g(z,Y,z.Y)
Y
where g(z,y,z) = p i 3 ) ( z , y , z ) + ~ ) ( 2 , y , z and ), 2 O
Z#+'
,
= C"'(2) = t (z, Y , 4
1
where t ( z , y , z ) = p i 3 ) ( z , y , z )* Pi3)(2,y,z).
Remark. The reader may notice the convention 0' = 1 used in the defmition of the exponentation. (8.8) Example. The predecessor function Pd
(2)
=
z e l , can also be
defmed by primitive recursion: P d (0) = 0
,
The upper indices which denote the number of variable, rill be omitted when no confusion ia posiible.
Calude
24
(8.4) Example. The arithmetical difference z o y ia primitive recursive since it c a n be defined by primitive recursion from fll)and Pd: 2
0 0 = P\')(2)
z L ( y + l ) = Pd
,
( 2 9 )
. 0
(8.6) Example. The sign functions sg and view of the following relations: 64(0) = 0
STare primitive recursive
in
9
and
C
(3.6) Example. The absolute difference function 12y 1 is primitive recursive since it can be defmed by functional composition using the sum and the arithmetical difference: 12y I = ( 2 % ) + (y). 0
(8.7) Example. The e z c e s ~  o u e r  a  s q ~ a rfunction e E ( z ) is primitive recursive. First we write the equations sqrt ( 0 ) = 0
,
sqrt (zcl)= sqrt
(2)
+ G([ ( ~ u c e(sqrt (z)))'Succ
(2)
1) ,
which define the function sqrt ( 2 ) = [zl/*!, and then E follows by functional composition: ~ ( z=) z L ( r q r t ( z ) ) * . ;3
Remark. From Theorem (2.34) and Example (3.7) we deduce that all functions lying in the classes G, are primitive recursive. To the list above three new functions could be added, that wid be useful later on.
25
Chapter 1
(8.8) Example. The comparisons functions
1
1, i f z < y , le(' d ) = 0, otherwise, 1,
if2 > y ,
and
h ( z , y ) = 8g(Y%), gr(z,Y) = Sg(Z+), It is seen that eq(z,y) = 67( Izy I), thus proving their primitive recursiveness.
and
n Remarks.
a) Conjugate applications of projection functions and functional composition allow to prove that in case f :W* N is primitive recursive, then so are the functions obtained from f by: (i) arbitrarily permuting the arguments, (ii) adding arbitrary "dummy" arguments (for example, g(zl, ...,z,,,y,z) = f(z,,...,z,,)),(fi) identifying the elements of every subset of the arguments (for example, f(z,...,2 ) ) . b) Each primitive recursive function is defined everywhere on some set W ,n 2 1. c) Every primitive recursive function is algorithmically computable, but not all algorithmically computable functions are primitive recursive. Consider, for example, ACKERMANNPETER'S binary function.
(3.9) Definition. A set A c W , n 2 1, is called primitive recursive provided its characteristic function with respect to N" (i.e. the function xA:W+ {OJ}, xA(zl,,z,) = 1, if ( 2 ,,...,z,,) is in A, and xA(zl,...,2 , ) = 0, in the opposite case) is primitive recursive.
...
(3.10) Example. Every finite or cofmite set A C sive.
RV" is primitive recur0
(8.11) Example. For f i e d natural n > 0, the family of primitive recursive sets A c N" is a Boolean algebra with respect to the settheoretic operations. 0
26
Cdudc
1.4. PRIMITIVE RECURSWE INVARIANTS
This section is devoted to the presentation of the basic algebraic and logic operations which preserve the class of primitive recursive functions.
We begin with some "bounded" operations. (4.1) Definition. Let u,u,g:W+' c N ,n 2 1, be three functions. The function f : W + ' N comes from g by limited summation with u and u as limite if for all Z ~ , . . . , Z , in + ~RV, +,,...>=n,sn
f (2 1,**.,zn
92,
+I) =
=+
i
with the convention u(Z1,*.*,zn+1) > u(z1,+n+1)
c
that
g(z1,..vzn,i)
i
(4.1)
+J
f(zl,...,zn+l)= 0
whenever
(4.2) Theorem. If f :W+' c N is defined by limited summation from the primitive recursive functions g, u and u (i.e. f satisfies (4.1)), then f is also primitive recursive.
27
Chapter 1
Concluding, we get the formula
(4.8) Example. Given a primitive recursive function f : N + N we can frnd an increasing primitive recursive function F : N + N which grows faster than f , simply by putting
(4.4) Definition. Replacing sum by product in Defmition (4.1) we obtain the defmition by limited product, namely +p...,z, 1)
f(z1,**,zn+l)=
n
i=o(sl,...,z, .J
g(z1,..vzn,i)
7
(4.2)
with the convention that f ( z l ,...,z , + ~ )= 1, whenever u (z1,..,zn+1)> 1) (z1,*.+n+1)* With minor modifications in the proof of Theorem (4.2) we can get

(4.6) Theorem. If f :W+'N is obtained by limited product from the primitive recursive functions g, u, and u (i.e. f satisfies (4.2)), then f is also primitive recursive. 0
Let us pass now to another useful operation, namely the limited minimisation.
213
Cnlude
'the smallest natural y 52, for which g(zl ,...,z,,y)= 0,
f ( z l,...,z,,t) = 'if such a number y exists,
(4.3)
\z+1, otherwise.
The operator p y is called the limited m i n i m i z a t i o n operator. I
Remark. To compute the value of the function f (zl, ...,z , , z ) defined by (4.3) we proceed as follows. We compute g(zl, ,z,,O) and we check if the obtained value is zero. In the affvmative we get the value f ( z l ,...,z,,~) = 0. In the opposite case we pass to the computation of g ( t l,...,zn,l), and we test the condition g(z, ,...,z,,l) = 0. In the affumative case, f(z,, ...,z,, z ) = 1; in the negative case we continue the computation with g(zl, ...,z,, 2). The process continues until a natural y 2 z satisfying the relation g(zl, ...,z,,y) = 0 is found, or the limit y = z+l was unsuccessfully attained. The elimination of the limit indicated in the defmition of this minimisation operator would allow infinite steps in the computation of f (for example, in the case of the function g(z,y)= z + y , for t 2 1); in this way, the operator would not preserve the class of primitive recursive functions (see also the Remark b) following Example (3.8)).
...
2 0, is primitive recursive, then the f (zl ,...,z , , z ) = p y [ g ( z , ,...,z,,y) = 01 is a
(4.7)Theorem. If g : W + + ' RV, n

function f :W+'
4
LW defined by
also primitive recursive.
Proof. The auxiliary function h : W + ' 1,
c
N
defined by
if g(zl,...,zn,t)#O, for every
can be expressed by a limited product:
So, by Theorem (4.5), h is primitive recursive.
O s t 0, and rrn (z,O) = z. To establish the primitive recursiveness of rm, we use the simple formula: rm(z,y) = 2 ‘y quo (z,y). 0
(4.10) Example. The prime predicate
=
PRIME:JV
P
(0,l) is defined by
i
1, ifz is prime, 0, otherwise.
It is easy to see that the following formula works: s
PRIME(z)= e q ( 2 , x G ( r m ( z , i ) )* ag(i))
.
id
Hence,
PRIME is primitive recursive. a
(4.11) Example. The n t h prime function pn is defined by p n ( z ) = p., where p o = 2, p I = 3, p 2 = 5 ,...,pi is the i t h prime. We shall prove the primitive recursiveness of pn using again the limited minimisation operator. The crucial point is to derive an a priori limit. For every n 2 0, we have pn! + 1 \ P,,+~,since if pn! + 1 is composite, then it is divisible by a prime greater than pn. Here n ! denotes the factorial function which obviously is primitive recursive (O! = 1, (n+l)! = ( n + l ) . n ! ) . Using the h:%V N , auxiliary primitive recursive function = 11, we can write the following primitive h(y) = p z[PRIME(z)*gr(z,y) Y!+l recursive scheme:
It follows that pn ia primitive recursive.
a
31
Chapter 1
(4.12) Definition. To every predicate g : W f l {O,l}, n _> 0, we MSOciate the predicate f:W+'+ {0,1}defined by limited czistcntial quanti fieation as follows: +
1, if g(zl,...,z , , i ) = 1, for at lcaet one natural O < i < y , 0, otherwise. J
We shall write: f ( z l,...,z,,y) = ,V g(zl,...,z,,,i). I
=o
(4.18) Definition. We say that the predicate f :W+' + {O,l}, n 2 0, is defmed by limited universal quanti fication from the predicate g:W+' (0,l) if

!
1,
f(zl,...,z,,y)
Theorem. f : W + '+ {OJ}, n
(4.14)
The
2 0,
=
if g(z, ,...,z , , i ) = I , for
all naturals O < i < y , 0 , otherwise.
class
of
primitive
recursive
predicates
is closed under limited existential and universal
quantifications.

involving the primitive recursive predicate f :W+'{OJ}. 0
Remarks. a) It is not difficult to see that the schemes of limited existential and universal quantification can be generalised by allowing primitive recursive functions a8 limits. b) The main application of the schemes above will be given in Section 2.3 when we shall prove the primitive recursiveness of some useful predicates related to the GODEL numbering of formal equations.
32
Caludc
1.6. PRIMITIVE RECURSIVE ENUMERATIONS
We present two encoding schemes which allow to identify, in a primitive recursive manner, the set of all natural numbers N and various sets of ntuples (for fued or variable naturals n 2 1). As immediate applications, we reduce some definitions by induction (more precisely, simultaneous recursion and courseofvalues recursion) to primitive recursion, thus establishing the primitive recursiveness of some new functions. Also, we reduce the primitive recursion to pure iteration via another encoding scheme. We begin with the primitive recursive identification of
N and I@.
(6.1) Definifion. A primitive recursive function r:# + N is called a pairing function whenever there exist two primitive recursive functions u,,crz:N+ N ,such that the following three relations hold for all 2, y , 2 in N : 4QlMQ2(4)
= z
(5.1)
7
J:w
Theorem. CANTOR'S function J(z,y) = ( z + y ) ( z + y + 1 ) / 2 + z , is a pairing function. (6.2)
+
N
defined
by
Proof. Firstly we prove that for every natural z , there exists a unique pair of naturals (z,y), such that t = J ( z , y ) , or equivalently (zy)' 32  y = 2 2 . Since 82 + 1 = ( 2 2 + 2 ~ + 1 )+~ 8 2 , it follows that 8t + 1 2 ( 2 2 + 2 ~ + 1 ) ~On . the other hand, a direct computation shows 1 0 , then Mi(")(z+l)= M/")(z) , for all 1 5 i
5 n1,
ROBIN
(5.12)
and M k ) ( z + l )
= MP)(Z)+l

:w+'
(6.11) Theorem. (RITCHIE [1965!) Let n be in RV and f RV be a function defined by primitive recursion from the primitive recursive functions g : W * IN and h : W + 2 * N . Then there exkt the primitive N ,such that f can be recursive functions H.:N + N and T : N expressed as

f(z1,***yzn,Y= ) g(O,...,O)
.~(R("+')(zli...,zn,y))
f8g(R(n+1)(2~1...,2,,Y)) .M~2)(~((R(n+1)(21,..',Zn,Y)))
where f comes by pure iteration from 0 and
m
=0
9
(5.13) 9
He: (5.14)
39
Chapter 1
&+I) =
.
H.(j(z))
(5.15)
Proof. We divide the proof into two intermediate steps. First intermediate step. For all naturals zl,...,zn,y,we have: f(z1,*+n
where the function F:N
,Y) = ~(~(~+')(z1,...,2,,y))
+
N is defined by iteration:
F ( 0 ) = 9(0,..,0)

9
F(z+l) = H ( z J ( z ) )
from the function H : I @
(5.16)
9
nV
I
given by
...,Mp+l)(Z+l)).Bg(Mp+y)(z+
1))
+ h (M1"+')(z),...,Mp+;')(z),lu)'sg(Mp+;')(z+
1))
H ( z , w ) = g(MI"+')(z+ 1),
.
In view of (5.10) we can write the formula (5.16) in an equivalent fom as:
F ( z ) = r(MI"+')(z), ...,M ~ ' ) ( z ) ).
(5.17)
The statement (5.17) (and hence (5.16)) wiU be proved by induction on z . Immediate for z = 0, by (5.11). Assume that (5.17) holds. We have:
F(z+l) = H ( z , f ( z ) ) = H(2 , f (M1"+I) ( 2 ), ...,Mt+;1) ( 2 ) ) ) =
g(MI"+')(z+ 1),...,M?+l)(z+ 1))*eg(Mp+;')(z+ 1))
+ h (M1"+')( z ) ,...,M?+ 0, then
T ( z + ~=) H*(f(z)) =
H*(R(zJ(z)))
=
R (MI2)(RbP ( z ) ) ) + 1,
H*(M12)(R(zJF(z))),M~z)(R(z,F(z))))) =
R(Z+1Jf*bJ(Z)))
=
R(z+lfi(zY(t)))
= R(z+l,F(t+l))
.
From (5.19) we get the formula F(Z)
= g(o,..,o)
'
G(Z)+ M i 2 ) ( f ( Z ) )
' 8g(Z)
,
which furnishes, together with (5.15), the required formula (5.13). 0
To tackle the embedding of ntuples sets, with variable n 2 1, into the set of all naturab we use the prime decompositions of natural numbers and we rely on the uniqueness of such decompositions.
...
Recall thst po = 2, p1 = 3, p2 = 5, and that p n : N 4 Pl is the primitive recursive function furnishing the z t h prime, p n ( z ) = pz. Two primitive recursive functions will be useful in the sequel, namely + N ,czp ( i , t ) = the exponent of the pi in the the function ezp :N2
41
Chapter 1
prime decomposition of some natural 2, and the function 1 o n g : N + N , long (z)= the index of the greatest prime dividing z . Since czp ( i , z ) is the smallest natural 2, such that pit+’ does not divide z , we can write the formula ezp ( i , z ) = pz[G(rm (z,pn(i)’+’))
= O]
a
As concerns the function
.
(5.20)
long it is seen that
Formulas (5.20) and (5.21) prove that czp and long are primitive recursive. The basic idea (due to GODEL [1931]) is to represent the sequence of natural numbers (zo,zl, ,z,) by the socalled GODEL number
...
+o
*I
POPI
“‘Pn
*ll
(5.22)
The codification (5.22) works in case all zith are nonnull, or in case we know the number of elements in the sequence. Otherwise, many different sequences can be codified by the same number (for example, all the sequences (1,2), (1,2,0) ,...,(1,2,0,0 ,...,0) ,... have the same GODEL number, i.e. 2 l * 32) and thus decodfication is not possible. The “bad” situation can be overpassed replacing the codification (5.22) by the formula (5.23)
thus encoding the length of the sequence by the exponent of po. (6.12) Proposition. Let tive recursive functions.
Then, the functions
f:N+ N  ( 0 ) and g : N
4
N be two primi
F:N c IN and G :IN + N given by n
F(n) = npn(i)J(if
,
id
and n
G(n) = p n ( ~ y +*’ npn(i+lY(’) i=O
are injective primitive recursive functions.
,
42
Caludc
Proof. Obvious. 0
Remarks. a) Functions F and G are not surjective. In spite of this disadvantage, we can easily work with F and C ,since we can test the membership problem t o range (F)or range (G) by primitive recursive functions and we can “extract” the initial functions f and g from F and G , respectively, again by primitive recursive functions. It is easy to check the validity of the following statements:
I
=o
f(n) = ezp(n,F(n))
g(n) = ezp(n+l,G(n))
I
.
b) The codifkation schemes which use the products of prime powers to represent fmite sequences of natural numbers are called GODEL The natural number F(n) (or, G(n)) is often called the number of the sequence (f(O), ...,f(n)) (respectively, (g(O), ...,g( n))). Sometimes we shall denote the value F(n) (or, G(n)) by ‘< f(O),...,f(n) > (respectively, < g(O), ...,g( n) >). The reader will fmd no difficulty in recognising the appropriate GODEL numbering we use in various contexts. numberinge.
GODEL
As in case of CANTOR’S numbering, we give an immediate application. Recall Example (2.3) in which FIBONACCI’S sequence (u,) was defmed by means of the equations uo= u* = 1 “n+Z
= %+I
+
, Un
The FIBONACCI sequence (un)is primitive recursive. To this end we use the scheme (5.22) in order to represent the fust ( n + l ) (6.18) Example.
elements of FIBONACCI’S sequence by a single natural number:
43
Chapter 1
< Uo,Ul
un
I...,
>=
.
fipn(i).' iP0
The sequence (un) satisfies the equations
,
u,=l un+1
= h(n,
.*pun >)
(5.25)
p
where h:N+N is the function defmed by: h ( n , z ) = eq (n,O) + gr(n,O).(ezp(n,z) + e z p ( n 4 , z ) ) . The equations (5.24) and (5.25) constitute an example of courseofvalues recursion; here, u , , ~does not depend only on u,, but rather on its full "history", u , ,...,urn. To establish the primitive recursiveness of u, we introduce the auxi,urn>, and we liary function F : N + N given by F ( n ) = < u,,ul,. notice that F can be defmed by primitive recursion:
..
F(0) =
< u, > = 2 ,
.
F(n+1) = F ( n ) . p n ( n + l )%+I)
Finally, the equation (5.25) can be written as u , + ~= h(nJ(n)), so concluding our proof. 0
(6.14) Definition. The function f:W+'4 N, n 2 0 is said to be defmed by courseofvalues recursion from the functions g : W + RV and h:N"+' P P J if f satisfies the equations f(Z1,**.,ZnrO)
f
(2 t,*+n
= g(zt,...,zn)
(5.26)
9
,I+ 1) = h (z1,.vzn91,
< f ( z t , * *  , Z n,O),.*,f (21r.+n ,u) >)
(5.27)
9
where < to,...,fn > denotes a GODEL numbering. (The function g reduces to a constant in case n = 0.)
(6.16) Theorem. If f:W" + N,n 2 0, is defmed by courseofvalues Bv and recursion from the primitive recuraive functions g : W h :nv1)'2 + h',then f ia also primitive recursive. +
n
Proof. We discuss only the case
t.
< t o ..., , tn > = n p n ( i )
I;
the reader will
i4
easily supply the detaile when the alternative The
function
F:W+'
+
h'
GODEL numbering is uaed.
defmed
by
...,
F(zl, zn,v)=
44
Caludc
thus proving that f is primitive recursive. 0
is also primitive recursive. Proof. Our aim is to show that f can be defmed by a courseofvalues recursion from primitive recursive functions. We introduce the primitive RV defmed by F(zl, zn,g,z)= recursive function F:Pf'+2 h ( z ,,...,z,,y, ezp(E(z,,...,zn,y),t)),and we write the equation (5.30) as fol

...,
lows
f ( z ~ v  + n , ~ + 1=) h(zl,...,zn,y,f(zl,...,zntB(z1,...,z,,y))) = F(z1,*,zn,y,
 . * , z n,O),***,f(z1,**,~n)
*
(5.31)
Here we made use of the formula (5.22). NOW,f is defmed by courseofvalues recursion from g and F (equations (5.29) and (5.31)), thus by Theorem (5.15), it is primitive recursive. 0
It is worth noticing, in the end of this section, that though there are many induction schemes which preserve the class of primitive recursive
45
Chapter 1
functions, there exist recursion defmitions which fail to have the property mentioned above; as an example, we recall the nested recursion defming the ACKERMANNPETER function.
1.6. SUDAN’S HIERARCHY
We extend the classification of oneargument primitive recursive functions developed in Section 1.2 to all primitive recursive functions. To this end we use SUDAN’S function instead of the A C K E R W N  P E T E R function, and appropriate bounded operations.
SUDAN’S function S : N 3 + N is d e f i e d by means of the equations S(z,y,O) = z
f
Y
S(z,O,fl+l) = z S(z,y
(6.1 1
1
,
(6.2)
+ l,n+ 1) = S(S(z,y,n+ l),S(z,y,n + l ) + y +
1,n)
.
(6.3)
In what follows we shall use the sequence of functions (S,,),,a, S,:nV* 4 N given by Sn(z,y)= S(z,y,n), for all naturals z,y , and n.
As in the case of ACKERMANNPETER’S hierarchy, we begin with the monotonicity properties of the sequence (S,,),,>O. We shall mainly use the proof by induction. (6.1) Lemma. For all naturals z,n , y, if y
> 0, then
Sn(z,y)> 2.
For n = 0, S,(z,y) = z + y > 2, since y > 0. Assume that Again we use the induction: for y = 1, Sn+l(z,l) = S,,(S,,+l(z,o),S,+l(z,O)+l)> Sn+,(z,O)= z. Using both induction hypotheses we obtain: Proof.
S,(z,y)
> z.
46
Caludc
(6.2) Lemma. For all naturals z,y ,
tz
we have: Sn(t,y+l) > Sn(z,y).
Remark. From Lemma (8.2) it follows that for all naturals z, y , n and m we have: S n ( z , y + r n ) 2 Sn(z,y)+ m. (6.8) Lemma. For all naturals z,y , n we have: S,(~+l,y) > s,(~,y).
Remark. From Lemma (6.3) it follows that S,(z+m,y) 2 S,(z,y)+m, for all naturals z,y, n , and m. (6.4) Lemma. For all naturals z,y , n we have: Sn+l(z,y)2 S,(z,y).
We have used, in order, the second induction hypothesis, Lemmae (6.2) and (6.3), and the fvst induction assumption.
Chapter 1
(6.6)
Lemma.
For naturals
2,
y,
47
n we
have: S n ( r + 1 , y + 2 )
5
sn+l(z+ 1 , ~ +1).
Proof. A direct computation gives
Remark. The inequality in Lemma (6.5) can be equivalently expressed as: S , ( z , y + l ) 5 Sn+l(z,y), for all naturals n, z,y with zy > 0. (6.6) Lemma. For all naturals z,y, n, if z
> 0, then Sn(z,y) > y.
Proof. In view of the Remark following Lemma (6.2) it follows that s n ( z , ~ / )_> sn(z,O) + II = z + y
>Y
since z
> 0. 0
Caludc
48
For all naturals z, y , m , n , if y m n S ~ ( Z , Y sn(z,m) ) I Sn(Z,y+m+l), (6.6) Lemma.
> 0,
+
(6.9) Lemma. For all naturals z and y , we have: S,(z,y)
2 zy.
(6.10) Lemma. For all naturals z,n we have: Sn(z,z)< Sn+,(z,2).
+hen
Chapter 1
49
0
In the following we shall use constantly the monotonicity properties of S, sometimes even without special mention.
(6.11) Definition. (DIMA [1981]) For every natural n, we defme 8 , to be the smallest class of oneargument numbertheoretic functions which contains the functions Succ (z), E ( z ) , [zl/),So(z,z),...,S,_l(z,z), S,(z,z) and which is closed under sum, product, composition and limited iteration. (6.12) Lemma. Each class
and
6.
6,,
n
2 0, contains the functions
P"),cill, 8g
Proof. The following formulas are selfexplanatory: P(')(O) = 0 , P(')(z+l) = succ ( I q z ) ) , "z) 5 succ (z); C!')(O)= 0, C!')(z+l) = P(qCy(z)), C!')(z) 5 succ (2); C f ) ( Z ) = SuccyC!')( ; 69(0) = 0, sg(zt1) = cp'(q(2)), sg(2) 5 C[')(a);G(2) = E ( S U C C 2 ( C p ( 2 ) ' 8 9 ( 2 ) ) ) .
"')
0
(6.1%) Proposition.
a) If f I , ...,faare m 2 1 functions in s , , then R(")(f,(z), ...,I,( z)) is also in a,, for every choice of n .

b) If g, h and t are functions in
f
:N
N defmed by cases
,
6,,
n
9(4 if h ( z ) = 0 t ( z ) , otherwise,
is
2 0, then the function
,
in s,.
Proof. a) For m = 1, R ( ' ) ( j 1 ( z )=) f,(z) is trivial. Immediate for rn = 2, R ( 2 ) ( f 1 ( 2 ) , f 2 (=z )((f1(~)+f2(z))2+f1(z))2+f2(z), ) since the defmition is based on sums and products. The closure on composition guarantees that is R(" +'I( f l(Z ),...,f, (2 ),fm+L(Z 1) = R(2)(R(m)(fl(z )c*..,fm(z ) ) , f m + d z ) ) also in a,. b) We have: f ( z ) = g ( z ) * q ( h ( z ) ) + t ( z ) . e g ( h ( zhence ) ) , by Lemma (6.12), f h in 8 , . 0
50
Cdudc
(DIMA [198l]) For each n 2 1 and every f in s,, there exists a natural k 2 1 (depending upon f ) such that for every z (6.14) Theorem.
f ( z ) < Sn+l(z,k)
(6.4)
*
Proof. We proceed by structural induction, i.e. on the basis of the construction of the class s,,. The formula (6.4) holds for the base functions with k = 2: Succ (2) < S,(z,2) 5 s,+1(2,2), E ( z ) = ~ q z ” ’ ]< ~z i~ ~ ( ~ 59 ~2, +)1 ( ~ , 2 ) , [2”’] < z < Sn+,(z,2), and si(z,z) I sn(z,z) k. 0
51
Chapter 1
(6.16) Corollary. If 1
5 n < m , then
8,
C 8 , and
8,
#
8,.
Proof. Immediate from Defmition (6.11) and Corollary (6.15).
(6.17) Proposition. If g is in sn, for some n pure iteration from 0 and g, then f is in 8,+1. (6.14)
furnishes
a
2 1, and f is obtained by
natural
k 2 1 such
that
all z.
To end the proof we show that f can be defmed by limited iteration 8,+1. All it remains to get is a bound in terms of functions from
within
s,,+~. Using (6.5) we have:
33
(6.18) Theorem. The class
U8,
is closed under sum, product, composi
n=O
tion and pure iteration. Hence, it is exactly the class of oneargument primitive recursive functions.
52
Cdudc
Proof. The closure under pure iteration follows from Proposition (6.17) and the reduction step developed in the second part of the proof of Theorem (2.34). Hence, every oneargument primitive recursive function belongs to some class 8 , . To see that the converse implication also holds, we must show that the functions S,(z,z) are primitive recursive. From the defmition of S we deduce the primitive recursiveness of the functions Sn(z,y), in particular of the oneargument functions Sn(z,z). 0
(8.19) Definition. (GRZEGORCZYK !19531) We say that the function f :W" + N , n _> 0, is defined from the functions g : W + RV, h : W ' ? + liV and t N by limited primitive recursion if f is defmed by primitive recursion from g and h , and for all naturals zl,. ..,z,,y L
f(Z1,*.+n,y)
I t(Z1,...,Zn,Y)

(6.20) Definition. (DIMA [1981!) For every n 2 0 , define S, to be the smallest class of numbertheoretic functions which contains the functions Succ (z),Cil)(z), @")(zl ,...,z,,), 1 5 i 5 m, and S,,(z,y), and which is closed under functional composition and limited primitive recursion.
Remark. In view of Defmition (6.20) and the monotonicity of S, we deduce that S, c S,,,,for all naturals n _ 1, S, is the class of all associates of all functions in 8 , .
Proof. Corollary (8.22) asserts that 8 , C s,, for all n 2 1. Every associate of each function f in s, can be obtained by formula (6.7); hence all associates are in S,. Conversely, from Proposition (6.24) it follows that it suffices to show that the base functiona of S, are rssochter of functions in s,. The functions Succ (2) and C{')(z) are selfassociated. The associates of the functions H"')(zl, ...,2), are the functions Mim)(z). T o prove that S,(z,j) has an associate in 8 , we proceed by induction relying upon Proposition (6.24 Immediate for n = 0: the associate of S,(z,y) = z + y is M p ) ( z )t M ( 2 ) = E ( [ z ' / ' ] ) + E ( z ) which lies in 8 , . If S,(z,y) has an associate in 8 , , then S,+,(z,y) has an associate in 8,+1 since it is defined by primitive recursion from f $ ' ) ( z ) and H(z,y,z) = S,(*)(z,y,z), succ ( * ) ( Z , 3 / , 4 + 43)(z,v,4)).
14
0
(6.26) Corollary. For every argument functions in
s,.
R
2 1,
8,
is exactly the class of all one
Proof. Immediate from Corollary (6.25). 0
(6.27) Corollary. For every n
2
1,
S,
C Sn+l and
S, z
&+I.
Proof. Immediate from the Remark following Definition (8.20) and Corollary (6.26). 0
57
Chapter 1
X
(6.28) Theorem. The union
USn is precisely the class of all primitive n 4
recursive functions. X
Proof. The class
U S,
contains the base functions Succ,
Ck),and P,'"),
n==U
and it is closed under functional composition (Defmition (6.20)), and primitive recursion (Proposition (6.24) and Corollary (6.25)). The converse implication being obvious, the proof is completed. 0
The increasing sequence of classes S1 C S2 C...C
S,
C... is called the
SUDAN hierarchy. The main results concerning this hierarchy are due to DIMA [1981] and CALUDE [1982b]. Remark. The results above show that the functional composition and Limited primitive recursion are insufficient to obtain, from the base functions, all primitive recursive functions. To prove some closure properties of the classes new operation, namely the limited maximum.
S,,
we introduce
P
(6.29) Definition. The function f :W+' c RV is defmed by limited ...,z,,~)= mazimum from the function g:Qv"+' .+ N if f(zl, max(g(zl ,...,z,,O) ,...,g(zl,...,z,,y)), for all z 1 z,,y in RV. In this case we shall write:
,...,
(6.80) Proposition. Each class imum.
Proof.
g : P f l+ N
Let
f (zl ,...,z,,y)
S,,
n
be
2 2, is closed under limited maxin
S,
and
then
set
,...,zm,z)).It is seen that
= maxz(g(z, I
f .( 1,...,z, 90) = g(zl,...,~m,O) ?
f (z1,...,zIn,1+1=) m=(f
' ( z l , . . . , ~ ,,~),g(zl,...,z~,I+l))
Obviously, the function max (z,y) = z  g r ( z , y ) + y * ~ ( g r ( z , ~is) )in S,. Consequently, to show that f is in S, it suffices to establish a bound for f within 3,. To this end we recall that in view of Corollary (6.25), g is the rnargument associate of the function
58
Cduda
g *(2 ) = g (MI"+I)
(z),...,MA7(;21 )) ) ,
in 8 , . The Remark following Theorem (6.14) furnishes a constant k for which the inequality g*(z)
holds for all 2 in
N. By
g(Z1,...,Zm,Y)
I Sn(z,k)
9
(6.7) we deduce:
,...
= 9'(R(m+1)(21 ,2,,Y))
L Sn(R(m+1)(2*,,.,Z,,y)tk) 9
all z l ,...,z,,y in N. The (m+l)argument function Sn(R(m+l)(zl,...,~m , y ) , k ) ia obviously in S,. Furthermore, it is increasing in in all arguments, in particular in y . This ensures that for all zl,..,,z,,y N we have:
for
(6.81) Proposition. Each class mation and limited product.
S,,
n
2 2,
is closed under limited sum
It can be easily proved that the functions f l by limited primitive recursion aa follows:
and f z can be defmed
59
Chapter I
Clearb, zv 5 1 + S2(z,y), for all the functions f l and f 2 are in S,.
2
and y. Hence, by Proposition (6.30), El
(642) Propodtion.
S,, n 2 2, is closed under Limited
Every class
minimir at ion.
Proof. If F:RV"'+'
+
S,,
RV is in
then the function f :RV"+l
+
N
defmed by
f ( 2 1 ,...,%b,J)
=
PZ[F(Zl,...,Z,,Z)
= 01
7
J
can be written as f(Zl,...,Z,,d
= 5:(1~If:(1~(21,...,Z,,i)))) j0
9
i4
and consequently it is also contained in
S,. 0
The next result can be viewed as a reinforcement of Theorem (8.14), for it shows that, in a sense, SUDAN'S function grows faster than any pr imitive recursive function.
(6.38) Theorem. (CALUDE, MARCUS and TEVY [1980]) For every primitive recursive function f :W+ N we can fmd two natural numbers p and q such that for all zl,. ..+, in
N.
Proof. We proceed by structural induction following Defmition (3.1). For the base functions the boundedness is immediate: 2,) = Succ (2)= z+l < S0(2,2), ck)2 1,...,2,) = rn < l+rn+(Zl+ S,(l+rn,zl+ ...+z,), and &)(zl ,...,z,) = zi < l+(zl+ ...+z,) = S , ( l , Z I+...+%). Assume now that the function f :W c N is defmed by functional composition from the functions h : P + N and gl, ...,gm :W + N the constants which satisfy the inequality (8.9) with
...+
60
Cdudc
We shall prove the inequality:
f(z1,*..,zn)< s,,+2lSp(q,mq),z,+...+zn)
*
First we prove, by induction on t, the Sp+t(q,r)> t*Sp(q,r),for all q 2 1 and t 2 1. For t = 0 , since r > 0. If SP+:(q,r) > t *Sp(q,r),then s p +t
+l h 7) =
s p +t ( S p +t
+1(9
9r
 1) , S p
+i +1(q
(6.10)
inequality
Sp(q,r) > 0,
,r 1)+r )
> t .~p(~,+:+,(9,~~),~p+t+,(q,~~)+~) 2 t.sp+t+,(q,r1) 2 t sp+t(e,.)
2 t.Sp(q,r) 9
where the last but one inequality was derived by Lemma (6.5). A direct application of the formula above enables us to write the inequalities: m
61
Chapter 1
= Sp(q,mq) = s p + m + 2 F p (e ,mq ),O)
.
Finally we shall deal with the primitive recursion. h u m e that the function f :W+' IN is obtained by primitive recursion from the funcIN and h:RV+' JV which satisfy the inequality (6.9) tions g:W with the constants (pl,ql) and (p1,q2), respectively. Set p = max (p1,p2)+ 1, and q = max (q1,q2) + 1. We shall prove, by induction on y, the inequality

+
f (z1,*,2n
,Y)
< S p (qvzi+ * * * + z n+U)
...,
Immediate for y = 0: f(z1, zn,O)= g(z1, If f ( 2 1 , ...,zn,y ) < S p ( q , z l + * .  + Z n +y ), then
+
Sp(q,zr + . . . + ~ n y+ I ) =
(6.11)
*
...,2,) < Sp(q,zl+...+
2,).
Spl(Sp(q,z,+...+zn+y),
Sp(q,2,+ ...+z * + y ) + q +
...+z n + y + l )
> S p  l ( s p (q ,Z1+.*+zn +11, f (Z1,*..,tn
, ~ ) + z1+ *.+zn
+y + 1)
> Sp,(q ,f (21,.*+n , Y ) + z , +  * + z n +Y ) > Spl(q2,f (21,**+n ry )+zI + .**+zn+Y ) > h(zl,...,zn,y,f(Zl,...,Zn)) = f(Zl,".,Z,,Y+1)
*
This completes the proof. 0
(6.24) Corollary.
is not primia) The function S : N + UV defmed by i ( z ) = Ss(z,z) tive recursive. + b) SUDAN'S function S:N3
IN is not primitive recursive.
Proof. a) Assume, for the sake of a contradiction, that s' is primitive recursive. By Theorems (6.28) and (6,33) it follows that we can fmd two natura h p and q , such that S(z)+l< S,(q,z), for all 2. Setting m = max ( p , q ) we obtain the inequality: S(z)+l < S,(m,z), for all 2. Finally, putting z = m we obtain the contradictory inequality: S ( m) +l < S,(m,rn) = S(m). b) Immediate from a).
62
Cdude
Remark. Though S is not primitive recursive, it is algorithmically computable. The reader is invited to write a FORTRAN program for the computation of S.
1.7. UNIVERSAL SEQUENCES OF PRIMITIVE RECURSIVE FUNCTIONS
In this section we construct, using RITCHIE’s function (RITCHIE 11965]), an infmite class of sequences of primitive recursive functions each of which generate the ACKERMANNPETER hierarchy.
RITCHIE
(19651 haa
obtained
GRZEGORCZYKL
hierarchy
(GRZEGORCZYK [1953] wag the first attempt to classify the primitive recursive functions according to their growth and it has much influenced subsequent work in the field) using a simpler function, namely, the function f : N 3+ RV given by f ( z , v , O )= z + 1
f(z,O,n+l) = 1
for all 2 , y
f (z,?/+l,n+1) = and n in RV, n 2 2.
(7.1)
7
,
f(z,f(z,y,n+l),n)
(7.4) 9
(7.5)
RITCHJE’s n t h class R, is the smallest family of numbertheoretic functions containing the functions Succ (z), C{’)(z), p(m)(zl,...,z,), 1 5 i 5 rn, and f,,(z,v) = f(z,v,n), and being closed under functional composition and limited primitive recursion. Since S,,(z,y) 2 fn+l(z,y), for all naturals 2 , y, n, z 2 1, it is easy to see that S,, equals exactly the ( n + l ) t h RITCHIE’s clans. So, both sequences of functions (S,),,? and (f,),,x generate, in a structural manner, the clase of all primitive recursive functions: This is the reaeon for calling them universal sequences of primitive recurdive functions. In what follows we shall focus out attention on oneargument primitive recursive functions; thus we shall work with oneargument universal sequences. For this purpose we write RITCHE’s function f as a double infinite sequence of oneargument
Chapter 1
63
functions:
The reader, already acquainted with the monotonicity properties of ACKERMANNPETER and SUDAN functions, will fmd no diffkulty in proving, by induction, the following properties of RITCHIE functions f,,,.
(7.2) Definition. (CALUDE and TAT[1983]) For all naturals n and m , let C,,n be the smallest class of oneargument numbertheoretic
functions containing the functions Succ (z),E ( z ) , [zl/'],and f m , n ( ~ ) , and being closed under the operations of sum, product, composition, and limited iteration. (7.8) Lemma. Each class C,,,, rn 2 0, n with i,jE {0,1,2).
P"),ci'),80, G,
2 0, contains the functions
64
Cdude
Remark. As in the proof of Proposition (6.13), we can show that for all naturals n,m 2 0, if g1,...,gk are in Cm,n, then R(')(pl(z) ,...,gk(z)) is a h contained in Cm,n. Furthermore, the function F : N * N defined by cases
1
g(z), if h ( z ) = 0 , F ( z ) = t ( z ) , otherwise,
is contained in
C,,n whenever
g,
h , and t are in Cm,n.
(7.4) Lemma. For all naturals n (f:,m(z))2
for all
2 3, m 2 2 and a 2 1, we have: I fndl"(4 (7.12) 7
2.
For all naturals n 2 3, rn 2 2, and every function f E Cn,m we can find a natural e (depending upon f ) such that for each z we have: (7.5) Theorem.
fb)I f;,m(Z+l)
(7.13)
*
Proof. We display a proof by structural induction on the definition of Cn,m. The following inequalities show that the base functions in Cn,m satisfy (7.13) with P = 1: SUCC( 2 ) = z+I
< 2(2+1)
= f2,2(~+1),
E ( z ) < SUCC( 2 )
< SUCC(21, f n , m ( z ) < fn,m(Z+l) f(z)< f,",,(t+l) and g ( z ) < fi,m(z+l),for
[zl"]
,
*
Now let all z. We shall prove that the operations by means of which Cn,m is defmed preserve the boundedness. The proof is obvious for the operation of limited
65
Chapter 1
iteration. For the product we have:
f .( 1 d z1 I f , " , m ( z + 1 ) fit,,(. + 1)
I (f:,az+1))2 I f,",+mbt1(z+1), by Lemma (7.4). For the sum the majorisation above works too. Finally, for the composition we have:
f ( d z1) I f:,m(f:,m .( + I)+ 1) I c,,(( f: ,m (2+ U2) L f:,m(f:;f,l(z + 1)) = f:l'mb+'(z+l)
.
0
(7.6) Corollary. For all naturals n 2 3 and m 2 2, and every function f in Cn,= we can fmd a natural j (depending upon f ) such that
f ( 4 < fn2+l,m(4
(7.14)
7
for every natural z 2 j.
Proof. Under the hypothesis we use Theorem (7.5) to fmd a natural such that f(z)2 fi,,,(z+l),for all z . In view of the inequality fi,m(z) for all z
< fn+l,m(z+k)
9
e,
(7.15)
2 0, k 2 1, n,m 2 2, we deduce (by (7.9)) f ( z ) I fd,m(.+1)
< f n + l , m (z+' I
+I)
fn+l,m(2.z)
I fn2+l,m(4
9
for all z 2 e +1. Hence the constant j = e + 1 works. The statement (7.15) can be proved by induction on k. For k = 1 we obtain,the obviously inequality fn,,(z) < fn+l,m(z+l).If (7.15) holds, then
f:;','Cz
= f n ,m ( I,",,(2
1)
< fn,,
( x +k))
(fn+l,m
86
Calude
(7.7) Corollary. For all naturals m
2 2, n 2 3, Cn,,,
f
Cn+l,m.
Proof. The function f,",,,, ia contained in Cn+l,m, but, in view of Corollary (7.6), it cannot belong to Cn,. d
o
(7.8) Propoeition. (CALUDE and TATARAM [19831) For all naturals k 2 1 and m 2 n 2 2, the function f n , k is in c,,k.
induction on n. For n = 2, f * , k ( z ) = kz = C~')(z)P(')(z) is in c * , k by Lemma (7.3). We shall show that in case f,,k is in Cm,f, for all m 2 n, we have also f n + l , k E Cm+l,k? for all m 2 n. This will be done by expressing the function f n + l , f as follows
Proof.
We
prove
by
= 8Q(fi+l,k(z))
fn+l,k(z)
k f i + l . k ( z )
where f,'+l,k is a certain function belonging to every class m >n.
Cm+l,k,
for
b defmed by pure iteration from the
The auxiliary function f,'+,,k function gn,k(z) = fn,k(G(z)+z): fi+l,k(0)
f,'+l.L(z+l)
(7.18)
9
=
9
= gn,k(fi+l,b(Z))
a
In view of Lemma (7.3) and the induction hypothesis the function gn,k is contained in every class Cm,t, for all m 2 n, in particular in all classes C m + l , k , for m 2 n. Since f n + l , k is defmed by pure iteration from g n , k , it follows that to prove tha t f n + l , k E C m + l , k ? for all rn 2 n, it suffices to establish a bound of f,'+l,k within Cm+l,f. To this aim we prove, by induction on 2 , the inequality f:+l,k(.)
Immediate f;+l,k(l)
for
z = 0,
= gn,k(f:+l,k(o))
and
5 2
fm+l,k(z)
= 1:
f m +l,k(z+
l) =
fi+l,k(O) = 0
= gn,k(O) = f n , k ( l )
the inequality (7.17) holds, for some z (xtl):

> 0,
f m , k ( f m +l,k(%
1)
(7.17)
5 1=
fm+l,h(0),
that we show that it devolves for
m, the function g,,,(z) = f , , , ( q ( Z ) + z ) is in C,,, C C,,q; furthermore, is contained in C,,q because it is defmed by limited iteration from gn,= and fn+l,q (recall that by (717), fi+i,,(z) _ 2 , if f E C m , k , then the function g ( z ) = f'(0) is in &+I,&. Proof. Let f and g be aa stated in the statement of the proposition. In view of Theorem (7.5) it follows that we can find a natural t , such that f ( z ) 5 f A , k ( z + l ) ,for all z. Consequently, the following bound can be established:
o ( t ) = f'(0) I fa1)
L for every z
> 0.
f.,+l,k(W
!
We have used Lemma (7.11).
The function g can be defmed by limited iteration within Cm+l,k so it lies in Cm+l,k.
( f E Cm,k C im+l,k by Corollary (7.9)),
3
We close this section with a comparison between the classes (Gn),B, In 3 , and ( C n ,m In ,m 20.
(7.18) Theorem. (CALUDE and ri _> 3, we have C,,2 = G,.
TATARAM (19831) For all naturals
c
Proof. First we deal with the inclusion Cn,2 G,. In view of Lemmas ( 2 . 2 3 ) , ( 2 . 3 2 ) , and Proposition (2.33), it suffices to show that fn,2 is in G,, for all n 2 3. It is seen that f 3 , 2 ( 2 ) = 2' = A 3 ( ~ * ) + 3 , so C3,p C G3. If f n , * is in G,, then, by Lemma (2.24), lies in G,+l because fn+1.2(0) = 1, f n + 1 , 2 1 2 + 1 ) = f n . d f n + 1 , d Z ) ) . For the converse implication, i.e. G, C Cn,2, we must prove the following two statements: i) the claaa C,,p is closed under arithmetical difference, and 5 ) 4, lies in Cn,2, for all n 2 3 .
69
Chapter 1
i) For n 2 3, set Cn,2 = {f(R(2)(z,y))I f E Cn,2}. We shall prove that: a) Cn,2 is closed under a certain particular form of limited primitive recursion, b) Cn,2 is closed under arithmetical difference, c) Cn,2 C Cn,2, and d) if f is an oneargument function in Cn,2, then f is in fact in
cn,2.
Ae concerns a) we show that in case g, j , and h are three functions in Cn,2, then the function f : N 2+ RV satisfying the conditions f(Z,O)
=2
9
f ( z , 9 + 1 ) = h(f(z,ar)) f ( z , v )i
9
ik)
is in C,,2. Indeed, RITCHIE's Theorem (5.11) and the proof of Proposition (6.24) assert that f can be expressed aa
where
*Mr)(m2)(z
f (2 ,Y) = sg(R(2)(z,I)) 1 1 1)) N is defmed by limited iteration from H * ( Z ) = R(2)(M f ) ( z ) + 1 , q ( M [ 2 (2)) ) .(M p ( M p( z ) + 1) .dp(Mp)(Mi21( z ) + 1))
7:nV
9
4
+ h (MJ2)(2)) .89(Mi2)(M12)(4+1))))

and R ( 2 ) ( z , j ( M [ 2 ) ( z ) Consequently, )). f is in
Cn,2,
9
hence f ia in
Cn,2.
To prove b) we notice that the predecessor function Pd (2) = 2 4 is contained in Cn,2 (see the proof of Theorem (2.34)), and, by a), the function z 9 y belongs to Cn,2 since z=z
z+y+l)
= Pd
Z * < Z
, ( 2 9 )
.
,
Also notice that Cn,? is closed under functional composition. If g,(z,y) = g,:(R(2)(z,y)), for some g,! in Cn,?, i=1,2,3, then s(z,mr)=, !71(92(z,Y),g3(~,Y))= 9'(R'2'(z,Y)), , where 91(4 = g;( R ( 2) ( g2( ~) , g3( ~)ie) )also , in Cn,2 because g is contained in C?, Now, if f and g are in C n , 2 , then f(z,y)(z,y) is also in Cn,2.
The inclusion Cn,2 c Cn,t follows from the fact that each function f in Cn,2 can be written as f ( z ) = f*(ld2)(z,y)),where f*(z) = f ( M [ ' ) ( z ) ) . The reader can easily see that C n , 2 # C n , p To prove statement d ) we take a function f :N IV in Cn,2, and we write, by virtue of the defmition of the class Cn,2, the formula f ( z ) = f*(R(2)(z,y)), for all z and y; here f * ie contained cn,p Set y = 0 in the formula above; we get f ( z )= f * ( R ( 2 ) ( z , 0= )) f (z'(z+~)~),

'fl
70
Cdudc
for all z,thus establishing the membership of f to C,,z.
We have fmished the prerequisites required to prove i). If f and g are in Cn,2, then the function !(~)%3(2) ie in C,,z (by c) and b)). In view of d), the oneargument function ~(z)%J(z)lies in fact in C,,2. We can pass to ii). For n = 3, A3(z) = 2*+'Q = f3,z(z+3)93is in C,,2 (we have used i)). If A,, is in Cn,2, then the function A,,+l given by the equations
4 + 1 ( z + 1 ) = A,(A+1(4) 7 can be written as &+,(z) = g,(z+l),
where
gn(0) = 0
gn(z+1) =
t
hn(gn(z))
t
and h , ( z ) = s~(t).A,(l)+sg(z)A,,(z). The formula above works since .c(1) > 0, for all rn 2 1 (see in this respect the proof of Theorem (2.34)). Obviously, h, belongs to C,,2, so g, is in c,+1,2 by Proposition (7.12). 0
(7.14) Corollary. We have G, = C,,, m 22.
for all naturals n
23
and
Proof. In view of Proposition (7.10) and Theorem (7.13) all it remains to for all n 2 3, and m 2 2. This reduces prove is the inclusion Cn,, C to the relation f,,, E Lr,,2, for all n 2 3, and m 2 2. Now for n = 3 the If for some n 2 3, f,,, is result is obvious since j 3 , , ( ~ ) = rnz 5 (2')"'; h. Cn,Zt i*e. c n , p ~ ~ n . then 2 9 fn+l,rn(z) = gn,m(z+l)t where = 0, gn,m(zT!) = h n , m ( g n , m ( z ) ) t and hs,mJz) = G(z)+ sg(z)*fn,m(z) Obviously, hn,m is in Cn,m C Cn,2, hence h,, is in Cn+l,2, by Proposition (7.12), thus completing the proof.
L,(n(O)
0 P
(7.15) Corollary. The class
U Cn,m coincides n 4
argument primitive recursive functions, for all rn
with the class of all one
2 2.
Proof. Immediate from Theorem (2.34) and Corollary (7.14).
71
Chapter 1
Remarks. a) It is easy to see that 0,= Co,j = i , j 2 0.
C,,j
= Cz,j =
Ci,o = Cj,l, for all
b) Corollary (7.14) says that 2’,3’, ...,m’ are all similar. More gen,...,fn,m(z) ,... have about the same rate of eraly, for n 2 3, fn,2(z),fn,3(z) growth, for each of them defines the same clam of functions. Thus, the ACKERMANNPETER hierarchy can be generated by an infmity of universal sequences of primitive recursive functions. c) The reader will fmd no difficulty in proving that for all n 2 2, rn 2 2, s, = Cn+l,nr = the class of oneargument functions in the ( n+ l) t h RITCHIE’s class. d) It is a strange fact that if we add to the three equations satisfied by the function k in Example (1.3) the initial equations k(E,n,O)= 1 , for all n
k(E,O,T) = B  T
21 ,
,
then the resulting (total) function k coincides with RITCHIE’s function f (CALUDE and VIERU [1981b)).
1.8. PRIMITIVE RECURSIVE STRINGFUNCTIONS
In this section we extend the primitive recursive functions and their corresponding hierarchies to stringfunctions. Although most results are essentially the same, there are some points where there exists a difference between the former (particular) and the latter cases. Moreover, it should be stressed that, via suitable encodings, these theories are equivalent; however, from a complexitytheoretic point of view, this equivalence may not be relevant, due to the inherent complexity of the encodingdecoding process. Let X = {u1,u2,...,$p},p 2 1, be a nonempty set, sometimes called alphabet. Denote by X the free monoid generated by X. Ae a set, X’ consists of all string8 z = zl...zn, where the zi’s belong to X ; the null string X is also in X*.The monoid operation is the concatenation defmed as follows: if z = zl...zn and y = y l . ..ym are in X*, then the concatenation of z and y ia the string zy = z l . . . z n y l ~ . y ~ ;furthermore, Xz = Z A = z, for each string z in X*.If z is in X and n EN,then
72
Cdude
(n copies of z) in case n > 0, and z o = A. Every string E X*  {A} can be uniquely written M z = z l ...z,, where all ti’s are in the set of generators X . If z,y are in X * , then z c y if y = zz, for some
zn = z...z z z
in x*.
We denote by e :X** N the homomorphism of monoids defrned by: t ( X ) = 0, !(z) = n , if z = zl...z, and all ziys are in X. We refer to Y(z) as the length of the string 2 . A function f :(X*)” X* in called a string function sometimes.

We shall work with the following base stringfunctions. The leftfiuccessor functions Succf:X* 4 X*,Succf(z) = a i z , the constant funcin X * and each tions Cf:(X*)” * X*,Cf(zI,...,2 , ) = y, for all zl,..;,z, string y , and the projection function F : ( X * ) n* X , F ( z l ,...,2 , ) = zi, for all z 1,...,2, in X* and each choice of n > 0, 1 5 i 5 n . The concept of primitive recursive function can be generalired from N to X * in a natural way if we regard X * as a monadic (noncommutative) algebra having p successor functions instead of only one. This means that in the generalised primitive recursion scheme we must have p recursion equations, namely a recursion equation for each successor. The reader can easily realise that our choice of leftsuccessors (instead of the rightsuccessors) does not affect the following results.

(8.1) Definition. The stringfunction f :(X*)n+’ obtained by, Xprimitive recursion from the g:(X*)”+ X and I L ~ : ( X * ) .c ” +X*, ~ i = l , ...,p , if
X*, n 2 0, is stringfunctions
f (z1,.*.,zn,A)= 9 ( ~ 1 , * * * ~ , )
(8.1)
9
X
f(Z1,.*,zn,SUCCi(Y ))
=
h(zlt**tznYY>f (z1v,zn,fo)
9
(8.2)
for all i E { 1,...,p } , and z1,...,2, ,y in X * . (8.2) Definitlon. We say that the stringfunction f:(X*)nfl c X*, n 2 0, is defmed by limited Xprimitive reeursion from the stringfunctions g:(X*)”, X * , hi :(X*)n+’ X* and 6 :(X*)n+’* X* if it satbfies the equations (8.1)t (8.2) and in addition +
( f ( z 1 ,  + n , ~ ) )I ~ ( ~ ( ~ ~ ,   ~ J L , v ) )
for all z1,...,z,,~ in
(8.3)
x*.
(8.8) Definition. The clam of primitive recursive stringfunctions (over X) is the smallest family of functions defmed on (X’)” with values in X*, n 2 1, containing the base stringfunctions and which ia closed under functional composition and Xprimitive recursion.
73
Chapter 1
(8.4) Example. The Concatenation function c ~ n ~ : ( X * ) ~ X* defmed by con2(z,u) = zy, ia primitive recursive. We fust defme the stringfunction c%~:(X*)~ ., X*by Xprimitive recursion: +
,
cZ?n2(z,X) = z
cz12(z,SUCC;(y)) = succ;(cz12(z,f())
,
and then con2 can be obtained as con2(z,y) = cZ?n2(y,z). 0
(8.6) Example. It is .a routine exercise to prove the primitive recursiveness of the following stringfunctions: con,:(X*Y
+
x*,con,(zl ,...,
2,)
01,
x
GX:x*
= zl...z,
,
i f 2 = A, 0
We defme now an extension of RITCHIE's sequence of number(f,),a (see the equations (7.1)(7.5), theoretic functions f,(z,v) = f ( z , y , n ) ) in order to obtain a hierarchy of the clam of primitive recursive stringfunctions. The generalized RITCHIE sequence ( f:),, 3, f::(X*)2 .,X*is defined by the equations:
f%v)
= SUCCf(4
fT(z,X) =
=
ff(z,X) =
9
(8.5)
7
(8.6)
f,X,,(z,~) = al, for all n
r:+,
(2 ,SUCCXb
(8.4)
9
> 1 .,
1) = f Y z ,f:+l(.
9
,...,p } .
for all n 2 0, i E (1
(8.7) (8.8)
74
Cdude
(8.6) Lemma. For all n in Bv and
2,
y in
X * , we have:
(8.7) Definition. (WEMRAUCH [1974]) For every natural n 2 0, we denote by & ( X ) the smallest class of stringfunctions containing the base stringfunctions, f,", and which is closed under functional composition and limited Xprimitive recursion. Remark. Since every stringfunction f," is primitive recursive it follows I.
that
u f , ( X ) is
a subset of the set of all primitive recursive string
n *O
functions.


(8.8) Lemma. For all naturals R 2 0, k 2 1, I f :Nk N is in R,, then we can find a stringfunction fX:(X*)k X * in &(X)such that
f(P for all z,,...,zt in
(Zl),...,l ( 2 6 ) )
=
e (fX(Z1,...,Zk))
(8.10)
?
x*.
Proof. We develop a structural induction on the defmition of R,. The following equalities are obviously valid: Succ(e(z)) = e (Succf(z)),
co(e (I)?*,[ .
( z k ) )=
(c?(z
I,,zk)),
pi
(e
1 ) P d (.k
1) = (P;"(%1,.*.,2k
Lemma (8.6)guarantees that (8.10)holds also for the function fn(z,y).
))*
Next we shall prove that the functional composition and limited primitive recursion preserve the property stated in the lemma. Assume fust that the function f :I?' 4 N is defmed by functional composition N , 15 i < m , in R,, from the functions h : W  N and g;:oVk satisfying the equality (8.10)with the stringfunctions h X , gi";l 5 i 5 m , respectively. A simple computation shows that the stringfunction fX:(x*)' 4x., f X ( 2 1 1 . . . , Z k ) = h x (91 x (21, ...,t ~ ) ...,, gm(X tl, , t k ) ) works. Furthermore, j x is in &,(X).

...
75
Chapter 1
Finally, suppose that f :Nit+'+ N in R,, WM obtained by limited primitive recursion from the functions g : N " + N ,h:N"+' + PI and 6 :4Vk+' + N,in R,, satisfying (8.10) with appropriate stringfunctions ox, h X , and b X . We shall see that the stringfunction fx:(X*)'+l + X*, defmed by limited Xprimitive recursion from gx and h f = h X , 1 5 i 2 p, works. The formula (8.10) can be easily established by induction on the length of the last argument of f X . All it remains to show is a bound for f X within E,(X). To this end we proceed as follows: (fX(Z1,*v2k,v))
=
f ( l( z l ) , * d(2k),e
(Y))
5 b(e (21)rvd ( 2 k ) , e ( v ) ) = (bx(zl,**,zk,~))9
for a~
21(...,zk, y
in x*. 0
2 0, and k 2 1, if fx:(X*)' + X*is in f,,(X), then we can fmd an increasing function f : N k+ RV in R,, such that (8.9) Lemma. For all naturals II.
(fX(21,.v2k))
for a~ zl,. ..,zk in
5 f (l (21),*,t
9
(8.11)
x*.
Proof. The proof is straightforward by structural induction on the defmition of t,,(X). 0
(8.10) Theorem. (WEMRAUCH [1974]) Let n 2 0, k 2 0, and consider stringfunction f :(X*)"+'+ X* defmed by Xprimitive recursion from the stringfunctions in f,,(X), gx:(X*)' + X* and hx:(X*)k+2 X*. Then, f X is in E,,(X) iff there exists a numbertheoretic function b :N"+' N in R,, with l (f x(zl,.+k,u)) 5 b ( l (zl), l (zk),l(y)), for all 2 1,..., z&,y in x*.
a
+
.
...,
Proof. For the direct implication we can take b = f , where f is the numbertheoretic function which comes from Lemma (8.9). Conversely, by Lemma (8.8) we can fmd a stringfunction bx:(X*)'+' + X* in t,,(x), such that t ( b x ( z l , n a + k , u ) ) = b ( l (zl) ,...,l ( z k ) , (v)), l for all z1,...,q , y in X Consequently, t ( fX(zl,+zk#)) 5 t (bx(zl, zk,y)), for all 21,...,2k,# in X*,t h u rsserting that f X can be defmed by limited Xprimitive recursion over &(x),i.e. f X lies in f,,(X).
...,
.
0
76
Cdudc

(8.11) Corollary. For each n 2 3, if f X : X * X*is in f,,(X),then we can frnd a natural m (depending upon f ) such that /I ( f X ( z ) < ) fn+1(2,!n+1(2,'(2)))
for every z in
(8.12)
X*with e (2)> m.
Proof. In view of Lemma (8.9), Corollary (7.6) and Remark c) following Corollary (7.15) we fmd a numbertheoretic function f : N * IV in R, such that W X ( Z ) )
I f ( ' ( 2 ) ) < f:+l,d'(Z))
9
for each string z in X * of length greater than a certain natural m (depending upon f ) . 3
(8.12) Corollary. For every natural n choice of k 5 n.
2 0, f," is in f n ( X ) ,for each
Proof. Immediate from Theorem (8.10), and the inequalities (7.6)(7.8). 3
(8.llr) Corollary. For every natural n
2 3, ff+, is not in f , ( X ) .
Proof. Assume, for the sake of a contradiction, that f,",, is in f n ( X ) for , n 23. Then, the some f X ( 4= stringfunc tion Succlx ( f xn + l ( f ~ + l ( z , z ) , f ~ + , ( z ie , z also ) ) ) in f , ( z ) . Corollary (8.11) yields a constant m such that
< fn+1(2,fn+1(2,'
1( f X ( z ) )
(2)))
7
for all z in X*with /I (2)> m . We get a contradiction in case we consider a string z with f ( z ) = m + 2. 0
We conclude with (8.14) Theorem. (WEMRAUCH [19741)
a) The claases f , , ( X )form a proper hierarchy.
*
b) The set
U f n ( X )ia n =O
string func tions.
precisely the set of all primitive recursive
77
Chapter 1
Proof. a) Immediate from Corollaries (8.12) and (8.13). .x)
b) The closure of
U &(X)under Xprimitive
recursion follows from
n 4 x)
the closure of
(8.10).
UR,, to primitive
recursion, a), Lemma (8.9) and Theorem
n 4
Ending this section we notice that the sets X* and PI = {ul}* can be identitied by means of primitive recursive stringfunctions. The reader can easily show that the stringfunction
c:x*
c { U , } *
given by C(X) = A, and
(8.13) is a bijective primitive recursive stringfunction.
1.9. HISTORY
We refer to KLEENE [1981]for a detailed history of the recursion theory. DEDEKIND [1888]and PEANO [1889]were the fvst to use defmitions by induction. Rudiments of a primitive recursive calculus can be found in SKOLEM [1923]and HJLBERT [1926]. GODEL (19311, [1934] used the primitive recursive functions (which he called “recursive functions”) in his famous paper on the incompleteness of logical systems satisfying certain reasonable conditions.
PETER [1934] introduced the term of “primitive recursion” and KLEENE [1936]wad the fvst to use the nowallaccepted name of “primitive recursive function”. A C K E R M A ” [1928]and S U D A N [1927]share authorship of (what we call today) the fvst example of a numbertheoretic (recursive) function which is not primitive recursive (see also CALUDE, MARCUS and T E W ji979)). Primitive recursive functions were extensively studied by
78
Caludc
ROBINSON [1947]. GRZEGORCZYK (19531 introduced the operation of limited recursion and constructed the fvst hierarchy of primitive recursive functions based on functions growth. In this way, GRZEGORCZYK was among the fvst authors dealing with a complexitytheoretic classifkation of primitive recursive functions. GRZEGORCZYK’s paper also provides a classification of primitive recursive predicates. This hierarchy, which parallels the functions hierarchy, emphasires the difference between the rote of growth and the intrinsic compiezity of primitive recursive functions. ACKERMANNPETER’S hierarchy was studied by GEORGIEVA j1978ai. SUDAN’S hierarchy comes from DIMA [1981]. It is strange that above a certain point the GRZEGORCZYK [1953], RITCHIE [1965!, ACKERMANNPETER, as well as many other hierarchies within the class of primitive recursive functions coincide (see also, HARROW 119791). The results presented in Section 1.7 show that we can fmd infmitely many ways t o defme GRZEGORCZYK’s classes. In contrast, VERBEEK [1978) has shown that it is possible to construct an infmite sequence of different hierarchies having the same properties as GRZEGORCZYKP hierarchy. Primitive recursive stringfunctions were introduced and studied by ASSER [1980l, and EILENBERG and ELGOT [1970]. The generalization of GRZEGORCZYKL hierarchy to stringfunctions comes from WEIHRAUCH [1974] (see also, HENKE, INDERMARK, ROSE and WEIHRAUCH (19751). The monographs KLEENE [1952], PETER [1957], DAVIS !19581, USPENSKY 119801, HENNIE !1977] contain chapters on primitive recursive functions. YASUHARA 119711, BRAINERD and LANDWEBER [1974) present GRZEGORCZYK’s hierarchy. A stringfunction oriented presentation of primitive recursive functions can be found in EILENBERG and ELGOT (19701, BRAINERD and LANDWEBER [1974], MACHTEY and YOUNG 119781. Interesting applications in computer science are contained in PETER [1981].
79
Chapter 1
1.10. EXERCISES AND PROBLEMS Section 1.2
(10.1) Show that for every natural n 2 2, we can fmd a predicate Pred:N (0,l)in G,+l  G',.
5,
(10.2) (GEORGIEVA [1976b])For every natural n 2 0, let be the elase of oneargument numbertheoretic functions which are obtainable from Succ (z), sqrt (2) = [zl/'], and &(z) by composition, arithmetical u
). difference and special limited summation ( f ( z ) = & h ( ( ~ + i ) ~ + z )Show

i0
that G, = C,, for all n 2 2.
(10.3) (CALUDE [1981]) Show that for every naturals 1 5 rn < n  1, and for every functions g E G,  Gmd1,f E G,  Gnl satisfying the inequality g(z) 2 f(z),for d but a fmite number of 2, we can fmd a function h E G j  Gjl, such that g(z) 5 h ( z ) 5 f ( z ) , for all but a fmite number of z,for every choice of j between m and n. (10.4) (Open) Is COLLATZ's function defmed in Example (1.1) in
GI,
for every natural a?
(10.5)Prove the correctness of the FORTRAN program displayed in Remark d) following Theorem (2.35). Section 1.8
(10.6) Prove the primitive recursiveness of the following functions: min:N2cRV 2,
A ,V:M
i

,
ifz0 ,
otherwise,
f
h:N2.N , h ( z , y ) = [2/2’]
I
Section 1.4

(10.7) Let f : N 2* RV and g : N c functions. Show that the function h :N2 +,O)
RV be two primitive recursive N defmed by the equations
= g(2)
1
m
h(z,y+l)
=
f (z,Xh.(z,i)) I
9
=o

is also primitive recursive.
(10.8) Show that the predicates f ,:N2 defrned by

{O,l} and fz:N3 ( 0 , l )
1
, if g ( i ) < g ( i + I ) , for some
11
, ,
zo,
< , 0,
and let
g:W a N be a partial function which is equationally computable from some finite set of equations f, with FA")as principal partial function sym.,z,,and y, we have bol. If for certain natural numbers zl,.. 4(21,...,%)
=
Y
7
then there exists a derivation of the equation W(~I,...,%) =
Y
7
(3.14)
from & in which no application of RR involves an equation containing a variable. Proof. We shall prove, stepbystep, that every derivation (from E) of the equation (3.14) can be replaced by a derivation (from t)of (3.14) in which no application of RR is followed by an application of SR. Let e 11.4,
!
(3.15)
be a derivation (from E) of (3.14), and assume that c j is the fwst equation in the sequence (3.15) for which: a) there exists a natural number t RR from certain precedent equations, and
< j, such
that ef is obtained by
b) the equation e j was derived by SR from an earlier equation
ei(i
< j).
Two possibilities may ocur:
A) The equation ei belongs to E or is obtained by earlier equations by SR. In this case the derivation (3.15) can be equivalently replaced by the derivation
106
Calude
e
,...,ei ,c j,ei
.
...,ejl,c j+l ,...,c,
(3.16)
B) The equation ei is obtained by an application of RR from some earlier equations ei and ei2, i, < i2 < i . Denote by and e,:, the equations obtained, respectively, from eil and eit by the substitution used to derive e j from ei. In view of Lemma (3.9) the derivation (3.15) can be equivalently replaced by the derivation I
e ll...,ei,,...,ei*,ei,
,
yei2 ,ej?***,eiteir+l,...,ejl,Cj+lc...,e~
*
(3.17)
Clearly, the initial derivations e l ,...,e *. le 1. and e l ,
...,ei ,,...,ei ,...,eil,ei,,ej , I
I
(3.18)
will eventually satisfy the required restriction. Finally, stepbystep, we can replace the derivations (3.16) or (3.17) by equivalent appropriate derivations satisfying the required restriction. 3
(8.11) Definition.
A derivation is said t o be normal if no application of
RR involves an equation containing a variable. (8.12) Example.
The derivation in Example (3.6) is normal. It can be replaced by the equally normal derivation
3
(8.18) L em ma . Let n, m > 0 be two natural numbers and let ql,...,qm :W3 N ,B :W 3 IN be equationally computable partial func
tions. Then, the partial function 4:" 4 N obtained by functional composition from e , q ll...lq,,, is also equationally computable.
..
X , respectively, the sets of equations defmProof. Denote by Sl, .,,;, ing the partial functions 9 , ,...,q,, B Without loss of generality we may assume that the partial function symbols occurring in the sets of equations jl,. . ,y',, Y have been chosen in such a way that no partial function symbol belongs to different defining sets of equations. Furthermore, suppose that the principal partial function symbols defming the partial functions q l ,...,q m , and B , are, respectively, E'):) ,...,F{:), and Pim). Fix i > max (il,...,amlj). Clearly, Fj")does not appear in the equations contained in g1, . . ,$,,,, and A'.
.
.
.
We defme the set of equations T t o be the union of the singleton
107
Chapter 2
(3.19)
with 51 U...U
$m
U 1
9
and we prove that 3defmes Q with I$") 88 principal partial fucntion symbol. More precisely, we shall prove the equivalence
...,z,,)= y w 3 k Jp(z1, ...,2,) for all naturd numbem z1,...,z,,,and I/. Q(Z1,
=y
,
(3.20)

For the direct implication, assume that Q(zl, ...,2.) y, for certain N. From the defmition of Q it follows that the existence of the natural numbers zl, ...,zm satisfying the equalities
zl, ...,z,,,y in
~,(z1,...,za)
zr,
r=l,***,m t
and
...,z,) = d(t.l,... By hypothesis, for every 1 5 r 5 m, 5, F fl:)(Zl,***rZa) Q(21,
,zm)
=Z
zr
*
,
and
M
Fjm)(zl,...,zm) = y
.
We use the defmition of 3to write the following three relations:
3~ ~):)(z~
,...,2),
= z,, for
15 r 5 m ,
+
F Fjm)(zl,...,zm) = 1 , F t F p ( U I , ...,u,) = Fjm!(Fp(u l,...,U,,),
...,F{:)
(u 1,...,u,))
.
Finally, an (rn+l)fold application of RB yields: 3 F FP)(Z1, ...,z,) = y
.
(3.21)
For the converse implication in (3.20)we m u m e that (3.21)holds for some z1,...,z,,,and y in N. Furthermore, in view of Corollary (3.10) we may suppose that the equation
108
Colude
F!")(Zl,
was derived from
...,2,)
=
,
y
(3.22)
Tin a normal form.
The set T contains an unique equation in which the symbol F(.") appears. Consequently, to construct a normal derivation of the equation (3.22) it is necessary to apply nfold the SR to the equation in the set (3.19), i.e. to obtain the equation
Fi(")(z
,...,t, ) = Fj"
)( F!:)
( z I ,...,2, ),...,F!:) ( z 1,...,L, ))
.
(3.23)
There is an unique equation in Tin which Fjm)appears together with all r = 1 , ...,m , namely (3.23). Consequently, to obtain the equation (3.22) we must use mfold the RR within the equation (3.23), by means of the equations:
F!:)(z, ,...,z,)
= 2,
, 15 r 5 m ,
(3.24)
for appropriate natural numbers zI,...,z,. Pursuing our analysis we note that these replacements will yield an equation of the form
F y ( 2 ,,...,C , )
=
F,(")(z, ,...,t m ) ,
(3.25)
and the unique way to continue the derivation is to make a replacement from an equation of the form
.
= y
Fp(Z,,...,Z,)
Concluding, from (3.21) we deduce the existence of the natural numbers t , ,...,Z, such that
?t
F!:)(Z~,...,zn)=
z,
,
1
5r5m ,
(3.28)
and
Tk F p ( Z , ,...,Z")
= y
a
(3.27)
Using our general hypothesis and the fact that the sets of equations and U have no common partial function symbols, we deduce (from (3.28) and (3.27)):
$,,
. . . ,$,
9,
F,L:)(z, ,...,t,) = z,
,
1
5r5m ,
and
.v t Fj")(z, ,...,zm) = y . Hence
109
Chapter 2
and
Finally,
(3.14) Lemma. Let n > 0 be a natural number and let q :WA N , B A hr, be two equationally computable partial functions. Then, the partial function t$:W+' A N defmed by primitive recursion from q and 8 is also equationally computable.
Proof. Suppose that q and 6 are defmed by mean8 of the sets of equations 5 and M having no common partial function symbols. The principal partial function symbols associated to q and 8 are, respectively, el")and F,("+*). Let k > max(i,j), and define 3to be the union of the sets 5, M and (3.28)
{FP+')(u1,...,U,,O) = F . ) ( u 1,...,u,) , F p +1)(u1,...,un,succ (u, +I)) = F,("y1'(u 1,...,u, &+I, FP+')(ul,***,Un ,Un+J)I
*
We shall prove that for all natural numbers zl, ...,Z,,Z,,+~, and y, 4(z1,***+n,zn+1) = Y
* F F FP+l)(zlJ...,z,,z,+l) = Y 
(3.29)
We proceed by induction on z,+~. Firstly let z,+~ = 0. Assume that =Y
d(zl""JzA,O)
(3.30)
J
for some zl, ...,zn, and y in PJ. Since 4(z1,"',z?I
Jo)
=
q(z1J'**,2n)
?
we deduce that
M
F?)(z1,...,z,) = y
.
Furthermore, in view of the relation A' C 7,we have 3 k Fp(Z1, ...,zn) = y
An nfold application of SR in the equation
.
(3.31)
Calude
110
Fp"'(ul ,".,u,,o)
=
Fp(u1,...,u,)
,
of T yields
T/ FP+')(zl,...,z,,O)
=
Fi(")(21, ...,2 , )
.
(3.32)
Now we use RR to derive from (3.31) and (3.32) the relation ?kF P + 1 ) ( Z 1
,...,z,,O)
.
= y
(3.33)
We pass to the converse implication, i.e. we assume t h a t (3.33) holds for some natural numbers z l , c,, and y , and we prove (3.30). We notice that, by construction, there exists an unique equation in Twhose lefthand side is exactly the term Fp+l)(ul,...,un,O). In order to have a normal derivation of the equation
...,
Fl"+l)(z1 ,...,2,,0) = y
,
(3.34)
we must use SR in the equation
Fp")(Ul ,...,un,o) = Fi(n)(U1 ,...,u,)
.
Since the symbols FP+') and F,ln)appear together in an unique equation, there is an unique possibility to obtain (3.34), i.e. by making a replacement in the above equation by means of the equation
.
Fi(")(Z1, ...,2 , ) = y We successively derive the relations:
?kF!")(zl,...,z,)
=y
,
4
=y
,
F ? ) ( z ~..., , 2,) 9(z1,.,zn)
= Y
9
employing the general hypothesis and the fact that F P ) does not occur in any equation of N. Finally, ~ (z t, * * . , z nP = )9 ( 2 1 , * . . , t n ) = Y
We pass to the induction step. Assume that (3.29) holds for all and y in N. We shall prove the equivalence
,...,z",z,+*,
tl
P(21,*,zn,SUCC(%,+I)) = Y
.?+F l " + l ) ( Z l
If then
,...,z,,succ
(2,+1))
=y
a
111
Chapter 2
4 (21r".,Zn,Zn+l,d(21,".,zn,Zn+1))
=Y
Consequently, we can fmd a natural number z satisfying the following two conditions: =z
4(21,".,Z,,2,+1)
(3.35)
9
fl(z1,**,G+n+1,z)= Y
(3.36)
*
Using the general and induction hypotheses we derive successively: TI Fp+')(Zl,...,2,,2,+1) = 2 , (3.37)
t FJ(n+2)(21,...,2n,zn+1,Z)= Y ?l
Fj"+2)(Z1
An nfold application of
,...,u,,succ
FP+')(Ul
,...,2,,2,+l,Z)
9
.
=y
(3.38)
SR in the equation (u"+l))=F,(nf2)(u1,...,u,,u,+1, FP+''(ul,*,un,un+1)) 9
(which belongs to 3')yields
? E Fp+l)(zl, ...,2, ,succ (z,+l))'
(3.39)
,z,+1,
F,("+2)(21,:..,2,
Ft+1)(21,...,2,,2n+1))
.
Finally, from (3.37), (3.38), and (3.39), by twofold applications of
RR, we get 7
,...,2, ,succ (Zn+l))
Fl"+')(Z 1
=
Fj"+2)(21,...,2, ,z,+l,z)
,
and
F t + ' ) ( Z 1 ,...,z,, succ (2,+1)) = y
?I
.
(3.40)
For the converse implication we assume that (3.40) holds for all z1,...,Z,,Z,+~, and y in N,and we prove that 4(z1,...,z,,Succ (z,,+~))= y. Again, by analysis of the possible normal derivation of the equation
FP+')(Z1
,...,z,,succ
(Zn+l))
=y
,
we deduce the necessity of an (n+l)fold application of SR within the equation
,...,u, ,Succ (Un+J)
F t + 1 ) (u 1
=
F,("+2)(u ,...,u,
,u, +1,
+')(ul,vun,un+1))
A similar argument (baaed on the construction of T and the induction hypothesis) ensures the existence of a natural number a such that
112
Calude
and
3
Remark. From Lemmas (3.13) and (3.14) it easily follows that all primitive recursive functions are equationally computable.
(8.15) Lemma. Let n > 0 be a natural number and let g:W" + P J be an equationally computable (total) function. Then, the partial function 6 : P 3 N obtained by minimieation from g is also equationally computable. Proof. Before beginning the proof we stress that g is total. We introduce the auxiliary function h : W t ' N defined by primitive recursion as follows:
.
h ( ~ l l . . . l ~ n= l o )1
,
h (Zl,.*,Zn,y+1) = sg(g(z i,..*lzn ,y)).h (z1,.~zn ,Y)
*
The (total) function h is, by Lemmas (3.14), (3.15), equationally computable. Furthermore, for all natural numbers zl,...,z,, y we have:
i
0 .( ll***,tn $ 8 )= 1
,
if g(zlr...,z,,,z)=O,for some z < y ,
,
Let W be a fmite set of equations defining h , with F,("+') an principal partial function symbol. Let j and k be two natural numbers satisfying the inequalities j > k > i . We define a new set of equations ? b y taking the union of U and the set
113
Chapter 2
(3.41) ,...,u, ,u ), F?+')(~,,...,u,,succ( u ) ) , u ) , ~ l ~ ) ( i , = o ,u~) ) . We shall prove that for all natural numbers zl, ...,z,, y we have: 4(z1,...,z,) = y w ?+ F,(")(zl,...,z,) = y . If 4(z1,...,2,) = y, then h(zl,...,z,,~)= 1, and h ( z l,...,z,,
{F,(")(u 1,...,?in )
Succ (y))
= 0.
=
FA3)(Fi("+I)(
u1
Consequently,
x t Fi("+1)(Zl ,...,z,,y)
,
= 1
(3.42)
and ,r(
I
Fj"+')(Z1 ,...,z,, succ (y))
=0
.
(3.43)
Using (3.41) we deduce the relation
+ F,(")(ul,...,
u,) =
F~~)(F,I"+')(U~ ,...,u , , ~ ) , Fp+l)(Ul,...,u,, succ ( u ) ) , u ) ,
which by (n+ 1) substitutions gives
,7tF,(")(Zl ,...,2,) = Fp(Fi("+')(zl, ...,z,,y),
Fj"fl)(z1,...,z,, succ (y)),y)
(3.44)
.
Sine U c 7 we can use twice RR; hence, from (3.44), (3.42), and (3.43) we deduce
.TI F , ( " ) (,..., ~ ~z,)
=
~i~)(i,o,~) .
(3.45)
Finally, from the relation
.~t
~ i ~ ) ( 1 , 0= , 4u
,
we obtain, by SR, the relation
TI Fi3)(1,0,Y) = which gives (from (3.45), by RR): TI Fp(z1, .+)
Y
9
=y
.
(3.48)
Conversely, if (3.48) holds, then a similar reasoning as in the proofs of L e m m a (3.13) and (3.14) produces successively the relations:
TITI
Fi("fl)(Z1
Fj"+1)(Zl
,...,t,,y)
= 1
,
,...,z,, succ (g)) = 0 ,
114
Caludc
N )I
...,zn,y) = 1 ,
F,lnfl)(zl,
+ F,l"+')(ZI ,...,z,, Succ (y)) = 0 .
Consequently, h ( z ,,...,z,,y) = 1, and prove that d(z,, ...,2 , ) = y .
h ( z ,,...,z,, Succ (y)) = 0 , which 0
(8.16) Theorem. Every p.r. function is equationally computable. Proof. We proceed inductively upon the defmition of the class of p.r. functions. The base functions are equationally computable. For, the constant function C 2 ) : W + UV is defmed by the equation F ~ ) ( ,,..., u u,,)
=
m
,
RV is defined by the equation Fp(U,,...,u,) = ui , and the successor function Succ : N IV is simply defined by the equa
the projection function @"):W +
4
tion
F[')(u,)
=
SUCC(U,)
.
The closure under functional composition, primitive recursion and minimiration follows from Lemmas (3.13), (3.14), and (3.15). 0
The proof of the converse of Theorem (3.16) will employ a suitable arithmetisation. Our fvst aim is to embed the class of all fmite sets of equations in a primitive recursive subset of N ,and to show that the equations and derivations can be handled by suitable primitive recursive functions. The arithmetiaation process will be described "by stages", following the construction of equations. Temporarily we return to the formal language developed in the beginning of the section.
A) Arithmetization of variables. To every variable ui, i 2 1, we assign the GODEL number
.
=2i1
B) Arithmetizotion of further terms. We start with < 0 > = 2 and we assign inductively
,
Chapter 2
< SUCC( t ) >
115
= 2.3‘’’
,
for every term t , and
< Fp)(tl,...,t , ) >
= pn(o)’+’*pn(l) ...pn ( n ) 1
...,
for all natural numbers i , n 2 1, and all terms tl, t,.
Remark. The arithmetisation of numerals begins with:
,
2
< i > = 2.3 = 232 , < > = 2.3 = 2.32.3’ a.s.0. Again, the identification of
ti
and n will produce no confusion.
C) Arithmetization of formal equatione. If t l and t , are terms, then the GODEL number of the formal equation t l = t 2 is
=J(,)
.
D) Arithmetization of finite sete of formal equatione. To a finite set of (rn t 1) formal equations ewe 1 9  * . , ~ n I
?
we assign the GODEL number
< e,,el ,...,em >
= pn(0)
<e,> *
pn(l)<el’...pn(m)
<em
>
Remarks. a) In our arithmetisation the equation e and the singleton { e } have distinct GODEL numbers.
b) The arithmetieation acts injectively on the set of t e r m (reapectively, on the set of formal equations). c) There is no “intrinsic” way of determining, for a given GODEL number, whether it represents a term, or a formal equation, or a finite set of formal equations. This is the consequence of arithmetkation lacking “global injectivity”. (8.17) Example. A simple computation shows that
< F P ) ( U 1 ) = Fp)(Fp)(ul))>
116
Caludc
=
J( , < F \ ' ) ( F [ ' ) ( u ~ > ) ))
= J(2'.3,2
2
.
* 321.3)
n Next we are going to prove the primitive recursiveness of a series of useful functions involving equations, derivations, and their GODEL numbers.

Consider the functions gn :N+ N , Val :N gn(m) =
K.
fi given by
,
m >;
and
1
if m = < t i > , for some natural number
,
(n
ual(m) = m + l
,
n,
otherwise.
(8.18) Lemma. The functions gn and val are primitive recursive.
Proof. It is easily seen that P(0)= 2 gn(rnt1) = 2
*
7
3"(m)
,
so, gn is primitive recursive.
The correctness of the above definition of val is a consequence of the injectivity of gn. Moreover, ua/(m) = pnign(n) = mi m
,
for every natural number m, which completes the proof. 3
Furthermore we introduce a sequence of unary predicates defined as follows: 1
I
,
1
= 0
if
z
is the GODEL number of some variable,
, if z is the GODEL number of some numeral, , otherwise, 1,
if
t
is the GODEL number of some term,
117
Chapter 2
1
,
if z is the GODEL number of some formal equation,
,
if z is the GODEL number of some fmite set of formal equations, GN(z) = 0 , otherwise. 1
(8.19) Lemma. The predicates Vur, N u n , Tern, Eq, and tive recursive.
GN are primi
Proof. It is seen that
,
Var(z) = eq(2[z/2]+l,z)
and a
Num(z) = C e q ( g n ( z ) , z )
9
z=O
for every z in gn(4
Hv (for the last formula we have used the obvious inequality:
> 2).
An analysis of the inductive definition of the terms gives the equivalence Term(z) = 1 H
i) Vur(z) = 1, or ii) z = 2, or
iii)
z = 2.3‘, for some natural number z
< z,
for which Term(z) = 1, or ‘...p n(n)l”, for some natural
iv) z = pn(0)’ * p
> 1, and zl, ...,2, < z , for which Term(zj) = 1, for every 1 5 j 5 n .
numbers i
Consequently, the following courseofvalues recursion defines Term: Term(0) = 0
,
Term (z+ 1) = Vur (z+ l)+eq(z+ 1,2)+eq(Zong(z+l),l)
 eq(ezp(o,z+ 1),1).Term (czp(l,z+1))
Cdudc
118
i= I
For the predicate Eq we can immediately write the formula:
Eq(z)= Term(Kti)).Term(L(z)), for all z in RV. Finally, for all natural numbers z we have:
fi
/on a)
GN
(2)
=
&(ew(k,z))
.
k 4


; I
We continue with other four functions, namely: term8ub:JV3 N 1 Sub :A@ {0,1}, and Rep :N3.c {OJ},given, respectively, for all natural numbers i , j , and k as follows:
1 I
= j , and
< t" > = k,
I
1 , if i and j are, respectively, the
GODEL
numbers of some equations e l and e2,
Sub(i,j) =
'
and e follows from e by SR, 0 , otherwise,
1 , if i , j l and k are, respectively, the GODEL numbers of some equations el,e2, and e 3 ,
Rep(i,j,k)=
'
and e 3 is obtained from e l , and e 2 by RR, 0 , otherwise.
\
(8.20) Lemma. The functions termsub, Sub, and Rep are primitive recursive.
Proof. An examination of the defuition of SR shows that for all i,j,k in JV we have:
119
Chapter 2
,
termeub(i,j,o) = 0
termsul(i,j,k+l) = i , if j = k + l and Tcrm(i)=Tcrm(j)=l, = k+l,
if j#k+l,Tcrm(i)=Tcrm(j)=l,
and (Va?(k+l)=l or k + l = 2 ) , =
h ( i , j , k ) ,if j#k+ l,Tcrrn(i)=Tern(j)=
Tcrm(k+l)=l,Var(t+l)=O, and k+ l f 2 , =0
,
otherwise,
where
The predicate Su6 can be expressed by the formula: '
Sub(i,j) =
c i
Eq(i).Eq(j)*(C Nurn(n)*Var(m) n=O m=O *
eq(K(j),termeub(n,m& ( i ) ) )
 eq (L(j),termsu6.(
tm
J (i))))
9
for all i , j in N. (Notice that the bounds on the sum operators follow from the fact that the GODEL number of a variable cannot exceed the GODEL number of the equation in which the variable occurs.) Finally we note that for all natural numbers i , j and k, we have: R e p ( i , j , k ) = 1 w (there exist three equations e l , c2, and c 3 such that < e l > = i, <e2> = j, and <eS> = k, and c s is obtained, by RR,from e l and e2) w there exists an equation c and a variable w not appearing in e l and e 2 such that: i) e l is obtained by replacing every occurrence of w in e by the lefthand side of c2, ii) c 3 is obtained by replacing every occurrence of w in e by the righthand side of e2. Now we can take w to be the variable ui+j+k+l, i.e. <w>
= 2(i+ j+k) A 1
Clearly, w is a new variable and we can write: Rep (i ,j,k)=M i ) .&(d*
WA)
'
.
120
Calude
. ~ ~ ) E g ( . 1 . ) . e q ( K ( i ) , t c r r n (aK u b( j ) , <w >, K ( z ) ) ) .=O
>,L(z))) eq ( K ( k),ternsub( L(i), <w > N z ) ) ) eq(L(i),termsub(K(j),<w
where H : N 3 mula

 ee(L(k),tcrmsub(L(j),<w>C(z)))) , N is the primitive recursive function given by the for
H ( i ,j,k) = k+./(tcrrnsub( < w > ,L(j),K(k)),tcrrnsub(< w > , L ( j ) , L ( k ) ) )
.
(In establishing the bound H we have used the monotonicity of the functions pz (p 2 2) and J(z,y), and the fact that the equation e can be obtained from the equation with the GODEL number k by making certain substitutions of the lefthand side of the equation with the GODEL number j,for w . ) The above formulas ensure the primitive recursiveness of the announced functions. 0
(3.21)
Lemma.
gr8ymb:N
recursive function a fmite set of greymb(i) is the greatest index of a partial function symbol
4
There
exists
a
primitive
N such that for every GODEL number i of
equations 5, appearing in E.

Proof. By means of a courseofvalues recursion we defme the primitive N, recursive function g : N
g(i+l) =
121
Chapter 2
(8.22) Theorem. Every equationally computable partial function is par
tial recursive.
> 0 be a natural number and let +:A"' be a partial function. Assume that is equationally computable by means of the fmite set of equations k' with F!") as principal partial function symbol. If j = <E>, then i = greymb(j). Proof. Let n
+
We shall defme two auxiliary predicates which turn out to be primitive recursive D S j : N + {O,l}? Derj:RV+' c { O J } ? 1
,
DSj(z) =
if z is the GODEL number of an equation of k‘
l
1 , if z is the GODEL number of a fmite
sequence of equations from which an equation of the form F!n)(zl,...,z,, =) m ,
Derj(z lr...,z,,z) = 0
,
for some rn in otherwise.
N,is derivable (in l),
It is seen that for every natural number z , (3.47) k=O
which shows that DS, is primitive recursive. To derive a primitive recursive description for Derj we fwst notice that Derj(zl,...,z,,z) = 1 iff GN(z) = 1 and i) each exponent in the prime decomposition of z is the GODEL number of an equation in f, or is derivable from an equation whose GODEL number is an earlier exponent of z , by SR,or is derivable from two equations whose GODEL numbers are earlier exponents of z , by RR, and ii) the last nonaero exponent in the prime decomposition of z is the GODEL number of an equation of the form
Fi(”)(zl, ...,z,) = rn
,
for some natural number rn. We “translate” into formulas the above defmition and we obtain:
Caludc
122
.eq(Zong(K(ezp(long(z),z))),n) n
j n e q ( e z P (',K(CZP ( h d z ) , z ) ) ) , g n
(zr
111
r=i
.eq(czp(O~(ezp(fong(z),z),grsymb(j)+l).gt(grsyrnb(j),O)
Nurn(L(ezp(long(z),z)))
.
Hence Derj is primitive recursive. (Notice that Dcrj depends upon n *)
In view of the equivalences: ti+,,
H
...,2 , )
=m
* f I
F/")(zl,...,z,)
=
m
Derj(zl,...,z , , z ) = 1 , for some natural number z
,
we can defme the p.r. function
R,:W
am
1
by the formula
Rj(zl,...J,) = F z [ D e r j ( z,..., l t,,z) = 11
.
(3.49)
It is worth noticing that if R j(zl,...,z,) # q then R j(zl,...,z,) gives the fvst GODEL number of a derivation of the equation qi(zl, ...,z,) = rn (for some natural number rn) from f. Finally, consider the p.r. function
W:p LbBV
WI
,
d e f i e d by 4
...,=,,I = ual(L(czp(Iong(Rj(zl,...,z, 11, R j(z 1,***+n1))) .
cJ jn)(z1,
for all zl,. ..,z, in Bv. Since it is obvious that I$ = a p.r. function.
(3.50)
W)"), it follows that I$
is 0
123
Chapter 2
Remark. From Theorems (3.16) and (3.22) it follows that the class of p.r. functions coincides with the class of equationally computable partial functions. Consequently, the temporary name “equationally computable partial function” will be replaced, in what follows, by p.r. function.
We are now ready to defme a deep notion in the study of computability and complexity. For every natural number j, we defme the p.r. function
wy:N4N , by (“”(z)
, if GN(j) = 1 ,
w1(1)(z) = 00,
for every z in
N. For every
(3.51)
otherwise,
> 1, we define the p.r. w p : w3N , n
function
...,2 , ) = w j”(J’”)(zl, ...,z.)) ,
w P)(z1,
(3.52)
for all zl, ...,2, in IV.
(WY))~~
The sequence constitutes an enumeration of all unary p.r. functions (see Theorem (3.22)). Furthermore, since every p.r. function of n variables can be obtained by functional compoqition from a certain unary p.r. function and the CANTOR primitive recursive bijection, it folis an enumeration of all p.r. functions of n variables. lows that The following two theorems establish the basic properties of this enumeration.
(WP))~~
(8.28) Theorem. (Enumeration Theorem) There exists a natural number univ such that for every natural number n 2 1, we have
(3.53)
for all natural numbers j , z l ,...,2,. (The p.r. function w&L1) is called an universal partial recursive function for the class of p.r. functions of n variables.)
Proof. Firstly we deal with the case
n = 1. We consider the primitive recursive predicates D S : N 2 .* {OJ}, Der :RV3 + {0,1} defmed by DS(j,z) = DSj(z), D c r (j , z , z ) = D e r j ( z , z ) , for all natural numbers j and z (see in thi respect the formulas (3.47) and (3.48)).
Next we use the p.r. function n = 1):
fl:wa N
given by (3.49) (with
124
Cdude
n(j,z)= pz[l)cr(j,z,a) for all j and
2
= 11
,
(3.54)
in N, in order to comtruct the p.r. function U:# A N
by
for all natural numbers j and z. Clearly, in view of (3.50) and (3.51), for all j and z in N, ',z)= w ~ ) ( z ) . Since U is a p.r. function it follows that U = L(hiJt)= U(K(t),.L(t))),for nome natural number uniw. This proves (3.53), for I) = 1.
wZi,,
Finally we shall show that the above natural number uniu abo works > 1. Indeed, for all natural numbers j,zl, z, we have:
...,
in the caw n
Wj")(Z1,".,Z,)
= wj"(J'")(z1,
...,
2,))
wEi,(j,J(")(zl ,...,z,)) = w ~ J J j,dn)(z ( ,..., = w ci,(J'"")( j,zl ,...,zn)) = ukL1)(j,zl ,...,2,) . =
2,)))
(Wehare w d , in order, formulaa (3.52), (3.53), (for n
= l), and again (3.62), the defiiition of CANTOR'S bijection and formula (3.52).) 0
The next property involves the functional composition. Our aim is
to uee L e m m a (3.13). The following technical lemma assures that we can dways replace, in a primitive recursive way, every pair of fmite sets of equations by an equivalent pair of fmite sets of equations which have no common partial function symbols.
Lemma. There exists a primitive recursive function tranr:H .,N having the following property. For all fmite sets of equations E and 7 there exists a fmite set of equations 7' having the following three properties: (8.24)
3' and E have no common partial function symbob, 7' computes the same partid function as 7 , 01)
f*(z+l)= p ( f ( z + l ) ,
f
rar[P(f(z+l),d > f*(41)
*
Clearly f* satisfies (4.21) and (4.22). 5
We close this section with the announced effective equivalence between two arbitrary acceptable g6delisations. This theorem is known as the ROGERS Ieomorphiem Theorem. Our proof (an that in MACHTEY and YOUNG [1978]) is essentially a constructive version of the settheoretical CANTORBERNSTEIN Theorem (see MALITZ [1979]).
142
Calude
(ROGERS (19581) For every acceptable g6delisations (dj"') and (@I)we can effectively find a recursive bijection f:RV + N
(4.14) Theorem.
such that
dl)= @$*)
(4.23)
t
for every z in N .
Proof. Lemma (4.13) effectively furnishes two recursive functions h :RV 3 UV, g :RV + N , satisfying condition (4.21) and
4y
= #*)
=
1
4g)
9
for every natural z. Recall that for every (recursive) function r : N c have been defined by the formulas: r O ( z )= z
,
ri+'(z) = r(ri(z))
IN,the iterates
ri
,
for all natural numbers i and z. For every natural number i , put
,
A(') = (goh)' ( N  r a n g e f g ) ) and
B
30
=
UA(')
.
i4
We shall prove that the function
F:N given by
F ( z )=
.
range(g)
,
{iy) >
ifz € B ifzEB, ?
is a recursive bijection.
a) F i8 recursive. In view of the property (4.21) of h and g it follows that for all natural numbers i and z,if i > z,then z 6! A(')(because the smallest element in A(') i greater than (qoh)(')(O)2 i > z). Consequently, for every z in Nl
zEl3
tj
z € A ( ' ) ,for some i
We consider the recursive function G : @ tive recursion as follows:
_< z *
,
(4.24)
(0,l) defmed by primi
143
Chapter 2
A routine verifkation shows that 1 , ifz € A ( ' ) ,
G(z,i)=
0
, if z 4 A(').
In view of (4.24) it follows that for every z in
N,
F ( z ) = g ( h ( z ) ) . B g ( C G ( z , i ) ) + Z ' ~ ( ~ G ( z ., i ) ) i=o
i=O
b) F i e bijective. We begin with the injectivity. Assume that z and y are distinct natural numbers. Four cases may occur:
i) both z and y are in B. In this case F ( z ) = g ( h ( z ) )f g(h(y)) = F ( g ) , by the injectivity of g and h (a consequence of (4.21));
ii) neither z nor y are in B. 2 f
This situation is clear: F ( z ) =
Y = F(Y);
iii) z is in B, but y is not in B. We notice that ( g o h ) ( z )ia also in E , consequently, F ( z ) = ( g o h ) ( z )# y = F(y); iv) The symmetrical last case is obvious.
The function F is also surjective. Only the nontrivial case E B n range(g) must be analysed. There exists a natural number i > 0 such that y €A(') (y 6 A(")= Nrange(g)). Consequently, y = (goh)(z), for some z €A('') c B , i.e. ~ ( z =) ( g o h ) ( z )= y. Finally, we use the inverse of the recursive bijection y
g:N .* range(g) to defme the recursive bijection
f:N+IN, by
,
144
Calude
which, obviously, fulfills (4.23).
Final Comment. Arithmetization turns out to be the most important method of establishing the equivalence between various classes of “computable’’ partial functions and the class of p.r. functions. The reader interested in other methods for defining the class of p.r. functions is referred to KLEENE [1952], DAVIS !1958] (for the standard TURING characterization), SHEPHERDSON and STURGIS [1963], BRAINERD and LANDWEBER [1974], KFOURY, MOLL and ARBEB I19821 (for a programmingoriented characterization), HENNIE [1977] (for various types of TURING machines), MACHTEY and YOUNG [I9781 (for RAM and ?dARKOV characterizations).
2.5. RECURSIVELY ENUMERABLE SETS
In this section we shall study the class of p.r. functions by means of p.r. characteristic functions, i.e. by means of a special class of sets of
natural numbers. (5.1) Definition. A set A c IV is recursive if it possesses a recursive characteristic function, i.e. if the function xA:m

i0,l)
1
such that 11, i f z E A , XA(z)
= 10
, if z E A ,
is recursive. Intuitively, the set A is recursive if the membership problem for A can be algorithmically solved.
145
Chapter 2
(6.2) Example. The following sets are recursive: i) The sets 0 and N. ii) Every primitive recursive set is recursive. (Notice that the converse implication fails to hold!) iii) The set {z EN J f ( y )= z,for some y 5 z), where f :IN ..c N is a faed recursive function. iv) The range of the primitive recursive function 2'. 0
Theorem. (CHURCH [1936]) Let (4!n)) be an acceptable gGdeliration. Then the set (6.S)
1
,
K=(xERq4,(z)Z4
(5.1)
is not recursive. ri

Proof. Assume, for the sake of a contradiction, that K is recursive and denote by diag its characteristic function, i.e. diag:lN 1
, if dz(z)#
{OJ},
20,
Let m be an index for the restriction of diag, p d i a g ( z ) = 00. A routine verification shows that for every x E N ,
30,
for
(5,(z) #
pdiag(z) = 0 +=+ r$'(z) =
00
,
which, in particular for z = m, gives the contradictory equivalence pdiag(n) #
00
+=+ 4,(m) =
00
.
Remark. The function diag used in the proof of Theorem (5.3) is an example of nonrecursive function (predicate). (6.4) Proposition. The class of recursive sets forms a Boolean algebra with respect to the settheoretic operations.
Proof. Obvious.
148
Calude

(6.5) Definitton. A set A C N is recursively enumerable (shortly, r.e.) if either A = 13,or there exists a recursive function f ;A? N , such that A = range(!). Intuitively, a set A c N is r.e. if there is an algorithm which lists the elements of A (with possible repetitions).
The function f is called an enumerating function for the set A.
Comment. The recursive sets are also called decidable (soh~able), and the r.e. sets are also called partially decidable (solvable). Here is the motivb tion of these terms. Clearly, the membership problem for a recursive set is algorithmically decidable. To decide if m E IV belongs to a r.e. set A [enumerated by f ) we generate the elements f(O), f ( l )...,f( , n), until we reach an n, such that f ( n ) = m. This method is partial because it never lets us decide whether an arbitrarily given m does not belong to A. More formally, the semicharacteristic function of A, i.e. the partial function h :Bv 4{ l ) ,
...
1, ifzEA,
h ( z ) = m , otherwise, is a p.r. function since for all z in
N ,h ( z ) = s g ( l + ~ y [ f ( y )= zi).
(6.6) Theorem. Every recursive set is r.e.
Proof. If A =
,a,then A is r.e. (by definition).
xA be the recursive characteristic function function f :IN ., N , by primitive recursion. f(0) = PYLXA(Y)= 1!
In the opposite case, let Define the recursive
of A.
9
f ( z + l ) = PY[xA(Y) = I and
f(z) < g1
in case A is infinite, and a,
ifz !I(%)and XA(Y) = 11
*
From the infmity of A and the construction of g, it follows that g is in fact recursive. Moreover, g satisfies both properties (5.2) and (5.3). Conversely, assume &at the set A is r.e. in increasing order by
148
Caludc
means of the recursive function g. For every x in
x
N,
.
E range(x) w x E { O , 1 , ...,g(x)}
Hence, the characteristic function of A , x A : N+ { O , l } , can be d e f i e d by I:
XAk) = h(z,g(i))
*
i=O
This formula shows that A is recursive. cl
(6.10)Theorem. Every infinite r.e. set has an infinite recursive subset. Proof. Let A be an infinite r.e. set enumerated by the recursive function
f:N+lN. Define the p.r. function g:N
a N ,by primitive
g(0) = f ( 0 )
9(z+l) =
recursion
I
f ( C c Y [ f ( Y ) > g(41)
*
From the infinity of range(f) and the construction, it follows that g is recursive and increasing. In view of Theorem (5.9) the set
B
= range(g)
CA
is also recursive. 0
(6.11) Lemma. Let
(+in))
be an acceptable gzdeliaation.
Then there
exists an index m such that
#m(x)= x for every x in
9
N.
Proof. Fiistly we shall prove the existence of the natural numbers
n and z such that #,(x) = x. For the sake of a contradiction, assume that & ( z ) z x,for all y , z EN. Let k be an index for the p.r. function (S.niul(t,z)+l.For z = k we have: #k(k) =
'#mi~,(ktk)+~ = +k(k)+l
9
a contradiction. Let n and x be such t ha t &(z) = by tion f :N
am,
x ) .
We construct the p.r. func
149
Chapter 2
f (Y 1 = AAmd) for all y in
N. Every index
m for
9
f works.
Remark. Again the proof of Lemma (5.11) is not constructive.
(6.12) Corollary. The universal p.r. function bi:ivi,, is not recursive. Proof. By Lemma (5.11), q5miul(m,z) = d,(z)
= .M 0
The following deep result gives a characterization of the r.e. sets in terms of the domains of p.r. functions.
(6.111) Theorem. 4 set A is r.e. iff A is the domain of an unary p.r. function. Proof. We shall use the acceptable g6delisation (up))and its associated timecomplexity (ai). We recall that the ternary predicate ni(z) 5 y is recursive (see Theorem (3.27)). The proof will use dovetailing computations. “a”If A = 0, then A = dom(wg)), where ug)ia the p.r. function supplied by Lemma (5.11). If A P 0,then A = range([), where f :IN + I?, is a recursive function. Then A = dom(f ), where f *:N4 N is given by f*(z)= f(py[f (y) = 21). ‘‘e” Assume that A = dom(w1’)) # 0.We define the p.r. functions T:IN 4 N and 7:Na N as follows:
Firstly we prove that r and 7 are total, hence recursive. Let z be the smallest element of A. By definition and Theorem (3.27), W ~ ( Z #) 00 and n,(z) # OQ Consequently y = max (z,n,(z)) 2 z, Rk(z) 5 y, and r(0) # OQ Moreover, 7(0) = z < OQ In case T ( i ) # 04 ~ (#i04 ) for
150
Caludc
i E {O,l, ...,t ) ,then T ( t l 1 ) # % a nd r ( z + l ) # xi Secondly, we show that dom(wp)) = range(7). If t Erange(r), then t = ~ ( y ) ,for some y in N. If y = 0, then t = 7(O) € A . If y > 0 and 7 ( Y ) * 7 ( 0 ) ,then f l k ( t ) = nk(r(g)) 2 r(Y) < x\ so w k ( t ) f cxz To prove the inclusion dom(w1') c range(r), we write dom(wpl) = [ t l , t , ,...}, ordered by the following (dovetailing) rule: for 1 5 i < j, (n,(ti) < nk(tj)) or (fl,(ti) = n , ( t j ) and ti < t i ) . An examination of the defmitions of I' and 7 shows that "(0) = f l k ( t 1 ) and 7(O)= t l (notice that fl,(z) 2 z, for all naturals z). Assume now that t l = ~ ( 0=) 7(ul), t , = ~ ( u ,..., . ~ )t i = 7(ui), 0 = u 1 5 u2 0,

i4
is clearly recursive. Consequently, by Theorem (5.9), there exists an increasing recursive function g:N + RV, which enumerates the infmite = I}. Next we defme the recursive function recursive set {z EN I.() f *:N 4 IV by composition: f *(z) = f (g(z)), for every z E N. Clearly, range(f*) C range(f); moreover, if t = f (z), for some z in N ,then t = f(z),
where
z = pyif (z)= f(y)]
r(z) = 1,
and
i.e.
I
range( f ) c range( f *). The restriction of f to the range of g is injective. For, if t1,t2 Erange(g), t l < t2, and f ( t J = f(t2), then r(t2) = 0, i.e. t , 4 range(g). Consequently, f ia injective. U
Remark. From Theorems (5.14)and (5.18) it follows the existence of two recursive functions
f,:RV+N,
,
f2:N,RV
such that for every natural number z, range(dfl(,)) = dom(4,)
,
is injective and
dom(q5fl(zj)is an initial segment of
PJ
(i.e. has one of the following three forms: (21, (O,l, n
1561
...,a}, or RV, for some
EN), range(b,,(,))
=
range(4,)
, df,c,, is injective
dom(6,2(z)) is an initial segment of
N
.
and
(5.7)
154
Calude
(6.19) Definition. Put Wi = range(4j')).
The sequence ( W i l i W will be
the standard enumeration of all r.e. sets.
Remark. In view of Padding Lemma (4.12) it follows that every r.e. set has an infmity of indices.

(6.20) Theorem. There exist four recursive functions im
,
preim
,
ioin
,
meet : N 2
N
,
such that the following equalities hold for all natural numbers i and j:
6iWj) = wia(i,jl
(5.8)
1
di'(Wj) = Wpcia(i,j)
(5.9)
9
wi u wj = Wj&m(i,jl wi n Wj = w m c c t ( i , j )
(5.10)
7
(5.11)
*
Proof. In view of the equality
wj>
+i(Wj) = {+i(z) 12 E Wi
N by
we can defme the p.r. function B : N 3
8 (i, j,z) =
4i (z).ag($i (z)+4 j(z)+ 1) Oi(z) , if 4i(z) z 03 and 4,(z) z oc,
r
7
30,
otherwise.
By a standard 8mn construction we get the recursive function c RV, satisfying the equation
:ov?
#r(i,j)(z) =
fl(i,j,z)
(5.12)
(r(i,j) = ~ f ( r n , a , j )where , rn is an index for B .)
We have: Y
E Si(Wj)
bi(z) z x b , ( z ) # 7
#r(i,j)(z) = y
Y Y
33
9
and
, for some z in RV
E range(4r(i,j)) E Wg(r(i,j))
,
9
9
where g b the recursive function furnished by Theorem (5.14) (formula (5.5)). Consequently, the recursive function
155
Chapter 2
it4,j)= dr(i,j))
)
satisfies (5.8).
To prove (5.9) it is sufficient to notice the formula We have:
Consequently,
.
p r ei m ( i , j ) = c o n p ( j , i )
The formula (5.10) can be deduced from the p.r.
function
$ : N 33 IN, given by $ ( i , j , z )=

Again by a standard N ,such that
pin:fl
i
1
if di(z) z
30,
otherwise.
8mn
CO
or bj(z) z 00
construction we get a recursive function
cbjoin(i,j)(Z)
= +G,j,Z)
9
for all natural numbers a , j , and z. From the construction it follows that pan satisfies (5.10). Finally, it is easy to see that the formula (5.11) works for the function m e e t ( i , j )= r ( i , j ) (i.e. the function satisfying (5.12)). 0
We continue with the extension of the notion of recursive enumerability to kary relations. (6.21) Definition. A subset R merable (r.e.) if the set
R
c N k (k 2 2)
is called recursively
,...,Zk) I(Z1)...,Z l j f R) c Hv ,
= {JqZI
enu
(5.13)
is r.e. The subset R c N k is recursive if its characteristic function is recursive, i.e. iff R and N”  R are both r.e.
Notation. As usual we shall abbreviate the relation
(21,
...,2 k ) E R
by
R(zb,zk)
The next result, known as the Graph Theorem, relates the partial recursiveness of a function and the recursive enumerability of its graph (thought aa a binary relation).
156
Caludc
(5.22) Theorem. A partial function
is partial recursive iff its graph is r.e.
Proof. Recall that Graph($) = {(z,$(z)) 12 E dom(4)). “a”If (I is a p.r. function, then tl, = di, for some a E N . Conseque n t ly ,
a ( 4 )= { J ( Z , 4 ( 4 ) 12 E dom(4)) = {+m(z)
=
Iz E wi)
#,(W;)
= Wim(m,i)
7
where m is an index for the p.r. function J o ( F $ ’ ) , d i ) . ‘‘e” Let k be such that wk
1%
= rJ(zi$(z))
Edom(4))
f
@
The partial function tl, can be expressed now as tl,(z) = L ( o ( r j I z = K(g(j))l))
where g : I N * N ,is a recursive function which enumerates wk. Indeed, if there exists a natural number j such that z = K ( g ( j ) ) ,say the smallest possible, then tl,(z) F 10, 2) = L ( o ( j ) ) and J(z,+)) = J ( K ( g ( j ) ) J ( o ( j ) )=) g ( j ) E Wt = rap ($1 Conversely, if 2 K M j ) ) , for all j E N ,then J ( z , y ) W,, for every y in I N , i.e. $(z) = ‘x
&
U
Remark. Notice that Graph($) may not be recursive; for example, the ) ie x). Following ROGERS !1967], this is the reason for set ( ( 2 , ~ [q5=(z) calling partial recursive functions (and not “recursive partial functions”) those partial functions satisfying Theorem (5.22). (6.28)
,,...,
c RV’, k 2 2, 15 i 5 k. The set ,...,z t ) IR(z,,...,zi, ...,q),for some zi E I N } is called the pro
Definition.
((2
jection of
Let
R
R along the i t h coordinate.
(5.24) Theorem. Every r.e. set R recursive set s c IN’+’.
c N’ (k 2 1) in a projection
of some
157
Chapter 2
Proof. We use the acceptable gGdelisation (up)).Assume that R is r.e. Let +:NA N be a p.r. function such that dom(+) = R (see (5.13)). Fm an index m for 4 : ~ : )= $. We have: w , , , ( J k ) ( z l , . . . , z k ) )z x
R(zl,..,zt) t)
R,,,(J(~)I(Z,
,...,z k ) )2 y , for some y
EN
.
The set = {(zl,"*ctk,zk+l)
Intn(~k)(zl~...vzk)) 5 zk+l)
7
is recursive and R is the projection of S along the ( k + l ) t h coordinate. 3
(6.26) Theorem. Every projection of an arbitrary r.e. set is also r.e.
Proof. h s u m e (see Theorem (5.24)) that the set R C N k can be obtained by projection of the r.e. set S along the (k+l) th coordinate arid Q c Nk' is the projection of R along the k t h coordinate. The p.r. function $:N3 EV given by
9(2 )
+ 1s(Ilkl) (z)'...,W .( 1 8( 2)& (41 )
= 8 g (1 Ir 2
7
has the following property: Q(zl ,...,t
,...,qJ)Z = , dk')(z1 ,...,zkJ Edam($) .
~ w~t6(J'(k')(zl )
w
In view of Theorem (5.13) and Defmition (5.21), Q is r.e. 0
(6.26) Corollary. A set R recursive set s C N ~ + ' .
c Nk is r.e.
iff it is the projection of some
Proof. Directly from Theorems (5.24) and (5.25). 0
Comment. Theoreme.
Theorems
(5.24)
and (5.25)
are called the Rejection
(6.27) Example. The set
A = {z EN 17 Erange(4,))
,
is r.e. We express A as a projection (using also
ROGERS' Isomorphism).
158
Coludc
Let t : N + 6V be a recursive bijection such that
4;)
.
= U&)
We have: A = {z E N Id,(v) = 7 , for some y E N } = {z E
N
for some y and The relation S
I and d,(Y)
Ifh(.)(Y) t
in aV)
%(,)(!/)
5
9
.
c Nsdefined by I 2 and
S(Z,Y,Z) iff %(,)(Y)
is clearly
= 7
4(Y) = 7
9
recursive (for dom(4,) = dom(w;(.)) = dom(R,(,)) 2 < =we haye X f dZ(t!) = k n l V I ( W ) ) .
and
if
The set A can be obtained by projection of the recursive S along the coordinates 2 and 3. In view of Theorem (5.25), A 19 r.e. U
We close thia section with an explicitly encoding of the family of finite sets (of course, the frnite sets can be named in various ways, e.g. by an index in the enumeration of all r.e. sets or by an index of the characteristic function). (6.28) Definition. The canonical indcz of the nonempty finite set
A = (zI ,...,z,} C
N ,z 1 < z 2 o and the recursive bijection t :RV ., RV, furnished by g6delisation (w ROGERS’ Isomorphism Theorem.
i)),,,
Consider the p.r. function d
:w 4 PI given by
( + ( j ) 9 if nt(i)(i)> i otherwise,
9
= o=,
for all natural numbers i and j.
By an
8mn
construction we get a
165
Chapter 2
recarsive function f
:N
4
N such that d,(i)(j) = d ( i , j )
for all i and j in
N.
It is routine to check the validity of the following statements for every i E N: n
i E K H I$;(;) # .x,
5 j , for some j E N ,
w
w there exists a natural number j such that @,(i)(z)=
$(z) , for z
< j and I$,(i)(z)= 33, for z L j ,
e Graph(+,(i)) C Graph($) and dom($j(i)) is finite =+f ( i ) E N   I
9
and
w I$,(&)
=
=+ f ( i ) E I
$(z) , for every z in N
,
*
Consequently,
i.e. n
nv  K = fyI) . The last equality proves the fact that I is not r.e. 0
Remark. Notice that Theorems (6.7) and (6.11) can be used directly to obtain a Characterization of r.e. function index sets. (6.12) Corollary. The following function index sets satisfy the properties (6.5) and (6.6) of Theorem (6.11):
I,, = N  I ,
= {a'
EN
is total }
,
166
Cdudc
IN  I7 = {iE IN ldom(4i) is infmite } , 11, = IN  I, = { a E dV (range(q$) is infinite } , I,, = IN  llo= {iE IN irange(gi) = PI} , I17 =
I , = IV

I,,
= {iE
IN l+i is bijective }
.
Consequently they are not r.e. 0
C o m m e n t . The sets I,, I,, I, and I, as well as their complements are not r.e. In particular, the Totality Roblem (i.e. the problem of deciding whether an arbitrary p.r. function is total) is “more undecidable” than the Halting Problem. Indeed, the Halting Problem i s partially decidable (Example (5.16)) while the Totality Problem i s not. We close this section with a presentation of GODEL’s Incompleteness Theorem and some of its consequences. There are many ways to give a precise formulation of GODEL’s Incompleteness Theorem for formal theories (see also the CHAITIN version in Chapter 4). We begin with the motivation of the hypotheses used in Theorem (6.15). Let X be a fmite, nonempty set (the alphabet) and E ( X )c X* the set of wellformed “expressions” in X. Assume that two subsets of E(X) have somehow been defmed: a) The set of “syntactic deducible expressions” or “theorems” (i.e. the set of those expressions that can be deduced from the “set of axioms” by means of “deduction rules”).
b) The set of “true” expressions (Le. the set of expressions that are “true” according to a given “semantics”).
I t is natural to ask that every theorem be true (it is possible to prove only what is true), and the set of all theorems be consistent (i.e. free from contradictions), Finally, a minimal requirement for mathematical proofs is the following: it is possible to “mechanically” check that a sequence of wellformed expressions is a proof. This fact means that the set of all proofs is r.e. An a coneequence, the set of all theorems is r.e. (Here we made use of a “numbering”, i.e. a method for identifying the wellformed expressions with natural numbers in such a way that the syntactic operations are represented by recursive functions and the syntactic relations are represented by recursive or r.e. sets. In this way, the syntax is reduced to arithmetics. As an example, see the numbering of formal equations in Section 2.3. For a more detailed presentation see YASUHARA [1971], W I N [1977].) A formal theory satisfying the above requirements and which,
167
Chapter 2
additionally, is “sufficiently” rich, contains true expressions which are not syntactically deducible. This is the informal statement of GODEL’s Incompleteness result. We shall pass to the formal approach. (6.18) Definition. A GODEL (formal) theory ing the following four properties:
T is a formal theory hav
The theory T is recursively axiomatisable (i.e. the set of all theorems which can be inferred in T is r.e.)
.
T is consistent . All theorems deducible in T are semantically true (at The theory
the level of metalanguage) The theory
(6.8) (6.9)
.
T is rich enough to contain
the recursive function theory
(6.7)
(6.10)
.
Comment. PEANO arithmetic is an example of GODEL theory. (6.14) Definition. An wellformed statement P is said to be independent with respect to T if neither P nor the negation of P can be proved in T. (6.16) Theorem. (CALUDE and PAUN [1983]) Let T be a GODEL theory and let P:LN + (0,l) be a predicate expressible in T, subject to the following two conditions:
If for some natural i , P ( i ) = 1 , then there exists a natural z such that g5i(z) = x
.
If for some natural j, P ( j ) = 0 , then there exists a natural y such that ~ $ ~ (fy )x,
(6.11)
(6.12)
.
Here (di) is an acceptable giidelisation expressible in T. Under these circumstances we can effectively find a natural k such that P ( k ) = 1 and the statement “ P ( k )= 1” is independent of T.
Proof. In view of (6.7) it follows that the partial function given by
T:H aN
168
Caludc
T ( z , i )=
for all z and i in
I
1 , if there exists a proof in x ,otherwise,
T for “ P ( i ) =
1”
,
N ,is a p.r. function.
By an smn construction we find a recursive function f :Bv + N , such that #,(i)(z) = T(z,i), for all z and i in PI. The Recursion Theorem gives a natural number k such that
#&b) = +,(L)(Z)
1
for every z in N. We shall prove t ha t the statement “P(k) = 1’’ has the required properties. Firstly, P(k) = 1. Indeed, if by contradiction P ( k ) = 0, then by (6.12)there exists an z, such that d k ( z o )# oc. In view of the construction of the p.r. function T and of (6.9) we derive the relation ~ ( z , k=) q for for all z E I?. Putting z = z, we all z E N. Consequently, dL(z) = obtain a contradiction. Secondly we prove t ha t “ P ( k ) = 1” is not a theorem of T. For the sake of a contradiction assume the contrary, i.e. assume that “ P ( k )= 1” can be deduced by a proof in T. By construction we have: + k ( z ) = 7(27k)=
1
for all z N. Again we use (6.9) and we deduce that P(k) = 1; then, by (6.11) there exists an z, such t ha t # k ( z o = ) xs We have obtained a contradiction. Finally we show that the negation of the statement “P(k)= 1” cannot be a theorem in T. If, on the contrary, there exists a proof in T for = I”, then P(k)= 0 (by (6.9)). This the negation of the statement “P(k) contradicts the fvst conclusion of our proof.
a Comment. The predicate P is not recursive.
Some interesting particular cases can be displayed. (6.16) Corollary.
(HARTMANIS and
HOPCROFT [1976]) Let T be a + (0,l) be the predicate
GODEL theory and for each z in N let P , : N defmed by
1
,
iff$&) =
‘X,
Then we can effectively fmd a natural number k (depending upon z)such
169
Chapter 2
that
P,(k)= 1 and the statement “P,(k)=
1” is independent of
T,
Proof. Obviously Pz satisfies conditions (6.11) and (6.12) in Theorem (6.15). 0
Remark. Corollary (6.16) asserts that the Halting Problem has a true independent instance with respect to every GODEL formal theory. T h b result assures the existence of independent instances for a large class of undecidable problems in the theory of formal languages (see CALUDE and
PAUN [1983]).
(6.17) Corollary. Let T be a GODEL theory and let P:N the predicate defmed by
+ {O,l}
be
Then we can effectively find a natural number k such that P ( k ) = 1 and the statement “ P ( k )= 1” is independent of T.
Proof. If for some natural number i , P ( i ) = 1, then for all z, y in N , q+(z) # y, i.e. di(z) = .XL Conversely, if P ( i ) = 0, then there exists a
pair of natural numbers z and y satisfying the relation q5i(z) = y which means that di(z) # x The statement in the corollary follows directly from Theorem (6.15).
0
Remark. Corollary (6.17) asserts that the problem whether range(4j) = @, for an arbitrary natural number i , has a true independent instance with respect to every GODEL theory. (6.18) Corollary. Let T be a GODEL theory and let the predicate defmed by 1
,
P : N + {OJ} be
if di is total,
Then we can effectively find a natural number k such that P ( k ) = 0 and the statement “P(k)= 0” is independent of T.
170
Calude
Proof. The predicate P ( i )= G(P(i)) fulfds the hypotheses of Theorem (6.15). 0
The next result generalises both RICE’S Corollary (6.9) and Corollaries (6.17)  (6.18). It relies on corollary (6.16).
(6.19) Theorem. ( C U U D E [1983a]) Let I be a nonempty proper subset of LV which is a function index set and let T be a GODEL theory. Then we can effectively fmd a natural number k such that the problem “ k E I” is independent of T and d f ( z ) = x+for every z E R.
Proof. Let us suppose that m 4 I in case dom(4,) = @ (in the opposite case we replace I by its complement JV  I). Since I * 0 we can find a p.r. function 4, with m E I. We construct the p.r. function 4 : N 3 R by
4J(z,Y 1 2 ) =
4 m (z).sg(1+4* (Y)) 6 , ( 4 if d,(I!) f
1 
for all z , y and z in
1
1
otherwise,
m,
IN.
~n smn construction gives us a recursive function r : ~ + ’
N~
such that @ r ( ~ , y J ( ~=)
+(z?yiz)
7
for all z,ylzE N.
We shall prove that for all natural numbers z and €1
+,Y)
* 4*(d #
y,
(6.13)
*
indeed, if r ( z , y ) E I, then there exists a natural number
t
such that
+,(z,y)(z) # x (because, in view of the hypothesis, the totally undefmed
p.r. function has no index in the function index set I). Consequently, x
=
4r(*,y)(4 = +mk)
?
1.e.
+.(Y)
# 33

Conversely, if d,(y) f xj then dm(z) = $ ( z , y , a ) = 4r(Z,yl(z); we use the hypothesis (m is in the function index set I) and we deduce that ‘ ( Z , Y ) E 1. We are able t o use Corollary (6.18). For every natural number z there exists a natural number k (depending upon z)such that the problem
171
Chapter 2
“+t(z) =
“r(k,z)
x” is true but independent of T. In view of
(6.13), the problem
I” is true and independent of T (for every z E N).
AU it remains to prove ia that for the above pair dr(t,z)(y) = x
for every y E N. If for some y
(z,k),
9
E N,
h(t,Z)(d
f 03
f
then 4r(t,z)(z) = b m ( z )
9
for every z E N ,i.e.
dkk)
#
33
7
a contradiction.
Remark. The membership problem for every set I j , j E {1,2, ...,15}, has an independent instance with respect to every GODEL theory.
2.7. UNIFORMITY
Our aim is to distinguish between uniform and nonuniform results, i.e. between results for which effective proof procedures can be given and results for which such effective procedures do not exist. The proof of Theorem (5.6) (every recursive set is r.e.) was not constructive in the sense that the case the recursive set is fmite cannot be detected by an effective procedure. The opposite situation holds for Theorem (5.20) where the indices of the outputs can be obtained, by suitable recursive functions, from the indices of the inputs. For example, there is a recursive function p i n :@ 4 N such that
wi U wj = wjd,(i,j)
*
In this case we say that the result holds “uniformly”. Theorem (5.14) is a typical example of uniform result (it asserts that we can go uniformly from domains of p.r. functions to ranges of p.r. functions and vice versa). Our fvst result concerns the Boolean structure of the recursive sets
172
Caludc
class. Since every recursive set is r.e. (Theorem (5.6)) we can use the enumeration (Wi)i20 to name the recursive sets; such a name will be called r.e. indez. Theorem (5.20) asserts that the closure of the recursive sets class under union and intersection is uniform.
(7.1) Theorem. The closure of recursive sets under complementation is not uniform with respect to r.e. indices, i.e. there is no p.r. function v:lV 2 lV such that for every natural number i , if Wi is recursive, then v(i) F x and W*,) = IN  W,. Proof. We use again a dovetailing argument. Let (&I) be an acceptable gGdelzation and let ( w ! " ) ) be the acceptable gGdelisation given by the arithmetiration of equations. Let t : N + N be a recursive bijection, furnished by ROGERS' Isomorphism Theorem, such that $!') = u$), for every i E N . 3s
For the sake of a contradiction assume that a p.r. function $ exists, in the statement of the theorem. Let g:N
+
lV be a recursive function such that for all naturals
z
It follows that for every z E N ,
and y , ds(r)(y) = sg(l+c$.,,ig,(z,z)).
I
I@
I
JN,i f z ~ ~ ,
Ws(.)= dom(4,(z)) =
,
otherwise.
Hence, Ws(z) is recursive for every natural number w(g(2)) = x, for every z E N .
By the hypothesis,
2.
Since
N , otherwise, for every z E
N ,we can write the equality ri
PJ

K
= (2 €
We shall prove that lV 
N
IWflp(s))#
0)
*
1
K
is r.e., thus contradicting Theorem (5.3). 1
Indeed, by Theorem (5.25),
PJ  K
ia r.e. since {z C
N ILVH~[~)) #
. > I = 'lz E N I Y = v(g(z)) and wv f @ } = {z E N I Y = to(s(z)) and flc(,,)(z)5 w , for some I/,w and z in N ] . 3
173
Chapter 2
(7.2) Corollary. There is no p.r. function B :Na N such that for every natural number z , if W, is recursive, then d ( z ) # XI and
Proof. The existence of such a p.r. function 0 would contradict Theorem (7.1). 9
Remar ke. a) We can name each recursive set by the index of its characteristic function; we call this name the charucterietic indez of a recursive set. With respect to this system of names the closure under complementation is uniform. Moreover, we can go uniformly from the characteristic indices to r.e. indices, but, as Corollary (7.2) says, not vice versa. b) The reader can easily notice both the uniformity and the nonuniformity properties of earlier results. c) It is worth noticing that the proofs involving 8mn constructions and the Recursion Theorem ore uniform.
We close this section with a simple example of nonuniform operation. For every nonempty set A c lV denote by
A 3 = {n E IN In 2 z , for some z in A}
,
i.e. the fdter generated by A. Clearly AS is cofmite, hence (primitive) recursive. We shall prove that this operation b not uniform.

Notation. For every predicate h : N {OJ}, we denote by S, the set ( 2 EN I h ( z ) = 1). Let (&I) be an acceptable g6delisation. (7.8) Theorem. (CALUDE [1983b]) There is no p.r. function f :N3 N having the following property: For every recursive function di with infmite range we have:
f(i)f #,(i)
(7.1)
9
is a 01 valued recursive function
,
The proof of Theorem (7.3) will be divided into several steps. First we give two obvious results.
(74
174
Caiude
(7.4) Lemma. The p.r. function $:BV % N defmed by the formula
$(i) = p j [ d i ( j ) = 1 and (di(z)
x,z
5 dl
9
has the following property: For every natural i , such that di is a 01 valued recursive function, we have: $ ( i ) is the minimum element of S,; or,
(7.4)
,
equivalently, the minimum element of (S,,)9
, then
If S,, =
= 1 (that is
$(t)
+(a)
E Sbi)
(7.6) Lemma. The p.r. function B
e(i,z) =
(7.5)
# xand&($(i))
ri[di(j)+ 2
. :N2 4N
defmed by the formula
+
and (di(z)
=C,Z
L ill
9
has the following property: For all naturals i and z, such that 6i is a recursive function with infinite range and z E range(gii), we have: e ( i , z ) is the minimum element j
f
4i(t9(i,z))z z
z generated by di
,
(7.6)
.
(7.7)
(7.6) Lemma. There exists a recursive function s:N2 * N having the following property: For all naturals i and 2 , such that di is a recursive function with infmite range and z E range(gii):
d,(i,t) is recursive
,
range(d,(i,z)) = range(di)  {z)
(7.8) (7.9)
*
Proof. Let F : N 33 UV be the p.r. function defmed by the formula
di(d(i,z)) 9 if di(y) =
2
7
otherwise.
By a standard s  m  nconstruction we get a recursive function such that +a(i,z)(v)
for all i,
2,
and y in
= Ffi,z,y)
8
:I@
4
N,
7
N.
We shall prove that the above recursive
function
8
satisfies
175
Chapter 2
conditions (7.8) and (7.9). To this aim let i and z be two naturals satisfying the hypothesis of lemma. From (7.6), 6(i,z) # M For fmed 2, the predicate “di(y) = 2” is, obviously, recursive; hence 4,ti,=) is recursive too, thus proving (7.8).
Now let us prove the equality (7.9). If z is in range(+i)  {z},then z = di(y), for some natural number y; furthermore z # 2. In view of the construction of 4,(i,s), we deduce the equality z = d,(i,r)(r)r (because di(y) z), i.e. z is in range(d,(i,,)). Conversely, if z is in range(d,(i,=)), then z = d,(i,s)(g), for some natural number y. In case di(y) # 2 , we have: z = #,(i,sl(y) = +i(y) # Z , i.e. z is in range(di)  {z}. In case gi(y) = z we have: z = 4,(i,s)(y) = di(e(i,z)) # z (by (7.7)), hence z is in  {z}, too.
+
; I
General Hypothesis. (GH) For the sake of a contradiction, assume the existence of a p.r. function f :N4 n V having the property stated in Theorem (7.3). The following partial results will use the GH. (7.7) Lemma. Consider the p.r. function 7 : M 4 N d e f i e d by
r(i,O) = i
,
d i , Y + l ) = 8(~(i,y),~f(~(;,Y))))
I
(t6 comes from Lemma (7.4) and 8 is furnished by Lemma (7.6)). For every natural i , such that oi is total and range(di) is infmite, the following properties hold for every natural y: I # ~ ( ~ , is ~ ) recursive
range (q5,(i,l))
,
is infmite
(7.11)
,
(7.12)
Proof. We proceed by induction on y. If y = 0, then r(i,O) = i. The properties (7.10) (7.12) and (7.14) are direct consequences of the hypothesis. We focus our attention to property’ (7.13), i.e. $ ( f ( i ) Erange(4i). ) From GH, 0 # (range(di))§ = S+Jli). In view of (7.5), $(j(i)) E S,,li). But, $(f (i))is the minimum element in = (range(di))9, i.e. the minimum element in range(4i). So,

’*Jli)
176
Caludc
fl f (4E range (4; ). Suppose now that properties (7.10)  (7.14) are fulfiied for some natural y. We shall prove that they still remain true when passing to (Ytl).
By defmition, ~ ( i , y + l )= s(r(a,y),$(f(7(i,y)))). Since 8 and f are recursive functions and T(i,y) # 30 (by virtue of the inductive hypothesis (7.10)),all it remains to prove is that N f ( T ( i , y ) ) ) # M From GH it foilows that /I range(dT(i,y))= S, we use (7.5) and obtain
*
,,,,,,,, 
dJ(f(?(i,y))) # q because t$,(7(,,y)) is a 01 valued recursive function (see GH and the inductive hypothesis (7.11)).
From properties (7.10)  (7.13) of the inductive hypothesis it follows that we can apply Lemma (7.6): dT(i,y+l)= ~ , ( 7 ( i , ~ ) , ~ f ( 7 ( i , y ) ) )is) recursive The last equality and range(4T(a,y+l))= range(d,(i:y))  {IN~(T(~,Y)))}* shows that range ($,(i,y+i)) is infmite. Firstly, f ( ~ ( i , y + l ) )# m Since, by GH, g5,(T(i,y+l)) recursive function we make use of (7.4): 4f(ThY+1))) E
=
is a 01 valued
( r a n ~ ( 4 7 ( i , , + 1 ) ) ) ~*
Moreover, + ( f ( ~ ( i , y + l ) ) ) is the minimum element (range(4,(i,r+1)))3,hence, it is in fact in range(d,(i,y+l)).
in
Finally, by (7.9) we have: range(d7(s,y+i)) = range(d,(i,y))

+1))))
c range(di)  { f l f ( ~ ( i , ~ + l ) ) ) l range(4i)
.
the
set
177
Chapter 2
(7.9) Lemma. There exists a p.r. function r : p S, UV, such that for every natural i , for which di is recursive and has an infmite range, we have:
The partial function g:N
a N , defmed by
g(z) = T ( i , z ) ,has range(g) = range(q$)
(7.18)
.
In fact, g is recursive and increasing
.
(7.19)
Proof. Put [ ' ( i , Z= ) $(f(7(i,z))) 7 for all naturals i and z.
If y ~ r a n g e ( g ) ,then y = $ ( f ( 7 ( i , z ) ) )for , some natural z. In view of (7.13) and (7.14), we have: vj(f(~(i,z))) E range(d,(i,,)) C range(di). In order to prove the converse relation, let range(g$) = ,...,z, ,...}, z, < z1 < z2 0. By monotonicity, F(A,,J c E(A), h e n c e z E F(A). Conversely, if z E F ( A ) , then (by weak continuity) z E F ( D ) , forsome fmite D c A. In view of the defmition of A, D C A a n d D finite imply D c A,,, for some natural n. Consequently, by monotonicity, z EE(A,,) = A,,+l C A, for some natural n.
To obtain (8.13) we take a subset B c N such that F ( E ) = B. We prove, by induction on n, that A,, C B. Indeed, A, = (3 f E ; if A,, C B, then (by monotonicity) A,,+, = E(A,,) c E ( E ) = B. Hence X
4 =
UA,, C E . n 10
Finally we show the recursive enumerability of A. Let _F  = F,,  for some z E N. For every natural y we have:
F(W,) = EJ(W,) = {z E RV IJ(z,u) E WJ,D, C W,,for some u E RVI . Since E,(W,) is r.e. (by Theorem (5.25)) we can employ an 8mn construction to get a recursive function f WI(Y,J)=
for every
in
:nV2 + N
PJ(WY)
7
satisfying the equation (8.15)
RV.
Let m be such that W,,, = (8. We construct, by a primitive recursion, the recursive function g:@ + N such that
185
Chapter 2
g ( W =m
g(z+l,z) = for every z in
I
f(!7(Z,Z),Z)
9
N.
B y induction, on n, we can prove the equality: 4, =
wt(n,s)
Therefore
A = lz E IV Iz f WP(n,s), for some n E N ) . Theorem (5.25) guarantees that A is r.e., thus ending the proof. 0
Remarks. a) Theorem (8.13) is a scholium to KNASTERTARSKI’s Theorem (which asserts that every monotone and continuous function from a complete lattice to itself has a least furedpoint; the continuity is taken here with respect to the topology generated by the closure under the leastupperbound operation of the lattice). In Theorem (8.13) we work with the lattice of all subsets of N ,partially ordered by inclusion. Monotonicity and weak continuity ensure the continuity with respect to the generated topology. In our particular case the least fixedpoint is r.e.
b) The reader may notice that, with the exception of the recursive enumerability of A, the proof of Theorem (8.13) does not use the particular form of F , but only properties (8.1)and (8.2). c) The proof of Theorem (8.13) points out formula (8.15) which shows that the enumeration operator F , works “recursively” on r.e. sets. Hence an index for the r.e. set A canbe unirormly obtained from t , i.e. there exists a recursive function h :NL IV such that
! ? ~ ( ~ h ( s= ) ) wh(s)
(8.16)
9
and For every
B C N satisfying E  s ( B ) = B,we have
wh(,) C B . (8.17)
Theorem (8.13) ensures a fixedpoint theorem for recursive operators.,
(8.14) Theorem. (KLEENE [1952]) Let
T : P a P ,
be a recursive operator. Then there exists a p.r. function that
+:N4 N
such
188
Calude
T ( 6 )= 6
(8.18)
9
and For every partial function
_T($)
=
$:N4 RV
satisfying
$ w e have Graph(#) C Graph($)
(8.19)
.
Proof. Let Fz:2"  2 "
,
be an enumeration operator defming the recursive operator ,T. We defme = F,. We prove, by induction on the sequence (A,,) as in (8.141, where n , that A, ia a singlevalued set. Indeed,& = 8 is a singlevalued set, and if A,, is singlevalued, then A,,+l = Ez(A,,+l)is also singlevalued (since f,  defmes the recursive operator ;'7 see Defjnition (8.10)). We conX
elude that the least fmedpoint A = the p.r. function
$:N4RV
UA,,
is a singlevalued set. Taking
n4
such tha t
Graph(6) = { ( z a ) E lv2IJ(z,o) E A )
?
we derive properties (8.18) and (8.19) directly from (8.12) and (8.13) in Theorem (8.13).
_I
(8.16) Corollary. There exists a recursive function g:W 4 RV such that for all natural numbers z and y , if
F,({J(n,m) IdV(n)= m } )is singlevalued,
(8.20)
then GraPh@g(v,,))
=
{ ( K l z ) , J w ) lz E&({J(nm)
Idpb) = m l ) )
6
In case F  , defmes a recursive operator
T:?aP
%
,
we have
m u )=4 for all natural numbers
2
e(i.1)
7
and y satisfying (8.20).
(8.21)
187
Chapter 2
Proof. Let
y and z be such that (8.20) holds. Perform uniformly the following steps (which guarantee the existence of 9 ) : (1) Use the Graph Theorem to fmd the natural y * such that wv*= { J ( n , m )Id&) = m l .
(2)
Compute f (y*,z) as in (8.15): g,(W,*)= W,(y,st.
(3)
Singlevaluize the set W,(f*,sl, by Theorem (8.6).
(4)
Use the Graph Theorem to obtain from the above singlevalued set a p.r. function. CI
Rernsr ks.
a) In view of Remark c) which follows Theorem (8.13), we get a recursive function h :A!c N such that for every natural z for which
F,:2"
,
2"
defmes a recursive operator
pP3P , we have: ,T(dh(.)) =
and for every partial function
h(.)
(8.22)
1
$:Na N ,satisfying ?($')
GraPh(h(*)) c Graph(*)
= (I we have

(8.23)
b) Theorem (8.14) may fail in case of a p.r. operator, since the least fmedpoint of the associated enumeration operator need not be a singlevalued set. c) In view of (8.21) it follows that every recursive operator

,
T:P*P
determines a recursive function f
7'(4,)
=
$,(=I
If 4, = &, then dl(,) (i.e. f is eztensionaf).
:N+ N satisfying the relations:
, for every
,
= t$j(y)for
natural
(8.24)
2,
all z and y in
IV ,
(8.25)
188
Calude
(8.18) Definition. A CIMS A of unary p.r. functions is said to be recursively enumerable (r.e.) if there exiats a recursive function f :JV * RV
such that
A = M I ( * ) Iz E N )
*
The function f is said to be an enumerating function of A. The set of all unary p.r. functions is r.e. f ( 2 ) = z,for every z E N .
(8.17) Example.
Here C
(8.18) Example. The set of all unary constant functions is r.e. See the proof of Example (4.4). 0
(6.19) Example. The set of all unary p.r. functions with finite domains is r.e. See Lemma (8.7). 0
(8.20) Example. The set of all functions r:N + JV which are ultimately sero (Le. r ( z ) = 0, for all but a finite number of z E N ) is r.e. We can prove this assertion by replacing the p.r. function rl, used in the proof * RV satisfying the relaof Lemma (8.7) by the recursive function $*:N2 tion:
Irl,(Z,Y) 1 i f q ( 2 ) = 1 , Cl7ZlY) = 10 otherwise .
(8.21) Example. The set of all unary primitive recursive functions is r.e. Let r : d 4 RV be the recursive function satisfying for all i and z in N the equality:
189
Chapter 2
ztl
if i = o ,
,
ifi=l, if i > 1 and e z p ( O , i ) = 0, if i > 1 and e z p ( O , i ) = 1,
9
r(ezp(l,i),z)+r(ezp(2,i),z), r(i,z) =
a
r(ezp(2,i), ‘(ezP(l,i),z
11, i f i > l , e z p ( O , i ) > l , and z=O, if i>l,ezp(O,i)>l, and z>O.
0,
r(ez~(2,i),~(i,zl)), \
Since for every numbertheoretic function f :N+ N, f 4 primitive recursive iff there exists a natural i such that f(z)= r(i,z), for all z EN,it follows that an amn construction will produce the required enumerating function.
of all unary recursive predicates i a not r.e. (8.22) Example. The set For the sake of a contradiction, assume that R0.I
for some recursive function f
E N}
= {#![*) Iz
:nV
*
N.
Construct the recursive predicate g : J V 0
if d,&)
7
9
+
=
{O,l}, by 1
,
Under the above circumstances, g = Ql(i), for some i in N. Setting z = i we arrive at the following contradictory relation: +/(i)(i) = 1 CJ #/(i)(i) =0
0
Remark. It ia obvious that a similar argument shows that the set unary recursive functions is not r.e.
R
of all
(8.23) Example. The set of all unary p.r. functions which arc nof recursive is r.e. Let $:N3 2 N be the p.r. function d e f i e d by
i
#i(z)
rL(i,m,z) =
00,
for all i , m and z in N and let g:@ which satisfies the equation
9
if
# m
9
otherwise, t
N be the recursive function
190
Caludc
#f(i,m)(z)
=

di,m,z)
Finally consider the recursive function G :IV
G(n) = ! 7 ( K ( + w ) for every n in
*
I? defmed by 9
I?. Clearly
PR

R
=
{dG(=] ( 2
EN}
3
Remark. It is worth noticing that there is no contradiction between the statements:
,P .P 
.Q
,
is r.e.
(8.28)
and The set
I
=
{i E
IN Idi
EP
R

R ) is not r.e.
(the validity of the last assertion follows from Corollary (8.8) since I
(8.27) =
I,).
The difference between (8.28) and (8.27) lies on the fact that an enumeration of P R  R (for instance, the enumeration given by G in Example (8.23)) includes at least one index for every nontotal p.r. function, whereas I contains ail indices for nontotal p.r. functions.
The notion of r.e. class of p.r. functions motivates the construction of a very useful class of operators. (8.24) Definition.
a) An operator
T:?R 4 P R
\
,
is called effective if there exists a p.r. function $:NA N such that for every 4i in the domain of, ’Z $ ( i ) # x , and Z’(di)(z) = dyi)(z), for every t
in IN.
b) An effective operator is total effective if its domain includes all recursive functions and if it maps every recursive function to a recursive function.
Remarks. a) The p.r. function $J in Definition (8.24) is extensional.
b) If the domain of a p.r. operator effective operator.
T is a subset of P R , then
is an
c) An effective operator is computed from the algorithms computing the p.r. functions in its domain, whereas a p.r. operator is computed by
Chapter 2
191
means of the fmite segments of the partial functions in its domain.
KREISELLACOMBESHOENFIELD's Theorem gives conditions under which effective operators are p.r. operators; see in this respect KREISEL, LACOMBE and SHOENFELD !1959], LACHLAN [1964!, ROGERS 11967). Since our main interest is directed to total effective operators, we shall do not give here this general result, but a useful, particular variation. We begin with some prerequisites. (8.26) Lemma. There exists a recursive function a :RV + IV such that the set {4+1 J n EN}is exactly the set of all fmite functions defmed on the initial segments of PI.
Proof. Let 0 :m2 a IV be the p.r. function defmed by otherwise, and let u :IV 4N be a recursive function furnished by an 8mn construction:
d,(,)(Y) =
+tv)
9
for all naturals z and y. We shall prove that this recursive function a works. Clearly, dam(+,(,)) = {OJ, ...,K(z)}. Moreover, for every p.r. function a:{Oll, ...,n} + IV there exists an 2 in IN such that a = 6,(,). Indeed, take z = J ( n , f i + ' ) ( a ( O )..., , a ( n ) ) ) . We have: K ( z )= n, L ( z ) = J'"")(a(O), ...,$n)), and for each 0 5 g 5 n, q5+)(y) = PY + + l ' ) ( L (=zI;::')( )) "+')(a(o),...,a(n))) = a(y). 0
Notation. a) Denote by
A,
the fmite function I$+),
comming from Lemma
(8.25).
b) Let a,":IV4 RV be the recursive function defmed by
*Z"(y)=
i
IK ( 4
X Z M ?
if
0,
otherwise.
Y
9
(8.28)
Furthermore, let b:N + IV be the recursive function satisfying the equation r," = I$+). c) For each natural n, let f i n i t e , : W + ' function defmed by
+
N be the recursive
192
Calude
Remark. It should be emphasired the distinction between F, and rS. (8.28) Lemma. For every natural i , n
rl
iEKnWiori@KuW, .
(8.30)
1 7
Proof. Obvious, since K
=
(zE N lds(z)
f
XI.
(8.27) Theorem. Let
Z:PRPR, be a total effective operator given by a recursive function g:N
Z(48)(4 = 6,(i)(4
*
Then, we can effectively fmd a recursive function f : N for every recursive ipi,
c
. RV
N,
such that
(8.31)
where C, = (n E IV (Graph ( x , , ) Proof. The following proof is essentially taken from the proof of
KREISELLACOMBESHOENFELD’sTheorem.
Recall that in view of KLEENE’s NormalForm Theorem and ROGERS’ Isomorphism Theorem, each p.r. function ipi can be written as
.
4,(4
= P ( P Y l V ’ z ’ d = 111
1
where T : N 3 {0,1} and p : N 4 N are fmed recursive functions. Furthermore, denote by 6 , :IV a N the p.r. function defined by
t(~ = w) i T ( i , z , y )=
11
.
Assume now that the total effective operator is given by the recursive function g . For each natural z we consider the p.r. function w, ; N RV given by
~ s ( i=) q,(i)(z) and the partial function
1
193
Chapter 2
funet,:PR A N
,
functs(4i) = $ , ( i )

defmed by ( f u n d , is called, sometimes, totol effective operation (see ROGERS [1967] for complete defmitions).)
Fix a natural 2 , and consider the recursive function G :IV2 + hr (which uniformly depends upon z)given by d j ( z ) , if T(i,i,q)#I, for all q j z , *;(z), i f y = l i ( i ) < x , 6j(q)#m,for a l l q l y ,
and n = prn[Graph(nt)CGraph(r,), dC(i,j)(z)
=
'
functz ( d j )# functz (ds(m))l, where
e = finite, (6j(0),*,6j (g)), x , otherwise. \
dC(A(j),j)
=
dj
9
because T(A(j),A(j),q)# 1, for all q in N . Consequently, ddG(X(j),j))
=
4o(j) '
and, in particular, 4g(j)(Z)

=
to,(i)= ~ s ( ~ ( ~ ( d , d )
Hence, X ( j ) E Cj = WA(j),thus contradicting (8.30) (since X ( j )
n
K).
Intcrmediote etcp. Each natural j for which funet,(#j) # 30 and t9i(jl(A(j)) # x has the following property. For every T,, satisfying the equalities
194
Calude
*n(u) =
for all u
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
(1.4)
n,(z) > r ( t ) .
Two cases must be analyced according to the relation between
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 a,(!) = n,(t) = $I,([). the construction of k and ! we have: r(!)
>
>
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 :Nc N is said to be realtime 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 realtime 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 realtime 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 amn 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. For every recursive predicate w i and for every natural number z,we have 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 timecomplexity of certain recursive functions which bear a resemblance to noncomputable functions. These complexitytheoretic 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), etepcounting 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 complexitytheoretic 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 timecomplexity 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 stepcounting functions by means of the timecomplexity
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 memorycomplezity, 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 stepcounting 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 stepcounting 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 indepcndent. (2.9) Example. Let Q = ((di),(ai)) be a BLUM space and let f :pV + RV be a recursivefunction 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 thedefmition
.
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
*eq (@i (2
*
k 4
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 NormalForm 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 tha 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) 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 )
ax.
(3.7)
I
0
,
= 1 and
k
= pm!(m 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:
r ( t ( z ) + m ) , for
every
or 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(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 r ( t ( n ) )or Oi(n) t(n).
j, 2
t(z)
* @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 , ...,z1). We arrived ti
.
(4.13)
such that , j = in, for at the following contrad
ictory relation:
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 funct size. Indeed, t ( z ) = ti < t o = r(z,t,)+I = tion 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 )
(4.14)
9
for all i and z with z E dorn(di). Then we can effectively find a recureive function t :RV that
two BLUM

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
,
[:PRPR 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. Assume that f :IN tion

nV is a
recursive function satisfying the equa
U Graph(*j(j))
Graph(ET(di)) =
t
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(z) t"'(.)
=
X ,
,
for z
(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,(zl)+I),
for z
2 d, ,
and for i E {zl,,..,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 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 z3
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(.)
=
#)(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
for every
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, f ( z )= #(o,z)
i

= {
5M, b p ) ( i + l , z ) , for z > M ,
#)(o,z)
,
for z
for z ~
~
5M ,
,
~ for ~ z ~> M ~
,)
~
z
)
where w = J ( M , P + ' ) (t$p)(O,O)
,...,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 SpeedUp 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 speedup 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 SpeedUp 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 speedup phenomenon is not a consequence of growth. Moreover, it is not difficult to modify the above proof of the SpeedUp 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 hspeedup (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 SpeedUp 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 SpeedUp 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 nonuniformity 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 SpeedUp 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.
N be a recursive function such that for every n, the equation p ( z ) = n has an infmity of solutions. By the 8mn Theorem we get a recursive function s :RV + IV satisfying the equation
Proof. Let p:RV
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
This is possible =
because the definition of h is independent O+)(z) in (5.28) we get: 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 noneffectiveness of speedup 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 speedup. Furthermore, the speedable function will be zeroone valued. (6.6) Theorem. (Operator SpeedUp 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 aeroone 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 reroone 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 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(#,+)).
Let w e must analyae two
S,+2
caaes, according to the value of the sum
ME(i,z.,y). U d
A) Incaae s,+2
c MW,Z,,Y)
Y d
we have
> 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,
so (9.11) was
proved. 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 realtime 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 wellknown result of HARTMANIS and STEARNS [1965] (proved by means of multitape 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 stepcounting func. tions is recursively meagre.
Proof. We apply Theorem (9.17) to the measured set of the stepcounting 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 stepcounting 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 speedup 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 SpeedUp Theorem (also a SpeedUp 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 nonr.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 SpeedUp Theorem proof is taken from YOUNG [1973] and MACHTEY and YOUNG [1978]. The Operator SpeedUp Theorem belongs to MEYER and FISCHER [1972]; another proof of this theorem can be found in YOUNG [1973]. An interesting survey on the speedup 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 means of complexity sequences was initiated by M EmR and FISCHhR [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 SpeedUp 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 realtime computable in the sense of Definition (1.2)?
Section 9.2 (11.2) Defme a “memorycomplexity” 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 SpeedUp Theorem for recursive predicates. (11.11) (BLUM [1969])Prove that no recursive function has an effective sufficiently large speedup (see the comment following Theorem (5.5)). (11.12) (SCHNORR [1973])There is no recursive function which has a sufficiently large speedup, such that both the index of the faster pro
gram and the number of points where the speedup 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 speedup. 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. hcornputable and i.0. hhard functions. (11.17) (LANDWEBER and ROBERTSON [1972]) Prove the existence of a r.e. set of i.0. hhard p.r. functions, which includes every i.0. hhard 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. hcomputable 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), 279280).) 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 nontotal 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.
297
CHAPTER 4
4. KOLMOGOROV AND MARTINLOF’S COMPLEXITY THEORY
This chapter is devoted to the complexity analysis of “algorithmic descriptions”. Due to the fact that in what follows the input/output processes play the decisive r&, we are dealing with stringfunctions (over a nonbinary alphabet). This study hae led to a satisfactory definition of random strings, which turn out to have many interesting applicationa.
4.1. EXAMPLES
In this section we present two problem which motivate the complexitytheoretic approach to random atrings, namely the opthisation of program length and the probabilistic tests of primality (with an application to cryptosystems). Paradoxes often turn out to be an important source of fertile mathematical ideas. That is why, we begin the analysis of the optimisstion problem below by presenting the famous BERRY paradox (see, for example, VAN HEIJENOORT [1967]). Consider the smallest natural number that cannot be defined by an English phrase whose length is less than lo3 characters. Let us suppose that n, is this smallest natural number and that the defmition of n, hm at lead lo3 characters. It is easy to see that, in fact, nocan be defmed by the following E n g h h phrase having much less than los characters: “the smallest natural number that cannot be defmed by an English phrase with less than lo3 characters”. Consequently, the natural number no cannot eziut!
Someone may argue against the linguistic and mathematical correctness of our former defmition (for an interesting discussion see BOREL
298
Cduda
[1946]). To avoid criticism, one can employ a formal axiomatic system having precise specifications. The problem of checking if a proof written in this system is correct is completely mechanical (for i=1,2, generate all strings of length i in the finite alphabet of the system and check for every such string whether is a correct proof; print all theorems of the system, i.e. our defmitiona, whose proofs were found), and consequently, it can be simulated by a computer (CHAITIN [1974)). In what follows we shall describe thin problem in detail (see aleo, DAVIS [1978], MACHTEY and YOUNG [1978]). We shall use a sufficiently strong programming language PL in order to give precise mathematical defmitions of natural numbers. A definition of a natural number n is a pair D = (P,m), where P is a (correct) program in PL and m is a natural number subject to the following condition: the program P accepts m as input and after running on m it prints n and halts. Clearly, every natural number n has at least a definition. Take, for example, D, = (P,,n), where P, is the program
...
BEGIN READ n PRINT n STOP T h e length of a defmition D = (P,rn) is the sum of the number of characters of program P and the characters number of the input data. For example, the length of D, is 20+[log,n]+l, where p is the base in which n is written. Consider now the following optimization problem: Find the shortest definition for every natural n. Every natural n has at least one defmition and there exist natural numbers VL which have significantly shorter defmitions than D,. For example, let us take n = p', for some k 2 35, and consider the program R, BEGIN READ k i = l n = p
WHILE i
# k
DO: n = n . p , i = i + l
PRINT n
STOP
Clearly, (R,,,k) is a defmition of n w h i h is shorter than D,, since A < p'=, for every k 2 35. Let us SUPPOS~ that PL satisfies the following three conditions: PL is aufficiently strong in order to:
Chapter 4
299
a) contain a program which, for every given program P in PL, computes the number of characters of P and halts, b) accept subroutines, and c) perform some basic algorithmic operations
(including WHILE constructions), PL uses a fmite alphabet (consequently,
(1.1)
the number of correct programs in PL having a fued length is finite),
(1.2)
PL works with natural numbers written in a base p
2. 2
.
(1.3)
Each natural number has at least one shorter defmition, though it may well have several ones. So, the optimisation problem has at least one solution which, by (1.2) should be searched for in the fmite set of all defmitions of shorter length than the length of 0,. It seems quite natural to ask whether the optimal solutions (or, a t least, one such solution for every natural n) could be algorithmically obtained, i.e. by using a program in PL. We shall prove that under the hypotheses ( l J F ( l . 3 ) no such program exists. Suppose, for the sake of a contradiction, that there exists a program P in PL such that for every natural n, 4.) gives as output a shortest defmition of n and halts. Let us denote by (fln),rn(n)) the defmition f l n )*
For every natural t
2 1 we construct the program Qr as follows:
BEGIN READ t y=o z=o
WHILE z < t DO: CALL fly),
PRINT y STOP
z = length ( f l y ) ) + length (m(g)), y = y+l
In view of (1.1) and (1.2) it follows that Q, ia a correct PL program. For distinct naturala t , and t,, the corresponding prograxm Qt, and Q,, diifer with respect to the input data and the condition tested in the WHILE atatement. Consequently, there exists a constant c > 16 (which
300
Cdude
depends upon the programs in (l.l),a) and b)) such that for every natural t 2 2e we have: length ( Q t ) = length ( t ) + e = [log,t+l]+c
< e+log,t+2
,
and, consequently, defmition ( Q r , t )is shorter than t , length
(8,)< t
.
In view of (1.2), the program Q, prints the smallest natural number requiring a defmition of length greater than t . This is a contradiction, becauae there exists already a defmition of it shorter than t . The above example suggests the possibility of measuring the complexity of fmite objects (natural numbers, strings etc.) by means of their shortest defmitions induced by a fmed computing device. The reader will a h fmd this idea in the next section. Recent results in approaching the complexity of concrete classes of problems have led to an important distinction between problems having a potynomial time algorithm and those requiring exponential running time. It is largely agreed that problems requiring exponential running time are intractable. Yet, problems for which no polynomial algorithm is known can sometime8 be solved by means of nondeterministic polynomial algorithms. The nondeterministic algorithms are very useful for theoretical purposes, but they are rather incongruous in practice. Furthermore, the problem of transforming nondeterministic polynomial time algorithms into the equivalent deterministic ones is open. In contrast, a new class of algor i t h m running in polynomial time has appeared: the clam of probabilistic algorithms. The probabilistic methods have been used for several decades (Bee
PAZ [1971], and the bibliography JANKO [1982]). The interest in these
new algorithm has increased when difficult problems turned out to be solvable by probabilistic algorithms that are working faster than the known deterministic ones. A typical example is the factoring problem. The complexity of factoring natural numbers is unknown (the best of the present algorithms work in (log2m)c'*m steps, for all large n a t u r b m, where c ia a constant, NILEMAN, POMERANCE and RUMELY !1983]; thia means that within fdteen seconds a etrong computer can check the primality of a fiftydigit natural number, LANDAU (19831). MILLER [1976], using the Extended R I E M A " Hypothesis (ERH), has d e v k d a polynomial algorithm to test primality. More exactly, let n and b be natural numbers, such that 1 5 6 < n. Denote by M(6,n) the
Chapter 4
301
b”’ fl(mod n), or
(1.4
following condition: rn = (n1)2+ is natural and 1 < gcd(bml,n)
< n, for some natural i .
(1.5)
If M(l,n) holds, for some b , then n must be composite. On the bagis of ERH, there exists a constant c such that if n is composite, then we can fmd a natural 6 satisfying the inequalities 1 5 6 5 c for which M(b,n) holds. The number b is called the witncer of the compositeners of n. RABIN 119761 has shown, without ERH that, when n is compoaite at lesst half of the natural numbers 1 5 b < n are witnesses of the compositenem of n. SOLOVAY and STRASSEN [1977] constructed a probabilistic algorithm for testing primality by means o,f the JACOB1 symbol j(b,n). For every natural b , 1 P"(lPAP1))
+,m)
20
(2.3)
9
(the last equality holds for p = 2 and m = 0). In particular,
> P"(P2)/(P1)
+PO)
20

(2.4)
Remarh. 1) Let 4:X' x RV S , X * be a p.r. function,'and let n and m be in RV such that n 2 m. I f p > 2 or m > 0, then limc(n,m) =
00
nca
.
The aesertion above fails to be true in caae p = 2 and m = 0. Actually, we shall present an example of a p.r. function 4:X' x RV having the property that e(n,O) = 1, for every n in RV. Let p = 2, a1 = 0, a2 = 1. Let < be the lexicographical order on X* = {0,1}* induced by 0 < l : X < 0 < 1 < 00 < 01 < 10 < 11 < 000 1p/(pl)
.
Remark. (DAVIS [1978]) Take p = 2, a 1 = 0, a2 = 1, and m = 10. Then, more than 99.8% of all strings of length greater than n10 are mrandom.
313
Chapter 4
4.8.
MABTINLOF TESTS
In this section we study the statbtieal propertier of KOLMOGOROV’s (asymptotic) random strings. We prove that KOLMOGOROV’s (ssymptotic) random strings poaaew, in a sense, all poi+ sible properties of stochasticity. (8.1) Example. (MARTINLOF [1966a], [1966b]) Consider the binary case, i.e. p = 2, a1 = 0, a2 = 1. h u m e that we hare a test of randomness for binary strings which rejects relative frequencies of ones differing too much from the expected value 1/2. In other worda, if z = z122...z2,is n
a binary string and an =
czi,then our test of randomness rejects the
ill
hypothesis when
bta/nlFI
9
is too large. Since we are interested in the magnitude order of the significance level, we may reatrict our attention to a discrete set of critical values (Sicherheitawahrscheinlichkeit (MARTINLOF [1966a], p.3.9)) c = 2’,22
,..’,2 ,....
Consequently, the above MARTINLOF test rejects the hypothesis of randomness on the level E = 2 provided l8JnlF
where f :RV x RV tione:
+
I 2 f(m,n)
(34
9
N hi a function satisfying the following two condk
The number of strings of length n for which the the inequality (3.1) holda is less than 2”’
.
One cannot diminish f without violating condition (3.2).
(3.2)
(3.3) 0
The above example euggesta a general notion of randomnetm teat. In order to get this defmition we establish a useful notation: For every set V c X*x (RV;{O}) and for every natural number m 2 1, denote by V, the set {z EX I(z,m) E V), that is the inverse image of the m t h projection.
314
Caludc
(MARTINLOF [1966b],CALUDE and CHITESCU [lSSZa])A nonempty r.e. set V C X* X ( N  ( 0 ) )is called a MARTINLOF test (ML t e s t ) if it possesees the following two properties: For all n and m in dv, m 2 1, we have: (8.2) Deitdtlon.
v,,, c v m card{z E X * l!(z) = n , EV,} ~
(3.4)
9
< p”“/(p1)
.
(3.5)
We agree upon the fact that the empty set in a ML test.
Comments. (Motivation of Defmition (3.2)) a) The choice of a strict inequality in condition (3.5) is motivated by Example (3.3), which in turn relies on the strict inequality in Lemma (2.7). b) Each test of randomness must be capable of being effectively specifled before the running experiment; it follows that such a teat must be a r.e. set (this is the weakest constructive restriction). c) Condition (3.4) can be regarded M an “efficiency” requirement.
Remark. For every ML test V and for every t(z)>m?l (8.8)
Example.
d:X*x Bv * X * be
(2,“)
.
in V one has
(3.6)
(CALUDE a p.r.
and CHITESCU [1982a]) Let function. We claim that the set V(4) defmed
~ ( d =) {(z,m) Iz EX*,^ E N , m 2 1, and K,(z (!
(2))
< 1 (2)m} ,
(3.7)
is a ML test.
First of ail we see that V(+)is a r.e. set. Let UE consider a (primirecursive enumeration of X*x RV given by the bijection e. :N X* x N. At etep i let e ( i ) = (2,m). Check if the finite set
tive)
A = (1 E X * l W < W  m , d ( u , W ) = 21 , is empty. Thin can be done by dovetailing. Let the algorithm which computes the p.r. function 4 run one step for all inputs (g,t(z)), with t ( y ) < !(z)m. If for some such y we have #(y,P(z)) = 2, then the set A is nonempty. If not, let the algorithm run the second etep for all inputs M before. Again, if for uome y we have d(y,t(z)) = 2 , then the set A is nonempty. If not, p m to the next step, a.a.0. If A in nonempty, accept the pair (z,m). The set V(4)C O M M ~ U of all accepted pairs (z,m). For z in (V(+)),+,,we have K,(z lt(z))< 1(z)ml < l(z)rn,
315
Chapter 4
thus proving that z is in (V($)),,,. Fmally, by Lemma (2.7), we have:
E X *le(z) = n
(8.4) Example. Let z be in t ( z ) > m 2 1. Then the set
, E~ (V(4)),,,)
X* and
m
in N. h u m e that
H(z,m) = {(Z,l),(Z,2),'..,( z t m ) )
,
(3.8)
is a ML test. The only condition in Defmition (3.2) which must be checked ia (3.5). We have:
card{y E X * l l ( y ) = n , ( z , q ) . E H ( z , m ) )
=i
1 , i f n = t ( z ) , and 1 0 , otherwise,
< P"'/(P1) because l ( z )> m 2 q (i.e.
q
5m,
9
p"'/(pl)
> 1). 0
(8.6) Example. Let z be in X* and m in N. Assume that [(z)> m 2 1. Then the set i ( ( z , m )=
{(w) lo EX*,%E N , l I 12 I m,y 3 z} ,
(3.9)
is a ML teat. (Recall that the relation y 2 z means that y = zz, for some z in Clearly, F(z,m) ia a r.e. set (in fact,a primitive recursive set). TO prove condition (3.4), let (y,n+l) be in H(z,m), i.e. 2 5 n + l 5 m and y> z;it follows that 1 5 n 5 m, and y 2 z,which shows that (g,n) is in H ( z ,m 1. Finally, let n and q be in RV such that q 2 1. We have:
x*.)
card{y E X * l q Y ) = n,(u,q) E@z,m))
318
Cdudc
Remarks. Let (z,m) be in are equivalent: a)
i) [ ( z )
X* x ( N  ( 0 , ) .
Then the following statements
> m 2 1,
ii) H_(z,m)is
a ML test, iii) H(z,m) is a ML test.
From Exampleel3.4) and (3.5) we know that i) implies both ii) and iii). If H ( z , m ) (or, H ( z , m ) )is a ML test, then 1 < p'(')/(pl), for every 1 5 q rn 2 1. b) For all z in
X*and
m in
Ehm)=
N{O} we have:
u U
H(y,m)
3 '
We finish the presentation of the examples of ML tests with a nonrecursive ML test. (8.6) Example. Take A c {a,}* = {X,al,a~,...,a; ,...} a r.e. but not recursive set (see Example (2.5.16)). Then V = (A{X,al}) X {I} is a nonrecursive ML test. (The condition (3.5) is fulfilled because the left member of the inequality is always less than or equal to 1.) 0
In order to obtain the main enumeration theorem we shall give the following lemma.
317
Chapter 4
(8.7) Lemma. There exiets a p.r. function
f:(N{o})2 ax*x
nv ,
with the following two properties: For all natural numbers i and j such that j(i,j)# oq we have f ( i , k ) # oq for all k
Aset A
c X'
.
5j
(3.10)
x N is r.e.
iff
(3.11)
A = { j ( i , j )lj=1,2 ,...}{.0},for some i
21
.
Proof. Let (fp))imj0) be an acceptable gEidelisation, where + / ' ) : I V  { O } a X x N. We defrne the p.r. function
f:(RV{o})2 by the formula:
I,
ax' x nv ,
&!io(i,j) 1 if 4E!ie(i,k) for all k 5 j f( i d=
where
4gi0is an universal p.r.
+ 04 ,
otherwise,
function for
(+/'))i E~{o).
Let us notice that among the p.r. functions h i : N  { O } A X *X RV, i EN{O}, hi(j) = f ( i , j ) , for all j in RV{0}, we can fmd all recursive functions as well as the empty function, thus ending the proof. 0 (8.8) Theorem.
(MARTINLOF [1966b], CALUDE and CHITESCU [1982a]) The set of all ML testa is r.e. More precisely, there elrists a r.e. set T C Bv x X*X N auch that for every V C X*x Bv the following equivalence holds: V is a ML test iff V = {( z, k) ] ( i , z , m )E T), for some i in N.
Proof. Throughout the proof we shall constantly use a fmed pa. function given by Lemma (3.7). Thia allows us to write 4 instead of {f (i ,j)li=1,2,...}{4. baaed upon Lemma (3.7), We display a procedure of ge:eration, which constructs all r.e. subsets of X x IN and modfier only those sets which are not ML tests (more exactly, makes empty all r.e. eta which are not ML tests). Roeedute of constructing the eeetion of T, i.e.,
318
Cdudc
z = {(z,m)I(i,m,z) E T), for some f i z e d natural number i 2 1: 1. Put z = 0. 2. P u t j = 1.
If f(i,j) = + then continue indefmitely. 4. Compute f(i,j)= (zj,mj). 5. If l(zj) 0.
In view of Theorem (3.10) we have: Vmy(r)= Vm~(s)e+c C u m ~ ( r )  e
Consequently, z ia in Um,,+]c,i.e. mdz)e
5 mu(.).
Suppose now that U is a ML test satisfying condition (3.13). We prove that V,, C U,, for all rn 2 1. h u m e that for some natural rn 2 1, Vm+c# 0. Let z be in Vm+c. In view of Defmition (3.14), rnV(z)2 m+e, or equivalently, my(z)e 2 m. According to (3.13) we have: mu(%)2 my(+
which proves that mv(z) 2 rn
2m
9
2 1, i.e. z E U,,,dsiC U,. a
In the follow'ng
we
shall ehoore a fized universal ML test U and
324
Cdudc
rhell write m inatcad of my. The following result establishes an aaymptotic relation between KOLMOGOROV’a compkxity K (induced by a fued universal KOLMOGOROV algorithm) and the critical level m (associated to an univehal MARTINLOF test). we
(MARTINLOF[1966b], CALUDE and [1982a]) There exists a natural number q such that
(8.16) Theorem.
I5
le(Z)K(z l+))m(z)
CHITESCU (3.14)
9
for all z in x*.
Proof. Firstly we prove the existence of a natural number c that
e (45 K(.
It (Z))+m(z)+c
2
1 such
(3.15)
1
for all z in x*. For this inequality we shall use the ML test (3.3), with w instead of 4.
V(4)given in Example
Let ua notice that my(,,(.)
Assume
rnq,,)(z)= 0.
that
.
= 0 iff t ( z )  K ( 2 le(z)) 5 1
Therefore
((2)
(3.16)
5 K ( z lt(z))+l 5
K ( 2 l e ( t ) ) + m(z)+l. Now suppose that rnqU1(z)# 0, i.e. t ( z )  K ( z It! (2)) > 1. According to defmition, r n ~ ( , ) ( ~=) max(rn =
2 1 ( K ( z (t(2))< e(z)m)
P(z)K(z ( e ( Z ) )  l
,
(3.17)
(see a h the Remark at the end of the proof). Theorem (3.15) furnishes a natural c’ such that rn for all z in X I . We take e = e’+l, because in case mq,$))’
(2)
5 rn(z)+c’,
# 0 one
has
.
e ( z )  K ( z le (2))1 5 m(z)+e’
Secondly we prove the existence of another natural number, aay d , such that
e (42 K(.
It (z))+m(z)d
7
(3.18)
for all z in x*. The universal ML k r t U,being infmite by Theorem (3.13), can be written U = g(aV{O}), where
Chapter 4
g:N(0)
325
+x*x Hv ,
ie an injective recursive function (see Theorem (2.5.18)). Using the recursive function g we shall construct a p.r. function d:X*X N S , X * such that (3.19)
for all 2 in
x*.
We construct the p.r. function 4 by cases. First we consider the set A = { ( ~ , t ( g ) )IV EX*}and we put d(g,t(y)) = y, for every y in X*. Clearly, the “graph” { ( t , d ( t ) )It E A} ie recursive. Now we construct the second “part” of 4. Consider the range of g and partition it according to the following equivalence relation: The equivalence class of g ( i ) = (zi,mi) contains a t most h elements, where because U is a ML test. Moreover,
We have therefore a sequence (Ei)i20of equivalence classes. Let a fued Ei contain r elements. We can order lexicographically the fust r strings of length .f (zi)mi, obtaining the ordered set Ci. Here Ei is the cl&s of (zi,mi) and the lexicographical order on X* is induced by a1
< a1 t(z), i.e. the set of all random strings, thus contradicting Corollary (4.5). 0
Consider the set
335
Chapter 4
(4.9) Corollary. If for an infmity of natural numbers n one has
K(zlz2...z2,In) >_
n nrn
,
for some fmed m, then A is not r.e.
Proof. The set A satisfies conditions (4.13) and (4.14) in Theorem (4.3), with m(n) = A A m . Consequently, A is not r.e. 0
Comment. The nonconstructable global property is not a decisive argument for a good defmition of randomness. For example, the set 1 A = {z E X * IK(z It (4)2 [logp(t (.) I> is clearly not r.e. (see Theorem (4.3)), but it must be clearly rejected as L candidate for the random strings set. We continue the analysis of the undecidable properties of (asymp totic) random strings with a characteriration of recursive MLtesta.
(4.10) Lemma. A ML test V is recursive iff the critical level induced by V, my, is a recursive function.
Proo;.
Assume that my is recursive. The characteristic function of V, + {0,1} can be defmed by
xv:X x IV
1, ifrnv(z)2m>O, xv(z7m)= (0
, otherwise,
which proves that V is recursive. Conversely, suppose that xv is recursive. Then the critical level induced by Vcan be expressed by the formula
E WT Ixv(z,m) = 1) , if xv(zJ) otherwise. Hence, my is recursive.
=1
,
338
Cdudc
(4.11) Theorem. The universal ML test V ( w )is not recursive.
Proof. Suppose, for the sake of a contradiction, that V ( w ) is recursive. In view of the equuality
X'(V(w))1
= (2
E X * IK&
lt(Z))
2 q+1>
9
we deduce that the set of 1random strings is recursive (for V(w) recursive implies the recursiveness of section (V(w))l). Thie contradicts Corollary (4.4).
(4.12) Corollary. a)
The critical level induced by a ML test V ( w )ie not recursive.
b) Each universal KOLMOGOROV algorithm w has nonrecursive graph; in particular, w is not recursive.
Proof. a) Directly from Lemma (4.10) and Theorem (4.11).

b) Assuming w has a recursive graph, the equivalence (2,m)
for some y in
E V(w)
w(ar,W)=z
,
X* with e ( ~ m”
can be coded as a recursive subset of X*
.
(4.17)
The formal system ia mund with respect to all propositions of the form “ K ( z In) > m”, i.e. if a proposition “K(zIn) > m” belongs to m ( F , 8 ) , then K ( z In) > m
.
(4.18)
338
Cduds
(4.16) Theorem. (CHAITIN [1974]) For every formal system having properties (4.17) and (4.18), there exists a constant e (depending upon the system), such that for every proposition of the form “ K ( z In) > m”, that belongs to Z%(F,s),we have m < t?(a)+e.
Proof. We begin with the construction of a p.r. function 4:X* x RV ax*by the following procedure: 1. Read (z,n) in X* x hV. 2. If z # T ( z ) s ,for all z in X*, then 4(z,n) = OQ 3. P u t h = 0. 4. Generate F(8,h). 5. If F ( s , h ) contains the code of a proposition of the form “K(y In) > m”, with rn > t(s)+2t(T(z)), then +,n) = y, where y comes from the fmet generated proposition “ K ( vIn) > m”. STOP. 6. Put h = h + l , and go to step 4. It was already noticed that the representation z = T(z)a is unique, when it happens. Moreover, the test in step 2 is obviously recursive. In view of (4.17) and (4.18) it follows that the above procedure defmes a p.r. function. According to Theorem (2.9), we can fmd a constant q such that K(ar I.) for
5Q
Y In)+q
v
(u,n) in X* x N. Now let (z,n) be in X* x hV such that 2
= T(z)a
,
for some z in X* with t(T(z)) = 2(q+l). If for some etring y in X* we have d(z,n) = 4(T(z)8,n) = Y
,
then K(Y/ I
4 I K,(Y In)+q I e (W4+Q = e ( 8 ) i  t (T(Z))+q = q8)+2(q+i)+q
= e(4+3q+2
.
In view of (4.8) and step 5 in the procedure which computes 4, we
339
Chapter 4
deduce that there exists a natural m such that
We conclude that no such y exists, so
W(+,n)
=
03
,
for all n in RV. Take c = 3q+2. We have proved that every proposition of the form “K(y In) > m ” is a theorem of the formal system only when m
t (2)” which is independent of (i.e., neither the proposition nor its negation is in Th(F,u)).
Proof. According to Theorem (2.14) we can fiid a random string z with t? ( 2 ) > l (s)+e, where c is the constant furnished by Theorem (4.15). The proposition “ K ( z lt?(z))> e(z)” is not a theorem of the formal system , for it violates the condition C (z)< e ( 5 ) + e . The negation of the proposition “ K ( z It? ( 2 ) ) > t (2)” cannot be a theorem of the formal system < F , 5 >, for it violates the soundness assumption (4.18). 0
Remsr ks. a) To realire the importance of Theorem (4.16) let us notice that there is no limitation to the form of axioms or rules of proof (presumably sound) for proving statements of the form “ K ( z In) > m”. We may include here all (constructive or nonconstructive) methods of proof avsilable in usual mathematics. Theorem (4.15) puts down a severe limitation to the power of mathematics, since it indicates the existence of a constant, t ( e ) + e (depending upon the system) such that it is impossible to prove within the system that a string is more complex than 1 ( u ) + e . b) P ut p = 2, u1 = 0, a2 = 1. Theorem (4.15) asserts that we can find a constant e such that if a theorem constitutes more than t ( e ) + e bits of information, then it ia impossible to deduce it from the system (here
340
Cdadc
C ( 8 ) denotes the information contained in the axioms of the system).
c) GODEL [1931] pointed out that there are statements about natural numbers which can be neither proved nor disproved in the logical system Principia Mathernatica or in a i m i i systems. Corollary (4.17) allows a deeper look into the matter (see also Theorem (2.6.15); DAVIS (19781, CALUDE (1982bj).
4.6. REPRESENTABILITY THEOREMS
The critical levele induced by ML testa constitute themselves aa an alternative to the KOLMOGOROV theory of complexity. The results of Sections 4.3 and 4.4 suggest that these complexity theories are "nearly equivalent". In the present section we shall prove that these theories are not equivalent and we shall investigate the possibility of expressing the ML tests in terma of KOLMOGOROV's complexity. We shall show that this is possible by adding an element to the primary alphabet. The starting point ia Example (3.3), which we shall briefly recall. To every p.r. function 4:X* x IV a x * we aesociate the ML test .V(#) defmed by
V(4) =
.I d , m E J V  { O ) , I+)) < W  m )
{(z,m)
K,(z
Notice that (z,m) cV(4) iff there exiats a string g in ( ( y ) < t'(z)m and 4(p,t'(z)) = 2 . This example suggests the following defmition.
(5.1)
X* with
(6.1) Definition. (CALUDE and CHITESCU [1983a]) Let V C X*x IV be a ML test. We say that V ia (KOLMOGOROV) representcable if there exists a p.r. function #:X* X N S , X * such that V = V(#).
(6.2) Example. The ML test H ( z , m ) in Example (3.4) is representable.
Take for instance the p.r. q5(a:(*)*',t'(z))
=
2.
Since
# : X * x N A X * , given by K,(z lC(z)) = .t?(z)ml, we have
function
H(.,m) = V(0). 0
341
Cbrpkr 4
(6.8) Example. The ML test g((z,m) in Example (3.5) is representable. We shall construct a p.r. function d:X*X h' ax*,such that for all (y,n) in X* x h' satisfying the conditions y 3 2 and 1 5 n 5 m , we have
q a r It ( 9 ) ) = t ( d  m  1
(54
9
thus proving that H(z,m) = V(4). Set d(apl(s)*1
For every natural t
,+))
=
.
2
> !(z), we consider the sets 4 = {Y EX*lY 3 z , w = t }
9
and
. EX*l t ( 2 ) = trn1} > t(z)rnl 2 0; so, Bt # 0. Moreover, Bt
Clearly, tm1
=
(2
c a r w = pt'(s)
<  ptl
=
CardBt
.
(5.3)
We order the sets 4 and Bt in the lexicographical order induced by up, thus obtaining 4 = {gl,v2 g,} and Bt = {zl,iq,...,z,}. In view of (5.3), 8 5 r . Now defme u1
,...,
< u2 0. There exists an unique natural i > 0 such that g(i) = (z,mv(z)).According t o the procedure, there exists a string y in f with l ( y ) = k'(z)rnV(z)l, and 4 ( y , l ( z ) ) = z. This shows that ~
K,(z le (2)) 5 e (z)mV(z)l
.
(5.5)
On the other hand, the equality #(y',k'(z')) = 2 implies z' = 2 , and [(y') = l(z)mjl, in case g ( j ) = (zj,mj) = (z,mj). This can be done for some mi 5 mv(z). We conclude that l(p') 2 k' [z)mv(z)l, i.e.
K , ( ~le(2)) 2 e(~)my(~)i
.
(54
From (5.5) and (5.6) property (5.4) follows, thus proving the inclusion
v c V(4).
To prove the converse inclusion, V(4) C V, we should notice fust that, in view of the construction of 4, (z,m) E V(4) implies (z,l) EV. Now we take (2,m) in V(#), and we prove that rn 5 my(z), (i.e., (z,m)E V). For the sake of a contradiction we suppose that m > mV(z). According t o the defmition of the critical level we have
345
Chapter 4
(z,mv(z)+l) EV(#), l (y) < t (z)m,,(z)l,
which and
yields
an
in
y
Y'
such
that
d(v,.f ( 2 ) ) = z. This contradicts property
(5.4). 0
Remark. If V is a representable ML test, then the equality V = V(4) holds for many p.r. functions 4. The p.r. function 4 furnished by the construction in the proof of Theorem (5.3) is injective. Actually, Example (5.5) can be generahed: (6.1) Propomition. For every alphabet X,having p 2 2 elements there exist a frnite ML test V, and an infmite ML test W, which are both nonrepresen table.
Proof. a) Let p strings
2 2 and put
8 =
We consider
(ppl)/(pl).
Y1,12,"',J,
8
difrerent
9
in X * , with length t(yi) = p + l . We claim that the frnite ML test,
v = ((ri,i) li=1,2 ,...,4 , is nonrepresentable. Indeed, if V were representable, then we could fmd the (mutually distinct) strings Zl,Z2,".9Z,
9
in X* each having the length l ( z i ) < p + l  1 = p, and such that
#(s,P+~) = yi
9
for i = l , 2 , ..,a. Since p'' < 8 , a t least one of the strings zi, say zt,should have the length shorter than p2. So, b(z,,p+l) = yt, and
w IP2
< %/,,)2
*
This shows that (yt,2) E V(O), contradicting the construction of V. b) Put W = V u {(ai,l) )i=p+2,p+3, ...}, where V is the ML t e s t constructed at a). 0
346
Cdude
(6.8) Propodtion. For every alphabet X, having p 2 2 elements, and alphabet Y 3 X with p + l elernenk, there exists a p.r. function
T?xBv
A X * such that the ML test test over X * x BV.
V(4) over
f x RV
is not
a
ML
Proof. Let X = {a1,a2,...,4p}and Y = X U {ap+,}. We order X* lexicographically according to a 1 < a2 (ppl)/(pl)
,
V(4)is not a MLtest over X* x N. U
Remarks. 1) We can interpret the result stated in Theorem (5.6) aa follows: a) The complexity theories of KOLMOGOROV (based on the complexity function K,) and MARTINLOF (bssed on the critical level rnv) are not equivalent, according to Example (5.5). b) Considering the MARTINLOF theory over an “enriched” alphabet (in fact, an alphabet containing one more element) we can exactly express the ML tests ae objects in the KOLMOGOROV theory. c) For every natural p 2 2, and for every alphabet X with p elements, there elcists a ML test over X*x RV which in nonrepresentable (see Proposition (5.7)). So, every nonrepreoentable ML test V c X* x Bv become representable in Y‘ x N,by adding a single new element to X. But in r‘ X RV there exist abo other nonrepresentable ML tests! And the “enlargement” may continue indefmitely. 2) Proposition (5.8) goes in a “converse direction”. Here, there are “too many” representable ML tests over the enriched alphabet. Hence, the KOLMOGOROV theory over an alphabet with p elements is not equivalent to the MARTINLOF theory over an alphabet with p + l elements.
347
Chapter 4
Comments. In Remark 1) following Corollary (2.8) we have pointed out the distinction between the binary and the nonbinary cases in the KOLMOGOROV theory of complexity. The representability analysis stresses this distinction; moreover, the same remark can be done for the MARTINLOF theory of complexity. The following result shows that, in a sense, the representable ML test are “economical”. (6.9) Propoeitton. For every representable ML test V the following inequality holds:
card{z
,
(57)
#:X* x IV
ax*,
E X * It (2) = n,mV(z) = m } 5 pncnl
for all natural numbers n and m, n
> m > 0.
Proof. From hypothesis there exists a p.r. function such that V = V(4).
Fix the naturals n > m > 0. For every z in X*satisfying the conditions t ( z ) = n, and mv(z) = rn, there exista a string y in X* with t ( y ) < l(z)m, and #(g,t‘(z)) = 2. We have t ( y ) 5 nm1. Actually, we shall prove that t ( y ) = nm1. Suppose; by absurd, that t ( y ) 5 nm2. Let [(y ) = n  m  1 4 , with h > 0. This leads to the false relation (z,m+h) EV. Indeed, t ( y ) = n,h1 < nmh and 4(y,t (2)) = z,thus showing that (z,m+h) E V(4)= V. The just proved equality t ( y ) = nm1 shows that
EX*l t(z ) = n,mv(z) = m } 5 card{y EX’ It (y) = nm1)
card{z =
pnml
0
We continue this section with a result establishing a precise relation between the KOLMOGOROV complexity K, and the critical level induced by the ML test V(#).
(6.10) Theorem. Let V = V(4)be a representable ML teat. The following aseertions hold for all z in X.: my(.)
If my(.)
=0
iffK,(z I+))
2 t(z)l
*
> 0, then K + ( z It (2))= t (z)mv(z)l
.
(54 (5.9)
In the particular case when range(#) = Vl, the equivalence (5.8) can be stated more precisely, namely:
348
Cdudc
Proof. Assume mv(z) = 0. Therefore (z,1)# V = V(+),i.e., for every string y in X’ with t ( y ) < t(z)1, we have +(y,t(z)) # 2 . Then, either +(y,t(z)) # 2 , for all y in X * (which shows that K,(z 14(z))= co),or their exints a string y in X* with +(y,e(z)) = z, but this y must have e(y) 2 e(Z)i. so, K,(Z l e ( Z ) ) 2 e(z)i.
2 t (z)l. There are two cases: then +(y,e(z)) # 2, for all y in X*,and then
Suppose that K,(z It (2)) i) if K,(z le(z)) = q (ZJ)B
v(4)
=
v,
ii) if K,(z le(z)) < cq then there exists at least one y in X* with d(y,t(z)) = 2, and one must have [(y) 2 e(z)l. This shows that (ZJ)6!
V(+)= v.
Hence (5.8)was proved. According to the hypothesis, there exists a string y in 2. We have:
X* such that
4(y,t(z)) =
card{z
EX*le(z) = p+l,(z,l)E V(+)}= t > (p’l)/(p1)
,
fde ch4.5, 1. 587 (ms 347):
m v k ) = mq,,(4 = max(m
E N Im 2 l,+(y,t(z))= 2 ,
for some y in X*with t (y) < t (z)rn) = max(m
E N Irn 2 l,+(y,e(z))=
for some y in
X*with
m
2,
< t(z)e(y)) .
The last maximum is attained for those y in X * which are of minimum length, i.e. for those y in X* with t (y) = K,(z It (2)). So, mv(z) = t ( z )  K + ( z lt(z))l
.
In the particular case when range(+) = V , we have: if mv(z) = 0 , then ( z , l ) # V, i.e. z range(+). Hence K,(z “(2)) = oa 0
C range(+). So, the condition V , = range(+) Remark. We have (V(+)), in Theorem (5.10)can be equally stated as range(+) C V,.
349
Chapter 4
X N S,X* be an universal KOLMO(6.11) Corollary. Let w :X* GOROV algorithm. Then, range(w) # (V(W))~.
Proof. Use Theorem (5.10) and the relation Ky(zle(z)) # cq for every z hX*. 0
Recall that the enumeration of X* in the lexicographical order induced by a y < az mh.
We
It remains to show that s(tm1)(rh) 2 1, i.e. r   h + l 5 (p‘l)/(pl). This relation follows from the inequalitiee rh+l
5 card{z EX*It(%)= t , ( z , m ) E V) L (Pl4AP1) *
It is worth adding that in caae V is fmite the procedure eventually halts. Property (6.1) is a coneequence of the injectivity of g:(zi,mV(zi)) # (mj,mdzj)) iff zi # z j or mv(zi) # mv(zj). This implies that for distinct i and j one must obtain dirrerent value8 4(zi,t?(zi)) = zi and +(zi,t(zj)) = zj. We prove now the inclueion: V C V(t$). Indeed, in case (z,m) is in
365
Chapter 4
V, let (z,rnv(t)) = (zi,rnv(zi)), in the enumeration given by g. So, rn 5 rny(zi), and ti = #(zi,t (ti)),where the length of zi is less than t(zi)mv(ti)l, i.e., K+(z (t(z))5 t (zi)rnv(zi)I < t (z)mv(z) 5 t (z)rn, showing that (zp)E V(4). It is seen that for every z in X* for which (z,1) is in V(d),there exists a natural number i 2 1 such that 2 = zi, and (zi,mv(zi)) EV. It follows that (z,l) .EV; hence (6.3) was proved. All it remains to show is the recursivenees of the graph.of 4. T h i ia proved by taking arbitrarily ((z,t),z) 2 (z,t,z) in X*x N X X*,and checking if ( z , t , z ) belongs to the graph of 4, according to the following algorithm (recall that r n V is a recursive function in view of Lemma (4.10)): 1. If mv(z) = 0, no. STOP. 2. If t (z)# t , no. STOP. 3. Chooee i such that g(i) = (zi,rnv(zi)) and z = zi. 4. Run enough steps in the procedure defming 4 in order to find zi. 5. If t = zi, gC8. STOP. 6. No.STOP. 0
Remark. For a given recursive ML test V there are many p.r. functions
4 satisfying Theorem (6.1), e.g. our construction depends on the enumeration function g. The converse implication in Proposition (5.9) also holds for recursive ML tests. (6.2) Theorem. Let V be a recursive ML test. Then the following conditions are equivalent:
The ML test V is representable, card{z EX*l l ( z ) = n , r n v ( ~ )= m } 5 p”’ for all naturals n
>m >0 .
(6.9) 3
(6.10)
Proof. The implication “(6.9) (6.10)’’is in fact a weakened form of Proposition (5.9). We deal with the converse implication. We shall prove that V = V(4),where 4 is the p.r. function constructed in Theorem (6.1). All it remains to prove is the inclusion V(4) C V. Take (z,rn) in V(4). In any caae (z,l) E V (see Theorem (6.1)). We shall prove that (z,rn) is in V by showing that my(.) 2 rny+)(z). For the sake of a contradiction, assume that mv(t) < mq&). It followa that (z,rnv(z)+l) is in V(d),hence there exists a atring a in X’
356
Cdudr
with ! ( z ) < !(z)rnv(z)l and
b(z,P (2))
=
2.
Let g(i) = (zi,mv(zi)),where z = zi, in the enumeration given by g (see the construction of I# in the proof of Theorem (6.1)). We let the procedure giving 4 run enough steps and we obtain the string zi such that I#(zi,l(zi)) = zi. We shall show that e(zi) = e(zi)mV(zi)l = t! (z)mV(z)l, thus deriving a contradiction (in view of the injectivity of #; see (6.1)). Remember the action of 4. In case e(z,) # [(zj),for all 1 2 j < i, we have !. ( z j ) = !(zi)mv(zi)l, and the proof is finbhed in this case. In CBBe
e (2j(2)) =...= e ( Z j ( & ) ) = e (zi) , 1 2 j(1)< j ( 2 ) ...> m ~ ( z j ( i t L) ) 4 . i )
*
0, so r ( t ) = r l ( t ) . Consequently, for an infiity of c dom(.r), (7.12) holds.
t E dom(r')
0
(7.6) Lemma. (MARTINLOF [1971)) Let f:RV function such that
+
RV be
a
recursive
00
C p  J ( n ) = 30 .
(7.13)
n d
Then we can effectively fid a recursive function
f':m
4
PI such
that w
.
p1
=
co ,and
(7.14)
niO
for each c E N,there exists a natural that f'(n)
2 f(n)+c, for all
2 N,
N, such
.
(7.15)
Proof. We defme, by primitive recursion, the recursive function F:N + RV: F(0) = 0
,
F(m+1) = pn[n > F ( m ) , and
2
P'(~)
> P"]

i=F(m)+l
Finally, defme f * by: f(n) = j(n)+m
if ~ ( m (1p)p'
,
(8.4)
card{z
EX*l!(z)
> (lp)pr
,
(8.5)
we have:
for every r
= r,f(n,z) = g(n)}
2 t.
Proof. We proceed by induction upon s = rt. fact (8.4). Consider the sets:
If 8
= 0 , then (8.5) is in
A = {z EX* l[(z) = r,f(n,z) = g(n))
(8.6)
and
B
= {y
EX*lg
= zui, for some
z in A and ai in X}
.
(8.7)
Suppose that cardA
> ( 1  p ) ~ ~.
Clearly, cardB = p cardA
> (1p)pr+' .
(8.8)
Furthermore, for every y in B (notice that t? (y) = r + l ) we have, by hypothesis and condition (8.1), f(n,g) = g(n). In view of (8.8) it follows that card{g E X * "(y) = r f l , f(n,g) = g(n)} 2 cardB > ( 1  p ) ~ ' ~ ' . 0
372
Cdude
Remark. Lemma (8.4) holds a h when
> is replaced
.
by 2 Moreover, the recursiveness of p can be dropped here; this condition will be used in Theorem (8.5).
(DE LEEUW, MOORE and SHANNON [1956], MA" [1973]) The class of all partial functions computed by probabilistic algorithms coincides with the clasa of p.r. functions. (8.6) Theorem.
Proof. If g:N 4 N is a p.r. function, then g is ccomputed by the probabilistic algorithm f :Nx X* 4 N defined by f(.,~) = g(n), for all z in X*and E = 22. Conversely, we shall prove that the partial function ccomputed by the probabilistic algorithm f as in Defmition (8.1) ia a p.r. function. Actually we shall present a procedure which computes the value of g for an arbitrary input n in EV: 1. Run the fvst step in the computation of f(n,z), for all z in with P(z) = 1.
X*
2. If for no z in X*with P(z) = 1, the computation halts within one step, then go to step 5.
3. In the opposite case, there exists a string z in X* with e(z) = 1 and f(n,z) halts in one step. Denote by n, the output thus obtained. If
4.
f(n,z) = nl}
card{z EX*le(z) = 1, f ( n , z ) halts in one step and > (1c)p, then g(n) = nl. STOP.
5. Run the fvst two steps in the computation of f ( n , z ) for all z in
X*with e (2) E {1,2}.
8. If for no z in X*with [(z)= 1, the computation halts within two steps, then go to step 9.
7. In the opposite case, there exists a string z in X* with t ( z ) = 1 and f(n,z) halts within two steps. Denote by n l the output thus obtained
.
8. If card{z E X * le(z) = 1, f(n,z) halts within two steps, and f(n,z) = nl)> (1c)p, then g(n) = n,. STOP.
9. If for no z in X*with P ( z ) = 2, the computation halts within two steps, then go to step 12.
10. In the opposite case, there exists a string z in X* with P(z) = 2 and f ( n , z ) halts within two steps. Denote by n2 the output thus obtained. 11. If card{z EX* lP(z) = 2, f ( n , z ) halts within two steps, and f(n,z) = n2}> (le)p2, then g(n) = n2. STOP.
12. Run the fvst three steps in the computation of f(n,z), for all
2
373
Chapter 4
in x' with t ( z ) E {1,2,3}. As.0. It is seen that the above procedure acts algorithmically (since c is a recursive real!). Two possibilities may occur. If for all natural numbers m and t , f(n,z) does not halt within m steps or card{z EX*le(z) = t , f(n,z) halts within m steps, and f(n,z) = k} 2 (lc)pt, for every k in RV, then g(n) = a In the opposite case, there exist the natural numbers m, t , and k such that card{z E X * It (2) = t,f(n,z) halts within m steps, (8.9 1 and f(n,z) = k} > ( 1  e ) ~ ' , and this inequality holds fnst for the given m and t . The procedure asserts that g(n) = k. Indeed, condition (8.9) cannot hold for a fmed t and different k's according to the fact that c E [0,2']. According to (8.2), the inequality (8.9) holds at leaat for some m, k and t = te,n. Moreover, in view of relation (8.1) and Lemma (8.4), (used for p = Q, t = t,,,) for d m' 2 m and t' 2 t the inequality card{z EX* lt(z) = t', f(n,z) halts witbin m' steps, and f(n,z) = k} > (lc)p*', holds too. 0
Fix a probabilistic algorithm given by a recursive function 4 nV which ccomputes the recursive function g:RV + RV.
f :pV x X*
For every recursive function h :RV + RV we consider the set:
~ ( h=){(z,m) Iz EX*,m E N  { o } ,
r(Wz)),z)f g ( h ( W ) ) , card{v
EX*l l ( v ) = W , f ( h ( W ) ,
> (1PAP1NPV
Y ) = s(h(C(v))N
*
(8.10)
(8.6) Lemma. The set W ( h )is a recursive ML test.
Proof. Clearly, W ( h ) is a recursive set. If (z,m) is in W(h)L+', for some , natural k 2 1, then f(h(t(z)),z) # g ( h ( t ( z ) ) ) and c a r d b EX*lW = W , f ( h ( W ) , v = ) o(h(W))}
> (1p ++')/(p l))p[ > (lpk/(pl))p~(*)
(=)
.
Consequently, (z,m) is in W(h)b. Finally,
374
Calude
EX*It (2) = j,(z,rn) E W ( h ) }
card{z
0, and i s ignored in case z = 0. There are no restrictions on uses of the loop variable within the scope of the loop. Notice that the execution process may change the value of the loop variable only by an arithmetical instruction; this change does not affect the number of executions of the loop scope. For example, the loop program
x
INPUT LOOP
x x = x+l
EM) OUTPUT
x
can be equivalently written
INPUT X
Y=X LOOP
x Y = Y+l
END
X=Y OUTPUT X (2.2) Definition. A function f : W ' + I?, rn
2 1, is called a
computable function provided there exists a program P in XI,...,Xmaa input registers and Y as output register such that
loop
L having 3 we hi
tially input zl, ...,z,, in XI,...$,,,, respectively, and set all remaining registers to rero, then P halts (i.e. one attains the output statement) and the content of Y is = f ( z l , 2,). Notice that Y may be one of the Xi's.
...,
Denote by
L the set of all loopcomputable functions.
Remark. Due to the specific form of the instructions composing the loop programs it follows that each such program always halts. (2.a) Example. The loop program
INPUTX,
LOOP
x Y
END
=
OUTPUT Y
Y
Y+l
Chapter 5
387
computes the sum function: z+y. 0
(2.4) Example. The predecessor function P d ( z ) = z Q1 puted by the loop program
INPUT
z=o
can be com
x
Y=Z
LOOP
x
Y=z
2 = z+1 END
OUTPUT
Y
(2.6) Example. The arithmetical difference function z p y is loopcomputable:
INPUT x, Y LOOP Y z1 = 0 Y1= z1 LOOP x
Y1= 21 21 = Zl+l
END
x = Yl END
OUTPUT
x
Remark. In view of Example (2.4) we may write, in a short form, the program displayed in Example (2.5) as follows:
INPUTX, Y
LOOP Y
X=X&l
END
OUTPUT x It is worth noticing that the above compact form is not just a correct loop program, for the simple reason that X = X A1 is not a permissible
388
Cdudc
instruction. The reader can easily realire that the introduction of such “subroutines”, which can be replaced by loop programs, does not affect the correctness of our reasonings. (2.6) Example. The sign function ao(z) is loopcomputed by the pro
gram
INPUT Y=O
x
Y = Y+l LOOP
x
Y=O
END OUTPUT Y U
Remark. It ie seen that the introduction of “dummy” input registers does not affect the correctness of loop program.. The main result of this section is (2.7) Theorem. (MEYER and RITCHIE [1967a], [1967b)) The class of primitive recursive functions coincides with L.
Proof. To prove that every primitive recursive function is loopcomputable we proceed by structural induction (see Defmition (1.3.1)). Firstly, we write the following loop programs which compute the base func tions: Succ(2) = z + l :
E(Z1,...,2 ” ) = zi: Cnr(Z1, ...,2,) = rn:
INPUT x x = x+l OUTPUT X INPUT X,, ..,.X, OUTPUT xi INPUT XI, ...&
Y=O
Y = Y+l Y = Y+l m times
Y = Y+1 OUTPUT Y
Chapter 5
389
Secondly, we prove the closure under functional composition and primitive recursion. If f :mi"' + IV, n 2 1, is obtained by functional composition from the functions h :RV"' + N ,m 2 1, and gl,. ..,om :W + N , then f is computed by the following loop program:
2 , = 9m(Xl,...Jn) Y = h(Z1,...,Z,,,) OUTPUT Y provided h and gi, 1 5 i 5 m are all loopcomputable. Notice the use of the subroutines computing the functions h and pi, 1 5 i 5 m, in the program above. If f:W+'+ N ,n 2 0, comes by primitive recursion from the loopcomputable functions g :W+ IV and h :BV"+' + RV, then f can be computed by the 1oop.program
INPUT XI,..&, 2 y = dXl,...Jn)
u=o
LOOP 2 y = h(Xl,...Jn ,u,q
u = u+1
END OUTPUT Y
(2.9)
The correctness of the above program can be proved by induction the content of 2 by noticing, a t the induction step, that the prograp (2.9) on the inputs z l ,...,z,, and z = n+l,is equivalent to the program
390
Caludc
on the inputa zl, ...,q,,and z = rn. (Recall that the content of the register 2 is 2 . ) The converse implication, i.e. every loopcomputable function is primitive recursive, w i l l be proved by induction on the length of loop prog r a m (i.e. on the number of instructions of type (2.1)(2.5) occurring in the programs). Obviously, the programs having no instructions, M well as the programa consisting of a single instruction compute primitive recursive functions. Let P be a loop program consisting of more than one instruction with Xl, ...& as input registers and Xi, 1 5 i 5 n, as output register. Assume that all loop programs with fewer instructions than P compute only primitive recursive functions. We shall prove that P itaelf computes a certain primitive recursive function. The proof falls into two cases according to the form of the last instruction (recall that the declarative statements INPUT/OUTPUT do not count in our inductive analysis). cusc 1: the lust i n s t r u c t i o n in P i s not END. It foflows that the last
instruction in P must be of type (2.1), or (2.2), or (2.3), since the LOOP instruction is always followed by an associated END. The program P can be of the following three forms: a)
INPUT Xi,...,X,,
Q
x=o
OUTPUT Xi
b) INPUT Xi,...J,,
Q
X=Y OUTPUT Xi C) INPUT Xl,,..J,,
Q
x = X+l
OUTPUT Xi
where Q is a loop program. In subcase a) the output ia 0 in case X = Xi, or is exactly the output given by the loop program Q (which must have fewer instructions than P), in case X # Xi. Consequently, the function computed by P ia either Cp)(zl,...,z,,), or the primitive recursive function computed by Q. The reader can now easily supply the details necessary for proving that in subcaees b) and c) the program P also computes a primitive recursive function. Cusc 2 the Zast i n a t r u e t i o n in P i s END. Then P must be of the
391
Chapter 5
form
xl, ...,& xj
INPUT
Q LOOP
R END OUTPUT xi where Q and R are loop program for which the induction hypothesis applies. Assume that Q and R (with input registers Xl, ...& and the outcompute the primitive recursive functions q,:W + N put register Xt) and r, :W+ N ,respectively; here 1 5 t 5 n. It is seen that the above hypothesis does not decrease the generality since we can suppose that
Xl,...,Xnare all registers appearing in P. Denote by fi:W + nV the function computed by P. By induction on the value q,(zl,...,2,) (i.e. the value of the loop variable Xi) we can prove that
fi (z1,.**+n) = S(q1(z1,*+n
),.*.,qn
(zl,..*,z))n
9
(2.10)
where
6.8.
LOOP HIERARCHIES
A hierarchy (L,),zo of *the class of primitive recursive functions, barred on the depth of the nesting measure for loop programs, ia
392
Caludc
constructed. A refmement of this hierarchy is obtained by counting the number of instructions of depth n (we intersperse a new hierarchy (Li)k,o between LnAl and L,,). We begin with the hierarchy (L.), 20.
(MEYER and RITCHIE (1967aI)  the set of all loop programs having no loops (i.e. a) Denote by Lo
(8.1) Definition.
the set of all finite, possibly empty, sequences of arithmetical instructions limited by INPUT/OUTPUT statements). For every natural n 2 1, the set L , is generated by the following three rules: 
If P is in
then the loop program consisting of
LOOP x
P
END and arbitrary INPUT/OUTPUT statements is also in L,. 
If P and Q are in L,, then the loop program consisting of
P
Q
and arbitrary INPUT/OUTPUT statements is also in
b)
Ln. A program P in L,,  Ln,has a depth of m e t i n g n.
(3.3)
c ) Denote by L,, the set of all numbertheoretic functions which are computable by loop programs in I,.
(1.2) Example. AU loop programs that compute the base functions in the proof of Theorem (2.7) have depth of nesting 0, so they belong to Lo. 0
(8.8) Example. The program computing the sum function in Example (2.3) has depth of nesting 1. 0
393
Chapter 6
Remark. From Defmition (3.1) it follows that 00
Lo
C
L1
C.*C Ln C*C L =
U Li
(3.4)
i4
Our fvst aim is to prove that (3.4) is a proper hierarchy of the class of primitive recursive functions. In view of Theorem (2.7) all it remains to prove is that Ln # L,+l, for all naturals n. To this aim we defme the following sequence of unary functions. For each n 2 0, the function t, :IV + EV is defmed by
1, 2 , to(.) = 2+2
ifz=o, ifz=l, , otherwise,
tn+,(z) = t,L(1)
(Recall that f " ( y ) = f(f(...f(y)...)), z times, for z The following formulas are obvious *l(') =
i
(3.5)
*
> 0, and
fo(y) = y.)
1, ifz=o, 2 *z, otherwise,
t z ( z )= 2"
, ifz=o,
(t,),,
The next result gives the monotonicity properties of the sequence >d. The proof by induction will be omitted.
(a.4) Lemma. The following assertions hold:
tn(z)2 z+l, for all n and z
,
(3.8)
The function f :Ns + N given by j(n,k,z) = tn)(z) is increasing in all arguments,
(3.7)
2 * t ; ( z ) 5 t:+'(z), for all
(34
k,z 2 0, and
21 z+tn)(z) 5 t;+'(z), for all k,z 2 0, and n 2 1 n
,
.
(3.9)
394
Cdudc
For all naturals n and k we can fmd a natural j (depending upon k) such that t,t(z)
< tn+l(z), for all z 2 j .
(3.10)
P having the input registers we associate the czeeution time function
(8.6) Definition. To every loop program
X,,
...&
Timep:hF +
IN ,
...,
given by Timcp(zl, z,) = the number of instructions executed by P on input (zl, ...,2.), We make the following counting convention: a) the execution of an arithmetical instruction increases by one the number of executed instructions, b) the LOOP statement counts only a loop in entered, c) the END statement counts each time the program reaches the end of the loop, d) the INPUT/OUTPUT statements do not count. (8.6) Exampie. Let P be the loop program in Example (2.4). Timep(l) = 6, Timep(2) = 9.
Then 0
Remark. We can think that Time is the restriction to the class of primitive recursive functions of a certain BLUM complexity measure (acting on a suitable “larger” universal programming language). See Section 5.4.
Ln,
(8.7) Lemma. if P in a program in n 2 0, with X, registers, then we can effectively fmd a natural t such that Timep(zl,
...,z,) 5 t,t(max(zl,...,2,))
,
,...J,
as input
(3.11)
for all z,,...,z , in Af.
Proof. We proceed by induction on n. In case n = 0, no loop belongs to P, so Timcp(zl, z,) = constant = the number of arithmetical instructions in P. Consequently, we can take k to be the constant above, and the result follows from (3.5) and (3.6). Aaaume that (3.11) holds for some n 2 0, and let P be a program in L,+,. In view of Defmition (3.1), we must analyse three cases, according to the fmal rule used in the construction of P. Case 1. The program P is in fact in L,,.In t h i case the result follows from the inductive hypothesis and (3.7): Case 2. The program P is of the form
...,
395
Chapter 5
xl,...J, xj
INPUT LOOP
P
END
OUTPUT where
P
xi
is in
X1,...J,,,are
Sn (without
all registers in
losa of generality we have assumed that
P). Denote by g the value max(zl,...,2,).
If n = 0,then P' is in go, so k, for some k 2 0, (here k is the number of arirhmeti, ) = c d instructions composing P). Consequently, n'mcp(zl, ...,z l+(l+k)zj 5 1 + ( 1 + k b m, the inequalities ti:i(m) 2 t:+'(m) = 2'+'m 2 m(k+2), for m, k _> 1, and (3.6), (3.8).
396
Cdudc
Case 9. The program
P ia of the form
INPUT XI, ...Jm PI
PZ
OUTPUT xi Each program P, may be in &,, or &,,+I; in where Pi, j=1,2, are in the laat case, Pjmust be of the form in Case 2. Four cases may appear according to Pj being in L,  or in & n + l . The result follows from the formula Tirncp(z,,...,)2, = Tirnepl(zl,...,z ,) + Timep,(zl ,...,z,), the induction hypothesis, the analysis made in Case 2, and (3.8). U
(8.8) Corollary. If f : P + JV, rn 2 1, is in L,, n 2 0, with XI,...,Xm as input registers, then we can effectively fmd a natural k 2 1 such that f(21,,zrn)
for all zl,. ..,z, in
L t:(mm(z1,**+m,1))
(3.12)
RV.
Proof. Let P be a program in L,  that computes f . For n = 0, if P has k arithmetical instructions, then
f (zl,...,2,) 0 we 5
use Lemma (3.7) to obtain a constant k such that tt(max(zl,...,2,)). It follows that
f (zl,...,zm) 5 max(z 1,...,zm)+ Timep(z1,...,2,) 5 max(zl,...,z,)+t~(max(zl, ...,2,)) 2 tnLf1(max(Z1,...,2,,1))
,
for all z 1,...,2 , in N (we have used (3.9)).
(8.9) Theorem. Lnl f
L,.
(MEYER and R I T C H E [1967a]) For every
n >0,
397
Chapter 5
We show that tn EL,L,,l.
For all naturala n and k, t,(z) > for all z > j , where j is a certain natural depending upon k (see (3.10)). Hence, by Corollary (3.8), t, cannot be in L,l. To complete the proof it suffices to show that t, EL,, for each n 2 1. The following program in
Proof.
INPUT X Y=O Y = Y+l LOOP
x
x = x+l
Y=X END OUTPUT Y computes the function t , . If t, is computed by some program in the program computing tnfl
INPUT
&,,
then
x
Y=O Y = Y+l
LOOP
x
Y = tn(Y) END OUTPUT Y hence will be clearly in L,+,, Remark. It is seen that t ,
tn+l is in f n + l .
B La.
Notation. The hierarchy (Ln)n20is known as the loop hierarchy. We are going to refme the loop hierarchy by additionally counting the number of in8truetions of depth n . This number will be called the loopconcatenation number.
(8.10)Definition. (GOETZEand NEHRLICH [1978]) a) Denote by n > 0, the smallest class of programs in that
&A,
hn1
C &n 1
and if Pi is in Lnl for i=1,2,3, then the loop program consisting of
k
such (3.13)
398
Cdude
LOOP x
p2 END ps (3.14) and arbitrary INFWT/OUTPUT statements is also in L,!.  n > 0, consists of all concatenations of k b) For k > 1, the class L:, 1 programs in L,,. c) denotes the set of all numbertheoretic functions computable by programs in 4;. 
f.:
Notation. It is convenient to introduce the following notations. If A and sets of loop programs, then we denote by A 2 the set of all programs consisting of
E are
P
Q
where P E A, Q El?, and arbitrary INPUT/OUTPUT statements. By A('), k 2 1, we abbreviate the expression A &..A,k times. Finally, by < A > we denote the set of all programs
LOOP
x P
END (with P
E A and arbitrary INPUT/OUTPUT statements).
Remarke. a) For all naturals n
2 0, i 2 1,
=
L,,.
b) Using the just introduced notation we can write the formula > k,,l)('), for all n , k > o (trivially, ~i = kn1).
k: = knl (
~is an enumeration of all unary p.r. functions and every w j'):Na RV can be obtained from two fmed primitive recursive functions p :N+ N ,T : N Sc (0,l) by means of the formula wj*)(z) = p ( w [ T ( j , z , v )= 11)
.
In view of Theorem (2.7) all it remains to show i that the operation of minimisation can be accomplished by general programs. More exactly, ...,.X,,, Y assume that: a) P is a general program with input registers Xl, and 2 as output register, which computes the (total) recursive function f :W+'+ N ,n 2 1, b) Wo,Wl,...,W,, V are names of registers not used in P , c) La is a Label not used in P. Under these circumstances the general program
INPUT W1, ...,wn
XI
=
w,
x, = wm
La CONTINUE Y = w, P
w,= W,+l I F 2 z 0 GO TO v=o LOOP w, w,= v v = v+r END OUTPUT
La
w,
exactly computes the p.r. function 4:" 4(21,**,2m)
A N defmed by
= c ( Y [ ~ ( z ~ , * * . ,= z ~0,1Y )*
Obviously, the functional composition can be realised by general programs; this completes the proof. 0
On the basis of Theorem (4.5) we can extend the execution t h e function Timcp:N"' + gY, associated to the loop program P to general progrsms. We obtain a partial function, also named Timep,
Chapter 5
n'mcp:W S , N
...,
407
,
defmed by n'mep(zl, 2,) = the number of instructiom executed by the , ) , in cam P eventually halta, and general program P on input (zl, z n'mcp(zl, 2,) = oq in the opposite case. The instructions (2.1)(2.5) are counted aa in Defmition (3.5); the instructions (4.1) or (4.2) count M an unit; the INPUT/OUTPUT statements do not affect the counting. The reader can easily develop a numbering of general programs leading to an acceptable gijdelisation of all p.r. functions for which the associated time partial functions satisfy BLUM axiom. More precisely, if P,,P1, iS a systematic numbering of all general programs and &,dl ,...,d, are the unary p.r. functions they compute, then (d,),z0 becomes an acceptable @delisation and the sequence (Timcpm),>o  will be a BLUM's computational complexity meaaure.
...,
...,
...&,... ,...
6.6. A
DYNAMIC CHARACTERIZATION OF LOOP CLASSES
We use the execution time functions to obtain a dynamic characteriaation of the classes L, and f:. As a consequence, we deduce that f,, Lk, as well aa the class of all primitive recursive functions are complexity c h e s with respect to a suitable BLUM space. Fmally we compare SUDAN and loop hierarchies. First we give a complete characterbation of L, in terms of execution times. Thia w i l l be done by showing that the implication in Lemma (3.7) is in fact an equivalence. (6.1) Theorem. (MEYER and RITCHIE [1967a], [1967b]) Fix the naturale m 2 1, n 2 3. Then for every function f :P + N,f e L ,, iff there exist a loop program P, with XI,...&,M input registers, which computes f and a constant k such that: n'mcp(21,...,z,)
for all zl,...,z,
in
RV.
I t:(m=(zl,...,z,))
,
(54
408
Cdude
Proof. (The technical details are due to S. BUZETEANU.) h u m e existence of a loop program P and of a constant k satisfying hypothesis of the theorem. We shall prove that the function f :N“‘ computed by P is in L,. Let Q be a program in L,  that computes
the the

IV
the
furthermore, assume that the output of Q is function l+Lt(max(z,, ...,2,)); T, a register different from all Xi, 1 5 i 5 m . Denote by Zl, fe the instructions composing the program P. Furthermore, anaume that P works ...& as input registers and Y as output register. We shall use with Xl, some new registers Cj, V,, R j , Ej in order to write a new loop program in L_, which simulates the program P. Firstly, we describe a procedure to replace each instruction Z, by a certain loop program P,. The analysis falls into three cases, according to the type of instruction.
...,
If Zj is an arithmetical instruction, then Pj is
LOOP
v j
I,:
vj = 0
v,+l= 0 v,+, = v,+1+1
END
Notice that the fmal value of Vj+l is 1; the effect of this assignment consists in the selection of the next instruction.
If for some 1 5 8 < r , Z, is of the form “LOOP X ” , and f, is the associated “END”, then P, will be
v, v, = 0
LOOP
R, = 0 R, = R,+I
c, = x
END
LOOP R,
R,
=0
v,,, = 0 v,,, = K+,+1 LOOP c, v,,, = 0 v,,, = 0 v,,, = v,+,+1 END
END
(select the next instruction to be executed)
409
Chapter 5
and P, will be
v,
LOOP
v,=O
R, = 0 R, = R,+1 E, = 0
END LOOP R, LOOP
c,
C, = E,
(C,= c, J1)
E, = E,+1 END
END (C,is the loop variable; in case C,
= 0, the next instruction to be executed is Z,+l; in the opposite case, i.e. C, > 0, C, is decreased by 1, and the rust instruction of the loop is selected by means of the “semaphore”
R, 1 The loop program INPUT
P can now be equivalently written as follows:
xl, ...&
Q
v, = 0 v, = V,+l LOOP T Pl
p. END
OUTPUT Y A little reflection will suffice to see that the loop program works (see
Ln;
also Example (5.2)). The loop program Q is in the remainder loop program ie in &. Consequently, the resulting program belongs to thus proving that f is in L,.
Ln,
0
410
Cdudr
(6.3) Example. Conaider the loop program
x x x = x+l LOOP x
INPUT
Y=O LOOP
x = x+l LOOP
x x = X+l
END END
END
Y=X
OUTPUT Y Using the procedure described in the proof of Theorem the following equivalent loop program:
INPUT X T = t:(X)
T = T+1
v,= 1
LOOP T LOOP
END
LOOP
v, Y=O v,= 0 v2 = 1 v, v, = 0
R, = 1
c, = x
END
LOOP R2
R2 = 0
v,,= 1
LOOP
END END
LOOP
c,
v,,= 0 v, = 1
v, x = x+l
I2
(5.1)we
get
41I
Chapter 5
v, = 0 v4= 1 END
LOOP
v4 v4 = 0 R4= 1
c, = x
END
LOOP R4 R4=
0
v,, = 1 LOOP c 4 v,,= 0 v6 = 1 END
END
LOOP
v6
x = x+l v6 = 0 v, = 1
END LOOP
v, v, = 0 Re = 1
ce = x
END
LOOP Re
Re = 0
v, = 1 c, v, = 0 v, = 1
LOOP
END END
LOOP
END
LOOP
v, x = x+l v, = 0 v, = 1 v, v, = 0 Re = 1 Ee
END
0
13
412
Cdude
LOOP Re
ca
LOOP
(78
= E6
Ea
=
E,+1
ENI) END
LOOP
v, v, = 0
R4 = 1 E4 = 0 END LOOP
R4 LOOP c4 C4 =
E,
=
E4 E4+1
END END LOOP
v,,
v,,= 0
Rz
= 1
Ez = 0 END LOOP Rz LOOP
cz (72
=
Ez
=
E, Ez+1
END END LOOP
v,, Y = X
v,, = 0 v,,= 1
END END OUTPUT Y The reader will notice the abbreviation above.
V, = 1
used in the program 0
413
Chapter 5
(6.8) Corollary. For d naturals m 2 1, n are equivalent: The function f :W+
2 3, the following assertions
nV is in L,
There exist a program
P in L_,  computing f
and a function g : W
+
ZXmcp(2,
,...,z,)
nV
in
.
(5.2)
L, , such that
2 g ( z l,...,zm),for allzl ,...,z, in RV
.
(5.3)
Proof. Immediate from Theorem (5.1). 0
(6.4) Corollary. The statement in Corollary (5.3) holds too when replacing f, by Li,for all k 2 1, n 2 3.
Proof. Immediate from the proof of Theorem (5.1), Remark a) following Defmition (3.10), Lemma (3.17), and Corollary (5.3). 0
(6.6) Corollary. A function f :W+ RV, m 2 1, is primitive recursive iff there exist a loop program P computing f and a primitive recursive function g : P + RV such that the inequality (5.3) holds.
Proof. We use the Theorem (2.71, the fact that (L,),Lo all primitive recursive functions, and Corollary (5.3).
is a hierarchy of 0
Remarks. a) In Corollary (5.5) we may equally use the genera1 programs instead of loop programs; in this case we can work with the extended partial function Timep introduced at the end of Section 5.4. b) In view of a), a function is primitive recursive iff it can be computed by a general program running “a primitive recursive number” of instructions. c) It is now easy to realise the “practically noncomputability” of nonprimitive recursive functions, and even of primitive recursive functions in f,,fn,, for n 2 4 (because their time function must grow faster than the function
414
Cdudc
t&) = 2
1 . .
,I
}
2
times ,z > o .
(6.6) DePlnHion. (RITCHIE [1963], MEYER and RITCHIE [1972]) A c l w of recursive functions is computationtime closed providing that a
function belongs to the c l w iff the function can be computed by a general program P for which n’mcp is bounded by some function in the class.
Remarb. merely state that L,, L: (for k 2 1, a) Corollaries (5.3)(5.5) n 2 3), and the class of all primitive recursive functions are each computation t ime closed. b) Denote by TIME(h) the complexity class of the recursive function h:N + N with respect to the BLUM space ((Pi),(nmepi))(Bee also the end of Section 5.4). By a) we can write
{f If { f If
unary,
f E L n ) = IJ TIME(h) h EL, h~ U
u
UnSYT, f E f 3 =
h EL! h ~ U
9
J
TIMEP)
9
J
for n 2 3, k 2 1. Furthermore, in view of the monotonicity properties of the sequences of functions (ti)i l oand (bt*p),,k,,20, we deduce the relations {f
{f
f E L,) =
If
unary,
If
unary, f E ~
00
u TIME(t,P) ,
P d 00
f =) u T I M E ( ~ : * P,) P=o
If
2 3 and k 2 1, which prove that the sets {f unary, f E f,}, {f I f unary, f E L:} are complexity claeses (we have used the Union Theorem (Theorem (3.6.1))). Finally, again the Union Theorem guarantees that the class of all unary primitive recursive functions is a complexity class. We close this section with a result relating the structural hierarchies d i n c u e d in Chapter 1 and the loop hierarchy. Recall that ( S , ) , l o is SUDAN’S hierarchy and 8, consists of all unary functions in Sn. for n
415
Chapter 6
(6.7) Theorem. For every natural n
2 2, S,
=
L,.
L,, n 2 2. In view of the Proof. F i t l y we prove the inclusion S, results established in Section 1.6 we must only show that 8 , C L, (because ROBINSON functions R("') are obviously in L,, and L, is closed under E(z), functional cornposition). Consequently, we must prove that SUCC(Z), S,,(z,z), S,(z,z) are in L,, and that L, is closed under sum, product, composition and limited iteration. This reduces to the following two statements: a) S,(z,y), s,(%,~)are in f,, b) L, is closed under limited iteration. a) Clearly, S,(z,y) = z + y is in f 2 (see Example (2.3)). If S,(z,y) is in L,, then S,,+l(z,y) can be computed by the loop program
c
...,
INPUT X,Y
z=x
LOOP Y
T = Z+Y T = T+l
z = %(Z,T)
END OUTPUT 2 so, %+I(Z,Y)
is in
L,+1.
b) Asaume that h , g : N + JV are in L,, and f :JV + JV comes from h and g by limited iteration. Consider the loop program P:
x x
INPUT
Y=O LOOP
Q
Y=Z END OUTPUT Y which computes f in case Q is a program in L, computing A (Q works with Y and 2,respectively, aa input and outputregisters). We have: Timcq(z)5 tn((z)
,
and for all z in bv; the constants q and r come from Theorem (5.1). It is seen that
416
Cdude
nmep(2) 2
f+(t+z(tt”(z)+t))
,
for all 2; since the function in the righthand side of the above inequality is clearly in L, it follows, by Corollary (5.3), that f is a h in L,. Secondly, we deal with the inclusion L, C S,, n 2 1. We proceed by induction on n. For n = 1 the result is clear (if not see Theorem (7.6)). h u m e L, c S,, and let f :hF + RV, m 2 1, be in Ln+l. Following Dtfmition (3.1) there are three caaes. i) If f is computed by some program in then f E L,, C S,, C S,,+l, by the inductive hypothesis. ii) If f is computed by some program P of the form
Ln,
xi,..,.X,, xi
INPUT
LOOP
R
END OUTPUT Xi
where R is in b,,, then f = f i , where f i comes from the formula (2.10) (see the proof of Theorem (2.7)), in which q,(z,,...,zm)= z,, 1 2 s 5 m. Hence, by the results concerning the SUDAN hierarchy, it follows that f is in
L+l.
iii) If f is computed by some program P of the form INPUT
Xi,..Jm
Pl
Pl OUTPUT Xi where each P,(g=1,2) is either in &,, or of the form in ii), then f is in L , +1 by closure under functional composition. 0
6.6. AUGMENTED LOOP LANGUAGES
We augmente the LOOP language with a fmed subroutine (that computes a recursive, not necessarily primitive recursive, function). In this way we are able to c U i y the recursive functions by means of the relation
417
Chapter 6
“primitive recursive in”. This classication is analysed from a computational complexity point of view using the notion of primitive recursivelyhonesty. MACHTEY [1972] defmed the augmented LOOP languages by adding to the instructions (2.1)(2.5) the following instruction:
X
=
F(Y)
(6.1)
where “F” is a name of a recursive function. If y ia the content of Y and F is a name for the recursive function f : R V Hv, then the instruction (6.1) assigns to X the value of f(y); the content of Y remains unchanged. An instruction of type (6.1) works like a subroutine computing the function f . We are already acquainted with such “abbreviations” when dealing with loop programs. The difference s t e m in that f may be not necessarily primitive recursive aa in the preceding situations.
(6.1) Deflnftlon. Let f :RV + RV be a recursive function. We denote by I+( f ) the smallest class of numbertheoretic functions 0:“ + RV,
which contains the functions Succ(z), Ci”’)(zl,...,z ~ ) , f (z), and which is closed under functional composition and primitive recursion. m
> 1,
fi“‘T(zI,...,z),
If g ia in R(f ), then we say that g is p r i m i t i v e recureive in f .
Remark. Clearly, R(f ) coincides with the class of all primitive recursive functions, in case f is itself primitive recursive. (6.2) Definitlon.
a) The class Lf of augmented loop programe i n f can be obtained from Definition (2.lrif we replace &  by &’  and the clause (2.6) by Each instruction of type (2.1)(2.3), or (6.1) aa well as the empty program are in
Lf 
.
(6.2)
b) As in Defmition (2.2) we can define the c h L’ of all numbertheoretic functions computable by augmented loop programs. We shall call them augmented loopcomputable functions. (6.8) Example. The augmented loop program
INPUT X,Y 2 = F(X) LOOP
z
Y = Y+l END
418
Cdudc
OUTPUT Y
computes the function f (z)+y. 0
(6.4) Theorem. (MACHTEY (19721) For every recursive function f :N+ RV, we have: R ( f )= L’.
Proof. Similar to the proof of Theorem (2.7).
a We are now in a position t o develop the announced classification. For every recursive function f :N+ N,the class L1 is a very small subset of the class of all recursive functions (more precisely, Lf = R ( f )is clearly a r.e. set of recursive functions, hence, by Corollary (3.9.18), is recursively meagre). Theorem (4.5) enables us to interpret .the instructions of the type (6.1) as general programs, and thus to chesify the recursive functione according to which class Lf they belong (every clam Lf is properly contained in the set of all recursive functions, and every recursive function fa& in some class Lf). In what follows we shall study the computational complexity of functions belonging to classes Lf and we shall prove that the classification above can be equally obtained if we restrict ourselvee to classes Lf generated by recursive functions which, in a sense, “honestly” reflect their time complexity (Le. with respect to the BLUM space ((Pi),(nmep,))).
:RV + RV be a recursive function. We say that the class Lf is honed if
(6.6) Definition. Let f a)
L/ = p
’
P
(6.3)
for some general program P.
b) The function f is primitive recursivelyhoned in case Lf is honest. We give a fmst example of primitive recursivelyhonest functions: the execution time functions.
P is a general program with registers, then we can effectively fmd a general program Q with input registers XI,...&, and Y aa output register such that (6.6) Theorem. (MACHTEY (19721) If
X,, ...&
M
Q computes the partial function Rmep ,
(8.4)
419
Chapter 6
TirncG(zl ,...,z , ) = 2.11t’mcp(zI,...,z,)+l for all z,,..,z, in HV.
,
(6.5)
Proof. The general program Q comes from the general program P by inserting new instructions as follows. The instruction “Y = 0” is placed aa the fvst instruction of the program Q. Then, we insert the instruction “Y = Y+1” after each instruction of type (2.1)(2.3), and (4.2); furthermore, the instruction “Y = Y+l” is inserted before each instruction of type (2.4), (2.5), and (4.1). The resulting program is just the desired Q. 0
(6.7) Example. Let P be the loop program computing the sum z+y (see Example (2.3)). The loop program Q furnished by Theorem (6.8) is
INPUT
X,J2
Y=O Y = Y+l LOOP
x, x,= X 2 + l Y = Y+l
Y = Y+1
END OUTPUT Y
It is seen that it computes just the function llt’mcp(zI,z2) and Tirncq(zl,z2)= 4z,+3 = 2(22,+1)+1 = 2Timcp(z1,z2)+1. 0
(6.8) Definition. Let P be a general program which uses the registers XI, ...,Xm. A Ploop simulator is a loop program Sp which uses the registers XI, ...&, T (T # Xi,1 5 i 5 m) and acts aa follows. If the contents of the registers XI, ...,Xm, T are z,,...,z,,t, respectively, the execution of S p leaves y, ,...,ym,t’ in XI ,...J,,T, respectively, where yj,t’(l 5 j 5 m ) come from the execution of P with input z,,...,~, follows: we try to run the
fust t instructions of P on the given input data (if P does not halt before), and we leave y,, ...,y, to be the fmal contents of XI, ...,Xm, respectively, and t‘ = 0 in case P did not halt, t’ equals t minus the number of steps until P halted if P did halt.
420
Cdudc
(6.9) Theorem.
(MACHTEY [1972)) For every general program P we
can effectively fmd a Ploop simulator.
Proof. We proceed by induction on the defmition of general programs. If P is the empty program, then S p is
INPUT Xl, ..&, T OUTPUT T If P consista of a single arithmetical instruction, then S p ia INPUT XI,...&, T U=leT U=I"U LOOP
u
T=TLl P
END
OUTPUT T (See Example (2.5) for the loop program computing A.) If P comes from the general programs Q and R by concatenation, then S, is the concatenation of S, and S,. If P is of the form INPUT XI,...&, LOOP x i END
Q
OUTPUT Xj then S, is
INPUT X1,.*,.X,,, ,T
U=leT U=1LU LOOP
u
T=T&l LOOP
xi
U=l&T U=l&U
LOOP END END
u
T=T"1 se
Chapter 5
42 1
END OUTPUT T Finally, if P is of the form INPUT X1p*.,X,,, La CONTINUE
Q
IF Xi # 0 GO TO La then S p is INPUT Xi,...Jm U = l n T
,T
U=lQU LOOP
u
T=TQ1 Sa
U=laXi U = l N J LOOP u T= TLL Sa
T= T a l
END
T = TL1
END OUTPUT T
(6.10) Example. The Ploop simulator associated to the loop program P
INPUT x LOOP x
x
=
x+l
END OUTPUT X
is INPUT X,T
U=l&T U=lLU
LOOP
u
T=TLl LOOP x
422
Cdude
U = l n T U=l&U LOOP u T=TAl U = l n T
U=lLU
LOOP
u
T=T"1
x = x+l END
END END END
OUTPUT T
(6.11) Example. The Ploop simulator associated to the general program
P INPUT X , Y 1 CONTINUE
Y = Y+l
IF x # 0 GO TO 1 OUTPUT Y is
INPUT X,Y,T U = l L T
U=l&U LOOP
u
T=T n l U = l n T U=l&U LOOP u T = T l l Y = Y+l END
U=l&X U = l w J LOOP u T=Tnl U=1PT
U=l&U
Chapter 5
LOOP
423
u T=TAl
Y = Y+l END
T=TAl END
T=TP1 END OUTPUT T
(6.12) Theorem. (MACHTEY [1972]) If f :W+ N ,m 2 1 is in L‘, and the general program P computes the total function g:N + N ,then we can effectively fmd a general program Q which computes f and Timeq
E Llimep
(6.6)
Proof. Let R be an augmented loop program in g which computes f . Amume that P and R use different registers. More exactly, assume that P works with W as input register, X as output register, and Xl, ...Jn, possibly other registers. The program Q ia obtained from R by replacing each instruction of the form “Y = g(2)” by the following instructions:
w=z x=o x,= 0 x, = 0 P Y=X It is seen that the above sequence can be thought as a general program which computes g ( z ) ( z is the content of 2; the output is Y). Consequently, proceeding to the just described transformation of R we get a general program computing f. We shall prove that this general program Q satisfies (6.6), i.e. Time* can be computed by some augmented loop program in TSmcp. (Notice that Timeq is a recursive function because f is recursive.) Let T , V, T,X’, 2‘ be completely new registers, and let S p be a Ploop simulator with X’and l‘ aa input registers and output register 2’. Furthermore, assume !hat S p and R have no common registers. The augmented loop program Q comes from R aa follows. We begin with the instruction “T = 0”; then, we insert the instruction “T = T+1” after each
424
Cdudc
instruction of type (2.1)(2.3), and before each instruction (2.4) and (2.5); each instruction of the form “ X = g(Y)” is replaced by the following instructions
v=o v = V+l v = V+l LOOP v T = T+l END
v = Timep(Y) LOOP v
T = T+l
END
T = Time#)
X’= Y SP
x
=
2’
where the instruction “V_= V+l” appears (n+3) times. The augmented loop program in Timep, Q , computes exactly the function TimeO. 0
(6.M) Lemma. If the p.r. function f :P 4 N,m 2 1, is computed by the general program P, and, in addition, Tirnep(zl,...,z,,,)5 h ( z l,...,)2,
for all zl, ...,z, in
,
(67)
N,and
hELg , for some recursive functions h : W + RV and g : N
(88) +
N ,then f E La.
Proof. Clearly, f is total, by (6.7). We take an augmented loop program in g which computes h . To this program we add a Ploop simulator which, for all zl, ...,2, in N ,executes the fvst h(zl,...,z,,,)instructions of P: we obtain an augmented loop program in g which computes f . 0
425
Chapter 5
(8.14) Corollary. If the recursive function *Bv" + N,m 2 1, is comk 8 p puted by the general program P,then f E L
.
Proof. Immediate from Lemma (6.13) and Theorem (6.12). 0
(8.16) Theorem. (MACHTEY [1972]) A recursive function f : N + N , ia primitive recursivelyhonest iff there exists a general program P which computes f and Timcp E L f .
Proof. Let P be
a general program computing f and satisfying the relalimep tion Timcp E L f . By Corollary (6.14) we have f E L Consequently, by Theorem (6.4),
.
Lf
=
~ ( f= )B(Timcp) =
Ll i n e p
9
showing that f is primitive recursivelyhonest. Conversely, assume that Lf = L R , for some general program R. Theorem (6.6) furnishes a general program Q which computes the function 2TmeR, and Timeg(2) = 2.Timc (z)+l, for all 2 in N. In view of the &r, fact that f E B ( f = ) Lf = L we deduce, b y Theorem (6.12 the kmeO which computes f and Timed E L existence of a general program Since ZIme
4
Lnnr8Q= ~
.
( ~ i m c ~ )
= B(2TimeR+1) = A.(TimcR)
L =
~
~
~
R
Lf
it follows that Timed E L f . Hence, the required general program P is exactly Q
.
0
Remarko. a) Intuitively, the primitive recursivelyhonest functions are those unary recursive functions which can be computed by general programs in time primitive recursive in themselves. b) The classes L', when f ranges in the set of all primitive recursivelyhonest functions, classify all recursive functions.
426
Cdude
(6.16) Corollary. Let g:N + N be a primitive recursivelyhonest function. The following aasertions are equivalent: The recursive function
f:BV"

N,m
2
1 is in f U
.
(6.9)
There exist a general program P which computes f and a function h : W '
c
UV in 'L such that
n'rnep(zl ,...,zm)5 h ( z ,,...,z,,,),for all zI,...,2, in
N
.
(6.10)
Proof. Immediate from Lemma (6.13) and Theorem (6.15). 0
Remsrke. a) From Corollary (8.18) it follows that each class B(g) ia computationtime closed in case g ki primitive recursivelyhonest. b) The recursive function g:N
iff { f : N+ N
I{ E A.(g)}
complexity class of h in the
=
U
+
N is primitive recursivelyhonest
TIME(h), where TZME(h) in the
h *(#I hunw
BLUM space ((fi),(TXrnep,.)).
c) The reader can now easily compare the notion of honesty defrned in Section 3.4 and the primitive recursivelyhonesty.
(6.17) Corollary. If f : N + IV is a primitive recursivelyhonest function, then R ( f )is a complexity class.
Proof. Immediate from Corollary (6.16) and the Union Theorem (Theorem (3.8.1)). 0
Remarks. a) The above classification of recursive functions coincides with the
KLEENE classification according to the notion of relative primitive recursiveness (see KLEENE [1958]). b) MEYER and RITCHIE (1912) have clawified the recursive functions by means of the elementaryhoned C h U 8 C 6 t(f)( q f )b the smallest class of numbertheoretic functions which contains the functions z+y, zy, z ' , f ( z ) , and which is closed under functional composition, limited summation, limited product and limited recursion).
Chapter 6
427
6.7. SIMPLE FUNCTIONS
The equivalence problem for loop program (i.e. the problem of establishing whether two arbitrarily given loop programs compute the same function) t undecidable. This problem remains undecidable for each n > 1; the barrier of undecidability lies between L, and L2(TSIclass CHRITZIS [1970]). This fact motivates the interest in theclsee L :(called, the claw of simple functions). To this aim we shall give a complete characterisation of L1,and, in particular, we shall solve the hierarchy problem for the classes (L The equivalence problem for a class C of loop programs is the prob compute the lem of deciding whether two arbitrarily gi& programs in C same function.
An,
(7.1) Theorem. The equivalence problem for
L is undecidable.
Proof. From KLEENE's NormalForm Theorem (Theorem (2.3.28)), every unary p.r. function w can be written as
1')
wl')(z) = p ( w [ T ( i , z , y )= 11)
9
appropriate primitive recursive functions p : N + N , and T : N S+ {O,l}. The set {z E RV lwi')(z) # 00) is not recursive, hence the problem of deciding whether for arbitrary z there exists an y such that T ( z , z , g )= 1, is undecidable. Hence, the problem of deciding whether for arbitrary z the unary function f , : N + N ,f , ( v ) = T(z,z,y) is the rero function, ia undecidable too. Finally, assume, by contradiction, that the equivalence problem for L were decidable. In view of Theorem (2.7), the problem of deciding for 'arbitrary z, if f,(g) = 0, for all y, would be decidable, thus arriving at a contradiction. for
0
(7.2) Corollary. The equivalence problem for n 2 2.
&,,
is undecidable, for each
Proof. It suffices to notice that KLEENE's predicate T : N 3+ {O,l} t in
s,= 12.
0
428
Cdudr
Remark. In view of Theorem (2.8.15) we can effectively fmd two programs P , and Pz in L2such that the proposition “Pl is equivalent to P2”is an independent statement. Our fmst task is to prove that Theorem (7.1) (which is equally true L and for all n 2 2) fails to hold in case 0: kl. for 
hn,
(7.8) Theorem. (TSICHRITZIS [1970]) A function f : W + RV, 2 1, is in toiff f ( z ,,...,z,) = k or f ( z ,,...,z,) = z , + k , for appropriate natural numbers k , and j (1 5 j 5 m), and all z1,...,2, in RV.
m
Proof. Recall that Lo is the set of numbertheoretic functions computed  i.e. by loop programs consisting only of arithmetical by programs in Lo, instructions. If f is of one of the forms speesed in the theorem, then f can be obviously computed by a loop program having no loops. To prove the converse implication we consider a program P (having Xl, ...,X,,, as input registers and output register Y) in Lo and we rewrite it by making the following transformations starting wit< the fwst instruction: a) replace each instruction of the form “X = 2” by “X = E”, where E is the expression appearing on the righthand side of the last previous instruction with X in the lefthand side. If there is no such instruction, then we write “X = z”, z being the current content of X; b) replace each instruction of the form “X = X+1”by “X = E+l”, where E is the expression appearing in the righthand aide of the last previous instruction with X in the lefthand side, in case such instruction exists; in the opposite case write “X = z+1”; c) each instruction of the form “X = 0” remains unchanged; d) after performing all replacements of the form a)c), retain, for every register 2 appearing in P, the last instruction containing 2 in the lefthand side, if such an instruction exists; in the opposite case, write
z = z.
Every register 2 appearing in P, in particular Y, wiU appear in an “equation” of the form 2 = zj+k, or 2 = k , where z j , is the content of some input register X,. 0
(7.4) Example. Consider the program P:
INPUT X J d ,
x,= X,+l
x, = X,+l
429
Chapter 5
x2= x1 x 2 = x2+1
OUTPUT
x 2
The transformations described in the proof of Theorem (7.3) lead to:
x,= 21+1. x,= (z1+1)+1, x 2=
(z1+1)+1,
x, = ((z1+1)+1)+1, and fmally
x1= 21+2, Xz = Z1+3.
X 3
=
23.
Hence, the function computed by
P is
f(2+2,23)
= 21i3.
U
(7.6) Definition. (TSICHRITZIS [1970]) The clams of eimplc function8 is the smalleat class of numbertheoretic functions which contains the func,...,zm),z+y, 'Pd(z) = z P l , [z/k], tions Succ(z), C{"')(zl,...,zm),drn)(zl rm(z,k), (A 2 2), and
1
,
wb,v)=
ify=o,
0 , otherwise,
and which is closed under functional composition.
(I.6) Theorem. (TSICHRITZIS [1970])The clam of all simple functiuxts coincides with L1. Proof. Since it is obvious that every simple function is in L1,we focus our attention to the converse implication. Let P be in L,;  write it as
p r n
where each portion P, is either a loop or an arithmetical instruction outside a loop. We ahall prove that each P, computes a certain simple function, hence the function computed by P can be obtained by functional cornposition from simple functions.
430
Cdude
The case when P, consists of an arithmetical instruction is obvious. Let us sssume now that P, is of the form
LOOP
END
x p:
and let Y,, ...,Y, be the registers used by P:. Furthermore, let X be dif(1 2 j 0. Hence, assume z > 0. After the fmt execution of P,, the contents of yi, ,..., are: yi, = j7itl+kit ,...,yix = ii1+kix, XI = ii;.,+kil. After the second execution we have: yit = &1 4+ki 11 +kit,...,Kx = iit+kil+kix, Y;.1 = iitl+kit+kil. In general, the content of 5, after z iterations b
xl

l i t = [Z / t ]
+
'(kil+*:+kit)+
c
t4
w(frn,bs(eq(rm(r:,t),m)))
s
m 4
where fo
=
ii,
9
for all0 < m 5 t nl. The above s u m contain a fized number of terms; therefore, to prove that &, can be expressed by means of a simple function it suffices to show that for every natural m, eq(z,m) is simple. Indeed, for m = 0, cq(z,O) = w(1,z); for rn > 0, eq(z ,m) = G(Pd([z/m])+G(z)+G( [z/m])+rm (z,m))
.
In Case 3, assume that we have a cycle yi,,...,yi,, (t 2 1) and a path Y;.t,Y;.t+l yit+,, r 2 1. More exactly, we have the equations in (7.1) and, in addition
,...,
Cdudc
432
The content of t + r after z > r iterations can be expressed from the content of after z e r iterations plus kit+l+...+kitrt. The fwst cases, i.e. those corresponding to the iterations z = O,l, r, can be treated by means of appropriate switching functions built from the functions w , Pd, e q , and rm. Hence, the content of can be expressed by simple funetions.
xt
...,
x,+r
The last case corresponds to a sequence of equations
and
A similar analysis shows that the content of can be expressed by in two cases, according to z > t ,
a simple function; the construction falls or z 5 t .
0
Remark. The above proof shows that there exists an uniform method for obtaining the expression of a function computed by a program in L1,  as a functional composition of initial simple functions.
(7.7) Example. Consider the following loop program:
INPUT X,Y,,Y2,Y3
x
= x+1
LOOP
x
Y&= Y4 = Y4= Y4 =
Y3 Y2 Y4+1
Y4+l
Chapter 6
433
Y4= Y4+l Y3 = Y4 Y4 = Y1 Y4 = Y4+l Y4= Y4+l Y2 = Y4 Y4 = Y5 Y4= Y4+l Yl = Y4
END OUTPUT Y3 The transformations abd) in the proof of Theorem (7.3) lead to the following equations expressing the scope of the loop:
YE4 = Y3? Y3 = y2 = Y1+2, y4 =
I3+1,
Y1 = y s + l . We have a cycle Yl,Y2,Y3,and two registers depending upon the cycle: Y4, YP The function computed by the above program is f(Z,Yl,Y2ia(S)
f, = Y S , f l
2
C w(fm,b9(CQ(rm(z+1,3),m))),
+
= 6[(~+1)/3]
where
m 4
= ~ 2 + 3 ,f
2
= YI+~. 0
(7.8) Definition. Let G be an expression defming a simple function g : W ., N,n 2 1 , as a functional composition of initial simple functions (see Defmition (7.5)). Let fl,..:,fm be the constants appearing ae second arguments of the functions [ z / f i ]or rm(z,ti) occurring in G , allowing repetition. Let q be the number of Occurrences of the predecessor function in G. Finally, put m
T = flti , 11
M = qT+1 Notice that T 2 2, because for all 1
. 2 i 2 m, ti 2 2.
(7.3)
434
Cdude
(7.9) Dcflnitfon. (TSICHRITZIS (19701) Let 0:" + RV, n 2 1, be a simple function and let T and M be two constants coming from Definition (7.8) and mme expremion C for 9 . Two ntuples (zl ,...,2,) and (yl y,) are called (T,M)compatible if the following two conditions hold for all 1 5 i s n :
,...,
5 M ) zi = yi , > M and vi > M )* zi = yi(mod T ) (zi
(zi
5M
or yi
(7.4)
.
(7.5)
We notice the following obvious properties of the above relation of compatibility: For all T 2 1 and
M 2 0, the relation of
(T,M)compatibility ia an equivalence relation.
(7.6)
If z1,...,zn)and (ul ,...,yn are (T,M)compatible
M)
then they are also (9,)compatible for all
T=k.Il',
k21.
M' < M
If a (T,M)compatibility claes has two distinct elements, then it has actually an infmite number of elements.
and (7.7)
(7.8)
(7.10) Theorem. (TSICHRITZIS [1970]) Let g : W + RV, n 2 1, be a simple function. Let T and M be two constants associated to g ae in Defmition (7.8). Then g gro+s linearly with respect to each variable on every class of (T,M)compatibility. Proof. We proceed inductively upon Defmition (7.5). The theorem holds obviously for the initial simple functions. For notational convenience we 'deal only with acts of points diifering only at one coordinate, say zi. We pass to the inductive step. Assume h :pv" + N,n 2 1 is a s h ple function satisfying the statement of the theorem with the constants Th and Mb. If the function g : W +N is defmed by g(zI,...,2,) = Pd(h(zl,...,zn)), then, according to Defmition (7.8), Tp = Tk and M, = M b + T h . Consider now two (T,,M,)compatible nuples (zl, ...,2,) and (yI,...,us) differing only at the i t h coordinate: zi = j i + u * T h , 8 > 0, zj = yj, for j # i . We have
436
Chapter 5
and then
Consequently, g possesses the required property with coefficient pi/t. If g ( z l,...,2,) = rm(h(zl,...,z,),t), then T, = T h ' f , M, 2 Mh (ain the preceding case). Again we consider two (T,,M,)compatible nuples (zl 2,) and (yl ,...,y,) for which zi = yi+8 .T,,8 > 0. h view of (7.7), the equality (7.9) will also hold, thus showing that
,...,
.m (h(zl,...,z,),t)rm(h(gl,...,y,),t)
=0
'
The reader can easily check the validity of the induction step for Succ, Cp), and @". Now assume that h 1 , h 2 : W + N are two simple functions satisfying the induction hypothesis for appropriate constants Tl, Ml, and T2,Ad2. If g(z, ,...,2), = w(hl(zl,...,2,),h2(zl z,)), then by defmition Tv = Tl.T2, and Mu2 max(M1,M2).If (zl 2,) and (vl,..,v,) are (T,,M,)compatible, zi = yi+s .T,,8 > 0, then (by (7.7))
,..., ,...,
hl(zl,...,z,)hl(vl,...,g,)
= Pi '8
*T'
,
hz(zl,...iz,)hz(yl,...,y,)
= qi '8
'Tg
*
,...,
,...,
case qi # 0, hz(z, 2,) 2 h2(gl g,) 2 1 since zi _> g; > M,, and thus g(zl,...,zn)g(yl ,...,v,) = 0. In case qi = 0, h&l, 2,)h2(yl,...,U), = 0. Again two subcases occur. If h 2 ( z , 2,) = 0, then 9(zl,".,z,)~(Yl,..',yn)= hl(zl,...,z,)hl(yl,...,y,) = Pi ' 8 'T,. If
In
,...,
...,
430
Cdudr
h ~ ( z 1 , . . . , ~+, ) 0, then 9(21,...,Z,)g(Ylr...,Yn) = 0. The reader can e d y supply the detaib for the inductive step involving the sum function aa well m the extension to sets of compatible trupler, in general. 0
Remark. Theorem (7.10)can be also used in showing that certain functions do not increase linearly on classes of (T,M)compatibility. example, consider the function sqrt (z)= [z'''].
An an
(7.11) Theorem. Every simple function g : W + RV, n 2 1, is completely specified by a finite number of nuples. More exactly, if T and M are g sssociated constants, then g is completely specified by its values in the frnite set
N Proof. z , + ~5
=
((2,
,...,z,) E W
Imax(zl,...,2,)
2*T+M}
.
For all (Zlr...,z,] in pv" with z 1 > M ,...,z, > M , and M ,...,2, 5 M ,we construct the following two sets:
A = {(y, ,...,y,) E N " jari = ji E
zi( mod
T),M
zi,8
< a' 5 a, and
< yi 5 M+T,15 i 5 8 ) ,
and
B
=
{(zi ,...,2:) E W 11 2;
2;
5 r 5 8,z:
= zi,8
< i 5 n, and
= z,( mod T), if M + T < 2,' 5 M + 2 * T ,and = zit mod T), if A4 < 2: 2 M+T,i E (1,...,a}{r}}
.
. It is seen that (zl ,...,zn), (gl,...,y,) and (2; ,...,2;) are (T,M)compatible in case (jl,...,y,) € A , ( z : ,...,2:) E B, 1 5 r 5 8 . Theorem (7.10)gives the relation: #
g ( Z l ? * * . , z n )=
g(Y1,,ln)+C (g(z:,,zL) 11
Clearly, A u values on N.
 g(vl,...,Y,)).(z,y,)/T * 8 C N ; hence g(zl, ...,2,) is completely specxed from the 0
437
Chapter 5
(7.12) Corollary. Let g l , g 2 : W * IV, n 2 1, be two simple functions. Let Tl, Ml, T,, Ad2 be the associated constants. If g1 and g2 agree at every nuple in the set
N
,...,z,) E W Im+, ,...,2), 5 MI
= {(zl
+M,+2.T,.T,} , then g1 = gp
Proof. Put T = T,*T2,M = M l + M p Suppose that g1 and g2 agree on N, and consider an arbitrary nuple (zl,2,) such that z1 > M ,...,2, > M , and z , + ~5 M ,...,z,5 M. Consider also the sets A and B associated to (zl ,...,z,,z,+I,...,z,), T and M , as in the proof of Theorem (7.11). Clearly, A U B C N, and every nuple in A U B iS (T,M>compstible with (zl, 2,). In view of (7.7), all nuples in A u B are (T,,M,)eompatible, as well as (T2,M2)compatible, with (zl,...,z,). From Theorem (7.10) we deduce the formulas:
...,
...,
c(d4,..4 a
Ol(Z1,...,2,)
= 91(Yl,...,Yn)+
r=l
 Ol(Yl,...,Y,))(z,Y,)/T
9
8
92(21,...,2,
1 = 82(11,.rln)+C r=l
( g d 4 ,.4
 92(11,...,~n))(zr~r)/T
9
which prove that g1 = g2. 0
(7.11) Corollary. (TSICHRITZIS [1970]) The equivalence problem for L1in decidable. Proof. We can uniformly construct the function computed by a program in L1and therefore we can get the aeaociated constants T and M. Finally, weonly run the programs with input data in the fmed fmite set furnished by Corollary (7.12). In case the outputs coincide on each input, the prog r a m are equivalent. In the opposite case, they are not. 0
Remarks. a) There is a drastic difference between L1 and L,, n 2 2 M far M the equivalence problem i concerned. Furthermore, we can formulate other decision problem which turn out to be also decidable for L1,but undecidable for each L,, n 2 2. For example, the problem to determine
438
Cdudr
whether a function in L, eventually takes eome d u e k, or the problem t o determine whether two functbm in fn are equal almost e v e w h e r e are decidable for n = 1, but undecidable for n 2 2. b) It is worth noticing that the decidability of the corresponding problem for programs in does not imply the decidability of the corresponding problem for programa in UL having loops without nesting because the instructions of UL have much power than the instructions of &. Furthermore, we can express every simple function in UL without using loops and it can be proved that the equivalence problem for prog r a m in UL having no nested loop8 is undecidable. We are going to the next problem in this section, namely, the hierarchy problem for the c h s (f:)t21. Notation. If f :W4 N ,n 2 1 b a function and 1 5 i n, then fxifO is the (nlkarguments numbertheoretic function defined by =
f=i=O(21,...,Zi1,Zi+1,...,2n)
f

(z1,...,2i1,O,zi+l,’..,zn)
The next result uses an idea in OSTROWSKI [1954].

(7.14) Lemma. If f : W hV, n 2 1, is in L :, for some A 2 1, then there exists a natural i , 1 5 i 5 n, such that f*i’O belongs to L.:’.
Proof. If f E Lf’, then for each i, f s i l O , is also in f f’. Therefore, and let P be a program in Lf computing f asaume that f EL:L:’, with input registers Xl,...,X,,, and output register Y. Let rLOOP Z” be the fvst loop instruction in P. The content of 2 before entering the loop is 2
= 6*Zi+k
,
where k E N ,1 5 i 5 a, and 6 E {O,l}: see Theorem (7.3). If 6 = 0, then the fvst loop is actually executed exactly A times. We conclude with the fact that this loop is not “proper”, i.e. it can be replaced by an equivalent program in Lo.  This means that f is in fact in L:’, thus contradicting our working hypothesis. Hence 6 = !., i.e., t = zi+A. Then P computes with Xl,...,Xit,Xi+l,...,Xn M input rcgbters, and outthe function fXi=,, put register Y. But again the fvst loop of P is not “proper”, showing that fZi’0
is in f fI.
0
439
Chapter 6
(7.16)
(f&
o,
Theorem. (GOETZE and NEHRLICH [lSSl]) The clsssee form a proper hierarchy: (7.10)
LT", for every n 2 2. Actually, we shall prove by induction on n that the function .3umn:W + I?,
Proof. We must show that Lr' #
czi,is in L;'L:", n
~um,(z~,..,q,) =
for each n
2 2.
i1
The function ~ u m ~ ( z ~=, z1+z2 z ~ ) can be computed with one loop (Bee Example (2.3)). Hence, 8um, is in LF'. We focus the attention to For n = 2, 8Um2 4 f,"= Lo (h case the relation 8umn 4 L;2. 6Um2 E Lo,then by Theorem (7.3), 8Um2(21,22) =
for appropriate naturals 6 tion). For
all
i, +
N
,
6 'zj+k
E {O,l}, j E {1,2}, k 2 0, which is a contradic
1 2 i5 n+l, coincide:
the
functions
8umn,
and
n +1
=
(8Umn+l)ri,0(21,".,2i1,zi+1,".,2n+1)
...,
= 8Umn(21, 2i1,2i+1,...,Zn+1)
2j j=l j#i
.
were in Consequently, in case 8umn E L ;2, via Lemma (7.14), i.e. if 8umn 4
Li'' we would also have L :?, then 8Umn+1 4 L,"'. 0
Remarks. a) The proof of Theorem (7.15) relies upon the fact that the number of variables of the function .3umn, n = 2,3, is increasing. GOETZE and NEHRLICH [1981] have proved that this result fails to be true in case we restrict our attention to functions having a fized number of arguments. Indeed, they have proved, using Theorem (7.6), that for each fmed number n of variables the corresponding hierarchy (7.10) collapses a t level ( n + l ) . In other words, ( n + l ) unnested loops are sufficient to compute all simple functions of n variables. Here we have a new diiference between f 1 and L,, for n 2 2.
...
b) By slightly modifying Defmition (3.1), AMIR and CHOUEKA [1981] have obtained a hierarchy (Lb), satisfying the equality
440
Cdudr
Lk+l = L,, for all n 2 2. Furthermore, L; coincides with the set of “polynomially computable functions”; alternatively, L; is the claw of all recursive functions that are computable with a polynomial number of steps by the modfied loop programs. A syntactical defmition of the problem P = P U P is fmally obtained.
6.8.
PROGRAM SIZE
This section is devoted to the tradeoffs between the computational complexity and “sire’.’ measures, i.e. between the number of instructions a program uses in its computations and the number of its characters. Let
=
((d,),(an)) be a BLUM space.
(8.1) Definition. (MACHTEY and YOUNG [1978]) A recursive function
II:ovmv, in called a general eize mcaaurc for (&)n20 if for all naturals n , the set
Idi I I; I = n )
1
(8.1
is fmite.
In other words, we can effectively compute the general sire of any given #i, and the number of incquivolcnt programs (algorithm) of arbitrarily given sire is finite. To give the following two examples of general sire measures we notice that, for each natural n , only fmitely many inequivalent UL prgramo have n characters (instructions), in spite of the fact that infinitely mury distinct UL programs have exactly n characters (instructions). This is poseible because we work with an infinite “alphabet” of register names, and a “systematic” change of register names in a given UL program does not affect the function computed by it. (8.1) Example. The total number of charactem in an UL program gives general sire measure with respect to the effective enumeration (Pn), 2oof all UL programs. a
441
Chapter 6
(8.S) Example. The total number of instructions in an UL program gives another general sire meamure. 0
(8.4) Example. The total number of instructions in an ALGOL program fails to lead to a general sire measure. The motivation is fairly simple: every constant function can be computed by a single ALGOL instruction. 0
As in the c u e of BLUM spaces one can eaailp. construct examples of “pathological” general sire memures. (8.5) Example. (MACHTEY and YOUNG [1978]) There exist a padding function p :d c RV (i.e. di = 4,(i,j), for all naturals i and j ) , and a general she measure I 1:N + RV such that
ip(i,j) I = li
I
for all i and j . Indeed, take without loss of generality an injective padding function p with recursive range (see Exercise (2.11.10)), and an arbitrary general ste measure I r:aV c PV. Defme
In
Clearly
I I works.
I=
I
li
1’ ,
In
TI
in cane n E range(p) and p(i,j) = n, for mme j , otherwise. 0
(8.6). Theorem. Let g,f:aV + RV be two recursive functions such that
the set { ldn) I In
EN) is infmite for some general sire memure I I:RV
(8.2)
9
+
IV.
Then we can effectively find two naturals i and j (depending upon g and f ) such that:
d,(j) f(li I) < lo(i) I di
=
(8.3)
9
.
(8.4)
442
Cnludc
Proof. We consider the recursive function r :N4 N given by
1) < l o b ) ill function 8 :M a N ,
r b ) = rm"9 (eee (8.2)).
Next we use the p.r.
+,d
9
= 4r(r(r))(4
(8.5)
*
From the Uniform Recursion Theorem we get a natural i (uniform in g and f ) such that for each natural 2,
di(.) where z is an index for 4 . r : j = r(i).
=
48(z?i)
P
Finally, the natural j comes again from
We shall prove that the just obtained i and j work. Indeed, condition (8.4) follom directly from the construction of r and j. h concerns condition (8.3),
di(z) = d s ( z 9 i ) = for each
2;
e(z,i) =
dg(r(i))(Z)
=
+g(j)(z)
9
we have used formula (8.5) and the construction of j. 0
(8.7) Definition. (BLUM [1967b]) A general sire measure I (:N + IN is called canonical size mca8urc if there exista a recursive function b:N N such that for all naturals i and j, +
(8.6)
Remark. From (8.6) it follows that for every canonical s h e measure the following two statements hold for each j: The set {iE N }l i 15 j}ia fmite.
(8.7)
There exists an algorithm which generates the set of all program di with l i I = j, i.e. by inspecting the fmite set {iC RV Ii 5 b ( j ) , I i I = j}.
(8.8)
(8.8) Example. The general sire meaaures in Example (8.2) and (8.3) are not canonical because the sets {iE RV I i I = j } are infmite for almoet all naturab j , thus contradicting (8.6).
I
13
443
Chaptor 5
(8.8) Example. Let (P,),20 be an effective enumeration of all UL prg r a m and I (:N ., N the general sire measure in Example (8.2). We replace each UL program P, by the equivalent program p', which UWE only the regbtem XI,...&, where m is the total number of registers used by P,. In this wry we obtain an acceptable gGdelisation for which the total number of characters in each program gives a canonical she measure. 0
(8.10) Seholfum. (BLUM [l967b]) Let g , f : N + N be two recursive functions such that g has infmite range. If I I:N + Hv is a canonical sire measure, then we can effectively fmd two naturals i and j (depending upon g and f ) such that conditions (8.3)and (8.4)in Theorem (8.6)hold.
Proof. If I I:Hv RV is a canonical measure and 0 has infmite range, then the eet { lg(n) I .In E N}must be infmite (by (8.7)). +
0
(8.11) Theorem. (MACHTEY and YOUNG [1978])Let recursive function satisfying the following two conditions:
range(g) is infmite, + u ( i ) is total for each natural i Then, for every canonical she measure
g:N+ N be a (8.9) (8.10)
.
I I:N
+
(4,,),,lo, the set Mu,(+") = {z EN Iz E range(g), y E range(g), if 4, = dl, then 1% I IIr I} is r.e.
N associated to and
for
each
Proof. We shall prove that A4g,(4sl is the domain of a certain p.r. function +:RV &HV. To this aim defme the partial function $:N&nV by I
pz[for each y E range(g) with Iv I C Iz 1, there exists a w 2 a d2)= 'such that #s(w) # +l(w)], if 2 E range(g) otherwise. 00,
,
\
In view of (8.1), (8.7)(8.10) it follows that 91 is in fact a p.r. function. The inclusion dam($) c Mg,(,nlis obvious; to prove the converse inclusion we we (8.7).
444
Cdudc
Comment. The r.e. set of recursive functions enumerated by p is c k u l y a small fraction of the set of all recursive functions (this set in recureirely meagre by Corollary (3.9.18)). Nevertheless, it may include all the recursive functions which we are dealing with in practical computations. An illuminating example is the set of all primitive recursive functions. In connection with this subrecursive clasa we may aak whether one does need general programs for any practical purpose though all practically computable functions are primitive recursive and the loop programa are sufficient for computing them. Theorem (8.11) and Scholium (8.10) give strong reasons for answering the above question in the atrumative. Indeed, let g*:N IV be a recursive enumeration of all loop programs having smallest canonical sire (see Example (8.9) and Theorem (8.11)). Now, Scholium (8.10) (with g(z) = g*(z) and f ( z ) = nz) guarantees the eldstence of a primitive recursive function whose minimal (with respect to the canonical sire meaaure) loop program computing it has the canonical sire n times aa large aa the canonical sire of its minimal general program. Hence, general programs are preferable to loop programs in computing primitive recursive functions, in case the sire meaaure gives the comparison criterion. The next result can be viewed aa a complexitytheoretic version of the Uniform Recursion Theorem. +
(8.i2) Theorem. (MACHTEY and YOUNG [1978]) There exiat two recursive functions T : N + N and h : M + RV such that for each total we have: 6qJ)(') = dbx(qS))(')*
'Or
'?
and
(8.11) (8.12)
Proof. We construct the auxiliary recursive function r :N3 * EV ae follows: 'qJ)(z)9 if
+,2,60
=
'S(T(z))
%I(qS))(')
10,
where the recursive function T = Theorem (see Theorem (2.4.7)).
5
and
=Y
9
otherwise,
TIcomes from the Uniform Recursion
Assume 4, is total. If d b x [ q J ) ) ( # z ) c q then
445
Chapter 6
Put
(8.13)
Remark. In view of (8.13), the recursive function h is increasing in the second argument. We are ready to give information concerning the tradeoffs between computational complexity measures and sire measures. We prove that for sufficiently complex functions, the increase in the number of performed steps that follows a reduction in sire is negligible.
(8.M) Theorem. Under the hypotheses of Theorem (8.6) there exists a recursive function h : @ + hV such that we can effectively fmd two naturals i and i (depending upon the given recursive functions g and f ) such that conditions (8.3) and (8.4) in Theorem (8.6) hold, and in addition @i(z)
I
(8.l4)
h(z,@g(j)(z))a*e.
Proof. The constants i and j come from Theorem (8.6) and the recursive function h is furnished by Theorem (8.12). It is seen that for each natural 2,
4i(z) = dg(j)(z) = ++;[o(j))(z)

Consequently, @i(z) I h(z,*+i(o(r(i)))(z) 0.e. = h(z,*,(j)(z))
*
(8.14) Seholium. (BLUM [1967b]) Let I I:N + JV be a canonical sire measure. There exists a recursive function h:M + RV such that for all recursive functions g,f :RV .+ RV, if range(g) is infmite, then we can effectively fmd two naturals i and j (depending upon g and f ) such that conditions (8.3), (8.4) and (8.14) hold.
446
Cdude
Proof. Immedirrte from Scholium (8.10) and Theorem (8.13). 0
In contraat with Theorem (8.11), the set of all minimal indices with respect to a canonical sire measure I I:Bv + N ,
q,") = {z
lfor each Y with
A
= dl,
.I I 5
lY
I>
9
ie not r.e. Actually we have: (8.16) Theorem. unmune.
(BLUM (1967b], MEYER (1972)) The set M(+ ie
Proof. We shall prove that for every infmite r.e. set W c Bv, W n ( h r  M ( , 1) f 0.We return to the idea of the proof of Theorem (8.6). Let f :RV r: N be an injective recursive function such that W = range( f ). Construct the p.r. function
$:p a Bv by
flit.) = df(fislj(s)>i$z)
9
for all i and z. The srnn and Recursion T h e o re m furnieh a fmed point zo:Sio(z) =
fliacz).
P ut no= f ( p z [ f ( z ) > io]). It follows that no E W, but no4 and i, < no. because 4i0 =
M(,*), . o
6.9.HISTORY
As we have already pointed out the fmt systematic programmingoriented studies in complexity were due to CLEAVE (19631, and MEYER and RITCHIE [1967a], [1967b] and concerned the primitive recursive functions. The papers of MEXER and RITCHIE contain the basic resulta concerning the LOOP language, the loop hierarchy and ite relation with GRZEGORCZYK c l w e r . Prior to these fundamental papers RITCHIE (19631, and COBHAM I19641 investigated the structural subrecursive hierarchies by meanr of complexitytheoretic toob. CONSTABLE [1971] extended the loop hierarchy through the multiplerecursive functions of PETER (1957). CONSTABLE and BORODIN [1972] contains a syskmatic rtudy of tradeoff8 between program
Chapter 5
447
structure and computational complexity. The loop concatenation hierarchy waa investigated by GOETZE and NEHRLICH [1978], [1980]. Extensions of these hierarchies to sequence functions have obtained by FACHINI and MAGGIOLOSCHETTINI [1979], [1982]. The universal language. UL comes from CONSTABLE and BORODIN [1972] and MACHTEY [1972]. The definition of computationtime closed sets of functions is essentially due to RITCHIE [1963]. The time analysis of loop and loopconcatenation hierarchies was made by MEYER and RITCHIE [1967a], [1967b], and GOETZE and NEHRLICH [l980]. The augmented LOOP languages and the related classification of recursive functions have been constructed by MACHTEY [1972]. h4EYER and RITCHIE (19721 developed a classification of recursive functions by means of the “elementaryhonest” classes; MEHLHORN [1976] haa studied the “polynomialhonest” classes. Simple functions were fvst investigated by TSICHRITZIS [1970]. The analysis of the hierarchy (f.&,,, waa done in GOETZE and NEHRLICH [1981]. PRESBURGER’a characterisation of simple functions as well as the investigation of the complexity of simple functions can be found in IBARRA and LEININGER [1981]. The she measures were fvat introduced and investigated in BLUM (1967bl; HARTMANIS and HOPCROFT (19711, and MACHTEY and YOUNG I19781 contain the basic results on size measures. The following monographs contain results concerning the subrecursive programming hierarchies: BRAINERD and LANDWEBER (19741, SCHNORR [1974], CALUDE [1982b]; GOETZE and NEHRLICH [1980] is a good suwey paper in this area.
6.10. EXERCISES AND PROBLEMS
Section 6.2 (10.1) Show that for every k _> 2, [z/k] and rrn(z,k) are loopcomputable functions. How many loope are necessary for computing these functions? (10.2) h u m e that we allow only a finite number of register names. Under this restriction, does Theorem (2.7) remain true?
4#
Cdudc
Settfon 6.S (10.3)Prove that the functions [z/2] and t m ( 2 , 2 ) are exactly in
L 1 Lo.
(10.4)Prove that the functions zy and 2’ are exactly in L2L,. (10.5) Give the exact position of the functions [z/2], rm(z,2), z i , and z’ with respect to the loopconcatenation hierarchy. (10.6) (GOETZE and NEHRLICH [1980])Prove that for all n 2 3, g1,...,g,:N +Nare all in then the function h :Bv Bv, h(zf = f(g,(z),...,om(2)) ie in Li. (10.7)(GOETZE and NEHRLICH [lSeb]) Show that the classes n 2 3, are closed under limited summation and limited product. (10.8) Check the closure of the classes Li, n 2 3, under limited recursion and primitive recursion. k,m
fi,
2 1, if f :W +RV is in Lnl and
Li,
Section 6.4 (10.9) Construct in detail the acceptable giidebation induced by a systematic numbering of all general programs. (10.10)Prove the validity of BLUM axioms for the time partial functions associated to general programs. (10.11)Denote by UL  {LOOP,END} the set of all general programs not containing the instructions LOOP, END. Check if each per. function can be computed by a program in UL  (LOOP,END}. (10.12) Write CJL programs for the ACKERMANNPETER and SUDAN functions. (10.13)Write UL programs for the time functions associated to the program in Exercise (10.12). Section 6.6 (10.14) (GOETZE and NEHRLICH [ISSO]) For all n in,...,i, 2 1, put .
.
 & 2rJrn ’
L?....Jrn

.
.
jml,....j,,,
(CLn1
> m 2 2,
iml,..& (in)
1
L~’”’”” the corresponding class of functions. i ,.& Show that each class L,,” is computationtime closed. Prove that the classes (L~””””’) form a hierarchy of primitive
and denote by a)
b) recursive functions.
(10.15)Check the validity of Corollary (5.3) for n € 3. (10.18)Show that for every n 2 3, f.: contains an universal function
449
Chapter 6
for
Ln+
(10.17) Show that for all n 2 3, k 2 1, Lf+' contains an universal function for Lf. (10.18) Using the existence of the universal functions, prove that Li (respectively, Lf?;) contains a predicate which is not in L nl (respectively,
LIZ). Section 6.6 (10.19)Exhibit examples of primitive recursivelydishonest functions. (10.20) (MACHTEY [1972]) Show that for every recursive function f :RV + Hv, we can effectively fmd a predicate g in L', such that for each general program P, computing 9 , we hare Timep(z) 2 f(z) a.e. Compare this result with the Compreosion Theorem (Theorem (3.4.19)). (10.21) (MACHTEY [1972]) If f , g : N + Hv are primitive recursivelyhonest functions, such that 'L L', then there eldsts a primitive recursivelyhonest function h :Bv * Bv, such that L f S Lh S LO.
5
Section 6.7 (10.22) a) Prove that the predicates A , V : M + (0,l)(see Exercise (1.10.6)) are simple. b) Prove that the predicates gr, t 8 are simple. (10.23) Fmd the constants T and M (aa in Definition (7.8)) for .the following simple functions C:w+ RV, C(z,y) = (l+)z, D:M 4 RV,
",d
= z4f.
(10.24) (TSICHRITZIS [1970]) Prove that the following problems are decidable: a ) Does an arbitrary simple function f:P + RV, n 2 1, take ultimately a given value k? b) Does two arbitrary simple functions f , g : W + N ,n 2 1, agree on all but a fmite number of nuples? c) Is an arbitrary simple function bounded? (10.25) (IBARRA and LEININGER [1981]) Prove that the claas of simple functions coincides with the class of PRESBURGER functions. We briefly recall the defmition of PRESBURGER functions. We consider the (logical) formulao about natural numbers; P(zl, 2,) denotes a formula having n 2 1 free variables zl,...,z, . The set of PRESBURGER formulae is the smallest class of formula8 satbfying the following four conditions (GINSBURG and SPANIER [1966]):
...,
n8
(a) a,+Caizi ill
m
= be+xbizi is a PRESBURGER formula for i=I
d
450
Cdude
2 1, u, ,...,u,, b,,..,,b,. (b) If PI and P2are PRESBURGER formulae, then junction Pl A Pzand disjunction P1V Pa. naturals m
so are their con
(c) If P is a PRESBURGER formula, then so ie its negation non(P). (d) If
P(z,,...,z,) is a PRI%BURGER
formula, then so is
( 3 zi)P(z1,*.vzn).
A (total) function f :W+ Bv, n 2 1, ia a PRESBURGER junction if there exists a PRESBURGER formula P(zl, ...,z,,~),such that for every (il,...,in) E W ,the following two conditions hold: i) if f ( i l,...,in)= j , then P(il,...,i*,j) is true, and
ii) if P ( i ,,...,in,j)is true, then f ( i l,...,in) = j. (10.26) (GOETZE and NEHRLICH [1981]) If 7is a class of numbertheoretic functions, then we denote by [q" the set of all functions of n variables in T, for e k h choice of n 2 1. Prove that for each n 2 1,
[L;In
s [L:I^ 5.5[L;'I" 5[L;In 5[L;+'I^
=
[Ll)" .
Section 6.8 (10.27) Supply the formal details in Example (8.9). (10.28) (BLUM [1967b]) Prove that every two canonical sire meas
ures are recursively related, i.e. if I 1,1 (.:N + hT are two canonical sire measures, then we can effectively fmd a recursive function g : N 4 R V such that for each natural n: a)
.1 I I dln I'h In I' 5 o(l. I).
b) (10.29) (BLUM (1967bl) Let I I,I (':N+ Qv be two canonical sire measures. Then we can effectively fmd a recursive function h:Qv + N such that for all naturals n and m:
I IIm I, then In I.I h( Im I.), b) i f h ( In I) 5 Irn I, then In 1' 5 lm I'. (10.30) (BLUM [l967b]) Let 1 (:h' + IV be
a) if In
a general sire meaeure and g : N + h' a recursive function such that 4,,(,,) = d,, for all n. Then, for all recursive functions f :N+ N ,h :flc Qv, and for each natural i,we can effectively fmd a natural jsuch that a)
+i = dg(j),
b) f ( l i I) < ldi)I, c) h(z,Oi(z)) < O,(jl(z), for every z in nV with d r ( z )# ca (10.31) (MACHTEY and YOUNG (19781) a) Prove that the function
Chapter 5
f
:N+ RV
451
defmed by
f (2) = pv[d,(O) = z and for each natural k, ifh(0)=
2 7
then lk
I2 Iv I1
9
i s not recursive.
b) Compare the above result with the fwst example in Section 4.1.
This Page Intentionally Left Blank
463
BIBLIOGRAPHYT
ACKERMA", W., Zum Hilbertwhen Aufbau der r e e h n Zahlen, Math. Ann. 99 (1928), 118133.
ADLEMAN, L., POMERANCE, C. and RUMELY, R., On dutinguihing prime numberr from comporite numberr, Ann. of Math. (2) 117 (1983) 173208. ADRIANOPOLI, F.,Una nuova forma normale per le funrioni parridi ricorrive, UniveraitZ degh rtudi di Salermo, Prcprint Series, ISITR017, 1978. ADRIANOPOLI, F. and DE LUCA, A., Closure oprrationr on meuurer on computational complexity, Cdcolo 2 (1974), 113. AHO, A.V., HOPCROFT, J.E. and ULLMAN, J.D., The D e r i p and Analytir of Computer Algorithms (AddironWerley, Reading Mw., 1974). AMIR, A. and CHOUEKA, Y., Loopprogramr and polynornia& computabh functionr, Internat. J. Comput. Math. 9 (1981), 196206.
ARBIB, M A , Theorier of Abstract Automata (PrenticaHalI, E n g l e w d Cuffs, N.J., 1969). ASSER, G., Rekurrive wortfunktionen, Z. Math. Logik Grundly. Math. 6 (lOeO), 258278.
AZRA, J.P. and JAULIN, B., Recurrivite' (GauthierViarr, Paru, Bruxeller, Montrdd, 1973). BLAKLEY, G.R. and BOROSH, I., Knuth'r iterated powers, Adv. in Math. 34 (l979), 109138. BLUM, L. and BLUM, M.,Toward a mathematical theory of inductive inference, Inform. and Control 28 (l975), 126155. BLUM, M.,Recurrive function theory and r p d of computation, Canad. Math. Bull. 9 (1966), 746760. BLUM, M.,A machineindependent theory of the complexity of recurrive functionr, J. a. Comput. Mach. 14 (1967a), 322336. BLUM, M.,On the rise of machines, Inform. and Control 11 (1967b), 267266. Journal titler are abbreviated according to Mathematical Review.
454
Cdude
BLUM, M.,On effective procedurer for rpeeding up algorithmr, in: ACM Sympoaium on Theory of Computing, 1969, 4353. BOOK, R.V.,Brief bibliography on computational complexity, Aiken Computation Laboratory, H a r r u d Univerrity, 1969. BOREL, E., Le calcul dcr ink’graler definer, Journal de Mathdmatiquer 8 (1912), 159210. BOREL, E., Lea paradoxeo de I’infini (Gallimud, 1946).
BORODIN,A.B., Complexity clmaes of recurrive functiono and the exirtence of complexity gaps, in: ACM Symposium on Theory of Computing, 1969, 6778.
BORODIN, A.B. and MUNRO, J.I., The Computational Complexity of Algebraic and Numeric Problem8 (American Ehevier, New York, 1975). BRAINERD, W.S. and LANDWEBER, L.H., Theory of Computation (John Wiley and Sonr, New York, 1974). BUZETEANU, S. and DIMA, N.,Arithmetiiation of the computation of Sudan and Knuth functiono, in: INFOIASI’83, Proc. 4th National Colloquium on Computer Science, h i , 1983, 103110 (Romanian). CALUDE, C., Darboux property and primitive recurrive functionr, Rev. Roumaine Math. Pureo Appl. 26 (1981), 11871192. CALUDE, C., Topological lire of retr of partial recuroive hnctionr, Z. Math. Logik Grundlag. Math. 28 (1982a), 456462. CALUDE, C., Computational Complexity. Qualitative Aspeeti (Ed. S t i t i h a ri Enciclopedica, Bucurcrti, 1982b (Romanian)). CALUDE, C., On a c l v r of independent problemr related to Rice theorem, ACM SIGACT New0 15 (1983a), 5357. CALUDE, C.,A simple nonuniform operation, Bulletin of EATCS 20 (1983b), 4046. CALUDE, C. and CHITESCU, I., Random atringn according to A.N. Kolmogorov and P. MutinLif. C l w i c d approach, Found. Control Engrg. 7 (1982a), 7386. CALUDE, C. and CHITESCU, I., Strong noncomputabiiity of random otringr, Internat. J. Comput. Math. 11 (1982b), 4345. CALUDE, C. and CHITESCU, I., On repreoentabiiity of (1983a), 4247.
P. MartinLiif terto, Kybernetika 19
CALUDE, C. and CHITESCU, I., On a (too) general theory of raodom sequencer, in:
Bibliography
456
DEMETRESCU, M.C. .ad IOSIFESCU, M. (eds.), Studia in Probability and R e h k d Topiu, Paprrs in Honour of Octav O n i c a u on Hi 90th Birthday ( N y u d Publirhrr, 1QWb,6669). CALUDE, C. and CHITESCU, I., Reprewntability of recursive P. MutiLiif teab, Kybernetika 19 (198k), 62G536. CALUDE, C. and FANTANEMU, B., On recursive, nonprimitive recursive functionr, Bull. Math. Soc. Sci. Math. R.S. Roumanie (N.S.)22 (1978), 366366. CALUDE, C., MARCUS, 5. and T E W , I., The first example of a recursive function which ir not primitive recursive, Hitoria Math. 6 (1979), 380.384. CALUDE, C., MARCUS, S. and TEW, I., Recursive properties of Sudan’s function, Rev. Roumaine Math. Purer Appl. 26 (1980), 503607. CALUDE, C. and PAUN, Gh., Independent instancu for wme undecidable problems, RAIRO Inform. Thebr. 17 (1983), 4964. CALUDE, C. and TATARAM, M.,Univerrd sequencer of primitive recursive functions, Rev. Roumline Math. Purer Appl. 28 (1983), 381389. CALUDE, C. and VIERU, V., An iterative normal form for p u t i d recurrive functionn, Found. Control Engrg. 3 (1981a), 133144. CALUDE, C. and VIERU, V.,A note on Knuth i k r a k d powers, An. S t i t . Univ. “A.1. C u d ’ Inri Sect. I Mat. (N.9.) 27 (1981b), 263266. CALUDE, C. and ZIMAND, M.,A relation between correctneu and randomneu in the computation of probabilirtic dgorithmr, Internat. J. Comput. Math. 16 (l984), 4753. CEITIN, G.S., Memvduc theorems in conrtructive analysu, Trudy Mat. Inst. Steklov 67 (l962), 362384. (Russian) CHAITIN, G.J., On the length of programs for computing fiite binuy sequencer, J. Auoe. Comput. Mach. 13 (l966), 647569. CHAITIN, G.J., Informationtheoretic limitations of formal system, J. hm. Comput. Mach. 21 (1974), 403424. C U T I N , G.J., A theory of program sire formally identical to information theory, J. Awe. Comput. Mach. 22 (1976), 329340. CHAITIN, G.J.,Algorithmic information theory, IBM J. R ~ I Develop. . 21 (1977), 360369. CHAITIN, G.J. and SCHWARTZ, J.T., A note on Monte C u l o primdity teati and rithmic information theory, Comm. Pure Appl. Math. 31 (l978), 621427.
ao
456
Calude
CHURCH, A., A m t of portulater for the foundation of logic, Ann. of Math. 33 (1932),346366. CHURCH, A,, A m t of pwtulater for the foundation of logic (wcond paper), Ann. of Math. 34 (1933),839864. CHURCH, A., An unsolvable problem of elementary number theory, Amer. J. Math. 58 (1936),345363.(Ako in DAVIS [l966],89107) CLEAVE, J.P., A hierarchy of primitive recurnive functionr, Math. 9 (19633,331345.
Z. Math. Lo& G r u n d l y .
COBHAM, A,, The intrinric computational difliculty of functionr, in: BARHILLEL, Y. (ed.), Proctedinp of the Congrew on Logic, Methodology and Philoaophy of Science, Haifa, brael (NorthHolland, h a t e r d a m , 1964, 2430). CONSTABLE, R.L., Subrecurrivtprogramminng lurguyer III. The multiplerecurnive functionr R”,in: Symporium on Computein m d Automata, Polytechnic Inntitute of Brooklyn, 1971,393410. CONSTABLE, R.L., The operator gap, J. Auoc. Comput. Mach. 19 (1972),176183. CONSTABLE, R.L. and BORODIN, A.B., Subrecurrive programming languages, Part I: Efficiency and program ntructure, J. h o c . Comput. Mach. 19 (1972),526668.
COOK,S.A.,An overview of computational complexity, Comm. ACM 26 (1983),401408. DALEY, R.P.,Quantitative and qualitative information in computation, Inform. and Control 45 (l980),236244. DAVIS, M.,Computability and Unnolvability (McCrawHill, New York, Toronto, London, 1968). DAVIS, M.,The Undecidable (Raven Prenr, Hewlett, New York, 1966). DAVIS, M.,Hilbert’r tenth problem u unrolvable, Amer. Math. Monthly 80 (1973),233269. DAVIS, M.,What L a computation? in: STEEN, LA. (ed.), Mathematicr Today, Twelve Informal Earayi (SpringerVerlag, New York, Heidelberg, Berlin, 1978,241267). DAVIS,
M.,Why
W e 1 didn’t have Church’i therir, Inform.and Control 64 (l982),324.
DEDEKWD, R.,Was rind und w i u iollen die Zahlen? (Braunrchweig, 1888). (Cited following
KLEENE IlQEl])
DEKKER, J.C.E., Two noter on recurrively enumerable retr, Proc. Amrr. Math. Soc. 4 (1953),496501.
Bibliography
457
DE LEEUW, K.,MOORE, E.F., SHANNON, C.E. and SHAPIRO, N., Computability by probabiliatic machinea, in: SHANNON, C.E. m d McCARTHY, J. (edi.), Automata Studies (Princeton Univ. Prcrs, Princeton, N. J., 1966, 183212). DIMA, N., Sudan’s function u universal for the c h i of primitive rccuriive functions, Stud. Cerc. Mat. 33 (leal), 6967. (Romanian) EILENBERG, S. and ELGOT, C.C., Recurriveneir (Academic P r u r , New York, London, 1970).
ENDERTON, H.B., Elementr of recursion theory, in: BARWISE, J. (cd.), Hmdbook of Mathematical Logic (NorthHolland, Amsterdam, 1977, 527666). ERDOS, P. and MILLS, G., Some boundr for the RamrcyPariEHurin&on numbers, J. Combin. Theory Ser. A, 30 (1981), 5370. FACHINI, E. and MAGGIOLOSCHETTINI, A., A hierarchy of primitive recurrive iequence functiona, RAJRO Inform. Thew. 13 (1979), 4967. FACHINI, E. and MAGGIOLOSCHETTINI, A., Comparing hieruchier of primitive recursive sequence functions, Z. Math. Logik Grundly. Math. 28 (1982), 431446.
FINE, T.L., Theoriea of Probability. An Examination of Foundationr (Academic Prers, New York, 1973). FREIVALDS, R., Letter to the author (August 17, 1983). GAREY, M.R. and JOHNSON, D.S.,Computcri and Intractability: A Guide to the Theory of U P  Complebcnesr (W.H. Freeman, San Francirco, 1978). GEORGIEVA, N.V., C l a m r of oneargument recursive functioni, Z. Math. Logik Grundlag. Math. 22 (1976a), 127130. GEORGIEVA, N.V., Hierarchies of one argument primitive recursive functions, C.R. A c d . Bulgare Sci. 29 (1976b), 919922. GILL, J., Computational complexity of probobiliatic Turing machioar, SIAM J. Comput. 6 (1976), 675696.
GILL, J. and BLUM, M.,On almoit everywhere complex recurrive hnctionr, J. h o c . Comput. Mach. 21 (1974), 425436. GINSBURG, 9. and SPAMER, E., Semigroupr, Prcrburger formulu, and Isngurpr, Pacific J. Math. 16 (1966), 286296. GLADSTONE, M.D.,Simplification of recuriion rchcme, J. Symbolic Logic 36 (1971) O M 666.
458
Calude
CODEL, K , Uber formal unentacheidbare Sata der Principia Mathematica und verwandter Systeme I, Monatsh. Math Phys 38 (1931),115198. (English translation in DAVIS ;1965], 538)
CODEL, K., On Undecidable Propoiitionr of Formal Mathematical Syrtems, Mimeographed Notei by S.C. KLEENE and J.B. ROSSER, Institute for Advanced Study, 1934. (Also in DAVIS (19651, 3973). GODEL, K , Uber die Lange der Beweise, Ergeb. eines math. Kolloquiume 7 (l936),2324. (English translation in DAVIS [1965], 8283). COETZE, 8. and NEHFUICH, W., Loop propamr and claarer of primitive recursive functions, in: Proc. 7th Sympoiium Mathematical Foundationr of Computer Science 1978,Lecture Notcr in Comput. Sci. 64 (1978), 232237. GOETZE, 8. and NEHRLICH, W.,The structure of loop programs and subrecursive hierarchies, 2. Math. Logik Grundlag. Math. 26 (1980), 256278. GOETZE, B. and NEHRLICIi, W.,The number of loop8 necersary and sufficient for computing rimple functionr, Elktron. Informationrverarb. Kybernet. 17 (l981),363376. GRZEGORCZYK, A., Some clansea of recursive functionr, Roiprawy Matematycine 4 (1953),146. GUY, R.K.,Unrolved Problems in Number Theory (SpringerVerlag, N e w York, Heidelberg, Berlin, 1981).
HARROW,K., Equivalence of some hierarchies of primitive recursive functionr, 2. Math. Logik Grundlag. Math. 25 (1979), 411418. HARTMAMS, J., Computational complexity of onetape Turing machine computations, J. Aaioc. Comput. M x h . 15 (l968),325339. HARTMAMS, J., On the problem of hiding natural computational complexity measures, Cornell Univeriity, Technical Report 73175,1973.
HARTMAMS,J. and HOPCROFT, J.E., An overview of the theory of computational complexity, J. h r o c . Comput. Mach. 18 (loll),444475. HARTMANlS, J. and HOPCROFT, J.E., Independent rerultr in computer science, ACM SIGACT N e w i 8 (1976), 1324. HARTMAMS, J. and STEARNS, R.E., Computational complexity of recurrive sequencer, in: IEEE Proc. FiRh Annual Sympoiium on Switching Circuit Theory and Logical Derign, 1964, 8290.
HARTMAMS, J. and STEARNS, R.E., On the computational complexity of algorithmr, Trani. Amer. Math. SOC.117 (lees),286306.
Bibliography
459
HELM, J.P., On efktivoly computable operators, Z. Math. Lo& Grundly. Math. 17 (1971), 231244.
HELM, J.P. and YOUNG, P., On rise
VI.
efficiency for programr admittins speedup, J.
Symbolic Logic 30 (1971),2127.
HENKE,F.W., INDERMARK, K., ROSE, G. m d WEIFIRAUCH, K., On primitive recurrive word functionr, Computing 16 (1976),217234.
HENNIE,F.C., Introduction to Computability (Addiron Wesley, New York, 1977). HENNIE,F.C. and STEARNS, R.E., Twotape simulation of multitape Turing mrchincr, J. Comput. Mach.13 (1960),633648.
hloc.
HEFlMES, H., Enumerability, Decidability, Computability (Academic Pram, New York, 1966).
HILBERT, D., Uber d m Unendliche, Math. Ann. 96 (1920), 181190.(English translation in VAN HEIJENOORT [1907], 367392) IBARRA, O.H. and LEININGER, B.S.,Chuacterirationr of Presbur~erfunctioni, SUM J. Comput. 10 (lQ8l),2239. IRLAND, M.I.and FISCHER, P.C., A bibliography on computationd complexity, Rer. Rep. CSRR 2028, University of Waterloo, 1970.
JANKO, W.H., A bibliography on randomired algorithmr, Bulletin of EATCS 18 (1982), 1620. JOSEPH, D. and YOUNG, P.,A rurvey of rome recent resultr on computational complexity in weak theories of arithmetic, in: Proc. 10th Symposium Mathematical Foundations of Computer Science, 1981,Lecture Noter in Comput. Sci. 118 (1981),4680. KAMAE, T., On Kolmogorov complexity and information, Oaaka J. Math. 10 (1973),306
307. KATSEFF, H.P., Complexity dips in infinite binary mquenca, Inform. and Control 3.8 (1978), 268263. KATSEFF, H.P. and SIPSER, M.,Several results in program sire complexity, Theorat. Comput. Sci. 16 (1981),291309. KETONEN, J. and SOLOVAY, R., Rapidly growing R~MIIOYfunction#, Ann. of Math. 113 (l981),287314. KFOURY, A.J., MOLL,R.N. and ARBIB, MA., A Programming Approrch to Computability (SpringerVerlag, New York, Heidelberg,&rlin, 1982).
400
Calude
KLEENE, S.C., General recurrive functionr of natural numberr, Math. Ann. 112 (1936), 727742. ( A h in DAVIS [1966], 236253) KLEENE, S.C., Introduction to Metunathematic8 (NorthHolland, Amsterdam, P. Noardhoff, Groningen and D.Van Nostrand, Toronto and New York, 1962).
KLEENE, S.C., Extenrion of an effectively generated clur of functionr by enumeration, Colloq. Math. 6
(lose),6778.
KLEENE, S.C., The theory of recurrive functionr, approaching itr centennial, Bull. Amcr. Math. SOC. (N.S.) 5 (loel), 4361. KNUTH, D.E., The Art of Computer Programming, Seminumerical Algorithmr (Vol. 2) (AddironWeiley, Reading MA,1989). KNUTH, D.E., Mathematics and compukr rcience: Coping with finitenerr, Science 194 (1976), 123S1242. KOLMOGOROV, A.N., Three approaches for defming the concept of "information quantity", Problemy Peredaci hformacii 1 (l96S), 311. (Rurrian) KOLMOGOROV, A.N., Logical b u b for information theory and probability theory, IEEE Trans. Inform. Theory 14 (l968), 6621384. KOLMOGOROV, A.N., Combinatorial brrir for information theory and computable probability, Urpekhi Mat. Nauk 38 (1983), 2736. (Ruirian) KREISEL, G., LACOMBE, D. and SHOENFIELD, J.R., Partial recurrive functionah and effective operationr, in: HEYTING, A. (ed.), Conrtructivity in Mathematicr (NorthHolland, Amrterdam, 1959, 195207). LACHLAN, A.H., Eflective operatori in a general irtting, J. Symbolic Logic 29 (l964), 163178. LANDAU, S., Primer, codel and the National Security Agency, Noticer Amer. Math. SOC. 30 (lass),710. LANDWEBER, L.H. and ROBERTSON, R.L., Recuriive propertier of abrtract complexity clmer, J. h i o c . Comput. Mach. 19 (1972), 296308. LEWIS, F.D., The enumerability and invariance of complexity cluier, J. Comput. Syrtem Sci. 5 (1971), 288303. LOFCREN, L., Complexity of dercriptioni of ryitemr: A foundational atudy, Internat. J. Gen. Syitemi 3 (1977), 197214. LOVELAND, D.W., A variant of the Kolmogorov concept of complexity, Inform. and Control 16 (I989),51&626.
Bibliography
48 1
MACHTEY, M., Augmented loop languagem and clurer of computable functionr, J. Cornput. Syrkrn Sci. 6 (1972),003624. MACHTEY, M. and YOUNG, P., An Introduction to the General Theory of Algorithmr (NorthHollmd, Amrkrdam, 1978). MALITZ, J., Introduction to Mathematical Logic (SpringerVerlag, New York, Heidelberg, Berlin, 1919).
MA", Y.I., A Courre in Mathematical Logic (SpringerVerlag, New York, Heidelberg, Barb,1977).
MA", Y.I., Expanding conrtructive univeraer, in: ERSOV, A.P. and KNUTH, D.E. (edr.), Algorithms in Modern Mathematics and Computer Science, Lecture Noter in Comput. Sci. 122 (l981),256260.
hu", I., Probabiliitic recurrive functionr, Tranr. h e r . Math. Soc. 177 (1973),447467. MARCUS, D.A.,An alternative t o Euclid'r algorithm, Amer. Math. Monthly 88 (1981). 280. 283. MARKOV, A.A., Theory of algorithmr, Trudy Math. Inat. Steklov 38 (l95l), 176189.( R u e rim) MARKOV, A.A., The Theory of Algorithms (National Science Foundation, Wmhington, D.C., 1981). MARTINLOF, P., On the orcillation of the complexity of infinite binary requencer, (1986), (Unpubbhed manuscript; cited from MARTINLOF [l971])( R u d a n ) MARTINLOF, P., Algorithma and Random Sequencer (Erlangen Univerrity, Niirnberg, Erlangen, 1966a). MARTINLOF, P.,The definition of random iequencer, Inform. and Control 9 (1968b), 602619. MARTINLOF, P., Nokr on Constructive Mathematicr (Almqvirt & W i k ~ l I ,Stockholm, 1970). MARTINLOF, P., Complexity orcillationr in infinite binary sequencer, 2. Wahrach. Verw. Gebiete 19 (1971),225230. McCREIGHT, E. and MEYER, A.R., Clolrer of computable functionr d e f i e d by boundr on computation, preliminary report, in: ACM Symporium on Theory of Computing, 1909, 7988. MEHLHORN, K., On the rise of computable functioni, in: IEEE Annual Symporium on S r i k h i n g and Automata Theory, Univ. Iowa, Calii., 1973,19G198.
482
Calude
MEHLHORN,K.,Polynomial and sbrtract nubrecurrive cl.uc8, J. Comput. Syrtem Sci. 12
(1976),147178.
MEYER, A.R., Propun rim in rertrickd progrunming Ianguager, Inform. and Control 21 (1972),382394.
MEYER,A.R. and FISCHER, P.C., Computational epeedup by effective operatori, J. Symbolic Logic 37 (1972),5668.
MEYER, A.R. and MOLL, R., Honest boundr for complexity c l v r e r of recursive functionr, in: Proc. 13th Annual Switching and Automata Theory Coot College Park, Md.,1972, 6166.
MEYER,A.R. and RITCHIE, D.M., Computational complexity and program rtructure, IBM Remarch Report RC 1817,1967a. MEYER,A.R. and RITCHIE, D.M., The complexity
of loop programr, in: Proc. 22 Nit.
ACM Conf. (1967b),465470. MEYER, A.R. and RITCHIE, D.M., A clsriification of functionr by computational complexity, in: Proc. Hawaii International Conference on SyNtem Science, Hawaii, 1968,1719.
MEYER, A.R. and RITCHIE, D.M., A clsrrification of recurrive functionr, Z. Math. Lo@ Grundlag. Math. 18 (1972),7182.
MEYER,A.R. and W " N ,
K., The fundamental theorem of complexity theory, preliminary vereion, Foundationr of Computer Science IU (Third Advanced Couru, A m r t e r d m , 1978) Part I (Mathematier Ctntrum, Amrterdun, 1979,97112).
MILLER, C.L.,Riemann'i hypotherin and t e r k for primality, J. Comput. Syrtem Sci. 13 (1976),300317. MINSKY, M.,Probkmc of formulation for artificial intekligence, in: BELLMAN, R.E. fed.), Mathematical Problemr in the Biological Sciencer, Proc. Sympor. Appl. Math. 14 (l962),36.
MINSKY,M., Computation: Finite and Infinite Machine8 (PrenticeHall, Engkwood Cliffi, N.J., 1967). MORDELL, L.J.,Diophantine Equationr (Academic P r e u , London, New York, 1969). MYHILL, J. and SHEPHERDSON, J.C.,Effective operationr on partial recuriive functionr, 2. Math. Logik Grundlag. Math. 1 (1965),310317.
NALIMOV, V.V., Facer of Science (IS1 P r e u , Philadelphia, 1981). NOVIKOV, P.S., Elementr of Matbematical Logic (Ed. Stiintifica, Bucurerti, 1966) (Romanian)
Bibliography
463
OSTROWSKI, A.M.,On two problemr in abrtract algebra connected with Horner'r rule, in: Studier Prewnted to R. von MLea (Academic Prerr, New York, 1964,4&48). OXTOB?, J.C., MepIure and Category (SpringerVerlag, Berlin, Heidelberg, New York, 1971). PARIS, J. and HARRINGTON, L., A mathematical incompletenew in Peano arithmetic, in: BARWISE, J. (ed.),Handbook of Mathematical Logic (NorthHolland, Amrkrdun, 1977, 11331142).
PAZ, A., Introduction to Probabilitic Automata (Academic Prcri, New York, London, 1971). PEANO, G., Arithmcticcr principia, nova methodo expoaita (Turin, Bocca, 1889). PETER, R., Uber den Zurarnmenhrng der verrchiedenen Bepiffe der rekurriven Funktion, Math. Ann. 110 (1934),612632. PETER, R., Rekurrive Funktionen (Verlag der Ungarirchen Akademie der WiuenechaRen, Budapeit, 1957). PETER, R., Recurrive Function8 in Computer Theory (Akadehiai Kiadd, Budapeat, 1981). POST, E.L., Finite combinatory processer. Formulation I, J. Symbolic Logic 1 (1936) 103105. (Ah0in DAMS (1965],288291) POST, E.L., Formal reductionr of the general combinatorid decbion problem, Amer. J. Math. 65 (1943),197215. RABIN, M.O.,Speed of computation of functionr and cladicatioa of recuriive rctr, in: Proc. Third Convention Sci. Soc., Israel, 19W,12.
W I N , M.O.,Degree of difficulty of computing a function and a partial ordering of recurrive rctr, Hebrew University, Jeruralem, Technical Report nr. 2, 1980. RABIN, M.O.,Realtime computation, Lrael J. Math. 1 (1963),203221. RABIN, M.O.,Probibdintic algorithma, in: TRAUB, J.F.(ed.), Algorithm and Complexity, New Directionr and Recent Rerultr (Academic P r e u , New York, 1976,2139). RABIN, M.O.,Complexity of computations, Comm. ACM 20 (1977),626633, Corrigendum: 21 (i97a),231. RICE, H.G., C ~ U K I of recurrively enumerable w t r and their decuion problemr, Tram h e r . Math. SOC.74 (1963),358366. RICE, H.G., Recutrive real numbcrr, Proc. Amer. Math. Soc. 5 (1964),784791.
464
Calude
RICE, H.G., On completely recurrively enumerable clrrrer and their key arrayr, J. Symbolic Logic tl(lQS6), 304308. RITCHIE, R.W., Clurer of predictable computable functionr, Tranr. h e r . Math. Soc. 106 (lea) 139173. , RITCHIE, R.W., Clurer of recurrive functions b u e d on Ackermann’r function, Pacfic J. Math. 16 (l965),10271044. M T , R.L., SHAMIR, A. and ADLEMAN, L., A method for obtaining digitd r i p a t u r c r and publickey cryptoryrtema, Comm. ACM 21 (1978),120126. ROBERTSON, E.L., Complexity clrrrer of partial recurrive functionr, preliminary version, in: Thud Annual ACM Symporium on Theory of Computing, 1971,268268. ROBINSON, R.M., Primitive recurrive functionr, Bull. h e r . Math. Soc. 53 (1947),925942. ROGERS, H.,G d e l numberingr and partial recurrive functionr, J. Symbolic Logic 23 (1958),331341. ROGERS, H.,Theory of Recurrive Function8 and ERective Computability (McGrawHill, New York, 1967). SANTOS, E.S., Computability by probabilistic Turing machino, Tranr. Amer. Math. Soc. 159 (1971),165184. SCHNORR, C.P., Do the computational apeedup concern programming! in: NIVAT, M. (ed.), Automata, Languagea and Programming (NorlhHolland, Amrterdam, 1973,585591). SCHNORR, C.P.,Rekurrive Funktionen und ihre Komplcxitit (Teubner, Stuttgart, 1974). SCHNORR, C.P., A rurvey of the theory of random requencei, in: BUTTS,R.E.and HINTJJCKA, J. (eds.), B a i c P r o b l e m in Methodology and Linguuiticr (D. Rcidel, Dordrecht, 1977,193210). SCHNORR, C.P. and STUMPE, G., A characterisation of complexity sequencea, 2. Math. Lo& Grundlag. Math. 21 (1975),4756. SHEPHERDSON, J.C.and STURGIS, H.E., Computability of recuraive functionr, J. Comput. Mach. 10 (1963),217256.
~ I O C .
SKOLEM, T., Begrundung der elementaren Arithmetik durch die rekurrierende Denkweire ohne Anwendung rcheinbare.Ver~derlichen mit unendlichem Ausdehnunpbereich, Skrifter utgit av Videnrkapsreiakapet i Krutirnia, I. MatematuikNaturvidenrkabelig K l w , 1923 (Englih tranrlation in VAN HEIJENOORT [l967],302333) SMORYNSKI, C., Some rapidly growing functionr, Math. Intelligencer 2 (lOzIO), 149164.
Bibliography
485
SMORYNSKI, C., “Big” newr from Archimeder to Friedman,Noticar Amer. Math. Soc. 30 (1983),251266. SMULLYAN, R.M., Theory of Formal Syikmi (Amah of Mathematicr Studier, Princeton, New York, 1961). SOLOMONOFF, R.J., A formal theory of inductive inference, Part I, Inform. and Control 7 (1964), 122. SOLOVAY, R. and STRASSEN, V.,A rut MonkCarlo tent for primality, S U M J. Comput. 6 (1977),8485,Erratum: 7 (1978),118. SPECKER, E.,Nicht konrtruktiv beweirbare S i t s der Andytir, J. Symbolic Logic 14 (l949), 145168. STAIGER, L., ReprcMntabk MartinLot terti (Manulcript, March 1984). STEARNS, R.E., HARTMANIS, J. and LEWIS, II, P.M., Hierarchiei of memory limited computationr, in: IEEE Conf. Rec. on Switching Circuit Theory and Logical Darim, 1965, 179190. STRONG, H.R., Algebraically generalized recutrive function theory, IBM J. Res. Develop. 12 (lOeS),465475. SUDAN, G., Sur Ie nombre trandiii w “, Bull. Math. Soc. Roumaine dcr Science8 30 (1927), 1130.
TRAKHTENBROT, B.A., Complexity of Algorithms and Computationm, Courae noter, Novoaibirrk, 1967. (Ruuian) TSICHRITZXS, D., The equivalence problem of rimple loop progrwnr, J. AJIOC. Comput. Mach.17 (1970),729738. TURING, A.M.,On computable numberr, with an application to the Enticheidungaproblem, Proc. London Math. Soc. 42 (1936),230266,Correction: 43 (1937), 544546. (Ah in DAVIS Il065],116161,162154) USPENSKY, V.A., Lecturei on Computable Function1 (Gorudarrtvennoye Irdat. Fir.Mat., Lit., Morcow, 1980). (Rusrian) USPENSKY, V.A. and SEMENOV,A.L., What are the gain& of the tbeory of algorithmr: Buic developmenti connected with the concept of a o r i t h m and with its application in mathematicr, in: ERSOV, A.P. and KNUTH, D.E. (edi.), Algorithmr in Modern Mathematicr and Computer Science, Lecture N o k i in Comput. Sci. 122 (1981),100234.
VAN EMDE BOAS,P.,Ten yeari of ipcsdup, in: Proc. 4th Symporium Mathematical Foundations of Computer Science 1976,Lecture Notcr in Comput. Sci. 32 (1976),232237.
466
Calude
VAN HEIJENOORT, J., From Frege to M e l . A Source Book in Mathematical Logic, 18791931 ( H u r u d Univ. Pram, Cambridge, Mur. 1967).
VEFtBEEK, R., PrimitivRekurriv GrregorcrykHieruchien (Univerritit Bonn, Informatik berichte, Bonn, 1978). VON NEUMA", J., The general and logical theory of automata, in: TAUB, A N . (ad.), Collected Workr, vol. 5 (Pergamon Preu, Oxford, London, New York, Pub, 1963,288328). WAGNER, E.G., Uniformly reflexive rtructurm: On the nature of gadelirationr and relative computability, Tranr. Amer. Math. SOC. 144 (1969),141. WEIHRAUCH, K.,Tcilklaurrcn primitivrekurriver Wortfunktionen, Berichte der GMD 91 (1974,149. WEYL, H., Uber die neue Grundlyenkrue der Mathemrtik, Math. 2. 10 (1921),3979.
YAMADA, H.,Rcaltime computation and recurrive functionr not realtime computable, IRE Tranr. 6 (l962),753760. YASUHARA, A., Reeurrivc Function Theory and Logic (Academic Prerr, New York, London, 1971). YOUNG, P., Eary conrtructionr in complexity theory: Gap and rpeedup theoremr, Proc. Amer. Math. SOC. 37 (1973),5565133. WTING, S., A "natural" enumeration of nonnegative rational numberr. An informal d b Amer.Math.Monthly 87 (1980),2529.
currion,
ZIMAND, M.,Complexity of probabilirtic algorithm, Found. Control Engrg. 8 (1983a), 3349.
ZIMAND, M.,Perronal communication. (October 1983b) ZVONKIN, A. and LEV", L., The complexity of finite objectr and the development of the conceptr of information and randomncrr by m e m i of the theory of dgorithmr, Uprekhi Mat. Nauk 166 (1970),85127.(Rurrian)
BIBLIOGRAPHY ADDED IN PROOF MIIR, A. m d CHOUEKA,Y., Polynomial computrtionr in nondetarminintic looppropmu and PLpropma, Internat. J. Comput. Math. 14 (1983), 209.211.
AWR, A. and CHOUEKA,Y., A q n t r e t i c d definition of the Comput. M J h . 17 (lWS), 217128.
P = 4 P problem,
Inkmat. J.
Bibliography
467
BEESON, M.J., Foundations of Constructive Mathematici (SpringerYerly, Berlin, Heidelberg, New York, Tokyo, 1986). BORGER, E., HASENJAEGER, G. and RODDING, D. (edr.), Logic and Machiner: Decision Probhmr and Complexity, Proceedings, Lecture Noter in Comput. Sci. 171 (1984). BUZETEANU, S., Some pnaralirrtioni of Kleene's wcond ruedpoint theorem, Bulletin of EATCS 26 (1986),1419. CALUDE, C. and CHITESCU, I., A c l v r of univerral P. MartinL6f tertr, Bulletin of EATCS 23 (1984),1522. CALUDE, C., CHITESCU, I. and STAIGER, L., P. MartinLBf tarts: Reprewntability and embeddability, Rev. Roumaine Math. Purer Appl. 30 (1986),719732. CICHON, E.A. and WAINER, S.S., The slowgrowing and the Grregorcryk hierarchier, J. Symbolic Logic 48 (1983),399408.
DAVIS, M. and WEYUKER, E.J., Computability, Complexity and Languager (Academic Preu, Orlando, San Diego, New York, London, Montreal, Sydney, Tokyo, 1983). EBBINGHAUS, H.D.,MULLER, G.H. and SACKS, G.E. (edr.), Recurrion Theory Week, Proceedings, Lecture Nokr in Math. 1141 (1984). ENGLEFRIET, J., The noncomputability of computability, Bulletin of EATCS 28 (lC86), 3&39.
GANDY, R.O., Some rclationr between c l w e r of low computational complexity, Bull. London Math. SOC. 16 (1984),127134. HARTMANIS, J., Generalired Kolmogorov complexity and the rtructure of feuible computationr, Preliminary Report, Cornell Univerrity, 1984. HARTMANIS, J., Independence rcrulk about contextfree languages and lower boundi, TR84808, Cornell Univerrity, 1984.
HUYNH,D.T., Reiourctbounded Kolmogorov complexity and hard
Ianguager, TR8610,
Iowa State Univeriity, 1986.
KARP,R.M., Combinatorica, complexity and randomnerr, Comm. ACM 29 (l986),96109. KRAMOSIL, I., Recurrive clwification of paeudorandom sequencer, Kybernetika 20 (1984), 334. LEVIN, LA., Randomneu conservation inequalitier: Information and independence in mathematical theorier, Inform. and Control 61 (1984), 1537.
468
Cdude
NERODE, A. and SHORE,R.A. (edi.), Recurlion Theory, Proc. Sympoi. Pure Math. 42 (1986).
RICHMAN, F.,Church’i t h e i i without taarr, J. Symbolic Logic 46 (1983), 797803. RICHTER, M.M.,BORGER, E., OBERSCHELP, W., SCHINZEL, B. and THOMAS, W. (edi.), Computation and Proof Theory, Proceedings, Part 2, Lecture Notei in Math. 1104 (1984). ROSE, H.E., Subrecuriion: Functioni and Hierarchies (Oxford Univeriity P r e u , Oxford, 1984).
SIPSER, M., A complexity theoretic approrch
to
randomneii, in: ACM Sympoaium on
Theory of Computing, 1983, 330336. SIPSER, M.,Computation by Automata (M.I.T., 1983). STAIGER, L., Repreientabb P. MartinLBf tcrti, Kybernetika 21 (1986),23S243. S T R E W , I., Explicit computation of a Gijdel independent sentence, Recuriive Function Theory: Nerrletter 33 (1985), 348. WELHRAUCH, K., Type 2 recursion theory, Theoret. Comput. Sci. 38 (1985), 1733. Z I M A N D , M.,Baire cluiification and partial recuriive functioni, Recursive Function Theory: Nerrletkr 32 (l984),346.
ZIMAND,M.,On the topological iixe of reti of random ntringn, 2. Math. Logik Grundlag. Math. 32 (l986),8188.
469
INDEX OF NOTATIONS
Nl1
El 1
R,1 =,#,I €1&1
{... I...}, 1
C nI1 1 u11
nl 1 1
1
x11
A', 1 f :A + B , 1
470
Cdudc
PSQ, 18 A(Z), 20
Ck),22
e’, 23
z
+ y, 23
Z Y , 23
z v , 23
Pd, 23
I 29 1,
24
8qrf(z)=
25
18,
. .I,
pr[ 1
[ x ” ~ ] 24 ,
28
quo, 30
PRIME, 30
n!, 30 1
V,31
i0
Index of Notations I
A , 31
i4
u p , 34
d n ) , 34, 35
J y 35 I?), 35
R("),37,' 38
MP), 38 exp, 40, 41 long, 41
< xo,...,x, >, 42 od, 79, 80
esr 80 sn, 52
max, 57
gcd, 81
ACK, 82 rev, 83
ma=(...),57 I
D ,84
47 1
472
Cdude
p,r., 91
nj,
last , 96
Zj, 122
time , 98
wj,
Ff"),99 0,1, ...,n ,...) loo I1
123
j'", 123 cdk;'), 123 w

(h/t*P
122
100
trans , 124
S R B R , loo
eomp, 126
=, loo
P1127
102
T,127
t1
!In1116
f!"), 129
ual , 116
select , 129
Vat, 116 Num , 116 Term , 116
Eq, 117
GN,117
,:a
129, 130
T,,135 &'I,
138
n
K,151
termeub, 118
Sub, 118 Rep, 118
diag, 145
r.e., 146 n
grsymb , 120
T,152
DSj, 121
Wi, 154
Detjl 121
im, 154
Index of Notations
preim , 154 154
+n,
meet, 154
D,, 158
T,167 A!, 173 Sh(h :N+ {O,l}), 173
E,
E.9
179
F,, 182 P, 182 P R , 182 R , 182 Spv,
182
x,l82 ROJ, 189 ?=,
191
r:, 191 finite,, 191, 192
fund,, 193 funcomp,
9,211 
apz, 211
204
473
474
Cdude
H ( t , m ) , 315
b t * p , 400
H(z,m ), 315
UL,402
U , 320,321
TZME(h),414
my, 323
A.(f 417
mu, m , 323,324
Lf, 417 
K,334
L f , 417
< F,s >, 337
Sp, 419
?h(F,S), 337
4r
xmVr , 362
+,dl
D(4,2), 378
sum, , 439
K , ( z ; m ) , 378
I
k1385
%W,b
L , 386
kr, 392 L,, 392
k,,393 Timep, 394
Lk
397,398
L i , 398 A Z3,
398
A('), 398 < A >, 398
11
11
I1
%Jl
426 429
440 443 446
.
.
.
.
k Jr'"am ,448 1 Jr'4n , 448
475
SUBJECT INDEX
acceptable gbdelization, 138 acceptable programming system, 138 ACKERMANNPETER’s function, 11 ACKERWPETER’s hierarchy, 7,20 algorithm, 87, 88 atgorithmically computable function, 88 almost everywhere (ax.), 220 ax. hcomputable function, 296 a.c. hhard function, 268 ARCHIMEDES’ number, 6 arithmetical instruction, 38ij arithmetiration of finite sets of formal equations, 116 arithmetization of formal equations, 115 arithmetiration of tcrm, 114, 116 arithmetization of vsuiables, 114 asymptotic random string (KOLMOGOROV), 312 augmented loop computable function, 417 augmented LOOP language, 417 augmented LOOP program, 417 BAIRE’s Category Theorem, 287 BERRY’S paradox, 2 BLUM axioms, 211 BLUM space, 211 canonical index (for finite sets), 168 canonical size measure, 442 CANTOR numbering, 33 CANTOR’Sfunction, 32 CANTOR’s number, 33 ebaracteristic index, 173 characteriatic function, 2 CHURCH’S thesis, 92 class determining set, 241 cofinite set, 1 COLLATZ’s sequence, 5 complexity class, 226 complexity sequence, 273 composition, 9, 10 Compression Theorem, 239 computationtime closed class, 414 computational complexity measure, 211 concatenation, 71 convergence function, 106 courseofvalues recursion, 43 critical level, 357, 368 critical level induced by a ML test, 323
470
Cdude
decidable, 146 depth of nesting, 392 derivation, 101, 102 double courstofvalues recursion, 81 dovetailing, 128 effective operator, 190 elementuyhonest e l m , 426 enumerating function, 188 enumeration operator, 179 Enumeration Theorem, 123 equationally computable partial function, 103 equivalence problem, 427 EULERFERMAT's Theorem, 302 J3ULER'e phifunction, 302 execution time function, 394 &tended R E M A " Hypothesis (ERH),300 extensional recursive function, 187 factoring problem, 300 FERMAT's greatest problem, 203 FIBONACCI's sequence, 8 fixedpoint, 132 FixedPoint Theorem, 132 f o r m d equation, 100 formd system (CHAITIN), 337 free monoid, 2 full ML test, 360 function computed by a general program, 403 function index set, 161 functional composition, 22, 91 functional operator, 182 G s p Theorem, 229, 230 general program, 402,403 general recursive function, 91 general size memure, 440 geperdiaed RITCHIE's sequence, 73 GODEL (formal) theory, 167 GODEL numbering, 41 GODEL's Incompleteneas Theorem, 166, 339 GODEL's number, 41 GOLDBACH's conjecture, 203 Graph Theorem, 165, 156 GRZEGORCZYK's function, 83 GRZEGORCZYK's hierarchy, 62 H d t i n g Problem, 159 honest clam, 418 honest function, 240 Honesty Theorem, 241, 242 immune ret, 206, 333,334
Subject Index independent statement, 167 index (relative to an acceptable g&ielization), infinite sequence, 2 infinitely often (i.o.), 220 i.0. hcomputable function, 268 L o hhard function, 296 iteration, 5
99
JACOBI's symbol, 301
KALMAR elementary functions, 82 KLEENE's NormalForm Theorem, 127 KLEENE's predicate, 127 KNASTERTARSW'a Theorem, 186 KNUTH's notation, 7 KOLMOGOROV's complexity, 304 KREISELLACOMBESHOENFEL.D'sTheorem, 191, 192 lattice, 216 LEBESGUE's probability, 381 length (of a string), 72 lexicographical order, 2 limited existential quantification, 31 limited iteration, 13 limited maximum, 57 limited minimization, 28 limited minimization operator, 28 limited primitive recursion, 52 limited product, 27 limited pure iteration, 13 limited summation, 26 limited universal quantification, 31 limited Xprimitive recursion, 72 loopcomputable function, 386 loopconcatenation number, 397, 398 loopconcatenation hierarchy, 402 loop hierarchy, 397 LOOP language, 384,385 loop program, 385 loop variable, 385 margument associate function, 53 MARTINLOF's test (ML teat), 314 measure of computation, 211 measured set, 238 memorycomplexity, 212 MILLER and W I N probabilistic algorithm, 300,301 minimization, 91 minimization over {a$, 206 MOIVRE and LAPLACEs Theorem, 378,379 mrandom string (KOLMOGOROV), 311,312 name (of a complexity class), 226
477
478
Cdude
normal derivation, 106 null string, 2 numbertheoretic partial function, 1 numeral, 100 onoargument primitive recursive function, 9 operator, 190 Operator Gap Theorem, 234 Operator SpeedUp Theorem, 259 padding function, 140 pairing function, 32 P A R I S  W I N G T O N ’ S Theorem, 6 partial function, 1 partial function symbol, 99 p u t i d recursive (p.r.) function, 91 partial recursive (p.r.) operator, 183 p a r t i d recursive (p.r.) stringfunction, 206 partially decidable, 146 P W O arithmetic, 6 PEANO axioms, 3 PELL’s equation, 9 Ploop simulator, 418 predicate, 15 PFUSBURGER formulas, 449, 450 PRESSURGER functions, 449, 450 primitive recursion, 4, 90 primitive recursive function, 23 primitive recursive function in, 417 primitive recursive real number, 206 primitive recursive set, 25 primitive recursive stringfunction, 72 primitive recursivelyhonest function, 418 principal partial function symbol, 103 priority method, 283 probabilistic algorithm, 369 probabilistic TURING machine, 156 projection, 157 Projection Theorems, 157 pure iteration, 5 pure primitive recursion, 4 RAMSEYPARISHARRINGTON numbers, 6 RhMSEY’e Theorem, 6 random etring (KOLMOGOROV), 311 realtime computable function, 209 Recursion Theorem, 132 recursive function, 91 recursive operator, 183 recursive real number, 185 recursive set, 144, 155 recursively convergent, 195 recursively enumerable (r.e.) in increasing order, 147
Subject Index recursively enumerable (r.e.) index, 172 recursively enumerrble (rx.) set, 146, 166 recursively enumerable (r.e.) set of p.r. functions, 188 recursively meegre set, 282 recursively nowhere dense set, 280, 281 recursively separable sets, 1 W Replacement Rule (RR), 100, 101 representable ML test, 340 Revisited Gap Theorem, 231 RICE’S Theorem, 162, 164 RITCHIE cleases, 62 RITCHIE’s function, 62 ROBINSON functions, 37,s ROGERS’ Isomorphism Theorem, 141, 142 RUSSELL’S paradox, 152 scope (of a loop), 386 semichurcterirtic function, 146 set of the recursively first BAIW category, 282 set of the recurrively second BARE crtegory, 282 simple function, 429 simultaneous recursion, 35 singlovalued set, 180 8mn function, 129, 130 8mn Theorem, 130 SOLOVAY and STRASSEN probabilietic algorithm, 301 SpeedUp Theorem, 261 stepcounting functions, 211 string, 2 stringiunction, 72 Substitution Rule (SR), 100 SUDAN’Sfunction, 46 SUDAN’S hieruchy, 46, 67 support, 279 term, 99, 100 timecomplexity, 127 total effective operation, 193 total effective operator, 190 Totality Problem, 168 TURING machine, 144 ULcomputable partial function, 403, 404 ultimately zero function, 269 uniform complexity, 378 uniform ML test, 379 Uniform Recursion Theorem 135 Uniformization Theorem, 180 uniformly recursive sequence, 268 Union Theorem, 264 universal function, 82 universal KOLMOGOROV algorithm, 308 universal language, 402, 403
479
480 universd ML teat, 321 universd p.r. function, 123, 139 variable, 99
WAGNERSTRONG uci011~,129,130 Xprimitive recursion, 72
Cdude
48 1
AUTHOR INDEX
ACKERMANN, w., xi, 7 , n , 13, i s , 20, 25,45,62, 63, 71,77,78,81,82, w, Q0,98,98,204,227,205,448,463,464,475
AIILEMAN, L., 30G302,463,464 ADRIANOPOLI, F., ix, 216,225, 293,463 AHO, A.V., vii, 453 ALKHOREZMI, 201 AMIR, A., 439,463,466 ARBIB, M.A., 144, 292,294,453,459 ARCHIMEDES, 6 , 7 , 465, 475 ASSER, G., ix, 78,453 AZRA, J.P., 202,294,296,453 BAIRE, R., 278,282,287,288,468, 476,479 BARHILLEL, Y., 456 BARWISE, J., 457, 463 BEESON, M.J.,467 BELLMAN, RE., 462 BERNSTEIN, F., 141 BERRY, G.G., 297,475 BLAKLEY, G.R., 7,453 BLUM,L., 377,463 BLUM, M.,viii, ix, xi, 202, 207,208, 211224, 226, 232, 238, 238, 241, 243, 248, 249, 250, 251, 256, 257, 259, 263, 286268, 270, 273, 278, 292295, 376,377,384,394,407, 414, 418, 428, 4(0443, 445448, 460, 451, 453, 454,457,475 BOOK,R.V., ix, 294,464 BOREL, E., vii, 201, 202, 297, 454 BORGER, E., 467, 468 BORODIN, AB., vii, 229, 293,446, 447,464,468 BOROSH, I., 7,453 BRAINWD, W.S., vii, 78, 144, 202, 293, 294, 447, 464 BUTTERFIELD, J., ix BUTTS, R.E., 464 BUZETEANU, S., ix, 202,408,454, 467
CALUDE, C., ix, 21, 67, 59, 63, 66,68,71, 77, 79,82, 167, 169, 170, 173, 202, 280, 284,288, 293, 294,296,314,317, 318, 322,324, 328, 334,340, 342, 352, 374,377, 380,381, 447, 454,465, 467
CANTOR, G., vii, 32,33,3&37,42,123, 124, 141,201, 221,475 CAUCHY, A., 196 CAZANESCU, V.E., ix CEITIN, G.S., 200,465 CHAITIN, G.J., 166,298,303,336338,376,377,455,476 CHITESCU, I., ix, 314,317, 318,322,324,328,334, 340,342,352,377,380, 381,454, 455,467
482
Cdudt
CHOUEMA,Y., 439,453,466 CHURCH, A., vii, 92, 146, 202, 456,468, 475 CICHON, E A . , 467 CLEAVE, J.P., 383,446,466 COBHAM, A., 292, 446, 456 COLLATZ, L., 5,8,79,475 CONSTABLE, RL.,234,293, 295, 446, 447, 456 COOK, S.A.,vu, 294, 377, 466 DALEY, R.P., 377,456 DARBOUX, G., 454 DAVIS, M., 9,78, 92, 144, 202, 212, 298,312,340, 156,468, 460, 463, 467 DEDEKlND, R., vii, 77, 201, 456 DEKKEFt, J.C.E., 205, 456 DE LEEUW, K., 372, 467 DE LUCA, A., 216, 203,453 DEMETFtESCU, M.C.,455 DIMA,N., 49,W, 52,57,78,202,454,457 EBBLNGHAUS, H.D.,467 ELENBERG, s., 78,202,467 ELGOT, C.C., 78, 202, 467 ENDERTON, HB., 202,467 ENGELFRIET, J., 467 ERATOSTENE, 88 W O S , P., 6, 457 ERSOV, A.P., 461, If35 IXJCLID, 87,201,302,461 EULER,L., 302,476 FACHINI, E., 447, 457 F A N T A " U , B., 82, 455 FERMAT, P., 203,302,476 FIBONACCI, L., 8,42, 476 FINE, T.L., 377, 457 FISCHER, P.C., 259, 273, 276,277, 293298, 459, 462 FRECE, G., 466 FREIVALDS, R., ix, 178, 457 FRIEDMAN, H., 465 GANDY, R.O., 467 GAREY, M.R.,vii, 457 GEORGIEVA, N.V., ix, 13, 16, 20,78, 79, 457 GILL, J., ix, 268, 270, 293, 369, 467 GINSBURG, S., 449,457 GLADSTONE, M.D.,18, 467 GODEL,K., vii, xi,31, 4143, 77, 92, 9496, 114122, 126, 126, 129, 162, 186171, 201, 202, 247, 261, 269, 270, 272, 292, 339, 340, 456, 458, 464, 466, 468, 476
Author Index
GOETZE, B., ix, 397,401,439,447,448,460,4MJ GOLDBACH, C., XS,476 GRZEGORCZYK,A., riii, 62,62,78,82,83,291,383,446,46%, 466,467,476 GUY, R.K.,6,468
HAMMEFt, PL., viii HARRWGTON,L., 6,6,21,467,463,478 HARROW, K.,78,468 HARTMANIS, J., vii, ix, 168,202, 222, 226,249,291294,447,468, 466,467 HASENJAEGER, G., 467 HELM,JP., 202, 278,296,469 HENKE, F.W., 78,469 HENNIE,F.c., 78,144,202,292,4~~ HERBRAND, J., 201 HERMES, H., 202, 469 HEYTWG, A., 460 HILBERT, D.,77, 468,469 HINTlKKA, J., 464 HOPCROFT, J.E., rii, 168,202,222,294,447,46& 468 HORNER,W.G., 463 HUYNH,D.T., 467
m m ,OH.,447, 449, 469 IOSIFESCU, M., 466 INDERMARK, K., 78,469 lRLAND, M.I.,204, 469 ISTRAIL, S., ix
JACOBI, K.G.J., 301, 477
JANKO,W.H., 300,469
JAULIN, B., 202,294,453 JONHSON, D.S.,vii, 467 JOSEPH, D., 202,469 JURGENSEN, H., ix
KALMAR, L., 82,291,477 KAMAE, T., 377,469 KARP, R.M., 467 KATSEFF, H.P.,ix, 362,367,377,469 KETONEN, J., 6, 469 KFOURY, A.J., 144,469 KLEENE, S.C., vii, 3,77,78,87,92, 127, 130, 132,144, 160, 186, 192, 202, 2(u, 216,
226, 246,108,426, 427,466, 458,460,467,477
KNASTER, M.B., 186,477 KNUTH, D.E., 7,377, 466, 460,461,466,477 KOLMOGOROV, AN., vii, riii, xii, 287, 303,304, 308313, 320, 324,328334, 336,337,340,341, 346,347, 349, 361,368,367, 374,375378, 381, 464,469,460,467,476,477479
KRAMOSIL, I., 467
483
484
Cdude
KREISEL, G., 191, 192, #)2,4Bo, 477 KRONECKW, L., 3 LACHLAN, AH., 191,202,460 LACOMBE, D., 191, 192, 202,460, 477 LANDAU, S., 3WJ, 302,460 LANDWEBEFt, L.H., vii, 78, 144, 202, 246, 293, 294, 296, 447, 454, 460 LAPLACE, S., 378,477 LAW, BE.,ix LEBESGUE, H., 381,477 LEININCEFt, B.S.,447, 449, 459 LEVIN, LA., 334, 377, 380,466, 467 LEWIS, F.D., 246, 293, 460 LEWIS, P.M.!I, 292,465 LOFGREN, L., ix, 304,460 LOVELAND, D.W., 377379, 460
MACHTEY,M., viiix, 78, 130, 138, 141, 144, 202, 204,293, 294, 298, 402, 404, 417,418,420, 423,425,440, 441,443,444,447,449,450,461
MAGGIOLOSCHETTINI, A., 447,457 MALITZ, J., 141, 202, 481 MA",Y.I., 166, 202, 203,377, 461 MA",I., 369, 372 MARCUS, D.A., 302, 461 MARCUS, S., viii, 5'477,455
MARKOV.A.A., 144,202,461
MARTINLOF, P., viiix, xii, 202,297,303,305,313, 314, 317,320,323, 324, 334, 346,347,352,367,377,378,381,454, 455, 461, 465, 467, 468,477
McCAFtTHY, J., 457 McCREIGHT, E., 226, 241, 264, 295295,461 MGHLHORN, K., ix, 293,447,461,462 MEYER,A.R., viii, ix, 226, 240, 241, 259, 264, 273, 276, 277, 293296, 383, 384,388,392,396,407,414,428,446,447, 461,462
MILLER, G.L., 300,301, 369,376, 462, 477 MILLS, G., 6, 457 MINSKY, M., 202,376,462 M O W , A., 378,477 MOLL, R.N., 144, 293, 459, 462 MOORE,E.F., 372, 457 MORDELL, L. J., 9, 462 MULLER, G.H., 467 MUNRO, J.I., vii, 454 MYKILL, J., 202, 462 NALIMOV, V.V., 377,462 NEHRLICH, W., 397, 401, 439,447, 448, 450, 458 NERODE, A., 468 NIVAT, M.,464 NOVMOV, P.S.,88, 462
Author Index
OBERScHeLP,w.,468
ONICESCU, 0.. 465 OSTROWSKI, A.M.,438,463 OXTOBY. J.C.,281,463
PARIS,J., 6, 6, 21, 467, 463, 478 PAZ,A., 300,463 PAW, GH., ix, 167,16Q,202,455 PEANO, G., vii, 3,4, 6, 77, 167, 201, 463, 478 PELL, J., 9,35,478 PETEbl, R., xi, 7, 11, 13, 15, 20, 26, 46, 62, 63, 71, 77,78, 81, 82, 86, QO,98,
w, 202, m,m,2 9 5 , 4 ~ , 4 4 a ,463
POMERANCE, c., 300,453 POST, EL., 202,463 PRESBURGER, M.,447, 449, 460, 457, 469, 478 W I N , M.O.,vii, 222, 292, 295, Sol, 369,376, 463, 477 RAMSEY,F.T., 6 , 6 , 467,469, 478 RICE, H.G., 161, 162, 164, 170, 19C198,202,270,4M, 463,479 RICHMAN, F.,468
RICHTER,M.M.,468
RIEMA", B., 300,462,476 RITCHIE, D.M., viii, 240, 293, 383,384,388,392,396, 407, 414, 426, 446, 447, 462, 476
RITCHIE, R.W., 38, 53,62, 63, 69,71,73,78,83,99,204, 414, 446,447, 464,479
RTVEST, RL., 301,302,464 ROBERTSON, E.L., 246,293,296,460,464 ROBINSON, R.M.,19,37,38, M , 7 8 , 416, 464,479 RODDING, D., 467 ROGmS, H., ix, 88, 138, 141, 142, 166, 167,162, 164, 172, 191193, 202206, 212, 216,220,226,464,479
ROSE, G., 78, 459 ROSE, H.E., 468 ROSSER, J.B., 458 RUDEANU, S., viii RUMELY, R., 300,453 RUSSELL, B., 152,479 RUSU, D., ix
SACKS,G.E., 467 SANTOS,E.S., 369,464
SCHAFER,G., 296 SCHINZEL,B., 468
SCHNORR, C.P., ix, 202,259, 298295, 377, 447, 464 SCHWARTZ, J.T., 376, 455 SEMENOV, A.L., 202,294,377,4~5 SEVENSTER, A., ix SHCLMIR, A., 301,302,404 SHANNON, CE., 372,457
485
486
Cdudc
SHAPIRO, N., 467
SHEPHERDSON,J.C., 144, 202,462,
464
SHOENFIELD, J.R., 191, 192, 202,460,477 SHORE,R.A., 468 SIPSER, M.,377,469,468 SKOLEM, T., 77,464 SMORYNSKI, C., 7,464,466 SMULLYAN, R.M., 199,202,466 SOLOMONOFF, R.J., 303,376,466 SOLOVAY, R., 6, 301, 369,376, 469, 466, 479 SPANIER, E.,449, 467
SPECKER,E.,1Q6,466
STAIGER, L.. ix, 349,3M),380,486,467,468 STEARNS, R.E., 226, 291293, 438, 469, 465 STEEN, LA.,466 STRASSEN, V., 301, 369,370, 466, 479 STREINU, I., 488 STRONG, HR., ix, 129,130,138,202,466,480
STUMPE,G., 2Q3,464
SUDAN, Q., xi, 37, 46, 57, so, 61, M, 77,78, 82,m, ~ 9 2w, , w,202, m, 407,414,416,44a, 466,457, 466, 479
STURGIS, HE., 144,202, 464 TARSKI, A., 186, 477 TATARAM, M., 63,66,68,466 TAUB, A.N., 486
THOMAS,w., 468
TRAKHTENBROT, B.A., 229,293,466 TRAUB,JE., 463 TSICHRITZIS,D.,384,421429, 434, 437, 447, 449, 405 TURLNG,A.M.,vii, 144,202, 212,291,389, 467469, 464,466, 478, 479 TEW, I., 6Q,77,466 ULLMAN, JD., vii, 463 USPENSKY, VA., 78,202,294,377,486 VAIDA, D., ix VAN EMDE BOAS,P., 250,293,485 VAN HEIJENOORT, J., 297,469, 464,466 VERB=, R., ix, 78,466
V W U , V.,21,71,465 VON MISES, R., 463 VON "W, J., 133,446
WAGNER, E.G., k, 129,130,138,202,466,480 WAINER, S.S.,467 WEIHRAUCH, K.,ix, 7478,84,469, 466,468 WEYL, H.,vii, !U31, 466 , E.J.,467
Author Index
WINKLMANN, K., 293,462 YAMADA, H., 308, 292,466 YASUHARA, A., 78,166, 202, 466 , YOUNG, P., viix, 7 8 , 1 3 o , i a , 141,144,202, 2 0 4 , ~ i , m 251,288295, 298,440,441,443,444,447,450, 459,461,466 WTING, S., 195, 466
ZIMAND, M., ix, 290, 389,374, 455, 466,168 ZVONKIN, A., 334,377,380, 466
487