module Cat.Univalent.Rezk where
The Rezk completion🔗
In the same way that we can freely complete a proset into a poset, it is possible to, in a universal way, replace any precategory by a category such that there is a weak equivalence (a fully faithful, essentially surjective functor) such that any map from to a univalent category factors uniquely through
The construction is essentially piecing together a handful of pre-existing results: The univalence principle for implies that Sets is a univalent category, and functor categories with univalent codomain are univalent; The Yoneda lemma implies that any precategory admits a full inclusion into and full subcategories of univalent categories are univalent — so, like Grothendieck cracking the nut, the sea of theory has risen to the point where our result is trivial:
module Rezk-large (A : Precategory o h) where
: Precategory (o ⊔ lsuc h) (o ⊔ h)
Rezk-completion = Full-inclusion→Full-subcat {F = よ A} (よ-is-fully-faithful A)
Rezk-completion
: is-category Rezk-completion
Rezk-completion-is-category =
Rezk-completion-is-category _ (λ _ → squash)
Restrict-is-category (Functor-is-category Sets-is-category)
: Functor A Rezk-completion
Complete = Ff-domain→Full-subcat {F = よ A} (よ-is-fully-faithful A)
Complete
: is-fully-faithful Complete
Complete-is-ff = is-fully-faithful-domain→Full-subcat
Complete-is-ff {F = よ _} (よ-is-fully-faithful _)
: is-eso Complete
Complete-is-eso = is-eso-domain→Full-subcat {F = よ _} (よ-is-fully-faithful _) Complete-is-eso
However, this construction is a bit disappointing, because we’ve had to pass to a larger universe than the one we started with. If originally we had with objects living in a universe and homs in we now have with objects living in
It’s unavoidable that the objects in will live in an universe satisfying since we want their identity type to be equivalent to something living in but going up a level is unfortunate. However, it’s also avoidable!
Since is a category, isomorphism is an identity system on its objects, which lives at the level of its morphisms — — rather than of its objects, Therefore, using the construction of small images, we may take to be a
module _ (A : Precategory o h) where
private
= PSh h A
PSh[A] module PSh[A] = Precategory PSh[A]
: is-category PSh[A]
PSh[A]-is-cat = Functor-is-category Sets-is-category
PSh[A]-is-cat
module よim = Replacement PSh[A]-is-cat (よ₀ A)
: Precategory (o ⊔ h) (o ⊔ h)
Rezk-completion .Ob = よim.Image
Rezk-completion .Hom x y = よim.embed x => よim.embed y
Rezk-completion .Hom-set _ _ = PSh[A].Hom-set _ _
Rezk-completion .id = PSh[A].id
Rezk-completion ._∘_ = PSh[A]._∘_
Rezk-completion .idr = PSh[A].idr
Rezk-completion .idl = PSh[A].idl
Rezk-completion .assoc = PSh[A].assoc Rezk-completion
Our resized Rezk completion factors the Yoneda embedding as a functor
where the first functor is a weak equivalence, and the second functor is fully faithful. Let’s first define the functors:
: Functor A Rezk-completion
complete .F₀ = よim.inc
complete .F₁ = よ A .F₁
complete .F-id = よ A .F-id
complete .F-∘ = よ A .F-∘
complete
: Functor Rezk-completion (PSh h A)
Rezk↪PSh .F₀ = よim.embed
Rezk↪PSh .F₁ f = f
Rezk↪PSh .F-id = refl
Rezk↪PSh .F-∘ _ _ = refl Rezk↪PSh
From the existence of the second functor, we can piece together pre-existing lemmas about the image and about identity systems in general to show that this resized Rezk completion is also a category: We can pull back the identity system on to one on since we know of a (type-theoretic) embedding between their types of objects.
That gives us an identity system which is slightly off, that of “ on the image of the functor ”, but since we know that this functor is fully faithful, that’s equivalent to what we want.
private module Rezk↪PSh = Ffr Rezk↪PSh id-equiv
abstract
: is-category Rezk-completion
Rezk-completion-is-category =
Rezk-completion-is-category
transfer-identity-system(pullback-identity-system
(Functor-is-category Sets-is-category)
(よim.embed , よim.embed-is-embedding))
(λ x y → Rezk↪PSh.iso-equiv e⁻¹)
λ x → trivial!
It remains to show that the functor is a weak equivalence. It’s fully faithful because the Yoneda embedding is, and it’s essentially surjective because it’s literally surjective-on-objects.
: is-fully-faithful complete
complete-is-ff = よ-is-fully-faithful A
complete-is-ff
: is-eso complete
complete-is-eso = do
complete-is-eso x .inc-is-surjective x
t ← よim(t .fst , path→iso (t .snd)) pure