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
    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) :

      The identity morphism of an algebra of endofunctor F

      Equations
        Instances For
          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

          Equations
            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) _auto✝
              @[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₂) :

              Algebras of an endofunctor F form a category

              Equations
                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.

                Equations
                  Instances For
                    @[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
                    @[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

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

                    Equations
                      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.

                        Equations
                          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✝) :

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

                            Equations
                              Instances For

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

                                Equations
                                  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.

                                    Equations
                                      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 hforget = forget.

                                        Equations
                                          Instances For

                                            The inverse of the structure map of an initial algebra

                                            Equations
                                              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
                                                  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) :

                                                    The identity morphism of an algebra of endofunctor F

                                                    Equations
                                                      Instances For
                                                        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

                                                        Equations
                                                          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) _auto✝
                                                            @[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₂) :

                                                            Coalgebras of an endofunctor F form a category

                                                            Equations
                                                              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.

                                                              Equations
                                                                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.

                                                                  Equations
                                                                    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.

                                                                      Equations
                                                                        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✝) :

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

                                                                          Equations
                                                                            Instances For

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

                                                                              Equations
                                                                                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.

                                                                                  Equations
                                                                                    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 hforget = forget.

                                                                                      Equations
                                                                                        Instances For

                                                                                          The inverse of the structure map of an terminal coalgebra

                                                                                          Equations
                                                                                            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.

                                                                                              Equations
                                                                                                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
                                                                                                  @[simp]

                                                                                                  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.

                                                                                                  Equations
                                                                                                    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.

                                                                                                      Equations
                                                                                                        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.

                                                                                                          Equations
                                                                                                            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.

                                                                                                              Equations
                                                                                                                Instances For
                                                                                                                  @[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✝) :
                                                                                                                  @[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✝) :