module Cat.Bi.Functor.Base where
Identity and composition for lax functors and pseudofunctorsπ
Having defined lax functors and pseudofunctors between bicategories, we should expect to be able to compose them, in analogy with ordinary functors between categories. This is indeed the case, and while the construction is unsurprising, showing the required coherence identities is a bit of an exercise.
private variable o1 o2 o3 h1 h2 h3 l1 l2 l3 : Level open _=>_ module Lf-reasoning {B : Prebicategory o1 h1 l1} {C : Prebicategory o2 h2 l2} (F : Lax-functor B C) where private module B = Prebicategory B module C = Prebicategory C module CH {A} {B} = Cr (C.Hom A B) module Pβ {A} {B} = Fr (Lax-functor.Pβ F {A} {B}) open Lax-functor F hiding (module Pβ) public βΆ-comp : β {X Y Z} {f : Y B.β¦ Z} β postaction C (β f) Fβ Pβ {X} {Y} => Pβ Fβ postaction B f βΆ-comp .Ξ· x = Ξ³β (_ , x) βΆ-comp .is-natural x y Ξ± = CH.cdr (Fr.introl (preaction C (β y)) Pβ.F-id) ββ Ξ³βnat _ _ ββ CH.car (Pβ.F-β _ _ β CH.eliml (Fr.elim Pβ B.compose.β.F-id)) β-comp : β {X Y Z} {f : X B.β¦ Y} β preaction C (β f) Fβ Pβ {Y} {Z} => Pβ Fβ preaction B f β-comp .Ξ· x = Ξ³β (x , _) β-comp .is-natural x y Ξ± = CH.cdr (Fr.intror (postaction C (β x)) Pβ.F-id) ββ Ξ³βnat _ _ ββ CH.car (Pβ.F-β _ _ β CH.elimr (Fr.elim Pβ B.compose.βΆ.F-id)) module Pf-reasoning {B : Prebicategory o1 h1 l1} {C : Prebicategory o2 h2 l2} (F : Pseudofunctor B C) where private module B = Prebicategory B module C = Prebicategory C module CH {A} {B} = Cr (C.Hom A B) module Pβ {A} {B} = Fr (Pseudofunctor.Pβ F {A} {B}) open Pseudofunctor F hiding (module Pβ) public open make-natural-iso open Cr.Inverses open Cr._β _ Ο β : β {A} β C.id CH.β β (B.id {A}) Ο β .to = Ο β Ο β .from = Ο β Ο β .inverses = Cr.is-invertible.inverses unitor-inv compositor-ni : β {A B C} β Uncurry C.compose Fβ (Pβ {B} {C} FΓ Pβ {A} {B}) β βΏ Pβ Fβ Uncurry B.compose compositor-ni = to-natural-iso ni where ni : make-natural-iso _ _ ni .eta = Ξ³β ni .inv = Ξ³β ni .etaβinv _ = Cr.is-invertible.inverses (compositor-inv _) .invl ni .invβeta _ = Cr.is-invertible.inverses (compositor-inv _) .invr ni .make-natural-iso.natural _ _ _ = sym $ Ξ³βnat _ _ Ξ³β : β {A B C} {f : B B.β¦ C} {g : A B.β¦ B} β β f C.β β g CH.β β (f B.β g) Ξ³β = isoβΏβiso compositor-ni _ βΆ-comp : β {X Y Z} {f : Y B.β¦ Z} β postaction C (β f) Fβ Pβ {X} {Y} β βΏ Pβ Fβ postaction B f βΆ-comp = to-natural-iso ni where ni : make-natural-iso _ _ ni .eta x = Ξ³β (_ , x) ni .inv x = Ξ³β (_ , x) ni .etaβinv _ = Cr.is-invertible.inverses (compositor-inv _) .invl ni .invβeta _ = Cr.is-invertible.inverses (compositor-inv _) .invr ni .natural x y Ξ± = sym $ CH.cdr (Fr.introl (preaction C (β y)) Pβ.F-id) ββ Ξ³βnat _ _ ββ CH.car (Pβ.F-β _ _ β CH.eliml (Fr.elim Pβ B.compose.β.F-id)) β-comp : β {X Y Z} {f : X B.β¦ Y} β preaction C (β f) Fβ Pβ {Y} {Z} β βΏ Pβ Fβ preaction B f β-comp = to-natural-iso ni where ni : make-natural-iso _ _ ni .eta x = Ξ³β (x , _) ni .inv x = Ξ³β (x , _) ni .etaβinv _ = Cr.is-invertible.inverses (compositor-inv _) .invl ni .invβeta _ = Cr.is-invertible.inverses (compositor-inv _) .invr ni .natural x y Ξ± = sym $ CH.cdr (Fr.intror (postaction C (β x)) Pβ.F-id) ββ Ξ³βnat _ _ ββ CH.car (Pβ.F-β _ _ β CH.elimr (Fr.elim Pβ B.compose.βΆ.F-id)) open Pseudofunctor open Lax-functor module _ {B : Prebicategory o1 h1 l1} where open Br B
The identity lax functor on a bicategory is constructed from the identity function on objects, and the identity functor on
IdL : Lax-functor B B IdL .Pβ z = z IdL .Pβ = Id
For the compositor and unitor, we can also choose the identity; the coherence conditions work out to be trivial.
IdL .compositor .Ξ· x = Hom.id IdL .compositor .is-natural _ _ _ = Hom.id-comm-sym IdL .unitor = Hom.id
IdL .hexagon f g h = Hom.elimr (Hom.idl _ β β.F-id) β Hom.insertl (Hom.idl _ β βΆ.F-id) IdL .right-unit f = Hom.elimr (Hom.idl _ β βΆ.F-id) IdL .left-unit f = Hom.elimr (Hom.idl _ β β.F-id)
Since identity morphisms are invertible, this extends directly to a pseudofunctor as well.
IdP : Pseudofunctor B B IdP .lax = IdL IdP .unitor-inv = Hom.id-invertible IdP .compositor-inv _ = Hom.id-invertible
module _ {B : Prebicategory o1 h1 l1} {C : Prebicategory o2 h2 l2} {D : Prebicategory o3 h3 l3} where private module B = Prebicategory B module C = Prebicategory C module D = Br D module DH = D.Hom module Pr = Pf-reasoning
It is similarly straightforward to define the composite of two lax functors and by composing the object functions and 1-cell functors.
_Lβ_ : Lax-functor C D β Lax-functor B C β Lax-functor B D F Lβ G = lf module Lβ where
lf .Pβ = F.Pβ β G.Pβ lf .Pβ = F.Pβ Fβ G.Pβ
For the compositor of the composite functor, we must construct a 2-cell Using the compositor of we have and mapping the compositor of under in the result, we get the required morphism. Naturality of this construction amounts to applying the naturality of the original compositors in turn.
lf .compositor .Ξ· (x , y) = F.β (G.Ξ³β (x , y)) D.β F.Ξ³β (G.β x , G.β y) lf .compositor .is-natural (x , y) (x' , y') (f , g) = (F.β (G.Ξ³β _) D.β F.Ξ³β _) D.β (F.β (G.β f) D.β F.β (G.β g)) β‘β¨ DH.extendr (F.Ξ³βnat (G.β f) (G.β g)) β©β‘ (F.β (G.Ξ³β _) D.β F.β (G.β f C.β G.β g)) D.β F.Ξ³β _ β‘β¨ DH.pushl (F.Pβ.weave (G.Ξ³βnat f g)) β©β‘ F.β (G.β (f B.β g)) D.β F.β (G.Ξ³β _) D.β F.Ξ³β _ β
The unitor follows a similar pattern.
lf .unitor = F.β G.Ο β D.β F.Ο β
Showing that the coherence equations hold for these constructions is in principle a straightforward matter of applying of the identities for and in sequence, but the sheer size of the equations make it a bit daunting. We show the case for the left unit to illustrate the point, but elide the other two equations which are similar in spirit.
lf .left-unit f = F.β (G.β (B.Ξ»β f)) D.β (F.β (G.Ξ³β (B.id , f)) D.β F.Ξ³β (G.β B.id , G.β f)) D.β (F.β G.Ο β D.β F.Ο β) D.β F.β (G.β f) β‘Λβ¨ DH.reflβ©ββ¨ DH.pushr (DH.extendl (sym $ F.β-comp .is-natural _ _ _) β ap (F.Ξ³β _ D.β_) (sym D.β-distribl)) β©β‘Λ F.β (G.β (B.Ξ»β f)) D.β F.β (G.Ξ³β (B.id , f)) D.β F.β (G.Ο β C.β G.β f) D.β F.Ξ³β (C.id , G.β f) D.β F.Ο β D.β F.β (G.β f) β‘β¨ F.Pβ.pulll3 (G.left-unit f) β©β‘ F.β (C.Ξ»β (G.β f)) D.β F.Ξ³β (C.id , G.β f) D.β F.Ο β D.β F.β (G.β f) β‘β¨ F.left-unit (G.β f) β©β‘ D.Ξ»β (F.β (G.β f)) β
Here are the hexagon and right unit identities, not for the faint of heart.
lf .hexagon f g h = F.β (G.β (B.Ξ±β _)) D.β (F.β (G.Ξ³β _) D.β F.Ξ³β _) D.β (F.β (G.Ξ³β _) D.β F.Ξ³β _) D.β F.β (G.β h) β‘Λβ¨ DH.reflβ©ββ¨ DH.pushr (DH.extendl (sym $ F.β-comp .is-natural _ _ _) β ap (F.Ξ³β _ D.β_) (sym D.β-distribl)) β©β‘Λ F.β (G.β (B.Ξ±β _)) D.β F.β (G.Ξ³β _) D.β F.β (G.Ξ³β _ C.β G.β h) D.β F.Ξ³β _ D.β F.Ξ³β _ D.β F.β (G.β h) β‘β¨ F.Pβ.extendl3 (G.hexagon f g h) β©β‘ F.β (G.Ξ³β _) D.β F.β (G.β f C.βΆ G.Ξ³β _) D.β F.β (C.Ξ±β _) D.β F.Ξ³β _ D.β F.Ξ³β _ D.β F.β (G.β h) β‘β¨ DH.reflβ©ββ¨ DH.reflβ©ββ¨ F.hexagon (G.β f) (G.β g) (G.β h) β©β‘ F.β (G.Ξ³β _) D.β F.β (G.β f C.βΆ G.Ξ³β _) D.β F.Ξ³β _ D.β F.β (G.β f) D.βΆ F.Ξ³β _ D.β D.Ξ±β _ β‘β¨ DH.reflβ©ββ¨ DH.extendl (sym $ F.βΆ-comp .is-natural _ _ _) β©β‘ F.β (G.Ξ³β _) D.β F.Ξ³β _ D.β F.β (G.β f) D.βΆ F.β (G.Ξ³β _) D.β F.β (G.β f) D.βΆ F.Ξ³β _ D.β D.Ξ±β _ β‘β¨ DH.pushr (ap (F.Ξ³β _ D.β_) (D.βΆ.pulll refl)) β©β‘ (F.β (G.Ξ³β (f , g B.β h)) D.β F.Ξ³β (G.β f , G.β (g B.β h))) D.β F.β (G.β f) D.βΆ (F.β (G.Ξ³β (g , h)) D.β F.Ξ³β (G.β g , G.β h)) D.β D.Ξ±β _ β lf .right-unit f = F.β (G.β (B.Οβ f)) D.β (F.β (G.Ξ³β (f , B.id)) D.β F.Ξ³β (G.β f , G.β B.id)) D.β F.β (G.β f) D.βΆ (F.β G.Ο β D.β F.Ο β) β‘Λβ¨ DH.reflβ©ββ¨ DH.pushr (DH.extendl (sym $ F.βΆ-comp .is-natural _ _ _) β ap (F.Ξ³β _ D.β_) (sym D.βΆ-distribr)) β©β‘Λ F.β (G.β (B.Οβ f)) D.β F.β (G.Ξ³β (f , B.id)) D.β F.β (G.β f C.βΆ G.Ο β) D.β F.Ξ³β (G.β f , C.id) D.β F.β (G.β f) D.βΆ F.Ο β β‘β¨ F.Pβ.pulll3 (G.right-unit f) β©β‘ F.β (C.Οβ (G.β f)) D.β F.Ξ³β (G.β f , C.id) D.β F.β (G.β f) D.βΆ F.Ο β β‘β¨ F.right-unit (G.β f) β©β‘ D.Οβ (F.β (G.β f)) β
Finally, pseudofunctors can be composed using the same construction, thanks to the fact that functors preserve isomorphisms.
_Pβ_ : Pseudofunctor C D β Pseudofunctor B C β Pseudofunctor B D (F Pβ G) .lax = F .lax Lβ G .lax (F Pβ G) .unitor-inv = DH.invertible-β (Pr.Pβ.F-map-invertible F (Pr.unitor-inv G)) (Pr.unitor-inv F) (F Pβ G) .compositor-inv _ = DH.invertible-β (Pr.Pβ.F-map-invertible F (Pr.compositor-inv G _)) (Pr.compositor-inv F _)