Skip to content

Commit 0411276

Browse files
committed
feat(CategoryTheory/Equivalence): functoriality of symmetry of equivalences (#23198)
We introduce a file `CategoryTheory/Equivalence/Symmetry` in which we continue to provide basic API for the category structure on equivalences defined in #23197. We prove that symmetry of equivalences defines an equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ`, and we use this to construct `Equivalence.inverseFunctor: (C ≌ D) ⥤ (D ⥤ C)ᵒᵖ` that takes an equivalence to its inverse functor, and to promote `Equivalence.congrLeft` to a functor.
1 parent 923a83b commit 0411276

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,7 @@ import Mathlib.CategoryTheory.Enriched.Ordinary.Basic
20172017
import Mathlib.CategoryTheory.EpiMono
20182018
import Mathlib.CategoryTheory.EqToHom
20192019
import Mathlib.CategoryTheory.Equivalence
2020+
import Mathlib.CategoryTheory.Equivalence.Symmetry
20202021
import Mathlib.CategoryTheory.EssentialImage
20212022
import Mathlib.CategoryTheory.EssentiallySmall
20222023
import Mathlib.CategoryTheory.Extensive
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/-
2+
Copyright (c) 2025 Robin Carlier. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Robin Carlier
5+
-/
6+
import Mathlib.CategoryTheory.Equivalence
7+
import Mathlib.CategoryTheory.Adjunction.Mates
8+
9+
/-!
10+
# Functoriality of the symmetry of equivalences
11+
12+
Using the calculus of mates in `CategoryTheory.Adjunction.Mates`, we prove that passing
13+
to the symmetric equivalence defines an equivalence between `C ≌ D` and `(D ≌ C)ᵒᵖ`,
14+
and provides the definition of the functor that takes an equivalence to its inverse.
15+
16+
## Main definitions
17+
- `Equivalence.symmEquiv C D`: the equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ` obtained by
18+
taking `Equivalence.symm` on objects, and `conjugateEquiv` on maps.
19+
- `Equivalence.inverseFunctor C D`: The functor `(C ≌ D) ⥤ (D ⥤ C)ᵒᵖ` sending an equivalence
20+
`e` to the functor `e.inverse`.
21+
- `congrLeftFunctor C D E`: the functor (C ≌ D) ⥤ ((C ⥤ E) ≌ (D ⥤ E))ᵒᵖ that applies
22+
`Equivalence.congrLeft` on objects, and whiskers left by `conjugateEquiv` on maps.
23+
24+
-/
25+
26+
namespace CategoryTheory
27+
28+
open CategoryTheory.Functor NatIso Category
29+
30+
namespace Equivalence
31+
32+
variable (C : Type*) [Category C] (D : Type*) [Category D]
33+
34+
/-- The forward functor of the equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ`. -/
35+
@[simps]
36+
def symmEquivFunctor : (C ≌ D) ⥤ (D ≌ C)ᵒᵖ where
37+
obj e := Opposite.op e.symm
38+
map {e f} α := (mkHom <| conjugateEquiv f.toAdjunction e.toAdjunction <| asNatTrans α).op
39+
map_comp _ _ := Quiver.Hom.unop_inj (by aesop_cat)
40+
41+
/-- The inverse functor of the equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ`. -/
42+
@[simps!]
43+
def symmEquivInverse : (D ≌ C)ᵒᵖ ⥤ (C ≌ D) :=
44+
Functor.leftOp
45+
{ obj e := Opposite.op e.symm
46+
map {e f} α := Quiver.Hom.op <| mkHom <|
47+
conjugateEquiv e.symm.toAdjunction f.symm.toAdjunction |>.invFun <| asNatTrans α
48+
map_comp _ _ := Quiver.Hom.unop_inj (by aesop_cat) }
49+
50+
/-- Taking the symmetric of an equivalence induces an equivalence of categories
51+
`(C ≌ D) ≌ (D ≌ C)ᵒᵖ`. -/
52+
@[simps]
53+
def symmEquiv : (C ≌ D) ≌ (D ≌ C)ᵒᵖ where
54+
functor := symmEquivFunctor _ _
55+
inverse := symmEquivInverse _ _
56+
counitIso :=
57+
NatIso.ofComponents (fun e ↦ Iso.op <| Iso.refl _) <| fun _ ↦
58+
(by simp [symm, symmEquivInverse])
59+
unitIso :=
60+
NatIso.ofComponents (fun e ↦ Iso.refl _) <| fun _ ↦ by
61+
ext c
62+
simp [symm, symmEquivInverse]
63+
functor_unitIso_comp X := by
64+
simp [symm, symmEquivInverse]
65+
66+
/-- The `inverse` functor that sends a functor to its inverse. -/
67+
@[simps!]
68+
def inverseFunctor : (C ≌ D) ⥤ (D ⥤ C)ᵒᵖ :=
69+
(symmEquiv C D).functor ⋙ (Functor.op <| functorFunctor D C)
70+
71+
variable {C D}
72+
73+
/-- The `inverse` functor sends an equivalence to its inverse. -/
74+
@[simps!]
75+
def inverseFunctorObjIso (e : C ≌ D) :
76+
(inverseFunctor C D).obj e ≅ Opposite.op e.inverse := Iso.refl _
77+
78+
/-- We can compare the way we obtain a natural isomorphism `e.inverse ≅ f.inverse` from
79+
an isomorphism `e ≌ f` via `inverseFunctor` with the way we get one through
80+
`Iso.isoInverseOfIsoFunctor`. -/
81+
lemma inverseFunctorMapIso_symm_eq_isoInverseOfIsoFunctor {e f: C ≌ D} (α : e ≅ f) :
82+
Iso.unop ((inverseFunctor C D).mapIso α.symm) =
83+
Iso.isoInverseOfIsoFunctor ((functorFunctor _ _).mapIso α) := by
84+
aesop_cat
85+
86+
/-- An "unopped" version of the equivalence `inverseFunctorObj'. -/
87+
@[simps!]
88+
def inverseFunctorObj' (e : C ≌ D) :
89+
Opposite.unop ((inverseFunctor C D).obj e) ≅ e.inverse :=
90+
Iso.refl _
91+
92+
variable (C D) in
93+
/-- Promoting `Equivalence.congrLeft` to a functor. -/
94+
@[simps!]
95+
def congrLeftFunctor (E : Type*) [Category E] : (C ≌ D) ⥤ ((C ⥤ E) ≌ (D ⥤ E))ᵒᵖ :=
96+
Functor.rightOp
97+
{ obj f := f.unop.congrLeft
98+
map {e f} α := mkHom <| (whiskeringLeft _ _ _).map <|
99+
conjugateEquiv e.unop.toAdjunction f.unop.toAdjunction <| asNatTrans <|
100+
Quiver.Hom.unop α
101+
map_comp _ _ := by
102+
ext
103+
simp [← map_comp] }
104+
105+
end Equivalence
106+
107+
end CategoryTheory

0 commit comments

Comments
 (0)