This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

The Integers as a Higher Inductive Type

Thorsten Altenkirch  and  Luis Scoccola
Abstract.

We consider the problem of defining the integers in Homotopy Type Theory (HoTT). We can define the type of integers as signed natural numbers (i.e., using a coproduct), but its induction principle is very inconvenient to work with, since it leads to an explosion of cases. An alternative is to use set-quotients, but here we need to use set-truncation to avoid non-trivial higher equalities. This results in a recursion principle that only allows us to define function into sets (types satisfying UIP). In this paper we consider higher inductive types using either a small universe or bi-invertible maps. These types represent integers without explicit set-truncation that are equivalent to the usual coproduct representation. This is an interesting example since it shows how some coherence problems can be handled in HoTT. We discuss some open questions triggered by this work. The proofs have been formally verified using cubical Agda.

1. Introduction

How to define the integers in Homotopy Type Theory? This can sound like a trivial question. The first answer is as signed natural numbers:

Definition 1.1.

Let w\mathbb{Z}_{w} be the inductive type generated by the following constructors:

  • 0:w0:\mathbb{Z}_{w}

  • 𝗌𝗍𝗋𝗉𝗈𝗌:w\mathsf{strpos}:\mathbb{N}\to\mathbb{Z}_{w}

  • 𝗌𝗍𝗋𝗇𝖾𝗀:w\mathsf{strneg}:\mathbb{N}\to\mathbb{Z}_{w}

However, this type is very inconvenient in practice because it creates a lot of unnecessary case distinctions. Nuo [Li15] tried to prove distributivity of multiplication over addition, which resulted in a lot of cases. It is like working with normal forms only, when working with λ\lambda-terms.

Nuo shows that it is much better to work with a quotient type, representing integers as differences of natural numbers. That is, we define q=×/\mathbb{Z}_{q}=\mathbb{N}\times\mathbb{N}/\sim where (x+,x)(y+,y)(x^{+},x^{-})\sim(y^{+},y^{-}) is defined as x++y=y++xx^{+}+y^{-}=y^{+}+x^{-} 111This is actually the definition in [Uni13].. However, this is not the end of the story. Here we use set-quotients, which can be implemented as a higher inductive type with a set-truncation constructor [Uni13, Section 6.10]. However, the set-truncation constructor implies that using its recursion principle we can only define functions into sets, which seems to be an unreasonable limitation when working in HoTT. For example, in the proof that the loop space of the circle is isomorphic to the integers [RLS13], we must map from the integers to the loop space of the circle, when we do not yet know that this will end up being a set.

We would like to have a definition of the integers which is convenient to work with (i.e., does not reduce them to normal forms) but which is not forced to be set-truncated by a set-truncation constructor. Paolo Capriotti suggested the following definition:

Definition 1.2.

Let h\mathbb{Z}_{h} be the higher inductive type with the following constructors:

  • 0:h0:\mathbb{Z}_{h};

  • 𝗌𝗎𝖼𝖼:hh\mathsf{succ}:\mathbb{Z}_{h}\to\mathbb{Z}_{h};

  • 𝗉𝗋𝖾𝖽:hh\mathsf{pred}:\mathbb{Z}_{h}\to\mathbb{Z}_{h};

  • 𝗌𝖾𝖼:(z:h)𝗉𝗋𝖾𝖽(𝗌𝗎𝖼𝖼(z))=z\mathsf{sec}:(z:\mathbb{Z}_{h})\to\mathsf{pred}(\mathsf{succ}(z))=z;

  • 𝗋𝖾𝗍:(z:h)𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽(z))=z\mathsf{ret}:(z:\mathbb{Z}_{h})\to\mathsf{succ}(\mathsf{pred}(z))=z;

  • 𝖼𝗈𝗁:(z:h)𝖺𝗉𝗌𝗎𝖼𝖼(𝗌𝖾𝖼(z))=𝗋𝖾𝗍(𝗌𝗎𝖼𝖼(z))\mathsf{coh}:(z:\mathbb{Z}_{h})\to\mathsf{ap}_{\mathsf{succ}}(\mathsf{sec}(z))=\mathsf{ret}(\mathsf{succ}(z)).

We add 𝗌𝗎𝖼𝖼\mathsf{succ} and 𝗉𝗋𝖾𝖽\mathsf{pred} as constructors, but then we postulate that they are inverse to each other using 𝗌𝖾𝖼\mathsf{sec} and 𝗋𝖾𝗍\mathsf{ret}. At this point we could add a set-truncation but then we would suffer from the same shortcoming as the definition using a set-quotient. However, we can add just one coherence condition 𝖼𝗈𝗁\mathsf{coh} which should look familiar to anybody who has read the HoTT book: indeed the constructors 𝗉𝗋𝖾𝖽\mathsf{pred}, 𝗌𝖾𝖼\mathsf{sec}, 𝗋𝖾𝗍\mathsf{ret}, and 𝖼𝗈𝗁\mathsf{coh} exactly say that 𝗌𝗎𝖼𝖼\mathsf{succ} is a half-adjoint equivalence [Uni13, Section 4.2]. More precisely, 𝗌𝖾𝖼\mathsf{sec} postulates that 𝗌𝗎𝖼𝖼\mathsf{succ} is a section, 𝗋𝖾𝗍\mathsf{ret} postulates that 𝗌𝗎𝖼𝖼\mathsf{succ} is a retraction, and 𝖼𝗈𝗁\mathsf{coh} represents the triangle identity in the definition of half-adjoint equivalence.

The question that now remains is the following. Is h\mathbb{Z}_{h} a correct definition of the integers, in particular is it a set with decidable equality? The strategy to prove this is to define a normalisation function into the signed integers, w\mathbb{Z}_{w}, and show that this normalisation function, together with the obvious embedding of w\mathbb{Z}_{w} into h\mathbb{Z}_{h}, forms an equivalence. It turns out that this is actually quite hard to prove, due to the presence of higher equalities, and nobody has so far been able to formally verify this.

In this paper, we follow the same idea but use a simpler definition of equivalence, namely bi-invertible maps [Uni13, Section 4.3]:

Definition 1.3.

Let b\mathbb{Z}_{b} be the higher inductive type with the following constructors:

  • 0:b0:\mathbb{Z}_{b};

  • 𝗌𝗎𝖼𝖼:bb\mathsf{succ}:\mathbb{Z}_{b}\to\mathbb{Z}_{b};

  • 𝗉𝗋𝖾𝖽1:bb\mathsf{pred}_{1}:\mathbb{Z}_{b}\to\mathbb{Z}_{b};

  • 𝗉𝗋𝖾𝖽2:bb\mathsf{pred}_{2}:\mathbb{Z}_{b}\to\mathbb{Z}_{b};

  • 𝗌𝖾𝖼:(z:b)𝗉𝗋𝖾𝖽1(𝗌𝗎𝖼𝖼(z))=z\mathsf{sec}:(z:\mathbb{Z}_{b})\to\mathsf{pred}_{1}(\mathsf{succ}(z))=z;

  • 𝗋𝖾𝗍:(z:b)𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽2(z))=z\mathsf{ret}:(z:\mathbb{Z}_{b})\to\mathsf{succ}(\mathsf{pred}_{2}(z))=z;

In this case we postulate that 𝗌𝗎𝖼𝖼\mathsf{succ} has a left inverse, given by 𝗉𝗋𝖾𝖽1\mathsf{pred}_{1} and 𝗌𝖾𝖼\mathsf{sec}, and a right inverse, given by 𝗉𝗋𝖾𝖽2\mathsf{pred}_{2} and 𝗋𝖾𝗍\mathsf{ret}. The reason why b\mathbb{Z}_{b} is simpler than h\mathbb{Z}_{h} is because it only has 0- and 11-dimensional constructors. The higher coherence 𝖼𝗈𝗁\mathsf{coh} is not needed in this case for the same reason that a 22-dimensional constructor is not needed in the definition of bi-invertible map: having two, a priory, unrelated inverses makes the type of witnesses that a certain map is bi-invertible a proposition ([Uni13, Theorem 4.3.2]).

For this definition we can give a complete proof that b\mathbb{Z}_{b} is equivalent to w\mathbb{Z}_{w}, which has been formalized in cubical Agda. We remark that this has previously been verified by Evan Cavallo [Cav18] in RedTT [red19]. However, our approach to prove the equivalence is more general. Our main result is Theorem 2.4, which says that only the components witnessing the preservation of 0 and 𝗌𝗎𝖼𝖼\mathsf{succ} are relevant when comparing morphisms out of b\mathbb{Z}_{b}.

Another presentation of the integers follows from directly implementing the idea that the integers can be specified as the initial type with an inhabitant and an equivalence:

  • 0:U0:\mathbb{Z}_{U};

  • s:U=Us:\mathbb{Z}_{U}=\mathbb{Z}_{U}.

The problem is that this is not a standard definition of a higher inductive type because we state an equality of the type itself. However, this can be fixed by using a small universe:

Definition 1.4.

Define U:𝒰U:\mathcal{U} and 𝖤𝗅:U𝒰\mathsf{El}:U\to\mathcal{U} inductively with the constructors:

  • z:Uz:U;

  • q:z=zq:z=z;

  • 0:𝖤𝗅(z)0:\mathsf{El}(z)

Now, let U:𝖤𝗅(z)\mathbb{Z}_{U}\vcentcolon\equiv\mathsf{El}(z).

While we can show that this is a set without using set-truncation, its recursion principle isn’t directly amenable to recursive definitions of functions because even 𝗌𝗎𝖼𝖼\mathsf{succ} is not a constructor. On the other hand the fact that the integers are the loop space of the circle is a rather easy consequence of this definition.

The definition of the integers is also closely related to the free group, indeed as suggested in [KA18] we can define the free group over a type AA by simply parametrizing all the constructors but 0:

Definition 1.5.

Given A:𝒰A:\mathcal{U}, define 𝐅(A)\mathbf{F}(A) inductively with the constructors:

  • 0:𝐅(A)0:\mathbf{F}(A);

  • 𝗌𝗎𝖼𝖼:A𝐅(A)𝐅(A)\mathsf{succ}:A\to\mathbf{F}(A)\to\mathbf{F}(A);

  • 𝗉𝗋𝖾𝖽1:A𝐅(A)𝐅(A)\mathsf{pred}_{1}:A\to\mathbf{F}(A)\to\mathbf{F}(A);

  • 𝗉𝗋𝖾𝖽2:A𝐅(A)𝐅(A)\mathsf{pred}_{2}:A\to\mathbf{F}(A)\to\mathbf{F}(A);

  • 𝗌𝖾𝖼:(a:A)(z:𝐅(A))𝗉𝗋𝖾𝖽1(a,𝗌𝗎𝖼𝖼(a,z))=z\mathsf{sec}:(a:A)\to(z:\mathbf{F}(A))\to\mathsf{pred}_{1}(a,\mathsf{succ}(a,z))=z;

  • 𝗋𝖾𝗍:(a:A)(z:𝐅(A))𝗌𝗎𝖼𝖼(a,𝗉𝗋𝖾𝖽2(a,z))=z\mathsf{ret}:(a:A)\to(z:\mathbf{F}(A))\to\mathsf{succ}(a,\mathsf{pred}_{2}(a,z))=z;

The integers arise as the special case =𝐅(𝟏)\mathbb{Z}=\mathbf{F}(\mathbf{1}). However, the normal forms get a bit more complicated because we must allow alternating sequences of 𝗌𝗎𝖼𝖼\mathsf{succ} and 𝗉𝗋𝖾𝖽\mathsf{pred} but only for different a:Aa:A. This means that a normalisation function is only definable for sets a:Aa:A with a decidable equality. The general problem of whether 𝐅(A)\mathbf{F}(A) is a set, if AA is, is still open — in [KA18] it is shown to be the case, if we 11-truncate the HIT.

The problem of defining the integers with convenient constructors, and adding only the right coherences to make it a set, can be seen as a simple instance of a more general class of coherence problems in HoTT. Another example that we have in mind is the intrinsic definition of the syntax of type theory as the initial category with families as developed in [AK16]. If we carry out this definition in HoTT, we need to set-truncate the syntax, but this stops us from interpreting the syntax in the standard model formed by sets. We hope that also in this case we can add the correct coherence laws and show that they are sufficient to deduce that the initial algebra is a set.

1.1. Contributions

We show that the definitions of the signed integers, w\mathbb{Z}_{w}, the definition of the integers as a higher inductive type using bi-invertible maps, b\mathbb{Z}_{b}, and the definition using a higher inductive-inductive type with a mini universe, U\mathbb{Z}_{U}, are all equivalent (Theorem 4.7).

For b\mathbb{Z}_{b} we establish some useful principles such as a recursion principle (Proposition 2.1) which only uses one predecessor, and an induction principle which says that to prove a predicate (i.e., a family of propositions), you only need to prove closure under 0, 𝗌𝗎𝖼𝖼\mathsf{succ}, and 𝗉𝗋𝖾𝖽1\mathsf{pred}_{1} (Proposition 2.2). This is sufficient to verify all algebraic properties of the integers, e.g., that the integers form a commutative ring. We have formalized [AS19] the constructions using cubical Agda [AMV19].

When formalizing the constructions involving b\mathbb{Z}_{b} we developed the theory of bi-invertible maps in cubical Agda, which wasn’t available. In particular, we prove that bi-invertible maps are equivalent to contractible-fibers maps [Uni13, Section 4.4], and the principle of equivalence induction for bi-invertible maps.

1.2. Related work

The claim that h\mathbb{Z}_{h} is a set can be found in [AP18] but the proof was flawed: it relies on the assumption that we can ignore propositional parts of an algebra for a certain signature when constructing algebra morphisms, which is not the case in general (Example 6.1). Cavallo [Cav18] verified that bw\mathbb{Z}_{b}\simeq\mathbb{Z}_{w} in RedTT. Higher inductive representations of the integers are discussed in [BGvdW17] and it is shown there that h\mathbb{Z}_{h} without the last constructor is not a set. [Kv19] also discuss [AP18] and note that it is a corollary of their higher Seifert-van Kampen theorem — however, they derive it from initiality not from the induction principle.

1.3. Background

We use Homotopy Type Theory as presented in the book [Uni13]. We adopt the following notational conventions.

If two terms aa and bb are definitionally equal, we write aba\equiv b, and we reserve a=ba=b to denote the type of propositional equalities between aa and bb.

Given a type A:𝒰A:\mathcal{U} and a type family P:A𝒰P:A\to\mathcal{U}, we write the corresponding Π\Pi-type as (a:A)P(a)(a:A)\to P(a), and the corresponding Σ\Sigma-type as (a:A)×P(a)(a:A)\times P(a).

Given a type A:𝒰A:\mathcal{U}, a type family P:A𝒰P:A\to\mathcal{U}, an equality e:a=be:a=b in AA, and p:P(a)p:P(a), we denote the coercion of pp along ee by e(p):P(b)e_{*}(p):P(b). This is defined by induction on ee.

A type is contractible if it has exactly one inhabitant. That is, given a type A:𝒰A:\mathcal{U}, we define 𝗂𝗌𝖢𝗈𝗇𝗍𝗋(A):(a0:A)×((a:A)a=a0)\mathsf{isContr}(A)\vcentcolon\equiv(a_{0}:A)\times\left((a:A)\to a=a_{0}\right). A type is a proposition if any two inhabitants are equal. That is, given a type A:𝒰A:\mathcal{U}, we define 𝗂𝗌𝖯𝗋𝗈𝗉(A):(a,b:A)a=b\mathsf{isProp}(A)\vcentcolon\equiv(a,b:A)\to a=b, [Uni13, Definition 3.3.1]. A type is a set if it satisfies UIP. That is, given a type A:𝒰A:\mathcal{U}, we define 𝗂𝗌𝖲𝖾𝗍(A):(a,b:A)(p,q:a=b)p=q\mathsf{isSet}(A)\vcentcolon\equiv(a,b:A)\to(p,q:a=b)\to p=q, [Uni13, Definition 3.1.1].

An equivalence between types AA and BB is a map f:ABf:A\to B together with a proof that (b:B)𝗂𝗌𝖢𝗈𝗇𝗍𝗋((a:A)×f(a)=b)(b:B)\to\mathsf{isContr}((a:A)\times f(a)=b). The type of equivalences between AA and BB is denoted by ABA\simeq B.

The general syntax of Higher Inductive Inductive Types (HIITs) is specified in [KK19], where also the types of the eliminators are derived. In the informal exposition, and in the formalisation, we use the cubical approach to path algebra introduced in [LB15].

For the formalisation we use cubical Agda [AMV19] which is based on the cubical type theory of [CCHM18]. The development of HIITs in Agda is based on [CHM18].

2. Representing \mathbb{Z} using bi-invertible maps

f(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x))){f(\mathsf{succ}(\mathsf{pred}_{1}(x)))}g(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x))){g(\mathsf{succ}(\mathsf{pred}_{1}(x)))}s(p(f(x))){s(p(f(x)))}s(p(g(x))){s(p(g(x)))}f(x){f(x)}g(x){g(x)}f(x){f(x)}g(x){g(x)}𝖺𝗉f(𝗌𝖾𝖼(x))\scriptstyle{\mathsf{ap}_{f}(\mathsf{sec}(x))}r(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x)))\scriptstyle{r(\mathsf{succ}(\mathsf{pred}_{1}(x)))}𝖺𝗉g(𝗌𝖾𝖼(x))\scriptstyle{\mathsf{ap}_{g}(\mathsf{sec}(x))}𝖺𝗉𝗌𝗎𝖼𝖼(𝖺𝗉𝗉𝗋𝖾𝖽1(r(x)))\scriptstyle{\mathsf{ap}_{\mathsf{succ}}(\mathsf{ap}_{\mathsf{pred}_{1}}(r(x)))}sec(g(x))\scriptstyle{\sec(g(x))}r(x)\scriptstyle{r(x)}r(x)\scriptstyle{r(x)}sec(f(x))\scriptstyle{\sec(f(x))}

Figure 1. Cube needed for lemma 2.6

The type \mathbb{N} of natural numbers is usually defined as the inductive type generated by an inhabitant 0:0:\mathbb{N} and an endomap 𝗌𝗎𝖼𝖼:\mathsf{succ}:\mathbb{N}\to\mathbb{N}. In this section, we define the integers b\mathbb{Z}_{b} in a similar way. The idea is to give constructors that guarantee that we have 0:b0:\mathbb{Z}_{b}, 𝗌𝗎𝖼𝖼:bb\mathsf{succ}:\mathbb{Z}_{b}\to\mathbb{Z}_{b}, and that 𝗌𝗎𝖼𝖼\mathsf{succ} is an equivalence using bi-invertible maps, see Definition 1.3. To make it easy to work with this definition, we prove three theorems that let us: map out of b\mathbb{Z}_{b} (Proposition 2.1), prove properties about b\mathbb{Z}_{b} (Proposition 2.2), and recognise when two maps out of b\mathbb{Z}_{b} are equal (Theorem 2.4).

The result about mapping out of b\mathbb{Z}_{b} is very simple, and follows immediately from the recursion principle of b\mathbb{Z}_{b}.

Proposition 2.1 (rec\mathbb{Z}simp).

Given a type TT with an inhabitant t:Tt:T and two maps f:TTf:T\to T, g:TTg:T\to T, such that gg is a left and right inverse of ff, we get a map r:bTr:\mathbb{Z}_{b}\to T such that r(0)tr(0)\equiv t and r(𝗌𝗎𝖼𝖼(z))f(r(z))r(\mathsf{succ}(z))\equiv f(r(z)), definitionally.

The next result is only slightly more involved.

Proposition 2.2 (ind\mathbb{Z}simp).

Given a type family P:b𝒰P:\mathbb{Z}_{b}\to\mathcal{U} such that (z:b)𝗂𝗌𝖯𝗋𝗈𝗉(P(z))(z:\mathbb{Z}_{b})\to\mathsf{isProp}(P(z)), if we have P(0)P(0), (z:b)P(z)P(𝗌𝗎𝖼𝖼(z))(z:\mathbb{Z}_{b})\to P(z)\to P(\mathsf{succ}(z)), and (z:b)P(z)P(𝗉𝗋𝖾𝖽1(z))(z:\mathbb{Z}_{b})\to P(z)\to P(\mathsf{pred}_{1}(z)), then it follows that (z:b)P(z)(z:\mathbb{Z}_{b})\to P(z).

Proof.

We use the induction principle of b\mathbb{Z}_{b}. The main idea is that we do not have to check any coherences, since we are proving a proposition. Concretely, this means that we only have to provide inhabitants for the following types: P(0)P(0), (z:b)P(z)P(𝗌𝗎𝖼𝖼(z))(z:\mathbb{Z}_{b})\to P(z)\to P(\mathsf{succ}(z)), (z:b)P(z)P(𝗉𝗋𝖾𝖽1(z))(z:\mathbb{Z}_{b})\to P(z)\to P(\mathsf{pred}_{1}(z)), and (z:b)P(z)P(𝗉𝗋𝖾𝖽2(z))(z:\mathbb{Z}_{b})\to P(z)\to P(\mathsf{pred}_{2}(z)). For the first three we just use the assumptions. For the fourth one, we make use of the fact that, for every z:bz:\mathbb{Z}_{b}, there is an equality 𝗉𝗋𝖾𝖽1(z)=𝗉𝗋𝖾𝖽2(z)\mathsf{pred}_{1}(z)=\mathsf{pred}_{2}(z). This is because 𝗉𝗋𝖾𝖽2(z)=𝗉𝗋𝖾𝖽1(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽2(z)))=𝗉𝗋𝖾𝖽1(z)\mathsf{pred}_{2}(z)=\mathsf{pred}_{1}(\mathsf{succ}(\mathsf{pred}_{2}(z)))=\mathsf{pred}_{1}(z) using 𝗌𝖾𝖼\mathsf{sec} and then 𝗋𝖾𝗍\mathsf{ret}. ∎

The result that allows us to compare maps out of b\mathbb{Z}_{b} is considerably more complicated to prove. In order to explain its proof, we need to talk about bi-invertible maps.

Definition 2.3.

A map between types f:ABf:A\to B is a bi-invertible map if there exist g,h:BAg,h:B\to A, and homotopies s:gf=𝗂𝖽As:g\circ f=\mathsf{id}_{A} and r:fh=𝗂𝖽Br:f\circ h=\mathsf{id}_{B}.

The type of bi-invertible structures on such a map ff is denoted by 𝗂𝗌𝖡𝗂𝖨𝗇𝗏(f)\mathsf{isBiInv}(f). The type (f:AB)×𝗂𝗌𝖡𝗂𝖨𝗇𝗏(f)(f:A\to B)\times\mathsf{isBiInv}(f) is denoted by AbBA\simeq_{b}B.

Whenever we have f:AbBf:A\simeq_{b}B, we will abuse notation, and write f:ABf:A\to B for the underlying function of the bi-invertible map ff.

Notice that the constructors 𝗌𝗎𝖼𝖼\mathsf{succ}, 𝗉𝗋𝖾𝖽1\mathsf{pred}_{1}, 𝗉𝗋𝖾𝖽2\mathsf{pred}_{2}, 𝗌𝖾𝖼\mathsf{sec}, and 𝗋𝖾𝗍\mathsf{ret} form a bi-invertible map. Suppose given a type TT with an inhabitant t:Tt:T and a bi-invertible map s:TbTs:T\simeq_{b}T. The recursion principle of b\mathbb{Z}_{b} gives us 𝗋𝖾𝖼b(T,t,s):bT\mathsf{rec}_{\mathbb{Z}_{b}}(T,t,s):\mathbb{Z}_{b}\to T. Now, assume given another map f:bTf:\mathbb{Z}_{b}\to T. What do we have to check to be able to conclude that f=𝗋𝖾𝖼b(T,t,s)f=\mathsf{rec}_{\mathbb{Z}_{b}}(T,t,s)?

The following theorem gives a simple answer to the question and is the main focus of this section.

Theorem 2.4 (uniqueness\mathbb{Z}).

Given a type TT, an inhabitant t:Tt:T, a bi-invertible map s:TbTs:T\simeq_{b}T, and a map f:bTf:\mathbb{Z}_{b}\to T, if f(0)=tf(0)=t and sf=f𝗌𝗎𝖼𝖼s\circ f=f\circ\mathsf{succ} then f=𝗋𝖾𝖼b(T,t,s)f=\mathsf{rec}_{\mathbb{Z}_{b}}(T,t,s).

In order to prove Theorem 2.4 we must study the preservation of bi-invertible maps, which we introduce next.

Fix types A,B,A,B:𝒰A,B,A^{\prime},B^{\prime}:\mathcal{U}, bi-invertible maps e:AbBe:A\simeq_{b}B and e:AbBe^{\prime}:A^{\prime}\simeq_{b}B^{\prime}, and maps α:AA\alpha:A\to A^{\prime} and β:BB\beta:B\to B^{\prime}:

A{A}B{B}A{A^{\prime}}B.{B^{\prime}.}eeα\alphaee^{\prime}β\beta

We now define what it means for α\alpha and β\beta to respect ee and ee^{\prime}. By a slight abuse of notation, let the bi-invertible maps ee and ee^{\prime} be given by (e,g,h,s,r)(e,g,h,s,r) and (e,g,h,s,r)(e^{\prime},g^{\prime},h^{\prime},s^{\prime},r^{\prime}).

Definition 2.5.

We define the type 𝗉𝗋𝖡𝗂𝖨𝗇𝗏(e,e,α,β)\mathsf{prBiInv}(e,e^{\prime},\alpha,\beta) as the iterated Σ\Sigma-type with the following fields:

  • (preservation of ee) pe:eα=βep_{e}:e^{\prime}\circ\alpha=\beta\circ e;

  • (preservation of gg) pg:gβ=αgp_{g}:g^{\prime}\circ\beta=\alpha\circ g;

  • (preservation of hh) ph:hβ=αhp_{h}:h^{\prime}\circ\beta=\alpha\circ h;

  • (preservation of ss) ps:(a:A)s(α(a))=𝖺𝗉g(pea) pg(e(a)) 𝖺𝗉α(s(a))p_{s}:(a:A)\to s^{\prime}(\alpha(a))=\mathsf{ap}_{g^{\prime}}(p_{e}a)\mathbin{\vbox{\hbox{\rule{1.29167pt}{1.29167pt}}}}p_{g}(e(a))\mathbin{\vbox{\hbox{\rule{1.29167pt}{1.29167pt}}}}\mathsf{ap}_{\alpha}(s(a));

  • (preservation of rr) pr:(b:B)r(β(b))=𝖺𝗉e(phb) pe(h(b)) 𝖺𝗉β(r(a))p_{r}:(b:B)\to r^{\prime}(\beta(b))=\mathsf{ap}_{e^{\prime}}(p_{h}b)\mathbin{\vbox{\hbox{\rule{1.29167pt}{1.29167pt}}}}p_{e}(h(b))\mathbin{\vbox{\hbox{\rule{1.29167pt}{1.29167pt}}}}\mathsf{ap}_{\beta}(r(a)).

The next proposition follows from the initiality of b\mathbb{Z}_{b}, although it is a bit involved to prove formally using the constructors and the induction principle.

Proposition 2.6 (uniqueness).

Suppose given a type TT with an inhabitant t:Tt:T, a bi-invertible map s:TbTs:T\simeq_{b}T, and a map f:bTf:\mathbb{Z}_{b}\to T. If f(0)=tf(0)=t and 𝗉𝗋𝖡𝗂𝖨𝗇𝗏(𝗌𝗎𝖼𝖼,s,f,f)\mathsf{prBiInv}(\mathsf{succ},s,f,f), then f=𝗋𝖾𝖼b(T,t,s)f=\mathsf{rec}_{\mathbb{Z}_{b}}(T,t,s).

Proof.

We write gg for 𝗋𝖾𝖼b(T,t,s)\mathsf{rec}_{\mathbb{Z}_{b}}(T,t,s). By function extensionality, it is enough to construct a term r:Πx:bf(x)=g(x)r:\Pi_{x:\mathbb{Z}_{b}}f(x)=g(x). We do this using the induction principle. The case for 0 follows directly from the assumption f(0)=tf(0)=t, and r(𝗌𝗎𝖼𝖼(x))=𝖺𝗉s(g(x))r(\mathsf{succ}(x))=\mathsf{ap}_{s}(g(x)) and the corresponding equalities for 𝗉𝗋𝖾𝖽1\mathsf{pred}_{1} and 𝗉𝗋𝖾𝖽2\mathsf{pred}_{2} follow directly from the assumption that ff respect the bi-invertible maps 𝗌𝗎𝖼𝖼\mathsf{succ} and ss.

It remains to check the cases of 𝗌𝖾𝖼\mathsf{sec} and 𝗋𝖾𝗍\mathsf{ret}. Since these are symmetric, we only describe the case of 𝗌𝖾𝖼\mathsf{sec}. In this case, we have to provide a filler for the following square of equalities:

f(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x))){f(\mathsf{succ}(\mathsf{pred}_{1}(x)))}g(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x))){g(\mathsf{succ}(\mathsf{pred}_{1}(x)))}f(x){f(x)}g(x).{g(x).}𝖺𝗉f(𝗌𝖾𝖼(x))\scriptstyle{\mathsf{ap}_{f}(\mathsf{sec}(x))}r(𝗌𝗎𝖼𝖼(𝗉𝗋𝖾𝖽1(x)))\scriptstyle{r(\mathsf{succ}(\mathsf{pred}_{1}(x)))}𝖺𝗉g(𝗌𝖾𝖼(x))\scriptstyle{\mathsf{ap}_{g}(\mathsf{sec}(x))}r(x)\scriptstyle{r(x)}

This filler can be obtained by filling the cube in figure 1, as follows. All the sides apart from the square in question can be filled using the fact that ff preserves the bi-invertible maps, and simple path algebra, so we can conclude the proof using the Kan filling property of cubes: any open box can be filled. ∎

Given a type A:𝒰A:\mathcal{U}, let 𝗂𝖽A:AA\mathsf{id}_{A}:A\to A be the identity function. We have 𝗂𝖽𝖻A:𝗂𝗌𝖡𝗂𝖨𝗇𝗏(𝗂𝖽A)\mathsf{idb}_{A}:\mathsf{isBiInv}(\mathsf{id}_{A}), so we can define a map 𝗍𝗈𝖡𝗂𝖨𝗇𝗏:A=BAbB\mathsf{toBiInv}:A=B\to A\simeq_{b}B by path induction, sending 𝗋𝖾𝖿𝗅:A=A\mathsf{refl}:A=A to 𝗂𝖽𝖻A\mathsf{idb}_{A}. By [Uni13, Corollary 4.3.3] and the univalence axiom, the map 𝗍𝗈𝖡𝗂𝖨𝗇𝗏\mathsf{toBiInv} is an equivalence. Let 𝗍𝗈𝖤𝗊:AbBA=B\mathsf{toEq}:A\simeq_{b}B\to A=B be its inverse.

From this we can derive the principle of (based) equivalence induction, which we now state.

Lemma 2.7 (BiInduction).

Fix a type A:𝒰A:\mathcal{U} and a type family P:(B:𝒰)AbB𝒰P:(B:\mathcal{U})\to A\simeq_{b}B\to\mathcal{U}. If we have P0:P(A,𝗂𝖽A,𝗂𝖽𝖻A)P_{0}:P(A,\mathsf{id}_{A},\mathsf{idb}_{A}), then we have (B:𝒰)(e:AbB)P(B,e)(B:\mathcal{U})\to(e:A\simeq_{b}B)\to P(B,e).

Proof.

This is proven by path induction, after translating bi-invertible maps to equalities, using 𝗍𝗈𝖤𝗊\mathsf{toEq} and 𝗍𝗈𝖡𝗂𝖨𝗇𝗏\mathsf{toBiInv}. ∎

Using equivalence induction, and singleton elimination, one can finally prove that a map between types together with bi-invertible maps that respects the maps, automatically respects the bi-invertible structure.

Lemma 2.8.

The type 𝗉𝗋𝖡𝗂𝖨𝗇𝗏(e,e,α,β)\mathsf{prBiInv}(e,e^{\prime},\alpha,\beta) is equivalent to the type eα=βee^{\prime}\circ\alpha=\beta\circ e.

Proof.

We use equivalence induction (Lemma 2.7) for ee and ee^{\prime} and then observe that the type

𝗉𝗋𝖡𝗂𝖨𝗇𝗏((𝗂𝖽,𝗂𝖽𝖻),(𝗂𝖽,𝗂𝖽𝖻),α,β)\mathsf{prBiInv}((\mathsf{id},\mathsf{idb}),(\mathsf{id},\mathsf{idb}),\alpha,\beta)

is equivalent to the type of equalities α=β\alpha=\beta. ∎

Proof of Theorem 2.4.

The theorem is a corollary of Proposition 2.6 and Lemma 2.8. ∎

One should notice that Lemma 2.8 can be proven directly, avoiding the usage of the univalence axiom (which was used to prove that 𝗍𝗈𝖡𝗂𝖨𝗇𝗏\mathsf{toBiInv} is an equivalence). The reason why we don’t do this, is because the path algebra involved in proving Lemma 2.8 directly is non-trivial.

3. \mathbb{Z} is a set

In this section we relate b\mathbb{Z}_{b} with the usual definition of the integers as signed natural numbers, which we call w\mathbb{Z}_{w}. We show that bw\mathbb{Z}_{b}\simeq\mathbb{Z}_{w}, and since we already know that w\mathbb{Z}_{w} is a set, we deduce that b\mathbb{Z}_{b} is a set too.

Definition 3.1.

Let w\mathbb{Z}_{w} be the inductive type with the following constructors:

  • 0:w0:\mathbb{Z}_{w}

  • 𝗌𝗍𝗋𝗉𝗈𝗌:w\mathsf{strpos}:\mathbb{N}\to\mathbb{Z}_{w}

  • 𝗌𝗍𝗋𝗇𝖾𝗀:w\mathsf{strneg}:\mathbb{N}\to\mathbb{Z}_{w}

Theorem 3.2 (\mathbb{Z}is\mathbb{Z}).

We have an equivalence bw\mathbb{Z}_{b}\simeq\mathbb{Z}_{w}.

Proof.

On the one hand, one can define 𝗌𝗎𝖼𝖼w:ww\mathsf{succ}_{w}:\mathbb{Z}_{w}\to\mathbb{Z}_{w} by induction, by mapping:

  • 0𝗌𝗍𝗋𝗉𝗈𝗌(0)0\mapsto\mathsf{strpos}(0);

  • 𝗌𝗍𝗋𝗉𝗈𝗌(n)𝗌𝗍𝗋𝗉𝗈𝗌(𝗌𝗎𝖼𝖼(n))\mathsf{strpos}(n)\mapsto\mathsf{strpos}(\mathsf{succ}(n));

  • 𝗌𝗍𝗋𝗇𝖾𝗀(0)0\mathsf{strneg}(0)\mapsto 0;

  • 𝗌𝗍𝗋𝗇𝖾𝗀(𝗌𝗎𝖼𝖼(n))𝗌𝗍𝗋𝗇𝖾𝗀(n)\mathsf{strneg}(\mathsf{succ}(n))\mapsto\mathsf{strneg}(n).

Similarly one defines 𝗉𝗋𝖾𝖽w\mathsf{pred}_{w}. The fact that 𝗉𝗋𝖾𝖽w\mathsf{pred}_{w} provides a left and right inverse for 𝗌𝗎𝖼𝖼w\mathsf{succ}_{w} is straightforward. So, by Proposition 2.1 we get a map 𝗇𝖿:bw\mathsf{nf}:\mathbb{Z}_{b}\to\mathbb{Z}_{w}. On the other hand, it is easy to construct a map i:wbi:\mathbb{Z}_{w}\to\mathbb{Z}_{b} by induction.

Induction on w\mathbb{Z}_{w} shows that 𝗇𝖿i=𝗂𝖽w\mathsf{nf}\circ i=\mathsf{id}_{\mathbb{Z}_{w}}. The hard part is to show that i𝗇𝖿=𝗂𝖽bi\circ\mathsf{nf}=\mathsf{id}_{\mathbb{Z}_{b}}. This is where Theorem 2.4 comes in handy. Theorem 2.4 implies that it is enough to check that (i𝗇𝖿)(0)=0(i\circ\mathsf{nf})(0)=0 and that 𝗌𝗎𝖼𝖼(i𝗇𝖿)=(i𝗇𝖿)𝗌𝗎𝖼𝖼\mathsf{succ}\circ(i\circ\mathsf{nf})=(i\circ\mathsf{nf})\circ\mathsf{succ}, and this follows directly by construction. ∎

4. Representing \mathbb{Z} using a universe

In this section we give another definition of the integers, denoted by U\mathbb{Z}_{U}, which allows one to easily prove that they are the initial type together with an inhabitant and an equality from the type to itself.

To make sense of initiality, we first define the type of \mathbb{Z}-algebras and of \mathbb{Z}-algebra morphisms.

Definition 4.1.

A \mathbb{Z}-algebra is a type T:𝒰T:\mathcal{U} together with an inhabitant t:Tt:T, and an equality e:T=Te:T=T. We denote such a \mathbb{Z}-algebra as (T,t,e)(T,t,e), or TT if the rest of the structure can be inferred from the context.

Definition 4.2.

A morphism of \mathbb{Z}-algebras from (T,t,e)(T,t,e) to (T,t,e)(T^{\prime},t^{\prime},e^{\prime}) is given by a map f:TTf:T\to T^{\prime}, together with an equality f(t)=tf(t)=t^{\prime}, and a proof that e(f)=e(f)e_{*}(f)=e^{\prime}_{*}(f). We denote the type of morphisms of \mathbb{Z}-algebras between TT and TT^{\prime} by TTT\to_{\mathbb{Z}}T^{\prime}.

We are interested in initial \mathbb{Z}-algebras.

Definition 4.3.

A initial \mathbb{Z}-algebra is a \mathbb{Z}-algebra (T,t,e)(T,t,e) such that for any other \mathbb{Z}-algebra (T,t,e)(T^{\prime},t^{\prime},e^{\prime}) the type TTT\to_{\mathbb{Z}}T^{\prime} is contractible.

See Definition 1.4 for the definition of the initial \mathbb{Z}-algebra using a mini universe222This is inspired by Zongpu Xie’s proposal how to represent HIITs in Agda [Kap19].. Then define an interpretation function 𝖤𝗅:U𝒰\mathsf{El}:U\to\mathcal{U}, as the higher inductive family with only one constructor 0:𝖤𝗅(z)0:\mathsf{El}(z). Define the type U:𝖤𝗅(z)\mathbb{Z}_{U}\vcentcolon\equiv\mathsf{El}(z). The type U\mathbb{Z}_{U} has the structure of a \mathbb{Z}-algebra, since we have 0:U0:\mathbb{Z}_{U} and s:𝖺𝗉𝖤𝗅(q):U=Us\vcentcolon\equiv\mathsf{ap}_{\mathsf{El}}(q):\mathbb{Z}_{U}=\mathbb{Z}_{U}. The following result follows by a routine application of the induction principle of U\mathbb{Z}_{U}.

Theorem 4.4 (\mathbb{Z}isInitial).

The \mathbb{Z}-algebra U\mathbb{Z}_{U} is initial.∎

In particular, we have.

Proposition 4.5.

Given a type TT with an inhabitant t:Tt:T and an equality e:T=Te:T=T, we get a morphism of \mathbb{Z}-algebras UT\mathbb{Z}_{U}\to T.∎

Again, comparing maps out of U\mathbb{Z}_{U} is easy, thanks to the following theorem.

Theorem 4.6.

Given a type TT, an inhabitant t:Tt:T, an equality e:T=Te:T=T, and a map f:UTf:\mathbb{Z}_{U}\to T, if f(0)=tf(0)=t and ef=fse_{*}\circ f=f\circ s_{*} then f=𝗋𝖾𝖼U(T,t,e)f=\mathsf{rec}_{\mathbb{Z}_{U}}(T,t,e).∎

Analogously to the case of b\mathbb{Z}_{b}, this is proven by combining the initiality of U\mathbb{Z}_{U} with the fact that to preserve an equality in the universe e:T=Te:T=T, it is enough to commute with its corresponding coercion function e:TTe_{*}:T\to T.

Following the argument given in Section 3, one deduces the following.

Theorem 4.7.

There is an equivalence Uw\mathbb{Z}_{U}\simeq\mathbb{Z}_{w}.∎

We omit the proof since it is basically the same as the construction presented in [RLS13] when proving that the integers are the loop space of the circle.

Indeed, the mini universe UU is nothing but the higher inductive type presentation of the circle S1S^{1} of [Uni13, Section 6.1], so that (z=z)ΩS1(z=z)\equiv\Omega S^{1}. Moreover, the type family 𝖤𝗅\mathsf{El} is equivalent to the path space fibration of the circle, in the following sense.

Theorem 4.8 (ElisPath).

For every u:Uu:U we have 𝖾𝖽(u):𝖤𝗅(u)(z=u)\mathsf{ed}(u):\mathsf{El}(u)\simeq(z=u).

Proof.

We construct a map 𝖾𝖽(u):𝖤𝗅(u)(z=u)\mathsf{ed}(u):\mathsf{El}(u)\to(z=u) using induction on UU and mapping 0:𝖤𝗅(z)0:\mathsf{El}(z) to 𝗋𝖾𝖿𝗅z\mathsf{refl}_{z}, To construct a map going the other way, we use path induction and map 𝗋𝖾𝖿𝗅z\mathsf{refl}_{z} to 0. It is then straightforward to see that these maps give an equivalence as in the statement. ∎

As a corollary, we obtain the well-known equivalence between the loop space of the circle and the integers.

Corollary 4.9.

We have an equivalence ΩS1w\Omega S^{1}\simeq\mathbb{Z}_{w}.∎

This suggests that alternatively one could view the representation of the integers as a universe as an inductive-inductive presentation of the circle equipped with a family that has a point in the fiber over the base point.

5. Formalization in cubical Agda

We formally checked the results of this paper [AS19] using cubical Agda [AMV19]. There are two differences between the informal presentation in the paper and the formalisation. The first one is that the presentation in the paper is done using book-HoTT [Uni13], whereas the formalisation is done using a cubical type theory. In this case, this difference is not important, since it is easy to translate the formalized arguments to book-HoTT.

The real difference is in the definition of higher inductive types. In the paper we define higher inductive types as initial algebras for a certain signature (Section 1.3). In the formalisation, we use higher inductive types as implemented in cubical Agda, which are based on [CHM18]. Although it is natural to assume that the Agda higher inductive type should be initial in the sense of Section 1.3, proving this fact is actually one of the main difficulties in the formalisation (Proposition 2.6).

In proving the results of Section 2, we developed the theory of bi-invertible maps in cubical Agda, which wasn’t available. We prove that the type of bi-invertible maps between AA and BB is equivalent to the type of equivalences between AA and BB, and the principle of bi-invertible induction.

6. Open questions

Preservation of properties

The key result in the above discussion is Lemma 2.8, which can be reformulated as follows. Let T,T:𝒰T,T^{\prime}:\mathcal{U}, s:TTs:T\to T, s:TTs^{\prime}:T^{\prime}\to T^{\prime}, ϕ:𝗂𝗌𝖡𝗂𝖨𝗇𝗏(s)\phi:\mathsf{isBiInv}(s), and ϕ:𝗂𝗌𝖡𝗂𝖨𝗇𝗏(s)\phi^{\prime}:\mathsf{isBiInv}(s^{\prime}). We can define the following two types of morphisms between TT and TT^{\prime}:

𝖬𝖺𝗉𝖾𝗇𝖽(T,T)\displaystyle\mathsf{Map}_{\mathsf{end}}(T,T^{\prime}) :(f:TT)×(sf=fs)\displaystyle\vcentcolon\equiv(f:T\to T^{\prime})\times(s^{\prime}\circ f=f\circ s)
𝖬𝖺𝗉𝖻𝗂𝖨𝗇𝗏(T,T)\displaystyle\mathsf{Map}_{\mathsf{biInv}}(T,T^{\prime}) :(f:TT)×𝗉𝗋𝖡𝗂𝖨𝗇𝗏(s,s,f,f).\displaystyle\vcentcolon\equiv(f:T\to T^{\prime})\times\mathsf{prBiInv}(s,s^{\prime},f,f).

Informally, 𝖬𝖺𝗉𝖾𝗇𝖽(T,T)\mathsf{Map}_{\mathsf{end}}(T,T^{\prime}) is the type of maps that respect the endomorphism, and 𝖬𝖺𝗉𝖻𝗂𝖨𝗇𝗏(T,T)\mathsf{Map}_{\mathsf{biInv}}(T,T^{\prime}) is the type of maps that respect the endomorphism and the proof that the endomorphism is a bi-invertible map.

We have a forgetful map 𝖬𝖺𝗉𝖻𝗂𝖨𝗇𝗏(T,T)𝖬𝖺𝗉𝖾𝗇𝖽(T,T)\mathsf{Map}_{\mathsf{biInv}}(T,T^{\prime})\to\mathsf{Map}_{\mathsf{end}}(T,T^{\prime}), and what Lemma 2.8 says is that this map is an equivalence.

There is something special about the type family 𝗂𝗌𝖡𝗂𝖨𝗇𝗏:(AB)𝒰\mathsf{isBiInv}:(A\to B)\to\mathcal{U}, and that is that it is valued in propositions. One might wonder if Lemma 2.8 is a general principle, in the following sense. Say that we have a signature SS for a type of algebras, and we extend it to a signature SS^{\prime}, such that the fields we added take values in propositions. In the above example SS corresponds to (T:𝒰)(f:TT)(T:\mathcal{U})(f:T\to T) and SS^{\prime} corresponds to the extension (T:𝒰)(f:TT)(ϕ:𝗂𝗌𝖡𝗂𝖨𝗇𝗏(s))(T:\mathcal{U})(f:T\to T)(\phi:\mathsf{isBiInv}(s)). As usual, given SS^{\prime}-algebras T,TT,T^{\prime}, we have a forgetful map 𝖬𝖺𝗉S(T,T)𝖬𝖺𝗉S(T,T)\mathsf{Map}_{S^{\prime}}(T,T^{\prime})\to\mathsf{Map}_{S}(T,T^{\prime}). Is this map an equivalence in general?

The following example, suggested by Paolo Capriotti, shows that this is not necessarily the case.

Example 6.1.

Consider SS, the signature (T:𝒰)(o:TTT)(T:\mathcal{U})(o:T\to T\to T), and SS^{\prime}, the extension

(T:𝒰)(o:TTT)(tr:𝗂𝗌𝖲𝖾𝗍(T))\displaystyle(T:\mathcal{U})(o:T\to T\to T)(tr:\mathsf{isSet}(T))
(e:T)(u:(t:T)o(t,e)=t×o(e,t)=t).\displaystyle(e:T)\left(u:(t:T)\to o(t,e)=t\times o(e,t)=t\right).

The SS-algebras are the types with a binary operation, and the SS^{\prime}-algebras are the sets with a binary operation with a distinguished element that is a left and right unit.

The extension SS^{\prime} is propositional. This is because being a set is a proposition ([Uni13, Theorem 7.1.10]), so trtr inhabits a proposition, two left and right units must necessarily coincide, so ee inhabits a proposition (assuming uu), and the identity types of a set are propositions and these are closed under pi-types ([Uni13, Theorem 7.1.9]), so uu inhabits a proposition (assuming trtr).

Let us see that for SS^{\prime}-algebras T,TT,T^{\prime} the forgetful map 𝖬𝖺𝗉S(T,T)𝖬𝖺𝗉S(T,T)\mathsf{Map}_{S^{\prime}}(T,T^{\prime})\to\mathsf{Map}_{S}(T,T^{\prime}) is not an equivalence in general. Let TT be (,+,ϕ,0,ψ)(\mathbb{N},+,\phi,0,\psi), where ϕ\phi is a proof that the natural numbers form a set, and ψ\psi is a proof that 0 is a left and right unit for ++. Let TT^{\prime} be (𝖻𝗈𝗈𝗅,,ϕ,,ψ)(\mathsf{bool},\vee,\phi^{\prime},\bot,\psi^{\prime}), where ϕ\phi^{\prime} is a proof that the booleans form a set, and ϕ\phi is a proof that \bot is a left and right unit for \vee. Then we have λn.:𝖻𝗈𝗈𝗅\lambda n.\top:\mathbb{N}\to\mathsf{bool}. This map clearly respects the operations, so we get an inhabitant of 𝖬𝖺𝗉S(T,T)\mathsf{Map}_{S}(T,T^{\prime}). But this morphism does not respect the units, so it cannot come from a morphism in 𝖬𝖺𝗉S(T,T)\mathsf{Map}_{S^{\prime}}(T,T^{\prime}).

This discussion leaves open an interesting question.

Question 6.2.

Given a signature SS and a propositional extension SS^{\prime}, are there useful necessary and sufficient conditions for the forgetful map 𝖬𝖺𝗉S(T,T)𝖬𝖺𝗉S(T,T)\mathsf{Map}_{S^{\prime}}(T,T^{\prime})\to\mathsf{Map}_{S}(T,T^{\prime}) to be an equivalence for every pair of SS^{\prime}-algebras TT and TT^{\prime}?

Initiality of HIITs

Our original goal was to complete the conjectured result from [AP18] and formally verify that h\mathbb{Z}_{h} is a set. Using the strategy from this paper this is fairly straightforward: we can show that the natural notion of morphism of h\mathbb{Z}_{h}-algebras satisfies a principle analogous to Lemma 2.8, and hence that h\mathbb{Z}_{h} is a set. When attempting to formalize this construction we hit an unexpected problem: it turns out that it is rather difficult to verify that the higher inductive type defining h\mathbb{Z}_{h} is initial in its corresponding wild category of algebras. Specifically, the proof seems to require the construction of a filler for a 44-dimensional cube which is rather laborious. In [KKA19] it is shown that for QIITs (i.e., set-truncated HIITs) elimination and initiality are equivalent, but the extension to higher dimensional HIITs seems non-trivial. In particular it may require developing the higher order categorical structure of the category of algebras.

Acknowledgements

The first author would like to thank Paolo Capriotti, Nicolai Kraus and Gun Pinyo for many interesting discussions on the subject of this paper. Both authors would like to thank Christian Sattler for comments and useful discussions. The work by and with Ambrus Kaposi and András Kovács plays an important role in particular in connection with the open questions triggered by this paper.

References

  • [AK16] Thorsten Altenkirch and Ambrus Kaposi. Type theory in type theory using quotient inductive types. SIGPLAN Not., 51(1):18–29, January 2016.
  • [AMV19] Andreas Abel, Anders Mörtberg, and Andrea Vezzosi. Cubical agda: A dependently typed programming language with univalence and higher inductive types. To appear in ICFP, 2019.
  • [AP18] Thorsten Altenkirch and Gun Pinyo. Integers as a higher inductive type. TYPES, 2018.
  • [AS19] Thorsten Altenkirch and Luis Scoccola. Implementation of the integers as a higher inductive type. https://github.com/LuisScoccola/integers-as-HITs, 2019.
  • [BGvdW17] Henning Basold, Herman Geuvers, and Niels van der Weide. Higher inductive types in programming. J. UCS, 23:63–88, 2017.
  • [Cav18] Evan Cavallo. biinv-int. https://github.com/RedPRL/redtt/blob/master/library/cool/biinv-int.red, 2018.
  • [CCHM18] Cyril Cohen, Thierry Coquand, Simon Huber, and Anders Mörtberg. Cubical Type Theory: A Constructive Interpretation of the Univalence Axiom. In Tarmo Uustalu, editor, 21st International Conference on Types for Proofs and Programs (TYPES 2015), volume 69 of Leibniz International Proceedings in Informatics (LIPIcs), pages 5:1–5:34, Dagstuhl, Germany, 2018. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.
  • [CHM18] Thierry Coquand, Simon Huber, and Anders Mörtberg. On higher inductive types in cubical type theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’18, pages 255–264, New York, NY, USA, 2018. ACM.
  • [KA18] Nicolai Kraus and Thorsten Altenkirch. Free higher groups in homotopy type theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, pages 599–608, 2018.
  • [Kap19] Ambrus Kaposi. Separate definition of constructors? Agda mailing ist, May 2019.
  • [KK19] Ambrus Kaposi and András Kovács. Signatures and induction principles for higher inductive-inductive types. CoRR, abs/1902.00297, 2019.
  • [KKA19] Ambrus Kaposi, András Kovács, and Thorsten Altenkirch. Constructing quotient inductive-inductive types. PACMPL, 3(POPL):2:1–2:24, 2019.
  • [Kv19] Nicolai Kraus and Jacob von Raumer. Path spaces of higher inductive types in homotopy type theory. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1–13, 2019.
  • [LB15] D. R. Licata and G. Brunerie. A cubical approach to synthetic homotopy theory. In 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science, pages 92–103, 2015.
  • [Li15] Nuo Li. Quotient types in type theory. PhD thesis, University of Nottingham, 2015.
  • [red19] Redtt. https://github.com/RedPRL/redtt, 2019.
  • [RLS13] Daniel R. Licata and Michael Shulman. Calculating the fundamental group of the circle in homotopy type theory. pages 223–232, 06 2013.
  • [Uni13] The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics. Institute for Advanced Study, Princeton, NJ, 2013.