module Cat.Instances.Sheaf.Limits.Finite
  {o  ℓj} {C : Precategory o } (J : Coverage C ℓj) where

Finite limits of sheaves🔗

Since the category of sheaves on a site is a reflective subcategory of we know automatically that it is closed — but using this theorem computes every limit, even the finite limits with known shape such as products and the terminal object, as an equaliser between maps to and from a very big product. To make working with finite limits of sheaves smoother, we specialise the proof that sheaves are closed under limits to these finite cases:

Sh[]-products : has-products (Sheaves J )
Sh[]-products (A , ashf) (B , bshf) = prod where
  prod' = PSh-products _ C A B

  prod : Product (Sheaves J _) _ _
  prod .apex .fst = prod' .apex
  prod .π₁ = prod' .π₁
  prod .π₂ = prod' .π₂
  prod .has-is-product .⟨_,_⟩  = prod' .⟨_,_⟩
  prod .has-is-product .π₁∘⟨⟩  = prod' .π₁∘⟨⟩
  prod .has-is-product .π₂∘⟨⟩  = prod' .π₂∘⟨⟩
  prod .has-is-product .unique = prod' .unique

  prod .apex .snd = is-sheaf-limit
    {F = 2-object-diagram _ _} {ψ = 2-object-nat-trans _ _}
    (is-product→is-limit (PSh  C) (prod' .has-is-product))
     { true  ashf ; false  bshf })

The terminal object in sheaves is even easier to define:

Sh[]-terminal : Terminal (Sheaves J )
Sh[]-terminal .top .fst = PSh-terminal _ C .top
Sh[]-terminal .has⊤ (S , _) = PSh-terminal _ C .has⊤ S

Sh[]-terminal .top .snd .whole _ _     = lift tt
Sh[]-terminal .top .snd .glues _ _ _ _ = refl
Sh[]-terminal .top .snd .separate _ _  = refl