11.5 Compactness of the interval
We already pointed out that our constructions of reals are entirely compatible withclassical logic. Thus, by assuming the law of excluded middle (LABEL:eq:lem) and the axiomof choice
(LABEL:eq:ac) we could develop classical analysis
, which would essentiallyamount to copying any standard book on analysis.
Nevertheless, anyone interested in computation, for example a numerical analyst, ought tobe curious about developing analysis in a computationally meaningful setting. Thatanalysis in a constructive setting is even possible was demonstrated by [Bishop1967].As a sample of the differences and similarities
between classical and constructiveanalysis we shall briefly discuss just one topic—compactness of the closed interval
and a couple of theorems
surrounding the concept.
Compactness is no exception to the common phenomenon in constructive mathematics thatclassically equivalent notions bifurcate. The three most frequently used notions ofcompactness are:
- 1.
metrically compact
: “Cauchy complete
and totally bounded
”,
- 2.
Bolzano–Weierstraß compact: “every sequence
has a convergent
subsequence
”,
- 3.
Heine-Borel compact: “every open cover has a finite subcover”.
These are all equivalent in classical mathematics.Let us see how they fare in homotopy type theory. We can use either the Dedekind or theCauchy reals, so we shall denote the reals just as . We first recall several basicdefinitions.
Definition 11.5.1.
A metric space is a set with a map satisfying, for all ,
Definition 11.5.2.
A Cauchy approximationin is a sequence satisfying
The limit of a Cauchy approximation is a point satisfying
A complete metric space is one in which every Cauchy approximation has a limit.
Definition 11.5.3.
For a positive rational , an -netin a metric space is an element of
In words, this is a finite sequence of points such that every pointin merely is within of some .
A metric space is totally boundedwhen it has -nets of allsizes:
Remark 11.5.4.
In the definition of total boundedness we used sloppy notation . Formally, we should have written instead,where is the inductive type of finite lists from \\autorefsec:bool-nat.However, that would make the rest of the statement a bit more cumbersome to express.
Note that in the definition of total boundedness we require pure existence of an-net, not mere existence. This way we obtain a function which assigns to each a specific -net. Such a function might be called a “modulus oftotal boundedness”. In general, when porting classical metric notions to homotopy typetheory, we should use propositional truncation
sparingly, typically so that we avoidasking for a non-constant map from to or . For instance, here is the“correct” definition of uniform continuity.
Definition 11.5.5.
A map on a metric space is uniformly continuouswhen
In particular, a uniformly continuous map has a modulus of uniform continuity,which is a function that assigns to each a corresponding .
Let us show that is compact in the first sense.
Theorem 11.5.6.
The closed interval is complete and totally bounded.
Proof.
Given , there is such that , so we may take the-net for . This is an -net because,for every there merely exists such that and , and so .
For completeness of , consider a Cauchy approximation and let be its limit in . Since and are Lipschitz maps,the retraction defined by commuteswith limits of Cauchy approximations, therefore
which means that , as required.∎
We thus have at least one good notion of compactness in homotopy type theory.Unfortunately, it is limited to metric spaces because total boundedness is a metricnotion. We shall consider the other two notions shortly, but first we prove that auniformly continuous map on a totally bounded space has a supremum,i.e. an upper bound which is less than or equal to all other upper bounds.
Theorem 11.5.7.
A uniformly continuous map on a totally bounded metric space has a supremum . For every there exists suchthat .
Proof.
Let be the modulus of uniform continuity of .We define an approximation as follows: for any totalboundedness of gives a -net . Define
We claim that is a Cauchy approximation. Consider any , so that
for some -net and -net .Every is merely -close to some , therefore , from which we may conclude that
therefore . Symmetrically we obtain , therefore .
We claim that is the supremum of . To prove that forall it suffices to show . So suppose to the contrary that . There is such that . But now merely forsome participating in the definition of we get , therefore , a contradiction.
We finish the proof by showing that satisfies the second part of the theorem, becauseit is then automatically a least upper bound. Given any , on one hand, and on the other merely for some participating in the definition of ,therefore by taking we obtain by triangleinequality.∎
Now, if in \\autorefctb-uniformly-continuous-sup we also knew that were complete, wecould hope to weaken the assumption of uniform continuity to continuity, and strengthenthe conclusion
to existence of a point at which the supremum is attained. The usual proofsof these improvements rely on the facts that in a complete totally bounded space
- 1.
continuity implies uniform continuity, and
- 2.
every sequence has a convergent subsequence.
The first statement follows easily from Heine-Borel compactness, and the second is justBolzano–Weierstraß compactness.Unfortunately, these are both somewhat problematic. Letus first show that Bolzano–Weierstraß compactness implies an instance of excluded middleknown as the limited principle of omniscience:for every ,
(11.5.8) |
Computationally speaking, we would not expect this principle to hold, because it asks us to decidewhether infinitely many values of a function are .
Theorem 11.5.9.
Bolzano–Weierstraß compactness of implies the limited principle of omniscience.
Proof.
Given any , define the sequence by
If the Bolzano–Weierstraß property holds, there exists a strictly increasing such that is a Cauchy sequence. For a sufficiently large the -th term is within of its limit. Either or. If then converges
to and so . If then , therefore .∎
While we might not mourn Bolzano–Weierstraß compactness too much, it seems harder to livewithout Heine–Borel compactness, as attested by the fact that both classical mathematicsand Brouwer’s Intuitionism accepted it. As we do not want to wade too deeply into generaltopology, we shall work with basic open sets. In the case of these are the openintervals with rational endpoints. A family of such intervals, indexed by a type ,would be a map
with the idea that a pair of rationals with determines the type . It is slightly more convenient to allow degenerate intervals as well, so we take afamily of basic intervalsto be a map
To be quite precise, a family is a dependent pair , not just. A finite family of basic intervals is one indexed by for some . We usually present it by a finite list . Finally, a finite subfamily of is givenby a list of indices which then determine the finite family.
As long as we are aware of the distinction between a pair and the correspondinginterval , we may safely use the same notation forboth. Intersections and inclusions of intervals are expressible in terms of theirendpoints:
We say that (pointwise) covers when
(11.5.10) |
The Heine-Borel compactness for states that every covering family of merely has a finite subfamily which still covers .
Theorem 11.5.11.
If excluded middle holds then is Heine-Borel compact.
Proof.
Assume for the purpose of reaching a contradiction that a family covers but no finite subfamily does. We construct a sequence of closedintervals which are nested, their sizes shrink to , and none of them is coveredby a finite subfamily of .
We set . Assuming has been constructed, let and . Both and are covered by , but they cannot both have a finite subcover,or else so would . Either has a finite subcover or it does not.If it does we set , otherwise we set .
The sequences and are both Cauchy and theyconverge to a point which is contained in every .There merely exists such that . Because the sizes of theintervals shrink to zero, there is such that , but this means that is covered by a single interval , while at the same time it has no finite subcover. A contradiction.∎
Without excluded middle, or a pinch of Brouwerian Intuitionism, we seem to be stuck.Nevertheless, Heine-Borel compactness of can be recovered in a constructivesetting, in a fashion that is still compatible with classical mathematics! For this to bedone, we need to revisit the notion of cover. The trouble with(11.5.10) is that the truncated existential allows a space tobe covered in any haphazard way, and so computationally speaking, we stand no chance ofmerely extracting a finite subcover. By removing the truncation we get
(11.5.12) |
which might help, were it not too demanding of covers. With this definition wecould not even show that and cover because that would amountto exhibiting a non-constant map , see\\autorefex:reals-non-constant-into-Z. Here we can take a lesson from “pointfree topology”(i.e. locale theory):the notion of cover ought to be expressed in terms of open sets, withoutreference to points. Such a “holistic” view of space will then allow us to analyze thenotion of cover, and we shall be able to recover Heine-Borel compactness. Localetheory uses power sets,which we could obtain by assuming propositional resizing;but instead we can steal ideas from the predicative cousin of locale theory,which is called “formal topology”.
Suppose that we have a family and an interval . How mightwe express the fact that is covered by the family, without referring to points?Here is one: if equals some then it is covered by the family.And another one: if is covered by some other family , and inturn each is covered by , then is covered. Notice that we are listing rules which can be used todeduce that covers . We should find sufficientlygood rules and turn them into an inductive definition.
Definition 11.5.13.
The inductive cover is a mere relation
defined inductively by the following rules, where are rational numbers and, are families of basic intervals:
- 1.
reflexivity
: for all ,
- 2.
transitivity:if and then ,
- 3.
monotonicity:if and then ,
- 4.
localization:if then .
- 5.
if then ,
- 6.
.
The definition should be read as a higher-inductive type in which the listed rules arepoint constructors, and the type is -truncated. The first four clauses are of ageneral nature and should be intuitively clear. The last two clauses are specific to thereal line: one says that an interval may be covered by two intervals if they overlap,while the other one says that an interval may be covered from within. Incidentally, if then is covered by the empty family by the last clause.
Inductive covers enjoy the Heine-Borel property, the proof of which requires a lemma.
Lemma 11.5.14.
Suppose and . Then there merelyexists a finite subfamily of which inductively covers .
Proof.
We prove the statement by induction on . There aresix cases:
- 1.
Reflexivity: if then by monotonicity is coveredby the finite subfamily .
- 2.
Transitivity:suppose and . By the inductive hypothesis there merely exists which covers .Again by the inductive hypothesis, each of is covered by a finitesubfamily of , and we can collect these into a finitesubfamily which covers .
- 3.
Monotonicity:if and then we mayapply the inductive hypothesis to because .
- 4.
Localization:suppose and .Because , by the inductive hypothesis there is a finite subcover of . We also know that , therefore is covered by, which is afinite subfamily of .
- 5.
If for some then by monotonicity.
- 6.
Finally, byreflexivity. ∎
Say that inductively covers when there merely exists such that .
Corollary 11.5.15.
A closed interval is Heine-Borel compact for inductive covers.
Proof.
Suppose is inductively covered by , so there merely is such that .By \\autorefreals-formal-topology-locally-compact there is a finite subcover of, which is therefore a finite subcover of .∎
Experience from formal topology shows that the rules for inductive covers are sufficientfor a constructive development of pointfree topology. But we can also provide our ownevidence that they are a reasonable notion.
Theorem 11.5.16.
- 1.
An inductive cover is also a pointwise cover.
- 2.
Assuming excluded middle, a pointwise cover is also an inductive cover.
Proof.
- 1.
Consider a family of basic intervals , where we write , an interval inductively covered by , and such that .We prove by induction on that there merelyexists such that . Most cases are pretty obvious, so we showjust two. If by reflexivity, then there merelyis some such that and so . If by transitivity via then bythe inductive hypothesis there merely is such that , and then since again by the inductive hypothesis there merelyexists such that . Other cases are just as exciting.
- 2.
Suppose pointwise covers . By\\autorefdefn:inductive-cover-interval-2 of \\autorefdefn:inductive-cover itsuffices to show that inductively covers whenever, so consider such and . By \\autorefclassical-Heine-Borelthere is a finite subfamily which already pointwise covers , and hence . Let be a Lebesgue numberfor as in\\autorefex:finite-cover-lebesgue-number. There is a positive such that . For let
The intervals , , …, inductively cover by repeated use of transitivity and \\autorefdefn:inductive-cover-interval-1in \\autorefdefn:inductive-cover. Because their widths are below each ofthem is contained in some , and we may use transitivity and monotonicity toconclude that inductively cover . ∎
The upshot of the previous theorem is that, as far as classical mathematics is concerned,there is no difference between a pointwise and an inductive cover. In particular, since itis consistent to assume excluded middle in homotopy type theory, we cannot exhibit aninductive cover which fails to be a pointwise cover. Or to put it in a different way, thedifference between pointwise and inductive covers is not what they cover but in theproofs that they cover.
We could write another book by going on like this, but let us stop here and hope that wehave provided ample justification for the claim that analysis can be developed in homotopytype theory. The curious reader should consult \\autorefex:mean-value-theorem forconstructive versions of the mean value theorem.