An adjoint equivalence is an isomorphism $(f, g, \eta, \varepsilon)$ where the homotopies ($\eta$, $\varepsilon$) satisfy the triangle identities, thus witnessing $f$ and $g$ as adjoint functors. In Homotopy Type Theory, we can use a half adjoint equivalence - satisfying only one of the triangle identities - as a good notion of equivalence.

is-half-adjoint-equiv : β {ββ ββ} {A : Type ββ} {B : Type ββ} (f : A β B) β Type _
is-half-adjoint-equiv {A = A} {B = B} f =
Ξ£[ g β (B β A) ]
Ξ£[ Ξ· β ((x : A) β g (f x) β‘ x) ]
Ξ£[ Ξ΅ β ((y : B) β f (g y) β‘ y) ]
((x : A) β ap f (Ξ· x) β‘ Ξ΅ (f x))

The argument is an adaptation of a standard result of both category theory and homotopy theory - where we can βimproveβ an equivalence of categories into an adjoint equivalence, or a homotopy equivalence into a strong homotopy equivalence (Vogtβs lemma). In HoTT, we show this synthetically for equivalences between $\infty$-groupoids.

: β {ββ ββ} {A : Type ββ} {B : Type ββ} {f : A β B}
β is-iso f β is-half-adjoint-equiv f
is-isoβis-half-adjoint-equiv {A = A} {B} {f} iiso =
g , Ξ· , Ξ΅' , Ξ» x β sym (zig x)
where
open is-iso iiso renaming (inv to g ; linv to Ξ· ; rinv to Ξ΅)

For $g$ and $\eta$, we can take the values provided by is-iso. However, if we want $(\eta, \varepsilon)$ to satisfy the triangle identities, we can not in general take $\varepsilon' = \varepsilon$. We can, however, alter it like thus:

Ξ΅' : (y : B) β f (g y) β‘ y
Ξ΅' y = sym (Ξ΅ (f (g y))) β ap f (Ξ· (g y)) β Ξ΅ y

Drawn as a diagram, the path above factors like:

There is a great deal of redundancy in this definition, given that $\varepsilon y$ and $\varepsilon' y$ have the same boundary! The point is that while the definition of $\varepsilon$ is entirely opaque to us, $\varepsilon'$ is written in such a way that we can use properties of paths to make the $\mathrm{sym}\ (\varepsilon ...)$ and $\varepsilon$ cancel:

zig : (x : A) β Ξ΅' (f x) β‘ ap f (Ξ· x)
zig x =
sym (Ξ΅ (f (g (f x))))  β ap f β (Ξ· (g (f x))) β β Ξ΅ (f x)   β‘
sym (Ξ΅ (f (g (f x))))  β β ap (f β g β f) (Ξ· x) β Ξ΅ (f x) β β‘Λ
sym (Ξ΅ (f (g (f x))))  β Ξ΅ (f (g (f x)))      β ap f (Ξ· x)  β‘
ap f (Ξ· x)                                                  β

The notion of half-adjoint equivalence is a useful stepping stone in writing a more comprehensible proof that isomorphisms are equivalences. Since this result is fundamental, the proof we actually use is written with efficiency of computation in mind - hence, cubically. The proof here is intended to be more educational.

First, we give an equivalent characterisation of paths in fibres, which will be used in proving that half adjoint equivalences are equivalences.

fibre-paths : β {ββ ββ} {A : Type ββ} {B : Type ββ} {f : A β B} {y : B}
β {f1 f2 : fibre f y}
β (f1 β‘ f2)
β (Ξ£[ Ξ³ β f1 .fst β‘ f2 .fst ] (ap f Ξ³ β f2 .snd β‘ f1 .snd))
The proof of this is not very enlightening, but itβs included here (rather than being completely invisible) for completeness:
fibre-paths {f = f} {y} {f1} {f2} =
Path (fibre f y) f1 f2
(Ξ£[ Ξ³ β f1 .fst β‘ f2 .fst ] (subst (Ξ» xβ β f xβ β‘ _) Ξ³ (f1 .snd) β‘ f2 .snd))
(Ξ£[ Ξ³ β f1 .fst β‘ f2 .fst ] (ap f Ξ³ β f2 .snd β‘ f1 .snd))                    ββ
where
helper : (p' : f (f1 .fst) β‘ y)
β (subst (Ξ» x β f x β‘ y) refl (f1 .snd) β‘ p')
β‘ (ap f refl β p' β‘ f1 .snd)
helper p' =
subst (Ξ» x β f x β‘ y) refl (f1 .snd) β‘ p'
(f1 .snd) β‘ p'                            β‘
β p' β β‘ f1 .snd                          β‘Λ
refl β p' β‘ f1 .snd                       β‘β¨β©
ap f refl β p' β‘ f1 .snd                  β

lemma : β {x'} {p'} β (Ξ³ : f1 .fst β‘ x')
β (subst (Ξ» x β f x β‘ _) Ξ³ (f1 .snd) β‘ p')
β‘ (ap f Ξ³ β p' β‘ f1 .snd)
lemma {x'} {p'} p =
J (Ξ» x' Ξ³ β β p' β (subst (Ξ» x β f x β‘ _) Ξ³ (f1 .snd) β‘ p')
β‘ (ap f Ξ³ β p' β‘ f1 .snd))
helper p p'

Then, given an element $y : B$, we can construct a fibre of of $f$, and, using the above characterisation of paths, prove that this fibre is a centre of contraction:

: β {ββ ββ} {A : Type ββ} {B : Type ββ} {f : A β B}
β is-half-adjoint-equiv f β is-equiv f
is-half-adjoint-equivβis-equiv {A = A} {B} {f} (g , Ξ· , Ξ΅ , zig) .is-eqv y = contr fib contract where
fib : fibre f y
fib = g y , Ξ΅ y

The fibre is given by $(g(y), Ξ΅(y))$, which we can prove identical to another $(x, p)$ using a very boring calculation:

contract : (fibβ : fibre f y) β fib β‘ fibβ
contract (x , p) = (fibre-paths eβ»ΒΉ) .fst (xβ‘gy , path) where
xβ‘gy = ap g (sym p) β Ξ· x

path : ap f (ap g (sym p) β Ξ· x) β p β‘ Ξ΅ y
path =
ap f (ap g (sym p) β Ξ· x) β p                   β‘
ap (Ξ» x β f (g x)) (sym p) β β ap f (Ξ· x) β β p β‘ -- by the triangle identity
ap (f β g) (sym p) β β Ξ΅ (f x) β p β            β‘ -- by naturality of Ξ΅

The calculation of path factors as a bunch of boring adjustments to paths using the groupoid structure of types, and the two interesting steps above: The triangle identity says that $\operatorname{ap}(f)(\eta x) = \varepsilon(f x)$, and naturality of $\varepsilon$ lets us βpush it past $p$β to get something we can cancel:

ap (f β g) (sym p) β ap (f β g) p β Ξ΅ y     β‘
β ap (f β g) (sym p) β ap (f β g) p β β Ξ΅ y β‘Λ
ap (f β g) β sym p β p β β Ξ΅ y              β‘
ap (f β g) refl β Ξ΅ y                       β‘β¨β©
refl β Ξ΅ y                                  β‘
Ξ΅ y                                         β

Putting these together, we get an alternative definition of is-isoβis-equiv:

is-isoβis-equiv'
: β {ββ ββ} {A : Type ββ} {B : Type ββ} {f : A β B}
β is-iso f β is-equiv f