Compact totally separated types
Abstract.
Perhaps surprisingly, there are infinite types that can be exhaustively searched mechanically in finite time. We use ideas from topology to build plenty of them, referring to searchable types as compact types, and we use ordinals to measure their logical complexity. We consider two systems of ordinal notations under which a single notation denotes both a discrete ordinal and a compact one, with an embedding of the former into the latter whose image has empty complement. A boolean valued function decides which points in the image of the embedding are isolated and which are topological limit points. The first system consists of the traditional Brouwer codes and the second is an inductive-recursive universe generalizing them. The discrete ordinals so obtained are trichotomous, and the compact ones have the least element property for complemented subsets, but these two desirable properties cannot be fulfilled simultaneously in a constructive setting. The ordinals obtained from Brouwer codes further enjoy a boolean Leibniz principle, which has the notion of total separatedness as its topological counterpart. This extends previous work from Gödel’s system to intensional Martin-Löf type theory with univalent universes, and is formalized in Agda in the TypeTopology repository.
0 Contents
1. Introduction
We consider the following search problem for a type . Given a function into the type with elements and , we want to either exhibit a point with , that is, a root of , or else determine that has no root. This problem amounts to the type
For a finite type this can always be done, by trying the finitely many points in turn. The question investigated in this paper is which infinite types admit such a procedure. Three related subjects view this requirement in three different ways.
- (1)
- (2)
In topology, this turns out to be a compactness problem [14]. In Johnstone’s topological topos [27], which we take as a guiding model, the types of our theory are interpreted as spaces, functions into classify the clopen subspaces, and for a closed subtype of a simple type, the requirement above holds exactly when the corresponding space is compact in the sense of topology [14].
- (3)
In logic it amounts to a choice problem, because the type displayed above asks for a root to be produced rather than asserted to exist. Which infinite instances of choice can be proved without being taken as axioms?
In classical mathematics, excluded middle decides whether has a root, and a choice principle produces one when it does. Asking every type of a universe to satisfy the above is equivalent to global choice, the principle
which is stronger than the axiom of choice and says that we can pick an element of every non-empty type [41, Theorem 3.2.2 and Remark 3.2.5].
In this paper we work constructively in an intensional Martin-Löf type theory, rather than classically in set theory as in our previous paper [14]. As in that paper, we take inspiration from topology to develop examples and counterexamples of such types, as well as their general theory, although we do not assume previous familiarity with topology, except for the sake of motivation [45, 46, 12]. Because of this and by (2) above, we refer to the types that satisfy the searchability condition as compact.
Moreover, we adopt the univalent point of view [41], due to its direct way of capturing various notions of extensionality, as well as the distinction between data and property. Alternatively, in principle everything discussed here could be redeveloped using setoids [24, 25, 39] instead, but we leave such a reworking to interested readers.
The natural numbers fail to be compact constructively. There are nonetheless many infinite compact types, as mentioned above. Perhaps the simplest example is the type of decreasing binary sequences,
which satisfies the universal property of the conatural numbers, and whose topological reading is the one-point compactification of the discrete space of natural numbers with a new point at infinity. It is compact in our type theoretic sense, and we had already shown it to be so in a system as weak as Gödel’s [15].
The compactness of has found applications outside the concerns of this paper. Normann and Tait [37] use its form in Gödel’s to fill a gap in an unpublished but widely circulated manuscript of Tait from 1958 on the computability of the fan functional. Pradic and Brown [40] use it to prove that the Cantor–Bernstein theorem implies excluded middle.
Compactness as defined above in type theory is uninformative for a type with too few functions into the type of booleans. The real numbers are a standard example, where it is consistent that all functions into the booleans are constant, rendering the search problem trivial. We say that a type is totally separated when the functions into separate the points, in the positive sense that
This is a Boolean Leibniz principle, whose classical topological reading is that the clopens separate the points. Our type theoretic notion of compactness is faithful to the topological notion with the same name only for types that are totally separated. We may envision obtaining a general type theoretic notion of compactness by changing the booleans to a Sierpiński-like type using dominances [21] and changing the searchability condition slightly (cf. [14]), but this is not investigated in the present work.
Totally separated types are sets in the sense of HoTT/UF, and they are closed under , , and retracts, and include the discrete types and hence the simple types, but they fail to be closed under constructively in general, and we investigate particular cases of totally separated types of interest.
All compact types we are able to construct turn out to come equipped with well-orders. Moreover, the constructions that preserve compactness discussed in the body of the paper also preserve well-orderability. We adopt the HoTT Book [41] definition of ordinal, namely a type equipped with a proposition valued order that is transitive, extensional and well-founded. (The HoTT Book also requires the underlying type to be a set, but we observe that this follows automatically from the extensionality condition.)
Trichotomy, namely the principle that or or for all elements and of an ordinal, is equivalent to the principle of excluded middle when required for all ordinals, but there are many trichotomous ordinals without assuming excluded middle. Any trichotomous ordinal is discrete (has decidable equality), but e.g. in the topological topos, discrete compact objects are necessarily finite, so that asking for trichotomy together with compactness gives only finite examples.
Another important classical property of ordinals is that every non-empty subset has a least element, which is known to fail in general in a constructive setting. But we do obtain the least element property constructively for a large class of compact totally separated ordinals, replacing subset by complemented subset (classically, every subset is complemented, and, topologically, complemented subsets correspond to clopen subsets).
Although the above phenomena exhibit a dichotomy between trichotomy and compactness, the two notions are related. In fact, a third phenomenon becomes visible in a constructive setting. Two ordinals that are seen to be the same classically can behave in vastly different ways constructively. An example is the classical ordinal , which has two manifestations (among others). In one, we equip the type with its natural order, which gives rise to a trichotomous ordinal. In the other, we equip again with its natural order, which gives rise to a compact totally separated ordinal with the least element property for complemented subsets, which fails to be trichotomous constructively. In the presence of the principle of excluded middle, these two ordinals are the same (and suffices). But, by the above discussion, in the topological topos, these two ordinals are patently different, one being discrete and the other compact totally separated (i.e. a Stone space [28]), and so are they in Hyland’s effective topos. We have the natural inclusion
which is an injection whose image has empty complement, but it is a bijection if and only if holds. That every decreasing binary sequence is of one of the forms and fails constructively, being equivalent to , while that there is no decreasing binary sequence other than these always holds.
We generalize the above situation by working with ordinal codes and interpreting them in two ways, so that one interpretation gives trichotomous ordinals and a second one gives compact totally separated ordinals with the least element property for complemented subsets. We always have an embedding of the first interpretation into the second, whose image has empty complement. We also discuss the standard interpretation, which fails to produce either trichotomous or compact totally separated ordinals, along with a fourth one that arises naturally and also fails to be totally separated.
We consider two kinds of ordinal codes to obtain the above results. The first ones are Brouwer codes, inductively defined by constructors for zero, successor and countable limits. The second ones are defined together with their interpretations, by induction-recursion in the sense of [9, 10, 11], so that a limit constructor is indexed by any previously constructed ordinal, rather than just . A crucial ingredient of the compact totally separated interpretation is a certain squashed sum, first defined in [15, Section 10] and generalized here as an extended sum for our purposes, with the aid of the theory of injective types [18, 8].
We would like to emphasize an important methodological difference with our previous work [13, 14]. There we worked classically using set theory, with externally defined models to establish our results. Here, instead, we work constructively, reasoning internally in our type theory, where the beginning of this transition took place in [15], informally within constructive mathematics without specifying any particular formal foundation.
Finally, although the fact that computable or constructively definable functions are continuous [34, 47] plays a crucial role in the link of topology with computer science and constructive mathematics, here, as in [15], we do not assume Brouwerian continuity axioms [47, 1]. In particular, we make no continuity assumption for the boolean predicate in the definition of compactness of the type , as opposed to our previous work [13, 14], so that our results hold in all topos models of (univalent) type theory [44] and are consistent with classical principles, including excluded middle and choice (but not with global choice, due to our use of univalence).
This is a full version of the four-page abstract [17], with further results, and builds on [15]. All mathematics reported here has been formalized in Agda [35], in TypeTopology [20], and a companion Agda file [19] lists each numbered item of this paper together with what establishes it.
Organization
Section 2 describes our type theory and introduces notation and terminology. Section 3 defines and discusses discrete and totally separated types, covering their closure properties, isolated points and the totally separated reflection. Section 4 does the same for compact types, and discusses the interplay of the three notions, a certain micro-Tychonoff theorem, and the extension of a family of compact types along an embedding. Section 5 fixes our conventions for ordinals and their arithmetic, and constructs extended sums and suprema. Section 6 discusses five interpretations of Brouwer codes as ordinals satisfying various combinations of compactness, discreteness, total separation and trichotomy. Section 7 generalizes Brouwer codes to an inductive-recursive universe in which the branching of a sum may be indexed by any previously constructed discrete ordinal, rather than just , with two interpretations, one trichotomous and the other compact, and gives a decision procedure for telling whether a point of the compact interpretation is isolated or a topological limit point. Section 8 summarizes the results, discusses the reach of these systems and describes the formalization.
2. Preliminaries
We work constructively and we adopt the foundation described in the HoTT Book [41]. In this section, which can be consulted on demand, we fix terminology and notation, and prove some auxiliary facts. We also recall basic notions from constructive mathematics, such as apartness relations and omniscience taboos.
2.1. Our type theory
We work in intensional Martin-Löf type theory with an empty type , a one-element type with point , a two-element type with points , a type of natural numbers, the type formers (binary sum or coproduct), (product), (sum or disjoint union), types, identity types denoted by the equality sign , and a hierarchy of universes closed under them, with the first and the next. Binary products, written , arise both as general products with index type and as sums of constant families, and we choose the latter incarnation by default. We often write a function type in the exponential form , as in the Cantor type .
For a family and an identification , we define , by induction on considering the reflexivity identification , with the family omitted when it is understood from the context. We say that a point is transported along to get a point of the type .
Definition 2.1 (Emptiness, negation and decidability).
We define
When we think of the type as a mathematical statement, the emptiness of amounts to its negation and is written . We say that a type is decidable if we can decide whether it is pointed or empty:
We remark that sometimes in the literature the terminology “ is decidable” is used to mean that has decidable equality instead. Here we say that is discrete to mean that it has decidable equality (Section 3). We also remark that we use non-empty to indicate a double negation, as opposed to the positive statement of inhabitation (Section 2.2) that is often adopted in the constructive mathematics literature [3].
Definition 2.2 (Logical equivalence).
Two types and are logically equivalent if each maps into the other:
When the types and are mathematical statements, we often just say “equivalent” rather than “logically equivalent”, leaving the context to resolve the ambiguity with the notion of type equivalence (Definition 2.8).
2.2. Univalent foundations
To this type theory we add the univalence axiom [41, 49] and set quotients. Univalence gives function extensionality and propositional extensionality, and set quotients give propositional truncations and set replacement. The formalization behind this paper [19] records where each of the above assumptions is used, taking them as explicit hypotheses wherever they are needed. Full univalence in this paper is assumed from Section 5 onwards, although not all results need it, the earlier sections using only its extensionality consequences.
A proposition, or subsingleton, is a type with at most one element. We write for the propositional truncation of a type , and and for the truncations of and . A type is pointed when it is equipped with a point, inhabited when its truncation is pointed, and non-empty when its emptiness is contradictory, that is, when holds. We also read truncation in words, saying that something holds in an unspecified way, or a similar mode of expression, when what is asserted is the truncation of the type of data establishing it. For example a type is compact in an unspecified way when the type of its compactness data is inhabited. When the disjuncts of a sum are mutually exclusive propositions, the sum is already a proposition, so the truncation makes no difference and we write “or” for either, as e.g. in the trichotomy of Definition 5.6.
Definition 2.3 (Singletons).
A type is a singleton or contractible if it has a point , its center of contraction, to which every point is equal:
For a family , there is a unique with when the sum of is a singleton:
A singleton is a proposition, and a pointed proposition is a singleton, and being a singleton is a property.
Definition 2.4 (Homotopy isolated points and sets).
A point is homotopy isolated if the identity type is a proposition for every :
A type is a set if all of its points are homotopy isolated.
Call a function weakly constant if any two of its values are equal.
Theorem 2.5 (Hedberg [23]).
If the identity type admits a weakly constant endofunction for every , then is homotopy isolated. Hence if this holds at every , then is a set.
Proof.
Fix , and write for the weakly constant endofunction of , and for its value on . We first show that every is the composite of followed by , by induction on , whose endpoint varies with it: for this is followed by , which is . Given , both are then composites of with values of on , and those two values are equal by weak constancy, so . Thus is a proposition. As was arbitrary, is homotopy isolated. ∎
Definition 2.6 (The type of propositions).
We write for the type of propositions in a universe :
whose two canonical elements are and . Propositional extensionality makes two elements of equal exactly when they are logically equivalent, and is a set. We omit the universe subscript when it is understood from the context.
Definition 2.7 (Base and fiber).
For a family we call the base or index type of the sum , that is, , and the fiber over . The fiber of a map over a point is the type of points that sends to :
The two usages agree up to type equivalence, the fiber of the first projection over being equivalent to .
Definition 2.8 (Type equivalences).
A map is an equivalence if its fibers are all singletons:
With the above terminology, this says that for every there is a unique with . We write for the type of equivalences from to :
Definition 2.9 (Surjections and induction along them).
A map is a surjection if its fibers are all inhabited:
This amounts to saying that . A surjection supports surjection induction: in order to prove a proposition valued at every , it is enough to prove at every . Conversely, a map supporting this principle is a surjection.
Definition 2.10 (Embeddings).
A map is an embedding, written , if its fibers are all propositions:
An embedding is left cancellable, in the sense that implies , and conversely a left cancellable map into a set is an embedding, so that the two notions agree for maps between sets.
We remark that embeddings in this sense are homotopical embeddings rather than topological embeddings. For example, the type of rationals is embedded into the type of Dedekind reals, but not topologically. In the topological topos the rationals get interpreted as a discrete space, and the Dedekind reals as the real line with its usual topology, and the discrete rationals are not a subspace of the real line. Moreover, the Dedekind reals are not the homotopy type of the reals, which would be a singleton, but rather a set in the above sense.
Definition 2.11 (Complemented families).
A family is complemented if is decidable for every . A complemented family of propositions on amounts to a function , its characteristic function.
Definition 2.12 (Subsets).
A subset of a type is a map from to the type of propositions of Definition 2.6:
Equivalently, a subset is a proposition valued map . We write , and say that is a member of , when the proposition holds.
A proposition valued family is equivalently an embedding , the family given by its fibers, and when the family is complemented the embedding is classified by a map , as illustrated by the following pullback diagram:
In models such as Johnstone’s topological topos, complemented subsets get interpreted as clopens.
Definition 2.13 (Image).
A point is in the image of a map when some is sent to in an unspecified way, and the image of is the type of the points of that are in it:
The image of a subset of along is the subset of whose members are the points that some member of is sent to in an unspecified way:
The corestriction of is the map that sends to together with a witness that it is in the image, and it is a surjection.
Definition 2.14 (Small and locally small types).
A type is -small if it is equivalent to a type in the universe , and it is locally -small if the identity type is -small for every .
Being small is a proposition if and only if univalence holds.
Definition 2.15 (Set replacement).
Set replacement is the principle that, for a map , if is -small and is a locally -small set, then the image of (Definition 2.13) is small.
This is the particular case for sets of a more general replacement principle first identified and studied by Rijke [42, 43].
Definition 2.16 (Set quotients).
Set quotients exist when, for every type and every -valued equivalence relation on , there is a set , the set quotient of by , with a map that identifies related points and is universal: every map into a set that identifies related points factors as for a unique .
Set replacement is equivalent to the existence of set quotients.
2.3. Constructive mathematics
Although the general principle of double negation elimination is equivalent to excluded middle, it does hold constructively in many particular examples of interest.
Definition 2.17 (-separatedness).
A type is -separated if identifications in it are -stable:
A type with decidable equality is -separated, because decidable types are -stable.
Lemma 2.18.
Every -separated type is a set.
Proof.
Compose the natural map with the given , obtaining an endofunction of . It is weakly constant, because is a negation and hence a proposition, so that any two intermediate values are equal. The result then follows by Theorem 2.5. ∎
Definition 2.19 (Apartness and tightness).
An apartness on a type is a proposition valued relation which is
- (1)
irreflexive: ,
- (2)
symmetric: , and
- (3)
cotransitive: .
It is tight if implies , for all .
An apartness is the positive counterpart of the negation of equality, in that asserts a difference where only denies equality [4]. Irreflexivity makes an apartness imply negation of equality, and hence makes equality imply the negation of apartness. Tightness asks for the converse of the latter. It follows that a type carrying a tight apartness is -separated, and hence a set by Lemma 2.18.
Definition 2.20 (Extreme density).
For a map the following are equivalent.
- (1)
The complement of the image of is empty:
- (2)
No point of lies outside the image of :
A map satisfying either, and hence both, of these conditions is called extremely dense, and extreme density is a proposition. An alternative terminology, not adopted here, is -density.
Proof.
For any type the negations and are logically equivalent, so the truncation in can be dropped under the inner negation. Extreme density is a proposition, being a negation. ∎
In the presence of the principle of excluded middle, a map is extremely dense if and only if it is a surjection. Extreme density is stronger than density in the topological sense. The rationals are dense in the reals in the usual sense, but the inclusion of the rationals into the Dedekind reals is not extremely dense, since irrational numbers lie outside its image.
Lemma 2.21.
An extremely dense map into a family of -separated types is right-cancellable: if is extremely dense, if has -separated for every , and if satisfy for every , then .
In particular, taking constant, two maps into a -separated type that agree after composition with are equal.
Proof.
For it is enough to prove , -separatedness of supplying and function extensionality supplying . If then no satisfies , since an identification transports the hypothesis to , so lies outside the image of , contradicting extreme density. ∎
Lemma 2.22.
The embedding that sends to and to is extremely dense.
Proof.
The map is an embedding because its fiber over is , a sum of two propositions that exclude each other. Let lie outside the image, so that and , these being the two values of the map. Logically equivalent propositions are equal, so would give , and would give . Hence and , which is a contradiction. So no point of lies outside the image. ∎
The fiber of this map over is the decidability of , so its extreme density says that no proposition can fail to be decidable, whereas excluded middle would say that every proposition is decidable.
Definition 2.23 (Global choice).
Global choice for a universe is the principle that every type in is decidable, so that given any type we can either produce a point of or establish that is empty, that is,
Equivalently, global choice says that we can choose a point of every non-empty type in ,
since a decidable type is -stable and, conversely, the type is non-empty for every . It is a classical principle, stronger than the axiom of choice, and we do not assume it, but it arises as a so-called constructive taboo in the conclusion of some statements.
Definition 2.24 (Excluded middle).
Excluded middle for a universe says that every proposition in is decidable:
The following taboos also arise in some of the mathematical questions considered in this paper.
Definition 2.25 (Bishop’s principles of omniscience [2]).
Bishop’s (limited principle of omniscience) decides whether a binary sequence takes the value somewhere, and (weak limited principle of omniscience) decides whether it has value everywhere:
Equivalently, the principle says that the finiteness of every conatural number is decidable, and says that it is decidable whether a conatural number is the point at infinity (Example 3.1). We use whichever formulation is convenient. In the vocabulary of this paper, -compactness of is and -compactness of is (Examples 4.5).
Excluded middle gives , which gives . The converse of the latter follows from Markov’s principle (namely that if a complemented family over has non-empty sum then its sum is pointed). All of these are independent of our type theory. They hold under classical logic and fail in models where all functions are continuous or computable, such as Johnstone’s topological topos [27] or Hyland’s effective topos [26] respectively. We neither assume nor deny them. When we say that something fails constructively, we mean that it implies a taboo. Saying instead that it is false would be an implication into the empty type, which is a stronger statement. The same applies to the doubly negated forms, such as , which are weaker but still independent. Global choice (Definition 2.23) is stronger than all of them, since it decides every type.
We do not assume any Brouwerian continuity axiom. Assuming continuity would settle the above taboos negatively, since it refutes and hence , whereas we keep them undecided in order to stay compatible with classical mathematics, so that our results hold in every model of our foundation, in particular -toposes [44], the boolean ones included.
Remark 2.26 (Weak topological toposes).
The statement is independent of our type theory and can be seen as a weak continuity principle [16]. We have that is equivalent to the existence of a function that is not continuous, and to every function being -continuous, the double negation being removable under Markov’s principle (which we are not assuming). We think of toposes in which holds as weak topological toposes.
This remark is the inspiration behind Definition 7.13.
2.4. Retracts and maps of sums
Definition 2.27 (Retracts).
A type is a retract of a type if there are specified maps and with the identity. We call a retraction and a section.
Definition 2.28 (Maps of sums).
Let and be families of types, let be a map, and let be a map for every . The map of the sums induced by and applies to the index and to the fiber component:
Lemma 2.29.
The map is
- (1)
an equivalence if is one and every is,
- (2)
an embedding if is one and every is,
- (3)
extremely dense if is and every is,
- (4)
a retraction if is the identity and every is.
Proof.
The fiber of over a point of is the sum, over the points of the fiber of over , of the fiber of over the point of obtained from by transport along . If the fibers of and of every are singletons, then so are these, a sum of singleton types over a singleton type being a singleton, which gives (1). If they are propositions, then so are these, a sum of propositions over a proposition being a proposition, which gives (2).
For (3), let be a point of and assume that no point of is sent to it. The assumption to be contradicted is itself a negation, so we may reason under a double negation, and extreme density of supplies with . Transporting along backwards gives a point of , and extreme density of supplies mapped to it, so that , which is the required contradiction.
For (4), let be a section of for every . Then is a section of , the two composing to , which is the identity. ∎
3. Totally separated types
This section studies the notions of discrete type, isolated point, and totally separated type. Compactness, which interacts with all of them, is discussed in Section 4.
The following type, already mentioned in Section 1, plays a major role in this paper and also illustrates many concepts.
Example 3.1.
The type of conaturals, equivalently the final coalgebra of , is the type of decreasing binary sequences,
Being decreasing is a proposition, so the first projection embeds into the Cantor type , and we write for the -th digit of . This embedding is a section of the map that forces a binary sequence to be decreasing and leaves the decreasing sequences unchanged, so is a retract of the Cantor type. Write for the inclusion and for its value at , the sequence of ones followed by zeros,
so that is constantly and prefixes a to . We let be the constantly sequence. For and we write to say that the -th digit of is , and to say that it is , so that the two are negations of each other. We say that is finite when for some , equivalently when for some .
3.1. Discrete types and isolated points
Definition 3.2 (Isolatedness and discreteness).
A point is isolated if we can decide, for every , whether and are equal:
A type is discrete if every point of is isolated, which amounts to saying that has decidable equality.
Examples 3.3.
- (1)
The types , and are discrete, and so is every proposition.
- (2)
The type of natural numbers is discrete.
- (3)
The type is discrete if and only if holds.
- (4)
The finite points of of the form are isolated.
- (5)
The point of is isolated if and only if holds.
- (6)
The map sending to and the added point to is an extremely dense embedding (Definition 2.20).
Proof.
Every proposition is discrete, since any two of its points are equal. The types and are propositions, and is discrete, its two points being distinct.
The natural numbers are discrete, with equality decided by induction.
A finite point is isolated, because holds exactly when for and , which is decided by inspecting finitely many digits.
If is discrete then in particular is isolated, and if is isolated then holds, because a binary sequence gives the conatural number with digits (Example 3.1), and exactly when is constantly . Conversely, makes discrete, because being decreasing is a proposition, so that two points are equal exactly when their digits agree, which is to say that the sequence is constantly .
The map is an embedding, its fibers being propositions because is an embedding, because is a set, which makes the constant map at an embedding, and because is not finite, so that no fiber meets both cases, and it is extremely dense, because a point of outside its image would be neither finite nor equal to , which is contradictory. ∎
Lemma 3.4.
- (1)
Every discrete type is a set.
- (2)
Every isolated point is homotopy isolated (Definition 2.4).
- (3)
Being isolated and being discrete are propositions.
Proof.
From decidability of we get an endofunction of that returns a fixed identification in the positive case and is vacuous in the negative one, hence is weakly constant, so Hedberg’s Theorem 2.5 applies, at a single point for (2) and at every point for (1).
For the last item, being isolated at is a -type of decidability statements about identity types, and to show that it is a proposition we may assume a witness, since a type is a proposition as soon as it is one under the assumption of a point. That assumption makes each type a proposition, by (2), so each decidability statement is a binary sum of two propositions that exclude each other, hence a proposition, and so is the -type. Being discrete is then a -type of propositions. ∎
Remark 3.5.
Classically, isolatedness and homotopy isolatedness (Definition 2.4) coincide. One direction is constructive, every isolated point being homotopy isolated (Lemma 3.4(2)), and for the other, excluded middle makes the proposition decidable. Constructively the two differ: is a set, so every point is homotopy isolated, whereas is isolated if and only if holds (Examples 3.3).
Proposition 3.6.
- (1)
Isolatedness is preserved by , , and hence discreteness is closed under binary sums.
- (2)
Discreteness is closed under retracts.
- (3)
A subtype of a discrete type is discrete, and, more generally, at a discrete index type the -types of discrete types are discrete, so that in particular binary products are.
- (4)
At any index type , if and are isolated then so is , and conversely, isolatedness of gives isolatedness of when is a set, and for products also of , with no hypothesis. (Isolatedness of the first component of a general sum needs the fibers to be compact (Lemma 4.19).)
- (5)
Left-cancellable maps, embeddings and equivalences reflect isolatedness, and equivalences also preserve isolatedness, and preserve and reflect discreteness.
Proof.
(1) is isolated when is, because an element of is either of the form , and then equality with reduces to , or of the form , and then the two are distinct, and symmetrically for . Discreteness of follows by cases. (2) For a retraction with section , decide in the discrete type. Equality of these two values gives after applying the retraction and using , and their inequality gives .
(3) A proposition valued subtype of a discrete type is discrete because equality of pairs reduces to equality of first components, the second being a proposition. For -types with a discrete index, decide first components. If they differ, the pairs differ, and if they agree, transport and decide the second.
(4) For a pair of isolated points, the same case analysis works at any index type. Isolatedness of decides the first components, and when they agree the identification between them is , an isolated point being homotopy isolated (Lemma 3.4(2)), so that the second components are compared without transport. Conversely, from isolatedness of we recover isolatedness of by pairing an arbitrary with , for which we need the identification of first components to be unique, that is, for to be a set. For the set hypothesis is unnecessary, the fiber not depending on the first component, and there isolatedness of is recovered as well, by pairing an arbitrary with .
(5) A left-cancellable reflects isolatedness, since to decide we decide and cancel. Embeddings and equivalences are left cancellable. An equivalence also preserves isolatedness, being left cancellable in the other direction as well. ∎
Lemma 3.7.
- (1)
If a type has two distinct points, then discreteness of implies that the emptiness of is decidable.
- (2)
A map out of a proposition into homotopy isolated points, in particular into isolated points, is always an embedding.
Proof.
For the first claim, let in and decide, in the discrete type , whether the two constant maps and are equal. If they are, then at every , so must be empty. If they are not, then cannot be empty, since over an empty any two maps are equal.
For the second, let be a proposition and land in homotopy isolated points. The fiber of over is , and any two of its elements have equal first components, since is a proposition, and equal second components, since is a proposition by homotopy isolatedness. So the fibers are propositions, and hence is an embedding. Isolated points are homotopy isolated (Lemma 3.4(2)), which gives the statement for maps into isolated points. ∎
3.2. Totally separated types
The following is a Boolean Leibniz principle, whose classical topological reading is that the clopens separate the points.
Definition 3.8 (Total separatedness).
A type is totally separated if the maps separate the points of , in the positive sense that for all , if for every , then . Write
for the equivalence relation that and are indistinguishable by -valued maps, so that total separatedness amounts to .
This notion is classically uninteresting, because excluded middle implies that every set is totally separated, in view of Lemma 3.9(1).
Lemma 3.9.
- (1)
Every discrete type is totally separated.
- (2)
Every totally separated type is -separated.
- (3)
Every totally separated type is a set.
- (4)
Being totally separated is a proposition.
Proof.
If is discrete and , apply the hypothesis to the characteristic function of , which sends to . It must then send to as well, which for that particular function means .
For -separatedness, suppose . For each we get by applying , and is -separated because equality in it is decidable. So , and total separatedness gives . Being a set then follows, since -separated types are sets by Lemma 2.18.
For the last item, given a witness of total separatedness the type is a set by (3), so total separatedness is a -type of identity types of a set, hence a proposition, and a type is a proposition as soon as it is one under the assumption of a point of it. ∎
Examples 3.10.
- (1)
- (2)
The type of propositions fails to be totally separated for constructive reasons: if is -separated (in particular, if it is totally separated), then excluded middle holds for (Definition 2.24).
- (3)
More relevantly for us, the type fails to be totally separated constructively, namely its total separatedness implies . This example is [22, Theorem 2.7], and is the prototype here for the failure of total separatedness proved in Section 6.2 below.
We can visualise the type of item (3) as a sequence that converges to two distinct points at infinity:
In classical topology, in a Hausdorff space, and hence in a totally separated space (the clopens separate the points), the intersection of two compact subsets is compact. The type gives a counterexample:
Proof of Examples 3.10(2,3).
(2) Let be a proposition with , and regard it as a point . Then holds if and only if , so gives , and -separatedness of gives , hence . That is double negation elimination, which is equivalent to excluded middle. Total separatedness gives -separatedness by Lemma 3.9(2).
(3) The type has two copies of the point at infinity, namely the pairs and , which are distinct because is a set, so that the fibers over are compared without transport. A map separating them gives the two maps and from to , which agree at every finite point, the type being empty, and differ at , and deciding whether a conatural number is amounts to (Definition 2.25). So leaves the two points indistinguishable by -valued maps, and total separatedness would then identify them, so total separatedness of the sum gives . ∎
Write
for the relation that some -valued map separates from . For every type , whether or not it is totally separated, this is an apartness: irreflexivity says that is impossible, symmetry is clear, and for cotransitivity, given with and any , decide in , which gives in one case and in the other.
Proposition 3.11.
The following are equivalent for any type .
- (1)
is totally separated, meaning that .
- (2)
The quasi-component of every point is a singleton.
- (3)
The evaluation function that maps to the function is an embedding.
- (4)
The apartness relation is tight.
Proof.
(1)(2). The quasi-component of a point has the point , where witnesses the reflexivity of . Assuming (1), any point of the quasi-component has , and the second components then agree because is a proposition, being a -type of identity types in the set . So the quasi-component of is a singleton, with center . Conversely, assume (2) and let witness . The points and of the quasi-component of are equal, and their first components give .
(1)(3). An embedding is a map whose fibers are propositions, and the fiber of over a point of is the type
By function extensionality, an identification amounts to . Assuming (3), if then the points and , where is the identification that gives in this way, lie in the fiber over , which is a proposition, so they are equal and their first components give . Conversely, assuming (1), any two points of a fiber have equal first components, and their second components then agree because is a set, being a product of copies of the set .
(1)(4). Tightness of says that implies , and the hypothesis says that no separates from . The truncation in can be dropped, because the statement is negated and hence a proposition. Since is decidable in , the hypothesis is equivalent to for every , that is, to . So tightness of and total separatedness are the same assertion. ∎
Proposition 3.12.
Total separatedness is closed under
- (1)
retracts, hence under equivalence,
- (2)
binary products,
- (3)
sums when the index type is discrete, and, as the special case of this indexed by , under binary sums,
- (4)
arbitrary products.
Proof.
For retracts, let be a retraction with section , and let in . Testing and against the predicates of the form with gives , hence by the total separatedness of , and applying gives .
For sums over a discrete index, let in . Testing against the predicates that ignore the second component gives in the index, and hence by discreteness and Lemma 3.9(1). Let be the transport of along this identification. Given , define a predicate on by deciding, for each index , whether , which discreteness allows, and sending to the value of at the transport of along the identification when there is one, and to when there is not. A discrete type is a set (Lemma 3.4(1)), so the identification decided at itself is , and the predicate takes the value at . Testing and against it gives . So , and the total separatedness of gives , which together with gives . Binary sums are the case of a two-element discrete index.
For products, let in , and fix and . Testing and against the predicate gives , so that , and the total separatedness of gives . Since was arbitrary, the functions and agree at every point and hence are equal. Binary products are the case of a two-element index. ∎
Examples 3.13.
- (1)
Total separatedness fails constructively to be closed under . The index type and the fibers of the type are totally separated, whereas its own total separatedness implies (Examples 3.10(3)).
- (2)
The simple types are the smallest collection of types containing and closed under function types, and the Baire type is one of them. Every simple type is totally separated and pointed, and has as a retract. More generally, every retract of , such as the type , is a retract of every simple type.
- (3)
Total separatedness also fails constructively to be closed under surjective images, as we will see in Example 6.10.
Proof.
(1) The index type is a retract of (Example 3.1), and the Cantor type and the fibers are products of copies of , which is totally separated, being discrete (Lemma 3.9(1)). So the index type and the fibers are totally separated, because total separatedness is closed under products and retracts (Proposition 3.12).
(2) All three claims are proved by induction on the construction of the simple types. The type is discrete and hence totally separated, and total separatedness is closed under (Proposition 3.12(4)). Pointedness holds at the base type and passes to function types by taking constant functions. For the retract claim, the induction step is that if is a retract of and is pointed, then is a retract of , sending a point of to the constant function at its image in , and recovering it from a function by evaluating at the point of and retracting. A retract of is a retract of the base type, so this step carries it through the function types, and the type is a retract of .
(3) The Cantor type is a product of copies of , and so is totally separated by the same reasoning as in (1). Two of its points are equal exactly when they agree at every index, so its discreteness decides, for any binary sequence, whether it is equal to the constant sequence , that is, whether it is constantly , which is in the formulation of Definition 2.25. ∎
We have seen that totally separated types are not in general closed under sums. The following is a sufficient condition for a sum to be totally separated, which will be useful for our purposes (Theorem 6.7(2)).
Lemma 3.14.
For any family with totally separated for every and with a proposition, its sum is totally separated.
Proof.
Let . Testing against the predicates that ignore the second component gives , and is totally separated, being a retract (Example 3.1) of the totally separated type (Examples 3.13(3)), so . Transport along this identification to , so that , and it remains to show that , for which, being totally separated, it is enough to show that . So let . As is -separated it is enough to rule out , so suppose that it holds. If were a finite point , then, that point being isolated (Examples 3.3), would extend to a predicate on by deciding, for each index , whether , applying after transport when it is and taking the value when it is not, as in the proof of Proposition 3.12 for a discrete index, and testing and against it would give . So is not a finite point. If were , then , since is a proposition, and again . So . But a conatural number that is not finite is , which is a contradiction. ∎
Every type can be turned into a totally separated type in a universal way.
Theorem 3.15.
Every type has a totally separated reflection , constructed as the image of the evaluation map defined in Proposition 3.11(3), together with a reflector , such that
- (1)
is totally separated, and is a surjection,
- (2)
for every totally separated and , there is a unique with , or, equivalently, precomposition with is an equivalence ,
- (3)
the reflector identifies and if and only if .
Proof.
Put , a subtype of , and let be the corestriction of , which is a surjection onto its image, so that surjection induction (Definition 2.9) is available for .
(1) is totally separated, since its elements are pairs with a truncated witness of being in the image, hence a proposition, so two elements are equal as soon as their first components are. Given , test against the predicates for each , which gives for every , so .
(2) Let be totally separated and . Uniqueness is immediate from being a surjection and a set (Lemma 3.9(3)). For existence, note that by Proposition 3.11(3) the map is an embedding, so the fibers are propositions, and this lets us define by untruncating , because the target is a proposition, and taking the unique with . By construction, for every , so that at every , and the total separatedness of gives .
(3) If then their first components agree, which is exactly . Conversely gives equality of first components, and the second components are propositions. ∎
A special case of interest of Theorem 3.15(2) is , which shows that the boolean valued predicates on are in canonical bijection with those on .
4. Compact types
This section studies the notion of compact type, including its closure properties, its interplay with the notions of discreteness and total separatedness, as well as the extension of families of compact types along embeddings, which is crucial for the purposes of Sections 6 and 7.
4.1. Definitions and first examples
Definition 4.1 (Compactness).
A type is -compact, or compact for short, if it is decidable, for every , whether has a root:
We also consider the weaker notions of -compactness and -compactness, obtained by replacing by and by respectively.
The same notions can be equivalently formulated with an arbitrary complemented family in place of a -valued predicate.
Lemma 4.2.
For any type and any universe , the compactness of is logically equivalent to the statement that the sum is decidable for every complemented family , and also to the restriction of this to proposition valued families .
Proof.
A complemented family has a characteristic function , with giving and refuting it, and then and are logically equivalent for every , because rules out . In the other direction, a predicate gives the family sending to when and to when , which is complemented and proposition valued, and which lives in any universe, because and do. Pointwise logically equivalent families have logically equivalent -types, and decidability is invariant under logical equivalence. ∎
The notions of -compactness and -compactness, and the pointed compactness of Lemma 4.6 below, can be treated by the same argument. In view of Lemma 4.2, we say simply that a type is compact, using whichever of these formulations is convenient for proofs, and saying which one when this matters. In particular, compactness does not depend on the universe .
Lemma 4.3.
Every compact type is decidable, and every decidable proposition is compact.
Proof.
For the first claim, apply compactness of to the constantly predicate. Either it has a root, which in particular supplies a point of , or else for every point of , which gives .
For the second, let be a decidable proposition and let . If then for every vacuously. If , decide the value of . If then has a root. If then, since is a proposition, every is equal to , so . ∎
Proposition 4.4.
Every type in a universe is compact if and only if global choice holds for (Definition 2.23).
Proof.
Assume global choice, let and let . Then is a type in , so it is decidable by global choice, which amounts to the compactness of . Conversely, if every type in is compact then every type in is decidable by Lemma 4.3. ∎
Global choice is not only constructively unacceptable, but also inconsistent with univalence [41, Corollary 3.2.7]. Nevertheless, in this paper we build many compact types in a constructive type theory compatible with univalence. We start from a trivial example and some basic, but important counterexamples.
Examples 4.5.
- (1)
Every finite type is compact, a finite type being one of the form , which includes the base case in the obvious inductive definition.
- (2)
is compact if and only if holds.
- (3)
is -compact if and only if holds.
- (4)
is -compact if and only if holds.
Compact types are closed under retracts, finite disjoint unions, images, and, when the index type is compact, under arbitrary sums (Section 4.3). Compactness, discreteness and total separatedness interact with function types much as their topological namesakes do, with arbitrary functions of type theory playing the role that continuous maps play in topology, but without any Brouwerian continuity axiom (Section 4.5). Under classical logic in the metatheory, the notions coincide with topological compactness in the model of simple types given by Kleene–Kreisel spaces [14, 29].
4.2. Compact pointed types
For reasons pertaining to constructivity, a number of definitions and theorems need to assume that the compact types under consideration are pointed. Moreover, it is convenient to work with the following characterization of compact pointed types, which we apply tacitly in the development that follows.
Lemma 4.6.
The following are equivalent for any type .
- (1)
is compact and pointed.
- (2)
For every we can find such that implies for all :
We call such an a universal witness for . It is a root of if and only if has some root.
We call a function assigning a universal witness to each a selection function for . In (2), a candidate root is produced before it is known whether a root exists.
Proof.
(1) implies (2). Let be compact and , and let . By compactness, either has a root , and we take , so that the implication holds vacuously because , or else for every , and we take , the conclusion of the implication being the assumption of this case.
(2) implies (1). Let , with universal witness . If then is a root of . If then for every by the universality of . This is precisely the case distinction required by compactness. For pointedness, apply the hypothesis to e.g. the constantly predicate, which gives a point of .
A universal witness is a candidate root. With a universal witness for , one direction is trivial, since if is a root then has a root. For the other, suppose for some . Then it is not the case that for every , since that would give , contradicting . By the contrapositive of the universality of , we conclude and so is a root. ∎
Examples 4.7.
- (1)
The type is compact pointed, with a selection function given by for any .
- (2)
The type of propositions in a universe is compact pointed too, despite excluded middle being undecided in our type theory.
- (3)
The type of Example 3.1 is an infinite compact type, with a root selection function (cf. Section 4.2). Moreover, is the infimum of the set of roots of , which may or may not be a root, but is a root if and only if has some root.
Proof.
For , take and suppose . We first get by cases on : it is immediate when , and when , substituting that equation into gives , a contradiction. Substituting into then gives , so is constantly .
For , decide the value of . If , take as a universal witness, the implication holding vacuously. If , take , and we must show that if also then is constantly . Two maps that agree at and agree everywhere, because the map is extremely dense (Lemma 2.22) and an extremely dense map into a -separated type is right-cancellable (Lemma 2.21), while is -separated, being discrete. Applying this to and the map constantly gives for every .
4.3. Closure properties of compact types
Theorem 4.8.
- (1)
The types and are compact, and so is every singleton.
- (2)
If and are compact, so is .
- (3)
If is compact and is compact for every , then is compact. In particular, the product is compact when both and are.
- (4)
If is a retract of and is compact, then so is . In particular, compactness is invariant under equivalence.
- (5)
If is a surjection and is compact, then so is , and hence so is the image of any map out of a compact type.
Proof.
By Lemma 4.2 we may take the given data to be a complemented family on the type under consideration rather than a -valued predicate, so that the task is to decide the sum of .
Items (2), (4) and (5) follow one pattern, which we record first. If is a map and is a complemented family on , then the composite is a complemented family on , and a point of gives the point of . So when is compact, the sum of is decidable, and what remains is to show that is empty in the case that is. This is where the hypothesis on is used.
(1) The types and are decidable propositions, and so is any singleton, so this is an instance of Lemma 4.3.
(2) Apply the pattern to the injections and , whose domains are compact by hypothesis. If either of and has a point, then so does . If both are empty, then so is , because every point of is of the form or .
(3) For each , the family on is complemented, and so the compactness of the fibers makes the family
on complemented. The compactness of then decides the sum of , which is the sum of up to reassociation, and decidability is invariant under logical equivalence. Binary products are the case of a constant family .
(4) Apply the pattern to the retraction , whose section satisfies for every . A point of gives the point of , where is obtained from by transport along , and so is empty when is. An equivalence is in particular a retraction.
(5) Apply the pattern to the surjection . If is empty, then holds for every , and hence holds for every by surjection induction (Definition 2.9), which is available because negations are propositions. Therefore is empty. The image of a map out of a compact type is covered by applying this to the corestriction of , which is a surjection. ∎
Proposition 4.9.
If is compact, then so is its totally separated reflection constructed in Theorem 3.15.
Proof.
The reflector is a surjection (Theorem 3.15(1)), and compactness passes to surjective images (Theorem 4.8(5)). ∎
Corollary 4.10.
Pointed compactness is closed under
- (1)
retracts, and hence equivalence ,
- (2)
sums, and hence binary products and coproducts ,
- (3)
surjective images .
Proof.
A compact pointed type is a compact type with a point (Lemma 4.6), and each of the three constructions preserves compactness by Theorem 4.8. What remains is to produce a point in each case.
(1) A retraction sends a point of to a point of , and an equivalence is in particular a retraction.
(2) A point of the base together with a point of the fiber is a point of . Binary products are the case of a constant family. Binary coproducts are compact by Theorem 4.8(2), and a point of gives the point of .
(3) A surjection sends a point of to a point of . ∎
Proposition 4.11.
Let be a compact type.
- (1)
If is a complemented, proposition valued family on , then the subtype is compact.
- (2)
If and are families on and holds, then we can decide between and .
- (3)
If is a complemented family on and is non-empty, then it is pointed.
Proof.
(1) Let be a complemented family on the subtype , so that what has to be decided is the sum of . The family
on is complemented. Indeed, decide . If is empty then so is . If , decide . A point of gives the point of , and if is empty then so is , because is a proposition, so that any is equal to and a point of transports to a point of . The compactness of now decides the sum of , which is the sum of up to reassociation.
(2) Write for the given point of and let be its indicator, with when lands in and when it lands in . The compactness of decides whether has a root. A root comes with a point of , and so gives a point of . If there is no root, then , and hence , for every .
(3) The compactness of decides the sum of , and a decidable type is -stable. ∎
Remark 4.12.
Tychonoff’s theorem in classical topology says that arbitrary products of compact spaces are compact. In our case, Theorem 4.8(3) gives this for binary, and hence finite, products of compact types. Without further axioms, it is not possible to prove an infinite generalization in our type theory, not even a countable one. With our type theoretical counterparts of the topological notions, the compactness of the Cantor type , the countable product of copies of , is independent, as it holds in the topological topos and in the Kleene–Vesley topos [48], but fails in the effective topos [26] due to the presence of Kleene trees (infinite binary trees with no computable paths, which give recursive counterexamples to König’s Lemma and hence the compactness of the Cantor space [30]).
4.4. -compactness and -compactness
Proposition 4.13.
- (1)
Each of -compactness and -compactness is a proposition.
- (2)
Any compact type is -compact.
- (3)
Any -compact type is -compact.
- (4)
If is -compact then is -stable.
- (5)
A type is -compact if and only if the constant map is isolated in .
- (6)
A type is -compact, respectively -compact, if and only if its totally separated reflection constructed in Theorem 3.15 is.
Proof.
(1) For each , the types and are propositions, and so is the decidability of a proposition.
(2) Compactness gives, for each predicate , either a root, whose truncation gives , or a proof that is constantly , which refutes it.
(3) Decide . In the positive case, is refuted, because a root of contradicts it, and this conclusion, being a negation, may be drawn from the truncated existence. In the negative case, no has , and hence for every , as has only two points.
(4) The proposition is decidable, and hence -elimination is applicable to get -stability.
(5) The -compactness of says that is decidable for every , while the isolatedness of says that is decidable for every . The type is pointwise equality of with the constant map, so the two types are equivalent and decidability is invariant under logical equivalence.
(6) Let and be corresponding predicates on and on , using Theorem 3.15(2) with . Decidability transfers along a logical equivalence, so it is enough to prove
A root of gives the root of . Conversely, the reflector is a surjection, so a root of has a preimage in an unspecified way, and any such preimage is a root of . If for every , then for every by composition with the reflector. Conversely, if for every , then for every by surjection induction along the reflector, the equations being propositions. ∎
The following are some closure properties of the two weaker notions of compactness.
Proposition 4.14.
- (1)
Both -compactness and -compactness pass to surjective images, and hence to retracts.
- (2)
If is -compact and is -compact for every , then the sum is -compact.
- (3)
Both notions pass to complemented subtypes.
Proof.
(1) Let be a surjection and let , and apply the compactness hypothesis on to the predicate .
For -compactness, a root of gives a root of , and so the truncated existence of the former gives that of the latter. If has no root, then neither has , because a root of has a preimage under in an unspecified way, and that preimage is a root of . This conclusion, being a negation, may be drawn from the truncated existence.
For -compactness, if for every , then for every by surjection induction along , the equations being propositions, and conversely by composition with . So the two universal statements are logically equivalent, and decidability transfers along a logical equivalence.
Images are the case of the corestriction, which is a surjection, and a retraction is a surjection.
(2) Let . For each , the -compactness of the fiber decides , and so there is a predicate with if and only if . The -compactness of decides , which is logically equivalent to , and this is after currying.
(3) Let be a complemented subset of , with subtype .
If is -compact, apply -compactness to the characteristic function of , which decides whether the subtype is inhabited. If it is not, then the subtype is empty, and an empty type is -compact. If it is, then a point of the subtype makes it a retract of , the points outside being sent to that point, and so the subtype is -compact by (1). This conclusion may be drawn from the inhabitedness of the subtype, because -compactness is a proposition (Proposition 4.13(1)).
If is -compact, a predicate on the subtype extends to a predicate on that takes the value outside , and the extension is constantly if and only if the given predicate is. So the -compactness of decides whether the extension is constantly , and hence whether the given predicate is. ∎
Proposition 4.15.
- (1)
A proposition is -compact if and only if it is decidable.
- (2)
The truncation of an -compact type is decidable.
- (3)
A non-empty -compact type is inhabited.
- (4)
A -compact type has decidable negation.
Proof.
(1) and (2) Apply -compactness to the constantly predicate. Every point of is a root of it, so that what is decided is the truncation , which gives (2). When is a proposition, the truncation is equivalent to , and so an -compact proposition is decidable. Conversely, a decidable proposition is -compact, by the argument of Lemma 4.3 with in place of .
(3) The truncation is decidable by (2). Its negation is logically equivalent to , which is ruled out by the non-emptiness of , and so the truncation holds, which says that is inhabited.
(4) Apply -compactness to the constantly predicate. What is decided is , which is logically equivalent to , because the type is empty. ∎
Proposition 4.16.
The following are equivalent for any type .
- (1)
is -compact and inhabited.
- (2)
Every has a universal witness in an unspecified way:
Moreover, the type is -compact if and only if it is empty or satisfies (2).
Proof.
(2) implies (1). Taking constantly gives a point of in an unspecified way, so that is inhabited. For -compactness, let and let be a universal witness for , available in an unspecified way. Deciding the value of either produces a root of or shows that is constantly , and so decides . This decision may be made under the truncation, because the decidability of a proposition is a proposition.
(1) implies (2). Let . By -compactness, either has a root in an unspecified way, and that root is a universal witness, the implication holding vacuously, or is constantly , and then any point of is a universal witness, one being available in an unspecified way from the inhabitedness of .
The final claim. An -compact type has decidable truncation by Proposition 4.15(2), and so is either inhabited, in which case it satisfies (2) by the equivalence just proved, or empty. Conversely, a type satisfying (2) is -compact by that equivalence, and so is an empty type, no predicate on it having a root. ∎
Proposition 4.17.
A type is -compact if and only if every has an infimum, that is, a greatest such that for every .
Proof.
Let be -compact and let . Decide whether is constantly . If it is, then is a lower bound of its values, and it is the greatest element of , so that it is the infimum. If it is not, then is a lower bound, being the least element of , and is not a lower bound, as that would make constantly , so that is the infimum.
Conversely, suppose that every has an infimum, and consider the two possible values of . If it is , then , and hence , for every . If it is , then is not constantly , because that would make a lower bound of its values and so force . ∎
The infimum operator sends to a boolean that is precisely when has value everywhere, so that it defines a boolean universal quantifier with . This is compactness in the sense of synthetic topology with dominance . In fact, writing for the map sending a boolean to the constant predicate at it, an infimum operator is precisely an order theoretic right adjoint to , since the adjunction says that pointwise if and only if , which is to say that is the greatest lower bound of the values of .
In classical topology a space is compact if and only if every projection is a closed map. The notion appropriate here is that of a clopen map, one sending complemented subsets to complemented subsets, with the image of a subset along a map as in Definition 2.13.
Proposition 4.18.
A type is -compact if and only if every projection is a clopen map.
Proof.
Let be -compact, let be the characteristic function of a complemented subset, and let . Membership of in the image of that subset along the projection amounts to , which -compactness decides.
Conversely, take to be the one-element type and let . Consider the subset of with characteristic function . Membership of the point of in the image of that subset along the projection amounts to , so that the clopenness of this single projection gives the -compactness of . ∎
4.5. Interplay between the notions
We collect results that combine compactness, discreteness and total separatedness.
Lemma 4.19.
If is compact for every and the point of is isolated, then is isolated.
Proof.
Let , so that what has to be decided is . The family
on is complemented, because is isolated, and so the compactness of decides the sum of . If some has , then by taking first components. If none does, then , because an identification would give such a by transporting along it. ∎
Proposition 4.20.
- (1)
If is -compact and is discrete for every , then is discrete.
- (2)
If is compact, the discreteness of can be strengthened to for all .
Proof.
Given , the discreteness of each decides , so there is an indicator with if and otherwise.
(1) -compactness decides whether for every , which amounts to deciding , by function extensionality.
(2) Compactness decides whether has a root, and a root of is a point with , and the absence of one gives everywhere, and hence . ∎
Example 4.21.
The principle , the -compactness of (Examples 4.5(4)), gives the discreteness of the Cantor type by Proposition 4.20(1). Together with Examples 3.13(3), this makes the discreteness of equivalent to .
Definition 4.22 (Disconnectedness).
A type is disconnected if is a retract of it, or, equivalently, if some takes both values.
Proposition 4.20 has a partial converse.
Proposition 4.23.
If is disconnected and is discrete, then is -compact.
Proof.
Take first . The -compactness of is the isolatedness of the constant map in (Proposition 4.13(5)), and in a discrete type every point is isolated. A disconnected comes with a retraction onto , and composing with it and with its section makes a retract of , and discreteness passes to retracts (Proposition 3.6(2)). ∎
Proposition 4.24.
Let be disconnected.
- (1)
If is totally separated and is -compact, then is discrete.
- (2)
For arbitrary , if is -compact, then the totally separated reflection of Theorem 3.15 is discrete.
Proof.
(1) Take first , and let . Since is discrete, there is a map with when and when the two values differ. Applying the -compactness of to decides , which says that and agree at every -valued predicate, that is, that . If , then by total separatedness, and if not, then , because would give for every . So is discrete.
For a disconnected , a retraction of onto makes a retract of , and -compactness passes to retracts (Proposition 4.14(1)), so that the case just proved applies.
(2) A retraction of onto makes a retract of , as in (1), and is equivalent to because and have the same -valued predicates (Theorem 3.15(2) with ). So is a retract of and hence -compact (Proposition 4.14(1)). Now apply (1) to , which is totally separated (Theorem 3.15(1)). ∎
Examples 4.25.
The results of this subsection show that some types fail to be compact constructively.
- (1)
A -compact simple type (Examples 3.13(2)) gives .
- (2)
The -compactness of gives .
Proof.
(1) The type is a retract of every simple type (Examples 3.13(2)), and -compactness is inherited by retracts (Proposition 4.14 (1)), so is -compact, which is (Examples 4.5(4)).
(2) The type is totally separated, being a retract of (Example 3.1), which is totally separated (Examples 3.13(3)), and total separatedness passing to retracts (Proposition 3.12(1)), so Proposition 4.24(1) turns the -compactness of into the discreteness of , which is (Examples 3.3(3)). ∎
4.6. The micro-Tychonoff theorem
We now formulate and prove the smallest possible instance of Tychonoff’s theorem for our notion of compactness (cf. Remark 4.12) by restricting the index type to be a subsingleton and the indexed compact types to be pointed. A crucial application is the compactness of extended sums (Theorem 4.32), on which the main results of Sections 6 and 7 are based.
Theorem 4.26 (Micro-Tychonoff).
If is a proposition and is compact pointed for every , then is compact pointed.
Proof.
Let be a proposition, let be a selection function witnessing that is compact pointed for each , and let . For each , evaluation at ,
is an equivalence, because a product indexed by a proposition is the value at any point of that proposition. Carry the predicate across by setting , and define the candidate witness pointwise:
We claim is a universal witness for . So assume , and we must show for an arbitrary .
(1) The conclusion follows from . Suppose . The universality of for says that implies for every . Since and is a section of , the hypothesis is our assumption . Instantiating and using , we get . This conclusion no longer mentions the point , so that .
(2) The conclusion also follows from . If is empty then any two points of are equal, in particular , and so .
(3) Combining (1) and (2). Excluded middle, if it were available, would now finish the argument, since is a proposition, but it is not needed. Suppose . Then , so contraposing (1) gives , and then (2) gives . Thus implies . The value of is or , and in the first case it is also , so . ∎
Specializing to a constant family, this says that is compact pointed for any proposition and any type such that the pointedness of implies the compact pointedness of , whether or not holds.
Example 4.27.
The function type is compact pointed. Indeed is a proposition that implies the compact pointedness of , so Theorem 4.26 applies. The exponential is compact whether or not holds, even though the compactness of is itself, which is independent of our type theory (Examples 4.5(2)).
Remark 4.28.
- (1)
The proof of Theorem 4.26 does not go through the equivalence , which holds once a point is given and would transfer compact pointedness directly. Such a point is at hand only under the hypothesis that holds, whereas the universal witness has to be produced without deciding .
- (2)
The pointedness hypothesis is essential, since the corresponding statement for plain compactness fails constructively. Indeed, take , which is compact but not pointed. Then is , so the unpointed statement would make compact, and hence decidable (Lemma 4.3), for every proposition , which is the principle of weak excluded middle. Pointedness enters the proof of Theorem 4.26 in the definition of , which has to be a point of whether or not holds, and plain compactness provides no such point.
The hypothesis on the index type can be generalized from a proposition to a subtype of a finite type, because such a subtype is a finite sum of propositions.
Corollary 4.29.
Let be a finite type and an embedding. If the type is compact pointed for every , then so is .
Proof.
The embedding decomposes as the sum of its fibers, and currying the product over that sum gives
Each fiber is a proposition, being an embedding, so each inner product is compact pointed by Theorem 4.26. The outer product is a finite product of compact pointed types, which is compact pointed by Corollary 4.10(2), and pointed compactness is invariant under equivalence (Corollary 4.10(1)). ∎
4.7. Extension of families of compact types along embeddings
The above closure properties of compact types allow us to construct new compact types starting from examples such as finite types and . However, they do not reach far. To construct more compact types, we develop a generalization of a certain squashed sum constructed in [15], with the aid of the theory of algebraically injective types developed in [18]. It works by extending a family of types along an embedding and then summing the extended family. The extension operation witnesses the algebraic injectivity of the universe, and what makes the sum compact is that the fibers of an embedding are propositions, so that the micro-Tychonoff Theorem 4.26 is applicable.
Definition 4.30 (-extension).
Let be a family of types and an arbitrary map. The -extension of along is the family given by
where is the fiber of over .
This is illustrated by the following diagram, with the general case on the left, used in Section 7, and the special case of the embedding on the right, used in Section 6:
The point of the above construction is that we can extend from to without checking whether the argument of the desired extension is or not, which is not available in our constructive setting, as it amounts to (Examples 3.3(5)).
Lemma 4.31.
Let and .
- (1)
If is an embedding, the -extension restricts back to along up to type equivalence: for every we have .
- (2)
If for every , then .
Proof.
(1) If is an embedding then is a proposition, and it contains the point , so it is a singleton. A product indexed by a singleton is equivalent to its value at the center, whence .
(2) If for every then is empty, and a product indexed by the empty type is equivalent to the type . ∎
We refer to the sum of the family as the extended sum of the family .
Theorem 4.32 (Compactness of extended sums).
For any embedding into a compact pointed type and any family of compact pointed types, the extended sum is compact pointed.
Proof.
By the closure of pointed compactness under (Corollary 4.10(2)) applied to the family over the compact pointed base , it suffices to show that is compact pointed for every . By definition this is the product of the types over the index type , all of which are compact pointed by hypothesis, and is a proposition precisely because is an embedding. So the micro-Tychonoff Theorem 4.26 applies. ∎
Remark 4.33.
Theorem 4.32 is a type theoretic generalization of the fact that the squashed sum constructed in [15, Section 10] produces compact sets. In loc. cit., given countably many compact pointed subsets , we rescaled by prefixing the finite sequence , making the pieces disjoint, smaller in diameter, close together, and converging to the point as increases, and defined their squashed sum to be the set of those such that if is a prefix of then . This set is the closure of , which classically is this union together with . Constructively, it can be described as the union of the -indexed family
The defining formula for corresponds to the -extension formula of Definition 4.30, for the family along the embedding . Thus, the extended sum generalizes the squashed sum to any embedding into a compact pointed type and any -indexed family of compact pointed types.
Lemma 4.34.
For any map , not necessarily an embedding, and any family of totally separated types, the type is totally separated for every .
Proof.
The type is the product of the types over the index type , each of which is totally separated by hypothesis, and total separatedness is closed under arbitrary products (Proposition 3.12). ∎
Lemma 4.35.
For any map and any families such that is a retract of for every ,
- (1)
the type is a retract of for every ,
- (2)
the extended sum is a retract of the extended sum .
Proof.
(1) By Definition 4.30, the two types are products over the index type , and a product of retractions is a retraction of the corresponding products, the retraction and the section acting pointwise. (2) follows by Lemma 2.29(4), applied to the identity on and to the retractions of (1). ∎
Classically, every point of is of one of the forms , with , or . The following gives a constructive version of this.
Lemma 4.36 (Delayed binary sequences).
- (1)
The extended sum of the constant family at along the embedding is the type of delayed binary sequences, consisting of a time together with a binary sequence made available when is finite,
- (2)
This type is equivalent to .
Proof.
(1) By Definition 4.30, the extension of the constant family at along the embedding evaluates at a point to the type of functions from the fiber to , so that the extended sum is the sum of these function types over . A point of the fiber is a natural number together with an identification , which is what it means for to be finite (Example 3.1).
(2) In one direction, we define a map
A delayed binary sequence is encoded as the run of s prescribed by its time, followed by a and the delayed value. A conatural number is either or the result of prefixing a to a conatural number, decided by its first digit, and a binary sequence is a digit followed by a binary sequence, so that corecursion on defines by the two clauses: the sequence begins with and continues as applied to the witness that is finite, and, for prefixing a to , the sequence begins with and continues as , where is composed with the passage from finiteness of to finiteness of .
In the other direction, we first define two maps
as follows. A binary sequence is turned into a delayed one by taking its initial run of s as the time and what follows as the delayed value. For a sequence , let be that initial run, read as a conatural number and defined by the final-coalgebra presentation of Example 3.1: it is when begins with , and it prefixes a to the head of the tail of when begins with . When is finite, witnessed by together with an identification of with , the delayed value is the suffix of after that run,
The two together give the map
from to the type of delayed binary sequences.
The composite is the identity. Its first component asks for , which holds for by induction on from the two clauses, and for because begins with and continues as , so that is a fixed point of prefixing a , and is the unique such point. This proves the two cases and . These suffice by Lemma 2.21, applied to the two functions of that send to and to , because the map is extremely dense (Examples 3.3(6)) and the values of the two functions at lie in a -separated type. That type is the type of functions from finiteness of to , which is totally separated, since is, being a retract of (Example 3.1, Examples 3.13(3), Proposition 3.12(1, 4)), and totally separated types are -separated (Lemma 3.9(2)). The second component asks that , transported along the identification just established, be , and this follows from the two clauses by cases on the finiteness witness, the case of a positive witness using that is applied to the witness of finiteness of once its first digits are removed.
The composite is the identity as well. When begins with , the head of is , and the first clause gives , because the finiteness witness obtained by transporting along has size , which makes at that witness the tail of . When begins with , the head of prefixes a to the head of the tail of , and the second clause gives that begins with and continues as , the transported witness again having the size that makes agree with of the tail of . Induction on the digit index, with generalized, settles all digits: the first case does so at one stroke, and the second reduces the digit of index to the digit of index of the tail. The two composites being the identity, the map is an equivalence. ∎
Remark 4.37.
Notice that, more generally, for any type , the extended sum of the constant family at along the embedding is the type This type satisfies the universal property of the delay monad [5], and, moreover, is the final coalgebra of the functor part of this monad, but we will not prove these two facts here. Hence the extended sum along of an arbitrary countable family generalizes the delay monad, the type of the result being allowed to depend on the time at which it arrives.
5. Equipping compact types with well-orders
The compact types we construct in this paper all come equipped with well-orders, in the sense of [41, Section 10.3], because the operations used to build them, discussed in the previous section, preserve well-orders.
5.1. Ordinals in type theory
Let be a binary relation on a type . We say that an element is accessible whenever every is accessible. In particular, if an element has no predecessors, then it is vacuously accessible. This is an inductive definition with a constructor of type
which we leave unnamed. We say that the relation is well-founded if every element is accessible.
Lemma 5.1.
A binary relation on a type is well-founded if and only if the principle of transfinite induction holds: for every family ,
Proof.
The accessibility elimination rule turns a step
into a witness of for every accessible , so accessibility of every element gives transfinite induction for every family . Conversely, the constructor of the accessibility predicate is a step for the family accessibility, so transfinite induction applied to accessibility gives accessibility of every element. ∎
We say that the relation is extensional if any two elements with the same predecessors are equal: . An ordinal is a type equipped with a proposition valued binary relation which is transitive, well-founded and extensional. Such a relation is called a well-order on . We write for the type of ordinals with underlying type in , where we omit the subscript when it can be inferred from the context. The HoTT Book additionally requires the type to be a set, but this is automatic:
Lemma 5.2.
Any type equipped with a proposition valued extensional relation is a set.
Proof.
Let be a proposition valued extensional relation on a type . Consider the derived relation , that every predecessor of is a predecessor of . It is reflexive, and it is proposition valued because is. Extensionality of says exactly that it is antisymmetric, since and together say that and have the same predecessors. Now a type carrying a reflexive, antisymmetric, proposition valued relation is a set, since the relation lets us define, from an identification , a weakly constant endofunction of : transport the reflexivity of along the identification to get and , and apply antisymmetry, the constancy coming from being proposition valued. So Hedberg’s Theorem 2.5 applies. ∎
Examples 5.3.
- (1)
The type of natural numbers under its natural order is well-ordered, giving rise to an ordinal written .
- (2)
Any proposition ordered by the relation with empty graph is an ordinal, and in particular we get ordinals and .
- (3)
The two-element type ordered by is an ordinal.
- (4)
The type of propositions is an ordinal under the order when and .
Notation 5.4.
An ordinal is written with the symbol of its underlying type, so that is a point of the underlying type of the ordinal , a map is a map between the underlying types, and a notion such as compactness is a notion about the underlying type. This is the same convention by which a group is identified by its carrier. The order of an ordinal is written , the same symbol for every ordinal, with a subscript naming the ordinal only when several orders occur together, as in the definitions of the arithmetic operations below. The subscript on , and on the variants of it introduced later, names the universe of the underlying types, as it does on , and is left out where the context determines it.
By univalence, the type is itself an ordinal in the next universe, under the relation
where is the initial segment (lower set, or downward closure) of at , which is again an ordinal, with the points of below as its underlying type and the order inherited from :
In particular, being well-ordered, is a set by Lemma 5.2. Passing to initial segments preserves the order, in the sense that implies . We also use the initial-segment embedding order
where a simulation of into is a map that is order-preserving and initial-segment-preserving, the latter meaning that every point of below is the image of a point of below :
The two conditions together say that maps the initial segment of onto the initial segment of , and implies , while implies . There is at most one simulation of into , so that is a proposition. Two ordinals are order equivalent, written , when there is an order-preserving equivalence with order-preserving inverse. This relation is a proposition, as there is at most one such equivalence.
Lemma 5.5.
If is a surjective simulation, then is an equivalence with order-preserving inverse.
Proof.
A simulation is left cancellable, which is proved by transfinite induction on the two points (Lemma 5.1). Let and . Order preservation gives , and initial-segment preservation gives with , so by the induction hypothesis. Symmetrically, every point below is below , and extensionality identifies with . The underlying type of an ordinal is a set by Lemma 5.2, and a left-cancellable map into a set is an embedding (Definition 2.10), so the fibers of are propositions. Surjectivity makes them inhabited (Definition 2.9), and an inhabited proposition is a singleton, so is an equivalence (Definition 2.8).
The map is also order-reflecting. If , then lies in the initial segment of , which initial-segment preservation identifies with the image of the initial segment of , so for some , and left cancellability gives . The inverse of an order-preserving order-reflecting equivalence is order-preserving. ∎
5.2. Trichotomy
Definition 5.6 (Trichotomy).
An ordinal is trichotomous if for all we have or or . We write for the type of trichotomous ordinals in a universe left implicit.
Remark 5.7.
Asking that every discrete ordinal be trichotomous is equivalent to excluded middle.
Proof.
Excluded middle decides for all , and a well-order whose order is decidable is trichotomous.
Conversely, let be a proposition with , and order the two-element type by
This order is proposition valued, transitive and well-founded with no assumption on , and makes it extensional, so it is an ordinal, whose underlying type is discrete. Trichotomy at and then gives , since is false and is empty. This is double negation elimination, and hence excluded middle. ∎
Trichotomous ordinals are nevertheless abundant without excluded middle, and Section 6.2 interprets every Brouwer code as a trichotomous ordinal under an interpretation that dominates the standard one.
Lemma 5.8.
Trichotomy implies discreteness.
Proof.
Given and , the two order cases of trichotomy decide , because a well-founded relation is irreflexive, and the middle case decides . ∎
5.3. Ordinal arithmetic
Definition 5.9 (Ordinal addition).
The sum has as underlying type the binary sum of those of and , ordered so that every element of precedes every element of :
Lemma 5.10.
The order of Definition 5.9 is a well-order, so that is an ordinal.
Proof.
The order is proposition valued because each of its two cases is and the two exclude each other. The first case is the order of . The second is a sum whose index type is a proposition, the underlying type of an ordinal being a set (Lemma 5.2), and whose fibers are given by the order of . The two cases exclude each other, because together with would make precede itself, which well-foundedness forbids. A binary sum of two propositions that exclude each other is a proposition.
For transitivity, consider two consecutive steps. If both move the index, then so does their composite, by the transitivity of the order of . If exactly one of them moves the index, then so does the composite, by transporting its index comparison along the identification supplied by the other. If neither does, the three indices agree and the fiber order is transitive.
For well-foundedness, we show that is accessible by induction on the accessibility of and then on that of . Its predecessors are the with , accessible by the induction hypothesis on , and the with , accessible by the induction hypothesis on .
Now let the family be constant, say for every , and let and have the same predecessors. Given , we have and hence , which gives either or together with . The second case is impossible, because it makes , so that and hence , which well-foundedness forbids. So every predecessor of is one of , and by symmetry the two points have the same predecessors, which gives by the extensionality of .
So we may take to be . For we have and hence , which gives , the alternative being impossible. By symmetry and the extensionality of , we get . ∎
Definition 5.11 (Lexicographic order on arbitrary sums).
For and a family , the lexicographic order on has the index as the more significant coordinate:
We write for the type equipped with this order.
Lemma 5.12.
The lexicographic order is proposition valued, transitive and well-founded. It is moreover extensional when the family is constant.
Proof.
It is proposition valued because each of its two cases is, the second because is a set, so that is unique, and the fiber orders are proposition valued. The two cases exclude each other, because together with would make precede itself. A binary sum of two propositions that exclude each other is a proposition.
For transitivity, if either of two consecutive steps moves the index then so does their composite, by the transitivity of after transporting, and if neither does, the three indices agree and the fiber order is transitive.
For well-foundedness, we show that is accessible by induction on the accessibility of and then on that of . Its predecessors are the with , accessible by the induction hypothesis on , and the with , accessible by the induction hypothesis on .
Now let the family be constant, say for every , and let and have the same predecessors. Given we have , so , which gives either , as wanted, or together with . In the second case , so and hence , which well-foundedness forbids. By symmetry and have the same predecessors, so by the extensionality of , and we may assume . Then for we have , hence , which gives , since is impossible, and by symmetry and the extensionality of the fiber, we get . ∎
Definition 5.13 (Ordinal multiplication).
Ordinal multiplication is the lexicographic order of Definition 5.11 in the case of a constant family: the sum over of the family constantly , so that is the more significant coordinate. The operands are thus written in the opposite order from their sum, before , as in the classical definition. It is an ordinal by Lemma 5.12.
Lemma 5.14 (Maps of lexicographic sums).
For with families and , a map and maps , the map of Definition 2.28 is
- (1)
order-preserving if is and every is,
- (2)
order-reflecting if is and every is and is in addition an embedding.
Proof.
A comparison in the lexicographic order of Definition 5.11 is of one of two kinds, a comparison of the indices, or an identification of the indices together with a comparison in the fiber.
(1) A comparison of the first kind is preserved by . One of the second kind is preserved by , after transporting the fiber component along the image under of the identification of the indices.
(2) A comparison of the images of the first kind is reflected by . One of the second kind comes with an identification of the images of the indices, and , being an embedding, is left cancellable, which identifies with . The underlying type of an ordinal is a set (Lemma 5.2), so the given identification is the image of that one, and the two transports agree. The comparison in the fiber is then reflected by . ∎
Remark 5.15.
For arbitrary and , the lexicographic order on fails constructively to be extensional, in that excluded middle follows if all such orders are extensional.
Proof.
Take to be the ordinal and to be the family that sends a truth value to the proposition . Every proposition is an ordinal in exactly one way, under the empty order, so this is a family of ordinals. No comparison in a fiber is possible, the fibers carrying the empty order, so the lexicographic sum is the subtype
of with the restricted order. No element of has a predecessor in , since a predecessor would have to be , which excludes. So the hypothesis of extensionality is vacuous, and extensionality of says that is a proposition. Let be a proposition with . Both and are elements of , so they are equal, and follows. This is double negation elimination, and hence excluded middle. This counterexample is due to Mike Shulman (personal communication). ∎
One sufficient condition for the lexicographic order to be extensional is that the family be constant, as we have seen above. Two further sufficient conditions are that the index ordinal be trichotomous, and that the summands have top elements.
Lemma 5.16.
If is trichotomous and is a -indexed family of ordinals, then the lexicographic order is extensional, so that is an ordinal.
Proof.
By Lemma 5.12, only extensionality is left to prove. Trichotomy makes the order of cotransitive, in the sense that implies, for any , that or . Indeed, compare with . In the case there is nothing to do, in the case we have , and in the case transitivity gives .
Now let and have the same predecessors. Given , cotransitivity applied to the point gives or . In the second case , so that , which the well-foundedness of the lexicographic order forbids. So every predecessor of is one of , and by symmetry the two have the same predecessors, which gives by the extensionality of .
So we may take to be . For we have and hence , which gives , the alternative being impossible. By symmetry and the extensionality of , we get . ∎
Definition 5.17 (Topped ordinals).
A top of an ordinal is a point that no element exceeds, and is the type of ordinals equipped with a top:
A largest element is a top, because the order is well-founded and hence irreflexive, but not conversely: in the ordinal no element exceeds a truth value with , since such a differs from , whereas is the largest element. This shows that having a top element is in general data rather than property. Classically, the topped ordinals are precisely the successor ordinals (ordinals of the form ).
Example 5.18.
The type of Example 3.1 is an ordinal under its natural order, in which precedes when is a finite point whose index is below in the sense of Example 3.1:
It is topped by its largest element , and we write for it, as an ordinal or as a topped one according to the context.
Proof.
The predecessors of a point are exactly the finite points with . One direction is the definition, which asks a predecessor to be finite, and for the other, the comparison holds whenever . Moreover, the index in the definition is determined by , because is left cancellable.
The order is proposition valued, being a sum over of a product of two equations in the sets and , with the index determined as observed above.
For transitivity, let and , say with and with . From we get , and is decreasing, so that gives . This says that .
For well-foundedness, each finite point is accessible by course-of-values induction on . Its predecessors are the with , that is, with , and these are accessible by the induction hypothesis. Any point is then accessible, its predecessors being finite points.
For extensionality, let and have the same predecessors. By the first paragraph this says that if and only if for every , and two binary digits that are in the same cases are equal, so and have the same digits. Being decreasing is a proposition, so a point of is determined by its digits, and .
Finally, the point is a top, because would make a finite point , and is not finite, having for every whereas . ∎
Constructively, is topped by without being a successor ordinal, since fails to be isolated constructively (Examples 3.3(5)).
The operations on topped ordinals and on trichotomous ordinals (Definition 5.6) are written like those on plain ordinals. Addition and multiplication of ordinals restrict to topped ordinals, and the ordinal-indexed sum of a topped-ordinal-indexed family of topped ordinals is again topped. They restrict to trichotomous ordinals as well, where the sum of a trichotomous-ordinal-indexed family of trichotomous ordinals is an ordinal by Lemma 5.16 and is again trichotomous.
Lemma 5.19.
If is a -indexed family of topped ordinals, then the lexicographi order is extensional, so that is an ordinal. If moreover is topped, then so is .
Proof.
By Lemma 5.12, only extensionality is left to prove. Write for the top of , and let and have the same predecessors. Given , we have and hence , which gives or together with a comparison exceeding in the fiber, and the latter is impossible. So every predecessor of is one of , and by symmetry the two have the same predecessors, which gives by the extensionality of . The fiber components are then identified as in the proof of Lemma 5.16, which for that step uses only the irreflexivity of the two orders.
We take the top of the sum to be the pair of the top of with the top of . A point exceeding it would either exceed in or exceed the top of in that fiber, and neither is possible. ∎
Lemma 5.20.
If and , where is compact pointed and is compact pointed for every , then is compact pointed.
Proof.
The underlying type of is by definition , in which the order plays no part, so the claim is an instance of Corollary 4.10(2). For the underlying type of a topped ordinal, pointed compactness and compactness agree by Lemma 4.6, the designated top supplying the point. ∎
5.4. Extended sums
The extended sum of Section 4.7 becomes a construction on ordinals once the extension of a family carries an order, which we use to interpret the ordinal notations of Sections 6 and 7. For the following, recall the -extension operation on families given in Definition 4.30.
Lemma 5.21.
Let be an embedding and a family of ordinals. For any , give the type the relation
This is a well-order, so we obtain the extension .
Proof.
Since is an embedding, the fiber is a proposition, so is a product indexed by a proposition, and is the order that such a product carries, asking the component order to hold at some point of the fiber. For each , evaluation at is an equivalence from the product to the component , whose inverse sends a point of the component to the section transporting it along the identifications of the fiber.
The order is proposition valued, being a sum over a proposition of proposition valued components.
For extensionality, suppose that and have the same predecessors, and let . A predecessor of determines a section, which is a predecessor of in the product, witnessed at . By the hypothesis it is a predecessor of , witnessed at some point of the fiber, which is because the fiber is a proposition, so is a predecessor of . Symmetrically, and have the same predecessors, and the extensionality of gives . Since was arbitrary, .
For transitivity, two consecutive comparisons come with points of the fiber, which are equal because the fiber is a proposition, so that the transitivity of the component order at that point applies.
For well-foundedness, a point of the product is accessible as soon as every is. A witness of supplies a point of together with , and is accessible because the order of is well-founded, so that is accessible as one of its predecessors. Accessibility transfers from the component back to the product along evaluation at , because a predecessor in the product of the section determined by a point of the component has its value at below . ∎
Lemma 5.22.
If every is topped, then so is every , so the construction extends families of topped ordinals.
Proof.
Suppose each has a top element . Then is a top element of , since, if it were below some , we would have a fiber with , contradicting the topness of . ∎
Lemma 5.23.
The construction restricts back to along , giving
for every , as illustrated in the diagram below.
Proof.
For the fiber is a singleton, being an inhabited proposition, so evaluation at its center is an equivalence by Lemma 4.31(1). It is order-preserving, because a comparison is witnessed at some point of the fiber, and that point is the center, the fiber being a proposition, so that the comparison holds at the center. It is order-reflecting, because a comparison at the center is by definition a witness of . The inverse of an order-preserving order-reflecting equivalence is order-preserving, so this is an order equivalence. ∎
Lemma 5.24.
If every is totally separated, then so is every .
Proof.
By Lemma 4.34. ∎
Under univalence, the above two lemmas show that the type of ordinals and the type of totally separated ordinals are both algebraically injective in the sense of [18], as univalence turns order equivalences into identifications.
Definition 5.25 (Countable extended sum and successor sum).
Let be a family of topped ordinals.
- (1)
The extended sum of is the extension of along the embedding , summed over the ordinal :
- (2)
The successor sum of is the extension of along the left inclusion , summed over the successor , taken as a topped ordinal with the added point as top:
Lemma 5.26.
Let .
- (1)
The successor sum is order equivalent to the successor of the countable sum:
- (2)
If is a retract of for every , then so is , and if is discrete for every , then so is .
Proof.
The sum is taken over , so its fibers are the extension of along . Since is an embedding, that extension gives back at , up to order equivalence (Lemma 5.23). At the fiber of is empty, no natural number having , so the extension is the one-point ordinal there (Lemma 4.31(2)). Write for the family on so described. Taking underlying types, that of is the binary sum , whose top is the one supplied by Lemma 5.19, namely the pair of the top of with the point of its fiber.
(1) Order equivalent families have order equivalent sums, by Lemma 2.29(1) and Lemma 5.14 with the identity on the index, so is order equivalent to . The map sending to and to is an equivalence from the underlying type of that sum to that of , with the evident inverse. The map and its inverse are order-preserving, as one sees by comparing the lexicographic order of the sum with the order of the addition on each of the two summands. Composing the two order equivalences gives the desired equivalence.
(2) By the description of the underlying type above, it is enough to treat . If each is a retract of , then is a retract of and hence of , by a pairing function, so that its binary sum with is a retract of , which is again a retract of . If each is discrete, then so is , discreteness being closed under over the discrete index , and so is its binary sum with , discreteness being closed under (Proposition 3.6). ∎
Definition 5.27 (Comparison map).
We now define a comparison map
First we need some preparation. Let . The underlying type of is and that of is . By Lemma 5.21 the two fibers are the products
Write for the map that sends to and the added point to , so that . The map is left cancellable: if then and so . If takes the same value at a finite point and at the added point, in either order, then , which is impossible. And if both are the added point, they are already equal, having a single point. Hence each gives the map defined by
where is obtained by cancelling in , which has type because . Since keeps the first component, precomposition with it gives the map defined by
With this notation, we define the comparison map to be the map of sums of Definition 2.28 induced by and the family ,
which amounts to .
This comparison map is the countable-sum case of the comparison between the discrete and the compact interpretation of Brouwer ordinal codes, which is the subject of Section 6.4. Recall from Definition 2.20 that a map is called extremely dense when the complement of the image is empty.
Lemma 5.28.
The comparison map is an extremely dense embedding and both order-preserving and order-reflecting.
Proof.
The map is an embedding and is extremely dense (Examples 3.3(6)). Each is an equivalence, being precomposition with the equivalence . That is an equivalence holds because the two fibers are propositions, and being embeddings, and because has a converse, sending to with obtained by applying to . An equivalence is in particular an embedding and extremely dense, so that Lemma 2.29(2,3), applied to on the indices and to the maps on the fibers, makes an extremely dense embedding.
Each is moreover order-preserving and order-reflecting. A comparison in either of the two products is a point of the fiber indexing it together with a comparison of the values there, and and its converse carry such data back and forth. The map is order-preserving and order-reflecting from to . Among the finite points, says that , which holds exactly when . A finite point precedes the added point of , and because . And precedes nothing, since would make finite. So Lemma 5.14 applies, its embedding hypothesis for (2) being again that is en embedding. ∎
5.5. Extended suprema
Every family of ordinals indexed by a small type has a least upper bound, assuming set quotients, or, equivalently, set replacement (Definition 2.15).
Theorem 5.29.
Let and , and consider the map
which sends a point of a member of the family to its initial segment in .
- (1)
The image of the map is an ordinal, written , under the inherited order
- (2)
The map sending to the image of is a surjection.
- (3)
is the least upper bound of the family .
The proofs of these clauses are in [7]. Set replacement makes the image of the map equivalent to a type in our base universe, although is a type in the next universe. Whether suprema of families of ordinals exist constructively was left open by Kraus, Nordvall Forsberg and Xu [33], who established the least upper bound property for weakly increasing families indexed by . Tom de Jong answered it with a construction by set quotients, extending and formalizing the one of [41, Lemma 10.3.22], which is claimed there only to be an upper bound, and the author of this paper simultaneously answered it with the above construction. Both are formalized by de Jong and are presented in his thesis [7].
Corollary 5.30.
If is compact pointed and is compact pointed for every , then is compact pointed.
Proof.
The type is compact pointed by Corollary 4.10(2), and is a surjective image of it by Theorem 5.29(2), so Corollary 4.10(3) applies. ∎
Theorem 5.31 (Compactness of extended suprema).
For any embedding into a compact pointed type and any family of compact pointed ordinals, the supremum of the extended family is itself compact pointed.
Proof.
By Corollary 5.30 applied to the family over the compact pointed index , it suffices to show that is compact pointed for every . By Lemma 5.21 this is the product of the types over the index type , all of which are compact pointed by hypothesis, and is a proposition precisely because is an embedding. So the micro-Tychonoff Theorem 4.26 applies. ∎
For use in Section 6, we introduce notation for the special case of the embedding .
Definition 5.32 (Countable extended supremum).
For a family of ordinals, the extended supremum is
the supremum of the extension of along the embedding . The superscript has the same meaning as in the extended sum, that the index type is rather than .
6. Compact totally separated ordinals from Brouwer codes
In the remainder of this paper we give two notation systems, each with several interpretations of the notations as ordinals. The first occupies this section and takes a traditional system, the Brouwer ordinal codes, whose interpretation is compact and totally separated and dominates the standard interpretation , which is neither. The subscript on an interpretation names the operation the limit constructor is read as, a sum or a supremum, and a superscript records that the family is first extended along the embedding , as in the extended sum of Definition 5.25 and the extended supremum of Definition 5.32.
We give five interpretations to Brouwer codes, obtaining different combinations of compactness, total separatedness, trichotomy and discreteness. The last of the five is the discrete interpretation of Section 6.4. It assigns to each code a discrete ordinal , and the same code denotes a compact totally separated ordinal . There is an extremely dense order-embedding of the discrete ordinal into the compact totally separated one, which classically is an equivalence but fails to be one constructively.
Definition 6.1 (Brouwer codes).
The type of Brouwer ordinal codes (countably branching trees) is inductively generated by the constructors
6.1. The standard interpretation
Definition 6.2.
We define an interpretation function
by interpreting the constructors as indicated in the following table:
Here is the supremum of an -indexed family of ordinals (Theorem 5.29).
The standard interpretation does not produce compact ordinals or trichotomous ordinals constructively, which motivates the alternative interpretations given in Section 6.2.
Proposition 6.3.
If the standard interpretation is compact for every Brouwer code , then holds.
Proof.
The code is interpreted as the supremum of the finite ordinals, which is , and the compactness of its underlying type is (Examples 4.5(2)). ∎
Proposition 6.4.
If the standard interpretation is trichotomous for every Brouwer code , then holds.
Proof.
It suffices to decide, for an arbitrary , whether is finite, because deciding finiteness for every conatural number is equivalent to . So fix and write for its -th digit under the inclusion . From Example 3.1, we have that is finite exactly when for some .
The codes. Put
the last clause being arbitrary. Write and . Unfolding Definition 6.2 and using that is left neutral for ,
The code we associate to is , and the hypothesis gives us that is trichotomous.
Two elements of . We have , and by Theorem 5.29 (3), so . Also , an ordinal being an element of its own successor, so . Let be the witnesses of these two facts, so that
Three lemmas. First, the supremum has a point: each , being of the form , has the point contributed by the summand, and the map carries it to a point of the supremum. Hence the inequality is impossible, because an initial segment of is , which would make empty.
Second, if is finite then . To see this, say , so that and hence . Now .
Third, conversely, the inequality implies that is finite: being finite is a proposition, so we may use that the maps are jointly surjective, which is the surjectivity of the map out of the sum (Theorem 5.29(2)), hence the element of whose initial segment is comes from some , and initial segments are preserved by the maps into the supremum, which are simulations (Theorem 5.29(3)), so , which is to say that . Decide the value of . If then is bounded by , hence finite. If then , giving , which is impossible since is irreflexive.
Deciding finiteness. Apply trichotomy of to and . Since passing to initial segments preserves the order, the three cases for trichotomy read:
- (1)
: then , so is finite by the third lemma.
- (2)
: then . So is not finite, for were it finite, the second lemma would give .
- (3)
: then , which the first lemma rules out, so this case does not arise.
In each case the finiteness of is decided. ∎
Remark 6.5.
The proof uses the hypothesis of trichotomy only at the single pair of the single ordinal , and is built from by a fixed construction. So the statement can be sharpened to give a function assigning to each conatural number a Brouwer code such that trichotomy of the standard interpretation of the code decides the finiteness of the conatural number.
6.2. Three non-standard interpretations
We now give three further interpretations of Brouwer codes, each obtaining a different combination of compactness, total separatedness and trichotomy, and all of them dominating the standard interpretation classically (Theorem 6.15).
Definition 6.6 (Three non-standard interpretations).
We define three interpretation functions
by interpreting the constructors as indicated in the following table:
Here is the lexicographic sum over (Definition 5.11), which is an ordinal by Lemma 5.16, the index being trichotomous, is the extended sum (Definition 5.25(1)), and is the extended supremum (Definition 5.32).
In the compact totally separated and the compact interpretation we deliberately map to rather than , so that every denoted ordinal is pointed and hence the micro-Tychonoff Theorem 4.26 is applicable to get the compactness of the ordinals in their images.
Theorem 6.7.
For every Brouwer code ,
- (1)
the ordinal is trichotomous,
- (2)
the underlying type of is compact and totally separated,
- (3)
the underlying type of is compact.
Proof.
All by induction on , with compactness throughout in the pointed sense.
(1) The interpretation lands in by construction, each of its clauses preserving trichotomy: is trichotomous, so is the successor of a trichotomous ordinal, and so is a sum over of a family of trichotomous ordinals, such a sum being an ordinal by Lemma 5.16. Here takes an ordinary -indexed sum, with nothing added at a limit.
(2) For compactness, the type is compact pointed. The successor clause is a sum over , so Corollary 4.10(2) applies. The limit clause is Theorem 4.32. For total separatedness, the type is totally separated. The successor clause is a whose index type is discrete, and total separatedness is closed under over a discrete index (Proposition 3.12). For the limit clause, apply Lemma 3.14: each fiber is totally separated by Lemma 4.34 and the induction hypothesis, and the fiber at is by Lemma 4.31(2).
(3) is compact pointed and the successor clause is a coproduct. The limit clause is the one place where the argument differs from (2), because is a supremum rather than a sum, and it is Theorem 5.31. ∎
Being trichotomous, is discrete (Lemma 5.8).
Proposition 6.8.
If is compact for every Brouwer code , then holds.
Proof.
Apply the hypothesis to the code , whose interpretation is the sum over of the constant family at , so that its underlying type is . The first projection makes a retract of it, compactness is closed under retracts (Theorem 4.8(4)), and the compactness of is (Examples 4.5(2)). ∎
Unlike (Theorem 6.7(2)), the compact interpretation fails to give totally separated ordinals constructively:
Proposition 6.9.
If is totally separated for every Brouwer code , then holds.
This follows from the following counterexample, which does not mention Brouwer codes and says that compact totally separated types fail to be closed under suprema constructively.
Example 6.10.
There are a type and a family such that is compact pointed and totally separated, is compact pointed and totally separated for every , and the total separatedness of implies .
We may take and for the extension along of the constant family with value . The proof, which requires a number of lemmas, uses the following explicit description of this supremum:
By Definition 4.30, since is an embedding whose fiber over is the proposition that is finite,
Its elements are partial elements of , with the finiteness of as domain of definition, so that is the type of such partial elements, which we will show to be order equivalent to the following Sierpiński ordinal.
Definition 6.11 (A Sierpiński ordinal).
Call a proposition semidecidable if it is equivalent to the finiteness of some conatural number,
which is a proposition. Let
where is the first projection, the domain of definition. Write and for the elements given by and , which are semidecidable via and respectively.
Lemma 6.12.
The relation is a well-order, so is an ordinal, and two of its elements are equal precisely when their domains of definition are logically equivalent.
Proof.
Being semidecidable is a proposition, so is a subtype of , and hence two of its elements are equal exactly when their domains of definition are logically equivalent. In particular is a set. The relation is proposition valued, being a product of two propositions, and transitive, since and give from the first and from the second. For extensionality, suppose and have the same predecessors. If holds then , hence , whose second component is , and symmetrically. So the domains of definition are logically equivalent, and . For well-foundedness, if then gives while gives , a contradiction, so no predecessor of has a predecessor, and every element of is accessible after two steps. ∎
Lemma 6.13.
There is an order equivalence .
Proof.
For each let be the canonical map into the supremum. These maps are simulations (Theorem 5.29(3)) and jointly surjective (Theorem 5.29(2)), and they preserve initial segments, a simulation mapping the initial segment of onto that of its value, so that .
Send a partial element to the proposition , that is, the proposition that is defined and takes the value . This is a proposition, because the finiteness of is a proposition and is a set, and it is semidecidable, because from we build a decreasing binary sequence, whose value at is before is known to satisfy , and is minus the value of at the finiteness witness afterwards, hence a conatural number whose finiteness is equivalent to . Writing for the resulting element of , we check that is order-preserving and that it depends on only through , so that it descends to the supremum. Since the ’s are jointly surjective and is a set, there is a unique with . It is order-preserving, by joint surjectivity and the corresponding property of . It is an initial segment inclusion, because an element of below has empty domain of definition, so it is , and we exhibit a predecessor of mapping to , namely the image under of the constantly partial element, such a predecessor being unique because is left cancellable at . So is a simulation. It is surjective, for given with a witness of semidecidability, we may unpack , because being in the image is a truncated statement, to get with , and then the constantly partial element of is sent to . So is an order equivalence by Lemma 5.5. ∎
Lemma 6.14.
If some has , then holds. Consequently, if is totally separated then holds.
Proof.
Every gives an element of , namely its own finiteness, which is semidecidable by definition. Write for this element. Then for every natural number , since a natural number is finite, and , since is not. So, given as in the statement, the composite takes the constant value on the natural numbers and the different value at . Composing with the complement if necessary, a matter decided by inspecting the two boolean values, we may assume that is constantly on and takes the value at . Such a map decides, for an arbitrary , whether , by inspecting the value , which if gives and if makes differ from every finite point, since a conatural number that is not finite is . That is in the formulation of Definition 2.25.
For the second claim, assume is totally separated and, for the sake of contradiction, that holds. For any we cannot have , by the first part. Deciding the two values, we conclude . As this holds for every , total separatedness gives , which is a contradiction. So . ∎
Proof of Example 6.10.
Take and . Then is compact pointed (Examples 4.7(3)) and totally separated, being a retract of (Example 3.1), which is totally separated (Examples 3.13(3)), and total separatedness passing to retracts (Proposition 3.12(1)). Each is , which is compact pointed by the micro-Tychonoff Theorem 4.26, and totally separated by closure of total separatedness under products (Proposition 3.12). Finally, if is totally separated then so is , by Lemma 6.13 and closure of total separatedness under equivalence (Proposition 3.12(1)), and then Lemma 6.14 gives . ∎
Proof of Proposition 6.9.
Apply the hypothesis to the code . By Definition 6.6, we have that , which is , and therefore , since sends to rather than to . So is totally separated, and Lemmas 6.13 and 6.14 give . ∎
6.3. Comparing the four interpretations
Classically, the three alternative interpretations dominate the standard interpretation and are related as in Theorem 6.15 below. Excluded middle is used twice, to make the successor operation of monotone and to turn an order-preserving map between ordinals into . A fifth interpretation follows in Section 6.4, related to in a stronger and constructive way (Theorem 6.23).
Theorem 6.15.
Assuming the principle of excluded middle, the following order relations hold for the four interpretations of any Brouwer code :
So the compact totally separated interpretation gives the largest ordinal among the four.
Proof.
The top row, the left-hand column and the bottom row are proved by induction on . All three use excluded middle at , for monotonicity of the successor operation on ordinals , and the top row and the bottom row use it again at , for the fact that a supremum is bounded by the corresponding sum. That fact is in turn the passage from an order-preserving map to , applied to the map of a summand into the sum, which makes the sum an upper bound of the family, so that the supremum, being least among upper bounds (Theorem 5.29(3)), is below it. The right-hand column uses the passage directly.
The top row.At both sides are . At , apply monotonicity of the successor to the induction hypothesis. At , the supremum is monotone in its family, so , and a supremum is bounded by the corresponding sum, which takes.
The left-hand column.The same shape, with one extra step at , where the family being summed on the right is the extension of the family along , so we first rewrite its value at as using the extension property (Lemma 4.31 (1)), compare suprema over , and then observe that the supremum over of a family restricted along is bounded by the supremum over all of . At the inequality is , the zero ordinal being least.
The bottom row.Again the same, using at that extension along an embedding preserves fiberwise, the extension being at each point a product indexed by a proposition, so that a simulation between the members gives one between the products, and then that suprema compare and that a supremum is bounded by the corresponding sum. At we also need that addition of topped ordinals agrees with addition of plain ordinals on underlying ordinals.
The right-hand column.This one is proved differently. We define a map by induction on and show that it is order-preserving, and then excluded middle turns an order-preserving map between ordinals into . At the source is empty. At the two summands go to the two summands. At the pair goes to paired with the partial element that sends a fiber element of over to the recursively defined value at , transported along the identification supplied by left cancellability of . Order preservation is a routine induction. ∎
Proposition 6.16.
- (1)
If the relation holds for every Brouwer code , then holds.
- (2)
If the relation holds for every Brouwer code , then holds.
Proof.
(1) An initial segment of a trichotomous ordinal is trichotomous. Since the trichotomous interpretation is trichotomous (Theorem 6.7(1)), the standard interpretation is trichotomous for every code, and Proposition 6.4 gives .
(2) An embedding into a totally separated type is totally separated. Since is totally separated (Theorem 6.7(2)), is totally separated for every code, and Proposition 6.9 gives . ∎
Question 6.17.
Do each of the remaining two comparisons, namely the relation for every code , and the relation for every code , imply a constructive taboo?
6.4. A fifth interpretation
Our fifth interpretation is a modification of the trichotomous interpretation of Definition 6.6, mapping to the ordinal , rather than , and to in order to match the compact totally separated interpretation and be able to get Theorem 6.23(2).
Definition 6.18.
We define an interpretation function
by interpreting the constructors as in the second row of the following table, whose first row repeats the compact totally separated interpretation of Definition 6.6 for comparison:
Here and are the extended sum and the successor sum of Definition 5.25.
Theorem 6.19.
For every Brouwer code ,
- (1)
the ordinal is trichotomous,
- (2)
the ordinal is compact,
- (3)
the underlying type of is a retract of , hence discrete,
- (4)
the underlying type of is a retract of , hence totally separated.
Notice that (1) gives an alternative route to the discreteness of (Lemma 5.8), whereas (2) does not follow from (4), the compactness of being independent of our type theory (Remark 4.12).
Proof.
(1) By induction on . For the one-point ordinal is trichotomous. For , ordinal addition is not a coproduct here but the ordinal-indexed sum over the ordinal of the two-element family, whose index type is (Section 5.3), and trichotomy is closed under ordinal-indexed sums, the index being trichotomous. For , the successor sum must preserve trichotomy. Unfolding as the sum over of the extension of the family along , the index is trichotomous and it remains to see that each fiber of the extension is. A fiber is a product indexed by the fiber of over the point in question, and such a product is trichotomous as soon as that fiber is decidable: if it holds, the product is equivalent to the fiber at its point, and if it fails, the product is empty and hence . The fiber is decidable, being either a singleton or empty according to the two cases of . Here the two interpretations differ. For the corresponding fibers are those of , whose decidability is exactly , so the same argument is unavailable.
(2) This is Theorem 6.7(2), proved there by a direct induction with the same three cases, using Corollary 4.10 for and , and Theorem 4.32 for .
(3) We show by induction on that is a retract of . For the underlying type is , a retract of . For , use that being a retract of is closed under , in the sense that if and every are retracts of , then so is , being a retract of , which is a retract of by a pairing function ; the index type of the addition is a retract of by sending to the left point and every successor to the right one. For , the interpretation is a successor sum, whose underlying type is a retract of as soon as those of the summands are, by Lemma 5.26(2). Discreteness follows since is discrete and discreteness is closed under retracts.
(4) Likewise by induction, we show that is a retract of . For , the type is a retract of any pointed type. For , we use that is a retract of (split on the first digit and pass to the tail), and being a retract of is closed under . For , the induction hypothesis gives, for each , a section with retraction . By Lemma 4.35, the extension along of the family is pointwise a retract of the extension of the constant family at , and hence the extended sum is a retract of the constant extended sum. By Lemma 4.36, the constant extended sum, the type of delayed binary sequences, is equivalent to , and in particular a retract of it. Compositions of retracts are retracts.
Total separatedness now follows without a further induction, because is totally separated (Examples 3.13(3)) and total separatedness is closed under retracts (Proposition 3.12(1)). ∎
Remark 6.20.
Total separatedness is obtained here through , but a direct induction also works, and the discreteness of is likewise obtained through , but also follows directly by induction on using Proposition 3.6, without passing through . Addition is a sum over the discrete index , and total separatedness is closed under over a discrete index (Proposition 3.12). The index of the extended sum is not discrete, its discreteness being (Examples 3.3), but Lemma 3.14 applies, the fiber at being . That is the route taken in Theorem 6.7. Closure under fails in general (Examples 3.13(1)), and being a retract of is a stronger property that implies total separatedness and is closed under the constructions used here.
Each of the two interpretations fails constructively to have the property that the other has.
Proposition 6.21.
- (1)
The statement that is compact for every Brouwer code is equivalent to .
- (2)
If is discrete for every Brouwer code , then holds.
Proof.
For the forward implications, apply the hypotheses to , the code of Example 6.24, whose discrete interpretation is with underlying type and whose compact one is with underlying type .
Compactness of gives compactness of , a retract of it (Theorem 4.8(4)), which is (Examples 4.5(2)), and discreteness of is (Examples 3.3). Conversely, makes compact, and is a retract of for every (Theorem 6.19(3)). ∎
So the trichotomy of Theorem 6.19(1) has no counterpart for , since trichotomy implies discreteness (Lemma 5.8).
Definition 6.22 (The comparison map).
The map is defined by induction on as follows:
where is the comparison map of Definition 5.27 for the family .
Theorem 6.23.
For every Brouwer code , the map is
- (1)
an embedding,
- (2)
extremely dense,
- (3)
order-preserving,
- (4)
order-reflecting.
Proof.
The four properties are established by induction on , with the induction for the embedding property simultaneous with the order-reflection property. At the map is the identity. At it is a map of sums, with the identity on the index and with the induction hypothesis and the identity on the two fibers, so that the embedding property and the density come from Lemma 2.29(2, 3) and the two order properties from Lemma 5.14. The embedding hypothesis of Lemma 5.14(2) is what makes the two inductions simultaneous, and the index map is the identity here, so it is met.
At , the family of maps induces a map between the successor sums, namely and , which preserves all four properties fiberwise, and the comparison map for the family has all four (Lemma 5.28), so the composite does too, being extremely dense and being an embedding both closed under composition. The map changes the added top point from an isolated one to a limit point (cf. Definition 7.13). ∎
The first code whose interpretations are both infinite shows the extent of the failure of the comparison embedding to be an equivalence.
Example 6.24.
Take , the countable sum of the one-point code. By Definition 6.18 the two interpretations are the successor and the extended sum of the constant family at ,
the summands being one-point ordinals and a sum of those being its own index, so the discrete side is with its added point isolated, because the point of is isolated and preserves isolatedness (Proposition 3.6(1)), the compact side is with its added point a limit (Section 5.4), and is the inclusion that sends the added point to .
The ordinal is discrete and a retract of , but it is compact exactly when holds, since is (Examples 4.5). The ordinal is compact and totally separated with no assumption (Theorem 6.19 (2 and 4)), but it is discrete, equivalently its top point is isolated, exactly when holds (Examples 3.3). The map between them is an extremely dense order-embedding, by Theorem 6.23. Read as binary sequences, the image of consists of the sequences and the sequence . Extreme density of says that no decreasing binary sequence lies outside this image, which is a theorem, and surjectivity says that every decreasing binary sequence lies in it, which for this code is exactly .
Proposition 6.25.
The statement that is an equivalence for every Brouwer code is equivalent to .
Proof.
For the forward direction, apply the hypothesis to the code , where is the inclusion , which is an equivalence exactly when holds (Example 6.24). Conversely, assume and induct on , following the clauses of Definition 6.22. At the map is the identity. At it is a map of sums whose index part is the identity and whose two fiber parts are the induction hypothesis and the identity, so it is an equivalence by Lemma 2.29(1). At the map between the successor sums induced by the family is an equivalence by the induction hypothesis, and is one because makes an equivalence, the maps being equivalences anyway (Lemma 5.28). ∎
6.5. The least element property
The compact ordinals are not just compact. Every complemented subset has an infimum, which is a member when the subset is non-empty.
Definition 6.26 (Infima of complemented subsets).
Let carry a relation . A complemented subset of is given by its characteristic function , whose roots are its elements. Say that has infima of complemented subsets if for every there is a point that is
- (1)
a conditional root: if has a root at all then is one,
- (2)
the infimum of the roots: for every root , and for every that is below all roots.
For a topped ordinal this is taken with respect to the weak order .
Remark 6.27.
Having infima of complemented subsets is a strengthening of pointed compactness, since clause (1) alone already gives it. Given , take the conditional root as a universal witness. If then has no root, since a root would force , and a -valued function with no root is constantly .
Lemma 6.28 (Least element property).
Let have infima of complemented subsets with respect to a relation . Then every non-empty complemented subset of has a least element, that is, a member below all members.
Proof.
Let be the characteristic function of the subset and the point supplied by Definition 6.26. Having infima gives compactness, so we can decide whether has a root, and non-emptiness rules out the absence of one. So has a root, and then is a root by clause (1), and it is below every root by clause (2). ∎
The following strengthens the micro-Tychonoff Theorem 4.26 from compactness to infima.
Theorem 6.29.
Let be a proposition, a family, and, for each , let be an arbitrary relation on , with associated relation . Give the pointwise-derived relation
If every has infima of -complemented subsets, in the sense of Definition 6.26, then so does .
Proof.
The construction of the witness is the same as in Theorem 4.26. Given a complemented family on , transport it along the evaluation equivalences available at each , take the infimum within , and assemble these pointwise. If has a root , then each transported is a root in , so the infimum is a root there, and since , this gives , so that is a conditional root. It remains to show that is the infimum for the pointwise-derived relation.
To see that is a lower bound, note that if is a root, then for each the transported is a root in , so , and was defined to be , which follows.
To see that it is greatest among lower bounds, let be below every root. We must show , which by definition rules out for every , so suppose that this holds at some . Every root of the transported family at that is the value at of a root of the original family, and is below the latter, so is below the former. Thus is below all roots of the transported family, and is their infimum, so , contradicting the supposition. ∎
Theorem 6.30.
For every Brouwer code , the topped ordinal has infima of complemented subsets.
Proof.
By induction on , with the same three cases and the same shape as Theorem 6.19, but now with closure properties for infima in place of those for compactness.
For , the one-point ordinal has infima, since the unique point is a conditional root and trivially the infimum. For , use that having infima of complemented subsets is closed under ordinal-indexed sums, in the sense that if has them and every does, then so does , the infimum being computed lexicographically. That is, first the infimum in the base of those whose fiber contains a root, then the infimum within that fiber. This needs the lexicographic weak order on the sum to agree with the weak order derived from the sum’s own strict order. The ordinal indexing the addition has infima by inspection of its two points.
For , unfold as the sum over the ordinal of the extension along and apply the same closure property. Two things are needed. First, the ordinal has infima of complemented subsets, which is the property of its selection function recorded in Examples 4.7(3), that the sequence it returns is a conditional root and the infimum of the set of roots. Second, each fiber of the extended family has infima. This is exactly Theorem 6.29, the micro-Tychonoff theorem for infima, applied to the fiber of the embedding over the point in question, which is a proposition. ∎
By Lemma 6.28, we conclude the following.
Corollary 6.31.
For every Brouwer code , every non-empty complemented subset of the ordinal has a least element.
By Remark 6.27, Theorem 6.30 subsumes the compactness of Theorem 6.19(2).
For the discrete interpretation the least element property fails constructively.
Proposition 6.32.
The statement that every non-empty complemented subset of the discrete interpretation has a least element, for every Brouwer code , is equivalent to .
Proof.
For the forward implication, take , whose discrete interpretation is with underlying type (Example 6.24). Given , consider the complemented subset with characteristic function
It contains the added point, so it is non-empty, and its least element is either for some , in which case , or the added point, in which case no is a member, since membership would give , that is, . Inspection of tells the two cases apart, and they decide whether has a root, which is compactness of , equivalently (Examples 4.5(2)).
Conversely, makes an equivalence (Proposition 6.25), and it is order-preserving and order-reflecting (Theorem 6.23), so and are order equivalent. Every non-empty complemented subset of has a least element, and this property transfers along the isomorphism. ∎
Remark 6.33.
The forward implication needs only the single code , as in Proposition 6.25.
7. An inductive-recursive universe of compact ordinals
In the Brouwer codes (Definition 6.1), the branching of the limit constructor is always indexed by . We now let the branching of a sum be indexed by an ordinal built at an earlier stage, which requires defining the type of codes and their standard interpretation simultaneously by induction-recursion in the sense of [9, 10, 11]. The codes carry a further interpretationd , with an extremely dense embedding for every code (Theorem 7.5(2)). The Brouwer codes embed into , with the inclusion making commute with , and with (Theorem 7.10). The interpretation gives trichotomous and hence discrete ordinals (Theorem 7.2), and gives compact ordinals with infima of complemented subsets (Theorem 7.5). The compact interpretation , however, is no longer totally separated in general (Proposition 7.11), and hence the ordinals witnessing this are denoted by no Brouwer code.
7.1. Ordinal expressions and their discrete interpretation
Definition 7.1 ( and ).
We define, by induction-recursion, a type of ordinal expressions by the constructors
simultaneously with the standard, discrete interpretation , by
Theorem 7.2.
For every , the underlying type of is a retract of , hence discrete, and moreover the ordinal is trichotomous.
Proof.
By induction on , which for an inductive-recursive definition means induction by the elimination principle of , in which the hypothesis for may use the already-available value in order to speak about the index type of .
For the underlying type is . For it is , which is equivalent to . The underlying type of an addition is a binary sum (Definition 5.9), that is, a over the index type , and that of a multiplication is a over a constant family (Definition 5.13), so the cases and are, as in the proof of Theorem 6.19(3), instances of the closure of “being a retract of ” under , the index type being a retract of . So is the case , where is the plain ordinal-indexed sum , with no extension, whose base and fibers are retracts of by the induction hypothesis. Restricting the branching to a discrete ordinal keeps the sum countable. Discreteness then follows because is discrete and discreteness is closed under retracts (Proposition 3.6(2)).
Trichotomy is proved by a separate induction on the same cases, using that is trichotomous, that is and hence so is its successor, and that trichotomy is preserved by ordinal-indexed sums of trichotomous families over a trichotomous index, as in the proof of Theorem 6.19(1), which covers addition and multiplication under the above readings of them as sums. Trichotomy gives a second route to the discreteness of , by Lemma 5.8. ∎
However, compactness and the least element both fail constructively.
Proposition 7.3.
Each of the following two statements is equivalent to :
- (1)
the type is compact for every code ,
- (2)
every non-empty complemented subset of has a least element, for every code .
Proof.
(1) Under the type is compact (Examples 4.5(2)), and is a retract of it by Theorem 7.2, so it is compact too, compactness being closed under retracts (Theorem 4.8(4)). Conversely, the single code suffices, since is , which has as a retract, so the same closure property gives the compactness of , which is .
(2) The proof is that of Proposition 6.32. In the forward implication the single code takes the place of , its discrete interpretation being . In the converse, makes an equivalence (Proposition 7.7(1)), and it is order-preserving and order-reflecting (Theorem 7.5(2)), so and are order equivalent, and the least element property transfers along the order equivalence. ∎
7.2. The compact interpretation
Definition 7.4 ( and ).
We simultaneously define
and prove by induction that is an embedding as follows. For a code and , write for the extension along of to a family , as illustrated in the following diagram :
We define and by
Here is the canonical embedding sending the added point to , and is the extension property of Lemma 5.21 at the point of the image.
That each is an embedding is proved by the same induction. At the map is the identity and at it is the canonical embedding , an embedding by Examples 3.3(6). The identity is an embedding, a map of sums is an embedding if its index map and all its fiber maps are (Lemma 2.29(2)), embeddings are closed under composition, and an equivalence is an embedding. At , where the addition is a sum over (Definition 5.9), the index map is the identity on and the fiber maps are and , and at , where the multiplication is a sum over a constant family (Definition 5.13), the index map is and the fiber map is , the maps and being embeddings by the induction hypothesis. At the map is the map of sums with index map and fiber maps , an embedding as the composition of the embedding with the equivalence .
The following generalizes Theorems 6.30 and 6.23.
Theorem 7.5.
For every ,
- (1)
the ordinal has infima of complemented subsets, hence is compact,
- (2)
the embedding is extremely dense, order-preserving and order-reflecting.
Proof.
Write so that , and by Definition 4.30 its value at is the product of the over the fiber of at . We prove (1) together with () by induction on , where
- ()
the ordinal has infima of complemented subsets for every and every .
For (1), the ordinal has infima by inspection. The ordinal has them, which strengthens the compactness of its underlying type by taking the order into account (Examples 4.7(3)). The cases , and are all instances of the closure of this property under ordinal-indexed sums , applied in the last case to the family , which is where the second half of the induction is used.
For (), the ordinal is a product of the ordinals indexed by , which is a proposition because is an embedding, and each factor has infima by the first half of the induction. So Theorem 6.29 applies.
Compactness then follows from Remark 6.27.
(2) That is an embedding is part of Definition 7.4. Each of the three remaining properties is then inherited exactly as in Theorem 6.23. All three are preserved by maps of sums (Lemma 2.29(3) and Lemma 5.14, order reflection requiring, as there, that the index map be an embedding), all three are preserved by composition, and equivalences have all three. The only new base case is , where is extremely dense (Examples 3.3(6)) and is order-preserving and order-reflecting for the standard order on (Lemma 5.28). ∎
Corollary 7.6.
Every non-empty complemented subset of the ordinal has a least element for any .
Proof.
As that of Corollary 6.31, with Theorem 7.5(1) in place of Theorem 6.30. ∎
Classically, the embedding is a surjection and hence an equivalence, but this fails constructively, and so does the discreteness, and hence the trichotomy, of .
Proposition 7.7.
- (1)
The map is an equivalence for every if and only if holds.
- (2)
makes discrete for every .
- (3)
If is discrete for every , then holds.
Proof.
(1) () Instantiate at , where is the canonical map . If it is an equivalence then every conatural number is either the image of a unique or is , and the inverse image tells us which, and deciding, for an arbitrary , whether is finite is (as in the proof of Proposition 6.4).
() By induction on . At the map is the identity. At , the principle says exactly that finiteness is decidable, which makes split surjective and hence, being an embedding already (Examples 3.3(6)), an equivalence. At , and the map is the map of sums of Definition 7.4, which is an equivalence when its index map and all its fiber maps are (Lemma 2.29(1)). At the fiber map is additionally composed with the equivalence , which does not affect the conclusion.
(2) Under the map is an equivalence for every by (1), so is discrete, being equivalent to the discrete type (Theorem 7.2).
(3) Instantiate at again, the discreteness of being , since deciding for every is deciding whether a binary sequence is constantly . ∎
The embedding is order-preserving and order-reflecting, and it is natural to ask whether it additionally satisfies the initial-segment condition, so that for all codes . The code does satisfy this, but the requirement that it holds for every code fails constructively.
Proposition 7.8.
- (1)
The canonical embedding is a simulation, so that .
- (2)
The relation holds for every if and only if holds.
Proof.
(1) The map is order-preserving (Theorem 7.5(2)). It preserves initial segments because the points of below are the finite points with (Example 5.18), and such a point is the image of , which is below in whether is finite or is the added point.
(2) () Under the map is an equivalence (Proposition 7.7(1)), and it is order-preserving and order-reflecting (Theorem 7.5(2)), so it is an order equivalence, and an order equivalence is a simulation.
() The single code suffices. Its discrete interpretation is the sum of and , and its compact interpretation is the sum of and . In both, the right summand contributes the single point , and no point is above it (Definition 5.9), the order of being empty.
Let be a simulation of into . Every point of is below , so its image is below and hence is not , which nothing is above. The image therefore lies in the left summand, giving a map with .
The map is a simulation of into . It is order-preserving because is, and it preserves initial segments because on both sides the points below a point of the left summand are the points of the left summand below it. There is at most one simulation of one ordinal into another (Section 5.1), so by (1), and in particular sends the added point of to .
The map sends to . Otherwise its value there is for some , and, the point of being below , the conatural number would be below , whereas is below no conatural number (Example 5.18).
Now let . The point of is below , so initial-segment preservation gives a point of below whose image it is. That point lies in the left summand, say , and then . The assignment is a section of , and deciding whether is of the form decides whether is finite, which is . ∎
7.3. Inclusion of Brouwer codes into inductive-recursive codes
The two notation systems of this paper are related by an inclusion of the first into the second, under which both interpretations are preserved.
Definition 7.9.
The map is defined by induction, together with the family of the limit clause, whose index type is :
Theorem 7.10.
The map is an embedding, and for every Brouwer code ,
- (1)
,
- (2)
,
where the interpretations on the left are those of Definition 6.18 and those on the right are those of Definitions 7.1 and 7.4.
Proof.
The map is left cancellable. The constructors of have disjoint images and are left cancellable in each argument, so if then and are given by the same constructor of , and we argue by induction. At there is nothing to prove. At the hypothesis identifies with , hence with , so that by the induction hypothesis. At it identifies with , hence with , and evaluation at gives for every , again by the induction hypothesis.
A left-cancellable map into a set is an embedding (Definition 2.10), and is a set. For the latter, encode into the -type with one shape for each of the five constructors, of arities , , , and . The last of these accommodates , whose branching type is a retract of (Theorem 7.2): the code is recorded at the point of and the composite of with the retraction at the points of . This composite determines , because for the section , so that two families with the same composite with take the same value at every point of . The encoding is therefore left cancellable, and the -type is a set, a -type whose type of shapes is a set being one. A type admitting a left-cancellable map into a set is a set, so is a set and is an embedding.
The two agreements are proved by induction on . At both sides are the one-point ordinal. At both sides are additions of , that is, sums over (Definition 5.9) with the same index, so it is enough to compare their two summands, the left ones by the induction hypothesis and the right ones being on both sides. Order equivalent families over a common index have order equivalent sums, by Lemma 2.29(1) and Lemma 5.14 with the identity on the index.
At both sides are again sums over a common index, so again it is enough to compare the fibers.
In (1) the index is , whose underlying type is . The fibers on the left are the extension of the family along (Definition 5.25(2)), and those on the right are the values of (Definition 7.1). At the extension gives back (Lemma 5.23), which the induction hypothesis compares with . At the fiber of is empty, so the extension is the one-point ordinal (Lemma 4.31(2)), and so is .
In (2) the index is , but the two families are extensions along different embeddings into , namely on the left (Definition 5.25(1)) and on the right (Definition 7.4). The comparison at a point is defined on the elements of the two fibers. A point of the fiber on the left is a function assigning to each a point of , and it is sent to the function assigning to the image of under the induction hypothesis, and to the point of the one-point ordinal . This is an equivalence, its inverse restricting a function on along and applying the inverse of the induction hypothesis. It is order-preserving and order-reflecting, because a witness of the order relation is given at a point of the fiber, and at there is none, the order of the one-point ordinal being empty. ∎
As opposed to the interpretation of Brouwer codes, the interpretation of codes fails to be totally separated constructively.
Proposition 7.11.
If is totally separated for every code , then holds.
Proof.
Take , where sends the finite points of to and its added point to . By Definition 7.4, the ordinal is the sum over of the extension of along , so a point of its underlying type is a point together with a function assigning to each element of a point of the corresponding member of the family. The elements with first component contribute the one-point type , and the element with first component , which is available exactly when , contributes , which is and which we read as . Hence
the type of Examples 3.10(3), whose total separatedness gives . Total separatedness is closed under equivalence (Proposition 3.12(1)), so the total separatedness of gives too. ∎
Remark 7.12.
Since the compact interpretation of a Brouwer code is totally separated (Theorem 6.19(4)) and agrees with it along the inclusion of Theorem 7.10, the ordinals witnessing the failure are denoted by no Brouwer code, so that denotes strictly more compact ordinals.
7.4. Isolated points and limit points
A point in the image of the embedding can be isolated in or a limit point. A boolean valued function on , defined by induction on the code , determines which of the two holds at each point. Everything in this subsection holds verbatim for the Brouwer codes of Section 6.4, with the same proofs, and we develop it here because the inductive-recursive codes are the more general system.
In classical topology, a limit point is a non-isolated point. Assuming excluded middle in our type theory, every point of any set is isolated, and our ordinals are all sets, so that a point of our ordinals is never non-isolated. In order to overcome this difficulty in the absence of excluded middle but remaining compatible with excluded middle, we define an element to be a limit point when its isolatedness implies . We choose this taboo because is a weak continuity principle, as discussed in Remark 2.26.
Definition 7.13 (Topological limit point).
A point of a type is a limit point if its isolatedness implies :
For example, at the code , whose compact interpretation is , the finite points are isolated while the added point is a limit, its isolatedness being (Examples 3.3).
Definition 7.14 (Limit point indicator).
The limit point indicator of a code is the function defined by induction on by
Theorem 7.15.
For every and ,
- (1)
if then is isolated in ,
- (2)
if then is a limit point of ,
- (3)
every point in the image of is either isolated or a limit point,
- (4)
if holds, isolatedness of is decidable.
Proof.
(1) By induction on , using throughout that a pair is isolated as soon as both of its components are (Proposition 3.6(4)).
At the unique point is isolated, the type being discrete. At the hypothesis leaves , whose image is the finite conatural number , which is isolated (Examples 3.3(4)). At the image is a pair whose index is or , isolated in (Proposition 3.6(1)), and whose second component is isolated by the induction hypothesis, the value of at the pair being its value at that component. At and the hypothesis reads , so that and the induction hypothesis applies to both components. This finishes the case , and in the case the second component of the image is (Definition 7.4), which is isolated because is and equivalences preserve isolatedness (Proposition 3.6(5)).
(2) By induction on , assuming in each case that is isolated and deriving .
At the hypothesis leaves , whose image is , and the isolatedness of is (Examples 3.3(5)). The remaining cases pass the assumed isolatedness down to the component that flags, where the induction hypothesis converts it into .
At that component is the second one, and isolatedness of a pair gives isolatedness of its second component when the index type is a set (Proposition 3.6(4)), which is. At and the hypothesis reads , so that or , and the flagged component is the first or the second accordingly. At the sum is a product, whose components are both isolated with no further hypothesis (same item). At the first component needs the fibers of the extended family to be compact (Lemma 4.19), which is what the second half of the induction in the proof of Theorem 7.5(1) supplies, and the second component is isolated because is a set (Lemma 5.2), which gives the isolatedness of and hence of , equivalences reflecting isolatedness (Proposition 3.6(5)).
Remark 7.16.
A point of an ordinal is an order limit point when it is neither the least element nor a successor. This notion does not agree with the topological notion of limit point (Definition 7.13). The point of the ordinal in the lexicographic order is the successor of , and hence is not an order limit point, but it is a topological limit point, since its isolatedness gives , through its first coordinate , a limit point of .
8. Discussion
8.1. Summary of results
| Interpretation | Reading of the limit constructor | Holds for every code | Fails constructively |
| Brouwer codes (Definition 6.1), limit constructor | |||
|
standard
in (Definition 6.2) |
supremum | nothing beyond being an ordinal | trichotomy, giving (Proposition 6.4), and compactness, giving (Examples 4.5) |
|
in (Definition 6.6) |
extended sum | compact and totally separated (Theorem 6.7), a retract of (Theorem 6.19), and infima of complemented subsets (Theorem 6.30), hence the least element property (Corollary 6.31) | discreteness, giving (Proposition 6.21(2)), and hence trichotomy |
|
in (Definition 6.6) |
supremum of the extension | compact (Theorem 6.7) | total separatedness, giving (Proposition 6.9) |
|
in (Definition 6.6) |
sum over | trichotomous (Theorem 6.7), hence discrete (Lemma 5.8) | compactness, giving (Proposition 6.8) |
|
in (Definition 6.18) |
successor sum | trichotomous and a retract of , hence discrete (Theorem 6.19) | compactness (Proposition 6.21) and the least element property (Proposition 6.32), each equivalent to |
| Inductive-recursive codes (Definition 7.1), sum constructor | |||
|
in (Definition 7.1) |
sum over | trichotomous and a retract of , hence discrete (Theorem 7.2) | compactness and the least element property, each equivalent to (Proposition 7.3) |
|
in (Definition 7.4) |
sum over of the extension | compact, with infima of complemented subsets (Theorem 7.5), hence the least element property (Corollary 7.6) | total separatedness, giving (Proposition 7.11), and discreteness, giving (Proposition 7.7(3)) |
| Property | Status | Reference |
|---|---|---|
| Embedding | holds for every code | Theorems 6.23 and 7.4 |
| Extremely dense | ||
| Order-preserving | ||
| Order-reflecting | ||
| Surjective, equivalently an equivalence | fails constructively, and for all codes at once amounts to | Proposition 6.25 and Proposition 7.7(1) |
We constructed infinite types that are exhaustively searchable, and called them compact because in many respects they behave like the topological notion of the same name (Section 4). We then noticed that the constructions carry natural well-orders and preserve them, and the ordinals thus obtained measure the logical complexity of the compact types we produced. We gave two notation systems for them, each with several interpretations as ordinals.
The interpretations differ mainly in the reading of the limit constructor, and they are collected in Table 1, which records for each of them what holds and what fails constructively. Total separatedness, one of the properties listed there, is a boolean Leibniz principle corresponding to the topological notion of the same name (Section 3.2). Two of the interpretations are related by an embedding of the discrete one into the compact one (Definitions 6.22 and 6.23), whose properties are collected in Table 2. That embedding needs no assumption, whereas the comparisons among the other interpretations need excluded middle (Theorem 6.15), which for every Brouwer code gives
The inductive-recursive universe carries a discrete and a compact interpretation, and , related by the embedding , as the Brouwer codes do, but its sum constructor is indexed by any previously constructed discrete ordinal rather than by (Definitions 7.1 and 7.4). This is possible because the codes and their discrete interpretation are defined simultaneously, so that a code may be indexed by the ordinal denoted by an earlier code. The Brouwer codes are included in it, and the inclusion preserves both interpretations up to order equivalence (Theorem 7.10). Total separatedness of the compact interpretation for every code of gives (Proposition 7.11), whereas the compact interpretation of every Brouwer code is totally separated. The ordinals witnessing the failure are denoted by no Brouwer code.
In the compact ordinals of both systems, every non-empty complemented subset has a least element (Corollarys 6.31 and 7.6). The isolated points and the limit points in the image of the embedding are distinguished by an explicit boolean valued function on the discrete side (Definitions 7.14 and 7.15), and the embedding is an equivalence for every code precisely when holds (Proposition 6.25 and Proposition 7.7(1)).
Trichotomy of the standard interpretation gives (Proposition 6.4), the suprema by which it reads the limit constructor not preserving trichotomy, and total separatedness of the interpretation that reads the same constructor by a supremum of an extended family gives (Proposition 6.9).
The above constructions rest on the closure properties of compactness (Section 4.3), the micro-Tychonoff theorem for families indexed by a proposition (Theorem 4.26), the extension of a family along an embedding and the sums built from it (Sections 4.7 and 5.4), and suprema of families of ordinals (Section 5.5).
8.2. Reaching large compact ordinals
In [15, §11] we reach compact totally separated ordinals of every rank below in Gödel’s , by iterating squashed sums in the Cantor space, and conjecture that this is the best we can do, which Normann proved [36]. If a closed subset of the Baire space has a search functional definable in , then it is countable and its Cantor–Bendixson rank lies below . Normann attaches to the functional an evaluation tree, which bounds the rank by the Kleene–Brouwer order type of the tree, and Howard’s estimate of the ordinal complexity of reduction in puts that order type below .
Coquand, Hancock and Setzer [6] add the type of Definition 6.1 to as a base type, with its constructors but without its elimination principle, and ask which ordinals are denoted by the closed terms of type . They call a point of a type together with an endomap of and a map a limit structure, the generic one being itself with , and . Our interpretations are limit structures in this sense, their main difference being in the third component, which is the supremum for (Definition 6.2), the extended sum for and the successor sum for (Definition 6.18).
In system they build closed terms denoting , , and so on, so that the ordinal of the system is at least . They apply a device of Gentzen, which from a predicate closed under zero, successor and limits of sequences forms and then , again closed under those three operations. Under realizability this transformation turns a limit structure on into one on , so that ordinary recursion at higher types replaces transfinite recursion. In the extension of by one universe of small types, Poincaré’s device of replacing an impredicative intersection by a countable one becomes what they call a lens, a type former together with a map and a way of turning a limit structure on into one on , and every ordinal below is then denoted. This is the easy half of a conjecture of Hancock that one universe reaches exactly those ordinals. In its proof-theoretic form the conjecture reads that universes have strength , where and , so that is . Aczel established this for one universe and Feferman in general, and the limit of the is the Feferman–Schütte ordinal (see e.g. [38] for a survey). We can reproduce these constructions in our type theory and evaluate the codes by to get compact totally separated ordinals of the same ranks, and so of every rank below .
Our system of inductive-recursive codes (Section 7) extends the Brouwer codes, and constructively it denotes strictly more compact ordinals (Remark 7.12).
8.3. Formalization
Every result above was formalized in Agda [35], before this paper was written, in the TypeTopology repository [20], checked with the --safe and --without-K flags, and hence with no postulates, and with the necessary HoTT/UF principles as explicit assumptions of the results that need them. The formalization is spread over the TypeTopology and Ordinals directories in the repository, with auxiliary results in many other directories. For easy reference, we produced a companion Agda file [19] for this paper, which formalizes every definition, lemma, proposition, theorem, example and remark, in the same order and under the same numbering, together with the mathematical claims in running prose outside proofs. Its entries name existing code.
Acknowledgements
Mike Shulman supplied, in personal communication, the counterexample of Remark 5.15, that extensionality of lexicographic sums of ordinals implies excluded middle. Tom de Jong constructed suprema of families of ordinals by set quotients (Section 5.5), and formalized both his construction and ours [7].
References
- [1] Michael J. Beeson. Foundations of Constructive Mathematics: Metamathematical Studies. Ergebnisse der Mathematik und ihrer Grenzgebiete, 3. Folge. Springer, Berlin, Heidelberg, 1985.
- [2] Errett Bishop. Foundations of Constructive Analysis. McGraw-Hill, 1967.
- [3] Errett Bishop and Douglas Bridges. Constructive Analysis, volume 279 of Grundlehren der mathematischen Wissenschaften. Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1985.
- [4] Douglas Bridges and Luminiţa Simona Vîţă. Techniques of Constructive Analysis. Universitext. Springer, 2006.
- [5] Venanzio Capretta. General recursion via coinductive types. Logical Methods in Computer Science, Volume 1, Issue 2, 2005.
- [6] Thierry Coquand, Peter Hancock, and Anton Setzer. Ordinals in type theory. Invited talk at Computer Science Logic (CSL), Aarhus, 1997. https://www.cse.chalmers.se/~coquand/ordinal.pdf, also archived as https://web.archive.org/web/20251203190938/https://www.cse.chalmers.se/~coquand/ordinal.ps.
- [7] Tom de Jong. Domain theory in constructive and predicative univalent foundations. PhD thesis, University of Birmingham, 2023. https://etheses.bham.ac.uk/id/eprint/13401/, also available as arXiv:2301.12405.
- [8] Tom de Jong and Martín Hötzel Escardó. Examples and counterexamples of injective types. Annals of Pure and Applied Logic, 178(2), 2027. Available online 8 September 2026.
- [9] Peter Dybjer. A general formulation of simultaneous inductive-recursive definitions in type theory. The Journal of Symbolic Logic, 65(2):525–549, 2000.
- [10] Peter Dybjer and Anton Setzer. A finite axiomatization of inductive-recursive definitions. In Jean-Yves Girard, editor, Typed Lambda Calculi and Applications (TLCA 1999), volume 1581 of Lecture Notes in Computer Science, pages 129–146. Springer, 1999.
- [11] Peter Dybjer and Anton Setzer. Indexed induction-recursion. Journal of Logic and Algebraic Programming, 66:1–49, 2006.
- [12] Martín Hötzel Escardó. Synthetic topology of data types and classical spaces. Electronic Notes in Theoretical Computer Science, 87:21–156, 2004.
- [13] Martín Hötzel Escardó. Infinite sets that admit fast exhaustive search. In 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007), pages 443–452. IEEE, 2007.
- [14] Martín Hötzel Escardó. Exhaustible sets in higher-type computation. Logical Methods in Computer Science, 4(3):3:3, 37, 2008.
- [15] Martín Hötzel Escardó. Infinite sets that satisfy the principle of omniscience in any variety of constructive mathematics. The Journal of Symbolic Logic, 78(3):764–784, 2013. Revised version: https://martinescardo.github.io/papers/omniscient-journal-revised.pdf.
- [16] Martín Hötzel Escardó. Constructive decidability of classical continuity. Mathematical Structures in Computer Science, 25(7):1578–1589, 2015.
- [17] Martín Hötzel Escardó. Compact, totally separated and well-ordered types in univalent mathematics. In Types for Proofs and Programs (TYPES 2019), 2019. 4-page abstract, https://martinescardo.github.io/papers/compact-ordinals-Types-2019-abstract.pdf.
- [18] Martín Hötzel Escardó. Injective types in univalent mathematics. Mathematical Structures in Computer Science, 2021.
- [19] Martín Hötzel Escardó. TypeTopology.CompactTotallySeparatedTypesArticle: an Agda companion to the preprint Compact totally separated types. https://github.com/martinescardo/TypeTopology/blob/0025fb18cda5504f36b74cdbd2a05a8a4e1c1974/source/TypeTopology/CompactTotallySeparatedTypesArticle.lagda, rendered at https://www.cs.bham.ac.uk/~mhe/TypeTopology/TypeTopology.CompactTotallySeparatedTypesArticle.html, 2026. Part of the TypeTopology repository.
- [20] Martín Hötzel Escardó et al. TypeTopology: Agda development of univalent mathematics, mainly Type Topology. https://github.com/martinescardo/TypeTopology. Agda repository, continuously developed since 2011.
- [21] Martín Hötzel Escardó and Cory M. Knapp. Partial elements and recursion via dominances in univalent type theory. In Valentin Goranko and Mads Dam, editors, 26th EACSL Annual Conference on Computer Science Logic (CSL 2017), volume 82 of LIPIcs, pages 21:1–21:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017.
- [22] Martín Hötzel Escardó and Thomas Streicher. The intrinsic topology of Martin-Löf universes. Annals of Pure and Applied Logic, 167(9):794–805, 2016. Fourth Workshop on Formal Topology (4WFTop).
- [23] Michael Hedberg. A coherence theorem for Martin-Löf’s type theory. Journal of Functional Programming, 8(4):413–436, 1998.
- [24] Martin Hofmann. Extensional concepts in intensional type theory. Technical report ECS-LFCS-95-327, Laboratory for Foundations of Computer Science, University of Edinburgh, 1995. PhD thesis, freely available from https://www.lfcs.inf.ed.ac.uk/reports/95/ECS-LFCS-95-327/.
- [25] Martin Hofmann. Extensional Constructs in Intensional Type Theory. Distinguished Dissertations. Springer, 1997.
- [26] J. M. E. Hyland. The effective topos. In A. S. Troelstra and D. van Dalen, editors, The L. E. J. Brouwer Centenary Symposium, volume 110 of Studies in Logic and the Foundations of Mathematics, pages 165–216. North-Holland, 1982.
- [27] Peter T. Johnstone. On a topological topos. Proceedings of the London Mathematical Society, 38(2):237–271, 1979.
- [28] P.T. Johnstone. Stone Spaces. Cambridge University Press, Cambridge, 1982.
- [29] Stephen C. Kleene. Countable functionals. Constructivity in Mathematics, pages 81–100, 1959.
- [30] Stephen C. Kleene and Richard E. Vesley. The Foundations of Intuitionistic Mathematics, Especially in Relation to Recursive Functions. Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1965.
- [31] Nicolai Kraus, Martín Hötzel Escardó, Thierry Coquand, and Thorsten Altenkirch. Generalizations of Hedberg’s theorem. In Typed Lambda Calculi and Applications (TLCA 2013), volume 7941 of Lecture Notes in Computer Science, pages 173–188. Springer, 2013.
- [32] Nicolai Kraus, Martín Hötzel Escardó, Thierry Coquand, and Thorsten Altenkirch. Generalizations of Hedberg’s theorem. Logical Methods in Computer Science, 13(1):15:1–15:15, 2017.
- [33] Nicolai Kraus, Fredrik Nordvall Forsberg, and Chuangjie Xu. Connecting constructive notions of ordinals in homotopy type theory. In 46th International Symposium on Mathematical Foundations of Computer Science (MFCS 2021), LIPIcs, 2021.
- [34] John Longley and Dag Normann. Higher-Order Computability. Theory and Applications of Computability. Springer, 2015.
- [35] Ulf Norell, Nils Anders Danielsson, Jesper Cockx, Andreas Abel, et al. Agda.
- [36] Dag Normann. On the Cantor–Bendixson rank of a set that is searchable in Gödel’s T. Computability, 5(1):61–74, 2016. Accepted version at https://hdl.handle.net/11250/4673359.
- [37] Dag Normann and William Tait. On the computability of the fan functional. In Feferman on Foundations, Outstanding Contributions to Logic. Springer, 2017.
- [38] Erik Palmgren. On universes in type theory. In Giovanni Sambin and Jan M. Smith, editors, Twenty-Five Years of Constructive Type Theory, volume 36 of Oxford Logic Guides, pages 191–204. Oxford University Press, 1998.
- [39] Andrew M. Pitts. Setoids in intensional type theory. https://arxiv.org/abs/2607.23671, 2026.
- [40] Cécilia Pradic and Chad E. Brown. Cantor-Bernstein implies excluded middle, 2019. https://arxiv.org/abs/1904.09193.
- [41] The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics. https://homotopytypetheory.org/book, Institute for Advanced Study, 2013.
- [42] Egbert Rijke. The join construction, 2017.
- [43] Egbert Rijke. Introduction to Homotopy Type Theory. Cambridge Studies in Advanced Mathematics. Cambridge University Press, 2025.
- [44] Michael Shulman. All -toposes have strict univalent universes. https://arxiv.org/abs/1904.07004, 2019.
- [45] Michael B. Smyth. Power domains and predicate transformers: A topological view. In Josep Díaz, editor, Automata, Languages and Programming, 10th Colloquium, Barcelona, Spain, July 18–22, 1983, Proceedings, volume 154 of Lecture Notes in Computer Science, pages 662–675. Springer, 1983.
- [46] Michael B. Smyth. Topology. In S. Abramsky, Dov M. Gabbay, and T. S. E. Maibaum, editors, Handbook of Logic in Computer Science, Volume 1: Background: Mathematical Structures, pages 641–761. Oxford University Press, 1992.
- [47] A. S. Troelstra, editor. Metamathematical Investigation of Intuitionistic Arithmetic and Analysis, volume 344 of Lecture Notes in Mathematics. Springer, 1973.
- [48] Jaap van Oosten. Realizability: An Introduction to its Categorical Side, volume 152 of Studies in Logic and the Foundations of Mathematics. Elsevier, Amsterdam, 2008.
- [49] Vladimir Voevodsky. An experimental library of formalized mathematics based on the univalent foundations. Mathematical Structures in Computer Science, 25(5):1278–1294, 2015.
Full table of contents