$W$-Types in Categories of Coalgebras
Taichi Uemura

TL;DR
This paper develops a method to construct $W$-types within categories of coalgebras for cartesian comonads, extending previous constructions in presheaf and gluing toposes.
Contribution
It introduces a generalized construction of $W$-types applicable to coalgebras for cartesian comonads, broadening the scope of existing theories.
Findings
Constructed $W$-types in coalgebra categories for cartesian comonads
Unified previous $W$-type constructions in presheaf and gluing toposes
Extended the applicability of $W$-types in categorical frameworks
Abstract
We construct -types in the category of coalgebras for a cartesian comonad. It generalizes the constructions of -types in presheaf toposes and gluing toposes.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Algebra and Logic · semigroups and automata theory · Commutative Algebra and Its Applications
-Types in Categories of Coalgebras
Taichi Uemura
Abstract
We construct -types in the category of coalgebras for a cartesian comonad. It generalizes the constructions of -types in presheaf toposes and gluing toposes.
1 Introduction
-type is an important feature of Martin-Löf’s dependent type theory [Mar82, NPS90] and allows us to define a wide range of inductive types. Its categorical counterpart is the initial algebra for a polynomial endofunctor [MP00, GH04].
In this paper we construct -types in the category of coalgebras for a cartesian comonad. This is a generalization of the constructions of -types in presheaf toposes and Freyd cover given by Moerdijk and Palmgren [MP00] and gluing -pretoposes given by van den Berg [Ber06].
In Section 2 we review the notion of -type. In Section 3 we describe pushforwards in the category of coalgebras for a cartesian comonad. In Section 4 we show the main theorem (Theorem 35) and give some applications. In Section 5 we show a technical lemma used in the proof of the main theorem.
2 -Types in Categories
We review the notions of polynomial, algebra and -type. First we recall the notion of algebra for an endofunctor.
Definition 1**.**
Let be an endofunctor on a category . A -algebra consists of an object and a morphism . A morphism of -algebras is a morphism in such that . We shall denote by the category of -algebras and morphisms of -algebras, and by the obvious forgetful functor. An initial -algebra is an initial object in the category .
Definition 2**.**
Let and be endofunctors. A lax morphism is a pair consisting of a functor and a natural transformation . A strong morphism is a lax morphism such that is an natural isomorphism.
Proposition 3**.**
Let and be endofunctors. A lax morphism induces a functor such that defined by .
The following is analogous to the adjoint lifting theorem for (co)algebras for (co)monads by Johnstone [Joh75] and Keigher [Kei75].
Proposition 4**.**
Let and be endofunctors and a strong morphism. Suppose that has a right adjoint . Then the induced functor has a right adjoint such that .
Proof.
Let and denote the unit and counit, respectively, of the adjunction . The functor is part of a lax morphism with the mate of
[TABLE]
Hence we have a functor such that . One can show that and defines natural transformations and respectively, so is the right adjoint to . ∎
-types are defined as the initial algebras for endofunctors represented by polynomials.
Notation 5**.**
Let be a locally cartesian closed category. For a morphism in , we shall denote by the pullback functor , by or its left adjoint, and by or its right adjoint.
[TABLE]
We call the pushforward along .
For a functor and an object , we denote by the functor .
Definition 6**.**
Let be a locally cartesian closed category. For objects , a polynomial from to is a triple of morphisms of the form
[TABLE]
For a polynomial from to , we define a functor to be . We say a functor is represented by a polynomial from to when is isomorphic to . We shall denote by the class of functors that are represented by some polynomial from to . We often omit the subscript and simply write when the category is clear from the context.
Definition 7**.**
Let be a locally cartesian closed category. For an object , an endopolynomial on is a polynomial of the form
[TABLE]
We say has -types or is a locally cartesian closed category with -types if, for any endopolynomial on any object , there exists an initial -algebra.
Remark 8*.*
-types in this paper are what are called dependent -types or indexed -types in the literature. Gambino and Hyland [GH04] showed that a locally cartesian closed category has all non-dependent -types if and only if it has all dependent -types. So our terminology “having -types” coincides with that of Moerdijk and Palmgren [MP00].
Definition 9**.**
Let and be locally cartesian closed categories and a locally cartesian closed functor, namely a functor that preserves finite limits and pushforwards. By definition, for an endopolynomial on an object , the functor is part of a strong morphism . Suppose and have -types. We say preserves -types if the induced functor preserves initial objects for any endopolynomial in .
By Proposition 4 we have the following.
Proposition 10**.**
Let and be locally cartesian closed categories with -types and a locally cartesian closed functor. If has a right adjoint, then preserves -types.
The class of functors represented by polynomials is closed under several constructions.
Proposition 11**.**
Let be a locally cartesian closed category.
For any object , the identity functor belongs to . 2. 2.
For functors and , if belongs to and belongs to , then belongs to .
Proof.
The identity functor is represented by the polynomial . For the composition, see [GK13]. ∎
Proposition 12**.**
Let be a locally cartesian closed category and a functor. If belongs to , then belongs to for any object .
Proof.
Suppose that is represented by a polynomial
{I}$${A}$${B}$${J.}$$\scriptstyle{h}$$\scriptstyle{g}$$\scriptstyle{f}
Consider the following diagram,
[TABLE]
where the left and middle squares are pullbacks, is the counit of the adjunction , and is an isomorphism. Then the functor is represented by the polynomial . ∎
We introduce the notion of class of polynomial functors which is a generalization of the family of classes of functors . This generalization is necessary to apply Theorem 35 on the existence of -types for a wide range of categorical constructions (see Section 4.1 and 4.2).
Definition 13**.**
Let be a locally cartesian closed category with -types. A class of polynomial functors consists of a class of functors for each pair of objects satisfying the following conditions.
If belongs to , then it also belongs to . 2. 2.
If belongs to and belongs to , then belongs to . 3. 3.
If belongs to and , then belongs to . 4. 4.
If belongs to , then belongs to for any object . 5. 5.
For any endofunctor that belongs to , there exists an initial -algebra.
Example 14*.*
For a locally cartesian closed category with -types, the classes form a class of polynomial functors by Proposition 11 and 12.
Example 15*.*
Let be a class of polynomial functors on a locally cartesian closed category with -types. For an object and objects , we define a class of functors to be the class of functors that belong to under the identification and . Then form a class of polynomial functors on .
Remark 16*.*
Clearly holds, but need not hold.
2.1 The Characterization Theorem
In some nice category , -types have a nice characterization due to van den Berg [Ber05]. To achieve this characterization, the category should be extensive [CLW93].
Definition 17**.**
An extensive category is a category with finite coproduct such that, for any objects , the coproduct functor
[TABLE]
is an equivalence of categories.
When is locally cartesian closed, the extensivity of is equivalent to much simpler conditions.
Definition 18**.**
Let be a category with finite coproducts. We say a binary coproduct in is disjoint if the inclusions and are monic and the pullback of these inclusions is the initial object.
Proposition 19**.**
Let be a locally cartesian closed category with finite coproducts. The following conditions are equivalent.
* is extensive.* 2. 2.
Binary coproducts in are disjoint. 3. 3.
The binary coproduct is disjoint.
Proof.
It is known that a category with finite coproducts is extensive if and only if binary coproducts are universal and disjoint [CLW93, Proposition 2.14]. Binary coproducts in a locally cartesian closed category are always universal because pullback functors have right adjoints. Hence the conditions 1 and 2 are equivalent. Trivially 2 implies 3. Suppose that the coproduct is disjoint. To show that any binary coproduct is disjoint, it suffices to show that the pullback of the inclusions and is the initial object [CLW93, Proposition 2.13] because binary coproducts are universal. Now we have a morphism . Since is cartesian closed, the initial object is strict [Joh02, A1.5.12]. Hence is the initial object. ∎
Definition 20**.**
Let be a category. We say an object is well-founded if any monomorphism into is an isomorphism.
Definition 21**.**
Let be an endofunctor on a category. A fixed point of is a -algebra such that is an isomorphism.
Theorem 22** (Characterization Theorem).**
*Let be an extensive locally cartesian closed category with a natural number object and
{I}$${A}$${B}$${I}$$\scriptstyle{h}$$\scriptstyle{g}$$\scriptstyle{f}
an endopolynomial in . For a -algebra , the following conditions are equivalent.*
* is an initial -algebra.* 2. 2.
* is a well-founded fixed point of , namely a fixed point of that is well-founded in the category .*
Proof.
The proof is similar to [Ber05, Theorem 26]. ∎
3 Comonads
We review the theory of (cartesian) comonads.
Notation 23**.**
Let be a comonad on a category . We will refer to the counit and comultiplication of as and respectively. We denote by the category of -coalgebras, by the forgetful functor and by the right adjoint to such that . We will refer to the unit of the adjunction as .
Definition 24**.**
Let be a cartesian category. A cartesian comonad on is a comonad on whose underlying functor preserves finite limits.
The following Lemma 25 is well-known.
Lemma 25**.**
Let be a comonad on a category .
The forgetful functor creates colimits. 2. 2.
If is cartesian, then creates finite limits.
Proposition 26**.**
Let be a cartesian comonad on a cartesian category . If is locally cartesian closed, then so is .
Proposition 26 is a well-known fact [Joh02, A4.2.1]. We concretely describe the construction of pushforward functors.
First we recall the adjoint lifting theorem [Joh75].
Definition 27**.**
Let and be categories, a comonad on and a comonad on . An oplax morphism consists of a functor and a natural transformation satisfying and .
Proposition 28**.**
Let and be categories, a comonad on , a comonad on and a functor. A natural transformation that makes an oplax morphism bijectively corresponds to a functor such that .
Proposition 29** (Adjoint Lifting Theorem).**
Let and be cartesian categories, a cartesian comonad on , a cartesian comonad on and an oplax morphism. Let denote the corresponding functor such that . If has a right adjoint with unit and counit , then has a right adjoint defined by the equalizer of the following coreflexive pair:
[TABLE]
* is the composite*
[TABLE]
where is the mate of , namely the composite
[TABLE]
* is .*
A slice of a category of coalgebras is again a category of coalgebras in the following sense. Let be a cartesian comonad on a cartesian category . For a -coalgebra , we define a functor to be the composite
[TABLE]
One can show that is equipped with a comonad structure. By definition is cartesian. For a morphism of -coalgebras , the canonical natural transformation is an isomorphism. The category of -coalgebras is naturally isomorphic to the slice category .
Now we can describe pushforwards in a category of coalgebras. Let be a morphism of -coalgebras. We identify slice categories with . By Proposition 29 the pushforward is the equalizer of the following coreflexive pair:
[TABLE]
is the composite
[TABLE]
where is the mate of the natural isomorphism ; is .
The following Proposition 30 describes algebras in the category of coalgebras for a comonad.
Proposition 30**.**
Let be a comonad on a category and an oplax morphism . Let denote the corresponding functor such that . The forgetful functor induces a functor . Since is a lax morphism , we have a functor defined by .
* is part of a comonad on .* 2. 2.
* and is an oplax morphism . Now we have a commutative diagram*
[TABLE] 3. 3.
The category of -algebras is isomorphic over to the category of -coalgebras. 4. 4.
For any initial -algebra , there exists a unique initial -algebra such that and .
Proof.
1 and 2 are straightforward. To see 3, observe that both a -algebra and a -coalgebra consist of the following data:
- •
an object ;
- •
a morphism ;
- •
a morphism
such that is a -coalgebra and the following diagram commutes.
[TABLE]
4 follows from 3 and Lemma 25. ∎
Corollary 31**.**
Let be a cartesian comonad on a cartesian category with finite coproducts. Then the forgetful functor creates natural number objects.
Proof.
By Lemma 25, the diagram
[TABLE]
commutes. Then use Proposition 30. ∎
4 -Types in Categories of Coalgebras
We show the main theorem: the existence of -types in the category of coalgebras for a cartesian comonad. We also give some applications of this theorem.
Lemma 32**.**
Let be an extensive locally cartesian closed category. If has -types, then it has a natural number object.
Proof.
Because the natural number object is the initial algebra for the associated functor of the polynomial
[TABLE]
∎
Lemma 33**.**
Let be a cartesian comonad on a locally cartesian closed category . If is an extensive category, then so is .
Proof.
By Lemma 25, the binary coproduct in is disjoint. Then use Proposition 19. ∎
Lemma 34**.**
Let be a locally cartesian closed category, endofunctors and and natural transformations such that . Let denote the equalizer of and . Suppose that preserves pullbacks and preserves monomorphisms. If and have initial algebras, then has a well-founded fixed point.
We will prove Lemma 34 in Section 5.
Theorem 35**.**
Let be an extensive locally cartesian closed category with -types, a class of polynomial functors on and a cartesian comonad on . Suppose that the underlying functor of belongs to . Then the category of -coalgebras has -types.
Proof.
Let
[TABLE]
be an endopolynomial in . Since preserves equalizers, the endofunctor is an equalizer of the form
[TABLE]
where and , and both and are sections of a natural transformation (see Section 3). Since the forgetful functor creates finite limits, we have and . We define to be and to be . Then we have and similarly . Since and belong to by construction, they have initial algebras, and so do and by Proposition 30. By construction and preserve pullbacks, and thus there exists a well-founded fixed point of by Lemma 34. By Theorem 22 is an initial -algebra, because has a natural number object by Lemma 32 and Corollary 31 and is extensive by Lemma 33. ∎
4.1 Application: Internal Diagrams
Let be an internal category in a locally cartesian closed category . We denote by and the domain and codomain morphisms
{C_{1}}$${C_{0}}
respectively. The category of internal diagrams on is isomorphic to the category of coalgebras for the cartesian comonad
[TABLE]
on . It is known that the diagonal functor is a locally cartesian closed functor.
Corollary 36**.**
Let be an extensive locally cartesian closed category and an internal category in . If has -types, then so does the category of internal diagrams on . Moreover, the diagonal functor preserves -types.
Proof.
Apply Theorem 35 with . The preservation of -types follows from Proposition 10 because has a right adjoint. ∎
4.2 Application: Gluing
Let be a cartesian functor between locally cartesian closed categories. Since the comma category is isomorphic to the category of coalgebras for the cartesian comonad on , it is locally cartesian closed. From the construction of pushforwards described in Section 3 we know that the projection is a locally cartesian closed functor.
Corollary 37**.**
Let be a cartesian functor between extensive locally cartesian closed categories. If and have -types, then so does . Moreover, the projection preserves -types.
To show Corollary 37, we define an appropriate class of polynomial functors on .
Definition 38**.**
Let and be locally cartesian closed categories with -types and and classes of polynomial functors on and respectively. For objects , we define a class of functors to be the class of functors of the form with and such that belongs to and belongs to for every .
Proposition 39**.**
For classes and of polynomial functors on locally cartesian closed categories with -types and respectively, is a class of polynomial functors on .
Proof.
A functor of the form with and belongs to , and thus . It is also clear that is closed under isomorphism. To see that it is closed under composition, let , , and be functors such that , , and for any and . Then we have and and for any .
To show that is closed under slice, let and be functors and objects such that and for any . Then we have and . We also have for any because it is the composite
[TABLE]
Finally we show the existence of initial algebras. Let and be functors such that and for any . Let be the initial -algebra and the initial -algebra. Then the object and the morphism form a -algebra. Let be another -algebra. A morphism of -algebras consists of a morphism and such that and . The second condition is equivalent to that is a morphism of -algebras . Hence, there exists a unique pair of morphisms satisfying these conditions by the initiality of and . ∎
Proof of Corollary 37.
Apply Theorem 35 with . The preservation of -types follows from Proposition 10 because has a right adjoint. ∎
5 Algebras for the Equalizer of a Coreflexive Pair
In this section we prove Lemma 34: the existence of a well-founded fixed point for an endofunctor defined as the equalizer of a coreflexive pair.
Lemma 40**.**
Suppose that we are given the following commutative diagram in a cartesian category
[TABLE]
where is the equalizer of and , is the equalizer of and , and is a monomorphism. Then the induced morphism is the pullback of along .
Proof.
For a morphism , the following conditions are equivalent.
- •
factors through
- •
- •
- •
- •
factors through
∎
Proof of Lemma 34.
Let and be initial - and -algebras respectively. By the initiality of and , we have morphisms and such that , , and . Let be the equalizer of and . Consider the diagram
[TABLE]
where all rows are equalizers. Since preserves monomorphisms, is the pullback of along by Lemma 40 . also preserves monomorphisms because it preserves pullbacks. Therefore is the intersection of and in the poset of subobjects of . For a morphism , the following conditions are equivalent.
factors through . 2. 2.
and . 3. 3.
. 4. 4.
.
The conditions 1 and 2 are equivalent by definition. The conditions 3 and 4 are equivalent by the naturality of and . From 2, we have 3 as . 3 and 4 imply 2 because and . Hence, is also an equalizer of and . In the following diagram,
[TABLE]
all rows are equalizers and and are isomorphisms, and thus the morphism factors as with an isomorphism .
We show that is a well-founded -algebra. Let be a -algebra and a monomorphism that is a morphism of -algebras. Let denote the pushforward . Since is a monomorphism, we have a pullback
[TABLE]
Hence, it suffices to show that the monomorphism is an isomorphism. To prove this, it is enough to see that carries a -algebra structure over , that is, the composite
{P_{0}X_{0}}$${P_{0}W_{0}}$${W_{0}}$$\scriptstyle{s_{0}}
factors through .
[TABLE]
Since and , it is equivalent to that the composite
{i^{*}P_{0}X_{0}}$${i^{*}P_{0}W_{0}\cong PW}$${W}$$\scriptstyle{s}
factors through . Since has a -algebra structure over , it suffices to show that factors through . Now is the equalizer of and is a monomorphism, and thus the square
[TABLE]
is a pullback by Lemma 40. Hence, to show that factors through , it suffices to show that the composite
{i^{*}P_{0}X_{0}}$${PW}$${P_{0}W}$$\scriptstyle{\iota(W)}
factors through . Since preserves pullbacks, we have a pullback
[TABLE]
and thus it is enough to show that the composite
{i^{*}P_{0}X_{0}}$${PW}$${P_{0}W}$${P_{0}W_{0}}$$\scriptstyle{\iota(W)}$$\scriptstyle{P_{0}i}
factors through . But this is true because is the pullback
[TABLE]
and by the naturality of . ∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[Ber 05] Benno Berg “Inductive types and exact completion” In Annals of Pure and Applied Logic 134.2 , 2005, pp. 95–121 DOI: 10.1016/j.apal.2004.09.003 · doi ↗
- 2[Ber 06] Benno Berg “Predicative topos theory and models for constructive set theory”, 2006
- 3[CLW 93] Aurelio Carboni, Stephen Lack and R.F.C. Walters “Introduction to extensive and distributive categories” In Journal of Pure and Applied Algebra 84.2 , 1993, pp. 145–158 DOI: 10.1016/0022-4049(93)90035-R · doi ↗
- 4[GH 04] Nicola Gambino and Martin Hyland “Wellfounded Trees and Dependent Polynomial Functors” In Types for Proofs and Programs: International Workshop, TYPES 2003, Torino, Italy, April 30 - May 4, 2003, Revised Selected Papers Berlin, Heidelberg: Springer Berlin Heidelberg, 2004, pp. 210–225 DOI: 10.1007/978-3-540-24849-1˙14 · doi ↗
- 5[GK 13] Nicola Gambino and Joachim Kock “Polynomial functors and polynomial monads” In Mathematical Proceedings of the Cambridge Philosophical Society 154.1 Cambridge University Press, 2013, pp. 153–192 DOI: 10.1017/S 0305004112000394 · doi ↗
- 6[Joh 02] Peter T. Johnstone “Sketches of an Elephant : A Topos Theory Compendium Volume 1” 43 , Oxford Logic Guides Oxford University Press, Hardcover, 2002
- 7[Joh 75] Peter T. Johnstone “Adjoint Lifting Theorems for Categories of Algebras” In Bulletin of the London Mathematical Society 7.3 , 1975, pp. 294–297 DOI: 10.1112/blms/7.3.294 · doi ↗
- 8[Kei 75] William F. Keigher “Adjunctions and comonads in differential algebra” In Pacific Journal of Mathematics 59.1 , 1975, pp. 99–112 DOI: 10.2140/pjm.1975.59.99 · doi ↗
