File: Mathlib/CategoryTheory/Monad/Algebra.lean

full_name: CategoryTheory.Monad.Algebra.A
code: /-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat
goal: C

full_name: CategoryTheory.Monad.Algebra
code: /-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.Monad.Algebra.assoc
code: /-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (T.μ.app self.A) self.a = CategoryTheory.CategoryStruct.comp (T.map self.a) self.a

full_name: CategoryTheory.Monad.Algebra.unit
code: /-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (T.η.app self.A) self.a = CategoryTheory.CategoryStruct.id self.A

full_name: CategoryTheory.Monad.Algebra.a
code: /-- An Eilenberg-Moore algebra for a monad `T`.
    cf Definition 5.2.3 in [Riehl][riehl2017]. -/
structure Algebra (T : Monad C) : Type max u₁ v₁ where
  /-- The underlying object associated to an algebra. -/
  A : C
  /-- The structure morphism associated to an algebra. -/
  a : (T : C ⥤ C).obj A ⟶ A
  /-- The unit axiom associated to an algebra. -/
  unit : T.η.app A ≫ a = 𝟙 A := by aesop_cat
  /-- The associativity axiom associated to an algebra. -/
  assoc : T.μ.app A ≫ a = (T : C ⥤ C).map a ≫ a := by aesop_cat
goal: T.obj self.A ⟶ self.A

full_name: CategoryTheory.Monad.Algebra.Hom
code: /-- A morphism of Eilenberg–Moore algebras for the monad `T`. -/
@[ext]
structure Hom (A B : Algebra T) where
  /-- The underlying morphism associated to a morphism of algebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of algebras. -/
  h : (T : C ⥤ C).map f ≫ B.a = A.a ≫ f := by aesop_cat
goal: Type v₁

full_name: CategoryTheory.Monad.Algebra.Hom.h
code: /-- A morphism of Eilenberg–Moore algebras for the monad `T`. -/
@[ext]
structure Hom (A B : Algebra T) where
  /-- The underlying morphism associated to a morphism of algebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of algebras. -/
  h : (T : C ⥤ C).map f ≫ B.a = A.a ≫ f := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (T.map self.f) B.a = CategoryTheory.CategoryStruct.comp A.a self.f

full_name: CategoryTheory.Monad.Algebra.Hom.f
code: /-- A morphism of Eilenberg–Moore algebras for the monad `T`. -/
@[ext]
structure Hom (A B : Algebra T) where
  /-- The underlying morphism associated to a morphism of algebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of algebras. -/
  h : (T : C ⥤ C).map f ≫ B.a = A.a ≫ f := by aesop_cat
goal: A.A ⟶ B.A

full_name: CategoryTheory.Monad.Algebra.Hom.id
code: /-- The identity homomorphism for an Eilenberg–Moore algebra. -/
def id (A : Algebra T) : Hom A A 
goal: A.Hom A

full_name: CategoryTheory.Monad.Algebra.Hom.instInhabited
code: instance (A : Algebra T) : Inhabited (Hom A A) 
goal: Inhabited (A.Hom A)

full_name: CategoryTheory.Monad.Algebra.Hom.comp
code: /-- Composition of Eilenberg–Moore algebra homomorphisms. -/
def comp {P Q R : Algebra T} (f : Hom P Q) (g : Hom Q R) : Hom P R 
goal: P.Hom R

full_name: CategoryTheory.Monad.Algebra.instCategoryStruct
code: instance : CategoryStruct (Algebra T) 
goal: CategoryTheory.CategoryStruct.{v₁, max u₁ v₁} T.Algebra

full_name: CategoryTheory.Monad.Algebra.Hom.ext'
code: @[ext]
lemma Hom.ext' (X Y : Algebra T) (f g : X ⟶ Y) (h : f.f = g.f) : f = g 
goal: f = g

full_name: CategoryTheory.Monad.Algebra.comp_eq_comp
code: @[simp]
theorem comp_eq_comp {A A' A'' : Algebra T} (f : A ⟶ A') (g : A' ⟶ A'') :
    Algebra.Hom.comp f g = f ≫ g 
goal: CategoryTheory.Monad.Algebra.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g

full_name: CategoryTheory.Monad.Algebra.id_eq_id
code: @[simp]
theorem id_eq_id (A : Algebra T) : Algebra.Hom.id A = 𝟙 A 
goal: CategoryTheory.Monad.Algebra.Hom.id A = CategoryTheory.CategoryStruct.id A

full_name: CategoryTheory.Monad.Algebra.id_f
code: @[simp]
theorem id_f (A : Algebra T) : (𝟙 A : A ⟶ A).f = 𝟙 A.A 
goal: (CategoryTheory.CategoryStruct.id A).f = CategoryTheory.CategoryStruct.id A.A

full_name: CategoryTheory.Monad.Algebra.comp_f
code: @[simp]
theorem comp_f {A A' A'' : Algebra T} (f : A ⟶ A') (g : A' ⟶ A'') : (f ≫ g).f = f.f ≫ g.f 
goal: (CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f

full_name: CategoryTheory.Monad.Algebra.eilenbergMoore
code: /-- The category of Eilenberg-Moore algebras for a monad.
    cf Definition 5.2.4 in [Riehl][riehl2017]. -/
instance eilenbergMoore : Category (Algebra T) 
goal: CategoryTheory.Category.{v₁, max u₁ v₁} T.Algebra

full_name: CategoryTheory.Monad.Algebra.isoMk
code: /--
To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Algebra T} (h : A.A ≅ B.A)
    (w : (T : C ⥤ C).map h.hom ≫ B.a = A.a ≫ h.hom := by aesop_cat) : A ≅ B 
goal: A ≅ B

full_name: CategoryTheory.Monad.Algebra.isoMk_inv_f
code: /--
To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Algebra T} (h : A.A ≅ B.A)
    (w : (T : C ⥤ C).map h.hom ≫ B.a = A.a ≫ h.hom := by aesop_cat) : A ≅ B 
goal: (CategoryTheory.Monad.Algebra.isoMk h w).inv.f = h.inv

full_name: CategoryTheory.Monad.Algebra.isoMk_hom_f
code: /--
To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Algebra T} (h : A.A ≅ B.A)
    (w : (T : C ⥤ C).map h.hom ≫ B.a = A.a ≫ h.hom := by aesop_cat) : A ≅ B 
goal: (CategoryTheory.Monad.Algebra.isoMk h w).hom.f = h.hom

full_name: CategoryTheory.Monad.forget_map
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure. -/
@[simps]
def forget : Algebra T ⥤ C 
goal: ∀ {X Y : T.Algebra} (f : X ⟶ Y), T.forget.map f = f.f

full_name: CategoryTheory.Monad.forget_obj
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure. -/
@[simps]
def forget : Algebra T ⥤ C 
goal: T.forget.obj A = A.A

full_name: CategoryTheory.Monad.forget
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure. -/
@[simps]
def forget : Algebra T ⥤ C 
goal: CategoryTheory.Functor T.Algebra C

full_name: CategoryTheory.Monad.free_obj_a
code: /-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T 
goal: (T.free.obj X).a = T.μ.app X

full_name: CategoryTheory.Monad.free_map_f
code: /-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T 
goal: ∀ {X Y : C} (f : X ⟶ Y), (T.free.map f).f = T.map f

full_name: CategoryTheory.Monad.free_obj_A
code: /-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T 
goal: (T.free.obj X).A = T.obj X

full_name: CategoryTheory.Monad.free
code: /-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T 
goal: CategoryTheory.Functor C T.Algebra

full_name: CategoryTheory.Monad.instInhabitedAlgebra
code: instance [Inhabited C] : Inhabited (Algebra T) 
goal: Inhabited T.Algebra

full_name: CategoryTheory.Monad.adj
code: /-- The adjunction between the free and forgetful constructions for Eilenberg-Moore algebras for
  a monad. cf Lemma 5.2.8 of [Riehl][riehl2017]. -/
@[simps! unit counit]
def adj : T.free ⊣ T.forget 
goal: T.free ⊣ T.forget

full_name: CategoryTheory.Monad.adj_unit
code: /-- The adjunction between the free and forgetful constructions for Eilenberg-Moore algebras for
  a monad. cf Lemma 5.2.8 of [Riehl][riehl2017]. -/
@[simps! unit counit]
def adj : T.free ⊣ T.forget 
goal: T.adj.unit = { app := fun X => T.η.app X, naturality := ⋯ }

full_name: CategoryTheory.Monad.adj_counit
code: /-- The adjunction between the free and forgetful constructions for Eilenberg-Moore algebras for
  a monad. cf Lemma 5.2.8 of [Riehl][riehl2017]. -/
@[simps! unit counit]
def adj : T.free ⊣ T.forget 
goal: T.adj.counit = { app := fun Y => { f := Y.a, h := ⋯ }, naturality := ⋯ }

full_name: CategoryTheory.Monad.algebra_iso_of_iso
code: /-- Given an algebra morphism whose carrier part is an isomorphism, we get an algebra isomorphism.
-/
theorem algebra_iso_of_iso {A B : Algebra T} (f : A ⟶ B) [IsIso f.f] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Monad.forget_reflects_iso
code: instance forget_reflects_iso : T.forget.ReflectsIsomorphisms 
goal: T.forget.ReflectsIsomorphisms

full_name: CategoryTheory.Monad.forget_faithful
code: instance forget_faithful : T.forget.Faithful 
goal: T.forget.Faithful

full_name: CategoryTheory.Monad.algebra_epi_of_epi
code: /-- Given an algebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism.
-/
theorem algebra_epi_of_epi {X Y : Algebra T} (f : X ⟶ Y) [h : Epi f.f] : Epi f 
goal: CategoryTheory.Epi f

full_name: CategoryTheory.Monad.algebra_mono_of_mono
code: /-- Given an algebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism.
-/
theorem algebra_mono_of_mono {X Y : Algebra T} (f : X ⟶ Y) [h : Mono f.f] : Mono f 
goal: CategoryTheory.Mono f

full_name: CategoryTheory.Monad.instIsRightAdjointAlgebraForget
code: instance : T.forget.IsRightAdjoint  
goal: T.forget.IsRightAdjoint

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHom
code: /--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂ 
goal: CategoryTheory.Functor T₁.Algebra T₂.Algebra

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHom_obj_a
code: /--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂ 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHom h).obj A).a = CategoryTheory.CategoryStruct.comp (h.app A.A) A.a

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHom_map_f
code: /--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂ 
goal: ∀ {X Y : T₁.Algebra} (f : X ⟶ Y), ((CategoryTheory.Monad.algebraFunctorOfMonadHom h).map f).f = f.f

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHom_obj_A
code: /--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂ 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHom h).obj A).A = A.A

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomId_inv_app_f
code: /--
The identity monad morphism induces the identity functor from the category of algebras to itself.
-/
-- Porting note: `semireducible -> default`
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomId {T₁ : Monad C} : algebraFunctorOfMonadHom (𝟙 T₁) ≅ 𝟭 _ 
goal: (CategoryTheory.Monad.algebraFunctorOfMonadHomId.inv.app X).f =
  (CategoryTheory.Iso.refl
      ((CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.id T₁)).obj X).A).inv

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomId
code: /--
The identity monad morphism induces the identity functor from the category of algebras to itself.
-/
-- Porting note: `semireducible -> default`
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomId {T₁ : Monad C} : algebraFunctorOfMonadHom (𝟙 T₁) ≅ 𝟭 _ 
goal: CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.id T₁) ≅
  CategoryTheory.Functor.id T₁.Algebra

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomId_hom_app_f
code: /--
The identity monad morphism induces the identity functor from the category of algebras to itself.
-/
-- Porting note: `semireducible -> default`
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomId {T₁ : Monad C} : algebraFunctorOfMonadHom (𝟙 T₁) ≅ 𝟭 _ 
goal: (CategoryTheory.Monad.algebraFunctorOfMonadHomId.hom.app X).f =
  (CategoryTheory.Iso.refl
      ((CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.id T₁)).obj X).A).hom

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomComp_inv_app_f
code: /-- A composition of monad morphisms gives the composition of corresponding functors.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomComp {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    algebraFunctorOfMonadHom (f ≫ g) ≅ algebraFunctorOfMonadHom g ⋙ algebraFunctorOfMonadHom f 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHomComp f g).inv.app X).f =
  (CategoryTheory.Iso.refl
      ((CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.comp f g)).obj X).A).inv

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomComp_hom_app_f
code: /-- A composition of monad morphisms gives the composition of corresponding functors.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomComp {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    algebraFunctorOfMonadHom (f ≫ g) ≅ algebraFunctorOfMonadHom g ⋙ algebraFunctorOfMonadHom f 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHomComp f g).hom.app X).f =
  (CategoryTheory.Iso.refl
      ((CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.comp f g)).obj X).A).hom

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomComp
code: /-- A composition of monad morphisms gives the composition of corresponding functors.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomComp {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    algebraFunctorOfMonadHom (f ≫ g) ≅ algebraFunctorOfMonadHom g ⋙ algebraFunctorOfMonadHom f 
goal: CategoryTheory.Monad.algebraFunctorOfMonadHom (CategoryTheory.CategoryStruct.comp f g) ≅
  (CategoryTheory.Monad.algebraFunctorOfMonadHom g).comp (CategoryTheory.Monad.algebraFunctorOfMonadHom f)

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomEq_hom_app_f
code: /-- 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 `eqToIso` so that the components are nicer to prove
lemmas about.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomEq {T₁ T₂ : Monad C} {f g : T₁ ⟶ T₂} (h : f = g) :
    algebraFunctorOfMonadHom f ≅ algebraFunctorOfMonadHom g 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHomEq h).hom.app X).f =
  (CategoryTheory.Iso.refl ((CategoryTheory.Monad.algebraFunctorOfMonadHom f).obj X).A).hom

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomEq
code: /-- 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 `eqToIso` so that the components are nicer to prove
lemmas about.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomEq {T₁ T₂ : Monad C} {f g : T₁ ⟶ T₂} (h : f = g) :
    algebraFunctorOfMonadHom f ≅ algebraFunctorOfMonadHom g 
goal: CategoryTheory.Monad.algebraFunctorOfMonadHom f ≅ CategoryTheory.Monad.algebraFunctorOfMonadHom g

full_name: CategoryTheory.Monad.algebraFunctorOfMonadHomEq_inv_app_f
code: /-- 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 `eqToIso` so that the components are nicer to prove
lemmas about.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomEq {T₁ T₂ : Monad C} {f g : T₁ ⟶ T₂} (h : f = g) :
    algebraFunctorOfMonadHom f ≅ algebraFunctorOfMonadHom g 
goal: ((CategoryTheory.Monad.algebraFunctorOfMonadHomEq h).inv.app X).f =
  (CategoryTheory.Iso.refl ((CategoryTheory.Monad.algebraFunctorOfMonadHom f).obj X).A).inv

full_name: CategoryTheory.Monad.algebraEquivOfIsoMonads_counitIso
code: /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂ 
goal: (CategoryTheory.Monad.algebraEquivOfIsoMonads h).counitIso =
  (CategoryTheory.Monad.algebraFunctorOfMonadHomComp h.inv h.hom).symm ≪≫
    CategoryTheory.Monad.algebraFunctorOfMonadHomEq ⋯ ≪≫ CategoryTheory.Monad.algebraFunctorOfMonadHomId

full_name: CategoryTheory.Monad.algebraEquivOfIsoMonads_unitIso
code: /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂ 
goal: (CategoryTheory.Monad.algebraEquivOfIsoMonads h).unitIso =
  CategoryTheory.Monad.algebraFunctorOfMonadHomId.symm ≪≫
    CategoryTheory.Monad.algebraFunctorOfMonadHomEq ⋯ ≪≫ CategoryTheory.Monad.algebraFunctorOfMonadHomComp h.hom h.inv

full_name: CategoryTheory.Monad.algebraEquivOfIsoMonads_functor
code: /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂ 
goal: (CategoryTheory.Monad.algebraEquivOfIsoMonads h).functor = CategoryTheory.Monad.algebraFunctorOfMonadHom h.inv

full_name: CategoryTheory.Monad.algebraEquivOfIsoMonads
code: /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂ 
goal: T₁.Algebra ≌ T₂.Algebra

full_name: CategoryTheory.Monad.algebraEquivOfIsoMonads_inverse
code: /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂ 
goal: (CategoryTheory.Monad.algebraEquivOfIsoMonads h).inverse = CategoryTheory.Monad.algebraFunctorOfMonadHom h.hom

full_name: CategoryTheory.Monad.algebra_equiv_of_iso_monads_comp_forget
code: @[simp]
theorem algebra_equiv_of_iso_monads_comp_forget {T₁ T₂ : Monad C} (h : T₁ ⟶ T₂) :
    algebraFunctorOfMonadHom h ⋙ forget _ = forget _ 
goal: (CategoryTheory.Monad.algebraFunctorOfMonadHom h).comp T₁.forget = T₂.forget

full_name: CategoryTheory.Comonad.Coalgebra.A
code: /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat
goal: C

full_name: CategoryTheory.Comonad.Coalgebra.coassoc
code: /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp self.a (G.δ.app self.A) = CategoryTheory.CategoryStruct.comp self.a (G.map self.a)

full_name: CategoryTheory.Comonad.Coalgebra.a
code: /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat
goal: self.A ⟶ G.obj self.A

full_name: CategoryTheory.Comonad.Coalgebra
code: /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat
goal: Type (max u₁ v₁)

full_name: CategoryTheory.Comonad.Coalgebra.counit
code: /-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp self.a (G.ε.app self.A) = CategoryTheory.CategoryStruct.id self.A

full_name: CategoryTheory.Comonad.Coalgebra.Hom
code: /-- A morphism of Eilenberg-Moore coalgebras for the comonad `G`. -/
-- Porting note(#5171): linter not ported yet
--@[ext, nolint has_nonempty_instance]
@[ext]
structure Hom (A B : Coalgebra G) where
  /-- The underlying morphism associated to a morphism of coalgebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of coalgebras. -/
  h : A.a ≫ (G : C ⥤ C).map f = f ≫ B.a := by aesop_cat
goal: Type v₁

full_name: CategoryTheory.Comonad.Coalgebra.Hom.h
code: /-- A morphism of Eilenberg-Moore coalgebras for the comonad `G`. -/
-- Porting note(#5171): linter not ported yet
--@[ext, nolint has_nonempty_instance]
@[ext]
structure Hom (A B : Coalgebra G) where
  /-- The underlying morphism associated to a morphism of coalgebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of coalgebras. -/
  h : A.a ≫ (G : C ⥤ C).map f = f ≫ B.a := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp A.a (G.map self.f) = CategoryTheory.CategoryStruct.comp self.f B.a

full_name: CategoryTheory.Comonad.Coalgebra.Hom.f
code: /-- A morphism of Eilenberg-Moore coalgebras for the comonad `G`. -/
-- Porting note(#5171): linter not ported yet
--@[ext, nolint has_nonempty_instance]
@[ext]
structure Hom (A B : Coalgebra G) where
  /-- The underlying morphism associated to a morphism of coalgebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of coalgebras. -/
  h : A.a ≫ (G : C ⥤ C).map f = f ≫ B.a := by aesop_cat
goal: A.A ⟶ B.A

full_name: CategoryTheory.Comonad.Coalgebra.Hom.id
code: /-- The identity homomorphism for an Eilenberg–Moore coalgebra. -/
def id (A : Coalgebra G) : Hom A A 
goal: A.Hom A

full_name: CategoryTheory.Comonad.Coalgebra.Hom.comp
code: /-- Composition of Eilenberg–Moore coalgebra homomorphisms. -/
def comp {P Q R : Coalgebra G} (f : Hom P Q) (g : Hom Q R) : Hom P R 
goal: P.Hom R

full_name: CategoryTheory.Comonad.Coalgebra.instCategoryStruct
code: /-- The category of Eilenberg-Moore coalgebras for a comonad. -/
instance : CategoryStruct (Coalgebra G) 
goal: CategoryTheory.CategoryStruct.{v₁, max u₁ v₁} G.Coalgebra

full_name: CategoryTheory.Comonad.Coalgebra.Hom.ext'
code: @[ext]
lemma Hom.ext' (X Y : Coalgebra G) (f g : X ⟶ Y) (h : f.f = g.f) : f = g 
goal: f = g

full_name: CategoryTheory.Comonad.Coalgebra.comp_eq_comp
code: @[simp]
theorem comp_eq_comp {A A' A'' : Coalgebra G} (f : A ⟶ A') (g : A' ⟶ A'') :
    Coalgebra.Hom.comp f g = f ≫ g 
goal: CategoryTheory.Comonad.Coalgebra.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g

full_name: CategoryTheory.Comonad.Coalgebra.id_eq_id
code: @[simp]
theorem id_eq_id (A : Coalgebra G) : Coalgebra.Hom.id A = 𝟙 A 
goal: CategoryTheory.Comonad.Coalgebra.Hom.id A = CategoryTheory.CategoryStruct.id A

full_name: CategoryTheory.Comonad.Coalgebra.id_f
code: @[simp]
theorem id_f (A : Coalgebra G) : (𝟙 A : A ⟶ A).f = 𝟙 A.A 
goal: (CategoryTheory.CategoryStruct.id A).f = CategoryTheory.CategoryStruct.id A.A

full_name: CategoryTheory.Comonad.Coalgebra.comp_f
code: @[simp]
theorem comp_f {A A' A'' : Coalgebra G} (f : A ⟶ A') (g : A' ⟶ A'') : (f ≫ g).f = f.f ≫ g.f 
goal: (CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f

full_name: CategoryTheory.Comonad.Coalgebra.eilenbergMoore
code: /-- The category of Eilenberg-Moore coalgebras for a comonad. -/
instance eilenbergMoore : Category (Coalgebra G) 
goal: CategoryTheory.Category.{v₁, max u₁ v₁} G.Coalgebra

full_name: CategoryTheory.Comonad.Coalgebra.isoMk_hom_f
code: /--
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Coalgebra G} (h : A.A ≅ B.A)
    (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a := by aesop_cat) : A ≅ B 
goal: (CategoryTheory.Comonad.Coalgebra.isoMk h w).hom.f = h.hom

full_name: CategoryTheory.Comonad.Coalgebra.isoMk_inv_f
code: /--
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Coalgebra G} (h : A.A ≅ B.A)
    (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a := by aesop_cat) : A ≅ B 
goal: (CategoryTheory.Comonad.Coalgebra.isoMk h w).inv.f = h.inv

full_name: CategoryTheory.Comonad.Coalgebra.isoMk
code: /--
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Coalgebra G} (h : A.A ≅ B.A)
    (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a := by aesop_cat) : A ≅ B 
goal: A ≅ B

full_name: CategoryTheory.Comonad.forget_map
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic
structure. -/
@[simps]
def forget : Coalgebra G ⥤ C 
goal: ∀ {X Y : G.Coalgebra} (f : X ⟶ Y), G.forget.map f = f.f

full_name: CategoryTheory.Comonad.forget
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic
structure. -/
@[simps]
def forget : Coalgebra G ⥤ C 
goal: CategoryTheory.Functor G.Coalgebra C

full_name: CategoryTheory.Comonad.forget_obj
code: /-- The forgetful functor from the Eilenberg-Moore category, forgetting the coalgebraic
structure. -/
@[simps]
def forget : Coalgebra G ⥤ C 
goal: G.forget.obj A = A.A

full_name: CategoryTheory.Comonad.cofree
code: /-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G 
goal: CategoryTheory.Functor C G.Coalgebra

full_name: CategoryTheory.Comonad.cofree_map_f
code: /-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G 
goal: ∀ {X Y : C} (f : X ⟶ Y), (G.cofree.map f).f = G.map f

full_name: CategoryTheory.Comonad.cofree_obj_A
code: /-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G 
goal: (G.cofree.obj X).A = G.obj X

full_name: CategoryTheory.Comonad.cofree_obj_a
code: /-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G 
goal: (G.cofree.obj X).a = G.δ.app X

full_name: CategoryTheory.Comonad.adj_counit
code: /-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras
for a comonad.
-/
@[simps! unit counit]
def adj : G.forget ⊣ G.cofree 
goal: G.adj.counit = { app := fun Y => G.ε.app Y, naturality := ⋯ }

full_name: CategoryTheory.Comonad.adj_unit
code: /-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras
for a comonad.
-/
@[simps! unit counit]
def adj : G.forget ⊣ G.cofree 
goal: G.adj.unit = { app := fun X => { f := X.a, h := ⋯ }, naturality := ⋯ }

full_name: CategoryTheory.Comonad.adj
code: /-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras
for a comonad.
-/
@[simps! unit counit]
def adj : G.forget ⊣ G.cofree 
goal: G.forget ⊣ G.cofree

full_name: CategoryTheory.Comonad.coalgebra_iso_of_iso
code: /-- Given a coalgebra morphism whose carrier part is an isomorphism, we get a coalgebra isomorphism.
-/
theorem coalgebra_iso_of_iso {A B : Coalgebra G} (f : A ⟶ B) [IsIso f.f] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Comonad.forget_reflects_iso
code: instance forget_reflects_iso : G.forget.ReflectsIsomorphisms 
goal: G.forget.ReflectsIsomorphisms

full_name: CategoryTheory.Comonad.forget_faithful
code: instance forget_faithful : (forget G).Faithful 
goal: G.forget.Faithful

full_name: CategoryTheory.Comonad.algebra_epi_of_epi
code: /-- Given a coalgebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism.
-/
theorem algebra_epi_of_epi {X Y : Coalgebra G} (f : X ⟶ Y) [h : Epi f.f] : Epi f 
goal: CategoryTheory.Epi f

full_name: CategoryTheory.Comonad.algebra_mono_of_mono
code: /-- Given a coalgebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism.
-/
theorem algebra_mono_of_mono {X Y : Coalgebra G} (f : X ⟶ Y) [h : Mono f.f] : Mono f 
goal: CategoryTheory.Mono f

full_name: CategoryTheory.Comonad.instIsLeftAdjointCoalgebraForget
code: instance : G.forget.IsLeftAdjoint  
goal: G.forget.IsLeftAdjoint