Skip to content

Commit 26d3788

Browse files
committed
feat(Algebra/Homology/ShortComplex): functoriality of first/second map (#31249)
From ClassFieldTheory
1 parent d1498bb commit 26d3788

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

Mathlib/Algebra/Homology/ShortComplex/Basic.lean

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2023 Joël Riou. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Joël Riou
55
-/
6-
76
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Zero
87

98
/-!
@@ -21,12 +20,14 @@ namespace CategoryTheory
2120

2221
open Category Limits
2322

24-
variable (C D : Type*) [Category C] [Category D]
23+
variable {C D E : Type*} [Category C] [Category D] [Category E]
24+
[HasZeroMorphisms C] [HasZeroMorphisms D] [HasZeroMorphisms E]
2525

26+
variable (C) in
2627
/-- A short complex in a category `C` with zero morphisms is the datum
2728
of two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` such that
2829
`f ≫ g = 0`. -/
29-
structure ShortComplex [HasZeroMorphisms C] where
30+
structure ShortComplex where
3031
/-- the first (left) object of a `ShortComplex` -/
3132
{X₁ : C}
3233
/-- the second (middle) object of a `ShortComplex` -/
@@ -44,9 +45,6 @@ namespace ShortComplex
4445

4546
attribute [reassoc (attr := simp)] ShortComplex.zero
4647

47-
variable {C}
48-
variable [HasZeroMorphisms C]
49-
5048
/-- Morphisms of short complexes are the commutative diagrams of the obvious shape. -/
5149
@[ext]
5250
structure Hom (S₁ S₂ : ShortComplex C) where
@@ -157,15 +155,18 @@ instance (f : S₁ ⟶ S₂) [IsIso f] : IsIso f.τ₃ := (inferInstance : IsIso
157155
@[reassoc (attr := simp)]
158156
lemma π₁Toπ₂_comp_π₂Toπ₃ : (π₁Toπ₂ : (_ : _ ⥤ C) ⟶ _) ≫ π₂Toπ₃ = 0 := by cat_disch
159157

160-
variable {D}
161-
variable [HasZeroMorphisms D]
162-
163158
/-- The short complex in `D` obtained by applying a functor `F : C ⥤ D` to a
164159
short complex in `C`, assuming that `F` preserves zero morphisms. -/
165160
@[simps]
166161
def map (F : C ⥤ D) [F.PreservesZeroMorphisms] : ShortComplex D :=
167162
ShortComplex.mk (F.map S.f) (F.map S.g) (by rw [← F.map_comp, S.zero, F.map_zero])
168163

164+
@[simp] lemma map_id (S : ShortComplex C) : S.map (𝟭 C) = S := rfl
165+
166+
@[simp] lemma map_comp (S : ShortComplex C)
167+
(F : C ⥤ D) [F.PreservesZeroMorphisms] (G : D ⥤ E) [G.PreservesZeroMorphisms] :
168+
S.map (F ⋙ G) = (S.map F).map G := rfl
169+
169170
/-- The morphism of short complexes `S.map F ⟶ S.map G` induced by
170171
a natural transformation `F ⟶ G`. -/
171172
@[simps]
@@ -216,6 +217,16 @@ def isoMk (e₁ : S₁.X₁ ≅ S₂.X₁) (e₂ : S₁.X₂ ≅ S₂.X₂) (e
216217
lemma isIso_of_isIso (f : S₁ ⟶ S₂) [IsIso f.τ₁] [IsIso f.τ₂] [IsIso f.τ₃] : IsIso f :=
217218
(isoMk (asIso f.τ₁) (asIso f.τ₂) (asIso f.τ₃)).isIso_hom
218219

220+
/-- The first map of a short complex, as a functor. -/
221+
@[simps] def fFunctor : ShortComplex C ⥤ Arrow C where
222+
obj S := .mk S.f
223+
map {S T} f := Arrow.homMk f.τ₁ f.τ₂ f.comm₁₂
224+
225+
/-- The second map of a short complex, as a functor. -/
226+
@[simps] def gFunctor : ShortComplex C ⥤ Arrow C where
227+
obj S := .mk S.g
228+
map {S T} f := Arrow.homMk f.τ₂ f.τ₃ f.comm₂₃
229+
219230
/-- The opposite `ShortComplex` in `Cᵒᵖ` associated to a short complex in `C`. -/
220231
@[simps]
221232
def op : ShortComplex Cᵒᵖ :=

0 commit comments

Comments
 (0)