Documentation

Mathlib.CategoryTheory.Monad.Adjunction

Adjunctions and (co)monads #

We develop the basic relationship between adjunctions and (co)monads.

Given an adjunction h : LR, we have h.toMonad : Monad C and h.toComonad : Comonad D. We then have Monad.comparison (h : L ⊣ R) : D ⥤ h.toMonad.algebra sending Y : D to the Eilenberg-Moore algebra for LR with underlying object R.obj X, and dually Comonad.comparison.

We say R : D ⥤ C is MonadicRightAdjoint, if it is a right adjoint and its Monad.comparison is an equivalence of categories. (Similarly for ComonadicLeftAdjoint.)

Finally we prove that reflective functors are MonadicRightAdjoint and coreflective functors are ComonadicLeftAdjoint.

def CategoryTheory.Adjunction.toMonad {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :

For a pair of functors L : C ⥤ D, R : D ⥤ C, an adjunction h : LR induces a monad on the category C.

Equations
Instances For
    @[simp]
    theorem CategoryTheory.Adjunction.toMonad_coe {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
    h.toMonad.toFunctor = L.comp R
    @[simp]
    theorem CategoryTheory.Adjunction.toMonad_μ {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
    h.toMonad = whiskerRight (whiskerLeft L h.counit) R
    @[simp]
    theorem CategoryTheory.Adjunction.toMonad_η {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
    h.toMonad = h.unit
    def CategoryTheory.Adjunction.toComonad {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :

    For a pair of functors L : C ⥤ D, R : D ⥤ C, an adjunction h : LR induces a comonad on the category D.

    Equations
    Instances For
      @[simp]
      theorem CategoryTheory.Adjunction.toComonad_coe {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
      h.toComonad.toFunctor = R.comp L
      @[simp]
      theorem CategoryTheory.Adjunction.toComonad_ε {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
      h.toComonad = h.counit
      @[simp]
      theorem CategoryTheory.Adjunction.toComonad_δ {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
      h.toComonad = whiskerRight (whiskerLeft R h.unit) L
      def CategoryTheory.Adjunction.adjToMonadIso {C : Type u₁} [Category.{v₁, u₁} C] (T : Monad C) :
      T.adj.toMonad T

      The monad induced by the Eilenberg-Moore adjunction is the original monad.

      Equations
      Instances For

        The comonad induced by the Eilenberg-Moore adjunction is the original comonad.

        Equations
        Instances For
          def CategoryTheory.Adjunction.unitAsIsoOfIso {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (i : L.comp R Functor.id C) :
          Functor.id C L.comp R

          Given an adjunction LR, if LR is abstractly isomorphic to the identity functor, then the unit is an isomorphism.

          Equations
          Instances For
            theorem CategoryTheory.Adjunction.isIso_unit_of_iso {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (i : L.comp R Functor.id C) :
            IsIso adj.unit
            noncomputable def CategoryTheory.Adjunction.fullyFaithfulLOfCompIsoId {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (i : L.comp R Functor.id C) :
            L.FullyFaithful

            Given an adjunction LR, if LR is isomorphic to the identity functor, then L is fully faithful.

            Equations
            • adj.fullyFaithfulLOfCompIsoId i = adj.fullyFaithfulLOfIsIsoUnit
            Instances For
              def CategoryTheory.Adjunction.counitAsIsoOfIso {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (j : R.comp L Functor.id D) :
              R.comp L Functor.id D

              Given an adjunction LR, if RL is abstractly isomorphic to the identity functor, then the counit is an isomorphism.

              Equations
              Instances For
                theorem CategoryTheory.Adjunction.isIso_counit_of_iso {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (j : R.comp L Functor.id D) :
                IsIso adj.counit
                noncomputable def CategoryTheory.Adjunction.fullyFaithfulROfCompIsoId {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (adj : L R) (j : R.comp L Functor.id D) :
                R.FullyFaithful

                Given an adjunction LR, if RL is isomorphic to the identity functor, then R is fully faithful.

                Equations
                • adj.fullyFaithfulROfCompIsoId j = adj.fullyFaithfulROfIsIsoCounit
                Instances For
                  def CategoryTheory.Monad.comparison {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                  Functor D h.toMonad.Algebra

                  Given any adjunction LR, there is a comparison functor CategoryTheory.Monad.comparison R sending objects Y : D to Eilenberg-Moore algebras for LR with underlying object R.obj X.

                  We later show that this is full when R is full, faithful when R is faithful, and essentially surjective when R is reflective.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[simp]
                    theorem CategoryTheory.Monad.comparison_obj_a {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (X : D) :
                    ((comparison h).obj X).a = R.map (h.counit.app X)
                    @[simp]
                    theorem CategoryTheory.Monad.comparison_obj_A {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (X : D) :
                    ((comparison h).obj X).A = R.obj X
                    @[simp]
                    theorem CategoryTheory.Monad.comparison_map_f {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) {X✝ Y✝ : D} (f : X✝ Y✝) :
                    ((comparison h).map f).f = R.map f
                    def CategoryTheory.Monad.comparisonForget {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                    (comparison h).comp h.toMonad.forget R

                    The underlying object of (Monad.comparison R).obj X is just R.obj X.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[simp]
                      theorem CategoryTheory.Monad.comparisonForget_hom_app {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (x✝ : D) :
                      (comparisonForget h).hom.app x✝ = CategoryStruct.id (((comparison h).comp h.toMonad.forget).obj x✝)
                      @[simp]
                      theorem CategoryTheory.Monad.comparisonForget_inv_app {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (x✝ : D) :
                      (comparisonForget h).inv.app x✝ = CategoryStruct.id (R.obj x✝)
                      theorem CategoryTheory.Monad.left_comparison {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                      L.comp (comparison h) = h.toMonad.free
                      instance CategoryTheory.instFaithfulAlgebraToMonadComparison {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} [R.Faithful] (h : L R) :
                      (Monad.comparison h).Faithful
                      def CategoryTheory.Comonad.comparison {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                      Functor C h.toComonad.Coalgebra

                      Given any adjunction LR, there is a comparison functor CategoryTheory.Comonad.comparison L sending objects X : C to Eilenberg-Moore coalgebras for LR with underlying object L.obj X.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[simp]
                        theorem CategoryTheory.Comonad.comparison_obj_A {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (X : C) :
                        ((comparison h).obj X).A = L.obj X
                        @[simp]
                        theorem CategoryTheory.Comonad.comparison_obj_a {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (X : C) :
                        ((comparison h).obj X).a = L.map (h.unit.app X)
                        @[simp]
                        theorem CategoryTheory.Comonad.comparison_map_f {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) {X✝ Y✝ : C} (f : X✝ Y✝) :
                        ((comparison h).map f).f = L.map f
                        def CategoryTheory.Comonad.comparisonForget {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                        (comparison h).comp h.toComonad.forget L

                        The underlying object of (Comonad.comparison L).obj X is just L.obj X.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[simp]
                          theorem CategoryTheory.Comonad.comparisonForget_inv_app {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (x✝ : C) :
                          (comparisonForget h).inv.app x✝ = CategoryStruct.id (L.obj x✝)
                          @[simp]
                          theorem CategoryTheory.Comonad.comparisonForget_hom_app {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) (x✝ : C) :
                          (comparisonForget h).hom.app x✝ = CategoryStruct.id (((comparison h).comp h.toComonad.forget).obj x✝)
                          theorem CategoryTheory.Comonad.left_comparison {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} (h : L R) :
                          R.comp (comparison h) = h.toComonad.cofree
                          instance CategoryTheory.Comonad.comparison_faithful_of_faithful {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {L : Functor C D} {R : Functor D C} [L.Faithful] (h : L R) :
                          (comparison h).Faithful
                          class CategoryTheory.MonadicRightAdjoint {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] (R : Functor D C) :
                          Type (max (max (max u₁ u₂) v₁) v₂)

                          A right adjoint functor R : D ⥤ C is monadic if the comparison functor Monad.comparison R from D to the category of Eilenberg-Moore algebras for the adjunction is an equivalence.

                          Instances

                            The left adjoint functor to R given by [MonadicRightAdjoint R].

                            Equations
                            Instances For
                              Equations
                              class CategoryTheory.ComonadicLeftAdjoint {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] (L : Functor C D) :
                              Type (max (max (max u₁ u₂) v₁) v₂)

                              A left adjoint functor L : C ⥤ D is comonadic if the comparison functor Comonad.comparison L from C to the category of Eilenberg-Moore algebras for the adjunction is an equivalence.

                              Instances

                                The right adjoint functor to L given by [ComonadicLeftAdjoint L].

                                Equations
                                Instances For
                                  Equations
                                  theorem CategoryTheory.Reflective.comparison_full {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {R : Functor D C} [R.Full] {L : Functor C D} (adj : L R) :
                                  (Monad.comparison adj).Full
                                  theorem CategoryTheory.Coreflective.comparison_full {C : Type u₁} [Category.{v₁, u₁} C] {D : Type u₂} [Category.{v₂, u₂} D] {R : Functor D C} [R.Full] {L : Functor C D} (adj : R L) :
                                  @[instance 100]

                                  Any reflective inclusion has a monadic right adjoint. cf Prop 5.3.3 of Riehl

                                  Equations
                                  @[instance 100]

                                  Any coreflective inclusion has a comonadic left adjoint. cf Dual statement of Prop 5.3.3 of Riehl

                                  Equations