# Exact real arithmetic

(Difference between revisions)
Jump to: navigation, search
 Revision as of 10:17, 3 August 2006 (edit) (→Why, are there reals at all, which are defined exactly, but are not computable?: Writing on Chaitin's construct and John Tromp's combinatory logic-related article)← Previous diff Revision as of 10:47, 3 August 2006 (edit) (undo) (Decoding function can be made a total function: with Maybe)Next diff → Line 32: Line 32: Now, Chatin's construct will be here Now, Chatin's construct will be here - :$\sum_{p\in 2^*,\;\mathrm{hnf}\left(\mathrm{dc}\;p\right)} 2^{-\left|p\right|}$ + :$\sum_{p\in \mathrm{Rng}_\mathrm{dc},\;\mathrm{hnf}\left(\mathrm{dc}\;p\right)} 2^{-\left|p\right|}$ - where $\mathrm{hnf}$ should denote an unary predicate “has normal form” (“terminates”) and $\mathrm{dc}$ should mean an operator “decode” (from binary string into [[combinatory logic]] term), and $2\!\;^{*}$ should denote the set of all finite bit sequences. “Absolut value” should mean the length of a bit sequence (not [[combinatory logic]] term evaluation!) + where + ;$\mathrm{hnf}$ + :should denote an unary predicate “has normal form” (“terminates”) + ;$\mathrm{dc}$ + :should mean an operator “decode” (a function from bit finite bit sequences to [[combinatory logic]] terms) + ;$2\!\;^{*}$ + :should denote the set of all finite bit sequences + ;$\mathrm{Rng}_\mathrm{dc}$ + :should denote the range of decoding function, e.g. the syntactically correct bit sequences (semantically, they may either terminate or diverge), + ;“Absolut value” + :should mean the length of a bit sequence (not [[combinatory logic]] term evaluation!) + + Here, $\mathrm{dc}$ is a partial function (from finite bit sequences). If this is confusing, then we can choose a more Haskell-like approach, making $\mathrm{dc}$ a total function: + + dc :: [Bit] -> Maybe CL + + then, Chaitin's construct will be + :$\sum_{p\in 2^*,\;\mathrm{maybe}\;\downarrow\;\mathrm{hnf}\left(\mathrm{dc}\;p\right)} 2^{-\left|p\right|}$ + where $\downarrow$ should denote false truth value. == Theory == == Theory ==

## 1 Introduction

Exact real arithmetic is an interesting area: it is a deep connection between

• numeric methods
• and deep theoretic fondations of algorithms (and mathematics).

Its topic: computable real numbers raise a lot of interesting questions rooted in mathematical analysis, arithmetic, but also Computability theory (see numbers-as-programs approaches).

Computable reals can be achieved by many approaches -- it is not one single theory.

### 1.1 What it is not

Exact real arithmetic is not the same as fixed arbitrary precision reals (see Precision(n) of Yacas).

Exact reals must allow us to run a huge series of computations, prescribing only the precision of the end result. Intermediate computations, and determining their necessary precision must be achieved automatically, dynamically.

Maybe another problem, but it was that lead me to think on exact real arithmetic: using some Mandelbrot-plotting programs, the number of iterations must be prescribed by the user at the beginning. And when we zoom too deep into these Mandelbrot worlds, it will become ragged or smooth. Maybe solving this particular problem does not need necessarily the concept of exact real arithmetic, but it was the first time I began to think on such problems.

See other numeric algorithms at Libraries and tools/Mathematics.

### 1.2 Why, are there reals at all, which are defined exactly, but are not computable?

See Wikipedia article on Chaitin's construction, referring to e.g.

Some more direct relatedness to functional programming: we can base Ω on combinatory logic (instead of a Turing machine), see the prefix coding system dscribed in Binary Lambda Calculus and Combinatory Logic (page 20) written by John Tromp:

$\widehat{\mathbf S} \equiv 00$
$\widehat{\mathbf K} \equiv 01$
$\widehat{\left(x y\right)} \equiv 1 \widehat x \widehat y$

of course, c, d are metavariables, and also some other notations are changed slightly.

Now, Chatin's construct will be here

$\sum_{p\in \mathrm{Rng}_\mathrm{dc},\;\mathrm{hnf}\left(\mathrm{dc}\;p\right)} 2^{-\left|p\right|}$

where

hnf
should denote an unary predicate “has normal form” (“terminates”)
dc
should mean an operator “decode” (a function from bit finite bit sequences to combinatory logic terms)
$2\!\;^{*}$
should denote the set of all finite bit sequences
Rngdc
should denote the range of decoding function, e.g. the syntactically correct bit sequences (semantically, they may either terminate or diverge),
“Absolut value”
should mean the length of a bit sequence (not combinatory logic term evaluation!)

Here, dc is a partial function (from finite bit sequences). If this is confusing, then we can choose a more Haskell-like approach, making dc a total function:

dc :: [Bit] -> Maybe CL

then, Chaitin's construct will be

$\sum_{p\in 2^*,\;\mathrm{maybe}\;\downarrow\;\mathrm{hnf}\left(\mathrm{dc}\;p\right)} 2^{-\left|p\right|}$

where $\downarrow$ should denote false truth value.

## 2 Theory

Jean Vuillemin's Exact real computer arithmetic with continued fractions is very good article on the topic itself. It can serve also as a good introductory article, too, because it presents the connections to both mathematical analysis and Computability theory. It discusses several methods, and it describes some of them in more details.

Martín Escardó's project A Calculator for Exact Real Number Computation -- its chosen functional language is Haskell, mainly because of its purity, lazyness, presence of lazy lists, pattern matching.

Martín Escardó has many exact real arithetic materials also among his many papers.

## 3 Portal-like homepages

### 3.1 Exact Computation

There are functional programming materials too, even with downloadable Haskell source.

### 3.2 ExactRealArithmetic

This HaWiki article provides links to many implementations.