open import Cat.Functor.Adjoint.Compose open import Cat.Functor.Naturality open import Cat.Functor.Properties open import Cat.Functor.Adjoint open import Cat.Functor.Base open import Cat.Prelude import Cat.Functor.Reasoning as Fr import Cat.Reasoning module Cat.Functor.Equivalence where
Equivalencesđ
A functor is an equivalence of categories when it has a right adjoint with the unit and counit natural transformations being natural isomorphisms. This immediately implies that our adjoint pair extends to an adjoint triple
record is-equivalence (F : Functor C D) : Type (adj-level C D) where private module C = Cat.Reasoning C module D = Cat.Reasoning D module [C,C] = Cat.Reasoning Cat[ C , C ] module [D,D] = Cat.Reasoning Cat[ D , D ] field Fâ»Âč : Functor D C FâŁFâ»Âč : F ⣠Fâ»Âč open _âŁ_ FâŁFâ»Âč hiding (η ; Δ) public field unit-iso : â x â C.is-invertible (unit.η x) counit-iso : â x â D.is-invertible (counit.Δ x)
The first thing we note is that having a natural family of invertible morphisms gives isomorphisms in the respective functor categories:
FâFâ»Âčâ Id : (F Fâ Fâ»Âč) [D,D].â Id FâFâ»Âčâ Id = [D,D].invertibleâiso counit (invertibleâinvertibleâż _ counit-iso) Idâ Fâ»ÂčâF : Id [C,C].â (Fâ»Âč Fâ F) Idâ Fâ»ÂčâF = [C,C].invertibleâiso unit (invertibleâinvertibleâż _ unit-iso) unitâ»Âč = [C,C]._â _.from Idâ Fâ»ÂčâF counitâ»Âč = [D,D]._â _.from FâFâ»Âčâ Id
Fâ»ÂčâŁF : Fâ»Âč ⣠F Fâ»ÂčâŁF = adj' where module adj = _âŁ_ FâŁFâ»Âč open _âŁ_ adj' : Fâ»Âč ⣠F adj' .unit = counitâ»Âč adj' .counit = unitâ»Âč adj' .zig {a} = zig' where abstract p : unitâ»Âč .η (Fâ»Âč # a) ⥠Fâ»Âč .Fâ (adj.Δ _) p = unitâ»Âč .η _ âĄâš C.introl adj.zag â©âĄ (Fâ»Âč .Fâ (adj.Δ _) C.â adj.η _) C.â unitâ»Âč .η _ âĄâš C.cancelr (unit-iso _ .C.is-invertible.invl) â©âĄ Fâ»Âč .Fâ (adj.Δ _) â zig' : unitâ»Âč .η (Fâ»Âč # a) C.â Fâ»Âč .Fâ (counitâ»Âč .η a) ⥠C.id zig' = apâ C._â_ p refl ·· sym (Fâ»Âč .F-â _ _) ·· ap (Fâ»Âč .Fâ) (counit-iso _ .D.is-invertible.invl) â Fâ»Âč .F-id adj' .zag {b} = zag' where abstract p : counitâ»Âč .η (F # b) ⥠F .Fâ (adj.η b) p = counitâ»Âč .η _ âĄâš D.intror adj.zig â©âĄ counitâ»Âč .η _ D.â adj.Δ _ D.â F .Fâ (adj.η b) âĄâš D.cancell (counit-iso _ .D.is-invertible.invr) â©âĄ F .Fâ (adj.η b) â zag' : F .Fâ (unitâ»Âč .η b) D.â counitâ»Âč .η (F # b) ⥠D.id zag' = apâ D._â_ refl p ·· sym (F .F-â _ _) ·· ap (F .Fâ) (unit-iso _ .C.is-invertible.invr) â F .F-id inverse-equivalence : is-equivalence Fâ»Âč inverse-equivalence = record { Fâ»Âč = F ; FâŁFâ»Âč = Fâ»ÂčâŁF ; unit-iso = λ x â D.is-invertible-inverse (counit-iso _) ; counit-iso = λ x â C.is-invertible-inverse (unit-iso _) }
We chose, for definiteness, the above definition of equivalence of categories, since it provides convenient access to the most useful data: The induced natural isomorphisms, the adjunction unit/counit, and the triangle identities. It is a lot of data to come up with by hand, though, so we provide some alternatives:
Fully faithful, essentially surjectiveđ
Any fully faithful and (split!) essentially surjective functor determines an equivalence of precategories. Recall that âsplit essentially surjectiveâ means we have some determined procedure for picking out an essential fibre over any object an object together with a specified isomorphism
module _ {F : Functor C D} (ff : is-fully-faithful F) (eso : is-split-eso F) where import Cat.Reasoning C as C import Cat.Reasoning D as D private module di = D._â _ private ffâ»Âč : â {x y} â D.Hom (F .Fâ x) (F .Fâ y) â C.Hom _ _ ffâ»Âč = equivâinverse ff module ff {x} {y} = Equiv (_ , ff {x} {y})
It remains to show that, when is fully faithful, this assignment of essential fibres extends to a functor For the object part, we send to the specified preimage. For the morphism part, the splitting gives us isomorphisms and so that we may form the composite Fullness then completes the construction.
ff+split-esoâinverse : Functor D C ff+split-esoâinverse .Fâ x = eso x .fst ff+split-esoâinverse .Fâ {x} {y} f = ffâ»Âč (f*y-iso .D._â _.from D.â f D.â f*x-iso .D._â _.to) where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso) open ÎŁ (eso y) renaming (fst to f*y ; snd to f*y-iso)
We must then, as usual, prove that this definition preserves identities and distributes over composites, so that we really have a functor. Preservation of identities is immediate; Distribution over composites is by faithfulness.
ff+split-esoâinverse .F-id {x} = ffâ»Âč (f*x-iso .di.from D.â â D.id D.â f*x-iso .di.to â) âĄâš ap! (D.idl _) â©âĄ ffâ»Âč (f*x-iso .di.from D.â f*x-iso .di.to) âĄâš ap ffâ»Âč (f*x-iso .di.invr) â©âĄ ffâ»Âč D.id âĄËâš ap ffâ»Âč (F .F-id) â©âĄË ffâ»Âč (F .Fâ C.id) âĄâš ff.η _ â©âĄ C.id â where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso) ff+split-esoâinverse .F-â {x} {y} {z} f g = ffâfaithful {F = F} ff ( F .Fâ (ffâ»Âč (ffz D.â (f D.â g) D.â ftx)) âĄâš ff.Δ _ â©âĄ ffz D.â (f D.â g) D.â ftx âĄâš cat! D â©âĄ ffz D.â f D.â â D.id â D.â g D.â ftx âĄËâš apÂĄ (f*y-iso .di.invl) â©âĄË ffz D.â f D.â (fty D.â ffy) D.â g D.â ftx âĄâš cat! D â©âĄ (ffz D.â f D.â fty) D.â (ffy D.â g D.â ftx) âĄËâš apâ D._â_ (ff.Δ _) (ff.Δ _) â©âĄË F .Fâ (ffâ»Âč _) D.â F .Fâ (ffâ»Âč _) âĄËâš F .F-â _ _ â©âĄË F .Fâ (ffâ»Âč _ C.â ffâ»Âč _) â ) where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso) open ÎŁ (eso y) renaming (fst to f*y ; snd to f*y-iso) open ÎŁ (eso z) renaming (fst to f*z ; snd to f*z-iso) ffz = f*z-iso .di.from ftz = f*z-iso .di.to ffy = f*y-iso .di.from fty = f*y-iso .di.to ffx = f*x-iso .di.from ftx = f*x-iso .di.to
We will, for brevity, refer to the functor weâve just built as
rather than its âproper nameâ ff+split-esoâinverse
.
Hercules now only has 11 labours to go: We must construct unit and
counit natural transformations, prove that they satisfy the triangle
identities, and prove that the unit/counit we define are componentwise
invertible. Iâll keep the proofs of naturality in
<details>
tags since.. theyâre rough.
private G = ff+split-esoâinverse
For the unit, we have an object and weâre asked to provide a morphism â where, recall, the notation represents the chosen essential fibre of over By fullness, it suffices to provide a morphism But recall that the essential fibre comes equipped with an isomorphism
ff+split-esoâunit : Id => (G Fâ F) ff+split-esoâunit .η x = ffâ»Âč (f*x-iso .di.from) where open ÎŁ (eso (F # x)) renaming (fst to f*x ; snd to f*x-iso)
Naturality of ff+split-esoâunit
.
ff+split-esoâunit .is-natural x y f = ffâfaithful {F = F} ff ( F .Fâ (ffâ»Âč ffy C.â f) âĄâš F .F-â _ _ â©âĄ â F .Fâ (ffâ»Âč ffy) â D.â F .Fâ f âĄâš ap! (ff.Δ _) â©âĄ ffy D.â â F .Fâ f â âĄâš ap! (sym (D.idr _) â ap (F .Fâ f D.â_) (sym (f*x-iso .di.invl))) â©âĄ ffy D.â F .Fâ f D.â ftx D.â ffx âĄâš cat! D â©âĄ (ffy D.â F .Fâ f D.â ftx) D.â ffx âĄËâš apâ D._â_ (ff.Δ _) (ff.Δ _) â©âĄË F .Fâ (ffâ»Âč (ffy D.â F .Fâ f D.â ftx)) D.â F .Fâ (ffâ»Âč ffx) âĄËâš F .F-â _ _ â©âĄË F .Fâ (ffâ»Âč (ffy D.â F .Fâ f D.â ftx) C.â ffâ»Âč ffx) âĄâšâ© F .Fâ ((G Fâ F) .Fâ f C.â xâf*x) â ) where open ÎŁ (eso (F .Fâ x)) renaming (fst to f*x ; snd to f*x-iso) open ÎŁ (eso (F .Fâ y)) renaming (fst to f*y ; snd to f*y-iso) ffy = f*y-iso .di.from fty = f*y-iso .di.to ffx = f*x-iso .di.from ftx = f*x-iso .di.to xâf*x : C.Hom x f*x xâf*x = ffâ»Âč (f*x-iso .di.from) yâf*y : C.Hom y f*y yâf*y = ffâ»Âč (f*y-iso .di.from)
For the counit, we have to provide a morphism We can again pick the given isomorphism.
ff+split-esoâcounit : (F Fâ G) => Id ff+split-esoâcounit .η x = f*x-iso .di.to where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso)
Naturality of ff+split-esoâcounit
ff+split-esoâcounit .is-natural x y f = fty D.â â F .Fâ (ffâ»Âč (ffy D.â f D.â ftx)) â âĄâš ap! (ff.Δ _) â©âĄ fty D.â ffy D.â f D.â ftx âĄâš D.cancell (f*y-iso .di.invl) â©âĄ f D.â ftx â where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso) open ÎŁ (eso y) renaming (fst to f*y ; snd to f*y-iso) ffy = f*y-iso .di.from fty = f*y-iso .di.to ftx = f*x-iso .di.to
Checking the triangle identities, and that the adjunction unit/counit defined above are natural isomorphisms, is routine. We present the calculations without commentary:
open _âŁ_ ff+split-esoâFâŁinverse : F ⣠G ff+split-esoâFâŁinverse .unit = ff+split-esoâunit ff+split-esoâFâŁinverse .counit = ff+split-esoâcounit ff+split-esoâFâŁinverse .zig {x} = ftx D.â F .Fâ (ffâ»Âč ffx) âĄâš ap (ftx D.â_) (ff.Δ _) â©âĄ ftx D.â ffx âĄâš f*x-iso .di.invl â©âĄ D.id â
where open ÎŁ (eso (F .Fâ x)) renaming (fst to f*x ; snd to f*x-iso) ffx = f*x-iso .di.from ftx = f*x-iso .di.to
The zag
identity
needs an appeal to faithfulness:
ff+split-esoâFâŁinverse .zag {x} = ffâfaithful {F = F} ff ( F .Fâ (ffâ»Âč (ffx D.â ftx D.â fftx) C.â ffâ»Âč fffx) âĄâš F .F-â _ _ â©âĄ F .Fâ (ffâ»Âč (ffx D.â ftx D.â fftx)) D.â F .Fâ (ffâ»Âč fffx) âĄâš apâ D._â_ (ff.Δ _) (ff.Δ _) â©âĄ (ffx D.â ftx D.â fftx) D.â fffx âĄâš cat! D â©âĄ (ffx D.â ftx) D.â (fftx D.â fffx) âĄâš apâ D._â_ (f*x-iso .di.invr) (f*f*x-iso .di.invl) â©âĄ D.id D.â D.id âĄâš D.idl _ â sym (F .F-id) â©âĄ F .Fâ C.id â )
Now to show they are componentwise invertible:
where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso) open ÎŁ (eso (F .Fâ f*x)) renaming (fst to f*f*x ; snd to f*f*x-iso) ffx = f*x-iso .di.from ftx = f*x-iso .di.to fffx = f*f*x-iso .di.from fftx = f*f*x-iso .di.to
open is-equivalence ff+split-esoâis-equivalence : is-equivalence F ff+split-esoâis-equivalence .Fâ»Âč = G ff+split-esoâis-equivalence .FâŁFâ»Âč = ff+split-esoâFâŁinverse ff+split-esoâis-equivalence .counit-iso x = record { inv = f*x-iso .di.from ; inverses = record { invl = f*x-iso .di.invl ; invr = f*x-iso .di.invr } } where open ÎŁ (eso x) renaming (fst to f*x ; snd to f*x-iso)
Since the unit is defined in terms of fullness, showing it is invertible needs an appeal to faithfulness (two, actually):
ff+split-esoâis-equivalence .unit-iso x = record { inv = ffâ»Âč (f*x-iso .di.to) ; inverses = record { invl = ffâfaithful {F = F} ff ( F .Fâ (ffâ»Âč ffx C.â ffâ»Âč ftx) âĄâš F .F-â _ _ â©âĄ F .Fâ (ffâ»Âč ffx) D.â F .Fâ (ffâ»Âč ftx) âĄâš apâ D._â_ (ff.Δ _) (ff.Δ _) â©âĄ ffx D.â ftx âĄâš f*x-iso .di.invr â©âĄ D.id âĄËâš F .F-id â©âĄË F .Fâ C.id â) ; invr = ffâfaithful {F = F} ff ( F .Fâ (ffâ»Âč ftx C.â ffâ»Âč ffx) âĄâš F .F-â _ _ â©âĄ F .Fâ (ffâ»Âč ftx) D.â F .Fâ (ffâ»Âč ffx) âĄâš apâ D._â_ (ff.Δ _) (ff.Δ _) â©âĄ ftx D.â ffx âĄâš f*x-iso .di.invl â©âĄ D.id âĄËâš F .F-id â©âĄË F .Fâ C.id â) } } where open ÎŁ (eso (F .Fâ x)) renaming (fst to f*x ; snd to f*x-iso) ffx = f*x-iso .di.from ftx = f*x-iso .di.to
Between categoriesđ
Above, we made an equivalence out of any fully faithful and split essentially surjective functor. In set-theoretic mathematics (and indeed between strict categories), the splitting condition can not be lifted constructively: the statement âevery (ff, eso) functor between strict categories is an equivalenceâ is equivalent to the axiom of choice.
However, between univalent categories, the situation is different: Any essentially surjective fully faithful functor splits. In particular, any ff functor between univalent categories has propositional essential fibres, so a âmereâ essential surjection is automatically split. However, note that both the domain and codomain have to be categories for the argument to go through.
module _ (F : Functor C D) (ccat : is-category C) (dcat : is-category D) (ff : is-fully-faithful F) where private module C = Cat.Reasoning C module D = Cat.Reasoning D
So, suppose we have categories and together with a fully faithful functor For any weâre given an inhabitant of which we want to âget outâ from under the truncation. For this, weâll show that the type being truncated is a proposition, so that we may âuntruncateâ it.
Essential-fibre-between-cats-is-prop : â y â is-prop (Essential-fibre F y) Essential-fibre-between-cats-is-prop z (x , i) (y , j) = they're-equal where
For this magic trick, assume weâre given a
together with objects
and isomorphisms
and
We must show that
and that over this path,
Since
is fully faithful, we can find an isomorphism
in
which
sends back to
Fxâ Fy : F .Fâ x D.â F .Fâ y Fxâ Fy = j D.Isoâ»Âč D.âIso i xâ y : x C.â y xâ y = is-ffâessentially-injective {F = F} ff Fxâ Fy
Furthermore, since weâre working with categories, these isomorphisms restrict to paths and Weâre half-done: weâve shown that some exists, and it remains to show that over this path we have More specifically, we must give a path laying over
xâĄy : x ⥠y xâĄy = ccat .to-path xâ y FxâĄFy : F .Fâ x ⥠F .Fâ y FxâĄFy = dcat .to-path Fxâ Fy
Rather than showing it over
directly, weâll show it over the path
we constructed independently. This is because we can use the helper
Hom-pathp-reflr-iso
to establish
the result with far less computation:
over' : PathP (λ i â FxâĄFy i D.â z) i j over' = D.â -pathp FxâĄFy refl (Univalent.Hom-pathp-refll-iso dcat (D.cancell (i .D._â _.invl)))
We must then connect with this path But since we originally got by full faithfulness of they are indeed the same path:
abstract square : ap# F xâĄy ⥠FxâĄFy square = ap# F xâĄy âĄâš F-map-path F ccat dcat xâ y â©âĄ dcat .to-path â F-map-iso F xâ y â âĄâš ap! (equivâcounit (is-ffâF-map-iso-is-equiv {F = F} ff) _) â©âĄ dcat .to-path Fxâ Fy â over : PathP (λ i â F .Fâ (xâĄy i) D.â z) i j over = transport (λ l â PathP (λ m â square (~ l) m D.â z) i j) over'
Hence â blink and youâll miss it â the essential fibres of over any are propositions, so it suffices for them to be merely inhabited for the functor to be split eso. With tongue firmly in cheek we call this result the theorem of choice.
they're-equal = ÎŁ-pathp xâĄy over Theorem-of-choice : is-eso F â is-split-eso F Theorem-of-choice eso y = â„-â„-elim (λ _ â Essential-fibre-between-cats-is-prop y) (λ x â x) (eso y)
This theorem implies that any fully faithful, âmerelyâ essentially surjective functor between categories is an equivalence:
ff+esoâis-equivalence : is-eso F â is-equivalence F ff+esoâis-equivalence eso = ff+split-esoâis-equivalence ff (Theorem-of-choice eso)
Furthermore, if is an equivalence between categories, then itâs an equivalence-on-objects functor. The inverse functor gives us a way to turn objects of back into objects of and unit/counit of the equivalence ensure that and so all that remains is to use the fact that and are categories to get the requisite paths.
is-cat-equivalenceâequiv-on-objects : â {F : Functor C D} â (ccat : is-category C) (dcat : is-category D) â is-equivalence F â is-equiv-on-objects F is-cat-equivalenceâequiv-on-objects {C = C} {D = D} {F = F} ccat dcat eqv = is-isoâis-equiv $ iso (e.Fâ»Âč .Fâ) (λ d â dcat .to-path (D.invertibleâiso _ (e.counit-iso d))) (λ c â sym $ ccat .to-path (C.invertibleâiso _ (e.unit-iso c))) where module C = Cat.Reasoning C module D = Cat.Reasoning D module e = is-equivalence eqv
Isomorphismsđ
Another, more direct way of proving that a functor is an equivalence of precategories is proving that it is an isomorphism of precategories: Itâs fully faithful, thus a typal equivalence of morphisms, and in addition its action on objects is an equivalence of types.
record is-precat-iso (F : Functor C D) : Type (adj-level C D) where no-eta-equality constructor iso field has-is-ff : is-fully-faithful F has-is-iso : is-equiv (F .Fâ)
Such a functor is (immediately) fully faithful, and the inverse has-is-iso
means that it
is split essentially surjective; For given
the inverse of
gives us an object
We must then provide an isomorphism
but those are identical, hence isomorphic.
module _ {F : Functor C D} (p : is-precat-iso F) where open is-precat-iso p is-precat-isoâis-split-eso : is-split-eso F is-precat-isoâis-split-eso ob = equivâinverse has-is-iso ob , isom where isom = pathâiso {C = D} (equivâcounit has-is-iso _)
Thus, by the theorem above, is an adjoint equivalence of precategories.
is-precat-isoâis-equivalence : is-equivalence F is-precat-isoâis-equivalence = ff+split-esoâis-equivalence has-is-ff is-precat-isoâis-split-eso
open is-equivalence open Precategory open _âŁ_ unquoteDecl H-Level-is-precat-iso = declare-record-hlevel 1 H-Level-is-precat-iso (quote is-precat-iso) module _ {o â o' â'} {C : Precategory o â} {D : Precategory o' â'} (F : Functor C D) (eqv : is-equivalence F) where private module e = is-equivalence eqv module C = Cat.Reasoning C module D = Cat.Reasoning D module F = Fr F is-equivalenceâis-ff : is-fully-faithful F is-equivalenceâis-ff = is-isoâis-equiv λ where .is-iso.inv x â e.unitâ»Âč .η _ C.â L-adjunct e.FâŁFâ»Âč x .is-iso.rinv x â D.invertibleâmonic (F-map-invertible F (e.unit-iso _)) _ _ $ apâ D._â_ refl (F .F-â _ _) ·· D.cancell (F.annihilate (e.unit-iso _ .C.is-invertible.invl)) ·· D.invertibleâmonic (e.counit-iso _) _ _ (R-L-adjunct e.FâŁFâ»Âč x â sym (D.cancell e.zig)) .is-iso.linv x â ap (_ C.â_) (sym (e.unit .is-natural _ _ _)) â C.cancell (e.unit-iso _ .C.is-invertible.invr) is-equivalenceâis-split-eso : is-split-eso F is-equivalenceâis-split-eso y = (e.Fâ»Âč .Fâ y) , D.invertibleâiso (e.counit .η y) (e.counit-iso y) is-equivalenceâis-eso : is-eso F is-equivalenceâis-eso y = inc ((e.Fâ»Âč .Fâ y) , D.invertibleâiso (e.counit .η y) (e.counit-iso y)) open is-precat-iso open is-iso is-equivalenceâis-precat-iso : is-category C â is-category D â is-precat-iso F is-equivalenceâis-precat-iso c-cat d-cat .has-is-ff = is-equivalenceâis-ff is-equivalenceâis-precat-iso c-cat d-cat .has-is-iso = is-cat-equivalenceâequiv-on-objects c-cat d-cat eqv
record Equivalence {o â o' â'} (C : Precategory o â) (D : Precategory o' â') : Type (o â â â o' â â') where no-eta-equality field To : Functor C D To-equiv : is-equivalence To open is-equivalence To-equiv renaming (Fâ»Âč to From; FâŁFâ»Âč to ToâŁFrom) public
Properties of equivalencesđ
If is fully-faithfuly and essentially surjective, then for every hom-set there (merely) exists an equivalent hom-set
module _ {oc âc od âd} {C : Precategory oc âc} {D : Precategory od âd} where private module C = Cat.Reasoning C module D = Cat.Reasoning D
ff+split-esoâhom-equiv : (F : Functor C D) â is-fully-faithful F â is-split-eso F â â d d' â ÎŁ[ c â C ] ÎŁ[ c' â C ] (C.Hom c c' â D.Hom d d') ff+split-esoâhom-equiv F ff split-eso d d' = d-fib .fst , d'-fib .fst , (F .Fâ , ff) âe D.isoâhom-equiv (d-fib .snd) (d'-fib .snd) where d-fib = split-eso d d'-fib = split-eso d' ff+esoâhom-equiv : (F : Functor C D) â is-fully-faithful F â is-eso F â â d d' â â[ c â C ] ÎŁ[ c' â C ] (C.Hom c c' â D.Hom d d') ff+esoâhom-equiv F ff eso d d' = do (c , Fcâ d) â eso d (c' , Fc'â d') â eso d' pure (c , c' , (F .Fâ , ff) âe D.isoâhom-equiv Fcâ d Fc'â d')
This allows us to prove a very useful little lemma: if is a fully-faithful, essentially surjective functor, then any property of hom-sets of that holds for all hom-sets must also hold for all hom-sets of
ff+esoâpreserves-hom-props : â {â} (F : Functor C D) â is-fully-faithful F â is-eso F â (P : Type (âc â âd) â Type â) â (â A â is-prop (P A)) â (â c c' â P (Lift âd (C.Hom c c'))) â â d d' â P (Lift âc (D.Hom d d')) ff+esoâpreserves-hom-props F ff eso P prop P-hom d d' = â„-â„-out (prop (Lift âc (D.Hom d d'))) $ do (c , c' , eqv) â ff+esoâhom-equiv F ff eso d d' pure (transport (ap P (ua (Lift-ap eqv))) (P-hom c c'))
As a corollary, we note that if is a fully-faithful, essentially surjective functor, then if the hom-sets of are all then the hom-sets of must also be
ff+esoâhom-hlevel : â {n} (F : Functor C D) â is-fully-faithful F â is-eso F â (â c c' â is-hlevel (C.Hom c c') n) â â d d' â is-hlevel (D.Hom d d') n ff+esoâhom-hlevel {n = n} F ff eso C-hlevel d d' = Lift-is-hlevel' _ $ ff+esoâpreserves-hom-props F ff eso (λ A â is-hlevel A n) (λ _ â is-hlevel-is-prop n) (λ c c' â Lift-is-hlevel n (C-hlevel c c')) d d'
Note that if is fully faithful and split essentially surjective, then we can drop the requirement that must be a prop.
ff+split-esoâpreserves-hom-fams : â {â} (F : Functor C D) â is-fully-faithful F â is-split-eso F â (P : Type (âc â âd) â Type â) â (â c c' â P (Lift âd (C.Hom c c'))) â â d d' â P (Lift âc (D.Hom d d')) ff+split-esoâpreserves-hom-fams F ff split-eso P P-hom d d' = transport (ap P (ua (Lift-ap (ff+split-esoâhom-equiv F ff split-eso d d' .snd .snd)))) (P-hom _ _)
As a corollary, equivalences preserve all families over hom sets.
equivalenceâpreserves-hom-fams : â {â} (E : Equivalence C D) â (P : Type (âc â âd) â Type â) â (â c c' â P (Lift âd (C.Hom c c'))) â â d d' â P (Lift âc (D.Hom d d')) equivalenceâpreserves-hom-fams E = ff+split-esoâpreserves-hom-fams (Equivalence.To E) (is-equivalenceâis-ff _ (Equivalence.To-equiv E)) (is-equivalenceâis-split-eso _ (Equivalence.To-equiv E))
equivalenceâhom-hlevel : â {n} (E : Equivalence C D) â (â c c' â is-hlevel (C.Hom c c') n) â â d d' â is-hlevel (D.Hom d d') n equivalenceâhom-hlevel {n = n} E C-hlevel d d' = Lift-is-hlevel' n $ equivalenceâpreserves-hom-fams E (λ A â is-hlevel A n) (λ c c' â Lift-is-hlevel n (C-hlevel c c')) d d'
Being an equivalence is also invariant under natural isomorphism.
is-equivalence-natural-iso : â {F G : Functor C D} â F â âż G â is-equivalence F â is-equivalence G is-equivalence-natural-iso {C = C} {D = D} {F = F} {G = G} α F-eqv = G-eqv where open is-equivalence module C = Cat.Reasoning C module D = Cat.Reasoning D G-eqv : is-equivalence G G-eqv .Fâ»Âč = F-eqv .Fâ»Âč G-eqv .FâŁFâ»Âč = adjoint-natural-isol α (F-eqv .FâŁFâ»Âč) G-eqv .unit-iso x = C.invertible-â (C.invertible-â (F-map-invertible (F-eqv .Fâ»Âč) (isoâżâis-invertible α x)) C.id-invertible) (F-eqv .unit-iso x) G-eqv .counit-iso x = D.invertible-â (F-eqv .counit-iso x) (D.invertible-â (F-map-invertible F C.id-invertible) (isoâżâis-invertible α _ D.invertibleâ»Âč))
Equivalences are invertible.
_Equivalenceâ»Âč : Equivalence C D â Equivalence D C (E Equivalenceâ»Âč) .Equivalence.To = Equivalence.From E (E Equivalenceâ»Âč) .Equivalence.To-equiv = Equivalence.inverse-equivalence E
Equivalences are also composable, as adjoints compose.
is-equivalence-â : â {F : Functor D E} {G : Functor C D} â is-equivalence F â is-equivalence G â is-equivalence (F Fâ G) is-equivalence-â {E = E} {C = C} {F = F} {G = G} F-eqv G-eqv = FG-eqv where module F-eqv = is-equivalence F-eqv module G-eqv = is-equivalence G-eqv module C = Cat.Reasoning C module E = Cat.Reasoning E FG-eqv : is-equivalence (F Fâ G) FG-eqv .Fâ»Âč = G-eqv.Fâ»Âč Fâ F-eqv.Fâ»Âč FG-eqv .FâŁFâ»Âč = LFâŁGR G-eqv.FâŁFâ»Âč F-eqv.FâŁFâ»Âč FG-eqv .unit-iso x = C.invertible-â (F-map-invertible G-eqv.Fâ»Âč (F-eqv.unit-iso (G .Fâ x))) (G-eqv.unit-iso x) FG-eqv .counit-iso x = E.invertible-â (F-eqv.counit-iso x) (F-map-invertible F (G-eqv.counit-iso (F-eqv .Fâ»Âč .Fâ x))) _âEquivalence_ : Equivalence C D â Equivalence D E â Equivalence C E (F âEquivalence G) .Equivalence.To = Equivalence.To G Fâ Equivalence.To F (F âEquivalence G) .Equivalence.To-equiv = is-equivalence-â (Equivalence.To-equiv G) (Equivalence.To-equiv F)
Unsurprisingly, the identity functor is an equivalence.
Id-is-equivalence : â {o h} {C : Precategory o h} â is-equivalence {C = C} Id Id-is-equivalence {C = C} .Fâ»Âč = Id Id-is-equivalence {C = C} .FâŁFâ»Âč .unit .η x = C .id Id-is-equivalence {C = C} .FâŁFâ»Âč .unit .is-natural x y f = C .idl _ â sym (C .idr _) Id-is-equivalence {C = C} .FâŁFâ»Âč .counit .η x = C .id Id-is-equivalence {C = C} .FâŁFâ»Âč .counit .is-natural x y f = C .idl _ â sym (C .idr _) Id-is-equivalence {C = C} .FâŁFâ»Âč .zig = C .idl _ Id-is-equivalence {C = C} .FâŁFâ»Âč .zag = C .idl _ Id-is-equivalence {C = C} .unit-iso x = Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _) Id-is-equivalence {C = C} .counit-iso x = Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _)
Preserving invertibilityđ
We can characterise equivalences as those adjunctions that preserve invertibility, in the sense that the adjunct of an isomorphism is an isomorphism and vice versa; that is, the property of being invertible in is equivalent to the property of being invertible in over the adjunctionâs
module _ {o â o' â'} {C : Precategory o â} {D : Precategory o' â'} {L : Functor C D} {R : Functor D C} (LâŁR : L ⣠R) where private module C = Cat.Reasoning C module D = Cat.Reasoning D module L = Fr L module R = Fr R
preserves-invertibility : Type (o â â â o' â â') preserves-invertibility = â {a b} â D.is-invertible â[ adjunct-hom-equiv LâŁR {a} {b} ] C.is-invertible
Since the unit and counit of an adjunction are adjuncts of identities, itâs not hard to see that they must be invertible if the adjunction preserves invertibility.
preserves-invertibilityâequivalence : preserves-invertibility â is-equivalence L preserves-invertibilityâequivalence e .Fâ»Âč = R preserves-invertibilityâequivalence e .FâŁFâ»Âč = LâŁR preserves-invertibilityâequivalence e .unit-iso c = C.invertible-cancelr (R.F-map-invertible D.id-invertible) (Equiv.to (e D.id _ refl) D.id-invertible) preserves-invertibilityâequivalence e .counit-iso d = D.invertible-cancell (L.F-map-invertible C.id-invertible) (Equiv.from (e _ _ (L-R-adjunct LâŁR _)) C.id-invertible)
The other direction is just as straightforward, since adjuncts are defined by composition with the (co)unit, and isomorphisms compose.
module _ {o â o' â'} {C : Precategory o â} {D : Precategory o' â'} (F : Functor C D) (eqv : is-equivalence F) where private module e = is-equivalence eqv module C = Cat.Reasoning C module D = Cat.Reasoning D module F = Fr F module Fâ»Âč = Fr e.Fâ»Âč
equivalenceâpreserves-invertibility : preserves-invertibility e.FâŁFâ»Âč equivalenceâpreserves-invertibility = prop-over-ext (adjunct-hom-equiv e.FâŁFâ»Âč) (hlevel 1) (hlevel 1) (λ f inv â C.invertible-â (Fâ»Âč.F-map-invertible inv) (e.unit-iso _)) (λ f inv â D.invertible-â (e.counit-iso _) (F.F-map-invertible inv))