module Cat.Instances.Slice.Presheaf {o ℓ} {C : Precategory o ℓ} where
Slices of presheaf categories🔗
We prove that slices of a presheaf category are again presheaf categories. Specifically, for a presheaf, we have an isomorphism where denotes the category of elements of
private
variable κ : Level
module C = Precategory C
open Precategory
open Element-hom
open Element
open Functor
open /-Obj
open /-Hom
open _=>_
An object in the slice consists of a functor together with a natural transformation To transform this data into a functor observe that for each element in the fibre is a set. But why this choice in particular? Well, observe that is essentially the total space of — so that what we’re doing here is proving an equivalence between fibrations and dependent functions! This is in line with the existence of object classifiers, and in the 1-categorical level, with slices of Sets.
In fact, since we have that latter equivalence is a special case of the one constructed here — where in the calculation below, denotes the constant presheaf The category of elements of a presheaf consists of pairs where of which there is only one choice, and
module _ {P : Functor (C ^op) (Sets κ)} where
private module P = Functor P
slice-ob→presheaf: Ob (Slice Cat[ C ^op , Sets κ ] P)
→ Functor (∫ C P ^op) (Sets κ)
.F₀ (elem x s) = el! (fibre (sl .map .η x) s)
slice-ob→presheaf sl
.F₁ eh (i , p) =
slice-ob→presheaf sl .domain .F₁ (eh .hom) i
sl (sl .map .is-natural _ _ _) _ ·· ap (P.₁ _) p ·· eh .commute , happly
.F-id =
slice-ob→presheaf sl λ x → Σ-prop-path! (happly (sl .domain .F-id) _)
funext .F-∘ f g =
slice-ob→presheaf sl λ x → Σ-prop-path! (happly (sl .domain .F-∘ _ _) _)
funext
private abstract
lemma: ∀ (y : Functor (∫ C P ^op) (Sets κ))
{o o'} {s} {s'} {el : y ʻ (elem o s)}
{f : C .Hom o' o} (p : P .F₁ f s ≡ s')
→ subst (λ e → y ʻ elem o' e) p (y .F₁ (elem-hom f refl) el)
.F₁ (elem-hom f p) el
≡ y {o = o} {o' = o'} {el = it} {f = f} =
lemma y (λ s' p → subst (λ e → y ʻ (elem o' e)) p (y .F₁ (elem-hom f refl) it)
J .F₁ (elem-hom f p) it)
≡ y (transport-refl _)
Keeping with the theme, in the other direction, we take a total space
rather than a family of fibres, with fibration being the first
projection fst
:
: Functor (∫ C P ^op) (Sets κ) → Ob (Slice Cat[ C ^op , Sets κ ] P)
presheaf→slice-ob = obj where
presheaf→slice-ob y : /-Obj {C = Cat[ _ , _ ]} P
obj .domain .F₀ c .∣_∣ = Σ[ sect ∈ P ʻ c ] y ʻ elem c sect
obj .domain .F₀ c .is-tr = hlevel 2
obj .domain .F₁ f (x , p) = P.₁ f x , y .F₁ (elem-hom f refl) p
obj .map .η x = fst obj
.domain .F-id {ob} = funext λ { (x , p) → Σ-path (happly (P.F-id) x) (lemma y _ ∙ happly (y .F-id) _) }
obj .domain .F-∘ f g = funext λ { (x , p) →
obj (happly (P.F-∘ f g) x)
Σ-path ( lemma y _
(λ e → y .F₁ (elem-hom (g C.∘ f) e) p) (P.₀ _ .is-tr _ _ _ _)
·· ap (y .F-∘ (elem-hom f refl) (elem-hom g refl)) _) }
·· happly .map .is-natural _ _ _ = refl obj
Since the rest of the construction is routine calculation, we present it without comment.
: Functor (Slice Cat[ C ^op , Sets κ ] P) Cat[ (∫ C P) ^op , Sets κ ]
slice→total = func where
slice→total : Functor (Slice Cat[ C ^op , Sets κ ] P) Cat[ (∫ C P) ^op , Sets κ ]
func .F₀ = slice-ob→presheaf
func .F₁ {x} {y} h .η i arg =
func .map .η (i .ob) (arg .fst) , h .commutes ηₚ _ $ₚ arg .fst ∙ arg .snd
h .F₁ {x} {y} h .is-natural _ _ _ = funext λ i →
func (happly (h .map .is-natural _ _ _) _)
Σ-prop-path!
.F-id = ext λ x y p → Σ-prop-path! refl
func .F-∘ f g = ext λ x y p → Σ-prop-path! refl
func
: is-fully-faithful slice→total
slice→total-is-ff {x} {y} = is-iso→is-equiv (iso inv rinv linv) where
slice→total-is-ff : Hom Cat[ ∫ C P ^op , Sets _ ] _ _
inv → Slice Cat[ C ^op , Sets _ ] P .Hom _ _
.map .η i o = nt .η (elem _ (x .map .η i o)) (o , refl) .fst
inv nt
.map .is-natural _ _ f = funext λ z →
inv nt (λ e → nt .η _ e .fst) (Σ-prop-path! refl)
ap (happly (nt .is-natural _ _
∙ ap fst (elem-hom f (happly (sym (x .map .is-natural _ _ _)) _))) _)
.commutes = ext λ z w →
inv nt .η (elem _ (x .map .η _ _)) (w , refl) .snd
nt
: is-right-inverse inv (F₁ slice→total)
rinv = ext λ where
rinv nt → Σ-prop-path! λ i →
o z p .η (elem (o .ob) (p i)) (z , λ j → p (i ∧ j)) .fst
nt
: is-left-inverse inv (F₁ slice→total)
linv = trivial!
linv sh
open is-precat-iso
: is-precat-iso slice→total
slice→total-is-iso .has-is-ff = slice→total-is-ff
slice→total-is-iso .has-is-iso = is-iso→is-equiv isom where
slice→total-is-iso open is-iso
: is-iso slice-ob→presheaf
isom .inv = presheaf→slice-ob isom
Proving that the constructions presheaf→slice-ob
and slice-ob→presheaf
are inverses is mosly
incredibly fiddly path algebra, so we omit the proof.
.rinv x =
isom
Functor-path(λ i → n-ua (Fibre-equiv (λ a → x ʻ elem (i .ob) a) (i .section)))
λ f → ua→ λ { ((a , b) , p) → path→ua-pathp _ (lemma x _ ∙ lemma' _ _ _) }
where abstract
lemma': ∀ {o o'} {sect : P ʻ o .ob}
(f : Hom (∫ C P ^op) o o')
(b : x ʻ elem (o .ob) sect)
(p : sect ≡ o .section)
→ x .F₁ (elem-hom (f .hom) (ap (P.₁ (f .hom)) p ∙ f .commute)) b
.F₁ f (subst (λ e → x ʻ elem (o .ob) e) p b)
≡ x {o = o} {o' = o'} f b p =
lemma' (λ _ p → ∀ f b → x .F₁ (elem-hom (f .hom) (ap (P.₁ (f .hom)) p ∙ f .commute)) b
J .F₁ f (subst (λ e → x ʻ elem (o .ob) e) p b))
≡ x (λ f b → ap₂ (x .F₁) (ext refl) (sym (transport-refl b)))
p f b
.linv x =
isom
/-Obj-path(Functor-path (λ x → n-ua (Total-equiv _ e⁻¹))
λ f → ua→ λ a → path→ua-pathp _ refl)
(Nat-pathp _ _ (λ x → ua→ (λ x → sym (x .snd .snd))))
-- downgrade to an equivalence for continuity/cocontinuity
: is-equivalence slice→total
slice→total-is-equiv = is-precat-iso→is-equivalence slice→total-is-iso
slice→total-is-equiv
: Functor Cat[ (∫ C P) ^op , Sets κ ] (Slice Cat[ C ^op , Sets κ ] P)
total→slice = slice→total-is-equiv .is-equivalence.F⁻¹ total→slice