Arch. Math. Logic (1999) 38: 423–447

c Springer-Verlag 1999

The continuum as a formal space

Sara Negri1, Daniele Soravia2 1 Department of Philosophy, P.O. Box 24 (Unioninkatu 40), 00014 University of Helsinki, Helsinki, Finland. e-mail: negri@helsinki.fi 2 Dipartimento di Matematica Pura ed Applicata, Via Belzoni 7, I-35131 Padova, Italy. e-mail: [email protected]

Received: 11 November 1996

Abstract. A constructive definition of the continuum based on formal topol- ogy is given and its basic properties studied. A natural notion of Cauchy sequence is introduced and Cauchy completeness is proved. Other results include elementary proofs of the Baire and Cantor theorems. From a clas- sical standpoint, formal reals are seen to be equivalent to the usual reals. Lastly, the relation of real numbers as a formal space to other approaches to constructive real numbers is determined.

1. Introduction In traditional set-theoretic the points of a space are the primitive objects and opens are defined as sets of points. In pointfree topology this conceptual order is reversed and opens are taken as primitive; points are then built as ideal objects consisting of particular, well behaved, collections of opens. The germs of pointfree topology can already be found in some remarks by Whitehead and Russell early in the century. For a detailed account of the historical roots of pointfree topology cf. [J] (notes on ch. II), and [Co]. The basic algebraic structure for pointfree topology is that of frame, or equivalently locale, or complete Heyting algebra, that is, a complete lattice with (finite) meets distributing over arbitrary joins. This is the order structure determined by the opens of a with respect to set-theoretic inclusion. A frame can thus be seen as a generalized topological space.

Mathematics Subject Classification (1991): 03F65, 26E40, 54A05 (Other constructive math- ematics, Constructive real analysis, Topological spaces and generalizations). 424 S. Negri, D. Soravia

The study of frames in category theory has been undertaken in the field known as locale theory. We refer to [J] and references therein for this ex- tensive direction in the development of pointfree topology. Martin-Lof¨ and Sambin introduced formal in [S] as an alterna- tive approach to poinfree topology, in the tradition of Johnstone’s coverages and Fourman and Grayson formal spaces [FG], but using a constructive set theory based on Martin-Lof’s¨ type theory (cf. [ML3]). Formal spaces and their effective presentations have been investigated in [Si,Si1] in a classical recursion theoretic setting. Pointfree topology has also been used for the semantics of computation, via the notion of information system ([Sc,ML2,Vi,SVV]). In [D] (pointfree) topological models have been applied to completeness of intuitionistic logic. The basic idea of pointfree topology of considering the opens, or approx- imations, as primitive, is here worked out to obtain a constructive definition of the continuum in the framework of formal topology. We give an account of all the basic notions of formal topology needed here and introduce the formal topology of intervals with rational endpoints, following an idea already in [J] (also developed in topos-theoretic terms in [V]). The formal points of this topology lead, through a natural construction, to our notion of continuum. Arithmetical operations are defined and an order relation giving rise to an apartness relation is studied in detail. From a constructive point of view formal reals are not order complete: this property only follows if we assume classical logic. Else, order completeness is obtained by suitably weakening the locatedness of formal reals, following a procedure typical of intuitionistic (cf. [T]). As a further confirmation of the correctness of our construction, we show how to obtain, by assuming classical logic, extensionality of the topology of formal reals. This means that the new pointfree space and the point-set one are classically equivalent. In order to develop constructive analysis, a natural notion of Cauchy sequence is introduced and Cauchy completeness is proved. Moreover, very elementary and constructive proofs of some basic results of analysis, like the Baire theorem and the Cantor theorem, are obtained. Finally, our notion of reals is shown to correspond to Bishop reals and to Dedekind cuts in their usual constructive treatment, and is compared with Martin-Lof’s¨ maximal approximations. We emphasize that, from the classical point of view, formal reals are equivalent to the usual reals, so that nothing is lost. What is gained is the possibility of using formal pointfree methods that permit to construc- tivize results of classical mathematics (cf. [CCN,CN,CS,N,NV,S1] for other examples, also outside analysis) and to pursue the project of machine- implemented formalization of analysis (cf. [C1,C2]). The continuum as a formal space 425

2. Preliminaries

We recall here the basic definitions concerning our approach to pointfree topology; further information can be found in [CN,S,SVV]. The reader already familiar with formal topology can skip this section. A point-set topology can always be presented using one of its bases. The abstract structure that we consider is a commutative monoid hS, ·S , 1S i where the set S corresponds to the set of the elements of the base of the point-set topology Ω(X), ·S corresponds to the operation of intersection between basic elements, and 1S corresponds to the whole collection X. In a point-set topology any is obtained as a union of elements of the base, but without points we do not have such a union; hence we are naturally led to think that an open set may directly correspond to a subset of the set S. Since there may be many different subsets of basic elements whose ∼ union is the same open set, we introduce an equivalence relation =S between two subsets U and V of S with the following intuitive motivation: denoting by c∗ the element of the base which corresponds to the formal basic open ∼ ∗ ∗ ∗ ∗ c, U =S V holds if and only if the opens U ≡∪a∈U a and V ≡∪b∈V b are equal. To this purpose we introduce a relation ¡S , called cover, between a basic element a of S and a subset U of S whose intended meaning is ∗ ∗ ∼ that a ¡S U when a ⊆ U and therefore the equivalence U =S V will amount to (∀u ∈ U) u ¡ V &(∀v ∈ V ) v ¡ U. The conditions we require of this relation are a straightforward rephrasing of the similar set-theoretic situation. We introduce a predicate Pos on elements of S, to express positively (that is without using negation) that a basic open is not empty. The notion of subset can be formalized within constructive type theory (cf. [ML3], p. 64): a subset U of a set S is a function that takes any x in S into a proposition U(x). We will use the informal notation a ∈ U for U(a) and the following abbreviations for subset inclusion and extensional equality:

U ⊆S V ≡ (∀x ∈ S)(U(x) → V (x)); U =S V ≡ U ⊆S V & V ⊆S U. In the sequel we omit subscripts when clear from the context. Definition 2.1 (Formal topology). Let S be a set. A formal topology over S is a structure S≡hS, ·, 1, ¡,Posi where hS, ·, 1i is a commutative monoid with unit, ¡ is a relation, called cover, between elements and subsets of S such that, for any a, b ∈ S and for any U, V ⊆ S the following conditions hold: 426 S. Negri, D. Soravia

a ∈ U reflexivity a ¡ U a ¡ U (∀u ∈ U)(u ¡ V ) transitivity a ¡ V a ¡ U dot - left a · b ¡ U a ¡ Ua¡ V dot - right a ¡ {u · v | u ∈ U, v ∈ V } and Posis a predicate on S, called positivity predicate, satisfying: Pos(a) a ¡ U monotonicity (∃b ∈ U) Pos(b)

positivity a ¡ a+ where a+ ≡{b ∈ S | a = b & Pos(b)} All the conditions are straightforward rephrasings of the preceding intu- itive considerations, except positivity. The first reason to introduce positivity is that any non-positive basic open is covered by anything. Indeed, when the predicate Posis decidable, positivity is equivalent to the rule ¬Pos(a) . a ¡ ∅

Positivity also allows proof by cases on Pos(a) for deductions involving covers (for a detailed discussion cf. [SVV]). In a formal topology the following rule is derivable from dot - left and dot - right: a ¡ U . localization a · b ¡ U · b If the base is a semilattice, localization becomes equivalent to dot - right. Given a formal topology A, we denote with Sat(A) the collection of saturated subsets of A, that is, of the subsets U of S such that AU = U, where AU ≡{a ∈ S | a ¡ U} .

With the following operations

WAU ∧AV ≡AUS∩AV = A(U · V ), i∈I AUi ≡A( i∈I Ui), The continuum as a formal space 427

Sat(A) is a frame (cf. [S1]). In order to connect our pointfree approach to classical point-set topology, the notion of point has to be recovered. Since we reverse the usual conceptual order between points and opens, and take the opens as primitive, points are defined as particular, well behaved, collections of opens. We recall here the definition of formal points of a formal topology:

Definition 2.2. Let A be a formal topology. A subset α of S is said to be a formal point if for all a, b ∈ S, U ⊆ S the following conditions hold: 1. 1 ∈ α ; a ∈ αb∈ α 2. a · b ∈ α ; a ∈ αa¡ U 3. (∃b ∈ U)(b ∈ α) .

We observe that formal points satisfy the rule a ∈ α Pos(a) as follows from condition 3 and positivity. In order to maintain the usual intuition on points, in the sequel we often write α k− a (α forces a,orα is a point in a) in place of a ∈ α, and α k− U for (∃a ∈ U)(α k− a). Moreover we interpret 1 as the whole space, product as intersection, a ¡ U as “a is included in the union of U”, and Pos(a) as “a is inhabited”, that is, a positive way of saying that a is not empty. For any formal topology A, the formal space Pt(A) of formal points on A can be endowed with a topology, called the extensional topology. Define, for a ∈ S, ext(a) to be the collection of formal points forcing a. The family {ext(a)}a∈S is a base for a topology on Pt(A): By the definition of formal points we have ext(1) = Pt(A), thus the whole space is a basic open, and ext(a) ∩ ext(b)=ext(a · b), thus the family is closed under intersection. If we denote ∪b∈U ext(b) with ext(U), then the generic open is of the form ext(U) for U ⊆ S. Let ΩPt(A) be the topology so obtained. Then the map φ : Sat(A) → ΩPt(A) U 7−→ ext(U) is clearly a surjective frame homomorphism, therefore it is a frame isomor- phism iff it is injective. Injectivity of φ amounts to

if for all α in Pt(A), α k− a implies α k− U, then a ∈ U 428 S. Negri, D. Soravia for arbitrary a ∈ S and U ⊆ S. When the above condition holds, we say that the formal topology is extensional or has enough points. This condition is classically equivalent to the following one: if a¡/U, then there exists α in Pt(A) such that α k− a and α k−/U. Intuitively this says that formal points suffice for “separating” the different opens. By the representation theorem for frames by means of formal topologies (cf. [S]), extensional formal topologies are “the same” as spatial frames (or locales). We recall a well known result that connects localic and point-set topology (cf. [J]): Theorem 2.3. The category of spatial frames is equivalent to the category of sober topological spaces. Thus extensionality for a formal topology is a measure of how much the formal space resembles the corresponding classical topological space. Ex- cept for very few cases like Scott formal topologies (cf. [SVV] for details), a proof of extensionality requires some non-constructive assumptions. For instance, the prime filter theorem is used in the case of Stone formal topolo- gies (cf. [N]). We give in Sect. 7 a proof of extensionality for the topology of formal reals that uses classical logic.

3. Definition of formal reals

Real numbers can be obtained in a pointfree setting starting from intervals with rational endpoints (cf. [J]). Here we show how to obtain real numbers as formal points of a formal topology. Some ideas in this direction have been already hinted at in [S]. The definition we shall use is a slight variant of the definition suggested by T. Coquand (cf. [CCN,CN]). We assume here the classic construction of the set Q of rationals starting from the integers, since it is unproblematic from the constructive point of view. Moreover, the usual order of rationals is decidable, and this will allow us to prove some results by cases. Given the set Q of rationals, let Q+ denote the totally ordered set obtained by adjoining a top element +∞ to Q and let similarly Q− denote Q∪{−∞}. The set S = Q− × Q+ is then partially ordered by the relation of inclusion: (p, q) ≤ (r, s) ≡ r ≤ p & q ≤ s. The meet operation, intersection of intervals, is defined by (p, q) · (r, s) ≡ (max(p, r), min(q, s)) and it makes S a semilattice with top element (−∞, +∞). The continuum as a formal space 429

Definition 3.1. The formal topology of formal reals is the structure R≡hQ− × Q+, ·, (−∞, +∞), ¡,Posi , where the cover ¡ is defined by 0 0 0 0 0 0 (p, q) ¡ U ≡ (∀p ,q)(p

(p, s) ¡f U (r, q) ¡f Up≤ r

We just recall here that it has been proved in [CN] that both ¡ and ¡f are covers, the latter being the Stone compactification of the former (cf. [N]). This means that the following holds: Proposition 3.2. Let (p, q) ∈ S and U ⊆ S. Then

1. If (p, q) ¡f U, then there exists a finite subset U0 of U such that (p, q) ¡f U0. 2. If (p, q) ¡f U, then (p, q) ¡ U. 3. If (p, q) ¡ U and U is finite, then (p, q) ¡f U. The general definition of formal reals is obtained as an instantiation of Definition 2.2 to the topology of formal reals. It is equivalent to the following more explicit one, where only the order between rationals is involved: Definition 3.3. A formal real is a subset α of S such that: 1. α k− (−∞, +∞) ; 2. α k− (p, q)&α k− (r, s) ⇔ α k− (p, q) · (r, s) ; α k− (p, q) p ≤ r

In the sequel we denote with Pt(R) the collection of formal points on R. We observe that right to left implication in condition 2 is equivalent to monotonicity of points with respect to the relation ≤, i.e., to the rule: α k− (p, q)(p, q) ≤ (t, v) . α k− (t, v)

Furthermore, condition 3 can be replaced by the equivalent α k− (p, q) r

The following results, stating that formal reals can be approximated by rationals up to an arbitrary accuracy, will be useful. Lemma 3.4. Let α be a formal real. Then, for any positive rational k, there exists (p, q) ∈ α such that q − p

Proof. By definition of formal reals, there exists (r, s) < (−∞, +∞) such r+2s that α k− (r, s). By trisecting the interval (r, s),wehaveα k− (r, 3 ) ∨ 2r+s 2 n α k− ( 3 ,s). Since there exists n such that ( 3 ) ·(s−r)

4. Arithmetic in Pt(R)

We recall that a f between the spaces (Pt(A), A) and (Pt(B), B) is given by a pair (f pt,fΩ), where f pt maps points of A into points of B and f Ω is a morphism of formal topologies (defined as in [S]) from B to A (cf. [Vi] for the analogous notion in terms of locale theory). The two maps are in an adjoint relation, i.e., for all α in Pt(A) and b in the base of B,wehave α k− f Ω(b) ⇔ f pt(α) k− b.

The same holds for continuous maps h : Pt(R) × Pt(R) → Pt(R) that are in adjoint relation with morphisms of formal topologies from R to the coproduct R + R, defined as in [NV]. The arithmetic operations on formal reals can thus be defined as follows (see also [Si]): – Successor: The successor of a point is obtained by shifting its neigh- bourhoods. So we define α +1 ≡ f pt(α) ≡{(r +1,s+1)| (r, s) ∈ α} f Ω((p, q)) ≡{(r, s) | r +1=p, s +1=q}. The continuum as a formal space 431

– Additive inverse: −α ≡ f pt(α) ≡{(−q, −p) | (p, q) ∈ α} f Ω((p, q)) ≡{(−q, −p)} .

– Sum: After defining the pointwise sum on S, (p, q)+(r, s) ≡ (p + r, q + s),

we put α + β ≡ f pt(α, β) ≡{(p, q)+(r, s) | (p, q) ∈ α, (r, s) ∈ β} f Ω((u, v)) ≡{((p, q), (r, s)) ∈ S × S | (u, v)=(p, q)+(r, s)}.

– Product: We define the binary operation between basic neighbourhoods, (p, q) ∗ (r, s) ≡ (min(pr, ps, qr, qs), max(pr, ps, qr, qs)) .

Then α · β ≡ f pt(α, β) ≡{(p, q) ∗ (r, s) | (p, q) ∈ α, (r, s) ∈ β} f Ω((u, v)) ≡{((p, q), (r, s)) | u = min(pr, ps, qr, qs), v = max(pr, ps, qr, qs)} .

– Inverse: It is defined only if α<0 or α>0: 1 1 α−1 ≡ f pt(α) ≡{(r, s) | (∃(p, q))(r ≤ < ≤ s & α |=(p, q) q p &(p>0 ∨ q<0))}

– Difference: α − β ≡ α +(−β)

5. Order in Pt(R)

We define strict order between formal reals in the following way: α<β≡ (∃(p, q) ∈ α)(∃(r, s) ∈ β)(q

Moreover we define: α ≤ β ≡¬β<α. Properties of strict and weak order follow from the following two lemmas (cf. [vP]): Lemma 5.1. Let α, β ∈ Pt(R). Then ¬(α<β& β<α) 432 S. Negri, D. Soravia

Proof. By definition of order, if α<βthere exist (p1,q1) in α and (r1,s1) in β such that q1

Proof. Since p<α¯ , there exist (q, r) in p¯ and (s, t) in α such that r

Lemma 5.7. Let α, β ∈ Pt(R) with α<β. Then there exists a rational number t such that α

Proof. For any (t, u) such that α k− (t, u), since r

5.1. Apartness

We now introduce an apartness relation between formal reals, i.e., a relation # satisfying, for all α, β, γ ∈ Pt(R)

1. ¬α#β ⇔ α =S β ; 434 S. Negri, D. Soravia

2. α#β ⇔ β#α ; 3. α#β ⇒ α#γ ∨ γ#β . Definition 5.11 (apartness). Let α, β ∈ Pt(R). Then α is apart from β, and we write α#β,if α<β∨ β<α. Observe that, by definition of order, we have α#β iff there exist (p, q) in α and (r, s) in β such that q

Corollary 5.13. Let α, β ∈ Pt(R).Ifα ⊆S β then α =S β. Proof. If α#β, there exist (p, q) in α and (r, s) in β such that ¬Pos((p, q) · (r, s)), which is absurd since α ⊆S β and a point cannot contain two disjoint intervals. Thus ¬α#β and therefore α =S β. 2

5.2. Minimum and maximum For α, β ∈ Pt(R) we define the minimum and maximum of α and β in the following way: min(α, β) ≡{(p, q) ∈ S | (α k− (p, +∞)&β k− (p, +∞)) &(α k− (−∞,q) ∨ β k− (−∞,q))};

max(α, β) ≡{(p, q) ∈ S | (α k− (p, +∞) ∨ β k− (p, +∞)) &(α k− (−∞,q)&β k− (−∞,q))} . It is easy to prove that min(α, β) and max(α, β) are formal reals and satisfy the constructive axioms of minimum and maximum in a linear order (cf. [vP]), that is, we have: Proposition 5.14. For all α, β in Pt(R), the following hold: MM1: ¬ α < min(α, β) , ¬ β < min(α, β) , ¬ max(α, β) <α, ¬ max(α, β) <β; MM2: ¬(min(α, β) <α& min(α, β) <β) , ¬(α < max(α, β)&β < max(α, β)) . The distance between two formal reals and the absolute value can thus be defined as usual: |α − β| = max(α − β,β − α); |α| = max(α, −α). The continuum as a formal space 435

5.3. Cantor theorem

By the following result formal reals constitute a non-denumerable collection.

Theorem 5.15 (Cantor). Let (αn)n∈N be a sequence of formal reals and let p, q be rational numbers with p

Proof. We define by induction two sequences of rationals (pn)n∈N and (qn)n∈N such that, for all n, m with 1 ≤ n

i. p ≤ pn αn or q¯n <αn; 1 iii. qn − pn < n .

Let n>1 and suppose that p1, ..., pn−1,q1, ..., qn−1 have been constructed. Since pn−1 p¯n−1 ∨ αn < q¯n−1. If the first disjunct holds, then p¯n−1 < min(αn, q¯n−1), and therefore, by Lemma 5.7, there exists a rational pn such that p¯n−1 < p¯n < min(αn, q¯n−1); moreover, ¯1 there exists qn such that p¯n < q¯n < min(αn, q¯n−1, p¯n + n ). Similarly, if the second disjunct holds then max(αn, p¯n−1) < q¯n−1 and therefore there exists qn such that max(αn, p¯n−1) < q¯n < q¯n−1 and consequently ¯1 there exists pn such that max(αn, p¯n−1, q¯n − n ) < p¯n < q¯n. In both cases conditions i-iii are satisfied. It is routine to check that α = {(p, q) ∈ S | (∃n)(∃m)(p ≤ pn&qm ≤ q)} is a formal real. Finally, for all n,we have by construction p¯n >αn ∨ q¯n <αn and moreover α k− (pn,qn) so that p¯n <αα and we can thus conclude that (∀n)(α#αn). 2

6. Order completeness

The order we have introduced in Pt(R) is not (conditionally) complete, i.e., it is not possible to prove constructively that a bounded non-empty collection of formal reals has a least upper bound (lub) and a greatest lower bound (glb). Indeed, we can prove that order completeness of Pt(R) implies a logical principle which is not intuitionistically valid. Proposition 6.1. If Pt(R) is order complete, then for any proposition P , ¬P ∨¬¬P holds.

Proof. Given a proposition P , we consider the following collection of for- mal reals: A = {α ∈ Pt(R) | (α =0∧ P ) ∨ (α =1∧¬P )}. 436 S. Negri, D. Soravia

If A = ∅, then 0 ∈/ A, 1 ∈/ A, and therefore ¬P ∧¬¬P . Thus A 6= ∅. Moreover A is bounded since α ∈ A implies α =0∨ α =1.Bythe hypothesis that the collection Pt(R) is order complete, there exists γ = lub(A) in Pt(R). We observe that P ⇒ γ =0 ¬P ⇒ γ =1 and thus, since α#β implies ¬(α = β), by contraposition we obtain γ#0 ⇒¬P γ#1 ⇒¬¬P.

Since 0#1 holds, by the property of apartness we have γ#0 ∨ γ#1 and therefore ¬P ∨¬¬P . 2 To obtain order completeness we are thus led, as an alternative to using a non-constructive logic, to widen the collection of formal reals as follows: Definition 6.2. A weak formal real is a subset α of S satisfying 1, 2, 4 of Definition 3.3, and the following weak form of 3: α k− (p, q) p ≤ r

Proof. First we observe that we can suppose that F is bounded by a rational e number, since if (∀i ∈ I)(αi <β) for some β ∈ Pt(R) , then there exists k ∈ Q such that β

α ≡{(p, q) ∈ S | (∃i ∈ I)((p, +∞) ∈ αi) 0 0 &(∃q

α ≡{(p, q) ∈ S | (∃i ∈ I)((−∞,q) ∈ αi) 0 0 &(∃p >p)(∀i ∈ I)((p , +∞) ∈ αi)}.

7. Extensionality of Pt(R)

In this section we provide a classical proof of extensionality for formal reals, or, in other words, of injectivity of the map ext : Sat(R) → ΩPt(R) defined in Sect. 2. The proof of extensionality for the formal topology of formal reals fol- lows from the general result stating extensionality of locally compact locales (cf. theorem 4.3, chapter VII, in [J]). We give here a direct proof. Theorem 7.1. By assuming classical logic, the formal topology of formal reals is extensional.

Proof. We prove classically that if (p, q)¡/Uthen there exists α in Pt(R) such that α k− (p, q) and α k−/U by an inductive construction of a formal point forcing (p, q) but not U. We start with defining ↑(p, q) ≡{(p0,q0) | (p, q) ≤ (p0,q0)} and we put α0 ≡↑(p, q). Since (p, q)¡/U, there exists (p1,q1) with p

8. Constructive analysis

8.1. Convergence in Pt(R)

The notion of convergence and of Cauchy sequence can be expressed simply in terms of formal reals. We shall prove that formal reals satisfy Cauchy completeness, that is, a sequence of formal reals converges (to a formal real) iff it is a Cauchy sequence. As usual, we say that a sequence of reals converges to a given real if, for any neighbourhood of such a real number, the sequence is eventually in it, i.e.:

Definition 8.1. A sequence (αn)n of formal reals converges to α in Pt(R) (abbr. (αn)n → α) if for all (p, q) in α there exists m such that for all n>m, αn k− (p, q). We can then prove that if a sequence converges, then it converges to a unique formal point, which can thus be called the limit of the sequence.

Proposition 8.2. Suppose (αn)n → α and (αn)n → β. Then α =S β.

Proof. If α#β, then (∃(p, q) ∈ α)(∃(r, s) ∈ β)(¬Pos((p, q) · (r, s)). So, by the definition of convergence, there exists m1 such that, for all n>m1, αn k− (p, q) and there exists m2 such that, for all n>m2, αn k− (r, s). Thus there exists m such that, for all n>m, αn k− (p, q) · (r, s), that contradicts ¬Pos((p, q) · (r, s)).So¬α#β and therefore, by 5.12, α =S β. 2 We can prove the following easy facts about convergent sequences: (α ) → α (β ) Proposition 8.3. Suppose n n . Then any subsequence nk k of (αn)n converges to the same limit. The continuum as a formal space 439

Proof. Straightforward. 2

Proposition 8.4. Any convergent sequence (αn)n is bounded.

Proof. Suppose (αn)n → α and let (p, q) be such that −∞ m, αn k− (p, q). Take, for all n ≤ m, a neighbourhood (pn,qn) with −∞

Definition 8.5. A sequence of formal reals (αn)n is called a Cauchy se- quence if, for any positive rational k, there exist a neighbourhood (p, q) and a natural number m such that

q − pm)(αn k− (p, q)) . As announced, we have: Theorem 8.6 (Cauchy completeness of Pt(R)). A sequence of formal re- als (αn)n converges iff it is a Cauchy sequence.

Proof. Suppose that (αn)n → α. This, together with Lemma 3.4, implies that for any positive rational k there exist (p, q) with q − pm, αn k− (p, q). On the other hand, if (αn)n is a Cauchy sequence, then we can prove that α = {(p, q) ∈ S | (∃(p0,q0))(pm)(αn k− (p ,q)))} is a formal real and the limit of the given sequence. 2 Definition 8.7. A collection F of formal reals is complete if every Cauchy sequence in F converges to a point in F .Itistotally bounded if for any pos- itive k ∈ Q there exists a finite sequence (p1,q1),...,(pn,qn) of intervals such that for all i ≤ n, qi − pi

Proof. Completeness. Let (αn)n∈N be a Cauchy sequence in [0, 1] and let α be its limit. If α>1¯ we have α k− (1, +∞) and therefore, by definition of ¯ convergence, (∃m)(∀n>m)(αn k− (1, +∞)) that is (∀n>m)(αn > 1). ¯ ¯ By hypothesis we have instead αn ≤ 1 and therefore we get α ≤ 1.Inthe same way we obtain 0¯ ≤ α. 440 S. Negri, D. Soravia

Total boundedness. Observe that (0, 1) can be covered by a finite se- quence of overlapping intervals (p1,q1),...,(pn,qn) such that p1 < 0 < p2

Proof. Suppose f pt(α) k− (p, q). Then by the adjunction between f pt and f Ω we have α k− f Ω((p, q)) and therefore, by definition of convergence, Ω pt (∃m)(∀n>m)(αn k− f ((p, q))). Again, by the relation between f and f Ω, we obtain pt (∃m)(∀n>m)(f (αn) k− (p, q)) pt pt that is (f (αn))n → f (α). 2

8.2. Baire theorem

In this section we prove that the classical Baire theorem holds for formal reals. As a corollary we get another proof of Cantor’s theorem on the non- denumerability of the continuum. These results follow some ideas already in [ML]. Definition 8.10. A subset U of S is dense in Pt(R) if for any positive interval (p, q) there exists (r, s) in U such that Pos((p, q) · (r, s)) holds. Observe that a subset U of S is dense in Pt(R) iff, for any positive interval (p, q), there exists at least one formal real α with α k− (p, q) and α k− U. Therefore, U is dense (as a collection of intervals) iff ext(U) is dense (as a collection of formal reals) in the usual sense. In the following we use the notation l(p, q) for q − p. The continuum as a formal space 441

Theorem 8.11 (Baire). Let (Un)n∈N be a denumerable family of subsets of S such that, for all n, Un is dense in Pt(R). Then ∩n∈Next(Un) is dense in Pt(R).

Proof. Let (p, q) be a positive interval in S. We start by taking (p1,q1) with p1, l(p ,q ) < l(pn−1,qn−1) < ... < l(p1,q1) n n 2 2n−1 ;

p

ext((pn,qn)) ⊆ ext(Un−1).

The last follows since an−1

α = {(a, b) | (∃(a0,b0))(am)(αn k− (a ,b))} .

Let m>0. Then we have max(pm,am) m, αn k− (pm+1,qm+1). Now, by definition of α, α k− (pm,qm) · (am,bm) and so, for all m>0, α k− (am,bm), that is α ∈ ext(Um) and α k− (pm,qm). Since p

Corollary 8.12. Let (αn)n be a sequence in Pt(R). Then the collection of formal reals α such that (∀n)(α#αn) is dense in Pt(R).

Proof. For all n, let Un ≡{(p, q) ∈ S | q¯ ≤ αn ∨ αn ≤ p¯}. It follows from the definition of a formal real that Un is dense. By Baire’s theorem, ∩n∈Next(Un) is dense in Pt(R). The conclusion follows since ext(Un)= {α | α#αn} and ∩n∈Next(Un)={α | (∀n)(α#αn)}. 2 442 S. Negri, D. Soravia

9. Other axiomatizations 9.1. Constructive Dedekind cuts We recall here the definition of a Dedekind cut on the rationals as given in [FH] and prove that there exists a one-one correspondence between formal points and Dedekind cuts. Definition 9.1. A Dedekind cut on the rationals is a pair (L, U), where L and U are non-empty strict subsets of Q− and of Q+ respectively, such that: – (∀p)(¬(p ∈ U & p ∈ L)) (disjointness); – (∀p ∈ L)(∃q ∈ L)(p

Proof. For any formal point α, (Lα,Uα) ≡ φ(α) is a Dedekind cut: Lα and Uα are non-empty since (−∞, +∞) ∈ α and therefore −∞ ∈ L and +∞∈ U. Disjointness holds too, since if p ∈ Lα and p ∈ Uα then, by closure under intersection, we would have (p, p) ∈ α and therefore Pos((p, p)) which is impossible. Openness and monotonicity follow from the fourth and the second condition of the definition of a formal real, respectively. Finally, locatedness is proved by observing that if p

For p ∈ Q, let (Lp,Up) be the Dedekind cut defined by Lp ≡{x ∈ − + Q | xp}. Then a basic open interval of Dedekind cuts is defined as + ]p, q[≡{(L, U) | Lp ⊂ L ⊂ Lq & U = {r ∈ Q | L

1. If α ∈ ψ(]p, q[) there exists (L, U) such that Lp ⊂ L ⊂ Lq & U = + {r ∈ Q | LL}. 2. Just observe that φ(ext((p, q))) = φ(ψ(]p, q[)) =]p, q[ by the above proof and bijectiveness. Thus we have: Proposition 9.3. Dedekind reals with their usual topology are homeomor- phic to formal reals with the extensional topology.

9.2. Cauchy sequences a` la Bishop

We recall the definition of real numbers a` la Bishop (cf. [Bi]):

Definition 9.4. A real number is a sequence of rationals (xn)n such that −1 −1 + |xm − xn|≤m + n (m, n ∈ N ) .

The real numbers (xn)n and (yn)n are equal if −1 + |xn − yn|≤2n (n ∈ N ) .

Then we have (cf. [CN]): Proposition 9.5. There is a one-one correspondence between formal reals and real numbers a` la Bishop.

Proof. Let α be a formal real. By Lemma 3.4, there exists (p, q) ∈ α such that q − p ≤ 2/3. We can generate inductively a sequence of intervals ((xn,yn))n by defining (x1,y1)=(p, q) and  (x ,y − yi−xi ) α k− (x ,y − yi−xi ) (x ,y ) ≡ i i 3 if i i 3 i+1 i+1 yi−xi yi−xi (xi + 3 ,yi) if α k− (xi + 3 ,yi)

yi−xi We observe that the definition is sound since α k− (xi,yi) and xi + 3 < yi−xi yi−xi yi−xi yi − 3 imply α k− (xi,yi − 3 ) ∨ α k− (xi + 3 ,yi). It can be verified that the sequences (xn)n and (yn)n are real numbers according to Definition 9.4. 444 S. Negri, D. Soravia

Conversely, if (xn)n is a real number a` la Bishop, then the set defined by [ α ≡ {(p, q) ∈ S | p

9.3. Martin-Lof’s¨ maximal approximations

In [ML], two positive basic neighbourhoods (p, q) and (r, s) are said to lie apart if q

(p1,q1) ∈ A (p1,q1) < (p2,q2) 1. ; (p2,q2) ∈ A (p1,q1) ∈ A (p2,q2) ∈ A 2. . (∃(r, s) ∈ A)((r, s) < (p1,q1)&(r, s) < (p2,q2)) An approximation A is maximal if moreover

(p1,q1) < (p2,q2) 3. . (∃(r, s) ∈ A)(¬Pos((p1,q1) · (r, s))) ∨ (p2,q2) ∈ A Then we have: Proposition 9.7. Every recursively enumerable formal real is a maximal approximation.

Proof. Let α be a formal real and also a recursively enumerable subset of Q− ×Q+. Then for all (p, q) ∈ α, Pos((p, q)) holds, thus α consists of pos- itive neighbourhoods. The defining conditions of maximal approximation are satisfied:

(1) If (p1,q1) ∈ α and (p1,q1) < (p2,q2) then (p1,q1) ¡ (p2,q2), and therefore, by monotonicity, (p2,q2) ∈ α. The continuum as a formal space 445

(2) Let (p1,q1) ∈ α and (p2,q2) ∈ α. Then (p1,q1) · (p2,q2) ∈ α and therefore, by definition of formal reals, (∃(r, s) ∈ α)((r, s) < (p1,q1) · (p2,q2)),so(∃(r, s) ∈ α)((r, s) < (p1,q1)&(r, s) < (p2,q2)). (3) Cf. Lemma 5.8. 2

Conversely we have: Proposition 9.8. Every maximal approximation is a recursively enumer- able formal real.

Proof. First observe that a maximal approximation A satisfies the rule of monotonicity (p ,q ) ∈ A (p ,q ) ≤ (p ,q ) 1 1 1 1 2 2 . (p2,q2) ∈ A

To see this, assume (p1,q1) ∈ A. Then by 2 of Definition 9.6, there exists (r, s) ∈ A such that (r, s) < (p1,q1). For such an (r, s) we have (r, s) < (p2,q2) and therefore (p2,q2) ∈ A. 1. By condition 3 of Definition 9.6, every maximal approximation is non- empty. So, if (p, q) ∈ A then (p, q) ≤ (−∞, +∞) and therefore, by the above observation, (−∞, +∞) ∈ A. 2. Suppose (p1,q1) ∈ A and (p2,q2) ∈ A. Then, by condition 2 of Defini- tion 9.6, (∃(r, s) ∈ A)((r, s) < (p1,q1)·(p2,q2)), thus by monotonicity (p1,q1) · (p2,q2) ∈ A. The converse simply holds by monotonicity. 3. Let (p, q) ∈ A and r

10. Concluding remarks

The presentation of the topology of formal reals by means of a Stone cover, and its use in mathematical proofs, is the main accomplishment of this work. It gives a precise sense to the computational content of formal reals. Formal topology is formalizable within Martin-Lof’s¨ constructive type theory, and the latter in turn can be used directly as a high-level programming language (cf. [ML1,NPS]). The definition of real numbers in formal topol- ogy allows inductive definitions and proofs which are ready to be made 446 S. Negri, D. Soravia algorithmic and machine-checked. This presentation of real numbers has served as a way of constructivizing mathematical analysis, cf. [CCN,CN], even to the point of achieving completely formalized and machine-checked proofs, as in [C1,C2]. Formal reals can thus be seen as a computational alternative to classical reals. A characterization of formal topologies having an inductive generation generalizing the one of formal reals, is presented in [N1]: As the real line is the prime example of a locally compact topological space, the topology of formal reals serves as a basis for defining the notion of locally Stone formal topology. The latter in turn is used for representing continuous lattices, the algebraic counterpart of locally compact spaces.

Acknowledgements. The first author wishes to thank Jan Cederquist, Jan von Plato and Juha Ruokolainen for carefully reading this paper and providing useful suggestions.

References

[A] Aczel, P.: An introduction to inductive definitions, in “Handbook of Mathematical Logic”, J. Barwise ed., North-Holland, pp. 739-782, 1977. [B] Beeson, M. J.: “Foundations of Constructive Mathematics”, Springer-Verlag, 1980. [Bi] Bishop, E.: “Foundations of Constructive Analysis”, Mc Graw Hill, 1967. [C] Cederquist, J.: A machine-assisted formalization of Intuitionistic Pointfree Topol- ogy, Licentiate Thesis, Chalmers University, Goteborg,¨ 1994. [C1] Cederquist, J.: An implementation of the Heine-Borel covering theorem in Type Theory, in “Types for Proofs and Programs”, Gimenez, E., Paulin-Mohring, C. (eds), Lecture Notes in Computer Science 1512, pp. 46–65, Springer, 1998. [C2] Cederquist, J.: A machine assisted proof of the Hahn-Banach theorem, Chalmers University of Technology and University of Goteborg,¨ 1997. [CCN] Cederquist, J., Coquand, T., Negri, S.: The Hahn-Banach theorem in type theory, in “Twenty-Five Years of Constructive Type Theory”, Sambin, G., Smith, J. (eds), pp. 57–72, Oxford University Press, 1998. [CN] Cederquist, J., Negri, S.: A constructive proof of the Heine-Borel covering theorem for formal reals, in “Types for Proofs and Programs”, Berardi, S., Coppo, M. (eds), Lecture Notes in Computer Science 1158, pp. 62–75, Springer, 1996. [Co] Coquand, T.: Computational content of classical logic, in “Semantics of Logics of Computation”, Pitts, A.M., Dybjer, P. (eds), Cambridge University Press, 1997. [CS] Coquand, T., Smith, J.: An application of constructive completeness, in “Types for Proofs and Programs”, Berardi, S., Coppo, M. (eds), Lecture Notes in Computer Science 1158, pp. 62–75, Springer, 1996. [D] Dragalin, A.G.: “Mathematical Intuitionism”, Translations of Mathematical Mono- graphs, vol. 67, American Mathematical Society, Providence, Rhode Island, 1988. [FG] Fourman, M.P., Grayson, R.J.: Formal spaces, in “The L. E. J. Brouwer Centenary Symposium”, Troelstra, A.S, van Dalen, D. (eds), North Holland, Amsterdam, pp. 107–122, 1982. [FH] Fourman, M.P., Hyland, J.M.E.: Sheaf models for analysis, in Fourman, M.P. et al. (eds), “Applications of Sheaves”, Lecture Notes in Mathematics 753, pp. 280–301, 1979. The continuum as a formal space 447

[H] Heyting, A.: “Intuitionism, an Introduction”, North Holland, 1971. [J] Johnstone, P.T.: “Stone Spaces”, Cambridge University Press, 1982. [ML] Martin-Lof,¨ P.: “Notes on Constructive Mathematics”, Almqvist & Wiksell, Stock- holm, 1970. [ML1] Martin-Lof,¨ P.: Constructive mathematics and computer programming, in “Logic, Methodology and Philosophy of Science VI”, Cohen, L.J. et al. (eds), pp. 153–175, North-Holland, 1982. [ML2] Martin-Lof,¨ P.: The domain interpretation of type theory, in “Proceedings of the Workshop on Semantics of Programming Languages”, Karlsson, K., Petersson, K. (eds), Chalmers University of Technology and University of Goteborg,¨ 1983. [ML3] Martin-Lof,¨ P.: “Intuitionistic Type Theory”, Bibliopolis, Napoli, 1984. [N] Negri, S.: Stone bases, alias the constructive content of Stone representation,in “Logic and Algebra”, Ursini, A., Agliano,` P. (eds), Marcel Dekker, New York, pp. 617–636, 1996. [N1] Negri, S.: Continuous lattices in formal topology, in “Types for Proofs and Pro- grams”, Gimenez, E., Paulin-Mohring, C. (eds), Lecture Notes in Computer Science 1512, pp. 333–353, Springer, 1998. [NV] Negri, S., Valentini, S.: Tychonoff’s theorem in the framework of formal topologies, The Journal of Symbolic Logic 62, pp. 1315–1332, 1997. [NPS] Nordstrom,¨ B., Petersson, K., Smith, J.: “Programming in Martin-Lof’s¨ Type The- ory”, Oxford University Press, 1990. [vP] von Plato, J.: Order in open intervals of computable reals, Mathematical Structures in Computer Science, in press. [S] Sambin, G.: Intuitionistic formal spaces–afirstcommunication, in “Mathematical logic and its applications”, D. Skordev ed., Plenum, pp. 187–204, 1987. [S1] Sambin, G.: Pretopologies and completeness proofs, The Journal of Symbolic Logic 60, pp. 861–878, 1995. [SVV] Sambin, G., Valentini, S., Virgili, P.: Constructive domain theory as a branch of intuitionistic pointfree topology, Theoretical Computer Science, 159/2, pp. 319– 341, 1996. [Sc] Scott, D.: Domains for denotational semantics, Lecture Notes in Computer Science, 140, pp. 577–613, Springer Verlag, 1982. [Si] Sigstam, I.: “On formal spaces and their effective presentation”, Ph. D. Thesis, Uppsala University, Department of Mathematics, Report 1990:7. [Si1] Sigstam, I.: Formal spaces and their effective presentation, Archive for Mathemat- ical Logic, 34, pp. 211–246, 1995. [Sm] Smyth, M.B.: Topology, in “Handbook of Logic in Computer Science”, S. Abramsky et al. (eds), Clarendon Press, Oxford, 1992. [T] Troelstra, A.S.: Intuitionistic extensions of the reals, part I, Nieuw Archief voor Wiskunde (3), 28, pp. 69–113, 1980. [T1] Troelstra, A.S.: Intuitionistic extensions of the reals, part II, in “Logic Colloquium ’80”, van Dalen, D. et al. (eds), pp. 279–310, North-Holland, 1982. [TvD] Troelstra, A.S., van Dalen, D.: “Constructivism in Mathematics, an Introduction”, vols. I and II, North-Holland, 1988. [V] Vermeulen,J.J.C.: “Constructive Techniques in Functional Analysis”, Ph. D. Thesis, University of Sussex, 1986. [Vi] Vickers, S.: “Topology via Logic”, Cambridge University Press, 1989.