Coherence via Wellfoundedness

Homotopy type theory allows us to work with the higher-dimensional structures that appear in homotopy theory and in higher category theory. The notion of coherence is central: it is usually not enough to know that objects are equal, but one needs to know how they are equal, and collections of equality proofs need to fit together. This is in particular true for quotienting -- a natural operation which gives a new type for any binary relation on a type and, in order to be well-behaved, cuts off higher structure (set-truncates). This makes it hard to characterise the type of maps from a quotient into a higher type. Open questions about free higher groups, pushouts of sets, and a well-behaved type-theoretic representation of type theory itself emerge from this difficulty. In order to approach these problems, we work with cycles (closed zig-zags) given by the transitive closure of the relation. Reasoning about these is hard since the obvious inductive strategy is bound to fail: if we remove a segment from a closed zig-zag, it is not closed anymore. We make use of the observation that the relations in the mentioned problems are all confluent and wellfounded. Starting from such a relation, we construct a new relation on closed zig-zags with the same properties, making wellfounded induction possible. This allows us to approach approximations (1-truncated cases) of the mentioned open questions. We have formalised our theory of cycles over confluent and well-founded relations, and the derivation of our main theorem, in the proof assistant Lean.


Introduction
Homotopy type theory [24], commonly known as HoTT, is a version of constructive dependent type theory inspired by the observation that types carry the structure of (higher) groupoids [12,25,21] and allow homotopical interpretations [3,17].
The assumption of uniqueness of identity/equality proofs (UIP), which says that every equality type ( written as a = b) has at most one element, is rejected; instead, types satisfying this principle are known as sets (or homotopy sets, h-sets).
This leads to new opportunities.We can find "higher" types (i.e."non-sets"), whose equality structure may be very complicated.At the same time, the familiar and desirable concept of quotienting [11] (from now on called set-quotienting [24,Chp 6.10]) becomes an instance of the more general idea of higher inductive types.With the help of these, theories of higher structures can be developed synthetically in type theory.One difficulty of constructions is that it is usually not sufficient to know that two things are equal, but we need to know how they are equal.Families of equalities need to "match" or "fit together": they need to be coherent.
The guiding motivation for the theory that we develop in this paper is the needed coherence that arises when working with set-quotients simultaneously with higher types.Recall from [24,Chp 6.10] that, for a given type A : U and a relation 1 (∼) : A → A → U, the set-quotient can be implemented as the higher inductive type inductive A/∼ where trunc : Π{x, y : A/∼}.Π(p, q : x = y).p= q (1) From this representation, we can derive the elimination rule: In order to get a function f : (A/∼) → X, we need to give a function g : A → X such that, whenever a ∼ b, we have g(a) = g(b).However, this only works if X is a set itself.If it is not, we have a priori no way of constructing the function f .
Let us look at one instance of the problem.We consider the following setquotient, which we will use as a running example.It is a standard construction that has been discussed in [24,Chp 6.11].
Example 1 (free group).Let A be a set.We construct the free group on A as a set-quotient.We consider lists over A + A, where we think of the left copy of A as positive and the right copy as negative elements.For x : A + A, we write x −1 for the "inverted" element: The binary relation ∼ on List(A + A) is generated by Then, the set-quotient List(A + A)/ ∼ is the free group on A: It satisfies the correct universal property by [24,Thm 6.11.7].
Another way to construct the free group on A is to re-use the natural groupoid structure that every type carries; this can be seen as a typical "HoTT-style" construction.It works as follows.The wedge of A-many circles is the (homotopy) coequaliser of the two maps from A into the unit type, hcolim(A ⇒ 1).Using a higher inductive type, it can be explicitly constructed: inductive hcolim(A ⇒ 1) : U where base : hcolim(A ⇒ 1) Its loop space Ω(hcolim(A ⇒ 1)) is by definition simply base = base.This loop space carries the structure of a group in the obvious way: the neutral element is given by reflexivity, multiplication is given by path composition, symmetry by path reversal, and every a : A gives rise to a group element loop(a).This construction is completely reasonable without the assumption that A is a set, and it therefore defines the free higher group (cf.[18]); from now on, we write F A for it: In contrast to this observation, the set-quotient of Example 1 ignores any existing higher structure (cf.[24,Rem 6.11.8]) and thus really only defines the free "ordinary" group.If we do start with a set A, it is a natural question whether the free higher group and the free group coincide: There is a canonical function 1 A relation is simply a type family A → A → U of which we do not assume any properties.In particular, ∼ does not need to be an equivalence relation for the quotient to exist.Some authors call such a relation proof-relevant to emphasise that it is not necessarily valued in propositions.
defined analogously to Ω(S 1 ) → Z, cf.[24].Classically, this function is an equivalence.Constructively, it is an open problem to construct an inverse of (6).The difficulties do not stem from the first two constructors of the set-quotient.Indeed, we have a canonical map which maps a list such as [inl(a 1 ), inr(a 2 ), inl(a 3 )] to the path composition loop(a 1 ) (loop(a 2 )) −1 loop(a 3 ).For this map, we also have since consecutive inverse loops cancel each other out.Therefore, if we define (A ∼) to be the higher inductive type (1) without the constructor trunc, i.e. the untruncated quotient or coequaliser, then there is a canonical map Thus, the difficulty with defining an inverse of (6) lies solely in the question whether F A is a set.This is an open problem which has frequently been discussed in the HoTT community (a slight variation is recorded in [24,Ex 8.2]).It is well-known in the community how to circumvent the problem if A has decidable equality.However, the only piece of progress on the general question that we are aware of is the result in [18], where it is shown that all fundamental groups [24,Chp 6.11] are trivial.In other words: Instead of showing that everything above truncation level 0 is trivial, the result shows that a single level is trivial.The proof in [18] uses a rather intricate construction which is precisely tailored to the situation.
Example 2. There is a long series of suggestions to formalise dependent type theory inside dependent type theory, starting with Dybjer [9].Chapman [5] introduced the expression "type theory eats itself" for a formalisation of the type-theoretic syntax, inspired by Danielsson [6] and others.Altenkirch and Kaposi [2] refer to the same concept as "type theory in type theory".Another recent suggestion was made by Escardó and Xu [10].Abel, Öhmann, and Vezzosi [1] start their paper stating that "type theory should be able to handle its own meta-theory".All proposals construct, in one way or another, types and type families of contexts, substitutions, types, and terms.They further define convertibility relations which capture the intended equalities, stating for example that (λx.x)(0) is related to 0. It is then natural to quotient the constructed types by the relation.However, there is a difficulty in homotopy type theory which was discussed by Shulman [23], Altenkirch and Kaposi [2], Kaposi and Kovács [15], and many others in the community.The problem is that we want to ensure that the standard model or meta-circular interpretation is really a model of the syntax.This means that, among other components, we have to construct a function from the set of contexts to the universe of sets (or types).But this universe is not a set, and we get a problem analogous to the one discussed above.
The construction of functions (A/∼) → X is the guiding motivation for the results that we present in this paper.We do not allow an arbitrary type X though, but we still assume that X is 1-truncated.This condition is satisfied by the universe of sets central to the above Example 2. As an application, we will give a new proof for the theorem that the fundamental groups of F A are trivial.We will also show a family of similar statements, by proving a common generalisation.
The characterisation of the equality types of (A/∼) makes it necessary to consider cycles, or closed zig-zags, in A. A cycle is simply an element of the symmetrictransitive closure, for example: The first new result (Theorem 14) of our current paper says: We get a function (A/∼) → X if we have f : A → X and h : (a ∼ b) → f (a) = f (b), together with the coherence condition stating that h maps any cycle to a commuting cycle in X.In the case of the example (10) above, this means that the composition h(s) h(t) −1 h(p) −1 h(q) −1 equals refl f (a) .Theorem 14 is fairly simple, and we do not consider it a major contribution of this paper.The actual contribution of the paper is to make Theorem 14 usable since, on its own, it is virtually impossible to apply in any non-trivial situation.The reason for this is that the coherence condition talks about cycles, i.e. closed zig-zags.Zig-zags are inductively generated (they are simply a chain of segments), but closed zig-zags are not.If we have a property on cycles, which we cannot generalise to arbitrary zig-zags, then there is no obvious inductive strategy to show the property for all cycles: if we remove a segment of a cycle, the remaining zig-zag is not closed any more.In all our examples, it seems not possible to formulate an induction hypothesis based on not-necessarily-closed zig-zags.
Although the function space (A/∼) → X in homotopy type theory is the guiding motivation of this paper, the actual main contribution and heart of the paper is completely independent of type theory and could be formulated in almost any (constructive) foundation.We start from a Noetherian (co-well-founded) and locally confluent binary relation on A (conditions that are satisfied in all our examples).We then construct a new Noetherian binary relation on the cycles of .An important property of this new relation is that any cycle can be written as the "merge" of a smaller cycle and one which is given by the condition of local confluence.The concrete consequence is Theorem 46, which we call Noetherian cycle induction: Assume we are given a property P on cycles which respects merging cycles as well as "rotating" cycles.Then, we can show P for all cycles by showing it for the empty cycle(s) and for all cycles that are given by the local confluence property.
While it is very hard to show a property directly for all cycles, it is much more manageable to show the property for those cycles that stem from local confluence.In any given example, when we prove local confluence, we can choose how these "confluence cycles" look like, giving us full control over what we have to prove.
Let us get back to homotopy type theory.The combination of the two mentioned results (Theorem 14 and Theorem 46) gives us Theorem 47: Given f : A → X such that a ∼ b implies f (a) = f (b), it suffices to show that "confluence cycles" are mapped to trivial equality proofs.We apply to this to show that the free higher group over a set has trivial fundamental groups.There is a family of similar statements that we also discuss and prove.
Our result should be applicable to construct the interpretation into the standard model of sets as in Example 2: The reduction relation can be formulated in a Noetherian and locally confluent way, and the universe of sets forms a 1-type.This however depends on the very concrete representation of the syntax inside type theory and involves a very lengthy development.We have not worked this out and leave it for the future.Outline of the paper.We start by clarifying the setting and recalling previous results that we build upon in Section 2. We then show the mentioned Theorem 14 describing functions out of the set-quotient in Section 3. In Section 4, we identify the properties of the relations in question, namely Noetherianess and local confluence.Section 5 is the core of the paper: Starting from a Noetherian locally confluent relation on A, we construct a Noetherian relation on the cycles of A. This allows us to formulate the principle of Noetherian cycle induction in Section 6.In Section 7, we show several applications.Section 8 is reserved for some concluding remarks.Formalisation.We have formalised the complete construction with all proofs in Sections 2 to 6 in the proof assistant Lean [7], including the existing results that we recall in Section 2. Parts of Section 7 are not self-contained and have not been included in the formalisation, but the important Theorem 47 is formalised.The formalisation was done for the third major version of Lean, which supports reasoning in HoTT by enforcing that its strict, impredicative universe of propositions is avoided in all definitions.It relies on a port of the Lean HoTT library [26] which was developed for Lean 2. The Lean code is available online. 2he formalisation approximately follows the structure of the paper.Many arguments are directly translated from the informal mathematical style of the paper into Lean code.In some cases, the formalisation uses shortcuts compared to the paper.These shortcuts would look ad-hoc and unnecessary on paper, where certain overhead is invisible anyway.However, avoiding this overhead simplifies the formalisation.
While homotopy type theory often allows very short formalisations of "homotopical" arguments (such as Theorem 14), combinatorial arguments (such as the ones leading to Theorem 46) are more tedious in Lean than they are on paper.It is difficult to say how big the formalisation exactly is due to the use of existing results, some of which are available in libraries while others are not.Only counting the core results, the Lean formalisation comprises approximately 1.600 lines of code.

Preliminaries and Prerequisites
2.1.Setting.We work in the version of homotopy type theory that is developed in the "HoTT book" [24].This means that we use a dependent type theory with Σ-and Π-types as well as coproducts, with univalent universes and function extensionality.We use inductive families [8] as for example in (11) below. 3Further, we use curly brackets to denote implicit arguments as it is done in various proof assistants, for example as in f : Π{a : A}.(B(a) → C(a)).This allows us to omit the implicit argument and write f (b) : C(a) in situations where a can easily be inferred.The only higher inductive types that are relevant for this paper besides set-quotients are coequalisers and set-truncations.They are briefly introduced in Section 2.3 below.(For the advanced application given by Theorem 51, pushouts [24, Chp 6.8] are used.)2.2.Relations and Closures.As usual, we have the following closure operations:
The type-theoretic implementation of these closures is standard.The reflexivetransitive closure is constructed as an inductive family with two constructors: The symmetric closure is the obvious disjoint sum, The transitive closure can be defined analogously to (11), with the constructor nil replaced by a constructor of the form (a ∼ b) → (a ∼ + b).
Remark 4. We often want to nest several constructions.If we start with the relation ∼ and first apply construction x, then y, then z, we denote the resulting relation by ∼ xyz .For example, the reflexive-symmetric-transitive closure ∼ s * is constructed by first taking the symmetric and then the reflexive-transitive closure.Needless to say, there are several possible variations of how such concepts can be implemented; for example, ∼ * could be defined as (x ∼ + y) + (x = y).The definitions we give are the ones which we found lead to the best computational behaviour in a proof assistant.
Definition 5 (chains and cycles).Given a relation ∼, we refer to elements of (a ∼ s * b) as chains (from a to b).A chain is monotone if either each segment comes from the left summand in (12), i.e. is of the form inl(t) with t : a ∼ b (no segment is inverted), or if segment comes from the right summand (every segment is inverted).
An element of (a ∼ s * a) is called a cycle (based at a).We write ∼ for the type of cycles, ∼ :≡ Σ(a : A).(a ∼ s * a).Definition 6 (notation and operations on closures).We have the following standard operations: (1) reflexivity: We write : a ∼ * a for the constructor nil.We also write for the trivial cycle, and a if we want to emphasise that we mean the trivial cycle based at a.
which calculates the length of a chain.We say that a chain α is empty if its length is zero.For the type of empty cycles, we write Remark 8.The trivial cycle is always empty, but not every empty cycle is equal to .Instead, an empty cycle corresponds to a loop in A, This is easy to see, since (11) without the second constructor is the usual definition of Martin-Löf's identity type as an inductive family.In particular, if A is a set, then is the only empty cycle.
2.3.Quotients, Coequalisers, Truncations.As explained in the introduction, the set-quotient A/∼ is the higher inductive type with constructors ι, glue, and trunc, see (1).The construction can be split into two steps.We write (A/∼) for the untruncated quotient or coequaliser which has only the constructors ι and glue, and we write − 0 for the set-truncation which has only the constructors ι and trunc.
Lemma 9.For a relation ∼ on A, we have Proof.The direct approach of constructing functions back and forth works without difficulties.
For a given type X, there is a canonical function from the function type (A ∼) → X to the Σ-type of pairs (f, h), where This map is given by: g → (g The universal property of the higher inductive type A ∼ tells us that this function is an equivalence (one can of course also show this with the dependent elimination principle of A ∼, if that is assumed instead as primitive).
2.4.Path Spaces of Coequalisers.We will need to prove statements about equalities in coequalisers.For this, we use a result by Kraus and von Raumer: Theorem 10 (induction for coequaliser equality, [19]).Let a relation (∼) : A → A → U as before and a point a 0 : A be given.Assume we further have a type family together with terms e : Π{b, c : A}, (q : ι(a 0 ) = ι(b)), (s : b ∼ c).

Eliminating out of Set-Quotients
As before, let ∼ be a relation on A. Assume further that given are a function f : A → X and a proof h that f sends related points to equal points, as in (18) and (19).There is an obvious function defined by recursion on a ∼ s * b which in each step path-composes with an equality given by h or the inverse of such an equality.Given (f, h) and a third map k : X → Y , it is easy to prove by induction on a ∼ * b that we have We also note that, for chains α, β, h s * (α :: β) = h s * (α) h s * (β) and (32) Of particular interest is the function glue s * : Π{a, b : A}.(a ∼ s * b) → ι(a) = ι(b).It is in general not an equivalence: For example, for t : a ∼ a, the chain t :: t −1 and the empty chain both get mapped to refl.Thus, glue s * does not preserve inequality (but see Remark 8.However, we have the following result: Proof.Fixing one endpoint a 0 : A and setting we need to show that, for all q, we have P (q).We use Theorem 10, where r is given by the empty chain.To construct e, we need to prove P (q) P (q glue(s)) for any s : b ∼ c.This amounts to constructing functions in both directions between the types Σ(p : a 0 ∼ s * b).glue s * (c) = q and Σ(p : a 0 ∼ s * b).glue s * (c) = q glue(s), where extending a chain with s or with s −1 is sufficient.
The following is a "derived induction principle" for equalities in coequalisers: Lemma 13.For a family P : Π{x : A ∼}.x = x → U such that each P (q) is a proposition, the two types and Π(x : A ∼), (q : x = x).P (q) (37) are equivalent.
Proof.Both types are propositions, and the second clearly implies the first.For the other direction, induction on x lets us assume that x is of the form ι(a) for some a : A; the case for the constructor glue is automatic.The statement then follows from the surjectivity of glue s * .

On Confluence and Well-Foundedness
In the theory of rewriting systems, a usually desirable property of a rewriting relation is strong normalisation, meaning that any term can be rewritten to exactly one irreducible term.The relations that we are interested in are much weaker.For a rewriting system, it is usually decidable whether and to what a term can be rewritten.In contrast, it is in the examples discussed in the introduction generally undecidable whether, for a given a : A, there is a b such that a ∼ b.Even if we already have both a and b, it is undecidable whether a ∼ b.Nevertheless, the concepts of confluence and well-foundedness make sense and are highly useful in our setting to solve cases such as the ones from the introduction.Convention 15.To emphasise the "directedness" of a relation, we name relations instead of ∼ when talking about confluence.This is only to be understood as supporting the intuition, it does not come with any implicit assumptions.Similarly, we use the relation name < in the context of well-foundedness.We also use the name order synonymously with relation; note that an order is still simply a type family A → A → U, again without any implicit assumptions.Definition 17 (confluence).We say that a relation on A is locally confluent if, for any span, there is a matching extended cospan: We say that is confluent if we can replace the assumption (b • c) by the weaker assumption (b * • * c).
Remark 18.Note that being [locally] confluent is not a proposition; it should be understood as carrying a [local] confluence structure.
The definition of well-foundedness is standard as well.If x < y, we say that x is smaller than y.Recall that a point a : A is <-accessible if every x < a is <accessible, and < is well-founded if all points are <-accessible.Type-theoretically, this can be expressed as follows: While the definition in [24, Chp.10.3] is only given for the special case that A is a set and < is valued in propositions, the more general case that we consider works in exactly the same way (cf.our formalisation).In particular, we have the following two results: Lemma 20.For any x, the type acc < (x) is a proposition.Further, the statement that < is well-founded is a proposition.
An immediate application is the following: Lemma 22.If a < a, then a is not <-accessible.
The notion relevant to our examples and application is not well-foundedness, but co-well-foundedness: instead of "no infinite sequences to the left" the property we want to use is "no infinite sequences to the right".Such a relation is known as Noetherian in the literature.Of course, this amounts to a simple swap of arguments.
Definition 24 (Noetherian).A relation > is called Noetherian (or co-well-founded ) if the opposite relation > op , defined by (b > op a) :≡ (a > b), is well-founded.The corresponding induction principle is known as Noetherian induction.
We have already seen an example in the introduction of this paper.Recall the relation (3) that is used in the construction of the free group in Example 1: Given two lists 1 , 2 : List(A + A), we have 1 2 if the first list can be transformed into the second list by removing exactly two elements.The two removed list elements have to be consecutive and "inverse" to each other, i.e. one is of the form inl(a), the other inr(a).
Proof.Noetherian is trivial since each step decreases the length of the list.Regarding local confluence, assume that we have a list which contains two redexes (x, x −1 ) and (y, y −1 ).We write x for the list with the first redex removed and y for the list with the second redex removed.There are only three cases: (1) The two redexes are the same (they "fully overlap").In this case, there is nothing to do: The extended cospan is empty.(2) The two redexes partially overlap, in the sense that x −1 = y (or y −1 = x, which is equivalent).In this case, we again have x = y .(3) There is no overlap between the two redexes.We can then remove the redex (y, y −1 ) from x and have constructed a list equal to the one we get if we remove (x, x −1 ) from y .
It is a classic result by by Newman [22] that local confluence is as strong as general confluence in the context of Noetherian relations.The proof by Huet [14] can directly be expressed in our setting.Strictly speaking, our formulation could be described as stronger since we do not assume that the relation is decidable or even given as a function, but Huet's argument stays exactly the same: Theorem 27 (Newman [22], Huet [14]).A locally confluent and Noetherian relation is confluent.
Proof.By Noetherian induction, with P (u) expressing that any extended span s * • * t can be completed to a quadrangle.If either leg has length 0, the statement is trivial.Otherwise, we can write it as s * v u w * t.By local confluence, we get x such that v * x and w * x.By P (v), we get y with s * y and x y.By P (w), we get z with y * z and t * z.This proof can be pictured as shown below.

Ordering Cycles
Let again < be a relation on A. The aim of this section is to construct a relation on cycles < .We proceed in several steps.We start by defining a relation on ordinary lists, i.e. on the type List A. Next, we extend the relation to rotating lists.Finally, we construct the relation on cycles and prove essential properties.

5.
1.An Order on Lists.The type of lists on A is, as it is standard, inductively generated by a constructor nil for the empty list and a constructor adding a single element, and it is written as List A. As for chains, we write :: for both adding a single element and for list concatenation.We write [a] for the list of length 1 with the single element a : A.
Definition 28.Given the relation < as before, we define a relation < L on List A: For lists l, k, we define l < L k to mean that l can be constructed from k by replacing a single list element x in k by a finite number of elements of A, all of which are smaller than x.
A type-theoretic implementation of this relation is the following.For l : List A and x : A, we first define l < all x as "every element y of l satisfies y < x".The relation < L is then generated inductively by a single constructor as in inductive (< L ) : List A → List A → U step : Π{l 1 , l 2 , l 3 : List A}.Π{x : A}.
(l 2 < all x) → (l 1 :: l 2 :: l 3 ) < L (l 1 :: x :: We show in several steps that < L is well-founded assuming that < is.The following strengthening of the induction principle is derivable: Lemma 29 (nested induction).Assume we are given a relation < 1 on a type B, a relation < 2 on a type C, and a family P : B × C → U. Assume further that we are given Then, we get: Proof.By double induction on the accessibility witnesses.
Lemma 30.If lists l and k are both < L -accessible, then so is l :: k.
Proof.We use Lemma 29 with List A and < L as both < 1 and < 2 , and with P (l, k) :≡ acc < L (l :: k).We need to show (47).Assume l and k are < L -accessible.By definition, P (l, k) holds if every list smaller than l :: k is accessible.By Definition 28, a smaller list can either be written as l :: k with l < L l or as l :: k with k < L k.These are accessible by induction hypothesis.
Lemma 31.If a is <-accessible, then the singleton list [a] is < L -accessible.
Proof.We do <-induction on a.It is enough to show that l ≡ [a 1 , a 2 , . . ., a n ] is < Laccessible for any l < L [a].By the induction hypothesis, every [a i ] is < L -accessible.By Lemma 30, the whole list is < L -accessible.
Lemma 32.If < is well-founded, then so is < L .
Proof.Writing a given list l as the concatenation of singleton lists and applying Lemma 31, the list l is < L -accessible.

5.2.
A Rotation-Invariant Relation on Lists.Rotating a list is defined in the obvious way: The function rot : List A → List A (49) removes the first element of a list (if it exists) and adds it at the end of the list.We now define a version of < L which does not discriminate between lists that are the same module rotation.
Definition 33.Given the relation < on A, we define the relation < on List A by setting (k < l) :≡ Σ(n : By definition, the relation < is invariant under arbitrarily rotating the smaller list.We also have this property for the larger list: Lemma 34.If we have k < l, then we also have that k < rot m (l) for any natural number m.
Proof.It is enough to show the statement for m ≡ 1.Let us assume that we have a number n such that rot n (k) < L l.By definition of < L , the latter expression can be written as (l 1 :: l 2 :: l 3 ) < L (l 1 :: x :: l 3 ).
(51) If we rotate the right-hand side once, then there are two cases: If l 1 is non-empty, then rotating the left-hand side once gives again an instance of < L .If l 1 is the empty list, then rotating the left-hand side length(k) times yields an instance of < L .
Proof.We do < L -accessibility induction on l and assume acc < L (l).This allows us to assume that any k with k < L l is < -accessible.
Given any k with k < l, we need to show that k is < -accessible.By definition, we have a number n such that rot n (k ) < L l. Therefore, rot n (k ) and by Corollary 35 is < -accessible.
Corollary 37.If the relation < L is well-founded, then so is < .

5.
3. An Order on Cycles.Rotating a chain is defined analogously to rotating a list.Specialising to cycles and re-using the name introduced at (49), this gives us a function rot : < → < .
(52) This function essentially rotates the base point of the cycle.
For a given chain, we can produce the list of its vertices and forget the actual relation.We define this function as follows: π Specialised to cycles, this function lists the vertices of a cycle.Clearly, the functions rot and π commute.Note that the function π ignores the very first endpoint of a chain: π(nil a ) is the empty list, not the list containing a.This ensures that π works on cycles as expected and does not list the base point twice.(It also means that an empty cycle, although still being based at some point, has an empty list of vertices.This awkward edge case will not be relevant.) We can now extend the relation < L to chains and < to cycles, overloading the symbols: Definition 38 (inherited relations on chains and cycles).For chains f : a < s * b and g : c < s * d, we define f < L g to mean π(f ) < L π(g).For cycles p, q : < , we define p < q to mean π(p) < π(q).
Theorem 39.If is Noetherian on A, then + + is Noetherian on .

Constructions with Noetherian Relations on Cycles.
Definition 40 (span).Let γ : be a cycle.We say that γ contains a span if we find consecutive vertices v u w, i.e. if we have γ = (α :: s −1 :: for some α : a s * v, s : u v, t : u w, β : w s * a.
The very intuitive statement of the next lemma is illustrated in Fig. 2 below.
Lemma 41.If a relation is well-founded (or Noetherian), then any cycle γ : is either empty or contains a span.
Proof.If α is empty, we are done.Otherwise, by Lemma 23 combined with Lemma 22, γ is not monotone in the sense of Definition 5, i.e. not all segments of γ go into the same direction.This means that we can find a span by going over the vertices of the cycle.Let be locally confluent.By Definition 17, we get a map from spans to extended cospans.By concatenating the original span with this extended cospan, we get a cycle.We denote this function from spans to cycles by and call a cycle of the form L(κ) a confluence cycle.
Lemma 43.Let be Noetherian and locally confluent.Any cycle γ is either empty or there is a number n such that the rotation rot n (γ) can be written as the merge of a confluence cycle and a cycle δ with γ + + δ.
Proof.If γ is non-empty then, by Lemma 41, it contains a span.We can then write γ as given by (55).By rotating, we can bring the cycle into the form rot n (γ) = (κ :: τ −1 ) with κ : v u w being the span and τ : v s * w being a chain.By local confluence, there is a chain α : v s * w which is smaller than the span in the sense that κ +L+ α.We define δ :≡ α • τ −1 and have rot n (γ) + + δ, thus by Lemma 34 α + + δ as required.
Remark 44.With the construction in the above proof, we have in almost all cases γ + δ.Only if the chain α is empty, which may happen if v = w, we need two steps from γ to δ.

Families over Cycles
We move on from studying cycles to exploring type families indexed over cycles.
Definition 45 (stability under merging and rotating).Assume that Q : → U is a family of types.We say that Q is stable under merging if, whenever γ is the merge of cycles α and β such that we have Q(α) and Q(β), we also have Q(γ).We say that Q is stable under rotating if, for any cycle δ such that Q(δ), we also have Q(rot(δ)).
Theorem 46 (Noetherian cycle induction).Let be Noetherian and locally confluent.Assume further that Q : → U is stable under merging and rotating.If Q is inhabited at every empty cycle and at every confluence cycle, then Q is inhabited everywhere: If A is a set, then the first line of the above principle can be replaced and it can be stated as follows: → Π(α : ).Q(α). (58) Proof.The relation  we want to show a property Q for the big octagon a 0 − a 7 .We first "remove" the confluence cycle spanned by a 2 a 3 a 4 to get the nonagon consisting of a 0 − a 9 without a 3 but with the dashed edges: we now have more vertices, but the nonagon is smaller than the octagon in the order + + .In the next step, we "remove" the confluence cycle spanned by a 9 a 4 a 5 , and so on.Which confluence cycle is removed in a certain step depends on the precise proof of Lemma 41.

Applications of Noetherian Cycle Induction
We are now ready to combine the theory developed in the previous two sections with our result on set-quotients.
Theorem 47.Let A : U be a type, : A → A → U be a Noetherian and locally confluent relation, and X : U be a 1-type.Then, the type of functions (A/ ) → X is equivalent to the type of tuples (f, h, d 1 , d 2 ) (a nested Σ-type), where Further, if A is a set, the type (A/ ) → X is equivalent to the type of triples (f, h, d 2 ).
Proof.The case for A being a set follows immediately from the main statement, since the type of d 1 becomes contractible.
For the main statement, we want to apply Theorem 14.We need to show that the type of c in (40) is equivalent to the type of pairs (d 1 , d 2 ) above.Note that they are all propositions.From c, we immediately derive (d 1 , d 2 ) from Remark 8.
Let us assume we are given (d 1 , d 2 ).We need to derive c.We want to apply Noetherian cycle induction as given by Theorem 46 with Q(γ) :≡ h s * (γ) = refl.First of all, we need to check that Q is stable under merging and rotating.Rotating is easy and follows from the fact that left-and right-inverses of path composition coincide.Merging follows from associativity of path composition and (32, 33).We refer to our Lean formalisation for the details.
Finally, we check the two assumption of Theorem 46.Let γ be an empty cycle.With Remark 8, we can construct Q(γ) from d 1 .Let κ be a span.What we need is given by d 2 .
We want to use this theorem to show that the free higher group F A has trivial fundamental groups.Recall that this is the example discussed in the introduction, with F A defined in equation ( 5).
Theorem 48.The fundamental groups of the free higher group on a set are trivial.In other words, for a set A and any x : F A , we have We split the proof into several small lemmas.We keep using the relation of Example 1 and Lemma 25.Further, recall the functions ω 1 (7) and ω 2 (8) from the introduction, as well as the map ω (9).
Lemma 49 (free group; continuing Example 1 and Lemma 25).For the local confluence constructed in Lemma 25, we can construct a term Proof.This lemma allows a standard ad-hoc proof which works by first generalising to arbitrary paths instead of loops given by a list, and then applying path induction.For the third case in Lemma 25, we first repeatedly use that associativity of path composition is coherent (we have "MacLane's pentagon" by trivial path induction).Then, we have to show that the two canonical ways of simplifying e 1 (p p −1 ) e 2 (q q −1 ) e 3 to e 1 e 2 e 3 are equal.If p and q are both refl, then both simplifications become refl as well.In the second case, we have to show that the two ways of reducing e 1 p p −1 p e 2 to e 1 e 2 are equal.Again, if p is refl, this is automatic.The first case is trivial.Lemma 50.The free higher group F A is a retract of List(A + A) , in the sense that there is a map ϕ : Proof.For any x : A + A, the operation "adding x to a list" (x :: ) : can be lifted to a function of type Moreover, the function (67) is inverse to (x −1 :: ) and thus an equivalence.
Let be the unique element of the unit type 1.We define the relation ∼ on the unit type by ( ∼ ) :≡ A. Then, hcolim(A ⇒ 1) is by definition the coequaliser (1 ∼), and F A is given by (ι( ) = ι( )).This allows us to define ϕ using Theorem 10 with the constant family P :≡ (List(A + A) ), with the equivalence of the component e given by (67).
A further application of Theorem 10 show that ω • ϕ is pointwise equal to the identity.
Proof of Theorem 48.By [24, Thms 7.2.9 and 7.3.12], the statement of the theorem is equivalent to the claim that F A 1 is a set.
We now consider the following diagram: The dashed map exists by the combination of Theorem 47 (note that we are in the simplified case where the type to be quotiented is a set) together with Lemma 49 (and Lemma 9).By construction, the bottom triangle commutes.The top triangle commutes by Lemma 50.Therefore, the map |−| 1 factors through a set (namely List(A + A)/ ).This means that F A 1 is a retract of a set, and therefore itself a set.
There are a number of deep problems that we can approach in a similar fashion.Let us look at the following list, where the first question is the one discussed in the introduction: (i) Is the free higher group on a set again a set?(ii) Is the suspension of a set a 1-type (open problem recorded in [24,Ex 8.2])?(iii) Given a 1-type B with a base point b 0 : B. If we add a single loop around b 0 , it the type still a 1-type?(iv) Given B and b 0 as above, imagine we add M -many loops around b 0 for some given set M .Is the resulting type still a 1-type?(v) If we add a path (not necessarily a loop) to a 1-type B, is the result still a 1-type?(vi) If we add an M -indexed family of paths to a 1-type B (for some set M ), is the resulting type still a 1-type?All questions are of the form: "Can a change at level 1 induce a change at level 2 or higher?"Only (i) seems to be about level 0 and 1, but this is simply because we have taken a loop space.With our Theorem 47, we can show an approximation for each of these questions analogously to Theorem 48.This means that we show: "A change at level 1 does not induce a change at level 2 (but we don't know about higher levels)."Fortunately, we do not have to discuss each problem separately as they have a common generalisation.To see this, assume we have a span The proof of Theorem 51 then proceeds as follows.The construction of ω and ϕ is essentially the same as before, using the version of Theorem 10 for pushouts available in [19].For the relation (74), we can show the analogous to Lemmas 25 and 49.The analogous to (68) is There is a small subtlety: Since A is a set and B, C are 1-types, the type of lists L x,x is a set.This is important since it allows us (as before) to use the simpler version of Theorem 47.The above diagram shows that i(x) = i(x ) 1 is a set.Choosing x and x to be identical, this means that Ω(B + A C, i(x)) 1 is a set, which is equivalent to the statement that Ω 2 (B + A C, i(x)) 0 (the second homotopy group) is trivial.It follows by the usual induction principle of the pushout that Ω 2 (B + A C, z) 0 for arbitrary z : B + A C is trivial.

Final Remarks
Coherence of structures is a central concept in homotopy type theory.In most cases, the difficult part is to express coherence.In the present paper, this part is easy: The coherence in question is already expressed correctly in the fairly simple Theorem 14.Instead, proving or checking the coherence of data that occurred in natural examples is the tricky part.
Inside homotopy type theory, we conjecture that one application is the construction of the syntax of type theory together with an interpretation function in the standard model of sets and functions as described in Example 2. As noted for example in the Agda implementation by Escardó and Xu [10], all required equations hold judgmentally in the standard model.In other words, every p : a ∼ b gets interpreted as refl.But if every segment of a cycle gets mapped to refl, one might expect that it is easy to prove that the whole cycle gets mapped to refl as required by Theorem 14.Unfortunately, this is not the case.The first statement is meta-theoretic, while the second is internal.Although trivial for any concretely given cycle, it is unclear to us how to directly prove that all cycles get mapped to refl.However, it looks very plausible that confluence cycles can be checked.A difficulty is that the implementations of "type theory in type theory" do not simply first define types of expressions and then the relation, but both components are mutually defined.It seems necessary to adapt our main result accordingly.
It is natural to ask what one can say about the higher homotopy groups of the free higher group over a set.It may very well be possible to show "higher" versions of Theorem 47 which relax the condition of 1-truncatedness if X to, for example, 2truncatedness.The expectation is that this would require coherence for the proofs that one needs for confluence cycles.
We do not believe that the conditions on A, B, and C in Theorem 51 can be relaxed any further.If A is the non-set S 1 we get a counterexample, since the suspension of the circle is the sphere which does not have trivial higher homotopy

Fig. 1 Figure 1 .
Fig. 1 below illustrates these definitions, where a → b denotes a ∼ b.

( 2 )
transitivity: Given α : a ∼ * b and β : b ∼ * c, we notate their concatenation by (α :: β) : a ∼ * c.Overloading the symbol :: , we also use it instead of the constructor cons.(3) symmetry: We can invert α : a ∼ s * b to get α −1 : b ∼ s * a.This is done by inverting each single segment and reversing the order of all segments.Definition 7 (empty chains and cycles).There is an obvious function length : Π{a, b : A}.(a ∼ s * b) → N

) 2 . 5 .
Functions out of Set-Truncations.For types A and B, we have a canonical function ( A 0 → B) → (A → B) (27) which is given by composition with |−| 0 .Any such function g • |−| 0 is moreover constant on loop spaces in the sense that ap g•|−| 0 : (a = a) → (g(a) = g(a)) (28) satisfies ap g•|−| 0 (p) = refl, for all a and p.The following known result by Capriotti, Kraus, and Vezzosi states that this property is all one needs to reverse (27): Theorem 11 ([4]).Let A be a type and B be a 1-truncated type.The canonical function from ( A 0 → B) to the type

Definition 16 (
span).Given a relation , a span is a 5-tuple (a, b, c, s, t) of a, b, c : A together with s : a b and t : a c.We write (• • •) for the type of spans.If b and c are fixed, we write (b • c) for the type of triples (a, s, t).And extended span is the same 5-tuple as s span, but with s : a * b and t : a * c.The notion of a cospan and an extended cospan are defined analogously, with the directions of s and t reversed.We use the notations (• * • * •), and (b * • * c) and so on in the obvious way.

Figure 2 .a 0 a 1 and a 2 a 3 a 4 .− 1 β :: γ − 1 Figure 3 .
Figure 2. Two elements of < .The left cycle consists of points a i : A and contains two spans, namely a 4 a 0 a 1 and a 2 a 3 a 4 .The right cycle does not contain any span; this is not possible if the relation is Noetherian.

Figure 4 .
Figure 4.An illustration of Noetherian cycle induction.Assume we want to show a property Q for the big octagon a 0 − a 7 .We first "remove" the confluence cycle spanned by a 2 a 3 a 4 to get the nonagon consisting of a 0 − a 9 without a 3 but with the dashed edges: we now have more vertices, but the nonagon is smaller than the octagon in the order + + .In the next step, we "remove" the confluence cycle spanned by a 9 a 4 a 5 , and so on.Which confluence cycle is removed in a certain step depends on the precise proof of Lemma 41.
59) h : Π{a, b : A}.(a b) → f (a) = f (b) (60) d 1 : Π{a : A}.Π(p : a = a).apf (p) = refl (61) + + is Noetherian by Theorem 39.We perform Noetherian induction.The induction hypothesis in particular tells us that Q is inhabited for the smaller cycle given by Lemma 43.From this and from the assumption that Q is inhabited for every confluence cycle, we get the desired result.The version for A being a set follows from Remark 8.