module Cat.Functor.Adjoint.Compose where
Composition of adjunctionsπ
Suppose we have four functors and such that they βfit togetherβ, i.e. the composites and both exist. What can we say about their composites? The hope is that they would again be adjoints, and this is indeed the case.
We prove this here by explicitly exhibiting the adjunction natural transformations and the triangle identities, which is definitely suboptimal for readability, but is the most efficient choice in terms of the resulting program.
module _ {o β oβ ββ oβ ββ} {A : Precategory o β} {B : Precategory oβ ββ} {C : Precategory oβ ββ} {F : Functor A B} {G : Functor B A} {L : Functor B C} {R : Functor C B} (Fβ£G : F β£ G) (Lβ£R : L β£ R) where
private module fg = _β£_ Fβ£G module lr = _β£_ Lβ£R module A = Cat.Reasoning A module B = Cat.Reasoning B module C = Cat.Reasoning C module F = Cat.Functor.Reasoning F module G = Cat.Functor.Reasoning G module L = Cat.Functor.Reasoning L module R = Cat.Functor.Reasoning R open _β£_ open _=>_ module LF = Functor (L Fβ F) module GR = Functor (G Fβ R)
infixr 30 _ββ£_ _ββ£_ : (L Fβ F) β£ (G Fβ R) _ββ£_ .unit .Ξ· x = G.β (lr.Ξ· _) A.β fg.Ξ· _ _ββ£_ .counit .Ξ· x = lr.Ξ΅ _ C.β L.β (fg.Ξ΅ _) _ββ£_ .unit .is-natural x y f = (G.β (lr.Ξ· _) A.β fg.Ξ· _) A.β f β‘β¨ A.pullr (fg.unit.is-natural _ _ _) β©β‘ G.β (lr.Ξ· _) A.β G.β (F.β f) A.β fg.Ξ· _ β‘β¨ A.pulll (sym (G.F-β _ _)) β©β‘ G.β β lr.Ξ· _ B.β F.β f β A.β fg.Ξ· _ β‘β¨ ap! (lr.unit.is-natural _ _ _) β©β‘ G.β (R.β (L.β (F.β f)) B.β lr.Ξ· _) A.β fg.Ξ· _ β‘β¨ A.pushl (G.F-β _ _) β©β‘ GR.β (LF.β f) A.β G.β (lr.Ξ· _) A.β (fg.Ξ· _) β _ββ£_ .counit .is-natural x y f = (lr.Ξ΅ _ C.β L.β (fg.Ξ΅ _)) C.β LF.β (GR.β f) β‘β¨ C.pullr (sym (L.F-β _ _)) β©β‘ lr.Ξ΅ _ C.β L.β β fg.Ξ΅ _ B.β F.β (GR.β f) β β‘β¨ ap! (fg.counit.is-natural _ _ _) β©β‘ lr.Ξ΅ _ C.β β L.β (R.Fβ f B.β fg.Ξ΅ _) β β‘β¨ ap! (L.F-β _ _) β©β‘ lr.Ξ΅ _ C.β L.β (R.Fβ f) C.β L.β (fg.Ξ΅ _) β‘β¨ C.extendl (lr.counit.is-natural _ _ _) β©β‘ f C.β lr.Ξ΅ _ C.β L.β (fg.Ξ΅ _) β _ββ£_ .zig = (lr.Ξ΅ _ C.β L.β (fg.Ξ΅ _)) C.β β LF.β (G.β (lr.Ξ· _) A.β fg.Ξ· _) β β‘β¨ C.extendr (ap! (LF.F-β _ _) β L.extendl (fg.counit.is-natural _ _ _)) β©β‘ (lr.Ξ΅ _ C.β L.β (lr.Ξ· _)) C.β (L.β (fg.Ξ΅ _) C.β LF.β (fg.Ξ· _)) β‘β¨ C.elimr (L.annihilate fg.zig) β©β‘ lr.Ξ΅ _ C.β L.β (lr.Ξ· _) β‘β¨ lr.zig β©β‘ C.id β _ββ£_ .zag = GR.β (lr.Ξ΅ _ C.β L.β (fg.Ξ΅ _)) A.β G.β (lr.Ξ· _) A.β fg.Ξ· _ β‘β¨ A.pulll (G.collapse (B.pushl (R.F-β _ _) β apβ B._β_ refl (sym (lr.unit.is-natural _ _ _)))) β©β‘ G.β β R.β (lr.Ξ΅ _) B.β lr.Ξ· _ B.β fg.Ξ΅ _ β A.β fg.Ξ· _ β‘β¨ ap! (B.cancell lr.zag) β©β‘ G.β (fg.Ξ΅ _) A.β fg.Ξ· _ β‘β¨ fg.zag β©β‘ A.id β
module _ {o β} {C : Precategory o β} where open Cat.Reasoning C open _=>_ open _β£_ Idβ£Id : Id {C = C} β£ Id {C = C} Idβ£Id .unit .Ξ· x = id Idβ£Id .unit .is-natural x y f = id-comm-sym Idβ£Id .counit .Ξ· x = id Idβ£Id .counit .is-natural x y f = id-comm-sym Idβ£Id .zig = id2 Idβ£Id .zag = id2