Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
0bd1581
feat(CategoryTheory): orthogonal of a property of objects
joelriou Nov 20, 2025
1807e21
chore(CategoryTheory): rename LeftBousfield.W as ObjectProperty.isLocal
joelriou Nov 20, 2025
a827619
Merge remote-tracking branch 'origin/triangulated-orthogonal' into tr…
joelriou Nov 20, 2025
fb7ad36
feat(CategoryTheory/Triangulated): right orthogonal and localization
joelriou Nov 20, 2025
d5627e7
Merge remote-tracking branch 'origin/master' into rename-bousfield-w
joelriou Nov 21, 2025
e8c89be
added docstring
joelriou Nov 21, 2025
6f361c9
add reference to Bousfield localization for `ObjectProperty.isLocal`
joelriou Nov 21, 2025
86fb3b0
feat(Algebra/Homology): K-injective cochain complexes
joelriou Nov 21, 2025
777ad27
added TODO
joelriou Nov 21, 2025
c4849dd
fix
joelriou Nov 21, 2025
207532e
better syntax
joelriou Nov 21, 2025
2b63d6c
better docstring
joelriou Nov 21, 2025
d9b561f
fix
joelriou Nov 21, 2025
8162f99
Merge remote-tracking branch 'origin/master' into k-injective-1
joelriou Nov 21, 2025
e8c86e3
fix
joelriou Nov 21, 2025
382e0f7
Apply suggestion from @joelriou
joelriou Nov 21, 2025
cc440ea
Merge remote-tracking branch 'origin/triangulated-orthogonal-2' into …
joelriou Nov 22, 2025
b59c9df
morphisms to a K-injective complex in the derived category
joelriou Nov 22, 2025
c7de9e2
Merge commit '382e0f7ebbae17ff85202d42b4ab954bd7f8d066' into k-inject…
joelriou Nov 22, 2025
37cf315
fix
joelriou Nov 22, 2025
912d7fa
Merge remote-tracking branch 'origin/master' into k-injective-1
joelriou Nov 23, 2025
5065e6b
the cochain complex indexed by integers associated to an injective re…
joelriou Nov 23, 2025
79a9e12
typo
joelriou Nov 23, 2025
9cda67d
Merge remote-tracking branch 'origin/rename-bousfield-w' into triangu…
joelriou Nov 24, 2025
3d9e4f5
Merge remote-tracking branch 'origin/master' into triangulated-orthog…
joelriou Nov 24, 2025
3ba61e4
Merge remote-tracking branch 'origin/master' into triangulated-orthog…
joelriou Nov 24, 2025
015b0dc
Merge remote-tracking branch 'origin/master' into triangulated-orthog…
joelriou Nov 24, 2025
f6e74f2
Merge remote-tracking branch 'origin/triangulated-orthogonal-2' into …
joelriou Nov 24, 2025
2455b11
feat(Algebra/Homology): cohomology of HomComplex
joelriou Nov 25, 2025
fb9a892
typo
joelriou Nov 25, 2025
ecd0ef4
morphisms in the homotopy category
joelriou Nov 25, 2025
84cdbb1
wip
joelriou Nov 25, 2025
f4bb279
Merge remote-tracking branch 'origin/k-injective-0' into homcomplex-s…
joelriou Nov 25, 2025
0c72eac
feat(Algebra/Homology): cochains and cocycles from/to single complexes
joelriou Nov 25, 2025
2d0ebcc
Merge remote-tracking branch 'origin/master' into k-injective-1
joelriou Nov 25, 2025
24009f2
Merge remote-tracking branch 'origin/homcomplex-single' into injectiv…
joelriou Nov 25, 2025
8b817b6
Merge remote-tracking branch 'origin/homcomplex-cohomology-class-hom'…
joelriou Nov 25, 2025
082dd63
Merge remote-tracking branch 'origin/injective-resolution-extend' int…
joelriou Nov 25, 2025
ecae259
feat(CategoryTheory): constructor for Ext-groups using an injective r…
joelriou Nov 25, 2025
106d01e
wip
joelriou Nov 25, 2025
6ab1c63
fix
joelriou Nov 25, 2025
47c840d
better syntax
joelriou Nov 25, 2025
add9a2d
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Nov 25, 2025
d1bd720
wip
joelriou Nov 25, 2025
1d605c4
wip
joelriou Nov 26, 2025
a95d22d
Merge remote-tracking branch 'origin/master' into homcomplex-cohomolo…
joelriou Nov 26, 2025
0c47772
rephrasing
joelriou Nov 27, 2025
07f0be5
Merge remote-tracking branch 'origin/homcomplex-cohomology-class' int…
joelriou Nov 27, 2025
fca9438
Merge remote-tracking branch 'origin/master' into homcomplex-cohomolo…
joelriou Nov 27, 2025
6da92ab
Apply suggestion from @joelriou
joelriou Nov 27, 2025
b18076f
Merge remote-tracking branch 'origin/master' into homcomplex-cohomolo…
joelriou Nov 29, 2025
491c379
equivHomShift'
joelriou Nov 29, 2025
9fb098b
Merge remote-tracking branch 'origin/master' into homcomplex-cohomolo…
joelriou Dec 4, 2025
6361fdc
Merge remote-tracking branch 'origin/homcomplex-cohomology-class-hom'…
joelriou Dec 4, 2025
ebf0ec9
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 4, 2025
269e1ec
fix
joelriou Dec 4, 2025
72943d4
fix
joelriou Dec 4, 2025
03dcbd8
wip
joelriou Dec 4, 2025
dc97b3b
wip
joelriou Dec 4, 2025
c30dd40
fix
joelriou Dec 4, 2025
06212aa
wip
joelriou Dec 4, 2025
ff8530a
added TODO
joelriou Dec 4, 2025
af0c548
typo
joelriou Dec 4, 2025
bd58ec5
typo
joelriou Dec 4, 2025
c9b75c9
typo
joelriou Dec 4, 2025
fa09c23
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 11, 2025
40ae59a
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 12, 2025
2eebe2a
whitespace
joelriou Dec 12, 2025
2185be8
s/cutsat/lia/g
joelriou Dec 12, 2025
070a4ab
feat(Algebra/Homology): equivOfIsKInjective
joelriou Dec 12, 2025
47b374b
dual instance
joelriou Dec 12, 2025
f65be34
feat(CategoryTheory): computing Ext-groups using a projective resolution
joelriou Dec 12, 2025
33b4728
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 19, 2025
cc78cc6
Merge remote-tracking branch 'origin/injective-resolution-ext' into p…
joelriou Dec 19, 2025
330876f
Merge remote-tracking branch 'origin/master' into projective-resoluti…
joelriou Dec 21, 2025
eafd64a
Update Mathlib/CategoryTheory/Abelian/Injective/Ext.lean
joelriou Dec 23, 2025
3582224
Update Mathlib/CategoryTheory/Abelian/Injective/Ext.lean
joelriou Dec 23, 2025
297c30b
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 23, 2025
b385574
used erw
joelriou Dec 23, 2025
108dde0
used change instead
joelriou Dec 23, 2025
d2f5015
better syntax
joelriou Dec 23, 2025
89da8cb
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 26, 2025
00c86c8
added simps attribute
joelriou Dec 27, 2025
f76e9de
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 27, 2025
5d0ba4a
Merge remote-tracking branch 'origin/injective-resolution-ext' into p…
joelriou Dec 28, 2025
19f66fb
fix
joelriou Dec 28, 2025
8fcc7cd
better equational lemma
joelriou Dec 28, 2025
bd68ef3
Merge remote-tracking branch 'origin/injective-resolution-ext' into p…
joelriou Dec 28, 2025
1c8eb67
better lemma
joelriou Dec 28, 2025
27aece1
typo
joelriou Dec 28, 2025
4510249
Merge remote-tracking branch 'origin/injective-resolution-ext' into p…
joelriou Dec 28, 2025
851cf76
better proof
joelriou Dec 28, 2025
3549a58
functoriality
joelriou Dec 28, 2025
2ef8943
Merge remote-tracking branch 'origin/projective-resolution-ext' into …
joelriou Dec 28, 2025
211678c
dual statement
joelriou Dec 28, 2025
72bf716
wip
joelriou Dec 28, 2025
b4b06c3
wip
joelriou Dec 28, 2025
bc8e78b
removed TODO
joelriou Dec 28, 2025
27add32
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Dec 28, 2025
3be9396
sorry free
joelriou Dec 28, 2025
0540607
Merge remote-tracking branch 'origin/master' into projective-resoluti…
joelriou Dec 28, 2025
34b3ce3
Merge remote-tracking branch 'origin/projective-resolution-ext' into …
joelriou Dec 28, 2025
fc6f310
Merge remote-tracking branch 'origin/injective-resolution-ext-functor…
joelriou Dec 28, 2025
7603e89
dual statement
joelriou Dec 28, 2025
62cc180
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Jan 2, 2026
26665a9
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Jan 3, 2026
72ae66c
suggestion by robin-carlier
joelriou Jan 3, 2026
0dd6bc5
Merge remote-tracking branch 'origin/injective-resolution-ext-functor…
joelriou Jan 3, 2026
31c8b6e
fix
joelriou Jan 3, 2026
75d8703
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Jan 10, 2026
1169f58
Merge remote-tracking branch 'origin/master' into injective-resolutio…
joelriou Jan 16, 2026
c455ed2
fix
joelriou Jan 16, 2026
9a86c30
better names
joelriou Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ lemma fromSingleMk_precomp
apply (fromSingleEquiv h).injective
simp [fromSingleEquiv, singleFunctor, singleFunctors, HomologicalComplex.single_map_f_self]

lemma fromSingleMk_postcomp {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
{L : CochainComplex C ℤ} (g : K ⟶ L) :
fromSingleMk (f ≫ g.f q) h =
(fromSingleMk f h).comp (.ofHom g) (add_zero n) :=
(fromSingleEquiv h).injective (by simp [fromSingleEquiv, singleFunctor, singleFunctors])

/-- Constructor for cochains to a single complex. -/
@[nolint unusedArguments]
noncomputable def toSingleMk {p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (_ : p + n = q) :
Expand Down Expand Up @@ -192,6 +198,13 @@ lemma toSingleMk_postcomp
apply (toSingleEquiv h).injective
simp [toSingleEquiv, singleFunctor, singleFunctors, HomologicalComplex.single_map_f_self]

lemma toSingleMk_precomp
{p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (h : p + n = q)
{L : CochainComplex C ℤ} (g : L ⟶ K) :
toSingleMk (g.f p ≫ f) h =
(Cochain.ofHom g).comp (toSingleMk f h) (zero_add n) :=
(toSingleEquiv h).injective (by simp [toSingleEquiv, singleFunctor, singleFunctors])

end Cochain

namespace Cocycle
Expand All @@ -212,6 +225,14 @@ lemma fromSingleMk_precomp {X' : C} (g : X' ⟶ X) {p q : ℤ} (f : X ⟶ K.X q)
ext : 1
exact (Cochain.fromSingleEquiv h).injective (by simp [Cochain.fromSingleMk_precomp])

lemma fromSingleMk_postcomp {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
(q' : ℤ) (hq' : q + 1 = q') (hf : f ≫ K.d q q' = 0) {L : CochainComplex C ℤ}
(g : K ⟶ L) :
fromSingleMk (f ≫ g.f q) h q' hq' (by simp [reassoc_of% hf]) =
(fromSingleMk f h q' hq' hf).postcomp g := by
ext : 1
exact (Cochain.fromSingleEquiv h).injective (by simp [Cochain.fromSingleMk_postcomp])

lemma fromSingleMk_surjective {p n : ℤ} (α : Cocycle ((singleFunctor C p).obj X) K n)
(q : ℤ) (h : p + n = q) (q' : ℤ) (hq' : q + 1 = q') :
∃ (f : X ⟶ K.X q) (hf : f ≫ K.d q q' = 0), fromSingleMk f h q' hq' hf = α := by
Expand Down Expand Up @@ -276,6 +297,15 @@ lemma toSingleMk_postcomp {p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (h : p + n = q
ext : 1
exact (Cochain.toSingleEquiv h).injective (by simp [Cochain.toSingleMk_postcomp])

lemma toSingleMk_precomp
{p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (h : p + n = q)
(p' : ℤ) (hp' : p' + 1 = p) (hf : K.d p' p ≫ f = 0)
{L : CochainComplex C ℤ} (g : L ⟶ K) :
toSingleMk (g.f p ≫ f) h p' hp' (by simp [← g.comm_assoc, hf]) =
(toSingleMk f h p' hp' hf).precomp g := by
ext : 1
exact (Cochain.toSingleEquiv h).injective (by simp [Cochain.toSingleMk_precomp])

lemma toSingleMk_surjective {q n : ℤ} (α : Cocycle K ((singleFunctor C q).obj X) n)
(p : ℤ) (h : p + n = q) (p' : ℤ) (hp' : p' + 1 = p) :
∃ (f : K.X p ⟶ X) (hf : K.d p' p ≫ f = 0), toSingleMk f h p' hp' hf = α := by
Expand Down
46 changes: 39 additions & 7 deletions Mathlib/CategoryTheory/Abelian/Injective/Ext.lean
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ Given an injective resolution `R` of an object `Y` in an abelian category `C`,
we provide an API in order to construct elements in `Ext X Y n` in terms
of the complex `R.cocomplex` and to make computations in the `Ext`-group.

## TODO
* Functoriality in `Y`: this would involve a morphism `Y ⟶ Y'`, injective
resolutions `R` and `R'` of `Y` and `Y'`, a lift of `Y ⟶ Y'` as a morphism
of cochain complexes `R.cocomplex ⟶ R'.cocomplex`; in this context,
we should be able to compute the postcomposition of an element
`R.extMk f m hm hf : Ext X Y n` by `Y ⟶ Y'`.

-/

@[expose] public section
Expand Down Expand Up @@ -182,6 +175,19 @@ lemma extMk_zero {n : ℕ} (m : ℕ) (hm : n + 1 = m) :
R.extMk (0 : X ⟶ R.cocomplex.X n) m hm (by simp) = 0 := by
simp [extMk]

lemma extMk_hom
[HasDerivedCategory C] {n : ℕ} (f : X ⟶ R.cocomplex.X n) (m : ℕ) (hm : n + 1 = m)
(hf : f ≫ R.cocomplex.d n m = 0) :
(R.extMk f m hm hf).hom =
(ShiftedHom.mk₀ _ rfl ((DerivedCategory.singleFunctorIsoCompQ C 0).hom.app X)).comp
((ShiftedHom.map (Cocycle.equivHomShift.symm
(Cocycle.fromSingleMk (f ≫ (R.cochainComplexXIso n n rfl).inv) (zero_add _) m
(by lia) (by simp [cochainComplex_d _ _ _ n m rfl rfl, reassoc_of% hf]))) _).comp
(.mk₀ _ rfl (inv (DerivedCategory.Q.map R.ι') ≫
(DerivedCategory.singleFunctorIsoCompQ C 0).inv.app Y))
(zero_add _)) (add_zero _) :=
extEquivCohomologyClass_symm_mk_hom _ _

lemma extMk_eq_zero_iff (f : X ⟶ R.cocomplex.X n) (m : ℕ) (hm : n + 1 = m)
(hf : f ≫ R.cocomplex.d n m = 0)
(p : ℕ) (hp : p + 1 = n) :
Expand Down Expand Up @@ -222,4 +228,30 @@ lemma mk₀_comp_extMk {n : ℕ} (f : X ⟶ R.cocomplex.X n) (m : ℕ) (hm : n +
← ShiftedHom.comp_assoc _ _ _ (add_zero _) (add_zero (n : ℤ)) (by simp)]
simp

variable {R} in
lemma extMk_comp_mk₀ {n : ℕ} (f : X ⟶ R.cocomplex.X n) (m : ℕ) (hm : n + 1 = m)
(hf : f ≫ R.cocomplex.d n m = 0)
{Y' : C} {R' : InjectiveResolution Y'} {g : Y ⟶ Y'} (φ : Hom R R' g) :
(R.extMk f m hm hf).comp (Ext.mk₀ g) (add_zero _) =
R'.extMk (f ≫ φ.hom.f n) m hm (by simp [reassoc_of% hf]) := by
have := HasDerivedCategory.standard C
ext
have : (f ≫ φ.hom.f n) ≫ (R'.cochainComplexXIso n n (by lia)).inv =
(f ≫ (R.cochainComplexXIso n n (by lia)).inv) ≫ φ.hom'.f n := by
simp [φ.hom'_f n n rfl]
simp only [Ext.comp_hom, extMk_hom, Ext.mk₀_hom, this]
rw [Cocycle.fromSingleMk_postcomp _ (zero_add _) _ (by lia)
(by simp [R.cochainComplex_d _ _ _ _ rfl rfl, reassoc_of% hf]),
Cocycle.equivHomShift_symm_postcomp,
← ShiftedHom.comp_mk₀ _ 0 rfl, ShiftedHom.map_comp,
ShiftedHom.comp_assoc _ _ _ _ (zero_add _) (by simp),
ShiftedHom.comp_assoc _ _ _ _ (zero_add _) (by simp),
ShiftedHom.comp_assoc _ _ _ _ (zero_add _) (by simp),
ShiftedHom.map_mk₀, ShiftedHom.mk₀_comp_mk₀, ShiftedHom.mk₀_comp_mk₀]
congr 3
rw [Category.assoc, ← NatTrans.naturality, ← Category.assoc, ← Category.assoc]
congr 1
simpa only [IsIso.eq_comp_inv, Category.assoc, IsIso.inv_comp_eq,
Functor.map_comp] using DerivedCategory.Q.congr_map φ.ι'_comp_hom'.symm

end CategoryTheory.InjectiveResolution
29 changes: 29 additions & 0 deletions Mathlib/CategoryTheory/Abelian/Injective/Extend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,35 @@ instance : R.cochainComplex.IsLE 0 := by
simp only [← HomologicalComplex.isSupported_iff_of_quasiIso R.ι']
infer_instance

namespace Hom

variable {R} {X' : C} {R' : InjectiveResolution X'} {f : X ⟶ X'}
(φ : Hom R R' f)

/-- The morphism on cochain complexes indexed by `ℤ` that is induced by
an (heterogeneous) morphism of injective resolutions. -/
noncomputable def hom' : R.cochainComplex ⟶ R'.cochainComplex :=
HomologicalComplex.extendMap φ.hom _

@[reassoc]
lemma hom'_f (n : ℤ) (m : ℕ) (h : m = n) :
φ.hom'.f n =
(R.cochainComplexXIso n m h).hom ≫ φ.hom.f m ≫ (R'.cochainComplexXIso n m h).inv := by
simp [hom', HomologicalComplex.extendMap_f _
ComplexShape.embeddingUpNat (i := m) (i' := n) (by simpa),
cochainComplexXIso]

@[reassoc (attr := simp)]
lemma ι'_comp_hom' :
R.ι' ≫ φ.hom' = (CochainComplex.singleFunctor C 0).map f ≫ R'.ι' :=
HomologicalComplex.from_single_hom_ext (by
simp [hom'_f _ 0 0 rfl, ι'_f_zero, CochainComplex.singleFunctor,
CochainComplex.singleFunctors,
HomologicalComplex.single, HomologicalComplex.singleObjXSelf,
HomologicalComplex.singleObjXIsoOfEq])

end Hom

end InjectiveResolution

end CategoryTheory
37 changes: 37 additions & 0 deletions Mathlib/CategoryTheory/Abelian/Projective/Ext.lean
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,19 @@ lemma extMk_zero {n : ℕ} (m : ℕ) (hm : n + 1 = m) :
R.extMk (0 : R.complex.X n ⟶ Y) m hm (by simp) = 0 := by
simp [extMk]

lemma extMk_hom
[HasDerivedCategory C] {n : ℕ} (f : R.complex.X n ⟶ Y) (m : ℕ) (hm : n + 1 = m)
(hf : R.complex.d m n ≫ f = 0) :
(R.extMk f m hm hf).hom =
(ShiftedHom.mk₀ _ rfl ((DerivedCategory.singleFunctorIsoCompQ C 0).hom.app X ≫
inv (DerivedCategory.Q.map R.π'))).comp
((ShiftedHom.map (Cocycle.equivHomShift.symm
(Cocycle.toSingleMk ((R.cochainComplexXIso (-n) n rfl).hom ≫ f) (by simp) (-m)
(by lia) (by simpa [cochainComplex_d _ _ _ _ _ rfl rfl]))) _).comp
(.mk₀ _ rfl ((DerivedCategory.singleFunctorIsoCompQ C 0).inv.app Y))
(zero_add _)) (add_zero _) :=
extEquivCohomologyClass_symm_mk_hom _ _

lemma extMk_eq_zero_iff (f : R.complex.X n ⟶ Y) (m : ℕ) (hm : n + 1 = m)
(hf : R.complex.d m n ≫ f = 0)
(p : ℕ) (hp : p + 1 = n) :
Expand Down Expand Up @@ -227,4 +240,28 @@ lemma extMk_comp_mk₀ {n : ℕ} (f : R.complex.X n ⟶ Y) (m : ℕ) (hm : n + 1
ShiftedHom.mk₀_comp_mk₀, ShiftedHom.mk₀_comp_mk₀, ← NatTrans.naturality]
dsimp

variable {R} in
lemma mk₀_comp_extMk {n : ℕ} (f : R.complex.X n ⟶ Y) (m : ℕ) (hm : n + 1 = m)
(hf : R.complex.d m n ≫ f = 0)
{X' : C} {R' : ProjectiveResolution X'} {g : X' ⟶ X} (φ : Hom R' R g) :
(Ext.mk₀ g).comp (R.extMk f m hm hf) (zero_add _) =
R'.extMk (φ.hom.f n ≫ f) m hm (by simp [← φ.hom.comm_assoc, hf]) := by
have := HasDerivedCategory.standard C
ext
have : (R'.cochainComplexXIso (-n) n (by lia)).hom ≫ φ.hom.f n =
φ.hom'.f (-n) ≫ (R.cochainComplexXIso (-n) n (by lia)).hom := by
simp [φ.hom'_f _ _ rfl]
simp only [Ext.comp_hom, extMk_hom, Ext.mk₀_hom, reassoc_of% this]
rw [Cocycle.toSingleMk_precomp _ _ _ (by lia)
(by simpa [R.cochainComplex_d _ _ _ _ rfl rfl]),
Cocycle.equivHomShift_symm_precomp,
← ShiftedHom.mk₀_comp 0 rfl, ShiftedHom.map_comp,
← ShiftedHom.comp_assoc _ _ _ (zero_add _) _ (by simp),
← ShiftedHom.comp_assoc _ _ _ (add_zero _) _ (by simp),
← ShiftedHom.comp_assoc _ _ _ (add_zero _) _ (by simp),
← ShiftedHom.comp_assoc _ _ _ (zero_add _) _ (by simp),
ShiftedHom.map_mk₀, ShiftedHom.mk₀_comp_mk₀, ShiftedHom.mk₀_comp_mk₀]
congr 3
simp [← Functor.map_comp_assoc, ← Functor.map_comp]

end CategoryTheory.ProjectiveResolution
29 changes: 29 additions & 0 deletions Mathlib/CategoryTheory/Abelian/Projective/Extend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,35 @@ instance : R.cochainComplex.IsGE 0 := by
simp only [HomologicalComplex.isSupported_iff_of_quasiIso R.π']
infer_instance

namespace Hom

variable {R} {X' : C} {R' : ProjectiveResolution X'} {f : X ⟶ X'}
(φ : Hom R R' f)

/-- The morphism on cochain complexes indexed by `ℤ` that is induced by
a (heterogeneous) morphism of projective resolutions. -/
noncomputable def hom' : R.cochainComplex ⟶ R'.cochainComplex :=
HomologicalComplex.extendMap φ.hom _

@[reassoc]
lemma hom'_f (n : ℤ) (m : ℕ) (h : -m = n) :
φ.hom'.f n =
(R.cochainComplexXIso n m h).hom ≫ φ.hom.f m ≫ (R'.cochainComplexXIso n m h).inv := by
simp [hom', HomologicalComplex.extendMap_f _
ComplexShape.embeddingDownNat (i := m) (i' := n) (by dsimp; lia),
cochainComplexXIso]

@[reassoc (attr := simp)]
lemma hom'_comp_π' :
φ.hom' ≫ R'.π' = R.π' ≫ (CochainComplex.singleFunctor C 0).map f :=
HomologicalComplex.to_single_hom_ext (by
simp [hom'_f _ 0 0 rfl, π'_f_zero, CochainComplex.singleFunctor,
CochainComplex.singleFunctors,
HomologicalComplex.single, HomologicalComplex.singleObjXSelf,
HomologicalComplex.singleObjXIsoOfEq])

end Hom

end ProjectiveResolution

end CategoryTheory
21 changes: 21 additions & 0 deletions Mathlib/CategoryTheory/Preadditive/Injective/Resolution.lean
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,27 @@ def self [Injective Z] : InjectiveResolution Z where
apply HomologicalComplex.isZero_single_obj_X
simp

variable {Z} {Z' : C} (I' : InjectiveResolution Z')

/-- Given injective resolutions `I` and `I'` of two objects `Z` and `Z'`,
and a morphism `f : Z ⟶ Z'`, this structure contains the data of a morphism
`I.cocomplex ⟶ I'.cocomplex` which is compatible with `f` -/
structure Hom (f : Z ⟶ Z') where
/-- A morphism between the cocomplexes -/
hom : I.cocomplex ⟶ I'.cocomplex
ι_f_zero_comp_hom_f_zero : I.ι.f 0 ≫ hom.f 0 = ((single₀ C).map f).f 0 ≫ I'.ι.f 0

namespace Hom

attribute [reassoc (attr := simp)] ι_f_zero_comp_hom_f_zero

variable {I I'} in
@[reassoc (attr := simp)]
lemma ι_comp_hom {f : Z ⟶ Z'} (φ : Hom I I' f) :
I.ι ≫ φ.hom = (single₀ C).map f ≫ I'.ι := by cat_disch

end Hom

end InjectiveResolution

end CategoryTheory
21 changes: 21 additions & 0 deletions Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ noncomputable def self [Projective Z] : ProjectiveResolution Z where
apply HomologicalComplex.isZero_single_obj_X
simp

variable {Z} {Z' : C} (P' : ProjectiveResolution Z')

/-- Given injective resolutions `P` and `P'` of two objects `Z` and `Z'`,
and a morphism `f : Z ⟶ Z'`, this structure contains the data of a morphism
`P.complex ⟶ P'.complex` which is compatible with `f` -/
structure Hom (f : Z ⟶ Z') where
/-- A morphism between the cocomplexes -/
hom : P.complex ⟶ P'.complex
hom_f_zero_comp_π_f_zero : hom.f 0 ≫ P'.π.f 0 = P.π.f 0 ≫ ((single₀ C).map f).f 0

namespace Hom

attribute [reassoc (attr := simp)] hom_f_zero_comp_π_f_zero

variable {I I'} in
@[reassoc (attr := simp)]
lemma hom_comp_π {f : Z ⟶ Z'} (φ : Hom P P' f) :
φ.hom ≫ P'.π = P.π ≫ (single₀ C).map f := by cat_disch

end Hom

end ProjectiveResolution

namespace Functor
Expand Down