module Cat.Site.Instances.Frame {o } (X : Poset o ) (isf : is-frame X) where

Frames as sites🔗

Since sites, as categories we can define sheaves on, are meant to axiomatise what it means for a category to have a notion of covering, we should expect that frames, as geometric objects, should admit the structure of a site.

This module shows that: for a frame thought of as the opens in a space, we say that the coverings for are the families with To interpret such a family as a sieve, we say that an object belongs if there exists an with this is the specialisation to partial orders of the sieve generated by a family of arrows.

private
  Covering :  X   Type _
  Covering U = Σ[ I  Type o ] Σ[ f  (I   X ) ] ( f  U)

  generate :  {U}  Covering U  Sieve (poset→category X) U
  generate (I , f , _) .arrows {V} _ = elΩ $ Σ[ i  I ] V  f i
  generate (I , f , _) .closed = rec! λ i α β  inc (i , ≤-trans β α)

For the stability property, we have to check that given a covering and a contained we can restrict to a covering of The answer is yes, and the process is leaving the index the same, and intersecting each part of the coverage with This works only because is a frame: essentially, if then the infinite distributive law gives us and this last meet, if is just so is a covering family for

  ∩-covering :  {U V}  V  U  Covering U  Covering V
  ∩-covering {U} {V} V≤U (I , f , p) = I , _ , cap-covers where abstract
    cap-covers :   i  f i  V)  V
    cap-covers =
        i  f i  V) ≡˘⟨ ⋃-distribr f V ≡˘
       f  V           ≡⟨ ap₂ _∩_ p refl 
      U  V             ≡⟨ ∩-comm  order→∩ V≤U 
      V                 

To show that these definitions fit together to give a Coverage, we must now show that, if is a covering family for then the intersection we computed above is contained in the pullback sieve We’ll actually do one better: the intersection we computed is the pullback sieve.

  generate-∩
    :  {U V} (h : V  U) (S : Covering U)
     generate (∩-covering h S)  pullback h (generate S)
  generate-∩ V≤U (I , f , p) = ext λ {W} W≤V  Ω-ua
    (rec! λ i W≤fi∩V  inc (i , ≤-trans W≤fi∩V ∩≤l))
    (rec! λ i W≤fi    inc (i , ∩-universal _ W≤fi W≤V))

Open-coverage : Coverage (poset→category X) (lsuc o)
Open-coverage .covers = Covering
Open-coverage .cover = generate
Open-coverage .stable {U} {V} S V≤U = inc (∩-covering V≤U S , incl) where
  incl : generate (∩-covering V≤U S)  pullback V≤U (generate S)
  incl g = subst (g ∈_) (generate-∩ V≤U S)

The open coverage on a frame enjoys the important property of being subcanonical, i.e. all of its covering sieves are pullback-stable colimits. This is essentially by definition: in the open coverage, a family over is covering if its union is i.e. if its colimit is Regardless, Agda will still ask that we do a bit of shuffling, and this is where our lemma for simplifying pullbacks comes in.

Open-coverage-is-subcanonical : is-subcanonical _ Open-coverage
Open-coverage-is-subcanonical {U} cov@(I , f , _) {V} V≤U = done where
  open make-is-colimit

  mk : make-is-colim (poset→category X) (generate (∩-covering V≤U cov))
  mk .ψ (elem W (W≤V , _)) = W≤V

In practical terms, all we have to show is that is the colimit of This computation is implicit in the definition of ∩-covering, so we may reuse that. In more details, we’re given an object and a witness that, for every for which there exists an with we have and we must show Since has a type with pretty complex quantification, we’ll write it out first:

  mk .universal {W} ε _ =
    let
      ε' :  {X}  X  V  ∃[ i  I ] X  f i  V  X  W
      ε' {X} α β = ε (elem X (α , (tr-□ β)))

Since is equal to the join it has the universal property of a join: to show for any it suffices to show that for every By we can reduce this to the two trivial conditions and After this, we can finish the proof by transitivity.

      pt :  i  f i  V  W
      pt i = ε' ∩≤r (inc (i , ≤-refl))
    in
      V                 =˘⟨ ∩-covering V≤U cov .snd .snd 
        i  f i  V) ≤⟨ ⋃-universal _ pt 
      W                 ≤∎

Commutativity, universality and uniqueness are all trivial in a poset, so is a colim sieve, which is almost what we wanted. The theorem is complete by transporting along our proof that

  mk .commutes _       = prop!
  mk .factors  _ _     = prop!
  mk .unique   _ _ _ _ = prop!

  done : is-colim (poset→category X) (pullback V≤U (generate cov))
  done = subst (is-colim (poset→category X)) (generate-∩ V≤U _) (to-is-colimitp mk refl)