module Cat.Instances.InternalFunctor.Compose where
Functoriality of internal functor compositionπ
Internal functor composition is functorial, when viewed as an operation on internal functor categories. This mirrors the similar results for composition of ordinary functors.
To show this, we will need to define whiskering and horizontal composition of internal natural transformations.
module _ {o β} {C : Precategory o β} {πΈ πΉ β : Internal.Internal-cat C} where open Precategory C open Internal C open Internal-functor open _=>i_ private module πΈ = Cat.Internal.Reasoning πΈ module πΉ = Cat.Internal.Reasoning πΉ module β = Cat.Internal.Reasoning β
_βi_ : {F G : Internal-functor πΉ β} β F =>i G β (H : Internal-functor πΈ πΉ) β F Fiβ H =>i G Fiβ H _βΈi_ : {F G : Internal-functor πΈ πΉ} β (H : Internal-functor πΉ β) β F =>i G β H Fiβ F =>i H Fiβ G _βi_ : {F G : Internal-functor πΉ β} {H K : Internal-functor πΈ πΉ} β F =>i G β H =>i K β F Fiβ H =>i G Fiβ K
These are almost identical to their 1-categorical counterparts, so we omit their definitions.
(Ξ± βi H) .Ξ·i x = Ξ± .Ξ·i (H .Fiβ x) (Ξ± βi H) .is-naturali x y f = Ξ± .is-naturali _ _ _ (Ξ± βi H) .Ξ·i-nat x Ο = β.begini Ξ± .Ξ·i (H .Fiβ x) [ Ο ] β.β‘iβ¨ Ξ± .Ξ·i-nat _ Ο β©β.β‘i Ξ± .Ξ·i (H .Fiβ x β Ο) β.β‘iβ¨ ap (Ξ± .Ξ·i) (H .Fiβ-nat x Ο) β©β.β‘i Ξ± .Ξ·i (H .Fiβ (x β Ο)) β (H βΈi Ξ±) .Ξ·i x = H .Fiβ (Ξ± .Ξ·i x) (H βΈi Ξ±) .is-naturali x y f = sym (H .Fi-β _ _) β ap (H .Fiβ) (Ξ± .is-naturali _ _ _) β H .Fi-β _ _ (H βΈi Ξ±) .Ξ·i-nat x Ο = β.casti $ H .Fiβ-nat _ Ο β.βi Ξ» i β H .Fiβ (Ξ± .Ξ·i-nat x Ο i) _βi_ {F} {G} {H} {K} Ξ± Ξ² .Ξ·i x = G .Fiβ (Ξ² .Ξ·i x) β.βi Ξ± .Ξ·i (H .Fiβ x) _βi_ {F} {G} {H} {K} Ξ± Ξ² .is-naturali x y f = (G .Fiβ (Ξ² .Ξ·i _) β.βi Ξ± .Ξ·i _) β.βi F .Fiβ (H .Fiβ f) β‘β¨ β.pullri (Ξ± .is-naturali _ _ _) β©β‘ G .Fiβ (Ξ² .Ξ·i _) β.βi (G .Fiβ (H .Fiβ f) β.βi Ξ± .Ξ·i _) β‘β¨ β.pullli (sym (G .Fi-β _ _) β ap (G .Fiβ) (Ξ² .is-naturali _ _ _)) β©β‘ G .Fiβ (K .Fiβ f πΉ.βi Ξ² .Ξ·i _) β.βi Ξ± .Ξ·i _ β‘β¨ β.pushli (G .Fi-β _ _) β©β‘ G .Fiβ (K .Fiβ f) β.βi (G .Fiβ (Ξ² .Ξ·i _) β.βi Ξ± .Ξ·i _) β _βi_ {F} {G} {H} {K} Ξ± Ξ² .Ξ·i-nat x Ο = β.begini (G .Fiβ (Ξ² .Ξ·i x) β.βi Ξ± .Ξ·i (H .Fiβ x)) [ Ο ] β.β‘iβ¨ β.βi-nat _ _ _ β©β.β‘i G .Fiβ (Ξ² .Ξ·i x) [ Ο ] β.βi Ξ± .Ξ·i (H .Fiβ x) [ Ο ] β.β‘iβ¨ (Ξ» i β G .Fiβ-nat (Ξ² .Ξ·i x) Ο i β.βi Ξ± .Ξ·i-nat (H .Fiβ x) Ο i) β©β.β‘i G .Fiβ (Ξ² .Ξ·i x [ Ο ]) β.βi Ξ± .Ξ·i (H .Fiβ x β Ο) β.β‘iβ¨ (Ξ» i β G .Fiβ (Ξ² .Ξ·i-nat x Ο i) β.βi Ξ± .Ξ·i (H .Fiβ-nat x Ο i)) β©β.β‘i G .Fiβ (Ξ² .Ξ·i (x β Ο)) β.βi Ξ± .Ξ·i (H .Fiβ (x β Ο)) β
With that out of the way, we can prove the main result.
module _ {o β} {C : Precategory o β} (πΈ πΉ β : Internal.Internal-cat C) where open Precategory C open Internal C open Cat.Instances.InternalFunctor C open Functor open Internal-functor open _=>i_ private module πΈ = Cat.Internal.Reasoning πΈ module πΉ = Cat.Internal.Reasoning πΉ module β = Cat.Internal.Reasoning β
Fiβ-functor : Functor (Internal-functors πΉ β ΓαΆ Internal-functors πΈ πΉ) (Internal-functors πΈ β) Fiβ-functor .Fβ (F , G) = F Fiβ G
Much like whiskering and horizontal composition, this is identical to the result involving functor composition. The only difference is the addition of extra naturality conditions, which are easy to prove.
Fiβ-functor .Fβ {F , G} {H , K} (Ξ± , Ξ²) = Ξ± βi Ξ² Fiβ-functor .F-id {F , G} = Internal-nat-path Ξ» x β F .Fiβ (πΉ.idi _) β.βi β.idi _ β‘β¨ ap (β._βi β.idi _) (F .Fi-id) β©β‘ β.idi _ β.βi β.idi _ β‘β¨ β.idli _ β©β‘ β.idi _ β Fiβ-functor .F-β {F , G} {H , J} {K , L} (Ξ± , Ξ²) (Ξ³ , Ο) = Internal-nat-path Ξ» x β K .Fiβ (Ξ² .Ξ·i _ πΉ.βi Ο .Ξ·i _) β.βi Ξ± .Ξ·i _ β.βi Ξ³ .Ξ·i _ β‘β¨ β.pushli (K .Fi-β _ _) β©β‘ K .Fiβ (Ξ² .Ξ·i _) β.βi K .Fiβ (Ο .Ξ·i _) β.βi Ξ± .Ξ·i _ β.βi Ξ³ .Ξ·i _ β‘β¨ β.extend-inneri (sym (Ξ± .is-naturali _ _ _)) β©β‘ K .Fiβ (Ξ² .Ξ·i _) β.βi Ξ± .Ξ·i _ β.βi H .Fiβ (Ο .Ξ·i _) β.βi Ξ³ .Ξ·i _ β‘β¨ β.associ _ _ _ β©β‘ (K .Fiβ (Ξ² .Ξ·i x) β.βi Ξ± .Ξ·i _) β.βi H .Fiβ (Ο .Ξ·i _) β.βi Ξ³ .Ξ·i _ β