Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 96d748e

Browse files
kim-emmergify[bot]
authored andcommitted
refactor(category_theory): rename functor.on_iso to functor.map_iso (#893)
* feat(category_theory): functor.map_nat_iso * define `functor.map_nat_iso`, and relate to whiskering * rename `functor.on_iso` to `functor.map_iso` * add some missing lemmas about whiskering * some more missing whiskering lemmas, while we're at it * removing map_nat_iso
1 parent d692499 commit 96d748e

File tree

6 files changed

+53
-13
lines changed

6 files changed

+53
-13
lines changed

src/category_theory/eq_to_hom.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ end functor
6868
by cases p; simp
6969

7070
@[simp] lemma eq_to_iso_map (F : C ⥤ D) {X Y : C} (p : X = Y) :
71-
F.on_iso (eq_to_iso p) = eq_to_iso (congr_arg F.obj p) :=
71+
F.map_iso (eq_to_iso p) = eq_to_iso (congr_arg F.obj p) :=
7272
by ext; cases p; simp
7373

7474
@[simp] lemma eq_to_hom_app {F G : C ⥤ D} (h : F = G) (X : C) :

src/category_theory/equivalence.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ include ℰ
6161
(e.inverse).obj ((f.inverse).obj ((f.functor).obj ((e.functor).obj X))) ≅ X :=
6262
calc
6363
(e.inverse).obj ((f.inverse).obj ((f.functor).obj ((e.functor).obj X)))
64-
≅ (e.inverse).obj ((e.functor).obj X) : e.inverse.on_iso (nat_iso.app f.fun_inv_id _)
64+
≅ (e.inverse).obj ((e.functor).obj X) : e.inverse.map_iso (nat_iso.app f.fun_inv_id _)
6565
... ≅ X : nat_iso.app e.fun_inv_id _
6666

6767
@[simp] private def feef_iso_id (e : C ≌ D) (f : D ≌ E) (X : E) :
6868
(f.functor).obj ((e.functor).obj ((e.inverse).obj ((f.inverse).obj X))) ≅ X :=
6969
calc
7070
(f.functor).obj ((e.functor).obj ((e.inverse).obj ((f.inverse).obj X)))
71-
≅ (f.functor).obj ((f.inverse).obj X) : f.functor.on_iso (nat_iso.app e.inv_fun_id _)
71+
≅ (f.functor).obj ((f.inverse).obj X) : f.functor.map_iso (nat_iso.app e.inv_fun_id _)
7272
... ≅ X : nat_iso.app f.inv_fun_id _
7373

7474
@[trans] def trans (e : C ≌ D) (f : D ≌ E) : C ≌ E :=

src/category_theory/isomorphism.lean

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ calc α.inv
4848
@[simp] lemma symm_hom (α : X ≅ Y) : α.symm.hom = α.inv := rfl
4949
@[simp] lemma symm_inv (α : X ≅ Y) : α.symm.inv = α.hom := rfl
5050

51+
@[simp] lemma symm_mk {X Y : C} (hom : X ⟶ Y) (inv : Y ⟶ X) (hom_inv_id) (inv_hom_id) :
52+
iso.symm {hom := hom, inv := inv, hom_inv_id' := hom_inv_id, inv_hom_id' := inv_hom_id} =
53+
{hom := inv, inv := hom, hom_inv_id' := inv_hom_id, inv_hom_id' := hom_inv_id} := rfl
54+
5155
@[refl] def refl (X : C) : X ≅ X :=
5256
{ hom := 𝟙 X,
5357
inv := 𝟙 X }
@@ -64,6 +68,15 @@ infixr ` ≪≫ `:80 := iso.trans -- type as `\ll \gg`.
6468
@[simp] lemma trans_hom (α : X ≅ Y) (β : Y ≅ Z) : (α ≪≫ β).hom = α.hom ≫ β.hom := rfl
6569
@[simp] lemma trans_inv (α : X ≅ Y) (β : Y ≅ Z) : (α ≪≫ β).inv = β.inv ≫ α.inv := rfl
6670

71+
@[simp] lemma trans_mk {X Y Z : C}
72+
(hom : X ⟶ Y) (inv : Y ⟶ X) (hom_inv_id) (inv_hom_id)
73+
(hom' : Y ⟶ Z) (inv' : Z ⟶ Y) (hom_inv_id') (inv_hom_id') (hom_inv_id'') (inv_hom_id'') :
74+
iso.trans
75+
{hom := hom, inv := inv, hom_inv_id' := hom_inv_id, inv_hom_id' := inv_hom_id}
76+
{hom := hom', inv := inv', hom_inv_id' := hom_inv_id', inv_hom_id' := inv_hom_id'} =
77+
{hom := hom ≫ hom', inv := inv' ≫ inv, hom_inv_id' := hom_inv_id'', inv_hom_id' := inv_hom_id''} :=
78+
rfl
79+
6780
@[simp] lemma refl_symm (X : C) : (iso.refl X).hom = 𝟙 X := rfl
6881
@[simp] lemma trans_symm (α : X ≅ Y) (β : Y ≅ Z) : (α ≪≫ β).inv = β.inv ≫ α.inv := rfl
6982

@@ -132,14 +145,14 @@ variables {D : Sort u₂}
132145
variables [𝒟 : category.{v₂} D]
133146
include 𝒟
134147

135-
def on_iso (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : F.obj X ≅ F.obj Y :=
148+
def map_iso (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : F.obj X ≅ F.obj Y :=
136149
{ hom := F.map i.hom,
137150
inv := F.map i.inv,
138151
hom_inv_id' := by rw [←map_comp, iso.hom_inv_id, ←map_id],
139152
inv_hom_id' := by rw [←map_comp, iso.inv_hom_id, ←map_id] }
140153

141-
@[simp] lemma on_iso_hom (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : (F.on_iso i).hom = F.map i.hom := rfl
142-
@[simp] lemma on_iso_inv (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : (F.on_iso i).inv = F.map i.inv := rfl
154+
@[simp] lemma map_iso_hom (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : (F.map_iso i).hom = F.map i.hom := rfl
155+
@[simp] lemma map_iso_inv (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : (F.map_iso i).inv = F.map i.inv := rfl
143156

144157
instance (F : C ⥤ D) (f : X ⟶ Y) [is_iso f] : is_iso (F.map f) :=
145158
{ inv := F.map (inv f),

src/category_theory/limits/preserves.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ end
126126
then it preserves any limit cone for K. -/
127127
def preserves_limit_of_preserves_limit_cone {F : C ⥤ D} {t : cone K}
128128
(h : is_limit t) (hF : is_limit (F.map_cone t)) : preserves_limit K F :=
129-
⟨λ t' h', is_limit.of_iso_limit hF (functor.on_iso _ (is_limit.unique h h'))⟩
129+
⟨λ t' h', is_limit.of_iso_limit hF (functor.map_iso _ (is_limit.unique h h'))⟩
130130

131131
/-- If F preserves one colimit cocone for the diagram K,
132132
then it preserves any colimit cocone for K. -/
133133
def preserves_colimit_of_preserves_colimit_cocone {F : C ⥤ D} {t : cocone K}
134134
(h : is_colimit t) (hF : is_colimit (F.map_cocone t)) : preserves_colimit K F :=
135-
⟨λ t' h', is_colimit.of_iso_colimit hF (functor.on_iso _ (is_colimit.unique h h'))⟩
135+
⟨λ t' h', is_colimit.of_iso_colimit hF (functor.map_iso _ (is_colimit.unique h h'))⟩
136136

137137
/-
138138
A functor F : C → D reflects limits if whenever the image of a cone

src/category_theory/natural_isomorphism.lean

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
import category_theory.isomorphism
66
import category_theory.functor_category
7+
import category_theory.whiskering
78

89
open category_theory
910

10-
namespace category_theory.nat_iso
11+
universes v₁ v₂ v₃ u₁ u₂ u₃ -- declare the `v`'s first; see `category_theory.category` for an explanation
1112

12-
universes v₁ v₂ u₁ u₂ -- declare the `v`'s first; see `category_theory.category` for an explanation
13+
namespace category_theory.nat_iso
1314

1415
variables {C : Sort u₁} [𝒞 : category.{v₁} C] {D : Sort u₂} [𝒟 : category.{v₂} D]
1516
include 𝒞 𝒟
@@ -92,9 +93,9 @@ by tidy
9293

9394
end category_theory.nat_iso
9495

95-
namespace category_theory.functor
96+
open category_theory
9697

97-
universes u₁ u₂ v₁ v₂
98+
namespace category_theory.functor
9899

99100
section
100101
variables {C : Sort u₁} [𝒞 : category.{v₁} C]
@@ -108,7 +109,7 @@ include 𝒞 𝒟
108109
{ hom := { app := λ X, 𝟙 (F.obj X) },
109110
inv := { app := λ X, 𝟙 (F.obj X) } }
110111

111-
universes u₃ v₃ u₄ v
112+
universes v₄ u
112113

113114
variables {A : Sort u₃} [𝒜 : category.{v₃} A]
114115
{B : Sort u₄} [ℬ : category.{v₄} B]

src/category_theory/whiskering.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,50 @@ variables {C} {D} {E}
4545
def whisker_left (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟹ H) : (F ⋙ G) ⟹ (F ⋙ H) :=
4646
((whiskering_left C D E).obj F).map α
4747

48+
@[simp] lemma whiskering_left_obj_obj (F : C ⥤ D) (G : D ⥤ E) :
49+
((whiskering_left C D E).obj F).obj G = F ⋙ G :=
50+
rfl
51+
@[simp] lemma whiskering_left_obj_map (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟹ H) :
52+
((whiskering_left C D E).obj F).map α = whisker_left F α :=
53+
rfl
54+
@[simp] lemma whiskering_left_map_app_app {F G : C ⥤ D} (τ : F ⟹ G) (H : D ⥤ E) (c) :
55+
(((whiskering_left C D E).map τ).app H).app c = H.map (τ.app c) :=
56+
rfl
57+
4858
@[simp] lemma whisker_left.app (F : C ⥤ D) {G H : D ⥤ E} (α : G ⟹ H) (X : C) :
4959
(whisker_left F α).app X = α.app (F.obj X) :=
5060
rfl
5161

5262
def whisker_right {G H : C ⥤ D} (α : G ⟹ H) (F : D ⥤ E) : (G ⋙ F) ⟹ (H ⋙ F) :=
5363
((whiskering_right C D E).obj F).map α
5464

65+
@[simp] lemma whiskering_right_obj_obj (G : C ⥤ D) (F : D ⥤ E) :
66+
((whiskering_right C D E).obj F).obj G = G ⋙ F :=
67+
rfl
68+
@[simp] lemma whiskering_right_obj_map {G H : C ⥤ D} (α : G ⟹ H) (F : D ⥤ E) :
69+
((whiskering_right C D E).obj F).map α = whisker_right α F :=
70+
rfl
71+
@[simp] lemma whiskering_right_map_app_app (F : C ⥤ D) {G H : D ⥤ E} (τ : G ⟹ H) (c) :
72+
(((whiskering_right C D E).map τ).app F).app c = τ.app (F.obj c) :=
73+
rfl
74+
5575
@[simp] lemma whisker_right.app {G H : C ⥤ D} (α : G ⟹ H) (F : D ⥤ E) (X : C) :
5676
(whisker_right α F).app X = F.map (α.app X) :=
5777
rfl
5878

5979
@[simp] lemma whisker_left_id (F : C ⥤ D) {G : D ⥤ E} :
6080
whisker_left F (nat_trans.id G) = nat_trans.id (F.comp G) :=
6181
rfl
82+
@[simp] lemma whisker_left_id' (F : C ⥤ D) {G : D ⥤ E} :
83+
whisker_left F (𝟙 G) = 𝟙 (F.comp G) :=
84+
rfl
6285

6386
@[simp] lemma whisker_right_id {G : C ⥤ D} (F : D ⥤ E) :
6487
whisker_right (nat_trans.id G) F = nat_trans.id (G.comp F) :=
6588
((whiskering_right C D E).obj F).map_id _
89+
@[simp] lemma whisker_right_id' {G : C ⥤ D} (F : D ⥤ E) :
90+
whisker_right (𝟙 G) F = 𝟙 (G.comp F) :=
91+
((whiskering_right C D E).obj F).map_id _
6692

6793
@[simp] lemma whisker_left_vcomp (F : C ⥤ D) {G H K : D ⥤ E} (α : G ⟹ H) (β : H ⟹ K) :
6894
whisker_left F (α ⊟ β) = (whisker_left F α) ⊟ (whisker_left F β) :=

0 commit comments

Comments
 (0)