module Cat.Instances.Sheaves.Omega {β} {C : Precategory β β} (J : Coverage C β) where
Closed sieves and the subobject classifierπ
The category of sheaves on a small site is a topos, which means that β in addition to finite limits and exponential objects β it has a subobject classifier, a sheaf which plays the role of the βuniverse of propositionsβ. We can construct the sheaf explicitly, as the sheaf of sieves.
A sieve is if it contains every morphism it covers. This notion is evidently closed under pullback, so the closed sieves form a presheaf on
is-closed : β {U} β Sieve C U β Type β is-closed {U} S = β {V} (h : Hom V U) β J β pullback h S β h β S abstract is-closed-pullback : β {U V} (f : Hom V U) (S : Sieve C U) β is-closed S β is-closed (pullback f S) is-closed-pullback f S c h p = c (f β h) (subst (J β_) (sym pullback-β) p)
private instance Extensional-closed-sieve : β {βr U} β¦ _ : Extensional (Sieve C U) βr β¦ β Extensional (Ξ£[ R β Sieve C U ] is-closed R) βr Extensional-closed-sieve β¦ e β¦ = injectionβextensional! Ξ£-prop-path! e
Ξ©J : Sheaf J β Ξ©J .fst = pre where pre : Functor (C ^op) (Sets β) pre .Fβ U = el! (Ξ£[ R β Sieve C U ] is-closed R) pre .Fβ f (R , c) = pullback f R , is-closed-pullback f R c pre .F-id = funext Ξ» _ β Ξ£-prop-path! pullback-id pre .F-β f g = funext Ξ» _ β Ξ£-prop-path! pullback-β
It remains to show that this is a sheaf. We start by showing that it is separated. Suppose we have two closed sieves which agree everywhere on some We want to show so fix some weβll show iff
Ξ©J .snd = from-is-separated sep mk where
It appears that we donβt know much about how and behave outside of their agreement on but knowing that theyβre closed will be enough to show that they agree everywhere. First, letβs codify that they actually agree on their intersection with
sep : is-separated J (Ξ©J .fst) sep {U} R {S , cS} {T , cT} Ξ± = ext Ξ» {V} h β let remβ : S β©S β¦ R β§ β‘ T β©S β¦ R β§ remβ = ext Ξ» {V} h β biimp (Ξ» (hβS , hβR) β cT h (subst (J β_) (ap fst (Ξ± h hβR)) (max (S .closed hβS id))) , hβR) (Ξ» (hβT , hβR) β cS h (subst (J β_) (ap fst (sym (Ξ± h hβR))) (max (T .closed hβT id))) , hβR)
Then, assuming w.l.o.g. that we know that the pullback is a covering sieve. And since is a subsieve of we conclude that if then is and since is closed, this implies also that
remβ : h β S β J β pullback h (S β©S β¦ R β§) remβ hβS = local (pull h (inc R)) Ξ» f hfβR β max ( S .closed hβS (f β id) , subst (_β R) (ap (h β_) (intror refl)) hfβR ) remβ' : h β S β J β pullback h T remβ' hβS = incl (Ξ» _ β fst) (subst (J β_) (ap (pullback h) remβ) (remβ hβS))
We omit the symmetric converse for brevity.
remβ : h β T β J β pullback h S remβ ht = incl (Ξ» _ β fst) (subst (J β_) (ap (pullback h) (sym remβ)) (local (pull h (inc R)) Ξ» f rfh β max (T .closed ht (f β id) , subst (_β R) (ap (h β_) (intror refl)) rfh)))
in biimp (Ξ» hβS β cT h (remβ' hβS)) (Ξ» hβT β cS h (remβ hβT))
Now we have to show that a family of compatible closed sieves over a sieve can be uniquely patched to a closed sieve on This is the sieve which is defined to contain whenever, for all in the part is the maximal sieve.
module _ {U : β C β} (R : J Κ» U) (S : Patch (Ξ©J .fst) β¦ R β§) where S' : Sieve C U S' .arrows {V} g = elΞ© $ β {W} (f : Hom W V) (hf : f β pullback g β¦ R β§) β β {V'} (i : Hom V' W) β i β S .part (g β f) hf .fst S' .closed = elim! Ξ» Ξ± h β inc Ξ» {W} g hf β subst (Ξ» e β β (h : e β R) {V'} (i : Hom V' W) β i β S .part e h .fst) (assoc _ _ _) (Ξ± (h β g)) hf
module _ {V W W'} (f : Hom V U) (hf : f β β¦ R β§) (g : Hom W V) (hfg : f β g β β¦ R β§) {h : Hom W' W} where lemma : h β S .part (f β g) hfg .fst β‘ (g β h) β S .part f hf .fst lemma = sym (ap (Ξ» e β β e .fst .arrows h β) (S .patch f hf g hfg)) module lemma = Equiv (pathβequiv lemma)
The first thing we have to show is that this pulls back to This is, as usual, a proof of biimplication, though in this case both directions are painful β and entirely mechanical β calculations.
restrict : β {V} (f : Hom V U) (hf : f β R) β pullback f S' β‘ S .part f hf .fst restrict f hf = ext Ξ» {V} h β biimp (rec! Ξ» Ξ± β let stepβ : id β S .part (f β h β id) (β¦ R β§ .closed hf (h β id)) .fst stepβ = substβ (Ξ» e e' β id β S .part e e' .fst) (pullr refl) (to-pathpβ» refl) (Ξ± id _ id) stepβ : ((h β id) β id) β S .part f hf .fst stepβ = lemma.to f hf (h β id) (β¦ R β§ .closed hf (h β id)) {id} stepβ in subst (Ξ» e β β S .part f hf .fst .arrows e β) (cancelr (idr _)) stepβ) (Ξ» hh β inc Ξ» {W} g hg {V'} i β S .part ((f β h) β g) hg .snd i (max let s1 : i β S .part (f β h β g) _ .fst s1 = lemma.from f hf (h β g) _ (subst (_β S .part f hf .fst) (assoc _ _ _) (S .part f hf .fst .closed hh (g β i))) q : PathP (Ξ» i β assoc f h g i β R) _ hg q = to-pathpβ» refl in transport (Ξ» j β β S .part (assoc f h g j) (q j) .fst .arrows (idr i (~ j)) β) s1))
Finally, we can use this to show that is closed.
abstract S'-closed : is-closed S' S'-closed {V} h hb = inc Ξ» {W} f hf {V'} i β S .part (h β f) hf .snd i $ let p = pullback (f β i) (pullback h S') β‘Λβ¨ pullback-β β©β‘Λ pullback (h β f β i) S' β‘β¨ restrict (h β f β i) (subst (_β R) (sym (assoc h f i)) (β¦ R β§ .closed hf i)) β©β‘ S .part (h β f β i) _ .fst β‘β¨ apβ (Ξ» e e' β S .part e e' .fst) (assoc h f i) (to-pathpβ» refl) β©β‘ S .part ((h β f) β i) _ .fst β‘Λβ¨ ap fst (S .patch (h β f) hf i (β¦ R β§ .closed hf i)) β©β‘Λ pullback i (S .part (h β f) hf .fst) β in subst (J β_) p (pull (f β i) hb)