module Cat.Site.Base where

Sites and sheavesπŸ”—

Sheaf theory is a particular formalisation of the idea that global structure on a complicated object is often best studied at its restrictions to simpler parts which glue to recover It’s particularly general, in the sense that the objects can belong to an arbitrary category as long as we equip with structure (called a coverage) determining what we mean by glue together β€” and as long as our global structure is fine living at the level of sets.

Source

Most of our material on sheaf theory is adapted from the Elephant (2002), specifically chapter C2.

To make these ideas concrete, we will fix a category of objects we want to study, and we will denote its objects by letters like and The structures we will be interested in will all take the form of presheaves on β€” functors into the category If we have any family of maps and an element then functorial action ensures that we can restrict along the to obtain elements

A representative example is when is the frame underlying some locale and the elements are such that This setup has the particular geometric interpretation of expressing as a union of smaller parts. Extending this intuition, we would consider our original to be the global information, and the restrictions to be information local to a given sub-part of the whole

So far, we have said nothing new: this is simply functoriality. The interesting question is going the other way: if we have the local information can we glue them together to get the global information We can’t always: this might be a failure of the functor1, or of the While it might be a bit disheartening that there are notions of β€œinformation” which can not be put together locally, these failures tell us that we have a fruitful concept at hand.

First, assuming that our are all restrictions of some we should investigate the properties it must have: these will tell us what properties we should impose on local data to ensure it has a chance of gluing to a The key property is, once again, functoriality β€” but it also has a geometric interpretation. Suppose we have two objects and drawn from our family, and some arbitrary third object and they fit into a commutative diagram like

If we are still thinking about then could simply be the intersection and the diagram commutes automatically. In any case, we have two ways of restricting to the intersection namely and By functoriality, we have

so that, if our β€œlocal” data comes from restricting β€œglobal” data, the local restrictions automatically agree on intersections. We thus have defined what it means to have local data with respect to a family of morphisms (which we think of as expressing their common codomain as being β€œglued together”), and what it means for that data to glue to give local data.

We could carry on and define sheaves from here, but we will make one final simplifying assumption: Instead of considering families of morphisms with common codomain, we will consider sieves in This lets us simplify the notion of compatibility: we now have values of at arbitrary composites of the so that it suffices to demand

Terminology for local dataπŸ”—

To formalise the notion of sheaf, we will need to introduce names for the ideas we’ve sketched out so far. First, if we are given a sieve we will refer to a family of elements as a family of parts. If these parts satisfy the compatibility condition defined above, relative to the sieve we will say they are a patch. The geometric intuition is key here: the are to be the literal parts of some hypothetical and they’re a patch if they agree on the β€œintersections”

  Parts : βˆ€ {U} (T : Sieve C U) β†’ Type _
  Parts {U} T = βˆ€ {V} (f : Hom V U) (hf : f ∈ T) β†’ Aβ‚€ V

  is-patch : βˆ€ {U} (T : Sieve C U) (p : Parts T) β†’ Type _
  is-patch {U} T part =
    βˆ€ {V W} (f : Hom V U) (hf : f ∈ T) (g : Hom W V) (hgf : f ∘ g ∈ T)
    β†’ A₁ g (part f hf) ≑ part (f ∘ g) hgf

Finally, if we have a family of parts, then we say that an element is a section of these parts if its restriction along each agrees with the part

  is-section : βˆ€ {U} (T : Sieve C U) β†’ Aβ‚€ U β†’ Parts T β†’ Type _
  is-section {U = U} T s p =
    βˆ€ {V} (f : Hom V U) (hf : f ∈ T)
    β†’ A₁ f s ≑ p f hf

We will most often consider parts-which-are-patches, so we introduce a record type to bundle them; similarly, we will consider elements-which-are-sections, so they also get a record type.

  record Patch {U} (T : Sieve C U) : Type (o βŠ” β„“ βŠ” β„“s) where
    no-eta-equality
    field
      part  : Parts T
      patch : is-patch T part
  record Section {U} {T : Sieve C U} (p : Patch T) : Type (o βŠ” β„“ βŠ” β„“s) where
    no-eta-equality
    field
      {whole} : A Κ» U
      glues   : is-section whole p
module _ {o β„“ β„“s} {C : Precategory o β„“} {A : Functor (C ^op) (Sets β„“s)} where
  open Cat C
  open Section
  open Patch
  private module A = Psh A
  open pre C A.₁ hiding (is-section) public

  instance
    Extensional-Patch
      : βˆ€ {U β„“r} {S : Sieve C U} ⦃ _ : Extensional (Parts S) β„“r ⦄
      β†’ Extensional (Patch A S) β„“r
    Extensional-Patch ⦃ e ⦄ .Pathᡉ x y = e .Pathᡉ (x .part) (y .part)
    Extensional-Patch ⦃ e ⦄ .reflᡉ x = e .reflᡉ (x .part)
    Extensional-Patch ⦃ e ⦄ .idsᡉ .to-path p i .part = e .idsᡉ .to-path p i
    Extensional-Patch ⦃ e ⦄ .idsᡉ .to-path {x} {y} p i .patch {W = W} f hf g hgf =
      is-propβ†’pathp (Ξ» i β†’ A.β‚€ W .is-tr (A.₁ g (e .idsᡉ .to-path p i _ hf)) (e .idsᡉ .to-path p i _ hgf))
        (x .patch f hf g hgf) (y .patch f hf g hgf) i
    Extensional-Patch ⦃ e ⦄ .idsᡉ .to-path-over p = is-propβ†’pathp (Ξ» i β†’ Pathᡉ-is-hlevel 1 e (hlevel 2)) _ _

    Extensional-Section
      : βˆ€ {U β„“r} {S : Sieve C U} {p : Patch A S} ⦃ _ : Extensional (A Κ» U) β„“r ⦄
      β†’ Extensional (Section A p) β„“r
    Extensional-Section ⦃ e ⦄ .Pathᡉ x y = e .Pathᡉ (x .whole) (y .whole)
    Extensional-Section ⦃ e ⦄ .reflᡉ x = e .reflᡉ (x .whole)
    Extensional-Section ⦃ e ⦄ .idsᡉ .to-path p i .whole = e .idsᡉ .to-path p i
    Extensional-Section {p = p} ⦃ e ⦄ .idsᡉ .to-path {a} {b} q i .glues {V} f hf =
      is-propβ†’pathp (Ξ» i β†’ A.β‚€ V .is-tr (A.₁ f (e .idsᡉ .to-path q i)) (p .part f hf))
        (a .glues f hf) (b .glues f hf) i
    Extensional-Section ⦃ e ⦄ .idsᡉ .to-path-over p = is-propβ†’pathp (Ξ» i β†’ Pathᡉ-is-hlevel 1 e (hlevel 2)) _ _

  subset→patch
    : βˆ€ {U} {S S' : Sieve C U}
    β†’ S' βŠ† S
    β†’ Patch A S
    β†’ Patch A S'
  subset→patch incl p .part f hf = p .part f (incl f hf)
  subset→patch incl p .patch f hf g hgf = p .patch f _ g _

  pullback-patch : βˆ€ {U V} {S : Sieve C U} (f : Hom V U) β†’ Patch A S β†’ Patch A (pullback f S)
  pullback-patch {S = S} f s .part g p = s .part (f ∘ g) p
  pullback-patch {S = S} f s .patch g h hfg hfgh =
      s .patch (f ∘ g) h hfg (S .closed h hfg)
    βˆ™ app s (pullr refl)

  open _=>_

  map-patch
    : βˆ€ {B : Functor (C ^op) (Sets β„“s)} {U} {S : Sieve C U} (eta : A => B)
    β†’ Patch A S
    β†’ Patch B S
  map-patch eta x .part f hf = eta .Ξ· _ (x .part f hf)
  map-patch eta x .patch f hf g hgf = sym (eta .is-natural _ _ _ $β‚š _) βˆ™ ap (eta .Ξ· _) (x .patch f hf g hgf)

Finally, we will formalise the idea that any global information can be made into a bunch of local pieces by restricting functorially.

  sectionβ†’patch : βˆ€ {U} {T : Sieve C U} β†’ A Κ» U β†’ Patch A T
  sectionβ†’patch x .part  f _ = A βŸͺ f ⟫ x
  section→patch x .patch f hf g hgf = A.collapse refl

  section→section
    : βˆ€ {U} {T : Sieve C U} (u : A Κ» U)
    → Section A {T = T} (section→patch u)
  section→section u .whole      = u
  section→section u .glues f hf = refl

The notion of sheafπŸ”—

Using our terminology above, we can very concisely define what it means for a functor to be a sheaf, at least with respect to a sieve on any patch of has a unique section. Thinking intuitively, satisfying the sheaf condition for a sieve means that each arises uniquely as the gluing of some patch

  is-sheaf₁ : βˆ€ {U} (T : Sieve C U) β†’ Type _
  is-sheaf₁ T = (p : Patch A T) β†’ is-contr (Section A p)

We will also need the notion of separated presheaf. These are typically defined to be the presheaves which have at most one section for each patch: the type of sections for each patch is a proposition, instead of being contractible.

But from a type-theoretic perspective, it makes more sense to define separated presheaves in the following β€œunfolded” form, which says that that equality on is a property.

  is-separated₁ : βˆ€ {U} (T : Sieve C U) β†’ Type _
  is-separated₁ {U} T =
    βˆ€ {x y : A Κ» U}
    β†’ (βˆ€ {V} (f : Hom V U) (hf : f ∈ T) β†’ A βŸͺ f ⟫ x ≑ A βŸͺ f ⟫ y)
    β†’ x ≑ y

Note that every sheaf is indeed separated, even after this unfolding, using the above mapping from elements to sections. The assumption of β€œ equality” is exactly what we need to assure that is also a section of the patch generated by restricting

  is-sheaf₁→is-separated₁ : βˆ€ {U} (T : Sieve C U) β†’ is-sheaf₁ T β†’ is-separated₁ T
  is-sheaf₁→is-separated₁ T sheaf {x} {y} lp = ap whole $
    let
      sec₁ : Section A (sectionβ†’patch x)
      sec₁ = sectionβ†’section x

      sec₂ : Section A (section→patch x)
      secβ‚‚ = record
        { whole = y
        ; glues = Ξ» f hf β†’
          A βŸͺ f ⟫ y β‰‘Λ˜βŸ¨ lp f hf βŸ©β‰‘Λ˜
          A βŸͺ f ⟫ x ∎
        }
    in is-contrβ†’is-prop (sheaf (sectionβ†’patch x)) sec₁ secβ‚‚

Sites, formallyπŸ”—

Up until now, we have only been considering single sieves when defining parts, patches, sections and sheaves. But a given category, even the opens of a locale, will generally have many distinct sieves on which could equally well be taken to be decompositions of . We would like a sheaf β€œon ” to have the local-to-global property for all of these decompositions, but we need to impose some order to make sure that we end up with a well-behaved category of sheaves.

We define a coverage on to consist of, for each a family of covering sieves on Translating this into type theory, for each we have a type of β€œ of ”, and, for each we have an associated sieve on

record Coverage {o β„“} (C : Precategory o β„“) β„“c : Type (o βŠ” β„“ βŠ” lsuc β„“c) where
  no-eta-equality

  open Precategory C

  field
    covers : ⌞ C ⌟ β†’ Type β„“c
    cover  : βˆ€ {U} β†’ covers U β†’ Sieve C U

The must satisfy the following stability property: if is some covering sieve, and is an arbitrary morphism, then there merely exists a covering sieve which is contained in the pullback sieve The quantifier complexity for this statement is famously befuddling, but stating it in terms of sieves does simplify the formalisation:

    stable
      : βˆ€ {U V : ⌞ C ⌟} (R : covers U) (f : Hom V U)
      β†’ βˆƒ[ S ∈ covers V ] (cover S βŠ† pullback f (cover R))

Thinking back to the case of we can equip any frame with a coverage. The stability condition, in that case, reduces to showing that, if a family has all of as its union, then the family has as its union.

Finally, we (re-)define separated presheaves and sheaves with respect to a coverage For separated presheaves, we can simply reuse the definition given above, demanding it for every sieve. But for sheaves, formalisation concerns lead us to instead define an β€œunpacked” record type:

  is-separated : Type _
  is-separated = βˆ€ {U : ⌞ C ⌟} (c : J # U) β†’ is-separated₁ A (J .cover c)

  record is-sheaf : Type (o βŠ” β„“ βŠ” β„“s βŠ” β„“c) where
    no-eta-equality
    field
      whole   : βˆ€ {U} (S : J .covers U) (p : Patch A (J .cover S)) β†’ A Κ» U
      glues   : βˆ€ {U} (S : J .covers U) (p : Patch A (J .cover S)) β†’ is-section A (whole S p) p
      separate : is-separated

This splitting of the sheaf condition into an operation and laws will help us in defining sheafifications later on. We can package the first two fields as saying that each patch has a section:

    split : βˆ€ {U} {S : J .covers U} (p : Patch A (J .cover S)) β†’ Section A p
    split p .Section.whole = whole _ p
    split p .Section.glues = glues _ p

  open is-sheaf using (whole ; glues ; separate) public

Note that, if a functor satisfies the sheaf condition for all sieves, it’s also a sheaf relative to quite a few other sieves: these are the closure properties of sites.

We will often refer to a category with a coverage as the site The first notion we define relative to sites is the category of sheaves on a site, the full subcategory of the presheaves on which are The nature of the sheaf condition ensures that inherits most of good categorical properties β€” we refer to it as the topos of sheaves.

  Sheaf : Type _
  Sheaf = Ξ£[ p ∈ Functor (C ^op) (Sets β„“s) ] is-sheaf J p

  Sheaves : Precategory (o βŠ” β„“ βŠ” β„“c βŠ” lsuc β„“s) (o βŠ” β„“ βŠ” β„“s)
  unquoteDef Sheaves = define-copattern Sheaves $
    Restrict {C = PSh β„“s C} (is-sheaf J)

  forget-sheaf : Functor Sheaves (PSh β„“s C)
  forget-sheaf .Fβ‚€ (S , _) = S
  forget-sheaf .F₁ f = f
  forget-sheaf .F-id = refl
  forget-sheaf .F-∘ f g = refl

  1. For a functor that is not a sheaf, consider the category

    and define a functor by sending to the unit set, both singleton sets to and the two-element set to the restriction mappings are the projections onto the first two factors.

    We will later see that, were a sheaf, the elements of would have their equality determined by their restrictions to and β€” but by this measure, and would have to be equal.β†©οΈŽ


References

  • Johnstone, Peter T. 2002. Sketches of an Elephant: a Topos Theory Compendium. Oxford Logic Guides. New York, NY: Oxford Univ. Press. https://cds.cern.ch/record/592033.