module Cat.Functor.Adjoint.Hom where
module _ {o ℓ o' ℓ'} {C : Precategory o ℓ} {D : Precategory o' ℓ'}
{L : Functor D C} {R : Functor C D}
where
Adjoints as hom-isomorphisms🔗
Recall from the page on adjoint functors that an adjoint pair induces an isomorphism
of sending each morphism to its left and right adjuncts, respectively. What that page does not mention is that any functors with such a correspondence — as long as the isomorphism is natural — actually generates an adjunction with the unit and counit given by the adjuncts of each identity morphism.
More precisely, the data we require is an equivalence (of sets) such that the equation
holds. While this may seem un-motivated, it’s really a naturality square for a transformation between the bifunctors and whose data has been “unfolded” into elementary terms.
hom-iso-natural: (∀ {x y} → C.Hom (L.₀ x) y → D.Hom x (R.₀ y))
→ Type _
=
hom-iso-natural f ∀ {a b c d} (g : C.Hom a b) (h : D.Hom c d) x
→ f (g C.∘ x C.∘ L.₁ h) ≡ R.₁ g D.∘ f x D.∘ h
hom-iso→adjoints: (f : ∀ {x y} → C.Hom (L.₀ x) y → D.Hom x (R.₀ y))
→ (eqv : ∀ {x y} → is-equiv (f {x} {y}))
→ hom-iso-natural f
→ L ⊣ R
= adj' where
hom-iso→adjoints f f-equiv natural : ∀ {x y} → D.Hom x (R.₀ y) → C.Hom (L.₀ x) y
f⁻¹ = equiv→inverse f-equiv
f⁻¹
: ∀ {a b c d} (g : C.Hom a b) (h : D.Hom c d) x
inv-natural → f⁻¹ (R.₁ g D.∘ x D.∘ h) ≡ g C.∘ f⁻¹ x C.∘ L.₁ h
= ap fst $ is-contr→is-prop (f-equiv .is-eqv _)
inv-natural g h x (f⁻¹ (R.₁ g D.∘ x D.∘ h) , refl)
( g C.∘ f⁻¹ x C.∘ L.₁ h
_ _ _
, natural (equiv→counit f-equiv _)
∙ sym (f ⊙ f⁻¹)
∙ ap (D.extendl (ap (R.₁ g D.∘_) (equiv→counit f-equiv _))))
We do not require an explicit naturality witness for the inverse of since if a natural transformation is componentwise invertible, then its inverse is natural as well. It remains to use our “binaturality” to compute that and do indeed give a system of adjunction units and co-units.
: L ⊣ R
adj' .unit .η x = f C.id
adj' .unit .is-natural x y h =
adj' .id D.∘ h ≡⟨ D.introl R.F-id ⟩
f C.₁ C.id D.∘ f C.id D.∘ h ≡˘⟨ natural _ _ _ ⟩
R(C.id C.∘ C.id C.∘ L.₁ h) ≡⟨ ap f (C.cancell (C.idl _) ∙ C.intror (C.idl _ ∙ L.F-id)) ⟩
f (L.₁ h C.∘ C.id C.∘ L.₁ D.id) ≡⟨ natural _ _ C.id ⟩
f .₁ (L.₁ h) D.∘ f C.id D.∘ D.id ≡⟨ D.refl⟩∘⟨ D.idr _ ⟩
R.₁ (L.₁ h) D.∘ f C.id ∎
R.counit .η x = f⁻¹ D.id
adj' .counit .is-natural x y f =
adj' .id C.∘ L.₁ (R.₁ f) ≡⟨ C.introl refl ⟩
f⁻¹ D.id C.∘ f⁻¹ D.id C.∘ L.₁ (R.₁ f) ≡˘⟨ inv-natural _ _ _ ⟩
C(R.₁ C.id D.∘ D.id D.∘ R.₁ f) ≡⟨ ap f⁻¹ (D.cancell (D.idr _ ∙ R.F-id) ∙ D.intror (D.idl _)) ⟩
f⁻¹ (R.₁ f D.∘ D.id D.∘ D.id) ≡⟨ inv-natural _ _ _ ⟩
f⁻¹ .∘ f⁻¹ D.id C.∘ L.₁ D.id ≡⟨ C.refl⟩∘⟨ C.elimr L.F-id ⟩
f C.∘ f⁻¹ D.id ∎
f C.zig =
adj' .id C.∘ L.₁ (f C.id) ≡⟨ C.introl refl ⟩
f⁻¹ D.id C.∘ f⁻¹ D.id C.∘ L.₁ (f C.id) ≡˘⟨ inv-natural _ _ _ ⟩
C(R.₁ C.id D.∘ D.id D.∘ f C.id) ≡⟨ ap f⁻¹ (D.cancell (D.idr _ ∙ R.F-id)) ⟩
f⁻¹ (f C.id) ≡⟨ equiv→unit f-equiv _ ⟩
f⁻¹ .id ∎
C.zag =
adj' .₁ (f⁻¹ D.id) D.∘ f C.id ≡⟨ D.refl⟩∘⟨ D.intror refl ⟩
R.₁ (f⁻¹ D.id) D.∘ f C.id D.∘ D.id ≡˘⟨ natural _ _ _ ⟩
R(f⁻¹ D.id C.∘ C.id C.∘ L.₁ D.id) ≡⟨ ap f (C.elimr (C.idl _ ∙ L.F-id)) ⟩
f (f⁻¹ D.id) ≡⟨ equiv→counit f-equiv _ ⟩
f .id ∎ D