module Cat.Displayed.Instances.Externalisation {o β} (B : Precategory o β) (β : Internal-cat B) where
open Cat.Reasoning B open Cat.Internal.Base B open Cat.Internal.Reasoning β open Cat.Internal.Morphism β open Displayed open Internal-hom
Externalisation of internal categoriesπ
Every internal category in gives rise to a fibration over known as the externalisation of The core idea is almost the same as that of the family fibration, but with playing the role of The space of objects over will be the generalised objects
Externalise : Displayed B β β Externalise = disp module Externalisation where disp : Displayed B β β disp .Ob[_] Ξ = Hom Ξ Cβ
Morphisms over are given by commuting diagrams of the following form:
The intuition here is that a generalized object can be seen as a family of morphisms in the internal category. To display one of these families over a map we simply precompose with the domain of the internal morphism; this yields something that mirrors the morphisms in the family fibration.
The identity morphism of families can almost be given by the identity morphism, though we run into definitional equality issues. A similar situation occurs for composition, though luckily these issues arenβt too hard to work around.
disp .Hom[_] u x y = Homi x (y β u) disp .Hom[_]-set _ _ _ = Internal-hom-set disp .id' = adjusti refl (sym (idr _)) (idi _) disp ._β'_ {f = u} {g = v} f g = adjusti refl (sym (assoc _ _ _)) (f [ v ] βi g)
Unfortunately, proof assistants make establishing the axioms fairly nasty. Associativity is especially bad.
disp .idr' f = Internal-hom-pathp refl (ap (_ β_) (idr _)) $ (f [ id ] βi adjusti _ _ (idi _)) .ihom β‘β¨ βi-ihom refl (idr _) (idr _) (idr _) refl β©β‘ (f βi idi _) .ihom β‘β¨ ap ihom (idri _) β©β‘ f .ihom β disp .idl' {f = u} f = Internal-hom-pathp refl (ap (_ β_) (idl _)) $ (adjusti _ _ (idi _) [ u ] βi f) .ihom β‘β¨ βi-ihom refl refl (ap (_β _) (idr _)) (ap ihom (idi-nat u)) refl β©β‘ (idi _ βi f) .ihom β‘β¨ ap ihom (idli _) β©β‘ f .ihom β disp .assoc' {w = a} {b} {c} {d} {f = u} {g = v} {h = w} f g h = Internal-hom-pathp refl (ap (_ β_) (assoc _ _ _)) $ (f [ v β w ] βi adjusti _ _ (g [ w ] βi h)) .ihom β‘β¨ βi-ihom refl refl refl refl (βi-ihom refl refl (sym (assoc _ _ _)) g-path refl) β©β‘ (f [ v β w ] βi g' βi h) .ihom β‘β¨ ap ihom (associ _ _ _) β©β‘ ((f [ v β w ] βi g') βi h) .ihom β‘β¨ βi-ihom refl refl reassoc inner refl β©β‘ (adjusti _ _ (f [ v ] βi g) [ w ] βi h) .ihom β where g' : Homi (b β w) (c β v β w) g' = coe1β0 (Ξ» i β Homi (b β w) (assoc c v w i)) (g [ w ]) g-path : g .ihom β w β‘ g' .ihom g-path = sym (transport-refl _) reassoc : (d β u) β (v β w) β‘ (d β u β v) β w reassoc = pulll (sym (assoc _ _ _)) inner : (f [ v β w ] βi g') .ihom β‘ (f [ v ] βi g) .ihom β w inner = (f [ v β w ] βi g') .ihom β‘β¨ βi-ihom refl (assoc _ _ _) (assoc _ _ _) (assoc _ _ _) (transport-refl _) β©β‘ ((f [ v ]) [ w ] βi g [ w ]) .ihom β‘Λβ¨ ap ihom (βi-nat (f [ v ]) g w) β©β‘Λ (f [ v ] βi g) .ihom β w β
Cartesian mapsπ
To really hammer home that point that the externalisation of an internal category is the internal version of the family fibration, we show that the cartesian morphisms are precisely the internal isomorphisms.
The forward direction looks almost identical to the proof that pointwise isomorphisms are cartesian morphisms in the family fibration.
internal-isoβcartesian : β {Ξ Ξ : Ob} {u : Hom Ξ Ξ} {x : Hom Ξ Cβ} {y : Hom Ξ Cβ} β (f : Homi x (y β u)) β is-invertiblei f β is-cartesian Externalise u f internal-isoβcartesian {Ξ} {Ξ} {u} {x} {y} f f-inv = cart where open is-cartesian module f-inv = is-invertiblei f-inv open f-inv using (invi) cart : is-cartesian _ _ _ cart .universal {u' = u'} m h' = invi [ m ] βi adjusti refl (assoc y u m) h' cart .commutes {u' = u'} m h' = Internal-hom-path $ (f [ m ] βi invi [ m ] βi _) .ihom β‘β¨ ap ihom (pullli (sym (βi-nat f invi m))) β©β‘ (β f βi invi β [ m ] βi _) .ihom β‘β¨ ap! f-inv.invli β©β‘ (β idi _ [ m ] β βi _) .ihom β‘β¨ ap! (idi-nat m) β©β‘ (idi _ βi _) .ihom β‘β¨ ap ihom (idli _) β©β‘ h' .ihom β cart .unique {u' = u'} {m = m} {h' = h'} m' p = Internal-hom-path $ m' .ihom β‘β¨ ap ihom (introli (Internal-hom-path (ap ihom (idi-nat m)))) β©β‘ (β idi _ [ m ] β βi m') .ihom β‘β¨ ap! (ap (Ξ» e β e [ m ]) (sym (f-inv.invri)) β βi-nat _ _ _) β©β‘ ((invi [ m ] βi f [ m ]) βi m') .ihom β‘β¨ ap ihom (pullri (Internal-hom-path (ap ihom p))) β©β‘ (invi [ m ] βi adjusti _ _ h') .ihom β
The reverse direction also mirrors the corresponding construction for the family fibration: we use the same trick of factoring the identity morphism.
cartesianβinternal-iso : β {Ξ Ξ : Ob} {u : Hom Ξ Ξ} {x : Hom Ξ Cβ} {y : Hom Ξ Cβ} β (f : Homi x (y β u)) β is-cartesian Externalise u f β is-invertiblei f cartesianβinternal-iso {Ξ} {Ξ} {u} {x} {y} f f-cart = f-inv where open is-cartesian f-cart open is-invertiblei open Inversesi open Externalisation f-inv : is-invertiblei f f-inv .invi = adjusti (ap (y β_) (idr u)) (idr x) (universal id (idi _)) f-inv .inversesi .invli = Internal-hom-path $ (f βi f-inv .invi) .ihom β‘β¨ βi-ihom (ap (_ β_) (sym (idr _))) (sym (idr _)) (sym (idr _)) (sym (idr _)) refl β©β‘ (f [ id ] βi universal id (idi _)) .ihom β‘β¨ ap ihom (commutes id (idi _)) β©β‘ idi (y β β u β id β) .ihom β‘β¨ ap! (idr _) β©β‘ idi (y β u) .ihom β f-inv .inversesi .invri = Internal-hom-path $ (f-inv .invi βi f) .ihom β‘β¨ βi-ihom refl refl (sym (idr _)) refl refl β©β‘ (adjusti _ _ (f-inv .invi) βi f) .ihom β‘β¨ ap ihom (unique (adjusti refl (sym (idr _)) (f-inv .invi) βi f) fβfβ»ΒΉβfβ‘f*) β©β‘ universal id (adjusti _ _ f) .ihom β‘Λβ¨ ap ihom (unique (adjusti refl (sym (idr _)) (idi _)) fβidβ‘f*) β©β‘Λ idi x .ihom β
The right inverse case needs some nightmare re-adjustments. Unfold this at your own risk!
where fβfβ»ΒΉβfβ‘f* : adjusti _ _ (f [ id ] βi adjusti _ _ (f-inv .invi) βi f) β‘ adjusti refl (ap (_ β_) (sym (idr _))) f fβfβ»ΒΉβfβ‘f* = Internal-hom-path $ (f [ id ] βi adjusti _ _ (f-inv .invi) βi f) .ihom β‘β¨ ap ihom (associ _ _ _) β©β‘ ((f [ id ] βi adjusti _ _ (f-inv .invi)) βi f) .ihom β‘β¨ βi-ihom refl (ap (y β_) (sym (idr _))) (sym (assoc _ _ _)) (βi-ihom (ap (y β_) (sym (idr _))) refl refl refl refl) refl β©β‘ (adjusti refl (sym (assoc _ _ _)) (f [ id ] βi universal id (idi _)) βi adjusti refl (ap (y β_) (sym (idr _))) f) .ihom β‘β¨ βi-ihom refl refl refl (ap ihom (commutes id (idi _))) refl β©β‘ (idi _ βi adjusti refl (ap (y β_) (sym (idr _))) f) .ihom β‘β¨ ap ihom (idli _) β©β‘ f .ihom β fβidβ‘f* : adjusti _ _ (f [ id ] βi adjusti _ _ (idi x)) β‘ adjusti _ _ f fβidβ‘f* = Internal-hom-path $ (f [ id ] βi adjusti _ _ (idi x)) .ihom β‘β¨ βi-ihom refl (idr _) (idr _) (idr _) refl β©β‘ (f βi idi _) .ihom β‘β¨ ap ihom (idri _) β©β‘ f .ihom β
Finally, we show that the externalisation is a fibration. As per usual, the argument proceeds in the same manner as for the family fibration. Given a generalized object and a morphism we can take the pullback of to be the lift of is then simply the (internal) identity morphism.
Externalisation-fibration : Cartesian-fibration Externalise Externalisation-fibration .Cartesian-fibration.has-lift u y = cart-lift where open Cartesian-lift cart-lift : Cartesian-lift Externalise u y cart-lift .x' = y β u cart-lift .lifting = idi _ cart-lift .cartesian .is-cartesian.universal m h' = adjusti refl (assoc _ _ _) h' cart-lift .cartesian .is-cartesian.commutes m h' = Internal-hom-path $ (β idi _ [ m ] β βi _) .ihom β‘β¨ ap! (idi-nat m) β©β‘ (idi _ βi _) .ihom β‘β¨ ap ihom (idli _) β©β‘ h' .ihom β cart-lift .cartesian .is-cartesian.unique {m = m} {h' = h'} m' p = Internal-hom-path $ m' .ihom β‘Λβ¨ ap ihom (idli _) β©β‘Λ (β idi _ β βi m') .ihom β‘β¨ ap! (sym (idi-nat m)) β©β‘ (idi _ [ m ] βi m') .ihom β‘β¨ ap ihom p β©β‘ h' .ihom β
Generic objectsπ
The externalisation is always globally small. We shall use the object of objects as the base for our generic object, and the identity morphism as the upstairs portion. Classifying maps in the base are given by interpreting using a object in the externalisation as a morphism in the base, and the displayed classifying map is the internal identity morphism, which is always cartesian.
Externalisation-globally-small : Globally-small Externalise Externalisation-globally-small = small where open Globally-small open Generic-object open is-cartesian small : Globally-small Externalise small .U = Cβ small .Gen = id small .has-generic-ob .classify x = x small .has-generic-ob .classify' x = adjusti refl (sym (idl _)) (idi _)
However, showing the internal identity morphism needs to be transported around a bit, so showing that it is cartesian requires some tedious calculations.
small .has-generic-ob .classify-cartesian x' .universal m h' = adjusti refl (idl _) h' small .has-generic-ob .classify-cartesian x' .commutes m h' = Internal-hom-path $ βi-ihom refl (sym (idl _)) (sym (assoc _ _ _)) (ap ihom (idi-nat _) β ap (Ξ» Ο β idi Ο .ihom) (sym (idl _))) refl β ap ihom (idli h') small .has-generic-ob .classify-cartesian x' .unique {m = m} m' p = Internal-hom-path $ sym (ap ihom (idli m')) Β·Β· βi-ihom refl refl (ap (_β m) (sym (idl _))) (sym (ap ihom (idi-nat m))) refl Β·Β· ap ihom p