module Cat.Univalent.Rezk.HIT {o β} (C : Precategory o β) where
Higher inductive Rezk completionsπ
We can define the Rezk completion of a precategory directly as a higher inductive type, without passing through replacement. Importantly, under this construction, the resulting universal functor becomes definitionally fully faithful.
The type of objects of looks a lot like the delooping of a group, but with an inclusion rather than a single basepoint: indeed, we can think of it as delooping all the automorphism groups of at once. Completely analogously, we have a constructor turning isomorphisms in into paths in and we have a generating triangle saying that this constructor respects composition, filling the diagram
data C^ : Type (o β β) where inc : β C β β C^ glue : β {x y} β x β y β inc x β‘ inc y glueα΅ : β {x y z} (f : x β y) (g : y β z) β Triangle (glue f) (glue (g βIso f)) (glue g) squash : is-groupoid C^
Note that, as in the case for simple deloopings, this generating
triangle is sufficient to ensure that glue
is functorial.
glue-β : (e : x β y) (e' : y β z) β Path (Path C^ (inc x) (inc z)) (glue e β glue e') (glue (e' βIso e)) glue-β e e' = sym (triangleβcommutes (glueα΅ e e')) glue-id : Path (Path C^ (inc x) (inc x)) (glue id-iso) refl glue-id = glue id-iso β‘β¨ β-intror (β-invr _) β©β‘ glue id-iso β glue id-iso β sym (glue id-iso) β‘β¨ β-pulll (glue-β _ _ β ap C^.glue (ext (idl _))) β©β‘ glue id-iso β sym (glue id-iso) β‘β¨ β-invr _ β©β‘ refl β
We will need an elimination principle for C^
into sets, saying that it
suffices to handle the point inclusions and the generating paths; the
generating triangle is handled automatically, as is the truncation. Of
course, we can also eliminate C^
into propositions, in which case the generating
paths are also handled automatically.
C^-elim-set : β {β} {P : C^ β Type β} β¦ _ : β {x} β H-Level (P x) 2 β¦ β (pi : β x β P (inc x)) β (pg : β {x y} (e : x β y) β PathP (Ξ» i β P (glue e i)) (pi x) (pi y)) β β x β P x C^-elim-set pi pg (inc x) = pi x C^-elim-set pi pg (glue x i) = pg x i C^-elim-set {P = P} pi pg (glueα΅ {x} f g i j) = is-setβsquarep (Ξ» i j β hlevel {T = P (glueα΅ f g i j)} 2) (Ξ» i β pi x) (Ξ» i β pg f i) (Ξ» i β pg (g βIso f) i) (Ξ» i β pg g i) i j C^-elim-set {P = P} pi pg (squash x y p q Ξ± Ξ² i j k) = is-hlevelβis-hlevel-dep 2 (Ξ» x β is-hlevel-suc 2 (hlevel {T = P x} 2)) (go x) (go y) (Ξ» i β go (p i)) (Ξ» i β go (q i)) (Ξ» i j β go (Ξ± i j)) (Ξ» i j β go (Ξ² i j)) (squash x y p q Ξ± Ξ²) i j k where go = C^-elim-set {P = P} pi pg
abstract C^-elim-prop : β {β} {P : C^ β Type β} β¦ _ : β {x} β H-Level (P x) 1 β¦ β (β x β P (inc x)) β β x β P x C^-elim-prop pi = C^-elim-set β¦ hlevel-instance (is-propβis-set (hlevel 1)) β¦ pi (Ξ» e β prop!) instance H-Level-C^ : β {n} β H-Level C^ (3 + n) H-Level-C^ = basic-instance 3 squash Inductive-C^ : β {β βm} {P : C^ β Type β} β¦ i : Inductive (β x β P (inc x)) βm β¦ β β¦ _ : β {x} β H-Level (P x) 1 β¦ β Inductive (β x β P x) βm Inductive-C^ β¦ i β¦ = record { methods = i .Inductive.methods ; from = Ξ» f β C^-elim-prop (i .Inductive.from f) }
Defining
spans over
C^
π
We now turn to the problem of defining the This turns out to have a lot of βcasesβ, but we can break them down intuitively as follows: to define a function where is a groupoid, we can start by giving a function
record C^-corr {β'} (P : Type β') : Type (o β β β β') where field has-is-groupoid : is-groupoid P base : β C β β β C β β P
Then, we must give actions of the isomorphisms on both the left and the right of making it into a sort of βprofunctorβ; and, correspondingly, these actions must be βprofunctorialβ. In particular, they should respect composition and commute past each other, which we can state concisely in terms of triangles and squares.
lmap : β {x x' y} (e : x β x') β base x y β‘ base x' y rmap : β {x y y'} (e : y β y') β base x y β‘ base x y' lcoh : β {x x' x'' y} (e : x β x') (e' : x' β x'') β Triangle (lmap {y = y} e) (lmap (e' βIso e)) (lmap e') rcoh : β {x y y' y''} (e : y β y') (e' : y' β y'') β Triangle (rmap {x = x} e) (rmap (e' βIso e)) (rmap e') comm : β {x x' y y'} (e : x β x') (e' : y β y') β Square (rmap e) (lmap e') (lmap e') (rmap e)
This is sufficient to discharge all the cases when writing a binary
function from
into a groupoid; we leave the formalisation in this <details>
block because it is rather fiddly.
private instance _ : H-Level P 3 _ = hlevel-instance has-is-groupoid goβ : (x : β C β) (y : C^) β P goβ ΞΎ (inc x) = base ΞΎ x goβ ΞΎ (glue x i) = rmap {ΞΎ} x i goβ ΞΎ (glueα΅ f g i j) = rcoh {ΞΎ} f g i j goβ ΞΎ (squash x y p q Ξ± Ξ² i j k) = let go = goβ ΞΎ in is-hlevelβis-hlevel-dep 2 (Ξ» _ β hlevel 3) (go x) (go y) (Ξ» i β go (p i)) (Ξ» i β go (q i)) (Ξ» i j β go (Ξ± i j)) (Ξ» i j β go (Ξ² i j)) (squash x y p q Ξ± Ξ²) i j k lmap' : β {x x'} (e : x β x') β goβ x β‘ goβ x' lmap' e = funextP $ C^-elim-set (Ξ» _ β lmap e) Ξ» e' β comm e' e lcoh' : β {w x y : β C β} (e : w β x) (e' : x β y) β Triangle (lmap' e) (lmap' (e' βIso e)) (lmap' e') lcoh' e e' = funext-square $ C^-elim-prop Ξ» x β lcoh e e' C^-recβ : (x y : C^) β P C^-recβ (inc x) z = goβ x z C^-recβ (glue x i) z = lmap' x i z C^-recβ (glueα΅ x y i j) z = lcoh' x y i j z C^-recβ (squash x y p q Ξ± Ξ² i j k) z = let go : C^ β P go x = C^-recβ x z in is-hlevelβis-hlevel-dep 2 (Ξ» _ β hlevel 3) (go x) (go y) (Ξ» i β go (p i)) (Ξ» i β go (q i)) (Ξ» i j β go (Ξ± i j)) (Ξ» i j β go (Ξ² i j)) (squash x y p q Ξ± Ξ²) i j k
Since is already a profunctor over we can show straightforwardly that it extends to a binary type family over
hom^ : C^ β C^ β Type β hom^ x y = β C^-recβ methods x y β where methods : C^-corr (Set β) methods .has-is-groupoid = hlevel 3 methods .base x y = el! (Hom x y) methods .lmap e = n-ua (dom-isoβhom-equiv e) methods .rmap e = n-ua (cod-isoβhom-equiv e) methods .lcoh e e' = n-ua-triangle (ext Ξ» h β assoc _ _ _) methods .rcoh e e' = n-ua-triangle (ext Ξ» h β sym (assoc _ _ _)) methods .comm e e' = n-ua-square (ext Ξ» h β sym (assoc _ _ _))
-- To make sure that composition in Rzk is injective in the objects, we -- wrap the hom^ family defined above in a record. record Hom^ (x y : C^) : Type β where constructor lift field lower : hom^ x y open Hom^ public instance H-Level-Hom^ : β {x y n} β H-Level (Hom^ x y) (2 + n) H-Level-Hom^ = basic-instance 2 (Isoβis-hlevel 2 (Hom^.lower , (iso lift (Ξ» x β refl) (Ξ» x β refl))) (hlevel 2)) Inductive-Hom^ : β {x y β βm} {P : Hom^ x y β Type β} β¦ i : Inductive (β h β P (lift h)) βm β¦ β Inductive (β x β P x) βm Inductive-Hom^ β¦ i β¦ = record { methods = i .Inductive.methods ; from = Ξ» { m (lift x) β i .Inductive.from m x } } private lifthom^ : β {x y} β hom^ x y β Hom^ x y lifthom^ = lift
Making a categoryπ
Since our
is valued in sets, we can use the eliminator defined above to construct
the identity morphisms and the composition operation by
These will consist of lifting the corresponding operation from
and then showing that they respect the action of glue
on hom^
, which we have defined to
be pre- and post-composition with the given isomorphism. Therefore,
while there is a lot of code motion to put these together, they are
conceptually very simple.
For a worked-out example, the necessary coherence for lifting the identity morphisms from to asks simply that if then we have which is a short calculation.
id^ : β x β hom^ x x id^ = C^-elim-set (Ξ» _ β id) coh where abstract coh : β {x y} (j : x β y) β PathP (Ξ» i β hom^ (glue j i) (glue j i)) id id coh z = pathβua-pathp _ $ z .to β id β z .from β‘β¨ ap (z .to β_) (idl _) β©β‘ z .to β z .from β‘β¨ z .invl β©β‘ id β
Lifting the composition operation is similar, but more involved, since
we now have to do recursion on C^
thrice.
β^ : β x y z β hom^ y z β hom^ x y β hom^ x z β^ = C^-elim-set fβ cohβ where mutual fβ : β x y z β hom^ (inc y) z β hom^ (inc x) (inc y) β hom^ (inc x) z fβ x y = C^-elim-set (Ξ» z β _β_) (cohβ x y) fβ : β x (y z : C^) β hom^ y z β hom^ (inc x) y β hom^ (inc x) z fβ x = C^-elim-set (fβ x) (cohβ x) abstract cohβ : β x y {z z'} (j : z β z') β PathP (Ξ» i β hom^ (inc y) (glue j i) β hom^ (inc x) (inc y) β hom^ (inc x) (glue j i)) _β_ _β_ cohβ x y j = uaβ (Ξ» f β funextP Ξ» g β pathβua-pathp _ (assoc _ _ _)) cohβ : β x {y z} (j : y β z) β PathP (Ξ» i β (y : C^) β hom^ (glue j i) y β hom^ (inc x) (glue j i) β hom^ (inc x) y) (fβ x y) (fβ x z) cohβ x j = funextP (C^-elim-prop (Ξ» z β uaβ Ξ» h β uaβ Ξ» i β ap (h β_) (insertl (j .invr)) β pulll refl)) cohβ : β {x y} (j : x β y) β PathP (Ξ» i β (y z : C^) β hom^ y z β hom^ (glue j i) y β hom^ (glue j i) z) (fβ x) (fβ y) cohβ j = funextP $ elim! Ξ» y β funextP $ elim! Ξ» z β funextP Ξ» f β uaβ Ξ» g β pathβua-pathp _ (sym (assoc _ _ _))
To show that this forms a precategory, it suffices to lift the corresponding proofs also from Since weβre showing a proposition, this is very straightforward: itβs just some un/wrapping.
Rzk : Precategory (o β β) β Rzk .P.Ob = C^ Rzk .P.Hom x y = Hom^ x y Rzk .P.Hom-set x y = hlevel 2 Rzk .P.id {x} = lift (id^ x) Rzk .P._β_ {w} {x} {y} f g = lift (β^ w x y (f .lower) (g .lower)) Rzk .P.idr {x} {y} (lift f) = ap lift (idr^ x y f) where abstract idr^ : β x y (f : hom^ x y) β β^ x x y f (id^ x) β‘ f idr^ = elim! Ξ» x y f β idr f Rzk .P.idl {x} {y} (lift f) = ap lift (idl^ x y f) where abstract idl^ : β x y (f : hom^ x y) β β^ x y y (id^ y) f β‘ f idl^ = elim! Ξ» x y f β idl f Rzk .P.assoc {w} {x} {y} {z} (lift f) (lift g) (lift h) = ap lift (assoc^ w x y z f g h) where abstract assoc^ : β w x y z (f : hom^ y z) (g : hom^ x y) (h : hom^ w x) β β^ w y z f (β^ w x y g h) β‘ β^ w x z (β^ x y z f g) h assoc^ = elim! Ξ» w x y z f g h β assoc f g h
We can give the Rezk completion functor.
complete : Functor C Rzk complete .Functor.Fβ = inc complete .Functor.Fβ f = lift f complete .Functor.F-id = refl complete .Functor.F-β f g = refl complete-is-ff : is-fully-faithful complete complete-is-ff = is-isoβis-equiv (iso Hom^.lower (Ξ» x β refl) Ξ» x β refl) complete-is-eso : is-eso complete complete-is-eso = elim! Ξ» x β inc (x , Rzk.id-iso)
Univalence of the Rezk completionπ
To show that
is univalent, we do one last monster
induction, to show that, for a fixed
the space of βisomorphs of
β
is contractible. This automatically handles one coherence, since
contractibility is a proposition; however, when actually lifting the
glue
constructor, we do still
have one coherence to show.
to-path^ : (a : C^) β is-contr (Ξ£[ b β C^ ] a Rzk.β b) to-path^ = C^-elim-set (Ξ» x β record { paths = Ξ» (b , e) β wrap x b e }) (Ξ» e β prop!) where module _ (a : β C β) where T : C^ β Type _ T x = (e : inc a Rzk.β x) β Path (Ξ£[ b β C^ ] inc a Rzk.β b) (inc a , Rzk.id-iso) (x , e) glue' : (x : β C β) β T (inc x) glue' x e = glue (hat.iso.from e) ,β Rzk.β -pathp _ _ (apd (Ξ» i β lifthom^) (pathβua-pathp _ (idr _)))
However, this coherence is essentially the generating triangle glueα΅
, and so the proof goes
through without much stress.
coh : {x y : Ob} (e : x β y) β PathP (Ξ» i β T (glue e i)) (glue' x) (glue' y) coh e = funext-dep Ξ» {xβ} {xβ} Ξ± β let open Rzk using (to) Ξ±' : glue (e βIso hat.iso.from xβ) β‘ glue (hat.iso.from xβ) Ξ±' = ap C^.glue (ext (ua-pathpβpath _ (apd (Ξ» _ x β x .to .lower) Ξ±))) in Ξ£-set-square (Ξ» _ β hlevel 2) $ glueα΅ (hat.iso.from xβ) e β· Ξ±' wrap : β b β T b wrap = C^-elim-set glue' coh Rzk-is-category : is-category Rzk Rzk-is-category = contrβidentity-system (Ξ» {a} β to-path^ a)