module Cat.Displayed.Instances.Elements {o β„“ s} (B : Precategory o β„“)
  (P : Functor (B ^op) (Sets s)) where

The displayed category of elementsπŸ”—

It is useful to view the category of elements of a presheaf P as a displayed category. Instead of considering pairs of objects and sections we instead think of the set of sections as displayed over The story is similar for morphisms; instead of taking pairs of morphisms and fragments of data that we place those fragments over the morphism

In a sense, this is the more natural presentation of the category of elements, as we obtain the more traditional definition by taking the total category of ∫.

∫ : Displayed B s s
∫ = with-thin-display record where
  Ob[_]            X = P Κ» X
  Hom[_] f P[X] P[Y] = P.₁ f P[Y] ≑ P[X]
  id' = happly P.F-id _
  _∘'_ {x = x} {y} {z} {f} {g} p q =
    P.₁ (f ∘ g) z   β‰‘βŸ¨ happly (P.F-∘ g f) z βŸ©β‰‘
    P.₁ g (P.₁ f z) β‰‘βŸ¨ ap (P.₁ g) p βŸ©β‰‘
    P.₁ g y         β‰‘βŸ¨ q βŸ©β‰‘
    x               ∎