@@ -104,24 +104,25 @@ end CommShift
104104/-- A functor `F` commutes with the shift by a monoid `A` if it is equipped with
105105commutation isomorphisms with the shifts by all `a : A`, and these isomorphisms
106106satisfy coherence properties with respect to `0 : A` and the addition in `A`. -/
107- class CommShift where
107+ class CommShift (F : C ⥤ D) (A : Type *) [AddMonoid A] [HasShift C A] [HasShift D A] where
108108 /-- The commutation isomorphisms for all `a`-shifts this functor is equipped with -/
109- iso (a : A) : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
110- zero : iso 0 = CommShift.isoZero F A := by cat_disch
111- add (a b : A) : iso (a + b) = CommShift.isoAdd (iso a) (iso b) := by cat_disch
109+ commShiftIso (F) (a : A) : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
110+ commShiftIso_zero (F) (A) : commShiftIso 0 = CommShift.isoZero F A := by cat_disch
111+ commShiftIso_add (F) (a b : A) :
112+ commShiftIso (a + b) = CommShift.isoAdd (commShiftIso a) (commShiftIso b) := by cat_disch
112113
113114variable {A}
114115
116+ export CommShift (commShiftIso commShiftIso_zero commShiftIso_add)
117+
118+ @[deprecated (since := "2025-11-11")] alias CommShift.iso := commShiftIso
119+ @[deprecated (since := "2025-11-11")] alias CommShift.zero := commShiftIso_zero
120+ @[deprecated (since := "2025-11-11")] alias CommShift.add := commShiftIso_add
121+
115122section
116123
117124variable [F.CommShift A]
118125
119- /-- If a functor `F` commutes with the shift by `A` (i.e. `[F.CommShift A]`), then
120- `F.commShiftIso a` is the given isomorphism `shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a`. -/
121- def commShiftIso (a : A) :
122- shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a :=
123- CommShift.iso a
124-
125126-- Note: The following two lemmas are introduced in order to have more proofs work `by simp`.
126127-- Indeed, `simp only [(F.commShiftIso a).hom.naturality f]` would almost never work because
127128-- of the compositions of functors which appear in both the source and target of
@@ -139,23 +140,12 @@ lemma commShiftIso_inv_naturality {X Y : C} (f : X ⟶ Y) (a : A) :
139140 (F.commShiftIso a).inv.app X ≫ F.map (f⟦a⟧') :=
140141 (F.commShiftIso a).inv.naturality f
141142
142- variable (A)
143-
144- lemma commShiftIso_zero :
145- F.commShiftIso (0 : A) = CommShift.isoZero F A :=
146- CommShift.zero
147-
143+ variable (A) in
148144set_option linter.docPrime false in
149145lemma commShiftIso_zero' (a : A) (h : a = 0 ) :
150146 F.commShiftIso a = CommShift.isoZero' F A a h := by
151147 subst h; rw [CommShift.isoZero'_eq_isoZero, commShiftIso_zero]
152148
153- variable {A}
154-
155- lemma commShiftIso_add (a b : A) :
156- F.commShiftIso (a + b) = CommShift.isoAdd (F.commShiftIso a) (F.commShiftIso b) :=
157- CommShift.add a b
158-
159149lemma commShiftIso_add' {a b c : A} (h : a + b = c) :
160150 F.commShiftIso c = CommShift.isoAdd' h (F.commShiftIso a) (F.commShiftIso b) := by
161151 subst h
@@ -166,19 +156,21 @@ end
166156namespace CommShift
167157
168158variable (C) in
159+ @[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app]
169160instance id : CommShift (𝟭 C) A where
170- iso := fun _ => rightUnitor _ ≪≫ (leftUnitor _).symm
161+ commShiftIso := fun _ => rightUnitor _ ≪≫ (leftUnitor _).symm
171162
163+ @[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app]
172164instance comp [F.CommShift A] [G.CommShift A] : (F ⋙ G).CommShift A where
173- iso a := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (F.commShiftIso a) _ ≪≫
165+ commShiftIso a := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (F.commShiftIso a) _ ≪≫
174166 Functor.associator _ _ _ ≪≫ isoWhiskerLeft _ (G.commShiftIso a) ≪≫
175167 (Functor.associator _ _ _).symm
176- zero := by
168+ commShiftIso_zero := by
177169 ext X
178170 dsimp
179171 simp only [id_comp, comp_id, commShiftIso_zero, isoZero_hom_app, ← Functor.map_comp_assoc,
180172 assoc, Iso.inv_hom_id_app, id_obj, comp_map, comp_obj]
181- add := fun a b => by
173+ commShiftIso_add := fun a b => by
182174 ext X
183175 dsimp
184176 simp only [commShiftIso_add, isoAdd_hom_app]
@@ -188,23 +180,12 @@ instance comp [F.CommShift A] [G.CommShift A] : (F ⋙ G).CommShift A where
188180
189181end CommShift
190182
191- @[simp]
192- lemma commShiftIso_id_hom_app (a : A) (X : C) :
193- (commShiftIso (𝟭 C) a).hom.app X = 𝟙 _ := comp_id _
194-
195- @[simp]
196- lemma commShiftIso_id_inv_app (a : A) (X : C) :
197- (commShiftIso (𝟭 C) a).inv.app X = 𝟙 _ := comp_id _
198-
199- lemma commShiftIso_comp_hom_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) :
200- (commShiftIso (F ⋙ G) a).hom.app X =
201- G.map ((commShiftIso F a).hom.app X) ≫ (commShiftIso G a).hom.app (F.obj X) := by
202- simp [commShiftIso, CommShift.iso]
183+ alias commShiftIso_id_hom_app := CommShift.id_commShiftIso_hom_app
184+ alias commShiftIso_id_inv_app := CommShift.id_commShiftIso_inv_app
185+ alias commShiftIso_comp_hom_app := CommShift.comp_commShiftIso_hom_app
186+ alias commShiftIso_comp_inv_app := CommShift.comp_commShiftIso_inv_app
203187
204- lemma commShiftIso_comp_inv_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) :
205- (commShiftIso (F ⋙ G) a).inv.app X =
206- (commShiftIso G a).inv.app (F.obj X) ≫ G.map ((commShiftIso F a).inv.app X) := by
207- simp [commShiftIso, CommShift.iso]
188+ attribute [simp] commShiftIso_id_hom_app commShiftIso_id_inv_app
208189
209190variable {B}
210191
@@ -354,16 +335,13 @@ variable {C D E : Type*} [Category C] [Category D]
354335
355336/-- If `e : F ≅ G` is an isomorphism of functors and if `F` commutes with the
356337shift, then `G` also commutes with the shift. -/
338+ @[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app]
357339def ofIso : G.CommShift A where
358- iso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _
359- zero := by
340+ commShiftIso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _
341+ commShiftIso_zero := by
360342 ext X
361- simp only [comp_obj, F.commShiftIso_zero A, Iso.trans_hom, isoWhiskerLeft_hom,
362- Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app,
363- isoZero_hom_app, whiskerRight_app, assoc]
364- erw [← e.inv.naturality_assoc, ← NatTrans.naturality,
365- e.inv_hom_id_app_assoc]
366- add a b := by
343+ simp [F.commShiftIso_zero, ← NatTrans.naturality]
344+ commShiftIso_add a b := by
367345 ext X
368346 simp only [comp_obj, F.commShiftIso_add, Iso.trans_hom, isoWhiskerLeft_hom,
369347 Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app,
@@ -376,9 +354,7 @@ lemma ofIso_compatibility :
376354 letI := ofIso e A
377355 NatTrans.CommShift e.hom A := by
378356 letI := ofIso e A
379- refine ⟨fun a => ?_⟩
380- dsimp [commShiftIso, ofIso]
381- rw [← whiskerLeft_comp_assoc, e.hom_inv_id, whiskerLeft_id', id_comp]
357+ exact ⟨fun a => by ext; simp [ofIso_commShiftIso_hom_app]⟩
382358
383359end CommShift
384360
0 commit comments