Skip to content

Commit 9cbb31e

Browse files
committed
feat(CategoryTheory/Triangulated): homological functors (#11759)
A functor `F : C ⥤ A` from a pretriangulated category to an abelian category is homological iff it sends distinguished triangles in `C` to exact sequences in `A`. In this PR, we define the corresponding type class `F.IsHomological`. If `F` is a homological functor, we introduce the strictly full triangulated subcategory `F.homologicalKernel`.
1 parent e8e66e7 commit 9cbb31e

File tree

6 files changed

+183
-3
lines changed

6 files changed

+183
-3
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,7 @@ import Mathlib.CategoryTheory.Sums.Basic
15551555
import Mathlib.CategoryTheory.Thin
15561556
import Mathlib.CategoryTheory.Triangulated.Basic
15571557
import Mathlib.CategoryTheory.Triangulated.Functor
1558+
import Mathlib.CategoryTheory.Triangulated.HomologicalFunctor
15581559
import Mathlib.CategoryTheory.Triangulated.Opposite
15591560
import Mathlib.CategoryTheory.Triangulated.Pretriangulated
15601561
import Mathlib.CategoryTheory.Triangulated.Rotate

Mathlib/CategoryTheory/Limits/Preserves/Shapes/Zero.lean

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ We provide the following results:
2525
-/
2626

2727

28-
universe v₁ v₂ u₁ u₂
28+
universe v₁ v₂ v₃ u₁ u₂ u₃
2929

3030
noncomputable section
3131

@@ -36,10 +36,11 @@ open CategoryTheory.Limits
3636
namespace CategoryTheory.Functor
3737

3838
variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D]
39+
{E : Type u₃} [Category.{v₃} E]
3940

4041
section ZeroMorphisms
4142

42-
variable [HasZeroMorphisms C] [HasZeroMorphisms D]
43+
variable [HasZeroMorphisms C] [HasZeroMorphisms D] [HasZeroMorphisms E]
4344

4445
/-- A functor preserves zero morphisms if it sends zero morphisms to zero morphisms. -/
4546
class PreservesZeroMorphisms (F : C ⥤ D) : Prop where
@@ -105,6 +106,15 @@ instance (priority := 100) preservesZeroMorphisms_of_full (F : C ⥤ D) [Full F]
105106
_ = 0 := by rw [F.map_comp, F.map_preimage, comp_zero]
106107
#align category_theory.functor.preserves_zero_morphisms_of_full CategoryTheory.Functor.preservesZeroMorphisms_of_full
107108

109+
instance preservesZeroMorphisms_comp (F : C ⥤ D) (G : D ⥤ E)
110+
[F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] :
111+
(F ⋙ G).PreservesZeroMorphisms := ⟨by simp⟩
112+
113+
lemma preservesZeroMorphisms_of_iso {F₁ F₂ : C ⥤ D} [F₁.PreservesZeroMorphisms] (e : F₁ ≅ F₂) :
114+
F₂.PreservesZeroMorphisms where
115+
map_zero X Y := by simp only [← cancel_epi (e.hom.app X), ← e.hom.naturality,
116+
F₁.map_zero, zero_comp, comp_zero]
117+
108118
instance preservesZeroMorphisms_evaluation_obj (j : D) :
109119
PreservesZeroMorphisms ((evaluation D C).obj j) where
110120

Mathlib/CategoryTheory/Preadditive/AdditiveFunctor.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ theorem additive_of_preservesBinaryBiproducts [HasBinaryBiproducts C] [Preserves
178178
biprod.add_eq_lift_id_desc]
179179
#align category_theory.functor.additive_of_preserves_binary_biproducts CategoryTheory.Functor.additive_of_preservesBinaryBiproducts
180180

181+
lemma additive_of_preserves_binary_products
182+
[HasBinaryProducts C] [PreservesLimitsOfShape (Discrete WalkingPair) F]
183+
[F.PreservesZeroMorphisms] : F.Additive := by
184+
have : HasBinaryBiproducts C := HasBinaryBiproducts.of_hasBinaryProducts
185+
have := preservesBinaryBiproductsOfPreservesBinaryProducts F
186+
exact Functor.additive_of_preservesBinaryBiproducts F
187+
181188
end
182189

183190
end

Mathlib/CategoryTheory/Triangulated/Functor.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ lemma map_distinguished [F.IsTriangulated] (T : Triangle C) (hT : T ∈ distTria
116116
F.mapTriangle.obj T ∈ distTriang D :=
117117
IsTriangulated.map_distinguished _ hT
118118

119+
namespace IsTriangulated
120+
121+
open ZeroObject
122+
123+
variable [F.IsTriangulated]
124+
125+
instance (priority := 100) : PreservesZeroMorphisms F where
126+
map_zero X Y := by
127+
have h₁ : (0 : X ⟶ Y) = 0 ≫ 𝟙 00 := by simp
128+
have h₂ : 𝟙 (F.obj 0) = 0 := by
129+
rw [← IsZero.iff_id_eq_zero]
130+
apply Triangle.isZero₃_of_isIso₁ _
131+
(F.map_distinguished _ (contractible_distinguished (0 : C)))
132+
dsimp
133+
infer_instance
134+
rw [h₁, F.map_comp, F.map_comp, F.map_id, h₂, zero_comp, comp_zero]
135+
136+
end IsTriangulated
137+
119138
end Functor
120139

121140
end CategoryTheory
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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

Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ Copyright (c) 2021 Luke Kershaw. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Luke Kershaw, Joël Riou
55
-/
6-
import Mathlib.CategoryTheory.Triangulated.TriangleShift
6+
import Mathlib.Algebra.Homology.ShortComplex.Basic
77
import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts
8+
import Mathlib.CategoryTheory.Triangulated.TriangleShift
89

910
#align_import category_theory.triangulated.pretriangulated from "leanprover-community/mathlib"@"6876fa15e3158ff3e4a4e2af1fb6e1945c6e8803"
1011

@@ -158,6 +159,19 @@ theorem comp_distTriang_mor_zero₃₁ (T : Triangle C) (H : T ∈ distTriang C)
158159
simpa using comp_distTriang_mor_zero₁₂ T.rotate.rotate H₂
159160
#align category_theory.pretriangulated.comp_dist_triangle_mor_zero₃₁ CategoryTheory.Pretriangulated.comp_distTriang_mor_zero₃₁
160161

162+
/-- The short complex `T.obj₁ ⟶ T.obj₂ ⟶ T.obj₃` attached to a distinguished triangle. -/
163+
@[simps]
164+
def shortComplexOfDistTriangle (T : Triangle C) (hT : T ∈ distTriang C) : ShortComplex C :=
165+
ShortComplex.mk T.mor₁ T.mor₂ (comp_distTriang_mor_zero₁₂ _ hT)
166+
167+
/-- The isomorphism between the short complex attached to
168+
two isomorphic distinguished triangles. -/
169+
@[simps!]
170+
def shortComplexOfDistTriangleIsoOfIso {T T' : Triangle C} (e : T ≅ T') (hT : T ∈ distTriang C) :
171+
shortComplexOfDistTriangle T hT ≅ shortComplexOfDistTriangle T'
172+
(isomorphic_distinguished _ hT _ e.symm) :=
173+
ShortComplex.isoMk (Triangle.π₁.mapIso e) (Triangle.π₂.mapIso e) (Triangle.π₃.mapIso e)
174+
161175
/-- Any morphism `Y ⟶ Z` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
162176
lemma distinguished_cocone_triangle₁ {Y Z : C} (g : Y ⟶ Z) :
163177
∃ (X : C) (f : X ⟶ Y) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C := by

0 commit comments

Comments
 (0)