11.3.2 Induction and recursion on Cauchy reals
In order to do anything useful with , of course, we need to give its induction principle. As is the case whenever we inductively define two or more objects at once, the basic induction principle for and requires a simultaneous induction over both at once. Thus, we should expect it to say that assuming two type families over and , respectively, together with data corresponding to each constructor, there exist sections of both of these families. However, since is indexed on two copies of , the precise dependencies of these families is a bit subtle. The induction principle will apply to any pair of type families:
The type of is obvious, but the type of requires a little thought. Since must depend on , but in turn depends on two copies of and one copy of , it is fairly obvious that must also depend on the variables and as well as an element of . What is slightly less obvious is that must also depend on and .
This may be more evident if we consider the non-dependent case (the recursion principle), where is a simple type (rather than a type family). In this case we would expect not to depend on or . But the recursion principle (along with its associated uniqueness principle) is supposed to say that with is an βinitial objectβ in some category, so in this case the dependency structure of and should mirror that of and : that is, we should have . Combining this observation with the fact that, in the dependent case, must also depend on and , leads inevitably to the type given above for .
It is helpful to think of as an -indexed family of relations between the types and . With this in mind, we may write as . Since is unique when it exists, we generally omit it from the notation and write ; this is harmless as long as we keep in mind that this relation is only defined when . We may also sometimes simplify further and write , with and inferred from the types of and , but sometimes it will be necessary to include them for clarity.
Now, given a type family and a family of relations as above, the hypotheses of the induction principle consist of the following data, one for each constructor of or :
-
β’
For any , an element .
-
β’
For any Cauchy approximation , and any such that
(11.3.1) an element . We call such a dependent Cauchy approximation over .
-
β’
For such that , and all and such that , a dependent path .
-
β’
For and , if , we have
-
β’
For and and a Cauchy approximation, and a dependent Cauchy approximation over , if , then
-
β’
Similarly, for and and a Cauchy approximation, and a dependent Cauchy approximation over , if , then
-
β’
For and Cauchy approximations, and and dependent Cauchy approximations over and respectively, if we have , then
-
β’
For and and , and and , any two elements of and are dependently equal over . Note that as usual, this is equivalent to asking that takes values in mere propositions.
Under these hypotheses, we deduce functions
which compute as expected:
(11.3.2) | ||||
(11.3.2) |
Here denotes the result of applying and to a Cauchy approximation to obtain a dependent Cauchy approximation over . That is, we define , and then for any we have to witness the fact that is a dependent Cauchy approximation, where arises from the assumption that is a Cauchy approximation.
We will never use this notation again, so donβt worry about remembering it. Generally we use the pattern-matching convention, where is defined by equations such asΒ (11.3.2) andΒ (11.3.2) in which the right-hand side ofΒ (11.3.2) may involve the symbols and an assumption that they form a dependent Cauchy approximation.
However, this induction principle is admittedly still quite a mouthful. To help make sense of it, we observe that it contains as special cases two separate induction principles forΒ and forΒ . Firstly, suppose given only a type family , and define to be constant at . Then much of the required data becomes trivial, and we are left with:
-
β’
for any , an element ,
-
β’
for any Cauchy approximation , and any , an element ,
-
β’
for and , and and , we have .
Given these data, the induction principle yields a function such that
We call this principle -induction; it says essentially that if we take as given, then is inductively generated by its constructors.
In particular, if is a mere property, the third hypothesis in -induction is trivial. Thus, we may prove mere properties of real numbers by simply proving them for rationals and for limits of Cauchy approximations. Here is an example.
Lemma 11.3.2.
For any and , we have .
Proof.
Define . Since this is a mere proposition (by the last constructor of ), by -induction, it suffices to prove it when is and when is . In the first case, we obviously have for any , hence by the first constructor of . And in the second case, we may assume inductively that for all . Then in particular, we have , whence by the fourth constructor of . β
Theorem 11.3.3.
is a set.
Proof.
We can also show that although may not be a quotient of the set of Cauchy sequences of rationals, it is nevertheless a quotient of the set of Cauchy sequences of reals. (Of course, this is not a valid definition of , but it is a useful property.) We define the type of Cauchy approximations to be
The second constructor of gives a function .
Lemma 11.3.4.
Every real merely is a limit point: . In other words, is surjective.
Proof.
By -induction, we may divide into cases on . Of course, if is a limit , the statement is trivial. So suppose is a rational point ; we claim is equal to . By the path constructor of , it suffices to show for all . And by the second constructor of , for this it suffices to find such that . But by the first constructor of , we may take any with . β
Lemma 11.3.5.
If is a set and respects coincidence of Cauchy approximations, in the sense that
then factors uniquely through .
Proof.
Since is surjective, by \autoreflem:images_are_coequalizers, is the quotient of by the kernel pair of . But this is exactly the statement of the lemma. β
For the second special case of the induction principle, suppose instead that we take to be constant at . In this case, is simply an -indexed family of relations on -close pairs of real numbers, so we may write instead of . Then the required data reduces to the following, where denote rational numbers, positive rational numbers, and Cauchy approximations:
-
β’
if , then ,
-
β’
if and , then ,
-
β’
if and , then ,
-
β’
if and , then .
The resulting conclusion is . We call this principle -induction; it says essentially that if we take as given, then is inductively generated (as a family of types) by its constructors. For example, we can use this to show that is symmetric.
Lemma 11.3.6.
For any and , we have .
Proof.
Since both are mere propositions, by symmetry it suffices to show one implication. Thus, let . By -induction, we may reduce to the case that is derived from one of the four interesting constructors of . In the first case when and are both rational, the result is trivial (we can apply the first constructor again). In the other three cases, the inductive hypothesis (together with commutativity of addition in ) yields exactly the input to another of the constructors of (the second and third constructors switch, while the fourth stays put). β
The general induction principle, which we may call -induction, is therefore a sort of joint -induction and -induction. Consider, for instance, its non-dependent version, which we call -recursion, which is the one that we will have the most use for. Ordinary -recursion tells us that to define a function it suffices to:
-
1.
for every construct ,
-
2.
for every Cauchy approximation , construct , assuming that has already been defined for all ,
-
3.
prove for all satisfying .
However, it is generally quite difficult to showΒ 3 without knowing something about how acts on -close Cauchy reals. The enhanced principle of -recursion remedies this deficiency, allowing us to specify an arbitrary βway in which acts on -close Cauchy realsβ, which we can then prove to be the case by a simultaneous induction with the definition of . This is the family of relations . Since is independent of , we may assume for simplicity that depends only on and , and thus there is no ambiguity in writing instead of . In this case, defining a function by -recursion requires the following cases (which we now write using the pattern-matching convention).
-
β’
For every , construct .
-
β’
For every Cauchy approximation , construct , assuming inductively that has already been defined for all and form a βCauchy approximation with respect to β, i.e.Β that .
-
β’
Prove that the relations are separated, i.e.Β that, for any ,
-
β’
Prove that if for , then .
-
β’
For any and any Cauchy approximation , prove that assuming inductively that and for some , and that is a Cauchy approximation with respect to .
-
β’
For any Cauchy approximation and any , prove that assuming inductively that and for some , and that is a Cauchy approximation with respect to .
-
β’
For any Cauchy approximations , prove that assuming inductively that and for some , and that and are Cauchy approximations with respect to .
Note that in the last four proofs, we are free to use the specific definitions of and given in the first two data. However, the proof of separatedness must apply to any two elements of , without any relation to : it is a sort of βadmissibilityβ condition on the family of relations . Thus, we often verify it first, immediately after defining , before going on to define and .
Under the above hypotheses, -recursion yields a function such that and are judgmentally equal to the definitions given for them in the first two clauses. Moreover, we may also conclude
(11.3.7) |
As a paradigmatic example, -recursion allows us to extend functions defined on to all of , as long as they are sufficiently continuous.
Definition 11.3.8.
A function is Lipschitz if there exists (the Lipschitz constant) such that
for all and . Similarly, is Lipschitz if there exists such that
for all and ..
In particular, note that by the first constructor of , if is Lipschitz in the obvious sense, then so is the composite .
Lemma 11.3.9.
Suppose is Lipschitz with constant . Then there exists a Lipschitz map , also with constant , such that for all .
Proof.
We define by -recursion, with codomain . We define the relation to be
For , we define
For a Cauchy approximation , we define
For this to make sense, we must verify that is a Cauchy approximation. However, the inductive hypothesis for this step is that for any we have , i.e.Β . Thus we have
For proving separatedness, we simply observe that means , which implies and thus .
To complete the -recursion, it remains to verify the four conditions on . This basically amounts to proving that is Lipschitz for all the four constructors of .
-
1.
When is and is with , the assumption that is Lipschitz yields , hence by definition.
-
2.
When is and is with , then the inductive hypothesis is , which proves by the third constructor of .
-
3.
The symmetric case when is rational and is a limit is essentially identical.
-
4.
When is and is , with such that , the inductive hypothesis is , which proves by the fourth constructor of .
This completes the -recursion, and hence the construction of . The desired equality is exactly the first computation rule for -recursion, and the additional conditionΒ (11.3.7) says exactly that is Lipschitz with constant . β
At this point we have gone about as far as we can without a better characterization of . We have specified, in the constructors of , the conditions under which we want Cauchy reals of the two different forms to be -close. However, how do we know that in the resulting inductive-inductive type family, these are the only witnesses to this fact? We have seen that inductive type families (such as identity types, see \autorefsec:identity-systems) and higher inductive types have a tendency to contain βmore than was put into themβ, so this is not an idle question.
In order to characterize more precisely, we will define a family of relations on recursively, so that they will compute on constructors, and prove that this family is equivalent to .
Theorem 11.3.10.
There is a family of mere relations such that
(11.3.10) | ||||
(11.3.10) | ||||
(11.3.10) | ||||
(11.3.10) |
Moreover, we have
(11.3.10) | |||
(11.3.10) | |||
(11.3.10) |
The additional conditionsΒ (11.3.10)β(11.3.10) turn out to be required in order to make the inductive definition go through. ConditionΒ (11.3.10) is called being rounded. Reading it from right to left gives monotonicity of ,
while reading it left to right to openness of ,
ConditionsΒ (11.3.10) andΒ (11.3.10) are forms of the triangle inequality, which say that is a βmoduleβ over on both sides.
Proof.
We will define by double -recursion. First we will apply -recursion with codomain the subset of consisting of those families of predicates which are rounded and satisfy the one appropriate form of the triangle inequality. Thinking of these predicates as half of a binary relation, we will write them as , with the symbol referring to the whole relation. Now we can write precisely as
As usual with subsets, we will use the same notation for an inhabitant of and its first component . As the family of relations required for -recursion, we consider the following, which will ensure the other form of the triangle inequality:
We observe that these relations are separated. For assuming to show it suffices to show for all . But implies for some , by roundedness, which together with implies ; and the converse is identical.
Now the first two data the recursion principle requires are the following.
-
β’
For any , we must give an element of , which we denote .
-
β’
For any Cauchy approximation , if we assume defined a function , which we will denote by , with the property that
(11.3.11) we must give an element of , which we write as .
In both cases, we give the required definition by using a nested -recursion, with codomain the subset of consisting of rounded families of mere propositions. Thinking of these propositions as zero halves of a binary relation, we will write them as , with the symbol referring to the whole family. Now we can write the codomain of these inner recursions precisely as
We take the required family of relations to be the remnant of the triangle inequality:
These relations are separated by the same argument as for , using roundedness of all elements of .
Note that if such an inner recursion succeeds, it will yield a family of predicates which are rounded (since their image in lies in ) and satisfy
Expanding out the definition of , this yields precisely the third condition for to belong to ; thus it is exactly what we need.
It is at this point that we can give the definitionsΒ (11.3.10)β(11.3.10), as the first two clauses of each of the two inner recursions, corresponding to rational points and limits. In each case, we must verify that the relation is rounded and hence lies in . In the rational-rational caseΒ (11.3.10) this is clear, while in the other cases it follows from an inductive hypothesis. (InΒ (11.3.10) the relevant inductive hypothesis is that , while inΒ (11.3.10) andΒ (11.3.10) it is that .)
The remaining data of the sub-recursions consist of showing that (11.3.10)β(11.3.10) satisfy the triangle inequality on the right with respect to the constructors of . There are eight cases β four in each sub-recursion β corresponding to the eight possible ways that , , and inΒ (11.3.10) can be chosen to be rational points or limits. First we consider the cases when is .
-
1.
Assuming and , we must show . But by definition of , this reduces to the triangle inequality for rational numbers.
-
2.
We assume such that and , and inductively that
(11.3.12) We assume also that is a Cauchy approximation with respect to , i.e.
(11.3.13) although we do not need this assumption in this case. Indeed, (11.3.12) with yields immediately , and hence by definition of .
- 3.
- 4.
Now we move on to the cases when is , with a Cauchy approximation. In this case, the ambient inductive hypothesis of the definition of is that we have , so that in addition to being rounded they satisfy the triangle inequality on the right.
-
5.
Assuming and , we must show . By definition of , the former means , so that above triangle inequality implies , hence as desired.
-
6.
We assume such that and , and two unneeded inductive hypotheses. By definition, we have such that , so the inductive triangle inequality gives . The definition of then immediately yields .
-
7.
We assume such that and , and two unneeded inductive hypotheses. By definition we have such that . Since is a Cauchy approximation, we have , so the inductive triangle inequality gives and then . The definition of then gives , as desired.
-
8.
Finally, we assume such that and . Then as before we have with , and two applications of the triangle inequality suffices as before.
This completes the two inner recursions, and thus the definitions of the families of relations and . Since all are elements of , they are rounded and satisfy the triangle inequality on the right with respect to . What remains is to verify the conditions relating to , which is to say that these relations satisfy the triangle inequality on the left with respect to the constructors of . The four cases correspond to the four choices of rational or limit points for and inΒ (11.3.10), and since they are all mere propositions, we may apply -induction and assume that is also either rational or a limit. This yields another eight cases, whose proofs are essentially identical to those just given; so we will not subject the reader to them. β
We can now prove:
Theorem 11.3.14.
For any and we have .
Proof.
Since both are mere propositions, it suffices to prove bidirectional implication. For the left-to-right direction, we use -induction applied to . Thus, it suffices to consider the four constructors of . In each case, and are specialized to either rational points or limits, so that the definition of evaluates, and the inductive hypothesis always applies.
For the right-to-left direction, we use -induction to assume that and are rational points or limits, allowing to evaluate. But now the definitions of , and the inductive hypotheses, supply exactly the data required for the relevant constructors of . β
Stretching a point, one might call a fibration of βcodesβ for , with the two directions of the above proof being and respectively. By the definition of , from \autorefthm:RC-sim-characterization we get equivalences
Our proof also provides the following additional information.
Corollary 11.3.15.
is rounded and satisfies the triangle inequality:
(11.3.15) | |||
(11.3.15) |
With the triangle inequality in hand, we can show that βlimitsβ of Cauchy approximations actually behave like limits.
Lemma 11.3.16.
For any , Cauchy approximation , and , if then .
Proof.
We use -induction on . If is , then this is exactly the second constructor of . Now suppose is , and that each has the property that for any , if then . In particular, taking and in this assumption, we conclude that for any .
Now let be arbitrary and assume . By roundedness, there is a such that . Then by the above observation, for any we have , and hence by the triangle inequality. Hence, the fourth constructor of yields . Thus, if we choose , the result follows. β
Lemma 11.3.17.
For any Cauchy approximation and any we have .
Proof.
Take and in the previous lemma. β
Remark 11.3.18.
We might have expected to have , but this fails in examples. For instance, consider defined by . Its limit is clearly , but we do not have , only .
As an application, \autorefthm:RC-sim-lim-term enables us to show that the extensions of Lipschitz functions from \autorefRC-extend-Q-Lipschitz are unique.
Lemma 11.3.19.
Let be continuous, in the sense that
and analogously for . If for all , then .
Proof.
We prove for all by -induction. The rational case is just the hypothesis. Thus, suppose for all . We will show that for all , so that the path constructor of applies.
Since and are continuous, there exist such that for all , we have
Choosing , by \autorefthm:RC-sim-lim-term we have both and . Hence
and thus by the triangle inequality. β
Title | 11.3.2 Induction and recursion on Cauchy reals |
\metatable |