• Keine Ergebnisse gefunden

7.6 Computable Numbers

The computable numbers can be described as real numbers whose expressions as a decimal are calculable by finite means (Alan Turing, 1936). More specifically, a computable number is one for which there is a Turing machine which, givennon its initial tape, terminates with thenth digit of that number encoded on its tape (Marvin Minsky, 1967). These informal definitions are subject to a rounding problem, while the modern definition only requires the result be accurate to within a given bound. Computable real numbers form the basis of computable analysis and play also an important role in the applications of mathematics.

Computable Real Numbers

Every rational number is computable, since each quotient mn withm, n∈N0,n6= 0, can be written as m

n = νm(c(0))

νn(c(0)). (7.61)

However, not every real number is computable, since the set of real numbers is not countable (by Cantor’s second diagonal argument), while the set of programs for a Turing machine is by Proposition 1.3 countable.

Each real number is by construction the limit of a Cauchy sequence of rationals. In view of a computable real number, the sequence of rationals must be computable, and the convergence of this sequence to its limit must be effective. These conditions are considered in turn.

A sequence (rk) of rational number iscomputableif there are three recursive functionsa, b, s:N0→ N0such that b(k)6= 0 for allkand

rk= (−1)s(k)a(k)

b(k), k∈N0. (7.62)

A sequence (rk) of rational number isconverges effectivelyto a real numberxif there is a recursive functione:N0→N0 such that for allN,

k≥e(N) =⇒ |rk−x| ≤2−N, k∈N0. (7.63) A real number x is computable if there is a computable sequence (rk) of rational numbers that converges effectively to x, written x= limk→∞rk or rk →xas k → ∞. Thus a computable real can be effectively approximated to any desired degree of precision by a Turing program. If more precision is required, the calculation may take longer but the method used does not alter.

Example 7.38.Consider the sequence of rationals (ek) given by ek=

In view of the sequence (sk) defined as

92 7 Undecidability

sk= 1 + 1 +1 2 +1

4+. . .+ 1 2k−1,

we have ek ≤sk = 3−1/2k−1. Thus the sequence (sk) is convergent and dominanting the sequence (ek). Hence, the sequence (ek) is convergent as well. The limite= limk→∞ek is theEuler number. The sequence (ek) is clearly computable and converges effectively toe, since|ek−e|<2−k for allk≥2.

The number eis irrational. Supposeeis rational withe=p/qin lowest terms. Then e−eq =k!/q for some numberkandq >2. Thus e−eq <(1/q!)·12 contradicting the previous equation.

The numerical value ofetruncated to 50 decimal places (sequence A001113 in OEIS) is 2.71828 18284 59045 23536 02874 71352 66249 77572 47093 69995. . . .

♦ Example 7.39.Letq6= 1. Consider thegeometric sequence (rk) given by

rk=

k−1X

m=0

qm= 1 +q+q2+. . .+qk−1.

Sinceq·rk−rk =qk−1, we obtainrk = (qk−1)/(q−1). If|q|<1, the sequence (rk) is convergent with the limitx= 1/(1−q); otherwise, it is divergent.

When q is rational, the sequence (rk) is clearly computable and converges effectively to x, since

|rk−x|=|qk/(q−1)| ≤2klog2q·2a, where a≥0 is the smallest number with 1−q≥2−a. ♦ Proposition 7.40.Letxbe a computable number. If x >0, then there is an effective procedure which proves this. Likewise for x <0. Ifx= 0, there is generally no effective procedure to show this.

Proof. Let xbe computable. Then xis the limit of a computable sequence (rk) of rationals with an effective modulus of convergencee(N).

Letx >0. Then the following procedure will eventually terminate and yield an effective proof that x >0:

ForN = 0,1,2, . . ., computee(N) andre(N) until anre(N) appears withre(N)>2−N.

Ifx >0, such anN must eventually occur. To see this, let 2−N < x/2. Then|re(N)−x| ≤2−N < x/2 impliesre(N)> x/2>2−N. Now if|re(N)−x| ≤2−N andre(N)>2−N, thenx >0.

Forx <0, the proof is similar. Forx= 0, see Proposition 7.55. ⊓⊔ Proposition 7.41 (Waiting Time). Let f be an injective enumerator of a recursively enumerable nonrecursive setA. Letw(n)denote the waiting time

w(n) = max{k|f(k)≤n}, n∈N0. (7.64) Then there is no monadic recursive functiong such that w(n)≤g(n)for alln.

Proof. Supposeg is a recursive function withw(n)≤g(n) for all n. Then the setAhas the following decision procedure and thus is recursive:

For each n∈N0, computef(k) for allk≤g(n). If one of these values isf(k) =n, thenn∈A;

otherwise,n6∈A.

7.6 Computable Numbers 93

To see this, letf(k) =nfor some k≤g(n). Then, by definition of the enumerator,n∈A. Otherwise, sinceg(n)≥w(n), we havef(k)6=n for allk≤w(n). Butw(n) provides the maximal value of k for whichf(k)≤n. Thus ifnhas not shown up as a value off(k) by the time w(n), then it never will. ⊓⊔ The notion of waiting time captures the idea that if the waiting time for an enumerator of a setAcould be effectively bounded, then there would be a decision procedure for this set (Figure 7.1).

0f(k0) f(k1) f(k2) n

Fig. 7.1.Waiting time.

Proposition 7.42 (Optimal Modulus of Convergence). Let f be an injective enumerator of a recursively enumerable nonrecursive set A, and let w=w(A)be the corresponding waiting time. Take the series

sk= Xk

m=0

2−f(m), k≥0, (7.65)

and letx= limk→∞sk. Define the optimal modulus of convergencee(N)as the smallest integer such that

k≥e(N) =⇒ (x−sk)≤2−N, k∈N0. (7.66) Thenw(N) =e(N).

Proof. For eachk∈N0,

x−sk= X

m=k+1

2−f(m).

The waiting timew(N) is the maximal valuekwithf(k)≤N and sof(w(N))≤N.

Supposek < w(N). Then the series (x−sk) contains the term form=w(N) with value 2−f(w(N))≥ 2−N. Since this series contains other positive terms,x−sk >2−N.

Supposek≥w(N). Then the series (x−sk) starting withm=k+ 1 contains no term 2−f(m)with f(m)≤N. Thus this series is dominated byP

m=N+12−m= 2−N and sox−sk ≤2−N.

Hence,w(N) satisfies exactly the condition by whiche(N) has been defined. ⊓⊔ Proposition 7.43.Let f be an injective enumerator of a recursively enumerable nonrecursive set A, and let(sk)be the computable sequence given as

sk= Xk

m=0

2−f(m), k≥0. (7.67)

Then the series(sk)converges noneffectively to its limit x= limk→∞sk.

94 7 Undecidability

Proof. By Example 7.39, the geometric series (rk) with rk = Pk

m=02−m converges with the limit 2. Since the function f is injective, the series (sk) is dominated by the series (rk) in the sense that 0≤sk ≤rk for allk∈N0and thus the series (sk) converges, too.

Suppose the convergence is effective. Then there is a recursive functione(N) such that k≥e(N) =⇒ (x−sk)≤2−N, k∈N0.

The optimal modulus of convergencee(N) satisfies by definitione(N)≥e(N). Moreover, by Proposi-tion 7.42,e(N) =w(N). Thus the recursive modulus function fulfillse(N)≥w(N), which is impossible by the Waiting lemma 7.41. Albeit the sequence (sk) is computable, the limitxis not computable since

the convergence is noneffective. ♦

Computable Sequences of Real Numbers

The main topic of this section are computable sequences of reals. For this, note that a sequence of computable reals (xn) may not be computable, even though each of its individual elements xn is.

Indeed, we might have a program for each n, but no way to combine these infinitely many programs into a single one.

The definition of a computable sequence of reals (xn) is based on a computable double sequence of rationals (rnk) which converges to (xn) as kapproaches ∞for each n, and this convergence must be effective. Technically, a double sequence (rnk) iscomputableif it is mapped onto a computable sequence (rl) by one of the standard recursive pairing functions such as the well-known Cantor pairing.

Let (xnk) be a double sequence of reals and (xn) be a sequence of reals such that as k → ∞, xnk → xn for eachn. Then the convergence xnk → xn is effective in k and n if there is a recursive functione:N20→N0 such that for alln, N∈N0,

k≥e(n, N) =⇒ |xnk−xn| ≤2−N, k∈N0. (7.68) There are two equivalent definitions of the notion of computability of a sequence of reals.

• A sequence of reals (xn) is computable if there is a computable double sequence of rationals (rnk) such that rnk→xn ask→ ∞, which is effective inkandn.

• A sequence of reals (xn) is computable if there is a computable double sequence of rationals (rnk) such that |rnk−xn| ≤2−k for allkandn.

Example 7.44.The double sequence of rationals (xnk) given by xnk= k

k+n+ 1, k, n∈N0, (7.69)

converges ask→ ∞to the sequence (xn) = (1,1,1, . . .). The convergence is effective ink andn, since for the modulus of convergencee(n, N) = (n+ 1)·2N we have|xnk−xn| ≤2−N for allk≥e(n, N).♦ Proposition 7.45.Let (xnk) be a computable double sequence of real numbers which converges as k→ ∞ to the sequence(xn)effectively ink andn. Then the sequence(xn)is computable.

7.6 Computable Numbers 95

Proof. Let (xnk) be a computable double sequence of real numbers. Then by definition there is a computable triple sequence of rationals (rnkN) such that

|rnkN −xnk| ≤2−N, n, k, N ∈N0. (7.70) Sincexnk→xn effectively ink andn, there is a recursive functione(n, N) such that

k≥e(n, N) =⇒ |xnk−xn| ≤2−N, k∈N0. (7.71) Then the computable double sequence of rationalssnN =rn,e(N),N satisfies by the triangular inequality,

|snN−xn| ≤ |snN −xnN|+|xnN−xn| ≤2·2−N. (7.72)

Hence, the sequence (xn) is computable. ⊓⊔

Proposition 7.46.Let(xnk)be a computable double sequence of real numbers which converges mono-tonically upwards as k→ ∞ to the sequence(xn), i.e., xn0≤xn1≤xn2≤. . . andxnk →xn for each n. Then the sequence(xn)is computable if and only if the convergence is effective in bothk andn.

Proof. Suppose the sequence (xn) converges effectively in bothkandn. Then by Proposition 7.45 the sequence (xn) is computable.

Suppose the sequence (xn) is computable. Then there is a computable double sequence of rationals (rnN) such that

|rnN−xn| ≤2−N/4, n, N∈N0.

Since the double sequence (xnk) is also computable, there is a computable triple sequence (rnkN) such that

|rnkN −xnk| ≤2−N/4, n, k, N ∈N0.

Define the dyadic recursive functione=e(n, N) to be the smallest indexksuch that

|rnkN−rnk| ≤ 3 2·2−N.

Such an indexkmust exist, since for largeN by the triangular inequality

|rnkN−rnk| ≤ |rnkN−xnk|+|rnN−xn|+|xnk−xn| ≤ 3 2 ·2−N.

This holds for allk≥e(n, N) and not only fork=e(n, N), since the sequence (xnk) is monotonous as a function ofk. Thuse(n, N) is an effective modulus of convergence for the limit processxnk→xn. ⊓⊔ Corollary 7.47.If a computable sequence of reals(xn)converges monotonically upwards to a limitx, then the numberxis computable if and only if the convergence is effective.

This assertion follows immediately from Proposition 7.46 by fixingn.

Corollary 7.48.There is a computable sequence of rationals which converges to a noncomputable real.

Proof. The computable sequence of rational numbers (sk) in Proposition 7.43 converges monotonically upwards to a limitx, but the convergence is not effective. Hence by Corollary 7.47, the limit xis not

computable. ⊓⊔

96 7 Undecidability

Proposition 7.49.Let (xn) and (yn) be computable sequences of real numbers. Then the following sequences are computable:

In particular, the set of computable reals forms a field

Proof. The computability of the sequences given by addition, subtraction, multiplication, and division follows from the definitions.

In view of the computability of the sequence (expxn), use the Taylor series expansion. For this, let snk=

Xk

m=0

xmn m!.

The double sequence (snk) is computable and converges to (expxn) as k → ∞, effectively in both k andn. Hence, by Proposition 7.45, the sequence (expxn) is computable.

The functions sinx, cosx, arcsinx, arccosx, arctanx, and arccotxcan be dealt with similarly by Taylor series expansions.

The functions logx and m√x require a bit more effort, since their Taylor series expansions have

limited domains of convergence. ⊓⊔

Example 7.50.The computability of arctanximplies the computability of the circle numberπ, since

π

4 = arctan 1. The numerical value ofπtruncated to 50 decimal places (sequence A000796 in OEIS) is 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510. . . .

♦ Example 7.51.Letf be an injective enumerator of a recursively enumerable nonrecursive setA. Take the computable double sequence (xnk) given by

xnk=

Thus the sequence (xn) describes the characteristic function ofA. However, the sequence (xn) is com-putable, since otherwise the setA would be recursive.

Albeit the sequence (xn) is not computable, its individual components are computable reals; they

are either 0 or 1. ♦

7.6 Computable Numbers 97

Example 7.52.Letf be an injective enumerator of a recursively enumerable nonrecursive setA. Take the computable double sequence (xnk) given by

xnk=

2−mifn=f(m) for somem≤k, 0 otherwise.

Then ask→ ∞,xnk→xn, where xn=

2−mifn=f(m) for somem, 0 ifn6∈A.

The convergence of (xnk) to (xn) is effective inkandn. To see this, we only need to consider the case xnk 6= xn which happens if n =f(m) for some m > k. Then xnk = 0 and xn = 2−m <2−k. Thus

|xnk−xn|<2−k for allkand n. Hence, by Proposition 7.45, the sequence (xn) is computable. ♦ The following results are consequences of the Examples 7.51 and 7.52.

Proposition 7.53.LetAbe a recursively enumerable nonrecursive set. Then there is a computable dou-ble sequence(xnk)which converges noneffectively to the characteristic function χA(n)ofA ask→ ∞. This follows from Example 7.51 by usingχ(n) instead ofxn.

Proposition 7.54.There is a computable double sequence (xnk) that converges to the sequence (xn) ask→ ∞ effectively ink but noneffectively inn.

This follows from Example 7.51. To see this, fix n. Then the convergence ofxnk → xn as k → ∞ is effective ink, sincexnk=xnfor all but finitely manyk. But the convergence is not effective inn, since otherwise by Proposition 7.45 the sequence (xn) would be computable.

Proposition 7.55.The condition x= 0 for computable reals cannot be decided effectively.

This follows from Example 7.52. The sequence (xn) considered there is computable, but the set {n∈ N0|xn= 0}which is equal to the set{n∈N0|n6∈A} cannot be effectively listed.

Proposition 7.56.There is a sequence of rationals(rn)that is computable as a sequence of reals, but not computable as a sequence of rationals.

This follows from Example 7.52. The sequence (xn) given there is computable, but (xn) is not com-putable as a sequence of rationals; i.e., the components cannot be expressed as xn = (−1)s(n)a(n)b(n) with recursive functionsa, b, s. If so, the conditionxn= 0 would be effectively decidable, which is not possible.

The computable real numbers form the basis of computable analysis, which deals with computability in classical analysis, mathematical physics, Hilbert and Banach spaces, bounded and unbounded linear operators, and other topics.

98 7 Undecidability