Hostname: page-component-cb9f654ff-lqqdg Total loading time: 0 Render date: 2025-08-25T15:22:04.292Z Has data issue: false hasContentIssue false

Computational synthetic cohomology theory in homotopy type theory

Published online by Cambridge University Press:  10 July 2025

Axel Ljungström*
Affiliation:
Department of Mathematics, Stockholm University, Stockholm, Sweden
Anders Mörtberg
Affiliation:
Department of Mathematics, Stockholm University, Stockholm, Sweden
*
Corresponding author: Axel Ljungström; Email: axel.ljungstrom@hotmail.com
Rights & Permissions [Opens in a new window]

Abstract

This paper discusses the development of synthetic cohomology in Homotopy Type Theory (HoTT), as well as its computer formalisation. The objectives of this paper are (1) to generalise previous work on integral cohomology in HoTT by the current authors and Brunerie (2022) to cohomology with arbitrary coefficients and (2) to provide the mathematical details of, as well as extend, results underpinning the computer formalisation of cohomology rings by the current authors and Lamiaux (2023). With respect to objective (1), we provide new direct definitions of the cohomology group operations and of the cup product, which, just as in the previous work by the current authors and Brunerie (2022), enable significant simplifications of many earlier proofs in synthetic cohomology theory. In particular, the new definition of the cup product allows us to give the first complete formalisation of the axioms needed to turn the cohomology groups into a graded commutative ring. We also establish that this cohomology theory satisfies the HoTT formulation of the Eilenberg–Steenrod axioms for cohomology and study the classical Mayer–Vietoris and Gysin sequences. With respect to objective (2), we characterise the cohomology groups and rings of various spaces, including the spheres, torus, Klein bottle, real/complex projective planes, and infinite real projective space. All results have been formalised in Cubical Agda, and we obtain multiple new numbers, similar to the famous ‘Brunerie number’, which can be used as benchmarks for computational implementations of HoTT. Some of these numbers are infeasible to compute in Cubical Agda and hence provide new computational challenges and open problems which are much easier to define than the original Brunerie number.

Information

Type
Special Issue: Advances in Homotopy type theory
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press

1. Introduction

A fundamental idea in algebraic topology is that spaces can be analysed in terms of homotopy invariants – functorial assignments of algebraic objects to spaces. The close correspondence between types and spaces in Homotopy Type Theory and Univalent Foundations (HoTT/UF) allows these concepts to be developed synthetically using type theory. This was explored in the HoTT Book (The Univalent Foundations Program, 2013), written during the IAS special year on HoTT/UF in 2012–2013, and has since led to the formalisation of many results from homotopy theory in HoTT/UF. Using these results, homotopy groups of many spaces – represented as types – have been characterised. However, just like in classical algebraic topology, these groups tend to be complicated to compute. Because of this, other topological invariants that are easier to compute, like cohomology, have also been developed synthetically in HoTT/UF.

Intuitively, the cohomology groups $H^n(X,G)$ of a space $X$ , relative to an abelian group $G$ , characterise the connected components of $X$ as well as its $(n+1)$ -dimensional holes. Figure 1 depicts the circle, $\mathbb{S}^1$ , and two circles which have been glued together in a point – that is, it is the wedge sum $\mathbb{S}^1 \vee \mathbb{S}^1$ . The fact that these spaces have a different number of holes is captured, using for instance singular cohomology, by the existence of isomorphisms $H^1(\mathbb{S}^1,G) \cong G$ and $H^1(\mathbb{S}^1 \vee \mathbb{S}^1,G) \cong G \times G$ , which geometrically means that they have one, respectively two, $2$ -dimensional holes (i.e., empty interiors). As cohomology groups are homotopy invariants, this then means that the spaces cannot be continuously deformed into each other.

Figure 1. $\mathbb{S}^1$ and $\mathbb{S}^1 \vee \mathbb{S}^1$ .

The usual formulation of singular cohomology using cochain complexes relies on taking the underlying set of topological spaces when defining the singular cochains (Hatcher, Reference Hatcher2002). This operation is not invariant under homotopy equivalence, which makes it impossible to use when formalising cohomology synthetically. For the construction of cohomology in HoTT/UF, we instead rely on Brown representability (Brown, Reference Brown1962) and define cohomology groups as homotopy classes of maps into Eilenberg–MacLane spaces (as defined in HoTT by Licata and Finster Reference Licata and Finster2014). This approach to synthetic cohomology theory was initially studied at the IAS special year (Shulman, Reference Shulman2013) and is classically provably equivalent to the singular cohomology of the spaces we consider in this paper. It has since been expanded with many classical results, for example the Eilenberg–Steenrod axioms for cohomology (Cavallo, Reference Cavallo2015), cellular cohomology (Buchholtz and Hou (Favonia), Reference Buchholtz and Hau (Favonia)2018), the Atiyah–Hirzebruch, and Serre spectral sequences (van Doorn, Reference van Doorn2018), and it plays a key role in the synthetic proof that $\pi _4(\mathbb{S}^3) \cong \mathbb{Z}/2\mathbb{Z}$ by Brunerie (Reference Brunerie2016).

This paper develops the theory of synthetic cohomology from a computational perspective with the aim of characterising cohomology groups and rings of various spaces. This is achieved by extending earlier work by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) where integral cohomology $H^n(X,\mathbb{Z})$ was developed in Cubical Agda. Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) also computed $\mathbb{Z}$ -cohomology groups of various classical spaces synthetically, including the spheres, torus, real/complex projective planes, and Klein bottle. This was aided by a new synthetic construction of the group structure on $H^n(X,\mathbb{Z})$ with better computational properties than the one already defined in HoTT by Licata and Finster (Reference Licata and Finster2014). Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) also redefined the cup product $\smile \,: H^n(X,\mathbb{Z}) \times H^m(X,\mathbb{Z}) \to H^{n+m}(X,\mathbb{Z})$ which led to substantially simplified proofs and better computational properties compared to the one originally defined synthetically by Brunerie (Reference Brunerie2016). Lamiaux et al. (Reference Lamiaux, Ljungström and Mörtberg2023) organised this into a ring $H^*(X,R)$ , for a general ring $R$ , and various such cohomology rings were computed for different spaces. The authors have also used some of these results, and extensions thereof, in a complete Cubical Agda formalisation of Brunerie’s synthetic proof that $\pi _4(\mathbb{S}^3) \simeq \mathbb{Z}/2\mathbb{Z}$ (Ljungström and Mörtberg, Reference Ljungström and Mörtberg2023). However, due to page constraints many proofs and constructions were omitted from (Brunerie et al., Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022), (Lamiaux et al., Reference Lamiaux, Ljungström and Mörtberg2023), and (Ljungström and Mörtberg, Reference Ljungström and Mörtberg2023). The aim of the current paper is to spell these details out, develop new results, and generalise various results already present in the previous papers and the general HoTT literature. Hence, our aim is to provide a more comprehensive synthetic treatment of cohomology in HoTT/UF, with a view towards effective computations. We summarise the main contents and contributions as follows.

  • We spell out the details of how to generalise the computationally well-behaved integral cohomology theory of Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) to general cohomology groups $H^n(X,G)$ . We first do this for Eilenberg–MacLane spaces in Section 3.1, which then induce the corresponding operations on cohomology in Section 4.

  • In Section 3.2, we prove that $K(G,n) \simeq \Omega K(G,n+1)$ by a direct encode-decode proof, avoiding the use of the Freudenthal suspension theorem.

  • In Sections 3.3 and 3.4, we spell out the details of how to generalise the theory of integral cohomology rings of Brunerie (Reference Brunerie2016) to general cohomology rings $H^*(X,R)$ as in (Lamiaux et al., Reference Lamiaux, Ljungström and Mörtberg2023). In particular, this involves a general form of the cup product $\smile \,: H^n(X,G_1) \times H^m(X,G_2) \to H^{n+m}(X,G_1 \otimes G_2)$ , inspired by a Book HoTT formalisation by Baumann (Reference Baumann2018).

  • To ensure that our definition of $H^n(X,G)$ is sensible, we verify that it satisfies the HoTT formulation of the Eilenberg–Steenrod axioms for cohomology in Section 4.2, which implies the existence of the Mayer–Vietoris sequence in Section 4.3, as originally shown in HoTT by Cavallo (Reference Cavallo2015).

  • We generalise the synthetic definition of the Thom isomorphism and Gysin sequence of Brunerie (Reference Brunerie2016) from $H^n(X,\mathbb{Z})$ to cohomology with arbitrary commutative ring coefficients in Section 4.4.

  • The cohomology theory is then used to compute various $H^n(X,G)$ and $H^*(X,R)$ for concrete values of $X$ , $G$ , and $R$ in Section 5. We do this for the spaces studied by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) (spheres, torus, real/complex projective planes, and Klein bottle), generalising those cohomology group computations from $\mathbb{Z}$ to arbitrary $G$ . We also provide details for how to carry out the cohomology ring computations of Lamiaux et al. (Reference Lamiaux, Ljungström and Mörtberg2023). Finally, we also have some new synthetic computations of these invariants for $\mathbb{R}P^{\infty }$ .

The present paper is carefully written so that all proofs are constructive. Furthermore, all results have been formalised in Cubical Agda (Vezzosi et al., Reference Vezzosi, Mörtberg and Abel2021) which has enabled us to do concrete computations with the operations defined in the paper. A summary file linking the paper to the formalised results can be found here: www.github.com/agda/cubical/blob/master/Cubical/Papers/ComputationalSyntheticCohomology.agda.

In order to facilitate efficient computer computations, we have been careful to give as direct constructions as possible. This allows us to define various new numbers similar to the famous ‘Brunerie number’ (Brunerie, Reference Brunerie2016), but which are much simpler and still intractable to compute in Cubical Agda. In Section 6, we collect various open computational problems and benchmark challenges for Cubical Agda and related systems in which univalence and HITs have computational content. However, while everything has been formalised in Cubical Agda, we have been careful to write the paper in the informal style of the HoTT Book. This means that the results in the paper, except for those in Section 6, can all be interpreted in suitably structured $\infty$ -topoi (Shulman, Reference Shulman2019), despite this not yet being known for results formalised in the particular cubical type theory of Cubical Agda.

While the paper is written in Book HoTT, we take some liberties and sometimes deviate from the notational conventions of the book. We detail this, as well some convenient cubical ideas that are useful also when working in Book HoTT, in Section 2.

2. Background on HoTT/UF and Notations

We assume familiarity with the contents and notations of the HoTT Book (The Univalent Foundations Program, 2013), from here on referred to as HoTT Book. In this section, we briefly recall a few key definitions and introduce some of our notational conventions.

Definition 1. (Binary $\textsf{ap}$ ). Given a binary function $f : A \to B \to C$ , we denote by $\textsf{ap}^2_f$ the function

\begin{equation*}(a_0 = a_1) \times (b_0 = b_1) \to f(a_0,b_0) = f(a_1,b_1) \end{equation*}

The following path exists Footnote 1 for each $p : a_0 = a_1$ and $q : b_0 = b_1$ :

\begin{equation*}\textsf{ap}^2_f\textsf{-funct}(p , q) : \textsf{ap}^2_f(p,q) = \textsf{ap}_{f(\!-,b_0)}(p) \cdot \textsf{ap}_{f(a_1,-)}(q)\end{equation*}

We define the (homotopy) fibre of a function $f : A \to B$ over a point $b :B$ as in [HoTT Book, Definition 4.2.4]. That is, $\textsf{fib}_{f}(b) := \Sigma _{a : A}(f\,a = b)$ . We use the contractible maps definition of equivalences in [HoTT Book, Definition 4.4.1] and say that a function $f : A \to B$ is an equivalence if, for each $b:B$ , we have that $\textsf{fib}_{f}(b)$ is contractible [HoTT Book, Definition 3.11.1]. We will simply say proposition for mere propositions [HoTT Book, Definition 3.1.1] and use set and $n$ -type (with $n \geq -2$ ) as in [HoTT Book, Section 3.1 and 7].

A pointed type [HoTT Book, Definition 2.1.7] is a pair $(A,\star _A)$ where $A$ is a type and $\star _A : A$ is a chosen basepoint of $A$ . We often omit $\star _A$ and simply write $A$ for the pointed type $(A,\star _A)$ . We always take $\star _A$ to denote the basepoint of a pointed type $A$ . Given two pointed types $A$ and $B$ , we denote by $A \to _\star B$ the type of pointed functions from $A$ to $B$ [HoTT Book, Definition 8.4.1]. That is, it is the type of pairs $(f,p)$ where $f : A \to B$ is a function and $p : f(\star _A) = \star _B$ . We often simply write $f : A \to _\star B$ and take $p$ implicit. If $f$ further is an equivalence, we write $f : A \simeq _\star B$ .

A class of pointed types particularly important for us is that of H-spaces. We borrow the definition (including notation) from (Brunerie Reference Brunerie2016, Definition 2.5.1).

Definition 2. (H-spaces). An H-space is a pointed type $A$ equipped with a multiplication $\mu : A \times A \to A$ and homotopies

\begin{align*} \mu _{\textsf{l}} &: (a : A) \to \mu (\star _A,a) = a\\ \mu _{\textsf{r}} &: (a : A) \to \mu (a,\star _A) = a\\ \mu _{\textsf{lr}} &: \mu _{\textsf{l}}(\star _A) = \mu _{\textsf{r}}(\star _A) \end{align*}

The notion of an H-space is closely related to homogeneous types.

Definition 3. (Homogeneous types). A pointed type $A$ is homogeneous if, for every $a : A$ there is a pointed equivalence $(A,\star _A) \simeq _\star (A,a)$ .

The loop space of a pointed type $A$ is defined as $\Omega (A) := (\star _A = \star _A)$ . Path composition defines an invertible H-space structure on $\Omega (A)$ . Consequently, $\Omega (A)$ is also homogeneous.

We will also rely on a few standard higher inductive types (HITs). For spheres, and many other constructions, we need suspensions. We use the standard definition from HoTT Book, Section 6.5, which we recall here:

Definition 4. (Suspensions). The suspension of a type $A$ , denoted $\Sigma A$ , is defined as a HIT with the following constructors:

  • $\textsf{north},\textsf{south} : \Sigma A$

  • $\textsf{merid} : A \to \textsf{north} = \textsf{south}$

Using this, we define the n-spheres by:

\begin{align*} \mathbb{S}^n = \begin{cases} \textsf{Bool} & \text{when } n = 0 \\ \Sigma \mathbb{S}^{n-1} & \text{otherwise} \end{cases} \end{align*}

In fact, suspensions are just a special case of (homotopy) pushouts:

Definition 5. (Homotopy pushouts). Given a span of functions $A \xleftarrow {f} C \xrightarrow {g} B$ , we define its (homotopy) pushout, denoted $A \sqcup ^C B$ , as a HIT with the following constructors:

  • $\textsf{inl} : A \to A \sqcup ^C B$

  • $\textsf{inr} : B \to A \sqcup ^C B$

  • $\textsf{push} : (c : C) \to \textsf{inl}\,{(f(c))} = \textsf{inr}\,{(g(c))}$

We will also make use of $n$ -truncations. These are defined using the ‘hub and spoke’ definition of [HoTT Book, Section 7.3] and, as usual, we denote the $n$ -truncation of a type $A$ by $\lVert A\rVert _n$ and write $\lvert \,a\,\rvert : \lVert A\rVert _n$ for its canonical elements. Following [HoTT Book, Definition 7.5.1], we say that a type $A$ is $n$ -connected if $\lVert A\rVert _n$ is contractible and a function $f : A \to B$ is said to be $n$ -connected if the fibre of $f$ over any $b : B$ is $n$ -connected.

2.1 Dependent paths and cubical thinking

While this paper is written in Book HoTT, it is still often helpful to use ideas from cubical type theory and ‘think cubically’. One reason for this is that iterated path types are conveniently represented by higher cubes. This cubical approach to Book HoTT was explored in depth by Licata and Brunerie (Reference Licata and Brunerie2015), and we will here outline some cubical ideas relevant to this paper.

We will often speak of dependent path types – in particular squares of paths. Given two paths $p : x = y$ and $q : z = w$ , we cannot ask whether $p = q$ , since this is not well-typed. We could, however, ask whether $p$ and $q$ are equal modulo composition with some other paths $r : x = z$ and $s : y = w$ . We say that we ask for a filler of the square

by which we mean a proof of the identity

\begin{equation*}\textsf{transport}^{X \mapsto X}(\textsf{ap}^{2}_{=}(r,s),p) = q\end{equation*}

(or, equivalently, $r^{-1}\cdot p \cdot s = q$ , or $\textsf{Square}\,r\,p\,q\,s$ using the notation of (Licata and Brunerie Reference Licata and Brunerie2014, Section IV.C). In cubical type theory, this would simply amount to providing a term of type $\textsf{PathP}\,(\lambda i.\,r\,i = s\,i)\,p\,q$ . We note also that the type of filler of a degenerate square

precisely coincides with the type $p = q$ .

As with regular paths, we may apply functions also to squares. For instance, given a function $f : A \to B$ and a filler $sq$ of the following square in $A$ :

we get the following filler in $B$ :

We will, with some minor abuse of notation,Footnote 2 denote this filler by $\textsf{ap}_{\textsf{ap}_f}(\textsf{sq})$

Let us give another example of manipulations of squares which will play a crucial role in Section 5. There is a map which takes a square filler and returns a filler of the same square, flipped along its diagonal:

The map is easily defined by path induction. In cubical type theory, $\textsf{flip}$ simply takes a square $I^2 \to A$ and flips the order of the arguments. This operation is homotopically non-trivial in a crucial sense. Consider the type of fillers of the square

This is precisely the path type $\textsf{refl}_x = \textsf{refl}_x$ or, in other words, $\Omega ^2(A,x)$ . Since all sides of the square are the same, $\textsf{flip}$ defines an endofunction $\Omega ^2(A,x) \to \Omega ^2(A,x)$ . One might suspect that it reduces to the identity in this degenerate setting, but this is actually not the case. Rather, we get the following:

Lemma 6. Given $p : \Omega ^2(A,x)$ , we have $\textsf{flip}(p) = p^{-1}$ .

Proof. Let $Q$ be the following filler.

Consider the following cube:

Let its bottom be filled by $Q^{-1}$ and its top be filled by $\textsf{flip}(Q)$ . All sides have their obvious fillers defined by path induction on $p$ , $q$ , $r$ and $s$ . We claim that the cube has a filler. We prove this by first applying path induction on $p$ , $r$ and $s$ , transforming $Q$ to a path $\textsf{refl}_x = q$ . Finally, after applying path induction on $Q$ we are left to fill a cube with $\textsf{refl}_{\textsf{refl}_x}$ on each side, which is trivial.

Specialising the above argument to the case when $p,q,r$ and $s$ are all $\textsf{refl}_x$ and $Q$ is arbitrary, we have our lemma.

3. Eilenberg–MacLane Spaces

In order to define representable cohomology in HoTT, we will need to define Eilenberg–MacLane spaces. These are spaces $K(G,n)$ associated with an abelianFootnote 3 group $G$ and a natural number $n$ such that $\pi _n(K(G,n)) \simeq G$ and all other homotopy groups vanish. These spaces carry the structure of an H-space which we will later see induces the group structure on cohomology. We will also see that they come equipped with a graded multiplication which, also in Section 4, will be lifted to define cohomology rings.

The definition of Eilenberg–MacLane spaces and their H-space structure in HoTT is due to Licata and Finster (Reference Licata and Finster2014). The special case of integral Eilenberg–MacLane spaces, $K(\mathbb{Z},n)$ , was considered by Brunerie (Reference Brunerie2016), who gave an alternative and very compact definition in terms of truncated spheres. This definition of $K(\mathbb{Z},n)$ was also considered by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022). In this section, we will generalise the optimised proofs regarding integral Eilenberg–MacLane spaces and their H-space structure found in (Brunerie et al., Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) to a definition of general Eilenberg–MacLane spaces following Licata and Finster (Reference Licata and Finster2014).

In order to ease the notation when describing the induction principles of $K(G,n)$ , we will define it one step at a time. The crucial step is $K(G,1)$ , which will be defined in terms of the following construction.

Definition 7. Given a type $A$ , we define $L(A)$ by the HIT

  • $\star : L(A)$

  • $\textsf{loop}_k : A \to \star = \star$

Given a group $G$ , the type $L(G)$ is almost the first Eilenberg–MacLane space of $G$ . By adding a constructor connecting the group structure on $G$ with the H-space structure on $\Omega (L(G))$ , we approximate it further.

Definition 8. (Raw Eilenberg–MacLane spaces). We define the first raw Eilenberg–MacLane space, denoted $\widetilde {K}(G,1)$ , by the following HIT

  • $\iota : L(A) \to \widetilde {K}(G,1)$

  • For every $g_1,g_2 : G$ , a filler $\textsf{sq}(g_1,g_2)$ of the square

For $n \gt 1$ , we define $\widetilde {K}(G,n) := {\Sigma (\widetilde {K}(G,n-1))}$ .

In practice, we will omit the $\iota$ and simply write, for example, $\star : \widetilde {K}(G,1)$ and ${\textsf{loop}_k\,{g}} : \Omega (\widetilde {K}(G,1))$ . We let $0_k$ denote the basepoint of $\widetilde {K}(G,n)$ . That is, $0_k := \star$ when $n=1$ and $0_k := \textsf{north}$ when $n\gt 1$ .

Definition 9. (Eilenberg–MacLane spaces). Given an integer $n \geq 1$ and an abelian group $G$ , we define the $n$ th Eilenberg–MacLane space of $G$ by $K(G,n) := \lVert \widetilde {K}(G,n)\rVert _n$ . The zeroth Eilenberg–MacLane space is simply $K(G,0) := G$ .

The type $K(G,n)$ is pointed by $0_G$ when $n = 0$ and $\lvert \,0_k\,\rvert$ when $n\geq 1$ . With some abuse of notation, we will simply write $0_k$ to denote the basepoint of $K(G,n)$ .

Eilenberg–MacLane spaces come with important elimination principles. Let $n \geq 1$ , the fundamental elimination principle of $K(G,n)$ is given in Figure 2A and says that, given a fibration of $n$ -types $P : K(G,n) \to {\textsf {{n}-Type}}$ , in order to define a section $(x : K(G,n)) \to P(x)$ , it suffices to describe its action on canonical elements $\lvert \,x\,\rvert : K(G,n)$ , where $x:\widetilde {K}(G,n)$ . If $P$ is set-valued and $n = 1$ , it suffices to define the section for elements in $L(G)$ – see Figure 2B. In other words, we do not need to prove that our construction respects the $\textsf{sq}$ -constructor. Finally, it is easy to see that if $P$ is a family of $(n-2)$ -types, then any section $(x : K(G,n)) \to P(x)$ is uniquely determined by its action on the basepoint $0_k : K(G,n)$ – see Figure 2C.

Figure 2. Elimination principles for $K(G,n)$ .

We will, in Section 3.2, see that $\Omega ^n K(G,n) \simeq G$ but, before this, let us establish that $K(G,n)$ is $(n-1)$ -connected. These two facts imply that $\pi _n(K(G,n)) \simeq G$ and that all other homotopy groups vanish, which therefore shows that $K(G,n)$ indeed is an Eilenberg–MacLane space.

Proposition 10. The type $K(G,n)$ is $(n-1)$ -connected.

Proof. We want to show that $\lVert K(G,n)\rVert _{n-1}$ is contractible. When $n = 0$ , the statement is trivial, since $\lVert A\rVert _{-1}$ is contractible for any pointed type $A$ . Let $n \geq 1$ , we choose the centre of contraction to be $\lvert \,{\textsf{0}_k}\,\rvert$ . We now want to construct a section $(x : \lVert K(G,n)\rVert _{n-1}) \to \lvert \,{\textsf{0}_k}\,\rvert = x$ . Since $\lVert K(G,n)\rVert _{n-1}$ is an $(n-1)$ -type, all path types over it are $(n-2)$ -types. Thus, it suffices to construct the section over $\lvert \,{\textsf{0}_k}\,\rvert$ , which is trivial by $\textsf{refl} : \lvert \,{\textsf{0}_k}\,\rvert = \lvert \,{\textsf{0}_k}\,\rvert$ .

The type ${K}(G,n)$ is functorial in $G$ . That is, for any homomorphism $\phi : G_1 \to G_2$ , we have an induced map $\phi _n : K(G_1,n) \to K(G_2,n)$ . We define this as a map $\widetilde {K}(G_1,n) \to \widetilde {K}(G_2,n)$ . When $n = 0$ , we set $\phi _0 := \phi$ . For $n = 1$ , $\phi _1$ is defined by

\begin{align*} \phi _1(\star ) &:= \star \\ \textsf{ap}_{\phi _1}({\textsf{loop}_k\,{g}}) &:= {\textsf{loop}_k\,{(\phi _0(g))}} \end{align*}

This respects the $\textsf{sq}$ constructor of $\widetilde {K}(G_1,n)$ since $\phi$ is assumed to be a homomorphism. For $n \geq 2$ , we define it recursively using functoriality of $\Sigma$ and the fact that $\widetilde {K}(G,n) := {\Sigma (\widetilde {K}(G,n-1))}$ :

We also remark that there is a map $\sigma _n : K(G,n) \to \Omega (K(G,n+1))$ . We define it for raw Eilenberg–MacLane spaces by

\begin{align*} \sigma _n(x) :=\begin{cases} {\textsf{loop}_k\,{g}} & \text{ if $n = 0$}\\ \textsf{merid}\,x \cdot (\textsf{merid}\,0_k)^{-1} &\text{ otherwise} \end{cases} \end{align*}

As $\Omega (K(G,n+1))$ is an $n$ -type, this definition also induces, via $n$ -type elimination for Eilenberg–MacLane spaces (see Figure 2A), a map $K(G,n) \to \Omega (K(G,n+1))$ :

With some abuse of notation, we also denote this map by $\sigma _n$ . The following fact follows immediately by construction of $\sigma _n$ .

Lemma 11. Given a group homomorphism $\phi : G_1 \to G_2$ , we have

\begin{equation*}\textsf{ap}_{\phi _{n+1}}(\sigma _n(x)) =_{\Omega (K(G_2,n))} \sigma _n(\phi _n(x))\end{equation*}

for $x : K(G_1,n)$ .

3.1 Group structure

One of the key contributions of Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) was the computationally optimised definition of the H-space structure on $K(\mathbb{Z},n) := \lVert \mathbb{S}^n\rVert _n$ (when $n \geq 1$ ). Our goal here is to rephrase this optimised construction to $K(G,n)$ defined as above. The following proposition is crucial. It is a special case of [HoTT Book, Lemma 8.6.2.] for which we provide a direct proof in order to make future constructions relying on it more computationally efficient.

Proposition 12. Let $n,m\geq 1$ and assume we are given a fibration $\widetilde {K}(G_1,n) \times \widetilde {K}(G_2,m) \to \textsf {{(n+m-2)}-Type}$ , sections $f : (x : \widetilde {K}(G_1,n)) \to P(x,{\textsf{0}_k})$ and $g : (y : \widetilde {K}(G_2,m)) \to P({\textsf{0}_k},y)$ , and a path $p : f(0_k) = g(0_k)$ .

In this case, there is a unique section

\begin{equation*}{{f}\tilde {\vee }{g}} : ((x , y) : {\widetilde {K}(G_1,n) \times \widetilde {K}(G_2,m)}) \to P(x,y)\end{equation*}

equipped with homotopies

\begin{align*} &l : (x : \widetilde {K}(G_1,n)) \to ({{f}\tilde {\vee }{g}})(x,0_k) = f(x) \\ &r : (y : \widetilde {K}(G_2,m)) \to ({{f}\tilde {\vee }{g}})(0_k,y) = g(y) \end{align*}

satisfying $l(0_k)^{-1} \cdot r(0_k) = p$ .

Proof. An easy way of proving this is to note that the canonical map

\begin{equation*} i_{\vee } : {\widetilde {K}(G_1,n) \vee \widetilde {K}(G_2,m)} \to {\widetilde {K}(G_1,n) \times \widetilde {K}(G_2,m)} \end{equation*}

is $((n-1) + (m-1))$ -connected, thereby inducing a section via the map

\begin{equation*} f \vee g : (x : {\widetilde {K}(G_1,n) \vee \widetilde {K}(G_1,m)}) \to P (i_\vee (x)) \end{equation*}

From the point of view of computer formalisation, however, this proof leads to poor computational behaviour of subsequent definitions. For this reason, we provide a direct proof.

We proceed by induction on $n$ and $m$ . We first consider the base-case: $n=m=1$ . We are to construct a section ${{f}\tilde {\vee }{g}} : ((x,y): \widetilde {K}(G_1,1) \times \widetilde {K}(G_2,1)) \to P(x,y)$ . Since $P$ is a set, it suffices to define a section ${{f}\tilde {\vee }{g}} : ((x,y): L(G_1) \times L(G_2)) \to P(x,y)$ . We proceed by $L(G_1)$ -induction on $x$ . For the point constructor, we define

\begin{align*} ({{f}\tilde {\vee }{g}})(\star ,y) &:= g(y) \end{align*}

We now need to define $\textsf{ap}_{({{f}\tilde {\vee }{g}})(\!-,y)}({\textsf{loop}_k\,{a}})$ for $a : G_1$ . Since $P$ is set valued, it suffices to do so when $y$ is $\star$ . We define

\begin{align*} \textsf{ap}_{({{f}\tilde {\vee }{g}})(\!-,\star )}({\textsf{loop}_k\,{a}}) &:= p^{-1}\cdot \textsf{ap}_{f}({\textsf{loop}_k\,{a}}) \cdot p \end{align*}

We note that this construction satisfies the additional properties by default: we construct $l : (x : \widetilde {K}(G_1,1)) \to ({{f}\tilde {\vee }{g}})(x,{\textsf{0}_k}) = f(x)$ by induction on $x$ . Since this is a proposition, it suffices to construct $l(0_k) : g({\textsf{0}_k}) = f({\textsf{0}_k})$ , which we do by $l(0_k) := p^{-1}$ . We construct $r : (y : \widetilde {K}(G_2,1)) \to ({{f}\tilde {\vee }{g}})({\textsf{0}_k},x)$ simply by $r(y) := \textsf{refl}$ , since the equality holds by definition. We finally need to show that ${l(0_k)}^{-1} \cdot r(0_k)= p$ which is immediate by construction of $l$ and $r$ .

We proceed by induction on $n$ , letting $n \geq 2$ and omitting the case when $n = 1$ and $m\geq 2$ which is entirely symmetric. Let us define ${{f}\tilde {\vee }{g}} : ((x , y) : {\widetilde {K}(G_1,n) \times \widetilde {K}(G_2,m)}) \to P(x,y)$ . We stress that since $n \geq 2$ , we have that $\widetilde {K}(G_1,n) = \Sigma \widetilde {K}(G_1,n-1)$ by definition. Hence, we may define ${f}\tilde {\vee }{g}$ by suspension induction on $x$ . Let us start with the action on point constructors.

\begin{align*} ({{f}\tilde {\vee }{g}})(\textsf{north},y) &:= g(y)\\ ({{f}\tilde {\vee }{g}})(\textsf{south},y) &:= {\textsf{transport}^{P(\!-,y)}(\textsf{merid}\,{\textsf{0}_k},g(y))} \end{align*}

We now need to define $\textsf{ap}_{{{f}\tilde {\vee }{g}}}(\!-,y)(\textsf{merid}\,a) : {g(y) =_{\textsf{merid}\,a}^{P(\!-,y)} {\textsf{transport}^{P(\!-,y)}(\textsf{merid}\,{\textsf{0}_k},g(y))}}$ for $a :\widetilde {K}(G_1,n-1)$ and $y : \widetilde {K}(G_2,m)$ . The type of $\textsf{ap}_{{{f}\tilde {\vee }{g}}}(\!-,y)(\textsf{merid}\,a)$ is an $(n+m-3)$ -type, and thus, by induction hypothesis, it suffices to construct the following:

\begin{align*} f' &: (a : \widetilde {K}(G_1,n-1))\to {g({\textsf{0}_k}) =_{\textsf{merid}\,a}^{P(\!-,{\textsf{0}_k})} {\textsf{transport}^{P(\!-,{\textsf{0}_k})}(\textsf{merid}\,{\textsf{0}_k},g({\textsf{0}_k}))}} \\ g' &: (y : \widetilde {K}(G_2,m))\to {g(y) =_{\textsf{merid}\,{\textsf{0}_k}}^{P(\!-,y)} {\textsf{transport}^{P(\!-,y)}(\textsf{merid}\,{\textsf{0}_k},g(y))}} \\ p' &: f'({\textsf{0}_k}) = g'({\textsf{0}_k}) \end{align*}

By composition with $p$ , the target type of $f'$ is equivalent to $f(\textsf{north}) =_{\textsf{merid}\,a}^{P(\!-,{\textsf{0}_k})} f(\textsf{south})$ , of which we have a term: $\textsf{ap}_{f}(\textsf{merid}\,a)$ . The target type of $g'$ is equivalent to $g(y) = g(y)$ and we simply give the term $\textsf{refl}$ . The construction of $p'$ is an easy but technical lemma. Thus we have constructed ${f}\tilde {\vee }{g}$ . Now note that $r : (y : \widetilde {K}(G_2,m)) \to ({{f}\tilde {\vee }{g}})({\textsf{0}_k},y) = g(y)$ holds by $\textsf{refl}$ . The path $l : (x : \widetilde {K}(G_1,n-1)) \to ({{f}\tilde {\vee }{g}})(x,{\textsf{0}_k}) = g(y)$ is easily constructed using the corresponding $l$ and $r$ paths from the inductive hypothesis. This can be done so that $l({\textsf{0}_k}) = r({\textsf{0}_k})$ holds almost by definition.

Our goal now is to define addition $+_k : K(G,n) \times K(G,n) \to K(G,n)$ . When $n = 0$ , it is simply addition in $G$ . For $n \geq 1$ , we note that, by the elimination principle for $K(G,n)$ in Figure 2A, it suffices to define a corresponding operation $+_k : \widetilde {K}(G,n) \times \widetilde {K}(G,n) \to K(G,n)$ . When $n = 1$ , we define it explicitly by

\begin{align*} \star +_k y &:= y\\ \textsf{ap}_{\_ +_k \star }({\textsf{loop}_k\,{g}}) &:= {\textsf{loop}_k\,{g}} \\ \textsf{ap}_{x \mapsto \, \to \textsf{ap}_{\_ +_k x}({\textsf{loop}_k\,{g_1}})}( ){{\textsf{loop}_k\,{g_2}}} &:= Q \end{align*}

where $Q$ is a filler of the following square

which is easily constructed using that $\textsf{loop}_k\,{}$ preserves composition by definition of $K(G,1)$ . All other cases are immediate since $K(G,1)$ is $1$ -truncated. For higher values of $n$ , the construction is made straightforward by Proposition 12: Indeed, in this case, we have that $K(G,n)$ is of h-level $n\leq n + n -2$ . Therefore, we may define $+_k$ simply by

(1) \begin{align} x +_k 0_k & := x \end{align}
(2) \begin{align} 0_k +_k y & := y \\[8pt]\nonumber\end{align}

Proposition 12 also requires us to prove the above definitions to coincide when $x= 0_k$ and $y = 0_k$ , which they do by $\textsf{refl}$ . Thus, we have defined $+_k : \widetilde {K}(G,n) \times \widetilde {K}(G,n) \to K(G,n)$ , which lifts to an addition $K(G,n) \times K(G,n) \to K(G,n)$ which we, abusing notation, will also denote by $+_k$ .

The laws governing $+_k$ are remarkably easy to prove.

Proposition 13. The addition $+_k$ has $0_k$ as a left and right unit. Furthermore, these are coherent in the sense that we have a filler of the following square

Proof. The statement follows from the group structure on $G$ when $n = 0$ . When $n = 1$ , the target type is a set, since $K(G,1)$ is $1$ -truncated (and hence path types over it are sets). By the set-elimination rule for $K(G,n)$ (see Figure 2B ), it suffices to show that $\lvert \,x\,\rvert +_k 0_k = 0_k = 0_k +_k \lvert \,x\,\rvert$ for $x : L(G)$ . These equalities hold definitionally by $L(G)$ induction. Hence, we also get the filler of the square by $\textsf{refl}$ . When $n \geq 2$ , the statement follows immediately by the defining equations (1) and (2), using the family of paths $l$ and $r$ and the coherence between them, as given in Proposition 12.

In fact, modulo $\mathbb{N}$ -induction, by the direct proof of Proposition 12, we get that the left-and right-unit laws are definitionally equal at $0_k$ , with both definitionally equal to $\textsf{refl}$ .

Proposition 14. The addition $+_k$ is commutative.

Proof. When $n = 0$ , the statement is simply that $G$ is abelian, which we have assumed. Let $n \geq 1$ . By truncation elimination, it suffices to construct paths $\lvert \,x\,\rvert +_k \lvert \,y\,\rvert = \lvert \,y\,\rvert +_k \lvert \,x\,\rvert$ for $x,y:\widetilde {K}(G,n)$ . This path type is $(n-1)$ -truncated which is sufficiently low for Proposition 12 to apply. Hence, it suffices to construct paths $p_x : \lvert \,x\,\rvert + 0_k = 0_k + \lvert \,x\,\rvert$ and $q_y : 0_k +_k \lvert \,y\,\rvert = \lvert \,y\,\rvert + 0_k$ and show that $p_{0_k} = q_{0_k}$ . We construct both paths as compositions of the left- and right-unit laws of $+_k$ in the obvious way. These definitions coincide over $0_k$ by the second part of Proposition 13.

The following is equally direct to prove (using Proposition 12), so we omit its proof.

Proposition 15. The addition $+_k$ is associative.

Propositions 13, 14 and 15 amount precisely to showing that $K(G,n)$ is a commutative, associative H-space. There is, however, more to the story. In HoTT, it is easy to define an inversion on $K(G,n)$ . When $n = 0$ , it is simply negation in $G$ . When $n \geq 1$ , we have two different options. One approach is to note that for any $x : K(G,n)$ , the map $y \mapsto x + y$ is an equivalence. This is proved by observing that the property of being an equivalence is a proposition. The elimination rule of $K(G,n)$ into $(n-2)$ -types tells us that it is enough to show that the map is an equivalence when $x$ is $0_k$ . In this case, the map is simply the identity, and thus also an equivalence. The unique element in the fibre of $y \mapsto x + y$ over $0_k$ is taken to be the inverse of $x$ . This proof also gives the desired cancellation laws by construction. This is the approach used in, for instance, (Licata and Finster, Reference Licata and Finster2014; Brunerie, Reference Brunerie2016).

While elegant, the above approach has one major disadvantage: the action of $-_k$ on any element other than $0_k$ is described using transports. One consequence of this is that the terms produced by $-_k$ often are hard to work with directly. Another consequence is that terms described using $-_k$ tend to explode in size, which leads to poor computational behaviour in implementations in proof assistants. For these reasons, we choose the obvious direct construction of $-_k$ . We define it as a map $-_k : \widetilde {K}(G,n) \to \widetilde {K}(G,n)$ . When $n = 1$ , we define

\begin{align*} -_k \,\star &:= \star \\ \textsf{ap}_{-_k}({\textsf{loop}_k\,{g}}) &:= ({\textsf{loop}_k\,{g}})^{-1}\\ \textsf{ap}_{\textsf{ap}_{-_k}}(\textsf{sq}\,g_1\,g_2) &:= Q \end{align*}

where $Q$ is a filler of the square

which is easy to construct using the functoriality of $\textsf{loop}_k\,{}$ . For $n \geq 2$ , we define it by

\begin{align*} -_k \, \textsf{north} &:= \textsf{north}\\ -_k \, \textsf{south} &:= \textsf{north}\\ \textsf{ap}_{-_k}(\textsf{merid}\,g) &:= \sigma _n(g)^{-1} \end{align*}

For the cancellation laws, we will need the following lemma. We remark that it is only well-typed in the case when $n = 1$ is fixed or when $n$ is on the form $(2 + m)$ . The fact that it is well-typed exploits the fact that $0_k = 0_k +_k 0_k$ holds definitionally modulo the case distinction on $n$ .

Proposition 16. Let $n \geq 1$ . Given $p, q : \Omega (K(G,n))$ , we have $\textsf{ap}^{2}_{+_k}(p,q) = p \cdot q$ .

Proof. We have

\begin{equation*} \textsf{ap}^{2}_{+_k}(p,q) = \textsf{ap}_{x\mapsto x +_k 0_k}(p) \cdot \textsf{ap}_{y\mapsto 0_k +_k y}(q) = p \cdot q \end{equation*}

The final step consists in applying the right- and left-unit laws to both components. This is justified since they agree at $0_k$ .

We write $x -_k y$ for $x +_k (\!-_k\,y)$ and have that the directly defined $-_k$ indeed is inverse to $+_k$ by the following proposition:

Proposition 17. For $x : K(G,n)$ , we have $x -_k x = 0_k = (\!-_k\,x) +_k x$ .

Proof. By commutativity of $+_k$ , it suffices to show that $x -_k x = 0_k$ . When $n = 0$ , this comes from the group structure on $G$ . When $n = 1$ , we note that the goal type is a set, which means that it suffices to show the statement for $x : L(G)$ . We have $\star -_k \star = 0_k$ by $\textsf{refl}$ . For $\textsf{loop}_k\,{}$ , we need to show that

\begin{equation*} \textsf{ap}^{2}_{x,y\mapsto x -_k y}({\textsf{loop}_k\,{g}},{\textsf{loop}_k\,{g}}) = \textsf{refl} \end{equation*}

By Proposition 16, the LHS above is equal to ${\textsf{loop}_k\,{g}} \cdot ({\textsf{loop}_k\,{g}})^{-1}$ which is equal to $\textsf{refl}$ . The case when $n \geq 2$ is entirely analogous, again using Proposition 16 for the path constructors.

And there we have it: the $3$ -tuple $(K(G,n),+_k,0_k)$ forms, for any $n$ , a commutative and associative H-space with inverse given by $-_k$ . We will see in Section 4 that this trivially gives an induced group structure on cohomology groups, but let us first take a closer look at $\sigma _n$ and also examine the multiplicative structure on $K(G,n)$ .

3.2 $K(G,n)$ versus $\Omega K(G,n+1)$

We will soon see that $\sigma _n : K(G,n) \to \Omega K(G,n+1)$ in fact is an equivalence. It will be crucial when computing cohomology groups of spaces. However, we do not need it yet: Proposition 16 already provides us with a strong link between the structures on $K(G,n)$ and $\Omega K(G,n+1)$ . For instance, we may already now deduce the commutativity of $\Omega K(G,n+1)$ from the commutativity of $+_k$ :

Proposition 18. For $x : K(G,n)$ and $p,q : x = x$ , we have $p \cdot q = q \cdot p$ .

Proof. When $n = 0$ , we are automatically done, since $G$ is a set. For $n \geq 1$ , it suffices, by $(n-2)$ -type elimination, to show the statement when $x$ is $0_k$ . Let $p,q: \Omega K(G,n)$ . We have

\begin{align*} p \cdot q = \textsf{ap}^{2}_{+_k}(p,q) = \textsf{ap}^{2}_{+_k}(q,p) = q \cdot p \end{align*}

where the second equality comes from the commutativity of $+_k$ .

The usefulness of the above proof (as opposed to one using an equivalence $K(G,n) \simeq \Omega K(G,n+1)$ as in (Brunerie, Reference Brunerie2016)) is that it is rather direct and is easily shown to be homotopically trivial when $p$ and $q$ are $\textsf{refl}$ .

On a similar note, we may also provide a direct proof of the following proposition.

Proposition 19. Let $n \geq 1$ and $p: \Omega K(G,n)$ , we have $\textsf{ap}_{-_k}(p) = p^{-1}$ .

Proof. We give the proof for $n = 1$ as the case when $n \gt 1$ is entirely analogous. Let us define a fibration $\textsf{Code}_x: (p : \star = x) \to \textsf{hProp}$ for $x:K(G,1)$ . As $\textsf{hProp}$ is a set, it suffices to define $\textsf{Code}_x(p)$ for $x : L(G)$ . We do this by induction on $x$ and define

\begin{align*} \textsf{Code}_\star (p) := (\textsf{ap}_{-_k}(p) = p^{-1}) \end{align*}

which is a proposition since $K(G,1)$ is $0$ -connected. We need to check that this definition respects the action of $\textsf{Code}$ on $\textsf{loop}_k\,{g}$ for $g:G$ . This amounts to showing that, for any $p : \Omega K(G,1)$ , we have an equivalence

\begin{align*} (\textsf{ap}_{-_k}(p) = p^{-1}) \simeq (\textsf{ap}_{-_k}(p \cdot {\textsf{loop}_k\,{g}}) &= (p \cdot {\textsf{loop}_k\,{g}})^{-1}) \end{align*}

We rewrite the terms on the RHS as follows:

\begin{align*} \textsf{ap}_{-_k}(p \cdot {\textsf{loop}_k\,{g}}) &= \textsf{ap}_{-_k}(p) \cdot \textsf{ap}_{-_k}({\textsf{loop}_k\,{g}}) \\ &= \textsf{ap}_{-_k}(p) \cdot {({\textsf{loop}_k\,{g}})}^{-1} \end{align*}

and

\begin{align*} (p \cdot {\textsf{loop}_k\,{g}})^{-1} &= ({\textsf{loop}_k\,{g}})^{-1} \cdot p^{-1} \\ &= p^{-1} \cdot ({\textsf{loop}_k\,{g}})^{-1} \end{align*}

Thus, we only need to construct an equivalence.

\begin{align*} (\textsf{ap}_{-_k}(p) = p^{-1}) \simeq (\textsf{ap}_{-_k}(p) \cdot ({\textsf{loop}_k\,{g}})^{-1} &= p^{-1} \cdot ({\textsf{loop}_k\,{g}})^{-1}) \end{align*}

This equivalence is given by $\textsf{ap}_{q \mapsto q \cdot ({\textsf{loop}_k\,{g}})^{-1}}$ and thereby the construction of $\textsf{Code}$ is complete.

We now note that we have a section $(p : \star = x) \to \textsf{Code}_x(p)$ for any $x:K(G,1)$ since, by path induction, it suffices to note that $\textsf{refl}$ is an element of $\textsf{Code}_\star (\textsf{refl})$ . Hence, in particular, we have an element of $\textsf{Code}_\star (p)$ for all $p : \Omega K(G,1)$ , which is what we wanted to show.

The following proposition is also crucial and its proof can be found in (Licata and Finster, Reference Licata and Finster2014, Lemma 4.4).

Proposition 20. For $x,y : K(G,n)$ , we have $\sigma _n(x +_k y) = \sigma _n(x) \cdot \sigma _n(y)$ .

Because $\sigma _n$ is pointed, Proposition 20 immediately gives us the following corollary (which is proved just like in group theory).

Corollary 21. For $x: K(G,n)$ , we have $\sigma _n(\!-_k \, x) = \sigma _n(x)^{-1}$ .

We are now ready for the main result of the section, namely that $\Omega K(G,n+1) \simeq K(G,n)$ . The original proof in HoTT is due to (Licata and FinsterReference Licata and Finster2014, Theorem 4.3) who used encode-decode proofs in the cases $n=0$ and $n=1$ , and the Freudenthal suspension theorem (formalised in HoTT by Hou (Favonia) et al., (Reference Hou (Favonia), Finster, Licata and Lumdaine2016)) in the case $n \geq 2$ . Here we use an identical proof in the case $n = 1$ . However, it is possible to avoid the Freudenthal suspension theorem completely by simply noting that the proof of Licata and Finster when $n = 1$ actually can be used for all $n \geq 1$ . We primarily wish to avoid the Freudenthal suspension theorem as circumventing it makes the computer formalisation more computationally viable.

Theorem 22. The map $\sigma _n : K(G,n) \to \Omega K(G,n+1)$ is an equivalence.

Proof. For $n = 0$ , we refer to the proof in (Licata and Finster, Reference Licata and Finster2014). For $n \geq 1$ , we choose to provide an encode-decode proof similar to their $n = 1$ case. We define $\textsf{Code} : K(G,n+1) \to {\textsf {{n}-Type}}$ by

\begin{align*} \textsf{Code}(\lvert \,\textsf{north}\,\rvert ) &:= K(G,n) \\ \textsf{Code}(\lvert \,\textsf{south}\,\rvert ) &:= K(G,n) \\ \textsf{ap}_{\textsf{Code}\,\circ \, \lvert \,-\,\rvert }(\textsf{merid}\,\,a) &:= \textsf{ua}(x \mapsto \lvert \,a\,\rvert +_k x) \end{align*}

Here $\textsf{ua}$ is the part of univalence which turns an equivalence into a path. Clearly, the map to which it is applied is an equivalence. For any $t : K(G,n+1)$ , we have a map $\textsf{encode}_t : 0_k = t \to \textsf{Code}(t)$ defined by $\textsf{encode}_t(p):={\textsf{transport}^{\textsf{Code}}(p,0_k)}$ (this is equivalent to path induction on $p$ ). We define $\textsf{decode}_t : \textsf{Code}(t) \to 0_k = t$ by truncation elimination and $K(G,n)$ -induction on $t$ . For the point constructors, we define it by

\begin{align*} \textsf{decode}_{\lvert \,\textsf{north}\,\rvert }(x) &= \sigma _n(x)\\ \textsf{decode}_{\lvert \,\textsf{south}\,\rvert }(x) &= \sigma _n(x)\cdot \textsf{ap}_{\lvert \,-\,\rvert }(\textsf{merid}\,0_k) \end{align*}

For the path constructor, we need to, after some simple rewriting of the goal, provide a path

\begin{equation*} \sigma _n(x-_k\lvert \,a\,\rvert ) = \sigma _n(x)\cdot \sigma _n(\lvert \,a\,\rvert )^{-1} \end{equation*}

for $x : K(G,n)$ and $a : \widetilde {K}(G,n)$ which is easily done using Proposition 20 and Corollary 21. We can now show that, for any $t : K(G,n+1)$ and $p : 0_k = t$ , we have $\textsf{encode}_t(\textsf{decode}_t(p)) = p$ by path induction on $p$ . In particular, we have $\textsf{decode}_{0_k}(\textsf{encode}_{0_k}(p)) = p$ for all $p : \Omega K(G,n+1)$ . We can also show that $\textsf{encode}_{0_k}(\textsf{decode}_{0_k}(x)) = x$ for all $x:K(G,n)$ by simply unfolding the definitions of $\textsf{decode}_{0_k}$ and $\textsf{encode}_{0_k}$ . Indeed, after applying truncation elimination on $x$ , we have:

\begin{align*} \textsf{encode}_{0_k}(\textsf{decode}_{0_k}(\lvert \,a\,\rvert )) &:= \textsf{encode}_{0_k}(\sigma _n(\lvert \,a\,\rvert )) \\ &:= {\textsf{transport}^{\textsf{Code}}(\sigma _n(\lvert \,a\,\rvert ),0_k)}\\ &= {\textsf{transport}^{\textsf{Code}\circ \lvert \,-\,\rvert }(\textsf{merid}\,(0_k)^{-1},{\textsf{transport}^{\textsf{Code}\circ \lvert \,-\,\rvert }(\textsf{merid}\,a,0_k)})} \\ &= {\textsf{transport}^{\textsf{Code}\circ \lvert \,-\,\rvert }(\textsf{merid}\,(0_k)^{-1},\lvert \,a\,\rvert +0_k)}\\ &=(\!-_k 0_k) +_k (\lvert \,a\,\rvert +0_k)\\ &= \lvert \,a\,\rvert \end{align*}

and we are done.

Note that this implies that we have $\Omega ^n (K(G,n)) \simeq G$ . By Proposition 20, this equivalence is an isomorphism of groups. Together with Proposition 10, this shows that $K(G,n)$ indeed is an Eilenberg–MacLane space.

3.3 The cup product with group coefficients

There is an additional structure definable already on Eilenberg–MacLane spaces: the cup product. The first construction in HoTT is due to Brunerie (Reference Brunerie2016), who defined it for integral cohomology – that is, he defined $\smile _k \, : K(\mathbb{Z},n) \times K(\mathbb{Z},m) \to K(\mathbb{Z},n+m)$ . This definition was later extended to $\smile _k \, : K(G_1,n) \times K(G_2,m) \to K(G_1 \otimes G_2,n+m)$ by Baumann (Reference Baumann2018). The issue with the definitions of these cup products is that they rely heavily on the properties of smash products. As smash products have turned out to be rather difficult to reason about in HoTT (Brunerie, Reference Brunerie2018), not all cup product axioms have been formally verified using these definitions. For this reason, a new definition of the cup product on $\mathbb{Z}$ -cohomology was given by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) which allowed for a complete proof of the graded commutative ring laws. Our goal in this section is to generalise this definition and get a map $\smile _k \, : K(G_1,n) \times K(G_2,m) \to K(G_1 \otimes G_2,n+m)$ satisfying the expected laws.

Before defining the cup product, we need to define tensor products of abelian groups. In HoTT, we can do this very directly using the obvious HIT:

Definition 23. Given abelian groups $G_1$ and $G_2$ we define their tensor product $G_1 \otimes G_2$ to be the HIT generated by

  • points $g_1 \otimes g_2 : G_1 \otimes G_2$ , for each $g_1 :G_1$ and $g_2:G_2$

  • points ${x} \oplus {y}$ for each pair of points $x,y : G_1 \otimes G_2$

  • for any $x,y,z : G_1 \otimes G_2$ , paths

    \begin{align*} {{x} \oplus {y}} &= {{y} \oplus {x}} \\ {{x} \oplus {({{y} \oplus {z}})}} &= {{({{x} \oplus {y}})} \oplus {z}} \\ {{(0_{G_1} \otimes 0_{G_1})} \oplus {x}} &= x \end{align*}
  • for any $x : G_1$ and $y,z : G_2$ , paths $x \otimes (y +_{G_2} z) = {{(x \otimes y)} \oplus {(x \otimes z)}}$

  • for any $x, y : G_1$ and $z : G_2$ , paths $(x +_{G_1} y) \otimes z = {{(x \otimes z)} \oplus {(y \otimes z)}}$

  • a constructor $\textsf {is-set} : \textsf{isSet}\,(G_1 \otimes G_2)$

One easily verifies that this construction has the expected universal property. Consequently, a map out of $G_1 \otimes G_2$ into a set is well-defined if and only if it is structure preserving. When mapping into a proposition, it suffices to construct the map over canonical elements $g_1 \otimes g_2$ and show that the proposition respects $\oplus$ .

Let us return to the problem at hand: defining the cup product. We note first that it is very easy to define a preliminary cup product

(3) \begin{align} {\smile }_k' : \widetilde {K}(G_1,n) \times K(G_2,m) \to K(G_1 \otimes G_2,n+m) \end{align}

When $n = 0$ , we define $g \smile _k' (\!-\!)$ by the functorial action of $K(\!-,m)$ on the group homomorphism given by $g \otimes (\!-\!) : G_2 \to G_1 \otimes G_2$ . When $n = 1$ , we inductively define:

\begin{align*} \star \smile _k' y &:= 0_k\\ \textsf{ap}_{x \mapsto x \smile _k'\,y}({\textsf{loop}_k\,{g}}) &:= \sigma _m(g \smile _k' y) \end{align*}

The fact that this respects the $\textsf{sq}$ constructor is easy to check. For $n \geq 2$ , the idea is the same:

\begin{align*} \textsf{north} \smile _k' y &= 0_k\\ \textsf{south} \smile _k' y &= 0_k\\ \textsf{ap}_{x \mapsto x \smile _k'\,y}(\textsf{merid}\,\,a) &= \sigma _{(n-1)+m}(a \smile _k' y) \end{align*}

We would now like to be able to lift $\smile _k'$ to a full cup product $\smile _k \, : K(G_1,n) \times K(G_2,m) \to K(G_1 \otimes G_2,n+m)$ :

or, after currying:

However, we run into an obstruction: for this lift to exist, we require the function type $K(G_2,m) \to K(G_1\otimes G_2,n+m)$ to be an $n$ -type, which it is not unless $m = 0$ . Fortunately, a very trivial observation makes the lift possible: we want our cup product to satisfy $x \smile _k 0_k = 0_k$ . In other words, we may see the cup product as a map into a pointed function type:

\begin{align*} \smile _k \, : K(G_1,n) \to (K(G_2,m) \to _\star K(G_1 \otimes G_2,n+m)) \end{align*}

In this case, we do get a lift

and thereby the cup product is defined. The existence of the lift is motivated by the following result which follows from a more general result (Buchholtz et al., Reference Buchholtz, van Doorn and Rijke2018, Corollary 1), but has a very simple direct proof when the spaces involved are Eilenberg–MacLane spaces.

Proposition 24. The space $K(G_1,n) \to _\star K(G_2,n+m)$ is $m$ -truncated.

Proof. It is enough to show that $\Omega ^{m+1}(K(G_1,n) \to _\star K(G_2,n+m))$ is contractible. We have

\begin{align*} \Omega ^{m+1} (K(G_1,n) \to _\star K(G_2,n+m)) &\simeq (K(G_1,n) \to _\star \Omega ^{m+1} K(G_2,n+m)) \\ &\simeq (K(G_1,n) \to _\star K(G_2,n-1)) \end{align*}

The fact that $(K(G_1,n) \to _\star K(G_2,n-1))$ is contractible follows easily from the $(n-2)$ -type elimination rule for $K(G_1,n)$ in Figure 2C .

This concludes the construction of $\smile _k$ . Let us now prove the various ring laws governing it. We first note that since $\smile _k'$ is pointed in both arguments, this also applies to $\smile _k$ . Thus, we have verified the first law:

Proposition 25. For $x : K(G,n)$ , we have $x \smile _k 0_k = 0_k$ and $0_k \smile _k x = 0_k$ .

We now set out to prove the remaining laws. This turns out to be rather difficult to do directly: we want to prove these laws using $K(G,n)$ -elimination via Proposition 24, but this forces us to prove equalities of pointed maps, rather than just maps. For instance, for left-distributivity we have to prove that for any two points $x,y: K(G_1,n)$ we have that the two maps

\begin{align*} z &\mapsto (x +_k y) \smile _k z \\ z &\mapsto (x \smile _k z) +_k (y \smile _k z) \end{align*}

are equal as pointed maps living in $K(G_2,m) \to _\star K(G_1 \otimes G_2 , n + m)$ . This is far more involved than proving equality of the underlying maps: a proof of equality of pointed maps $(f,p),(g,q) : A \to _\star B$ consists not only of a homotopy $h : (a : A) \to f\,a = g\,a$ but also a coherence $p =_{\textsf{refl}}^{h(\star _A)} q$ . Fortunately, there is a trick to automatically infer the coherence. We attribute this result to Evan Cavallo.Footnote 4

Lemma 26. (Evan’s trick). Given two pointed functions $(f,p), (g,q) : A \to _\star B$ with $B$ homogeneous. If $f = g$ , then there is a path of pointed functions $(f,p) = (g,q)$ .

Proof. By assumption, we have a homotopy $h : (x : A) \to f(x) = g(x)$ . We construct $r : \star _B = \star _B$ by

\begin{align*} r := p^{-1} \cdot h(\star _A) \cdot q \end{align*}

and define $P : (B,\star _B) =_{\mathcal{U}_*} (B,\star _B)$ by

\begin{align*} P := \textsf{ap}_{(B,-)}(r) \end{align*}

We get $P = \textsf{refl}$ as an easy consequence of the homogeneity of $B$ . Hence, instead of proving that $(f,p) = (g,q)$ , it is enough to prove that ${\textsf{transport}^{{A \to _\star (\!-\!)}}(P,(f,p))} = (g, q)$ . The transport only acts on $p$ and $q$ , so the identity of the first components holds by $h$ . For the second components, we are reduced to proving that $p \cdot r = h(\!\star _A\!) \cdot q$ . This is true immediately by the construction of $r$ .

Proposition 27. (Left-distributivity of $\smile _k$ ). Let $x,y : K(G_1,n)$ and $z : K(G_2,m)$ . We have

\begin{equation*} (x +_k y) \smile _k z = x \smile _k z +_k y \smile _k z \end{equation*}

Proof. When $n = 0$ , the result follows by a straightforward induction on $m$ . When $n \geq 1$ , we generalise and, for $x,y : K(G_1,n)$ , consider the two functions

\begin{align*} z &\mapsto (x +_k y) \smile _k z \\ z &\mapsto (x \smile _k z) +_k (y \smile _k z) \end{align*}

We claim that these are equal as pointed functions living in $K(G_2,m) \to _\star K(G_1\otimes G_2 , n + m)$ . By Proposition 24, all path types over $K(G_2,m) \to _\star K(G_1\otimes G_2 , n + m)$ are $(n-1)$ -types. This allows us to apply truncation elimination and Proposition 12. In combination with Lemma 26, it suffices to construct, for each $z : K(G_2,m)$ :

\begin{align*} l(y) &: (0_k +_k \lvert \,y\,\rvert ) \smile _k z = (0_k \smile _k z) +_k (\lvert \,y\,\rvert \smile _k z) \\ r(x) &: (\lvert \,x\,\rvert +_k 0_k) \smile _k z = (\lvert \,x\,\rvert \smile _k z) +_k (0_k \smile _k z) \\ q &: l(0_k) = r(0_k) \end{align*}

which is direct using the unit laws for $+_k$ and $\smile _k$ . The obvious construction makes $q$ hold by $\textsf{refl}$ .

Right-distributivity follows by an almost identical proof, so we omit it.

Proposition 28. (Right-distributivity of $\smile _k$ ). Let $x: K(G_1,n)$ and $y,z : K(G_2,m)$ . We have

\begin{equation*} x \smile _k (y +_k z) = x \smile _k y +_k x \smile _k z \end{equation*}

Before moving on to associativity, we will need the following lemma. As pointed out by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022), this lemma also appears in (Brunerie, Reference Brunerie2016, Proposition 6.1.1) where it is used for the construction of the Gysin sequence. Its proof relies on the pentagon identity for smash products which, at the time, was open in HoTT. In our setting, which like that of Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) uses pointed maps instead of smash products, it holds by construction.

Lemma 29. For $x : K(G_1,n)$ and $y : K(G_2,m)$ , we have

\begin{equation*}\textsf{ap}_{x\mapsto x \smile _k y}(\sigma _n(x)) = \sigma _{n+m}(x \smile _k y)\end{equation*}

Proof. When $n = 0$ , the statement holds by definition. Let us consider the case $n \geq 1$ . The maps we are comparing are of type $K(G_1,n) \to K(G_2,m) \to _\star \Omega (K(G_1 \otimes G_2 , (n + 1) + m))$ . The type

\begin{equation*}K(G_2,m) \to _\star \underset {\simeq K(G_1\otimes G_2,n+m)}{\underbrace {\Omega (K(G_1 \otimes G_2 , (n + 1) + m))}}\end{equation*}

is an $n$ -type by Proposition 24, and hence we may use $K(G,n)$ -elimination on $x$ . Hence, we want to construct an equality of pointed functions

\begin{equation*}(y\mapsto \textsf{ap}_{x\mapsto x \smile _k y}(\sigma _n(a))) = (y \mapsto \sigma _{n+m}(a \smile _k' y))\end{equation*}

for $a : \widetilde {K}(G,n)$ . By Lemma 26, it suffices to show this equality for underlying functions. This follows trivially:

\begin{align*} \textsf{ap}_{x\mapsto x \smile _k y}(\sigma _n(a)) &:= \textsf{ap}_{x\mapsto \lvert \,x\,\rvert \smile _k y}(\textsf{merid}\,a \cdot (\textsf{merid}\,0_k)^{-1}) \\ &= \textsf{ap}_{x\mapsto \lvert \,x\,\rvert \smile _k y}(\textsf{merid}\,a) \cdot (\textsf{ap}_{x\mapsto \lvert \,x\,\rvert \smile _k y}(\textsf{merid}\,0_k))^{-1} \\ &:= \sigma _{n+m}(a \smile _k' y) \cdot \sigma _{n+m}(0_k \smile _k' y)^{-1}\\ &= \sigma _{n+m}(a \smile _k' y) \end{align*}

With Lemma 29, associativity is straightforward to prove.

Proposition 30. The cup product is associative. That is, the following diagram commutes:

Proof. We induct on $n$ . Let us first consider the inductive step and save the base case for last. To this end, let $n \geq 1$ . We may consider the two functions we are comparing as doubly pointed functions of type

\begin{equation*}K(G_1,n) \to (K(G_2,m) \to _\star (K(G_3,k) \to _\star K(G_1 \otimes (G_2 \otimes G_3) , n + m + k)))\end{equation*}

Applying an appropriate variant of Proposition 24, the codomain of the above function type is an $n$ -type. When $x$ is a point constructor of $K(G_1,n)$ , the diagram in the statement commutes by $\textsf{refl}$ . For the higher constructor ( $\textsf{merid}\,$ or $\textsf{loop}_k\,{}$ , depending on the value of $n$ ), we are done if we can show, for $x : K(G_1,n-1)$ , that

\begin{align*} \textsf{ap}_{x \mapsto x \smile _k (y \smile _k z)}(\sigma _{n-1}(x)) = \textsf{ap}_{x \mapsto \alpha _{n+m+k} ((x \smile _k y) \smile _k z)}(\sigma _{n-1}(x)) \end{align*}

where $\alpha : (G_1 \otimes G_2) \otimes G_3 \simeq G_1 \otimes (G_2 \otimes G_3)$ and, recall, $\alpha _{p} : K((G_1 \otimes G_2) \otimes G_3,p) \to K(G_1 \otimes (G_2 \otimes G_3),p)$ is the functorial action of $K(\!-,p)$ on $\alpha$ . We have

\begin{align*} \textsf{ap}_{x \mapsto x \smile _k (y \smile _k z)}(\sigma _{n-1}(x)) &= \sigma _{(n-1)+(m+k)}(x \smile _k (y \smile _k z)) & \text{(}\text{Lemma}\,29)\text{} \\ &= \sigma _{(n-1)+(m+k)}(\alpha _{(n-1)+(m+k)} ((x \smile _k y) \smile _k z)) & \text{ (Ind. hyp.)} \\ &= \textsf{ap}_{\alpha _{n+m+k}}(\sigma _{((n-1) + m)+k}((x \smile _k y) \smile _k z)) &\text{(}\text{Lemma}\,11\text{)} \\ &= \textsf{ap}_{\alpha _{n+m+k}}(\textsf{ap}_{x \mapsto x \smile _k z}(\sigma _{((n-1) + m)}(x \smile _k y))) &\text{(}\text{Lemma}\,29\text{)} \\ &= \textsf{ap}_{\alpha _{n+m+k}}(\textsf{ap}_{x \mapsto x \smile _k z}({\textsf{ap}_{x \mapsto x \smile y}(\sigma _{(n-1)}(x))})) &\text{(}\text{Lemma}\,29\text{)} \\ &= \textsf{ap}_{x \mapsto \alpha _{n+m+k} ((x \smile _k y) \smile _k z)}(\sigma _{n-1}(x)) \end{align*}

which concludes the inductive step.

Let us return to the base case, namely, the case $n = 0$ . In this case, we fix $g_1 : G_1$ and instead consider the functions $y,z \mapsto g_1 \smile _k(y\smile _k z)$ and $y,z \mapsto (g_1 \smile _k y)\smile _k z$ to be of type

\begin{equation*}K(G_2,m) \to K(G_3,k) \to _\star K(G_1\otimes (G_2 \otimes G_3) , m + k).\end{equation*}

We induct on $m$ . The inductive step follows in the same way as the inductive step above. For the base case, we fix $y$ to be $g_2 : G_2$ and are left to prove $g_1 \smile _k (g_2 \smile _k z) = (g_1 \smile _k g_2) \smile _k z$ for $z : K(G_3,k)$ . Again, this is followed by induction on $k$ . The base case is given by associativity of $G_1\otimes (G_2 \otimes G_3)$ and the inductive step follows in exactly the same way as before.

Let us verify graded commutativity. Although our argument is a direct generalisation of that of Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022, Proposition 18), we remark that a similar albeit somewhat more high-level argument appears in (Wärn, Reference Wärn2023, Section 4.3).

Proposition 31. The cup product is graded commutative. That is, the following diagram commutes:

Proof. We may, without loss of generality, assume that $n \geq m$ . We induct on the quantity $n+m$ . The base-case when $n = m = 0$ is trivial. Let us consider the two cases $n = m = 1$ and $n,m \geq 2$ and omit the two cases when $n \geq 2$ and $m \lt 2$ as they follow in an entirely analogous manner. In what follows, let $c_p : K(G_2\otimes G_1,p) \to K(G_1 \otimes G_2,p)$ denote the commutator.

We start with the case $n = m = 1$ . In this case, we would like to be able to apply the set-elimination rule for $K(\!-,1)$ . As before, fix $x : K(G_1,1)$ . We strengthen the goal by asking for $x \smile _k (\!-\!)$ and $y \mapsto (\!-1)^{nm}(y \smile _k x)$ to be equal as pointed functions living in $K(G_2,1) \to _\star K(G_1\otimes G_2 , 2)$ . The type of such functions is a $1$ -type, and hence, any path type over it is a set. Thus, we may apply set-elimination and assume that $x : L(G_1)$ . We may now repeat the argument for $y : K(G_2,n)$ : we would like $(\!-\!) \smile _k y$ and $x \mapsto (\!-1)^{nm}(y \smile _k x)$ to be equal as pointed functions living in $L(G_1) \to _\star K(G_1\otimes G_2, 2)$ . By a very similar argument to that of Proposition 24, this pointed function type is again a $1$ -type, which justifies set-elimination being applied to $y$ . Combining this with Lemma 26, it is enough to show that

\begin{align*} x \smile _k y = - c_{2}(y \smile _k x) \end{align*}

for $x : L(G_1)$ and $y : L(G_2)$ . We do this by $L(G_1)$ induction. When either $x$ or $y$ is a point constructor, the identity holds by $\textsf{refl}$ . The remaining case amounts to (by evaluation of $c_2$ ) the following identity

\begin{align*} \textsf{ap}_{x \mapsto \textsf{ap}_{x \smile _k (\!-\!)}({\textsf{loop}_k\,{h}})}({\textsf{loop}_k\,{g}}) = \textsf{flip}(\textsf{ap}_{x \mapsto \textsf{ap}_{x \smile _k (\!-\!)}({\textsf{loop}_k\,{h}})}({\textsf{loop}_k\,{g}})^{-1}) \end{align*}

which holds by Lemma 6.

We give a rough sketch of the case $n,m \geq 2$ . We may apply $K(G_1,n)$ -elimination again, by the same argument as in the previous case. The crucial step this time is verifying

(4) \begin{align} \textsf{ap}_{x \mapsto \textsf{ap}_{x \smile _k (\!-\!)}(\textsf{merid}\,\,h)}(\textsf{merid}\,\,g) = \textsf{ap}_{x \mapsto \textsf{ap}_{(\!-1)^{nm} (x \,\smile _k (\!-\!))}(\textsf{merid}\,\,h)}(\textsf{merid}\,\,g) \end{align}

We note that the above identity and the identities that follow only are well-typed up to some coherences which we brush under the rug for the sake of readability. We notice that (4) follows if we can show that for $x : K(G_1,n-1)$ , $y : K(G_2,m-1)$ , we have

(5) \begin{align} \textsf{ap}_{x \mapsto \textsf{ap}_{x \smile _k (\!-\!)}(\sigma _{m-1}(y))}(\sigma _{n-1}(x)) = \textsf{ap}_{x \mapsto \textsf{ap}_{(\!-1)^{nm} (x \,\smile _k (\!-\!))}(\sigma _{m-1}(y))}(\sigma _{n-1}(x)) \end{align}

Let us, for further readability, omit the equivalence $c_{p}$ in the following equations. Some of the following equalities hold up to multiplication by $(\!-1)^p$ for some $p : \mathbb{N}$ . This will be indicated in the right-hand column.

\begin{align*} \textsf{ap}_{a \mapsto \textsf{ap}_{a \smile _k (\!-\!)}(\sigma _{m-1}(y))}(\sigma _{n-1}(x)) &= \textsf{ap}_{a \mapsto \textsf{ap}_{(\!-\!) \smile _k a}(\sigma _{n-1}(x))}(\sigma _{m-1}(y)) & (\!-1)\\ &= \textsf{ap}_{\sigma _{(n-1)+m}}(\textsf{ap}_{x \smile _k (\!-\!)}(\sigma _{m-1}(y))) \\ &= \textsf{ap}_{\sigma _{m+(n-1)}}(\textsf{ap}_{(\!-\!) \smile _k x}(\sigma _{m-1}(y))) & m(n-1) \\ &= \textsf{ap}_{\sigma _{(m-1)+(n-1)+1}}(\sigma _{(m-1)+(n-1)}(y \smile _k x)) \\ &= \textsf{ap}_{\sigma _{{(n-1)+(m-1)+1}}}(\sigma _{{(n-1)+(m-1)}}(x \smile _k y)) & (n-1)(m-1) \\ &= \textsf{ap}_{\sigma _{n+(m-1)}}(\textsf{ap}_{(\!-\!) \smile _k y}(\sigma _{n-1}(x))) \\ &= \textsf{ap}_{\sigma _{m+(n-1)}}(\textsf{ap}_{y \smile _k (\!-\!)}(\sigma _{n-1}(x))) & (m-1)n \\ &= \textsf{ap}_{a \mapsto \textsf{ap}_{(\!-\!) \,\smile a}(\sigma _{m-1}(y))}(\sigma _{n-1}(x)) \end{align*}

Since $(\!-1)+n(m-1) + (n-1)(m-1) + (n-1)m =_{\mathbb{Z}/2\mathbb{Z}} nm$ , the above identity holds up to multiplication by $(\!-1)^{nm}$ , which gives (5).

3.4 The cup product with ring coefficients

We now consider the special case of $\smile _k \, : K(G_1,n) \times K(G_2,m) \to K(G_1\otimes G_2,n + m)$ where $G_1 = G_2 = R$ for a (not necessarily commutative) ring $R$ . Let $\textsf{mult}_{n} : K(R\otimes R, n) \to K(R,n)$ be the map induced by the multiplication $R \otimes R \to R$ . Now, consider the composition

Let us, with some overloading of notation, use $\smile _k : K(R,n)\times K(R,m) \to K(R,n)$ to denote also the composition above. Note that the above tensor product is a tensor product of underlying abelian groups and not of rings, although this is of no consequence for the construction. Using the results from Section 3.3, we easily arrive at the following results. Their proofs all follow the same strategy and we will only sketch the proof of Proposition 33.

Proposition 32. The cup product $\smile _k$ with ring coefficients is associative, left- and right-distributive and has $0_k$ as annihilating element.

Proposition 33. The cup product $\smile _k$ with coefficients in a commutative ring is graded-commutative.

Proof. Let $c_p$ denote the commutator $K(G\otimes H,p) \to K(H \otimes G,p)$ . Consider the following diagram.

The statement is that the outer square commutes. By Proposition 31 the left-square commutes. It is easy to verify, using commutativity of $R$ , that $\textsf{mult}_{n+m} \circ c = \textsf{mult}_{m+n}$ . Hence, the right-square commutes, and we are done.

Finally, we note that we now have access to a neutral element $1_R : K(R,0)$ which is a left and right unit for $\smile _k$ :

Proposition 34. For $x : K(R,n)$ , we have $x \smile _k 1_R = x = 1_R \smile _k x$ .

Proof. By a straightforward induction on $n$ , using the recursive definition of the cup product.

4. Cohomology

For the construction of cohomology groups, we rely on Brown (Reference Brown1962) representability: given $n:\mathbb{N}$ , an abelian group $G$ and a type $X$ , we define the nth cohomology group of X with coefficients in $G$ byFootnote 5

\begin{align*} H^n(X,G) := \lVert X \to K(G,n)\rVert _0 \end{align*}

This construction is clearly contravariantly functorial by pre-composition. The group structure on $K(G,n)$ naturally carries over to $H^n(X,G)$ by point-wise application of $+_k$ and $-_k$ . The neutral element is, in both cases, the constant map $\_ \, \mapsto 0_k$ . In what follows, we will denote addition, inversion and the neutral element in $H^n(X,G)$ by $+_h$ , $-_h$ and $0_h$ respectively. Explicitly, they are defined by

\begin{align*} \lvert \,f\,\rvert +_h \lvert \,g\,\rvert &:= \lvert \,x \mapsto f(x) +_k g(x)\,\rvert \\ -_h \lvert \,f\,\rvert &:= \lvert \,x \mapsto -_k f(x)\,\rvert \\ 0_h &:= \lvert \,\_ \, \mapsto 0_k\,\rvert \end{align*}

In the same way, our construction of the cup product also carries over to cohomology groups. In particular, the cup product with ring coefficients in Section 3.4 gives us a cup product on cohomology

\begin{align*} \smile \, : H^n(X,R) \times H^m(X,R) \to H^{n+m}(X,R) \end{align*}

satisfying the usual graded ring axioms and, when $R$ is commutative, graded commutativity. In addition, it induces a multiplication on $H^*(X,R) = \oplus _{n : \mathbb{N}} H^n(X,R)$ , turning it into a graded-commutative (assuming $R$ is commutative) ring known as the cohomology ring of $X$ with coefficients in $R$ . This was formalised in Cubical Agda by Lamiaux et al. (Reference Lamiaux, Ljungström and Mörtberg2023). This gives an even more fine-grained invariant than just the cohomology groups $H^n(X,G)$ , as it can help to distinguish spaces for which all cohomology groups agree. As a classic example which was also considered by Lamiaux et al. (Reference Lamiaux, Ljungström and Mörtberg2023), consider Figure 3 which depicts a torus and the ‘Mickey Mouse space’ consisting of a sphere glued together with two circles.

Figure 3. $\mathbb{T}^2$ and $\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1$ .

Let $X$ be either of the two spaces in the figure. One can prove that $H^0(X,\mathbb{Z}) \cong \mathbb{Z}$ as they are both connected, $H^1(X,\mathbb{Z}) \cong \mathbb{Z} \times \mathbb{Z}$ as they each have two 2-dimensional holes (the circle in the middle of the torus and the one going around the interior, and the ‘ears’ of Mickey), and $H^2(X,\mathbb{Z}) \cong \mathbb{Z}$ as they have one 3-dimensional hole each (the interior of the torus and Mickey’s head). Furthermore, their higher cohomology groups are all trivial as they do not have any further higher dimensional cells. The cohomology groups are hence insufficient to tell the spaces apart. However, one can show that the cup product on $\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1$ is trivial, while for $\mathbb{T}^2$ it is not. So $H^*(\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1,\mathbb{Z}) \not \cong H^*(\mathbb{T}^2,\mathbb{Z})$ , which again means that the spaces cannot be equivalent (see Section 6.1 for details on how this can be proved by computer computation in Cubical Agda).

4.1 Reduced cohomology

When $X$ is pointed, we may also define reduced cohomology groups by simply requiring all functions to be pointed:

\begin{align*} \widetilde {H}^n(X,G) := \lVert X \to _\star K(G,n)\rVert _0 \end{align*}

Just like before, the additive structure on $K(G,n)$ carries over directly to $\widetilde {H}(X,G)$ . As we will soon see, this definition is equivalent to the non-reduced version when $n\geq 1$ but has the advantage of vanishing for connected spaces when $n = 0$ .

Proposition 35. The first projection (sending a pointed map to its underlying function) induces an isomorphism $\widetilde {H}^n(X,G) \cong H^n(X,G)$ for $n \geq 1$ .

Proof. Let $F$ denote the function in question. The fact that it is a homomorphism is trivial. We may construct its inverse $F^{-1} : H^n(X,G) \to \widetilde {H}^n(X,G)$ explicitly by

\begin{align*} F^{-1}\,\lvert \,f\,\rvert := \lvert \, x \mapsto f(x) -_k f(\star _X)\,\rvert \end{align*}

In order to see that $F(F^{-1} \lvert \,f\,\rvert ) = \lvert \,f\,\rvert$ , we note that this is a proposition. By connectedness of $K(G,1)$ , we may assume we have a path $f(\star _X) = 0_k$ . Hence

(6) \begin{align} F(F^{-1}\,\lvert \,f\,\rvert ):= \lvert \, x \mapsto f(x) -_k f(\star _X)\,\rvert = \lvert \,f\,\rvert \end{align}

For the other direction, we need to check that

\begin{align*} F^{-1}(F\,\lvert \,(f,p)\,\rvert ) = \lvert \,(f,p)\,\rvert \end{align*}

By Lemma 26, we only need to verify that the first projections agree, and we are reduced to the second equality in (6), which we have already verified.

Proposition 36. $\widetilde {H}^0(X,G) \oplus G \cong H^0(X,G)$ .

Proof. We define $\phi : (X \to _\star G) \times G \to (X \to G)$ by

\begin{equation*} \phi (f,g) := x \mapsto f(x) +_G g \end{equation*}

and $\psi : (X \to G) \to (X \to _\star G) \times G$ by

\begin{equation*} \psi (f) := ((x \mapsto f(x) -_G f(\star _X)) , f(\star _X)) \end{equation*}

The fact that these maps cancel out follows immediately from the group laws on $G$ . This induces, after applying the appropriate set truncations, an equivalence $H^0(X,G) \simeq \widetilde {H}^0(X,G) \oplus G$ . The fact that it is an isomorphism is also trivial using the group laws on $G$ .

4.2 Eilenberg–Steenrod axioms for cohomology

In order to verify that our cohomology theory is sound, let us verify the Eilenberg–Steenrod Axioms (Eilenberg and Steenrod, Reference Eilenberg and Steenrod1952) for the reduced version of cohomology $\widetilde {H}^n(X,G)$ . These axioms have been studied previously in HoTT by Shulman (Reference Shulman2013); Cavallo (Reference Cavallo2015); Buchholtz and Hou (Favonia) (Reference Buchholtz and Hau (Favonia)2018); van Doorn (Reference van Doorn2018). To state the Exactness axiom, we need to introduce cofibres (also known as mapping cones).

Definition 37. Given a function $f : X \to Y$ , the cofibre of $f$ , denoted $\textsf{cofib}\,f$ , is pushout of the span $\unicode{x1D7D9} \leftarrow X \xrightarrow {f} Y$ . We will use the name ${\textsf{cfcod}}$ for the inclusion $\textsf{inr}: Y \to {\textsf{cofib}\,f}$ .

We will also need wedge sums.

Definition 38. Given a family of pointed types $X_i$ over an indexing type $I$ , the wedge sum of $X_i$ , denoted $\bigvee _i X_i$ , is the cofibre of the inclusion $j : I \to \Sigma _{i:I}X_i$ defined by $j(i) = (i,\star _{X_i})$ .

From a constructive point of view, we will primarily be interested in wedge sums indexed by a type satisfying the set-level axiom of choice (see, for instance, (Cavallo, Reference Cavallo2015, Section 3.2.3), (van Doorn, Reference van Doorn2018, Section 5.4), and (Buchholtz and Hou (Favonia) Reference Buchholtz and Hau (Favonia)2018, Section 6) for further discussions of this).

Definition 39. A type $I$ is said to satisfy the set-level axiom of choice ( $\textsf{AC}_0$ ) if for any family of types $X_i$ over $I$ , the canonical map

\begin{equation*} \lVert (i : I) \to X_i\rVert _0 \to \left ((i : I) \to \lVert X_i\rVert _0\right ) \end{equation*}

is an equivalence.

In particular, any finite set $I$ satisfies $\textsf{AC}_0$ . We may now state the Eilenberg–Steenrod axioms for reduced cohomology.

Definition 40. A $\mathbb{Z}$ -indexed family of contravariant functors $E^n : \mathcal{U}_\star \to \textsf{AbGroup}$ is said to be an ordinary, reduced cohomology theory if the following axioms hold.

  • Suspension: there is an isomorphism $E^n(X) \cong E^{n+1}(\Sigma \,X)$ natural in $X$ .

  • Exactness: given a function $f : X \to _\star Y$ , there is an exact sequence

    \begin{align*} E^n({\textsf{cofib}\,f}) \xrightarrow {E^n \,{{\textsf{cfcod}}}} E^n(Y) \xrightarrow {E^n\,f} E^n(X) \end{align*}
  • Dimension: for $n : \mathbb{Z}$ with $n \neq 0$ , we have $E^n(\mathbb{S}^0) \cong \unicode{x1D7D9}$ .

  • Additivity: for $n : \mathbb{Z}$ and a family of pointed types $X_i$ over a type $I$ satisfying $\textsf{AC}_0$ , the map $E^n(\bigvee _i X_i) \to \Pi _{i:I}(E^n(X_i))$ induced by the functorial action of $E^n$ on the inclusion $X_i \to \bigvee _{i:I} X_i$ is an isomorphism of groups.

The following theorem was originally proved in Book HoTT by Cavallo (Reference Cavallo2015). We spell out some of the details for our setup here. In what follows, let $\widetilde {H}^n(X,G) := \unicode {x1D7D9}$ for $n \lt 0$ .

Theorem 41. Given an abelian group $G$ , the reduced cohomology theory $\widetilde {H}^n(\!-,G)$ satisfies the Eilenberg–Steenrod Axioms.

Proof. We verify that $\widetilde {H}^n(\!-,G)$ satisfies the four axioms.

  • Suspension: this axiom is trivially satisfied when $n \lt -1$ . When $n = -1$ , we need to verify that $\widetilde {H}^0(\Sigma \,X,G)$ is trivial, which follows immediately by connectedness of $\Sigma \,X$ . For $n \geq 0$ , the suspension axiom follows immediately from the fact that $\Sigma$ and $\Omega$ are adjoint. We have

    \begin{align*} \widetilde {H}^{n+1}(\Sigma \,X,G) &= \lVert \Sigma X \to _\star K(G,n+1)\rVert _0 \\ &\simeq \lVert X \to _\star \Omega \,K(G,n+1)\rVert _0 \\ &\simeq \lVert X \to _\star K(G,n)\rVert _0 \\ &= \widetilde {H}^n(X,G) \end{align*}
    It is easy to see that the above equivalence of types is a homomorphism and is natural in $X$ . This concludes the proof of the suspension axiom.
  • Exactness: Let $f : X \to Y$ . We want to show that the sequence

    \begin{align*} \widetilde {H}^n({\textsf{cofib}\,f},G) \xrightarrow {{{\textsf{cfcod}}}^*} \widetilde {H}^n(Y,G) \xrightarrow {f^*} \widetilde {H}^n(X,G) \end{align*}
    is exact.Footnote 6 In other words, we want to show that, given an element $\lvert \,g\,\rvert : \widetilde {H}^n(Y,G)$ , we have $\lvert \,g\,\rvert \in \ker (f^*)$ iff $g \in \textsf{im}({{\textsf{cfcod}}}^*)$ . For the left-to-right implication, the assumption $\lvert \,g\,\rvert \in \ker (f^*)$ gives us a homotopyFootnote 7 $p : (x : X) \to 0_k = g(f(x))$ . Using this, we construct a function $g_{\textsf{cf}} : {\textsf{cofib}\,f} \to K(G,n)$ by
    \begin{align*} g_{\textsf{cf}}(\textsf{inl}\,{\star }) &= 0_k \\ g_{\textsf{cf}}(\textsf{inr}\,{y}) &= g(y) \\ \textsf{ap}_{g_{\textsf{cf}}}(\textsf{push}\,x) &= p(x) \end{align*}
    The fact that ${{\textsf{cfcod}}}^*(\lvert \,g_{\textsf{cf}}\,\rvert ) = \lvert \,g\,\rvert$ holds by construction, and hence $\lvert \,g\,\rvert \in \textsf{im}({{\textsf{cfcod}}}^*)$ .

    For the other direction, we simply want to show that the composition $f^* \circ {{\textsf{cfcod}}}^*$ is null-homotopic. This holds by construction, since ${{\textsf{cfcod}}} \circ f : X \to {\textsf{cofib}\,f}$ is null-homotopic by definition of $\textsf{cofib}\,f$ .

  • Dimension: when $n \lt 0$ , the statement is trivial. When $n \gt 0$ , we have

    \begin{align*} \widetilde {H}^n(\mathbb{S}^0,G) = \lVert \mathbb{S}^0 \to _\star K(G,n)\rVert _0 \simeq \lVert K(G,n)\rVert _0 \end{align*}
    Since $K(G,n)$ is $(n-1)$ -connected, $\lVert K(G,n)\rVert _0$ vanishes for $n \gt 0$ .
  • Additivity: Again, the statement is trivial when $n \lt 0$ . For the non-trivial case, the result follows from a simple rewriting of $\widetilde {H}^n(\bigvee _{i:I} X_i,G)$ using the elimination principle for $\bigvee _{i:I} X_i$ :

    \begin{align*} \widetilde {H}^n\left (\bigvee _{i:I} X_i,G\right ) &:= \bigg \Vert \bigvee _{i:I} X_i \to _\star K(G,n) \bigg \Vert _0 \\ &\simeq \Bigg \Vert \sum _{f : (\sum _{i:I} X_i) \to K(G,n)} \sum _{x_0 : K(G,n)} \left (((i : I) \to f(i,\star _{X_i}) = x_0) \times (x_0 = 0_k)\right ) \Bigg \Vert _0\\ &\simeq \Bigg \Vert \sum _{f : (\sum _{i:I} X_i) \to K(G,n)} \sum _{(x_0,p) : \sum _{x : K(G,n)} (x = 0_k)} \left ((i : I) \to f(i,\star _{X_i}) = x_0\right ) \Bigg \Vert _0\\ &\simeq \Bigg \Vert \sum _{f : (\sum _{i:I} X_i) \to K(G,n)} ((i : I) \to f(i,\star _{X_i}) = 0_k) \Bigg \Vert _0 \\ &\simeq \lVert (i : I) \to X_i \to _\star K(G,n)\rVert _0\\ &\simeq (i : I) \to \lVert X_i \to _\star K(G,n)\rVert _0 & (\textsf{AC}_0)\\ &= \Pi _{i:I}\widetilde {H}^n(X_i,G) \end{align*}
    where the step from the third to fourth line is simply a deletion of the (contractible) singleton type $\sum _{x : K(G,n)} (x = 0_k)$ . The fact that this composition of equivalences indeed gives the usual homomorphism $\widetilde {H}^n\left (\bigvee _{i:I} X_i,G\right ) \to \Pi _{i:I}\widetilde {H}^n(X_i,G)$ is immediate by construction.

Just like in traditional algebraic topology, many standard results and constructions follow directly from the axioms – see, for instance, (Cavallo, Reference Cavallo2015; Buchholtz and Hou (Favonia), Reference Buchholtz and Hau (Favonia)2018) for concrete examples, including the Mayer–Vietoris sequence (Cavallo, Reference Cavallo2015, Section 4.5).

4.3 The Mayer–Vietoris sequence

The Mayer–Vietoris sequence is surprisingly easy to construct in HoTT. It was first developed in HoTT by Cavallo (Reference Cavallo2015) for axiomatic cohomology theories and then for the specific $\mathbb{Z}$ -cohomology theory of Brunerie (Reference Brunerie2016) who constructed the sequence directly. This direct construction in no way depends on the use of $\mathbb{Z}$ -coefficients and the exact same proof translates to our theory. In this short section, we will briefly recall this construction. All notations are borrowed from Brunerie (Reference Brunerie2016).

Consider three types $X,Y,Z$ with functions $f : X \to Y$ and $g : X \to Z$ . Let $D$ denote the pushout of the span $Y \xleftarrow {f} X \xrightarrow {g} Z$ . There is a natural map $\widetilde {d} : (X \to K(G,n)) \to (D \to K(G,n+1))$ given by

\begin{align*} \widetilde {d}(\gamma )(\textsf{inl}\,{y}) &:= 0_k \\ \widetilde {d}(\gamma )(\textsf{inr}\,{z}) &:= 0_k \\ \textsf{ap}_{\widetilde {d}(\gamma )}(\textsf{push}\,{x}) &:= \sigma _n(\gamma (x)) \end{align*}

This lifts to a map $d : H^n(X,G) \to H^{n+1}(D,G)$ by $d(\lvert \,\gamma \,\rvert ) = \lvert \,\widetilde {d}(\gamma )\,\rvert$ . There is also a natural map $\Delta : H^{n}(Y) \times H^{n}(Z) \to H^n(X,G)$ given by

\begin{equation*} \Delta (\alpha ,\beta ) := f^*(\alpha ) -_h g^*(\beta ) \end{equation*}

Finally, we have a map $i : H^n(D,G) \to H^n(Y,G) \times H^n(Z,G)$ given by

\begin{equation*} i(\delta ) := (\textsf{inl}^*(\delta ), \textsf{inr}^*(\delta )) \end{equation*}

Theorem 42. (Mayer–Vietoris sequence). The families of functions $i$ , $\Delta$ and $d$ give rise to a long exact sequence on the form:

Proof. Straightforward generalisation of Brunerie (Reference Brunerie2016, Proposition 5.2.2).

This is useful to compute cohomology of spaces defined as pushouts, such as $\mathbb{C}P^2$ (see Section 5.4). Let us now consider another useful long exact sequence developed in HoTT by Brunerie (Reference Brunerie2016) known as the Gysin sequence.

4.4 The thom isomorphism and the Gysin sequence

Brunerie (Reference Brunerie2016) also introduced, for the first time in HoTT, the Thom isomorphism and the Gysin sequence. While Brunerie’s original constructions concerned integral cohomology, we may easily generalise them to cohomology with coefficients in an arbitrary commutative ring $R$ . In this short section, we will give a quick review of Brunerie’s proof/construction – here generalised to arbitrary coefficients (which has no major effect on the proofs).

Let $\alpha _n : \mathbb{S}^n \to _\star K(R,n)$ denote the image of $1_r : R$ under the equivalence

\begin{align*} R \simeq \Omega ^n K(R,n) \simeq (\mathbb{S}^n \to _\star K(R,n)) \end{align*}

This induces a family of equivalences $g^i : K(R,i) \to (\mathbb{S}^n \to _\star K(R,i + n))$ defined by

\begin{align*} g^i(x) := y\mapsto x \smile _k \alpha _n(y) \end{align*}

Now, let $B$ be a $0$ -connected, pointed type and suppose we have fibration $Q : B \to \textsf{Type}_\star$ with $\psi : Q(\star _B) \simeq _\star \mathbb{S}^n$ and a $B$ -indexed family of functions $c_b : Q(b) \to _\star K(R,n)$ with $c_{\star _B} = \alpha _n \circ \psi$ . We remark that such a family automatically exists when $B$ is further assumed to be $1$ -connected. We may use this to define a $B$ -relative version of $g^i$ :

\begin{align*} g_b^i &: K(R,i) \to (Q(b) \to _\star K(R,i+n))\\ g_b^i(x) &:= y \mapsto x \smile _k c_b(y) \end{align*}

Showing that this map is an equivalence is straightforward: for connectedness reasons, we only need to do so when $b$ is $\star _B$ , in which case we have $g_{\star _B}^i(x) = g^i(x) \circ \psi$ which we already know defines an equivalence.

The fact that $g_b^i$ is an equivalence means, in particular, that the following map is one too.

\begin{align*} \varphi ^i &: (B \to K(R,i)) \to ((b : B) \to Q(b) \to _\star K(R,i+n))\\ \varphi ^i(f) &:= (b,q \mapsto f(b) \smile c_b(q)) \end{align*}

We instantiate the above with some concrete spaces. Let $P : B \to \textsf{Type}$ be a fibration with $P(\star _B) \simeq \mathbb{S}^{n-1}$ and let $Q(b)$ be the suspension of $P(b)$ – in other words, let $Q(b) := \Sigma \,(P(b))$ . Suppose also that we have a family $c_b : (Q(b) \to _\star K(R,n))$ as above (again, this is automatic if $B$ is $1$ -connected). Let $E := \Sigma _{b:B}P(b)$ be the total space of $P$ and $\widetilde {E}$ be the associated Thom space or, in other words, the cofibre of the projection map $E \to B$ . It is easy to see that $((b : B) \to Q(b) \to _\star K(R,k)) \simeq (\widetilde {E} \to _\star K(R,k))$ . Combining this with $\varphi ^i$ , we get an isomorphism

\begin{align*} \phi ^i : H^i(B,R) \cong \widetilde {H}^{i+ n}(\widetilde {E},R) \end{align*}

Finally, we may consider the long exact sequence related to the pushout defining $\widetilde {E}$ (the first row in the following diagram). Substituting along $\phi ^{i-n}$ yields the Gysin sequence (the second row in the diagram).

Here the dashed arrow is defined as the composition $H^{i-1}(E,R) \to \widetilde {H}^i(\widetilde {E},R) \xrightarrow {(\phi ^{i-n})^{-1}} H^{i-n}(B,R)$ .

Above, the class $e : H^n(B,R)$ is defined by $e := \lvert \,b \mapsto c_b(\textsf{south})\,\rvert$ . The commutativity of the centre square follows immediately by construction of $\phi ^{i-n}$ . For the sake of completeness, let us state the existence of the Gysin sequence as a theorem.

Theorem 43. (The Gysin Sequence). Let $B$ be $0$ -connected and $P : B \to \textsf{Type}$ be a fibration equipped with an equivalence $\psi : P(\star _B) \simeq \mathbb{S}^{n-1}$ . Assume that the following condition is satisfied:

  • ( $\ast$ ) There is a $B$ -indexed family $c_b : \Sigma (P(b)) \to _\star K(R,{n})$ s.t. $c_{\star _{B}}$ is the image of $1_R : R$ under the composition of isomorphisms

    \begin{equation*} R \cong H^n(\mathbb{S}^n,R)\, \overset {(\Sigma (\psi ))^*}{\cong }\, H^n(\Sigma (P(\star _B)),R) \end{equation*}

Let $E$ denote the total space of $P$ and define $e : H^n(B,R)$ by $e := \lvert \,b \mapsto c_b(\textsf{south})\,\rvert$ . We get a long exact sequence

Moreover, condition ( $\ast$ ) is always satisfied when $B$ is $1$ -connected.

The Gysin sequence was for instance crucially used by Brunerie (Reference Brunerie2016) to compute the integral cohomology ring of $\mathbb{C}P^2$ (see also Section 5.4). We will also use this sequence to compute the cohomology ring of the infinite real projective space in Section 5.5.

5. Computations of Cohomology Groups and Rings

In this section, we will compute some cohomology groups and rings of some common spaces. All of these groups/rings will be very familiar to the traditional mathematician. Our intent is to showcase how these computations are carried out in HoTT. What is particularly interesting here is that the computations can often be done very directly, without relying on more general machinery (e.g., the Mayer–Vietoris sequence, spectral sequences, and so on). We have two reasons for preferring direct proofs whenever possible. Firstly, we think that the existence of such proofs in many cases showcases the strengths of the synthetic approach to cohomology theory in HoTT. Many proofs become incredibly short and rely solely on spelling out the computation rule for the space in question. In particular, we can carry out these proofs without any homological algebra. Secondly, by carefully choosing the direct proofs, we often produce proof terms which are far simpler than those produced by more advanced machinery. This means that we can use the isomorphisms we construct here to make concrete computations (i.e., normalisation of closed terms) in a constructive proof assistant such as Cubical Agda. We will discuss this more in Section 6.

Let us start by computing the cohomology groups of some special types.

Proposition 44. $H^n(\unicode {x1D7D9},G) \cong \begin{cases} G & n = 0 \\ \unicode {x1D7D9} & n \geq 1 \end{cases}$

Proof. We have $H^n(\unicode {x1D7D9}) := \lVert \unicode {x1D7D9} \to K(G,n)\rVert _0 \simeq \lVert K(G,n)\rVert _0$ . This is $\lVert G\rVert _0 \simeq G$ when $n = 0$ and contractible when $n \gt 0$ since $K(G,n)$ is $(n-1)$ -connected.

We also include note the following easy lemma

Lemma 45. For any type $X$ , we have $H^n(X,G) \cong H^n(\lVert X\rVert _n,G)$ .

Proof. Using that $K(G,n)$ is $n$ -truncated, we get, by the universal property of $n$ -truncation, that

\begin{align*} H^n(X,G) = \lVert X \to K(G,n)\rVert _0 \simeq \lVert \lVert X\rVert _n \to K(G,n)\rVert _0 = H^n(\lVert X\rVert _n,G) \end{align*}

The fact that this equivalence is a homomorphism is trivial.

Using this we can easily compute the zeroth cohomology group of a $0$ -connected type (and hence, any $n$ -connected type with $n \geq 0$ ).

Proposition 46. For any $0$ -connected type $X$ , we have $H^0(X,G) \cong G$ .

Proof. By Lemma 45, we have $H^0(X,G) = H^0(\lVert X\rVert _0,G)$ . But $\lVert X\rVert _0 \simeq \unicode {x1D7D9}$ since $X$ is $0$ -connected. Thus, by Proposition 44, the zeroth cohomology group is isomorphic to $G$ .

5.1 Spheres

We now have what we need to compute the cohomology of the $n$ -sphere. Let us start with $n = 1$ .

Proposition 47. $H^1(\mathbb{S}^1,G) \cong G$ .

Proof. A function $\mathbb{S}^1 \to K(G,1)$ is uniquely determined by its action on the canonical base point and the canonical loop. Hence, it corresponds to choices of a point $x : K(G,1)$ and a loop $x = x$ . In other words, $(\mathbb{S}^1 \to K(G,1)) \simeq \Sigma _{x : K(G,1)} (x = x)$ . But $K(G,1)$ is homogeneous, so $(x = x) \simeq \Omega K(G,1)$ . Thus, we have

\begin{align*} H^1(\mathbb{S}^1,G) &= \lVert \mathbb{S}^1 \to K(G,1)\rVert _0 \\ &\simeq \lVert \Sigma _{x : K(G,1)} (x = x)\rVert _0\\ &\simeq \lVert K(G,1) \times \Omega K(G,1)\rVert _0 \\ &\simeq \lVert K(G,1)\rVert _0 \times G \end{align*}

Now, $K(G,1)$ is $0$ -connected, so $\lVert K(G,1)\rVert _0$ vanishes. Thus, we have $H^1(\mathbb{S}^1,G) \simeq G$ .

We need to verify that this isomorphism is a homomorphism. It is easier to show that its inverse is. Let us call it $\phi$ . By definition, $\phi (g) = \lvert \,f_g\,\rvert$ where $f_g : \mathbb{S}^1 \to K(G,1)$ is the map sending $\textsf{base}$ to $\star$ and $\textsf{loop}$ to $\textsf{loop}_k\,{g}$ . Thus, we only need to verify that for $g_1,g_2 : G$ and $x : \mathbb{S}^1$ , we have $f_{g_1}(x) +_k f_{g_2}(x) = f_{g_1 + g_2}(x)$ . We do this by induction on $x$ . When $x$ is $\textsf{base}$ , the goal holds by $\textsf{refl}$ . For the action on $\textsf{loop}$ , we need to show that

\begin{align*} \textsf{ap}^{2}_{+_k}({\textsf{loop}_k\,{g_1}},{\textsf{loop}_k\,{g_2}}) = {\textsf{loop}_k\,{(g_1 + g_2)}} \end{align*}

which holds by Proposition 16 and functoriality of $\textsf{loop}_k\,{}$ .

It is easy to generalise this to get all non-trivial cohomology groups of $\mathbb{S}^n$ for $n \geq 1$ .

Proposition 48. For $n \geq 1$ , we have $H^n(\mathbb{S}^n,G) \cong G$ .

Proof. The case $n = 1$ is Proposition 47. For $n \gt 1$ , we simply apply the suspension isomorphism inductively.

The vanishing groups can also be handled directly.

Proposition 49. For $n \neq m$ and $n \geq 1$ have $H^n(\mathbb{S}^m,G) \cong \unicode {x1D7D9}$ .

Proof. Let us first consider the case $n \gt m$ . We induct on $m$ . When $m = 0$ , we have

\begin{align*} H^n(\mathbb{S}^0) = \lVert \mathbb{S}^0 \to K(G,n)\rVert _0 \simeq \lVert K(G,n) \times K(G,n)\rVert _0 \end{align*}

which vanishes since $K(G,n)$ is $(n-1)$ -connected and $n \gt m = 0$ . For larger $m$ , we know by suspension that $H^n(\mathbb{S}^m) \cong H^{n-1}(\mathbb{S}^{m-1})$ which vanishes by the induction hypothesis.

When $n\lt m$ we have

\begin{align*} H^n(\mathbb{S}^m,G) \simeq H^n(\lVert \mathbb{S}^m\rVert _n,G) \end{align*}

which vanishes because $\mathbb{S}^m$ is $n \leq (m-1)$ -connected and $n \geq 1$ .

Knowing these groups, the cohomology ring of the spheres is easily computed.

Proposition 50. Given any ring $R$ and $n \geq 1$ , we have $H^*(\mathbb{S}^n,R) \cong R[x]/(x^2)$ .

Proof. The only non-trivial cohomology groups are $H^0(\mathbb{S}^n,R) \cong H^n(\mathbb{S}^n,R) \cong R$ . Thus, the cup product can only be non-trivial in dimensions $0 \times n$ and $n \times 0$ . In these dimension, the cup product is simply left respectively right $R$ -multiplication. This gives the desired isomorphism by letting constants in $H^*(\mathbb{S}^n,R)$ represent elements coming from $H^0(\mathbb{S}^n,R)$ and elements of degree one represent elements coming from $H^n(\mathbb{S}^n,R)$ .

5.2 The torus

Now that we know the cohomology of spheres, let us investigate something slightly more advanced: the torus.

Definition 51. (The torus). We define $\mathbb{T}^2$ as the HIT generated by the following constructors:

  • $\star : \mathbb{T}^2$

  • $\ell _1,\ell _2 : \star = \star$

  • $\textsf{sq} : {l_2 =_{l_1}^{l_1} l_2}$ – that is, a filler of the square:

It is well-known that $\mathbb{T}^2 \simeq \mathbb{S}^{1} \times \mathbb{S}^1$ .Footnote 8 We will see that this fact makes the computation of the cohomology groups of $\mathbb{T}^2$ rather direct. We follow the proof strategy of Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022, Propositions 20–21), which directly translates from integral cohomology to our setting.

Proposition 52.

\begin{equation*} H^n(\mathbb{T}^2,G) \cong \begin{cases} G & \text{ if $n=0$ or $n=2$} \\ G \times G & \text{ if $n=1$}\\ \unicode {x1D7D9} & \text{ otherwise} \end{cases} \end{equation*}

Proof. The case when $n=0$ follows by Proposition 46 since $\mathbb{T}^2$ is $0$ -connected. For the case $n \geq 1$ , let us inspect the underlying function space of $H^n(\mathbb{T}^2 , G)$ . We have

\begin{align*} (\mathbb{T}^2 \to K(G,n)) &\simeq (\mathbb{S}^1 \times \mathbb{S}^1 \to K(G,n)) \\ &\simeq \mathbb{S}^1 \to (\mathbb{S}^1 \to K(G,n)) \\ &\simeq \sum _{f :\,\mathbb{S}^1\to K(G,n)} (f = f)\\ &\simeq \sum _{f :\,\mathbb{S}^1\to K(G,n)} ((x : \mathbb{S}^1) \to \Omega (K(G,n) , f(x)))\\ &\simeq (\mathbb{S}^1\to K(G,n)) \times (\mathbb{S}^1 \to \Omega (K(G,n)))\\ &\simeq (\mathbb{S}^1\to K(G,n)) \times (\mathbb{S}^1 \to K(G,n-1))\\ \end{align*}

where the step from line 3 to 4 is function extensionality and the step from lines 4 to 5 follows by homogeneity of $K(G,n)$ . Under set truncation, the last type in this chain of equivalences is simply $H^n(S^1,G) \times H^{n-1}(S^1,G)$ , which we know from Section 5.1 is simply $G \times G$ when $n = 1$ , $G$ when $n = 2$ , and trivial for higher $n$ . The fact that this map is a homomorphism follows by a similar argument to that of the corresponding statement in the proof of Proposition 47.

5.3 The real projective plane and the Klein bottle

Let us consider two somewhat more complex (but closely related) examples: the real projective plane and the Klein bottle. In HoTT, we define the real projective plane, $\mathbb{R}P^2$ , and the Klein bottle, $K^2$ , by HITs corresponding to their usual folding diagrams:

Definition 53. (The real project plane). We define $\mathbb{R}P^2$ as the HIT generated by the following constructors:

  • $\star : \mathbb{R}P^2$

  • $\ell : \star = \star$

  • $\textsf{sq} : \ell ^{-1} = \ell$ – that is, a filler of the square:

Definition 54. (The Klein bottle). We define $K^2$ as the HIT generated by the following constructors:

  • $\star : K^2$

  • $\ell _1,\ell _2 : \star = \star$

  • $\textsf{sq} : {l_2 =_{l_1}^{l_1^{-1}} l_2}$ – that is, a filler of the square:

Let us first tackle the cohomology of $\mathbb{R}P^2$ . It is an easy lemma that $\mathbb{R}P^2$ is $0$ -connected, and hence $H^0({\mathbb{R}P^2},G) \cong G$ . In order to compute its higher cohomology groups, we will need to introduce some new constructions: for an abelian group $G$ and an integer $n \geq 0$ , let $G[n]$ denote the $n$ -torsion subgroup of $G$ or, in other words, the kernel of the map $n \cdot (\!-\!) : G \to G$ . Let $G/n$ denote the cokernel of the same homomorphism – that is, the group $G/\sim$ where $\sim$ is the relation $x^n = 0$ . We denote the quotient map $G \to G/n$ by $[\!-\!]$ .

Proposition 55. $H^1(\mathbb{R}P^2,G) \cong G[2]$ .

Proof. The elimination principle for $\mathbb{R}P^2$ tells us that

\begin{equation*}({\mathbb{R}P^2} \to K(G,1)) \simeq \sum _{x : K(G,1)}\sum _{p : x = x} (p^{-1} = p) \simeq \sum _{x : K(G,1)}\sum _{p : x = x} (p \cdot p = \textsf{refl}) \end{equation*}

Since $K(G,n)$ is homogeneous, this is equivalent to the type

\begin{equation*}{K(G,1)} \times \sum _{p : \Omega K(G,1)} (p \cdot p = \textsf{refl}) \end{equation*}

which under the equivalence $\Omega K(G,1) \simeq G$ is equivalent to the type

\begin{equation*}{K(G,1)} \times \sum _{g : G} (g + g = 0_G) \end{equation*}

or, in other words, $K(G,1) \times G[2]$ . Thus, we get

\begin{align*} H^1({\mathbb{R}P^2},G) = \lVert {\mathbb{R}P^2} \to K(G,1)\rVert _0 &\simeq \lVert K(G,1) \times G[2] \rVert _0 \\ &\simeq \lVert K(G,1)\rVert _0 \times G[2] \\ &\simeq G[2] \end{align*}

We verify that the inverse of this equivalence is a homomorphism. The inverse $\psi : G[2] \to H^1({\mathbb{R}P^2},G)$ is given by $\psi (g) = f_g$ where $f_g : {\mathbb{R}P^2} \to K(G,1)$ sends $\star$ to $0_k$ and $\ell$ to $\textsf{loop}_k\,{g}$ . We do not need to worry about its action on $\textsf{sq}$ : for truncation reasons, this is not data but a property. We need to verify that $f_{g_1+g_2}(x) = f_{g_1}(x) +_k f_{g_2}(x)$ for $x : {\mathbb{R}P^2}$ and $g_1,g_2 : G$ . When $x$ is $\star$ , this holds by $\textsf{refl}$ . For the action on $\ell$ , we need to verify that

\begin{align*} {\textsf{loop}_k\,{(g_1+g_2)}} = \textsf{ap}^{2}_{+_k}({\textsf{loop}_k\,{g_1}},{\textsf{loop}_k\,{g_2}}) \end{align*}

which we already verified in the proof of Proposition 47. This concludes the proof.

Proposition 56. $H^2({\mathbb{R}P^2},G) \cong G/2$ .

Proof. Like in the proof of Proposition 55, we have

\begin{align*} ({\mathbb{R}P^2} \to K(G,2)) &\simeq \sum _{x : K(G,2)}\sum _{p : x = x} {p \cdot p = \textsf{refl}} \\ &\simeq K(G,2) \times \sum _{p : \Omega K(G,2)} {p \cdot p = \textsf{refl}} \\ &\simeq K(G,2) \times \sum _{x : K(G,1)}{x +_k x = 0_k} \end{align*}

Under set truncation, the $K(G,2)$ -component vanishes which leaves us with the type $\lVert \sum _{x : K(G,1)}{x +_k x = 0_k}\rVert _0$ . Let us construct a map $\phi : \lVert \sum _{x : K(G,1)}{x +_k x = 0_k}\rVert _0 \to G/2$ by means of a curried map $\phi _x : x +_k x = 0_k \to G/2$ depending on $x : K(G,1)$ . We may define it by the set-elimination rule for $K(G,1)$ . When $x$ is $0_k$ , what is desired is a map $\phi _{\star } : \Omega K(G,1) \to G/2$ . This map may simply be defined by $\phi _{\star } := [\!-\!] \circ \sigma _0^{-1}$ . We now need to describe the action on $\textsf{loop}_k\,{g}$ . This amounts to providing a path $[g] = [g' + g + g']$ , which of course trivially exists in $G/2$ . This defines $\phi (\lvert \,x,p\,\rvert ) := \phi _x(p)$ .

The inverse $\psi : G/2 \to \lVert \Sigma _{x : K(G,1)} (x+_k x = 0_k)\rVert _0$ is defined on canonical elements by $\psi [g] = (0_k,{\textsf{loop}_k\,{g}})$ . In order to show that this is well-defined, we need to show that

\begin{align*} \lvert \,(0_k, \textsf{refl})\,\rvert = \lvert \,(0_k,{\textsf{loop}_k\,{(g+_G g)}})\,\rvert \end{align*}

This is done component-wise. For first component, we need to provide a path $0_k = 0_k$ . In fact, the right choice here is not $\textsf{refl}$ but instead $\textsf{loop}_k\,{g}$ . Showing that the second components agree now amounts to providing a filler of the square

which, in turn, is equivalent to proving that ${\textsf{loop}_k\,{(g +_G g)}} = \textsf{ap}^{2}_{+_k}({\textsf{loop}_k\,{g}},{\textsf{loop}_k\,{g}})$ , which we have already done in the proofs of Propositions 47 and 55.

Finally, let us prove that the maps cancel. Verifying that $\phi (\psi (x)) = x$ for $x:G/2$ is very direct: since the statement is a proposition, it suffices to this when $x$ is on the form $[g]$ . In this case, we have $\phi (\psi [g]) := \phi _{0_k}({\textsf{loop}_k\,{g}}) := \sigma _0^{-1}(\sigma _0(g)) = g$ .

For the other direction, the fact that we are proving a proposition means that it suffices to show the cancellation for elements of $\lVert \Sigma _{x : K(G,1)} (x +_k x = 0_k)\rVert _0$ on the form $\lvert \,(0_k,p)\,\rvert$ with $p : \Omega K(G,1)$ . We get $\psi (\phi \,\lvert \,0_k,p\,\rvert ) := \psi (\sigma _0^{-1}(p)) = \lvert \,0_k,\sigma _0(\sigma _0^{-1}(p))\,\rvert = \lvert \,0_k,p\,\rvert$ . Thus, we have shown:

\begin{align*} H^2({\mathbb{R}P^2},G) &\simeq \bigg \Vert K(G,2) \times \sum _{x : K(G,1)}{x +_k x = 0_k} \bigg \Vert _0 \\ &\simeq \bigg \Vert \sum _{x : K(G,1)}{x +_k x = 0_k} \bigg \Vert _0\\ &\simeq G/2 \end{align*}

The argument for why this equivalence is a homomorphism is technical but similar to the argument given in previous proofs.

Proposition 57. $H^n({\mathbb{R}P^2},G)$ is trivial for $n \gt 2$ .

Proof. As we have seen in the two previous proofs:

\begin{align*} H^n({\mathbb{R}P^2},G) &\simeq \bigg \Vert K(G,n) \times \sum _{x : K(G,n-1)} x +_k x = 0_k \bigg \Vert _0 \\ &\simeq \bigg \Vert \sum _{x : K(G,n-1)} x +_k x = 0_k \bigg \Vert _0 \end{align*}

We may move in the truncation one step further to get

\begin{align*} \bigg \Vert \sum _{x : K(G,n-1)} \lVert x +_k x = 0_k\rVert _0\bigg \Vert _0 \end{align*}

Since $n \gt 2$ , any path space over $K(G,n-1)$ is (at least) $0$ -connected. Thus, the truncation kills the space $(x +_k x = 0_k)$ . Hence, the above type is simply $\lVert K(G,n-1)\rVert _0$ , which also vanishes due to connectedness.

This gives us all the cohomology groups of $\mathbb{R}P^2$ . We will now see how this, in a rather direct way, gives us all the cohomology groups of $K^2$ as well. Trivially, $H^0(K^2,G) \cong G$ for connectedness reasons.

Proposition 58. $H^n(K^2,G) \cong \begin{cases} H^n({\mathbb{R}P^2},G) & n \neq 1 \\ G \times H^1({\mathbb{R}P^2},G) & n = 1 \end{cases}$

Proof. Consider the function space $(K^2 \to K(G,n))$ :

\begin{align*} (K^2 \to K(G,n)) \simeq \sum _{x : K(G,n)}\sum _{p,q: x = x}(p \cdot q \cdot p = q) \end{align*}

Again, we may use homogeneity of $K(G,n)$ to show that this is equivalent to the type

\begin{equation*}K(G,n) \times \sum _{p,q: \Omega K(G,n)}(p \cdot q \cdot p = q)\end{equation*}

We now consider the path space $p \cdot q \cdot p = q$ for $p,q : \Omega K(G,n)$ . By commutativity of $\Omega \,K(G,n)$ , composing both sides by $q^{-1}$ will cancel out $q$ everywhere. Thus, the type is simply $p\cdot p = \textsf{refl}$ . Hence, we have

\begin{align*} H^n(K^2,G) &:= \lVert K^2 \to K(G,n)\rVert _0 \\ &\simeq \bigg \Vert K(G,n) \times \Omega K(G,n) \times \sum _{p : \Omega K(G,n)} (p \cdot p \equiv \textsf{refl})\bigg \Vert _0 \end{align*}

Excluding the $\Omega K(G,n)$ component, this is precisely the characterisation of $H^n({\mathbb{R}P^2},G)$ . Thus, the above type is equivalent to

\begin{align*} \lVert \Omega K(G,n)\rVert _0 \times H^n({\mathbb{R}P^2},G) \end{align*}

The factor $\lVert \Omega K(G,n)\rVert _0$ vanishes for $n \gt 1$ . When $n = 1$ , we have $\lVert \Omega K(G,1)\rVert _0 \simeq \lVert G\rVert _0 \simeq G$ . Verifying that this is a homomorphism is straightforward but somewhat technical.

Computing the integral cohomology ring of $\mathbb{R}P^2$ is straightforward. Naturally, the following proposition easily generalises to $H^*({\mathbb{R}P^2},R)$ for any $2$ -torsion free ring $R$ .

Proposition 59. $H^*({\mathbb{R}P^2},\mathbb{Z}) \cong \mathbb{Z}[x]/(2x,x^2)$ .

Proof. By Proposition 55, we have $H^1({\mathbb{R}P^2},\mathbb{Z}) \cong \mathbb{Z}[2]$ . Since $\mathbb{Z}$ has no non-trivial torsion elements, this tells us that $H^1({\mathbb{R}P^2},\mathbb{Z})$ is trivial. Hence, we only have as non-trivial cohomology groups the groups $H^0({\mathbb{R}P^2},\mathbb{Z}) \cong \mathbb{Z}$ and $H^2({\mathbb{R}P^2},\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}$ . The proof now proceeds just like that of Proposition 50, representing elements from $H^0({\mathbb{R}P^2},\mathbb{Z})$ and elements from $H^2({\mathbb{R}P^2},\mathbb{Z})$ respectively by degree- $0$ and degree- $1$ elements in $H^*({\mathbb{R}P^2},\mathbb{Z})$ . The $2x$ -quotient comes from the $2$ -torsion in $H^2({\mathbb{R}P^2},\mathbb{Z})$ .

Let us now turn to the Klein bottle. For the coming results, the following construction will be crucial.

Definition 60. There is a homotopy

\begin{equation*}{\textsf{kill-}\Delta } : (p : \Omega K(G,n)) \to \textsf{ap}^{2}_{\smile _k}(p,p) = 0_k\end{equation*}

defined by the composite path

Here $h(p)$ is given by pointwise application of the right and left annihilation laws for $\smile _k$ using that they agree on $0_k$ .

We will rely on this construction to kill off certain cup products on $\mathbb{R}P^2$ and $K^2$ . For instance, it makes the following computation easy.

Proposition 61. $H^*(K^2,\mathbb{Z}) \cong \mathbb{Z}[x,y]/(2y,x^2,y^2,xy)$ .

Proof. Using Proposition 58 and the preceding results, we know that the only non-trivial cohomology groups of $K^2$ are

\begin{align*} H^0(K^2,\mathbb{Z}) &\cong \mathbb{Z} \\ H^1(K^2,\mathbb{Z}) &\cong \mathbb{Z} \times \mathbb{Z}[2] \cong \mathbb{Z} \\ H^2(K^2,\mathbb{Z}) & \cong \mathbb{Z}/2\mathbb{Z} \end{align*}

Consider first the ring $\mathbb{Z}[x,y]$ . Using the above isomorphisms, we may naively let degree- $0$ elements in $\mathbb{Z}[x,y]$ represent elements from $H^0(K^2,\mathbb{Z})$ , degree- $1$ elements with $x$ -term represent elements from $H^1(K^2,\mathbb{Z})$ and degree- $1$ elements with $y$ term represent elements from $H^2(K^2 ,\mathbb{Z})$ . Under this identification, we see that the relations described by the ideal $(2y,xy,y^2)$ are satisfied. Hence, we have a map $\mathbb{Z}[x,y]/(2y,xy,y^2) \to H^1(K^2,\mathbb{Z})$ . In order to lift this to an isomorphism $\mathbb{Z}[x,y]/(2y,x^2,y^2,xy) \cong H^*(K^2,\mathbb{Z})$ , we need to show that the cup product is trivial in dimension $1 \times 1$ . It suffices to show that it vanishes on generators. We can easily define a map $\alpha : K^2 \to K(1,\mathbb{Z})$ such that $\lvert \,\alpha \,\rvert$ generates $H^1(K^2,\mathbb{Z})$ . We define it by

\begin{align*} \alpha (\star ) &:= 0_k \\ \textsf{ap}_{\alpha }(\ell _1) &:= \textsf{refl} \\ \textsf{ap}_{\alpha }(\ell _2) &:= {\textsf{loop}_k\,{1}} \end{align*}

where, $1 : \mathbb{Z}$ denotes the generator. The final step of the definition – the action of $\alpha$ on $\textsf{sq}$ – corresponds to providing a proof that ${\textsf{loop}_k\,{1}} = {\textsf{loop}_k\,{1}}$ , which we do by $\textsf{refl}$ . Let $x : K^2$ . We show that $\alpha (x) \smile _k \alpha (x) = 0_k$ by induction on $x$ . We prove $\alpha (\star )\smile _k \alpha (\star ) = 0_k$ by $\textsf{refl}$ and $\textsf{ap}^{2}_{\smile _k}(\textsf{ap}_{\alpha }(\ell _2),\textsf{ap}_{\alpha }(\ell _2)) = \textsf{refl}$ by $\textsf{refl}$ . For $\textsf{ap}^{2}_{\smile _k}(\textsf{ap}_{\alpha }(\ell _1),\textsf{ap}_{\alpha }(\ell _1))$ , we need to provide a path $\textsf{ap}^{2}_{\smile _k}({\textsf{loop}_k\,{1}},{\textsf{loop}_k\,{1}}) = \textsf{refl}$ , which we give by ${\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}})$ . Finally, for the action of $\textsf{sq}$ , we need to provide a filler of the square

which is trivial. Thus, we have shown, in particular, that $\lvert \,\alpha \,\rvert \smile \lvert \,\alpha \,\rvert$ is trivial, which means that $\smile$ vanishes everywhere in dimension $1 \times 1$ . This concludes the proof.

Let us now turn to the $\mathbb{Z}/2\mathbb{Z}$ -cohomology of $K^2$ and $\mathbb{R}P^2$ . When working in $\mathbb{Z}/2\mathbb{Z}$ -coefficients, it turns out that we will need to investigate $\textsf{kill-}\Delta$ further. In particular, it turns out that applying $\textsf{kill-}\Delta$ may give rise to non-trivial homotopies. In particular, the twist in $\mathbb{R}P^2$ and $K^2$ will force us to investigate how much $\textsf{kill-}\Delta$ commutes with path inversion in the sense that there exists a loop $q : \Omega ^2 K(\mathbb{Z}/2\mathbb{Z},2n)$ solving the following square filling problem

We remark that the only case of interest to us is the case $n = 1$ , due to the vanishing of higher homotopy groups. We will need the following construction.

Definition 62. Given two points $x ,y : A$ and a binary function $F : A \to A \to B$ , we construct the homotopy

\begin{equation*} \textsf{Res}_F : (p : x = y) \to (\textsf{ap}_{F(\!-,y)}(p^{-1}) \cdot \textsf{ap}_{F(x,-)}(p^{-1}))^{-1} = \textsf{ap}_{F(\!-,x)}(p) \cdot \textsf{ap}_{F(y,-)}(p)\end{equation*}

by the outer square of the following composite square

where all the outermost squares are given by their obvious fillers.

The following lemma is immediate by path induction.

Lemma 63. For any point $x: A$ and $F : A \to A \to B$ , we have $\textsf{Res}_F(\textsf{refl}_{x}) = \textsf{refl}$ .

The usefulness of $\textsf{Res}$ is that it measures how much $\textsf{ap}^2_F\textsf {-funct}$ fails commute with path inversion, as made clear by the following lemma.

Lemma 64. Given a binary function $F : A \to A \to B$ and a path $p : x =_A y$ , we have a filler

where the left-most path is the obvious coherence (defined by path induction in Book HoTT and simply by $\textsf{refl}$ in cubical type theory).

Proof. Path induction on $p$ .

What is rather surprising is that $\textsf{Res}_F(p)$ is not just a mere coherence path: it may be homotopically non-trivial when $p$ is a loop. In particular, when $p$ is ${\textsf{loop}_k\,{1}} : \Omega K(G,1)$ and $F$ is the cup product $\smile _k : K(\mathbb{Z}/2\mathbb{Z},1) \to K(\mathbb{Z}/2\mathbb{Z},1) \to K(\mathbb{Z}/2\mathbb{Z},2)$ , the inner square in Definition 62 is, modulo cancellation laws, precisely the two-cell $\sigma ^2(1) : \Omega ^2 K(\mathbb{Z}/2\mathbb{Z},2)$ (here $\sigma ^2$ is shorthand for $\textsf{ap}_{\sigma _1}\circ \sigma _0 : K(\mathbb{Z}/2\mathbb{Z},0) \to \Omega ^2 K(\mathbb{Z}/2\mathbb{Z},2)$ ). This follows directly by construction of the cup product. Hence we arrive at the following lemma, which is key to analysing the behaviour of the cup product on $\mathbb{R}P^2$ and $K^2$ .

Lemma 65. We have a filler of the following square

We may now characterise the cup product on the cohomology groups of $\mathbb{R}P^2$ and $K^2$ with $\mathbb{Z}/2\mathbb{Z}$ coefficients. In fact, Lemma 65 is the only technical lemma we will need, and we do not need to rely on any other advanced theorems/constructions. Let us start with $\mathbb{R}P^2$ .

Proposition 66. The following diagram commutes

Proof. It is enough to show that $\lvert \,\alpha \,\rvert \smile \lvert \,\alpha \,\rvert = \lvert \,\beta \,\rvert$ for generators $\alpha : {\mathbb{R}P^2} \to K(\mathbb{Z}/2\mathbb{Z},1)$ and $\beta : {\mathbb{R}P^2} \to K(\mathbb{Z}/2\mathbb{Z},2)$ . We define $\alpha$ by

\begin{align*} \alpha (\star ) &:= 0_k \\ \textsf{ap}_{\alpha }(\ell ) &:= {\textsf{loop}_k\,{1}} \\ \textsf{ap}_{\textsf{ap}_{\alpha }}(\textsf{sq}) &:= Q({\textsf{loop}_k\,{1}}) \end{align*}

where $Q : (p : \Omega \,K(\mathbb{Z}/2\mathbb{Z},1) \to p = p^{-1}$ is given by the $2$ -torsion in $K(\mathbb{Z}/2\mathbb{Z},n)$ (its explicit construction is irrelevant for our purposes). We define $\beta$ by

\begin{align*} \alpha (\star ) &:= 0_k \\ \textsf{ap}_{\beta }(\ell ) &:= \textsf{refl} \\ \textsf{ap}_{\textsf{ap}_{\beta }}(\textsf{sq}) &:= \sigma ^2(1) \end{align*}

where $\sigma ^2 : \mathbb{Z}/2\mathbb{Z} \xrightarrow {\sim } \Omega ^2 K(\mathbb{Z}/2\mathbb{Z},2)$ . The fact that $\alpha$ and $\beta$ define generators on cohomology is straightforward by the constructions in the proofs of Propositions 55 and 56. We now provide a homotopy $h : (x : {\mathbb{R}P^2}) \to \alpha (x) \smile _k\alpha (x) = \beta (x)$ . We define

\begin{align*} h(\star ) &:= \textsf{refl}\\ \textsf{ap}_{h}(\ell ) &:= {\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}}) \end{align*}

For the action of $h$ on $\textsf{sq}$ , we need to provide a filler of the following square of paths.

The bottom path acts on the right-hand path by moving in a path inversion around $\textsf{loop}_k\,{1}$ . Hence, our new square filling problem is

But this is precisely Lemma 65, and we are done.

As an immediate corollary, we get the cohomology ring of $\mathbb{R}P^2$ with $\mathbb{Z}/2\mathbb{Z}$ -coefficients.

Proposition 67. $H^*({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}[x]/(x^3)$ .

Proof. We simply let elements in $H^n({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z})$ correspond to degree- $n$ elements in $H^*({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z})$ . By Proposition 66, we know that the multiplicative structure on $H^*({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z})$ is regular $\mathbb{Z}/2\mathbb{Z}$ -multiplication, which proves statement.

Let us now turn to the Klein bottle. Although the cohomology ring structure is different, we may still make use of the above. We start by considering its multiplicative structure. First, we construct the generators $\alpha ,\beta : K^2 \to K(\mathbb{Z}/2\mathbb{Z},1)$ by

\begin{align*}\begin{array}{r@{\kern2pt}l@{\kern+36pt}r@{\kern2pt}l}\alpha (\star ) &:= 0_k & \beta (\star ) &:= 0_k\\ \textsf{ap}_{\alpha }(\ell _1) &:= {\textsf{loop}_k\,{1}} & \textsf{ap}_{\beta }(\ell _1) &:= \textsf{refl} \\ \textsf{ap}_{\alpha }(\ell _2) &:= \textsf{refl} & \textsf{ap}_{\beta }(\ell _2) &:= {\textsf{loop}_k\,{1}} \\ \textsf{ap}_{\textsf{ap}_\alpha }(\textsf{sq})& := \textsf{flip}(\textsf{refl}_{{\textsf{loop}_k\,{1}}}) & \textsf{ap}_{\textsf{ap}_\beta }(\textsf{sq}) &:= \textsf{refl}_{{\textsf{loop}_k\,{1}}}\end{array}\end{align*}

It is immediate by construction that the isomorphism $H^1(K^2,\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ takes $\lvert \,\alpha \,\rvert$ to $(1,0)$ and $\lvert \,\beta \,\rvert$ to $(0,1)$ . The single generator of $H^2(K^2,\mathbb{Z}/2\mathbb{Z})$ is given by $\gamma : K^2 \to K(\mathbb{Z}/2\mathbb{Z},2)$ :

\begin{align*} \gamma (\star ) &:= 0_k \\ \textsf{ap}_{\gamma }(\ell _1) &:= \textsf{refl} \\ \textsf{ap}_{\gamma }(\ell _2) &:= \textsf{refl} \\ \textsf{ap}_{\textsf{ap}_\gamma }(\textsf{sq}) &:= \sigma ^2(1) \end{align*}

It again follows by construction that the isomorphism $H^2(K^2,\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}$ takes $\lvert \,\gamma \,\rvert$ to $1$ .

Proposition 68. We have the following relations in $H^*(K^2,\mathbb{Z}/2\mathbb{Z})$

\begin{align*} \lvert \,\alpha \,\rvert ^2 = \gamma \hspace {3cm} \lvert \,\alpha \,\rvert \smile \lvert \,\beta \,\rvert = \gamma \hspace {3cm} \lvert \,\beta \,\rvert ^2 = 0_h \end{align*}

Proof. Let us deal with the identities from right to left, in increasing difficulty. Showing that $\beta ^2 = 0_h$ is easy. First, we construct a homotopy $f : (x : K^2) \to \beta (x) \smile _k \beta (x) = 0_k$ by induction on $x$ .

\begin{align*} f(\star ) &:= \textsf{refl} \\ \textsf{ap}_{f}(\ell _1) &:= \textsf{refl} \\ \textsf{ap}_{f}(\ell _2) &:= {\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}}) \end{align*}

For the action on $\textsf{sq}$ , we are reduced to simply providing a path ${\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}}) = {\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}})$ , which we can by $\textsf{refl}$ . This gives us, in particular, that $\lvert \,\beta \,\rvert ^2 = 0_h$ .

Let us now provide a homotopy $g : (x : K^2) \to \alpha (x) \smile _k \beta (x) = \gamma (x)$ . We again proceed by $K^2$ -induction.

\begin{align*} g(\star ) &:= \textsf{refl} \\ \textsf{ap}_{g}(\ell _1) &:= \textsf{refl} \\ \textsf{ap}_{g}(\ell _2) &:= \textsf{refl} \end{align*}

The reason that $\textsf{refl}$ works for the action on $\ell _1$ and $\ell _2$ is because $\textsf{ap}_{0_k \smile _k (\!-\!)}({\textsf{loop}_k\,{1}})$ and $\textsf{ap}_{(\!-\!) \smile _k 0_k}({\textsf{loop}_k\,{1}})$ by definition reduce to $\textsf{refl}_{0_k}$ . The final step amount to showing that

\begin{align*} \textsf{ap}_{x \mapsto \textsf{ap}_{y \mapsto \alpha (x) \smile _k \beta (y)}({\textsf{loop}_k\,{1}})}({\textsf{loop}_k\,{1}}) = \sigma ^2(1) \end{align*}

which is easy to see by unfolding the definition of $\smile _k$ . Thus, we have $\lvert \,\alpha \,\rvert \smile \lvert \,\beta \,\rvert = \lvert \,\gamma \,\rvert$ .

Finally, let us verify that $\lvert \,\alpha \,\rvert ^2 = \lvert \,\gamma \,\rvert$ . We construct a homotopy $h : (x : K^2) \to \alpha (x) \smile _k \alpha (x) = \gamma (x)$ by

\begin{align*} h(\star ) &:= \textsf{refl} \\ \textsf{ap}_{h}(\ell _1) &:= {\textsf{kill-}\Delta }({\textsf{loop}_k\,{1}}) \\ \textsf{ap}_{h}(\ell _2) &:= \textsf{refl} \end{align*}

For the action on $\textsf{sq}$ , we end up having to fill another square (or rather: another degenerate cube). Fortunately for us, this filling problem can easily be reduced to that of filling the first square appearing in the proof of Proposition 66, which we have already filled. Thus $\lvert \,\alpha \,\rvert ^2 = \lvert \,\gamma \,\rvert$ .

Corollary 69. $H^*(K^2,\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}[x,y]/(x^3,y^2,xy+x^2)$

Proof. By Proposition 68, we obtain the isomorphism by mapping the generators $1 : H^0(K^2,\mathbb{Z}/2\mathbb{Z})$ , $\alpha ,\beta : H^1(K^2,\mathbb{Z}/2\mathbb{Z})$ and $\gamma : H^2(K^2,\mathbb{Z}/2\mathbb{Z})$ to $1$ , $x$ , $y$ and $x^2$ respectively.

5.4 The complex projective plane

Sometimes, providing direct cohomology computations is rather difficult. One example of a space whose cohomology is difficult to compute directly, but is straightforward to compute using the Gysin sequence is $\mathbb{C}P^2$ – the cofibre of the Hopf map $h : \mathbb{S}^{3} \to \mathbb{S}^{2}$ – the details of which will not be needed here (see (Ljungström and Mörtberg, Reference Ljungström and Mörtberg2023, Definition 5) for a self-contained definition or [HoTT Book, Section 8.5] for the original definition in HoTT). This was first done in HoTT by Brunerie (Reference Brunerie2016) who applied the Gysin sequence to the fibre sequence

(7) \begin{align} \mathbb{S}^1 \to \mathbb{S}^{5}\to \mathbb{C}P^2 \end{align}

It follows from the Mayer–Vietoris sequence that, for any group $G$ , the cohomology of $\mathbb{C}P^2$ is concentrated in degrees $0$ , $2$ and $4$ :

\begin{align*} H^n(\mathbb{C}P^2,G) \cong \begin{cases} G & \text{if $n \in \{0, 2, 4 \}$} \\ \unicode {x1D7D9} & \text{otherwise} \end{cases} \end{align*}

The space $\mathbb{C}P^2$ is $1$ -connected and so we may apply the Gysin sequence to (7) with $n = 2$ . Unfolding the sequence for $i = 2$ and $i = 4$ tells us that $e : H^2(\mathbb{C}P^2,\mathbb{Z})$ and $e^2 : H^4(\mathbb{C}P^2,\mathbb{Z})$ are generators, thus giving us $H^*(\mathbb{C}P^2,\mathbb{Z}) \cong \mathbb{Z}[x]/(x^3)$ . This was formalised in full detail by Lamiaux et al. (Reference Lamiaux, Ljungström and Mörtberg2023).

5.5 Infinite real projective space

To further showcase the usefulness of the Gysin sequence, let us compute $H^*({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})$ . This computation is particularly interesting since it is an example of an application of the Gysin sequence to a space which is not $1$ -connected. For it to work, we hence need to construct the family $c_b$ in ( $\ast$ ) explicitly. As $\mathbb{R}P^{\infty }$ is well-known to be an Eilenberg–MacLane space we may conveniently define it by ${\mathbb{R}P^{\infty }} := {K(\mathbb{Z}/2\mathbb{Z},1)}$ . We remark that this differs from the definition given in (Buchholtz and Rijke, Reference Buchholtz and Rijke2017, Definition IV.1), but the argument we provide here should be easy to translate to fit their definition.

Hence, we are to compute $H^*({K(\mathbb{Z}/2\mathbb{Z},1)},\mathbb{Z}/2\mathbb{Z})$ . Using the equivalence $\psi : \Omega {K(\mathbb{Z}/2\mathbb{Z},1)} \simeq _\star \mathbb{S}^0$ , we construct the fibre sequence

\begin{equation*}\mathbb{S}^0 \to \Sigma _{x : {K(\mathbb{Z}/2\mathbb{Z},1)}} (0_k = x) \to {K(\mathbb{Z}/2\mathbb{Z},1)}\end{equation*}

This fits the Gysin sequence with $n = 1$ and the fibration $P : {K(\mathbb{Z}/2\mathbb{Z},1)} \to \textsf{Type}$ being defined by $P(x) := (0_k = x)$ . In order to apply the sequence, we need to construct, for each $x : {K(\mathbb{Z}/2\mathbb{Z},1)}$ , a map

\begin{equation*}c_x : \Sigma (0_k = x) \to _\star K(\mathbb{Z}/2\mathbb{Z},1)\end{equation*}

Let us initially construct $c_x$ is the case when $x := 0_k$ . In this case, the domain of $c_x$ is simply $\Sigma (\Omega (K(\mathbb{Z}/2\mathbb{Z},1)))$ and hence the counit of the adjunction $\Sigma \dashv \Omega$ gives us our map:

\begin{equation*}\epsilon : \Sigma (\Omega (K(\mathbb{Z}/2\mathbb{Z},1))) \to _\star K(\mathbb{Z}/2\mathbb{Z},1) \end{equation*}

We would like to define $c_{0_k} := \epsilon$ , but it is not entirely obvious why this definition would define $c_x$ for all $x : {K(\mathbb{Z}/2\mathbb{Z},1)}$ – the type $\Sigma (0_k = 0_k) \to _\star K(\mathbb{Z}/2\mathbb{Z},1)$ is not a proposition but a set, and hence this is not automatic. The trick is to add some structure to the type of $c_x$ by instead considering the following type:

(8) \begin{align} \sum _{e : \Sigma (0_k = x) \to _\star K(\mathbb{Z}/2\mathbb{Z},1)} (e \neq \textsf{const}) \end{align}

Lemma 70. The type in (8) is contractible. Furthermore, $\epsilon$ is non-constant and thus is the centre of contraction when $x$ is $0_k$ .

Proof. Since we are proving a proposition, it suffices to do so when $x$ is $0_k$ . We get

\begin{align*} (\Sigma (0_k = 0_k) \to _\star {K(\mathbb{Z}/2\mathbb{Z},1)}) &\simeq (\Omega ({K(\mathbb{Z}/2\mathbb{Z},1)}) \to _\star \Omega ({K(\mathbb{Z}/2\mathbb{Z},1)}))\\ &\simeq (\mathbb{S}^0 \to _\star \mathbb{S}^0) \\ &\simeq \textsf{Hom}(\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/2\mathbb{Z}) \end{align*}

By construction, this equivalence sends $\epsilon$ to the identity on $\mathbb{Z}/2\mathbb{Z}$ . The predicate $(\!-\!) \neq \textsf{const}$ is easily seen to be preserved by this chain of equivalences, and hence we get

\begin{equation*}\sum _{e : \Sigma (0_k = 0_k) \to _\star K(\mathbb{Z}/2\mathbb{Z},1)} (e \neq \textsf{const}) \simeq \sum _{\phi : \textsf{Hom}(\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/2\mathbb{Z})} (\phi \neq \textsf{const}) \end{equation*}

Since the identity is the unique non-constant map in $\textsf{Hom}(\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/2\mathbb{Z})$ , we are done.

Hence, by Lemma 70, we construct our family $c_x : \Sigma (0_k = x) \to _\star {K(\mathbb{Z}/2\mathbb{Z},1)}$ by choosing the unique element of (8). This gives us our class $e :H^1({K(\mathbb{Z}/2\mathbb{Z},1)},\mathbb{Z}/2\mathbb{Z})$ . In fact, with this rather explicit construction, it is easy to show that $e = \lvert \,\textsf{id}\,\rvert$ , but this additional knowledge will not be needed here. We may now instantiate the Gysin sequence. We get, for $i \geq 1$ , exact sequences

where recall, ${\mathbb{R}P^{\infty }} := {K(\mathbb{Z}/2\mathbb{Z},1)}$ and $E := \sum _{x: {K(\mathbb{Z}/2\mathbb{Z},1)}}(0_k = x)$ . Since $E$ is contractible, we get that the $(\!-\!)\smile e : {H^{i-1}({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})} \to {H^i({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})}$ is an isomorphism. Since $\mathbb{R}P^{\infty }$ is connected, we have $H^0({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}$ , and hence we get a chain of isomorphisms

\begin{equation*}\mathbb{Z}/2\mathbb{Z} \cong H^0({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z}) \cong H^1({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z}) \cong \ldots \cong H^n({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})\end{equation*}

whose composition is simply the map $(\!-\!)\smile e^n : \mathbb{Z}/2\mathbb{Z} \to H^n({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})$ . Hence, we have computed $H^*({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z})$ .

Proposition 71. $H^*({\mathbb{R}P^{\infty }},\mathbb{Z}/2\mathbb{Z}) \cong \mathbb{Z}/2\mathbb{Z}[x]$ .

6. Computer Computations and Synthetic Cohomology Theory

In this section, we will discuss various computations which can be performed using the constructions in the paper when formalised in a system like Cubical Agda, where univalence and HITs have computational content. This section is the only in the paper which cannot be directly formalised in Book HoTT where univalence and HITs are added axiomatically and lack computational content.

6.1 Proofs by computation in cubical agda

One big advantage of formalising synthetic mathematics in a system like Cubical Agda compared to Book HoTT is that many simple routine results hold definitionally. This sometimes vastly simplifies proofs. Even more ambitiously, one can hope that entire results can be proved directly by automatic computation. A classic conjecture of this form is the computability of the ‘Brunerie number’ (Brunerie, Reference Brunerie2016) – that is, the number $n : \mathbb{Z}$ such that $\pi _4(\mathbb{S}^3) \cong \mathbb{Z}/n\mathbb{Z}$ . The number $n$ can, in theory, be computed by running the function

\begin{equation*} \unicode {x1D7D9}\xrightarrow {(1,1)}\mathbb{Z} \times \mathbb{Z} \xrightarrow {\cong } \pi _2(\mathbb{S}^2) \times \pi _2(\mathbb{S}^2) \xrightarrow {[-,-]} \pi _3(\mathbb{S}^2) \xrightarrow {\cong } \mathbb{Z} \end{equation*}

where $[-,-]$ denotes the Whitehead product. Brunerie dedicates the second half of the thesis to manually proving that the absolute value of the number returned by this function is $2$ . To this end, he has to introduce cohomology, the Hopf invariant and several other complex constructions. If this number could instead be computed on a computer, these manual computations would not be required. Unfortunately, we still have not been able to carry out this computation in Cubical Agda, or in any other proof assistant where univalence and HITs have computational content.

However, while the original Brunerie number is still out of reach, a much simplified version of the number was successfully computed by the authors in (Ljungström and Mörtberg, Reference Ljungström and Mörtberg2023). We refer the interested reader to that paper for details. Computations of related numbers have also been reported by Jack (Reference Jack2023). However, an even simpler example of the same type of problem can be found when trying to show that the wedge sum of two circles and a sphere is not homotopy equivalent to the torus. This is typically done by distinguishing their cohomology rings and the problem boils down to showing that the cup product vanishes in degrees $(1,1)$ for $\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1$ but not for $\mathbb{T}^2$ . This was done computationally by Brunerie et al.(Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022, Section 6) by running the following function in Cubical Agda

\begin{equation*} \unicode {x1D7D9}\xrightarrow {(1,0),(0,1)}(\mathbb{Z} \times \mathbb{Z}) \times (\mathbb{Z} \times \mathbb{Z}) \xrightarrow {\cong } H^1(X,\mathbb{Z}) \times H^1(X,\mathbb{Z}) \xrightarrow {\smile } H^2(X,\mathbb{Z}) \xrightarrow {\cong } \mathbb{Z} \end{equation*}

for $X$ the two spaces in question. Simply by noting that the output was $0$ for one space and $1$ for the other, one can deduce that $\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1 \not \simeq \mathbb{T}^2$ .

Another class of results which we have successfully proved this way is that of statements concerning the fact that some cohomology group is generated by some particular element $g : H^n(X,G)$ . By first showing that $H^n(X,G)$ is isomorphic to a simple well-known group like $\mathbb{Z}$ by some isomorphism $\phi$ , it suffices to check that $\phi (g) = \pm 1$ for $g$ to generate $H^n(X,G)$ . However, the applicability of this method is also sometimes limited by computations being infeasible. Already in (Brunerie, Reference Brunerie2016), another such number appears: namely, the output of the following function

(9) \begin{align} \unicode {x1D7D9}\xrightarrow {(1,1)}\mathbb{Z} \times \mathbb{Z} \xrightarrow {\cong } H^2({\mathbb{C}P^2},\mathbb{Z}) \times H^2({\mathbb{C}P^2},\mathbb{Z}) \xrightarrow {\smile } H^4({\mathbb{C}P^2},\mathbb{Z}) \xrightarrow {\cong } \mathbb{Z} \end{align}

Successfully running it should give an output of absolute value $1$ and would provide a proof that the Hopf invariant $\pi _3(\mathbb{S}^2) \to \mathbb{Z}$ is an isomorphism. This computation was attempted in Cubical Agda by Brunerie et al. (Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) without luck. The definition of this number is arguably less complex than that of the Brunerie number, so the fact that Cubical Agda is stuck on it is an indication that a careful benchmarking of similar examples should be done. Further similar numbers approximating the original Brunerie number can be found in (Ljungström and Mörtberg, Reference Ljungström and Mörtberg2023) and we have, in fact, also in this paper implicitly defined other similar numbers. Consider, for instance the function

\begin{equation*} \unicode {x1D7D9} \xrightarrow {\lvert \,\alpha \,\rvert ,\lvert \,\alpha \,\rvert } H^1({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z}) \times H^1({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z}) \xrightarrow {\smile } H^2({\mathbb{R}P^2},\mathbb{Z}/2\mathbb{Z}) \xrightarrow {\cong } \mathbb{Z}/2\mathbb{Z} \end{equation*}

where $\alpha : {\mathbb{R}P^2} \to K(\mathbb{Z}/2\mathbb{Z},1)$ is defined as in Proposition 66. Computing this, we should get $1$ as output. This would completely remove the need for Lemma 65 in the proof of Proposition 66. Similar computations could also be used to verify Proposition 68. We judge these computations to be more feasible than that of (9) since the degrees of the cohomology groups involved are lower, although they have thus far not been successfully run in Cubical Agda.

6.2 Benchmarks

In order to find potential bottlenecks and get a better idea of which computations succeed and which fail, we have run several benchmarks in Cubical Agda. These all consider the underlying maps $\phi : H^n(X,G) \to H$ maps of isomorphisms defined for concrete groups $G$ and $H$ , and spaces/types $X$ . Using these maps, we have tried computing $\phi (h)$ for concrete elements $h : H^n(X,G)$ . As $H$ is often a simpler group like $\mathbb{Z}$ , $\mathbb{Z} \times \mathbb{Z}$ or $\mathbb{Z}/2\mathbb{Z}$ , these values are all easily understood. We typically pick $h$ as a generator of $H^n(X,G)$ , or as some more complicated element constructed from generators. Whenever $H^n(X,G)$ is a cyclic group, we write $g^{(n)}$ for its generator and when there are multiple generators, we simply write $g^{(n)}_i$ for the $i$ th generator. These generators are all easily constructed and we refer the interested reader to the Agda code for the precise definitions.

The various benchmarks and choices are all given in Table 1. The first four columns gives $n$ , $X$ , $G$ , and $H$ , s.t. $H^n(X,G) \cong H$ . Both the $G$ and $H$ columns often have two rows to indicate the two choices of $G$ which we have considered. We have focused on $\mathbb{Z}$ and $\mathbb{Z}/2\mathbb{Z}$ coefficients as these are the most interesting from a computational point of view. The fifth column contains the values of $h$ which we have considered, separated by spaces. So, for $H^1(\mathbb{S}^1,G)$ for example, we considered $3$ values of $h$ for each of the two coefficient groups under consideration. The results can be found in the final column. Its entries are aligned with the corresponding values of $h$ which we have tried.

Table 1. Benchmarks

As we expect similar goals like these to appear in future formalisations, the tests were run on a regular laptop with $1.60$ GHz Intel processor and $16$ GB of RAM. The successful computation were marked with $\color {green}{\unicode{x2714}}$ and the failed computations, marked with $\color {red}{\unicode{x2718}}$ , were manually terminated after a few minutes. Details and exact timings can be found at www.github.com/aljungstrom/SyntheticCohomologyTests/blob/master/CohomologyComputations.agda.

As expected, more tests work for lower dimensions, but for $\mathbb{R}P^2$ , and the more complex $K^2$ and $\mathbb{R}P^\infty$ , all tests fail even in dimension $1$ . This is not as surprising as it may seem. For $\mathbb{R}P^2$ and $K^2$ , $\phi$ attempts to compute the winding number of a loop in $\Omega K(\mathbb{Z},1)$ which is constructed in terms of the complex proof that $\sigma ^{-1} : \Sigma K(\mathbb{Z},2) \to K(\mathbb{Z},1)$ is a morphism of H-spaces. Another observation is that the choice of coefficients does not seem to make much of a difference. Somewhat more surprising, however, is the fact that several computations which terminated successfully in (Brunerie et al., Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) fail to terminate here. It is not uncommon that generality comes at the cost of efficiency, but it is puzzling that a minor change of the definition of $K(\mathbb{Z},n)$ (from the definition using $n$ -truncated $n$ -spheres to the one used here) would make such a difference.

7. More Related and Future Work

In this paper, we have described a synthetic approach to cohomology theory in HoTT, with the possibility of doing direct computations in Cubical Agda. This works builds on lots of prior work which we have discussed throughout the paper, but there is also additional related work on which this work is not directly based. In this final section we will discuss this work, as well as possible future directions.

First of all, there is some related prior work already formalised in Cubical Agda. Qian (Reference Qian2019) formalised $K(G,1)$ as a HIT, following Licata and Finster (Reference Licata and Finster2014), and proved that it satisfies $\pi _1(K(G,1)) \cong G$ . Alfieri (Reference Alfieri2019) and Harington (Reference Harington2020) formalised $K(G,1)$ as the classifying space $BG$ using $G$ -torsors. Using this, $H^1(\mathbb{S}^1,\mathbb{Z}) \cong \mathbb{Z}$ was proved – however, computing using the maps in this definition proved to be infeasible.

Certified computations of homology groups using proof assistants have been considered prior to HoTT/UF. For instance, the Coq system (The Coq Development Team, 2021) has been used to compute homology (Heras et al., Reference Heras, Dénès, Mata, Mörtberg, Poza and Siles2012) and persistent homology (Heras et al., Reference Heras, Coquand, Mörtberg and Siles2013) with coefficients in a field. This was later extended to homology with $\mathbb{Z}$ -coefficients by Cano et al. (Reference Cano, Cohen, Dénès, Mörtberg and Siles2016). The approach in these papers was entirely algebraic and spaces were represented as simplicial complexes. Other formalisations of various classical (co)homology theories can be found in Lean’s mathlib (mathlib Community, 2020), but this work is also not synthetic. However, an earlier HoTT formalisation of synthetic (co)homology theory in Lean 2 can be found in (The Spectral Sequence Project, 2018) which was developed as part of (van Doorn, Reference van Doorn2018).

An interesting approach to increase the efficiency of synthetic cohomology computations would be to develop classical computational approaches to cohomology synthetically. This was done for cellular cohomology by (Buchholtz and Hou (Favonia) Reference Buchholtz and Hau (Favonia)2018) who showed that a cohomology theory akin to the one considered in this paper can also be computed using synthetic cellular cohomology for spaces which are CW complexes. In ongoing work with Loïc Pujet, we are formalising cellular (co)homology in Cubical Agda with the aim of reducing (co)homology computations to linear algebra, similar to the certified computations of homology groups in Coq mentioned above (which relied on certified Gaussian elimination and Smith normal form computations, as is customary in traditional computational topology). One envisioned application of this is in the formalisation of the recent synthetic proof of Serre’s classification theorem for homotopy groups of spheres by Barton and Campion (Barton, Reference Barton2022).

A synthetic approach to homology in HoTT/UF was developed informally by Graham (Reference Graham2018) using stable homotopy groups. This was later extended with a proof of the Hurewicz theorem by Christensen and Scoccola (Reference Christensen and Scoccola2023). There has also been some recent work on synthetic definitions of other classical tools in homological algebra, in particular Ext groups (Christensen and Flaten, Reference Christensen and Flaten2023). Various results related to synthetic homology theory, including a formalisation of the Eilenberg–Steenrod axioms for homology, were formalised as part of (The Spectral Sequence Project, 2018). It would be interesting to also formalise this in Cubical Agda and try to compute also homology groups synthetically.

The definition of $\smile$ in the setting of $\mathbb{Z}$ -cohomology in HoTT/UF is due to Brunerie (2016, Chapter 5.1). This definition, however, relies on the smash product which has proved very complex to reason about formally (Brunerie, Reference Brunerie2018). Despite this, Baumann (Reference Baumann2018) generalised this to $H^n(X,G)$ and managed to formalise graded commutativity in HoTT-Agda. Baumann’s formal proof of this property is $\sim 5000$ LOC while our formalisation is just $\sim 1200$ LOC. This indicates that it would be infeasible to formalise other algebraic properties of $H^*(X,R)$ with this definition. Associativity seems particularly infeasible, but with our definition the formal proof is only $\sim 600$ LOC. In fact, recent work by Ljungström (Reference Ljungström2024) on the symmetric monoidal structure of the smash product fills in the gaps in (Brunerie, Reference Brunerie2016), thus making Brunerie’s arguments, in theory, formalisable. Nevertheless, the definition we have presented here still appears to us to be more convenient to work with.

Acknowledgements

The authors are grateful to Guillaume Brunerie and Thomas Lamiaux for collaborating with us and co-authoring earlier related work in (Brunerie et al., Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022) and (Lamiaux et al., Reference Lamiaux, Ljungström and Mörtberg2023). We are also grateful to Evan Cavallo for insightful comments and many cubical tricks. The first author would also like to thank David Wärn for many fruitful discussions on related work which inspired the proof of Proposition 71. Finally, we wish to thank Dan Christensen for his helpful comments on an older version of this paper.

This paper is based upon research supported by the Swedish Research Council (Vetenskapsrådet) under Grant No. 2019-04545. The research has also received funding from the Knut and Alice Wallenberg Foundation through the Foundation’s programme for mathematics.

Competing Interests

The authors declare none.

Footnotes

1 Note that we could have defined $\textsf{ap}^2_f$ in terms of $\textsf{ap}$ so that $\textsf{ap}^2_f\textsf{-funct}$ holds definitionally. We choose not to do this in order to stay neutral with respect to the flavour of HoTT our proof holds in – the usual definition of $\textsf{ap}^2_f$ in cubical type theory does not make this kind of functoriality hold definitionally.

2 Technically, the outer $\textsf{ap}$ should be dependent function application, $\textsf{apd}$ , if we were to follow HoTT Book notation. We will not distinguish the two and use $\textsf{ap}$ for both.

3 Technically, this is only needed when $n\gt 1$ , but in this paper we will, for simplicity, always assume $G$ to be abelian.

4 The original form of the lemma was conjectured only for Eilenberg–MacLane spaces and appears as (Brunerie et al., Reference Brunerie, Ljungström, Mörtberg, Manea and Simpson2022, Lemma 14). Its proof, and generalisation to arbitrary homogeneous types, is attributed to Cavallo, whose original formalisation can be found in (Cavallo, Reference Cavallo2022). The result has later been generalised by Buchholtz et al. (Reference Buchholtz, Christensen, Flaten and Rijke2023, Lemma 2.7)

5 Here, one could more generally have chosen a dependent version by letting $H^n(X,G_{(\!-\!)}) := \lVert (x : X) \to K(G_x,n)\rVert _0$ for any family of abelian groups $G_x$ over $X$ as is done by, for example, van Doorn (Reference van Doorn2018, Definition 5.4.2). We choose the non-dependent version for ease of presentation, although everything which follows can be read with the dependent version in mind.

6 Recall that the action on maps by $\widetilde {H}^n(\!-,G)$ is defined by precomposition. That is, $\widetilde {H}^n(f,G) := f^*$ .

7 This homotopy only exists up to propositional truncation, but since we are proving a proposition, this is not an obstacle.

8 In plain HoTT, this was first fully proved by Sojakova (Reference Sojakova2016). In cubical type theory, this fact is a triviality (Mörtberg and Pujet, Reference Mörtberg and Pujet2020, Section 3).

References

Alfieri, V. (2019). Formalisation de notions de théorie des groupes en théorie cubique des types. Internship report, supervised by Thierry Coquand. Unpublished.Google Scholar
Barton, R. (2022). Finite presentability of homotopy groups of spheres. Talk at the Seminar on Homotopy Type Theory at CMU, presenting joint work with Tim Campion, 29 April 2022.Google Scholar
Baumann, T. (2018). The cup product on cohomology groups in homotopy type theory. Master’s thesis, University of Augsburg.Google Scholar
Brown, E. H. (1962). Cohomology theories. The Annals of Mathematics 75 (3) 467484.10.2307/1970209CrossRefGoogle Scholar
Brunerie, G. (2016). On the homotopy groups of spheres in homotopy type theory. PhD thesis, Université Nice Sophia Antipolis.Google Scholar
Brunerie, G. (2018). Computer-Generated Proofs for the Monoidal Structure of the Smash Product, Homotopy Type Theory Electronic Seminar Talks.Google Scholar
Brunerie, G., Ljungström, A. and Mörtberg, A. (2022). Synthetic Integral Cohomology in Cubical Agda. In Manea, F. and Simpson, A.(eds.) 30th EACSL Annual Conference on Computer Science Logic (CSL 2022), volume 216 of Leibniz International Proceedings in Informatics (LIPIcs), 11:1-11:19.Google Scholar
Buchholtz, U. and Hau (Favonia), K.-B. (2018). Cellular Cohomology in Homotopy Type Theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’18, Association for Computing Machinery, 521529.10.1145/3209108.3209188CrossRefGoogle Scholar
Buchholtz, U., Christensen, J. D., Flaten, J. G. T. and Rijke, E. (2023). Central H-spaces and banded types. arXiv: 2301.02636.Google Scholar
Buchholtz, U. and Rijke, E. (2017). The Real Projective Spaces in Homotopy Type Theory. In Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’17, IEEE Press.10.1109/LICS.2017.8005146CrossRefGoogle Scholar
Buchholtz, U., van Doorn, F. and Rijke, E. (2018). Higher Groups in Homotopy Type Theory. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’18, Association for Computing Machinery, 205214.10.1145/3209108.3209150CrossRefGoogle Scholar
Cano, G., Cohen, C., Dénès, M., Mörtberg, A. and Siles, V. (2016). Formalized linear algebra over elementary divisor rings in Coq. Logical Methods in Computer Science 12 (2) 72016.Google Scholar
Cavallo, E. (2015). Synthetic cohomology in homotopy type theory. Master’s thesis, Carnegie Mellon University.Google Scholar
Christensen, J. D. and Flaten, J. G. T. (2023). Ext groups in homotopy type theory. arXiv: 2305.09639.Google Scholar
Christensen, J. D. and Scoccola, L. (2023). The Hurewicz theorem in homotopy type theory. Algebraic & Geometric Topology 23 (5) 21072140.10.2140/agt.2023.23.2107CrossRefGoogle Scholar
Eilenberg, S. and Steenrod, N. (1952). Foundations of Algebraic Topology, Princeton University Press.10.1515/9781400877492CrossRefGoogle Scholar
Graham, R. (2018). Synthetic homology in homotopy type theory, arXiv: 1706.01540.Google Scholar
Harington, E. (2020). Groupes de cohomologie en théorie des types univalente. Internship report, supervised by Thierry Coquand.Google Scholar
Hatcher, A. (2002). Algebraic Topology, Cambridge University Press.Google Scholar
Heras, J., Coquand, T., Mörtberg, A. and Siles, V. (2013). Computing persistent homology within Coq/SSReflect. ACM Transactions On Computational Logic 14 (4) 126.10.1145/2528929CrossRefGoogle Scholar
Heras, J., Dénès, M., Mata, G., Mörtberg, A., Poza, M. and Siles, V. (2012). Towards a Certified Computation of Homology Groups for Digital Images. In Proceedings of the 4th International Conference on Computational Topology in Image Context, CTIC’12, Springer-Verlag, 4957.10.1007/978-3-642-30238-1_6CrossRefGoogle Scholar
Hou (Favonia), K. B., Finster, E., Licata, D. R. and Lumdaine, P. L. (2016). A Mechanization of the Blakers–Massey Connectivity Theorem in Homotopy Type Theory. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’16, ACM, 565574.10.1145/2933575.2934545CrossRefGoogle Scholar
Jack, T. (2023). $\pi _4(\mathbb{S}^3) \not \cong 1$ and another Brunerie number in CCHM. In The Second International Conference on Homotopy Type Theory (HoTT 2023). Available at https://hott.github.io/HoTT-2023/abstracts/HoTT-2023_abstract_21.pdf.Google Scholar
Lamiaux, T., Ljungström, A. and Mörtberg, A. (2023). Computing Cohomology Rings in Cubical Agda. In Proceedings of the 12th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP, Association for Computing Machinery, 239252.10.1145/3573105.3575677CrossRefGoogle Scholar
Licata, D. R. and Brunerie, G. (2014). A Cubical Type Theory, Talk at Oxford Homotopy Type Theory Workshop.Google Scholar
Licata, D. R. and Brunerie, G. (2015). A Cubical Approach to Synthetic Homotopy Theory. In Proceedings of the 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ’15, IEEE Computer Society, 92103.10.1109/LICS.2015.19CrossRefGoogle Scholar
Licata, D. R. and Finster, E. (2014). Eilenberg-MacLane Spaces in Homotopy Type Theory. In Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, Association for Computing Machinery,10.1145/2603088.2603153CrossRefGoogle Scholar
Ljungström, A. (2024). Symmetric monoidal smash products in homotopy type theory. Mathematical Structures in Computer Science 34 (9) 9851007.10.1017/S0960129524000318CrossRefGoogle Scholar
Ljungström, A. and Mörtberg, A. (2023). Formalizing $\pi _4({S}^3) \cong \mathbb{Z}/2\mathbb{Z}$ and computing a Brunerie number in cubical agda. In 38th Annual ACM/IEEE Symposium oOn Logic in Computer Science (LICS), IEEE, 113.Google Scholar
mathlib Community, T (2020). The Lean Mathematical Library. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP, Association for Computing Machinery, 367381.Google Scholar
Mörtberg, A. and Pujet, L. (2020). Cubical Synthetic Homotopy Theory. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP, Association for Computing Machinery, 158171.10.1145/3372885.3373825CrossRefGoogle Scholar
Qian, Z. (2019). Towards eilenberg-macLane spaces in cubical type theory. Master’s thesis, Carnegie Mellon University.Google Scholar
Shulman, M. (2013). Cohomology. Post on the homotopy type theory blog. Available at www.homotopytypetheory.org/2013/07/24/.Google Scholar
Shulman, M. (2019). All $(\infty ,1)$ -toposes have strict univalent universes, arXiv: 1904.07004.Google Scholar
Sojakova, K. (2016). The equivalence of the torus and the product of two circles in homotopy type theory. ACM Transactions On Computational Logic 17 (4) 29:129:19.10.1145/2992783CrossRefGoogle Scholar
The Coq Proof Assistant (2021).The Coq Proof Assistant. Available at www.coq.inria.fr.Google Scholar
The Spectral Sequence Project (2018). The Spectral Sequence Project. Available at www.github.com/cmu-phil/Spectral.Google Scholar
The Univalent Foundations Program (2013). Homotopy Type Theory: Univalent Foundations of Mathematics. Self-published, Institute for Advanced Study.Google Scholar
van Doorn, F. (2018). On the Formalization of higher inductive types and synthetic homotopy theory. PhD thesis. Carnegie Mellon University.Google Scholar
Vezzosi, A., Mörtberg, A. and Abel, A. (2021). Cubical agda: a dependently typed programming language with univalence and higher inductive types. Journal of Functional Programming 31 e8.10.1017/S0956796821000034CrossRefGoogle Scholar
Wärn, D. (2023). Eilenberg–Maclane spaces and stabilisation in homotopy type theory. Journal of Homotopy and Related Structures 18 (2) 357368.10.1007/s40062-023-00330-5CrossRefGoogle Scholar
Figure 0

Figure 1. $\mathbb{S}^1$ and $\mathbb{S}^1 \vee \mathbb{S}^1$.

Figure 1

Figure 2. Elimination principles for $K(G,n)$.

Figure 2

Figure 3. $\mathbb{T}^2$ and $\mathbb{S}^2 \vee \mathbb{S}^1 \vee \mathbb{S}^1$.

Figure 3

Table 1. Benchmarks