|
| 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.HomologySequenceLemmas |
| 9 | +import Mathlib.Algebra.Homology.Refinements |
| 10 | + |
| 11 | +/-! |
| 12 | +# The mapping cone of a monomorphism, up to a quasi-isomophism |
| 13 | +
|
| 14 | +If `S` is a short exact short complex of cochain complexes in an abelian category, |
| 15 | +we construct a quasi-isomorphism `descShortComplex S : mappingCone S.f ⟶ S.X₃`. |
| 16 | +
|
| 17 | +We obtain this by comparing the homology sequence of `S` and the homology |
| 18 | +sequence of the homology functor on the homotopy category, applied to the |
| 19 | +distinguished triangle attached to the mapping cone of `S.f`. |
| 20 | +
|
| 21 | +-/ |
| 22 | + |
| 23 | +open CategoryTheory Category ComplexShape HomotopyCategory Limits |
| 24 | + HomologicalComplex.HomologySequence Pretriangulated Preadditive |
| 25 | + |
| 26 | +variable {C : Type*} [Category C] [Abelian C] |
| 27 | + |
| 28 | +namespace CochainComplex |
| 29 | + |
| 30 | +@[reassoc] |
| 31 | +lemma homologySequenceδ_quotient_mapTriangle_obj |
| 32 | + (T : Triangle (CochainComplex C ℤ)) (n₀ n₁ : ℤ) (h : n₀ + 1 = n₁) : |
| 33 | + (homologyFunctor C (up ℤ) 0).homologySequenceδ |
| 34 | + ((quotient C (up ℤ)).mapTriangle.obj T) n₀ n₁ h = |
| 35 | + (homologyFunctorFactors C (up ℤ) n₀).hom.app _ ≫ |
| 36 | + (HomologicalComplex.homologyFunctor C (up ℤ) 0).shiftMap T.mor₃ n₀ n₁ (by omega) ≫ |
| 37 | + (homologyFunctorFactors C (up ℤ) n₁).inv.app _ := by |
| 38 | + apply homologyFunctor_shiftMap |
| 39 | + |
| 40 | +namespace mappingCone |
| 41 | + |
| 42 | +variable (S : ShortComplex (CochainComplex C ℤ)) (hS : S.ShortExact) |
| 43 | + |
| 44 | +/-- The canonical morphism `mappingCone S.f ⟶ S.X₃` when `S` is a short complex |
| 45 | +of cochain complexes. -/ |
| 46 | +noncomputable def descShortComplex : mappingCone S.f ⟶ S.X₃ := desc S.f 0 S.g (by simp) |
| 47 | + |
| 48 | +@[reassoc (attr := simp)] |
| 49 | +lemma inr_descShortComplex : inr S.f ≫ descShortComplex S = S.g := by |
| 50 | + simp [descShortComplex] |
| 51 | + |
| 52 | +@[reassoc (attr := simp)] |
| 53 | +lemma inr_f_descShortComplex_f (n : ℤ) : (inr S.f).f n ≫ (descShortComplex S).f n = S.g.f n := by |
| 54 | + simp [descShortComplex] |
| 55 | + |
| 56 | +@[reassoc (attr := simp)] |
| 57 | +lemma inl_v_descShortComplex_f (i j : ℤ) (h : i + (-1) = j) : |
| 58 | + (inl S.f).v i j h ≫ (descShortComplex S).f j = 0 := by |
| 59 | + simp [descShortComplex] |
| 60 | + |
| 61 | +variable {S} |
| 62 | + |
| 63 | +lemma homologySequenceδ_triangleh (n₀ : ℤ) (n₁ : ℤ) (h : n₀ + 1 = n₁) : |
| 64 | + (homologyFunctor C (up ℤ) 0).homologySequenceδ (triangleh S.f) n₀ n₁ h = |
| 65 | + (homologyFunctorFactors C (up ℤ) n₀).hom.app _ ≫ |
| 66 | + HomologicalComplex.homologyMap (descShortComplex S) n₀ ≫ hS.δ n₀ n₁ h ≫ |
| 67 | + (homologyFunctorFactors C (up ℤ) n₁).inv.app _ := by |
| 68 | + /- We proceed by diagram chase. We test the identity on |
| 69 | + cocycles `x' : A' ⟶ (mappingCone S.f).X n₀` -/ |
| 70 | + dsimp |
| 71 | + rw [← cancel_mono ((homologyFunctorFactors C (up ℤ) n₁).hom.app _), |
| 72 | + assoc, assoc, assoc, Iso.inv_hom_id_app, |
| 73 | + ← cancel_epi ((homologyFunctorFactors C (up ℤ) n₀).inv.app _), Iso.inv_hom_id_app_assoc] |
| 74 | + apply yoneda.map_injective |
| 75 | + ext ⟨A⟩ (x : A ⟶ _) |
| 76 | + obtain ⟨A', π, _, x', w, hx'⟩ := |
| 77 | + (mappingCone S.f).eq_liftCycles_homologyπ_up_to_refinements x n₁ (by simpa using h) |
| 78 | + erw [homologySequenceδ_quotient_mapTriangle_obj_assoc _ _ _ h] |
| 79 | + dsimp |
| 80 | + rw [comp_id, Iso.inv_hom_id_app_assoc, Iso.inv_hom_id_app] |
| 81 | + erw [comp_id] |
| 82 | + rw [← cancel_epi π, reassoc_of% hx', reassoc_of% hx', |
| 83 | + HomologicalComplex.homologyπ_naturality_assoc, |
| 84 | + HomologicalComplex.liftCycles_comp_cyclesMap_assoc] |
| 85 | + /- We decompose the cocycle `x'` into two morphisms `a : A' ⟶ S.X₁.X n₁` |
| 86 | + and `b : A' ⟶ S.X₂.X n₀` satisfying certain relations. -/ |
| 87 | + obtain ⟨a, b, hab⟩ := decomp_to _ x' n₁ h |
| 88 | + rw [hab, ext_to_iff _ n₁ (n₁ + 1) rfl, add_comp, assoc, assoc, inr_f_d, add_comp, assoc, |
| 89 | + assoc, assoc, assoc, inr_f_fst_v, comp_zero, comp_zero, add_zero, zero_comp, |
| 90 | + d_fst_v _ _ _ _ h, comp_neg, inl_v_fst_v_assoc, comp_neg, neg_eq_zero, |
| 91 | + add_comp, assoc, assoc, assoc, assoc, inr_f_snd_v, comp_id, zero_comp, |
| 92 | + d_snd_v _ _ _ h, comp_add, inl_v_fst_v_assoc, inl_v_snd_v_assoc, zero_comp, add_zero] at w |
| 93 | + /- We simplify the RHS. -/ |
| 94 | + conv_rhs => simp only [hab, add_comp, assoc, inr_f_descShortComplex_f, |
| 95 | + inl_v_descShortComplex_f, comp_zero, zero_add] |
| 96 | + rw [hS.δ_eq n₀ n₁ (by simpa using h) (b ≫ S.g.f n₀) _ b rfl (-a) |
| 97 | + (by simp only [neg_comp, neg_eq_iff_add_eq_zero, w.2]) (n₁ + 1) (by simp)] |
| 98 | + /- We simplify the LHS. -/ |
| 99 | + dsimp [Functor.shiftMap, homologyFunctor_shift] |
| 100 | + rw [HomologicalComplex.homologyπ_naturality_assoc, |
| 101 | + HomologicalComplex.liftCycles_comp_cyclesMap_assoc, |
| 102 | + S.X₁.liftCycles_shift_homologyπ_assoc _ _ _ _ n₁ (by omega) (n₁ + 1) (by simp), |
| 103 | + Iso.inv_hom_id_app] |
| 104 | + dsimp [homologyFunctor_shift] |
| 105 | + simp only [hab, add_comp, assoc, inl_v_triangle_mor₃_f_assoc, |
| 106 | + shiftFunctorObjXIso, neg_comp, Iso.inv_hom_id, comp_neg, comp_id, |
| 107 | + inr_f_triangle_mor₃_f_assoc, zero_comp, comp_zero, add_zero] |
| 108 | + |
| 109 | +open ComposableArrows |
| 110 | + |
| 111 | +set_option simprocs false |
| 112 | + |
| 113 | +lemma quasiIso_descShortComplex : QuasiIso (descShortComplex S) where |
| 114 | + quasiIsoAt n := by |
| 115 | + rw [quasiIsoAt_iff_isIso_homologyMap] |
| 116 | + let φ : ((homologyFunctor C (up ℤ) 0).homologySequenceComposableArrows₅ |
| 117 | + (triangleh S.f) n _ rfl).δlast ⟶ (composableArrows₅ hS n _ rfl).δlast := |
| 118 | + homMk₄ ((homologyFunctorFactors C (up ℤ) _).hom.app _) |
| 119 | + ((homologyFunctorFactors C (up ℤ) _).hom.app _) |
| 120 | + ((homologyFunctorFactors C (up ℤ) _).hom.app _ ≫ |
| 121 | + HomologicalComplex.homologyMap (descShortComplex S) n) |
| 122 | + ((homologyFunctorFactors C (up ℤ) _).hom.app _) |
| 123 | + ((homologyFunctorFactors C (up ℤ) _).hom.app _) |
| 124 | + ((homologyFunctorFactors C (up ℤ) _).hom.naturality S.f) |
| 125 | + (by |
| 126 | + erw [(homologyFunctorFactors C (up ℤ) n).hom.naturality_assoc] |
| 127 | + dsimp |
| 128 | + rw [← HomologicalComplex.homologyMap_comp, inr_descShortComplex]) |
| 129 | + (by |
| 130 | + dsimp |
| 131 | + erw [homologySequenceδ_triangleh hS] |
| 132 | + simp only [Functor.comp_obj, HomologicalComplex.homologyFunctor_obj, assoc, |
| 133 | + Iso.inv_hom_id_app, comp_id]) |
| 134 | + ((homologyFunctorFactors C (up ℤ) _).hom.naturality S.f) |
| 135 | + have : IsIso ((homologyFunctorFactors C (up ℤ) n).hom.app (mappingCone S.f) ≫ |
| 136 | + HomologicalComplex.homologyMap (descShortComplex S) n) := by |
| 137 | + apply Abelian.isIso_of_epi_of_isIso_of_isIso_of_mono |
| 138 | + ((homologyFunctor C (up ℤ) 0).homologySequenceComposableArrows₅_exact _ |
| 139 | + (mappingCone_triangleh_distinguished S.f) n _ rfl).δlast |
| 140 | + (composableArrows₅_exact hS n _ rfl).δlast φ |
| 141 | + all_goals dsimp [φ]; infer_instance |
| 142 | + apply IsIso.of_isIso_comp_left ((homologyFunctorFactors C (up ℤ) n).hom.app (mappingCone S.f)) |
| 143 | + |
| 144 | +end mappingCone |
| 145 | + |
| 146 | +end CochainComplex |
0 commit comments