theories computational complexitycristian/crispapers/cristiancalude... · independent theories of...

500

Upload: others

Post on 18-Jan-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance
Page 2: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

THEORIES OF COMPUTATIONAL COMPLEXITY

Page 3: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

ANNALS OF DISCRETE MATHEMATICS

General Editor: Peter L. HAMMER Rutgers University, New Brunswick, NJ, U. S.A.

Advisory Editors: C. BERGE, Universite de 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 California Institute of Technology, Pasadena, CA, U.S.A. G.-C. ROTA, Massachusetts Institute of Technology, Cambridge, MA, U. S.A.

35

NORTH-HOLLAND -AMSTERDAM NEW YORK 0 OXFORD 0 TOKYO

Page 4: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

THEORIES OF COMPUTATIONAL COMPLEXITY

Cristian CALUDE Department of Mathematics University of Bucharest Bucharest, Rumania

1988

Page 5: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 DE R B I LT AV E N U E NEW YORK, N.Y. 10017 U.S.A.

LIBRARY OF CONGRESS Library of Congress Cataloging-in-Publication Data

Calude, Cristian. 1952- Theories o f computational complexity / Cri s t i a n Calude.

p . cm. -- (Annals o f discrete mathematics ; 35) B1b:iography. p . Includes indexes. 199; 0-444-70356-X 1. Computational complexity. I. Title. 11. Serfes.

QA267. C34 1988 511--dC19 87-30864

CIP

PRINTED IN THE NETHERLANDS

Page 6: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

TO ELENA AND ANDREEA

Page 7: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

This Page Intentionally Left Blank

Page 8: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 prob- lems 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 number-theoretic functions computable by algorithms, i.e. the algorithmi- cally 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 1959-1960.

The computational complexity studies fall into a variety of direc- tions, 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 NP-complete problems), or in sections of some books on com- putation 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 machine- independent theories of computational complexity, whose selection is motivated by their intrinsic importance and practical relevance. One of them (i.e. the KOLMOGOROV and MARTIN-LOF theory) wan never syn- thesised 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

Page 9: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

V i i i Caludc

logic, constructive topology, probability and programming theories are established.

The book ie organiced in five chapters. The rust chapter is devoted to a complexity-theoretic 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 self-contained and complexity-oriented 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 MARTIN-LOF theory of complexity. This theory, referring to the complexity of “algorithmic descriptions”, is developed within a non-binary 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 pro- gramming 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 non-computable functions. The mid 60’s marked a similar situation as concerns the diffkultp of computations. Hence, most of results are nega- tive. 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 limita- tions”.

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, to logicians and philosophers.

I express my profound gratitude to 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 to Professor P.L. HAMMER for advising the book

Page 10: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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. MARTIN-LOF, 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 North-Holland, 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

Page 11: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

This Page Intentionally Left Blank

Page 12: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

TABLE OF CONTENTS

PREFACE Y i i

INTRODUCTION

CHAPTER 1 1. Primitive Recursive Hierarchies 1.1. Examples 1.2. ACKERMANN-PETER’S Hierarchy 1.3. Primitive Recursive Functions 1.4. Primitive Recursive Invariants 1.5. Primitive Recursive Enumerations 1.6. SUDAN’S Hierarchy 1.7. 1.8. Primitive Recursive String-functions 1.9. History 1.10. Exercises and Problem

Universal Sequences of Primitive Recursive Functions

CHAPTER 2 2. Recursive Functions 2.1. Examples 2.2. Arithmetiration of Computation: An Example 2.3. Equational Characterbation of Partial Recursive Functions 2.4. GODEL Numbering8 2.5. Recursively Enumerable Sets 2.6. Undecidability and Independence 2.7. Uniformity 2.8. Operators 2.9. Recursive Real Numbers 2.10. History 2.11. Exercises and Problems

CHAPTER 3. BLUM’s Complexity Theory 3.1. Examples 3.2. BLUM Spaces 3.3. 3.4. Complexity Classes 3.5. The Speed-up Phenomenon

Recursive Dependence of Complexity Measures

1

3 3 7

22 26 32 45 62 71 77 79

87 87 92 99

129 144 159 171 178 195 201 203

207 207 211 218 226 249

Page 13: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

xii Calude

3.6. The Union Theorem 3.7. Hard Recursive Functions 3.8. Complexity Sequences 3.9. A Topological Analysis 3.10. History 3.11. Exercises and Problems

CHAPTER 4 4. 4.1. Examples 4.2. KOLMOGOROV’s Complexity 4.3. MARTIN-LOF Tests 4.4. Undecidability Theorems 4.5. Representability Theorems 4.6. Recursive MARTIN-LOF Tests 4.7. Infinite Oscillations 4.8. Probabilistic Algorithm 4.9. History 4.10. Exercises and Problems

KOLMOGOROV and MARTIN-LOF’s Complexity Theory

CHAPTER 6. 5. Subrecursive Programming Hierarchies 5.1. Examples 5.2. The LOOP Language 5.3. LOOP Hierarchies 5.4. A Universal Language 5.5. A Dynamic Characterisation of LOOP Classes 5.8. Augmented LOOP Languages 5.7. Simple Functions 5.8. Program Sire 5.9. History 5.10. Exercises and Problems

BIBLIOGRAPHY

INDEX OF NOTATIONS

263 268 273 278 292 294

297 297 303 313 330 340 352 361 388 376 377

383 383

391 402 407 416 427 440 446 447

384

453

469

SUBJECT INDEX 475

AUTHOR INDEX 481

Page 14: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

1

INTRODUCTION

This book is essentially self-contained. 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.

The set of natural numbers will be denoted by RV, i.e. JV = {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 ele- ments. 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 (i E 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 non-empty 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 that 4 ie total. A partial function 4:" AIV will be called number- theoretic partial function.

Let d:A S , B be a partial function. Then dom (4) =

{z EA l4(z) f 4, Graph@) = {(z,d(z)) Iz E dom (4)); 4(C) = {4(z) 12 E C) , for each C C dom (41, 4-'(D) = {z € A 1#(z) ED}, for each D C B. Two partial functions bl:A, S, B1 and d2:A2 S, B2 are equal in case dom (4,) = dom (#2), and #,(z) = d2(z), for each z E dom (bl); we write dl = 42.

range (4) = <4(z) Iz E dom (4)).

Page 15: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

2 Calude

For each set A we denote by 9 the set of all subsets of A; Qj is the empty set. By Pf(A) we denote the family of all finite subsets of A . If A is a set at most countable, then card A is the number of elements of A, in case A is fmite, and card A = m, in the opposite case.

Let A and B be two sets such that A c B . The characteristic function of A with respect to B is the function x A : B - { O , l } , x A ( z ) = 1 if z € A , and xA(z ) = 0 if z 4 A .

Partial orderings will sometimes be strict (<) or non-strict (5). If (A,<_) is partially ordered, then A u {OO} is endowed with the augmented partial order: z y if z and y are in A and z 5 y , or y = m; we write <_ instead of 3

The logical asbreviations are the following: “A” for “and”, “V” for h‘Or”, “j” for “only if“, “H” or “iff” for “if and only if”, “3” for “there exists”, “V ” for “for all”.

By p z [ ... z...] we designate the smallest natural number z such that the expression ... z... holds, if this smallest natural number exists, or 00, in the opposite case.

For every z f R, [z] is the lower integral part of z. Let X = { a l , ..., a,,}, p 2 1, be a finite set, called sometimes alphabet.

Denote by X* the free nonoid generated by X with X as a null element (the empty string). The elements of X* are called strings. Each non- empty string z can be uniquely written as z = zl...z,, where the zi’s are in X; n = E(z) is the length of z. For every string z in X*, and each n in IV, by 2” we denote the string ZZ. . .~ ( n copies) in case n > 0; zo = A. We shall work with the lexicographical order induced on X* by the order a l < a2 <...< a,; we denote by y(n ) the n t h string ( n 2 1) in X* accord- ing to the lexicographical order.

By X” we denote the set of all infinite sequences x = z1z2. .. z, ... of elements in X. If n E N - (0) and x Ex“, then x(n) = zl...z, is the initial segment of length n of r; clearly, x(n) EX*.

Chapters are divided into sections. A cross reference of the form “Theorem (4.2.14)” refers to the Theorem (2.14) of Chapter 4; this theorem can be found in Section 4.2. The chapter number 4 is omitted if the reference is in Chapter 4.

The symbol 0 is used at the end of a proof or at the end of theorems, propositions, lemmas or corollaries not followed by proof.

The bibliographical references are made by the author’s name fol- lowed by a bracket date.

Page 16: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

3

CHAPTER 1

1. PRIMITIVE RECURSIVE HIERARCHIES

This chapter has two aims, namely to present the fundamentals of the primitive recursive function theory, and to develop a classification of primitive recursive functions according to their rate of growth.

The former goal is mainly technical; the following chapters will extensively use the language and the results established here. The latter goal pertains to our main interests. The primitive recursive functions are, in a sense, the simpler algorithmically computable functions and the rate of growth classification is the fvst natural method in analysing the costs of computations. As it will be quickly clear, this reasonable and useful method has a restricted utility: a devastating increasing function is diffi- cult to compute, but the converse implication fails to hold.

1.1. EXAMPLES

We begin with a series of examples which motivate the interest in the defmitions by induction and in their corresponding class of number- theore tic functions.

The fundamental infinite mathematical system is that of the natural numbers+

N = {0,1,2,3, ...} . The system of natural numbers can be obtained by starting with the

object zero (0), and applying indefmitely the “successor operation”, which gives the “next object”. The famous five PEANO axioms constitute a complete description of the system of natural numbers (KLEENE [1952]).

“God made the intcgcrr, all rest is the work of man ” raid KRONECKER about one hundred yearn ago.

Page 17: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

4 Caludc

The fdth PEANO axiom (in a set-theoretic formulation: a subset of the set of natural numbers which contains 0 and is closed under the successor operation is precisely the set of all natural numbers) inaugurates the defm- itions by induction (called also, by recursion).

The first examples of such definitions are those of the sum, product, and exponentiation number-theoretic functions:

a t O = a , a - succ (z ) = succ (o+z ) , a * O = O , a * Succ (2) = (a *z) + a

a o = l , a S u c c ( r ) = aI .

,

where Succ stands for the successor function: Succ (2) = z + 1.

namely, of primitive recursion. Let us assume that the functions The definitions above constitute particular cases of a general scheme,

g : W - N , h : W + = 4 IV

are already known. Then, there exists a unique function

f :w+' + m satisfying the following two equations

f ( a * , . . * , ~ , , O ) = g(alt...,an) 9 (1.1)

/ ( a l,...,% ,z + 1) = ( a 1t...,a,,,z ,f (a,,...,% ,z 1) - (1.2)

We say that f is defmed by p r i m i t i v e r e c u r e i o n on z, with n 2 0 param- eters a , , ..., a,,, from g and k. We agree upon the fact that in c a e n = 0 the function g reduces to a constant. The value of f a t (a lt...,a,,,z) with t > 0 can be obtained, via the previously known function h, from its value at (a l t ..., a,,z-l), and so inductively from its values at ( a , ,..., a , , z - 2 ) , ( a ,,..., a,,z-3) ,..., (ol ,..., 4,,O); the last value comes by (1.1) from the previously known value of the function g.

For example, in case of the sum function f (a,z) = a + z, we have n = 1, a , = a , and the previously known functions are g(4) = a , h ( a , z , y ) = y + 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

Page 18: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 3

f ( a 1 , * . . ~ n ,z + I ) = hl(al,*..,an ,f (a1,**-yan ,z)) y (1.3)

where hl:RV"+' + IN. If the equation (1.2) is replaced by

f (~1 , . - ,an ,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 func- tion h in the right-hand 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 (a lv-yan ,z 1) 7 (1.4)

for some function h 3 : N - N, then we have a definition by pure iteru- tion.

In the case with no parameters (i.e. n = 0) there is only one particu- larization, 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 (1.5)

f ( z + l ) = H ( f ( 4 ) 7 (1.6)

for some fmed natural number a and number-theoretic 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

a o = a ,

an+1 = {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

a, /? , if an is even,

(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

Page 19: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

6 Caludc

unprovability result by establishing some bounds for the RAMSEY- PARIS-HARRINGTON numbers associated to the involved variant of RAMSEY’s Theorem.

For every finite set X and every natural p , [XIp denotes the set of all p-element 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 parti- tion of the set iX]P into k classes, there exists an m-clement subset I’ X, all of whose p-element 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 - ( rn ) l 7

and this i s a statement provable in PEANO arithmetic. The PARIS-HARRINGTON 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 rn-element, relatively large subset k’C X, all of whose p-element 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 PARIS-WRINGTON statement is denoted by

7% d m ) P *

Finally denote by Rl(rn) the smallest n with n +(m)P. The unpro- vability of the statement

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.

Page 20: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 7

,o18.00’ ARCHIMEDES’ number is about 10 (SMORYNSKI [1983]).

KNUTH j1976) has introduced a felicitous notation for describing huge numbers. KNUTH starts with the following expressions:

B(B( ...( B ) ...)) = B t T , B t (B t (.-t(B)...)) = B tt T , tt ( B tt (...tt(B)...)) = B ttt T ?

a.s.0. In the left-hand side of every equation above there are exactly T copies of B (here T and B are non-null 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”:

k(B,l ,T) = BT ,T 2 1 , k(B,n,I) = B ,n 2 1 ,

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. ACKERMANN-PETER’S HIERARCHY

To tackle the question “what one-argument number-theoretic func- tions are definable by induction?” we introduce the class of one-argument primitive recursive functions. Then we construct a hierarchy of one- argument primitive recursive functions by means of the ACKERMANN- PETER function.

Page 21: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

8 Caludc

In Example (1.1), COLLATZ’s sequence corresponds to an one- argument function which is defmed by pure iteration. The following exam- ples suggest the interest of the class of one-argument functions defmed by induction.

(2.1) Example. The geometric progression

u0,u ,,..., u, ,... where uo = a, un+, = q * u,, is a sequence defined by pure iteration.

(2.2) Example. The arithmetic progression

u0,u ,,..., u, ,... where uo = 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 = u1 = 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 di 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,...,uk-l = uk , 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 pro- gression and FIBONACCI’S sequence are recursion sequences of the second order.

0

Page 22: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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

z2 - d y 2 = 1, z,y 2 0, 1 d = a 2 - 1 , a > l ,

called PELL’s equation, has the obvious solutions:

2 0 = 1 , y o = o . (2.1) Furthermore, every solution (z,y) to PELL’s equation is of the form (zn , I n 1, where

z, + y n v z = ( a t f l y . The last equality enables us to write the following defmition:

zm+1 = a z m + dym,

ymcl = z,,, + 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 defmi- tion of the class of one-argument primitive recursive functions. AU func- tions will be number-theoretic, 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, Succ:N -+ N , Succ (2) = z+1, and the ezcees-over-a-square function, E:lN -+ N , E ( z ) = z P[z1/’I2; here z e y = max(z-y,O) is the arithmetical difference and [z‘/’] is the largest natural number y , such that y2 5 2.

(2.6) Definition. The class of one-argument primitive recursive func- tions is the smallest class of one-argument number-theoretic 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

Page 23: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

10 Calude

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.

N) are also primitive recursive, c ) for every a in N and every primitive recursive function

f1(z) = 9 ( 2 ) + h ( z ) , f & ) = !?(z) - h ( z ) , f d z ) = !?(h(z)), for all z in

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 one-argument 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)))).

(2.8) Example. The function C o : N - N defined by Co(z) = 0, for all E , is primitive recursive. Indeed, Co follows from 0 and E by pure itera- tion: Co(0) = 0, Co(z+I) = E(Co(z)) .

3

i2.9) Example. 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)).

il

(2.10) Example. The constant function C , : N - N , C,(z) = a, for all E , is primitive recursive. The case a = 0 was presented in Example (2.8). Let 4 f 0, and consider the function f :UV 4 UV defined by pure itera- tion: f ( 0 ) = a , f ( z + I ) = Succ ( f (2)). Finally write C,(z) = f (Co(z)).

1

The reader can easily verify that the following one-argument number-theoretic functions are also primitive recursive:

Page 24: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 11

S q ( 2 ) = 0 if 2 = 0, 8 9 ( 2 ) = 1, if Z > 0;

q ( z ) = 1 & 8 g ( 2 ) ;

2 + a ;

z - a ;

a’;

a o z (here a is a natural fmed parameter). It is worth noticing that the inductive definition of one-argument

primitive recursive functions provides a useful method to construct algo- rithmically computable functions. Indeed, it is easily seen that the base functions are algorithmically computable and the composition rules preserve this property. Furthermore, every one-argument primitive recur- sive function is everywhere defined on the set of natural numbers.

Keeping in mind the former fact let us pass to a fvst “complexity- theoretic” problem, namely to measure how complicate it is to perform the computation necessary to get the value of an arbitrary one-argument 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 ACKERMANN-PETER binary function, which is the number-theoretic function A:N2 + N defined by means of the following three equations

A(0 , z ) = z + 1 , (2.3)

A(n+l,O) = A(n,l) , (2.4)

A ( n + l , z + l ) = A(n,A(n+l,z)) (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 ine- quality 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 induction hypothesis, A(n+l , z ) 2 z + 1, we obtain A ( n + l , z + l ) > z + 1.

0

Page 25: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

12 Caludc

(2.12) Lemma. For all naturals n, z we have: A(n,z) < A(n,z+l).

Proof. For n = 0, A(0,z) = z + 1 < z + 2 = A(O,z+l). Assume that A ( n , z ) < A(n,z+l ) . In view of (2.5) and Lemma (2.11) we have A ( n + l , z + l ) = A(n,.A(n+l,z)) > A(n t1 , 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 induc- tion hypotheses and Lemma (2.12).

(2.14) Lemma. For all naturals n, 2, if n 2 2, then 2 . A(n,z) < A(n,A(n,z)).

Proof. For n = 2 we have: 2 - A(2,z) = 2(2.2+3) < 2(2*z+3)+3 = A(ZA(2,z)). If 2 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)).

3

(2.16) Lemma. 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 z : 1.

Proof. It is seen that t + k < A(2,z-Ik-el) 5 A(n+l ,z -Ll ) , for all t 3 k 4 . Consequently, A(n,z+k) < A(n,AA(n+l ,znkLl) ) =

a A (n - 1,t a).

(2.16) Lemma. For all naturals n, k we have: A(n t1 , z ) = A(n,A(n, ...y4(n,1)...)), where the symbol A appears (z+1) times.

Page 26: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 13

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 + l f . 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 one-argument primitive recursive functions. For all naturals n, z, put A,,(z) = A(n,z). Thus A,, becomes an one-argument 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 ) ) ! (2.7)

f ( z ) l w 7 (2.8)

for all naturals z.

(2.18) Definition. (GEORGIEVA [1976a]) For every natural n define G, as the smallest class of one-argument number-theoretic 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 2 0, contains the functions C,, P, sg and 89, for arbitrary natural a .

Page 27: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

14 Caludc

Proof. Firstly, we notice that C,(z) = 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 composi- tion 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 -+ N, we put fo(z) = z, and f i+ ' ( z ) =; i(f ' (z)) , for all z and i.

(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 ) <. &(z), then f ( z ) 5 h ( z ) < g ( z ) .

(2.22) Corollary. For every natural n 2 2 and all functions f , g E G,, there exists a natural k (depending upon f and g) such that f(z) + g(z) < d ( z ) , for all z.

Proof. From Lemma (2.21) we get two naturals p and q for which the inequality f(z) + g(z) < x ( z ) + x ( z ) holds for every 2. Using Lemma (2.14) we derive the evaluation: f(.) + O(Z) < 2 . 4m4P,q)(2) < &m4P.o)+' (2).

0

Page 28: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 15

(2.28) Lemma. Each class G,, 1~ 2 2, is closed under sum.

Proof. We can write the formula:

f ( z ) + g(z) = F ( z ) ' ( (W -=.g(z)) 9

where F ( z ) = x(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 , .

0

(2.24) Lemma. If g is in G,, n 2 2, and f is obtained by pure iteration from 0 and g, then f lies in G,+l.

Proof. If f ( 0 ) = 0 and f ( z + l ) = g ( f ( z ) ) , then f ( z ) = g'(0) 5 @(O) < &+l(kz), for 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).

0

A function f :PI -+ (0 , l ) is called a predicate since it can be viewed a8 the characteristic function of the property defining the set (2 E lv I f ( 2 ) = 1).

(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 ACKERMANN- PETER'S function m e derives the inequalities:

&) 5 & - ' ( A n ( z + ( k w )

< & - ' ( ~ , , + ~ ( z P ( k q ) ) ) , for all z 2 i . (2.9)

Intermediate etep: For all naturals n 2 1, k 2 2, we have:

Page 29: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

16 Calude

(2.10)

We proceed by induction using extensively the equation (2.5) and Lemma (2.16). For z = k, 4 - ' ( A , + l ( k q k 4 ) ) ) = &-'(A,+1(1)) = &-'(4*(1)) = A,,+l(k). If the equality (2.10) holds, then

& - ' ( 4 + I ( b + 1 ) q k - 1))) = 4-YA, (A, +1b q k "-1)))) = &(&-lPn+l(=+w)) = A , ( A , + l ( Z ) )

= 4 , + 1 ( Z + l ) *

From (2.9) and (2.10) we deduce that the inequalities

il

Theorem (2.26) shows that for every n 2 1, A,,+l increases foster than each function i n G,. Theorem (2.26) and Proposition (2.20) show that (Gn), lo is really a hierarchy.

(2.27) Corollary. For all naturals n 2 1, G, + G,,,.

f ( z ) < x(z) < A,,+l(z) hold for all z 2 i .

Proof. From Theorem (2.26) it follows that A,,+, EG,+, - G,, i.e.

0

C n * Gn+i.

Remark. It is seen that Go = G I since A, (%) = z + 2 = Ao(AAo(z)).

small classes G , . The following results deal with some useful functions lying in some

Notation. Fix a natural k 2 2. We denote by rm(z,k) the remoinder when z i s divided by k , and by 'jz/kl the integral part of the quotient z /k.

(2.28) Lemma. The class G, contains the functions r m ( z , k ) and [z/k], for every k 2 2.

Proof. We define both functions by limited iteration as following:

rm(0,k) = 0 ,

Page 30: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 17

rm(z,k) I , and fz/2] = f (z) Az, where f(0) = 0, f (zf1) = g( f ( z ) ) , f (z) I Adz), g(z) = z + 1 + 8g(rm(z,3)). Finally, [z/k] = F ( z ) Az, where F(0) = 0, F(z+l) = G ( F ( z ) ) , F ( z ) <_ A,(z), G(z) = z + 1 + G(rm(z+2,k+l)) , for k > 2.

0

(2.29) Lemma. Let g : N -+ N and P red :N -+ { O , l } be two functions in G,, m 2 3. Then, the function f :N -+ N defmed by

g(z), if Pred (2) = 1, 0, otherwise,

is also in G,.

Proof. First we notice that the function 2“ is in G 3 because 2” = A S ( z 3 ) + 3, z 2 3.

Next we consider the auxiliary function h :N -c DJ defmed by h(z) = 2 . z ,(2‘+’q2’+‘m(”A+’ S ? 3 + 1 ) ) ,

It is seen that, by Lemma (2.23), h is in G,, and

0, if z iseven, 2 . 2 , if z isodd.

Finally, in view of Lemma (2.28), we can write the formula

f (2) = [h((2 * g(z)+2) APred (z))/4] , which shows that f is in G,.

0

(2.80) Corollary. Let g, h be two functions in G,,,, rn 2 3. If Pred : N -* {0,1) is in G,, then the function f :N -+ N defmed by cases:

g(z), if Pred (2) = I, h ( z ) , otherwise,

is also in G,.

Page 31: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

18 Calude

Proof. We write f ( z ) = f l (z ) + fz(z), where

f1(') = 0 otherwise, {p(z ) , if Pred (2) = 1,

and

h ( z ) , if sg(Pred (2)) = 1, f 2 ( Z ) = I 0 , otherwise,

and we use Lemmas (2.23), (2.29). 0

Let PSQ : IV -+ ( 0 , l ) be the predicate given by the formula:

1, if z is a perfect square,

(2.81) Lemma. (GLADSTONE [1971]) The predicate PSQ lies in G3.

Proof. We write the formula

(2.82) Lemma. The class G3 contains the functions z', [zl/'] and E(z).

Proof. The function R : N -+ N defmed by Limited iteration: R(0) = 0, R ( z + l ) = f ( R ( z ) ) , R ( z ) I A,(z), is in G3 since f ( z ) = z + 1 + 2 - PSQ ( t + 4 ) is in G, by Lemma (2.31). It is seen that R(z) = t + 2 * [zl/']. Next, we write the limited iteration for z2:(z+l)' = R(z') + 1, zz 5 A,(z), thus proving that z 2 is in G,.

Page 32: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 19

Finally, [z1i2] = [(R(z) " z ) p ] and E ( z ) = 2 "[x 1/2 ] 2 .

0

(2.33) Proposition. Each class G,,, n 2 3, is closed under product.

Proof. If g and h are in G,, then f(z) = g(z) * h ( z ) = [((g(z) + h(t))2 ' (g (s) ) ' " ( h ( ~ ) ) ~ / 2 ] is also in G,, by Lemmas (2.32), (2.28).

0

We are now ready to get the final conclusion.

00

(2.34) Theorem. The set U G n coincides with the family of all one-

argument primitive functions. n 4

00

Proof. To prove the primitive recursiveness of the functions in UG,, i t

suffices to show that for all primitive recursive functions f ,g :IV --+ PJ, the arithmetical difference f ( z ) "g(z) is also primitive recursive. T o this aim we shall use (following ROBINSON [1947]) the auxiliary function F : @ + N defined by

n=O

F(u , r ) = E ( ( U + Z ) ~ + 3u + z + 1) , for all t t , x in N.

since the preceding square is ( ~ + z + 1 ) ~ . It is seen that for all u,z in PJ, if u 2 z, then F ( u , z ) = u - x ,

Furthermore, for all naturals u,z we have

21 = * F ( u , z ) = 0 . (2.11)

Indeed, F(u,u) = E ( ( 2 ~ + 1 ) ~ ) = 0. Conversely, assume that F ( u , z ) = 0, i.e. ( u + z ) ~ + 3u + 5 + 1 is a perfect square. Since

(u+z)2 < (u+z)2 + 3u + 5 + 1 < (u+z+2)2

(u+z)2 + 3u + z + 1 = (u+z+1)2

, it follows that,

, 1.e. u = z.

On the basis of the equivalence (2.11) we can write the formulas

Page 33: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Calude

Finally,

f ( z ) "g(z) = F(f(z),g(z)) * sg(F(F(f(z),g(z))+g(z),f(2))) 9

for all t in N; hence f(z) - g ( z ) is an one-argument primitive recursive function.

x

For the converse inclusion we must show that UG,, is closed under

pure iteration. To this aim let a be in N and let g be in some Gn, n 2 0. Consider the function f :Bv -+ lV which satisfies the equations: /(O) = a , f ( z + l ) = g(f(z)). Two cases must be analysed. If a = 0, then f is in G,,+,, by v i r tue of Lemma (2.24). If a # 0, then again two situations occur according to g'((a) being null for some natural k 2 0, or not. If g k ( ( a ) = 0: for all naturals k, then the function f can be written a8 f(z) = f (z+l), where f * ( O ) = 0, f*(z+l ) = h ( f * ( z ) ) , and h ( z ) = a * @(z) + glz) In the opposite case we use again the auxiliary function f . Let k be the smallest natural number for which g k ( a ) = 0, and deflne f by cases as follows:

n =O

6g(z).

if Pred (z) = 1, f.(z %), otherwise,

where

and f . (O) = 0, f.(z+l) = g(f - (z ) ) . a

The increasing sequence of classes GI s G1 'z - - 5 G, 5 * * * is called the ACKERMANN-PETER hierarchy. The main results concerning the classes G, are due to GEORGIEVA [1978a].

PAS) Theorem. (PETER [1957)) The diagonal function A:N - RV, A(z) = A(z,z) is not primitive recursive.

Page 34: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 21

Proof. h u m e , for the sake of contradiction, that 2 ia primitive recur- sive. From Theorem (2.34) we get a natural n such that is in G,. Theorem (2.26) furnishes a natural k such that A(=) < ~ , , + ~ ( z ) = A ( ~ + I , z ) , for all z 2 k. Let z = n + k + I. We arrive at a contradiction, since A(n+k+l) = A(n+k+l ,n+k+l ) < A(n+l ,n+k+l) (see Lemma (2.13)). This ends the proof.

0

Remar ke.

a) The function A grows faster than any one-argument primitive recursive function, hence it cannot be primitive recursive.

b) Some small values of A have bsen obtained (for example, i ( 1 ) = 3, A(2) = 7, A(3) = 2'&3 = 61, 2 "3, where power 2 appears 7 times). Roughly speaking, A , has a sub-linear rate of growth, A2 increases linearly, A3 exponentially, A, as a linear stack 8.8.0.

c) Each A,,+1 grows more rapidly than A,,, since the former cannot be reached from the latter without the aid of itself. Nevertheless, all A,, are primitive recursive in contrast to A which cannot be primitive recur- sive. Returning to the PARIS-HARRINGTON example we can see that the functions R i and 2 have roughly the same rate of growth. The impos- sibility of aggregating infmitely many proofs into a single one in case of the PARIS-HARRINGTON statement corresponds to the non-primitive recursiveness of function 2 (in spite of the primitive recursiveness of all its sections).

d) Function A (and in particular, A) is algorithmically computable as the following FORTRAN program shows (CALUDE and V E R U I1981 a]):

-

d..

INTEGER FUNCTION A (N,X) INTEGER X, PLACE DIMENSION ITERATION (N) , JF(N) JF(1) = X A = l PLACE = 1 IF (PLACE.GT.N) GO TO 6

1 ITERATION (PLACE) = 0 2 IF(ITERATI0N (PLACE) .GT. JF(PLACE1) GO TO 5

IF(PLACE.EQ.N) GO TO 3 JF(PLACE+l) = A A = l PLACE = PLACE+l GO TO 1

Page 35: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

22 Calude

3 A = A+1 4 ITERATION(PLACE) = ITERATION(PLACE)+l

GO TO 2 5 IF(PLACE EQ 1) GO TO 7

PLACE = PLACE-1 GO TO 4

6 A = A+l 7 RETURN

END

This fact suggests that, although the class of one-argument primitive recursive functions includes a wealth of usual algorithmically computable unary functions, it does not contain all algorithmically computable func- tions. In Chapter 2 we shall define a larger class of functions which will provide an adequate model of algorithmically computable functions.

1.a. PRIMITIVE RECURSIVE FUNCTIONS

We extend the notion of primitive recursive function from unary functions to n-ary functions, n 2 2. On this basis we introduce the Boolean algebra of primitive recursive sets.

The defmition of the class of primitive recursive functions f : W - N, n 2 1, will be also inductive, but more economical than the defmition of unary primitive recursive functions.

We shall use two operations, namely primitive recursion (see the defmition given by the equations (1.1) and (1.2)) and functional composi- tion. Giving the natural numbers rn, n 2 1, and the functions

h : P + I V

g,:w + Nt . . . , g m : w + N

f : W + N

we say that the function

is obtained by functional composition from the functions h , g,, ...,gm, pro- vided f (zl ,..., t.) = h ( g l ( t l ,..., t,), ...,g,( z l , ..., z,)), for all zl,. .+,, in N .

Here, the base functions are: the succc~eor function, the constant funetione Ct):RV" -* N , C?)(z1, ..., t,) = m, for any choice of the

Page 36: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 23

naturals n > 0 and m, and the projcction functions Pp):PJ" + N, pfn)(zl, ..., z,,) = ti , for each choice of n > 0 and 1 5 i 5 nA.

(8.1) Definition. The clase of primitive recureiue functions is the smal- lest 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 com- position are particular c w s of primitive recursion and functional composi- tion, respectively). To thb aim we display a sequence of primitive recur- sive 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 + 0 = P { l ) ( Z )

2 + (ar+l) = h ( w , z + y )

2 - 0 = cp(2) , 2 ' ( Y + l ) = g(z,Y,z.Y)

2 O = C"'(2) , Z#+' = t ( z , Y , 4

, 7

where h(z,y,z) = Succ (ps")(z,y,z)),

Y

where g(z,y,z) = p i 3 ) ( z , y , z ) + ~ ) ( 2 , y , z ) , and

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 defm- ition of the exponentation.

(8.8) Example. The predecessor function Pd (2) = z e l , can also be defmed by primitive recursion:

Pd (0) = 0 ,

The upper indices which denote the number of variable, rill be omitted when no confusion ia posiible.

Page 37: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

24 Calude

(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 ST are primitive recursive in view of the following relations:

64(0) = 0 9

and

C

(3.6) Example. The absolute difference function 12-y 1 is primitive recursive since it can be defmed by functional composition using the sum and the arithmetical difference: 12-y I = ( 2 % ) + (y-).

0

(8.7) Example. The e z c e s ~ - o u e r - a - s q ~ a r e function 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 func- tional 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.

Page 38: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 25

(8.8) Example. The comparisons functions

1, i f z < y ,

1, i f2 > y ,

le(' d) = 0, otherwise, 1 and

It is seen that h ( z , y ) = 8g(Y%), gr(z,Y) = Sg(Z+), and eq(z,y) = 67( Iz-y I), thus proving their primitive recursiveness.

n

Remarks.

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, ACKERMANN-PETER'S binary function.

a)

(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 RV" is primitive recur- sive.

0

(8.11) Example. For f i e d natural n > 0, the family of primitive recur- sive sets A c N" is a Boolean algebra with respect to the set-theoretic operations.

0

Page 39: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

26 Cdudc

1.4. PRIMITIVE RECURSWE INVARIANTS

This section is devoted to the presentation of the basic algebraic and

We begin with some "bounded" operations. logic operations which preserve the class of primitive recursive functions.

(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 9 2 , +I) = c g(z1,..vzn,i) i (4.1) i =+ +J

with the convention that f(zl,...,zn+l) = 0 whenever u(Z1,*.*,zn+1) > u(z1,-+n+1)-

(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.

Page 40: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 27

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 g(z1,..vzn,i) 7 (4.2) i=o(sl ,..., z, .J

with the convention that f ( z l , ..., z ,+~) = 1, whenever u (z 1,..-,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.

Page 41: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

213 Cnlude

f ( z l ,..., z,,t) =

'the smallest natural y 52, for which g(zl ,..., z,,y)= 0,

'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(tl ,..., zn,l), and we test the condition g(z, ,..., z,,l) = 0. In the affuma- tive case, f(z,, ...,z,, z ) = 1; in the negative case we continue the computa- tion with g(zl, ...,z,, 2). The process continues until a natural y 2 z satis- fying 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 primi- tive recursive functions (see also the Remark b) following Example (3.8)).

(4.7) Theorem. If g:W++' 4 RV, n 2 0, is primitive recursive, then the

function f :W+' - LW defined by f (zl ,..., z , ,z ) = py[g(z , ,..., z,,y) = 01 is

also primitive recursive. a

Proof. The auxiliary function h : W + ' --c N defined by

1, if g(zl ,..., zn,t)#O, for every O s t < y ,

can be expressed by a limited product:

So, by Theorem (4.5), h is primitive recursive.

Page 42: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 29

Finally we can write a

0 =o

To prove the correctness of formula (4.4) we analyse two cases.

i) If f ( z l ,..., zn,t) = t T t + l , then t 5 t , g(z l ,..., z,,t) = 0, and g(z ,,..., z,,m) # 0, for every m < t . Therefore h(zl ,..., z,,O) =

~ ( z ~ , - * * , ~ n , z ) = 2 h(zl,-*,zn,U) - (4.4)

1, ...,h( Z 1 , . . . , Z , , ~ ~ ~ ) = 1, h(z l , ..., zn,t) = 0, ..., h(z1, ..., Z n , Z ) = 0, so t =

5 h(Zl,...,Z,,Y). I

y =o

ii) If f ( z l ,..., z,,z) = z+l, then g(z, ,..., zn,y) # 0, for every y 5 z . Consequently, h ( z l ,..., zn,y) = 1, for every y 5 z , so

a

P O

h(zl ,..., z,,y) = ztl.

Theorem (4.2) and formula (4.4) show that f is primitive recursive.

Remarks.

a) If h :W 4 N and g : W f l --* PI, n 2 0, are two primitive recursive functions, then the function f :W 4 PI defined by

is also primitive recursive, since it can be expressed by the formula

f ( z l , - - * , ~ n ) = F(Zl,...,zn,h(Zl,...,zn)) 9

where

F(z1 ,... , Z , , t ) = cCY[9(Zl,...,Z,,Y) = 01 *

b) The condition g(zl , ..., z,,,z) = 0 appearing in the definition of the limited minimization operator is as general as the condition gl(z, ,..., z,,z) = g2(z1 ,..., zn,z), since the latter is equivalent to

Some examples will illuminate the importance of the limited minimi- )g1(z, ,...., w)- g2(21,... ,Z , ,Z) I = 0.

zation operator.

Page 43: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

30 Calude

(4.8) Example. The quotient funtion quo (z,~) ia defmed as the quo- tient obtained by dividing z by y, in case y # 0, and quo (z,O) = 0. We express the function quo by the formula

quo (z,y) = sg(y) * (pz[gr(y(z+l),z) = I]), and then we use Theorem z

(4.7).

a

(4.9) Example. The remainder function rm(z,y) is defmed to be the remainder when z is divided by y, provided y > 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

1, ifz is prime, = i 0, otherwise.

I t 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 nth prime function pn is defined by pn(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 opera- tor. The crucial point is to derive an a priori limit. For every n 2 0, we

prime greater than pn. Here n! denotes the factorial function which obviously is primitive recursive (O! = 1, (n+l)! = ( n + l ) . n ! ) . Using the auxiliary primitive recursive function h:%V N,

have pn! + 1 \ P, ,+~, since if pn! + 1 is composite, then it is divisible by a

h(y) = p z[PRIME(z)*gr(z,y) = 11, we can write the following primitive Y ! + l

recursive scheme:

I t follows that pn ia primitive recursive. a

Page 44: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 31

(4.12) Definition. To every predicate g : W f l -+ {O, l} , n _> 0, we MSO-

ciate the predicate f:W+' + {0,1} defined by limited czistcntial quan- ti fieation as follows:

1,

0, otherwise.

if g(zl ,..., z , , i )= 1, for

at lcaet one natural O < i < y ,

J

I =o We shall write: f ( z l ,..., z,,y) = ,V g(zl ,..., z,,,i).

(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, if g(z, ,..., z , , i )= I , for all naturals O<i<y ,

0, otherwise. f(zl ,..., z,,y) = !

(4.14) Theorem. The class of primitive recursive predicates f:W+' + {OJ}, n 2 0, 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 Sec- tion 2.3 when we shall prove the primitive recursiveness of some useful predicates related to the GODEL numbering of formal equations.

Page 45: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

32 Caludc

1.6. PRIMITIVE RECURSIVE ENUMERATIONS

We present two encoding schemes which allow to identify, in a primi- tive recursive manner, the set of all natural numbers N and various sets of n-tuples (for fued or variable naturals n 2 1). As immediate applica- tions, we reduce some definitions by induction (more precisely, simultane- ous recursion and course-of-values 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:

4 Q l M Q 2 ( 4 ) = z 7 (5.1)

(6.2) Theorem. CANTOR'S function J:w -+ N defined by J(z,y) = ( z + y ) ( z + y + 1 ) / 2 + z , is a pairing function.

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 (z-y) ' - 32 - y = 22. 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 that 82 + 1 <: ( 2 ~ + 2 y + 3 ) ~ . Concluding,

2 2 t 2y -L 1 <_ (8z+l)'/' < 22 + 2y + 3 , 2 ( 2 - ~ y + l ) 5 (8z+l)'" c 1 < 2(z+y+2)

. ,

[(1+((8~+1)'/'])/2] = 2 + y + 1

Thus we have derived a fvst equation

z t y = i(1+[(8~+1)~/'])/%!]4 . (5.4)

On the basis of the relations 32 + y = 2 2 q z + y ) ' and (5.4) we establish the second equation

Page 46: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 33

32 + y = 22 ~([(1+[(8~+1)’/’])/2]~1)~ . (5.5)

The linear system (5.4) and (5.5) has obviously an unique solution, which can be expressed aa:

2 = “ 4 ( z ) W ~ ) ) / 2 1 9

Y = f(z) - % 7 ( 4 ~ f ( Z ) ) P l 9

where f ( z ) = [(1+[(8~+1)~/’])/2] 0 1 and g(z) = 22qf (z ) )* . We have obtained the following formulas:

K ( z ) = “g(z )~ f (z ) ) /21 , w = ( f ( z ) ) - w ;

hence K and L are primitive recursive and z = K ( J ( z , y ) ) , y = L(J(z,y)).

AU it remains to prove is the relation (5.1), i.e. J ( K ( z ) & ( z ) ) = z . For an arbitrary z , we compute the largest natural tt for which

1 + 2 +...+ n 5 2 , and we put z=z - ( l+2+ ...+ n). It is seen that zsn; so, y = n+z = n-z. We have

z = (1+2+ ...+ n) + 2 = (1+2+ ...+( z+y)) + 2

= J(.,Y) )

and thus z = K ( J ( z , y ) ) = K ( z ) and y = L ( J ( z , y ) ) = L(z ) . Finally, 2 = J (K(z ) ,L ( z ) ) .

0

Remark. It is seen that the following formulas work: J

~ ( z ) = p z [ C eq (J (z , i ) , z ) = 11 , i=o

and

since J(z,y) 2 max(z,y).

Notation. The codification scheme J is often called the CANTOR numbering and the number J(z,y) is referred to a8 the CANTOR number associated to the pair ( 2 , ~ ) .

Page 47: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

34 Caludc

Remark. The primitive recursive function r : f l -* DJ defmed by a(z,y) = 2'(2y-1) "1 is also a pairing function.

(6.8) Proposition. If r : p + N is a pairing function, then from the equalities u l ( z ) = ul (z ' ) and u2(z) = c2(z') we infer z = 2'.

Proof. We have: z = 7r(u1(2),u~(2)) = a(ul(z'),u2(i)) = 2'.

0

(6.4) Proposition. Let a : N --c N be a pairing function and B E {ul,u2}. Then for every natural n, the equation u ( z ) = n has an infm- ity of solutions.

Proof. For all naturals n and p , we have: ul(*(n,p)) = n and a,(*(p,n)) = n -

o

(6.6) Theorem. Every pairing K:W -. UV can be extended to a primi- tive recursive bijection n ( " ) : W 4 N, for each choice of the natural n 2 3 .

Proof. Denote by a(2) = K the pairing function and by ui2) = ul,uh2) = u2 its decoding associates. Assuming inductively that the bijection a("):&"' -+ IN and its decoding associates have been already defmed, we can write the formulas

*(" '"( z 1 I..., 2, ,2, + l ) = J2)( 2 l,x(n)( z2 ,..., 2, ,2, + 1))

@ + ' ) ( Z ) = 012)(z) , @ + l ) ( Z ) = uI"'(up(z)) ,

,

which defiie a sequence of primitive recursive functions that works. 0

Remark. I t is obvious that one can equally extend the pairing function *:N2 -. N to a primitive bijection 1?-("):W - N by the formula

$2) =

Page 48: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 35

ii(" +*I( 2 , ,..., 2, ,z, +,) = xc.'"'( z * ,..., z, ),z, +I) .

Notation. We shall denote by J("):W -+ N the CANTOR bijection and by I p ) , ..., I?) its decoding associates. Thus, J(') = J, 11,) = K,

We use CANTOR'S function to establish the primitive recursiveness of the functions defined by simultaneous recursion. Aa an example, recall the dehi t ion of the solutions to PELL's equation (Example (2.5)):

Ip' = L.

z , = l , y o = o , z m + l = a z m + dym

Ym+l = z m + aYm

9

*

The above equations are not just two primitive recursions written together, since zmtl depends both on z, and y,, and y,+, is expressed simultaneously in terms of z, and y,.

(6.6) Definition. Let n be a natural number and g1,g2:W -+ N, h l , h 2 : N n + 3 -+ UV. The functions fl,f2:W+' -+ UV are said to be defined by s i m u l t a n e o u s r e c u r s i o n from the functions gl, g2, h , and h,, provided they are specified by the equations:

f 11z1,...,2, ,Y + 1) = h,(z,, . . . 9 2 , ,Y,

f2(21,...,2,,Y+l) = h2(Z1,...,2,,Y,

f 1(z1,..-,z,d,f 2(z1,-.*,%,Y)) t (5-8)

f*(z*,...,2,,y),f 2(21,...9%,Y)) ' (5.9)

Again we consider that the functions g l and g2 are reduced to con- stants, in case n = 0.

Before passing to prove the closure of the primitive recursive func- tions class under simultaneous recursion we shall spend a minute with the solutions of PELL's equation.

(6.7) Example. The functions 2, and y, are primitive recursive. Initially, z, = 1, yo = 0. For m = 1, z1 = az, + dy , = a ,

y1 = z, + ay, = 1. Next, 2, = azl + dy, = a + d , yz = z t + ayl = a + a = 2a, a.s.0.

The main problem is to separate the definitions of z, and y,,,. The

2

Page 49: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

36 Calude

key is to try to express the CANTOR number of the pair ( ~ ~ + ~ , y ~ + ~ ) aa a primitive recursive function of the CANTOR number of the pair (z,,~,,,), and, fmally, to separate each component z, and y,. To thin aim we con- struct the auxiliary function F:N -+ N, given by F(m) = J(z,,y,). Using the defmition of 2, and y, we can derive the relations: F ( 0 ) = J ( z o , y 0 ) = J(1,O) = 2, JbZ,tdY,,~,+aV,) =

F(m+1) = Jb,+l,Ym+l) = J(.rC-(F(m 1) + d V ( m 11,

K ( F ( m ) ) + aL(F(rn))), since 2, = K(F(m)) and y, = L(F(m)).

defined by a primitive recursion: Concluding, the function F is primitive recursive since it can be

F ( 0 ) = 2 ,

F(m+1) = H(F(m)) ,

where H(n) = J(aK(n)+dL(n),K(n)+aL(n)) . Hence z, and y, are primitive recursive.

5

(6.8) Theorem. If the functions fl,f2:N"+' - N, n _> 0, are defmed by simultaneous recursion from the primitive recursive functions gl, g2, h , and h , (i.e. f l , f 2 satisfy the equations (5.6)-(5.9)), then they are both p r h i t ive recursive .

Page 50: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 37

Remark. The reader can easily extend the simultaneous recursion to m 2 2 functions and to prove that this operation preserves the class of primitive recursive functions.

(6.9) Proposition. Each primitive recursive function f :W - N, n > 1, can be written as f(z,, ..., z,) = /*(J’n)(~l,...,zn)),for the appropri- ate one-argument primitive recursive function f . Proof. Put f * ( z ) = f ( I p ) ( z ) , ..., I t ) ( = ) ) , for every z in RV. Then

f*(J(”)(z1,*..+n)) = r(Iln)(J’n)(21,...,2n)),

,..., Ip( J(”)( 2 1 ,..., 2, )))

= t ( z~ ,***+n) *

(6.10) Corollary. Every primitive recursive function can be obtained from the one-argument primitive recursive functions, the sum, and the projection functions by means of functional composition.

Proof. We use Proposition (5.9) and the form of CANTOR’S function. 0

Corollary (5.10) says that, under suitable conditions, the defmition by primitive recursion is reducible to pure iteration. In applications (for instance, in developing SUDAN’S hierarchy in Section (1.6)) we need a direct relation between primitive recursion and pure iteration. This required reduction can be obtained by means of ROBINSON functiona R ( ” ) : W - JV defmed by (see ROBINSON [1947]):

R(’)(z) = 2 ,

Page 51: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

38 Caludc

R(')(z,y) = ( ( z + ~ ) ~ + z ) ~ + y , R ( ~ + ' ) ( ~ ,,..., 2,,zn+,) = R(~)(R(~)(~~,...,~,),Z,+~) .

The function R = R(2) is not exactly a pairing function, because R and its decoding functions E([z'/'!) and E ( t ) satisfy conditions (5.2) and (5.3), but fail to satisfy (5.1) (for example, R(E([l'/']),E(l)) = 0 # 1).

RV, 1 <_ a 5 q , associ- ated to R(q), are inductively defmed as follows:

In general, the decoding functions Mi(*):&'

M"+) = 2 ,

iMp(2) = E ( 2 ) , .+t,ln+"(2) = M ! " ) ( M [ ~ ) ( z ) ) , for all 1 <_ i 5 n

.Mp!')(z) = M&) .

M l 2 ) ( t ) = E([z'/ ']) ,

,

I t is easy to check the validity of the following properties of ROBIN- SON functions:

M~(~)(R(~)(z~,...,z,)) = zi , for all 1 5 i 5 n (5.10)

R(")(O ,..., 0) = Mp)(O) = O , for all 1 5 i 5 n (5.11)

If M t ) ( z + l ) > 0 , then Mi(")(z+l) = M/")(z ) , (5.12)

for all 1 5 i 5 n-1 , and Mk)(z+l)

, ,

= MP)(Z)+l

(6.11) Theorem. (RITCHIE [1965!) Let n be in RV and f :w+' - 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 recursive functions H.:N + N and T:N - N, such that f can be expressed as

f ( z 1 , * * * y z n , Y ) = g(O,...,O) .~(R("+')(zli . . . ,zn,y))

f8g(R(n+1)(2~1...,2,,Y)) (5.13)

.M~2)(~( (R(n+1)(21 , . . ' ,Zn,Y)) ) 9

where f comes by pure iteration from 0 and H e :

m = 0 9 (5.14)

Page 52: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 39

&+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 ( z 1 , - * + n ,Y) = ~(~(~+')(z1,...,2,,y)) 9 (5.16)

where the function F:N + N is defined by iteration:

F(0) = 9(0,.-.,0) 9

F(z+ l ) = H ( z J ( z ) ) I

from the function H : I @ - nV given by

H(z ,w ) = g(MI"+')(z+ 1), ..., Mp+l)(Z+ l)).Bg(Mp+y)(z+ 1))

+ h (M1"+')(z), ..., Mp+;')(z),lu) 'sg(Mp+;')(z+ 1)) . In view of (5.10) we can write the formula (5.16) in an equivalent

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:

fom as:

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?+<') ( Z ) , f ( M l " + ' ) ( Z ) ,

..., M t S ' ) ( 2 ) ) ) *sg( Mp+y (2 + 1)) . Two cases must be analysed according to the equality

Mt,f')(z+l) = 0. In case Mp+T')(z+l) = 0 we have:

F(z+l ) = g(Ml"+')(z+l), ...,Mp+')( z+l))

= f (Ml"+') (z+ l), ...,Mk+')( z+l),O)

= f(M1"+') (z+ l), ..., Mp+')(z+l),Mp+y)(a+ 1)) . In the opposite case, i.e. MtA')(z+l) # 0, we have:

F( z+ 1) = h (MI"+')( z ) , ..., Aft;') (z ) , f (@+')( Z),-..,M~+;')( 2)))

Page 53: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

40 Calude

= f (Ml"+') ( t ) , ..., Mp +"(z),M!",t~)(z)+ 1)

= f (Ml"+l)(z+ 1), ..., M?+l)(z+ 1),MP+l1) (z+ 1)) . To obtain the last equality we have used property (5.12). This ends the proof o€ the fust intermediate step.

Next we construct the function f , satisfying the equations (5.14) and (5.15), for appropriate primitive recursive function H e . To this aim we work with the auxiliary function H*:N - N, defmed by H * ( z , w ) = H(O,g(O, ..., 0)) * .$z) + H ( z , w ) e g ( z ) , on whose bash we define the function H*:N 4 N,

H * ( w ) = R(2)(M[2)(w)+l,H*(M[2)(~),Mjl?)(~))) . (5.18)

-

Second intermediate step. For each natural z ,

rc., = W,F( . ) ) * 4 z ) * (5.19)

Recall that R = R('). For z = 0, T ( 0 ) = 0. For z = 1, ?(I) = H*(f(O)) = He(0) = R(I,H*(O,O)) = R(l,H(O,g(O, ..., 0))) = R(l,F(l)). If (5.19) holds for some t > 0, then

T ( z + ~ ) = H*(f(z))

= H * ( R ( z J ( z ) ) )

= R (MI2) (Rb P ( z ) ) ) + 1 ,

= R(Z+1Jf*bJ(Z)) )

= R ( z + l f i ( z Y ( t ) ) )

H*(M12)(R(zJF(z))) ,M~z)(R(z ,F(z)))))

= 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 n-tuples 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, pn(z) = pz.

Two primitive recursive functions will be useful in the sequel, namely the function ezp :N2 + N, czp ( i , t )= the exponent of the pi in the

Page 54: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 41

prime decomposition of some natural 2, and the function 1ong: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 for- mula

ezp ( i , z ) = pz[G(rm (z,pn(i)’+’)) = O] . (5.20) a

As concerns the function long it is seen that

Formulas (5.20) and (5.21) prove that czp and long are primitive

The basic idea (due to GODEL [1931]) is to represent the sequence of recursive.

natural numbers (zo,zl, ... ,z,) by the so-called GODEL number

+o *I *ll

POPI “ ‘Pn (5.22)

The codification (5.22) works in case all zi th are non-null, or in case we know the number of elements in the sequence. Otherwise, many dif- ferent 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 f:N + N-(0) and g : N 4 N be two primi- tive recursive functions.

Then, the functions F:N --c IN and G :IN -+ N given by n

F(n) = npn(i)J(if , id

and n

G(n) = pn(~y+’ * npn(i+lY(’) , i =O

are injective primitive recursive functions.

Page 55: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

42 Caludc

Proof. Obvious. 0

Remarks.

a) Functions F and G are not surjective. In spite of this disadvan- tage, we can easily work with F and C, since we can test the membership problem to 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)) I

g(n) = ezp(n+l,G(n)) . b) The codifkation schemes which use the products of prime powers

to represent fmite sequences of natural numbers are called GODEL numberinge. The natural number F(n) (or, G(n)) is often called the GODEL 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.

As in case of CANTOR’S numbering, we give an immediate applica- Recall Example (2.3) in which FIBONACCI’S sequence (u,) was tion.

defmed by means of the equations

u o = u * = 1 , “n+Z = %+I + Un

(6.18) Example. The FIBONACCI sequence (un) is primitive recursive. To this end we use the scheme (5.22) in order to represent the fust (n+l) elements of FIBONACCI’S sequence by a single natural number:

Page 56: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 43

< Uo,Ul I..., un > = fipn(i).' . iP0

The sequence (un) satisfies the equations

u , = l , (5.24)

un+1 = h(n,< uo>.*-pun >) p (5.25)

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 course-of- values 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- liary function F:N -+ N given by F ( n ) = < u,,ul,. . . ,urn >, and we notice that F can be defmed by primitive recursion:

F(0) = < u, > = 2 , F(n+1) = F(n) .pn(n+l) %+I) .

Finally, the equation (5.25) can be written as u , + ~ = h(nJ(n)), so con- cluding our proof.

0

(6.14) Definition. The function f:W+' 4 N, n 2 0 is said to be defmed by course-of-values recursion from the functions g : W + RV and h:N"+' -P PJ if f satisfies the equations

f(Z1,**.,ZnrO) = g(zt,...,zn) 9 (5.26)

f (2 t,--*+n ,I + 1) = h (z1,.-vzn 91,

< f (zt ,**- ,Zn ,O) , . -* , f (21r.--+n ,u) >) 9 (5.27)

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 course-of-values recursion from the primitive recuraive functions g : W -+ Bv and h :nv1)'2 + h', then f ia also primitive recursive.

n t . Proof. We discuss only the case < to, ..., tn > = n p n ( i ) I; the reader will

easily supply the detaile when the alternative GODEL numbering is uaed. i4

The function F : W + ' -+ h' defmed by F(zl, ..., zn,v) =

Page 57: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 course-of-values recursion from primitive recursive functions. We introduce the primitive recursive function F:Pf'+2 - RV defmed by F(zl, ..., zn,g,z) = 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,<f(zl,

- .* , zn ,O),***,f(z1,*-*,~n ,v) > ) * (5.31)

Here we made use of the formula (5.22). NOW, f is defmed by course-of- values 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

Page 58: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 45

functions, there exist recursion defmitions which fail to have the property mentioned above; as an example, we recall the nested recursion defming the ACKERMANN-PETER function.

1.6. SUDAN’S HIERARCHY

We extend the classification of one-argument 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 def ied by means of the equations

S(z,y,O) = z f Y 1 (6.1 1 S(z,O,fl+l) = z , (6.2)

S(z,y + 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 ACKERMANN-PETER’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.

Proof. For n = 0, S,(z,y) = z + y > 2, since y > 0. Assume that S,(z,y) > z. Again we use the induction: for y = 1, Sn+l(z,l) =

hypotheses we obtain: S,,(S,,+l(z,o),S,+l(z,O)+l) > Sn+,(z,O) = z. Using both induction

Page 59: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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: Sn(z ,y+rn) 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.

Page 60: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 47

(6.6) Lemma. For naturals 2, y, n we have: Sn(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

Page 61: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

48 Caludc

(6.6) Lemma. For all naturals z, y , m , n, if y m n > 0, +hen S ~ ( Z , Y ) + sn(z,m) I S n ( Z , y + m + l ) ,

(6.9) Lemma. For all naturals z and y , we have: S,(z,y) 2 z y .

(6.10) Lemma. For all naturals z, n we have: Sn(z,z) < Sn+,(z ,2) .

Page 62: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 one-argument number-theoretic 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 6,, n 2 0, contains the functions P"), cill, 8g and 6.

Proof. The following formulas are self-explanatory: 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(zt-1) = 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 , ...,fa are 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 6,, n 2 0, then the function f :N - N defmed by cases

9 ( 4 , if h ( z ) = 0 , t ( z ) , otherwise,

is 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 also in a,.

b) We have: f ( z ) = g ( z ) * q ( h ( z ) ) + t ( z ) . e g ( h ( z ) ) , hence by Lemma (6.12), f h in 8,.

0

R(" +'I( f l(Z ),...,f, (2 ),fm+L(Z 1) = R(2)(R(m)(fl(z )c*..,fm(z ) ) , f m + d z ) )

Page 63: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

50 Cdudc

(6.14) Theorem. (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

f ( z ) < Sn+l(z,k) * (6.4)

Proof. We proceed by structural induction, i.e. on the basis of the con- struction 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

<: S,+,(z,2), for all a E {OJ, ..., n}. The last inequalities follow from Lem- mas (6.4) and (6.10).

Assume now that for every z, g(z ) < Sn+l(z,k), and h ( z ) < S n + l ( ~ , m ) , for appropriate constants k, m 2 1. We shall prove that the four operations present in the defmition of s, preserve the bound- edness property. If f ( z ) = g ( z ) + h ( z ) , then by Lemma (6.81,

i ~ ~ ( ~ 9 2 ) 5 ~ , + 1 ( ~ , 2 ) , [2”’] < z < Sn+,(z,2), and si(z,z) I sn(z,z)

f ( z ) < sn+,(z,k)+Sn+l(z,m) 5 Sn+1(Z,k+m+1). If f ( z ) = g ( z ) . h ( z ) , then Sl(Sn +1(2 &),Sn+l(z F)) I s n ( sn+l (z ,k) , sn+l(z,m )) 5 Sn(Sn+l(z,L+mf,Sn+l(z,k+m)+k+m +I) =

f (2 ) <Sn+l(z,k) .Sn+l(Z,m) I

S,,+,(z,k+m+ 1); we have used Lemma (6.9) and the monotonicity proper- ties of SUDAN’S function. If f ( z ) = ( g ( h ( z ) ) , then f ( z ) <

defmed by limited iteration, then the result h immediate. sn+l(s,+l(z,m),k) I sn+1(z,sn(m&)), by Lemma (8.7). Finally, if f h

0

Remark. It is worth noticing that with a similar proof M in the case of Theorem (6.14) we can deduce that for each function f in 8 , , n 2 2, there exists a constant k (depending upon f ) such that f ( z ) 5 S,(z,k), for all 1.

(6.16) Coroilary. For every function f in s,, n 2 1, there exists a natural i such that

fk ) < %+1(z,z)

for every z 2 i.

Proof. We use Theorem (6.14) and Lemma (6.2) to fmd the natural k satisfying the inequalities: f ( z ) < S,+,(z,k), and S,+,(z ,k) < S,+,(z,k+m), for all z 2 2 and m 2 1. Hence f ( z ) < Sn+l(z,z), for every z _> k.

0

Page 64: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 51

(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. pure iteration from 0

If g is in sn, for some n 2 1, and f is obtained by and g, then f is in 8,+1.

(6.14) furnishes a natural k 2 1 such that all z.

33

(6.18) Theorem. The class U 8, is closed under sum, product, composi-

tion and pure iteration. Hence, it is exactly the class of one-argument primitive recursive functions.

n=O

To end the proof we show that f can be defmed by limited iteration within 8,+1. All it remains to get is a bound in terms of functions from s,,+~. Using (6.5) we have:

Page 65: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 one-argument 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 one-argument 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 -L N by limited primitive recursion if f is defmed by primitive recursion from g and h , and for all naturals zl,. ..,z,,y

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 number-theoretic 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. deduce that S, c S,,,, for all naturals n <_ rn.

In view of Defmition (6.20) and the monotonicity of S, we

(6.21) Proposition. L-y, zy, 2 3, ;z'/'], E ( z ) , and S,(z,z), 0 5 i 5 n.

Each class s, with n 2 1, contains the functions

Proof. We display a sequence of functions in S, which includes the required functions:

zy :

Page 66: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 53

Pd (0) = 0 , Pd (z) = zL1 : I Pd (z+l ) = z ,

2 9 :

G(z) :

(6.22) Corollary. For every n 2 1, s,, c S,.

Proof. We proceed by structural induction. The base functions in s,,, i.e. Succ (z), E ( z ) , [z'i'], Si(z,z), 0 5 i 5 n, are in S,, by Proposition (6.21). Again this result guarantees the closure under sum and product, thus end- ing the proof.

0

The relation between a,, and S,, is more profound than it is stated in Corollary (6.22). We shall prove that 6, is preciaely the claw of all one- argument functions in $,,. To this aim we introduce the notion of function associate.

(6.28) Definition. (RITCHIE [1965]) A function g : P -+ N, m 2 1, is called the m-argument associate of the function f :W + N, n 2 1, if for every natural z we have:

g (Mi" (2 ) ,..., Mi" )( 2 )) = f (MI") (z ) ,..., M p ( z )) . (8.6)

Recal that the functions M("), 1 5 i 5 n, are the "pseudo-inverse"

Page 67: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

54 Cdudc

functions associated to ROBINSON'S function R(") (see Section 1.5).

Rernar ks.

ate function, if any. Indeed, if g is an m-argument associate, then a) Each function f :W + RV has at most one m-argument associ-

g(zl, ..., E,) = f(M1")(R(m)(z1, ..., z,)), ..., Mp(R(")(z I,...,tm))) ,

for all zl, ..., z, in N.

b) The identity function Pi1)(,) = z does not have a 2-argument asaociate. Indeed, assume for the sake of a contradiction, that the func- tion g : f l - UV is a 2-argument associate of HI). In view of (8.7), g(z,y) = pll)(M[')(R(2)(z,y))) = R(2)(z,y) = ( ( ~ + y ) ~ + z ) * + y . This func- tion g violates condition y.6) for z = 1, since g(Mp(l) ,Mp(l)) = g(0,o) = 0 f 1 = pI' (M[l)(l)).

(6.24) Proposition.

a) The class of all m-argument associates of functions in a, is closed under functional composition and limited primitive recursion, for all choice of n 2 0 and m 2 2.

b) Each function defmed by primitive recursion from functions with associates in s, has an associate in s,+~, for every n 2 0.

Proof.

a) Assume that h:Nq - N and g l ,..., !,:A!"' - N, q,m 2 1, are associates of the one-argument functions h , 91 ,..., g,':nV - in s,, respectively. Then the function f :W - RV defined by f (z ,..., 2, ) = h (gl(z ,..., 2,) ,..., gq(z ,... ,z,)) is precisely the m-argument associate of the one-argument function f *(z) = h*(R(q)(g:(z),...,g;(z))). We have:

f (Ml")(z), . . . ,M~~)(z))

= h(g;(z ) , . . . ,g ,*(z ) )

= h (MI')(R(q)(g; (2 I,... ,g& ))),...,Mp(R(')(#: (2 ),...,O9*(2 1)))

= h (g MI") (2 ) ,..., Mim )( z )) ,... ,gq (MI") (2 ) ,..., Mim)( z )))

= h *( R(')( (2 ), ..., o,'( 2))) . The function f * belongs to a, by Proposition (6.13),s), and closure under composition.

N o w we shall pass to b), and fmally shall return to the closure under

Page 68: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter I 55

limited primitive recursion using the results below. b) Assume that the function f:RV'+' + N is defined by primitive

recursion from the functions g:N' + lN and h:hV'+' + N, having their associates g* and h' in a,, respectively. Accordmg to RITCHIE's Theorem (5.11) f can be expressed by the formula:

f (2 1 ,... ,Zq,Y) = g(O,...,O) *G(R('+')(z 1 ,... ,Zq,Y 1) + Mi2)( 7((R(Q+')(zl, ..., Z',Y)))

'a9(R(Q+')(zl,...,zq,Y )) 9

where 7 is def ied by pure iteration from 0 and a certain function-H. defined in terms of the functions H' and H (see the formula (5.18)).

Using the formulas (relying upon the hypothesis):

g'(MI2) ( M 1 " ( W ) + 1)) = g(MPf1) (Mp (w)+ 1), ..., Mp+')(Mp (w )+ 1)) ,

and

h*( w ) = h (MP+') (Mi') (w )), ..., ~~l)(M1')(w)),Mi2)(y)) 9

we can derive the equality

H (MI') ( w),Mh') (w )) = +(Ads1) ( MI') (w )+ 1))

* g'(M12) (MIZ) (w )+ 1))

+ 89( M f i 1 ) (MI')( w )+ 1)) .he( w ) , which ensures that the one-argument function H(M~*)(w),M~~)(w)) is in 8,. Next,

H*(M[') (w) ,MP)(w)) = H(O,g(O, ..., 0) ) .G(M{')( w))

+ H(MI2)(~),M~')(ur)).sg(MI2)(~)) 9

and

H*(w) = R(2)(M~2)(~)+l~'(MIZ)(~),M~2)(~)) , are also in a,.

1-argument associate of f , i.e. the function Proposition (6.17) shows that 7 lies in a,+'. Consequently, the

Page 69: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

56 Cdude

+ A4p (f'((R(Q+')(Ml'+')(z), ...,MJ::') (2))))

' 89((R(Q+1)(Mlq+1)(Z), ..., M~"(2))) , is also in

We are now in a position to deal with the closure under limited prim- itive recursion. All it remains to compute is a bound within 8, for f * , in caae f is bounded by some function t:RVq+' - N having its associate t*:N -+ IN in 8,. In view of the-formula (6.81, a bound for 7 will ensure a bound for f*. Since for all 2, f(z) 5 R(z , t (z)), it follows that f , and hence f* , are in a,, thus completing our proof.

0

thus ending the proof of b).

(6.26) Corollary. For every 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 associ- ate 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 self-associated. The associates of the functions H"')(zl, ..., 2,) are the functions Mim)(z). To prove that S,(z, j) has an associate in 8 , we proceed by induction relying upon Pro- position (6.24 Immediate for n = 0: the associate of S,(z,y) = z + y is

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),

M p ) ( z ) t M 14 ( 2 ) = E([z ' / ' ] ) + E ( z ) which lies in 8 , . If S,(z,y) has an

succ ( * ) ( Z , 3 / , 4 + 4 3 ) ( z , v , 4 ) ) . 0

(6.26) Corollary. For every R 2 1, 8 , is exactly the class of all one- argument functions in s,. 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 Corol- lary (6.26).

0

Page 70: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 57

X

(6.28) Theorem. The union USn is precisely the class of all primitive

recursive functions. n 4

X

Proof. The class U S, contains the base functions Succ, Ck), and P,'"),

and it is closed under functional composition (Defmition (6.20)), and primi- tive recursion (Proposition (6.24) and Corollary (6.25)). The converse implication being obvious, the proof is completed.

n==U

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 func- tions, all primitive recursive functions.

To prove some closure properties of the classes S,, we introduce P new operation, namely the limited maximum.

(6.29) Definition. The function f :W+' -c RV is defmed by limited mazimum from the function g:Qv"+' -.+ N if f(zl, ..., z,,~) = max(g(zl ,..., z,,O) ,..., g(zl ,..., z,,y)), for all z1 ,..., z,,y in RV. In this case we shall write:

(6.80) Proposition. Each class S,, n 2 2, is closed under limited max- imum.

Proof. Let g:Pfl + N be in S, and then set

f (zl ,..., z,,y) = maxz(g(z, ,..., zm,z)). It is seen that I

f (. 1,...,z, 90) = g(zl,...,~m,O)

f (z1,...,zIn,1+1) = m=(f (zl,. . . ,~, ,~),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 rn-argument associate of the function

Page 71: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

58 Cduda

g *( 2) = g (MI" +I) (z),...,MA7;1) (2)) , in 8, . The Remark following Theorem (6.14) furnishes a constant k for which the inequality

g*(z ) I Sn(z,k) 9

holds for all 2 in N. By (6.7) we deduce:

g(Z1,... ,Zm,Y) = 9'(R(m+1)(21 ,... ,2,,Y))

L Sn(R(m+1)(2*,,.-,Z,,y)tk) 9

for 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 all arguments, in particular in y . This ensures that for all zl,..,,z,,y in N we have:

(6.81) Proposition. Each class S,, n 2 2, is closed under limited sum- mation and limited product.

It can be easily proved that the functions f l and f z can be defmed by limited primitive recursion aa follows:

Page 72: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter I 59

Clearb, zv 5 1 + S2(z,y), for all 2 and y. Hence, by Proposition (6.30), the functions f l and f 2 are in S,.

El

(642) Propodtion. minimir at ion.

Every class S,, n 2 2, is closed under Limited

Proof. defmed by

If F:RV"'+' -+ RV is in S,, then the function f :RV"+l -+ N

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)))) 9

j - 0 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 imi tive 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:

S,(l+rn,zl+ ...+ z,), and &)(zl ,..., z,) = zi < l+(zl+ ...+ z,) =

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 which satisfy the inequality (8.9) with the constants

Succ (2) = z+l < S0(2,2), ck) 2 1 ,..., 2,) = rn < l+rn+(Zl+ ...+ 2,) =

S , ( l , Z I+...+%).

Page 73: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

60 Cdudc

We shall prove the inequality:

f(z1,*..,zn) < s,,+2lSp(q,mq),z,+...+zn) * (6.10)

First we prove, by induction on t , the inequality Sp+t(q,r) > t*Sp(q,r), for all q 2 1 and t 2 1. For t = 0, Sp(q,r) > 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 ,r - 1 )+ r )

> t .~p(~,+:+,(9,~-~),~p+t+,(q,~-~)+~) 2 t . sp+t+ , (q , r -1 )

2 t - s p + 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

Page 74: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 61

= Sp(q,mq)

= sp+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 func- tions g:W -+ IN and h:RV+' - JV which satisfy the inequality (6.9) 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 induc- tion on y, the inequality

(6.11)

Immediate for y = 0: f(z1, ..., zn,O) = g(z1, ..., 2,) < Sp(q,zl+ ...+ 2,). f (z1,-*,2n ,Y) < S p (qvz i+ ***+zn + U) *

If f ( 2 1 , ..., zn ,y ) < Sp(q,z l+* . -+Zn + y ), then

Sp(q,z r + . . . + ~ n + y+ I ) = Sp-l(Sp(q,z ,+. . .+zn+y),

Sp(q,2,+ ...+ z*+y)+q+ ...+ z n + y + l )

> Sp- l (sp (q ,Z1+.*-+zn + 11, f (Z1,*..,tn ,~)+z 1+ *.-+zn + y + 1)

> Sp-,(q , f (2 1,.*+n ,Y)+z ,+-*+zn + Y )

> S p l ( q 2 , f (2 1,**+n ry )+ z I + .**+zn + Y )

> h(zl,...,zn,y,f(Zl,...,Zn)) = f(Zl,".,Z,,Y+1) *

This completes the proof. 0

(6.24) Corollary.

tive recursive. a) The function S:N -+ UV defmed by i ( z ) = Ss(z,z) is not primi-

b) SUDAN'S function S:N3 -+ IN is not primitive recursive.

Proof. a) Assume, for the sake of a contradiction, that s' is primitive recur-

sive. By Theorems (6.28) and (6,33) it follows that we can fmd two natur- ah 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).

Page 75: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

62 Cdude

Remark. Though S is not primitive recursive, it is algorithmically com- putable. 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 ACKERMANN-PETER 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 func- tion f : N 3 + RV given by

f (z ,v ,O) = z + 1 7 (7.1)

f(z,O,n+l) = 1 , (7.4)

f (z,?/+l,n+1) = f(z,f(z,y,n+l),n) 9 (7.5)

for all 2 , y and n in RV, n 2 2.

RITCHJE’s n th class R, is the smallest family of number-theoretic 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 ) th RITCHIE’s clans. So, both sequences of functions (S,),,? and (f,),,x generate, in a structural manner, the clase of all primitive recur- sive functions: This is the reaeon for calling them universal sequences of primitive recurdive functions. In what follows we shall focus out atten- tion on one-argument primitive recursive functions; thus we shall work with one-argument universal sequences. For this purpose we write RITCHE’s function f as a double infinite sequence of one-argument

Page 76: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 63

functions:

The reader, already acquainted with the monotonicity properties of ACKERMANN-PETER 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 one-argument number-theoretic functions containing the functions Succ (z), E ( z ) , [zl/'], and f m , n ( ~ ) , and being closed under the operations of sum, product, composition, and lim- ited iteration.

(7.8) Lemma. Each class C,,,, rn 2 0, n 2 0, contains the functions P"), ci'), 80, G, with i,j E {0,1,2).

Page 77: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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

g(z), if h ( z ) = 0, F ( z ) = 1 t ( z ) , otherwise,

is contained in C,,n whenever g, h , and t are in Cm,n.

(7.4) Lemma. For all naturals n 2 3, m 2 2 and a 2 1, we have:

(f:,m(z))2 I fndl"(4 7 (7.12)

for all 2.

(7.5) Theorem. 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:

f b ) 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)

[zl"] < SUCC (21, f n , m ( z ) < fn,m(Z+l) ,

*

Now let f(z) < f,",,(t+l) and g(z) < fi,m(z+l), for 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

Page 78: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 65

iteration. For the product we have:

f (. 1 - d z 1 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 z 1) 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 < f n 2 + l , m ( 4 7 (7.14)

for every natural z 2 j.

Proof. Under the hypothesis we use Theorem (7.5) to fmd a natural e , such that f(z) 2 fi,,,(z+l), for all z . In view of the inequality

f i , m ( z ) < f n + l , m ( z + k ) 9 (7 .15)

for all z 2 0, k 2 1, n,m 2 2, we deduce (by (7.9))

f ( z ) I f d , m ( . + 1 )

< f n + l , m (z +' + I )

I f n + l , m ( 2 . z )

I f n 2 + 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 , , ( f n + l , m ( x +k))

Page 79: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 Corol- lary (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.

Proof. We prove by 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 fn+l , f as fol- lows

f n + l , k ( z ) = 8 Q ( f i + l , k ( z ) ) -k f i + l . k ( z ) 9 (7.18)

where f,'+l,k is a certain function belonging to every class C m + l , k , for m > n .

function gn,k(z) = fn,k(G(z)+z): The auxiliary function f,'+,,k b defmed by pure iteration from the

f i + l , k ( 0 ) = 9

f , '+ l .L(z+l ) = gn,k( f i+ 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 that f n + l , k E Cm+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(.) 5 f m + l , k ( z ) - (7.17)

Immediate for z = 0, and 2 = 1: fi+l,k(O) = 0 5 1 = fm+l ,h (0 ) ,

the inequality (7.17) holds, for some z > 0, we show that it devolves for f ; + l , k ( l ) = gn,k(f:+l,k(o)) = gn,k(O) = f n , k ( l ) <_ f m + l , k ( l ) . that

( x t l ) :

f m + l , k ( z + l ) = f m , k ( f m +l,k(% 1)

Page 80: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 67

(7.9) Corollary. The sequence (C,,,),z3 is strictly increasing, for every natural rn 2 2.

Proof. Immediate from Corollary (7.7) and Proposition (7.8). 0

(7.10) Proposition. For all naturals n,m 2 2, we have C,,, C Cn,m+l.

Proof. As in the proof of Proposition (7.8) we state that f, is in Cn,q,

is in C2,q, q 2 rn, by Lemma (7.3). Aesume that f,,, is in Cn,q, for every q 2 m. The function fn+l,nr can be expressed by formula (7.16), with k = m. Our induction hypothesis is clearly equivalent to the inclusions C,,m c Cn,qr for all q 2 rn. Consequently, for every q _> m, the function g,,,(z) = f , , , ( q ( Z ) + z ) is in C,,, C C,,q; furthermore, fi+l,,(z) is con- tained in C,,q because it is defmed by limited iteration from gn,= and fn+l,q (recall that by (7-17), fi+i,,(z) <_ f n + l , m ( Z ) I fn+l ,q(z) ) . F ~ & Y , an inspection of (7.16) assures that fn+1,* is in Cn+l,q.

for all n,rn 2 2 and q 2 rn. For n = 2, fz,,(z) = rnz = C, m (z) .pyZ)

0

To end the proof we must return and prove formula (7.16). Again we use an induction on 2. The equality follows easily from the defmition, for z = 0. In case z = 1 we have: f n + l , k ( l ) = f , , ,k(! , ,+l ,b(O)) =

Page 81: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

68 Calude

(7.11) Lemma. For all naturals k 2 0 and n , n 2 1, we have fW) 5 f n + l , k ( 4 .

(7.12) Propoeition. For all naturala rn 2 3 and k >_ 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 fA,k(z+l) , for all z. Consequently, the following bound can be established:

o ( t ) = f'(0)

I f a 1 )

L f . , + l , k ( W !

for every z > 0. We have used Lemma (7.11).

(f E Cm,k C im+l,k by Corollary (7.9)), so it lies in Cm+l ,k .

The function g can be defmed by limited iteration within Cm+l,k

3

We close this section with a comparison between the classes (Gn),B, In 3, and (Cn ,m In ,m 20.

(7.18) Theorem. (CALUDE and TATARAM (19831) For all naturals ri _> 3, we have C,,2 = G,.

Proof. First we deal with the inclusion Cn,2 c G,. In view of Lemmas (2 .23 ) , (2 .32 ) , and Proposition (2 .33) , it suffices to show that fn,2 is in G,, for all n 2 3. I t is seen that f 3 , 2 ( 2 ) = 2' = A 3 ( ~ * ) + 3 , so C3,p C G3. If fn ,* is in G,, then, by Lemma (2.24), lies in G,+l because

For the converse implication, i.e. G, C Cn,2, we must prove the fol- lowing two statements: i) the claaa C,,p is closed under arithmetical differ- ence, and 5) 4, lies in Cn,2, for all n 2 3 .

fn+1.2(0) = 1, fn+1 ,212+1) = f n . d f n + 1 , d Z ) ) .

Page 82: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 69

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 one-argument 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 :N2 -+ RV satisfying the conditions

f (Z,O) = 2 9

f ( z , 9 + 1 ) = h(f(z,ar)) 9

f ( z , v ) i 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

f (2 ,Y) = sg(R(2)(z ,I)) *Mr)(m2)(z 1 1 1)) 9

where 7:nV 4 N is defmed by limited iteration from

H * ( Z ) = R(2)( Mf) ( z )+ 1 , q ( M [ 2 ) (2))

.( M p (Mp (z )+ 1) .dp(Mp) (Mi21 (z )+ 1))

+ h (MJ2)(2)) .89(Mi2) (M12)(4+ 1)))) 9 - and R(2) ( z , j (M[2) ( z ) ) ) . Consequently, f is in Cn,2, 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 func- tion z 9 y belongs to Cn,2 since

z - = z , z + y + l ) = Pd ( 2 9 ) ,

Z * < Z . 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

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 'fl cn,p Set y = 0 in the formula above; we get f ( z ) = f*(R(2) (z ,0) ) = f (z ' (z+~)~),

s(z,mr) =, !71(92(z,Y),g3(~,Y)) = 9'(R'2'(z,Y)), , where 91(4 =

Page 83: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 one-argument 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)93 is 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

gn(0) = 0 t

gn(z+1) = hn(gn(z)) t

can be written as &+,(z) = g,(z+l), where

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. m 2 2 .

We have G, = C,,,, for all naturals n 2 3 and

Proof. In view of Proposition (7.10) and Theorem (7.13) all it remains to prove is the inclusion Cn,, C for all n 2 3, and m 2 2. This reduces to the relation f,,, E Lr,,2, for all n 2 3, and m 2 2. Now for n = 3 the result is obvious since j 3 , , ( ~ ) = rnz 5 (2')"'; If for some n 2 3, f,,, is h. Cn,Zt i*e. cn,p ~ ~ n . 2 9 then fn+l,rn(z) = gn,m(z+l)t where L , ( n ( O ) = 0, gn,m(zT!) = hn,m(gn,m(z) ) t and hs,mJz) = G(z)+ sg(z)*fn,m(z)- Obvi- ously, hn,m is in Cn,m C Cn,2, hence h,, is in Cn+l,2, by Proposition (7.12), thus completing the proof.

0

P

(7.15) Corollary. The class U Cn,m coincides with the class of all one-

argument primitive recursive functions, for all rn 2 2. n 4

Proof. Immediate from Theorem (2.34) and Corollary (7.14).

Page 84: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 71

Remarks.

a) It is easy to see that 0, = Co,j = C,,j = Cz,j = Ci,o = Cj,l, for all i , j 2 0.

b) Corollary (7.14) says that 2’,3’, ..., m’ are all similar. More gen- eraly, for n 2 3, fn,2(z), fn,3(z) ,..., fn,m(z) ,... have about the same rate of growth, for each of them defines the same clam of functions. Thus, the ACKERMANN-PETER 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 one-argument functions in the (n+l)th 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 2 1

k(E,O,T) = B - T , ,

then the resulting (total) function k coincides with RITCHIE’s function f (CALUDE and VIERU [1981b)).

1.8. PRIMITIVE RECURSIVE STRING-FUNCTIONS

In this section we extend the primitive recursive functions and their corresponding hierarchies to string-functions. 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; how- ever, from a complexity-theoretic point of view, this equivalence may not be relevant, due to the inherent complexity of the encoding-decoding pro- cess.

Let X = {u1,u2,...,$p}, p 2 1, be a non-empty 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 = yl . ..ym are in X*, then the concatena- tion 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

Page 85: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

72 Cdude

zn = z...z (n copies of z) in case n > 0, and zo = A. Every string z E X* - {A} can be uniquely written M z = zl . ..z,, where all t i ’s are in the set of generators X . If z,y are in X* , then z c y if y = zz, for some

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 string-functions. The left- fiuccessor functions Succf:X* 4 X*, Succf(z) = a i z , the constant func- tions Cf:(X*)” -* X*, Cf(zI ,..., 2,) = y, for all zl,..;,z, in X* and each string y , and the projection function F : ( X * ) n -* X , F ( z l , ..., 2,) = zi, for all z1 ,..., 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 (non- commutative) 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 succes- sor. The reader can easily realise that our choice of left-successors (instead of the right-successors) does not affect the following results.

(8.1) Definition. The string-function f :(X*)n+’ - X*, n 2 0, is obtained by, X-primitive recursion from the string-functions g:(X*)” -+ X and I L ~ : ( X * ) ” + ~ .--c X*, i = l , ..., p, if

z in x*.

f (z1,.*.,zn,A) = 9 ( ~ 1 , * * * ~ , ) 9 (8.1)

(8.2) X f(Z1,.*-,zn,SUCCi (Y )) = h(zlt-**tznYY>f (z1v--,zn,fo) 9

for all i E { 1 ,..., p}, and z1 ,..., 2, ,y in X*.

(8.2) Definitlon. We say that the string-function f:(X*)nfl -c X*, n 2 0, is defmed by limited X-primitive reeursion from the string- functions 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 ) ) (8.3)

for all z1 ,..., z,,~ in x*.

(8.8) Definition. The clam of primitive recursive string- functions (over X) is the smallest family of functions defmed on (X’)” with values in X*, n 2 1, containing the base string-functions and which ia closed under func- tional composition and X-primitive recursion.

Page 86: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 73

(8.4) Example. The Concatenation funct ion c ~ n ~ : ( X * ) ~ -+ X* defmed by con2(z,u) = zy, ia primitive recursive. We fust defme the string- function c%~:(X*)~ -., X* by X-primitive 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 recursive- ness of the following string-functions:

con,:(X*Y -+ x*, con,(zl ,..., 2,) = zl...z, ,

01, i f 2 = A , -x GX :x* 0

We defme now an extension of RITCHIE's sequence of number- theoretic functions (f,),a (see the equations (7.1)-(7.5), f,(z,v) = f (z ,y ,n)) in order to obtain a hierarchy of the clam of primitive recursive string-functions. The generalized RITCHIE sequence ( f:),, 3, f::(X*)2 -., X* is defined by the equations:

f%v) = SUCCf(4 9 (8.4)

fT(z,X) = = 9 (8.5)

ff(z,X) = 7 (8.6)

f,X,,(z,~) = al, for all n > 1 ., (8.7)

r:+, (2 ,SUCCXb 1) = f Y z ,f:+l(. 9 (8.8)

for all n 2 0, i E (1 ,..., p } .

Page 87: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 string-functions containing the base string-functions, f,", and which is closed under functional composition and limited X-primitive recursion.

Remark. Since every string-function f," is primitive recursive it follows

that u f , ( X ) is a subset of the set of all primitive recursive string-

functions.

I.

n *O

(8.8) Lemma. then we can find a string-function fX:(X*)k - X* in &(X) such that

For all naturals R 2 0, k 2 1, I f :Nk - N is in R,,

f ( P (Zl) , . . . , l ( 2 6 ) ) = e ( f X ( Z 1 , . . . , Z k ) ) ? (8.10)

for all z,, ..., zt in x*. Proof. We develop a structural induction on the defmition of R,. The following equalities are obviously valid: Succ(e(z)) = e (Succf(z)),

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 from the functions h : W - N and g;:oVk - N, 15 i < m , in R,, satisfying the equality (8.10) with the string-functions h X , gi";-l 5 i 5 m , respectively. A simple computation shows that the string-function

works. Furthermore, j x is in &,(X).

co(e (. I)?--*,[ (zk)) = (c?(z I , - - , zk) ) , pi (e 1 ) P d (.k 1) = (P;"(% 1,.*.,2k ))*

fX:(x*)' 4 x., fX(211 . . . ,Zk ) = h x x (91 (21, ..., t~), ...,gm( X tl, ... , tk ) )

Page 88: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 75

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 string-functions o x , h X , and b X . We shall see that the string-function fx:(X*)'+l + X*, defmed by limited X-primitive recursion from gx and h f = h X , 1 5 i 2 p, works. The formula (8.10) can be easily established by induc- tion on the length of the last argument of fX. All it remains to show is a bound for f X within E,(X). To this end we proceed as follows:

( f X ( Z 1 , * - v 2 k , v ) ) = f ( l ( z l ) , * d ( 2 k ) , e (Y))

5 b(e (21)r-vd ( 2 k ) , e ( v ) ) = (bx(zl,*-*,zk,~)) 9

for a~ 21(...,zk, y in x*. 0

(8.9) Lemma. For all naturals II. 2 0, and k 2 1, if fx:(X*)' + X* is in f,,(X), then we can fmd an increasing function f :Nk -+ RV in R,, such that

( fX(21 , . -v2k) ) 5 f (l (21),*-,t 9 (8.11)

for a~ zl,. ..,zk in x*.

Proof. The proof is straightforward by structural induction on the defmi- tion of t,,(X).

0

(8.10) Theorem. (WEMRAUCH [1974]) Let n 2 0, k 2 0, and consider a string-function f :(X*)"+' + X* defmed by X-primitive recursion from the string-functions in f,,(X), gx:(X*)' + X* and hx:(X*)k+2 -+ X*. Then, f X is in E,,(X) iff there exists a number-theoretic 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*.

Proof. For the direct implication we can take b = f , where f is the number-theoretic function which comes from Lemma (8.9). Conversely, by Lemma (8.8) we can fmd a string-function bx:(X*)'+' + X* in t,,(x), such that t ( b x ( z l , n a + k , u ) ) = b ( l (zl) ,..., l (zk), l ( v ) ) , 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 X-primitive recursion over &(x), i.e. f X lies in f,,(X).

0

Page 89: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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))) (8.12)

for every z in 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 number-theoretic 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. choice of k 5 n.

For every natural 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 some n 2 3 . Then, the string-func tion f X ( 4 = Succl x x ( f n + l ( f ~ + l ( z , z ) , f ~ + , ( z , z ) ) ) ie also in f , ( z ) . Corollary (8.11) yields a constant m such that

1 ( f X ( z ) ) < fn+1(2,fn+1(2,' (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 precisely the set of all primitive recursive *

n =O string- func tions.

Page 90: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 77

Proof.

a) Immediate from Corollaries (8.12) and (8.13).

b) The closure

the closure of U R,,

(8.10).

x)

n 4

.x)

of U &(X) under X-primitive recursion follows from

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 string-functions. The reader can easily show that the string-function

c:x* -c { U , } *

given by C(X) = A, and

(8.13)

is a bijective primitive recursive string-function.

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 defm- itions 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 func- tions”) in his famous paper on the incompleteness of logical systems satis- fying certain reasonable conditions.

PETER [1934] introduced the term of “primitive recursion” and KLEENE [1936] wad the fvst to use the now-all-accepted name of “primi- tive recursive function”.

ACKERMA” [1928] and SUDAN [1927] share authorship of (what we call today) the fvst example of a number-theoretic (recursive) function which is not primitive recursive (see also CALUDE, MARCUS and T E W

Primitive recursive functions were extensively studied by ji979)).

Page 91: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

78 Caludc

ROBINSON [1947]. GRZEGORCZYK (19531 introduced the operation of limited recur-

sion 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 complexity-theoretic classifkation of primitive recursive functions. GRZEGORCZYK’s paper also provides a classifica- tion 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.

ACKERMANN-PETER’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!, ACKERMANN-PETER, as well as many other hierar- chies 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 to defme GRZEGORCZYK’s classes. In con- trast, VERBEEK [1978) has shown that it is possible to construct an infm- ite sequence of different hierarchies having the same properties as GRZEGORCZYKP hierarchy.

Primitive recursive string-functions were introduced and studied by ASSER [1980l, and EILENBERG and ELGOT [1970]. The generalization of GRZEGORCZYKL hierarchy to string-functions 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 recur- sive functions. YASUHARA 119711, BRAINERD and LANDWEBER [1974) present GRZEGORCZYK’s hierarchy. A string-function oriented presen- tation 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].

Page 92: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 79

1.10. EXERCISES AND PROBLEMS

Section 1.2

(10.1) Show that for every natural n 2 2, we can fmd a predicate P red :N

(10.2) (GEORGIEVA [1976b]) For every natural n 2 0, let 5, be the elase of one-argument number-theoretic functions which are obtainable from Succ (z), sqrt (2) = [zl/'], and &(z) by composition, arithmetical

difference and special limited summation ( f ( z ) = & h ( ( ~ + i ) ~ + z ) ) . Show

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, - Gn-l 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 - Gj-l, 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).

(0,l) in G,+l - G',.

u

- i -0

Section 1.8

(10.6) Prove the primitive recursiveness of the following functions:

min:N2-cRV , 2 , i f z < y ,

A , V : M - (0,l) ,

A 0 , i f z y = o ,

= i 1 , otherwise,

0, i f z = y = o ,

Page 93: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

80 Caludc

1 , if z is odd,

f g : J V + N , [log*(z)]+l , if 2 > 0 ,

otherwise,

f

h : N 2 - - . N , h ( z , y ) = [2/2’] I

Section 1.4

functions. Show that the function h :N2 - N defmed by the equations (10.7) Let f : N 2 -* RV and g : N --c RV be two primitive recursive

+,O) = g(2) 1

h ( z , y + l ) = f ( z ,Xh . ( z , i ) ) 9

m

I =o

is also primitive recursive.

defrned by (10.8) Show that the predicates f ,:N2 - { O , l } and fz:N3 - (0 , l )

1 , if g ( i ) < g ( i + I ) , for some z < i < y ,

and

11 , if z s y and z = m a x ( g ( i ) I z I i < - y ) , f 2 ( 2 ’ y 9 Z ) = 10 , otherwise,

are primitive recursive whenever g:N -+ N is primitive recursive.

Page 94: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 81

Section 1.6

(10.9) Shoy that the binomial eoe fficient function f : N 2 --* N,

f ( z , y ) = z:y J is primitive recursive.

(10.10) Show that the greatest common divisor function gcd :w 4 N defined by

gcd(z,O) = gcd(0,y) = 0 ,

i f 2 = y > o , gcd(z,y) = gcd(z ,y -z ) , if0 < 2 < , 1I( gcd(z-y,y) 9 i f 0 < Y < 2 *

is primitive recursive. (10.11) Show that the class of primitive recursive functions is closed

under a double course-of-values recursion, i.e. the function f :N2 4 N specried by the equations

f (0,311 = gdy) 8 4

f (2+1,0) = 92(2) 9

f ( z + l , v + l ) = h ( z , y , t ( z + y + l ) ) , is primitive recursive whenever the functions gi : N -+ N, h :N3 -+ N are themselves primitive recursive. Here, the function t :N --+ N is defmed as follows:

a

t ( z ) = r[pn(i)'(') ,

8 ( i ) = npn(j)'(j8J+), o < - - i < z .

I =o i

I ==O

(10.12) Let A : w --c N be the ACKERMANN-PETER function. For every natural n , denote by B, the one-argument function defmed by B , ( z ) = A(z,n) . Show that each function B, is not primitive recursive.

(10.13) Prove that for every primitive recursive function g:N --+ N , the function f :@ 4 N given by the equations

f(0,O) = 0 1

f ( O , Y + l ) = g ( f (Y90)) 9

f ( Z + l , Y ) = g ( f (z,I/+1)) t

is ale0 primitive recursive.

Page 95: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

82 Cdude

Section 1.8

(10.14) (CALUDE and FANTANEANU [1978]) ACKERMANN’s function ACK :N3 + IV is defmed by the equations (see A C K E R M A “ 119281):

ACK (z,y,O) = z+y , ACK (z,O,n+l) = Q ( z , ~ ) ,

ACK (z,y+l,n+l) = ACK (2, ACK (z,y,n+l),n) , 0 , i f n = O ,

z , i f n > l .

Prove that S(z ,v ,n) 2 ACK (z,u,n), for all

(10.15) (GRZEGORCZYK [1953]) Define the clam of KALMAR e lc - mcntary function8 to be the smallest class of number-theoretic functions containing the functions Succ (z), z + y , z+, and which is closed under functional composition, limited summation and limited product.

(z,r,n) E Qvs - {(0,0,2)).

Show that: a) The class of KALMAR elementary functions is closed under lim-

b) The class of KALh4AR elementary predicates is closed under h-

(10.18) Prove that S2 is exactly the class of KALMAR elementary

(10.17) Give an intrinsic characteriration of the class of unary KAL- MAR elementary predicates.

(10.18) Check the closure of SUDAN’e classes S, under the schemes given in Exercises (10.7), (10.8), ( l O . l l ) , and (10.13).

(10.19) Show that in every class Sn+l, n 2 2, there exists for every choice of m 2 1, a function F : P P + l + IV such that for every function f:W - N in S, we can fmd a natural q such that F ( q , z , ,..., z,) = f ( z l ,..., z,,,), for all z1 ,..., 2, in N. The function F is called universal function of (m+l) argumcntcl.

(10.20) Give an intrinsic characterisation of all predicates in the n th class of ACKERMANN-PETER’s hierarchy.

ited recursion and limited minimization.

ited existential and universal quantifkations.

functions.

Page 96: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 83

Section 1.7

(10.21) Check the validity of the results obtained in Section 1.7 when replacing RITCHIE's function with SUDAN'S function or GRZEGORCZYK's function. (Recall that GRZEGORCZYK's original sequence is defined as follows: go(z,y) = y+l, gI(z,y) = z f y , g2(z,y) = (z+l)(y+l), gn+l(O,y) = gn(y+1,Y+1), gm+l(z+l,y) = gn++1(Z,gn++1(z,y)),for n 2 2.1

(10.22) Doe_s there exist a double infinite sequence of primitive recur- sive functions fn,m(z) with the property that the corresponding classes cn,m (see Defmition (7.2)) satisfy the strict inclusion cm,m 5 Cn,m+l, for all sufficiently large naturals n,m?

Section 1.8

sive: (10.23) Show that the following string-functions are primitive recur-

4 rev:X* 4 X* ,

rev (A) = X,rev (a il...aik) = ai t...ail ,

b)

fl:X*-+X* ,

c)

f2:X* + x* , f 2 ( A ) = X, f ( a . a. ... ai ) = O i l , 2 'I '2 t

z , if z = y'z with t ( ~ ' ) = t ( y ) , A , otherwise,

Page 97: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

84 Calude

fe:(X')2 4 x* , X , i f z c y r

f s ( z ty ) = a l , otherwise. i (10.24) Let X c Y, Y fmite. Show that in case f :X* + X* is primi-

tive recursive, then its X-ezteneion j :f 4 v' given by

j ( 2 ) = I"", X , otherwise, i f z E X * ,

is primitive recursive. (10.25) (WEMRAUCH [19741) For every k 2 2, consider the string-

function q k ~ ( x * ) ~ .-, x* defmed by qk(zl,,..,zk) = conk(c(zl), ..., e(zk)) , where c ( X ) = a l , e(aiz) = Succf( ...( Succf(e(z))) ...)( i times).

Show that: a) If card X = p > 1, then q k E ll(X). b ) If t(zi) 5 l(yi), 1 5 i 5 k, then t ( q k ( z , ,..., zk)) 5

c ) There exist the string-functions q b :X* -c X* (1 5 i 5 k) such

(10.28) Write an X-primitive recursion for the string-function

(10.27) Consider the inverse function of C , say D:{al}* -c X*.

i) the string-function f:X* -+ X* given by f ( z ) = D(Succf(C(z)))

ii) the string-functions i, :(a1}* -+ {al}* given by j i (z) =

(10.28) Consider the diagram

P " ( 9 k ( Y 1 , . . . 4 k N .

that qk(qk;(z],. . . ,zk)) = z,, for aU zl,.. .,tk in x*.

C:X* - {al}*, defined by formula (8.13).

Show that:

is primitive recursive,

C(Succf(D(z))) are primitive recursive, for all 1 5 i 5 p .

Show that: a) if f * is primitive recursive, then f ( z ) = D ( f * ( C ( z ) ) ) is primitive

Page 98: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 1 85

recursive;

recursive.

“same” no matter which alphabet is chosen.

b) if f is primitive recursive, then f*(z) = C ( f ( D ( z ) ) ) ie primitive

Conclude that the primitive recursive functions are essentially the

(10.29) Find the exact place of C in the hierarchy (~, , (X)) , ,>O. - (10.30) Give a string-function version of the ACKERMANN-PETER

hierarchy.

Page 99: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

This Page Intentionally Left Blank

Page 100: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

87

CHAPTER 2

2. RECURSIVE FUNCTIONS

This chapter is devoted to the study of the basic capabilities and lim- itations of all possible algorithmic computations, without distinguishing between efficient or inefficient ones.

We shall work with KLEENE’s equational language; this choice is motivated by the equational definitions of the non-primitive recursive functions involved in the preceding chapter.

A special attention will be directed to the “time-complexity” which will furnish an useful instrument to “dovetail” computations.

2.1. EXAMPLES

In this section we discuss a series of examples which motivate the introduction of the class of recursive functions.

A basic argument for the enlargement of the class of primitive recur- sive functions is the necessity to find an adequate formal model for those function8 which are “algorithmically computable” or “effectively comput- able”.

Fist, it is worth noticing the distinction between “algorithms” a d “algorithmically computable functions”. The general notion of (informal) algorithm, as a fundamental concept, cannot be defmed through other con- cepts, though explanations of the form “an algorithm is a precise pro- cedure which can be applied to a certain datum, belonging to a fwed class of symbolic inputs, and which eventually produces, for each input, a corresponding symbolic output” are sufficient to derive nontrivial facts. In what follows we shall restrict our discuseion to algorithms which mani- pulate fmite sets of natural numbers, or of strings (on some fmite and fured alphabet). We strese the permissive and the impera t ive features of algo- rithms (an algorithm has to be performed). EUCLID’r aborithm for the

Page 101: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

88 Cdudc

f ( 2 ) = .

construction of the greatest common divisor of two natural numbers, ERATOSTENE’s sieve for finding the n t h prime, or the quadrature method for fmding the n th digit in the decimal expansion of x = 3.1415 ... are well-known examples of algorithm.

An algorithmically Computable function is a mapping yielded by an algorithm. As an example, every primitive recursive function is algorithmi- cally computable.

The fust example shows that there exist functions which seem to have no algorithm of evaluation.

I

1 ,

(1.1) Example. (ROGERS 119671) Consider the predicate f :N + {O,l}, given by

for all natural numbers z.

We have f(1) = 1;

if a consecutive run of exactly z

5’4 occurs in the decimal expan- sion of x ,

otherwise,

we do not know whether f ( l l l 0 ) = 1 or f ( l l l 0 ) = 0. More general, no algorithm is known for computing f (if any). 3

Remark. Later, in Section 2.5, we shall prove the existence of functions having no evaluation algorithm, in a precise setting.

In the next example we shall exhibit a primitive recursive function for which we do not know to identify a concrete computing algorithm.

(1.2) Example. (NOVIKOV [1966l) Let x be an irrational number in (0,l) and let

x = 0.2,2 p. . 2,. .. be its decimal expansion. We shall defme a function f , : N 4 JV as fol- lows. Let

t. i1 = z. i,+1 - * * a = - 2il+jl = 0 9 2i,+il+l * 0 9

be the fvst consecutive run of 0’s in the decimal expansion of x (if any). For every i 5 i , f il, put f x ( i ) = 0.

Let

Page 102: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 89

2. sz = 2. i 2 t 1 - * * a = - zit+jz = 0 1 zi,+jg+l f 0 1

be the next consecutive run of 0’s (if any). Defme:

1, if i ,+ jl < i < i 2 , il i 2 5 i 5 i2+ jz .

Let

2il = q + 1 =...= q + j , = 0 , Zi,+j,+l # 0 ,

be the next consecutive run of 0’s (if any). Defme

2 , i f i , + j z < i < i 3 ,

o , if i , 5 i 5 i , + j 3 . The procedure continues indefinitely (in view of the irrationality of

For example, if x, the sequence t,,z2, ... cannot be ultimately aero).

x = 0.123004501200034.. . then f x ( 0 ) = f,(l) = fx(2) = f,(3) = fx (4 ) = fx(5) = 0, f x ( 6 ) = f X ( 7 )

fx(14) = f,(15) = 3, a.s.0.

all n in IV by

= 1, f x ( 8 ) = 0, fx(9) = !,(lo) = 2, r,(ll) = fX(W = f,(13) = 0,

We pass to the construction of the function F, : N + UV given for

F,(n) = 7 ?

in case f,(rn) = r , for infinitely many m. We shall prove that: a) the mapping F, is a function, b) F, is primitive recursive.

To see that F, acts as a function, we shall prove that there is an unique natural r such that f.,(rn) = r , for infmitely many rn. Two possi- bilities may occur: i) z, = 0, for infinitely many rn, or 6) z, = 0, for finitely many m. In case i), r = 0 works. All it remains to show ia the uniqueness of r . This happens since for every natural k > 0, fx(rn) = k only for those m with i , t jk < m < ik+l. In case ii), r is exactly the number of consecutive runs of 0’s.

The function F, is clearly constant, so it is primitive recursive. The Miculty here is that we cannot, for a large class of irrational numbers (including, for example r), distinguish between i) and ii), and consequently we are not able to fmd the constant r, though we are sure that it exists!

0

Page 103: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

90 Caludc

Remark. The key idea in Example (1.2) relies on the disconnection between the following two situations: a) knowing that a certain function i s algorithmically computable, b) knowing to compute it. See, for further results, Section 2.7.

(13) Example. ACKERMANN-PETER'S function A : @ - IV defmed by equations (2.3)-(2.5) in Section 1.2 is algorithmically computable. The FORTRAN program displayed in the end of Section 1.2 gave evidence to this fact.

3

Remark. S U D A N ' S function is also an example of algorithmically com- putable function. Furthermore, the last two functions are not primitive recursive, thus showing that the class of primitive recursive functions is not a satisfactory model for the algorithmically computable functions. Hence, we must look for a suitable larger class. This will be done in what follows.

The main idea is to use the same base functions as in Defmition (1.3.1), and, in addition to the operations of primitive recursion and func- tional composition, the (unlimited) minimisation. Since the last operation does not preserve the totality property, we shall work with partaul number-theoretic funceions. Recall that a partial function 4:A a B is just a function f :A' - B, where A' c A. In the particular case A' = A, we simply write d:A -+ B and we understand that 4 is totol (on A), i.e. it is everywhere defmed (on A). Furthermore, by convention, we shall write d(z) = x (4 is undefined in t) in case t € A - A'; dom (4) = {t E A (4(z) # x} and range (4) = (t#(z) 1% E dom (t$)}. Occa- sionally, for emphasis, we shall say that t$ is defmed in z in case t E dom (4). Two partial functions 4:A S, B and +:C 2 D are equal, provided dom (4) = dom (+), and 4(z) = Hz), for each z E dom (4); we write 4 = @.

We restate the operations of primitive recursion and functional com- position in the context of partial functions.

Given the partial functions 4:nV" a Hv, n 2 1, and $:IV"+* 9 , N , we construct the partial function 6 :Wfl N by primit ive reeureion from Q and $J using the equations:

6 (2 1,-*.,tn 90) = d(z 1,***,zn) 7

6 ( z l , - * - , t n , ~ + 1 ) = flr(21,...,Zn,Y,e(zlc...czn,~)) 9

where dom ( 6 ) is ale0 defmed by recursion:

Page 104: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 91

(1.4) Definition.

a) The class of partial recursive functions (shortly, p.r. functions) is the smallest class of partial functions d : W am, n 2 1, which con- tains the functions Succ, Ck), and @), and which is closed under the operations of primitive recursion, functional composition and minimiration.

b) A function f :RV -+ nV is called a recursive function provided it is a p.r. function with dom (f) = W. In other words, a totally d e h e d p.r. function is called recursive function. (The recursive functions are also called general recursive functions.)

Remarks.

a) Every primitive recursive function is recursive. The converse implication fails to hold: SUDAN’S function is recursive (see Section 2.2), but it is not primitive recursive (Corollary (1.6.34)).

b) Clearly, we can easily specify examples of p.r. functions which are not total, for example, 4:Nz a N,

The partial function 8 :PF’ 4 N, n 2 1, is obtained by functional composition from the partial functions $:W “N, m 2 1, and

~- - ~~

Page 105: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

92 Cdudc

c) Every p.r. function is algorithmically computable. The converse implication is known as CHURCH’S thesis. Clearly, CHURCH’S thesis can- not be formally proved, because it merely relates an intuitive notion (algo- rithmically computable function) and a mathematical notion (p.r. func- tion). Many arguments can be found in support of CHURCH’S thesis (see, for example, KLEENE (19523, DAVIS (19821).

d) The reader will immediately realize that all results in Section 1.4 remain true when replacing ”primitive recursive functions” by “p.r. func- tions”.

2.2. A R I T B M E T I Z A T I O N OF C O M P U T A T I O N : A N EXAMPLE

We develop a GODEL numbering in order to describe the computa- tion of SUDAN’S non-primitive recursive function by means of suitable sequences of natural numbers, and fmally to prove its recursiveness. In the next section we shall prove that the arithmetieation is an elegant and general method to characterize partial recursive functions.

We recall that SUDAN’S function S:m3 - N satisfies the equations

S(Z,Y,O) = 2 i- Y 9 (2.1)

S(z,O,n+I) = z , (2.2)

S(z ,y+ 1,n + 1) = S(S(z ,y,n + l),S(z ,y,n + 1)+ y + 1,n) . (2.3’)

The equation (2.3’) can be equivalently written as

S(z,y +l,n+ 1) = S(S(z,y,n+l),S(S(z ,y,n+ l),y+l,O),n) . (2.3)

The equations (2.1) - (2.3) can be used as rules for the evaluation of S. At each step (i.e. application of a certain rule) in the evaluation of S(z,y,n) the result is either a natural number (i.e. a partial or final result), or else a nested expression involving the symbol S and certain natural numbers. To guarantee the uniqueness of the computation evolu- tion we make the convention that at each step n o matter which rule works, it must be applied to the rightmost occurrence of the symbol S . Notice that the result of the computation does not depend on this

Page 106: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 93

convention, which can be viewed as a standard form of computation.

(2.1) Lemma. For all natural numbers z, y, and n, there exists a unique natural number z such that S(z,y,n) = z ; this natural number can be obtained by a fmite number of rightmost applications of rules (2.1) - (2.3). Proof. We proceed by induction on n. For n = 0, a single step gives S(z,y,O) = 2 + y, by (2.1). Assume now that the statement holds for n. We prove, by induction on y, that the statement also holds for (n+l). If y = 0, then a single step gives S(z,O,n+1) = z, by (2.2). If the statement applies to the tuples (z,g,n+I), then by (2.3) we have:

S(z ,y+ 1,n + 1) = S(S(z,y,n + l),S(S(z,y,n+ l),y+ l,O),n) . (2.4)

Now we use the induction hypotheses, from right to left. In view of the induction step on y, there exists an unique zI such that S(z,y,n+l)=t,, and z1 can be obtained by a fmite number of rightmost applications of rules (2.1) - (2.3). Clearly, S(z,,y+l,O) = z1 + y + 1; this result can be obtained directly from (2.1). Finally, by the induction step on n, a fmite number of applications of the rules (2.1) - (2.3) produces the unique natural number z2 = S(zl,zl+y+l,n). By (2.4), S(z,y+l,n+l) = 22.

Summarizing, S(z,y+l,n+l) can be evaluated by a fmite number of appli- cations of rules (2.1) - (2.3).

3

Page 107: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

94 Caludc

(we have underlined the rightmost occurrence of S). 3

Remark. Notice that the evaluation of S(2,2,1) is based on three “data manipulations” (do not confuse them with the rules (2.1) - (2.3)), namely: a) the substitution of a natural number for a variable in an equation, h) the replacement of a term (Le. an expression of the form S(i,j,n)) in an equation by its equivalent as specified by another equation, and c ) the computation of the sum of two natural numbers. As it is easily seen, the sum operation can be replaced by the successor in case equation (2.1) is replaced by the following two equations (involving only the successor func- tion):

S(z,O,O) = z , (2.1’)

S(z,Succ (y),O) = succ (S(Z,V,O)) . (2.1”)

Recall that the GODEL number associated to the natural number k 2 1, and to the tuple (z,, ..., tk) ia:

Page 108: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 95

where pi = pn(i) . A natural number n is the GODEL number of some tuple (z ,,..., z t ) iff ezp (O,n) 2 long(n) 2 1.

We are ready to develop the announced numbering scheme. To every expression representing a step in the computation of S we associate a tuple of natural numbers in the following way: to the symbol S we assign the number 0, and to every natural number z we associate Succ (2). This method is correct since in an expression denoting a step in the computa- tion of S the “terms” are always associated to the right. Finally we com- pute the GODEL number of the resulting tuple according to (2.5).

(2.8) Example. The computation of S(2,2,1) in Example (2.2) can be described by the following sequences of tuples:

U

We defme the partial function a:" a UV by putting a(z,y,n,m) to be the GODEL number associated to the expression representing the m t h step in the evaluation of S by rightmost applications of rules (2.1) - (2.3) (here rn = 0 denotes the initial step: S(z,y,n)). Clearly, in view of Lemma (2.1), for all natural numbers 2, y, n, there exists an unique t (i.e. the number of steps necessary to compute S(z,y,n) by rightmost applications of rules (2.1) - (2.3)) such that a ( z , g , n , t ) # q and a(z,v,n,m) = q for a l l m > C .

Page 109: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

96 Cdudc

hi(z) =

(2.4) Theorem. The partial function a can be extended to a primitive recursive function.

'the GODEL number of the tuple that follows when the rule 2.i) is

'applied to the tuple whose GODEL number is z ,

,o 1 otherwise. if R i ( Z ) = 1 ,

which gives the place of the rightmost occurrence of the symbol S in a n expression denoting a step in the computation of the function S.

The reader can easily check the following formulas:

R , ( z ) = 8g(CZp (0,z)Ll) A G(Z) A G(ezp (Ia6t(z)+3,z)L1)

R,(z) = 8g(CZp ( 0 , z ) q ) A G(z) A G(ezp ( loe t (z )+2 ,z )4 )

A sg(ezp (lasf(z)+3,z)x1) , and

R,(z) = s g ( e z p ( 0 , z ) q ) A C(z) A e g ( e z p (loef(z)+2,2)J-l)

(1 8g(CZp (fUsf(Z)f3,2)4) , where the primitive recursive predicate G :RV -c (0,l) is the characteristic function of the set of all GODEL numbers (i.e. G(z) =

8g(ezP (092)) A eg((ezP (OF)+l)*oW(z)))*

Our fvst task is to prove the primitive recursiveness of the functions Ri and hi , for every i E {1,2,3}. To this aim we introduce the primitive recursive function las t : N 4 N defrned by

Page 110: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 97

For every natural z for which sg(szp (0,z)nl) A G ( z ) # 1, we have hi(z) = 0, for each choice of i E {1,2,3}. In the opposite case:

i -1

erp (fort(r)+l,o)+rrp ( f ~ t ( r ) + z , ~ ) A 1 ‘ pn ( h 8 t (2 ))

i =lort(r)+l

i = I

erp ( lwf(r)+1,z) 6 pn (last (2 ))

and

Finally, it is easy to see that the primitive recursive function B:N4 N defined by primitive recursion

Page 111: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

98 Calude

B(z,y,n,m+l) =

is an extension of a. 0

(2.6) Corollary. SUDAN’S function is recursive.

Proof. natural numbers z, y , and n by

We consider the p.r, function t i m e : N 3 2 IV defmed for all

time(z,y,n) = j m [ e z p (O,B(z,y,n,m)) = 11 . (2.8) Furthermore, by Lemma (2.1), time is total, hence recursive. For all z, y, n in IV we have:

S(z,y,n) = e z p (l,B(z,y,n,timc(z,y,n)))~l . (2.9) 0

Remarks.

a) SUDAN’S function is not primitive recursive (Corollary (1.6.34)). Hence, by (2.9), time is not primitive recursive. The lack of a primitive recursive bound for the minimization operation in (2.8) explains the non- primitive recursiveness of time, and ip60 faeto, of S.

b) The simultaneous action of S in four places in (2.3) made neces- sary the codification of the symbol S (by zero) and the translation of the natural numbers occurrences. A suitable translation would ensure the codification of a fmite number of auxiliary symbols.

c ) The reader can easily develop a similar method for proving the recursiveness of ACKERMANN-PETER’S function. Notice that in this case each step of the computation is of the form

A(zItA(z2,...tAAzn-l,zn)...)) 9

or, equivalently,

(z1,z2,.-iZn-l,Zn 1

since the terms are 2-uples and they are associated to right. No codika- tion of the symbol A is necessary, hence no tranelation is needed in this case.

Page 112: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 99

2.8. EQUATIONAL CHARACTERIZATION OF PARTIAL RECURSIVE FUNCTIONS

We extend the arithmetisation method discussed in the preceding section to a general claas of “formal equations” defming partial functions. It is proved that the resulting class of partial functions coincides with the class of all p.r. functions. The equational formalism is equally used to describe, in an uniform way, the number of steps performed in a computa- tion which eventually halts.

Our fvst task is to extend to a general method the equational defmi- tion of ACKERMANN-PETER, SUDAN, and RITCHIE functions. Roughly speaking, we fm a fmite set of “formal equations” l, and we defme a “computation’, to be a fmite sequence of “formal equations” beginning with some “formal equation” in l, and such that each “formal equation” is obtained from the preceding ones either by substitution of a natural number for a variable throughout a “formal equation”, or by the use of a “formal equation” to replace “equals for equals” at certain occurrences in some “formal equation”. See in this respect the Remark following Example (2.2).

The formal equations are expressions made up of variables, partial function aymbols, the distinguished-name Succ (which stands for the suc- cessor function name), the symbol 0 (which stands for the natural number zero), and some punctuation marks (the point, the left and right parantheses and the equality sign “=’*).

The set of variables is {ul,uz, ... ,u,, ...}. The set of partial function symbols is {FP) ln,j=1,2,...}. The symbol FYI refers to the j t h n-variable partial function symbol; j is the indez of FYI. Since in what follows we shall actualiee only a fmite number of variables and partial function sym- bols, sometimes we shall denote by u , v , w the variables and by F, G, H the partial function symbole.

We begin with the syntactic description of formal equations.

(8.1) DeRnitton. The notion of term is inductively defmed by the follow- ing four rules:

i) ii) iii) iv)

v)

Every variable is a term. The symbol 0 is a term. If t is a term, then the formal expression Succ ( t ) is also a term. For all natural numbers n, j 2 1, for all t e r m t l , ..., t,,, the formal expression Ff”)(tl, ..., t,) is a term. Only those formal expressions that are built up by a fmite number of

Page 113: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

100 Calude

applications of rules i ) - iv) are terms. Syntactic notation. We shall use the following abbreviations:

i = sUCC (01, i = sUCC (SW lo)), ..., i = succ ( ~ u c c (...(~ucc (0)) ...)I (where Succ appears n times). The element 6 is called a numeral.

(8.2) Definition. A formal equation is a formal expression of the form

t , = t , I

where t , and t? are terms. We pass to the deduction rules. Suppose that t , , t2 and t , are terms

(not necessarily distinct). By substitution of t , for t 2 in t , we mean the formal expression that follows from the replacing of every occurrence of t , withinbt, by an occurrence of t,. We shall denote by

the substitution function.

Remarks.

a) The formal expression resulting by a substitution is a term. b ) If t 2 does not appear within t , , then the substitution of t , for t ,

c) Our notation for the substitution is compatible with the func-

in t , is simply t,.

tional notation.

(8.8) Definition. ( T h e Substitution Rule: SR) If u is a variable, 6 is a numeral. and t , , t , are terms, then from the formal equation

t , = t, I

( G / U ) t , = ( i / U ) t 2 . we can derive the formal equation

Notation. The sign "=" should not be interpreted aa the identity rela- tion, but simply as an abstract syntactic symbol. The identity of two terms t , and t , will be indicated by t l = t,.

(8.4) Definition. (The Replacement Rule: RR) Let

t , = t 2 , and t 3 = t , (3.1)

be two formal equations. Assume that there exists a formal equation

Page 114: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 101

t 6 = 7

and a variable tu not appearing in (3.1) such that

t , = ( t 3 / w ) t 5 , and t , = ( t 3 / w ) t 6 .

Then, from the formal equations (3.1) we can derive the formal equa- tion

( t4 /w) t6 = ( t 4 / t u ) t 6 *

Remark. From the formal equations

t , = t , , and t , = t 3 , we can derive, by RR, the formal equation

t , = t 3 . For, let w be a variable not appearing in the terms t , , t,, and t,. We con- sider the formal equation

t , = w , and we notice that

t , = ( t z / w ) t , , and t , = ( t2/tu)w . Hence, by RR,

( t 3 / W ) t l = ( t3 /W)W

1.e.

t , = t 3 .

(8.6) Definition. A formal equation e is derivable from a fmite set formal equations if there exists a sequence for formal equations

of

e 1,-*,em ? (3.2)

such that: a) e = em,

b) For every k E {l,,..,m}, either:

i) ii)

iii)

the formal equation I?k is in E, or the formal equation ek is obtained from some formal equation ei with i < k, by SR, or the formal equation e k is obtained from some formal equations ci and e j with i , j < k, by RR.

Page 115: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

102 Caludc

In case e is derivable from l, the sequence (3.2) is called a derivation and we write

C t - e .

(3 .8) Example. Let l be the set of the following three formal equations:

F\')(O) = 2 , (3.3)

F\')(Succ (u) ) = succ (F\')(u)) , (3.4)

F i ' ) ( u ) = F\')(Succ (F[')(u))) . (3.5)

We shall show that the formal equation

F p ( 2 ) = F p ( 5 ) , (3.6)

is derivable from f. To this aim we shall display a derivation e1,e2, ..., e O from f. We begin the derivation with a formal equation in C

e l :Fi ' ) (v) = ~ I ' ) ( ~ u c c ( ~ l ' ) ( u ) ) ) . The next formal equation is obtained from e , by SR (u is substituted by

ez:Fh1) (2) = ~ [ ' ) ( ~ u c c ( ~ [ ' ) ( 2 ) ) ) .

e3:F{1)(Succ (u)) = succ ( F { ' ) ( u ) )

e , :F[ ' ) (2) = ~ u c c (F[')(i)) .

2):

Now we take the formal equation (3.4) of f:

, and we apply SR (u is substituted by i) to obtain

From e 2 and e, we derive, by RR, the formal equation:

e s : ~ h 1 ) ( 2 ) = F { ' ) ( S ~ ~ C (suCC (Fll)(i)))) . Indeed, put

t = FA')(2) , and t' = F[')(Succ ( w ) ) , and consider the formal equation

t = t #

It is seen that

( F [ ' ) ( i ) / W ) f = Fi ' ) ( i ) , (F[ ' ) ( i ) /w) t ' = F\')(Succ ( F p ( 2 ) ) ) ,

Page 116: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 103

(SUCC ( F [ ' ) ( i ) ) / w ) t = F p @ ) , (succ ( F i 1 ) ( i ) ) / U ) t ' = ~ [ ' ) ( s u c c (succ (Fl1)(i)))) .

Furthermore, the formal equation

e,,:F{')(i') = succ ( F [ ' ) ( O ) ) , is obtained from e 3 by SR and

e,:F[l)(O) = i , is (3.3). The formal equation

e,&)(i) = 3 ,

Fl1)(i) = succ ( w ) . follows by RR, from e 6 , e7, and the formal equation

Finally, again by RR, from e 5 and e 8 we derive

eg:Fp)(?l) = ~ { ' ) ( 5 ) ,

FL')(i) = F{')(Succ (SUCC ( w ) ) ) .

by means of the formal equation

Notation. In what follows we shall drop the adjective "formal" in the expression "formal equation", and we shall replace the numeral ti by the natural number n. Clearly, no confusion follows.

We shall temporarily introduce a new class of partial functions.

(3.7) Definition. Let n be a natural number, n > 0, and let

l $ : W A N ,

be a partial function. We say that d is equationally computable if there exists a finite set of equations f, and a partial function symbol Ff") such that k is the greatest index among the indices of all partial function sym- bols occurring in the equations of f, and for every (zl, ..., 2,) in N" and for every in N we have:

e'l- Fl")(z, ,..., z,) = y w d(2' ,..., 2,) = y . In thie case we say that t defines q5 with F P ) as principal partial func- tion symbol.

Page 117: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

104 Calude

(8.8) Example. The set of equations (3.3) - (3.5) defines the function f : N --c 1N given by f ( z ) = z + 5 , for every z in RV, with Fil) aa princi- pal partial function symbol.

3

The following two technical results are intended to establish a nor- mal form of derivations.

(3.9) Lemma. If the equation

t , = t2 7

is obtained by SR from the equation I

t , = t2 9

by substituting every occurrence of the variable u (appearing in (3.7)) by the natural number n, and the equation (3.7) was derived from the equa- tions

t ; = t i , and t i = t i ,

( n / u ) t y = ( n / u ) t i , and ( n / u ) t i = ( n / u ) t q .

(3.8)

by RR, then the equation (3.6) can be equally deduced by RR from the equations:

(3.9)

Proof. From the hypothesis it follows the existence of an equation

t ; = tl; , (3.10)

and of a variable w , not appearing in the equations (3.8), such that

t ; E ( t i / W ) t ; : , tz" = ( t ; / w ) t l ; , (3.11)

and n i

t ; 3 ( t l / w ) t 5 , t , = ( t ; / w ) t ; . (3.12)

The equation

(+)t i = (n /u ) t l ; , (3.13)

follows from (3.10) by SR. We shall prove that the equation (3.6) can be obtained from (3.9) and (3.13) by RR. Since w P u, from (3.11) it follows:

(+It; = ( ( n / V ) t ; / 4 ( ( n / m 9

( n / u , t i 3 ((n/4f;/w)((n/+ll) *

From (3.9) and (3.13) we obtain, by RR, the equation:

Page 118: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 105

(8.10) Corollary. Let n be a natural number, n > 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- bol. If for certain natural numbers zl,.. .,z,, and y, we have

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, step-by-step, 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 1 1 . 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 < j, such that ef is obtained by RR from certain precedent equations, and

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

Page 119: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

106 Calude

e ,..., ei ,c j,ei ..., ej-l,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 equa- tions 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 ,e j?*** ,e i teir+l,...,ej-l,Cj+lc...,e~ * (3.17)

Clearly, the initial derivations I I

e l ,..., e . * l e . 1 and e l , ..., ei ,,..., ei ,..., eil,ei,,ej , (3.18)

will eventually satisfy the required restriction.

by equivalent appropriate derivations satisfying the required restriction. Finally, step-by-step, we can replace the derivations (3.16) or (3.17)

3

(8.11) Definition. A derivation is said to 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) Lemma. Let n, m > 0 be two natural numbers and let ql,.. . ,qm :W 3 N, B :W 3 IN be equationally computable partial func- tions. Then, the partial function 4:" 4 N obtained by functional com- position from e , q ll...lq,,, is also equationally computable.

Proof. Denote by Sl, . . . ,;,, X , respectively, the sets of equations defm- 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, sup- pose that the principal partial function symbols defming the partial func- tions q l ,..., qm, and B , are, respectively, E'):) ,..., F{:), and Pim). Fix i > max (il, ..., amlj). Clearly, Fj") does not appear in the equations con- tained in g1, . . . ,$,,,, and A'.

We defme the set of equations T t o be the union of the singleton

Page 120: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 107

(3.19)

with

51 U...U $m U 1 9

and we prove that 3defmes Q with I$") 88 principal partial fucntion sym- bol. More precisely, we shall prove the equivalence

(3.20) Q(Z1, ..., z,,) = y w 3 k Jp(z1, ..., 2,) = y , for all naturd numbem z1, ..., z,,, and I/.

For the direct implication, assume that Q(zl, ..., 2.) - y, for certain zl, ..., z,,, y in N. From the defmition of Q it follows that the existence of the natural numbers zl, ..., zm satisfying the equalities

~,(z1,...,za) zr, r=l,***,m t

and

Q(21, ..., z,) = d(t.l,... ,zm)

5, F fl:)(Zl,***rZa) =Z zr

*

By hypothesis, for every 1 5 r 5 m,

,

and

M Fjm)(zl, ..., zm) = y . We use the defmition of 3to write the following three relations:

3~ ~):)(z~ ,..., 2,) = z,, for 1 5 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

Page 121: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

108 Colude

F!")(Zl, ..., 2,) = y , (3.22)

was derived from 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 n-fold the SR to the equation in the set (3.19), i.e. to obtain the equation

(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 m-fold the RR within the equation (3.23), by means of the equations:

(3.24)

Fi(")( z ,..., t, ) = Fj" )( F!:) ( z I ,..., 2, ),. .. ,F!:) ( z 1 ,..., L, )) .

F!:)(z, ,..., z,) = 2, , 1 5 r 5 m , for appropriate natural numbers zI,...,z,.

equation of the form Pursuing our analysis we note that these replacements will yield an

F y ( 2 , ,..., C , ) = F,(")(z, ,..., tm) , (3.25)

and the unique way to continue the derivation is to make a replacement from an equation of the form

F p ( Z , , . . . , Z , ) = y .

Concluding, from (3.21) we deduce the existence of the natural

(3.28)

numbers t , , ..., Z, such that

?t-- F!:)(Z~ ,..., zn) = z, , 1 5 r 5 m , 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 5 r 5 m , and

.v t Fj")(z, ,..., zm) = y . Hence

Page 122: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 109

and

Finally,

(3.14) Lemma. Let n > 0 be a natural number and let q :W AN, 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 equa- tions 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)(u 1 ,..., 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

d(zl""JzA,O) = Y J (3.30)

for some zl, ... ,zn, and y in PJ. Since

4(z1,"',z?I J o ) = q(z1J'**,2n) ?

we deduce that

M F?)(z1, ... ,z,) = y .

3 k Fp(Z1, ..., zn) = y

Furthermore, in view of the relation A' C 7, we have .

An n-fold application of SR in the equation

(3.31)

Page 123: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

110 Calude

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

?k F P + 1 ) ( Z 1 ,..., z,,O) = y . (3.33)

We pass to the converse implication, i.e. we assume that (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 left-hand 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:

-?k F!")(zl, ..., z,) = y , 4 F ? ) ( z ~ , ..., 2,) = y ,

9(z1,- . ,zn) = Y 9

employing the general hypothesis and the fact that F P ) does not occur in any equation of N. Finally,

~(zt,**.,znP) = 9 ( 2 1 , * . . , t n ) = Y

We pass to the induction step. Assume that (3.29) holds for all t l ,..., z", z,+*, and y in N. We shall prove the equivalence

P(21,--*,zn,SUCC (%,+I)) = Y

.?+ Fl"+l) (Zl ,..., z,,succ (2,+1)) = y a

If

then

Page 124: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 111

4 (21r".,Zn,Zn+l,d(21,".,zn,Zn+1)) = Y

Consequently, we can fmd a natural number z satisfying the following two conditions:

4(21,".,Z,,2,+1) = z 9 (3.35)

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 9

?l- Fj"+2)(Z1 ,..., 2,,2,+l,Z) = y . (3.38)

An n-fold application of SR in the equation

F P + ' ) ( U l ,..., u,,succ (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))' F,("+2)(2 1,:..,2, ,z,+1, (3.39)

Ft+1)(21,...,2,,2n+1)) . Finally, from (3.37), (3.38), and (3.39), by two-fold applications of

RR, we get

7 Fl"+')(Z 1 ,..., 2, ,succ (Zn+l)) = Fj"+2)(2 1 ,..., 2, ,z, +l,z) , and

?I- F t + ' ) ( Z 1 ,..., z,, succ (2,+1)) = y . (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 ,

Ft+1)( u 1 ,..., u, ,Succ (Un+J) = F,(" +2)(u ,..., u, ,u, +1,

+')(u l,--vun ,un+1))

we deduce the necessity of an (n+l)-fold application of SR within the equation

A similar argument (baaed on the construction of T and the induction hypothesis) ensures the existence of a natural number a such that

Page 125: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

112 Calude

and

3

Remark. From Lemmas (3.13) and (3.14) it easily follows that all primi- tive recursive functions are equationally computable.

(8.15) Lemma. Let n > 0 be a natural number and let g:W" -+ PJ be an equationally computable (total) function. Then, the partial function 6 : P 3 N obtained by minimieation from g is also equationally comput- able.

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 fol- lows:

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 com- putable. Furthermore, for all natural numbers zl,...,z,, y we have:

0 , if g(zlr... ,z,, ,z)=O, for some z < y , (. ll***,tn $ 8 ) = 1 , i

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 ?by taking the union of U and the set

Page 126: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 113

{F,(")( u 1 ,...,?in ) = FA3)(Fi(" + I ) ( u 1 ,... , u, ,u ), (3.41)

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,,

x t Fi("+1)(Zl ,..., z,,y) = 1 , (3.42)

Succ (y)) = 0. Consequently,

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

,7t F,(")(Zl ,..., 2,) = Fp(Fi("+')(zl, ..., z,,y), (3.44)

Fj"fl)(z1 ,..., z,, succ (y)),y) . 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 , 4 = u ,

TI- Fi3)(1,0,Y) = Y 9

we obtain, by SR, the relation

which gives (from (3.45), by RR): TI- Fp(z1, .+) = 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:

TI- Fi("fl)(Z1 ,..., t,,y) = 1

T I - Fj"+1)(Zl ,..., z,, succ (g)) = 0

, ,

Page 127: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

114 Caludc

N F,lnfl)(zl, ..., zn,y) = 1 , )I + F,l"+')(ZI ,..., z,, Succ (y)) = 0 .

Consequently, h ( z , ,..., z,,y) = 1, and h ( z , ,..., z,, Succ (y)) = 0 , which prove that d(z,, ..., 2,) = y.

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 con- stant function C 2 ) : W -+ UV is defmed by the equation

F ~ ) ( u ,,..., u,,) = m , the projection function @"):W -+ RV is defined by the equation

Fp(U,,...,u,) = ui ,

and the successor function Succ : N 4 IV is simply defined by the equa- tion

F[')(u ,) = SUCC (U ,) .

The closure under functional composition, primitive recursion and

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 equa- tions and derivations can be handled by suitable primitive recursive func- tions. 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

minimiration follows from Lemmas (3.13), (3.14), and (3.15).

< u i > = 2 i - 1 .

B) Arithmetizotion of further terms. We start with

< 0 > = 2 , and we assign inductively

Page 128: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 115

< SUCC ( t ) > = 2.3‘’’ , for every term t , and

< Fp)(tl ,..., t , ) > = pn(o)’+’*pn(l) <t,> ...p n(n) <t, > 1

for all natural numbers i , n 2 1, and all terms tl , ..., t,. Remark. The arithmetisation of numerals begins with:

< 0 > 2 , < i > = 2.3<0> = 2-32 ,

< > = 2.3<i> = 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 = t2 is

< t , = t , > = J ( < t , > , < t , > ) . 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,> <em >

* pn(l)<el’...pn(m) < e,,el ,..., em > = pn(0)

Remarks.

a) In our arithmetisation the equation e and the singleton { e } have

b) The arithmetieation acts injectively on the set of t e r m (reapec- tively, 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”.

distinct GODEL numbers.

(8.17) Example. A simple computation shows that

< F P ) ( U 1 ) = Fp)(Fp)(ul)) >

Page 129: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

116 Caludc

= J( <Ft)(ul)> , < F \ ' ) ( F [ ' ) ( u ~ ) ) > ) = J(2'.3,2 * 3 ) . 2 21.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 - fi given by

gn(m) = K. m ;> , and

(n , m + l , otherwise.

if m = < ti > , for some natural number n, ual(m) = 1

(8.18) Lemma. The functions gn and val are primitive recursive.

Proof. It is easily seen that

P ( 0 ) = 2 7

gn(rnt1) = 2 * 3"(m) ,

so, gn is primitive recursive.

injectivity of gn. Moreover, The correctness of the above definition of val is a consequence of the

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 , if z is the GODEL number of some variable,

1 , if z is the GODEL number of some numeral, = 0 , otherwise,

1 , if t is the GODEL number of some term,

I

Page 130: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 117

1 , if z is the GODEL number of some formal equation,

GN(z) =

1 , if z is the GODEL number of some fmite set of formal equations,

0 , otherwise.

(8.19) Lemma. The predicates Vur, Nun, Tern, Eq, and GN are primi- tive recursive.

Proof. It is seen that

Var(z) = eq(2[z/2]+l,z) , and

a

Num(z) = Ceq(gn(z) ,z ) 9

z =O

for every z in Hv (for the last formula we have used the obvious inequality:

An analysis of the inductive definition of the terms gives the g n ( 4 > 2).

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

iv) z = pn(0)’ * p ‘...p n(n)l”, for some natural

numbers i > 1, and zl, ..., 2, < z , for which

Term(zj) = 1, for every 1 5 j 5 n . Consequently, the following course-of-values 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))

Page 131: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

118

Sub(i,j) = '

Rep(i,j,k) = '

Cdudc

I

1 , if i and j are, respectively, the GODEL numbers of some equations e l and e2,

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 e3 ,

and e 3 is obtained from e l , and e 2 by RR, 0 , otherwise.

\

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: /on a)

k 4 GN (2) = fi & ( e w ( k , z ) ) .

;I

We continue with other four functions, namely: term8ub:JV3 - N1 Sub :A@ - {0,1}, and Rep :N3 .-c {OJ}, given, respectively, for all natural numbers i , j , and k as follows:

1 < ( t / d ) t ' * > , if there exist three terms t , i , and I

t" such that < t > = i ,< t '> = j ,

and < t" > = k,

(8.20) Lemma. recursive.

The functions termsub, Sub, and Rep are primitive

Proof. An examination of the defuition of SR shows that for all i , j ,k in JV we have:

Page 132: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 119

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: ' i

Sub(i,j) = Eq(i).Eq(j)*(C 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: Rep( i , j , k ) = 1 w (there exist three equations e l , c2, and c3 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 left- hand side of c2,

ii) c3 is obtained by replacing every occurrence of w in e by the right-hand 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 * W A )

Page 133: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

120 Calude

. ~~ )Eg( .1 . ) . eq (K( i ) , t crrnaub ( K ( j ) , < w > , K ( z ) ) ) .=O

eq(L(i),termsub(K(j),< w > ,L(z)))

eq ( K ( k ),ternsub ( L (i), < w > N z ) ) )

- ee(L(k),tcrmsub(L(j),<w >C(z)))) , where H : N 3 - N is the primitive recursive function given by the for- mula

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 func- tions 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 left-hand 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. There exists a primitive recursive function gr8ymb:N 4 N such that for every GODEL number i of a fmite set of equations 5, greymb(i) is the greatest index of a partial function symbol appearing in E.

Proof. By means of a course-of-values recursion we defme the primitive recursive function g:N - N ,

g ( i + l ) =

Page 134: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 121

DSj(z) =

(8.22) Theorem. Every equationally computable partial function is par- tial recursive.

1 , if z is the GODEL number of an equation of k‘

Derj(z lr...,z,,z) =

It is seen that for every natural number z ,

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,

for some rn in N, is derivable (in l), 0 , otherwise.

(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 non-aero 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:

Proof. Let n > 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).

We shall defme two auxiliary predicates which turn out to be primi- tive recursive D S j : N + { O , l } ? Derj:RV+' --c { O J } ?

Page 135: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

122 Caludc

.eq(Zong(K(ezp(long(z),z))),n)

j n e q ( e z P ( ' ,K(CZP (hdz) ,z) ) ) ,gn ( z r 111

.eq(czp(O~(ezp(fong(z),z),grsymb(j)+l).gt(grsyrnb(j),O)

n

r = i

-Nurn(L (ezp(long(z),z))) .

Hence Derj is primitive recursive. (Notice that Dcrj depends upon

In view of the equivalences: n *)

ti+,, ..., 2,) = m * f I- F/")(zl ,..., z,) = m

H Derj(zl, ..., z, ,z) = 1 , for some

natural number z , we can defme the p.r. function

R , : W a m 1

by the formula

Rj(zl ,... J,) = Fz[Derj(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 WI -W:p LbBV ,

def ied by (3.50) 4

cJ jn)(z1, ...,=,,I = ual(L(czp(Iong(R j(zl,...,z, 11, R j(z 1,***+n 1))) .

for all zl,. ..,z, in Bv. Since it is obvious that I$ = W)"), it follows that I$ is a p.r. function.

0

Page 136: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 123

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 func- tions. Consequently, the temporary name “equationally computable par- tial function” will be replaced, in what follows, by p.r. function.

We are now ready to defme a deep notion in the study of computa- bility and complexity. For every natural number j, we defme the p.r. function

w y : N 4 N , by

(“”(z) , if GN(j) = 1 , otherwise, w1(1)(z) =

00 ,

for every z in N. For every n > 1, we define the p.r. function

w p : w 3 N ,

w P)(z1, ..., 2,) = w j”(J’”)(zl, ..., z.)) ,

(3.51)

(3.52)

for all zl, ..., 2, in IV. The sequence ( W Y ) ) ~ ~ 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 fol- lows that ( W P ) ) ~ ~ is an enumeration of all p.r. functions of n variables. The following two theorems establish the basic properties of this enumera- tion.

(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), Dcr( j , z , z ) = Der 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 fl:w a N given by (3.49) (with n = 1):

Page 137: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

124 Cdude

n(j,z) = pz[l)cr(j,z,a) = 11 , (3.54)

for all j and 2 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 = wZi,,

L(hiJt) = U(K(t),.L(t))), for nome natural number uniw. This proves (3.53), for I) = 1.

Finally we shall show that the above natural number uniu abo works in the caw n > 1. Indeed, for all natural numbers j,zl, ..., z, we have:

Wj")(Z1,".,Z,) = wj"(J'")(z1, ..., 2,))

= wEi,(j,J(")(zl ,..., z,)) = w ~ J J ( j,dn)(z ,..., 2,)))

= w ci,(J'"")( j,zl ,..., zn)) = ukL1)(j,zl ,..., 2,) .

(We hare 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 Lemma (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.

(8.24) Lemma. There exists a primitive recursive function tranr:H -., N having the following property. For all fmite sets of equa- tions E and 7 there exists a fmite set of equations 7' having the following three properties:

3' and E have no common partial function symbob, (3.56)

7' computes the same partid function as 7 , (3.57)

< 7 ' > = t r a n r ( < E > , < 7 > ) . (3.68)

Page 138: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 125

Proof. Using the arithmetisation of terms and of fmite sets of equations we can write the following course-of-values recursion for the auxiliary primitive recursive function t :W --* RV~

t(i,O) = 0 ,

t ( i l j + l ) =

j + 1 if Terin(j+-1) = 0 or Var( j+ l )+Num( j+ l ) = 1

yzp(Oj+l )+i

0

We shall describe the term translation of partial function symbols in the following example.

The new term ie consequently

Fi(yl(Fi(yl(ol succ (0) ) ) .

Page 139: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

126 Caludc

((1.26) Theorem. There exists a primitive recursive function comp:N2 .-c N such that

~ E s p ( i , j ) ( z ) = 4 1) ( w , (1) (4) 9 (3.59)

for all natural numbers i , j, and z.

Proof. Consider the fmite sets of equations ti and t j , < ti > = t ,

< Ej > = j, which, respectively, defme the p.r. functions w 1') and w 1'1) (with Fvr*nb(i (1) and Fr,mb(jl, (1) respectively, as principal partial function symbols).

Put t = ti u EtrMr(i,j) u {F*+:rm,(i,jl(ud 1 1)

= ~ ~ ! m * ( i ) t ~ ~ ! ~ * ( * r M , ~ i , j ~ ~ t u ~ ) ) } *

In view of Lemma (3.13) it follows that t defmes the p.r. function If we denote by r ( i , j ) the GODEL number of the unique

( i 9 3 -1 = j(2i+:r-(i.j)+l.3

s!') o wil). equation in E which contains the symbol F!ytrm,(i,j), i.e.

7 7

2vrF"b(i)+1 .3frd(Cr.nr(idl)f1.

then

e o m p ( i , j ) = GN(i) .GN(j) . i (3.60)

k=O

* pn (Iong(i )+Iong(trans ( i , j ) )+2)+pJ) .

Since GN(0) = 0, and w i ' ) ( z ) = 30, for every natural number 2, it follows that (3.60) represents an appropriate general formula; moreover, it is seen that from (3.60) we derive the primitive recursiveness of comp.

0

We return to the p.r. functions ily):JtV A N defmed for all j and z in N by flP)(z) = f2(j,z) = p z ( D e r ( j , z , t ) = 11, (see (3.54)), and we establish two important properties.

((1.27) Theorem.

1) For every natural number j,

dom(w1')) = dom(fl,(')) . 2) The predicate M : N 3 + (0,l) defmed by

(3.61)

Page 140: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 127

1 , if rzj')(z) 5 y , (3.62) M(j,z9y) = i 0 , otherwise,

for all natural numbers j, z, and y, is primitive recursive.

Proof.

in IN. Consequently, (3.61) follows directly from (3.54) and (3.55). 1) For every j E PI, if GN(j) = 0 , then Der( j,z,z) = 0, for all z, z

2) It is seen that

M(j,z,y) = v ( $ D e r ( j , z l k ) ) k =O

for all j , z, and y in PI. The primitive recursiveness of M can be deduced from the primitive recursiveness of Det (see the proof of Theorem (3.22), for the case n = 1).

0

Remark. Notice that long(fl(')(z)) gives the length of the shortest

provided such an y exists. Assuming that the application of the rules SR or RR, or the identification of an equation in a fmite set take the same amount of t ime, we can interpret the value ny)(z) aa the shortest time necessary to compute the value w j ' ) ( z ) in the equational formalism. In view of '(3.61), if wjl)(z) = oc (i.e. the computation never halts), then

In the sequel we shall call the p.r. function fly), the t ime-eomplezity

derivation of the value y = w j d (2) from the j t h fmite set of equations,

ny)(Z) = m.

associated to the p.r. function w y), in the equational formalism.

(8.28) Theorem. (KLEENE's Normal-Form) There exist a (primitive) recursive function

p : n v - t N , and a (primitive) recursive predicate

T : N 3 -+ {0,1} , such that for all j and z in N, we have:

+)(Z) = P(cCY[%Z,Y) = 11) - (The predicate T is known as KLEENE's predicate.)

(3.63)

Page 141: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

128 Caludc

Proof. Defme the predicate A u z : N ‘ -+ {0,1} by the formula

1 , if slj’I(2) 5 w ,

Auz( j ,z,y,w) = and w i l ) ( t ) = y , 1 0 , otherwise,

for all j, t , y, and w in N. In view of Theorem (3.27) it follows that Aux is recursive:

( s l j l ) ( t ) 5 w * nl ‘ ) (z) < XCJ W I ( l ) ( Z ) # Go) .

Next we use the primitive recursive functions p : N -+ N, q:N - N given by

P ( Z ) = ezp(l,z+l) , q(z ) = ezp(O,z+l) 7

for every t in N , to defme the predicate T:

T(j , z ,v ) = Auz(j,z,p(y),q(y))

for all j , E, and y in N .

and T. The formula (3.63) follows immediately from the defmitions of p , q ,

c1

Remarks.

a) The question whether the recursive function p can be elimimated from (3.63), in order to obtain a stronger form of Theorem (3.28), will be answered in the negative in Section 2.6.

b) In view of (3.52) we have:

~l (n) (z i , -+n) = p(ccy[T(j,J(”)(z,,...,2,),y) = 11) 9

for all n, j, z , ,..., xn in RV.

Methodological Remark. The proof of Theorem (3.28) involves a method of defming a recursive function by means of another p.r. function (not necessarily total!) and its time-complexity, using extensively the pro. perties (3.81) and (3.62). This method of “dovetailing” the computations of some p.r. function will be extensively used in what follows.

Page 142: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 129

2.4. GODEL NUMBERING9

Exploiting the properties established for the enumeration (w we give another characterisation for the class of p.r. functions. On thls bash we are able to prove some general results concerning the global capa- bilities of the algorithmic computation.

We begin by considering a class 7of partial functions

f("):hm 4 N , n = 1,2 ,..., i = 0,1,2 ,.... As usual, f )") is the i t h partial function of n variables.

Assume that the family (fy)) has the following five properties (known under the name of WAGNER-STRONG axioms):

The class Tcontains the base functions, i.e. the (4.1)

constant functions, the projection functions, and

the successor function.

The class ?is closed under functional composition.

The class Tcontains the selection function,

u , i f z = y ,

( 4 4

(4.3)

select :oV4 - RV , given by

seIect(z,y,u,w) = i w , otherwise.

For every natural number n 2 1, there exists a

natural number uniu, 2 1 (depending upon n )

such that

f k ~ ~ ) ( ~ , z 1 , * * * , z n ) = fk) (z l , . .+n) , (4.4)

for all m, z1 ,..., z, in N.

functions of n variables (in 3). We refer to fk;;) as the universal partial function for the partial

For all natural numbers n, n 2 1, there exists in 7 (4.5)

a (total) function

a::BVm+'+N ,

Page 143: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

130 Caludc

satisfying the relation

for all i, z1 ,..., z,, y l ,..., yn in RV

The function s," is known as the 8-m-n function.

Methodological Remark . To prove that a certain partial function of n variables $J is in ?means to show that rC, = fin), for some v in RV.

Our fvst aim is to prove the following:

(4.1) Theorem. (WAGNER [1969!, STRONG [1968]) The class of all p.r. functions is the smallest class of partial functions satisfying properties

The proof of Theorem (4.1) will be divided into two steps. Firstly, we shall prove that the class of p.r. functions enumerated by means of equations, i.e. (up)), satisfies properties (4.1) - (4.5). Secondly, we shall prove that every class ? of partial functions satisfying properties (4.1) - (4.5) contains all the p.r. functions.

We begin with a fundamental result known as the s-m-n Theorem. Our proof is due to MACHTEY and YOUNG [1978] and is based upon Theorem (3.26).

(4.1) - (4.5).

(4.2) Theorem. (KLEENE [1936]) For all natural numbers rn, n 2 1, there exists a primitive recursive function s,":fN""' + RV, such that

for all natural numbers i, z ,..., x,,yt ,..., gn.

Proof. We construct two auxiliary primitive recursive functions P:RV - RV, Q :RV -+ N , defined by

P(z) = J(O,z ) , Q(z) = J(K(z )+ l ,L ( z ) ) . In view of Theorems (3.18), (3.22) and formula (3.51), it follows that

We construct now the primitive recursive function R:RV --* N , P = w!) and Q = wil ) , for some natural numbers p and q .

defined by primitive recursion as follows:

R(0) = P 7

R(z+ l ) = comp(qJqz)) 9

where comp is the primitive recursive function given by (3.59).

Page 144: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 131

By induction on z we prove the equality

Wk[* ) (Y) = J(z9sr) Y ( 4 4

for all z and y in ZN. Indeed, w k&y) = w F)(y) = Pfy) = J(0,y). In case (4.8) holds for some z 2 0, we have:

w &+l)b) = L4.J eomp(q,R(s))(Y) (1)

= L4.J y ( w &)(d) = Q ( J ( z , v ) )

= J(z+l,y) . We fm the natural numbers rn, n 2 1. We construct the primitive

recursive function Con?:N2 -+ Hv, given by

Con,m(z,y) = J’”+”’(Ip’(z) ,...( p ( Z ) , I p ) ( y ) ,..., I?)(y)) . Let k E IV be such that w i 2 ) = Con;, and defme the primitive

For all i , 2, y in IV we have (by (4.8) and (3.52)):

recursive function t :N2 --. N, by t ( i , z ) = comp(i,eomp(k,R(z))).

OJ l [ L ) ( Y 1 = w I1)(w P ( W k[*)(d)) (4.7)

= w !%J 1”(J(. ,Y 1)) = w p ( w p)(z ,y ))

= wp(con,m(z,y)) . We fmally define the primitive recursive function 8: as follows:

8nm(i,Z1 ,..., Zm) = t(i,Jf”)(q ,..., 2,)) . In view of (4.7) we have:

= wp( Con?( J(m )( z 1 ,.”, Z m ) , J q y 1 ,..., y, )))

= w c(l)(J(”+”)(Z1 I... ,2,,y1 ,... , y,))

= w 1” +qz 1 ,..., 2, ,y* ,..., y, ) . 0

Page 145: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

132 Cdude

Comment. In view of Theorems (3.23) and (4.2) it follows that the class of p.r. functions satisfies the properties (4.1) - (4.5). Moreover, notice that the function select is primitive recursive and so is the 8-m-n function; a h , our natural number uniu works for every n 2 1, i.e. it does not depend upon n.

We pass to the converse analysis. Assume Fis a class of partial func- tions satisfying the properties (4.1) - (4.5). The fvst result, known as the Recut8ion meorem or the Fized-Point meorem, is one of the main methods for proving, in a very economical way, the recursiveness of vari- ous functions.

(4.S) Theorem. (KLEENE i19381) For every (total) function g:N + N in T, and for every natural n 2 1, there exists a natural t (depending upon g and n) such that

f P = f$\ - (The natural t is cailed a fized-point of 9.)

Proof. We begin by constructing a partial function w :W+' a N, by the formula

LJ (Y ,21 ,* . .r~n) = f ~ f r ' ( f ~~.,(Y,ar),zl,...,Zn) 9

for all y, z1 ,..., zn in N. We deduce that w is in some w in N. We can use now the 8-m-n property (4.5) and write

i.e. w = fkf'), for

LJ(Y,Z, ,'.. 7%) = fk+1)(Y,21,...,G)

- - f,;(",#)(zl,...,Zn) (a)

The function p:N - N defmed by p(z) = a?(CL')(z),

The composition g o p is a (total) function of X Consequently dl)(z)) = s; (w,z ) is in 3(remember that w is fwed!).

g o p = f i l l , for some u in N. Finally put

t = p ( u ) .

Page 146: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 133

We have used the defmitions of t and w , and the totality of f;').

We give two simple applications of Theorem (4.3).

The fvst example is dealing with the following vague question: Does there exist a computing machine with the ability to reproduce itself? Many precise formulations of this problem are present in the literature (see VON NEUMA" (19631).

(4.4) Example. There exists a natural number t such that

ft(')(z) = t 7 (4.8)

for every z E N .

such that We begin by proving the existence of a (total) function k:N + N,

C!')(Y) = f&)(ar) 7 (4.9)

for all z, y in N. To prove the relation (4.9) we consider the function g:M -+ Nl

defmed by g(z,y) = Ci')(y) = z. Clearly, g is in ?since it can be written

By the s-m-n property (4.5) we get the (total) function 5 : in 3such g(z,y) = p12)(z,v).

that

for some w EN.

Defming k ( z ) = s:(C:)(z),z) = s:(w,z), we obtain a (total) function in 3 which generates, by Theorem (4.3), a fmed-point t . Clearly, (4.8) holds for this t .

0

(4.6) Example. There exists a natural number m such that

f i ) (z) = f!')(m) ; (4.10)

for every z in N .

By an 8-m-n construction we get a (total) function g:N -+ N in F

Page 147: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

134 Colude

0

A natural question involving the Recursion Theorem can be stated as follows: Is there any effective way to obtain the fixed-point from an index of the considered function? The answer is positive. To obtain this result we generahe Theorem (3.26) to a family ?satisfying the properties (4.1) - (4.5).

(4.6) Theorem. There exists a (total) function in F comp:N2 -c UV ,

such that

fL%p(i , j ) (z) = f!')(fjl)(z)) 7

for all i and j in I?.

(4.11)

Proof. The partial function 6 :Pi3 Hv, given by

e(z,?/,z) = f Y ( f y ( 4 ) = f ~ ~ ~ u ~ ( z , f i ~ ~ u ~ ( v , z ) ) 9

isin?: Let w be an index for 6 , i.e. fL3) = 6 . In view of the s-m-n property

(4.5) we get a (total) function 8 ; in J sa tb fyhg the relations

('1 (.) = fi3)(z,v,~) = e(z,y,z) . f * ; ( w , % v )

compjz ,ar ) = 8 I"(d2)(z ,Y)P?)(~ ,r),pi2)(z ,v)) . The desired (total) function comp can now be defmed by

0

We are now able to prove

Page 148: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 135

(4.7) Theorem. (Uniform Recursion Theorem) For every natural n 2 1 there exists a (total) function Tn = IV -+ UV in Tsuch that for every z , if fjl) is total, then

(z l ,#*.,zn = fj~4,,~), (2 1,*.*,zn 9 (4.12)

for all zl,...,zn in N .

Proof. Put g = and consider the proof of Theorem (4.3). In view of Theorem (4.6) the index of the composition g o p can be uniformly obtained from 2:

u = conp(z,i) , where i is an index of p (which turns out to be independent of 9 ) .

Then

G ( Z ) = P ( c ~ ~ P ( z , ~ ) ) 9

is the desired function in j?

c3

Comment. Theorem (4.3) can be strengthened by replacing the unary function g by a k-ary function.

(4.8) Proposition. If n 2 1, and the partial functions g:W & N , h :Wfa -% IN are in 7; then the partial function f :Wf' 3 l l V obtained by primitive recursion from g and h is also in E

Using the definition of the function select, we can derive the for- mula:

Proof. Using a standard 8-m-n construction we get a (total) function b :RV + IV in 7; satisfying the equalities:

f$~tsJ3)(z1,..*r~n9~ , z ,w) = f k ~ ~ ~ a ( ~ , z l , * * * , ~ n , Y , z + ~ ,

h,...,%,W)) = f p + 3 ) ( ~ ,..., Z, ,I ,z+ 1,

h(zl,---,zn,z,w)) *

Consider an index i for the projection function Pp+%3), and construct a (total) function a : N -+ IV in Tsuch that:

Page 149: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

136 Caludt

w , if z = y ,

y,z+l ,h(z , ,... 1Z,2,UI)) , if t f y .

f ~ + 3 ) ( ~ 1 , . . . , z n , (4.13)

(4.9) Proposition. If n 2 1, and g : W + ’ - N is a (total) function in 7, then the partial function f :W 4 N obtained by miniisation from g is also in Z

Proof. The partial function P : l W 2 a 12v . defied by P(u ,zl,...,zn ,u)

By an 8-m-n construction we get a (total) function a : N --c RY in 3such that

= s e I e e t ( P ( z l , ..., zn,~),O,O,Succ (fmio,,l(u,zl (n +2) ,..., z,,u+1))) is clearly in T.

Page 150: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 137

and

f(Z1, ..., 2,) = 0 w g(z*, ..., 2,,0) = 0,

w ft("+')(Z1 ,..., Z,,O) = 0,

f (2 1,*-,Zn = fr(n+')(z 1,**.,2n 90)

we deduce that

9

for all zl,. ..,z, in N. Hence is in X

Remark. Notice the power of the Recursion Theorem which guarantees a defmition in. which the function value a t point (zl, ..., z,,y) depends upon its value at point (zl, ..., z,,y+1). See in this respect the defiiition of the partial function ft(n+l).

Comment. Propositions (4.8) and (4.9) w u r e that every clam Tof par- tial functions satisfying properties (4.1) - (4.5) contains all p.r. functions. In thin nay we have fiiished the enumeration of partial results that con- clude Theorem (4.1).

Page 151: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

138 Calude

Terminological Comment. In what follows we shall work with an arbi- trary enumeration of all par. functions

fpp:%P &IN,

satisfying the WAGNER-STRONG axioms. Such an enumeration is called an (acceptable) gzdelization of all p.r. functions (see ROGERS [1958], 19673) or an acceptable programming system (see MACHTEY and

YOUNG :1978l As an example we have constructed the acceptable

tions (see Section 2.3).

no confusion.

gadelieation ( w , L.1 ) given by the arithmetiration of all finite sets of equa-

The upper index of bin) will be omitted in the sequel if that entails

The remainder of this section will be devoted to the proof of a deep resuit which asserts that, in a strong sense, every two acceptable gadelieations are effectively equivalent. We begin with some technical lem- mas.

(4.10) Lemma. Let (&I) be an acceptable gGdelisation, and 8 = si be an s-m-n recursive function. Then, for every recursive function h:N --c N there exists a natural number t (depending upon h ) such that

d h ( z ) ( y ) = @ # ( t , * ) b ) 9 (4.16)

for all x and y in IN. Furthermore, the unary recursive function S : N - N , given by S(z) = s( t ,z ) , for every z in N , is injective.

Proof. We consider the p.r. function 6 :N3 * N given by the following formula:

j 2 1 io k=O if S9(C eq(+%+,j)))= 1 7

Recall that gr and eg are the primitive recursive functions defmed by

1 , i f2 > y ,

Page 152: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 139

1 , i f z = y ,

By a standard s-m-n construction we get a recursive function f :RV + RV such that

@f(s)(j,v) = e(z,ibi) , for all z , j, and y in UV. Now, we use the Recursion Theorem to obtain a fued-point, i.e. a natural t such that dj2) = d#).

We prove now the injectivity of S(z) = s(t ,z) . For the sake of a contradiction, assume that S is not injective. Let r < j be the smallest natural numbers such that S ( r ) = S(j).

For every y in N, we have (by (4.17)):

since s ( t , r ) = s ( t , j ) and r < j. In case y > j we have:

ds(r)(y) = d,( t ,r ) (Y)

= dt(r,v)

(4.18)

(4.19)

= df(t)(r,Y)

= B ( t , r , y ) = 1 , since r and j are the smallest distinct natural numbers with S ( r ) = S(j).

Clearly (4.18) and (4.19) are contradictory. Finally, notice that by the injectivity of S, the first two conditions

(for z = t ) fail in (4.17). Consequently,

d , ( t , z ) b ) = d t ( z , g ) = dh(o)(Y) 7

for all x and y in N.

(4.11) Lemma. For every two acceptable gadelisations (&'I) and (&'I) we can effectively fmd an injective recursive function f : N 4 IN such that

Page 153: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

140 Cnludc

42) = *YjS) 9

for every z in N.

Proof. Let s = 8,‘ be the s-m-n function associated to ($PI) and let k be such that rLi2) = dgii,,. Defiie the recursive function h :JV - N, by h ( 2 ) = s ( k , z ) .

We have:

*h(s)(Y) = 4#(k,s)(Y) = ?bk(zd) = 4miul(z,y) = d s ( Y ) 7

for all natural numbers z and y.

Now we use Lemma (4.10) with (&‘I) instead of (4?)), and the recursive function h . We fmd the injective recursive function f :LW - Bv such that

l6 f (S) (V) = ?h(z)(Y) = d.(Y) I

for all natural numbers z and y.

0

(4.12) Lemma. Let (&I) be an acceptable g6delisation. Then, there exists an injective recursive function p :N2 - IV such that

b!’) = di{!,j) 9 (4.20)

for all i and j in N. (The recursive function p is called a padding func- tion.)

Proof. The proof will be divided into two steps. Firstly, we prove the lemma for the particular gijdehation (up)). Secondly, we extend the result to an arbitrary acceptable g6deliaation (&’I) via Lemma (4.11).

It is clear that the sets of equations C and C u { j = j } defme the same p.r. functions, for every j in N. On this basis we construct the injective recursive function q :RVz --* RV def i ed by

i .pn(long(i)+l)J(F(j),”(j)) , if G N ( ~ ) = 1 , i f G N ( i ) = 0 ,

where h :N -+ N is the injective recursive function given by

h ( 0 ) = 0 , h(z+1) = pyiy > h ( z ) and G N ( y ) = 01 .

From the above construction it follows that wj’) = w $ ! , ~ ) , for all i and j in N.

Page 154: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 141

Now consider (&I) to be an arbitrary acceptable gijdelisation. Let f :N -+ N, g:N .-c N be the injective recursive functions given by Lemma (4.11) such that

and 4:) = ~ ( ' 1 w!1) = #)s) U b ) ' for all z in N.

We claim that the injective recursive function p : p - N given by

P(Z9Y) = f ( d g ( 4 , v ) ) 9

for all 2, y in N satisfies (4.20). Indeed, for all z and y in N we have: ( 1) (1) - $2) . 4t!,) = 4?du(s , ,v , , = Wrl(u(s),v) = W r ( s ) -

0

(4.18) Lemma. For every acceptable gGdelisations (&I) and (&'I) we can effectively find a recursive function f *:N + krv satisfying the proper- ties:

z < f * ( Z ) < f.(z+l) , (4.21)

(4.22)

Proof. Let f and p be the recursive functions furnished, respectively, by Lemmaa (4.11) and (4.12). Defme the recursive function f * by primitive recursion:

f ( 0 ) = P(f(O), Park(f(O),Y) > 01) f*(z+l) = p ( f ( z + l ) , rar[P(f(z+l),d > f*(41)

f

*

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 set- theoretical CANTOR-BERNSTEIN Theorem (see MALITZ [1979]).

Page 155: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

142 Calude

(4.14) Theorem. (ROGERS (19581) For every acceptable g6delisations (dj"') and (@I) we can effectively find a recursive bijection f:RV -+ N such that

dl) = @$*) t (4.23)

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

4 y = #*) 1 = 4 g ) 9

for every natural z.

have been defined by the formulas: Recall that for every (recursive) function r : N --c IN, the iterates ri

r O ( z ) = z , ri+'(z) = r(ri(z)) , for all natural numbers i and z.

For every natural number i , put

A(') = (goh)' (N-rangefg) ) ,

and 30

B = UA(') . i -4

We shall prove that the function

F:N -. range(g) , given by

{iy) > i fz € B ?

i f z E B , F ( z ) =

is a recursive bijection. a) F i8 recursive. In view of the property (4.21) of h and g it fol-

lows 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). Conse- quently, for every z in Nl

z E l 3 tj z € A ( ' ) , for some i _< z , (4.24)

We consider the recursive function G : @ --* (0,l) defmed by primi- tive recursion as follows:

Page 156: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 143

A routine verifkation shows that

1, ifz € A ( ' ) ,

0 , if z 4 A(') . G(z, i ) =

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 b i j ec t i ve . 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

ii) neither z nor y are in B. This situation is clear: F ( z ) =

iii) z is in B, but y is not in B. We notice that ( g o h ) ( z ) ia also in

iv) The symmetrical last case is obvious. The function F is also surjective. Only the non-trivial case

y E B n range(g) must be analysed. There exists a natural number i > 0 such that y €A( ' ) (y 6 A(") = N-range(g)). Consequently, y = (goh)(z), for some z €A('-') c B , i.e. ~ ( z ) = ( g o h ) ( z ) = y.

(4.21));

2 f Y = F(Y);

E , consequently, F ( z ) = ( g o h ) ( z ) # y = F(y);

Finally, we use the inverse of the recursive bijection

g:N -.* range(g) , to defme the recursive bijection

f:N-+IN,

by

Page 157: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 “comput- able’’ 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 programming-oriented 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 , X A ( z ) = 10 , if z E A ,

is recursive. Intuitively, the set A is recursive if the membership problem for A

can be algorithmically solved.

Page 158: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 145

(6.2) Example. The following sets are recursive: i) The sets 0 and N. ii) Every primitive recursive set is recursive. (Notice that the con-

iii) The set {z EN J f ( y ) = z, for some y 5 z), where f :IN .-.c N

iv) The range of the primitive recursive function 2'.

verse implication fails to hold!)

is a faed recursive function.

0

(6.S) Theorem. (CHURCH [1936]) Let (4!n)) be an acceptable gGdeliration. Then the set

1

K = ( x E R q 4 , ( z ) Z 4 , (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 - {OJ}, 1 , if dz(z) # 20,

Let m be an index for the restriction of diag, pd iag ( z ) = 30, for (5,(z) # 00. A routine verification shows that for every x E N,

pdiag(z) = 0 +=+ r$'(z) = 00 , which, in particular for z = m, gives the contradictory equivalence

p d i a g ( n ) # 00 +=+ 4,(m) = 00 .

Remark. The function diag used in the proof of Theorem (5.3) is an example of non-recursive function (predicate).

(6.4) Proposition. The class of recursive sets forms a Boolean algebra with respect to the set-theoretic operations.

Proof. Obvious.

Page 159: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 semi-characteristic function of A, i.e. the partial function h :Bv 4 {l) ,

1 , i f z E A , 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). In the opposite case, let x A be the recursive characteristic function of A. Define the recursive function f :IN .--, N , by primitive recursion.

f(0) = PYLXA(Y)= 1! 9

f (z+l) = PY[xA(Y) = I and f(z) < g1 in case A is infinite, and

a,, ifz <_ k,

in case A = (a, Iz <_ k). In both cases, A = range(!).

Remarks.

a) The proof of Theorem (5.6) is not constructive in the sense that given an index for X A we may not know whether or not A = (Z E RV ) x A ( z ) = l } is fmite.

b) The converse of Theorem (5.6) fa&. See in this respect the

Page 160: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chrpkr 2

Remark following Example (5.16).

147

(6.7) Theorem. A set A C N is recursive iff both A and N - A are r.e.

Proof. The direct 'mplication follom from Proposition (5.4). For the converse implication we are dealing only with the non-trivial case, i.e. A f 0 and RV - A == U. Let g l : N - N , g 2 : N + N, be two recur- sive functions such that

A = range(gl) , N - A = range(g2) . We construct the p.r. function h :RV a N, h ( z ) =

py[eq(gl(y),z) + eq(g2(y),z) = 1). Clearly, for every z E N , there exists an unique y E R, such that either gl(y) = z or gz(y) = 2 . So, h ( z ) # 30, for every z E RV, i.e. h is recursive.

The characteristic function of the set A, xA:N + { O , l } , can be writ- ten as i' Y ol(h(z)) = 2 9

X A ( 2 ) = 0 , otherwise,

which proves the recursiveness of A. 0

(6.8) Definition. A set A C N is recureively enumerable in increasing order if there exists a recursive function g : N + N, such that

range(g) = A , (5.2)

= < Y * g(z ) < Q(Y) 9 (5.3)

and

for all z , y E N .

(6.9) Theorem. A set A C N ia infinite and recursive iff A is r.e. in increasing order.

Proof. In case A is an infinite recursive set we construct the p.r. function g:N -+ N, by primitive recursion:

do) = PUIXA(Y) = 11

g(z+l) = rar[v > !I(%) and XA(Y) = 11

9

*

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

Page 161: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

148 Caludc

means of the recursive function g. For every x in N,

x E range(x) w x E { O , 1 , ..., g(x)} . Hence, the characteristic function of A , xA:N + { O , l } , can be de f i ed by

I:

X A k ) = 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 recursion

g ( 0 ) = f ( 0 ) I

9 (z+l) = 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) C A

is also recursive. 0

(6.11) Lemma. Let (+in)) be an acceptable gzdeliaation. Then there exists an index m such that

#m(x) = x 9

for every x in 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.

tion f :N am, by Let n and x be such that &(z) = x). We construct the p.r. func-

Page 162: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 149

f (Y 1 = AAmd) 9

for all y in N. Every index m for 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 time-complexity (ai). We recall that the ternary predicate ni(z) 5 y is recursive (see Theorem (3.27)). The proof will use dovetailing computa- tions.

“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 *:N 4 N is given by f*(z) = f(py[f (y) = 21).

‘‘e” Assume that A = dom(w1’)) # 0. We define the p.r. func- tions T:IN 4 N and 7:N a 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 ~(i) # 04 for

Page 163: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

150 Caludc

i E { O , l , ..., t ) , then T ( t l 1 ) # %and 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

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,(tj) 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 = u1 5 u2 <...< ui. Let n be the smallest natural number such that T(ui+m) = u i + m + l , for each 15 m < n, but l'(u,+n) 5 ui+n. Clearly T(ui+n) = f l I ( t i+J and 7(ui+n) = t i + l *

7 ( Y ) * 7(0) , then f l k ( t ) = nk(r(g)) 2 r (Y) < x\ so w k ( t ) f cxz

9

The next result shows that we can go uniformly from the domain of a p.r. function to its range and vice versa.

(6.14) Theorem. Let (91")) be an acceptable gtidelisation. Then there exist two recursive functions f :IN -+ IN, g:N -c N, such that

W 4 9 # ) ) = dom(d!')) 9 (5.4)

dom(4ii!$ = range(9jl)) , (5.5)

for every i E N.

Proof. To construct the recursive function g we consider the p.r. func- tion $ : I N 2 4 IN given by dovetailing:

+ ( i , z ) = # i ( p Y l 4 i ( Y ) = zj) 9

for all i and z in N. If m is an index for y5, then by an a-m-n construc- tion we get:

Put g ( i ) = s;(m,i).

The equality (5.5) follows directly from the obvious formula:

z , if di(y) = z , for some Y E I N , do(i)(z) = oc, otherwise.

We p a a ~ to the second relation. Let k:N + N be the recursive function furnished by the construction (4.9) in Example (4.4), for the gGdelioation (&I):

Page 164: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 151

bt(i)(z) = c!l)(z) 9

for all i and z in N. We define the p.r. function B :@ 4 I?, by

d( i , z ) = ~,io,(c.mP(k(z),i),z) 9

for all i and z in N. Again by a standard 8-m-n construction we get the recursive function f ( i ) = at(m,i), where m is an index of B . The relation (5.4) is a consequence of the formula:

(6.16) Corollary. A set A C N is r.e. iff it is the range of an unary p.r. function.

Proof. Directly from Theorems (5.13) and (5.14). 0

(6.16) Example. The set n K = Iz E PI l#,(z) + ~1

rl

i s r.e. (Recall that K is not recursive by Theorem (5.3)). Consequently, in view of Theorem (5.7),

n I? - K = (Z EN I ~ , ( z ) = m} ,

i s not r.e.) n

Indeed, we represent K aa the range of the p.r. function $:IN N,

2 9 ifd,(z)f m9

w= ( m, otherwise. n

In view of Corollary (5.15), K. r.e.

Page 165: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

152 Caludc

Remark. The above example shows the existence of r.e. sets which are

not recursive; the set K is such a set (see Theorem (5.3)). The reader fam-

iliar with the RUSSELL paradox will discover that, under the identifica-

tion of a r.e. set with its GODEL number, the diagonal set K consists of

all r.e. sets of natural numbers which are contained in themselves.

n

n

n (6.17) Example. The set IN - T, where

is not r.e. A standard s-m-n construction gives a recursive function

r :N 4 N, such that

d r ( r ) ( ~ ) = C~”(6,,i , ,(~2’(2,~),pi2’(~,~)))

0 , i f 6 * ( z b X l

oc, otherwise. n

hsurne, for the sake of a contradiction, that IN - T is r.e., i.e. (by

Theorem (5.13)) rl

IV - T = dam($) ,

where $:UV UV is a certain p.r. function. Let O ( Z ) = $(r(z)). We have:

Consequently, n

dom(8) = N - K , n

i.e., the recursive enumerability of IN - T implies the recursive enumera-

bility of IN - K. We have reached a contradiction. 1

3

The next characterisation of the infmite r.e. sets, though not

Page 166: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 153

profound, will be very helpful.

(6.18) Theorem. An infinite set A c N is r.e. iff it is the range of an injective recursive unary function.

Proof. In view of the Defmition (5.5) all we have to prove is the possibil- ity of avoiding the repetitions in the enumeration of the given r.e. set. To this aim let A be an infinite r.e. set and let f :PJ - N be a recursive function such that A = range(f). The predicate r : N -+ {O,l}, given by r(0) = 1, and for z > 0,

i4

is clearly recursive. Consequently, by Theorem (5.9), there exists an increasing recursive function g:N -+ RV, which enumerates the infmite recursive set {z EN I.(.) = I}. Next we defme the recursive function 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)] and r(z) = 1, i.e.

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.

I

U

Remark. From Theorems (5.14) and (5.18) it follows the existence of two recursive functions

f,:RV-+N, f 2 : N - , R V , such that for every natural number z,

range(dfl(,)) = dom(4,) , is injective and 15-61

dom(q5fl(zj) is an initial segment of PJ

(i.e. has one of the following three forms: (21, ( O , l , ..., a}, or RV, for some n EN),

range(b,,(,)) = range(4,) , df,c,, is injective and (5.7)

dom(6,2(z)) is an initial segment of N .

Page 167: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

154 Calude

(6.19) Definition. Put Wi = range(4j')). The sequence (Wil iW 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 : N2 - N , such that the following equalities hold for all natural numbers i and j:

6iWj) = wia(i,jl 1 (5.8)

di'(Wj) = Wpcia(i,j) 9 (5.9)

wi u wj = Wj&m(i,jl 7 (5.10)

wi n Wj = wmcc t ( i , j ) * (5.11)

Proof. In view of the equality

+i(Wj) = {+i(z) 12 E Wi wj> 7

we can defme the p.r. function B : N 3 N by

8 (i, j , z ) = 4i (z).ag($i (z)+4 j(z)+ 1)

Oi(z) , if 4i(z) z 03 and 4,(z) z 30, oc, otherwise.

By a standard 8-m-n construction we get the recursive function

#r(i,j)(z) = f l ( i , j , z ) (5.12)

r :ov? --c RV, satisfying the equation

(r(i ,j) = ~f(rn,a,j), where rn is an index for B .) We have:

Y E Si(Wj) bi(z) z x 7 b , ( z ) # 33 9 and

#r(i,j)(z) = y , for some z in RV , Y E range(4r(i,j)) 9

Y E Wg(r(i,j)) 9

where g b the recursive function furnished by Theorem (5.14) (formula (5.5)). Consequently, the recursive function

Page 168: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 155

it4,j) = dr(i,j)) )

satisfies (5.8).

To prove (5.9) it is sufficient to notice the formula

We have:

Consequently,

preim(i , j ) = conp( j , i ) .

The formula (5.10) can be deduced from the p.r. function $:N3 3 IN, given by

1 if di(z) z C-O or bj(z) z 00

$ ( i , j , z ) = i 30, otherwise.

Again by a standard 8-m-n construction we get a recursive function p i n : f l - N, such that

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 func- tion meet( i , j ) = r ( i , j ) (i.e. the function satisfying (5.12)).

0

We continue with the extension of the notion of recursive enumera- bility to k-ary relations.

(6.21) Definition. A subset R c N k (k 2 2) is called recursively enu- merable (r.e.) if the set

(5.13)

is r.e. The subset R c Nk is recursive if its characteristic function is recursive, i.e. iff R and N” - R are both r.e.

R = { J q Z I ,..., Zk) I(Z1) ..., Z l j f R) c Hv ,

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).

Page 169: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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)).

que n t ly , “a” If (I is a p.r. function, then tl, = di, for some a E N . Conse-

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 Jo(F$’) ,d i ) . ‘‘e” Let k be such that

w k = rJ(zi$(z)) 1% 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,

for all j E N, then J(z ,y)

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 ) ) , &

W,, for every y in I N , i.e. $(z) = ‘x -- U

Remark. Notice that Graph($) may not be recursive; for example, the set ( ( 2 , ~ ) [q5=(z) ie x). Following ROGERS !1967], this is the reason for calling partial recursive functions (and not “recursive partial functions”) those partial functions satisfying Theorem (5.22).

(6.28) Definition. Let R c RV’, k 2 2, 15 i 5 k. The set ((2 ,,..., ,..., z t ) IR(z,, ..., zi, ... ,q), for some zi E I N } is called the pro- jection of R along the i t h coordinate.

(5.24) Theorem. Every r.e. set R c N’ (k 2 1) in a projection of some recursive set s c IN’+’.

Page 170: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 157

Proof. We use the acceptable gGdelisation (up)). Assume that R is r.e. Let +:N A N be a p.r. function such that dom(+) = R (see (5.13)). Fm an index m for 4 : ~ : ) = $. We have:

R(zl,..-,zt) w, , , (Jk) (z l , . . . , zk) ) z x

t) R,,,(J(~)I(Z, ,..., z k ) ) 2 y , for some y E N .

The set

= { ( z l , " * c t k , z k + l ) Intn(~k)(zl~...vzk)) 5 z k + l ) 7

is recursive and R is the projection of S along the (k+l ) th 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 Nk 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 th coordinate. The p.r. func- tion $:N 3 EV given by

9( 2 ) = 8 g (1 + Ir 2 1s (Ilk -l) (z )'...,W (. 18 (2 )& (41 ) 7

has the following property:

Q(zl ,..., t ~ - ~ ) w t6(J'(k-')(zl ,..., q-J) Z = , w dk-')(z1 ,..., zk-J Edam($) .

In view of Theorem (5.13) and Defmition (5.21), Q is r.e. 0

(6.26) Corollary. A set R c Nk is r.e. iff it is the projection of some recursive set s C N ~ + ' .

Proof. Directly from Theorems

Comment. Theorems (5.24) Theoreme.

(5.24) and (5.25).

0

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).

Page 171: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 Ifh(.)(Y) I and d,(Y) = 7 9

for some y and t in aV) . The relation S c Ns defined by

S(Z,Y,Z) iff %(,)(Y) I 2 and 4 ( Y ) = 7 9

is clearly recursive (for dom(4,) = dom(w;(.)) = dom(R,(,)) and if

The set A can be obtained by projection of the recursive S along the %(,)(!/) 5 2 < =we haye X f dZ(t!) = k n l V I ( W ) ) .

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 fin- ite 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 non-empty finite set

A = (zI ,..., z,} C N, z1 < z2 <...< z,, is $2'". We denote by D, the

fmite set whose canonical index is 2.

I = I

Remark. For all z and y in N, z > 0, y ED, iff 1 appears as the (y+l)th digit (from the right) in the binary representation of z.

(6.29) Example. D,, = (1,2}. CI

Remarks. The following assertions can be easily checked: a) Each frnite non-empty set has exactly one canonical index.

b) There exists a (primitive) recursive function j : N 4 N, such that f(z) = cardD,.

Page 172: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 159

2.6. UNDECIDABILITY AND INDEPENDENCE

This section is devoted to the basic undecidable problems. It is also proved that each such problem has an independent instance with respect to every formal theory satisfying four natural properties.

Fix an acceptable gtideliration (&I).

In Section 2.5 we have proved that the predicate diag:RV + {0,1} defined by

1 9 i f A ( 4 f diag(z) = I 0 , otherwise,

is not recursive. This function is intimately related to an well-known question named

the Halting Roblem (here “halting” refers to “having an output”; more precisely, a p.r. function $:RV a RV halts in z E IV provided $(z) # XI):

Is there a recursive binary predicate g such that g(z,g) = 1 if & ( v ) # 9 arid g(z,y) = 0 if $.(g) = x ?

Our fwst result says that the Halting Problem is undecidable.

(6.1) Theorem. There is no recursive predicate

g:m* + (0,l) , such that for all natural numbers 2, y

Proof. Let m be an index for the p.r. function $:PI2 2 N, given by

1 9 ifd,(.,z) = 0 , cMz,z) = I 00, otherwise.

By an s-m-n construction we get a recursive function h : N + RV, such that

d h ( z ) ( Z ) = $,(2,z) I

for all z and z in RV ( h ( z ) = 8i(m,z)) .

satisfying (6.1) and let n be an index for g. By the construction of h , For the sake of a contradiction assume the existence of a recursive g

Page 173: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

180 Calude

dh(n)(z) z x #n(z , t ) = 0

for all z in UV. Putting z = h(n) we obtain:

dh(n)(h(n)) + * #n(h(n),h(n)) = 0 *

I t follows that g * 4,,, a contradiction. 0

The next result concerns the possibility that every p.r. function can be extended to a recursive (i.e. total) function.

(6.2) Theorem. There exists a p.r. function $:N a N which has no recursive extension.

Proof, We consider the p.r. function 6 given by the following (diagonal) defmition

+(.) = #.niv,(Z,z)+'

d,(z)+l 9 if d*(z) + z c 7

- - L, otherwise.

Let 4; be an arbitrary recursive function. Since b j is total it follows that d j ( j ) # x, so

= 4j(i)+l * d,(A . Consequently, 4, is not an extension of 4.

0

We are now in a position to answer the question raised in conjunc- tion with KLEENE's Normal-Form Theorem, namely: Is it possible to eliminate the recursive function p from the statement of Theorem (3.28)? The answer is negative.

(6.8) Theorem. There exists a p.r. function $:N 4 RV such that the relation $(z) = p y [ f ( t , y ) = l!, for every t h N , fails to hold for every recursive function f :m2 + RV.

Proof. Again we use the diagonal condition d,(z) # x to defme $J. Put

For the sake of a contradiction, assume that f :w - IV is a recur- sive function such that

Page 174: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 181

= ctr[ f (w) = 11 9

for all z in N.

s ik case, i.e. In caee 4%(z) # x), we have +(z) = 2, so f(z,z) = 1. In the oppo-

+=(z) = x), f (z ,y) # 1, for all y in N; in particular, f(z,z) # 1-

The recursive predicate g:N + (0,l) given by

1 , if f(z,z) = 1 , dz) = i 0 , if f(z,z) # 1 ,

coincides with dicrg(z), which is not recursive. We arrived at a contradic- tion.

0

The next results, due to H.G. RICE, represent the most powerful tooh for proving non-recursiveness (and even, the non-recursive enumera- bility ).

(6.4) Definition. A set I c N is a function indez set if for all i and j in N, i E I and I$!') = 91') imply j E I.

Remark. A set I C N is a function index set if for every i E I, the set I contains every index of the p.r. function qbi. In view of Padding Lemma (4.12) every non-empty function index set is infinite.

(6.6) Example. The r.e. set

A = {z E N 17 E range(d,)) , (see Example (5.27)) is a function index set.

(6.6) Example. The r.e. and non-recursive set n K = {z E N I+,(z) # 4 9

(see Example (5.18) and Theorem (5.3)), is not a function index set. Indeed, by a standard application of the u-m-n Theorem and Recursion Theorem we get a natural number m such that

0 , i f z = m ,

',(') = cc, otherwise, n

i for every z in N. Consequently, W, = dorn(0,) = (m}, and m E K.

Page 175: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

162 Calude

Now take n EN - { m } such that 9, = 4%. Clearly, &(n) =

d,,,(n) = X, so n @ K. ?

C

(6.7) Theorem. Let I c N be a function index set. Assume the existence of two p.r. functions l:N 3 Hv, $:N allV such that

(RICE [1956])

1 = qii , for some i E I (6.2)

11 = dj , for some j E IN - I (6.3)

Graph(1) C Graph($) . (6.4)

, ,

Then I is not r.e.

Proof. To develop a dovetailing approach we use the acceptable giidelieation (w:)) , , ,~, , and a bijective recursive function t : N -+ RV, fur- nished by ROGERS' Isomorphism Theorem:

4;) = 11) (m)

for all m N. We introduce the auxiliary p.r. function o:w 3 N given by

a(z,y) = ~ [ R t ( t ) ( z ) < or Rt(i)(Y) < 21 7

for all E , y E lV. (Remember, the predicate n, (y) < z is primitive recur- sive.)

On the basis of a we defme the p.r. function 1':N' *N, as follows:

r (z ,Y 1 = 1 (Y 1.4 6 (Rt(i)(y ),a(% ,Y 11 + f l Y ) . ~ ~ ( ~ * ( , ) ( ~ ) , Q ( Z , Y O ) - 8( f l t ( i ) (Y )& ,d ) ) 9

for all z and y in N . It is seen that, by (6.4), for all natural numbers 2,

Yl

O(Y) 9 if 4z(z) = 00 ,

f l y ) , ifd,(z) # x .

Using an 8-m-n construction we can obtain a recursive function f :JV N satisfying the relation:

@ f ( Z ) b ) = r(ztY) 9

for all z and y in N.

Page 176: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 163

The conditions (6.2) and (6.3) together with the property of I to be a function index set, guarantee the following inclusions:

{z w l e = 4%) c I , (y E n v I $ = 4vj C N - I .

Consequently, for every natural number z, ;I

f ( z ) E I H d%(z) = X H z e K . $1 '1

So, RV - K = f - ' ( Z ) . If I were r.e.. then RV - K would also be r.e. We

contradict Theorem (5.3) and Example (5.16). 0

(6.8) Corollary. The following function index sets satisfy the properties (6.2) - (6.4) of Theorem (6.7):

I , = { i E RV 14; is not total } , I , = { a E z $j} 9

where # j is a fured recursive function , I , = { i E JV 14; = dj} ,

f , = R V - I S , Is = { i E N I j 6 dom(+i)} , for some fwed j E RV

18 = ( i EN Idom(#;) = VI} , 1, = ( i E RV Idom(di) is fiiite}

I , = { i E RV I j 4 range(#i)} , for some fured j E RV

1, = { i E RV [range(#;) is finite }

I,, = { i E RV (range(di) + N ) , I , , = {i E RV loi is injective }

Il2 = { i E N 14; is not bijective ]

where d j is a p.r. function such that @ # dom(dj) f N ,

,

, ,

,

, .

Consequently, all these sets are not r.e.

Page 177: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

164 Calude

Remark. The set Bv - I, does not satisfy the hypotheses of Theorem (6.7). However, this set is also non r.e. aa Corollary (6.12) will show.

(6.9) Corollary. (RICE [19531) If I C N is a function index set, then I is recursive iff I = ,a or I = N.

Proof. Assume that I c N is a function index set and I # 8, and I # N. Either I or N - I contains all indices of the p.r. function with empty domain. The nowhere defmed p.r. function is extended by every p.r. function qi. Consequently, Theorem (6.7) works: I (or N - I ) is not r.e., hence I is not recursive.

J

(8.10) Corollary. The following function index sets as well as their com- plements are not recursive (so, not r.e.1:

113 = { i E RV IWi is recursive }

114 = { i E RV is primitive recursive } ,

II6 = { i E R

where J’ is a fued natural number.

,

= bj(z), for some z EN} ,

3

Another variant of the RICE Theorem involves the behaviour of a given p.r. function on fmite portions of its domain.

(6.11) Theorem (RICE [1956]) Let I c PV be a function index set. Assume the existence of a p.r. function +l:N a RV satisfying the following two conditions:

$J = 4i , for some i E Z , (6.5)

{ i E RV Jdom(4i) fmite and Graph(#,) C Graph(+)} C A’ - I . (8.6)

Then I is not r.e.

Proof. Again we use the dovetailing method by means of the acceptable g6delisation (w i)),,, >o and the recursive bijection t :RV -., RV, furnished by ROGERS’ Isomorphism Theorem.

Consider the p.r. function d :w 4 PI given by

(+( j ) 9 if nt(i)(i) > i 9

= o=, otherwise,

for all natural numbers i and j. By an 8-m-n construction we get a

Page 178: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 165

recarsive function f :N 4 N such that

d,(i)(j) = d( i , j )

for all i and j in N.

every i E N: It is routine to check the validity of the following statements for

n i E K H I$ ; ( ; ) # .x,

w

w there exists a natural number j such that @,(i)(z) =

5 j , for some j E N ,

$(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 )EN-- I 9

and

w I$,(&) = $(z) , for every z in N , =+ f ( i ) E I *

Consequently,

i.e. n

nv - K = f-yI) .

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' E N is total } ,

Page 179: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

166 Cdudc

I17 = IN - I7 = {i E IN ldom(4i) is infmite }

11, = IN - I, = { a E dV (range(q$) is infinite }

I,, = IN - llo = {i E IN irange(gi) = PI}

I , = IV - I,, = {i E IN l+i is bijective }

, ,

, .

Consequently they are not r.e. 0

Comment . 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, non-empty set (the alphabet) and E ( X ) c X* the set of well-formed “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 well-formed 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 well-formed expressions with natural numbers in such a way that the syntactic opera- tions 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 Sec- tion 2.3. For a more detailed presentation see YASUHARA [1971], W I N [1977].)

A formal theory satisfying the above requirements and which,

Page 180: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 167

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 T is a formal theory hav- ing the following four properties:

The theory T is recursively axiomatisable (i.e. the set

of all theorems which can be inferred in T is r.e.) (6.7)

. The theory T is consistent . (6.8)

All theorems deducible in T are semantically true (at

the level of meta-language) . The theory T is rich enough to contain

the recursive function theory .

(6.9)

(6.10)

Comment. PEANO arithmetic is an example of GODEL theory.

(6.14) Definition. An well-formed 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 ~ $ ~ ( y ) f 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 T:H a N given by

Page 181: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

168 Caludc

1 , if there exists a proof in T for “ P ( i ) = 1 ” , I x, otherwise, T ( z , i ) =

for all z and i in N, is a p.r. function. By an s-m-n 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 that the statement “P(k) = 1’’ has the required pro-

perties. Firstly, P(k) = 1. Indeed, if by contradiction P(k) = 0, then by

(6.12) there exists an z, such that dk(zo) # oc. In view of the construction of the p.r. function T and of (6.9) we derive the relation ~ ( z , k ) = q for all z E N. Consequently, dL(z) = for all z E I?. Putting z = z, we obtain a contradiction.

Secondly we prove that “ 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 ( 2 7 k ) = 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 that #k(zo) = xs We have obtained a con- tradiction.

Finally we show that the negation of the statement “P(k) = 1” can- not be a theorem in T. If, on the contrary, there exists a proof in T for the negation of the statement “P(k) = I”, then P(k) = 0 (by (6.9)). This 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 GODEL theory and for each z in N let P , : N -+ (0,l) be the predicate defmed by

1 , iff$&) = ‘X,

Then we can effectively fmd a natural number k (depending upon z) such

Page 182: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 169

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 + {O,l} be the predicate defmed by

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 P:N -+ {OJ} be the predicate defmed by

1 , 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.

Page 183: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 Corol- laries (6.17) - (6.18). It relies on corollary (6.16).

(6.19) Theorem. ( C U U D E [1983a]) Let I be a non-empty proper sub- set 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:N3 R by

4J(z ,Y 12) = 4 m (z).sg(1+4* (Y))

6 , ( 4 1 if d,(I!) f 1

- - 1 m, otherwise,

for all z , y and z in IN.

such that ~n s-m-n construction gives us a recursive function r : ~ ’ ---+ N~

@ r ( ~ , y J ( ~ ) = + ( z ? y i z ) 7

for all z,ylz E N. We shall prove that for all natural numbers z and y,

+ ,Y) € 1 * 4 * ( d # * (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 = 4 r ( * , y ) ( 4 = + m k ) ?

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

We are able to use Corollary (6.18). For every natural number z there exists a natural number k (depending upon z) such that the problem

‘ (Z ,Y) E 1.

Page 184: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 171

“+t(z) = x” is true but independent of T. In view of (6.13), the problem “r(k,z) I” is true and independent of T (for every z E N).

AU it remains to prove ia that for the above pair (z ,k ) ,

dr(t,z)(y) = x 9

h ( t , Z ) ( d f 03 f

4r(t,z)(z) = b m ( z ) 9

d k k ) # 33 7

for every y E N. If for some y E N,

then

for every z E N, i.e.

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 non-uniform 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 con- structive 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 suit- able 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

Page 185: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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, fur- nished by ROGERS' Isomorphism Theorem, such that $!') = u$), for every i E N .

For the sake of a contradiction assume that a p.r. function $ exists, 3s in the statement of the theorem.

Let g:N + lV be a recursive function such that for all naturals z and y , ds(r)(y) = sg(l+c$.,,ig,(z,z)). It follows that for every z E N ,

I I

JN, i f z ~ ~ ,

Ws(.) = dom(4,(z)) = I@ , otherwise.

Hence, Ws(z) is recursive for every natural number 2. By the hypothesis, w(g(2)) = x, for every z E N .

Since

N , otherwise,

for every z E N, we can write the equality ri

PJ - K = (2 € N IWflp(s)) # 0) *

1

We shall prove that lV - K is r.e., thus contradicting Theorem (5.3).

Indeed, by Theorem (5.25), PJ - K ia r.e. since {z C N ILVH~[~)) #

flc(,,)(z) 5 w , for some I/, w and z in N].

1

. > I = 'lz E N I Y = v(g(z)) and wv f @ } = {z E N I Y = to(s(z)) and

3

Page 186: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 173

(7.2) Corollary. There is no p.r. function B :N a 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 non- uniformity properties of earlier results.

c) It is worth noticing that the proofs involving 8-m-n constructions and the Recursion Theorem ore uniform.

We close this section with a simple example of non-uniform opera- tion. For every non-empty set A c lV denote by

A3 = {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 Ih(z ) = 1).

Let (&I) be an acceptable g6delisation.

(7.8) Theorem. (CALUDE [1983b]) There is no p.r. function f :N 3 N having the following property: For every recursive function di with infmite range we have:

f ( i ) f 9 (7.1)

#,(i) is a 0-1 valued recursive function , ( 7 4

The proof of Theorem (7.3) will be divided into several steps. First we give two obvious results.

Page 187: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

174 Caiude

(7.4) Lemma. The p.r. function $:BV % N defmed by the formula

$(i) = pj[di( j ) = 1 and (di(z) x ,z 5 dl 9

has the following property: For every natural i , such that di is a 0-1 valued recursive function, we have:

$ ( i ) is the minimum element of S,; or, (7.4)

If S,, = , then + ( a ) # xand&($(i)) (7.5)

equivalently, the minimum element of (S,,)9 ,

= 1 (that is $ ( t ) E Sbi) .

(7.6) Lemma. The p.r. function B :N2 4 N defmed by the formula

e(i ,z) = ri[di(j) + 2 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:

, (7.6) e( i ,z) is the minimum element j f z generated by di

4i(t9(i,z)) z z . (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 , (7.8)

range(d,(i,z)) = range(di) - {z) * (7.9)

Proof. Let F:N3 3 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-n construction we get a recursive function 8 :I@ 4 N, such that

+a(i,z)(v) = Ffi ,z ,y) 7

for all i , 2 , and y in N. We shall prove that the above recursive function 8 satisfies

Page 188: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 175

conditions (7.8) and (7.9). To this aim let i and z be two naturals satisfy- ing 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 :N 4 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 def ied 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)

Page 189: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

176 Caludc

fl f (4 E range (4; ).

( Y t l ) .

Suppose now that properties (7.10) - (7.14) are fulfiied for some We shall prove that they still remain true when passing to

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 Nf(T( i ,y) ) ) # M From GH it foi- lows that /I * range(dT(i,y)) = S, ,,,,,,,, - we use (7.5) and obtain dJ(f(?(i,y))) # q because t$,(7(,,y)) is a 0-1 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

shows that range ($,(i,y+i)) is infmite.

Firstly, f ( ~ ( i , y + l ) ) # m Since, by GH, g5,(T(i,y+l)) is a 0-1 valued recursive function we make use of (7.4):

natural y.

and range(4T(a,y+l)) = range(d,(i:y)) - { I N ~ ( T ( ~ , Y ) ) ) } * The last equality

4 f ( T h Y + 1 ) ) ) E = ( r an~(47( i , ,+1 ) ) )~ *

Moreover, + ( f ( ~ ( i , y + l ) ) ) is the minimum element in the set (range(4,(i,r+1)))3, hence, it is in fact in range(d,(i,y+l)).

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) .

Page 190: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 177

(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 ~range (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$) =

{zo,zl ,..., z, ,... }, z, < z1 < z2 <...< z, < .... We shall prove, by induction on A, the formula:

2k = $( f (7 ( i , k ) ) ) *

For k = 0, $(f(T(i,O))) = $(f(i)) = the minimum element of range(di) = 2,. If zk = ?,6(f(T(i ,k))) , then $( f (v ( i ,k+ l ) ) ) = the minimum element of = the minimum element of

(range(#;) - U { $ ( f ( 7 ( i , y ) ) ) } ) = the minimum element of k

Y d

(range(4i) - {zo,zl,.*.,zk}) = zk+l .

From (7.10) and (7.5) it follows that g ia recursive. Clearly, from the formula Zk = $(f (T( i ,k ) ) ) = ['(a$) = g(k), we conclude that g is increas- ing.

0

We are able to fmish the proof of Theorem (7.3). According to Lemma (7.9), for every natural i such that di is recursive and range(di) is infmite, we can effectively find an increasing recursive function g : N + N (which depends upon a), such that range(#;) = range(g), i.e. range(#i) is recursive. We have arrived at a contradiction.

2

The following question naturally arises: Does there exist a fuced r.e. (and, obviously, non-recursive) set A c IV, such that for every p.r. func- tion c : h V 3 N, satisfying property (7.21), we have:

Page 191: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

178 Calude

(7.20)

The property in question is:

For every i E nV , if Oi is total and A = range(gi) , then t ( i ) # x , and +di) is a 0-1 valued function.

(7.21)

(7.10) Theorem. (FREIVALDS [19831) There is no r.e. set A satisfying properties (7.20) and (7.21).

Proof. Assume, for the sake of a contradiction, the existence of a set A satisfying the required properties. Let B be the set of all constant one- argument functions having property (7.21), i.e.

B = {Ci ) Im E PJ , I$, is a 0-1 valued function } .

It is obvious that for each (7:) E B,

(7.22)

for all i E PJ. On the other hand, A3 is a recursive set and its characteris- tic function is some #,,:PJ - {(),I}. Consequently,

S,= = Ai . (7.23)

The relations (7.22) (with rn = n), and (7.23) are contradictory because +,, must be in B.

0

2.8. OPERATORS

We defme and study the enumeration, (partial) recursive and total

Recall that (Di)i2, is the canonical enumeration of all fmite sets (see effective operators.

Defmition (5.28)) and that 2m is the power set of N.

Page 192: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 179

(8.1) Definition. An enumeration operator is a function

- - F ; 2 m + 2 " , for which there exists a natural number z such that for every subset A C RV,

- F(A) = {z E RVIJ(z,u) E W , P , C A, for some u EN} .

Remark. Enumeration operators are a set-theoretic analogue of recursive functions. Since every enumeration operator is defined by a certain natural number, it follows that, in a sense, the enumeration operators are simpler than the recursive functions.

Notation. We denote by _Fa - the enumeration operator corresponding to the natural number z .

(8.2) Example. Let z be such that W, = N. Then the enumeration operator

&:2" - -2" , acts as follows:

N , i f A # ( Z I , F,(A) - = 0 , otherwise,

for every A c N. a

(8.8) Theorem. For every enumeration operator

F : 2 m N 2 " , - and for every A,B C RV we have:

If A c B , then F(A) - c E ( E ) , (monotonicity) (8.1 1 If z E F(A) , then z E F(D) , - for some finite D C A , (8.2) -

(weak continuity).

Proof. Direct from the Definition (8.1). 0

Page 193: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

180 Caludc

d + , U ) =

Remark. The enumeration operators are continuous mappings in case we endow the power set 2" with the topology induced by the family of sets

{ A C N I D i C A ) , ; E N

u , if u = 4, (z l ( i ) , for some i e N , and for every t # L ( u ) , if

J ( K ( u ) , t ) = 4,,(&), for some

jEN, then i < j , x, otherwise.

(8.4) Definition. A set A C N is single-valued if for all natural numbers t, y , y , if J(z,y) E A and J(z,y') E A, then y = y'.

Remark. It is seen that A is single-valued iff

A = IJ (Z ,Y) I ( w ) E Graph($)) 7

for some partial function $ : N N .

(8.6) Definition. some y E N } .

If A C N , then dom(A) = {z E N IJ(z,y) E A, for

(8.6) Theorem. (Uniformication Theorem) There exists a recursive func- tion f : N -. N , such that for every natural number z ,

W,(,, is single-valued, (8.3)

W,(z) c wz ! (8.4)

dOdW,(,)) = dom(W,) 9 (8.5)

If W, is single-valued, then W,(,) = W, . (8.6)

By an 8-m-n construction we get the recursive function f : N + IV which satisfies the relation

Proof. From the Remark following Theorem (5.18) we have a recursive function f l:N -. N such that for every z E N ,

range(#/,(*)) = dom(#s) = Wa

is injective, and dom(#,l(al) is an initial segment of N.

By means of Theorem (5.25) we define the p.r. function $:N2 4 lV aa follows:

Page 194: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 181

w4 = 4,(1)(4 I

for all naturhl numbers z and U.

Property

quences of the (8.8).

4f*(s) and the (8.3) is a consequence of the injectivity of the p.r. function construction of 4. Properties (8.4) and (8.5) are conse- construction of vh Finally, from (8.4) and (8.5) we deduce

Note on Terminology. In case f is the recursive function in Theorem (8.6), we say that W,cI, is obtained by “single-valuising” the set W,.

The following technical lemma introduces an injective enumeration of all finite p.r. functions.

(8.7) Lemma. There exists a recursive function f : N - N such that (4,(r))sm is an enumeration of all p.r. functions with fmite domain satis- fying the following two properties for all natural numbers z and y:

and

If D, is single-valued, then D, = {J(n,m) [#,(,)(n) = m) . (8.8)

Proof. In view of the construction of Di it follows that there exist two recursive predicates h :N2 + {0,1}, g :IV + (0,l) defined by:

1 , i fz ED, I

h(zlr) = [ 0 , otherwise,

and

1 , if D, is single-valued, g(z) = 1 0 , otherwise.

Using these recursive functions we can define the p.r. function +:N2 RV by

,z) = 1 and K ( t ) = y]) , if g(z) = 1 , otherwise.

An 8-m-n construction gives a recursive function f :i’V - iV satisfy- ing the equation

Page 195: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

182 Caludc

d,(r)(l) = dJ(z,ar) , for all z and y in JV.

The equation h ( t , z ) = 1 has only a fmite number of solutions for every fmed natural number 2. Hence, dom(d,(,)) ia frnite for every z in N. Conversely, if 9 :N 4 lN is a p.r. function with a finite domain, then there exists an unique natural number 2 such that

D, = { J ( n , m ) l d ( n ) = m ) . The set D, is single-valued and B = qb,(rl.

Property (8.7) is a consequence of the corresponding property of the enumeration (Di): if Di = D j , then i = j. Property (8.8) can be easily checked using the construction of the recursive function f . -

-J

Notation.

a) Denote by F, the fmite p.r. function 0 5 , ( ~ ) furnished by Lemma (8.7).

b) Let P be the class of all unary partial functions a : N 4 N, P R (respectively, R ) be the class of all p.r. (respectively, recursive) functions in ?, and Snv be the class of all single-valued subsets of RV.

(8.8) Definition. A partial function

Y T : P a P , will be called a (functional) operator. If (I is in the domain ,T and z E RV, then we write T((I)(z) the value of the partial function ,T(+) at point 2.

Remark. Sotice that an enumeration operator maps sets to sets, whereas a (functional) operator maps partial functions to partial functions.

(8.9) Definition. Let

- - F:SN , be a partial function and

-., T : P a P , be an operator. We say that F defmes ,T provided that, for every (I in the domain of ,T and all natural numbers z and y , we have:

T ( $ ) ( z ) = Y * J( . ,ar ) E E ( { J ( n , m ) IIM4 = 4) ' (8.9)

Page 196: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 183

(8.10) Definition. a) A partial recursive (p.r.) operator is an operator defmed, in the

sense of Defmition (8.9), by the restriction of an enumeration operator - F; to the set F;'(SN) - n SN.

b) A recursive operator is a p.r. operator defmed by an enumeration operator F , - satisfying the property: F,(SN) - C SN.

(8.11) Example. The identity function

- - F:SN- SN , given by F(A) - = A, for every A E SN, defines the recursive operator

v T:P- P , given by ,T($) = 4, for every $J in P.

(8.12) Proposition. An operator

v T:P&P , is partial recursive iff there exists a r.e. set W,, such that for every $J in the domain of T we have

(8.10) 7 T($)(z) = Y * J(J(. ,Y), t) E w, and Graph(Ft) c Graph($), for some t in LV .

Proof. We notice that every subset of a single-valued subset of N is also single-valued, and that for every single-valued set A C N,

D, c A * Graph(F,) c { (K( t ) ,L ( t ) ) It € A ) 9 (8.11)

for every z in N. An application of (8.11) to the set

A = :J (n ,m) I$(.) = m ) 9

for some $ in the domain of Z', ends the proof. 0

The enumeration operators constitute a natural universe for a more genuine fmed-point theorem.

Page 197: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

184 Calude

(8.1a) Theorem. Let

be an enumeration operator. There exists a r.e. set A C N such that

F(A) - = A 1 (8.12)

(8.13) For every B C N , if F ( E ) - = E , then A C E .

Proof. Recall that F has the properties of monotonicity and weak con- tinuity (8.1) and (8.2)T

We defme the following sequence of sets.

A0 = ID , & + I = g(4) 9 (8.14)

and we take X

A = U A , , .

Firstly we prove (8.12). If z E A, then z E A,, = F(A,,-,), for some natural n > 0. By monotonicity, F(A,,J c E(A), hencez E F(A). Con- versely, if z EF(A), then (by weak continuity) z EF(D) , for-some 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

-4 = UA,, C E . X

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 8-m-n con- struction to get a recursive function f :nV2 + N satisfying the equation

WI(Y,J) = PJ(WY) 7 (8.15)

for every in RV.

sion, the recursive function g:@ + N such that Let m be such that W,,, = (8. We construct, by a primitive recur-

Page 198: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 185

g ( W = m I

g(z+l,z) = f ( ! 7 ( Z , Z ) , Z ) 9

for every z in N. By 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 KNASTER-TARSKI’s Theorem (which asserts that every monotone and continuous function from a com- plete lattice to itself has a least fured-point; the continuity is taken here with respect to the topology generated by the closure under the least- upper-bound operation of the lattice). In Theorem (8.13) we work with the lattice of all subsets of N, partially ordered by inclusion. Monotoni- city and weak continuity ensure the continuity with respect to the gen- erated topology. In our particular case the least fixed-point 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 particu- lar 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 can-be unirormly obtained from t , i.e. there exists a recursive function h :N --L IV such that

- ! ? ~ ( ~ h ( s ) ) = wh(s) 9 (8.16)

and

For every B C N satisfying Es(B) - = B, we have wh(,) C B . (8.17) Theorem (8.13) ensures a fixed-point 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 +:N 4 N such that

Page 199: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

188 Calude

T ( 6 ) = 6 9 (8.18)

and

For every partial function $:N 4 RV satisfying

_T($) = $we have Graph(#) C Graph($)

(8.19)

.

Proof. Let

- Fz:2" - - 2 " ,

be an enumeration operator defming the recursive operator ,T. We defme the sequence (A,,) as in (8.141, where = F , . We prove, by induction on n, that A, ia a single-valued set. Indeed,-& = 8 is a single-valued set, and if A,, is single-valued, then A,,+l = Ez(A,,+l) is also single-valued (since f, defmes the recursive operator 7'; see Defjnition (8.10)). We con-

elude that the least fmed-point A = UA,, is a single-valued set. Taking

the p.r. function $:N 4 RV such that

X -

n - 4

Graph(6) = { ( z a ) E lv2 IJ(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 single-valued, (8.20)

then

GraPh@g(v,,)) = { (K lz ) , Jw) lz E&({J(nm) Idpb) = ml) ) 6

In case F , - defmes a recursive operator

% T : ? a P , we have

m u ) = 4 e ( i . 1 ) 7

for all natural numbers 2 and y satisfying (8.20).

(8.21)

Page 200: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 187

Proof. Let y and z be such that (8.20) holds. Perform uniformly the fol- lowing steps (which guarantee the existence of 9 ) :

(1) Use the Graph Theorem to fmd the natural y * such that

(2)

(3)

(4)

wv* = { J ( n , m ) Id&) = ml.

Compute f (y*,z) as in (8.15): g,(W,*) = W,(y-,st.

Single-valuize the set W,(f*,sl, by Theorem (8.6).

Use the Graph Theorem to obtain from the above single-valued set a p.r. function.

CI

Rernsr ks.

recursive function h :A! --c N such that for every natural z for which a) In view of Remark c) which follows Theorem (8.13), we get a

- - F,:2" - 2 " , defmes a recursive operator

p P 3 P , we have:

,T(dh(.)) = h(.) 1 (8.22)

and for every partial function $:N a N, satisfying ?'($) = (I we have

GraPh(h(*)) c Graph(*) - (8.23)

b) Theorem (8.14) may fail in case of a p.r. operator, since the least fmed-point of the associated enumeration operator need not be a single- valued set.

c) In view of (8.21) it follows that every recursive operator

- T:P*P , determines a recursive function f :N + N satisfying the relations:

7'(4,) = $,(=I , for every natural 2,

If 4, = &, then dl(,) = t$j(y) , for all z and y in IV , (8.24)

(8.25)

(i.e. f is eztensionaf).

Page 201: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

188 Calude

(8.18) Definition. A CIMS A of unary p.r. functions is said to be recur- sively 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.

(8.17) Example. The set of all unary p.r. functions is r.e. Here f (2) = z, for every z E N .

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 ulti- mately 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 of Lemma (8.7) by the recursive function $*:N2 --* RV satisfying the rela- 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:

Page 202: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2

r(i,z) = a

189

z t l , if i = o , 9 i f i = l ,

r(ezp(l,i),z)+r(ezp(2,i),z), if i > 1 and e z p ( O , i ) = 0,

r(ezp(2,i), if i > 1 and e z p ( O , i ) = 1,

0 , i f i > l , e z p ( O , i ) > l , and z=O,

r ( e z ~ ( 2 , i ) , ~ ( i , z - l ) ) , if i> l ,ezp(O, i )>l , and z>O.

‘(ezP(l,i),z 11,

\

(8.22) Example. The set For the sake of a contradiction, assume that

of all unary recursive predicates i a not r.e.

R 0 . I = {#![*) Iz E N} 9

for some recursive function f :nV -* N. Construct the recursive predicate g:JV -+ {O,l}, by

0 7 if d,&) = 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. I t ia obvious that a similar argument shows that the set R of all unary recursive functions is not r.e.

(8.23) Example. The set of all unary p.r. functions which arc nof recur- sive is r.e. Let $:N3 2 N be the p.r. function def ied by

#i(z) 9 if # m 9 i 00, otherwise, rL(i,m,z) =

for all i , m and z in N and let g:@ -t N be the recursive function which satisfies the equation

Since for every number-theoretic 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 a-m-n construction will produce the required enumerating function.

Page 203: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

190 Caludc

#f ( i ,m)(z) = d i , m , z ) *

G(n) = ! 7 ( K ( + w ) 9

P R - R = { d G ( = ] ( 2 E N }

Finally consider the recursive function G :IV - I? defmed by

for every n in I?. Clearly

- 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 E P R - R ) is not r.e. (8.27)

(the validity of the last assertion follows from Corollary (8.8) since I = 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 non-total p.r. func- tion, whereas I contains ail indices for non-total 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 $:N A 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 T is a subset of P R , then

effective operator. 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

is an

Page 204: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 191

means of the fmite segments of the partial functions in its domain. KREISEL-LACOMBESHOENFIELD'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, par- ticular variation. We begin with some prerequisites.

(8.26) Lemma. There exists a recursive function a :RV -+ IV such that the set {4+1 Jn 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

and let u :IV 4 N be a struction:

for all naturals z and y. works.

otherwise,

recursive function furnished by an 8-m-n con-

d,(,)(Y) = + t v ) 9

We shall prove that this recursive function a

Clearly, dam(+,(,)) = {OJ, ...,K( z)}. Moreover, for every p.r. func- tion a :{Ol l , ..., 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) =

P+')(L(z)) Y + l = I;::')( "+')(a(o),...,a(n))) = a(y). 0

Notation.

(8.25). a) Denote by A, the fmite function I$+) , comming from Lemma

b) Let a,":IV 4 RV be the recursive function defmed by

X Z M ? if Y I K ( 4 9

(8.28)

Furthermore, let b:N + IV be the recursive function satisfying the equa- tion r," = I$+).

c) For each natural n, let f in i te , :W+' -+ N be the recursive function defmed by

* Z " ( y ) = i 0 , otherwise.

Page 205: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

192 Calude

Remark. It should be emphasired the distinction between F, and rS.

(8.28) Lemma. For every natural i , rl n

i E K n W i o r i @ K u W , . (8.30)

17

Proof. Obvious, since K = (z E N lds(z) f XI.

(8.27) Theorem. Let

Z : P R - - P R ,

Z(48)(4 = 6,(i)(4 *

be a total effective operator given by a recursive function g:N --c N,

Then, we can effectively fmd a for every recursive ipi,

where C, = (n E IV (Graph (x , , )

recursive function f : N -. RV such that

(8.31)

Proof. The following proof is essentially taken from the proof of KREISEL-LACOMBESHOENFELD’s Theorem.

Recall that in view of KLEENE’s Normal-Form 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:N3 -. {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 recur-

sive function g . For each natural z we consider the p.r. function w, ; N RV given by

~ s ( i ) = q,(i)(z) 1

and the partial function

Page 206: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2

dC(i,j)(z) = '

193

d j ( z ) , if T( i , i ,q)#I , for all q j z ,

* ; (z ) , i f y = l i ( i ) < x , 6 j (q )#m, fo r a l l q l y ,

and n = prn[Graph(nt)CGraph(r,),

functz ( d j ) # functz (ds(m))l, where e = finite, (6 j (0),-*,6 j (g)),

x, otherwise. \

funet,:PR A N , defmed by

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 ) - - n

Hence, X ( j ) E Cj = WA(j), thus contradicting (8.30) (since X ( j ) 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

functs(4i) = $,( i ) - ( fund, 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

Page 207: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

194 Calude

*n(u) = gj(u) 7

for all u <_ y = 8 L ( j l ( A ( j ) ) , we have

functz(4j) = funets(g,(rn)) (8.32)

We proceed by contradiction. For given j, satisfying the hypothesis of the Intermediate step, we Iook for the smallest n for which (8.32) fails to hold. (The reader may notice that both sides in (8.32) are t X ) It follows that #G(X(,),J) = r,' = db(,,). Next

V i ) 4 WL(,) - (8.33) -

Since C, = Wk(jl, all it remains to prove reduces to the relation

vj, (G (Wi)) + 16% (i) . But

%(G (Ui),i)) = funct , (4~(~( , ) , , ) )

= functz(4b(n))

= funetz(4,)

= w(i) . I

Since X ( j ) E K (by hypothesis), it follows that (8.33) contradicts

(8.30), thus completing the proof of the Intermediate step. Finaily, let bj be recursive. We have: funet,(dj) = #p(i)(z) f x,

and X ( j ) EK. For each r , with a,(u) = dj(u), for all

u <_ y = f l L ( j l ( l ( j ) ) , we have f~net,(t$~) = functZ(4b(,,,)). In particular, the fmite function ?r, , where C = finitcr(q5j(0), ...,b,(y)), satisfies all condi- t ions; hence

n

functz(dj) = fumtz(db(l)) - The global uniformity assures the existence of the required recursive

function f ; formula (8.31) works in view of the Intermediate step. 3

Page 208: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 195

2.9. RECURSIVE REAL NUMBERS

This section contains a short introduction to recursive teals. We focus our attention to the construction as well as to some decision prob- lems.

The positive rational numbers can be “recursively” enumerated without repetitions by means of the sequence (q i ) , 2o defmed M follows (see W-TING [1980]):

q o = o 1 (9.1)

(9.2) q;, = 1 + q i , for every natural n > o

q;n+l = l / ( l + q J , for every natural R . (9.3)

,

Moreover, the sequence enumerates (without repetitions) all the rational numbers in the interval (0,ll. We can easily extend this enumera- tion to all rational numbers; denote by (q,), 2o the resulting enumeration.

We shall consider that a rational number is “given” if the corresponding index - in the enumeration (q,,)n20 a is given. So, to every sequence of rational numbers corresponds a sequence of natural numbers and conversely. In this way the basic constructions involving partial recur- siveness can be transferred mutadie mutandie to rational numbers. For example, a sequence of rational numbers is calied recursively enumerable (r.e.) provided the corresponding sequence of indices is a r.e. set. Obvi- ously, a r.e. sequence of rational numbers can be represented as ( q t ( i ] la’ E N}, where t : N - LW is a certain recursive function.

(9.1) Definition. A r.e. sequence of rational numbers

a,,a1 ,..., 0, I...

is called recureively convergent when there exists a recursive function g :RV + RV such that for all natural numbers n , m, and k > 0, we have

I =, - a, I < l/k f

in case n,m 2 g(k). The recursive function g will be called a convergence function for the sequence.

(9.2) Definition. (RICE (19541) A real number a in rccureiuc when it is the limit of a r.e. sequence of rational numbers which is recursively conver- gent.

Page 209: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

198 Calude

Remar krr.

a) The Defmition (9.2) is a constructive version of the usual CAU-

b) Every rational number is clearly recursive. Moreover, the usual For example, the well known

CI-W construction of the set of real numbers.

irrational numbers are in fact recursive. series expansions

e = 1+1/1!+1/2!+1/3!+ ... ,

IF = 4(1-1/3+1/5-1/?+ ...) , can be used to show that the transcendental numbers e and r are recur- sive.

c ) The reader can easily check that the set of all recursive real

d) The set of all recursive real numbers is denumerable. A simple

In the next theorem we shall exhibit an example of a r.e. sequence of

numbers is an algebraically closed field in R.

diagonal argument proves that this set is not r.e.

rational numbers which does not recursively converge.

(9.8) Theorem. (SPECKER 119491, RICE j19541) There exists a r.e. sequence of rational numbers

0 < a, < a, <...< a, <...< 1 , (9.4)

which does not recursively converge.

Proof. Let f ; N --+ N be an injective recursive function such that !-

range( f ) = K = {z E N lrjz(z) # x} .

Putting

m =O

for every natural n, we guarantee (9.4) and the recursive enumerability condition.

ia recursively convergent (with some recuraive g as a convergence function). Let G :N - PI be the recursive function given by G(z) = 4(2'+').

In view of Defmition (9.1) we deduce that for all naturals n and rn, if n > G(m), then

For the sake of a contradiction assume that the sequence

Page 210: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 197

From (9.5) and (9.6) we infer that the implication

holds for all naturals n and m. Consequently, from (9.7), 1

m E K e+ f(n) = m, for some n E {O,l,...,G(m)} . (9.8)

n From (9.8) we derive the recursiveness of K, which is impossible (see

Example (5.16)).

cl

(9.4) Theorem. (RICE [1954]) The problem whether two arbitrary recursive real numbers a , 6 , a # 6 , are or are not in the relation a < 6 is decidable.

Proof. Let (an),, 20 and (b,),ZO be two r.e. sequences of rational numbers which are recursively convergent to the recursive real numbers a and 6 , respectively. Let f ,q:N - IN be the convergence functions for the sequences (an)n lo and (6n)n Zo, respectively.

Since, by hypothesis, a # 6 , there exists a natural n such that

la-6 I >4/n . (9.9)

Page 211: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

198 Caludc

l a - q ( m ) If lb-bg(m) I I 2/m < Iq(m)-b&n) I 9

we obtain the equivalence

a < b * =l [m) < bg(m) * (9.11)

Since the righeside condition of (9.11) can be effectively checked, we have fmished the proof.

B

If in the hypothesis of Theorem (9.4) we drop the condition a * b , then the proof given above fails, since n may not exist. In fact, in this case no proof can exist, as the following result asserts.

(9.6) Theorem. (RICE !1954]) The problem whether a limit of a r.e. sequence, which recursively converges, is or is not equal to aero is undecid- able.

Proof. For the sake of a contradiction assume that there exists an effec- tive general method to solve the above problem.

that the r.e. sequence of rational numbers Let f : N -. (0,l) be an arbitrary recursive predicate and notice

f ( O ) , f (O)+ f ( l ) / W O ) + f (1)/2+ f (2)/49... (9.12)

is recursively convergent. Moreover, the sequence (9.12) has the limit 0 iff range(f) = ( 0 ) . Consequently, from our initial assumption, we derive the decidability of the problem of testing whether or not the range of an arbi- trary recursive predicate is equal to {O}. We shall prove that this is false. For, let h : N -. N be an arbitrary recursive function whose range is not recursive. Define the recursive function H:H -+ N by

H ( Z , Y ) = 1 lY-h(4 I 9 (9.13)

for all naturals z and y. By an 8-m-n construction we get a recursive function g :lV -.* N satisfying the equation

In view of (9.13), for every natural y ,

Since for every natural y , b,,(,) is a recursive predicate, we deduce the recursiveness of range(h), a contradiction.

3

Page 212: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 199

(9.6) Corollary. The problem whether or not two arbitrary recursive real numbers are equal is undecidable.

Proof. The decidability of the equality between two arbitrary recursive real numbers implies the decidability of the problem analyzed in Theorem (9.5).

0

Remark. Corollary (9.6) holds even in case one of the recursive reals is rational and fmed.

(9.7) Definition. (SMULLYAN [196l\) Two r.e. sets A and B are said to be recursively separable if we can find a recursive set C such that

A C C and B n C = q 7 . (9.15)

Remark. If A and B are two disjoint r.e. sets which cannot be recur- sively separated, then none of them ia recursive. For, if A were recursive, then A and E would be recursively separated by means of the recursive set C = A.

(9.8) Theorem. (SMULLYAN (19611) There exists a pair of disjoint r.e. sets which cannot be recursively separated.

Proof. We consider the acceptable giideliration (w,,),, Lo and we put

A = { z E N ( w , ( z ) = O ) , B = ( Z E N I W , ( Z ) = l } . We shall prove that the disjoint r.e. sets A and E cannot be recursively separated.

We use Theorem (5.14) to get a recursive function f :N 4 IV for which

Wi = dom(wi) = range(wf(i)) , for every natural i .

Defme the p.r. function q :N3 3 N by the formula

Page 213: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

200

q(i,j,z) =

Calude

‘I , if for some n EN, w I(il(n)= z , and

for ail rn <n, from nf(jl(m)<nf(i)(n)

we have ~ , ( ~ ) ( m ) f z,

i f for some n e N , ~ ! ( ~ ) ( n ) = z and

for ail m <n, from R,(i~(m)<flf(,)(n)

we have w ft,,(m) f z,

G O ,

,x , otherwise.

(9.9) Theorem. (CEITIN [1962]) The problem whether an arbitrary recursive real number a is positive is undecidable.

Proof. Let A and B be two disjoint r.e. sets which cannot be recursively separated (Theorem (9.8)). Let A = range(!) and B = range(g), where j,g:RV + N are two recursive functions.

We construct the recursive predicates F,G :nU2 - ( O , l } , by

1 , if f (n) = rn , , otherwise,

and

1 , if g(n) = n ,

Defme, for every natural m, the recursive real number a, by

By an 8-m-n construction we get a recursive function g : N 2 - N which satisfies the equation

dg(i,j)(s) = v ( i , j t z ) . We continue the proof by assuming, for the sake of a contradiction,

the existence of a recursive C = Wi satisfying (9.15). Let j be an index of the r.e. set LV - C .

We shall prove the contradictory relation:

g( i , j ) C u ( N - C ) = N . For example, assume - again by contradiction - that g ( i , j ) E C = Wi.

In view of the definition of q , we have:

4,,(,,,)b(i,j)j = d i , j , g ( i , j ) ) = 1 a

So, g( i , j ) E B . We have arrived at a contradiction since B n C = (%.

Page 214: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 201

X

a, = x(G(m,n)-F(m,n))2” . n 4

Assume, by contradiction, that the problem in the statement of the theorem is decidable. We shall apply it to the recursive real numbers (Q,,,),,,~,, to show that the sets A and B can be recursively separated by means of the recursive set

C = (m E RV (a, <_ 0 ) . Clearly, if m E A, then a, < 0, so n E C. On the other hand, if

m E B, then a, > 0, i.e. m C. We have arrived at a contradiction. 0

Let us take an arbitrary recursive real. If the number is rational, then it has a recursive decimal expansion. In the opposite case we can recursively determine every digit of its decimal expansion (by computing it with sufficient accuracy, i.e. by computing a sufficient number of terms in the sequence of rational numbers which recursively converges to it). Since every recursive real number either is or is not rational, we conclude that every recursive real number has a recursive decimal expansion. It is natural to ask if th is procedure can be made effective. The answer is negative. For, if we could compute a decimal expansion:

a

a = n + Cg(t)-10++’) , 6 4

for every recursive real number a , then, by testing whether n 5 -1 or n 2 0 , we would decide whether a 5 0 or a 2 0, thus contradicting Theorem (9.9).

2.10. HISTORY

EUCLID and AL-KHOREZMI gave the fvst examples of algorithms, whereas DEDEKIND !1888l and PEANO [1889] have been the fvst to use functions defmed by induction. The foundational problems arising from CANTOR’S development of the set theory have led to an increasing interest in the notion of algorithm. Some forms close to the modern use of this notion can be found in BOREL [1912] and WEYL [1921].

GODEL [1934], on a suggestion of HERBRAND, gave an equatibnal

Page 215: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

202 Calude

defmition of the “general recursive functions”. Beginning with 1930, vari- ous equivalent defmitions of p.r. functions were given: CHURCH [1932], 19331, TURING 119361, POST !1936], [1943], KLEENE 119361, MARKOV 19511, SMULLYAN [198ll, SHEPHERDSON and STURGIS [1983], MACHTEY 119721 (see in this respect, KLEENE [1981]).

The arithmetisation of the computation of SUDAN’S function was taken from BUZETEANU and DIMA f19831. The equational characteriza- tion of p.r. functions is mainly due to KLEENE [1952]; our approach was motivated by ROGERS !1967] and BLUM [1967a]. The material concern- ing the GODEL numberings is essentially due to WAGNER [1969] and STRONG [196S\. ROGERS’ Isomorphism Theorem proof was suggested by LMACHTEY and YOUNG [I9781 and MALITZ [1979).

The material concerning r.e. sets and undecidability results is stan- dard. The independence results are due to HARTMANIS and HOP- CROFT [1978], CALUDE and PAUN [1983], CALUDE [1983a]; see also JOSEPH and YOUNG [1981] (which also contains a good related bibliogra-

The uniformity results are standard (see in this respect ROGERS 19671). The non-uniform operation A -. A3 comes from CALUDE 1983bl.

The basic papers on effective operators are MYHILL and SHEPHERDSON [1955], KREISEL, LACOMBE and SHOENFIELD [1959], LACHLAN (19641. See ROGERS [1987] and SCHNORR (19741 for related results. Some pathological results may be found in HELM 119711.

The recursive reale were introduced by TURING [1936]; RICE I19541 is a standard reference. See also MINSKY [1967] and MARTIN-LOF 1970’1. In this respect it is worth noticing the results in BOREL [1912].

The fundamental reference in the field is ROGERS [1987]. There are good texts in recursive function theory: KLEENE [19521, PETER 1957!, DAVIS (19581, MARKOV [19Sl], HERMES 1191351, MINSKY [1967],

YASUHARA ;1971], AZRA and JAULIN [1973], BRAINERD and LANDWEBER’ ;1974!, SCHNORR (19741, HENNIE [1977], MANIN [1977], MACHTEY and YOUNG [1978]; EILENBERG and ELGOT [1970], BRAINERD and LANDWEBER [1974] and, especially, MACHTEY and YOUNG (19781 deal with recursive string-functions. See also the presenta- tions in ENDERTON [1977], and USPENSKY and SEMENOV [1981\.

phy).

Page 216: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2

2.11. EXERCISES AND PROBLEMS

1 , if a consecutive run of at

least z 5’s occurs in the

203

0 , otherwise,

a) Is 4 a p.r. function? b) (Open) (this is actually FERMAT’s conjecture) Is + nowhere

(11.3) Let f:N -+ (0 , l ) be the predicate defined by

if there exists a prime p >z such that p+2 is also prime,

defmed?

1

0 , otherwise.

a) Is f recursive? b) (Open) (this is actually the “twin prime conjecture”) Is f a con-

stant function?

(GOLDBACH’s conjecture: “Every even number greater than 2 is the sum of two primes”.)

Compare the results with Example (1.1).

(11.2) (MANIN 11977)) Consider the partial function 4:IV 3LV defmed, in conjunction with FERMAT’s greatest problem, as follows:

Page 217: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

204 Caludc

Section 2.2

(1 1.4) Prove the recursiveness of the ACKERMANN-PETER and RITCHLE functions using the method developed in Section 2.2.

Section 2.3

(11.5) Develop a suitable arithmetization of formal equations for which a “global injectivity” holds (see in this respect the Remarks preced- ing Example (3.17)).

(11.8) Construct a primitive recursive function funcornp:N3 + N satisfying the equation,

(11.7) Show that KLEENE’s predicate T(j,z,y) = Der(j ,z,y).GN(j) works with p ( z ) = uol(L(ezp(long(z),z))).

Section 2.4

(11.8) (MACHTEY and YOUNG [1978]) a) Show the existence of a primitive recursive function S : N “ + ~ - JV, m 2 1, such that for all naturals i , z ,,..., z,, y 1 ,..., yn and n 2 1,

LJ s(n,n,m,zl, In) ..., zm)(y t t * . . , ~ n ) = w jmtn)(Z1,...,Zrn,yl,...,~n) *

b) Prove that a can be arranged to be independent of n.

(11.9) Assume that (bi) is an acceptable gGdelization. Prove that for every p.r. function tj:m 3 N we can effectively fmd a natural m such that for each t E IV we have:

4 m ( Z ) = J(+(z),m) *

(11.10) Let (#i) be an acceptable gGdeliiation. Prove the existence of a padding function p:NZ -. N for which p ( i , z ) 2 max ( i , z ) , for all i and x.

Section 2.5

(11.11) Show that in case A c JV is r.e., then so is U W,.

(11.12) (ROGERS !19671) Let A c N be a recursive set. Is U D,

Z € A

2 6 4

recursive? (11.13) Prove that the following statements are equivalent: a ) The aet

A c JV is recursive and non-empty, b) There exists a recursive function

Page 218: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 2 205

f :N + Bv such that A = range( f ), and f is non-decreasing (i.e. for all z and y in N, if z < y, then f (z) 5 f (y)).

(11.14) (DEKKER (19531) A set A C QV is immune if it is infmite and contains no infinite r.e. subset.

a) Show that immune sets do exist. b) Show that there exist sets A C N such that both A and PI - A

(11.15) In each of the following cases check the existence of a natural

a) W, = IV - {n},

b) W,, = {z EQV l h ( z ) = 4, c) W,, = { f (n)}, for some fured recursive function f :PI -+ N.

are immune.

n having the specified property:

Section 2.6

(11.16) (ROGERS 119671) Show the existence of a recursive function f :RV -#Bv whose set of fued-points (in the sense of the Recursion Theorem) is not r.e.

(11.17) Consider the following sets:

A , = ( n E N I W , i s f i n i t e } , A2 = (n E RV (W, is primitive recursive }

A, = (n E KV I“,, is not recursive }

Which of the above sets are actually index sets?

problems for known undecidable problems.

,

(11.18) Find (as simple as possible) concrete examples of independent

Section 2.1

(11.19) a) Give “uniform” versions of Propositions (4.8). and (4.9); b) Check the uniformity of Exercise (11.13).

(11.20) (ROGERS 119671) Show that there is no p.r. function $:N A N such that if W, is finite, then $(z) # 34 dyz) is a 0-1 valued function and W, = (y E RV Id+)(y) = 1).

(11.21) Give an exampk of a non-uniform operation satisfying appropriate conditions of the type (7.20) and (7.21).

Page 219: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

206 Calude

Section 2.8

valued } is not r.e. (11.22) (ROGERS [1967]) Show that the set {z E JV (W, ia single-

(11.23) Let _F,,&:2” -+ 2” be two enumeration operators. Defrne

c1(E2(A)),(El+g2)(A) = E,(A) U Ez(A), E , f ( A ) = U E V ) (where

- - the following three operators: (Elogz)(Af =

Y2

n =I F ! - - 1 = F,,g:+‘ - = Flog:). - Prove that &o&, - &+&, and FT - are enumeration operators.

Section 2.9

(11.24) Show that the operations of addition and multiplication of

(11.25) The notion of recursive real can be weakened to primitive recursive real if primitive recursive functions are used instead of recursive functions. Check the validity of Theorem (9.5) for primitive recursive reals.

recursive reals are uniform.

Addit ional exercise (11.26) Let X = {al,..+}, p 2 1, be a fmite alphabet. We extend

the operations of X-primitive recursion and functional composition to par- tial string-functions, and we define the operation of minimization over (aj}* ( 1 <_ j 5 p) as follows: from the total string-function o:(X*)n+’ + X , n 2 1, we construct the partial function $:(X*)n ax* given by d~(z~,..,,z,) = aj ’ =’I. The set of partial recursive string-functions is the smallest set of partial string-functions which con- tains the base string-functions (Succf, Ct, p;“), and which is closed under X-primitive recursion, functional composition and minimization over (aj}*,

a) Show that every primitive recursive string-function is partial

b) Prove that Exercise (1.10.27) works too when replacing “primitive

$mid=L, . . ,s ,am)

1 . L i s p .

recursive. Does the converse ‘mplication hold?

recursive” by “partial recursive”.

Remark. According to Exercise (11.26), a p.r. string-function 6:X* ax’ will be shortly denoted “px. function”. This terminology applies also in case of partial functions # : A a B , where A,B f { ~ , . X * , N X X * , N - {O},P,(X*)}.

Page 220: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

207

CHAPTER 3

8. BLUM’S COMPLEXITY THEORY

In this chapter we study the computational complexity of algorithmi- cally computable functions in terms of the algorithms needed to compute them. To this aim we use the axiomatic system due to M. BLUM.

It should be emphasized that in this approach the input/output processes do not contribute to the computational complexity measures; the complexity of these processes will be analysed in the next chapter.

&I. EXAMPLES

The present section is focused on questions of the type “how many steps are needed to compute...?”, with respect to the time-complexity.

Recall that (w i)i >,, is the acceptable gGdelisatioh of unary p.r. func- tions induced by the arithmetisation of formal equations (see Section 2.3), and that (Qi)i2a is a sequence of p.r. functions satisfying the following two conditions:

For every natural number i, dom(wi) = dom(Ri) . The predicate M : N 3 -+ {O,l},

(1.1)

(1.21

defmed for all i,z and y in QV by

1 , ifni(z) < _ Y 9

M(i,z,y) = i 0 , otherwise,

ia (primitive) recursive (see Theorem (2.3.27)).

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

Page 221: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

208 Calude

computation eventually halts.

defmed by We give a "time-relativization" of the function d i a g : N - N

1 , i f w , ( z ) f x,

diag(z) = i 0 , otherwise,

for every t in IN, namely the function f , :N + RV defined for every natural number t by

1 9 i fn* ( t ) I d.1 1

where r :hT -- RV is a fmed recursive function. The function diag is not recursive (Theorem (2.5.3)), while f, is

recursive (because f,(z) = M(z,z,r(z)), for every z in RV). Hence, a natural question may be raised: How many steps are necessary to compute f,? We begin with a lower bound.

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

for infmitely many natural numbers 2 .

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

0 7 if fr(z) = 0 7

x' , otherwise, d(2) =

for every t in RV. Let k be an index for q5 in the enumeration (wi) such that

n k ( z ) = nj (Z ) 9

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

4 = w , 1 (1.3)

n"(Z) = n,(z) 7 (1.4)

for every z such that n,(z) > r ( t ) .

Two cases must be analyced according to the relation between no(()

Page 222: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 209

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 f,(t) = 0. Since t > n , fl,(t) < r( t ) . In view of the hypothesis and of the construction of k and ! we Again we reach a contradiction.

Remark. Theorem (1.1) furnishes intrinsically require a large amount

have: r(!) > a,(!) = n,( t ) = $I,([).

examples of recursive functions which of computation time. In particular, if

r b not primitive recursive, then f, cannot be primitive recursive.

(1.2) Definition. (YAMADA [1962]) A recursive function f :N --c N is said to be real-time computable if there exist two naturals i , j such that f = w and for each z 2 j,

n,(Z) 5 z a

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

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

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

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

1 , ifn,(.)s Z 9

M ( z , z , z ) = i 0 , otherwise.

To obtain an upper bound on the number of steps which are neces- sary to compute f, we fm an index j for r .

(1.6) Theorem. g:nv?

There exist two recursive functions 8 :N --c N and IV such that f,(z) = u,(,)(z), for every t in N , and

Page 223: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

2 10 Cllude

for every z 2 j.

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

r ; ( i l ( z ) 9 if ni(z) I Y 9

t(z,i,l/) = 0 otherwise.

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

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 thb series of examples with a general negative result follow- ing from Theorem (1.1).

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

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

H ( z ) = b ( z , O ) + b(z,l) , for every natural number z.

have For every recursive predicate wi and for every natural number z, we

ni (z ) I b(z,wi(z)) I H ( z ) *

We get the desired contradiction if we take w i = fSuccoH, as in Theorem

0

(1.1).

Page 224: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 211

8.2. BLUM SPACES

This section introduces the BLUM general axiomatics for the quanti- tative study of computational complexity and gives the introductory results.

In Section 3.1 we have obtained some “asymptotic evaluations” for the time-complexity of certain recursive functions which bear a resem- blance to non-computable functions. These complexity-theoretic results can be obtained, in a general manner, using the axiomatics proposed by M. BLUM.

(2.1) Definition. (BLUM [1967a]) A BLUM space is a couple 2 = ((#i),(*i)), where (di)ilo is an acceptable gGdelisation of all unary p.r. functions and (9i)ilo is a sequence of p.r. functions satisfying the fol- lowing two axioms (called BLUM aziorne):

For every natural number i, dom(bi) = dom(ai) . (2.1)

(2.2)

1 7 if*i(z) L Y , The predicate M : N 3 + {O,l}, defined by

M(i,z,y) = i 0 , for all i, z and y in A?, is recursive.

BLUM [1967a] calls the p.r. functions ai, satisfying axioms (2.1) and (2.2), etep-counting functions or, Computational complezity meaeuree; the predicate M is called a measure of cornputation.

It should be emphasized that the stepcounting functions are associ- ated 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 effec- tive computation of a p.r. function deals with some algorithm specifying that function. Later, we shall see that complexity-theoretic studies provide a decisiie argument in this direction by showing that the complexity of a p.r. function cannot be defined as the complexity of its “best” algorithm since there are certain p.r. functions having no “best” algorithm.

Axiom (2.1) says that we get a value of the stepcounting function iff the computation of the corresponding algorithm produces a value for the p.r. function being computed. Axiom (2.2) expresses the possibility to determine if a particular computation halts within a certain bound.

An an immediate consequence of axiom (2.2) we deduce that the ter- nary predicates “ai(.) < y”, “@i(z) = y”, and “*i(z) > y” are rccur- sive. Furthermore, for all natural numbers i, 2, @i(z) = miff (@i(z) > y,

Page 225: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

212 Cdudc

for every y 2 0) .

(2.2) Example. example of BLUM space ((wi),(ni)).

The time-complexity R i associated to w i is our basic

0

(2.3) Example. Every acceptable giidelisation (c$~) can be equipped with a set of step-counting functions by means of the time-complexity (n,) and ROGERS' Isomorphism Theorem, i.e. by defining for all i and z in N,

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

where t : N -. fV is a bijective recursive function which ties (4,) and

0

(wi):bi = "+).

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

3

Remark. Some related examples of BLUM spaces are the number of .U.,GOL instruction executions, the amount of space used for the execution of ALGOL programs, etc.

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

a;(.), if i f i , ,

i f i = i,,

where i , is a fixed index for some recursive function. It is seen that @ = ((si),(i,)) is also a BLUM space.

0

Page 226: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 213

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

I I.''

Oi,(Z) = 2 } 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 con- ditions:

The function f is strictly increasing. (2.3)

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

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

In view of (2.3) the range of f is recursive and the equation Q j = 9g(i)*

f ( 2 ) = i has at most a solution, for each fued i . We put t$g(j)(z) , if i = f ( j ) , for some j in N ,

'i(') = i Oi(z) , otherwise,

for all i and z in N.

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

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

Page 227: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

214 Cdude

(2.8) Example. Let (di) be an acceptable gGdeliration. The p.r. func- tions 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 axiom are indepcn- dent.

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

a =O

for ail natural numbers i, z and y.

U

The next result gives a method, based on the minimization operator, for recognizing when a given sequence of p.r. functions is a sequence of stepcounting functions for some acceptable gGdeliaation.

(2.10) Proposit ion. 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 predi- cate 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 8 - = ((4),(4,)) by the-defmition

Page 228: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 215

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

for all natural numbers i and Z .

Indeed, for all i and z in N,

&i-(z) = CCY[R(~ ,~ ,Y ) = 11 9

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

~ ( i v z = 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 (2.6)

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

Proof. KLEENE's Normal-Form Theorem furnishes the recursive func- tions p : N + N, T:N3 --+ (0,l) such that for all i and z in N,

Wi(z) = P(PY[T(~,~,Y) = 11)

a,(.) = ~ ~ [ T ( t ( i ) , z , y ) = 11

(2.7)

For every acceptable g6delisation (si) we put

9

where t : N + RV ia a recursive bijection, supplied by ROGERS' Isomor- phism Theorem, satisfying the equation 4i = w t ( i ) .

In view of Proposition (2.10), 9 - is a BLUM space; formula (2.6) fol- lows directly from (2.7).

0

Fix an acceptable 86delization (4i). For all computational complex- ity meaeares (ai) and (+i)lfor (4i), we defrne two sequences of p.r. func- tbns (ei Q&i) and (aj @Oi) 811 €allows:

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

(4i O&i)(z) = mu(ai(z),ei(z)) , (2.9)

for all i and z in N.

Page 229: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

216 Caludc

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

Proof. First we prove that ((4i),(ai Qdi)) and (f4i),(ai 04,)) are BLUM spaces. From Proposition (2.10) there exist two recursive predi- cates R, R:N3 -* (0,lj satisfying the equalities

a,(.) = P Y [ R ( ~ , ~ , u ) = 11 9

i i ( 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, Oii)(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) = max(R(i ,z ,Y) .dg(~~( i ,z , t ) ) ,

%i 3 2 $3 ).88(r5 R(i,z ,m *

t 4

t 4

Since condition (2.1) is obviously fulfilled, we can apply Proposition (2.10) to decide that Q and @are internal operations. Furthermore, from (2.8) and (2.9) it follows that the operations Q a n d @satisfy the axioms of a distributive lattice.

We fmish the proof by showing that the resulting lattice has neither a maximum nor a minimum (with respect to the induced order i.e. (ai) <(4i) iff Oi(z) 5 8i(z), for all i and z in N). The first assertion (the lattice hss no maximum) follows directly from Example (2.9) by tak- ing f to be strictly increasing. Hence, we have to check the existence of a minimum. We prove the following:

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

@i(z) 2 g( i ,z ) 9 (2.10)

a:(,) = ai(z) A g ( i , z ) , (2.11)

for all natural numbers i and z, then the sequence (a:),

is a computational complexity measure for (&). Indeed, if for all i and z

Page 230: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 217

we have

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

@I(.) = rY[R(i,z,g(i,z)+Y) = 11

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

, for all natural numbers i and z, which shows that the axiom (2.2) holds; obviously (2.1) holds too.

For the consistency of the Intermediate step we need an example of a recursive function g satisfying (2.10). To this aim we associate to every recursive function f :N -+ IV the recursive function gf :nV2 - N given by

@i(z) 9 if +i(z) I f (2) 9

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

Clearly, gf works. Now let (a,.) be an arbitrary computational complexity measure and

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

1 , if z E dom(di) ,

would solve the Halting Problem). 0

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

a,(.) = g(i ,z) , (2.12)

for all i and z in N such that z E dom(di).

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

0

Page 231: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

218 Cdudc

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

@i(z) < f (z ) (2.13)

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

0

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

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

y+l , if i = i , and z = I , ,

g ( i 9 z 7 y ) = i y , otherwise. (2.14)

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

&i(z) = g ( i , z , a i ( z ) ) . Furthermore, &i(z) 2 4i(z), for all i and z in N, and, by (2.141,

8i,(zo) = Qi,(zo) + 1 7

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

0

11.8. RECURSIVE DEPENDENCE OF COMPLEXITY MEAS URES

The pathological examples of BLUM spaces discussed in Section 3.2

Page 232: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 219

lead to the question whether any interesting consequences can follow from BLUM’s axiomatic defmition of computational complexity. The present section is dealing with such a result. We show that all computational com- plexity measures are ‘‘aeymptotically the same” within some recursive fac- tor. In other words, if a function can be “easily” computed with respect to a certain computational measure, then it can be “easily” computed, modulo some recursive factor, in all measures.

We begin with the announced result.

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

2 h(z,&i(z)) 9 ( 3 4 and

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

Ciearly, for every z 2 i , we have:

Remarke. a) If h satisfies the statement of Theorem (3.1), and f:N -., RV is a

strictly increasing recursive function, then the recursive function H = f o b also works.

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

Page 233: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

220 Cduda

evaluation is specific to this axiomatic approach. c) An a consequence of Theorem (3.1), we notice that the computa-

tional complexity of any class of recursive functions which is recursively bounded in one measure (for example, by polynomials) is recursively bounded in every measure.

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

(a.2) Scholium. Let 2 = ((di),(ai)) and 4 = ((di),(&,)) be two BLUM spaces such that for naturals i and z, ai(z) 2 z, and bi(z) 2 2.

Then there exists a recursive function g : N -P N such that for all natur- ah i and 2 , if z 2 i , then

+,(2) L g i i i ( z ) ) 7 (3.3)

I g(ai(z)) - (3.4)

and

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

0

Remar ke.

a) The quite realistic hypothesis @i(z) 2 z requires that the step- counting function increases with the input size. Although this condition can be easily realized, there exist infmitely many BLUM spaces which fail to satisfy it (see in this respect the proof to Theorem (2.12)).

b) A minor modification in the above proof shows that Scholium (3.2) equally holds if we replace the condition a,(.) 2 z by a,(.) 2 f (z ) , where f is an increasing recursive function (for example, f(z) = [log2z]).

Notation. We shall often prove statements which hold for all but finitely many natural numbers z (almost everywhere) or for infrnitely many z.

Hence, we introduce abbreviations: a) If the statement S, involving the variable z, holds for all but finitely many z, then we shall write “S(z) u.c.”; b) If the statement S holds for infmitely many z, then we shall write “S(z) i.0.”.

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

Page 234: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 22 1

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

@i = 4d(i) * (3.5)

Proof. Let w :w 3 N be the p.r. function given by

w ( i , z ) = rar[R(i,z,ar) = 11 , for all i and 2 in N (here R is the recursive predicate which comes from Proposition (2.10)).

A n 8-m-n construction produces the required recursive function d which satisfies the statement:

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

for all i and z in IN.

Remark. The recursive function d in Proposition (3.3) is not surjective (see Remark b) following Proposition (2.10)).

(8.4) Proposition. Let Q be a BLUM space, and let r : N -* RV be a recursive function, Then the re exists a recursive function f :N -* N such that for every natural number i with f = di we have

a,(.) > r(z) i.0. ( 3 4

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

4 h ( Z ) k ) + 1 9 if @h(r)(Z) I P

f ( z ) = i 0 , otherwise,

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

Now let f = dj, for some natural j. We have:

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

a j ( i ) = > r ( i ) i.0.

0

Page 235: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

222 Cdude

f (a) = '

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

I

0 , = 1 and k = pm!(m<n)

A (0, (ra ) <F(n)) A (for every t < n , if Q , ( t ) L F ( t ) , then f ( t ) = &,(t))l1

1 , otherwise, \

(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)

for some index j for f.

Page 236: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 223

Claim I. There exists an infmity of natural numbers n > j such that ~ ( n ) # cq and ~ ( n ) 5 j .

To prove Claim 1 we consider the infmite set

Nj = {m E RV Irn > j and Qj(rn) 5 F(m)} , and we notice that every element of Nj satisfies the required properties (since f = dj).

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

Finally, let n be such that ~ ( n ) = j and notice that

a contradiction.

Remsr ks.

a) Theorem (3.5) shows that from the fact that a recursive function is dificult to compute we cannot infer that it is large.

b) A simpler argument suffices to prove the existence of arbitrarily complex recursive functions. Indeed, the function f :RV + RV defmed, for every z in N, by

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

works, since in case Oi(z) 5 F ( z ) , for some z 2 i, then for the smallest such 2, f(z) 2 di(~) + 1 > +;(.)a

Theorem (1.6) can now be extended to all BLUM spaces.

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

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

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

0

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

Page 237: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

224 Caludc

“complexity” and “sire”.

(8.7) Theorem. For every BLUM space 9 - there exists a recursive func- tion b :fl --c N such that for every a ,

4i(z) I ‘(z,*i(z)) (3.9)

Proof. Let a :JV3 --+ N be the recursive function given by

b i ( z ) if = Y t

.(;,.,Y) = i 0 , otherwise.

The recursive bound b can be defmed by

b(z,ar) = max(a(i,z,v) 1; 52) , for all t and y.

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

‘(z,@i(z)) <_ a(icz,@i(z)) = bi(z) . 0

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

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

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

Proof. We define the auxiliary recursive function p:Nb -. JV by

+,(;,j)(z) , if a,(%) = y and Q j ( z ) = z , P ( i , j , Z , Y , Z ) = i 0 , otherwise.

Then we apply a maximiation to obtain h:

h(z,ar,z) = m=(p(i,j,z,y,z) Ii,j 5.1 .

Page 238: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 225

(8.9) Example. There exists a recursive function c:N3 + N such that for all i and j

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

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

0

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

Qll = *i 4 . (3.10)

Proof. Consider the KLEENE Normal-Form Theorem and write for all i and z,

di(z) = ~ ( ~ ~ [ T ( t ( i ) , z , y ) = 11) 9

where t : N -+ N is a recursive bijection given by ROGERS' Ieomorphism Theorem (di = uqi)).

Recall that for all i , z, and y,

1 , if $Ii(.) 5 ezp (O,y+l) and T( i , z , y ) = ui(z) = ezp( l , y+1) , (3.11) l 0 , otherwise,

and put

Qi(z) = ~ ~ ( T ( t ( i ) , z , y ) = 11 9

(3.12)

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

1 , if 4,%) 5 Y ,

But,

M*( i , z , v ) = 1 w (a,(.) 5 3'+' and ai(z) Adi(z) I y) , since, by (3.11), if z E dom(bi) and Oi(z) > 3'+', then

Page 239: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

226 Calude

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

a.4. COMPLEXITY CLASSES

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

Fix a BLUM space (p - = ((di),(Qi)).

(4.1) Definition. and MEYER [1969]) Let

(HARTMANIS and STEARNS (196S]; McCREIGHT

f : N - + N ,

be a recursive function. The complezity elass of f is

Cp = {g E R 1 there exists an i such that ( 4 4

g = bi and ai(z) 5 f (z) a.e.}

The recursive function f is called a name of the complexity class. Intuitively, a complexity class Cp is the class of all recursive func-

tions which have at least an algorithm of evaluation whose computational complexity is bounded by f . Some further explanations turn to be useful.

.

Comments.

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

Page 240: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 227

@i(z) > g(2) * (4.2)

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

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

for all z and y. By an 8-m-n construction we get the recursive function s : N + nV satisfying the equation

(”” 1 if @&) > g b ) 9

h(y,z) = d,(,)(Z) - The Recursion Theorem furnishes a fied-point i of 8, di = d,<q, which is the desired index. Indeed, if for some z, ai(z) 5 g(z), then di(z) = d,(il(z) = l+di(z), a contradiction. So, for all z, @;(z) > g(z), which ensures that t$i = f .

b) The “almost all” condition is consistent with the bounding proper- ties of ACKERMANN-PETER and SUDAN functions and with the recur- sive dependence among complexity measures. Furthermore, the Speed-Up results (which will be presented in the next section) hold for aU but finitely many arguments.

Remark. From Theorem (3.5) it follows that there is no recursive func- tion f : N + N satisfying the equality Cp = R (or, Cp = R.J .

Notation. When it causes no confusion we shall simply write C, instead of cp. (4.2) Lemma. For every recursive function f:N -+ JV there exists a recursive function g : N 4 N such that

C c, # c, . (4.3)

Proof. By Theorem (3.5) we find a recursive function F:N -+ N such that for every index i for F, @i(z) > f ( z ) 0.c.

Let i be an index for F, and define the recursive function g by g = @i. Clearly, C, c C, and F

0

Thus starting with a recursive function we can construct a new com- plexity claas which ia a strict enlargement of the first class, and thia pro- cess continues indefinitely. We may ask whether we can construct uni- formly larger and larger complexity classes.

C,. To fmish, notice that F E C,.

Page 241: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

228 Calude

(4.8) Theorem. There exist two recursive functions h : N 2 + N and t :fi -+ N such that for every recursive function f : N + N and every index i for f we have

h(i) p c, and 6t(i) E clo(pI'),o;) - (4.4)

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

d r ( z ) ( z ) + 1 9 if @ r ( z ) ( z ) I di(z) 9

otherwise.

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

and

a contradiction! To construct the recursive function h we use the constant function

Cd2)(z,y) = k, for all z and y; here k is an arbitrary index for dt(;). In view of Proposition (3.8) there exists a recursive function h*:N3 -+ N such that for all z and y ,

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

In particular, if z = y = i , then

~ k ( n ) = +cp)(,,;fin) I h*(a,+i(n),+i(n)) a-e.

Finally, put

h(z,y) = h.(z,y,y) , (4.5)

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

0

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

Page 242: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 229

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

dt(i) E C/ and dt(i) E C H ~ O ; * (4.8)

Proof. We use the proof of Theorem (4.3) before the formula (4.5) which ia to be replaced by

H ( z ) = h * ( Z , Z , Z ) , for all 2.

0

(4.6) Corollary. P : N 4 PI such that for every recursive function d, ,

There exist two recursive functions p : @ - N and

C

c,i + cpo(Pt'),*i) '

and, in case ai(z) 2 z, for all z, C

c,; f G O O i * (4.7)

Proof. Let h:w -P N be the recursive function furnished by Theorem (4.3), and put

P ( Z , Y ) = 2 * (z*w)+* , P ( 2 ) = p(z,z) , for all z and y.

0

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

,- L

Chi # coo,; 9

for all sufficiently large recursive functions die In other words, if we replace the complexity ai by +it then the formula (4.7) fails to hold, for every recursive function P.

(4.6) Theorem. (Gap Theorem; TRAKHTENBROT [1967] and BORO- DIN [1969]) For every recursive function r:RV -P N such that t ( z ) 2 z, for all z, there exieta an increasing recursive function t :RV + RV such that

Page 243: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

2 30 Calude

c t = Crct - (4.8)

Proof. Defme the p.r. function t :PI N as follows:

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

where

m, = ptn [ for every i 5 2, either

O i ( z + l ) > r ( t ( z )+m) , or @;(z+l) 5 t ( z ) + m ] , for every 2.

Indeed, all predicates involved in the scope of the minimbation operator are recursive; we exam- ine only a finite number of conditions, and for every i < z there exist only two possibilities:

a) Oi(z+l) = zq and in this case Oi(z+1) > r ( t ( z )+m) , for every

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

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

First we show that t is in fact recursive.

rn, or

Oj(2) <_ ‘ ( t ( 2 ) ) U.C. , and, on the other hand,

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

0

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

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

Next we present a slight variation of the Gap Theorem together with a proof which can be easily generalired to obtain an Operator Gap Theorem.

Page 244: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 231

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

t ( z ) 2 a(.) 0.c. , (4.9)

and for all j and z with z > j ,

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

Proof. To defme t ( z ) we set

h t l = a(.) 9

t 2 = r(z $,-el)+ 1 9

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

Clearly, for every O < i 2 z + I , ti-, = r ( z , t i ) + l 2 ti+I > t i . So,

t o > t , >...> t, > f+ l . (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

ti < Oji(z) I r(z,ti) < ti-, . (4.13)

It follows that there exist 15 n < n 2 z+1 such that j, = in, for {ji li=1,2 ,..., z ,z+l} c { O , l , ..., z-1). We arrived 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).

Page 245: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

232 Calude

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

Ct = C r o(pf) , t l *

Only the inclusion Ct 3 Cr o(Pp~,t l must 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

e 8 . ' '

cP,,(z) = 2 } 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. ,

aj(z) 5 2'(") a.e.

and

Remark. The proof of Theorem (4.7) indicates a recursive bound of func- tion t size. Indeed, t ( z ) = ti < t o = r(z , t , )+I =

r(z,r(z,tz)+l)+l =...= r(z ,r(z , ..., r(z,a(z))+l)+.,.+l)+l)+l; here the symbol r appears (z+1) times.

(4.9) Corollary. Let 9 - = ((+i),(@i)) and 6 - = ((+i),(6i)) be two BLUM spaces such that

@i(z) < &i(z) 9 (4.14)

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

that Then we can effectively find a recureive function t :RV - N such

Page 246: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3

c $ = c t .

233

(4.15)

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

t(z) 2 a(.) 0.e. , where o : N -c N 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 satis- fies 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. , contradicts condition (4.10). Hence Cp C C$.

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 com- plexity 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.

Page 247: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

234 Calude

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

[ : P R - P R , 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

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

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

Assume that f :IN - nV is a recursive function satisfying the equa- tion

Graph(ET(di)) = U Graph(*j(j)) t

I Ec;

for all recursive di (see Theorem (2.8.27)); here Ci =

i j€oV !Graph(*,) C

P u t t (0 ) = a(0 ) and d o = 0.

At Stage z > 0 in the computation of t suppose that t ( z ) has been already defined for z < d,, where d , 2 x is a certain natural number which will be further effectively determined. This finite initial segment of t will be denoted by t ( ' ) , i.e. t ( ' ) : IN O I N is the p.r. function which is d e f - e d by

t ( z ) , for z < d , , X , otherwise, t"'(.) =

for all z .

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

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

where for every z ,

Page 248: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 235

t"'(2) = t ( z ) , for z < d, , rnax(a(z),t,(z-l)+I), for z 2 d, ,

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

t i ( Z ) =

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

lFJollF'l ,..., AJ, :I? 2% N ,

to(.) 9 if I d, , given by

I co, otherwise, do(.) =

and

t j ( z ) , for t <_A, , .Ji(t) = 00, otherwise,

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

and

A,+l = P [ Z 2 A, and Graph(*',) C U Graph(r/(,))] , Y a i , i

where Ba,i = {gem Iry(n) = ti+l(n), for every n 5 z } , for every i E {0, ..., z-I}.

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

F ( t ' ) ( z ) I ti-l(z)

for every z such that A, 5 z 5 A,.-1.

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

*'i(Z) < @j(z) 9 (4.16)

for ~ o m e t with A, 2 t 5 A,, and

Page 249: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

238 Calude

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

for all z' with A, 5 z' 5 A,-,.

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

To prove Claim 1 we notice that if d , is unsafe for j, then for all k < i, we have:

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

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

a j ( Z t ) 5 .'I(.') ,

fails to hold for every z' with A, 5 z' 5 Ah-,, thus ending the proof of Claim 1.

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

In view of Claim 1, for all z 2 1 and j < z, card{i 5 z Idi is safe for j } 2 z ,

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

We conclude with the following procedure for the step-by-step con- struction of t . Initially, t ( 0 ) = a(O), and d o = 0. For every z > 0, Stage L in the computation of t is the following:

1. Construct ( z + l ) recursive extensions t = , ..., t o of the finite p.r. function t( ' ) .

2. Construct the ( z+ l ) pairs of finite p.r. functions and natural

3. Find the least i , I z for which A', is safe for all j < 2.

numbers ( d,,A,), ...,( dt ,A, ).

4. Put t (%+') = 7r'i . 5 . Put d,+, = A0+1, and go to next stage.

Our procedure constructs a monotonous recuraive function t which grows faster than a , and has the following property: For all z and j , if z > j, the extension constructed at Stage z, i.e. t('+'), is safe for j . Thin means that either for every z' E dom(t('+')), a,(.') 5 t ( t ' ) or else, f ( t ) ( z ' ) < aj(t'), for some z' f dom(t('+')). It follows that when .

Page 250: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 237

t ( 2 ) < Oj(2) i .0. , we have

[ ( t ) ( z ) < Oj(z) i.0. , thus ending our proof.

0

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

(4.11) Theorem. that for all recursive functions di,

There exists a recursive function h:M 4 RV such

C

C@i # c h ( P p , * i ) *

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

4d(i)(Z) I if 4d(i)t2) = y ?

.(i,.,v) = 1 0 , otherwise,

for all i , z, and y. Notice that the totality of r follows from the recursive- ness of the ternary predicate gd( i ) (z ) = y (which is in fact @i(z) = y) and from the axiom (2.2).

The recursive function g:I@ +-N defined for all z and y by g(z,y) = l+max(r(j,z,y) l j 5 z), satisfies the inequality

g(zt@i(z)) > r ( i , z , @ i ( z ) ) = Qd(i)(Z) 9

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

C

= ‘ # d [ i ) ’ cpO(pp),@d(i$ cpO(Pp),#O(pp)8*,)) ’

So, the recursive function h :@ -+ N def ied by

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

for all z and y, works. 0

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

Page 251: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

238 Calude

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

(4.18) Example. The step-counting functions of a BLUM space form a measured set.

13

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

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

41(n) < i.#i(n) 9

x, otherwise. 1 7iCn) =

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

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

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

@

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

0

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

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

Clearly, the measured set (dh(, ,)) contains B . 3

Page 252: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 239

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

C

c7i + c”(Py.7i) *

More precisely, we can effectively find a recursive function k :pV + N such that for every recursive function ri, the following two properties hold:

If 4j = , then > ri(z) a.c. , (4.18)

@k( i ) ( z ) L h(z,ri(z)) 0.e. (4.19)

Proof. The recursive function k follows from an 8-m-n construction:

+yi)(z) = PY[Y # dj(z) 7 for all i L 2 with @j(z) I ri(z)] 9

for all i and z.

total, then t$h(i) is also total. It is seen that if ri(z) # co, then g k ( i ) ( ~ ) # CQ. Moreover, if ri is

h a m e now that we fu a recursive ri. If dt(i) = Qr, for some t , then for all J’ and z, z 2 j, @j(z) 5 ri(z)

So, at(.) > 7i(z) Q.C. (i.e. (4.18)); moreover, implies #k(i)(z) Z + j ( z ) . dk( i ) c,;.

We pass to the definition of h:

h ( z , ~ ) = m=(O,@L(j)(z) Irj(z) = Y $ and i I z) 1

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

h(z,ri(z)) = m=(@k(j)(Z) Irj(z) = Ti(%) and i 5.1 2 @k(i)(z) -

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

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

Page 253: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

240 Calude

&(&) = I

honest by MEYER and RITCHIE [19681.

di(z) , if (z <I) or (if z >y , then there exists t such that Oi(z)<g(z,z),

and z = di(z)) x, otherwise.

\

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

N, g :w

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

0

(4.22) Lemma.

functions is r.e.

functions, for a suitable recursive g.

a) For every recursive function g:M -+ lV the set of all g-honest

b) Every measured set can be embedded into the set of all g-honest

We shall prove that

!d,+) In 2 01 = { f E P J f = di, and ei(z) 5 g ( z , f ( z ) ) a.c., for some :} , where h : R 4 N is the recursive function def ied for all z by

h ( z ) = 8(K(Z)J (Z) ) *

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

To prove the converse inclusion we show that for every n,

Page 254: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 241

@ h ( n ) ( 4 Ig(z,h(n)(z)) ?

for every z 2 L(n). If dh(n)(Z) # x and E 2 L(n), then

Hence, dh(ts)(s) = +#(K(n)J.(a))(z) = 4K(n) (Z) , and @K(n)(z) 5 g(z,dK(n)(Z))*

= @K(n)(z)

I g(Ec+K(n)(z))

= g ( z d h ( n ) ( Z ) ) - b) If f : N + N is a recursive function and { 4 1 ( ~ ) In 2 0) is a meas-

ured set, then the Compression Theorem furnishes a recursive function h :hr? + N such that for every

@f( i ) ( z ) I h(z,df(i)(z)) a*c.

So, the recursive function g = h works. Is1

Remark. Though the notions of honest function and measured set are “almost the same” by Lemma (4.22), they are not exactly equivalent since an honest function may exist not in the measured set.

The Operator Gap Theorem says that there is no effective operator which, on the basis of a recursive bound, produces a larger recursive bound which allows us to run new algorithms. The Compression Theorem says that there ia such an uniform method provided we restrict our initial recursive bounds to a measured set. The next deep result asserts the existence of a fiied measured set which contains names for any complexity class. In view of Lemma (4.22), this means that there exists a fued binary recursive function g such that every complexity class can be named by a g-honest function.

(4.2a) Definition. A measured set 7;S said to be a elam determining for the BLUM space 9 if for every recursive function f :N -t N there exists a recursive function g : N + N in Tsuch that C, = C,.

Roughly speaking, Tis a class determining for 9 - if it is measured and contains a name for every complexity class in 2.

(4.24) Theorem. (Honesty Theorem; McCREIGHT and MEYER [1969]) Every BLUM space has a class determining set. Moreover, there exists a recursive function g : N + N such that for every total qje, #,(*I is also recursive and

Page 255: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

242 Cdudc

In other words, there exists a total effective operator

such that for every total 9,,

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

C

C*,(iJ + CQ, 1 *

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

The Compression Theorem gives us an index i , such that di2(z) = h ( z , d .I (z)), for all z, which ensures that

O(’11 C

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

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

5 w ( z ) a.e. w ai(z) 5 w * ( z ) 0.c. (4.20)

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

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

Page 256: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 243

Assume that e is an index for a given unary p.r. function w . We

1. Put queue(n) = n, z = K(n), y = t(n).

2. If Ge(z) # y, then go to step 6.

3. Put i = 0.

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

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

7. If there exists a natural number k 2 n having the following three

eancci(qucue(k)) = 1 , (4.21)

@ q W I . ( C ) ( 4 > I 9 (4.22)

display the Stage n in the computation of w *:

the next stage of computation.

properties:

for every j < k, i f cancel(queue(j)) = 0,

then @qwse(j)(z) I Y , (4.23)

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

8. Go to the next stage of computation. The following comments will ensure that the above procedure is

effective and eventually terminates. At any Stagen = 0,1,2, ... the pro- cedure assigns certain values to queue and cancel; so, the tests involving earlier values of these arrays are effective. The only problem can appear at step 4, since w may be undefmed at certain points. But, to arrive at step 4 we must pass the test in step 2, i.e. decide that Qe(z) = y < x. In view of BLUM axioms, in this case we have w ( z ) = #,(z) # x; sa, the test Gi(z) > w (2) can be effectively performed.

The condition in step 6 guarantees that w * ( z ) is well defmed. Finally, if for some 2 , w * ( z ) f x, then w * ( z ) is defmed at Stugen = Jfz,w*(z)). Consequently, to decide whether w * ( z ) = y, for arbitrarily given z and y, we must simply run the procedure until Stuge J(z,y); this shows that the graph of w is recursive. Furthermore, since the above procedure is uniform in w , it follows that the resulting set of p.r. functions is measured.

Next we pass to the proof of (4.20). Our proof will be by c u e s according to the “stability” of the involved index i with respect to queue (we say that i is stable if it reaches a fmal location in queue; in the con- trary, i ia unetable).

Fix an arbitrary i .

Page 257: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

244 Cdudc

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

ai(z) > w * ( z ) i.a.

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

* Oi(z) > ~ ( z ) i.0. , and this completes the proof in this case.

Case 2. (The index i is etable.) We shall prove the equivalences:

a,(.) <_ w ( z ) a.e. H i is stable

e a&) 5 /(z) a.e. (4.24)

We divide the proof into two subcases depending upon the value 0 or 1 when cancel(i) must ultimately stabilize.

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

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

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

~ , ( z ) 5 w * ( z ) 0.e.

Subcase 2.2. (cancel(i) stabilizes at 1.)

so, globally,

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

M = max(o,(z) /cancel( j) = 0 and for some k < m ,

Page 258: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 245

qucue(k) = j,queue(m) = i ) . It ia seen that in view of the analysis made at the preceding subcaee,

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

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

aj(z) > m = w * ( z ) , for certain j = queue(k) and i = queue(!) with k < t ; furthermore, since eancel( j ) = 0, we violate (4.23). Finally, we notice that W * cannot be defmed before Stage J(z,O), thus completing our argument.

Since the index i haa stabilised at StageJ(z,O), and eaneel( i ) is stable at 1, we deduce that (4.22) must fail to hold at Stage J ( z , M ) , i.e.

a,(.) 5 M 5 m i n ( W ( Z ) , W * ( Z ) ) . The above statement is based on a hypothesis which turns to hold almost everywhere, thus

a,(.) 5 w ( z ) a.e. , and

ai(z) <_ w * ( z ) a.e.

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

(4.25)

If 4j is total, then # g ( j ) is also total because if for some 2 ,

d#(j)(z) = then

#G(j)(.) > dj(z)+4j(z) 9

and the right-hand side of the inequality is fmite; remember, Graph(&(j)) is recursive.

Furthermore, the ternary predicates ~G(,,(z) = y, (Dj(z) = z , and dj(z)+(Dj(z) = y are obviouely recursive. So, the graph of dr(j) ia

Page 259: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

246 CJudt

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

a,(.) <_ de(2) a.e. * a,(.) I # v ( e ) ( z ) a.e* 1

thus showing the equality

&,(el * C*< = c

We shall use the relation (4.24) and the defmition (4.25). Assume that for every z 2 zo, (4.24) holds: in particular, ai(z) 5 d,(z), For such an z two possibilities may occur: a) el(^) 5 +,(z)+CP,(z), and in this

in this case Oi(z) 5 be(z) 5 ~ $ ~ ( z ) + a ~ ( z ) = dq(el(z). Conversely, if the equivalence (4.24) and the inequality a,(.) 5 I $ ~ ( ~ ) ( Z ) hold for every

Next we study the recursive enumerabitity of complexity classes. First we shall prove the existence of a BLUM space which has a non-r.e. complexity class.

case by (4.24)i *i(z) I ’#G(e)(z) = #p(e)(s); b) d ~ ( r ) ( z ) > + e ( z ) + # e ( z ) , and

2 20, then @if.) i bg(e)(z) 5 d G ( e ) ( z ) , hence +i(z) I 4e(s)*

(4.26) Theorem. (LEWIS [1971], LANDWEBER and ROBERTSON !1972)) For every recursive function f:oV + PJ there exists a BLUM space 9’ - (which depends upon f ) such that &F is not r.e. I

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

dij(z) = i 9 (4.28)

for all j’ and z. We defme now the step-counting functions (a;) as fol- lows:

i fn = i j and

T ( j , j , g ) = 0, for all y 5 z , (4.27)

otherwise.

In the above formula T is KLEENE’s predicate. I t is easy to aee that 9’ = ((d,),(@{)) ie a BLUM space (the fvst

axiom follows from (4.26), and the proof of the second axiom involves the recursiveness of I).

Then, by (4.27), CP!(z) <_ f ( z ) a.e. iff there exist two naturals j and

Page 260: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 247

2, such that n = ij and @j(z) = f(z), for all 2 2 2,. But ‘i

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

all p 5 2, and z 2 2, w T(j,j,p) = 0, for all y

w i 4 dom(dj)

Hence n

a!(.) I f ( z ) a.e. w n = i, and j 4 K, for some natural j ,

and n I

Cf = {g E R 1g = 6, and 4{(z) I f ( z ) a.e.1 = {dij Ii 4 K ) - (Recall that K = {z E RV ]q5z(z) # x} = {z E IV IT(z,z,y) = 1, for some

n

Y E W) n

If CF’ were r.e., then the set { j E RV Idi. E Cf’} = IV - K would be

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

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

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

For every f E 5 f ( z ) 5 B ( z ) a.e. , (4.28)

7cc, * (4.29)

Proof. Let 7= {dh(i) l i >O}, where h : N + IV is a suitable recursive function. Put

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

and

Page 261: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

248 Caludc

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

0

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

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

+i(z) , if (for each k 5 .z,ai(k) 5 y) and

(for each z < k 2 z, ai(k) 5 f(k)) , 0 , otherwise,

1 = {+h(i) I i 2 0) 9

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

and then construct the r.e. set

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

If dj is recursive and a,(%) 5 f(z), for all z 2 z,, for suitable z,, C f = x.

then $j = q5h(i), where i = J( 4 (j,z0,max(aj(z) Iz 5 ZJ). Conversely, for every i t 4h(i) E C,, since all ultimately zero recursive functions are in C

0

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

Page 262: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 249

bh(i,s,#)(z) =

qbi(z) , if (for every y 5 k 5 z, 9,(k) 5 t ( k ) ) and (for every

k < Y,@i(k) < 2) 9

g(z) , otherwise. \

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

a.6. THE SPEED-UP PHENOMENON

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

We begin with two illuminating examples.

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

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

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

0

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

Page 263: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

250 Caludc

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

1 , if 2 is a palindrome, f ( z ) = { 0 , otherwise,

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

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

0

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

R ( @ j ( z ) ) < @i(z) 9

for infmitely many z in dom(q).

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

R(@ j ( z ) ) 2 @i (2) - Then, for almost all z,

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

0

Page 264: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 251

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

The following deep result asserts that a stronger version of the above phenomenon is generally true.

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

g ( z d I !dZ,Y+1) 9 (5.1)

for all z and y.

Then there exists a recursive function f :N - Wr such that

for all z, and for every di = f there exists a j with

f = di, and g(z,@,(z)) 5 ai(z) ax . (5.3)

(We say that f has a g-speed-up with respect to g.) -

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

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

.&) 9 if 2 I W Y ) 9

4t(inu)(Z) = q5i(z) , otherwise. (5.4) I For all n, m and z we define the s e t of indice8 cancelled at Stage z

by n and m, C(n,rn,z), to be

Page 265: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

252 Cdude

Furthermore, for all n, m, and 2 , if C(n,rn,y) is def ied for all y < 2 , and

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

for all m <_ a’ < z and 0 5 t 5 z, then C(n,m,z) is also def ied and its members can be effectively determined.

If C(n,m,z) is defined and i is in the fmite set C(n,m,z), then

We are now ready to use the s-m-n Theorem in order to obtain a *i(.) P x, so di(t) f x.

recursive function H:IN -+ IN satisfying the equation

+aln)(m tz = PY [Y * bi (z), for every E c(n ,m 11 . (5.6)

d&(n)(miz) 5 z 7 (5.7)

Clearly, if for some n, m, and z, $kl,)(rn,z) z X, , then

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

By the Recursion Theorem, there exists a fixed-point q of H, i.e.

@)(m,z) = &l,)(m,.) 9 (5.8) for all m and z .

Notice that in view of (5.5),

@(m,z) = 0 ,

op( rn ,o ) f x , $j2’(m,l) # x ,..., @(m,z&l) # m ,

for every m 2 2 .

Intermediate step. If for some rn and z > rn,

(5.9)

and

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

for allm < i < z and 0 5 t <_ z, then

(5.10)

@(m,z) * 23 . (5.11)

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

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

Page 266: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 253

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

dt(,(q,z)&) # x 7

+), de(q,s)(z) , otherwise,

for every t z. But,

if 2 I K ( 4 9

, if z 5 K ( z ) 7

#f)(z,z) , otherwise, .

, if 2 I K ( z ) 9

= I - - [O , otherwise.

Step-by-step we can prove that dp)(m,z) # q for every m < z. We prove by induction on 2, that for all n, m > 0,

C(n,m,z) = C(n,O,z)-{O,l, ..., m-1) . (5.12)

For z = 0, C(n,m,O) = C(n,0,0) = 0. Assume that

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

for all n, m > 0, and y 5 2. If i E C(n,m,z+l), then

m < i < z + l , (5.13)

i E u C(n ,n ,y ) , (5.14) v < s + l

and

@i(z+l) < g(z+l,max(~t(e(n,i+l),r)(Z+l) 12 I z+1)) * (5.15)

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

Page 267: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

254 Cdudc

(5.16)

Finally, from (5.13), (5.16) and (5.15) we deduce that i f C(n,O,z+l)-{0,l, ..., m-I) , thus ending the proof of (5.12).

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

W

i E UC(",O,V) Y

Y d

then

(5.17)

We prove that for every z > M ,

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

From (5.12) it follows that we need to prove only the inclusion

C(n,O,z) c C(n,m,z) '

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

z-3

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

it follows from (5.17) that M

i E UC("'0,Z) 9

a -0

so, i E C(n,O,z), for some t 5 M < z. Consequently, 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

df)(m,z) = d H ( , ) ( W ) = &&,4 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 effec- tively computed!

We are now able to defme the required recursive function f :N '-c RV by the formula

Page 268: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 255

f(.) = #)(OlZ) 9 (5.19)

for every 2. Clearly, (5.2) follows directly from the definition and (5.7).

We note that for all i and 2 , if z > i , and

9(2,rnax(@t(r(p,i+1),.)(2) Iz 5 4) > @1(4 9 (5.20)

then f # 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 ) , for every j€C(q,O,zo)]

# di(Z0) *

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 .

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

f ( z ) = #(o,z)

#)(o,z) , for z 5 M , bp) ( i+ l , z ) , for z > M ,

for z 5 M , = { ~ ~ ~ ~ ~ ~ ) ~ z ) , for z > M ,

- - i 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:

Page 269: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

256 Caludc

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

2 a,(,) a.e. , 2 q = 1

or

a j (z ) 5 10g~(*~(z)) a.e.

This logarithmic speed-up can be indefmitely iterated: to each j corresponds an index k for f such that

+t(z) I logZ(Qj(z)) I logdlogZ(+s(z))) a.e*

aa.0. 0

Comments.

a) The “almost all” condition in the statement of the Speed-Up Theorem cannot be dropped since for every recursive function we can con- struct a computing algorithm having an auxiliary computation table which produces finitely many outputs in a minimum complexity.

b) Condition (5.2) shows that the speed-up phenomenon is not a consequence of growth. Moreover, it is not difficult to modify the above proof of the Speed-Up Theorem to obtain a recursive predicate which sathfies condition (5.3).

c) Theorem (3.5) says that not all recursive functions can be speed- up. Furthermore, in the context of Corollary (4.9), every recursive func- tion f with an h-speed-up (here h is the binary recursive function which satisfies the relations (3.1) and (3.2) in Theorem (3.1)) in the BLUM space 4 has the following property: for every index i for f we can find an index ;for f such that

Page 270: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 257

In other worda, for the computation of f the faster computer is not better than the slow one.

d) We stress the asymptotic character of the Speed-Up phenomenon. The practical significaqce of this result is not so strong since all real com- putations deal only with finite initial segments of functions.

The above proof of the Speed-Up Theorem does not provide an uni- form way to obtain an index for the faster algorithm for f on the basis of an earlier index of f , A first non-uniformity result is given in the next theorem.

(6.6) Theorem. (BLUM [1967a]) Let g:nv? --c RV be a sufficiently large recursive function satisfying (5.1) and let f:RV -+ RV be the corresponding recursive function furnished by the Speed-Up Theorem. Then there is no recursive function 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) Q.C. (5.23)

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

dm(i)(z) = dbj(p(s))(z) - (5.24)

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

(5.25)

for all i and 2.

function R : W 4 RV such that First of all, in view of (5.24), we notice the existence of a recursive

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

Page 271: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

258 Caludc

To the recurs ive 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 , and t we have:

R( 2 ,i ,z,t) < 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 ) = 6 6 , ( p ( r ) ) ( 4 = h ( p ( r ) ) ( Z ) 9

for all 2, so ~ ( t ) ki an index for f . In view of (5.25),

@ a ( , ) ( . ) 5 (2 t4k(p(s))(z ))+a(t,9t(p(z))) f (5.26)

for all 2 . For every n and for infinitely many 2, p ( z ) = n and

% ( t ) ( Z ) 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) > z+h(z ,y) 1 (5.28)

for all t and y. This is possible because the definition of h is independent of 9 . Putting y = O+)(z) in (5.28) we get:

g(Z,* i (n) (Z)) > z + h ( z t @ L ( n ) ( z ) ) >

so, by (5.27)

Page 272: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 259

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

for every n and for an infmity of x . Hence, for every n,

@ 8 ( t ) ( z ) < g(z,@k(n)(Z)) T

a contradiction since f = q5,(t).

0

Comment. A stronger result (see BLUM I19691 and SCHNORR [1973)) concerning the non-effectiveness of speed-up can be proved: Let f and g be unary and, respectively, binary recursive functions. Then there does not exist a p.r. function T :RV a Hv such that for every index i for f , ~ ( i ) Z

We close this section with the operatorial form of speed-up. Further- more, the speedable function will be zero-one valued.

and g(z,@r(i)(z)) I @i(z) 4.e-

(6.6) Theorem. (Operator Speed-Up Theorem; h4EYER and FISCHER [1972]) Let - F : P R + P R , 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

‘v F ( Q j ) ( z ) < ai(z) 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 (ei) be a recursive enumeration of all aero-one valued functions

with fmite domain. We s h d construct, by stages, the recursive predicate f on the basis of a ternary p.r. function B ( , and of the unary recursive predicate cancel.

Put caneeZ(0) = 0 and defme the Stage x in the computation of

1. Put ecmeel (x+l ) = 0.

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.

e (. ,u ,2 88 mows:

Page 273: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 pi(z) , then find the smallest i with these properties and put cancd(i) = 1, e1(u,o,z) = l+(z), and STOP.

8. Put 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

We shall consQruct a suitable sequence (pi) satisfying the condition at that B 1 is a rero-one valued recursive function when

the beginning of the proof and we shall put f t ( z ) = B ( ( O , O , z ) , for all z.

is total.

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 compu-

tation 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

dom(eo) = (z E IV Iz < u, or coneel(i) = 1 in the

computation of B((O,O,z), for some i < u } , (5.31)

and

Page 274: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 26 1

fe(n) = ~ O ( n ) (5.32)

for every n E dorn(C6). Only the case u > 0 is interesting. We prove by induction on z that

{ i E N Ii 2 u, cancel(i) = 1 in the computation of Bt(O,O,z)} = {i E N l i 2 u , eaneel(i) = 1 in the computation of Bt(u,e,z)}.

For z = 0 both sets are empty since the only possibility to obtain caneel(i) = 1 in the computation of 6,(0,0,0) (or e,(u,w,O)) is to pass the test in step 5, in particular the inequalities: 0 < u <_ i 5 z = 0. It should be easy to see that supposing the equality holds for certain 2 > 0, then it remains true when replacing 2 by (z+l), since the test in step 5 is “hereditary ”.

By an s-m-n construction we get a recursive function t : N 3 4 N satisfying the equation

dt(r,o,r.)(~) = Be(u,v,z) - Claim 8. For every total effective operator d,, such that for all u and u,

there is a recursive function

E P t ( s + l , o , n ) ) ( 4 5 P u b ) =.I?. (5.33)

To prove (5.33) we consider the p.r. function w :N2 a N given by the equation

w ( e ,J( i ,z) ) =

for all L , i , and z. The Recursion Theorem gives a fmed-point n: dn(w) = w ( n , w ) , for all w .

We are now into a position to defme the required sequence (pi). For every i , consider the p.r. function p i : N defmed for all z by pi(.) = w ( n , J ( i , z ) ) , i.e.

Page 275: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

262 Cdudc

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

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

(5.35)

Claim 6. From (M) we deduce that 4, is recursive. If po is total, then p o ( z ) is given by the second clause in the defmi-

tion (5.34) for almost all z. Consequently, +"(J(j,y)) z cq for every j > 0 and all y, i.e. pj is total for every j 2 0, thus proving that 9, is total.

Claim 6. For all u,u, l , and z ,

9 t ( u , o , r ) ( 4 + * (. < or (. E dom(C)) or (d t ( J ( i ,m)) # 30, for

a l l u < i < m < z ) . (5.36)

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

If for every i > m, pi is total, then by (5.36) it follows that 4q,+l,a,n) total, and hence +'t(m+i,o,n) and E(@t(m+l,o,nl) are also total. So, if p,(m) = KI, for some rn, then for all i > m , pi(z) = 0, for every z (by virtue of the fvst clause in (5.34)). Hence po is total, thus ending the proof of Claim 3.

We are now able to fmish the proof. Put f = f , = dt(o,o,n), where n is taken from Claim 3. By Claim 3 and the remarks preceding Claim 1 we

Page 276: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 263

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

Oi(z) > p i ( . ) use. , and by (5.33),

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

Consequently,

f ( 4 j(z)) < Pi (z ) a*e. 9

which proves that f satisfies (5.29).

Remarks.

a) is the following: Y F(di) = rot$;, where r : N RV is a fued recursive function (BLUM [1967a]).

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

An example of a total effective operator

c) A significantly speedable predicate is dishonest.

8.6. THE UNION THEOREM

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

Fix 9 a BLUM space. Let (f;);Zo be a r.e. set of unary recursive functions &h that for all i and 2,

Page 277: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

264 Caludc

Our aim is to prove the following result:

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

x)

c, = uc,; i = O

Proof. Since ( f i ) ia r.e., we can find a recursive function H:N -+ N such that fi = +H(i), for all i.

We shall define g by means of a course-of-values recursion using a “priority method” which uses some unary recursive function guess. We display the procedure for computing the values g(O),g(l), ...,g( z), for some z.

1. Put y = 0.

2. Put gU1?88(y) = y.

3. Put A = +H(,)(Y).

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

4. Put i = 0.

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

7. Put i = ;+I. If i 5 y , then go to step 5. 8. Put g(v) = A. 9. Put y = y+l. If y 5 z, then go to step 2. 10. STOP. Some comments will be helpful. First, notice that equality (6.2) h

equivalent to the condition: For all i, (aj(,) 5 g(z) ax.) w (a,(.) 2 j i(z) ax. , for some i) . (6.3)

It follows that the fnst candidate for g is the diagonal function fs(z). Clearly, G(z) = f,(z) is greater than fi(z), for aU i and almost all 2.

However, thie function does not work since there may exist a recursive dj such that

a,(.) < f , ( z ) a.e. , (6.4)

and for every i,

Page 278: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 265

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

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

the value guess(i) represents the “guess” that the inequality

a i ( y ) I dH(gwrr(i))(y) a*e* 9

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

g(z) = min(4H(r)(z ) d H ( g ~ c r r ( i ) ) ( ~ 1; 5 and

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

Once convincing that the procedure works we shall simply use the

Claim 1. For every j, shorter notation f i instead of

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

Let j be fmed and consider an z 2 j. For every y such that j 5 y 2 z we have guess(y) 2 j and, by

(6.1), fgrcr,(,)(z) 2 fj(z). Indeed, an inspection of the procedure shows that, by step 2, gueee(y) = y 2 3, and then the value of gucse(y) can be modified only in the computation of g ( z ) , for some z 2 y. Two possibili- ties of modifkation may occur: a) z = y, and in this case, by step 6, guess(y) = y 2 j , b) z > y, and in. this caae, again by step 6,

For every y < j 2 2 , 8 guces(y) 5 j , and fw,r(r)(z) is used in the computation of g(z), then fw,,(,,(z) < aY(z), and the test in step 5 fails to hold, i.e. gueee(y) = z 2 j.

gUe88(y) = 2 > y 2 j.

We continue the proof of Claim 1 with Claim 2. There e h t s an z,* 2 j such that no f, with y < j is used

in the computation of g(z), for all z 2 zf.

We proceed by rcductio ad abeurdum. Assume that for every z 2 j there exiets an y < j such that f, is used in the computation of g(z), i.e. there exists an i 5 z with y = gucas(i) and

Oi(z1 > fmr,(i)(z) = fy( 4 * (6.8)

We have to analyse two situations. If j 5 i <_ z, then y = gueae(i) 2 j > y , a contradiction! If i < j 5 2 , then, on one hand,

Page 279: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

266 Calude

g u e s s ( i ) = z 2 j , and, on another, by (6.8), g u e s s ( i ) = y < j. Again we obtain a contradiction.

We can reformulate Claim 2 as follows: There exists an zf 2 j such that for all t 2 zf and y < j , i 5 2 , if g U e 8 8 ( i ) = y, then

<_ fmr,,(,)(z). Consequently, we can write

g(z) = mh(fz(z),jguei,(i)(z) I; 5 % and

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

since in case i 5 z and g u e s s ( i ) < j we have, by the above formulation of

To fmish the proof of Claim 1 we note that if g(z) = fz(z), then 2 j, and if g ( z ) = fgre,,(i)(z), then again

Claim 2, ai(2) <_ fgw,,(il(z).

g(z) 2 fj(z), for all z 2 g(z) 2 fj(z), for all z 2 zj, since pess(i) 2 j.

Claim 3. If Qi(z) 5 g ( z ) o x . , then there exist a j with

ai(z) <_ fj(z) a.c. (6-9)

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

We have

ail.) I g ( 2 ) = mh(fz(z),fgw,,(j)Iz) lj I 2 and

@ j ( z ) > fgse,,(j)(z)) *

In the computation of g(z) the inequality Qi(z) > fpc,,(,)(z) cannot hold since it would imply

@i(z) > fgwr, ( i ) (z ) 2 g(2) 7

which contradicts the hypothesis of Claim 3. So, for every z 2 max(t,z;), g u e s s ( i ) does not change the value. Putting j = g u e s s ( i ) we obtain (6.9).

U

(6.2) Corollary. There exists a recursive function g:N + iN such that the set of all unary primitive recursive functions coincides with the com- plexity class of g in the BLUM space ((u,),(f l i)).

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

Page 280: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 267

i

f ; ( x ) = C fj(z) 3

j-0

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

30

where g :PI -+ N ia a suitable recursive function. To fmish the proof we notice that for every unary primitive recursive

function f , an unary primitive recursive function F corresponds such that in the BLUM space ((ui),(fli)), f E CF. The argument proving the above statement follows from the inductive definition of the set of primitive recursive functions. The base functions are complexity classes named by primitive recursive functions and the closure operations respect thin pro- perty.

0

Remarks.

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

b) Corollary (6.2) and the preceding remark show that there exist strong arguments for considering the class of primitive recursive functions to be the least complex class of recursive functions.

c) The recursive function g which names the complexity class of all primitive recursive functions cannot be made primitive recursive. For, if g were primitive recursive, then g would belong to a certain class in the primitive recursive hierarchies (see Chapter 1) and so C, would not include higher classes. However, by the Honesty Theorem, g can be taken to belong to some measured set.

d ) We can easily construct a BLUM space for which Corollary (6.2) fa& to hold.

Page 281: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

268 Caludc

a.7. BARD RECURSIVE FUNCTIONS

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

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

(7.1) Definition. (GILL and BLUM [1974]) Let h:N - N be a recur- sive function. h-eomputable (with respect to 9 ) - if there is an index i for w such that

A p.r. function w :nV 3 RV is i.0.

a,(.) 5 h ( 2 ) i.0. (7.1) We say that w is a x . h-hard if it is not i.0. h-computable.

Remark. In Defmition (7.1) the p.r. function w is not necessarily total, but in view of (7.1), w has an infmite domain.

(7.2) Definition. A sequence (Ri), recursive provided the set

of subsets of N is called uniformly

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

Remark. If (Ri) i 2o is uniformly recursive, then each set Ri is recursive.

(7.a) Example. For every i , put

Rl = {z E N 1 2 >l} . It should be clear that the sequence (R,); Lo is uniformly

The fust result asserts that if a p.r. function w

recursive. 0

vanishes for every element of a certain “easy-to-decide” recursive set R , then w is “easy-to- compute” on R.

(7.4) Lemma. If (Ri)i20 is uniformly recursive, then there is a recursive function B:JN + N such that every p.r. function which vanishes on some Ri has an index j such that on Ri,

Page 282: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 269

Proof. Let 8 :p 4 N be a recursive function supplied by the 8-m-n

Theorem which satisfies the equation

, i f z E R i , 4*(idz) = (ooj(z) , otherwise. (7.3)

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

We defme the recursive function B as follows:

ifz 4 Ri, for all i 2 x ,

i , j 5 z, and z E Ri) , otherwise,

for every z. If z E Ri, and z 2 ma [ i , j ) , then @,(i,j)(z) 2 B(z ) . If d j ( z ) = 0,

for all z E Ri, then (as we have already seen) 4, = +,(i,j), and, on Ri,

n @,(i,j)(z) i B ( z )

(7.6) Corollary. every ultimately zero p.r. function d j satiefies the condition

There is a recursive function b:N --c lV such that

Gj(z) 5 b ( z ) 0.c. (7.4)

Proof. We use the sequence (Ri)i20 in Example (7.3) and Lemma (7.4).

0

We are now into the position to analyse the possibilities to prove that a recursive function is a.e. h-hard. As expected, we shall prove that if the unary recursive function h ia sufficiently large, then we can con- struct a recursive predicate f which cannot, under reasonable assump- tions, be proved to be o.e. h-hard, in spite of the fact that it is.

Fix T a GODEL theory and suppose that for every unary recursive function h there exists in T a formula H ( i ) , which can be effectively con- structed on the basis of an index i , and has the following meaning: ‘‘#i ia ad. h-hard”. Since T is consistent, it follows that if H ( i ) ia a theorem of T, then 4i is use. h-hard.

Page 283: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

270 Caludc

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

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

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

0

The following question seems to be natural: Has every recursive func- tion an “exceptional” algorithm about which we can certify that the func- tion is a.e. hard? The next theorem answers this question in the negative.

(7.7) Theorem. (GILL and BLUM [1974]) For every sufficiently large recursive function h , every r.e. class of ax. h-hard partial recursive func- tions omits arbitrarily hard recursive predicates.

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

If a,(.) 5 t (z) i .o., then f f (bi , (7.5)

f d,(i) * (7.6)

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

1. Put 2 = y.

2. If n < rn, then go to the next stage. 3. I f+ i (z ) I n, then R j i ~ ) ( i , ~ , ~ ) = {n)U R j ~ \ i , ~ , ~ ) y and E = z+l.

4. Go to next stage.

Page 284: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 271

We use Lemma (7.4) to obtain the recursive bound B for the com- plexity of the p.r. functions which vanish on some RJqi,m,,l. Since the construction of R J ~ ~ , ~ , , ) is independent of h , we can take h to satisfy the inequality: h ( z ) 2 B(z ) , for all 2.

We construct the recursive function f by stages. We use two auxili- ary unary arrays u and cancel. We say that the requirement 2i is out- standing at Stage n if canccl(i) = 0, and @;(n) < t(n); the requirement 2 i+ l is outstanding at Stage n if @,(i)(u(i)) 5 n, and 4,ti)(u(i)) = f(u(i)) , for the current value u(i) a t Stage n. The require- ments are ordered according to the following rule: the requirement i has higher priority than the requirement j whenever a < j . Initially u(i) = canccl(i) = 0, for all i .

We display the Stage n in the computation of f :

I. If there is no outstanding requirement with the number j < 2n,

2. Compute the number j < 2n of the outstanding requirement of

3. If j = 2 i , for some i , and eancel(i) = 0, then put eancel(i) = 1

1 , i f & ( n ) = O ,

then put f (n) = 0. STOP.

highest priority.

and defme

f ( n ) = { 0 , otherwise.

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

f ( n ) = 0. STOP. The above procedure works since: a) step 1 can be effectively per-

formed; b) if j = 2 i , then chi(n) < t(n), so #;(n) # 0s.

Claim 1. For every i ' , f # 4,(i).

hsume , for the sake of a contradiction, that f = d,(k), for some 1; furthermore, suppose that k is the smallest possible.

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

Page 285: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

272 Calude

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

% ( k ) ( 4 k ) ) 5 n 9

and

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

Consequently, f = 4,(k) and on RJ(ak,(kj,m,,),

4 , ( k ) k ) L =-e.

In particular, it follows that q5+) is i.0. E-computable, a conclusion which contradicts the hypothesis ({d,(,j I i E RV} contains only U . C . h-hard func- tions) since h ( z ) 2 B ( z ) , for all z.

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

0

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

Page 286: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 273

8.8. COMPLEXITY SEQUENCES

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

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

For every a, dom(pi) = dom(4) , (8.1)

Oi(z) 2 pj(z) 0.c. (8.2)

at(.) 5 Pi(.) a-e. (8.3)

For every di = 4, there exists a j such that

For every pi, there is a d k = 4 such that

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

0

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

0

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

0

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

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

Page 287: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

274 Calude

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

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

4 4 ( c , s ) ( 4 = A ( 2 ) 7 ( 8 - 5 )

for every i ,

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

and

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

for all z E dam(#,), and for every i ,

h(z#i(z)) 2 @k(z) a.e.

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

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

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

for all e , i and z (in other words, for all y 5 z, if @i(y ) < z and * e ( ~ ) I ~9 then +,(Y) = 4i(Y)).

We construct the p.r. function w :N3 3 N by cases:

q$(z) , if E ( e , i , z ) = 1 and a,(.) < ae(z) , u ( e , i , z ) = 1 #e(z ) , otherwise.

The 8-m-n Theorem furnishes the recursive function a :p - PI satisfying the equation

w ( e , i , z ) = #a(e,i)(z) - If be(z) f cr, then @,(z) # q so, if Oi (z) < O,(z), and

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

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

Page 288: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 275

Oace,i)(z) , if E(c,i,z) = 1 and Oi(z) = z , H(e , i , z , z ) = L otherwise.

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

H(C,i,z,@i(z)) = @a(a,i)(z) = pifz)

Now put for all z and z

h * ( z , t ) = max(H(rn,n,z,z) Im,n 5 Z) , and suppose that # e = #i. Since E ( c , i , z ) = 1 for every z, it follows that H(e , i , z , a i ( z ) ) = pi(z), for every z, so

h*(z,*i(z)) 2 pi(z) 9 (8.8)

for every z 2 max(e,i).

recursive function b :fl -c N by the condition For the last condition we use the enumeration (ri)izo and define the

rj(z) , if z E dom(rj) , ‘b(nd(z) = i #,(z) , otherwise.

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

*b(n,j)(z) 9 if @ n ( z ) = 1

G(n,j,z,z) = L otherwise,

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

On this basis we put for all z and z ,

h**(z ,s) = max(G(n,j,z,t) Jn,i 5 Z ) . It follows that

h**(z,Qn(Z)) 2 # b ( r , j ) ( z ) 7

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

h ( z , z ) = max(h*(z,z),h**(z,z)) , for all z and z. Clearly h satisfies both (8.8) and (8.9) almost everywhere. In view of (8.4) we have:

#a(e,i)(z) = be(%) 9

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

Page 289: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

276 Calude

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

C : P R - P R , is a total effective operator satisfying the condition

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

for every total qbi and all 2, then every recursive function satisfying the Operator Speed-Up Theorem (for this F') has a r.e. complexity sequence.

Proof. Our h will be produced by Theorem (8.5). Let 4, be the recursive function which satisfies the Operator Speed-Up Theorem, i.e. if bi = be, then there exists a bj = &c such that

F(o i ) ( z ) < ai(z) a.e.

We consider the r.e. sequence (pi)iLo furnished by Theorem (8.5) for the above fmed e and we shall prove that i t ie a complexity sequence for 4,. From (8.4) it follows (8.1). From (8.7) and the totality of 4, we deduce the existence of a k such that be = @k and for every

h(z,pi(z)) 2 @ k ( z ) a.e. (8.1 1)

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

h(z ,an(z ) ) 5 F ( a n ) ( 2 ) < @ k ( Z ) a.e.

From (8.11) we deduce the inequality

h(z,@n(z)) I h(z,pi(z)) a.e.

which enables us to write the relation

a n ( , ) I Pi(z) a*e. (8.12)

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

Page 290: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 277

(8.3) holds. Finally, condition (8.2) follows from (8.6). Let i be such that

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

f(@,)(z) < ai(z) a.c.

By (8.10) and (8.6) we deduce that

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

0

The above corollary shows that the recursive functions poesessing a sufficient speed-up have r.e. complexity sequences. The next result goes deeper into this phenomenon.

(8.7) Theorem. (MEYER and FISCHER I197211 There exists a recursive function h :@ -* RV such that for every nondecreasing total effective operator

E : P R - . P R , satisfying condition (8.10) and for every recursive function f :N -.+ RV, the following two statements are equivalent:

f satisfies the Operator Speed-Up Theorem for [ . (8.13)

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

f such that for every pi there exists a pi with

F(Pj)(z) < Pi(z) a-e. (8.14)

Here f nondecreasing means that for all i and j, if 4il.I 2 4j(z) Q.c., then [(+i)(z) 2 F(dj)(z) a.c*

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

E ( P j ) ( Z ) I E(@t)(z) I pi(%) a*c.

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

Page 291: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

278 Coiude

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

a

Remarks.

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

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

for aU i , is a complexity sequence.

a.9. A TOPOLOGICAL ANALYSIS

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

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

4i(z) , if 2 5 Y , and a,(.) I +,(i,r,z)(s) = 0 , otherwise.

We prove that R(0) = {++) Iz EN), where h:N + IV is the recursive function given by

h ( z ) = a(rIS)(Z),r43)(Z),r433)(2)) Y

for every z in N. For every natural number 2 , dr(.) in in R(0) (because for every

Page 292: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 279

i I lp)(z), 6A(s)ti) = # ~ f j ( ~ ) ( ~ ) f OC) r 3 @$)c,t(i) 5 I!%”((.) < 3o f and 4+)(i) = 0, in other cases). Conversely, if f = 4, is in R(O), and

4,(i) = 0 , for every i > i,, then take

2 = ~(~),(z,i,,max(@,(y) I0 5 I I io)) , and notice that f = 4 h ( # ) (because dA( ( i ) = 0, for every i > i,, and 4h(#)(i) = # s ( i ) = f(i) , for every i I i,, smce =!

@,(i) I m=(@,(ar) lo 5 Y I i o ) ) .

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

auPP(+h(s)) c {0919--9143)((.)} * ( 9 4

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

we say

d c w 9

in case

8uPP(b) c dom(w) J

and for every z E 8Upp(d) we have:

w ( 4 = 4 ( 4 - C I f4 C w , and 4 f w , then we write 4 z w .

(9.3)

Remark. It is seen that C is a quasi-order relation on P R.

topology in P R. We defrne a system of basic open neighborhoods which induces a

For every t E R(O) , put

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

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

Page 293: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

280 Cdudc

t 3 ( z ) =

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

Ut, = UtI n ut, *

I

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

t 2 ( 4 , t l ( 4 1 if 2 E 8uPp(t,)-X 9

if 2 E 8'PP(tJ-X 9

0 , otherwise.

0

Lemma (9.2) guarantees that (U,),,=J(~) is a system of basic neighbor-

The next result is immediate. hoods in P R . We shall work with the induced topology r .

(9.8) Lemma. Let IC P R. Then the following statements are equivalent :

X is open . (9.5)

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

q5 C w , then w E X , and for every 4' E X

there exists t E X n R(0) such that t C 4' . (9.6)

Remark. The topology r is not separated and quasi-compact.

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

For every n E IN, 6!(,,) E R(0) ( 9 4

Page 294: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 281

For all m,n in N, if m > g(n), then

d / ( n ) ( 4 = 0 9

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

There exiats a natural number i such

(9.9)

(9.10)

that for every n in RV for which

! (d,,(,,)) > i, we have X n U+,(n) = 0 . (9.11)

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

We continue with an useful technical result.

(9.6) Lemma. Let Xc PR. Then the following statements are equivalent:

X is a recursively nowhere dense set. (9.12)

There exist two recursive functions f ' : N - N, i:RV + RV such that X together with f ' and

81 satisfy conditions (9.%), (9.9), (9.11), and (9.10') (9.13)

For every n E m, dh(n) C + 6,1(,) (9 .lo')

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

d,(i)(z) 9 if 2 I g( i ) 9

P(i,.) = 1 , i f 2 = g ( i ) + l , I otherwise.

We use an 8-m-n construction to get a recursive function a : N -.+ RV satisfying the equation

~(i,.) = d,(i)(Z) 9

and we put

Page 295: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

282 Caludc

f ( i ) = 8 ( i ) , g’(i) = g( i )+ l ,

for every natural number i. The above defmitions ensure the recursive- ness of the functions f’ and 9’.

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

C !In)

which ensures the required relation: 1 n U, = 0. J’kl

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

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

r=uxi , (9.14) i 20

For every natural number ;,Xi is a recursively

nowhere dense set with respect to f i and gi . (9.15)

(9.7) Definition. If X C P R ia not recursively meagre, then X in called a set of recursively second BAIRE category.

Remarks.

a) Intuitively, the recursively meagre sets are “recursively small” sets, in opposition to the sets of the recursively second BAIRE category which are “recursively big”.

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

Page 296: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 283

the converse implication fails.

(9.8) Propoeition. The f a m ~ of recursively meagre sets is closed under subset.

Proof. Let 9 be a subset of a recursively meagre set x. If 1 is recur-

sively meagre under the decomposition = U &, where every Xi is

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

y = U Yi (since, obviously, IJi is recursively nowhere dense with respect i >O

to f i and gi).

i 2 0

0

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

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

0

(9.10) Propoeitlon. Let 1 C P R be a set which can be written as

X=U& , i 2 0

and for which there edst the recursive functions f ,g:@ - nV satisfying the following two conditions:

For every i E N, Xi = U Yi,, , (9.16) i 20

For all i , j f Bv, Pi ,J is recursively nowhere

dense with respect to qb,(i,j) and 40(i,j) . (9.17)

Under these circumstances 1 is recursively meagre.

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

c m = YK(m)C(m) 9

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

Page 297: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

204 Calude

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

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

Uri = U(IJYi,j)= IJ Cm 1

i 2 0 I >O j > _ O m 20

it follows that 1 is recursively meagre.

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

Proof. Directly from Proposition (9.10).

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

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

r=uxi , 1 2 0

where Xi is recursively nowhere dense with respect to f i and gi, for every natural i . Furthermore, the sets {fiJiZO and {gi}i20 are r.e. In view of Lemma (9.5) we can suppose that dh(,,) F

Let us notice that for fured natural numbers n, i , and j the func- tional equality

for all n anl; i in RV.

d!,(n) = dh(j) 7

is equivalent to the following two conditions:

for every z I gi(n), z E s u p ~ ( 4 j , ( n ) )

(9.18)

(9.19)

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

Page 298: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 285

is recursive. Moreover, since 4fi(,,) is in R ( O ) , for ail natural numbers i and n, then for futed such i and n there exists a natural number j (depending upon i and n) such that Q(i,j ,n) = 1.

By means of the natural number q satisfying the equality t = dh(q)

and of the predicate Q we construct the recursive function r:m -c IV defined by primitive recursion:

r(0) = 0 , 4) = 4 f

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

to(.) = +) 9

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

t m ( 4 = #fKlm)(r("))(4 t 2 1 *

We notice that in view of the relation

Q(K(m) , r (m+l) , r (m)) = 1 , rn 2 1 , we deduce the functional equality

h K , m ) ( ' ( m ) ) = h r ( m + l ) ) ' for every rn 2 1.

We show that for every natural number n, C

tm + k + 1 *

Indeed, for m = 0,

t o = t

= 4") C + df K(&)

- - dfK(l)('(l))

- - t l 9

and

(9.20)

(9.21)

Page 299: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

286 Calude

tm = df,,,fiW = dh(r (m+l ) )

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

= fn+1

by (9.20).

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

if = I iIK(m)(+4).

f(z) = trn(2) Y

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

(9.22) Xi n u+,ii,,l = 0

We choose m to satisfy the conditions

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

twa = dJK, , , , f i (m) ) = Qh(r(m+l)) = dh(n) f

and

(fin) = (dh(n)) > ni *

On the other hand,

(9.23)

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

0

Page 300: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 287

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

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

0

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

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

r , = a , ritl = l/ri-ni .

Hence every function

f:nv-,nv

f (O)+l,f (1)+1, ..., r(.)+l) ... can be identified with the expansion

(9.24)

and this correspondence yields a homeomorphism between the set of irra- tional numbers between 0 and 1, and the set of functions (9.24). Thb homeomorphism preserves the correspondence between recursive functions and irrational recursive real numbers in [O,l]. Via the above identifick tions, Corollary (9.13) and Corollary (9.9) give:

(9.14) Corollary. The set of all recursive real numbers in [0,1] ia a aet of recursively second BAIRE category.

(9.16) Corollary. The set of unary partial recursive functions P R is a set of recursively second BARE category.

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

0

Page 301: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

288 CJudc

Q ) ( n ) ' if z 5Zh3)(n), and

rt"]c,,,(z 5 IF) (n 1,

1, if 2 = ZQ)(n)+l, and

(9.16) Corollary. second BAtRE category.

Every non-empty open set is a set of recursively

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

0

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

V d

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

Y d

otherwise,

By two fold applications of the e-m-n Theorem we get a recursive

for all i , n, and 2 in RV. c. . function e :RV - N which satisfies the equation

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

is recursive.

We shall prove the existence of two r.e. sets of recursive functions 2o such that the singleton {bG(il} is recursively nowhere

First we construct the recursive functions di and gi. We define the

(di)i Lo and dense with respect to di and gi, for every i E N.

recursive function p :aV3 -+ RV by

Page 302: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 289

Put:

for every n in RV. Obviously, the sets of recursive functions (di)i20 and (gi)i20 are r.e.

To frnieh the proof we verify conditions (9.8)-(9.11) for the triple dh(i), di and gi, where i i an arbitrary fmed natural number. The conditions (9.8) and (9.9) are clearly fulfilled: dd,.(,,)(z) = p(i ,n,z) = 0 a.c. for each fued natural number n , and 6di(,,)(m) = 0, for all n and m with rn > gi(n) = 1p)(n)+1.

For every n in RV, C

#A(n) f #+,(i)(”) = ddi(n) t

because

dh(n)(Z) = d4a1(n)(z) 9

for every z E e ~ p p ( + n ( ~ , ) n {0,1, ...,@1(n)}.

natural number n with t(4h(nl) > 0, we have: To verify condition (9.11) we set ni = 0 and we show that for every

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

> 0,

ddi(n) c dA(i)

Thie means that for every 2 E a u ~ p ( d d ~ ( ~ ) ) , dh(i)(z) = 6di(n)(Z). Let 2, = @)(n)+l. It k seen that 2, f supp(#,+)). w e must analyae two

caaes, according to the value of the sum S,+2

U d

ME(i,z. ,y) .

A) Incaae s,+2

Y d c MW,Z,,Y) = 0 9

we have

Page 303: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

290 Crlude

ME(i,Z0,Y) = 0 7

or, equivalently,

#h(i)(zo) # Y ?

for every 0'5 y 5 z0+2. Consequently,

4d, (n) (Zo) = 1 < z o + 2 , and

hence

B) Incase

it follows that

and consequently

In both cases we have arrived at a contradiction, so (9.11) was

0

proved.

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. meagre.

Every r e . set of recursive functions is recursively

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

0

Page 304: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 partic-

ular, every c h in the GRZEGORCZYK (or any equivalent) hierarchy, the set of KALMAR elementary functions.

c) The set of real-time computable functions. d) Every r.e. complexity c h .

Proof. Directly from Theorem (9.17) and Corollary (9.18).

0

If we combine the Honesty Theorem and Corollary (9.18) we get

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

0

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

(9.21) Corollary. Every complexity class iS recursively meagre.

Proof. Let f :N + I? be a recursive function. We can fmd a recursive function g:N + RV such that C, U R(0) C C,:

It follows that C, is r.e., hence, by Corollary (9.19), it is recursively meagre. Finally, we use Proposition (9.8) to see that Cf c C, is recur- sively meagre.

0

The existence of complexity classes which are not r.e. (see Theorem 4.25)) shows that the converse of Theorem (9.17) fails.

(9.22) Corollary. The set of algebraic numbers (and, in particular, the set of rational numbers) is recursively meagre.

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

0

Page 305: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

292 Cdude

Remark. Corollaries (9.14) and (9.22) reinforce the classical result on the real line: in the set of all recursive real numbers only a few numbers are algebraic.

(9.28) Corollary. In every BLUM space the set of step-counting func. tions is recursively meagre.

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

0

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

a.io. HISTORY

The rapid developments of mathematical logic, constructive mathematics and computer science were followed by a considerable interest in the construction of algorithms, in the analysis of their efficiency (see, for example, GODEL’s speed-up theorem for proofs in recursive log- ics, 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 com- puting 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].

Page 306: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 293

The axiomatic approach waa introduced by BLUM [1967a]; his wonderful work WM written along the idem of RABIN [1980] and HART- MANIS and STEARNS [1965]. The recursive dependence of complexity measures, the Speed-Up Theorem (also a Speed-Up Theorem for total effective operators of the form f’(4) = r 04, where r is a fmed unary recursive function), and the Compression Theorem are due to M. BLUM.

The algebraic study of BLUM spaces WM undertaken by ADRLANO- POL1 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 CON- STABLE [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 complex- ity, whose proof is given by a “priority method”. The proof of the Honesty Theorem comes from MEYER and MOLL [1972].

The existence of non-r.e. complexity classes WM proved by LEWIS [1971], and LANDWBER and ROBERTSON [1972]; these papers include a detailed study of complexity clssses.

BLUM’s Speed-Up Theorem proof is taken from YOUNG [1973] and MACHTEY and YOUNG [1978]. The Operator Speed-Up Theorem belongs to MEYER and FISCHER [1972]; another proof of this theorem can be found in YOUNG [1973]. An interesting survey on the speed-up phenomenon is VAN EMDE BOA3 [1975].

The proof of the Union Theorem (which belongs to McCREIGHT and MEYECR [1969]) was taken from BRAINERD and LANDWEBER [1974].

The material of Section 3.7 wad essentially taken from GILL and BLUM [1974]. The analysis of the complexity of recursive functions by means of complexity sequences was initiated by MEmR and FISCHhR [1972]; see also SCHNORR and STUMPE [1975]. A general result con- cerning the possibility of describing the complexity of recursive functions by a recursive sequence of honest functions wad explored in MEYER and W ” N [1979]; they have obtained a strong result from which we can derive the Compression Theorem and the Operator Speed-Up Throrem.

Section 3.9 follows the paper CALUDE [1982a]; see abo MEHLHORN [1973].

Page 307: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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

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

Section 9.2

g6deliaation (w !‘I). (11.2) Defme a “memory-complexity” associated to the acceptable

(11.3) Use Theorem (2.11) to obtain Theorem (2.6.3).

Section a.8

(11.4) Let 9 be a BLUM space. Prove that for all recursive func- we can effectively fmd an index j for g such that tions f ,g:N --*

aj(z) > f (z) , for ull z E AT.

Section a.4

(11.5) (BLUM; McCREIGHT and MEYER [1969]) Let Cp = ((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 C p = Cp. Show that for every BLUM space 9, we can construct a BLUM space 4, - such that neither 9 - nor 4 - is a refmement of the other.

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

Page 308: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 3 295

(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 to (= ) i.o., then ai(z) 2 J’(t*)(=) i.0.

Section S.6

(11.10) Give a direct proof of BLUM’s Speed-Up Theorem for recur- sive predicates.

(11.11) (BLUM [1969]) Prove that no recursive function has an effec- tive sufficiently large speed-up (see the comment following Theorem (5.5)).

(11.12) (SCHNORR [1973]) There is no recursive function which has a sufficiently large speed-up, such that both the index of the faster pro- gram and the number of points where the speed-up fails to hold can be recursively bounded by the index of the slower program.

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

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

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

Section S.6

(11.15) (McCREIGHT and MEYER [1969]) For each recursive func- tion t :N -+ N, put 1, = {i E 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 pre- cisely 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.

Page 309: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

296 Cdude

Seetion 8.7

A systematic interchange of “a.e.” and “i.0.” in Definition (7.1) leads to the notions of u.e. h-cornputable and i.0. h-hard functions.

(11.17) (LANDWEBER and ROBERTSON [1972]) Prove the existence of a r.e. set of i.0. h-hard p.r. functions, which includes every i.0.

h-hard recursive function; here h is an arbitrary recursive function. (11.18) (ROBERTSON 11971)) Prove that for every sufficiently large

recursive function h :N + RV, the claes of a.e. h-computable p.r. func- tions is r.e.

Section a.8

recursive function h :@ * RV, such that for each recursive 4e, if (11.19) (MEYER and FISCHER [1972]) Prove the existence of a

a) pi(z) = + t ( J ( i , z ) ) , for all i and z, and b) for all i, there in an u, such that pi(z) 2

li(z,max(@I(J(j,n)) Iu < j 5 n 5 2 ) ) a.e., then (pi) ia a complexity sequence for a recursive predicate f :N + {O,l}, and if di = f , then +i(z) > pi(z) 4.e.

Sectlon 8.9

(11.20) (ZIMAND [1983b] (Added in proof. I have learned through Professor G. ASSER that the same results have been reached by G. SCHAFER (A note on conjectures of Calude about the topological sise of sets of partial recursive functions, 2. Math. Logik Grundlag. Math. 91 (1985), 279-280).) Show that the set of all recursive predicates is recur- sively meagre. Extend the result to recursive functions with fmite range.

(11.21) (ZIMAND [1983b]) Show that the set of non-total p.r. func- tions 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

(11.23) (Open) Give a topological version of the Compression meagre?

Theorem.

Page 310: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

297

CHAPTER 4

4. KOLMOGOROV AND MARTIN-LOF’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 string-functions (over a non-binary 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 complexity-theoretic approach to random atrings, namely the opthisation of program length and the probabilistic tests of primality (with an appli- cation to cryptosystems).

Paradoxes often turn out to be an important source of fertile mathematical ideas. That is why, we begin the analysis of the optimiss- tion 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, no can be defmed by the following Enghh 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 correct- ness of our former defmition (for an interesting discussion see BOREL

Page 311: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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) pro- gram 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 defmi- tions 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:

Page 312: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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), (1.1)

PL uses a fmite alphabet (consequently,

the number of correct programs in PL having

a fued length is finite),

written in a base p 2. 2 .

(1.2)

(1.3)

PL works with natural numbers

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 defmi- tions 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 ( lJF( 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 ln )*

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),

z = length ( f l y ) ) + length (m(g)), y = y + l

PRINT y STOP

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

Page 313: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

300 Cdude

depends upon the programs in (l.l), a) and b)) such that for every natural t 2 2-e we have:

length (Qt) = length ( t )+e

= [log,t+l]+c

< e+log,t+2 , and, consequently, defmition (Qr , 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 com- plexity 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 non-deterministic polynomial algo- rithms. The non-deterministic algorithms are very useful for theoretical purposes, but they are rather incongruous in practice. Furthermore, the problem of transforming non-deterministic polynomial time algorithms into the equivalent deterministic ones is open. In contrast, a new class of algo- r i t hm 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 fifty-digit 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

Page 314: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 301

following condition:

b”-’ fl( mod n), or (1.4

(1.5)

rn = (n-1)2+ is natural and

1 < gcd(bm-l,n) < n, for some natural i . 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 a t lesst half of the natural numbers 1 5 b < n are witnesses of the compo- sitenem of n.

SOLOVAY and STRASSEN [1977] constructed a probabilistic algo- rithm for testing primality by means o,f the JACOB1 symbol j(b,n). For every natural b , 1 <_ 6 < n, set 6 = J(l,n) (see RIVEST, S H A M I R and ADLEMAN [1978] for an efficient algorithm that computes j(b,n)). Assume that b is relatively prime to n. If n is prime, then

6 =- b(”-’)D ( mod n) . (1.6)

Since, for a composite n, the set of all naturals b, 1 2 6 < n, sstisfy- ing (1.6) is a proper subgroup of unite of Z,,, it follows that a t leaat half of the naturals b smaller than n and relatively prime to n do not satisfy (1.6). The SOLOVAY and STRASSEN probabilistic algorithm runs k independent trials. If for some trial the answer is “composite”, then the number n ia declared composite (and in this caae the output i s correct). In the opposite situation, the natural n is declared prime (and the proba- bility that the output is correct is greater than 1-2-’).

The general form of the MILLER and W I N , reepectively, SOLO- VAY and STRASSEN probabilistic algorithm is the following. Take k naturals uniformly distributed between 1 and n-1, inclusively, and for every trial b, check the validity of some fmed predicate W(b,n). If for some b, W(b,n) holds then n is composite. If not, n is prime with probe bility greater than 1-2-‘. The predicates W(b,n), which are ddferent for the MILLER and W I N , respectively, SOLOVAY and STRASSEN proba- bilistic algorithms, can be evaluated by polynomial algorithms. These pro- babilistic algorithms act deterministically, but they use a “random device” - a coin flipping, for example - in order to obtain, a t mme moments, “an auxiliary entry”. The given output is only probably correct; neverthekss, the correctness probability is sufficiently large. The study of the correct- netw of thew probabilistic algorithm requires an adequate notion of

Page 315: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

302 Cdudc

randomness; some related results will be presented in Section 4.8.

We end this example with an application in cryptography which will show the practical significance of the above probabilistic algorithms (see RIVEST, SHAMIR and ADLEMAN [1978], LANDAU (19831). In short, the idea is that on the basis of the diificulty of factoring large naturals a cryp- tosystem can be constructed, in which the encryption method is “public”, but for possible interceptor, decryption is very dBicult and it could take years to get. Such a mechanism ia called a f i b l i e - K e y Syetem.

RIVEST-SHAMIR-ADLEMAN’s method use8 EULER’s phi-function 4 (#(m) = card{n E PV 11 5 n < m,ged(n,m) = 1)) and the fact that cal- culating d(m) ia polynomial time equivalent to factoring m. Each partici- pant in the cryptosystem fmds two large primes (each having about fdty digits) p and q, and a natural b, 1 5 6 < pg, which is relatively prime to d(pq) = (p-l)(q-1). Such a 6 does exist since most natural numbers smailer than pq are relatively prime to #(PQ). Every participant in the cryptosystem appears in the Public-Key Book with the pair (b,n), where n = pq.

The encryption of a message is given by the following algorithm: 1. Translate the message into natural numbers. 2. Break the resulting message into blocks of convenient length. 3. Transform each block into (block)’( mod n).

The decryption of a message can be done by the following algorithm: I. Compute the integers z and y, such that bz++(n)y = 1.

2. Break the message up into blocks. 3. For each block, compute (block)'( mod n). 4. Glue the block8 back together. 5. Decode the resulting message. The decryption algorithm is correct because from the relation

ged(b,+(n)) = 1 it follows that we can (eaaily) fmd the integers z and y, such that bz+g)(n)y = 1 (for example, by EUCLID’s modified algorithm in MARCUS [1981]). Consequently,

((block)’)’ 3 ( b l ~ e k ) ’ ~

= (block)’*”)’

E (block) (mod n) , by EULER-FERMAT’s Theorem (For every integer m and every natural u which is relatively prime to rn we have: ad”’) E 1 (mod m).).

The decryption is “feasible”, for it takes polynomial time to compute

Page 316: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapkr 4 309

z if one disposes of +(n). The ddference between the addrewee and a pos- sible interceptor lies in the former knowing #(n), while the latter knows only n (which is the product of two fdty-digit primes); factoring such a large natural number is a t present an intractable problem.

4.2. KOLMOGOROV’S COMPLEXITY

In this section we develop a complexity-theoretic method for defming “random strings”. This approach waa initiated independently by SOLO- MONOFF [1964], KOLMOGOROV [1965], and CHAITIN [1966]. The adequacy of this method ia mainly due to MARTIN-LOF [1966a], [1966b].

We begin with an illuminating example.

(2.1) Example. (MARTIN-LOF [1966a]) Consider the following four binary strings of length 32:

z = z y = 10011001100110011001100110011001 u = 00001001100000010100000000100000 u = 01001110100111101000001100101101.

Suppose that a random device produces reros and ones with proba- bility 1/2. According to classical probability theory the strings z, y, u and u are equally probable (i.e., the probability of each is 2”*).

We can compare the above strings from another, totally different, point of view, namely “regularity”. The string z is of maximum regular- ity, hence its information content is lower. It in easy to see the regularity involved in the string y: eight substrings of the form 1001. As concerns u and u , we can hardly specify a defrnite regularity. Nevertheless, a deeper analysis would point out a drastic difference in the structures of u and u. To see this let us return to the strings z and y and kt us defme them in a shorter way: z can be described by the English statement “only scrod”, y can be defined by “eight strings 1001”. In order to distinguish the strings u and v , we order the binary strings of a given kngth according to the increasing frequency of the ones and within c b s of equal frequency, in the lexicographical order induced by the relation 0 < 1. We define a string by its number in the above enumeration. The number of a string of length n having a small frequency of ones (i.e., m/n 5 1F, where m is

Page 317: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

304 Cdade

the number of ones) requires approximately n*H(m/n) binary digits, where H is the binary entropy function: H ( 0 ) = 0, H ( t ) = -t.loglt-(l-t)*log2(l-t), 0 < t 5 1). If a constant number, say e , of binary diik is needed for the enumeration description, then the defmition of our string requires approximately

n.H(m/n)+e , binary digits, which is smaller that n for small values of the quotient m/n. Note that u is such a string (8/32 < lb); consequently, u haa a shorter defmition.

In contrast, the string v appears to have no shorter defmition. It is only one of the four strings which would be regarded as being the output of a random experiment which gives preference to neither ieros or ones.

These examples point out a closer relation between complexity and randomness. Moreover, the length is not a decisive factor in this analysis. For example, the string u (or even, the string u) is more complex than the string a consisting of 40 sera . The last remark suggests that the complex- ity basically refers to cognition processes (see also LOFGREN [1977]).

KOLMOGOROV [1965] has defmed the complexity of a given string z with respect to the algorithm 4 as the length of the ahortest program which computes it.

More formally, let us flx a fmite alphabet

x = {Q1lQ2,...,QI) 1

g:x*xm-Qbx* . with p 2 2 elements, and consider a p.r. function

(2.2) Definition. The KOLMOGOROV complczity induced by 4 ia a function

K+:X* x N -+ JV U {m} , defmed by the formula

m w r ) Iv EX1,9(y,m) = 4 , in ca&e 2 = d(v,m), for some y in X* , (X. otherwise,

KdZ Im) =

for every z in X* and m in N.

Page 318: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 306

(2.8) Example. Let 4:X* x R'V + X* be the recursive function defmed by #(z,rn) = z, for every z in X* and rn in N. A simple computation shows that

K+(2 Im) = t (z) , for every z in X* and m in RV.

0

(2.4) Example. Let f:Hv aX* be a p.r. function. Asaociate the p.r. function +,:X* x RV *X* given by t$,(z,rn) = f(rn), for every z in X* and rn in N. (Clearly, if f(m) = q for some rn in RV, then #,(z,rn) = q for every z in X*.) If z = f(rn), for Bome rn in R'V, then t$,(A,rn) = 2. Consequently,

0 , i f2 = f ( r n ) , K+,(z Irn) = 0 0 , otherwise. i

(2.6) Example. Consider the p.r. function +:X* x Hv AX* given by

z d(z,m) = o t herwiee.

in case t (z) = rn ,

Then

[(z), i f t (2) = rn , K+(z Irn) = i 00 , otherwise.

(2.6) Example. (MARTIN-LOF [1966a]) Take p = 2, a1 = 0 and a2 = 1. We defme a p.r. function #:X* x R'V *X* in this way: #(z,n) is the kth element in the enumeration of the binary strings of length n intr- duced in Example (2.1), where k ie the natural number whose binary expansion is 2. Let m(z) be the number of ones in 2. Then, for every z in x*,

K,(Z I W ) W . H ( m ( z ) / W ) 9

when m(z)/t (2) 5 l f i . 0

Page 319: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

308 Cdude

(2.7) Lemma. Let +:X* x IV ax' be a p.r. function. Then: For all natural numbers n and r we have:

card{z EX* l t ( 2 ) = A , K,(z In) = r } 5 p' . (2.1)

For all n and m in N, if n 2 m, then

card{z EX* l t ( z ) = n,K+(z In)

< n-m} 5 (p""-l)/(p-1)

<P""AP-1) t

(both equalities can occur).

Proof.

(the case A = 0 is obvious). (2.1) Let A = {Z EX* lt(z) = n, K,(Z In) = r). Assume A z 0

We defme the auxiliary function

D : A - , ~ x *

by D ( 4 = {ar E X * It (u) = r , db , t (2)) = 2).

For every z in A we have D ( z ) # 0; moreover, if z1 # z2, then D(zl) n D ( z , ) = 0, so D ( z J # D ( z q ) . Since the function D is injective it follows that

cardA = cardD(A) 5 c a r W = p c . (2.2) The case n = m being obvious, assume n > m. In view of

(2.1), we have:

card{z EX* lt(z) = n,.K4(z In) < n-m} n-m-1

= card{z E X ' It (z) = n&,(z In) = i} id

n-m-1

5 c Pi = (p""-l)/(p-l) . i4

0

For all natural numbers n and m, set c(n,m) = card{z EX* l t ( z ) = n, K,(Z In) 2 n-m}.

Page 320: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 307

(2.8) Corollary. Let 4:X' x RV ax* be a p.r. function. Then for all natural numbers n and m such that n 2 m, we have:

+,m) > P"(l-P-AP-1)) 2 0 9 (2.3) (the last equality holds for p = 2 and m = 0).

In particular,

+PO) > P"(P-2)/(P-1) 2 0 - (2.4)

Remarh.

RV such that n 2 m. I f p > 2 or m > 0, then

limc(n,m) = 00 .

1) Let 4:X' x RV S,X* be a p.r. function,'and let n and m be in

n-ca

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 ax* 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 <.. . Recall that y(n) is the n t h string in the lexicographical order; it is seen that y(2"+'-1) = l", and y(2"+') = On+1. (Recall that for every a EX, a" = a...a, (n copies) for n 2 1, and ao = X.)

Let E(0) = {(A,O)}. For every natural number R 2 1 set

E ( n ) = {(g(i),n) li=1,2,3 ,..., 2"-1,2"+'-1} . 00

ina ally, put E = u E(n) c X* x N. n 4

Now we defme by cases the announced p.r. function +:E + X*: a) For n = 0, 4(X,O) = A. b) For n 2 1, d(y(i),n) = y(i+2"-1), for i=1,2,3 ,..., 2"-1, and

A rapid examination of the above defmition tells us that for.every 4(y(2"+'-l),n) = y(2"+'-1).

natural n 2 1, one hae

{z EX* It(%) = n&+(z In) 2 n}

= {z EX* l t ( z ) = n&,(z In) = n}

Page 321: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

308 Cdudc

= {y(2"+'-1)} . Hence c(n,O) = 1.

This fact shows the existence of a drastic distinction between the binary ease and the non-binary e a ~ e s .

2) From the inequality (2.4) we deduce that for every p.r. function d:X* x N A X * and for every n in N, there exists a t least one string z in X* such that l ( z ) = n and K,(z In) 2 n.

(2.9) Theorem. (KOLMOGOROV [1965]) There exists a per. function w :X* x lN A X * with the following universality property: For every p.r. function #:X* x RV a x * , we can effectively fmd a natural e (which depends upon w and 4) such that

K, ( z I4 I K,(z Im)+e 9 (2.5)

for every z in X* and m in RV.

Proof. Let us consider an acceptable giideljsation (#i)i u*,

For further purposes we defme the following auxiliary (primitive)

1) T : X * -+ X * , T(X) = a1a2, and for every z EX*, z = z1z2...2,,

+i:x* x RV ax*.

recursive functions:

with n = l ( z ) 2 1, T(z) = 21212222...2,z,a1a2,

2) f:X' +x*, z , if z = T(z)y, for some

X , otherwise, y and z in X* , 1

1 f ( z ) =

and 3) g:x* +x*,

y , if z = T(z)y, for some

X , otherwise. y and z in X* , !7(4 =

Notice that the last two recursive functions are well-defined because the representation z = T(z)y is unique (when it holds).

Let &:X* x (X* x N) AX* be an universal p.r. function, i.e. for all i, z in X*, and every m in N, we have: #i2iv(i,(z,m)) = di(z,m). The p.r. function w :X* x N a x x . will be defined by the formula

Page 322: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 309

w (2 ,m = 4Eie ( f ( ~ ) , ( g ( ~ ) , m 1) *

Now let 4:X' x PJ ax' be a p.r. function and let i be an index for 4, i.e. d = bi. Aseume that K& Im) = t < cq i.e. there elrista a string y in X' with [ (y) = t and #(y,m) = 2. Take z = T(i)y and com- pute:

w(z,m) = w(T(i)y,m)

= 4Eie(f ( ~ ( i ) y ) , ( g ( ~ ( i ) y ) , m ) )

= 4%e(it(y,m))

= 6i(r,m) = 2

and

e (2) = e (T ( i ) y ) = e (y)+2([ (i)+l) = t+2(! (i)+l)

K,(z Im) 5 e(2) = t f C = K,(z Im)+e

. Set c = 2(e (i)+l). We have proved that

.

Remark. The constant e appearing in the asymptotic relation (2.5) depends, in fact, upon the gcdelisation (di)=* and #.

(2.10) Definition. A p.r. function w :X' x PJ 4X' which satisfies the asymptotic relation (2.5) will be called an universal KOLMOGOROV algorithm.

I n the following we shall choose a fized universal KOLMOGOROV algorithm w and we ehall write K ( z Im) inetead ofK,(z Im).

(2.11) Corollary. There exists a natural number e (which depends upon the fixed universal KOLMOGOROV algorithm w ) such that

K(. It (4) I e ( 4 + C 9 (2.6)

for every z in x*.

Proof. Take 4:X' X PJ -+ X' to be the recursive function in Example (2.3), i.e. t#(z,rn) = 2, for every z in X' and m in PV. We have already noticed that K4(z lt(z)) = e(z), for every z in X'. In view of KOLMOGOROV's Theorem (2.9) we have:

K ( z I+)) 5 K,(z (!(z))+e = ! ( Z ) + C , for iome natural number e and every z in X'.

Page 323: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

310 Cdudc

Remark. Corollary (2.11) enables us to claim exists a eequence EH of natural numbers,

n < m , I n + e , such that

that in case p > 2 there

Indeed, we use the equality

(Z EX* = ~ , K ( z In) 2 n) C

= U{Z EX* I!(%) = n,K(z In) = n+i) , id

and Corollaries (2.8) and (2.11) to fmd, for every n in RV, a natural number m,

card{z EX' le(z) = n&(z In) c- mn} 2 pn(p-2)/(p-l)(c+l) . {n,n+l, ..., n+c} such that

(2.12) Corollary. There exists a natural number q (which depends upon the fmed universal KOLMOGOROV algorithm) such that for every z in X' there exists a natural number m such that

K b I m ) G l - (2-7)

Proof. Let f :RV +X* be a recursive bijection and let qj,:X' x A' + X* be the recursive function defined by (p,(z,rn) = f(rn). In view of Example (2.4) we have:

if f(m) = 2 , Kd,(z ~ m ) = k, otherwise.

By KOLMOGOROVL Theorem (2.9) the existence of a natural number g follows, such that for every z in X* there exists an m in IV (i.e. the unique m such that z = f (m)), such that

K(. I 4 I K,,(z Im)+cl = Q

0

Page 324: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 311

(2.18) Deflnitlon. (KOLMOGOROV [1966]) A string z in X* is called a (KOLMGOROV) random string provided

(2.14) Theorem. For every natural number n there exists a random string of length n.

Proof. In view of Corollary (2.8), with w instead of 4, we have:

card{z EX* It(%) = n,K(z In) 2 n}

> P”(P-2)/(P-l) 2 0 -

Remarks.

a) The defmition of random strings depends upon the chosen univer- sal KOLMOGOROV algorithm w .

b) The random strings are those elements of X* of maximal com- plexity with respect to w .

c) In Sections 4.3 and 4.4 we shall prove the adequacy of KOLMOGOROVL defmition of randomness, both from the statistical and the recursion-theoretic points of view.

Notation. Denote by RAND(w) , (or, shortly, RAND) the set of all ran- dom strings.

(2.16) .Theorem. increases “proportionally” to the number of elements in the alphabet X.

The number of random strings of a fmed length

Proof. By Corollary (2.7), with w instead of 4, we have:

card{z EX* l t ( z ) = n,K(z In) < n}*p” < l /(p-l) .

Comment. If p > 2, then more than half of the strings of a given length are random.

(2.16) Deflnitlon.

(KOLMOGOROV) m-random provided a) Let m be a fmed natural. We say that the string z EX* is

Page 325: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

312 Cdudc

K ( Z le(2)) 2 +)-m . (2.9)

b) A string in X* M said to be (KOLMOGOROV) ueymptotic ran- dom provided it is rn-random, for some natural number m. Random strings are precisely the &random atrings.

Notation. Denote by RAND,(w), (or, shortly, RAND,) the set of all m-random atrings.

(2.17) Theorem. For all natural numbers n and rn auch that n > m, there exists an m-random string of length n.

Proof. In view of Corollary (2.8), with w instead of $, we have:

card{z E X * lt'(z) = n&(z In) 2 n-m} > pn(l-p-/(p-l)) 2 0 .

0

Comment. The proofs of Theorems (2.14) and (2.17), which rely on the proof of Corollary (2.8), are non-constructive. In Section 4.4 we shall prove that there are no (uniform) constructive proofs for these existential theorems.

Actually, a bit stronger version of Theorem (2.15) can be stated:

(2.18) Theorem. For every natural number rn 2 1, almost all strings are m-random.

Proof. Again, by Corollary (2.8) we have:

card(z EX* lt(z) = n&(z In) >_ n-m}/p" > 1-p-/(p-l) .

Remark. (DAVIS [1978]) Take p = 2, a1 = 0, a2 = 1, and m = 10. Then, more than 99.8% of all strings of length greater than n-10 are m-random.

Page 326: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 313

4.8. MABTIN-LOF 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. (MARTIN-LOF [1966a], [1966b]) Consider the binary case, i.e. p = 2, a1 = 0, a2 = 1. h u m e that we hare a test of random- ness for binary strings which rejects relative frequencies of ones differing too much from the expected value 1/2. In other worda, if z = z12 2...z2, is

a binary string and an = czi, then our test of randomness rejects the

hypothesis when

n

i l l

bta/n-lFI 9

is too large. Since we are interested in the magnitude order of the signifi- cance level, we may reatrict our attention to a discrete set of critical values (Sicherheitawahrscheinlichkeit (MARTIN-LOF [1966a], p.3.9))

Consequently, the above MARTIN-LOF test rejects the hypothesis of c = 2-’,2-2 ,..’, 2- ,... . randomness on the level E = 2- provided

l8Jn-lF I 2 f (m,n) 9 ( 3 4

where f :RV x RV + N hi a function satisfying the following two condk tione:

The number of strings of length n for which the

the inequality (3.1) holda is less than 2”’- . (3.2)

One cannot diminish f without violating condition (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 mth projec- tion.

Page 327: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

314 Caludc

(8.2) Deitdtlon. (MARTIN-LOF [1966b], CALUDE and CHITESCU [lSSZa]) A non-empty r.e. set V C X* X (N-(0)) is called a MARTIN- LOF test (M-L t e s t ) if it possesees the following two properties: For all n and m in dv, m 2 1, we have:

v,,, c v m 9 (3.4)

card{z EX* l!(z) = n , ~ EV,} < p”“/(p-1) . (3.5)

We agree upon the fact that the empty set in a M-L 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 M-L test V and for every (2,“) in V one has

t ( z ) > m ? l . (3.6)

(8.8) Example. (CALUDE and CHITESCU [1982a]) Let d:X* x Bv *X* be a p.r. 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 M-L test. First of ail we see that V(+) is a r.e. set. Let UE consider a (primi-

tive) recursive 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

A = (1 E X * l W < W - m , d ( u , W ) = 21 , is empty. Thin can be done by dovetailing. Let the algorithm which com- putes 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 non-empty. 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 non-empty. If not, p m to the next step, a.a.0. If A in non-empty, 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)-m-l < l(z)-rn,

Page 328: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 315

thus proving that z is in (V($)),,,. Fmally, by Lemma (2.7), we have:

EX* le(z) = n , ~ E (V(4)),,,)

(8.4) Example. Let z be in X* and m in N. h u m e that t(z) > m 2 1. Then the set

H(z,m) = {(Z,l),(Z,2) ,'.., (z tm)) , (3.8)

is a M-L test.

We have: The only condition in Defmition (3.2) which must be checked ia (3.5).

card{y EX* l l ( y ) = n, (z ,q) .EH(z ,m))

=i 0 , otherwise, 1 , i fn = t ( z ) , and 1 q 5 m ,

< P"'/(P-1) 9

because l ( z ) > m 2 q (i.e. p"'/(p-l) > 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 M-L teat. (Recall that the relation y 2 z means that y = zz, for some z in x*.)

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:

card{y E X * l q Y ) = n,(u,q) E@z,m))

Page 329: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

318 Cdudc

Remarks.

are equivalent: a) Let (z,m) be in X* x (N-(0,) . Then the following statements

i) [ (z) > m 2 1, ii) H_(z,m) is a M-L test, iii) H(z,m) is a M-L 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 M-L test, then 1 < p'(')-/(p-l), for every 1 5 q <_ rn, i.e. P(z) > rn 2 1.

b) For all z in X* and m in N-{O} we have:

E h m ) = u H(y,m) U 3'

We finish the presentation of the examples of M-L tests with a non- recursive M-L test.

(8.6) Example. Take A c {a,}* = {X,al,a~ ,..., a; ,... } a r.e. but not recur- sive set (see Example (2.5.16)). Then V = (A-{X,al}) X {I} is a non- recursive M-L 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.

Page 330: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 317

(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 5 j Aset A c X' x N is r.e.

iff (3.11)

A = { j ( i , j ) lj=1,2 ,... }-{.0}, for some i 2 1

. (3.10)

.

Proof. Let (fp))i m-j0) be an acceptable gEidelisation, where + / ' ) : I V - { O } a X x N. We defrne the p.r. function

f:(RV-{o})2 ax' x nv , by the formula:

&!io(i,j) 1 if 4E!ie(i,k) + 04

for all k 5 j , I, otherwise, f ( i d =

where 4gi0 is an universal p.r. function for (+/'))i E ~ - { o ) .

Let us notice that among the p.r. functions hi :N- {O} AX* 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. (MARTIN-LOF [1966b], CALUDE and CHITESCU [1982a]) The set of all M-L 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 M-L 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) l i= 1,2,...}-{4.

We display a procedure of ge:eration, baaed upon Lemma (3.7), which constructs all r.e. subsets of X x IN and modfier only those sets which are not M-L tests (more exactly, makes empty all r.e. eta which are not M-L tests).

R o e e d u t e of constructing the eeetion of T, i.e.,

Page 331: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

318 Cdudc

z = {(z,m) I(i,m,z) E T), for some f i z ed natural number i 2 1: 1. Put z = 0. 2. Put j = 1. 3. If f(i,j) = + then continue indefmitely. 4. Compute f(i,j) = (zj,mj).

5. If l(zj) <_ mi, then put Ti = 0 and STOP.

7. If Ti is not a M-L test, then put 8. Put j = j+l and go to step 3.

6. Put Ti = Ti U H(~j,mj) . = 0 and STOP.

Comments.

a) The test in step 3 is not recursive. But, in case f(i,j) = oq then the algorithm computing f wil l never atop, i.e. it will continue indefmitely, and remains unchanged. If f ( i , j ) # cq then the algorithm computing f will eventually give aa output the pair (zj,mj).

b) In view of the Remark a) following Example (3.5), the step 5 can be considered a preliminary rejection, because if H(z,m) is included in aome M-L test, then H(z,rn) is a M-L teat itself.

c) An concerns step 7, it is obvious that the problem of deciding if for all natural numbers j , m1,m2 ,..., mi, and for all strings z1,z2 ,..., 2,’ the fmite set

i -1

is a M-L test, is recursive. Indeed, condition (3.4) is obviously fulfilled for H, and condition (3.5) must be checked only for 1 5 rn 5 max(m1,m2 ,..., mi) and z in the set {z1,z2 ,..., 2,).

The test in step 7 ia essential, because otherwise we can generate sets Ti which are not M-L tests. This fact relies on the possibility that a finite union of M-L tests of the form H(z,m) need not be a M-L test. See, in this respect, Example (3.9) and the following Remark (CALUDE and CHI- TESCU [1982a]).

d) The procedure either stops after a fmite number of steps or con- thUe6 indefmitely. It stops only when the reetion G is empty; but, it may well continue indefmitely even when

All that remains to be proved can be divided into two steps: 1) For every natural number i , the set Ti is a M-L test, and 2) For every natural number i , if 4. is a M-L teat, then Ti = A,. (Recall that A, = {f(i,j) I j=1,2 ,... }-{a}.)

ia fmite.

Page 332: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 319

1) The interesting case is that one when the procedure continues indefinitely (see the procedure and Comment d) above). Obviously, q is r.e. If (z,m+l) is in z, then (z ,m+l) is in some H(zj,mj), therefore

For the sake of a contradiction suppose the existence of the natural (2,m) is in H(Zj,rnj) c z.

numbera m and n, such that

card{z EX* l t ( z ) = A , ( z , ~ ) E q} 2 p""/(p-l) . t

But, q = UH(zj,mj), for some 1 5 t 5 cq where f(i,j) = (zjymj).

Hence there exist distinct strings ~,~,z,~,...,zj~ of length n, such that jl < j2 <...< j,, r 2 p""/(p-l), and m 5 min(mjl,mja ,..., mjr). In view of step 7 the set

j-1

jr

H = IJH(zj,mj) v j-1

is a M-L test, consequently,

ciud{z EX* It(%) = n,(z,m) EH) < #"'/(p-l) . Since the set {z EX* le(z) = n,(z,m) EH} contains at least r elements (i.e. zjl,zjs, ..., zjr) and r 2 p""/(p-l), it follows a contradiction.

2) Notice that 4. = 0 implies q = 0 (though the procedure never stops). Aasume 4. z 0.

We prove that 4. c T i , i.e. (zj,mj) E q, for every j 2 1 such that f(i,j) = (zj,mj)*

i) For k=1,2 ,..., j , we have

(because the test in step 5 ie passed). Indeed, it is Been that

zk E B = {z E X* It (2) = t (zh),(Z,mh) E Ai) 9

therefore

AP-1) 9

(sk 1-k 1 < card3 < p

because A, is a M-L test. ii) For every natural number t 2 j , the set

t

H = IJH(zi,mi) 9

i-1

is a M-L test (step 7 is paesed). Indeed, it is Been that all the fmite sets H(zl,m1),H(z2,m2), ...a( zt,m,) are included in the M-L t e n t 4.. Their

Page 333: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

320 Cdudc

union H is also included in the M-L test 4. and haa the following addi- tional propert7:

(z ,m+l) E H * (2,m) EH , for every m 2 1. Consequently, H is also a M-L test.

iii) Following i) and ii) we conclude that H(zj,mj) c Ti and no “rerorisation” may occur, i.e. # 0. The reader will realire that we have apparently proved more in order to avoid a possible “seroriation” given by steps 5 or 7.

Finally we prove that Ti c A,. Let (2,”) be in $; there exists j 2 1 such that z = z,, m 5 mi, and f ( i , j ) = (zj,mj). Since A, is a M-L test and (zj,mj) belongs to 4. it follows that (z,m) belongs to A, too.

0

(8.9) Example. A fmite union of M-L tests of type H(z,m) need not be a M-L test.

For instance, take p = 2, a1 = 0, o2 = 1, z1 = 00, z2 = 01, and 2 3 = 10. Then H = H ( z , , l ) u H(z2,1) u H(z, , l ) ia not a M-L test (it violates condition (3.5)).

0

Remark. Assume, for the sake of contradiction, that the procedure in the proof of Theorem (3.8) would contain only the steps 1,2,3,4,5,6,!, and p = 2, a, = 0, a2 = 1. Then take the p.r.. function h:{1,2,3} + X x RV defmed by h ( j ) = z j , j = 1,2,3, where the 2’s are those of Example (3.9). For a fmed f M in Lemma (3.7) there exists some natural number i such that h ( j ) = f ( i , j ) , j = 1,2,3. The procedure (without step 7) will produce the non M-L test

The next theorem is analoguous to KOLMOGOROV’s Theorem (2.9) expressed in terms of M-L tests.

which is exactly the set H in Example (3.9).

(8.10) Theorem. (MARTIN-LOF [1966b]) There exists a M-L test U with the following universality property: For every M-L test V we can effectively fmd e in PV (depending upon U and V) such that

vm, c u m 9 (3.12)

for every natural number m 2 1.

Page 334: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 321

Proof. Let T be the r.e. set constructed in Theorem (3.8). Defme

u = {(Z,rn) 12 d , m E N - { 0 } ,

(i,z,rn+i) E T, for some i > 0) . Clearly, V is r.e. We prove that it ie in fact a M-2, test.

Firstly, take some (z,rn+l) in U and prove that (z,m) is a h in U. Our hypothesis is therefore that (z,m+i+l) ie in T i . Hence (z,m+i) is in the M-L test q, i.e. (z,m) is in U.

Secondly, for all natural numbers n and m with n 2 1 we have:

card{z EX4 It(=) = A,Z E Urn}

= card{z EX* lt(z) = n, there exiata an i such

that (z,m+i) E K }

< gp"++)/(p-l) i t 1

= p""/(p-1)2

SP*-/(P-- l ) *

Finally, let V be an arbitrary M-L test. In view of Theorem (3.8) we find some natural number i such that V = {(z,m) 1% EX*,m E N-{0}, (i,z,m) E 2"). Consequently,

v,, = {z EX* I(i,z,n+i) E TI

c {z EX* I(z,m) E U}

= u, . The constant e is therefore equal to i, and this ends the proof.

0

The previous theorem enables us to give:

(S.11) Definition. A M-L test U satisfying condition (3.12) in Theorem (3.10) wil l be called an uniuereal M-L tcet.

Comment. An universal M-L test possesses the following intuitive pr- perty: if a string is random with respect to that test, then it is random with respect to every conceivable test, neglecting a change in the level of significance.

Page 335: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

322 Caludc

(8.12) Lemma. A M-L test V is finite iff the section V, is fmite.

Proof. We must prove that in case Vl is fmite, V is itself fmite. Assume V, # 0 (in the opposite case V itself is empty) and put n = max(t(z) 12 E Vl). Take a natural number m 2 n. Then V , must be empty, because otherwise every z in V, would have e(z) > m (notice that V, c VJ On the other hand

V1 IJ Vz > s e e > Vn-1

and

(8.1s) Theorem. (CALUDE and CHITESCU [1982a)) Every universal M-L test U has all its sections U, infmite.

Proof. We shall exhibit an example of a M-L test W having all sections W, infinite. Defme

w = {(%,ma) 12 EX.,m 2 1,z 3 uY+l} . a) The set W is a M-L test. Indeed, it is obvious that W is recur-

sive, hence r.e. For every natural m 2 1, Wm+l c W, = {z EX* Iz 2 a;""}. To check the last property, we fu the natural numbers 1~ > m and we compute:

card{z EX* It (z) = n,z E W,}

= card{y EX* l t ( y ) = n-m-1)

- - pn--l

< Pn-/(P-l) *

b) Obviously, for every natural m 2 1, the section W, is infmite. c) According to Theorem (3.10), there exists a natural number e

such that W,,, C U,, for every m 2 1. Since W,+c is infmite, it follows that Urn is infmite.

0

We introduce another measure of complexity: the critical level induced by a M-L test.

Page 336: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 323

(8.14) Definition. (MARTIN-LOF [1966b]) ZRe critical level induced by a M-L teet V is the function

r n V : X * 4 v , given by

max(m 2 1 Iz EV,), i f z EV,, otherwise.

Remarks.

significance (i.e., p") on which the randomness hypothesis is rejected. a) As in statistical practice, the critical level is the smallest level of

b) We have 0 5 mv(z) 5 t (z), for every z in X'. If z # X, then m v ( 4 < e (4.

(8.16) Theorem. Let U be a M-L test. Then U ia an universal M-L test iff for every M-L test V there exists a natural number c (depending upon U and V) such that:

(3.13)

Proof. Let U be 'an universal M-L test. We prove that the constant e in (3.13) can be taken to be the same as that one in Theorem (3.10), relation (3.12).

The result ia obvious in caae mdz) = 0. Consequently, aaaume mdz) #O, i.e. z E V,,,+). We must check the inequality (3.13) only in caae mv(z)-e > 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 M-L 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(+ 2 m 9

which proves that mv(z) 2 rn 2 1, i.e. z E U,,,dsi C U,.

a

In the follow'ng we shall ehoore a fized universal M-L test U and

Page 337: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

324 Cdudc

we rhell write m inatcad of my.

The following result establishes an aaymptotic relation between KOLMOGOROV’a compkxity K (induced by a fued universal KOLMO- GOROV algorithm) and the critical level m (associated to an univehal MARTIN-LOF test).

(8.16) Theorem. [1982a]) There exists a natural number q such that

(MARTIN-LOF [1966b], CALUDE and CHITESCU

le(Z)-K(z l+))--m(z) I 5 9 (3.14)

for all z in x*.

Proof. Firstly we prove the existence of a natural number c 2 1 such that

e (4 5 K(. It (Z))+m(z)+c 1 (3.15)

for all z in x*. For this inequality we shall use the M-L test V(4) given in Example

Let ua notice that (3.3), with w instead of 4.

my(,,(.) = 0 iff t ( z ) - K ( 2 le(z)) 5 1 . (3.16)

Assume that rnq,,)(z) = 0. Therefore ( (2 ) 5 K ( z l t ( z ) )+ l 5

Now suppose that rnqU1(z) # 0, i.e. t ( z ) -K(z It! (2)) > 1. Accord- K ( 2 le( t ) )+m(z)+l .

ing 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).

for all z in XI. We take e = e’+l, because in case mq,$))’ # 0 one has Theorem (3.15) furnishes a natural c’ such that rn (2) 5 rn(z)+c’,

e ( z ) -K(z le (2))-1 5 m(z)+e’ . Secondly we prove the existence of another natural number, aay d,

e (4 2 K(. It (z))+m(z)-d 7 (3.18)

such that

for all z in x*.

written U = g(aV-{O}) , where The universal M-L k r t U, being infmite by Theorem (3.13), can be

Page 338: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 325

g:N-(0) -+x* x Hv , ie an injective recursive function (see Theorem (2.5.18)). Using the recur- sive 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 M-L test. Moreover,

We have therefore a sequence (Ei)i20 of 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 <...< a,.

We construct the sets Bi = {(g,t(zi)) Ig ECi}, and we put B = UBi . Notice that for distinct i and j we have Bi n Bj = (3, and

i l l A n B = @ .

pletely determined by the following procedure (defmition of 4 on B).

00

The domain of 4 will be A U B. The p.r. function 4 will be com-

Let g ( l ) = (zl,ml). Then put

and notice that t(zl)-ml 2 1 because (zl,ml) is in the M-L test U. Clearly, (a~(’l)-l,t (ZJ) is the fust element in B1, if El is the equivalence

Let g(2) = (z2,m2). There are two possibilities: either ClaM of (zl,ml).

(t(z2),mz) # (t(zl),ml), and in this case put

Page 339: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

326 Calude

or, (t (z2),m2) = ( t (zl),ml), and in this case put

4 ( z 2 ) ) = 2 2 d(a yZ) -x-1

In the rust case ( a 1 '(sx)-',t(z2)) is the fust element in B2, if E2 is the equivalence class of (z2,mZ). In the second case, (aI '(aJ-+a2,e (z2)) is the second element in El. Notice that the last elements do not exist since L'(z2)-m2 2 1.

we have two subcases: The procedure continues: g(3) = (zs,m3). If ( e (zs),m3) = ( e (zz),ml)

i) If (t'(z2),m2) = (t(zl),ml), then one aet

aS,e(ZS)) = 2s 9 f(.))-ms-l

in case p 2 3, or

a d (2s)) and w - 1 - 1 in case p = 2. The elements (a1

(a;(=a)-a-2 a2a ,e (z3)) are respectively, the third element of E l , or the fvst element in B2, according to p > 2 or p = 2. We must check that we have "enough" elements to carry out our construction. Indeed, if p 2 3, the above computation.showa that t'(z3)-m3 2 1. If p = 2 we use the condi- tion (3.5) and we have:

3 5 card{z EX* It (2) = e (zs),(z,m3) E V ) < 2 W-I 9

hence e(z3)-m3 2 2. ii) If (t(z2),rn2) # (t(zJ,mJ, then one set

a2re (23)) = zs * W - m a - 1

Notice that (a1 '('""'-'a2,e (zs)) is the second element in B2. In case ( l (z3),m3) # (l (z2),m2), three subcases appear: a) If (P(z2),m2) = (!(z1),ml), then one set

,e(z3)) = 2 3 9 +(ayl)-?

where (al '(as)-tns,t(zs)) is the fist element in B2, if E2 is the clase of (239m3).

b) If (f(z,),m,) # (f(Zl),ml) and (e(zl),ml) = (e ( 2 s ) m s ) , then one set

Page 340: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 327

. I , t (ZS)) = 2 s I 4(a:(~t)-m,--l

a2,t (23)) is the second element in B,. W - t - 1

c) If (e(z2),m2) f (e(Zl),ml) and ( t (Zl ) ,rnl ) f (t(zs),rns), then one

,%)) = 2 3 9

where (a1

set d(= ;(=t)**

where (a1 “‘””8,t (zs)) is the fist element in Bj.

well-defmed. Notice that the set B has “enough” elements, hence the procedure is

Clearly A and B are r.e. sets. Therefore, d is a p.r. function. We c l a i i that the above constructed p.r. function 4 satisfies the

equality (3.19). Indeed, for a given z in X* two possibilities may occur: A) m(z) = 0. In thia case, for all natural numbers i 2 1 and

rn 2 1, we have g ( i ) Z (z,rn), so +(z,t(z)) = z and no other possibility for obtaining z via 4 occurs. Consequently, K,(z It (2)) = t (2).

B) m(z) f 0. In thia case there exist the natural numbers i 2 1 and rn 2 1 such that g ( i ) = (zi,rni) = (z,rn). The string z = zi may be obtained in two ways via +:

or

d ( ~ 8 (.if) = zi 9

with y in X*, t ( y ) = t(zi)-rni, and g ( i ) = (z,rni). Hence:

K,(z It (2)) = &([ (Z)-mi lo(;) = (Zrmi))

= min (t(z)-m I(z,rn) E V)

= t (2)-max(rn _> 1 I(z,rn) E U)

= t(z)-m(z) . According to Theorem (2.9) there exists a natural d such that:

K ( z It (2)) < K+(z It (z))+d = t (z)-m(z)+d . From the inequalities (3.15) and (3.18) we conclude:

. - d 5 ! ( z ) -K(z lt(z))-rn(z) 5 e

Taking q = max(e,d) we obtain the required asymptotic evaluation

0

(3.14).

Page 341: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

328 Cdudc

Remarkm.

a) The constant g appearing in the inequality (3.14) depends upon w and U.

b) Notice that the equality (3.17) used in the proof of Theorem (3.16) is valid only in c u e mqw)(z) > 0.

We are in a position to specify the statistical properties of the KOL- MOGOROV random strings. We begin by proving that the M-L test BBM)-

ciated to an universal KOLMOGOROV algorithm ie universal.

(8.17) Theorem. (CALUDE and CHITESCU [1984]) Let w :X x N A X * be an universal KOLMOGOROV algorithm. Then V(w) i an universal M-L test.

Proof. Recall that putting w instead of # in (3.7) we get the M-L test

~ ( w ) = {(z,m) Iz E X*,m E N , m 2 1, . and K,(z [!(Z)) < !(z)-m}

In view of Theorem (3.15) it is sufficient to prove that V ( w ) satisfies the relation (3.13). To this aim we use an universal M-L test U provided by Theorem (3.10): For every M-L test V there elcists a natural e such that

m v k ) I mu(z)+e t (3.20)

tor every z in x*.

such that Using Theorem (3.16) for the pair (w ,U) we get a natural number q

m u k ) I W - K & l W ) + q 7 (3.21)

for every z in x*. Now let V be an arbitrary M-L test and set t = q+c+l, where c is

obtained from (3.20) and g is the fmed constant satisfying (3.21). We analyse two cases, according to mqw)(z) = 0 or m+)(z) > 0.

If my,)(z) = 0, then by (3.16) we have:

e (.)-& (2 It (4) I 1 (3.22)

In view of (3.20), (3.21) and (3.22) we have:

md.1 5 mu(z)+e

5 W - K & l W ) + P + C

Page 342: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 329

- < q + c + l

= t

= mV(&)+f *

mV(w,(z) = W - K & l W ) - - l *

If m+,(z) > 0, then by (3.17) we have:

Using again (3.20), (3.21) and (3.23) we derive:

mv(4 I mv(z)+c

I W - K , ( z I W ) + Q + C

= my,)(z)+1+q+c

= mV(w)(z)+t 9

which concludes the proof.

(3.23)

0

(8.18) Corollary. Fix an universal KOLMOGOROV algorithm w :X x IV 4X*. Then every random string (associated to w ) with- stands the universal M-L test V ( w ).

Proof. Since z is random it follows that

Kw(z I+ ) ) 2 “4 > w - 1 f

which proves that (z,l) $! V(w).

Comment. Corollary (3.18) shows that the KOLMOGOROV random strings possess almost all conceivable statistical properties of randomness (i.e. they withstand an universal M-L test).

(8.19) Corollary. Every asymptotic random string withstands the universal M-L test V(w) .

Proof. For some natural number m 4 [(z) we have

w. I W ) L w - - m I

consequently (z,m) 4 V(u).

Page 343: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

330 Cdudc

(8.20) Corollary. To every asymptotic random string z and every M-L teat V we can associate a natural number q such that

(ztm+q) 4 v 9

for all naturals m 2 1.

Proof. In view of Theorem (3.17), there exists a natural c (depending upon w and V) such that Vn+c C (V(W))=, for every natural m 2 1. On the other hand, (z ,d) 4 V(W), for some natural d. Hence z (V(w) )d , i.e. z Vm+(d+e), for every natural m 2 1. The constant q = d+c works.

0

Remark. When z is random, q can be taken to be c .

We close this section by stressing that KOLMOGOROV’s complezity-theoretic dc finition of (finite) randomness is compatible with almost all statietieal requirements.

4.4. UNDECIDABILITY THEOREMS

We pursue our analysis of the relevance of KOLMOGOROV’s complexity-theoretic definition of (fmite) randomness by proving that the (asymptotic) random strings are, in a strong sense, non-conatructable. This result reinforces the adequacy of KOLMOGOROV’s approach.

We begin with aome preliminary results.

(4.1) Theorem. Let w :X* x IV A X * be an universal KOLMOGOROV algorithm and let a:RV -+ nV be a (non-neceesarily recursive) function such that lim a(.) = 03.

n -3c

Then every partial function f :IV * X * satisfying the condition

K,(f (n) In) 2 a(*) and n E dom(f) 7 (4.1 1 for an infmity of naturals n, hae no p.r. extension. In particular f itself ie not a p.r. function.

Page 344: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 331

Proof. For the sake of a contradiction, w u m e the existence of a p.r. function F:BV S,X* which extends f. We construct the audliary p.r. function

4F:X* x Ax*

given by 4F(z,n) = F(n), for all z in X* and n in dom(F). Notice that from condition (4.1) it follows that the domain of f is infmite, hence, the domain of F is abo infmite.

In view of Example (2.4) (with F instead of f) we have:

K,p(.) I.) = 0 9 (4.2)

for all n in dom(F). Furthermore, if n is in dom(f), then

because F(n) = f(n).

(depending upon w and F) such that KOLMOGOROV’s Theorem (2.9) furnishes a natural number e

for all n in dom(f). From the divergence of function a we conclude that a(.) > e 0.c.

We use condition (4.1): ultimately we can fmd a natural number n in dom(f) such that

K u ( f ( 4 1.1 2 4.) > e - (4.5)

The relations (4.4) and (4.5) are contradictory, thus ending the proof. 0

Remark. The recursive functions a(.) = n, a(.) = n%, and a(.) = Pog2n] satisfy the condition of divergence used in Theorem (4.1).

(4.2) Lemma. Let A C X* be an infmite r.e. set. Then there exists a p.r. function F:N S, X* having the following properties:

The domain of F is infmite. ( 4 4

’ The range of F is contained in A. (4.7)

For every n in dom(F), t (F(n)) = n. (4.8)

Furthermore, if for all z and y in A, z # y impliss t ( z ) # t (p ) , then:

Page 345: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

332 Cdude

The function F can be taken to be injective. (4.9)

The range of F is exactly A. (4.10)

Proof. From the recursive enumerability of A it follows that A is the range of some injective recursive function f :N + X*. The p.r. function F:RV %X* will be given by the following procedure:

1. Put a = 0.

2. Put F(!(f(i))) = f ( i ) .

3. Put i = i+ l .

4. If t ( f ( i ) ) = t(f(j)) , for some j < i , then go to step 3. 5. Go tos t ep 2.

Property (4.6) follows from the infinity of the set A and the fact that step 2 in the procedure which computes F is reached infinitely many times.

From the construction of F we easily conclude that (4.7) and (4.8) hold.

Under the assumption that for every natural number n there is a t most one string of length n, the test in step 4 is always overpaaeed. Con- sequently, for all naturals n and m in dom(F) such that F(n) = F(rn), there exist two other naturals i and j satisfying the equalities

F(n) = F ( W i ) ) ) = flil F(m) = F ( e ( f ( j ) ) ) = f ( i ) I

n = e(f(;)) = e(f(j)) = m

I

(see the procedure defming F). Hence

which proves (4.9).

that range(F) = range(f) = A. We fmish the proof with the equality F(t(f(i))) = f ( i ) which shows

0

(4.S) Theorem. Let w :X* x RV ax* be an universal KOLMOGOROV algorithm and let a:BV --+ BV be a (non-necesearily recursive) function such that lim a(.) = oa

n -00

For a set A C X* we consider the following properties:

The eet A is infmite. (4.11)

Page 346: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 333

For almost all z in A , K , ( z It(.)) 2 a( l ( z ) )

For all z and y in A, if [(z) = l ( y ) , then z = 9

For infdtely many z in A, K, (z it (2)) 2 a(t (2))

. (4.12)

(4.13)

(4.14)

If A has the propertiee ((4.11) and (4.12)) or ((4.13) and (4.14)), then

. .

A is not r.e.

Proof. Suppose that A fu l f i i (4.11) and (4.12). For the sake of a con- tradiction, assume that A is r.e. In view of Lemma (4.2) there exists a p.r. function F:RV ax*, having an infmite domain and range(F) C A. For almost all n E dom(F) we have: t (F(n)) = n and K,(F(n) ( t (F(n))) = K,(F(n) In) 2 a(n) , because F(n) E A. This contradicts Theorem (4.1).

Suppose now that fulzills A (4.13) and (4.14) and asoume by rcduetio ad obeurdum, that A is r.e. By Lemma (4.2) there exists an injective p.r. function F:N ax* such that range(F) = A and for every n in dom(F), t (F (n ) ) = n. Then there exists an infmite subset Y of dom(F) such that for every n in Y we have: F(n) € A , t'(F(n)) = n and K, (F(n) It (F(n))) = K, (F(n) in) 2 a(n), thus contradicting Theorem (4.1).

0

Remark. Theorem (4.3) is consistent! In fact, conditions (4.11) and (4.12) are satisfied by the identity function a(.) = n and the set of all raidom strings (see Theorem (2.14)). Again let a(.) = n and let A be a set of strings satisfying (4.13) and containing an infrnite set of random strings; we have a model for (4.13) and (4.14).

For the rest of this section fm an universal KOLMOGOROV algo- rithm w ; K = K,.

(4.4) Corollary. For every natural number m 2 0, RAND, is immune.

Proof. Let a:N + N be the function a(.) = n A m . Let A be an infmite set of m-random strings. Obviously, lim a(.) = 00; since A ful-

f i conditions (4.11) and (4.12) in Theorem (4.3) we conclude that RAND, is immune.

R

n - m

Page 347: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

334 Cdudc

(4.6) Corollary. (ZVONKIN and LEVIN [1970]; CALUDE and CHI- TESCU [1982b]) The set RAND is immune.

Proof. Set m = 0 in Corollary (4.4). 0

(4.6) Corollary. The set X*-RAND, ia not recursive, for every natural number m . In particular, XI-RAND is not recursive.

Proof. Directly, from Corollary (4.4) and Theorem (2.5.7).

0

(4.7) Corollary. Let m be a natural number. Then there ia no recursive function f :N - X* such that for every natural n we have t ( f (n)) = n and K( f ( n ) In) 2 n A m .

Proof. Take A = range( f ). Since A satisfies conditions (4.13) and (4.14) in Theorem (4.3), it follows that A is not r.e. We have arrived at a con- t r adic t ion.

0

Remsrks.

a) Corollary (4.7) shows that the “m-random strings are not con- structable”, in fact, strongly non-constructable, by Corollary (4.4). Tireee reeults point out that, in a strong .sense, there i s no “algorithmic rule” for generating m-random strings. In other worde, there are no afgo- rithmie tooh for uniformly recognizing m-random stringe, thus reinforc- ing the adequacy of KOLMOGOROV’s defmition of fmite randomness.

b) Corollary (4.7) stresses that the existence of m-random strings cannot be constructively proved. Hence, Theorems (2.14) and (2.17) can- not be proved in any constructive way.

(4.8) Corollary. (MARTIN-LOF (1966bl) The function

K:x*+w , defmed by I?(=) = K ( z It(=)) ia not recursive.

Proof. If I? were recursive, then one_ should fmd a recursive function which produces aiI 2 in X* such that K ( z ) _> t(z), i.e. the set of all ran- dom strings, thus contradicting Corollary (4.5).

0

Consider the set

Page 348: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 335

(4.9) Corollary. If for an infmity of natural numbers n one has

K(zlz 2...z2, In) >_ n n r n , 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 non-constructable global property is not a decisive argu- ment for a good defmition of randomness. For example, the set

A = {z E X * IK(z It (4) 2 [logp(t (.))I> 1

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 M-L testa.

(4.10) Lemma. A M-L 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, xv:X x IV -+ {0,1} can be defmed by

1 , i f r n v ( z ) 2 m > O ,

xv(z7m) = (0 , otherwise,

which proves that V is recursive.

induced by Vcan be expressed by the formula Conversely, suppose that xv is recursive. Then the critical level

E WT Ixv(z,m) = 1) , if xv(zJ) = 1 , otherwise.

Hence, my is recursive.

Page 349: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

338 Cdudc

(4.11) Theorem. The universal M-L 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& l t ( Z ) ) 2 q+1> 9

we deduce that the set of 1-random 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 M-L test V ( w ) ie not recursive.

b) Each universal KOLMOGOROV algorithm w has non-recursive 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) E V(w) - w ( a r , W ) = z , for some y in X* with e ( ~ ) < e(z)-m, contradicta Theorem (4.11).

0

Following CHAITIN [1974], we consider a formal system to be a pro- gram for listing the set of theorem and the time at which a theorem is written out to be the length of its proof.

We try to formaliie these ideas. Let P,(X*) be the set of all fmite subsets of X*. Consider a recursive function

F:X* x lN -., P,(X*) , such that

F ( z , n ) C F(z,n+l) , (4.15)

for all z in X*, and n in I?. The recursive function F defines the rules of in ference of a class of

formal systems. The value F(u,n) is the fmite (pomibly empty) set of the theorems that can be proved from the axioms coded by the string E in X*, by means of the proofs of length shorter than n.

A recursive function F defming the inference rules of a formal eye tern can be described by the composition of a recursive function

Page 350: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 337

+:x*xBV-+x* ,

a:x* + P,(X*) . and a (primitive) recursive bijection

More precisely,

(4.12) Definition. (CHAITIN [1974]) The ordered pair <F,e> where

F:X. x Hv + P,(X*) , ia a recursive function satisfying (4.15), and 8 is a string in X* (the codifi- cation of the set of axiom) is a f o r m a l eyetern.

Notice that a formal system <F,8> implies both the choice of infer- ence rules and the codification of axioms.

(4.14) Definition. The set of all theorems deducible in the formal system <F,8> is

(4.16)

Recall that in the proof of Theorem (2.9) we have constructed an universal KOLMOGOROV algorithm w :X* X RV ax* by means of an universal p.r. function $mie:X* x (X* x nV) S,X* and three recursive functions T, f , and g. In what follows we shall make use of these func- tions.

Fix a formal system <F,e > having the following two properties:

The propositions of the form “K(z In) > m”

can be coded as a recursive subset of X* . (4.17)

The formal system <F,e > ia mund with respect

to all propositions of the form “ K ( z In) > m”,

i.e. if a proposition “K(z In) > m” belongs to m ( F , 8 ) ,

then K ( z In) > m . (4.18)

Page 351: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

338 Cduds

(4.16) Theorem. (CHAITIN [1974]) For every formal system <F,s> 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. Put 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(v In) > 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.) 5 Q Y In)+q v

for (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

= q8)+2(q+i)+q

= e ( 4 + 3 q + 2 .

= e (8) i - t (T(Z))+q

In view of (4.8) and step 5 in the procedure which computes 4, we

Page 352: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 339

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 <F,e> only when

0

m < t ( 6 ) f C .

(4.16) Corollary. (GODEL) For every formal system <F,e> having the properties (4.17) and (4.18), there exista a true proposition of the form “ K ( z 11 (z)) > t (2)” which is independent of <F,e > (i.e., neither the pro- position 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 <F,s >, for it violates the condition C (z) < e(5)+e. The negation of the proposition “ K ( z I t? ( 2 ) ) > t (2)” cannot be a theorem of the formal sys- tem <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 non-constructive) methods of proof avsil- able 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) Put 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

Page 353: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 M-L 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 M-L 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 M-L test .V(#) defmed by

V(4) = {(z,m) I. d , m E J V - { O ) ,

K,(z I+)) < W - m ) (5.1) Notice that (z,m) cV(4) iff there exiats a string g in X* with ( ( y ) < t'(z)--m and 4(p,t'(z)) = 2.

This example suggests the following defmition.

(6.1) Definition. (CALUDE and CHITESCU [1983a]) Let V C X* x IV be a M-L 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 M-L test H(z,m) in Example (3.4) is representable. Take for instance the p.r. function #:X* x N A X * , given by q5(a:(*)*-',t'(z)) = 2. Since K,(z lC(z)) = .t?(z)--m-l, we have

0

H(.,m) = V(0).

Page 354: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Cbrpkr 4 341

(6.8) Example. The M-L 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 9 ( 5 4

thus proving that H(z,m) = V(4). Set

d(apl(s)*-1 ,+)) = 2 . For every natural t > !(z), we consider the sets

4 = {Y EX*lY 3 z , w = t}

Bt = ( 2 EX* l t ( 2 ) = t-rn-1}

9

and

. Clearly, t-m-1 > t(z)-rn-l 2 0; so, Bt # 0. Moreover,

C a r d B t . (5.3) c a r w = pt-'(s) < pt--l = - We order the sets 4 and Bt in the lexicographical order induced by

u1 < u2 <...< up, thus obtaining 4 = {gl,v2 ,..., g,} and Bt = {zl,iq ,..., z,}. In view of (5.3), 8 5 r . Now defme

+(Zi,t) = gi 9

for every i=1,2 ,..., 8 .

Clearly is a p.r. function satisfying the relation (5.2).

0

(6.4) Example. There exist universal and representable M-L tests. Take, for example, an universal KOLMOGOROV algorithm w :X* x h' ax*, and consider the M-L test V(w) (see Theorem (3.17)).

0

Unfortunately, not all M-L testa are representable.

(6.6) Example. Take p = 2, u1 = 0, a2 = 1. The set

v = ~ ~ ~ , ~ ~ ~ ~ ~ ~ ~ , ~ ~ , ~ ~ ~ ~ , ~ ) ~ 9

b a non-representable M-L test.

Obviously, V is a (fmite) M-L test. We shall prove that V is not representable. Suppose, by absurd, that there exists a p.r. function d:X* x hT a x * such that V = V(4). We can infer the existence of three strings go,yI,gl in X*, l? (ui) 1, such that

Page 355: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

342 Cdude

+(y0,3) =

+t111,3) = 010 9

+ ( ~ 2 , 3 ) = 111

It follows that {y0,yl,y2} = {A,O,l}. For instance, we choose @,3) = OOO (and 4(0,3) = 010, +(1,3) = 111). For this t# we must have (000,2) E V(4), because t? ( A ) = 0 < t? (000)-2 = 3-2 = 1. This proves that (000,2) E V(4) = V, which is a contradiction.

0

In order to avoid this situation we “enlarge” the primary alphabet X = {a1,a2, ..., ap}, p 2 2, by adding a single new elment ap+l (distinct from ai, 1 5 i 5 p). We obtain the new alphabet Y = {a1,a2,...,ap,ap+1}.

In this case, every M-L test V c X* x IV can be viewed as a M-L test V c r‘ x N. We shall prove that all such M-L teats are represent- able and, in fact, the p.r. function 4 : f x lN af which represents V (i.e. V = V(+)) can be taken to have its range included in X*.

(6.6) Theorem. (CALUDE and CHITESCU [1983a]) Let X = {al,a2~..,ap}, p 2 2, and Y = X U aa before. For every M-L test V C X x lN there exists a p.r. function

4 : y ‘ x N & f , such that V = V(+), and range(+) C X*.

Proof. Only the non-trivial case V # 0 will be considered. Let UB con- sider the lexicographical order on f induced by a1 < a2 <...< ap < ap+l.

We shall construct a p.r. function 4 : f x N &f having the pro- perty

K& I[ (4) = e (z)-w(z)-l ? (5.4)

for every z in X* for which (z,1) E V. (For the motivation see the p.r. function 4 exhibited in Example (5.3).)

We distinguish two cases: a) The M-L test V is infinite, and in‘this cane there exists an injec-

tive recurshe function g : N - ( 0 ) -+ X* x IV, such that range(g) = V. b) The M-L test V is finite, and in this caee there exists a (p.r.)

injective function g:(1,2 ,..., q } + X* x hr, such that g({1,2 ,..., q } ) = V (we have assumed that cardV= q). In both canes we shall write g(i) = (zi,m,), for every i in dom(g).

We shall describe the action of 4, on the basis of an uniform p r e cedure (which stops after a fmite number of steps in case V is fmite). We

Page 356: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 343

proceed similarly to the construction of the p.r. function 4 in the proof of Theorem (3.16).

Let g( l ) = (zl,ml) and set

In the latter case set

The construction is possible because t (za)-m2 > 0 ((z2,m2) belongs to the M-L test V). If the additional equality (t (z2),m2) = (t (zl),mr) holds, then we have (in view of (3.5)):

2 5 card{z EX. (2) = t (zz), (%,ma) E v)

which proves that t (2,)-m2 2 2.

(t (zi),mi) + (t (zj),rnj), for'all j=l,2,...,i-1, put In general, at step i > 1, let g(i) = (zipti). In case

In the opposite case, let

1 <_ 8 = card{j E IV l i 5 j < 1, and (t (zj),mj) = (t (zi),mi))

(the k t inequality is a consequence of condition (3.5) for the M-L test V). The elements 8 in f, having t ( y ) = t(zi)-mi-l, are (in lexicographical order):

Y 19Y21.*-9Yr I

where e (s;)-mi -1

r = (p+ l )

Put

The construction is possible because

Page 357: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

344 Cdudc

> ((pw+ -l)/(p-1))-1 2 8 . t(+6;-1 r = (p+l)

It is obvious that 4 sets as a function. Moreover, the above pro- cedure stops after the analysis of g(q), when V is fmite and hss exactly q elements; otherwise, the procedure continues indefmitely.

To be more precise, we shall describe the domain of 4. To this aim, we partition the range of g according to the following equivalence relation:

g( i ) g(i) * (k'(zi),mi) = (k'(Zj),mj) *

The equivalence class of an element (zi,mi) contains a t most h elements, where

pair

B =

W(P-1) * h = (p'(si)*i-

00

So, the range V of g is the union U E j , of equivalence classes Ej (m case V

is infmite) or is a fmite union U E , (in case V is fmite). For every

equivalence clasa Ej - which contains t elements - we consider the set Cj consisting of the lexicographically last t strings of length k' (zj)-mj-l; here Ej is the CIME of (zj,rnj). Put then Bj = {(y,t (zj)) Iy E Ci}, for the above

j-I 8

j -1

m

(zj,mj). The domain of 4 ia B = UEj, (in case V is infmite), or

U E j , (in case V ia fmhe).

Take z in X* such that (z,l) E V, so mv(z) > 0. There exists an

j-1 s

j-1

. . - . ~

unique natural i > 0 such that g(i ) = (z,mv(z)). According to the pro- cedure, 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)--mj-l, 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 , ( ~ l e (2 ) ) 2 e(~)--my(~)-i . ( 5 4

From (5.5) and (5.6) property (5.4) follows, thus proving the inclusion

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 to the defmition of the critical level we have

vc V(4).

Page 358: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 345

(z,mv(z)+l) EV(#), which yields an y in Y' such that l (y) < t (z)-m,,(z)-l, and d(v,.f ( 2 ) ) = z. This contradicts property

0

(5.4).

Remark. If V is a representable M-L test, then the equality V = V(4) holds for many p.r. functions 4. The p.r. function 4 furnished by the con- struction 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 M-L test V, and an infmite M-L test W, which are both non- represen table.

Proof.

strings a) Let p 2 2 and put 8 = (pp-l)/(p-l). We consider 8 difrerent

Y1,12,"',J, 9

in X*, with length t(yi) = p + l . We claim that the frnite M-L test,

v = ((ri , i) li=1,2 ,..., 4 , is non-representable.

tinct) strings Indeed, if V were representable, then we could fmd the (mutually dis-

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 p-2. So, b(z,,p+l) = yt, and

w I P-2 < %/,,)-2 *

This shows that (yt,2) E V(O), contradicting the construction of V.

constructed at a). b) Put W = V u {(ai , l ) )i=p+2,p+3, ...}, where V is the M-L t e s t

0

Page 359: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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?x Bv A X * such that the M-L test V(4) over f x RV is not a M-L

test over X* x BV.

Proof. Let X = {a1,a2,...,4p} and Y = X U {ap+,}. We order X* lexico- graphically according to a 1 < a2 <...< ap, and r‘ according to a1 < a2 <...< ap < ap+l.

Let A = {y E f IL(y) < p) = {~~~...~y~,...,g~}~ in 1exic:graphical order. I t is seen tha t t = ((p+l)P-l)/p. Let B = {z EX l t(z) = p + l } = {z1,z2 ,..., z,}, in lexicographical order. We have 8 = pp+’ > 1 .

The domain of 4 is the set D = {(ui,p+l) li=1,2, ..., t } . We defme 4:D - X*, by 4(yi,p+1) = zi.

The set V(4) is a M-L test over r‘ X dv. On the other hand V(4) C X* x RV; a simple computation showa that

card{% EX* le(z) = p + l , ( z , l ) E V(4)} = t > (pp-l)/(p-l) , asserting that V(4) is not a M-L test 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 com-

plexity function K,) and MARTIN-LOF (bssed on the critical level rnv) are not equivalent, according to Example (5.5).

b) Considering the MARTIN-LOF theory over an “enriched” alpha- bet (in fact, an alphabet containing one more element) we can exactly express the M-L tests ae objects in the KOLMOGOROV theory.

c) For every natural p 2 2, and for every alphabet X with p ele- ments, there elcists a M-L test over X* x RV which in non-representable (see Proposition (5.7)). So, every non-repreoentable M-L 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 non-representable M-L tests! And the “enlargement” may continue indefmitely.

2) Proposition (5.8) goes in a “converse direction”. Here, there are “too many” representable M-L tests over the enriched alphabet. Hence, the KOLMOGOROV theory over an alphabet with p elements is not equivalent to the MARTIN-LOF theory over an alphabet with p + l ele- ments.

Page 360: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 347

Comments. In Remark 1) following Corollary (2.8) we have pointed out the distinction between the binary and the non-binary cases in the KOL- MOGOROV theory of complexity. The representability analysis stresses this distinction; moreover, the same remark can be done for the MARTIN-LOF theory of complexity.

The following result shows that, in a sense, the representable M-L test are “economical”.

(6.9) Propoeitton. For every representable M-L test V the following ine- quality holds:

card{z EX* It (2) = n,mV(z) = m} 5 pn-cn-l , (5-7)

for all natural numbers n and m, n > m > 0.

Proof. From hypothesis there exists a p.r. function #:X* x IV ax*, such that V = V(4).

Fix the naturals n > m > 0. For every z in X* satisfying the condi- tions 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 n-m-1.

Actually, we shall prove that t ( y ) = n-m-1. Suppose; by absurd, that t (y) 5 n-m-2. Let [ (y) = n-m-14, with h > 0. This leads to the false relation (z,m+h) EV. Indeed, t ( y ) = n-,-h-1 < n-m-h and 4(y,t (2)) = z, thus showing that (z,m+h) E V(4) = V.

The just proved equality t (y ) = n-m-1 shows that

card{z EX* lt(z) = n,mv(z) = m}

5 card{y EX’ It (y) = n-m-1)

= pn-m-l

0

We continue this section with a result establishing a precise relation between the KOLMOGOROV complexity K, and the critical level induced by the M-L test V(#).

(6.10) Theorem. Let V = V(4) be a representable M-L teat. The follow- ing aseertions hold for all z in X.:

my(.) = 0 iffK,(z I+)) 2 t(z)-l * ( 5 4

(5.9) If my(.) > 0, then K+(z It (2)) = t (z)-mv(z)-l . In the particular case when range(#) = Vl, the equivalence (5.8) can

be stated more precisely, namely:

Page 361: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 le(Z)) 2 e(z)-i.

Suppose that K,(z It (2)) 2 t (z)-l. There are two cases: i) if K,(z le(z)) = q then +(y,e(z)) # 2, for all y in X*, and then

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) B v(4) = v,

(ZJ) 6! V(+) = v. Hence (5.8) was proved. According to the hypothesis, there exists a string y in X* such that

card{z EX* le(z) = p+l,(z,l) E V(+)} = t > (p’-l)/(p-1) 4(y,t(z)) = 2. We have:

, 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)) = 2,

for some y in X* with m < 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,

0

then (z , l ) # V, i.e. z range(+). Hence K,(z “(2)) = oa

Remark. We have (V(+)), C range(+). So, the condition V, = range(+) in Theorem (5.10) can be equally stated as range(+) C V,.

Page 362: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 349

d . 9 . ) =

(6.11) Corollary. GOROV algorithm. Then, range(w) # (V(W))~.

Let w :X* X N S,X* be an universal KOLMO-

I

zt , if n 2 t (z)+2, z = y ( 8 ( t (z)-l)+i), and t = pr[e(z,) = n,m, = n-t(z)-l,

and card{j E h v 11 5 j 5 r,e(zi) = n,

mj = n-e (Z)-l} = i] E hv,

00 , otherwise, \

Proof. Use Theorem (5.10) and the relation Ky(z le(z)) # cq for every

0

Recall that the enumeration of X* in the lexicographical order induced by a y < az <...< a,, is given by {y(n) In 2 11, where y(1) = A, y(2) = a1 ?..., y(p+l) = ap, y(p+2) = alal ,... . It follows that ap" = y(#(m)), where s (m) = z p ' = (pm+'-1)/(p-l).

z hX*.

ln

id

(6.1%) Theorem. (STAIGER [1984) (added in proof)) Every M-L test V C X* x IV satisfying the condition:

card{z EX* l l ( z ) = n,(z,m) €V) 5 p"-"'-' , (5.11)

for all naturala n,m 2 1, is representable.

Proof. As in the proof of Theorem (5.6), fu an injective recursive (or, fmite) enumeration g for V, i.e. range(g) = V.. Put g ( i ) 7 (q,mi), for each i E dom(g). We define the p.r. function 4 :X x IV A X aa follows:

zt , if n 2 2, and t = pr[t(z,) = n,

m, = n-11 EN, I 00, otherwise, b o d =

and

for z # 1. We shall prove that V = V(4).

First, assume that (2,rn) EV, i.e. (z,m) = (zt,rnt), for mme t 2 1. Since t ( 2 ) > m, two caaee may occur:

a) If ! ( z ) = m+l, then put z = X and notice that +(X,m+l) = z. Indeed, in view of (5.11), there ie an unique string y of length m + l euch that (y,m) E V, namely y = 2.

Page 363: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

350 Cdudc

b) If e(z) > m + l , then we compute the number

i = card{i EN 11 5 J' 2 t , t (z,) = t(z),m, = m } , and we notice that, by hypothesis and (5.11), 1 5 i 5 pe(')--'. In this c w we put E = y(.g(t'(z)-rn-2)+i) and it is easily seen that

In both cases we have found a string z of length e(z)-m-l such that ~(z,!(z)) = 2, thus proving that (z,m) E V(6).

Conversely, if (z,m) E V(t#), then we can fmd a string z in X* with ! ( z ) 5 t (z ) -m-l such that # ( E , ~ ( Z ) ) = 2. In view of the construction of 4, we fmd a t E RV, with # ( E , ~ ( z ) ) = zt and mt = e(z)-e(z)-l 2 t (z ) -e (z)+m+i- i = m. Consequently, z = zt, (zt,mt) E V, and m 5 mt; 80, (z,m) E V, thus ending the proof.

d(z,t (4) = 2 *

0

Remark. Example (6.7).

The condition (5.11) is not necessary. See in this respect

(6.18) Corollary. (STAIGER [1964]) Let V C X* x RV be a M-L test and let u E X*-{A}. Then the set

tbv = {(=,m) I(z,m) E v) !

is a representable M-L test.

Proof. For all naturab n,m 2 1, we have:

card{y EX*

= card{z EX* (y) = n,(y,m) E uV)

(2) = n-e (u),(z,rn) E V)

5 (p"-e(.)- - 1 )/(P - 1) 5 pn--1 ,

because t (u) 2 1. Hence uV satisfies the condition (5.11), being represent able by Theorem (5.12).

0

(6.14) Theorem. (STAIGER [1984]) There exieta a M-L test V c X* x Bv such that the relation V c V(4) faib to hold for every p.r. function 4 :x* x N 4 x*.

Page 364: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 . 351

=

I 0, (y(s(n)+l), ...,y( e(n)+p+l)}, if n 2 3,l I m I n-2,

{y(e(n)+W,

,0 9 otherwise.

if n 5 2,m 2 0,

if n EA,m = n-1,

b (8 (a )+2)1, if n EB,m = n-1,

Proof. Firstly, we prove the following combinstorial result:

the condition Intermediate etep. Let W C X* X PV be a M-L test which satisfies

card{% EX* I!(z) = n,(~,m) E W ) = (p""-l)/(p-1) , (5.12)

for some naturals m,n 2 1. If W C V(+), for some p.r. function +:X* x JV ax*, then 4 maps the set {(z,n) Iz EX', !(z) 5 n-m-1) in an one-to-one manner onto the set {y EX* It (y) = n, (y,m) E W).

Indeed, in view of the relation W C V(+), we have mw(z) 5 myc,,(s) = e(z)- K,(z lt(z))-l, for all z in W, (see Theorem (5.10)). Hence, for every EX* with !(y) = n and (y,m) E W, (i.e. mw(y) 2 m), there is a string z, in X with t (z , ) 5 n-rn-1 and +(z,,n) = y. Since there are a t most (p"--l)/(p-l) strings of length less than n-m-1, the assertion of the Intermediate step follows from (5.12).

We continue the proof by picking two r.e. sets A,B C JV which can- not be recursively separated (see Theorem (2.9.8)). Furthermore, assume that 0,1,2 A U B .

We defme the M-L test V C X* x EV an follows:

(Recall that { ~ ( n ) In 2 1) is the enumeration of X* in lexicographical order.)

Clearly, V is really a M-L test. Suppose, by contradiction, that v c ~ ( 4 1 , for some p.r. function #:x* x PV AX*. Since for every n 2 3, card{z EX* It (2) = n, (z,n-2) E V) = p + l , we can use the Inter- mediate step to derive that the restriction of the p.r. function # to the set X U { A } acts in an one-to-one manner onto the set (y(a(n)+l), ...,y(8( n)+p+l)}. In particular, $(A,.) # 00, for every n 2 3. According to the defmition of V, for each n 2 3, we have:

Page 365: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

352 Cdudc

{YMn)+qh if €4 {4(X,n)} = { V ( 8 ( 4 + 2 ) } , if n EB.

The recursive set C = {n E RV In 2 3, #(A,.) = Y(a(n)+l)} separates the r.e. sets A and 8, thus contradicting our working hypothesis.

0

4.6. RECURSIVE MARTIN-LOF TESTS

In this section we focus our attention to recursive M-L tests. In this context we are able to express some previous facts in a more precise set- ting.

(6.1) Theorem. (CALUDE and CHITESCU [1983c]) Let V C X* X RV be s recursive M-L test. Then we can effectively find a p.r. function d:X* x N a X* such that V C V(t$). Furthermore, 4 can be taken to poeseea the following properties:

4 is injective. (6.1)

(6.2)

(6.3)

The graph of 4 is recursive.

For every z in X*,(z,l) E V iff (z,1) E V(t$) .

Proof. The set A = {(zrmV(z)) Iz E V,} is recursive in view of Lemma (4.10). We distinguish two caaes: i) V is infinite and in this case there exists an injective recursive function g:RV-{0} + X* X w’ such that range(g) = A; ii) V ie finite and A hss q elements, and in this case there elrists an injective (p.r.) function g:{1,2, ...,q} - X* X nV such that g({1,2 ,..., g}) = A. In all caaes, if i is in the domain of 8, we put

Due to the recursiveness of V, we may suppoee that g haa the follow- g(i) = (2; d z i 1).

ing “lexicographical” property: for all natural numbers 1 < i < + (zi) I -t (zj), (6.4)

(6-5) if e(zi) = e (zj), then mv(zi) 2 mv(zi)

We are ready to defme the p.r. function 4. For i = 1, g( l ) = (z1,my(z1)). Put z1 = ~(s(t(zl)-mV(zl)-l)) and

Page 366: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 353

4 ( ~ 1 , ~ ( Z l ) ) = 2 1

Next, let i = 2, 80 g(2) = (z2,mv(z2)).

In c w e (tl) z t (4, we put In case t ( z l ) = t(z2), we consider the greatest element (according to

the lexicographical order) of the set {p(l),g(2), ...,y( 8 (e (22)-mv(z2)-l)))- {zl}, and we call thia element z2.

= v ( ~ ( e (22)-m~(z2)-1)).

In both cases, put

+2,+2)) = 2 2 - Continuing the procedure we reach the step i > 1,

g(i) = (zi,mv(zi)). There are two cases. In the former case e(zi) # e(z,), for all 1 5 j < i; set zi = y(8(e(zi)-mv(zi)-1)). In the latter (opposite) case let 1 j(1) < j(2) <...< j ( b ) < i be all indices 1 5 j < i such that t (q ) = t ( z j ) . In fact j(2) = J(l)+l, j(3) = d2)+i, ..., due to properties (6.4) and (6.5). We defie zi to be the greatest element (m lexicographical order) of the set { ~ ( 1 ) , ~ ( 2 ) , ...,y( 8 ( e (zi)-mV(zi))}-{zj(l),zj(2),...tzj(k)~.

In both cues put

d(zi,e (zi)) = zi . Notice that 4 acts ae a function, because if t(zi) = e(zj ) , then

zi # zj. The construction is possible and here follows the motivation. Put qz,) = e(Zj(q) = e(zj(a)) =...- - P ( ~ ~ ( ~ 1 ) = t . We have:

mi = mV(zi) <_ mk = mV(zj(t)) 5 mk-l

= mV(zj(k-1)) <...< ml = mV(zj(l)) *

For every natural t E {1,2, ..., k} U {i}, let

4 = b(l)lY(2),...,Y(4 --mt--l))} '

Notice that

B1 C 8 2 C-.C Bt C Bi 9

and for every 1 5 u < v ,

E,, = Bo iff m, = m, . We shall describe in detail the action of 4. Clearly,

Zj(1) J ~(8(e-m,-1)) *

In order to obtain ~ ~ ( ~ 1 , we differentiate two possible cases:

Page 367: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

354 Cdude

m1> m2 (6-7)

m l = m 2 . (6.8)

or

If (6.7) holds, then zj(?) = ~(s(t-rn,-l)); in the case of (6.8) we have 8, = B2, 80 zj(2) = Y(d(t-m2-1)-1). It is obvious that in case (6.8) one has s(t-m2-l)-l 2 1, since

2 <_ card{z EX* l t (z) = e,(z,m2) E V)

I (P--l)/(P-l)

= e(t-m2-1) .

The case when the strict inclusion occurs in (6.6) being clearly favourable, we focus our attention on the “bad” situation, i.e.,

mh = mh+l = mh+2 =...= m, = m , for 1 5 h 5 r 2 i . Here, in caae h > 1, we conaider mh-l > mh. We have

zj ( , ) = y(s(t-m-l)-(r-h)) . It remains to show that s(t-m-1)-(r-h) 2 1, i.e. r - - h + l 5 (p‘--l)/(p-l). This relation follows from the inequalitiee

r-h+l 5 card{z EX* It(%) = t , (z ,m) E V)

L ( P l - 4 A P - 1 ) *

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 # zj 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

Page 368: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 365

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) .E V; hence (6.3) was proved.

All it remains to show is the recursivenees of the graph.of 4. Thi 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 M-L test V there are many p.r. functions 4 satisfying Theorem (6.1), e.g. our construction depends on the enumera- tion function g. The converse implication in Proposition (5.9) also holds for recursive M-L tests.

(6.2) Theorem. Let V be a recursive M-L test. Then the following con- ditions are equivalent:

The M-L test V is representable, (6.9)

card{z EX* l l (z) = n,rnv(~) = m} 5 p”--’ 3

for all naturals n > m > 0 . (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’

Page 369: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 pro- cedure 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 (. . ) = e (2j(2)) =...= e (Z j (&) ) = e (zi) , 1(1)

for 1 2 j(1) < j ( 2 ) <...< j(k) < i, we have analysed several possibilities, according to the existence of some equalities in the sequence of inequalities

mv(zj(1)) L mv(zj(2)) >...> m~(z j ( i t ) ) L 4.i) *

In the case of the strict inequality rnv(zi) < mv(zj(k)), we saw that P(zi) = !(zi)-rnV(zi)-l, and again the proof b finished. The most com- plicated cme is when

mV(zi) = mv(zj(i)) = mv(zj(k-1)) =.**- - md2j(k-)) 9

where 0 5 r < k. In this case we must put zi = y(8(t(zi)-mv(zi)-l)-(r+1)). In any case we have r+2 elements z such that P(z) = n and mv(z) = m (we put e(zi) = A , and rnv(zi) = rn) and the hypothesis gives

r + 2 2 pn- -1= card{z E X * l l ( z ) = n-rn-1) . But y(.~(n--m-l)) is the last element (in the lexicographical order) of the set

x"--l= { z EX* lqz) = n-m-~) . It follows that zi EX"-"-', which shows that t ( z i ) = A-m-1. The proof ie finished in this case too.

0

Using Theorem (5.10) we get

(6.8) Corollary. Let V be a recursive representable M-L test and let #:X* x N S, X* be a p.r. function such that

V = V(#) and range(#) = Vl . (8.11)

Then the partial function U,:X* A N given by Lr+(z) = K,(z {e(z)) is a p.r. function with recursive graph.

Page 370: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapkr 4 357

Proof. In view of hypothesis (6.11) we can apply Theorem (5.10). From (5.9) and (5.10) it followe that U, is a p.r. function. Moreover,

( ~ , m ) E Graph(UJ w mV(z) # 0 and m = e (z)-mV(z)-l . Here we have used the recursivenew of the function my (see Lemma (4.10)).

0

Remark. The p.r. function q5 given by the proof of Theorem (6.1) satis- fies the additional property: range(#) = Vl.

(6.4) Theorem. range(q5) = (V(#))l. Then the following assertions are equivalent:

Let q5:X’ x N 44’ be a p.r. function such that

The partial function U,:X’ *Hv given

by V,(z) = K4(z le(z)) is a p.r. function

with a recursive graph. (6.12)

(6.13) The M-L test V(#) is recureive.

Proof. In order to prove the implication “(6.12) + (6.13)” we establish a chain of equivalences: For all (z,m) in X’ X IV we have:

(2,m) E V(4) U , ( Z ) < e (2)- - U , ( Z ) E {0,1,2, ...,[( 2)-m-1} - UdZ) = 0 v U&) = 1 v...v V&) = !(z)-m-l

* ( ~ $ 0 ) E Graph (Vb) V (z,l) E Graph (V,) v ... V (z,e (2)-,-1) E Graph (V,) .

By convention, when .t (2) < m+l, the set {O, l , ...,l( z)-m-l) is void.

V = V(+) and we apply Corollary (6.3) to V and 4. For the converse implication, i.e., “(6.13) (6.12)”, we put

0

The following theorem will furnish a c h of recursive representable M-L tes ts .

Recall that for every set V C X’ x (N-{0}) and for every natural number m 2 1 we have written V, = {z E X * 1(z,m) E V). We defme the critical level induced by V to be the function

Page 371: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

358 Caludc

mV:X* -+NU {m} , sup {m E N Im 2 1,z E V,}, in case such rn exists,

otherwise.

Clearly, thia defmition ia compatible with the defmition of the critical level induced by a M-L test.

(6.6) Theorem. Let V C X* x A’ be a r.e. set such that V,,, C V,, for every natural number m 2 1.

a) The following assertions are equivalent:

For all natural numbers n > m 2 1, we have:

card{z EX* le (2) = n,(z,m) E V) = (p”“-l)/(p-1)

For all natural numbers n > rn 2 1, we have:

card(z EX* lt?(z) = n,my(z) = m} = p

.(6.14)

(6.15)

b) If one of the above conditions (6.14) or (6.15) iS fulfiied for a set V subject to the general hypothesis, then V is a recursive representable M-L test.

n-m-1

Proof.

a) Firstly, we deal with the implication “(6.14) (6.15)”. The hypothesis of the theorem and condition (6.14) eneure that V ia a M-L test, hence my takes only fmite values.

Fix a natural number j and let n 2 j+l. In view of the inclusion V,,, c V,, we have:

{z EX* lt?(z) = n,rnV(z) = n--(j+l)}

= {z EX* l t (z) = n,(z,n-j-l) EV)

- {z EX* lt(z) = n,(z,n-j) EV) . Consequently, according to (6.14), we have:

card{z EX* (P( z ) = n , r n ~ ( z ) = n-(j+l)}

= (( pn -(. +-I) - 1 )/( p - 1 )) - (( pn -in 4- 1 )/(p - 1))

- - p J . Taking m = n-( j+l ) , we obtain (6.15).

natural numbers n > m 2 1. Secondly, we prove the implication “(6.15) =+ (6.14)”. Fix the

For every natural g 2 1, put

Page 372: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 359

In view of (6.15), cardA,,-l = 1. Since A,, C A,,-l, it follows that car* 5 1. The equality car- = 1 would imply A,, = A,,-1, a contrad- iction. Consequently, A,, = (3. Moreover, A, = 0, for all u 2 n. We have proved the equality:

{z EX* le(z) = n,(z,m) E v)

From (6.16) we infer the equalities:

card{z EX* l t ( z ) = n,(z,m) E V) n -1

= card{z EX* le(z) = n,mdz) = j )

n -1 = C pn-i-l - - (Fn--l)/(p-l) .

b) All it remains to prove is that under the general hypothesis, con- dition (6.14) implies the recursivenew of V (because in this case V will be a recursive M-L test satisfying condition (6.10) in Theorem (6.2)).

Clearly, in view of (6.14), V is infinite. Let g :N-(0) + X' x IV be an injective recursive function such that range(g) = V. Put g ( i ) = (zi,mi), for every natural number i 2 1.

We take an arbitrary (z,m) in X* x N and we describe an algo- rithm for testing if (z,rn) is in V. Put t ( z ) = n. There exiets a natural q 2 1 such that the set

G = {9(1),0(2),...,9(~)) 9

contains all the elements (y,m) in V with t ( y ) = n. Moreover, q can be effectively found. For instance, q can be taken to be the l e d natural number h such that the set

( 9 (1),!?(2),...,9(h 1) 9

contains exactly (pn--1)/(p-l) pairs (g,m) with t ( y ) = n. If (z,m) is in G , then (z,m) EV; if (z,m)

0

G, then (z,rn) B V.

Page 373: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

360 Cdudc

(6.6) Definition. A M-L test V satisfying condition (6.14) (or, equivalently, condition (6.15)) will be called full.

Remark. Every full M-L test is recursive and representable by Theorem (6.5).

(6.7) Example. We shall give an example of a full M-L test V and we shall construct its associate p.r. function 9 such that V = V(#), M in Theorem (6.1).

a) Denote, for all naturals n > m 2 1, by A(n,m) the set {(z,m) E Vle(z) = n}. It is clear that V d be completely determined by the sets A(n,m).

Recalling the lexicographical enumeration of X* given by {y(n) In > O} we set

A(n,rn) = {(y(s(n-l)+i),m) li=1,2, ...,s(n-m-l)} . (6.17)

For every natural rn 2 1 one has a,

V, = U A(n,m) . n==m+l

(6.18)

Clearly, V ia a full M-L test. Moreover, for every natural n 2 2, one

rny(y(s(n-l)+l)) = n-1 , (6.19)

haa:

and

rnv(y(s(n-l)+i)) = n-k-1 , (6.20)

for every 1 <_ k 5 n-2, and i E {s(k-l)+l , s(k-l)+2, ..., e ( k ) } .

Also, rnv(z) = 0, for the other z in X*. An inspection of A(n, l ) shows that for n 2 2 we have:

card{z E X * l!(z) = n,(z,rn) EV, for some rn 2 1) = e(n-2) . b) In order to carry out the construction indicated in the proof of

Theorem (6.1), we choose an enumeration function p for the set A = {(z,rnV(z)) Iz E Vl}. This g will satisfy conditions (6.4) and (6.5). Furthermore, p has the supplementary property (which completely deter- mines 9):

If for some i < j one haa [(z,) = e(zj) and

mv(zi) = rnv(zj), then zi is greater than zj

Page 374: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4

in the lexicographical order.

361

(6.21)

Property (6.21) says that for all n > m 2 1, the set

{z EX* l t (z) = n,my(z) = m) , is ordered by the “inverse” lexicographical order.

The p.r. function 4:X* x PJ A X * produced by the proof of Theorem (6.1) is given by d(v(i),n) = y(s(n-l)+i) , for every n 2 2 and i E {1,2 ,..., ~ ( n - 2 ) ) .

0

4.7. INFINITE OSCILLATIONS

In thie section we deal with the set of all initial segments of a fixed infinite sequence x = z1z2. .. z,... It is shown that €or every recursive

function f :N --.* JV such that Cp-’(”) = CQ every infmite sequence x

haa an infmite number of initial segments zl...zz, such that K,(z l...z, in) 5 n-f(n); here w :X* x PJ A X * is an arbitrary universal KOLMOGOROV algorithm.

The motivation of the following results comes from probability theory. Recalling Example (3.1), it is known that the deviation of s,/n from 1/2 is of aeymptotical order of magnitude G / n (see also Exercise (10.7)). Furthermore, the law of the iterated logarithm tells us that, for each fixed infmite binary sequence x = z 1z2...z, ..., there exist infmitely many more moments n when (sn/n)-(l/2) is bigger than G / n , i.e. there exist infmitely many moments n when the binary string zl...z,, con- sidered as an element of the population of all binary strings of length n, is “non-random”.

Our aim is to prove that the phenomenon just described also occurs when the randomness is measured by KOLMOGOROVL complexity asso- ciated to an universal KOLMOGOROV algorithm.

00

n 4

Page 375: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

362 Cdudc

Notation. By X" we denote the set of all infinite sequences x = 2122...2n ... of elements in X.

If 'I E X", then a) x(n) = zl...zn, for every n > 0, and b) for all n,

m EN-{O},

We begin with an useful combinatorial reault.

(7.1) Lemma. satisfying the inequality

(KATSEFF [1978]) For each (nl1...,nk) E nVk, k 2 1,

k

cP-'rl 1

i =1

one can effectively fmd the strings 81,.. . ,8k such that:

e ( 8 ; ) = ni, for each 1 5 i 5 k , and

for every x EX", there exists an

i , 1 5 i 5 k, such that 8i = x(ni) .

Proof. Assume, without loss of generality, that nl <_ n2 I...< nt. The strings a,,..., at will be produced by the following algorithm:

"1 1. Put e l = al . 2. For every 1 < i 5 k, let 8i be the smallest string (according to

the lexicographical order induced by a1 < a2 <...< a,,) of the set

A,,; = {z EX* l l ( z ) = ni, card{j E IN 11 < j 5 i ,

a j C 2 } isminimum} . Condition (7.2) is obviously fulfiied. To prove (7.3) we proceed by

reduetio ad absurdum. h u m e , for the sake of a contradiction, the existence of an infmite sequence x EX", auch that for every 1 5 i 5 k , .si Z x(ni). In other words, we can fmd an infinite sequence x EX" such that si 6 x(nk), for each 1 _< i 2 k.

For every 1 5 i <_ k, there exists a string z E X * such that ca rd ( j E RV 11 5 j < i , s l c z) = 0. Indeed, we take z = x(ni). Conse- quently, for all 1 5 n < rn 5 k , 6 8,.

To each string di, 1 5 i 5 k, we associate the aet

Page 376: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 363

Si = {V Ex' ( e ( V ) = n k , 8i c $f} - It is seen that card Si = pncei, and

k c Usi + {V EX* I ~ ( v ) = nt } i 4

9

because .(tit) 4 Si, for each choice of i, 1 5 i 5 k. Furthermore, since Si n Sj = 0, for distinct indices i and j , we can write:

h h k

i =I i r l i=1 card(USi) = x c a r d S i = x p n k l c i < pnk .

k

i-1

Hence, zp-" ' < 1, thus contradicting (7.1).

(7.2) Lemma. Let 7 :JV S, nV be a p.r. function with a recursive graph, such that

(7.4)

Then we can effectively fmd a p.r. function r ' :N a N having the following five properties:

n 4

' Graph(7') C Graph(7) . ~ ' ( n ) < n, for each n E dom(7') . (7.7)

(7-9)

card{n € R V In-.'(.) = k} 5 1, for each natural k . (7.8)

7' haa a recursive graph.

Proof. Recall that if m 4 dom(T), then r(m) = so, the term

p*(m) = 0 does not contribute to zp'("). Defme the p.r. function

r ' : N &PI by

M

n 4

~ ( n ) , if r(n) 5 n, and for every m < R,

oq otherwise.

The properties (7.6)-(7.9) follow from construction. Hence, we focus our attention on (7.5). We define the sets

Page 377: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

364 Cdudc

A = {a E N b ( n ) I , At = {n EN In-r(n) = k} .

From (7.4) it follows that

nEA

because

c p-+)<m . {n EN I+)>. 1

Furthermore, A, n Aj = 0 for distinct indices i and j, and M

A = U A i . t 4

For every natural k for which At # 0, we denote by nt the smallest element of At. It is obvious that dom(r’) = (at Ik E N , Ak # @). We have:

In case At # 0,

EAk n =nk+l n =nk+l

n f n , a h n i ( n ) = = t

Since

Page 378: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 365

we deduce that 00

(p/(p-l)) .cp-+'(") = c p+) = 00 . m=u nEA

which proves (7.5). 0

(7.8) Lemma. Let 7 :RV a N be a p.r. function with a recursive graph satisfying (7.4). Then we can effectively find a recuraive function g:N ---c X* satisfying the condition: For every x EX"", the set

4 x 1 = {t E Idt) = x(e ( g ( t ) ) ) and e = 9 (7.10) is infinite.

Proof. Replace 7 by 7 ' , the p.r. function furnished by Lemma (7.2). It is seen that for every natural n, .'(TI) # 00 iff ~ ' ( n ) = m, for some m 5 n. It follows that the domain of T' is actually rccureivc.

The recursive function g will be defmed by stages a8 follows: Stage 0.

I. Compute no = pn[ C p+'(j) 2 11. n

14 r'(j)+m

2. Extract from the vector (7'(o),...,7'(nO)) all fmite components, thus obtaining the vector ( r ' ( io) , ..., ~'(i~,)).

strings 8,,...98k EX having e ( 8 , ) = r f ( j j ) , 0

each x E xm, there exists a j E {(),I, ..., k,} satisfying 8, = x(e (6,)).

m E {o,l,...,~o}-{~o,...,jk~}.

3. Use the al5orithm provided by Lemma (7.1) in order to fmd the j 5 k,, and such that for

4. Defme g(ij) = a j , for all j E {0,1 ,..., ko}, and g(m) = A, for all

Stage ( q + i ) .

I. Compute nq+l = w[n, < n, i: p+'(j) 2 11. jm,+l r'(j)+m

2. Extract from the vector (~ ' (n ,+l) , ..., T ' ( A , + ~ ) ) the fmite com-

3. Use the algorithm provided by Lemma (7.1) in order to fmd the

ponents, thus obtaining the vector (r '( ik +l),...,Tf(ik,+l)). f

Page 379: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

366 Cdude

strings 8k,+l, ..., E X * , having [ ( a , ) = r ’ ( i j ) , J’ E {k,+l, ..., k,+l}, and such that for each x EX”, we can find a j E {k,+l,...,k,+l}, satisfying

4. Defme g ( i j ) = sir for all J’ E {kq+l,...,kq+l} and g(m) = A , for all

It is easy to notice that the above procedure really defines a recur- sive function g:N -+ X*. Condition (7.10) follows from the construction of g and the infinity of the domain of 7 ‘ .

0

8 j = X(! (8j)).

m E (nq+l,..’,n,+l}-{iL,+~,...,i~,-~}.

Remark. In case the p.r. function 7 itself comes from Lemma (7.2), i.e. 7 satisfies conditions (7.5), (7.7)-(7.9), then

t ‘ ( g ( t ) ) = 7 ( t ) , for each t E dom(7) . (7.11)

(7.4) Proposltlon. Let r :N 3 N be a p.r. function with a recursive graph satisfying (7.4). Then for each universal KOLMOGOROV alg- rithm w :X* x N ax* we can find a constant e such that for every x E X” there exist infmitely many naturals n E dom(.r), for which the fol- lowing inequality holds:

K,(x(n) In) 5 n--7(n)+c . (7.12)

Proof. Construct, for the given 7 , the p.r. function 7’:N 3 N furnished by Lemma (7.2). By Lemma (7.3) we can construct the recursive function g : N -c x* satisfying (7.10).

Defme the p.r. function #:X* x N J+X* by

g(n)y, if n-7’(4 = w, 4(ar,n) = [ OG, otherwise,

for all y EX*, n EN. The above definition works because in case n--7’(n) = [ (y) , then this n must be unique by (7.8).

Take now x EX”. For each t E A(x) = {t E IV I g ( t ) = x(t ( g ( t ) ) ) and P ( g ( t ) ) = 7 ‘ ( t ) } , we construct the string

Y(t) = x e(u(t))+l.t .

Clearly, P ( ~ ( ~ 1 ) = t - 7 ’ ( t ) and

d(?+),t) = 9 ( l ) Y ( t ) = x u ) - Consequently,

Page 380: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 367

Ko(x( t ) It) 5 % ( t ) ) = f - r ' ( t )

K,(x(t) I t ) <_ K,(x(t) I t ) + c 5 t -r ' ( t )+e

'

KOLMOGOROV's Theorem furnishes a constant e such that

. Finally, t -? ' ( t ) _> 0, so r ( t ) = r l ( t ) . Consequently, for an inf i i ty of

t E dom(r') c dom(.r), (7.12) holds. 0

(7.6) Lemma. (MARTIN-LOF [1971)) Let f : R V + RV be a recursive function such that

00

C p - J ( n ) = 30 . (7.13)

Then we can effectively fid a recursive function f':m 4 PI such

n d

that w .

p-1 = co ,and (7.14) niO

for each c E N, there exists a natural N, such that f'(n) 2 f (n)+c, for all 2 N, . (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 ) < n 2 F(rn+~) . Clearly f * hae the requited properties.

0

(7.6) Theorem. (MARTIN-LOF [1971], KATSEFF [1978]) Let

f :RV -+ N be a recursive function such that Cp-'(") = OQ Then for

every universal KOLMOGOROV algorithm w :X X IV 44. and for each I EX",

00

"4.

Page 381: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

368 Cdude

K,(x(n) In) 5 n-f(n) i.0. (7.16)

Proof. Let f *:N 4 N be the recursive function coming from Lemma (7.5). Clearly, T = f satisfies the hypothesis of Proposition (7.4). Hence, we can fmd a constant e such that for every x EX"", the set

I = {n EN IK,(x(n) In) 5 n-f.(n)+c) , is infmite. Lemma (7.5) guarantees the existence of the natural N, satisfy- ing (7.15). Consequently, the set

I' = I n {n E N If*(n) 2 f (n)+c)

K , ( W in) 5 n - f f . ( 4 + e I n - w

is still infmite. For each n E I' we have:

9

thus completing the proof. 0

Remark. In contrast with the law of the iterated logarithm from proba- bility theory, the inequality (7.16) holds for each x EXrn, and not only with probability one. Theorem (7.6) holds for f (a) = [logpa].

4.8. PROBABILISTIC ALGORITHMS

The probabilistic tests of primality diecussed in the rust section of this chapter are only probably correct. This ie a common feature for all probabilistic algorithms. In the present aection we shall describe the clam of all probabilistic algorithms and we shall prove that the ability to make random decisions does not increase the global computational power. We shall analyse a complexity-theoretic condition under which a probabilistic algorithm is error-free. This result is only of theoretical interest, since it involves the use of an infmite set of random strings, which is not r.e., by Corollary (4.4). Roughly speaking, there is only a theoretical (but not practical) poeeibility to convert a large class of probabilistic algorithm into equivalent deterministic onee.

First of all we formabe the general notion of probabilistic algorithm.

Page 382: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 369

(8.1) Definition. (ZIMAND [1983a]) A pair (f ,e), where

f :nvxX*s ,N , is a p.r. function and e E [0,2-'] is a recursive real, is called a probabilistic algorithm that c-computes the partial function

g : n v a n v , provided the following two conditions hold:

If g(n) f 00 and f (n,z) = g(n), for some n in N

and z in X*, then f (n,zy) = g(n), for every y in X*

For every n in dom(g), there exists a natural number

t , , (which depends upon e and n) such that:

. (8.1)

card{z EX* 14(z) = t,,,, f (n,z) = g(n)} > (l-c)pf"" . (8.2)

Remarks.

a) The computation of a probabilistic algorithm is influenced by a "random" factor, for instance the tosses of an unbiased coin (in the binary case). When writing f (n , z ) we denote by n the input value and by the string z the encoding of the "random" behaviour.

Condition (8.1) says that if the probabilietic algorithm reaches an acceptable state, then further random experiments are superfluous. According to condition (8.2), the probability that f computes g is greater than 1-e (i the encoding of the "random" factor is sufficiently long). Finally, choosing e in the interval [0,2-'] will ensure the uniqueness of the function evaluated by f (see Theorem (8.5)).

b) A model of probabilistic algorithm is the probabilistic TURING machine which is a TURING machine with distinguished states (the coin- tossing states, in the binary case). For each such dietinguished state, the fmite control unit specifies p possible next states (in case X = {a1,a3, ..., tap}, p 2 2). The computation is deterministic except that in the distinguished states the machine uses the output of a random experL ment (having exactly p results) to decide among the p possible next states. See for example, SANTOS [1971), MA" [1973], GILL [1976].

(8.2) Example. We shall prove that the MILLER and W I N , and SOLOVAY and STRASSEN probabilistic algorithms satisfy Definition (8.1).

We shall take c = 2-' and g:N -* (0,l) the (primitive recursive) characteristic function of the set of primes: g = PRIME.

Page 383: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

370 CJudc

To be more precise we recall the common construction of these pro- babilistic algorithm. For every natural number n (which can be tested) we take j natural numbers b uniformly distributed in the set {1,2, ...,ta- l}. For each such 6 we check whether some rued predicate W(6,n) holds. If so, n is composite; if not, n is prime (with a probability greater than

The encoding of the “random” experiment (which consists of the selection of 6’s in the set {1,2, ..., n-1}) ia binary. Put p = 2, u1 = 0, a2 = 1. For every subset Zc {1,2, ..., n-1}, consider the binary string z of length %-I, defmed by z = Z~Z~...Z,-~,

1 - 2 3 .

1 , i f i c l ,

Condition (8.1) ia obviously fulfied. Take t,,n = n-1. Condition (8.2) holds too, because in case n ie prime,

card{z EX’ l!(z) = n-l,f(n,z) = g(n)}

- - 2”-1 > (1-2-1)2m-l , and in case n is composite, a t least half of 6’s between 1 and n-1 satisfy the predicate W(b,n), i.e.

card{z EX* It (2) = n-l,f(n,z) = g(n)}

= card{z E X * lt(z) = n - 1 , ~ ~ = 1 and W(6,n) holds

for some b in {1,2, ..., n-1}}

n-1 n-1

kI0 2 2n-I - C( )2-k

- - 2”-1-(3/2)”-1

= 2”-’( 1 -(3/4)”-’)

> 2n-l(l-2-1),

for n 2 5.

0

(8.8) Example. We consider the p.r. function f :N X X* by f(0,z) = 0 and for n > 0,

N, defmed

Page 384: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 371

n , if z contains at least one 01

in the fvst n positions, otherwise.

Take c = l - l /p and t , , = n. The probabilistic algorithm f c-com- putes the identity function g : N -+ N, g(n) = n.

0

(8.4) Lemma. Let /:N x X* 4 N be a probabilistic algorithm that r-computes the partial function g :PI 3 N.

For every natural n in dom(g), and for every natural number t 2 1 for which there exists a recursive real p E [0,2-'] satisfying the inequality

card{z EX* lt?(z) = t , f ( n , z ) = g(n)} > (1-p)p'

card{z EX* l!(z) = r,f(n,z) = g(n)} > (l-p)pr

, (8.4)

(8.5)

we have:

, for every r 2 t .

Proof. We proceed by induction upon s = r-t. If 8 = 0, then (8.5) is in fact (8.4). Consider the sets:

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 > (1-p)pr+' . (8.8)

Furthermore, for every y in B (notice that t? (y) = r + l ) we have, by

In view of (8.8) it follows that card{g EX* "(y) = r f l ,

0

hypothesis and condition (8.1), f(n,g) = g(n).

f(n,g) = g(n)} 2 cardB > (1-p)~'~' .

Page 385: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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).

(8.6) Theorem. (DE LEEUW, MOORE and SHANNON [1956], MA" [1973]) The class of all partial functions computed by probabilistic algo- rithms coincides with the clasa of p.r. functions.

Proof. If g:N 4 N is a p.r. function, then g is c-computed by the pro- babilistic algorithm f :N x X* 4 N defined by f(.,~) = g(n), for all z in X* and E = 2-2.

Conversely, we shall prove that the partial function c-computed by the probabilistic algorithm f as in Defmition (8.1) ia a p.r. function. Actu- ally 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 X* with P(z) = 1.

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.

4. If card{z EX* le(z) = 1, f(n,z) halts in one step and f(n,z) = nl} > (1-c)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 nl 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) > (1-c)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} > (l-e)p2, then g(n) = n2. STOP.

12. Run the fvst three steps in the computation of f(n,z), for all 2

Page 386: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 373

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 (l-c)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 EX* It (2) = t ,f(n,z) halts within m steps,

and f(n,z) = k} > (1-e)~ ' , (8.9 1 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} > (l-c)p*', holds too.

0

Fix a probabilistic algorithm given by a recursive function f :pV x X* 4 nV which c-computes the recursive function g:RV -+ RV.

For every recursive function h :RV + RV we consider the set:

~ ( h ) = {(z,m) Iz EX*,m E N-{o},

r ( W z ) ) , z ) f g ( h ( W ) ) ,

card{v EX* l l ( v ) = W , f ( h ( W ) , Y ) = s(h(C(v))N > (1-P-AP-1NPV * (8.10)

(8.6) Lemma. The set W ( h ) is a recursive M-L 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

ca rdb EX* lW = W , f ( h ( W ) , v ) = o ( h ( W ) ) }

> (1-p + +')/(p -l))p[ (=)

> (l-p-k/(p-l))p~(*) . Consequently, (z,m) is in W(h)b. Finally,

Page 387: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

374 Calude

card{z EX* It (2) = j,(z,rn) E W(h)}

<_ C-W EX* It (2 ) = j , fW( j ) ,Z ) = e(k(i)),

< PJ+-P-/(P-WPj

= p'"/(p-l) . Fix an universal KOLMOGOROV algorithm w and an universal M-L

teat U (see Defmitiona (2.10) and (3.11)). Recall that K = K, is the KOLMOGOROV complexity induced by w , and rn = mu is the critical level induced by U.

(8.7) Theorem. (CALUDE and ZIMAM) [1984]) Let f :N x X* 3 N, g,h :hT + N, be three recursive functions.

Assume that: A) f is a probabilistic algorithm that ecomputea g.

B) For every natural n there exist a natural tn and a recursive real p,, E [0,2-'] such that:

l im)c ,=o , n -cm

(8.11)

and

card{z E X * lt(z) = t , , , f ( n , t ) = g(n)} 2 (l-pn)pt" . (8.12)

Then there elcists a natural number n, such that for every n 2 no

(8.13)

satisfying

n = h(t(y)), and 4(y) 2 t,, for some y in X* , we have

f ( n 4 = o ( 4 7

for every random string z in X* such that n = h(4 (2)).

Proof. In view of Lemma (8.6) and Theorem (3.10) one geta a natural i 2 1 such that:

rnW(h)(a) 5 m(z)+i 7 (8.14)

for every a in x*.

(w ,U), and put: Let q be the constant furnished by Theorem (3.16) for the pair

kn = P ~ ~ ( l / ~ n ( p - l ) ) ] - ( g + ~ + l ) * (8.15)

In view of (8.11) there exists a natural number no such that kn > 0,

Page 388: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 375

for every n 2 no. Let k = knk. We shall prove that for each n 2 no, if there exists a string y with h ( P ( y ) ) = n and t (p) 2 t,, then f(n,z) = g(n), for all random strings z such that h(P(z) ) = n.

We proceed by rcduetio ad absurdum. Suppose z to be random, n = h ( t ( 2 ) ) 2 ti,, a d

f (n,z) # o(n) (8.16)

In view of Lemma (8.4) (see also the Remark which follows) and the hypothesis (8.12) we have:

card{z EX' lP (2) = t! (z), f(n,z) = g(n)}

2 (1-pn)P . (8.17)

From the construction of the critical level we conclude that (z,rnw(k)(z)+l) $! W(h). Hence:

card{z EX' l t (z) = !(z),f(n,z) = o(n))

s (1-P -by*)(=)+1) /(P -1))P l ( = ) (8.18)

Combining the inequalities (8.17) and (8.18) we obtain the relation

AP-1) s -c"'y*fi)f',

Pn 2 P

or, equivalently,

~ w ( A ) ( z ) 2 [logp(l/~n(~-1))J-1 - (8.19)

From (8.14) and (8.19) it follows:

m(z) 2 [logp(l/~n(~-1))]-(i+1) * (8.20)

Finally, we use Theorem (3.16) - which has furnished the constant q - and the relation (8.20):

K ( z It (4) I e (z)-+)+q

I = P(z ) -k ,

<+) 9

(z)+ (q +i+ 1)-Pogp(1/pn (~-1)) l

since k, > 0. We contradict the randomness of z.

Page 389: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

376 Cdudt

Remarks.

a) The set RAND is not r.e. (Corollary (4.4)). Consequently, we cannot practically convert each probabilistic algorithm satisfying the hypotheses of Theorem (8.7) into an equivalent deterministic one.

b) In view of Theorem (2.11),

card{z E X* (! (2) = t&(z It (z)) 2 t}.p-' < l/(p-1) , i.e. the probability that astring z is random is greater than (p-2)/(p-l).

c) The consistency of Theorem (8.7) follows from Theorem (8.8) which shows that the MILLER and W I N , and SOLOVAY and STRASSEN pr*maIity tests satiafy hypothesis B) in Theorem (8.7).

(8.8) Theorem. For almost all inputa n, the probabilistic algorithm of MILLER and W I N , and SOLOVAY and STRASSEN are error-free in case the encoding of the coin tosses is a random binary string.

Proof. We consider the recursive function h : N + N, h(n) = n + l , and we set, for every natural number n, pn = 2-['"!4, tn = n n l .

For every natural number n 2 5, the condition (8.12) folIows from (8.3). Since limp,, = 0, the condition B) in Theorem (8.7) holds. Cone-

quently, for almost all n, and every random string z in X* with P(z) = i - 1 , the primality tests of MILLER and W I N , and SOLOVAY and STRASSEN are error-free.

n -00

Remark. A slightly diierent by CHAITIN and SCHWARTZ

version of Theorem (8.8) was fvst proved 119781.

4.9.BISTORY

The concept of program sire structure waa fust studied by SOLO- MONOFF (19641, KOLMOGOROV [1965], and CHAITIN [1966]. CHAITIN [1977] credited MINSKY [1962] for the fvst publication of these ideas.

Since that time, a number of different measures of program sise com- plexity have been introduced and studied, for instance BLUM [1967b],

Page 390: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 377

LOWLAND [1969], CHAITM [1975]. AU these measures, though differing in the programming language used and in the the additional information helping the computation, and in spite of varioue tradeoffs (see DALEY [1980]), have the same asymptotic properties. A comparative analysis was done in KATSEFF and SIPSER [1981].

The basic link between the KOLMOGOROV notion of randomness and the statistical tests was discovered by MARTIN-LOF [1966a] and [1966b]. He extended this study for arbitrary sequences. There some pathological phenomena occur (see CALUDE and CHITESCU [1983b]). See also FINE [1973] and NALlMOV [1981] for a critical discussion.

The non-binary approach was investigated by CALUDE and CHI- TESCU [1982a], [1982b], [1983a].

The infmite oscillations of the complexity have been first announced by MARTIN-LOF [1965]. Detailed proofs appear in MARTIN-LOF [1971] and KATSEFF [1978] (see ale0 KATSEFF and SIPSER [1981]).

Useful overviews can be found in MARTIN-LOF [1966a], ZVONKIN and LEVIN (19701, CHATTIN (19771, SCHNORR [1977], USPENSKY and SEMENOV [1981]; MANIN [1977] gives a hint of some results concerning KOLMOGOROV’s complexity in a slight different context. Related works are: KNUTH [1969], KAMAE [1973]. See ae0 KOLMOGOROV [1968], [ 1 9831.

MANIN [1981] contains an interesting informal discussion of the basic resuits overviewed in Section 4.2.

Many applications in biology, mathematical logic, cryptography and algorithmic information theory were developed: for related work see L. BLUM and BLUM [1975], CHAITIN [1977], COOK [1983].

4.10. EXERCISES AND PROBLEMS

Section 4.2

(10.1) Let b:X* x nV ax* be a p.r. function. For every z in X* and 0 < i 5 4(z), denote by z(i) the i t h prefm of 2, i.e. z ( i ) C z and e(z(i)) = i. Put

Page 391: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

378 Cdudr

D ( ~ , z ) = {y EX* l+(u,i) = z(i), for every o < i 5 t (2)) . Following LOVELAND [1969], defme the uniform eomplezity

induced by + to be the partial function

K,( ; ) : x* x pv AN,

&(! (Y) Iv E W , z ) ) , if W , z ) # 0, K,(z;t(z)) = i-, otherwise.

a) Check the validity of Lemma (2.7) and Corollary (2.8) using the uniform complexity inatead of KOLMOGOROV'a complexity.

b) Show the existence of a p.r. function q:X* x JV 4X* such that for every p.r. function d:X* x RV 4 X * there exists a constant e (depend- ing upon 9 and +) such that

K & ; W ) 5 K,(z;+))+e 9 (10.1)

for every z in x*. (10.2) Evaluate the difference I K,(z l-!?(z))-K,,(z;t(z)) I, for a

fixed p.r. function satisfying condition (10.1) in Exercise (10.1).

(10.3) (LOWLAND [lSSS]) Let f :N 4 X* he a function. Show that f is recuraive iff K,.(f(n) In) < e , for some conatant e in N, and all n E IV; w :X* x JV 4 X is an univeraal KOLMOGOROV algorithm.

Recall the function rev:X* - x* defmed in Exercise (1.10.23) by rev(1) = 1, rev(a il...a. ' k ) = ai k ... ail. Let w :X* x Bv AX* be a universal KOLMOGOROV algorithm.

(10.4) (LOVELAND [1969])

a) Show the existence of a constant q m EV such that

lK,(z lW)-Kw(rev(z) I + + ) ) ) I < Q ? (10.2)

for all z in x*.

satisfying (10.1) lacks the property (10.2). b) Show that the uniform complexity induced by a p.r. function q

Section 4.8

(10.5) Construct a function f :m X IV .-+ PV eatk~fying the condi- tions (3.1)-(3.3) in Example (3.1).

(10.8) (MARTIN-LOF [1966a]) Consider the M-L test in Example (3.1). Prove the existence of a constant c such that for every natural number n,

I2*s,-n I < f ( n - K ( z l...z, In)+c,n) . (10.3)

(10.7) (MARTIN-LOF [1966a]) Use the M O W and LAPLACE

Page 392: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 379

Theorem to prove that in the context of Exercise (l0.6),

where

Conclude that 1 2-en-n I is of the order of magnitude & provided K ( z l...zn In) approximately equals ta.

(10.8) (LOVELAND [1969]) Let V be a M-L test, n > m 2 1 two natural numbers and e = n-m. A string z in V, with t (2) = n is said to be terminal for claes c at m provided there does not exiet a string y in Vm+l with !(y) = n + l , and J 3 2. Denote by r ( V ) the set of all termi- nal strings for claw c at r, for 1 5 r < m.

A M-L test V is said to be an uniform M-L teat provided for d natural numbers n > m 2 1 we have:

card{z E X * It ( 2 ) = n , ~ E Vm} + cardc+(V)

<P""/(P-l) * (10.4)

a) Show that the set of aIl uniform M-L teats is r.e. b) Prove the existence of an universal uniform M-L test (i.e. an uni-

form M-L test satisfying condition (3.12) for the clam of d uniform M-L tests).

c) Restate Theorem (3.16) for the uniform complexity and uniform

(10.9) Does there exist a universal M-L test which is uniform? (10.10) Exhibit a proof of Theorem (3.17) making no use of Theorem

M-L tests.

(3.16).

Section 4.4

(10.11) Is every universal M-L test non-recursive?

(10.12) Is the set X*-RAND, r.e. for some natural m?

(10.13) (Open) Is Corollary (4.16) a consequence of Theorem (2.6.15)? Check also the converse implication.

Page 393: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

380 Cdudc

Sectton 4.6

Theorem (3.10) representable? (10.14) Is the universal M-L teat U constructed in the proof of

(10.15) Does there exist a non-representable universal M-L teat? (10.16) (STAIGER (19843) Use Theorem (5.12) to obtain a direct

(10.17) (ZVONKIN and LEVIN [1970)) Let $:X* x N AX' be a

K,(z I+ ) ) F K,(z l W ) + C r (10.5)

for every p.r. function 4:X' x nV ax* and each z in X'; here the con- stant e depends upon + and b. Show that for every u in X*, there exist a natural 8 (depending upon $ and u) such that

proof of Theorem (5.6).

p.r. function satisfying the inequality

K,(z I+)) L K,(uz l w 4 ) + 8 ?

for each z in X*.

proof)) statements are equivalent:

(10.18) (CALUDE, CHITESCU and STAIGER [1985] (added in Then the following Let $:X* x Bv ax' be a p.r. function.

a) The p.r. function $ satiafiea (10.5). b) For every M-L test V, there exists a natural number q (depending

upon V and 4) such that

m v ( 4 L e (z)-&(z lW)+Q ?

for all z in x*.

such that K,(z I t (=)) 5 ! ( z ) + d , for each z in X'.

way.

c) The M-L teat V($) is universal and there is a natural number d

(10.19) Use the above exercise to derive Theorem (3.16) in a direct

Section 4.6

(10.20) (STAIGER (19841) A M-L test W ia called weakly recursive in case the set <(z,mw(z)) Iz E W,} ia r.e. Show that every recursive M-L teat is weakly recursive but the converae implication is falae.

(10.2l) (CALUDE, CHITESCU and STAIGER [1985]) Show that every weakly recuraive M-L test is uniformly embeddable into a weakly recursive representable M-L test.

(10.22) Show that Theorem (6.2) in valid for weakly recursive M-L tests.

(10.23) Exhibit an aample of a M-L test which is not weakly

Page 394: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 4 381

recursive. (10.24) Show that the M-L test W is recursive and satisfies condition

(6.10) in Theorem (6.2) iff W is representable by a (total) recursive func- tion.

(10.25) Show that the M-L test W is weakly recursive and sathies condition (6.10) in Theorem (6.2) iff W is representable by an injective p.r. function.

SectSon 4.7

(10.26) (CALUDE and CHITESCU [1983b]) For each z in X*, put zX" = {y EX" Iy( t (2)) = z}, in case z # X, and AX" = X".

a) Sow that the set of all fmite mutually disjoint unions of sets of the form zx" generates a o-algebra C.

b) Prove that the computable function p:{zXo31z E X'} -+ [0,1] given by

p(2X.q = p+) , induces a probability p on C (i.e. the LEBESGUE probability).

(10.27) (MARTIN-LOF [1971]) Let f : N + RV be such that

iro

Show that with LEBESGUE probability one, for each x in Xo3,

K,(x(n) In) 2 n-f(n) a.e.

Here w :x' x PJ ax* is an universal KOLMOGOROV algorithm.

Page 395: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

This Page Intentionally Left Blank

Page 396: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

383

CHAPTER 8

6. SUBRECURSTVE PROGRAMMING HIERARCHIES

This chapter contains an analysis of mme subrecursive hierarchies built on the restricted use of a few natural programming schemes. We are dealing with dynamic complexity (the number of instructions that a pro- gram performs on a given input), programming efficiency (the computa- tional capacity of programming schemes), sire complexity (the total number of characters of a program), and various trade-offs between these criteria.

6.1. EXAMPLES

This is a short section aiming to present some natural questions motivating the material reviewed in the remainder of the chapter.

The starting point of these investigations is due to CLEAVE [1963], and MEYER and RITCHIE [1967a], [1967b] who have used certain theoretical programming languages to obtain a syntactical description of GRZEGORCZYK classes.

The attempts to establish claasifkations of computabIe functions in terms of natural algorithmic schemes lead to certain hierarchies defined by means of subrecursive programming languages. The converse influence holds too: the efficiency of programming languages, and therefore of pro- g r a m as well, can be measured by means of subrecursive classes of func- tions.

In this respect, the following question is the fwst to mind: What is the best strategy in selecting formalism (he. programming languages) for computing the primitive recursive functions (or other functions of a subre- cursive class having certain reasonable properties)? More precisely, is an universal programming language (i.e. a programming language powerful enough to compute all p.r. functions) preferable to a restricted subset

Page 397: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

384 Calude

whose computational capacity reduces exactly to primitive recursive func- tions?

BLUM [1967b] gave evidence that if we look for economical sire pro- g r a m , then the answer to this question is affumative.

With respect to the class of all p.r. functions most decision problem have been proved to be undecidable. Hence, most decision problems con- cerning arbitrary universal programming languages are undecidable. Ree- tricting the class of programs we expect more decision problems to be decidable as their computational capacity diminishes. Hence, two natural questions arise: 1) Under what restrictions concerning a claas of program can we effectively decide about its fundamental problem, i.e. the equivalence between program in the class?, 2) Can the barrier undecidability f decidability be described in terms of program site?

The works of MEYER and RITCHIE [1967a], [1967b] and TSI- CHRITZIS [1970] show that both questions can be answered affirmatively.

A third problem concerns the trade-offs between the number of steps executed by a certain program and its “siae”, i.e. its total number of char- acters. In this respect, BLUM [1967b] has proved that, for sufficiently com- plex functions f , a decrease of the sire of a program computing f b fol- lowed only by a negligible increase in the number of performed steps.

6.2. THE LOOP LANGUAGE

In this section we present the subrecursive LOOP language and

MEYER and RITCHIE [1967a], [1967b] defmed the LOOP language investigate its global computational capacity.

using instructions of the following five types:

x = o (2.1)

X = Y (2.2)

x = x+l (2.3 1 LOOP x (2.4)

END (2.5 1 Here X and Y are names for registers. We shall use capital Latin

letters {posribly with indices) to denote register names. Each register may

Page 398: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 385

contain an arbitrary natural number and the set of all available registers is infinite. The content of the register X will be denoted by 2.

(1.1) DeRnttion. The set L - of all loop programs is inductively defmed by the f~llowing rules:

Each instruction of type (2.1)-(2.3) an

well aa the empty program are in L - . (2.6)

If P and Q are in L, then the concatenation program P defmed by

P Q

is also in L -

If P is in L, - then the program defmed by

LO0P.X P

END isalsoin L. -

Sometimes we also specify the INPUT/OUTPUT registers used in the program in L. Hence, a loop program begins with an INPUT statement which design& the input registers of the program, and ends with an OUTPUT statement which names the output register.

The fwst three types of instructions (also called arithmetical instructions) have the following obvious interpretations: “X = 0” means that the content of X is set to sero (clear register X), “X = Y” means the transfer of the actual content of register Y to register X (the previous con- tent of X dieappears and the content of Y remains unchanged), “X = X+l” means that we add 1 to the actual content of X. The instructions in a loop program are normally executed in the order they occur in the program.

The LOOP and END instructions determine the repetitive execution of a group of instructions. Each LOOP is paired with a unique END. The variable named in the LOOP instruction is called the loop variable. The group of inetructions following LOOP, including its associated END is called the scope of the loop. The sequence

LOOP x P

Page 399: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

386 Cdude

END determines the X times execution of P, if 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 pro- gram

INPUT x LOOP x

EM) OUTPUT x

x = x+l

can be equivalently written

INPUT X Y = X LOOP x

END X = Y OUTPUT X

Y = Y+l

(2.2) Definition. A function f:W' + I?, rn 2 1, is called a loop- computable function provided there exists a program P in L having XI, ...,Xm aa input registers and Y as output register such that 3 we hi- tially input zl, ..., z,, in XI, ...$,,,, respectively, and set all remaining regis- ters 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 loop-computable 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, Y LOOP x

END OUTPUT Y

Y = Y+l

Page 400: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 387

computes the sum function: z+y.

0

(2.4) Example. The predecessor function Pd(z) = z Q1 can be com- puted by the loop program

INPUT x z=o Y = Z LOOP x

Y = z 2 = z+1

END OUTPUT Y

(2.6) Example. The arithmetical difference function z p y is loop- computable:

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

END OUTPUT x

X=X&l

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

Page 401: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 loop-computed by the pro- gram

INPUT x Y = O Y = Y+l LOOP x END OUTPUT Y

Y = O

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 loop- computable 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 : INPUT x x = x+l OUTPUT X INPUT X,, ...,..X,, OUTPUT xi INPUT XI, ...& Y = O Y = Y+l Y = Y+l

E(Z1, ..., 2” ) = zi:

Cnr(Z1, ..., 2,) = rn:

m times

Y = Y+1 OUTPUT Y

Page 402: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 com- position from the functions h :RV"' -+ N, m 2 1, and gl,. ..,om :W + N, then f is computed by the following loop program:

2, = 9 m ( X l , . . . J n ) 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 pro- gram above.

If f:W+' --+ N, n 2 0, comes by primitive recursion from the loop-computable 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

Page 403: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

390 Caludc

on the inputa zl , ...,q,, and z = rn. (Recall that the content of the register

The converse implication, i.e. every loopcomputable function is primitive recursive, wi l l be proved by induction on the length of loop pro- g 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 instruc- tion with Xl, ...& as input registers and Xi, 1 5 i 5 n, as output regis- ter. Assume that all loop programs with fewer instructions than P com- pute only primitive recursive functions. We shall prove that P itaelf com- putes 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 ins t ruc t ion 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:

2 is 2.)

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 recur- sive function.

Cusc 2 the Zast ina t rue t ion in P i s END. Then P must be of the

Page 404: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 391

form

INPUT xl, ...,& Q LOOP xj

OUTPUT xi

R END

where Q and R are loop program for which the induction hypothesis applies. Assume that Q and R (with input registers Xl, ...& and the out- put register Xt) compute the primitive recursive functions q,:W + N 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, ...,Xn are 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(q 1(z 1,*+n ),.*.,qn (zl,..*,zn )) 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

Page 405: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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.

(8.1) Definition. (MEYER and RITCHIE (1967aI) a) Denote by Lo - the set of all loop programs having no loops (i.e.

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 Ln. (3.3)

b) A program P in L,, - Ln-, has a depth of m e t i n g n.

c ) Denote by L,, the set of all number-theoretic 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

Page 406: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 393

Remark. From Defmition (3.1) it follows that 00

L o 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 fol- lowing sequence of unary functions. For each n 2 0, the function t, :IV + EV is defmed by

to(.) =

1 , i f z = o , 2 , ifz=l,

2+2 , otherwise,

tn+,(z) = t,L(1) * (3.5)

(Recall that f"(y) = f(f( ...f(y)...)), z times, for z > 0, and fo(y) = y.)

The following formulas are obvious

1 , i f z = o , *l(') = i 2 *z , otherwise,

tz(z) = 2" ,

i f z = o ,

The next result gives the monotonicity properties of the sequence (t,),, >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)

(3.7)

( 3 4

(3.9)

The function f :Ns + N given by

j(n,k,z) = tn)(z) is increasing in all arguments,

2* t ; ( z ) 5 t:+'(z), for all k,z 2 0, and n 2 1

z+tn)(z) 5 t;+'(z), for all k,z 2 0, and n 2 1 , .

Page 407: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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)

(8.6) Definition. To every loop program P having the input registers X,, ...& we associate the czeeution time function

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 exe- cution of an arithmetical instruction increases by one the number of exe- cuted 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. Timep(l) = 6, Timep(2) = 9.

Let P be the loop program in Example (2.4). Then

0

Remark. We can think that Time is the restriction to the class of primi- tive recursive functions of a certain BLUM complexity measure (acting on a suitable “larger” universal programming language). See Section 5.4.

(8.7) Lemma. if P in a program in Ln, n 2 0, with X, ,... J, as input registers, then we can effectively fmd a natural t such that

Timep(zl, ..., z,) 5 t,t(max(zl, ..., 2,)) , (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 instruc- tions 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 fol- lows from the inductive hypothesis and (3.7):

Case 2. The program P is of the form

Page 408: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 395

INPUT xl, ...J, LOOP xj

P

OUTPUT xi END

where P is in Sn (without losa of generality we have assumed that X1 ,... J,,, are all registers in P). Denote by g the value max(zl ,..., 2,). Again we proceed by cases. If n = 0,-then P' is in go, so n'mep(zl, ..., 2,) = 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 <_ t;+'k). If n > 0, then, by hypothesis, we can effectively fmd a const& k such that

n'mcp(zl,...,z*) I t:(m=(zl,...,Z,)) , for all zl,...,z, in N. It is seen that after the fvat execution of P the con- tent of each X,, 1 _< 8 < m, must be less than

(see (3.9)). The next execution wil l produce values less than

again by (3.9). It is seen, by induction, that the loop instruction will pro- duce values less than

(Recall that zj is the content of Xj.) This is also a bound on the number of instructions required for z j executions of P. Consequently,

n'mcp(zl, ..., 2,) < 1+g+t#@+')(z) - I l+z - + t#'i+l'(t#(l))

= l+g+t#@+ql) -

= 1 +g+ tn+l(td:f k)) < tlZ::&)+td::ki)

I tlZ::(g1 '

We have used, in order, the bound just established, the inequality tr(1) > m, the inequalities ti:i(m) 2 t:+'(m) = 2'+'m 2 m(k+2), for m, k _> 1, and (3.6), (3.8).

Page 409: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

396 Cdudc

Case 9. The program P ia of the form

INPUT XI, ...Jm

P I

PZ OUTPUT xi

where Pi, j=1,2, are in Each program P, may be in &,,, or &,,+I; in the laat case, Pj must 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 for- mula Tirncp(z, ,..., 2,) = Tirnepl(zl ,..., z,) + Timep,(zl ,..., z,), the induc- tion 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) L t:(mm(z1,**+m,1)) (3.12)

for all zl,. ..,z, in 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,) <_ mm(zl , ..., z,)+Tirnep(zl ,..., 2,) I tf(m=(z1,...,2,,1)) 9

for all zl, ..., z, in N, because each instruction can increase a variable by at most one.

In case n > 0 we use Lemma (3.7) to obtain a constant k such that Timep(zl ,..., z,) 5 tt(max(zl ,..., 2,)). It follows that

f (z l , . . . ,zm) 5 max(z 1 ,..., zm)+ Timep(z 1 ,..., 2,) 5 max(zl, ..., z,)+t~(max(zl, ..., 2,))

2 tnLf1(max(Z1,...,2,,1)) , for all z1 ,..., 2, in N (we have used (3.9)).

(8.9) Theorem. (MEYER and RITCHE [1967a]) For every n >0, Ln-l f L,.

Page 410: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 397

Proof. 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 com- plete the proof it suffices to show that t, EL,, for each n 2 1. The fol- lowing program in

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 &,,, then the program computing tnfl

INPUT x Y = O Y = Y+l LOOP x

END OUTPUT Y

Y = tn(Y)

will be clearly in L,+,, - hence tn+l is in f n + l .

Remark. It is seen that t , B La.

Notation. The hierarchy (Ln)n20 is 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 loop-concatenation number.

(8.10) Definition. (GOETZE and NEHRLICH [1978])

that a) Denote by &A, n > 0, the smallest class of programs in k - such

h n - 1 C &n 1 (3.13)

and if Pi is in - Ln-l for i=1,2,3, then the loop program consisting of

Page 411: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

398 Cdude

LOOP x p2

END ps (3.14)

and arbitrary INFWT/OUTPUT statements is also in L,!. -

programs in L,,.

by programs in 4;. -

Notation. It is convenient to introduce the following notations. If A and - E are sets of loop programs, then we denote by A 2 the set of all pro- grams consisting of

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

b) For k > 1, the class L:, - n > 0, consists of all concatenations of k

c) f.: denotes the set of all number-theoretic functions computable

1

LOOP x P

END

(with P E A and arbitrary INPUT/OUTPUT statements).

Remarke.

a) For all naturals n 2 0, i 2 1,

b) Using the just introduced notation we can write the formula = L,,. -

k: = kn-l ( < > k,,-l)('), for all n , k > o (trivially, ~i = kn-1).

(8.11) Definition. A program P haa the depth of nesting lees than n and the loop-concatenation number k, provided P i 8 in &I-&;-'.

(8.12) Example. For n > 0, the class

includes all program of the form

Page 412: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Ch8pter 6 399

END ps LOOP xj

PI

ps OUTPUT x,

END

where Pl, ...,Ps are all programs in L,-,. - 0

(8.18) Example. The loop program in Example (2.3), computing the sum function, belongs to < La - > C La < &, > Lo = & I .

1

U

(8.14) Example. The function t , lies in Li. Indeed, the following pro- gram in - I,; computes the function t2 (z ) = 2':

INPUT X Y = O Y = Y+l LOOP x

LOOP Y

END END OUTPUT Y

Y = Y+l

0

(8.16) Example. Using the above loop program we can easily show that the function

t s ( t i ( 2 ) ) = 2 . . ' 1 (2' times) , is in L;.

Remark. From Defmition (3.10) it followa that a,

L,-l c L: c LX c...c L, = u L: . (3.15) k-1

An in case of the clasaee L, we show, using appropriate bounding functions, that (3.16) b a proper hierarchy.

Page 413: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

400 Cdudc

For all naturals p 2 0, k 2 1, and n 2 2 we define the function b t ' P : I N + N, by b:iP(z) = trf(tX-l(z)). The following lemma syntheeixes some monotonicity properties of the functions b:Ip. As in case of Lemma (3.4), we leave the proof to the reader.

(8.18) Lemma. The following assertions hold:

If rn < n, then tm(tn(z)) 5 tn(to(z)), for all z 2 0 . (3.18)

For all n,=,Y 2 0, t 3 y ) I tn+l(z+Y) * (3.17)

(3.18) For all n,p,z 2 0, k 2 1, (b,!*p)k(z) 5 b,$b(z) . 0

(8.17) Lemma. If n 2 2, k,q 2 1, then for every f : N q --c nV in fi we can effectively find a constant p 2 1 such that

f ( Z I , . . . , Z q ) s P(m+1, . . . ,zq,l)) 9 (3.19)

for all zl, ..., z9 in RV.

Proof. We divide the proof into three cases.

>. From Corollary (3.8) and (3.17) we effectively get a constant p 2 1 such that

Case 1. The function f is computed by some program <

Page 414: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 401

= 6,'!!F+' (max(z ,..., z9,1)) . The constants p and e come from Corollary (3.8), and r was furnished by Case 1. We have also used (3.18).

Case 9. The function f is computed by some program in L i = &,,-I( < &,,-I > L,-l)(k) = (&-I < L n - 1 > Ln-l)(k)p (see the Remarks following Defmition (3.10)). Using (3.17), t i e result just proved in Case 2, and (3.18), we deduce

f (. l,"Vzq) 5 (b,")L(max(z1,*..,z9,1)) - < b,""(max(zI ,..., zq,l)) .

(8.18) Lemma. For all naturala n,k,p > 0 we can fmd a natural j 2 0 such that

6,'J'(z) < b,'+lVo(z) , (3.20)

for all z 2 j.

Proof. By (3.10) we can fmd the natural j such that t,P-l(z) < t , ( z ) , for all z 2 j. Hence

6fSP(z) = t: (t: -1 (Z ))

< t,t(tn(z))

= t,'+'(z)

= b,'+'nO(z) , for all z 2 j.

We are now ready to show that ( f ,')k ,o is really a hierarchy.

(8.19) Theorem. (GOETZE and NEHRLICH [1978], [1980]) If n 2 2, then all inclusions in (3.15) are proper.

Proof. First, Lndl # LA because t , is in L i, but t, e L (see the proof of Theorem (3.9)).

We shall prove that t,' is in f,'-L,'-', for all k 2 2. From the con- struction it follows that 6;" is in f , ' , for all k,n > 2, and p 2 0 . Hence, t,'(z) = t,"(t,"-l(z)) = 6ita(2) lies in L,'. To prove that t,' e f,'-' we proceed by reduetio ad abeurdum. If t," is in Li-', then from Lemma (3.17), we get a constant p 2 1 such that t : ( z ) 5 b,'-lBP(z) < 6i"(z) = tf(z), for all z 2 max(i,l); here j comes from

Page 415: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

402 Cdude

Lemma (3.18). We get a contradiction, thus ending the proof. 0

The hierarchy (fi)m,k ,o is called the loop-concatenation hierarchy.

6.4. A UNIVERSAL LANGUAGE

We enlarge the list of instructions used in loop programs by a condi- tional instruction and a punctuation instruction. In this way, the corresponding class of computed functions becomes the family of all p.r. functions. The time execution of the extended class of programs will become an useful computational complexity measure; we shall use it in further investigations.

To the five instructions (2.1)-(2.5) used in defining the LOOP language we add two new instructions, namely:

I F X z 0 GO TO La ( 4 4

La CONTINUE (4.2)

where ((La” may be replaced by an arbitrary element from an infinite set of labels.

Instruction (4.1) tests the content of the register X ; if the content of X is not equal to sero, then the next instruction executed is the one with label (‘La”; in the opposite case, i.e. when the content of X is equal to Lero, the next instruction executed is the one following it.

Instruction (4.2) does nothing; it merely plays a punctuation role; the next instruction executed in the one following it.

(4.1) Definitlon. grams is inductively defined by the following rules:

(MACHTEY [1972]) The set UL of all general pro-

Each instruction of type (2.1)-(2.3) aa well

aa the empty program are in UL . (4.3)

If P and Q are in UL and have n o labels in common, then the concatenation program

P Q

Page 416: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6

is also in UL.

403

(4.4)

LOOP x P

END is a h in UL.

If P is in UL and docs not eonta in

the label "La", then the program defmed by

La CONTINUE

P

IF X # 0 GO TO La

isalsoin UL .

(4.5)

Remarks.

a) The universal language UL uses labele, in contrast to the LOOP language.

b) Every loop program is a general program, but the converse impli- cation ia obviously false.

c) As in the cam of loop programs, the general programs begin with an INPUT Statement, and end with an OUTPUT statement. We say that a program P halt8 on a certain input data in case P eventually reaches the output statement on it. The general programs do not always halt. This ia a consequence of the action of the instructions of type (4.1)-(4.2) which may cause infmite cycles.

(4.2) Definition. A general program P, with input registers XI,...&, n 2 1, and output register Y, eomputce the partial function 4:W AN, if when started with arbitrary zl,...,zn as input values of XI, ...,Xn, and with all registers initially sero, then

the program P halts with #(z) aa the

content of Y, in case z E dam(#), or

the program P never halts in caae z fZ dom(4) (4.7)

(4.8) . We say that the partial function 4:" SlV is an UL-computable

partial function provided there exists a general program P that computes 4.

Page 417: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

404 Calude

(4.8) Example. The following general program

INPUT x x = X+l

1 CONTINUE Y = O I F x # 0 GO TO 1 OUTPUT Y

never hdta; hence, the partial function computed by it is nowhere defined. 0

(4.4) Example. The partial function 4:fl a IV defmed by

is computed by the following general program:

INPUT X,Y 2 = sg(y)

1 CONTINUE IF # 0 GO TO 1 s = o v = 0

2 CONTINUE s = S+Y v= V+l D = S A X T = Bg(D) IF T # 0 GO TO 2 v = V L l OUTPUT v

where G(Y), @(I)), S+Y, S AX and V e l are “subroutines” abbreviat- ing the loop programs in Examples (2.6), (2.3), (2.5), and (2.4).

0

Our main task is to determine the class of partial functions com- puted by general programs.

(4.6) Theorem. (MACHTEY [1972]) The clam of all p.r. functions coin- cides with the class of all UL-computable partial functions.

Page 418: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 405

Proof. To ahow that every partial function computed by a general pro- gram is partial recursive we may use an induction on the length of general programs (i.e. on the number of instructions composing the programs). The induction is similar to that developed in the proof of Theorem (2.7) with two exceptions. Firstly, we work with partial functions and, secondly, we must analyee three cases in the inductive step (according to the rules (4.4)-(4.5)). Onlr the case of a general program Q of the form

INPUT XI, ...& 1 CONTINUE

P IF Xi # 0 GO TO 1 OUTPUT xi

must be treated. Here we assume that the partial function Qr :hT" -% EV computed by P with Xl,...,Xn as input registers and Xt M output register is a p.r. function, for every choice of t E {1, ...,n}.

We defme, by primitive recursion, the p.r. function r:RV"+' -%N as f0Uows:

n 4~(S~,.. . ,S*)

1 r(Zlr--vZn 90) = I~(P (t -1)) t -1

..., z,,y+i) = A , where in case czp (8,r(z1, ... ,z,,y)) # 00, for all 0 5 8 5 n-1 and ezp (i-l,r(~I,...,Z,,Y)) # 0,

n ~,(*~(o,~(=*,...,z~,Y)),...,@zP (~- l , r (s~, . . . ,z~,Y)) )

A = rI(pn(t-1)) 9

t =I

in case ezp (8,r(z1, ..., zn,y)) # 00, for all 0 5 8 5 n-1, but ezp (i-l,l'(zl ,..., z,,y)) = 0,

A = O ;

otherwise,

A = w .

Finally, the partial function computed by the general program Q is 4:" a a V given by

d(z1,**.,zn) = ezp (j-i ,r(Zl,+, ,

~Y[r(z1,.*.,zn,y) = 01 nl) ) 9

for all zl,. ..,zn in IV. A dovetailing argument shows that 4 is a p.r. func- tion.

Page 419: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

408 Caliidc

The converse implication, i.e. every p.r. function can be computed by some general program, can be proved using KLEENE's Normal-Form Theorem (Theorem (2.3.28)). Recall that ( W I ( ~ ) ) ~ > ~ is an enumeration of all unary p.r. functions and every w j'):N a RV can be obtained from two fmed primitive recursive functions p :N -+ N, T : N S -c (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, assume that: a) P is a general program with input registers Xl, ...,.X,,, Y 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 gen- eral program

INPUT W1, ...,wn XI = w,

x, = wm

Y = w, P w, = W,+l I F 2 z 0 GO TO La v = o LOOP w,

La CONTINUE

w, = v v = v+r

END OUTPUT w,

exactly computes the p.r. function 4:" A N defmed by

4 ( 2 1 , - * * , 2 m ) = c (Y[~(z~ ,** . , z~ ,Y) = 01 *

Obviously, the functional composition can be realised by general pro-

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,

grams; this completes the proof.

Page 420: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 407

n'mcp:W S,N , defmed by n'mep(zl, ..., 2,) = the number of instructiom executed by the general program P on input (zl, ..., z,), in cam P eventually halta, and 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 lead- ing to an acceptable gijdelisation of all p.r. functions for which the associ- ated 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 characteri- aation 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 wi 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 natur- ale 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,) I t:(m=(zl,...,z,)) , ( 5 4

for all zl,...,z, in RV.

Page 421: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

408 Cdude

Proof. (The technical details are due to S. BUZETEANU.) h u m e the existence of a loop program P and of a constant k satisfying the hypothesis of the theorem. We shall prove that the function f :N“‘ - IV computed by P is in L,. Let Q be a program in L, - that computes the function l+Lt(max(z,, ..., 2,)); furthermore, assume that the output of Q is 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 with Xl, ...& as input registers and Y as output register. We shall use some new registers Cj, V,, Rj , 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 vj 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 con- sists 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

LOOP v, v, = 0

c, = x

R, = 0 R, = R,+I

END

LOOP R, R, = 0 v,,, = 0 v,,, = K+,+1

(select the next instruction to be executed)

LOOP c, v,,, = 0 v,,, = 0 v,,, = v,+,+1

END END

Page 422: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 409

and P, will be

LOOP v, v , = O R, = 0 R, = R,+1 E, = 0

END LOOP R,

LOOP c, C, = E, E, = E,+1

END END

(C, = c, J-1)

(C, is the loop variable; in case C, = 0, the next instruction to be exe- cuted 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”

The loop program P can now be equivalently written as follows: R, -1

INPUT 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 also Example (5.2)). The loop program Q is in Ln; the remainder loop program ie in &. Consequently, the resulting program belongs to Ln, thus proving that f is in L,.

0

Page 423: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

410 Cdudr

(6.3) Example. Conaider the loop program

INPUT x Y = O LOOP x

x = x+l LOOP x

x = x+l LOOP x

END x = X+l

END END Y = X OUTPUT Y Using the procedure described in the proof of Theorem (5.1) we get

the following equivalent loop program:

INPUT X T = t : ( X ) T = T+1 v, = 1 LOOP T

LOOP v, Y = O v, = 0 v2 = 1

v, = 0

c, = x

END LOOP v,

R, = 1

END LOOP R2

R2 = 0 v,, = 1 LOOP c,

v,, = 0 v, = 1

END END LOOP v,

x = x+l

I2

Page 424: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

v, = 0 v4= 1

v4 = 0

c, = x

END LOOP v4

R4= 1

END LOOP R4

R4= 0 v,, = 1 LOOP c 4

v,, = 0 v6 = 1

END END LOOP v6

x = x+l

v, = 1

v, = 0

ce = x

v6 = 0

END LOOP v,

Re = 1

END LOOP Re

Re = 0 v, = 1 LOOP c,

v, = 0 v, = 1

END END LOOP v,

x = x+l v, = 0 v, = 1

v, = 0

END LOOP v,

Re = 1 Ee 0

END

Chapter 5

1 3

41 I

Page 425: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

412 Cdude

LOOP Re LOOP ca

(78 = E6

Ea = E,+1 ENI)

END LOOP v,

v, = 0 R4 = 1 E4 = 0

END LOOP R4

LOOP c4 C4 = E4 E, = E4+1

END END LOOP v,,

v,, = 0 Rz = 1 Ez = 0

END LOOP Rz

LOOP cz (72 = E, Ez = Ez+1

END END LOOP v,,

Y = X v,, = 0 v,, = 1

END END OUTPUT Y

The reader will notice the abbreviation V, = 1 used in the program above.

0

Page 426: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 413

(6.8) Corollary. For d naturals m 2 1, n 2 3, the following assertions are equivalent:

The function f :W -+ nV is in L, . (5.2)

There exist a program P in L_, - computing f

and a function g : W -+ nV in L, , such that

ZXmcp(2, ,..., z,) 2 g(zl ,..., 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 replac- ing 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 is a hierarchy of all primitive recursive functions, and Corollary (5.3).

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 par- tial function Timep introduced at the end of Section 5.4.

b) In view of a), a function is primitive recursive iff it can be com- puted by a general program running “a primitive recursive number” of instructions.

c) It is now easy to realise the “practically non-computability” of non-primitive 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

Page 427: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

414 Cdudc

, I

} 2 times ,z > o . 1 . . t&) = 2

(6.6) DePlnHion. (RITCHIE [1963], MEYER and RITCHIE [1972]) A c l w of recursive functions is computation-time 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.

Corollaries (5.3)(5.5) merely state that L,, L: (for k 2 1, 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 func- tion h:N + N with respect to the BLUM space ((Pi),(nmepi)) (Bee also the end of Section 5.4). By a) we can write

a)

{f If unary, f E Ln) = IJ TIME(h) 9

h EL, h ~ U J

{ f If UnSYT, f E f3 = u TIMEP) 9

h EL! h ~ U J

for n 2 3, k 2 1.

of functions (ti)i lo and (bt*p),,k,,20, we deduce the relations Furthermore, in view of the monotonicity properties of the sequences

00

{ f I f unary, f E L,) = u TIME(t,P)

{f I f unary, f E ~ f ) = u TIME(~:*P) ,

for n 2 3 and k 2 1, which prove that the sets {f I 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 incued 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.

, P d 00

P=o

Page 428: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 415

(6.7) Theorem. For every natural n 2 2, S, = L,.

Proof. F i t l y we prove the inclusion S, c L,, n 2 2. In view of the 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 functional cornposition). Consequently, we must prove that SUCC(Z), E ( 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 state- ments: a) S,(z,y), s,(%,~) are in f,, b) L, is closed under limited itera- tion.

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

INPUT X,Y z = x LOOP Y

T = Z+Y T = T+l z = %(Z,T)

so, %+I(Z,Y) is in L,+1.

END OUTPUT 2

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:

INPUT x Y = O LOOP x

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

Page 429: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

416 Cdude

nmep(2) 2 f+(t+z(tt”(z)+t)) , for all 2; since the function in the right-hand 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 Ln, 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

INPUT xi, ...,.X,,, LOOP xi

R END OUTPUT Xi

where R is in b,,, then f = f i , where fi 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 com- putes 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

Page 430: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 417

“primitive recursive in”. This classication is analysed from a computa- tional complexity point of view using the notion of primitive recursively- honesty.

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 number-theoretic functions 0:“ + RV, m > 1, which contains the functions Succ(z), Ci”’)(zl, ..., z ~ ) , fi“‘T(zI, ..., z-), f (z), and which is closed under functional composition and primitive recursion.

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.

from Definition (2.lrif we replace & - - by &’ and the clause (2.6) by

Each instruction of type (2.1)-(2.3), or (6.1)

a) The class Lf of augmented loop programe in f can be obtained

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 number- theoretic functions computable by augmented loop programs. We shall call them augmented loop-computable functions.

(6.8) Example. The augmented loop program

INPUT X,Y 2 = F(X) LOOP z

END Y = Y+l

Page 431: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 to develop the announced classification. For every recursive function f :N -+ N, the class L1 is a very small sub- set 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 prop- erly 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 func- tions belonging to classes Lf and we shall prove that the classification above can be equally obtained if we restrict ourselvee to classes Lf gen- erated by recursive functions which, in a sense, “honestly” reflect their time complexity (Le. with respect to the BLUM space ((Pi),(nmep,))).

(6.6) Definition. Let f :RV -+ RV be a recursive function. a) We say that the class Lf is honed if

(6.3) L/ = p ’ P

for some general program P.

honest. b) The function f is primitive recursively-honed in case Lf is

We give a fmst example of primitive recursively-honest functions: the execution time functions.

(6.6) Theorem. (MACHTEY (19721) If P is a general program with X,, ...& M registers, then we can effectively fmd a general program Q with input registers XI,...&, and Y aa output register such that

Q computes the partial function Rmep , (8.4)

Page 432: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 419

TirncG(zl ,..., z,) = 2.11t’mcp(zI ,..., z,)+l , (6.5)

for all z,,. ..,z, in HV.

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); further- more, 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, = X2+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 P-loop simulator is a loop program Sp which uses the regis- ters 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.

Page 433: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

420 Cdudc

(6.9) Theorem. (MACHTEY [1972)) For every general program P we can effectively fmd a P-loop 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 = l e T U=I"U LOOP u

T = T L l P

END OUTPUT T

(See Example (2.5) for the loop program computing A.)

then S, is the concatenation of S, and S,. If P is of the form If P comes from the general programs Q and R by concatenation,

INPUT XI,...&, LOOP xi

Q END OUTPUT Xj

then S, is

INPUT X1,.-*,.X,,, ,T U = l e T U = 1 L U LOOP u

T=T&l LOOP xi

U=l&T U=l&U LOOP u

T=T"1 se

END END

Page 434: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 ,T U = l n T U = l Q U LOOP u

T = T Q 1 Sa U = l a X i U = l N J LOOP u

T = T L L

T = T a l Sa

END T = TL1

END OUTPUT T

(6.10) Example. The P-loop simulator associated to the loop program P

INPUT x LOOP x

END OUTPUT X

INPUT X,T U=l&T U = l L U LOOP u

x = x+l

is

T = T L l LOOP x

Page 435: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

422 Cdude

U = l n T U = l & U LOOP u

T = T A l U = l n T U = l L U LOOP u

T = T " 1 x = x+l

END END

END END OUTPUT T

(6.11) Example. The P-loop 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 = T n l U = 1 P T U=l&U

Page 436: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 423

LOOP u T = T A l Y = Y+l

END T = T A l

END T = T P 1

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 L (6.6) l imep

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, possi- bly 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). Conse- quently, 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 pro- gram 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 P-loop 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

Page 437: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 END

LOOP v END T = Time#) X’ = Y SP x = 2’

T = T+l

v = Timep(Y)

T = T+l

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,) , (6-7)

h E L g , (8-8)

for all zl, ..., z, in N, and

for some recursive functions h : W -+ RV and g:N + 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 P-loop 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

Page 438: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 425

(8.14) Corollary. If the recursive function puted by the general program P, then f E L

*Bv" --+ N, m 2 1, is com- k 8 p .

Proof. Immediate from Lemma (6.13) and Theorem (6.12).

0

(8.16) Theorem. (MACHTEY [1972]) A recursive function f : N -+ N, ia primitive recursively-honest 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 rela- tion Timcp E L f . By Corollary (6.14) we have f E L . Consequently, by Theorem (6.4),

l i n e p

limep

Lf = ~ ( f ) = B(Timcp) = L 9

showing that f is primitive recursively-honest. ZIme 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 fact that f E B ( f ) = Lf = L we deduce, by Theorem (6.12 the existence of a general program 4 which computes f and Timed E L . Since

&r,

k m e O

Lnnr8Q = ~ ( ~ i m c ~ )

= B(2-TimeR+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 recursively-honest functions are those unary recursive functions which can be computed by general programs in time primitive recursive in themselves.

The classes L', when f ranges in the set of all primitive recursively-honest functions, classify all recursive functions.

b)

Page 439: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

426 Cdude

(6.16) Corol lary. Let g:N + N be a primitive recursively-honest func- tion. The following aasertions are equivalent:

(6.9) The recursive function f:BV" - N , m 2 1 is in f U

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.

computation-time closed in case g ki primitive recursively-honest.

iff {f:N + N I { E A.(g)} =

complexity class of h in the BLUM space ((fi),(TXrnep,.)).

in Section 3.4 and the primitive recursively-honesty.

a) From Corollary (8.18) it follows that each class B(g) ia

b) The recursive function g:N --+ N is primitive recursively-honest TIME(h), where TZME(h) in the U

h *(#I h u n w

c) The reader can now easily compare the notion of honesty defrned

(6.17) Corollary. If f : N + IV is a primitive recursively-honest func- tion, 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 recur- siveness (see KLEENE [1958]).

b) MEYER and RITCHIE (1912) have clawified the recursive func- tions by means of the elementary-honed C h U 8 C 6 t(f) ( qf) b the smallest class of number-theoretic functions which contains the functions z+y, z - y , z', f ( z ) , and which is closed under functional composition, limited summation, limited product and limited recursion).

Page 440: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6

6.7. SIMPLE FUNCTIONS

427

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 class An, n > 1; the barrier of undecidability lies between L, and L2 (TSI- CHRITZIS [1970]). This fact motivates the interest in theclsee L :(called, the claw of simple functions). To this aim we shall give a complete char- acterisation 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- lem of deciding whether two arbitrarily gi& programs in C - compute the same function.

(7.1) Theorem. The equivalence problem for L - is undecidable.

Proof. every unary p.r. function w 1') can be written as

From KLEENE's Normal-Form Theorem (Theorem (2.3.28)),

wl')(z) = p(w[T( i , z ,y ) = 11) 9

for 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 fo r 'arbitrary z, if f,(g) = 0, for all y, would be decidable, thus arriving at a contradiction.

0

(7.2) Corollary. The equivalence problem for &,, is undecidable, for each n 2 2.

Proof. It suffices to notice that KLEENE's predicate T:N3 + {O,l} t in

0

s,= 12.

Page 441: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

428 Cdudr

Remark. In view of Theorem (2.8.15) we can effectively fmd two pro- grams P, and Pz in L2 such 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 for L - and hn, for all n 2 2) fails to hold in case 0: kl.

(7.8) Theorem. (TSICHRITZIS [1970]) A function f:W + RV, m 2 1, is in to iff 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.

Proof. Recall that Lo is the set of number-theoretic functions computed by programs in Lo, - i.e. by loop programs consisting only of arithmetical 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 fol- lowing 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 right-hand side of the last pre- vious instruction with X in the left-hand side. If there is no such instruc- tion, 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 right-hand aide of the last pre- vious instruction with X in the left-hand 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 left-hand 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

Page 442: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 429

x2 = x1 x2 = x2+1 OUTPUT x2

The transformations described in the proof of Theorem (7.3) lead to:

x, = 21+1. x, = (z1+1)+1, x2 = (z1+1)+1, x, = ((z1+1)+1)+1,

and fmally

x1= 21+2, Xz = Z1+3. X3 = 23.

Hence, the function computed by P is f(2+2,23) = 21i-3.

U

(7.6) Definition. (TSICHRITZIS [1970]) The clams of eimplc function8 is the smalleat class of number-theoretic functions which contains the func- tions Succ(z), C{"')(zl ,..., zm), drn)(zl ,..., zm), z+y, 'Pd(z) = z P l , [z/k], rm(z,k), (A 2 2), and

, i f y = o , w b , v ) = 1 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

prn

where each portion P, is either a loop or an arithmetical instruction out- side a loop. We ahall prove that each P, computes a certain simple func- tion, hence the function computed by P can be obtained by functional cornposition from simple functions.

Page 443: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

430 Cdude

The case when P, consists of an arithmetical instruction is obvious. Let us sssume now that P, is of the form

LOOP x

END p:

and let Y,, ..., Y, be the registers used by P:. Furthermore, let X be dif- ferent from all 5's (1 2 j <_ n). The program Pi does not contain any loop; therefore, we can apply here the transformations a)-d) in the proof of Theorem (7.3). The result will be a set of equations of the form yi = gj+k, or ~ l . = k, for every Y;. appearing in P:.

In case Y, = pj+k we say that register r;. links register Y,. Notice that every yi links a t most one 5. We can draw, on this basis, a directed graph whose nodes are just the names of the registers in Pi, i.e. Yl, ..., Y,; an arrow comes from yi to in case yi links q. According to the posi- tion in this graph, each Yt falls into four cases, namely:

Case 1. There are no 'arrows into Yt. Case 2. The node Y, belongs to a cycle, i.e. there exist the nodes

yil ,..., Kt, f 2 1, such that Y;.

from some node in a cycle to Yr.

links q , 1 5 g < t , and ql links x,. g + l *

Case 3. The node Yc does not belong to a cycle, but there is a path

Caee 4 . There is a path from a node in Case 1 to Yc. Assume now that ti,. . . ,&,, z are the contents of the registers

Yl, ..., Y,, X, respectively, a t the beginning of the loop; the contents of these registera are cl, . . . ,V,, z upon the end of the loop. Our aim is to show that ci can be expressed by means of simple functions of ilJ . . . ,in,

. In Case 1, the node Yr can be obtained in two ways: a) if Yt = y l + k , then Vp = j t + k z ; b) if Yt = k, then

2.

and it ia seen that c, = w(g l , z )+w(k ,G(z ) ) , where G(z) = w(1,z).

In Case 2, assume that xL, ...,xt, t 2 1 is a cycle such that

Page 444: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapkr 6 431

K, = Yil+ki,,

x1 = Yit+lfil.

Without lose of generality we shall compute the fmal value k,. By means of the function w(n,z) we can separate the caaes,z = 0 and z > 0. Hence, assume z > 0. After the fmt execution of P,, the contents of yi, ,..., xl are: yi, = j7it-l+kit ,..., yix = ii1+kix, XI = ii;.,+kil. After the second execution we have: yit = & +ki +kit,...,Kx = iit+kil+kix, Y;. = iit-l+kit+kil. In general, the content of 5, after z iterations b

1 4 1-1

1 - l i t = [Z / t ] '(kil+*:-+kit)+

t 4

+ c w(frn,bs(eq(rm(r:,t),m))) s m 4

where

f o = 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

Page 445: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

432 Cdudc

The content of after z > r iterations can be expressed from the content of xt 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 x,+r can be expressed by simple fune- tions.

t + r

The last case corresponds to a sequence of equations

and

A similar analysis shows that the content of can be expressed by a simple function; the construction falls in two cases, according to z > t , 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& = Y3 Y4 = Y2 Y4 = Y4+1 Y4 = Y4+l

Page 446: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 433

Y4 = Y4+l Y3 = Y4 Y4 = Y1

Y2 = Y4 Y4 = Y5 Y4 = Y4+l Yl = Y4

Y4 = Y4+l Y4 = Y4+l

END OUTPUT Y3

The transformations abd) in the proof of Theorem (7.3) lead to the follow- ing 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

2

m 4 f ( Z , Y l , Y 2 i a ( S ) = 6 [ ( ~ + 1 ) / 3 ] + C w(fm,b9(CQ(rm(z+1,3),m))), where

f, = Y S , f l = ~ 2 + 3 , f 2 = Y I + ~ . 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 = f l t i ,

1-1

M = qT+1 . (7.3)

Notice that T 2 2, because for all 1 2 i 2 m, ti 2 2.

Page 447: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 n-tuples (zl ,..., 2,) and (yl ,..., y,) are called (T,M)-compatible if the following two conditions hold for all 1 5 i s n :

(zi 5 M or yi 5 M) zi = yi , (7.4)

(7.5) (zi > M and vi > M) * zi = yi(mod T ) . 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

(7.7)

of elements. (7.8)

then they are also (9, M) )-compatible for all M' < M and T = k . I l ' , k 2 1 .

If a (T,M)-compatibility claes has two distinct elements, then it has actually an infmite number

(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 n-uples (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

Page 448: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 436

and then

Consequently, g possesses the required property with coefficient pi/t.

If g(z l ,..., 2,) = rm(h(zl ,..., z,),t), then T, = Th ' f , M, 2 Mh (a in the preceding case). Again we consider two (T,,M,)-compatible n-uples (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 Mu 2 max(M1,M2). If (zl ,..., 2,) and ( v l ,.., 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

, *

In 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 h2(z , ,..., 2,) = 0, then 9(zl,".,z,)-~(Yl,..',yn) = hl(zl,...,z,)-hl(yl,...,y,) = Pi ' 8 'T,. If

Page 449: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 involv-

ing the sum function aa well m the extension to sets of compatible tr-upler, in general.

0

Remark. Theorem (7.10) can be also used in showing that certain func- tions do not increase linearly on classes of (T,M)-compatibility. An an example, consider the function sqrt (z) = [z'''].

(7.11) Theorem. Every simple function g : W -+ RV, n 2 1, is com- pletely specified by a finite number of n-uples. More exactly, if T and M are g sssociated constants, then g is completely specified by its values in the frnite set

N = ((2, ,..., z,) E W Imax(zl, ..., 2,) 2 * T + M } .

Proof. For all (Z lr...,z,] in pv" with z1 > M ,..., z, > M, and z , + ~ 5 M, ..., 2, 5 M, we construct the following two sets:

A = {(y, ,..., y,) EN" jari = zi,8 < a' 5 a, and

j i E zi( mod T),M < yi 5 M+T,1 5 i 5 8 ) , and

B = {(zi ,..., 2:) E W 11 5 r 5 8,z: = zi,8 < i 5 n, and

2; = z,( mod T), if M+T < 2,' 5 M+2*T, and

2; = 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(Zl?**. ,zn) = g(Y1,- , ln)+C (g(z:,---,zL) 1-1

- g(vl,...,Y,)).(z,-y,)/T *

Clearly, A u 8 C N; hence g(zl, ..., 2,) is completely specxed from the values on N.

0

Page 450: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 437

(7.12) Corollary. Let gl ,g2: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 n-uple in the set

N = {(zl ,... ,z,) E W Im+, ,..., 2,) 5 MI

+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 n-uple (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 n-uple in A U B iS (T,M>compstible with (zl, ..., 2,). In view of (7.7), all n-uples in A u B are (T,,M,)-eompatible, as well as (T2,M2)-compatible, with (z l,...,z,). From Theorem (7.10) we deduce the formulas:

a

Ol(Z1,...,2,) = 91(Yl,...,Yn)+ c (d4,..4

- Ol(Yl,...,Y,))(z,-Y,)/T 9

92(21,...,2, 1 = 82(11,-- .rln)+C ( g d 4 ,.4 r=l

- 92(11,. . . ,~n))(zr-~r)/T 9

r= l

8

which prove that g1 = g2.

0

(7.11) Corollary. (TSICHRITZIS [1970]) The equivalence problem for L1 in decidable.

Proof. We can uniformly construct the function computed by a program in L1 and therefore we can get the aeaociated constants T and M. Finally, we-only 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 pro- g 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

Page 451: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

438 Cdudr

whether a function in L, eventually takes eome d u e k, or the problem to 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 pro- g r a m in UL having no nested loop8 is undecidable.

We are going to the next problem in this section, namely, the hierar- chy problem for the c h s (f :)t21.

Notation. If f :W 4 N, n 2 1 b a function and 1 5 i fxifO is the (n-lkarguments number-theoretic function defined by

n, then

f=i=O(21,...,Zi-1,Zi+1,...,2n) = f (z1,...,2i-1,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, asaume that f EL:-L:-’, and let P be a program in Lf computing f 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 the function fXi=,, with Xl,...,Xi-t,Xi+l,...,Xn M input rcgbters, and out- put register Y. But again the fvst loop of P is not “proper”, showing that fZi’0 is in f f-I.

0

Page 452: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 439

(7.16) Theorem. (GOETZE and NEHRLICH [lSSl]) The clsssee (f& ,o form a proper hierarchy:

(7.10)

Proof. We must show that Lr-' # LT", for every n 2 2. Actually, we shall prove by induction on n that the function .3umn:W + I?,

~um,(z~,.. ,q,) = czi, is in L;-'-L:", for each n 2 2. n

i -1

The function ~ u m ~ ( z ~ , z ~ ) = z1+z2 can be computed with one loop (Bee Example (2.3)). Hence, 8um, is in LF-'. We focus the attention to the relation 8umn 4 L;-2. For n = 2, 8Um2 4 f," = Lo (h case 6Um2 E Lo, then by Theorem (7.3),

8Um2(21,22) = 6 ' z j + k , for appropriate naturals 6 E {O,l}, j E {1,2}, k 2 0, which is a contradic- tion).

For all i, 1 2 i 5 n + l , the functions 8umn, and + N coincide:

n +1

j = l j#i

(8Umn+l)ri,0(21,".,2i-1,zi+1,".,2n+1) = 2j

= 8Umn(21, ..., 2i-1,2i+1,...,Zn+1) . Consequently, in case were in Li'-' we would also have

8umn E L ;-2, via Lemma (7.14), i.e. if 8umn 4 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

Page 453: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 UP is fmally obtained.

6.8. PROGRAM SIZE

This section is devoted to the trade-offs 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

I I :ov -mv ,

Idi I I; I = n ) 1

in called a general eize mcaaurc for (&)n20 if for all naturals n, the set

(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 arbi- trarily 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 pr- gramo 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 a general sire measure all UL programs.

total number of charactem in an UL program gives with respect to the effective enumeration (Pn), 2o of

Page 454: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 441

(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 gen- eral 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

li 1’ , in cane n E range(p) and p(i , j ) = n, for mme j ,

In T I otherwise.

0

I In I =

Clearly I I works.

(8.6). Theorem. Let g,f:aV + RV be two recursive functions such that the set

{ ldn) I In E N ) 9 (8.2)

is infmite for some general sire memure I I:RV -+ IV.

and f ) such that: Then we can effectively find two naturals i and j (depending upon g

di = d,(j) 9 (8.3)

f(li I) < lo( i ) I . (8.4)

Page 455: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

442 Cnludc

Proof. We consider the recursive function r :N 4 N given by

r b ) = rm"9 1) < l o b ) ill 9

(eee (8.2)). Next we use the p.r. function 8 :M a N, +,d = 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(.) = 48(z?i) P

where z is an index for 4 . Finally, the natural j comes again from r : j = r( i ) .

We shall prove that the just obtained i and j work. Indeed, condi- tion (8.4) follom directly from the construction of r and j. h concerns condition (8.3),

di(z) = ds(z9 i ) = e(z,i) = dg(r( i ) ) (Z) = +g(j)(z) 9

for each 2; 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 she measure the following two statements hold for each j:

The set {i EN} 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 {i C 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 {i E RV I I i I = j } are infmite for almoet all naturab j , thus contradicting (8.6).

13

Page 456: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chaptor 5 443

d2) =

(8.8) Example. Let (P,),20 be an effective enumeration of all UL pr- g 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

I

pz[for each y E range(g) with I v I C Iz 1, there exists a w 2 a

'such that #s(w) # +l(w)], if 2 E range(g) , otherwise. 00,

\

(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 g:N -+ N be a recursive function satisfying the following two conditions:

range(g) is infmite, (8.9)

+u(i) is total for each natural i . (8.10)

Then, for every canonical she measure I I:N -+ N associated to (4,,),,lo, the set Mu,(+") = {z EN Iz E range(g), and for each y E range(g), if 4, = dl, then 1% I I Ir I} is r.e.

Proof. We shall prove that A4g,(4sl is the domain of a certain p.r. func- tion +:RV &HV. To this aim defme the partial function $:N &nV by

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,(,nl is obvious; to prove the converse inclusion

we we (8.7).

Page 457: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 recur- sive functions which we are dealing with in practical computations. An illuminating example is the set of all primitive recursive functions. In con- nection with this subrecursive clasa we may aak whether one does need general programs for any practical purpose though all practically comput- able functions are primitive recursive and the loop programa are sufficient for computing them. Theorem (8.11) and Scholium (8.10) give strong rea- sons for answering the above question in the atrumative. Indeed, let g*:N --+ IV be a recursive enumeration of all loop programs having smal- lest 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 complexity-theoretic 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 fol- lows:

'qJ)(z)9 if ' S ( T ( z ) ) 5 and %I(qS))(') = Y 9

10, otherwise,

where the recursive function T = TI comes from the Uniform Recursion Theorem (see Theorem (2.4.7)).

+,2,60 =

Assume 4, is total. If dbx[qJ)) (z) # cq then

Page 458: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 445

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 trade-offs 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 h(z,@g(j)(z)) a*e. (8.l4)

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 effec- tively fmd two naturals i and j (depending upon g and f ) such that con- ditions (8.3), (8.4) and (8.14) hold.

Page 459: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 l Y I> 9

ie not r.e. Actually we have:

(8.16) Theorem. (BLUM (1967b], MEYER (1972)) The set M(+ ie unmune.

Proof. We shall prove that for every infmite r.e. set W c Bv, W n (hr -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

fl it .) = df(fislj(s)>i$z) 9

for all i and z. The s-rn-n and Recursion Theorem furnieh a fmed point

Put no = f (pz[f(z) > io]). It follows that no E W, but no 4 M(,*), zo:Sio(z) = f l i a c z ) .

because 4i0 = and i, < no.

. o

6.9.HISTORY

As we have already pointed out the fmt systematic programming- oriented studies in complexity were due to CLEAVE (19631, and MEYER and RITCHIE [1967a], [1967b] and concerned the primitive recursive func- tions. The papers of MEXER and RITCHIE contain the basic resulta con- cerning the LOOP language, the loop hierarchy and ite relation with GRZEGORCZYK clwer . Prior to these fundamental papers RITCHIE (19631, and COBHAM I19641 investigated the structural subrecursive hierarchies by meanr of complexity-theoretic toob.

CONSTABLE [1971] extended the loop hierarchy through the multiple-recursive functions of PETER (1957). CONSTABLE and BORO- DIN [1972] contains a syskmatic rtudy of trade-off8 between program

Page 460: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 MAGGIOLO-SCHETTINI [1979], [1982]. The universal language. UL comes from CONSTABLE and BORODIN [1972] and MACHTEY [1972].

The definition of computation-time closed sets of functions is essen- tially due to RITCHIE [1963]. The time analysis of loop and loop- concatenation 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 “elementary-honest” classes; MEHLHORN [1976] haa studied the “polynomial-honest” 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 subrecur- sive 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 loop- computable 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?

Page 461: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

4# Cdudc

Settfon 6.S

(10.3) Prove that the functions [z/2] and tm(2,2) are exactly in

(10.4) Prove that the functions zy and 2’ are exactly in L2-L,. (10.5) Give the exact position of the functions [z/2], rm(z,2), z i ,

and z’ with respect to the loop-concatenation hierarchy. (10.6) (GOETZE and NEHRLICH [1980]) Prove that for all n 2 3,

k,m 2 1, if f :W -+RV is in Ln-l and g1 ,..., g,:N -+N are all in f i , 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 L i , 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.

L 1- Lo.

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 func- tions 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 ACKERMANN-PETER 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 > m 2 2, in,..., i, 2 1, put

. . jm-l,....j,,, im-l,..& (in)

(CLn-1 1 L?....Jrn- - & 2-rJrn ’ -

. . and denote by L~’”’”” the corresponding class of functions.

i ,.-& a) Show that each class L,,” b) Prove that the classes (L~””””’) form a hierarchy of primitive

(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

is computation-time closed.

recursive functions.

Page 462: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 6 449

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 n-l (respectively, LIZ).

Section 6.6

(10.19) Exhibit examples of primitive recursively-dishonest 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. Com- pare this result with the Compreosion Theorem (Theorem (3.4.19)).

(10.21) (MACHTEY [1972]) If f , g :N + Hv are primitive recursively-honest functions, such that L' 5 L', then there eldsts a primi- tive recursively-honest function h :Bv -* Bv, such that L f S Lh S LO.

Section 6.7

(1.10.6)) are simple. (10.22) a) Prove that the predicates A , V : M -+ (0,l) (see Exercise

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,

(10.24) (TSICHRITZIS [1970]) Prove that the following problems are

a ) Does an arbitrary simple function f:P + RV, n 2 1, take ulti-

b) Does two arbitrary simple functions f , g : W + N, n 2 1, agree

",d = z 4 f .

decidable:

mately a given value k?

on all but a fmite number of n-uples? 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 con- ditions (GINSBURG and SPANIER [1966]):

n8 m

(a) a,+Caizi = be+xbizi is a PRESBURGER formula for d i l l i =I

Page 463: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

450 Cdude

naturals m 2 1, u, ,..., u,, b,,..,,b,.

junction Pl A Pz and disjunction P1 V Pa. (b) If PI and P2 are PRESBURGER formulae, then 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

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:

( 3 zi)P(z1,*.vzn).

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 number- theoretic 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 b) In I' 5 o(l. I). (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:

a) if In I I Im 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 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 :fl -c Qv, and for each natural i, we can effectively fmd a natural j such 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

Page 464: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Chapter 5 451

f :N -+ RV defmed by

f (2) = pv[d,(O) = z and for each natural k,

i f h ( 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.

Page 465: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

This Page Intentionally Left Blank

Page 466: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

463

BIBLIOGRAPHYT

ACKERMA", W., Zum Hilbertwhen Aufbau der r e e h n Zahlen, Math. Ann. 99 (1928), 118-133.

ADLEMAN, L., POMERANCE, C. and RUMELY, R., On dutinguihing prime numberr from comporite numberr, Ann. of Math. (2) 117 (1983) 173-208.

ADRIANOPOLI, F., Una nuova forma normale per le funrioni parridi ricorrive, UniveraitZ degh rtudi di Salermo, Prcprint Series, ISI-TR-017, 1978.

ADRIANOPOLI, F. and DE LUCA, A., Closure oprrationr on meuurer on computational complexity, Cdcolo 2 (1974), 1-13.

AHO, A.V., HOPCROFT, J.E. and ULLMAN, J.D., The Der ip and Analytir of Computer Algorithms (Addiron-Werley, 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, Englewd Cuffs, N.J., 1969).

ASSER, G., Rekurrive wortfunktionen, Z. Math. Logik Grundly. Math. 6 (lOeO), 258-278.

AZRA, J.P. and JAULIN, B., Recurrivite' (Gauthier-Viarr, Paru, Bruxeller, Montrdd, 1973).

BLAKLEY, G.R. and BOROSH, I., Knuth'r iterated powers, Adv. in Math. 34 (l979), 109- 138.

BLUM, L. and BLUM, M., Toward a mathematical theory of inductive inference, Inform. and Control 28 (l975), 126-155.

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), 322-336.

BLUM, M., On the rise of machines, Inform. and Control 11 (1967b), 267-266.

Journal titler are abbreviated according to Mathematical Review.

Page 467: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

454 Cdude

BLUM, M., On effective procedurer for rpeeding up algorithmr, in: ACM Sympoaium on Theory of Computing, 1969, 43-53.

BOOK, R.V., Brief bibliography on computational complexity, Aiken Computation Labora- tory, Har rud Univerrity, 1969.

BOREL, E., Le calcul dcr ink’graler definer, Journal de Mathdmatiquer 8 (1912), 159-210.

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, 67-78.

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: INFO-IASI’83, Proc. 4th National Colloquium on Computer Science, h i , 1983, 103-110 (Romanian).

CALUDE, C., Darboux property and primitive recurrive functionr, Rev. Roumaine Math. Pureo Appl. 26 (1981), 1187-1192.

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 Encicloped- ica, Bucurcrti, 1982b (Romanian)).

CALUDE, C., On a c l v r of independent problemr related to Rice theorem, ACM SIGACT New0 15 (1983a), 53-57.

CALUDE, C., A simple non-uniform operation, Bulletin of EATCS 20 (1983b), 40-46.

CALUDE, C. and CHITESCU, I., Random atringn according to A.N. Kolmogorov and P. Mutin-Lif. C l w i c d approach, Found. Control Engrg. 7 (1982a), 73-86.

CALUDE, C. and CHITESCU, I., Strong noncomputabiiity of random otringr, Internat. J. Comput. Math. 11 (1982b), 43-45.

CALUDE, C. and CHITESCU, I., On repreoentabiiity of P. Martin-Liif terto, Kybernetika 19 (1983a), 42-47.

CALUDE, C. and CHITESCU, I., On a (too) general theory of raodom sequencer, in:

Page 468: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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. Muti-Liif teab, Kyber- netika 19 (198k), 62G536.

CALUDE, C. and FANTANEMU, B., On recursive, non-primitive recursive functionr, Bull. Math. Soc. Sci. Math. R.S. Roumanie (N.S.) 22 (1978), 366-366.

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), 49-64.

CALUDE, C. and TATARAM, M., Univerrd sequencer of primitive recursive functions, Rev. Roumline Math. Purer Appl. 28 (1983), 381-389.

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), 263-266.

CALUDE, C. and ZIMAND, M., A relation between correctneu and randomneu in the com- putation of probabilirtic dgorithmr, Internat. J. Comput. Math. 16 (l984), 47-53.

CEITIN, G.S., Mem-vduc theorems in conrtructive analysu, Trudy Mat. Inst. Steklov 67 (l962), 362-384. (Russian)

CHAITIN, G.J., On the length of programs for computing fiite binuy sequencer, J. Auoe. Comput. Mach. 13 (l966), 647-569.

CHAITIN, G.J., Information-theoretic limitations of formal system, J. hm. Comput. Mach. 21 (1974), 403-424.

C U T I N , G.J., A theory of program sire formally identical to information theory, J. Awe. Comput. Mach. 22 (1976), 329-340.

CHAITIN, G.J., Algorithmic information theory, IBM J. R ~ I . Develop. 21 (1977), 360-369.

CHAITIN, G.J. and SCHWARTZ, J.T., A note on Monte Culo primdity teati and ao- rithmic information theory, Comm. Pure Appl. Math. 31 (l978), 621427.

Page 469: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

456 Calude

CHURCH, A., A mt of portulater for the foundation of logic, Ann. of Math. 33 (1932), 346- 366.

CHURCH, A,, A mt of pwtulater for the foundation of logic (wcond paper), Ann. of Math. 34 (1933), 839-864.

CHURCH, A., An unsolvable problem of elementary number theory, Amer. J. Math. 58 (1936), 345363. (Ako in DAVIS [l966], 89-107)

CLEAVE, J.P., A hierarchy of primitive recurnive functionr, Z. Math. Lo& Grundly . Math. 9 (19633, 331-345.

COBHAM, A,, The intrinric computational difliculty of functionr, in: BAR-HILLEL, Y. (ed.), Proctedinp of the Congrew on Logic, Methodology and Philoaophy of Science, Haifa, brael (North-Holland, h a t e r d a m , 1964, 2430).

CONSTABLE, R.L., Subrecurrivtprogramminng lurguyer III. The multiple-recurnive func- tionr R”, in: Symporium on Computein m d Automata, Polytechnic Inntitute of Brooklyn, 1971, 393-410.

CONSTABLE, R.L., The operator gap, J. Auoc. Comput. Mach. 19 (1972), 176-183.

CONSTABLE, R.L. and BORODIN, A.B., Subrecurrive programming languages, Part I: Effi- ciency and program ntructure, J. h o c . Comput. Mach. 19 (1972), 526-668.

COOK, S.A., An overview of computational complexity, Comm. ACM 26 (1983), 401-408.

DALEY, R.P., Quantitative and qualitative information in computation, Inform. and Control 45 (l980), 236-244.

DAVIS, M., Computability and Unnolvability (McCraw-Hill, 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), 233-269.

DAVIS, M., What L a computation? in: STEEN, LA. (ed.), Mathematicr Today, Twelve Informal Earayi (Springer-Verlag, New York, Heidelberg, Berlin, 1978, 241-267).

DAVIS, M., Why W e 1 didn’t have Church’i therir, Inform. and Control 64 (l982), 3-24.

DEDEKWD, R., Was rind und wiu 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.

Page 470: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Bibliography 457

DE LEEUW, K., MOORE, E.F., SHANNON, C.E. and SHAPIRO, N., Computability by pro- babiliatic machinea, in: SHANNON, C.E. m d McCARTHY, J. (edi.), Automata Studies (Princeton Univ. Prcrs, Princeton, N. J., 1966, 183-212).

DIMA, N., Sudan’s function u universal for the c h i of primitive rccuriive functions, Stud. Cerc. Mat. 33 (leal), 69-67. (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 (North-Holland, Amsterdam, 1977, 527-666).

ERDOS, P. and MILLS, G., Some boundr for the Ramrcy-PariEHurin&on numbers, J. Combin. Theory Ser. A, 30 (1981), 53-70.

FACHINI, E. and MAGGIOLO-SCHETTINI, A., A hierarchy of primitive recurrive iequence functiona, RAJRO Inform. Thew. 13 (1979), 49-67.

FACHINI, E. and MAGGIOLO-SCHETTINI, A., Comparing hieruchier of primitive recur- sive sequence functions, Z. Math. Logik Grundly. Math. 28 (1982), 431-446.

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 lamr of oneargument recursive functioni, Z. Math. Logik Grundlag. Math. 22 (1976a), 127-130.

GEORGIEVA, N.V., Hierarchies of one argument primitive recursive functions, C.R. A c d . Bulgare Sci. 29 (1976b), 919-922.

GILL, J., Computational complexity of probobiliatic Turing machioar, SIAM J. Comput. 6 (1976), 675-696.

GILL, J. and BLUM, M., On almoit everywhere complex recurrive hnctionr, J. h o c . Com- put. Mach. 21 (1974), 425-436.

GINSBURG, 9. and SPAMER, E., Semigroupr, Prcrburger formulu, and Isngurpr, Pacific J. Math. 16 (1966), 286-296.

GLADSTONE, M.D., Simplification of recuriion rchcme, J. Symbolic Logic 36 (1971) O M - 666.

Page 471: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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], 5-38)

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, 39-73).

GODEL, K , Uber die Lange der Beweise, Ergeb. eines math. Kolloquiume 7 (l936), 23-24. (English translation in DAVIS [1965], 82-83).

COETZE, 8. and NEHFUICH, W., Loop propamr and claarer of primitive recursive func- tions, in: Proc. 7th Sympoiium Mathematical Foundationr of Computer Science 1978, Lec- ture Notcr in Comput. Sci. 64 (1978), 232-237.

GOETZE, 8. and NEHRLICH, W., The structure of loop programs and subrecursive hierar- chies, 2. Math. Logik Grundlag. Math. 26 (1980), 256-278.

GOETZE, B. and NEHRLICIi, W., The number of loop8 necersary and sufficient for com- puting rimple functionr, Elktron. Informationrverarb. Kybernet. 17 (l981), 363-376.

GRZEGORCZYK, A., Some clansea of recursive functionr, Roiprawy Matematycine 4 (1953), 1-46.

GUY, R.K., Unrolved Problems in Number Theory (Springer-Verlag, New York, Heidelberg, Berlin, 1981).

HARROW, K., Equivalence of some hierarchies of primitive recursive functionr, 2. Math. Logik Grundlag. Math. 25 (1979), 411-418.

HARTMAMS, J., Computational complexity of one-tape Turing machine computations, J. Aaioc. Comput. M x h . 15 (l968), 325-339.

HARTMAMS, J., On the problem of hiding natural computational complexity measures, Cornell Univeriity, Technical Report 73-175, 1973.

HARTMAMS, J. and HOPCROFT, J.E., An overview of the theory of computational com- plexity, J. h r o c . Comput. Mach. 18 (loll), 444475.

HARTMANlS, J. and HOPCROFT, J.E., Independent rerultr in computer science, ACM SIGACT Newi 8 (1976), 13-24.

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, 82-90.

HARTMAMS, J. and STEARNS, R.E., On the computational complexity of algorithmr, Trani. Amer. Math. SOC. 117 (lees), 286306.

Page 472: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Bibliography 459

HELM, J.P., On efktivoly computable operators, Z. Math. Lo& Grundly. Math. 17 (1971), 231-244.

HELM, J.P. and YOUNG, P., On rise VI. efficiency for programr admittins speed-up, J. Symbolic Logic 30 (1971), 21-27.

HENKE, F.W., INDERMARK, K., ROSE, G. m d WEIFIRAUCH, K., On primitive recurrive word functionr, Computing 16 (1976), 217-234.

HENNIE, F.C., Introduction to Computability (Addiron Wesley, New York, 1977).

HENNIE, F.C. and STEARNS, R.E., Two-tape simulation of multitape Turing mrchincr, J. h l o c . Comput. Mach. 13 (1960), 633-648.

HEFlMES, H., Enumerability, Decidability, Computability (Academic Pram, New York, 1966).

HILBERT, D., Uber d m Unendliche, Math. Ann. 96 (1920), 181-190. (English translation in VAN HEIJENOORT [1907], 367-392)

IBARRA, O.H. and LEININGER, B.S., Chuacterirationr of Presbur~er functioni, SUM J. Comput. 10 (lQ8l), 22-39.

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), 16-20.

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), 46-80.

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), 268-263.

KATSEFF, H.P. and SIPSER, M., Several results in program sire complexity, Theorat. Com- put. Sci. 16 (1981), 291-309.

KETONEN, J. and SOLOVAY, R., Rapidly growing R~MIIOY function#, Ann. of Math. 113 (l981), 287-314.

KFOURY, A.J., MOLL, R.N. and ARBIB, MA. , A Programming Approrch to Computability (Springer-Verlag, New York, Heidelberg,&rlin, 1982).

Page 473: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

400 Calude

KLEENE, S.C., General recurrive functionr of natural numberr, Math. Ann. 112 (1936), 727-742. ( A h in DAVIS [1966], 236253)

KLEENE, S.C., Introduction to Metunathematic8 (North-Holland, Amsterdam, P. Noardh- off, Groningen and D. Van Nostrand, Toronto and New York, 1962).

KLEENE, S.C., Extenrion of an effectively generated clur of functionr by enumeration, Col- loq. Math. 6 (lose), 67-78.

KLEENE, S.C., The theory of recurrive functionr, approaching itr centennial, Bull. Amcr. Math. SOC. (N.S.) 5 (loel), 43-61.

KNUTH, D.E., The Art of Computer Programming, Seminumerical Algorithmr (Vol. 2) (Addiron-Weiley, Reading MA, 1989).

KNUTH, D.E., Mathematics and compukr rcience: Coping with finitenerr, Science 194 (1976), 123S-1242.

KOLMOGOROV, A.N., Three approaches for defming the concept of "information quan- tity", Problemy Peredaci hformacii 1 (l96S), 3-11. (Rurrian)

KOLMOGOROV, A.N., Logical b u b for information theory and probability theory, IEEE Trans. Inform. Theory 14 (l968), 662-1384.

KOLMOGOROV, A.N., Combinatorial brrir for information theory and computable proba- bility, Urpekhi Mat. Nauk 38 (1983), 27-36. (Ruirian)

KREISEL, G., LACOMBE, D. and SHOENFIELD, J.R., Partial recurrive functionah and effective operationr, in: HEYTING, A. (ed.), Conrtructivity in Mathematicr (North-Holland, Amrterdam, 1959, 195-207).

LACHLAN, A.H., Eflective operatori in a general irtting, J. Symbolic Logic 29 (l964), 163- 178.

LANDAU, S., Primer, codel and the National Security Agency, Noticer Amer. Math. SOC. 30 (lass), 7-10.

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), 197-214.

LOVELAND, D.W., A variant of the Kolmogorov concept of complexity, Inform. and Con- trol 16 (I989), 51&626.

Page 474: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Bibliography 48 1

MACHTEY, M., Augmented loop languagem and clurer of computable functionr, J. Cornput. Syrkrn Sci. 6 (1972), 003-624.

MACHTEY, M. and YOUNG, P., An Introduction to the General Theory of Algorithmr (North-Hollmd, Amrkrdam, 1978). MALITZ, J., Introduction to Mathematical Logic (Springer-Verlag, New York, Heidelberg, Berlin, 1919).

MA", Y.I., A Courre in Mathematical Logic (Springer-Verlag, New York, Heidelberg, Bar- b, 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), 447-467.

MARCUS, D.A., An alternative to Euclid'r algorithm, Amer. Math. Monthly 88 (1981). 280. 283.

MARKOV, A.A., Theory of algorithmr, Trudy Math. Inat. Steklov 38 (l95l), 176-189. (Rue rim)

MARKOV, A.A., The Theory of Algorithms (National Science Foundation, Wmhington, D.C., 1981).

MARTIN-LOF, P., On the orcillation of the complexity of infinite binary requencer, (1986), (Unpubbhed manuscript; cited from MARTIN-LOF [l971]) (Rudan)

MARTIN-LOF, P., Algorithma and Random Sequencer (Erlangen Univerrity, Niirnberg, Erlangen, 1966a).

MARTIN-LOF, P., The definition of random iequencer, Inform. and Control 9 (1968b), 602- 619.

MARTIN-LOF, P., Nokr on Constructive Mathematicr (Almqvirt & W i k ~ l I , Stockholm, 1970).

MARTIN-LOF, P., Complexity orcillationr in infinite binary sequencer, 2. Wahrach. Verw. Gebiete 19 (1971), 225230.

McCREIGHT, E. and MEYER, A.R., Clolrer of computable functionr def ied by boundr on computation, preliminary report, in: ACM Symporium on Theory of Computing, 1909, 79-88.

MEHLHORN, K., On the rise of computable functioni, in: IEEE Annual Symporium on Sr ikhing and Automata Theory, Univ. Iowa, Calii., 1973, 19G198.

Page 475: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

482 Calude

MEHLHORN, K., Polynomial and sbrtract nubrecurrive cl.uc8, J. Comput. Syrtem Sci. 12 (1976), 147-178.

MEYER, A.R., Propun rim in rertrickd progrunming Ianguager, Inform. and Control 21 (1972), 382-394.

MEYER, A.R. and FISCHER, P.C., Computational epeed-up by effective operatori, J. Sym- bolic Logic 37 (1972), 56-68.

MEYER, A.R. and MOLL, R., Honest boundr for complexity c lvrer of recursive functionr, in: Proc. 13th Annual Switching and Automata Theory Coot College Park, Md., 1972, 61-66.

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), 465-470.

MEYER, A.R. and RITCHIE, D.M., A clsriification of functionr by computational complex- ity, in: Proc. Hawaii International Conference on SyNtem Science, Hawaii, 1968, 17-19.

MEYER, A.R. and RITCHIE, D.M., A clsrrification of recurrive functionr, Z. Math. Lo@ Grundlag. Math. 18 (1972), 71-82.

MEYER, A.R. and W " N , K., The fundamental theorem of complexity theory, prel- iminary vereion, Foundationr of Computer Science IU (Third Advanced Couru, Amrterdm, 1978) Part I (Mathematier Ctntrum, Amrterdun, 1979, 97-112).

MILLER, C.L., Riemann'i hypotherin and te rk for primality, J. Comput. Syrtem Sci. 13 (1976), 300-317.

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 (Prentice-Hall, Engkwood Cliffi, N.J., 1967).

MORDELL, L.J., Diophantine Equationr (Academic Preu , London, New York, 1969).

MYHILL, J. and SHEPHERDSON, J.C., Effective operationr on partial recuriive functionr, 2. Math. Logik Grundlag. Math. 1 (1965), 310-317.

NALIMOV, V.V., Facer of Science (IS1 Preu , Philadelphia, 1981).

NOVIKOV, P.S., Elementr of Matbematical Logic (Ed. Stiintifica, Bucurerti, 1966) (Romanian)

Page 476: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 (Springer-Verlag, Berlin, Heidelberg, New York, 1971).

PARIS, J. and HARRINGTON, L., A mathematical incompletenew in Peano arithmetic, in: BARWISE, J. (ed.), Handbook of Mathematical Logic (North-Holland, Amrkrdun, 1977, 1133-1142).

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), 612-632.

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) 103- 105. (Ah0 in DAMS (1965], 288-291)

POST, E.L., Formal reductionr of the general combinatorid decbion problem, Amer. J. Math. 65 (1943), 197-215.

RABIN, M.O., Speed of computation of functionr and cladicatioa of recuriive rctr, in: Proc. Third Convention Sci. Soc., Israel, 19W, 1-2.

W I N , M.O., Degree of difficulty of computing a function and a partial ordering of recur- rive rctr, Hebrew University, Jeruralem, Technical Report nr. 2, 1980.

RABIN, M.O., Real-time computation, Lrael J. Math. 1 (1963), 203-221.

RABIN, M.O., Probibdintic algorithma, in: TRAUB, J.F. (ed.), Algorithm and Complexity, New Directionr and Recent Rerultr (Academic Preu , New York, 1976, 21-39).

RABIN, M.O., Complexity of computations, Comm. ACM 20 (1977), 626633, Corrigendum: 21 (i97a), 231.

RICE, H.G., C~UKI of recurrively enumerable wtr and their decuion problemr, Tram h e r . Math. SOC. 74 (1963), 358-366.

RICE, H.G., Recutrive real numbcrr, Proc. Amer. Math. Soc. 5 (1964), 784791.

Page 477: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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), 139-173.

RITCHIE, R.W., Clurer of recurrive functions bued on Ackermann’r function, Pacfic J. Math. 16 (l965), 1027-1044.

M T , R.L., SHAMIR, A. and ADLEMAN, L., A method for obtaining digitd r ipa turcr and public-key cryptoryrtema, Comm. ACM 21 (1978), 120-126.

ROBERTSON, E.L., Complexity clrrrer of partial recurrive functionr, preliminary version, in: Thud Annual ACM Symporium on Theory of Computing, 1971, 268-268.

ROBINSON, R.M., Primitive recurrive functionr, Bull. h e r . Math. Soc. 53 (1947), 925-942.

ROGERS, H., G d e l numberingr and partial recurrive functionr, J. Symbolic Logic 23 (1958), 331-341.

ROGERS, H., Theory of Recurrive Function8 and ERective Computability (McGraw-Hill, New York, 1967).

SANTOS, E.S., Computability by probabilistic Turing machino, Tranr. Amer. Math. Soc. 159 (1971), 165-184.

SCHNORR, C.P., Do- the computational apeed-up concern programming! in: NIVAT, M. (ed.), Automata, Languagea and Programming (Norlh-Holland, Amrterdam, 1973, 585-591).

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 HIN- TJJCKA, J. (eds.), Baic Problem in Methodology and Linguuiticr (D. Rcidel, Dordrecht, 1977, 193-210).

SCHNORR, C.P. and STUMPE, G., A characterisation of complexity sequencea, 2. Math. Lo& Grundlag. Math. 21 (1975), 47-56.

SHEPHERDSON, J.C. and STURGIS, H.E., Computability of recuraive functionr, J. ~ I O C .

Comput. Mach. 10 (1963), 217-256.

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. Matematuik-Naturvidenrkabelig K l w , 1923 (Englih tranrlation in VAN HEIJENOORT [l967], 302-333)

SMORYNSKI, C., Some rapidly growing functionr, Math. Intelligencer 2 (lOzIO), 149-164.

Page 478: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Bibliography 485

SMORYNSKI, C., “Big” newr from Archimeder to Friedman, Noticar Amer. Math. Soc. 30 (1983), 251-266.

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), 1-22.

SOLOVAY, R. and STRASSEN, V., A rut Monk-Carlo 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), 145-168.

STAIGER, L., ReprcMntabk Martin-Lot terti (Manulcript, March 1984).

STEARNS, R.E., HARTMANIS, J. and LEWIS, II, P.M., Hierarchiei of memory limited com- putationr, in: IEEE Conf. Rec. on Switching Circuit Theory and Logical Darim, 1965, 179- 190.

STRONG, H.R., Algebraically generalized recutrive function theory, IBM J. Res. Develop. 12 (lOeS), 465-475.

SUDAN, G., Sur Ie nombre trandiii w “, Bull. Math. Soc. Roumaine dcr Science8 30 (1927), 11-30.

TRAKHTENBROT, B.A., Complexity of Algorithms and Computationm, Courae noter, Novo- aibirrk, 1967. (Ruuian)

TSICHRITZXS, D., The equivalence problem of rimple loop progrwnr, J. AJIOC. Comput. Mach. 17 (1970), 729-738.

TURING, A.M., On computable numberr, with an application to the Enticheidungaproblem, Proc. London Math. Soc. 42 (1936), 230-266, Correction: 43 (1937), 544546. (Ah in DAVIS Il065], 116-161, 162-154)

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 Nok i in Comput. Sci. 122 (1981), 100-234.

VAN EMDE BOAS, P., Ten yeari of ipcsd-up, in: Proc. 4th Symporium Mathematical Foun- dations of Computer Science 1976, Lecture Notcr in Comput. Sci. 32 (1976), 232237.

Page 479: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

466 Calude

VAN HEIJENOORT, J., From Frege to M e l . A Source Book in Mathematical Logic, 1879- 1931 ( H u r u d Univ. Pram, Cambridge, Mur. 1967).

VEFtBEEK, R., Primitiv-Rekurriv Grregorcryk-Hieruchien (Univerritit Bonn, Informatik berichte, Bonn, 1978).

VON NEUMA", J., The general and logical theory of automata, in: TAUB, AN. (ad.), Collected Workr, vol. 5 (Pergamon Preu, Oxford, London, New York, Pub, 1963, 288-328).

WAGNER, E.G., Uniformly reflexive rtructurm: On the nature of gadelirationr and relative computability, Tranr. Amer. Math. SOC. 144 (1969), 1-41.

WEIHRAUCH, K., Tcilklaurrcn primitiv-rekurriver Wortfunktionen, Berichte der GMD 91 (1974, 1-49.

WEYL, H., Uber die neue Grundlyenkrue der Mathemrtik, Math. 2. 10 (1921), 39-79.

YAMADA, H., Rcal-time computation and recurrive functionr not real-time computable, IRE Tranr. 6 (l962), 753-760.

YASUHARA, A., Reeurrivc Function Theory and Logic (Academic Prerr, New York, Lon- don, 1971).

YOUNG, P., Eary conrtructionr in complexity theory: Gap and rpeed-up theoremr, Proc. Amer. Math. SOC. 37 (1973), 556-5133.

W-TING, S., A "natural" enumeration of non-negative rational numberr. An informal d b currion, Amer. Math.Monthly 87 (1980), 25-29.

ZIMAND, M., Complexity of probabilirtic algorithm, Found. Control Engrg. 8 (1983a), 33-49.

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), 85-127. (Rurrian)

BIBLIOGRAPHY ADDED IN PROOF

MIIR, A. m d CHOUEKA, Y., Polynomial computrtionr in non-detarminintic loop-propmu and PL-propma, 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 P = 4 P problem, Inkmat. J. Comput. M J h . 17 (lWS), 217-128.

Page 480: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Bibliography 467

BEESON, M.J., Foundations of Constructive Mathematici (Springer-Yerly, Berlin, Heidel- berg, 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 rued-point theorem, Bulletin of EATCS 26 (1986), 1419.

CALUDE, C. and CHITESCU, I., A c lv r of univerral P. Martin-L6f tertr, Bulletin of EATCS 23 (1984), 15-22.

CALUDE, C., CHITESCU, I. and STAIGER, L., P. Martin-LBf tarts: Reprewntability and embeddability, Rev. Roumaine Math. Purer Appl. 30 (1986), 719-732.

CICHON, E.A. and WAINER, S.S., The slow-growing and the Grregorcryk hierarchier, J. Symbolic Logic 48 (1983), 399-408.

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 non-computability of computability, Bulletin of EATCS 28 (lC86), 3&39.

GANDY, R.O., Some rclationr between c lwer of low computational complexity, Bull. Lon- don Math. SOC. 16 (1984), 127-134.

HARTMANIS, J., Generalired Kolmogorov complexity and the rtructure of feuible compu- tationr, Preliminary Report, Cornell Univerrity, 1984.

HARTMANIS, J., Independence rcrulk about context-free languages and lower boundi, TR-84-808, Cornell Univerrity, 1984.

HUYNH, D.T., Reiourctbounded Kolmogorov complexity and hard Ianguager, TR-8610, Iowa State Univeriity, 1986.

KARP, R.M., Combinatorica, complexity and randomnerr, Comm. ACM 29 (l986), 96-109.

KRAMOSIL, I., Recurrive clwification of paeudo-random sequencer, Kybernetika 20 (1984), 3-34.

LEVIN, LA., Randomneu conservation inequalitier: Information and independence in mathematical theorier, Inform. and Control 61 (1984), 15-37.

Page 481: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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), 797-803.

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 Preu , Oxford, 1984).

SIPSER, M., A complexity theoretic approrch to randomneii, in: ACM Sympoaium on Theory of Computing, 1983, 330-336.

SIPSER, M., Computation by Automata (M.I.T., 1983).

STAIGER, L., Repreientabb P. Martin-LBf 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), 17-33.

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), 81-88.

Page 482: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

469

INDEX OF NOTATIONS

N l 1

El 1

R, 1

= , # , I

€ 1 & 1

{... I...}, 1

C nI1 1

u 1 1

nl 1

-1 1

x 1 1

A', 1

f :A + B , 1

Page 483: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

470 Cdudc

PSQ, 18

A(Z), 20

Ck), 22

e’, 23

z + y, 23

ZY, 23

zv, 23

Pd, 23

I 2-9 1, 24

8qrf(z) = [ x ” ~ ] , 24

18, 25

p r [ ...I, 28 1

quo, 30

PRIME, 30

n!, 30

1

i-0 V , 3 1

Page 484: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Index of Notations 47 1

I A , 31 i4

u p , 34

dn) , 34, 35

J y 35

I?), 35

R("), 37,' 38

MP), 38

exp, 40, 41

long, 41

< xo,...,x, >, 42

sn, 52

max, 57

ma=(...), 57 I

od, 79, 80

esr 80

gcd, 81

ACK, 82

rev, 83

D, 84

Page 485: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

472 Cdude

p,r., 91

last , 96

time , 98

Ff"), 99 - - 0,1, ..., n , ...) loo

(h/t*P I 1 100

S R B R , loo

=, loo

t -1 102

!In1116

ual , 116

Vat, 116

Num , 116

Term , 116

Eq, 117

GN, 117

termeub, 118

Sub, 118

Rep, 118

grsymb , 120

DSj, 121

Detjl 121

n j, 122

Zj, 122

w j , 123

w j'", 123

cdk;'), 123 trans , 124

eomp, 126

P1127

T, 127

f!"), 129

select , 129

a:, 129, 130

T,, 135

&'I, 138

K, 151 n

diag, 145

r.e., 146

n T, 152

Wi, 154

im, 154

Page 486: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Index of Notations 473

preim , 154

+n, 154

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, 204

9,211 -

apz, 211

Page 487: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

474 Cdude

H ( t , m ) , 315

H( z ,m ), 3 15

U , 320, 321

my, 323

mu, m , 323, 324

K, 334

< F,s >, 337

?h(F,S), 337

xmVr , 362

D(4,2), 378

K,(z;m), 378

k1385

L , 386

kr, 392

L,, 392

k,, 393

Timep, 394

L k 397,398

L i , 398 A Z3, 398

A('), 398

< A >, 398

b t * p , 400

UL, 402

TZME(h), 414

A.(f 1 1 417

- Lf , 417

L f , 417

Sp, 419

4r 1 1 426

+ , d l 429

sum, , 439

I I1 440

%W,b 443

%Jl 446

k Jr'-"am ,448 . .

. . 1 Jr'-4n , 448

Page 488: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

475

SUBJECT INDEX

acceptable gbdelization, 138 acceptable programming system, 138 ACKERMANN-PETER’s function, 11 ACKERW-PETER’s hierarchy, 7,20 algorithm, 87, 88 atgorithmically computable function, 88 almost everywhere (ax.), 220 ax. h-computable function, 296 a.c. h-hard 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’S function, 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 computation-time closed class, 414 computational complexity measure, 211 concatenation, 71 convergence function, 106 course-of-values recursion, 43 critical level, 357, 368 critical level induced by a M-L test, 323

Page 489: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

470 C d u d e

decidable, 146 depth of nesting, 392 derivation, 101, 102 double courstof-values recursion, 81 dovetailing, 128

effective operator, 190 elementuy-honest e l m , 426 enumerating function, 188 enumeration operator, 179 Enumeration Theorem, 123 equationally computable partial function, 103 equivalence problem, 427 EULER-FERMAT's Theorem, 302 J3ULER'e phi-function, 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

Fixed-Point Theorem, 132 f o r m d equation, 100 formd system (CHAITIN), 337 free monoid, 2 full M-L test, 360 function computed by a general program, 403 function index set, 161 functional composition, 22, 91 functional operator, 182

fixed-point, 132

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

Page 490: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Subject Index 477

independent statement, 167 index (relative to an acceptable g&ielization), 99 infinite sequence, 2 infinitely often (i.o.), 220 i.0. h-computable function, 268 Lo h-hard function, 296 iteration, 5

JACOBI's symbol, 301

KALMAR elementary functions, 82 KLEENE's Normal-Form Theorem, 127 KLEENE's predicate, 127 KNASTER-TARSW'a Theorem, 186 KNUTH's notation, 7 KOLMOGOROV's complexity, 304 KREISEL-LACOMBESHOENFEL.D's Theorem, 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 X-primitive recursion, 72 loop-computable function, 386 loop-concatenation number, 397, 398 loop-concatenation hierarchy, 402 loop hierarchy, 397 LOOP language, 384,385 loop program, 385 loop variable, 385

m-argument associate function, 53

measure of computation, 211 measured set, 238 memory-complexity, 212 MILLER and W I N probabilistic algorithm, 300, 301 minimization, 91 minimization over {a$, 206 MOIVRE and LAPLACEs Theorem, 378,379 m-random string (KOLMOGOROV), 311,312

name (of a complexity class), 226

MARTIN-LOF's test (M-L teat), 314

Page 491: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

478 C d u d e

normal derivation, 106 null string, 2 number-theoretic partial function, 1 numeral, 100

onoargument primitive recursive function, 9 operator, 190 Operator Gap Theorem, 234 Operator Speed-Up 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 par t id recursive (p.r.) string-function, 206 partially decidable, 146 P W O arithmetic, 6 PEANO axioms, 3 PELL’s equation, 9 P-loop 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 string-function, 72 primitive recursively-honest 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

RAMSEY-PARIS-HARRINGTON numbers, 6 RhMSEY’e Theorem, 6 random etring (KOLMOGOROV), 311 real-time 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

Page 492: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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 M-L 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

479

scope (of a loop), 386 semi-churcterirtic 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 8-m-n function, 129, 130 8-m-n Theorem, 130 SOLOVAY and STRASSEN probabilietic algorithm, 301 Speed-Up Theorem, 261 step-counting functions, 211 string, 2 string-iunction, 72 Substitution Rule (SR), 100 SUDAN’S function, 46 SUDAN’S hieruchy, 46, 67 support, 279

term, 99, 100 time-complexity, 127 total effective operation, 193 total effective operator, 190 Totality Problem, 168 TURING machine, 144

UL-computable partial function, 403, 404 ultimately zero function, 269 uniform complexity, 378 uniform M-L 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

Page 493: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

480 Cdude

universd M-L teat, 321 universd p.r. function, 123, 139

variable, 99

WAGNER-STRONG uci011~,129,130

X-primitive recursion, 72

Page 494: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

48 1

AUTHOR INDEX

ACKERMANN, w., xi, 7 , n , 13, is , 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

AMIR, A., 439,463,466 ARBIB, M.A., 144, 292,294,453,459 ARCHIMEDES, 6,7, 465, 475 ASSER, G., ix, 78,453

AL-KHOREZMI, 201

AZRA, J.P., 202,294,296,453

BAIRE, R., 278,282,287,288,468, 476,479

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, 211-224, 226, 232, 238, 238, 241, 243,

BAR-HILLEL, Y., 456

248, 249, 250, 251, 256, 257, 259, 263, 286268, 270, 273, 278, 292-295, 376,377,384,394,407, 414, 418, 428, 4(0-443, 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

Page 495: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

482 Cdudt

CHOUEMA, Y., 439,453,466 CHURCH, A., vii, 92, 146, 202, 456,468, 475 CICHON, EA. , 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

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

ELENBERG, s., 78,202,467

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, 293-298, 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, 41-43, 77, 92, 94-96, 114-122, 126, 126, 129, 162,

186171, 201, 202, 247, 261, 269, 270, 272, 292, 339, 340, 456, 458, 464, 466, 468, 476

Page 496: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Author Index 483

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,291-294,447,468, 466,467 HASENJAEGER, G., 467 HELM, JP., 202, 278,296,469 HENKE, F.W., 78,469

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

HENNIE, F.c., 78,144,202,292,4~~

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

JURGENSEN, H., ix JOSEPH, D., 202,469

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,

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,328-334,

336, 337,340,341, 346,347, 349, 361,368,367, 374,375378, 381,

2(u, 216, 226, 246,108,426, 427,466, 458,460,467,477

464,469,460,467,476,477-479 KRAMOSIL, I., 467

Page 497: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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., 377-379, 460

MACHTEY, M., vii-ix, 78, 130, 138, 141, 144, 202, 204, 293, 294, 298, 402, 404,

MAGGIOLO-SCHETTINI, 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 MARTIN-LOF, P., vii-ix, 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, 293-296, 383,

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

417,418,420, 423,425,440, 441,443,444,447,449,450,461

384,388,392,396,407,414,428,446,447, 461,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

Page 498: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Author Index 485

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,

POMERANCE, c., 300,453 POST, EL., 202,463 PRESBURGER, M., 447, 449, 460, 457, 469, 478

w, 202, m, m, 2 9 5 , 4 ~ , 4 4 a , 463

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,

RITCHIE, R.W., 38, 53,62, 63, 69,71,73,78,83,99,204, 414, 446,447,

RTVEST, RL., 301,302,464 ROBERTSON, E.L., 246,293,296,460,464 ROBINSON, R.M., 19,37,38, M,78, 416, 464,479 RODDING, D., 467

447, 462, 476

464,479

ROGmS, H., ix, 88, 138, 141, 142, 166, 167,162, 164, 172, 191-193, 202-206, 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

SEVENSTER, A., ix SHCLMIR, A., 301,302,404 SHANNON, CE., 372,457

SEMENOV, A.L., 202,294,377,4~5

Page 499: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

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

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 2 , w, w, 202, m,

STEARNS, R.E., 226, 291-293, 438, 469, 465

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

TURLNG, A.M., vii, 144,202, 212,291,389, 467-469, 464,466, 478, 479 TEW, I., 6Q, 77,466

TSICHRITZIS, D., 384, 421-429, 434, 437, 447, 449, 405

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, 74-78,84,469, 466,468 WEYL, H., vii, !U31, 466 -, E.J., 467

Page 500: THEORIES COMPUTATIONAL COMPLEXITYcristian/crispapers/CristianCalude... · independent theories of computational complexity, whose selection is motivated by their intrinsic importance

Author Index

WINKLMANN, K., 293,462

YAMADA, H., 308, 292,466 YASUHARA, A., 78,166, 202, 466 YOUNG, P., vi-ix, 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 W-TING, S., 195, 466

ZIMAND, M., ix, 290, 389,374, 455, 466,168 ZVONKIN, A., 334,377,380, 466

487