<<

4. on the Real

Real numbers are the basic objects in analysis. For most non-mathematicians a real is an infinite , for example π = 3•14159 ... . Mathematicians prefer to define the real numbers axiomatically as follows: · (R, +, , 0, 1,<) is, up to isomorphism, the only Archimedean ordered field satisfying the of continuity [Die60]. The of real numbers can also be constructed in various ways, for example by means of Dedekind cuts or by completion of the ( of) rational numbers. We will neglect all foundational problems and assume that the real numbers form a well-defined

set R with all the properties which are proved in analysis. We will denote the R

real , that is, the set of all open of ,byτR. In Sect. 4.1 we introduce several representations of the real numbers, three of which (and the equivalent ones) will survive as useful. We introduce a rep- n n resentation ρ of R by generalizing the definition of the main representation

ρ of the set R of real numbers. In Sect. 4.2 we discuss the computable real numbers. Sect. 4.3 is devoted to computable real functions. We show that many well known functions are computable, and we show that partial sum- mation of is computable and that operator on sequences of real numbers is computable, if a modulus of convergence is given. We also prove a computability theorem for power . Convention 4.0.1. We still assume that Σ is a fixed finite alphabet con- taining all the symbols we will need.

4.1 Various Representations of the Real Numbers

According to the principles of TTE we introduce computability on R by nam-

∗ ⊆ → R ing systems. Since the set R is not countable, it has no notation ν : Σ (onto) but only representations. Most of its numerous representations have no applications. In this section we introduce three representations ρ, ρ< and ρ> of the set of real numbers (and some equivalent ones) which induce the most important computability concepts. We will also discuss some other represen- tations which, for various reasons, are only of little interest in .

86 4. Computability on the Real Numbers R Since the set Q of rational numbers is dense in , every has arbitrarily tight lower and arbitrarily tight upper rational bounds. Every real number x can be identified by the set { | ∈ } (a; b) a, b Q, ax of all rational numbers greater than x. According to the concept of standard admissible representations (Definitions 3.2.1, 3.2.2) a name of x will be a list of all open intervals with rational endpoints containing x, a list of all rational lower bounds of x or a list of all rational upper bounds of x, respectively.

Convention 4.1.1. In the following we will abbreviate νQ(w)bywwhere

ν Qis our standard notation of the rational numbers (Definition 3.1.2). First, we introduce a standard notation In of all rational n-dimensional cubes with edges parallel to the coordinate axes and rational vertices. Definition 4.1.2 (notation of rational cubes). Assume n ≥ 1. n 1. For (a1,...,an)∈ R define the (maximum)

||(a1,...,an)|| := max |a1|,...,|an| n

and for x, y ∈ R define the (maximum) by d(x, y):=||x − y|| .

(n) n

∈ Q } 2. Let Cb := {B(a, r) | a ∈ Q ,r ,r>0 be the set of open rational n| } balls (or cubes), where B(a, r):={x∈ R d(x, a)

n 4. By I (w) we denote the of the In(w) . In particular, Cb(1) is the set of all open intervals with rational endpoints and I1(ι(v)ι(w)) is the open (v − w; v + w), Cb(2) is the set of all open squares with rational vertices (edges parallel to the coordinate axes) 2 and I (ι(v1)ι(v2)ι(w)) is the open (v1 − w; v1 + w) × (v2 − w; v2 + w), Cb(3) is the set of all open cubes with rational vertices (edges parallel to the coordinate axes), etc. . We introduce representations ρ, ρ< and ρ> as our standard representa- tions of computable topological spaces as follows. 4.1 Various Representations of the Real Numbers 87

Definition 4.1.3 (the representations ρ, ρ< and ρ>). Define computa- ble topological spaces (1) 1 • S= := (R, Cb , I ) , • ∞ S< := (R,σ<,ν<),ν<(w):=(w; ), • −∞ S> := (R,σ>,ν>),ν>(w):=( ; w) , and let ρ := δS= , ρ< := δS< and ρ> := δS> .

(The sets σ< and σ> are defined implicitly.) Notice that S=, S< and S> are

computable topological spaces (Definition 3.2.1), since the properties νQ(u)= 1 1

νQ(v)andI(u)=I (v) are decidable in (u, v). By Definition 3.2.2,

⇐⇒ { ∈ (1) 1 } ρ(p)=x J Cb | x ∈ J} = {I (w) | ι(w)  p , or roughly speaking, iff p is a list of all J ∈ Cb(1) such that x ∈ J. Similarly, ρ<(p)=x,iffpis a list of all rational numbers a such that a(p)=x,iffpis a list of all rational numbers a such that a>x. Fig. 4.1 shows some open intervals J ∈ Cb(1) with x ∈ J and some rational

numbers a with a

The final of the above representations can be characterized easily (Definition 3.1.3.2, Lemma 3.2.5.3):

Lemma 4.1.4 (final topologies of ρ, ρ< and ρ>).

1. The final topology of ρ is the topology τR.

{ ∞ | ∈ R}

2. The final topology of ρ< is τρ< := (x; ) x .

{ −∞ | ∈ R} 3. The final topology of ρ> is τρ> := ( ; x) x .

(1) 

Proof: Cb generates τR, σ< generates τρ< and σ> generates τρ> .

Another important representation of the real numbers is the Cauchy rep- resentation. Since every real number is the limit of a Cauchy of rational numbers, such sequences can be used as names of real numbers. However, the “naive Cauchy representation” which considers all converging sequences of rational numbers as names is not very useful (Example 4.1.14.1). 88 4. Computability on the Real Numbers

For the Cauchy representation we consider merely the “rapidly converging” sequences of rational numbers. Definition 4.1.5 (Cauchy representation). Define the Cauchy repre- ω sentation ρC :⊆ Σ → R by   ∈

there are words w0,w1... dom(ν Q) ρC(p)=x:⇐⇒ such that p = ι(w0)ι(w1)ι(w2) ...,  −i |wi −wk|≤2 for i

The representation ρ, the Cauchy representation ρC and many variants of them are equivalent:

Lemma 4.1.6 (representations equivalent to ρ). The following repre- sentations of the real numbers are equivalent to the standard representation ω

ρ :⊆ Σ → R: 1. the Cauchy representation ρC, 0 00 000 2. the representations ρC, ρC and ρC obtained by substituting

−i −i −i |wi − wk| < 2 , |wi − x| < 2 or |wi − x|≤2 ,

−i respectively, for |wi − wk|≤2 in the definition of ρC, 3.  1  there are words u0,u1...∈dom(I )  such that p = ι(u0)ι(u1) ...,  a ⇐⇒ ρ (p)=x:  ∀ 1 ⊆ 1 1 −k  ( k) I (uk+1) I (uk) and length(I (uk)) < 2  1 1 and {x} =I (u0)∩I (u1)∩... , 4. \ n o b 1

ρ (p)=x :⇐⇒ { x } = I ( v ) | ι ( v )  p .

0 00 000 The representations ρC, ρC and ρC are inessential modifications of the Cauchy representation, and ρa is a representation by strongly nested, rapidly converging sequences of open intervals. A ρb-name of x is a list of closed rational intervals for which x is the only common . While a ρ-name of x is a list of all open rational intervals containing x, these characterizations show that it suffices to list merely “sufficiently many” of them. Proof: b a ρ ≤ ρ : Define representations δ1 and δ2 of R by δ1(p)=x,iff

1 1 1 1 p=ι(u0)ι(u1)..., I (uk+1) ⊆ I (uk )and{x}=I(u0)∩I(u1)∩... , and δ2(p)=x,iff 4.1 Various Representations of the Real Numbers 89

1 1 1 1 p = ι(u0)ι(u1) ..., I (uk+1) ⊆ I (uk )and{x}=I (u0)∩I (u1)∩... . There is a computable h :⊆ Σω → Σω such that \n o

1 1 |  h(p)=ι(v0)ι(v1)... where I (vi)= I (v) ι(v) p

∈ 1 where ip is the smallest number k such that ι(v)  p

I1(w)=B(a, r)=⇒I1◦g(i, w)=B(a, (1 + 2−i) · r) .

There is a computable function f :⊆ Σω → Σω such that

f(ι(w0)ι(w1)ι(w2) ...)=ι◦g(0,w0)ι◦g(1,w1)ι◦g(2,w2)... .

Then f translates δ1 to δ2. It remains to select from any δ2-name a rapidly converging subsequence of intervals. There is a Type-2 machine M which on ∈ input p = ι(u0)ι(u1) ... dom(δ2) computes a sequence q = ι(um0 )ι(um1 ) ... 1 −k where mk is the smallest number i>mk−1 such that length(I (ui)) < 2 . a Then fM , the function computed by the machine M,translatesδ2 to ρ . Therefore, ρb ≤ ρa. a ≤ 0 a ≤ 00 ⊆ ω → ω ρ ρC and ρ ρC: There is a computable function f : Σ Σ a mapping any p = ι(u0)ι(u1)ι(u1) ...∈dom(ρ )toq=ι(v0)ι(v1)ι(v1)...such 1 a

that ν Q(vi)=inf(I (ui)) for all i.Ifρ(p)=x,thenv0

1 − 000 where u is a word with I (u)=(w0 2; w0 +2).IfρC (p)=x,thenqis a list ∈ 1 000 of all words v such that x I (v). Therefore, the function fM translates ρC to ρ. 90 4. Computability on the Real Numbers

ρ ≤ ρb:TheidentityonΣω translates ρ to ρb.

Therefore, the given representations are equivalent. 

The representation δ informally introduced in Sect. 1.3.2 has the property ρa ≤ δ ≤ ρb (Lemma 4.1.6) and so is equivalent to ρ. By definition, a ρ-name of x is a list of all intervals (a; b) with rational endpoints such that x ∈ (a; b). Every arbitrarily tight lower and every arbi- trarily tight upper rational bound of x can be obtained from a finite prefix of p. This is the common property of all representations equiv- alent to ρ:

Lemma 4.1.7 (characterization of ρ). For every representation ω

δ :⊆ Σ → R,



× Q | } { ∈ R ≤ ⇐⇒ ( x, a) a

δ ρ { ∈ R × Q | }

(x, a) x

This is essentially a special case of Theorem 3.2.10. For a proof see Exer- cise 4.1.3. Therefore, ρ is up to equivalence the “poorest” representation δ of the real numbers such that the properties “a can be simplified.

Lemma 4.1.8 (representations equivalent to ρ<). The following rep- resentations of the real numbers are equivalent to the representation ω ρ< :⊆ Σ → R:   ∈

there are u0,u1... dom(ν Q) a ⇐⇒ 1. ρ<(p)=x:  such that p = ι(u0)ι(u1) ..., u0

b } ⇐⇒ { |  2. ρ<(p)=x : x =sup v ι(v) p .

The proof is left as Exercise 4.1.5. However, if we force rapid conver- gence, we obtain a representation equivalent to ρ (Exercise 4.1.6). Lemma 4.1.7 holds correspondingly for ρ< replacing ρ. Therefore, ρ< is the “poor- est” representation δ of the real numbers such that the property “a replacing ρ<. The following lemma is obvious already from our informal characteriza- tions of ρ, ρ< and ρ>.

Lemma 4.1.9. 1. ρ ≡ ρ< ∧ ρ> (that is, ρ is the greatest lower bound of ρ< and ρ>), in particular, ρ ≤ ρ< and ρ ≤ ρ> . 2. ρ< 6≤t ρ , ρ> 6≤t ρ , ρ< 6≤t ρ> and ρ> 6≤t ρ< . 4.1 Various Representations of the Real Numbers 91

Proof: 1. By Definition 3.3.7, (ρ< ∧ ρ>)hp, qi = x ⇐⇒ ρ < ( p )=ρ>(q)=x. There is a Type-2 machine M which on input p ∈ dom(ρ) produces a list of

all ι(w) for which there is some word v such that ι(v)  p and w is the left 1 endpoint of the interval I (v). Then the function fM translates ρ to ρ< .For a similar reason, ρ ≤ ρ>. By Lemma 3.3.8, ρ ≤ ρ< ∧ ρ>. a ∧ a ≤ b For the other direction it suffices to prove ρ< ρ> ρ .ThereisaType-2 h i∈ a ∧ a machine M which on input p, q dom(ρ< ρ>), where p = ι(u0)ι(u1) ... and q = ι(v0)ι(v1) ... , produces a sequence ι(w0)ι(w1) ... , such that 1 a ∧ a b I (wi)=(ui;vi). The function fM translates ρ< ρ> to ρ . 2. This follows from the simple observation that a lower bound cannot be obtained from a finite set of upper bounds and vice versa. More formally we 0

can use the fact γ ≤t γ =⇒ τγ ⊆ τγ0 from Theorem 3.1.8: ρ< 6≤t ρ since 6⊆  τρ τρ< etc. .

To sum up, one can roughly say that for a real number x,aρ<-name consists of all rational lower bounds of x,aρ>-name consists of all rational upper bounds of x,andaρ-name consists of all rational lower bounds and all rational upper bounds of x. Since by Corollary 3.2.12 for admissible representations only continuous functions can be computable, Lemma 4.1.4 tells us which of the three computability concepts is adequate in a given topological setting. Computability of elements and functions induced by the representations ρ, ρ< and ρ> will be discussed in the following sections. As an instructive example we discuss the problem of finding a rational upper bound for a real number.

Example 4.1.10. Consider the multi-valued function

Q { ∈ R × Q | } F : R , RF := (x, a) x

1. F is not (ρ<,νQ)-continuous. Q

2. F is (ρ>,νQ)-computable (and therefore, (ρ, ν )-computable). Q 3. F has no (ρ, ν Q)-continuous choice function (and therefore, no (ρ>,ν )- continuous choice function).

Remember, that νQis admissible with discrete final topology τ (Example

νQ 3.2.4.1) .

b Q 1. Suppose F is (ρ<,νQ)-continuous. Then F has a continuous (ρ<,ν )- ⊆ ω → ∗ b realization g : Σ Σ (Lemma 4.1.8). Consider ρ<(p)=x. By assump- ∈ ∗

tion, g(p)=wwith x<νQ(w)=wfor some w Σ .Sincegis continuous, ω there is some number n with g[p

fix of p(p) < w0 = ν Q fM (p) for all 92 4. Computability on the Real Numbers

∈ p = ι(w0)ι(w1) ... dom(ρ>). Therefore, fM is a (ρ>,νQ)-realization of the R.

3. Since the final topology τRof the admissible representation ρ is con-

nected, every (ρ, ν Q)- is constant by Corollary 3.2.13. But

a choice function of F cannot be constant. 

The definitions of ρ, ρC, ρ< and ρ> (and their variants) can be modified in various other ways without affecting the induced continuity or computabil-

ity, respectively. So far we have used the set Q of the rational numbers as a

“standard” dense countable of the real numbers and ν Qas its standard

notation. Can we replace ν Qby some other notation νQ of a dense subset Q

of R such that the resulting representations induce the same continuity or

computability concepts on R? The following “robustness” theorem gives an answer.

Theorem 4.1.11 (robustness). For any representation δ of the real num-

bers introduced in Definitions 4.1.3, 4.1.5, 4.1.6 and 4.1.8 consider δ as a Q function of ν Q,thatis,δ=D(ν ). Then for every notation νQ of a dense

subset Q ⊆ R, 1. δ ≡t D(νQ), ≡

2. δ D(νQ), ifνQand νQ are r.e.-related { || − | −i}

(that is, if (v, w, i) νQ(v) νQ(w) <2 is r.e.).

The proof is left as Exercise 4.1.8. Examples for notations r.e.-related to

Q Q ν Qare any notation of equivalent to ν and any standard notation of the

n

{ | ∈ Z ∈ N} binary rational numbers Q2 := z/2 z ,n . Computability concepts introduced via robust definitions are not sensitive to “inessential” modifications. It can be expected that they occur in many applications. On the other hand, computability concepts introduced via non- robust definitions are not very relevant. The is another famous example of a robust definition. Numerous variants of the original definition are used in the literature, all of which define the same notion of computable functions. Usually the repre- sentation by infinite decimal is considered to be the most natural representation of the real numbers. Definition 4.1.12 (finite and infinite -n fractions). For n ≥ 2 define the notation νb,n of the finite base-n fractions and the representation ω ρb,n :⊆ Σ → R of the real numbers by infinite -n fractions as follows: ∗ ∗ ∗ dom(νb,n):={λ, -}(Γ \ 0Γ )•Γ , ∗ ∗ ω dom(ρ ):={λ, -}(Γ \ 0Γ )•Γ , b,n X i νb,n(sak ...a0•a−1a−2 ...a−m):=s· ai · n , ≥≥− kXi m i ρb,n(sak ...a0•a−1a−2...):=s· ai·n, i≤k 4.1 Various Representations of the Real Numbers 93

where ai ∈ Γn := {0, 1,...,n−1} for all i ≤ k, s := 1,ifs=λ,ands:= −1, if s = -. (We assume tacitly Γn ⊆ Σ.) (Remember that λ is the empty word.) The following theorem summarizes some interesting properties of the representations by infinite base-n fractions.

Theorem 4.1.13 (infinite base-n fractions). For any m, n ≥ 2 (assum- ing Γm,Γn ⊆Σ)

Ir Ir \ Q 1. ρb,n| ≡ ρ| (where Ir := R is the set of irrational real numbers), 2. x is ρb,n-computable, iff x is ρ-computable. 3. ρb,n ≤ ρ and ρ 6≤t ρb,n, 4. ρb,m ≤ ρb,n,ifpd(n)⊆pd(m), ρb,m 6≤t ρb,n otherwise (where pd(n) denotes the set of prime divisors of n),

5. ρb,n has the final topology τR.

6. ρb,n is not admissible, → R 7. f :⊆ R is (ρb,n,ρ)-computable (-continuous), iff it is (ρ, ρ)-computable (-continuous).

Proof: 1. and 2. See Exercise 4.1.10 3. There is a Type-2 machine M which maps any sequence p = sak ...a0•a−1a−2 ...∈dom(ρb,n) to a sequence ι(u0)ι(u1) ...with uj = νb,n(sak ...a0•a−1a−2 ...a−j). Then M translates ρb,n to ρC.

The relation ρ 6≤t ρb,n will be concluded from Property 4. ∈ N 4. Suppose, pd(n) ⊆ pd(m). Then for each k ∈ N numbers lk ,bk can lk k be determined such that m = bk · n . For computing a ρb,n-name of x = k ρb,m(p), it suffices to compute c0,c1,...such that ck ≤ n ·x ≤ ck +1 for all k. There is a Type-2 machine M, which on input (p, u)(x:= ρb,m(p),

lk k

∈ N · k := νN(u)) determines (names of) numbers lk,bk such that m = bk n and then (a name of) a number ck such that

lk ck · bk ≤ m · x ≤ (ck +1)·bk .

(For this purpose, M must read only the first lk digits of p after the dot.) lk k k Since m = bk · n , we obtain immediately ck ≤ n · x ≤ ck + 1, as required. Therefore, ρb,m can be translated to ρb,n by a Type-2 machine. ∈ Now consider that the r N divides n but not m.There ≤ · is some c ∈ N,1 c

3. (continued) Suppose ρ ≤t ρb,n. Choose some prime number m which does not divide n.Thenρb,m ≤t ρ ≤t ρb,n by Property 1, but ρb,m 6≤t ρb,n as proved above (contradiction). This shows ρ 6≤t ρb,n. ⊆ ≤ 5. If X R is open, then it is ρ-open by Lemma 4.1.4. Since ρb,n ρ by

Property 3, X is ρb,n-open by Theorem 3.1.8. Let X ⊆ R be ρb,n-open. Then −1 ω ∩ ⊆ ∗ ∈ ρb,n[X]=AΣ dom(ρb,n)forsomeA Σ .Considerx X,x>0. Case 1: x = a/nj for some a and some j. Then x has two ρb,n-names p := “ak ...a0•a−1 ...”andq:= “bk ...b0•b−1...”, such that there is some some m ≤ k with am > 0, ai =0forimsuch that ρb,n[“ak ...a0•a−1...a−l”Σ ] ⊆ X ω −l and ρb,n[“bk ...b0•b−1...b−l”Σ ] ⊆ X.Weobtain[x;x+n )⊆Xand (x − n−l; x] ⊆ X, i,e, x has the open neighborhood (x − n−l; x + n−l) ⊆ X. Case 2: Not Case 1. Then x has a ρb,n-name p := “ak ...a0•a−1...” which has neither the period 0 − −1 nor the period (n 1). Since ρb,n[X]isopenindom(ρb,n), there is a number ω l such that ρb,n[“ak ...a0•a−1 ...a−l”Σ ]⊆X.Thenx∈(y;z)⊆X,where y:= ρb,n(“ak ...a0•a−1...a−l00 ...”) and z := ρb,n(“ak ...a0•a−1 ...a−l(n−1)(n−1) ...”), hence x hasanopenneigh- borhood in X. For the case x<0 the proof is similar. If x = 0 consider the two names “•00 ...”and“-•00 ...”. 6. By Lemma 4.1.4, the representation ρ is admissible with final topology

τR. By Theorem 3.2.8.1 any two admissible representations with final topology

τRare continuously equivalent. Since the representation ρb,n has the final

topology τRbut is not continuously equivalent to ρ, it cannot be admissible.

7. See Exercise 4.1.12. 

Restricted to the irrational numbers, ρb,n and ρ are equivalent. Therefore, arealnumberxis ρb,n-computable, iff it is ρ-computable (notice that the rational numbers are ρb,n-computable and ρ-computable). Since ρb,n is not admissible, a ρb,n-name cannot be interpreted as a (suf- ficiently rich) list of atomic properties from a of its final topology

τR. Although ρb,n-names are richer than ρ-names by Property 3, this ad- ditional information is useless for computing real functions by Property 7. From Property 7 we conclude also that every (ρb,n,ρb,m)-computable func- tion is (ρ, ρ)-computable. However, already the simple (ρ, ρ)-computable real function x 7→ 3 · x is not (ρb,10,ρb,10)-continuous (Example 2.1.4.7). We discuss some further representations of the real numbers which, how- ever, have only very few applications.

Example 4.1.14 (further representations of R). 1. Naive Cauchy representation: Define the naive Cauchy representation ρCn of the real numbers by

ρCn(p)=x:⇐⇒ p = ι ( w 0 ) ι ( w 1 ) ... and lim wi = x. i→∞ 4.1 Various Representations of the Real Numbers 95

Since ρC, ρ< and ρ> are restrictions of ρCn,wehaveρC,ρ<,ρ> ≤ ρCn. } ρCn has the final topology {∅, R (no property of x = ρCn(p)canbe concluded from a finite prefix w of p). From this fact and Theorem 3.1.8 we conclude ρCn 6≤t ρC, ρCn 6≤t ρ< and ρCn 6≤t ρ>. 2. Cut representations: Define computable topological spaces

• R ∞

S≤ =( ,σ≤,ν≤)byν≤(w):=[νQ(w); )and

• R −∞

S≥ =( ,σ≥,ν≥)byν≥(w):=( ; ν Q(w)] (cf. Definition 4.1.3). Define the left cut representation and the right cut

representation by ρ≤ := δS≤ and ρ≥ := δS≥ , respectively. ≤ ≥ If ρ≤(p)=x(ρ≥(p)=x), then p is a list of all a ∈ Q with a x (a x). ∪ The final topology of ρ≤ is τρ< σ≤, that is, also intervals (“atomic ≤ properties”) [a; ∞)witha∈ Q are called “open”. We have ρ≤ ρ<, but neither ρ<, ρ>, ρC nor ρ≥ are t-reducible to ρ≤. ≤ ⊆ As an example assume ρC t ρ≤.Thenτρ≤ τρ by Theorem 3.1.8. But ∞ ∈ \ [0; ) τρ≤ τρ. Restricted to the irrational numbers ρ< and ρ≤ are Ir Ir equivalent: ρ<| ≡ ρ≤| . (The properties hold accordingly for ρ≥.) The definitions of ρ≤ and ρ≥ are not topologically robust, that is, replacement

of Q in the definitions by another dense subset Q yields representations which are not continuously equivalent to ρ≤ and ρ≥, respectively. 3. representation: For any real number x ≥ 0 define its

continued fraction fr(x):=[a0,a1,...](ai ∈N) inductively by:

x0 := x,  1 if a =6 x a := bx c ,x := xn−an n n n n n+1 0otherwise. Then, informally 1 x = a + , 0 a + 1 1 a2+...

where the fraction is finite (an =0foralln≥n0), iff the number x is rational. Define the continued fraction representation ρcf of the real a0 a1 numbers by ρcf (p)=x,iff(x≥0andp=1 01 0 ... where fr(x):= a0 a1 [a0,a1,...]) or (x<0andp=-1 01 0 ...where fr(−x):=[a0,a1,...]). One can show ρcf ≡ ρ≤ ∧ ρ≥ ,

in particular, ρcf ≤ ρ≤ and ρcf ≤ ρ≥.Furthermore,ρcf ≤ ρb,n for all n ≥ 2. Neither ρ≤, ρ≥ nor ρb,n for n ≥ 2 are t-reducible to ρcf . Restricted Ir Ir to the irrational numbers, ρ and ρcf are equivalent: ρ| ≡ ρcf | . 

The definitions of the cut representations ρ≤ and ρ≥ are not even topolog- ically robust. Neither the representations by infinite base-n fractions and the naive Cauchy representation nor the cut representations ρ≤ and ρ≥ and their greatest lower bound ρcf are of much interest in computable analysis. Fig. 4.2 shows the reducibility order of the representations of the real numbers we 96 4. Computability on the Real Numbers have introduced so far. Many other representations of the real numbers are introducedandcomparedin[Hau73,Dei84].

ρCn

@

@

@

ρ< ρ>

@

@

@ ρ

 

ρ≤ ρb,n ρ≥

 

@

@

@ ρcf

Fig. 4.2. Reducibility order of some representations of R

ω

Our main representation ρ :⊆ Σ → R of the real numbers is not a total function and it is not injective. The same holds for all representations equivalent to it which we have discussed. It would be convenient to have an injective representation δ of the real numbers which is equivalent to ρ. Unfortunately this is not possible.

Theorem 4.1.15. ω ≡ 1. There is no total representation δ : Σ → R with δ ρ. ω ≡ 2. There is no injective representation δ :⊆ Σ → R with δ ρ. The two statements hold accordingly for ρ< and ρ> instead of ρ.

ω ≡ Proof: 1. Let δ : Σ → R be a total function with δ ρ. δ is continuous, since ρ is continuous. By Lemma 2.2.5 the (Σω ,d)withCantor topology τC is compact. A continuous function maps compact sets to compact ω sets, therefore, range(δ)=δ[Σ ]iscompact.SinceR is not compact (for

{ | ∈ } R 6 example the open cover (z; z +2) z Z has no finite subcover), = range(δ). ω ≡ 2. Let δ :⊆ Σ → R be an with δ ρ. By Lemma −1

3.2.5, τRis the final topology of δ,thatis,Xis open, iff δ [X]isopenin dom(δ). Since δ is injective, there is some w ∈ Σ∗ such that 0 ∈ δ[wΣω] and 1 6∈ δ[wΣω]. Since wΣω and Σω \ wΣω are open, A := δ[wΣω]and 4.1 Various Representations of the Real Numbers 97

ω ω ∈ ∈ ∪ R B := δ[Σ \ wΣ ] are open subsets of R such that 0 A,1 B,A B= and A ∩ B = ∅. This is impossible.

The proofs for ρ< and ρ> are left for Exercise 4.1.17. 

In the “real-RAM” model of computation which is used, for example, in computational geometry [PS85] and studied in detail by Blum et al. [BCSS98] one uses the test x

Theorem 4.1.16 (x ≤ y is absolutely undecidable). For every rep- ⊆ ω ≤ resentation δ : Σ → R the relations “x = y”and“x y”arenot (δ, δ)-open and the relation “x

Proof: Assume that the relation “x = y”is(δ, δ)-open. By Definitions 2.4.1 and 3.1.3.2 there is a continuous function f :⊆ Σω × Σω → Σ∗ such that f(p, q)=0,ifδ(p)=δ(q), and f(p, q)=divotherwiseforallp, q ∈ dom(δ). Consider z and p with δ(p)=z.Weobtainf(p, p) = 0. Since f is continuous, f[wΣω × wΣω]={0}for some prefix w ∈ Σ∗ of p.Weobtainx=yfor any ∈ ω ω x, y δ[wΣ ], hence {z} = δ[wΣ ]. Therefore, for every z ∈ R there is some w ∈ Σ∗ with {z} = δ[wΣω]. But this is impossible, since Σ∗ is countable and ≤ ≥ R is uncountable. If “x y”is(δ, δ)-open, then also “x y”is(δ, δ)-open, hence “x = y”is(δ, δ)-open by Theorem 2.4.5. If “x

then “x ≥ y”is(δ, δ)-open. 

Among the representations of the real numbers discussed in this section, ρ, ρ< and ρ> (and equivalent ones) are the most natural ones. For represen- n ≥ tations of R (n 2) we generalize Definition 4.1.3 straightforwardly.

n n ≥ n Definition 4.1.17 (standard representation ρ of R ). For n 1 let ρ n be the standard representation of R derived from the computable topological n n (n) n space S := (R , Cb , I ) (Definition 4.1.2).

ω n n

A sequence p ∈ Σ is a ρ -name of x ∈ R , iff it is a list of all n- dimensional open rational cubes J ∈ Cb(n) such that x ∈ J. Fig. 4.3 shows ∈ (2) 2 ∈ some rational squares J Cb and a point x ∈ R such that x J. The definitions of the other representations equivalent to ρ given above can be generalized straightforwardly to n by substituting the n- dimensional norm || . || for the | . | and the notation In for I1.

Lemma 4.1.18 (representations equivalent to ρn). For n ≥ 2 gener- 0 00 000 a b alize the definitions of ρ, ρC,ρC,ρC,ρC ,ρ and ρ from Definitions 4.1.3,

n R 4.1.5 and Lemma 4.1.6, respectively, from R to by substituting the B- dimensional norm || . || for the absolute value | . | and the notation In for I1. Then all the resulting representations are equivalent to ρn. 98 4. Computability on the Real Numbers

x r

Fig. 4.3. Some open rational squares J ∈ Cb(2) such that x ∈ J

Proof: The proof of Lemma 4.1.6 can be generalized straightforwardly. 

Instead of maximum norm, distance and balls, sometimes we will use Euclidean norm (absolute value), distance and balls: p •| | 2 2 (a1,...,an) = a1p+...+an, e 2 2 • d (x, y):=|x−y|= (x1 −y1) +...+(xn −yn) , • e n|| − | } B (a, r):={x∈ R x a

n and generate the same topology on the set R . If we replace the maximum metric by the Euclidean metric in the above n n definitions, we obtain representations of R which are equivalent to ρ .We leave the proofs to the reader. According to Definition 3.3.3, the [ρ]n =[ρ,...,ρ] is defined by

n [ρ] hp1,...,pni=(ρ(p1),...,ρ(pn)) .

The following lemma summarizes some useful properties.

Lemma 4.1.19. n ≡ n n n

1. [ρ] ρ , ρ is admissible with final topology τR. n 2. A (x1,...,xn)is(ρ,...,ρ)-computable, iff it is ρ -computable. n

3. A set X ⊆ R is (ρ,...,ρ)-decidable (-r.e. , -clopen, -open), iff it is ρn-decidable (-r.e. , -clopen, -open).

n

4. A function or multi-valued function f :⊆ R M is (ρ,...,ρ,δ)- computable (-continuous), iff it is (ρn,δ)-computable (-continuous).

k k ◦ ⊆ → R 5. A function f : M is (δ, ρ )-computable (-continuous), iff pri f is (δ, ρ)-computable (-continuous) for i =1,...,k. 4.1 Various Representations of the Real Numbers 99

n Proof: 1. Every ρ -name of (x1,...,xn) essentially consists of arbitrarily tight upper and arbitrarily tight lower bounds for every component xi.Thesame n n n is true for every [ρ] -name of (x1,...,xn). Translations from ρ to [ρ] and from [ρ]n to ρn can be constructed straightforwardly.

2.-5. These properties follow from Property 1 and Lemma 3.3.6.  Convention 4.1.20. From now on we will consider as standard the nota-

ZQ tions ν N,ν , ν and idΣ of the natural numbers, the integers, rational num- ∗ ω ω bers and the set Σ , respectively, and the representations idΣω : Σ → Σ ,

n ω n R ρ and ρ of Σ , R and , respectively. Occasionally, we will omit prefixes

∗ ω n

Z Q ν N-, ν -, ν -, idΣ -, idΣ - ρ-andρ -andsaycomputable instead of ρ-compu-

table, recursively enumerable (r.e.) instead of (νN,ρ)-r.e. , computable instead

of (ρ, ν Q,ρ)-computable etc. . Often we will use representations which we have proved to be equivalent to ρ or ρn.

The representations ρ, ρ< and ρ> can be extended to representations of R R, the closure of under supremum and infimum. We now modify Definition

4.1.3.

R R ∪{−∞ ∞} Definition 4.1.21 (representations of R). For := , define computable topological spaces • ∞ S< := (R,σ<,ν<),ν<(w):=(w; ], −∞ • S> := (R,σ>,ν>),ν>(w):=[ ; w) , ∧ and let ρ< := δS< , ρ> := δS> and ρ := ρ< ρ> .

Exercises 4.1.

 1. Show that the set of real numbers is not countable.

Z Q

| N≡ | ≡ ≤ | 6≤

ZQ Q 2. Show ρ ν N, ρ ν , ν ρ and ρ t ν (Sect. 1.4). 3. Prove Lemma 4.1.7. 4. Show that a representation δ of the real numbers is reducible to ρ<,iff

{ ∈ R × Q | }

the set (x, a) a

8. Prove that the definitions of ρ, ρ< and ρ> are topologically and compu- tationally robust (Theorem 4.1.11). 100 4. Computability on the Real Numbers

9. a) Show that by 3 is not continuous with respect to ρb,2.

 b) Show that neither nor multiplication are continuous with respect to ρb,n for n ≥ 2. 10. Prove Theorem 4.1.13.1 and 4.1.13.2.

 11. The representations by infinite base-n fractions can be studied as mem-

bers of a larger class of representations [Wei92a]: → ⊆ R Let ν : N Q be a numbering of a dense subset Q . Define a representation ϑν of the real numbers by  ν ( i ) x =⇒ p(i)=1.

Show: a) If µ is a standard numbering of the finite base-n fractions, for example k

µhi, j, ki := (i − j)/n ,thenρb,n ≡ ϑµ.

→ N → b) For any two numberings µ : N P and ν : Q of dense subsets

of R we have: • ϑν ≤t ρ , ρ 6≤t ϑν , • ≤

ϑν ρ ,ifνand ν Qare r.e.-related, • Q ⊆ P ⇐⇒ ϑ µ ≤ t ϑ ν ,

• ν ≤ µ =⇒ ϑ µ ≤ ϑ ν .

→ Q h i − ≡ c) Define ν0 : N by ν0 i, j, k := (i j)/(1 + k). Then ϑν0 ∧ ∧ ρb,2 ρb,3 ... ,thatis,ϑν0 is the greatest lower bound of all ρb,n

(Definition 3.3.7).

⊆ R → R

d) Let ν and ν Qbe r.e.-related. Then f : is (ϑν,ρ)-computable, iff it is (ρ, ρ)-computable.

⊆ → R e) f : R is (ρb,n,ρ)-computable, iff it is (ρ, ρ)-computable.

 12. Prove Theorem 4.1.13.7 without using Exercise 4.1.11 [Her99b]. 13. Let ρCn be the naive Cauchy representation. Prove: a) ρCn 6≤t ρ< , } b) ρCn has the final topology {∅, R , c) there is a (ρCn,ρCn)-computable function, which is not (ρ, ρ)-compu- table (hint: consider a constant function with value xA (Example 1.3.2) where A is an r.e. non-recursive set),

 d) A real function is continuous, iff it is (ρCn,ρCn)-continuous [BH00]. 14. Prove the properties of the cut representations ρ≤ and ρ≥ stated in Ex- ample 4.1.14.2. ∗

15. For an arbitrary notation µ :⊆ Σ → Q of a dense subset Q ⊆ R define ∞ the effective Sµ =(R,σµ,νµ)byνµ(w):=[µ(w); ) ⊆ ∗ → and δµ := δSµ (cf. Example 4.1.14.2). For notations µ : Σ Q and 0 ∗ 0 0 µ :⊆ Σ → Q show: δµ ≤t δµ0 ,iffQ ⊆Q. 16. Prove the properties of the continued fraction representation stated in Example 4.1.14.3. 17. Show that there is neither a total nor an injective representation of the real numbers which is equivalent to ρ<. 4.2 Computable Real Numbers 101

18. Complete the proof of Lemma 4.1.18. 0

 19. Let δ and δ be representations of an M. Show that the set {(x, y) | x, y ∈ M, x = y} is not (δ, δ0)-open.

20. Show that the definition of ρn is computationally robust, that is, replace- R

ment of νQin Definition 4.1.17 by a notation νQ of a dense subset of which is r.e.-related to it (Theorem 4.1.11) yields an equivalent represen- tation.

 21. Show that ρ< and ρ> are the restrictions of ρ< and ρ>, respectively, to R R and that ρ is equivalent to the restriction of ρ to . (See Definition 4.1.21.)

2

R → R  22. Show that the function f : , f(x):=1/x ,is(ρ, ρ<)-computable.

4.2 Computable Real Numbers

We will denote the set of computable (that is, ρ-computable) real numbers

by Rc. Informally, a real number x is computable, iff arbitrarily tight lower and arbitrarily tight upper rational bounds of x can be computed. This is formalized by each of the following characterizations.

Lemma 4.2.1. For any x ∈ R the following properties are equivalent: 1. x is ρ-computable. 2. [Tur36] x is ρb,n-computable, that is, the number x has a computable ∈ ≥ infinite base-n fraction (n N,n 2). → ∗ 3. There is a computable function g : N Σ such that

| − −n |≤ ∈ N

x ν Qg(n) 2 for all n . → N 4. [Grz55] There is a computable function f : N such that

| |− f(n) 1 ∈ x < for all n N .

n+1 n+1 → N 5. [PER89] There are computable functions s, a, b, e : N with

− − s(k) a(k) ≤ −N x ( 1) 2 , if k ≥ e(N), for all k, N ∈ N . b(k)

Proof: 1 ⇐⇒ 2: This follows from Theorem 4.1.13.

1=⇒3: Let ι(u0)ι(u1) ...be a computable ρC-name of x.Then | − |≤ −n

x νQ(un) 2 for all n. Define g(n):=un. 102 4. Computability on the Real Numbers

3=⇒5: There are computable functions s, a, b with − s(k) a(k) ν Qg(k)=( 1) b(k) . Define e(N):=N.

−(N+2) 5=⇒4: From Property 5 we obtain ||x|−aN/bN |≤2

< 1/(2(N + 1)), where aN := a ◦ e(N +2)andbN := b ◦ e(N + 2). There is

→ N | − |≤ a computable function f : N with aN (N +1)/bN f(N) 1/2. We obtain

f(N) aN aN f(N) 1 1 |x|− ≤ |x|− + − <2 ≤ . N+1 bN bN N +1 2(N +1) N +1 ⇒ ≥ → ∗ 4= 1: Assume x 0. There is a computable function g : N Σ such n+1 n+1

that ν Qg(n)=f(2 )/(2 + 1). We obtain

n+1 | − | | |− f(2 ) 1 −n−1

x ν Qg(n) = x < <2 . 2n+1 +1 2n+1 +1 Define p ∈ Σω by p := ι(g(0))ι(g(1)) ....Thenpis computable,

| − |≤| − | | − |≤ −n

Q Q Q ν Qg(n) ν g(m) ν g(n) x + x ν g(m) 2 for m>nand

limn→∞ ν Qg(n)=x, hence ρC(p)=x.Ifx<0, define g such that

n n − 

ν Qg(n)= f(2 )/(2 +1).

Every a is computable (if νQ(u)=a, define g(n√):=u for all n in Lemma 4.2.1.3). In Example 1.3.1 we have shown that 2and log3 5 are computable real numbers. Many other examples will follow from theorems below (Example 4.3.13.8). By Lemma 4.1.19, a vector (x1,...,xn) n

of real numbers is ρ -computable, iff all its components xi are computable. →N Definition 4.2.2 (modulus of convergence). Afunctione:N is | − |≤ −n called a modulus of convergence of a sequence (xi)i∈ N,iff xi xk 2 for i, k ≥ e(n). 0 0 If e is a modulus of convergence then e with e (n):=maxk≤ne(k)is a modulus of convergence, which is computable, if e is computable. There- fore we may assume in most cases that the modulus of convergence is non- −n decreasing. If e is a modulus of convergence then |x − xi|≤2 for i ≥ e(n), 0 −n 0 where x = limi→∞ xi.Ife is a function with |x−xi|≤2 for i ≥ e (n), then e with e(n):=e0(n+ 1) is a modulus of convergence, which is computable, if e0 is computable.

Therefore, it follows from Lemma 4.2.1.5 that the limit of any computa- Q ble (more precisely (ν N,ν )-computable) sequence of rational numbers with computable modulus of convergence is a computable real number. This ob-

servation can be generalized as follows: N

Theorem 4.2.3. Let (xi)i∈N be a (ν ,ρ)-computable sequence of real → N numbers with computable modulus of convergence e : N .Thenits limit x = limi→∞ xi is computable.

4.2 Computable Real Numbers 103 ∈ N

Proof: Since the sequence is (ν N,ρC)-computable, for any i, j ,aworduij can be computed such that xi = ρC(ι(ui0)ι(ui1) ...). Define vi := ue(i+2),i+2 and q := (ι(v0)ι(v1) ...). For all k

|vk − x|≤|ue(k+2),k+2 − xe(k+2)| + |xe(k+2) − x| ≤ 2−k−2 +2−k−2 ≤2−k−1

−k−1 −m−1 −k and |vk − vm|≤|vk−x|+|vm−x|≤2 +2 ≤ 2 . Therefore, ω x = ρC(q)andxis ρC-computable, since q ∈ Σ is computable. 

Example 4.2.4. P i

1. Define xi := k=0 1/k!. Then e = limi→∞ xi. Obviously the sequence

N Q N (xi)i∈Nis (ν ,ν )-computable, hence (ν ,ρ)-computable. Define e(n):= −n n+1. Then |xi−xj|≤2 for i, j ≥ e(n). By Theorem 4.2.3, the number e is computable. − − 2. A famousP result by Leibnitz states π/4=1 1/3+1/5 1/7.... Define i − k xi := k=0( 1) ak where ak =1/(2k + 1). Then the sequence (xi)i∈N is computable. For i ≤ j and even j − i, ≤ − − − 0 (ai aPi+1)+(ai+2 ai+3)+...+(aj−2 aj−1)+aj − i j − k =( 1) k=i( 1) ak = ai − (ai+1 − ai+2) − ...−(aj−1 −aj) ≤ai P − ≤ − i j − k ≤ − ≤ and similarlyP for odd j i,0 ( 1) k=i( 1) ak ai aj ai.Inboth | j − k |≤ n ≤ cases, k=i(P1) ak ai. Define e(n):=2 .Thenfore(n) i

3. By Example 1.3.2 for any set A ⊆ N of numbers, the sum X −i xA := 2 i∈A is a computable real number, iff A is a recursive set.

Let A be recursively enumerable but not recursive. Then there is a com- → N putable injective function f : N with A = range(f). We obtain

X Xn −f(j) −f(j) xA := 2 = lim 2 . n→∞

j∈N j=0 P n −f(j)

Therefore, (an)n∈Nwith an := j=o 2 is a computable increasing sequence of rational numbers. Its limit xA is ρ<-computable. Since xA is 104 4. Computability on the Real Numbers

not computable, by Theorem 4.2.3 the sequence (an)n∈Ncannot have a computable modulus of convergence. Since the set A is not recursive, the enumerating function f cannot have a computable lower bound which is monotone and unbounded. Therefore, unforseeable values f(n) are very −f(n)

small and terms 2 are large. 

The ρ<-computable numbers are also called left-computable or left-r.e. and the ρ>-computable numbers are also called right-computable or right- r.e.. By Specker’s example there is a left-computable real number which is not computable (Examples 1.3.2, 4.2.4.3).

Lemma 4.2.5. Arealnumberx 1. is left-computable, iff −x is right-computable, 2. is computable, iff it is left-computable and right-computable.

Proof: A direct proof is easy. Property 2 follows also from ρ ≡ ρ< ∧ ρ>

(Lemma 4.1.9). 

The computable real numbers are a which, however, cannot be enumerated “effectively”. We prove a “positive” version of this statement by diagonalization.

Theorem 4.2.6. N 1. Let (xi)i∈Nbe a (ν ,ρ)-computable sequence of real numbers. Then

there is a computable real number x such that x =6 xi for all i ∈ N.

2. There is no numbering or notation ν of the set Rc of the computable real numbers with r.e. domain such that ν ≤ ρ.

Proof: 1. We construct x by diagonalization. We may assume that the se- ∈ N quence is (ν N,ρC)-computable. For any i we can determine a sequence qi := ι(ui0)ι(ui1) ...with xi = ρC(qi). Therefore, there is a computable func- ∗ → ∗ i | ◦ i − |≤ −2i−2 tion g : Σ Σ with g(0 )=ui,2i+2.Weobtain νQg(0 ) xi 2 .We − −i compute a nested sequence ([ui; vi])i∈Nof closed intervals with vi ui =3 such that xi 6∈ [ui; vi] as follows: ◦

(u , v ):=(νQ g(λ)+1,u +1) 0 0  0 1 · −i ◦ i+1 ≥ 1 · −i (ui,ui+1 + 3 3 )ifνQ g(0 ) ui + 2 3 (ui+1, vi+1):= 2 · −i (ui + 3 3 , vi)otherwise. ◦ i+1 ≥ 1 · −i ≥ 1 · −i − −2(i+1)−2 If ν Q g(0 ) ui + 2 3 ,thenxi+1 ui + 2 3 2 > 1 · −i ◦ i+1 6≥ 1 · −i 2 · −i ui + 3 3 ,andifνQ g(0 ) ui + 2 3 ,thenxi+1 < ui + 3 3 .We obtain xi+1 6∈ [ui+1; vi+1]. There is a computable sequence i 7→ wi of words 1 such that I (wi)=[ui;vi]. Therefore, q := ι(w0)ι(w1) ... is computable and b b b x := ρ (q)(ρ from Lemma 4.1.6) differs from all numbers xi.Sinceρ ≡ρ, xis computable.

4.2 Computable Real Numbers 105 → R

2. Assume that there is such a numbering ν :⊆ N c.Thereisa → N

computable function f : N with range(f)=dom(ν). Then νf is a

R ≤ ≤ N total numbering of c with νf ν ρ. Therefore, (νf(i))i∈Nis a (ν ,ρ)- computable sequence of all computable real numbers. This is impossible by Property 1. → ∗ If ν is a notation, there is a computable function f : N Σ with

range(f)=dom(ν). Continue as above. 

We derive a notation of the computable real numbers canonically from the representation ρ using the standard notation ξ∗ω of the computable functions f :⊆ Σ∗ → Σω (Definition 2.3.4). ∗

Definition 4.2.7. Define the notation νρ :⊆ Σ → Rc of the computable real numbers by ◦ ∗ω νρ(w):=ρ ξw (λ). ω For w ∈ dom(νρ), νρ(w)=ρ(p)wherep∈Σ is the sequence computed by the Turing machine with code w on input λ. By the utm-theorem for ∗ω ≤ { ∈ ∗ | ∗ω ∈ ξ , νρ ρ. By Theorem 4.2.6 the domain dom(νρ)= w Σ ξw (λ) dom(ρ)} is not r.e.

Every countable subset X ⊆ R can be covered by arbitrarily small open

sets. The (countable) set Rc of computable real numbers can be covered by arbitrarily small “r.e. open” sets [Spe59] (cf. Sect. 5.1).

7→ Theorem 4.2.8. For each N ∈ N there is a computable sequence i wi 1 of words wi ∈ dom(I ), such that [ X ⊆ 1 1 ≤ −N

Rc UN := I (wi)and length(I (wi)) 2 . ∈N i∈N i

Proof: For each i = hk, ti define the word wi as follows: If the Turing machine with code νΣ(k) on input λ in t steps (but not in (t−1) ∗ −j steps) writes an output ι(u0)ι(u1) ...ι(uk+N+4) ∈ Σ with |uj − um|≤2 for 0 ≤ j ≤ m ≤ k + N +4,then   1 −k−N−3 −k−N−3 I (wi)= uk+N+4 − 2 ; uk+N+4 +2 , otherwise   1 −i−N−2 I (wi)= 0; 2 .

ω Suppose x is computable. Then x = ρC(p) for some computable p ∈ Σ . ∗ω Thereissomenumberksuch that ξνΣ (k)(λ)=p. Then there is some t such that the machine with code νΣ(k) on input λ in t steps computes a prefix ∈ ∗ ∈ h i

ι(u0)ι(u1) ...ι(uk+N+4) Σ of p with ui dom(ν Q). For i = k, t we 106 4. Computability on the Real Numbers

S 1 ⊆ 1 obtain x ∈ I (wi). Therefore, Rc I (wi). i∈N For each k thereisatmostonetsuch that the first condition holds, therefore, X  X X 1 −i−N−2 −k−N−2 −N

length I (wi) ≤ 2 + 2 =2 .

∈N ∈N i∈N i k

Since the function (w, t) 7→ v,wherevis the word which the machine with code w on input λ produces in t steps, is computable, the sequence i 7→ wi

is computable (cf. Lemma 2.1.5). 

Exercises 4.2.

 1. Show that a real number x is computable, iff there are computable func-

−n

→ N | − − |≤ tions f, g, h : N with x (f(n) g(n))/(1 + h(n)) 2 for all

n ∈ N. ∈N 2. a) Define a (ν N,ρ<)-computable sequence (xi)i which lists all ρ<- computable real numbers. b) Construct by diagonalization a ρ>-computable real number which is

not ρ<-computable. → R 3. Let a : N be a computable sequence of real numbers with infinite

range. Then there is an injective computable sequence of real numbers → R b : N with range(a)=range(b).

4. Let (ak)k∈Nbe a computable sequence of real numbers converging to 0.

a) Show that the sequence (ak)k∈Nhas a computable modulus of con-

vergence, if ak ≤ ak+1 for all k. → N b) Show that there is an increasing computable function f : N with −n |af(n)|≤2 for all n (hence n 7→ n is a modulus of convergence of the computable subsequence n 7→ af(n)).

c) Show that there is a computable sequence (bk)k∈Nof real numbers converging to 0 which has no computable modulus of convergence. −f(k) (Hint: define bk := 2 where f is an injective of a

non-recursive r.e. set.)

N Q

5. Show that the sequence (an)n∈Nin Example 4.2.4.3 is (ν ,ν )-compu-

N ≤ table, (ν N,ρ)-computable andP (ν ,ρ )-computable (Example 4.1.14.2).

∈ −i ⊆ N 6. Consider n N, n>2. Is i∈A n computable, if A is recursive

(r.e.)? N

7. Show that there is a sequence (ai)i∈Nof rational numbers which is (ν ,ρ)-

N → N Q computable but not (ν N,ν )-computable. Hint: Let a : be a computable injective function such that range(a) is not recursive. Define −k

xn := 0, if n 6∈ range(a), xn := 2 ,ifa(k)=n.

Q → R ⊆ Q

8. Define a (ν Q,ρ)-computable function f : such that range(f)

Q

| Q → Q Q and the restriction f : is not (νQ,ν )-computable. [Hau87]

4.2 Computable Real Numbers 107 → R 9. Show that there is a computable sequence y : N of real num- bers, such that the sequence sgn ◦ y is not computable (where sgn(x):= 0, if x ≤ 0, 1 otherwise). √ P∞ 1 

2 · k ∈ R | |  10. By Taylor’s theorem, 1+t= k=0 k t for all t with t < 1. The series converges also for |t| =1.Fort=−1weobtain 1 1 1·3 1·3·5 0=1− − − − −... . 2 2·4 2·4·6 2·4·6·8

Determine a modulus of convergenceP (find an expression in elementary functions and do not use summation ) for the sequence i 7→ xi with P 1  i 2 · − k

xi := k=0 k ( 1) . (Consult, for example, [BB85].)

 ∈N 11. Show that for every bounded (ν N,ρ<)-computable sequence (xi)i of real numbers, sup x is ρ -computable. i∈N i < P ∈ 6 −i

12. There is a left-computable real number x (0; 2) such that x = i∈A 2 ⊆ N for every r.e. set A ⊆ N.Hint:LetB be recursively enumerable but not recursive and define X X −(2i+1) −(2i+2) yB := 2 + 2 . i∈B i6∈B

13. LetP (xi)i∈Nbe a computable sequence of real numbers such that |xi+1 − xi| is finite. Show that x is the sum of a left-computable i∈N and a right-computable real number. There are real numbers of this type, which are neither left- nor right-computable. Left-computable and more general types of real numbers are investigated in [WZ98a].

⊆ × R Q 14. Show that the multi-valued function F : R , defined by RF := { | } ((x, y),a) x,ρ<,νQ)-computable. 1 15. The open set UN := I (wi) from Theorem 4.2.8 containing all com- i∈N putable real numbers can be written as a disjoint union of open intervals. Let K ⊆ UN be the interval of this partition of UN containing the (com-

putable) number 0 ∈ R and let c := sup(K) be its right-hand endpoint. 6∈ a) Show c is not computable, that is, c Rc. ⊆ b)S Let cn be the right-hand endpoint of the longest interval J n 1 ∈ i=0 I (wi)with0 J. Show that (cn)n∈Nis a non-decreasing com- putable sequence with c =sup c . (Hence c is left-computable.) n∈N n

1

c) Show that cn ≤ a or cn ≥ b,ifn≥iand (a, b):=I (wi).

N d) Show that f :⊆ R , defined by

−n

× N | ∀ | − |≥ } Rf := {(x, n) ∈ Rc ( k>n)ck x 2 ,

is (ρ, ν N)-computable. 108 4. Computability on the Real Numbers

16. Effectivize Theorem 4.2.6.1. Define a multi-valued function

N

R { | ∀ 6 } D : R by RD := ((x0,x1,...,),x) ( i) x=xi .

a) Show that D is ([ρ]ω,ρ)-computable. b) Show that D has no ([ρ]ω,ρ)-continuous choice function. ∈ 17. By Theorem 4.1.13.2, x R is ρb,2-computable, iff it is ρb,10-computable. ω By Theorem 4.1.13.4, ρb,2 6≤t ρb,10. Show that there is a [ρb,2] - ω

computable sequence (x0,x1,...) which is not [ρb,10] -computable [Mos57]. → N Hint: There are injective computable functions a, b : N such that A := range(a)andB:= range(b) are recursively inseparable, that is, ∩ ∅ ⊆ ⊆ \ A B = and for no recursive set C, A C and B N C [Rog67, Odi89]. Let ρb,2(0•d1d2 ...)=1/5 and define   ρb,2(0•d1d2 ...)forn6∈ A ∪ B, 0• 00 xn :=  ρb,2( d1d2...dk ...)fora(k)=n, ρb,2(0•d1d2...dk11 ...)forb(k)=n.

4.3 Computable Real Functions → R A real function f :⊆ R is computable (more precisely (ρ, ρ)-computable), iff some Type-2 machine transforms any ρ-name p of any x ∈ dom(f)toa ρ-name of f(x), where a ρ-name of y is a list of all rational open intervals J ∈ Cb(1) such that y ∈ J. Since equivalent representations induce the same computability, ρ can be replaced by any representation equivalent to it, for example by the Cauchy representation ρC (Lemma 4.1.6). Computable func- tions with n real arguments are realized accordingly by machines with n input

tapes. Since the representation ρ is admissible with final topology τR(Lemma 4.1.4), we obtain as a special case of our Main Theorem 3.2.11:

Theorem 4.3.1 (continuity). Every computable real function is contin- uous.

More precisely, every (ρn,ρ)-computable real function is continuous w.r.t.

the real line topology τR. Many easily definable functions like the step func- tion or the Gauß staircase (Fig. 1.3) are not (ρ, ρ)-computable, since they are not continuous. Some people reject TTE and similar approaches to computa- ble analysis since they think that a reasonable computability theory for anal- ysis should make such functions computable. This objection can be removed, since TTE admits various natural computable topological spaces which make the step function, the Gauß staircase and similar functions computable (for example the Gauß staircase is (ρ, ρ>)-computable). The following theorem lists some computable real functions. 4.3 Computable Real Functions 109

Theorem 4.3.2 (some computable real functions). The following real functions are computable:

1. (x1,...,xn)7→ c (where c ∈ R is a computable constant), 2. (x1,...,xn)7→ xi (1 ≤ i ≤ n), 3. x 7→ −x, 4. (x, y) 7→ x + y, 5. (x, y) 7→ x · y, 6. x 7→ 1/x, 7. (x, y) 7→ min(x, y), (x, y) 7→ max(x, y), 8. x 7→ |x|, 9. every function in n variables with computable coefficients,

7→ i 0 ∈ R 10. (i, x) x for i ∈ N and x (0 := 1).

000 Proof: We will use the representations ρC and ρC which are equivalent to ρ by Lemma 4.1.6. 1. Let M be a Type-2 machine with n input tapes which on every in- put computes some computable ρ-name of c.ThenfM realizes the constant function with value c. 2. Let M be a Type-2 machine with n input tapes which copies the i-th input tape to the output tape. Then fM realizes the i-th projection. 3. There is a computable word function f : Σ∗ → Σ∗ such that

− ∈

Q Q ν Q(w)=ν f(w) for all w dom(ν ). There is a Type-2 machine M,which ∈ ∈ transforms any input p := ι(u0)ι(u1) ... dom(ρC) (where ui dom(ν Q)) to the sequence q := ι(f(u0))ι(f(u1)) .... Obviously, ρC(q)=−x,ifρC(p)=x.

Therefore, fM realizes negation on R.

Q

Q Q 4. Since addition on is (νQ,ν ,ν )-computable, there is a computable ⊆ ∗ × ∗ → ∗ ∈

function f : Σ Σ Σ such that u + v = ν Qf(u, v) for all u, v

dom(ν Q). There is a Type-2 machine M, which transforms any input (p, q), ∈ 000 ∈ 000 p := ι(u0)ι(u1) ... dom(ρC )andq:= ι(v0)ι(v1) ... dom(ρC ) (where ∈ ui,vi dom(ν Q)) to the sequence r := ι(y0)ι(y1) ...with yi := f(ui+1,vi+1). Since yi = ui+1 + vi+1,wehave | − 000 000 |≤| − 000 | | − 000 |≤ · −i−1 −i yi (ρC (p)+ρC (q)) ui+1 ρC (p) + vi+1 ρC (q) 2 2 =2 . ∈ 000 000 We obtain r = fM (p, q) dom(ρC )andρC (r)=x+y. Therefore, fM is a 000 000 000

(ρC ,ρC ,ρC )-realization of addition.

Q

Q Q 5. Since multiplication on is (νQ,ν ,ν )-computable, there is a com- ⊆ ∗ × ∗ → ∗ ·

putable function f : Σ Σ Σ such that u v = ν Qf(u, v) for all ∈

u, v dom(ν Q). There is a Type-2 machine M which transforms any input ∈ 000 ∈ 000 (p, q), p := ι(u0)ι(u1) ... dom(ρC )andq:= ι(v0)ι(v1) ... dom(ρC ), to

the sequence r := ι(y0)ι(y1) ... with yi := f(um+i ,vm+i), where m ∈ N is m−1 m−1 the smallest number with |u0| +2≤2 and |v0| +2≤2 . For all n we have

| |≤| − 000 | | 000 − | | |≤ | |≤ m−1 un un ρC (p) + ρC (p) u0 + u0 2+ u0 2 110 4. Computability on the Real Numbers

| |≤ m−1 000 000 and accordingly vn 2 .Withx:= ρC (p)andy:= ρC (q)weobtain | − · | | · − · | yi x y = um+i vm+i x y ≤|um+i·vm+i−um+i·y|+|um+i·y−x·y| ≤|um+i·(vm+i−y)|+|(um+i−x)·y| ≤2·2m−1·2−m−i =2−i . ∈ 000 000 · We obtain r = fM (p, q) dom(ρC )andρC (r)=x y. Therefore, fM is a 000 000 000 (ρC ,ρC ,ρC )-realization of multiplication. 6. There is a Type-2 machine M which works as follows on input p :=

000 ∈ ∈ N ι(u0)ι(u1) ... dom(ρC ): First M searches for the smallest N with −N |uN | > 3 · 2 .AssoonassuchanumberNhas been found, M starts to write the sequence r := ι(y0)ι(y1) ...with yi =1/u2N+i. 000 6 | | −N ≥ Suppose that x := ρC (p) =0.ThenN exists and uk > 2 for all k N and hence |x|≥2−N.Weobtain

| − | −1 1 −1 x u2N+i ≤ −2N−i· N · N −i yi = = 2 2 2 =2 . x u2N+i x |u2N+i|·|x| 000 000 Therefore, fM is a (ρC ,ρC )-realization of inversion. Notice that fM (p)does 000 not exist, if ρC (p)=0. 7. There is a Type-2 machine M which transforms any input (p, q), p := ∈ 000 ∈ 000 ι(u0)ι(u1) ... dom(ρC )andq:= ι(v0)ι(v1) ... dom(ρC ), to the sequence r := ι(y0)ι(y1) ... with yi =min(ui,vi). If x =min(x, y, ui, vi), then | − | − ≤ − ≤ −i yi min(x, y) =min(ui,vi) x ui x 2 .

If ui =min(x, y, ui, vi), then | − | − ≤ − ≤ −i yi min(x, y) =min(x, y) ui x ui 2 . | − |≤ For the cases y =min(x, y, ui, vi)andvi =min(x, y, ui, vi), yi min(x, y) −i 000 000 000 2 can be concluded similarly. Therefore, fM is a (ρC ,ρC ,ρ )-realization of min. Since max(x, y)=(x+y)−min(x, y), max is computable by Properties 3 and 4 and the composition theorem 3.1.6. 8. |x| =max(x, −x), apply Properties 3 and 7. 9. We apply the composition theorem 3.1.6. Every monomial f of degree 0 (that is, f(x1,...,xn):=c) with computable constant c is computable by Property 1. Suppose that all monomials of degree k with computable coeffi- cients are computable. If fk+1 is a monomial of degree k +1 with computable · coefficient, then fk+1(x1,...,xn)=fk(x1,...,xn) pri(x1,...,xn)forsome monomial of degree k with computable coefficient and some i. By induction and Properties 2 and 5, fk+1 is computable. Another easy induction shows that every polynomial function with compu- table coefficients is computable. 4.3 Computable Real Functions 111

10. For h(i, x):=xi we have h(0,x)=1, h(n+1,x)=x·h(n, x) . If we define f(x):=1andf0(n, y, x):=x·y,thenfand f0 are computable by Properties 1 and 5 above, and h is computable by Theorem 3.1.7.2 on

primitive recursion.  → R Example 4.3.3. The exp : R is computable. We use the estimation

XN xi |x|N+1 N exp(x)= + r (x) , where r (x) ≤ 2 · ,if |x|≤1+ . i! N N (N +1)! 2 i=0

Let M be a Type-2 machine which for any p = ι(u0)ι(u1) ... ∈ dom(ρC) computes a sequence q = ι(v0)ι(v1) ...,whereforeachn,vn is determined as follows. | | ≤ 1. M determines the smallest N1 ∈ N with u0 +1 1+N1/2. ∈ ≥ 2. M determines the smallest N N, N N1,with |1+N /2|N+1 2· 1 ≤2−n−2 . (N +1)! ∈ 3. M determines the smallest m N with

XN i · (1 + N /2)i−1 2−m · 1 ≤ 2−n−2 . i! i=1 ∗ 4. M determines vn ∈ Σ such that

XN u i v = m . n i! i=0

Assume x = ρC(p)=ρC(ι(u0)ι(u1)...). Then |x|≤1+N1/2and|um|≤ 1+N1/2. We obtain

XN xi XN u i | exp(x) − v |≤| − m | + |r (x)| n i! i! N i=0 i=0 XN |xi−1 + xi−2u + ...+ui−1| ≤|x−u |· m m +2−n−2 m i! i=1 XN i · (1 + N /2)i−1 ≤2−m · 1 +2−n−2 i! i=1 ≤2−n−2 +2−n−2 ≤2−n−1 . 112 4. Computability on the Real Numbers

We obtain furthermore exp(x)=ρC(ι(v0)ι(v1)...), since for i

−i−1 −j−1 −i |vi−vj|≤|vi−exp(x)| + | exp(x) − vj |≤2 +2 ≤2 .

Therfore, fM realizes the exponential function.  The computable real functions are closed under composition (Theorem 3.1.6) and under primitive recursion (Theorem 3.1.7). There are some other useful operations which map computable real functions to computable real functions.

n

→ R ∈ R Corollary 4.3.4. If f, g :⊆ R are computable functions and a is a , then x 7→ a·f(x), x 7→ f(x)+g(x), x 7→ f(x)·g(x), x 7→ max(f(x),g(x)), x 7→ min(f(x),g(x)) and x 7→ 1/f(x) are computable functions.

Proof: By Theorem 3.1.6 the computable real functions are closed under

composition. Apply Theorem 4.3.2. 

The join of two computable functions at a computable point is a compu- table function (Fig. 4.4).

f(x) 6

f -

c x a f2 f1

Fig. 4.4. The join f of f1 and f2 at a → R Lemma 4.3.5 (join of functions). Let f1,f2 :⊆ R be computable

real functions and let c ∈ R be a computable real number. Then the

→ R ⊆ R function f : , defined by  f1(x)ifxc, f(x):= f1(a)ifx=cand f1(a)=f2(a), div otherwise, is computable. 4.3 Computable Real Functions 113

Proof: First consider the case c = 0. We may assume that f1 and f2 are (ρa,ρa)-computable, ρa from Lemma 4.1.6. There are Type-2 machines

M1 and M2 such that fM1 and fM2 realize f1 and f2, respectively. For i =1,2letMi(p, k) be the output written by the machine Mi in k steps. For any w ∈ Σ ∗ let N(w):=(λ,ifwhas no subword ι(w0), its rightmost subword ι(w0) otherwise). There is a Type-2 machine M which on input a p = ι(u0)ι(u1) ...∈dom(ρ ) operates in stages k =0,1,2...as follows: Stage k: 1 • If 0 ∈ I (uk)andifN◦M1(p, k)=λor N ◦ M2(p, k)=λ,thenMgoes to the next stage; 1 • If 0 ∈ I (uk)andifN◦M1(p, k)=ι(w1)andN◦M2(p, k)=ι(w2), then M writes some word ι(w), such that I1(w) is the smallest interval with 1 1 1 I (w1) ∪ I (w2) ⊆ I (w); 1 • If I (uk) < 0, then M writes N ◦ M1(p, k); 1 • if I (uk) > 0, then M writes N ◦ M2(p, k). Suppose that x = ρa(p)andf(x) exists. If x<0, then M finally produces the output intervals of M1 on input p.Ifx>0, then M finally produces the output intervals of M2 on input p.Ifx=0,thenM produces a combination of both outputs which converges to f1(0) = f2(0). The result is always a ρb-name of f(x), ρb from Lemma 4.1.6. Therefore, f is (ρa,ρb)-computable. 6 0 0 If c = 0, apply the above join operation to the functions f1 and f2, 0 0 f1(x):=f1(x+c)andf2 := f2(x + c), which are computable by Theo- 0 0 rem 4.3.2, and shift the result f : f(x):=f(x−c). 

We turn now to functions on infinite sequences of real numbers. We use

ω → N the representation [ρ] (Definition 3.3.3) which is equivalent to [νN ρ] by Lemma 3.3.16. Projection and partial summation are computable:

Lemma 4.3.6 (sequences). For sequences (x0,x1,...)ofrealnumbers 7→ ω 1. The projection pr : (x0,x1,...),i xi is ([ρ] ,νN,ρ)-computable; 2. The function S0 : (x0,x1,...),i 7→ x0 + x1 + ...+xi ω

is ([ρ] ,νN,ρ)-computable; 3. the function S :(x0,x1,...)7→ (y0,y1,...)where ω ω yi := x0 + x1 + ...+xi,is([ρ] ,[ρ] )-computable.

Proof: 1. The function (hp ,p ,...i,w)7→ p realizes the projection.

0 1 ν N(w) 2. We apply Theorem 3.1.7 on primitive recursion. Define  h 0, (x0,x1,...) =x0   h n+1,(x0,x1,...) =h n, (x0,x1,...) +xn+1 . 0 Since f(x0,x1,...):=x0 and f (n, y, (x0,x1,...)) := y+xn+1 are computable by Property 1, h is computable by Theorem 3.1.7. Since S0 (x0,x1,...),i = ω

x0 +x1 +...+xi =h i, (x0,x1,...) , S0 is ([ρ] ,νN,ρ)-computable. 114 4. Computability on the Real Numbers

ω → N 3. By Property 2 and Theorem 3.3.15, S is ([ρ] , [νN ρ] )-computable, ω ω and so ([ρ] , [ρ] )-computable. 

The limits of converging sequences and series are computable. We add as → N a further a modulus e : N of convergence and use the represen-

NN tation [ν N ν ] (Definition 3.3.13).

Theorem 4.3.7 (limit of sequences and series of numbers). For → N sequences (x0,x1,...) of real numbers and modulus functions e : N , the functions  L : (x ,x ,...),e 7→ lim x and (4.1) 0 1 →∞ i  i X SL : (x0,x1,...),e 7→ xi (4.2)

i∈N

−n where ((x0,x1,...),e) ∈ dom(L), iff (∀j>i≥e(n))|xj − xi|≤2 ,and −n ((x0,x1,...),e) ∈ dom(SL), iff (∀j ≥ i ≥ e(n))|xi + ...+xj|≤2 ,are

ω →

NN ([ρ] , [ν N ν ] ,ρ)-computable.

Proof: 4.1. We generalize the proof of Theorem 4.2.3. It suffices to show that

ω →

NN the function is ([ρC] , [ν N ν ] ,ρC)-computable. There is a Type-2 ma- chine M which on input hp0,p1,...i,q , = ι(ui0)ι(ui1)... ∈ dom(ρC),

NN e := [νN ν ] (q), writes the sequence q := ι(ue(2)2)ι(ue(3)3)ι(ue(4)4) ... .

ω →

NN Then fM is a ([ρC] , [νN ν ] ,ρC)-realization of L (cf. the proof of Theo- rem 4.2.3). P 7→ 4.2. By Lemma 4.3.6, S :(x0,x1,...) (y0,y1,...), yi := m≤i xi, ω ω −n is ([ρ] , [ρ] )-computable. If for all j ≥ i ≥ e(n), |xi + ...+ xj|≤2 , −n then for all j>i ≥e(n), |yj − yi| =|xi+1 + ...+xj|≤2 . Therefore, SL (x0,x1,...),e =L S(x0,x1,...),e ,Lfrom 4.1 above, if |xi +...+xj|≤

−n ω

≥ ≥ → 

NN 2 for all j i e(n), and so SL is ([ρ] , [ν N ν ] ,ρ)-computable.

We apply Theorem 4.3.7 to show that the uniform limit of a fast converg- ing computable sequence of real-valued functions is computable (Fig 4.5).

Theorem 4.3.8 (limit of sequences and series of functions). Let ⊆ ω → ⊆ ⊆ →

δ : Σ M be a representation, let X M.Let(fi)i∈Nwith fi : M → R and dom(fi)=X be a sequence of functions such that (i, x) fi(x)is

(νN,δ,ρ)-computable.

−n

→ N | − |≤ 1. If there is a computable function e : N with fj (x) fi(x) 2

for all j>i≥e(n)andx∈X, then the function f :⊆ M → R, defined

by dom(f)=Xand f(x) = limi→∞ fi(x), is (δ, ρ)-computable.

→ N | |≤ 2. If there is a computable function e : N with fi(x)+...+fj(x) −n 2 for all j ≥ i ≥ e(n)andx∈X,P then the function f :⊆ M → R, defined by dom(f)=Xand f(x)= fi(x), is (δ, ρ)-computable. i∈N 4.3 Computable Real Functions 115

f(x) 6

f0 f2

f1

c - f x

Fig. 4.5. Functions f0,f1,f2 ... uniformly converging to f

7→

Proof: 1. Since the function (x, i) fi(x)is(δ, ν N,ρ)-computable, by Theo-

7→ →

N N rem 3.3.15.2 the function F : x (fi(x))i∈Nis (δ, [ν ρ] )-computable and hence (δ, [ρ]ω )-computable by Lemma 3.3.16. We obtain f(x)=L(F(x),e) for all x ∈ X where L is the limit operator from Theorem 4.3.7,4.1. The

ω →

NN function f is (δ, ρ)-computable, since L is ([ρ] , [νN ν ] ,ρ)-computable

NN and e is [νN ν ] -computable.

1. This follows correspondingly from Theorem 4.3.7.4.2. 

Lemma 4.3.6 and Theorems 4.3.7 and 4.3.8 can be generalized straight-

n R forwardly from R to . ∈ | | p Every z = x + iy C has an absolute value√ z = x2 + y2 and a norm ||z|| =max(|x|,|y|) satisfying ||z|| ≤ |z|≤ 2·||z||.

2 R The set C of complex numbers can be identified with the set of pairs of ↔ 2 n real numbers, x + iy (x, y), with standard representation [ρ] .ThenC is represented by [[ρ]2]n ≡ [ρ]2n ≡ ρ2n (where we assume that the Cartesian ∈ product is associative, see Definitions 3.3.3, 4.1.17). We call a point a C computable, iff it is ρ2-computable (iff it is (ρ, ρ)-computable), a function

n 2n 2 → C f :⊆ C computable, iff it is (ρ ,ρ )-computable etc. . A complex- valued function is computable, iff its real part and its imaginary part are computable (Lemma 3.3.6).

Theorem 4.3.9 (computable complex functions). The complex func- 7→ 7→ · tions z 7→ a (for computable a ∈ C ), (z1,z2) z1 + z2,(z1,z2) z1 z2, z 7→ 1/z, z 7→ |z|, z 7→ ||z||, z 7→ Re(z)andz7→ Im(z) are computable. Fur- thermore, every complex polynomial function with computable coefficients and the function (j, z) 7→ zj are computable.

Proof: Consider the function f : z 7→ 1/z. By Lemma 3.3.6 it suffices to show that the projections Re(f) and Im(f)are(ρ, ρ, ρ)-computable. We have 1 x − iy x −y f(x + iy)= = = + i , x+iy x2 + y2 x2 + y2 x2 + y2 116 4. Computability on the Real Numbers therefore, f is computable√ by Theorem 4.3.2. Computability of |z| follows 7→ ≥ from computability of x x for x ∈ R,x 0, which will be proved below

(Example 4.3.13.6). The remaining proofs are left to the reader. 

Theorem 4.3.10 (sequences of complex numbers). Lemma 4.3.6 and Theorem 4.3.7 hold for sequences of complex numbers accordingly.

Every sequence (aj )j∈Nof complex numbers defines a with co- → C efficients a0,a1,...and a function f :⊆ C , defined by X∞ j f(z):= aj · z . j=0

The sum f(z) of the series is defined for all z with |zp| Rwhere R := 1/ lim supj→∞ aj is the radius of convergence. By Cauchy’s estimate for every number r

to an appropriate constant M for Cauchy’s estimate can be computed from ∈N (aj)j∈Nin general. For computing f(z)fromzand the sequence (aj)j of coefficients further information about this sequence must be available. We −j will use a radius r

j ∈ N. 7→ →

We represent the set of sequences j aj of complex numbers by [νN 2 2 ω

ρ ]N(Definition 3.3.13) or by [ρ ] (Definition 3.3.3) which are equivalent by Lemma 3.3.16.

Theorem 4.3.11 (power series). The function  X∞ 7−→ · j

P : (aj )j∈N,r,M,z aj z j=0

−j defined for arguments with |z|

2 ω 2 2 N

[ρ ] ,νQ,ν ,ρ ,ρ -computable.

× C Q Proof: The multi-valued function h :⊆ Q with graph

{ || | } 2 Q Rh := (r, z, s) z

Q : (aj )j∈N,r,s,M,z aj z j=0 4.3 Computable Real Functions 117

−j defined for arguments with |z|

2 ω 2 2

Q N [ρ] ,νQ,ν ,ν ,ρ ,ρ -computable.

7→ j 2 2 The function (j, z) z is (νN,ρ ,ρ )-computable (Theorem 4.3.9). By the 7→ · k complex generalization of Lemma 4.3.6.1, the function (aj )j∈N,z,k ak z 2 ω 2 2

is ([ρ ] ,ρ ,νN,ρ )-computable. Therefore, by Theorem 3.3.15.2 and Lemma 3.3.16, 

7→ · j 2 ω 2 2 ω ∈N G : (aj )j∈N,z (aj z )j is ([ρ ] ,ρ ,[ρ ] )-computable.

Next we determine a modulus of convergence. The function    m | · s · r ≤ −n H :(r, s, M, n) 7→ min m ∈ N M 2 r r − s

∈ ∈ N (r, s Q,s

H0 :(r, s, M ) 7→ e, e(n):=H(r, s, M, n) ,

→ | |≤ ≥ ≥

Q N N N is (νQ,ν ,ν ,[ν ν ])-computable. For z s

ai z =SL G((aj)j∈N,z),H (r, s, M ) , i=0

−j if |z|≤s

Combining machines for h and Q we can construct a machine computing P . 

For a computable sequence (aj )j∈Nof complex numbers we obtain the following useful consequences:

Theorem 4.3.12. Let (aj)j∈Nbep a computable sequence of complex num- j | | bers and let R := 1/ lim supPj→∞ aj . 7→ ∞ · i 1. The function f : z i=0 ai z is computable on every closed ball { ∈ || |≤ }

z C z r with r

0 0 Proof: 1. There is some rational number r such that r

∈ 0 0 0 N | |

Cauchy bound M for r . Then for all z

2. For input z first find some number k with |z|

The above theorems have many applications.

Example 4.3.13. ∈ C 1. If (aj)j∈Nis a computable sequence ofp complex numbers, z0 is com-

j

| | ⊆C →C putable and r

is computable on the disc {z ||z−z0|≤r}. For a proof consider the function f from Theorem 4.3.12. Then g(z)=f(z−z0), hence g is

computable by Theorem 4.3.9. → C 2. The exponential function exp : C can be defined by the power series

∞ Xzj exp(z)= j! j=0 p ∈ j for all z C . Since lim supj→∞ 1/j! = 0, the radius of convergence is ∞ ∈ R = . By Theorem 4.3.12, for every N N the exponential function is computable on the disc {z ||z|≤N}. This means, for every number N there is a machine MN whichcomputesexponthisdisc.

There is also a single machine computing exp(z) for all z ∈ C .Toshow this we apply Theorem 4.3.12.2. Consider N ≥ 1. For j ≤ N we have 1 ≤ 1 ≤ N N−j = N N · N −j , j! and for j>Nwe have 1 1 1 ≤ ≤ =NN ·N−j . j! (N +1)·(N+2)·...·j Nj−N

rk Define rk := k +1 andMk := rk . By Theorem 4.3.12.2, the exponential

function is computable on C .

→ C C → C 3. The sin : C and cos : are computa- ble. For a proof use the identities sin(z) = (exp(iz) − exp(−iz))/(2i) and cos(z) = (exp(iz)+exp(−iz))/2 and Example 2. In particular, the real trigonometric functions are computable. 4.3 Computable Real Functions 119

4. For |z| < 1wehave

∞ X zj log(1 + z)= (−1)j+1 . j j=1

The radius of convergence is 1. The function z 7→ log(1+z) is computable on the disc {z ||z|<1}(Exercise 4.3.12). 5. The real function x 7→ log x is computable on the interval (0; ∞): By Example 4.3.13.4 the number log 2 = log(1 + 1/3) − log(1 − 1/3) is computable. There is a machine M which on input x (more precisely, ∈ on input p with ρ(p)=x>0) first determines some integer d Z with 1/2

⊆ d R Z { | · }

g : with Rg = (x, d) 1/2

but has no (ρ, ν Z)-continuous choice function.) 7→ y 6. The function (x, y) x for x, y ∈ R and√ x>0 is computable: xy =exp(y·log x) . In particular, x 7→ x is computable. 7. For real x with |x| < 1wehave

1 x3 1 · 3 x5 1 · 3 · 5 x7 arcsin x = x + · + · + · + ... . 2 3 2 · 4 5 2 · 4 · 6 7 The function arcsin is computable on (−1; 1) (Exercise 4.3.13). 8. Since computable functions map computable elements to computable √ones, and since√ the rational numbers are computable, numbers like

1/2 m ∈ Q 2=2 , n(m, n > 1), e = exp 1, log 2, loga b =logb/ log a (a, b , · π

a, b > 0), π =6 arcsin(1/2) and e are computable real numbers.  → C Complex functions f :⊆ C which can be defined by power series are called analytic [Ahl66]. We will discuss computability of analytic functions in

Sect. 6.5.

→ R ⊆ R Let f : R be a (total) computable real function and let X be a “very complicated” set. Then by definition the restriction fcX is also c computable. But f X has a computable extension with the simple domain R. There is, however, a computable real function with very complicated domain, which has no computable extension.

Example 4.3.14 (a computable function with inherent Gδ-domain). → R Define the function f :⊆ R by P −i

{2 |µ(i)

Stage i: −m M searches for some m with |um − µ(i)| > 2 .Ifnosuchmexists, then the computation remains in Stage i forever. Otherwise, M prints ι(vi)where −i −m vi =vi−1+2 ,ifµ(i)

function f. \Q

The function f has the domain dom(f)=R which is a Gδ-set, that \ Q

Tis, it can be written as an intersection of a sequence of open sets: R =

\{ } R\ Q ( R µ(i) ). is even a “computable” Gδ-set (Exercise 4.3.17). Since i∈N −k for each rational number a = ν(k), limx→a+ f(x) − limx→a− f(x)=2 ,the function f has no proper continuous extension and hence no proper compu-

table extension. 

Every continuous partial real function has an extension with Gδ-domain [Kur66]. Every (ρn,ρ)-computable real function has a strongly (ρn,ρ)-compu- table extension. The domain of each strongly (ρn,ρ)-computable real function is a computable Gδ-set (Exercise 3.1.5 and Exercises 4.3.17 and 18). In Chap. 9 we will discuss several other definitions for computable real functions and compare them with the definitions given here. As a special case n

of Corollary 3.2.13, every computable or continuous function from R to a discrete space is constant.

Lemma 4.3.15. Let µ be a notation of a set M, M =6 ∅. If a function n → n f : R M is (ρ ,µ)-continuous, then f is a constant function.

n n n R

Proof: The final topology τR of the admissible representation ρ of is

connected. Apply Corollary 3.2.13. 

Corollary 4.3.16.

n n

R → N

1. Every (ρ ,νN)-continuous or -computable function f : is con- stant.

n n

R → Q

2. Every (ρ ,νQ)-continuous or -computable function f : is con- stant.

n n

R → B

3. Every (ρ ,δB )-continuous or -computable function f : is con-

stant (δB from Definition3.1.2).

Proof: The first two statements are immediate. Consider i ∈ N. The function

7→ ◦ n

N N Hi : h h(i)is(δB ,ν )-computable, hence Hi f is (ρ ,ν )-continuous, and

so constant. Therefore, f is constant. 

Exercises 4.3.

R × R → R ∈ R  1. Let f : be a computable function and let c be a computable constant. Define g(x):=f(x, c) for all x. Show that g is computable.

4.3 Computable Real Functions 121

R \ Z  2. The Gauß staircase is (ρ, ρ>)-computable. Its restriction to is

(ρ, ρ)-computable. ∅ R  3. Use Exercise 3.1.4 to show that and are the only ρ-decidable subsets

or R.

 4. Show that in Theorem 4.3.2 Property 3 follows from Properties 1,2 and 5. 5. Show that the real functions x 7→ |x|, x 7→ ||x||,(x, y) 7→ d(x, y)and 7→ e n (x, y) d (x, y)forx, y ∈ R are computable.

6. Let a0,b0,...,an,bn ∈ Q with a0 < ... < an. Show that the rational → R polygon f : R , defined by  b0 if x

is computable. 7. Show that the function Yn 7→

((xi)i∈N,n) xi i=0

ω

is ([ρ] ,νN,ρ)-computable. n

8. Show that Lemma 4.3.6, Theorem 4.3.7 and Theorem 4.3.8 hold for R

replacing R (and, in particular, for complex numbers).

R → R

9. Let (fi)i∈Nwith fi : be a sequence of real functions with 7→

a) (i, x) fi(x)is(νN,ρ,ρ)-computable,

2 −n

→ N | − |≤ b) there is a computable function e : N with fi(x) fj (x) 2

for all i, j ≥ e(n, k)and|x|

⊆ → R b not computable. Show that there is a real function f : R such that f is strictly increasing, dom(f) = (0; 1), range(f)=(a;b), f and f−1 are computable. The computable function f has a (unique) continu- ous extension to [0; 1] which is not computable. (Hint: consider Example 4.2.4.3; let f be an infinite .) 12. Prove that z 7→ log(1 + z) is computable on the open disc {z ||z|<1}. 13. Prove that x 7→ arcsin x is computable on the open interval {x ||x|<1}. x 14. Show that the real exponential function x 7→ e is (ρ<,ρ<)-computable. 15. (Sorting real numbers)

n n → R a) Show that the function f : R , defined by f(x1,...,xn):=(y1,...,yn) such that {x1,...,xn} = {y1,...,yn} and y1 ≤ y2 ≤ ...≤yn, is computable.

2

N b) Show that the multi-valued function f : R , defined by Rf := { | } 2

((x1,x2),i) xi =min(x1,x2) ,isnot(ρ,νN)-continuous. 122 4. Computability on the Real Numbers

c) Show that the function

6 ≤ ≤ (x1,...,xn)7→ π, xi ∈ R,xi=xj for 1 i, j n,

where π is the permutation of {1,...,n} such that xπ(1) < ... < n xπ(n),is(ρ ,ν)-computable (where ν is a canonical notation of the permutations of {1,...,n}). 16. Let 0

− Q a(νN,ν )-computable sequence of rational numbers ai with b a = limi→∞ ai. T S 

⊆ ∗ ∗ 1 × R \ Q |

17. Show that there is some r.e. set A Σ Σ with = u v Iv

\ Q ∈ R (u, v) A (that is, is a “computable” Gδ-set).T S 

1

⊆ R | ∈  18. [Wei93] Call X a computable Gδ-set, iff X = u v Iv (u, v) A for some r.e. set A ⊆ Σ∗ × Σ∗.

⊆ → R a) Show that every computable real function f : R has a strongly (ρ, ρ)-computable extension (Exercise 3.1.5).

b) Show that dom(f) is a computable Gδ-set for every strongly (ρ, ρ)- → R computable real function f : R .

c) Show that for every computable Gδ-set X there is a strongly (ρ, ρ)- → R computable real function f : R with X =dom(f).

⊆ { ∈ N | ∀ ∃ ∈ d) Let X N be a Π2-subset, that is, X = x ( i)( k)(x, i, k) } ⊆ 3

B for some decidable set B N . Show that X is a computable Gδ-

N \ R \ subset of R.(IfX is r.e. , then X, X and X are computable

Gδ-subsets of R.)

m n

R → R  19. For a function f : , the following properties are equivalent: a) f is (ρm,ρn)-computable, m n b) the set {(u, v)S|f[I (u)] ⊆ I (v)} is r.e. , c) f −1 [In(v)] = Im(u) | (u, v) ∈ B for some r.e. set B ⊆ Σ∗ × Σ∗ (Theorem 3.2.14). n n 20. Show that every continuous, (ρ , idΣω )-continuous or (ρ , idΣω )-comput- n → ω able function f : R Σ is constant.

n n n

R → R 7→  21. Let f : be computable. Show that the function (n, x) f (x) n n

is (νN,ρ ,ρ )-computable. Hint: Apply Theorem 3.1.7.

∈ 2 C → C 22. For c C define fc : by fc (z):=z +c. Show that the function 7→ n 2 2 (n, c) fc (0) is (ν N,ρ ,ρ )-computable. Hint: Apply Theorem 3.1.7. 23. Show that every continuous (and hence (ρn,ρ)-continuous) function f :

n

→ R ⊆ Q R with range(f) is constant.