Hodge conjecture: the CM case in Lean, read and discussed
OpenAI's Lean proof of the Hodge conjecture for CM abelian varieties: rerun it, read its statement, and keep the open questions with their sources. The conjecture is open

| 1 | /- |
| 2 | Derived from AINTLIB: |
| 3 | projects/ModularCurves/ModularCurves/ForMathlib/SheafDerivedGlobalSections.lean |
| 4 | The upstream AINTLIB repository is licensed under Apache 2.0. |
| 5 | This file has been modified. |
| 6 | -/ |
| 7 | import Mathlib.Algebra.Homology.Embedding.ExtendHomology |
| 8 | import Mathlib.CategoryTheory.Abelian.Injective.Ext |
| 9 | import Mathlib.CategoryTheory.Abelian.RightDerived |
| 10 | import Mathlib.CategoryTheory.Sites.GlobalSections |
| 11 | import OAI.AlgebraicGeometry.SheafCohomology.Cech.Compat |
| 12 | import OAI.AlgebraicGeometry.SheafCohomology.Cech.GlobalSectionsFunctor |
| 13 | |
| 14 | /-! # Derived Global Sections -/ |
| 15 | |
| 16 | namespace OAI.AlgebraicGeometry.SheafCohomology.Cech.DerivedGlobalSections |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | open _root_.CategoryTheory |
| 21 | open _root_.CategoryTheory.Abelian |
| 22 | open _root_.CategoryTheory.Abelian.Ext |
| 23 | open _root_.TopCat |
| 24 | open _root_.TopCat.Sheaf |
| 25 | |
| 26 | /-! |
| 27 | # Sheaf cohomology as derived global sections |
| 28 | |
| 29 | This file identifies `Ext` from a representing object with the right-derived functors of |
| 30 | the represented additive functor. It then specializes this comparison to identify genuine |
| 31 | sheaf cohomology with right-derived global sections. |
| 32 | -/ |
| 33 | |
| 34 | open _root_.CategoryTheory.Limits |
| 35 | |
| 36 | universe v u |
| 37 | |
| 38 | namespace CategoryTheory.Abelian.Ext |
| 39 | |
| 40 | variable {C : Type u} [Category.{v} C] [Abelian C] |
| 41 | variable {G : C ⥤ AddCommGrpCat.{v}} [G.Additive] |
| 42 | variable {Z F : C} |
| 43 | |
| 44 | private def cochainToSectionsEquiv |
| 45 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 46 | (K : CochainComplex C ℤ) (n : ℤ) : |
| 47 | CochainComplex.HomComplex.Cochain |
| 48 | ((CochainComplex.singleFunctor C 0).obj Z) K n ≃+ |
| 49 | ↑(G.obj (K.X n)) := |
| 50 | (CochainComplex.HomComplex.Cochain.fromSingleEquiv (zero_add n)).trans (e (K.X n)) |
| 51 | |
| 52 | private def cochainToSectionsIso |
| 53 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 54 | (K : CochainComplex C ℤ) (n : ℤ) : |
| 55 | (((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).X n ≅ |
| 56 | ((G.mapHomologicalComplex (.up ℤ)).obj K).X n := |
| 57 | (cochainToSectionsEquiv e K n).toAddCommGrpIso |
| 58 | |
| 59 | omit [G.Additive] in |
| 60 | private lemma cochainToSectionsEquiv_fromSingleMk |
| 61 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 62 | (K : CochainComplex C ℤ) (n : ℤ) (f : Z ⟶ K.X n) : |
| 63 | cochainToSectionsEquiv e K n |
| 64 | (CochainComplex.HomComplex.Cochain.fromSingleMk f (zero_add n)) = e (K.X n) f := by |
| 65 | exact congrArg (e (K.X n)) |
| 66 | (CochainComplex.HomComplex.Cochain.fromSingleEquiv_fromSingleMk f (zero_add n)) |
| 67 | |
| 68 | private lemma cochainToSectionsIso_hom_apply |
| 69 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 70 | (K : CochainComplex C ℤ) (n : ℤ) |
| 71 | (α : CochainComplex.HomComplex.Cochain |
| 72 | ((CochainComplex.singleFunctor C 0).obj Z) K n) : |
| 73 | (cochainToSectionsIso e K n).hom.hom α = cochainToSectionsEquiv e K n α := |
| 74 | rfl |
| 75 | |
| 76 | private lemma homComplex_d_apply |
| 77 | (K : CochainComplex C ℤ) (i j : ℤ) |
| 78 | (α : CochainComplex.HomComplex.Cochain |
| 79 | ((CochainComplex.singleFunctor C 0).obj Z) K i) : |
| 80 | ((((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).d i j).hom α = |
| 81 | CochainComplex.HomComplex.δ i j α := |
| 82 | rfl |
| 83 | |
| 84 | private def homComplexIsoSections |
| 85 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 86 | (he : ∀ {X Y : C} (f : Z ⟶ X) (g : X ⟶ Y), |
| 87 | e Y (f ≫ g) = G.map g (e X f)) |
| 88 | (K : CochainComplex C ℤ) : |
| 89 | ((CochainComplex.singleFunctor C 0).obj Z).HomComplex K ≅ |
| 90 | (G.mapHomologicalComplex (.up ℤ)).obj K := |
| 91 | HomologicalComplex.Hom.isoOfComponents (cochainToSectionsIso e K) fun i j hij ↦ by |
| 92 | ext α |
| 93 | obtain ⟨f, rfl⟩ := |
| 94 | CochainComplex.HomComplex.Cochain.fromSingleMk_surjective α i (zero_add i) |
| 95 | let α := CochainComplex.HomComplex.Cochain.fromSingleMk f (zero_add i) |
| 96 | have hleft : |
| 97 | (((cochainToSectionsIso e K i).hom ≫ |
| 98 | ((G.mapHomologicalComplex (.up ℤ)).obj K).d i j).hom α) = |
| 99 | (G.map (K.d i j)).hom (e (K.X i) f) := by |
| 100 | change (((G.mapHomologicalComplex (.up ℤ)).obj K).d i j).hom |
| 101 | ((cochainToSectionsIso e K i).hom.hom α) = _ |
| 102 | rw [Functor.mapHomologicalComplex_obj_d] |
| 103 | rw [cochainToSectionsIso_hom_apply] |
| 104 | exact congrArg (G.map (K.d i j)).hom |
| 105 | (cochainToSectionsEquiv_fromSingleMk e K i f) |
| 106 | have hright : |
| 107 | (((((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).d i j ≫ |
| 108 | (cochainToSectionsIso e K j).hom).hom α) = |
| 109 | e (K.X j) (f ≫ K.d i j) := by |
| 110 | change (cochainToSectionsIso e K j).hom.hom |
| 111 | (((((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).d i j).hom α) = _ |
| 112 | change cochainToSectionsEquiv e K j |
| 113 | (CochainComplex.HomComplex.δ i j α) = _ |
| 114 | rw [CochainComplex.HomComplex.Cochain.δ_fromSingleMk f (zero_add i) j j |
| 115 | (zero_add j)] |
| 116 | exact cochainToSectionsEquiv_fromSingleMk e K j (f ≫ K.d i j) |
| 117 | exact hleft.trans ((he f (K.d i j)).symm.trans hright.symm) |
| 118 | |
| 119 | private lemma homComplexIsoSections_hom_f_apply |
| 120 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 121 | (he : ∀ {X Y : C} (a : Z ⟶ X) (b : X ⟶ Y), |
| 122 | e Y (a ≫ b) = G.map b (e X a)) |
| 123 | (K : CochainComplex C ℤ) (n : ℤ) |
| 124 | (z : CochainComplex.HomComplex.Cochain |
| 125 | ((CochainComplex.singleFunctor C 0).obj Z) K n) : |
| 126 | ((homComplexIsoSections e he K).hom.f n).hom z = |
| 127 | cochainToSectionsEquiv e K n z := |
| 128 | rfl |
| 129 | |
| 130 | private def homComplexPostcomp {K L : CochainComplex C ℤ} (f : K ⟶ L) : |
| 131 | ((CochainComplex.singleFunctor C 0).obj Z).HomComplex K ⟶ |
| 132 | ((CochainComplex.singleFunctor C 0).obj Z).HomComplex L where |
| 133 | f n := AddCommGrpCat.ofHom |
| 134 | { toFun := fun z ↦ z.comp (.ofHom f) (add_zero n) |
| 135 | map_zero' := by ext; simp |
| 136 | map_add' := by intros; ext; simp } |
| 137 | comm' i j _ := by |
| 138 | ext z |
| 139 | exact CochainComplex.HomComplex.δ_comp_ofHom z f j |
| 140 | |
| 141 | private lemma homComplexPostcomp_f_apply {K L : CochainComplex C ℤ} (f : K ⟶ L) |
| 142 | (n : ℤ) |
| 143 | (z : CochainComplex.HomComplex.Cochain |
| 144 | ((CochainComplex.singleFunctor C 0).obj Z) K n) : |
| 145 | ((homComplexPostcomp f).f n).hom z = |
| 146 | z.comp (.ofHom f) (add_zero n) := |
| 147 | rfl |
| 148 | |
| 149 | private lemma homComplexIsoSections_naturality |
| 150 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 151 | (he : ∀ {X Y : C} (a : Z ⟶ X) (b : X ⟶ Y), |
| 152 | e Y (a ≫ b) = G.map b (e X a)) |
| 153 | {K L : CochainComplex C ℤ} (f : K ⟶ L) : |
| 154 | homComplexPostcomp f ≫ (homComplexIsoSections e he L).hom = |
| 155 | (homComplexIsoSections e he K).hom ≫ |
| 156 | (G.mapHomologicalComplex (.up ℤ)).map f := by |
| 157 | ext n z |
| 158 | obtain ⟨a, rfl⟩ := |
| 159 | CochainComplex.HomComplex.Cochain.fromSingleMk_surjective z n (zero_add n) |
| 160 | let α := CochainComplex.HomComplex.Cochain.fromSingleMk a (zero_add n) |
| 161 | have hleft : |
| 162 | ((((homComplexPostcomp f ≫ |
| 163 | (homComplexIsoSections e he L).hom).f n).hom α) = |
| 164 | e (L.X n) (a ≫ f.f n)) := by |
| 165 | rw [HomologicalComplex.comp_f] |
| 166 | change ((homComplexIsoSections e he L).hom.f n).hom |
| 167 | (((homComplexPostcomp f).f n).hom α) = _ |
| 168 | change cochainToSectionsEquiv e L n |
| 169 | (α.comp (.ofHom f) (add_zero n)) = _ |
| 170 | rw [← CochainComplex.HomComplex.Cochain.fromSingleMk_postcomp] |
| 171 | exact cochainToSectionsEquiv_fromSingleMk e L n (a ≫ f.f n) |
| 172 | have hright : |
| 173 | (((((homComplexIsoSections e he K).hom ≫ |
| 174 | (G.mapHomologicalComplex (.up ℤ)).map f).f n).hom α) = |
| 175 | (G.map (f.f n)).hom (e (K.X n) a)) := by |
| 176 | rw [HomologicalComplex.comp_f] |
| 177 | change (((G.mapHomologicalComplex (.up ℤ)).map f).f n).hom |
| 178 | (((homComplexIsoSections e he K).hom.f n).hom α) = _ |
| 179 | rw [Functor.mapHomologicalComplex_map_f] |
| 180 | change (G.map (f.f n)).hom (cochainToSectionsEquiv e K n α) = _ |
| 181 | exact congrArg (G.map (f.f n)).hom |
| 182 | (cochainToSectionsEquiv_fromSingleMk e K n a) |
| 183 | exact hleft.trans ((he a (f.f n)).trans hright.symm) |
| 184 | |
| 185 | private def cocyclePostcomp {K L : CochainComplex C ℤ} (f : K ⟶ L) (n : ℤ) : |
| 186 | CochainComplex.HomComplex.Cocycle ((CochainComplex.singleFunctor C 0).obj Z) K n →+ |
| 187 | CochainComplex.HomComplex.Cocycle ((CochainComplex.singleFunctor C 0).obj Z) L n where |
| 188 | toFun z := z.postcomp f |
| 189 | map_zero' := by ext; simp [CochainComplex.HomComplex.Cocycle.postcomp] |
| 190 | map_add' x y := by ext; simp [CochainComplex.HomComplex.Cocycle.postcomp] |
| 191 | |
| 192 | private def cohomologyClassPostcomp {K L : CochainComplex C ℤ} (f : K ⟶ L) (n : ℤ) : |
| 193 | CochainComplex.HomComplex.CohomologyClass |
| 194 | ((CochainComplex.singleFunctor C 0).obj Z) K n →+ |
| 195 | CochainComplex.HomComplex.CohomologyClass |
| 196 | ((CochainComplex.singleFunctor C 0).obj Z) L n := |
| 197 | CochainComplex.HomComplex.CohomologyClass.descAddMonoidHom |
| 198 | ((CochainComplex.HomComplex.CohomologyClass.mkAddMonoidHom |
| 199 | ((CochainComplex.singleFunctor C 0).obj Z) L n).comp (cocyclePostcomp f n)) (by |
| 200 | rintro z ⟨m, hm, β, hβ⟩ |
| 201 | rw [AddMonoidHom.mem_ker] |
| 202 | change CochainComplex.HomComplex.CohomologyClass.mk (z.postcomp f) = 0 |
| 203 | rw [CochainComplex.HomComplex.CohomologyClass.mk_eq_zero_iff] |
| 204 | refine ⟨m, hm, β.comp (.ofHom f) (add_zero m), ?_⟩ |
| 205 | rw [CochainComplex.HomComplex.Cocycle.postcomp_coe, ← hβ] |
| 206 | exact CochainComplex.HomComplex.δ_comp_ofHom β f n) |
| 207 | |
| 208 | private lemma cohomologyClassPostcomp_mk {K L : CochainComplex C ℤ} (f : K ⟶ L) |
| 209 | (n : ℤ) |
| 210 | (z : CochainComplex.HomComplex.Cocycle |
| 211 | ((CochainComplex.singleFunctor C 0).obj Z) K n) : |
| 212 | cohomologyClassPostcomp f n (CochainComplex.HomComplex.CohomologyClass.mk z) = |
| 213 | CochainComplex.HomComplex.CohomologyClass.mk (z.postcomp f) := |
| 214 | rfl |
| 215 | |
| 216 | private def homComplexPostcompLeftHomologyMapData {K L : CochainComplex C ℤ} |
| 217 | (f : K ⟶ L) (n : ℤ) : |
| 218 | ShortComplex.LeftHomologyMapData |
| 219 | ((HomologicalComplex.shortComplexFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 220 | (homComplexPostcomp f)) |
| 221 | (CochainComplex.HomComplex.leftHomologyData |
| 222 | ((CochainComplex.singleFunctor C 0).obj Z) K n) |
| 223 | (CochainComplex.HomComplex.leftHomologyData |
| 224 | ((CochainComplex.singleFunctor C 0).obj Z) L n) where |
| 225 | φK := AddCommGrpCat.ofHom (cocyclePostcomp f n) |
| 226 | φH := AddCommGrpCat.ofHom (cohomologyClassPostcomp f n) |
| 227 | commi := by ext; rfl |
| 228 | commf' := by |
| 229 | let hK := CochainComplex.HomComplex.leftHomologyData |
| 230 | ((CochainComplex.singleFunctor C 0).obj Z) K n |
| 231 | let hL := CochainComplex.HomComplex.leftHomologyData |
| 232 | ((CochainComplex.singleFunctor C 0).obj Z) L n |
| 233 | let φ := (HomologicalComplex.shortComplexFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 234 | (homComplexPostcomp (Z := Z) f) |
| 235 | let φK : hK.K ⟶ hL.K := AddCommGrpCat.ofHom (cocyclePostcomp f n) |
| 236 | change hK.f' ≫ φK = φ.τ₁ ≫ hL.f' |
| 237 | have hcommi : φK ≫ hL.i = hK.i ≫ φ.τ₂ := by |
| 238 | ext |
| 239 | rfl |
| 240 | apply (cancel_mono hL.i).1 |
| 241 | calc |
| 242 | (hK.f' ≫ φK) ≫ hL.i = hK.f' ≫ hK.i ≫ φ.τ₂ := by |
| 243 | rw [Category.assoc, hcommi] |
| 244 | _ = ((((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).sc n).f ≫ |
| 245 | φ.τ₂ := by rw [← Category.assoc, hK.f'_i] |
| 246 | _ = φ.τ₁ ≫ ((((CochainComplex.singleFunctor C 0).obj Z).HomComplex L).sc n).f := |
| 247 | φ.comm₁₂.symm |
| 248 | _ = (φ.τ₁ ≫ hL.f') ≫ hL.i := by rw [Category.assoc, hL.f'_i] |
| 249 | commπ := by ext; rfl |
| 250 | |
| 251 | private lemma homologyAddEquiv_homComplexPostcomp {K L : CochainComplex C ℤ} |
| 252 | (f : K ⟶ L) (n : ℤ) |
| 253 | (x : ↑((((CochainComplex.singleFunctor C 0).obj Z).HomComplex K).homology n)) : |
| 254 | CochainComplex.HomComplex.homologyAddEquiv |
| 255 | ((CochainComplex.singleFunctor C 0).obj Z) L n |
| 256 | (((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 257 | (homComplexPostcomp f)).hom x) = |
| 258 | cohomologyClassPostcomp f n |
| 259 | (CochainComplex.HomComplex.homologyAddEquiv |
| 260 | ((CochainComplex.singleFunctor C 0).obj Z) K n x) := by |
| 261 | rw [HomologicalComplex.homologyFunctor_map] |
| 262 | let hK := CochainComplex.HomComplex.leftHomologyData |
| 263 | ((CochainComplex.singleFunctor C 0).obj Z) K n |
| 264 | let hL := CochainComplex.HomComplex.leftHomologyData |
| 265 | ((CochainComplex.singleFunctor C 0).obj Z) L n |
| 266 | let φ := (HomologicalComplex.shortComplexFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 267 | (homComplexPostcomp (Z := Z) f) |
| 268 | let γ := homComplexPostcompLeftHomologyMapData (Z := Z) f n |
| 269 | change (hL.homologyIso.hom).hom ((ShortComplex.homologyMap φ).hom x) = |
| 270 | (AddCommGrpCat.ofHom (cohomologyClassPostcomp f n)).hom ((hK.homologyIso.hom).hom x) |
| 271 | exact ConcreteCategory.congr_hom γ.homologyMap_comm x |
| 272 | |
| 273 | private def mapXIso (K : CochainComplex C ℕ) (n : ℕ) : |
| 274 | G.obj (K.X n) ≅ ((G.mapHomologicalComplex (.up ℕ)).obj K).X n := |
| 275 | Iso.refl _ |
| 276 | |
| 277 | private lemma mapXIso_naturality (K : CochainComplex C ℕ) (i j : ℕ) : |
| 278 | (mapXIso K i).hom ≫ ((G.mapHomologicalComplex (.up ℕ)).obj K).d i j = |
| 279 | G.map (K.d i j) ≫ (mapXIso K j).hom := |
| 280 | rfl |
| 281 | |
| 282 | private def mapExtendXIso |
| 283 | (K : CochainComplex C ℕ) (n : ℤ) : |
| 284 | G.obj ((K.extend ComplexShape.embeddingUpNat).X n) ≅ |
| 285 | (((G.mapHomologicalComplex (.up ℕ)).obj K).extend |
| 286 | ComplexShape.embeddingUpNat).X n := by |
| 287 | classical |
| 288 | exact if h : 0 ≤ n then |
| 289 | G.mapIso (HomologicalComplex.extendXIso K ComplexShape.embeddingUpNat |
| 290 | (Int.toNat_of_nonneg h)) ≪≫ |
| 291 | mapXIso K n.toNat ≪≫ |
| 292 | (HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 293 | ComplexShape.embeddingUpNat (Int.toNat_of_nonneg h)).symm |
| 294 | else |
| 295 | IsZero.iso |
| 296 | (G.map_isZero (K.isZero_extend_X ComplexShape.embeddingUpNat n |
| 297 | (fun k hk ↦ h (hk ▸ Int.natCast_nonneg k)))) |
| 298 | (((G.mapHomologicalComplex (.up ℕ)).obj K).isZero_extend_X |
| 299 | ComplexShape.embeddingUpNat n (fun k hk ↦ h (hk ▸ Int.natCast_nonneg k))) |
| 300 | |
| 301 | private lemma mapExtendXIso_natCast (K : CochainComplex C ℕ) (k : ℕ) : |
| 302 | mapExtendXIso (G := G) K (k : ℤ) = |
| 303 | G.mapIso (HomologicalComplex.extendXIso K ComplexShape.embeddingUpNat |
| 304 | (ComplexShape.embeddingUpNat_f k)) ≪≫ |
| 305 | mapXIso (G := G) K k ≪≫ |
| 306 | (HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 307 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f k)).symm := by |
| 308 | classical |
| 309 | simp [mapExtendXIso] |
| 310 | |
| 311 | private def mapExtendIso (K : CochainComplex C ℕ) : |
| 312 | (G.mapHomologicalComplex (.up ℤ)).obj (K.extend ComplexShape.embeddingUpNat) ≅ |
| 313 | ((G.mapHomologicalComplex (.up ℕ)).obj K).extend ComplexShape.embeddingUpNat := |
| 314 | HomologicalComplex.Hom.isoOfComponents (mapExtendXIso K) fun i j hij ↦ by |
| 315 | clear hij |
| 316 | by_cases hi : ∃ k, ComplexShape.embeddingUpNat.f k = i |
| 317 | · obtain ⟨a, ha⟩ := hi |
| 318 | have ha' : (a : ℤ) = i := (ComplexShape.embeddingUpNat_f a).symm.trans ha |
| 319 | clear ha |
| 320 | subst i |
| 321 | by_cases hj : ∃ k, ComplexShape.embeddingUpNat.f k = j |
| 322 | · obtain ⟨b, hb⟩ := hj |
| 323 | have hb' : (b : ℤ) = j := (ComplexShape.embeddingUpNat_f b).symm.trans hb |
| 324 | clear hb |
| 325 | subst j |
| 326 | rw [mapExtendXIso_natCast (G := G) K a, mapExtendXIso_natCast (G := G) K b] |
| 327 | rw [Functor.mapHomologicalComplex_obj_d, |
| 328 | HomologicalComplex.extend_d_eq ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 329 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f a) |
| 330 | (ComplexShape.embeddingUpNat_f b), |
| 331 | HomologicalComplex.extend_d_eq K ComplexShape.embeddingUpNat |
| 332 | (ComplexShape.embeddingUpNat_f a) (ComplexShape.embeddingUpNat_f b)] |
| 333 | let eᵢ := HomologicalComplex.extendXIso K ComplexShape.embeddingUpNat |
| 334 | (ComplexShape.embeddingUpNat_f a) |
| 335 | let eⱼ := HomologicalComplex.extendXIso K ComplexShape.embeddingUpNat |
| 336 | (ComplexShape.embeddingUpNat_f b) |
| 337 | let fᵢ := HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 338 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f a) |
| 339 | let fⱼ := HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 340 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f b) |
| 341 | let mᵢ := mapXIso (G := G) K a |
| 342 | let mⱼ := mapXIso (G := G) K b |
| 343 | change (G.map eᵢ.hom ≫ mᵢ.hom ≫ fᵢ.inv) ≫ |
| 344 | (fᵢ.hom ≫ ((G.mapHomologicalComplex (.up ℕ)).obj K).d |
| 345 | a b ≫ fⱼ.inv) = |
| 346 | G.map (eᵢ.hom ≫ K.d a b ≫ eⱼ.inv) ≫ |
| 347 | (G.map eⱼ.hom ≫ mⱼ.hom ≫ fⱼ.inv) |
| 348 | calc |
| 349 | _ = G.map eᵢ.hom ≫ |
| 350 | (mᵢ.hom ≫ ((G.mapHomologicalComplex (.up ℕ)).obj K).d |
| 351 | a b) ≫ fⱼ.inv := by |
| 352 | simp only [Category.assoc, Iso.inv_hom_id_assoc] |
| 353 | _ = G.map eᵢ.hom ≫ |
| 354 | (G.map (K.d a b) ≫ mⱼ.hom) ≫ fⱼ.inv := by |
| 355 | rw [show mᵢ.hom ≫ ((G.mapHomologicalComplex (.up ℕ)).obj K).d |
| 356 | a b = G.map (K.d a b) ≫ mⱼ.hom by |
| 357 | exact mapXIso_naturality K a b] |
| 358 | _ = _ := by simp [Functor.map_comp, Category.assoc] |
| 359 | · exact (((G.mapHomologicalComplex (.up ℕ)).obj K).isZero_extend_X |
| 360 | ComplexShape.embeddingUpNat j (fun k hk ↦ hj ⟨k, hk⟩) |>.eq_of_tgt _ _) |
| 361 | · exact (G.map_isZero (K.isZero_extend_X ComplexShape.embeddingUpNat i |
| 362 | (fun k hk ↦ hi ⟨k, hk⟩)) |>.eq_of_src _ _) |
| 363 | |
| 364 | private lemma mapExtendIso_hom_f (K : CochainComplex C ℕ) (n : ℤ) : |
| 365 | (mapExtendIso (G := G) K).hom.f n = (mapExtendXIso (G := G) K n).hom := |
| 366 | rfl |
| 367 | |
| 368 | private lemma mapExtendIso_naturality {K L : CochainComplex C ℕ} (f : K ⟶ L) : |
| 369 | (G.mapHomologicalComplex (.up ℤ)).map |
| 370 | (HomologicalComplex.extendMap f ComplexShape.embeddingUpNat) ≫ |
| 371 | (mapExtendIso L).hom = |
| 372 | (mapExtendIso K).hom ≫ |
| 373 | HomologicalComplex.extendMap |
| 374 | ((G.mapHomologicalComplex (.up ℕ)).map f) ComplexShape.embeddingUpNat := by |
| 375 | classical |
| 376 | apply HomologicalComplex.Hom.ext |
| 377 | funext n |
| 378 | rw [HomologicalComplex.comp_f, HomologicalComplex.comp_f, |
| 379 | mapExtendIso_hom_f (G := G), mapExtendIso_hom_f (G := G), |
| 380 | Functor.mapHomologicalComplex_map_f] |
| 381 | by_cases h : ∃ k, ComplexShape.embeddingUpNat.f k = n |
| 382 | · obtain ⟨k, hk⟩ := h |
| 383 | have hk' : (k : ℤ) = n := (ComplexShape.embeddingUpNat_f k).symm.trans hk |
| 384 | clear hk |
| 385 | subst n |
| 386 | rw [HomologicalComplex.extendMap_f f ComplexShape.embeddingUpNat |
| 387 | (ComplexShape.embeddingUpNat_f k), |
| 388 | HomologicalComplex.extendMap_f |
| 389 | ((G.mapHomologicalComplex (.up ℕ)).map f) |
| 390 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f k)] |
| 391 | rw [mapExtendXIso_natCast (G := G) K k, mapExtendXIso_natCast (G := G) L k] |
| 392 | rw [Functor.mapHomologicalComplex_map_f] |
| 393 | simp only [G.map_comp, Iso.trans_hom, mapXIso] |
| 394 | let eK := HomologicalComplex.extendXIso K ComplexShape.embeddingUpNat |
| 395 | (ComplexShape.embeddingUpNat_f k) |
| 396 | let eL := HomologicalComplex.extendXIso L ComplexShape.embeddingUpNat |
| 397 | (ComplexShape.embeddingUpNat_f k) |
| 398 | let gK := HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj K) |
| 399 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f k) |
| 400 | let gL := HomologicalComplex.extendXIso ((G.mapHomologicalComplex (.up ℕ)).obj L) |
| 401 | ComplexShape.embeddingUpNat (ComplexShape.embeddingUpNat_f k) |
| 402 | change (G.map eK.hom ≫ G.map (f.f k) ≫ G.map eL.inv) ≫ |
| 403 | (G.map eL.hom ≫ 𝟙 _ ≫ gL.inv) = |
| 404 | (G.map eK.hom ≫ 𝟙 _ ≫ gK.inv) ≫ |
| 405 | (gK.hom ≫ G.map (f.f k) ≫ gL.inv) |
| 406 | have heL : G.map eL.inv ≫ G.map eL.hom = 𝟙 _ := |
| 407 | (G.mapIso eL).inv_hom_id |
| 408 | have heLgL : G.map eL.inv ≫ G.map eL.hom ≫ gL.inv = gL.inv := |
| 409 | (G.mapIso eL).inv_hom_id_assoc gL.inv |
| 410 | have hgK : gK.inv ≫ gK.hom ≫ G.map (f.f k) ≫ gL.inv = |
| 411 | G.map (f.f k) ≫ gL.inv := by |
| 412 | exact gK.inv_hom_id_assoc (G.map (f.f k) ≫ gL.inv) |
| 413 | calc |
| 414 | _ = G.map eK.hom ≫ G.map (f.f k) ≫ gL.inv := by |
| 415 | have hunit : (𝟙 (G.obj (L.X k))) ≫ gL.inv = gL.inv := |
| 416 | Category.id_comp gL.inv |
| 417 | have htail₀ : G.map eL.hom ≫ 𝟙 _ ≫ gL.inv = |
| 418 | G.map eL.hom ≫ gL.inv := |
| 419 | congrArg (fun q ↦ G.map eL.hom ≫ q) hunit |
| 420 | have htail : G.map eL.inv ≫ |
| 421 | (G.map eL.hom ≫ 𝟙 _ ≫ gL.inv) = gL.inv := |
| 422 | (congrArg (fun q ↦ G.map eL.inv ≫ q) htail₀).trans heLgL |
| 423 | have houter := Category.assoc |
| 424 | (G.map eK.hom) (G.map (f.f k) ≫ G.map eL.inv) |
| 425 | (G.map eL.hom ≫ 𝟙 _ ≫ gL.inv) |
| 426 | have hinner := Category.assoc (G.map (f.f k)) (G.map eL.inv) |
| 427 | (G.map eL.hom ≫ 𝟙 _ ≫ gL.inv) |
| 428 | have hinnerWhisker := congrArg (fun q ↦ G.map eK.hom ≫ q) hinner |
| 429 | have hcancelWhisker := congrArg |
| 430 | (fun q ↦ G.map eK.hom ≫ G.map (f.f k) ≫ q) htail |
| 431 | exact houter.trans (hinnerWhisker.trans hcancelWhisker) |
| 432 | _ = _ := by |
| 433 | simp only [Category.assoc] |
| 434 | apply (cancel_epi (G.mapIso eK).hom).2 |
| 435 | exact hgK.symm |
| 436 | · exact (((G.mapHomologicalComplex (.up ℕ)).obj L).isZero_extend_X |
| 437 | ComplexShape.embeddingUpNat n (fun k hk ↦ h ⟨k, hk⟩) |>.eq_of_tgt _ _) |
| 438 | |
| 439 | private def extAddEquivHomComplexHomology |
| 440 | [HasExt.{v} C] (R : InjectiveResolution F) (n : ℕ) : |
| 441 | Ext.{v} Z F n ≃+ |
| 442 | ↑((((CochainComplex.singleFunctor C 0).obj Z).HomComplex R.cochainComplex).homology n) := |
| 443 | (R.extAddEquivCohomologyClass (X := Z)).trans |
| 444 | (CochainComplex.HomComplex.homologyAddEquiv |
| 445 | ((CochainComplex.singleFunctor C 0).obj Z) R.cochainComplex n).symm |
| 446 | |
| 447 | private lemma extAddEquivHomComplexHomology_naturality |
| 448 | [HasExt.{v} C] {F' : C} (R : InjectiveResolution F) (R' : InjectiveResolution F') |
| 449 | (g : F ⟶ F') (φ : InjectiveResolution.Hom R R' g) (n : ℕ) (x : Ext.{v} Z F n) : |
| 450 | extAddEquivHomComplexHomology R' n (x.comp (Ext.mk₀ g) (add_zero n)) = |
| 451 | ((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 452 | (homComplexPostcomp φ.hom')).hom (extAddEquivHomComplexHomology R n x) := by |
| 453 | obtain ⟨a, ha, rfl⟩ := R.extMk_surjective x (n + 1) rfl |
| 454 | rw [R.extMk_comp_mk₀ a (n + 1) rfl ha φ] |
| 455 | apply (CochainComplex.HomComplex.homologyAddEquiv |
| 456 | ((CochainComplex.singleFunctor C 0).obj Z) R'.cochainComplex n).injective |
| 457 | rw [homologyAddEquiv_homComplexPostcomp] |
| 458 | simp only [extAddEquivHomComplexHomology, AddEquiv.trans_apply, |
| 459 | AddEquiv.apply_symm_apply, InjectiveResolution.extAddEquivCohomologyClass_apply, |
| 460 | InjectiveResolution.extEquivCohomologyClass_extMk, cohomologyClassPostcomp_mk] |
| 461 | congr 1 |
| 462 | have hcomp : (a ≫ φ.hom.f n) ≫ (R'.cochainComplexXIso n n (by lia)).inv = |
| 463 | (a ≫ (R.cochainComplexXIso n n (by lia)).inv) ≫ φ.hom'.f n := by |
| 464 | simp [φ.hom'_f n n rfl] |
| 465 | rw [← CochainComplex.HomComplex.Cocycle.fromSingleMk_postcomp |
| 466 | (a ≫ (R.cochainComplexXIso n n rfl).inv) (zero_add (n : ℤ)) |
| 467 | ((n + 1 : ℕ) : ℤ) (by lia) (by |
| 468 | rw [R.cochainComplex_d (n : ℤ) ((n + 1 : ℕ) : ℤ) n (n + 1) rfl rfl] |
| 469 | simp only [Category.assoc, Iso.inv_hom_id_assoc] |
| 470 | rw [← Category.assoc, ha] |
| 471 | simp) φ.hom'] |
| 472 | ext : 1 |
| 473 | simp only [CochainComplex.HomComplex.Cocycle.fromSingleMk_coe] |
| 474 | exact congrArg |
| 475 | (fun t ↦ CochainComplex.HomComplex.Cochain.fromSingleMk t (zero_add (n : ℤ))) hcomp |
| 476 | |
| 477 | private def homComplexHomologyAddEquivSections |
| 478 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 479 | (he : ∀ {X Y : C} (f : Z ⟶ X) (g : X ⟶ Y), |
| 480 | e Y (f ≫ g) = G.map g (e X f)) |
| 481 | (R : InjectiveResolution F) (n : ℕ) : |
| 482 | ↑((((CochainComplex.singleFunctor C 0).obj Z).HomComplex R.cochainComplex).homology n) ≃+ |
| 483 | ↑(((G.mapHomologicalComplex (.up ℤ)).obj R.cochainComplex).homology n) := |
| 484 | ((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).mapIso |
| 485 | (homComplexIsoSections e he R.cochainComplex)).addCommGroupIsoToAddEquiv |
| 486 | |
| 487 | private lemma homComplexHomologyAddEquivSections_naturality |
| 488 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 489 | (he : ∀ {X Y : C} (a : Z ⟶ X) (b : X ⟶ Y), |
| 490 | e Y (a ≫ b) = G.map b (e X a)) |
| 491 | {F' : C} (R : InjectiveResolution F) (R' : InjectiveResolution F') |
| 492 | (g : F ⟶ F') (φ : InjectiveResolution.Hom R R' g) (n : ℕ) |
| 493 | (x : ↑((((CochainComplex.singleFunctor C 0).obj Z).HomComplex |
| 494 | R.cochainComplex).homology n)) : |
| 495 | homComplexHomologyAddEquivSections e he R' n |
| 496 | (((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 497 | (homComplexPostcomp φ.hom')).hom x) = |
| 498 | ((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 499 | ((G.mapHomologicalComplex (.up ℤ)).map φ.hom')).hom |
| 500 | (homComplexHomologyAddEquivSections e he R n x) := by |
| 501 | let H := HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n |
| 502 | have h := congrArg H.map (homComplexIsoSections_naturality e he φ.hom') |
| 503 | rw [Functor.map_comp, Functor.map_comp] at h |
| 504 | have hx := ConcreteCategory.congr_hom h x |
| 505 | change (H.map (homComplexIsoSections e he R'.cochainComplex).hom).hom |
| 506 | ((H.map (homComplexPostcomp φ.hom')).hom x) = |
| 507 | (H.map ((G.mapHomologicalComplex (.up ℤ)).map φ.hom')).hom |
| 508 | ((H.map (homComplexIsoSections e he R.cochainComplex).hom).hom x) |
| 509 | exact hx |
| 510 | |
| 511 | private def sectionsCochainHomologyAddEquivCocomplex |
| 512 | (R : InjectiveResolution F) (n : ℕ) : |
| 513 | ↑(((G.mapHomologicalComplex (.up ℤ)).obj R.cochainComplex).homology n) ≃+ |
| 514 | ↑(((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).homology n) := |
| 515 | ((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).mapIso |
| 516 | (mapExtendIso R.cocomplex)).addCommGroupIsoToAddEquiv.trans |
| 517 | (((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).extendHomologyIso |
| 518 | ComplexShape.embeddingUpNat |
| 519 | (show ComplexShape.embeddingUpNat.f n = (n : ℤ) from rfl)).addCommGroupIsoToAddEquiv |
| 520 | |
| 521 | private lemma sectionsCochainHomologyAddEquivCocomplex_naturality |
| 522 | {F' : C} (R : InjectiveResolution F) (R' : InjectiveResolution F') |
| 523 | (g : F ⟶ F') (φ : InjectiveResolution.Hom R R' g) (n : ℕ) |
| 524 | (x : ↑(((G.mapHomologicalComplex (.up ℤ)).obj R.cochainComplex).homology n)) : |
| 525 | sectionsCochainHomologyAddEquivCocomplex R' n |
| 526 | (((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n).map |
| 527 | ((G.mapHomologicalComplex (.up ℤ)).map φ.hom')).hom x) = |
| 528 | ((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℕ) n).map |
| 529 | ((G.mapHomologicalComplex (.up ℕ)).map φ.hom)).hom |
| 530 | (sectionsCochainHomologyAddEquivCocomplex R n x) := by |
| 531 | let HZ := HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℤ) n |
| 532 | let HN := HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℕ) n |
| 533 | let fN := (G.mapHomologicalComplex (.up ℕ)).map φ.hom |
| 534 | let fE := HomologicalComplex.extendMap fN ComplexShape.embeddingUpNat |
| 535 | have hmap : |
| 536 | (G.mapHomologicalComplex (.up ℤ)).map φ.hom' ≫ (mapExtendIso R'.cocomplex).hom = |
| 537 | (mapExtendIso R.cocomplex).hom ≫ fE := by |
| 538 | simpa [InjectiveResolution.cochainComplex, InjectiveResolution.Hom.hom', fN, fE] using |
| 539 | mapExtendIso_naturality (G := G) φ.hom |
| 540 | have hmapH : |
| 541 | HZ.map ((G.mapHomologicalComplex (.up ℤ)).map φ.hom') ≫ |
| 542 | HZ.map (mapExtendIso R'.cocomplex).hom = |
| 543 | HZ.map (mapExtendIso R.cocomplex).hom ≫ HZ.map fE := by |
| 544 | exact (HZ.map_comp _ _).symm.trans |
| 545 | ((congrArg HZ.map hmap).trans (HZ.map_comp _ _)) |
| 546 | have hext : HZ.map fE ≫ |
| 547 | (((G.mapHomologicalComplex (.up ℕ)).obj R'.cocomplex).extendHomologyIso |
| 548 | ComplexShape.embeddingUpNat rfl).hom = |
| 549 | (((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).extendHomologyIso |
| 550 | ComplexShape.embeddingUpNat rfl).hom ≫ HN.map fN := by |
| 551 | change HomologicalComplex.homologyMap fE (n : ℤ) ≫ |
| 552 | (((G.mapHomologicalComplex (.up ℕ)).obj R'.cocomplex).extendHomologyIso |
| 553 | ComplexShape.embeddingUpNat rfl).hom = |
| 554 | (((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).extendHomologyIso |
| 555 | ComplexShape.embeddingUpNat rfl).hom ≫ HomologicalComplex.homologyMap fN n |
| 556 | exact HomologicalComplex.extendHomologyIso_hom_naturality fN |
| 557 | ComplexShape.embeddingUpNat (show ComplexShape.embeddingUpNat.f n = (n : ℤ) from rfl) |
| 558 | have htotal : |
| 559 | (HZ.map ((G.mapHomologicalComplex (.up ℤ)).map φ.hom') ≫ |
| 560 | HZ.map (mapExtendIso R'.cocomplex).hom) ≫ |
| 561 | (((G.mapHomologicalComplex (.up ℕ)).obj R'.cocomplex).extendHomologyIso |
| 562 | ComplexShape.embeddingUpNat rfl).hom = |
| 563 | (HZ.map (mapExtendIso R.cocomplex).hom ≫ |
| 564 | (((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).extendHomologyIso |
| 565 | ComplexShape.embeddingUpNat rfl).hom) ≫ HN.map fN := by |
| 566 | let A := HZ.map ((G.mapHomologicalComplex (.up ℤ)).map φ.hom') |
| 567 | let B := HZ.map (mapExtendIso (G := G) R'.cocomplex).hom |
| 568 | let C₀ := HZ.map (mapExtendIso (G := G) R.cocomplex).hom |
| 569 | let D := HZ.map fE |
| 570 | let E' := (((G.mapHomologicalComplex (.up ℕ)).obj |
| 571 | R'.cocomplex).extendHomologyIso ComplexShape.embeddingUpNat |
| 572 | (show ComplexShape.embeddingUpNat.f n = (n : ℤ) from rfl)).hom |
| 573 | let E := (((G.mapHomologicalComplex (.up ℕ)).obj |
| 574 | R.cocomplex).extendHomologyIso ComplexShape.embeddingUpNat |
| 575 | (show ComplexShape.embeddingUpNat.f n = (n : ℤ) from rfl)).hom |
| 576 | let F₀ := HN.map fN |
| 577 | have hmapH' : A ≫ B = C₀ ≫ D := hmapH |
| 578 | have hext' : D ≫ E' = E ≫ F₀ := hext |
| 579 | change (A ≫ B) ≫ E' = (C₀ ≫ E) ≫ F₀ |
| 580 | have h₀ := congrArg (fun q ↦ q ≫ E') hmapH' |
| 581 | have h₁ := Category.assoc C₀ D E' |
| 582 | have h₂ := congrArg (fun q ↦ C₀ ≫ q) hext' |
| 583 | have h₃ := (Category.assoc C₀ E F₀).symm |
| 584 | exact h₀.trans (h₁.trans (h₂.trans h₃)) |
| 585 | have hx := ConcreteCategory.congr_hom htotal x |
| 586 | change (((G.mapHomologicalComplex (.up ℕ)).obj R'.cocomplex).extendHomologyIso |
| 587 | ComplexShape.embeddingUpNat rfl).hom.hom |
| 588 | ((HZ.map (mapExtendIso R'.cocomplex).hom).hom |
| 589 | ((HZ.map ((G.mapHomologicalComplex (.up ℤ)).map φ.hom')).hom x)) = |
| 590 | (HN.map fN).hom |
| 591 | ((((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).extendHomologyIso |
| 592 | ComplexShape.embeddingUpNat rfl).hom.hom |
| 593 | ((HZ.map (mapExtendIso R.cocomplex).hom).hom x)) |
| 594 | exact hx |
| 595 | |
| 596 | private def sectionsCocomplexHomologyAddEquivRightDerived |
| 597 | [HasInjectiveResolutions C] (R : InjectiveResolution F) (n : ℕ) : |
| 598 | ↑(((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).homology n) ≃+ |
| 599 | ↑((G.rightDerived n).obj F) := |
| 600 | (R.isoRightDerivedObj G n).symm.addCommGroupIsoToAddEquiv |
| 601 | |
| 602 | private lemma sectionsCocomplexHomologyAddEquivRightDerived_naturality |
| 603 | [HasInjectiveResolutions C] |
| 604 | {F' : C} (R : InjectiveResolution F) (R' : InjectiveResolution F') |
| 605 | (g : F ⟶ F') (φ : InjectiveResolution.Hom R R' g) (n : ℕ) |
| 606 | (x : ↑(((G.mapHomologicalComplex (.up ℕ)).obj R.cocomplex).homology n)) : |
| 607 | sectionsCocomplexHomologyAddEquivRightDerived R' n |
| 608 | (((HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℕ) n).map |
| 609 | ((G.mapHomologicalComplex (.up ℕ)).map φ.hom)).hom x) = |
| 610 | ((G.rightDerived n).map g).hom |
| 611 | (sectionsCocomplexHomologyAddEquivRightDerived R n x) := by |
| 612 | let HN := HomologicalComplex.homologyFunctor AddCommGrpCat.{v} (.up ℕ) n |
| 613 | let fN := (G.mapHomologicalComplex (.up ℕ)).map φ.hom |
| 614 | have h := InjectiveResolution.isoRightDerivedObj_inv_naturality g R R' φ.hom |
| 615 | (by simpa using φ.ι_f_zero_comp_hom_f_zero) G n |
| 616 | have hx := ConcreteCategory.congr_hom h x |
| 617 | change (R'.isoRightDerivedObj G n).inv.hom ((HN.map fN).hom x) = |
| 618 | ((G.rightDerived n).map g).hom ((R.isoRightDerivedObj G n).inv.hom x) |
| 619 | exact hx.symm |
| 620 | |
| 621 | /-- If an additive functor is represented by `Z`, then `Extⁿ(Z, -)` agrees with its |
| 622 | right-derived functor in degree `n`. -/ |
| 623 | private noncomputable def addEquivRightDerived |
| 624 | [HasExt.{v} C] [HasInjectiveResolutions C] |
| 625 | (G : C ⥤ AddCommGrpCat.{v}) [G.Additive] (Z F : C) |
| 626 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 627 | (he : ∀ {X Y : C} (f : Z ⟶ X) (g : X ⟶ Y), |
| 628 | e Y (f ≫ g) = G.map g (e X f)) (n : ℕ) : |
| 629 | Ext.{v} Z F n ≃+ ↑((G.rightDerived n).obj F) := |
| 630 | let R := injectiveResolution F |
| 631 | (extAddEquivHomComplexHomology R n).trans |
| 632 | ((homComplexHomologyAddEquivSections e he R n).trans |
| 633 | ((sectionsCochainHomologyAddEquivCocomplex R n).trans |
| 634 | (sectionsCocomplexHomologyAddEquivRightDerived R n))) |
| 635 | |
| 636 | /-- The comparison between represented `Ext` and the right-derived functor is natural |
| 637 | in the derived variable. -/ |
| 638 | private theorem addEquivRightDerived_naturality |
| 639 | [HasExt.{v} C] [HasInjectiveResolutions C] |
| 640 | (G : C ⥤ AddCommGrpCat.{v}) [G.Additive] (Z : C) |
| 641 | (e : ∀ X : C, (Z ⟶ X) ≃+ ↑(G.obj X)) |
| 642 | (he : ∀ {X Y : C} (a : Z ⟶ X) (b : X ⟶ Y), |
| 643 | e Y (a ≫ b) = G.map b (e X a)) |
| 644 | {F F' : C} (f : F ⟶ F') (n : ℕ) (x : Ext.{v} Z F n) : |
| 645 | addEquivRightDerived G Z F' e he n (((Ext.mk₀ f).postcomp Z (add_zero n)) x) = |
| 646 | ((G.rightDerived n).map f).hom (addEquivRightDerived G Z F e he n x) := by |
| 647 | let R := injectiveResolution F |
| 648 | let R' := injectiveResolution F' |
| 649 | let φ : InjectiveResolution.Hom R R' f := |
| 650 | { hom := InjectiveResolution.desc f R' R |
| 651 | ι_f_zero_comp_hom_f_zero := by |
| 652 | simpa using InjectiveResolution.desc_commutes_zero f R' R } |
| 653 | change sectionsCocomplexHomologyAddEquivRightDerived R' n |
| 654 | (sectionsCochainHomologyAddEquivCocomplex R' n |
| 655 | (homComplexHomologyAddEquivSections e he R' n |
| 656 | (extAddEquivHomComplexHomology R' n (x.comp (Ext.mk₀ f) (add_zero n))))) = |
| 657 | ((G.rightDerived n).map f).hom |
| 658 | (sectionsCocomplexHomologyAddEquivRightDerived R n |
| 659 | (sectionsCochainHomologyAddEquivCocomplex R n |
| 660 | (homComplexHomologyAddEquivSections e he R n |
| 661 | (extAddEquivHomComplexHomology R n x)))) |
| 662 | rw [extAddEquivHomComplexHomology_naturality R R' f φ n x] |
| 663 | rw [homComplexHomologyAddEquivSections_naturality e he R R' f φ n] |
| 664 | rw [sectionsCochainHomologyAddEquivCocomplex_naturality R R' f φ n] |
| 665 | exact sectionsCocomplexHomologyAddEquivRightDerived_naturality R R' f φ n _ |
| 666 | |
| 667 | end CategoryTheory.Abelian.Ext |
| 668 | |
| 669 | open _root_.TopologicalSpace |
| 670 | |
| 671 | namespace TopCat.Sheaf |
| 672 | |
| 673 | variable {X : TopCat.{u}} |
| 674 | |
| 675 | private abbrev J (X : TopCat.{u}) := Opens.grothendieckTopology X |
| 676 | |
| 677 | private abbrev constantZ (X : TopCat.{u}) : |
| 678 | CategoryTheory.Sheaf (J X) AddCommGrpCat.{u} := |
| 679 | (CategoryTheory.constantSheaf (J X) AddCommGrpCat.{u}).obj |
| 680 | (AddCommGrpCat.of (ULift.{u} ℤ)) |
| 681 | |
| 682 | noncomputable local instance : (GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).Additive := |
| 683 | (CategoryTheory.constantSheafΓAdj (J X) AddCommGrpCat.{u}).right_adjoint_additive |
| 684 | |
| 685 | private def homToGlobalSectionsEquiv |
| 686 | (F : CategoryTheory.Sheaf (J X) AddCommGrpCat.{u}) : |
| 687 | (constantZ X ⟶ F) ≃+ ↑((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).obj F) := |
| 688 | ((CategoryTheory.constantSheafΓAdj (J X) AddCommGrpCat.{u}).homAddEquiv |
| 689 | (AddCommGrpCat.of (ULift.{u} ℤ)) F).trans |
| 690 | (AddCommGrpCat.uliftZMultiplesAddEquiv ((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).obj F)) |
| 691 | |
| 692 | private lemma homToGlobalSectionsEquiv_naturality |
| 693 | {F G : CategoryTheory.Sheaf (J X) AddCommGrpCat.{u}} |
| 694 | (f : constantZ X ⟶ F) (g : F ⟶ G) : |
| 695 | homToGlobalSectionsEquiv G (f ≫ g) = |
| 696 | (GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).map g (homToGlobalSectionsEquiv F f) := by |
| 697 | change AddCommGrpCat.uliftZMultiplesAddEquiv _ |
| 698 | ((CategoryTheory.constantSheafΓAdj (J X) AddCommGrpCat.{u}).homEquiv _ _ (f ≫ g)) = _ |
| 699 | rw [(CategoryTheory.constantSheafΓAdj |
| 700 | (J X) AddCommGrpCat.{u}).homEquiv_naturality_right] |
| 701 | rfl |
| 702 | |
| 703 | /-- Sheaf cohomology agrees with the right-derived functors of global sections. -/ |
| 704 | noncomputable def _root_.OAI.AlgebraicGeometry.SheafCohomology.Cech.Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections |
| 705 | (F : Sheaf AddCommGrpCat.{u} X) (n : ℕ) : |
| 706 | Compat.TopCat.Sheaf.H F n ≃+ ↑(((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).rightDerived n).obj (Compat.TopCat.Sheaf.toSiteSheaf F)) := by |
| 707 | exact DerivedGlobalSections.CategoryTheory.Abelian.Ext.addEquivRightDerived |
| 708 | (GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X) (constantZ X) (Compat.TopCat.Sheaf.toSiteSheaf F) |
| 709 | homToGlobalSectionsEquiv |
| 710 | (fun f g ↦ homToGlobalSectionsEquiv_naturality f g) n |
| 711 | |
| 712 | /-- The identification of sheaf cohomology with derived global sections commutes with |
| 713 | morphisms of sheaves. -/ |
| 714 | private theorem H.addEquivRightDerivedGlobalSections_naturality |
| 715 | {F G : Sheaf AddCommGrpCat.{u} X} (f : F ⟶ G) (n : ℕ) (x : Compat.TopCat.Sheaf.H F n) : |
| 716 | Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections G n (Compat.TopCat.Sheaf.H.map f n x) = |
| 717 | (((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).rightDerived n).map f).hom |
| 718 | (Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections F n x) := by |
| 719 | exact DerivedGlobalSections.CategoryTheory.Abelian.Ext.addEquivRightDerived_naturality |
| 720 | (GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X) (constantZ X) homToGlobalSectionsEquiv |
| 721 | (fun a b ↦ homToGlobalSectionsEquiv_naturality a b) f n x |
| 722 | |
| 723 | /-- The inverse comparison from derived global sections to sheaf cohomology |
| 724 | is natural in the coefficient sheaf. -/ |
| 725 | theorem _root_.OAI.AlgebraicGeometry.SheafCohomology.Cech.Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections_symm_naturality |
| 726 | {F G : Sheaf AddCommGrpCat.{u} X} (f : F ⟶ G) (n : ℕ) |
| 727 | (x : ((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).rightDerived n).obj (Compat.TopCat.Sheaf.toSiteSheaf F)) : |
| 728 | (Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections G n).symm |
| 729 | (((GlobalSectionsFunctor.TopCat.Sheaf.globalSectionsFunctor X).rightDerived n).map f x) = |
| 730 | Compat.TopCat.Sheaf.H.map f n ((Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections F n).symm x) := by |
| 731 | apply (Compat.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections G n).injective |
| 732 | rw [AddEquiv.apply_symm_apply] |
| 733 | rw [DerivedGlobalSections.TopCat.Sheaf.H.addEquivRightDerivedGlobalSections_naturality] |
| 734 | rw [AddEquiv.apply_symm_apply] |
| 735 | |
| 736 | end TopCat.Sheaf |
| 737 | |
| 738 | end |
| 739 | |
| 740 | end OAI.AlgebraicGeometry.SheafCohomology.Cech.DerivedGlobalSections |