File: Mathlib/CategoryTheory/Endofunctor/Algebra.lean

full_name: CategoryTheory.Endofunctor.Algebra.str
code: /-- An algebra of an endofunctor; `str` stands for "structure morphism" -/
structure Algebra (F : C ⥤ C) where
  /-- carrier of the algebra -/
  a : C
  /-- structure morphism of the algebra -/
  str : F.obj a ⟶ a
goal: F.obj self.a ⟶ self.a

full_name: CategoryTheory.Endofunctor.Algebra
code: /-- An algebra of an endofunctor; `str` stands for "structure morphism" -/
structure Algebra (F : C ⥤ C) where
  /-- carrier of the algebra -/
  a : C
  /-- structure morphism of the algebra -/
  str : F.obj a ⟶ a
goal: Type (max u v)

full_name: CategoryTheory.Endofunctor.Algebra.a
code: /-- An algebra of an endofunctor; `str` stands for "structure morphism" -/
structure Algebra (F : C ⥤ C) where
  /-- carrier of the algebra -/
  a : C
  /-- structure morphism of the algebra -/
  str : F.obj a ⟶ a
goal: C

full_name: CategoryTheory.Endofunctor.instInhabitedAlgebraId
code: instance [Inhabited C] : Inhabited (Algebra (𝟭 C)) 
goal: Inhabited (CategoryTheory.Endofunctor.Algebra (CategoryTheory.Functor.id C))

full_name: CategoryTheory.Endofunctor.Algebra.Hom.h
code: /-- A morphism between algebras of endofunctor `F` -/
@[ext]
structure Hom (A₀ A₁ : Algebra F) where
  /-- underlying morphism between the carriers -/
  f : A₀.1 ⟶ A₁.1
  /-- compatibility condition -/
  h : F.map f ≫ A₁.str = A₀.str ≫ f := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp (F.map self.f) A₁.str = CategoryTheory.CategoryStruct.comp A₀.str self.f

full_name: CategoryTheory.Endofunctor.Algebra.Hom.f
code: /-- A morphism between algebras of endofunctor `F` -/
@[ext]
structure Hom (A₀ A₁ : Algebra F) where
  /-- underlying morphism between the carriers -/
  f : A₀.1 ⟶ A₁.1
  /-- compatibility condition -/
  h : F.map f ≫ A₁.str = A₀.str ≫ f := by aesop_cat
goal: A₀.a ⟶ A₁.a

full_name: CategoryTheory.Endofunctor.Algebra.Hom
code: /-- A morphism between algebras of endofunctor `F` -/
@[ext]
structure Hom (A₀ A₁ : Algebra F) where
  /-- underlying morphism between the carriers -/
  f : A₀.1 ⟶ A₁.1
  /-- compatibility condition -/
  h : F.map f ≫ A₁.str = A₀.str ≫ f := by aesop_cat
goal: Type v

full_name: CategoryTheory.Endofunctor.Algebra.Hom.id
code: /-- The identity morphism of an algebra of endofunctor `F` -/
def id : Hom A A 
goal: A.Hom A

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

full_name: CategoryTheory.Endofunctor.Algebra.Hom.comp
code: /-- The composition of morphisms between algebras of endofunctor `F` -/
def comp (f : Hom A₀ A₁) (g : Hom A₁ A₂) : Hom A₀ A₂ 
goal: A₀.Hom A₂

full_name: CategoryTheory.Endofunctor.Algebra.instCategoryStruct
code: instance (F : C ⥤ C) : CategoryStruct (Algebra F) 
goal: CategoryTheory.CategoryStruct.{v, max u v} (CategoryTheory.Endofunctor.Algebra F)

full_name: CategoryTheory.Endofunctor.Algebra.ext
code: @[ext]
lemma ext {A B : Algebra F} {f g : A ⟶ B} (w : f.f = g.f := by aesop_cat) : f = g 
goal: f = g

full_name: CategoryTheory.Endofunctor.Algebra.id_eq_id
code: @[simp]
theorem id_eq_id : Algebra.Hom.id A = 𝟙 A 
goal: CategoryTheory.Endofunctor.Algebra.Hom.id A = CategoryTheory.CategoryStruct.id A

full_name: CategoryTheory.Endofunctor.Algebra.id_f
code: @[simp]
theorem id_f : (𝟙 _ : A ⟶ A).1 = 𝟙 A.1 
goal: (CategoryTheory.CategoryStruct.id A).f = CategoryTheory.CategoryStruct.id A.a

full_name: CategoryTheory.Endofunctor.Algebra.comp_eq_comp
code: @[simp]
theorem comp_eq_comp : Algebra.Hom.comp f g = f ≫ g 
goal: CategoryTheory.Endofunctor.Algebra.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g

full_name: CategoryTheory.Endofunctor.Algebra.comp_f
code: @[simp]
theorem comp_f : (f ≫ g).1 = f.1 ≫ g.1 
goal: (CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f

full_name: CategoryTheory.Endofunctor.Algebra.instCategory
code: /-- Algebras of an endofunctor `F` form a category -/
instance (F : C ⥤ C) : Category (Algebra F) 
goal: CategoryTheory.Category.{v, max u v} (CategoryTheory.Endofunctor.Algebra F)

full_name: CategoryTheory.Endofunctor.Algebra.isoMk_inv_f
code: /-- To construct an isomorphism of algebras, it suffices to give an isomorphism of the As which
commutes with the structure morphisms.
-/
@[simps!]
def isoMk (h : A₀.1 ≅ A₁.1) (w : F.map h.hom ≫ A₁.str = A₀.str ≫ h.hom := by aesop_cat) :
    A₀ ≅ A₁ 
goal: (CategoryTheory.Endofunctor.Algebra.isoMk h w).inv.f = h.inv

full_name: CategoryTheory.Endofunctor.Algebra.isoMk
code: /-- To construct an isomorphism of algebras, it suffices to give an isomorphism of the As which
commutes with the structure morphisms.
-/
@[simps!]
def isoMk (h : A₀.1 ≅ A₁.1) (w : F.map h.hom ≫ A₁.str = A₀.str ≫ h.hom := by aesop_cat) :
    A₀ ≅ A₁ 
goal: A₀ ≅ A₁

full_name: CategoryTheory.Endofunctor.Algebra.isoMk_hom_f
code: /-- To construct an isomorphism of algebras, it suffices to give an isomorphism of the As which
commutes with the structure morphisms.
-/
@[simps!]
def isoMk (h : A₀.1 ≅ A₁.1) (w : F.map h.hom ≫ A₁.str = A₀.str ≫ h.hom := by aesop_cat) :
    A₀ ≅ A₁ 
goal: (CategoryTheory.Endofunctor.Algebra.isoMk h w).hom.f = h.hom

full_name: CategoryTheory.Endofunctor.Algebra.forget
code: /-- The forgetful functor from the category of algebras, forgetting the algebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Algebra F ⥤ C 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Algebra F) C

full_name: CategoryTheory.Endofunctor.Algebra.forget_map
code: /-- The forgetful functor from the category of algebras, forgetting the algebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Algebra F ⥤ C 
goal: ∀ {X Y : CategoryTheory.Endofunctor.Algebra F} (self : X.Hom Y),
  (CategoryTheory.Endofunctor.Algebra.forget F).map self = self.f

full_name: CategoryTheory.Endofunctor.Algebra.forget_obj
code: /-- The forgetful functor from the category of algebras, forgetting the algebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Algebra F ⥤ C 
goal: (CategoryTheory.Endofunctor.Algebra.forget F).obj A = A.a

full_name: CategoryTheory.Endofunctor.Algebra.iso_of_iso
code: /-- An algebra morphism with an underlying isomorphism hom in `C` is an algebra isomorphism. -/
theorem iso_of_iso (f : A₀ ⟶ A₁) [IsIso f.1] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Endofunctor.Algebra.forget_reflects_iso
code: instance forget_reflects_iso : (forget F).ReflectsIsomorphisms 
goal: (CategoryTheory.Endofunctor.Algebra.forget F).ReflectsIsomorphisms

full_name: CategoryTheory.Endofunctor.Algebra.forget_faithful
code: instance forget_faithful : (forget F).Faithful 
goal: (CategoryTheory.Endofunctor.Algebra.forget F).Faithful

full_name: CategoryTheory.Endofunctor.Algebra.epi_of_epi
code: /-- An algebra morphism with an underlying epimorphism hom in `C` is an algebra epimorphism. -/
theorem epi_of_epi {X Y : Algebra F} (f : X ⟶ Y) [h : Epi f.1] : Epi f 
goal: CategoryTheory.Epi f

full_name: CategoryTheory.Endofunctor.Algebra.mono_of_mono
code: /-- An algebra morphism with an underlying monomorphism hom in `C` is an algebra monomorphism. -/
theorem mono_of_mono {X Y : Algebra F} (f : X ⟶ Y) [h : Mono f.1] : Mono f 
goal: CategoryTheory.Mono f

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans_obj_a
code: /-- From a natural transformation `α : G → F` we get a functor from
algebras of `F` to algebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α).obj A).a = A.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans
code: /-- From a natural transformation `α : G → F` we get a functor from
algebras of `F` to algebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Algebra F) (CategoryTheory.Endofunctor.Algebra G)

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans_obj_str
code: /-- From a natural transformation `α : G → F` we get a functor from
algebras of `F` to algebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α).obj A).str =
  CategoryTheory.CategoryStruct.comp (α.app A.a) A.str

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans_map_f
code: /-- From a natural transformation `α : G → F` we get a functor from
algebras of `F` to algebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G 
goal: ∀ {X Y : CategoryTheory.Endofunctor.Algebra F} (f : X ⟶ Y),
  ((CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α).map f).f = f.f

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransId_hom_app_f
code: /-- The identity transformation induces the identity endofunctor on the category of algebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: (CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.hom.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransId
code: /-- The identity transformation induces the identity endofunctor on the category of algebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans (CategoryTheory.CategoryStruct.id F) ≅
  CategoryTheory.Functor.id (CategoryTheory.Endofunctor.Algebra F)

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransId_inv_app_f
code: /-- The identity transformation induces the identity endofunctor on the category of algebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: (CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.inv.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp_hom_app_f
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans β ⋙ functorOfNatTrans α 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α β).hom.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp_inv_app_f
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans β ⋙ functorOfNatTrans α 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α β).inv.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans β ⋙ functorOfNatTrans α 
goal: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans (CategoryTheory.CategoryStruct.comp α β) ≅
  (CategoryTheory.Endofunctor.Algebra.functorOfNatTrans β).comp (CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α)

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq_hom_app_f
code: /--
If `α` and `β` are two equal natural transformations, 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq h).hom.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq
code: /--
If `α` and `β` are two equal natural transformations, 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α ≅ CategoryTheory.Endofunctor.Algebra.functorOfNatTrans β

full_name: CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq_inv_app_f
code: /--
If `α` and `β` are two equal natural transformations, 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq h).inv.app X).f = CategoryTheory.CategoryStruct.id X.a

full_name: CategoryTheory.Endofunctor.Algebra.equivOfNatIso_functor
code: /-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G 
goal: (CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).functor =
  CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α.inv

full_name: CategoryTheory.Endofunctor.Algebra.equivOfNatIso_counitIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G 
goal: (CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).counitIso =
  (CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α.inv α.hom).symm ≪≫
    CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq ⋯ ≪≫ CategoryTheory.Endofunctor.Algebra.functorOfNatTransId

full_name: CategoryTheory.Endofunctor.Algebra.equivOfNatIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G 
goal: CategoryTheory.Endofunctor.Algebra F ≌ CategoryTheory.Endofunctor.Algebra G

full_name: CategoryTheory.Endofunctor.Algebra.equivOfNatIso_unitIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G 
goal: (CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).unitIso =
  CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.symm ≪≫
    CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq ⋯ ≪≫
      CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α.hom α.inv

full_name: CategoryTheory.Endofunctor.Algebra.equivOfNatIso_inverse
code: /-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G 
goal: (CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).inverse =
  CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α.hom

full_name: CategoryTheory.Endofunctor.Algebra.Initial.strInv
code: /-- The inverse of the structure map of an initial algebra -/
@[simp]
def strInv : A.1 ⟶ F.obj A.1 
goal: A.a ⟶ F.obj A.a

full_name: CategoryTheory.Endofunctor.Algebra.Initial.left_inv'
code: theorem left_inv' :
    ⟨strInv h ≫ A.str, by rw [← Category.assoc, F.map_comp, strInv, ← Hom.h]⟩ = 𝟙 A 
goal: { f := CategoryTheory.CategoryStruct.comp (CategoryTheory.Endofunctor.Algebra.Initial.strInv h) A.str, h := ⋯ } =
  CategoryTheory.CategoryStruct.id A

full_name: CategoryTheory.Endofunctor.Algebra.Initial.left_inv
code: theorem left_inv : strInv h ≫ A.str = 𝟙 _ 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.Endofunctor.Algebra.Initial.strInv h) A.str =
  CategoryTheory.CategoryStruct.id A.a

full_name: CategoryTheory.Endofunctor.Algebra.Initial.right_inv
code: theorem right_inv : A.str ≫ strInv h = 𝟙 _ 
goal: CategoryTheory.CategoryStruct.comp A.str (CategoryTheory.Endofunctor.Algebra.Initial.strInv h) =
  CategoryTheory.CategoryStruct.id (F.obj A.a)

full_name: CategoryTheory.Endofunctor.Algebra.Initial.str_isIso
code: /-- The structure map of the initial algebra is an isomorphism,
hence endofunctors preserve their initial algebras
-/
theorem str_isIso (h : Limits.IsInitial A) : IsIso A.str 
goal: CategoryTheory.IsIso A.str

full_name: CategoryTheory.Endofunctor.Coalgebra.str
code: /-- A coalgebra of an endofunctor; `str` stands for "structure morphism" -/
structure Coalgebra (F : C ⥤ C) where
  /-- carrier of the coalgebra -/
  V : C
  /-- structure morphism of the coalgebra -/
  str : V ⟶ F.obj V
goal: self.V ⟶ F.obj self.V

full_name: CategoryTheory.Endofunctor.Coalgebra
code: /-- A coalgebra of an endofunctor; `str` stands for "structure morphism" -/
structure Coalgebra (F : C ⥤ C) where
  /-- carrier of the coalgebra -/
  V : C
  /-- structure morphism of the coalgebra -/
  str : V ⟶ F.obj V
goal: Type (max u v)

full_name: CategoryTheory.Endofunctor.Coalgebra.V
code: /-- A coalgebra of an endofunctor; `str` stands for "structure morphism" -/
structure Coalgebra (F : C ⥤ C) where
  /-- carrier of the coalgebra -/
  V : C
  /-- structure morphism of the coalgebra -/
  str : V ⟶ F.obj V
goal: C

full_name: CategoryTheory.Endofunctor.instInhabitedCoalgebraId
code: instance [Inhabited C] : Inhabited (Coalgebra (𝟭 C)) 
goal: Inhabited (CategoryTheory.Endofunctor.Coalgebra (CategoryTheory.Functor.id C))

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom.h
code: /-- A morphism between coalgebras of an endofunctor `F` -/
@[ext]
structure Hom (V₀ V₁ : Coalgebra F) where
  /-- underlying morphism between two carriers -/
  f : V₀.1 ⟶ V₁.1
  /-- compatibility condition -/
  h : V₀.str ≫ F.map f = f ≫ V₁.str := by aesop_cat
goal: CategoryTheory.CategoryStruct.comp V₀.str (F.map self.f) = CategoryTheory.CategoryStruct.comp self.f V₁.str

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom
code: /-- A morphism between coalgebras of an endofunctor `F` -/
@[ext]
structure Hom (V₀ V₁ : Coalgebra F) where
  /-- underlying morphism between two carriers -/
  f : V₀.1 ⟶ V₁.1
  /-- compatibility condition -/
  h : V₀.str ≫ F.map f = f ≫ V₁.str := by aesop_cat
goal: Type v

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom.f
code: /-- A morphism between coalgebras of an endofunctor `F` -/
@[ext]
structure Hom (V₀ V₁ : Coalgebra F) where
  /-- underlying morphism between two carriers -/
  f : V₀.1 ⟶ V₁.1
  /-- compatibility condition -/
  h : V₀.str ≫ F.map f = f ≫ V₁.str := by aesop_cat
goal: V₀.V ⟶ V₁.V

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom.id
code: /-- The identity morphism of an algebra of endofunctor `F` -/
def id : Hom V V 
goal: V.Hom V

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom.instInhabited
code: instance : Inhabited (Hom V V) 
goal: Inhabited (V.Hom V)

full_name: CategoryTheory.Endofunctor.Coalgebra.Hom.comp
code: /-- The composition of morphisms between algebras of endofunctor `F` -/
def comp (f : Hom V₀ V₁) (g : Hom V₁ V₂) : Hom V₀ V₂ 
goal: V₀.Hom V₂

full_name: CategoryTheory.Endofunctor.Coalgebra.instCategoryStruct
code: instance (F : C ⥤ C) : CategoryStruct (Coalgebra F) 
goal: CategoryTheory.CategoryStruct.{v, max u v} (CategoryTheory.Endofunctor.Coalgebra F)

full_name: CategoryTheory.Endofunctor.Coalgebra.ext
code: @[ext]
lemma ext {A B : Coalgebra F} {f g : A ⟶ B} (w : f.f = g.f := by aesop_cat) : f = g 
goal: f = g

full_name: CategoryTheory.Endofunctor.Coalgebra.id_eq_id
code: @[simp]
theorem id_eq_id : Coalgebra.Hom.id V = 𝟙 V 
goal: CategoryTheory.Endofunctor.Coalgebra.Hom.id V = CategoryTheory.CategoryStruct.id V

full_name: CategoryTheory.Endofunctor.Coalgebra.id_f
code: @[simp]
theorem id_f : (𝟙 _ : V ⟶ V).1 = 𝟙 V.1 
goal: (CategoryTheory.CategoryStruct.id V).f = CategoryTheory.CategoryStruct.id V.V

full_name: CategoryTheory.Endofunctor.Coalgebra.comp_eq_comp
code: @[simp]
theorem comp_eq_comp : Coalgebra.Hom.comp f g = f ≫ g 
goal: CategoryTheory.Endofunctor.Coalgebra.Hom.comp f g = CategoryTheory.CategoryStruct.comp f g

full_name: CategoryTheory.Endofunctor.Coalgebra.comp_f
code: @[simp]
theorem comp_f : (f ≫ g).1 = f.1 ≫ g.1 
goal: (CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f

full_name: CategoryTheory.Endofunctor.Coalgebra.instCategory
code: /-- Coalgebras of an endofunctor `F` form a category -/
instance (F : C ⥤ C) : Category (Coalgebra F) 
goal: CategoryTheory.Category.{v, max u v} (CategoryTheory.Endofunctor.Coalgebra F)

full_name: CategoryTheory.Endofunctor.Coalgebra.isoMk
code: /-- To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the Vs which
commutes with the structure morphisms.
-/
@[simps]
def isoMk (h : V₀.1 ≅ V₁.1) (w : V₀.str ≫ F.map h.hom = h.hom ≫ V₁.str := by aesop_cat) :
    V₀ ≅ V₁ 
goal: V₀ ≅ V₁

full_name: CategoryTheory.Endofunctor.Coalgebra.isoMk_hom_f
code: /-- To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the Vs which
commutes with the structure morphisms.
-/
@[simps]
def isoMk (h : V₀.1 ≅ V₁.1) (w : V₀.str ≫ F.map h.hom = h.hom ≫ V₁.str := by aesop_cat) :
    V₀ ≅ V₁ 
goal: (CategoryTheory.Endofunctor.Coalgebra.isoMk h w).hom.f = h.hom

full_name: CategoryTheory.Endofunctor.Coalgebra.isoMk_inv_f
code: /-- To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the Vs which
commutes with the structure morphisms.
-/
@[simps]
def isoMk (h : V₀.1 ≅ V₁.1) (w : V₀.str ≫ F.map h.hom = h.hom ≫ V₁.str := by aesop_cat) :
    V₀ ≅ V₁ 
goal: (CategoryTheory.Endofunctor.Coalgebra.isoMk h w).inv.f = h.inv

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

full_name: CategoryTheory.Endofunctor.Coalgebra.forget_obj
code: /-- The forgetful functor from the category of coalgebras, forgetting the coalgebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Coalgebra F ⥤ C 
goal: (CategoryTheory.Endofunctor.Coalgebra.forget F).obj A = A.V

full_name: CategoryTheory.Endofunctor.Coalgebra.forget
code: /-- The forgetful functor from the category of coalgebras, forgetting the coalgebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Coalgebra F ⥤ C 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Coalgebra F) C

full_name: CategoryTheory.Endofunctor.Coalgebra.iso_of_iso
code: /-- A coalgebra morphism with an underlying isomorphism hom in `C` is a coalgebra isomorphism. -/
theorem iso_of_iso (f : V₀ ⟶ V₁) [IsIso f.1] : IsIso f 
goal: CategoryTheory.IsIso f

full_name: CategoryTheory.Endofunctor.Coalgebra.forget_reflects_iso
code: instance forget_reflects_iso : (forget F).ReflectsIsomorphisms 
goal: (CategoryTheory.Endofunctor.Coalgebra.forget F).ReflectsIsomorphisms

full_name: CategoryTheory.Endofunctor.Coalgebra.forget_faithful
code: instance forget_faithful : (forget F).Faithful 
goal: (CategoryTheory.Endofunctor.Coalgebra.forget F).Faithful

full_name: CategoryTheory.Endofunctor.Coalgebra.epi_of_epi
code: /-- An algebra morphism with an underlying epimorphism hom in `C` is an algebra epimorphism. -/
theorem epi_of_epi {X Y : Coalgebra F} (f : X ⟶ Y) [h : Epi f.1] : Epi f 
goal: CategoryTheory.Epi f

full_name: CategoryTheory.Endofunctor.Coalgebra.mono_of_mono
code: /-- An algebra morphism with an underlying monomorphism hom in `C` is an algebra monomorphism. -/
theorem mono_of_mono {X Y : Coalgebra F} (f : X ⟶ Y) [h : Mono f.1] : Mono f 
goal: CategoryTheory.Mono f

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans_obj_V
code: /-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).obj V).V = V.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans
code: /-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Coalgebra F) (CategoryTheory.Endofunctor.Coalgebra G)

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans_map_f
code: /-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G 
goal: ∀ {X Y : CategoryTheory.Endofunctor.Coalgebra F} (f : X ⟶ Y),
  ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).map f).f = f.f

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans_obj_str
code: /-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).obj V).str =
  CategoryTheory.CategoryStruct.comp V.str (α.app V.V)

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId_inv_app_f
code: /-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: (CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId.inv.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId
code: /-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans (CategoryTheory.CategoryStruct.id F) ≅
  CategoryTheory.Functor.id (CategoryTheory.Endofunctor.Coalgebra F)

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId_hom_app_f
code: /-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ 
goal: (CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId.hom.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp_inv_app_f
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α β).inv.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β 
goal: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans (CategoryTheory.CategoryStruct.comp α β) ≅
  (CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).comp
    (CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans β)

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp_hom_app_f
code: /-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α β).hom.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq_inv_app_f
code: /-- If `α` and `β` are two equal natural transformations, then the functors of coalgebras 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq h).inv.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq
code: /-- If `α` and `β` are two equal natural transformations, then the functors of coalgebras 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α ≅ CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans β

full_name: CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq_hom_app_f
code: /-- If `α` and `β` are two equal natural transformations, then the functors of coalgebras 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.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β 
goal: ((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq h).hom.app X).f = CategoryTheory.CategoryStruct.id X.V

full_name: CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G 
goal: CategoryTheory.Endofunctor.Coalgebra F ≌ CategoryTheory.Endofunctor.Coalgebra G

full_name: CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso_counitIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G 
goal: (CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso α).counitIso =
  (CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α.inv α.hom).symm ≪≫
    CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq ⋯ ≪≫
      CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId

full_name: CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso_functor
code: /-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G 
goal: (CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso α).functor =
  CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α.hom

full_name: CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso_inverse
code: /-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G 
goal: (CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso α).inverse =
  CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α.inv

full_name: CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso_unitIso
code: /-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G 
goal: (CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso α).unitIso =
  CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId.symm ≪≫
    CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransEq ⋯ ≪≫
      CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α.hom α.inv

full_name: CategoryTheory.Endofunctor.Adjunction.Algebra.homEquiv_naturality_str
code: theorem Algebra.homEquiv_naturality_str (adj : F ⊣ G) (A₁ A₂ : Algebra F) (f : A₁ ⟶ A₂) :
    (adj.homEquiv A₁.a A₁.a) A₁.str ≫ G.map f.f = f.f ≫ (adj.homEquiv A₂.a A₂.a) A₂.str 
goal: CategoryTheory.CategoryStruct.comp ((adj.homEquiv A₁.a A₁.a) A₁.str) (G.map f.f) =
  CategoryTheory.CategoryStruct.comp f.f ((adj.homEquiv A₂.a A₂.a) A₂.str)

full_name: CategoryTheory.Endofunctor.Adjunction.Coalgebra.homEquiv_naturality_str_symm
code: theorem Coalgebra.homEquiv_naturality_str_symm (adj : F ⊣ G) (V₁ V₂ : Coalgebra G) (f : V₁ ⟶ V₂) :
    F.map f.f ≫ (adj.homEquiv V₂.V V₂.V).symm V₂.str =
    (adj.homEquiv V₁.V V₁.V).symm V₁.str ≫ f.f 
goal: CategoryTheory.CategoryStruct.comp (F.map f.f) ((adj.homEquiv V₂.V V₂.V).symm V₂.str) =
  CategoryTheory.CategoryStruct.comp ((adj.homEquiv V₁.V V₁.V).symm V₁.str) f.f

full_name: CategoryTheory.Endofunctor.Adjunction.Algebra.toCoalgebraOf
code: /-- Given an adjunction `F ⊣ G`, the functor that associates to an algebra over `F` a
coalgebra over `G` defined via adjunction applied to the structure map. -/
def Algebra.toCoalgebraOf (adj : F ⊣ G) : Algebra F ⥤ Coalgebra G 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Algebra F) (CategoryTheory.Endofunctor.Coalgebra G)

full_name: CategoryTheory.Endofunctor.Adjunction.Coalgebra.toAlgebraOf
code: /-- Given an adjunction `F ⊣ G`, the functor that associates to a coalgebra over `G` an algebra over
`F` defined via adjunction applied to the structure map. -/
def Coalgebra.toAlgebraOf (adj : F ⊣ G) : Coalgebra G ⥤ Algebra F 
goal: CategoryTheory.Functor (CategoryTheory.Endofunctor.Coalgebra G) (CategoryTheory.Endofunctor.Algebra F)

full_name: CategoryTheory.Endofunctor.Adjunction.AlgCoalgEquiv.unitIso
code: /-- Given an adjunction, assigning to an algebra over the left adjoint a coalgebra over its right
adjoint and going back is isomorphic to the identity functor. -/
def AlgCoalgEquiv.unitIso (adj : F ⊣ G) :
    𝟭 (Algebra F) ≅ Algebra.toCoalgebraOf adj ⋙ Coalgebra.toAlgebraOf adj 
goal: CategoryTheory.Functor.id (CategoryTheory.Endofunctor.Algebra F) ≅
  (CategoryTheory.Endofunctor.Adjunction.Algebra.toCoalgebraOf adj).comp
    (CategoryTheory.Endofunctor.Adjunction.Coalgebra.toAlgebraOf adj)

full_name: CategoryTheory.Endofunctor.Adjunction.AlgCoalgEquiv.counitIso
code: /-- Given an adjunction, assigning to a coalgebra over the right adjoint an algebra over the left
adjoint and going back is isomorphic to the identity functor. -/
def AlgCoalgEquiv.counitIso (adj : F ⊣ G) :
    Coalgebra.toAlgebraOf adj ⋙ Algebra.toCoalgebraOf adj ≅ 𝟭 (Coalgebra G) 
goal: (CategoryTheory.Endofunctor.Adjunction.Coalgebra.toAlgebraOf adj).comp
    (CategoryTheory.Endofunctor.Adjunction.Algebra.toCoalgebraOf adj) ≅
  CategoryTheory.Functor.id (CategoryTheory.Endofunctor.Coalgebra G)

full_name: CategoryTheory.Endofunctor.Adjunction.algebraCoalgebraEquiv
code: /-- If `F` is left adjoint to `G`, then the category of algebras over `F` is equivalent to the
category of coalgebras over `G`. -/
def algebraCoalgebraEquiv (adj : F ⊣ G) : Algebra F ≌ Coalgebra G 
goal: CategoryTheory.Endofunctor.Algebra F ≌ CategoryTheory.Endofunctor.Coalgebra G