File: Mathlib/CategoryTheory/Monad/Basic.lean

full_name: CategoryTheory.Monad
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.Monad.right_unit
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.map (self.η.app X)) (self.μ.app X) =
  CategoryTheory.CategoryStruct.id (self.obj ((CategoryTheory.Functor.id C).obj X))

full_name: CategoryTheory.Monad.left_unit
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.η.app (self.obj X)) (self.μ.app X) =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.Functor.id C).obj (self.obj X))

full_name: CategoryTheory.Monad.μ
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: self.comp self.toFunctor ⟶ self.toFunctor

full_name: CategoryTheory.Monad.η
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: CategoryTheory.Functor.id C ⟶ self.toFunctor

full_name: CategoryTheory.Monad.assoc
code: /-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.map (self.μ.app X)) (self.μ.app X) =
  CategoryTheory.CategoryStruct.comp (self.μ.app (self.obj X)) (self.μ.app X)

full_name: CategoryTheory.Comonad.ε
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: self.toFunctor ⟶ CategoryTheory.Functor.id C

full_name: CategoryTheory.Comonad.δ
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: self.toFunctor ⟶ self.comp self.toFunctor

full_name: CategoryTheory.Comonad.right_counit
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.map (self.ε.app X)) =
  CategoryTheory.CategoryStruct.id (self.obj X)

full_name: CategoryTheory.Comonad
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.Comonad.coassoc
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.map (self.δ.app X)) =
  CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.δ.app (self.obj X))

full_name: CategoryTheory.Comonad.left_counit
code: /-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.ε.app (self.obj X)) =
  CategoryTheory.CategoryStruct.id (self.obj X)

full_name: CategoryTheory.coeMonad
code: instance coeMonad : Coe (Monad C) (C ⥤ C) 
goal: Coe (CategoryTheory.Monad C) (CategoryTheory.Functor C C)

full_name: CategoryTheory.coeComonad
code: instance coeComonad : Coe (Comonad C) (C ⥤ C) 
goal: Coe (CategoryTheory.Comonad C) (CategoryTheory.Functor C C)

full_name: CategoryTheory.MonadHom.app_η
code: /-- A morphism of monads is a natural transformation compatible with η and μ. -/
@[ext]
structure MonadHom (T₁ T₂ : Monad C) extends NatTrans (T₁ : C ⥤ C) T₂ where
  app_η : ∀ X, T₁.η.app X ≫ app X = T₂.η.app X := by aesop_cat
  app_μ : ∀ X, T₁.μ.app X ≫ app X = (T₁.map (app X) ≫ app _) ≫ T₂.μ.app X := by
    aesop_cat
goal: CategoryTheory.CategoryStruct.comp (T₁.η.app X) (self.app X) = T₂.η.app X

full_name: CategoryTheory.MonadHom.app_μ
code: /-- A morphism of monads is a natural transformation compatible with η and μ. -/
@[ext]
structure MonadHom (T₁ T₂ : Monad C) extends NatTrans (T₁ : C ⥤ C) T₂ where
  app_η : ∀ X, T₁.η.app X ≫ app X = T₂.η.app X := by aesop_cat
  app_μ : ∀ X, T₁.μ.app X ≫ app X = (T₁.map (app X) ≫ app _) ≫ T₂.μ.app X := by
    aesop_cat
goal: CategoryTheory.CategoryStruct.comp (T₁.μ.app X) (self.app X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp (T₁.map (self.app X)) (self.app (T₂.obj X)))
    (T₂.μ.app X)

full_name: CategoryTheory.MonadHom
code: /-- A morphism of monads is a natural transformation compatible with η and μ. -/
@[ext]
structure MonadHom (T₁ T₂ : Monad C) extends NatTrans (T₁ : C ⥤ C) T₂ where
  app_η : ∀ X, T₁.η.app X ≫ app X = T₂.η.app X := by aesop_cat
  app_μ : ∀ X, T₁.μ.app X ≫ app X = (T₁.map (app X) ≫ app _) ≫ T₂.μ.app X := by
    aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.ComonadHom.app_δ
code: /-- A morphism of comonads is a natural transformation compatible with ε and δ. -/
@[ext]
structure ComonadHom (M N : Comonad C) extends NatTrans (M : C ⥤ C) N where
  app_ε : ∀ X, app X ≫ N.ε.app X = M.ε.app X := by aesop_cat
  app_δ : ∀ X, app X ≫ N.δ.app X = M.δ.app X ≫ app _ ≫ N.map (app X) := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.app X) (N.δ.app X) =
  CategoryTheory.CategoryStruct.comp (M.δ.app X)
    (CategoryTheory.CategoryStruct.comp (self.app (M.obj X)) (N.map (self.app X)))

full_name: CategoryTheory.ComonadHom
code: /-- A morphism of comonads is a natural transformation compatible with ε and δ. -/
@[ext]
structure ComonadHom (M N : Comonad C) extends NatTrans (M : C ⥤ C) N where
  app_ε : ∀ X, app X ≫ N.ε.app X = M.ε.app X := by aesop_cat
  app_δ : ∀ X, app X ≫ N.δ.app X = M.δ.app X ≫ app _ ≫ N.map (app X) := by aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.ComonadHom.app_ε
code: /-- A morphism of comonads is a natural transformation compatible with ε and δ. -/
@[ext]
structure ComonadHom (M N : Comonad C) extends NatTrans (M : C ⥤ C) N where
  app_ε : ∀ X, app X ≫ N.ε.app X = M.ε.app X := by aesop_cat
  app_δ : ∀ X, app X ≫ N.δ.app X = M.δ.app X ≫ app _ ≫ N.map (app X) := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (self.app X) (N.ε.app X) = M.ε.app X

full_name: CategoryTheory.instQuiverMonad
code: instance : Quiver (Monad C) 
goal: Quiver (CategoryTheory.Monad C)

full_name: CategoryTheory.instQuiverComonad
code: instance : Quiver (Comonad C) 
goal: Quiver (CategoryTheory.Comonad C)

full_name: CategoryTheory.MonadHom.ext'
code: @[ext]
lemma MonadHom.ext' {T₁ T₂ : Monad C} (f g : T₁ ⟶ T₂) (h : f.app = g.app) : f = g 
goal: f = g

full_name: CategoryTheory.ComonadHom.ext'
code: @[ext]
lemma ComonadHom.ext' {T₁ T₂ : Comonad C} (f g : T₁ ⟶ T₂) (h : f.app = g.app) : f = g 
goal: f = g

full_name: CategoryTheory.instCategoryMonad
code: instance : Category (Monad C) 
goal: CategoryTheory.Category.{max u₁ v₁, max u₁ v₁} (CategoryTheory.Monad C)

full_name: CategoryTheory.instCategoryComonad
code: instance : Category (Comonad C) 
goal: CategoryTheory.Category.{max u₁ v₁, max u₁ v₁} (CategoryTheory.Comonad C)

full_name: CategoryTheory.instInhabitedMonadHom
code: instance {T : Monad C} : Inhabited (MonadHom T T) 
goal: Inhabited (CategoryTheory.MonadHom T T)

full_name: CategoryTheory.MonadHom.id_toNatTrans
code: @[simp]
theorem MonadHom.id_toNatTrans (T : Monad C) : (𝟙 T : T ⟶ T).toNatTrans = 𝟙 (T : C ⥤ C) 
goal: (CategoryTheory.CategoryStruct.id T).toNatTrans = CategoryTheory.CategoryStruct.id T.toFunctor

full_name: CategoryTheory.MonadHom.comp_toNatTrans
code: @[simp]
theorem MonadHom.comp_toNatTrans {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    (f ≫ g).toNatTrans = ((f.toNatTrans : _ ⟶ (T₂ : C ⥤ C)) ≫ g.toNatTrans : (T₁ : C ⥤ C) ⟶ T₃) 
goal: (CategoryTheory.CategoryStruct.comp f g).toNatTrans = CategoryTheory.CategoryStruct.comp f.toNatTrans g.toNatTrans

full_name: CategoryTheory.instInhabitedComonadHom
code: instance {G : Comonad C} : Inhabited (ComonadHom G G) 
goal: Inhabited (CategoryTheory.ComonadHom G G)

full_name: CategoryTheory.ComonadHom.id_toNatTrans
code: @[simp]
theorem ComonadHom.id_toNatTrans (T : Comonad C) : (𝟙 T : T ⟶ T).toNatTrans = 𝟙 (T : C ⥤ C) 
goal: (CategoryTheory.CategoryStruct.id T).toNatTrans = CategoryTheory.CategoryStruct.id T.toFunctor

full_name: CategoryTheory.comp_toNatTrans
code: @[simp]
theorem comp_toNatTrans {T₁ T₂ T₃ : Comonad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    (f ≫ g).toNatTrans = ((f.toNatTrans : _ ⟶ (T₂ : C ⥤ C)) ≫ g.toNatTrans : (T₁ : C ⥤ C) ⟶ T₃) 
goal: (CategoryTheory.CategoryStruct.comp f g).toNatTrans = CategoryTheory.CategoryStruct.comp f.toNatTrans g.toNatTrans

full_name: CategoryTheory.MonadIso.mk_hom_toNatTrans
code: /-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N 
goal: (CategoryTheory.MonadIso.mk f f_η f_μ).hom.toNatTrans = f.hom

full_name: CategoryTheory.MonadIso.mk_inv_toNatTrans
code: /-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N 
goal: (CategoryTheory.MonadIso.mk f f_η f_μ).inv.toNatTrans = f.inv

full_name: CategoryTheory.MonadIso.mk
code: /-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N 
goal: M ≅ N

full_name: CategoryTheory.ComonadIso.mk_hom_toNatTrans
code: /-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N 
goal: (CategoryTheory.ComonadIso.mk f f_ε f_δ).hom.toNatTrans = f.hom

full_name: CategoryTheory.ComonadIso.mk_inv_toNatTrans
code: /-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N 
goal: (CategoryTheory.ComonadIso.mk f f_ε f_δ).inv.toNatTrans = f.inv

full_name: CategoryTheory.ComonadIso.mk
code: /-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N 
goal: M ≅ N

full_name: CategoryTheory.monadToFunctor_map
code: /-- The forgetful functor from the category of monads to the category of endofunctors.
-/
@[simps!]
def monadToFunctor : Monad C ⥤ C ⥤ C 
goal: ∀ {X Y : CategoryTheory.Monad C} (f : X ⟶ Y), (CategoryTheory.monadToFunctor C).map f = f.toNatTrans

full_name: CategoryTheory.monadToFunctor_obj
code: /-- The forgetful functor from the category of monads to the category of endofunctors.
-/
@[simps!]
def monadToFunctor : Monad C ⥤ C ⥤ C 
goal: (CategoryTheory.monadToFunctor C).obj T = T.toFunctor

full_name: CategoryTheory.monadToFunctor
code: /-- The forgetful functor from the category of monads to the category of endofunctors.
-/
@[simps!]
def monadToFunctor : Monad C ⥤ C ⥤ C 
goal: CategoryTheory.Functor (CategoryTheory.Monad C) (CategoryTheory.Functor C C)

full_name: CategoryTheory.instFaithfulMonadFunctorMonadToFunctor
code: instance : (monadToFunctor C).Faithful 
goal: (CategoryTheory.monadToFunctor C).Faithful

full_name: CategoryTheory.monadToFunctor_mapIso_monad_iso_mk
code: theorem monadToFunctor_mapIso_monad_iso_mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N) (f_η f_μ) :
    (monadToFunctor _).mapIso (MonadIso.mk f f_η f_μ) = f 
goal: (CategoryTheory.monadToFunctor C).mapIso (CategoryTheory.MonadIso.mk f f_η f_μ) = f

full_name: CategoryTheory.instReflectsIsomorphismsMonadFunctorMonadToFunctor
code: instance : (monadToFunctor C).ReflectsIsomorphisms 
goal: (CategoryTheory.monadToFunctor C).ReflectsIsomorphisms

full_name: CategoryTheory.comonadToFunctor
code: /-- The forgetful functor from the category of comonads to the category of endofunctors.
-/
@[simps!]
def comonadToFunctor : Comonad C ⥤ C ⥤ C 
goal: CategoryTheory.Functor (CategoryTheory.Comonad C) (CategoryTheory.Functor C C)

full_name: CategoryTheory.comonadToFunctor_obj
code: /-- The forgetful functor from the category of comonads to the category of endofunctors.
-/
@[simps!]
def comonadToFunctor : Comonad C ⥤ C ⥤ C 
goal: (CategoryTheory.comonadToFunctor C).obj G = G.toFunctor

full_name: CategoryTheory.comonadToFunctor_map
code: /-- The forgetful functor from the category of comonads to the category of endofunctors.
-/
@[simps!]
def comonadToFunctor : Comonad C ⥤ C ⥤ C 
goal: ∀ {X Y : CategoryTheory.Comonad C} (f : X ⟶ Y), (CategoryTheory.comonadToFunctor C).map f = f.toNatTrans

full_name: CategoryTheory.instFaithfulComonadFunctorComonadToFunctor
code: instance : (comonadToFunctor C).Faithful 
goal: (CategoryTheory.comonadToFunctor C).Faithful

full_name: CategoryTheory.comonadToFunctor_mapIso_comonad_iso_mk
code: theorem comonadToFunctor_mapIso_comonad_iso_mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N) (f_ε f_δ) :
    (comonadToFunctor _).mapIso (ComonadIso.mk f f_ε f_δ) = f 
goal: (CategoryTheory.comonadToFunctor C).mapIso (CategoryTheory.ComonadIso.mk f f_ε f_δ) = f

full_name: CategoryTheory.instReflectsIsomorphismsComonadFunctorComonadToFunctor
code: instance : (comonadToFunctor C).ReflectsIsomorphisms 
goal: (CategoryTheory.comonadToFunctor C).ReflectsIsomorphisms

full_name: CategoryTheory.MonadIso.toNatIso
code: /-- An isomorphism of monads gives a natural isomorphism of the underlying functors.
-/
/- Porting note: removed
`@[simps (config := { rhsMd := semireducible })]`
and replaced with `@[simps]` in the two declarations below-/
@[simps!]
def MonadIso.toNatIso {M N : Monad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: M.toFunctor ≅ N.toFunctor

full_name: CategoryTheory.MonadIso.toNatIso_inv
code: /-- An isomorphism of monads gives a natural isomorphism of the underlying functors.
-/
/- Porting note: removed
`@[simps (config := { rhsMd := semireducible })]`
and replaced with `@[simps]` in the two declarations below-/
@[simps!]
def MonadIso.toNatIso {M N : Monad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: (CategoryTheory.MonadIso.toNatIso h).inv = h.inv.toNatTrans

full_name: CategoryTheory.MonadIso.toNatIso_hom
code: /-- An isomorphism of monads gives a natural isomorphism of the underlying functors.
-/
/- Porting note: removed
`@[simps (config := { rhsMd := semireducible })]`
and replaced with `@[simps]` in the two declarations below-/
@[simps!]
def MonadIso.toNatIso {M N : Monad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: (CategoryTheory.MonadIso.toNatIso h).hom = h.hom.toNatTrans

full_name: CategoryTheory.ComonadIso.toNatIso_inv
code: /-- An isomorphism of comonads gives a natural isomorphism of the underlying functors.
-/
@[simps!]
def ComonadIso.toNatIso {M N : Comonad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: (CategoryTheory.ComonadIso.toNatIso h).inv = h.inv.toNatTrans

full_name: CategoryTheory.ComonadIso.toNatIso
code: /-- An isomorphism of comonads gives a natural isomorphism of the underlying functors.
-/
@[simps!]
def ComonadIso.toNatIso {M N : Comonad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: M.toFunctor ≅ N.toFunctor

full_name: CategoryTheory.ComonadIso.toNatIso_hom
code: /-- An isomorphism of comonads gives a natural isomorphism of the underlying functors.
-/
@[simps!]
def ComonadIso.toNatIso {M N : Comonad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N 
goal: (CategoryTheory.ComonadIso.toNatIso h).hom = h.hom.toNatTrans

full_name: CategoryTheory.Monad.id_obj
code: /-- The identity monad. -/
@[simps!]
def id : Monad C 
goal: (CategoryTheory.Monad.id C).obj X = X

full_name: CategoryTheory.Monad.id_η_app
code: /-- The identity monad. -/
@[simps!]
def id : Monad C 
goal: (CategoryTheory.Monad.id C).η.app X = CategoryTheory.CategoryStruct.id X

full_name: CategoryTheory.Monad.id_μ_app
code: /-- The identity monad. -/
@[simps!]
def id : Monad C 
goal: (CategoryTheory.Monad.id C).μ.app X = CategoryTheory.CategoryStruct.id X

full_name: CategoryTheory.Monad.id
code: /-- The identity monad. -/
@[simps!]
def id : Monad C 
goal: CategoryTheory.Monad C

full_name: CategoryTheory.Monad.id_map
code: /-- The identity monad. -/
@[simps!]
def id : Monad C 
goal: ∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.Monad.id C).map f = f

full_name: CategoryTheory.Monad.instInhabited
code: instance : Inhabited (Monad C) 
goal: Inhabited (CategoryTheory.Monad C)

full_name: CategoryTheory.Comonad.id_δ_app
code: /-- The identity comonad. -/
@[simps!]
def id : Comonad C 
goal: (CategoryTheory.Comonad.id C).δ.app X = CategoryTheory.CategoryStruct.id X

full_name: CategoryTheory.Comonad.id_ε_app
code: /-- The identity comonad. -/
@[simps!]
def id : Comonad C 
goal: (CategoryTheory.Comonad.id C).ε.app X = CategoryTheory.CategoryStruct.id X

full_name: CategoryTheory.Comonad.id
code: /-- The identity comonad. -/
@[simps!]
def id : Comonad C 
goal: CategoryTheory.Comonad C

full_name: CategoryTheory.Comonad.id_obj
code: /-- The identity comonad. -/
@[simps!]
def id : Comonad C 
goal: (CategoryTheory.Comonad.id C).obj X = X

full_name: CategoryTheory.Comonad.id_map
code: /-- The identity comonad. -/
@[simps!]
def id : Comonad C 
goal: ∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.Comonad.id C).map f = f

full_name: CategoryTheory.Comonad.instInhabited
code: instance : Inhabited (Comonad C) 
goal: Inhabited (CategoryTheory.Comonad C)

full_name: CategoryTheory.Monad.transport
code: /-- Transport a monad structure on a functor along an isomorphism of functors. -/
def transport {F : C ⥤ C} (T : Monad C) (i : (T : C ⥤ C) ≅ F) : Monad C 
goal: CategoryTheory.Monad C

full_name: CategoryTheory.Comonad.transport
code: /-- Transport a comonad structure on a functor along an isomorphism of functors. -/
def transport {F : C ⥤ C} (T : Comonad C) (i : (T : C ⥤ C) ≅ F) : Comonad C 
goal: CategoryTheory.Comonad C