Quotients, inductive types, and quotient inductive types
QQUOTIENTS, INDUCTIVE TYPES,& QUOTIENT INDUCTIVE TYPES
MARCELO P. FIORE , ANDREW M. PITTS , AND S. C. STEENKAMP ( (cid:66) ) Department of Computer Science and Technology, University of Cambridge, United Kingdom e-mail address : marcelo.fi[email protected] as Author 1 e-mail address : [email protected] as Author 1 e-mail address : [email protected]
Abstract.
This paper introduces an expressive class of indexed quotient-inductive types,called QWI types, within the framework of constructive type theory. They are initialalgebras for indexed families of equational theories with possibly infinitary operators andequations. We prove that QWI types can be derived from quotient types and inductivetypes in the type theory of toposes with natural number object and universes, providedthose universes satisfy the Weakly Initial Set of Covers (WISC) axiom. We do so byconstructing QWI types as colimits of a family of approximations to them defined bywell-founded recursion over a suitable notion of size, whose definition involves the WISCaxiom. We developed the proof and checked it using the Agda theorem prover. Introduction
Inductive types are an essential feature of many type theories and the proof assistantsand programming languages that are based upon them. Homotopy Type Theory [Uni13]introduces a powerful extension to the notion of inductive type: higher inductive types(HITs). To define an ordinary inductive type one declares the ways in which its elements areconstructed, and these constructions may depend inductively on smaller elements. To definea HIT one not only declares element constructors, but also declares equality constructorsvalued in identity types (possibly iterated ones), specifying how the element constructors(and possibly the equality constructors) are related. In the language of homotopy theory,these correspond to points, paths, surfaces, and so on.In this paper, rather than using HoTT, we work in the simpler setting of ExtensionalType Theory [Mar82], where any propositional equality is reflected as a definitional equality.However, our results also hold for an intensional type theory with the uniqueness of identityproofs axiom (UIP), as demonstrated by our Agda development which can be found at [FPS21].In either case identity types are trivial in dimensions higher than one, so that any two proofs
Key words and phrases: dependent type theory, higher inductive types, quotient types, well-foundedrelation, weakly initial set of covers, topos theory.
Preprint submitted toLogical Methods in Computer Science © M. P. Fiore, A. M. Pitts, and S. C. Steenkamp CC (cid:13) Creative Commons a r X i v : . [ c s . L O ] J a n M. P. FIORE, A. M. PITTS, AND S. C. STEENKAMP of identity are equal. Nevertheless, as Altenkirch and Kaposi [AK16] point out, HITs arestill useful in such a one-dimensional setting. They introduced the term quotient inductivetype (QIT) for this truncated form of HIT.One specific advantage of QITs over inductive types is that they provide a naturalway to study universal algebra in type theory, since in general algebraic theories cannot berepresented in an equation-free way just using inductive notions [MM16]. As an example,the free commutative monoid on carrier X is given by the quotient inductive type of finitemultisets , Bag X , with constructors: [] ∶ Bag X _ ∶∶ _ ∶ X → Bag X → Bag X swap ∶ ∏ x,y ∶ X ∏ zs ∶ Bag X x ∶∶ y ∶∶ zs = y ∶∶ x ∶∶ zs (1.1)This can be seen as the element constructors for lists ( [] and ∶∶ ), along with an equalityconstructor swap that allows all reorderings of a list to be identified. Notice that the swap constructor lands in the identity type on Bag X (just written as _ = _), making it an equation constructor, compared to the element constructors, [] and _ ∶∶ _, which are familiar fromordinary inductive type definitions.An alternative presentation of multisets, whose equalities can be easier to work with, is: [] ∶ Bag ′ X _ ∶∶ _ ∶ X → Bag ′ X → Bag ′ X comm ∶ ∏ x,y ∶ X ∏ as , bs , cs ∶ Bag ′ X as = y ∶∶ cs → x ∶∶ cs = bs → x ∶∶ as = y ∶∶ bs (1.2)Notice that the comm equality constructor is conditional on two equations, as = y ∶∶ cs and x ∶∶ cs = bs , in order to deduce the final equation x ∶∶ as = y ∶∶ bs . The QWI-types introducedin this paper are not able to encode such conditional QITs (at least, not obviously so); seethe discussion in the Conclusion.Given the parameter X , the types Bag X and Bag ′ X are single quotient-inductive types,rather than indexed families defined quotient-inductively. As an example of the latter,consider the go-to example of an inductively defined family, the vector type (length-indexedlists). This has a commutative variant, AbVec
X n for n ∶ N , which makes it an example ofan indexed QIT. It has constructors: [] ∶ AbVec X _ ∶∶ _ ∶ X → ∏ i ∶ N AbVec
X i → AbVec X ( suc i ) swap ∶ ∏ x,y ∶ X ∏ i ∶ N ∏ zs ∶ AbVec
X i x ∶∶ y ∶∶ zs = y ∶∶ x ∶∶ zs (1.3) Other presentations of multisets are available, aside from the two presentations given here. Incidentally,the mono-sorted algebra of monoids has an equation-free presentation – the multi-sorted algebra of Lists –and this is why no equation for associativity is needed in either definition of multisets.
UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 3
Our final example of a QIT is unordered countably-branching trees over X , called ω Tree X , with constructors: leaf ∶ ω Tree X node ∶ X → ( N → ω Tree X ) → ω Tree X perm ∶ ∏ x ∶ X ∏ b ∶ N → N ∏ b ′ ∶ isIso b ∏ f ∶ N → ω Tree X node x f = node x ( f ○ b ) (1.4)where elements of isIso b witness that b is a bijection. (As with AbVec , one could similarlyconsider a depth-indexed variant of ω Tree .) The significance of this example is that the node x _ and perm x b b ′ _ constructors have infinite arity, making this an example of an infinitary QIT. This type is one of the original motivations for considering QITs [AK16],since they can enable constructive versions of structures that classically use non-constructivechoice principles, as we explain next.The examples of QITs in (1.1)–(1.3) only involve element constructors of finite arity.For example in (1.1), [] is nullary and for each x, y ∶ X , x ∶∶ _ and swap x y _ are unary.Consequently Bag X is isomorphic to the type obtained from the ordinary inductive type offinite lists over X by quotienting by the congruence generated by swap . By contrast, (1.4)involves element and equality constructors with countably infinite arity. So if one first formsthe ordinary inductive type of ordered countably-branching trees (by dropping the equalityconstructor perm from the declaration) and then quotients by a suitable relation to get theequalities specified by perm , one appears to need the axiom of countable choice to be able tolift the node element constructor to the quotient [AK16, Section 2.2]. The construction of theCauchy reals as a higher inductive-inductive type [Uni13, Section 11.3] provides a similar, butmore complicated example where use of countable choice is avoided. So it seems that withoutsome form of choice principle, quotient inductive types are strictly more expressive thanthe combination of ordinary inductive types with quotient types. Indeed, Lumsdaine andShulman [LS19, Section 9] turn an infinitary equational theory due to Blass [Bla83, Section 9]into a higher-inductive type that cannot be proved to exist in ZF set theory without theAxiom of Choice. In this paper we show that in fact a much weaker and constructivelyacceptable form of choice is sufficient for constructing indexed quotient inductive types. Thisis the Weakly Initial Set of Covers (WISC) axiom, originally called the “Axiom of MultipleChoice” by van den Berg and Moerdijk [vdBM14]. WISC is constructively acceptable inthat it holds in the internal logic of a very wide range of toposes [Joh02] (for example, allGrothendieck and all realizability toposes over the topos of classical sets), including thosecommonly used in the semantics of Type Theory. Section 4 reviews WISC and our motivationfor using it herein.Thus we make two contributions: ● First we define a class of indexed quotient inductive types called
QWI-types and giveelimination and computation rules for them (Section 3). The usual W-types of Martin-Löf[Mar82] are inductive types giving the algebraic terms over a possibly infinitary signature.One specifies a QWI-type by giving a family of equations between such terms. So suchtypes give initial algebras for (families of) possibly infinitary algebraic theories. Aswe indicate in Section 7, they can encode a very wide range of examples of possiblyinfinitary, indexed quotient inductive types. In classical set theory with the Axiom ofChoice, QWI-types can be constructed simply as Quotients of the underlying IndexedW-type—hence the name.
M. P. FIORE, A. M. PITTS, AND S. C. STEENKAMP ● Secondly, our main result (Theorem 6.1) is that with only WISC it is still possibleto construct QWI-types from inductive types and quotients in the constructive typetheory of toposes, but not simply by quotienting a W-type. Instead, quotienting isinterleaved with an inductive construction. To make sense of this and prove that theresulting type has the required universal property, we construct the type as the colimitof a family of approximations to it defined by well-founded recursion over a suitablenotion of size (a constructive version of what classically would be accomplished witha sequence of transfinite ordinal length). Our notion of size is developed in Section 5.Sizes are elements of a W-type equipped with the plump [Tay96] well-founded order; andWISC allows us to make the W-type big enough that a given polynominal endofunctorpreserves size-indexed colimits (Corollary 5.9). This fact is then applied in Section 6 toform QWI-types as size-indexed colimits.
Note.
This paper is a greatly revised and expanded version of our earlier paper [FPS20],which introduced QW-types (the non-indexed version of Definition 3.2). Here, as well asconsidering the more expressive indexed form, we put their construction from inductive andquotient types on a firm semantic footing using a well-founded notion of size and WISC.In the previous work we instead used sized types [Abe12] as they are implemented in theAgda theorem prover [Agd20]. Unfortunately, in the current version of Agda sized types arelogically unsound ( github.com/agda/agda/issues/3026 ); however, the Agda developmentfrom [FPS20] does type check in Agda v2.5.2, which is not known to have unsoundnessbugs. The Agda development for the results in this paper, avoiding sized types, is availableat [FPS21]. 2.
Type theory
The results in this paper are proved in a version of Extensional Type Theory [Mar82] whichis an internal language for toposes [Joh02] with natural number object and universes. We usethis type theory in an informal way, in the style of the HoTT book [Uni13] and in particularuse its notation for type theory. Thus dependent function types are written ∏ x ∶ A B x andnon-dependent ones as either A → B or B A . Dependent product types are written ∑ x ∶ A B x and non-dependent ones as A × B . Coproduct types are written A + B (with injections ι ∶ A → A + B and ι ∶ B → A + B ); and finite types are written (with no elements), (with a single element ), (with two elements , ), etc. The identity type for x ∶ A and y ∶ A is x = A y , or just x = y when the type A is known from the context. When we needto refer to the judgement that x and y are definitionally equal, we write x ≡ y . Unlikein [Uni13], the type x = y is an extensional identity type and so it is inhabited iff x ≡ y holds.In particular, proofs of identity are unique when they exist and so it makes sense to useMcBride’s heterogeneous form of identity type [McB99] wherever possible. Given x ∶ A and y ∶ B , we denote the heterogeneous identity type by x == y ; thus this type is inhabited iff A ≡ B and x ≡ y .The type theory has universes of types, U ∶ U ∶ U , . . . which we write just as U when the universe level is immaterial. We use Russell-style universes (there is no syntacticdistinction between an element A ∶ U and the corresponding type of its elements). Influencedby Agda (see below) and unlike the HoTT Book [Uni13], we do not assume universes arecumulative, but instead use Agda-style closure under ∏ -types: if A ∶ U i and B ∶ A → U j ,then ∏ x ∶ A B x ∶ U max ij . Since we only consider toposes with natural number object, we can UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 5 ● Given A ∶ U and R ∶ A → A → Prop , we have: A / R ∶ U[ _ ] R ∶ A → A / R qeq R ∶ ∀( x, y ∶ A ) . R x y → [ x ] R = [ y ] R ● Furthermore, given B ∶ A / R → U and f ∶ ∏ x ∶ A B ([ x ] R ) , we have: qelim R B f ∶ (∀( x, y ∶ A ) . R x y → f x == f y ) → ∏ z ∶ A / R B z qcomp R B f ∶ (∀( x, y ∶ A ) . R x y → f x == f y ) → ∀( x ∶ A ) . qelim B f [ x ] R = f x ● Quotients of equivalence relations are effective: writing ER R for the proposition that R is reflexive, symmetric and transitive, we have: qeff R ∶ ER R → ∀( x, y ∶ A ) . [ x ] R = [ y ] R → R x y
Figure 1: Quotient typesassume the universes are closed under forming not just W-types [MP00, Proposition 3.6], butalso all inductively defined indexed families of types [GH04]. Indexed W-types are consideredin more detail in the next section.The lowest universe contains an impredicative universe
Prop of propositions, correspond-ing to the subobject classifier in a topos.
Prop contains the identity types, is closed underintuitionistic connectives ( ∧ , ∨ , → , ↔ , etc.) and quantifiers ( ∀( x ∶ A ) .φ and ∃( x ∶ A ) .φ ), for A in any universe), and satisfies propositional extensionality: propext ∶ ∀( p, q ∶ Prop ) . ( p ↔ q ) → p = q (2.1)Being an extensional type theory, we also have function extensionality: funext ∶ ∀ ( f, g ∶ ∏ x ∶ A B x ) . (∀( x ∶ A ) . f x = g x ) → f = g (2.2)Note that like the universes U i , Prop is also a Russell-style universe, in that we do not makea notational distinction between a proposition p ∶ Prop and the type of its proofs. Given A ∶ U and φ ∶ A → Prop , we regard the comprehension type { x ∶ A ∣ φ x } in U as synonymouswith the dependent product ∑ x ∶ A φ x .Toposes have coequalizers and effective epimorphisms [Joh02, A2.4]. Correspondingly thetype theory contains quotient types, with notation as in Figure 1 (recall that == stands forheterogeneous identity). These can be constructed in the usual way via equivalence classes,using Prop ’s impredicative quantifiers and the fact that toposes satisfy unique choice: uniquechoice ∶ (∃( x ∶ A ) . ∀( y ∶ A ) .x = y ) → A (2.3)Thus uniquechoice is a function mapping proofs that A has exactly one element to a namefor that one element. Agda development.
We have developed and checked a version of the results in this paperusing the Agda theorem prover [Agd20]. Being intensional and predicative, the type theoryprovided by Agda is weaker than the one described above, but can be soundly interpreted init. One has to work harder to establish the results with Agda, since two expressions that aredefinitionally equal in Extensional Type Theory may not be so in Agda and hence one has
M. P. FIORE, A. M. PITTS, AND S. C. STEENKAMP to produce a term in a corresponding identity type to prove them equal. On the other hand,when a candidate term is given, Agda can decide whether or not it is a correct proof, becausevalidity of the judgements of the type theory it implements is decidable , in contrast withthe situation for Extensional Type Theory [Hof95]. Our development is also made easierby extensive use of the predicative universes of proof-irrelevant propositions that featurein recent versions of Agda. Not only are any two proofs of such propositions definitionallyequal, but inductively defined propositions (such as the well-founded ordering on sizes usedin Section 6) can be eliminated in proofs using dependent pattern matching, which is a verygreat convenience. We still need these propositions to satisfy the extensionality (2.1) andunique choice (2.3) properties, so we add them as postulates in Agda. Also, the impredicativeconstruction of quotient types is not available, so we get quotients as in Figure 1 by postulatingthem and using a user-declared rewrite to make their computation rule a definitional equality.Although function extensionality (2.2) is not provable in Agda’s core type theory, it becomesso once one has such quotient types. Our Agda development is available at [FPS21].3. Indexed containers and equational systems
In this section we introduce a class of indexed quotient inductive types, called QWI-types,which are free algebras for indexed families of possibly infinitary equational theories.Given a type I ∶ U , when we map between two I -indexed types, say A ∶ U I to B ∶ U I , wewill write A ⇁ B def = ∏ k ∶ I A k → B k (3.1)for the function type; in the non-indexed case, A ⇁ B becomes the ordinary function type A → B . The composition of f ∶ A ⇁ B and g ∶ B ⇁ C will just be written as g ○ f def = λi.λx. g i ( f i x ) (3.2)We also often need to define an indexed family of types B a ∶ U I which is dependent on someterm a ∶ A i for A ∶ U I . The type of such families will be written as A ⇁̸ U I def = ∏ i ∶ I A i → U I (3.3)This simplifies to B ∶ A → U in the non-indexed case.As for ordinary W-types, the indexed version of our QW types gives convenient expressivepower (see Section 7). However, the definitions and constructions are easier to understand inthe non-indexed case, as in the conference version of this paper [FPS20]. In what followswe often leave indexes implicit when they can be inferred. Thus we invite the reader in thefirst instance to ignore indexing types I and read each occurrence of U I as simply U ; andsimilarly any family ∏ i ∶ I . . . as a singleton family. though not always feasibly so UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 7
Indexed containers.
We take our notion of a signature for an indexed W-typeto be a particular case of indexed containers [AAG05], namely an element of the type ∑ I ∶U ∑ A ∶U I ∏ i ∶ I A i → U I , which with the above notational conventions we write as Sig def = ∑ I ∶U ∑ A ∶U I A ⇁̸ U I (3.4)We only need indexed containers whose the source and target indexing types are the same,since we only need to consider algebras of endofunctors on the category of I -indexed familiesin U . Thus a signature Σ ≡ ( I, A, B ) is a triple that can be thought of as a set of indices I , an I -indexed family of operators A i , and a function mapping each operator a ∶ A i to an I -indexed family of arities in U I . For instance, the type of vectors over some type D has: ● natural numbers as indices; ● for index a parameter-less operator for the empty vector, and for index n + an operatorparametrised by D for cons; and ● for the operator indexed by , a family of empty types for arities, and for operatorsindexed by n + , a family ∏ i ∶ I δ i,n of arities which is the unit type just in the n th index,and empty otherwise.Each such signature determines a polynomial endofunctor S Σ ∶ U I → U I , which is defined ata family X ∶ U I by ( S I,A,B X ) i def = ∑ a ∶ A i ( B i a ⇁ X ) (3.5)An S Σ - algebra is by definition an element of the dependent product Alg Σ def = ∑ X ∶U I ( S Σ X ) ⇁ X (3.6) S Σ -algebra morphisms ( X, α ) → ( X ′ , α ′ ) are given by an I -indexed family of functions h ∶ X ⇁ X ′ together with a family of elements in the types ( isHom h ) i def = ∏ a ∶ A i ∏ b ∶ B i a ⇁ X ( α ′ i ( a, h ○ b ) = h i ( α i ( a, b ))) (3.7)The WI-type W a ∶ A i B i a , or W Σ , determined by Σ ≡ ( I, A, B ) is the underlying type of aninitial S Σ -algebra. More generally, Dybjer [Dyb97] shows that the initial algebra of anynon-nested, strictly positive endofunctor on U is given by a W-type; and Abbott, Altenkirch,and Ghani [AAG05] extend this to the case with nested uses of W-types as part of theirwork on containers.The elements of W Σ represent an I -indexed family of closed algebraic terms (i.e. well-founded trees) over the signature Σ . From this point of view it is natural to consider notonly closed terms solely build up from operations, but also open terms additionally built upwith variables drawn from some family V ∶ U I . Categorically, the type T Σ V of such openterms is the free S Σ -algebra on V and is another W-type for the signature that is obtainedfrom Σ with the elements of V added as nullary operations. Nevertheless, it is convenientto give a direct inductive definition: the value of T Σ ∶ U I → U I at some some V ∶ U I , is theinductively defined type with constructors η ∶ V ⇁ T Σ Vσ ∶ S Σ ( T Σ V ) ⇁ T Σ V (3.8)Given an S Σ -algebra ( X, α ) ∶
Alg Σ and an I -indexed family of functions f ∶ V ⇁ X , theunique morphism of S Σ -algebras from the free S Σ -algebra T V, σ on V to ( X, α ) has an M. P. FIORE, A. M. PITTS, AND S. C. STEENKAMP underlying family of functions T Σ V ⇁ X mapping each t ∶ ( T Σ V ) i to the element t ≫= f defined by recursion on the structure of t : η x ≫= f def = f xσ ( a, b ) ≫= f def = α ( a, λ x . b x ≫= f ) (3.9)As the notation suggests, ≫= is the Kleisli lifting operation (“bind”) for a monad structureon T Σ ; indeed, it is the free monad on the endofunctor S Σ .3.2. QWI-type.
The notion of
QWI-type that we introduce in this section is obtained fromthat of a W-type by considering not only the algebraic terms over a given structure, but alsoequations between terms. To code equations we use a type-theoretic, and indexed, renderingof a categorical notion of equational system introduced by Fiore and Hur, referred to as termequational system [FH09, Section 2] and as monadic equational system [Fio13, Section 5],here instantiated to free monads on signatures.
Definition 3.1. A system of equations over a signature Σ ∶ Sig is specified by: ● An I -indexed family of types E ∶ U I . The elements e ∶ E i can be thought of as names foreach equation. ● For each equation e ∶ E i , an I -indexed family of types V i e ∶ U I , where V i e represents thevariables used in the equation e . That is, a function V ∶ E ⇁̸ U I . ● For each equation e ∶ E i , two elements called l e and r e of type ( T Σ ( V i e )) i , which is thevalue at i of the free S Σ -algebra on the “variables” V i e . So l e and r e can be thought ofas the abstract syntax tree (AST) of a term with some leaves being free variables drawnfrom V i e .So systems of equations are elements of the dependent product Syseq Σ def = ∑ E ∶U I ∑ V ∶ E ⇁̸U I ( ∏ i ∶ I ∏ e ∶ E i ( T Σ ( V i e )) i ) × ( ∏ i ∶ I ∏ e ∶ E i ( T Σ ( V i e )) i ) (3.10)An S Σ -algebra α ∶ S Σ X ⇁ X satisfies the system of equations ε ≡ ( E, V, l, r ) ∶
Syseq Σ if foreach i ∶ I there is a proof of ( Sat α,ε X ) i def = ∀( e ∶ E i ) . ∀( ρ ∶ ∏ j ∶ I V i,j e → X j ) . (( l e ) ≫= ρ ) = (( r e ) ≫= ρ ) (3.11)The category-theoretic view of QWI-types is that they are simply S Σ -algebras that are initialamong those satisfying a given system of equations: Definition 3.2 ( QWI-type ) . A QWI-type for a signature Σ ≡ ( I, A, B ) ∶
Sig and a systemof equations ε ≡ ( E, V, l, r ) ∶
Syseq Σ is given by a type QW ∶ U I equipped with an S Σ -algebrastructure and a proof that it satisfies the equations qwintro ∶ S Σ QW ⇁ QW (3.12) qwequate ∶ Sat qwintro ,ε QW (3.13) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 9 together with functions that witness that it is an initial such algebra: qwrec ∶ ∏ X ∶U I ∏ α ∶ S Σ X ⇁ X ( Sat α,ε ( X ) → ( QW ⇁ X )) (3.14) qwrechom ∶ ∏ X ∶U I ∏ α ∶ S Σ X ⇁ X ∏ p ∶ Sat α,ε ( X ) isHom ( qwrec X α p ) (3.15) qwuniq ∶ ∏ X ∶U I ∏ α ∶ S Σ X ⇁ X ∏ p ∶ Sat α,ε ( X ) ∏ f ∶ QW ⇁ X isHom f → qwrec X α p = f (3.16) Remark 3.3 ( QW-type ) . The special case of Definition 3.1 when I = is a one-elementtype is equivalent to the notion of system of equations from our conference paper [FPS20,Definition 1]: Σ is given by A ∶ U and B ∶ A → U ; and ε by E ∶ U , V ∶ E → U and l, r ∶ ∏ e ∶ E T Σ ( V e ) . Thus QW-types [FPS20, Definition 2] are the I = special case ofQWI-types. Remark 3.4 ( Free algebras ) . Definition 3.2 defines QWI-types as initial algebras forsystems of equations ε over signatures Σ . More generally, the free ( Σ , ε ) -algebra on a family X ∶ U I is a family F Σ ,ε X ∶ U I equipped with an S Σ -algebra structure S Σ ( F Σ ,ε X ) ⇁ F Σ ,ε X satisfying the system of equations ε and an inclusion of generators η X ∶ X → F Σ ,ε X which isuniversal among such data. Initial algebras are the X = special case of free algebras. Butonce one has them, one also has free algebras, by change of signature: F Σ ,ε X is the QWI-typefor the signature Σ X and system of equations ε X defined as follows. If Σ = ( I, A, B ) , then Σ X = ( I, λi. X i + A i , B X ) where B X ∶ ∏ i ∶ I ( X i + A i → U I ) satisfies ( B X ) i ( ι x ) = λj. and ( B X ) i ( ι a ) = B i a . And if ε = ( E, V, l, r ) , then ε X = ( E, V, l X , r X ) where for each i ∶ I and e ∶ E i , l X e = ( l e ≫= η ) and r X e = ( r e ≫= η ) (using the S Σ -algebra structure s on T Σ ( V i e ) given by s ( a, b ) = σ ( ι a, b ) ).The definition of S Σ in (3.5) and Sat α,ε in (3.11) are suggestive that a QWI-type is an instanceof the indexed version of the notion of quotient-inductive type [AK16], with qwintro as theelement constructor and qwequate as the equality constructor. To show that QWI-typesare indeed an instance of indexed quotient-inductive types, they need to have the requisitedependently-typed elimination and computation properties for these elements and equalityconstructors. We show that these follow from (3.14)–(3.16) and function extensionality. Tostate this proposition we need a dependent version of the bind operation (3.9). This isbecause the free variables of a dependently-typed abstract syntax tree require substitutionsof terms that include the dependency – a ∑ -type.For each motive P and induction step p , P ∶ ∏ i ∶ I QW i → U p ∶ ∏ i ∶ I ∏ a ∶ A i ∏ b ∶ B i a ⇁ QW ( ∏ j ∶ I ∏ x ∶( B i a ) j P j ( b j x )) → P i ( qwintro i ( a, b )) (3.17) In this paper we work with extensional type theory, so the computation property, (3.20), is also adefinitional equality. In our Agda development we work in intentional type theory, thus therein we onlyestablish the computation property up to propositional equality; so, using the terminology of Shulman [Shu18],those are typal indexed quotient-inductive types. as well as family X ∶ U I , an I -indexed substitution ρ ∶ ( X ⇁ ∑ x ∶ QW P x ) , and term t ∶ ( T X ) j for j ∶ I , we have an element of lift P,X p ρ t ∶ P ( t ≫= π ○ ρ ) defined by recursion on thestructure of t : lift P,X p ρ ( η x ) def = π ( ρ x ) lift P,X p ρ ( σ ( a, b )) def = p j a ( λ x . b x ≫= ( π ○ ρ )) (( lift P,X p ρ ) ○ b ) (3.18)Note that the substitution ρ gives terms in the “dependent telescope” ∑ x ∶ QW i P i x , which willbe written as P ′ . Proposition 3.5.
For a QWI-type as defined above, given P and p as in (3.17) , and a term p resp of type ∏ i ∶ I ∏ e ∶ E i ∏ ρ ∶ V i e ⇁∑ x ∶ QW P x lift
P,X p ρ ( l e ) == lift P,X p ρ ( r e ) (3.19) there are elimination and computation terms qwelim ∶ ∏ i ∶ I ∏ x ∶ QW i P i x qwcomp ∶ ∏ i ∶ I ∏ a ∶ A i ∏ b ∶ B i a ⇁ QW qwelim ( qwintro ( a, b )) = p i a b ( λ j . qwelim j ○ b j ) (3.20)(Note that (3.19) uses heterogeneous identity == , because lift P,X p ρ ( l e ) and lift P,X p ρ ( r e ) inhabit different types, namely P ( l e ≫= π ○ ρ ) and P ( r e ≫= π ○ ρ ) respectively.) Proof.
To define the eliminator, we must first use the algebra map on the more general type P ′ i def = ∑ x ∶ QW i P i x for all indexes i ∶ I . The algebra map, qwrec , requires that this type P ′ has an algebra structure β ∶ S Σ P ′ ⇁ P ′ , which is given, for each i , by: β ( a, b ) def = ( qwintro ( a, π ○ b ) , p a ( π ○ b ) ( π ○ b )) (3.21)Moreover, we must show that the recursor satisfies the equations by giving a proof s ∶ Sat β,ε P ′ ,which we do pointwise on the two elements of the dependent product P ′ . Taking projectionsdistributes (possibly dependently) over ≫= ; so to construct s it suffices that, given any e ∶ E i and ρ ∶ V i e ⇁ P ′ , we have the two terms: qwequate e ρ ∶ l e ≫= ( π ○ ρ ) = r e ≫= ( π ○ ρ ) p resp e ρ ∶ lift p ρ ( l e ) == lift p ρ ( r e ) (3.22)Then the eliminator is defined by taking the second projection of this recursor. qwelim def = π ○ r def = π ○ qwrec P ′ β s (3.23)Given an element ( a, b ) ∶ ( S Σ QW ) i , we can prove that applying the eliminator to it computes – qwelim ( qwintro ( a, b )) = p i a b ( qwelim ○ b ) – as follows: qwelim ( qwintro ( a, b ))== π ( r ( qwintro ( a, b ))) (def. of qwelim ) == π ( β i ( a, ( r ○ b ))) (using qwrechom against qwintro ( a, b ) ) == p i a ( π ○ r ○ b ) ( π ○ r ○ b ) (def. of β ) == p i a b ( π ○ r ○ b ) ( r preserves QW in the first component;follows from qwrechom and qwuniq ) == p i a b ( qwelim ○ b ) (def. of qwelim ) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 11 Weakly initial sets of covers
In Section 3 we defined a QWI-type in a topos to be an initial algebra for a given (possiblyinfinitary) signature and system of equations (Definition 3.2). If one interprets these notionsin the topos of sets in classical Zermelo-Fraenkel set theory with the axiom of Choice (ZFC),one regains an indexed version of the usual notion from universal algebra of initial algebrasfor infinitary equational theories. Thus in ZFC, the QWI-type for a signature Σ = ( I, A, B ) and system of equations ε = ( E, V, l, r ) can be constructed by first forming the I -indexedfamily W Σ of sets of well-founded trees over Σ and then quotienting by the congruencerelation ∼ ε on W Σ generated by ε . The I -indexed family of quotient sets ( W Σ )/∼ ε yields thedesired initial algebra for ( Σ , ε ) provided the S Σ -algebra structure on W Σ induces one onthe quotient sets. It does so, because for each operator in the signature, using the Axiomof Choice (AC) one can pick representatives of the (possibly infinitely many) equivalenceclasses that are the arguments of the operator, apply the interpretation of the operator in W Σ and then take the equivalence class of that. So the topos of sets in ZFC has QWI-types.Is this use of AC really necessary? Blass [Bla83, Section 9] shows that if one drops ACand just works in ZF, then provided a certain large cardinal axiom is consistent with ZFC, itis consistent with ZF that there is an infinitary equational theory with no initial algebra. Heshows this by first exhibiting a countably presented equational theory whose initial algebrahas to be an uncountable regular cardinal; and secondly appealing to the construction ofGitik [Git80] of a model of ZF with no uncountable regular cardinals (assuming a certainlarge cardinal axiom). Lumsdaine and Shulman [LS19] turn the infinitary equational theoryof Blass into a higher-inductive type that cannot be proved to exist in ZF (and hence cannotbe constructed in type theory just using pushouts and the natural numbers). We show inExample 7.7 that this higher inductive type can be presented as a QWI-type.So one cannot hope to construct QWI-types using a type theory which is interpretablein just ZF. However, the type theory in which we work (Section 2) already requires goingbeyond ZF to be able to give a classical set-theoretic interpretation of its universes (byassuming the existence of enough strongly inaccessible cardinals, for example). So the aboveconsiderations about non-existence of initial algebras for infinitary equational theories inZF do not necessarily rule out the construction of QWI-types in other toposes with naturalnumber object and universes. In Section 6, we show that a very wide range of toposes haveQWI types, namely the ones satisfying the following constructively acceptable form of choice. Definition 4.1 ( WISC ) . A universe U has weakly initial sets of covers if for every A ∶ U ,there is a type Cov A ∶ U and a family of types Dom A ∶ Cov A → U with the property thatfor all surjective functions q ∶ B → A in U , there exists c ∶ Cov A and e ∶ Dom A c → B forwhich q ○ e ∶ Dom A c → A is surjective. We say that a topos with natural number object anduniverses satisfies WISC if each of its universes has a weakly initial set of covers for everytype in the universe.This axiom was introduced independently by van den Berg and Moerdijk [vdBM14] whoexpress it in constructive set theory CZF and call it the Axiom of Multiple Choice (buildingupon previous work by Moerdijk and Palmgren [MP02]); and by Streicher [Str05], whocalls it
TTCA f . We follow https://ncatlab.org/nlab/show/WISC in using the “WISC”terminology, which is justified as follows. A cover of A ∶ U is just a surjective function q ∶ B → A for some B ∶ U . If Dom A ∶ Cov A → U is as in the above definition, then the type ∑ c ∶ Cov A ∑ f ∶ Dom A c → A ∀( x ∶ A ) . ∃( y ∶ Dom A c ) .f y = x of all covers of A with domains in { Dom A c ∣ c ∶ Cov A } is weakly initial: for every cover q ∶ B → A of A in U , there is a cover in the family which factors through q . Conversely, if p ∶ I → ∑ B ∶U ∑ f ∶ B → A ∀( x ∶ A ) . (∃ y ∶ B ) .f x = y is a weakly initial family of covers (i.e. for every cover q ∶ B → A , there exists i ∶ I sothat the cover π ( π ( p i )) ∶ π ( p i ) → A factors through q ), then we can take Cov A = I and Dom A = π ○ p in Definition 4.1.Note that in classical set theory AC implies WISC: the axiom of choice implies that coverssplit and so we can take Cov A to be the type with unique element ∶ and Dom A = A .WISC is independent of ZF in classical logic [Kar14; Rob15]. In constructive logic it ispreserved by many ways of making new toposes from existing ones, in particular by theformation of sheaf toposes and realizability toposes over a given topos [vdBM14]. Thus itholds in all the toposes commonly used for the semantics of Type Theory. It is in this sensethat WISC is a constructively acceptable form of the axiom of choice. (Roberts [Rob15] givesexamples of toposes which fail to satisfy WISC.)The following lemma gives a convenient reformulation of WISC: Lemma 4.2.
Suppose that a universe U has weakly initial sets of covers. If A ∶ U , B ∶ A → U and φ ∶ ∏ x ∶ A ( B x → Prop ) satisfy ∀( x ∶ A ) . ∃( y ∶ B x ) . φ x y , then there exist c ∶ Cov A , a surjection p ∶ Dom A c → A and a function q ∶ ∏ z ∶ Dom A c B ( p z ) satisfying ∀( z ∶ Dom A c ) . φ ( p z ) ( q z ) .Proof. Consider the type E def = ∑ x ∶ A ∑ y ∶ B x φ x y in U . By assumption π ∶ E → A is asurjection, so by WISC there exist c ∶ Cov A and e ∶ Dom A c → E with π ○ e a surjection. Sowe can take p = π ○ e and q to be the function mapping each z ∶ Dom A c to π ( π ( z )) ; andthen π ( π ( z )) is a proof that φ ( p z )( q z ) holds.5. Size
Swan [Swa18] uses WISC to construct
W-types with reductions , which are a simple specialcase of QWI-types (see Example 7.5). We will see that in fact WISC implies the existence ofall QWI-types, but using a different approach from that of Swan [Swa18]. We show in thissection that, starting with a given signature Σ and system of equations ε as in Definition 3.1,using WISC one can construct a well-founded notion of “size” with the property that colimitsof size-indexed diagrams are preserved when taking exponents by certain types associatedwith ( Σ , ε ) (roughly speaking, any arity, or cover, or cover of a cover of such arities). Thiswill enable us to construct the QWI-type for ( Σ , ε ) as a sized-indexed colimit in Section 6.Size is here playing a role in the constructive type theory of toposes that in classical settheory would be played by ordinal numbers. The next definition gives the properties of sizethat we need. Definition 5.1 ( Size ) . A type
Size ∶ U will be called a type of sizes if it comes equippedwith a binary relation _ < _ ∶ Size → Size → Prop which is transitive ∀ i, j, k. i < j → j < k → i < k (5.1)well-founded ∀( φ ∶ Size → Prop ) . (∀ i. (∀ j. j < i → φ j ) → φ i ) → ∀ i. φ i (5.2) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 13 has upper bounds for pairs of elements ∀ i, j. ∃ k. i < k ∧ j < k (5.3)and has a “successor” operation ↑ ∶ Size → Size satisfying ∀ i. i < ↑ i (5.4) ∀ i, j. i < j → ↑ i < ↑ j (5.5)Such a type of sizes has many properties of the classic notion of limit ordinal , except thatwe do not require the order to be total ( ∀ i, j. i < j ∨ i = j ∨ j < i ); that would be too strongin a constructive setting and indeed does not hold in the examples below. Nor do we haveany need for an extensionality property ( ∀ i, j. (∀ k. k < i ↔ k < j ) → i = j ). In the precursorto this paper [FPS20] we made use of Agda’s built in type Size and its version of sizedtypes [Abe12]. This shares only some of the properties of the above definition. In particular,it has a greatest size ∞ ; so ∞ < ∞ holds and hence < is not well-founded. Notation 5.2 ( Bounded quantification over sizes ) . We write ∏ j < i _ for ∏ j ∶(↓ i ) _,where ↓ i def = { j ∶ Size ∣ j < i } (5.6)is the type of sizes below i ∶ Size . Similarly for other binders involving sizes, such as ∀ j < i. _and λ j < i . _.In the next section we need the standard fact that well-founded recursion can be reducedto well-founded induction (5.2) by defining the graph of the recursive function and thenappealing to unique choice (2.3) and function extensionality (2.2): Proposition 5.3 ( Well-founded recursion ) . For any family of types A ∶ Size → U andfunction α ∶ ∏ i ((∏ j < i A j ) →
A i ) , there is a unique function rec A α ∶ ∏ i A i satisfying ∀ i. rec A α i = α i ( λ j < i . rec A α j ) (5.7) Proof.
Let R ∶ ∏ i ( A i → Prop ) be the least family of relations satisfying ∀ i. ∀( f ∶ ∏ j < i A j ) . (∀ j < i. R j ( f j )) → R i ( α i f ) (5.8)Then ∀ i. ∃ ! ( x ∶ A i ) . R i x follows applying (5.2) with φ i def = ∃ ! x. R i x . So by unique choice thereis r ∶ ∏ i A i satisfying ∀ i. R i ( r i ) and hence by (5.8) also satisfying ∀ i. R i ( α i ( λ j < i . r j )) .Since for each i there is a unique x with R i x , it follows that r i = α i ( λ j < i . r j ) . So wecan take rec A α to be r . If r ′ ∶ ∏ i A i also satisfies ∀ i. r ′ i = α i ( λ j < i . r ′ j ) , then ∀ i. r ′ i = r i follows from another application of (5.2), so that r ′ = r by function extensionality (2.2). Example 5.4 ( Plump order ) . Let
Size ∶ U be the W-type determined by some type Op ∶ U and family Ar ∶ Op → U . Thus Size is inductively defined with constructor σ ∶ or zero ordinal, since we do not need to require that a type of sizes is actually inhabited Unfortunately in the current version of Agda (2.6.1) it is possible to prove well-foundedness of < andthis leads immediately to logical unsoundness; see github.com/agda/agda/issues/3026 . For this reason weavoid the use of Agda’s sized types in the current development. Instead of the impredicative definition of R (and < and ≤ in Example 5.4) as the least relation closedunder some rules, in our Agda development such relations are constructed as inductively defined datatypes inthe universe Prop , allowing one to use dependent pattern-matching to simplify proofs about them. (∑ a ∶ Op ( Ar a → Size )) →
Size . The plump ordering [Tay96] on
Size is given by the leastrelations _ < _ , _ ≤ _ ∶ Size → Size → Prop satisfying for all a ∶ Op , b ∶ Ar a → Size and i ∶ Size (∀( x ∶ Ar a ) . b x < i ) → σ a b ≤ i (5.9) ∀( x ∶ Ar a ) . i ≤ b x → i < σ a b (5.10)It is not hard to see that the relation < is transitive (5.1) and well-founded (5.2). Furthermore ≤ is reflexive and hence from (5.10) we get ∀( x ∶ Ar a ) . b x < σ a b (5.11)so that for each operation a ∶ Op , every family of elements of Size indexed by its arity
B a has an upper bound with respect to < . In particular, if the signature ( Op , Ar ) containsan operation a ∶ Op whose arity is Ar a = , then an upper bound for any i, j ∶ Size withrespect to < is given by i ⊔ j def = σ a b i,j (5.12)with b i,j ∶ → Size defined by b i,j = i and b i,j = j . So (5.3) is satisfied in this case andfurthermore ↑ i def = i ⊔ i (5.13)gives a successor operation satisfying (5.4) and (5.5). Therefore, we have: Lemma 5.5.
If the signature Op ∶ U , Ar ∶ Op → U contains a binary operation ( a ∶ A with B a = ), then the corresponding W-type, equipped with the plump order < , is a type of sizesin the sense of Definition 5.1. Let ( Σ , ε ) be a signature and system of equations in a topos with natural number object anduniverses, as in Definition 3.1. Assuming the topos satisfies WISC, in Definition 5.6 belowwe associate with ( Σ , ε ) a type of sizes Size Σ ,ε using the plump order < on a suitable W-type.We need Size Σ ,ε to have upper bounds (with respect to < ) for X -indexed families when X isone of the arities in Σ or ε — more specifically, when X = ∑ j ∶ I ( B i a ) j , or X = ∑ j ∶ I ( V i e ) j ,where Σ = ( I, A, B ) and ε = ( E, V, l, r ) , i ∶ I , a ∶ A i and e ∶ E i . We also need upper boundsfor ( Dom X c ) -indexed families for any cover c ∶ Cov X ; and also for ( Dom Y c ) -indexed familieswhen Y is aopen qw-journal.pdf certain subtype of one of the types in the set of covers of anarity, for the same reason that Swan uses “2-cover bases” [Swa18, Sect. 3.2.2]. We use thefollowing notation for such 2-covers:Given X ∶ U , WISC gives us Cov X ∶ U and Dom X ∶ Cov X → U . For each cover c ∶ Cov X and function f ∶ Dom X c → X , we can form the kernel of f Ker ( c, f ) def = ∑ x,x ′ ∶ Dom X c ( f x = f x ′ ) (5.14)Since this is a type in U , we can apply WISC again to get a type Cov
Ker ( c,f ) of covers for it.Then we define Cov X def = ∑ c ∶ Cov X ∑ f ∶ Dom X c → X Cov
Ker ( c,f ) (5.15) Dom X ∶ Cov X → U Dom X ( c, f, c ′ ) def = Dom
Ker ( c,f ) c ′ (5.16) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 15
Definition 5.6 ( The size of an equational theory ) . Given an I -indexed signature andsystem of equations ( Σ , ε ) (Definition 3.1) in a universe U in topos satisfying WISC, wedefine the type of sizes Size Σ ,ε ∶ U to be given as in Lemma 5.5 with Op ∶ U and Ar ∶ Op → U as follows. Suppose Σ = ( I, A, B ) and ε = ( E, V, l, r ) ; given i ∶ I , a ∶ A i and e ∶ E i , we write ∑ B i a for ∑ j ∶ I ( B i a ) j and ∑ V i e for ∑ j ∶ I ( V i e ) j . Then Op def = + ∑ i ∶ I ⎛⎝ A i + ∑ a ∶ A i ( Cov ∑ B i a + Cov ∑ B i a ) + E i + ∑ e ∶ E i ( Cov ∑ V i e + Cov ∑ V i e )⎞⎠ and Ar ∶ Op → U maps ● the element ∶ to (so that there is a binary operation in the signature and hencebinary upper bounds (5.12) and an inflationary, monotone successor operation (5.13) forthe plump order) ● elements a ∶ A i , c ∶ Cov ∑ B i a and c ′ ∶ Cov ∑ B i a (for each i ∶ I ) respectively to ∑ B i a , Dom ∑ B i a c and Dom ∑ B i a c ′ ● elements e ∶ E i , c ∶ Cov ∑ V i e and c ′ ∶ Cov ∑ V i e (for each i ∶ I ) respectively to ∑ V i e , Dom ∑ V i e c and Dom ∑ V i e c ′ .With this choice of Op and Ar , not only is Size Σ ,ε a type of sizes in the sense of Definition 5.1,but by virtue of (5.11), we have < -upper bounds for families of sizes in Size Σ ,ε indexed by ∑ B i a , Dom ∑ B i a c , Dom ∑ B i a c ′ , ∑ V i e , Dom ∑ V i e c , or Dom ∑ V i e c ′ . This allows us to provecocontinuity properties (Theorem 5.8 and Corollary 5.9 below) that we apply in Section 6.These cocontinuity properties have to do with colimits of Size Σ ,ε -indexed diagrams in U .To state them, we first recall some semi-standard category-theoretic notions to do withdiagrams and colimits.5.1. Colimits of size-indexed diagrams.
By definition, given a type of sizes
Size (Defini-tion 5.1), a
Size -indexed diagram in a universe U is given by a family of types D ∶ Size → U equipped with functions δ i,j ∶ D i → D j for all i, j ∶ Size with i < j , satisfying ∀( i, j, k ∶ Size ) . i < j < k → δ i,k = δ j,k ○ δ i,j (5.17)As usual, the colimit of such a diagram is a cocone of functions in U( ν D ) i ∶ D i → colim D ∀( i, j ∶ Size ) . i < j → ( ν D ) i = ( ν D ) j ○ δ i,j (5.18)with the universal property that for any other cocone f i ∶ D i → C ∀( i, j ∶ Size ) . i < j → f i = f j ○ δ i,j there is a unique function f ∶ colim D → C satisfying ∀ i. f i = f ○ ( ν D ) i .Colimits can be constructed using quotient types. We define a binary relation _ ∼ _ on ∑ i D i by: ( i, x ) ∼ ( j, y ) def = ∃( k ∶ Size ) . i < k ∧ j < k ∧ δ i,k x = δ j,k y (5.19)This is an equivalence relation, because ( Size , <) has properties (5.3) and (5.4). Quotientingby it yields colim D def = (∑ i D i ) /∼ (5.20) They are only semi-standard, because < is not reflexive (indeed is irreflexive, because of well-foundedness),so that ( Size , <) is only a semi-category. with the universal cocone functions ( ν D ) i given by mapping each x ∶ D i to the equivalenceclass [ i, x ] ∼ . Notation 5.7.
We need to consider
Size -indexed diagrams and their colimits not only in U , but also in U I for some indexing type I ∶ U . Such diagrams and their colimits are givenpointwise by diagrams and colimits in U . The situation is notationally involved, since thereare indexes ranging both over the index type I and over sizes. In what follows we use i for atypical element of I and i, j, k, . . . to range over Size . Given a
Size -indexed diagram ( D, δ ) in U I and a family X ∶ U I , we get a power diagram ( D X , δ X ) in U with ( D X ) i def = X ⇁ D i ( i ∶ Size ) ispe ( δ X ) i,j def = λ ( f ∶ X ⇁ D i ) . δ i,j ○ f ( i, j ∶ Size ) (5.21)Post-composition with ( ν D ) i gives a cocone under the diagram D X with vertex X ⇁ colim D and this induces a well-defined function κ D,X ∶ colim ( D X ) → ( X ⇁ colim D ) κ D,X [ i, f ] ∼ = ( ν D ) i ○ f (5.22)One says that taking a power by X ∶ U I preserves Size -indexed colimits if for all
Size -indexeddiagrams ( D, δ ) in U I the function κ D,X is an isomorphism.
Theorem 5.8 ( Cocontinuity ) . Given a signature Σ = ( I, A, B ) and system of equations ε = ( E, V, l, r ) (Definition 3.1) in a topos with natural number object and universes satisfyingWISC, the type of sizes Size Σ ,ε from Definition 5.6 has the property that taking a power by afamily X ∶ U I preserves Size Σ ,ε -indexed colimits when X is one of the arities in ( Σ , ε ) , thatis, of the form B i a or V i e with i ∶ I and a ∶ A i or e ∶ E i .Proof. To see that (5.22) is an isomorphism, it suffices to prove that it is both injective andsurjective; for then we can apply unique choice (2.3) to construct a two-sided inverse for κ D,X . By definition of ∼ (5.19), κ D,X is injective iff ∀( i, j ∶ Size Σ ,ε ) . ∀( f ∶ X ⇁ D i ) . ∀( f ′ ∶ X ⇁ D j ) . ( ν D ) i ○ f = ( ν D ) j ○ f ′ →∃( k ∶ Size Σ ,ε ) . i < k ∧ j < k ∧ δ i,k ○ f = δ j,k ○ f ′ (5.23)and surjective iff ∀( f ∶ X ⇁ colim D ) . ∃( i ∶ Size Σ ,ε ) . ∃( f ′ ∶ X ⇁ D i ) . ( ν D ) i ○ f ′ = f (5.24) Proof of (5.23): Suppose we have f ∶ X ⇁ D i and f ′ ∶ X ⇁ D j satisfying ( ν D ) i ○ f = ( ν D ) j ○ f ′ .So by definition of colim D (5.20) and writing ∑ X for ∑ i ∶ I X i , we have ∀(( i , x ) ∶ ∑ X ) . ∃( k ∶ Size Σ ,ε ) . i < k ∧ j < k ∧ ( δ i,k ○ f ) i x = ( δ j,k ○ f ′ ) i x Using the formulation of WISC in Lemma 4.2, there is c ∶ Cov ∑ X , ⟨ p , p ⟩ ∶ Dom ∑ X c → ∑ X and s ∶ Dom ∑ X c → Size Σ ,ε with ⟨ p , p ⟩ surjective and satisfying ∀( z ∶ Dom ∑ X c ) . i < s z ∧ j < s z ∧ ( δ i,s z ○ f ) p z ( p z ) = ( δ j,s z ○ f ′ ) p z ( p z ) (5.25)Since X is one of the arities in ( Σ , ε ) , as mentioned after Definition 5.6 we have that s ∶ Dom ∑ X c → Size Σ ,ε has an upper bound, i.e. there is k ∶ Size Σ ,ε with ∀( z ∶ Dom ∑ X c ) . s z < k ;and by (5.3) we can assume further that i < k and j < k . Furthermore, from (5.25) and (5.17) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 17 we get ∀( z ∶ Dom ∑ X c ) . ( δ i,k ○ f ) p z ( p z ) = ( δ j,k ○ f ′ ) p z ( p z ) ; but ⟨ p , p ⟩ is surjective, so δ i,k ○ f = δ j,k ○ f ′ , as required for (5.23). Proof of (5.24): Suppose we have f ∶ X ⇁ colim D . Since for each i ∶ I the quotientfunction [ _ ] ∼ ∶ ∑ i ( D i ) i → colim D i is surjective, using Lemma 4.2 again, there is c ∶ Cov ∑ X , ⟨ p , p ⟩ ∶ Dom ∑ X c → ∑ X , s ∶ Dom ∑ X c → Size Σ ,ε and g ∶ ∏ z ∶ Dom ∑ X c ( D s z ) p z with ⟨ p , p ⟩ surjective and satisfying ∀( z ∶ Dom ∑ X c ) . f p z ( p z ) = [ s z, gz ] ∼ . As before, we have that s ∶ Dom ∑ X c → Size Σ ,ε has an upper bound, i.e. there is j ∶ Size Σ ,ε with ∀( z ∶ Dom ∑ X c ) . s z < j .So we get a function g ′ ∶ ∏ z ∶ Dom ∑ X c ( D j ) p z by defining g ′ z def = ( δ s z,j ) p z ( gz ) and hence f p z ( p z ) = [ s z, gz ] ∼ = [ j, ( δ s z,j ) p z ( gz )] ∼ = (( ν D ) j ) p z ( g ′ z ) (5.26)Let Y def = Ker ( c, ⟨ p , p ⟩) be the kernel of ⟨ p , p ⟩ as in (5.14). Then for any ( z, z ′ ) ∶ Y , since ⟨ p , p ⟩ z = ⟨ p , p ⟩ z ′ , we have (( ν D ) j ) p z ( g ′ z ) = f p z ( p z ) = f p z ′ ( p z ′ ) = (( ν D ) j ) p z ′ ( g ′ z ′ ) and hence ∃ k. j < k ∧ ( δ j,k ) p z ( g ′ z ) == ( δ j,k ) p z ′ ( g ′ z ′ ) . So we can apply Lemma 4.2 againto deduce the existence of c ′ ∶ Cov Y , ⟨ p ′ , p ′ ⟩ ∶ Dom Y c ′ → Y and s ′ ∶ Dom Y c ′ → Size Σ ,ε with ⟨ p ′ , p ′ ⟩ surjective and satisfying ∀( z ′ ∶ Dom Y c ′ ) . ( δ j,s ′ z ′ ) p ( p ′ z ′ ) ( g ′ ( p ′ z ′ )) == ( δ j,s ′ z ′ ) p ( p ′ z ′ ) ( g ′ ( p ′ z ′ )) (5.27)Note that from (5.16) we have Dom Y c ′ = Dom ∑ X ( c, ⟨ p , p ⟩ , c ′ ) and so by construction of Size Σ ,ε , the family of sizes s ′ ∶ Dom Y c ′ → Size Σ ,ε has an upper bound, i say; and by (5.3)we can assume j < i . Let g ′′ ∶ ∏ z ∶ Dom ∑ X c ( D i ) p z be λ z . ( δ j,i ) p z ( g ′ z ) . Thus from (5.26)we have f p z ( p z ) = (( ν D ) i ) p z ( g ′′ z ) (5.28)To complete the proof of (5.24) it suffices to show that for each i ∶ I the relation F ′ i ∶ X i →( D i ) i → Prop given by F ′ i x d def = ∃( z ∶ Dom ∑ X c ) . p z = i ∧ p z == x ∧ g ′′ z == d (5.29)is single-valued and total. For then by unique choice (2.3) the F ′ i are the graphs of a familyof functions f ′ ∶ X ⇁ D i satisfying ( ν D ) i ○ f ′ = f , because of (5.28), (5.29) and the fact that ⟨ p , p ⟩ is surjective.Each F ′ i is total since ⟨ p , p ⟩ is surjective: given x ∶ X i , there is some z ∶ Dom ∑ X c with p z = i and p z == x , so that F ′ i x d holds for d def = g ′′ z . Single-valuedness of each F ′ i holdsbecause if for some x, z , z , d , d we have p z = i ∧ p z == x ∧ g ′′ z == d ∧ p z = i ∧ p z == x ∧ g ′′ z == d then ( z , z ) is in the kernel Ker ( c, ⟨ p , p ⟩) , i.e. in Y , and so since ⟨ p ′ , p ′ ⟩ is surjective thereis z ′ with ( p ′ z ′ , p ′ z ′ ) = ( z , z ) ; hence d = g ′′ z = g ′′ ( p ′ z ′ ) since p ′ z ′ = z = ( δ j,i ) i ( g ′ ( p ′ z ′ )) since g ′′ def = λ z . ( δ j,i ) p z ( g ′ z ) and i = p z = p ( p ′ z ′ )= ( δ j,i ) i ( g ′ ( p ′ z ′ )) by (5.27) and (5.17), since s ′ z ′ < i = g ′′ ( p ′ z ′ ) since g ′′ def = λ z . ( δ j,i ) p z ( g ′ z ) and i = p z = p ( p ′ z ′ )= g ′′ z = d since p ′ z ′ = z So (5.29) does indeed determine single-valued and total relations and so we have completedthe proof of (5.24) and hence of Theorem 5.8. If ( D, δ ) is a Size -indexed diagram in U I , then we get another such, ( S Σ ○ D, S Σ ○ δ ) , bycomposing with the polynominal endofunctor S Σ ∶ U I → U I associated with the signature Σ as in (3.5): ( S Σ ○ D ) i def = S Σ ( D i ) ( i ∶ Size )( S Σ ○ δ ) i,j def = S Σ ( δ i,j ) ( i, j ∶ Size ) (5.30)Applying S Σ to the I -indexed version of (5.18) gives a cocone under ( S Σ ○ D, S Σ ○ δ ) withvertex S Σ ( colim D ) and this induces a family of functions in U I , κ D, Σ ∶ colim ( S Σ ○ D ) ⇁ S Σ ( colim D ) (5.31)One says that the polynomial endofunctor S Σ preserves Size -indexed colimits if κ D, Σ is afamily of isomorphisms, for all diagrams ( D, δ ) . Corollary 5.9 ( Cocontinuity of S Σ ) . Given a signature Σ = ( I, A, B ) and system ofequations ε = ( E, V, l, r ) (Definition 3.1) in a topos with natural number object and universessatisfying WISC, the type of sizes Size Σ ,ε from Definition 5.6 has the property that thepolynominal endofunctor S Σ ∶ U I → U I preserves Size Σ ,ε -indexed colimits.Proof. Given a diagram ( D, δ ) in U I , the I -indexed family of functions (5.31) satisfies for all i ∶ I , i ∶ Size Σ ,ε , a ∶ A i and b ∶ B i a ⇁ D i ( κ D, Σ ) i [ i, ( a, b )] ∼ = ( a, ( ν D ) i ○ b )( κ D, Σ ) i is injective, because if ( a, ( ν D ) i ○ b ) = ( a ′ , ( ν D ) j ○ b ′ ) , then a = a ′ and ( ν D ) i ○ b =( ν D ) j ○ b ′ ; but then from (5.23) with X = B i a = B i a ′ , there is some k with i, j < k and δ i,k ○ b = δ j,k ○ b ′ , so that [ i, ( a, b )] ∼ and [ j, ( a ′ , b ′ )] ∼ are equal elements of ( colim ( S Σ ○ D )) i . ( κ D, Σ ) i is surjective because given ( a, b ) ∶ ( S Σ ( colim D )) i , from (5.24) with X = B i a ,there exist i ∶ Size Σ ,ε and b ′ ∶ B i a ⇁ D i with ( ν D ) i ○ b ′ = b ; so [ i, ( a, b ′ )] ∼ in ( colim ( S Σ ○ D )) i is mapped by ( κ D, Σ ) i to ( a, b ) .Since ( κ D, Σ ) i is both injective and surjective, we can apply unique choice (2.3) toconclude that it is an isomorphism.6. Construction of QWI-types
We aim to prove the following theorem about existence of QWI-types (Definition 3.2):
Theorem 6.1.
QWI-types exist in every topos with natural number object and universessatisfying WISC.
The proof follows from the cocontinuity results of the previous section (Theorem 5.8 andCorollary 5.9). For simplicity, here we only give the proof for QW-types, that is, for thenon-indexed I = case of signatures. The general case is similar, but notationally moreinvolved since there are indexes ranging both over an index type and over sizes (as in theprevious section).So in this section we fix a signature Σ = ( A ∶ U , B ∶ A → U ) and system of equations ε = ( E ∶ U , V ∶ E → U , l, r ∶ ∏ e ∶ E T Σ ( V e )) over it, in some universe U of a topos with naturalnumbers object and universes satisfying WISC. UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 19 mutualdata W ∶ U where qτ ∶ T Σ ( W /∼) → W data _ ∼ _ ∶ W → W → Prop where qε ∶ ∀( e ∶ E ) . ∀( ρ ∶ V e → W /∼) . qτ ( T Σ ρ ( l e )) ∼ qτ ( T Σ ρ ( r e )) qη ∶ ∀( t ∶ T Σ ( W /∼)) . qτ ( η ( qτ t )) ∼ qτ tqσ ∶ ∀( a ∶ A ) . ∀( b ∶ B a → T Σ ( W /∼)) . qτ ( σ ( a, b )) ∼ qτ ( σ ( a, η ○ qτ ○ b ) QW = W /∼ Figure 2: First attempt at constructng QW-types6.1.
Motivating the construction.
We noted at the start of Section 4 that QW-typescan be constructed in the category of ZFC sets as initial algebras for possibly infinitaryequational theories by first forming the W-type of terms of the theory and then quotientingthat by the congruence relation generated by the equations of the theory. AC is used whenconstructing the algebra structure of the quotient, because the signature’s arities may beinfinite. To avoid this use of AC, instead of forming all terms in one go and then quotienting,we consider interleaving quotient formation with the construction of terms of free algebrasfor equational systems (cf. the categorical construction by Fiore and Hur [FH09]).Figure 2 gives the idea, using the constructors η and σ from (3.8) and Agda-like notationfor inductive definitions. We would like to construct the QW-type for ( Σ , ε ) as a quotient QW def = W /∼ , but now the type W ∶ U and the relation _ ∼ _ ∶ W → W → Prop are mutuallyinductively defined, with constructors as indicated in the figure. Note that whereas theconstruction in ZFC uses AC to get an S Σ -algebra structure for QW , here we get one triviallyfrom the constructor qτ ∶ T Σ ( W /∼) → W : S Σ ( QW ) ≡ S Σ ( W /∼) S Σ η ——→ S Σ ( T Σ ( W /∼)) σ —→ T Σ ( W /∼) qτ —→ W [ _ ] ∼ ——→ W /∼ ≡ QW Furthermore the property qε of ∼ in Figure 2 ensures that the S Σ -algebra W /∼ satisfies theequational system ε . The use of T Σ rather than S Σ in the domain of qτ seems necessary forthis method of construction to go through (once we have fixed up the problems mentioned inthe next paragraph); but it does mean that as well as qε , we have to impose the conditions qη and qσ to ensure that W /∼ has a T Σ -algebra structure.Note that the domain of the constructor qτ combines T Σ ( _ ) with _ / _. While the firstis unproblematic for inductive definitions, the second is not: if one thinks of the semanticsof inductively defined types in terms of initial algebras for endofunctors, it is not clearwhat endofunctor (in some class known to have initial algebras) is involved here, given thatboth arguments to _ / _ are being defined simultaneously. Agda uses a notion of “strictpositivity” as a conservative approximation for such a class of functors; and one can instructAgda to regard quotienting as a strictly positive operation through the use of its POLARITY declarations. If one does so, then a definition like the one in Figure 2 is accepted by Agda.The semantic justification for regarding quotients as strictly positive needs further work.We avoid the need for that here and replace the attempt to define W and ∼ inductively bya size-indexed version that uses definition by well-founded recursion over the type of sizesdeveloped in the previous section. This also avoids another difficulty with Figure 2: evenif one can define W and ∼ inductively, one still has to verify that W /∼ has the universalproperty (3.14)–(3.16) required of a QW-type. In particular, there is an obvious recursive definition of qwrec following the shape of the inductive definition in Figure 2, but it is not atall clear why this recursive definition is terminating (i.e. gives a well-defined, total function).Well-founded recursion over sizes will solve this problem as well.6.2. QW-type via sizes.
Let
Size ∶ U denote the type of sizes
Size Σ ,ε associated with thesignature ( Σ , ε ) as in Definition 5.6. Definition 6.2. A Size -indexed Σ -algebra in U is specified by a family of types D ∶ Size → U equipped with functions τ j,i ∶ T Σ ( D j ) → D i for all i, j ∶ Size with j < i Similarly, for each i ∶ Size , a (↓ i ) -indexed Σ -algebra is the same thing, except with D onlydefined on ↓ i (5.6). Clearly, given a Size -indexed Σ -algebra ( D, τ ) , for each i ∶ Size we get a (↓ i ) -indexed one ( D (↓ i ) , τ (↓ i )) by restriction.If i ∶ Size and ( D, τ ) is a (↓ i ) -indexed Σ -algebra, let ◇ i D ∶ U be the quotient type ◇ i D def = ⎛⎝∑ j < i T Σ D j ⎞⎠/ R i (6.1)with the relation R i ∶ (∑ j < i T Σ D j ) → (∑ j < i T Σ D j ) → Prop defined by: R i ( j, t ) ( k, t ′ ) def =( k = j ∧ ∃( e ∶ E ) . ∃( ρ ∶ V e → D j ) . t = T Σ ρ ( l e ) ∧ t ′ = T Σ ρ ( r e ))∨ ( k < j ∧ t = η ( τ k,j t ′ ))∨ ( k < j ∧ ∃( a ∶ A ) . ∃( b ∶ B a → T Σ D k ) . t = σ ( a, b ) ∧ t ′ = σ ( a, η ○ τ k,j ○ b )) (6.2)(The three clauses in the above definition correspond to the three constructors qε , qη and qσ in Figure 2.) We will see that QW-types can be constructed from Size -indexed Σ -algebras ( D, τ ) satisfying the following fixed-point property. Definition 6.3. A Size -indexed Σ -algebra ( D, τ ) is a ◇ -fixed point if for all i ∶ Size D i = ◇ i ( D (↓ i )) (6.3)and for all j < i and t ∶ T Σ D j τ j,i t == [ j, t ] R i (6.4)Suppose that ( D, τ ) is a ◇ -fixed point. Because of (6.3) and (6.4), for i, j ∶ Size with i < j the functions δ i,j ∶ D i → D j δ i,j def = τ i,j ○ η (6.5)satisfy δ i,j ([ k, t ] R i ) == [ k, t ] R j (for all k < i and t ∶ T Σ D k ) (6.6)In particular they satisfy (5.17) and so ( D, δ ) is a Size -indexed diagram in U whose colimitwe can form as in Section 5.1. We prove that this colimit QW def = colim D (6.7)has the structure (3.12)–(3.16) of a QW-type for the signature ( Σ , ε ) . UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 21 qwintro : We claim that the functions S Σ ( D i ) S Σ η ——→ S Σ ( T Σ D i ) σ —→ T Σ D i τ i, ↑ i ——→ D ↑ i ( ν D ) ↑ i ———→ colim D (6.8)form a cocone under the diagram S Σ ○ D and hence induce a function colim ( S Σ ○ D ) → colim D ; then we obtain qwintro ∶ S Σ ( colim D ) → colim D by composing this with theisomorphism S Σ ( colim D ) ≅ colim ( S Σ ○ D ) from Corollary 5.9. That the functions in(6.8) form a cocone for S Σ ○ D follows from the fact that the functions in (6.5) satisfyfor all sizes i < j ∀( t ∶ T Σ ( D i )) . ∃( k ∶ Size ) . j < k ∧ τ j,k ( T Σ δ i,j ( t )) = τ i,k ( t ) (6.9)from which it follows that ( ν D ) ↑ j ○ τ j, ↑ j ○ T Σ δ i,j = ( ν D ) ↑ i ○ τ i, ↑ i and hence also thecocone property. (6.9) can be proved by induction on the structure of t ∶ T Σ ( D i ) ,with the t = σ ( a, b ) case of (3.8) proved using the fact that Size has < -upper boundsfor families of sizes indexed by ∑( B i a ) . qwequate : Given e ∶ E and ρ ∶ V e → colim D , by Theorem 5.8 there exist i ∶ Size and ρ ′ ∶ V e → D i with ρ = ( ν D ) i ○ ρ ′ . Hence by definition of ≫= (3.9) we have ( l e ≫= ρ ) = ( l e ≫= ( ν D ) i ○ ρ ′ ) = ( T Σ ρ ′ ( l e ) ≫= ( ν D ) i )( r e ≫= ρ ) = ( r e ≫= ( ν D ) i ○ ρ ′ ) = ( T Σ ρ ′ ( r e ) ≫= ( ν D ) i ) From the definition of qwintro it follows that for any t ∶ T Σ D i , there is a proof of ( t ≫= ( ν D ) i ) = ( ν D ) ↑ i ( τ i, ↑ i t ) (6.10)So from above we have that ( l e ≫= ρ ) = ( ν D ) ↑ i ( τ i, ↑ i ( T Σ ρ ′ ( l e ))) and ( r e ≫= ρ ) =( ν D ) ↑ i ( τ i, ↑ i ( T Σ ρ ′ ( r e ))) . Since from (6.4) and the first clause in the definition of R i (6.2) we also have τ i, ↑ i ( T Σ ρ ′ ( l e )) = τ i, ↑ i ( T Σ ρ ′ ( r e )) , it follows that there is a proof of ( l e ≫= ρ ) = ( r e ≫= ρ ) . qwrec : Given an S Σ -algebra ( X, α ) ∶ ∑ X ∶U ( S Σ X → X ) satisfying the system of equations ε , the function qwrec ∶ QW = colim D → X is induced by a cocone of functions r ∶ ∏ i ( D i → X ) under the diagram D , defined by well-founded recursion (Proposi-tion 5.3). More precisely, a strengthened “recursion hypothesis” is needed: instead of ∏ i ( D i → X ) we use ∏ i F i where F i def = { f ∶ D i → X ∣ ∀ j < i. ∀( t ∶ T Σ D j ) . ( t ≫= ( f ○ δ j,i )) == f ([ j, t ] R i )} (The definition relies on the fact (6.3) that D i = ◇ i ( D (↓ i )) .) For each i ∶ Size , if wehave r j ∶ F j for all j < i , then we get a function r i ∶ F i well-defined by r i ([ j, t ] R i ) def = t ≫= r j for all j < i and t ∶ T Σ D j (6.11)(The defining property of F i is needed to see that the right-hand side of this definitionrespects the relation R i .) Hence by well-founded recursion (Proposition 5.3) weget an element r ∶ ∏ i F i . One can prove ∀ i. ∀ j < i. r j = r i ○ δ j,i by well-foundedinduction (5.2); so r is a cocone and induces a function qwrec ∶ colim D → X . qwrechom : To prove that S Σ ( colim D ) qwintro (cid:47) (cid:47) S Σ qwrec (cid:15) (cid:15) colim D qwrec (cid:15) (cid:15) S Σ X α (cid:47) (cid:47) X commutes, by Corollary 5.9 and the definitions of qwintro and qwrec , it suffices toprove that S Σ D i τ i, ↑ i ○ σ ○ S Σ η (cid:47) (cid:47) S Σ r i (cid:15) (cid:15) D ↑ ir ↑ i (cid:15) (cid:15) S Σ X α (cid:47) (cid:47) X does for each i ∶ Size . But each ( a, b ) ∶ S Σ D i is mapped by τ i, ↑ i ○ σ ○ S Σ η to [ i, σ ( a, η ○ b )] R ↑ i (using the fact that D ↑ i = ◇ ↑ i ( D (↓ (↑ i ))) ); and by (6.11), that ismapped by r ↑ i to σ ( a, η ○ b )≫= r i , which is indeed equal to α ( S Σ r i ( a, b )) by definitionof ≫= (3.18). qwuniq : If h ∶ colim D → X is a morphism of S Σ -algebras, then one can prove by well-foundedinduction for < that ∀ i. h ○ ( ν D ) i = r i holds: for if we have h ○ ( ν D ) j = r j for all j < i ,then for any [ j, t ] R i in D i = ◇ i ( D (↓ i )) r i ([ j, t ] R i ) def = t ≫= r j (6.11) = t ≫= ( h ○ ( νD ) j ) by induction hypothesis = h ( t ≫= ( ν D ) j ) since h is a morphism of S Σ -algebras == h (( ν D ) ↑ j [ j, t ] R ↑ j ) by (6.10) and (6.4) = h (( ν D ) i [ j, t ] R i ) since by (6.6), δ ↑ j, ↑ i ([ j, t ] R ↑ j ) = [ j, t ] R ↑ i = δ i, ↑ i ([ j, t ] R i ) .So by well-founded induction, h ○ ( ν D ) i = r i holds for all i ∶ Size , and hence bydefinition of qwrec and the uniqueness part of the universal property of colimits wehave h = qwrec .Thus we have proved: Proposition 6.4.
If the
Size -indexed Σ -algebra ( D, τ ) is a ◇ -fixed point, then colim D hasthe structure of a QW-type for the signature ( Σ , ε ) . Now we can complete the proof of the main theorem:
Proof of Theorem 6.1.
In view of Proposition 6.4, it suffices to construct a
Size -indexed Σ -algebra which is a ◇ -fixed point in the sense of Definition 6.3.For each i ∶ Size , say that a (↓ i ) -indexed Σ -algebra (Definition 6.2) is an upto- i ◇ -fixedpoint if ∀ j < i. D j = ◇ j ( D (↓ j )) ∧ ∀ k < j. ∀ t. τ k,j t == [ k, t ] R j (6.12)(cf. (6.3) and (6.4)). Note that:(A) Given j < i , any upto- i ◇ -fixed point restricts to an upto- j ◇ -fixed point. (B) For all i , any two upto- i ◇ -fixed points are equal (proof by well-founded induction (5.2)).Using these two facts, it follows by well-founded recursion (Proposition 5.3) that there is anupto- i ◇ -fixed point for all i ∶ Size . For if ( D ( j ) , τ ( j ) ) is an upto- j ◇ -fixed point for all j < i ,then we get D ( i ) ∶ ↓ i → U by defining for each j < i ( D ( i ) ) j def = ◇ j ( D ( j ) ) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 23 If k < j < i , then by (A) we have that D ( j ) ↓ k is an upto- k ◇ -fixed point and hence by (B)that D ( j ) ↓ k = D ( k ) . So together with (6.12) this gives: ( D ( i ) ) k def = ◇ k ( D ( k ) ) = ◇ k ( D ( j ) ↓ k ) = ( D ( j ) ) k Hence we can define ( τ ( i ) ) k,j ∶ T Σ (( D ( i ) ) k ) → ( D ( i ) ) j by ( τ ( i ) ) k,j t def = [ k, t ] R j and this makes ( D ( i ) , τ ( i ) ) into a (↓ i ) -indexed Σ -algebra which by construction is an upto- i ◇ -fixed point.Thus by well-founded recursion (Proposition 5.3) we have an upto- i ◇ -fixed point D ( i ) forall i ∶ Size .Let D ∶ Size → U be given by D i def = ◇ i ( D ( i ) ) . If j < i , then by (A) and (B) we have D ( i ) ↓ j = D ( j ) and together with (6.12) this gives: D j def = ◇ j ( D ( j ) ) = ◇ i ( D ( i ) ↓ j ) = ( D ( i ) ) j So we can define τ j,i ∶ T Σ D j → D i by τ j,i t def = [ j, t ] R i . This makes ( D, τ ) into a Σ -algebrawhich by construction is a ◇ -fixed point.7. Encoding QITs as QWI-types
The general notion of indexed quotient inductive type (QIT) was discussed by example in theIntroduction. We wish to show that a wide variety of QITs can be expressed as QWI-types,namely those which do not use conditional equality constructors (as in the example in (1.2)).We first introduce a schema for such QITs that combines desirable features of ones that occurin the literature.7.1.
General QIT schemas.
Basold, Geuvers, and van der Weide [BGvdW17] present aschema for infinitary QITs that do not support conditional path equations. Constructorsare defined by arbitrary polynomial endofunctors built up using (non-dependent) productsand sums, which means in particular that parameters and arguments can occur in any order;however, they require constructors to be in uncurried form. Dybjer and Moeneclaey [DM18,Sections 3.1 and 3.2] present a schema for finitary QITs that does allow curried constructors(and also supports conditional path equations), but requires all parameters to appear beforeall arguments. This contrasts with the more convenient schema for regular inductive typesin Agda, which allows parameters and arguments in any order. Building on these two works,we provide a schema for infinitary, non-conditional QITs combining the arbitrarily orderedparameters and arguments of the former [BGvdW17] with the curried constructors of thelatter [DM18].The following definition should read as an extension of a formalisation of the type theorydescribed in Section 2 in terms of typing contexts ( Γ , ∆ , . . . ) and various judgements-in-context(such as Γ ⊢ a ∶ A , Γ ⊢ a ≡ a ′ ∶ A , etc.); cf. the HoTT Book [Uni13, Appendix]. Definition 7.1.
A ( non-conditional ) indexed QIT , X , indexed by I in a context Γ is specifiedby a list of element constructors c ∶ C , . . . , c m ∶ C m , followed by a list of equality constructors d ∶ D , . . . , d n ∶ D n , with each type C i derived as Γ ⊢ C i ElCnstr and each type D j derived as Γ ⊢ D j EqCnstr according to the rules in Figure 3.Given a list of element and equality constructors built up according to these rules, thenewly-defined QIT, X , has formation rule Γ ⊢ X ∶ I → U ∆ ⊢ H ElCnstr
In the following X and I are fixed, whereas A , K , ∆ , etc. are metavariables. ∆ ⊢ i ∶ I Res ∆ ⊢ X i
ElCnstr ∆ ⊢ K StrPos ∆ , a ∶ K ⊢ H ElCnstr
Arg ∆ ⊢ ∏ a ∶ K H ElCnstr ∆ ⊢ K StrPos ∆ ⊢ i ∶ I IndArg ∆ ⊢ X i
StrPos ∆ ⊢ A ∶ U Param ∆ ⊢ A StrPos ∆ ⊢ A StrPos ∆ , a ∶ A ⊢ K StrPos
Prod ∆ ⊢ ∑ a ∶ A K StrPos ∆ ⊢ A ∶ U ∆ , a ∶ A ⊢ K StrPos
StrPosFun ∆ ⊢ ∏ a ∶ A K StrPos
Note: At this point ∆ ⊢ X ∶ U is not derivable, so firstly X can neverappear in the LHS of a ∏ -type (strictly positive), and secondly abstractingwith ∑ or ∏ cannot result in dependencies of X in the codomain. Inparticular, if X appears in the LHS of a ∑ -type, the RHS will not dependon it.For example, if I = N , then ∏ a ∶( X )× N X ( π a ) is the type of a constructorcontaining such a non-dependent Σ -type, and contains only strictly pos-itive occurrences of X in the arguments of the constructor. Whereas ∏ x ∶ X X (( λ y ∶ X . ) x ) is not a valid type for a constructor since theterm λ y ∶ X . cannot be typed as ∆ ⊢ X ∶ N → U cannot be derived. ∆ ⊢ K EqCnstr ∆ ⊢ i ∶ I ∆ ⊢ x EqTerm i ∆ ⊢ y EqTerm i ∆ ⊢ x = y EqCnstr ∆ , a ∶ A ⊢ K EqCnstr ∆ ⊢ A StrPos ∆ ⊢ ∏ a ∶ A K EqCnstr ∆ ⊢ x EqTerm i The introduction rules for the element constructors c , . . . , c m can beused when deriving EqTerm s. (Compare with the schema by Basold etal. [BGvdW17, Definition 6].) ∆ ⊢ x ∶ X i
Var ∆ ⊢ x EqTerm i ∆ ⊢ c p ∶ C p C p def = ∏ a ∶ A ∏ a ∶ A ⋯ ∏ a k ∶ A k X f ( a , a , . . . , a k ) ∆ ⊢ z ∶ A ∆ ⊢ z ∶ A ⋯ ∆ ⊢ z k ∶ A k Con ∆ ⊢ c p z z . . . z k EqTerm f ( z , z , . . . , z k ) Figure 3: Rules for QIT element and equality constructors.
UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 25 for the specific context Γ in which it was defined. And it has an introduction rule for eachelement constructor and each equality constructor: Γ ⊢ c ∶ C ⋯ Γ ⊢ c m ∶ C m Γ ⊢ d ∶ D ⋯ Γ ⊢ d n ∶ D n We show how to derive elimination and computation rules for X from these formationand introduction rules (compare with Basold, Geuvers, and van der Weide [BGvdW17,Definition 10]).The arguments of a constructor, written Arg ( C j ) , is the list of all strictly positive typesintroduced with the rule Arg . For the constructor c j ∶ C j def = Arg ( C j ) → X i , the index is aterm Γ , Arg ( C j ) . . . ⊢ i ∶ I , and can also be seen as a function from the constructor arguments Γ ⊢ Indx C j ∶ Arg ( C j ) → I .Given a QIT defined by constructors c , . . . , c m , d , . . . , d n as above, the underlyinginductive type ⌊ X ⌋ is the indexed inductive type defined by only the element constructors c , . . . , c m , ignoring the equalities; and then the underlying WI-type is the indexed W-typethat encodes this indexed inductive type. (Recall that every strictly positive description ofan endofunctor gives rise to a W-type with the same initial algebra; see Dybjer [Dyb97] andAltenkirch et al. [AGHMM15] for the more general indexed and nested case.)In order to define the elimination and computation rules we must first define the inductionhypothesis. First, given a motive Γ ⊢ P ∶ ∏ i ∶ I X i → U , define the type P ′ def = ∏ i ∶ I ∑ x ∶ X i P i x .Now given a strictly positive argument A , define the type A ′ by induction on the structureof A , replacing each occurrence of X i ( IndArg ) with P ′ i .Define leaf application on a strictly positive term a ∶ A for a function f ∶ ∏ i ∶ I ∏ p ∶ P ′ i Q p into some type Q , written f $ a by induction on the StrPos structure:
IndArg f $ x def = f x Param f $ b def = b Prod f $ ( a, b ) def = ( f $ a, f $ b ) StrPosFun f $ g def = ( f $ _ ) ○ g (7.1)To find the induction hypothesis C j ˆ for each element constructor c j ∶ C j , replace each of thestrictly positive arguments ∏ a ∶ A ⋯ ∏ a p ∶ A p with ∏ a ∶ A ′ ⋯ ∏ a p ∶ A ′ p , as defined above, andreplace the target X i , for some i , of the constructor with P i ( c j ( π $ a ) ⋯ ( π $ a p )) .The induction hypotheses for the element constructors are then h ∶ C ˆ , . . . , h m ∶ C m ˆ ,and these provide an eliminator elim h ⋯ h m for the underlying inductive type ⌊ X ⌋ .Given h , . . . , h m , define D ′ k ˆ , for each equality constructor d k ∶ D k , in the same way.Replace the endpoints l, r of the equality inductively with l ˆ , r ˆ : Var x ˆ def = x ∶ P ′ i Con c j a ⋯ a p ˆ def = h j a ˆ ⋯ a p ˆ (7.2)The elimination rule is then: Γ ⊢ P ∶ ∏ i ∶ I X i → U Γ ⊢ h ∶ C ˆ . . . Γ ⊢ h m ∶ C m ˆ Γ ⊢ p ∶ D ˆ . . . Γ ⊢ p n ∶ D n ˆ qitelim h ⋯ h m p ⋯ p n ∶ ∏ i ∶ I ∏ x ∶ X i P i x Finally the computation rules are, for each element constructor c i ∶ C i , same hypotheses as qitelim Γ ⊢ a , . . . , a p ∶ Arg ( C i ) qitelim h ⋯ h m p ⋯ p n ( Indx i ( a , . . . , a p )) ( c i a ⋯ a p )= P i ( c i a ⋯ a p ) h i (( id × ( qitelim ⋯)) $ a ) ⋯ (( id × ( qitelim ⋯)) $ a p ) From QIT to QWI-type.
We claim that any indexed QIT X in the sense of Defin-ition 7.1 can be constructed as the QWI-type for a signature Σ and equational system ε derived from the declaration of the QIT. That is, QWI-types are universal for non-conditionalQITs in the same sense that W-types are for inductive types in a sufficiently extensional typetheory.We saw above that the data c ∶ C , . . . , c m ∶ C m in Definition 7.1 gives rise to anunderlying indexed inductive type ⌊ X ⌋ and hence to a WI-type [AGHMM15], with signature Σ = ( I, A, B ) . The parameters and arguments of the equality constructors d ∶ D , . . . , d n ∶ D n are also encoded in the same way by a signature ( I, E, V ) . Then the endpoints of the equalityconstructors can be encoded by the l and r arguments of an equational system ε = ( I, E, V, l, r ) in the sense of Definition 3.1; the encoding follows the structure of EqTerm judgements inFigure 3, using the η constructor of T Σ (3.8) for Var and the σ constructor Con . We illustratethe encoding by example, beginning with the three examples from the Introduction.
Example 7.2 ( Finite multisets ) . The element constructors of the QIT,
Bag X , of finitemultisets over X ∶ U in (1.1) are encoded exactly as the W-type for List over X : we take A ∶ U to be + X , where ι corresponds to [] and ι x corresponds to x ∶∶ _ for each x ∶ X .The arity of [] is zero, and the arity of each x ∶∶ _ is one; so we take B ∶ A → U to be thefunction mapping ι to and each ι x to . The swap equality constructor is parametrisedby elements of E def = X × X and for each ( x, y ) ∶ E , swap ( x, y ) yields an equation involving asingle free variable (called zs ∶ Bag X in (1.1)); so we define V def = λ _ . ∶ E → U . Each side ofthe equation named by swap ( x, y ) is coded by an element of T Σ ( V ( x, y )) = T Σ . Recallingthe definition of T Σ from (3.9), the single free variable, zs , corresponds to η ∶ T Σ . Thenthe left-hand side of the equation, x ∶∶ y ∶∶ zs , is encoded as σ ( ι x, ( λ _ . σ ( ι y, ( λ _ . η )))) ,and similarly the right-hand side, y ∶∶ x ∶∶ zs , is encoded as σ ( ι y, ( λ _ . σ ( ι x, ( λ _ . η )))) .So altogether, the encoding of Bag X as a QW-type uses the non-indexed signature Σ = ( A, B ) and equational system ε = ( E, V, l, r ) , where: A def = + X E def = X × XB ( ι ) def = V ( x, y ) def = B ( ι x ) def = l ( x, y ) def = σ ( ι x, ( λ _ . σ ( ι y, ( λ _ . η )))) r ( x, y ) def = σ ( ι y, ( λ _ . σ ( ι x, ( λ _ . η )))) Example 7.3 ( Length-indexed multisets ) . The QWI-type encoding the QIT
AbVec X of length-indexed multisets in (1.3) is an indexed version of the previous example, using theindex type I def = N . The indexed signature Σ = ( N , A, B ) has A ∶ U N and B ∶ ∏ i ∶ N ( A i → U N ) given by: A def = A i + def = XB j def = B i + x j def = ( i = j ) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 27
The system of equations ε = ( E, V, l, r ) over Σ has E ∶ U N , V ∶ ∏ i ∶ N ( E i → U N ) and l, r ∶∏ i ∶ N ∏ e ∶ E i ( T Σ ( V i e )) i given by: E def = E def = E i + def = X × XV i + ( x, y ) j def = ( i = j ) l i + ( x, y ) def = σ i + ( x, λ _ . λ refl . σ i + ( y, λ _ . λ refl . η i refl )) r i + ( x, y ) def = σ i + ( y, λ _ . λ refl . σ i + ( x, λ _ . λ refl . η i refl )) (We have used dependent pattern matching [Coq92] to simplify the formulation of the abovedefinitions; refl ∶ x = x denotes the proof of reflexivity.) Example 7.4 ( Unordered countably-branching trees ) . The parameters of the leaf and node constructors for the QIT in (1.4) look like those for
Bag , except that the arity of node is N rather than . So we use the non-indexed signature Σ = ( A, B ) with A ∶ U and B ∶ A → U given by: A def = + XB ( ι ) def = B ( ι x ) def = N The perm equality constructor is parameterised by elements of X × ∑ b ∶ N → N isIso b . For eachelement ( x, b, b ′ ) of that type, perm ( x, b, b ′ ) yields an equation involving an N -indexed familyof variables (called f ∶ N → ω Tree X in (1.4)); so we take V ∶ E → U to be λ _ . N . Each sideof the equation named by perm ( x, b, b ′ ) is coded by an element of T Σ ( V ( x, b, b ′ )) = T Σ ( N ) .The N -indexed family of variables is represented by the function η ∶ N → T Σ ( N ) and itspermuted version by η ○ b . Thus the left- and right-hand sides of the equation named by perm ( x, b, b ′ ) are coded respectively by the elements σ ( ι x, η ) and σ ( ι x, η ○ b ) . Thus thenon-indexed system of equations over Σ for the QW-type corresponding to the QIT in (1.4)is ε = ( E, V, l, r ) with: E def = X × ∑ b ∶ N → N isIso bV ( x, b, b ′ ) def = N l ( x, b, b ′ ) def = σ ( ι x, η ) r ( x, b, b ′ ) def = σ ( ι x, η ○ b ) This example is significant since, prior to the introduction of QW-types [FPS20], none of theconstructions in the existing literature on subclasses of QITs [Soj15; Swa18; DM18] or QIITs[Dij17; KKA19] supported infinitary QITs.
Example 7.5 ( W-suspensions [Soj15]) . These are also instances of QW-types. The datafor a W-suspension is: a type A ′ ∶ U and a type family B ′ ∶ A ′ → U , (that is, the same data asa W-type), together with a type C ′ ∶ U and functions l ′ , r ′ ∶ C ′ → A ′ that express a restrictedsubset of equalities. The equivalent QW-type is: A def = A ′ E def = C ′ l def = λ c . σ ( l ′ c, η ) B def = B ′ V def = λ c . B ′ ( l ′ c ) × B ′ ( r ′ c ) r def = λ c . σ ( r ′ c, η ) Example 7.6 ( W-types with reductions [Swa18]) . These are further instances of QWI-types. The data of such a type, using our notational conventions, is: Z ∶ U , Y ∶ U Z , X ∶ Y ⇁̸ U ,together with, for all z ∶ Z a reindexing map R z ∶ ∏ y ∶ Y z ( X z y ) z . The reindexing map identifiesa term σ ( y, α ) in index z with one of the arguments that was used to construct that term,namely α z ( R z y ) . The equivalent QWI-type is given by: I def = Z A def = Y E def = Y l def = λ z . λ y . σ z ( y, η ) B def = X V def = X r def = λ z . λ y . η z ( R z y ) Example 7.7 ( Blass, Lumsdaine and Shulman’s HIT [LS19]) . As discussed in Section 4,Blass [Bla83, Section 9] shows that, provided a certain large cardinal axiom is consistent withZFC, then there is an infinitary equational theory with no initial algebra in ZF. Lumsdaineand Shulman [LS19, Section 9] adapt this theory into a higher-inductive type, called F , thatthat cannot be proved to exist in ZF, and hence cannot be constructed in type theory justusing pushouts and natural numbers. Nevertheless it can be constructed in the type theoryof Section 2 plus WISC, because of Theorem 6.1 and the fact that F can be expressed as aQWI-type.The type F can be thought of as a set of notations for countable ordinals. Its definitionrequires some setup.Fix the bijection [ even , odd ] ∶ N + N → N with inverse par . Fix another bijection pair ∶ N × N → N with inverse ⟨ fst , snd ⟩ . Given f, g ∶ N → A , write f ∪ g ∶ N → A for thecomposite [ f, g ] ○ par ; given a ∶ A , write { a } ∶ N → A for the constant function at a .Now F is defined by the three point constructors, ∶ FS ∶ F → F sup ∶ ( N → F ) → F and the five path constructors, sup { } = ∏ f,g ∶ N → N ∏ h ∶ N → F (∏ n ∶ N ( ∑ m ∶ N f ( m ) = n ) ↔ ( ∑ m ∶ N g ( m ) = n )) → sup ( h ○ f ) = sup ( h ○ g )∏ f,g ∶ N → F sup ( f ∪ { sup ( f ∪ g )}) = sup ( f ∪ g )∏ f,g ∶ N → F sup ( f ∪ { S ( sup ( f ∪ g ))}) = S ( sup ( f ∪ g ))∏ b,c ∶ N → N ∏ L ∶ N → N → N ∏ h ∶ N → F ( JS b c → Lrel
L b c → Lrel
L c b → sup ( iter h b ) = sup ( iter h c ) ) where JS b c def = the type of proofs that b and c are jointly surjective Lrel
L x y def = ∏ n ∶ N ∑ m,l ∶ N ( L ( x m ) l = y n ) iter h p def = λ n . h ( fst n ) ( p ( snd n )) h def = hh ( x + ) def = λ y . sup ( h x ○ ( L y )) UOTIENTS, INDUCTIVE TYPES, AND QUOTIENT INDUCTIVE TYPES 29
This can be expressed as a QW-type as follows: A def = B def = [ , , N ] E def = + ( N → N ) + + + ∑ b,c ∶ N → N ∑ L ∶ N → N → N ( JS b c × Lrel
L b c × Lrel
L c b ) V def = [ , N , N + N , N + N , N ] l ( ι _ ) def = σ ( , λ _ . σ ( , ! )) r ( ι _ ) def = σ ( , ! ) l ( ι f g ) def = σ ( , ( η ○ f )) r ( ι f g ) def = σ ( , ( η ○ g )) l ( ι _ ) def = σ ( , (( η ○ ι ) ∪ λ _ . σ ((( η ○ ι ) ∪ ( η ○ ι ))))) r ( ι _ ) def = σ ( , (( η ○ ι ) ∪ ( η ○ ι ))) l ( ι _ ) def = σ ( , (( η ○ ι ) ∪ λ _ . σ ( , λ _ . σ ((( η ○ ι ) ∪ ( η ○ ι )))))) r ( ι _ ) def = σ ( , λ _ . σ ( , (( η ○ ι ) ∪ ( η ○ ι )))) l ( ι b c L _ _ _ ) def = σ ( , λ n . k L ( fst n ) ( b ( snd n ))) r ( ι b c L _ _ _ ) def = σ ( , λ n . k L ( fst n ) ( c ( snd n ))) where k L def = ηk L ( x + ) def = λ y . σ ( , (( k L x ) ○ ( L y ))) Conclusion
QWI-types are a general form of indexed quotient inductive type that capture many ex-amples, including simple 1-cell complexes and non-recursive QITs [BGvdW17], non-structuralQITs [Soj15], W-types with reductions [Swa18] and also infinitary QITs (e.g. unorderedinfinitely branching trees [AK16] and the F-type of Lumsdaine and Shulman [LS19]). Wehave shown that it is possible to construct any QWI-type, even infinitary ones, in theextensional type theory of toposes with natural number objects and universes satisfying theWISC Axiom.We conclude by mentioning related work and some possible directions for future work.
Reduction of QWI to QW.
WI-types (indexed W-types) can be constructed from W-types: see [GH04, Theorem 12] and [AGHMM15, Section 7.1]. Our main Theorem 6.1 impliesindirectly that in the presence of WISC, QWI-types can be constructed from QW-types(since quotients and W-types are instances of the latter). We do not know whether there is adirect reduction of QWI to QW without any further axioms, extending the reduction of WIto W.
Conditional path equations.
In Section 7.1 we mentioned the fact that Dybjer andMoeneclaey [DM18] give a schema for finitary 1-HITs and 2-HITs in which constructors areallowed to take arguments involving the identity type of the datatype being declared. Tocover this case, one could consider generalising QWI-types by replacing the role played byinfinitary equational theories by theories whose axioms are infinitary Horn clauses, that is,equations conditioned by (possibly infinite) conjunctions of equations. It seems likely thatTheorem 6.1 could be extended to cover this case.
Quotients of monads.
Theorem 6.1 gives a construction of initial algebras for equationalsystems on the free monad T Σ generated by a signature Σ . By a suitable change of signature(see Remark 3.4) this extends to a construction of free algebras, rather than just initial ones.One can show that the construction works for an arbitrary strictly positive monad and notjust for free ones. Given such a construction one gets a quotient monad morphism from thebase monad to the quotient monad. This contravariantly induces a forgetful functor fromthe algebras of the latter to those of the former. Using the adjoint triangle theorem, oneshould be able to construct a left adjoint. This would then cover examples such as the freegroup over a monoid, free ring over a group, etc. Quotient inductive-inductive types.
We do not know whether our analysis of QITsusing quotients, inductive types and a well-founded notion of size can be extended to coverthe notion of quotient inductive-inductive type (QIIT) [ACDKN18; KKA19]. Dijkstra [Dij17]studies such types in depth and in Chapter 6 of his thesis gives a construction for finitaryones in terms of countable colimits, and hence in terms of countable coproducts and quotients.One could hope to pass to the infinitary case by using well-founded sizes as we have done,provided an analogue for QIITs can be found of the construction in Section 6 for our classof QITs, the QWI-types. Kaposi, Kovács, and Altenkirch [KKA19] give a specification offinitary QIITs using a domain-specific type theory called the theory of signatures and proveexistence of QIITs matching this specification. It might be possible to encode their theory ofsignatures using QWI-types (it can already be encoded as a QIIT), or to extend QWI-typesmaking this possible. This would allow infinitary QIITs.
Homotopy Type Theory (HoTT).
In this paper we have used an extensional type theory.Our Agda development is more intensional, but nevertheless makes use of the Uniquness ofIdentity Proofs (UIP) axiom, which is well-known to be incompatible with the UnivalenceAxiom [Uni13, Example 3.1.9]. Given the interest in HoTT, it is certainly worth investigatingwhether an analogue of Theorem 6.1 holds in some model of univalent foundations.
Pattern matching for QITs and HITs.
Our reduction of QITs to quotients and inductivetypes in the presence of WISC is of foundational interest. For applications, one could wishfor direct support in systems like Agda, Lean and Coq for the very useful notion of quotientinductive type, or more generally, for higher inductive types. Even having better support forthe special case of quotient types would be welcome. It is not hard to envisage the addition ofa general schema for declaring QITs; but when it comes to defining functions on them, havingto do that with eliminator forms rapidly becomes cumbersome (for example, for functions ofseveral QIT arguments). Some extension of dependently-typed pattern matching to coverequality constructors as well as element constructors is needed. In this context it is worth
EFERENCES 31 mentioning that the cubical features of recent versions of Agda give access to cubical typetheory [VMA19]. This allows for easy declaration of HITs and hence in particular QITs and acertain amount of pattern matching when it comes to defining functions on them: the valueof a function on a path constructor can be specified by using generic elements of the intervaltype in point-level patterns; but currently the user is given little mechanised assistance tosolve the definitional equality constraints on end-points of paths that are generated by thismethod.
Acknowledgement
We would like to acknowledge the contribution Ian Orton made to the initial developmentof the work described here; he and the first author supervised the third author’s Master’sthesis in which the notion of a QW-type was first introduced. The second author would alsolike to thank Andrew Swan for discussions about the role of WISC in constructive proofs ofcocontinuity for polynominal endofunctors (Corollary 5.9).
References [AAG05] M. Abbott, T. Altenkirch, and N. Ghani. “Containers: Constructing StrictlyPositive Types”. In:
Theoretical Computer Science vol. 342 .1 (2005), pp. 3–27.[Abe12] A. Abel. “Type-Based Termination, Inflationary Fixed-Points, and MixedInductive-Coinductive Types”. In:
Electronic Proceedings in Theoretical Com-puter Science vol. 77 (2012), pp. 1–11. doi : .[ACDKN18] Thorsten Altenkirch, Paolo Capriotti, Gabe Dijkstra, Nicolai Kraus, andFredrik Nordvall Forsberg. “Quotient Inductive-Inductive Types”. In: Founda-tions of Software Science and Computation Structures, FoSSaCS 2018 . Ed. byChristel Baier and Ugo Dal Lago. Vol. 10803. Lecture Notes in ComputerScience. Springer International Publishing, 2018, pp. 293–310.[Agd20] Agda v2.6.1. https://agda.readthedocs.io/en/v2.6.1.1/index.html .2020.[AGHMM15] Thorsten Altenkirch, Neil Ghani, Peter Hancock, Conor Mcbride, and PeterMorris. “Indexed Containers”. In:
Journal of Functional Programming vol. 25 (2015), e5. doi : .[AK16] T. Altenkirch and A. Kaposi. “Type Theory in Type Theory Using Quotient In-ductive Types”. In: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACTSymposium on Principles of Programming Languages - POPL 2016 . The43rd Annual ACM SIGPLAN-SIGACT Symposium. St. Petersburg, FL, USA:ACM Press, 2016, pp. 18–29. doi : .[BGvdW17] Henning Basold, Herman Geuvers, and Niels van der Weide. “Higher InductiveTypes in Programming”. In: Journal of Universal Computer Science vol. 23 .1(2017), p. 27. doi : .[Bla83] A. Blass. “Words, Free Algebras, and Coequalizers”. In: Fundamenta Mathem-aticae vol. 117 .2 (1983), pp. 117–160.[Coq92] T. Coquand. “Pattern Matching with Dependent Types”. In:
Proceedings ofthe 1992 Workshop on Types for Proofs and Programs, Båstad, Sweden . Ed. byB. Nordström, K. Petersson, and G. D. Plotkin. June 1992, pp. 66–79. [Dij17] Gabe Dijkstra. “Quotient Inductive-Inductive Definitions”. PhD thesis. UnitedKingdom: University of Nottingham, 14th Dec. 2017. url : http://eprints.nottingham.ac.uk/42317/1/thesis.pdf (visited on 14/10/2019).[DM18] Peter Dybjer and Hugo Moeneclaey. “Finitary Higher Inductive Types in theGroupoid Model”. In: Electronic Notes in Theoretical Computer Science vol.336 (Apr. 2018), pp. 119–134. doi : .[Dyb97] P. Dybjer. “Representing Inductively Defined Sets by Wellorderings in Martin-Löf’s Type Theory”. In: Theoretical Computer Science vol. 176 .1-2 (1997),pp. 329–335. doi : .[FH09] M. P. Fiore and C.-K. Hur. “On the Construction of Free Algebras forEquational Systems”. In: Theoretical Computer Science vol. 410 .18 (Apr.2009), pp. 1704–1729.[Fio13] M. P. Fiore. “An Equational Metalogic for Monadic Equational Systems”. In:
Theory and Applications of Categories vol. 27 .18 (2013), pp. 464–492. url : http://emis.ams.org/journals/TAC/volumes/27/18/27-18.pdf (visitedon 10/09/2019).[FPS20] M. P. Fiore, A. M. Pitts, and S. C. Steenkamp. “Constructing InfinitaryQuotient-Inductive Types”. In: . Ed. byJ. Goubault-Larrecq and B. König. Vol. 12077. Lecture Notes in ComputerScience. Springer, 2020, pp. 257–276. doi : .[FPS21] M. P. Fiore, A. M. Pitts, and S. C. Steenkamp. Agda Code Accompanying“Quotients, Inductive Types, and Quotient Inductive Types” . 2021. url : .[GH04] N. Gambino and M. Hyland. “Wellfounded Trees and Dependent PolynomialFunctors”. In: Types for Proofs and Programs . Ed. by S. Berardi, M. Coppo,and F. Damiani. Berlin, Heidelberg: Springer Berlin Heidelberg, 2004, pp. 210–225.[Git80] M. Gitik. “All Uncountable Cardinals Can Be Singular”. In:
Israel J. Math.vol. 35 .1–2 (1980), pp. 61–88.[Hof95] M. Hofmann. “Extensional Concepts in Intensional Type Theory”. PhD thesis.University of Edinburgh, 1995.[Joh02] P. T. Johnstone.
Sketches of an Elephant, A Topos Theory Compendium,Volumes 1 and 2 . Oxford Logic Guides 43–44. Oxford University Press, 2002.[Kar14] A. Karagila. “Embedding Orders into Cardinals with DC κ ”. In: FundamentaMathematcae vol. 226 (2014), pp. 143–156.[KKA19] Ambrus Kaposi, András Kovács, and Thorsten Altenkirch. “Constructing Quo-tient Inductive-Inductive Types”. In:
Proceedings of the ACM on ProgrammingLanguages vol. 3 (POPL 2nd Jan. 2019), 2:1–2:24. doi : .[LS19] P. L. Lumsdaine and M. Shulman. “Semantics of Higher Inductive Types”. In: Mathematical Proceedings of the Cambridge Philosophical Society (17th June2019), pp. 1–50. doi : .[Mar82] P. Martin-Löf. “Constructive Mathematics and Computer Programming”.In: Studies in Logic and the Foundations of Mathematics . Ed. by LaurenceJonathan Cohen, Jerzy Łoś, Helmut Pfeiffer, and Klaus-Peter Podewski. vol.104 . Elsevier, 1982, pp. 153–175. doi : . EFERENCES 33 [McB99] C. McBride. “Dependently Typed Functional Programs and Their Proofs”.PhD thesis. Edinburgh , Scotland, United Kingdom: University of Edinburgh,1999. 263 pp. url : https://era.ed.ac.uk/handle/1842/374 (visited on09/07/2020).[MM16] Philippe Malbos and Samuel Mimram. “Homological Computations for TermRewriting Systems”. In: . Vol. 52. Porto, Portugal, June 2016,27:1–27:17. url : https://hal.archives-ouvertes.fr/hal-01678175 .[MP00] I. Moerdijk and E. Palmgren. “Wellfounded Trees in Categories”. In: Annals ofPure and Applied Logic vol. 104 .1 (2000), pp. 189–218. doi : .[MP02] I. Moerdijk and E. Palmgren. “Type theories, Toposes and Constructive SetTheory: Predicative Aspects of AST”. In: Annals of Pure and Applied Logicvol. 114 .1 (2002), pp. 155–201.[Rob15] D. M. Roberts. “The Weak Choice Principle WISC may Fail in the Categoryof Sets”. In:
Studia Logica vol. 103 (2015), pp. 1005–1017.[Shu18] M. Shulman. “Brouwer’s Fixed-Point Theorem in Real-Cohesive HomotopyType Theory”. In:
Mathematical Structures in Computer Science vol. 28 .6(June 2018), pp. 856–941. doi : .[Soj15] Kristina Sojakova. “Higher Inductive Types as Homotopy-Initial Algebras”.In: Principles of Programming Languages . Proceedigns of the 42nd AnnualACM SIGPLAN-SIGACT Symposium. Mumbai, India: ACM Press, 2015,pp. 31–42. doi : .[Str05] T. Streicher. “Realizability Models for CZF + ¬ Pow”. . 2005.[Swa18] A. Swan. “W-Types with Reductions and the Small Object Argument”. In:(21st Feb. 2018). arXiv: .[Tay96] P. Taylor. “Intuitionistic Sets and Ordinals”. In:
Journal of Symbolic Logicvol. 61 (1996), pp. 705–744.[Uni13] The Univalent Foundations Program.
Homotopy Type Theory: UnivalentFoundations for Mathematics . Institute for Advanced Study: http : / /homotopytypetheory.org/book , 2013.[vdBM14] B. van den Berg and I. Moerdijk. “The Axiom of Multiple Choice and Modelsfor Constructive Set Theory”. In:
Journal of Mathematical Logic vol. 14 .01(June 2014), p. 1450005. doi : .[VMA19] Andrea Vezzosi, Anders Mörtberg, and Andreas Abel. “Cubical Agda: ADependently Typed Programming Language with Univalence and HigherInductive Types”. In: Proc. ACM Program. Lang. vol. 3 .ICFP (July 2019),87:1–87:29. doi : . This work is licensed under the Creative Commons Attribution License. To view a copy of thislicense, visit https://creativecommons.org/licenses/by/4.0/https://creativecommons.org/licenses/by/4.0/