On the equivalence of some approaches to computability on the real line∗ Dieter Spreen†, Holger Schulz Fachbereich Mathematik, AG Theoretische Informatik, Universit¨at Siegen 57068 Siegen, Germany
Abstract There have been many suggestions for what should be a computable real number or function. Some of them exhibited pathological properties. At present, research concentrates either on an application of Weihrauch’s Type Two Theory of Effectivity or on domain-theoretic approaches, in which case the partial objects appearing during computations are made explicit. A further, more analysis-oriented line of research is based on Grzegorczyk’s work. All these approaches are claimed to be equivalent, but not in all cases proofs have been given. In this paper it is shown that a real number as well as a real-valued function are computable in Weihrauch’s sense if and only if they are definable in Escard´ o’s functional language Real PCF, an extension of the language PCF by a new ground type for (total and partial) real numbers. This is exactly the case if the number is a computable element in the continuous domain of all compact real intervals and/or the function has a computable extension to this domain. For defining the semantics of the language Real PCF a full subcategory of the category of bounded-complete ω-continuous directed-complete partial orders is introduced and it is defined when a domain in this category is effectively given. The subcategory of effectively given domains contains the interval domain and is Cartesian closed.
1
Introduction
The question which real numbers are computable has interested logicians and computer scientists since the early days of computability theory [21], and various definitions have been proposed. (The relationship of most of them is studied in [4].) The central idea with these approaches is that real numbers are limit points of certain sets (or sets of sets) of rationals (Dedekind cuts, Cauchy sequences, Cauchy sequences with a fixed convergence rate, sequences of nested rational intervals with length approaching zero, n-adic expansions, . . . ). Rational numbers are easy to encode objects. A real is then computable, if the set and/or sequence (of codes) of approximating objects can effectively be generated. Unfortunately, though these notions are derived from equivalent characterizations of the reals, they partly lead to different classes of computable real numbers. Moreover, in some approaches simple operations such as multiplication are not computable [22], where a real-valued function is computable, if there is a Turing machine which operates on the infinite input words given by (the code of) the objects approximating the arguments and produces as output the sequence of (codes of the) objects approximating the function value. An analysis of these approaches led Weihrauch to the development of his Type Two Theory of Effectivity (TTE) [14, 22, 23, 24]. Here infinite entities like the reals are represented by infinite words over a finite alphabet. If such a word is computable (as a sequence of letters), then also the corresponding entity is considered as computable. A map between spaces of such ∗ The paper mainly contains results from the second author’s diploma thesis [18] written under the supervision of the first author. † Corresponding author. E-mail:
[email protected].
1
entities is computable, if there is a Turing machine which, working on the word representing the argument, step by step produces a word representing the value of the map. Note that such computations are necessarily infinite, but that each finite part of the output is produced in finite time. Different representations of a space can be compared in a canonical way. This allows to distinguish certain representations as admissible. They induce the same computability notion on the represented space. In the case of the real numbers the representations defined by Cauchy sequences of rationals with a fixed convergence rate and/or sequences of nested rational intervals with length approximating zero turn out to be admissible. All basic operations on the reals are computable with respect to these representations. A machine independent and more analysis-oriented computability definition for real-valued functions has been proposed by Grzegorczyk [12, 13]. He defines real numbers to be computable, if they are limits of computable Cauchy sequences of rationals with a fixed convergence rate (e.g. 2−n ). Similarly, a sequence of real numbers is computable, if there is a double sequence of rationals converging pointwise with fixed rate to the given sequence. A real-valued function is then computable, if it maps computable sequences to computable sequences and is effectively uniformly continuous on compact rational intervals. Note that these computability notions are also used in Pour-El/Richards [17]. Quite a different approach to computability on the reals goes back to an early paper of D. Scott [19], in which he considers the countably based continuous domain of all closed real intervals as well as the whole real line ordered by converse inclusion. The real numbers are just the maximal elements of this domain. There is an elaborated computability theory for such domains [25] (see also [8]). Thus, one obtains a computability notion for the reals as a special case. Note that in this approach a real number turns out to be computable if and only if it is the intersection of a computable sequence of nested closed rational intervals. Every continuous real-valued function has a continuous extension to the whole domain. It is said to be computable if it has a computable extension. As is shown by Edalat and S¨ underhauf [8], these computability notions coincide with the ones used by Grzegorczyk as well as Pour-El and Richards. There has recently been a considerable amount of work on using continuous domains in computable analysis. A large class of spaces can be recovered as maximal elements of domains which in addition to the ideal elements of the mathematical universe also contain the partial entities necessarily appearing in constructions (computations). Furthermore, an important part of analytical mathematics has be extended to such domains. (See [9] for an overview.) Working with continuous domains has certain drawbacks, especially when one is interested in considering higher type functions and computability. Therefore, some authors [2, 20, 6, 7] prefer to work with Scott domains. In the case of the reals one considers the ideal completion of the class of all closed rational intervals ordered by converse inclusion. Now, the real numbers are no longer the maximal elements of the domain, but can be obtained by factorizing its total elements [2, 3]. A real number is computable in this case, if it has a computable representative in the corresponding equivalence class, and a real-valued function is computable, if it has a computable extension to the domain modulo factorization. Also these computability notions are equivalent to the notions of Grzegorczyk, as is proved by Stoltenberg-Hansen and Tucker [20]. All approaches to computability on the reals mentioned so far are external: with the help of a coding of the rationals and some topological properties a reduction to well known computability notions on discrete sets is used. A totally different, internal approach is due to Escard´o [10]. He extends the functional programming language PCF introduced by Plotkin [16] with a type for real numbers. This type is interpreted as the interval domain mentioned above. A real number and a real-valued function, respectively, are computable in this approach, if there is a term in the extended language which denotes the given number or an extension of the given function. In this paper we show that these computability notions for numbers and functions coincide with the ones given via the theory of effectively presented continuous domains, as well as those obtained through the TTE approach. Since all approaches to the computability on the real line reported on above are quite different, this equivalence result together with those cited before shows that also in the continuous case we now have a stable notion of a computable real number and a computable real-valued function, respectively. 2
For interpreting the Real PCF language, a Cartesian closed category of domains is required which contains the interval domain as object. Moreover, to establish the relationship between definability in Real PCF and computability, the domains in this category have to be effectively presented such that a notion of computable object can be introduced. In order to achieve this, either the category of computable retracts of Plotkin’s T ω [11] or of effectively given Scott domains [18] has been considered. Here, a new approach is presented. We offer a notion of being effectively given for a subclass of bounded-complete ω-continuous directed-complete partial orders and show that the category of such domains with Scott continuous maps as morphisms is Cartesian closed. Moreover, it contains the interval domain. The paper is organized as follows. In Section 2 the TTE approach to real number computability is recalled. Similarly, Section 3 contains basic definitions and results from domain theory. The aforementioned category of effectively given domains is presented and its Cartesian closure is shown. Moreover, the interval domain is considered. In Section 4 the language Real PCF is introduced. Finally, in Section 5 the equivalence theorems are proved. Concluding remarks are given in Section 6.
2
The TTE approach to real number computations
2.1
Basic definitions
Let Σ be some finite alphabet, Σ∗ be the set of all finite words over Σ, and Σω be the set of infinite sequences (words) with elements from Σ. The empty word is denoted by ǫ. As is well known, Σω is furnished with a canonical topology, the Cantor topology τC = { AΣω | A ⊆ Σ∗ }. Here AΣω is the set of all words in Σω that have a prefix from A. In order to compute with infinite words Turing machines with a finite number of readonly input tapes and a write-only output tape are used so that on the output tape the head can move only in one direction. They are called type two machines [23]. If M is such a machine, say with k input tapes and input/output alphabets Σ1 , . . . , Σk , Σ, then the partial ω ω map ΓM : Σω 1 × · · · × Σk ⇀ Σ computed by M is defined as follows: ΓM (p1 , . . . , pk ) = p, if M with p1 , . . . , pk written on its input tapes computes forever, writing the infinite sequence p on its output tape. Note that, if ΓM (p1 , . . . , pk ) is defined then every finite prefix of the output is produced in finite time and is thus dependent only on a finite initial segment of the input. In other words, ΓM is continuous. ω ω Definition 2.1 An operator Γ : Σω 1 × · · · × Σk ⇀ Σ is recursive, if there is a type two machine M with k input tapes and input/output alphabets Σ1 , . . . , Σk , Σ such that Γ = ΓM .
A point p ∈ Σω is constructive, if the 0-place operator () 7→ p is recursive. Constructive elements are also called computable in the literature. A representation δ of a nonempty set T is a partial map δ : Σω ⇀ T (onto) with domain dom(δ). The value of δ at p ∈ dom(δ) is denoted, interchangeably, by δp and δ(p). Example 2.2 Let natural numbers be denoted in binary (without leading zeros) and let νbin : {0, 1}∗ ⇀ ω map meaningful binary words to their corresponding numbers. For p = u1 ♯u2 ♯ . . . with ui ∈ dom(νbin ) set Mp = { νbin (ui ) − 1 | i ∈ ω ∧ νbin (ui ) > 0 }, and for any other word p ∈ {0, 1, ♯}ω let Mp be undefined. Then M is a representation of the power set of ω. Representations of T can be compared in a natural way. ′ ω Definition 2.3 Let δ : Σω 1 ⇀ T and δ : Σ2 ⇀ T be representations of the set T . ω 1. δ ≤c δ ′ , read δ is (computably) reducible to δ ′ , if there is a recursive operator Γ : Σω 1 ⇀ Σ2 ′ ′ such that for all p ∈ dom(δ), Γ(p) ∈ dom(δ ) and δp = δΓ(p) .
3
2. δ ≡c δ ′ , read δ is (computably) equivalent to δ ′ , if δ ≤c δ ′ and δ ′ ≤c δ. With the help of a representation the canonical computability notions for infinite words and operators on them can be lifted to the represented set. Definition 2.4 Let T, T1 , . . . , Tk be nonempty sets with representations δ, δ 1 , . . . , δ k , respectively. 1. An element z ∈ T is called δ-computable, if there is a constructive point p ∈ Σω with z = δp . 2. A partial map F : T1 × · · · × Tk ⇀ T is (δ 1 , . . . , δ k , δ)-computable, if there is a recursive operator Γ with Γ(p1 , . . . , pk ) ∈ dom(δ) and F (δp11 , . . . , δpkk ) = δΓ(p1 ,...,pk ) , for all (p1 , . . . , pk ) ∈ (δ 1 × · · · × δ k )−1 (dom(F )). Obviously, these computability notions are invariant under the equivalence of representations. There are many ways to represent a set. But not all of them will induce the computability notion one may have in mind. In the case of countably based topological T0 -spaces there is a natural way to single out a class of representations with the “right” properties. Definition 2.5 Let (T, τ ) be a topological T0 -space with a countable basis { Bi | i ∈ ω }. For p ∈ dom(M) let θp be the unique point z ∈ T such that Mp is the set of all numbers n with z ∈ Bn , if there is such a point, and let θp be undefined for any other p ∈ {0, 1, ♯}ω . The map θ is called standard representation of T . Any representation κ of T with κ ≡c θ is said to be admissible. Each representation induces a topology on the represented set, by lifting the Cantor topology. In the case of admissible representations this topology coincides with the given topology τ . Moreover, τ is the coarsest topology induced by a continuous representation (see [23]).
2.2
Admissible representations of the real line
We shall now consider representations of the reals. First we introduce a canonical notation for rational numbers. Let to this end Σ1 = {0, 1, −, /, ♯} and define νQ : Σ∗1 ⇀ Q as follows. For u ∈ dom(νbin ), νQ (u) = νbin (u), for u ∈ dom(νbin ) \ {0}, νQ (−u) = −νbin (u), and for u, v ∈ dom(νbin ) with u 6= 0 and v 6∈ {0, 1} such that νbin (u) and νbin (v) have no common divisor, νQ (u/v) = νbin (u)/νbin (v) and νQ (−u/v) = −νbin (u)/νbin (v). In any other case νQ is undefined. Obviously, νQ is surjective. Definition 2.6 For u0 , v0 , u1 , v1 , . . . ∈ dom(νQ ) such that sup { νQ (ui ) | i ∈ ω } = inf{ νQ (vi ) | i ∈ ω } set ρ(u0 ♯v0 ♯u1 ♯v1 . . . ) = sup { νQ (ui ) | i ∈ ω }. For any other p ∈ Σω 1 let ρ(p) be undefined. The map ρ is called interval representation of R. As is shown in [23], this representation is admissible. A word representing a real number with respect to ρ contains information about approximations of the number from below and above. If this requirement is relaxed, one obtains representations that are no longer admissible. Definition 2.7 For u0 , u1 , . . . ∈ dom(νQ ) let 1. ρL (u0 ♯u1 . . . ) = sup { νQ )(ui ) | i ∈ ω }, if νQ (ui ) < sup { νQ )(ui ) | i ∈ ω }, for all i ∈ ω, 2. ρR (u0 ♯u1 . . . ) = inf { νQ )(ui ) | i ∈ ω }, if νQ (ui ) > inf { νQ )(ui ) | i ∈ ω }, for all i ∈ ω, L R R ω and let ρL p and ρp be undefined for any other p ∈ Σ1 . The maps ρ and ρ , respectively, are called Dedekind left- and right-cut representations of R.
Lemma 2.8
4
1. Up to computational equivalence the representation ρ is the infimum of the representations ρL and ρR with respect to computational reducibility. 2. The representations ρL and ρR are not comparable with respect to computational reducibility. 3. A real number is ρ-computable just if it is both ρL - and ρR -computable. Proof: (1) Let ξ ∈ R and u0 ♯v0 ♯u1 ♯v1 . . . ∈ dom(ρ) with ρ(u0 ♯v0 ♯u1 ♯v1 . . . ) = ξ. Then we have for all i ∈ ω that νQ (ui ) ≤ ξ ≤ νQ (vi ). In the definitions of representations ρL and ρR strict ω inequalities are required. Define an operator Γ : Σω 1 ⇀ Σ1 as follows. For p = u0 ♯v0 ♯u1 ♯v1 . . . ′ ′ with ui , vi ∈ dom(νQ ), for i ∈ ω, let Γ(p) = u0 ♯u1 . . . , where for every i ∈ ω, u′i is the uniquely determined word in dom(νQ ) with νQ (u′i ) = νQ (ui ) − 1/(i + 1). In any other case let Γ(p) be undefined. Then Γ is computable and witnesses that ρ ≤c ρL . Analogously, it follows that ρ ≤c ρR . If δ : Σω ⇀ R is any other representation of the reals with ρ ≤c δ ≤c ρL , ρR , there are L R computable operators ΓL , ΓR : Σω ⇀ Σω 1 with ΓL (p) ∈ dom(ρ ), ΓR (p) ∈ dom(ρ ), and R ω set ρL = δ = ρ , for p ∈ dom(δ). For p ∈ Σ p 1 ΓL (p) ΓR (p) Γ(p) = ΓL (p)(0)♯ΓR (p)(0)♯ΓL (p)(2)♯ΓR (p)(2) . . . . Then Γ is computable and for p ∈ dom(δ) we have that Γ(p) ∈ dom(ρ) and δp = ρΓ(p) . Thus δ ≡c ρ. (2) Assume that ρL ≤c ρR . Then ρL ≡c ρ by (1), which means that ρL is admissible. As is easily verified, admissible representations are continuous. Thus, there are an index set I and uj ∈ Σ∗1 (j ∈ I), say uj = uj0 ♯ . . . ujmj ♯, with uji ∈ dom(νQ ) so that (ρL )−1 ((0, 1)) = S dom(ρL ) ∩ {Suj Σω 1 | j ∈ I }. By definition, representations are surjective. Hence, we have j L j ω that (0, 1) = { ρL (uj Σω 1 ) | j ∈ I }. But ρ (u Σ1 ) = { ξ ∈ R | ξ > max { νQ (ui ) | i ≤ mj } }. R L In the same way it follows that ρ 6≤c ρ . (3) The “only if”-part is a consequence of (1). For the “if”-part let ξ ∈ R be both ρL and ρR -computable. Then there are infinite constructive words u0 ♯u1 . . . and v0 ♯v1 . . . with ρL (u0 ♯u1 . . . ) = ξ = ρR (v0 ♯v1 . . . ). It follows that also u0 ♯v0 ♯u1 ♯v1 . . . is constructive and ξ = ρ(u0 ♯v0 ♯u1 ♯v1 . . . ). In numerical computations one usually works with the decimal representation of the real numbers or a variation thereof. But, as shown in [23], the decimal representation is not admissible. Moreover, a simple operation like multiplication by 3 is not computable with respect to this representation (see e.g. [23]). Similar phenomena can also be observed with respect to any other b-adic representation. Again, the reason is that these representations are obtained from one-sided approximations. In order to overcome this deficiency one allows also negative digits in the representation. Definition 2.9 Let b ∈ ω with b ≥ 2 and Σb = {−b + 1, . . . , b − 1, .}. Set κ(b) (an . . . a0 .a−1 a−2 . . . ) =
n X
ai · bi ,
i=−∞ (b)
(b) is if ai ∈ {−b + 1, . . . , b − 1}, and let κp be undefined for any other p ∈ Σω b . The map κ called negative digit b-adic representation.
Note that in the case of the negative digit binary representation we simply write κ instead of κ(2) . Lemma 2.10 The negative digit b-adic representation is admissible.
5
Proof: We show that κ(b) ≡c ρ. Let us first verify that κ(b) ≤c ρ. This is witnessed by ω (b) the following operator Γ : Σω b ⇀ Σ1 . For p ∈ dom(κ ), say p = an . . . a0 .a−1 a−2 . . . , set Γ(p) = u0 ♯v0 ♯u1 ♯v1 . . . , where for i ≥ 0, ui and vi , respectively, are the unique elements in dom(νQ ) with νQ (ui ) =
n X
k
ak b − b
−(i+1)
and
νQ (vi ) =
k=−i
n X
ak bk + b−(i+1) .
k=−i
In any other case let Γ(p) be undefined. ω ω For the converse reduction define Γ : Σω 1 ⇀ Σb as follows. If p ∈ Σ1 is not of the form u0 ♯v0 ♯u1 ♯v1 . . . with ui , vi ∈ dom(νQ ), let Γ(p) be undefined. Otherwise, set Γ(p) = an . . . a0 .a−1 a−2 . . . , where n ∈ ω and an , . . . , a0 , a−1 , . . . ∈ {−b+1, . . . , b−1} are inductively given in the subsequent way. First, find k0 , m0 ∈ ω such that |νQ (uk0 ) − νQ (vm0 )| ≤ 1. Let a = ⌈νQ (uk0 )⌉ and set n = ⌊logb a⌋. Now, for i = n, . . . , 0, define Pn ai = max { j | −b + 1 ≤ j ≤ b − 1 ∧ l=i+1 al bl + jbi ≤ a }.
Pn Obviously, l=0 al bl = a. Next, assume for i > 0 that the digits an , . . . , a0 , a−1 , . . . , a−i+1 have already been computed and that indices kn , mn ∈ ω with |νQ (ukn ) − νQ (vmn )| ≤ b−n have been found, for n < i. Then find ki , mi ∈ ω such that νQ (uki ) ≥ νQ (uki−1 ) and |νQ (uki ) − νQ (vmi )| ≤ b−i . In case that P−i+1 P−i+1 | l=n al bl − νQ (uki )| ≤ b−i , set a−i = 0, if l=n al bl ≥ νQ (uki ), and a−i = 1, if not. In the P−i+1 opposite case determine 0 < j < b with jb−i < | l=n al bl − νQ (uki )| ≤ (j + 1)b−i and define P−i+1 l a−i = −j, if l=n al b > νQ (uki ) + jb−i , and a−i = min{j + 1, b − 1}, otherwise. If p ∈ dom(ρ), we can always find indices k, m as required. By induction we now show P−i that for i ≥ 0, l=n al bl ∈ [νQ (uki ), νQ (uki ) + b−i ], or if this is not true and ¯ı is the greatest Pi P−i stage below i in the construction for which it holds, then l=n al bl ∈ [νQ (uk¯ı ) + l=¯ı+1 (b − 1)b−l , νQ (uki )]. Obviously, the statement is valid for i = 0. Suppose that it holds for i − 1 and let s = P−i+1 l −l | l < i }] and νQ (uki−1 ) ≤ νQ (uki ) ≤ ρp , l=n al b . Since ρp ∈ [νQ (uki−1 ), min { νQ (ukl ) + b we have that also νQ (uki ) ∈ [νQ (uki−1 ), min { νQ (ukl ) + b−l | l < i }]. Thus, either s, νQ (uki ) ∈ Pi−1 [νQ (uki−1 ), νQ (uki−1 ) + b−i+1 ], or s ∈ [νQ (uk¯ı ) + l=¯ı+1 (b − 1)b−l , νQ (uki−1 )] and νQ (uki ) ∈ [νQ (uki−1 ), νQ (uk¯ı ) + b−¯ı ]. It follows that in both cases |s − νQ (uki )| ≤ b−i+1 , which means that in the definition of a−i a number j < b can be found as specified. Now, assume that s ∈ [νQ (uki−1 ), νQ (uki−1 ) + b−i+1 ]. Then in all but one of the cases in the definition of a−i it is easily verified s + a−i b−i ∈ [νQ (uki ), νQ (uki ) + b−i ]. The exception is the case in which (b − 1)b−i < |s − νQ (uki )| ≤ b−i+1 and s < νQ (uki ) − (b − 1)b−i . The last inequality means that s + a−i b−i < νQ (uki ). By the assumption we moreover have that s + a−i b−i ≥ νQ (uki−1 ) + (b − 1)b−i . Thus, the second part in the above statement holds. Note that ¯ı = i − 1 in this case. Next, suppose that there is some ¯ı as specified in the above statement and s ∈ [νQ (uk¯ı ) + Pi−1 −l l=¯ ı+1 (b − 1)b , νQ (uki−1 )]. Again we obtain in all cases in the definition of a−i except the one mentioned that the first part of the above statement holds. The second part is obviously valid in the exceptional case. It follows from this consideration that Γ(p) is defined. By construction, Γ(p) ∈ dom(κ(b) ). P−i (b) As a further consequence we have that | l=n al bl − ρp | ≤ b−i , which implies that ρp = κΓ(p) .
6
3
The domain-theoretic approach to real number computability
3.1
Basic definitions and facts
Let (D, ⊑) be a partial order with smallest element ⊥. For a subset S of D, ↑S = { x ∈ D | (∃y ∈ S)y ⊑ x } is the upper set generated by S. The subset S is called compatible if it has an upper bound. S is directed , if it is nonempty and every pair of elements in S has an upper bound in S. D is aF directed-complete partial order (dcpo) if every directed subset S of D has a least upper bound S in D, and D is bounded-complete if every compatible subset has a least upper bound. For a detailed treatment of the theory of directed-complete partial orders the reader is referred to [1]. If (D, ⊑) is a dcpo and x, y ∈ D then oneFsays that x approximates y, and writes x ≪ y if for every directed subset S of D with y ⊑ S there is some u ∈ S such that x ⊑ u. The relation ≪ is transitive. It is also called way-below relation. Definition 3.1 Let (D, ⊑) be dcpo. 1. A subset F Z of D is a basis of D, if for any x ∈ D the set Zx = { z ∈ Z | z ≪ x } is directed and x = Zx .
2. D is called continuous if it has a basis, and ω-continuous if it has a countable basis. The next lemma lists some important properties of the order of approximation ≪.
Lemma 3.2 Let D be a continuous dcpo with basis Z, M a finite subset of D, and u, v, x, y ∈ D. Then the following three statements hold: 1. If x ≪ y then x ⊑ y. 2. If u ⊑ x ≪ y ⊑ v then u ≪ v. 3. If w ≪ x, for all w ∈ M , then there is some z ∈ Z such that z ≪ x and w ≪ z, for all w ∈ M. Statement (3) is known as the interpolation property. As a consequence of the lemma we have for u, v ∈ D such that u ⊔ v exists, if u, v ≪ x then also u ⊔ v ≪ x. For z ∈ Z let ↑{z} = { y ∈ D | z ≪ y }. Note that by the interpolation property there is always a descending sequence in ↑{z}. But in general one cannot force it to have z as its greatest lower bound. We say that the basis Z of a continuous dcpo D has the inverse approximation property, if for every z ∈ Z and every y ∈ ↑{z} there is an infinite sequence (yi )i∈ω with z ≪ yi+1 ⊑ yi ⊑ y, for i ∈ ω, which has z as its greatest lower bound. Definition 3.3 A bounded-complete ω-continuous dcpo D with basis Z which is closed under the operation of taking least upper bounds of bounded finite subsets and has the inverse approximation property is called domain. The following technical result will be used later. Lemma 3.4 Let D be a continuous dcpo with a basis Z that has the inverse approximation property. Moreover, let z ∈ Z, and let S be a finite subset of D with ↑{z} ⊆ ↑S. Then z ∈ ↑S. Proof: Let y ∈ ↑{z}. Then there is an infinite descending sequence (yi )i∈ω with z ≪ yi ⊑ y, which has z as its greatest lower bound. It follows that yi ∈ ↑S, for all i ∈ ω. Thus, there is some xi ∈ S with xi ⊑ yi , for each i. Since S is finite, we can assume without restriction that all xi are equal, i.e., there is some x ∈ S such that x ⊑ yi , for all i ∈ ω. Because z is the greatest lower bound of the yi , we have that x ⊑ z.
7
As is well known, on each dcpo D there is a canonical T0 topology σ: the Scott topology. A subset X of Q is open in σ if X is an upper set and with each x ∈ X there is some y ∈ X such that y ≪ x. If D is continuous, this topology is generated by the sets ↑{z} with z ∈ Z. With respect to set inclusion, the Scott topology is itself a dcpo. Its way-below ≪σ relation can be characterized in the following way. Lemma 3.5 Let D be a continuous dcpo with open subsets O and U . Then O ≪σ U if and only if O ⊆ ↑S ⊆ U , for some finite set S. Definition 3.6 Let D and E be dcpo’s. A map F : D → E is Scott continuous if it is monotone and for any directed subset S of D, G G F ( S) = F (S).
As is well known, a map between dcpo’s is Scott continuous, exactly when it is continuous with respect to the Scott topologies. The collection of all Scott continuous maps from D to E is denoted by [D → E]. It is endowed with the pointwise order , i.e., F ⊑ G if F (x) ⊑ G(x), for all x ∈ D, which makes it into a dcpo. The categorical product of two dcpo’s is obtained by taking the ordinary Cartesian product and furnishing it with the componentwise partial order. The product of two domains is again a domain. In general, the function space of two continuous dcpo’s is not a continuous dcpo again, in other words, the category of continuous dcpo’s and Scott continuous maps is not Cartesian closed. This is the case, however, if we restrict our attention to the full subcategory DOM of domains. Definition 3.7 Let D and E be bounded-complete continuous dcpo’s. 1. For basic elements d ∈ D and e ∈ E the single-step function (d ց e) : D → E is defined by ( e if d ≪ x, (d ց e)(x) = ⊥E otherwise. 2. A step function is the join of a bounded finite collection of single-step functions. Note that a finite family (di ց ei ), i = 1, . . . , n, of single-step functions is bounded, exactly if the set { ei | di ≪ x } is bounded for each x ∈ D. As follows from the next lemma, for domains D, E the collection of all step functions is a basis of [D → E]. Lemma 3.8 Let D, E be domains with bases ZD and ZE , respectively. Moreover, let F ∈ [D F → E], and for some finite index set I, let di ∈ ZD and ei ∈ ZE , for i ∈ I, such that { (di ց ei ) | i ∈ I } exists. Then the following two statements hold: F 1. F = { (d ց e) | e ≪ F (d) }. F 2. { (di ց ei ) | i ∈ I } ≪ F ⇔ (∀i ∈ I)ei ≪ F (di ). F F Proof: In [5] it is shown that F = { (d ց e) | ↑{d} ≪σ F −1 (↑{e}) }, and { (di ց ei ) | i ∈ I } ≪ F if and only if ↑{di } ≪σ F −1 (↑{ei }), for all i ∈ I. But as follows from Lemmas 3.4 and 3.5, ↑{d} ≪σ F −1 (↑{e}) just if e ≪ F (d). Theorem 3.9 The category DOM of domains and Scott continuous maps is Cartesian closed.
8
Proof: It remains to show that the collection of all step functions has the inverse approximation property. Let to this end F ∈ [D → E] and I be a finite index set such that F { (di ց ei ) | i ∈ I } ≪ F , where di ∈ ZD and ei ∈ ZE , for i ∈ I. Then there are finitely many subsets set of all dj with j ∈ F J is bounded. It folF J of I, say J0 , . . . , Jn , so that the F lows that { e | j ∈ J } exists, for k ≤ n, and { e | j ∈ J } ≪ F ( { dj | j ∈ Jk }). Let j k j k F F dk = { dj | j ∈ Jk } and ek = { ej | j ∈ Jk }. Since ZE has the inverse approximation property, there are sequences (ylk )l∈ω , for k ≤ n, with ek ≪ . . . y1k ⊑ y0k ⊑ F (dk ) such that (ylk )l∈ω has ek as its greatest lower bound. Set G zl = { (dk ց ylk ) | k ≤ n },
F for l ∈ ω. Then F zl ⊑ F and zl+1 ⊑ zl . Moreover { (di ց ei ) | i ∈ I } ≪ zl and the sequence (zl )l∈ω has { (di ց ei ) | i ∈ I } as its greatest lower bound.
3.2
Effectively given domains
In what follows, let h , i : ω 2 → ω be a recursive pairing function with corresponding projections π1 and π2 such that πi (ha1 , a2 i) = ai . We extend the pairing function in the usual way to an (n) n-tupel encoding. The projections are then denoted by πi , for 1 ≤ i ≤ n. Moreover, let ∆ : ω → Pf (ω) be a canonical indexing of all finite subsets of natural numbers and let P (n) (R(n) ) denote the set of all n-ary partial (total) recursive functions. Definition 3.10 Let D be a domain with countable basis Z = {d0 , d1 , d2 , . . . }. D is effectively given (relative to d), if the following three conditions hold: 1. The set { hi, ji | di ≪ dj } is recursive. 2. The set { n | { di | i ∈ ∆n } is bounded } is recursive. F 3. There is a function q ∈ R(1) such that dq(n) = { di | i ∈ ∆n }, if { di | i ∈ ∆n } is bounded. We say in this case that {d0 , d1 , . . . } is a canonical basis of D. Definition 3.11 Let D be an effectively given domain. An element x ∈ D is computable, if the set { i ∈ ω | di ≪ x } is recursively enumerable. For any countable set A = {a0 , a1 , . . . } the set A⊥ = A ∪ {⊥} with partial order given by x ⊑ y, if x = ⊥ or x = y, is an effectively given domain: set d0 = ⊥ and dn+1 = an , for n ∈ ω. Any of its elements is computable. The product of two effectively given domains D and E with canonical bases, say {d0 , d1 , . . . } and {e0 , e1 , . . . }, respectively, is again effectively given, with canonical basis {b0 , b1 , . . . }, where bhi,ji = (di , ej ). Definition 3.12 Let D and E be continuous dcpo’s with countable bases {d0 , d1 , . . . } and {e0 , e1 , . . . }, respectively. A continuous map F : D → E is Scott computable, if the set { hi, ji | ej ≪ F (di ) } is recursively enumerable. Scott computable maps between effectively given domains map computable elements to computable elements. As has been shown in the preceding section, the category of domains with Scott continuous maps as morphisms is Cartesian closed. We shall now see that the same holds for the full subcategory of effectively given domains. Proposition 3.13 Let D and E be effectively given domains. Then the domain of continuous maps [D → E] is also effectively given. The Scott computable maps are its computable elements.
9
Proof: As has already been said, the collection of all step functions is a basis of [D → E]. Let {d0 , d1 , . . . } and {e0 , e1 , . . . }, respectively, be canonical bases of D and E and set M = { n ∈ ω | { (di ց ej ) | hi, ji ∈ ∆n } is bounded }. Obviously, M is recursive. Therefore we can define an enumeration of all step functions as F follows: For n ∈ M set fn = { (di ց ej ) | hi, ji ∈ ∆n }. Otherwise, let fn be the smallest element of the function domain. It remains to check the requirements in Definition 3.10. For the first requirement let q ∈ R(1) witness that 3.10(3) holds for E. Without restriction, assume that k, k ′ ∈ M . Then it follows with Lemmas 3.2 and 3.8 that G G { (di ց ej ) | hi, ji ∈ ∆k } ≪ { (dn ց em ) | hn, mi ∈ ∆k′ } G ⇔ (∀hi, ji ∈ ∆k )(di ց ej ) ≪ { (dn ց em ) | hn, mi ∈ ∆k′ } G ⇔ (∀hi, ji ∈ ∆k )ej ≪ { (dn ց em ) | hn, mi ∈ ∆k′ }(di ). But
G
{ (dn ց em ) | hn, mi ∈ ∆k′ }(di ) =
G
{ em | (∃l ∈ π1 (∆k′ ))hl, mi ∈ ∆k′ ∧ dl ≪ di }
= eq(h(k′ ,i)) ,
where h ∈ R(2) with ∆h(k′ ,i) = { m | (∃l ∈ π1 (∆k′ ))hl, mi ∈ ∆k′ ∧ dl ≪ di }. Thus, condition (1) holds. The same is true for condition (2), as there is a function g ∈ R(2) with ∆g(n) = S { ∆j | j ∈ ∆n }, and hence the set { fi | i ∈ ∆n } is bounded just if n ∈ g −1 (M ). If { fi | i ∈ ∆n } is bounded, we have that G G { fi | i ∈ ∆n } = { (dk ց el ) | hk, li ∈ ∆g(n) } = fg(n) ,
which verifies requirement 3.10(3). In order to derive the second statement, let F ∈ [D → E] be Scott computable and A = {Fhi, ji | ej ≪ F (di ) }. Then A is recursively enumerable (r.e.). As is shown in [5], F = { (di ց ej ) | ↑{di } ≪σ F −1 (↑{ej }) }, and by Lemmas 3.4 and 3.5, ↑{di } ≪σ F −1 (↑{ej }) exactly if ej ≪ F (di ). Therefore, we have that G F = { (di ց ej ) | hi, ji ∈ A } G F = { { (di ց ej ) | hi, ji ∈ ∆k } | ∆k ⊆ A } G = { fq(k) | ∆k ⊆ A },
where the function q ∈ R(1) is as in condition 3.10(3). Since { k | ∆k ⊆ A } is r.e., this shows that F is a computable element of [D → E]. Conversely, assume that F is a computable element of [D → E]. Then the set { k | fk ≪ F } is r.e. Since ej ≪ F (di ) ⇔ (di ց ej ) ≪ F ⇔ (∃k)fk ≪ F ∧ hi, ji ∈ ∆k , we obtain that F is also Scott computable.
Theorem 3.14 The category EDOM of effectively given domains and Scott continuous maps is Cartesian closed.
3.3
The interval domain
As we have already seen in Section 2, in order to compute with real numbers one has to approximate them from both sides, e.g. by using compact intervals. In the domain-theoretic approach to computation the objects used for approximation are considered as part of the 10
computational structure. Following this idea in the case of the real numbers, one obtains the interval domain. It is the collection of all nonempty compact intervals, endowed with a least element which we concretely take as the intervall (−∞, +∞): R = { [a, b] ⊆ R | a, b ∈ R ∧ a ≤ b } ∪ {(−∞, +∞)}. The order is reversed subset inclusion, i.e., x ⊑ y if y ⊆ x. Therefore directed least upper bounds correspond to filtered intersections. The way-below relation on R is given by x ≪ y if and only if int(x) ⊇ y, where int(x) is the interior of x with respect to the standard topology on the real line. Thus, (−∞, +∞) ≪ x, for all x ∈ R, and [a, b] ≪ [c, d] if and only if a < c and d < b. The maximal elements are the intervals [a, a], i.e., the singleton sets. Proposition 3.15 R is a domain with basis Q = { [a, b] | a, b ∈ Q ∧ a ≤ b } ∪ {(−∞, +∞)}. Following Escard´ o [10] we call R the partial real line and its elements partial real numbers. The left and right end-points of a partial real number x will be denoted by x and x, respectively, so that x = [x, x]. A base for the Scott topology on R is given by the whole space as well as the sets ↑{[a, b]} = { x ∈ R | x ⊆ (a, b) } with a, b ∈ R so that a < b. So a base for the relative Scott topology on the set MaxR of maximal elements is of the form ↑{[a, b]} ∩ MaxR = { {ξ} | ξ ∈ (a, b) }. Under the canonical map {ξ} 7→ ξ : MaxR → R this is mapped onto the open interval (a, b). Lemma 3.16 The set of maximal elements with the relative Scott topology is homeomorphic to the real line with the standard topology. Let αQ : ω → Q be a canonical indexing of the extended rationals Q = Q ∪ {−∞, +∞}, e.g., let αQ be given by i−j k αQ (hi, j, ki) = +∞ −∞
if k 6= 0, if k = 0 and j ≤ i, otherwise.
Moreover, set rhi,ji = [αQ (i), αQ (j)], if −∞ ≤ αQ (i) ≤ αQ (j) ≤ +∞, and rhi,ji = (−∞, +∞), otherwise. Then r0 , r1 , . . . is an enumeration of the basis Q of the interval domain such that the set { hn, mi | rn ≪ rm } is recursive. Thus condition (1) in Definition 3.10 holds. Since a finite set {[a0 , b0 ], . . T . , [an , bn ]} of rational intervals is bounded just if max { ai | i ≤ n } ≤ min { bi | i ≤ n }, and { [ai , bi ] | i ≤ n } = [max { ai | i ≤ n }, min { bi | i ≤ n }] in this case, the other requirements in 3.10 are satisfied as well. Proposition 3.17 The interval domain R is effectively given. Let us now consider its computable elements. Lemma 3.18 An partial real number x ∈ R is computable if and only if its end-points x and x, respectively, are ρL - and ρR -computable. Proof: Let cd : ω → dom(νQ ) be a bijective computable coding function such that α(i) = νQ (cd(i)), for all i ∈ ω. Now, assume that x is computable. Then there is some effective enumeration n0 , n1 , . . . of the set { m | rm ≪ x }. For m ∈ ω let um = cd(π1 (m)). Then un0 , un1 , . . . is a computable sequence of words in dom(νQ ) such that νQ (uni ) < x, for all i ≥ 0, and x = sup { νQ (uni ) | i ∈ ω }. Hence x = ρL (un0 ♯un1 ♯ . . . ), i.e., x is ρL -computable. In the same way it follows that x is ρR -computable. Next, conversely, suppose that x is ρL - and x is ρR -computable. Then there are constructive R L infinite words u0 ♯u1 ♯ . . . , v0 ♯v1 ♯ . . . ∈ Σω 1 such that ρ (u0 ♯u1 ♯ . . . ) = x and ρ (v0 ♯v1 ♯ . . . ) = x. −1 −1 Let ni = hcd (ui ),Tcd (vi )i, for i ∈ ω. It follows that {n0 , n1 , . . . } is an r.e. subset of { m | rm ≪ x } with { rni | i ∈ ω } = x, which shows that x is a computable element of R. 11
Corollary 3.19 Let δ be an admissible representation of the real line. Then a real number ξ ∈ R is δ-computable, if and only if the singleton set {ξ} is computable in R. There is a correspondence between continuous functions F : Rn ⇀ R and Scott continuous maps G : Rn → R (n > 0). ˇ : Rn ⇀ R be defined in the following way: For Definition 3.20 Let G : Rn → R and let G n ~ ~ ~ ~ be undefined. G ˇ ˇ ξ) ˇ is ξ ∈ R such that G({ξ}) = {ζ}, set G(ξ) = ζ. In any other case let G( n n ˇ called restriction of G to R and G extension of G to R . The next lemma shows that every continuous real-valued function has a Scott continuous extension to the partial reals. To ease notation we restrict ourselves to functions of arity one. Lemma 3.21 Let F : R ⇀ R be continuous and Fˆ : R → R be defined by [supz≪x inf ξ∈z∩dom(F ) F (ξ), inf z≪x supξ∈z∩dom(F ) F (ξ)] if supz≪x inf ξ∈z∩dom(F ) F (ξ), Fˆ (x) = inf z≪x supξ∈z∩dom(F ) F (ξ) ∈ R, ⊥ otherwise,
for x ∈ R. Then Fˆ is Scott continuous and for all ξ ∈ dom F , Fˆ ({ξ}) ∈ MaxR and Fˆ ({ξ}) = {F (ξ)}. X be a directed subset of R. In order Proof: Obviously, Fˆ is well-defined and monotone. Let F F to derive Scott continuity it is sufficient to verify that Fˆ ( X) ⊑ Fˆ (X). We show to this end that Let z ≪
F
supz≪F X inf ξ∈z∩dom(F ) F (ξ) ≤ supx∈X supz≪x inf ξ∈z∩dom(F ) F (ξ).
X. Then we have by Lemma 3.2 that z ≪ x, for some x ∈ X. Hence,
inf ξ∈z∩dom(F ) F (ξ) ≤ supz≪x inf ξ∈z∩dom(F ) F (ξ) ≤ supx∈X supz≪x inf ξ∈z∩dom(F ) F (ξ), from which the above inequality follows. In the same way we obtain that inf x∈X inf z≪x supξ∈z∩dom(F ) F (ξ) ≤ inf z≪F X supξ∈z∩dom(F ) F (ξ).
Now, let ξ ∈ dom(F ). Then
supz≪{ξ} inf ζ∈z∩dom(F ) F (ζ) = F (ξ) = inf z≪{ξ} supζ∈z∩dom(F ) F (ζ), by the continuity of F . Hence, Fˆ (ξ) ∈ MaxR and Fˆ ({ξ}) = {F (ξ)}. As a consequence of Lemma 3.16 we have conversely that the restriction of a Scott continuous map to Rn is a continuous function on the reals. This gives rise to a domain-theoretic definition of computability for real number functions. Definition 3.22 A function F : Rn ⇀ R is R-computable if it has a Scott computable extension G : Rn → R. A convenient computational model for the unit interval [0, 1] is defined in the same manner as the domain R. We denote by I the unit interval domain consisting of all compact intervals contained in [0, 1]: I = { [a, b] ⊆ [0, 1] | a ≤ b }. The order is reversed inclusion as before. Note that [0, 1] is itself a compact interval, so [0, 1] ∈ I and we do not need to add a least element. The above results for R concerning the Scott topology and extensions of functions do also hold for I. 12
Proposition 3.23 I is a domain with basis QI = { [a, b] ∈ I | a, b, ∈ Q }. Observe that I is a sub-order of R: The domain order and the way-below relation are the restriction to I of the corresponding relations on R. Moreover, the least upper bounds of directed subsets of I are the same as in R. The Scott topology on I is the relative Scott topology of R on the set I. Set riI = ri ∩ [0, 1]. Then r0I , r1I , . . . is an enumeration of the basis QI of the unit interval domain such that there is some function h ∈ R(1) with riI = rh(i) , for i ∈ ω. Proposition 3.24 The unit interval domain I is effectively given.
4 4.1
The language Real PCF Computing with partial real numbers
The language Real PCF invented by M. H¨otzel Escard´o [10] is an extension of Plotkin’s language PCF [16], which itself is an extension of the simply typed lambda calculus by arithmetical operations and a fixed point operator for each type. Real PCF allows the the computation with intervals. Definition 4.1 The concatenation • : I × I → I of intervals is given by [x, x] • [y, y] = [(x − x)y + x, (x − x)y + x]. The idea in the definition of this operation is the following: Given x, y ∈ I, rescale the unit interval so that it becomes x, and define x • y to be the interval which results from applying the same rescaling and translation to y. It follows that x • y is a subinterval of x. The rescaling factor is the diameter of x, namely x − x, and the translation constant is the left end-point of x. If x is maximal, then its diameter is zero, so that x • y = x. Obviously, concatenation is associative. Moreover, it is Scott continuous in the second parameter, but not in the first. Therefore, instead of the binary concatenation operation a family of unary operations is considered. For each a ∈ I define the map consa : I → I by consa (x) = a • x. For nonmaximal a ∈ I the map consa has a Scott continuous left inverse taila : I → I, which is given by taila (x) = [max{0, min{(x − a)/(a − a), 1}}, max{0, min{(x − a)/(a − a), 1}}]. The concatenation defined above makes also sense for x and y ranging over the whole interval domain with the restriction that x should not be the smallest element. But in this general case y = a • x does no longer mean that y is contained in a, which holds, however, if x ∈ I. For a ∈ R \ {⊥} define the map riconsa : I → R by riconsa (x) = a • x. Then riconsa is Scott continuous. For nonmaximal elements a ∈ R \ {⊥}, this map too has a Scott continuous left inverse irtaila : R → I, given in the same way as the map taila . Finally, for each nonmaximal a ∈ R \ {⊥}, define the map rrconsa : R → R by rrconsa (x) = a • x. Let B = {tt, ff} be the truth-value set and define b2n = tt and b2n+1 = ff, for n ∈ ω. Then B⊥ is an effectively given domain. In addition to the above operations there are Scott continuous inequality tests k }). Now, define g : ω⊥ → I by (F { conspk+1+i (· · · conspn ([0, 1]) · · · ) | n > k + i } if i 6= ⊥, g(i) = [0, 1] otherwise.
Moreover, for i ∈ ω set 0 if pk+1+i = L, f (i) = 1 if pk+1+i = C, 2 if pk+1+i = R.
Then f ∈ R(1) . Finally, define F : [ω⊥ → I] → [ω⊥ [0, 1] cons (h(i + 1)) L F (h)(i) = cons (h(i + 1)) C consR (h(i + 1))
→ I] by if if if if
i = ⊥, i 6= ⊥ and f (i) = 0, i 6= ⊥ and f (i) = 1, i 6= ⊥ and f (i) = 2.
As is readily verified, F is Scott continuous and g is its least fixed point. Obviously, F is representable in Real PCF, say by F. It follows that the term ricons[xk +c,xk +c] (Y(N→I) (F)(k0 )) represents {ξ}. Next, we consider the case of real-valued functions. Theorem 5.2 Let δ be an admissible representation of the real number set and F : Rn ⇀ R. Then the following three statements are equivalent: 1. F is (δ, . . . , δ)-computable. 2. F is R-computable. 3. F has an extension to Rn which in its curried form is definable in Real PCF. The theorem will follow from the subsequent lemmas. Without restriction we only consider unary functions. Note that by Propositions 3.13 and 4.7 we already know that (3) implies (2). 18
Lemma 5.3 Let δ be an admissible representation of R. Then every R-computable function F : R ⇀ R is (δ, δ)-computable. Proof: Since the interval representation ρ is admissible, it suffices to show that F is (ρ, ρ)computable. Let Fˆ : R → R be a Scott computable extension of F . Then there is a Turing machine M which lists all pairs (x, y) of elements of the basis Q of R such that y ≪ Fˆ (x), more precisely: on input m, M outputs a♯a♯b♯b♯ with [νQ (b), νQ (b)] ≪ Fˆ ([νQ (a), νQ (a)]). By simulating M we can construct a type two machine M ′ with at least two working tapes which operates as follows: input: p ∈ Σω 1 m := 0; repeat if p has a prefix u0 ♯v0 ♯ . . . um ♯vm ♯ then copy um ♯vm ♯ from the input tape and add it to tape 1; simulate M on input m and add the result to tape 2 else stop fi; (∗let the inscription on tape 2 be a0 ♯a0 ♯b0 ♯b0 ♯ . . . am ♯am ♯bm ♯bm ♯∗) for k = 1, . . . , m do if ak ♯ak ♯ can be found on tape 1 then add bk ♯bk ♯ to the output tape fi od; m := m + 1; until forever Since Fˆ is Scott continuous and F is its restriction to R, we obtain for p ∈ ρ−1 (dom(F )) that ρΓM (p) = F (ρp ), which shows that F is (ρ, ρ)-computable. In order to make the proof more perspicuous, we derive the last implication in two steps. First, we show that it holds for functions F : [0, 1 ⇀ [0, 1]. Because of Lemma 2.10 we can assume without restriction that F is (κ, κ)-computable. As follows from the next result, we can even assume that it is (κI , κ)-computable. Lemma 5.4 There is a type two machine M which transforms every word p ∈ dom(κ) with κp ∈ [0, 1] in a word p′ ∈ dom(κ) with κp = κp′ so that p′ has prefix 0.1. Proof: Let p ∈ Σω 2 . If p is not of the form a0 .a−1 a−2 . . . , M stops working. Therefore, suppose that p = a0 .a−1 a−2 . . . and let p′ = 0.1b−2 b−3 . . . be the output of M . If a0 = 1, set bi = −1, for i ≥ 2. Note that if κp ∈ [0, 1], then we must have that a−i = −1, i.e., κp = 0. If a0 = 0 we have to distinguish the cases that a−1 = 1, a−1 = −1, and a−1 = 0. If a−1 = 1 the word p is of the right form. Set p′ = p, i.e., b−i = a−i , for i ≥ 2. If a−1 = −1, let b−i − 1, for i ≥ 2. Note that if κp ∈ [0, 1], then κp = 0 in this case. If a−1 = 0, define ( −1 if a−i ∈ {0, 1} and a−j = 0, for all 1 ≤ j < i, b−i = a−i otherwise, for i ≥ 2. Observe that if κp ∈ [0, 1], then for the smallest j ≥ 1 with a−j 6= 0 we must have that a−j = 1, in case there is any such j. Having this in mind, it is easily verified that κp′ = κp . It remains to consider the case a0 = 1. If a−1 = 1, then M stops working. If a−1 = 0, let b−i = 1, for i ≥ 2. And if a−1 = −1, define b−i = a−i , for i ≥ 2. Obviously, it follows also in these cases that κp′ = κp , if p ∈ [0, 1].
19
In the proof of the last implication it is necessary to describe the behaviour of a type two machine in Real PCF. We call a type two machine normal if it writes at most one symbol on the output tape after reading exactly one symbol from each input tape. Of course, for every type two machine one can construct an equivalent normal one, since finite parts of the inputs and the output can be stored on working tapes. In the sequel we suppose every type two machine to be normal. For what follows we need a G¨ odelization of the finite prefixes of the inscriptions on the input and output tapes of type two machines. Let to this end p·q : Σ∗2 → ω be an encoding of all finite words over Σ2 which is monotone with respect to the prefix ordering, has a decidable range, and for which exists a function ∗ ∈ R(2) such that pwq ∗ pw′ q = pww′ q, for w, w′ ∈ Σω 2. Lemma 5.5 Every (κI , κ)-computable function F : [0, 1] ⇀ [0, 1] has a Real PCF definable extension Fˆ to the unit interval domain. Proof: The construction of the Real PCF term proceeds in a similar way as in the proof of Theorem 5.1. But now, in order to simulate the type two machine which computes the given function, we first have to generate an input for this machine that represents the function argument. We use the test for being smaller than 1/2 to do this and then the maps tailL and tailR to shift the argument appropriately afterwards. Let F : [0, 1] ⇀ [0, 1] be (κI , κ)-computable and let this be witnessed by the normal type two machine M . Every such machine is determined by its behaviour on finite prefixes of the input. It follows that there is a function fM ∈ R(1) such that fM (pwq) is the pq-code of the longest prefix of the output generated by M while reading the prefix w of the input. For i ∈ ω such that i = pa0 . . . an q, for a0 , . . . , an ∈ Σ2 , let suf(i) be the unique m ∈ ω such that fM (pa0 . . . an q) = fM (pa0 . . . an−1 q) ∗ m. For any other i ∈ ω let suf(i) = 0. Then suf ∈ R(1) . For what follows we assume that all such arithmetic functions f are strictly extended to ω⊥ , i.e., for all i ∈ ω⊥ \ dom(f ), f (i) = ⊥. Define maps con : I × ω⊥ → I and H : [ω⊥ × I → I] → [ω⊥ × I → I] by
and
consL (z) if suf(i) = p−1q, cons (z) if suf(i) = p0q, C con(z, i) = consR (z) if suf(i) = p1q, consI (z) otherwise
H(G)(i, z) 1 1 = pif I (z n. In what follows, let consM (a−2 ...a−n ) (z) be an abbreviation for con(z, p0.1a−2 . . . a−n q). Then we have for m ≥ 0 H m (⊥)(p0.1q, {ξ}) = consM (a−2 ) (· · · conM (a−2 ...a−(m+1) ) ([0, 1]) · · · ),
20
where ξ = κI (0.1a−2 a−3 . . . ) and ξ is either not of the form c/2n or it is, but m < n. In the remaining case we have that H m (⊥)(p0.1q, {ξ}) ¡ ¡ = consM (a−2 ) · · · consM (a−2 ...a−(n+1) )
consM (a−2 ...a−(n+1) 1) (· · · consM (a−2 ...a−(n+1) 1−1...−1) ([0, 1]) · · · ) ¢ ¢ ⊓ consM (a−2 ...a−(n+1) −1) (· · · consM (a−2 ...a−(n+1) −11...1) ([0, 1]) · · · ) · · · ,
where the words a−2 . . . a−(n+1) 1 − 1 . . . − 1 and a−2 . . . a−(n+1) − 11 . . . 1 both have length m. From the definition of the map con we obtain for ξ ∈ dom(F ) that F (ξ) ∈ H m (⊥)(p0.1q, {ξ}), for all m ∈ ω. Note moreover that H m+1 (⊥)(p0.1q, {ξ}) $ H m (⊥)(p0.1q, {ξ}), if the machine M , after reading the first m+4 letters on the input tape, increases the output which it obtained by reading the first m + 3 letters of input. Since the final output is an infinite word, it follows that the length of the intervals H m (⊥)(p0.1q, {ξ}) converges to zero. Thus Fˆ ({ξ}) = {F (ξ)}. In the next and final step we extend the above result to functions F : R ⇀ R. Note that if am . . . a0 .a−1 a−2 . . . represents a real Pmnumber ξ with respect to the negative digit binary representation, then we know for c = i=0 ai 2i that ξ ∈ [c − 1, c + 1]. The idea is now to shift the number ξ c times by 1 or -1 so that at the end it is in [-1,1]. Every number in this interval can be represented by an infinite word starting with either 0.1 or 0.-1 and we can proceed in a similar way as above. We code a prefix am . . . a0 .a−1 . . . a−k of an infinite word representing a real by hsg(c), |c|, p.a−1 . . . a−k qi, where sg(c) = 0, if c ≥ 0, and sg(c) = 1, otherwise. Lemma 5.6 Every (κ, κ)-computable function F : R ⇀ R has a Real PCF definable extension Fˆ to the interval domain. Proof: Let F : R ⇀ R be (κ, κ)-computable and let this be witnessed by the normal type two machine M . We assume that M has been modified in such a way that it first reads the input till the dot and also outputs all digits till the dot in one step. Afterwards it proceeds according to normality. Then there is a function fM ∈ R(1) such that for a prefix Pm am . . . a0 .a−1 . . . a−k of the input ξ ∈ R with c = i=o ai 2i , fM (hsg(c), |c|, p.a−1 . . . a−k qi) = hsg(F (ξ)), ||F (ξ)||, pwqi, where w is the suffix starting with dot of the longest prefix of the output generated by M while reading am . . . a0 .a−1 . . . a−k and ||F (ξ)|| is the absolute value of the integer corresponding to the subword before the dot. Furthermore, there is a func(3) (3) tion suf ∈ R(1) with π3 (fM (hn, m, p.a−1 . . . a−k qi)) = π3 (fM (hn, m, p.a−1 . . . a−(k−1) qi)) ∗ suf(hn, m, p.a−1 . . . a−k qi). Let con : I × ω⊥ → I be defined as in the preceding proof by using this function suf. The map con shifts real numbers in [0,1] as determined by M when using only digits following the dot. For the remaining shifts let K : [R × ω⊥ → R] → [R × ω⊥ → R] be defined by (3) (3) (3) (3) ′ if π1 (i) = 0 and π2 (i) > 0, rrcons[1,2] (G (x, h0, π2 (i) − 1, π3 (i)i)) (3) (3) (3) (3) rrcons[−1,0] (G′ (x, h1, π2 (i) − 1, π3 (i)i)) if π1 (i) 6= 0 and π2 (i) > 0, (3) K(G′ )(x, i) = ricons[−1,0] (x) if π2 (i) = 0 and suf(i) = p−1q, (3) if π2 (i) = 0 and suf(i) = p0q, ricons[− 1 , 1 ] (x) 2 2 ricons[0,1] (x) otherwise, ′
for G′ ∈ [R × ω⊥ → R], x ∈ R and i ∈ ω⊥ . Denote the least fixed point of K by con . Moreover, let H : [ω⊥ × I → I] → [ω⊥ × I → I] be given by H(G)(i, z)
1 1 = pif I (z