2-adjoint equivalences in homotopy type theory
Daniel Carranza, Jonathan Chang, Chris Kapulkin, Ryan Sandford
aa r X i v : . [ m a t h . L O ] A ug Daniel Carranza Jonathan Chang Krzysztof Kapulkin Ryan SandfordAugust 31, 2020
Abstract
We introduce the notion of (half) 2-adjoint equivalences in Homotopy Type Theory andprove their expected properties. We formalized these results in the Lean Theorem Prover.
Introduction
There are numerous notions of equivalence in homotopy type theory: bi-invertible maps, contractiblemaps, and half adjoint equivalences. Other natural choices, such as quasi-invertible maps and adjointequivalences, while logically equivalent to the above, are not propositions, making them unsuitableto serve as the definition of an equivalence. One can use a simple semantical argument, which inessence comes down to analyzing different subcomplexes of the nerve of the groupoid p – q , to seewhy some definitions work and others do not. The conclusion here is that while the definition as a“half n -adjoint equivalence” gives us a proposition, the definition as a “(full) n -adjoint equivalence”does not.In this paper, we take the first step towards expressing these results internally in type theory,putting special emphasis on their formalization. In particular, we revisit the notions of a quasi-invertible map, a half adjoint equivalence, and an adjoint equivalence, giving the formal proofs oftheir expected properties. Our proofs are more modular than those given in [Uni13], and helpimprove efficiency. We then turn our attention to corresponding notions arising from 2-adjunctions,namely half 2-adjoint equivalences and (full) 2-adjoint equivalences, and show that while the formeris always a proposition, the latter fails to be one in general.These results have been formalized using the Lean Theorem Prover, version 3.4.2 ( https://github.com/leanprover/lean ) as part of the HoTT in Lean 3 library ( https://github.com/gebner/hott3 ); the formalization consists of 528 lines of code across 3 files and may be found in thedirectory hott3/src/hott/types/2 adj . We write file/name for a newly-formalized result, where file denotes the file it is found in and name denotes the name of the formal proof in the code. Organization.
Section 1 recalls the necessary background on equivalences which will be usedthroughout. Section 2 introduces new formal proofs that the types of quasi-inverses and adjointequivalences are not propositions. Note that specific examples where this fails are presented, butnot formally proven since the current version of the HoTT in Lean 3 library does not containinduction principles for the higher inductive types S and S . Section 3 introduces half 2-adjointequivalences, which are propositions containing the data of adjoint equivalences, as well as 2-adjointequivalences, which are non-propositions related to both quasi-inverses and adjoint equivalences. Acknowledgements.
This work was carried out when the first, second, and fourth authors wereundergraduates at the University of Western Ontario and was supported through two UndergraduateStudent Research Awards and a Discovery Grant, all funded by the Natural Sciences and EngineeringResearch Council (NSERC) of Canada. We thank NSERC for its generosity.1
Preliminaries
We largely adopt the notation of [Uni13], with additional and differing notation stated here. Wenotate the ap function for f : A Ñ B by f r´s : p x “ y q Ñ p f x “ f y q . For ap , the action of f on 2-dimensional paths, we write f J ´ K : p p “ q q Ñ p f r p s “ f r q sq . For a homotopy H : f „ g between dependant functions f, g : ś x : A Bx and a non-dependant function h : C Ñ A , we write H h : f h „ gh for the composition of H and h . If f, g : A Ñ B are non-dependant and we instead have h : B Ñ C ,we write h r H s : hf „ hg for the composition of h r´s and H . Given an additional homotopy H : f „ g and α : H „ H , wesimilarly write h J α K : h r H s „ h r H s for the composition of h J ´ K and α . Lastly, for H : f „ g and H : g „ h , we write transitivity ofhomotopies as H ¨ H : f „ h in path-concatenation order. Definition 1.1 ( adj/qinv , adj/is hadj l ) . A function f : A Ñ B
1. has a quasi-inverse if the following type is inhabited: qinv f : ” ÿ g : B Ñ A gf „ id A ˆ f g „ id B .
2. is a half-adjoint equivalence if the following type is inhabited: ishadj f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B f r η s „ ε f .
3. is a left half-adjoint equivalence if the following type is inhabited: ishadjl f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B η g „ g r ε s . For types
A, B : U , the type of equivalences between A and B is: A » B : ” ÿ f : A Ñ B ishadj f. Theorem 1.2 ([Uni13, Lem. 4.2.2, Thms. 4.2.3, 4.2.13]) . For f : A Ñ B , there are maps ishadj f ishadjl f qinv f » where the top two types are propositions. A, B : U is that of aquasi-inverse. However, as this type is not a proposition, we define equivalences to be half adjointequivalences. Since both half and left half adjoint equivalences are propositional types, one couldalso define the type of equivalences to be left half adjoint equivalences.With a well-behaved notion of equivalence, we present the remaining lemmas to be used through-out. Lemma 1.3 (Equivalence Induction, [Uni13, Cor. 5.8.5]) . Given D : ś A,B : U p A » B q Ñ U and d : ś A : U D p A, A, id A q , there exists f : ź A,B : U ź e : A » B D p A, B, e q such that f p A, A, id A q “ d p A q for all A : U . Lemma 1.4 ( prelim/sigma hty is contr , [Uni13, Cor. 5.8.6, Thm. 5.8.4]) . Given f : A Ñ B , thetypes ÿ g : B Ñ A f „ g and ÿ g : B Ñ A g „ f are both contractible with center p f, refl f q . Lemma 1.5 ([Uni13, Lem. 4.2.5]) . For any f : A Ñ B , y : B and p x, p q , p x , p q : fib f y , we have p x, p q “ p x , p q » ÿ γ : x “ x p “ f r γ s ¨ p . Lemma 1.6 ([Uni13, Thm. 4.2.6]) . If f : A Ñ B is a half-adjoint equivalence, then for any y : B the fiber fib f y is contractible. We present a proof that the type of quasi-inverses is not a proposition, using Lemma 1.4 for increasedmodularity over the proof presented in [Uni13, Lem. 4.1.1].
Theorem 2.1 ( adj/qinv equiv pi eq ) . Given f : A Ñ B such that ishadj f is inhabited, we have qinv f » ź x : A x “ x. Proof.
By Equivalence Induction 1.3, it suffices to show qinv id A » ś x : A x “ x . Observe that qinv id A ” ÿ g : A Ñ A g „ id A ˆ g „ id A » ÿ g : A Ñ A ÿ η : g „ id A g „ id A » ÿ u : ř g : A Ñ A g „ id A pr u „ id A » id A „ id A (1) ” ź x : A x “ x, where (1) follows from Lemma 1.4 (the type ř g : A Ñ A g „ id A is contractible with center p id A , refl q ).3his result implies that any type with non-trivial π may be used to construct non-trivial inhab-itants of this type. For instance, since π p S q “ Z , we have: Corollary 2.2.
The type qinv id S is not a proposition. Conceptually, this proof takes the pair p g, η q and uses Lemma 1.4 to contract it so that onlyone homotopy remains. This differs from the proof in [Uni13], which uses function extensionality towrite the homotopies as paths and contracts using based path induction. This proof modularizesthe proof in [Uni13] by packaging function extensionality and rewriting of contractible types intoone result, simplifying both the proof and the formalization.Thus, the type of half and left half adjoint equivalences each append an additional coherenceto contract with the remaining homotopy. However, appending both coherences gives us a non-proposition. Definition 2.3 ( adj/adj ) . Given f : A Ñ B , the structure of an adjoint equivalence on f is thetype: adj f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B f r η s „ ε f ˆ η g „ g r ε s . Theorem 2.4 ( adj/adj equiv pi refl eq ) . Given f : A Ñ B such that ishadj f is inhabited, wehave adj f » ź x : A refl x “ refl x . Proof.
By Equivalence Induction 1.3, it suffices to show adj id A » ś x : A refl x “ refl x . Observe that adj id A ” ÿ g : A Ñ A ÿ η : g „ id A ÿ ε : g „ id A id A r η s „ ε ˆ η g „ g r ε s» ÿ ε : id A „ id A refl „ ε ˆ refl „ id A r ε s (2) » ÿ ε : id A „ id A ÿ τ : refl „ ε refl „ id A r ε s» ÿ u : ř ε : id A „ id A refl „ ε refl „ id A r pr u s» refl „ id A r refl s (3) ” ź x : A refl x “ refl x . The equivalence (2) comes from the equivalence in Theorem 2.1, where the pair p g, η q contracts to p id A , refl q . The equivalence (3) follows from Lemma 1.4.This result implies that any type with non-trivial π may be used to construct non-trivial inhab-itants of this type. In particular, π p S q “ Z proves the following: Corollary 2.5.
The type adj id S is not a proposition. This is a solution to Exercise 4.1 in [Uni13]. As before, this proof uses Lemma 1.4 to contract thepairs p g, η q and p ε, τ q so that a single homotopy remains. Trying to apply path induction directlyrequires an equivalence which writes each homotopy as an equality; a formal proof using functionextensionality for such an equivalence along with path induction reaches 60 lines of code (varying byformat, syntax choice, etc.). By modularizing the case of qinv , this proof is reduced to manipulatingΣ-types and applying Lemma 1.4 twice, with the formal proof in the library being 23 lines of code.4 As in the case of qinv , we expect there is an additional coherence that may be appended to the type adj f to create a proposition once more. To define this coherence, we use the following homotopy: Lemma 3.1 ( two adj/nat coh ) . Given f : A Ñ B and g : B Ñ A with a homotopy H : gf „ id A ,we have a homotopy Coh H : H gf „ g r f r H ss such that Coh refl ” refl refl : refl „ refl . Proof.
Fix x : A . We have H g p fx q “ p gf qr H x s“ g r f r H x ss , where the first equality holds by naturality and the second holds by functoriality of g r´s .With this, we define the type of half 2-adjoint equivalences. Definition 3.2 ( two adj/is two hae ) . A function f : A Ñ B is a half 2-adjoint equivalence if thefollowing type is inhabited: ish2adj f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B ÿ τ : f r η s„ ε f ÿ θ : η g „ g r ε s Coh η ¨ g J τ K „ θ f . In parallel with adjoint equivalences, we give a definition which uses an alternate coherence.
Definition 3.3 ( two adj/is two hae l ) . A function f : A Ñ B is a left half 2-adjoint equivalence if the following type is inhabited: ish2adjl f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B ÿ τ : f r η s„ ε f ÿ θ : η g „ g r ε s τ g ¨ Coh ε „ f J θ K . To show the type of half 2-adjoint equivalences is a proposition, we prove the following lemma:
Lemma 3.4 ( two adj/r2coh equiv fib eq ) . Given f : A Ñ B with p g, η, ε, θ q : ishadjl f , we have ÿ τ : f r η s„ ε f Coh η ¨ g J τ K „ θ f » ź x : A p f r η x s , Coh η x ¨ θ fx q “ ` ε fx , refl g r ε fx s ˘ , where p f r η x s , Coh η x ¨ θ fx q , ` ε fx , refl g r ε fx s ˘ : fib g r´s g r ε fx s .Proof. We have ÿ τ : f r η s„ ε f Coh η ¨ g J τ K „ θ f ” ÿ τ : ś x : A f r η x s“ ε fx ź x : A Coh η x ¨ g J τ x K “ θ fx , » ź x : A ÿ τ : f r η x s“ ε fx Coh η x ¨ g J τ K “ θ fx (4) » ź x : A ÿ τ : f r η x s“ ε f p x q Coh η ´ x ¨ θ fx “ g J τ K (5) » ź x : A ` f r η x s , p N η q ´ ¨ θ f p x q ˘ “ ´ ε f p x q , refl g r ε f p x q s ¯ . (6)The equivalence (4) holds by the Type-Theoretic Axiom of Choice, (5) is a rearrangment of equality,and (6) holds by Lemma 1.5. 5 emma 3.5 ( two adj/is contr r2coh ) . Given f : A Ñ B with p g, η, ε, θ q : ishadj f , the type ÿ τ : f r η s„ ε f Coh η ¨ g J τ K „ θ f is contractible.Proof. By Lemma 3.4 and contractibility of Π-types, it suffices to fix x : A and show the type ` f r η x s , Coh η ´ x ¨ θ fx ˘ “ ` ε fx , refl g r ε fx s ˘ is contractible. Since g is an equivalence, g r´s is also an equivalence. By Lemma 1.6, the type fib g r´s p g r ε fx sq is contractible, so its equality type is also contractible. Theorem 3.6 ( two adj/is prop is two hae ) . For any f : A Ñ B , the type ish2adj f is a proposi-tion.Proof. It suffices to assume e : ish2adj f and show this type is contractible. Observe that ish2adj f ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B ÿ τ : f r η s„ ε f ÿ θ : η g „ g r ε s Coh η ¨ g J τ K „ θ f » ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B ÿ θ : η g „ g r ε s ÿ τ : f r η s„ ε f Coh η ¨ g J τ K „ θ f » ÿ p g,η,ε,θ q : ishadjl f ÿ τ : f r η s„ ε f Coh η ¨ g J τ K „ θ f » ÿ τ : f r η s„p ε q f Coh η ¨ g J τ K „ p θ q f . The last equivalence holds since ishadjl f is contractible (it is a proposition and inhabited by e afterdiscarding coherences); we write p g , η , ε , θ q : ishadjl f for its center of contraction. This final typeis contractible by Lemma 3.5, therefore ish2adj f is contractible.Parallels of these proofs are used to obtain similar results about left half two-adjoint equivalencesas well. Lemma 3.7 ( two adj/is contr l2coh ) . Given f : A Ñ B with p g, η, ε, τ q : ishadj f , the type ÿ θ : η g „ g r ε s τ g ¨ Coh ε „ f J θ K . is contractible.Proof. Analogous to Lemma 3.5.
Theorem 3.8 ( two adj/is prop is two hae l ) . For f : A Ñ B , the type ish2adjl f is a proposition.Proof. Analogous to Theorem 3.6.As well, either half adjoint equivalence may be promoted to the alternate half 2-adjoint equiva-lence.
Theorem 3.9 ( two adj/two adjointify ) . For f : A Ñ B , we have maps1. ishadjl f Ñ ish2adj f ishadj f Ñ ish2adjl f roof. Take the missing coherences to be the centers of contraction from Lemmas 3.5 and 3.7.This implies that an adjoint equivalence may be promoted to either half 2-adjoint equivalence.
Corollary 3.10.
For f : A Ñ B , we have maps1. adj f Ñ ish2adj f adj f Ñ ish2adjl f Proof.
Discard either coherence and apply Theorem 3.9.Finally, we have that the half 2-adjoint and left half 2-adjoint equivalences are logically equivalent.
Theorem 3.11 ( two adj/two hae equiv two hae l ) . For f : A Ñ B , we have maps ish2adj f Ø ish2adjl f. Proof.
In either direction, discard coherences and apply Theorem 3.9.We summarize the properties of these 2-adjoint equivalances with the following diagram of maps: ish2adjl f ish2adj f adj f ishadjl f ishadj f qinv f »» where rows 1 and 3 are propositions.As before, appending either one of these coherences yields a proposition, but appending bothcoherences yields a non-proposition once more. Definition 3.12 ( two adj/two adj ) . Given f : A Ñ B , the structure of a on f is the type: f : ” ÿ g : B Ñ A ÿ η : gf „ id A ÿ ε : fg „ id B ÿ τ : f r η s„ ε f ÿ θ : η g „ g r ε s Coh η ¨ g J τ K „ θ f ˆ τ g ¨ Coh ε „ f J θ K . Theorem 3.13 ( two adj/two adj equiv pi refl eq ) . Given f : A Ñ B such that ishadj f isinhabited, we have f » ź x : A refl refl x “ refl refl x . Proof.
By Equivalence Induction 1.3, it suffices to show A » ś x : A refl refl x “ refl refl x . Observe7hat A ” ÿ g : A Ñ A ÿ η : g „ id A ÿ ε : g „ id A ÿ τ : id A r η s„ ε ÿ θ : η g „ g r ε s Coh η ¨ g J τ K „ θ ˆ τ g ¨ Coh ε „ id A J θ K » ÿ θ : refl „ refl Coh refl ¨ id A J refl refl K „ θ ˆ refl refl ¨ Coh refl „ id A J θ K (7) ” ÿ θ : refl „ refl refl refl „ θ ˆ refl refl „ id A J θ K » ÿ θ : refl „ refl refl refl „ θ ˆ refl refl „ θ » ÿ θ : refl „ refl ÿ A : refl refl „ θ refl refl „ θ » ÿ u : ř θ : refl „ refl refl refl „ θ refl refl „ pr u » refl refl „ refl refl (8) ” ź x : A refl refl x “ refl refl x . The equivalence (7) is from Theorem 2.4; we contract p g, η, ε, τ q to p id A , refl , refl , refl refl q . The equiv-alence (8) is an application of Lemma 1.4.Once again, this result implies any type with non-trivial π may be used to construct non-trivialinhabitants of this type. We know π p S q “ Z , which proves: Corollary 3.14.
The type S is not a proposition. Proving this result using function extnsionality directly and path induction requires an equiva-lence which writes homotopies as equalities. By modularizing the case of qinv , similar to the analo-gous proof for adj , this result may be proven by manipulating Σ-types and applying Lemma 1.4 threetimes, with the formal proof in the library being 44 lines of code. As with adj , one would expectthis approach to be 40 to 80 lines shorter than one which uses function extensionality directly.
References [Uni13] The Univalent Foundations Program.
Homotopy Type Theory: Univalent Foundations ofMathematics.
Institute for Advanced Study: https://homotopytypetheory.org/bookhttps://homotopytypetheory.org/book