/- Copyright 2026 The Formal Conjectures Authors. Released under Apache 2.0 license as described in the file LICENSE. This file has been modified. -/ import Mathlib.Algebra.Homology.DerivedCategory.RightDerivedFunctorPlus import Mathlib.CategoryTheory.Shift.Localization /-! # Derived Functor Plus Shift -/ namespace OAI.Algebra.Homology.DerivedFunctorPlusShift noncomputable section open _root_.CategoryTheory open _root_.CategoryTheory.Functor open _root_.HomotopyCategory open _root_.HomotopyCategory.Plus /-! # Coherent shifts on bounded-below right derived functors The bounded-below homotopy category of injective objects is equivalent to the bounded-below derived category. The right-derived unit becomes an isomorphism on this category. The coherent shifts descend through this equivalence, using Mathlib's localization construction. Boundedness is explicit in all source and target categories. -/ namespace HomotopyCategory.Plus variable (C : Type*) [Category* C] [Abelian C] [HasDerivedCategory C] /-- The bounded-below homotopy category of injective objects maps to the bounded-below derived category. -/ def injectiveToDerived : HomotopyCategory.Plus (InjectiveObject C) ⥤ DerivedCategory.Plus C := (InjectiveObject.ι C).mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh instance : (injectiveToDerived C).CommShift ℤ := inferInstanceAs (((InjectiveObject.ι C).mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh).CommShift ℤ) set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in lemma injectiveToDerived_map_bijective (K L : HomotopyCategory.Plus (InjectiveObject C)) : Function.Bijective ((injectiveToDerived C).map : (K ⟶ L) → _) := by let incl := (InjectiveObject.ι C).mapHomotopyCategoryPlus have hL : CochainComplex.IsKInjective (incl.obj L).obj.as := by obtain ⟨n, hn⟩ : CochainComplex.plus C (incl.obj L).obj.as := by have h := (incl.obj L).property rwa [← HomotopyCategory.plus_quotient_obj_iff] exact CochainComplex.isKInjective_of_injective _ n exact (DerivedCategory.Plus.Qh_map_bijective_of_isKInjective (incl.obj K) (incl.obj L) hL).comp ⟨incl.map_injective, incl.map_surjective⟩ instance : (injectiveToDerived C).Full where map_surjective := (injectiveToDerived_map_bijective C _ _).surjective instance : (injectiveToDerived C).Faithful where map_injective {K L} {_f _g} h := (injectiveToDerived_map_bijective C K L).injective h variable [EnoughInjectives C] instance : (injectiveToDerived C).EssSurj := by dsimp only [injectiveToDerived] infer_instance instance : (injectiveToDerived C).IsEquivalence := { } instance : (injectiveToDerived C).IsLocalization (MorphismProperty.isomorphisms (HomotopyCategory.Plus (InjectiveObject C))) := Functor.IsLocalization.of_isEquivalence _ _ (by rfl) omit [HasDerivedCategory C] in /-- Natural transformations into a functor that inverts quasi-isomorphisms are determined by their values on bounded-below injective complexes. -/ lemma natTrans_ext_on_injectives {H : Type*} [Category* H] {F G : HomotopyCategory.Plus C ⥤ H} (hG : (HomotopyCategory.Plus.quasiIso C).IsInvertedBy G) {α β : F ⟶ G} (h : ∀ K : HomotopyCategory.Plus (InjectiveObject C), α.app ((InjectiveObject.ι C).mapHomotopyCategoryPlus.obj K) = β.app ((InjectiveObject.ι C).mapHomotopyCategoryPlus.obj K)) : α = β := by ext K : 2 let r := Classical.arbitrary ((HomotopyCategory.Plus.localizerMorphism C).RightResolution K) have : IsIso (G.map r.w) := hG r.w r.hw rw [← cancel_mono (G.map r.w), ← α.naturality, ← β.naturality, h] end HomotopyCategory.Plus namespace CategoryTheory.Functor variable {C D : Type*} [Category* C] [Category* D] [Abelian C] [Abelian D] [HasDerivedCategory C] [HasDerivedCategory D] [EnoughInjectives C] (F : C ⥤ D) [F.Additive] /-- Termwise application of `F` to bounded-below injective complexes, followed by passage to the derived category. -/ def rightDerivedFunctorPlusOnInjectives : HomotopyCategory.Plus (InjectiveObject C) ⥤ DerivedCategory.Plus D := (InjectiveObject.ι C).mapHomotopyCategoryPlus ⋙ F.mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh instance : (rightDerivedFunctorPlusOnInjectives F).CommShift ℤ := inferInstanceAs (((InjectiveObject.ι C).mapHomotopyCategoryPlus ⋙ F.mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh).CommShift ℤ) /-- The right-derived unit restricted to injective complexes. -/ def rightDerivedFunctorPlusOnInjectivesUnit : (rightDerivedFunctorPlusOnInjectives F) ⟶ DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C ⋙ F.rightDerivedFunctorPlus := whiskerLeft (InjectiveObject.ι C).mapHomotopyCategoryPlus F.rightDerivedFunctorPlusUnith ≫ (Functor.associator _ _ _).inv set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in instance : IsIso (rightDerivedFunctorPlusOnInjectivesUnit F) := by have h (K : HomotopyCategory.Plus (InjectiveObject C)) : IsIso (F.rightDerivedFunctorPlusUnith.app ((InjectiveObject.ι C).mapHomotopyCategoryPlus.obj K)) := (HomotopyCategory.Plus.localizerMorphism_derives (F.mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh)).isIso_of_isRightDerivedFunctor F.rightDerivedFunctorPlusUnith K let _ : ∀ K, IsIso ((rightDerivedFunctorPlusOnInjectivesUnit F).app K) := fun K => by simpa only [rightDerivedFunctorPlusOnInjectivesUnit, NatTrans.comp_app, whiskerLeft_app, Functor.associator_inv_app, Category.comp_id] using h K exact NatIso.isIso_of_isIso_app _ /-- The canonical injective-resolution comparison. -/ def rightDerivedFunctorPlusOnInjectivesIso : DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C ⋙ F.rightDerivedFunctorPlus ≅ (rightDerivedFunctorPlusOnInjectives F) := (asIso (rightDerivedFunctorPlusOnInjectivesUnit F)).symm instance rightDerivedFunctorPlusInjectiveLifting : Localization.Lifting (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) (MorphismProperty.isomorphisms (HomotopyCategory.Plus (InjectiveObject C))) (rightDerivedFunctorPlusOnInjectives F) F.rightDerivedFunctorPlus := ⟨(rightDerivedFunctorPlusOnInjectivesIso F)⟩ /-- Coherent shift compatibility of the bounded-below right derived functor. Its zero and addition coherence laws are inherited by localization from the termwise complex-level shift compatibility. -/ instance rightDerivedFunctorPlusCommShift : F.rightDerivedFunctorPlus.CommShift ℤ := Functor.commShiftOfLocalization (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) (MorphismProperty.isomorphisms (HomotopyCategory.Plus (InjectiveObject C))) ℤ (rightDerivedFunctorPlusOnInjectives F) F.rightDerivedFunctorPlus /-- The injective-resolution comparison is compatible with the coherent shifts, which pins it to the derived unit. -/ instance rightDerivedFunctorPlusOnInjectivesIso_commShift : NatTrans.CommShift (rightDerivedFunctorPlusOnInjectivesIso F).hom ℤ := NatTrans.commShift_iso_hom_of_localization (DerivedFunctorPlusShift.HomotopyCategory.Plus.injectiveToDerived C) (MorphismProperty.isomorphisms (HomotopyCategory.Plus (InjectiveObject C))) ℤ (rightDerivedFunctorPlusOnInjectives F) F.rightDerivedFunctorPlus set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Compatibility with the derived unit after restriction to injective complexes. -/ instance rightDerivedFunctorPlusUnit_whiskerLeft_injectives_commShift : NatTrans.CommShift (whiskerLeft (InjectiveObject.ι C).mapHomotopyCategoryPlus F.rightDerivedFunctorPlusUnith) ℤ := by have : NatTrans.CommShift (rightDerivedFunctorPlusOnInjectivesUnit F) ℤ := inferInstanceAs (NatTrans.CommShift (rightDerivedFunctorPlusOnInjectivesIso F).inv ℤ) have h : (rightDerivedFunctorPlusOnInjectivesUnit F) ≫ (Functor.associator _ _ _).hom = whiskerLeft (InjectiveObject.ι C).mapHomotopyCategoryPlus F.rightDerivedFunctorPlusUnith := by simp [rightDerivedFunctorPlusOnInjectivesUnit] rw [← h] infer_instance set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- The full right-derived unit commutes with the coherent shifts, including on complexes which are not termwise injective. -/ instance rightDerivedFunctorPlusUnitCommShift : NatTrans.CommShift F.rightDerivedFunctorPlusUnith ℤ where shift_comm a := by apply DerivedFunctorPlusShift.HomotopyCategory.Plus.natTrans_ext_on_injectives C · intro K L f hf have : IsIso (DerivedCategory.Plus.Qh.map f) := Localization.inverts DerivedCategory.Plus.Qh (HomotopyCategory.Plus.quasiIso C) f hf change IsIso ((shiftFunctor (DerivedCategory.Plus D) a).map (F.rightDerivedFunctorPlus.map (DerivedCategory.Plus.Qh.map f))) infer_instance · intro K let incl := (InjectiveObject.ι C).mapHomotopyCategoryPlus have h := NatTrans.shift_app_comm (whiskerLeft incl F.rightDerivedFunctorPlusUnith) a K simp only [Functor.commShiftIso_comp_hom_app, whiskerLeft_app, Category.assoc] at h rw [← F.rightDerivedFunctorPlusUnith.naturality_assoc] at h apply (cancel_epi ((F.mapHomotopyCategoryPlus ⋙ DerivedCategory.Plus.Qh).map ((incl.commShiftIso a).hom.app K))).1 simpa only [NatTrans.comp_app, whiskerRight_app, whiskerLeft_app, Functor.commShiftIso_comp_hom_app, Category.assoc] using h end CategoryTheory.Functor end end OAI.Algebra.Homology.DerivedFunctorPlusShift