University of London

Imperial College of Science, Technology and Medicine Department of Computing

PCF extended with real numbers: a domain-theoretic approach to

higher-order exact real number computation

Martín Hötzel Escardó

Dr. Michael B. Smyth

Supervisor

Prof. Achim Jung

External Examiner

Prof. Edmund Robinson

Internal Examiner

A thesis submitted for the degree of Doctor of Philosophy of the University of London

and for the Diploma of the Imperial College

Submitted November 1996 Defended February 1997

Declaration

The results of Sections 5.2 and 5.3 of Part II consist of joint work with Thomas Streicher [ES97]. The results of Part V consist of joint work with Abbas Edalat [EE96a]. All other results reported in this thesis are due to the author, except for background results, which are clearly stated as such. Some of them have already appeared as [Esc96a, Esc96b], and preliminary ideas have appeared in the extended abstract [Esc94].

Note This version of the thesis, produced on Monday 1 \underline{st} December 1997, is the same I submitted after the defence, except that I have added the references [ES, EE, Esc, EEK].

À Daniele

iii

Abstract

We develop a theory of higher-order exact real number computation based on Scott domain theory. Our main object of investigation is a higher-order functional programming language, Real PCF, which is an extension of PCF with a data type for real numbers and constants for primitive real functions. Real PCF has both operational and denotational semantics, related by a computational adequacy property.

In the standard interpretation of Real PCF, types are interpreted as continuous Scott domains. We refer to the domains in the universe of discourse of Real PCF induced by the standard interpretation of types as the real numbers type hierarchy. Sequences are functions defined on natural numbers, and predicates are truth-valued functions. Thus, in the real numbers types hierarchy we have real numbers, functions between real numbers, predicates defined on real numbers, sequences of real numbers, sequences of sequences of real numbers, sequences of functions, functionals mapping sequences to numbers (such as limiting operators), functionals mapping functions to numbers (such as integration and supremum operators), functionals mapping predicates to truth-values (such as existential and universal quantification operators), and so on.

As it is well-known, the notion of computability on a domain depends on the choice of an effective presentation. We say that an effective presentation of the real numbers type hierarchy is sound if all Real PCF definable elements and functions are computable with respect to it. The idea is that Real PCF has an effective operational semantics, and therefore the definable elements and functions should be regarded as concretely computable. We then show that there is a unique sound effective presentation of the real numbers type hierarchy, up to equivalence with respect to the induced notion of computability. We can thus say that there is an absolute notion of computability for the real numbers type hierarchy.

All computable elements and all computable first-order functions in the real numbers type hierarchy are Real PCF definable. However, as it is the case for PCF, some higher-order computable functions, including an existential quantifier, fail to be definable. If a constant for the existential quantifier (or, equivalently, a computable supremum operator) is added, the computational adequacy property remains true, and Real PCF becomes a computationally complete programming language, in the sense that all computable functions of all orders become definable.

We introduce induction principles and recursion schemes for the real numbers domain, which are formally similar to the so-called Peano axioms for natural numbers. These principles and schemes abstractly characterize the real numbers domain up to isomorphism, in the same way as the so-called Peano axioms for natural numbers characterize the natural numbers. On the practical side, they allow us to derive recursive definitions of real functions, which immediately give rise to correct Real PCF programs (by an application of computational adequacy). Also, these principles form the core of the proof of absoluteness of the standard effective presentation of the real numbers type hierarchy, and of the proof of computational completeness of Real PCF.

Finally, results on integration in Real PCF consisting of joint work with Abbas Edalat are included.

Acknowledgements

Before coming to Imperial, Rocha Costa introduced me to domain theory, Dalcidio Claudio introduced me to interval analysis, and Benedito Acióly introduced me to the connections between the two. In a group organized by Rocha Costa, including Álvaro Moreira, Vanderlei Rodrigues and myself, we studied the book [Pau87]. All this forms a vast part of the background material needed to develop this work. I also had many discussions with Paulo Azeredo and Daltro Nunes. I am grateful to all of them. Rocha Costa deserves especial credit, for having organized the very fruitful theory group at the Instituto de Informática da Universidade Federal do Rio Grande do Sul, of which I had the opportunity of being a member.

I acknowledge Benedito Acióly and Wilson de Oliveira (a former student of Mike Smyth, who I met personally only a few months ago) for having suggested that I should apply for a position as a research student at Imperial. Juarez Muylaert, who was at Imperial at that time, helped me to make contact with Mike, via e-mail.

I benefited from many discussions about real number computability with Klaus Weihrauch, most of them by e-mail, which started when I was in Brazil, before coming to Imperial. I also had some interesting discussions with his student Vasco Brattka.

The sponsorship by the Brazilian agency CNPq made this work possible. An ARC project “A Computational Approach to Measure and Integration Theory”, organized by Abbas Edalat, Achim Jung and Klaus Keimel, allowed me to visit the Technische Hochschule Darsmtadt on three occasions, which were very productive times. Achim Jung gave me valuable feedback during the first visit, as did Frank Pfenning (who was also visiting Darmstadt), Martin Hofmann, Klaus Keimel and Thomas Streicher during the second visit. In particular, I established the computational completeness result for Real PCF after I spoke with Thomas about my partial success (first-order case) and he subsequently explained his technique [Str94] to me. Also, the collaboration with him, partially reported in Section 5.2, started during that visit. Dana Scott gave me detailed feedback, in the form of questions, criticism and directions, in three workshops (two of them sponsored by the ARC project) and one conference.

The fixed-point definition of the integration operator given in Section 14.2 is based on a suggestion by Peter Freyd.

Michael Huth carefully read the paper [Esc96a] (after it was accepted for publication). He spotted some mistakes and imprecisions, which are corrected in this thesis. He also indicated how to improve some points.

I had interesting discussions with Pietro di Gianantonio, during a workshop in Hagen and during a visit by himself to Imperial.

During these three years at Imperial, I have had many discussions with Samson Abramsky, David Clark, Roy Crole, Abbas Edalat, Lindsay Errington, Ian Hodkinson, François Lamarche, Guy McCusker, Juarez Muylaert, Peter Potts, Paul Taylor, Mike Smyth, Chis Townsend, Steve Vickers, and Julian Webster.

Samson played the rôle of “second supervisor” during my transfer from MPhil to PhD, when he gave me valuable feedback. We also had many interesting discussions during a recent conference, in particular while we spent a whole day waiting to come back to the UK.

Abbas deserves especial credit. He has closely followed my work since its early stages, and we have had uncountably many discussions about it. As a result, an intense collaboration arose. A portion of it is reported in Part V of this thesis, which is the full version of the extended abstract [EE96a]. Also, Abbas has introduced me to many people, including some of the above.

Last but not least, I would like to acknowledge Mike Smyth, my supervisor. I have had weekly meetings with him and his students, and sometimes with guests, during which I benefited from his vast knowledge and original ideas. He has always managed to relate my ideas to his and other people’s work, in unexpected ways. On the rare occasions when he didn’t feel confident about a particular point, he sent me to speak to the appropriate people, including some of the above. This has resulted in fruitful informal extra supervision.

Both Abbas and Mike have carefully proof-read this thesis. Of course, all remaining mistakes are due to myself.

Most commutative diagrams in this thesis were produced with Paul’s commutative diagrams package. Lindsay and Peter have kept the machines running. They also helped me to recover the file containing the paper [Esc96b], which I managed to delete just before submitting it.

Contents

Abstract iv

1 Introduction 1 1.1 Main results and underlying ideas . . . . . . . . . . . . . . . . . . 3 1.2 Additional contributions . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4 Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

I Background 8

2 Domain theory 10 2.1 Directed complete posets and the Scott topology . . . . . . . . . 10 2.2 Pointed dcpos and least fixed-points . . . . . . . . . . . . . . . . 11 2.3 Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.4 Lattice-like domains . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.5 Retracts and universal domains . . . . . . . . . . . . . . . . . . . 14 2.6 Function spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.7 Ideals and round ideals . . . . . . . . . . . . . . . . . . . . . . . . 16 2.8 Injective spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.9 Bifree algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Effectively given domains 20 3.1 Recursion theory preliminaries . . . . . . . . . . . . . . . . . . . 20 3.2 Effectively given domains . . . . . . . . . . . . . . . . . . . . . . 21 3.3 Effectively given algebraic domains . . . . . . . . . . . . . . . . . 22 3.4 Effectively given coherently complete domains . . . . . . . . . . . 24

4 The programming language PCF 30 4.1 The languages L_{DA}, L_{PA} and L_{PA+∃} . . . . . . . . . . . . . . . . 30 4.2 Denotational semantics . . . . . . . . . . . . . . . . . . . . . . . . 31 4.3 Operational semantics . . . . . . . . . . . . . . . . . . . . . . . . 33

II Domain theory revisited 36

5 Bifree algebras generalized 38 5.1 Inductive retractions . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.2 Structural recursion . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.3 Biquotients of bifree algebras . . . . . . . . . . . . . . . . . . . . 43

6 Equivalence of effectively given domains 46 6.1 A non-standard effective presentation of B^{ω} . . . . . . . . . . . . 46 6.2 Equivalence of effectively given domains . . . . . . . . . . . . . . 48 6.3 Characterizations of some effective presentations . . . . . . . . . 50

7 Coherently complete domains 52 7.1 Joining maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 7.2 Canonical joining maps . . . . . . . . . . . . . . . . . . . . . . . 54 7.3 Universality of B^{ω} via internal joins . . . . . . . . . . . . . . . . 56 7.4 Function spaces of J-domains . . . . . . . . . . . . . . . . . . . . 57

III The partial real line 60

8 Partial real numbers 62 8.1 The interval domain . . . . . . . . . . . . . . . . . . . . . . . . . 62 8.2 The partial real line . . . . . . . . . . . . . . . . . . . . . . . . . 64 8.3 Canonical extensions of real valued maps of real variables …. 64 8.4 Partial real valued functions . . . . . . . . . . . . . . . . . . . . . 65 8.5 Discontinuous functions in real analysis versus continuous func-

tions in domain theory . . . . . . . . . . . . . . . . . . . . . . . . 68 8.6 Order of magnitude on the partial real line . . . . . . . . . . . . 69 8.7 The partial real line as a J-domain . . . . . . . . . . . . . . . . . 70 8.8 A parallel effect in the partial real line . . . . . . . . . . . . . . . 70

Appendix 72 8.9 The unit triangle and the half-plane . . . . . . . . . . . . . . . . 72 8.10 A construction of the partial real line by Dedekind cuts . . . . . 73 8.11 A construction of the partial real line by round ideals . . . . . . 74 8.12 An algebraic version of the partial real line . . . . . . . . . . . . 75 8.13 The partial real line as a quasi-metric space . . . . . . . . . . . . 75

9 Partial real numbers considered as continuous words 80 9.1 Discrete words . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.2 The prefix preorder of a monoid . . . . . . . . . . . . . . . . . . . 81 9.3 Left translations of a monoid . . . . . . . . . . . . . . . . . . . . 82 9.4 Concatenation of partial real numbers . . . . . . . . . . . . . . . 83 9.5 Infinitely iterated concatenations . . . . . . . . . . . . . . . . . . 85 9.6 Partial real numbers considered as continuous words . . . . . . . 87 9.7 Heads and tails of continuous words . . . . . . . . . . . . . . . . 88 9.8 Computation rules for continuous words . . . . . . . . . . . . . . 91

9.9 The partial unit interval acting on the partial real line . . . . . . 92

10 Induction and recursion on the partial real line 94 10.1 Peano-like axioms for the partial unit interval . . . . . . . . . . . 94 10.2 Structural recursion on the partial unit interval . . . . . . . . . . 105 10.3 Bifurcated binary expansions . . . . . . . . . . . . . . . . . . . . 108 10.4 Coinduction on the partial unit interval . . . . . . . . . . . . . . 115 10.5 Structural recursion on the partial real line . . . . . . . . . . . . 116 10.6 Examples of recursive definitions . . . . . . . . . . . . . . . . . . 116

IV Computation on the partial real line 122

11 The programming language Real PCF 124 11.1 The programming language PCF^{I} . . . . . . . . . . . . . . . . . 124 11.2 The programming language Real PCF . . . . . . . . . . . . . . . 129

12 Computational completeness of Real PCF 131 12.1 The unique sound effective presentation of the partial real line . 131 12.2 Computational completeness via universal domains . . . . . . . . 133 12.3 Computational completeness of Real PCF . . . . . . . . . . . . . 134 12.4 Computational completeness via joining maps . . . . . . . . . . . 136 12.5 Computational completeness of PCF revisited . . . . . . . . . . . 139 12.6 Computational completeness of Real PCF revisited . . . . . . . . 140

V Integration on the partial real line 142

13 Interval Riemann integrals 144 13.1 Simple interval Riemann Integrals . . . . . . . . . . . . . . . . . 144 13.2 Multiple interval Riemann integrals . . . . . . . . . . . . . . . . . 151 13.3 A supremum operator . . . . . . . . . . . . . . . . . . . . . . . . 153

14 Integration in Real PCF 155 14.1 Real PCF extended with interval Riemann integration . . . . . . 155 14.2 A fixed-point definition of integration . . . . . . . . . . . . . . . 160 14.3 Real PCF extended with supremum . . . . . . . . . . . . . . . . 161 14.4 Computational completeness of Real PCF extended with su-

premum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

VI Concluding remarks 165

15 Summary of results 166 15.1 Continuous words, Real PCF, and computational adequacy … 166 15.2 Induction and recursion on the partial real line . . . . . . . . . . 166 15.3 Computability on the real numbers type hierarchy . . . . . . . . 167 15.4 Computational completeness of Real PCF . . . . . . . . . . . . . 168 15.5 Partial real valued functions . . . . . . . . . . . . . . . . . . . . . 168 15.6 Interval Riemann integration . . . . . . . . . . . . . . . . . . . . 169 15.7 Integration in Real PCF . . . . . . . . . . . . . . . . . . . . . . . 169 15.8 New results on domain theory . . . . . . . . . . . . . . . . . . . . 169

16 Open problems and further work 171 16.1 Equivalence of effectively given domains . . . . . . . . . . . . . . 171 16.2 Real number computability . . . . . . . . . . . . . . . . . . . . . 171 16.3 Injective spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.4 Way-below order . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.5 Full abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.6 Sequentiality on the real numbers type hierarchy . . . . . . . . . 172 16.7 Joining maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.8 Continued fractions and Möbius transformations . . . . . . . . . 173

Bibliography 174

Index 183

Chapter 1

Introduction

We develop a theory of higher-order exact real number computation based on Scott domain theory [AJ94]. Our main object of investigation is a higherorder functional programming language, Real PCF, which is an extension of PCF [Plo77] with a data type for real numbers and constants for primitive real functions.

Traditionally, in computing science one represents real numbers by floatingpoint approximations. If we assume that these approximations are “exact” then we can prove correctness of numerical programs by analytical methods. Such an idealization is the idea behind the so-called BSS model [BSS89]. However, such “correct” programs do not produce correct results in practice, due to the presence of round-off errors. Striking examples are described in [MM96]. Moreover, such programs are inappropriate for problems whose solution is sensitive to small variations on the input.

As a consequence, exact real number computation has been advocated as an alternative solution (see e.g [Boe87, BC90, BCRO86, Gru, MM96, Pot96, Viu90, Vui88] on the practical side and [Bra96, Gia93b, Gia96b, Gia96a, Gia93a, Grz57, KV65, Ko91, ML70, Myh53, PeR83, Ric54, Tur37, Wei87, Wei95, Wie80] on the foundational side). In exact real number computation, as opposed to floating point-computation, the produced outputs are guaranteed to be correct, and, moreover, the results can be effectively computed to within any desired degree of accuracy. These approaches, as well as ours, differ from the BSS model in that they consider only effective computations in the sense of logic and recursion theory [Kle52, Rog67, Tur37], whereas the BSS model admits non-effective operations such as equality tests on real numbers. The BSS model is best conceived as a useful idealization of floating-point computation, as we have indicated above, and as Blum, Shub and Smale indicate in their seminal paper [BSS89].

However, work on exact real number computation has focused on representations of real numbers and has neglected the issue of data types for real numbers. Two exceptions are [BC90] and [Gia93a]. In particular, programming languages for exact real number computation with an explicit distinction between operational semantics [Gun92], which is representation-dependent, and denotational semantics [Gun92], which is representation-independent, have hardly been investigated. An exception is [Gia93a]. Such programming languages allow for correctness proofs based on analytical methods, in a representation-independent fashion, as discussed below.

The real numbers type of Real PCF is interpreted as the interval domain introduced by D.S. Scott [Sco72b], which is related to the interval space introduced by R.E. Moore [Moo66]. The elements of the interval domain are considered as “generalized real numbers” or “partial real numbers”. Such an extension of PCF was one of the problems left open by G.D. Plotkin in his seminal paper [Plo77]. Pietro di Gianantonio [Gia93a] also presents an extension of PCF with a ground type interpreted as a domain of real numbers, with the purpose of obtaining an abstract data type for real numbers. His extension is based on an algebraic domain of real numbers. In this thesis we push his ideas further; in particular, in addition to work with a continuous domain of real numbers which faithfully represents the real line, we give an operational semantics to our extension of PCF with real numbers.

There have been a number of applications of domain theory in constructing computational models for classical spaces, including locally compact Hausdorff spaces [Eda95e] and metric spaces [EH96]. These models have resulted in new techniques in computation with real numbers. In particular the computational measure and integration theory [Eda95e, Eda95b, Eda96b, EN96] has had various applications, including exact computation of integrals, in fractals [Eda96a], statistical physics [Eda95a], stochastic processes [Eda95d] and neural networks [Eda95c, Pot95].

An important feature of our approach to exact real number computation is that the programmer does not have access to representations within the programming language and can think of real numbers as abstract entities in the usual mathematical sense. Of course, the Real PCF machinery has access only to concrete representations. The correct interaction between the abstract level and the concrete level is usually referred to as computational adequacy. At the denotational level, a Real PCF program is just a mathematical expression denoting a number or a function. The task of the programmer is to find a mathematical expression in this language denoting the entity that he or she has in mind. This entity is usually given by unrestricted mathematical means. In this case the programmer has to find an equivalent Real PCF expression. Computational adequacy ensures that the entity denoted by the program will be actually computed by the Real PCF machinery. This is why the programmer is not concerned with representations in correctness proofs. Of course, in order to obtain efficient programs, the programmer has to reason about representations. The point is that efficiency considerations and correctness proofs can be tackled separately.

We introduce induction principles and recursion schemes for the real numbers domain, which are formally similar to the so-called Peano axioms for natural numbers [Sto66]. These principles and schemes allow us to prove correctness of programs and derive correct programs respectively.

In addition to computational adequacy, a main result is computational completeness, which roughly means that Real PCF has enough primitive operations to express all computable functions. This result is proved by means of the above induction principles and recursion schemes.

1.1 Main results and underlying ideas

We now proceed to a slightly more detailed and technical exposition of our main results and underlying ideas.

Computational Adequacy The operational semantics of Real PCF implements computations on real numbers via computations on rational intervals. We show that the operational semantics is computationally adequate with respect to the denotational semantics, in the sense that every piece of information about the value assigned by the denotational semantics to a program is eventually produced in a finite number of steps by the operational semantics. The intuitive idea of “piece of information” is formalized via the use of continuous domains [AJ94, Sco72a], and the the proof of computational adequacy relies on the basic machinery of continuous domains, including the so-called “way-below relation” and “ϵ−δ characterization of continuity”. The domain of partial numbers is a (non-algebraic) continuous domain. Its subspace of maximal points (single-point intervals) is homeomorphic to the Euclidean real line, so that real numbers are special cases of partial real numbers. Notice that no algebraic domain can have the real line as its subspace of maximal points.

Continuous words We show that partial real numbers can be considered as “continuous words”, and we use this fact to obtain the operational semantics of Real PCF. Partial real numbers can be considered as continuous words in the sense that they can be given the structure of a monoid, in such a way that it has a finitely generated submonoid isomorphic to the monoid of words over any finite alphabet. Moreover, as it is the case for words, the prefix preorder of the monoid of continuous words coincides with its information order. This coincidence is the basis for the successful interaction between the operational and denotational semantics of Real PCF.

Concatenation of continuous words has intuitive geometrical and computational interpretations. Geometrically, a concatenation of continuous words corresponds to a rescaling of an interval followed by a translation (an affine transformation). Computationally, a concatenation of continuous words corresponds to refinement of partial information; in a concatenation xy, the partial real number y refines the information given by x, by selecting a subinterval of x.

The notion of length of words generalizes to partial real numbers. The length of a partial real number is an extended non-negative real number, being infinity iff the partial number is maximal, and zero iff the partial number is bottom. Roughly speaking, the length of a partial number x considered as a partial realization of an unknown real number y gives the number of digits of a digit expansion of y that x is able to give correctly. The concatenation operation “adds lengths”, in the sense that the length function is a monoid homomorphism from the monoid of partial real numbers to the additive monoid of non-negative extended real numbers.

The usual basic operations cons, head and tail used to explicitly or recursively define functions on words generalize to partial real numbers. Geometrically, the operation cons is an affine transformation (in analytic terms, a linear map) on the unit interval, tail reverses the effect of cons, and head decides in which half of the real line its argument lies, telling us nothing in ambiguous cases.

Concatenation of partial numbers can be infinitely iterated. This fact gives a notion of meaningful infinite computation. The concatenation of finite initial segments of infinite computations gives more and more information about the final result, in such a way that every piece of information about the (ideal) result is eventually produced in a finite amount of steps. In practice, the terms of a computation can be taken as the partial numbers with distinct rational end-points.

The interpretation of partial real numbers as continuous words is related to a well-known approach to real number computation. Usual binary expansions are not appropriate representations for real number computation; for instance, multiplication by three is not computable if we read the expansions from left to right [Wie80]. But binary expansions of numbers in the signed unit interval [−1, 1] allowing a digit −1 turn out to be effective [BCRO86, Gia93a, Gru, Wei87, Wei95, Wie80]. In the domain of partial numbers contained in the signed unit interval, infinite concatenations of the partial numbers [−1, 0], [−\frac{1}{2}, \frac{1}{2}] and [0, 1] correspond to binary expansions of numbers in the signed unit interval using the digits −1, 0 and 1 respectively.

To be accurate, the interpretation of partial numbers as continuous words holds only for the domain of partial real numbers contained in the unit interval (or any other compact interval). The domain of partial numbers contained in the unit interval is referred to as the partial unit interval, and the domain of all partial real numbers is referred to as the partial real line. The above results are extended from the partial unit interval to the partial real line via an action of the partial unit interval on the partial real line.

Higher-order real number computation In the standard interpretation of Real PCF, types are interpreted as bounded complete continuous domains [AJ94], which form a cartesian closed category [LS86] suitable for higher-order real number computation. We refer to the domains in the universe of discourse of Real PCF induced by the standard interpretation of types as the real numbers type hierarchy. Sequences are functions defined on natural numbers, and predicates are truth-valued functions. Thus, in the real numbers types hierarchy we have real numbers, functions between real numbers, predicates defined on real numbers, sequences of real numbers, sequences of sequences of real numbers, sequences of functions, functionals mapping sequences to numbers (such as limiting operators), functionals mapping functions to numbers (such as integration and supremum operators), functionals mapping predicates to truth-values (such as existential and universal quantification operators), and so on.

Higher-order exact real number computability As it is well-known, the notion of computability on a domain depends on the choice of an effective presentation [KP79]. We say that an effective presentation of the real numbers type hierarchy is sound if all Real PCF definable elements and functions are computable with respect to it. The idea is that Real PCF has an effective operational semantics, and therefore the definable elements and functions should be regarded as concretely computable. An important result is that there is a unique sound effective presentation of the real numbers type hierarchy, up to equivalence with respect to the induced notion of computability. We can thus say that there is an absolute notion of computability for the real numbers type hierarchy.

Computational completeness of Real PCF We show that all computable elements and all computable first-order functions in the real numbers type hierarchy are Real PCF definable. However, as it is the case for PCF, some higher-order computable functions, including an existential quantifier, fail to be definable. If a constant for the existential quantifier (or, equivalently, a computable supremum operator) is added, the computational adequacy property remains true, and Real PCF becomes a computationally complete programming language, in the sense that all computable functions of all orders become definable [Esc96b], as it is also the case for PCF. Informally, this means that Real PCF has enough primitive operations.

Recursive real functions So far, except for the recent work by Brattka [Bra96], there has been no attempt to characterize computability on the real line via recursiveness. The computational completeness result for Real PCF immediately gives rise to an inductively defined collection of higher-order functions on real numbers (namely the Real PCF definable ones) which contains exactly the computable ones. Thus, we can reason about computability in a representationindependent way, by reducing computability questions to recursiveness questions.

Induction and recursion on the real line We introduce induction principles and recursion schemes for the real line, based on the theory of domain equations [AJ94, Plo80, SP82] and previous work on the uniform real line [Esc94]. These principles abstractly characterize the partial real line up to isomorphism in the category of bounded complete domains, in the same way as the so-called Peano axioms for natural numbers characterize the natural numbers up to isomorphism in the category of sets. On the practical side, they allow us to derive recursive definitions of real functions, which immediately give rise to correct Real PCF programs (by an application of computational adequacy). Also, these principles form the core of the proof of absoluteness of the standard effective presentation of the real numbers type hierarchy, and of the proof of computational completeness of Real PCF.

Integration in Real PCF We report results on integration in Real PCF consisting of joint work with Abbas Edalat [EE96a]. We begin by generalizing Riemann integration of real valued functions of real variables to partial real valued functions of partial real variables. We then show that several basic properties of standard Riemann integration generalize to interval Riemann integration. In particular, we prove a generalization of the so-called Fubini’s rule, which reduces multiple integrals to iterated simple integrals. We then consider two approaches to integration in Real PCF. First, we show how to introduce integration as a primitive operation, with a simple operational semantics which is proved to be computationally adequate. Second, we introduce the supremum operator mentioned above as a primitive operation, again with a simple operational semantics which is proved to be computationally adequate, and then we show that the integration operator can be recursively defined in Real PCF extended with the supremum operator.

1.2 Additional contributions

In order to either justify some of the decisions taken in the course of our investigation or else obtain our results on real number computation, we were led to obtain some subsidiary results in domain theory, which are interesting in their own right. These results are reported in Part II, and are about, or directly related to

• domain equations [AJ94, Plo80, Sco72a, SP82],

• effectively given domains [EC76, Plo80, Smy77], and

• coherently complete domains [Plo78].

1.3 Background

The prerequisites for this work are basic topology [Bou66, Kel55, Smy92b, Vic89], basic recursion theory [Phi92, Rog67], very basic category theory [Cro93, ML71, McL92, Poi92], domain theory [AJ94, GHK^{+}80, Plo80], effective domain theory [EC76, Plo80, Smy77], and operational and denotational semantics of PCF [Gun92, Plo77]. Since domain theory, effective domain theory, and PCF are heavily used in this thesis, we include background chapters on these subjects. Some notions of the other subjects are recalled when they are needed.

1.4 Organization

This thesis is organized in five parts,

I Background

II Domain theory revisited

III The partial real line IV Computation on the partial real line

V Integration on the partial real line,

in addition to a part containing concluding remarks. Each part contains a description of its contents and organization, and so does each of its chapters.

The reader who is mainly interested in real number computation can safely skip Part II at a first reading, as we clearly indicate when some chapter in Part II is needed to proceed further.

An automatically generated index of definitions is included; it contains the emphasized defined terms and some mathematical symbols.

Part I Background

8

This part can be used as a reference. In Chapter 2 we introduce domain theory. In Chapter 3 we introduce effective domain theory. In Chapter 4 we introduce the programming language PCF.

Domain theory

We regard domain theory as a branch of topology which is conveniently presented via order theoretic concepts, as it is done in the seminal papers [Sco72a, Sco76] by Dana Scott. This chapter, which can be used as a reference, introduces basic concepts, terminology, and results.

Our main references to domain theory are [AJ94, Plo80]. Additional references to the topological aspects of domain theory are [GHK^{+}80, Smy92b, Vic89].

2.1 Directed complete posets and the Scott topology

A preordered set is a set together with a reflexive and transitive binary relation ⊑. Preordered sets naturally arise in topology as follows. For any space X, the binary relation ⊑ defined by

x ⊑ y iff every neighbourhood of x is a neighbourhood of y
iff x belongs to the closure of {y},

is a preorder on the points of X, called the specialization order of X. It is clear from the definition that any continuous map between topological spaces preserves the specialization order. If X is Hausdorff, then this preorder is trivial because it is the identity relation (also called the discrete order). A main feature of domain theory is that it considers spaces with a rich specialization order.

Convention 2.1 Unless otherwise stated, every mention of order in a topological space implicitly refers to its specialization order. □

A poset (partially ordered set) is a preordered set (P, ⊑) with ⊑ antisymmetric. Recalling that a space is T_{0} if no two distinct points share the same system of neighbourhoods, antisymmetry of the specialization order is equivalent to the T_{0} axiom.

Let P be a poset, x ∈ P, and X ⊆ P. Then we write

1. ↑ ↑x = {v ∈ P |x ⊑ v}, 2. ↓ ↓x = {u ∈ P |u ⊑ x},

3. ↑ ↑X = ⋃_{x∈X} ↑ ↑x,

4. ↓ ↓X = ⋃_{x∈X} ↓ ↓x.

Convention 2.2 We use the words below and above in partial ordered sets to refer to order in the non-strict sense. For example, if x ⊑ y we say that x is below y and that y is above x. If we want to imply that x and y are distinct, we say strictly below and strictly above. □

A subset A of a poset P is directed if every finite subset of A has an upper bound in A. Since the empty set is included in this definition, a directed set is non-empty. A dcpo (directed complete poset) is a poset with least upper bounds of directed subsets. The order relation of a dcpo is called its information order.

Convention 2.3 We write ⨆ A to denote the least upper bound of a subset A which has a least upper bound, and we write ^{⨆↑} A to denote the least upper bound of a set A which is assumed to be directed. □

A function between dcpos is order-continuous if it preserves least upper bounds of directed subsets. Such a function is necessarily monotone.

The Scott topology of a dcpo D has as open sets the sets O such that

1. O is an upper set, and

2. if O contains the least upper bound of a directed subset A of D then O already contains a member of A.

It follows that a set is closed in the Scott topology iff it is a lower set containing the least upper bounds of its directed subsets. The main feature of this topology is that order-continuity coincides with topological continuity. Moreover, if D is a dcpo endowed with its Scott topology, then its specialization order coincides with its information order.

Convention 2.4 Unless otherwise stated, when we implicitly or explicitly refer to a dcpo D as a topological space, we mean the set of elements of D endowed with the Scott topology of D. □

2.2 Pointed dcpos and least fixed-points

A dcpo is pointed if it contains a least element ⊥, called bottom. A function between pointed dcpos is strict if it preserves ⊥.

Every dcpo D can be made into a pointed dcpo by the addition of a new least element ⊥. The resulting dcpo is denoted by D_{⊥} and is called the lifting of D. This construction makes sense even if D is already pointed.

A fixed-point of an endofunction f : X → X is an element x such that f(x) = x. Every continuous endomap f : D → D on a pointed dcpo D has a least fixed-point, given by ^{⨆↑}_{n∈ω} f^{n}(⊥). Least fixed points are interesting mainly in connection with function spaces, which are discussed below.

2.3 Domains

The way-below order of a dcpo D is the binary relation ≪ on D defined by

x ≪ y in D iff for every directed set A ⊆ D, y ⊑ ^{⨆↑} A implies x ⊑ a
for some a ∈ A.

A continuous map f : D → E preserves the way-below relation iff its a semiopen map, in the sense that ↑ ↑f(O) ⊆ E is Scott open for every Scott open set O ⊆ D. The following properties are easily verified (for example, for the first one, it suffices to consider A = {y}), and some of them are entailed by the others:

1. x ≪ y implies x ⊑ y,

2. if ⊥ is a least element then ⊥ ≪ x,

3. u ⊑ x ≪ y ⊑ v implies u ≪ v,

4. x ≪ y ≪ z implies x ≪ z,

5. if u ≪ x, v ≪ x and u ⊔ v exists then u ⊔ v ≪ v.

There is no reason why any pair (x, y) (except if x is a minimal element) should be related by the way-below relation for general dcpos (an example in which only such pairs are related by the way-below order is given by two complete chains with top elements identified). A dcpo is continuous if its way-below relation is frequent, in the sense that it satisfies the following axiom of approximation:

x =\begin{matrix}⨆ & ↑ \\ y≪x \end{matrix} y.

That is, the set of elements way-below x is directed and has x as its least upper bound. The axiom of approximation implies that

If x ⋢ y then there is some u ≪ x such that already u ⋢ y.

We write

1. ↑ ↑x = {v ∈ P |x ≪ v},

2. ↓ ↓x = {u ∈ P |u ≪ x},

3. ↑ ↑X = ⋃_{x∈X} ↑ ↑x,

4. ↓ ↓X = ⋃_{x∈X} ↓ ↓x.

With this notation, the axiom of approximation reads

x = ^{⨆↑} ↓ ↓x.

In a continuous dcpo, the way-below relation satisfies the following interpolation property:

If x ≪ y then there is some u such that x ≪ u ≪ y.

This implies that

x ≪ y iff for every directed set A, we have that x ≪ a for some a ∈ A whenever y ⊑ ^{⨆↑} A.

A domain is a continuous dcpo. A basis of a domain D is a subset B such that

x = ^{⨆↑} ↓ ↓x ∩ B.

That is, x is the directed join of the members of B which are way-below x. By definition, a domain is a basis of itself. A domain is countably based if it has a countable basis (the terminology ω-continuous is also used).

For any basis B of a domain D, the sets ↑ ↑b for b ∈ B form a base of the Scott topology. Thus, if D and E are domains with bases B and C, then a function f : D → E is continuous at x iff

c ≪ f(x) for c ∈ C iff there is some b ≪ x in B such that c ≪ f(b).

This is often referred to as the ϵ − δ characterization of continuity. Also, f is continuous at x iff

f(x) =\begin{matrix}⨆ & ↑ \\ b≪x \end{matrix} f(b).

An element x is finite (or compact, or isolated from below) if it is waybelow itself. This means that x is below some member of each directed set with least upper abound above x. Any basis of a continuous dcpo contains the set of compact elements (which can be empty). A dcpo is algebraic if the compact elements form a basis. The basis of finite elements of an algebraic domain D is denoted by K_{D}.

2.4 Lattice-like domains

A continuous lattice is a continuous dcpo which is also a complete lattice (has all joins and meets, including those of the empty set).

A subset of a poset is bounded (or consistent) if is has an upper bound. A poset is bounded complete (or consistently complete) if every bounded subset has a least upper bound. Since this definition includes the empty set, which is bounded iff the poset is non-empty, a bounded complete poset is pointed if it is non-empty. A bounded complete domain is a continuous dcpo which is also bounded complete. Every continuous lattice is a bounded complete domain, but not conversely. However, if a bounded complete domain fails to be a continuous lattice, it fails only by lacking a top element. Moreover, the bounded complete domains are the closed subspaces of continuous lattices. Notice that for this to be true we have to admit the empty bounded complete domain – as we did. We refer to bounded complete, countably based domains as continuous Scott domains.

A subbasis of a bounded complete domain D is a subset S such that the joins of finite consistent subsets of S form a basis, called the basis induced by S.

A poset is coherently complete if every pairwise consistent subset has a least upper bound. Plotkin [Plo78] says that a poset is coherent in this case. We follow the terminology of [Str94], because coherence is used to denote many different notions in computing science and mathematics. Every coherently complete poset is bounded complete, but not conversely. A coherently complete domain is a continuous dcpo which is also coherently complete.

For any poset P we write

1. x↑ ↑y in P iff {x, y} is bounded,

2. x # y iff not x↑ ↑y.

In these cases we respectively say that x and y are consistent and that x and y lie apart. This terminology is taken from [Plo77, Plo78]. Monotone functions preserve the consistency relation and reflect the apartness relation. A bounded complete domain is coherently complete iff whenever an element is apart from the least upper bound of a bounded set, it is already apart from some member of the set.

2.5 Retracts and universal domains

A section-retraction pair between objects X and Y of a category X consists of morphisms

X ⇆_{s}^{r} Y with r ∘ s = id_{X}.

In this case s ∘ r is an idempotent on Y and X is called a retract of Y.

The categories of domains, continuous lattices, bounded complete domains, and coherently complete domains are closed under the formation of retracts in the ambient category of dcpos and continuous maps.

An object of a category is universal if it has every object of the category as a retract. This (well-established) terminology is obviously misleading, as the term “universal” is already used in another sense in category theory.

Let 𝔹= {tt, ff} be the discretely ordered set of truth values, B= 𝔹_{⊥} be the flat domain of truth values. Then B^{ω} is a universal domain in the category of countably based coherently complete domains and strict continuous maps (and hence is also universal in the larger category with all continuous maps) [Plo78]. (But notice that it is not known whether every coherently complete domain is the retract of some power of B; Plotkin [Plo78] conjectures that the answer is negative.)

2.6 Function spaces

We assume that the reader is familiar with the concept of cartesian closed category [ML71, McL92, Poi92]. Roughly, a cartesian closed category is a category with finite products and well-behaved function spaces, called exponentials.

The category of dcpos and continuous maps is cartesian closed. The empty product is the one-point dcpo, and binary products are obtained by forming the set-theoretical product and endowing it with the componentwise order defined by

(x, y) ⊑ (u, v) iff x ⊑ u and y ⊑ v.

Exponentials are given by the set of all continuous maps endowed with the pointwise order defined by

f ⊑ g iff f(x) ⊑ g(x) for all x.

The exponential D ⇒ E of two dcpos is endowed with the application map app : (D ⇒ E) × D → E defined by

app(f, x) = f(x),

which is continuous. Moreover, in this case, for any dcpo C there is a bijection between continuous maps C × D → E and continuous maps C → (D ⇒ E) which sends a map f : C ×D → E to the map curry(f) : C → (D ⇒ E) defined by

curry(f)(x)(y) = f(x, y),

also called the transpose of f. In the other direction, the bijection sends a map g : C → (D ⇒ E) to the map uncurry(g) : C × D → E defined by

uncurry(g)(x, y) = g(x)(y).

For any pointed dcpo E, the function fix : (E ⇒ E) → E which sends a function f ∈ (E ⇒ E) to its least fixed-point ^{⨆↑}_{n} f^{n}(⊥) ∈ E is continuous, and it is called the least fixed-point combinator. In applications, it is often the case that E is a function space C ⇒ D, and the least fixed-point operator is used to solve functional equations of the form f = F (f) for F : (C ⇒ D) → (C ⇒ D) continuous. Such a functional equation is often called a recursive definition of f, and it is implicitly assumed that it defines f to be the least fixed-point of F.

The category of domains and continuous maps fails to be cartesian closed, because exponentials fail to exist in general. However, the full subcategories of continuous lattices, bounded complete domains, and coherently complete domains are cartesian closed, and, moreover, products and function spaces are calculated as in the category of dcpos and continuous maps. There are other interesting examples of cartesian closed categories of domains [Jun90, JS96a, JS96b], but they are outside the scope of this work.

If D and E are bounded complete domains with (countable) bases A and B respectively, then a (countable) subbasis of D ⇒ E is the set of single-step functions A ⇒_{s} B = {a ⤇ b|a ∈ A, b ∈ B}, where

(a ⤇ b)(x) = \begin{cases}b & if a ≪ x, \\ ⊥ & otherwise. \end{cases}

The induced (countable) basis is denoted by A ⇒ B, and its members (finite joins of consistent single-step functions) are referred to as step functions.

2.7 Ideals and round ideals

Let P be a poset. An ideal in P is a directed lower set in P. The set of all ideals of P ordered by inclusion is an algebraic domain, referred to as the ideal completion of P. Every algebraic domain is isomorphic to the ideal completion of its basis of finite elements. The isomorphism is given by the map which sends an element x to the ideal of finite elements below x.

Every continuous domain is a retract of an algebraic domain. In fact, if B is a basis of a domain D, then D is a retract of the ideal completion of B. The section sends an element x ∈ D to the ideal ↓ ↓x ∩ B, and the retraction sends an ideal I ⊆ B to its least upper bound ^{⨆↑} I ∈ D.

Smyth [Smy77] introduced round ideals in the context of R-structures (also called abstract bases in [AJ94]) as a generalization of Dedekind cuts, with the purpose of constructing continuous domains as certain completions of their bases, discussed below.

An abstract basis is a transitively ordered set (B, ≺) such that for all finite M ⊆ B,

M ≺ x implies M ≺ y ≺ x for some y ∈ B.

Here M ≺ x is a short-hand for m ≺ x for each m ∈ M. Lower sets and directed sets for transitively ordered sets are defined in the same way as for partially ordered sets. A round ideal of an abstract basis (B, ≺) is a directed set A with A = ↓ ↓A, or, equivalently, such that

1. for all x ≺ y in B, if y ∈ A then x ∈ A, and

2. for every x ∈ A there is some y ∈ A with x ≺ y.

The round completion of an abstract basis consists of the set of round ideals ordered by inclusion. The round completion of any abstract basis is a domain; moreover, the image of the embedding b ↦ ↓ ↓b of B into the completion is a basis of the completion. Conversely, for any basis B of a domain D, the restriction of the way-below order of D to B gives rise to an abstract basis, with round completion isomorphic to D.

2.8 Injective spaces

In typical applications of domain theory, one starts by embedding given spaces into appropriate domains (see e.g. [Sco76, Plo78, Eda95e, Eda95b, Eda96a, Eda96b, EE96a, Esc96a, EH96]). Thus, given spaces X and Y embedded into domains D and E respectively, it is natural to ask whether the continuous maps D → E capture the continuous maps X → Y, in the sense that every continuous map f : X → Y extends to a continuous map h : D → E. Since every continuous map f : X → Y trivially coextends to a continuous map g : X → E, it suffices to consider extensions of continuous maps g : X → E to continuous maps h : D → E. This brings us to the subject of injective spaces.

Let X be a category and J be a class of monomorphisms of X closed under composition with isomorphisms. An object E ∈ X is injective with respect to J if every morphism g : X → E extends to a morphism h : D → E, for any subobject inclusion j : X → D in J:

X ^{_{⊂}  j} D
[figure: g; .......; h]
E

Here we consider the category of T_{0} spaces.

When the class J consists of all subspace inclusions, we simply speak of injective spaces, as in [Sco72a], and we have that:

The injective spaces are the continuous lattices.

Moreover, extensions can be found in a canonical way. If X is a subspace of a space Y, and E is any injective space, then every continuous map g : X → E has a greatest continuous extension ĝ : D → E, with respect to the pointwise order induced by the specialization order of E, given by

ĝ(d) =\begin{matrix}⨆ & ↑ \\ d∈V ∈ΩD \end{matrix} ⨅_{x∈V ∩X} g(x).

Here ΩD is the lattice of open sets of D.

In several applications, the spaces embedded into domains are Hausdorff (e.g. the discrete space of natural numbers, the ω-power of the discrete space {0, 1} of bits) and the embeddings are onto the subspace of maximal points of bounded complete domains (e.g., the flat domain of natural numbers, the domain of finite and infinite sequences of bits ordered by prefix). In our applications, we consider the embedding of the Euclidean real line onto the subspace of maximal points of the interval domain discussed in Chapter 8.

The closure of any subset of a domain contains its lower set. By Zorn’s Lemma, every point of a domain is below some maximal point. Hence the closure of the subspace of maximal points is the whole domain. Therefore the set of maximal points of a domain is dense.

A space is densely injective if it is injective with respect to the class of dense subspace inclusions. Since there are fewer dense subspace inclusions than subspace inclusions, there are more densely injective spaces than injective spaces, and we have that:

The densely injective spaces are the bounded complete domains.

Notice that for this to be true we have to admit the empty bounded complete domain (cf. Section 2.4). Again, extensions can be found in a canonical way. If X is a dense subspace of a space Y, and E is any domain, then every continuous map g : X → E has a greatest continuous extension ĝ : Y → E, given by the same rule as for injective spaces. The fact that X is dense is equivalent to the fact that the set X ∩ V is non-empty for every non-empty open subset V of Y. Therefore the meet cannot be the missing top element, which shows that the rule gives rise to a well-defined map.

The examples of embeddings given above are, in fact, embeddings into coherently complete domains. A subspace X of a space Y is called isochordal in [Plo78] if for any pair of disjoint open sets U and V in X there is a pair of disjoint open sets U′ and V′ in Y such that U′ ∩ X = U and V′ ∩ X = V. For example, every dense subspace is isochordal. A space is isochordally injective if it is injective with respect to the class of isochordal subspace inclusions. There is no known domain-theoretic characterization of the isochordally injective spaces. However, there is a domain-theoretic characterization of the isochordalily injective second countable spaces:

In the category of second countable T_{0} spaces, the isochordally injective spaces are the countably based, coherently complete domains.

2.9 Bifree algebras

Let X be a category and F : X → X be a functor. Recall that an F-algebra is a morphism α : FX → X, and that an F-algebra homomorphism from an algebra α : FX → X to an algebra β : FY → Y is a morphism h : X → Y such that h ∘ α = β ∘ Fh:

FX ⟶^{α} X
Fh↓  ↓_{h}
FY ⟶_{β} Y

Dually, an F-coalgebra is a morphism α : X → FX, and an F-coalgebra homomorphism from a coalgebra α : X → FX to a coalgebra β : X → FX is a morphism h : X → Y such that Fh ∘ α = β ∘ h:

X ⟶^{α} FX
h↓  ↓_{Fh}
Y ⟶_{β} FY

Algebras (resp. coalgebras) compose and form a category.

If α : FX → X is an initial algebra then α is an isomorphism. Freyd [Fre90, Fre91, Fre92] attributes this fact to Lambek.

Definition 2.5 A bifree algebra is an initial algebra α : FX → X whose inverse is a final coalgebra (Freyd speaks of free algebras in this case). □

Sometimes a bifree algebra α : FX → X is referred to as the canonical solution to the domain equation

X ≅ FX.

In this work we consider bifree algebras in the category SDom of bounded complete domains and strict continuous maps. A functor F : SDom → SDom is locally continuous if for all D and E, the map

f ↦ Ff : (D ⇒ E) → (FD ⇒ FE)

is continuous. A basic result of Smyth and Plotkin [SP82] is that

Every locally continuous functor F : SDom → SDom has a bifree algebra.

This result is stated and proved in a much more general form which does not concern us in this work. Also, it is not relevant for the purposes of this work how the canonical solution is constructed, because we can deduce the results that we are interested in from the formal properties of bifree algebras. The interested reader can find the construction of the bifree algebra as a bilimit in [AJ94, Plo80, SP82].

Effectively given domains

This chapter introduces effectively given domains. The material of Section 3.3 on effectively given algebraic domains is standard [EC76, Plo80]. However, the material on effectively given coherently complete domains is slightly nonstandard, but it is based on well-known ideas by Plotkin [Plo78] and Smyth [Smy77].

3.1 Recursion theory preliminaries

Recall that a pairing function is a recursive bijection (m, n) ↦ ⟨m, n⟩ : ℕ^{2} → ℕ. For any pairing function there are unique recursive maps π_{1}, π_{2} : ℕ → ℕ such that l ↦ (π_{1}(l), π_{2}(l)) is its inverse. See Rogers [Rog67] for a construction of a pairing function. In this section we consider an unspecified pairing function denoted as above, with projections also denoted as above.

Definition 3.1 Let A ⊆ ℕ be a set of the form {n_{1}, n_{2}, …, n_{k}} with n_{1} < n_{2} < ⋯ < n_{k}. Then the natural number ∑_{i=1}^{k} 2^{n_{i}} is called the canonical index of A. Notice that if A is empty then the canonical index of A is 0. The finite set with canonical index n is denoted by Δ_{n}. □

The idea is to use binary expansions. The condition n_{1} < n_{2} < ⋯ < n_{k} is not actually needed; it is enough that n_{i} ≠ n_{j} for i ≠ j. Rogers writes D_{n} instead of Δ_{n}, but this is in conflict with the usual notation for domains. The particular form of the indexing of finite sets given in Definition 3.1 is not important. The only relevant properties are:

1. The map n ↦ Δ_{n} is a bijection between natural numbers and finite sets of natural numbers.

2. There are recursive functions δ and ρ such that if Δ_{n} is non-empty then

(a) δ(n) ∈ Δ_{n},

(b) Δ_{ρ(n)} = Δ_{n} − {δ(n)}.

Definition 3.2 Let A and B be sets endowed with enumerations {a_{n}}_{n∈ℕ} and {b_{n}}_{n∈ℕ} of its elements respectively.

1. A subset X of A is recursive (respectively r.e.) if the set X̂ = {n ∈ ℕ|a_{n} ∈ X} is recursive (respectively r.e.).

2. A function f : A → B is recursive if there is a recursive function f̂ : ℕ → ℕ such that f(a_{n}) = b_{f̂(n)}.

3. A relation R ⊆ A × B is recursive (respectively r.e.) if the relation R̂ ⊆ ℕ × ℕ defined by mR̂n iff a_{m}Rb_{n} is recursive (respectively r.e.). This definition generalizes to n-ary relations on n enumerated sets in the obvious way.

4. A set C of finite subsets of A is recursive (respectively r.e.) if the set {n | {b_{k}|k ∈ Δ_{n}} ∈ C} is recursive (respectively r.e.).

5. A relation R ⊆ A × P_{fin}B is recursive (respectively r.e.) if the relation R̂ ⊆ ℕ × ℕ defined by mR̂n iff a_{m}R{b_{k}|k ∈ Δ_{n}} is recursive (respectively r.e.). □

3.2 Effectively given domains

This subsection contains preliminary definitions and motivations for the definitions of algebraic and continuous effectively given domains given in the following sections.

Definition 3.3 Let D and E be domains together with enumerated bases A and B respectively.

1. An element x ∈ D is computable if the set A_{x} =^{def} ↓ ↓x ∩ A is recursively enumerable.

2. A continuous function f : D → E is computable if the relation

Graph(f) =^{def} {(a, b) ∈ A × B|b ≪ f(a)}

is recursively enumerable. □

These definitions of computability are appropriate only if certain properties of the enumerations are assumed. First, computable functions should form a category under ordinary function composition; that is, the identity function should be computable, and the composition of two composable computable functions should be computable. For instance, the identity is computable iff the waybelow order restricted to basis elements is recursively enumerable. Moreover, if f : D → E is computable and x ∈ D is computable, f(x) should be computable. Also, it would be reasonable to have that x ∈ D is computable iff there is some r.e. directed subset of A with lub x, and this cannot be proved without further assumptions on the enumeration of A.

Second, a category of computable functions appropriate for higher-order computability has to be cartesian closed. We restrict our attention to the category of bounded complete domains as it is done in [EC76, Plo80, Smy77].

Convention 3.4 In this chapter, the term domain designates a bounded complete countably based domain. □

To say that a cartesian category of computable maps is closed amounts to saying that the evaluation map is computable and that a function defined on a cartesian product is computable iff its transpose is computable. Given domains D and E endowed with enumerated bases (A, {a_{n}}_{n∈ℕ}) and (B, {b_{n}}_{n∈ℕ}) respectively, it is natural to construct an enumerated basis (A ⇒ B, {(a ⇒ b)_{n}}_{n∈ℕ}) of the function space D ⇒ E as follows:

1. A ⇒ B is the basis induced by the subbasis consisting of single-step functions a ⤇ b for a ∈ A and b ∈ B (cf. 2.6).

2. (a ⇒ b)_{n} = \begin{cases}⨆ M & if M =^{def} \{a_{l} ⤇ b_{m}| ⟨l, m⟩ ∈ Δ_{n}\} is consistent, \\ ⊥ & otherwise. \end{cases}

It would be reasonable to have that a continuous map f : D → E is computable as a function iff it is computable as an element of the function space D ⇒ E. Since consistency is not decidable for arbitrary enumerations [Smy77], this is not true in general. In particular, it follows that the category of domains with enumerated bases and computable functions is not cartesian closed.

3.3 Effectively given algebraic domains

This section is based on [EC76, Plo80]. We only present the (parts of the) proofs which are necessary for this work.

Definition 3.5 An effectively given algebraic domain is an algebraic domain D together with an enumeration {b_{n}}_{n∈ℕ} of K_{D} such that the following relations are recursive:

1. x↑ ↑y,

2. x = y ⊔ z,

for x, y, and z ranging over K_{D} (cf. Definition 3.2).

The notions of computability of elements and functions are given by Definition 3.3. □

Lemma 3.6 (D, {b_{n}}_{n∈ℕ}) is an effectively given algebraic domain iff the following are recursive:

1. the set of finite consistent subsets of K_{D},

2. the relation x ⊑ ⨆ Y for x ∈ K_{D} and Y ⊆_{fin} K_{D}.

Lemma 3.7 In order to effectively present an algebraic domain D it suffices to give an enumeration {s_{n}}_{n∈ℕ} of a subbasis S of D contained in K_{D}, such that the following are recursive:

1. the set of finite consistent subsets of S,

2. the relation x ⊑ ⨆ X for x ∈ S and X ⊆_{fin} S. Proof Take

b_{n} = \begin{cases}⨆ M & if M =^{def} \{s_{k}|k ∈ Δ_{n}\} is consistent, \\ ⊥ & otherwise.  □ \end{cases}

Proposition 3.8 An element x of an effectively given algebraic domain (D, {b_{n}}_{n∈ℕ}) is computable iff there is a primitive recursive function k ↦ n_{k} such that the set {b_{n_{k}}}_{k∈ℕ} is consistent and has lub x.

We say that a set M is way-consistent it is has an upper bound in the way-below order.

Lemma 3.9 Let D and E be bounded complete algebraic domains, and {a_{i}}_{i∈I} and {b_{i}}_{i∈I} be finite families of elements of D and E respectively. Then the following statements are equivalent:

1. {a_{i} ⤇ b_{i}}_{i∈I} is a consistent subset of D ⇒ E.

2. For every J ⊆ I, if {a_{j}}_{j∈J} is way-consistent then {b_{j}}_{j∈J} is consistent.

As a corollary, we have that

Lemma 3.10 Let D and E be bounded complete domains respectively, {a_{i}}_{i∈I} and {b_{i}}_{i∈I} be finite families of compact elements of D and E respectively, and assume that the set {a_{i} ⤇ b_{i}}_{i∈I} is consistent. Then the following statements hold:

1. ⨆_{i∈I}{a_{i} ⤇ b_{i}} ⊑ f iff b_{i} ⊑ f(x) for all i ∈ I and all compact x ∈ ↑ ↑a_{i}.

2. ⨆_{i∈I}{a_{i} ⤇ b_{i}} # f iff b_{i} # f(x) for some i ∈ I and some compact x ∈ ↑ ↑a_{i}.

Recall that, under the conditions of the above lemma, ⨆{a_{i} ⤇ b_{i}}_{i∈I} is a compact element of D ⇒ E.

Proposition 3.11 A map f between effectively given algebraic domains D and E is computable as a function D → E iff it is computable as an element of the function space D ⇒ E. An element x ∈ D is computable iff the global element x : 1 → D is a computable function.

Proposition 3.12 The category of effectively given algebraic domains and computable functions is cartesian closed.

In particular, the evaluation map is computable, and thus if f : D → E and x ∈ D are computable so is f(x). Proof Let (D, {a_{n}}_{n∈ℕ}) and (E, {b_{n}}_{n∈ℕ}) be effectively given algebraic domains. We only consider function spaces. Define an enumeration of the subbasis of D ⇒ E consisting of finite single-step functions by s_{⟨m,n⟩} = (a_{m} ⇒ b_{n}). Then the conditions of Lemma 3.7 apply, as Lemmas 3.9 and 3.6 show. If the induced enumeration of the the step functions of D ⇒ E is denoted by {(a ⇒ b)_{n}}_{n∈ℕ} then (D ⇒ E, {(a ⇒ b)_{n}}_{n∈ℕ}) is an effectively given algebraic domain. □

Lemma 3.13 For any effectively given algebraic domain D, the least fixedpoint combinator of type (D ⇒ D) → D is computable.

3.4 Effectively given coherently complete domains

As we have seen, ω-algebraic bounded complete domains have a relatively simple theory of effectivity. Unfortunately, this is not the case for ω-continuous bounded complete domains.

Smyth [Smy77] defines three notions of effectivity for ω-continuous bounded complete domains, namely effectively given domain, effectively given M-domain, and effectively given A-domain. The notions are equivalent, in the sense that they can be effectively translated to each other. Moreover, it can be shown that they give rise to equivalent categories of effective maps.

The notion of effectively given A-domain gives rise to a simple notion of effectively given coherently complete domain, as it is shown below. We slightly modify Smyth’s definition in order to make effective presentations explicit, as Kanda and Park [KP79] showed that it is possible to effectively present some domains in essentially different ways (as it is made clear in Chapter 6):

Definition 3.14 An effectively given A-domain is a computable retract of an effectively given algebraic domain. More precisely, it is a list D = (D, E, s, r) where D is a domain, E is an effectively given algebraic domain, (s : D → E, r : E → D) is a section-retraction pair, and the idempotent s ∘ r : E → E is computable. The list (E, s, r) is referred to as the effective presentation of D. □

The idea is to reduce effectivity in the continuous case to effectivity in the algebraic case, using the fact that every continuous domain is a retract of an algebraic domain.

Since B^{ω} is a universal coherently complete domain with a simple theory of effectivity [Plo78], it is natural to specialize the above definition to the case when E = B^{ω}, obtaining a simple definition of effectively given coherently complete domain.

An element p ∈ B^{ω} is finite iff p^{−1}(tt) and p^{−1}(ff) are finite subsets of ω. Plotkin [Plo78] considers the following effective presentation of B^{ω}:

b_{n} = p, where p is the unique finite element such that

n = ∑_{i∈p^{−1}(tt)} 2 · 3^{i} + ∑_{i∈p^{−1}(ff)} 3^{i}.

The idea is to use ternary expansions. It turns out that

p ∈ B^{ω} is computable iff p^{−1}(tt) and p^{−1}(ff) are r.e. subsets of ω,

and that

A function g : B^{ω} → B^{ω} is computable iff the relation

b ⊑ g(a)

is r.e. for finite a, b ∈ B^{ω}.

Definition 3.15 We call this effective presentation the standard effective presentation of B^{ω}, and from now on we implicitly assume the standard effective presentation of B^{ω}, unless otherwise stated. □

This induces effective presentations on the product B^{ω} × B^{ω} and the function space B^{ω} ⇒ B^{ω} as we have discussed above.

The following definition is certainly not original, but it is non-standard. Therefore we are forced to prove some results about it.

Definition 3.16

1. An effective presentation of a coherently complete domain D is a section-retraction pair

(s : D → B^{ω}, r : B^{ω} → D)

such that the induced idempotent s ∘ r : B^{ω} → B^{ω} is computable.

2. An effectively given coherently complete domain is a list (D, s, r) where D is a coherently complete domain and (s, r) is an effective presentation of D.

3. Let (D, s_{D}, r_{D}) and (E, s_{E}, r_{E}) be effectively given coherent domains.

(a) An element x ∈ D is computable if s_{D}(x) ∈ B^{ω} is computable. This is equivalent to say that there is some computable p ∈ B^{ω} such that x = r_{D}(p).

(b) A continuous function f : D → E is computable if the function (r_{D} ⇒ s_{E})(f) : B^{ω} → B^{ω} is computable:

B^{ω} ⟶^{(r_{D}⇒s_{E})(f)} B^{ω}
r_{D}↓  ↑^{s_{E}}
D ⟶_{f} E

This is equivalent to either of the following conditions:

• There is a computable g : B^{ω} → B^{ω} with f = (s_{D} ⇒ r_{E})(g).

• There is a computable g : B^{ω} → B^{ω} such that the following

diagram commutes:

B^{ω} ⟶^{g} B^{ω}
r_{D}↓  ↓^{r_{E}}
D ⟶_{f} E
□

Proposition 3.17 Any effectively given coherently complete domain (D, s, r) has a basis of computable elements. In particular, any finite element of D is computable. Proof It is given by r (K_{B^{ω}}). □

We already know that coherently complete domains form a cartesian closed category. The domains B^{ω}×B^{ω} and B^{ω} ⇒ B^{ω} are retracts of B^{ω}, simply because B^{ω} is universal. In fact, B^{ω} × B^{ω} is isomorphic to B^{ω}. An isomorphism is given by Pair : B^{ω} → B^{ω} × B^{ω} defined by

Pair^{−1}(p, q)(2n) = p(n)
Pair^{−1}(p, q)(2n + 1) = q(n).

Then (B^{ω} ×B^{ω}, Pair^{−1}, Pair) is an effectively given coherently complete domain. We assume the section-retraction pair

(Pred : (B^{ω} ⇒ B^{ω}) → B^{ω}, Fun : B^{ω} → (B^{ω} ⇒ B^{ω}))

constructed in [Plo78]. But notice that the details of the construction are unimportant; the relevant fact is that there are such computable maps. Since Pred and Fun are computable, so is Pred ∘ Fun : B^{ω} → B^{ω}. Therefore (B^{ω} ⇒ B^{ω}, Pred, Fun) is an effectively given coherently complete domain.

Theorem 3.18 Effectively given coherently complete domains and computable functions form a cartesian closed category. Proof Let C, D, E be effectively given coherently complete domains. The identity of D is computable, because s_{D} ∘ id_{D} ∘ r_{D} = s_{D} ∘ r_{D} is computable by definition. Let f : C → D and g : D → E be computable. Then

s_{E} ∘ g ∘ f ∘ r_{C} = s_{E} ∘ g ∘ (r_{D} ∘ s_{D}) ∘ f ∘ r_{C} = (s_{E} ∘ g ∘ r_{D}) ∘ (s_{D} ∘ f ∘ r_{C}).

Hence s_{E} ∘g∘f ∘r_{C} is computable, because by definition s_{E} ∘g∘r_{D} and s_{D}∘f ∘r_{C} are computable functions B^{ω} → B^{ω}, and the composition of two computable functions B^{ω} → B^{ω} is computable. Thus g∘f : C → E is computable. Therefore effectively given coherently complete domains and computable maps form a category.

Clearly, a terminal domain can be effectively presented, and the unique map from any effectively given coherently complete domain to it is clearly computable. An effective presentation of D × E is given by

(Pair^{−1} ∘ (s_{D} × s_{E}), (r_{D} × r_{E}) ∘ Pair),

The projections are easily shown to be computable, and also f : C → D and g : C → E are computable iff ⟨f, g⟩ : C → D × E is computable. Hence the category has finite products.

An effective presentation of D ⇒ E is given by

(Pred ∘ (r_{D} ⇒ s_{E}), (s_{D} ⇒ r_{E}) ∘ Fun).

The evaluation map ev : (D ⇒ E)×D → E is easily checked to be computable, and also a computable function f : C × D → E is computable iff its transpose f̄ : C → (D ⇒ E) is computable. Hence the category has exponentials, and therefore it is cartesian closed. □

Definition 3.19 We denote by ECDom the category of effectively given coherently complete domains and computable functions.

Given effective presentations of D and E, we implicitly assume the effective presentations of D × E and D ⇒ E constructed in the above theorem, unless otherwise stated. □

Proposition 3.20 1. A continuous map is computable as a function iff it is a computable element of the corresponding function space.

2. An element is computable iff the induced global element is a computable function.

In particular, if f : D → E and x ∈ D are computable, so is f(x) ∈ E. Proof A function f : D → E is computable iff the element f ∈ D ⇒ E is computable, because s_{E} ∘ f ∘ r_{D} is computable iff (Pred ∘ (r_{D} ⇒ s_{E}))(f) is computable, as

Pred((r_{D} ⇒ s_{E})(f)) = Pred(s_{E} ∘ f ∘ r_{D}),

and Pred(ϕ) is computable iff ϕ = Fun(Pred(ϕ)) is computable. The second assertion is immediate. □

Proposition 3.21 The fixed-point combinator fix_{D} : (D ⇒ D) → D is computable for every effectively given coherently complete domain D = (D, s, r).

In particular, the least fixed-point of a computable function is computable. Proof By Theorem 3.18 we have that

D ⇒ D = (D ⇒ D, s′, r′),

where

s′ = Pred ∘ (r ⇒ s)  and  r′ = (s ⇒ r) ∘ Fun.

Hence, by definition, fix_{D} is computable iff there is a computable g : B^{ω} → B^{ω} with

fix_{D} = (s′ ⇒ r)(g).

Let f : D → D. Then

(s′ ⇒ r)(fix_{B^{ω}} ∘ Fun)(f) = r ∘ (fix_{B^{ω}} ∘ Fun) ∘ s′(f)
= r ∘ (fix_{B^{ω}} ∘ Fun) ∘ (Pred ∘ (r ⇒ s))(f)
= r ∘ fix_{B^{ω}} ∘ (r ⇒ s)(f)
= r ∘ fix_{B^{ω}}(s ∘ f ∘ r)
= r (\begin{matrix}⨆ & ↑ \\ n∈ω \end{matrix}(s ∘ f ∘ r)^{n}(⊥))

= r (\begin{matrix}⨆ & ↑ \\ n∈ω \end{matrix} s ∘ f^{n} ∘ r(⊥))

= r ∘ s (\begin{matrix}⨆ & ↑ \\ n∈ω \end{matrix} f^{n}(r(⊥)))
= \begin{matrix}⨆ & ↑ \\ n∈ω \end{matrix} f^{n}(⊥)
= fix_{D}(f).

Hence we can take g = fix_{B^{ω}} ∘Fun, because fix_{B^{ω}} ∘Fun is computable. Therefore fix_{D} is computable. □

Let D be a bounded complete domain. The sequential conditional

if : B × D × D → D

is defined by

if(p, x, y) = \begin{cases}x & if p = tt, \\ y & if p = ff, \\ ⊥ & otherwise. \end{cases}

Since bounded complete dcpos have binary meets, and since the binary meet operation is continuous in bounded complete domains, we also have the parallel conditional

pif : B × D × D → D

defined by

pif(p, x, y) = \begin{cases}x & if p = tt, \\ y & if p = ff, \\ x ⊓ y & otherwise. \end{cases}

We sometimes write

if p then x else y

and

pif p then x else y

instead of if(p, x, y) and pif(p, x, y) respectively.

Proposition 3.22 For any effectively given coherently complete domain D, the sequential and parallel conditionals if_{D} and pif_{D} are computable maps, regardless of the choice of effective presentation of the domain of truth-values. Proof As above, using the fact that if_{B^{ω}} and pif_{B^{ω}} are computable [Plo78]. □

Definition 3.23 ESDom is the category of effectively given coherently complete domains and strict computable maps. □

We say that a functor F : ESDom → ESDom is locally computable if for all D and E, the map

f ↦ Ff : (D ⇒ E) → (FD ⇒ FE)

is computable, uniformly in the effective presentations of D and E, which means that there is a single computable F : (B^{ω} ⇒ B^{ω}) → (B^{ω} ⇒ B^{ω}). From [Plo78, Plo80, Smy77] we know that functors formed from basic constructions such as product and exponential by composition are locally computable, and that

Every locally computable functor has a computable bifree algebra.

The programming language PCF

We introduce the basic notions of PCF needed in this thesis. See [Gun92] for an excellent textbook account.

This chapter is based on [Plo77], with minor adaptations and simplifications convenient to our needs, and can be safely skipped and used as a reference.

4.1 The languages L_{DA}, L_{PA} and L_{PA+∃}

Given a collection of symbols called ground types, the set of types is the least set containing the ground types and containing the formal expression (σ → τ) whenever it contains the expressions σ and τ. The greek letters σ and τ range over types. We let (σ_{1}, …, σ_{n}, τ) stand for (σ_{1} → (σ_{2} → ⋯ (σ_{n} → τ) ⋯)).

Given a collection L of formal constants, each having a fixed type, and a family of formal variables {α_{i}^{σ}} (i ≥ 0) for each type σ, the L-terms are given by the following inductive rules:

1. Every variable α_{i}^{σ} is an L-term of type σ.

2. Every constant of type σ is an L-term of type σ.

3. If M and N are L-terms of types (σ → τ) and σ respectively then (MN) is an L-term of type τ.

4. If M is an L-term of type τ then (λα_{i}^{σ}M) is an L-term of type σ → τ.

When L is understood from the context it need not be used as a prefix. The letters L, M, and N range over terms. The letter c range over constants. We denote the fact that a term M has type σ by M : σ. Notice that every term has a unique type. Terms of the form (MN) are called combinations. Terms of the form (λαM) are called abstractions. Parentheses around combinations and abstractions are sometimes omitted with the convention that juxtaposition associates to the left. We also omit parentheses in type expressions with the convention that → associates to the right.

The set of free variables of a term M is FV(M), inductively defined by 1. FV(α_{i}^{σ}) = {α_{i}^{σ}}

2. FV(c) = ∅

3. FV(MN) = FV(M) ∪ FV(N)

4. FV(λα_{i}^{σ}M) = FV(M) − {α_{i}^{σ}}

A term M is closed if FV(M) = ∅ and open otherwise. Programs are closed terms of ground type. The idea is that the ground types are the data types and programs produce data, via the operational semantics. The remaining terms are significant as subprograms. Sometimes we will informally refer to any PCF term as a program.

[N/α]M is the result of replacing all free occurrences of the variable α in M by N, making the appropriate changes in the bound variables of M so that no free variables of N become bound.

The ground types for the language L_{DA} are N and T, and its constants are

tt : T ff : T

if_{σ} : (T, σ, σ, σ) for σ ground

Y_{σ} : (σ → σ) → σ for each σ

k_{n} : N for each natural number n

(+1) : N → N, (−1) : N → N, (= 0) : N → T

The language L_{PA} is the language L_{DA} extended by the constants

pif_{σ} : (T, σ, σ, σ) for σ ground

The language L_{PA+∃} is the language L_{PA} extended with the constant

∃ : (N → T) → T

4.2 Denotational semantics

A collection of domains for PCF is a family {D_{σ}}_{σ} of domains, one for each type σ, such that D_{σ→τ} = D_{σ} ⇒ D_{τ}. It is standard if D_{T} is B (the flat domain of truth values), and D_{N} is N (the flat domain of natural numbers).

An interpretation of a language L is a collection {D_{σ}}_{σ} of domains for PCF together with a mapping

c ↦ A⟦c⟧ : L → ⋃_{σ}{D_{σ}}

which is type-respecting, in the sense that if c : σ then A⟦c⟧ ∈ D_{σ}.

An interpretation is standard if it interprets the constants tt, ff, if_{σ}, Y_{σ}, k_{n}, (+1), (−1), (= 0), pif_{σ} and ∃ respectively as tt, ff, the sequential conditional, the fixed point operator, the natural number n, the successor function, the predecessor function, the test for zero, the parallel conditional and the continuous existential quantifier ∃ : (N ⇒ B) → B defined by

∃(p) = \begin{cases}tt & if p(n) = tt for some n ∈ N, \\ ff & if p(⊥) = ff, \\ ⊥ & otherwise. \end{cases}

Notice that p(⊥) = ff iff p(n) = ff for all n ∈ N, by monotonicity of p. An interpretation ⟨{D_{σ}}_{σ}, A⟩ induces a denotational semantics Â for L. First, the set Env of environments is the set of type-respecting functions

from the set of variables to ⋃_{σ}{D_{σ}}. It is ranged over by ρ. If α : σ and x ∈ D_{σ} then ρ[x/α] is the environment which maps α to x and any other variable α′ to ρ(α′). The undefined environment ⊥ maps each variable of type σ to the bottom element of the domain D_{σ}.

The denotational semantics

M ↦ (ρ ↦ Â⟦M⟧(ρ)) : Terms → (Env → ⋃_{σ}{D_{σ}})

is inductively defined by:

1. Â⟦α⟧(ρ) = ρ(α)

2. Â⟦c⟧(ρ) = A⟦c⟧

3. Â⟦MN⟧(ρ) = Â⟦M⟧(ρ) (Â⟦N⟧(ρ))

4. Â⟦λαM⟧(ρ)(x) = Â⟦M⟧(ρ[x/α]) (with x ∈ D_{σ} if α : σ)

Informally,

1. A variable denotes what the environment assigns to it.

2. A constant denotes what the interpretation assigns to it.

3. If a term M denotes the function f : D → E and a term N denotes the value x ∈ D then the combination MN denotes the value f(x) ∈ E.

4. If a term M denotes the value y_{x} ∈ E in an environment which assigns the value x ∈ D to the variable α, then the abstraction λαM denotes the function f : D → E defined by f(x) = y_{x}.

If M is closed then its denotation does not depend on the environment, in the sense that Â⟦M⟧(ρ) = Â⟦M⟧(ρ′) for all ρ and ρ′.

In order to simplify notation, we let ⟦M⟧ stand for the denotation Â⟦M⟧(⊥) of a closed term M with respect to an implicit semantics Â. Also, for any term M, we let ⟦M⟧(ρ) stand for Â⟦M⟧(ρ).

4.3 Operational semantics

The operational semantics of L_{DA} is given by an immediate reduction relation, defined by the following rules:

1. (λαM)N → [N/α]M

2. YM → M(YM)

3. (+1)k_{n} → k_{n+1}, (−1)k_{n+1} → k_{n}

4. (= 0)k_{0} → tt, (= 0)k_{n+1} → ff

5. if ttMN → M, if ffMN → N

6. \frac{M → M′}{MN → M′N}, \frac{N → N′}{MN → MN′} if M is if, (+1), (−1) or (= 0)

We omit the reduction rules of the languages L_{PA} and L_{PA+∃}. The reduction relation preserves types, in the sense that if M → M′ and M has type σ, so does M′.

Evaluation is given by a partial function Eval from programs to constants, defined by

Eval(M) = c iff M →^{∗} c

It is well-defined because if M →^{∗} c and M →^{∗} c′ then c = c′.

The following theorem is often referred to as the adequacy property of PCF. It asserts that the operational and denotational semantics coincide.

Theorem 4.1 (Plotkin [Plo77], Theorem 3.1) For any L_{DA} program M and constant c,

Eval(M) = c iff ⟦M⟧ = ⟦c⟧.

Proof Lemma 4.6 below. □ The following definitions are introduced to formulate and prove Lemma 4.6.

Definition 4.2 The predicates Comp_{σ} are defined by induction on types by:

1. If M : σ is a program then M has property Comp_{σ} iff ⟦M⟧ = ⟦c⟧ implies Eval(M) = c.

2. If M : σ → τ is a closed term it has property Comp_{σ→τ} iff whenever N : σ is a closed term with property Comp_{σ} then MN is a term with property Comp_{τ}.

3. If M : σ is an open term with free variables α_{1} : σ_{1}, …, α_{n} : σ_{n} then it has property Comp_{σ} iff [N_{1}/α_{1}] ⋯ [N_{2}/α_{n}]M has property Comp_{σ} whenever N_{1}, …, N_{n} are closed terms having properties Comp_{σ_{1}}, …, Comp_{σ_{n}} respectively.

A term of type σ is computable if it has property Comp_{σ}. □

If M : σ → τ and N : σ are closed computable terms, so is MN and also a term M : (σ_{1}, …, σ_{n}, τ) is computable iff M̃N_{1} … N_{n} is computable whenever the terms N_{1} : σ_{1}, …, N_{n} : σ_{n} are closed computable terms and M̃ is a closed instantiation of M by computable terms.

In the following definition, α has to be chosen as some variable of appropriate type in each instance.

Definition 4.3 Define terms Ω_{σ} by

Ω_{σ} = Y_{σ}(λαα)

for σ ground and

Ω_{σ→τ} = λαΩ_{τ} ,

and define terms Y_{σ}^{(n)} by induction on n by

Y_{σ}^{(0)} = λα.Ω_{σ},
Y_{σ}^{(n+1)} = λα.α(Y_{σ}^{(n)}α). □

Then ⟦Y_{σ}⟧ = ⨆_{n}⟦Y_{σ}^{n}⟧ for any standard interpretation.

Definition 4.4 The syntactic information order ≼ is the least relation between terms such that

1. Ω_{σ} ≼ M : σ and Y_{σ}^{(n)} ≼ Y_{σ},

2. M ≼ M, and

3. if M ≼ M′ : σ → τ and N ≼ N′ : σ then λαN ≼ λαN′ and also

MN ≼ M′N′. □

Lemma 4.5 (Plotkin [Plo77], Lemma 3.2) If M ≼ N and M → M′ then either M′ ≼ N or else for some N′, N → N′ and M′ ≼ N′. Proof By structural induction on M and cases according to why the immediate reduction M → M′ takes place. □

We include the proof of the following lemma since we are going to extend it to Real PCF:

Lemma 4.6 (Plotkin [Plo77], Lemma 3.3) Every L_{DA}-term is computable. Proof By structural induction on the formation rules of terms:

(1) Every variable is computable since any closed instantiation of it by a computable term is computable.

(2) Every constant other than the Y_{σ}’s is computable. This is clear for constants of ground type. Out of +1, −1, = 0, and if we only consider −1 as an example. It is enough to show (−1)M computable when M is a closed computable term of type N. Suppose ⟦(−1)M⟧ = ⟦c⟧. Then c = k_{m} for some m and so ⟦M⟧ = m + 1. Therefore as M is computable, M →^{∗} k_{m+1} and so (−1)M →^{∗} k_{m} = c.

(3) If M : σ → τ and N : σ are computable, so is the combination MN. If MN is closed so are M and N and its computability follows from clause 2 of the definition of computability. If it is open, any closed instantiation L of it by computable terms has the form M̃Ñ where M̃ and Ñ are closed instantiations of M and N respectively and therefore themselves computable which in turn implies the computability of L and hence of MN.

(4) If M : τ is computable, so is the abstraction λαM. It is enough to show that the ground term LN_{1} ⋯ N_{n} is computable when N_{1}, ⋯, N_{n} are closed computable terms and L is a closed instantiation of λαM by computable terms. Here L must have the form λαM̃ where M̃ is an instantiation of all free variables of M, except α, by closed computable terms. If ⟦LN_{1} ⋯ N_{n}⟧ = ⟦c⟧, then we have ⟦[N_{1}/α]M̃N_{2} ⋯ N_{n}⟧ = ⟦LN_{1} ⋯ N_{n}⟧ = ⟦c⟧. But [N_{1}/α]M̃ is computable and so too therefore is M̃N_{2} ⋯ N_{n}. Therefore LN_{1} ⋯ N_{n} → [N_{1}/α]M̃N_{2} ⋯ N_{n} →^{∗} c, as required.

(5) Each Y_{σ} is computable. It is enough to prove Y_{σ}N_{1} ⋯ N_{k} is computable when N_{1}, ⋯, N_{k} are closed computable terms and Y_{σ}N_{1} ⋯ N_{k} is ground. Suppose ⟦YN_{1} ⋯ N_{k}⟧ = ⟦c⟧. Since ⟦Y_{σ}⟧ = ⨆_{n}⟦Y_{σ}^{n}⟧, ⟦Y^{(n)}N_{1} ⋯ N_{k}⟧ = ⟦c⟧ for some n. Since ⟦Ω_{σ}⟧ = ⊥ for σ ground, Ω_{σ} is computable for σ ground. From this and (1), (3), and (4) proved above it follows that every Ω_{σ} and Y_{σ}^{(n)} is computable. Therefore Y^{(n)}N_{1} ⋯ N_{k} →^{∗} c and so by Lemma 4.5, YN_{1} ⋯ N_{k} →^{∗} c, concluding the proof. □ This lemma extends to the languages L_{PA} and L_{PA+∃}. It suffices to show that pif and ∃ are computable terms, with respect to appropriate reduction rules.

Part II

Domain theory revisited

This part contains new results on domain theory, which are about, or directly related to

• bifree algebras,

• effectively given domains, and

• coherently complete domains.

In Chapter 5 we introduce the concept of inductive retraction as a generalization of the concept of bifree algebra. Inductive retractions are used in Chapter 10 of Part III in order to obtain structural recursion schemes for the partial real line.

In Chapter 6 we introduce some results about equivalence of effectively given domains. These results are used in Chapter 12 of Part IV to establish absoluteness of the notion of computability in the real numbers type hierarchy.

In Chapter 7 we characterize the coherently complete domains as the bounded complete domains having certain “joining maps”. These joining maps are used in Chapter 12 to prove that every computable first-order function in the real numbers type hierarchy is Real PCF definable (without the existential quantifier).

The reader who is mainly interested in real number computation can safely proceed directly to Part III, as we clearly indicate when some chapter or portion of a chapter in the present part is needed to proceed further.

Bifree algebras generalized

In this chapter we introduce a new technique for defining structural recursion schemes based on the theory of domain equations. This technique was first introduced in [Esc96b] by the author and then further developed in collaboration with Thomas Streicher [ES97]. The results obtained in collaboration are contained in Sections 5.2 and 5.3.

Recursion is a paradigmatic notion in theoretical computer science. Domain theory incorporates recursion both at the level of elements (via least fixed-points of continuous maps) and at the level of objects (via canonical solutions of domain equations). Although recursion at the element level can be explained from first principles, recursion at the object level leads to recursion at the element level [Gun92]. Moreover, recursive definitions of domains give rise to structural recursion at the element level [LS81, SP82], via bifree algebras (cf. Definition 2.5 in Section 2.9). For instance, both primitive recursion and general recursion (in the form of minimization) are induced by a recursive definition of the natural numbers [Smy92a].

Thus, we are led to consider recursion in the partial real line, at both levels. This is the subject of Chapter 10 in Part III. There is a fundamental problem, however, about domain equations for the partial real line, namely that the canonical solution of a domain equation involving usual functors is algebraic, but the partial real line is not algebraic.

A relevant observation is that there are two main aspects of a domain equation D ≅ FD. First, its canonical solution is uniquely determined by the functor F. Second, its canonical solution gives rise to recursion schemes via bifree algebras. Our solution to the problem of structural recursion on the partial real line consists in giving up the first aspect and weakening the second aspect, in such a way as to still have structural recursion. In this chapter we develop and investigate such a weakening.

The basic idea is to consider not a distinguished domain D such that D ≅ FD, but instead a domain D such that D is a retract of FD, in a special way to be defined in the technical development that follows this discussion. We refer to such a domain D as an F-inductive retract.

The section and retraction involved in the situation referred above are not a final coalgebra and an initial algebra respectively, because the existence part in the definition of finality and initiality are missing. However, the uniqueness part is present; there is at most one homomorphism from any coalgebra to the section, and there is at most one homomorphism from the retraction to any algebra.

The lack of the existence part is not a severe problem in practice, because it is often the case that in a recursive definition we know the entity which we intend to define. Hence it is enough to be sure that the entity is the only solution to the recursive definition. Therefore the uniqueness part is enough for such purposes.

5.1 Inductive retractions

The material of this section was originally introduced in [Esc96b] with the purpose of establishing both absoluteness of the notion of computability in the real numbers type hierarchy and computational completeness of Real PCF.

Convention 5.1 In the remaining of this chapter, X is any category and F is an endofunctor of X. □

Definition 5.2 An F-inductive retraction is a pair of arrows X ⇆_{β}^{α} FX

such that

f = α ∘ Ff ∘ β iff f = id_{X}. □

The right-to-left implication shows that

α ∘ β = id_{X}

and hence X is a retract of FX. Also, notice that if ⟨α, β⟩ is an F-inductive retraction in X, then ⟨β, α⟩ is an F-inductive retraction in X^{op}.

The following proposition shows that inductive retractions generalize bifree algebras:

Proposition 5.3 Let X ⇆_{β}^{α} FX be an F-inductive isomorphism. If F has a

bifree algebra then it is isomorphic to α. Proof Let i : FC → C be a bifree algebra, r : i → α be the unique algebra homomorphism and s : β → i^{−1} be the unique coalgebra homomorphism. This means that r ∘ i = α ∘ Fr and i^{−1} ∘ s = Fs ∘ β. Hence

r ∘ s = r ∘ i ∘ i^{−1} ∘ s
= α ∘ Fr ∘ Fs ∘ β
= α ∘ F(r ∘ s) ∘ β.

By inductivity, r ∘ s = id_{X}. Since s = i ∘ Fs ∘ β, we have that

s ∘ r ∘ i = i ∘ Fs ∘ β ∘ α ∘ Fr
= i ∘ F(s ∘ r).

Hence s ∘ r : i → i and therefore s ∘ r = id_{C}. □

Convention 5.4 In the remaining of this chapter, i : FC → C is a bifree algebra and X ⇆_{β}^{α} FX is an F-inductive retraction. □

The first part of the proof of Proposition 5.3 shows that every inductive retract is a retract of the bifree algebra, in a canonical way:

Lemma 5.5 If r : i → α and s : β → i^{−1} are the unique (co)algebra homo-

morphisms then X ⇆_{s}^{r} C is a retraction with r ∘ s = id_{X}.

Lemma 5.6 There are unique (co)algebra homomorphisms α → α and β → β. Proof Let f : α → α be an algebra homomorphism. This means that f ∘ α = α ∘ Ff. Hence f = α ∘ Ff ∘ β. By inductivity, f = id_{C}. The second part follows by duality. □

A technical lemma

The following lemma, which may appear to be rather technical, is applied to establish computational completeness of Real PCF in Chapter 12 of Part IV. The idea is to replace a canonical solution of a domain equation by a domain having the canonical solution as a retract.

Lemma 5.7 Let X be a category, let F : X → X be a functor, let

C ⇆_{j}^{i} FC

be a bifree algebra, let

X ⇆_{β}^{α} FX

be an F-inductive section-retraction pair, let

C ⇆_{e}^{p} C′

be a section-retraction pair with p ∘ e = id, and define

C′ ⇆_{j′}^{i′} FC′

by

i′ = e ∘ i ∘ Fp  and  j′ = Fe ∘ j ∘ p

Then any pair of maps

X ⇆_{s′}^{r′} C′

such that

r′ = α ∘ F r′ ∘ j′  and  s′ = i′ ∘ F s′ ∘ β

is a section-retraction pair with r′ ∘ s′ = id.

Proof Let

X ⇆_{s}^{r} C

be the canonical section-retraction pair constructed in Proposition 5.5. Since

r′ ∘ e ∘ i = α ∘ Fr′ ∘ j′ ∘ e ∘ i by the assumption on r′
= α ∘ Fr′ ∘ Fe ∘ j ∘ p ∘ e ∘ i by definition of j′
= α ∘ F(r′ ∘ e) ∘ j ∘ i because p ∘ e = id
= α ∘ F(r′ ∘ e) because j is the inverse of i,

and since this means that r′ ∘ e is an algebra homomorphism from i to α, it follows that r′ ∘ e = r. Similarly,

j ∘ p ∘ s′ = j ∘ p ∘ i′ ∘ Fs′ ∘ β By the assumption on s′
= p ∘ e ∘ i ∘ Fp ∘ Fs′ ∘ β by definition of i′
= j ∘ i ∘ F(p ∘ s′) ∘ β because p ∘ e = id.
= F(p ∘ s′) ∘ β.

Since this means that p∘s′ is a coalgebra homomorphism from β to j, it follows that p ∘ s′ = s. We also have that

j′ ∘ i′ = Fe ∘ j ∘ p ∘ e ∘ i ∘ Fp by definition of i′ and j′
= Fe ∘ j ∘ i ∘ Fp because p ∘ e = id
= Fe ∘ Fp because j is the inverse of i.

It follows that

r′ ∘ s′ = α ∘ Fr′ ∘ j′ ∘ i′ ∘ Fs′ ∘ β by the assumption on r′ and s′
= α ∘ Fr′ ∘ Fe ∘ Fp ∘ Fs′ ∘ Fβ because j′ ∘ i′ = Fe ∘ Fp
= α ∘ Fr ∘ Fs ∘ β because r′ ∘ e = r and p ∘ s′ = s
= α ∘ β because r ∘ s = id
= id by definition. □

5.2 Structural recursion

This section contains results developed in collaboration with Thomas Streicher.

Proposition 5.8 Let r : i → α, s : β → i^{−1}, e = s ∘ r : C → C, h : i → a, and k : b → i^{−1}.

1. For any algebra a : FA → A, there is a homomorphism f : α → a iff h = h ∘ e, and in this case f = h ∘ s.

2. For any coalgebra b : B → FB, there is a homomorphism g : b → β iff k = e ∘ k, and in this case g = r ∘ k.

Proof (1): If f : α → a then f ∘ r = h because r : i → α. Therefore f = h ∘ s and h = h ∘ s ∘ r. Conversely, if f ∘ r : i → a then f : α → a because

f ∘ α = f ∘ α ∘ F(r ∘ s)
= f ∘ α ∘ Fr ∘ Fs
= f ∘ r ∘ i ∘ Fs
= a ∘ F(f ∘ r) ∘ Fs
= a ∘ Ff ∘ F(r ∘ s)
= a ∘ Ff.

If h ∘ s ∘ r = h then this holds in particular for f = h ∘ s. (2): Dual to (1). □ Roughly, condition (1) means that h respects the congruence on C induced by the idempotent e = s ∘ r, and that f is the restriction of h to A via s. Dually, condition (2) means that the image of k is contained in image of e and that g is the corestriction of k to B via r.

Corollary 5.9

1. For any algebra a : FA → A there is at most one homomorphism f : α → a.

2. For any coalgebra b : B → FB there is at most one homomorphism g : b → β.

Only for the last result of this section, we assume that our base category X is the category SDom of domains and strict continuous maps.

Proposition 5.10 Let F : SDom → SDom be locally continuous.

1. If there is a homomorphism f : α → a for a given algebra a : FA → A then it is the least f′ : X → A such that f′ = a ∘ Ff′ ∘ β.

2. If there is a homomorphism g : b → β for a given coalgebra b : B → FB

then it is the least g′ : B → X such that g′ = α ∘ Fg′ ∘ b. Proof (1): The least solution of the above equation is f′ = ⨆_{n} f_{n}, where the sequence f_{n} is inductively defined by

f_{0} = ⊥
f_{n+1} = a ∘ Ff_{n} ∘ β.

Define id_{n} : X → X by

id_{0} = ⊥
id_{n+1} = α ∘ Fid_{n} ∘ β.

By local continuity of F,

⨆_{n} id_{n} = ⨆_{n} id_{n+1}
= ⨆_{n}(α ∘ Fid_{n} ∘ β)

= α ∘ F (⨆_{n} id_{n}) ∘ β.

Hence ⨆_{n} id_{n} = id_{X} by inductivity. Since f is strict, we have that f_{0} = f ∘ id_{0}. Assuming that f_{n} = f ∘ id_{n} we deduce that

f_{n+1} = a ∘ Ff_{n} ∘ β
= a ∘ Ff ∘ Fid_{n} ∘ β
= f ∘ α ∘ Fid_{n} ∘ β
= f ∘ id_{n+1}.

Hence f_{n} = f ∘ id_{n} for every n. Therefore

f′ = ⨆ f_{n}
= ⨆_{n}(f ∘ id_{n})
= f ∘ ⨆_{n} id_{n}
= f ∘ id_{X}
= f.

(2): Dual to (1). □ Thus, in order to to find a recursive definition of a function f : X → A we can try to find an algebra a such that f : α → a is a homomorphism, and in order to find a recursive definition of a function g : B → X we can try to find a coalgebra b such that g : b → β is a homomorphism. If we succeed in finding such algebra a and coalgebra b, then we obtain a definition of f by structural recursion and a definition of g by structural corecursion.

5.3 Biquotients of bifree algebras

This section also contains results developed in collaboration with Thomas Streicher. We have seen that any F-inductive retraction

X ⇆_{β}^{α} FX

appears as a retract of the bifree F-algebra i : FC → C via r : i → α and s : β → i^{−1} with r ∘ s = id_{X}. We now characterize for a bifree algebra i : FC → C the idempotents e : C → C which admit a splitting e = s ∘ r of the kind just described.

Definition 5.11 Let e : C → C be an idempotent and define C ⇆_{b}^{a} FC by

a = e ∘ i  and  b = i^{−1} ∘ e.

We say that e is a biquotient of the bifree algebra i : FC → C if the following conditions hold:

(i) e : i → a (ii) e : b → i^{−1}

(iii) h = a ∘ Fh ∘ b iff h = e. □

Theorem 5.12

1. If X ⇆_{β}^{α} FX is an F-inductive retraction, r : i → α and s : β → i^{−1} then

e =^{def} s ∘ r is a biquotient of i. Moreover, α and β can be recovered from r and s as

α = r ∘ i ∘ Fs β = Fr ∘ i^{−1} ∘ s.

2. If e : C → C is a biquotient of i and e = s ∘ r with r ∘ s = id_{X} then the maps

α =^{def} r ∘ i ∘ Fs : FX → X
β =^{def} Fr ∘ i^{−1} ∘ s : X → FX

constitute an F-inductive retraction. Moreover, we have r : i → α and s : β → i^{−1}.

Proof (1): Conditions (i) and (ii) hold by the following equational reasoning:

e ∘ i ∘ Fe = s ∘ r ∘ i ∘ Fs ∘ Fr
= s ∘ α ∘ Fr ∘ Fs ∘ Fr
= s ∘ α ∘ Fr
= s ∘ r ∘ i
= e ∘ i,
Fe ∘ i^{−1} ∘ e = Fs ∘ Fr ∘ i^{−1} ∘ s ∘ r
= Fs ∘ Fr ∘ Fs ∘ β ∘ r
= Fs ∘ β ∘ r
= i^{−1} ∘ s ∘ r
= i^{−1} ∘ e.

From this we get immediately that

e ∘ i ∘ Fe ∘ i^{−1} ∘ e = e ∘ i ∘ i^{−1} ∘ e = e ∘ e = e.

For the other implication of condition (iii), let h : C → C with e∘i∘Fh∘i^{−1}∘e = h It follows that r ∘ i ∘ Fh ∘ i^{−1} ∘ s = r ∘ h ∘ s and so we get

r ∘ h ∘ s = r ∘ i ∘ Fh ∘ i^{−1} ∘ s
= α ∘ Fr ∘ Fh ∘ Fs ∘ β
= α ∘ F(r ∘ h ∘ s) ∘ β,

which entails r ∘ h ∘ s = id_{X} as α and β form an F-inductive retract. Thus we get

h = e ∘ h ∘ e = s ∘ r ∘ h ∘ s ∘ r = s ∘ r = e.

The proposed reconstruction of α and β from r and s can be seen as follows:

r ∘ i ∘ Fs = α ∘ Fr ∘ Fs = α,
Fr ∘ i^{−1} ∘ s = Fr ∘ Fs ∘ β = β.

(2): We have that

(a) r ∘ i = r ∘ i ∘ F(s ∘ r),
(b) i^{−1} ∘ s = F(s ∘ r) ∘ i^{−1} ∘ s,
(c) s ∘ r ∘ i ∘ Fh ∘ i^{−1} ∘ s ∘ r = h iff h = e,

and hence that

α ∘ β = r ∘ i ∘ Fs ∘ Fr ∘ i^{−1} ∘ s
= r ∘ i ∘ F(s ∘ r) ∘ i^{−1} ∘ s
= r ∘ i ∘ i^{−1} ∘ s
= r ∘ s
= id_{X}.

Let f : X → X with f = α ∘ Ff ∘ β. As

α ∘ Ff ∘ β = r ∘ i ∘ F(s ∘ f ∘ r) ∘ i^{−1} ∘ s,

for h =^{def} s ∘ f ∘ r we get

h = s ∘ r ∘ i ∘ Fh ∘ i^{−1} ∘ s ∘ r = e ∘ i ∘ Fh ∘ i^{−1} ∘ e,

from which we get by (c) that h = e. But then

f = r ∘ s ∘ f ∘ s ∘ r = r ∘ h ∘ s = r ∘ e ∘ s = id_{X}

as desired. It remains to show that r : i → α and s : β → i^{−1}:

α ∘ Fr = r ∘ i ∘ Fs ∘ Fr = r ∘ i by (a),
Fs ∘ β = Fs ∘ Fr ∘ i^{−1} ∘ s = i^{−1} ∘ s by (b). □

Equivalence of effectively given domains

Kanda and Park [KP79] have shown that, in general, it is possible to present an effectively given algebraic domain in essentially different ways. This fact led them to introduce and investigate a notion of equivalence of effectively given algebraic domains. This notion does not generalize to effectively given domains in the sense of Smyth [Smy77], and it is rather involved as it considers directly the enumerations of basis elements.

In this chapter we introduce a more abstract and simpler definition of equivalence, which also works for continuous domains. In some sense, our notion is not new at all, because it is simply an instance of the notion of equivalence of objects of concrete categories [AHS90]. But we claim that the idea of applying this notion to effectively given domains is original.

The results of this chapter are applied in Chapter 12 of Part IV to show that there is an essentially unique effective presentation of the real numbers type hierarchy which makes the Real PCF primitive operations formally computable. In particular, Theorem 6.12 together with the results of Chapter 10 of Part III directly entail the result.

6.1 A non-standard effective presentation of B^{ω}

An effective presentation of B^{ω} in the sense of Definition 3.16 is given by (id_{B^{ω}}, id_{B^{ω}}). Let f : ω → ω be a non-recursive permutation of ω, and define ϕ : B^{ω} → B^{ω} by ϕ(p) = p ∘ f. Then

(ϕ, ϕ^{−1}) is an effective presentation of B^{ω},

because ϕ∘ϕ^{−1} = id_{B^{ω}}. But this effective presentation is intuitively not “really” effective, by construction.

One might suspect that this may have something to do with the definition of the notion of effective presentation via section-retraction pairs given in Definition 3.16. But the same phenomenon takes place for the usual notion of effectively given algebraic domain. If we define b′_{n} = b_{f(n)}, where b is the standard algebraic effective presentation of B^{ω}, it is easy to check that the axioms for effectively given algebraic domains given in Definition 3.14 are satisfied by b′.

One might conclude that the solution to this paradox would lie in the fact that (B^{ω}, id, id) and (B^{ω}, ϕ, ϕ^{−1}) are not isomorphic objects of ECDom. An examination of this possibility seems to make the paradox even worse:

ϕ : (B^{ω}, id, id) → (B^{ω}, ϕ, ϕ^{−1}) is an isomorphism in ECDom

Proof By definition, we have that a function f : B^{ω} → B^{ω} is computable with respect to effective presentations (s_{1}, r_{1}) and (s_{2}, r_{2}) respectively iff s_{1} ∘ f ∘ r_{2} : B^{ω} → B^{ω} is computable with respect to the standard effective presentation of B^{ω}. If we take (s_{1}, r_{1}) = (id_{B^{ω}}, id_{B^{ω}}), (s_{2}, r_{2}) = (ϕ, ϕ^{−1}) and f = ϕ then s_{1} ∘ f ∘ r_{2} = id ∘ ϕ ∘ ϕ^{−1} = id which is certainly computable with respect to the standard effective presentation. If we take (s_{1}, r_{1}) = (ϕ, ϕ^{−1}), (s_{2}, r_{2}) = (id_{B^{ω}}, id_{B^{ω}}) and f = ϕ^{−1} then s_{1} ∘ f ∘ r_{2} = ϕ ∘ ϕ^{−1} ∘ id = id. Therefore ϕ and its inverse are computable! □ Again, in the category of effectively given algebraic domains and computable maps, (B^{ω}, b) and (B^{ω}, b′) are isomorphic objects, with ϕ as an isomorphism. We omit the argument, which is similar.

On the other hand,

The identity of B^{ω} is not computable as a morphism (B^{ω}, id, id) → (B^{ω}, ϕ, ϕ^{−1}) or as a morphism (B^{ω}, ϕ, ϕ^{−1}) → (B^{ω}, id, id).

This is reasonable and solves the paradox, because it shows that we cannot access within B^{ω} “correctly presented” the computable elements of B^{ω} “incorrectly presented”, which are not computable in B^{ω} “correctly presented”.

We can summarize the above remarks by saying that effective domain theory does not give an absolute notion of effectivity. In the following sections we investigate the concept introduced in the definition below, and we show that we can achieve absoluteness by imposing additional structure on effectively given domains.

Definition 6.1 We say that two effective presentations (s_{1}, r_{1}) and (s_{2}, r_{2}) of a coherently complete domain D induce the same notion of computability on D if the following conditions hold:

1. For every effectively given domain (C, s, r), a function f : C → D is computable w.r.t. (s, r) and (s_{1}, r_{1}) iff it is computable w.r.t. (s, r) and (s_{2}, r_{2}).

2. For every effectively given domain (E, s, r), a function f : D → E is computable w.r.t. (s_{1}, r_{1}) and (s, r) iff it is computable w.r.t. (s_{2}, r_{2}) and (s, r).

By taking C = 1 we see that if (s_{1}, r_{1}) and (s_{2}, r_{2}) induce the same notion of computability on D, then an element of D is computable w.r.t. (s_{1}, r_{1}) iff it is computable w.r.t. (s_{2}, r_{2}). □

6.2 Equivalence of effectively given domains

We recall the following definitions from [AHS90], and we make explicit a notion which we call representability: Definition 6.2

1. A concrete category over a category X is a category A together with a faithful functor U : A → X, called the underlying functor.

2. Let (A, U) be a concrete category over X. If A and B are objects in A then a morphism f : UA → UB in X is (A, B)-representable if there is a (necessarily unique) morphism f̄: A → B in A such that U(f̄) = f, called the (A, B)-representation of f.

3. We write f : A → B to denote the fact that a morphism f : UA → UB is (A, B)-representable, and we notationally identify f with its (A, B)- representation f̄.

4. The fibre of an object X in X is the preordered class consisting of all objects A in A with U(A) = X, with order given by:

A ≤ B iff id_{X} : A → B, where id_{X} : X → X is the identity.

5. Let A and B in A be objects in the same fibre. The we define

A ≡ B iff A ≤ B and B ≤ A,

and in this case we say that A and B are equivalent objects of (A, U). □

Clearly, ECDom is concrete over CDom, with the underlying functor given by the forgetful functor which forgets effective presentations. Using the language of the above definition, we have that

(B^{ω}, id, id) and (B^{ω}, ϕ, ϕ^{−1}) are isomorphic objects of the category ECDom, but inequivalent objects of the concrete category (ECDom, U).

Clearly, if D and E are objects in ECDom, a function f : UD → UE in CDom is (D, E)-representable iff it is computable w.r.t the effective presentations of D and E.

Definition 6.3 We say that two effective presentations (s_{1}, r_{1}) and (s_{2}, r_{2}) of a coherently complete domain D are equivalent if (D, s_{1}, r_{1}) and (D, s_{2}, r_{2}) are equivalent objects of the concrete category (ECDom, U). □

It is immediate that (s_{1}, r_{1}) and (s_{2}, r_{2}) are equivalent iff s_{1} ∘ r_{2} and s_{2} ∘ r_{1} are computable w.r.t. the standard effective presentation of B^{ω}.

Proposition 6.4 Let (A, U) be a concrete category over X, let X be an Xobject, and let B and B′ be A-objects in the fibre of X. Then the following are equivalent:

1. B ≤ B′.

2. For all A in A and f : UA → X in X, if f : A → B then f : A → B′.

3. For all C in A and f : X → UC in X if f : B′ → C then f : B → C. Proof (1 ⇒ 2): Assume that f : UA → X is (A, B)-representable, let f̄: A → B be the (A, B)-representation of f, and \overline{id}_{X} : B → B′ be the (A, B′)- representation of id_{X}. Then f′ = \overline{id}_{X} ∘ f̄ is a (B, B′)-representation of f, because U(f′) = U(\overline{id}_{X} ∘ f̄) = U(\overline{id}_{X}) ∘ U(f̄) = id_{X} ∘ f = f. (1 ⇒ 3): Similar. (2 ⇒ 1): Take A = B and f = id_{X}. (3 ⇒ 1): Similar. □ This shows that our notion of equivalence is appropriate:

Corollary 6.5 Two effective presentations of a coherently complete domain are equivalent iff they induce the same notion of computability on the domain.

The following definition is also taken from [AHS90]:

Definition 6.6 A concrete category (A, U) over X is called concretely cartesian closed provided the following hold:

1. A and X are cartesian closed,

2. U preserves finite products, exponentials, and evaluation.

□

Clearly, (ECDom, U) is concretely cartesian closed. The following results are routinely proved, as Proposition 6.4:

Proposition 6.7 Let (A, U) be a concretely cartesian closed category over X. If 1 and 1′ are terminal objects of A in the same fibre then 1 ≤ 1′, and if A ≤ A′ and B ≤ B′ are objects of A in the same fibre then

1. A × B ≤ A′ × B′,

2. (A ⇒ B′) ≤ (A′ ⇒ B).

We can thus say that equivalence is a “cartesian closed congruence”.

Proposition 6.8 Let (A, U) be a concretely cartesian closed category over X, and let A and B and be A-objects. Then

1. Any two products of A and B which are in the same fibre are equivalent.

2. Any two exponentials of B to the power A which are in the same fibre are equivalent.

Thus, as soon as effective presentations of D and E are specified, the effective presentations of D × E and D ⇒ E are uniquely specified up to equivalence.

It is clear that any coherently complete finite domain has some effective presentation.

Proposition 6.9 Any two effective presentations of a finite coherently complete domain are equivalent.

Proof Let D be a finite coherently complete domain and (s_{1}, r_{1}) and (s_{2}, r_{2}) be effective presentations of D. We have to show that s_{1} ∘ r_{2} and r_{2} ∘ s_{1} are computable w.r.t. the standard effective presentation of B^{ω}. Let d ∈ D, and i ∈ {1, 2}. Since d = r_{i}(s_{i}(d)) is finite and r_{i} is continuous, there is some finite p_{i}^{d} ⊑ s_{i}(d) in B^{ω} such that already d = r_{i}(p_{i}^{d}). Hence

r_{i} = ⨆_{d∈D} p_{i}^{d} ⤇ d  and  s_{i} = ⨆_{d∈D} d ⤇ s_{i}(r_{i}(p_{i}^{d})),

because s_{i}(d) = s_{i}(r_{i}(p_{i}^{d})). Hence, if j ∈ {1, 2}\{i},

s_{i} ∘ r_{j}(x) = ⨆_{d⊑r_{j}(x)} s_{i}(r_{i}(p_{i}^{d})) = ⨆ ; d⊑⨆_{p^{e}_{j}⊑x} e s_{i}(r_{i}(p_{i}^{d})).

But s_{i}(r_{i}(p_{i}^{d})) is computable because p_{i}^{d} is finite and s_{i} ∘ r_{i} is computable by definition of effective presentation. Therefore s_{i} ∘ r_{j} is computable, because there are finitely many d’s and e’s. □ Thus, we don’t need to specify the effective presentation of a finite domain.

6.3 Characterizations of some effective presentations

How can we isolate the “correct” effective presentation of a domain D among all possible effective presentations? As we have seen, there is no absolute notion of computability for domain theory, and from the categorical point of view this is not a worry. However, in practice we need specific effective presentations. One way to achieve absoluteness is:

1. find some basic operations on D which are concretely computable (in our case these will be the Real PCF definable primitive operations),

2. find an effective presentation which makes the operations formally computable, and

3. show that any two effective presentations of D which make the operations formally computable are equivalent.

We first illustrate this idea in the case of D = B^{ω}. The operations defined in the following proposition are concretely computable, and formally computable w.r.t. the standard presentation of B^{ω}, as it is shown in [Plo78]. This establishes (1) and (2). The proposition itself establishes (3):

Proposition 6.10 Define continuous maps

cons : B × B^{ω} → B^{ω}, head : B^{ω} → B, tail : B^{ω} → B^{ω}

by

cons(t, p)(0) = t,  head(p) = p(0),
cons(t, p)(n + 1) = p(n),  tail(p)(n) = p(n + 1).

Then any two effective presentations of B^{ω} which make cons, head, and tail computable are equivalent.

Here we assume any effective presentation of B, and we notationally identify the domain B with the domain B endowed with the effective presentation. Proof Let D and D′ in ECDom be objects in the fibre of B^{ω} such that

cons : B × D → D, head : D → B, tail : D → D

and

cons : B × D′ → D′, head : D′ → B, tail : D′ → D′

The identity of B^{ω} is the least fixed-point of F : (B^{ω} ⇒ B^{ω}) → (B^{ω} ⇒ B^{ω}) defined by

F (f)(p) = cons(head(p), f(tail(p))).

Since head : D → B, tail : D → D and cons : B × D′ → D′, we have that F : (D ⇒ D′) → (D ⇒ D′). And since head : D′ → B, tail : D′ → D′ and cons : B × D → D, we have that F : (D′ ⇒ D) → (D′ ⇒ D). Hence id_{B^{ω}} : D → D′ and id_{B^{ω}} : D′ → D. But id_{B^{ω}} = fix F is computable because F is computable and the fixed-point combinator is always computable. Therefore D and D′ are equivalent. □ That is, there is a unique notion of computability for B^{ω} such that cons, head, and tail are computable.

Since cons : B×B^{ω} → B^{ω} is a bifree algebra, we see that Proposition 6.10 is a special case of Theorem 6.11 below. We already know that a locally computable functor has a computable bifree algebra.

Theorem 6.11 Let F : SDom → SDom be a locally continuous functor which restricts to a locally computable functor G : ESDom → ESDom, and let i : FC → C be a bifree algebra. Then there is at most one effective presentation of C which makes i and i^{−1} computable, up to equivalence. Proof As in Proposition 6.10, observing that the identity of C is the unique algebra homomorphism from i to itself, which is the least fixed-point of the functional F defined by F (f) = i ∘ Gf ∘ i^{−1}. □ This theorem further generalizes to inductive retractions with the same proof, by virtue of Lemma 5.6:

Theorem 6.12 Let F : SDom → SDom be a locally continuous functor which restricts to a locally computable functor G : ESDom → ESDom, and let ⟨α : FC → C, β : C → FC⟩ be an F-inductive section-retraction pair. Then there is at most one effective presentation of C which makes α and β computable, up to equivalence.

We apply this theorem in Section 12.1 in order to show that there an essentially unique effective presentation of the real numbers type hierarchy which makes the Real PCF definable elements computable.

Coherently complete domains

In our investigation of computational completeness in Chapter 12 of Part IV, we are led to consider bounded complete domains D with the following property: for every element d of D (or perhaps of some basis of D) there is a continuous map join_{d} : D → D such that

join_{d}(x) = d ⊔ x for every x consistent with d.

Such a map join_{d} is called a joining map and such a domain D is called a J-domain. In the above definition, if x is inconsistent with d, then there is a certain degree of freedom in what join_{d}(x) can be. Therefore, in general, an element can have more than one joining map, if it has a joining map at all.

In this chapter we characterize the J-domains exactly as the coherently complete domains. Moreover, we show that every element of a coherently complete domain has a least joining map. We also investigate joining maps of function spaces with respect to the joining maps of their source and target.

The results of this chapter are applied in Chapter 12 to show that Real PCF (without the existential quantifier) is first-order computationally complete.

7.1 Joining maps

Definition 7.1 A joining map of an element d of a bounded complete domain D is a continuous function join_{d} : D → D such that

join_{d}(x) = d ⊔ x for every x↑ ↑d.

A bounded complete domain D has internal joins if each d ∈ D has a joining map join_{d}. □

Proposition 7.2 Flat domains have internal joins. Proof For bottom, the unique joining map is the identity, and for a nonbottom element x, the unique joining map is the constant map x. □

Proposition 7.3 If a bounded complete domain D has internal joins, so does D^{ω}. Proof Let d ∈ D^{ω}, and define join_{d} : D^{ω} → D^{ω} by join_{d}(x) = ⟨join_{d_{i}}(x_{i})⟩_{i∈ω} . Then join_{d} is clearly a joining map for d, because d↑ ↑x iff d_{i}↑ ↑x_{i} for every i ∈ ω, and joins are computed componentwise. □

Proposition 7.4 Domains with internal joins are closed under the formation of retracts. Proof Let D be a retract of a domain E with internal joins, with respect to a section s : D → E and a retraction r : E → D, and for each d ∈ D define join_{d} : D → D by join_{d} = r∘join_{s(d)}∘s, where join_{s(d)} is a joining map for s(d) ∈ E. Let x be consistent with d. Then s(x)↑ ↑s(d). Hence join_{d}(x) = r(s(d)⊔s(x)) = d⊔x, by a general property of section-retraction pairs. Therefore join_{d} is a joining map for d. □ Recall that a domain is coherently complete if every pairwise consistent subset has a least upper bound, and recall that the coherently complete, countably based domains are characterized as the retracts of B^{ω}.

Theorem 7.5 A bounded complete countably based domain has internal joins iff it is coherently complete. Proof (⇒): Let {a, b, c} be a pairwise consistent subset of D, and join_{a} be a joining map for a. Since join_{a} is monotone, it preserves consistency. Thus a ⊔ b↑ ↑a⊔c, because b↑ ↑c. Hence {a, b, c} is consistent, and by bounded completeness it has a least upper bound. By induction, every finite pairwise consistent subset has a least upper bound. Therefore, for every pairwise consistent set there is a cofinal directed set, obtained by adding the joins of finite subsets.

(⇐) : Since B is a flat domain it has internal joins and hence so do B^{ω} and every retract of B^{ω}. □ We shall see that the countability hypothesis is not really necessary in the above theorem.

We shall need domains which have joining maps only for elements of a countable basis.

Definition 7.6 A J-domain is a bounded complete domain with a countable basis B such that each b ∈ B has a joining map. □

But these turn out to be the coherently complete countably based domains again. Recall that ↓ ↓↑ ↑d is the set of elements consistent with d.

Lemma 7.7 Let D be a bounded complete domain, x and y be elements of D, and let Z ⊆ D be directed. Then the following statements hold:

1. If a↑ ↑b for all a ≪ x and b ≪ y then x↑ ↑y.

2. The intersection of the closed neighbourhoods of x is ↓ ↓↑ ↑x.

3. If x↑ ↑z for every z ∈ Z then x↑ ↑^{⨆↑} Z. Proof (1): Assume that every a ≪ x is consistent with every b ≪ y, and let Z = {a ⊔ b|a ≪ x, b ≪ y}. Then Z is non-empty because it contains ⊥. Let a_{1} and a_{2} be way-below x, and b_{1} and b_{2} be way-below y. Then there is some u ≪ x above a_{1} and a_{2}, and there is some v ≪ y above b_{1} and b_{2}. Hence u ⊔ v is a member of Z above the members a_{1} ⊔ a_{2} and b_{1} ⊔ b_{2}. This shows that Z is directed. Therefore x and y are consistent, because ⨆ Z is above them.

(2): Any closed neighbourhood of x contains ↓ ↓↑ ↑x, because open sets are upper sets and closed sets are lower sets. If y ∉ ↓ ↓↑ ↑x then y is apart from x, and there are disjoint open neighbourhoods U and V of x and y respectively, by (1). In fact, the contrapositive of (1) states that if x and y lie apart then there are a ≪ x and b ≪ y such that a and b already lie apart; thus we can take U = ↑ ↑a and V = ↑ ↑b. Therefore y is not in the closure of U.

(3): This follows from (2), because Z ⊆ ↓ ↓↑ ↑x and closed sets contain the least upper bounds of their directed subsets. □

Proposition 7.8 Any J-domain is coherently complete. Proof Let B be a countable basis of a coherently complete domain D such that every element b of B has a joining map join_{b}, let {a, b, c} be a pairwise consistent subset of D, and let a′ ≪ a in B. Since join_{a′} is monotone, it preserves consistency. Thus a′ ⊔ b↑ ↑a′ ⊔ c, because b↑ ↑c. Hence a′ ⊔ b↑ ↑a′ ⊔ c for every a′ ≪ a in B. Since ⨆_{a′∈↓ ↓a∩B} a′⊔x = a⊔x for any x↑ ↑a, by two applications of Lemma 7.7 we conclude that a ⊔ b↑ ↑a ⊔ c. Therefore {a, b, c} is consistent, and we can finish the proof as in Theorem 7.5. □

Corollary 7.9 A countably based bounded complete domain is a J-domain iff it is coherently complete.

7.2 Canonical joining maps

In general, an element of a coherently complete domain can have more than one joining map. For example, let D be the flat domain of truth values with a new element tt′ above tt. Then any joining map of tt has to map ⊥ and tt to tt, and tt′ to tt′, but we can choose to map ff to either tt or else tt′. However, Theorem 7.13 below shows that there is a canonical way of choosing joining maps. Moreover, it shows how to construct joining maps directly instead of indirectly via the joining maps of the coherently complete domain B^{ω}.

Proposition 7.10 If join_{d} is a joining map for an element d of a bounded complete domain D, then join_{d} is an idempotent with image ↑ ↑d. Proof join_{d}(⊥) = d. By monotonicity, join_{d}(x) ∈ ↑ ↑d. If x ∈ ↑ ↑d then x↑ ↑d and join_{d}(x) = d ⊔ x = x. □ Recall that a kernel operator on a dcpo D is a continuous idempotent below the identity of D [AJ94, GHK^{+}80], and that a kernel operator is uniquely determined by its image.

Proposition 7.11 If join_{d} is a joining map of an element d of a bounded complete domain D, then the map consist_{d} : D → D defined by

consist_{d}(x) = join_{d}(x) ⊓ x

is a kernel operator with image ↓ ↓↑ ↑d.

Proof The binary meet operation is well-defined and continuous in any bounded complete domain. Hence so is consist_{d}. For any x, consist_{d}(x) is consistent with d, because join_{d}(x) is clearly above consist_{d}(x), and it is above d by Proposition 7.10. Conversely, if x is consistent with d then consist_{d}(x) = (d⊔x)⊓x = x. Therefore consist_{d} is a continuous idempotent with image ↓ ↓↑ ↑d. □

Proposition 7.12 For any coherently complete domain D and any d ∈ D there is a kernel operator consist_{d} : D → D with image ↓ ↓↑ ↑d, given by

consist_{d}(x) = max (↓ ↓x ∩ ↓ ↓↑ ↑d) .

That is, consist_{d}(x) is the greatest element below x which is consistent with d. Proof For each x ∈ D define Y_{x} = ↓ ↓x∩↓ ↓↑ ↑d. The set Y_{x} is non-empty, because it has bottom as a member. Let a, b ∈ Y_{x}. This means that a and b are bounded by x and consistent with d. By coherence, {a, b, d} has a join. Hence a ⊔ b is consistent with d. Therefore Y_{x} is directed. But it is also closed, because ↓ ↓x and ↓ ↓↑ ↑x are closed by Lemma 7.7. Therefore it contains its least upper bound, which has to be its greatest member. In order to show that consist_{d} is continuous, we use the ϵ-δ characterization of continuity. Let y ≪ ⨆ Y_{x}. We have to show that there is some x′ ≪ x such that already y ≪ ⨆ Y_{x′}. By a basic property of the way-below order on continuous dcpos, y ≪ a for some a ∈ Y_{x}. By interpolation, y ≪ a′ ≪ a for some a′, which belongs to Y_{x} as Y_{x} is closed. By transitivity, a′ ≪ x, and again by interpolation, we can find x′ such that a′ ≪ x′ ≪ x. But a′ ∈ Y_{x′}. Hence y ≪ ⨆ Y_{x′}, because y ≪ a′. Therefore consist_{d} is a kernel operator with image ↓ ↓↑ ↑d. □

Theorem 7.13 Every element d of a coherently complete domain D has a least joining map join_{d}, given by

join_{d}(x) = d ⊔ consist_{d}(x).

Proof The map is well-defined because consist_{d}(x) is consistent with d by construction, and it is clearly continuous. Therefore join_{d} is a joining map of d, because x = consist_{d}(x) iff x is consistent with d, again by construction. It remains to show that it is below any other joining map join′_{d} of d. By Proposition 7.11, we know that consist_{d}(x) = join′_{d}(x) ⊓ x, because kernel operators are uniquely determined by their image. Hence join_{d}(x) = d ⊔ (join′_{d}(x) ⊓ x). We have that d is below join′_{d}(x) by Proposition 7.10 , and we clearly have that join′_{d}(x)⊓x is below join′_{d}(x). Hence the join of d and join′_{d}(x)⊓x is itself below join′d(x). Therefore join_{d}(x) ⊑ join′_{d}(x). □

We have already shown that a bounded complete, countably based domain has internal joins iff it is coherently complete. The above theorem implies that this is true also when the countability hypothesis is omitted:

Corollary 7.14 A bounded complete domain has internal joins iff it is coherently complete.

Also, notice that the proof of this more general fact does not use the universality of B^{ω}.

7.3 Universality of B^{ω} via internal joins

We give a new proof of the fact that B^{ω} is a universal coherently complete countably based domain (in the sense that is has every coherently complete countably based domain as a retract). The proof is based on internal joins. The advantage of the new proof is that it can be effectivized in order to establish first-order computational completeness of Real PCF and full computational completeness of extensions of PCF with ground types interpreted as algebraic domains.

Theorem 7.15 A bounded complete countably based domain D is coherently complete iff it is a retract of B^{ω}. Proof Only the left-to-right implication is non-trivial. Let B be a countable basis of D and let {b_{n}|n ∈ ω} be an enumeration of B. The function s : D → B^{ω} defined by

s(x)(n) = \begin{cases}tt & if b_{n} ≪ x, \\ ff & if b_{n} # x, \\ ⊥ & otherwise. \end{cases}

is easily seen to be continuous. If p = s(x) then p^{−1}(tt) is an enumeration of ↓ ↓x ∩ B. We thus define j : ℕ → (D ⇒ D), f : B^{ω} → (ℕ ⇒ D), and r : B^{ω} → D by

j(n) = join_{b_{n}}
f(p)(n) = pif p(n) then j(n)(f(p)(n + 1)) else f(p)(n + 1),
r(p) = f(p)(0).

Here f is assumed to be the least fixed point of an implicitly defined functional, and pif is the parallel conditional defined in Section 3.4. The idea is that f recursively joins the elements enumerated by p^{−1}(tt). The function j is clearly continuous (ℕ with discrete topology), and f and r are continuous because they are defined by composition of continuous functions. We clearly have that f = ⨆_{k∈ω} f^{(k)}, for f^{(k)} inductively defined by

f^{(0)}(p)(n) = ⊥,
f^{(k+1)}(p)(n) = pif p(n) then j(n) (f^{(k)}(p)(n + 1)) else f^{(k)}(p)(n + 1).

We prove by induction on k that for all x ∈ D and k, n ∈ ω,

f^{(k)}(s(x))(n) = ⨆_{\begin{matrix}n≤i<k+n \\ b_{i}≪x \end{matrix}} b_{i}.

This implies that

r(s(x)) = f(s(x))(0) = ⨆_{k∈ω} f^{(k)}(s(x))(0) = ⨆_{k∈ω} ⨆_{\begin{matrix}i<k \\ b_{i}≪x \end{matrix}} b_{i} = ⨆_{\begin{matrix}k∈ω \\ b_{k}≪x \end{matrix}} b_{k} = x,

establishing that D is a retract of B^{ω}. For k = 0 the claim is immediate. For the inductive step, define

z = ⨆_{\begin{matrix}n+1≤i<k+n+1 \\ b_{i}≪x \end{matrix}} b_{i},

y = j_{n}(z).

By the induction hypothesis,

f^{(k+1)}(s(x))(n) = pif s(x)(n) then y else z.

We consider the following three cases for x:

Case (1): b_{n} ≪ x. Then s(x)(n) = tt, and b_{n}↑ ↑z, because z ⊑ x. Thus

f^{(k+1)}(s(x))(n) = y = b_{n} ⊔ z = ⨆_{\begin{matrix}n≤i<(k+1)+n \\ b_{i}≪x \end{matrix}} b_{i}.

Case (2): b_{n} # x. Then s(x)(n) = ff and b_{n} ≪̸ x. Thus

f^{(k+1)}(s(x))(n) = z = ⨆_{\begin{matrix}n≤i<(k+1)+n \\ b_{i}≪x \end{matrix}} b_{i}.

Case (3) Otherwise. Then s(x)(n) = ⊥, b_{n}↑ ↑x, b_{n} ≪̸ x, and b_{n}↑ ↑z, because z ⊑ x. Thus

f^{(k+1)}(s(x))(n) = y ⊓ z = (b_{n} ⊔ z) ⊓ z = z = ⨆_{\begin{matrix}n≤i<(k+1)+n \\ b_{i}≪x \end{matrix}} b_{i}. □

7.4 Function spaces of J-domains

We already know that the category of coherently complete countably based domains is cartesian closed. The point of the following theorem is to show how to construct joining maps for a basis of a function space D ⇒ E from the joining maps for bases of D and E. Of course, we cannot define join_{f}^{D⇒E}(g)(x) = join_{f(x)}^{E}(g(x)), because the map e ↦ join_{e}^{E} is not continuous; in fact, it is easy to see that it is not even monotone.

Lemma 7.16 A bounded complete domain is a J-domain iff it has a countable subbasis S such that each s ∈ S has a joining map. Proof If A = {s_{1}, …, s_{n}} is a bounded subset of S and s_{1}, …, s_{n} have joining maps join_{s_{1}}, …, join_{s_{n}} respectively, then the element ⨆ A of the induced basis has a joining map join_{s_{1}} ∘ ⋯ ∘ join_{s_{n}}. Notice that for n = 0 we have that ⨆ A = ⊥ and that join_{s_{1}} ∘ ⋯ ∘ join_{s_{n}} is the identity. □

Theorem 7.17 The category of J-domains is cartesian closed. Proof Let D and E be J-domains w.r.t. countable bases A and B respectively.

The identity function of a one-point domain is a joining map for the unique element of the domain. Hence it is a J-domain. A countable basis of D × E is A × B. If (a, b) ∈ A × B then a and b have joining maps join_{a}^{D} and join_{b}^{E} respectively, and it is easy to see that then (a, b) has a joining map join_{(a,b)}^{D×E} =^{def} join_{a}^{D}×join_{b}^{E}. Therefore the category of J-domains is closed under the formation of finite products.

Recall that a countable subbasis of D ⇒ E is given by the set of single-step functions A ⇒_{s} B = {a ⤇ b|a ∈ A, b ∈ B}, where

(a ⤇ b)(x) = \begin{cases}b & if a ≪ x, \\ ⊥ & otherwise. \end{cases}

Let a ⤇ b ∈ A ⇒_{s} B, let join_{b}^{E} be a joining map for b, and define a map way-below_{a}^{D} : D → B by

way-below_{a}^{D}(x) = \{ \begin{matrix}tt & if x is in ↑ ↑a, \\ ff & if x is in the exterior of ↑ ↑a, \\ ⊥ & if x is in the boundary of ↑ ↑a. \end{matrix}

Here the exterior of a set is the largest open set disjoint from it, namely the interior of its complement. Therefore this function is continuous. Define join_{a⤇b}^{D⇒E} : (D ⇒ E) → (D ⇒ E) by

join_{a⤇b}^{D⇒E}(f)(x) = pif^{E} way-below_{a}^{D}(x) then join_{b}^{E}(f(x)) else f(x),

and let f be an element of D ⇒ E consistent with a ⤇ b. In order to prove that join_{a⤇b}^{D⇒E}(f) = (a ⤇ b) ⊔ f, we show that join_{a⤇b}^{D⇒E}(f)(x) = ((a ⤇ b) ⊔ f)(x) for every x ∈ D, by considering the following three cases:

(1) x is in ↑ ↑a: In this case x is (trivially) consistent with a and hence b = (a ⤇ b)(x)↑ ↑f(x). Therefore join_{a⤇b}^{D⇒E}(f)(x) = join_{b}^{E}(f(x)) = b ⊔ f(x) = ((a ⤇ b) ⊔ f)(x).

(2) x is in the exterior of ↑ ↑a: Then join_{a⤇b}^{D⇒E}(f)(x) = f(x) = ⊥ ⊔ f(x) = ((a ⤇ b) ⊔ f)(x).

(3) x is in the boundary of ↑ ↑a: We first show that b↑ ↑f(x). By hypothesis, every neighbourhood of x intersects ↑ ↑a. In particular, every x′ ≪ x is wayconsistent with a. Let x′ ≪ x and u ∈ ↑ ↑x′∩↑ ↑a. Then (a ⤇ b)(u) = b↑ ↑f(u), because function application preserves consistency. Since x′ ⊑ u and hence f(x′) ⊑ f(u), b↑ ↑f(x′). This shows that b↑ ↑f(x′) for every x′ ≪ x. Hence, by continuity of f and Lemma 7.7, b↑ ↑ ⨆_{x′≪x} f(x′) = f(x). It follows that join_{a⤇b}^{D⇒E}(f)(x) = join_{b}^{E}(f(x)) ⊓ f(x) = (b ⊔ f(x)) ⊓ f(x) = f(x) = ((a ⤇ b) ⊔ f)(x).

Therefore, by Lemma 7.16, the category of J-domains is closed under the formation of function spaces. □

We don’t pause to check whether the joining maps constructed above are minimal whenever the given joining maps are minimal. But we conjecture that this is the case.

The above theorem gives a particularly simple construction of joining maps for function spaces of algebraic J-domains. By Lemma 7.7, if d is an element of a bounded complete domain D, then the set d^{♯} of elements apart from d is an open set disjoint from the open set ↑ ↑d; that is, d^{♯} is contained in the exterior of ↑ ↑d. In general, there is no reason why these sets should be equal. In fact, it seems to be hard to characterize the exterior of ↑ ↑d in order-theoretical terms. But a simple characterization is available when d is compact and D is algebraic:

Lemma 7.18 If d is a compact element of a bounded complete algebraic domain D, then the exterior of the open set ↑ ↑d = ↑ ↑d is d^{♯}. Proof Let x be an exterior point of ↑ ↑d. Then x has an open neighbourhood O disjoint from ↑ ↑d. By algebraicity of D, O contains a compact element b ⊑ x. Hence b is apart from d, because O is an upper set, and therefore x itself is apart from d, because it is above b. □

Part III

The partial real line

In Chapter 8 we introduce the partial real line. We include both standard facts and new results. In Chapter 9 we develop the idea that partial real numbers are “continuous words”, which is applied to obtain an operational semantics for Real PCF in Chapter 11 of Part IV. In Chapter 10 we introduce induction principles and recursion schemes for the partial real line, which are related to the interpretation of partial real numbers as continuous words.

Partial real numbers

In Section 8.1 we introduce the interval domain and its basic structure. In Section 8.2 we relate the Scott topology on the interval domain to the Euclidean topology on the real line. Since the subspace of maximal points of the interval domain is homeomorphic to the Euclidean real line, we decide to refer to is as the partial real line. In Section 8.3 we discuss extensions of continuous real valued functions of real valued variables to Scott continuous partial real valued functions of partial real variables. The material of these first three sections is standard.

In Section 8.4 we introduce new results about partial real valued functions. In Section 8.5 we relate discontinuous functions in analysis to continuous functions in domain theory. In Section 8.6 we discuss order of magnitude on partial real numbers. In Section 8.7 we show that every partial real number has a unique joining map (cf. Chapter 7 of Part II), and we conclude in particular that the partial real line is a coherently complete domain. In Chapter 8.8 we discuss a “parallel effect” on the partial real line which forces us to use the so-called parallel conditional, which is informally discussed in [BC90]. We give a simple topological explanation of the parallel effect.

Sections 8.9–8.13 are included as an appendix to this chapter. They can be omitted as they are not needed in the development which follows. Section 8.9 relates the partial real line to the Euclidean plane. Section 8.10 generalizes the construction of the real line by Dedekind cuts to the partial real line. Section 8.11 constructs the partial real line by round ideals, and it does not contain any new material. Section 8.12 discuss an algebraic version of the partial real line. Section 8.13 presents the partial real line as a quasi-metric space.

8.1 The interval domain

In this section we discuss standard facts about the interval domain introduced in [Sco72b], which is the main domain of interest in this thesis.

The set R = Iℝ of non-empty compact subintervals of the Euclidean real line ordered by reverse inclusion

x ⊑ y iff x ⊇ y

is a domain, referred to as the interval domain. If we add an artificial bottom element to R, which can be concretely taken as the non-compact interval (−∞, +∞), then R becomes a bounded complete domain R_{⊥}.

For any interval x ∈ R, we write

\underline{x} = inf x  and  \overline{x} = sup x

so that x = [\underline{x}, \overline{x}]. A subset A ⊆ R has a least upper bound iff it has non-empty intersection, and in this case

⨆ A = [sup_{a∈A} \underline{a}, inf_{a∈A} \overline{a}] = ⋂ A.

Any subset A ⊆ R with a lower bound has a greatest lower bound, given by

⨅ A = [ inf_{a∈A} \underline{a}, sup_{a∈A} \overline{a}] ⊇ ⋃ A.

The way-below relation of R is given by

x ≪ y iff \underline{x} < \underline{y} and \overline{y} < \overline{x}
iff the interior of x contains y.

The way-below relation of R is multiplicative, in the sense that

x ≪ y and x ≪ z together imply x ≪ y ⊓ z.

A basis of R is given by the intervals with distinct rational (respectively dyadic) end-points. Recall that a dyadic number is a rational number of the form m/2^{n}.

The unit interval domain

The set I= I[0, 1] of all non-empty closed intervals contained in the unit interval [0, 1] is a bounded complete, countably based domain, referred to as the unit interval domain. The bottom element of I is the interval [0, 1]. Its way-below order is given by

x ≪ y iff \underline{x} = 0 or \underline{x} < \underline{y}, and \overline{y} < \overline{x} or \overline{y} = 1
iff the interior of x contains y.

The extended interval domain

Let ℝ^{⋆} = [−∞, +∞] be the two-point compactification of the real line, also referred to as the extended real line. Then the set R^{⋆}= Iℝ^{⋆} of all non-empty compact intervals of the extended real line is a bounded complete, countably based domain, referred to as the extended interval domain. Its way-below relation is given similarly.

8.2 The partial real line

Let s : ℝ → R denote the singleton-map r ↦ {r}. This is a function onto the maximal elements of R. Since the sets ↑ ↑x, for x ∈ R, form a basis of the Scott topology of R, and since

↑ ↑x ∩ Max R = \{\{r\}|\underline{x} < r < \underline{x}\} = \{s(r)|r ∈ (\underline{x}, \overline{x})\},

the sets {s(r)|r ∈ (a, b)}, for open intervals (a, b), form a base of the relative topology on Max R. This shows that Max R is homeomorphic to the real line, and that the singleton map is a subspace inclusion, because the open intervals (a, b) form a base of the topology of the real line.

Similarly, Max I and Max R^{⋆} are homeomorphic to the unit interval and the extended real line.

Therefore non-singleton intervals can be regarded as approximations of real numbers, and we refer to them as partial real numbers and to the interval domain as the partial real line. Similarly, we refer to the unit interval domain as the partial unit interval and to the extended interval domain as the extended partial real line.

Remark 8.1 In interval analysis [Moo66] one works with R endowed with the topology induced by the Hausdorff metric on intervals. We refer to the resulting space as the interval space. For topological connections between domain theory and interval analysis see [EC93]. In particular, it is shown that the Scott open sets of the interval domain are the open upper sets of the interval space. Conversely, the open sets of the interval space are the Lawson open sets of the interval domain. Since in interval analysis one restricts oneself to monotone functions, many results presented in [Moo66] go through if one replaces the topology induced by the Hausdorff metric by the Scott topology. See also Acióly [Aci91] for more connections between domain theory and interval analysis. □

8.3 Canonical extensions of real valued maps of real variables

Every continuous map f : ℝ^{n} → ℝ extends to a continuous map If : R^{n} → R defined by

If(x_{1}, …, x_{n}) = {f(r_{1}, …, r_{n})|r_{1} ∈ x_{1}, …, r_{n} ∈ x_{n}},

called its canonical extension. For n = 1 we reason as follows. Since f is continuous, it maps connected sets to connected sets, and compact sets to compact sets. Hence it maps compact intervals to compact intervals. Therefore If is well-defined. But extensions of maps to powersets preserve intersections of ⊇-directed sets. Therefore If is Scott continuous. For n arbitrary the argument is analogous.

It is easy to see that the canonical extension is the greatest monotone extension. Since it is continuous and every continuous function is monotone, it is also the greatest continuous extension. Notice however that the above extension property doesn’t follow from the injectivity properties discussed in Section 2.8, because R is not bounded complete as it lacks a bottom element.

If the function f is increasing in each argument with respect to the natural order of ℝ, then If is given pointwise:

If(x_{1}, …, x_{n}) = [f(\underline{x_{1}}, …, \underline{x_{n}}), f(\overline{x_{1}}, …, \overline{x_{n}})].

If f is decreasing in each argument, then If is given “antipointwise”:

If(x_{1}, …, x_{n}) = [f(\overline{x_{1}}, …, \overline{x_{n}}), f(\underline{x_{1}}, …, \underline{x_{n}})].

Convention 8.2 We often notationally identify the function f : ℝ^{n} → ℝ with its extension If : R^{n} → R, and a number r ∈ ℝ with its inclusion {r} ∈ R. Moreover, we often define a function f : R^{n} → R by first defining a function f : ℝ^{n} → ℝ and then implicitly taking its canonical extension. The same convention applies to functions denoted by operator symbols, such as addition denoted by +. □

For example,

x + y = [\underline{x} + \underline{y}, \overline{x} + \overline{y}],
1 − 2x = [1 − 2\overline{x}, 1 − 2\underline{x}].

Of course, the extension properties discussed for the interval domain also apply to the partial unit interval.

For the extended partial real line we can reason as follows. The closure of ℝ in ℝ^{⋆} is ℝ^{⋆}. Hence the singleton map r ↦ {r} : ℝ → R^{⋆} embeds the real line as a dense subspace of R^{⋆}. Therefore, by the injective property of bounded complete domains (cf. Section 2.8), every continuous function f : ℝ → ℝ has a greatest continuous extension f^{⋆} : R^{⋆} → R^{⋆}. If the limits of f at ±∞ exist, then the values of f^{⋆} at ±∞ are these limits, as discussed in the next section.

8.4 Partial real valued functions

In this section we consider functions defined on any space with values on the extended partial real line.

The projections \underline{π}, \overline{π} : R^{⋆} → ℝ^{⋆} defined by

\underline{π}(x) = \underline{x}  and  \overline{π}(x) = \overline{x}

are not continuous because they do not preserve the specialization order, as the specialization order of ℝ^{⋆} is discrete.

The set of extended real numbers endowed with its natural order ≤ is a continuous lattice, and so is its opposite (see [GHK^{+}80]). Moreover, for any space X, a function f : X → ℝ^{⋆} is lower semicontinuous iff it is continuous with respect to the Scott topology on ℝ^{⋆} induced by ≤, and it is upper semicontinuous iff it is continuous with respect to the Scott topology on ℝ^{⋆} induced by ≥. It is clear from this observation that the above projections are respectively lower and upper semicontinuous.

In order to avoid the rather long terms “lower semicontinuous” and “upper semicontinuous”, we denote by \underline{ℝ} and \overline{ℝ} the set of extended real numbers endowed with the Scott topologies induced by ≤ and ≥ respectively, and we refer to the points of these topological spaces as respectively lower and upper real numbers. Thus, the above projections are continuous functions \underline{π} : R^{⋆} → \underline{ℝ} and \overline{π} : R^{⋆} → \overline{ℝ}.

The projections satisfy

\underline{π} ≤ \overline{π}

pointwise. Thus, given any continuous function f : X → R^{⋆}, we can define continuous functions \underline{f} : X → \underline{ℝ} and \overline{f} : X → \overline{ℝ} by composition with the projections, and we have that \underline{f} ≤ \overline{f} pointwise. Conversely,

Lemma 8.3 For any space X and all continuous maps \underline{f} : X → \underline{ℝ} and \overline{f} : X → \overline{ℝ} with

\underline{f} ≤ \overline{f}

pointwise, there is a unique continuous map f : X → R^{⋆} such that

\underline{f} = \underline{π} ∘ f  and  \overline{f} = \overline{π} ∘ f,

namely [\underline{f}, \overline{f}] defined by

[\underline{f}, \overline{f}](x) = [\underline{f}(x), \overline{f}(x)].

Proof It suffices to show that [\underline{f}, \overline{f}] is continuous. Given a basic open set ↑ ↑y in R^{⋆}, we have that

[\underline{f}, \overline{f}]^{−1}(↑ ↑y) = \{x ∈ X|y ≪ [\underline{f}, \overline{f}](x)\}
= \{x ∈ X|\underline{y} ≪\underline{ℝ} \underline{f}(x) and \overline{y} ≪\overline{ℝ} \overline{f}(x)\}
= \{x ∈ X|\underline{y} ≪\underline{ℝ} \underline{f}(x)\} ∩ \{x ∈ X|\overline{y} ≪\overline{ℝ} \overline{f}(x)\}
= \underline{f}^{−1}(↑ ↑\underline{ℝ} \underline{y}) ∩ \overline{f}^{−1}(↑ ↑\overline{ℝ} \overline{y})

is an open set, because ↑ ↑\underline{ℝ} \underline{y} and ↑ ↑\overline{ℝ} \overline{y} are open sets in \underline{ℝ} and \overline{ℝ} respectively. Therefore [\underline{f}, \overline{f}] is continuous. □ Thus, for any space X, a continuous function f : X → R^{⋆} is essentially the same as a pair of continuous maps ⟨\underline{f} : X → \underline{ℝ}, \overline{f} : X → \overline{ℝ}⟩ with \underline{f} ≤ \overline{f} pointwise.

We can thus say that an extended partial real number is given by a pair ⟨\underline{x}, \overline{x}⟩ of respectively lower and upper real numbers such that \underline{x} ≤ \overline{x}.

Corollary 8.4 R^{⋆} is homeomorphic to the subspace of \underline{ℝ} × \overline{ℝ} consisting of pairs of extended real numbers ⟨\underline{x}, \overline{x}⟩ with \underline{x} ≤ \overline{x}.

Since R^{⋆} is a bounded complete domain, it is a densely injective space (cf. Section 2.8).

Proposition 8.5 Let X be a dense subspace of a metric space Y and f : X → R^{⋆} be a continuous map. Then the greatest continuous extension f̂: Y → R^{⋆} of f is given by

f̂(y) = [lim inf_{x→y} \underline{f}(x), lim sup_{x→y} \overline{f}(x)] .

Here x → y is a short-hand for x ∈ X and x → y. Proof

f̂(y) = \begin{matrix}⨆ & ↑ \\ y∈O∈ΩY \end{matrix} ⨅_{x∈X∩O} f(x)

= \begin{matrix}⨆ & ↑ \\ ϵ>0 \end{matrix} ⨅_{0<d(x,y)<ϵ} [\underline{f}(x), \overline{f}(x)]

= \begin{matrix}⨆ & ↑ \\ ϵ>0 \end{matrix} [ inf_{0<d(x,y)<ϵ} \underline{f}(x), sup_{0<d(x,y)<ϵ} \overline{f}(x)]

= [sup_{ϵ>0} inf_{0<d(x,y)<ϵ} \underline{f}(x), inf_{ϵ>0} sup_{0<d(x,y)<ϵ} \overline{f}(x)]
= [lim inf_{x→y} \underline{f}(x), lim sup_{x→y} \overline{f}(x)] . □

In particular, if f : X → ℝ^{⋆} is a continuous map, then the above theorem applied to the coextension s ∘ f : X → R^{⋆} of f to R^{⋆}, where s : ℝ^{⋆} → R^{⋆} is the singleton embedding, produces a greatest extension f̂: Y → R^{⋆} of f, given by

f̂(y) = [lim inf_{x→y} f(x), lim sup_{x→y} f(x)] .

Let f : ℝ → ℝ be continuous. By the above remark, if f has a limit at ∞, then f̂(∞) = lim_{x→∞} f(x). For a pathological example, consider f : (ℝ − {0}) → ℝ defined by f(x) = sin(1/x). Then f̂(0) = [−1, 1], so that f̂ behaves as the so-called topologist’s sine curve [HY88]. Also, f̂(±∞) = 0.

Lemma 8.6 Every continuous map f : ℝ → R has a greatest continuous extension f̂: R → R, given by

f̂(x) = ⨅ f(x).

Proof Since this is clearly the greatest monotone extension, it suffices to show that it is continuous. In this proof we make use of techniques not introduced in the background Part I, which can be found in [Sch93] (see also [Smy83, Vic89, Eda95e]). Let U be the endofunctor on the category of topological spaces which assigns to a space X its upper space, whose points are the non-empty compact saturated sets of X, and which assigns to a continuous map f : X → Y the continuous map Uf : UX → UY defined by Uf(Q) = ↑ ↑f(Q). Then for any space X the map x ↦ ↑ ↑x : X → UX is continuous, and for any continuous ⊓-semilattice D, the meet map ⨅ : UD → D is well-defined and continuous.

Since R is a continuous ⊓-semilattice and a subspace of Uℝ, the map f̂ is continuous, because it can be expressed as the following composition of continuous maps:

\begin{matrix}R & ^{⊂} & Uℝ & \overline{\begin{matrix}Uf \\ \end{matrix}} & UR & \overline{⨅} & R \\ x & ↦ & x & ↦ & ↑ ↑f(x) & ↦ & ⨅ ↑ ↑f(x) = ⨅ f(x). \end{matrix}

(Note: This also shows that the assignment f ↦ f̂ is Scott continuous, and is a particular case of a much more general fact about injectivity established in [Esc97]). □

8.5 Discontinuous functions in real analysis versus continuous functions in domain theory

This section contains new results about extensions of arbitrary real valued functions to continuous partial real valued functions.

In real analysis one often considers discontinuous functions f : ℝ → ℝ, but in many cases only the points of continuity of f are interesting. For instance, a function f : ℝ → ℝ is Riemann integrable on any compact interval iff it is bounded on compact intervals and continuous almost everywhere [Roy88]. Moreover, the integral of f depends only on its points of continuity. The following theorem shows that such uses of ad hoc discontinuity can be avoided in domain theory.

Lemma 8.7 For any function f : X → ℝ^{⋆} defined on a metric space X there is a continuous map f̃: X → R^{⋆} agreeing with f at every point of continuity of f, given by

f̃(x) = [lim inf_{y→x} f(y), lim sup_{y→x} f(y)] .

Proof We know from classical topology and analysis that

\underline{g}(y) = lim inf_{x→y} f(x)

is the greatest lower semicontinuous function below f, and that

\overline{g}(y) = lim sup_{x→y} f(x)

is the least upper semicontinuous function above f (see e.g. [Bou66, Roy88]). Since f̃ is [\underline{g}, \overline{g}], it is continuous. Since f is continuous at y iff lim_{x→y} g(x) exists iff lim inf_{x→y} f(x) = lim sup_{x→y} g(x), f̃ agrees with f at every point of continuity of f. □

Theorem 8.8 For any function f : ℝ → ℝ bounded on compact intervals there is a continuous map f̈ : R → R agreeing with f at every point of continuity of f, given by

f̈(x) = [inf \underline{g}(x), sup \overline{g}(x)],

where \underline{g} : ℝ → \underline{ℝ} and \overline{g} : ℝ → \overline{ℝ} are continuous maps defined by

\underline{g}(y) = lim inf_{x→y} f(x)  and  \overline{g}(y) = lim sup_{x→y} f(x).

Proof Since f is bounded on compact intervals, the function f̃ : ℝ → R^{⋆} defined in Lemma 8.7 corestricts to R. By Lemma 8.6, the corestriction can be extended to a function f̈: R → R, given by

f̈(x) = ⨅ f̃(x) = [inf \underline{g}(x), sup \overline{g}(x)].  □

8.6 Order of magnitude on the partial real line

We define a strict order < on partial numbers by

x < y iff \overline{x} < \underline{y}.

This relation is clearly irreflexive, transitive, and asymmetric (in the sense that x < y together with x > y is impossible). The following lemma is immediate:

Lemma 8.9 For all partial real numbers x and y, exactly one of the relations x < y, x↑ ↑y and x > y holds.

Lemma 8.10 For all x, y, u, v ∈ R,

1. u < x ⊓ y iff u < x and u < y,

2. x ⊓ y < v iff x < v and y < v. Proof (1): u < x ⊓ y iff \overline{u} < \underline{x ⊓ y} iff \overline{u} < min(\underline{x}, \underline{y}) iff \overline{u} < \underline{x} and \overline{u} < \underline{y} iff u < x and u < y. (2): Similar. □

Let 𝔹= {tt, ff} be the discrete space of truth values. The characteristic function χ_{<} : ℝ × ℝ → 𝔹 of the inequality predicate < is discontinuous at each point ⟨x, x⟩. This reflects the fact that equality of real numbers is undecidable [ML70, PeR83, Wei87, Wei95]. Recall that B= 𝔹_{⊥} is the flat domain of partial truth values. Since the points of continuity of χ_{<} form a dense set, χ_{<} restricted to its points of continuity has a greatest continuous extension (x, y) ↦ (x<_{⊥}y) : R_{⊥} × R_{⊥} → B. This extension is given by

(x<_{⊥}y) = \begin{cases}tt & if x < y, \\ ff & if x > y, \\ ⊥ & if x↑ ↑y. \end{cases}

We define a relation ≤ on partial numbers by

x ≤ y iff \overline{x} ≤ \underline{y}.

The relation ≤ transtive and antisymmetric, but reflexive only on total real numbers, and therefore the notation can be misleading.

8.7 The partial real line as a J-domain

Recall from Chapter 7 that a joining map of an element d of a bounded complete domain D is a continuous function join_{d} : D → D such that

join_{d}(x) = d ⊔ x for every x↑ ↑d,

and that a bounded complete domain is a J-domain iff it has a basis such that every basis element has a joining map.

Proposition 8.11 Each a ∈ R_{⊥} has a unique joining map join_{a}. Proof If a = ⊥ the identity is the only joining map. Otherwise, if join_{a} : R_{⊥} → R_{⊥} is a joining map of a, then its monotonicity implies that join_{a}(x) = \underline{a} for all x < a and join_{a}(x) = \overline{a} for all x > a. In fact, assume that x < a. This means that \overline{x} < \underline{a}. Then [\underline{x}, \underline{a}] ⊑ x. Hence \underline{a} = join_{a}([\underline{x}, \underline{a}]) ⊑ join_{a}(x). Therefore \underline{a} = join_{a}(x), because \underline{a} is maximal. The other case is similar. By Lemma 8.9, if a has a joining map then it has to be join_{a} defined by

join_{a}(x) = \begin{cases}\underline{a} & if x < a, \\ a ⊔ x & if x↑ ↑a, \\ \overline{a} & if a < x \end{cases}

= max(\underline{a}, min(x, \overline{a})).

Notice that we are applying Convention 8.2. Since this map is continuous, it is a joining map of a. □ Since a domain is coherently complete iff each of its elements has a joining map, we have that

Corollary 8.12 R_{⊥} is a coherently complete domain.

8.8 A parallel effect in the partial real line

We say that a continuous predicate p : R_{⊥} → B is non-trivial if there are total real numbers x and y such that p(x) = tt and p(y) = ff, and we say that a function f : R_{⊥} → D is undefined at x if f(x) = ⊥.

Proposition 8.13 Let D be a domain, p : R_{⊥} → B be a continuous predicate, g, h : R_{⊥} → D be continuous functions, and define a function f : R_{⊥} → D by

f(x) = if p(x) then g(x) else h(x).

If p is non-trivial then f is undefined at some total real number.

The proof depends only on the fact that Max (R_{⊥}) is a connected space. Proof The non-empty disjoint sets U = p^{−1}(tt) ∩ Max (R_{⊥}) and V = p^{−1}(ff) ∩ Max (R_{⊥}) are open in Max (R), because p is continuous, and {tt} and {ff} are open in B. Hence U ∪ V ≠ Max (R_{⊥}), because Max (R_{⊥}) is connected. Therefore there is some maximal element x such that p(x) = ⊥. □

Thus, the sequential conditional is not appropriate for definition by cases of total functions on the partial real line (or any domain with subspace of maximal points homeomorphic to the real line) because it produces non-total functions for non-trivial continuous predicates. We claim that the parallel conditional overcomes this deficiency of the sequential conditional. This “parallel effect” seems to be related to the “intensional effect” described in [Luc77].

In virtually all definitions by cases of the form

f(x) = pif p(x) then g(x) else h(x)

given in this work, one has that g(x) = h(x) for all maximal x with p(x) = ⊥. In such a situation, if x is maximal and p(x) = ⊥, then

f(x) = g(x) ⊓ h(x) = g(x) = h(x).

The examples below illustrate this situation, and, moreover, they show that the parallel conditional is useful to overcome the fact that equality of real numbers is undecidable.

Example 8.14 The following definition gives an extension of the absolute value function:

|x| = pif x<_{⊥}0 then − x else x.

For the case x = 0 one has

|0| = pif ⊥ then − 0 else 0 = 0 ⊓ 0 = 0.  □

Example 8.15 Let E be any domain, and let f, g : I → E be continuous maps. Then f and g are (generalized) paths in the domain E. (The restrictions of f and g to total real numbers are paths in the usual sense [HY88].) If f(1) = g(0) the paths are said to be composable. Now define a continuous map h : I → E by

h(x) = pif x <_{⊥} \frac{1}{2} then f(2x) else g(2x − 1)

If the paths are composable, then h is a (generalized) composite path. Let us check the crucial case x = \frac{1}{2}:

h(\frac{1}{2}) = pif \frac{1}{2} <_{⊥} \frac{1}{2} then f(2 · \frac{1}{2}) else g(2 · \frac{1}{2} − 1) = pif ⊥ then f(1) else g(0)
= f(1) ⊓ g(0) = f(1) = g(0)

Notice that the sequential conditional would produce ⊥ instead of f(1) ⊓ g(0), and therefore h would be undefined at \frac{1}{2}.

If f and g are not composable, then h is a generalized composite path with a jump at \frac{1}{2}, namely f(1) ⊓ g(0). For instance, if E = I and f and g are constant maps with range 0 and 1 respectively, then h can be thought as a switch which turns on at time \frac{1}{2}. In this case, the switch is in the transition state [0, 1] = 0⊓1 at time \frac{1}{2}. Notice that even in this case h is Scott continuous, because it is a composition of continuous maps. □

The following lemma is useful to prove properties of definitions involving the parallel conditional. Recall that a function between two bounded complete domains is multiplicative iff it preserves binary meets.

Lemma 8.16 Let f : D → E be a continuous map between bounded complete domains D and E. Then

f(pif p then x else y) = pif p then f(x) else f(y)

for all p ∈ B and all x, y ∈ D iff f is multiplicative. Proof (⇒): Take p = ⊥. Then the left-hand side of the equation is f(x ⊓ y) and the right-hand side is f(x) ⊓ f(y).

(⇐): If p = tt then lhs=f(x)=rhs, If p = ff then lhs=f(y)=rhs, and if p = ⊥ then lhs=f(x ⊓ y) = f(x) ⊓ f(y)=rhs. □

Appendix

Section 8.9 relates the partial real line to the Euclidean plane. Section 8.10 generalizes the construction of the real line by Dedekind cuts to the partial real line. Section 8.11 constructs the partial real line by round ideals, and it does not contain any new material. Section 8.12 discuss an algebraic version of the partial real line. Section 8.13 presents the partial real line as a quasi-metric space.

8.9 The unit triangle and the half-plane

The partial unit interval can be presented in a geometrically convenient form as follows. The unit square [0, 1] × [0, 1] under the componentwise order induced by the usual order ≤ on [0, 1] is a continuous lattice, whose Lawson topology coincides with the Euclidean topology on the unit square [GHK^{+}80] (see Remark 8.1). If we consider the points below (equivalently, on the left of) the diagonal which goes from (0, 1) to (1, 0), that is, the points (x, y) with x + y ≤ 1, we get a triangle, which we refer to as the unit triangle. The unit triangle is easily seen to be a domain. Its maximal elements are the points (x, y) with x + y = 1, that is, the points on the diagonal.

It turns out that the unit triangle is isomorphic to the partial unit interval. The isomorphisms can be taken as

(x, y) ↦ [x, 1 − y],
[x, y] ↦ (x, 1 − y).

We can think of the unit triangle as a coordinate system for the partial unit interval.

We have a similar fact for the partial real line; a coordinate system for R is given by the half-plane consisting of the points (x, y) with x + y ≤ 0. A coordinate system for R_{⊥} is obtained by adding a point (−∞, −∞) to the half-plane, and a coordinate system for R^{⋆} is obtained similarly.

8.10 A construction of the partial real line by Dedekind cuts

The real line can be constructed by Dedekind cuts [Rud76]. In this section we extend this construction to the extended partial real numbers domain.

A Dedekind cut is a pair ⟨L, R⟩ of sets of rational numbers such that

1. L and R are non-empty.

2. L is a lower set with no greatest element, and R is an upper set with no least element.

3. Every member of L is strictly below every element of R.

4. If p < q are rational numbers then p is a member of L or q is a member of R.

The second axiom can be put in constructive form, by positively expressing the negation of the universal quantification.

If the set ℝ of real numbers is already given, then there is a bijection between real numbers and cuts, given by the maps

x ↦ ⟨{r ∈ ℚ|r < x}, {r ∈ ℚ|x < r}⟩ ,
⟨L, R⟩ ↦ sup L  (or, equivalently, inf R).

Otherwise, we can define ℝ to be the set of cuts, and, indeed, this is one of the approaches to the construction of real numbers. The idea is that a real number is uniquely determined by its sets of rational lower and upper bounds.

If the first axiom is omitted, then we obtain the extended cuts. Only two new cuts arise, namely ⟨∅, ℚ⟩ and ⟨ℚ, ∅⟩, which can be thought as −∞ and +∞.

If the last axiom is also omitted, we obtain the partial extended cuts, and a construction of the partial extended real line. The information order on cuts can be defined by ⟨L, R⟩ ⊑ ⟨L′, R′⟩ iff L ⊆ L′ and R ⊆ R′. We thus have an isomorphism between partial extended real numbers and partial extended cuts, given by

x ↦ ⟨\{r ∈ ℚ|r < \underline{x}\}, \{r ∈ ℚ|\overline{x} < r\}⟩ ,
⟨L, R⟩ ↦ [sup L, inf R].

The partial real line can be constructed by keeping the first axiom and omitting the last, but allowing the partial cut ⊥ = ⟨∅, ∅⟩. The lower and upper real line \underline{ℝ} and \overline{ℝ} can be constructed by partial extended cuts of the form ⟨L, ∅⟩ and ⟨∅, R⟩ respectively.

If real numbers, extended real numbers, lower and upper real numbers, partial real numbers, and partial extended real numbers are constructed in this way, all of them coexist in a single universe, namely the domain of partial extended cuts.

Cuts have a natural computational interpretation. We can say that we know a (partial extended) real number if we know which rationals are below it and which rationals are above it. Then computability can be taken as effective knowledge, and, in fact, for real numbers this coincides with the definition of computability for the real line given in e.g. [PeR83, Wei87, Wei95]. The information order as defined above gives a natural ordering between the degrees of knowledge induced by partial cuts.

8.11 A construction of the partial real line by round ideals

Here we consider the abstract basis of R consisting of intervals with distinct rational end-points, referred to as the abstract rational basis. The order is given by

x ≺ y iff \underline{x} < \underline{y} and \overline{x} > \overline{y}.

The treatment of the extended case is similar. It is easy to see that there is a bijection between round ideals in the abstract rational basis and partial Dedekind cuts, given by

A ↦ ⟨{p| [p, q] ∈ A for some q}, {q| [p, q] ∈ A for some p}⟩
⟨L, R⟩ ↦ { [p, q]| p ∈ L and q ∈ R}.

Martin-Löf’s approach to constructive real analysis [ML70] is based on the abstract rational basis. (Notice that a recursion-theoretic approach to constructivity is adopted in loc. cit.) He considers the elements of the abstract rational basis as formal intervals, refers to them as neighbourhoods, and reads the expression x ≺ y as y is finer than x. He refers to a round ideal as an approximation, to its members as its neighbourhoods, positively defines the apartness relation by

x#y iff \overline{x} < \underline{y} or \underline{x} > \overline{y},

and defines

“An approximation a is maximal if, for every pair of neighbourhoods I and J such that I is finer than J, either I lies apart from some neighbourhood of a or J is a neighbourhood of a. The maximal approximations form the constructive points of the space we are considering.”

A non-constructive argument (using e.g. Zorn’s Lemma) is needed to prove that maximality in his sense coincides with order-theoretic maximality.

In the domain-theoretic approach to real number computation, approximations and points coexist in a single space, and approximations are considered as partial points. The construction of the partial real line by round ideals is discussed in detail in [Aci91].

8.12 An algebraic version of the partial real line

As we have seen in Section 2.7, every domain is a retract of the ideal completion of any of its bases, in a canonical way. Here we consider the ideal completion R̃ of the basis B of R consisting of intervals with (not necessarily distinct) rational end-points. Then we have a section-retraction pair

R ⇆_{e}^{p} R̃

defined by

e(x) = ↓ ↓x
p(X) = ^{⨆↑} X.

Since sections are subspace embeddings, if s : ℝ → R is the singleton embedding defined in Section 8.2, then e∘s : ℝ → R̃ is a subspace embedding, which is not onto the maximal elements of R̃. In fact, if r ∈ R is rational, then the round ideal

r^{∘} = e ∘ s(r) = {[a, b] ∈ B|a < r < b} = ↓ ↓{r}

has three ideals above it, namely

r^{□} = {[a, b] ∈ B|a ≤ r ≤ b} = ↓ ↓{r}
r^{−} = {[a, b] ∈ B|a < r ≤ b}
r^{+} = {[a, b] ∈ B|a ≤ r < b}.

Among these, the “square ideal” r^{□} is maximal, and it is an open point of R̃, simply because it is the principal ideal generated by a maximal basis element. Therefore the map d : ℚ → R̃ defined by

d(r) = r^{□}

is an embedding of the discrete space of rational numbers into the maximal elements of R̃.

Since the image of d is open in R̃, the closure of the image of e ∘ s is disjoint from the image of d. Therefore the embedding e ∘ s is not dense. But it is easily seen to be strongly isochordal (cf. Section 2.8). Since R̃_{⊥} is easily seen to be a coherently complete domain (and hence isochordally injective), we have that every continuous function f : ℝ → ℝ extends to a continuous function f̃: R̃_{⊥} → R̃_{⊥}. This justifies an approach to real number computation based on R̃, or the similar algebraic domain considered by Pietro di Gianantonio [Gia93a].

8.13 The partial real line as a quasi-metric space

A quasi-metric space [Law73, Smy87, Smy89, Smy92b] is a set X together with a function

d : X × X → [0, ∞]

such that 1. d(x, x) = 0,

2. d(x, y) + d(y, z) ≥ d(x, z).

Any quasi-metric induces a topology, given by the basis of open balls

B_{ϵ}(x) = {y ∈ X|d(x, y) < ϵ}.

The quasi-metric and specialization order induced by the topology are related by

d(x, y) = 0 iff x ⊑ y.

If d is a quasi-metric then so is its opposite, defined by

d^{op}(x, y) = d(y, x),

The symmetrization of d defined by

d^{∗}(x, y) = max(d(x, y), d^{op}(x, y))

is a metric, as it is immediate that

d^{∗}(x, y) = d^{∗}(y, x).

The topology induced by d^{∗} is the join of the topologies induced by d and d^{op}.

The examples below show that a quasi-metric d has the following intuitive interpretation:

d(x, y) tells us how much we have to degrade x so that it becomes smaller than y in the specialization order.

We can define a quasi-metric on the extended real numbers by

d(x, y) = x −^{.} y,

where −^{.} is truncated subtraction, defined by

x −^{.} y = \begin{cases}x − y & if x ≥ y, \\ 0 & if x ≤ y \end{cases}
= inf{ϵ > 0 | x − ϵ ≤ y}.

Notice that a subtraction involving infinities can be ambiguous, but that the last term of the definition eliminates the ambiguity if ϵ is assumed to be finite. We call this the lower quasi-metric on the extended real numbers, as the induced topology is the lower topology, because d(x, y) < ϵ iff x − ϵ ≪ y, and hence

B_{ϵ}(x) = ↑ ↑(x − ϵ).

Dually, d^{op} induces the upper topology and is called the upper quasi-metric. Hence d^{∗} induces the the usual topology on the extended real numbers. In fact,

d^{∗}(x, y) = max((x −^{.} y), (y −^{.} x)) = |y − x|,

as one of x −^{.} y and y −^{.} x must be zero and the other must be |y − x|.

Limits of sequences and Cauchy sequences can be defined in the same way as for metric spaces. Thus, a limit of a sequence x_{i} on a quasi-metric space X is a point y ∈ X such that for every ϵ > 0 there is an n such that d(x_{i}, y) < ϵ for all i ≥ n, and x_{i} is a Cauchy sequence if for every ϵ > 0 there is an n such that d(x_{i}, x_{j}) < ϵ for all i, j ≥ n. Although limits as defined above clearly coincide with limits with respect to the induced topology, it is not true that every convergent sequence is Cauchy. The following proposition is proved in a more general form in [Smy89]:

Proposition 8.17 A sequence x_{i} of extended real numbers converges to y with respect to the lower quasi-metric iff

y ≤ lim sup_{i∈ω} x_{i}.

In particular, if x_{i} is increasing then it converges to y iff

y ≤ sup_{i∈ω} x_{i}.

Proof x_{i} converges to y

iff for every ϵ > 0 there is an n such that x_{i} − ϵ < y for all i ≥ n,
iff for every ϵ > 0 there is an n such that sup_{i≥n} x_{i} − ϵ < y,
iff for every ϵ > 0, inf_{n∈ω} sup_{i≥n} x_{i} − ϵ < y,
iff for every ϵ > 0, lim sup_{i∈ω} x_{i} − ϵ < y,
iff for every ϵ > 0, d(lim sup_{i∈ω} x_{i}, y) < ϵ,
iff d(lim sup_{i∈ω} x_{i}, y) ≤ 0,
iff y ≤ lim sup_{i∈ω} x_{i}. □

Thus, every sequence is convergent with respect to the lower quasi-metric. This merely reflects the fact that every net is convergent in the lower real line, because −∞ is the least limit of any net. The above proposition shows that there is always a greatest limit too.

Given quasi-metrics on sets X and Y, we can define a quasi-metric on the product X × Y by

d(⟨x_{1}, y_{1}⟩ , ⟨x_{2}, y_{2}⟩) = max(d(x_{1}, x_{2}), d(y_{1}, y_{2})).

Then the metric on the product induces the product topology. In particular, the product of the lower and upper quasi-metrics induces a quasi-metric on the product space \underline{ℝ} × \overline{ℝ}. By the above remark, this quasi-metric induces the Scott topology on \underline{ℝ} × \overline{ℝ}. In fact, we have that

d(x, y) = ⨆{ϵ > 0 | x_{ϵ} ⊑ y},

where the partial number

x_{ϵ} = ⟨\underline{x} − ϵ, \overline{x} + ϵ⟩

is the ϵ-degradation of x. Hence the open balls are given by

B_{ϵ}(x) = ↑ ↑x_{ϵ}.

This quasi-metric restricts to the subspaces R^{⋆} and R of the quasi-metric space \underline{ℝ} × \overline{ℝ} (cf. Section 8.4, where R^{⋆} and R are identified with subspaces of \underline{ℝ} × \overline{ℝ}). This quasi-metric on R coincides with the quasi-metric defined by Acióly [Aci91] in a more direct way, and it is also induced by the quasi-metric defined by Edalat [Eda95e] on the upper space of ℝ. Under the identification of real numbers and maximal elements of R, the restriction of the standard quasimetric to the maximal elements is the usual metric on real numbers. Therefore, the limit of a Cauchy sequence of maximal elements w.r.t. the usual metric coincides with the greatest limit w.r.t. the quasi-metric.

The symmetrization of the induced quasi-metric on R is the Hausdorff metric

d(x, y) = max(|\underline{y} − \underline{x}|, |\overline{y} − \overline{x}|).

and therefore it induces the Lawson topology (see Remark 8.1 and Section 8.9).

By the above proposition and its dual, a sequence x_{i} in R^{⋆} converges to y ∈ R^{⋆} iff

y ⊑ [lim inf_{i∈ω} \overline{x_{i}}, lim sup_{i∈ω} \underline{x_{i}}] .

Thus, every sequence x_{i} converges to a least limit [−∞, +∞] and to a greatest limit [lim inf_{i∈ω} \overline{x_{i}}, lim sup_{i∈ω} \underline{x_{i}}]. Steve Vickers [Vic96] has defined a notion of “flat completion” of a quasi-metric space. He also showed (personal communication) that the completion of the rational intervals with respect to the quasi-metric defined above produces the partial real line.

The above metric on R_{⊥} can be extended to R_{⊥} by stipulating that

1. d(⊥, x) = 0

2. d(x, ⊥) = ∞ if x ≠ ⊥.

This coincides with a definition via ϵ-degradations as above if we understand that

⊥_{ϵ} = ⊥.

Now we consider a recursive definition of a limiting operator

lim : R_{⊥}^{ω} → R_{⊥}.

Definition 8.18 Let (X, d) be a quasi-metric space. A fast-converging Cauchy sequence in X is sequence x_{i} such that d(x_{m}, x_{n}) < 2^{−n} for all m ≤ n. □

There is nothing special about the particular sequence 2^{−n}. We could have used the sequence 1/(n + 1) (as it is done in Bishop and Bridges [BB85]), or any other simple sequence of rational numbers converging to zero at a known rate. Notice that a term of a fast-converging Cauchy sequence in R_{⊥} is bottom iff all terms are bottom.

Lemma 8.19 If x_{n} is a fast-converging Cauchy sequence in R_{⊥}, then its greatest limit is given by

\begin{matrix}⨆ & ↑ \\ n \end{matrix}[\underline{x_{n}} − 2^{−n}, \overline{x_{n}} + 2^{−n}].

Proof Immediate consequence of the above observations, noting that the interval [\underline{x_{n}} − 2^{−n}, \overline{x_{n}} + 2^{−n}] is the 2^{−n}-degradation of x_{n}. □

Define a map j : ℝ^{3} → ℝ by

j(x, y, z) = max(x, min(y, z)).

Then, given p ≤ q ∈ ℝ, the map f : ℝ → ℝ defined by

f(x) = j(p, x, q)

is idempotent,

p ≤ f(x) ≤ q,

and

f(x) = x iff p ≤ x ≤ q.

Let ĵ : R_{⊥}^{3} → R_{⊥} be the greatest extension of j : ℝ^{3} → ℝ defined by the formula of Section 2.8:

ĵ(x, y, z) = \begin{matrix}⨆ & ↑ \\ (x,y,x)∈V ∈ΩR_{⊥}^{3} \end{matrix}  ⨅_{(p,q,r)∈(s×s×s)^{−1}(V)} j(p, q, r)

= \begin{matrix}⨆ & ↑ \\ (a,b,c)≪(x,y,x) \end{matrix} ⨅_{(p,q,r)∈a×b×c} j(p, q, r),

where s : ℝ → R_{⊥} is the singleton embedding. Hence, if x and y are non-bottom intervals with \underline{x} ≤ \underline{y} and \overline{x} ≤ \overline{y}, then

j(x, ⊥, y) = [\underline{x}, \overline{y}].

Thus, j is non-strict.

Proposition 8.20 Define a function L : R_{⊥}^{ω} → R_{⊥} by

L(x) = M(0, 1, x)

where M : ω × R_{⊥} × R_{⊥}^{ω} → R_{⊥} is recursively defined by

L(n, ϵ, x) = ĵ(x_{n} − ϵ, M(n + 1, ϵ/2, x), x_{n} + ϵ).

If x ∈ R_{⊥}^{ω} is a fast-converging Cauchy sequence, then L(x) is its greatest limit. Proof (Sketch) M is the least upper bound of the sequence of functions defined by

M_{0}(n, ϵ, x) = ⊥
M_{i+1}(n, ϵ, x) = ĵ(x_{n} − ϵ, M_{i}(n + 1, ϵ/2, x), x_{n} + ϵ).

By induction,

M_{i}(n, ϵ, x) = ⨆_{n≤k<n+i}[\underline{x} − ϵ/2^{n}, \overline{x} + ϵ/2^{n}].

Therefore the result follows from Lemma 8.19. □

Partial real numbers considered as continuous words

This chapter is the basis of the operational semantics of the programming language Real PCF, introduced in Chapter 11 of Part IV. In Section 9.1 we briefly motivate and outline the programme of the following sections by considering discrete words first.

9.1 Discrete words

Consider a (deterministic) device that outputs symbols of a finite alphabet in sequence. We assume that the device can either produce output forever, or else stop producing output after some (possibly none) output has been produced. But we don’t assume that the device gives an indication when it stops producing output. Rather, we assume that the typical reason why the device stops producing output, if it stops at all, is that its internal machinery loops forever, without being able to produce more symbols. Such a device may have been designed, for example, to print the decimal expansion of some real number, giving as many digits as we are patient to wait for.

If the device never stops, its potentially infinite output is represented by an infinite sequence of symbols. Otherwise, its finite output is represented by a finite sequence. The empty sequence represents the situation in which the device fails to produce any output. We refer to a finite or infinite sequence of symbols as a word. Recall that a word x is a prefix of a word y if x is an initial subsequence of y. In this case, if x is infinite then it must be the same as y. If two devices X and Y as above produce outputs respectively x and y such that x is a prefix of y, this means Y produces more output than X. Since the set of words ordered by prefix forms a domain, we can use domain theory in order to account for the external behaviour of such devices.

Now suppose that we are interested in the internal behaviour of such a device, and consider the case when it is specified by a program in a functional programming language. Then there are two main questions: First, what are the primitive operations on words from which we can define more complex operations? Second, how is the functional program interpreted as an algorithm?

The answer to the first question is more or less simple. Let Σ be a finite alphabet, let Σ^{∞} denote the domain of words ordered by prefix, and let σ range over Σ. The primitive operations that one finds in a typical functional programming language with features for infinite word processing are essentially the functions cons_{σ}, tail : Σ^{∞} → Σ^{∞} and head : Σ^{∞} → Σ_{⊥} defined by

cons_{σ}(x) = σx
tail(ϵ) = ϵ
tail(σx) = x
head(ϵ) = ⊥
head(σx) = σ.

By combining these operations with the aid of the conditional and recursion, one can define more complex operations.

In order to answer the second question, suppose that such a complex combination of primitive operations denoting the intended external behaviour of some device is given. As an example, we consider the (not very complex) combination x = cons_{a}(x), where a is some symbol. Since the only word x satisfying this equation is the infinite word aaa ⋯, the device is supposed to repeatedly output the symbol a forever. But how can the device work out the symbols to be printed from an expression as above, in a mechanical fashion? That is, what is the operational semantics of our (informally and imprecisely specified) language? A simple idea is the following. Given an expression e, the device tries to mechanically reduce it to an expression of the form cons_{σ}(e′). Whatever e′ is, the value of the expression cons_{σ}(e′) is some word whose first symbol is σ. Therefore the device can output the symbol σ, and proceed to evaluate the expression e′, repeatedly using the same principle. We can ignore the reduction rules for the conditional and recursion, because they are the same for any data type. The rules specific to our data type can be:

tail(cons_{σ}(x)) → x
tail(e) → tail(e′)  if e → e′
head(cons_{σ}(x)) → σ
head(e) → head(e′)  if e → e′.

In the following sections we introduce similar primitive operations for the partial real line. As opposed to the case of words, it is perhaps not obvious how to combine these primitive operations with the aid of the conditional and recursion in order to obtain more complex operations. We develop some techniques to systematically derive recursive definitions in the next chapter.

9.2 The prefix preorder of a monoid

Recall that a monoid is a set together with a binary associative operation and a neutral element for this operation. It is customary to refer to this operation as multiplication, but in this work it is convenient to refer to it as concatenation.

By a word over an alphabet Σ we mean either a finite word in Σ^{∗} or an infinite word in Σ^{ω}. We denote the set of all words by Σ^{∞}. Usual concatenation of words, with the convention that xy = x if x is infinite, makes Σ^{∞} into a monoid with neutral element the empty word ε.

In any monoid (M, ·, e) we can define a preorder, called its prefix preorder, by x ⊑ z iff xy = z for some y. In this case x is called a prefix of z and y is called a suffix. This relation is reflexive because e is right neutral, and it is transitive because the concatenation operation is associative. It has e as its least element because e is left neutral. Monoid homomorphisms preserve the least element and the prefix preorder, by the very definition of monoid homomorphism. An element x is maximal iff it is left dominant, in the sense that xy = x for every y. The meet of a set, when it exists, is the greatest common prefix of the elements of the set.

The prefix preorder of the monoid Σ^{∞} makes the set Σ^{∞} into a Scott domain [Smy92b]. In particular, the prefix preorder is a partial order; that is, it is antisymmetric. An element of Σ^{∞} is maximal iff it is an infinite word, and it is finite in the domain-theoretic sense iff it is a finite word. The concatenation operation seen as a function Σ^{∞} × Σ^{∞} → Σ^{∞} is not continuous, because it is not even monotone. But it is continuous in its second argument. This can be expressed by saying that left translations x ↦ ax are continuous for all words a.

9.3 Left translations of a monoid

We denote a left translation x ↦ ax of a monoid (M, ·, e) by cons_{a}. Left translations are monotone and cons_{a}(M) = ↑ ↑a, where ↑ ↑a = {x ∈ M|a ⊑ x}. An element a is left-cancelable iff the translation cons_{a} is injective.

If x is left-cancelable and x ⊑ z, we denote the unique y such that xy = z by z\x, so that x(z\x) = z. The basic properties of this (partially defined) quotient operation are:

x\e = x  for all x,
x\x = e  for all left-cancelable x,
(y\x)(z\y) = z\x  for all z and all left-cancelable x, y with x ⊑ y ⊑ z,
(xy)\z = (x\z)y for all x, y and all left-cancelable z with z ⊑ x.

Let a be a left-cancelable element of a monoid M. Then the corestriction of cons_{a} to its image is a bijection between the sets M and ↑ ↑a, with inverse x ↦ x\a. Therefore M is a preordered set isomorphic to the set ↑ ↑a under the inherited order, because cons_{a} is monotone.

The left-cancelable elements of Σ^{∞} are the finite words. It follows that ↑ ↑a is a domain isomorphic to Σ^{∞} for every finite word a. The subsection below shows that the partial unit interval has the same property for every nonmaximal partial number a, for a suitable concatenation operation on partial numbers.

9.4 Concatenation of partial real numbers

Define a binary operation (x, y) ↦ xy on the partial unit interval by

xy = [(\overline{x} − \underline{x})\underline{y} + \underline{x}, (\overline{x} − \underline{x})\overline{y} + \underline{x}].

That is, given x, y ∈ I, rescale and translate the unit interval so that it becomes x, and define xy to be the interval which results from applying the same rescaling and translation to y. Then it is immediate that xy is a subinterval of x. The rescaling factor is the diameter of x, namely \overline{x}−\underline{x}, and the translation constant is the left end-point of x. If x is maximal, then its diameter is zero, so that xy = x. In order to simplify notation, we let κ_{x} stand for the diameter of x and μ_{x} stand for the left end-point of x, so that

x = [μ_{x}, μ_{x} + κ_{x}].

Thus, a left translation cons_{a} : I → I is the canonical extension of the unique increasing affine map [0, 1] → [0, 1] with image a, namely

r ↦ κ_{a}r + μ_{a} : [0, 1] → [0, 1].

Recall that an affine map is a function of the form r ↦ pr + q. Hence, by Convention 8.2, we can write

xy = κ_{x}y + μ_{x}.

Notice that in some cases there can be some ambiguity with the usual notation for multiplication. In these cases we will denote multiplication by ×.

Theorem 9.1 (I, ·, ⊥) is a monoid with the following properties:

1. Its prefix preorder coincides with the information order of the domain I.

2. Its left-cancelable elements are the non-maximal ones.

3. Its left translations preserve all meets and all existing joins. Proof Let x, y, z ∈ I. Then

xy = κ_{x}y + μ_{x} = κ_{x}[μ_{y}, μ_{y} + κ_{y}] + μ_{x} = [κ_{x}μ_{y} + μ_{x}, κ_{x}(μ_{y} + κ_{y}) + μ_{x}].

Hence μ_{xy} = κ_{x}μ_{y} + μ_{x} and κ_{xy} = κ_{x}κ_{y}. Therefore

(xy)z = κ_{xy}z + μ_{xy} = κ_{x}κ_{y}z + κ_{x}μ_{y} + μ_{x} = κ_{x}(κ_{y}z + μ_{y}) + μ_{x} = x(yz).

Now, clearly x⊥ = x, because by definition ⊥ = [0, 1] is rescaled and translated so that it becomes x. Also, ⊥x = x because by definition ⊥ = [0, 1] is rescaled and translated so that it becomes itself; hence ⊥x is the application of the identity to x. Therefore (I, ·, ⊥) is a monoid.

(1) We have already seen that a maximal element is not left-cancelable. The proof of item (2) shows that if x ⊑ z in the information order and x is non-maximal then there is a (unique) y such that xy = z.

(2) A rescaling is reversible iff the rescaling factor is non-zero, a translation is always reversible, and an element has diameter zero iff it is maximal.

(3) The linear map r ↦ κ_{a}r +μ_{a} : [0, 1] → [0, 1] is either an increasing order isomorphisms between [0, 1] and its image (if κ_{x} > 0) or else constant map (if κ_{x} = 0), and the canonical extension of such a function is computed pointwise (cf. Section 8.3). □

Remark 9.2 The fact that a left translation preserves all existing meets does not imply that it has a lower adjoint, which would preserve all joins and hence would be continuous, because I is not a complete lattice, as it lacks a top element [AJ94, GHK^{+}80]. In fact, if cons_{a} had a lower adjoint, it would be given by x ↦ ⨅ cons_{a}^{−1}(↑ ↑x); but cons_{a}^{−1}(↑ ↑x) is empty if x is apart from a, and in this case the meet would be the missing top element. In Section 9.7 we show that if a is non-maximal then cons_{a} has a continuous left inverse tail_{a}, however.

□

The above proof shows that the concatenation operation on partial numbers “multiplies diameters”, in the sense that κ_{xy} = κ_{x}κ_{y}. Therefore κ_{xy} ≤ κ_{x} and κ_{xy} ≤ κ_{y}, the equalities holding iff x = ⊥ or y = ⊥.

Concatenation of partial numbers has the following geometrical and computational interpretations. In a concatenation xy, the interval y refines the information given by x by selecting a subinterval of x. For example, the partial numbers [0, 1], [0, \frac{1}{2}], [\frac{1}{2}, 1], and [\frac{1}{3}, \frac{2}{3}] respectively select the whole interval, the first half, the second half, and the middle third part. Thus, concatenation of partial numbers allows for incremental computation on partial real numbers, also known as lazy evaluation (cf. Proposition 9.4).

There is yet another geometrical interpretation of concatenation, induced by the isomorphism between the partial unit interval and the unit triangle. The upper set of any non-maximal element x of the unit triangle is clearly a triangle, isomorphic to the unit triangle via a rescaling of the unit triangle followed by a translation. Thus, any element y can be interpreted either as an absolute address of a point in the unit triangle or else as a relative address of a point in the smaller triangle generated by x, namely the point xy, obtained by applying the same rescaling and translation to y.

We finish this section with the following lemma:

Lemma 9.3 The bases of the partial unit interval consisting of respectively all non-maximal partial numbers and all non-maximal partial numbers with rational end-points are submonoids of (I, ·, ⊥) closed under existing quotients, in the sense that if b and c are basis elements with b ⊑ c then c\b is a basis element too. Proof Existing quotients are given by

y\x = (y − μ_{x})/κ_{x} = [(\underline{y} − μ_{x})/κ_{x}, (\overline{y} − μ_{x})/κ_{x}].

Therefore, if x and y have distinct (rational) end-points, so does y\x. □

The basis consisting of all non-maximal partial numbers with dyadic endpoints is a submonoid, but it is not closed under existing quotients.

9.5 Infinitely iterated concatenations

Let M be a monoid with a partial prefix order and joins of increasing ω-chains, and let ⟨x_{n}⟩_{n≥1} be a sequence of elements of M. Then we have that

x_{1} ⊑ x_{1}x_{2} ⊑ ⋯ ⊑ x_{1}x_{2} ⋯ x_{n} ⊑ · · · .

The infinitely iterated concatenation of ⟨x_{n}⟩_{n≥1} is defined to be the join of these partial concatenations, informally denoted by x_{1}x_{2} ⋯ x_{n} · · ·. It is also convenient to use the informal notation y_{1} ⊔ y_{2} ⊔ ⋯ ⊔ y_{n} ⊔ ⋯ for the join of a chain y_{1} ⊑ y_{2} ⊑ ⋯ ⊑ y_{n} ⊑ · · ·.

An interval expansion of a partial real number x is a sequence of intervals ⟨x_{n}⟩_{n≥1} such that x = x_{1}x_{2} ⋯ x_{n} · · ·. For example, interval expansions formed from the intervals

[0, \frac{1}{10}] , [\frac{1}{10}, \frac{2}{10}] , …, [\frac{8}{10}, \frac{9}{10}] , [\frac{9}{10}, 1]

are essentially decimal expansions.

If we think of an infinitely iterated concatenation as a computation, the following proposition shows that we can compute in an incremental fashion if left translations are continuous:

Proposition 9.4 (Infinite associativity) Let M be a monoid with infinitely iterated concatenations. Then M satisfies the ω-associativity law

x_{1}(x_{2} ⋯ x_{n} ⋯) = x_{1}x_{2} ⋯ x_{n} ⋯

iff left translations preserve joins of increasing ω-chains. Proof (⇒) Assume that the ω-associativity law holds, let ⟨y_{n}⟩_{n≥1} be an increasing ω-chain of elements of M, and let ⟨x_{n}⟩_{n≥1} be a sequence of elements of M such that y_{n}x_{n} = y_{n+1}. Then the join of the chain is the same as the infinitely iterated concatenation of the sequence ⟨x_{n}⟩_{n≥1} with y_{1} added as a new first element, because y_{1}x_{1}x_{2} ⋯ x_{n} = y_{n}, as an inductive argument shows. Therefore

a(y_{1} ⊔ y_{2} ⊔ ⋯ ⊔ y_{n} ⊔ ⋯) = a(y_{1}x_{1}x_{2} ⋯ x_{n} ⋯)
= ay_{1}x_{1}x_{2} ⋯ x_{n} ⋯
= a ⊔ ay_{1} ⊔ ay_{1}x_{1} ⊔ ⋯ ⊔ ay_{1}x_{1} ⋯ x_{n} ⊔ ⋯
= a ⊔ ay_{1} ⊔ ay_{2} ⊔ ⋯ ⊔ ay_{n} ⊔ ⋯
= ay_{1} ⊔ ay_{2} ⊔ ⋯ ⊔ ay_{n} ⊔ · · · .

(⇐) Assume that left translations preserve joins of increasing ω-chains. Then we have that

x_{1}(x_{2} ⋯ x_{n} ⋯) = x_{1}(x_{2} ⊔ x_{2}x_{3} ⊔ ⋯ ⊔ x_{2}x_{3} ⋯ x_{n} ⊔ ⋯)
= x_{1}x_{2} ⊔ x_{1}x_{2}x_{3} ⊔ ⋯ ⊔ x_{1}x_{2}x_{3} ⋯ x_{n} ⊔ ⋯
= x_{1} ⊔ x_{1}x_{2} ⊔ x_{1}x_{2}x_{3} ⊔ ⋯ ⊔ x_{1}x_{2}x_{3} ⋯ x_{n} ⊔ ⋯
= x_{1}x_{2} ⋯ x_{n} · · · . □

We denote the infinitely iterated concatenation xx ⋯ x ⋯ of a constant sequence with range x by x^{ω}. An immediate consequence of the above proposition is that x^{ω} is the least fixed point of cons_{x} for any monoid with infinite concatenations.

Now let y_{1} ⊑ y_{2} ⊑ ⋯ ⊑ y_{n} ⊑ ⋯ be a chain of left-cancelable elements. Then the sequence y_{1}, y_{2}\y_{1}, y_{3}\y_{2}, …, y_{n+1}\y_{n}, … has the elements of the chain as partial concatenations. Therefore the join of the chain is the same as the infinite concatenation of the induced sequence.

Proposition 9.5 Consider the bases of I consisting of respectively all nonmaximal partial numbers and all non-maximal partial numbers with rational end-points. Then there is a bijection between ω-chains of basis elements and sequences of basis elements, taking any chain to a sequence whose infinitely iterated concatenation is the join of the chain. □

Therefore we can replace ω-chains of basis elements by (arbitrary) sequences of basis elements and work with infinitely iterated concatenations instead of joins.

For monoids with infinitely iterated concatenations, it is natural to ask homomorphisms to preserve them.

Proposition 9.6 A monoid homomorphism preserves infinitely iterated concatenations iff it preserves joins of increasing ω-chains Proof Let h : L → M be a monoid homomorphism between monoids L and M. (⇒) Let ⟨y_{n}⟩_{n≥1} be an increasing ω-chain of elements of L having a join and let ⟨x_{n}⟩_{n≥1} be a sequence of elements of L such that y_{n}x_{n} = y_{n+1}. Then we have that

h(y_{1} ⊔ ⋯ ⊔ y_{n} ⊔ ⋯)
= h(y_{1}x_{1} ⋯ x_{n} ⋯)
= h(y_{1})h(x_{1}) ⋯ h(x_{n}) ⋯
= h(y_{1}) ⊔ h(y_{1})h(x_{1}) ⊔ ⋯ ⊔ h(y_{1})h(x_{1}) ⋯ h(x_{n}) ⊔ ⋯
= h(y_{1}) ⊔ ⋯ ⊔ h(y_{n}) ⊔ · · · .

because h(y_{n})h(x_{n}) = h(y_{n+1}). (⇐) Let ⟨x_{i}⟩_{i≥1} be a sequence of elements of L having an infinitely iterated concatenation. Then we have that

h (x_{1}x_{2} ⋯ x_{n} ⋯) = h (x_{1} ⊔ x_{1}x_{2} ⊔ ⋯ ⊔ x_{1}x_{2} ⋯ x_{n} ⊔ ⋯)
= h(x_{1}) ⊔ h(x_{1}x_{2}) ⊔ ⋯ ⊔ h(x_{1}x_{2} ⋯ x_{n}) ⊔ ⋯
= h(x_{1}) ⊔ h(x_{1})h(x_{2}) ⊔ ⋯ ⊔ h(x_{1})h(x_{2}) ⋯ h(x_{n}) ⊔ ⋯
= h(x_{1})h(x_{2}) ⋯ h(x_{n}) · · · . □

9.6 Partial real numbers considered as continuous words

Concatenation of partial numbers in the partial unit interval generalizes concatenation of words over any finite alphabet, in the following sense:

Proposition 9.7 For every finite n-letter alphabet Σ, the monoid Σ^{∞} is isomorphic to a finitely generated submonoid of I. Moreover, the induced embedding of Σ^{∞} into I is a continuous monoid homomorphism. Proof Without essential loss of generality, we prove the claim for the twoletter case Σ = {0, 2}. Let C be the submonoid of I finitely generated by the partial numbers [0, 1/3] and [2/3, 1]. Then C clearly contains the partial numbers corresponding to the intervals successively produced in the construction of the Cantor set. Hence the joins of strictly increasing ω-chains of elements of C are the elements of the Cantor set. But these joins are the infinitely iterated concatenations of the generators. The set C of finite and infinite concatenations of the generators is also a submonoid of I, which can be considered as the monoid of partial Cantor numbers. It is easy to see that {0, 2}^{∞} is isomorphic to C. We know that {0, 2}^{∗} is the free monoid over {0, 2}. Hence there is a unique monoid homomorphism h : {0, 2}^{∗} → C such that h(0) = [0, 1/3] and h(2) = [2/3, 1]. But h has a unique continuous extension to {0, 2}^{∞}, because monoid homomorphisms are monotone and {0, 2}^{∗} consists of the finite elements (in the domain-theoretic sense) of {0, 2}^{∞}. The resulting extension is a monoid homomorphism. Since it takes an infinite word x to the element of the Cantor set whose ternary expansion is x, it follows that h is a bijection, and therefore a monoid isomorphism.

(For general n, we repeat the above construction for n non-overlapping intervals of the same diameter.) □

Therefore, the elements of the partial unit interval can be considered as “continuous words”. For any word x ∈ Σ^{∞} let length(x) ∈ [0, ∞] denote the length of x defined in the usual way. For any continuous word x ∈ I and any real number b > 1 we define length_{b}(x) ∈ [0, ∞] to be − log_{b}(κ_{x}). Thus, length_{b}(x) = ∞ iff x is maximal, and length_{b}(x) = 0 iff x is bottom.

If a continuous word x is a partial realization of an unknown real number y, then length_{b}(x) is the number of correct digits of an expansion to base b of y that x allows us to know. For example, if we consider x = [0.143, 0.145] as a partial realization of an unknown real number y then length_{10}(x) is roughly 2.7, meaning that x allows us to know two decimal digits of y.

Although it is possible to show that Proposition 9.7 holds even for countably infinite alphabets (by considering countably many non-overlapping intervals), the following proposition holds only for the finite case.

Proposition 9.8 Consider [0, ∞] as a monoid under addition and as a domain under its prefix preorder (which coincides with its natural order).

1. For every real number b > 1, length_{b} : I → [0, ∞] is a continuous monoid homomorphism.

2. Let h be the embedding of the monoid of words over a finite n-letter al-

phabet into I defined in Proposition 9.7. Then length = length_{n+1} ∘ h. Proof Routine verification. The first part follows from the fact that the concatenation operation multiplies diameters and that logarithms take multiplication to addition. □

Corollary 9.9 The infinitely iterated concatenation of a sequence of continuous words is maximal iff the sum of the lengths of the continuous words is ∞. Proof The length function is a continuous monoid homomorphism and a partial number has infinite length iff it is maximal. □

The following proposition allows us to prove some properties of real number programs. We say that a map f : I → I is guarded if there is a real number δ > 0 such that length(f(x)) ≥ length(x) + δ, called a guarding constant for f. Clearly, left translations cons_{a} with a ≠ ⊥ are guarded, with guarding constant length(a).

Proposition 9.10 Any continuous guarded map f : I → I has a maximal partial number as its unique fixed point. Proof Since length(f^{n}(⊥)) ≥ nδ for every n and length is a continuous homomorphism, length (⨆_{n} f^{n}(⊥)) ≥ sup_{n} nδ = ∞. This means that the least fixed point of f is maximal. Therefore it is the unique fixed point of f. □

9.7 Heads and tails of continuous words

The tail map on discrete words removes a prefix of length 1 from its argument, if such a prefix exists. The length 1 plays no distinguished rôle in continuous words, and, moreover, length is not an absolute notion in the case of continuous words as it depends on the choice of a base. Thus, in order to obtain an analogue of the tail map for continuous words, we consider other properties of the tail map on discrete words.

The main property of the tail map on discrete words is that

tail(cons_{σ}(x)) = x.

In fact, it gives rise to the computation rule for tail discussed in Section 9.1. In other words, this property says that tail is a left inverse of cons_{σ} (for every symbol σ). However, it is not hard to see that there is no continuous map tail on continuous words which is a left inverse of cons_{a} for every continuous word a. Nevertheless, it will be enough to consider a continuous left inverse tail_{a} of cons_{a} for each left-cancelable continuous word a. That is, we consider a map tail_{a} which removes the prefix a of its argument, if such a prefix exists:

tail_{a}(ax) = x.

This specification fails to uniquely characterize tail_{a}, because it doesn’t say what tail_{a}(x) should be if x doesn’t have a as a prefix. A naïve attempt would be to let tail_{a}(x) be bottom in this case. But then tail_{a} wouldn’t be continuous, because we would have that tail_{a}(↓ ↓a) = {⊥} as a ⋢ x for all x ≪ a with x ≠ ⊥.

Since the equation tail_{a}(ax) = x means that tail_{a} ∘ cons_{a} = id, we see that tail_{a} is a retraction of cons_{a}.

Proposition 9.11 Let a ∈ I be left-cancelable. The retractions of cons_{a} are the maps tail_{a} of the form

tail_{a}(x) = e_{a}(x)\a,

for e_{a} : I → I a continuous idempotent with image ↑ ↑a. Proof Lemmas 9.12 and 9.13 below. □

Lemma 9.12

1. Let f : D → E be a continuous map such that its corestriction f^{∘} : D → f(D) is an isomorphism. If the inclusion f_{∘} : f(D) → E has a retraction r : E → f(D) then f has a retraction g =^{def} (f^{∘})^{−1} ∘ r, as illustrated in the following diagram:

D ⇆_{f}^{g} E = D ⇆_{f_{∘}}^{(f^{∘})^{−1}} f(D) ⇆_{f^{∘}}^{r} E

2. Any retraction r : E → D of a continuous map s : D → E is uniquely determined by its induced idempotent s ∘ r.

Proof (1) This follows from the fact that for all arrows X ⇆_{r}^{s} Y ⇆_{r′}^{s′} Z of any

category, if r, r′ are retractions of s, s′ respectively then r′ ∘ r is a retraction of s ∘ s′.

(2) Assume that r′ : E → D is a retraction of s with the same induced idempotent, i.e., s∘r′ = s∘r. Since r∘s = id, we conclude that r∘s∘r′ = r∘s∘r and hence r′ = r. □

Lemma 9.13 Let a ∈ I be left-cancelable.

1. If tail_{a} is a retraction of cons_{a} then the induced idempotent cons_{a} ∘ tail_{a} has image ↑ ↑a.

2. Conversely, for every idempotent e_{a} : I → I with image ↑ ↑a, there is a unique retraction tail_{a} of cons_{a} with e_{a} = cons_{a} ∘ tail_{a}, given by

tail_{a}(x) = e_{a}(x)\a

Proof (1) a ⊑ cons_{a}(tail_{a}(x)) by Theorem 9.1, which shows that the image is contained in ↑ ↑a. If a ⊑ x then x = a(x\a) and cons_{a}(tail_{a}(a(x\a))) = cons_{a}(x\a) = x, which establishes the inclusion in the other direction.

(2) x ↦ x\a : ↑ ↑a → I is the inverse of cons_{a} corestricted to its image. Hence tail_{a} is a retraction of cons_{a} by Lemma 9.12(1), because every idempotent factors through its image as a retraction followed by a section. Uniqueness follows from Lemma 9.12(2). □

Recall that join_{a} : I → I constructed in Proposition 8.11 is an idempotent with image ↑ ↑a by virtue of Proposition 7.10.

Definition 9.14 For every left cancelable a ∈ I, we denote by tail_{a} : I → I the unique continuous map such that

tail_{a} ∘ cons_{a} = id  and  cons_{a} ∘ tail_{a} = join_{a}.

That is,

tail_{a}(x) = join_{a}(x)\a.  □

By Proposition 8.11, using the fact that

(max(\underline{a}, min(r, \overline{a})) − μ_{a})/κ_{a} = max(0, min((r − μ_{a})/κ_{a}, 1)),

we see that the map tail_{a} is the canonical extension of the map

r ↦ max(0, min((r − μ_{a})/κ_{a}, 1)).

Remark 9.15 If in the case of discrete words we define tail_{a}(x) = tail^{n}(x), where n is the length of the finite word a, then tail_{a} is a retraction of cons_{a} and the induced idempotent is the unique joining map of a. □

Lemma 9.16 tail_{a} is a multiplicative function. Proof This follows from the fact the tail_{a} is the canonical extension of an increasing continuous function, and any such canonical extension preserves all meets. □

Let h : Σ^{∞} → I be the submonoid embedding defined in Proposition 9.7, for the two-letter alphabet Σ = {0, 2}. If we identify 0 with tt and 2 with ff so that Σ_{⊥} = B, then for every x ∈ Σ^{∞} we have that

head(x) = (h(x)<_{⊥}1/2).

We are thus tempted to define head : I → B by head(x) = (x<_{⊥}1/2). Since the number 1/2 is an accidental feature of our construction of h, and since we don’t want to commit ourselves to this arbitrary choice at this stage, we instead define head_{r} : I → B for each real number r ∈ [0, 1] by

head_{r}(x) = (x<_{⊥}r).

Lemma 9.17 head_{r} is a multiplicative function. Proof Immediate consequence of Lemma 8.10. □

In the next section we show that the generalized versions of the primitive operations on discrete words have simple computation rules. In the next chapter we show how to combine them by means of the (parallel) conditional and recursion in order to obtain more complex operations.

9.8 Computation rules for continuous words

The following lemma shows how to reduce expressions e denoting non-bottom partial numbers to expressions of the form cons_{a}(e′) with a ≠ ⊥. Such an expression is called a head-normal form. The idea is that if an expression e has a head-normal form cons_{a}(e′) then we know that its value is contained in the interval a. Thus, a head-normal form is a partially evaluated expression. A better partial evaluation of e is obtained by partially evaluating e′, obtaining a head-normal form cons_{b}(e′′), and applying rule (1) below to cons_{a}(cons_{b}(e′′)) in order to obtain the more informative head-normal form cons_{ab}(e′′) of e, and so on.

Lemma 9.18 For all non-maximal a, b ∈ I and all x ∈ I,

1. cons_{a}(cons_{b}(x)) = cons_{ab}(x)

2. tail_{a}(cons_{b}(x)) = 0 if b ≤ a

3. tail_{a}(cons_{b}(x)) = 1 if b ≥ a

4. tail_{a}(cons_{b}(x)) = cons_{b\a}(x) if a ⊑ b

5. tail_{a}(cons_{b}(x)) = cons_{(a⊔b)\a}(tail_{(a⊔b)\b}(x)) if a↑ ↑b

6. head_{r}(cons_{a}(x)) = tt if a < r

7. head_{r}(cons_{a}(x)) = ff if a > r

8. pif tt then x else y = x

9. pif ff then x else y = y

10. pif p then cons_{a}(x) else cons_{b}(y) =

cons_{a⊓b}(pif p then cons_{a\(a⊓b)}(x)

else cons_{b\(a⊓b)}(y)).

Proof (1) This is the associativity law expressed in terms of left translations. (2)–(3) Immediate

(4) This is a special case of (5) below. But it is also equivalent to the fact that (bx)\a = (b\a)x.

(5) For all c↑ ↑x, cons_{b}(join_{c}(x)) = cons_{b}(c ⊔ x) = cons_{b}(c) ⊔ cons_{b}(x) = join_{bc}(cons_{b}(x)), because left-translations preserve existing joins. Hence

tail_{a}(cons_{b}(x)) = join_{a}(cons_{b}(x))\a = join_{a⊔b}(cons_{b}(x))\a
= join_{b((a⊔b)\b)}(cons_{b}(x))\a = cons_{b}(join_{(a⊔b)\b}(x))\a
= cons_{b}(cons_{(a⊔b)\b}(tail_{(a⊔b)\b}(x)))\a
= cons_{a⊔b}(tail_{(a⊔b)\b}(x))\a = cons_{(a⊔b)\a}(tail_{(a⊔b)\b}(x)).

The second step follows from the fact that join_{a}(y) = join_{a⊔b}(y) if a↑ ↑b and b ⊑ y. The last step follows from the fact that (cy)\a = (c\a)y.

(6–9) Immediate. (10) It suffices to show that

cons_{a}(x) ⊓ cons_{b}(y) = cons_{a⊓b}(cons_{a\(a⊓b)}(x) ⊓ cons_{b\(a⊓b)}(y)).

Since left translations preserve meets and a = c(a\c) for all c ⊑ a, the result follows by taking c = a ⊓ b. □

9.9 The partial unit interval acting on the partial real line

In this section we extend the results of the previous subsections from the partial unit interval to the partial real line.

The concatenation operation

xy = κ_{x}y + μ_{x},

originally defined for x and y in the partial unit interval, makes sense for x and y ranging over the partial real line. With this extension, R becomes a monoid too. But its prefix preorder does not coincide with its information order, and it is due to this reason that we initially restricted ourselves to the partial unit interval. In fact, if y = ax this does not mean that y is contained in a. However, if we know that x is in the partial unit interval then y = ax does imply that y is contained in a, even if y is not in the partial unit interval. This is the content of the following theorem.

Theorem 9.19 The map (x, y) ↦ xy : R × I → R is a (right) action of the monoid (I, ·, ⊥) on the monoid (R, ·, [0, 1]), inducing the information order of R:

1. For all x ∈ R and all y, z ∈ I, x⊥ = x and (xy)z = x(yz).

2. For all x, z ∈ R, x ⊑ z iff xy = z for some y ∈ I, such a y being unique iff x is non-maximal.

Moreover, for all a ∈ R, the map ricons_{a} : I → R_{⊥} defined by ricons_{a}(x) = ax preserves all meets and all existing joins. □

Given x, z ∈ R with x ⊑ z and x non-maximal, denote the unique y ∈ I such that xy = z by z\x.

For each non-maximal a ∈ R, define a strict continuous map irtail_{a} : R_{⊥} → I as in Definition 9.14 so that for all non-maximal a ∈ R, the maps ricons_{a} and irtail_{a} form a section-retraction pair, with join_{a} as the induced idempotent, and

irtail_{a}(x) = x\a if a ⊑ x.

Finally, for each non-maximal a ∈ R define a strict continuous map rrcons_{a} : R_{⊥} → R_{⊥} by

rrcons_{a}(x) = ax.

Thus, I is a retract of R_{⊥}, in many ways. In particular, 1. ricons_{[0,1]} : I → R_{⊥} is the inclusion,

2. irtail_{[0,1]} : R_{⊥} → I is a “truncated projection”, and

3. join_{[0,1]} : R_{⊥} → R_{⊥} is the coextension of the truncated projection. The head-normal forms for R_{⊥} are taken as the expressions of the form

ricons_{a}(e). Lemma 9.20 For all non-maximal a ∈ R and b ∈ I, and all x ∈ I,

1. (a) rrcons_{a}(rrcons_{b}(x)) = rrcons_{ab}(x)

(b) rrcons_{a}(ricons_{b}(x)) = ricons_{ab}(x)

(c) ricons_{a}(cons_{b}(x)) = ricons_{ab}(x)

2. irtail_{a}(ricons_{b}(x)) = 0 if b ≤ a

3. irtail_{a}(ricons_{b}(x)) = 1 if b ≥ a

4. irtail_{a}(ricons_{b}(x)) = cons_{b\a}(x) if a ⊑ b

5. irtail_{a}(ricons_{b}(x)) = cons_{(a⊔b)\a}(tail_{(a⊔b)\b}(x)) if a↑ ↑b

6. rhead_{r}(ricons_{a}(x)) = tt if a < r

7. rhead_{r}(ricons_{a}(x)) = ff if a > r

8. pif tt then x else y = x

9. pif ff then x else y = y

10. pif p then ricons_{a}(x) else ricons_{b}(y) =

ricons_{a⊓b}(pif p then ricons_{a\(a⊓b)}(x)

else ricons_{b\(a⊓b)}(y)),

where the parallel conditional, the comparison map, and the head map for R_{⊥} are defined in the same way as for I. Notice that the above lemma is Lemma 9.18 with “r” and “i” inserted in appropriate places.

Induction and recursion on the partial real line

At this point, it is possible to proceed directly to Chapter 11 of Part IV, which introduces Real PCF. This chapter has Chapter 5 of Part II as a prerequisite. It introduces recursion on the real line, a technique which can be used to derive Real PCF programs. This technique is used in Chapter 12 of Part IV in order to respectively establish existence of a unique sound effective presentation of the partial real line, up to equivalence, and computational completeness of Real PCF (cf. Section 1.1). Several examples of recursive definitions given in the present chapter immediately give rise to Real PCF programs for computing the recursively defined entities. Thus, this chapter is implicitly about programming in Real PCF.

In Section 10.1 we characterize the partial unit interval by axioms similar to the so-called Peano axioms for natural numbers. In Section 10.2 we introduce structural recursion for the partial unit interval. In Section 10.3 we generalize binary expansions of real numbers to what we call bifurcated binary expansions of partial real numbers; this material is needed in Chapter 12 of Part IV. In Section 10.4 we briefly discuss coinduction on the partial unit interval. In Section 10.5 we briefly introduce structural recursion on the partial real line. Finally, in Section 10.6 we give some examples of recursive definitions (in addition to those given in Section 10.3).

10.1 Peano-like axioms for the partial unit interval

Recall that cons_{L}, cons_{R} : I → I are defined by

cons_{L}(x) = x/2 cons_{R}(x) = (x + 1)/2.

and that these are the unique increasing affine maps such that

cons_{L}(⊥) = L cons_{R}(⊥) = R,

where

L = [0, 1/2] R = [1/2, 1].

In this section we consider cons_{L} and cons_{R} as partial real number “constructors”, in a similar fashion as zero and successor are considered as natural number constructors. A main difference is that the natural numbers together with zero and successor form a free algebra, whereas I together with cons_{L} and cons_{R} will form a kind of quotient of a bifree algebra with respect to some equations. The main such equation is

cons_{L}(1) = cons_{R}(0),

which simply means that 1/2 = (0 + 1)/2.

Another main difference is that natural numbers are constructed from zero by finitely many applications of the successor function, whereas elements of I are constructed “from nothing” by infinitely many applications of cons_{L} and cons_{R}. This observation will be made precise in the development that follows. For the moment, we remark that 0 and 1 are constructed by infinitely many applications of cons_{L} and cons_{R} in the sense that:

0 = \begin{matrix}⨆ & ↑ \\ n \end{matrix} cons_{L}^{n}(⊥) and 1 = \begin{matrix}⨆ & ↑ \\ n \end{matrix} cons_{R}^{n}(⊥).

In fact, 0 and 1 are the unique fixed points of cons_{L} and cons_{R} respectively: cons_{L}(x) = x iff x/2 = x iff x = 0, and cons_{R}(y) = y iff (y + 1)/2 = y iff y = 1. More generally, every total x ∈ I can be written in the form

x = \begin{matrix}⨆ & ↑ \\ n \end{matrix} cons_{a_{1}} ∘ ⋯ ∘ cons_{a_{n}}(⊥)

for some sequence a_{i} ∈ {L, R}, corresponding to a binary expansion of x. Partial real numbers are obtained by iterating cons_{L} and cons_{R} in a more complicated way (see Section 10.3 below).

Pursuing our analogy with natural numbers, we now observe that every natural number is either zero or else the successor of a unique number.

Lemma 10.1 For every x ∈ I,

1. if x ≤ 1/2 then x = cons_{L}(y) for a unique y,

2. if x ≥ 1/2 then x = cons_{R}(z) for a unique z,

3. if x ↑ ↑ 1/2 then x = cons_{L}(y) ⊓ cons_{R}(z) for unique y ⊑ 1 and z ⊑ 0.

Notice that x↑ ↑1/2 iff x ⊑ 1/2, because 1/2 is maximal. Proof (1): cons_{L} is bijective onto its image. Hence there is at most one y with x = cons_{L}(y). The image of cons_{L} is ↑ ↑L by definition. But x ≤ 1/2 iff L ⊑ x. (2): Similar. (3): In this case 1/2 ∈ x. Hence x = [\underline{x}, 1/2] ⊓ [1/2, \overline{x}] = cons_{L}([2\underline{x}, 1]) ⊓ cons_{L}([0, 2\overline{x} − 1]). □

The fact that every number is either zero or a successor can be expressed by the equation

n = if n = 0 then 0 else succ(pred(n)).

where

pred(0) = 0 (say)  and  pred(succ(n)) = n.

Recall that in Section 9.7 we defined maps tail_{a} : I → I for a ∈ I non-maximal, and maps head_{r} : I → B for r ∈ [0, 1]. For notational simplicity we write

head = head_{1/2}.

Lemma 10.2

tail_{L}(cons_{L}(x)) = x  tail_{R}(cons_{L}(x)) = 0
tail_{L}(cons_{R}(y)) = 1  tail_{R}(cons_{R}(y)) = y
tail_{L}(cons_{L}(x) ⊓ cons_{R}(y)) = x ⊓ 1 tail_{R}(cons_{L}(x) ⊓ cons_{R}(y)) = 0 ⊓ y,
head ∘ cons_{L}(x) ⊑ tt head ∘ cons_{L}(x) = ⊥ iff x ⊑ 1
head ∘ cons_{R}(y) ⊑ ff  head ∘ cons_{R}(y) = ⊥ iff y ⊑ 0
x = pif head(x) then cons_{L}(tail_{L}(x)) else cons_{R}(tail_{R}(x)).

Proof Routine verification, included for the sake of completeness. The equation tail_{a} ∘ cons_{a} = id holds by construction. By definition,

tail_{a}(x) = join_{a}(x)\a = max(0, min((x−μ_{a})/κ_{a}, 1)) = max(0, min((x−\underline{a})/(\overline{a}−\underline{a}), 1)).

Hence

tail_{L}(x) = max(0, min((x − 0)/(1/2), 1)) = max(0, min(2x, 1)) = min(2x, 1),
tail_{R}(x) = max(0, min((x − 1/2)/(1/2), 1)) = max(0, min(2x − 1, 1)) = max(0, 2x − 1),

because x lies in the unit interval. Hence

tail_{L}(cons_{R}(y)) = min(2((y + 1)/2), 1) = min(y + 1, 1) = 1
tail_{R}(cons_{L}(x)) = max(0, 2(x/2) − 1) = max(0, x − 1) = 0.

Since for all p, q ∈ [0, 1] we have that p/2 ≤ (q+1)/2, as p/2 ∈ L and (q+1)/2 ∈ R, it follows that

cons_{L}(x) ⊓ cons_{R}(y) = [\underline{x}/2, \overline{x}/2] ⊓ [(\underline{y} + 1)/2, (\overline{y} + 1)/2] = [\underline{x}/2, (\overline{y} + 1)/2].

Hence

tail_{L}(cons_{L}(x) ⊓ cons_{R}(y)) = tail_{L}([\underline{x}/2, (\overline{y} + 1)/2]) = [\underline{x}, 1] = x ⊓ 1.

Similarly, tail_{R}(cons_{L}(x) ⊓ cons_{R}(y)) = 0 ⊓ y. The statements about head follow from the fact that head(x) = (x<_{⊥}1/2) by definition, cons_{L}(x) ≤ 1/2, and cons_{L}(x) < 1/2 iff x/2 < 1/2 iff x < 1 iff x ⋢ 1. Similarly, cons_{R}(x) ≥ 1/2, and cons_{R}(y) < 1/2 iff y ⋢ 0. For the last equation, only the case head(x) = ⊥ is not immediate. In this case x↑ ↑1/2, which is equivalent to x ⊑ 1/2 as 1/2 is maximal and means that 1/2 ∈ x. Hence

x = [\underline{x}, 1/2] ⊓ [1/2, \overline{x}]
= ([0, 1/2] ⊔ [\underline{x}, \overline{x}]) ⊓ ([1/2, 1] ⊔ [\underline{x}, \overline{x}])
= join_{L}(x) ⊓ join_{R}(x)
= cons_{L}(join_{L}(x)\L) ⊓ cons_{R}(join_{R}(x)\R)
= cons_{L}(tail_{L}(x)) ⊓ cons_{R}(tail_{R}(x))
= pif head(x) then cons_{L}(tail_{L}(x)) else cons_{R}(tail_{R}(x)). □

Given a set X, an element x ∈ X, and a function g : ℕ → X, there is a unique function f : ℕ → X such that f(0) = x and f(n + 1) = g(n). A similar fact holds for I equipped with cons_{L} and cons_{R}, but we have to take into account the equation cons_{L}(0) = cons_{R}(1).

Lemma 10.3 (Definition by cases) Let D be a bounded complete domain and g_{L}, g_{R} : I → D be continuous maps such that

g_{L}(1) = g_{R}(0).

Then there is a unique continuous map f : I → D such that

f(cons_{L}(x)) = g_{L}(x)
f(cons_{R}(y)) = g_{R}(y)
f(cons_{L}(x) ⊓ cons_{R}(y)) = g_{L}(x) ⊓ g_{L}(y)  for x ⊑ 1 and y ⊑ 0,

namely the function f defined by

f(x) = pif head(x) then g_{L}(tail_{L}(x)) else g_{R}(tail_{R}(x)).

Proof It is clear from Lemma 10.1 that there is at most one such function. We show that f as defined above is such a function. If x ⋢ 1 then head(cons_{L}(x)) = tt and

f(cons_{L}(x)) = g_{L}(tail_{L}(cons_{L}(x))) = g_{L}(x).

Otherwise head(cons_{L}(x)) = ⊥ and

f(cons_{L}(x)) = g_{L}(tail_{L}(cons_{L}(x))) ⊓ g_{R}(tail_{R}(cons_{L}(x)))
= g_{L}(x) ⊓ g_{R}(0) = g_{L}(x) ⊓ g_{L}(1) = g_{L}(x),

because g_{L}(x) ⊑ g_{L}(1), by monotonicity. Similarly, a case analysis on y shows that f(cons_{R}(y)) = g_{R}(y). Assume that x ⊑ 1 and y ⊑ 0. Then

f(cons_{L}(x) ⊓ cons_{R}(y))
= g_{L}(tail_{L}(cons_{L}(x) ⊓ cons_{R}(y))) ⊓ g_{R}(tail_{R}(cons_{L}(x) ⊓ cons_{R}(y)))
= g_{L}(x ⊓ 1) ⊓ g_{R}(0 ⊓ y) = g_{L}(x) ⊓ g_{R}(y),

which concludes the proof. □

Remark 10.4 Definition by cases is the same as path composition as defined in Example 8.15. □

The natural numbers enjoy an induction principle, which can be expressed by saying that if a set of natural numbers contains zero and is closed under the successor operation, then it contains all natural numbers. A similar principle is enjoyed by the partial unit interval endowed with the operations cons_{L} and cons_{R}.

Definition 10.5 Let D be a domain. A set A ⊆ D is called inductive if it closed under the formation of least upper bounds of directed subsets; that is, if X ⊆ A for X directed implies ^{⨆↑} X ∈ A. □

Lemma 10.6 (Dyadic induction)

Let A ⊆ I be inductive, and assume that the following conditions hold:

1. (Base case) ⊥ ∈ A.

2. (Inductive step) x ∈ A and y ∈ A together imply

(a) cons_{L}(x) ∈ A,

(b) cons_{R}(y) ∈ A,

(c) cons_{L}(x) ⊓ cons_{R}(y) ∈ A if x ⊑ 1 and y ⊑ 0.

Then A = I. Proof Let B be the basis of I consisting of intervals with distinct dyadic end-points. In order to show that A = I, it suffices to conclude that B ⊆ A, because B is a basis of I. But since

B = ⋃_{n} B_{n}, where B_{n} = {[l/2^{n}, m/2^{n}]|0 ≤ l < m ≤ 2^{n}},

it suffices to show that B_{n} ⊆ A for all n by induction on n. For n = 0 this is immediate because B_{0} = {⊥} and ⊥ ∈ A by hypothesis. Assume that B_{n} ⊆ A, and define

L_{n} = cons_{L}(B_{n}),
R_{n} = cons_{R}(B_{n}),
C_{n} = {cons_{L}(x) ⊓ cons_{R}(y)|x, y ∈ B_{n} ∧ x ⊑ 1 ∧ y ⊑ 0}.

Then L_{n} ⊆ cons_{L}(A) ⊆ A because x ∈ A implies cons_{L}(x) ∈ A by hypothesis.

Similarly, R_{n} ⊆ A and C_{n} ⊆ A. Hence L_{n} ∪ R_{n} ∪ C_{n} ⊆ A. But

L_{n} ∪ R_{n} ∪ C_{n}

= \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 0 ≤ l < m ≤ 2^{n}\} ∪ \{[\frac{l + 2^{n}}{2^{n+1}} , \frac{m + 2^{n}}{2^{n+1}} ]| 0 ≤ l < m ≤ 2^{n}\}
∪ \{[\frac{l}{2^{n+1}} , \frac{1}{2}] ⊓ [\frac{1}{2}, \frac{m + 2^{n}}{2^{n+1}} ]| 0 ≤ l < 2^{n} ∧ 0 < m ≤ 2^{n}\}
= \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 0 ≤ l < m ≤ 2^{n}\} ∪ \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 2^{n} ≤ l < m ≤ 2^{n+1}\}
∪ \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 0 ≤ l < 2^{n} < m ≤ 2^{n+1}\}
= \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 0 ≤ l < m ≤ 2^{n}∨2^{n} ≤ l < m ≤ 2^{n+1}∨0 ≤ l < 2^{n} < m ≤ 2^{n+1}\}
= \{[\frac{l}{2^{n+1}} , \frac{m}{2^{n+1}} ]| 0 ≤ l < m ≤ 2^{n+1}\}
= B_{n+1}.

Therefore B_{n+1} ⊆ A, which concludes the inductive argument. □

Corollary 10.7 Let D be a domain and f, g : I → D be continuous maps. In order to show that f = g it suffices to show that the following conditions hold:

1. (Base case) f(⊥) = g(⊥).

2. (Inductive step) f(x) = g(x) and f(y) = g(y) together imply

(a) f(cons_{L}(x)) = g(cons_{L}(x)),

(b) f(cons_{R}(y)) = g(cons_{R}(y)),

(c) f(cons_{L}(x)⊓cons_{R}(y)) = g(cons_{L}(x)⊓cons_{R}(y)) if x ⊑ 1 and y ⊑ 0. Proof If f and g are continuous, then the set A = {x|f(x) = g(x)} is inductive. □

Remark 10.8 If we omit condition (c) of the inductive step, then in Lemma 10.6 we conclude that Max I ⊆ A, and in Corollary 10.7 we conclude that f_{|Max I} = g_{|Max I}. A slight reformulation of Corollary 10.7 in these lines may be useful to prove that a continuous function f̄: I → I is an extension of a continuous function f : [0, 1] → [0, 1], but not necessarily the canonical extension of f. □

Lemma 10.9 Let D be a bounded complete domain, g_{L}, g_{R} : D → D be continuous maps, and f : I → D be a continuous solution to the functional equation

f(x) = pif head(x) then g_{L}(f(tail_{L}(x))) else g_{R}(f(tail_{R}(x))).

Then the following statements hold:

1. f(0), f(1) and f(⊥) are fixed points of g_{L}, g_{R} and g_{L} ⊓ g_{R} respectively.

2. f is uniquely determined by the values that it assumes at 0, 1, and ⊥.

3. f is the least solution iff

f(0) = fix g_{L}  f(1) = fix g_{R}  f(⊥) = fix (g_{L} ⊓ g_{R}).

4. In particular, if g_{L}, g_{R}, and g_{L} ⊓ g_{R} have unique fixed points then f is the

unique solution. Proof (1): f(0) = g_{L}(f(0)) because head(0) = tt and tail_{L}(0) = 0. Similarly, f(1) = g_{R}(f(1)). Since head(⊥) = ⊥ and tail_{L}(⊥) = tail_{R}(⊥), we have that f(⊥) = g_{L}(f(⊥)) ⊓ g_{R}(f(⊥)) = (g_{L} ⊓ g_{R})(f(⊥)).

(2): We show by dyadic induction as in Corollary 10.7 that if f′ is a continuous solution agreeing with f at 0, 1 and ⊥ then f = f′. (Base case): By hypothesis. (Inductive step): Assume that f(x) = f′(x) and f(y) = f′(y). If head ∘ cons_{L}(x) = tt then

f(cons_{L}(x)) = g_{L}(f(tail_{L}(cons_{L}(x)))) = g_{L}(f(x))
= g_{L}(f′(x)) = g_{L}(f′(tail_{L}(cons_{L}(x)))) = f′(cons_{L}(x)).

Otherwise head(cons_{L}(x)) = ⊥ and x ⊑ 1. Therefore,

f(cons_{L}(x)) = g_{L}(f(tail_{L}(cons_{L}(x)))) ⊓ g_{R}(f(tail_{R}(cons_{L}(x))))
= g_{L}(f(x)) ⊓ g_{R}(f(0)) = g_{L}(f′(x)) ⊓ g_{R}(f′(0))
= g_{L}(f′(tail_{L}(cons_{L}(x)))) ⊓ g_{R}(f′(tail_{R}(cons_{L}(x))))
= f′(cons_{L}(x)).

Similarly, a case analysis on head∘cons_{R}(y) shows that f(cons_{R}(y)) = f′(cons_{R}(y)). Assume that x ⊑ 1 and y ⊑ 0. Then

f(cons_{L}(x) ⊓ cons_{R}(y))

= g_{L}(f(tail_{L}(cons_{L}(x) ⊓ cons_{R}(y)))) ⊓ g_{R}(f(tail_{R}(cons_{L}(x) ⊓ cons_{R}(y))))
= g_{L}(f(x ⊓ 1)) ⊓ g_{R}(f(0 ⊓ y)) = g_{L}(f(x)) ⊓ g_{R}(f(y))
= g_{L}(f′(x)) ⊓ g_{R}(f′(y)) = g_{L}(f′(x ⊓ 1)) ⊓ g_{R}(f′(0 ⊓ y))
= g_{L}(f′(tail_{L}(cons_{L}(x) ⊓ cons_{R}(y)))) ⊓ g_{R}(f′(tail_{R}(cons_{L}(x) ⊓ cons_{R}(y))))
= f′(cons_{L}(x) ⊓ cons_{R}(y)).

(3): In view of (1) and (2), it suffices to show that if f is the least solution then it satisfies the condition. Assume that f is the least solution. Then f = ^{⨆↑}_{n} f_{n} where

f_{0}(x) = ⊥
f_{n+1}(x) = pif head(x) then g_{L}(f_{n}(tail_{L}(x))) else g_{R}(f_{n}(tail_{R}(x))).

But f_{n}(0) = g_{L}^{n}(⊥) because head(0) = tt and tail_{L}(0) = 0. Hence f(0) = fix g_{L}. Similarly, f(1) = fix g_{R}. Also, f_{n+1}(⊥) = (g_{L} ⊓ g_{R})^{n}(⊥), because

f_{n+1}(⊥) = g_{L}(f_{n}(⊥)) ⊓ g_{R}(f_{n}(⊥)) = (g_{L} ⊓ g_{R})(f_{n}(⊥)).

Therefore f(⊥) = fix (g_{L} ⊓ g_{R}).

(4): Immediate consequence of (1), (2) and (3) above. □

We can define functions on natural numbers by iteration. If X is a set, x is an element of X, and g : X → X is a function, then there is a unique function f : ℕ → X such that f(0) = x and f(n + 1) = g(f(n)). A similar fact holds for the partial unit interval equipped with cons_{L} and cons_{L}.

Lemma 10.10 (Dyadic recursion) Let D be a bounded complete domain, and g_{L}, g_{R} : D → D be continuous maps such that

g_{L}(fix g_{R}) = g_{R}(fix g_{L}).

Then there is a unique continuous map f : I → D satisfying the equations

(Base case)

f(0) = fix g_{L}
f(1) = fix g_{R}
f(⊥) = fix (g_{L} ⊓ g_{R})

(Recursion step)

f(cons_{L}(x)) = g_{L}(f(x))
f(cons_{R}(y)) = g_{R}(f(y))
f(cons_{R}(x) ⊓ cons_{R}(y)) = g_{L}(f(x)) ⊓ g_{R}(f(y))  if x ⊑ 1 and y ⊑ 0,

namely the least continuous solution to the equation

f(x) = pif head(x) then g_{L}(f(tail_{L}(x))) else g_{R}(f(tail_{R}(x))).

Proof Define F : (I ⇒ D) → (I ⇒ D) by

F (f)(x) = pif head(x) then g_{L}(f(tail_{L}(x))) else g_{R}(f(tail_{R}(x))),

and let f : I → D be a continuous map satisfying the base case. By Lemma 10.9, it suffices to show that f satisfies the recursion step iff f = F (f). But, by Lemma 10.3, this is equivalent to show that

F (f)(cons_{L}(x)) = g_{L}(f(x))
F (f)(cons_{R}(y)) = g_{R}(f(y))
F (f)(cons_{R}(x) ⊓ cons_{R}(y)) = g_{L}(f(x)) ⊓ g_{R}(f(y))  if x ⊑ 1 and y ⊑ 0.

In fact, assuming that these equations hold, if f = F (f) then f satisfies the recursion step; and, conversely, if f satisfies the recursion step both f and F (f) satisfy the same definition by cases, and therefore they have to be the same by Lemma 10.3. If x ⋢ 1 then head(cons_{L}(x)) = tt and

F (f)(cons_{L}(x)) = g_{L}(f(tail_{L}(cons_{L}(x)))) = g_{L}(f(x)).

Otherwise head(cons_{L}(x)) = ⊥ and

F (f)(cons_{L}(x)) = g_{L}(f(tail_{L}(cons_{L}(x)))) ⊓ g_{R}(f(tail_{R}(cons_{L}(x))))
= g_{L}(f(x)) ⊓ g_{R}(f(0)) = g_{L}(f(x)) ⊓ g_{R}(fix g_{L})
= g_{L}(f(x)) ⊓ g_{L}(fix g_{R}) = g_{L}(f(x)) ⊓ g_{L}(f(1))
= g_{L}(f(x)),

because g_{L}(f(x)) ⊑ g_{L}(f(1)), by monotonicity. Similarly, a case analysis on y shows that F (f)(cons_{R}(y)) = g_{R}(f(y)). Assume that x ⊑ 1 and y ⊑ 0. Then

F (f)(cons_{L}(x) ⊓ cons_{R}(y))

= g_{L}(f(tail_{L}(cons_{L}(x) ⊓ cons_{R}(y)))) ⊓ g_{R}(f(tail_{R}(cons_{L}(x) ⊓ cons_{R}(y))))
= g_{L}(f(x ⊓ 1)) ⊓ g_{R}(f(0 ⊓ y)) = g_{L}(f(x)) ⊓ g_{R}(f(y)),

which concludes the proof. □

Finally, the set of natural numbers is uniquely specified, up to isomorphism, by the so called Peano axioms, which are essentially the properties that we informally considered above for the sake of motivation. This idea is made formal in e.g. Stoll [Sto66], where unary systems are used as a tool (a unary system is a set X together with an element x ∈ X and a function s : X → X).

In the following definition, the domain D generalizes the partial unit interval and the maps a_{L} and a_{R} generalize the maps cons_{L} and cons_{R} respectively.

Definition 10.11 A binary system is a bounded complete domain D equipped with a pair of continuous maps a_{L}, a_{R} : D → D such that

a_{L}(1) = a_{R}(0),

where

0 = fix a_{L} 1 = fix a_{R}.

We also impose the technical condition

fix (a_{L} ⊓ a_{R}) = ⊥,

which ensures that homomorphisms defined below, as Lemma 10.10 suggests, make binary systems into a category under ordinary function composition.

A homomorphism from a binary system (D, a_{L}, a_{R}) to a binary system (E, b_{L}, b_{R}) is a continuous map f : D → E such that

f(0) = 0
f(1) = 1
f(⊥) = ⊥
f(a_{L}(x)) = b_{L}(f(x))
f(a_{R}(y)) = b_{R}(f(y))
f(a_{L}(x) ⊓ a_{R}(y)) = b_{L}(f(x)) ⊓ b_{R}(f(y))  if x ⊑ 1 and y ⊑ 0. □

Binary systems were introduced and investigated in the context of uniform spaces in the extended abstract [Esc94], which contains some mistakes.

Remark 10.12 Recall that an iterated function system (IFS) [Hut81] consists of a complete metric space X together with a finite list of contracting maps f_{1}, …, f_{n} : X → X. Several generalizations of this concept have been introduced and investigated. Hayaschi [Hay85] has investigated the case where X is a compact Hausdorff space. Edalat [Eda95e, Eda96a] has investigated the case where X is the upper space of a complete metric space. In this generalized setting, a binary system is an IFS. Moreover, the notion of homomorphism between binary systems coincides with the notion of conjugacy of IFS’s investigated in Devaney [Dev89]. □

Lemma 10.10 can be formulated as

Theorem 10.13 (I, cons_{L}, cons_{R}) is an initial object in the category of binary systems.

Compare the following lemma to Lemmas 10.2 and 10.3, were c_{L}, c_{R}, h, t_{L}, t_{R} play the rôle of cons_{L}, cons_{R}, head, tail_{L}, and tail_{R} respectively:

Lemma 10.14 Let D = (D, c_{L}, c_{R}) be a binary system. Then there is at most one triple of continuous maps h : D → B and t_{L}, t_{R} : D → D such that

\begin{aligned}t_{L}(c_{L}(x)) & = & x & t_{R}(c_{L}(x)) & = & 0 \\ t_{L}(c_{R}(y)) & = & 1 & t_{R}(c_{R}(y)) & = & y \\ t_{L}(c_{L}(x) ⊓ c_{R}(y)) & = & x ⊓ 1 & t_{R}(c_{L}(x) ⊓ c_{R}(y)) & = & 0 ⊓ y \end{aligned}

\begin{aligned}h(c_{L}(x)) & ⊑ & tt, & h(c_{L}(x)) & = & ⊥ & iff x ⊑ 1 \\ h(c_{R}(y)) & ⊑ & ff, & h(c_{R}(y)) & = & ⊥ & iff y ⊑ 0 \end{aligned}

x = pif h(x) then c_{L}(t_{L}(x)) else c_{R}(t_{R}(x)).

Moreover, in this case D admits definition by cases, in the sense that for each bounded complete domain E and each pair of continuous maps g_{L}, g_{L} : D → E with

g_{L}(1) = g_{R}(0)

there is a unique map f : D → E such that

f(c_{L}(x)) = g_{L}(x)
f(c_{R}(y)) = g_{R}(y)
f(c_{R}(x) ⊓ c_{L}(y)) = g_{L}(x) ⊓ g_{R}(y)  if x ⊑ 1 and y ⊑ 0

Proof Assume that such maps exist. Claim: For every x ∈ I,

1. if h(x) = tt then x = c_{L}(y) for a unique y,

2. if h(x) = ff then x = c_{R}(z) for a unique z,

3. if h(x) = ⊥ then x = c_{L}(y) ⊓ c_{R}(z) for unique y ⊑ 1 and z ⊑ 0.

(1): There is at most one such y because t_{L} is a left inverse of c_{L}. Since

x = pif tt then c_{L}(t_{L}(x)) else c_{R}(t_{R}(x)) = c_{L}(t_{L}(x)),

We can take y = t_{L}(x). (2): Similar. (3): (Uniqueness) Assume that c_{L}(y) ⊓ c_{R}(z) = c_{L}(y′) ⊓ c_{R}(z′) for y, y′ ⊑ 1 and z, z′ ⊑ 0. Then, by applying t_{L} to both sides, we obtain y ⊓ 1 = y′ ⊓ 1. But y ⊓ 1 = y and y′ ⊓ 1 = y′. Therefore y = y′. Similarly, z = z′. (Existence):

x = pif ⊥ then c_{L}(t_{L}(x)) else c_{R}(t_{R}(x)) = c_{L}(t_{L}(x) ⊓ c_{R}(t_{R}(x))).

Hence t_{L}(x) = t_{L}(x) ⊓ 1 and t_{R}(x) = 0 ⊓ t_{R}(x). We can thus let y = t_{L}(x) and z = t_{R}(x), and the proof of the claim is concluded.

It follows that there is at most one f satisfying the definition-by-cases scheme. Therefore there is at most one triple of maps as specified above, because t_{L} and t_{R} satisfy the definition-by-cases scheme, and h is completely specified by the above clauses by virtue of the claim (the inequality h(c_{L}(x)⊓c_{R}(y)) ⊑ ⊥ holds by monotonicity). Finally, a function f satisfying the definition-by-cases scheme can be constructed as in Lemma 10.3, because it only uses the abstract properties of cons_{L}, cons_{R}, head, tail_{L}, and tail_{R} considered in the statement of the present lemma (and proved in Lemma 10.2). □

Definition 10.15 If such maps exist, then they are called the destructors of (D, c_{L}, c_{R}). □

Definition 10.16 A binary system (D, c_{L}, c_{R}) satisfies the dyadic induction principle if for any inductive set A ⊆ D the conditions

1. (Base case) ⊥ ∈ A,

2. (Inductive step) x ∈ A and y ∈ A together imply

(a) c_{L}(x) ∈ A,

(b) c_{R}(y) ∈ A,

(c) c_{L}(x) ⊓ c_{R}(y) ∈ A if x ⊑ 1 and y ⊑ 0,

together entail that A = D. □

Definition 10.17 A binary system (D, c_{L}, c_{R}) is inductive if

1. 0 and 1 are the unique fixed points of c_{L} and c_{R}.

2. 0 ≠ 1 and 0 ⊓ 1 = ⊥.

3. It has destructors.

4. It satisfies the dyadic induction principle. □

The following theorem axiomatically characterizes the binary system (I, cons_{L}, cons_{R}) up to isomorphism, without explicit reference to real numbers or intervals.

Theorem 10.18 A binary system is inductive iff it is initial. In particular, any two inductive binary systems are isomorphic. Proof The inductiveness property is clearly preserved by binary system isomorphisms. Since (I, cons_{L}, cons_{R}) is an initial inductive binary system, every initial binary system is inductive, because any two initial objects are isomorphic. The proof of Lemma 10.10 only uses the axioms for inductive binary systems, without mentioning any particular property of (I, cons_{L}, cons_{R}), except for the equations

head(0) = tt  head(1) = ff
tail_{L}(0) = 0  tail_{R}(1) = 1
tail_{L}(⊥) = ⊥  tail_{R}(⊥) = ⊥,

indirectly in Lemma 10.9, which easily follow from the axioms. □

10.2 Structural recursion on the partial unit interval

Definition 10.19 Define T : SDom → SDom by

T D = B × D × D,

and define

I ⇆_{destr}^{cons} T I

by

cons = pif ∘ (id × cons_{L} × cons_{R}),
destr = ⟨head, tail_{L}, tail_{R}⟩;

that is,

cons(p, y, z) = pif x then cons_{L}(y) else cons_{R}(z),
destr(x) = ⟨head(x), tail_{L}(x), tail_{R}(x)⟩. □

Theorem 10.20 ⟨destr, cons⟩ is a T -inductive section-retraction pair. Proof The equation

f = cons ∘ T f ∘ destr.

is equivalent to the equation

f(x) = pif head(x) then cons_{L}(f(tail_{L}(x))) else cons_{R}(f(tail_{R}(x))).

By Lemma 10.2, f = id is a solution. But cons_{L} and cons_{R} and cons_{R} ⊓ cons_{L} have unique fixed-points. Therefore there is a unique solution by virtue of Lemma 10.9. □

Recall from Section 5.2 that this gives rise to structural recursion and corecursion on I.

We leave as an open problem to characterize the T -algebras a such that there is a (necessarily unique) homomorphism from cons to a in a neat way, without referring to the bifree algebra for the functor T .

We now relate the algebra cons : T I → I to the binary system (I, cons_{L}, cons_{R}).

Definition 10.21 A binary T -algebra is a T -algebra a : T D → D of the form

pif ∘ (id × a_{L} × a_{R})

for (necessarily unique) a_{L}, a_{R} : D → D. □

Such maps are necessarily unique because they have to satisfy the equations

a_{L}(x) = a(tt, x, ⊥),
a_{R}(y) = a(ff, ⊥, y).

Compare the following proposition to Lemma 10.10 and Definition 10.11:

Proposition 10.22 Let a : T D → D be a binary T -algebra. Then a strict continuous map f : I → D is a homomorphism from cons to a iff

f(cons_{L}(x)) = a_{L}(f(x))
f(cons_{R}(y)) = a_{R}(f(y))
f(cons_{R}(x) ⊓ cons_{R}(y)) = a_{L}(f(x)) ⊓ a_{R}(f(y)).

Proof f is a homomorphism from cons to a iff

f(pif p then cons_{L}(x) else cons_{R}(y)) = pif p then a_{L}(f(x)) else a_{R}(f(y))

for all p, x, y. By considering the cases p = tt, ff, ⊥ respectively, this equation is seen to be equivalent to the above equations together. □

Compare the following proposition to Lemmas 10.9 and 10.10.

Proposition 10.23 If there is a homomorphism from cons to a binary T - algebra a : T D → D then it is the least continuous map f : I → D such that

f(x) = pif head(x) then a_{L}(f(tail_{L}(x))) else a_{R}(f(tail_{R}(x))).

Proof By Proposition 5.8 we know that if there is a homomorphism from cons to a, then it is the least continuous function f such that

f = a ∘ T f ∘ destr,

which is equivalent to the above equation. □

Compare the following proposition to Definition 10.11:

Proposition 10.24 Let a : T D → D be a binary T -algebra. If there is a homomorphism from cons to a then

a_{L}(fix a_{R}) = a_{R}(fix a_{L}).

Proof Let f be a homomorphism. Then f satisfies the equations of Lemma 10.22. Hence

f(cons_{L}(1)) = a_{L}(f(1)) = a_{L}(fix a_{R})
f(cons_{R}(0)) = a_{R}(f(0)) = a_{R}(fix a_{L})

by Lemma 10.23. But cons_{L}(1) = cons_{R}(0). □

Is the converse true? No, because cons makes more identifications than cons_{L} and cons_{R} do. For example, cons(⊥, x, y) = cons(tt, x, ⊥) if y ⊑ 1, and cons(⊥, x, y) = cons(ff, ⊥, y) if x ⊑ 0. We leave as an open problem to give a necessary and sufficient condition on a binary algebra a for the existence of a homomorphism from cons to a. This amounts to the classification of these identifications, which shouldn’t be very difficult.

In order to consider recursive definitions of functions f : I × I → E, we can try to develop the analogue of Lemma 10.10 for two variables, as in the following proposition. Unfortunately, in practice it turns that one of the hypotheses is hardly ever satisfied (namely that the transpose of f is strict).

Proposition 10.25 Let f : I × I → D be a continuous map multiplicative in each argument such that its transpose g : I → (I ⇒ D) is strict, let

a_{ij} : E → E, i, j ∈ {L, R}

be continuous functions such that

f ∘ (cons_{i} × cons_{j}) = a_{ij} ∘ f

and define a : T (I ⇒ E) → (I ⇒ E) by

a = id × (pif ∘ (id × a_{LL} × a_{LR}) ∘ destr) × (pif ∘ (id × a_{RL} × a_{RR}) ∘ destr).

Then g is the unique homomorphism from cons to the algebra a. In particular, f is the least solution to the functional equation

f(x, y) = pif head(x) then pif head(y) then a_{LL}(f(tail_{L}(x), tail_{L}(y)))

else a_{LR}(f(tail_{L}(x), tail_{R}(y)))

else pif head(y) then a_{RL}(f(tail_{R}(x), tail_{L}(y)))
else a_{RR}(f(tail_{R}(x), tail_{R}(y))).

Proof The condition on f implies that

g(cons_{i}(x))(cons_{j}(y)) = a_{ij}(g(x)(y)),

and by Lemma 10.2 we know that the identity

z = pif head(z) then cons_{L}(tail_{L}(z)) else cons_{R}(tail_{R}(z))

holds. This and the fact that f is multiplicative in its second argument together imply that

g(cons_{i}(x))(z)

= g(cons_{i}(x))(pif head(z) then cons_{L}(tail_{L}(z)) else cons_{R}(tail_{R}(z)))
= pif head(z) then g(cons_{i}(x))(cons_{L}(tail_{L}(z))) else g(cons_{i}(x))(cons_{R}(tail_{R}(z)))
= pif head(z) then a_{i}L(g(x)(z)) else a_{i}R(g(x)(z)).

Since the definition of a can be written

a(p, h, k)(z) = pif p then pif head(z) then a_{LL}(h(tail_{L}(z)))

else a_{LR}(h(tail_{R}(z)))

else pif head(z) then a_{RL}(k(tail_{L}(z)))
else a_{RR}(k(tail_{R}(z)))

and f is multiplicative in its first argument, we have that

(g ∘ cons(p, x, y))(z) = g(pif p then cons_{L}(x) else cons_{R}(y))(z)
= (pif p then g(cons_{L}(x)) else g(cons_{R}(y)))(z)
= pif p then g(cons_{L}(x))(z) else g(cons_{R}(y))(z)
= a(p, g(x), g(y))(z)
= (a ∘ T g(p, x, y))(z).

Therefore g ∘ cons = a ∘ T g, which means that g is an algebra homomorphism from cons to a. From Proposition 5.8, we know that g is the least solution of the equation

g = a ∘ T g ∘ destr.

Therefore g is the least solution to the equation

g(x)(y) = pif head(x) then pif head(y) then a_{LL}(g(tail_{L}(x))(tail_{L}(y)))

else a_{LR}(g(tail_{L}(x))(tail_{R}(y)))

else pif head(y) then a_{RL}(g(tail_{R}(x))(tail_{L}(y)))
else a_{RR}(g(tail_{R}(x))(tail_{R}(y)))

and f is the least solution to the above equation. □ Notice that the multiplicativity hypothesis in the statement of the proposition is stronger than necessary.

10.3 Bifurcated binary expansions

The canonical solution to the domain equation

D ≅ T D,

for the functor T D = B × D × D considered in Definition 10.19, is the domain BTree of infinite binary trees with nodes labelled by truth values, ordered nodewise, together with the bifree algebra

mktree : T BTree → BTree which sends a list ⟨p, s, t⟩ to the tree with root labelled by p, and with left and right subtrees s and t respectively:

mktree(p, s, t) = \begin{aligned}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{aligned}

Definition 10.26 Let num : BTree → I be the unique algebra homomorphism from mktree to cons, and bin : I → BTree be the unique coalgebra homomorphism from destr to mktree^{−1}, as indicated in the following diagrams:

T BTree \overline{{mktree \atop }} BTree

[figure: T I; ^{T num}; cons; I; num]

I  \overline{destr} T I

[figure: BTree; bin; mktree^{−1}; T BTree; ^{T bin}]
□

Then we have that

num ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then cons_{L}(num(s)) else cons_{R}(num(t)),

bin(x) =

head(x)
↙  ↘
bin(tail_{L}(x))  bin(tail_{R}(x)).

By Proposition 5.5, num ∘ bin = id.

Definition 10.27 We refer to the tree bin(x) as the bifurcated binary expansion of x. □

By the above recursive definition of bin, we have that

bin(0)

=

tt

↙  ↘
bin(0)  bin(0)

bin(1) = \begin{aligned}& ff \\ ↙ & & ↘ \\ bin(1) & & bin(1) \end{aligned}

bin(1/2) = \begin{aligned}& ⊥ \\ ↙ & & ↘ \\ bin(1) & & bin(0) \end{aligned}

Thus the bifurcated binary expansions of 0 and 1 are the binary trees with all nodes labelled by tt and ff respectively. Also,

bin(x) = \{ \begin{matrix}tt ↙  ↘ bin(tail_{L}(x))  bin(0) & if x < 1/2, \\ ff ↙  ↘ bin(1)  bin(tail_{R}(x)) & if x > 1/2, \\ ⊥ ↙  ↘ bin(tail_{L}(x))  bin(tail_{R}(x)) & if x↑ ↑1/2, \end{matrix}

because tail_{L}(cons_{R}(x)) = 1 and tail_{R}(cons_{L}(x)) = 0.

Now, recall that a binary expansion of a real number x ∈ [0, 1] is a sequence ⟨a_{n}⟩_{n≥1} of bits (binary digits 0 and 1) with

∑_{n≥1} a_{n}2^{−n} = x

(see e.g. Bourbaki [Bou66]). A binary expansion ⟨a_{n}⟩_{n≥1} of a number x ∈ [0, 1] can be found by the following non-deterministic inductive procedure, which is also non-effective as equality of real numbers is undecidable:

1. Let x_{0} = x.

2. If x_{n} ≤ 1/2 let a_{n} = 0 and x_{n+1} = tail_{L}(x_{n}).

3. If x_{n} ≥ 1/2 let a_{n} = 1 and x_{n+1} = tail_{R}(x_{n}).

If we denote the multi-valued function which sends a number to its set of binary expansions by Bin, and if we write sequences vertically, the above process can be described by the following informal recursive definition:

Bin(x) = \{ \begin{matrix}\begin{matrix}0 \\ ↓ \\ Bin(tail_{L}(x)) \end{matrix} & if x ≤ 1/2, \\ \begin{matrix}1 \\ ↓ \\ Bin(tail_{R}(x)) \end{matrix} & if x ≥ 1/2. \end{matrix}

Thus, the main differences between bifurcated binary expansions and usual binary expansions are that

1. bifurcated binary expansions capture partial numbers in addition to total numbers, 2. bifurcated binary expansions are obtained by a deterministic process (the

above recursive definition of bin),

3. bifurcated binary expansions are obtained by an effective process, which replaces the non-effective tests x ≤ 1/2 and x ≥ 1/2 by the effective test head(x) = (x<_{⊥}1/2).

On the other hand, not every binary tree is a bifurcated binary expansion. However, the idempotent

norm = bin ∘ num : BTree → BTree

has the bifurcated binary expansions as its fixed-points. Moreover, by general properties of retracts, the set of bifurcated binary expansions endowed with the order inherited from BTree is a domain isomorphic to I.

In the remaining of this section we look for a recursive definition of

[figure: BTree; norm; BTree = BTree; bin; I; num; BTree]

not involving the intermediate domain I. Such a recursive definition is applied in Section 12.1 in order to find an appropriate effective presentation of the partial real line.

If we have an algebra cons′ : T BTree → BTree such that bin is a homomorphism from cons to cons′, as indicated in the diagram

T I \overline{cons} I

[figure: T BTree; ^{T bin}; cons′; BTree; bin]

then norm is a homomorphism from mktree to cons′, because num is a homomorphism from mktree to cons, by definition, and homomorphisms compose. Therefore norm can be recursively defined by

norm ∘ mktree = cons′ ∘ T norm,

or, equivalently, by

norm ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = cons′(p, norm(s), norm(t)).

Moreover, if cons′ is a binary T -algebra (Definition 10.21), in the sense that we can find maps cons′_{L}, cons′_{R} : BTree → BTree such that

cons′ = pif ∘ (id × cons′_{L} × cons′_{R}),

then we can recursively define norm by

norm ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then cons′_{L}(norm(s)) else cons′_{R}(norm(t)).

Lemma 10.28 bin is a multiplicative function. Proof bin is the least fixed-point of the continuous functional F defined by

F (f) = mktree ∘ T f ∘ destr.

The function mktree is multiplicative because binary meets of triples are computed componentwise, and binary meets of trees are computed nodewise. If f is multiplicative so is T f. Also destr = ⟨head, tail_{L}, tail_{R}⟩ is multiplicative because head, tail_{R} and tail_{L} are multiplicative by Lemmas 9.17 and 9.16 respectively. Hence, since a composition of multiplicative functions is multiplicative, if f is multiplicative so is F (f). Therefore the least fixed-point of F is multiplicative, because the binary meet operation preserves directed joins. □

Lemma 10.29 Let cons′_{L}, cons′_{R} : BTree → BTree be continuous maps, and define

cons′ = pif ∘ (id × cons′_{L} × cons′_{R}).

If the diagrams

I \overline{^{cons_{L}}} I

[figure: BTree; bin; cons′_{L}; BTree; bin]

I ^{cons_{R}} I

[figure: BTree; bin; cons′_{R}; BTree; bin]

commute then bin is an algebra homomorphism from cons to cons′. Proof By Lemmas 8.16 and 10.28, if the diagrams commute then

bin ∘ cons(p, y, z) = bin(pif p then cons_{L}(y) else cons_{R}(z))
= pif p then bin(cons_{L}(y)) else bin(cons_{R}(z))
= pif p then cons′_{L}(bin(y)) else cons′_{R}(bin(z))
= cons′(p, bin(y), bin(z))
= cons′ ∘ T Bin(p, y, z),

and hence bin is a homomorphism from cons to cons′. □

In order to construct such maps cons′_{L} and cons′_{R}, we first consider the following construction:

Lemma 10.30 Let head′_{0}, head′_{1} : BTree → B be recursively defined by

head′_{0} ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then head′_{0}(s) else ff,

head′_{1} ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then tt else head′_{1}(t).

Then

head′_{0} = head_{0} ∘ num  and  head′_{1} = head_{1} ∘ num.

Proof Define

f_{0} = ⊥  f_{n+1} (mktree(p, s, t)) = pif p then f_{n}(s) else ff,
id_{0} = ⊥  id_{n+1} (mktree(p, s, t)) = mktree(p, id_{n}(s), id_{n}(t)).

Then head′_{0} and id : BTree → BTree are the least upper bounds of the chains f_{n} and id_{n} respectively. We show by induction on n that head_{0} ∘num∘id_{n} = f_{n}. For the base case this is immediate, because head_{0} and num are both strict. For the inductive step, recall that head_{0} is multiplicative by Lemma 9.17, and that hence it distributes over the parallel conditional in the sense of Lemma 8.16. Also, notice that head_{0} ∘ cons_{L} = head_{0}, because x < 0 iff x/2 < 0, and that head_{0} ∘ cons_{R}(x) = ff, because cons_{R}(x) ≥ 1/2. Hence

head_{0} ∘ num ∘ id_{n+1} (mktree(p, s, t))

= head_{0} ∘ num (mktree(p, id_{n}(s), id_{n}(t)))
= head_{0}(pif p then cons_{L}(num(id_{n}(s))) else cons_{R}(num(id_{n}(s)))
= pif p then head_{0}(cons_{L}(num(id_{n}(s)))) else head_{0}(cons_{R}(num(id_{n}(s))))
= pif p then head_{0}(num(id_{n}(s))) else ff
= pif p then f_{n}(s) else ff
= f_{n+1} (mktree(p, s, t)) ,

which finishes our inductive argument. Therefore

head′_{0} = \begin{matrix}⨆ & ↑ \\ n \end{matrix} f_{n} = ^{⨆↑} head_{0} ∘ num ∘ id_{n} = head_{0} ∘ num ∘^{⨆↑} id_{n} = head_{0} ∘ num.

The proof for head′_{1} is symmetric. □

The continuous maps of the hypothesis of Lemma 10.29 can be constructed as follows:

Lemma 10.31 Let cons′_{L}, cons′_{R} : BTree → BTree be defined by

cons′_{L}(t) = \begin{aligned}& & head′_{1}(t) \\ & ↙ & & ↘ \\ t & & & bin(0) \end{aligned}

cons′_{R}(t) = \begin{aligned}& head′_{0}(t) \\ ↙ & & ↘ \\ bin(1) & & & t \end{aligned}

Then the diagrams displayed in Lemma 10.29 commute. Proof Since head′_{1} = head_{1} ∘ num by Lemma 10.30, and since num ∘ bin, we conclude that head_{1} = head′_{1} ∘ bin. Since head ∘ cons_{L}(x) = (x/2<_{⊥}1/2) = (x<_{⊥}1) = head_{1}(x),

bin ∘ cons_{L}(x)

= mktree(head ∘ cons_{L}(x), bin(tail_{L}(cons_{L}(x))), bin(tail_{R}(cons_{L}(x))))
= mktree(head_{1}(x), bin(x), bin(0))
= mktree(head′_{1}(bin(x)), bin(x), bin(0))
= cons′_{L} ∘ bin(x).

The proof for cons_{R} is symmetric. □ We have thus established Theorem 10.32 The idempotent norm can be recursively defined by

norm ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then cons′_{L}(norm(s)) else cons′_{R}(norm(t)).

Compare the following lemma to Definition 3.16(3b), where BTree plays the rôle of B^{ω}: Lemma 10.33 Let tail′_{L}, tail′_{R} : BTree → BTree and head′ : BTree → B be defined by

head′ ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then head′_{1}(s) else head′_{0}(t)
tail′_{L} ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then s else bin(1)
tail′_{R} ( \begin{matrix}& & p \\ & ↙ & & ↘ \\ s & & & & t \end{matrix} ) = pif p then bin(0) else t.

Then, for each a ∈ {L, R},

cons_{a} = (bin ⇒ num)(cons′_{a})
head = (bin ⇒ id)(head′)
tail_{a} = (bin ⇒ num)(tail′_{a}).

Proof By Lemma 10.31, we have that bin ∘ cons_{a} = cons′_{a} ∘ bin. Hence

cons_{a} = num ∘ cons_{a} ∘ bin = (bin ⇒ num)(cons′_{a}),

because num ∘ bin = id. For head we have that

(bin ⇒ id)(head′)(x)

= head′ ∘ bin(x)
= head′(mktree(head(x), bin(tail_{L}(x)), bin(tail_{R}(x))))
= pif head(x) then head′_{1}(bin(tail_{L}(x))) else head′_{0}(bin(tail_{R}(x)))
= pif head(x) then head_{1}(tail_{L}(x)) else head_{0}(tail_{R}(x)),

by virtue of Lemma 10.30. If head(x) = tt then x < 1/2 and hence tail_{L}(x) < 1. Thus, in this case the last term is

head_{1}(tail_{L}(x)) = tt = head(x).

Similarly, if head(x) = ff then

head_{1}(tail_{R}(x)) = ff = head(x).

Otherwise head(x) = ⊥. Then x ⊑ 1/2 and hence tail_{L}(x) ⊑ 1 and tail_{R}(x) ⊑ 0. Therefore in this case the last term is

head_{1}(tail_{L}(x)) ⊓ head_{0}(tail_{R}(x)) = ⊥ ⊓ ⊥ = ⊥ = head(x).

For tail_{L} we have that

(bin ⇒ num)(tail′_{L})(x)
= num ∘ tail′_{L} ∘ bin(x)
= num ∘ tail′_{L}(mktree(head(x), bin(tail_{L}(x)), bin(tail_{R}(x))))
= num(pif head(x) then bin(tail_{L}(x)) else bin(1))
= num ∘ bin(pif head(x) then tail_{L}(x) else 1)
= pif head(x) then tail_{L}(x) else 1

If head(x) = tt then the last term is tail_{L}(x). If head(x) = ff then the last term is 1 = tail_{L}(x). Otherwise, head(x) = ⊥. Then x ⊑ 1/2 and tail_{L}(x) ⊑ 1. Hence in this case the last term is

tail_{L}(x) ⊓ 1 = tail_{L}(x).

For tail_{R} we have a symmetric proof. □

10.4 Coinduction on the partial unit interval

Dana Scott suggested to the author that he should also consider a characterization of the partial unit interval by “co-Peano axioms”, based on some form of coinduction and corecursion. Although we don’t have such a characterization yet, we have a coinduction principle based on the ideas of Smyth [Smy92a] and Fiore [Fio93, Fio96].

Definition 10.34 A bisimulation on I is a binary relation ∼⊆ I × I such that

x ∼ y implies that head(x) = head(y) and tail_{a}(x) ∼ tail_{a}(y) for a ∈ {R, L}.

We say that x and y are bisimilar if they are related by some bisimulation. □

Theorem 10.35 (Coinduction) If x, y ∈ I are bisimilar then x = y. Proof (Sketch) Assume that x and y are bisimilar. Then bin(x) = bin(y). Since bin is split mono, x = y. □

So far we don’t have any application of this coinduction principle.

Of course, we can replace equalities by inequalities thus obtaining the notion of simulation and a more general coinduction principle for establishing inequalities.

10.5 Structural recursion on the partial real line

The domain R_{⊥} is treated similarly, by considering the primitive operations

rcons_{L}(x) = x/2,  rtail_{L}(x) = 2x,
rcons_{R}(x) = (x + 1)/2,  rtail_{R}(x) = 2x − 1,
trunc(x) = max(0, min(x, 1)),  incl(x) = x.

Here incl : I → R and trunc : R_{⊥} → I form a section-retraction pair.

We omit the routine details, because they are formally similar to those of the treatment of I. The crucial idea is that the identity of R_{⊥} is the unique continuous function such that

f(x) = pif x<_{⊥}0 then rcons_{R}(f(rtail_{R}(x)))
pif 1<_{⊥}x then rcons_{L}(f(rtail_{L}(x)))
else incl(trunc(x)).

Roughly, the idea is that if x < 0 then there is some n such that rtail_{R}^{n}(x) belongs to I, and, similarly, if x > 1 then there is some n such that rtail_{L}^{n}(x) belongs to I, so that we can reduce the treatment to the previous case. This leads us to define a functor T : SDom → SDom by

T D = B × B × D × D × I

functions

R_{⊥} ⇆_{destr}^{cons} T R_{⊥}

by

cons(p, q, x, y, z) = pif p then rcons_{R}(x)
pif q then rcons_{L}(y)
else incl(z).
destr(x) = ⟨x<_{⊥}0, 1<_{⊥}x, rtail_{R}(x), rtail_{L}(x), trunc(x)⟩.

Theorem 10.36 ⟨destr, cons⟩ is a T -inductive section-retraction pair.

It is easy to derive the analogue of Theorem 10.32 and Lemma 10.33, which are necessary to establish computational completeness of Real PCF.

10.6 Examples of recursive definitions

We have already seen several examples of recursive definitions in Section 10.3. In this section we show how to derive recursive definitions of basic real functions using the principles introduced in Sections 10.1, 10.2, and 10.5. For the sake of brevity, some routine proofs and constructions are only sketched.

Unless otherwise stated, when we refer to a real function as a partial real function, we mean its canonical extension, as in Convention 8.2.

Proposition 10.37 The complement map compl : I → I defined by

compl(x) = 1 − x

can be recursively defined by

compl(x) = pif head(x) then cons_{R}(compl(tail_{L}(x)))
else cons_{L}(compl(tail_{R}(x))).

Proof There are two ways to prove this fact, based on Sections 10.1 and 10.2 respectively, but they are essentially equivalent:

First way: If (D, c_{L}, c_{R}) is a binary system, so is (D, c_{R}, c_{L}), because the definition is symmetric. Thus, it suffices to show that compl is a homomorphism from (I, cons_{L}, cons_{R}) to (I, cons_{R}, cons_{L}), and apply Lemma 10.10, obtaining the above recursive definition. The base case clearly holds because it simply says that compl(0) = 1, compl(1) = 0, and compl(⊥) = ⊥, which is immediately true. The first two equations of the recursion step are proved by

compl(cons_{L}(x)) = 1 − x/2 = (2 − x)/2 = ((1 − x) + 1)/2
= cons_{R}(compl(x)),
compl(cons_{R}(x)) = 1 − (x + 1)/2 = (2 − (x + 1))/2 = (1 − x)/2
= cons_{L}(compl(x)).

For the third equation of the recursion step, it suffices to observe that compl is multiplicative, simply because it is an isomorphism.

Second way: If compl is a homomorphism from the algebra cons to the algebra cons′ defined by

cons′ = pif ∘ (id × cons_{R} × cons_{L}),

then the result follows from Proposition 10.23. But the hypothesis follows from the arguments above and Proposition 10.22. □ Proposition 10.38

1. The logarithm function log_{2} : I[1, 2] → I[0, 1] can be recursively defined by

log_{2}(x) = pif x<_{⊥}\sqrt{2} then cons_{L}(log_{2}(x^{2}))
else cons_{R}(log_{2}(x^{2}/2)),

where x^{2} and x^{2}/2 stand for min(x^{2}, 2) and max(1, x^{2}/2) respectively, by an abuse of notation.

2. The inverse exp_{2} : I[0, 1] → I[1, 2] of log_{2} can be recursively defined by

exp_{2}(x) = pif head(x) then \sqrt{exp_{2}(tail_{L}(x))}
else \sqrt{2 exp_{2}(tail_{L}(x))}.

Proof Define a_{L}, a_{R} : I[1, 2] → I[1, 2] by

a_{L}(x) = \sqrt{x} a_{R}(x) = \sqrt{2x}.

Then

log_{2} ∘a_{L}(x) = log_{2}(\sqrt{x}) = log_{2}(x)/2 = cons_{L} ∘ log_{2}(x)
log_{2} ∘a_{R}(x) = log_{2}(\sqrt{2x}) = (log_{2}(x) + 1)/2 = cons_{R} ∘ log_{2}(x).

Since exp_{2} is the inverse of log_{2},

exp_{2} ∘cons_{L} = a_{L} ∘ exp_{2}
exp_{2} ∘cons_{R} = a_{R} ∘ exp_{2} .

It follows that (I[1, 2], a_{L}, a_{R}) is a binary system isomorphic to (I, cons_{L}, cons_{R}) and hence it is also initial by Theorem 10.18. Hence

a = pif ∘ (id × a_{L} × a_{R})

is a bifree algebra. But since log_{2} and exp_{2} are isomorphisms, they are multiplicative. Hence Proposition 10.22 shows that log_{2} : a → cons and exp_{2} : cons → a. The destructors of (I, a_{L}, a_{L}) are

h(x) = x<_{⊥}\sqrt{2}
t_{L}(x) = min(x^{2}, 1)
t_{R}(x) = max(0, x^{2}/2).

Therefore the result follows from Proposition 10.23. □

Proposition 10.39 The the average map ⊕ : I × I → I defined by

x ⊕ y = (x + y)/2

can be recursively defined by

x ⊕ y = pif head(x) then pif head(y) then cons_{L}(tail_{L}(x) ⊕ tail_{L}(y))

else cons_{C}(tail_{L}(x) ⊕ tail_{R}(y))

else pif head(y) then cons_{C}(tail_{R}(x) ⊕ tail_{L}(y))
else cons_{R}(tail_{R}(x) ⊕ tail_{R}(y)).

where

C = [1/4, 3/4].

Proof First, notice that average satisfies the following exchange law:

(a ⊕ x) ⊕ (b ⊕ y) = ((a + x)/2 + (b + y)/2)/2 = ((a + b)/2 + (x + y)/2)/2
= (a ⊕ b) ⊕ (x ⊕ y).

Since

cons_{L}(x) = 0 ⊕ x,  cons_{C}(x) = 1/2 ⊕ x,  cons_{R}(x) = 1 ⊕ x,

and since 0 ⊕ 0 = 0, 1/2 = 0 ⊕ 1 = 1 ⊕ 0, and 1 ⊕ 1 = 1, it follows that

cons_{L}(x) ⊕ cons_{L}(y) = cons_{L}(x ⊕ y)
cons_{L}(x) ⊕ cons_{R}(y) = cons_{C}(x ⊕ y)
cons_{R}(x) ⊕ cons_{L}(y) = cons_{C}(x ⊕ y)
cons_{R}(x) ⊕ cons_{R}(y) = cons_{R}(x ⊕ y).

A routine verification shows that average is multiplicative in each argument (it suffices to check one argument because it is commutative). Hence, if the transpose of average were strict, which unfortunately it isn’t, the result would immediately follow from Proposition 10.25. We thus proceed as follows: (1) We show that average satisfies the recursive equation, and (2) we show that any two functions satisfying the recursive equation are equal. Step (1) can be done directly using the above equations and the fact that average is multiplicative. Step (2) can be done by nested dyadic induction. We omit the details. □

Ternary average, needed in the recursive definition of multiplication given in Proposition 10.40 below, can be recursively defined in essentially the same way as binary average (with an extra level in the nesting of conditionals).

A routine verification shows that the multiplication map (x, y) ↦ x × y : I × I → I satisfies the following equations:

cons_{L}(x) × cons_{L}(y) = cons_{LL}(x × y)
cons_{L}(x) × cons_{R}(y) = cons_{L} (\frac{x + x × y}{2} )
cons_{R}(x) × cons_{L}(y) = cons_{L} (\frac{x × y + y}{2} )
cons_{R}(x) × cons_{R}(y) = cons_{RL} (\frac{x + x × y + y}{3} )

If we informally apply Proposition 10.25 in order to reduce these four equations to a single equation, and formally proceed as in the proof of Proposition 10.39, we obtain:

Proposition 10.40 The multiplication map (x, y) ↦ x × y : I × I → I can be recursively defined by

x × y = pif head(x)

then pif head(y) then cons_{LL} (tail_{L}(x) × tail_{L}(y))

else cons_{L} (\frac{tail_{L}(x) + tail_{L}(x) × tail_{R}(y)}{2})
else pif head(y) then cons_{L} (\frac{tail_{R}(x) × tail_{L}(y) + tail_{L}(y)}{2})

else cons_{RL} (\frac{tail_{R}(x) + tail_{R}(x) × tail_{R}(y) + tail_{R}(y)}{3}).

Similarly, we have that

max(cons_{L}(x), cons_{L}(y)) = cons_{L}(max(x, y))
max(cons_{L}(x), cons_{R}(y)) = cons_{L}(x)
max(cons_{R}(x), cons_{L}(y)) = cons_{L}(y)
max(cons_{R}(x), cons_{R}(y)) = cons_{R}(max(x, y)),

and we conclude that

Proposition 10.41 max can be recursively defined by

max(x, y) = pif head(x) then pif head(y) then cons_{L}(max(tail_{L}(x), tail_{L}(y)))

else y

else pif head(y) then x else cons_{R}(max(tail_{R}(x), tail_{R}(y))).

The operation min can be defined in a similar way, or simply by

min(x, y) = 1 − max(1 − x, 1 − y).

Proposition 10.42 The function (x, y) ↦ (x<_{⊥}y) : I ×I → I can be recursively defined by

(x<_{⊥}y) = pif head(x) then pif head(y) then tail_{L}(x)<_{⊥}tail_{L}(y)

else tt

else pif head(y) then ff else tail_{R}(x)<_{⊥}tail_{R}(y)

We now consider some recursive definitions on R_{⊥}. We obtain a recursive definition of addition in R_{⊥} by reducing addition to the average operation on I defined in Proposition 10.39. In the following proposition, the symbol ∨ denotes parallel-or, defined by

p ∨ q = pif p then tt else q.

Also, the affine maps in the recursive definition correspond to operations rrcons_{a} for appropriate a.

Proposition 10.43 Addition on R_{⊥} can be recursively defined by

x + y = pif x <_{⊥} 0 ∨ y <_{⊥} 0 then 2 (\frac{x+1}{2} + \frac{y+1}{2}) − 2

else pif x >_{⊥} 1 ∨ y >_{⊥} 1 then 2 (\frac{x}{2} + \frac{y}{2}) else 2 trunc(incl(x) ⊕ incl(y)).

Proof We only observe that the above equation is equivalent to

x + y = pif x < 0 ∨ y < 0 then 2 (\frac{x+1}{2} + \frac{y+1}{2}) − 2

else pif x > 1 ∨ y > 1 then 2 (\frac{x}{2} + \frac{y}{2}) else 2 (\frac{x+y}{2} ),

with some slight abuse of notation. The idea is to “normalize” x and y to fractions, compute average, and then rescale the result back. □ Maximum, minimum, and multiplication on R_{⊥} can be obtained in a similar way from the corresponding operations on I.

Proposition 10.44 If b > 1 then the logarithm function log_{b} : R_{⊥} → R_{⊥}, with the convention that log_{b}(x) = ⊥ if x is consistent with a non-positive number, can be recursively defined by

log_{b}(x) = pif x >_{⊥} b then log_{b}(x/b) + 1 else pif x <_{⊥} 1 then log_{b}(bx) − 1

else join_{[0,1]} (pif x^{2} <_{⊥} b then \frac{log_{b}(x^{2})}{2} else \frac{log_{b}(x^{2}/b)+1}{2})

For a treatment of some trigonometric functions see [Esc94].

Part IV

Computation on the partial real line

In Chapter 11 we introduce Real PCF and its operational and denotational semantics, and we establish computational adequacy. In Chapter 12 we show that the real numbers type hierarchy has a unique sound effective presentation, and we establish computational completeness of Real PCF.

The programming language Real PCF

We introduce two successive extensions of PCF, first with a type for the partial unit interval (Section 11.1) and then with a further type for the partial real line (Section 11.2). We prove that the operational semantics enjoys the following adequacy property: a program of real number type evaluates to a headnormal form iff its value is different from ⊥; if its value is different from ⊥ then it successively evaluates to head-normal forms giving better and better partial results converging to its value.

11.1 The programming language PCF^{I}

We let L range over the languages L_{DA}, L_{PA} and L_{PA+∃}, and L^{I} denote the extension of L with a new ground type I and the following new constants:

1. cons_{a} : I → I

2. tail_{a} : I → I

3. head_{r} : I → T

4. pif_{I} : (T, I, I, I)

for each non-bottom a ∈ I with distinct rational end-points, so that the interpretation of tail_{a} given below is well-defined, and each rational r ∈ (0, 1). We refer to the ground type I as the real number type, and to programs of real number type as real programs.

Denotational semantics

We let D_{I} = I and we extend the standard interpretation A of L to L^{I} by

1. A⟦cons_{a}⟧ = cons_{a}

2. A⟦tail_{a}⟧ = tail_{a}

3. A⟦head_{r}⟧ = head_{r}

4. A⟦pif_{I}⟧pxy = pif p then x else y.

Operational semantics

We extend the immediate reduction relation → of L to L^{I} by the following rules:

1. cons_{a}(cons_{b}M) → cons_{ab} M

2. tail_{a}(cons_{b}M) → Ycons_{L} if b ≤ a

3. tail_{a}(cons_{b}M) → Ycons_{R} if b ≥ a

4. tail_{a}(cons_{b}M) → cons_{b\a} M if a ⊑ b and a ≠ b

5. tail_{a}(cons_{b}M) → cons_{(a⊔b)\a}(tail_{(a⊔b)\b} M)

if a↑ ↑b, a ⋢ b, b ⋢ a, b ≰ a, and a ≰ b

6. head_{r}(cons_{a}M) → tt if a < r

7. head_{r}(cons_{a}M) → ff if a > r

8. pif ttMN → M, pif ffMN → N

9. pif L (cons_{a}M) (cons_{b}N) →
cons_{a⊓b}(pif L (cons_{a\(a⊓b)} M) (cons_{b\(a⊓b)} N))

if a ⊓ b ≠ ⊥

10. \frac{N → N′}{MN → MN′} if M is cons_{a}, tail_{a}, head_{r} or pif

11. \frac{L → L′}{pifL → pifL′}  \frac{M → M′}{pifLM → pifLM′}  \frac{N → N′}{pifLMN → pifLMN′}.

These rules are well-defined by virtue of Lemma 9.3 and because the extra conditions on them which are not present in Lemma 9.18 ensure that no bottom elements and no maximal elements are produced as subscripts of cons or tail. It may seem that there is a missing self-evident reduction rule for tail_{a}, namely the rule tail_{a}(cons_{a}M) → M; see remark after Lemma 11.6.

The basic idea behind the above reduction rules is to reduce computations on real numbers to computations on rational numbers, namely the subscripts of the constants cons, head, and tail.

Notice that the immediate reduction rules for the parallel conditional are non-deterministic. The following lemma shows that this non-determinism does not produce inconsistencies:

Lemma 11.1 M → N implies ⟦M⟧(ρ) = ⟦N⟧(ρ) for all terms M and N and any environment ρ. Proof This is true for the language L, and remains true for the extended language L^{I} by virtue of Lemma 9.18. □

The partial map Eval on programs M of truth-value and natural number type is defined in the same way as for L. It is well-defined by virtue of Lemma 11.1, because no two different constants have the same interpretation. We extend Eval to a multi-valued map on real programs M by

Eval(M) = {a ∈ I|M →^{∗} cons_{a}M′ for some M′};

that is, a ∈ Eval(M) iff M has a head-normal form cons_{a}M′.

Soundness of the operational semantics

Lemma 11.2 For all real programs M, a ∈ Eval(M) implies a ⊑ ⟦M⟧. Proof By Lemma 11.1, if M →^{∗} cons_{a}M′ then ⟦M⟧ = ⟦cons_{a}M′⟧ = a⟦M′⟧. Therefore a ⊑ ⟦M⟧, because the information order on partial numbers coincides with the prefix preorder. □

Theorem 11.3 (Soundness) For any real program M,

⨆ Eval(M) ⊑ ⟦M⟧.

Proof The join exists because ⟦M⟧ is an upper bound of the set Eval(M). Therefore the result follows from Lemma 11.2. □

Completeness of the operational semantics

By virtue of Lemma 11.2, for any real program M we have that Eval(M) is empty if ⟦M⟧ = ⊥. The following theorem states a stronger form of the converse:

Theorem 11.4 (Completeness) For any real program M,

⨆ Eval(M) ⊒ ⟦M⟧

Proof Lemma 11.6 below. □

The soundness and completeness properties in the senses of Theorems 11.3 and 11.4 can be referred together as the computational adequacy property of L^{I}.

Theorem 11.5 (Adequacy) L^{I} is computationally adequate.

Several recursive definitions given in Section 10.6 immediately give rise to PCF programs. It would be a formidable task to syntactically prove the correctness of the resulting programs by appealing to the operational semantics given by the reduction rules. However, a mathematical proof of the correctness of a recursive definition allows us to conclude that the induced programs indeed produce correct results, via an application of the Adequacy Theorem. In fact, this is one of the main points of denotational semantics.

We extend the inductive definition of the predicates Comp_{σ} given in Section 4.3 of Part I by the following clause:

A real program M has property Comp_{I} if for every non-bottom partial number x ≪ ⟦M⟧ (as close to ⟦M⟧ as we please) there is some a ∈ Eval(M) with x ⊑ a.

If we read the relation x ≪ y as “x is a piece of information about y” then the above definition says that a real program is computable if every piece of information about its value can be produced in a finite number of reduction steps.

The domain-theoretic justificative for continuity of computable functions is that it is a finiteness condition [Plo80, Sco72b, Smy83, Smy92b]; a function f is continuous if a finite amount of information about f(x) depends only on a finite amount of information about x. The continuity of a domain, which amounts to its way-below order being well-behaved, gives us a general and abstract framework for consistently talking about “pieces of information”. Then it should come as no surprise that Lemma 11.6 makes essential use of the waybelow order and of the continuity of the primitive functions.

The following lemma, which extends Lemma 4.6, establishes the Completeness Theorem:

Lemma 11.6 Every term is computable. Proof It suffices to extend the inductive proof of Lemma 4.6. We have to:

1. slightly modify the proof for the case of abstractions, because it mentions constants and we have added new constants;

2. extend the proof of computability of the terms Y_{σ} to the new types; and

3. show that the new constants are computable.

(1) If M is computable so is λαM:

It is enough to show that the ground term LN_{1} ⋯ N_{n} is computable when N_{1}, ⋯, N_{n} are closed computable terms and L is a closed instantiation of λαM by computable terms. Here L must have the form λαM̃ where M̃ is an instantiation of all free variables of M, except α, by closed computable terms. Since [N_{1}/α]M̃ is computable, so is [N_{1}/α]M̃N_{2} ⋯ N_{n}. Since LN_{1} ⋯ N_{n} → [N_{1}/α]M̃N_{2} ⋯ N_{n} and the reduction relation preserves meaning, in order to evaluate LN_{1} ⋯ N_{n} it suffices to evaluate [N_{1}/α]M̃N_{2} ⋯ N_{n}.

(2) Y_{σ} is computable for all new types:

In order to prove that Y_{σ} is computable for all new types it suffices to show that the term Y_{(σ_{1},...,σ_{k},I)}N_{1} ⋯ N_{k} is computable whenever N_{1} : σ_{1}, …, N_{k} : σ_{k} are closed computable terms.

It follows from (1) above that the terms Y_{σ}^{(n)} are computable for all new types, because the proof of computability of Y_{σ}^{(n)} for old types depends only on the fact that variables are computable and that the combination and abstraction formation rules preserve computability.

The syntactic information order ≼ on L extends to L^{I}, and Lemma 4.5 is easily seen to remain true by a routine extension of its inductive proof.

Let x ≪ ⟦YN_{1} ⋯ N_{k}⟧ be a non-bottom partial number. By a basic property of the way-below order of any continuous dcpo, there is some n such that x ≪ ⟦Y^{(n)}N_{1} ⋯ N_{k}⟧, because ⟦Y⟧ = ⨆_{n}⟦Y^{(n)}⟧. Since Y^{(n)} is computable, there is a c ∈ Eval(Y^{(n)}N_{1} ⋯ N_{k}) with x ⊑ c. Since there is a term M with Y^{(n)}N_{1} ⋯ N_{k} →^{∗} cons_{c}M and Y^{(n)} ≼ Y, it follows from Lemma 4.5 that YN_{1} ⋯ N_{k} →^{∗} cons_{c}M for some M and therefore c ∈ Eval(YN_{1} ⋯ N_{k}).

(3) The new constants are computable:

In order to prove that one of the new constants c is computable it suffices to show that if M_{1}, …, M_{n} are closed computable terms such that cM_{1} … M_{n} has real number type, then cM_{1} … M_{n} is computable.

(3)(a) cons_{a} is computable:

Let M be a computable real program and let x ≪ ⟦cons_{a}M⟧ = a⟦M⟧ be a non-bottom partial number. We have to produce c ∈ Eval(cons_{a}M) with x ⊑ c. Let b ≪ ⟦M⟧ with x ≪ ab. If b = ⊥ then we can take c = a. Otherwise, by computability of M we can find b′ ∈ Eval(M) with b ⊑ b′. Then we can take c = ab′, because cons_{a}M →^{∗} cons_{a}(cons_{b′}M′) → cons_{ab′}M′ for some M′.

(3)(b) tail_{a} is computable:

Let M be a computable real program and let y ≪ ⟦tail_{a}M⟧ = tail_{a}(⟦M⟧) be a non-bottom partial number. We have to produce c ∈ Eval(tail_{a}M) with y ⊑ c. Since tail_{a} is continuous, there is some x ≪ ⟦M⟧ such that y ≪ tail_{a}(x). Let b ∈ Eval(M) with x ⊑ b. It follows that b ⋢ a, because y ≠ ⊥ and if b ⊑ a then y ≪ tail_{a}(x) ⊑ tail_{a}(b) ⊑ tail_{a}(a) = ⊥. Then exactly one of the following four cases holds:

(t1) b ≤ a

(t2) a ≤ b

(t3) a ⊑ b

(t4) a↑ ↑b, a ⋢ b, b ≰ a, and a ≰ b

which have the following proofs:

(t1) In this case tail_{a}M →^{∗} tail_{a}(cons_{b}M′) → Ycons_{L} for some M′. Hence y ≪ ⟦tail_{a}M⟧ = ⟦Ycons_{L}⟧. Since Ycons_{L} is a computable term, there is some c ∈ Eval(Ycons_{L}) ⊆ Eval(tail_{a}M) with y ⊑ c.

(t2) This case is handled similarly.

(t3) Since x ⊑ b, we have that tail_{a}(x) ⊑ tail_{a}(b) = b\a, and since y ⊑ tail_{a}(x), we have that y ⊑ b\a. Therefore we can take c = b\a, because tail_{a}M →^{∗} tail_{a}(cons_{b}M′) → cons_{b\a}M′ for some M′.

(t4) Since x ⊑ b, we have that tail_{a}(x) ⊑ tail_{a}(b) = (a ⊔ b)\a, and since y ⊑ tail_{a}(x), we have that y ⊑ (a ⊔ b)\a. Therefore we can take c = (a ⊔ b)\a, because tail_{a}M →^{∗} tail_{a}(cons_{b}M′) → cons_{(a⊔b)\a}(tail_{(a⊔b)\b}M′) for some M′.

(3)(c) head_{r} is computable:

Assume that ⟦head_{r}M⟧ = head_{r}(⟦M⟧) ≠ ⊥ for a computable real program M. Then there is an x ≪ ⟦M⟧ such that either x < r or else x > r, because head_{r} is continuous. Let c ∈ Eval(M) with x ⊑ c. Then either c < r or else c > r. Hence there is some M′ such that either head_{r}M →^{∗} head_{r}(cons_{c}M′) → tt or else head_{r}M →^{∗} head_{r}(cons_{c}M′) → ff respectively. Therefore if x < r then Eval(head_{r}M) = tt and if x > r then Eval(head_{r}M) = ff.

(3)(d) pif is computable:

It suffices to show that pifLMN is computable whenever ⟦L⟧ = ⊥ and M and N are computable programs, because the case ⟦L⟧ ≠ ⊥ is immediate. Let x ≪ ⟦pifLMN⟧. Then x ≪ ⟦M⟧ ⊓ ⟦N⟧. Hence x ≪ ⟦M⟧ and x ≪ ⟦N⟧. Let a ∈ Eval(M) and b ∈ Eval(N) with x ⊑ a and x ⊑ b. Then x ⊑ a ⊓ b and a ⊓ b ∈ Eval(pifLMN), because pifLMN →^{∗} pifL(cons_{a}M)(cons_{b}N) → cons_{a⊓b}(pifL(cons_{a\(a⊓b)}M)(cons_{b\(a⊓b)}N)).

This concludes the proof of Lemma 11.6. □ The proof for tail_{a} implicitly shows that a reduction rule tail_{a}(cons_{a}M) →

M would be useless. This can be explicitly explained as follows. If M denotes ⊥, so does tail_{a}(cons_{a}M). Hence there is no point in reducing tail_{a}(cons_{a}M) before reducing M to a head-normal form. If M has a head-normal form cons_{c}M′, then tail_{a}(cons_{a}M) reduces to tail_{a}(cons_{ac}M′), which in turn reduces to cons_{c}M′. In practice, however, this rule (and possibly more rules) can be included for efficiency reasons.

11.2 The programming language Real PCF

We let L^{R} denote the extension of L^{I} with a new ground type R and the following new constants:

1. rrcons_{a} : R → R

2. ricons_{a} : I → R

3. irtail_{a} : R → I

4. rhead_{r} : R → T

5. pif_{R} : (T, R, R, R)

for each a ∈ R with distinct rational end-points and each rational number r.

We let D_{R} = R_{⊥} and we extend the standard interpretation A of L^{I} to L^{R} in the obvious way:

1. A⟦rrcons_{a}⟧ = rrcons_{a}

2. A⟦ricons_{a}⟧ = ricons_{a}

3. A⟦irtail_{a}⟧ = irtail_{a} 4. A⟦rhead_{r}⟧x = rhead_{r}

5. A⟦pif_{R}⟧pxy = pif p then x else y. The reduction rules for L^{R} are given by Lemma 9.20, with the same restrictions as for the reduction rules for L^{I}. The Computability Lemma 11.6 and the Adequacy Theorem 11.5 routinely generalize to L^{R}. Definition 11.7 Real PCF is the programming language L^{R} for L = L_{DA}.

□

Theorem 11.8 (Adequacy) Real PCF is computationally adequate.

Computational completeness of Real PCF

In Section 12.1 we show that there is a unique effective presentation of the partial real line such that the basic operations for real number computation are computable, up to equivalence in the sense of Chapter 6 of Part II. In Section 12.2 we discuss a technique introduced by Thomas Streicher in order to establish computational completeness; the technique relies of the fact that PCF extended with ∃ is known to be computationally complete. In Section 12.3 we apply the technique to show that Real PCF extended with ∃ is computationally complete. A limitation of this technique is that it does not give information about definability in the case that ∃ is not available. In Section 12.4 we discuss a new technique for establishing computational completeness. As a corollary, in Section 12.5 we obtain a very simple new proof of computational completeness of PCF extended with ∃. The technique works in its full generality only for algebraic domains in its present form. However, in Section 12.6 we are able to apply the technique to show that ∃ is not necessary to define the first-order computable functions in Real PCF, as it is the case for PCF, thus obtaining more information about definability.

12.1 The unique sound effective presentation of the partial real line

Recall that we defined a functor T : SDom → SDom by

T D = B × D × D

(Definition 10.19). As we have seen in Chapter 10, the carrier of the bifree T -algebra is the domain of infinite binary trees with nodes labelled by truthvalues. Since B^{ω} is isomorphic to this domain, there is a bifree T -algebra with B^{ω} as its carrier.

Lemma 12.1 There is a computable bifree algebra mktree : T B^{ω} → B^{ω}. Proof B^{ω} is the canonical solution to the domain equation D ≅ B × D. A bifree algebra is given by cons : B × B^{ω} → B^{ω} defined in Proposition 6.10.

Since Pair : B^{ω} → B^{ω} × B^{ω} defined in Section 3.4 is an isomorphism, so is mktree(t, p, q) = cons(t, Pair^{−1}(p, q)). This isomorphism is clearly computable. A routine verification shows that ⟨mktree^{−1}, mktree⟩ is a T -inductive isomorphism pair (cf. Definition 5.2). By Proposition 5.3, mktree is an initial algebra. □ Now, recall that we defined maps

I ⇆_{destr}^{cons} T I

by

cons(p, y, z) = pif x then cons_{L}(y) else cons_{R}(z),
destr(x) = ⟨head(x), tail_{L}(x), tail_{R}(x)⟩

(Definition 10.19) and that these maps were shown to form a T -inductive section-retraction pair in Theorem 10.20. Recall also that we defined num to be the unique algebra homomorphism from mktree to cons, and bin to be the unique coalgebra homomorphism from destr to mktree^{−1} (Definition 10.26), and that ⟨bin, num⟩ is a section-retraction pair by virtue of Proposition 5.5.

Theorem 12.2 There is an effective presentation of I which makes cons_{L}, cons_{R}, head, tail_{L}, and tail_{R} computable. Proof By Theorem 10.32, the idempotent norm = bin ∘ num is computable w.r.t. the standard effective presentation of B^{ω}. Therefore ⟨bin, num⟩ is an effective presentation of I. By Lemmas 10.31 and 10.33, the above functions are computable. □

Theorem 12.3 Any two effective presentations of I which make cons_{L}, cons_{R}, head, tail_{L}, and tail_{R} computable are equivalent. Proof Any two effective presentations which make the above maps computable also make destr and cons computable. Therefore the result follows from Theorem 6.12. □ Similarly,

Theorem 12.4 There is an effective presentation of R_{⊥} which makes rcons_{L}, rcons_{R}, rhead_{0}, rhead_{1}, rtail_{L}, rtail_{R}, incl and trunc computable.

Theorem 12.5 Any two effective presentations of R_{⊥} which make rcons_{L}, rcons_{R}, rhead_{0}, rhead_{1}, rtail_{L}, and rtail_{R}, incl and trunc computable are equivalent.

Convention 12.6 Whenever we implicitly or explicitly speak about computability on I or R_{⊥}, we assume any effective presentation which make the above operations computable. □

12.2 Computational completeness via universal domains

Definition 12.7 We say that a programming language is computationally complete if every computable element of its universe of discourse is definable in the language. □

The term universal is also used to refer to this property (because of universal Turing machines), but we avoid it as it is very overloaded (e.g. universal domain, universal property of a categorical construction).

We prove that Real PCF extended with ∃ is computationally complete by means of a technique introduced by Thomas Streicher [Str94] in order to prove that PCF extended with recursive types, parallel-or and ∃ is computationally complete. Here are the main steps of his proof:

1. Show that every definable element is computable.

2. Take a universal domain U of PCF, e.g. (N ⇒ B).

3. Show that for every domain D in the extended language there is a definable section-retraction pair

D ⇆_{s_{D}}^{r_{D}} U

4. Given d ∈ D computable, s_{D}(d) ∈ U is computable because s_{D} is computable.

5. Since PCF extended with parallel-or and ∃ is computationally complete [Plo77] and U is a PCF domain, s_{D}(d) is definable.

6. Hence so is d, because d = r_{D}(s_{D}(d)).

7. Therefore every computable element is definable.

The crucial step consists in showing that D is a definable retract of U, and this is not so simple in the presence of recursive types. But in our case the situation is very simple:

Lemma 12.8 Let PCF’ be any extension of PCF with parallel-or, ∃, new ground types and new constants such that

1. Every PCF’-definable element is computable.

2. Every ground domain of PCF’ is a definable retract of a PCF universal domain U such that U ⇒ U is a computable retract of U.

Then PCF’ is computationally complete. Proof In order to apply Streicher’s argument, it suffices to show by induction on types that every domain D in PCF’ is a definable retract of U. The base case holds by hypothesis. For the inductive step, assume that D and E are definable retracts of U. We have to show that D ⇒ E is a definable retract of U. The function space D ⇒ E is a retract of U ⇒ U as indicated below,

D ⇆_{r_{E}⇒s_{D}}^{s_{E}⇒r_{D}} (U ⇒ U),

because

(s_{E} ⇒ r_{D}) ∘ (r_{E} ⇒ s_{D})(f) = (s_{E} ⇒ r_{D})(s_{D} ∘ f ∘ r_{E})
= r_{D} ∘ s_{D} ∘ f ∘ r_{E} ∘ s_{E}
= id ∘ f ∘ id = f.

Let

(U ⇒ U) ⇆_{s_{U}}^{r_{U}} U,

be a computable section-retraction pair. Then

D ⇆_{s_{U} ∘(r_{E}⇒s_{D})}^{(s_{E}⇒r_{D})∘r_{U}} U,

is a section-retraction pair, because section-retraction pairs compose. Therefore D ⇒ E is a definable retract of U, because

(s_{E} ⇒ r_{D}) ∘ r_{U}(u) = r_{D} ∘ r_{U}(u) ∘ s_{E},
s_{U} ∘ (r_{E} ⇒ s_{D})(f) = s_{U}(s_{D} ∘ f ∘ r_{E}),

and s_{U} and r_{U} are definable by computational completeness of PCF extended with parallel-or and ∃.

□

12.3 Computational completeness of Real PCF

Definition 12.9 In PCF we don’t have product types, and hence we have to work with curried maps in order to capture maps C × D → E, and we have to work with pairs of maps in order to capture maps C → D × E. In order to avoid unnecessary detailed constructions in the following proofs, we say that a map is essentially definable if we can define it by eliminating product types in this (standard) way. □

The uniqueness part of the following theorem appears to be new, but it is certainly not unexpected:

Theorem 12.10 There is a unique notion of computability for PCF such that every PCF definable element is computable.

By this we mean that there is a unique effective presentation of the PCF domains with the above property, up to equivalence.

Proof In [Plo77] it is shown that the following enumerations are effective presentation of the PCF ground domains:

B_{B} = B  \begin{aligned}b_{0}^{B} & = ⊥ \\ b_{1}^{B} & = tt \\ b_{n+2}^{B} & = ff \end{aligned}  B_{N} = N  \begin{aligned}b_{0}^{N} & = ⊥ \\ b_{n+1}^{N} & = n, \end{aligned}

and it is also shown that the elements of L_{DA}, L_{PA} and L_{PA+∃} are computable with respect to it.

Uniqueness for B follows from the fact that it is a finite domain. In order to establish uniqueness for N, recall that it is the canonical solution of the domain equation N ≅ 1+N. Then we can apply Theorem 6.11, because the (standard) bifree algebra and its inverse are essentially definable.

Finally we can apply Proposition 6.8 to lift the effective presentations to higher-order types in a unique way, up to equivalence. □

This result extends to Real PCF:

Theorem 12.11 There is a unique notion of computability for the real numbers type hierarchy such that every Real PCF definable element is computable. Proof Immediate consequence of Theorems 12.2, 12.3, 12.4 and 12.5, and Proposition 6.8. □

Proposition 12.12 ∃ is computable but not Real PCF definable. Proof The inductive proof given in [Plo77] for the fact that ∃ is not definable in PCF extended with parallel-or goes through for Real PCF, by adding obvious inductive steps for the Real PCF constants. □

Theorem 12.13 Real PCF extended with ∃ is computationally complete. Proof By virtue of Lemma 12.8, it suffices to show that every ground type is a definable retract of some universal domain of PCF. The maps

B_{ω} ⇆_{e}^{p} (N ⇒ B)

defined by

e(x)(n) = \begin{cases}⊥ & if n = ⊥, \\ x_{n} & otherwise, \end{cases}
p(f)(i) = f(i)

form a section-retraction pair (with the strict functions N → B as the fixedpoints of the induced idempotent). Hence U = (N ⇒ B) is a universal domain. It is immediate that B and N are definable retracts of U.

In order to show that I is a definable retract of U, we apply Lemma 5.7. Define

mktree′ = e ∘ mktree ∘ T p,
dstree′ = T e ∘ dstree ∘ p,

where dstree = mktree^{−1}. Then mktree′ and dstree′ are easily seen to be essentially definable. Define bin : I → U and num : U → I recursively by

bin′ = cons ∘ T bin′ ∘ dstree′
num′ = mktree′ ∘ T num′ ∘ ∘destr.

By Lemma 5.7, ⟨bin′, num′⟩ is a section-retraction pair. Since cons, destr, mktree′ and dstree are essentially definable, bin′ and num′ are (strictly) definable. Therefore I is a definable retract of U.

R_{⊥} is treated similarly. □ There is another way of showing that I and R_{⊥} are definable retracts

of U, based on Theorems 7.15 and 7.17. If we show that the maps join_{a}^{D} and way-below_{a}^{D}, for D ∈ {I, R_{⊥}} are definable uniformly in the Gödel number of a, then we can define

s(n)(x) = way-below_{n}^{D}(x)

and the proof of Theorem 7.15 gives a construction of the desired definable retraction. This is done in Section 12.6 below, with the purpose of obtaining more information about Real PCF definability.

12.4 Computational completeness via joining maps

In this section we introduce a general technique for establishing universality of extensions of PCF with ground types interpreted as algebraic coherently complete domains. It particular, we obtain a new proof of universality of PCF extended with the parallel conditional and the existential quantifier. It is an open problem to extend the technique to the continuous case, but the technique is intrinsically restricted to coherently complete domains, due to the results of Chapter 7.1.

In this section we work with effectively given algebraic domains in the sense of Definition 3.5.

Let L_{P} be an extension of L_{DA} with new ground types and a set of new constants P ⊇ DA, and consider any extension of the standard interpretation of L_{DA} to L_{P} such that

1. The interpretation of ground types is given by coherently complete algebraic domains.

2. The interpretation is computationally feasible, in the sense that there is an effective presentation of the new ground domains such that every L_{P} - definable element is computable w.r.t. the induced effective presentations at higher-order types.

Definition 12.14 A J_{P} -domain is a domain D for which there is an L_{P} - definable function

N → (D ⇒ D)
n ↦ join_{n}^{D}
⊥ ↦ ⊥

such that join_{n}^{D} is a joining map of b_{n}^{D}. □

Lemma 12.15 If D is a J_{P} -domain then every computable element of D is L_{P} -definable. Proof Let x ∈ D be computable. Then there is a primitive recursive function k ↦ n_{k} such that x = ⨆_{k∈ℕ} b_{n_{k}}^{D}. Let Φ be the endomap on the function space

(N ⇒ (D ⇒ D)) ⇒ D

defined by

Φ(F)(f) = f(0)(F (n ↦ f(n + 1))),

for F ∈ (N ⇒ (D ⇒ D)) ⇒ D and f ∈ N ⇒ (D ⇒ D). Then Φ^{m}(⊥)(f) = f(0) ∘ f(1) ∘ ⋯ ∘ f(m)(⊥). Hence

⨆_{m∈ℕ}Φ^{m}(⊥) (k ↦ join_{n_{k}}^{D}) = ⨆_{m∈ℕ}join_{n_{0}}^{D} ∘ join_{n_{1}}^{D} ∘ ⋯ ∘ join_{n_{m}}^{D}(⊥)
= ⨆_{m∈ℕ}b_{n_{0}}^{D} ⊔ b_{n_{1}}^{D} ⊔ ⋯ ⊔ b_{n_{m}}^{D}
= x,

and thus x is the least fixed point of Φ applied to the map k ↦ join_{n_{k}}^{D}. Therefore x is L_{P} -definable, because Φ is L_{P} -definable. □

We let way-below_{n}^{D} be a short hand for way-below_{b_{n}^{D}}^{D}. Recall that the way-below maps were defined in the proof of Theorem 7.17.

Definition 12.16 A W_{P} -domain is a domain D such that the map

N → (D ⇒ B)
n ↦ way-below_{n}^{D}
⊥ ↦ ⊥

is L_{P} -definable. □

Lemma 12.17 If D is a W_{P} -domain and E is a J_{P} -domain then D ⇒ E is a J_{P +pif}-domain. Proof The construction given in Theorem 7.17 shows that there is a definable map n ↦ join_{n}^{D⇒E} with the desired property. First, there is a L_{P +pif}-definable map n ↦ sjoin_{n}^{D⇒E} such that sjoin_{n}^{D⇒E} is a joining map of the subbasis element s_{n}^{D}, because

sjoin_{⟨n,m⟩}^{D⇒E}(f)(x) = pif^{E} way-below_{n}^{D}(x) then join_{m}^{E}(f(x)) else f(x).

Hence n ↦ join_{n}^{D⇒E} can be recursively given by

join_{n}^{D⇒E}(f)(x) = if “b_{n}^{D⇒E} = ⊥” then f(x) else sjoin_{δ(n)}^{D⇒E}(join_{ρ(n)}^{D⇒E}(f)(x)).

where δ and ρ are recursive functions specified immediately after Definition 3.1, and “b_{n}^{D⇒E} = ⊥” is some term defining the recursive predicate b_{n}^{D⇒E} = ⊥ of n.

□

Define the bounded universal quantifier

\begin{matrix}N & → & (N & ⇒ & B) & → & B \\ n & ↦ & & p & & ↦ & ∀_{x∈Δ_{n}} p(x) \end{matrix}

by

∀_{x∈Δ_{n}} p(x) = \begin{cases}tt & if p(x) = tt for all x ∈ Δ_{n}, \\ ff & if p(x) = ff for some x ∈ Δ_{n}, \\ ⊥ & otherwise, \end{cases}

where Δ_{n} is specified in Definition 3.1.

Lemma 12.18 The bounded universal quantifier is L_{PA}-definable. Proof Recursively define the bounded quantifier by

∀_{x∈Δ_{n}} p(x) = “Δ_{n} = ∅” ∨ (p(δ(n)) ∧ ∀_{x∈Δ_{ρ(n)}} p(x)) ,

where δ and ρ are specified immediately after Definition 3.1, “Δ_{n} = ∅” stands for the equality test n =_{⊥} 0, and ∨ and ∧ are parallel-or and parallel-and [Plo77]. Actually, a sequential version of disjunction would be enough. But parallel conjunction is necessary, because p(x) can be ⊥ for some x ∈ Δ_{n} and ff for another x ∈ Δ_{n}, and one has to ensure that in such cases ∀_{x∈Δ_{n}} p(x) = ff. □

The following definability lemma depends on the fact that the function space D ⇒ E is an algebraic domain, as it makes use of Lemmas 7.18 and 3.10:

Lemma 12.19 If D is a J_{P} -domain and E is a W_{P} -domain then D ⇒ E is a W_{P +pif+∃}-domain. Proof If D is a J_{P} -domain then there is a L_{P} -definable function

N → (N → D)
n ↦ up_{n}^{D}

such that the range of up_{n}^{D} is ↑ ↑b_{n}^{D} ∩ B_{D} (and therefore up_{n}^{D}(⊥) = b_{n}^{D}), given by

up_{n}^{D}(m) = join_{n}^{D} ∘ join_{m}^{D}(⊥).

By Lemmas 7.18 and 3.10,

way-below_{n}^{D⇒E}(f) = ∀_{⟨a,b⟩∈Δ_{n}} ∀_{k∈N} way-below_{b}^{E}(f(up_{a}^{D}(k))),

where ∀_{k∈N} e = ¬∃λk.¬e. This establishes the L_{P +pif+∃}-definability of the map n ↦ way-below_{n}^{D⇒E}. □

In joint work with Thomas Erker and Klaus Keimel [EEK97], we have obtained a characterization of the way-below order on function spaces X → E where X is a coherent space and E is a bounded complete domain. However, we haven’t had the opportunity to consider the application of this characterization to the extension of the method of proof introduced in this section to continuous domains.

12.5 Computational completeness of PCF revisited

In [Plo77] it is shown that L_{DA} and L_{PA} are not computationally complete, but that L_{P A+∃} is. The proof given in [Plo77] is based on the fact that the ground domains are flat. We offer another proof, based on the general results of the previous section.

Lemma 12.20 Each PCF ground domain is a J_{DA}-domain and a W_{DA}-domain. Proof Recall from Proposition 7.2 that every element of a flat domain has a unique joining map, and that it is the identity for the bottom element and a constant function for a non-bottom element. The map join_{n}^{B} is given by

join_{n}^{B}(x) = if x =_{⊥} 0 then x else ((n − 1) =_{⊥} 0).

The map join_{n}^{N} is given by

join_{n}^{N} (x) = if x =_{⊥} 0 then x else n − 1.

Therefore n ↦ join_{n}^{D} is DA-definable for D ground. The map way-below_{n}^{B} is given by

way-below_{n}^{B}(x) = n =_{⊥} 0 ∨ if n =_{⊥} 1 then x else ¬x.

The map way-below_{n}^{N} is given by

way-below_{n}^{N} (x) = (n =_{⊥} 0) ∨ ((n − 1) =_{⊥} x).

Therefore n ↦ way-below_{n}^{D}(x) is DA-definable for D ground. □

Theorem 12.21 L_{P A+∃} is computationally complete. Moreover, every firstorder computable function is L_{PA}-definable. Proof Every domain is a J_{PA+∃}-domain and a W_{PA+∃}-domain, by a simultaneous induction on the formation rules of the PCF domains; Lemma 12.20 establishes the base cases, and Lemmas 12.17 and 12.19 establish the inductive steps. Then the result follows from Lemma 12.15. First-order computational completeness follows from the fact that the existential quantifier is needed only in the hypothesis of Lemma 12.19. □

12.6 Computational completeness of Real PCF revisited

We know that Real PCF extended with ∃ is computationally complete. In this section we show that ∃ is not necessary to define the first-order computable functions, as it is the case for PCF. For the sake of brevity, we only treat the type I, as the treatment of R_{⊥} is analogous.

We assume the notion of effectively given domain given in [Smy77] via enumerations of basis elements. Essentially, the axioms are the same as for effectively given algebraic domains via enumerations of basis elements as in Definition 3.5, with some technical axioms which ensure that we obtain a cartesian closed category. Since these technical axioms are not important for our purposes as we are concerned with first-order types only, we adopt the naïve approach.

Recall that an enumeration {r_{n}}_{n∈ℕ} of the rational numbers is standard if there are recursive functions n ↦ s_{n}, n ↦ p_{n} and n ↦ q_{n} such that r_{n} = (−1)^{s_{n}} p_{n}/q_{n}.

Lemma 12.22 An enumeration {r_{n}}_{n∈ℕ} of the rational numbers is standard iff the basic four operations and the (in)equality predicates are recursive with respect to it.

For example, Cantor’s enumeration of the rational numbers is standard. In this section {r_{n}}_{n∈ℕ} is any standard enumeration of the rational numbers contained in the unit interval.

Let B be the basis of I consisting of intervals with (not necessarily distinct) rational end-points. Then the following enumeration of B gives rise to an effective presentation of I:

b_{⟨m,n⟩} = [min(r_{m}, r_{n}), max(r_{m}, r_{n})]

By Lemma 12.22, we see that the basic primitives for real number computation are computable w.r.t. this presentation.

Lemma 12.23 The (strict) map n ↦ b_{n} : N → I is Real PCF definable. Proof By Lemma 12.22, for each a ∈ {L, R} there are recursive functions g_{a} and h such that

b_{g_{a}(n)} = tail_{a}(b_{n}^{I})
h(n) = head(b_{n}^{I}),

and we have that

b_{n} = if h(n) then cons_{L}(b_{g_{L}(n)}) else cons_{R}(b_{g_{R}(n)}). □

Lemma 12.24 I is a J_{RA}-domain and W_{RA}-domain. Proof It is not hard to see that for every a,

join_{a}^{I}(x) = max(\underline{a}, min(x, \overline{a})),
way-below_{a}^{I}(x) = (\underline{a} = 0 ∨ \underline{a} <_{⊥} x) ∧ (x <_{⊥} \overline{a} ∨ \overline{a} = 1),

and also that there are recursive maps f and g such that b_{f_{D}(n)} = \underline{b_{n}} and b_{g_{D}(n)} = \overline{b_{n}}. Then n ↦ join_{n}^{I} and n ↦ way-below_{n}^{I} are given by

join_{n}^{I}(x) = max(b_{f(n)}, min(x, b_{g(n)})),
way-below_{n}^{I}(x) = (b_{f(n)}^{I} = 0 ∨ b_{f(n)}^{I} <_{⊥} x) ∧ (x <_{⊥} b_{g_{(}n)} ∨ b_{g_{(}n)} = 1). □

Since R_{⊥} can be treated similarly, Real PCF is first-order computationally complete, in the following sense:

Theorem 12.25 All first-order computable elements of the real numbers type hierarchy are Real PCF definable. Proof Lemmas 12.24, 12.17 and 12.15. □

In joint work with Abbas Edalat [EE96b], we have extended the above method to second-order functions, by obtaining a suitable characterization of the way-below order on the function space R_{⊥} → R_{⊥}; but notice that the existential quantifier is still needed for second-order functions, because function spaces are handled by Lemma 12.19, which uses the existential quantifier.

Part V

Integration on the partial real line

This part is based on joint work with Abbas Edalat [EE95, EE96a]. In Chapter 13 we introduce interval Riemann integration. In Chapter 14 we show how to handle interval Riemann integration in Real PCF.

Interval Riemann integrals

A generalization of the Riemann theory of integration based on domain theory was introduced in [Eda95b]. Essentially, a domain-theoretic framework for the integration of real-valued functions w.r.t. any finite measure on a compact metric space was constructed using the probabilistic power domain of the upper space of the metric space. In this work we are only concerned with integration w.r.t. the Lebesgue measure (uniform distribution) in ℝ^{n}.

In order to extend Real PCF with integration, we embark on a novel approach compared to [Eda95b] for integration w.r.t. the Lebesgue measure in ℝ, in that we consider integration of maps of type R^{n} → R rather than ℝ^{n} → ℝ. We deduce various properties of integration defined in this way, which are interesting in their own right as well.

In Section 13.1 we introduce simple interval Riemann integration. In Section 13.2 we introduce multiple Riemann integration, which is related to simple interval Riemann integration via a generalization of the so-called Fubini’s rule. In Section 13.3 we introduce a supremum operator, which is used in Chapter 14 to obtain a fixed-point definition of Riemann integration.

13.1 Simple interval Riemann Integrals

Recall that addition in R is defined by

x + y = [\underline{x} + \underline{y}, \overline{x} + \overline{y}],

and that given a real number α ≥ 0 and an interval x, we have that

xα = αx = [\underline{x}α, \overline{x}α].

In this chapter it will be convenient to denote the diameter κ_{x} of an interval x ∈ R by dx:

dx = \overline{x} − \underline{x}.

A partition of an interval [a, b] is a finite set of the form

P = {[a, x_{1}], [x_{1}, x_{2}], …, [x_{n−1}, x_{n}], [x_{n}, b]}.

We denote by P[a, b] the set of all partitions of [a, b]. A partition Q refines a partition P if Q is obtained by partitioning some elements of P, in the sense that there is a (necessarily unique) family {Q_{x}}_{x∈P} such that Q is its disjoint union and Q_{x} is a partition of x for each x ∈ P. Such a family is called the refinement witness.

Lemma 13.1 P[a, b] is directed by the refinement order. That is, for any two partitions of [a, b] there is a third partition refining both.

Definition 13.2 Let f : R → R be a map and [a, b] be an interval. An interval Riemann sum of f on [a, b] is a sum of the form

∑_{x∈P} f(x)dx  for P ∈ P[a, b]. □

Lemma 13.3 Let f : R → R be a monotone map (w.r.t. the information order). If a partition Q of an interval [a, b] refines a partition P then

∑_{x∈P} f(x)dx ⊑ ∑_{x∈Q} f(x)dx.

Therefore, the set of interval Riemann sums of f on [a, b] is directed. Proof If two compact intervals x_{1} and x_{2} just touch then

f(x_{1} ⊓ x_{2})d(x_{1} ⊓ x_{2}) = f(x_{1} ⊓ x_{2})(dx_{1} + dx_{2})
= f(x_{1} ⊓ x_{2})dx_{1} + f(x_{1} ⊓ x_{2})dx_{2}
⊑ f(x_{1})dx_{1} + f(x_{2})dx_{2}.

By induction, if successive elements of the sequence x_{1}, …, x_{n} just touch then

f( ⨅_{k=1}^{n} x_{k})d( ⨅_{k=1}^{n} x_{k}) ⊑ ∑_{k=1}^{n} f(x_{k})dx_{k}.

Hence, if {Q_{x}}_{x∈P} is the refinement witness, then for any x ∈ P,

f(x)dx ⊑ ∑_{y∈Q_{x}} f(y)dy,

because x = ⨅ Q_{x}. By monotonicity of addition and induction on the size of P,

∑_{x∈P} f(x)dx ⊑ ∑_{x∈P} ∑_{y∈Q_{x}} f(y)dy.

Since Q is the disjoint union of the sets Q_{x} and addition is associative,

∑_{x∈P} ∑_{y∈Q_{x}} f(y)dy = ∑_{y∈Q} f(y)dy. □

Definition 13.4 The interval Riemann integral of a monotone map f : R → R on an interval [a, b] is defined by

∫_{a}^{b} f =\begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P} f(x)dx.

We sometimes denote ∫_{a}^{b} f by ∫_{a}^{b} f(x)dx. □

Proposition 13.5 For all continuous maps f, g : R → R and all real numbers α and β,

∫_{a}^{a} f = 0,
∫_{a}^{b} f + ∫_{b}^{c} f = ∫_{a}^{c} f,
∫_{a}^{b}(αf + βg) = α ∫_{a}^{b} f + β ∫_{a}^{b} g.

Proof The first equation follows from the fact that {[a, a]} is the only partition of [a, a]. If P and Q are partitions of [a, b] and [b, c] respectively, then P ∪ Q is a partition of [a, c]. Conversely, if R is partition of [a, c], then there are partitions P and Q of [a, b] and [b, c] respectively such that P ∪ Q refines R. Therefore

∫_{a}^{b} f + ∫_{b}^{c} f = \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P} f(x)dx +\begin{matrix}⨆ & ↑ \\ Q∈P[b,c] \end{matrix} ∑_{y∈Q} f(y)dy

= \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} \begin{matrix}⨆ & ↑ \\ Q∈P[b,c] \end{matrix} ∑_{x∈P} f(x)dx + ∑_{y∈Q} f(y)dy

= \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} \begin{matrix}⨆ & ↑ \\ Q∈P[b,c] \end{matrix} ∑_{z∈P ∪Q} f(z)dz

= \begin{matrix}⨆ & ↑ \\ R∈P[a,c] \end{matrix} ∑_{z∈R} f(z)dz

= ∫_{a}^{c} f.

We omit the routine proof of the third equation. □ Clearly, ∫_{a}^{b} f depends only on the values that f assumes on I[a, b].

Theorem 13.6 For every interval [a, b], the integration map

f ↦ ∫_{a}^{b} f : (I[a, b] ⇒ R) → R

is continuous.

Proof Let F be a directed subset of the domain I[a, b] ⇒ R. Then

∫_{a}^{b} ^{⨆↑} F = \begin{matrix}⨆ & ↑ \\ P \end{matrix} ∑_{x∈P} (^{⨆↑} F) (x)dx

= \begin{matrix}⨆ & ↑ \\ P \end{matrix} ∑_{x∈P} ( \begin{matrix}⨆ & ↑ \\ f∈F \end{matrix} f(x)) dx

= \begin{matrix}⨆ & ↑ \\ P \end{matrix} ∑_{x∈P} \begin{matrix}⨆ & ↑ \\ f∈F \end{matrix} f(x)dx

= \begin{matrix}⨆ & ↑ \\ P \end{matrix}\begin{matrix}⨆ & ↑ \\ f∈F \end{matrix} ∑_{x∈P} f(x)dx

= \begin{matrix}⨆ & ↑ \\ f∈F \end{matrix} \begin{matrix}⨆ & ↑ \\ P \end{matrix} ∑_{x∈P} f(x)dx

= \begin{matrix}⨆ & ↑ \\ f∈F \end{matrix} ∫_{a}^{b} f. □

Any dense subset A of [a, b] induces a basis

B = {[x, y]|x ≤ y in A}

of I[a, b].

Lemma 13.7 Let [a, b] be an interval, let B be any basis of I[a, b] induced by a dense subset of [a, b], and denote by P_{B}[a, b] the partitions of [a, b] consisting of basis elements. Then for any continuous function f : I[a, b] → R,

∫_{a}^{b} f =\begin{matrix}⨆ & ↑ \\ Q∈P_{B}[a,b] \end{matrix} ∑_{x∈Q} f(x)dx.

Proof Let u ≪ ∫_{a}^{b} f. It suffices to conclude that

u ⊑\begin{matrix}⨆ & ↑ \\ P ∈P_{B}[a,b] \end{matrix} ∑_{x∈P} f(x)dx.

Let P = {x_{1}, …, x_{n}} ∈ P[a, b] such that u ≪ ∑_{x∈P} f(x)dx. W.l.o.g., we can assume that [a, b] has non-zero diameter and that P consists of intervals of non-zero diameter. Then for each x ∈ P there is some x′ ≪ x in B such that already

u ≪ ∑_{x∈P} f(x′)dx

because f, addition, and scalar multiplication are continuous. Wlog we can assume that only successive elements of the sequence x′_{1}, …, x′_{n} do not overlap, because otherwise we can shrink the intervals x′_{i} in such a way that that the above inequality still holds. Then the unique partition Q of [a, b] consisting of intervals of non-zero diameter with the end-points of the intervals x′_{1}, …, x′_{n} is of the form {y_{1}, z_{1}, y_{2}, …, z_{n−1}, y_{n}} with 1. z_{i} = x′_{i} ⊔ x′_{i+1} for 1 ≤ i ≤ n

2. (a) y_{1} ⊓ z_{1} = x′_{1} and z_{n−1} ⊓ y_{n} = x′_{n} (b) z_{i−1} ⊓ y_{i} ⊓ z_{i} = x′_{i} for 1 < i < n.

We claim that

∑_{x∈P} f(x)dx ⊑ ∑_{y∈Q} f(y)dy,

which implies that

u ≪\begin{matrix}⨆ & ↑ \\ Q∈P_{B}[a,b] \end{matrix} ∑_{x∈Q} f(x)dx,

by transitivity, and concludes the proof. For notational simplicity and w.l.o.g., we prove the claim for the case P = {x_{1}, x_{2}}. In this case the claim reduces to

f(x′_{1})dx_{1} + f(x′_{2})dx_{2} ⊑ f(y_{1})dy_{1} + f(z_{1})dz_{1} + f(y_{2})dy_{2},

and is proved by

f(x′_{1})dx_{1} + f(x′_{2})dx_{2}
= f(x′_{1})(dy_{1} + dx_{1} − dy_{1}) + f(x′_{2})(dx_{2} − dy_{2} + dy_{2})
= f(x′_{1})dy_{1} + f(x′_{1})(dx_{1} − dy_{1}) + f(x′_{2})(dx_{2} − dy_{2}) + f(x′_{2})dy_{2}
⊑ f(y_{1})dy_{1} + f(z_{1})(dx_{1} − dy_{1}) + f(z_{1})(dx_{2} − dy_{2}) + f(y_{2})dy_{2}
= f(y_{1})dy_{1} + f(z_{1})dz_{1} + f(y_{2})dy_{2}. □

Remark 13.8 Moore [Moo66] handles integration by considering sums which are essentially interval Riemann sums for partitions consisting of n intervals of the same length, but he restricts his definition to rational functions. The integrand is assumed to be monotone w.r.t. inclusion and continuous w.r.t. the Hausdorff metric on intervals. Since the Hausdorff metric induces the Lawson topology on R, the integrand is Scott continuous [EC93, GHK^{+}80] (cf. Remark 8.1). Therefore Lemma 13.7 above and Theorem 13.13 below show that our definition generalizes that of Moore to all Scott continuous functions, and Theorem 13.9 below shows that our definition captures all Riemann integrable functions. □

Recall that given any continuous function f : ℝ → ℝ, the function If : R → R defined by

If(x) = f(x)

is a continuous extension of f. Since continuous maps preserve connectedness and compactness,

If(x) = [inf f(x), sup f(x)].

Hence the end-points of an interval Riemann sum are given by lower and upper Darboux sums respectively:

∑_{x∈P} If(x)dx = [∑_{x∈P} inf f(x)dx, ∑_{x∈P} sup f(x)dx] .

Therefore the interval Riemann integral is a singleton in this case:

∫_{a}^{b} If = [\underline{∫{b \atop a}}f, \overline{∫{b \atop a}}f] = \{∫_{a}^{b} f\} ,

where the symbols \underline{∫{b \atop a}} and \overline{∫{b \atop a}} denote lower and upper Riemann integrals respectively. Any continuous map f : ℝ → ℝ has infinitely many distinct continuous extensions to R → R. Recall that the extension If is characterized as the greatest one. Theorem 13.13 below shows that If can be replaced by any continuous extension of f in the above equation. Moreover, Theorem 13.9 below shows that the above equation can be generalized to any Riemann integrable function. Recall that a function is Riemann integrable on compact intervals iff it is bounded on compact intervals and continuous almost everywhere [Roy88], and that in this case the value of the integral depends only on the points of continuity of the function. Recall also that Theorem 8.8 shows that for any function f : ℝ → ℝ bounded on compact intervals there is a continuous map f̈: R → R agreeing with f at every point of continuity of f, given by

f̈(x) = [inf \underline{g}(x), sup \overline{g}(x)],

where \underline{g} : ℝ → \underline{ℝ} and \overline{g} : ℝ → \overline{ℝ} are continuous maps defined by

\underline{g}(y) = lim inf_{x→y} f(x)  and  \overline{g}(y) = lim sup_{x→y} f(x).

The following theorem shows that interval Riemann integration, even when restricted to Scott continuous functions, captures all Riemann integrable functions.

Theorem 13.9 Let f : ℝ → ℝ be Riemann integrable on compact intervals [a, b], and let f̈ : R → R be the Scott continuous function defined in Theorem 8.8. Then

∫_{a}^{b} f̈ = {∫_{a}^{b} f} .

Proof By Theorem 8.8,

∫_{a}^{b} f̈ = \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P} f̈(x)dx

= \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P}[inf \underline{g}(x), sup \overline{g}(x)]dx

= \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} [∑_{x∈P} inf \underline{g}(x)dx, ∑_{x∈P} sup \overline{g}(x)dx]

= [ sup_{P ∈P[a,b]} ∑_{x∈P} inf \underline{g}(x)dx, inf_{P ∈P[a,b]} ∑_{x∈P} sup \overline{g}(x)dx]

= [\underline{∫{b \atop a}}\underline{g}, \overline{∫{b \atop a}}\overline{g}]

= {∫_{a}^{b} f} ,

because \underline{g} and \overline{g} agree with f at every point of continuity of f. □

Lemma 13.10 For every continuous function f : R → R there is a greatest continuous function f̂: R → R such that

f_{|Max R} = f̂_{|Max R},

given by

f̂(x) = ⨅ f(↑ ↑x ∩ Max R)

Proof We first restrict f to Max R ≅ ℝ, and then we find the greatest continuous extension to R by an application of Lemma 8.6, obtained by a formula which is essentially the same as the above one. □

Lemma 13.11 For any continuous f : R → R,

∫_{a}^{b} f = ∫_{a}^{b} f̂.

Proof ∫_{a}^{b} f ⊑ ∫_{a}^{b} f̂ because f ⊑ f̂. For the other direction, we first prove that

f̂(x)dx ⊑ ∫ \overline{x} ; \underline{x} f

for all x ∈ R. Let b ≪ f̂(x)dx. It suffices to conclude that

b ⊑ ∫ \overline{x} ; \underline{x} f.

Since f̂(x) = ⨅_{r∈x}f({r}), by Lemma 13.10, we have that b ≪ f({r})dx for all r ∈ x. By continuity of f, for each r ∈ x there is a w_{r} ≪ {r} such that already b ≪ f(w_{r})dx. Since the interiors of the intervals w_{r} form an open cover of the compact interval x, there is a finite subset C of {w_{r}}_{r∈x} such that the interiors of the members of C already cover x. Since the way-below order of R is multiplicative, b ≪ ⨅_{y∈C} f(y)dx . Now, there is a unique partition P of x, consisting of non-singleton intervals, such that the set of end-points of elements of P is the set of end-points of elements of C belonging to x, together with the two points \underline{x} and \overline{x}. Since

f(z) ⊑ ⨅_{y∈P,z⊑y} f(y),

we have that

⨅_{z∈C} f(z) ⊑ ⨅_{z∈C} ⨅_{y∈P,z⊑y} f(y) = ⨅_{y∈P} f(y).

Hence b ≪ ⨅_{y∈P} f(y)dx. But

⨅_{y∈P} f(y)dx ⊑ ∑_{z∈P} f(z)dz,

because

⨅_{y∈P} f(y)dx = [min_{y∈P} f(y)dx, max_{y∈P} f(y)dx] ,

and hence the weighted average ∑_{z∈P} f(z)dz has to be contained in the latter interval. Therefore b ≪ ∑_{z∈P} f(z)dz ⊑ ∫ \overline{x} ; \underline{x} f, which yields b ⊑ ∫ \overline{x} ; \underline{x} f, as desired. Finally, we have that

∫_{a}^{b} f̂ = \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P} f̂(x)dx ⊑\begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∑_{x∈P} ∫ \overline{x} ; \underline{x} f

= \begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} ∫_{a}^{b} f = ∫_{a}^{b} f,

which concludes the proof. □

Theorem 13.12 The interval Riemann integral of a continuous function f : R → R depends only on the value that f assumes at maximal elements, in the sense that for any continuous function g : R → R,

f_{|Max (R)} = g_{|Max (R)} implies ∫_{a}^{b} f = ∫_{a}^{b} g.

Proof By Lemma 13.10, f_{|Max (R)} = g_{|Max (R)} implies f̂ = ĝ. Therefore the result follows from Lemma 13.11. □

Theorem 13.13 If f : ℝ → ℝ is Riemann integrable on compact intervals and f̃: R → R is any Scott continuous map agreeing with f at points of continuity of f, then

∫_{a}^{b} f̃ = {∫_{a}^{b} f} .

Proof By Theorem 13.9, we know that this is true for the greatest such f̃, namely f̈. Therefore the result follows from Theorem 13.12. □ The significance of Theorems 13.12 and 13.13 is that sometimes it is easy to obtain a Real PCF program for an extension of a function f but it is difficult or undesirable to obtain a program for its greatest continuous extension. For instance, the distributive law does not hold for the greatest continuous extensions of addition and multiplication, so that two different definitions of the same function can give rise to two different extensions and two different programs [Moo66].

13.2 Multiple interval Riemann integrals

A partition of a hyper-cube

a⃗ = (a_{1}, …, a_{n}) ∈ R^{n}

is a cartesian product

P⃗ = P_{1} × ⋯ × P_{n}

of partitions of a_{1}, …, a_{n} respectively. We denote the set of partitions of a⃗ by Pa⃗. Refinements are defined coordinatewise. The volume of an n-dimensional hyper-cube x⃗ is

dx⃗ = dx_{1} ⋯ dx_{n}.

Definition 13.14 Let f : R^{n} → R be a map and a⃗ be an n-dimensional hyper-cube. A multiple interval Riemann sum of f on a⃗ is a sum of the form

∑_{x⃗∈P⃗} f(x⃗)dx⃗  for P⃗ ∈ Pa⃗. □

Definition 13.15 The multiple interval Riemann integral of a monotone map f : R^{n} → R on a hyper-cube a⃗ is defined by

∫a⃗ f =\begin{matrix}⨆ & ↑ \\ P⃗ ∈Pa⃗ \end{matrix} ∑_{x⃗∈P⃗} f(x⃗)dx⃗.  □

For n = 1 this definition reduces to our previous definition:

∫_{(a)} f = ∫ \overline{a} \underline{a} f.

Theorem 13.16 (Fubini’s Rule) For every natural number n > 1, every continuous function f : R^{n} → R, and every n-dimensional hyper-cube a⃗,

∫a⃗ f = ∫_{(a_{1})} (∫a⃗′ f(x)dx′) dx_{1},

where a⃗′ = (a_{2}, …, a_{n}) and x′ = (x_{2}, …, x_{n}). Proof For notational simplicity and without essential loss of generality, we prove the claim for n = 2, which corresponds to the inductive step of the claim for arbitrary n by induction on n:

∫_{(a,b)} f = \begin{matrix}⨆ & ↑ \\ P ×Q∈P(a,b) \end{matrix} ∑_{(x,y)∈P ×Q} f(x, y)d(x, y)

= \begin{matrix}⨆ & ↑ \\ P ∈Pa \end{matrix}\begin{matrix}⨆ & ↑ \\ Q∈Pb \end{matrix} ∑_{x∈P} ∑_{y∈Q} f(x, y)dxdy

= \begin{matrix}⨆ & ↑ \\ P ∈Pa \end{matrix} ∑_{x∈P} (\begin{matrix}⨆ & ↑ \\ Q∈Pb \end{matrix} ∑_{y∈Q} f(x, y)dy) dx

= ∫_{(a)} λx ∫_{(b)} λyf(x, y). □

13.3 A supremum operator

In this section we define a supremum operator, which is used in Section 14.2 to obtain a fixed-point definition of interval Riemann integration. The presentation follows the same pattern as Section 13.1, and therefore we omit the proofs which are reworkings of previous proofs.

Lemma 13.17 Let f : R → R be a monotone map (w.r.t. the information order). If a partition Q of an interval [a, b] refines a partition P then

max_{x∈P} f(x) ⊑ max_{x∈Q} f(x).

Definition 13.18 For a function f : ℝ → ℝ we write

sup_{[a,b]} f = sup_{x∈[a,b]} f(x).

The supremum of a monotone map f : R → R on an interval [a, b] is defined by

sup_{[a,b]} f =\begin{matrix}⨆ & ↑ \\ P ∈P[a,b] \end{matrix} max_{x∈P} f(x).  □

Proposition 13.19 For all continuous maps f, g : R → R and all real numbers α and β,

sup_{[a,a]} f = f(a),
max(sup_{[a,b]} f, sup_{[b,c]} f) = sup_{[a,c]} f,
sup_{[a,b]} max(αf, βg) = max(α sup_{[a,b]} f, β sup_{[a,b]} g).

Clearly, sup_{[a,b]} f depends only on the values that f assumes on I[a, b].

Theorem 13.20 For every interval [a, b], the supremum map

f ↦ sup_{[a,b]} f : (I[a, b] ⇒ R) → R

is continuous.

Lemma 13.21 Let [a, b] be an interval, and let B be any basis of I[a, b]. Then for any continuous function f : I[a, b] → R,

sup_{[a,b]} f =\begin{matrix}⨆ & ↑ \\ Q∈P_{B}[a,b] \end{matrix} max_{x∈Q} f(x).

Clearly, for f : ℝ → ℝ continuous we have that

max_{x∈P} If(x) = [max_{x∈P} inf f(x), max_{x∈P} sup f(x)] .

Therefore

sup_{[a,b]} If = {sup_{[a,b]} f} .

Lemma 13.22 For any continuous f : R → R,

sup_{[a,b]} f = sup_{[a,b]} f̂.

Theorem 13.23 The supremum of a continuous function f : R → R depends only on the value that f assumes at maximal elements.

Theorem 13.24 If f : ℝ → ℝ is continuous and f : R → R is a continuous extension of f then

sup_{[a,b]} f = {sup_{[a,b]} f} .

An infimum operator inf is defined similarly, by replacing max by min.

Integration in Real PCF

In Section 14.1 we extend Real PCF with a primitive for interval Riemann integration, and we establish computational adequacy for the extension. Similarly, in Section 14.3 we extend Real PCF with a primitive for supremum, and we establish computational adequacy for the extension. In Section 14.2 we show how to recursively define integration from the supremum operator. Finally, in Section 14.4 we discuss computational completeness of Real PCF extended with integration or supremum.

For simplicity, in this chapter we are deliberately informal concerning syntax.

14.1 Real PCF extended with interval Riemann integration

Again, for simplicity and without essential loss of generality, we restrict ourselves to the unit interval. Clearly, the map ∫_{0}^{1} : (I ⇒ R) → R restricts to (I ⇒ I) → I. We denote the restriction by ∫.

The programming language Real PCF∫

Instead of introducing integration as a constant, we introduce it as a termformation rule. This treatment of primitive operations is taken from Gunter [Gun92]. We could treat all primitive operations in this way, as he does, but we treat only integration in this way, for simplicity.

Definition 14.1

1. Real PCF∫ is Real PCF extended by the following term-formation rule:

If Y : I is a term and x : I is a variable, then ∫ Y dx : I is a term, with the same free variables as Y, except for x, which becomes bound. Terms of this form are called integrals, whereas Y is called the integrand.

Here the term Y must not be confused with the fixed-point combinator Fix .

2. The meaning of the term ∫ Y dx in an environment ρ is ∫ f, where f is the meaning of λx.Y in ρ. □

Convention 14.2 We denote α-congruence by ≡. Following Barendregt [Bar92], we identify α-congruent terms, and we adopt the inductive definition of substitution given in page 125 of loc. cit., extended by the rules

• c[α := M] ≡ c for any constant c.

• (∫ Y dx)[α := M] ≡ (∫ Y [α := M]dx) provided α ≢ x.

• (∫ Y dx)[x := M] ≡ (∫ Y dx).

Notice that this definition assumes the so-called “[bound] variable convention” in order to omit the cumbersome proviso which prevents the capture of free variables [Bar84]. □

Operational semantics

Recall that ⊕ denotes binary average, which is a Real PCF definable operation.

Lemma 14.3 For any continuous map f : I → I,

∫ cons_{a} ∘ f = cons_{a} (∫ f) ,
∫ f = ∫ f ∘ cons_{L} ⊕ ∫ f ∘ cons_{R}.

Proof The first equation is linearity. For the second equation we have

∫ f = ∫_{0}^{1} f
= ∫0^{\frac{1}{2}} f + ∫ 1_{\frac{1}{2}} f

= ∫_{0}^{1} f (\frac{x}{2}) \frac{1}{2}dx + ∫_{0}^{1} f (\frac{x+1}{2}) \frac{1}{2}dx
= ∫ f ∘ cons_{L} ⊕ ∫ f ∘ cons_{R}. □

Definition 14.4 The immediate reduction rules for integration are:

1. (Production) ∫ Y dx → ∫ Zdx if Y → Z,

2. (Output) ∫ cons_{a}Y dx → cons_{a} (∫ Y dx),

3. (Input) ∫ Y dx → ∫ Y_{L}dx ⊕ ∫ Y_{R}dx,

where

Y_{a} ≡ Y [x := cons_{a}x].  □

Intuitively, the output rule produces partial output, the input rule supplies partial input, and the production rule partially evaluates the integrand (with no input or with the partial input supplied by the input rule in previous reduction steps).

Computational adequacy

Lemma 14.5 For every natural number n define a map ∫^{(n)} : (I ⇒ I) → I by

∫ ^{(n)} f = ∑_{k=1}^{2^{n}} f ([\frac{k − 1}{2^{n}}, \frac{k}{2^{n}} ]) \frac{1}{2^{n}} .

Then ∫^{(n)} is continuous, and

∫ f =\begin{matrix}⨆ & ↑ \\ n≥0 \end{matrix} ∫ ^{(n)} f.

Proof The right-hand side of the equation can be expressed as

\begin{matrix}⨆ & ↑ \\ n≥0 \end{matrix} ∑_{y∈Q_{n}} f(y)dy,

where

Q_{n} = \{[\frac{k − 1}{2^{n}}, \frac{k}{2^{n}} ]| 1 ≤ k ≤ 2^{n}\} .

Let D_{n} = {k/2^{n}|0 ≤ k ≤ 2^{n}}. Then ⋃_{n≥0} D_{n} is the set of dyadic numbers, which is dense in [0, 1]. Hence intervals with distinct dyadic end-points form a basis of I[0, 1], say B. Moreover, the end-points of the intervals in Q_{n} are contained in D_{n}. Hence for every partition P ∈ P_{B}[0, 1] there is some n such that Q_{n} refines P. Therefore the result follows from Lemma 13.7. □

Lemma 14.6 For every natural number n,

∫ ^{(0)} f = f(⊥),
∫ ^{(n+1)} f = ∫ ^{(n)} f ∘ cons_{L} ⊕ ∫ ^{(n)} f ∘ cons_{R}.

Proof For the first equation we have

∫ ^{(0)} f = ∑_{k=1}^{2^{0}} f ([\frac{k − 1}{2^{0}}, \frac{k}{2^{0}} ]) \frac{1}{2^{0}} = f([0, 1]) = f(⊥).

For the second equation we have

∫ ^{(n+1)} f = ∑_{k=1}^{2^{n+1}} f ([\frac{k − 1}{2^{n+1}}, \frac{k}{2^{n+1}} ]) \frac{1}{2^{n+1}}

= ∑_{k=1}^{2^{n}} f ([\frac{k − 1}{2^{n+1}}, \frac{k}{2^{n+1}} ]) \frac{1}{2^{n+1}} + ∑_{k=2^{n}+1}^{2^{n+1}} f ([\frac{k − 1}{2^{n+1}}, \frac{k}{2^{n+1}} ]) \frac{1}{2^{n+1}}

= \frac{1}{2} ∑_{k=1}^{2^{n}} f ([\frac{k − 1}{2^{n+1}}, \frac{k}{2^{n+1}} ]) \frac{1}{2^{n}} + \frac{1}{2} ∑_{k=1}^{2^{n}} f ([\frac{(k + 2^{n}) − 1}{2^{n+1}}, \frac{k + 2^{n}}{2^{n+1}} ]) \frac{1}{2^{n}}

= ∑_{k=1}^{2^{n}} f (\frac{[\frac{k−1}{2^{n}}, \frac{k}{2^{n}} ]}{2}) \frac{1}{2^{n}} ⊕ ∑_{k=1}^{2^{n}} f (\frac{[\frac{k−1}{2^{n}}, \frac{k}{2^{n}} ] + 1}{2}) \frac{1}{2^{n}}

= ∫ ^{(n)} f (\frac{x}{2}) dx ⊕ ∫ ^{(n)} f (\frac{x + 1}{2}) dx
= ∫ ^{(n)} f ∘ cons_{L} ⊕ ∫ ^{(n)} f ∘ cons_{R}. □

As a corollary, we have that for every n there is a program in Real PCF (without the integration primitive) defining ∫^{(n)}. But, in order to establish computational adequacy, it will prove simpler to introduce ∫^{(n)} as a primitive construction. Definition 14.7

1. Real PCF^{∫^{(n)}} is Real PCF∫ extended with a constant Ω_{σ} : σ for each type σ and the following term-formation rule for each natural number n:

If Y : I is a term and x : I is a variable, then ∫^{(n)} Y dx : I is a term, with the same free variables as Y, except for x, which becomes bound.

2. The meaning of Ω_{σ} is the bottom element of the domain of interpretation of σ. Notice that Ω_{σ} is PCF-definable. We introduce it as a constant so as to be able to prove Lemma 14.11 below.

3. The meaning of ∫^{(n)} Y dx in an environment ρ is ∫^{(n)} f, where f is the meaning of λx.Y in ρ.

4. There is no reduction rule for Ω_{σ}.

5. The immediate reduction rules for ∫^{(n)} are:

(a) (Production) ∫^{(0)} Y dx → ∫^{(0)} Zdx if Y → Z,

(b) (Output) ∫^{(0)} cons_{a}Y dx → cons_{a} (∫^{(0)} Y dx),

(c) (Input) ∫^{(n+1)} Y dx → ∫^{(n)} Y_{L}dx ⊕ ∫^{(n)} Y_{R}dx.

□

Definition 14.8 A sublanguage of a language L is a subset of L-terms which is closed under reduction. □ The following lemma is immediate: Lemma 14.9 If every L-term is computable, so is every term of any sublanguage of L. Thus, in order to prove that every term of Real PCF∫ is computable it suffices to prove that every term of Real PCF^{∫^{(n)}} is computable. Definition 14.10 Let ≼ be the least relation on terms such that:

1. If M : σ then Ω_{σ} ≼ M.

2. If Y ≼ Y′ : I then ∫^{(n)} Y dx ≼ ∫ Y′dx and also ∫ Y dx ≼ ∫ Y′dx.

3. M ≼ M.

4. If M ≼ M′ : σ → τ and N ≼ N′ : σ, then (MN) ≼ (M′N′).

5. If M ≼ M′ are terms (of the same type) then λα.M ≼ λα.M′.

□

This relation turns out to be reflexive and transitive, which justifies the notation, but we do not need this fact.

The following lemma is analogous to Lemma 4.5: Lemma 14.11 If M ≼ N and M → M′ then M′ ≼ N′ and N → N′ for some N′. This situation is summarized by the diagram below:

\begin{matrix}M & ≼ & N \\ M′ & & ≼ & N′ & ^{. . . . .} \end{matrix}

Proof By structural induction on M, according to why M → M′. □ Corollary 14.12 If M ≼ N and M →^{∗} M′ then M′ ≼ N′ and N →^{∗} N′ for some N′. Proof By induction on the length of the reduction. □ Corollary 14.13 For each natural number n and all Y : I and x : I,

Eval (∫ ^{(n)} Y dx) ⊆ Eval (∫ Y dx) .

Proof Immediate consequence of Corollary 14.12, noticing that, by definition of ≼, if one has that cons_{a}Z ≼ Z′ then Z′ has to be of the form cons_{a}Z′′. □

The term Ω_{σ} is trivially computable.

Lemma 14.14 For every n, if Y : I is computable so is ∫^{(n)} Y dx for all x : I. Proof By induction on n.

Base: Since the terms ∫^{(0)} Y dx and Y [x := Ω_{I}] have the same meaning in any environment, namely ∫^{(0)} f = f(⊥) where f is the meaning of λx.Y, and since Y [x := Ω_{I}] is computable as it is an instantiation of a computable term by computable terms, it suffices to conclude that Eval(Y [x := Ω_{I}]) ⊆ Eval(∫^{(0)} Y dx). Assume that Y [x := Ω_{I}] →^{∗} cons_{a}Z. One easily checks by structural induction that Y [x := Ω_{I}] ≼ Y. Hence, by Corollary 14.12 we conclude that Y →^{∗} Z′ for some Z′ with cons_{a}Z ≼ Z′. By definition of ≼, Z′ has to be of the form cons_{a}Z′′. Hence, by some applications of the production rule followed by an application of the output rule, ∫^{(0)} Y dx →^{∗} ∫^{(0)} cons_{a}Z′′dx → cons_{a}(∫^{(0)} Z′′dx).

Induction step: If Y is computable so is Y_{a} for any a. Hence, by the induction hypothesis, ∫^{(n)} Y_{a}dx is computable. Since ⊕ is a Real PCF term, it is computable. By definition of computability, it follows that ∫^{(n)} Y_{L}dx ⊕ ∫^{(n)} Y_{R}dx is computable. Therefore ∫^{(n+1)} Y dx is computable, because every reduction from ∫^{(n+1)} Y dx factors through ∫^{(n)} Y_{L}dx ⊕ ∫^{(n)} Y_{R}dx via the input rule, and ∫^{(n+1)} Y dx has the same meaning as ∫^{(n)} Y_{L}dx ⊕ ∫^{(n)} Y_{R}dx, in any environment. □

Lemma 14.15 Every Real PCF^{∫^{(n)}} term is computable. Proof Extend the proof of Lemma 11.6 by including Lemma 14.14 as one of the inductive steps. □

Theorem 14.16 (Adequacy) Every Real PCF∫ term is computable. Proof Lemmas 14.5, Corollary 14.13, and Lemmas 14.15 and 14.9. □

14.2 A fixed-point definition of integration

It is natural to ask if the integration operator, added in Section 14.1 as primitive, is already recursively definable in Real PCF.

Let D = (I ⇒ I) ⇒ I. Then the second equation of Lemma 14.3 leads one to consider the map G : D → D defined by

G(F)(f) = F (f ∘ cons_{L}) ⊕ F (f ∘ cons_{R}).

Thus the integration operator ∫ is a fixed point of G. However, the least fixed point is the bottom element of D.

Peter Freyd suggested that if we restrict ourselves to the subspace D′ ⊆ D of functions F ∈ D such that

inf f ≤ F (f) ≤ sup f,

then G restricts to a map G′ : D′ → D′, and ∫ is the least fixed point of G′. We use this idea in a modified form, obtaining ∫ directly as the least fixed point of a function H : D → D.

Define a map p : [0, 1]^{3} → [0, 1] by

j(x, y, z) = max(x, min(y, z)).

Then, given a ≤ b, the map g : [0, 1] → [0, 1] defined by

g(x) = j(a, x, b)

is idempotent,

a ≤ f(x) ≤ b,

and

g(x) = x iff a ≤ x ≤ b.

(Cf. Section 8.13). Also, define a function H : D → D by

H(F)(f) = j (inf f, F (f ∘ cons_{L}) ⊕ F (f ∘ cons_{R}), sup f) .

Lemma 14.17 For every continuous function f : I → I,

H^{n}(⊥)(f) = ∫ ^{(n)} f̂,

where f̂ is defined as in Lemma 13.10. Proof By induction on n. For the base case use the fact that f̂(⊥) = j(inf f, ⊥, sup f). □

Proposition 14.18 ∫ is the least fixed point of H. Proof Immediate consequence of Lemmas 14.5 and 14.17. □

14.3 Real PCF extended with supremum

This section follows the same pattern as Section 14.1. Due to this reason, we omit the proofs which are reworking of proofs given earlier. Again, for simplicity and without essential loss of generality, we restrict ourselves to the unit interval. Clearly, the map sup_{[0,1]} : (I ⇒ R) → R restricts to (I ⇒ I) → I. We denote the restriction by sup.

Definition 14.19 Real PCF^{sup} is Real PCF extended with a construction sup_{x} Y, as in Definition 14.1, denoting the operation sup : (I ⇒ I) → I. □

Lemma 14.20 For any continuous map f : I → I,

sup cons_{a} ∘ f = cons_{a} (sup f) ,
sup f = max (sup f ∘ cons_{L}, sup f ∘ cons_{R}) .

Definition 14.21 The immediate reduction rules for supremum are:

1. (Production) sup_{x} Y → sup_{x} Z if Y → Z,

2. (Output) sup_{x} cons_{a}Y → cons_{a} (sup_{x} Y),

3. (Input) sup_{x} Y → max (sup_{x} Y_{L}, sup_{x} Y_{R}),

where

Y_{a} ≡ Y [x := cons_{a}x].  □

Notice that these are the reduction rules for ∫ with ∫ and ⊕ replaced by sup and max respectively. We obtain the following similar results, whose proofs are omitted because they are similar too:

Lemma 14.22 For every natural number n define a map sup^{(n)} : [I → I] → I by

sup^{(n)}f = max_{k=1}^{2^{n}} f ([\frac{k − 1}{2^{n}}, \frac{k}{2^{n}} ]) .

Then sup^{(n)} is continuous, and

sup f =\begin{matrix}⨆ & ↑ \\ n≥0 \end{matrix} sup^{(n)}f.

Lemma 14.23 For every natural number n,

sup^{(0)}f = f(⊥),
sup^{(n+1)}f = max (sup^{(n)}f ∘ cons_{L}, sup^{(n)}f ∘ cons_{R}) .

As a corollary, we have that for every n there is a Real PCF program defining sup^{(n)}. But, as we did for integration, we add the partial supremum operators sup^{(n)} as primitive, and we conclude that:

Theorem 14.24 (Adequacy) Every Real PCF^{sup} term is computable.

The operation inf is definable from sup by

inf f = 1 − sup_{x}(1 − f(x)),

so there is no need to include it as primitive too.

Corollary 14.25 The integration operator is definable in Real PCF^{sup}. Proof The function H in Lemma 14.17 is Real PCF^{sup} definable. □

Corollary 14.26 For every natural number n there is a program in Real PCF extended with either integration or supremum which computes the multiple integration operator ∫ : (I^{n} ⇒ I) → I of order n. Proof (Since PCF does not have cartesian products, we have to use curried maps.) Our primitive or program for integration takes care of the case n = 1. Fubini’s Rule (Theorem 13.16) can be read as a definition of a program for the case n + 1 from a program for the case n. By the adequacy theorems, these programs indeed compute multiple integrals of order n. □

This application of the adequacy theorems shows that computational adequacy is a powerful property. In fact, it allows us to derive correct programs from analytical results, in a representation-independent fashion. Of course, this is precisely the idea behind denotational semantics.

14.4 Computational completeness of Real PCF extended with supremum

Although Theorem 12.13 implies that sup is definable in Real PCF extended with ∃, we do not know a neat fixed-point definition of sup.

Proposition 14.27 The existential quantification operator ∃ is definable in Real PCF extended with sup. Proof For D ∈ {N , B}, define continuous maps

D ⇆_{s_{D}}^{r_{D}} I

by

s_{N} (n) = if n = 0 then 0 else cons_{R}(s_{N} (n − 1))
r_{N} (x) = if x <_{⊥} 1/4 then 0 else r_{N} (tail_{R}(x)) + 1,
s_{B}(t) = if t then 1 else 0
r_{B}(x) = if x <_{⊥} 1/2 then false else true

Then (s_{D}, r_{D}) is a section-retraction pair. This is immediate for D = B. For D = N, we prove by induction on n that r_{N} ∘ s_{N} (n) = n. If n = ⊥ or n = 0 this is immediate. For the inductive step we have that

r_{N} ∘ s_{N} (n + 1) = r_{N} (cons_{R}(s_{N} (n))
= r_{N} (tail_{R} ∘ cons_{R}(s_{N} (n))) + 1
= r_{N} (s_{N} (n)) + 1
= n + 1 by the induction hypothesis.

It follows that the diagram below commutes:

(I ⇒ I) ⟶^{sup} I
r_{N} →s_{B}↑  ↓^{r_{B}}
(N ⇒ B) ⟶_{∃} B

In fact, let p ∈ [N → B] and define f : I → I by

f = (r_{N} ⇒ s_{B})(p) = s_{B} ∘ p ∘ r_{N} .

If there is some n such that p(n) = true, then there is some x such that f(x) = 1, namely x = s_{N} (n), and in this case we have that sup f = 1. If p(⊥) = false, then f(⊥) = 0, and in this case we have that sup f = 0. Therefore ∃ is definable in Real PCF extended with sup. □

Corollary 14.28 Real PCF extended with sup is computationally complete.

We don’t know whether Real PCF extended with integration is computationally complete. Moreover, we don’t know whether integration is definable in Real PCF with no extensions, but conjecture that this is not the case.

For applications of Real PCF to real analysis, it seems more natural to include the supremum operator as a primitive operation than to include the existential quantification operator.

Remark 14.29 Notice that the section-retraction pairs defined in the proof of Proposition 14.27 are expressed in terms of sequential primitives only, and that the maximum operation on I represents the “parallel or” operation ∨ on B, in the sense that the following diagram commutes:

I × I ⟶^{max} I
s_{B}×s_{B}↑  ↓^{r_{B}}
B × B ⟶_{∨} B
□

Part VI

Concluding remarks Summary of results

Recall that this thesis consists of the following five parts:

I Background

II Domain theory revisited

III The partial real line

IV Computation on the partial real line

V Integration on the partial real line

15.1 Continuous words, Real PCF, and computational adequacy

In Chapter 9 of Part III we showed that partial real numbers can be considered as continuous words. Continuous words and their basic properties were used in Chapter 11 of Part IV to extend PCF with real numbers, obtaining Real PCF, and to show that Real PCF is computationally adequate, in the sense that its operational and denotational semantics coincide.

15.2 Induction and recursion on the partial real line

In Chapter 10 of Part III we introduced induction principles and recursion schemes for the partial real line, similar to the so-called Peano axioms for natural numbers. In particular, we obtained an abstract characterization of the partial unit interval, up to isomorphism, which does not mention real numbers or intervals. In order to formulate this characterization, we introduced the category of binary systems.

Based on the results of Chapter 5 of Part II, we showed that the partial real line can be given the structure of an inductive retraction, thus obtaining structural recursion and corecursion schemes. These schemes were formulated in terms of “generalized bifree algebras”, which are quotients of bifree algebras in a special way. As a byproduct, we obtained an effective version of binary expansions for partial real numbers, which we called “bifurcated binary expansions”.

We gave many applications of induction and recursion. First, we obtained several examples of recursive definitions on the partial real line, most of which immediately give rise to Real PCF programs. Second, these induction principles and recursion schemes were used to establish the existence of a unique sound effective presentation of the Real PCF domains, up to equivalence. Third, they were used to establish computational completeness of Real PCF. These applications are discussed below.

15.3 Computability on the real numbers type hierarchy

In our approach to computation on real numbers, we introduced two new ingredients, which are very natural for an approach based on domain theory. First, we made partially successful computations official, via partial real numbers. Second, we admitted higher-order functions (such as integration operators). From the point of view of computability, these two new ingredients are not problematic, because domain theory was designed to support them, via effectively given domains and function spaces. Thus, in order to define computability on the real numbers type hierarchy, one has to simply choose a natural basis (such as the rational intervals) and a natural enumeration of the basis (such as Cantor enumeration), and then lift the effective presentation to higher types. Since computability is a robust notion, the choice of basis and its enumeration should not make any difference. We proved that this is indeed the case, as follows.

First, we needed a notion of equivalence of effective presentations of a continuous domain. Since such a notion was available only for the algebraic case, and since it does not immediately generalize to the continuous case, we were forced to introduce a new notion in Chapter 6 of Part II. We argued that the natural notion of equivalence is just the existing notion of equivalence of objects in concrete categories, specialized to the category of effectively given domains, considered concrete over the category of domains, via the forgetful functor which forgets effective presentations. We established two main results:

(1) two effective presentations on the same domain are equivalent iff they induce the same notion of computability on the domain, and (2) effective presentations can be lifted uniquely, up to equivalence, to function spaces. These are really instances of two results on concrete categories and concretely cartesian closed categories.

Second, we observed that all Real PCF definable functions should be regarded as computable, because Real PCF has an effective operational semantics. We thus called “sound” an effective presentation of the real numbers domain which makes all definable elements computable. In Chapter 12 of Part IV we showed that there is a unique sound effective presentation, up to equivalence, obtaining an absolute notion of computability for the real numbers type hierarchy.

Absoluteness was achieved by means of the inductive principles and recursion schemes discussed above, in the following way. In Chapter 6 of Part II, we showed that for any locally computable functor F and any domain D, there is at most one effective presentation of D which makes D an F-inductive retract, up to equivalence. In Chapter 10 of Part III, we exhibited a functor which gives the the partial real line the structure of an inductive retract. In Chapter 12 of Part IV, we observed that this functor is locally computable, and we showed that there is an effective presentation of the partial real line which makes the section and retraction both computable and Real PCF definable, thus establishing soundness and absoluteness.

15.4 Computational completeness of Real PCF

In Chapter 12 of Part IV, we observed that a computable existential quantifier, which is not PCF definable, is not Real PCF definable either. Again making use of the induction principles and recursion schemes discussed above, we adapted a technique by Thomas Streicher, establishing that Real PCF extended with the existential quantifier is computationally complete, in the sense that all computable elements are definable.

It is well-known that the existential quantifier is not needed to define all firstorder computable functions in PCF, and one would expect Real PCF to enjoy the same property. Unfortunately, Thomas Streicher’s technique does not give information about definability at first-order types. We thus developed a new general technique for establishing computational completeness of extensions of PCF with new ground types, which does give such information. In particular, we obtained as a corollary a new proof of computational completeness of PCF extended with parallel-if and the existential quantifier.

In its present form, the technique works in its full generality only when the ground types are interpreted as algebraic domains. Nevertheless, we were able to apply it to establish first-order computational completeness of Real PCF.

The technique makes use of what we called “joining maps” in Chapter 7 of Part II, and also of general properties of joining maps developed in that chapter. By the results of that chapter, a bounded complete domain admits joining maps iff it is coherently complete. Therefore, the technique is intrinsically restricted to coherently complete domains, of which the partial real line is an example anyway.

15.5 Partial real valued functions

In Chapter 8 of Part III, we showed that for any space X, a continuous partial real valued function f : X → R is essentially the same as a pair of respectively lower and upper semicontinuous functions \underline{f} : X → ℝ and \overline{f} : X → ℝ, bounded on compact intervals, with \underline{f} ≤ \overline{f} pointwise. Moreover, we showed that for any (not necessarily continuous) function f : ℝ → ℝ bounded on compact intervals there is a continuous function f̈: R → R which agrees with f at every point of continuity of f.

15.6 Interval Riemann integration

In Chapter 13 of Part V, we generalized Riemann integration of real valued functions of real variables to “interval Riemann integration” of partial real valued functions of partial real variables. We showed that interval Riemann integration fully captures Riemann integration, in the sense that for every Riemann integrable function f : ℝ → ℝ (i.e., bounded on compact intervals and continuous almost everywhere), the Riemann integral of f : ℝ → ℝ coincides with the Interval Riemann integral of any continuous f̃ : R → R agreeing with f at every point of continuity of f. We also proved basic properties of interval Riemann integration, such as linearity and Fubini’s rule for multiple Riemann integration.

15.7 Integration in Real PCF

In Chapter 14, we introduced an extension of Real PCF with simple interval Riemann integration as a primitive operation, via reduction rules, and we established computational adequacy of the extension. Fubini’s rule and computational adequacy together imply definability of multiple interval Riemann integration. Based on a suggestion by Peter Freyd, we obtained a fixed-point definition of integration based on the reduction rules. Since the fixed-point definition involves a supremum operator, we showed how to extend Real PCF with it, again via reduction rules, retaining computational adequacy. We also showed that the existential quantifier can be replaced by the supremum operator in the computational completeness result, which is more natural for applications to real number computation.

15.8 New results on domain theory

As it is clear by the above summary, we developed new results on domain theory in order to obtain our main results on Real PCF, higher-order real number computability, and Real PCF definability. Since these results are interesting in their own right, we decided to collect them together in Part II. Running the risk of being somewhat repetitive, we briefly summarize them independently of their particular applications to domain-theoretic higher-order real number computation via Real PCF.

Bifree algebras generalized In Chapter 5 we defined inductive retracts as generalizations of bifree algebras, and we showed that any functor with a bifree algebra has any of is inductive retractions as a retract of the bifree algebra, in a canonical way. Moreover, we showed that inductive sections and retractions behave as respectively final coalgebras and initial algebras, except that the existence part in the definition of finality and initiality is missing. We gave a general criterion for the existence of homomorphisms, which amounted to saying that the involved (co)algebras (co)respect the congruence induced on the bifree algebra. Moreover, we gave two explicit constructions of the (unique) homomorphisms, when they exist. Except for one of the last two constructions, which holds only in certain order-enriched categories, all results hold in any category.

Equivalence of effectively given domains We remarked in Chapter 6 that, as far as we know, only equivalence of effectively given algebraic domains was considered in the literature. We showed that the notion of equivalence of objects in concrete categories gives rise to an appropriate notion of equivalence of effective presentations of domains, when we consider the category of effectively given domains and computable maps as a concrete category over the category of domains and continuous maps, via the forgetful functor which forgets effective presentations. We proved that two effective presentations of the same domain are equivalent iff they induce the same notion of computability on the domain, and we also showed that effective presentations lift uniquely, up to equivalence, to cartesian products and function spaces. Also, we showed that, for any functor F on the category of domains which extends to a locally computable functor on effectively given domains, and any F-inductive retraction (D, α, β), there is at most one effective presentation of D which makes retraction α and the section β computable, up to equivalence. Moreover, if α and β are isomorphisms (and hence form a bifree algebra), then there is exactly one such effective presentation.

Coherently complete domains We characterized the coherently complete domains as the bounded complete domains which admit joining maps; we showed that every element of a coherently complete domain admits a least joining map; we obtained a new proof of universality of the coherently complete domain B^{ω}; and we showed how to construct joining maps of function spaces from joining maps of the target domain, and from the best continuous approximation to the characteristic function of the way below order on the source domain. The last two items gave rise to the general technique for establishing computational completeness of PCF extended with coherently complete domains, which works in its full generality only for the algebraic case as we lack information about the best continuous approximation to the way-below relation.

Open problems and further work

16.1 Equivalence of effectively given domains

Since the original notion of equivalence of effectively given domains introduced in [KP79] applies only to the algebraic case and doesn’t immediately generalize to the continuous case, we introduced a new notion, based on concrete categories, in Chapter 6 of Part II. Moreover, we showed that our definition is appropriate for our purposes. Nevertheless, it is an open problem whether our definition restricted to the algebraic case coincides with that of Kanda and Park. We conjecture that this is the case.

16.2 Real number computability

In Section 12.1 of Part IV, we showed that there is a unique sound effective presentation of the real numbers type hierarchy, thus providing an absolute notion of higher-order real number computability. However, we didn’t relate the resulting notion of computability to existing notions for total real numbers [Grz57, KV65, Ko91, ML70, Myh53, PeR83, Ric54, Tur37, Wei87, Wei95]. We conjecture that our notion of computability, when restricted to real numbers and total real functions of total real variables, coincides with at least those of [Ko91, PeR83, Wei95]^{1}. See [Wei95] for comments about (in)equivalence of the existing notions. If our conjecture is true, we have that a function f : ℝ → ℝ is computable in the sense of [Ko91, PeR83, Wei95] iff it has an extension f̃: R → R computable in our sense iff the lifting (If)_{⊥} : R_{⊥} → R_{⊥} of its canonical extension If : R → R is computable in our sense. The reason is that there is a computable idempotent c : (R_{⊥} ⇒ R_{⊥}) → (R_{⊥} ⇒ R_{⊥}) such that c(g) is the lifting of the canonical extension of f : ℝ → ℝ, for any extension g : R_{⊥} → R_{⊥} of f. Notice however that this closure operator is interdefinable with the existential quantifier (or the supremum operator).

1Philipp Sünderhauff [Sün97] has shown that this is the case

16.3 Injective spaces

Originally, we had planned a chapter in Part II containing new results about injective spaces [Esc97]. Since most results are unrelated or vaguely related to this thesis, we eventually decided to omit it. However, we discussed some instances of some of the results. For instance, the idempotent c : (R_{⊥} ⇒ R_{⊥}) → (R_{⊥} ⇒ R_{⊥}) is an instance of a much more general construction for injective spaces. Its continuity depends only on the fact that the singleton-embedding ℝ → R is proper in the sense of [HL82]. The fact that the idempotent has to make functions strict is explained by the fact that the smallest dense subspace of R_{⊥} whose embedding into R_{⊥} is a proper map is the subspace ℝ ∪ {⊥}. Any sober space has such a smallest subspace and, moreover, has an associated closure operator defined roughly as above. Also, Lemma 8.6 (including the note at the end of its proof) are vastly generalized in loc. cit.

16.4 Way-below order

A new technique for proving computational completeness of extensions of PCF with new ground types was introduced in Section 12.4 of Part IV. In its present form, it only works in its full generality when the ground types are interpreted as algebraic domains. The generalization to the continuous case depends on a suitable constructive characterization of the (characteristic function of) the way-below order on function spaces of continuous domains. More precisely, we need a characterization which allows us to prove the crucial Lemma 12.17 in the continuous case. Some steps in this direction were already taken in joint work with Thomas Erker and Klaus Keimel [EEK97], where we obtained several characterizations of the way-below order on function spaces.

16.5 Full abstraction

Is Real PCF fully abstract? We conjecture that it is (recall that Real PCF includes a parallel conditional). A solution to the problem of the previous section would positively answer this question.

16.6 Sequentiality on the real numbers type hierarchy

Is there any language-independent notion of sequentiality for the real numbers type hierarchy? Does the notion of sequentiality for real numbers depend on the model of computation? It seems that the answer to the last question is positive.

We know that R_{⊥} is a coherently complete domain and that B^{ω} is a universal coherently complete domain, which is essentially the same as the PCF domain U = (N → B). It is thus natural to attempt to reduce sequentiality on R_{⊥} to sequentiality on U. Let us say that a (computable) function ϕ : U → U is sequential if it is PCF definable. Given any section-retraction pair s : R_{⊥} → U and r : U → R_{⊥} with s ∘ r : U → U computable, we could say that a (computable) function f : R_{⊥} → R_{⊥} is s − r-sequential if the function r ∘ f ∘ s : U → U is sequential. This notion generalizes to functions of several variables in the obvious way. It is not hard to see that there are distinct section-retraction pairs give which rise to distinct notions of sequentiality.

Is R_{⊥} a sequential retract of U (or of any universal PCF domain), in the sense that the induced idempotent on U is sequential? We conjecture that this is not the case. Are there s and r such that (some extension of) the addition operation is sequential? We conjecture that the answer is also negative.

16.7 Joining maps

Some questions about joining maps were raised in Chapter 7 of Part II. Here we add the following question: if join_{x} denotes the least joining map of an element x of a coherently complete domain D, and if we define x □ y = join_{x}(y), does it follow that (D, □, ⊥) is a monoid? It is enough to check the associativity law, which can be expressed by the equation

join_{x}(join_{y}(z)) = join_{join_{x}(y)}(z).

These questions should be easy to answer ^{2}.

16.8 Continued fractions and Möbius transformations

Peter Potts [Pot96] has recently found a common generalization of the ideas presented in this thesis about PCF extended with real numbers and the ideas of Vuillemin [Viu90, Vui88] on continued fractions. The idea is to use Möbius transformations, that is, functions of the form

x ↦ \frac{px + q}{rx + s},

which include our affine transformations x ↦ px + q when r = 0 and s = 1. In ongoing work with him and Abbas Edalat, we have generalized the monoid of continuous words so that left actions are now Möbius transformations instead of affine transformations. We obtained an extension of PCF with real numbers, whose operational semantics is essentially the same as Real PCF’s [PEE97]. The advantage of such an approach is that the parallel conditional can be avoided in many important instances, such as programs for a wide class of analytic functions.

2Michal Konecny has proved that this is not the case in general.

Bibliography

[Aci91] B.M. Acióly. A Computational Foundation of Interval Mathematics. PhD thesis, Universidade Federal do Rio Grande do Sul, Instituto de Informatica, Porto Alegre, Brazil, 1991. (In Portuguese).

[AHS90] J Adamek, H Herrlich, and G.E. Strecker. Abstract and Concrete Categories. John Wiley & Sons, Inc., 1990.

[AJ94] S. Abramsky and A. Jung. Domain theory. In S. Abramsky, D.M. Gabbay, and T.S.E Maibaum, editors, Handbook of Logic in Computer Science, volume 3, pages 1–168. Clarendon Press, Oxford, 1994.

[Bar84] H.P. Barendregt. The Lambda-Calculus: its Syntax and Semantics. North-Holland, Amsterdam, 1984.

[Bar92] H.P. Barendregt. Lambda calculi with types. In S. Abramsky, D.M. Gabbay, and T.S.E Maibaum, editors, Handbook of Logic in Computer Science, volume 2, pages 117–309. Clarendon Press, Oxford, 1992.

[BB85] E. Bishop and D. Bridges. Constructive Analysis. Springer-Verlag, Berlin, 1985.

[BC90] H.J. Boehm and R. Cartwright. Exact real arithmetic: Formulating real numbers as functions. In Turner. D., editor, Research Topics in Functional Programming, pages 43–64. Addison-Wesley, 1990.

[BCRO86] H.J. Boehm, R. Cartwright, M. Riggle, and M.J. O’Donnel. Exact real arithmetic: A case study in higher order programming. In ACM Symposium on Lisp and Functional Programming, 1986.

[Boe87] H.J. Boehm. Constructive real interpretation of numerical programs. SIGPLAN Notices, 22(7):214–221, 1987.

[Bou66] N. Bourbaki. General Topology, volume 1. Addison-Wesley, London, 1966.

[Bra96] V. Brattka. Recursive characterization of computable real-valued functions and relations. Theoretical Computer Science, 162(1):45– 77, August 1996.

[BSS89] L. Blum, M. Shub, and S. Smale. On a theory of computation and complexity over the real numbers. Bull. Amer. Math. Soc., 21:1–46, 1989.

[Cro93] R.L. Crole. Categories for Types. Cambridge University Press, Cambridge, 1993.

[Dev89] R. L. Devaney. An Introduction to Chaotical Dynamical Systems. Addison-Wesley, California, 2nd edition, 1989.

[EC76] H. Egli and R.L. Constable. Computability concepts for programming languages. Theoretical Computer Science, 2:133–145, 1976.

[EC93] M.H. Escardó and D.M. Claudio. Scott domain theory as a foundation for interval analysis. Technical Report 218, UFRGS/II, Porto Alegre, Brazil, 1993.

[Eda95a] A. Edalat. Domain of computation of a random field in statistical physics. In C. Hankin, I. Mackie, and R. Nagarajan, editors, Theory and formal methods 1994: Proceedings of the second Imperial College Department of Computing Workshop on Theory and Formal Methods, Mller Centre, Cambridge, 11-14 September 1995. IC Press.

[Eda95b] A. Edalat. Domain theory and integration. Theoretical Computer Science, 151:163–193, 1995.

[Eda95c] A. Edalat. Domain theory in learning processes. In S. Brookes, M. Main, A. Melton, and M. Mislove, editors, Proceedings of MFPS, volume one of Electronic Notes in Theoretical Computer Science. Elsevier, 1995.

[Eda95d] A. Edalat. Domain theory in stochastic processes. In Proceedings of Logic in Computer Science (LICS), Tenth Annual IEEE Symposium, 26-19 June, 1995, San Diego. IEEE Computer Society Press, 1995.

[Eda95e] A. Edalat. Dynamical systems, measures and fractals via domain theory. Information and Computation, 120(1):32–48, July 1995.

[Eda96a] A. Edalat. Power domains and iterated function systems. Information and Computation, 124:182–197, 1996.

[Eda96b] A. Edalat. The Scott topology induces the weak topology. Mathematical Structures in Computer Science, 1996. To appear.

[EE] A. Edalat and M.H. Escardó. Integration in Real PCF. Information and Computation. To appear.

[EE95] A. Edalat and M.H. Escardó. Integration in Real PCF (full version). http://theory.doc.ic.ac.uk/people/Escardo, December 1995.

[EE96a] A. Edalat and M.H. Escardó. Integration in Real PCF (extended abstract). In Proceedings of the Eleventh Annual IEEE Symposium on Logic In Computer Science, pages 382–393, New Brunswick, New Jersey, USA, July 1996.

[EE96b] A. Edalat and M.H. Escardó. The way-below relation on the function space R → R. Department of Computing, Imperial College of Science and Technology, University of London, February 1996.

[EEK] T. Erker, M.H. Escardó, and K. Keimel. The way-below relation on function spaces of semantics domains. Topology and its applications. To appear.

[EEK97] T. Erker, M.H. Escardó, and K. Keimel. The way-below relation of function spaces of semantic domains. Topology and Its Applications, 1997. To appear.

[EH96] A. Edalat and R. Heckmann. A computational model for metric spaces. Theoretical Computer Science, 1996. To appear.

[EN96] A. Edalat and S. Negri. Generalised Riemann integral on locally compact spaces. In A. Edalat, S. Jourdan, and G. McCusker, editors, Advanced in theory and formal methods of computing: Proceedings of the third Imperial College workshop April 1996. Imperial College Press, 1996.

[ES] M.H. Escardó and T. Streicher. Induction and recursion on the rartial real line with applications to Real PCF. Theoretical Computer Science. To appear.

[ES97] M.H. Escardó and T. Streicher. Induction and recursion on the partial real line via biquotients of bifree algebras. In Proceedings of the Twelveth Annual IEEE Symposium on Logic In Computer Science, Warsaw, Polland, Jun 1997.

[Esc] M.H. Escardó. Properly injective spaces and function spaces. Topology and its Applications. To appear.

[Esc94] M.H. Escardó. Induction and recursion on the real line. In C. Hankin, I. Mackie, and R. Nagarajan, editors, Theory and Formal Methods 1994: Proceedings of the Second Imperial College Department of Computing Workshop on Theory and Formal Methods, pages 259–282, Mller Centre, Cambridge, 11–14 September 1994. IC Press. 1995.

[Esc96a] M.H. Escardó. PCF extended with real numbers. Theoretical Computer Science, 162(1):79–115, August 1996.

[Esc96b] M.H. Escardó. Real PCF extended with ∃ is universal. In A. Edalat, S. Jourdan, and G. McCusker, editors, Advances in Theory and Formal Methods of Computing: Proceedings of the Third Imperial College Workshop, April 1996, pages 13–24, Christ Church, Oxford, 1996. IC Press.

[Esc97] M.H. Escardó. Properly injective spaces and function spaces. Topology and Its Applications, 1997. To appear (available at

http://theory.doc.ic.ac.uk/people/Escardo).

[Fio93] M.P. Fiore. A coinduction principle for recursive data types based on bisimulation (extended abstract). In 8^{th} LICS Conf. IEEE, Computer Society Press, 1993. (Full version in Information and Computation special issue for LICS 93).

[Fio96] M.P. Fiore. A coinduction principle for recursive data types based on bisimulation. Information and Computation, 127(2):186–198, 1996.

[Fre90] P. J. Freyd. Recursive types reduced to inductive types. In Proceedings of the Fifth Annual IEEE Symposium on Logic In Computer Science, 1990.

[Fre91] P. J. Freyd. Algebraically complete categories. In A. Carboni et al., editors, Proc. 1990 Como Category Theory Conference, pages 95–104, Berlin, 1991. Springer-Verlag. Lecture Notes in Mathematics Vol. 1488.

[Fre92] P. J. Freyd. Remarks on algebraically compact categories. In M. P. Fourman, P. T. Johnstone, and A. M. Pitts, editors, Applications of Categories in Computer Science: Proceedings of the LMS Symposium, Durham, 1991. Cambridge University Press, 1992. LMS Lecture Notes Series, 177.

[GHK^{+}80] G. Gierz, K.H. Hofmann, K. Keimel, J.D. Lawson, M. Mislove, and D.S. Scott. A Compendium of Continuous Lattices. Springer-Verlag, 1980.

[Gia93a] P. Di Gianantonio. A functional approach to computability on real numbers. PhD thesis, University of Pisa, 1993. Technical Report TD 6/93.

[Gia93b] P. Di Gianantonio. Real number computability and domain theory. In 18th symposioum on Mathematical Foundation of Compueter Science, number 711 in LNCS, pages 413–422. Springer-Verlag, 1993.

[Gia96a] P. Di Gianantonio. A golden ratio notation for the real numbers. Technical Report CS-R9602, CWI Amsterdam, 1996.

[Gia96b] P. Di Gianantonio. Real number computability and domain theory. Information and Computation, 127(1):11–25, 1996.

[Gru] K. Grue. Unrestricted lazy numerical algorithms. Unpublished manuscript.

[Grz57] A. Grzegorczyk. On the definition of computable real continuous functions. Fund. Math., 44:61–77, 1957.

[Gun92] C. A. Gunter. Semantics of Programming Languages – Structures and Techniques. The MIT Press, London, 1992.

[Hay85] S. Hayashi. Self-similar sets as Tarski’s fixed points. Publications of the Research Institute for Mathematical Sciences, 21(5):1059–1066, 1985.

[HL82] K.H. Hofmann and J.D. Lawson. On the order theoretical foundation of a theory of quasicompactly generated spaces without separation axiom. In R.-E. Hoffmann, editor, Continuous Lattices and Related Topics, volume 27 of Mathematik-Arbeitspapiere, pages 143–160. University of Bremen, 1982.

[Hut81] J. E. Hutchinson. Fractals and self-similarity. Indiana University Mathematics Journal, 30:713–747, 1981.

[HY88] J.G. Hocking and G.S. Young. Topology. Dover Publications, 1988.

[JS96a] A. Jung and Ph. Sünderhauf. On the duality of compact vs. open. In S. Andima, R. C. Flagg, G. Itzkowitz, P. Misra, Y. Kong, and R. Kopperman, editors, Papers on General Topology and Applications: Eleventh Summer Conference at University of Southern Maine, Annals of the New York Academy of Sciences, 1996. To appear in Topology and its Applications.

[JS96b] A. Jung and Ph. Sünderhauf. Uniform approximation of topological spaces. Technical Report CSR-96-3, School of Computer Science, The University of Birmingham, 1996. 19pp., available from

http://www.cs.bham.ac.uk/.

[Jun90] A. Jung. The classification of continuous domains. In Logic in Computer Science, pages 35–40. IEEE Computer Society Press, 1990.

[Kel55] J.L. Kelley. General Topology. D. van Nostrand, New York, 1955.

[Kle52] S.C. Kleene. Introduction to Metamathematics. North-Holland, Amsterdam, 1952.

[Ko91] Ker-I Ko. Complexitity Theory of Real Functions. Birkhauser, Boston, 1991.

[KP79] A. Kanda and D. Park. When are two effectively given domains identical? In K. Weihrauch, editor, Theoretical Computer Science 4^{th} GI Conference, LNCS, 1979.

[KV65] S.C. Kleene and R.E Vesley. The Foundations of Intuitionistic Mathematics: Especially in Relation to Recursive Functions. North-Holland, Amsterdam, 1965.

[Law73] F.W. Lawvere. Metric spaces, generalized logic, and closed categories. In Rend. del Sem. Mat. e Fis. di Milano, volume 43, pages 135–166, 1973.

[LS81] D.J. Lehmann and M.B. Smyth. Algebraic specification of data types: a synthetic approach. Math. Syst. Theory, 14:97–139, 1981.

[LS86] J. Lambek and P.J. Scott. Introduction to Higher Order Categorical Logic. Cambridge University Press, Cambridge, 1986.

[Luc77] H. Luckhardt. A fundamental effect in computations on real numbers. Theoretical Computer Science, 5:321–324, 1977.

[McL92] C. McLarty. Elementary Categories, Elementary Toposes. Clarendon Press, Oxford, 1992.

[ML70] P. Martin-Löf. Notes on Constructive Mathematics. Almqvist & Wiksell, Stockholm, 1970.

[ML71] S. Mac Lane. Categories for the Working Mathematician. Springer-Verlag, 1971.

[MM96] V. Ménissier-Morain. Arbitrary precision real arithmetic: design and alogrithms. Submitted to J. Symbolic Computation, 1996.

[Moo66] R.E. Moore. Interval Analysis. Prentice-Hall, Englewood Cliffs, 1966.

[Myh53] J. Myhill. Criteria of constructivity of real numbers. J. Symbolic Logic, 18:7–10, 1953.

[Pau87] L.C. Paulson. Logic and Computation: Interactive Proof with LCF. Cambridge University Press, Cambridge, 1987.

[PEE97] P.J. Potts, A. Edalat, and M.H. Escardó. Semantics of exact real arithmetic. In Proceedings of the Twelveth Annual IEEE Symposium on Logic In Computer Science, Warsaw, Polland, Jun 1997.

[PeR83] M.B. Pour-el and I. Richards. Computability and noncomputability in classical analysis. Trans. Am. Math. Soc., pages 539–560, 1983.

[Phi92] I.C.C. Phillips. Recursion theory. In S. Abramsky, D.M. Gabbay, and T.S.E Maibaum, editors, Handbook of Logic in Computer Science, volume 1, pages 79–187. Clarendon Press, Oxford, 1992.

[Plo77] G. Plotkin. LCF considered as a programming language. Theoretical Computer Science, 5(1):223–255, 1977.

[Plo78] G. Plotkin. B^{ω} as a universal domain. Journal of Computer and System Sciences, 17:209–236, 1978.

[Plo80] G. Plotkin. Domains. Post-graduate Lectures in advanced domain theory, University of Edinburgh, Department of Computer Science. http:// ida.dcs.qmw.ac.uk/ sites/ other/ domain.notes.other, 1980.

[Poi92] A. Poigné. Basic category theory. In S. Abramsky, D.M. Gabbay, and T.S.E Maibaum, editors, Handbook of Logic in Computer Science, volume 1, pages 413–640. Clarendon Press, Oxford, 1992.

[Pot95] P.J. Potts. The storage capacity of forgetful neural networks. Master’s thesis, Department of Computing, Imperial College, 1995.

[Pot96] P.J. Potts. Computable real arithmetic using linear fractional transformations. Manuscript presented during the second Computation and Approximation Workshop, held in Darmstadt, September 1996.

[Ric54] H.G. Rice. Recursive real numbers. Proc. Amer. Math. Soc., pages 784–791, 1954.

[Rog67] H. Rogers. Theory of Recursive Functions and Effective Computability. McGraw-Hill, New York, 1967.

[Roy88] H.L. Royden. Real Analysis. Collier Macmillan Publishing, third edition, 1988.

[Rud76] W. Rudin. Principles of Mathematical Analysis. McGraw-Hill, New Yourk, 3rd edition, 1976.

[Sch93] A. Schalk. Algebras for Generalized Power Constructions. PhD thesis, Technische Hochschule Darmstadt, July 1993. ftp://ftp.cl.cam.ac.uk/papers/as213/diss.dvi.gz.

[Sco72a] D. S. Scott. Continuous lattices. In F.W. Lawvere, editor, Toposes, Algebraic Geometry and Logic, volume 274 of Lectures Notes in Mathematics, pages 97–136. Springer-Verlag, 1972.

[Sco72b] D. S. Scott. Lattice theory, data types and semantics. In Formal semantics of programming languages, pages 66–106, Englewood Cliffs, 1972. Prentice-Hall.

[Sco76] D. S. Scott. Data types as lattices. SIAM Journal on Computing, 5:522–587, September 1976.

[Smy77] M.B. Smyth. Effectively given domains. Theoretical Computer Science, 5(1):256–274, 1977.

[Smy83] M.B. Smyth. Power domains and predicate transformers: a topological view. In J. Diaz, editor, Automata, Languages and Programming, pages 662–675. Springer-Verlag, 1983. LNCS 154.

[Smy87] M.B. Smyth. Quasi-uniformities: Reconciling domains with metric spaces. In M. Main, A. Melton, M. Mislove, and D. Schimidt, editors, Mathematical Foundations of Programming Languages, pages 236–253, London, 1987. Springer-Verlag. LNCS 298.

[Smy89] M.B. Smyth. Totally bounded spaces and compact ordered spaces as domains of computation. In Oxford Topology Symposium’89, Oxford, 1989. Oxford University Press.

[Smy92a] M.B. Smyth. I-categories and duality. In M.P. Fourman, P.T. Johnstone, and Pitts A.M., editors, Applications of Categories in Computer Science, pages 270–287, Cambridge, 1992. Cambridge University Press. London Mathematical Society Lecture Notes Series 177.

[Smy92b] M.B. Smyth. Topology. In S. Abramsky, D. M. Gabbay, and T.S.E. Maibaum, editors, Handbook of Logic in Computer Science, volume 1, pages 641–761. Clarendon Press, Oxford, 1992.

[SP82] M.B. Smyth and G. Plotkin. The category-theoretic solution of recursive domain equations. SIAM Journal of Computing, 11(4):761–783, 1982.

[Sto66] R. Stoll. Set Theory and Logic. W.H. Freeman and Company, San Fransisco, 1966.

[Str94] T. Streicher. A universality theorem for PCF with recursive types, parallel-or and ∃. Mathematical Structures for Computing Science, 4(1):111 – 115, 1994.

[Sün97] Ph. Sünderhauf. A domain-theoretic approach to computable analysis. Department of Computing, Imperial College, March 1997.

[Tur37] A. Turing. On computable numbers, with an application to the Entscheindungproblem. The London Mathematical Society, 42:230– 265, 1937.

[Vic89] S. Vickers. Topology via Logic. Cambridge University Press, Cambridge, 1989.

[Vic96] S. Vickers. Flat completion of quasi-metric spaces. Department of Computing, Imperial College of Science and Technology, University of London, March 1996.

[Viu90] J. Viullemin. Exact real computer arithmetic with continued fractions. IEEE Transactions on Computers, 39(8):1087–1105, 1990.

[Vui88] J. Vuillemin. Exact real arithmetic with continued fractions. In Proc. ACM Conference on Lisp and Functional Programming, pages 14–27, 1988.

[Wei87] K. Weihrauch. Computability. Springer-Verlag, Berlin, 1987.

[Wei95] K. Weihrauch. A simple introduction to computable analysis. Technical Report 171 – 7/1995, FernUniversitat, 1995.

[Wie80] E. Wiedmer. Computing with infinite objects. Theoretical Computer Science, 10:133–155, 1980.

Index

(A, B)-representable, 48 (A, B)-representation, 48 N, 31 SDom, 18 B, 14 𝔹, 14 curry, 15 δ, 20 ϵ-degradation, 78 ϵ − δ characterization of continuity,

13 head, 96 ω-continuous, 13 ≼, 34 <_{⊥}, 69 if, 28 pif, 28 ρ, 20 uncurry, 15 𝔹, 69 F-algebra, 18 F-algebra homomorphism, 18 F-coalgebra, 18 F-coalgebra homomorphism, 18 F-inductive retract, 38 F-inductive retraction, 39 B, 69 I, 63 L-terms, 30 R^{⋆}, 63 K_{D}, 13 Δ_{n}, 20

above, 11 absolute notion of computability, 5 abstract basis, 16 abstract rational basis, 74 abstractions, 30 adequacy property, 33, 124 affine map, 83 algebraic, 13 apart, 14 approximation, 74 axiom of approximation, 12

basis, 13 below, 11 bifree algebra, 18 bifurcated binary expansion, 109 binary T -algebra, 106 binary expansion, 110 binary system, 102 biquotient, 43 bisimilar, 115 bisimulation, 115 bottom, 11 bounded, 13 bounded complete, 13 bounded complete domain, 13 bounded universal quantifier, 138

canonical extension, 64 canonical index, 20 canonical solution, 18 closed, 31 coherently complete, 14, 53 coherently complete domain, 14 collection of domains for PCF, 31 combinations, 30 compact, 13 composable, 71 composite path, 71 computable, 21, 25, 33 computational adequacy, 2, 126 computational completeness, 2 computationally complete, 133 computationally complete programming language, 5 computationally feasible, 136 concatenation, 82 concrete category, 48 concretely cartesian closed, 49 conjugacy, 103 consistent, 13, 14 consistently complete, 13 continuous, 12 continuous lattice, 13 continuous Scott domains, 13 countably based, 13 cut, 73

dcpo, 11 denotational semantics, 32 densely injective, 17 destructors, 104 directed, 11 directed complete poset, 11 discrete order, 10 discrete space of rational numbers,

75 domain, 13, 22 domain equation, 18 dyadic, 63 dyadic induction principle, 104

effective presentation, 24 effective presentation of a coherently

complete domain, 25 effectively given A-domain, 24 effectively given algebraic domain,

22 effectively given coherently complete

domain, 25 environments, 32 equivalent, 48 equivalent objects, 48 essentially definable, 134 extended cuts, 73 extended interval domain, 63 extended partial real line, 64 extended real line, 63 exterior, 58

fast-converging Cauchy sequence, 78 fibre, 48 finite, 13 first-order computationally complete,

141 flat domain of truth values, 14 formal intervals, 74 free variables, 30

ground types, 30 guarded, 88 guarding constant, 88

half-plane, 72

has internal joins, 52 Hausdorff metric, 78 head-normal form, 91 homomorphism, 102 hyper-cube, 151

ideal, 16

ideal completion of P, 16

immediate reduction relation, 33 immediate reduction rules for integ-

ration, 156 immediate reduction rules for supremum,

162 induce the same notion of comput-

ability, 47 induced, 13 inductive, 98, 104 infinitely iterated concatenation, 85 information order, 11 injective, 16 injective spaces, 17 integrals, 155 integrand, 155 interpolation property, 12 interpretation, 31 interval domain, 63 interval expansion, 85 interval Riemann integral, 146 interval Riemann sum, 145 interval space, 64 isochordal, 18 isochordally injective, 18 isolated from below, 13 iterated function system (IFS), 103

J-domain, 52, 53 joining map, 52 kernel operator, 54

lazy evaluation, 84 least fixed-point combinator, 15 left dominant, 82 lifting, 11 locally computable, 29 locally continuous, 18 lower, 66 lower quasi-metric, 76

maximal, 74 multiple interval Riemann integral,

152 multiple interval Riemann sum, 152 multiplicative, 63, 72

neighbourhoods, 74 non-trivial, 70

open, 31 open balls, 76 opposite, 76 order-continuous, 11

pairing function, 20 parallel conditional, 28 parallel-or, 120 partial extended cuts, 73 partial real line, 4, 64 partial real numbers, 64 partial unit interval, 4, 64 partially evaluated, 91 partially ordered set, 10 partition, 144, 151 pointed, 11 poset, 10 prefix, 80, 82 prefix preorder, 82 preordered set, 10 Programs, 31

quasi-metric space, 75

real number type, 124 real numbers type hierarchy, 4 Real PCF, 130 real programs, 124 recursive, 21 recursive definition, 15 refinement witness, 145 refines, 145 retract, 14 round completion, 16 round ideal, 16

Scott topology, 11 section-retraction, 14 sequential conditional, 28 set of truth values, 14 simulation, 116 single-step functions, 15 singleton-map, 64 sound, 5 specialization order, 10 standard, 31 standard effective presentation of B^{ω},

25 step functions, 15 strict, 11 strictly above, 11 strictly below, 11 structural corecursion, 43 structural recursion, 43 subbasis, 13 sublanguage, 159 suffix, 82 supremum, 153 symmetrization, 76 syntactic information order, 34

transpose, 15 truncated subtraction, 76 types, 30

undefined, 70 undefined environment, 32 underlying functor, 48 unit interval, 63 unit interval domain, 63 unit triangle, 72 universal, 14 upper, 66 upper quasi-metric, 76

volume, 152 way-below, 12 way-consistent, 23 word, 80