Skip to content

Commit 51a7cdb

Browse files
committed
feat(Algebra/Homology): extensions of bifunctors to complexes preserve homotopies (leanprover-community#32383)
Given a `TotalComplexShape c₁ c₂ c`, a functor `F : C₁ ⥤ C₂ ⥤ D`, we show in this PR that up to homotopy the morphism `mapBifunctorMap f₁ f₂ F c` only depends on the homotopy classes of the morphism `f₁` in `HomologicalComplex C c₁` and of the morphism `f₂` in `HomologicalComplex C c₂`. (The case of `f₁` was already done, the case of `f₂` is obtained in this PR by symmetry.)
1 parent 571ff86 commit 51a7cdb

3 files changed

Lines changed: 118 additions & 8 deletions

File tree

Mathlib/Algebra/Homology/BifunctorFlip.lean

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ namespace HomologicalComplex
2929

3030
variable {I₁ I₂ J : Type*} {c₁ : ComplexShape I₁} {c₂ : ComplexShape I₂}
3131
[HasZeroMorphisms C₁] [HasZeroMorphisms C₂] [Preadditive D]
32-
(K₁ : HomologicalComplex C₁ c₁) (K₂ : HomologicalComplex C₂ c₂)
32+
(K₁ L₁ : HomologicalComplex C₁ c₁) (φ₁ : K₁ ⟶ L₁)
33+
(K₂ L₂ : HomologicalComplex C₂ c₂) (φ₂ : K₂ ⟶ L₂)
3334
(F : C₁ ⥤ C₂ ⥤ D) [F.PreservesZeroMorphisms] [∀ X₁, (F.obj X₁).PreservesZeroMorphisms]
3435
(c : ComplexShape J) [TotalComplexShape c₁ c₂ c] [TotalComplexShape c₂ c₁ c]
3536
[TotalComplexShapeSymmetry c₁ c₂ c]
@@ -38,7 +39,7 @@ lemma hasMapBifunctor_flip_iff :
3839
HasMapBifunctor K₂ K₁ F.flip c ↔ HasMapBifunctor K₁ K₂ F c :=
3940
(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).flip_hasTotal_iff c
4041

41-
variable [DecidableEq J] [HasMapBifunctor K₁ K₂ F c]
42+
variable [DecidableEq J] [HasMapBifunctor K₁ K₂ F c] [HasMapBifunctor L₁ L₂ F c]
4243

4344
instance : HasMapBifunctor K₂ K₁ F.flip c := by
4445
rw [hasMapBifunctor_flip_iff]
@@ -49,9 +50,32 @@ noncomputable def mapBifunctorFlipIso :
4950
mapBifunctor K₂ K₁ F.flip c ≅ mapBifunctor K₁ K₂ F c :=
5051
(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).totalFlipIso c
5152

53+
@[reassoc (attr := simp)]
54+
lemma ι_mapBifunctorFlipIso_hom (i₁ : I₁) (i₂ : I₂) (j : J) (hj : c₂.π c₁ c (i₂, i₁) = j) :
55+
ιMapBifunctor K₂ K₁ F.flip c i₂ i₁ j hj ≫ (mapBifunctorFlipIso K₁ K₂ F c).hom.f j =
56+
c₁.σ c₂ c i₁ i₂ • ιMapBifunctor K₁ K₂ F c i₁ i₂ j
57+
(by rw [← ComplexShape.π_symm c₁ c₂ c i₁ i₂, hj]) :=
58+
HomologicalComplex₂.ιTotal_totalFlipIso_f_hom
59+
(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂) c i₁ i₂ j hj
60+
61+
@[reassoc (attr := simp)]
62+
lemma ι_mapBifunctorFlipIso_inv (i₁ : I₁) (i₂ : I₂) (j : J) (hj : c₁.π c₂ c (i₁, i₂) = j) :
63+
ιMapBifunctor K₁ K₂ F c i₁ i₂ j hj ≫ (mapBifunctorFlipIso K₁ K₂ F c).inv.f j =
64+
c₁.σ c₂ c i₁ i₂ • ιMapBifunctor K₂ K₁ F.flip c i₂ i₁ j
65+
(by rw [ComplexShape.π_symm c₁ c₂ c i₁ i₂, hj]) :=
66+
HomologicalComplex₂.ιTotal_totalFlipIso_f_inv
67+
(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂) c i₁ i₂ j hj
68+
5269
lemma mapBifunctorFlipIso_flip
5370
[TotalComplexShapeSymmetry c₂ c₁ c] [TotalComplexShapeSymmetrySymmetry c₁ c₂ c] :
5471
mapBifunctorFlipIso K₂ K₁ F.flip c = (mapBifunctorFlipIso K₁ K₂ F c).symm :=
5572
(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).flip_totalFlipIso c
5673

74+
variable {K₁ K₂ L₁ L₂} in
75+
@[reassoc (attr := simp)]
76+
lemma mapBifunctorFlipIso_hom_naturality :
77+
mapBifunctorMap φ₂ φ₁ F.flip c ≫ (mapBifunctorFlipIso L₁ L₂ F c).hom =
78+
(mapBifunctorFlipIso K₁ K₂ F c).hom ≫ mapBifunctorMap φ₁ φ₂ F c := by
79+
cat_disch
80+
5781
end HomologicalComplex

Mathlib/Algebra/Homology/BifunctorHomotopy.lean

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Authors: Joël Riou
55
-/
66
module
77

8-
public import Mathlib.Algebra.Homology.Bifunctor
8+
public import Mathlib.Algebra.Homology.BifunctorFlip
99
public import Mathlib.Algebra.Homology.Homotopy
1010

1111
/-!
1212
# The action of a bifunctor on homological complexes factors through homotopies
1313
1414
Given a `TotalComplexShape c₁ c₂ c`, a functor `F : C₁ ⥤ C₂ ⥤ D`,
15-
we shall show in this file that up to homotopy the morphism
15+
we show in this file that up to homotopy the morphism
1616
`mapBifunctorMap f₁ f₂ F c` only depends on the homotopy classes of
1717
the morphism `f₁` in `HomologicalComplex C c₁` and of
18-
the morphism `f₂` in `HomologicalComplex C c₂` (TODO).
18+
the morphism `f₂` in `HomologicalComplex C c₂`.
1919
2020
-/
2121

@@ -32,11 +32,10 @@ variable {C₁ C₂ D I₁ I₂ J : Type*} [Category C₁] [Category C₂] [Cate
3232
namespace HomologicalComplex
3333

3434
variable {K₁ L₁ : HomologicalComplex C₁ c₁} {f₁ f₁' : K₁ ⟶ L₁} (h₁ : Homotopy f₁ f₁')
35-
{K₂ L₂ : HomologicalComplex C₂ c₂} (f₂ : K₂ ⟶ L₂)
35+
{K₂ L₂ : HomologicalComplex C₂ c₂} (f₂ f₂' : K₂ ⟶ L₂) (h₂ : Homotopy f₂ f₂')
3636
(F : C₁ ⥤ C₂ ⥤ D) [F.Additive] [∀ X₁, (F.obj X₁).Additive]
3737
(c : ComplexShape J) [DecidableEq J] [TotalComplexShape c₁ c₂ c]
38-
[HasMapBifunctor K₁ K₂ F c]
39-
[HasMapBifunctor L₁ L₂ F c]
38+
[HasMapBifunctor K₁ K₂ F c] [HasMapBifunctor L₁ L₂ F c]
4039

4140
namespace mapBifunctorMapHomotopy
4241

@@ -57,6 +56,27 @@ lemma ιMapBifunctor_hom₁ (i₁ i₁' : I₁) (i₂ : I₂) (j j' : J)
5756
subst h'
5857
simp [hom₁]
5958

59+
variable (f₁) {f₂ f₂'} in
60+
/-- Auxiliary definition for `mapBifunctorMapHomotopy₂`. -/
61+
noncomputable def hom₂ (j j' : J) :
62+
(mapBifunctor K₁ K₂ F c).X j ⟶ (mapBifunctor L₁ L₂ F c).X j' :=
63+
HomologicalComplex₂.totalDesc _
64+
(fun i₁ i₂ _ ↦ ComplexShape.ε₂ c₁ c₂ c (i₁, c₂.prev i₂) •
65+
(F.map (f₁.f i₁)).app (K₂.X i₂) ≫
66+
(F.obj (L₁.X i₁)).map (h₂.hom i₂ (c₂.prev i₂)) ≫
67+
ιMapBifunctorOrZero L₁ L₂ F c _ _ j')
68+
69+
variable (f₁) {f₂ f₂'} in
70+
@[reassoc]
71+
lemma ιMapBifunctor_hom₂ (i₁ : I₁) (i₂ i₂' : I₂) (j j' : J)
72+
(h : ComplexShape.π c₁ c₂ c (i₁, i₂') = j) (h' : c₂.prev i₂' = i₂) :
73+
ιMapBifunctor K₁ K₂ F c i₁ i₂' j h ≫ hom₂ f₁ h₂ F c j j' =
74+
ComplexShape.ε₂ c₁ c₂ c (i₁, i₂) •
75+
(F.map (f₁.f i₁)).app (K₂.X i₂') ≫
76+
(F.obj (L₁.X i₁)).map (h₂.hom i₂' i₂) ≫ ιMapBifunctorOrZero L₁ L₂ F c i₁ i₂ j' := by
77+
subst h'
78+
simp [hom₂]
79+
6080
lemma zero₁ (j j' : J) (h : ¬ c.Rel j' j) :
6181
hom₁ h₁ f₂ F c j j' = 0 := by
6282
ext i₁ i₂ h'
@@ -158,4 +178,47 @@ noncomputable def mapBifunctorMapHomotopy₁ :
158178
zero := zero₁ h₁ f₂ F c
159179
comm := comm₁ h₁ f₂ F c
160180

181+
variable (f₁) {f₂ f₂'} in
182+
open mapBifunctorMapHomotopy in
183+
/-- The homotopy between `mapBifunctorMap f₁ f₂ F c` and `mapBifunctorMap f₁ f₂' F c` that
184+
is induced by a homotopy between `f₂` and `f₂'`. -/
185+
noncomputable def mapBifunctorMapHomotopy₂ :
186+
Homotopy (mapBifunctorMap f₁ f₂ F c) (mapBifunctorMap f₁ f₂' F c) :=
187+
letI : TotalComplexShape c₂ c₁ c := TotalComplexShape.symm c₁ c₂ c
188+
letI : TotalComplexShapeSymmetry c₁ c₂ c := TotalComplexShape.symmSymmetry c₁ c₂ c
189+
haveI : F.flip.Additive := { }
190+
haveI (X₁ : C₂) : (F.flip.obj X₁).Additive := { }
191+
letI H : Homotopy (mapBifunctorMap f₁ f₂ F c) (mapBifunctorMap f₁ f₂' F c) :=
192+
(Homotopy.ofEq (by simp)).trans
193+
((((mapBifunctorMapHomotopy₁ h₂ f₁ F.flip c).compRight
194+
(mapBifunctorFlipIso L₁ L₂ F c).hom).compLeft
195+
((mapBifunctorFlipIso K₁ K₂ F c).inv)).trans (Homotopy.ofEq (by simp)))
196+
haveI hom₂_eq : hom₂ f₁ h₂ F c = H.hom := by
197+
ext j j' i₁ i₂ hj
198+
dsimp [H, mapBifunctorMapHomotopy₁]
199+
rw [add_zero, zero_add, ι_mapBifunctorFlipIso_inv_assoc, Linear.units_smul_comp,
200+
ιMapBifunctor_hom₁_assoc h₂ f₁ F.flip c _ i₂ i₁ j j'
201+
(by rw [ComplexShape.π_symm c₁ c₂ c i₁ i₂, hj]) rfl,
202+
ιMapBifunctor_hom₂ f₁ h₂ F c i₁ _ i₂ j j' hj rfl]
203+
dsimp
204+
simp only [NatTrans.naturality_assoc, Linear.units_smul_comp, assoc]
205+
by_cases hj' : c₁.π c₂ c (i₁, c₂.prev i₂) = j'
206+
· rw [ιMapBifunctorOrZero_eq _ _ _ _ _ _ _ hj',
207+
ιMapBifunctorOrZero_eq _ _ _ _ _ _ _ (by rwa [ComplexShape.π_symm c₁ c₂ c]),
208+
ι_mapBifunctorFlipIso_hom, Linear.comp_units_smul, Linear.comp_units_smul,
209+
smul_smul, smul_smul]
210+
by_cases hi₂ : c₂.Rel (c₂.prev i₂) i₂
211+
· congr 1
212+
nth_rw 2 [mul_comm]
213+
rw [← ComplexShape.σ_ε₂ c₁ c i₁ hi₂, mul_comm, ← mul_assoc,
214+
Int.units_mul_self, one_mul]
215+
· rw [h₂.zero _ _ hi₂, Functor.map_zero, zero_comp, comp_zero, smul_zero, smul_zero]
216+
· rw [ιMapBifunctorOrZero_eq_zero _ _ _ _ _ _ _ hj',
217+
ιMapBifunctorOrZero_eq_zero _ _ _ _ _ _ _ (by rwa [ComplexShape.π_symm c₁ c₂ c]),
218+
comp_zero, comp_zero, smul_zero, zero_comp, comp_zero,
219+
comp_zero, smul_zero, smul_zero]
220+
{ hom := hom₂ f₁ h₂ F c
221+
zero j j' h := by simpa only [hom₂_eq] using H.zero j j' h
222+
comm j := by simpa only [hom₂_eq] using H.comm j }
223+
161224
end HomologicalComplex

Mathlib/Algebra/Homology/ComplexShapeSigns.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ instance {I : Type*} [AddMonoid I] (c : ComplexShape I) [c.TensorSigns] :
270270

271271
end ComplexShape
272272

273+
/-- The total complex shape for `c₂`, `c₁` and `c₁₂` that is deduced
274+
from a total complex shape for `c₁`, `c₂` and `c₁₂`. -/
275+
def TotalComplexShape.symm [TotalComplexShape c₁ c₂ c₁₂] :
276+
TotalComplexShape c₂ c₁ c₁₂ where
277+
π := fun ⟨i₂, i₁⟩ ↦ ComplexShape.π c₁ c₂ c₁₂ ⟨i₁, i₂⟩
278+
ε₁ := fun ⟨i₂, i₁⟩ ↦ ComplexShape.ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩
279+
ε₂ := fun ⟨i₂, i₁⟩ ↦ ComplexShape.ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂⟩
280+
rel₁ h i₁ := ComplexShape.rel_π₂ c₁ c₁₂ i₁ h
281+
rel₂ i₂ _ _ h := ComplexShape.rel_π₁ c₂ c₁₂ h i₂
282+
ε₂_ε₁ h₂ h₁ := by
283+
rw [neg_mul, ComplexShape.ε₂_ε₁ c₁₂ h₁ h₂, neg_mul, neg_neg]
284+
273285
/-- A total complex shape symmetry contains the data and properties which allow the
274286
identification of the two total complex functors
275287
`HomologicalComplex₂ C c₁ c₂ ⥤ HomologicalComplex C c₁₂`
@@ -283,6 +295,17 @@ class TotalComplexShapeSymmetry [TotalComplexShape c₁ c₂ c₁₂] [TotalComp
283295
σ_ε₂ (i₁ : I₁) {i₂ i₂' : I₂} (h₂ : c₂.Rel i₂ i₂') :
284296
σ i₁ i₂ * ComplexShape.ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ = ComplexShape.ε₁ c₂ c₁ c₁₂ ⟨i₂, i₁⟩ * σ i₁ i₂'
285297

298+
/-- The symmetry between the total complex shape for `c₁`, `c₂` and `c₁₂`,
299+
and its symmetric total complex shape. -/
300+
def TotalComplexShape.symmSymmetry [TotalComplexShape c₁ c₂ c₁₂] :
301+
letI := TotalComplexShape.symm c₁ c₂ c₁₂
302+
TotalComplexShapeSymmetry c₁ c₂ c₁₂ :=
303+
letI := TotalComplexShape.symm c₁ c₂ c₁₂
304+
{ symm i₁ i₂ := rfl
305+
σ _ _ := 1
306+
σ_ε₁ _ _ := by aesop
307+
σ_ε₂ _ _ := by aesop }
308+
286309
namespace ComplexShape
287310

288311
variable [TotalComplexShape c₁ c₂ c₁₂] [TotalComplexShape c₂ c₁ c₁₂]

0 commit comments

Comments
 (0)