A Coinductive Approach to Computing with Compact Sets

Exact representations of real numbers such as the signed digit representation or more generally linear fractional representations or the infinite Gray code represent real numbers as infinite streams of digits. In earlier work by the first author it was shown how to extract certified algorithms working with the signed digit representations from constructive proofs. In this paper we lay the foundation for doing a similar thing with nonempty compact sets. It turns out that a representation by streams of finitely many digits is impossible and instead trees are needed.


Introduction
Digital representations of real numbers have been widely studied in the literature. Probably best known is the signed digit representation as considered in Ciaffaglione and Di Gianantonio [7], Escardó and Marcel-Romero [12] Berger and Hou [4] and many others, where a real number in [−1, 1] is represented by a stream of signed digits −1, 0, 1, a digit d representing the mapping x → (x+d)/2. This has been generalized to linear fractional representations studied in Edalat and Sünderhauf [11] as well as Edalat and Heckmann [9] where digits represent maps of the form x → (ax + b)/(cx + d).
A variant of the signed digit representation is the infinite Gray code introduced by Tsuiki [14] which represents real numbers in [−1, 1] by a binary stream with possibly one undefined entry. The infinite Gray code has the remarkable property that it is non-redundant, that is, every real has exactly one code.
Berger [2] showed how to use the method of program extraction from proofs (see eg Schwichtenberg and Wainer [13]) to extract certified algorithms working with the signed digit representations. In this paper we lay the foundation for doing a similar thing with nonempty compact sets.
In the first part of the paper (Section 2 to Section 5) we develop our approach in the style of classical mathematics speaking explicitly about representations. In Section 2 we generalize the signed digit representation to digit spaces (X, D), that is, we replace the interval [−1, 1] by a complete bounded metric space X and the signed digits by a finite set D of contractions whose images cover X . In Section 3 and Section 4 we introduce the hyper-space of nonempty compact sets and develop a representation of compact sets by non-wellfounded trees of digits, after having shown that in most situations a representation by streams of digits is impossible. In Section 5 we compare the notion of computability for compact sets generated by our tree representation with those studied by Brattka and Presser [6].
In the second part (Section 6 to Section 8) we recast the approach constructively in a representation free way. We introduce a coinductive predicate on the powerset of X whose realizers are trees representing nonempty compact subsets of X generalizing the coinductive approach to the signed digit representation studied by Berger [2]. We sketch how this approach can be used to extract programs computing with compact sets from constructive proofs and comment on the relation to iterated function systems as studied by Edalat [8]. The Cantor set is considered as an example. Lemma 2. 6 Let d ∈ D n . Then, for every x ∈ d [X], there is some α ∈ D ω with α <n = d and [[α]] = x.
Proof Let x ∈ d[X] and let y ∈ X such that x = d(y). By the covering property of D, there exist e ∈ D and z ∈ X such that y = e(z). Hence x = ( de)(z), in particular x ∈ ( de) [X]. By dependent choice, there is some α ∈ D ω with α <n = d and x ∈ α <m [X] for all m ≥ n, hence [[α]] = x.
In words, there exists a natural number m such that for all sequences α and β in D ω the first m elements of which coincide, if [ Thus, Claim 1 is proven.
Let m be as in Claim 1 and set E :

Compact sets and the Hausdorff metric
We start this section by deriving some facts about metric digit spaces needed in the sequel.
Definition 3.1 Let (X, µ) be a metric space and ε ∈ R + . Then a subset E of X is an ε-chain if µ(x, y) ≥ ε, for all x, y ∈ E such that x = y.
Moreover, let q be a uniform contraction factor for all digits in D. Then the size of every q n · M -chain in X is bounded by D n .
Proof Let E be a q n · M -chain in X . Because of the covering property we have that Since M is a bound of X , we have that µ(x ′ , y ′ ) ≤ M . On the other hand, µ(x, y) ≥ q n · M , as E is a q n · M -chain. With (3) it thus follows that q n · M < q n · M , a contradiction.
For a metric space (X, µ) we denote by K(X) the set of nonempty compact subsets of X . The Hausdorff metric, µ H , on K(X) is defined by the formula The subsequent properties are often useful. Let to this end µ(A, y) := inf x∈A µ(x, y) and µ A (B) := sup y∈B µ(A, y). Lemma 3.3 For x, y ∈ X , A, A ′ , B, B ′ ∈ K(X) and a contraction d : X → X the following statements hold: Note that K(X) has the same bound M as X . Moreover, it is well-known that K(X) inherits completeness and compactness from X . However, we cannot expect K(X) to have a finite covering system of contractions as we show in the following.
Lemma 3.4 Let (X, µ) be a bounded metric space and ε ∈ R + . If X has an ε-chain E of size m, then K(X) has an ε-chain of size 2 m − 1.
Proof Let M be a bound of X , D be the set of digits of K(X) of size k and q be a uniform contraction factor of the digits in D. If E ′ is a q m · M -chain in X , it follows with Lemma 3.4 that K(X) has a q m · M -chain of size 2 E ′ − 1. By Lemma 3.2 we therefore have that 2 E ′ ≤ k m + 1 ≤ k m+1 . Thus, Now, let E be a 2 −n -chain in X and m = ⌊ It follows that E is a q m · M -chain as well. Therefore, by the above: Lemma 3.6 Let X be a non-trivial bounded and convex subset of a normed linear space. Then there cannot be finitely many contractions on K(X) that cover K(X).
Proof Let x, y be different elements of X . Hence ||x − y|| ≥ 2 −n 0 for some n 0 ∈ N + . Let n ∈ N + and set Then E n ⊆ X is a 2 −(n 0 +n) -chain, since for ν = ν ′ we have that: Now, assume that K(X) has a finite system of digits. By Corollary 3.5 there are constants c 1 , c 2 ∈ R + (independent of n) such that: On the other hand, E n = 2 n + 1, which is a contradiction for large enough n.

Representation of compact sets by trees
Since, according to Lemma 3.6, it will in most cases be impossible to turn K(X) into a digit space, we consider a representation of compact sets by trees (instead of streams) of digits of the original digit space (X, D). Note that each such tree is finitely branching as D is finite. Moreover, every element [d 0 , . . . , d n−1 ] ∈ T can be continued to an infinite path α in T , that is, α ∈ D ω is such that α i = d i , for i < n, and [α 0 , . . . , α k−1 ] ∈ T for all k ∈ N. In the following we write α ∈ T to mean that α is a path in T and by a path we always mean an infinite path.
Let T D denote the set of digital trees with digits in D and for T ∈ T D and n ≥ 0, let T ≤n be the finite initial subtree of T of height n. Then: Every such initial subtree defines a map f T,n : X → P(X) from X into the powerset of X in the obvious way: .
Note that this interpretation of a digital tree corresponds to the IFS-tree of an iterated function system in Edalat [8].
Let T be a digital tree and α be an infinite path not lying in T . Then there is a finite initial segment α <n of α that is not contained in T , since as explained above, a path is identified with the sequence of its finite initial segments. Because T is closed under taking initial segments, for all infinite continuations β of α <n we have that β ∈ T as well. Thus, D ω \ T is open in the metric topology on D ω .

Lemma 4.5
For any digital tree the set of its infinite paths is closed in D ω .
Obviously, the set of infinite paths of a tree is nonempty. Conversely, let C be a nonempty closed subset of D ω and T C := { α <n | α ∈ C ∧ n ∈ N } . Obviously, T C is a digital tree. Lemma 4.6 Let C be a nonempty closed subset of D ω . Then the sequences in C are exactly the paths of T C .
Proof Clearly, every element of C is a path in T C . Conversely, if β is a path in T C , then its initial segment of length n is of the form α <n for some α ∈ C . Hence β has distance 2 −n from α. It follows that β is in the closure of C , hence in C .
As we have already seen in Corollary 2.8 and Lemma 2.9, the compact subsets of X are exactly the images of the compact subsets in D ω under [[·]]. Thus, we have the following result.

Lemma 4.7
The nonempty compact subsets of a digit space (X, D) are exactly the values of digital trees.
The metric defined on D ω in Section 2 can be transferred to T D . As we will see next, it coincides with the Hausdorff metric.
Proof (1) Ontoness is a consequence of Lemma 4.7. For the verification of uniform continuity let S, T ∈ T D , α ∈ S and β ∈ T . With Inequality (2) we have that Similarly, we obtain that also from which the uniform continuity of [[·]] follows.
(2) The statement follows by a straightforward adaption of the proof of Proposition 2.7(2).

Computably compact sets
The purpose of the present paper is to provide a logic-based approach to computing with continuous data. In this section we compare it with Weihrauch's Type-Two Theory of Effectivity [15].

Definition 5.1 (Brattka and Presser
the elements of which are called basic elements. is the Gödel number of a computable function g so that (σ Q (g(n))) n∈N is a Cauchy sequence of rationals converging to µ(u i , u j ). In what follows we will work with finite objects such as basic elements, finite sets of basic elements, digits or finite sequences of digits directly as in the above definition and leave it to the reader to make the statements precise, if wanted. Note that by doing so we identify a digit d with the letter d.
if it has a computable modulus of continuity and there is a procedure g Φ which given As is easily verified, the set of all computable maps on X is closed under composition.

Definition 5.3
Let (X, D) be a digit space such that the underlying metric space (X, µ) has a countable dense subset Q with respect to which it is computable. (X, D, Q) is said to be a computable digit space if, in addition, all digits d ∈ D are computable.
Besides Q, computable digit spaces possess other canonical dense subspaces. For We want to show that Q and Q D are effectively equivalent in the sense that given u ∈ Q and n ∈ N we can compute a sequence d ∈ D <ω such that µ(u, d(x 0 )) < 2 −n , and that similarly there is a computable function g : N × D <ω → Q with: To do so, some more requirements have to be satisfied.
Lemma 5.5 Let (X, D) be a well-covering digit space. Then there exists ε ∈ Q + such that for every Proof Assume the contrary. Then for every n ∈ N there exists x n ∈ X such that Each ε ∈ Q + as in the preceding lemma will be called a well-covering number.
(2) constructively dense if there is a procedure that given θ ∈ Q + , d ∈ D and Lemma 5.7 Let (X, D, Q) be a well-covering, decidable and constructively dense digit space. Then, for every u ∈ Q and n ∈ N a sequence d of digits can effectively be found such that µ(u, d(x 0 )) < 2 −n .
Proof Let ε be a well-covering number for (X, D) and set Given u ∈ Q and n ∈ N, proceed as follows: increase i by 1 and go to (2).
(2) Assume that e has been computed so far. Use the decidabilty of (X, D, Q) to increase i by 1 and go to (2).
Proof Since x 0 ∈ A eff , there is a procedure f which on input n ∈ N computes a basic element u ∈ Q with µ(x 0 , u) < 2 −n . Now, define h by recursion on d: output the result of procedure f on input n. Otherwise, assume that d = e e and that the result of h on input e and n + 1 is u ∈ Q. Then output the result of applying g e to input u and n + 1.
Summing up we obtain the following result.

Proposition 5.9
Let (X, D, Q) be a well-covering, decidable and constructively dense digit space. Then the topological bases Q and Q D are effectively equivalent.
Denote the set of all computable elements of X by X c .
Let x ∈ X be computable and let this be witnessed by α ∈ D ω . With Lemma 2.6 and (1) we obtain that µ(x, α <n (x 0 )) ≤ q n · M . Set and assume that (X, D, Q) is computable. By Lemma 5.8, for any given n, we can This shows that X c ⊆ A eff . The converse implication will be a consequence of Theorem 8.2 derived later in a constructive fashion. To this end a further condition is needed.
Obviously, every computable digit space with approximable choice is constructively dense.

Proposition 5.12
Let (X, D, Q) be a well-covering and decidable computable digit space with approximable choice. Then X c = A eff .
Proposition 5.13 A computable digit space (X, D, Q) has approximable choice if, and only if, every d ∈ D has a computable right inverse.
Proof Assume that (X, D, Q) has approximable choice and let d ∈ D and x ∈ range(d). Because of density there is some Use approximable choice to pick the function λ(θ, u).v θ u . For θ n := 2 −n−4 , pick θ ′ ∈ Q + according to approximable choice, part (2). Let N n ≥ 0 such that µ(x, u m ) < θ ′ /3, for m ≥ N n . Without restriction let N n be such that N n ≥ N i , for all i < n. Set v n := v θn u Nn . By approximable choice, part (3), there is some z n ∈ d −1 [u Nn ] with µ(z n , v n ) < θ n . Because of the assumption on N n , we have that µ(u Nm , u Nn ) < θ ′ , for m ≥ n. Hence, µ(v m , v n ) < θ n . It follows that µ(z m , z n ) < 3θ n < 2 −n . Thus, (z n ) n∈N is a fast Cauchy sequence. Since (X, µ) is complete, it converges to some y (um) ∈ X . As d is continuous, we obtain that It follows that µ(z n , z ′ n ) < 3θ n and thus µ(y (um) , y (u ′ m ) ) < 9θ n < 2 −n . For x = x ′ , we obtain that y (um) = y (u ′ m ) , ie y does not depend on the choice of the approximating sequence (u m ) m∈N . Define d ′ (x) := y. By what we have just shown, d ′ is uniformly continuous with computable modulus of continuity.
Since d ′ is computable, we can compute for any given u ∈ Q ∩ range(d) and n ∈ N a basic element v ∈ Q so that µ . It remains to verify the conditions in Definition 5.11 of having approximable choice: (2) As d ′ has a computable modulus of continuity, for given θ ∈ Q + we can compute a θ ′ ∈ Q + such that for u, In Type-Two Theory of Effectivity an element x ∈ X is defined to be computable, if it is contained in A eff . So, it follows that both computability notions coincide. In the present approach elements of X are represented by infinite streams of digits. In Type-Two Theory of Effectivity, similarly, an element x is represented by an infinite sequence (u i ) i∈N of basic elements with µ(x, u n ) < 2 −n . The resulting representation is called the Cauchy representation ρ C . As follows from the proofs leading to the preceding proposition, one can computably pass from an infinite stream α of digits to an infinite sequence of basic elements (u i ) i∈N so that µ([[α]], u n ) < 2 −n , and vice versa. This means that there are computable translations between both representations as summarized by the next result.
Theorem 5.14 Let (X, D, Q) be a well-covering and decidable computable digit space with approximable choice. Then there are computable operators F : D ω → Q ω and G : Q ω ⇀ D ω such that for α ∈ D ω and w ∈ dom(G), Let us next start an analogous investigation for compact sets. As has already been mentioned, (K(X), µ H ) is a complete compact metric space. It has a canonical dense subset, the set Q := P + fin (Q), the elements of which we will call basic sets. If (X, µ, Q) is computable the same holds for (K(X), µ H , Q) (see Brattka [5]).
So, every nonempty compact set is the limit of a fast Cauchy sequence of basic sets with respect to the Hausdorff metric. Brattka and Presser [6] call the resulting representation η H of K(X) the Hausdorff representation. Proof Let T ∈ T D , α ∈ T and n ∈ N. Moreover, let the computable map h : D <ω × N → Q be as in Lemma 5.8. Then we have that for m ≥ n. Thus, µ(h(α <(n+2) , n + 2), h(α <(m+2) , m + 2)) < 2 −n .
On the other hand, if u ∈ C n , then u = h(γ <(n+2) , n + 2), for some γ ∈ T . Since As a consequence of Theorem 8.4, also the converse holds: given an infinite word in Σ ω representing a nonempty compact set K , one can compute a digital tree with value K . It follows that we can effectively translate representations of compact sets in Type-Two Theory of Effectivity into representations in our setting, and vice versa.

Definition 5.17
Let (X, D) be a digit space. A set K ∈ K(X) is computable if it is the value of computable digital tree. Denote the set of computable compact sets by K(X) c .
In Type-Two Theory of Effectivity a compact set is computable if it is contained in A eff K , where: A eff K := { K ∈ K(X) | there is a procedure that given n ∈ N computes a basic set U ∈ Q with µ H (K, U) < 2 −n } With the preceding theorem we obtain that both notions coincide.

Corollary 5.18
Let (X, D, Q) be a well-covering and decidable computable digit space with approximable choice. Then K(X) c = A eff K .

Extracting digital trees from coinductive proofs
In this section we recast the theory of digit spaces and their hyper-spaces in a constructive setting with the aim to extract programs that provide effective representations of certain objects or transformations between different representations. One of the main results will be effective transformations between the Cauchy-Hausdorff representation and the digital tree representation of the hyper-space showing that the two representations are effectively equivalent. The method of program extraction will be based on a version of realizability, and the main constructive definition and proof principle will be coinduction. The advantage of the constructive approach lies in the fact that proofs can be carried out in a representation-free way. Constructive logic and the Soundness Theorem guarantee automatically that proofs are witnessed by effective and provably correct transformations on the level of representations.
Regarding the theory of realizability and its applications to constructive analysis we refer the reader to Schwichtenberg and Wainer [13], Berger and Seisenberger [3] and Berger [2]. Here, we only recall the main facts. We work in many-sorted first-order logic extended by the formation of inductive and coinductive predicates. Realizability assigns to each formula A a unary predicate R(A) to be thought of as the set of realizers of A. Instead of R(A)(a) one often writes a r A ("a realizes A"). The realizers a can be typed or untyped, but for the understanding of the following, details about the nature of realizers are irrelevant. It suffices to think of them as being (idealized, but executable) functional programs or (Oracle-)Turing machines. The crucial clauses of realizability for the propositional connectives are: Hence, an implication is realized by a function and a conjunction is realized by a pair (accessed by left and right projections, p 0 (.), p 1 (.)).
Quantifiers are treated uniformly in our version of realizability: This reflects the fact we allow variables x to range over abstract mathematical objects without prescribed computational meaning. Therefore, the usual interpretation of a r (∀x A(x)) to mean ∀x a(x) r A(x) doesn't make sense since we would use the abstract object x as an input to the program a.
For atomic formulas P( t), where P is a predicate and t are terms, realizability is defined in terms of a chosen predicate P with on extra argument place, that is, a r P( t) := P(a, t).
The choice of the predicates P allows us to fine tune the computational content of proofs.
So far, we have covered first-order logic. Now we explain how inductive and coinductive definitions are realized. An inductively define predicate P is defined as the least fixed point of a monotone predicate transformer Φ(X, x), that is the formula , with free predicate variables X and Y , must be provable. Then we have the closure axiom as well as the induction schema for every predicate A defined by some formula A( x) as A( x) ↔ A( x). Realizability for P is defined by defining P inductively by the operator Φ(X, a, x) := a r Φ(X, x). This means we have the closure axiom ∀a, x(a r Φ(P, x) → P(a, x)) as well as the induction schema: ∀a, x(a r Φ(A, a, x) → A(a, x)) → ∀a, x( P(a, x) → A(a, x)) Dually, Φ also gives rise to a coinductively defined predicate Q defined as the greatest fixed point of Φ. Hence, we have the coclosure axiom and the coinduction schema: Realizability for Q is defined by defining Q coinductively by the same operator Φ as above, hence, the coclosure axiom and the coinduction schema: The basis for program extraction from proofs is the Soundness Theorem.
Soundness Theorem From a constructive proof of a formula A from assumptions B 1 , . . . , B n one can extract a program M(a 1 , . . . , a n ) such that M(a 1 , . . . , a n ) r A is provable from the assumptions a 1 r B 1 , . . . , a n r B n .
If one wants to apply this theorem to obtain a program realizing the formula A one must provide terms K 1 , . . . , K n realizing the assumptions B 1 , . . . , B n . Then it follows that the term M(K 1 , . . . , K n ) realizes A. We can simplify the definition of realizability for formulas with non-computational parts: If A is non-computable, then: Non-computational formulas can simplify program extraction drastically. Therefore, it is important to have handy criteria for recognizing non-computable formulas. First of all, realizability, and hence the question which formulas are non-computable, depends on how the predicates P, defining realizability of atomic formulas P( t), are axiomatized. We call a predicate P non-computational if the axiom for P is: Now, clearly, P( t) is non-computable, if P is non-computable. Furthermore, ⊥ is non-computable and it is easy to see that the set of non-computable formulas is closed under implication, conjunction and universal and existential quantification. Moreover, if A is a faithful formula, that is, then A → B is non-computable, provided B is non-computable. In particular, the negation of a faithful formula is non-computable. Clearly, every non-computable formula is faithful and it is easy to see that the set of faithful formulas is closed under conjunction, disjunction and existential quantification.
In our formalization and realizability interpretation of the theory of real numbers and digit spaces, we regard the set R of real numbers as well as the carrier set X of an arbitrary but fixed metric space (X, µ) as sorts. All arithmetic constants and functions we wish to talk about as well as the metric µ are admitted as constants or function symbols. We declare the predicates =, < and ≤ on R as non-computational. Furthermore, we admit all true non-computable statements about real numbers as well as the axioms of a metric space (which are non-computable formulas) as axioms in our formalization.
In order to be able to formalize a digit space (X, D) and the hyper-space K(X) we add to every sort s its powersort P(s), equipped with a non-computational element-hood relation ǫ, as well as a function space sort s → t to any two sorts r and t, equipped with an application operation and operations such as composition and the like. Furthermore, we add for every non-computable formula A(x) the comprehension axiom ∃u ∀x (xǫu ↔ A(x)) (A(x) may contain other free variables than x). We will use the notation { x | A(x) } for the element u of sort P(s) whose existence is postulated in the comprehension axiom above. Hence, we can define the empty set ∅ : The comprehension axiom above is an example of an non-computable formula which we wish to accept as true. In general, we may admit any non-computable formula as axiom which is true in an intended model or provable in some accepted theory (which may be classical).
Our first example of an inductive definition is the predicate P fin of finite subsets of a predicate P P fin (∅) If P fin (v) and P(x), then P fin (v ∪ {x}) (Here v is a variable of sort P(s) and x is a variable of sort s). More formally, P fin is defined as the least fixed point of the operator: Above, we may view ∅ and ∪ as a new constant and function symbol, or else eliminate them with the usual technique (as in set theory).
The next example is a coinductive predicate that generalizes a corresponding definition of a predicate C 0 on the signed digit space (I, AV) introduced in Berger [2] and Berger and Seisenberger [3]. Definition 6.1 Let (X, D) be a digit space. We define coinductively C 0 as the largest subset of X such that for all x ∈ X : x ∈ C 0 ⇒ ∃d ∈ D ∃y ∈ C 0 x = d(y) Proof By definition, C 0 ⊆ X . For the proof of the converse inclusion it suffices to observe that because of Proposition 2.7(1) and Lemma 2.5 the defining implication of C 0 remains correct if C 0 is replaced by X .
Hence, classically, the set C 0 is rather uninteresting, but, constructively, it is significant, since from a constructive proof that x ∈ C 0 one can extract a stream of signed digits α such that x = [[α]]. Furthermore, as shown by Berger [2], in the case of the signed digit (I, AV), one can extract from a constructive proof that C 0 is closed under, say, multiplication, a program for multiplication with respect to the signed digit representation.
In this paper we investigate whether what was done for the points of I can be done in a similar way for the nonempty compact subsets of I, (or, more generally, for the nonempty compact subsets of the underlying space X of a digit space (X, D)).

Definition 6.3
Given a digit space (X, D), we define, coinductively, the set C K as the largest subset of K(X) such that: Proof By definition, C K ⊆ K(X). The converse inclusion follows by coinduction, since the implication in the above statement holds by Lemma 4.7 and Corollary 4.4.
The proof of Lemma 6.4 is classical because the set E cannot be computed since, in general, one cannot decide whether d[X] ∩ A = ∅. The significance of the definition of C K stems from the fact that the realizers of a statement A ∈ C K are exactly the digital trees representing A, as we will show below. It follows from the definition of realizability in Berger [2] that the type τ of realizers of a statement A ∈ C K is defined by the recursive type equation where P + (D) is the set of nonempty subsets of D and E is the cardinality of E . Using constructive terminology one would call P + (D) the set of decidable inhabited subsets of D; since D is finite this set is finite as well and its cardinality exists constructively. For example, if D has three elements i, j, k, then: One sees that τ is, essentially, the set T D of digital trees. Indeed, every digital tree T can be identified with the pair (E T ,

and [[dα]] = d([[α]])).
What it means for a digital tree T to realize that A ∈ C K , written T r (A ∈ C K ), is defined coinductively as the largest subset · r · of T D × K(X) such that if T r (A ∈ C K ), then: Theorem 6. 5 The realizers of a statement A ∈ C K are exactly the digital trees representing A, that is: In particular, from a constructive proof of A ∈ C K one can extract a digital tree representation of A.
by induction on n, where M is a bound for X and q < 1 is a common contraction factor for the digits in D. The case n = 0 is trivial. For the step we assume T r (A ∈ C K ) and

Extracting the Cantor Set
As an example, we prove that the Cantor set lies in C K and extract a program that computes a digital tree representation of it. Of course, in this example, the digit space under discussion is the signed digit space (I, AV) which was introduced in Sect. 2. For convenience, we consider a scaled version of the Cantor set that fits better with the signed digits. Therefore, we define the Cantor set C as the fractal defined by the contractions: More precisely, C is the unique attractor of the iterated function system (IFS) {f − , f + } and can be defined explicitly as . Intuitively, this means that we start with the interval I, remove the open middle third and repeat the process with the remaining parts 1 . The only facts we will be using about the set C are that it is a nonempty subset of I and a fixed point of F . In order to show that C ∈ C K we show more generally, by coinduction that the set is a subset of C K . By the definition of C K we have to show: Since all elements of C ′ are nonempty subsets of I (since C is nonempty), this amounts to showing that for every rational palm h with h[I] ⊆ I we can find a set E ⊆ {−1, 0, 1} and rational palms h i (i ∈ E ) with h i [I] ⊆ I such that: Using the fact that C is a fixed point of F , ie we obtain: Furthermore, by the choice of i, j, we have, as required, To determine i, note that Consider the case a ≤ −1/2. Then we have v ≤ 1/4, since if v > 1/4 we would have u = v−a > 3/4 and therefore b = v+u > 1. It follows that v−u/3 = (2v+a)/3 ≤ 0. This means that we can take i = −1. In the case a ≥ −1/2 we can take i = 0 since v − u/3 ≤ v ≤ 1/2 (if v > 1/2 we would have u = v − a ≥ v > 1/2 and therefore b > 1). The calculation of j is symmetric: if b ≥ 1/2, we can take j = 1, otherwise j = 0.

Equivalence with the Cauchy representation
Let (X, D, Q) be a computable digit space. We define the predicate A ⊆ X by: is a fast Cauchy sequence in Q converging to x.
Proof Because of Lemma 5.8 it suffices to show that ∀n ∈ N ∀x ∈ X (C 0 (x) ⇒ ∃u ∈ Q D µ(x, u) ≤ M · q n ), which will be done by induction on n. If n = 0, let u be any element in Q D . For n + 1, assume x ∈ C 0 . Then there are d ∈ D and y ∈ C 0 such that x = d(y). By induction hypothesis, there exists v ∈ Q D such that µ(y, v) ≤ M · q n . Set u : Theorem 8.2 Let (X, D, Q) be a well-covering and decidable computable digit space with approximable choice. Then A ⊆ C 0 .
Proof We prove the statement by coinduction. Hence assume A(x). We have to find d ∈ D and y ∈ X such that x = d(y) and A(y). Let ε ∈ Q + be a well-covering number. Using A(x), pickû ∈ Q such that µ(x,û) < ε/2. Pick d ∈ D such that B µ (û, ε) ⊆ d [X]. Then x ∈ B µ (û, ε).
By Proposition 5.13, d has a computable right inverse d ′ . Set y := d ′ (x). Since d ′ has a computable modulus of continuity, we can, given n ∈ N, compute a number k(n) so that for Using the assumption A(x) again, we find u ∈ Q such that µ(x, u) < 2 −k(n) . It follows that µ(d ′ (x), d ′ (u))) < 2 −n−1 . By the computability of d ′ we can moreover compute a basic element v ∈ Q with µ(d ′ (u), v) < 2 −n−1 . Hence, µ(y, v) < 2 −n , which shows that A(y). Now we do for the hyper-space K(X) what we did for X above. We define the predicate A K ⊆ K(X) by: A K (A) ≡ ∀n ∈ N ∃U ∈ P + fin (Q) µ H (A, U) < 2 −n A realizer of A K (A) is a fast Cauchy sequence of nonempty finite subsets of Q converging to A.
Proof We show ∀n ∈ N ∀A ∈ K(X) (C K (A) ⇒ ∃U ∈ P + fin (Q) µ H (A, U) ≤ M · q n ), by induction on n. If n = 0, we can take U := {u}, for any u ∈ Q. For n + 1, assume A ∈ C K . Then there are E ⊆ D and a family ( Theorem 8.4 Let (X, D, Q) be a well-covering and decidable computable digit space with approximable choice. Then A K ⊆ C K .
The proof will be based on a sequence of intermediate results.
We say that (X, D, Q) has property (P) if the following holds: For every K ∈ K(X) and every sequence (C n ) n∈N of basic sets with µ H (C n , K) < 2 −n for all n, one can compute from (C n ) -a decision procedure for a set E of digits in D, In terms of realizers this means: for every set K ∈ K(X) and every sequence (C n ) of basic sets with µ H (C n , K) < 2 −n for all n, one can compute from (C n ) a digital tree T such that [[T]] = K . Proof Immediate, by coinduction.
Alternatively, one can directly define a decision procedure for a tree defining a set K ∈ K(X) from a Cauchy-sequence of basic sets converging to K . To this end, assume that µ H (K, C n ) < 2 −n for all n ∈ N where the C n are basic sets. We define a function where K 0 (X) is the set of basic sets and * is a new symbol meaning intuitively "not in the tree". The definition of t( d) is by recursion on d and will be such that whenever t( d) = (K ′ , (C ′ n ) n∈N ), then µ H (K ′ , C ′ n ) < 2 −n for all n ∈ N. Conversely, let x ∈ K . We define recursively α ∈ D ω , such that for all m ∈ N, t(α <m ) = * , hence t(α <m ) is of the form (K m , . . .) and x ∈ α <m [K m ]. It follows then that α ∈ T and x = [[α]]. For m = 0 there is nothing to define since t(α <0 ) = t([]) = (K, . . .) and x ∈ K , by assumption. Now suppose α <m has been defined such that t(α <m ) = (K m , . . .) and x ∈ α <m [K m ]. Let y ∈ K m such that x = α <m (y). By the definition of t, we have a set E ⊆ D such that α <m d ∈ T exactly if d ∈ E , as well as K m = d∈E d[K d ] for some K d ∈ K(X) such that for d ∈ E , t(α <n d) = (K d , . . .). Hence y ∈ d[K d ] for some d ∈ E . Set α(m) := d and K m+1 := K d . It follows that t(α <m+1 ) is of the form (K m+1 , . . .) and x ∈ α <m+1 [K m+1 ]. Lemma 8.6 Let (X, µ) be a compact metric space. Let K ∈ K(X) and C n ∈ K(X) such that µ H (K, C n ) ≤ 2 −n for all n ∈ N.
(a) For x ∈ X the following are equivalent: (i) x ∈ K (ii) ∀n ∈ N ∃y ∈ C n µ(x, y) < 2 −n (iii) ∀n ∈ N ∃k ≥ n ∃y ∈ C k µ(x, y) < 2 −n (b) Let K ′ ∈ K(X) and C ′ n ∈ K(X) such that µ H (K ′ , C ′ n ) ≤ 2 −n for all n ∈ N. If for every n ∈ N there exists k ≥ n with C ′ n ⊆ C k , then K ′ ⊆ K .
Proof (a) The implications from (i) to (ii) and from (ii) to (iii) are trivial. Assume (iii) holds. For every n ∈ N let k n ≥ n and y n ∈ C kn such that µ(x, y n ) < 2 −n (using assumption (iii)) and also let x n ∈ K such that µ(y n , x n ) < 2 −kn (using the hypothesis that µ H (K, C kn ) ≤ 2 −kn ). It follows µ(x, x n ) ≤ 2 −n + 2 −kn ≤ 2 1−n . Hence x is a limit of points in K and therefore in K, since K is closed.
(b) Let x ∈ K ′ . From the assumptions it easily follows that condition (iii) of part (a) holds. Therefore x ∈ K . Lemma 8.7 Let (X, µ) be a compact metric space with dense subset Q. Let D be a finite index set and X d a nonempty closed subset of X for each d ∈ D. Assume that the X d well-cover X , ie there exists a rational ε > 0 such that for each x ∈ X there exists d ∈ D with B µ (x, ε) ⊆ X d .
Let K ∈ K(X) and (C n ) n∈N a family of basic sets such that µ H (K, C n ) ≤ 2 −n for all n ∈ N.
Then there exists E ⊆ D and for each d ∈ E a set K d ∈ K(X) and a family of basic sets (C d n ) n∈N such that: -C d n ⊆ X d for all d ∈ E and n ∈ N µ H (K d , C d n ) ≤ 2 −n for all n ∈ N -K d ⊆ X d for all d ∈ E -d∈E K d = K Moreover, if X is a computable metric space such that for y ∈ Q, ρ ∈ Q and d ∈ D one can decide whether B µ (y, ρ) ⊆ X d , then from ε and (C n ) n∈N one can compute the families (C d n ) n∈N as well as a decision procedure for E .
Claim 3 For all d ∈ E and n ∈ N, C d n is a basic set and µ H (C d n , C d n+1 ) ≤ 2 1−(m+n) .
Proof: For the sets C d n to be basic, it suffices to show their nonemptyness, since, by definition, they are finite subsets of Q. Nonemptyness follows by induction on n using Claim 2 and observing that C d 0 is nonempty, by definition. The inequality µ H (C d n , C d n+1 ) ≤ 2 1−(m+n) follows from Claim 2 and the definition of C d n+1 .