/- Copyright 2026 The Formal Conjectures Authors. Released under Apache 2.0 license as described in the file LICENSE. This file has been modified. -/ import OAI.Algebra.Homology.Notation import OAI.Algebra.Homology.DerivedFunctorPlusNaturality import OAI.Algebra.Homology.DerivedFunctorPlusShift /-! # Functor Plus Shift Naturality -/ namespace OAI.Algebra.Homology.FunctorPlusShiftNaturality.CategoryTheory.NatTrans noncomputable section open _root_.CategoryTheory open _root_.CategoryTheory.NatTrans /-! # Shift compatibility of derived natural transformations The transformations induced by coefficient maps commute with the coherent shifts. This is needed to compare support enlargement before and after orientation duality. The compatibility is proved on complexes and descended through the injective-resolution comparison. -/ section Detect variable {B C D : Type*} [Category* B] [Category* C] [Category* D] (A : Type*) [AddMonoid A] [HasShift B A] [HasShift C A] [HasShift D A] /-- Shift compatibility can be checked after essentially surjective precomposition. -/ lemma commShift_of_whiskerLeft (L : B ⥤ C) [L.EssSurj] [L.CommShift A] {F G : C ⥤ D} [F.CommShift A] [G.CommShift A] (α : F ⟶ G) [CommShift (Functor.whiskerLeft L α) A] : CommShift α A where shift_comm a := by let τ := (F.commShiftIso a).hom ≫ Functor.whiskerRight α _ let τ' := Functor.whiskerLeft _ α ≫ (G.commShiftIso a).hom have h (X : B) : τ.app (L.obj X) = τ'.app (L.obj X) := by have h := shift_app_comm (Functor.whiskerLeft L α) a X simp only [Functor.commShiftIso_comp_hom_app, Functor.whiskerLeft_app, Category.assoc] at h rw [← α.naturality_assoc] at h exact (cancel_epi (F.map ((L.commShiftIso a).hom.app X))).1 h ext Y : 2 rw [← cancel_epi ((shiftFunctor C a ⋙ F).map (L.objObjPreimageIso Y).hom), τ.naturality, τ'.naturality, h] /-- Shift compatibility can be checked after faithful postcomposition. -/ lemma commShift_of_whiskerRight (L : C ⥤ D) [L.Faithful] [L.CommShift A] {F G : B ⥤ C} [F.CommShift A] [G.CommShift A] (α : F ⟶ G) [CommShift (Functor.whiskerRight α L) A] : CommShift α A where shift_comm a := by ext X : 2 apply L.map_injective apply (cancel_mono ((L.commShiftIso a).hom.app (G.obj X))).1 have h := shift_app_comm (Functor.whiskerRight α L) a X simp only [Functor.commShiftIso_comp_hom_app, Functor.whiskerRight_app, Category.assoc] at h rw [← L.commShiftIso_hom_naturality] at h simpa only [NatTrans.comp_app, Functor.whiskerRight_app, Functor.whiskerLeft_app, L.map_comp, Category.assoc] using h end Detect variable {C D : Type*} [Category* C] [Category* D] [Abelian C] [Abelian D] {F G : C ⥤ D} [F.Additive] [G.Additive] (α : F ⟶ G) set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- Termwise coefficient transformations commute with cohomological shifts. -/ instance mapCochainComplexCommShift : CommShift (α.mapHomologicalComplex ℤᵘᵖ) ℤ where shift_comm a := by ext K i simp set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- The induced transformation on homotopy categories retains the shifts. -/ instance mapHomotopyCategoryCommShift : CommShift (α.mapHomotopyCategory ℤᵘᵖ) ℤ := by have h : Functor.whiskerLeft (HomotopyCategory.quotient C ℤᵘᵖ) (α.mapHomotopyCategory ℤᵘᵖ) = (F.mapHomotopyCategoryFactors ℤᵘᵖ).hom ≫ Functor.whiskerRight (α.mapHomologicalComplex ℤᵘᵖ) (HomotopyCategory.quotient D ℤᵘᵖ) ≫ (G.mapHomotopyCategoryFactors ℤᵘᵖ).inv := by ext K simp [Functor.mapHomotopyCategoryFactors, mapHomotopyCategory] exact (Category.id_comp _).symm have : CommShift (Functor.whiskerLeft (HomotopyCategory.quotient C ℤᵘᵖ) (α.mapHomotopyCategory ℤᵘᵖ)) ℤ := by rw [h] infer_instance exact commShift_of_whiskerLeft ℤ (HomotopyCategory.quotient C ℤᵘᵖ) _ set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- Restricting to bounded-below homotopy complexes preserves shift compatibility. -/ instance mapHomotopyCategoryPlusCommShift : CommShift (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.mapHomotopyCategoryPlus α) ℤ := by let eF : F.mapHomotopyCategoryPlus ⋙ HomotopyCategory.Plus.ι D ≅ HomotopyCategory.Plus.ι C ⋙ F.mapHomotopyCategory ℤᵘᵖ := (HomotopyCategory.plus D).liftCompιIso _ _ let eG : G.mapHomotopyCategoryPlus ⋙ HomotopyCategory.Plus.ι D ≅ HomotopyCategory.Plus.ι C ⋙ G.mapHomotopyCategory ℤᵘᵖ := (HomotopyCategory.plus D).liftCompιIso _ _ have : CommShift eF.hom ℤ := by dsimp [eF]; infer_instance have : CommShift eG.hom ℤ := by dsimp [eG]; infer_instance have h : Functor.whiskerRight (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.mapHomotopyCategoryPlus α) (HomotopyCategory.Plus.ι D) = eF.hom ≫ Functor.whiskerLeft (HomotopyCategory.Plus.ι C) (α.mapHomotopyCategory ℤᵘᵖ) ≫ eG.inv := by ext K simp [eF, eG, DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.mapHomotopyCategoryPlus, ObjectProperty.liftCompιIso] exact (Category.id_comp _).symm have : CommShift (Functor.whiskerRight (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.mapHomotopyCategoryPlus α) (HomotopyCategory.Plus.ι D)) ℤ := by rw [h] infer_instance exact commShift_of_whiskerRight ℤ (HomotopyCategory.Plus.ι D) _ variable [HasDerivedCategory C] [HasDerivedCategory D] [EnoughInjectives C] set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- On injective complexes the derived transformation is the termwise map, conjugated by the canonical derived-unit isomorphisms. -/ theorem rightDerivedFunctorPlus_onInjectives : Functor.whiskerLeft (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.rightDerivedFunctorPlus α) = (DerivedFunctorPlusShift.CategoryTheory.Functor.rightDerivedFunctorPlusOnInjectivesIso F).hom ≫ Functor.whiskerLeft (InjectiveObject.ι C).mapHomotopyCategoryPlus (Functor.whiskerRight (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.mapHomotopyCategoryPlus α) DerivedCategory.Plus.Qh) ≫ (DerivedFunctorPlusShift.CategoryTheory.Functor.rightDerivedFunctorPlusOnInjectivesIso G).inv := by ext K : 2 simp [DerivedFunctorPlusShift.CategoryTheory.Functor.rightDerivedFunctorPlusOnInjectivesIso, DerivedFunctorPlusShift.CategoryTheory.Functor.rightDerivedFunctorPlusOnInjectivesUnit, DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived] set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- Coherent shift compatibility of the derived transformation, from the termwise compatibility of the coefficient map proved above. -/ instance rightDerivedFunctorPlusCommShift : CommShift (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.rightDerivedFunctorPlus α) ℤ := by have : CommShift (Functor.whiskerLeft (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) (DerivedFunctorPlusNaturality.CategoryTheory.NatTrans.rightDerivedFunctorPlus α)) ℤ := by rw [rightDerivedFunctorPlus_onInjectives] infer_instance exact commShift_of_whiskerLeft ℤ (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) _ end end OAI.Algebra.Homology.FunctorPlusShiftNaturality.CategoryTheory.NatTrans