module Cat.Site.Sheafification where

Sheafification🔗

Source

The higher-inductive construction of sheafification presented in this module is originally due to Matthias Hutzler, in code that was contributed to the cubical library. The cubical library is distributed under the terms of the MIT license, available here.

This module constructs the sheafification of a presheaf on relative to an arbitrary coverage on Abstractly, this is the left adjoint to the inclusion of sheaves on into presheaves on in concrete terms, this means that, given a presheaf we construct a and a map which is universal among maps from to sheaves.

Unlike traditional constructions in the literature (e.g. those found in (Johnstone 2002, C2.2.6; Mac Lane and Moerdijk 1994, chaps. V, 3.7; Stacks Project Authors 2018, 7.10)), which construct sheafifications by a two-step construction, working in cubical type theory lets us construct sheafifications all at once, using a higher inductive type. As usual when constructing left adjoints, this boils down to writing down an inductive type with constructors standing for all the “generators” and “relations” that the object must satisfy, then a bit of plumbing to establish the universal property in categorical terms.

While this construction might not be familiar to working mathematicians, we will see by, investigating each constructor in turn, that there is a very natural set of “generators” and “relations” that present the sheafification. Let us start with the generators: how can you construct an element of

First, admits a (universal) natural transformation from so we must have a constructor standing for that, namely inc. Second, must be a functor, so given and we have a constructor map standing for the restriction Finally, is a sheaf, so given any sieve we can glue together a patch with respect to living in

  data Sheafify₀ :  C   Type (o    ℓs  ℓc) where
    inc : A ʻ U  Sheafify₀ U

    map : (f : Hom U V)  Sheafify₀ V  Sheafify₀ U

    glue
      : (c : J .covers U) (p : pre.Parts C map (J .cover c))
       (g : pre.is-patch C map (J .cover c) p)
       Sheafify₀ U

Then, we come to the relations, which are defined as path constructors. First, we have constructors assuring that map is functorial, and that inc is a natural transformation:

    map-id :  x  map {U = U} id x  x
    map-∘  :  x  map (g  f) x  map f (map g x)

    inc-natural : (x : A ʻ U)  inc (A  f  x)  map f (inc x)

To ensure that is a sheaf, we have two constructors: one states that is separated for any sieve, and one states that the point obtained by glue really is a section of the given patch.

    sep
      :  {x y : Sheafify₀ U} (c : J .covers U)
       (l :  {V} (f : Hom V U) (hf : f  J .cover c)  map f x  map f y)
       x  y

    glues
      : (c : J .covers U) (p : pre.Parts C map (J .cover c))
       (g : pre.is-patch C map (J .cover c) p)
       pre.is-section C map (J .cover c) (glue c p g) p

Finally, we must tame all these generators for equality, by truncating to a set.

    squash : is-set (Sheafify₀ U)

By distributing the data above, we see that is indeed a functor (Sheafify), that it is separated, and that it is a sheaf.

  Sheafify : Functor (C ^op) (Sets (o    ℓs  ℓc))
  Sheafify .F₀ x .∣_∣ = Sheafify₀ x
  Sheafify .F₀ x .is-tr = squash
  Sheafify .F₁ = map
  Sheafify .F-id    = funext map-id
  Sheafify .F-∘ f g = funext map-∘

  Sheafify-is-sep : is-separated J Sheafify
  Sheafify-is-sep c = sep c

  Sheafify-is-sheaf : is-sheaf J Sheafify
  Sheafify-is-sheaf = from-is-separated Sheafify-is-sep λ c s  record
    { whole = glue c (s .part) (s .patch)
    ; glues = glues c (s .part) (s .patch)
    }

An induction principle🔗

It remains to prove the universal property of Showing existence of the natural transformation is easy, and showing that we can factors maps through when is a sheaf is similarly uncomplicated. However, showing uniqueness of this factorisation is slightly more complicated: we will need an induction principle for to tackle this problem in a sensible way.

Every higher-inductive type has a mechanically derivable eliminator into propositions, which lets us get a section of a proposition given only its values at the point constructor. But sheafifications have three point constructors: inc, map, and glue. Showing a proposition is preserved by map feels redundant, since functoriality feels like it should be automatic, and having to handle the glue constructor feels unnatural.

Hutzler shows us how to give a more natural elimination principle, which furthermore handles map automatically. We will assume that we have a family of propositions with sections over inc:

  Sheafify-elim-prop
    :  {ℓp} (P :  {U}  Sheafify₀ U  Type ℓp)
     (pprop :  {U} (x : Sheafify₀ U)  is-prop (P x))
     (pinc :  {U :  C } (x : A ʻ U)  P (inc x))

Instead of asking for over glue, we will ask instead that be local for any sieve. Explicitly, this means that we need to show for and a sieve but we’re allowed to assume that has already been shown for any restriction as long as

     (plocal
        :  {U :  C } (c : J .covers U) (x : Sheafify₀ U)
         (∀ {V} (f : Hom V U) (hf : f  J .cover c)  P (map f x))  P x)
      {U} (x : Sheafify₀ U)  P x

The key idea is to strengthen to the proposition “ holds at every restriction of ”; we will call this stronger proposition Since is its own restriction along the identity, it is clear that implies it is also automatic that is a family of propositions as well.

  Sheafify-elim-prop {ℓp} P pprop pinc plocal x = unp' (go x) where opaque
    P' :  {U} (x : Sheafify₀ U)  Type (o    ℓp)
    P' {U} x =  {V} (f : Hom V U)  P (map f x)

    unp' :  {U} {x : Sheafify₀ U}  P' x  P x
    unp' p' = subst P (map-id _) (p' id)

    p'prp :  {U} (x : Sheafify₀ U)  is-prop (P' x)
    p'prp x = Π-is-hlevel' 1 λ V  Π-is-hlevel 1 λ f  pprop (map f x)

We now turn to showing over every point constructor. First, it is preserved by map, by functoriality: in a bit more detail, suppose we have and we want to show Unfolding the definition of this means that we must show for any but our assumption means that we have for any Taking gives which is equal to our goal by functoriality.

    p'map :  {U V :  C } (f : Hom U V) (x : Sheafify₀ V)  P' x  P' (map f x)
    p'map f x p g = subst P (map-∘ _) (p (f  g))

Similarly, we can show for the inclusion of an at every restriction, by naturality of inc.

    p'inc :  {U :  C } (x : A ʻ U)  P' (inc x)
    p'inc x {V} f = subst P (inc-natural x) (pinc (A  f  x))

Finally, we must show that preserves the glue constructor. This is a bit more involved: suppose we have a sieve on and a patch over For our induction hypothesis, we assume for any We want to show given any

    p'glue
      :  {U :  C } (c : J .covers U) (p : pre.Parts C map (J .cover c))
       (g : pre.is-patch C map (J .cover c) p)
       (∀ {V} (f : Hom V U) (hf : f  J .cover c)  P' (p f hf))
       P' (glue c p g)

We will use the assumption that is local, at the pullback sieve which is since is a site: to show it will suffice to show this at every restriction along Since is a section of it becomes equal to after restricting along such a We have by assumption, and by the preceding observation, so we can finish by functoriality. This is a slightly tricky argument, so the formalisation may actually be easier to read:

    p'glue c p compat loc f = ∥-∥-out (pprop _) do
      (c' , sub)  J .stable c f
      pure $ plocal c' (map f (glue c p compat)) λ g hg 
        let
          it : P (map id (p (f  g) (sub g hg)))
          it = loc (f  g) (sub g hg) id
          q = map id (p (f  g) _)            ≡⟨ map-id _ 
              p (f  g) _                     ≡˘⟨ glues c p compat (f  g) (sub g hg) ≡˘
              map (f  g) (glue c p compat)   ≡⟨ map-∘ _ 
              map g (map f (glue c p compat)) 
        in subst P q it

The universal property🔗

Using the induction principle above, we may show the categorical universal property of However, at this stage, we must pay attention to the universe levels involved. Let us recap:

  • A site, as a category with a coverage is parametrised over three universe levels: one for the type of objects of one for and one for the collection of Finally, we can consider presheaves on valued in a completely arbitrary universe.

    The sheafification construction is fully general: the type simply lives in the least universe larger than all those that parametrise and

  • The functor category is parametrised by a universe level Among other things, this means that we can only really consider natural transformations between presheaves valued in the same universe level.

    Moreover, to get a Cartesian closed category of presheaves, must be small — its objects and must live in the same universe — and they must be valued in that same universe level.

In practice, this means that, while the construction of is parametrised over four universe levels, we only obtain a nice universal property if is some category, equipped with an coverage, and we are talking about presheaves valued in the category of sets. As a result, the sheafification functor qua left adjoint is only parametrised over this one universe level.

Returning to the construction, the universal natural transformation is easy to define:

  unit : A => Sheafify A
  unit .η _ = inc
  unit .is-natural x y f = funext inc-natural

And, if is a extending a map to a map is similarly straightforward. At each construction of we have a corresponding operation valued in deferring to for the inclusion of points from Similarly, the path constructors are all handled by the corresponding laws in

  univ : (B : Functor (C ^op) (Sets ))  is-sheaf J B  A => B  Sheafify A => B
  univ {A = A} G shf eta = nt where
    private module G = Psh G
    go :  U  Sheafify₀ A U  G ʻ U
    go U (inc x)   = eta .η U x
    go U (map f x) = G  f  (go _ x)
    go U (glue c p g) =
      shf .whole c record { patch = λ f hf h hhf i  go _ (g f hf h hhf i) }
We will leave the laws in this little <details> block, since they’re a tad uglier than the cases above. Note also that naturality of is a definitional equality.
    go U (map-id x i) = G.F-id {x = go _ x} i
    go U (map-∘ {g = g} {f = f} x i) = G.F-∘ f g {x = go _ x} i
    go U (inc-natural {f = f} x i) = eta .is-natural _ U f i x
    go U (sep {x = x} {y = y} c l i) = shf .separate c {go _ x} {go _ y}  f hf i  go _ (l f hf i)) i
    go U (glues c p g f hf i) = shf .is-sheaf.glues c record { patch = λ f hf h hhf i  go _ (g f hf h hhf i) } f hf i
    go U (squash x y p q i j) = G.₀ U .is-tr (go U x) (go U y)  i  go U (p i))  i  go U (q i)) i j

    nt : Sheafify A => G
    nt .η = go
    nt .is-natural x y f = refl

Finally, we can show that is the unique map which extends This is very straightforward with our induction principle for and the assumption that is a implies that equality in is

  unique
    : (G : Functor (C ^op) (Sets )) (shf : is-sheaf J G) (eta : A => G) (eps : Sheafify A => G)
     (∀ U (x : A ʻ U)  eps .η U (inc x)  eta .η U x)
     univ G shf eta  eps
  unique {A = A} G shf eta eps comm = ext λ i  Sheafify-elim-prop A
     {v} x  univ G shf eta .η v x  eps .η v x)
     {U} x  hlevel 1)
     x  sym (comm _ x))
     c x l  is-sheaf.separate shf c  f hf  l f hf  eps .is-natural _ _ _ # _))

References