module Cat.Internal.Opposite {o β} {C : Precategory o β} where
Opposites of internal categoriesπ
We can take the opposite of an internal category, by flipping the source and target morphisms. We begin by defining a little helper function that flips internal morphisms.
op-ihom : β {Cβ Cβ Ξ} {src tgt : Hom Cβ Cβ} {x y : Hom Ξ Cβ} β Internal-hom src tgt x y β Internal-hom tgt src y x op-ihom f .ihom = f .ihom op-ihom f .has-src = f .has-tgt op-ihom f .has-tgt = f .has-src op-ihom-nat : β {Cβ Cβ Ξ Ξ} {src tgt : Hom Cβ Cβ} {x y : Hom Ξ Cβ} β (f : Internal-hom src tgt x y) β (Ο : Hom Ξ Ξ) β op-ihom f [ Ο ] β‘ op-ihom (f [ Ο ]) op-ihom-nat f _ = Internal-hom-path refl
private op-ihom-involutive : β {Cβ Cβ Ξ} {src tgt : Hom Cβ Cβ} {x y : Hom Ξ Cβ} β {f : Internal-hom src tgt x y} β op-ihom (op-ihom f) β‘ f op-ihom-involutive = Internal-hom-path refl {-# REWRITE op-ihom-involutive #-}
Showing that this operation yields an internal category is a routine calculation.
Internal-cat-on-opi : β {Cβ Cβ} {src tgt : Hom Cβ Cβ} β Internal-cat-on src tgt β Internal-cat-on tgt src Internal-cat-on-opi β = icat-opi-on where open Internal-cat-on module β = Internal-cat-on β icat-opi-on : Internal-cat-on _ _ icat-opi-on .idi x = op-ihom (β.idi x) icat-opi-on ._βi_ f g = op-ihom (op-ihom g β.βi op-ihom f) icat-opi-on .idli f = ap op-ihom (β.idri _) icat-opi-on .idri f = ap op-ihom (β.idli _) icat-opi-on .associ f g h = ap op-ihom (sym (β.associ _ _ _)) icat-opi-on .idi-nat Ο = op-ihom-nat (β.idi _) Ο β ap op-ihom (β.idi-nat Ο) icat-opi-on .βi-nat f g Ο = op-ihom-nat (op-ihom g β.βi op-ihom f) Ο β ap op-ihom ((β.βi-nat (op-ihom g) (op-ihom f) Ο) β apβ β._βi_ (op-ihom-nat g Ο) (op-ihom-nat f Ο)) _^opi : Internal-cat β Internal-cat β ^opi = op-icat where open Internal-cat op-icat : Internal-cat op-icat .Cβ = β .Cβ op-icat .Cβ = β .Cβ op-icat .src = β .tgt op-icat .tgt = β .src op-icat .has-internal-cat = Internal-cat-on-opi (β .has-internal-cat) infixl 60 _^opi