Constructing Higher Inductive Types as Groupoid Quotients

02/19/2020 ∙ by Niels van der Weide, et al. ∙ 0

In this paper, we show that all finitary 1-truncated higher inductive types (HITs) can be constructed from the groupoid quotient. We start by defining internally a notion of signatures for HITs, and for each signature, we construct a bicategory of algebras in 1-types and in groupoids. We continue by proving initial algebra semantics for our signatures. After that, we show that the groupoid quotient induces a biadjunction between the bicategories of algebras in 1-types and in groupoids. We finish by constructing a biinitial object in the bicategory of algebras in groupoids. From all this, we conclude that all finitary 1-truncated HITs can be constructed from the groupoid quotient. All the results are formalized over the UniMath library of univalent mathematics in Coq.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1. Introduction

The Martin-Löf identity type, also known as propositional equality, represents provable equality in type theory [51]. This type is defined polymorphically over all types and has a single introduction rule representing reflexivity. The eliminator, often called the J-rule or path induction, is used to prove symmetry and transitivity. Note that in particular, we can talk about the identity type of an already established identity type. This can be iterated to obtain an infinite tower of types, which has the structure of an -groupoid [59, 50].

The J-rule is also the starting point of homotopy type theory [58]. In that setting, types are seen as spaces, inhabitants are seen as points, proofs of identity are seen as paths, and paths between paths are seen as homotopies. In mathematical terms, type theory can be interpreted using simplicial sets [40]. In the resulting model, not every inhabitant of the identity type is equal to reflexivity, which is also the case in the groupoid model [37, 36] and the cubical sets model [17].

If we assume enough axioms, then we can construct types for which we can prove that not every two inhabitants of the identity type are equal. One example is the universe if one assumes the univalence axiom [58]. Other examples can be obtained way by using higher inductive types (HITs).

Higher inductive types generalize inductive types by allowing constructors for paths, paths between paths, and so on. While inductive types are specified by giving the arities of the operations [28], for higher inductive types one must also specify the arities of the paths, paths between paths, and so on. The resulting higher inductive type is freely generated by the provided constructors. To make this concrete, let us look at some examples [58]:

Inductive  :=
|  : 
|  : 

Inductive  :=
|  : 
|  : 
|  : 

The first one, , represents the circle. It is generated by a point constructor and a path constructor . The second one, , represents the torus. This type is generated by a point constructor , two path constructors and of type , and a homotopy constructor where denotes the concatenation of and . Note that constructors depend on previously given constructors in the specification. For both types, introduction, elimination, and computation rules can be given [58].

In this paper, we study a schema of higher inductive types that allows defining types by giving constructors for the points, paths, and homotopies. All of these constructors can be recursive, but they can only have a finite amount of recursive arguments. Note that recursion is necessary to cover examples such as W-types, the set truncation, algebraic theories, and the integers. A similar scheme was studied by Dybjer and Moenclaey and they interpret HITs on this scheme in the groupoid model [26].

Say that a type is 1-truncated if for all , , and we have , and a 1-type is a type which is 1-truncated. An example of a 1-type is the circle [48], which we mentioned before. Groupoids are related to 1-types via the groupoid quotient [56], which takes a groupoid and returns 1-type whose points are objects of and whose paths are morphisms in . Note that the type of univalent groupoids is equivalent to the type of 1-types [3].

The goal of this paper is to show that finitary 1-truncated higher inductive types can be derived from simpler principles. More specifically, every finitary 1-truncated HIT can be constructed in a type theory with propositional truncations, set quotients, and groupoid quotients. Note that the set quotient is a special instance of the groupoid quotient. The result of this paper can be used to simplify the semantic study of finitary 1-truncated HITs. Instead of verifying the existence of a wide class of HITs, one only needs to check the existence of propositional truncations and groupoid quotients.

The contributions of this paper are summarized as follows

  • An internal definition of signatures for HITs which allows path and homotopy constructors (Definition 3.4);

  • Bicategories of algebras in both 1-types and groupoids (Definition 3.16);

  • A proof that biinitial algebras in 1-types satisfy the induction principle (Proposition 4.18);

  • A biadjunction between the bicategories of algebras in 1-types and algebras in groupoids (Construction 5.13);

  • A construction of 1-truncated HITs from the groupoid quotient (Construction 6.4), which shows that such HITs exist. This is the main contribution of this paper.

Related Work Various schemes of higher inductive types have been defined and studied. Awodey et al. study inductive types in homotopy type theory and prove initial algebra semantics [14]. Sojakova extended their result to various higher inductive types, among which are the groupoid quotient, W-suspensions, and the torus [55, 56]. Basold et al. define a scheme for HITs allowing for both point and path constructors, but no higher constrtuctors [15], and a similar scheme is given by Moenclaey [52]. Dybjer and Moenclaey extended this scheme by allowing homotopy constructors and they give semantics in the groupoid model [26]. In the framework of computational higher-dimensional type theory [11], Cavallo and Harper defined indexed cubical inductive types and prove canonicity [21]. Altenkirch et al. define quotient inductive-inductive types, which combine the features of quotient types with inductive-inductive types [30, 5]. Kovács and Kaposi extended this syntax to higher inductive-inductive types [39], which can be used to define not necessarily set-truncated types.

Higher inductive types have already been used for numerous applications. One of them is synthetic homotopy theory. Spaces, such as the real projective spaces, higher spheres, and Eilenberg-MacLane spaces, can be defined as higher inductive types [45, 47, 19, 58]. The resulting definitions are strong enough to determine homotopy groups [45, 48]. In addition, algebraic theories can be modeled as HITs, which allows one to define finite sets as a higher inductive type [32]. Other applications of HITs include homotopical patch theory, which provides a way to model version control systems [12], and modeling data types such as the integers [15, 10]. Besides, quotient inductive-inductive types can be used to define the partiality monad [6]. These types can also be used to define type theory within type theory [7] and to prove normalization [8].

Several classes of higher inductive types have already been reduced to simpler ones. Both Van Doorn and Kraus constructed truncations from non-recursive higher inductive types [61, 42]. Using the join construction, Rijke constructed several examples of HITs, namely truncations, the Rezk completion, and quotients [54]. Awodey et al. give an impredicative construction of finitary inductive types and some HITs [13]. Constructions of more general classes of HITs have also been given. Assuming UIP, Kaposi et al. constructed all finitary quotient inductive-inductive types from a single one [38], and without UIP, Van der Weide and Geuvers constructed all finitary set truncated HITs from quotients [60]. Note that these two works only concern set truncated HITs.

Lastly, the semantics of HITs has also been studied. Coquand et al. interpreted several HITs in the cubical sets model [17, 24]. Note that one can constructively prove univalence in the cubical sets model [23] and that cubical type theory satisfies homotopy canonicity [25]. Furthermore, cubical type theory has been implemented in Agda with support for higher inductive types [62]. Lumsdaine and Shulman give a semantical scheme for HITs and show that these can be interpreted in sufficiently nice model categories [49].
Formalization All results in this paper are formalized in Coq [57] using UniMath [63]. The formalization uses the version with git hash 2dadfb61 and can be found here:

https://github.com/nmvdw/GrpdHITs

Overview We start by recalling the groupoid quotient and displayed bicategories in Section 2. Displayed bicategories are our main tool to construct the bicategory on algebras on a signature. In Section 3, we define signatures and show that each signature gives rise to a bicategory of algebras in both 1-types and groupoids. The notion of a higher inductive type on a signature is given in Section 4. There, we also prove initial algebra semantics, which says that biinitiality is a sufficient condition for being a HIT. To construct the desired higher inductive type, we use the groupoid quotient, and in Section 5 we lift this to a biadjunction on the level of algebras. As a consequence, constructing the initial algebra of a signature in groupoids is sufficient to construct the desired higher inductive type. In Section 6, we construct the desired initial algebra and we conclude that each signature has a higher inductive type. Lastly, we conclude in Section 7.
Notation Let us recall some notation from HoTT which we use throughout this paper. The identity path is denoted by and the concatenation of paths and is denoted by . Given a type with points and paths , we call a path a 2-path. A proposition is a type of which all inhabitants are equal. A set is a type such that for all the type is a proposition. A homotopy between consists of a path for each .

2. Preliminaries

Introduction rules:

Elimination rule:

Computation rules:

For :

For :

Figure 1. Introduction, elimination, and computation rules for the groupoid quotient.

2.1. Groupoid Quotient

Let us start by formally introducing the groupoid quotient [56]. The groupoid quotient is a higher dimensional version of the set quotient, so let us quickly recall the set quotient. Given a setoid (a set with an equivalence relation on ), the set quotient gives a type , which is with the points identified according to . Note that always is a set.

Instead of a setoid, the groupoid quotient takes a groupoid as input. Recall that a groupoid is a category in which every morphism is invertible. In particular, each groupoid has identity morphisms, denoted by , and a composition operation. The composition of and is denoted by . We write for the type of groupoids.

Given , the groupoid quotient gives a 1-type . In this type, the points are objects of and these are identified according to the morphisms in . In addition, the groupoid structure must be preserved. Informally, we define groupoid quotient as the following HIT.

Inductive   :=
|  : 
|  : 
|  : 
|  : 
           
|  : 
           

To formally add this type to our theory, we need to provide introduction, elimination, and computation rules for . Formulating the elimination principle requires two preliminary notions. These are inspired by the work by Licata and Brunerie [46]. The first of these gives paths in a dependent type over a path in the base.

Definition 2.1.

Given a type , a type family , points , a path , and points and over and respectively, we define the type of paths over from to by path induction on by saying that the paths over the identity path from to are just paths .

Note that the groupoid quotient also has constructors for paths between paths. This means that we also need a dependent version of 2-paths, and inspired by the terminology of globular sets, we call these globes over a given 2-path. We define them as follows.

Definition 2.2.

Given paths , a 2-path , and paths and over and respectively, we define the type of globes over from to by path induction on by saying that the paths over the identity path are just paths .

From this point on, we assume that our type theory has the groupoid quotient. More specifically, we assume the following axiom.

Axiom 2.3.

For each groupoid there is a type which satisfies the rules in Figure 1.

Note that there are no computation rules for , , and , because such rules follow from the fact that is a family of 1-types.

2.2. Bicategory Theory

The upcoming construction makes heavy use of notions from bicategory theory [16, 44] and in particular, the displayed machinery introduced by Ahrens et al. [2]. Here we recall some examples of bicategories and the basics of displayed bicategories.

Recall that a bicategory consists of objects, 1-cells between objects, and 2-cells between 1-cells. The type of 1-cells from to is denoted by and the type of 2-cells from to is denoted by . There are identity 1-cells and 2-cells denoted by and respectively, composition of 1-cells and is denoted by , and the vertical composition of 2-cells and is denoted by . The left whiskering of a 2-cell with 1-cell is denoted by and right whiskering of with a 1-cell is denoted by . Unitality and associativity of vertical composition of 2-cells hold strictly while for 1-cells, these laws only hold up to an invertible 2-cell.

Let us fix some notation before continuing. We write for the type of pseudofunctors from to . The type of pseudotransformations from to is denoted by and the type of modifications from to is denoted by [44]. Lastly, the type of biadjunctions between and is denoted by where and . If we have , we say that is left biadjoint to . The definition of biadjoint we use, is similar to the one used by Gurski [33], but without any coherencies. Beside these standard notions, we use two bicategories: and .

Example 2.4.

We have

  • a bicategory whose objects are 1-types, 1-cells are functions, and 2-cells are homotopies;

  • a bicategory of groupoids whose objects are (not necessarily univalent) groupoids, 1-cells are functors, and 2-cells are natural transformations.

Next we discuss displayed bicategories, which is our main tool to define bicategories of algebras on a signature. Intuitively, a displayed bicategory over represents structure and properties to be added to . Displayed bicategories generalize displayed categories to the bicategorical setting [4]. Each such gives rise to a total bicategory . The full definition can be found in the paper by Ahrens et al. [2], and here, we only show a part.

Definition 2.5.

Let be a bicategory. A displayed bicategory over consists of

  • For each a type of objects over ;

  • For each , and , a type of 1-cells over ;

  • For each , , and , a set of 2-cells over .

In addition, there are identity cells and there are composition and whiskering operations. The composition of displayed 1-cells and is denoted by , the displayed identity 1-cell is denoted by . The vertical composition of 2-cells and is denoted by , the left and right whiskering is denoted by and respectively, and the identity 2-cell is denoted by .

Definition 2.6.

Let be a bicategory and let be a displayed bicategory over . We define the total bicategory as the bicategory whose objects of are just dependent pairs with in and in . The 1-cells and 2-cells in are defined similarly. In addition, we define the projection to be the pseudofunctor which takes the first component of each pair.

Let us finish this section by defining the displayed bicategories we need in the remainder of this paper. Motivation and explanation of Examples 2.7 and 2.9 is given by Ahrens et al. [2].

Example 2.7.

Given a bicategory and a pseudofunctor , we define a displayed bicategory over such that

  • the objects over are 1-cells ;

  • the 1-cells over from to are invertible 2-cells ;

  • the 2-cells over from to are equalities

Example 2.8.

Given a bicategory , a type , and for each a displayed bicategory over , we define a displayed bicategory over such that

  • the objects over are functions ;

  • the 1-cells over from to are functions ;

  • the 2-cells over from to are functions .

Example 2.9.

Let be a bicategory with a displayed bicategory over it. Now suppose that we have pseudofunctors and two pseudotransformations . Then we define a displayed bicategory over such that

  • the objects over are 2-cells ;

  • the 1-cells over from to are equalities

  • the 2-cells over are inhabitants of the unit type.

Example 2.10.

Let be a bicategory and let be a family of propositions on the objects of . Then we define a displayed bicategory over whose objects over are proofs of and whose displayed 1-cells and 2-cells are inhabitants of the unit type. The total bicategory is the full subbicategory of whose objects satisfy .

3. Signatures and their Algebras

Figure 2. Rules for the path endpoints.

Figure 3. Rules for the homotopy endpoints.

Before we can discuss how to construct 1-truncated higher inductive types, we need to define signatures for those. Our notion of signature is similar to the one by Dybjer and Moenclaey [26]. However, instead of defining them externally, we define a type of signatures within type theory just like what was done for inductive-recursive and inductive-inductive definitions [27, 31]. In addition, we show that each signature gives rise to a bicategory of algebras on .

To see what the challenges are when defining HITs, let us recall the torus.

Inductive  :=
|  : 
|  : 
|  : 

There is a point constructor , two paths constructors , and a homotopy constructor . Note that and refer to and that refers to all other constructors. Hence, the signatures we define, must be flexible enough to allow such dependencies.

A similar challenge comes up when defining the bicategory of algebras on a signature. For the torus, an algebra would consist of a type , a point , paths , and a 2-path . Again there are dependencies: and depend on while depends on both and . To overcome this challenge, we use displayed bicategories to construct the bicategory of algebras in a stratified way.

3.1. Signatures

Now let us define signatures, and to do so, we must specify data which describes the constructors for points, paths, and homotopies. To specify the point constructors, we use polynomial codes. Given a type and a polynomial code , we get another type . Such a code describes an operation of the form .

Definition 3.1.

The type of codes for polynomials is inductively generated by the following constructors

where is a 1-type and and are arbitrary polynomials.

The constructor represents the constant polynomial, represents the identity, and and represent the sum and product respectively. Note that we restrict ourselves to finitary polynomials since we do not have a constructor where and is a type.

The second part of the signature describes the path constructors, which represent universally quantified equations. To describe them, we must give two path endpoints. These endpoints can refer to the point constructor, which we represent by a polynomial . In addition, they have a source (the type of the quantified variable) and a target (the type of the of the term). The source and the target are represented by polynomials and respectively.

Definition 3.2.

Let , , and be codes for polynomials The type of path endpoints with arguments , source , and target is inductively generated by the constructors given in Figure 2.

If we have a type with a function , then each endpoint gives for every a point . Note that depends on while we do not write in the notation. Hence, two endpoints represent the equation

Note that a HIT could have arbitrarily many path constructors and we index them by the type .

The last part of the signature describes the homotopy constructors and these depend on both the point and path constructors. A homotopy constructor represents an equation of paths, which is universally quantified over both points and paths of the HIT being defined. The point argument is represented by a polynomial , and the path argument is represented by a polynomial and endpoints . Lastly, the type of the paths in the equation is described by two endpoints with .

Definition 3.3.

Suppose that we have

  • A polynomial ;

  • A type together with for each a polynomial and endpoints ;

  • A polynomial ;

  • A polynomial with endpoints ;

  • A polynomial with endpoints .

Then we define the type of homotopy endpoint inductively by the constructors in Figure 3.

The way we represent path arguments allows us to represent equations with any finite number of path arguments by only two path endpoints. For example, two path arguments and is represented by one path argument of type .

Given a type with a function and for each a path , a homotopy endpoint gives rise for each point and path to another path . Hence, two homotopy endpoints represent the equation

Now let us put this all together and define what signatures for higher inductive types are.

Definition 3.4.

A HIT-signature consists of

  • A polynomial ;

  • A type together with for each a polynomial and endpoints ;

  • A type together with for each polynomials and , endpoints and , and homotopy endpoints .

If is clear from the context, we do not write the superscript. In the remainder, we show how to interpret the following HIT given a signature :

Inductive  :=
|  : 
|  : 
|  : 
      
|  : 

Next we consider three examples of HITs we can express with these signatures.

Example 3.5.

The torus is described by the signature .

  • Take ;

  • Take and for both inhabitants we take and ;

  • Take . Since there no arguments for this path constructor, we take and . Now for the left-hand side and right-hand side of this equation, we take and respectively.

Example 3.6.

We represent the integers modulo 2 as the following HIT:

Inductive  :=
|  : 
|  : 
|  : 
|  : 

Note that all constructors except are recursive. We define a signature .

  • Take ;

  • Take and for its unique inhabitant we take and

  • Take . Furthermore, we take and . The endpoints and encode and respectively, and for the left-hand side and right-hand side of this equation, we take

    respectively. Note that we use , , and to make the equations type check. If we would interpret the left-hand side and right-hand side of the homotopy constructor in 1-types, then all occurrences of , , and become the identity path. We thus get the right homotopy constructor.

Example 3.7.

Given a 1-type , the set truncation of is defined by the following HIT:

Inductive  :=
|  : 
|  : 

Note that this higher inductive type has a parameter , so the signature we define, depends on a 1-type as well. To encode the path arguments of , we use that two paths is the same as a path . Define a signature such that

  • ;

  • is the empty type;

  • . In addition, there are two point arguments