|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Joël Riou. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Joël Riou |
| 5 | +-/ |
| 6 | +import Mathlib.Algebra.Homology.ShortComplex.Exact |
| 7 | +import Mathlib.CategoryTheory.Abelian.Basic |
| 8 | +import Mathlib.CategoryTheory.Shift.ShiftSequence |
| 9 | +import Mathlib.CategoryTheory.Triangulated.Functor |
| 10 | +import Mathlib.CategoryTheory.Triangulated.Subcategory |
| 11 | + |
| 12 | +/-! # Homological functors |
| 13 | +
|
| 14 | +In this file, given a functor `F : C ⥤ A` from a pretriangulated category to |
| 15 | +an abelian category, we define the type class `F.IsHomological`, which is the property |
| 16 | +that `F` sends distinguished triangles in `C` to exact sequences in `A`. |
| 17 | +
|
| 18 | +If `F` is a homological functor, we define the strictly full triangulated subcategory |
| 19 | +`F.homologicalKernel`. |
| 20 | +
|
| 21 | +Note: depending on the sources, homological functors are sometimes |
| 22 | +called cohomological functors, while certain authors use "cohomological functors" |
| 23 | +for "contravariant" functors (i.e. functors `Cᵒᵖ ⥤ A`). |
| 24 | +
|
| 25 | +## TODO |
| 26 | +
|
| 27 | +* The long exact sequence in homology attached to an homological functor. |
| 28 | +
|
| 29 | +## References |
| 30 | +* [Jean-Louis Verdier, *Des catégories dérivées des catégories abéliennes*][verdier1996] |
| 31 | +
|
| 32 | +-/ |
| 33 | + |
| 34 | +namespace CategoryTheory |
| 35 | + |
| 36 | +open Category Limits Pretriangulated ZeroObject Preadditive |
| 37 | + |
| 38 | +variable {C D A : Type*} [Category C] [HasZeroObject C] [HasShift C ℤ] [Preadditive C] |
| 39 | + [∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] |
| 40 | + [Category D] [HasZeroObject D] [HasShift D ℤ] [Preadditive D] |
| 41 | + [∀ (n : ℤ), (CategoryTheory.shiftFunctor D n).Additive] [Pretriangulated D] |
| 42 | + [Category A] [Abelian A] |
| 43 | + |
| 44 | +namespace Functor |
| 45 | + |
| 46 | +variable (F : C ⥤ A) |
| 47 | + |
| 48 | +/-- A functor from a pretriangulated category to an abelian category is an homological functor |
| 49 | +if it sends distinguished triangles to exact sequences. -/ |
| 50 | +class IsHomological extends F.PreservesZeroMorphisms : Prop where |
| 51 | + exact (T : Triangle C) (hT : T ∈ distTriang C) : |
| 52 | + ((shortComplexOfDistTriangle T hT).map F).Exact |
| 53 | + |
| 54 | +lemma map_distinguished_exact [F.IsHomological] (T : Triangle C) (hT : T ∈ distTriang C) : |
| 55 | + ((shortComplexOfDistTriangle T hT).map F).Exact := |
| 56 | + IsHomological.exact _ hT |
| 57 | + |
| 58 | +instance (L : C ⥤ D) (F : D ⥤ A) [L.CommShift ℤ] [L.IsTriangulated] [F.IsHomological] : |
| 59 | + (L ⋙ F).IsHomological where |
| 60 | + exact T hT := F.map_distinguished_exact _ (L.map_distinguished T hT) |
| 61 | + |
| 62 | +lemma IsHomological.mk' [F.PreservesZeroMorphisms] |
| 63 | + (hF : ∀ (T : Pretriangulated.Triangle C) (hT : T ∈ distTriang C), |
| 64 | + ∃ (T' : Pretriangulated.Triangle C) (e : T ≅ T'), |
| 65 | + ((shortComplexOfDistTriangle T' (isomorphic_distinguished _ hT _ e.symm)).map F).Exact) : |
| 66 | + F.IsHomological where |
| 67 | + exact T hT := by |
| 68 | + obtain ⟨T', e, h'⟩ := hF T hT |
| 69 | + exact (ShortComplex.exact_iff_of_iso |
| 70 | + (F.mapShortComplex.mapIso ((shortComplexOfDistTriangleIsoOfIso e hT)))).2 h' |
| 71 | + |
| 72 | +variable [F.IsHomological] |
| 73 | + |
| 74 | +lemma IsHomological.of_iso {F₁ F₂ : C ⥤ A} [F₁.IsHomological] (e : F₁ ≅ F₂) : |
| 75 | + F₂.IsHomological := |
| 76 | + have := preservesZeroMorphisms_of_iso e |
| 77 | + ⟨fun T hT => ShortComplex.exact_of_iso (ShortComplex.mapNatIso _ e) |
| 78 | + (F₁.map_distinguished_exact T hT)⟩ |
| 79 | + |
| 80 | +/-- The kernel of a homological functor `F : C ⥤ A` is the strictly full |
| 81 | +triangulated subcategory consisting of objects `X` such that |
| 82 | +for all `n : ℤ`, `F.obj (X⟦n⟧)` is zero. -/ |
| 83 | +def homologicalKernel [F.IsHomological] : |
| 84 | + Triangulated.Subcategory C := Triangulated.Subcategory.mk' |
| 85 | + (fun X => ∀ (n : ℤ), IsZero (F.obj (X⟦n⟧))) |
| 86 | + (fun n => by |
| 87 | + rw [IsZero.iff_id_eq_zero, ← F.map_id, ← Functor.map_id, |
| 88 | + id_zero, Functor.map_zero, Functor.map_zero]) |
| 89 | + (fun X a hX b => IsZero.of_iso (hX (a + b)) (F.mapIso ((shiftFunctorAdd C a b).app X).symm)) |
| 90 | + (fun T hT h₁ h₃ n => (F.map_distinguished_exact _ |
| 91 | + (Triangle.shift_distinguished T hT n)).isZero_of_both_zeros |
| 92 | + (IsZero.eq_of_src (h₁ n) _ _) (IsZero.eq_of_tgt (h₃ n) _ _)) |
| 93 | + |
| 94 | +instance [F.IsHomological] : ClosedUnderIsomorphisms F.homologicalKernel.P := by |
| 95 | + dsimp only [homologicalKernel] |
| 96 | + infer_instance |
| 97 | + |
| 98 | +lemma mem_homologicalKernel_iff [F.IsHomological] [F.ShiftSequence ℤ] (X : C) : |
| 99 | + F.homologicalKernel.P X ↔ ∀ (n : ℤ), IsZero ((F.shift n).obj X) := by |
| 100 | + simp only [← fun (n : ℤ) => Iso.isZero_iff ((F.isoShift n).app X)] |
| 101 | + rfl |
| 102 | + |
| 103 | +noncomputable instance (priority := 100) [F.IsHomological] : |
| 104 | + PreservesLimitsOfShape (Discrete WalkingPair) F := by |
| 105 | + suffices ∀ (X₁ X₂ : C), PreservesLimit (pair X₁ X₂) F from |
| 106 | + ⟨fun {X} => preservesLimitOfIsoDiagram F (diagramIsoPair X).symm⟩ |
| 107 | + intro X₁ X₂ |
| 108 | + have : HasBinaryBiproduct (F.obj X₁) (F.obj X₂) := HasBinaryBiproducts.has_binary_biproduct _ _ |
| 109 | + have : Mono (F.biprodComparison X₁ X₂) := by |
| 110 | + rw [mono_iff_cancel_zero] |
| 111 | + intro Z f hf |
| 112 | + let S := (ShortComplex.mk _ _ (biprod.inl_snd (X := X₁) (Y := X₂))).map F |
| 113 | + have : Mono S.f := by dsimp [S]; infer_instance |
| 114 | + have ex : S.Exact := F.map_distinguished_exact _ (binaryBiproductTriangle_distinguished X₁ X₂) |
| 115 | + obtain ⟨g, rfl⟩ := ex.lift' f (by simpa using hf =≫ biprod.snd) |
| 116 | + dsimp [S] at hf ⊢ |
| 117 | + replace hf := hf =≫ biprod.fst |
| 118 | + simp only [assoc, biprodComparison_fst, zero_comp, ← F.map_comp, biprod.inl_fst, |
| 119 | + F.map_id, comp_id] at hf |
| 120 | + rw [hf, zero_comp] |
| 121 | + have : PreservesBinaryBiproduct X₁ X₂ F := preservesBinaryBiproductOfMonoBiprodComparison _ |
| 122 | + apply Limits.preservesBinaryProductOfPreservesBinaryBiproduct |
| 123 | + |
| 124 | +instance (priority := 100) [F.IsHomological] : F.Additive := |
| 125 | + F.additive_of_preserves_binary_products |
| 126 | + |
| 127 | +end Functor |
| 128 | + |
| 129 | +end CategoryTheory |
0 commit comments