Constructing Higher Inductive Types as Groupoid Quotients

In this paper, we study finitary 1-truncated higher inductive types (HITs) in homotopy type theory. We start by showing that all these types can be constructed from the groupoid quotient. We define an internal 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. Then we construct a biinitial object in the bicategory of algebras in groupoids, which gives the desired algebra. From all this, we conclude that all finitary 1-truncated HITs can be constructed from the groupoid quotient. We present several examples of HITs which are definable using our notion of signature. In particular, we show that each signature gives rise to a HIT corresponding to the freely generated algebraic structure over it. We also start the development of universal algebra in 1-types. We show that the bicategory of algebras has PIE limits, i.e. products, inserters and equifiers, and we prove a version of the first isomorphism theorem for 1-types. Finally, we give an alternative characterization of the foundamental groups of some HITs, exploiting our construction of HITs via the groupoid quotient. All the results are formalized over the UniMath library of univalent mathematics in Coq.


Introduction
The Martin-Löf identity type, also known as propositional equality, represents provable equality in type theory [ML75]. 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 [BG11,Lum10].
The J-rule is also the starting point of homotopy type theory [Uni13]. In that setting, types are seen as spaces, terms are seen as points, proofs of identity of terms are seen as paths, and proofs of identity between identities are seen as homotopies. In mathematical terms, type theory can be interpreted in many Quillen model categories [AW09,LW15], as 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.
Moreover, we employ our framework for HITs for the development of 2-dimensional universal algebra. Each HIT discussed in the paper comes with a notion of algebra: a 1-type (or a groupoid) which is closed under the introduction rules of the HIT. Algebras for a HIT form a bicategory. We prove that this bicategory has PIE limits. Moreover, all its morphisms admit a factorization analogous to the one given by the first isomorphism theorem. Our framework also allows the construction of the free algebra for a signature, generalizing the notion of term algebra in (1-dimensional) universal algebra. Notice that the bicategory of algebras (and also all the other concrete bicategories we consider in this paper) is a (2,1)-category, so the notion of PIE limit in this case coincides with that of homotopy limit [AKL15].
Lastly, we show how to exploit our construction of HITs via the groupoid quotient to calculate the fundamental group of some HITs.
The contributions of this paper are summarized as follows • An internal definition of signatures for HITs which allow 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.17); • A biadjunction between the bicategories of algebras in 1-types and algebras in groupoids (Construction 5.12); • 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; • PIE limits in the bicategories of algebras in 1-types (Section 8); • The definition of the free algebra for a signature as a HIT (Definition 9.1); • A proof of the first isomorphism theorem for 1-types (Theorem 10.10); • An alternative approach for calculating the fundamental groups of some HITs (Section 11).
Related work. Various schemes of higher inductive types have been defined and studied. Awodey et al. studied inductive types in homotopy type theory and proved initial algebra semantics [AGS12]. Sojakova extended their result to various higher inductive types, among which are the groupoid quotient, W-suspensions, and the torus [Soj15,Soj16]. For these types, Sojakova proved that homotopy initiality is equivalent to the induction principle while we only show that these two imply each other. Note that all the HITs we consider, are 1-truncated, while Sojakova looked at types which are not necessarily 1-truncated. However, while we consider a general class of HITs with higher path constructors, she only studied several examples of such HITs, namely the groupoid quotient, the torus, and higher truncations. Basold et al. [BGvdW17] defined a scheme for HITs allowing for both point and path constructors, but no higher constructors, and a similar scheme is given by Moeneclaey [Moe16]. Dybjer and Moeneclaey extended this scheme by allowing homotopy constructors and they give semantics in the groupoid model [DM18]. In the framework of computational higher-dimensional type theory [AHW17], Cavallo and Harper defined indexed cubical inductive types and proved canonicity [CH19]. Altenkirch et al. defined quotient inductive-inductive types, which combine the features of quotient types with inductive-inductive types [FS10, ACD + 18]. Kovács and Kaposi extended this syntax to higher inductive-inductive types [KK18], which can be used to define not necessarily set-truncated types. The scheme studied in this paper, is most similar to the one by Dybjer Formalization. All results in this paper are formalized in Coq [The18] using UniMath [VAG + 20]. The formalization uses the version with git hash 2dadfb61 and can be found here: https://github.com/nmvdw/GrpdHITs/tree/extended In our development, we slightly deviate from the UniMath philosophy by employing Coq's support for inductive type families.
Overview. We start by recalling the groupoid quotient and displayed bicategories in Section 2. Displayed bicategories are our main tool to construct the bicategory of algebras for 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 an associated higher inductive type. Next we discuss more examples of HITs in Section 7 and there we also show how to obtain monoidal objects and coherent 2-groups as algebras for certain signatures. After that we study 2-dimensional universal algebra with our signatures. More specifically, we construct PIE limits of algebras in Section 8, the free algebra for a signature in Section 9, and we prove the first isomorphism theorem in Section 10. The final topic we discuss, is the calculation of fundamental groups. In Section 11, we use the way we constructed higher inductive types to determine the fundamental group of the circle, the torus, and the group quotient. Lastly, we conclude in Section 12.
Publication History. This paper is an extended version of [Wei20] by the second author. In Section 3, we changed Definition 3.3 and in Section 4, we added Construction 4.10. Figures 5 and 6 are also new. Sections 7 to 11 are new.
Notation. In this paper, we work in dependent type theory and we assume the univalence axiom. In particular, this means that we also have function extensionality. Let us recall some notation from HoTT which we use throughout this paper. The identity path is denoted by idpath(x), the concatenation of paths p : x = y and q : y = z is denoted by p • q, and the inverse of a path p : x = y is denoted by p −1 : y = x. Given a type X with points x, y : X and paths p, q : x = y, we call a path s : p = q a 2-path. A proposition is a type of which all inhabitants are equal. A set is a type X such that for all x, y : X the type x = y is a proposition. A homotopy between f, g : X → Y consists of a path f (x) = g(x) for each x : A. By assuming function extensionality, we have access to a map funext sending a homotopy between functions f and g to a path f = g. Given a type A, we write ||A|| for its propositional truncation and inc : A → ||A|| for the point constructor. We define the existential quantification ∃a : A.B(a) as || a:A B(a)||.

Preliminaries
2.1. Groupoid Quotient. Let us start by formally introducing the groupoid quotient [Soj16]. The groupoid quotient is a higher dimensional version of the set quotient, so let us 8:6

Niccolò Veltri and Niels van der Weide
Vol. 17:2 briefly recall the set quotient. Given a setoid (X, R) (a set X with an equivalence relation R valued in propositions on X), the set quotient gives a type X/R, which is X with the points identified according to R. Note that X/R always is a set since equality in X/R is described by R.
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 id(x), and a composition operation. The composition of f and g is denoted by f · g. In addition, the type of morphisms from x to y is required to be a set. We write Grpd for the type of groupoids.
In homotopy type theory, groupoids (and more generally categories) are usually required to be univalent, meaning that the type of isomorphisms between objects in a groupoid is equivalent to to the type of equalities between objects. In this paper we do not use this requirement, so the groupoids are not necessarily univalent. Note that the objects in a groupoid form a type without any restriction on its truncation level.
Given G : Grpd, the groupoid quotient gives a 1-type GQuot(G). In this type, the points are objects of G and these are identified according to the morphisms in G. In addition, the groupoid structure must be preserved. Informally, we define the groupoid quotient as the following HIT.
Definition 2.1. Given a type X : Type, a type family Y : X → Type, points x 1 , x 2 : X, a path p : x 1 = x 2 , and points x 1 : Y (x 1 ) and x 2 : Y (x 2 ) over x 1 and x 2 respectively, we define the type x 1 = Y p x 2 of paths over p from x 1 to x 2 by path induction on p by saying that the paths over the identity path idpath(x) from x 1 to x 2 are just paths x 1 = x 2 .
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. Let X, Y , and x 1 , x 2 be as in Definition 2.1. Suppose that we have paths p, q : x 1 = x 2 , a 2-path g : p = q, and paths p : x 1 = p x 2 and q : x 1 = q x 2 over p and q respectively. We define the type p = g q of globes over g from p to q by path induction on g by saying that the paths over the identity path idpath(p) are just paths p = q.
From this point on, we assume that our type theory has the groupoid quotient. More specifically, we assume the following axiom.
Since the groupoid quotient is a special instance of the Rezk completion, the type GQuot(G) can be constructed without assuming any axiom [AKS15]. However, this construction increases the universe level and only by assuming some resizing axiom, one can stay in the same universe.
Note that there are no computation rules for gconcat, ge, and gtrunc, because equations on homotopies follow automatically from the fact that Y is a family of 1-types.
2.2. Bicategory Theory. The upcoming constructions make heavy use of notions from bicategory theory [Bén67,Lei98]  A bicategory consists of objects, 1-cells between objects, and 2-cells between 1-cells. The type of 1-cells from x to y is denoted by x → y and the type of 2-cells from f to g is denoted by f ⇒ g. Note that the type f ⇒ g is required to be a set. There are identity 1-cells and 2-cells denoted by id 1 and id 2 respectively. Composition of 1-cells f and g is denoted by f · g, and the vertical composition of 2-cells θ and θ is denoted by θ • θ . Note that we use diagrammatic order for composition. The left whiskering of a 2-cell θ with 1-cell f is denoted by f θ and right whiskering of θ with a 1-cell g is denoted by θ g. Unitality and associativity of vertical composition of 2-cells hold strictly, while for 1-cells 8:8

Niccolò Veltri and Niels van der Weide
Vol. 17:2 these laws hold only up to invertible 2-cells. Given 1-cell f : A → B, there are invertible 2-cells λ : id 1 (A) · f ⇒ f and ρ : f · id 1 (B) ⇒ f . Given three composable 1-cells f, g and h, there is an invertible 2-cell α : f · (g · h) ⇒ (f · g) · h. Let us fix some notation before continuing. Given bicategories B 1 and B 2 , we write Pseudo(B 1 , B 2 ) for the type of pseudofunctors from B 1 to B 2 . Pseudofunctors preserve identity and composition of 1-cells up to an invertible 2-cell. Given a pseudofunctor F : Pseudo(B 1 , B 2 ) and an object A of B 1 , there are invertible 2-cells F i : id 1 (F (A)) ⇒ F (id 1 (A)) and F c : F (f ) · F (g) ⇒ F (f · g), with f and g two composable 1-cells. Preservation of identity and composition of 2-cells is strict. The type of pseudotransformations from F to G is denoted by F ⇒ G. The naturality square of a pseudotransformation θ : F ⇒ G commutes only up to invertible 2-cell. Given a 1-cell f in B 1 , there is an invertible 2-cell The type of modifications from θ to θ is denoted by θ θ [Lei98]. Next we discuss biadjunctions [Gur12,Lac00].
Definition 2.4. Let B 1 and B 2 be bicategories. A biadjunction from B 1 to B 2 consists of • pseudofunctors L : Pseudo(B 1 , B 2 ) and R : Pseudo(B 2 , B 1 ); The type of biadjunctions from B 1 to B 2 is denoted by L R where L : Pseudo(B 1 , B 2 ) and R : Pseudo(B 2 , B 1 ). If we have L R, we say that L is left biadjoint to R.
Definition 2.5. Given bicategories B 1 and B 2 , a pseudofunctor L : Pseudo(B 1 , B 2 ), and a biadjunction L R, we say that L R is coherent if the following 2-cells are equal to identity 2-cells The following bicategories are important for subsequent constructions: 1-Type and Grpd.
Note that 1-Type and Grpd are actually (2,1)-categories just like the other bicategories that we use in this paper. However, in the formalization we do not use this fact so that we can reuse the work by Ahrens et al. [AFM + 20].
Next we discuss displayed bicategories, which is our main tool to define bicategories of algebras for a signature. Intuitively, a displayed bicategory D over B represents structure and properties to be added to B. Displayed bicategories generalize displayed categories to the bicategorical setting [AL19]. Each such D gives rise to a total bicategory D. In addition, there are identity cells and there are composition and whiskering operations. The composition of displayed 1-cells f and g is denoted by f · g, the displayed identity 1-cell is denoted by id 1 (x). The vertical composition of 2-cells θ and θ is denoted by θ • θ , the left and right whiskering is denoted by f θ and θ f respectively, and the identity 2-cell is denoted by id 2 (f ).
Definition 2.8. Let B be a bicategory and let D be a displayed bicategory over B. We define the total bicategory D as the bicategory whose objects are dependent pairs (x, x) with x in B and x in D(x). The 1-cells and 2-cells in D are defined similarly. In addition, we define the projection π D : Pseudo( D, B) 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. Examples 2.9 and 2.11 were first given by Ahrens et al. [AFM + 20].
Example 2.9. Given a bicategory B and a pseudofunctor F : Pseudo(B, B), we define a displayed bicategory DFalg(F ) over B such that • the objects over x : B are 1-cells h x : F (x) → x; • the 1-cells over f : • the 2-cells over θ : f ⇒ g from τ f to τ g are equalities • the 1-cells over f : x → y from x to y are functions (i : • the 2-cells over θ : f ⇒ g from f to g are functions (i : I), f (i) θ = ⇒ g(i).
Example 2.11. Let B be a bicategory with a displayed bicategory D over it. Now suppose that we have pseudofunctors S, T : Pseudo(B, B) and two pseudotransformations l, r : π D · S ⇒ π D · T . Then we define a displayed bicategory DFcell(l, r) over D such that • the objects over x are 2-cells γ x : l(x) ⇒ r(x); • the 1-cells over f : x → y from γ x to γ y are equalities (γ x T (π D (f ))) • r(f ) = l(f ) • (S(π D (f )) γ y ); • the 2-cells over θ : f ⇒ g are inhabitants of the unit type.

Niccolò Veltri and Niels van der Weide
Vol. 17:2 Example 2.12. Let B be a bicategory and let P be a family of propositions on the objects of B. We define a displayed bicategory FSub(P ) over B whose objects over x are proofs of P (x) and whose displayed 1-cells and 2-cells are inhabitants of the unit type. The total bicategory FSub(P ) is the full subbicategory of B whose objects satisfy P .

Signatures and their Algebras
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 Moeneclaey [DM18]. 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 [DS99,FS12]. We also show that each signature Σ gives rise to a bicategory of algebras for Σ.
In this section, we study HITs of the following shape To see what the challenges are when defining such HITs, let us take a closer look at the torus.
There is a point constructor base, two paths constructors loop l , loop r : base = base, and a homotopy constructor surf : loop l • loop r = loop r • loop l . Note that loop l and loop r refer to base and that surf 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 for a signature. For the torus, an algebra would consist of a type X, a point b, paths p, q : b = b, and a 2-path s : p • q = q • p. Again there are dependencies: p and q depend on b while s depends on both p and q. To deal with these dependencies, we use displayed bicategories, which allow us 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 X and a polynomial code P , we get another type P (X). Such a code P describes the input of an operation of the form P (X) → X.
Definition 3.1. The type of codes for polynomials is inductively generated by the following constructors C(X) : P, Id : P, P 1 + P 2 : P, P 1 × P 2 : P where X is a 1-type and P 1 and P 2 are elements of P.  The constructor C(X) represents the constant polynomial returning the type X, Id represents the identity, and P 1 + P 2 and P 1 × P 2 represent the sum and product respectively. Note that we restrict ourselves to finitary polynomials since we do not have a constructor which represents the function space.
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 A. In addition, they have a source (the type of the quantified variable) and a target (the type of the term). The source and the target are represented by polynomials S and T respectively.
Definition 3.2. Let A, S, and T be codes for polynomials. The type E A (S, T ) of path endpoints with arguments A, source S, and target T is inductively generated by the constructors given in Figure 2.
Note that the parameter A is only used in the path endpoint constr, which represents the point constructor. If we have a type X with a function c : A(X) → X, then each endpoint e gives for every x : S(X) a point e (x) : T (X). Note that e (x) depends on c while we do not write c in the notation. Often we write e(x) instead of e (x). Hence, two endpoints l, r : E A (S, T ) represent the equation Note that a HIT could have arbitrarily many path constructors and we index them by the type J.
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 R, and the path argument is represented by a polynomial T and endpoints a, b : E A (R, T ). Lastly, the type of the paths in the equation is described by two endpoints s, t : E A (R, W ) with a polynomial W .
• A type J together with for each j : J a polynomial Q j and endpoints l j , r j : Then we define the type H l,r,a,b (s, t) of homotopy endpoints inductively by the constructors in Figure 3.
There are three homotopy endpoints of particular importance. The first one is path, which represents the path constructor and it makes use of l j and r j . The second one is p arg , which represents the path argument and it uses a and b. The last one is ap and it corresponds to the action of an endpoint on a homotopy endpoint.
The way we represent path arguments allows us to specify equations with any finite number of path arguments by only two path endpoints. For example, two path arguments p : x 1 = y 1 and q : x 2 = y 2 is represented by one path argument of type (x 1 , x 2 ) = (y 1 , y 2 ).
From the grammar in Figure 3, we can derive the following additional homotopy endpoints, which will be employed in forthcoming examples.
Given a type X with a function c : A(X) → X and for each x : Q j (X) a path l j (x) = r j (x), a homotopy endpoint p : H l,r,a,b (s, t) gives rise for each point x : R(X) and path w : a(x) = b(x) to another path p(x, w) : s(x) = t(x). Hence, two homotopy endpoints p, q : H l,r,a,b (s, t) represent the equation Now let us put this all together and define what signatures for higher inductive types are.
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 Σ: Next we consider three examples of HITs we can express with these signatures.
Example 3.5. The torus is described by the signature T 2 .
• Take A T 2 :≡ C(1); • Take J T 2 P :≡ 2 and for both inhabitants we take S T 2 :≡ C(1) and l T 2 :≡ r T 2 :≡ constr; • Take J T 2 H :≡ 1. Since there are no arguments for this path constructor, we take R T 2 :≡ T T 2 :≡ C(1) and a T 2 :≡ b T 2 :≡ c(tt). Now for the left-hand side and right-hand side of this equation, we take path true (id) @ path false (id) and path false (id) @ path true (id) respectively. Notice that the usual presentation of the torus does not include the explicit 1-truncation constructor t, since T 2 is already provably 1-truncated without its presence. A similar consideration applies to the circle S 1 .
Example 3.6. We represent the integers modulo 2 as the following HIT:

Niccolò Veltri and Niels van der Weide
Vol. 17:2 Note that all constructors except Z are recursive. We define a signature Z 2 .
• Take A Z 2 :≡ C(1) + Id; • Take J Z 2 P :≡ 1 and for its unique inhabitant we take S Z 2 :≡ Id and l Z 2 :≡ (inr · constr) · (inr · constr), r Z 2 :≡ id; • Take J Z 2 H :≡ 1. Furthermore, we take R Z 2 :≡ Id and a Z 2 :≡ b Z 2 :≡ c(tt). The endpoints s and t encode S(S(S(x))) and S(x) 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 A, the set truncation of A is defined by the following HIT: Note that this higher inductive type has a parameter A, so the signature we define depends on a 1-type A as well. To encode the path arguments of trunc, we use the fact that giving two paths p, q : x = y is the same as giving a path r : (x, x) = (y, y). Define a signature ||A|| 0 such that In addition, there are two point arguments R ||A|| 0 :≡ Id × Id and a path argument with left-hand side (pr 1 , pr 1 ) and right-hand side (pr 2 , pr 2 ). For the left-hand side and right-hand side of the homotopy, we take pr 1 (p arg ) and pr 2 (p arg ) respectively.
More examples of HIT signatures are discussed in Section 7.
3.2. Algebras in 1-types and groupoids. With the signatures in place, our next goal is to study the introduction rules of HITs and for that, we define bicategories of algebras for a signature. Since we ultimately want to construct HITs via the groupoid quotient, we look at both algebras in 1-types and groupoids.
In both cases, we use a stratified approach with displayed bicategories. Let us illustrate this by briefly describing the construction for 1-types. On 1-Type, we define a displayed bicategory and we denote its total bicategory by PreAlg(Σ). The objects of PreAlg(Σ) consist of a 1-type X together with an operation A Σ (X) → X. Concretely, the objects satisfy the point introduction rules specified by Σ. On top of PreAlg(Σ), we define another displayed bicategory whose total bicategory is denoted by PathAlg(Σ). Objects of PathAlg(Σ) satisfy the introduction rules for both the points and the paths. Lastly, we take a full subbicategory of PathAlg(Σ) obtaining another bicategory Alg(Σ) whose objects satisfy the introduction rules for the points, paths and homotopies.
Construction 3.9 (for Problem 3.8). We only discuss the case for 1-types since the case for groupoids is similar. Given a polynomial P and a type X, we get a type P (X) by induction. The verification that this gives rise to a pseudofunctor can be found in the formalization.
Definition 3.10. Let Σ be a signature. Then we define the bicategories PreAlg(Σ) and PreAlg Grpd (Σ) to be the total bicategories of DFalg( A Σ ) and DFalg( A Σ ) respectively. Objects of these bicategories are called prealgebras for Σ.
Note that prealgebras only have structure witnessing the introduction rule for the points. Next we look at the introduction rule for the paths. In this case, the desired structure is added via Example 2.11 and to apply this construction, we interpret path endpoints as pseudotransformations.
Problem 3.11. Given e : E A (P, Q), to construct pseudotransformations Construction 3.12 (for Problem 3.11). We only discuss e since e is defined similarly. Given a 1-type X and c : A(X) → X, we define the function e : P (X) → Q(X) by induction. The verification that this gives rise to a pseudotransformation can be found in the formalization.
Problem 3.14. Suppose that we have a homotopy endpoint h : H l,r,a,b (s, t). Given a 1-type X with c : A(X) → X and p : (j : In addition, given a groupoid G together with a functor c : A (G) → G and for each j : J a natural transformation l j (G) ⇒ r j (G), to construct for each object x : Q (G) and morphism w : Construction 3.15 (for Problem 3.14). By induction.
Definition 3.16. Let Σ be a HIT signature. We define Alg(Σ) to be the full subbicategory of PathAlg(Σ) in which every object X satisfies In addition, we define Alg Grpd (Σ) to be the full subbicategory of PathAlg Grpd (Σ) in which every object X satisfies Niccolò Veltri and Niels van der Weide Vol. 17:2 Objects of Alg(Σ) and Alg Grpd (Σ) are called algebras for Σ.
The bicategory Alg(Σ) is constructed by repeatedly using Definition 2.8. By unpacking the definition, we see that an algebra X : Alg(Σ) consists of ). Lastly, given two algebras X, Y : Alg(Σ) and an algebra morphisms f, g :

Induction and Biinitiality
The algebra structure only represents the introduction rule and the next step is to define the elimination and computation rules for higher inductive types. Furthermore, we show that biinitial algebras satisfy the induction principle.
Before we can formulate these principles, we need to define dependent actions of polynomials, path endpoints, and homotopy endpoints. All of these constructions are done by induction and details can be found in the literature [DM18, HJ98, WG19].
Problem 4.1. Given a type X, a type family Y on X, and a polynomial P , to construct a type family P (Y ) on P (X).
Problem 4.2. Given a type X, a type family Y on X, a polynomial P , and a map f : (x : X), Y (x), to construct a map P (f ) : (x : P (X)), P (Y )(x). Problem 4.3. Given a type X, a type family Y on X, and a polynomial P , to construct a map 1 oplax(P ) : P ( (x:X) Y (x)) → (x:P (X)) P (Y )(x) such that for all z : P ( (x:X) Y (x)), we have π 1 (oplax(P )(z)) = P (π 1 )(z).
The map oplax(P ) actually defines an equivalence, but we do not employ its inverse in our development.
Problem 4.4. Given a type X, a type family Y on X, an endpoint e : E A (P, Q), and a map c : A(X) → X, to construct for each x : P (X) and y : P (Y )(x) an inhabitant e (y) : Q(Y )( e (x)).
1 This operation is called oplax since, when the type family Y does not depend on X, it corresponds to oplax monoidality of the pseudofunctor associated to the polynomial P wrt. the cartesian product ×. Problem 4.5. Suppose, that we have polynomials A, P, Q, a type X with a map c X : A(X) → X, and a type family Y on X with a map c Y : (x : and a map f : (x : X), Y (x). Given an endpoint e : E A (P, Q), to construct an equality e (f ) : Q(f )( e (x)) = e (P (f )(x)).
Problem 4.6. Let Σ be a signature. Let X be a type with a function c X : A Σ (X) → X and for each j : J Σ P and x : S Σ j (X) a path p X (j, x) : l Σ j (x) = r Σ j (x). In addition, suppose that Y is a type family on X, that we have a function c Y : (x : , and that for all j : J Σ P and points x : S Σ j (X) and x : . With these notions in place, we define displayed algebras. A displayed algebra represents the input of the elimination rule. Furthermore, we show that each displayed algebra gives rise to a total algebra and a projection.
Definition 4.7. Given a signature Σ and an algebra X for Σ, a displayed algebra Y over X consists of • A family Y of 1-types over X; • For each j : J P , x : S j (X), and x : S j (Y )(x), a path p Y j : l j (x) = p X j x r j (x); • For each j : J H , points x : R j (X) and x : R j (Y )(x), and paths w : a j (x) = b j (x) and Remark 4.8. The type family of a displayed algebra is required to be 1-truncated. This means that the HITs we construct, can only be eliminated into 1-types, and as a consequence, these HITs only have the right elimination principle with respect to 1-types.
The underlying map of the morphism π 1 : Y → X takes the first projection of a pair.
We call Y the total algebra of Y and the morphism π 1 is called the first projection. The output of the elimination rule and the computation rules are given by a section to be defined in Definition 4.12 below. One might expect that, just like for the groupoid quotient, the computation rules for the paths are given as globes over some 2-path in the base (Definition 2.2). However, this is not the case.

Niccolò Veltri and Niels van der Weide
Vol. 17:2 This is because there is a slight discrepancy between the rules for the groupoid quotient and the HITs we discuss, namely for the former the computation rules for the points are definitional equalities while for the latter, these rules only hold propositionally. This affects how we need to formulate the computation rules for the paths.
Let us illustrate this via the torus (Example 3.5). The input for the elimination rule consists, among others, of a type family Y , a point b : Y (base), and a path p l : b = loop l b. The elimination rule gives a map f : (x : T 2 ), Y (x). By the point computation rule, we have a propositional equality between f (base) and b. Now the computation rule for loop l ought to equate apd f loop l and p l . However, such an equation does not type check since apd f loop l has type f (b) = loop l f (b) while p l has type b = loop l b. In conclusion, we cannot formulate the computation rules the same way as we did for the groupoid quotient.
Our solution to this problem is to define a type of squares over a given 2-path similarly to Definition 2.2 [LB15].
Definition 4.11. Let X be a type and let Y be a type family on X. Suppose that we are given points x 1 , x 2 : X and x 1 , x 1 : Y (x 1 ) and x 2 , x 2 : Y (x 2 ), paths p, q : x 1 = x 2 together with paths p : x 1 = p x 2 and q : x 1 = q x 2 over p and q respectively. If we also have two paths h 1 : x 1 = x 1 and h 2 : x 2 = x 2 and a 2-path g : p = q, then we define the type of squares over g from p to q with sides h 1 and h 2 by path induction on g.
Definition 4.12. Let X be an algebra for a given signature Σ and let Y be a displayed algebra over X. Then a section of Y consists of • A map f : (x : X), Y (x); • For all x : A(X), an equality f (c X (x)) = c Y (A(f )(x)); • For all j : J P and x : S(X), a square from apd f (p X j (x)) to p Y j (S(f )(x)) with sides l j (f )(x) and r j (f )(x).
Definition 4.13. Let Σ be a signature. Then a 1-truncated higher inductive type for Σ consists of an algebra X be an algebra for Σ and a proof that each displayed algebra Y over X has a section.
Often we just say that X is a HIT for Σ instead of saying that X is 1-truncated HIT. With this in place, we can check whether our rules for higher inductive types agree for the usual examples with the rules given in the literature [Uni13]. We illustrate this with the torus (Example 3.5) and the set truncation (Example 3.7). In the next example, we write p • q for the concatenation of dependent paths.
Example 4.14 (Example 3.5 cont'd). Recall the signature T 2 for the torus. Let X be a HIT for T 2 . Since X is an algebra, we have a point base : X, two paths loop l , loop r : base = base, and a 2-path surf : loop l • loop r = loop r • loop l . This corresponds precisely to the usual introduction rules of the torus.
A family Y of 1-types on X together with a point b : Y (base), two paths l : b = loop l b and r : b = loopr b and a globe h : l • r = surf r • l over surf gives rise to a displayed algebra over X. This corresponds to the usual input of the elimination rule of the torus. If we have a section s of Y , then in particular, we get a map f s : (x : X), Y (x). We also get a path p s : f (base) = b, a square from apd f loop l to l and one from apd f loop r to r. Both squares have sides p s and p s . These are the computation rules for the points and paths of the torus. Note that since we are looking at 1-truncated HITs, this only gives the 1-truncation of the torus. Example 4.15 (Example 3.7 cont'd). Let A be a 1-type and recall the signature ||A|| 0 . Now let X be a HIT on ||A|| 0 . Note that an algebra for ||A|| 0 consists of a type Z together with a map A → Z and a proof that Z is a set. This means in particular, that we have a map inc : A → X and a proof trunc that X is a set. A family Y of sets on X together with a map i : (a : A), Y (inc(A)) give rise to a displayed algebra over X. A section s of that displayed algebra consists of a map f s : (x : X), Y (x) such that f s (inc(a)) = i(a) for all a : A. This corresponds to the usual elimination and computation rules for the set truncation.
To verify that an algebra satisfies the elimination rule, we use initial algebra semantics [HJ98]. However, this technique is usually applied in a categorical setting and it uses initial objects in categories. Since we work in a bicategorical setting, we need to use the corresponding notion in bicategory theory: biinitiality.
Definition 4.16. Let B be a bicategory and let x be an object in B. Then we say x is biinitial if • For each object y there is a 1-cell x → y; • Given 1-cells f, g : x → y, there is a 2-cell f ⇒ g; • Given 2-cells θ, θ : f ⇒ g, there is an equality θ = θ .
Briefly, an object x is biinitial if for each y there is a 1-cell from x to y, which is unique up to a unique 2-cell. One can show that this definition is equivalent to the category x → y being contractible for all y. Now we can formulate initial algebra semantics for our signatures.
Proposition 4.17. Let Σ be a signature and let X be an algebra for Σ. Then X is a 1-truncated HIT for Σ if and only if X is biinitial in Alg(Σ).
One consequence of initial algebra semantics, is that HITs are unique up to path equality if the univalence axiom holds. This result is a consequence of the fact that the bicategory of algebras is univalent. Recall that a bicategory is univalent if equality between objects X and Y is equivalent to adjoint equivalences between X and Y and equality of 1-cells f and g is equivalent to invertible 2-cells between f and g [AFM + 20]. Using the methods employed by Ahrens et al. [AFM + 20] one can show that the bicategory of algebras is univalent. Since biinitial objects are unique up to adjoint equivalence, one can conclude that HITs are unique up to path equality.
Proposition 4.18. Let Σ be a signature and let H 1 and H 2 be HITs for Σ. Denote the underlying algebras of H 1 and H 2 by X 1 and X 2 . Then X 1 = X 2 .

Lifting the Groupoid Quotient
To construct higher inductive types, we use Proposition 4.17, which says that biinitial objects satisfy the induction principle. We use the groupoid quotient to acquire the desired algebra. More specifically, we construct a pseudofunctor from Alg Grpd (Σ) to Alg(Σ), which is the groupoid quotient on the carrier. We do that in such a way that the obtained pseudofunctor preserves biinitiality, so that we obtain the HIT by constructing a biinitial object in Alg Grpd (Σ).

Niccolò Veltri and Niels van der Weide
Vol. 17:2 One class of pseudofunctors which preserve biinitial objects is given by left biadjoints. More precisely, suppose that we have bicategories B and C, a left biadjoint pseudofunctor L : Pseudo(B, C), and an object x : B. Then the object L(x) is biinitial if x is.
Instead of directly lifting the groupoid quotient to the level of algebras, we first show that the groupoid quotient specifies a left biadjoint pseudofunctor and then we lift that biadjunction to the level of algebras. To do so, we use the fact we defined the bicategory of algebras via displayed bicategories. This way we can define the biadjunction on each part of the structure separately.
More specifically, we define the notion of displayed biadjunction between two displayed bicategories over a biadjunction in the base, and we show that each displayed biadjunction gives rise to a total biadjunction between the total bicategories. Defining displayed biadjunctions requires defining displayed analogues of pseudofunctors, pseudotransformations, and invertible modification, which were defined by Ahrens et al. Definition 5.1. Let D 1 and D 2 be displayed bicategories over B 1 and B 2 respectively and let F : Pseudo(B 1 , B 2 ) be a pseudofunctor. Then a displayed pseudofunctor F from D 1 to D 2 over F consist of • For all 1-cells f : x → y, objects x : D 1 (x) and y : D 1 (y), and displayed 1-cells f : • For all f : x f − → y and g : y Here F i and F c denote the identitor and compositor of F . In addition, several coherencies, which can be found in the formalization, need to be hold. We denote the type of displayed pseudofunctors from D 1 to D 2 over F by D 1 • For all 1-cells f : x → y and f : Here θ 1 denotes the family of invertible 2-cells corresponding to the naturality squares of θ. Again several coherencies must be satisfied and the precise formulation can be found in the formalization. The type of displayed pseudotransformatons from F to G over θ is denoted by F θ = ⇒ G. Definition 5.3. Suppose that we have displayed bicategories D 1 and D 2 over B 1 and B 2 , displayed pseudofunctors F and G from D 1 to D 2 over F and G respectively, and displayed pseudotransformations θ and θ from F to G over θ and θ respectively. In addition, let m be an invertible modification from θ to θ . Then a displayed invertible modification m from θ to θ over m consists of a displayed invertible 2-cell m 2 (x) : θ(x) for each x : B 1 and x : D 1 (x), In addition, a coherency must be satisfied, which can be found in the formalization. The type of displayed invertible modifications from θ to θ over m is denoted by θ m * 4 θ .
Before we can define displayed biadjunctions, we need several operations on the displayed gadgets we introduced.
Example 5.6. We have the following Definition 5.7. Suppose we have bicategories B 1 and B 2 and a biadjunction L R from B 1 to B 2 . We write η and for the unit and counit of L R respectively, and we write τ 1 and τ 2 for the left and right triangle respectively. Suppose, that we also have displayed bicategories D 1 and D 2 over B 1 and B 2 respectively and a displayed pseudofunctor L : D 1 L − → D 2 . Then we say L is a displayed left biadjoint pseudofunctor if we have : R · L = ⇒ id; • Displayed invertible modifications From Construction 5.5, we get Proposition 5.8. Given a displayed left biadjoint pseudofunctor L, then L is a left biadjoint pseudofunctor.
Now let us use the introduced notions to construct the biadjunction on the level of algebras. Our approach is summarized in Figure 4. We start by showing that the groupoid quotient gives rise to a biadjunction. Construction 5.10 (for Problem 5.9). We only show how the involved pseudofunctors are defined. The pseudofunctor GQuot is the groupoid quotient while PathGrpd sends a 1-type X to the groupoid whose objects are points of X and morphisms from x to y are paths x = y.
Notice that the above biadjunction turns into a biequivalence if we consider the bicategory of univalent groupoids in place of Grpd. This implies that the biadjunction of Problem 5.9 cannot be a biequivalence, since not every groupoid is equivalent to a univalent groupoid.
Next we lift this biadjunction to the level of algebras using the displayed machinery introduced in this section.
Construction 5.12 (for Problem 5.11). We only give a very brief outline of the construction.
We start by constructing a displayed biadjunction from DFalg( A Σ ) to DFalg( A Σ ) over the biadjunction from Construction 5.10. To do so, we first need to lift the pseudofunctors, and for that, we generalize the approach of Hermida and Jacobs to the bicategorical setting [HJ98, Theorem 2.14]. This requires us to construct two pseudotransformations.
We denote the total biadjunction of the resulting displayed biadjunction by GQuot PreAlg PathGrpd PreAlg .
Next we lift the biadjunction to the level of path algebras and for that, we construct a displayed biadjunction between DFcell( l Σ (i) , r Σ (i) ) and DFcell( l Σ (i) , r Σ (i) for all j : J P . Denote the resulting total biadjunction by GQuot PathAlg PathGrpd PathAlg .
To finish the proof, we need to construct one more displayed biadjunction. For that, we only need to show that if G : PathAlg Grpd (Σ) is an algebra, then GQuot PathAlg (G) also is an algebra, and if X : PathAlg(Σ) is an algebra, then so is PathGrpd PathAlg (X).
The next proposition concludes this section.

HIT Existence
From Theorem 4.17 we know that initiality implies the induction principle. Hence, it suffices to construct a biinitial object in the bicategory of algebras in 1-types. By Proposition 5.13, it suffices to construct a biinitial object in Alg Grpd (Σ). To do so, we adapt the semantics by Dybjer and Moeneclaey to our setting [DM18].
Construction 6.2 (for Problem 6.1). We only discuss how the carrier G of G is defined.
• Note that each polynomial P gives rise to a containerP . Note that each container induces a W-type [AAG03], and we define the type of objects of G to be the W-type induced bŷ A. Denote this type by G 0 and let c G 0 : A(G 0 ) → G 0 its algebra map.
• The morphisms of G are constructed as a set quotient. The main idea is to define the type of morphisms and equalities between them so that the groupoid has the desired structure. For each part of the structure, we add a constructor, so concretely, we have constructors witnessing the path constructors, identity, composition, and all other laws. First, we define an inductive type x ∼ P y, for each polynomial P : P and elements x, y : P (G 0 ). Its constructors are given in Figure 5. When P is Id, we write x ∼ y instead of x ∼ Id y. Afterwards, for each P : P,x, y : P (G 0 ) and f, g : x ∼ P y, we define a type f ≈ P g. Again this type is defined inductively, and its constructors can be found in Figure 6. Note that given p : x ∼ P y, we can define e (p) : e (x) ≈ Q e (y) where e is an endpoint. When P is Id, we write f ≈ g instead of f ≈ Id g.
Note that the input of the quotient is an equivalence relation, which is valued in propositions. For this reason, we define f ≈ p g to be the propositional truncation of f ≈ g. All in all, we define the morphisms from x to y to be the set quotient of x ∼ y by ≈ p . Problem 6.3. Each signature has a HIT.
Construction 6.4 (for Problem 6.3). By Propositions 4.17 and 5.13, it suffices to find a biinitial object in Alg Grpd (Σ). The desired object is given in Construction 6.2.

Additional Examples
In this section we present some additional examples, which complement the ones introduced in Section 3. Remember that our higher inductive types are all 1-truncated, and we always omit the 1-truncation constructor from their syntax. 7.1. Coinserter. The coinserter is a bicategorical generalization of the coequalizer in a category. In the bicategory of 1-types, coinserters can be constructed as homotopy coequalizer [Uni13, Chapter 6].
, path ∼ (j, y)) Figure 6: Rules for the type f ≈ P g.

8:26
Niccolò Veltri and Niels van der Weide Vol. 17:2 Definition 7.1. Let B be a bicategory. Let A and B be objects of B and let f, g : A → B.
The coinserter of f and g is an object Q together with a 1-cell q : B → Q and a 2-cell θ : f · q ⇒ g · q. The triple (Q, q, θ) must satisfy the following universal property. Suppose that we have • an object Q ; • a 1-cell q : B → Q ; • a 2-cell θ : f · q ⇒ g · q .
Then there exists a 1-cell h : is unique up to unique 2-cell, which means that given another 1-cell h : Q → Q and another 2-cell φ : Next we show how to construct coinserters in the bicategory of 1-types. Given two 1-types A and B and two functions f, g : A → B, the coinserter of f and g is given by the following HIT: Here are all the ingredients needed to specify the signature Coeqz(f, g) for the coinserter: • A Coeqz(f,g) :≡ C(B); • J Coeqz(f,g) P :≡ 1, and for its unique inhabitant take S Coeqz(f,g) :≡ C(A) and endpoints l Coeqz(f,g) :≡ fmap(f ) · constr, r Coeqz(f,g) :≡ fmap(g) · constr; • J Coeqz(f,g) H is the empty type. 7.2. Coequifier. The coequifier is a finite colimit in a bicategory, corresponding to a higher version of the coequalizer. While the coinserter makes a diagram of 1-cell commute up to a 2-cell, the coequifier makes a diagram of 2-cells commute strictly.
Definition 7.2. Let B be a bicategory. Let A and B be objects of B, let f, g : A → B be 1-cells and β, γ : f ⇒ g be 2-cells. The coequifier of β and γ is an object Q together with a 1-cell q : B → Q and a path β q = γ q. The pair (Q, q) must satisfy the following universal property. Suppose that we have • an object Q , • a 1-cell q : B → Q , and • a path β q = γ q .
Then there exists a 1-cell h : Q → Q together with a 2-cell φ : q · h ⇒ q . The pair (h, φ) is unique up to a unique 2-cell, which means that given another 1-cell h : Q → Q and another 2-cell φ : q · h ⇒ q , there exists a unique 2-cell τ : h ⇒ h such that q τ • φ = φ.
In the construction of the homotopy endpoints we used the function idtoH introduced in Section 3.1, which embeds paths between endpoints into homotopy endpoints. Notice also the difference between ap and ap: the first is an homotopy endpoint constructor, the second indicates the application of a function to a path. 7.3. Group Quotient. Now we introduce a particular instance of the groupoid quotient, that we call the group quotient. We start with a group G and we write id for its unit and · for multiplication in G. Define a groupoid G with only one object and with G as the only homset. The group quotient of G is the groupoid quotient of G, and it corresponds to the following HIT: The signature GroupQuot(G) for the group quotient is defined as follows: • A :≡ C(1); • J P :≡ 1, and for its unique inhabitant take S :≡ C(G) and both endpoints l and r equal to c(tt) · constr. • J H :≡ 2, where 2 is the type of booleans with inhabitants true and false. This means that there are two homotopy constructors: loope, with associated label true, and loopm, with associated label false. • The constructor loope does not have point arguments, so we take R true :≡ C(1). It also does not have path arguments, therefore T true :≡ C(1) and a true :≡ b true :≡ c(tt). The endpoints s true and t true are both equal to c(tt) · constr. The left homotopy endpoint is ap constr (cmap(c(id))) −1 @ α −1 @ path(c(id)) @ α @ ap constr (cmap(c(id))), while the right homotopy endpoint is idpath(constr).

8:28
Niccolò Veltri and Niels van der Weide Vol. 17:2 • The constructor loopm has two point arguments of type G, so we take R false :≡ C(G × G). It does not have path arguments, therefore T false :≡ C(1) and a false :≡ b false :≡ c(tt). The endpoints s false and t false are both equal to c(tt)·constr. The left homotopy endpoint is ap constr (cmap(fmap(λ x, y. x · y))) −1 @ α −1 @ path(fmap(λ x, y. x · y)) @ α @ ap constr (cmap(fmap(λ x, y. x · y))), while the right endpoint is ap constr (cmap(fmap(π 1 ))) −1 @ α −1 @ path(fmap(π 1 )) @ α @ ap constr (cmap(fmap(π 1 ))) @ ap constr (cmap(fmap(π 2 ))) −1 @ α −1 @ path(fmap(π 2 )) @ α @ ap constr (cmap(fmap(π 2 ))) The signature for the groupoid quotient is obtainable as a slight generalization of the signature for the group quotient. We do not show the more general construction here, since this is not conceptually more enlightening than the (already quite complicated) signature for the group quotient. 7.4. Monoidal Object. Next we look at two other examples of signatures. Here we are not interested in the HIT described by the signature, but instead, we are interested in the algebras. We first discuss the signature whose algebras are monoidal objects. We do not show the signature associated to this HIT here. We redirect the interested reader to our formalization for the complete definition.
In the constructors of MonObj, one can recognize the data of a monoidal category. The point constructors u and m correspond to unit object and tensor. The path constructors lam, rho and al are left unitor, right unitor and associator respectively, while the homotopy constructors tr and pent are the two coherence laws of monoidal categories. And in fact, algebras in groupoids of the monoidal object signature are precisely monoidal groupoids, the groupoid variant of monoidal categories, and MonObj is a presentation of the initial monoidal groupoid. Note that Piceghello proved coherence for monoidal groupoids [Pic19], and algebras for the signature MonObj correspond to those monoidal groupoids.
Example 7.3. Let A be a 1-type. We can construct an algebra of MonObj whose carrier is the type List(A) of lists of A. The unit is the empty list, the tensor is concatenation, and the laws and coherencies are proven by induction.
We also define a signature CohGrp whose algebras are coherent 2-groups [BL20]. Its definition includes all the constructors of the monoidal object, plus a new point constructor i : CohGrp → CohGrp, two new path constructors linv : and two new homotopy constructors similar to the coherencies given by Baez and Lauda [BL20]. We look at two examples of coherent 2-groups. The first is based on the work of Buchholtz et al. [BvDR18] and Kraus and Altenkirch [KA18]. They define higher groups as loop spaces and for 1-truncated types, the loop space is a coherent 2-group in our sense.
Example 7.4. Suppose, A is a 2-type and a is a point of A. Then we can construct an algebra of CohGrp whose carrier is given by a = a.
The second example is the automorphism group on a 1-type whose elements are equivalences on a given 1-type. Note that this group is the loop space of the 2-type of 1-types due to univalence.
Example 7.5. Let A be a 1-type. We have an algebra of CohGrp whose carrier is given by equivalences f : A → A. The unit element is the identity function, the tensor is the concatenation, and the inverse is just the inverse of an equivalence.

PIE Limits of Algebras
This section is dedicated to the construction of PIE limits in the bicategory Alg(Σ) of algebras in 1-types for the signature Σ [PR91]. Note that Alg(Σ) also has a terminal object whose carrier is the unit type. 8.1. Products. Binary products in a bicategory generalize the notion of binary product in a category.
Definition 8.1. Let B be a bicategory and let A and B be two objects of B. The product of A and B is given by an object A × B together with 1-cells π 1 : A × B → A and π 2 : A × B → B.
The triple (A × B, π 1 , π 2 ) must satisfy the following universal property. Given an object X and 1-cells f : X → A and g : X → B, there exist a 1-cell f, g : X → A × B and two 2-cells θ : f, g · π 1 ⇒ f and θ : f, g · π 2 ⇒ g.
• The carrier is A × B, the product of the carriers of A and B.
• The function c A×B : • For all labels j : J P we are given pseudonatural transformations l j and r j . We write l j X for the component of l j at object X. Given a 1-cell f : X → Y in Alg(Σ), we write l j (f ) for the 2-cell of type l j X · f ⇒ S j (f ) · l j Y (this is the same notation used in Example 2.11). We write similarly for r j . For each point x : S j (A×B), we are required to construct a path p A×B j (x) : l j A×B (x) = r j A×B (x). This is a path in A×B, so it is enough to construct two paths π 1 ( l j A×B (x)) = π 1 ( r j A×B (x)) and π 2 ( l j A×B (x)) = π 2 ( r j A×B (x)). The first of these is defined as the following concatenation of paths: The second path is defined analogously. • The construction of the required homotopies is more involved and we refer the reader to the formalization for all the details.
It is not difficult to show that the projections π 1 : A × B → A and π 2 : A × B → B are morphisms of algebras. Moreover, the product of algebras satisfies the required universal property of Definition 8.1. Given two algebra morphisms f : X → A and g : X → B, we have a function f, g : X → A × B by the universal property of the product (of types). We refer the reader to the formalization for the proof that f, g is a morphism of algebras. 8.2. Inserter. The inserter in a bicategory is a generalization of the equalizer in a category.
Definition 8.4. Let B be a bicategory. Let A and B be objects of B and let f, g : A → B.
The inserter of f and g is an object E together with a 1-cell e : E → A and a 2-cell : e · f ⇒ e · g. The triple (E, e, ) must satisfy the following universal property. Suppose we have • an object E ; • a 1-cell e : E → A; • a 2-cell : e · f ⇒ e · g.
Then there exists a 1-cell h : E → E together with a 2-cell φ : h · e ⇒ e and a path The pair (h, φ) is unique up to unique 2-cell, which means that given another 1-cell h : E → E, another 2-cell φ : h · e ⇒ e , and a path Note that there is a choice for the direction of the 2-cell : e · f ⇒ e · g since we could also have chosen : e · g ⇒ e · f or we could have required this 2-cell to be inevrtible. However, since we only consider bicategories in which all 2-cells are invertible, this choice does not matter.
Problem 8.5. Given algebras A and B for Σ and algebra morphisms f, g : A → B, to construct the inserter of f and g in Alg(Σ).
Construction 8.6 (for Problem 8.5). The inserter of f and g is defined as the total algebra Y of a displayed algebra Y over A. Displayed algebras were introduced in Definition 4.7. Y is defined as follows: Suppose we have x : A(Y )(x). By induction on the polynomial A, it is possible to derive from x a path p : A(f )(x) = A(g)(x). We define c Y (x) as the following concatenation of paths: • The construction of paths p Y j is relatively involved, and we refer to the formalization for the details.
• The construction of globes h Y j is straightforward. These are paths between paths in Y (x), for some point x. Since Y (x) is a set, the required paths exist.
The 1-cell e is the first projection out of the total algebra Y , which is an algebra morphism by construction. The 2-cell is the second projection out of Y . The algebra Y satisfies the required universal property of the inserter spelled out in Definition 8.4. 8.3. Equifier. The equifier is finite limit in a bicategory, corresponding to a higher version of the equalizer.
Definition 8.7. Let B be a bicategory. Let A and B be objects of B, let f, g : A → B and β, γ : f ⇒ g. The equifier of β and γ is an object E together with a 1-cell e : E → A and a path e β = e γ. The pair (E, e) must satisfy the following universal property. Suppose we have Then there exists a 1-cell h : E → E together with a 2-cell φ : h · e ⇒ e . The pair (h, φ) is unique up to unique 2-cell, which means that given another 1-cell h : E → E and another 2-cell φ : h · e ⇒ e , there exists a unique 2-cell τ : h ⇒ h such that τ e • φ = φ.
Problem 8.8. Given algebras A and B for Σ, given 1-cells f, g : A → B and 2-cells β, γ : f ⇒ g, to construct the equifier of β and γ in Alg(Σ).
Construction 8.9 (for Problem 8.8). Similar to the construction of the inserter, we define the equifier of β and γ as the total algebra Y of the following displayed algebra Y over A.

8:32
Niccolò Veltri and Niels van der Weide Vol. 17:2 • For each x : A(A), we are required to construct a map c Y : A(Y )(x) → β(c A (x)) = γ(c A (x)). Assume given x : A(Y )(x). By induction on the polynomial A, it is possible to derive from x a path p : A(β)(x) = A(γ)(x). We define c Y (x) as the following concatenation of paths: • The construction of paths p Y j and globes h Y j is straightforward. These are respectively paths and paths between paths in Y (x) for some point x. Since Y (x) is a proposition, these constructions are all trivial.
The 1-cell e is the first projection out of the total algebra Y , which is an algebra morphism by construction. The 2-cell is the second projection out of Y . The algebra Y satisfies the required universal property of the equifier spelled out in Definition 8.7.

The Free Algebra
In this section, we discuss the free algebra for a signature Σ and show that it gives rise to a left biadjoint pseudofunctor from 1-types to algebras in 1-types for Σ. From this, we conclude that each signature generates a pseudomonad on the bicategory of 1-types [Lac00].
We construct the free algebra for Σ as a biinitial algebra for a modified version of Σ. More specifically, suppose that we have a signature Σ and a 1-type A. We first construct another signature, called the free signature, which has all the constructors of Σ and an additional point constructor with arguments from A. Then we define the free Σ-algebra on A to be the biinitial algebra for the free signature.
Definition 9.1. Let Σ be a signature and let A be a 1-type. Define the free signature FreeSig Σ (A) as follows and q FreeSig Σ (A) to be p Σ and q Σ respectively.
Before we state and prove the isomorphism theorem, we define the kernel of algebra morphisms.
Definition 10.9 (Kernel). Given a signature Σ, algebras X, Y : Alg(Σ), and an algebra morphism f : X → Y , we define a groupoid algebra Ker(f ) on X, called the kernel of f , by setting R(x, y) :≡ f (x) = f (y).
Proof. Using Remark 10.7, we can define the maps f : GQuot Alg ( Ker(f )) → Y and f : GQuot Alg ( Ker(f )) → Im(f ). Note that from Remark 10.7, we also get that f satisfies the required equalities and that f is unique. To show that f is an adjoint equivalence, we use Proposition 10.8, and we do that by showing that the fibers are contractible. Proving that the fibers are inhabited and propositional is similar to proving the surjectivity and injectivity for the set-theoretical first isomorphism theorem [LS19].

Calculating Fundamental Groups
Let us finish by using Construction 6.4 to determine the fundamental group of some HITs. Such results are often proven by encode-decode method [LS13,LF14], but we take a different approach. We only use encode-decode to determine the path space of the groupoid quotient. For the HITs considered in this section, we give a simpler description of the initial groupoid algebra, which fixes the fundamental group. We start by determining the path space of the groupoid quotient.
Proposition 11.1. Let G be a groupoid and let x and y be objects in G. Then the types gcl(x) = gcl(y) and G(x, y) are equivalent.
As a result, the type of paths between two points in a HIT is the type of morphisms in the initial groupoid algebra. Since this algebra is unique, we can determine the fundamental group by finding a simpler description of the initial groupoid algebra. 11.1. Circle. Recall that the circle is defined as the following HIT Inductive S 1 := | base S 1 : S 1 | loop S 1 : base S 1 = base S 1 We can define a signature S 1 that represents this HIT. Notice that the HIT generated by this signature includes also a 1-truncation constructor, which is superflous in this case since S 1 is already provably 1-truncated.
Next we construct a groupoid algebra S of this signature and we prove that S is biinitial.
Definition 11.2. We define a groupoid S as follows • the type of objects is the unit type; • the type of morphisms from tt to tt is the type integers.
Problem 11.3. To construct an S 1 -algebra structure on S.
Construction 11.4 (for Problem 11.3). To construct the desired algebra structure, we first need to define a functor b from the unit category to S. This functor sends the unique element to tt. Furthermore, we need to define a natural transformation l from b to b. On each component, this transformation is defined to be 1.
From Construction 6.4 and the fact that biinitial objects are unique up to equivalence, we can deduce that the circle is the groupoid quotient of S and that its base point base S 1 is gcl(tt). Since the morphisms of S are just the integers, we immediately get the following from Proposition 11.1 Corollary 11.6. The type base S 1 = base S 1 is equivalent to the integers.
11.2. Torus. Next we look at the torus, which we defined in Example 3.5. We use the same approach to determine its fundamental group, so we start by giving a simpler description of the biinitial algebra for T 2 in groupoids.
Definition 11.7. Define a groupoid T as follows • the type of objects is the unit type; • the type of morphisms from tt to tt is Z × Z.
Problem 11.8. To construct an T 2 -algebra structure on T .
Construction 11.9 (for Problem 11.8). Again the point constructor is given by a functor b from the unit category to T , which sends the unique element to tt. The two natural transformations l and r from b to b send each element to (1, 0) and (0, 1) respectively. For the last component, we need to give an equality s between (1, 0) + (0, 1) = (0, 1) + (1, 0). This holds definitionally.
Again we can deduce that the torus is the groupoid quotient of T and that its base point base is gcl(tt). From Proposition 11.1, we immediately get Corollary 11.11. The type base = base is equivalent to Z × Z.
11.3. Group Quotient. For the remainder of this section, we assume that a group G is given. Our goal is to show that the fundamental group of the group quotient at its base point is G. Again we do this by determining the biinitial groupoid algebra. The algebra structure is constructed in a similar fashion to Construction 11.9.
Definition 11.12. We define a groupoid G as follows • the type of objects is the unit type; • the type of morphisms from tt to tt is G.
Problem 11.13. To construct an GroupQuot(G)-algebra structure on G.
Corollary 11.15. The fundamental group of the group quotient of G is G itself.

Conclusion and Further Work
We showed how to construct finitary 1-truncated higher inductive types using the propositional truncation, quotient, and the groupoid quotient. This reduces the existence of a general class of HITs to simpler ones. We needed the types to be 1-truncated, so that we could use the framework of bicategory theory, and the HITs we studied had to be finitary to guarantee that the groupoid quotient commutes with the involved operations [CUV19]. On the way, we also proved that HITs are unique and we studied universal algebra with our signatures. We showed that the bicategory of algebras has finite limits and we proved the first isomorphism theorem for these algebras. Lastly, we used the way we constructed HITs to calculate fundamental groups. There are numerous ways to improve on these results. First of all, we only constructed finite limits of algebras while it should also be possible to construct finite colimits of algebras. The scheme studied in this paper is not flexible enough to support these colimits since we do not have a path endpoint that represents the action of a polynomial on the point constructor. Hence, if we want to internally construct these colimits, then we need to define a more permissive signature for higher inductive types. Secondly, it should be possible to modify our approach to obtain HITs in directed type theory (DTT) [Nor19]. In the model of DTT provided by North, types are interpreted as categories and higher inductive types in DTT could be interpreted as initial algebras. We constructed such algebras in the bicategory of groupoids and in a similar way, one should be able to construct the desired algebras in the bicategory of categories.
Lastly, our construction only considers a rather simple scheme of HITs. In particular, we restrict ourselves to the 1-truncated case. Since untruncated types correspond to ∞groupoids, generalizing the methods used in this paper to the untruncated case, requires formalizing notions from ∞-category theory in type theory [AR12,CK18,FM17]. This also requires finding an ∞-dimensional generalization of the groupoid quotient. An alternative approach to deal with untruncated HITs, pointed out by Ali Caglayan, would be using wild categories [HHT15,KvR19]. Note that generalizing Construction 6.2 would also pose a challenge, because the set quotient cannot be used. Instead all n-morphisms must be freely generated by the n-path constructors. We would also like to extend our scheme to incorporate both indexed HITs and higher inductive-inductive types [CH19,KK18].