Eilenberg-Moore (co)algebras for a (co)monad #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines Eilenberg-Moore (co)algebras for a (co)monad, and provides the category instance for them.
Further it defines the adjoint pair of free and forgetful functors, respectively from and to the original category, as well as the adjoint pair of forgetful and cofree functors, respectively from and to the original category.
References #
- A : C
- a : ↑T.obj self.A ⟶ self.A
- unit' : T.η.app self.A ≫ self.a = 𝟙 self.A . "obviously"
- assoc' : T.μ.app self.A ≫ self.a = ↑T.map self.a ≫ self.a . "obviously"
An Eilenberg-Moore algebra for a monad T
.
cf Definition 5.2.3 in Riehl.
Instances for category_theory.monad.algebra
- category_theory.monad.algebra.has_sizeof_inst
- category_theory.monad.algebra.category_theory.category_struct
- category_theory.monad.algebra.EilenbergMoore
- category_theory.monad.algebra.inhabited
- category_theory.monad.algebra_preadditive
A morphism of Eilenberg–Moore algebras for the monad T
.
Instances for category_theory.monad.algebra.hom
- category_theory.monad.algebra.hom.has_sizeof_inst
- category_theory.monad.algebra.hom.inhabited
The identity homomorphism for an Eilenberg–Moore algebra.
The category of Eilenberg-Moore algebras for a monad. cf Definition 5.2.4 in Riehl.
Equations
To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which commutes with the structure morphisms.
Equations
- category_theory.monad.algebra.iso_mk h w = {hom := {f := h.hom, h' := w}, inv := {f := h.inv, h' := _}, hom_inv_id' := _, inv_hom_id' := _}
The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure.
Equations
Instances for category_theory.monad.forget
- category_theory.monad.forget_reflects_iso
- category_theory.monad.forget_faithful
- category_theory.monad.forget.category_theory.is_right_adjoint
- category_theory.monad.forget.monadic_right_adjoint
- category_theory.monad.forget_creates_limits
- category_theory.monad.forget_creates_colimit
- category_theory.monad.forget_creates_colimits_of_shape
- category_theory.monad.forget_creates_colimits
- category_theory.monad.forget_additive
The free functor from the Eilenberg-Moore category, constructing an algebra for any object.
Equations
The adjunction between the free and forgetful constructions for Eilenberg-Moore algebras for a monad. cf Lemma 5.2.8 of Riehl.
Equations
- T.adj = category_theory.adjunction.mk_of_hom_equiv {hom_equiv := λ (X : C) (Y : T.algebra), {to_fun := λ (f : T.free.obj X ⟶ Y), T.η.app X ≫ f.f, inv_fun := λ (f : X ⟶ T.forget.obj Y), {f := T.to_functor.map f ≫ Y.a, h' := _}, left_inv := _, right_inv := _}, hom_equiv_naturality_left_symm' := _, hom_equiv_naturality_right' := _}
Given an algebra morphism whose carrier part is an isomorphism, we get an algebra isomorphism.
Given an algebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism.
Given an algebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism.
Given a monad morphism from T₂
to T₁
, we get a functor from the algebras of T₁
to algebras of
T₂
.
The identity monad morphism induces the identity functor from the category of algebras to itself.
Equations
- category_theory.monad.algebra_functor_of_monad_hom_id = category_theory.nat_iso.of_components (λ (X : T₁.algebra), category_theory.monad.algebra.iso_mk (category_theory.iso.refl ((category_theory.monad.algebra_functor_of_monad_hom (𝟙 T₁)).obj X).A) _) category_theory.monad.algebra_functor_of_monad_hom_id._proof_2
A composition of monad morphisms gives the composition of corresponding functors.
Equations
If f
and g
are two equal morphisms of monads, then the functors of algebras induced by them
are isomorphic.
We define it like this as opposed to using eq_to_iso
so that the components are nicer to prove
lemmas about.
Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over C
, that is, we have algebra_equiv_of_iso_monads h ⋙ forget = forget
.
Equations
- category_theory.monad.algebra_equiv_of_iso_monads h = {functor := category_theory.monad.algebra_functor_of_monad_hom h.inv, inverse := category_theory.monad.algebra_functor_of_monad_hom h.hom, unit_iso := category_theory.monad.algebra_functor_of_monad_hom_id.symm ≪≫ category_theory.monad.algebra_functor_of_monad_hom_eq _ ≪≫ category_theory.monad.algebra_functor_of_monad_hom_comp h.hom h.inv, counit_iso := (category_theory.monad.algebra_functor_of_monad_hom_comp h.inv h.hom).symm ≪≫ category_theory.monad.algebra_functor_of_monad_hom_eq _ ≪≫ category_theory.monad.algebra_functor_of_monad_hom_id, functor_unit_iso_comp' := _}
- A : C
- a : self.A ⟶ ↑G.obj self.A
- counit' : self.a ≫ G.ε.app self.A = 𝟙 self.A . "obviously"
- coassoc' : self.a ≫ G.δ.app self.A = self.a ≫ G.to_functor.map self.a . "obviously"
An Eilenberg-Moore coalgebra for a comonad T
.
Instances for category_theory.comonad.coalgebra
- category_theory.comonad.coalgebra.has_sizeof_inst
- category_theory.comonad.coalgebra.category_theory.category_struct
- category_theory.comonad.coalgebra.EilenbergMoore
- category_theory.comonad.coalgebra_preadditive
A morphism of Eilenberg-Moore coalgebras for the comonad G
.
Instances for category_theory.comonad.coalgebra.hom
- category_theory.comonad.coalgebra.hom.has_sizeof_inst
The identity homomorphism for an Eilenberg–Moore coalgebra.
The category of Eilenberg-Moore coalgebras for a comonad.
The category of Eilenberg-Moore coalgebras for a comonad.
Equations
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which commutes with the structure morphisms.
Equations
- category_theory.comonad.coalgebra.iso_mk h w = {hom := {f := h.hom, h' := w}, inv := {f := h.inv, h' := _}, hom_inv_id' := _, inv_hom_id' := _}
The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic structure.
Equations
The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any object.
The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras for a comonad.
Equations
- G.adj = category_theory.adjunction.mk_of_hom_equiv {hom_equiv := λ (X : G.coalgebra) (Y : C), {to_fun := λ (f : G.forget.obj X ⟶ Y), {f := X.a ≫ G.to_functor.map f, h' := _}, inv_fun := λ (g : X ⟶ G.cofree.obj Y), g.f ≫ G.ε.app Y, left_inv := _, right_inv := _}, hom_equiv_naturality_left_symm' := _, hom_equiv_naturality_right' := _}
Given a coalgebra morphism whose carrier part is an isomorphism, we get a coalgebra isomorphism.
Given a coalgebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism.
Given a coalgebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism.