module Cat.Displayed.Total
{o ℓ o' ℓ'} {B : Precategory o ℓ} (E : Displayed B o' ℓ') where
open Displayed E
open DR E
open DM E
open CR B
The total category of a displayed category🔗
So far, we’ve been thinking of displayed categories as “categories of structures” over some base category. However, it’s often useful to consider a more “bundled up” notion of structure, where the carrier and the structure are considered as a singular object. For instance, if we consider the case of algebraic structures, we often want to think about “a monoid” as a singular thing, as opposed to structure imposed atop some set.
Constructing the total category does exactly this. The objects are pairs of an object from the base, an object from the displayed category that lives over it.
Note that we use a sigma type here instead of a record for technical reasons: this makes it simpler to work with algebraic structures.
: Type (o ⊔ o')
Total = Σ[ Carrier ∈ B ] Ob[ Carrier ] Total
The situation is similar for morphisms: we bundle up a morphism from the base category along with a morphism that lives above it.
record Total-hom (X Y : Total) : Type (ℓ ⊔ ℓ') where
constructor total-hom
field
: Hom (X .fst) (Y .fst)
hom : Hom[ hom ] (X .snd) (Y .snd)
preserves
open Total-hom
As is tradition, we need to prove some silly lemmas showing that the bundled morphisms form an hset, and another characterizing the paths between morphisms.
: ∀ {X Y : Total} {f g : Total-hom X Y}
total-hom-path → (p : f .hom ≡ g .hom) → f .preserves ≡[ p ] g .preserves → f ≡ g
.hom = p i
total-hom-path p p' i {f = f} {g = g} p p' i .preserves = p' i total-hom-path
With all that in place, we can construct the total category!
: Precategory (o ⊔ o') (ℓ ⊔ ℓ')
∫ .Precategory.Ob = Total
∫ .Precategory.Hom = Total-hom
∫ .Precategory.Hom-set _ _ = hlevel 2
∫ .Precategory.id .hom = id
∫ .Precategory.id .preserves = id'
∫ .Precategory._∘_ f g .hom = f .hom ∘ g .hom
∫ .Precategory._∘_ f g .preserves = f .preserves ∘' g .preserves
∫ .Precategory.idr _ = total-hom-path (idr _) (idr' _)
∫ .Precategory.idl _ = total-hom-path (idl _) (idl' _)
∫ .Precategory.assoc _ _ _ = total-hom-path (assoc _ _ _) (assoc' _ _ _) ∫
Morphisms in the total category🔗
Isomorphisms in the total category of consist of pairs of isomorphisms in and
private module ∫E = CR ∫
: ∀ {x y} → x ∫E.≅ y → x .fst ≅ y .fst
total-iso→iso = make-iso
total-iso→iso f (∫E._≅_.to f .hom)
(∫E._≅_.from f .hom)
(ap hom $ ∫E._≅_.invl f)
(ap hom $ ∫E._≅_.invr f)
: ∀ {x y} → (f : x ∫E.≅ y) → x .snd ≅[ total-iso→iso f ] y .snd
total-iso→iso[] = make-iso[ total-iso→iso f ]
total-iso→iso[] f (∫E._≅_.to f .preserves)
(∫E._≅_.from f .preserves)
(ap preserves $ ∫E._≅_.invl f)
(ap preserves $ ∫E._≅_.invr f)
Pullbacks in the total category🔗
Pullbacks in the total category of have a particularly nice characterization. Consider the following pair of commuting squares.
If the bottom square is a pullback square, and both and are cartesian, then the upper square is a pullback in the total category of
cartesian+pullback→total-pullback: ∀ {p x y z p' x' y' z'}
→ {p₁ : Hom p x} {f : Hom x z} {p₂ : Hom p y} {g : Hom y z}
→ {p₁' : Hom[ p₁ ] p' x'} {f' : Hom[ f ] x' z'}
→ {p₂' : Hom[ p₂ ] p' y'} {g' : Hom[ g ] y' z'}
→ is-cartesian E p₁ p₁'
→ is-cartesian E g g'
→ (pb : is-pullback B p₁ f p₂ g)
→ (open is-pullback pb)
→ f' ∘' p₁' ≡[ square ] g' ∘' p₂'
→ is-pullback ∫
(total-hom p₁ p₁') (total-hom f f')
(total-hom p₂ p₂') (total-hom g g')
As the lower square is already a pullback, all that remains is constructing a suitable universal morphism in Luckily, is cartesian, so we can factorise maps in to obtain a map We then use the fact that is cartesian to show that the map we’ve constructed factorises maps as well. Uniqueness follows from the fact that is cartesian.
= total-pb where
cartesian+pullback→total-pullback p₁-cart g-cart pb square' open is-pullback
open Total-hom
module p₁' = is-cartesian p₁-cart
module g' = is-cartesian g-cart
: is-pullback ∫ _ _ _ _
total-pb .square = total-hom-path (pb .square) square'
total-pb .universal {a , a'} {p₁''} {p₂''} p =
total-pb (pb .universal (ap hom p))
total-hom (p₁'.universal' (pb .p₁∘universal) (p₁'' .preserves))
.p₁∘universal =
total-pb (pb .p₁∘universal) (p₁'.commutesp _ _)
total-hom-path .p₂∘universal {p = p} =
total-pb (pb .p₂∘universal) $
total-hom-path .uniquep₂ _ _ _ _ _
g'(pulll[] _ (symP square')
_ (p₁'.commutesp (pb .p₁∘universal) _))
∙[] pullr[] (symP $ ap preserves p)
.unique p q =
total-pb (pb .unique (ap hom p) (ap hom q)) $
total-hom-path .uniquep _ _ (pb .p₁∘universal) _ (ap preserves p) p₁'
We can also show the converse, provided that is a fibration.
cartesian+total-pullback→pullback: ∀ {p x y z p' x' y' z'}
→ {p₁ : Hom p x} {f : Hom x z} {p₂ : Hom p y} {g : Hom y z}
→ {p₁' : Hom[ p₁ ] p' x'} {f' : Hom[ f ] x' z'}
→ {p₂' : Hom[ p₂ ] p' y'} {g' : Hom[ g ] y' z'}
→ Cartesian-fibration E
→ is-cartesian E p₁ p₁'
→ is-cartesian E g g'
→ is-pullback ∫
(total-hom p₁ p₁') (total-hom f f')
(total-hom p₂ p₂') (total-hom g g')
→ is-pullback B p₁ f p₂ g
As we already have a pullback in the total category, the crux will be constructing enough structure in so that we can invoke the universal property of the pullback. We can do this by appealing to the fact that is a fibration, which allows us to lift morphisms in the base to obtain a cone in From here, we use the fact that and are cartesian to construct the relevant paths.
cartesian+total-pullback→pullback{p} {x} {y} {z}
{p₁ = p₁} {f} {p₂} {g} {p₁'} {f'} {p₂'} {g'} fib p₁-cart g-cart total-pb = pb where
open is-pullback
open Total-hom
open Cartesian-fibration fib
module p₁' = is-cartesian p₁-cart
module g' = is-cartesian g-cart
: is-pullback B _ _ _ _
pb .square = ap hom (total-pb .square)
pb .universal {P} {p₁''} {p₂''} sq =
pb .universal
total-pb {p₁' = total-hom p₁'' (has-lift.lifting p₁'' _)}
{p₂' = total-hom p₂'' (g'.universal' (sym sq) (f' ∘' has-lift.lifting p₁'' _))}
(total-hom-path sq (symP (g'.commutesp (sym sq) _))) .hom
.p₁∘universal =
pb .p₁∘universal
ap hom $ total-pb .p₂∘universal =
pb .p₂∘universal
ap hom $ total-pb .unique {p = p} q r =
pb .unique
ap hom $ total-pb (total-hom-path q (p₁'.commutesp q _))
(total-hom-path r (g'.uniquep _ _ (sym $ p) _
(pulll[] _ (symP $ ap preserves (total-pb .square))
_ (p₁'.commutesp q _)))) ∙[] pullr[]