arXiv is now an independent nonprofit! Learn more
License: CC BY 4.0
arXiv:2609.10447v1 [math.LO] 09 Sep 2026

Compact totally separated types

Martín Hötzel Escardó
Date: September 9, 2026
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 TT 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 XX. Given a function p:X→𝟐p:X\to\mathbf{2} into the type with elements 00 and 11, we want to either exhibit a point x:Xx:X with p​x=0p\,x=0, that is, a root of pp, or else determine that pp has no root. This problem amounts to the type

∏p:X→𝟐((Σx:Xpx=0)+(∏x:Xpx=1)).\textstyle\prod_{p\,:\,X\to\mathbf{2}}\,\Big(\big(\textstyle\Sigma_{x:X}p\,x=0\big)\;+\;\big(\textstyle\prod_{x:X}p\,x=1\big)\Big).

For a finite type XX this can always be done, by trying the finitely many points in turn. The question investigated in this paper is which infinite types XX admit such a procedure. Three related subjects view this requirement in three different ways.

  1. (1)

    Computer science reads it as a search problem. Can an infinite type be exhaustively searched mechanically in finite time? Perhaps surprisingly, there are plenty of infinite types that satisfy this searchability condition [12, 13, 14, 15].

  2. (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 𝟐\mathbf{2} 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. (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 pp has a root, and a choice principle produces one when it does. Asking every type XX of a universe 𝒰\mathcal{U} to satisfy the above is equivalent to global choice, the principle

∏X:𝒰(¬¬X→X),\textstyle\prod_{X:\mathcal{U}}\,\big(\neg\neg X\to X\big),

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,

ℕ∞:≡Σα: 2ℕ∏i:ℕα(i+1)≤αi,\mathbb{N}_{\infty}\;:\equiv\;\textstyle\Sigma_{\alpha\,:\,\mathbf{2}^{\mathbb{N}}}\,\textstyle\prod_{i:\mathbb{N}}\,\alpha\,(i{+}1)\leq\alpha\,i,

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 TT [15].

The compactness of ℕ∞\mathbb{N}_{\infty} has found applications outside the concerns of this paper. Normann and Tait [37] use its form in Gödel’s TT 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 𝟐\mathbf{2} 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 XX is totally separated when the functions into 𝟐\mathbf{2} separate the points, in the positive sense that

∏x,y:X(∏p:X→𝟐px=py)→x=y.\textstyle\prod_{x,y:X}\,\big(\textstyle\prod_{p\,:\,X\to\mathbf{2}}p\,x=p\,y\big)\to x=y.

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 Π\Pi, ++, ×\times and retracts, and include the discrete types and hence the simple types, but they fail to be closed under Σ\Sigma constructively in general, and we investigate particular cases of totally separated Σ\Sigma 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 x<yx<y or x=yx=y or x>yx>y for all elements xx and yy 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 ω+1\omega+1, which has two manifestations (among others). In one, we equip the type ℕ+𝟏\mathbb{N}+\mathbf{1} with its natural order, which gives rise to a trichotomous ordinal. In the other, we equip ℕ∞\mathbb{N}_{\infty} 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 LPO\mathrm{LPO} 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

ℕ+𝟏{\lx@inpgf@ignorespaces\mathbb{N}+\mathbf{1}}ℕ∞{\lx@inpgf@ignorespaces\mathbb{N}_{\infty}}inl​n{\lx@inpgf@ignorespaces\mathrm{inl}\,n}1n​0ω{\lx@inpgf@ignorespaces 1^{n}0^{\omega}}inr⋆{\lx@inpgf@ignorespaces\mathrm{inr}\,\star}1ω,{\lx@inpgf@ignorespaces 1^{\omega},}

which is an injection whose image has empty complement, but it is a bijection if and only if LPO\mathrm{LPO} holds. That every decreasing binary sequence is of one of the forms 1n​0ω1^{n}0^{\omega} and 1ω1^{\omega} fails constructively, being equivalent to LPO\mathrm{LPO}, 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 ω\omega. 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 p:X→𝟐p:X\to\mathbf{2} in the definition of compactness of the type XX, 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 ω\omega, 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 𝟎\mathbf{0}, a one-element type 𝟏\mathbf{1} with point ⋆\star, a two-element type 𝟐\mathbf{2} with points 0,10,1, a type ℕ\mathbb{N} of natural numbers, the type formers ++ (binary sum or coproduct), Π\Pi (product), Σ\Sigma (sum or disjoint union), 𝖶\mathsf{W} types, identity types denoted by the equality sign ==, and a hierarchy of universes 𝒰,𝒱,𝒲,…\mathcal{U},\mathcal{V},\mathcal{W},\dots closed under them, with 𝒰0\mathcal{U}_{0} the first and 𝒰1\mathcal{U}_{1} the next. Binary products, written X×YX\times Y, arise both as general products with index type 𝟐\mathbf{2} and as sums of constant families, and we choose the latter incarnation by default. We often write a function type X→YX\to Y in the exponential form YXY^{X}, as in the Cantor type 𝟐ℕ\mathbf{2}^{\mathbb{N}}.

For a family A:X→𝒰A:X\to\mathcal{U} and an identification p:x=yp:x=y, we define transportA​p:A​x→A​y\mathrm{transport}^{A}\,p:A\,x\to A\,y, by induction on pp considering the reflexivity identification p=reflp=\mathrm{refl}, with the family AA omitted when it is understood from the context. We say that a point a:A​xa:A\,x is transported along p:x=yp:x=y to get a point of the type A​yA\,y.

Definition 2.1 (Emptiness, negation and decidability).

We define

X is empty:≡(X→𝟎).\text{$X$ is empty}\;:\equiv\;(X\to\mathbf{0}).

When we think of the type XX as a mathematical statement, the emptiness of XX amounts to its negation and is written ¬X\neg X. We say that a type XX is decidable if we can decide whether it is pointed or empty:

X is decidable:≡X+¬X.\text{$X$ is decidable}\;:\equiv\;X+\neg X.

We remark that sometimes in the literature the terminology “XX is decidable” is used to mean that XX has decidable equality instead. Here we say that XX 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 XX and YY are logically equivalent if each maps into the other:

X and Y are logically equivalent:≡(X→Y)×(Y→X).\text{$X$ and $Y$ are logically equivalent}\;:\equiv\;(X\to Y)\times(Y\to X).

When the types XX and YY 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 ‖X‖\|X\| for the propositional truncation of a type XX, and ∃\exists and ∨\vee for the truncations of Σ\Sigma 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 ¬¬⁡X\neg\neg X 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 XX is a singleton or contractible if it has a point c:Xc:X, its center of contraction, to which every point is equal:

X is a singleton:≡Σc:X∏x:Xc=x.\text{$X$ is a singleton}\;:\equiv\;\textstyle\Sigma_{c:X}\,\prod_{x:X}\,c=x.

For a family A:X→𝒱A:X\to\mathcal{V}, there is a unique x:Xx:X with A​xA\,x when the sum of AA is a singleton:

∃!x:X,Ax:≡the type Σx:XAx is a singleton.\exists!\,x:X,\,A\,x\;:\equiv\;\text{the type $\Sigma_{x:X}\,A\,x$ 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 x:Xx:X is homotopy isolated if the identity type x=yx=y is a proposition for every y:Xy:X:

x is homotopy isolated:≡∏y:X(x=y is a proposition).\text{$x$ is homotopy isolated}\;:\equiv\;\textstyle\prod_{y:X}\,(\text{$x=y$ is a proposition}).

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 x=yx=y admits a weakly constant endofunction for every y:Xy:X, then xx is homotopy isolated. Hence if this holds at every x:Xx:X, then XX is a set.

Proof.

Fix y:Xy:X, and write ff for the weakly constant endofunction of x=yx=y, and c:x=xc:x=x for its value on refl\mathrm{refl}. We first show that every p:x=yp:x=y is the composite of c−1c^{-1} followed by f​pf\,p, by induction on pp, whose endpoint yy varies with it: for p=reflp=\mathrm{refl} this is c−1c^{-1} followed by cc, which is refl\mathrm{refl}. Given p,q:x=yp,q:x=y, both are then composites of c−1c^{-1} with values of ff on x=yx=y, and those two values are equal by weak constancy, so p=qp=q. Thus x=yx=y is a proposition. As yy was arbitrary, xx is homotopy isolated. ∎

This formulation of the theorem is due to Kraus, Escardó, Coquand and Altenkirch [31, 32].

Definition 2.6 (The type of propositions).

We write Ω𝒰\Omega_{\mathcal{U}} for the type of propositions in a universe 𝒰\mathcal{U}:

Ω𝒰:≡ΣP:𝒰(P is a proposition),\Omega_{\mathcal{U}}\;:\equiv\;\textstyle\Sigma_{P:\mathcal{U}}\,(\text{$P$ is a proposition}),

whose two canonical elements are ⊥:≡𝟎\bot:\equiv\mathbf{0} and ⊤:≡𝟏\top:\equiv\mathbf{1}. Propositional extensionality makes two elements of Ω𝒰\Omega_{\mathcal{U}} equal exactly when they are logically equivalent, and Ω𝒰\Omega_{\mathcal{U}} is a set. We omit the universe subscript when it is understood from the context.

Definition 2.7 (Base and fiber).

For a family Y:X→𝒱Y:X\to\mathcal{V} we call XX the base or index type of the sum Σ​Y\Sigma Y, that is, Σx:XYx\Sigma_{x:X}\,Y\,x, and Y​xY\,x the fiber over x:Xx:X. The fiber of a map f:X→Yf:X\to Y over a point y:Yy:Y is the type of points that ff sends to yy:

f−1(y):≡Σx:Xfx=y.f^{-1}(y)\;:\equiv\;\textstyle\Sigma_{x:X}\,f\,x=y.

The two usages agree up to type equivalence, the fiber of the first projection Σx:XYx→X\Sigma_{x:X}\,Y\,x\to X over xx being equivalent to Y​xY\,x.

Definition 2.8 (Type equivalences).

A map f:X→Yf:X\to Y is an equivalence if its fibers are all singletons:

f is an equivalence:≡∏y:Y(f−1​(y) is a singleton).\text{$f$ is an equivalence}\;:\equiv\;\textstyle\prod_{y:Y}\,(\text{$f^{-1}(y)$ is a singleton}).

With the above terminology, this says that for every y:Yy:Y there is a unique x:Xx:X with f​x=yf\,x=y. We write X≃YX\simeq Y for the type of equivalences from XX to YY:

X≃Y:≡Σf:X→Y(f is an equivalence).X\simeq Y\;:\equiv\;\textstyle\Sigma_{f:X\to Y}\,(\text{$f$ is an equivalence}).
Definition 2.9 (Surjections and induction along them).

A map f:X→Yf:X\to Y is a surjection if its fibers are all inhabited:

f:X→Y is a surjection:≡∏y:Y∥f−1(y)∥.\text{$f:X\to Y$ is a surjection}\;:\equiv\;\textstyle\prod_{y:Y}\,\|f^{-1}(y)\|.

This amounts to saying that ∏y:Y∃x:Xfx=y\prod_{y:Y}\,\exists_{x:X}\,f\,x=y. A surjection supports surjection induction: in order to prove a proposition valued P:Y→𝒱P:Y\to\mathcal{V} at every y:Yy:Y, it is enough to prove P⁡(f​x)P\,(f\,x) at every x:Xx:X. Conversely, a map supporting this principle is a surjection.

Definition 2.10 (Embeddings).

A map j:X→Yj:X\to Y is an embedding, written j:X↪Yj:X\hookrightarrow Y, if its fibers are all propositions:

j:X→Y is an embedding:≡∏y:Y(j−1​(y) is a proposition).\text{$j:X\to Y$ is an embedding}\;:\equiv\;\textstyle\prod_{y:Y}\,(\text{$j^{-1}(y)$ is a proposition}).

An embedding is left cancellable, in the sense that j​x=j​x′j\,x=j\,x^{\prime} implies x=x′x=x^{\prime}, 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 A:X→𝒱A:X\to\mathcal{V} is complemented if A​xA\,x is decidable for every x:Xx:X. A complemented family of propositions on XX amounts to a function X→𝟐X\to\mathbf{2}, its characteristic function.

Definition 2.12 (Subsets).

A subset of a type XX is a map from XX to the type of propositions of Definition 2.6:

S:X→Ω𝒰.S:X\to\Omega_{\mathcal{U}}.

Equivalently, a subset is a proposition valued map X→𝒰X\to\mathcal{U}. We write x∈Sx\in S, and say that xx is a member of SS, when the proposition S​xS\,x holds.

A proposition valued family A:X→𝒱A:X\to\mathcal{V} is equivalently an embedding Y↪XY\hookrightarrow X, the family given by its fibers, and when the family is complemented the embedding is classified by a map X→𝟐X\to\mathbf{2}, as illustrated by the following pullback diagram:

Y{\lx@inpgf@ignorespaces Y}𝟏{\lx@inpgf@ignorespaces\mathbf{1}}X{\lx@inpgf@ignorespaces X}𝟐.{\lx@inpgf@ignorespaces\mathbf{2}.}complemented1\scriptstyle{\lx@inpgf@ignorespaces 1}

In models such as Johnstone’s topological topos, complemented subsets get interpreted as clopens.

Definition 2.13 (Image).

A point y:Yy:Y is in the image of a map f:X→Yf:X\to Y when some x:Xx:X is sent to yy in an unspecified way, and the image of ff is the type of the points of YY that are in it:

y∈imagef:≡∥f−1(y)∥,imagef:≡Σy:Y(y∈imagef).y\in\mathrm{image}\,f\;:\equiv\;\|f^{-1}(y)\|,\qquad\mathrm{image}\,f\;:\equiv\;\textstyle\Sigma_{y:Y}\,(y\in\mathrm{image}\,f).

The image of a subset SS of XX along ff is the subset of YY whose members are the points that some member of SS is sent to in an unspecified way:

y∈imagefS:≡∃x:X(x∈S×(fx=y)).y\in\mathrm{image}\,f\,S\;:\equiv\;\exists_{x:X}\,\big(x\in S\times(f\,x=y)\big).

The corestriction of ff is the map X→image​fX\to\mathrm{image}\,f that sends xx to f​xf\,x 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 XX is 𝒰\mathcal{U}-small if it is equivalent to a type in the universe 𝒰\mathcal{U}, and it is locally 𝒰\mathcal{U}-small if the identity type x=yx=y is 𝒰\mathcal{U}-small for every x,y:Xx,y:X.

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 f:X→Yf:X\to Y, if XX is 𝒰\mathcal{U}-small and YY is a locally 𝒱\mathcal{V}-small set, then the image of ff (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 X:𝒰X:\mathcal{U} and every 𝒱\mathcal{V}-valued equivalence relation ≈\approx on XX, there is a set X/≈X/\approx, the set quotient of XX by ≈\approx, with a map η:X→X/≈\eta:X\to X/\approx that identifies related points and is universal: every map f:X→Yf:X\to Y into a set YY that identifies related points factors as f=f¯∘ηf=\bar{f}\circ\eta for a unique f¯:X/≈→Y\bar{f}:{X/\approx}\to Y.

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 (¬¬\neg\neg-separatedness).

A type XX is ¬¬\neg\neg-separated if identifications in it are ¬¬\neg\neg-stable:

X is ¬¬-separated:≡∏x,y:X¬¬(x=y)→x=y.\text{$X$ is $\neg\neg$-separated}\;:\equiv\;\textstyle\prod_{x,y:X}\,\neg\neg(x=y)\to x=y.

A type with decidable equality is ¬¬\neg\neg-separated, because decidable types are ¬¬\neg\neg-stable.

Lemma 2.18.

Every ¬¬\neg\neg-separated type is a set.

Proof.

Compose the natural map x=y→¬¬⁡(x=y)x=y\to\neg\neg(x=y) with the given ¬¬⁡(x=y)→x=y\neg\neg(x=y)\to x=y, obtaining an endofunction of x=yx=y. It is weakly constant, because ¬¬⁡(x=y)\neg\neg(x=y) 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 XX is a proposition valued relation ♯\mathrel{\sharp} which is

  1. (1)

    irreflexive: ¬(x♯x)\neg(x\mathrel{\sharp}x),

  2. (2)

    symmetric: x♯y→y♯xx\mathrel{\sharp}y\to y\mathrel{\sharp}x, and

  3. (3)

    cotransitive: x♯y→(x♯z)∨(y♯z)x\mathrel{\sharp}y\to(x\mathrel{\sharp}z)\vee(y\mathrel{\sharp}z).

It is tight if ¬(x♯y)\neg(x\mathrel{\sharp}y) implies x=yx=y, for all x,y:Xx,y:X.

An apartness is the positive counterpart of the negation of equality, in that x♯yx\mathrel{\sharp}y asserts a difference where ¬(x=y)\neg(x=y) 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 ¬¬\neg\neg-separated, and hence a set by Lemma 2.18.

Definition 2.20 (Extreme density).

For a map f:X→Yf:X\to Y the following are equivalent.

  1. (1)

    The complement of the image of ff is empty:

    ¬Σy:Y¬(y∈imagef).\neg\,\Sigma_{y:Y}\,\neg\,(y\in\mathrm{image}\,f).
  2. (2)

    No point of YY lies outside the image of ff:

    ¬Σy:Y¬Σx:Xfx=y.\neg\,\Sigma_{y:Y}\,\neg\,\Sigma_{x:X}\,f\,x=y.

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 ¬¬\neg\neg-density.

Proof.

For any type AA the negations ¬‖A‖\neg\|A\| and ¬A\neg A are logically equivalent, so the truncation in y∈image​fy\in\mathrm{image}\,f 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 ¬¬\neg\neg-separated types is right-cancellable: if j:X→Yj:X\to Y is extremely dense, if Z:Y→𝒰Z:Y\to\mathcal{U} has Z​yZ\,y ¬¬\neg\neg-separated for every y:Yy:Y, and if f,g:∏y:YZyf,g:\prod_{y:Y}Z\,y satisfy f⁡(j​x)=g⁡(j​x)f\,(j\,x)=g\,(j\,x) for every x:Xx:X, then f=gf=g.

In particular, taking ZZ constant, two maps Y→ZY\to Z into a ¬¬\neg\neg-separated type that agree after composition with jj are equal.

Proof.

For y:Yy:Y it is enough to prove ¬¬⁡(f​y=g​y)\neg\neg(f\,y=g\,y), ¬¬\neg\neg-separatedness of Z​yZ\,y supplying f​y=g​yf\,y=g\,y and function extensionality supplying f=gf=g. If f​y≠g​yf\,y\neq g\,y then no x:Xx:X satisfies j​x=yj\,x=y, since an identification p:j​x=yp:j\,x=y transports the hypothesis f⁡(j​x)=g⁡(j​x)f\,(j\,x)=g\,(j\,x) to f​y=g​yf\,y=g\,y, so yy lies outside the image of jj, contradicting extreme density. ∎

Lemma 2.22.

The embedding 𝟐→Ω𝒰\mathbf{2}\to\Omega_{\mathcal{U}} that sends 00 to ⊥\bot and 11 to ⊤\top is extremely dense.

Proof.

The map is an embedding because its fiber over PP is ¬P+P\neg P+P, a sum of two propositions that exclude each other. Let P:Ω𝒰P:\Omega_{\mathcal{U}} lie outside the image, so that P≠⊥P\neq\bot and P≠⊤P\neq\top, these being the two values of the map. Logically equivalent propositions are equal, so ¬P\neg P would give P=⊥P=\bot, and PP would give P=⊤P=\top. Hence ¬¬⁡P\neg\neg P and ¬P\neg P, which is a contradiction. So no point of Ω𝒰\Omega_{\mathcal{U}} lies outside the image. ∎

The fiber of this map over PP is the decidability of PP, 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 𝒰\mathcal{U} is the principle that every type in 𝒰\mathcal{U} is decidable, so that given any type X:𝒰X:\mathcal{U} we can either produce a point of XX or establish that XX is empty, that is,

∏X:𝒰(X+¬X).\textstyle\prod_{X:\mathcal{U}}\,(X+\neg X).

Equivalently, global choice says that we can choose a point of every non-empty type in 𝒰\mathcal{U},

∏X:𝒰(¬¬X→X),\textstyle\prod_{X:\mathcal{U}}\,(\neg\neg X\to X),

since a decidable type is ¬¬\neg\neg-stable and, conversely, the type X+¬XX+\neg X is non-empty for every XX. 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 𝒰\mathcal{U} says that every proposition in 𝒰\mathcal{U} is decidable:

∏P:𝒰(P is a proposition→P+¬P).\textstyle\prod_{P:\mathcal{U}}\,\big(\text{$P$ is a proposition}\to P+\neg P\big).

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 LPO\mathrm{LPO} (limited principle of omniscience) decides whether a binary sequence takes the value 00 somewhere, and WLPO\mathrm{WLPO} (weak limited principle of omniscience) decides whether it has value 11 everywhere:

LPO\displaystyle\mathrm{LPO} :≡∏p:𝟐ℕ(the type Σn:ℕpn=0 is decidable),\displaystyle:\equiv\textstyle\prod_{p:\mathbf{2}^{\mathbb{N}}}\,\big(\text{the type $\Sigma_{n:\mathbb{N}}\,p\,n=0$ is decidable}\big),
WLPO\displaystyle\mathrm{WLPO} :≡∏p:𝟐ℕ(the type ∏n:ℕpn=1 is decidable).\displaystyle:\equiv\textstyle\prod_{p:\mathbf{2}^{\mathbb{N}}}\,\big(\text{the type $\prod_{n:\mathbb{N}}\,p\,n=1$ is decidable}\big).

Equivalently, the principle LPO\mathrm{LPO} says that the finiteness of every conatural number is decidable, and WLPO\mathrm{WLPO} 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, Σ\Sigma-compactness of ℕ\mathbb{N} is LPO\mathrm{LPO} and Π\Pi-compactness of ℕ\mathbb{N} is WLPO\mathrm{WLPO} (Examples 4.5).

Excluded middle gives LPO\mathrm{LPO}, which gives WLPO\mathrm{WLPO}. The converse of the latter follows from Markov’s principle (namely that if a complemented family over ℕ\mathbb{N} 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 ¬¬⁡WLPO\neg\neg\mathrm{WLPO}, 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 WLPO\mathrm{WLPO} and hence LPO\mathrm{LPO}, 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 ∞\infty-toposes [44], the boolean ones included.

Remark 2.26 (Weak topological toposes).

The statement ¬WLPO\neg\mathrm{WLPO} is independent of our type theory and can be seen as a weak continuity principle [16]. We have that WLPO\mathrm{WLPO} is equivalent to the existence of a function ℕ∞→ℕ\mathbb{N}_{\infty}\to\mathbb{N} that is not continuous, and ¬WLPO\neg\mathrm{WLPO} to every function ℕ∞→ℕ\mathbb{N}_{\infty}\to\mathbb{N} being ¬¬\neg\neg-continuous, the double negation being removable under Markov’s principle (which we are not assuming). We think of toposes in which ¬WLPO\neg\mathrm{WLPO} 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 YY is a retract of a type XX if there are specified maps r:X→Yr:X\to Y and s:Y→Xs:Y\to X with r∘sr\circ s the identity. We call rr a retraction and ss a section.

Definition 2.28 (Maps of sums).

Let A:X→𝒰A:X\to\mathcal{U} and B:Y→𝒰B:Y\to\mathcal{U} be families of types, let f:X→Yf:X\to Y be a map, and let g​x:A​x→B⁡(f​x)g\,x:A\,x\to B\,(f\,x) be a map for every x:Xx:X. The map of the sums induced by ff and gg applies ff to the index and gg to the fiber component:

Σ⁡(f,g):Σ​A→Σ​B,Σ⁡(f,g)​(x,a)=(f​x,g​x​a).\Sigma(f,g):\Sigma A\to\Sigma B,\qquad\Sigma(f,g)\,(x,a)\;=\;(f\,x,\,g\,x\,a).
Lemma 2.29.

The map Σ⁡(f,g)\Sigma(f,g) is

  1. (1)

    an equivalence if ff is one and every g​xg\,x is,

  2. (2)

    an embedding if ff is one and every g​xg\,x is,

  3. (3)

    extremely dense if ff is and every g​xg\,x is,

  4. (4)

    a retraction if ff is the identity and every g​xg\,x is.

Proof.

The fiber of Σ⁡(f,g)\Sigma(f,g) over a point (y,b)(y,b) of Σ​B\Sigma B is the sum, over the points (x,p)(x,p) of the fiber of ff over yy, of the fiber of g​xg\,x over the point of B⁡(f​x)B\,(f\,x) obtained from bb by transport along pp. If the fibers of ff and of every g​xg\,x 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 (y,b)(y,b) be a point of Σ​B\Sigma B and assume that no point of Σ​A\Sigma A 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 ff supplies x:Xx:X with p:f​x=yp:f\,x=y. Transporting bb along pp backwards gives a point of B⁡(f​x)B\,(f\,x), and extreme density of g​xg\,x supplies a:A​xa:A\,x mapped to it, so that Σ⁡(f,g)​(x,a)=(y,b)\Sigma(f,g)\,(x,a)=(y,b), which is the required contradiction.

For (4), let s​xs\,x be a section of g​xg\,x for every xx. Then Σ⁡(id,s)\Sigma(\mathrm{id},s) is a section of Σ⁡(id,g)\Sigma(\mathrm{id},g), the two composing to Σ⁡(id,g∘s)\Sigma(\mathrm{id},g\circ s), 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 ℕ∞\mathbb{N}_{\infty} of conaturals, equivalently the final coalgebra of X↦𝟏+XX\mapsto\mathbf{1}+X, is the type of decreasing binary sequences,

ℕ∞:≡Σα: 2ℕ∏i:ℕα(i+1)≤αi.\mathbb{N}_{\infty}\;:\equiv\;\Sigma_{\alpha\,:\,\mathbf{2}^{\mathbb{N}}}\,\textstyle\prod_{i:\mathbb{N}}\,\alpha\,(i{+}1)\leq\alpha\,i.

Being decreasing is a proposition, so the first projection embeds ℕ∞\mathbb{N}_{\infty} into the Cantor type 𝟐ℕ\mathbf{2}^{\mathbb{N}}, and we write uiu_{i} for the ii-th digit of u:ℕ∞u:\mathbb{N}_{\infty}. This embedding is a section of the map β↦(i↦min⁡{β​ 0,…,β​i})\beta\mapsto\big(i\mapsto\min\{\beta\,0,\dots,\beta\,i\}\big) that forces a binary sequence to be decreasing and leaves the decreasing sequences unchanged, so ℕ∞\mathbb{N}_{\infty} is a retract of the Cantor type. Write ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} for the inclusion and k¯=ι​k\underline{k}=\iota\,k for its value at kk, the sequence of kk ones followed by zeros,

k¯=(i↦1 if i<k, and 0 otherwise),\underline{k}\;=\;\big(i\mapsto\text{$1$ if $i<k$, and $0$ otherwise}\big),

so that 0¯\underline{0} is constantly 00 and k+1¯\underline{k{+}1} prefixes a 11 to k¯\underline{k}. We let ∞:ℕ∞\infty:\mathbb{N}_{\infty} be the constantly 11 sequence. For n:ℕn:\mathbb{N} and u:ℕ∞u:\mathbb{N}_{\infty} we write n⊏un\mathrel{\sqsubset}u to say that the nn-th digit of uu is 11, and u⊑nu\mathrel{\sqsubseteq}n to say that it is 00, so that the two are negations of each other. We say that uu is finite when u=k¯u=\underline{k} for some kk, equivalently when u⊑iu\mathrel{\sqsubseteq}i for some ii.

3.1. Discrete types and isolated points

Definition 3.2 (Isolatedness and discreteness).

A point x:Xx:X is isolated if we can decide, for every y:Xy:X, whether xx and yy are equal:

x is isolated:≡∏y:X(x=y is decidable).\text{$x$ is isolated}\;:\equiv\;\textstyle\prod_{y:X}\,(\text{$x=y$ is decidable}).

A type XX is discrete if every point of XX is isolated, which amounts to saying that XX has decidable equality.

Examples 3.3.
  1. (1)

    The types 𝟎\mathbf{0}, 𝟏\mathbf{1} and 𝟐\mathbf{2} are discrete, and so is every proposition.

  2. (2)

    The type of natural numbers is discrete.

  3. (3)

    The type ℕ∞\mathbb{N}_{\infty} is discrete if and only if WLPO\mathrm{WLPO} holds.

  4. (4)

    The finite points of ℕ∞\mathbb{N}_{\infty} of the form n¯\underline{n} are isolated.

  5. (5)

    The point ∞\infty of ℕ∞\mathbb{N}_{\infty} is isolated if and only if WLPO\mathrm{WLPO} holds.

  6. (6)

    The map ℕ+𝟏→ℕ∞\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} sending inl​n\mathrm{inl}\,n to n¯\underline{n} and the added point to ∞\infty is an extremely dense embedding (Definition 2.20).

Proof.

Every proposition is discrete, since any two of its points are equal. The types 𝟎\mathbf{0} and 𝟏\mathbf{1} are propositions, and 𝟐\mathbf{2} is discrete, its two points being distinct.

The natural numbers are discrete, with equality decided by induction.

A finite point n¯\underline{n} is isolated, because u=n¯u=\underline{n} holds exactly when ui=1u_{i}=1 for i<ni<n and un=0u_{n}=0, which is decided by inspecting finitely many digits.

If ℕ∞\mathbb{N}_{\infty} is discrete then in particular ∞\infty is isolated, and if ∞\infty is isolated then WLPO\mathrm{WLPO} holds, because a binary sequence pp gives the conatural number uu with digits ui=min⁡{p​ 0,…,p​i}u_{i}=\min\{p\,0,\dots,p\,i\} (Example 3.1), and u=∞u=\infty exactly when pp is constantly 11. Conversely, WLPO\mathrm{WLPO} makes ℕ∞\mathbb{N}_{\infty} 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 i↦(ui equals vi)i\mapsto(\text{$u_{i}$ equals $v_{i}$}) is constantly 11.

The map ℕ+𝟏→ℕ∞\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} is an embedding, its fibers being propositions because (−)¯\underline{(-)} is an embedding, because ℕ∞\mathbb{N}_{\infty} is a set, which makes the constant map at ∞\infty an embedding, and because ∞\infty is not finite, so that no fiber meets both cases, and it is extremely dense, because a point of ℕ∞\mathbb{N}_{\infty} outside its image would be neither finite nor equal to ∞\infty, which is contradictory. ∎

Lemma 3.4.
  1. (1)

    Every discrete type is a set.

  2. (2)

    Every isolated point is homotopy isolated (Definition 2.4).

  3. (3)

    Being isolated and being discrete are propositions.

Proof.

From decidability of x=yx=y we get an endofunction of x=yx=y 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 xx is a Π\Pi-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 x=yx=y 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 Π\Pi-type. Being discrete is then a Π\Pi-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 x=yx=y decidable. Constructively the two differ: ℕ∞\mathbb{N}_{\infty} is a set, so every point is homotopy isolated, whereas ∞\infty is isolated if and only if WLPO\mathrm{WLPO} holds (Examples 3.3).

Proposition 3.6.
  1. (1)

    Isolatedness is preserved by inl\mathrm{inl}, inr\mathrm{inr}, and hence discreteness is closed under binary sums.

  2. (2)

    Discreteness is closed under retracts.

  3. (3)

    A subtype of a discrete type is discrete, and, more generally, at a discrete index type the Σ\Sigma-types of discrete types are discrete, so that in particular binary products are.

  4. (4)

    At any index type XX, if x:Xx:X and y:Y​xy:Y\,x are isolated then so is (x,y)(x,y), and conversely, isolatedness of (x,y)(x,y) gives isolatedness of yy when XX is a set, and for products also of xx, with no hypothesis. (Isolatedness of the first component of a general sum needs the fibers to be compact (Lemma 4.19).)

  5. (5)

    Left-cancellable maps, embeddings and equivalences reflect isolatedness, and equivalences also preserve isolatedness, and preserve and reflect discreteness.

Proof.

(1) inl​x\mathrm{inl}\,x is isolated when xx is, because an element of X+YX+Y is either of the form inl​x′\mathrm{inl}\,x^{\prime}, and then equality with inl​x\mathrm{inl}\,x reduces to x′=xx^{\prime}=x, or of the form inr​y\mathrm{inr}\,y, and then the two are distinct, and symmetrically for inr\mathrm{inr}. Discreteness of X+YX+Y follows by cases. (2) For a retraction rr with section ss, decide s​y=s​y′s\,y=s\,y^{\prime} in the discrete type. Equality of these two values gives y=y′y=y^{\prime} after applying the retraction rr and using r∘s∼idr\circ s\sim\mathrm{id}, and their inequality gives y≠y′y\neq y^{\prime}.

(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 Σ\Sigma-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 (x,y)(x,y) of isolated points, the same case analysis works at any index type. Isolatedness of xx decides the first components, and when they agree the identification between them is refl\mathrm{refl}, an isolated point being homotopy isolated (Lemma 3.4(2)), so that the second components are compared without transport. Conversely, from isolatedness of (x,y)(x,y) we recover isolatedness of yy by pairing an arbitrary y′y^{\prime} with xx, for which we need the identification of first components to be unique, that is, for XX to be a set. For ×\times the set hypothesis is unnecessary, the fiber not depending on the first component, and there isolatedness of xx is recovered as well, by pairing an arbitrary x′x^{\prime} with yy.

(5) A left-cancellable ff reflects isolatedness, since to decide x′=xx^{\prime}=x we decide f​x′=f​xf\,x^{\prime}=f\,x 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. (1)

    If a type YY has two distinct points, then discreteness of YXY^{X} implies that the emptiness of XX is decidable.

  2. (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 y0≠y1y_{0}\neq y_{1} in YY and decide, in the discrete type YXY^{X}, whether the two constant maps λ​x.y0\lambda x.\,y_{0} and λ​x.y1\lambda x.\,y_{1} are equal. If they are, then y0=y1y_{0}=y_{1} at every x:Xx:X, so XX must be empty. If they are not, then XX cannot be empty, since over an empty XX any two maps are equal.

For the second, let PP be a proposition and f:P→Yf:P\to Y land in homotopy isolated points. The fiber of ff over yy is Σp:P(fp=y)\Sigma_{p:P}(f\,p=y), and any two of its elements have equal first components, since PP is a proposition, and equal second components, since f​p=yf\,p=y is a proposition by homotopy isolatedness. So the fibers are propositions, and hence ff 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 XX is totally separated if the maps X→𝟐X\to\mathbf{2} separate the points of XX, in the positive sense that for all x,y:Xx,y:X, if p​x=p​yp\,x=p\,y for every p:X→𝟐p:X\to\mathbf{2}, then x=yx=y. Write

x=2y:≡∏p:𝟐Xpx=pyx=_{2}y\,:\equiv\,\prod_{p:\mathbf{2}^{X}}p\,x=p\,y

for the equivalence relation that xx and yy are indistinguishable by 𝟐\mathbf{2}-valued maps, so that total separatedness amounts to x=2y→x=yx=_{2}y\to x=y.

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. (1)

    Every discrete type is totally separated.

  2. (2)

    Every totally separated type is ¬¬\neg\neg-separated.

  3. (3)

    Every totally separated type is a set.

  4. (4)

    Being totally separated is a proposition.

Proof.

If XX is discrete and x=2yx=_{2}y, apply the hypothesis to the characteristic function of xx, which sends xx to 00. It must then send yy to 00 as well, which for that particular function means x=yx=y.

For ¬¬\neg\neg-separatedness, suppose ¬¬⁡(x=y)\neg\neg(x=y). For each p:X→𝟐p:X\to\mathbf{2} we get ¬¬⁡(p​x=p​y)\neg\neg(p\,x=p\,y) by applying pp, and 𝟐\mathbf{2} is ¬¬\neg\neg-separated because equality in it is decidable. So x=2yx=_{2}y, and total separatedness gives x=yx=y. Being a set then follows, since ¬¬\neg\neg-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 Π\Pi-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. (1)

    The homotopical circle fails to be totally separated for homotopical reasons, because it is not a set [41, Section 6.4], and totally separated types are sets by Lemma 3.9(3).

  2. (2)

    The type Ω𝒰\Omega_{\mathcal{U}} of propositions fails to be totally separated for constructive reasons: if Ω𝒰\Omega_{\mathcal{U}} is ¬¬\neg\neg-separated (in particular, if it is totally separated), then excluded middle holds for 𝒰\mathcal{U} (Definition 2.24).

  3. (3)

    More relevantly for us, the type Σx:ℕ∞ 2x=∞\Sigma_{x:\mathbb{N}_{\infty}}\,\mathbf{2}^{x=\infty} fails to be totally separated constructively, namely its total separatedness implies ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. 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 Σx:ℕ∞ 2x=∞\Sigma_{x:\mathbb{N}_{\infty}}\,\mathbf{2}^{x=\infty} of item (3) as a sequence that converges to two distinct points at infinity:

0011223344⋯\cdots∞0\infty_{0}∞1\infty_{1}

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 Σx:ℕ∞ 2x=∞\Sigma_{x:\mathbb{N}_{\infty}}\,\mathbf{2}^{x=\infty} gives a counterexample:

{0,1,…,∞0}\{0,1,\ldots,\infty_{0}\}∩\cap{0,1,…,∞1}\{0,1,\ldots,\infty_{1}\}==ℕ\mathbb{N}compactnot compact
Proof of Examples 3.10(2,3).

(2) Let PP be a proposition with ¬¬⁡P\neg\neg P, and regard it as a point p:Ω𝒰p:\Omega_{\mathcal{U}}. Then PP holds if and only if p=⊤p=\top, so ¬¬⁡P\neg\neg P gives ¬¬(p=⊤)\neg\neg(p=\top), and ¬¬\neg\neg-separatedness of Ω𝒰\Omega_{\mathcal{U}} gives p=⊤p=\top, hence PP. That is double negation elimination, which is equivalent to excluded middle. Total separatedness gives ¬¬\neg\neg-separatedness by Lemma 3.9(2).

(3) The type has two copies of the point at infinity, namely the pairs ∞0=(∞,λ​_​. 0)\infty_{0}=(\infty,\lambda\_.\,0) and ∞1=(∞,λ​_​. 1)\infty_{1}=(\infty,\lambda\_.\,1), which are distinct because ℕ∞\mathbb{N}_{\infty} is a set, so that the fibers over ∞\infty are compared without transport. A map pp separating them gives the two maps u↦p⁡(u,λ​_​. 0)u\mapsto p\,(u,\lambda\_.\,0) and u↦p⁡(u,λ​_​. 1)u\mapsto p\,(u,\lambda\_.\,1) from ℕ∞\mathbb{N}_{\infty} to 𝟐\mathbf{2}, which agree at every finite point, the type n¯=∞\underline{n}=\infty being empty, and differ at ∞\infty, and deciding whether a conatural number is ∞\infty amounts to WLPO\mathrm{WLPO} (Definition 2.25). So ¬WLPO\neg\mathrm{WLPO} leaves the two points indistinguishable by 𝟐\mathbf{2}-valued maps, and total separatedness would then identify them, so total separatedness of the sum gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. ∎

Write

x♯2y:≡∃p:𝟐Xpx≠pyx\mathrel{\sharp}_{2}y:\equiv\exists_{p:\mathbf{2}^{X}}\,p\,x\neq p\,y

for the relation that some 𝟐\mathbf{2}-valued map separates xx from yy. For every type XX, whether or not it is totally separated, this is an apartness: irreflexivity says that p​x≠p​xp\,x\neq p\,x is impossible, symmetry is clear, and for cotransitivity, given pp with p​x≠p​yp\,x\neq p\,y and any zz, decide p​x=p​zp\,x=p\,z in 𝟐\mathbf{2}, which gives p​z≠p​yp\,z\neq p\,y in one case and p​x≠p​zp\,x\neq p\,z in the other.

Proposition 3.11.

The following are equivalent for any type XX.

  1. (1)

    XX is totally separated, meaning that x=2y→x=yx=_{2}y\to x=y.

  2. (2)

    The quasi-component Σyx=2y\Sigma_{y}\,x=_{2}y of every point x:Xx:X is a singleton.

  3. (3)

    The evaluation function evalX:X→𝟐𝟐X\mathrm{eval}_{X}:X\to\mathbf{2}^{\mathbf{2}^{X}} that maps x:Xx:X to the function (p↦p​x):𝟐X→𝟐(p\mapsto p\,x):\mathbf{2}^{X}\to\mathbf{2} is an embedding.

  4. (4)

    The apartness relation ♯2\mathrel{\sharp}_{2} is tight.

Proof.

(1)⇔\Leftrightarrow(2). The quasi-component of a point xx has the point (x,refl2)(x,\mathrm{refl}_{2}), where refl2\mathrm{refl}_{2} witnesses the reflexivity of =2=_{2}. Assuming (1), any point (y,e)(y,e) of the quasi-component has y=xy=x, and the second components then agree because x=2yx=_{2}y is a proposition, being a Π\Pi-type of identity types in the set 𝟐\mathbf{2}. So the quasi-component of xx is a singleton, with center (x,refl2)(x,\mathrm{refl}_{2}). Conversely, assume (2) and let ee witness x=2yx=_{2}y. The points (x,refl2)(x,\mathrm{refl}_{2}) and (y,e)(y,e) of the quasi-component of xx are equal, and their first components give x=yx=y.

(1)⇔\Leftrightarrow(3). An embedding is a map whose fibers are propositions, and the fiber of evalX\mathrm{eval}_{X} over a point Φ\Phi of 𝟐𝟐X\mathbf{2}^{\mathbf{2}^{X}} is the type

Σx:X(evalXx=Φ).\Sigma_{x:X}\,(\mathrm{eval}_{X}\,x=\Phi).

By function extensionality, an identification evalX​x=evalX​y\mathrm{eval}_{X}\,x=\mathrm{eval}_{X}\,y amounts to x=2yx=_{2}y. Assuming (3), if x=2yx=_{2}y then the points (x,refl)(x,\mathrm{refl}) and (y,e)(y,e), where ee is the identification that x=2yx=_{2}y gives in this way, lie in the fiber over evalX​x\mathrm{eval}_{X}\,x, which is a proposition, so they are equal and their first components give x=yx=y. Conversely, assuming (1), any two points of a fiber have equal first components, and their second components then agree because 𝟐𝟐X\mathbf{2}^{\mathbf{2}^{X}} is a set, being a product of copies of the set 𝟐\mathbf{2}.

(1)⇔\Leftrightarrow(4). Tightness of ♯2\mathrel{\sharp}_{2} says that ¬(x♯2y)\neg(x\mathrel{\sharp}_{2}y) implies x=yx=y, and the hypothesis says that no pp separates xx from yy. The truncation in ♯2\mathrel{\sharp}_{2} can be dropped, because the statement is negated and hence a proposition. Since p​x≠p​yp\,x\neq p\,y is decidable in 𝟐\mathbf{2}, the hypothesis is equivalent to p​x=p​yp\,x=p\,y for every pp, that is, to x=2yx=_{2}y. So tightness of ♯2\mathrel{\sharp}_{2} and total separatedness are the same assertion. ∎

Proposition 3.12.

Total separatedness is closed under

  1. (1)

    retracts, hence under equivalence,

  2. (2)

    binary products,

  3. (3)

    sums when the index type is discrete, and, as the special case of this indexed by 𝟐\mathbf{2}, under binary sums,

  4. (4)

    arbitrary products.

Proof.

For retracts, let r:X→Yr:X\to Y be a retraction with section ss, and let y=2y′y=_{2}y^{\prime} in YY. Testing yy and y′y^{\prime} against the predicates of the form q∘sq\circ s with q:X→𝟐q:X\to\mathbf{2} gives sy=2sy′s\,y=_{2}s\,y^{\prime}, hence s​y=s​y′s\,y=s\,y^{\prime} by the total separatedness of XX, and applying rr gives y=y′y=y^{\prime}.

For sums over a discrete index, let (a,b)=2(x,y)(a,b)=_{2}(x,y) in Σ​Y\Sigma\,Y. Testing against the predicates that ignore the second component gives a=2xa=_{2}x in the index, and hence a=xa=x by discreteness and Lemma 3.9(1). Let b′b^{\prime} be the transport of bb along this identification. Given q:Y​x→𝟐q:Y\,x\to\mathbf{2}, define a predicate on Σ​Y\Sigma\,Y by deciding, for each index uu, whether u=xu=x, which discreteness allows, and sending (u,v)(u,v) to the value of qq at the transport of vv along the identification u=xu=x when there is one, and to 00 when there is not. A discrete type is a set (Lemma 3.4(1)), so the identification decided at xx itself is refl\mathrm{refl}, and the predicate takes the value q​yq\,y at (x,y)(x,y). Testing (a,b)(a,b) and (x,y)(x,y) against it gives q​b′=q​yq\,b^{\prime}=q\,y. So b′=2yb^{\prime}=_{2}y, and the total separatedness of Y​xY\,x gives b′=yb^{\prime}=y, which together with a=xa=x gives (a,b)=(x,y)(a,b)=(x,y). Binary sums are the case of a two-element discrete index.

For products, let φ=2ψ\varphi=_{2}\psi in ∏xY​x\prod_{x}Y\,x, and fix x:Xx:X and q:Y​x→𝟐q:Y\,x\to\mathbf{2}. Testing φ\varphi and ψ\psi against the predicate λ​γ.q⁡(γ​x)\lambda\gamma.\,q\,(\gamma\,x) gives q⁡(φ​x)=q⁡(ψ​x)q\,(\varphi\,x)=q\,(\psi\,x), so that φx=2ψx\varphi\,x=_{2}\psi\,x, and the total separatedness of Y​xY\,x gives φ​x=ψ​x\varphi\,x=\psi\,x. Since xx was arbitrary, the functions φ\varphi and ψ\psi agree at every point and hence are equal. Binary products are the case of a two-element index. ∎

Examples 3.13.
  1. (1)

    Total separatedness fails constructively to be closed under Σ\Sigma. The index type and the fibers of the type Σx:ℕ∞ 2x=∞\Sigma_{x:\mathbb{N}_{\infty}}\,\mathbf{2}^{x=\infty} are totally separated, whereas its own total separatedness implies ¬¬⁡WLPO\neg\neg\mathrm{WLPO} (Examples 3.10(3)).

  2. (2)

    The simple types are the smallest collection of types containing ℕ\mathbb{N} and closed under function types, and the Baire type ℕℕ\mathbb{N}^{\mathbb{N}} is one of them. Every simple type is totally separated and pointed, and has ℕ\mathbb{N} as a retract. More generally, every retract of ℕ\mathbb{N}, such as the type 𝟐\mathbf{2}, is a retract of every simple type.

  3. (3)

    The converse of Lemma 3.9(1) fails constructively: the Cantor type 𝟐ℕ\mathbf{2}^{\mathbb{N}} is totally separated, and its discreteness implies WLPO\mathrm{WLPO}.

Total separatedness also fails constructively to be closed under surjective images, as we will see in Example 6.10.

Proof.

(1) The index type ℕ∞\mathbb{N}_{\infty} is a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (Example 3.1), and the Cantor type and the fibers 𝟐x=∞\mathbf{2}^{x=\infty} are products of copies of 𝟐\mathbf{2}, 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 ℕ\mathbb{N} is discrete and hence totally separated, and total separatedness is closed under Π\Pi (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 AA is a retract of YY and XX is pointed, then AA is a retract of YXY^{X}, sending a point of AA to the constant function at its image in YY, and recovering it from a function X→YX\to Y by evaluating at the point of XX and retracting. A retract of ℕ\mathbb{N} is a retract of the base type, so this step carries it through the function types, and the type 𝟐\mathbf{2} is a retract of ℕ\mathbb{N}.

(3) The Cantor type 𝟐ℕ\mathbf{2}^{\mathbb{N}} is a product of copies of 𝟐\mathbf{2}, 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 11, that is, whether it is constantly 11, which is WLPO\mathrm{WLPO} 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 A:ℕ∞→𝒱A:\mathbb{N}_{\infty}\to\mathcal{V} with A​uA\,u totally separated for every uu and with A​∞A\,\infty a proposition, its sum Σ​A\Sigma A is totally separated.

Proof.

Let (u,a)=2(v,b)(u,a)=_{2}(v,b). Testing against the predicates that ignore the second component gives u=2vu=_{2}v, and ℕ∞\mathbb{N}_{\infty} is totally separated, being a retract (Example 3.1) of the totally separated type 𝟐ℕ\mathbf{2}^{\mathbb{N}} (Examples 3.13(3)), so u=vu=v. Transport aa along this identification to a′:A​va^{\prime}:A\,v, so that (u,a)=(v,a′)(u,a)=(v,a^{\prime}), and it remains to show that a′=ba^{\prime}=b, for which, A​vA\,v being totally separated, it is enough to show that a′=2ba^{\prime}=_{2}b. So let r:A​v→𝟐r:A\,v\to\mathbf{2}. As 𝟐\mathbf{2} is ¬¬\neg\neg-separated it is enough to rule out r​a′≠r​br\,a^{\prime}\neq r\,b, so suppose that it holds. If vv were a finite point n¯\underline{n}, then, that point being isolated (Examples 3.3), rr would extend to a predicate on Σ​A\Sigma A by deciding, for each index ww, whether w=n¯w=\underline{n}, applying rr after transport when it is and taking the value 00 when it is not, as in the proof of Proposition 3.12 for a discrete index, and testing (u,a)(u,a) and (v,b)(v,b) against it would give r​a′=r​br\,a^{\prime}=r\,b. So vv is not a finite point. If vv were ∞\infty, then a′=ba^{\prime}=b, since A​∞A\,\infty is a proposition, and again r​a′=r​br\,a^{\prime}=r\,b. So v≠∞v\neq\infty. But a conatural number that is not finite is ∞\infty, which is a contradiction. ∎

Every type can be turned into a totally separated type in a universal way.

Theorem 3.15.

Every type XX has a totally separated reflection 𝕋​X\mathbb{T}\,X, constructed as the image of the evaluation map evalX:X→𝟐𝟐X\mathrm{eval}_{X}:X\to\mathbf{2}^{\mathbf{2}^{X}} defined in Proposition 3.11(3), together with a reflector η𝕋:X→𝕋​X\eta^{\mathbb{T}}:X\to\mathbb{T}\,X, such that

  1. (1)

    𝕋​X\mathbb{T}\,X is totally separated, and η𝕋\eta^{\mathbb{T}} is a surjection,

  2. (2)

    for every totally separated AA and f:X→Af:X\to A, there is a unique f¯:𝕋​X→A\bar{f}:\mathbb{T}\,X\to A with f¯∘η𝕋=f\bar{f}\circ\eta^{\mathbb{T}}=f, or, equivalently, precomposition with η𝕋\eta^{\mathbb{T}} is an equivalence A𝕋​X≃AXA^{\mathbb{T}\,X}\simeq A^{X},

  3. (3)

    the reflector identifies xx and yy if and only if x=2yx=_{2}y.

Proof.

Put 𝕋​X:≡image⁡(evalX)\mathbb{T}\,X:\equiv\mathrm{image}(\mathrm{eval}_{X}), a subtype of 𝟐𝟐X\mathbf{2}^{\mathbf{2}^{X}}, and let η𝕋\eta^{\mathbb{T}} be the corestriction of evalX\mathrm{eval}_{X}, which is a surjection onto its image, so that surjection induction (Definition 2.9) is available for η𝕋\eta^{\mathbb{T}}.

(1) 𝕋​X\mathbb{T}\,X is totally separated, since its elements are pairs (φ,w)(\varphi,w) with ww a truncated witness of being in the image, hence a proposition, so two elements are equal as soon as their first components are. Given (φ,w)=2(γ,w′)(\varphi,w)=_{2}(\gamma,w^{\prime}), test against the predicates x′↦pr1​x′​px^{\prime}\mapsto\mathrm{pr}_{1}x^{\prime}\,p for each p:X→𝟐p:X\to\mathbf{2}, which gives φ​p=γ​p\varphi\,p=\gamma\,p for every pp, so φ=γ\varphi=\gamma.

(2) Let AA be totally separated and f:X→Af:X\to A. Uniqueness is immediate from η𝕋\eta^{\mathbb{T}} being a surjection and AA a set (Lemma 3.9(3)). For existence, note that by Proposition 3.11(3) the map evalA\mathrm{eval}_{A} is an embedding, so the fibers Σa​evalA​a=γ\Sigma_{a}\,\mathrm{eval}_{A}\,a=\gamma are propositions, and this lets us define f¯​(φ,w)\bar{f}(\varphi,w) by untruncating ww, because the target is a proposition, and taking the unique aa with evalA​a=λ​q.φ⁡(q∘f)\mathrm{eval}_{A}\,a=\lambda q.\,\varphi(q\circ f). By construction, q⁡(f¯​(φ,w))=φ⁡(q∘f)q\,(\bar{f}\,(\varphi,w))=\varphi\,(q\circ f) for every q:A→𝟐q:A\to\mathbf{2}, so that q⁡(f¯​(η𝕋​x))=q⁡(f​x)q\,(\bar{f}\,(\eta^{\mathbb{T}}\,x))=q\,(f\,x) at every x:Xx:X, and the total separatedness of AA gives f¯∘η𝕋=f\bar{f}\circ\eta^{\mathbb{T}}=f.

(3) If η𝕋​x=η𝕋​y\eta^{\mathbb{T}}\,x=\eta^{\mathbb{T}}\,y then their first components agree, which is exactly x=2yx=_{2}y. Conversely x=2yx=_{2}y gives equality of first components, and the second components are propositions. ∎

A special case of interest of Theorem 3.15(2) is A=𝟐A=\mathbf{2}, which shows that the boolean valued predicates on XX are in canonical bijection with those on 𝕋​X\mathbb{T}\,X.

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 XX is Σ\Sigma-compact, or compact for short, if it is decidable, for every p:X→𝟐p:X\to\mathbf{2}, whether pp has a root:

∏p:𝟐X(the type Σx:Xpx=0 is decidable).\textstyle\prod_{p:\mathbf{2}^{X}}\,\big(\text{the type $\Sigma_{x:X}\,p\,x=0$ is decidable}\big).

We also consider the weaker notions of ∃\exists-compactness and Π\Pi-compactness, obtained by replacing Σx:Xpx=0\Sigma_{x:X}\,p\,x=0 by ∃x:Xpx=0\exists_{x:X}\,p\,x=0 and by Πx:Xpx=1\Pi_{x:X}\,p\,x=1 respectively.

The same notions can be equivalently formulated with an arbitrary complemented family in place of a 𝟐\mathbf{2}-valued predicate.

Lemma 4.2.

For any type XX and any universe 𝒱\mathcal{V}, the compactness of XX is logically equivalent to the statement that the sum Σx:XAx\Sigma_{x:X}\,A\,x is decidable for every complemented family A:X→𝒱A:X\to\mathcal{V}, and also to the restriction of this to proposition valued families AA.

Proof.

A complemented family AA has a characteristic function p:X→𝟐p:X\to\mathbf{2}, with p​x=0p\,x=0 giving A​xA\,x and p​x=1p\,x=1 refuting it, and then A​xA\,x and p​x=0p\,x=0 are logically equivalent for every xx, because A​xA\,x rules out p​x=1p\,x=1. In the other direction, a predicate p:X→𝟐p:X\to\mathbf{2} gives the family sending xx to 𝟏\mathbf{1} when p​x=0p\,x=0 and to 𝟎\mathbf{0} when p​x=1p\,x=1, which is complemented and proposition valued, and which lives in any universe, because 𝟎\mathbf{0} and 𝟏\mathbf{1} do. Pointwise logically equivalent families have logically equivalent Σ\Sigma-types, and decidability is invariant under logical equivalence. ∎

The notions of ∃\exists-compactness and Π\Pi-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 𝒱\mathcal{V}.

Lemma 4.3.

Every compact type is decidable, and every decidable proposition is compact.

Proof.

For the first claim, apply compactness of XX to the constantly 00 predicate. Either it has a root, which in particular supplies a point of XX, or else 0=10=1 for every point of XX, which gives ¬X\neg X.

For the second, let XX be a decidable proposition and let p:X→𝟐p:X\to\mathbf{2}. If ¬X\neg X then p​x=1p\,x=1 for every x:Xx:X vacuously. If x:Xx:X, decide the value of p​xp\,x. If p​x=0p\,x=0 then pp has a root. If p​x=1p\,x=1 then, since XX is a proposition, every y:Xy:X is equal to xx, so p​y=1p\,y=1. ∎

Proposition 4.4.

Every type in a universe 𝒰\mathcal{U} is compact if and only if global choice holds for 𝒰\mathcal{U} (Definition 2.23).

Proof.

Assume global choice, let X:𝒰X:\mathcal{U} and let p:X→𝟐p:X\to\mathbf{2}. Then Σx:Xpx=0\Sigma_{x:X}\,p\,x=0 is a type in 𝒰\mathcal{U}, so it is decidable by global choice, which amounts to the compactness of XX. Conversely, if every type in 𝒰\mathcal{U} is compact then every type in 𝒰\mathcal{U} 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. (1)

    Every finite type is compact, a finite type being one of the form 𝟏+⋯+𝟏\mathbf{1}+\cdots+\mathbf{1}, which includes the base case 𝟎\mathbf{0} in the obvious inductive definition.

  2. (2)

    ℕ\mathbb{N} is compact if and only if LPO\mathrm{LPO} holds.

  3. (3)

    ℕ\mathbb{N} is ∃\exists-compact if and only if LPO\mathrm{LPO} holds.

  4. (4)

    ℕ\mathbb{N} is Π\Pi-compact if and only if WLPO\mathrm{WLPO} 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 XX.

  1. (1)

    XX is compact and pointed.

  2. (2)

    For every p:X→𝟐p:X\to\mathbf{2} we can find x0:Xx_{0}:X such that p​x0=1p\,x_{0}=1 implies p​x=1p\,x=1 for all x:Xx:X:

    ∏p:𝟐XΣx0:X(px0=1→∀x.px=1).\prod_{p:\mathbf{2}^{X}}\Sigma_{x_{0}:X}\,\big(p\,x_{0}=1\to\forall x.\,p\,x=1\big).

We call such an x0x_{0} a universal witness for pp. It is a root of pp if and only if pp has some root.

We call a function ε:𝟐X→X\varepsilon:\mathbf{2}^{X}\to X assigning a universal witness to each pp a selection function for XX. In (2), a candidate root is produced before it is known whether a root exists.

Proof.

(1) implies (2). Let XX be compact and x⋆:Xx_{\star}:X, and let p:X→𝟐p:X\to\mathbf{2}. By compactness, either pp has a root xx, and we take x0=xx_{0}=x, so that the implication p​x0=1→∀x.p​x=1p\,x_{0}=1\to\forall x.\,p\,x=1 holds vacuously because p​x0=0p\,x_{0}=0, or else p​x=1p\,x=1 for every xx, and we take x0=x⋆x_{0}=x_{\star}, the conclusion of the implication being the assumption of this case.

(2) implies (1). Let p:X→𝟐p:X\to\mathbf{2}, with universal witness x0x_{0}. If p​x0=0p\,x_{0}=0 then x0x_{0} is a root of pp. If p​x0=1p\,x_{0}=1 then p​x=1p\,x=1 for every xx by the universality of x0x_{0}. This is precisely the case distinction required by compactness. For pointedness, apply the hypothesis to e.g. the constantly 00 predicate, which gives a point of XX.

A universal witness is a candidate root. With x0x_{0} a universal witness for pp, one direction is trivial, since if x0x_{0} is a root then pp has a root. For the other, suppose p​x=0p\,x=0 for some xx. Then it is not the case that p​x′=1p\,x^{\prime}=1 for every x′x^{\prime}, since that would give p​x=1p\,x=1, contradicting p​x=0p\,x=0. By the contrapositive of the universality of x0x_{0}, we conclude p​x0≠1p\,x_{0}\neq 1 and so x0x_{0} is a root. ∎

Examples 4.7.
  1. (1)

    The type 𝟐\mathbf{2} is compact pointed, with a selection function given by ε​p=p​ 0\varepsilon\,p=p\,0 for any p:𝟐𝟐p:\mathbf{2}^{\mathbf{2}}.

  2. (2)

    The type Ω𝒰\Omega_{\mathcal{U}} of propositions in a universe 𝒰\mathcal{U} is compact pointed too, despite excluded middle being undecided in our type theory.

  3. (3)

    The type ℕ∞\mathbb{N}_{\infty} of Example 3.1 is an infinite compact type, with a root selection function ε​p=(n↦min⁡{p⁡(k¯)∣k≤n})\varepsilon\,p=(n\mapsto\min\{p(\underline{k})\mid k\leq n\}) (cf. Section 4.2). Moreover, ε​p\varepsilon\,p is the infimum of the set of roots of pp, which may or may not be a root, but is a root if and only if pp has some root.

Proof.

For 𝟐\mathbf{2}, take x0=p​ 0x_{0}=p\,0 and suppose p⁡(p​ 0)=1p\,(p\,0)=1. We first get p​ 0=1p\,0=1 by cases on p​ 0p\,0: it is immediate when p​ 0=1p\,0=1, and when p​ 0=0p\,0=0, substituting that equation into p⁡(p​ 0)=1p\,(p\,0)=1 gives p​ 0=1p\,0=1, a contradiction. Substituting p​ 0=1p\,0=1 into p⁡(p​ 0)=1p\,(p\,0)=1 then gives p​ 1=1p\,1=1, so pp is constantly 11.

For Ω𝒰\Omega_{\mathcal{U}}, decide the value of p⊥p\,\bot. If p⊥=0p\,\bot=0, take ⊥\bot as a universal witness, the implication holding vacuously. If p⊥=1p\,\bot=1, take ⊤\top, and we must show that if also p⊤=1p\,\top=1 then pp is constantly 11. Two maps Ω𝒰→𝟐\Omega_{\mathcal{U}}\to\mathbf{2} that agree at ⊥\bot and ⊤\top agree everywhere, because the map 𝟐→Ω𝒰\mathbf{2}\to\Omega_{\mathcal{U}} is extremely dense (Lemma 2.22) and an extremely dense map into a ¬¬\neg\neg-separated type is right-cancellable (Lemma 2.21), while 𝟐\mathbf{2} is ¬¬\neg\neg-separated, being discrete. Applying this to pp and the map constantly 11 gives p​P=1p\,P=1 for every PP.

For ℕ∞\mathbb{N}_{\infty}, see [15] or the companion formalization file [19]. ∎

4.3. Closure properties of compact types

Theorem 4.8.
  1. (1)

    The types 𝟎\mathbf{0} and 𝟏\mathbf{1} are compact, and so is every singleton.

  2. (2)

    If XX and YY are compact, so is X+YX+Y.

  3. (3)

    If XX is compact and Y​xY\,x is compact for every x:Xx:X, then Σ​Y\Sigma\,Y is compact. In particular, the product X×YX\times Y is compact when both XX and YY are.

  4. (4)

    If YY is a retract of XX and XX is compact, then so is YY. In particular, compactness is invariant under equivalence.

  5. (5)

    If f:X→Yf:X\to Y is a surjection and XX is compact, then so is YY, 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 AA on the type under consideration rather than a 𝟐\mathbf{2}-valued predicate, so that the task is to decide the sum of AA.

Items (2), (4) and (5) follow one pattern, which we record first. If f:X→Yf:X\to Y is a map and AA is a complemented family on YY, then the composite A∘fA\circ f is a complemented family on XX, and a point (x,a)(x,a) of Σ⁡(A∘f)\Sigma\,(A\circ f) gives the point (f​x,a)(f\,x,a) of Σ​A\Sigma A. So when XX is compact, the sum of A∘fA\circ f is decidable, and what remains is to show that Σ​A\Sigma A is empty in the case that Σ⁡(A∘f)\Sigma\,(A\circ f) is. This is where the hypothesis on ff is used.

(1) The types 𝟎\mathbf{0} and 𝟏\mathbf{1} are decidable propositions, and so is any singleton, so this is an instance of Lemma 4.3.

(2) Apply the pattern to the injections inl:X→X+Y\mathrm{inl}:X\to X+Y and inr:Y→X+Y\mathrm{inr}:Y\to X+Y, whose domains are compact by hypothesis. If either of Σ⁡(A∘inl)\Sigma\,(A\circ\mathrm{inl}) and Σ⁡(A∘inr)\Sigma\,(A\circ\mathrm{inr}) has a point, then so does Σ​A\Sigma A. If both are empty, then so is Σ​A\Sigma A, because every point of X+YX+Y is of the form inl​x\mathrm{inl}\,x or inr​y\mathrm{inr}\,y.

(3) For each x:Xx:X, the family y↦A⁡(x,y)y\mapsto A\,(x,y) on Y​xY\,x is complemented, and so the compactness of the fibers makes the family

Bx:≡Σy:Y​xA(x,y)B\,x\;:\equiv\;\textstyle\Sigma_{y:Y\,x}\,A\,(x,y)

on XX complemented. The compactness of XX then decides the sum of BB, which is the sum of AA up to reassociation, and decidability is invariant under logical equivalence. Binary products are the case of a constant family YY.

(4) Apply the pattern to the retraction r:X→Yr:X\to Y, whose section s:Y→Xs:Y\to X satisfies r⁡(s​y)=yr\,(s\,y)=y for every y:Yy:Y. A point (y,a)(y,a) of Σ​A\Sigma A gives the point (s​y,a′)(s\,y,a^{\prime}) of Σ⁡(A∘r)\Sigma\,(A\circ r), where a′a^{\prime} is obtained from aa by transport along r⁡(s​y)=yr\,(s\,y)=y, and so Σ​A\Sigma A is empty when Σ⁡(A∘r)\Sigma\,(A\circ r) is. An equivalence is in particular a retraction.

(5) Apply the pattern to the surjection ff. If Σ⁡(A∘f)\Sigma\,(A\circ f) is empty, then ¬A⁡(f​x)\neg\,A\,(f\,x) holds for every x:Xx:X, and hence ¬A​y\neg\,A\,y holds for every y:Yy:Y by surjection induction (Definition 2.9), which is available because negations are propositions. Therefore Σ​A\Sigma A is empty. The image of a map gg out of a compact type is covered by applying this to the corestriction of gg, which is a surjection. ∎

Proposition 4.9.

If XX is compact, then so is its totally separated reflection 𝕋​X\mathbb{T}\,X constructed in Theorem 3.15.

Proof.

The reflector η𝕋\eta^{\mathbb{T}} 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. (1)

    retracts, and hence equivalence ,

  2. (2)

    sums, and hence binary products and coproducts ,

  3. (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 X→YX\to Y sends a point of XX to a point of YY, and an equivalence is in particular a retraction.

(2) A point xx of the base together with a point of the fiber Y​xY\,x is a point of Σ​Y\Sigma\,Y. Binary products are the case of a constant family. Binary coproducts are compact by Theorem 4.8(2), and a point xx of X0X_{0} gives the point inl​x\mathrm{inl}\,x of X0+X1X_{0}+X_{1}.

(3) A surjection X→YX\to Y sends a point of XX to a point of YY. ∎

Proposition 4.11.

Let XX be a compact type.

  1. (1)

    If AA is a complemented, proposition valued family on XX, then the subtype Σx:XAx\Sigma_{x:X}\,A\,x is compact.

  2. (2)

    If AA and BB are families on XX and ∏x:X(Ax+Bx)\prod_{x:X}\,(A\,x+B\,x) holds, then we can decide between Σx:XAx\Sigma_{x:X}\,A\,x and ∏x:XBx\prod_{x:X}\,B\,x.

  3. (3)

    If AA is a complemented family on XX and Σx:XAx\Sigma_{x:X}\,A\,x is non-empty, then it is pointed.

Proof.

(1) Let BB be a complemented family on the subtype Σx:XAx\Sigma_{x:X}\,A\,x, so that what has to be decided is the sum of BB. The family

Cx:≡Σa:A​xB(x,a)C\,x\;:\equiv\;\textstyle\Sigma_{a:A\,x}\,B\,(x,a)

on XX is complemented. Indeed, decide A​xA\,x. If A​xA\,x is empty then so is C​xC\,x. If a:A​xa:A\,x, decide B⁡(x,a)B\,(x,a). A point bb of B⁡(x,a)B\,(x,a) gives the point (a,b)(a,b) of C​xC\,x, and if B⁡(x,a)B\,(x,a) is empty then so is C​xC\,x, because A​xA\,x is a proposition, so that any a′:A​xa^{\prime}:A\,x is equal to aa and a point of B⁡(x,a′)B\,(x,a^{\prime}) transports to a point of B⁡(x,a)B\,(x,a). The compactness of XX now decides the sum of CC, which is the sum of BB up to reassociation.

(2) Write qq for the given point of ∏x:X(Ax+Bx)\prod_{x:X}\,(A\,x+B\,x) and let p:X→𝟐p:X\to\mathbf{2} be its indicator, with p​x=0p\,x=0 when q​xq\,x lands in A​xA\,x and p​x=1p\,x=1 when it lands in B​xB\,x. The compactness of XX decides whether pp has a root. A root xx comes with a point of A​xA\,x, and so gives a point of Σx:XAx\Sigma_{x:X}\,A\,x. If there is no root, then p​x=1p\,x=1, and hence B​xB\,x, for every xx.

(3) The compactness of XX decides the sum of AA, and a decidable type is ¬¬\neg\neg-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 𝟐ℕ\mathbf{2}^{\mathbb{N}}, the countable product of copies of 𝟐\mathbf{2}, 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. ∃\exists-compactness and Π\Pi-compactness

Proposition 4.13.
  1. (1)

    Each of ∃\exists-compactness and Π\Pi-compactness is a proposition.

  2. (2)

    Any compact type is ∃\exists-compact.

  3. (3)

    Any ∃\exists-compact type is Π\Pi-compact.

  4. (4)

    If XX is ∃\exists-compact then ∃x:Xpx=0\exists_{x:X}\,p\,x=0 is ¬¬\neg\neg-stable.

  5. (5)

    A type XX is Π\Pi-compact if and only if the constant map λ​x​. 1\lambda x.\,1 is isolated in 𝟐X\mathbf{2}^{X}.

  6. (6)

    A type XX is ∃\exists-compact, respectively Π\Pi-compact, if and only if its totally separated reflection 𝕋​X\mathbb{T}\,X constructed in Theorem 3.15 is.

Proof.

(1) For each pp, the types ∃xp​x=0\exists_{x}p\,x=0 and ∏xp​x=1\prod_{x}p\,x=1 are propositions, and so is the decidability of a proposition.

(2) Compactness gives, for each predicate pp, either a root, whose truncation gives ∃xp​x=0\exists_{x}p\,x=0, or a proof that pp is constantly 11, which refutes it.

(3) Decide ∃xp​x=0\exists_{x}p\,x=0. In the positive case, ∏xp​x=1\prod_{x}p\,x=1 is refuted, because a root of pp contradicts it, and this conclusion, being a negation, may be drawn from the truncated existence. In the negative case, no xx has p​x=0p\,x=0, and hence p​x=1p\,x=1 for every xx, as 𝟐\mathbf{2} has only two points.

(4) The proposition ∃xp​x=0\exists_{x}p\,x=0 is decidable, and hence ¬¬\neg\neg-elimination is applicable to get ¬¬\neg\neg-stability.

(5) The Π\Pi-compactness of XX says that ∏xp​x=1\prod_{x}p\,x=1 is decidable for every pp, while the isolatedness of λ​x​. 1\lambda x.\,1 says that p=λ​x​. 1p=\lambda x.\,1 is decidable for every pp. The type ∏xp​x=1\prod_{x}p\,x=1 is pointwise equality of pp with the constant map, so the two types are equivalent and decidability is invariant under logical equivalence.

(6) Let qq and p=q∘η𝕋p=q\circ\eta^{\mathbb{T}} be corresponding predicates on 𝕋​X\mathbb{T}\,X and on XX, using Theorem 3.15(2) with A=𝟐A=\mathbf{2}. Decidability transfers along a logical equivalence, so it is enough to prove

∃x:Xpx=0⇔∃y:𝕋​Xqy=0,∏x:Xpx=1⇔∏y:𝕋​Xqy=1.\exists_{x:X}\,p\,x=0\iff\exists_{y:\mathbb{T}\,X}\,q\,y=0,\qquad\prod_{x:X}\,p\,x=1\iff\prod_{y:\mathbb{T}\,X}\,q\,y=1.

A root xx of pp gives the root η𝕋​x\eta^{\mathbb{T}}\,x of qq. Conversely, the reflector is a surjection, so a root of qq has a preimage in an unspecified way, and any such preimage is a root of pp. If q​y=1q\,y=1 for every yy, then p​x=1p\,x=1 for every xx by composition with the reflector. Conversely, if p​x=1p\,x=1 for every xx, then q​y=1q\,y=1 for every yy 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. (1)

    Both ∃\exists-compactness and Π\Pi-compactness pass to surjective images, and hence to retracts.

  2. (2)

    If XX is Π\Pi-compact and Y​xY\,x is Π\Pi-compact for every x:Xx:X, then the sum Σ​Y\Sigma\,Y is Π\Pi-compact.

  3. (3)

    Both notions pass to complemented subtypes.

Proof.

(1) Let f:X→Yf:X\to Y be a surjection and let q:Y→𝟐q:Y\to\mathbf{2}, and apply the compactness hypothesis on XX to the predicate q∘fq\circ f.

For ∃\exists-compactness, a root of q∘fq\circ f gives a root of qq, and so the truncated existence of the former gives that of the latter. If q∘fq\circ f has no root, then neither has qq, because a root of qq has a preimage under ff in an unspecified way, and that preimage is a root of q∘fq\circ f. This conclusion, being a negation, may be drawn from the truncated existence.

For Π\Pi-compactness, if q⁡(f​x)=1q\,(f\,x)=1 for every x:Xx:X, then q​y=1q\,y=1 for every y:Yy:Y by surjection induction along ff, the equations being propositions, and conversely by composition with ff. 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 p:Σ​Y→𝟐p:\Sigma\,Y\to\mathbf{2}. For each x:Xx:X, the Π\Pi-compactness of the fiber Y​xY\,x decides ∏yp⁡(x,y)=1\prod_{y}p\,(x,y)=1, and so there is a predicate q:X→𝟐q:X\to\mathbf{2} with q​x=1q\,x=1 if and only if ∏yp⁡(x,y)=1\prod_{y}p\,(x,y)=1. The Π\Pi-compactness of XX decides ∏xq​x=1\prod_{x}q\,x=1, which is logically equivalent to ∏x∏yp⁡(x,y)=1\prod_{x}\prod_{y}p\,(x,y)=1, and this is ∏(x,y)p⁡(x,y)=1\prod_{(x,y)}p\,(x,y)=1 after currying.

(3) Let SS be a complemented subset of XX, with subtype Σx:Xx∈S\Sigma_{x:X}\,x\in S.

If XX is ∃\exists-compact, apply ∃\exists-compactness to the characteristic function of SS, which decides whether the subtype is inhabited. If it is not, then the subtype is empty, and an empty type is ∃\exists-compact. If it is, then a point of the subtype makes it a retract of XX, the points outside SS being sent to that point, and so the subtype is ∃\exists-compact by (1). This conclusion may be drawn from the inhabitedness of the subtype, because ∃\exists-compactness is a proposition (Proposition 4.13(1)).

If XX is Π\Pi-compact, a predicate on the subtype extends to a predicate on XX that takes the value 11 outside SS, and the extension is constantly 11 if and only if the given predicate is. So the Π\Pi-compactness of XX decides whether the extension is constantly 11, and hence whether the given predicate is. ∎

Proposition 4.15.
  1. (1)

    A proposition is ∃\exists-compact if and only if it is decidable.

  2. (2)

    The truncation ‖X‖\|X\| of an ∃\exists-compact type XX is decidable.

  3. (3)

    A non-empty ∃\exists-compact type is inhabited.

  4. (4)

    A Π\Pi-compact type has decidable negation.

Proof.

(1) and (2) Apply ∃\exists-compactness to the constantly 00 predicate. Every point of XX is a root of it, so that what is decided is the truncation ‖X‖\|X\|, which gives (2). When XX is a proposition, the truncation is equivalent to XX, and so an ∃\exists-compact proposition is decidable. Conversely, a decidable proposition is ∃\exists-compact, by the argument of Lemma 4.3 with ∃\exists in place of Σ\Sigma.

(3) The truncation ‖X‖\|X\| is decidable by (2). Its negation is logically equivalent to ¬X\neg X, which is ruled out by the non-emptiness of XX, and so the truncation holds, which says that XX is inhabited.

(4) Apply Π\Pi-compactness to the constantly 00 predicate. What is decided is ∏x0=1\prod_{x}0=1, which is logically equivalent to ¬X\neg X, because the type 0=10=1 is empty. ∎

The following truncated form of Lemma 4.6(2), being a product of propositions, is a proposition.

Proposition 4.16.

The following are equivalent for any type XX.

  1. (1)

    XX is ∃\exists-compact and inhabited.

  2. (2)

    Every p:𝟐Xp:\mathbf{2}^{X} has a universal witness in an unspecified way:

    ∏p:𝟐X∃x0:X(px0=1→∀x.px=1).\textstyle\prod_{p:\mathbf{2}^{X}}\,\exists_{x_{0}:X}\,\big(p\,x_{0}=1\to\forall x.\,p\,x=1\big).

Moreover, the type XX is ∃\exists-compact if and only if it is empty or satisfies (2).

Proof.

(2) implies (1). Taking pp constantly 00 gives a point of XX in an unspecified way, so that XX is inhabited. For ∃\exists-compactness, let p:X→𝟐p:X\to\mathbf{2} and let x0x_{0} be a universal witness for pp, available in an unspecified way. Deciding the value of p​x0p\,x_{0} either produces a root of pp or shows that pp is constantly 11, and so decides ∃xp​x=0\exists_{x}p\,x=0. This decision may be made under the truncation, because the decidability of a proposition is a proposition.

(1) implies (2). Let p:X→𝟐p:X\to\mathbf{2}. By ∃\exists-compactness, either pp has a root in an unspecified way, and that root is a universal witness, the implication holding vacuously, or pp is constantly 11, and then any point of XX is a universal witness, one being available in an unspecified way from the inhabitedness of XX.

The final claim. An ∃\exists-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 ∃\exists-compact by that equivalence, and so is an empty type, no predicate on it having a root. ∎

Proposition 4.17.

A type XX is Π\Pi-compact if and only if every p:X→𝟐p:X\to\mathbf{2} has an infimum, that is, a greatest n:𝟐n:\mathbf{2} such that n≤p​xn\leq p\,x for every x:Xx:X.

Proof.

Let XX be Π\Pi-compact and let p:X→𝟐p:X\to\mathbf{2}. Decide whether pp is constantly 11. If it is, then 11 is a lower bound of its values, and it is the greatest element of 𝟐\mathbf{2}, so that it is the infimum. If it is not, then 00 is a lower bound, being the least element of 𝟐\mathbf{2}, and 11 is not a lower bound, as that would make pp constantly 11, so that 00 is the infimum.

Conversely, suppose that every p:X→𝟐p:X\to\mathbf{2} has an infimum, and consider the two possible values of infp\inf p. If it is 11, then 1≤p​x1\leq p\,x, and hence p​x=1p\,x=1, for every xx. If it is 00, then pp is not constantly 11, because that would make 11 a lower bound of its values and so force 1≤infp1\leq\inf p. ∎

The infimum operator sends pp to a boolean infp\inf p that is 11 precisely when pp has value 11 everywhere, so that it defines a boolean universal quantifier 𝖠:𝟐X→𝟐\mathsf{A}:\mathbf{2}^{X}\to\mathbf{2} with 𝖠​p=infp\mathsf{A}\,p=\inf p. This is compactness in the sense of synthetic topology with dominance 𝟐\mathbf{2}. In fact, writing 𝖪:𝟐→𝟐X\mathsf{K}:\mathbf{2}\to\mathbf{2}^{X} for the map sending a boolean to the constant predicate at it, an infimum operator is precisely an order theoretic right adjoint 𝖠\mathsf{A} to 𝖪\mathsf{K}, since the adjunction says that 𝖪​n≤p\mathsf{K}\,n\leq p pointwise if and only if n≤𝖠​pn\leq\mathsf{A}\,p, which is to say that 𝖠​p\mathsf{A}\,p is the greatest lower bound of the values of pp.

In classical topology a space XX is compact if and only if every projection Y×X→YY\times X\to Y 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 XX is ∃\exists-compact if and only if every projection Y×X→YY\times X\to Y is a clopen map.

Proof.

Let XX be ∃\exists-compact, let p:Y×X→𝟐p:Y\times X\to\mathbf{2} be the characteristic function of a complemented subset, and let y:Yy:Y. Membership of yy in the image of that subset along the projection amounts to ∃x:Xp(y,x)=0\exists_{x:X}\,p\,(y,x)=0, which ∃\exists-compactness decides.

Conversely, take YY to be the one-element type and let p:X→𝟐p:X\to\mathbf{2}. Consider the subset of 𝟏×X\mathbf{1}\times X with characteristic function p∘pr2p\circ\mathrm{pr}_{2}. Membership of the point of 𝟏\mathbf{1} in the image of that subset along the projection 𝟏×X→𝟏\mathbf{1}\times X\to\mathbf{1} amounts to ∃x:Xpx=0\exists_{x:X}\,p\,x=0, so that the clopenness of this single projection gives the ∃\exists-compactness of XX. ∎

4.5. Interplay between the notions

We collect results that combine compactness, discreteness and total separatedness.

Lemma 4.19.

If Y​xY\,x is compact for every x:Xx:X and the point (x,y)(x,y) of Σ​Y\Sigma\,Y is isolated, then xx is isolated.

Proof.

Let x′:Xx^{\prime}:X, so that what has to be decided is x=x′x=x^{\prime}. The family

A​y′:≡((x,y)=(x′,y′))A\,y^{\prime}:\equiv\big((x,y)=(x^{\prime},y^{\prime})\big)

on Y​x′Y\,x^{\prime} is complemented, because (x,y)(x,y) is isolated, and so the compactness of Y​x′Y\,x^{\prime} decides the sum of AA. If some y′y^{\prime} has (x,y)=(x′,y′)(x,y)=(x^{\prime},y^{\prime}), then x=x′x=x^{\prime} by taking first components. If none does, then x≠x′x\neq x^{\prime}, because an identification x=x′x=x^{\prime} would give such a y′y^{\prime} by transporting yy along it. ∎

Proposition 4.20.
  1. (1)

    If XX is Π\Pi-compact and Y​xY\,x is discrete for every x:Xx:X, then ∏xY​x\prod_{x}Y\,x is discrete.

  2. (2)

    If XX is compact, the discreteness of ∏xY​x\prod_{x}Y\,x can be strengthened to (Σx:Xfx≠gx)+(f=g)\big(\Sigma_{x:X}\,f\,x\neq g\,x\big)+\big(f=g\big) for all f,g:∏xY​xf,g:\prod_{x}Y\,x.

Proof.

Given f,g:∏xY​xf,g:\prod_{x}Y\,x, the discreteness of each Y​xY\,x decides f​x=g​xf\,x=g\,x, so there is an indicator p:X→𝟐p:X\to\mathbf{2} with p​x=0p\,x=0 if f​x≠g​xf\,x\neq g\,x and p​x=1p\,x=1 otherwise.

(1) Π\Pi-compactness decides whether p​x=1p\,x=1 for every xx, which amounts to deciding f=gf=g, by function extensionality.

(2) Compactness decides whether pp has a root, and a root of pp is a point xx with f​x≠g​xf\,x\neq g\,x, and the absence of one gives f​x=g​xf\,x=g\,x everywhere, and hence f=gf=g. ∎

Example 4.21.

The principle WLPO\mathrm{WLPO}, the Π\Pi-compactness of ℕ\mathbb{N} (Examples 4.5(4)), gives the discreteness of the Cantor type 𝟐ℕ\mathbf{2}^{\mathbb{N}} by Proposition 4.20(1). Together with Examples 3.13(3), this makes the discreteness of 𝟐ℕ\mathbf{2}^{\mathbb{N}} equivalent to WLPO\mathrm{WLPO}.

Definition 4.22 (Disconnectedness).

A type XX is disconnected if 𝟐\mathbf{2} is a retract of it, or, equivalently, if some p:X→𝟐p:X\to\mathbf{2} takes both values.

Proposition 4.20 has a partial converse.

Proposition 4.23.

If YY is disconnected and YXY^{X} is discrete, then XX is Π\Pi-compact.

Proof.

Take first Y=𝟐Y=\mathbf{2}. The Π\Pi-compactness of XX is the isolatedness of the constant map λ​x​. 1\lambda x.\,1 in 𝟐X\mathbf{2}^{X} (Proposition 4.13(5)), and in a discrete type every point is isolated. A disconnected YY comes with a retraction onto 𝟐\mathbf{2}, and composing with it and with its section makes 𝟐X\mathbf{2}^{X} a retract of YXY^{X}, and discreteness passes to retracts (Proposition 3.6(2)). ∎

Proposition 4.24.

Let YY be disconnected.

  1. (1)

    If XX is totally separated and YXY^{X} is Π\Pi-compact, then XX is discrete.

  2. (2)

    For arbitrary XX, if YXY^{X} is Π\Pi-compact, then the totally separated reflection 𝕋​X\mathbb{T}\,X of Theorem 3.15 is discrete.

Proof.

(1) Take first Y=𝟐Y=\mathbf{2}, and let x,y:Xx,y:X. Since 𝟐\mathbf{2} is discrete, there is a map q:𝟐X→𝟐q:\mathbf{2}^{X}\to\mathbf{2} with q​p=1q\,p=1 when p​x=p​yp\,x=p\,y and q​p=0q\,p=0 when the two values differ. Applying the Π\Pi-compactness of 𝟐X\mathbf{2}^{X} to qq decides ∏pq​p=1\prod_{p}q\,p=1, which says that xx and yy agree at every 𝟐\mathbf{2}-valued predicate, that is, that x=2yx=_{2}y. If x=2yx=_{2}y, then x=yx=y by total separatedness, and if not, then x≠yx\neq y, because x=yx=y would give p​x=p​yp\,x=p\,y for every pp. So XX is discrete.

For a disconnected YY, a retraction of YY onto 𝟐\mathbf{2} makes 𝟐X\mathbf{2}^{X} a retract of YXY^{X}, and Π\Pi-compactness passes to retracts (Proposition 4.14(1)), so that the case just proved applies.

(2) A retraction of YY onto 𝟐\mathbf{2} makes 𝟐X\mathbf{2}^{X} a retract of YXY^{X}, as in (1), and 𝟐𝕋​X\mathbf{2}^{\mathbb{T}\,X} is equivalent to 𝟐X\mathbf{2}^{X} because XX and 𝕋​X\mathbb{T}\,X have the same 𝟐\mathbf{2}-valued predicates (Theorem 3.15(2) with A=𝟐A=\mathbf{2}). So 𝟐𝕋​X\mathbf{2}^{\mathbb{T}\,X} is a retract of YXY^{X} and hence Π\Pi-compact (Proposition 4.14(1)). Now apply (1) to 𝕋​X\mathbb{T}\,X, 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. (1)

    A Π\Pi-compact simple type (Examples 3.13(2)) gives WLPO\mathrm{WLPO}.

  2. (2)

    The Π\Pi-compactness of 𝟐ℕ∞\mathbf{2}^{\mathbb{N}_{\infty}} gives WLPO\mathrm{WLPO}.

Proof.

(1) The type ℕ\mathbb{N} is a retract of every simple type (Examples 3.13(2)), and Π\Pi-compactness is inherited by retracts (Proposition 4.14 (1)), so ℕ\mathbb{N} is Π\Pi-compact, which is WLPO\mathrm{WLPO} (Examples 4.5(4)).

(2) The type ℕ∞\mathbb{N}_{\infty} is totally separated, being a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (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 Π\Pi-compactness of 𝟐ℕ∞\mathbf{2}^{\mathbb{N}_{\infty}} into the discreteness of ℕ∞\mathbb{N}_{\infty}, which is WLPO\mathrm{WLPO} (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 XX is a proposition and Y​xY\,x is compact pointed for every x:Xx:X, then ∏xY​x\prod_{x}Y\,x is compact pointed.

Proof.

Let XX be a proposition, let εx\varepsilon_{x} be a selection function witnessing that Y​xY\,x is compact pointed for each x:Xx:X, and let p:∏xY​x→𝟐p:\prod_{x}Y\,x\to\mathbf{2}. For each x:Xx:X, evaluation at xx,

fx:∏x′Y​x′→Y​x,fx​φ=φ​x,f_{x}:\textstyle\prod_{x^{\prime}}Y\,x^{\prime}\to Y\,x,\qquad f_{x}\,\varphi=\varphi\,x,

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 qx​y=p⁡(fx−1​y)q_{x}\,y=p\,(f_{x}^{-1}\,y), and define the candidate witness pointwise:

φ0​x=εx​qx.\varphi_{0}\,x\;=\;\varepsilon_{x}\,q_{x}.

We claim φ0\varphi_{0} is a universal witness for pp. So assume p​φ0=1p\,\varphi_{0}=1, and we must show p​φ=1p\,\varphi=1 for an arbitrary φ\varphi.

(1) The conclusion follows from XX. Suppose x:Xx:X. The universality of φ0​x\varphi_{0}\,x for qxq_{x} says that p⁡(fx−1​(φ0​x))=1p\,(f_{x}^{-1}(\varphi_{0}\,x))=1 implies p⁡(fx−1​y)=1p\,(f_{x}^{-1}\,y)=1 for every y:Y​xy:Y\,x. Since fx​φ0=φ0​xf_{x}\,\varphi_{0}=\varphi_{0}\,x and fx−1f_{x}^{-1} is a section of fxf_{x}, the hypothesis is our assumption p​φ0=1p\,\varphi_{0}=1. Instantiating y=φ​xy=\varphi\,x and using fx−1​(φ​x)=φf_{x}^{-1}(\varphi\,x)=\varphi, we get p​φ=1p\,\varphi=1. This conclusion no longer mentions the point xx, so that X→p​φ=1X\to p\,\varphi=1.

(2) The conclusion also follows from ¬X\neg X. If XX is empty then any two points of ∏xY​x\prod_{x}Y\,x are equal, in particular φ=φ0\varphi=\varphi_{0}, and so p​φ=p​φ0=1p\,\varphi=p\,\varphi_{0}=1.

(3) Combining (1) and (2). Excluded middle, if it were available, would now finish the argument, since XX is a proposition, but it is not needed. Suppose p​φ=0p\,\varphi=0. Then p​φ≠1p\,\varphi\neq 1, so contraposing (1) gives ¬X\neg X, and then (2) gives p​φ=1p\,\varphi=1. Thus p​φ=0p\,\varphi=0 implies p​φ=1p\,\varphi=1. The value of p​φp\,\varphi is 00 or 11, and in the first case it is also 11, so p​φ=1p\,\varphi=1. ∎

Specializing to a constant family, this says that YXY^{X} is compact pointed for any proposition XX and any type YY such that the pointedness of XX implies the compact pointedness of YY, whether or not XX holds.

Example 4.27.

The function type ℕLPO\mathbb{N}^{\mathrm{LPO}} is compact pointed. Indeed LPO\mathrm{LPO} is a proposition that implies the compact pointedness of ℕ\mathbb{N}, so Theorem 4.26 applies. The exponential is compact whether or not LPO\mathrm{LPO} holds, even though the compactness of ℕ\mathbb{N} is LPO\mathrm{LPO} itself, which is independent of our type theory (Examples 4.5(2)).

Remark 4.28.
  1. (1)

    The proof of Theorem 4.26 does not go through the equivalence ∏xY​x≃Y​x0\prod_{x}Y\,x\simeq Y\,x_{0}, which holds once a point x0:Xx_{0}:X is given and would transfer compact pointedness directly. Such a point is at hand only under the hypothesis that XX holds, whereas the universal witness has to be produced without deciding XX.

  2. (2)

    The pointedness hypothesis is essential, since the corresponding statement for plain compactness fails constructively. Indeed, take Y​x:≡𝟎Y\,x:\equiv\mathbf{0}, which is compact but not pointed. Then ∏xY​x\prod_{x}Y\,x is ¬X\neg X, so the unpointed statement would make ¬X\neg X compact, and hence decidable (Lemma 4.3), for every proposition XX, which is the principle of weak excluded middle. Pointedness enters the proof of Theorem 4.26 in the definition of φ0\varphi_{0}, which has to be a point of ∏xY​x\prod_{x}Y\,x whether or not XX 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 FF be a finite type and j:X↪Fj:X\hookrightarrow F an embedding. If the type Y​xY\,x is compact pointed for every x:Xx:X, then so is ∏xY​x\prod_{x}Y\,x.

Proof.

The embedding decomposes XX as the sum of its fibers, and currying the product over that sum gives

∏x:XYx≃∏i:F∏w:j−1​(i)Y(pr1w).\textstyle\prod_{x:X}Y\,x\;\simeq\;\prod_{i:F}\ \prod_{w:j^{-1}(i)}Y\,(\mathrm{pr}_{1}w).

Each fiber is a proposition, jj 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 ℕ∞\mathbb{N}_{\infty}. 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 (Π\Pi-extension).

Let Y:X→𝒰Y:X\to\mathcal{U} be a family of types and j:X→Kj:X\to K an arbitrary map. The Π\Pi-extension of YY along jj is the family Y/j:K→𝒰Y\mathbin{/}j:K\to\mathcal{U} given by

(Y/j)k:≡∏(x,p):j−1​(k)Yx,(Y\mathbin{/}j)\,k\;:\equiv\;\prod_{(x,p)\,:\,j^{-1}(k)}Y\,x,

where j−1(k):≡Σx:X(jx=k)j^{-1}(k):\equiv\Sigma_{x:X}(j\,x=k) is the fiber of jj over kk.

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 ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} on the right, used in  Section 6:

X{\lx@inpgf@ignorespaces X}K{\lx@inpgf@ignorespaces K}𝒰{\lx@inpgf@ignorespaces\mathcal{U}}j\scriptstyle{\lx@inpgf@ignorespaces j}Y\scriptstyle{\lx@inpgf@ignorespaces Y}Y/j\scriptstyle{\lx@inpgf@ignorespaces Y\mathbin{/}j}  ℕ{\lx@inpgf@ignorespaces\mathbb{N}}ℕ∞{\lx@inpgf@ignorespaces\mathbb{N}_{\infty}}𝒰.{\lx@inpgf@ignorespaces\mathcal{U}.}ι\scriptstyle{\lx@inpgf@ignorespaces\iota}Y\scriptstyle{\lx@inpgf@ignorespaces Y}Y/ι\scriptstyle{\lx@inpgf@ignorespaces Y\mathbin{/}\iota}

The point of the above construction is that we can extend YY from ℕ\mathbb{N} to ℕ∞\mathbb{N}_{\infty} without checking whether the argument of the desired extension Y/ιY\mathbin{/}\iota is ∞\infty or not, which is not available in our constructive setting, as it amounts to WLPO\mathrm{WLPO} (Examples 3.3(5)).

Lemma 4.31.

Let Y:X→𝒰Y:X\to\mathcal{U} and j:X→Kj:X\to K.

  1. (1)

    If jj is an embedding, the Π\Pi-extension restricts back to YY along jj up to type equivalence: for every x:Xx:X we have (Y/j)​(j​x)≃Y​x(Y\mathbin{/}j)(j\,x)\simeq Y\,x.

  2. (2)

    If j​x≠kj\,x\neq k for every x:Xx:X, then (Y/j)​k≃𝟏(Y\mathbin{/}j)\,k\simeq\mathbf{1}.

Proof.

(1) If jj is an embedding then j−1​(j​x)j^{-1}(j\,x) is a proposition, and it contains the point (x,refl)(x,\mathrm{refl}), so it is a singleton. A product indexed by a singleton is equivalent to its value at the center, whence (Y/j)​(j​x)≃Y​x(Y\mathbin{/}j)(j\,x)\simeq Y\,x.

(2) If j​x≠kj\,x\neq k for every x:Xx:X then j−1​(k)j^{-1}(k) is empty, and a product indexed by the empty type is equivalent to the type 𝟏\mathbf{1}. ∎

We refer to the sum Σ⁡(Y/j)\Sigma(Y\mathbin{/}j) of the family as the extended sum of the family YY.

Theorem 4.32 (Compactness of extended sums).

For any embedding j:X→Kj:X\to K into a compact pointed type and any family Y:X→𝒰Y:X\to\mathcal{U} of compact pointed types, the extended sum Σ⁡(Y/j)\Sigma(Y\mathbin{/}j) is compact pointed.

Proof.

By the closure of pointed compactness under Σ\Sigma (Corollary 4.10(2)) applied to the family Y/jY\mathbin{/}j over the compact pointed base KK, it suffices to show that (Y/j)​k(Y\mathbin{/}j)\,k is compact pointed for every k:Kk:K. By definition this is the product of the types Y​xY\,x over the index type j−1​(k)j^{-1}(k), all of which are compact pointed by hypothesis, and j−1​(k)j^{-1}(k) is a proposition precisely because jj 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 Xn⊆𝟐ℕX_{n}\subseteq\mathbf{2}^{\mathbb{N}}, we rescaled XnX_{n} by prefixing the finite sequence 1n​01^{n}0, making the pieces disjoint, smaller in diameter, close together, and converging to the point ∞=1ω\infty=1^{\omega} as nn increases, and defined their squashed sum to be the set of those α\alpha such that if 1n​01^{n}0 is a prefix of α\alpha then α∈1n​0​Xn\alpha\in 1^{n}0X_{n}. This set is the closure of ⋃n1n​0​Xn\bigcup_{n}1^{n}0X_{n}, which classically is this union together with {∞}\{\infty\}. Constructively, it can be described as the union of the ℕ∞\mathbb{N}_{\infty}-indexed family

Yx={α∈𝟐ℕ∣∀n∈ℕ⁡(x=n⇒α∈1n​0​Xn)​ and ​(x=∞⇒α=∞)}.Y_{x}=\{\alpha\in\mathbf{2}^{\mathbb{N}}\mid\forall n\in\mathbb{N}\,(x=n\Rightarrow\alpha\in 1^{n}0X_{n})\text{ and }(x=\infty\Rightarrow\alpha=\infty)\}.

The defining formula for YxY_{x} corresponds to the Π\Pi-extension formula of Definition 4.30, for the family n↦1n​0​Xnn\mapsto 1^{n}0X_{n} along the embedding ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}. Thus, the extended sum generalizes the squashed sum to any embedding X↪KX\hookrightarrow K into a compact pointed type and any XX-indexed family of compact pointed types.

Lemma 4.34.

For any map j:X→Kj:X\to K, not necessarily an embedding, and any family Y:X→𝒰Y:X\to\mathcal{U} of totally separated types, the type (Y/j)​k(Y\mathbin{/}j)\,k is totally separated for every k:Kk:K.

Proof.

The type (Y/j)​k(Y\mathbin{/}j)\,k is the product of the types Y​xY\,x over the index type j−1​(k)j^{-1}(k), 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 j:X→Kj:X\to K and any families Y,Z:X→𝒰Y,Z:X\to\mathcal{U} such that Y​xY\,x is a retract of Z​xZ\,x for every x:Xx:X,

  1. (1)

    the type (Y/j)​k(Y\mathbin{/}j)\,k is a retract of (Z/j)​k(Z\mathbin{/}j)\,k for every k:Kk:K,

  2. (2)

    the extended sum Σ⁡(Y/j)\Sigma\,(Y\mathbin{/}j) is a retract of the extended sum Σ⁡(Z/j)\Sigma\,(Z\mathbin{/}j).

Proof.

(1) By Definition 4.30, the two types are products over the index type j−1​(k)j^{-1}(k), 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 KK and to the retractions of (1). ∎

Classically, every point of 𝟐ℕ\mathbf{2}^{\mathbb{N}} is of one of the forms 1n​0​α1^{n}0\alpha, with α:𝟐ℕ\alpha:\mathbf{2}^{\mathbb{N}}, or 1ω1^{\omega}. The following gives a constructive version of this.

Lemma 4.36 (Delayed binary sequences).
  1. (1)

    The extended sum of the constant family at 𝟐ℕ\mathbf{2}^{\mathbb{N}} along the embedding ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} is the type of delayed binary sequences, consisting of a time u:ℕ∞u:\mathbb{N}_{\infty} together with a binary sequence made available when uu is finite,

    Σu:ℕ∞(u is finite→𝟐ℕ).\textstyle\Sigma_{u\,:\,\mathbb{N}_{\infty}}\,\big(\text{$u$ is finite}\to\mathbf{2}^{\mathbb{N}}\big).
  2. (2)

    This type is equivalent to 𝟐ℕ\mathbf{2}^{\mathbb{N}}.

Proof.

(1) By Definition 4.30, the extension of the constant family at 𝟐ℕ\mathbf{2}^{\mathbb{N}} along the embedding ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} evaluates at a point u:ℕ∞u:\mathbb{N}_{\infty} to the type of functions from the fiber ι−1​(u)\iota^{-1}(u) to 𝟐ℕ\mathbf{2}^{\mathbb{N}}, so that the extended sum is the sum of these function types over u:ℕ∞u:\mathbb{N}_{\infty}. A point of the fiber is a natural number nn together with an identification n¯=u\underline{n}=u, which is what it means for uu to be finite (Example 3.1).

(2) In one direction, we define a map

Cons:(Σu:ℕ∞(u is finite→𝟐ℕ))→𝟐ℕ.\mathrm{Cons}\;:\;\big(\textstyle\Sigma_{u\,:\,\mathbb{N}_{\infty}}\,\big(\text{$u$ is finite}\to\mathbf{2}^{\mathbb{N}}\big)\big)\to\mathbf{2}^{\mathbb{N}}.

A delayed binary sequence is encoded as the run of 11s prescribed by its time, followed by a 00 and the delayed value. A conatural number is either 0¯\underline{0} or the result of prefixing a 11 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 𝟐ℕ\mathbf{2}^{\mathbb{N}} defines Cons\mathrm{Cons} by the two clauses: the sequence Cons⁡(0¯,π)\mathrm{Cons}(\underline{0},\pi) begins with 00 and continues as π\pi applied to the witness that 0¯\underline{0} is finite, and, for uu prefixing a 11 to vv, the sequence Cons⁡(u,π)\mathrm{Cons}(u,\pi) begins with 11 and continues as Cons⁡(v,π′)\mathrm{Cons}(v,\pi^{\prime}), where π′\pi^{\prime} is π\pi composed with the passage from finiteness of vv to finiteness of uu.

In the other direction, we first define two maps

Head:𝟐ℕ→ℕ∞Tail:∏α:𝟐ℕ(Head​α is finite→𝟐ℕ)\begin{array}[]{lll}\mathrm{Head}&:&\mathbf{2}^{\mathbb{N}}\to\mathbb{N}_{\infty}\\ \mathrm{Tail}&:&\textstyle\prod_{\alpha:\mathbf{2}^{\mathbb{N}}}\,\big(\text{$\mathrm{Head}\,\alpha$ is finite}\to\mathbf{2}^{\mathbb{N}}\big)\end{array}

as follows. A binary sequence is turned into a delayed one by taking its initial run of 11s as the time and what follows as the delayed value. For a sequence α\alpha, let Head​α\mathrm{Head}\,\alpha be that initial run, read as a conatural number and defined by the final-coalgebra presentation of Example 3.1: it is 0¯\underline{0} when α\alpha begins with 00, and it prefixes a 11 to the head of the tail of α\alpha when α\alpha begins with 11. When Head​α\mathrm{Head}\,\alpha is finite, witnessed by n:ℕn:\mathbb{N} together with an identification pp of n¯\underline{n} with Head​α\mathrm{Head}\,\alpha, the delayed value is the suffix of α\alpha after that run,

Tail​α​(n,p)​k=α⁡(k+n+1).\mathrm{Tail}\,\alpha\,(n,p)\,k\;=\;\alpha\,(k{+}n{+}1).

The two together give the map

Cons−1​α=(Head​α,Tail​α)\mathrm{Cons}^{-1}\,\alpha=(\mathrm{Head}\,\alpha,\mathrm{Tail}\,\alpha)

from 𝟐ℕ\mathbf{2}^{\mathbb{N}} to the type of delayed binary sequences.

The composite Cons−1∘Cons\mathrm{Cons}^{-1}\circ\mathrm{Cons} is the identity. Its first component asks for Head⁡(Cons⁡(u,π))=u\mathrm{Head}(\mathrm{Cons}(u,\pi))=u, which holds for u=n¯u=\underline{n} by induction on nn from the two clauses, and for u=∞u=\infty because Cons⁡(∞,π)\mathrm{Cons}(\infty,\pi) begins with 11 and continues as Cons⁡(∞,π′)\mathrm{Cons}(\infty,\pi^{\prime}), so that Head⁡(Cons⁡(∞,π))\mathrm{Head}(\mathrm{Cons}(\infty,\pi)) is a fixed point of prefixing a 11, and ∞\infty is the unique such point. This proves the two cases u=n¯u=\underline{n} and u=∞u=\infty. These suffice by Lemma 2.21, applied to the two functions of u:ℕ∞u:\mathbb{N}_{\infty} that send π\pi to Head⁡(Cons⁡(u,π))\mathrm{Head}(\mathrm{Cons}(u,\pi)) and to uu, because the map ℕ+𝟏→ℕ∞\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} is extremely dense (Examples 3.3(6)) and the values of the two functions at uu lie in a ¬¬\neg\neg-separated type. That type is the type of functions from finiteness of uu to ℕ∞\mathbb{N}_{\infty}, which is totally separated, since ℕ∞\mathbb{N}_{\infty} is, being a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (Example 3.1, Examples 3.13(3), Proposition 3.12(1, 4)), and totally separated types are ¬¬\neg\neg-separated (Lemma 3.9(2)). The second component asks that Tail⁡(Cons⁡(u,π))\mathrm{Tail}(\mathrm{Cons}(u,\pi)), transported along the identification just established, be π\pi, and this follows from the two clauses by cases on the finiteness witness, the case of a positive witness using that Cons⁡(n+1¯,π)\mathrm{Cons}(\underline{n{+}1},\pi) is π\pi applied to the witness of finiteness of n+1¯\underline{n{+}1} once its first n+1n{+}1 digits are removed.

The composite Cons∘Cons−1\mathrm{Cons}\circ\mathrm{Cons}^{-1} is the identity as well. When α\alpha begins with 00, the head of α\alpha is 0¯\underline{0}, and the first clause gives Cons⁡(Cons−1​α)=α\mathrm{Cons}(\mathrm{Cons}^{-1}\,\alpha)=\alpha, because the finiteness witness obtained by transporting along Head​α=0¯\mathrm{Head}\,\alpha=\underline{0} has size 00, which makes Tail​α\mathrm{Tail}\,\alpha at that witness the tail of α\alpha. When α\alpha begins with 11, the head of α\alpha prefixes a 11 to the head of the tail of α\alpha, and the second clause gives that Cons⁡(Cons−1​α)\mathrm{Cons}(\mathrm{Cons}^{-1}\,\alpha) begins with 11 and continues as Cons(Cons−1(the tail of α))\mathrm{Cons}(\mathrm{Cons}^{-1}(\text{the tail of $\alpha$})), the transported witness again having the size that makes Tail​α\mathrm{Tail}\,\alpha agree with Tail\mathrm{Tail} of the tail of α\alpha. Induction on the digit index, with α\alpha generalized, settles all digits: the first case does so at one stroke, and the second reduces the digit of index k+1k{+}1 to the digit of index kk of the tail. The two composites being the identity, the map Cons\mathrm{Cons} is an equivalence. ∎

Remark 4.37.

Notice that, more generally, for any type XX, the extended sum of the constant family at XX along the embedding ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} is the type Σu:ℕ∞(u is finite→X).\textstyle\Sigma_{u\,:\,\mathbb{N}_{\infty}}\,\big(\text{$u$ is finite}\to X\big). This type satisfies the universal property of the delay monad [5], and, moreover, 𝟐ℕ\mathbf{2}^{\mathbb{N}} 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 ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} of an arbitrary countable family X:ℕ→𝒰X:\mathbb{N}\to\mathcal{U} generalizes the delay monad, the type X​nX\,n of the result being allowed to depend on the time u=n¯u=\underline{n} 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 <{\mathrel{<}} be a binary relation on a type XX. We say that an element x:Xx:X is accessible whenever every y<xy\mathrel{<}x 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

∏x:X(∏y:X(y<x→y is accessible))→x is accessible,\textstyle\prod_{x:X}\big(\textstyle\prod_{y:X}(y\mathrel{<}x\to\text{$y$ is accessible})\big)\to\text{$x$ is accessible},

which we leave unnamed. We say that the relation <{\mathrel{<}} is well-founded if every element is accessible.

Lemma 5.1.

A binary relation <{\mathrel{<}} on a type XX is well-founded if and only if the principle of transfinite induction holds: for every family P:X→𝒰P:X\to\mathcal{U},

(∏x:X(∏y:Xy<x→Py)→Px)→∏x:XPx.\big(\textstyle\prod_{x:X}\big(\textstyle\prod_{y:X}y\mathrel{<}x\to P\,y\big)\to P\,x\big)\to\textstyle\prod_{x:X}P\,x.
Proof.

The accessibility elimination rule turns a step

(∏y:X(y<x→Py))→Px\big(\textstyle\prod_{y:X}(y\mathrel{<}x\to P\,y)\big)\to P\,x

into a witness of P​xP\,x for every accessible xx, so accessibility of every element gives transfinite induction for every family P:X→𝒰P:X\to\mathcal{U}. Conversely, the constructor of the accessibility predicate is a step for the family P=P={}accessibility, so transfinite induction applied to accessibility gives accessibility of every element. ∎

We say that the relation <{\mathrel{<}} is extensional if any two elements with the same predecessors are equal: (u<x↔u<y for all u)→x=y\big(u\mathrel{<}x\leftrightarrow u\mathrel{<}y\text{ for all }u\big)\to x=y. An ordinal is a type XX equipped with a proposition valued binary relation <:X→X→𝒰{\mathrel{<}}:X\to X\to\mathcal{U} which is transitive, well-founded and extensional. Such a relation is called a well-order on XX. We write Ord𝒰\mathrm{Ord}_{\mathcal{U}} for the type of ordinals with underlying type in 𝒰\mathcal{U}, where we omit the subscript when it can be inferred from the context. The HoTT Book additionally requires the type XX 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 <{\mathrel{<}} be a proposition valued extensional relation on a type XX. Consider the derived relation x≼y:≡∏z(z<x→z<y)x\preccurlyeq y:\equiv\prod_{z}(z\mathrel{<}x\to z\mathrel{<}y), that every predecessor of xx is a predecessor of yy. It is reflexive, and it is proposition valued because <\mathrel{<} is. Extensionality of <\mathrel{<} says exactly that it is antisymmetric, since x≼yx\preccurlyeq y and y≼xy\preccurlyeq x together say that xx and yy 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 x=yx=y, a weakly constant endofunction of x=yx=y: transport the reflexivity of ≼\preccurlyeq along the identification to get x≼yx\preccurlyeq y and y≼xy\preccurlyeq x, and apply antisymmetry, the constancy coming from ≼\preccurlyeq being proposition valued. So Hedberg’s Theorem 2.5 applies. ∎

Examples 5.3.
  1. (1)

    The type of natural numbers under its natural order is well-ordered, giving rise to an ordinal written ω\omega.

  2. (2)

    Any proposition ordered by the relation with empty graph is an ordinal, and in particular we get ordinals 𝟎\mathbf{0} and 𝟏\mathbf{1}.

  3. (3)

    The two-element type 𝟐\mathbf{2} ordered by 0<10\mathrel{<}1 is an ordinal.

  4. (4)

    The type Ω\Omega of propositions is an ordinal under the order p<qp\mathrel{<}q when p=⊥p=\bot and q=⊤q=\top.

Notation 5.4.

An ordinal is written with the symbol of its underlying type, so that x:αx:\alpha is a point of the underlying type of the ordinal α\alpha, a map α→β\alpha\to\beta 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 <{\mathrel{<}}, 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 Ord\mathrm{Ord}, and on the variants of it introduced later, names the universe of the underlying types, as it does on Ω𝒰\Omega_{\mathcal{U}}, and is left out where the context determines it.

By univalence, the type Ord\mathrm{Ord} is itself an ordinal in the next universe, under the relation

α<β:≡Σb:βα=β↓b,\alpha\mathrel{<}\beta\;:\equiv\;\Sigma_{b:\beta}\,\alpha=\beta\mathbin{\downarrow}b,

where β↓b\beta\mathbin{\downarrow}b is the initial segment (lower set, or downward closure) of β\beta at bb, which is again an ordinal, with the points of β\beta below bb as its underlying type and the order inherited from β\beta:

β↓b:≡Σy:βy<βb,(y,l)<(z,m):≡y<βz.\beta\mathbin{\downarrow}b\;:\equiv\;\textstyle\Sigma_{y:\beta}\,y\mathrel{<_{\beta}}b,\qquad(y,l)\mathrel{<}(z,m)\;:\equiv\;y\mathrel{<_{\beta}}z.

In particular, being well-ordered, Ord\mathrm{Ord} is a set by Lemma 5.2. Passing to initial segments preserves the order, in the sense that y<βy′y\mathrel{<_{\beta}}y^{\prime} implies β↓y<β↓y′\beta\mathbin{\downarrow}y\mathrel{<}\beta\mathbin{\downarrow}y^{\prime}. We also use the initial-segment embedding order

α≤β:≡Σf:α→βf is a simulation of α into β,\alpha\mathrel{\leq}\beta\;:\equiv\;\Sigma_{f:\alpha\to\beta}\,\text{$f$ is a simulation of $\alpha$ into $\beta$},

where a simulation of α\alpha into β\beta is a map f:α→βf:\alpha\to\beta that is order-preserving and initial-segment-preserving, the latter meaning that every point of β\beta below f​xf\,x is the image of a point of α\alpha below xx:

x<αy→fx<βfyandz<βfx→Σx′:α(x′<αx)×(fx′=z).x\mathrel{<_{\alpha}}y\to f\,x\mathrel{<_{\beta}}f\,y\qquad\text{and}\qquad z\mathrel{<_{\beta}}f\,x\to\textstyle\Sigma_{x^{\prime}:\alpha}\,(x^{\prime}\mathrel{<_{\alpha}}x)\times(f\,x^{\prime}=z).

The two conditions together say that ff maps the initial segment of xx onto the initial segment of f​xf\,x, and α<β\alpha\mathrel{<}\beta implies α≤β\alpha\mathrel{\leq}\beta, while α<β≤γ\alpha\mathrel{<}\beta\mathrel{\leq}\gamma implies α<γ\alpha\mathrel{<}\gamma. There is at most one simulation of α\alpha into β\beta, so that α≤β\alpha\mathrel{\leq}\beta is a proposition. Two ordinals α,β\alpha,\beta are order equivalent, written α≃oβ\alpha\simeq_{o}\beta, when there is an order-preserving equivalence α≃β\alpha\simeq\beta with order-preserving inverse. This relation is a proposition, as there is at most one such equivalence.

Lemma 5.5.

If f:α→βf:\alpha\to\beta is a surjective simulation, then ff 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 f​x=f​x′f\,x=f\,x^{\prime} and u<xu\mathrel{<}x. Order preservation gives f​u<f​x′f\,u\mathrel{<}f\,x^{\prime}, and initial-segment preservation gives v<x′v\mathrel{<}x^{\prime} with f​v=f​uf\,v=f\,u, so u=v<x′u=v\mathrel{<}x^{\prime} by the induction hypothesis. Symmetrically, every point below x′x^{\prime} is below xx, and extensionality identifies xx with x′x^{\prime}. 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 ff are propositions. Surjectivity makes them inhabited (Definition 2.9), and an inhabited proposition is a singleton, so ff is an equivalence (Definition 2.8).

The map ff is also order-reflecting. If f​x<f​yf\,x\mathrel{<}f\,y, then f​xf\,x lies in the initial segment of f​yf\,y, which initial-segment preservation identifies with the image of the initial segment of yy, so f​x=f​x′f\,x=f\,x^{\prime} for some x′<yx^{\prime}\mathrel{<}y, and left cancellability gives x=x′<yx=x^{\prime}\mathrel{<}y. The inverse of an order-preserving order-reflecting equivalence is order-preserving. ∎

5.2. Trichotomy

Definition 5.6 (Trichotomy).

An ordinal α\alpha is trichotomous if for all x,y:αx,y:\alpha we have x<yx\mathrel{<}y or x=yx=y or x>yx\mathrel{>}y. We write Ord3\mathrm{Ord}_{3} 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 x<yx\mathrel{<}y for all x,y:αx,y:\alpha, and a well-order whose order is decidable is trichotomous.

Conversely, let PP be a proposition with ¬¬⁡P\neg\neg P, and order the two-element type by

0<1:≡P,0<0:≡ 1<0:≡ 1<1:≡ 0.0\mathrel{<}1\;:\equiv\;P,\qquad 0\mathrel{<}0\;:\equiv\;1\mathrel{<}0\;:\equiv\;1\mathrel{<}1\;:\equiv\;\mathbf{0}.

This order is proposition valued, transitive and well-founded with no assumption on PP, and ¬¬⁡P\neg\neg P makes it extensional, so it is an ordinal, whose underlying type 𝟐\mathbf{2} is discrete. Trichotomy at 00 and 11 then gives PP, since 0=10=1 is false and 1<01\mathrel{<}0 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 xx and yy, the two order cases of trichotomy decide x≠yx\neq y, because a well-founded relation is irreflexive, and the middle case decides x=yx=y. ∎

5.3. Ordinal arithmetic

Definition 5.9 (Ordinal addition).

The sum α+β\alpha\mathbin{+}\beta has as underlying type the binary sum of those of α\alpha and β\beta, ordered so that every element of α\alpha precedes every element of β\beta:

inl​x<inl​x′\displaystyle\mathrm{inl}\,x\mathrel{<}\mathrm{inl}\,x^{\prime} :≡x<αx′,\displaystyle:\equiv x\mathrel{<_{\alpha}}x^{\prime}, inl​x<inr​y′\displaystyle\mathrm{inl}\,x\mathrel{<}\mathrm{inr}\,y^{\prime} :≡𝟏,\displaystyle:\equiv\mathbf{1},
inr​y<inr​y′\displaystyle\mathrm{inr}\,y\mathrel{<}\mathrm{inr}\,y^{\prime} :≡y<βy′,\displaystyle:\equiv y\mathrel{<_{\beta}}y^{\prime}, inr​y<inl​x′\displaystyle\mathrm{inr}\,y\mathrel{<}\mathrm{inl}\,x^{\prime} :≡𝟎.\displaystyle:\equiv\mathbf{0}.
Lemma 5.10.

The order of Definition 5.9 is a well-order, so that α+β\alpha\mathbin{+}\beta 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 τ\tau. The second is a sum whose index type x=x′x=x^{\prime} is a proposition, the underlying type of an ordinal being a set (Lemma 5.2), and whose fibers are given by the order of υ​x′\upsilon\,x^{\prime}. The two cases exclude each other, because x<x′x\mathrel{<}x^{\prime} together with x=x′x=x^{\prime} would make xx 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 τ\tau. 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 (x,a)(x,a) is accessible by induction on the accessibility of xx and then on that of aa. Its predecessors are the (x′,a′)(x^{\prime},a^{\prime}) with x′<xx^{\prime}\mathrel{<}x, accessible by the induction hypothesis on xx, and the (x,a′)(x,a^{\prime}) with a′<aa^{\prime}\mathrel{<}a, accessible by the induction hypothesis on aa.

Now let the family be constant, say υ​x=α\upsilon\,x=\alpha for every xx, and let (x,a)(x,a) and (x′,a′)(x^{\prime},a^{\prime}) have the same predecessors. Given u<xu\mathrel{<}x, we have (u,a)<(x,a)(u,a)\mathrel{<}(x,a) and hence (u,a)<(x′,a′)(u,a)\mathrel{<}(x^{\prime},a^{\prime}), which gives either u<x′u\mathrel{<}x^{\prime} or u=x′u=x^{\prime} together with a<a′a\mathrel{<}a^{\prime}. The second case is impossible, because it makes x′<xx^{\prime}\mathrel{<}x, so that (x′,a′)<(x,a)(x^{\prime},a^{\prime})\mathrel{<}(x,a) and hence (x′,a′)<(x′,a′)(x^{\prime},a^{\prime})\mathrel{<}(x^{\prime},a^{\prime}), which well-foundedness forbids. So every predecessor of xx is one of x′x^{\prime}, and by symmetry the two points have the same predecessors, which gives x=x′x=x^{\prime} by the extensionality of τ\tau.

So we may take x′x^{\prime} to be xx. For b<ab\mathrel{<}a we have (x,b)<(x,a)(x,b)\mathrel{<}(x,a) and hence (x,b)<(x,a′)(x,b)\mathrel{<}(x,a^{\prime}), which gives b<a′b\mathrel{<}a^{\prime}, the alternative x<xx\mathrel{<}x being impossible. By symmetry and the extensionality of α\alpha, we get a=a′a=a^{\prime}. ∎

Definition 5.11 (Lexicographic order on arbitrary sums).

For τ:Ord\tau:\mathrm{Ord} and a family υ:τ→Ord\upsilon:\tau\to\mathrm{Ord}, the lexicographic order on Σx:τυx\Sigma_{x:\tau}\,\upsilon\,x has the index as the more significant coordinate:

(x,a)<(x′,a′):≡(x<τx′)+Σr:x=x′(transportυra<υ​x′a′).(x,a)\mathrel{<}(x^{\prime},a^{\prime})\;:\equiv\;(x\mathrel{<_{\tau}}x^{\prime})\;+\;\textstyle\Sigma_{r\,:\,x=x^{\prime}}\,\big(\mathrm{transport}^{\upsilon}\,r\,a\mathrel{<_{\upsilon\,x^{\prime}}}a^{\prime}\big).

We write Στ​υ\Sigma_{\tau}\upsilon for the type Σx:τυx\Sigma_{x:\tau}\,\upsilon\,x 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 τ\tau is a set, so that rr is unique, and the fiber orders are proposition valued. The two cases exclude each other, because x<x′x\mathrel{<}x^{\prime} together with x=x′x=x^{\prime} would make xx 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 <\mathrel{<} after transporting, and if neither does, the three indices agree and the fiber order is transitive.

For well-foundedness, we show that (x,a)(x,a) is accessible by induction on the accessibility of xx and then on that of aa. Its predecessors are the (x′,a′)(x^{\prime},a^{\prime}) with x′<xx^{\prime}\mathrel{<}x, accessible by the induction hypothesis on xx, and the (x,a′)(x,a^{\prime}) with a′<aa^{\prime}\mathrel{<}a, accessible by the induction hypothesis on aa.

Now let the family be constant, say υ​x=α\upsilon\,x=\alpha for every xx, and let (x,a)(x,a) and (x′,a′)(x^{\prime},a^{\prime}) have the same predecessors. Given u<xu\mathrel{<}x we have (u,a)<(x,a)(u,a)\mathrel{<}(x,a), so (u,a)<(x′,a′)(u,a)\mathrel{<}(x^{\prime},a^{\prime}), which gives either u<x′u\mathrel{<}x^{\prime}, as wanted, or u=x′u=x^{\prime} together with a<a′a\mathrel{<}a^{\prime}. In the second case x′<xx^{\prime}\mathrel{<}x, so (x′,a′)<(x,a)(x^{\prime},a^{\prime})\mathrel{<}(x,a) and hence (x′,a′)<(x′,a′)(x^{\prime},a^{\prime})\mathrel{<}(x^{\prime},a^{\prime}), which well-foundedness forbids. By symmetry xx and x′x^{\prime} have the same predecessors, so x=x′x=x^{\prime} by the extensionality of τ\tau, and we may assume x=x′x=x^{\prime}. Then for b<ab\mathrel{<}a we have (x,b)<(x,a)(x,b)\mathrel{<}(x,a), hence (x,b)<(x,a′)(x,b)\mathrel{<}(x,a^{\prime}), which gives b<a′b\mathrel{<}a^{\prime}, since x<xx\mathrel{<}x is impossible, and by symmetry and the extensionality of the fiber, we get a=a′a=a^{\prime}. ∎

Definition 5.13 (Ordinal multiplication).

Ordinal multiplication α×β\alpha\mathbin{\times}\beta is the lexicographic order of Definition 5.11 in the case of a constant family: the sum over β\beta of the family constantly α\alpha, so that β\beta is the more significant coordinate. The operands are thus written in the opposite order from their sum, α\alpha before β\beta, as in the classical definition. It is an ordinal by Lemma 5.12.

Lemma 5.14 (Maps of lexicographic sums).

For τ,τ′:Ord\tau,\tau^{\prime}:\mathrm{Ord} with families υ:τ→Ord\upsilon:\tau\to\mathrm{Ord} and υ′:τ′→Ord\upsilon^{\prime}:\tau^{\prime}\to\mathrm{Ord}, a map f:τ→τ′f:\tau\to\tau^{\prime} and maps g​x:υ​x→υ′​(f​x)g\,x:\upsilon\,x\to\upsilon^{\prime}\,(f\,x), the map Σ⁡(f,g):Στ​υ→Στ′​υ′\Sigma(f,g):\Sigma_{\tau}\upsilon\to\Sigma_{\tau^{\prime}}\upsilon^{\prime} of Definition 2.28 is

  1. (1)

    order-preserving if ff is and every g​xg\,x is,

  2. (2)

    order-reflecting if ff is and every g​xg\,x is and ff 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 ff. One of the second kind is preserved by g​xg\,x, after transporting the fiber component along the image under ff of the identification of the indices.

(2) A comparison of the images of the first kind is reflected by ff. One of the second kind comes with an identification f​x=f​yf\,x=f\,y of the images of the indices, and ff, being an embedding, is left cancellable, which identifies xx with yy. 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 g​xg\,x. ∎

Remark 5.15.

For arbitrary τ:Ord\tau:\mathrm{Ord} and υ:τ→Ord\upsilon:\tau\to\mathrm{Ord}, the lexicographic order on Σx:τυx\Sigma_{x:\tau}\,\upsilon\,x fails constructively to be extensional, in that excluded middle follows if all such orders are extensional.

Proof.

Take τ\tau to be the ordinal Ω\Omega and υ\upsilon to be the family that sends a truth value pp to the proposition p≠⊥p\neq\bot. 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

X:≡Σp:Ωp≠⊥X\;:\equiv\;\textstyle\Sigma_{p:\Omega}\,p\neq\bot

of Ω\Omega with the restricted order. No element of XX has a predecessor in XX, since a predecessor would have to be ⊥\bot, which XX excludes. So the hypothesis of extensionality is vacuous, and extensionality of XX says that XX is a proposition. Let PP be a proposition with ¬¬⁡P\neg\neg P. Both PP and ¬¬⁡P\neg\neg P are elements of XX, so they are equal, and PP 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 τ\tau is trichotomous and υ\upsilon is a τ\tau-indexed family of ordinals, then the lexicographic order is extensional, so that Στ​υ\Sigma_{\tau}\upsilon is an ordinal.

Proof.

By Lemma 5.12, only extensionality is left to prove. Trichotomy makes the order of τ\tau cotransitive, in the sense that x<yx\mathrel{<}y implies, for any zz, that x<zx\mathrel{<}z or z<yz\mathrel{<}y. Indeed, compare zz with yy. In the case z<yz\mathrel{<}y there is nothing to do, in the case z=yz=y we have x<zx\mathrel{<}z, and in the case y<zy\mathrel{<}z transitivity gives x<zx\mathrel{<}z.

Now let (a,b)(a,b) and (x,y)(x,y) have the same predecessors. Given u<au\mathrel{<}a, cotransitivity applied to the point xx gives u<xu\mathrel{<}x or x<ax\mathrel{<}a. In the second case (x,y)<(a,b)(x,y)\mathrel{<}(a,b), so that (x,y)<(x,y)(x,y)\mathrel{<}(x,y), which the well-foundedness of the lexicographic order forbids. So every predecessor of aa is one of xx, and by symmetry the two have the same predecessors, which gives a=xa=x by the extensionality of τ\tau.

So we may take aa to be xx. For v<bv\mathrel{<}b we have (x,v)<(x,b)(x,v)\mathrel{<}(x,b) and hence (x,v)<(x,y)(x,v)\mathrel{<}(x,y), which gives v<yv\mathrel{<}y, the alternative x<xx\mathrel{<}x being impossible. By symmetry and the extensionality of υ​x\upsilon\,x, we get b=yb=y. ∎

Definition 5.17 (Topped ordinals).

A top of an ordinal α\alpha is a point that no element exceeds, and Ord⊤\mathrm{Ord}^{\top} is the type of ordinals equipped with a top:

Ord⊤:≡Σα:OrdΣt:α∏y:α¬(t<y).\mathrm{Ord}^{\top}:\equiv\textstyle\Sigma_{\alpha:\mathrm{Ord}}\,\Sigma_{t:\alpha}\,\prod_{y:\alpha}\,\neg\,(t\mathrel{<}y).

A largest element is a top, because the order is well-founded and hence irreflexive, but not conversely: in the ordinal Ω\Omega no element exceeds a truth value PP with ¬¬⁡P\neg\neg P, since such a PP differs from ⊥\bot, whereas ⊤\top 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 α+𝟏\alpha\mathbin{+}\mathbf{1}).

Example 5.18.

The type ℕ∞\mathbb{N}_{\infty} of Example 3.1 is an ordinal under its natural order, in which uu precedes vv when uu is a finite point n¯\underline{n} whose index is below vv in the sense of Example 3.1:

u<v:≡Σn:ℕ((u=n¯)×(n⊏v)).u\mathrel{<}v\;:\equiv\;\textstyle\Sigma_{n:\mathbb{N}}\,\big((u=\underline{n})\times(n\mathrel{\sqsubset}v)\big).

It is topped by its largest element ∞\infty, and we write ℕ∞\mathbb{N}_{\infty} for it, as an ordinal or as a topped one according to the context.

Proof.

The predecessors of a point vv are exactly the finite points n¯\underline{n} with n⊏vn\mathrel{\sqsubset}v. One direction is the definition, which asks a predecessor to be finite, and for the other, the comparison n¯<v\underline{n}\mathrel{<}v holds whenever n⊏vn\mathrel{\sqsubset}v. Moreover, the index nn in the definition is determined by uu, because (−)¯\underline{(-)} is left cancellable.

The order is proposition valued, being a sum over nn of a product of two equations in the sets ℕ∞\mathbb{N}_{\infty} and 𝟐\mathbf{2}, with the index nn determined as observed above.

For transitivity, let u<vu\mathrel{<}v and v<wv\mathrel{<}w, say u=m¯u=\underline{m} with m⊏vm\mathrel{\sqsubset}v and v=n¯v=\underline{n} with n⊏wn\mathrel{\sqsubset}w. From m⊏n¯m\mathrel{\sqsubset}\underline{n} we get m<nm<n, and ww is decreasing, so that n⊏wn\mathrel{\sqsubset}w gives m⊏wm\mathrel{\sqsubset}w. This says that u<wu\mathrel{<}w.

For well-foundedness, each finite point n¯\underline{n} is accessible by course-of-values induction on nn. Its predecessors are the m¯\underline{m} with m⊏n¯m\mathrel{\sqsubset}\underline{n}, that is, with m<nm<n, and these are accessible by the induction hypothesis. Any point vv is then accessible, its predecessors being finite points.

For extensionality, let uu and vv have the same predecessors. By the first paragraph this says that n⊏un\mathrel{\sqsubset}u if and only if n⊏vn\mathrel{\sqsubset}v for every nn, and two binary digits that are 11 in the same cases are equal, so uu and vv have the same digits. Being decreasing is a proposition, so a point of ℕ∞\mathbb{N}_{\infty} is determined by its digits, and u=vu=v.

Finally, the point ∞\infty is a top, because ∞<v\infty\mathrel{<}v would make ∞\infty a finite point n¯\underline{n}, and ∞\infty is not finite, having n⊏∞n\mathrel{\sqsubset}\infty for every nn whereas n¯⊑n\underline{n}\mathrel{\sqsubseteq}n. ∎

Constructively, ℕ∞\mathbb{N}_{\infty} is topped by ∞\infty without being a successor ordinal, since ∞\infty 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 Στ​υ\Sigma_{\tau}\upsilon 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 υ\upsilon is a τ\tau-indexed family of topped ordinals, then the lexicographi order is extensional, so that Στ​υ\Sigma_{\tau}\upsilon is an ordinal. If moreover τ\tau is topped, then so is Στ​υ\Sigma_{\tau}\upsilon.

Proof.

By Lemma 5.12, only extensionality is left to prove. Write tut_{u} for the top of υ​u\upsilon\,u, and let (a,b)(a,b) and (x,y)(x,y) have the same predecessors. Given u<au\mathrel{<}a, we have (u,tu)<(a,b)(u,t_{u})\mathrel{<}(a,b) and hence (u,tu)<(x,y)(u,t_{u})\mathrel{<}(x,y), which gives u<xu\mathrel{<}x or u=xu=x together with a comparison exceeding tut_{u} in the fiber, and the latter is impossible. So every predecessor of aa is one of xx, and by symmetry the two have the same predecessors, which gives a=xa=x by the extensionality of τ\tau. 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 tt of τ\tau with the top of υ​t\upsilon\,t. A point exceeding it would either exceed tt in τ\tau or exceed the top of υ​t\upsilon\,t in that fiber, and neither is possible. ∎

Lemma 5.20.

If τ:Ord⊤\tau:\mathrm{Ord}^{\top} and υ:τ→Ord⊤\upsilon:\tau\to\mathrm{Ord}^{\top}, where τ\tau is compact pointed and υ​x\upsilon\,x is compact pointed for every xx, then Στ​υ\Sigma_{\tau}\upsilon is compact pointed.

Proof.

The underlying type of Στ​υ\Sigma_{\tau}\upsilon is by definition Σx:τυx\Sigma_{x:\tau}\,\upsilon\,x, 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 Π\Pi-extension operation on families given in Definition 4.30.

Lemma 5.21.

Let j:X↪Kj:X\hookrightarrow K be an embedding and α:X→Ord\alpha:X\to\mathrm{Ord} a family of ordinals. For any k:Kk:K, give the type (α/j)​k(\alpha\mathbin{/}j)\,k the relation

u<v:≡Σp:j−1​(k)up<α⁡(pr1​p)vp.u\mathrel{<}v\;:\equiv\;\Sigma_{p\,:\,j^{-1}(k)}u\,p\mathrel{<_{\alpha\,(\mathrm{pr}_{1}p)}}v\,p.

This is a well-order, so we obtain the extension α/j:K→Ord\alpha\mathbin{/}j:K\to\mathrm{Ord}.

Proof.

Since jj is an embedding, the fiber j−1​(k)j^{-1}(k) is a proposition, so (α/j)​k(\alpha\mathbin{/}j)\,k is a product indexed by a proposition, and <\mathrel{<} is the order that such a product carries, asking the component order to hold at some point of the fiber. For each p:j−1​(k)p:j^{-1}(k), evaluation at pp is an equivalence from the product to the component α⁡(pr1​p)\alpha\,(\mathrm{pr}_{1}p), 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 uu and vv have the same predecessors, and let p:j−1​(k)p:j^{-1}(k). A predecessor xx of u​pu\,p determines a section, which is a predecessor of uu in the product, witnessed at pp. By the hypothesis it is a predecessor of vv, witnessed at some point of the fiber, which is pp because the fiber is a proposition, so xx is a predecessor of v​pv\,p. Symmetrically, u​pu\,p and v​pv\,p have the same predecessors, and the extensionality of α⁡(pr1​p)\alpha\,(\mathrm{pr}_{1}p) gives u​p=v​pu\,p=v\,p. Since pp was arbitrary, u=vu=v.

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 uu of the product is accessible as soon as every v<uv\mathrel{<}u is. A witness of v<uv\mathrel{<}u supplies a point pp of j−1​(k)j^{-1}(k) together with v​p<u​pv\,p\mathrel{<}u\,p, and u​pu\,p is accessible because the order of α⁡(pr1​p)\alpha\,(\mathrm{pr}_{1}p) is well-founded, so that v​pv\,p is accessible as one of its predecessors. Accessibility transfers from the component back to the product along evaluation at pp, because a predecessor in the product of the section determined by a point xx of the component has its value at pp below xx. ∎

Lemma 5.22.

If every α​x\alpha\,x is topped, then so is every (α/j)​k(\alpha\mathbin{/}j)\,k, so the construction extends families of topped ordinals.

Proof.

Suppose each α​x\alpha\,x has a top element txt_{x}. Then p↦tpr1​pp\mapsto t_{\mathrm{pr}_{1}p} is a top element of <\mathrel{<}, since, if it were below some ψ\psi, we would have a fiber p:j−1​(k)p:j^{-1}(k) with tpr1​p<ψ​pt_{\mathrm{pr}_{1}p}\mathrel{<}\psi\,p, contradicting the topness of tpr1​pt_{\mathrm{pr}_{1}p}. ∎

Lemma 5.23.

The construction restricts back to α\alpha along jj, giving

(α/j)(jx)≃oαx(\alpha\mathbin{/}j)(j\,x)\simeq_{o}\alpha\,x

for every x:Xx:X, as illustrated in the diagram below.

X{\lx@inpgf@ignorespaces X}K{\lx@inpgf@ignorespaces K}Ord{\lx@inpgf@ignorespaces\mathrm{Ord}}j\scriptstyle{\lx@inpgf@ignorespaces j}α\scriptstyle{\lx@inpgf@ignorespaces\alpha}α/j\scriptstyle{\lx@inpgf@ignorespaces\alpha\mathbin{/}j}
Proof.

For k=j​xk=j\,x the fiber j−1​(j​x)j^{-1}(j\,x) is a singleton, being an inhabited proposition, so evaluation at its center (x,refl)(x,\mathrm{refl}) is an equivalence (α/j)​(j​x)→α​x(\alpha\mathbin{/}j)(j\,x)\to\alpha\,x by Lemma 4.31(1). It is order-preserving, because a comparison u<vu\mathrel{<}v 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 u<vu\mathrel{<}v. The inverse of an order-preserving order-reflecting equivalence is order-preserving, so this is an order equivalence. ∎

Lemma 5.24.

If every α​x\alpha\,x is totally separated, then so is every (α/j)​k(\alpha\mathbin{/}j)\,k.

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 υ:ℕ→Ord⊤\upsilon:\mathbb{N}\to\mathrm{Ord}^{\top} be a family of topped ordinals.

  1. (1)

    The extended sum of υ\upsilon is the extension of υ\upsilon along the embedding ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}, summed over the ordinal ℕ∞\mathbb{N}_{\infty}:

    Σ1​υ:≡Σℕ∞​(υ/ι).\Sigma^{1}\upsilon\;:\equiv\;\Sigma_{\mathbb{N}_{\infty}}\,\big(\upsilon\mathbin{/}\iota\big).
  2. (2)

    The successor sum of υ\upsilon is the extension of υ\upsilon along the left inclusion inl:ℕ↪ℕ+𝟏\mathrm{inl}:\mathbb{N}\hookrightarrow\mathbb{N}+\mathbf{1}, summed over the successor ω+𝟏\omega\mathbin{+}\mathbf{1}, taken as a topped ordinal with the added point as top:

    Σ1​υ:≡Σω+𝟏​(υ/inl).\Sigma_{1}\upsilon\;:\equiv\;\Sigma_{\omega\mathbin{+}\mathbf{1}}\,\big(\upsilon\mathbin{/}\mathrm{inl}\big).
Lemma 5.26.

Let υ:ℕ→Ord⊤\upsilon:\mathbb{N}\to\mathrm{Ord}^{\top}.

  1. (1)

    The successor sum is order equivalent to the successor of the countable sum:

    Σ1υ≃o(Σωυ)+𝟏.\Sigma_{1}\upsilon\;\simeq_{o}\;\Big(\Sigma_{\omega}\,\upsilon\Big)\mathbin{+}\mathbf{1}.
  2. (2)

    If υ​n\upsilon\,n is a retract of ℕ\mathbb{N} for every nn, then so is Σ1​υ\Sigma_{1}\upsilon, and if υ​n\upsilon\,n is discrete for every nn, then so is Σ1​υ\Sigma_{1}\upsilon.

Proof.

The sum is taken over ℕ+𝟏\mathbb{N}+\mathbf{1}, so its fibers are the extension of υ\upsilon along inl\mathrm{inl}. Since inl\mathrm{inl} is an embedding, that extension gives υ​n\upsilon\,n back at inl​n\mathrm{inl}\,n, up to order equivalence (Lemma 5.23). At inr⋆\mathrm{inr}\,\star the fiber of inl\mathrm{inl} is empty, no natural number having inln=inr⋆\mathrm{inl}\,n=\mathrm{inr}\,\star, so the extension is the one-point ordinal there (Lemma 4.31(2)). Write υ′\upsilon^{\prime} for the family on ℕ+𝟏\mathbb{N}+\mathbf{1} so described. Taking underlying types, that of Σ1​υ\Sigma_{1}\upsilon is the binary sum (Σn:ℕυn)+𝟏\big(\Sigma_{n:\mathbb{N}}\,\upsilon\,n\big)+\mathbf{1}, whose top is the one supplied by Lemma 5.19, namely the pair of the top inr⋆\mathrm{inr}\,\star of ω+𝟏\omega\mathbin{+}\mathbf{1} 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 Σ1​υ\Sigma_{1}\upsilon is order equivalent to Σω+𝟏​υ′\Sigma_{\omega\mathbin{+}\mathbf{1}}\,\upsilon^{\prime}. The map sending (inl​n,x)(\mathrm{inl}\,n,x) to inl⁡(n,x)\mathrm{inl}\,(n,x) and (inr⋆,⋆)(\mathrm{inr}\,\star,\star) to inr⋆\mathrm{inr}\,\star is an equivalence from the underlying type of that sum to that of (Σω​υ)+𝟏\big(\Sigma_{\omega}\,\upsilon\big)\mathbin{+}\mathbf{1}, 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 (Σn:ℕυn)+𝟏\big(\Sigma_{n:\mathbb{N}}\,\upsilon\,n\big)+\mathbf{1}. If each υ​n\upsilon\,n is a retract of ℕ\mathbb{N}, then Σn:ℕυn\Sigma_{n:\mathbb{N}}\,\upsilon\,n is a retract of ℕ×ℕ\mathbb{N}\times\mathbb{N} and hence of ℕ\mathbb{N}, by a pairing function, so that its binary sum with 𝟏\mathbf{1} is a retract of ℕ+𝟏\mathbb{N}+\mathbf{1}, which is again a retract of ℕ\mathbb{N}. If each υ​n\upsilon\,n is discrete, then so is Σn:ℕυn\Sigma_{n:\mathbb{N}}\,\upsilon\,n, discreteness being closed under Σ\Sigma over the discrete index ℕ\mathbb{N}, and so is its binary sum with 𝟏\mathbf{1}, discreteness being closed under ++ (Proposition 3.6). ∎

Definition 5.27 (Comparison map).

We now define a comparison map

𝔠υ:Σ1​υ→Σ1​υ.\mathfrak{c}_{\upsilon}:\Sigma_{1}\upsilon\to\Sigma^{1}\upsilon.

First we need some preparation. Let υ:ℕ→Ord⊤\upsilon:\mathbb{N}\to\mathrm{Ord}^{\top}. The underlying type of Σ1​υ\Sigma_{1}\upsilon is Σz:ℕ+𝟏(υ/inl)z\Sigma_{z\,:\,\mathbb{N}+\mathbf{1}}\,(\upsilon\mathbin{/}\mathrm{inl})\,z and that of Σ1​υ\Sigma^{1}\upsilon is Σu:ℕ∞(υ/ι)u\Sigma_{u\,:\,\mathbb{N}_{\infty}}\,(\upsilon\mathbin{/}\iota)\,u. By Lemma 5.21 the two fibers are the products

(υ/inl)z=∏(n,r):inl−1​(z)υn,(υ/ι)u=∏(n,q):ι−1​(u)υn.(\upsilon\mathbin{/}\mathrm{inl})\,z=\textstyle\prod_{(n,r)\,:\,\mathrm{inl}^{-1}(z)}\upsilon\,n,\qquad(\upsilon\mathbin{/}\iota)\,u=\textstyle\prod_{(n,q)\,:\,\iota^{-1}(u)}\upsilon\,n.

Write ι1:ℕ+𝟏→ℕ∞\iota_{1}:\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} for the map that sends inl​n\mathrm{inl}\,n to n¯\underline{n} and the added point to ∞\infty, so that ι1∘inl=ι\iota_{1}\circ\mathrm{inl}=\iota. The map ι1\iota_{1} is left cancellable: if ι1​(inl​m)=ι1​(inl​n)\iota_{1}\,(\mathrm{inl}\,m)=\iota_{1}\,(\mathrm{inl}\,n) then m¯=n¯\underline{m}=\underline{n} and so m=nm=n. If ι1\iota_{1} takes the same value at a finite point and at the added point, in either order, then n¯=∞\underline{n}=\infty, which is impossible. And if both are the added point, they are already equal, 𝟏\mathbf{1} having a single point. Hence each z:ℕ+𝟏z:\mathbb{N}+\mathbf{1} gives the map φz:ι−1​(ι1​z)→inl−1​(z)\varphi_{z}:\iota^{-1}(\iota_{1}\,z)\to\mathrm{inl}^{-1}(z) defined by

φz​(n,q)=(n,rq),\varphi_{z}\,(n,q)=(n,r_{q}),

where rq:inl​n=zr_{q}:\mathrm{inl}\,n=z is obtained by cancelling ι1\iota_{1} in qq, which has type ι1​(inl​n)=ι1​z\iota_{1}\,(\mathrm{inl}\,n)=\iota_{1}\,z because ι1∘inl=ι\iota_{1}\circ\mathrm{inl}=\iota. Since φz\varphi_{z} keeps the first component, precomposition with it gives the map ez:(υ/inl)​z→(υ/ι)​(ι1​z)e_{z}:(\upsilon\mathbin{/}\mathrm{inl})\,z\to(\upsilon\mathbin{/}\iota)\,(\iota_{1}\,z) defined by

ez​ψ​(n,q)=ψ⁡(φz​(n,q)).e_{z}\,\psi\,(n,q)=\psi\,(\varphi_{z}\,(n,q)).

With this notation, we define the comparison map 𝔠υ:Σ1​υ→Σ1​υ\mathfrak{c}_{\upsilon}:\Sigma_{1}\upsilon\to\Sigma^{1}\upsilon to be the map of sums of Definition 2.28 induced by ι1\iota_{1} and the family ee,

𝔠υ=Σ⁡(ι1,e),\mathfrak{c}_{\upsilon}\;=\;\Sigma(\iota_{1},e),

which amounts to 𝔠υ​(z,ψ)=(ι1​z,ez​ψ)\mathfrak{c}_{\upsilon}\,(z,\psi)=(\iota_{1}\,z,\,e_{z}\,\psi).

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 𝔠υ\mathfrak{c}_{\upsilon} is an extremely dense embedding and both order-preserving and order-reflecting.

Proof.

The map ι1\iota_{1} is an embedding and is extremely dense (Examples 3.3(6)). Each eze_{z} is an equivalence, being precomposition with the equivalence φz\varphi_{z}. That φz\varphi_{z} is an equivalence holds because the two fibers are propositions, inl\mathrm{inl} and ι\iota being embeddings, and because φz\varphi_{z} has a converse, sending (n,r)(n,r) to (n,q)(n,q) with qq obtained by applying ι1\iota_{1} to rr. An equivalence is in particular an embedding and extremely dense, so that Lemma 2.29(2,3), applied to ι1\iota_{1} on the indices and to the maps eze_{z} on the fibers, makes 𝔠υ\mathfrak{c}_{\upsilon} an extremely dense embedding.

Each eze_{z} 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 φz\varphi_{z} and its converse carry such data back and forth. The map ι1\iota_{1} is order-preserving and order-reflecting from ω+𝟏\omega\mathbin{+}\mathbf{1} to ℕ∞\mathbb{N}_{\infty}. Among the finite points, m¯<n¯\underline{m}\mathrel{<}\underline{n} says that m⊏n¯m\mathrel{\sqsubset}\underline{n}, which holds exactly when m<nm<n. A finite point precedes the added point of ω+𝟏\omega\mathbin{+}\mathbf{1}, and n¯<∞\underline{n}\mathrel{<}\infty because n⊏∞n\mathrel{\sqsubset}\infty. And ∞\infty precedes nothing, since ∞<v\infty\mathrel{<}v would make ∞\infty finite. So Lemma 5.14 applies, its embedding hypothesis for (2) being again that ι1\iota_{1} 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 I:𝒰I:\mathcal{U} and α:I→Ord\alpha:I\to\mathrm{Ord}, and consider the map

σ:Σi:Iαi→Ord,σ(i,x)=αi↓x,\sigma:\textstyle\Sigma_{i:I}\,\alpha\,i\to\mathrm{Ord},\qquad\sigma\,(i,x)=\alpha\,i\mathbin{\downarrow}x,

which sends a point of a member of the family to its initial segment in Ord\mathrm{Ord}.

  1. (1)

    The image of the map σ\sigma is an ordinal, written supα\sup\alpha, under the inherited order

    (β,w)<(β′,w′):≡β<β′.(\beta,w)\mathrel{<}(\beta^{\prime},w^{\prime})\;:\equiv\;\beta\mathrel{<}\beta^{\prime}.
  2. (2)

    The map Σi:Iαi→supα\Sigma_{i:I}\,\alpha\,i\to\sup\alpha sending (i,x)(i,x) to the image of xx is a surjection.

  3. (3)

    supα\sup\alpha is the least upper bound of the family α\alpha.

The proofs of these clauses are in [7]. Set replacement makes the image of the map σ\sigma equivalent to a type in our base universe, although Ord\mathrm{Ord} 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 ℕ\mathbb{N}. 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 II is compact pointed and α​i\alpha\,i is compact pointed for every i:Ii:I, then supα\sup\alpha is compact pointed.

Proof.

The type Σi:Iαi\Sigma_{i:I}\,\alpha\,i is compact pointed by Corollary 4.10(2), and supα\sup\alpha 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 j:X↪Kj:X\hookrightarrow K into a compact pointed type and any family α:X→Ord\alpha:X\to\mathrm{Ord} of compact pointed ordinals, the supremum of the extended family α/j\alpha\mathbin{/}j is itself compact pointed.

Proof.

By Corollary 5.30 applied to the family α/j\alpha\mathbin{/}j over the compact pointed index KK, it suffices to show that (α/j)​k(\alpha\mathbin{/}j)\,k is compact pointed for every k:Kk:K. By Lemma 5.21 this is the product of the types α​x\alpha\,x over the index type j−1​(k)j^{-1}(k), all of which are compact pointed by hypothesis, and j−1​(k)j^{-1}(k) is a proposition precisely because jj 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 ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}.

Definition 5.32 (Countable extended supremum).

For a family α:ℕ→Ord\alpha:\mathbb{N}\to\mathrm{Ord} of ordinals, the extended supremum is

sup1α:≡sup(α/ι),\sup\nolimits^{1}\alpha\;:\equiv\;\sup\big(\alpha\mathbin{/}\iota\big),

the supremum of the extension of α\alpha along the embedding ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}. The superscript has the same meaning as in the extended sum, that the index type is ℕ∞\mathbb{N}_{\infty} rather than ℕ+𝟏\mathbb{N}+\mathbf{1}.

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 ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} is compact and totally separated and dominates the standard interpretation ⟦−⟧sup\llbracket-\rrbracket_{\mathrm{sup}}, 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 11 records that the family is first extended along the embedding ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}, 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 bb a discrete ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}}, and the same code bb denotes a compact totally separated ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}}. 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 B\mathrm{B} of Brouwer ordinal codes (countably branching trees) is inductively generated by the constructors

𝖹:B,𝖲:B→B,𝖫:(ℕ→B)→B.\mathsf{Z}:\mathrm{B},\qquad\mathsf{S}:\mathrm{B}\to\mathrm{B},\qquad\mathsf{L}:(\mathbb{N}\to\mathrm{B})\to\mathrm{B}.

6.1. The standard interpretation

Definition 6.2.

We define an interpretation function

⟦−⟧sup:B→Ord(standard interpretation)\llbracket-\rrbracket_{\mathrm{sup}}:\mathrm{B}\to\mathrm{Ord}\qquad\text{(standard interpretation)}

by interpreting the constructors as indicated in the following table:

𝖹\mathsf{Z} 𝖲\mathsf{S} 𝖫\mathsf{L}
⟦−⟧sup\llbracket-\rrbracket_{\mathrm{sup}} 𝟎\mathbf{0} (−)+𝟏(-)\mathbin{+}\mathbf{1} sup\sup

Here sup\sup is the supremum of an ℕ\mathbb{N}-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 ⟦b⟧sup\llbracket b\rrbracket_{\mathrm{sup}} is compact for every Brouwer code bb, then LPO\mathrm{LPO} holds.

Proof.

The code 𝖫⁡(n↦𝖲n​𝖹)\mathsf{L}(n\mapsto\mathsf{S}^{n}\,\mathsf{Z}) is interpreted as the supremum of the finite ordinals, which is ω\omega, and the compactness of its underlying type ℕ\mathbb{N} is LPO\mathrm{LPO} (Examples 4.5(2)). ∎

Proposition 6.4.

If the standard interpretation ⟦b⟧sup\llbracket b\rrbracket_{\mathrm{sup}} is trichotomous for every Brouwer code bb, then LPO\mathrm{LPO} holds.

Proof.

It suffices to decide, for an arbitrary u:ℕ∞u:\mathbb{N}_{\infty}, whether uu is finite, because deciding finiteness for every conatural number is equivalent to LPO\mathrm{LPO}. So fix u:ℕ∞u:\mathbb{N}_{\infty} and write ui:𝟐u_{i}:\mathbf{2} for its ii-th digit under the inclusion ℕ∞↪𝟐ℕ\mathbb{N}_{\infty}\hookrightarrow\mathbf{2}^{\mathbb{N}}. From Example 3.1, we have that uu is finite exactly when u⊑iu\mathrel{\sqsubseteq}i for some ii.

The codes. Put

g​i\displaystyle g\,i =𝖲⁡(if ui=0 then 𝖲​𝖹 else 𝖹),\displaystyle\;=\;\mathsf{S}\big(\text{if $u_{i}=0$ then $\mathsf{S}\,\mathsf{Z}$ else $\mathsf{Z}$}\big),
h​ 0\displaystyle h\,0 =𝖲⁡(𝖲​𝖹),\displaystyle=\mathsf{S}(\mathsf{S}\,\mathsf{Z}),
h​ 1\displaystyle h\,1 =𝖲⁡(𝖫​g),\displaystyle=\mathsf{S}(\mathsf{L}\,g),
h⁡(n+2)\displaystyle h\,(n{+}2) =𝖹,\displaystyle=\mathsf{Z},

the last clause being arbitrary. Write α​i=⟦g​i⟧sup\alpha\,i=\llbracket g\,i\rrbracket_{\mathrm{sup}} and β=⟦𝖫​h⟧sup=supi⟦h​i⟧sup\beta=\llbracket\mathsf{L}\,h\rrbracket_{\mathrm{sup}}=\sup_{i}\llbracket h\,i\rrbracket_{\mathrm{sup}}. Unfolding Definition 6.2 and using that 𝟎\mathbf{0} is left neutral for +\mathbin{+},

α​i\displaystyle\alpha\,i ={𝟐if ​ui=0,𝟏if ​ui=1,\displaystyle=\begin{cases}\mathbf{2}&\text{if }u_{i}=0,\\ \mathbf{1}&\text{if }u_{i}=1,\end{cases}
⟦h​ 0⟧sup\displaystyle\llbracket h\,0\rrbracket_{\mathrm{sup}} =𝟐,\displaystyle=\mathbf{2},
⟦h​ 1⟧sup\displaystyle\llbracket h\,1\rrbracket_{\mathrm{sup}} =(supiα​i)+𝟏.\displaystyle=(\sup_{i}\alpha\,i)\mathbin{+}\mathbf{1}.

The code we associate to uu is 𝖫​h\mathsf{L}\,h, and the hypothesis gives us that β\beta is trichotomous.

Two elements of β\beta. We have 𝟏<𝟐\mathbf{1}\mathrel{<}\mathbf{2}, and ⟦h​ 0⟧sup≤β\llbracket h\,0\rrbracket_{\mathrm{sup}}\mathrel{\leq}\beta by Theorem 5.29 (3), so 𝟏<β\mathbf{1}\mathrel{<}\beta. Also supiα​i<(supiα​i)+𝟏=⟦h​ 1⟧sup≤β\sup_{i}\alpha\,i\mathrel{<}(\sup_{i}\alpha\,i)\mathbin{+}\mathbf{1}=\llbracket h\,1\rrbracket_{\mathrm{sup}}\mathrel{\leq}\beta, an ordinal being an element of its own successor, so supiα​i<β\sup_{i}\alpha\,i\mathrel{<}\beta. Let y0,y1:βy_{0},y_{1}:\beta be the witnesses of these two facts, so that

β↓y0=𝟏,β↓y1=supiα​i.\beta\mathbin{\downarrow}y_{0}=\mathbf{1},\qquad\beta\mathbin{\downarrow}y_{1}=\sup_{i}\alpha\,i.

Three lemmas. First, the supremum supiα​i\sup_{i}\alpha\,i has a point: each α​i\alpha\,i, being of the form γ+𝟏\gamma\mathbin{+}\mathbf{1}, has the point contributed by the 𝟏\mathbf{1} summand, and the map α​i→supiα​i\alpha\,i\to\sup_{i}\alpha\,i carries it to a point of the supremum. Hence the inequality supiα​i<𝟏\sup_{i}\alpha\,i\mathrel{<}\mathbf{1} is impossible, because an initial segment of 𝟏\mathbf{1} is 𝟎\mathbf{0}, which would make supiα​i\sup_{i}\alpha\,i empty.

Second, if uu is finite then 𝟏<supiα​i\mathbf{1}\mathrel{<}\sup_{i}\alpha\,i. To see this, say u=n¯u=\underline{n}, so that un=0u_{n}=0 and hence α​n=𝟐\alpha\,n=\mathbf{2}. Now 𝟏<𝟐=α​n≤supiα​i\mathbf{1}\mathrel{<}\mathbf{2}=\alpha\,n\mathrel{\leq}\sup_{i}\alpha\,i.

Third, conversely, the inequality 𝟏<supiα​i\mathbf{1}\mathrel{<}\sup_{i}\alpha\,i implies that uu is finite: being finite is a proposition, so we may use that the maps α​i→supiα​i\alpha\,i\to\sup_{i}\alpha\,i are jointly surjective, which is the surjectivity of the map out of the sum (Theorem 5.29(2)), hence the element of supiα​i\sup_{i}\alpha\,i whose initial segment is 𝟏\mathbf{1} comes from some x:α​ix:\alpha\,i, and initial segments are preserved by the maps into the supremum, which are simulations (Theorem 5.29(3)), so 𝟏=α​i↓x\mathbf{1}=\alpha\,i\mathbin{\downarrow}x, which is to say that 𝟏<α​i\mathbf{1}\mathrel{<}\alpha\,i. Decide the value of uiu_{i}. If ui=0u_{i}=0 then uu is bounded by ii, hence finite. If ui=1u_{i}=1 then α​i=𝟏\alpha\,i=\mathbf{1}, giving 𝟏<𝟏\mathbf{1}\mathrel{<}\mathbf{1}, which is impossible since <\mathrel{<} is irreflexive.

Deciding finiteness. Apply trichotomy of β\beta to y0y_{0} and y1y_{1}. Since passing to initial segments preserves the order, the three cases for trichotomy read:

  1. (1)

    y0<y1y_{0}\mathrel{<}y_{1}: then 𝟏<supiα​i\mathbf{1}\mathrel{<}\sup_{i}\alpha\,i, so uu is finite by the third lemma.

  2. (2)

    y0=y1y_{0}=y_{1}: then 𝟏=supiα​i\mathbf{1}=\sup_{i}\alpha\,i. So uu is not finite, for were it finite, the second lemma would give 𝟏<𝟏\mathbf{1}\mathrel{<}\mathbf{1}.

  3. (3)

    y1<y0y_{1}\mathrel{<}y_{0}: then supiα​i<𝟏\sup_{i}\alpha\,i\mathrel{<}\mathbf{1}, which the first lemma rules out, so this case does not arise.

In each case the finiteness of uu is decided. ∎

Remark 6.5.

The proof uses the hypothesis of trichotomy only at the single pair y0,y1y_{0},y_{1} of the single ordinal β\beta, and β\beta is built from uu 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

⟦−⟧Σ:B→Ord3(trichotomous interpretation)⟦−⟧Σ1:B→Ord⊤(compact totally separated interpretation)⟦−⟧sup1:B→Ord(compact interpretation)\begin{array}[]{rcll}\llbracket-\rrbracket_{\Sigma}&:&\mathrm{B}\to\mathrm{Ord}_{3}&\text{(trichotomous interpretation)}\\ \llbracket-\rrbracket_{\Sigma^{1}}&:&\mathrm{B}\to\mathrm{Ord}^{\top}&\text{(compact totally separated interpretation)}\\ \llbracket-\rrbracket_{\mathrm{sup}^{1}}&:&\mathrm{B}\to\mathrm{Ord}&\text{(compact interpretation)}\end{array}

by interpreting the constructors as indicated in the following table:

𝖹\mathsf{Z} 𝖲\mathsf{S} 𝖫\mathsf{L}
⟦−⟧Σ\llbracket-\rrbracket_{\Sigma} 𝟎\mathbf{0} (−)+𝟏(-)\mathbin{+}\mathbf{1} Σ\Sigma
⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} 𝟏\mathbf{1} (−)+𝟏(-)\mathbin{+}\mathbf{1} Σ1\Sigma^{1}
⟦−⟧sup1\llbracket-\rrbracket_{\mathrm{sup}^{1}} 𝟏\mathbf{1} (−)+𝟏(-)\mathbin{+}\mathbf{1} sup1\sup\nolimits^{1}

Here Σ\Sigma is the lexicographic sum over ω\omega (Definition 5.11), which is an ordinal by Lemma 5.16, the index ω\omega being trichotomous, Σ1\Sigma^{1} is the extended sum (Definition 5.25(1)), and sup1\sup\nolimits^{1} is the extended supremum (Definition 5.32).

In the compact totally separated and the compact interpretation we deliberately map 𝖹\mathsf{Z} to 𝟏\mathbf{1} rather than 𝟎\mathbf{0}, 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 bb,

  1. (1)

    the ordinal ⟦b⟧Σ\llbracket b\rrbracket_{\Sigma} is trichotomous,

  2. (2)

    the underlying type of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is compact and totally separated,

  3. (3)

    the underlying type of ⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}^{1}} is compact.

Proof.

All by induction on bb, with compactness throughout in the pointed sense.

(1) The interpretation lands in Ord3\mathrm{Ord}_{3} by construction, each of its clauses preserving trichotomy: 𝟎\mathbf{0} is trichotomous, so is the successor of a trichotomous ordinal, and so is a sum over ω\omega of a family of trichotomous ordinals, such a sum being an ordinal by Lemma 5.16. Here ⟦−⟧Σ\llbracket-\rrbracket_{\Sigma} takes an ordinary ℕ\mathbb{N}-indexed sum, with nothing added at a limit.

(2) For compactness, the type 𝟏\mathbf{1} is compact pointed. The successor clause is a sum over 𝟏+𝟏\mathbf{1}+\mathbf{1}, so Corollary 4.10(2) applies. The limit clause is Theorem 4.32. For total separatedness, the type 𝟏\mathbf{1} is totally separated. The successor clause is a Σ\Sigma whose index type 𝟏+𝟏\mathbf{1}+\mathbf{1} is discrete, and total separatedness is closed under Σ\Sigma 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 ∞\infty is 𝟏\mathbf{1} by Lemma 4.31(2).

(3) 𝟏\mathbf{1} is compact pointed and the successor clause is a coproduct. The limit clause is the one place where the argument differs from (2), because ⟦𝖫​b⟧sup1\llbracket\mathsf{L}\,b\rrbracket_{\mathrm{sup}^{1}} is a supremum rather than a sum, and it is Theorem 5.31. ∎

Being trichotomous, ⟦b⟧Σ\llbracket b\rrbracket_{\Sigma} is discrete (Lemma 5.8).

Proposition 6.8.

If ⟦b⟧Σ\llbracket b\rrbracket_{\Sigma} is compact for every Brouwer code bb, then LPO\mathrm{LPO} holds.

Proof.

Apply the hypothesis to the code 𝖫(λi.𝖲𝖹)\mathsf{L}(\lambda i.\,\mathsf{S}\,\mathsf{Z}), whose interpretation is the sum over ω\omega of the constant family at 𝟎+𝟏\mathbf{0}\mathbin{+}\mathbf{1}, so that its underlying type is Σi:ℕ(𝟎+𝟏)\Sigma_{i:\mathbb{N}}\,(\mathbf{0}+\mathbf{1}). The first projection makes ℕ\mathbb{N} a retract of it, compactness is closed under retracts (Theorem 4.8(4)), and the compactness of ℕ\mathbb{N} is LPO\mathrm{LPO} (Examples 4.5(2)). ∎

Unlike ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} (Theorem 6.7(2)), the compact interpretation ⟦−⟧sup1\llbracket-\rrbracket_{\mathrm{sup}^{1}} fails to give totally separated ordinals constructively:

Proposition 6.9.

If ⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}^{1}} is totally separated for every Brouwer code bb, then ¬¬⁡WLPO\neg\neg\mathrm{WLPO} 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 II and a family β:I→Ord\beta:I\to\mathrm{Ord} such that II is compact pointed and totally separated, β​i\beta\,i is compact pointed and totally separated for every i:Ii:I, and the total separatedness of supβ\sup\beta implies ¬¬⁡WLPO\neg\neg\mathrm{WLPO}.

We may take I=ℕ∞I=\mathbb{N}_{\infty} and for β\beta the extension α¯\bar{\alpha} along ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} of the constant family α:ℕ→Ord\alpha:\mathbb{N}\to\mathrm{Ord} with value 𝟐\mathbf{2}. The proof, which requires a number of lemmas, uses the following explicit description of this supremum:

𝔰:≡supα¯.\mathfrak{s}\;:\equiv\;\sup\bar{\alpha}.

By Definition 4.30, since ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} is an embedding whose fiber over uu is the proposition that uu is finite,

α¯​u= 2u is finite.\bar{\alpha}\,u\;=\;\mathbf{2}^{\text{$u$ is finite}}.

Its elements are partial elements of 𝟐\mathbf{2}, with the finiteness of uu as domain of definition, so that 𝔰\mathfrak{s} 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,

∃u:ℕ∞(P≃u is finite),\textstyle\exists_{u:\mathbb{N}_{\infty}}\,\big(P\simeq\text{$u$ is finite}\big),

which is a proposition. Let

𝕊:≡ΣP:Ω𝒰0(P is semidecidable),t<𝕊t′:≡¬δt×δt′\mathbb{S}\;:\equiv\;\Sigma_{P:\Omega_{\mathcal{U}_{0}}}\,(\text{$P$ is semidecidable}),\qquad t\mathrel{<_{\mathbb{S}}}t^{\prime}\;:\equiv\;\neg\,\delta t\times\delta t^{\prime}

where δ\delta is the first projection, the domain of definition. Write ⊥𝕊\bot_{\mathbb{S}} and ⊤𝕊\top_{\mathbb{S}} for the elements given by 𝟎\mathbf{0} and 𝟏\mathbf{1}, which are semidecidable via ∞\infty and 00 respectively.

Lemma 6.12.

The relation <𝕊\mathrel{<_{\mathbb{S}}} is a well-order, so 𝕊\mathbb{S} 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 𝕊\mathbb{S} is a subtype of Ω𝒰0\Omega_{\mathcal{U}_{0}}, and hence two of its elements are equal exactly when their domains of definition are logically equivalent. In particular 𝕊\mathbb{S} is a set. The relation <𝕊\mathrel{<_{\mathbb{S}}} is proposition valued, being a product of two propositions, and transitive, since t<𝕊t′t\mathrel{<_{\mathbb{S}}}t^{\prime} and t′<𝕊t′′t^{\prime}\mathrel{<_{\mathbb{S}}}t^{\prime\prime} give ¬δ​t\neg\,\delta t from the first and δ​t′′\delta t^{\prime\prime} from the second. For extensionality, suppose tt and t′t^{\prime} have the same predecessors. If δ​t\delta t holds then ⊥𝕊<𝕊t\bot_{\mathbb{S}}\mathrel{<_{\mathbb{S}}}t, hence ⊥𝕊<𝕊t′\bot_{\mathbb{S}}\mathrel{<_{\mathbb{S}}}t^{\prime}, whose second component is δ​t′\delta t^{\prime}, and symmetrically. So the domains of definition are logically equivalent, and t=t′t=t^{\prime}. For well-foundedness, if u<𝕊v<𝕊tu\mathrel{<_{\mathbb{S}}}v\mathrel{<_{\mathbb{S}}}t then u<𝕊vu\mathrel{<_{\mathbb{S}}}v gives δ​v\delta v while v<𝕊tv\mathrel{<_{\mathbb{S}}}t gives ¬δ​v\neg\,\delta v, a contradiction, so no predecessor of tt has a predecessor, and every element of 𝕊\mathbb{S} is accessible after two steps. ∎

Lemma 6.13.

There is an order equivalence 𝔰≃o𝕊\mathfrak{s}\simeq_{o}\mathbb{S}.

Proof.

For each u:ℕ∞u:\mathbb{N}_{\infty} let θu:α¯​u→𝔰\theta_{u}:\bar{\alpha}\,u\to\mathfrak{s} 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 ξ\xi onto that of its value, so that 𝔰↓θu​ξ=α¯​u↓ξ\mathfrak{s}\mathbin{\downarrow}\theta_{u}\,\xi=\bar{\alpha}\,u\mathbin{\downarrow}\xi.

Send a partial element ξ:𝟐u finite\xi:\mathbf{2}^{\text{$u$ finite}} to the proposition ℱ​ξ:≡Σφ​ξ​φ=1\mathcal{F}\,\xi:\equiv\Sigma_{\varphi}\,\xi\,\varphi=1, that is, the proposition that ξ\xi is defined and takes the value 11. This is a proposition, because the finiteness of uu is a proposition and 𝟐\mathbf{2} is a set, and it is semidecidable, because from ξ\xi we build a decreasing binary sequence, whose value at ii is 11 before uu is known to satisfy u⊑iu\mathrel{\sqsubseteq}i, and is 11 minus the value of ξ\xi at the finiteness witness afterwards, hence a conatural number whose finiteness is equivalent to ℱ​ξ\mathcal{F}\,\xi. Writing 𝔽​ξ\mathbb{F}\,\xi for the resulting element of 𝕊\mathbb{S}, we check that 𝔽\mathbb{F} is order-preserving and that it depends on ξ\xi only through θu​ξ\theta_{u}\,\xi, so that it descends to the supremum. Since the θu\theta_{u}’s are jointly surjective and 𝕊\mathbb{S} is a set, there is a unique τ:𝔰→𝕊\tau:\mathfrak{s}\to\mathbb{S} with τ⁡(θu​ξ)=𝔽​ξ\tau\,(\theta_{u}\,\xi)=\mathbb{F}\,\xi. It is order-preserving, by joint surjectivity and the corresponding property of 𝔽\mathbb{F}. It is an initial segment inclusion, because an element of 𝕊\mathbb{S} below τ​y\tau\,y has empty domain of definition, so it is ⊥𝕊\bot_{\mathbb{S}}, and we exhibit a predecessor of yy mapping to ⊥𝕊\bot_{\mathbb{S}}, namely the image under θu\theta_{u} of the constantly 00 partial element, such a predecessor being unique because τ\tau is left cancellable at ⊥𝕊\bot_{\mathbb{S}}. So τ\tau is a simulation. It is surjective, for given (P,w)(P,w) with ww a witness of semidecidability, we may unpack ww, because being in the image is a truncated statement, to get uu with P≃(u finite)P\simeq(\text{$u$ finite}), and then the constantly 11 partial element of α¯​u\bar{\alpha}\,u is sent to (P,w)(P,w). So τ\tau is an order equivalence by Lemma 5.5. ∎

Lemma 6.14.

If some p:𝕊→𝟐p:\mathbb{S}\to\mathbf{2} has p⊥𝕊≠p⊤𝕊p\,\bot_{\mathbb{S}}\neq p\,\top_{\mathbb{S}}, then WLPO\mathrm{WLPO} holds. Consequently, if 𝕊\mathbb{S} is totally separated then ¬¬⁡WLPO\neg\neg\mathrm{WLPO} holds.

Proof.

Every u:ℕ∞u:\mathbb{N}_{\infty} gives an element of 𝕊\mathbb{S}, namely its own finiteness, which is semidecidable by definition. Write u^\hat{u} for this element. Then n¯^=⊤𝕊\widehat{\underline{n}}=\top_{\mathbb{S}} for every natural number nn, since a natural number is finite, and ∞^=⊥𝕊\widehat{\infty}=\bot_{\mathbb{S}}, since ∞\infty is not. So, given pp as in the statement, the composite q=(u↦p​u^):ℕ∞→𝟐q=(u\mapsto p\,\hat{u}):\mathbb{N}_{\infty}\to\mathbf{2} takes the constant value p⊤𝕊p\,\top_{\mathbb{S}} on the natural numbers and the different value p⊥𝕊p\,\bot_{\mathbb{S}} at ∞\infty. Composing with the complement if necessary, a matter decided by inspecting the two boolean values, we may assume that qq is constantly 00 on ℕ\mathbb{N} and takes the value 11 at ∞\infty. Such a map decides, for an arbitrary u:ℕ∞u:\mathbb{N}_{\infty}, whether u=∞u=\infty, by inspecting the value q​uq\,u, which if 00 gives u≠∞u\neq\infty and if 11 makes uu differ from every finite point, since a conatural number that is not finite is ∞\infty. That is WLPO\mathrm{WLPO} in the formulation of Definition 2.25.

For the second claim, assume 𝕊\mathbb{S} is totally separated and, for the sake of contradiction, that ¬WLPO\neg\mathrm{WLPO} holds. For any p:𝕊→𝟐p:\mathbb{S}\to\mathbf{2} we cannot have p⊥𝕊≠p⊤𝕊p\,\bot_{\mathbb{S}}\neq p\,\top_{\mathbb{S}}, by the first part. Deciding the two values, we conclude p⊥𝕊=p⊤𝕊p\,\bot_{\mathbb{S}}=p\,\top_{\mathbb{S}}. As this holds for every pp, total separatedness gives ⊥𝕊=⊤𝕊\bot_{\mathbb{S}}=\top_{\mathbb{S}}, which is a contradiction. So ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. ∎

Proof of Example 6.10.

Take I=ℕ∞I=\mathbb{N}_{\infty} and β=α¯\beta=\bar{\alpha}. Then ℕ∞\mathbb{N}_{\infty} is compact pointed (Examples 4.7(3)) and totally separated, being a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (Example 3.1), which is totally separated (Examples 3.13(3)), and total separatedness passing to retracts (Proposition 3.12(1)). Each α¯​u\bar{\alpha}\,u is 𝟐u finite\mathbf{2}^{\text{$u$ finite}}, 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 supα¯=𝔰\sup\bar{\alpha}=\mathfrak{s} is totally separated then so is 𝕊\mathbb{S}, by Lemma 6.13 and closure of total separatedness under equivalence (Proposition 3.12(1)), and then Lemma 6.14 gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. ∎

Proof of Proposition 6.9.

Apply the hypothesis to the code b=𝖫(λ_.𝖲𝖹)b=\mathsf{L}(\lambda\_.\,\mathsf{S}\,\mathsf{Z}). By Definition 6.6, we have that ⟦𝖲​𝖹⟧sup1=⟦𝖹⟧sup1+𝟏=𝟏+𝟏\llbracket\mathsf{S}\,\mathsf{Z}\rrbracket_{\mathrm{sup}^{1}}=\llbracket\mathsf{Z}\rrbracket_{\mathrm{sup}^{1}}\mathbin{+}\mathbf{1}=\mathbf{1}\mathbin{+}\mathbf{1}, which is 𝟐\mathbf{2}, and therefore ⟦b⟧sup1=supα¯=𝔰\llbracket b\rrbracket_{\mathrm{sup}^{1}}=\sup\bar{\alpha}=\mathfrak{s}, since ⟦−⟧sup1\llbracket-\rrbracket_{\mathrm{sup}^{1}} sends 𝖹\mathsf{Z} to 𝟏\mathbf{1} rather than to 𝟎\mathbf{0}. So 𝔰\mathfrak{s} is totally separated, and Lemmas 6.13 and 6.14 give ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. ∎

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 Ord\mathrm{Ord} monotone and to turn an order-preserving map between ordinals into ≤\mathrel{\leq}. A fifth interpretation follows in Section 6.4, related to ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} 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 bb:

standard⟦b⟧sup\llbracket b\rrbracket_{\mathrm{sup}}≤\mathrel{\leq}⟦b⟧Σ\llbracket b\rrbracket_{\Sigma}trichotomouscompact⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}^{1}}≤\mathrel{\leq}⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}}compact totally separated.⩽\mathrel{\rotatebox[origin={c}]{-90.0}{$\leqslant$}}⩽\mathrel{\rotatebox[origin={c}]{-90.0}{$\leqslant$}}

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 bb. All three use excluded middle at 𝖲\mathsf{S}, for monotonicity of the successor operation on ordinals , and the top row and the bottom row use it again at 𝖫\mathsf{L}, 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 ≤\mathrel{\leq}, applied to the map y↦(x,y)y\mapsto(x,y) 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 𝖹\mathsf{Z} both sides are 𝟎\mathbf{0}. At 𝖲\mathsf{S}, apply monotonicity of the successor to the induction hypothesis. At 𝖫\mathsf{L}, the supremum is monotone in its family, so supi⟦b​i⟧sup≤supi⟦b​i⟧Σ\sup_{i}\llbracket b\,i\rrbracket_{\mathrm{sup}}\mathrel{\leq}\sup_{i}\llbracket b\,i\rrbracket_{\Sigma}, and a supremum is bounded by the corresponding sum, which ⟦𝖫​b⟧Σ\llbracket\mathsf{L}\,b\rrbracket_{\Sigma} takes.

The left-hand column.The same shape, with one extra step at 𝖫\mathsf{L}, where the family being summed on the right is the extension of the family n↦⟦b​n⟧sup1n\mapsto\llbracket b\,n\rrbracket_{\mathrm{sup}^{1}} along ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}, so we first rewrite its value at n¯\underline{n} as ⟦b​n⟧sup1\llbracket b\,n\rrbracket_{\mathrm{sup}^{1}} using the extension property (Lemma 4.31 (1)), compare suprema over ℕ\mathbb{N}, and then observe that the supremum over ℕ\mathbb{N} of a family restricted along ι\iota is bounded by the supremum over all of ℕ∞\mathbb{N}_{\infty}. At 𝖹\mathsf{Z} the inequality is 𝟎≤𝟏\mathbf{0}\mathrel{\leq}\mathbf{1}, the zero ordinal being least.

The bottom row.Again the same, using at 𝖫\mathsf{L} that extension along an embedding preserves ≤\mathrel{\leq} 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 𝖲\mathsf{S} 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 ⟦b⟧Σ→⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma}\to\llbracket b\rrbracket_{\Sigma^{1}} by induction on bb and show that it is order-preserving, and then excluded middle turns an order-preserving map between ordinals into ≤\mathrel{\leq}. At 𝖹\mathsf{Z} the source is empty. At 𝖲\mathsf{S} the two summands go to the two summands. At 𝖫\mathsf{L} the pair (i,x)(i,x) goes to ι​i\iota\,i paired with the partial element that sends a fiber element (j,p)(j,p) of ι\iota over ι​i\iota\,i to the recursively defined value at xx, transported along the identification j=ij=i supplied by left cancellability of ι\iota. Order preservation is a routine induction. ∎

Proposition 6.16.
  1. (1)

    If the relation ⟦b⟧sup≤⟦b⟧Σ\llbracket b\rrbracket_{\mathrm{sup}}\mathrel{\leq}\llbracket b\rrbracket_{\Sigma} holds for every Brouwer code bb, then LPO\mathrm{LPO} holds.

  2. (2)

    If the relation ⟦b⟧sup1≤⟦b⟧Σ1\llbracket b\rrbracket_{\mathrm{sup}^{1}}\mathrel{\leq}\llbracket b\rrbracket_{\Sigma^{1}} holds for every Brouwer code bb, then ¬¬⁡WLPO\neg\neg\mathrm{WLPO} 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 LPO\mathrm{LPO}.

(2) An embedding into a totally separated type is totally separated. Since ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is totally separated (Theorem 6.7(2)), ⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}^{1}} is totally separated for every code, and Proposition 6.9 gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. ∎

Question 6.17.

Do each of the remaining two comparisons, namely the relation ⟦b⟧sup≤⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}}\mathrel{\leq}\llbracket b\rrbracket_{\mathrm{sup}^{1}} for every code bb, and the relation ⟦b⟧Σ≤⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma}\mathrel{\leq}\llbracket b\rrbracket_{\Sigma^{1}} for every code bb, imply a constructive taboo?

6.4. A fifth interpretation

Our fifth interpretation is a modification of the trichotomous interpretation ⟦−⟧Σ\llbracket-\rrbracket_{\Sigma} of Definition 6.6, mapping 𝖹\mathsf{Z} to the ordinal 𝟏\mathbf{1}, rather than 𝟎\mathbf{0}, and 𝖫\mathsf{L} to Σ1\Sigma_{1} in order to match the compact totally separated interpretation ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} and be able to get Theorem 6.23(2).

Definition 6.18.

We define an interpretation function

⟦−⟧Σ1:B→Ord⊤(alternative trichotomous interpretation)\llbracket-\rrbracket_{\Sigma_{1}}:\mathrm{B}\to\mathrm{Ord}^{\top}\qquad\text{(alternative trichotomous interpretation)}

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:

𝖹\mathsf{Z} 𝖲\mathsf{S} 𝖫\mathsf{L}
⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} 𝟏\mathbf{1} (−)+𝟏(-)\mathbin{+}\mathbf{1} Σ1\Sigma^{1}
⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma_{1}} 𝟏\mathbf{1} (−)+𝟏(-)\mathbin{+}\mathbf{1} Σ1\Sigma_{1}

Here Σ1\Sigma^{1} and Σ1\Sigma_{1} are the extended sum and the successor sum of Definition 5.25.

Theorem 6.19.

For every Brouwer code bb,

  1. (1)

    the ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is trichotomous,

  2. (2)

    the ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is compact,

  3. (3)

    the underlying type of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is a retract of ℕ\mathbb{N}, hence discrete,

  4. (4)

    the underlying type of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}}, hence totally separated.

Notice that (1) gives an alternative route to the discreteness of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} (Lemma 5.8), whereas (2) does not follow from (4), the compactness of 𝟐ℕ\mathbf{2}^{\mathbb{N}} being independent of our type theory (Remark 4.12).

Proof.

(1) By induction on bb. For 𝖹\mathsf{Z} the one-point ordinal is trichotomous. For 𝖲\mathsf{S}, ordinal addition τ+υ\tau\mathbin{+}\upsilon is not a coproduct here but the ordinal-indexed sum over the ordinal 𝟐\mathbf{2} of the two-element family, whose index type is 𝟏+𝟏\mathbf{1}+\mathbf{1} (Section 5.3), and trichotomy is closed under ordinal-indexed sums, the index 𝟐\mathbf{2} being trichotomous. For 𝖫\mathsf{L}, the successor sum must preserve trichotomy. Unfolding Σ1\Sigma_{1} as the sum over ω+𝟏\omega\mathbin{+}\mathbf{1} of the extension of the family along ℕ↪ℕ+𝟏\mathbb{N}\hookrightarrow\mathbb{N}+\mathbf{1}, 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 ℕ↪ℕ+𝟏\mathbb{N}\hookrightarrow\mathbb{N}+\mathbf{1} 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 𝟏\mathbf{1}. The fiber is decidable, being either a singleton or empty according to the two cases of ℕ+𝟏\mathbb{N}+\mathbf{1}. Here the two interpretations differ. For Σ1\Sigma^{1} the corresponding fibers are those of ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty}, whose decidability is exactly LPO\mathrm{LPO}, 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 𝖹\mathsf{Z} and 𝖲\mathsf{S}, and Theorem 4.32 for 𝖫\mathsf{L}.

(3) We show by induction on bb that ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is a retract of ℕ\mathbb{N}. For 𝖹\mathsf{Z} the underlying type is 𝟏\mathbf{1}, a retract of ℕ\mathbb{N}. For 𝖲\mathsf{S}, use that being a retract of ℕ\mathbb{N} is closed under Σ\Sigma, in the sense that if τ\tau and every υ​x\upsilon\,x are retracts of ℕ\mathbb{N}, then so is Σx​υ​x\Sigma_{x}\upsilon\,x, being a retract of ℕ×ℕ\mathbb{N}\times\mathbb{N}, which is a retract of ℕ\mathbb{N} by a pairing function ; the index type 𝟏+𝟏\mathbf{1}+\mathbf{1} of the addition is a retract of ℕ\mathbb{N} by sending 00 to the left point and every successor to the right one. For 𝖫\mathsf{L}, the interpretation is a successor sum, whose underlying type is a retract of ℕ\mathbb{N} as soon as those of the summands are, by Lemma 5.26(2). Discreteness follows since ℕ\mathbb{N} is discrete and discreteness is closed under retracts.

(4) Likewise by induction, we show that ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}}. For 𝖹\mathsf{Z}, the type 𝟏\mathbf{1} is a retract of any pointed type. For 𝖲\mathsf{S}, we use that 𝟐ℕ+𝟐ℕ\mathbf{2}^{\mathbb{N}}+\mathbf{2}^{\mathbb{N}} is a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (split on the first digit and pass to the tail), and being a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} is closed under ++ . For 𝖫\mathsf{L}, the induction hypothesis gives, for each i:ℕi:\mathbb{N}, a section si:⟦b​i⟧Σ1→𝟐ℕs_{i}:\llbracket b\,i\rrbracket_{\Sigma^{1}}\to\mathbf{2}^{\mathbb{N}} with retraction ρi\rho_{i}. By Lemma 4.35, the extension along ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} of the family i↦⟦b​i⟧Σ1i\mapsto\llbracket b\,i\rrbracket_{\Sigma^{1}} is pointwise a retract of the extension of the constant family at 𝟐ℕ\mathbf{2}^{\mathbb{N}}, and hence the extended sum ⟦𝖫​b⟧Σ1\llbracket\mathsf{L}\,b\rrbracket_{\Sigma^{1}} 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 𝟐ℕ\mathbf{2}^{\mathbb{N}}, and in particular a retract of it. Compositions of retracts are retracts.

Total separatedness now follows without a further induction, because 𝟐ℕ\mathbf{2}^{\mathbb{N}} 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 𝟐ℕ\mathbf{2}^{\mathbb{N}}, but a direct induction also works, and the discreteness of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is likewise obtained through ℕ\mathbb{N}, but also follows directly by induction on bb using Proposition 3.6, without passing through ℕ\mathbb{N}. Addition is a sum over the discrete index 𝟏+𝟏\mathbf{1}+\mathbf{1}, and total separatedness is closed under Σ\Sigma over a discrete index (Proposition 3.12). The index ℕ∞\mathbb{N}_{\infty} of the extended sum is not discrete, its discreteness being WLPO\mathrm{WLPO} (Examples 3.3), but Lemma 3.14 applies, the fiber at ∞\infty being 𝟏\mathbf{1}. That is the route taken in Theorem 6.7. Closure under Σ\Sigma fails in general (Examples 3.13(1)), and being a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} 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. (1)

    The statement that ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is compact for every Brouwer code bb is equivalent to LPO\mathrm{LPO}.

  2. (2)

    If ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} is discrete for every Brouwer code bb, then WLPO\mathrm{WLPO} holds.

Proof.

For the forward implications, apply the hypotheses to b=𝖫(λi.𝖹)b=\mathsf{L}(\lambda i.\,\mathsf{Z}), the code of Example 6.24, whose discrete interpretation is ω+𝟏\omega\mathbin{+}\mathbf{1} with underlying type ℕ+𝟏\mathbb{N}+\mathbf{1} and whose compact one is ℕ∞\mathbb{N}_{\infty} with underlying type ℕ∞\mathbb{N}_{\infty}.

Compactness of ℕ+𝟏\mathbb{N}+\mathbf{1} gives compactness of ℕ\mathbb{N}, a retract of it (Theorem 4.8(4)), which is LPO\mathrm{LPO} (Examples 4.5(2)), and discreteness of ℕ∞\mathbb{N}_{\infty} is WLPO\mathrm{WLPO} (Examples 3.3). Conversely, LPO\mathrm{LPO} makes ℕ\mathbb{N} compact, and ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is a retract of ℕ\mathbb{N} for every bb (Theorem 6.19(3)). ∎

So the trichotomy of Theorem 6.19(1) has no counterpart for ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}}, since trichotomy implies discreteness (Lemma 5.8).

Definition 6.22 (The comparison map).

The map ιb:⟦b⟧Σ1→⟦b⟧Σ1\iota_{b}:\llbracket b\rrbracket_{\Sigma_{1}}\to\llbracket b\rrbracket_{\Sigma^{1}} is defined by induction on bb as follows:

ι𝖹=idι𝖲​b(inl⋆,y)=(inl⋆,ιby)ι𝖲​b(inr⋆,y)=(inr⋆,y)ι𝖫​b=𝔠υ∘Σ1​(i↦ιb​i),\begin{array}[]{l}\iota_{\mathsf{Z}}=\mathrm{id}\\[1.72218pt] \iota_{\mathsf{S}\,b}\,(\mathrm{inl}\,\star,y)=(\mathrm{inl}\,\star,\iota_{b}\,y)\\[1.72218pt] \iota_{\mathsf{S}\,b}\,(\mathrm{inr}\,\star,y)=(\mathrm{inr}\,\star,y)\\[1.72218pt] \iota_{\mathsf{L}\,b}=\mathfrak{c}_{\upsilon}\circ\Sigma_{1}\big(i\mapsto\iota_{b\,i}\big),\end{array}

where 𝔠υ\mathfrak{c}_{\upsilon} is the comparison map of Definition 5.27 for the family υ​i=⟦b​i⟧Σ1\upsilon\,i=\llbracket b\,i\rrbracket_{\Sigma^{1}}.

Theorem 6.23.

For every Brouwer code bb, the map ιb:⟦b⟧Σ1→⟦b⟧Σ1\iota_{b}:\llbracket b\rrbracket_{\Sigma_{1}}\to\llbracket b\rrbracket_{\Sigma^{1}} is

  1. (1)

    an embedding,

  2. (2)

    extremely dense,

  3. (3)

    order-preserving,

  4. (4)

    order-reflecting.

Proof.

The four properties are established by induction on bb, with the induction for the embedding property simultaneous with the order-reflection property. At 𝖹\mathsf{Z} the map is the identity. At 𝖲\mathsf{S} 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 𝖫\mathsf{L}, the family of maps ιb​i\iota_{b\,i} induces a map between the successor sums, namely inl⁡(i,x)↦inl⁡(i,ιb​i​x)\mathrm{inl}\,(i,x)\mapsto\mathrm{inl}\,(i,\iota_{b\,i}\,x) and inr⋆↦inr⋆\mathrm{inr}\,\star\mapsto\mathrm{inr}\,\star, which preserves all four properties fiberwise, and the comparison map 𝔠υ\mathfrak{c}_{\upsilon} for the family υ​i=⟦b​i⟧Σ1\upsilon\,i=\llbracket b\,i\rrbracket_{\Sigma^{1}} has all four (Lemma 5.28), so the composite does too, being extremely dense and being an embedding both closed under composition. The map 𝔠υ\mathfrak{c}_{\upsilon} 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 b=𝖫(λi.𝖹)b=\mathsf{L}(\lambda i.\,\mathsf{Z}), 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 𝟏\mathbf{1},

⟦b⟧Σ1=Σ1(i↦𝟏)≃o(ω+𝟏),⟦b⟧Σ1=Σ1(i↦𝟏)≃oℕ∞,\llbracket b\rrbracket_{\Sigma_{1}}=\Sigma_{1}\big(i\mapsto\mathbf{1}\big)\simeq_{o}\big(\omega\mathbin{+}\mathbf{1}\big),\qquad\llbracket b\rrbracket_{\Sigma^{1}}=\Sigma^{1}\big(i\mapsto\mathbf{1}\big)\simeq_{o}\mathbb{N}_{\infty},

the summands being one-point ordinals and a sum of those being its own index, so the discrete side is ℕ+𝟏\mathbb{N}+\mathbf{1} with its added point isolated, because the point of 𝟏\mathbf{1} is isolated and inr\mathrm{inr} preserves isolatedness (Proposition 3.6(1)), the compact side is ℕ∞\mathbb{N}_{\infty} with its added point ∞\infty a limit (Section 5.4), and ιb\iota_{b} is the inclusion ℕ+𝟏↪ℕ∞\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty} that sends the added point to ∞\infty.

The ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} is discrete and a retract of ℕ\mathbb{N}, but it is compact exactly when LPO\mathrm{LPO} holds, since ℕ\mathbb{N} is (Examples 4.5). The ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} 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 WLPO\mathrm{WLPO} 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 ιb\iota_{b} consists of the sequences 1n​0ω1^{n}0^{\omega} and the sequence 1ω1^{\omega}. Extreme density of ιb\iota_{b} 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 LPO\mathrm{LPO}.

Proposition 6.25.

The statement that ιb\iota_{b} is an equivalence for every Brouwer code bb is equivalent to LPO\mathrm{LPO}.

Proof.

For the forward direction, apply the hypothesis to the code 𝖫(λi.𝖹)\mathsf{L}(\lambda i.\,\mathsf{Z}), where ιb\iota_{b} is the inclusion ℕ+𝟏↪ℕ∞\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty}, which is an equivalence exactly when LPO\mathrm{LPO} holds (Example 6.24). Conversely, assume LPO\mathrm{LPO} and induct on bb, following the clauses of Definition 6.22. At 𝖹\mathsf{Z} the map is the identity. At 𝖲​b\mathsf{S}\,b 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 𝖫​b\mathsf{L}\,b the map between the successor sums induced by the family ιb​i\iota_{b\,i} is an equivalence by the induction hypothesis, and 𝔠υ\mathfrak{c}_{\upsilon} is one because LPO\mathrm{LPO} makes ι1\iota_{1} an equivalence, the maps eze_{z} being equivalences anyway (Lemma 5.28). ∎

6.5. The least element property

The compact ordinals ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} 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 XX carry a relation ≤\leq. A complemented subset of XX is given by its characteristic function p:X→𝟐p:X\to\mathbf{2}, whose roots are its elements. Say that XX has infima of complemented subsets if for every pp there is a point x0:Xx_{0}:X that is

  1. (1)

    a conditional root: if pp has a root at all then x0x_{0} is one,

  2. (2)

    the infimum of the roots: x0≤xx_{0}\leq x for every root xx, and l≤x0l\leq x_{0} for every ll that is below all roots.

For a topped ordinal τ\tau this is taken with respect to the weak order x≤y:≡¬(y<x)x\leq y:\equiv\neg\,(y\mathrel{<}x).

Remark 6.27.

Having infima of complemented subsets is a strengthening of pointed compactness, since clause (1) alone already gives it. Given pp, take the conditional root x0x_{0} as a universal witness. If p​x0=1p\,x_{0}=1 then pp has no root, since a root would force p​x0=0p\,x_{0}=0, and a 𝟐\mathbf{2}-valued function with no root is constantly 11.

Lemma 6.28 (Least element property).

Let XX have infima of complemented subsets with respect to a relation ≤\leq. Then every non-empty complemented subset of XX has a least element, that is, a member below all members.

Proof.

Let pp be the characteristic function of the subset and x0x_{0} the point supplied by Definition 6.26. Having infima gives compactness, so we can decide whether pp has a root, and non-emptiness rules out the absence of one. So pp has a root, and then x0x_{0} 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 XX be a proposition, Y:X→𝒰Y:X\to\mathcal{U} a family, and, for each x:Xx:X, let <{\mathrel{<}} be an arbitrary relation on Y​xY\,x, with associated relation y≤y′:≡¬(y′<y)y\leq y^{\prime}:\equiv\neg\,(y^{\prime}\mathrel{<}y). Give ∏xY​x\prod_{x}Y\,x the pointwise-derived relation

φ≤γ:≡¬Σx:Xγx<φx.\varphi\leq\gamma\;:\equiv\;\neg\,\Sigma_{x:X}\,\gamma\,x\mathrel{<}\varphi\,x.

If every Y​xY\,x has infima of <{\mathrel{<}}-complemented subsets, in the sense of Definition 6.26, then so does ∏xY​x\prod_{x}Y\,x.

Proof.

The construction of the witness is the same as in Theorem 4.26. Given a complemented family on ∏xY​x\prod_{x}Y\,x, transport it along the evaluation equivalences fxf_{x} available at each x:Xx:X, take the infimum φ0​x\varphi_{0}\,x within Y​xY\,x, and assemble these pointwise. If pp has a root γ\gamma, then each transported γ​x\gamma\,x is a root in Y​xY\,x, so the infimum φ0​x\varphi_{0}\,x is a root there, and since fx−1​(φ0​x)=φ0f_{x}^{-1}(\varphi_{0}\,x)=\varphi_{0}, this gives p​φ0=0p\,\varphi_{0}=0, so that φ0\varphi_{0} is a conditional root. It remains to show that φ0\varphi_{0} is the infimum for the pointwise-derived relation.

To see that φ0\varphi_{0} is a lower bound, note that if γ\gamma is a root, then for each xx the transported γ\gamma is a root in Y​xY\,x, so φ0​x≤γ​x\varphi_{0}\,x\leq\gamma\,x, and φ0≤γ\varphi_{0}\leq\gamma was defined to be ¬Σx:Xγx<φ0x\neg\,\Sigma_{x:X}\,\gamma\,x\mathrel{<}\varphi_{0}\,x, which follows.

To see that it is greatest among lower bounds, let ψ\psi be below every root. We must show ψ≤φ0\psi\leq\varphi_{0}, which by definition rules out φ0​x<ψ​x\varphi_{0}\,x\mathrel{<}\psi\,x for every xx, so suppose that this holds at some xx. Every root of the transported family at that xx is the value at xx of a root of the original family, and ψ\psi is below the latter, so ψ​x\psi\,x is below the former. Thus ψ​x\psi\,x is below all roots of the transported family, and φ0​x\varphi_{0}\,x is their infimum, so ψ​x≤φ0​x\psi\,x\leq\varphi_{0}\,x, contradicting the supposition. ∎

Theorem 6.30.

For every Brouwer code bb, the topped ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} has infima of complemented subsets.

Proof.

By induction on bb, 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 𝖹\mathsf{Z}, the one-point ordinal has infima, since the unique point is a conditional root and trivially the infimum. For 𝖲\mathsf{S}, use that having infima of complemented subsets is closed under ordinal-indexed sums, in the sense that if τ\tau has them and every υ​x\upsilon\,x does, then so does Στ​υ\Sigma_{\tau}\upsilon, the infimum being computed lexicographically. That is, first the infimum in the base of those xx 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 𝟐\mathbf{2} indexing the addition has infima by inspection of its two points.

For 𝖫\mathsf{L}, unfold Σ1\Sigma^{1} as the sum over the ordinal ℕ∞\mathbb{N}_{\infty} of the extension along ℕ↪ℕ∞\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} and apply the same closure property. Two things are needed. First, the ordinal ℕ∞\mathbb{N}_{\infty} 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 bb, every non-empty complemented subset of the ordinal ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} 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 ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} has a least element, for every Brouwer code bb, is equivalent to LPO\mathrm{LPO}.

Proof.

For the forward implication, take b=𝖫(λi.𝖹)b=\mathsf{L}(\lambda i.\,\mathsf{Z}), whose discrete interpretation is ω+𝟏\omega\mathbin{+}\mathbf{1} with underlying type ℕ+𝟏\mathbb{N}+\mathbf{1} (Example 6.24). Given α:ℕ→𝟐\alpha:\mathbb{N}\to\mathbf{2}, consider the complemented subset with characteristic function

p(inln)=αn,p(inr⋆)=0.p\,(\mathrm{inl}\,n)=\alpha\,n,\qquad p\,(\mathrm{inr}\,\star)=0.

It contains the added point, so it is non-empty, and its least element x0x_{0} is either inl​n\mathrm{inl}\,n for some nn, in which case α​n=0\alpha\,n=0, or the added point, in which case no inl​n\mathrm{inl}\,n is a member, since membership would give x0≤inl​nx_{0}\leq\mathrm{inl}\,n, that is, ¬(inln<inr⋆)\neg(\mathrm{inl}\,n\mathrel{<}\mathrm{inr}\,\star). Inspection of x0x_{0} tells the two cases apart, and they decide whether α\alpha has a root, which is compactness of ℕ\mathbb{N}, equivalently LPO\mathrm{LPO} (Examples 4.5(2)).

Conversely, LPO\mathrm{LPO} makes ιb\iota_{b} an equivalence (Proposition 6.25), and it is order-preserving and order-reflecting (Theorem 6.23), so ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}} and ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} are order equivalent. Every non-empty complemented subset of ⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}} has a least element, and this property transfers along the isomorphism. ∎

Remark 6.33.

The forward implication needs only the single code 𝖫(λi.𝖹)\mathsf{L}(\lambda i.\,\mathsf{Z}), 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 𝖫\mathsf{L} is always indexed by ℕ\mathbb{N}. We now let the branching of a sum be indexed by an ordinal built at an earlier stage, which requires defining the type E\mathrm{E} of codes and their standard interpretation Δ\Delta simultaneously by induction-recursion in the sense of [9, 10, 11]. The codes carry a further interpretationd K\mathrm{K}, with an extremely dense embedding Δ​ν↪K​ν\Delta\nu\hookrightarrow\mathrm{K}\nu for every code ν:E\nu:\mathrm{E} (Theorem 7.5(2)). The Brouwer codes embed into E\mathrm{E}, with the inclusion making ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma_{1}} commute with Δ\Delta, and ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} with K\mathrm{K} (Theorem 7.10). The interpretation Δ\Delta gives trichotomous and hence discrete ordinals (Theorem 7.2), and K\mathrm{K} gives compact ordinals with infima of complemented subsets (Theorem 7.5). The compact interpretation K\mathrm{K}, 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 (E\mathrm{E} and Δ\Delta).

We define, by induction-recursion, a type E\mathrm{E} of ordinal expressions by the constructors

⌜​𝟏​⌝,⌜​ω+𝟏​⌝:E,⌜+⌝,⌜×⌝:E→E→E,\ulcorner\mathbf{1}\urcorner,\ulcorner\omega{+}\mathbf{1}\urcorner:\mathrm{E},\qquad\mathbin{\ulcorner{+}\urcorner},\mathbin{\ulcorner{\times}\urcorner}:\mathrm{E}\to\mathrm{E}\to\mathrm{E},
⌜Σ⌝:∏ν:E((Δν→E)→E),\ulcorner\Sigma\urcorner:\textstyle\prod_{\nu:\mathrm{E}}\,\big((\Delta\nu\to\mathrm{E})\to\mathrm{E}\big),

simultaneously with the standard, discrete interpretation Δ:E→Ord⊤\Delta:\mathrm{E}\to\mathrm{Ord}^{\top}, by

Δ​⌜​𝟏​⌝\displaystyle\Delta\,\ulcorner\mathbf{1}\urcorner =𝟏\displaystyle=\mathbf{1} Δ​⌜​ω+𝟏​⌝\displaystyle\Delta\,\ulcorner\omega{+}\mathbf{1}\urcorner =ω+𝟏\displaystyle=\omega\mathbin{+}\mathbf{1}
Δ⁡(ν0⌜+⌝ν1)\displaystyle\Delta\,(\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}) =Δ​ν0+Δ​ν1\displaystyle=\Delta\nu_{0}\mathbin{+}\Delta\nu_{1} Δ⁡(ν0⌜×⌝ν1)\displaystyle\Delta\,(\nu_{0}\mathbin{\ulcorner{\times}\urcorner}\nu_{1}) =ΣΔ​ν0(λ_.Δν1)\displaystyle=\Sigma_{\Delta\nu_{0}}(\lambda\_.\,\Delta\nu_{1})
Δ⁡(⌜​Σ​⌝​ν​A)\displaystyle\Delta\,(\ulcorner\Sigma\urcorner\,\nu\,A) =ΣΔ​ν​(Δ∘A).\displaystyle=\Sigma_{\Delta\nu}(\Delta\circ A).
Theorem 7.2.

For every ν:E\nu:\mathrm{E}, the underlying type of Δ​ν\Delta\nu is a retract of ℕ\mathbb{N}, hence discrete, and moreover the ordinal Δ​ν\Delta\nu is trichotomous.

Proof.

By induction on ν\nu, which for an inductive-recursive definition means induction by the elimination principle of E\mathrm{E}, in which the hypothesis for ⌜​Σ​⌝​ν​A\ulcorner\Sigma\urcorner\,\nu\,A may use the already-available value Δ​ν\Delta\nu in order to speak about the index type Δ​ν\Delta\nu of AA.

For ⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner the underlying type is 𝟏\mathbf{1}. For ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner it is ℕ+𝟏\mathbb{N}+\mathbf{1}, which is equivalent to ℕ\mathbb{N}. The underlying type of an addition is a binary sum (Definition 5.9), that is, a Σ\Sigma over the index type 𝟏+𝟏\mathbf{1}+\mathbf{1}, and that of a multiplication is a Σ\Sigma over a constant family (Definition 5.13), so the cases ⌜+⌝\mathbin{\ulcorner{+}\urcorner} and ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} are, as in the proof of Theorem 6.19(3), instances of the closure of “being a retract of ℕ\mathbb{N}” under Σ\Sigma, the index type 𝟏+𝟏\mathbf{1}+\mathbf{1} being a retract of ℕ\mathbb{N}. So is the case ⌜​Σ​⌝​ν​A\ulcorner\Sigma\urcorner\,\nu\,A, where Δ⁡(⌜​Σ​⌝​ν​A)\Delta(\ulcorner\Sigma\urcorner\,\nu\,A) is the plain ordinal-indexed sum ΣΔ​ν​(Δ∘A)\Sigma_{\Delta\nu}(\Delta\circ A), with no extension, whose base Δ​ν\Delta\nu and fibers Δ⁡(A​x)\Delta(A\,x) are retracts of ℕ\mathbb{N} by the induction hypothesis. Restricting the branching to a discrete ordinal keeps the sum countable. Discreteness then follows because ℕ\mathbb{N} 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 𝟏\mathbf{1} is trichotomous, that ω\omega 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 Δ​ν\Delta\nu, 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 LPO\mathrm{LPO}:

  1. (1)

    the type Δ​ν\Delta\nu is compact for every code ν:E\nu:\mathrm{E},

  2. (2)

    every non-empty complemented subset of Δ​ν\Delta\nu has a least element, for every code ν:E\nu:\mathrm{E}.

Proof.

(1) Under LPO\mathrm{LPO} the type ℕ\mathbb{N} is compact (Examples 4.5(2)), and Δ​ν\Delta\nu 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 ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner suffices, since Δ​⌜​ω+𝟏​⌝\Delta\ulcorner\omega{+}\mathbf{1}\urcorner is ℕ+𝟏\mathbb{N}+\mathbf{1}, which has ℕ\mathbb{N} as a retract, so the same closure property gives the compactness of ℕ\mathbb{N}, which is LPO\mathrm{LPO}.

(2) The proof is that of Proposition 6.32. In the forward implication the single code ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner takes the place of 𝖫(λi.𝖹)\mathsf{L}(\lambda i.\,\mathsf{Z}), its discrete interpretation being ω+𝟏\omega\mathbin{+}\mathbf{1}. In the converse, LPO\mathrm{LPO} makes ιν\iota_{\nu} an equivalence (Proposition 7.7(1)), and it is order-preserving and order-reflecting (Theorem 7.5(2)), so Δ​ν\Delta\nu and K​ν\mathrm{K}\nu are order equivalent, and the least element property transfers along the order equivalence. ∎

7.2. The compact interpretation

Definition 7.4 (K\mathrm{K} and ιν\iota_{\nu}).

We simultaneously define

K:E→Ord⊤,ιν:Δ​ν→K​ν\begin{array}[]{lll}\mathrm{K}&:&E\to\mathrm{Ord}^{\top},\\ \iota_{\nu}&:&\Delta\nu\to\mathrm{K}\nu\end{array}

and prove by induction that ιν\iota_{\nu} is an embedding as follows. For a code ν:E\nu:\mathrm{E} and A:Δ​ν→EA:\Delta\nu\to\mathrm{E}, write (K∘A)/ιν(\mathrm{K}\circ A)\mathbin{/}\iota_{\nu} for the extension along ιν:Δ​ν↪K​ν\iota_{\nu}:\Delta\nu\hookrightarrow\mathrm{K}\nu of K∘A:Δ​ν→Ord⊤\mathrm{K}\circ A:\Delta\nu\to\mathrm{Ord}^{\top} to a family K​ν→Ord⊤\mathrm{K}\nu\to\mathrm{Ord}^{\top}, as illustrated in the following diagram :

Δ​ν{\lx@inpgf@ignorespaces\Delta\nu}K​ν{\lx@inpgf@ignorespaces\mathrm{K}\nu}E{\lx@inpgf@ignorespaces\mathrm{E}}Ord⊤.{\lx@inpgf@ignorespaces\mathrm{Ord}^{\top}.}ιν\scriptstyle{\lx@inpgf@ignorespaces\iota_{\nu}}A\scriptstyle{\lx@inpgf@ignorespaces A}(K∘A)/ιν\scriptstyle{\lx@inpgf@ignorespaces(\mathrm{K}\circ A)\mathbin{/}\iota_{\nu}}K\scriptstyle{\lx@inpgf@ignorespaces\mathrm{K}}

We define K:E→Ord⊤\mathrm{K}:\mathrm{E}\to\mathrm{Ord}^{\top} and ιν:Δ​ν→K​ν\iota_{\nu}:\Delta\nu\to\mathrm{K}\nu by

K​⌜​𝟏​⌝\displaystyle\mathrm{K}\,\ulcorner\mathbf{1}\urcorner =𝟏\displaystyle=\mathbf{1} K​⌜​ω+𝟏​⌝\displaystyle\mathrm{K}\,\ulcorner\omega{+}\mathbf{1}\urcorner =ℕ∞\displaystyle=\mathbb{N}_{\infty}
K⁡(ν0⌜+⌝ν1)\displaystyle\mathrm{K}\,(\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}) =K​ν0+K​ν1\displaystyle=\mathrm{K}\nu_{0}\mathbin{+}\mathrm{K}\nu_{1} K⁡(ν0⌜×⌝ν1)\displaystyle\mathrm{K}\,(\nu_{0}\mathbin{\ulcorner{\times}\urcorner}\nu_{1}) =ΣK​ν0(λ_.Kν1)\displaystyle=\Sigma_{\mathrm{K}\nu_{0}}(\lambda\_.\,\mathrm{K}\nu_{1})
K⁡(⌜​Σ​⌝​ν​A)\displaystyle\mathrm{K}\,(\ulcorner\Sigma\urcorner\,\nu\,A) =ΣK​ν​((K∘A)/ιν)\displaystyle=\Sigma_{\mathrm{K}\nu}\big((\mathrm{K}\circ A)\mathbin{/}\iota_{\nu}\big)
ι⌜​𝟏​⌝\displaystyle\iota_{\ulcorner\mathbf{1}\urcorner} =id\displaystyle=\mathrm{id} ι⌜​ω+𝟏​⌝\displaystyle\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner} =ι𝟏\displaystyle=\iota_{\mathbf{1}}
ιν0⌜+⌝ν1(inl⋆,y)\displaystyle\iota_{\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}}\,(\mathrm{inl}\,\star,\,y) =(inl⋆,ιν0y)\displaystyle=(\mathrm{inl}\,\star,\,\iota_{\nu_{0}}\,y) ιν0⌜×⌝ν1​(x,y)\displaystyle\iota_{\nu_{0}\mathbin{\ulcorner{\times}\urcorner}\nu_{1}}\,(x,\,y) =(ιν0​x,ιν1​y)\displaystyle=(\iota_{\nu_{0}}\,x,\,\iota_{\nu_{1}}\,y)
ιν0⌜+⌝ν1(inr⋆,y)\displaystyle\iota_{\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}}\,(\mathrm{inr}\,\star,\,y) =(inr⋆,ιν1y)\displaystyle=(\mathrm{inr}\,\star,\,\iota_{\nu_{1}}\,y)
ι⌜​Σ​⌝​ν​A​(x,z)\displaystyle\iota_{\ulcorner\Sigma\urcorner\,\nu\,A}\,(x,\,z) =(ιν​x,φx−1​(ιA​x​z)).\displaystyle=\big(\iota_{\nu}\,x,\;\varphi_{x}^{-1}(\iota_{A\,x}\,z)\big).

Here ι𝟏\iota_{\mathbf{1}} is the canonical embedding ℕ+𝟏↪ℕ∞\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty} sending the added point to ∞\infty, and φx:((K∘A)/ιν)(ινx)≃oK(Ax)\varphi_{x}:\big((\mathrm{K}\circ A)\mathbin{/}\iota_{\nu}\big)(\iota_{\nu}\,x)\simeq_{o}\mathrm{K}(A\,x) is the extension property of Lemma 5.21 at the point ιν​x\iota_{\nu}\,x of the image.

That each ιν\iota_{\nu} is an embedding is proved by the same induction. At ⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner the map is the identity and at ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner it is the canonical embedding ι𝟏\iota_{\mathbf{1}}, 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 ⌜+⌝\mathbin{\ulcorner{+}\urcorner}, where the addition is a sum over 𝟏+𝟏\mathbf{1}+\mathbf{1} (Definition 5.9), the index map is the identity on 𝟏+𝟏\mathbf{1}+\mathbf{1} and the fiber maps are ιν0\iota_{\nu_{0}} and ιν1\iota_{\nu_{1}}, and at ⌜×⌝\mathbin{\ulcorner{\times}\urcorner}, where the multiplication is a sum over a constant family (Definition 5.13), the index map is ιν0\iota_{\nu_{0}} and the fiber map is ιν1\iota_{\nu_{1}}, the maps ιν0\iota_{\nu_{0}} and ιν1\iota_{\nu_{1}} being embeddings by the induction hypothesis. At ⌜​Σ​⌝​ν​A\ulcorner\Sigma\urcorner\,\nu\,A the map is the map of sums with index map ιν\iota_{\nu} and fiber maps φx−1∘ιA​x\varphi_{x}^{-1}\circ\iota_{A\,x}, an embedding as the composition of the embedding ιA​x\iota_{A\,x} with the equivalence φx−1\varphi_{x}^{-1}.

The following generalizes Theorems 6.30 and 6.23.

Theorem 7.5.

For every ν:E\nu:\mathrm{E},

  1. (1)

    the ordinal K​ν\mathrm{K}\nu has infima of complemented subsets, hence is compact,

  2. (2)

    the embedding ιν:Δ​ν→K​ν\iota_{\nu}:\Delta\nu\to\mathrm{K}\nu is extremely dense, order-preserving and order-reflecting.

Proof.

Write Kν,A=(K∘A)/ιν:K​ν→Ord⊤\mathrm{K}_{\nu,A}\;=\;(\mathrm{K}\circ A)\mathbin{/}\iota_{\nu}\;:\;\mathrm{K}\nu\to\mathrm{Ord}^{\top} so that K⁡(⌜​Σ​⌝​ν​A)=ΣK​ν​Kν,A\mathrm{K}(\ulcorner\Sigma\urcorner\,\nu\,A)=\Sigma_{\mathrm{K}\nu}\,\mathrm{K}_{\nu,A}, and by Definition 4.30 its value at yy is the product of the K⁡(A​x)\mathrm{K}(A\,x) over the fiber of ιν\iota_{\nu} at yy. We prove (1) together with (†\dagger) by induction on ν\nu, where

  1. (†\dagger)

    the ordinal Kν,A​y\mathrm{K}_{\nu,A}\,y has infima of complemented subsets for every A:Δ​ν→EA:\Delta\nu\to\mathrm{E} and every y:K​νy:\mathrm{K}\nu.

For (1), the ordinal 𝟏\mathbf{1} has infima by inspection. The ordinal ℕ∞\mathbb{N}_{\infty} has them, which strengthens the compactness of its underlying type by taking the order into account (Examples 4.7(3)). The cases ⌜+⌝\mathbin{\ulcorner{+}\urcorner}, ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} and ⌜​Σ​⌝\ulcorner\Sigma\urcorner are all instances of the closure of this property under ordinal-indexed sums , applied in the last case to the family Kν,A\mathrm{K}_{\nu,A}, which is where the second half of the induction is used.

For (†\dagger), the ordinal Kν,A​y\mathrm{K}_{\nu,A}\,y is a product of the ordinals K⁡(A​x)\mathrm{K}(A\,x) indexed by ιν−1​(y)\iota_{\nu}^{-1}(y), which is a proposition because ιν\iota_{\nu} 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 ιν\iota_{\nu} 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 ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner, where ℕ+𝟏↪ℕ∞\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty} is extremely dense (Examples 3.3(6)) and is order-preserving and order-reflecting for the standard order on ℕ∞\mathbb{N}_{\infty} (Lemma 5.28). ∎

Corollary 7.6.

Every non-empty complemented subset of the ordinal K​ν\mathrm{K}\nu has a least element for any ν:E\nu:\mathrm{E}.

Proof.

As that of Corollary 6.31, with Theorem 7.5(1) in place of Theorem 6.30. ∎

Classically, the embedding ι:Δ​ν↪K​ν\iota:\Delta\nu\hookrightarrow\mathrm{K}\nu is a surjection and hence an equivalence, but this fails constructively, and so does the discreteness, and hence the trichotomy, of K​ν\mathrm{K}\nu.

Proposition 7.7.
  1. (1)

    The map ιν\iota_{\nu} is an equivalence for every ν:E\nu:\mathrm{E} if and only if LPO\mathrm{LPO} holds.

  2. (2)

    LPO\mathrm{LPO} makes K​ν\mathrm{K}\nu discrete for every ν:E\nu:\mathrm{E}.

  3. (3)

    If K​ν\mathrm{K}\nu is discrete for every ν:E\nu:\mathrm{E}, then WLPO\mathrm{WLPO} holds.

Proof.

(1) (⇒\Rightarrow) Instantiate at ν=⌜​ω+𝟏​⌝\nu=\ulcorner\omega{+}\mathbf{1}\urcorner, where ιν\iota_{\nu} is the canonical map ℕ+𝟏→ℕ∞\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty}. If it is an equivalence then every conatural number is either the image of a unique n:ℕn:\mathbb{N} or is ∞\infty, and the inverse image tells us which, and deciding, for an arbitrary uu, whether uu is finite is LPO\mathrm{LPO} (as in the proof of Proposition 6.4).

(⇐\Leftarrow) By induction on ν\nu. At ⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner the map is the identity. At ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner, the principle LPO\mathrm{LPO} says exactly that finiteness is decidable, which makes ℕ+𝟏→ℕ∞\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} split surjective and hence, being an embedding already (Examples 3.3(6)), an equivalence. At ⌜+⌝\mathbin{\ulcorner{+}\urcorner}, ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} and ⌜​Σ​⌝\ulcorner\Sigma\urcorner 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 ⌜​Σ​⌝\ulcorner\Sigma\urcorner the fiber map is additionally composed with the equivalence φx−1\varphi_{x}^{-1}, which does not affect the conclusion.

(2) Under LPO\mathrm{LPO} the map ιν\iota_{\nu} is an equivalence for every ν\nu by (1), so K​ν\mathrm{K}\nu is discrete, being equivalent to the discrete type Δ​ν\Delta\nu (Theorem 7.2).

(3) Instantiate at ν=⌜​ω+𝟏​⌝\nu=\ulcorner\omega{+}\mathbf{1}\urcorner again, the discreteness of ℕ∞\mathbb{N}_{\infty} being WLPO\mathrm{WLPO}, since deciding u=∞u=\infty for every uu is deciding whether a binary sequence is constantly 11. ∎

The embedding ιν\iota_{\nu} is order-preserving and order-reflecting, and it is natural to ask whether it additionally satisfies the initial-segment condition, so that Δ​ν≤K​ν\Delta\nu\mathrel{\leq}\mathrm{K}\nu for all codes ν\nu. The code ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner does satisfy this, but the requirement that it holds for every code fails constructively.

Proposition 7.8.
  1. (1)

    The canonical embedding ι⌜​ω+𝟏​⌝:ℕ+𝟏↪ℕ∞\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}:\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty} is a simulation, so that Δ​⌜​ω+𝟏​⌝≤K​⌜​ω+𝟏​⌝\Delta\ulcorner\omega{+}\mathbf{1}\urcorner\mathrel{\leq}\mathrm{K}\ulcorner\omega{+}\mathbf{1}\urcorner.

  2. (2)

    The relation Δ​ν≤K​ν\Delta\nu\mathrel{\leq}\mathrm{K}\nu holds for every ν:E\nu:\mathrm{E} if and only if LPO\mathrm{LPO} holds.

Proof.

(1) The map is order-preserving (Theorem 7.5(2)). It preserves initial segments because the points of ℕ∞\mathbb{N}_{\infty} below ι⌜​ω+𝟏​⌝​z\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}\,z are the finite points n¯\underline{n} with n⊏ι⌜​ω+𝟏​⌝​zn\mathrel{\sqsubset}\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}\,z (Example 5.18), and such a point is the image of inl​n\mathrm{inl}\,n, which is below zz in ω+𝟏\omega\mathbin{+}\mathbf{1} whether zz is finite or is the added point.

(2) (⇐\Leftarrow) Under LPO\mathrm{LPO} the map ιν\iota_{\nu} 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.

(⇒\Rightarrow) The single code ν=⌜​ω+𝟏​⌝⌜+⌝⌜​𝟏​⌝\nu=\ulcorner\omega{+}\mathbf{1}\urcorner\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner suffices. Its discrete interpretation is the sum of ω+𝟏\omega\mathbin{+}\mathbf{1} and 𝟏\mathbf{1}, and its compact interpretation is the sum of ℕ∞\mathbb{N}_{\infty} and 𝟏\mathbf{1}. In both, the right summand contributes the single point (inr⋆,⋆)(\mathrm{inr}\,\star,\star), and no point is above it (Definition 5.9), the order of 𝟏\mathbf{1} being empty.

Let ff be a simulation of Δ​ν\Delta\nu into K​ν\mathrm{K}\nu. Every point (inl⋆,z)(\mathrm{inl}\,\star,z) of Δ​ν\Delta\nu is below (inr⋆,⋆)(\mathrm{inr}\,\star,\star), so its image is below f(inr⋆,⋆)f\,(\mathrm{inr}\,\star,\star) and hence is not (inr⋆,⋆)(\mathrm{inr}\,\star,\star), which nothing is above. The image therefore lies in the left summand, giving a map g:ℕ+𝟏→ℕ∞g:\mathbb{N}+\mathbf{1}\to\mathbb{N}_{\infty} with f(inl⋆,z)=(inl⋆,gz)f\,(\mathrm{inl}\,\star,z)=(\mathrm{inl}\,\star,\,g\,z).

The map gg is a simulation of ω+𝟏\omega\mathbin{+}\mathbf{1} into ℕ∞\mathbb{N}_{\infty}. It is order-preserving because ff 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 g=ι⌜​ω+𝟏​⌝g=\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner} by (1), and in particular gg sends the added point of ℕ+𝟏\mathbb{N}+\mathbf{1} to ∞\infty.

The map ff sends (inr⋆,⋆)(\mathrm{inr}\,\star,\star) to (inr⋆,⋆)(\mathrm{inr}\,\star,\star). Otherwise its value there is (inl⋆,w)(\mathrm{inl}\,\star,w) for some w:ℕ∞w:\mathbb{N}_{\infty}, and, the point (inl⋆,inr⋆)(\mathrm{inl}\,\star,\mathrm{inr}\,\star) of Δ​ν\Delta\nu being below (inr⋆,⋆)(\mathrm{inr}\,\star,\star), the conatural number ∞=g(inr⋆)\infty=g\,(\mathrm{inr}\,\star) would be below ww, whereas ∞\infty is below no conatural number (Example 5.18).

Now let u:ℕ∞u:\mathbb{N}_{\infty}. The point (inl⋆,u)(\mathrm{inl}\,\star,u) of K​ν\mathrm{K}\nu is below (inr⋆,⋆)=f(inr⋆,⋆)(\mathrm{inr}\,\star,\star)=f\,(\mathrm{inr}\,\star,\star), so initial-segment preservation gives a point of Δ​ν\Delta\nu below (inr⋆,⋆)(\mathrm{inr}\,\star,\star) whose image it is. That point lies in the left summand, say (inl⋆,z)(\mathrm{inl}\,\star,z), and then ι⌜​ω+𝟏​⌝​z=g​z=u\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}\,z=g\,z=u. The assignment u↦zu\mapsto z is a section of ι⌜​ω+𝟏​⌝\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}, and deciding whether zz is of the form inl​n\mathrm{inl}\,n decides whether uu is finite, which is LPO\mathrm{LPO}. ∎

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 𝔢:B→E\mathfrak{e}:\mathrm{B}\to\mathrm{E} is defined by induction, together with the family AbA_{b} of the limit clause, whose index type Δ​⌜​ω+𝟏​⌝\Delta\ulcorner\omega{+}\mathbf{1}\urcorner is ℕ+𝟏\mathbb{N}+\mathbf{1}:

𝔢​𝖹=⌜​𝟏​⌝,𝔢⁡(𝖲​b)=𝔢​b⌜+⌝⌜​𝟏​⌝,𝔢⁡(𝖫​b)=⌜​Σ​⌝​⌜​ω+𝟏​⌝​Ab,\mathfrak{e}\,\mathsf{Z}=\ulcorner\mathbf{1}\urcorner,\qquad\mathfrak{e}\,(\mathsf{S}\,b)=\mathfrak{e}\,b\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner,\qquad\mathfrak{e}\,(\mathsf{L}\,b)=\ulcorner\Sigma\urcorner\,\ulcorner\omega{+}\mathbf{1}\urcorner\,A_{b},
Ab(inln)=𝔢(bn),Ab(inr⋆)=⌜𝟏⌝.A_{b}\,(\mathrm{inl}\,n)=\mathfrak{e}\,(b\,n),\qquad A_{b}\,(\mathrm{inr}\,\star)=\ulcorner\mathbf{1}\urcorner.
Theorem 7.10.

The map 𝔢\mathfrak{e} is an embedding, and for every Brouwer code bb,

  1. (1)

    ⟦b⟧Σ1≃oΔ(𝔢b)\llbracket b\rrbracket_{\Sigma_{1}}\simeq_{o}\Delta(\mathfrak{e}\,b),

  2. (2)

    ⟦b⟧Σ1≃oK(𝔢b)\llbracket b\rrbracket_{\Sigma^{1}}\simeq_{o}\mathrm{K}(\mathfrak{e}\,b),

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 𝔢\mathfrak{e} is left cancellable. The constructors of E\mathrm{E} have disjoint images and are left cancellable in each argument, so if 𝔢​b=𝔢​b′\mathfrak{e}\,b=\mathfrak{e}\,b^{\prime} then bb and b′b^{\prime} are given by the same constructor of B\mathrm{B}, and we argue by induction. At 𝖹\mathsf{Z} there is nothing to prove. At 𝖲\mathsf{S} the hypothesis identifies 𝔢​b⌜+⌝⌜​𝟏​⌝\mathfrak{e}\,b\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner with 𝔢​b′⌜+⌝⌜​𝟏​⌝\mathfrak{e}\,b^{\prime}\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner, hence 𝔢​b\mathfrak{e}\,b with 𝔢​b′\mathfrak{e}\,b^{\prime}, so that b=b′b=b^{\prime} by the induction hypothesis. At 𝖫\mathsf{L} it identifies ⌜​Σ​⌝​⌜​ω+𝟏​⌝​Ab\ulcorner\Sigma\urcorner\,\ulcorner\omega{+}\mathbf{1}\urcorner\,A_{b} with ⌜​Σ​⌝​⌜​ω+𝟏​⌝​Ab′\ulcorner\Sigma\urcorner\,\ulcorner\omega{+}\mathbf{1}\urcorner\,A_{b^{\prime}}, hence AbA_{b} with Ab′A_{b^{\prime}}, and evaluation at inl​n\mathrm{inl}\,n gives b​n=b′​nb\,n=b^{\prime}\,n for every nn, again by the induction hypothesis.

A left-cancellable map into a set is an embedding (Definition 2.10), and E\mathrm{E} is a set. For the latter, encode E\mathrm{E} into the W\mathrm{W}-type with one shape for each of the five constructors, of arities 𝟎\mathbf{0}, 𝟎\mathbf{0}, 𝟏+𝟏\mathbf{1}+\mathbf{1}, 𝟏+𝟏\mathbf{1}+\mathbf{1} and 𝟏+ℕ\mathbf{1}+\mathbb{N}. The last of these accommodates ⌜​Σ​⌝​ν​A\ulcorner\Sigma\urcorner\,\nu\,A, whose branching type Δ​ν\Delta\nu is a retract of ℕ\mathbb{N} (Theorem 7.2): the code ν\nu is recorded at the point of 𝟏\mathbf{1} and the composite of AA with the retraction ρ:ℕ→Δ​ν\rho:\mathbb{N}\to\Delta\nu at the points of ℕ\mathbb{N}. This composite determines AA, because ρ⁡(σ​x)=x\rho\,(\sigma\,x)=x for the section σ\sigma, so that two families with the same composite with ρ\rho take the same value at every point xx of Δ​ν\Delta\nu. The encoding is therefore left cancellable, and the W\mathrm{W}-type is a set, a W\mathrm{W}-type whose type of shapes is a set being one. A type admitting a left-cancellable map into a set is a set, so E\mathrm{E} is a set and 𝔢\mathfrak{e} is an embedding.

The two agreements are proved by induction on bb. At 𝖹\mathsf{Z} both sides are the one-point ordinal. At 𝖲\mathsf{S} both sides are additions of 𝟏\mathbf{1}, that is, sums over 𝟏+𝟏\mathbf{1}+\mathbf{1} (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 𝟏\mathbf{1} 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 𝖫\mathsf{L} both sides are again sums over a common index, so again it is enough to compare the fibers.

In (1) the index is ω+𝟏\omega\mathbin{+}\mathbf{1}, whose underlying type is ℕ+𝟏\mathbb{N}+\mathbf{1}. The fibers on the left are the extension of the family n↦⟦b​n⟧Σ1n\mapsto\llbracket b\,n\rrbracket_{\Sigma_{1}} along inl:ℕ↪ℕ+𝟏\mathrm{inl}:\mathbb{N}\hookrightarrow\mathbb{N}+\mathbf{1} (Definition 5.25(2)), and those on the right are the values of Δ∘Ab\Delta\circ A_{b} (Definition 7.1). At inl​n\mathrm{inl}\,n the extension gives ⟦b​n⟧Σ1\llbracket b\,n\rrbracket_{\Sigma_{1}} back (Lemma 5.23), which the induction hypothesis compares with Δ⁡(𝔢⁡(b​n))\Delta(\mathfrak{e}\,(b\,n)). At inr⋆\mathrm{inr}\,\star the fiber of inl\mathrm{inl} is empty, so the extension is the one-point ordinal (Lemma 4.31(2)), and so is Δ​⌜​𝟏​⌝\Delta\,\ulcorner\mathbf{1}\urcorner.

In (2) the index is ℕ∞\mathbb{N}_{\infty}, but the two families are extensions along different embeddings into ℕ∞\mathbb{N}_{\infty}, namely ι:ℕ↪ℕ∞\iota:\mathbb{N}\hookrightarrow\mathbb{N}_{\infty} on the left (Definition 5.25(1)) and ι⌜​ω+𝟏​⌝:ℕ+𝟏↪ℕ∞\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}:\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty} on the right (Definition 7.4). The comparison at a point u:ℕ∞u:\mathbb{N}_{\infty} is defined on the elements of the two fibers. A point of the fiber on the left is a function φ\varphi assigning to each (n,p):ι−1​(u)(n,p):\iota^{-1}(u) a point of ⟦b​n⟧Σ1\llbracket b\,n\rrbracket_{\Sigma^{1}}, and it is sent to the function assigning to (inl​n,p):ι⌜​ω+𝟏​⌝−1​(u)(\mathrm{inl}\,n,p):\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}^{-1}(u) the image of φ⁡(n,p)\varphi\,(n,p) under the induction hypothesis, and to (inr⋆,p)(\mathrm{inr}\,\star,p) the point of the one-point ordinal K​⌜​𝟏​⌝\mathrm{K}\,\ulcorner\mathbf{1}\urcorner. This is an equivalence, its inverse restricting a function on ι⌜​ω+𝟏​⌝−1​(u)\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}^{-1}(u) along (n,p)↦(inl​n,p)(n,p)\mapsto(\mathrm{inl}\,n,p) 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 (inr⋆,p)(\mathrm{inr}\,\star,p) there is none, the order of the one-point ordinal being empty. ∎

As opposed to the ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma_{1}} interpretation of Brouwer codes, the K\mathrm{K} interpretation of E\mathrm{E} codes fails to be totally separated constructively.

Proposition 7.11.

If K​ν\mathrm{K}\nu is totally separated for every code ν\nu, then ¬¬⁡WLPO\neg\neg\mathrm{WLPO} holds.

Proof.

Take ν=⌜​Σ​⌝​⌜​ω+𝟏​⌝​A\nu=\ulcorner\Sigma\urcorner\,\ulcorner\omega{+}\mathbf{1}\urcorner\,A, where AA sends the finite points of Δ​⌜​ω+𝟏​⌝\Delta\ulcorner\omega{+}\mathbf{1}\urcorner to ⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner and its added point to ⌜​𝟏​⌝⌜+⌝⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner. By Definition 7.4, the ordinal K​ν\mathrm{K}\nu is the sum over ℕ∞\mathbb{N}_{\infty} of the extension of K∘A\mathrm{K}\circ A along ι⌜​ω+𝟏​⌝:ℕ+𝟏↪ℕ∞\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}:\mathbb{N}+\mathbf{1}\hookrightarrow\mathbb{N}_{\infty}, so a point of its underlying type is a point u:ℕ∞u:\mathbb{N}_{\infty} together with a function assigning to each element of ι⌜​ω+𝟏​⌝−1​(u)\iota_{\ulcorner\omega{+}\mathbf{1}\urcorner}^{-1}(u) a point of the corresponding member of the family. The elements with first component inl​n\mathrm{inl}\,n contribute the one-point type K​⌜​𝟏​⌝\mathrm{K}\,\ulcorner\mathbf{1}\urcorner, and the element with first component inr⋆\mathrm{inr}\,\star, which is available exactly when u=∞u=\infty, contributes K⁡(⌜​𝟏​⌝⌜+⌝⌜​𝟏​⌝)\mathrm{K}(\ulcorner\mathbf{1}\urcorner\mathbin{\ulcorner{+}\urcorner}\ulcorner\mathbf{1}\urcorner), which is 𝟏+𝟏\mathbf{1}+\mathbf{1} and which we read as 𝟐\mathbf{2}. Hence

Kν≃Σu:ℕ∞ 2u=∞,\mathrm{K}\nu\;\simeq\;\textstyle\Sigma_{u:\mathbb{N}_{\infty}}\,\mathbf{2}^{u=\infty},

the type of Examples 3.10(3), whose total separatedness gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO}. Total separatedness is closed under equivalence (Proposition 3.12(1)), so the total separatedness of K​ν\mathrm{K}\nu gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO} too. ∎

Remark 7.12.

Since the compact interpretation of a Brouwer code is totally separated (Theorem 6.19(4)) and K\mathrm{K} agrees with it along the inclusion of Theorem 7.10, the ordinals witnessing the failure are denoted by no Brouwer code, so that E\mathrm{E} denotes strictly more compact ordinals.

7.4. Isolated points and limit points

A point in the image of the embedding ιν:Δ​ν→K​ν\iota_{\nu}:\Delta\nu\to\mathrm{K}\nu can be isolated in K​ν\mathrm{K}\nu or a limit point. A boolean valued function on Δ​ν\Delta\nu, defined by induction on the code ν\nu, 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 WLPO\mathrm{WLPO}. We choose this taboo because ¬WLPO\neg\mathrm{WLPO} is a weak continuity principle, as discussed in Remark 2.26.

Definition 7.13 (Topological limit point).

A point xx of a type is a limit point if its isolatedness implies WLPO\mathrm{WLPO}:

x is a limit point:≡(x is isolated→WLPO).\text{$x$ is a limit point}\;:\equiv\;(\text{$x$ is isolated}\to\mathrm{WLPO}).

For example, at the code ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner, whose compact interpretation is ℕ∞\mathbb{N}_{\infty}, the finite points are isolated while the added point ∞\infty is a limit, its isolatedness being WLPO\mathrm{WLPO} (Examples 3.3).

Definition 7.14 (Limit point indicator).

The limit point indicator of a code ν\nu is the function ℓν:Δ​ν→𝟐\ell_{\nu}:\Delta\nu\to\mathbf{2} defined by induction on ν\nu by

ℓ⌜​𝟏​⌝​(⋆)\displaystyle\ell_{\ulcorner\mathbf{1}\urcorner}(\star) =0\displaystyle=0 ℓν0⌜+⌝ν1(inl⋆,x0)\displaystyle\ell_{\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}}(\mathrm{inl}\,\star,x_{0}) =ℓν0​(x0)\displaystyle=\ell_{\nu_{0}}(x_{0})
ℓ⌜​ω+𝟏​⌝​(inl​n)\displaystyle\ell_{\ulcorner\omega{+}\mathbf{1}\urcorner}(\mathrm{inl}\,n) =0\displaystyle=0 ℓν0⌜+⌝ν1(inr⋆,x1)\displaystyle\ell_{\nu_{0}\mathbin{\ulcorner{+}\urcorner}\nu_{1}}(\mathrm{inr}\,\star,x_{1}) =ℓν1​(x1)\displaystyle=\ell_{\nu_{1}}(x_{1})
ℓ⌜​ω+𝟏​⌝(inr⋆)\displaystyle\ell_{\ulcorner\omega{+}\mathbf{1}\urcorner}(\mathrm{inr}\,\star) =1\displaystyle=1 ℓν0⌜×⌝ν1​(x0,x1)\displaystyle\ell_{\nu_{0}\mathbin{\ulcorner{\times}\urcorner}\nu_{1}}(x_{0},x_{1}) =max⁡(ℓν0​(x0),ℓν1​(x1))\displaystyle=\max(\ell_{\nu_{0}}(x_{0}),\ell_{\nu_{1}}(x_{1}))
ℓ⌜​Σ​⌝​ν​A​(x,y)\displaystyle\ell_{\ulcorner\Sigma\urcorner\,\nu\,A}(x,y) =max⁡(ℓν​(x),ℓA​x​(y))\displaystyle=\max(\ell_{\nu}(x),\ell_{A\,x}(y))
Theorem 7.15.

For every ν:E\nu:\mathrm{E} and x:Δ​νx:\Delta\nu,

  1. (1)

    if ℓν​(x)=0\ell_{\nu}(x)=0 then ιν​x\iota_{\nu}\,x is isolated in K​ν\mathrm{K}\nu,

  2. (2)

    if ℓν​(x)=1\ell_{\nu}(x)=1 then ιν​x\iota_{\nu}\,x is a limit point of K​ν\mathrm{K}\nu,

  3. (3)

    every point in the image of ιν\iota_{\nu} is either isolated or a limit point,

  4. (4)

    if ¬WLPO\neg\mathrm{WLPO} holds, isolatedness of ιν​x\iota_{\nu}\,x is decidable.

Proof.

(1) By induction on ν\nu, using throughout that a pair is isolated as soon as both of its components are (Proposition 3.6(4)).

At ⌜​𝟏​⌝\ulcorner\mathbf{1}\urcorner the unique point is isolated, the type 𝟏\mathbf{1} being discrete. At ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner the hypothesis leaves x=inl​nx=\mathrm{inl}\,n, whose image is the finite conatural number n¯\underline{n}, which is isolated (Examples 3.3(4)). At ⌜+⌝\mathbin{\ulcorner{+}\urcorner} the image is a pair whose index is inl⋆\mathrm{inl}\,\star or inr⋆\mathrm{inr}\,\star, isolated in 𝟏+𝟏\mathbf{1}+\mathbf{1} (Proposition 3.6(1)), and whose second component is isolated by the induction hypothesis, the value of ℓ\ell at the pair being its value at that component. At ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} and ⌜​Σ​⌝\ulcorner\Sigma\urcorner the hypothesis reads max⁡(a,b)=0\max(a,b)=0, so that a=b=0a=b=0 and the induction hypothesis applies to both components. This finishes the case ⌜×⌝\mathbin{\ulcorner{\times}\urcorner}, and in the case ⌜​Σ​⌝\ulcorner\Sigma\urcorner the second component of the image is φx−1​(ιA​x​y)\varphi_{x}^{-1}(\iota_{A\,x}\,y) (Definition 7.4), which is isolated because ιA​x​y\iota_{A\,x}\,y is and equivalences preserve isolatedness (Proposition 3.6(5)).

(2) By induction on ν\nu, assuming in each case that ιν​x\iota_{\nu}\,x is isolated and deriving WLPO\mathrm{WLPO}.

At ⌜​ω+𝟏​⌝\ulcorner\omega{+}\mathbf{1}\urcorner the hypothesis leaves x=inr⋆x=\mathrm{inr}\,\star, whose image is ∞\infty, and the isolatedness of ∞\infty is WLPO\mathrm{WLPO} (Examples 3.3(5)). The remaining cases pass the assumed isolatedness down to the component that ℓ\ell flags, where the induction hypothesis converts it into WLPO\mathrm{WLPO}.

At ⌜+⌝\mathbin{\ulcorner{+}\urcorner} 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 𝟏+𝟏\mathbf{1}+\mathbf{1} is. At ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} and ⌜​Σ​⌝\ulcorner\Sigma\urcorner the hypothesis reads max⁡(a,b)=1\max(a,b)=1, so that a=1a=1 or b=1b=1, and the flagged component is the first or the second accordingly. At ⌜×⌝\mathbin{\ulcorner{\times}\urcorner} the sum is a product, whose components are both isolated with no further hypothesis (same item). At ⌜​Σ​⌝\ulcorner\Sigma\urcorner 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 K​ν\mathrm{K}\nu is a set (Lemma 5.2), which gives the isolatedness of φx−1​(ιA​x​y)\varphi_{x}^{-1}(\iota_{A\,x}\,y) and hence of ιA​x​y\iota_{A\,x}\,y, equivalences reflecting isolatedness (Proposition 3.6(5)).

(3) Decide the value of ℓν​(x)\ell_{\nu}(x), which is a point of 𝟐\mathbf{2}, and apply (1) or (2).

(4) By (3) the point ιν​x\iota_{\nu}\,x is isolated, in which case isolatedness is decided, or a limit point, in which case its isolatedness implies WLPO\mathrm{WLPO}, and contraposing against ¬WLPO\neg\mathrm{WLPO} gives that it is not isolated. ∎

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 (ω,1)(\omega,1) of the ordinal (ω+1)×(ω+1)(\omega+1)\times(\omega+1) in the lexicographic order is the successor of (ω,0)(\omega,0), and hence is not an order limit point, but it is a topological limit point, since its isolatedness gives WLPO\mathrm{WLPO}, through its first coordinate ω\omega, a limit point of ω+1\omega+1.

8. Discussion

8.1. Summary of results

Table 1. The interpretations of the two notation systems.
Interpretation Reading of the limit constructor Holds for every code Fails constructively
Brouwer codes bb (Definition 6.1), limit constructor 𝖫\mathsf{L}
standard ⟦b⟧sup\llbracket b\rrbracket_{\mathrm{sup}}
in Ord\mathrm{Ord}
(Definition 6.2)
supremum nothing beyond being an ordinal trichotomy, giving LPO\mathrm{LPO} (Proposition 6.4), and compactness, giving LPO\mathrm{LPO} (Examples 4.5)
⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma^{1}}
in Ord⊤\mathrm{Ord}^{\top}
(Definition 6.6)
extended sum compact and totally separated (Theorem 6.7), a retract of 𝟐ℕ\mathbf{2}^{\mathbb{N}} (Theorem 6.19), and infima of complemented subsets (Theorem 6.30), hence the least element property (Corollary 6.31) discreteness, giving WLPO\mathrm{WLPO} (Proposition 6.21(2)), and hence trichotomy
⟦b⟧sup1\llbracket b\rrbracket_{\mathrm{sup}^{1}}
in Ord\mathrm{Ord}
(Definition 6.6)
supremum of the extension compact (Theorem 6.7) total separatedness, giving ¬¬⁡WLPO\neg\neg\mathrm{WLPO} (Proposition 6.9)
⟦b⟧Σ\llbracket b\rrbracket_{\Sigma}
in Ord3\mathrm{Ord}_{3}
(Definition 6.6)
sum over ω\omega trichotomous (Theorem 6.7), hence discrete (Lemma 5.8) compactness, giving LPO\mathrm{LPO} (Proposition 6.8)
⟦b⟧Σ1\llbracket b\rrbracket_{\Sigma_{1}}
in Ord⊤\mathrm{Ord}^{\top}
(Definition 6.18)
successor sum trichotomous and a retract of ℕ\mathbb{N}, hence discrete (Theorem 6.19) compactness (Proposition 6.21) and the least element property (Proposition 6.32), each equivalent to LPO\mathrm{LPO}
Inductive-recursive codes ν\nu (Definition 7.1), sum constructor ⌜​Σ​⌝\ulcorner\Sigma\urcorner
Δ​ν\Delta\nu
in Ord⊤\mathrm{Ord}^{\top}
(Definition 7.1)
sum over Δ​ν\Delta\nu trichotomous and a retract of ℕ\mathbb{N}, hence discrete (Theorem 7.2) compactness and the least element property, each equivalent to LPO\mathrm{LPO} (Proposition 7.3)
K​ν\mathrm{K}\nu
in Ord⊤\mathrm{Ord}^{\top}
(Definition 7.4)
sum over K​ν\mathrm{K}\nu of the extension compact, with infima of complemented subsets (Theorem 7.5), hence the least element property (Corollary 7.6) total separatedness, giving ¬¬⁡WLPO\neg\neg\mathrm{WLPO} (Proposition 7.11), and discreteness, giving WLPO\mathrm{WLPO} (Proposition 7.7(3))
Table 2. The map ι\iota from the discrete to the compact interpretation, for a Brouwer code bb and for an E\mathrm{E}-code ν\nu.
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 LPO\mathrm{LPO} 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 bb gives

⟦b⟧sup≤⟦b⟧Σ⩽⩽⟦b⟧sup1≤⟦b⟧Σ1​.\begin{array}[]{ccc}\llbracket b\rrbracket_{\mathrm{sup}}&\mathrel{\leq}&\llbracket b\rrbracket_{\Sigma}\\[4.30554pt] \mathrel{\rotatebox[origin={c}]{-90.0}{$\leqslant$}}&&\mathrel{\rotatebox[origin={c}]{-90.0}{$\leqslant$}}\\[4.30554pt] \llbracket b\rrbracket_{\mathrm{sup}^{1}}&\mathrel{\leq}&\llbracket b\rrbracket_{\Sigma^{1}}\hbox to0.0pt{$.$\hss}\end{array}

The inductive-recursive universe E\mathrm{E} carries a discrete and a compact interpretation, Δ\Delta and K\mathrm{K}, related by the embedding ι\iota, as the Brouwer codes do, but its sum constructor is indexed by any previously constructed discrete ordinal rather than by ℕ\mathbb{N} (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 K\mathrm{K} for every code of E\mathrm{E} gives ¬¬⁡WLPO\neg\neg\mathrm{WLPO} (Proposition 7.11), whereas the compact interpretation ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} 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 LPO\mathrm{LPO} holds (Proposition 6.25 and Proposition 7.7(1)).

Trichotomy of the standard interpretation gives LPO\mathrm{LPO} (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 ¬¬⁡WLPO\neg\neg\mathrm{WLPO} (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 ε0\varepsilon_{0} in Gödel’s TT, 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 TT, then it is countable and its Cantor–Bendixson rank lies below ε0\varepsilon_{0}. 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 TT puts that order type below ε0\varepsilon_{0}.

Coquand, Hancock and Setzer [6] add the type B\mathrm{B} of Definition 6.1 to TT as a base type, with its constructors but without its elimination principle, and ask which ordinals are denoted by the closed terms of type B\mathrm{B}. They call a point of a type XX together with an endomap of XX and a map (ℕ→X)→X(\mathbb{N}\to X)\to X a limit structure, the generic one being B\mathrm{B} itself with 𝖹\mathsf{Z}, 𝖲\mathsf{S} and 𝖫\mathsf{L}. Our interpretations are limit structures in this sense, their main difference being in the third component, which is the supremum for ⟦−⟧sup\llbracket-\rrbracket_{\mathrm{sup}} (Definition 6.2), the extended sum for ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma^{1}} and the successor sum for ⟦−⟧Σ1\llbracket-\rrbracket_{\Sigma_{1}} (Definition 6.18).

In system TT they build closed terms denoting ω\omega, ωω\omega^{\omega}, ωωω\omega^{\omega^{\omega}} and so on, so that the ordinal of the system is at least ε0\varepsilon_{0}. They apply a device of Gentzen, which from a predicate AA closed under zero, successor and limits of sequences forms A′​(x)=∀y.A⁡(y)→A⁡(y+x)A^{\prime}(x)=\forall y.\,A(y)\to A(y+x) and then A1​(x)=A′​(ωx)A_{1}(x)=A^{\prime}(\omega^{x}), again closed under those three operations. Under realizability this transformation turns a limit structure on XX into one on X→XX\to X, so that ordinary recursion at higher types replaces transfinite recursion. In the extension of TT 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 FF together with a map F​X→XFX\to X and a way of turning a limit structure on XX into one on F​XFX, and every ordinal below φε0​0\varphi_{\varepsilon_{0}}0 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 nn universes have strength γn\gamma_{n}, where γ0=ε0\gamma_{0}=\varepsilon_{0} and γn+1=φγn​0\gamma_{n+1}=\varphi_{\gamma_{n}}0, so that φε0​0\varphi_{\varepsilon_{0}}0 is γ1\gamma_{1}. Aczel established this for one universe and Feferman in general, and the limit of the γn\gamma_{n} is the Feferman–Schütte ordinal Γ0\Gamma_{0} (see e.g. [38] for a survey). We can reproduce these constructions in our type theory and evaluate the codes by K\mathrm{K} to get compact totally separated ordinals of the same ranks, and so of every rank below φε0​0\varphi_{\varepsilon_{0}}0.

Our system E\mathrm{E} 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 (∞,1)(\infty,1)-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