module Cat.Displayed.TwoSided.Discrete where
Discrete two-sided fibrations🔗
Much like how discrete fibrations are presheaves, a discrete two-sided fibration is a displayed presentation of a profunctor.
A displayed category is a discrete two-sided fibration if:
module _
{oa ℓa ob ℓb oe ℓe}
{A : Precategory oa ℓa} {B : Precategory ob ℓb}
(E : Displayed (A ×ᶜ B) oe ℓe)
where
private
module A = Cat.Reasoning A
module B = Cat.Reasoning B
module A×B = Cat.Reasoning (A ×ᶜ B)
open Cat.Displayed.Reasoning E
open Cat.Displayed.Morphism E
open Displayed E
record is-discrete-two-sided-fibration : Type (oa ⊔ ℓa ⊔ ob ⊔ ℓb ⊔ oe ⊔ ℓe) where
- For every is a set.
field
: ∀ a b → is-set (Ob[ a , b ]) fibre-set
- For every and there exists a unique pair
field
cart-lift: ∀ {a₁ a₂ : A.Ob} {b : B.Ob}
→ (f : A.Hom a₁ a₂)
→ (y' : Ob[ a₂ , b ])
→ is-contr (Σ[ x' ∈ Ob[ a₁ , b ] ] Hom[ f , B.id ] x' y')
_^*_ : ∀ {a₁ a₂ : A.Ob} {b : B.Ob} → A.Hom a₁ a₂ → Ob[ a₂ , b ] → Ob[ a₁ , b ]
= cart-lift u y' .centre .fst
u ^* y'
π*: ∀ {a₁ a₂ : A.Ob} {b : B.Ob}
→ (u : A.Hom a₁ a₂)
→ (y' : Ob[ a₂ , b ])
→ Hom[ u , B.id ] (u ^* y') y'
= cart-lift u y' .centre .snd π* u y'
- For every and there exists a unique pair
field
cocart-lift: ∀ {a : A.Ob} {b₁ b₂ : B.Ob}
→ (f : B.Hom b₁ b₂)
→ (x' : Ob[ a , b₁ ])
→ is-contr (Σ[ y' ∈ Ob[ a , b₂ ] ] Hom[ A.id , f ] x' y')
_^!_ : ∀ {a : A.Ob} {b₁ b₂ : B.Ob} → B.Hom b₁ b₂ → Ob[ a , b₁ ] → Ob[ a , b₂ ]
= cocart-lift v x' .centre .fst
v ^! x'
ι!: ∀ {a : A.Ob} {b₁ b₂ : B.Ob}
→ (v : B.Hom b₁ b₂)
→ (x' : Ob[ a , b₁ ])
→ Hom[ A.id , v ] x' (v ^! x')
= cocart-lift v x' .centre .snd ι! v x'
- For every there exists a vertical map such that
field
vert-lift: ∀ {a₁ a₂ b₁ b₂ x y}
→ {u : A.Hom a₁ a₂} {v : B.Hom b₁ b₂}
→ (f : Hom[ u , v ] x y)
→ Hom[ A.id , B.id ] (v ^! x) (u ^* y)
factors: ∀ {a₁ a₂ b₁ b₂ x y}
→ {u : A.Hom a₁ a₂} {v : B.Hom b₁ b₂}
→ (f : Hom[ u , v ] x y)
→ f ≡[ A.intror (A.idl _) ,ₚ B.insertl (B.idl _) ] (π* u y ∘' vert-lift f ∘' ι! v x)
This final condition implies that for every the lifts and coincide.
same-lift: ∀ {a₁ a₂ b₁ b₂ x' y'} {u : A.Hom a₁ a₂} {v : B.Hom b₁ b₂}
→ (f : Hom[ u , v ] x' y')
→ u ^* y' ≡ v ^! x'
First, note that it suffices to construct a map as the space of lifts of along is contractible. The above axiom ensures that this map exists!
{x' = x'} {y' = y'} {u = u} {v = v} f =
same-lift (cart-lift A.id (u ^* y'))
ap fst $ is-contr→is-prop (u ^* y' , id')
(v ^! x' , vert-lift f)
Moreover, the factorisation condition ensures that every hom set forms a proposition.
Hom[]-is-prop: ∀ {a₁ a₂ b₁ b₂ x' y'} {u : A.Hom a₁ a₂} {v : B.Hom b₁ b₂}
→ is-prop (Hom[ u , v ] x' y')
Let be a pair of morphisms. Both maps factor as and so it suffices to show that
{x' = x'} {y' = y'} {u = u} {v = v} f' g' =
Hom[]-is-prop
cast[] $
f' ≡[]⟨ factors f' ⟩
π* u y' ∘' ⌜ vert-lift f' ⌝ ∘' ι! v x' ≡[]⟨ ap! vert-lift-eq ⟩
π* u y' ∘' vert-lift g' ∘' ι! v x' ≡[]˘⟨ factors g' ⟩ g' ∎
The type of objects is a set, so it further suffices to prove that which follows immediately from uniqueness of lifts.
where
: vert-lift f' ≡ vert-lift g'
vert-lift-eq =
vert-lift-eq (fibre-set _ _) $
Σ-inj-set (cart-lift A.id (u ^* y'))
is-contr→is-prop (v ^! x' , vert-lift f')
(v ^! x' , vert-lift g')
An alternative view is that these final conditions ensure that morphisms are equivalent to proofs that
opaque
discrete-two-sided-hom: ∀ {a₁ a₂ b₁ b₂ x' y'}
→ (u : A.Hom a₁ a₂) (v : B.Hom b₁ b₂)
→ (u ^* y') ≡ (v ^! x')
→ Hom[ u , v ] x' y'
{x' = x'} {y' = y'} u v p =
discrete-two-sided-hom .elimr (A.idr _) ,ₚ B.cancell (B.idl _) ] $
hom[ A(λ v!x → Hom[ A.id , B.id ] v!x (u ^* y')) p id' ∘' ι! v x'
π* u y' ∘' subst
discrete-two-sided-hom-is-equiv: ∀ {a₁ a₂ b₁ b₂ x' y'}
→ (u : A.Hom a₁ a₂) (v : B.Hom b₁ b₂)
→ is-equiv (discrete-two-sided-hom {x' = x'} {y' = y'} u v)
=
discrete-two-sided-hom-is-equiv u v
is-iso→is-equiv $
iso same-lift(λ _ → Hom[]-is-prop _ _)
(λ _ → fibre-set _ _ _ _ _ _)
Functoriality🔗
Note that the action is functorial on the fibres of that are vertical over as lifts are unique.
^*-∘: ∀ {a₁ a₂ a₃ : A.Ob} {b : B.Ob}
→ (u : A.Hom a₂ a₃) (v : A.Hom a₁ a₂)
→ (y' : Ob[ a₃ , b ])
→ (u A.∘ v) ^* y' ≡ (v ^* (u ^* y'))
=
^*-∘ u v y' (u A.∘ v) y' .paths $
ap fst $ cart-lift (u ^* y') ,
v ^* .idl _ ] (π* u y' ∘' π* v (u ^* y'))
hom[ refl ,ₚ B
^*-id: ∀ {a b} {x' : Ob[ a , b ]}
→ A.id ^* x' ≡ x'
{x' = x'} =
^*-id .id x' .paths (x' , id') ap fst $ cart-lift A
Dually, the action is functorial on the fibres of that are vertical over
^!-∘: ∀ {a : A.Ob} {b₁ b₂ b₃ : B.Ob}
→ (u : B.Hom b₂ b₃) (v : B.Hom b₁ b₂)
→ (x' : Ob[ a , b₁ ])
→ (u B.∘ v) ^! x' ≡ (u ^! (v ^! x'))
=
^!-∘ u v x' (u B.∘ v) x' .paths $
ap fst $ cocart-lift (v ^! x') , hom[ A.idr _ ,ₚ refl ] (ι! u (v ^! x') ∘' ι! v x')
u ^!
^!-id: ∀ {a b} {x' : Ob[ a , b ]}
→ B.id ^! x' ≡ x'
{x' = x'} =
^!-id .id x' .paths (x' , id') ap fst $ cocart-lift B
Moreover, we also have an interchange law that lets us relate the contravariant and covariant actions on fibres.
^*-^!-comm: ∀ {a₁ a₂ : A.Ob} {b₁ b₂ : B.Ob}
→ (u : A.Hom a₁ a₂) (v : B.Hom b₁ b₂)
→ (x' : Ob[ a₂ , b₁ ])
→ (u ^* (v ^! x')) ≡ (v ^! (u ^* x'))
=
^*-^!-comm u v x' (hom[ A.idl u ,ₚ B.idr v ] (ι! v x' ∘' π* u x')) same-lift
Invertible maps🔗
Every morphism in a discrete two-sided fibration living over an invertible pair of morphisms is itself invertible.
all-invertible[]: ∀ {a₁ a₂ b₁ b₂ x' y'} {u : A.Hom a₁ a₂} {v : B.Hom b₁ b₂}
→ (f : Hom[ u , v ] x' y')
→ (uv⁻¹ : A×B.is-invertible (u , v))
→ is-invertible[ uv⁻¹ ] f
Let be a map displayed over a pair of invertible maps
{a₁} {a₂} {b₁} {b₂} {x'} {y'} {u} {v} f uv⁻¹ = f⁻¹ where
all-invertible[] module uv⁻¹ = A×B.is-invertible uv⁻¹
open is-invertible[_]
: A.Hom _ _
u⁻¹ = uv⁻¹.inv .fst
u⁻¹
: B.Hom _ _
v⁻¹ = uv⁻¹.inv .snd v⁻¹
All of our Hom sets are propositional, so constructing an inverse only requires us to build a map Moreover, it suffices to prove that which follows from some tedious functoriality algebra.
: is-invertible[ uv⁻¹ ] f
f⁻¹ .inv' =
f⁻¹
discrete-two-sided-hom u⁻¹ v⁻¹ $(u⁻¹ ^*_) ^!-id ⟩
u⁻¹ ^* x' ≡˘⟨ ap (⌜ B.id ⌝ ^! x') ≡⟨ ap! (sym (ap snd $ uv⁻¹.invr)) ⟩
u⁻¹ ^* ((v⁻¹ B.∘ v) ^! x') ≡⟨ ap (u⁻¹ ^*_) (^!-∘ v⁻¹ v x') ⟩
u⁻¹ ^* (v⁻¹ ^! ⌜ v ^! x' ⌝) ≡⟨ ap! (sym (same-lift f)) ⟩
u⁻¹ ^* (v⁻¹ ^! (u ^* y')) ≡˘⟨ ap (u⁻¹ ^*_) (^*-^!-comm u v⁻¹ y') ⟩
u⁻¹ ^* (u ^* (v⁻¹ ^! y')) ≡˘⟨ ^*-∘ u u⁻¹ (v⁻¹ ^! y') ⟩
u⁻¹ ^* .∘ u⁻¹ ⌝ ^* (v⁻¹ ^! y') ≡⟨ ap! (ap fst $ uv⁻¹.invl) ⟩
⌜ u A.id ^* (v⁻¹ ^! y') ≡⟨ ^*-id ⟩
A
v⁻¹ ^! y' ∎.inverses' .Inverses[_].invl' =
f⁻¹ (λ _ → Hom[]-is-prop) _ _
is-prop→pathp .inverses' .Inverses[_].invr' =
f⁻¹ (λ _ → Hom[]-is-prop) _ _ is-prop→pathp
Cartesian and cocartesian maps🔗
Every map that is is cartesian and every map that is is cocartesian.
vertical-cartesian: ∀ {a₁ a₂ b x' y'} {u : A.Hom a₁ a₂}
→ (f : Hom[ u , B.id {b} ] x' y')
→ is-cartesian E (u , B.id) f
vertical-cocartesian: ∀ {a b₁ b₂ x' y'} {v : B.Hom b₁ b₂}
→ (f : Hom[ A.id {a} , v ] x' y')
→ is-cocartesian E (A.id , v) f
The proof is a bit more functoriality algebra.
{x' = x'} {y'} {u} f .is-cartesian.universal {_} {a'} (v , w) h =
vertical-cartesian
discrete-two-sided-hom v w $(v ^*_) ^!-id ⟩
v ^* x' ≡˘⟨ ap (B.id ^! x') ≡˘⟨ ap (v ^*_) (same-lift f) ⟩
v ^* (u ^* y') ≡˘⟨ ^*-∘ u v y' ⟩
v ^* (u A.∘ v) ^* y' ≡⟨ same-lift h ⟩
(B.id B.∘ w) ^! a' ≡⟨ ap (_^! a') (B.idl w) ⟩
w ^! a' ∎{x' = x'} {y'} {u} f .is-cartesian.commutes _ _ =
vertical-cartesian _ _
Hom[]-is-prop {x' = x'} {y'} {u} f .is-cartesian.unique _ _ =
vertical-cartesian _ _ Hom[]-is-prop
The cocartesian case is formally dual, so we omit the details.
{x' = x'} {y'} {v} f .is-cocartesian.universal {_} {a'} (u , w) h =
vertical-cocartesian
discrete-two-sided-hom u w $(_^* a') (A.idr _) ⟩
u ^* a' ≡˘⟨ ap (u A.∘ A.id) ^* a' ≡⟨ same-lift h ⟩
(w B.∘ v) ^! x' ≡⟨ ^!-∘ w v x' ⟩
(v ^! x') ≡˘⟨ ap (w ^!_) (same-lift f) ⟩
w ^! (A.id ^* y') ≡⟨ ap (w ^!_) ^*-id ⟩
w ^!
w ^! y' ∎{x' = x'} {y'} {v} f .is-cocartesian.commutes _ _ =
vertical-cocartesian _ _
Hom[]-is-prop {x' = x'} {y'} {v} f .is-cocartesian.unique _ _ =
vertical-cocartesian _ _ Hom[]-is-prop
Discrete two-sided fibrations are two-sided fibrations🔗
module _
{oa ℓa ob ℓb oe ℓe}
{A : Precategory oa ℓa} {B : Precategory ob ℓb}
(E : Displayed (A ×ᶜ B) oe ℓe)
where
private
module A = Cat.Reasoning A
module B = Cat.Reasoning B
open Cat.Displayed.Reasoning E
open Cat.Displayed.Morphism E
open Displayed E
Every discrete two-sided fibration is a two-sided fibration.
discrete-two-sided-fibration→two-sided-fibration: is-discrete-two-sided-fibration E
→ Two-sided-fibration E
This is essentially a triviality at this point: every map is cocartesian, and every map is cartesian, and all requisite lifts exit.
= E-fib where
discrete-two-sided-fibration→two-sided-fibration E-dfib open is-discrete-two-sided-fibration E-dfib
open Two-sided-fibration
open Cocartesian-lift
open Cartesian-lift
: Two-sided-fibration E
E-fib .cart-lift u y' .x' = u ^* y'
E-fib .cart-lift u y' .lifting = π* u y'
E-fib .cart-lift u y' .cartesian = vertical-cartesian (π* u y')
E-fib .cocart-lift v x' .y' = v ^! x'
E-fib .cocart-lift v x' .lifting = ι! v x'
E-fib .cocart-lift v x' .cocartesian = vertical-cocartesian (ι! v x')
E-fib .cart-cocart-commute p f-cocart g-cart ._↔_.to _ =
E-fib _
vertical-cocartesian .cart-cocart-commute p f-cocart g-cart ._↔_.from _ =
E-fib _ vertical-cartesian