Skip to content

Commit 40436c4

Browse files
chore(CategoryTheory/Adjunction): deduplicate API for uniqueness of adjoints (#17113)
Removes some API from the file `Adjunction.Unique` which was a duplicate of API from `Adjunction.Mates` Co-authored-by: @emilyriehl Co-authored-by: dagurtomas <dagurtomas@gmail.com>
1 parent 685ce1b commit 40436c4

File tree

3 files changed

+55
-100
lines changed

3 files changed

+55
-100
lines changed

Mathlib/CategoryTheory/Adjunction/Basic.lean

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import Mathlib.CategoryTheory.Yoneda
1414
1515
We provide various useful constructors:
1616
* `mkOfHomEquiv`
17-
* `mkOfUnitCounit`
17+
* `mk'`: construct an adjunction from the data of a hom set equivalence, unit and counit natural
18+
transformations together with proofs of the equalities `homEquiv_unit` and `homEquiv_counit`
19+
relating them to each other.
1820
* `leftAdjointOfEquiv` / `rightAdjointOfEquiv`
1921
construct a left/right adjoint of a given functor given the action on objects and
2022
the relevant equivalence of morphism spaces.
@@ -30,6 +32,44 @@ adjoint can be obtained as `F.rightAdjoint`.
3032
`toEquivalence` upgrades an adjunction to an equivalence,
3133
given witnesses that the unit and counit are pointwise isomorphisms.
3234
Conversely `Equivalence.toAdjunction` recovers the underlying adjunction from an equivalence.
35+
36+
## Overview of the directory `CategoryTheory.Adjunction`
37+
38+
* Adjoint lifting theorems are in the directory `Lifting`.
39+
* The file `AdjointFunctorTheorems` proves the adjoint functor theorems.
40+
* The file `Comma` shows that for a functor `G : D ⥤ C` the data of an initial object in each
41+
`StructuredArrow` category on `G` is equivalent to a left adjoint to `G`, as well as the dual.
42+
* The file `Evaluation` shows that products and coproducts are adjoint to evaluation of functors.
43+
* The file `FullyFaithful` characterizes when adjoints are full or faithful in terms of the unit
44+
and counit.
45+
* The file `Limits` proves that left adjoints preserve colimits and right adjoints preserve limits.
46+
* The file `Mates` establishes the bijection between the 2-cells
47+
```
48+
L₁ R₁
49+
C --→ D C ←-- D
50+
G ↓ ↗ ↓ H G ↓ ↘ ↓ H
51+
E --→ F E ←-- F
52+
L₂ R₂
53+
```
54+
where `L₁ ⊣ R₁` and `L₂ ⊣ R₂`. Specializing to a pair of adjoints `L₁ L₂ : C ⥤ D`,
55+
`R₁ R₂ : D ⥤ C`, it provides equivalences `(L₂ ⟶ L₁) ≃ (R₁ ⟶ R₂)` and `(L₂ ≅ L₁) ≃ (R₁ ≅ R₂)`.
56+
* The file `Opposites` contains constructions to relate adjunctions of functors to adjunctions of
57+
their opposites.
58+
* The file `Reflective` defines reflective functors, i.e. fully faithful right adjoints. Note that
59+
many facts about reflective functors are proved in the earlier file `FullyFaithful`.
60+
* The file `Restrict` defines the restriction of an adjunction along fully faithful functors.
61+
* The file `Triple` proves that in an adjoint triple, the left adjoint is fully faithful if and
62+
only if the right adjoint is.
63+
* The file `Unique` proves uniqueness of adjoints.
64+
* The file `Whiskering` proves that functors `F : D ⥤ E` and `G : E ⥤ D` with an adjunction
65+
`F ⊣ G`, induce adjunctions between the functor categories `C ⥤ D` and `C ⥤ E`,
66+
and the functor categories `E ⥤ C` and `D ⥤ C`.
67+
68+
## Other files related to adjunctions
69+
70+
* The file `CategoryTheory.Monad.Adjunction` develops the basic relationship between adjunctions
71+
and (co)monads. There it is also shown that given an adjunction `L ⊣ R` and an isomorphism
72+
`L ⋙ R ≅ 𝟭 C`, the unit is an isomorphism, and similarly for the counit.
3373
-/
3474

3575

@@ -59,8 +99,6 @@ hom set equivalence.
5999
To construct adjoints to a given functor, there are constructors `leftAdjointOfEquiv` and
60100
`adjunctionOfEquivLeft` (as well as their duals).
61101
62-
Uniqueness of adjoints is shown in `CategoryTheory.Adjunction.Unique`.
63-
64102
See <https://stacks.math.columbia.edu/tag/0037>.
65103
-/
66104
structure Adjunction (F : C ⥤ D) (G : D ⥤ C) where

Mathlib/CategoryTheory/Adjunction/Mates.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import Mathlib.Tactic.ApplyFun
1313
1414
This file establishes the bijection between the 2-cells
1515
16+
```
1617
L₁ R₁
1718
C --→ D C ←-- D
1819
G ↓ ↗ ↓ H G ↓ ↘ ↓ H
1920
E --→ F E ←-- F
2021
L₂ R₂
22+
```
2123
2224
where `L₁ ⊣ R₁` and `L₂ ⊣ R₂`. The corresponding natural transformations are called mates.
2325

Mathlib/CategoryTheory/Adjunction/Unique.lean

Lines changed: 12 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,21 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Bhavik Mehta, Thomas Read, Andrew Yang, Dagur Asgeirsson, Joël Riou
55
-/
6-
import Mathlib.CategoryTheory.Adjunction.Basic
6+
import Mathlib.CategoryTheory.Adjunction.Mates
77
/-!
88
99
# Uniqueness of adjoints
1010
1111
This file shows that adjoints are unique up to natural isomorphism.
1212
1313
## Main results
14-
* `Adjunction.natTransEquiv` and `Adjunction.natIsoEquiv` If `F ⊣ G` and `F' ⊣ G'` are adjunctions,
15-
then there are equivalences `(G ⟶ G') ≃ (F' ⟶ F)` and `(G ≅ G') ≃ (F' ≅ F)`.
16-
Everything else is deduced from this:
1714
1815
* `Adjunction.leftAdjointUniq` : If `F` and `F'` are both left adjoint to `G`, then they are
1916
naturally isomorphic.
2017
2118
* `Adjunction.rightAdjointUniq` : If `G` and `G'` are both right adjoint to `F`, then they are
2219
naturally isomorphic.
2320
24-
## TODO
25-
26-
There some overlap with the file `Adjunction.Mates`. In particular, `natTransEquiv` is just a
27-
special case of `mateEquiv`. However, before removing `natTransEquiv`, in favour of `mateEquiv`,
28-
the latter needs some more API lemmas such as `natTransEquiv_apply_app`, `natTransEquiv_id`, etc.
29-
in order to make automation work better in the rest of this file.
3021
-/
3122

3223
open CategoryTheory
@@ -35,89 +26,9 @@ variable {C D : Type*} [Category C] [Category D]
3526

3627
namespace CategoryTheory.Adjunction
3728

38-
/--
39-
If `F ⊣ G` and `F' ⊣ G'` are adjunctions, then giving a natural transformation `G ⟶ G'` is the
40-
same as giving a natural transformation `F' ⟶ F`.
41-
-/
42-
@[simps]
43-
def natTransEquiv {F F' : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G') :
44-
(G ⟶ G') ≃ (F' ⟶ F) where
45-
toFun f := {
46-
app := fun X ↦ F'.map ((adj1.unit ≫ whiskerLeft F f).app X) ≫ adj2.counit.app _
47-
naturality := by
48-
intro X Y g
49-
simp only [← Category.assoc, ← Functor.map_comp]
50-
erw [(adj1.unit ≫ (whiskerLeft F f)).naturality]
51-
simp
52-
}
53-
invFun f := {
54-
app := fun X ↦ adj2.unit.app (G.obj X) ≫ G'.map (f.app (G.obj X) ≫ adj1.counit.app X)
55-
naturality := by
56-
intro X Y g
57-
erw [← adj2.unit_naturality_assoc]
58-
simp only [← Functor.map_comp]
59-
simp
60-
}
61-
left_inv f := by
62-
ext X
63-
simp only [Functor.comp_obj, NatTrans.comp_app, Functor.id_obj, whiskerLeft_app,
64-
Functor.map_comp, Category.assoc, unit_naturality_assoc, right_triangle_components_assoc]
65-
erw [← f.naturality (adj1.counit.app X), ← Category.assoc]
66-
simp
67-
right_inv f := by
68-
ext
69-
simp
70-
71-
@[simp]
72-
lemma natTransEquiv_id {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G) :
73-
natTransEquiv adj adj (𝟙 _) = 𝟙 _ := by ext; simp
74-
75-
@[simp]
76-
lemma natTransEquiv_id_symm {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G) :
77-
(natTransEquiv adj adj).symm (𝟙 _) = 𝟙 _ := by ext; simp
78-
79-
@[simp]
80-
lemma natTransEquiv_comp {F F' F'' : C ⥤ D} {G G' G'' : D ⥤ C}
81-
(adj1 : F ⊣ G) (adj2 : F' ⊣ G') (adj3 : F'' ⊣ G'') (f : G ⟶ G') (g : G' ⟶ G'') :
82-
natTransEquiv adj2 adj3 g ≫ natTransEquiv adj1 adj2 f = natTransEquiv adj1 adj3 (f ≫ g) := by
83-
apply (natTransEquiv adj1 adj3).symm.injective
84-
ext X
85-
simp only [natTransEquiv_symm_apply_app, Functor.comp_obj, NatTrans.comp_app,
86-
natTransEquiv_apply_app, Functor.id_obj, whiskerLeft_app, Functor.map_comp, Category.assoc,
87-
unit_naturality_assoc, right_triangle_components_assoc, Equiv.symm_apply_apply,
88-
← g.naturality_assoc, ← g.naturality]
89-
simp only [← Category.assoc, unit_naturality, Functor.comp_obj, right_triangle_components,
90-
Category.comp_id, ← f.naturality, Category.id_comp]
91-
92-
@[simp]
93-
lemma natTransEquiv_comp_symm {F F' F'' : C ⥤ D} {G G' G'' : D ⥤ C}
94-
(adj1 : F ⊣ G) (adj2 : F' ⊣ G') (adj3 : F'' ⊣ G'') (f : F' ⟶ F) (g : F'' ⟶ F') :
95-
(natTransEquiv adj1 adj2).symm f ≫ (natTransEquiv adj2 adj3).symm g =
96-
(natTransEquiv adj1 adj3).symm (g ≫ f) := by
97-
apply (natTransEquiv adj1 adj3).injective
98-
ext
99-
simp
100-
101-
/--
102-
If `F ⊣ G` and `F' ⊣ G'` are adjunctions, then giving a natural isomorphism `G ≅ G'` is the
103-
same as giving a natural transformation `F' ≅ F`.
104-
-/
105-
@[simps]
106-
def natIsoEquiv {F F' : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G') :
107-
(G ≅ G') ≃ (F' ≅ F) where
108-
toFun i := {
109-
hom := natTransEquiv adj1 adj2 i.hom
110-
inv := natTransEquiv adj2 adj1 i.inv
111-
}
112-
invFun i := {
113-
hom := (natTransEquiv adj1 adj2).symm i.hom
114-
inv := (natTransEquiv adj2 adj1).symm i.inv }
115-
left_inv i := by simp
116-
right_inv i := by simp
117-
11829
/-- If `F` and `F'` are both left adjoint to `G`, then they are naturally isomorphic. -/
11930
def leftAdjointUniq {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G) : F ≅ F' :=
120-
(natIsoEquiv adj1 adj2 (Iso.refl _)).symm
31+
((conjugateIsoEquiv adj1 adj2).symm (Iso.refl G)).symm
12132

12233
-- Porting note (#10618): removed simp as simp can prove this
12334
theorem homEquiv_leftAdjointUniq_hom_app {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G)
@@ -141,9 +52,10 @@ theorem unit_leftAdjointUniq_hom_app
14152
theorem leftAdjointUniq_hom_counit {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G) :
14253
whiskerLeft G (leftAdjointUniq adj1 adj2).hom ≫ adj2.counit = adj1.counit := by
14354
ext x
144-
simp only [Functor.comp_obj, Functor.id_obj, leftAdjointUniq, Iso.symm_hom, natIsoEquiv_apply_inv,
145-
Iso.refl_inv, NatTrans.comp_app, whiskerLeft_app, natTransEquiv_apply_app, whiskerLeft_id',
146-
Category.comp_id, Category.assoc]
55+
simp only [Functor.comp_obj, Functor.id_obj, leftAdjointUniq, Iso.symm_hom,
56+
conjugateIsoEquiv_symm_apply_inv, Iso.refl_inv, NatTrans.comp_app, whiskerLeft_app,
57+
conjugateEquiv_symm_apply_app, NatTrans.id_app, Functor.map_id, Category.id_comp,
58+
Category.assoc]
14759
rw [← adj1.counit_naturality, ← Category.assoc, ← F.map_comp]
14860
simp
14961

@@ -180,7 +92,7 @@ theorem leftAdjointUniq_refl {F : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) :
18092

18193
/-- If `G` and `G'` are both right adjoint to `F`, then they are naturally isomorphic. -/
18294
def rightAdjointUniq {F : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F ⊣ G') : G ≅ G' :=
183-
(natIsoEquiv adj1 adj2).symm (Iso.refl _)
95+
conjugateIsoEquiv adj1 adj2 (Iso.refl _)
18496

18597
-- Porting note (#10618): simp can prove this
18698
theorem homEquiv_symm_rightAdjointUniq_hom_app {F : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G)
@@ -192,8 +104,8 @@ theorem homEquiv_symm_rightAdjointUniq_hom_app {F : C ⥤ D} {G G' : D ⥤ C} (a
192104
theorem unit_rightAdjointUniq_hom_app {F : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F ⊣ G')
193105
(x : C) : adj1.unit.app x ≫ (rightAdjointUniq adj1 adj2).hom.app (F.obj x) =
194106
adj2.unit.app x := by
195-
simp only [Functor.id_obj, Functor.comp_obj, rightAdjointUniq, natIsoEquiv_symm_apply_hom,
196-
Iso.refl_hom, natTransEquiv_symm_apply_app, NatTrans.id_app, Category.id_comp]
107+
simp only [Functor.id_obj, Functor.comp_obj, rightAdjointUniq, conjugateIsoEquiv_apply_hom,
108+
Iso.refl_hom, conjugateEquiv_apply_app, NatTrans.id_app, Functor.map_id, Category.id_comp]
197109
rw [← adj2.unit_naturality_assoc, ← G'.map_comp]
198110
simp
199111

@@ -243,4 +155,7 @@ theorem rightAdjointUniq_refl {F : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) :
243155

244156
end Adjunction
245157

158+
@[deprecated (since := "2024-10-07")] alias Adjunction.natTransEquiv := conjugateEquiv
159+
@[deprecated (since := "2024-10-07")] alias Adjunction.natIsoEquiv := conjugateIsoEquiv
160+
246161
end CategoryTheory

0 commit comments

Comments
 (0)