Skip to content

Commit cce8437

Browse files
committed
feat: the derived category of an abelian category (#11806)
The derived category of an abelian category is defined and it is shown that it is a triangulated category. Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
1 parent ecd2ff7 commit cce8437

File tree

5 files changed

+222
-2
lines changed

5 files changed

+222
-2
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ import Mathlib.Algebra.Homology.BifunctorShift
287287
import Mathlib.Algebra.Homology.ComplexShape
288288
import Mathlib.Algebra.Homology.ComplexShapeSigns
289289
import Mathlib.Algebra.Homology.ConcreteCategory
290+
import Mathlib.Algebra.Homology.DerivedCategory.Basic
290291
import Mathlib.Algebra.Homology.DifferentialObject
291292
import Mathlib.Algebra.Homology.Embedding.Basic
292293
import Mathlib.Algebra.Homology.Exact
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
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.HomotopyCategory.HomologicalFunctor
7+
import Mathlib.Algebra.Homology.HomotopyCategory.ShiftSequence
8+
import Mathlib.Algebra.Homology.HomotopyCategory.Triangulated
9+
import Mathlib.Algebra.Homology.Localization
10+
11+
/-! # The derived category of an abelian category
12+
13+
In this file, we construct the derived category `DerivedCategory C` of an
14+
abelian category `C`. It is equipped with a triangulated structure.
15+
16+
The derived category is defined here as the localization of cochain complexes
17+
indexed by `ℤ` with respect to quasi-isomorphisms: it is a type synonym of
18+
`HomologicalComplexUpToQuasiIso C (ComplexShape.up ℤ)`. Then, we have a
19+
localization functor `DerivedCategory.Q : CochainComplex C ℤ ⥤ DerivedCategory C`.
20+
It was already shown in the file `Algebra.Homology.Localization` that the induced
21+
functor `DerivedCategory.Qh : HomotopyCategory C (ComplexShape.up ℤ) ⥤ DerivedCategory C`
22+
is a localization functor with respect to the class of morphisms
23+
`HomotopyCategory.quasiIso C (ComplexShape.up ℤ)`. In the lemma
24+
`HomotopyCategory.quasiIso_eq_subcategoryAcyclic_W` we obtain that this class of morphisms
25+
consists of morphisms whose cone belongs to the triangulated subcategory
26+
`HomotopyCategory.subcategoryAcyclic C` of acyclic complexes. Then, the triangulated
27+
structure on `DerivedCategory C` is deduced from the triangulated structure
28+
on the homotopy category (see file `Algebra.Homology.HomotopyCategory.Triangulated`)
29+
using the localization theorem for triangulated categories which was obtained
30+
in the file `CategoryTheory.Localization.Triangulated`.
31+
32+
## Implementation notes
33+
34+
If `C : Type u` and `Category.{v} C`, the constructed localized category of cochain
35+
complexes with respect to quasi-isomorphisms has morphisms in `Type (max u v)`.
36+
However, in certain circumstances, it shall be possible to prove that they are `v`-small
37+
(when `C` is a Grothendieck abelian category (e.g. the category of modules over a ring),
38+
it should be so by a theorem of Hovey.).
39+
40+
Then, when working with derived categories in mathlib, the user should add the variable
41+
`[HasDerivedCategory.{w} C]` which is the assumption that there is a chosen derived
42+
category with morphisms in `Type w`. When derived categories are used in order to
43+
prove statements which do not involve derived categories, the `HasDerivedCategory.{max u v}`
44+
instance should be obtained at the beginning of the proof, using the term
45+
`HasDerivedCategory.standard C`.
46+
47+
## TODO (@joelriou)
48+
49+
- define the induced homological functor `DerivedCategory C ⥤ C`.
50+
- construct the distinguished triangle associated to a short exact sequence
51+
of cochain complexes, and compare the associated connecting homomorphism
52+
with the one defined in `Algebra.Homology.HomologySequence`.
53+
- refactor the definition of Ext groups using morphisms in the derived category
54+
(which may be shrunk to the universe `v` at least when `C` has enough projectives
55+
or enough injectives).
56+
57+
## References
58+
* [Jean-Louis Verdier, *Des catégories dérivées des catégories abéliennes*][verdier1996]
59+
* [Mark Hovey, *Model category structures on chain complexes of sheaves*][hovey-2001]
60+
61+
-/
62+
63+
universe w v u
64+
65+
open CategoryTheory Limits
66+
67+
variable (C : Type u) [Category.{v} C] [Abelian C]
68+
69+
namespace HomotopyCategory
70+
71+
/-- The triangulated subcategory of `HomotopyCategory C (ComplexShape.up ℤ)` consisting
72+
of acyclic complexes. -/
73+
def subcategoryAcyclic : Triangulated.Subcategory (HomotopyCategory C (ComplexShape.up ℤ)) :=
74+
(homologyFunctor C (ComplexShape.up ℤ) 0).homologicalKernel
75+
76+
instance : ClosedUnderIsomorphisms (subcategoryAcyclic C).P := by
77+
dsimp [subcategoryAcyclic]
78+
infer_instance
79+
80+
variable {C}
81+
82+
lemma mem_subcategoryAcyclic_iff (X : HomotopyCategory C (ComplexShape.up ℤ)) :
83+
(subcategoryAcyclic C).P X ↔ ∀ (n : ℤ), IsZero ((homologyFunctor _ _ n).obj X) :=
84+
Functor.mem_homologicalKernel_iff _ X
85+
86+
lemma quotient_obj_mem_subcategoryAcyclic_iff_exactAt (K : CochainComplex C ℤ) :
87+
(subcategoryAcyclic C).P ((quotient _ _).obj K) ↔ ∀ (n : ℤ), K.ExactAt n := by
88+
rw [mem_subcategoryAcyclic_iff]
89+
refine forall_congr' (fun n => ?_)
90+
simp only [HomologicalComplex.exactAt_iff_isZero_homology]
91+
exact ((homologyFunctorFactors C (ComplexShape.up ℤ) n).app K).isZero_iff
92+
93+
variable (C)
94+
95+
lemma quasiIso_eq_subcategoryAcyclic_W :
96+
quasiIso C (ComplexShape.up ℤ) = (subcategoryAcyclic C).W := by
97+
ext K L f
98+
exact ((homologyFunctor C (ComplexShape.up ℤ) 0).mem_homologicalKernel_W_iff f).symm
99+
100+
end HomotopyCategory
101+
102+
/-- The assumption that a localized category for
103+
`(HomologicalComplex.quasiIso C (ComplexShape.up ℤ))` has been chosen, and that the morphisms
104+
in this chosen category are in `Type w`. -/
105+
abbrev HasDerivedCategory := MorphismProperty.HasLocalization.{w}
106+
(HomologicalComplex.quasiIso C (ComplexShape.up ℤ))
107+
108+
/-- The derived category obtained using the constructed localized category of cochain complexes
109+
with respect to quasi-isomorphisms. This should be used only while proving statements
110+
which do not involve the derived category. -/
111+
def HasDerivedCategory.standard : HasDerivedCategory.{max u v} C :=
112+
MorphismProperty.HasLocalization.standard _
113+
114+
variable [HasDerivedCategory.{w} C]
115+
116+
/-- The derived category of an abelian category. -/
117+
def DerivedCategory : Type (max u v) := HomologicalComplexUpToQuasiIso C (ComplexShape.up ℤ)
118+
119+
namespace DerivedCategory
120+
121+
instance : Category.{w} (DerivedCategory C) := by
122+
dsimp [DerivedCategory]
123+
infer_instance
124+
125+
variable {C}
126+
127+
/-- The localization functor `CochainComplex C ℤ ⥤ DerivedCategory C`. -/
128+
def Q : CochainComplex C ℤ ⥤ DerivedCategory C := HomologicalComplexUpToQuasiIso.Q
129+
130+
instance : (Q (C := C)).IsLocalization
131+
(HomologicalComplex.quasiIso C (ComplexShape.up ℤ)) := by
132+
dsimp only [Q, DerivedCategory]
133+
infer_instance
134+
135+
/-- The localization functor `HomotopyCategory C (ComplexShape.up ℤ) ⥤ DerivedCategory C`. -/
136+
def Qh : HomotopyCategory C (ComplexShape.up ℤ) ⥤ DerivedCategory C :=
137+
HomologicalComplexUpToQuasiIso.Qh
138+
139+
variable (C)
140+
141+
/-- The natural isomorphism `HomotopyCategory.quotient C (ComplexShape.up ℤ) ⋙ Qh ≅ Q`. -/
142+
def quotientCompQhIso : HomotopyCategory.quotient C (ComplexShape.up ℤ) ⋙ Qh ≅ Q :=
143+
HomologicalComplexUpToQuasiIso.quotientCompQhIso C (ComplexShape.up ℤ)
144+
145+
instance : Qh.IsLocalization (HomotopyCategory.quasiIso C (ComplexShape.up ℤ)) := by
146+
dsimp [Qh, DerivedCategory]
147+
infer_instance
148+
149+
instance : Qh.IsLocalization (HomotopyCategory.subcategoryAcyclic C).W := by
150+
rw [← HomotopyCategory.quasiIso_eq_subcategoryAcyclic_W]
151+
infer_instance
152+
153+
noncomputable instance : Preadditive (DerivedCategory C) :=
154+
Localization.preadditive Qh (HomotopyCategory.subcategoryAcyclic C).W
155+
156+
instance : (Qh (C := C)).Additive :=
157+
Localization.functor_additive Qh (HomotopyCategory.subcategoryAcyclic C).W
158+
159+
instance : (Q (C := C)).Additive :=
160+
Functor.additive_of_iso (quotientCompQhIso C)
161+
162+
noncomputable instance : HasZeroObject (DerivedCategory C) :=
163+
Q.hasZeroObject_of_additive
164+
165+
noncomputable instance : HasShift (DerivedCategory C) ℤ :=
166+
HasShift.localized Qh (HomotopyCategory.subcategoryAcyclic C).W ℤ
167+
168+
noncomputable instance : (Qh (C := C)).CommShift ℤ :=
169+
Functor.CommShift.localized Qh (HomotopyCategory.subcategoryAcyclic C).W ℤ
170+
171+
instance (n : ℤ) : (shiftFunctor (DerivedCategory C) n).Additive := by
172+
rw [Localization.functor_additive_iff
173+
Qh (HomotopyCategory.subcategoryAcyclic C).W]
174+
exact Functor.additive_of_iso (Qh.commShiftIso n)
175+
176+
noncomputable instance : Pretriangulated (DerivedCategory C) :=
177+
Triangulated.Localization.pretriangulated
178+
Qh (HomotopyCategory.subcategoryAcyclic C).W
179+
180+
instance : (Qh (C := C)).IsTriangulated :=
181+
Triangulated.Localization.isTriangulated_functor
182+
Qh (HomotopyCategory.subcategoryAcyclic C).W
183+
184+
noncomputable instance : IsTriangulated (DerivedCategory C) :=
185+
Triangulated.Localization.isTriangulated
186+
Qh (HomotopyCategory.subcategoryAcyclic C).W
187+
188+
end DerivedCategory

Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ lemma mem_homologicalKernel_W_iff {X Y : C} (f : X ⟶ Y) :
230230
simp only [mem_homologicalKernel_iff, h₁, ← h₂, ← h₃]
231231
constructor
232232
· intro h n
233-
obtain ⟨m, rfl⟩ : ∃ (m : ℤ), n = m + 1 := ⟨n - 1, by omega
233+
obtain ⟨m, rfl⟩ : ∃ (m : ℤ), n = m + 1 := ⟨n - 1, by simp
234234
have := (h (m + 1)).1
235235
have := (h m).2
236236
apply isIso_of_mono_of_epi

Mathlib/CategoryTheory/Triangulated/Subcategory.lean

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Authors: Joël Riou
55
-/
66
import Mathlib.CategoryTheory.ClosedUnderIsomorphisms
77
import Mathlib.CategoryTheory.Localization.CalculusOfFractions
8-
import Mathlib.CategoryTheory.Triangulated.Triangulated
8+
import Mathlib.CategoryTheory.Localization.Triangulated
9+
import Mathlib.CategoryTheory.Shift.Localization
910

1011
/-! # Triangulated subcategories
1112
@@ -185,6 +186,11 @@ lemma W.unshift {X₁ X₂ : C} {f : X₁ ⟶ X₂} {n : ℤ} (hf : S.W (f⟦n
185186
(S.respectsIso_W.arrow_mk_iso_iff
186187
(Arrow.isoOfNatIso (shiftEquiv C n).unitIso (Arrow.mk f))).2 (hf.shift (-n))
187188

189+
instance : S.W.IsCompatibleWithShift ℤ where
190+
condition n := by
191+
ext K L f
192+
exact ⟨fun hf => hf.unshift, fun hf => hf.shift n⟩
193+
188194
instance [IsTriangulated C] : S.W.IsMultiplicative where
189195
comp_mem := by
190196
rw [← isoClosure_W]
@@ -241,6 +247,15 @@ instance [IsTriangulated C] : S.W.HasRightCalculusOfFractions where
241247
dsimp at eq
242248
rw [← sub_eq_zero, ← comp_sub, hq, reassoc_of% eq, zero_comp]
243249

250+
instance [IsTriangulated C] : S.W.IsCompatibleWithTriangulation := ⟨by
251+
rintro T₁ T₃ mem₁ mem₃ a b ⟨Z₅, g₅, h₅, mem₅, mem₅'⟩ ⟨Z₄, g₄, h₄, mem₄, mem₄'⟩ comm
252+
obtain ⟨Z₂, g₂, h₂, mem₂⟩ := distinguished_cocone_triangle (T₁.mor₁ ≫ b)
253+
have H := someOctahedron rfl mem₁ mem₄ mem₂
254+
have H' := someOctahedron comm.symm mem₅ mem₃ mem₂
255+
let φ : T₁ ⟶ T₃ := H.triangleMorphism₁ ≫ H'.triangleMorphism₂
256+
exact ⟨φ.hom₃, S.W.comp_mem _ _ (W.mk S H.mem mem₄') (W.mk' S H'.mem mem₅'),
257+
by simpa [φ] using φ.comm₂, by simpa [φ] using φ.comm₃⟩⟩
258+
244259
section
245260

246261
variable (T : Triangle C) (hT : T ∈ distTriang C)

docs/references.bib

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,22 @@ @Book{ Hofstadter-1979
17461746
year = "1979"
17471747
}
17481748

1749+
@Article{ hovey-2001,
1750+
author = {Hovey, Mark},
1751+
title = {Model category structures on chain complexes of sheaves},
1752+
journal = {Trans. Amer. Math. Soc.},
1753+
fjournal = {Transactions of the American Mathematical Society},
1754+
volume = {353},
1755+
year = {2001},
1756+
number = {6},
1757+
pages = {2441--2457},
1758+
issn = {0002-9947,1088-6850},
1759+
mrclass = {18F20 (14F05 18E15 18E30 55U35)},
1760+
mrnumber = {1814077},
1761+
doi = {10.1090/S0002-9947-01-02721-0},
1762+
url = {https://doi.org/10.1090/S0002-9947-01-02721-0}
1763+
}
1764+
17491765
@Misc{ howard,
17501766
title = {Second Order Elliptic PDE: The Lax-Milgram Theorem},
17511767
url = {https://www.math.tamu.edu/~phoward/m612/s20/elliptic2.pdf},

0 commit comments

Comments
 (0)