Documentation

Mathlib.CategoryTheory.Endofunctor.Algebra

Algebras of endofunctors #

This file defines (co)algebras of an endofunctor, and provides the category instance for them. It also defines the forgetful functor from the category of (co)algebras. It is shown that the structure map of the initial algebra of an endofunctor is an isomorphism. Furthermore, it is shown that for an adjunction F ⊣ G the category of algebras over F is equivalent to the category of coalgebras over G.

TODO #

structure CategoryTheory.Endofunctor.Algebra {C : Type u} [Category.{v, u} C] (F : Functor C C) :
Type (max u v)

An algebra of an endofunctor; str stands for "structure morphism"

  • a : C

    carrier of the algebra

  • str : F.obj self.a ⟢ self.a

    structure morphism of the algebra

Instances For
    @[implicit_reducible]
    structure CategoryTheory.Endofunctor.Algebra.Hom {C : Type u} [Category.{v, u} C] {F : Functor C C} (Aβ‚€ A₁ : Algebra F) :

    A morphism between algebras of endofunctor F

    Instances For
      theorem CategoryTheory.Endofunctor.Algebra.Hom.ext {C : Type u} {inst✝ : Category.{v, u} C} {F : Functor C C} {Aβ‚€ A₁ : Algebra F} {x y : Aβ‚€.Hom A₁} (f : x.f = y.f) :
      x = y
      theorem CategoryTheory.Endofunctor.Algebra.Hom.ext_iff {C : Type u} {inst✝ : Category.{v, u} C} {F : Functor C C} {Aβ‚€ A₁ : Algebra F} {x y : Aβ‚€.Hom A₁} :
      x = y ↔ x.f = y.f
      @[simp]
      theorem CategoryTheory.Endofunctor.Algebra.Hom.h_assoc {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ : Algebra F} (self : Aβ‚€.Hom A₁) {Z : C} (h : A₁.a ⟢ Z) :

      compatibility condition

      The identity morphism of an algebra of endofunctor F

      Instances For
        @[implicit_reducible]
        instance CategoryTheory.Endofunctor.Algebra.Hom.instInhabited {C : Type u} [Category.{v, u} C] {F : Functor C C} (A : Algebra F) :
        Inhabited (A.Hom A)
        def CategoryTheory.Endofunctor.Algebra.Hom.comp {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ Aβ‚‚ : Algebra F} (f : Aβ‚€.Hom A₁) (g : A₁.Hom Aβ‚‚) :
        Aβ‚€.Hom Aβ‚‚

        The composition of morphisms between algebras of endofunctor F

        Instances For
          theorem CategoryTheory.Endofunctor.Algebra.ext {C : Type u} [Category.{v, u} C] {F : Functor C C} {A B : Algebra F} {f g : A ⟢ B} (w : f.f = g.f := by cat_disch) :
          f = g
          theorem CategoryTheory.Endofunctor.Algebra.ext_iff {C : Type u} [Category.{v, u} C] {F : Functor C C} {A B : Algebra F} {f g : A ⟢ B} :
          f = g ↔ autoParam (f.f = g.f) ext._auto_1
          @[simp]
          theorem CategoryTheory.Endofunctor.Algebra.comp_eq_comp {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ Aβ‚‚ : Algebra F} (f : Aβ‚€ ⟢ A₁) (g : A₁ ⟢ Aβ‚‚) :
          @[simp]
          theorem CategoryTheory.Endofunctor.Algebra.comp_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ Aβ‚‚ : Algebra F} (f : Aβ‚€ ⟢ A₁) (g : A₁ ⟢ Aβ‚‚) :
          @[implicit_reducible]

          Algebras of an endofunctor F form a category

          def CategoryTheory.Endofunctor.Algebra.isoMk {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ : Algebra F} (h : Aβ‚€.a β‰… A₁.a) (w : CategoryStruct.comp (F.map h.hom) A₁.str = CategoryStruct.comp Aβ‚€.str h.hom := by cat_disch) :
          Aβ‚€ β‰… A₁

          To construct an isomorphism of algebras, it suffices to give an isomorphism of the As which commutes with the structure morphisms.

          Instances For
            @[simp]
            theorem CategoryTheory.Endofunctor.Algebra.isoMk_inv_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ : Algebra F} (h : Aβ‚€.a β‰… A₁.a) (w : CategoryStruct.comp (F.map h.hom) A₁.str = CategoryStruct.comp Aβ‚€.str h.hom := by cat_disch) :
            (isoMk h w).inv.f = h.inv
            @[simp]
            theorem CategoryTheory.Endofunctor.Algebra.isoMk_hom_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ : Algebra F} (h : Aβ‚€.a β‰… A₁.a) (w : CategoryStruct.comp (F.map h.hom) A₁.str = CategoryStruct.comp Aβ‚€.str h.hom := by cat_disch) :
            (isoMk h w).hom.f = h.hom

            The forgetful functor from the category of algebras, forgetting the algebraic structure.

            Instances For
              @[simp]
              theorem CategoryTheory.Endofunctor.Algebra.forget_map {C : Type u} [Category.{v, u} C] (F : Functor C C) {X✝ Y✝ : Algebra F} (self : X✝.Hom Y✝) :
              (forget F).map self = self.f
              theorem CategoryTheory.Endofunctor.Algebra.iso_of_iso {C : Type u} [Category.{v, u} C] {F : Functor C C} {Aβ‚€ A₁ : Algebra F} (f : Aβ‚€ ⟢ A₁) [IsIso f.f] :

              An algebra morphism with an underlying isomorphism hom in C is an algebra isomorphism.

              theorem CategoryTheory.Endofunctor.Algebra.epi_of_epi {C : Type u} [Category.{v, u} C] {F : Functor C C} {X Y : Algebra F} (f : X ⟢ Y) [h : Epi f.f] :
              Epi f

              An algebra morphism with an underlying epimorphism hom in C is an algebra epimorphism.

              theorem CategoryTheory.Endofunctor.Algebra.mono_of_mono {C : Type u} [Category.{v, u} C] {F : Functor C C} {X Y : Algebra F} (f : X ⟢ Y) [h : Mono f.f] :

              An algebra morphism with an underlying monomorphism hom in C is an algebra monomorphism.

              From a natural transformation Ξ± : G β†’ F we get a functor from algebras of F to algebras of G.

              Instances For
                @[simp]
                theorem CategoryTheory.Endofunctor.Algebra.functorOfNatTrans_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (α : G ⟢ F) {X✝ Y✝ : Algebra F} (f : X✝ ⟢ Y✝) :
                ((functorOfNatTrans Ξ±).map f).f = f.f

                The identity transformation induces the identity endofunctor on the category of algebras.

                Instances For
                  def CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) :

                  A composition of natural transformations gives the composition of corresponding functors.

                  Instances For
                    @[simp]
                    theorem CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp_hom_app_f {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) (X : Algebra Fβ‚‚) :
                    @[simp]
                    theorem CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp_inv_app_f {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) (X : Algebra Fβ‚‚) :

                    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.

                    Instances For

                      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.

                      Instances For

                        The inverse of the structure map of an initial algebra

                        Instances For

                          The structure map of the initial algebra is an isomorphism, hence endofunctors preserve their initial algebras

                          structure CategoryTheory.Endofunctor.Coalgebra {C : Type u} [Category.{v, u} C] (F : Functor C C) :
                          Type (max u v)

                          A coalgebra of an endofunctor; str stands for "structure morphism"

                          • V : C

                            carrier of the coalgebra

                          • str : self.V ⟢ F.obj self.V

                            structure morphism of the coalgebra

                          Instances For
                            @[implicit_reducible]
                            structure CategoryTheory.Endofunctor.Coalgebra.Hom {C : Type u} [Category.{v, u} C] {F : Functor C C} (Vβ‚€ V₁ : Coalgebra F) :

                            A morphism between coalgebras of an endofunctor F

                            Instances For
                              theorem CategoryTheory.Endofunctor.Coalgebra.Hom.ext {C : Type u} {inst✝ : Category.{v, u} C} {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} {x y : Vβ‚€.Hom V₁} (f : x.f = y.f) :
                              x = y
                              theorem CategoryTheory.Endofunctor.Coalgebra.Hom.ext_iff {C : Type u} {inst✝ : Category.{v, u} C} {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} {x y : Vβ‚€.Hom V₁} :
                              x = y ↔ x.f = y.f
                              @[simp]
                              theorem CategoryTheory.Endofunctor.Coalgebra.Hom.h_assoc {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} (self : Vβ‚€.Hom V₁) {Z : C} (h : F.obj V₁.V ⟢ Z) :

                              compatibility condition

                              The identity morphism of an algebra of endofunctor F

                              Instances For
                                @[implicit_reducible]
                                def CategoryTheory.Endofunctor.Coalgebra.Hom.comp {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ Vβ‚‚ : Coalgebra F} (f : Vβ‚€.Hom V₁) (g : V₁.Hom Vβ‚‚) :
                                Vβ‚€.Hom Vβ‚‚

                                The composition of morphisms between algebras of endofunctor F

                                Instances For
                                  theorem CategoryTheory.Endofunctor.Coalgebra.ext {C : Type u} [Category.{v, u} C] {F : Functor C C} {A B : Coalgebra F} {f g : A ⟢ B} (w : f.f = g.f := by cat_disch) :
                                  f = g
                                  theorem CategoryTheory.Endofunctor.Coalgebra.ext_iff {C : Type u} [Category.{v, u} C] {F : Functor C C} {A B : Coalgebra F} {f g : A ⟢ B} :
                                  f = g ↔ autoParam (f.f = g.f) ext._auto_1
                                  @[simp]
                                  theorem CategoryTheory.Endofunctor.Coalgebra.comp_eq_comp {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ Vβ‚‚ : Coalgebra F} (f : Vβ‚€ ⟢ V₁) (g : V₁ ⟢ Vβ‚‚) :
                                  @[simp]
                                  theorem CategoryTheory.Endofunctor.Coalgebra.comp_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ Vβ‚‚ : Coalgebra F} (f : Vβ‚€ ⟢ V₁) (g : V₁ ⟢ Vβ‚‚) :
                                  @[implicit_reducible]

                                  Coalgebras of an endofunctor F form a category

                                  def CategoryTheory.Endofunctor.Coalgebra.isoMk {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} (h : Vβ‚€.V β‰… V₁.V) (w : CategoryStruct.comp Vβ‚€.str (F.map h.hom) = CategoryStruct.comp h.hom V₁.str := by cat_disch) :
                                  Vβ‚€ β‰… V₁

                                  To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the Vs which commutes with the structure morphisms.

                                  Instances For
                                    @[simp]
                                    theorem CategoryTheory.Endofunctor.Coalgebra.isoMk_inv_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} (h : Vβ‚€.V β‰… V₁.V) (w : CategoryStruct.comp Vβ‚€.str (F.map h.hom) = CategoryStruct.comp h.hom V₁.str := by cat_disch) :
                                    (isoMk h w).inv.f = h.inv
                                    @[simp]
                                    theorem CategoryTheory.Endofunctor.Coalgebra.isoMk_hom_f {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} (h : Vβ‚€.V β‰… V₁.V) (w : CategoryStruct.comp Vβ‚€.str (F.map h.hom) = CategoryStruct.comp h.hom V₁.str := by cat_disch) :
                                    (isoMk h w).hom.f = h.hom

                                    The forgetful functor from the category of coalgebras, forgetting the coalgebraic structure.

                                    Instances For
                                      @[simp]
                                      theorem CategoryTheory.Endofunctor.Coalgebra.forget_map {C : Type u} [Category.{v, u} C] (F : Functor C C) {X✝ Y✝ : Coalgebra F} (f : X✝ ⟢ Y✝) :
                                      (forget F).map f = f.f
                                      theorem CategoryTheory.Endofunctor.Coalgebra.iso_of_iso {C : Type u} [Category.{v, u} C] {F : Functor C C} {Vβ‚€ V₁ : Coalgebra F} (f : Vβ‚€ ⟢ V₁) [IsIso f.f] :

                                      A coalgebra morphism with an underlying isomorphism hom in C is a coalgebra isomorphism.

                                      theorem CategoryTheory.Endofunctor.Coalgebra.epi_of_epi {C : Type u} [Category.{v, u} C] {F : Functor C C} {X Y : Coalgebra F} (f : X ⟢ Y) [h : Epi f.f] :
                                      Epi f

                                      An algebra morphism with an underlying epimorphism hom in C is an algebra epimorphism.

                                      theorem CategoryTheory.Endofunctor.Coalgebra.mono_of_mono {C : Type u} [Category.{v, u} C] {F : Functor C C} {X Y : Coalgebra F} (f : X ⟢ Y) [h : Mono f.f] :

                                      An algebra morphism with an underlying monomorphism hom in C is an algebra monomorphism.

                                      From a natural transformation Ξ± : F β†’ G we get a functor from coalgebras of F to coalgebras of G.

                                      Instances For
                                        @[simp]
                                        theorem CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (α : F ⟢ G) {X✝ Y✝ : Coalgebra F} (f : X✝ ⟢ Y✝) :
                                        ((functorOfNatTrans Ξ±).map f).f = f.f

                                        The identity transformation induces the identity endofunctor on the category of coalgebras.

                                        Instances For
                                          def CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) :

                                          A composition of natural transformations gives the composition of corresponding functors.

                                          Instances For
                                            @[simp]
                                            theorem CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp_hom_app_f {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) (X : Coalgebra Fβ‚€) :
                                            @[simp]
                                            theorem CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp_inv_app_f {C : Type u} [Category.{v, u} C] {Fβ‚€ F₁ Fβ‚‚ : Functor C C} (Ξ± : Fβ‚€ ⟢ F₁) (Ξ² : F₁ ⟢ Fβ‚‚) (X : Coalgebra Fβ‚€) :

                                            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.

                                            Instances For

                                              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.

                                              Instances For

                                                The inverse of the structure map of a terminal coalgebra

                                                Instances For

                                                  The structure map of the terminal coalgebra is an isomorphism, hence endofunctors preserve their terminal coalgebras

                                                  theorem CategoryTheory.Endofunctor.Adjunction.Algebra.homEquiv_naturality_str {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) (A₁ Aβ‚‚ : Algebra F) (f : A₁ ⟢ Aβ‚‚) :
                                                  CategoryStruct.comp ((adj.homEquiv A₁.a A₁.a) A₁.str) (G.map f.f) = CategoryStruct.comp f.f ((adj.homEquiv Aβ‚‚.a Aβ‚‚.a) Aβ‚‚.str)
                                                  theorem CategoryTheory.Endofunctor.Adjunction.Coalgebra.homEquiv_naturality_str_symm {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) (V₁ Vβ‚‚ : Coalgebra G) (f : V₁ ⟢ Vβ‚‚) :
                                                  CategoryStruct.comp (F.map f.f) ((adj.homEquiv Vβ‚‚.V Vβ‚‚.V).symm Vβ‚‚.str) = CategoryStruct.comp ((adj.homEquiv V₁.V V₁.V).symm V₁.str) f.f

                                                  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.

                                                  Instances For
                                                    @[simp]
                                                    theorem CategoryTheory.Endofunctor.Adjunction.Algebra.toCoalgebraOf_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) {X✝ Y✝ : Algebra F} (f : X✝ ⟢ Y✝) :
                                                    ((toCoalgebraOf adj).map f).f = f.f

                                                    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.

                                                    Instances For
                                                      @[simp]
                                                      theorem CategoryTheory.Endofunctor.Adjunction.Coalgebra.toAlgebraOf_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) {X✝ Y✝ : Coalgebra G} (f : X✝ ⟢ Y✝) :
                                                      ((toAlgebraOf adj).map f).f = f.f

                                                      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.

                                                      Instances For

                                                        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.

                                                        Instances For

                                                          If F is left adjoint to G, then the category of algebras over F is equivalent to the category of coalgebras over G.

                                                          Instances For
                                                            @[simp]
                                                            theorem CategoryTheory.Endofunctor.Adjunction.algebraCoalgebraEquiv_functor_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) {X✝ Y✝ : Algebra F} (f : X✝ ⟢ Y✝) :
                                                            @[simp]
                                                            theorem CategoryTheory.Endofunctor.Adjunction.algebraCoalgebraEquiv_inverse_map_f {C : Type u} [Category.{v, u} C] {F G : Functor C C} (adj : F ⊣ G) {X✝ Y✝ : Coalgebra G} (f : X✝ ⟢ Y✝) :