open import Cat.Functor.Equivalence.Path
open import Cat.Instances.Shape.Terminal
open import Cat.Displayed.Bifibration
open import Cat.Displayed.Cocartesian
open import Cat.Displayed.Cartesian
open import Cat.Functor.Equivalence
open import Cat.Displayed.Fibre
open import Cat.Displayed.Total
open import Cat.Displayed.Base
open import Cat.Prelude

module Cat.Displayed.Instances.Trivial
  {o β„“} (π’ž : Precategory o β„“)

The Trivial BifibrationπŸ”—

Any category C\mathcal{C} can be regarded as being displayed over the terminal category ⊀\top.

Trivial : Displayed ⊀Cat o β„“
Trivial .Displayed.Ob[_] _ = Ob
Trivial .Displayed.Hom[_] _ = Hom
Trivial .Displayed.Hom[_]-set _ _ _ = Hom-set _ _
Trivial .Displayed.idβ€² = id
Trivial .Displayed._βˆ˜β€²_ = _∘_
Trivial .Displayed.idrβ€² = idr
Trivial .Displayed.idlβ€² = idl
Trivial .Displayed.assocβ€² = assoc

All morphisms in the trivial displayed category are vertical over the same object, so producing cartesian lifts is extremely easy: just use the identity morphism!

open Cartesian-fibration
open Cocartesian-fibration
open Cartesian-lift
open Cocartesian-lift

Trivial-fibration : Cartesian-fibration Trivial
Trivial-fibration .has-lift f yβ€² .xβ€² = yβ€²
Trivial-fibration .has-lift f yβ€² .lifting = id
Trivial-fibration .has-lift f yβ€² .cartesian = cartesian-id Trivial

We can use a similar line of argument to deduce that it is also an opfibration.

Trivial-opfibration : Cocartesian-fibration Trivial
Trivial-opfibration .has-lift f xβ€² .yβ€² =
Trivial-opfibration .has-lift f xβ€² .lifting = id
Trivial-opfibration .has-lift f xβ€² .cocartesian = cocartesian-id Trivial

Therefore, it is also a bifibration.

Trivial-bifibration : is-bifibration Trivial
Trivial-bifibration .is-bifibration.fibration = Trivial-fibration
Trivial-bifibration .is-bifibration.opfibration = Trivial-opfibration

Furthermore, the total category of the trivial bifibration is isomorphic to the category we started with.

trivial-total : Functor (∫ Trivial) π’ž
trivial-total .Fβ‚€ = snd
trivial-total .F₁ = preserves
trivial-total .F-id = refl
trivial-total .F-∘ _ _ = refl

trivial-total-iso : is-precat-iso trivial-total
trivial-total-iso .is-precat-iso.has-is-ff =
  is-iso→is-equiv $
    iso (total-hom tt)
        (Ξ» _ β†’ refl)
        (Ξ» _ β†’ total-hom-pathp Trivial refl refl refl refl)
trivial-total-iso .is-precat-iso.has-is-iso =
  is-iso→is-equiv $
    iso (tt ,_)
        (Ξ» _ β†’ refl)
        (Ξ» _ β†’ refl ,β‚š refl)

As the trivial bifibration only has one fibre, this fibre is also isomorphic to E\mathcal{E}.

trivial-fibre : Functor (Fibre Trivial tt) π’ž
trivial-fibre .Fβ‚€ x = x
trivial-fibre .F₁ f = f
trivial-fibre .F-id = refl
trivial-fibre .F-∘ _ _ = transport-refl _

trivial→fibre-iso : is-precat-iso trivial-fibre
trivial→fibre-iso .is-precat-iso.has-is-ff = id-equiv
trivial→fibre-iso .is-precat-iso.has-is-iso = id-equiv