TL;DR
This paper develops a new theorem about equality types in homotopy type theory, enabling more direct reasoning about coequalizers and pushouts, simplifying proofs, and extending classical results like the Seifert-van Kampen theorem.
Contribution
It proves a general theorem on equality types of coequalizers and pushouts without truncation restrictions, streamlining proofs and suggesting higher homotopy analogues.
Findings
Simplified calculation of the fundamental group of the circle
Proof that pushouts preserve embeddings
A higher version of the Seifert-van Kampen theorem
Abstract
The study of equality types is central to homotopy type theory. Characterizing these types is often tricky, and various strategies, such as the encode-decode method, have been developed. We prove a theorem about equality types of coequalizers and pushouts, reminiscent of an induction principle and without any restrictions on the truncation levels. This result makes it possible to reason directly about certain equality types and to streamline existing proofs by eliminating the necessity of auxiliary constructions. To demonstrate this, we give a very short argument for the calculation of the fundamental group of the circle (Licata and Shulman '13), and for the fact that pushouts preserve embeddings. Further, our development suggests a higher version of the Seifert-van Kampen theorem, and the set-truncation operator maps it to the standard Seifert-van Kampen theorem (due to Favonia and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Path Spaces of Higher Inductive Types
in Homotopy Type Theory
Nicolai Kraus and Jakob von Raumer
Abstract.
The study of equality types is central to homotopy type theory. Characterizing these types is often tricky, and various strategies, such as the encode-decode method, have been developed.
We prove a theorem about equality types of coequalizers and pushouts, reminiscent of an induction principle and without any restrictions on the truncation levels. This result makes it possible to reason directly about certain equality types and to streamline existing proofs by eliminating the necessity of auxiliary constructions.
To demonstrate this, we give a very short argument for the calculation of the fundamental group of the circle (Licata and Shulman [26]), and for the fact that pushouts preserve embeddings. Further, our development suggests a higher version of the Seifert-van Kampen theorem, and the set-truncation operator maps it to the standard Seifert-van Kampen theorem (due to Favonia and Shulman [18]).
We provide a formalization of the main technical results in the proof assistant Lean.
Nicolai Kraus is supported by the Engineering and Physical Sciences Research Council (EPSRC), grant reference EP/M016994/1.
1. Introduction, Motivation, and Overview
1.1. Homotopy Type Theory
Martin-Löf’s intensional type theory is a specific form of type theory which can serve as both a foundation for dependently typed programming languages and as a system in which mathematics can be developed. An important concept is identity or equality types: if is a type and are elements, then is a type whose elements we view as proofs that and are equal. Following a widespread convention, we denote this type by or . In contrast, we denote definitions by .
Homotopy type theory, commonly known as HoTT, is a variation of Martin-Löf’s type theory. It is inspired by the observation that equalities behave like paths in homotopy theory, and this connection is so central that equality types are even referred to as path spaces in HoTT. As described in the book [35], two main features distinguish it from other variations of type theory. First, Voevodsky’s univalence axiom (or univalence principle) ensures that the equality of types corresponds to equivalence of types (“coherent isomorphism”). Second, higher inductive types are an implementation of the idea that, if we can generate the elements of a type inductively, we could inductively generate its equalities at the same time.
1.2. Quotients and Coequalizers
One central example for a class of higher inductive types is what we call (homotopy) coequalizers of relations. Coequalizers can (via straightforward constructions) be used to encode many other higher inductive types such as circles and spheres, tori, suspensions, general pushouts, and (via more difficult constructions) propositional truncations [36, 21] and higher truncations [32].
Coequalizers are of particularly great importance for the development of HoTT in the proof assistant Lean [16], since they are, together with propositional truncations, the only classes of higher inductive types that are defined in the prelude and thus “available by default”. Much of HoTT in Lean is based on them, and they are known as quotients or typal quotients [38] in the Lean community. While they certainly look like quotients, we choose to avoid this name since it could be confusing for readers outside of the Lean community (see the discussion below).
Definition 1** (coequalizer of a relation).**
Assume is a type ( is a universe), and is a family of types indexed twice over , sometimes called a “binary proof-relevant relation” ; we write instead of . The coequalizer is the higher inductive type generated by the constructors and , as in:
[TABLE]
The constructors express the idea that we take and make related elements equal. We use curly brackets for the first two arguments of the constructor, , to express that we will keep these arguments implicit to improve readability. On paper, we can view this as purely on the level of notation, i.e. write simply as shorthand notation for .
Let us justify why we call a coequalizer. In standard category theory, given two morphisms/functions , their coequalizer can be thought of as the object/type where and are identified. In “standard” HoTT (as developed in the book [35]), this can be expressed as the following higher inductive type:
[TABLE]
Given and , we can define the relation on by . It is then easy to see that is equivalent to . In Lean, where the higher inductive type (2) is not available, we can thus use instead.
Vice versa, if we start with a relation , we can consider the two projections
[TABLE]
Then, is equivalent to .
In order to explain why we choose to avoid calling a quotient, we want to emphasize two points:
- (I)
Recall that a (homotopy) set in HoTT is a type satisfying the principle of unique identity proofs, i.e. a type such that, for and , we always have . The type is in general not a set. However, the variation of the construction which forces it to be a set is in the book [35] called a set-quotient and sometimes simply a quotient. 2. (II)
The relation is neither required to be (homotopy) propositional (i.e. it is “proof relevant”), nor is it required to be reflexive, symmetric, or transitive.
It might be reasonable to speak of a quotient by a higher relation (cf. [5]) which is freely generated by , but we do not go into this.
The points I and II above make coequalizers very flexible and remarkably powerful. Not forcing to be a set lets us implement many interesting structures. For example, we can consider the (seemingly) trivial case where is the unit type and is constantly unit as well. Then, the quantifications in the constructors in (1) are unnecessary, and (1) simplifies to the definition of the circle type , as on the right side:
\mathsf{base}$$\mathsf{loop}
[TABLE]
The left side above shows how can be drawn, thinking of elements as points and equalities as paths as suggested by the intuition that HoTT is inspired by.
Point II from above allows further important constructions. We have already seen that general (homotopy) coequalizers of two functions can be constructed. Similarly, the (homotopy) pushout on the right can be defined as , where
[TABLE]
and , , are all empty. Here, is neither reflexive, nor symmetric, nor transitive.
Higher inductive types, such as the ones above, allow the development of a synthetic version of homotopy theory inside HoTT (cf. [11, 8, 9, 10, 18, 25, 24, 7, 32]). A main objective of this line of research is to describe, classify, and compare path spaces (i.e. equality types) or homotopy groups (i.e. truncated path spaces) of higher inductive types such as circles and spheres.
For a (higher) inductive type, we know that its elements are generated by the constructors. This is expressed by elimination principles. Following the terminology of the book [35], we refer to the dependent elimination rule as induction and the non-dependent one as recursion. The induction principle for coequalizers, as it is standard in HoTT and implemented in Lean, states the following:
Principle 2** (induction for coequalizers).**
Given a type family , and terms
[TABLE]
we get a term
[TABLE]
such that computes to and, if applied on , it equals what we get from .
Here, we use the path-over a.k.a. dependent path notation [35, p.183] in the expression : Note that and do not have the same type, but by transporting/substituting along , we can equate them.
1.3. Motivation for the Main Result
Often, we want to find out what specific equality types look like. This is directly the goal when calculating the homotopy groups of given types (as in the synthetic homotopy theory mentioned above), but it is also a necessary intermediate step for many other constructions. For a very concrete example, let us recall the calculation of the loop space of the circle by Licata and Shulman [26]. This loop space of , as defined above in (4), is by definition simply the equality type . Licata and Shulman introduce and explain the encode-decode method: in order go get started, they “guess” that the loop space in question is equivalent to the integers (looking at the left side of (4), the intuition is that one can go around the loop clockwise any number of times, and negative numbers correspond to going anticlockwise). Licata and Shulman then define a type family , inspired by the “guess”, and construct functions between and in order to show that these types are equivalent. Finally, observing that is gives the desired result.
The encode-decode method has been employed successfully in a variety of cases. Going through the necessary steps can be somewhat tedious but it often at least partially mechanical. One main goal in this paper is to develop a different method to directly work with equality types of coequalizers and pushouts (and constructions based on them): Since elimination rules such as 2 characterize the points of an inductive type, and higher inductive types define points and equalities simultaneously, we believe that it is natural to hope for an “induction principle for equalities”, i.e. a theorem which is reminiscent of an elimination rule. More concretely, for our case of coequalizers, let us assume we are given a type family
[TABLE]
We ask ourselves whether there are simple-to-check conditions that are sufficient to conclude for a general , i.e. for any given with .
Note that in (9) quantifies over two elements of and an equality in . In comparison, if we asked the same question for a type family instead of , the answer would be the eliminator (a.k.a. path induction), which says that it would be sufficient to prove . What we want and need in all the application is the version with “restricted” endpoints as in (9).
It turns out that there is an easy but powerful generalization of the above question. We get this generalization by switching from the global (or unbased) setting as in (9) to a local (based) one: we can fix one of the two endpoints to be and replace by a family which is indexed only once over ,
[TABLE]
This is akin to the difference between the standard (a.k.a. path induction) and the Paulin-Mohring [30] (a.k.a. based path induction). Just as for the two versions of , a principle answering the based version of the question also answers the unbased one, and we thus focus exclusively on the former.
To get some intuition for the subtleties of equality types, let us first look at an “obvious” induction principle for (10) that turns out to be wrong. Usually, induction principles contain “one case for every constructor” (e.g. 2 contains one case for , and one case for ). The standard equality constructor is , and (1) contains a further path constructor . Thus, we might try:
Incorrect principle**.**
Given and a family as in (10) and terms
[TABLE]
can we conclude ?
Counterexample.
Consider the relation on the natural numbers , defined by . We can then look at the coequalizer . Let us take as the base point and , defined by . It is very easy to construct the terms and in (11,12). At the same time, we have that is empty. ∎
The above naïve suggestion was easy to disprove, but let us try to understand why it was insufficient. Equalities that come from can, by , be assumed to be ; these are sufficiently covered. However, this is not true for equalities that are generated using the constructor. The counterexample uses that we have not explicitly closed them under symmetry, and similarly, we could have used that we have not closed them under transitivity.
How could we fix this? Given an equality in , we can compose it with assuming the endpoints match, which suggests that the induction principle we are looking for should assume Q(q)\to Q(q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{glue}(s)), where q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}p denotes the concatenation of two equalities and . We also can compose with , suggesting that we also need Q(q)\to Q(q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{glue}(s)^{-1}). The operations of composing with and composing with should be inverse to each other, which motivates us to ask for only one of them and require this one to be an equivalence, i.e. Q(q)\simeq Q(q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{glue}(s)). This leads us to a valid induction principle which is short, useful (as we will see when discussing applications), and comes with -rules. Proving this principle is a main result of this paper:
Theorem 3** (induction for coequalizer equality).**
Assume we have , as before and a point , and are further given a type family
[TABLE]
together with terms
[TABLE]
Then, we can construct a term
[TABLE]
with the following -rules:
[TABLE]
Remark 4**.**
The above theorem can be proved in a way which makes the first -rule (17) hold judgmentally. This is what we have done in our formalization (see Section 1.7). It offers some additional convenience. In this paper, we do not track judgmental equalities explicitly.
1.4. Further Contents
Section 2 proves the stated theorems above. The proof makes use of the fact that such induction principles always have non-dependent counterparts which, when stated together with their uniqueness properties, are interderivable with the induction principles. The section should be seen as the core of the paper. It is split into three subsections introducing the main ideas, performing the technical constructions, and deriving the induction principle from the non-dependent version. We will see that it is useful to state our main results for pushouts instead of coequalizers, and this is discussed further in Section 3. Building on this, we offer several further results and applications in this paper.
In Section 4, we demonstrate first applications of our theorems, one for the non-dependent coequalizer version and another for the dependent pushout version. Concretely, in Section 4.1, we show how our result immediately implies that the loop space of the circle (4) is equivalent to the integers [26]. In Section 4.2, we apply our result to prove a theorem in which our main result helps to avoid a somewhat tedious encode-decode agrument: Embeddings are preserved under pushouts [17].
The Seifert-van Kampen theorem, a result in algebraic topology allowing the computation of the fundamental group of a space if the groups of subspaces are known, was formulated and proved in HoTT by Favonia and Shulman [18]. How to do a higher version of this theorem, i.e. without set-truncation, is an open question in HoTT. In Section 5, we suggest one formulation of a higher Seifert-van Kampen theorem and prove it using the main result of this paper.
1.5. Summary of our Contributions
- •
We prove a new induction principle for equality types in coequalizers and pushouts.
- •
To demonstrate the usefulness of this principle, we present a very short proof of the fact that the loop space of is [26] and that embeddings are closed under pushout (possibly a new result in HoTT).
- •
We formulate and prove a higher dimensional Seifert-van Kampen theorem, generalizing the result by Favonia and Shulman [18].
1.6. Setting and Notation
We work in the “standard” version of homotopy type theory that is also developed in the book [35] with sums, - and -types, a hierarchy of univalent universes (we actually only need two), and inductive and higher inductive types. To be precise, the main part only requires coequalizers (Definition 1) and no other higher inductive types, which is what Lean provides by default; and our formalization does not require any further “higher inductive types via postulates”. Only Section 5 makes use of the additional concept of an indexed higher inductive types, but this part is independent from the main results of this paper.
We use standard notation as used in [35] (with only minor modifications). In particular, we uncurry implicitly and write instead of or if has type . To further improve readability, we use implicit arguments (purely on the notational level) as explained after Definition 1 above.
1.7. Formalization
The main technical results have been formalized in the theorem prover Lean [16]: We formalized the equivalence of wild categories and constructed their initial objects as in Section 2.1 and 2.2. We showed the non-dependent eliminator and its uniqueness, using a shortcut to make the first -rule hold judgmentally, and used it to derive the dependent eliminator (the induction principle) with judgmental first -rule as proved in Section 2.3. We furthermore implemented the version for pushouts similar to the construction of Section 3 and proved that pushouts preserve embeddings (Section 4.2). We have not formalized the example in Section 4.1; the (in the context of this paper) interesting part of that example is immediate. Further, the development and discussion in Section 5 is not formalized (cf. Remark 21).
Our code can be found at gitlab.com/fplab/freealgstr.
2. The Main Theorem: Path Spaces of Coequalizers
We will first formulate and prove the non-dependent version of the main result, by developing the corresponding categorical framework inside type theory. This then allows us to derive the induction principle as stated in Theorem 3.
2.1. Categorical Ideas in Type Theory
Using categorical ideas to structure constructions and reason inside type theory is standard. The induction (a.k.a. dependent elimination) principle of an inductive type can equivalently be formulated as a recursion (non-dependent elimination) principle together with a uniqueness principle, often formulated as a universal property. A principled way of doing this is to define objects and morphisms of a category; the statement is then that the inductive type in question is (homotopy) initial in this category. For the specific case of HoTT, the connection between induction and initiality has been shown by Awodey, Gambino and Sojakova [4] for inductive types, and by Sojakova [34] for some higher inductive types.
However, category theory in HoTT is subtle. The “obvious” naïve definition of a category without truncation (sometimes called a wild category; Definition 5) is not a well-behaved notion; for example, the slice of a wild category is not a wild category anymore. The underlying reason is that the identity and associativity equalities do not behave like laws, but like higher morphisms in a higher category where coherences are required. One approach to higher categories in HoTT is discussed in [12]. Alternatively, the univalent categories of [1] restrict the truncation levels to avoid the issue. For us, truncating is not a suitable strategy since it would not allow us to prove our general result.
Although not well-behaved in general, wild categories are still a useful tools in this paper. We do not think of them as “bad ordinary categories” but instead as an approximation to -categories, where most of the (higher) data is omitted. However, since none of our constructions require us to actually use the omitted data, we get away with this. Most importantly, we can talk about the concept of (homotopy) initiality without ever referring to higher morphisms. Technically, we do not even need associativity; it could be excluded from the following definition without consequences for the rest of the paper.
Definition 5** (wild categories and initiality).**
A wild category , for simplicity henceforth simply category, consists of a type of objects; for , a type of morphisms; a composition operator and identities in the obvious way, together with the two standard equalities for the identies and one equality which states that is associative. An object is called initial if, for every object , the type is contractible (i.e. equivalent to the unit type).
For the whole section, let us assume that a type together with and a relation is given. Our main category of interest is the following:
Definition 6**.**
The category is defined as follows. Objects in are “pointed type families respecting ”, i.e. triples of the types
[TABLE]
Morphisms are “pointed fibrewise functions”. Explicitly, a morphism in is a triple :
[TABLE]
Here, is an equality witnessing that, for any , the following square commutes:
[TABLE]
The remaining components (identities, composition, equations) are straightforward to define. For example, identities are given as and composition by
[TABLE]
where the last bit is given by pasting two vertically neighboring squares (25) (we do not think that writing down the full type-theoretic expression for this offers much insight).
A variation of Theorem 3, this time not as induction but as non-dependent elimination principle with uniqueness, can now be stated as follows:
Theorem 7** (initiality of coequalizer equality).**
Consider the object of , where the first part is given by
[TABLE]
i.e. is given by equality in the coequalizer . The point is given by
[TABLE]
For every , the component is the equivalence between and which is given by composition with ; we simply write
[TABLE]
Then, our statement is: The object is initial in the category .
Section 2.2 is devoted to the proof of this theorem, requiring various constructions and lemmas.
2.2. Initiality of Coequalizer Equality
In order to prove Theorem 7, we consider a second category which we call . We will then show that and are isomorphic. The point is that it is very easy to find the initial object in , and, via the isomorphism, it can easily be transported to . A useful technical tool is the formulation of coequalizer induction as an equivalence, which is what we start with.
Lemma 8** (coequalizer induction as equivalence).**
Given a type family , there is a canonical map from the type
[TABLE]
to the type
[TABLE]
mapping to the pair . This canonical map is an equivalence.
Note that is the “dependent function” [35].
Proof.
The standard induction principle, given as 2 above, states that there is a function from (31) to (30) with -rules that essentially amount to stating that this function is a section of the canonical map above. Lemma 8 replaces “section” by “inverse”. This easily follows from the standard induction principle. We are not the first to make this observation: a small variation of the lemma is already present in the Lean library [37]. ∎
Remark 9**.**
Note that Lemma 8 crucially depends on the “non-recursiveness” of . For example, the analogous statement for the natural numbers is false (i.e. assuming it leads to a contradiction).
In line with the strategy outlined above, we further consider the following category :
Definition 10** (category ).**
is the category of pointed families over . Explicitly, objects in are pairs as in
[TABLE]
and morphisms in are pairs of types
[TABLE]
Again, the remaining components of the category are defined in the straightforward way.
The connection between and is as follows:
Lemma 11**.**
The two categories are isomorphic, in the following sense. There is a map
[TABLE]
which is an equivalence, and there is also a map
[TABLE]
such that each is an equivalence. Moreover, identities and compositions are preserved by the equivalence.
Proof.
Let us unfold the type in (36); this is the type of the equivalence that we want to construct:
[TABLE]
Lemma 8 gives us a tool to construct equivalences. Let us use that lemma with the constant family ; this makes use of the fact that the lemma works on all universe levels. The lemma then gives us, simply by replacing by , renaming variables, and using that we are now in the non-dependent special case, the following equivalence :
[TABLE]
Moreover, we know how is defined, namely by
[TABLE]
(since we are in the non-dependent case, became ).
We claim that the function of type (38) can be constructed from the function of type (39) via two small modifications:
- •
First, if we compare the domains of with the domain of , and the codomain of with the codomain of , we see that the “point-component” is missing from , i.e. the -component is missing in its domain and is missing in its codomain. However, we can just extend domain and codomain with this -component. The equation (40) tells us that this extension is completely trivial, since , i.e. we extend with the identity on one additional new component.
- •
The codomain of this extended only differs from the codomain of in that the component in (39) concludes with , while the component in (38) concludes with . To close this gap, we can use the canonical function which turns an equality between types into an equivalence (cf. [35]), and of which the univalence axiom ensures that it is an equivalence itself.
This concludes the construction of the equivalence , and, using (40), we can write down how the function part of it computes when applied to a pair :
[TABLE]
The construction of as in (37) is slightly more subtle since it depends on , but works in essentially the same way. Assume we are given and in . We unfold the type of as in (37), making use of equation (41). This gives us the type that we want to inhabit:
[TABLE]
Let us use Lemma 8 again, this time with the family . Simply by plugging this into Lemma 8 (and renaming variables), we get the following equivalence :
[TABLE]
Similar to what we have done before, we have to use (43) to derive (42); and as before, there are two steps. First, we need to add the equation for the points (i.e. the components and ), but this is as simple and direct as before; we do not spell out the details.
Second, and more interestingly, we have to show that the ’s of (42) and (43) coincide (i.e. that their types are equivalent). As very often in HoTT when we want to prove something for a specific equality (here ), the easiest way to do this is to generalize the statement and formulate it in terms of an arbitrary equality, which then allows path induction. The only red herring here is that is a family of functions; but, since it is indexed over and the equality in question lives in , we cannot make use of this. The equivalence follows from Lemma 12 below, by using for , and for , and for .
It is easy to check that preserves identities and compositions of morphisms. ∎
Lemma 12**.**
Let be a type, two type families, and elements and an equality. Assume we have functions and . Then, the type is equivalent to the type
[TABLE]
Proof.
By induction, we can assume , in which case both expressions evaluate to . ∎
Having shown Lemma 11, which constitutes the main technical difficulty of the proof of Theorem 7, we can work with instead of . The benefit is that it is easy to find the initial object of :
Lemma 13**.**
Let us consider the object of , given as follows:
[TABLE]
This object is initial in .
Proof.
Let be any other object. After unfolding the definition in (34,35), the type is given by
[TABLE]
This type is contractible by applying “singleton contraction” twice: first, we use that an element together with an equality form a contractible pair, simplifying the above type to ; and this type is clearly contractible. ∎
Having found the initial object in , we transport it to in order to prove the categorical version of our main result, namely Theorem 7:
Proof of Theorem 7.
Since as constructed in Lemma 11 preserves morphism spaces, preserves the initial object. Thus, all we need to do is to use the object found in Lemma 13 and compute using (41). This gives us and immediately. The last component is correct by a standard “path induction”-argument. ∎
2.3. Derivation of the Induction Principle
The main part of the derivation of the based induction principle (Theorem 3) from the non-dependent based formulation (Theorem 7) is completely standard and follows known principles, cf. the work by Awodey, Gambino, and Sojakova [4]. We use the “total space” construction to turn the dependent case into the non-dependent one. Afterwards, we still need to derive the -rules, and this is trickier; we use a small trick to “strictify” equations. Let us restate the theorem which we want to prove:
See 3
Proof.
Assume , and are given. The “total space” versions of these three components form an object of the category , and they are defined as follows:
[TABLE]
Note that the last line (53) implicitly uses that an equivalence between -types can be constructed from a pair of equivalences for the first and second component. Explicitly, the function part of the equivalence maps a given pair with and to the pair (q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{glue}(s),e(q,s,x)).
We have a morphism from the initial object of to this newly constructed object (let’s call it ), but we also have the “first projection” into the other direction:
[TABLE]
It follows from initiality that the composition of these morphisms is the identity on the object , i.e. we have a of the following type:
[TABLE]
In particular, given any , we get an equality
[TABLE]
and we can define:
[TABLE]
This defines the induction principle, but the two -rules still need to be justified. The equality in (56) consists of three parts, one for each component [35, Thm 2.7.2]; let us write for them. The general idea is that, just as has allowed us to construct the induction principle (59), allows us to show the first -equation and gives us the second. The main difficulty here are the many transports/pathovers involved, since the types of and depend on . The trick is to split into by setting , , and similarly split and . Using this, and calculating the left side of (56), we get
[TABLE]
Now, we can generalize the situation: we claim that, for all , we can derive the induction principle plus two -equalities. This formulation allows us to use based path induction on and assume that , . This lets the mentioned dependencies disappear and we get as well as . In addition, (59) simplifies to .
For the first -equality, we unfold the type of :
[TABLE]
We need to show that the second components are equal. From , we get that the second components are equal when one is transported along the , and from , we get that this is a transport along .
The procedure for the second -equation is similar. The details are best seen by considering the following diagram:
[TABLE]
says that this square commutes. Let us take some and see how it is mapped (using and so on):
[TABLE]
Here, tells us that the two pairs at the bottom right are equal. As before, we need that their second components are equal; and analogously to what we did before, we use to see that this is the case. ∎
3. Equality in Pushouts
As discussed in the introduction, pushouts and coequalizers can easily be defined in terms of each other. The standard representation in the HoTT literature as a higher inductive type, where we assume that types and functions and are given, is as follows:
[TABLE]
L$$N$$M$$M\!\sqcup^{L}\!N$$\scriptstyle f$$\scriptstyle g$$\scriptstyle\mathsf{inl}$$\scriptstyle\mathsf{inr}
We write for the map given by . To simplify notation, we keep the inclusions and implicit.
Since pushouts are used a lot and play a vital role in the Seifert-van Kampen theorem (cf. Section 5), we want to state our main result explicitly for pushouts instead of coequalizers. The proofs can straightforwardly be obtained by expressing the pushouts as coequalizers, as described in the introduction.111In Lean, this is simply a specialization.
Theorem 14** (induction for pushout equality).**
Assume are given as above, together with a point . Assume we are given families and terms as follows:
[TABLE]
*Then, we can construct terms *
[TABLE]
with the following -rules:
[TABLE]
∎
Remark 15**.**
As before, the first -rule (70) holds judgmentally in our formalization.
Theorem 16** (initiality of pushout equality).**
Given the same data as in the previous theorem, we can consider the category , whose definition mirrors that of . Objects are quadruples ,
[TABLE]
[TABLE]
and a morphism between and consists of fiberwise functions which preserve and commute with .
Then, the object defined by
[TABLE]
is initial in .∎
4. First Applications
We anticipate that our main result, especially in the formulations of Theorem 3 and 16, will be a useful tool for a variety of constructions in HoTT. Our own motivation for developing these theorems is the concrete realization of the plans outlined by the first-named author [22]. In this paper, we present two shorter applications.
4.1. The Loop Space of the Circle
Recall that the loop space of a type with an (implicitly given) point is defined to be . Thus, the loop space of the circle (4) is simply . Let us reprove the following known result:
Theorem 17** (Licata-Shulman [26]).**
.
Proof.
As discussed in the introduction, is the coequalizer of and the relation which has as its value. This allows us to apply Theorem 7 and, since all quantifications are now quantifications over the unit type, we can safely ignore them. Thus, \big{(}\Omega(\mathbb{S}^{1}),\mathsf{refl},\_\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{loop}\big{)} is the initial object in the category of pointed types with an automorphism. Due to the uniqueness of initial objects, all we need is that is initial in this category. This statement is completely removed from the higher inductive type ; it is a basic property of the integers, analogous to the fact that is initial in the category of pointed types with an endofunction. ∎
Of course, the difficulty of a concrete proof for the initiality property depends on the concrete definition of that one uses. With the definition used by Licata and Shulman (essentially ), this is easy albeit some work. We will come back to definitions of the integers in Remark 21.
4.2. Pushouts Preserve Embeddings
Recall that an embedding is a map whose fibers are propositions, i.e. where, for each , the type is a (“mere”) proposition. Equivalently, is an embedding if and only if
[TABLE]
is a family of equivalences between path spaces. As formalized by Finster [17] via an encode-decode construction, embeddings are closed under pushout. As a further application of our main result, we present an alternative (and significantly shorter) argument.
Theorem 18** (Finster [17]).**
Embeddings are closed under pushout. Explicitly, if in the diagram on the right is an embedding, then so is .
L$$N$$M$$M\!\sqcup^{L}\!N$$\scriptstyle f$$\scriptstyle g$$\scriptstyle\mathsf{inl}$$\scriptstyle\mathsf{inr}
Proof.
Using (80), we need to show that is an equivalence for all points . Thus, for any , we want to find something in the fiber over . This tells us how we need to choose the type family (65) of Theorem 14: we fix and define
[TABLE]
We also need to define the type family (64). Given something in , we “move” it back to by going via the fiber, which allows us to define using :
[TABLE]
The component (66) is the obvious one, . For a given we know that, since is an embedding, the type is contractible and we can assume . This implies P(f(l),q)\simeq Q(g(l),q\mathchoice{\mathbin{\raisebox{2.15277pt}{\displaystyle\centerdot}}}{\mathbin{\raisebox{2.15277pt}{\centerdot}}}{\mathbin{\raisebox{1.07639pt}{\scriptstyle,\centerdot,}}}{\mathbin{\raisebox{0.43057pt}{\scriptscriptstyle,\centerdot,}}}\mathsf{glue}(l)), which is exactly what we need in order to define the component (67). Thus, we have
[TABLE]
i.e. a section of (a function such that ). To show that is the identity, we do path induction and use the first -rule (70). ∎
5. Free Groupoids and a Higher Seifert-van Kampen Theorem
The traditional Seifert-van Kampen (SvK) theorem, a standard result in algebraic topology, makes it possible to calculate the fundamental group of a topological space when the fundamental groups of two open and path-connected subspaces covering are already known. Favonia and Shulman [18] have stated and shown this theorem in HoTT, where the union of subspaces can be phrased as a (homotopy) pushout. Their result is that fundamental groups of a pushout are equivalent to a type which they define as a set-quotient of a list.
Fundamental groups (in topology) are quotients of spaces or (in HoTT) are [math]-truncations of equality types. Thus, it is natural to ask for a higher dimensional version of the theorem which does not quotient or truncate. In homotopy theory, different versions have been proved by Lurie [27] and Brown, Higgins, and Sivera [6]. In HoTT, it is an open problem how this could be done. Our results of the current paper suggest one possible such higher SvK theorem, which (after recalling the Favonia-Shulman result) we present in this section.
Note that the precise formulation of a theorem is part of the open question how to generalize the SvK theorem in HoTT, since the analogue of the family by Favonia and Shulman has to be defined (and a trivial solution exists: define this analogue to be the equality). Our justification for why the analogue we suggest is reasonable is that, by [math]-truncating, the Favonia-Shulman theorem can be recovered relatively easily.
As before in Section 3, let us assume that the types and functions in the pushout on the right are given for the rest of the section. As in [18], we write .
L$$N$$M$$P$$\scriptstyle f$$\scriptstyle g$$\scriptstyle\mathsf{inl}$$\scriptstyle\mathsf{inr}
A caveat is in order. In this section, we make use of indexed higher inductive types, and this is not part of our formalization. Note that indexed inductive types can always be encoded via inductive types [2, 33], and we expect that the same is true for indexed higher inductive types.
5.1. The Favonia-Shulman SvK Theorem
Favonia and Shulman give two versions of the SvK theorem. We concentrate on the first (“naive Seifert-van Kampen Theorem”); we think the difference between the two versions is not really relevant for what we present in the current paper. We do not repeat their definition of in full detail, since this definition is of significant length (2 pages including careful explanations and remarks). In a nutshell, is a set-quotient of a type of lists which “link” and , where . For simplicity, we restrict ourselves to endpoints in (instead of ). Let us fix . Then, the considered lists are points together with and such that the and form a path from to as in the following drawing, where the vertical arrows are ’s:
[TABLE]
Next, a set-quotient is taken which ensures that we can remove “trivial” paths in the above picture. For example, if and , then the set-quotient ensures that the above list is identified with the following:
[TABLE]
This set-quotient defines the type , and the definition where one or both endpoints are in is analogous. Restricted to the case where we consider endpoints in , the SvK theorem states:
Theorem 19** (Favonia and Shulman [18]).**
For , there is an equivalence . ∎
5.2. From Quotiented Lists to Free Higher Groupoids
The central difficulty of a higher version of the SvK theorem is, of course, avoiding the set-truncation. Note that, in the above description of the lists, the set-truncations in and can be removed since we set-truncate later when taking the set-quotient. This is essentially a repeated application of the equivalence
[TABLE]
This unnecessary set-truncation does make sense in the formulation of the SvK theorem, where all equality types are set-truncated, but removing it makes it easier to motivate our higher SvK theorem.
Next, we suggest an alternative definition for the type of lists (before quotienting/truncation). To simplify things further, let us fix and consider lists starting at this point. Let us now look at the following indexed inductive type with three constructors, where should be understood as a type of lists from to . Recall that we keep the embeddings and implicit.
[TABLE]
Clearly, gives us the empty list. The other two constructors allow us to switch between lists ending in a point in to lists ending in a point in and vice versa. Intuitively, this is done simply by adding a at the end of the list. This explains how to add the vertical lines of a list as drawn in (86). It may be surprising that we do not add the horizontal components and explicitly. The reason is that they are automatically and implicitly present in this encoding: the map of type
[TABLE]
allows us to “insert” the upper horizontal components in (86) and (exchanging by ) also the lower horizontal components.
The type encodes lists from to , but we have not done the quotienting, i.e. the lists (86) and (87) are still different. To remedy this, we can turn into an indexed higher inductive type and add constructors ensuring that and . If we set-truncate, this would give us the correct type, namely something equivalent to the by Favonia and Shulman. Since we do not want to set-truncate, we have to be more careful. and together with the equality constructors will form a pair of quasi-inverses (cf. [35]), and it is known that this type is not well-behaved. Instead, we mirror the components that form an actual equivalence. Although there are several formulations that would work, we use those that turn into a bi-invertible map [35], as follows:
[TABLE]
This definition of does certainly not look very appealing, and we only give this presentation because it is the “standard” way of presenting higher inductive types. If we allow ourselves to fold the last five constructors into a single one, the type looks as follows:
[TABLE]
It may also be interesting to do this in the formulation for a coequalizer instead of a pushout. As explained in Section 1.2, this is a completely mechanical translation. Thus, assume with and . Then, the corresponding type in the “folded” form looks as follows:
[TABLE]
Let us write instead of , in order to explicitly mention the point . We can call the free higher groupoid generated by . This construction generalizes the explicit construction of a free higher group (based on an idea by Capriotti, cf. [23]). It also generalizes the “integer type as a higher inductive type” (itself a special case of the free higher group) which was independently suggested by Pinyo and Altenkirch [31] (based on Capriotti’s idea), by van der Weide et al. in unpublished work, and in a formalization by Cavallo based on a remark by Mörtberg [14]. This example is discussed further in Remark 21 below.
5.3. A Higher SvK Theorem
The type family depends on the chosen point . To remove this dependency, let us consider a version of which is indexed twice over : we write for . This expression plays the role of in our higher analogue of the Favonia-Shulman result, Theorem 19. While it can be extended to a family in a straightforward way, we choose the following formulation for simplicity (and to match Theorem 19 more closely):
Theorem 20** (a higher Seifert-van Kampen theorem).**
For , we have an equivalence:
[TABLE]
Proof.
Like all (indexed/higher/ordinary) inductive types, (92) is (homotopy-) initial in an appropriately formulated category of algebras (see [4], [15], and others). Here is where we draw the connection with the main result of the paper: The category in which (92) is initial is the category from Theorem 16.222To be precise, the object is initial in . This is easy to see when we use the general specification and definition of higher inductive-inductive types given by Kaposi and Kovács [19, 20], but see Remark 21 below.
By the uniqueness of the initial object and by Theorem 16, is equivalent to . Letting vary, we get the statement of the theorem. ∎
It is relatively straightforward to recover the set-truncated SvK statement (Theorem 19) from the higher version (Theorem 20). We can simply set-truncate both sides in (94) and then prove that is equivalent to by constructing maps in both directions.
Remark 21**.**
Theorem 20 and its proof deserve additional comments. We think it is fair to say that the formal theory of indexed higher inductive types is not yet well-established, but it is under very active development. Kaposi and Kovács ([19, 20]) have suggested a definition for general higher inductive-inductive types which captures the case we need. Indexed higher inductive types are considered in some of the cubical settings; cf. Cavallo and Harper [13], and there are plans to extend cubical Agda [39, 28, 29] and redtt [3] with the concept (at the time of writing, a possibly not final version is available in cubical Agda). The syntax in (91) is the obvious and non-controversial one for such indexed higher inductive types. We think it would be desirable to also allow the syntactical representation in (92), even if only as syntactic sugar for (91). Note that Kaposi and Kovács allow equalities between types, which is very similar to allowing this family of equivalences.
The critical step in the above proof of Theorem 20 is to establish (92) as the initial object of the category . With the specification suggested by Kaposi and Kovács allowing (92), with equalities instead of equivalences, this part is easy. However, we want to emphasize that the initiality of (91) is not immediate at all if we use what we could call the direct induction principle333The terminology was suggested by Anders Mörtberg in a discussion with the authors.. The direct induction principle is the “standard” principle one derives by giving one case for each constructor, as done in the book [35] and by current proof assistants such as cubical Agda. Unfortunately, due to the type dependency in the direct induction principle, it becomes very hard to “fold” the components for the type (91) in order to achieve the principle one would expect from (92). We expect that implementing Theorem 20 in cubical Agda would be extremely tedious for this reason.
The core of the problem with the direct induction principle is that it does not allow us to “reason on the level of constructors”. As an example, let us consider the interval with two point constructors and one path constructor. If we can reason on the level of constructors, it is by “singleton contraction” clear that one point and the path constructor form a contractible pair, and that the interval is therefore equivalent to the type generated by a single point. With the direct induction principle, this style of reasoning is not possible. It turns out to be easy enough to prove the interval contractible, but in other cases, the situation is less fortunate.
As an example, proposals by Pinyo and Altenkirch [31], unpublished work by van der Weide et al., and a formalization by Cavallo based on a remark by Mörtberg [14] suggest to define as a higher inductive type, and their very definition is chosen such that should become the initial object of the category of pointed types with automorphism (cf. Section 4.1). Their definitions are versions of (93) with and replaced by the unit type and the relation constantly unit. Crucially, they have to “unfold” the constructor , since this is what the current cubical proof assistants require. It turns out that this makes it extremely tedious to prove the resulting type equivalent to other definitions of the integers.
6. Final Remarks
We have shown a theorem, reminiscent of an induction principle, which allows to reason about path spaces of pushouts/coequalizers. There are multiple reasonable formulations of this result. We have then proceeded to use this result for short proofs of two statements that had formerly been proved with encode-decode constructions.
The core of the proof in Section 2 is the isomorphism between and (Lemma 11). Strictly speaking, the full isomorphism is not required since we are only interested in the initial objects, but showing the isomorphism seems conceptually cleaner and is not significantly harder that a more minimalistic approach.
Kristina Sojakova has formulated an alternative version of the proof of Theorem 3. This proof is presented in a more direct fashion, without explicitly going through initiality in wild categories, although all analogous steps (apart from the full isomorphism of categories) are still taken. Such a presentation makes it easier to see that the first -rule in Theorem 3 and Theorem 14 holds judgmentally.
A question to consider in the future would be whether it is possible to generalize the result from coequalizers to arbitrary higher inductive types or at least to a larger fragment of higher inductive types.
Acknowledgments
We thank Kristina Sojakova, Paolo Capriotti, and Anders Mörtberg for valuable suggestions and inspiring discussions. We are also grateful to the anonymous reviewers for their remarks, which have helped us to improve this paper.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Benedikt Ahrens, Krzysztof Kapulkin, and Michael Shulman. Univalent categories and the Rezk completion. Mathematical Structures in Computer Science (MSCS) , pages 1–30, Jan 2015.
- 2[2] Thorsten Altenkirch, Neil Ghani, Peter Hancock, Conor Mc Bride, and Peter Morris. Indexed containers. J. Funct. Program. , 25, 2015.
- 3[3] Carlo Angiuli, Evan Cavallo, Kuen-Bang Hou (Favonia), Robert Harper, Anders Mörtberg, and Jon Sterling. redtt – cartesian cubical proof assistant, 2018. Talk available online at http://www.jonmsterling.com/pdfs/dagstuhl.pdf , implementation at https://github.com/Red PRL/redtt .
- 4[4] Steve Awodey, Nicola Gambino, and Kristina Sojakova. Homotopy-initial algebras in type theory. J. ACM , 63(6):51:1–51:45, January 2017.
- 5[5] Simon Boulier, Egbert Rijke, and Nicolas Tabareau. A coinductive approach to type valued equivalence relations. 2017. Abstract presented at the workshop on Ho TT/UF in Oxford.
- 6[6] Ronald Brown, Philip J Higgins, and Rafael Sivera. Nonabelian algebraic topology . 2011.
- 7[7] Guillaume Brunerie. The James construction and π 𝜋 \pi 4 4 {}_{\mbox{4}} (s 3 3 {}^{\mbox{3}} ) in homotopy type theory. Co RR , 2017.
- 8[8] Ulrik Buchholtz and Kuen-Bang Hou (Favonia). Cellular cohomology in homotopy type theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science , 2018.
