The areas / V24. Category theory
Mathlib.CategoryTheory.Monad.Kleisli
60 declarations. Mathlib docs · Source
Kleisli category on a (co)monad
This file defines the Kleisli category on a monad (T, η_ T, μ_ T) as well as the co-Kleisli
category on a comonad (U, ε_ U, δ_ U). It also defines the Kleisli adjunction which gives rise to
the monad (T, η_ T, μ_ T) as well as the co-Kleisli adjunction which gives rise to the comonad
(U, ε_ U, δ_ U).
References
- [Riehl, Category theory in context, Definition 5.2.9][riehl2017]
theorem CategoryTheory.Cokleisli.mk.inj E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {U : CategoryTheory.Comonad C} {of of_1 : C},
{ of := of } = { of := of_1 } → of = of_1
theorem CategoryTheory.Cokleisli.Hom.mk.injEq E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {U : CategoryTheory.Comonad C}
{c c' : CategoryTheory.Cokleisli U} (of of_1 : U.obj c.of ⟶ c'.of), ({ of := of } = { of := of_1 }) = (of = of_1)
def CategoryTheory.Cokleisli.Hom.ctorIdx E1 #
{C : Type u} →
{inst : CategoryTheory.Category.{v, u} C} →
{U : CategoryTheory.Comonad C} → {c c' : CategoryTheory.Cokleisli U} → c.Hom c' → ℕ
theorem CategoryTheory.Kleisli.mk.injEq E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) (of of_1 : C),
({ of := of } = { of := of_1 }) = (of = of_1)
def CategoryTheory.Kleisli.Hom.ctorIdx E1 #
{C : Type u} →
{inst : CategoryTheory.Category.{v, u} C} →
{T : CategoryTheory.Monad C} → {c c' : CategoryTheory.Kleisli T} → c.Hom c' → ℕ
theorem CategoryTheory.Kleisli.mk.inj E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {T : CategoryTheory.Monad C} {of of_1 : C},
{ of := of } = { of := of_1 } → of = of_1
theorem CategoryTheory.Cokleisli.mk.injEq E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (U : CategoryTheory.Comonad C) (of of_1 : C),
({ of := of } = { of := of_1 }) = (of = of_1)
theorem CategoryTheory.Cokleisli.Hom.mk.inj E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {U : CategoryTheory.Comonad C}
{c c' : CategoryTheory.Cokleisli U} {of of_1 : U.obj c.of ⟶ c'.of}, { of := of } = { of := of_1 } → of = of_1
def CategoryTheory.Cokleisli.ctorIdx E1 #
{C : Type u} →
{inst : CategoryTheory.Category.{v, u} C} → {U : CategoryTheory.Comonad C} → CategoryTheory.Cokleisli U → ℕ
theorem CategoryTheory.Kleisli.Hom.mk.inj E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {T : CategoryTheory.Monad C} {c c' : CategoryTheory.Kleisli T}
{of of_1 : c.of ⟶ T.obj c'.of}, { of := of } = { of := of_1 } → of = of_1
theorem CategoryTheory.Kleisli.Hom.mk.injEq E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Monad C} {c c' : CategoryTheory.Kleisli T}
(of of_1 : c.of ⟶ T.obj c'.of), ({ of := of } = { of := of_1 }) = (of = of_1)
def CategoryTheory.Kleisli.ctorIdx E1 #
{C : Type u} → {inst : CategoryTheory.Category.{v, u} C} → {T : CategoryTheory.Monad C} → CategoryTheory.Kleisli T → ℕ
structure CategoryTheory.Kleisli E1 #
{C : Type u} → [inst : CategoryTheory.Category.{v, u} C] → CategoryTheory.Monad C → Type u
The objects for the Kleisli category of the monad T : Monad C, which are the same
thing as objects of the base category C.
ctor CategoryTheory.Kleisli.mk E0 #
{C : Type u} → [inst : CategoryTheory.Category.{v, u} C] → (T : CategoryTheory.Monad C) → C → CategoryTheory.Kleisli T
abbrev CategoryTheory.Kleisli.of E1 #
{C : Type u} → [inst : CategoryTheory.Category.{v, u} C] → {T : CategoryTheory.Monad C} → CategoryTheory.Kleisli T → C
The underlying object of the base category.
structure CategoryTheory.Cokleisli E1 #
{C : Type u} → [inst : CategoryTheory.Category.{v, u} C] → CategoryTheory.Comonad C → Type u
The objects for the co-Kleisli category of the comonad U : Comonad C, which are the same
thing as objects of the base category C.
ctor CategoryTheory.Cokleisli.mk E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] → (U : CategoryTheory.Comonad C) → C → CategoryTheory.Cokleisli U
abbrev CategoryTheory.Cokleisli.of E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] → {U : CategoryTheory.Comonad C} → CategoryTheory.Cokleisli U → C
The underlying object of the base category.
theorem CategoryTheory.Cokleisli.mk_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Comonad C}
(c : CategoryTheory.Cokleisli T), { of := c.of } = c
theorem CategoryTheory.Kleisli.mk_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Monad C} (c : CategoryTheory.Kleisli T),
{ of := c.of } = c
theorem CategoryTheory.Cokleisli.of_mk E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Comonad C} (c : C), { of := c }.of = c
theorem CategoryTheory.Kleisli.of_mk E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Monad C} (c : C), { of := c }.of = c
structure CategoryTheory.Kleisli.Hom E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{T : CategoryTheory.Monad C} → CategoryTheory.Kleisli T → CategoryTheory.Kleisli T → Type v
For (T : Monad C), morphisms c ⟶ c' in the Kleisli category of T are
morphisms c ⟶ T.obj c' in C.
ctor CategoryTheory.Kleisli.Hom.mk E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{T : CategoryTheory.Monad C} → {c c' : CategoryTheory.Kleisli T} → (c.of ⟶ T.obj c'.of) → c.Hom c'
abbrev CategoryTheory.Kleisli.Hom.of E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{T : CategoryTheory.Monad C} → {c c' : CategoryTheory.Kleisli T} → c.Hom c' → (c.of ⟶ T.obj c'.of)
The morphism in C underlying the morphism in the Kleisli category.
structure CategoryTheory.Cokleisli.Hom E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{U : CategoryTheory.Comonad C} → CategoryTheory.Cokleisli U → CategoryTheory.Cokleisli U → Type v
For (U : Comonad C), morphisms c ⟶ c' in the Cokleisli category of U are
morphisms U.obj c ⟶ c' in C.
ctor CategoryTheory.Cokleisli.Hom.mk E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{U : CategoryTheory.Comonad C} → {c c' : CategoryTheory.Cokleisli U} → (U.obj c.of ⟶ c'.of) → c.Hom c'
abbrev CategoryTheory.Cokleisli.Hom.of E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
{U : CategoryTheory.Comonad C} → {c c' : CategoryTheory.Cokleisli U} → c.Hom c' → (U.obj c.of ⟶ c'.of)
The morphism in C underlying the morphism in the Kleisli category.
theorem CategoryTheory.Cokleisli.Hom.ext E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {U : CategoryTheory.Comonad C}
{c c' : CategoryTheory.Cokleisli U} {x y : c.Hom c'}, x.of = y.of → x = y
theorem CategoryTheory.Cokleisli.Hom.ext_iff E0 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {U : CategoryTheory.Comonad C}
{c c' : CategoryTheory.Cokleisli U} {x y : c.Hom c'}, x = y ↔ x.of = y.of
theorem CategoryTheory.Kleisli.Hom.ext_iff E0 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {T : CategoryTheory.Monad C} {c c' : CategoryTheory.Kleisli T}
{x y : c.Hom c'}, x = y ↔ x.of = y.of
theorem CategoryTheory.Kleisli.Hom.ext E1 #
∀ {C : Type u} {inst : CategoryTheory.Category.{v, u} C} {T : CategoryTheory.Monad C} {c c' : CategoryTheory.Kleisli T}
{x y : c.Hom c'}, x.of = y.of → x = y
instance CategoryTheory.Kleisli.instInhabited E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
[Inhabited C] → (T : CategoryTheory.Monad C) → Inhabited (CategoryTheory.Kleisli T)
instance CategoryTheory.Cokleisli.instInhabited E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
[Inhabited C] → (T : CategoryTheory.Comonad C) → Inhabited (CategoryTheory.Cokleisli T)
instance CategoryTheory.Kleisli.category E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Monad C) → CategoryTheory.Category.{v, u} (CategoryTheory.Kleisli T)
The Kleisli category on a monad T.
cf Definition 5.2.9 in [Riehl][riehl2017].
theorem CategoryTheory.Kleisli.category_comp_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C)
{x x_1 Z : CategoryTheory.Kleisli T} (f : x.Hom x_1) (g : x_1.Hom Z),
(CategoryTheory.CategoryStruct.comp f g).of =
CategoryTheory.CategoryStruct.comp f.of (CategoryTheory.CategoryStruct.comp (T.map g.of) (T.μ.app Z.of))
instance CategoryTheory.Cokleisli.category E0 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Comonad C) → CategoryTheory.Category.{v, u} (CategoryTheory.Cokleisli T)
The co-Kleisli category on a comonad T.
theorem CategoryTheory.Cokleisli.category_id_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C)
(X : CategoryTheory.Cokleisli T), (CategoryTheory.CategoryStruct.id X).of = T.ε.app X.of
theorem CategoryTheory.Kleisli.category_id_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) (X : CategoryTheory.Kleisli T),
(CategoryTheory.CategoryStruct.id X).of = T.η.app X.of
theorem CategoryTheory.Cokleisli.category_comp_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C)
{Z x x_1 : CategoryTheory.Cokleisli T} (g : Z.Hom x) (f : x.Hom x_1),
(CategoryTheory.CategoryStruct.comp g f).of =
CategoryTheory.CategoryStruct.comp (T.δ.app Z.of) (CategoryTheory.CategoryStruct.comp (T.map g.of) f.of)
theorem CategoryTheory.Cokleisli.hom_ext_iff E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Comonad C}
{x y : CategoryTheory.Cokleisli T} {f g : y ⟶ x}, f = g ↔ f.of = g.of
theorem CategoryTheory.Cokleisli.hom_ext E1 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Comonad C}
{x y : CategoryTheory.Cokleisli T} {f g : y ⟶ x}, f.of = g.of → f = g
theorem CategoryTheory.Kleisli.hom_ext_iff E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Monad C} {x y : CategoryTheory.Kleisli T}
{f g : x ⟶ y}, f = g ↔ f.of = g.of
theorem CategoryTheory.Kleisli.hom_ext E1 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] {T : CategoryTheory.Monad C} {x y : CategoryTheory.Kleisli T}
{f g : x ⟶ y}, f.of = g.of → f = g
def CategoryTheory.Kleisli.Adjunction.toKleisli E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Monad C) → CategoryTheory.Functor C (CategoryTheory.Kleisli T)
The left adjoint of the adjunction which induces the monad (T, η_ T, μ_ T).
def CategoryTheory.Cokleisli.Adjunction.toCokleisli E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Comonad C) → CategoryTheory.Functor C (CategoryTheory.Cokleisli T)
The right adjoint of the adjunction which induces the comonad (T, ε_ T, δ_ T).
theorem CategoryTheory.Kleisli.Adjunction.toKleisli_map_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) {X Y : C} (f : X ⟶ Y),
((CategoryTheory.Kleisli.Adjunction.toKleisli T).map f).of = CategoryTheory.CategoryStruct.comp f (T.η.app Y)
theorem CategoryTheory.Kleisli.Adjunction.toKleisli_obj_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) (X : C),
((CategoryTheory.Kleisli.Adjunction.toKleisli T).obj X).of = X
theorem CategoryTheory.Cokleisli.Adjunction.toCokleisli_map_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C) {Y X : C} (f : Y ⟶ X),
((CategoryTheory.Cokleisli.Adjunction.toCokleisli T).map f).of = CategoryTheory.CategoryStruct.comp (T.ε.app Y) f
theorem CategoryTheory.Cokleisli.Adjunction.toCokleisli_obj_of E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C) (X : C),
((CategoryTheory.Cokleisli.Adjunction.toCokleisli T).obj X).of = X
def CategoryTheory.Kleisli.Adjunction.fromKleisli E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Monad C) → CategoryTheory.Functor (CategoryTheory.Kleisli T) C
The right adjoint of the adjunction which induces the monad (T, η_ T, μ_ T).
theorem CategoryTheory.Cokleisli.Adjunction.fromCokleisli_map E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C)
{Y x : CategoryTheory.Cokleisli T} (f : Y ⟶ x),
(CategoryTheory.Cokleisli.Adjunction.fromCokleisli T).map f =
CategoryTheory.CategoryStruct.comp (T.δ.app Y.of) (T.map f.of)
theorem CategoryTheory.Kleisli.Adjunction.fromKleisli_map E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) {x Y : CategoryTheory.Kleisli T}
(f : x ⟶ Y),
(CategoryTheory.Kleisli.Adjunction.fromKleisli T).map f =
CategoryTheory.CategoryStruct.comp (T.map f.of) (T.μ.app Y.of)
theorem CategoryTheory.Kleisli.Adjunction.fromKleisli_obj E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Monad C) (X : CategoryTheory.Kleisli T),
(CategoryTheory.Kleisli.Adjunction.fromKleisli T).obj X = T.obj X.of
def CategoryTheory.Cokleisli.Adjunction.fromCokleisli E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Comonad C) → CategoryTheory.Functor (CategoryTheory.Cokleisli T) C
The left adjoint of the adjunction which induces the comonad (T, ε_ T, δ_ T).
theorem CategoryTheory.Cokleisli.Adjunction.fromCokleisli_obj E0 #
∀ {C : Type u} [inst : CategoryTheory.Category.{v, u} C] (T : CategoryTheory.Comonad C)
(X : CategoryTheory.Cokleisli T), (CategoryTheory.Cokleisli.Adjunction.fromCokleisli T).obj X = T.obj X.of
def CategoryTheory.Kleisli.Adjunction.adj E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Monad C) →
CategoryTheory.Kleisli.Adjunction.toKleisli T ⊣ CategoryTheory.Kleisli.Adjunction.fromKleisli T
The Kleisli adjunction which gives rise to the monad (T, η_ T, μ_ T).
cf Lemma 5.2.11 of [Riehl][riehl2017].
def CategoryTheory.Kleisli.Adjunction.toKleisliCompFromKleisliIsoSelf E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Monad C) →
(CategoryTheory.Kleisli.Adjunction.toKleisli T).comp (CategoryTheory.Kleisli.Adjunction.fromKleisli T) ≅
T.toFunctor
The composition of the adjunction gives the original functor.
def CategoryTheory.Cokleisli.Adjunction.toCokleisliCompFromCokleisliIsoSelf E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Comonad C) →
(CategoryTheory.Cokleisli.Adjunction.toCokleisli T).comp (CategoryTheory.Cokleisli.Adjunction.fromCokleisli T) ≅
T.toFunctor
The composition of the adjunction gives the original functor.
def CategoryTheory.Cokleisli.Adjunction.adj E1 #
{C : Type u} →
[inst : CategoryTheory.Category.{v, u} C] →
(T : CategoryTheory.Comonad C) →
CategoryTheory.Cokleisli.Adjunction.fromCokleisli T ⊣ CategoryTheory.Cokleisli.Adjunction.toCokleisli T
The co-Kleisli adjunction which gives rise to the comonad (T, ε_ T, δ_ T).