module Cat.Displayed.Cartesian.Discrete where
open Cartesian-fibration
open Cartesian-lift
open is-cartesian
Discrete cartesian fibrations🔗
A discrete cartesian fibration or discrete fibration is a displayed category whose fibre categories are all discrete categories: thin, univalent groupoids. Since thin, univalent groupoids are sets, a discrete fibration over is an alternate way of encoding a presheaf over i.e., a functor Here, we identify a purely fibrational property that picks out the discrete fibrations among the displayed categories, without talking about the fibres directly.
A discrete cartesian fibration is a displayed category such that each type of displayed objects is a set, and such that, for each right corner
there is a contractible space of objects over equipped with maps
module _ {o ℓ o' ℓ'} {B : Precategory o ℓ} (E : Displayed B o' ℓ') where
private
module B = Cat.Reasoning B
module E = Displayed E
open Cat.Displayed.Reasoning E
open Cat.Displayed.Morphism E
open Displayed E
record is-discrete-cartesian-fibration : Type (o ⊔ ℓ ⊔ o' ⊔ ℓ') where
field
: ∀ x → is-set E.Ob[ x ]
fibre-set
cart-lift: ∀ {x y} (f : B.Hom x y) (y' : E.Ob[ y ])
→ is-contr (Σ[ x' ∈ E.Ob[ x ] ] E.Hom[ f ] x' y')
We will denote the canonical lift of to as
_^*_ : ∀ {x y} → (f : B.Hom x y) (y' : E.Ob[ y ]) → E.Ob[ x ]
= cart-lift f y' .centre .fst
f ^* y'
: ∀ {x y} → (f : B.Hom x y) (y' : E.Ob[ y ]) → E.Hom[ f ] (f ^* y') y'
π* = cart-lift f y' .centre .snd π* f y'
Basic properties of discrete cartesian fibrations🔗
Every hom set of a discrete fibration is a proposition.
: ∀ {x y x' y'} {f : B.Hom x y} → is-prop (Hom[ f ] x' y') Hom[]-is-prop
Let be a pair of morphisms in Both and are candidates for lifts of along so contractibility of lifts ensures that Moreover, the type of objects in forms a set, so we can conclude that
{x' = x'} {y' = y'} {f = f} f' f'' =
Hom[]-is-prop (fibre-set _) $
Σ-inj-set (cart-lift f y') (x' , f') (x' , f'') is-contr→is-prop
We can improve the previous result by noticing that morphisms give rise to proofs that
opaque
^*-lift: ∀ {x y x' y'}
→ (f : B.Hom x y)
→ Hom[ f ] x' y'
→ f ^* y' ≡ x'
{x' = x'} {y' = y'} f f' =
^*-lift .paths (x' , f') ap fst $ cart-lift f y'
We can further improve this to an equivalence between paths and morphisms
^*-hom: ∀ {x y x' y'}
→ (f : B.Hom x y)
→ f ^* y' ≡ x'
→ Hom[ f ] x' y'
{x' = x'} {y' = y'} f p =
^*-hom .idr f ] $
hom[ B(λ y' → Hom[ B.id ] x' y') (sym p) id'
π* f y' ∘' subst
^*-hom-is-equiv: ∀ {x y x' y'}
→ (f : B.Hom x y)
→ is-equiv (^*-hom {x' = x'} {y' = y'} f)
=
^*-hom-is-equiv f
is-iso→is-equiv $(^*-lift f)
iso (λ _ → Hom[]-is-prop _ _)
(λ _ → fibre-set _ _ _ _ _)
Functoriality of lifts🔗
The (necessarily unique) choice of lifts in a discrete fibration are contravariantly functorial.
^*-id: ∀ {x} (x' : Ob[ x ])
→ B.id ^* x' ≡ x'
^*-∘: ∀ {x y z}
→ (f : B.Hom y z) (g : B.Hom x y) (z' : Ob[ z ])
→ (f B.∘ g) ^* z' ≡ g ^* (f ^* z')
The proof here is rather slick. As noted earlier morphisms in a discrete fibration correspond to proofs that so it suffices to construct morphisms and resp. The former is given by the identity morphism, and the latter by composition of lifts!
= ^*-lift B.id id'
^*-id x' = ^*-lift (f B.∘ g) (π* f z' ∘' π* g (f ^* z')) ^*-∘ f g z'
Invertible maps in discrete cartesian fibrations🔗
Let be an invertible morphism of If is a discrete fibration, then every morphism displayed over is also invertible.
all-invertible[]: ∀ {x y x' y'} {f : B.Hom x y}
→ (f' : Hom[ f ] x' y')
→ (f⁻¹ : B.is-invertible f)
→ is-invertible[ f⁻¹ ] f'
Let be an invertible morphism, and be a morphism lying over Every hom set of is a proposition, so constructing an inverse only requires us to exhibit a map which in turn is given by a proof that This is easy enough to prove with a bit of algebra.
{x' = x'} {y' = y'} {f = f} f' f⁻¹ = f'⁻¹ where
all-invertible[] module f⁻¹ = B.is-invertible f⁻¹
open is-invertible[_]
: is-invertible[ f⁻¹ ] f'
f'⁻¹ .inv' =
f'⁻¹ .inv $
^*-hom f⁻¹.inv ^* x' ≡˘⟨ ap (f⁻¹.inv ^*_) (^*-lift f f') ⟩
f⁻¹.inv ^* (f ^* y') ≡˘⟨ ^*-∘ f f⁻¹.inv y' ⟩
f⁻¹(f B.∘ f⁻¹.inv) ^* y' ≡⟨ ap (_^* y') f⁻¹.invl ⟩
.id ^* y' ≡⟨ ^*-id y' ⟩
B
y' ∎.inverses' .Inverses[_].invl' =
f'⁻¹ (λ _ → Hom[]-is-prop) _ _
is-prop→pathp .inverses' .Inverses[_].invr' =
f'⁻¹ (λ _ → Hom[]-is-prop) _ _ is-prop→pathp
As an easy corollary, we get that all vertical maps in a discrete fibration are invertible.
all-invertible↓: ∀ {x x' y'}
→ (f' : Hom[ B.id {x} ] x' y')
→ is-invertible↓ f'
= all-invertible[] f' B.id-invertible all-invertible↓ f'
Cartesian maps in discrete fibrations🔗
Every morphism in a discrete fibration is cartesian. Every hom set in a discrete fibration is propositional, so we just need to establish the existence portion of the universal property.
all-cartesian: ∀ {x y x' y'} {f : B.Hom x y}
→ (f' : Hom[ f ] x' y')
→ is-cartesian E f f'
.commutes _ _ = Hom[]-is-prop _ _
all-cartesian f' .unique _ _ = Hom[]-is-prop _ _ all-cartesian f'
Suppose we have an open diagram
where is the unique lift of along We need to find a map By the usual yoga, it suffices to show that
Note that we can transform into a proof that and into a proof that Moreover, Putting this all together, we get:
{x' = x'} {y' = y'} {f = f} f' .universal {u' = u'} g h' =
all-cartesian
^*-hom g $(g ^*_) (^*-lift f f') ⟩
g ^* x' ≡˘⟨ ap (g ^* (f ^* y')) ≡˘⟨ ^*-∘ f g y' ⟩
(f B.∘ g) ^* y' ≡⟨ ^*-lift (f B.∘ g) h' ⟩
u' ∎
Discrete fibrations are cartesian🔗
To prove that discrete fibrations deserve the name discrete fibrations, we prove that any discrete fibration is a Cartesian fibration.
: is-discrete-cartesian-fibration → Cartesian-fibration E
discrete→cartesian = r where
discrete→cartesian disc open is-discrete-cartesian-fibration disc
: Cartesian-fibration E r
Luckily for us, the sea has already risen to meet us: by assumption, every right corner has a unique lift, and every morphism in a discrete fibration is cartesian.
.has-lift f y' .x' = f ^* y'
r .has-lift f y' .lifting = π* f y'
r .has-lift f y' .cartesian = all-cartesian (π* f y') r
Discrete fibrations are presheaves🔗
As noted earlier, a discrete fibration over encodes the same data as a presheaf on First, let us show that we can construct a presheaf from a discrete fibration.
module _ {o ℓ} (B : Precategory o ℓ) where
private
module B = Precategory B
discrete→presheaf: ∀ {o' ℓ'} (E : Displayed B o' ℓ')
→ is-discrete-cartesian-fibration E
→ Functor (B ^op) (Sets o')
{o' = o'} E disc = psh where
discrete→presheaf module E = Displayed E
open is-discrete-cartesian-fibration disc
For each object in
we take the set of objects
that lie over
The functorial action of f : Hom X Y
is then constructed by
taking the domain of the lift of f
. Functoriality follows
by uniqueness of the lifts.
: Functor (B ^op) (Sets o')
psh .Functor.F₀ X = el E.Ob[ X ] (fibre-set X)
psh .Functor.F₁ f X' = f ^* X'
psh .Functor.F-id = funext λ X' → ^*-id X'
psh .Functor.F-∘ {X} {Y} {Z} f g = funext λ X' → ^*-∘ g f X' psh
To construct a discrete fibration from a presheaf we take the (displayed) category of elements of This is a natural choice, as it encodes the same data as just rendered down into a soup of points and bits of functions. Discreteness follows immediately from the contractibilty of singletons.
presheaf→discrete: ∀ {κ} → Functor (B ^op) (Sets κ)
→ Σ[ E ∈ Displayed B κ κ ] is-discrete-cartesian-fibration E
{κ = κ} P = ∫ B P , discrete where
presheaf→discrete module P = Functor P
: is-discrete-cartesian-fibration (∫ B P)
discrete .is-discrete-cartesian-fibration.fibre-set X =
discrete .₀ X .is-tr
P.is-discrete-cartesian-fibration.cart-lift f P[Y] =
discrete (P.₁ f P[Y] , refl) Singleton-is-contr contr
We conclude by proving that the two maps defined above are, in fact, inverses. Most of the complexity is in characterising paths between displayed categories, but that doesn’t mean that the proof here is entirely trivial, either. Well, first, we note that one direction is trivial: modulo differences in the proofs of functoriality, which do not matter for identity, turning a functor into a discrete fibration and back is the identity.
open is-iso
: ∀ {κ} → is-iso (presheaf→discrete {κ = κ})
presheaf≃discrete .inv (d , f) = discrete→presheaf d f
presheaf≃discrete .linv x = Functor-path (λ _ → n-path refl) λ _ → refl presheaf≃discrete
The other direction is where the complication lies. Given a discrete fibration how do we show that Well, by the aforementioned characterisation of paths in displayed categories, it’ll suffice to construct a functor (lying over the identity), then show that this functor has an invertible action on objects, and an invertible action on morphisms.
.rinv (P , p-disc) = Σ-prop-path hl ∫≡dx where
presheaf≃discrete open is-discrete-cartesian-fibration p-disc
open Displayed-functor
open Displayed P
The functor will send an object to that same object This is readily seen to be invertible. But the action on morphisms is slightly more complicated. Recall that, since is a discrete fibration, every span has a contractible space of Cartesian lifts Our functor must, given objects a map and a proof that produce a map — so we can take the canonical and transport it over the given
: Displayed-functor (∫ B (discrete→presheaf P p-disc)) P Id
pieces .F₀' x = x
pieces .F₁' {f = f} {a'} {b'} x =
pieces (λ e → Hom[ f ] e b') x $ cart-lift f b' .centre .snd subst
This transport threatens to throw a spanner in the works, since it is an equation between objects (over But since is a discrete fibration, the space of objects over is a set, so this equation can’t ruin our day. Directly from the uniqueness of we conclude that we’ve put together a functor.
.F-id' =
pieces (λ _ → Hom[]-is-prop) _ _
is-prop→pathp .F-∘' {f = f} {g} {a'} {b'} {c'} {f'} {g'} =
pieces (λ _ → Hom[]-is-prop) _ _ is-prop→pathp
It remains to show that, given a map (and the rest of the data we can recover a proof that is the chosen lift But again, lifts are unique, so this is immediate.
: ∫ B (discrete→presheaf P p-disc) ≡ P
∫≡dx = Displayed-path pieces (λ _ → id-equiv) (is-iso→is-equiv p) where
∫≡dx : ∀ {a b} {f : B.Hom a b} {a'} {b'} → is-iso (pieces .F₁' {f = f} {a'} {b'})
p .inv f = ap fst $ cart-lift _ _ .paths (_ , f)
p .rinv p = from-pathp (ap snd (cart-lift _ _ .paths _))
p .linv p = fibre-set _ _ _ _ _ p
We must additionally show that the witness that is a discrete fibration will survive a round-trip through the type of presheaves, but this witness lives in a proposition (it is a pair of propositions), so it survives automatically.
private unquoteDecl eqv = declare-record-iso eqv (quote is-discrete-cartesian-fibration)
: ∀ x → is-prop _
hl = Iso→is-hlevel! 1 eqv hl x