module Cat.Site.Grothendieck where

Grothendieck sitesπŸ”—

A Grothendieck topology on a category is function assigning to each a predicate on the sieves on satisfying the closure properties of sites. Every topology generates a coverage (where the space of sieves that cover is the total space of and, conversely, every site can be saturated to give a topology.

record Topology {o β„“} (C : Precategory o β„“) β„“s : Type (o βŠ” β„“ βŠ” lsuc β„“s) where
  open Precategory C
  field
    covering : (U : ⌞ C ⌟) (R : Sieve C U) β†’ Type β„“s

  _β—€_ : (U : ⌞ C ⌟) (R : Sieve C U) β†’ Type β„“s
  _β—€_ = covering

  field
    has-is-prop : βˆ€ {U} {R : Sieve C U} β†’ is-prop (U β—€ R)

    stable
      : βˆ€ {U V} (h : Hom V U) {R : Sieve C U} (hr : U β—€ R)
      β†’ V β—€ (pullback h R)

    maximal
      : βˆ€ {U} {R : Sieve C U} β†’ id ∈ R β†’ U β—€ R

    local :
      βˆ€ {U} {R : Sieve C U} (hr : U β—€ R) {S : Sieve C U}
      β†’ (βˆ€ {V} (f : Hom V U) (hf : f ∈ R) β†’ V β—€ pullback f S)
      β†’ U β—€ S

The main interest in defining this notion is that if we start with a topology demote it to a coverage and then saturate this coverage, we obtain a topology identical to the one we started with. Since many notions in sheaf theory speak of sieves belonging to the saturation of a coverage, if we know that we started with a topology, then we know that we truly haven’t added any β€œnew” coverings.

  from-topology : Coverage C _
  from-topology .covers U = βˆ«β‚š (U β—€_)
  from-topology .cover = fst
  from-topology .Site.stable (R , P) f = inc ((pullback f R , stable f P) , Ξ» h x β†’ x)

  unsaturate : βˆ€ {U} {R : Sieve C U} β†’ from-topology βˆ‹ R β†’ U β—€ R
  unsaturate = go where
    go : βˆ€ {U} {R : Sieve C U} β†’ from-topology βˆ‹ R β†’ U β—€ R
    go (Cl.inc (_ , Ξ±)) = Ξ±
    go (Cl.max x) = maximal x
    go (Cl.local s p) = local (go s) Ξ» f h β†’ go (p f h)
    go (Cl.pull h x) = stable h (go x)
    go (Cl.squash x y i) = has-is-prop (go x) (go y) i