@@ -147,13 +147,39 @@ end
147147
148148namespace CommShift
149149
150- variable (C)
151-
150+ variable (C) in
152151instance id : CommShift (𝟭 C) A where
153152 iso := fun a => rightUnitor _ ≪≫ (leftUnitor _).symm
154153
154+ instance comp [F.CommShift A] [G.CommShift A] : (F ⋙ G).CommShift A where
155+ iso a := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (F.commShiftIso a) _ ≪≫
156+ Functor.associator _ _ _ ≪≫ isoWhiskerLeft _ (G.commShiftIso a) ≪≫
157+ (Functor.associator _ _ _).symm
158+ zero := by
159+ ext X
160+ dsimp
161+ simp only [id_comp, comp_id, commShiftIso_zero, isoZero_hom_app, ← Functor.map_comp_assoc,
162+ assoc, Iso.inv_hom_id_app, id_obj, comp_map, comp_obj]
163+ add := fun a b => by
164+ ext X
165+ dsimp
166+ simp only [commShiftIso_add, isoAdd_hom_app]
167+ dsimp
168+ simp only [comp_id, id_comp, assoc, ← Functor.map_comp_assoc, Iso.inv_hom_id_app, comp_obj]
169+ simp only [map_comp, assoc, commShiftIso_hom_naturality_assoc]
170+
155171end CommShift
156172
173+ lemma commShiftIso_comp_hom_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) :
174+ (commShiftIso (F ⋙ G) a).hom.app X =
175+ G.map ((commShiftIso F a).hom.app X) ≫ (commShiftIso G a).hom.app (F.obj X) := by
176+ simp [commShiftIso, CommShift.iso]
177+
178+ lemma commShiftIso_comp_inv_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) :
179+ (commShiftIso (F ⋙ G) a).inv.app X =
180+ (commShiftIso G a).inv.app (F.obj X) ≫ G.map ((commShiftIso F a).inv.app X) := by
181+ simp [commShiftIso, CommShift.iso]
182+
157183variable {B}
158184
159185lemma map_shiftFunctorComm_hom_app [F.CommShift B] (X : C) (a b : B) :
@@ -200,4 +226,138 @@ lemma map_shiftFunctorCompIsoId_inv_app [F.CommShift A] (X : C) (a b : A) (h : a
200226
201227end Functor
202228
229+ namespace NatTrans
230+
231+ variable {C D E : Type *} [Category C] [Category D] [Category E]
232+ {F₁ F₂ F₃ : C ⥤ D} (τ : F₁ ⟶ F₂) (τ' : F₂ ⟶ F₃) (e : F₁ ≅ F₂)
233+ (G G' : D ⥤ E) (τ'' : G ⟶ G')
234+ (A : Type *) [AddMonoid A] [HasShift C A] [HasShift D A] [HasShift E A]
235+ [F₁.CommShift A] [F₂.CommShift A] [F₃.CommShift A]
236+ [G.CommShift A] [G'.CommShift A]
237+
238+ /-- If `τ : F₁ ⟶ F₂` is a natural transformation between two functors
239+ which commute with a shift by an additive monoid `A`, this typeclass
240+ asserts a compatibility of `τ` with these shifts. -/
241+ class CommShift : Prop :=
242+ comm' (a : A) : (F₁.commShiftIso a).hom ≫ whiskerRight τ _ =
243+ whiskerLeft _ τ ≫ (F₂.commShiftIso a).hom
244+
245+ namespace CommShift
246+
247+ section
248+
249+ variable {A}
250+ variable [NatTrans.CommShift τ A]
251+
252+ lemma comm (a : A) : (F₁.commShiftIso a).hom ≫ whiskerRight τ _ =
253+ whiskerLeft _ τ ≫ (F₂.commShiftIso a).hom := by
254+ apply comm'
255+
256+ @[reassoc]
257+ lemma comm_app (a : A) (X : C) :
258+ (F₁.commShiftIso a).hom.app X ≫ (τ.app X)⟦a⟧' =
259+ τ.app (X⟦a⟧) ≫ (F₂.commShiftIso a).hom.app X :=
260+ NatTrans.congr_app (comm τ a) X
261+
262+ @[reassoc]
263+ lemma shift_app (a : A) (X : C) :
264+ (τ.app X)⟦a⟧' = (F₁.commShiftIso a).inv.app X ≫
265+ τ.app (X⟦a⟧) ≫ (F₂.commShiftIso a).hom.app X := by
266+ rw [← comm_app, Iso.inv_hom_id_app_assoc]
267+
268+ @[reassoc]
269+ lemma app_shift (a : A) (X : C) :
270+ τ.app (X⟦a⟧) = (F₁.commShiftIso a).hom.app X ≫ (τ.app X)⟦a⟧' ≫
271+ (F₂.commShiftIso a).inv.app X := by
272+ erw [comm_app_assoc, Iso.hom_inv_id_app, Category.comp_id]
273+
274+ end
275+
276+ instance of_iso_inv [NatTrans.CommShift e.hom A] :
277+ NatTrans.CommShift e.inv A := ⟨fun a => by
278+ ext X
279+ dsimp
280+ rw [← cancel_epi (e.hom.app (X⟦a⟧)), e.hom_inv_id_app_assoc, ← comm_app_assoc,
281+ ← Functor.map_comp, e.hom_inv_id_app, Functor.map_id]
282+ rw [Category.comp_id]⟩
283+
284+ lemma of_isIso [IsIso τ] [NatTrans.CommShift τ A] :
285+ NatTrans.CommShift (inv τ) A := by
286+ haveI : NatTrans.CommShift (asIso τ).hom A := by
287+ dsimp
288+ infer_instance
289+ change NatTrans.CommShift (asIso τ).inv A
290+ infer_instance
291+
292+ variable (F₁) in
293+ instance id : NatTrans.CommShift (𝟙 F₁) A := ⟨by aesop_cat⟩
294+
295+ instance comp [NatTrans.CommShift τ A] [NatTrans.CommShift τ' A] :
296+ NatTrans.CommShift (τ ≫ τ') A := ⟨fun a => by
297+ ext X
298+ simp [comm_app_assoc, comm_app]⟩
299+
300+ instance whiskerRight [NatTrans.CommShift τ A] :
301+ NatTrans.CommShift (whiskerRight τ G) A := ⟨fun a => by
302+ ext X
303+ simp only [Functor.comp_obj, whiskerRight_twice, comp_app,
304+ whiskerRight_app, Functor.comp_map, whiskerLeft_app,
305+ Functor.commShiftIso_comp_hom_app, Category.assoc]
306+ erw [← NatTrans.naturality]
307+ dsimp
308+ simp only [← G.map_comp_assoc, comm_app]⟩
309+
310+ variable {G G'} (F₁)
311+
312+ instance whiskerLeft [NatTrans.CommShift τ'' A] :
313+ NatTrans.CommShift (whiskerLeft F₁ τ'') A := ⟨fun a => by
314+ ext X
315+ simp only [Functor.comp_obj, comp_app, whiskerRight_app, whiskerLeft_app, whiskerLeft_twice,
316+ Functor.commShiftIso_comp_hom_app, Category.assoc, ← NatTrans.naturality_assoc, comm_app]⟩
317+
318+ end CommShift
319+
320+ end NatTrans
321+
322+ namespace Functor
323+
324+ namespace CommShift
325+
326+ variable {C D E : Type *} [Category C] [Category D]
327+ {F : C ⥤ D} {G : C ⥤ D} (e : F ≅ G)
328+ (A : Type *) [AddMonoid A] [HasShift C A] [HasShift D A]
329+ [F.CommShift A]
330+
331+ /-- If `e : F ≅ G` is an isomorphism of functors and if `F` commutes with the
332+ shift, then `G` also commutes with the shift. -/
333+ def ofIso : G.CommShift A where
334+ iso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _
335+ zero := by
336+ ext X
337+ simp only [comp_obj, F.commShiftIso_zero A, Iso.trans_hom, isoWhiskerLeft_hom,
338+ Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app,
339+ isoZero_hom_app, whiskerRight_app, assoc]
340+ erw [← e.inv.naturality_assoc, ← NatTrans.naturality,
341+ e.inv_hom_id_app_assoc]
342+ add a b := by
343+ ext X
344+ simp only [comp_obj, F.commShiftIso_add, Iso.trans_hom, isoWhiskerLeft_hom,
345+ Iso.symm_hom, isoWhiskerRight_hom, NatTrans.comp_app, whiskerLeft_app,
346+ isoAdd_hom_app, whiskerRight_app, assoc, map_comp, NatTrans.naturality_assoc,
347+ NatIso.cancel_natIso_inv_left]
348+ simp only [← Functor.map_comp_assoc, e.hom_inv_id_app_assoc]
349+ simp only [← NatTrans.naturality, comp_obj, comp_map, map_comp, assoc]
350+
351+ lemma ofIso_compatibility :
352+ letI := ofIso e A
353+ NatTrans.CommShift e.hom A := by
354+ letI := ofIso e A
355+ refine' ⟨fun a => _⟩
356+ dsimp [commShiftIso, ofIso]
357+ rw [← whiskerLeft_comp_assoc, e.hom_inv_id, whiskerLeft_id', id_comp]
358+
359+ end CommShift
360+
361+ end Functor
362+
203363end CategoryTheory
0 commit comments