module Cat.Monoidal.Strength where
Strong functorsπ
module _ {o β} {C : Precategory o β} (Cα΅ : Monoidal-category C) (F : Functor C C) where open Cat.Reasoning C open Monoidal-category Cα΅ open Functor F private module F = Cat.Functor.Reasoning F
A left strength for a functor on a monoidal category is a natural transformation
interacting nicely with the left unitor and associator.
record Left-strength : Type (o β β) where field left-strength : -β- Fβ (Id FΓ F) => F Fβ -β- module Ο = _=>_ left-strength Ο : β {A B} β Hom (A β Fβ B) (Fβ (A β B)) Ο = Ο.Ξ· _ field left-strength-Ξ»β : β {A} β Fβ (Ξ»β {A}) β Ο β‘ Ξ»β left-strength-Ξ±β : β {A B C} β Fβ (Ξ±β A B C) β Ο β‘ Ο β (id ββ Ο) β Ξ±β A B (Fβ C)
Reversely1, a right strength is a natural transformation
interacting nicely with the right unitor and associator.
record Right-strength : Type (o β β) where field right-strength : -β- Fβ (F FΓ Id) => F Fβ -β- module Ο = _=>_ right-strength Ο : β {A B} β Hom (Fβ A β B) (Fβ (A β B)) Ο = Ο.Ξ· _ field right-strength-Οβ : β {A} β Fβ (Οβ {A}) β Ο β‘ Οβ right-strength-Ξ±β : β {A B C} β Fβ (Ξ±β A B C) β Ο β‘ Ο β (Ο ββ id) β Ξ±β (Fβ A) B C
right-strength-Ξ±β : β {A B C} β Ο β Ξ±β (Fβ A) B C β‘ Fβ (Ξ±β A B C) β Ο β (Ο ββ id) right-strength-Ξ±β = sym $ swizzle (sym (right-strength-Ξ±β β assoc _ _ _)) (Ξ±β .invr) (F.F-map-iso Ξ±β .invl)
A strength for is a pair of a left strength and a right strength inducing a single operation i.e.Β making the following diagram commute:
record Strength : Type (o β β) where field strength-left : Left-strength strength-right : Right-strength open Left-strength strength-left public open Right-strength strength-right public field strength-Ξ±β : β {A B C} β Fβ (Ξ±β A B C) β Ο β (Ο ββ id) β‘ Ο β (id ββ Ο) β Ξ±β A (Fβ B) C
A functor equipped with a strength is called a strong functor.
private unquoteDecl left-eqv = declare-record-iso left-eqv (quote Left-strength) Left-strength-path : β {a b} β a .Left-strength.left-strength β‘ b .Left-strength.left-strength β a β‘ b Left-strength-path p = Iso.injective left-eqv (Ξ£-prop-path (Ξ» _ β hlevel 1) p) private unquoteDecl right-eqv = declare-record-iso right-eqv (quote Right-strength) Right-strength-path : β {a b} β a .Right-strength.right-strength β‘ b .Right-strength.right-strength β a β‘ b Right-strength-path p = Iso.injective right-eqv (Ξ£-prop-path (Ξ» _ β hlevel 1) p)
Symmetryπ
In a symmetric monoidal category (or even just a braided monoidal category, if one is careful about directions), there is an equivalence between the notions of left and right strength: we can obtain one from the other by βconjugatingβ with the braiding, as illustrated by this diagram.
Therefore, the literature usually speaks of βstrengthβ in a symmetric
monoidal category to mean either a left or a right strength, but note
that this is not quite the same as a Strength
as defined above,
which has left and right strengths not necessarily related by
the braiding. If they are, we will say that the strength is
symmetric; such a strength contains exactly the information of
a left (or right) strength.
is-symmetric-strength : Strength β Type (o β β) is-symmetric-strength s = β {A B} β Ο {A} {B} β Ξ²β β‘ Fβ Ξ²β β Ο where open Strength s
The construction of the equivalence between left and right strengths
is extremely tedious, so we leave the details to the curious reader.
leftβright : Iso Left-strength Right-strength
leftβright .fst l = r where open Left-strength l open Right-strength r : Right-strength r .right-strength .Ξ· _ = Fβ Ξ²β β Ο β Ξ²β r .right-strength .is-natural _ _ (f , g) = (Fβ Ξ²β β Ο β Ξ²β) β (Fβ f ββ g) β‘β¨ pullr (pullr (Ξ²β.is-natural _ _ _)) β©β‘ Fβ Ξ²β β Ο β (g ββ Fβ f) β Ξ²β β‘β¨ reflβ©ββ¨ extendl (Ο.is-natural _ _ _) β©β‘ Fβ Ξ²β β Fβ (g ββ f) β Ο β Ξ²β β‘β¨ F.extendl (Ξ²β.is-natural _ _ _) β©β‘ Fβ (f ββ g) β Fβ Ξ²β β Ο β Ξ²β β r .right-strength-Οβ = Fβ Οβ β Fβ Ξ²β β Ο β Ξ²β β‘β¨ F.pulll Οβ-Ξ²β β©β‘ Fβ Ξ»β β Ο β Ξ²β β‘β¨ pulll left-strength-Ξ»β β©β‘ Ξ»β β Ξ²β β‘β¨ Ξ»β-Ξ²β β©β‘ Οβ β r .right-strength-Ξ±β = Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Ο β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pushl3 (sym (lswizzle (Ο.is-natural _ _ _) (F.annihilate (β.annihilate (Ξ²β .invl))))) β©β‘ Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Fβ (Ξ²β ββ id) β Ο β (Ξ²β ββ β Fβ id β) β Ξ²β β‘β¨ ap! F-id β©β‘ Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Fβ (Ξ²β ββ id) β Ο β (Ξ²β ββ id) β Ξ²β β‘β¨ F.extendl3 (sym Ξ²β-idβΞ²β-Ξ±β) β©β‘ Fβ Ξ²β β Fβ (id ββ Ξ²β) β Fβ (Ξ±β _ _ _) β Ο β (Ξ²β ββ id) β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pulll left-strength-Ξ±β β©β‘ Fβ Ξ²β β Fβ (id ββ Ξ²β) β (Ο β (id ββ Ο) β Ξ±β _ _ _) β (Ξ²β ββ id) β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pullr (pullr refl) β©β‘ Fβ Ξ²β β Fβ (id ββ Ξ²β) β Ο β (id ββ Ο) β Ξ±β _ _ _ β (Ξ²β ββ id) β Ξ²β β‘β¨ reflβ©ββ¨ pushr (pushr (reflβ©ββ¨ sym Ξ²β-Ξ²ββid-Ξ±β)) β©β‘ Fβ Ξ²β β (Fβ (id ββ Ξ²β) β Ο β (id ββ Ο)) β Ξ²β β (Ξ²β ββ id) β Ξ±β _ _ _ β‘Λβ¨ reflβ©ββ¨ pulll (βΆ.shufflel (Ο.is-natural _ _ _)) β©β‘Λ Fβ Ξ²β β Ο β (id ββ (Fβ Ξ²β β Ο)) β Ξ²β β (Ξ²β ββ id) β Ξ±β _ _ _ β‘β¨ pushr (pushr (extendl (sym (Ξ²β.is-natural _ _ _)))) β©β‘ (Fβ Ξ²β β Ο β Ξ²β) β ((Fβ Ξ²β β Ο) ββ id) β (Ξ²β ββ id) β Ξ±β _ _ _ β‘β¨ reflβ©ββ¨ β.pulll (sym (assoc _ _ _)) β©β‘ (Fβ Ξ²β β Ο β Ξ²β) β ((Fβ Ξ²β β Ο β Ξ²β) ββ id) β Ξ±β _ _ _ β leftβright .snd .inv r = l where open Right-strength r open Left-strength l : Left-strength l .left-strength .Ξ· _ = Fβ Ξ²β β Ο β Ξ²β l .left-strength .is-natural _ _ (f , g) = (Fβ Ξ²β β Ο β Ξ²β) β (f ββ Fβ g) β‘β¨ pullr (pullr (Ξ²β.is-natural _ _ _)) β©β‘ Fβ Ξ²β β Ο β (Fβ g ββ f) β Ξ²β β‘β¨ reflβ©ββ¨ extendl (Ο.is-natural _ _ _) β©β‘ Fβ Ξ²β β Fβ (g ββ f) β Ο β Ξ²β β‘β¨ F.extendl (Ξ²β.is-natural _ _ _) β©β‘ Fβ (f ββ g) β Fβ Ξ²β β Ο β Ξ²β β l .left-strength-Ξ»β = Fβ Ξ»β β Fβ Ξ²β β Ο β Ξ²β β‘β¨ F.pulll Ξ»β-Ξ²β β©β‘ Fβ Οβ β Ο β Ξ²β β‘β¨ pulll right-strength-Οβ β©β‘ Οβ β Ξ²β β‘β¨ Οβ-Ξ²β β©β‘ Ξ»β β l .left-strength-Ξ±β = Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Ο β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pushl3 (sym (lswizzle (Ο.is-natural _ _ _) (F.annihilate (βΆ.annihilate (Ξ²β .invr))))) β©β‘ Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Fβ (id ββ Ξ²β) β Ο β (β Fβ id β ββ Ξ²β) β Ξ²β β‘β¨ ap! F-id β©β‘ Fβ (Ξ±β _ _ _) β Fβ Ξ²β β Fβ (id ββ Ξ²β) β Ο β (id ββ Ξ²β) β Ξ²β β‘β¨ F.extendl3 ((reflβ©ββ¨ Ξ²β.is-natural _ _ _) β sym Ξ²β-Ξ²ββid-Ξ±β) β©β‘ Fβ Ξ²β β Fβ (Ξ²β ββ id) β Fβ (Ξ±β _ _ _) β Ο β (id ββ Ξ²β) β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pulll right-strength-Ξ±β β©β‘ Fβ Ξ²β β Fβ (Ξ²β ββ id) β (Ο β (Ο ββ id) β Ξ±β _ _ _) β (id ββ Ξ²β) β Ξ²β β‘β¨ reflβ©ββ¨ reflβ©ββ¨ pullr (pullr refl) β©β‘ Fβ Ξ²β β Fβ (Ξ²β ββ id) β Ο β (Ο ββ id) β Ξ±β _ _ _ β (id ββ Ξ²β) β Ξ²β β‘β¨ reflβ©ββ¨ pushr (pushr (reflβ©ββ¨ ((reflβ©ββ¨ sym (Ξ²β.is-natural _ _ _)) β sym Ξ²β-idβΞ²β-Ξ±β))) β©β‘ Fβ Ξ²β β (Fβ (Ξ²β ββ id) β Ο β (Ο ββ id)) β Ξ²β β (id ββ Ξ²β) β Ξ±β _ _ _ β‘Λβ¨ reflβ©ββ¨ pulll (β.shufflel (Ο.is-natural _ _ _)) β©β‘Λ Fβ Ξ²β β Ο β ((Fβ Ξ²β β Ο) ββ id) β Ξ²β β (id ββ Ξ²β) β Ξ±β _ _ _ β‘β¨ pushr (pushr (extendl (sym (Ξ²β.is-natural _ _ _)))) β©β‘ (Fβ Ξ²β β Ο β Ξ²β) β (id ββ (Fβ Ξ²β β Ο)) β (id ββ Ξ²β) β Ξ±β _ _ _ β‘β¨ reflβ©ββ¨ βΆ.pulll (sym (assoc _ _ _)) β©β‘ (Fβ Ξ²β β Ο β Ξ²β) β (id ββ (Fβ Ξ²β β Ο β Ξ²β)) β Ξ±β _ _ _ β leftβright .snd .rinv r = Right-strength-path $ ext Ξ» (A , B) β Fβ Ξ²β β (Fβ Ξ²β β Ο β Ξ²β) β Ξ²β β‘β¨ extendl (F.cancell (Ξ²β .invl)) β©β‘ Ο β Ξ²β β Ξ²β β‘β¨ elimr (Ξ²β .invl) β©β‘ Ο β where open Right-strength r leftβright .snd .linv l = Left-strength-path $ ext Ξ» (A , B) β Fβ Ξ²β β (Fβ Ξ²β β Ο β Ξ²β) β Ξ²β β‘β¨ extendl (F.cancell (Ξ²β .invr)) β©β‘ Ο β Ξ²β β Ξ²β β‘β¨ elimr (Ξ²β .invr) β©β‘ Ο β where open Left-strength l
Dualityπ
As hinted to above, a right strength for on can equivalently be defined as a left strength on the reverse monoidal category It is entirely trivial to show that the two definitions are equivalent:
module _ {o β} {C : Precategory o β} (M : Monoidal-category C) (F : Functor C C) where open is-iso
strength^rev : Left-strength (M ^rev) F β Right-strength M F strength^rev = IsoβEquiv is where is : Iso _ _ is .fst l = record { right-strength = NT (Ξ» _ β Ο) Ξ» _ _ _ β Ο.is-natural _ _ _ ; right-strength-Οβ = left-strength-Ξ»β ; right-strength-Ξ±β = left-strength-Ξ±β } where open Left-strength l is .snd .inv r = record { left-strength = NT (Ξ» _ β Ο) Ξ» _ _ _ β Ο.is-natural _ _ _ ; left-strength-Ξ»β = right-strength-Οβ ; left-strength-Ξ±β = right-strength-Ξ±β } where open Right-strength r is .snd .rinv _ = Right-strength-path _ _ trivial! is .snd .linv _ = Left-strength-path _ _ trivial!
Sets-endofunctors are strongπ
Every endofunctor on seen as a cartesian monoidal category, can be equipped with a canonical symmetric strength: the tensor product is the actual product of sets, so, given we can simply apply the functorial action of on the function yielding a function
Sets-strength : Left-strength Setsβ F Sets-strength .left-strength .Ξ· (A , B) (a , Fb) = Fβ (a ,_) Fb Sets-strength .left-strength .is-natural (A , B) (C , D) (ac , bd) = ext Ξ» a Fb β (sym (F-β _ _) β F-β _ _) $β Fb Sets-strength .left-strength-Ξ»β = ext Ξ» _ Fa β (sym (F-β _ _) β F-id) $β Fa Sets-strength .left-strength-Ξ±β = ext Ξ» a b Fc β (sym (F-β _ _) β F-β _ _) $β Fc
This is an instance of a more general fact: in a closed monoidal category (that is, one with an adjunction for example coming from a cartesian closed category), left strengths for endofunctors are equivalent to enrichments of F: that is, natural transformations
internalising the functorial action Then, what we have shown boils down to the fact that every endofunctor on is trivially
That is, on the other side of the reverse monoidal category duality.β©οΈ