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 | Copyright (c) 2026 The AINTLIB contributors. All rights reserved. |
| 3 | Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | Authors: AINTLIB ModularCurves project |
| 5 | This file has been modified. |
| 6 | -/ |
| 7 | import Mathlib.Data.Fin.Tuple.Sort |
| 8 | import Mathlib.LinearAlgebra.Finsupp.LSum |
| 9 | import OAI.AlgebraicGeometry.SheafCohomology.Projective.OrderedBaseCechAlternating |
| 10 | |
| 11 | /-! # Cech Tuple Alternating Homotopy -/ |
| 12 | |
| 13 | namespace OAI.AlgebraicGeometry.SheafCohomology.Projective.CechTupleAlternatingHomotopy |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | /-! |
| 18 | # The tuple-chain homotopy for alternating Cech cochains |
| 19 | |
| 20 | This file formalizes the support-preserving free-chain construction in Conrad, |
| 21 | *Cech Cohomology and Alternating Cochains*. It is the combinatorial core of the |
| 22 | homotopy in Stacks Project, Lemma 20.23.6 (Tag 01FM). |
| 23 | -/ |
| 24 | |
| 25 | open Set |
| 26 | |
| 27 | universe u |
| 28 | |
| 29 | /-- The free integral module on tuples of length `n + 1`. -/ |
| 30 | abbrev CechTupleChain (ι : Type u) (n : ℕ) := |
| 31 | (Fin (n + 1) → ι) →₀ ℤ |
| 32 | |
| 33 | /-- Delete one entry from a tuple. -/ |
| 34 | def cechTupleDelete {ι : Type u} {n : ℕ} |
| 35 | (i : Fin (n + 2) → ι) (k : Fin (n + 2)) : |
| 36 | Fin (n + 1) → ι := |
| 37 | i ∘ k.succAbove |
| 38 | |
| 39 | /-- Extend a function on tuple generators linearly. -/ |
| 40 | def cechTupleLinearExtension {ι : Type u} {n m : ℕ} |
| 41 | (f : (Fin (n + 1) → ι) → CechTupleChain ι m) : |
| 42 | CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι m := |
| 43 | Finsupp.lsum ℤ fun i => |
| 44 | LinearMap.toSpanSingleton ℤ (CechTupleChain ι m) (f i) |
| 45 | |
| 46 | @[simp] |
| 47 | theorem cechTupleLinearExtension_single {ι : Type u} {n m : ℕ} |
| 48 | (f : (Fin (n + 1) → ι) → CechTupleChain ι m) |
| 49 | (i : Fin (n + 1) → ι) (a : ℤ) : |
| 50 | cechTupleLinearExtension f (Finsupp.single i a) = a • f i := by |
| 51 | simp [cechTupleLinearExtension] |
| 52 | |
| 53 | /-- The alternating deletion boundary of a tuple generator. -/ |
| 54 | def cechTupleBoundaryBasis {ι : Type u} (n : ℕ) |
| 55 | (i : Fin (n + 2) → ι) : CechTupleChain ι n := |
| 56 | ∑ k : Fin (n + 2), |
| 57 | Finsupp.single (cechTupleDelete i k) ((-1 : ℤ) ^ (k : ℕ)) |
| 58 | |
| 59 | /-- The alternating deletion boundary on free tuple chains. -/ |
| 60 | def cechTupleBoundary {ι : Type u} (n : ℕ) : |
| 61 | CechTupleChain ι (n + 1) →ₗ[ℤ] CechTupleChain ι n := |
| 62 | cechTupleLinearExtension (cechTupleBoundaryBasis n) |
| 63 | |
| 64 | @[simp] |
| 65 | theorem cechTupleBoundary_single {ι : Type u} (n : ℕ) |
| 66 | (i : Fin (n + 2) → ι) (a : ℤ) : |
| 67 | cechTupleBoundary n (Finsupp.single i a) = |
| 68 | a • cechTupleBoundaryBasis n i := by |
| 69 | simp [cechTupleBoundary] |
| 70 | |
| 71 | /-- Prepend one entry to a tuple. -/ |
| 72 | def cechTuplePrepend {ι : Type u} {n : ℕ} |
| 73 | (i₀ : ι) (i : Fin (n + 1) → ι) : Fin (n + 2) → ι := |
| 74 | Fin.cases i₀ i |
| 75 | |
| 76 | /-- Prepending a fixed entry, extended to free tuple chains. -/ |
| 77 | def cechTuplePrependChain {ι : Type u} (i₀ : ι) (n : ℕ) : |
| 78 | CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι (n + 1) := |
| 79 | cechTupleLinearExtension fun i => Finsupp.single (cechTuplePrepend i₀ i) 1 |
| 80 | |
| 81 | @[simp] |
| 82 | theorem cechTuplePrependChain_single {ι : Type u} (i₀ : ι) (n : ℕ) |
| 83 | (i : Fin (n + 1) → ι) (a : ℤ) : |
| 84 | cechTuplePrependChain i₀ n (Finsupp.single i a) = |
| 85 | Finsupp.single (cechTuplePrepend i₀ i) a := by |
| 86 | simp [cechTuplePrependChain] |
| 87 | |
| 88 | @[simp] |
| 89 | theorem cechTupleDelete_prepend_zero {ι : Type u} {n : ℕ} (i₀ : ι) |
| 90 | (i : Fin (n + 1) → ι) : |
| 91 | cechTupleDelete (cechTuplePrepend i₀ i) 0 = i := by |
| 92 | funext k |
| 93 | rfl |
| 94 | |
| 95 | @[simp] |
| 96 | theorem cechTupleDelete_prepend_succ {ι : Type u} {n : ℕ} (i₀ : ι) |
| 97 | (i : Fin (n + 2) → ι) (k : Fin (n + 2)) : |
| 98 | cechTupleDelete (cechTuplePrepend i₀ i) k.succ = |
| 99 | cechTuplePrepend i₀ (cechTupleDelete i k) := by |
| 100 | funext l |
| 101 | refine Fin.cases ?_ (fun m => ?_) l |
| 102 | · rfl |
| 103 | · simp [cechTupleDelete, cechTuplePrepend, Function.comp_apply] |
| 104 | |
| 105 | theorem cechTupleDelete_delete {ι : Type u} {n : ℕ} |
| 106 | (i : Fin (n + 3) → ι) {k : Fin (n + 3)} {l : Fin (n + 2)} |
| 107 | (hkl : k ≤ l.castSucc) : |
| 108 | cechTupleDelete (cechTupleDelete i l.succ) |
| 109 | (k.castLT (lt_of_le_of_lt hkl l.is_lt)) = |
| 110 | cechTupleDelete (cechTupleDelete i k) l := by |
| 111 | funext m |
| 112 | have hδ := CategoryTheory.ConcreteCategory.congr_hom |
| 113 | (SimplexCategory.δ_comp_δ'' hkl) |
| 114 | exact congrArg i (hδ m) |
| 115 | |
| 116 | private theorem cechTuplePrepend_contraction_single {ι : Type u} (i₀ : ι) (n : ℕ) |
| 117 | (i : Fin (n + 2) → ι) : |
| 118 | cechTupleBoundary (n + 1) |
| 119 | (cechTuplePrependChain i₀ (n + 1) (Finsupp.single i 1)) + |
| 120 | cechTuplePrependChain i₀ n |
| 121 | (cechTupleBoundary n (Finsupp.single i 1)) = |
| 122 | Finsupp.single i 1 := by |
| 123 | simp only [cechTuplePrependChain_single, cechTupleBoundary_single, one_smul] |
| 124 | unfold cechTupleBoundaryBasis |
| 125 | rw [Fin.sum_univ_succ, map_sum] |
| 126 | simp only [Fin.val_zero, pow_zero, cechTupleDelete_prepend_zero, |
| 127 | cechTuplePrependChain_single, Fin.val_succ, pow_succ, |
| 128 | cechTupleDelete_prepend_succ, mul_neg, mul_one, Finsupp.single_neg] |
| 129 | rw [Finset.sum_neg_distrib] |
| 130 | abel |
| 131 | |
| 132 | private theorem cechTuplePrepend_contraction_single_smul {ι : Type u} (i₀ : ι) (n : ℕ) |
| 133 | (i : Fin (n + 2) → ι) (a : ℤ) : |
| 134 | cechTupleBoundary (n + 1) |
| 135 | (cechTuplePrependChain i₀ (n + 1) (Finsupp.single i a)) + |
| 136 | cechTuplePrependChain i₀ n |
| 137 | (cechTupleBoundary n (Finsupp.single i a)) = |
| 138 | Finsupp.single i a := by |
| 139 | have h := congrArg (fun x => a • x) (cechTuplePrepend_contraction_single i₀ n i) |
| 140 | simpa using h |
| 141 | |
| 142 | /-- Prepending a fixed entry contracts the free tuple-chain complex in positive degrees. -/ |
| 143 | theorem cechTuplePrepend_contraction {ι : Type u} (i₀ : ι) (n : ℕ) |
| 144 | (x : CechTupleChain ι (n + 1)) : |
| 145 | cechTupleBoundary (n + 1) (cechTuplePrependChain i₀ (n + 1) x) + |
| 146 | cechTuplePrependChain i₀ n (cechTupleBoundary n x) = x := by |
| 147 | induction x using Finsupp.induction_linear with |
| 148 | | zero => simp |
| 149 | | add x y hx hy => |
| 150 | simp only [map_add] |
| 151 | calc |
| 152 | _ = |
| 153 | (cechTupleBoundary (n + 1) (cechTuplePrependChain i₀ (n + 1) x) + |
| 154 | cechTuplePrependChain i₀ n (cechTupleBoundary n x)) + |
| 155 | (cechTupleBoundary (n + 1) (cechTuplePrependChain i₀ (n + 1) y) + |
| 156 | cechTuplePrependChain i₀ n (cechTupleBoundary n y)) := by |
| 157 | abel |
| 158 | _ = x + y := by rw [hx, hy] |
| 159 | | single i a => exact cechTuplePrepend_contraction_single_smul i₀ n i a |
| 160 | |
| 161 | private theorem cechTupleBoundary_boundary_single {ι : Type u} (n : ℕ) |
| 162 | (i : Fin (n + 3) → ι) : |
| 163 | cechTupleBoundary n |
| 164 | (cechTupleBoundary (n + 1) (Finsupp.single i 1)) = 0 := by |
| 165 | simp only [cechTupleBoundary_single, one_smul] |
| 166 | unfold cechTupleBoundaryBasis |
| 167 | rw [map_sum] |
| 168 | simp only [cechTupleBoundary_single] |
| 169 | unfold cechTupleBoundaryBasis |
| 170 | simp only [Finset.smul_sum] |
| 171 | rw [← Finset.sum_product'] |
| 172 | let P := Fin (n + 3) × Fin (n + 2) |
| 173 | let T : Finset P := {kl : P | (kl.1 : ℕ) ≤ (kl.2 : ℕ)} |
| 174 | rw [Finset.univ_product_univ, ← Finset.sum_add_sum_compl T, |
| 175 | ← eq_neg_iff_add_eq_zero, ← Finset.sum_neg_distrib] |
| 176 | let φ : ∀ kl : P, kl ∈ T → P := fun kl hkl => |
| 177 | (kl.2.succ, Fin.castLT kl.1 |
| 178 | (lt_of_le_of_lt (Finset.mem_filter.mp hkl).right (Fin.is_lt kl.2))) |
| 179 | apply Finset.sum_bij φ |
| 180 | · intro kl hkl |
| 181 | simp_rw [T, φ, Finset.compl_filter, Finset.mem_filter_univ, |
| 182 | Fin.val_succ, Fin.val_castLT] at hkl ⊢ |
| 183 | omega |
| 184 | · rintro ⟨k, l⟩ hkl ⟨k', l'⟩ hkl' h |
| 185 | rw [Prod.mk_inj] |
| 186 | exact ⟨by simpa [φ, Fin.castSucc_castLT] using! |
| 187 | congr_arg Fin.castSucc (congr_arg Prod.snd h), |
| 188 | by simpa [φ] using! congr_arg Prod.fst h⟩ |
| 189 | · rintro ⟨k', l'⟩ hkl' |
| 190 | simp_rw [T, Finset.compl_filter, Finset.mem_filter_univ, |
| 191 | not_le] at hkl' |
| 192 | refine ⟨(Fin.castSucc l', k'.pred (by |
| 193 | rintro rfl |
| 194 | simp only [Fin.val_zero, not_lt_zero] at hkl')), ?_, ?_⟩ |
| 195 | · simpa [T] using! Nat.le_sub_one_of_lt hkl' |
| 196 | · simp only [φ, Fin.succ_pred, Fin.castLT_castSucc] |
| 197 | · rintro ⟨k, l⟩ hkl |
| 198 | dsimp |
| 199 | rw [cechTupleDelete_delete i] |
| 200 | · simp [φ, pow_succ, Finsupp.smul_single, mul_comm] |
| 201 | · simpa [T] using! hkl |
| 202 | |
| 203 | private theorem cechTupleBoundary_boundary_single_smul {ι : Type u} (n : ℕ) |
| 204 | (i : Fin (n + 3) → ι) (a : ℤ) : |
| 205 | cechTupleBoundary n |
| 206 | (cechTupleBoundary (n + 1) (Finsupp.single i a)) = 0 := by |
| 207 | have h := congrArg (fun x => a • x) (cechTupleBoundary_boundary_single n i) |
| 208 | simpa using h |
| 209 | |
| 210 | /-- Consecutive free tuple-chain boundaries compose to zero. -/ |
| 211 | theorem cechTupleBoundary_boundary {ι : Type u} (n : ℕ) |
| 212 | (x : CechTupleChain ι (n + 2)) : |
| 213 | cechTupleBoundary n (cechTupleBoundary (n + 1) x) = 0 := by |
| 214 | induction x using Finsupp.induction_linear with |
| 215 | | zero => simp |
| 216 | | add x y hx hy => simp [hx, hy] |
| 217 | | single i a => exact cechTupleBoundary_boundary_single_smul n i a |
| 218 | |
| 219 | /-- Sort an injective tuple with the sign of the sorting permutation, and kill tuples |
| 220 | with repeated entries. -/ |
| 221 | def cechTupleAlternatingProjectionBasis {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 222 | (i : Fin (n + 1) → ι) : CechTupleChain ι n := |
| 223 | if Function.Injective i then |
| 224 | Finsupp.single (i ∘ Tuple.sort i) |
| 225 | (Equiv.Perm.sign (Tuple.sort i) : ℤ) |
| 226 | else |
| 227 | 0 |
| 228 | |
| 229 | /-- The signed sorting projection on free tuple chains. -/ |
| 230 | def cechTupleAlternatingProjection {ι : Type u} [LinearOrder ι] (n : ℕ) : |
| 231 | CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι n := |
| 232 | cechTupleLinearExtension (cechTupleAlternatingProjectionBasis n) |
| 233 | |
| 234 | @[simp] |
| 235 | theorem cechTupleAlternatingProjection_single {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 236 | (i : Fin (n + 1) → ι) (a : ℤ) : |
| 237 | cechTupleAlternatingProjection n (Finsupp.single i a) = |
| 238 | a • cechTupleAlternatingProjectionBasis n i := by |
| 239 | simp [cechTupleAlternatingProjection] |
| 240 | |
| 241 | theorem cechTupleAlternatingProjectionBasis_of_injective |
| 242 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 243 | (i : Fin (n + 1) → ι) (hi : Function.Injective i) : |
| 244 | cechTupleAlternatingProjectionBasis n i = |
| 245 | Finsupp.single (i ∘ Tuple.sort i) |
| 246 | (Equiv.Perm.sign (Tuple.sort i) : ℤ) := by |
| 247 | simp [cechTupleAlternatingProjectionBasis, hi] |
| 248 | |
| 249 | theorem cechTupleAlternatingProjectionBasis_of_not_injective |
| 250 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 251 | (i : Fin (n + 1) → ι) (hi : ¬Function.Injective i) : |
| 252 | cechTupleAlternatingProjectionBasis n i = 0 := by |
| 253 | simp [cechTupleAlternatingProjectionBasis, hi] |
| 254 | |
| 255 | theorem cechTupleAlternatingProjectionBasis_comp_perm |
| 256 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 257 | (i : Fin (n + 1) → ι) (σ : Equiv.Perm (Fin (n + 1))) : |
| 258 | cechTupleAlternatingProjectionBasis n (i ∘ σ) = |
| 259 | (Equiv.Perm.sign σ : ℤ) • |
| 260 | cechTupleAlternatingProjectionBasis n i := by |
| 261 | by_cases hi : Function.Injective i |
| 262 | · have hiσ : Function.Injective (i ∘ σ) := |
| 263 | (Function.Injective.of_comp_iff' i σ.bijective).2 hi |
| 264 | rw [cechTupleAlternatingProjectionBasis_of_injective (i ∘ σ) hiσ, |
| 265 | cechTupleAlternatingProjectionBasis_of_injective i hi, |
| 266 | Finsupp.smul_single] |
| 267 | have htuple : |
| 268 | (i ∘ σ) ∘ Tuple.sort (i ∘ σ) = i ∘ Tuple.sort i := |
| 269 | Tuple.comp_perm_comp_sort_eq_comp_sort |
| 270 | rw [htuple] |
| 271 | have hperm : |
| 272 | σ * Tuple.sort (i ∘ σ) = Tuple.sort i := by |
| 273 | ext k |
| 274 | exact congrArg Fin.val (hi (congrFun htuple k)) |
| 275 | have hsign := congrArg |
| 276 | (fun τ : Equiv.Perm (Fin (n + 1)) => |
| 277 | (Equiv.Perm.sign τ : ℤ)) hperm |
| 278 | simp only [Equiv.Perm.sign_mul, Units.val_mul] at hsign |
| 279 | have hs : (Equiv.Perm.sign σ : ℤ) * |
| 280 | (Equiv.Perm.sign σ : ℤ) = 1 := |
| 281 | Int.units_coe_mul_self (Equiv.Perm.sign σ) |
| 282 | congr 1 |
| 283 | calc |
| 284 | (Equiv.Perm.sign (Tuple.sort (i ∘ σ)) : ℤ) = |
| 285 | 1 * (Equiv.Perm.sign (Tuple.sort (i ∘ σ)) : ℤ) := by rw [one_mul] |
| 286 | _ = ((Equiv.Perm.sign σ : ℤ) * (Equiv.Perm.sign σ : ℤ)) * |
| 287 | (Equiv.Perm.sign (Tuple.sort (i ∘ σ)) : ℤ) := by rw [hs] |
| 288 | _ = (Equiv.Perm.sign σ : ℤ) * |
| 289 | ((Equiv.Perm.sign σ : ℤ) * |
| 290 | (Equiv.Perm.sign (Tuple.sort (i ∘ σ)) : ℤ)) := by |
| 291 | rw [mul_assoc] |
| 292 | _ = (Equiv.Perm.sign σ : ℤ) * |
| 293 | (Equiv.Perm.sign (Tuple.sort i) : ℤ) := by rw [hsign] |
| 294 | · have hiσ : ¬Function.Injective (i ∘ σ) := by |
| 295 | simpa only [Function.Injective.of_comp_iff' i σ.bijective] using hi |
| 296 | rw [cechTupleAlternatingProjectionBasis_of_not_injective (i ∘ σ) hiσ, |
| 297 | cechTupleAlternatingProjectionBasis_of_not_injective i hi, smul_zero] |
| 298 | |
| 299 | theorem cechTupleAlternatingProjectionBasis_of_strictMono |
| 300 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 301 | (i : Fin (n + 1) → ι) (hi : StrictMono i) : |
| 302 | cechTupleAlternatingProjectionBasis n i = Finsupp.single i 1 := by |
| 303 | rw [cechTupleAlternatingProjectionBasis_of_injective i hi.injective] |
| 304 | have hsort : Tuple.sort i = 1 := |
| 305 | Tuple.sort_eq_refl_iff_monotone.2 hi.monotone |
| 306 | simp [hsort] |
| 307 | |
| 308 | private theorem cechTupleAlternatingProjection_boundary_single_of_strictMono |
| 309 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 310 | (i : Fin (n + 2) → ι) (hi : StrictMono i) : |
| 311 | cechTupleBoundary n |
| 312 | (cechTupleAlternatingProjection (n + 1) (Finsupp.single i 1)) = |
| 313 | cechTupleAlternatingProjection n |
| 314 | (cechTupleBoundary n (Finsupp.single i 1)) := by |
| 315 | rw [cechTupleAlternatingProjection_single, |
| 316 | cechTupleAlternatingProjectionBasis_of_strictMono i hi, one_smul] |
| 317 | simp only [cechTupleBoundary_single, one_smul] |
| 318 | unfold cechTupleBoundaryBasis |
| 319 | rw [map_sum] |
| 320 | apply Finset.sum_congr rfl |
| 321 | intro k _ |
| 322 | rw [cechTupleAlternatingProjection_single, |
| 323 | cechTupleAlternatingProjectionBasis_of_strictMono] |
| 324 | · simp |
| 325 | · exact hi.comp (Fin.strictMono_succAbove k) |
| 326 | |
| 327 | private theorem cechTupleDelete_comp_cechPermDelete |
| 328 | {ι : Type u} {n : ℕ} (i : Fin (n + 2) → ι) |
| 329 | (σ : Equiv.Perm (Fin (n + 2))) (r : Fin (n + 2)) : |
| 330 | cechTupleDelete i (σ r) ∘ |
| 331 | OrderedBaseCechAlternating.Scheme.Modules.cechPermDelete σ r = |
| 332 | cechTupleDelete (i ∘ σ) r := by |
| 333 | funext x |
| 334 | exact congrArg i |
| 335 | (OrderedBaseCechAlternating.Scheme.Modules.succAbove_cechPermDelete σ r x) |
| 336 | |
| 337 | private theorem cechTupleAlternatingProjectionBasis_delete_perm |
| 338 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 339 | (i : Fin (n + 2) → ι) (σ : Equiv.Perm (Fin (n + 2))) |
| 340 | (hiσ : StrictMono (i ∘ σ)) (r : Fin (n + 2)) : |
| 341 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i (σ r)) = |
| 342 | (Equiv.Perm.sign |
| 343 | (OrderedBaseCechAlternating.Scheme.Modules.cechPermDelete σ r) : ℤ) • |
| 344 | Finsupp.single (cechTupleDelete (i ∘ σ) r) 1 := by |
| 345 | let ρ := OrderedBaseCechAlternating.Scheme.Modules.cechPermDelete σ r |
| 346 | have htuple : |
| 347 | cechTupleDelete i (σ r) ∘ ρ = |
| 348 | cechTupleDelete (i ∘ σ) r := |
| 349 | cechTupleDelete_comp_cechPermDelete i σ r |
| 350 | have hperm := |
| 351 | cechTupleAlternatingProjectionBasis_comp_perm |
| 352 | (cechTupleDelete i (σ r)) ρ |
| 353 | rw [htuple, cechTupleAlternatingProjectionBasis_of_strictMono |
| 354 | (cechTupleDelete (i ∘ σ) r) |
| 355 | (hiσ.comp (Fin.strictMono_succAbove r))] at hperm |
| 356 | have hs : |
| 357 | (Equiv.Perm.sign ρ : ℤ) * (Equiv.Perm.sign ρ : ℤ) = 1 := |
| 358 | Int.units_coe_mul_self (Equiv.Perm.sign ρ) |
| 359 | calc |
| 360 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i (σ r)) = |
| 361 | 1 • cechTupleAlternatingProjectionBasis n |
| 362 | (cechTupleDelete i (σ r)) := by rw [one_smul] |
| 363 | _ = ((Equiv.Perm.sign ρ : ℤ) * (Equiv.Perm.sign ρ : ℤ)) • |
| 364 | cechTupleAlternatingProjectionBasis n |
| 365 | (cechTupleDelete i (σ r)) := |
| 366 | congrArg (fun a : ℤ => a • |
| 367 | cechTupleAlternatingProjectionBasis n |
| 368 | (cechTupleDelete i (σ r))) hs.symm |
| 369 | _ = (Equiv.Perm.sign ρ : ℤ) • |
| 370 | ((Equiv.Perm.sign ρ : ℤ) • |
| 371 | cechTupleAlternatingProjectionBasis n |
| 372 | (cechTupleDelete i (σ r))) := by rw [smul_smul] |
| 373 | _ = (Equiv.Perm.sign ρ : ℤ) • |
| 374 | Finsupp.single (cechTupleDelete (i ∘ σ) r) 1 := |
| 375 | congrArg ((Equiv.Perm.sign ρ : ℤ) • ·) hperm.symm |
| 376 | |
| 377 | private theorem cechTupleAlternatingProjection_boundary_single_of_injective |
| 378 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 379 | (i : Fin (n + 2) → ι) (hi : Function.Injective i) : |
| 380 | cechTupleBoundary n |
| 381 | (cechTupleAlternatingProjection (n + 1) (Finsupp.single i 1)) = |
| 382 | cechTupleAlternatingProjection n |
| 383 | (cechTupleBoundary n (Finsupp.single i 1)) := by |
| 384 | let σ := Tuple.sort i |
| 385 | let j := i ∘ σ |
| 386 | have hj : StrictMono j := |
| 387 | (Tuple.monotone_sort i).strictMono_of_injective |
| 388 | (hi.comp σ.injective) |
| 389 | rw [cechTupleAlternatingProjection_single, |
| 390 | cechTupleAlternatingProjectionBasis_of_injective i hi, one_smul, |
| 391 | cechTupleBoundary_single] |
| 392 | rw [cechTupleBoundary_single, one_smul] |
| 393 | change (Equiv.Perm.sign σ : ℤ) • cechTupleBoundaryBasis n j = |
| 394 | cechTupleAlternatingProjection n (cechTupleBoundaryBasis n i) |
| 395 | unfold cechTupleBoundaryBasis |
| 396 | rw [map_sum, Finset.smul_sum] |
| 397 | simp only [cechTupleAlternatingProjection_single] |
| 398 | refine Fintype.sum_equiv σ _ _ fun r => ?_ |
| 399 | rw [cechTupleAlternatingProjectionBasis_delete_perm i σ hj r] |
| 400 | simp only [Finsupp.smul_single, smul_eq_mul, mul_one] |
| 401 | congr 1 |
| 402 | rw [OrderedBaseCechAlternating.Scheme.Modules.cechPermDelete_sign] |
| 403 | have hsquare : |
| 404 | (-1 : ℤ) ^ (σ r : ℕ) * (-1 : ℤ) ^ (σ r : ℕ) = 1 := by |
| 405 | rw [← pow_add, (Even.add_self (σ r : ℕ)).neg_one_pow] |
| 406 | calc |
| 407 | (Equiv.Perm.sign σ : ℤ) * (-1 : ℤ) ^ (r : ℕ) = |
| 408 | (-1 : ℤ) ^ (r : ℕ) * (Equiv.Perm.sign σ : ℤ) := mul_comm _ _ |
| 409 | _ = (-1 : ℤ) ^ (σ r : ℕ) * |
| 410 | (((-1 : ℤ) ^ (r : ℕ) * (Equiv.Perm.sign σ : ℤ)) * |
| 411 | (-1 : ℤ) ^ (σ r : ℕ)) := by |
| 412 | symm |
| 413 | calc |
| 414 | (-1 : ℤ) ^ (σ r : ℕ) * |
| 415 | (((-1 : ℤ) ^ (r : ℕ) * (Equiv.Perm.sign σ : ℤ)) * |
| 416 | (-1 : ℤ) ^ (σ r : ℕ)) = |
| 417 | (((-1 : ℤ) ^ (σ r : ℕ)) * |
| 418 | (-1 : ℤ) ^ (σ r : ℕ)) * |
| 419 | (((-1 : ℤ) ^ (r : ℕ)) * |
| 420 | (Equiv.Perm.sign σ : ℤ)) := by ring |
| 421 | _ = (-1 : ℤ) ^ (r : ℕ) * (Equiv.Perm.sign σ : ℤ) := by |
| 422 | rw [hsquare, one_mul] |
| 423 | |
| 424 | private theorem cechTupleAlternatingProjectionBasis_delete_pair |
| 425 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 426 | (i : Fin (n + 2) → ι) (k l : Fin (n + 2)) |
| 427 | (hkl : i k = i l) : |
| 428 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i k) = |
| 429 | (Equiv.Perm.sign |
| 430 | (OrderedBaseCechAlternating.Scheme.Modules.cechDeleteSwapPerm k l) : ℤ) • |
| 431 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i l) := by |
| 432 | let ρ := OrderedBaseCechAlternating.Scheme.Modules.cechDeleteSwapPerm k l |
| 433 | have htuple : |
| 434 | cechTupleDelete i l ∘ ρ = cechTupleDelete i k := |
| 435 | OrderedBaseCechAlternating.Scheme.Modules.comp_succAbove_cechDeleteSwapPerm_of_eq |
| 436 | i k l hkl |
| 437 | have hperm := |
| 438 | cechTupleAlternatingProjectionBasis_comp_perm |
| 439 | (cechTupleDelete i l) ρ |
| 440 | rwa [htuple] at hperm |
| 441 | |
| 442 | private theorem cechTupleAlternatingProjectionBasis_delete_pair_cancel |
| 443 | {ι : Type u} [LinearOrder ι] {n : ℕ} |
| 444 | (i : Fin (n + 2) → ι) (k l : Fin (n + 2)) |
| 445 | (hki : i k = i l) (hkl : k ≠ l) : |
| 446 | (-1 : ℤ) ^ (k : ℕ) • |
| 447 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i k) + |
| 448 | (-1 : ℤ) ^ (l : ℕ) • |
| 449 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i l) = 0 := by |
| 450 | let t := cechTupleAlternatingProjectionBasis n (cechTupleDelete i l) |
| 451 | have hpair := |
| 452 | cechTupleAlternatingProjectionBasis_delete_pair i k l hki |
| 453 | change (-1 : ℤ) ^ (k : ℕ) • _ + (-1 : ℤ) ^ (l : ℕ) • t = 0 |
| 454 | rw [hpair, smul_smul, |
| 455 | OrderedBaseCechAlternating.Scheme.Modules.cechDeleteSwapPerm_sign k l hkl] |
| 456 | have hcoef : |
| 457 | (-1 : ℤ) ^ (k : ℕ) * |
| 458 | -((-1 : ℤ) ^ (k : ℕ) * (-1 : ℤ) ^ (l : ℕ)) = |
| 459 | -((-1 : ℤ) ^ (l : ℕ)) := by |
| 460 | rw [mul_neg, ← mul_assoc, ← pow_add, |
| 461 | (Even.add_self (k : ℕ)).neg_one_pow, one_mul] |
| 462 | rw [hcoef, neg_smul, neg_add_cancel] |
| 463 | |
| 464 | private theorem cechTupleAlternatingProjection_boundary_single_of_not_injective |
| 465 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 466 | (i : Fin (n + 2) → ι) (hi : ¬Function.Injective i) : |
| 467 | cechTupleBoundary n |
| 468 | (cechTupleAlternatingProjection (n + 1) (Finsupp.single i 1)) = |
| 469 | cechTupleAlternatingProjection n |
| 470 | (cechTupleBoundary n (Finsupp.single i 1)) := by |
| 471 | rw [cechTupleAlternatingProjection_single, |
| 472 | cechTupleAlternatingProjectionBasis_of_not_injective i hi, one_smul, |
| 473 | map_zero, cechTupleBoundary_single, one_smul] |
| 474 | unfold cechTupleBoundaryBasis |
| 475 | rw [map_sum] |
| 476 | simp only [cechTupleAlternatingProjection_single] |
| 477 | symm |
| 478 | let F : Fin (n + 2) → CechTupleChain ι n := fun k => |
| 479 | (-1 : ℤ) ^ (k : ℕ) • |
| 480 | cechTupleAlternatingProjectionBasis n (cechTupleDelete i k) |
| 481 | change ∑ k, F k = 0 |
| 482 | by_cases hall : ∀ k : Fin (n + 2), |
| 483 | ¬Function.Injective (cechTupleDelete i k) |
| 484 | · apply Finset.sum_eq_zero |
| 485 | intro k _ |
| 486 | dsimp only [F] |
| 487 | rw [cechTupleAlternatingProjectionBasis_of_not_injective _ (hall k), |
| 488 | smul_zero] |
| 489 | · have hex : ∃ k : Fin (n + 2), |
| 490 | Function.Injective (cechTupleDelete i k) := by |
| 491 | by_contra h |
| 492 | apply hall |
| 493 | intro k hk |
| 494 | exact h ⟨k, hk⟩ |
| 495 | obtain ⟨k, hk⟩ := hex |
| 496 | obtain ⟨l, hlk, hil⟩ := |
| 497 | OrderedBaseCechAlternating.Scheme.Modules.exists_partner_of_delete_injective |
| 498 | i hi k hk |
| 499 | have hkl : k ≠ l := hlk.symm |
| 500 | have hother (m : Fin (n + 2)) (hmk : m ≠ k) (hml : m ≠ l) : |
| 501 | F m = 0 := by |
| 502 | have hm := |
| 503 | OrderedBaseCechAlternating.Scheme.Modules.delete_not_injective_of_ne |
| 504 | i k l m hkl hmk.symm hml.symm hil |
| 505 | have hm' : ¬Function.Injective (cechTupleDelete i m) := by |
| 506 | simpa [cechTupleDelete] using hm |
| 507 | dsimp only [F] |
| 508 | rw [cechTupleAlternatingProjectionBasis_of_not_injective _ hm', |
| 509 | smul_zero] |
| 510 | have hrem : ((Finset.univ.erase l).erase k).sum F = 0 := by |
| 511 | apply Finset.sum_eq_zero |
| 512 | intro m hm |
| 513 | have hmk : m ≠ k := (Finset.mem_erase.mp hm).1 |
| 514 | have hml : m ≠ l := |
| 515 | (Finset.mem_erase.mp (Finset.mem_erase.mp hm).2).1 |
| 516 | exact hother m hmk hml |
| 517 | have hk_mem : k ∈ Finset.univ.erase l := |
| 518 | Finset.mem_erase.mpr ⟨hkl, Finset.mem_univ k⟩ |
| 519 | calc |
| 520 | ∑ m, F m = (Finset.univ.erase l).sum F + F l := |
| 521 | (Finset.sum_erase_add Finset.univ F (Finset.mem_univ l)).symm |
| 522 | _ = (((Finset.univ.erase l).erase k).sum F + F k) + F l := by |
| 523 | rw [Finset.sum_erase_add (Finset.univ.erase l) F hk_mem] |
| 524 | _ = F k + F l := by rw [hrem, zero_add] |
| 525 | _ = 0 := by |
| 526 | dsimp only [F] |
| 527 | exact cechTupleAlternatingProjectionBasis_delete_pair_cancel |
| 528 | i k l hil.symm hkl |
| 529 | |
| 530 | private theorem cechTupleAlternatingProjection_boundary_single |
| 531 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 532 | (i : Fin (n + 2) → ι) : |
| 533 | cechTupleBoundary n |
| 534 | (cechTupleAlternatingProjection (n + 1) (Finsupp.single i 1)) = |
| 535 | cechTupleAlternatingProjection n |
| 536 | (cechTupleBoundary n (Finsupp.single i 1)) := by |
| 537 | by_cases hi : Function.Injective i |
| 538 | · exact cechTupleAlternatingProjection_boundary_single_of_injective n i hi |
| 539 | · exact cechTupleAlternatingProjection_boundary_single_of_not_injective n i hi |
| 540 | |
| 541 | private theorem cechTupleAlternatingProjection_boundary_single_smul |
| 542 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 543 | (i : Fin (n + 2) → ι) (a : ℤ) : |
| 544 | cechTupleBoundary n |
| 545 | (cechTupleAlternatingProjection (n + 1) (Finsupp.single i a)) = |
| 546 | cechTupleAlternatingProjection n |
| 547 | (cechTupleBoundary n (Finsupp.single i a)) := by |
| 548 | have h := congrArg (fun x => a • x) |
| 549 | (cechTupleAlternatingProjection_boundary_single n i) |
| 550 | simpa using h |
| 551 | |
| 552 | /-- Signed sorting is a chain map on free tuple chains. -/ |
| 553 | theorem cechTupleAlternatingProjection_boundary |
| 554 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 555 | (x : CechTupleChain ι (n + 1)) : |
| 556 | cechTupleBoundary n (cechTupleAlternatingProjection (n + 1) x) = |
| 557 | cechTupleAlternatingProjection n (cechTupleBoundary n x) := by |
| 558 | induction x using Finsupp.induction_linear with |
| 559 | | zero => simp |
| 560 | | add x y hx hy => simp [hx, hy] |
| 561 | | single i a => |
| 562 | exact cechTupleAlternatingProjection_boundary_single_smul n i a |
| 563 | |
| 564 | /-- Conrad's recursive chain homotopy from the identity to signed sorting. -/ |
| 565 | def cechTupleAlternatingHomotopy {ι : Type u} [LinearOrder ι] : |
| 566 | (n : ℕ) → CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι (n + 1) |
| 567 | | 0 => 0 |
| 568 | | n + 1 => |
| 569 | cechTupleLinearExtension fun i => |
| 570 | cechTuplePrependChain (i 0) (n + 1) |
| 571 | (cechTupleAlternatingProjectionBasis (n + 1) i - |
| 572 | Finsupp.single i 1 - |
| 573 | cechTupleAlternatingHomotopy n |
| 574 | (cechTupleBoundaryBasis n i)) |
| 575 | |
| 576 | @[simp] |
| 577 | theorem cechTupleAlternatingHomotopy_zero |
| 578 | {ι : Type u} [LinearOrder ι] : |
| 579 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (ι := ι) 0 = 0 := |
| 580 | rfl |
| 581 | |
| 582 | @[simp] |
| 583 | theorem cechTupleAlternatingHomotopy_succ_single |
| 584 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 585 | (i : Fin (n + 2) → ι) (a : ℤ) : |
| 586 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) (Finsupp.single i a) = |
| 587 | a • cechTuplePrependChain (i 0) (n + 1) |
| 588 | (cechTupleAlternatingProjectionBasis (n + 1) i - |
| 589 | Finsupp.single i 1 - |
| 590 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n |
| 591 | (cechTupleBoundaryBasis n i)) := by |
| 592 | simp [CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy, cechTupleLinearExtension] |
| 593 | |
| 594 | /-- The lower-degree term `h∂` in the tuple-chain homotopy identity. -/ |
| 595 | def cechTupleAlternatingHomotopyPrevious |
| 596 | {ι : Type u} [LinearOrder ι] : |
| 597 | (n : ℕ) → CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι n |
| 598 | | 0 => 0 |
| 599 | | n + 1 => |
| 600 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n).comp (cechTupleBoundary n) |
| 601 | |
| 602 | @[simp] |
| 603 | theorem cechTupleAlternatingHomotopyPrevious_zero |
| 604 | {ι : Type u} [LinearOrder ι] : |
| 605 | cechTupleAlternatingHomotopyPrevious (ι := ι) 0 = 0 := |
| 606 | rfl |
| 607 | |
| 608 | @[simp] |
| 609 | theorem cechTupleAlternatingHomotopyPrevious_succ_apply |
| 610 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 611 | (x : CechTupleChain ι (n + 1)) : |
| 612 | cechTupleAlternatingHomotopyPrevious (n + 1) x = |
| 613 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n (cechTupleBoundary n x) := |
| 614 | rfl |
| 615 | |
| 616 | theorem cechTupleAlternatingProjection_zero |
| 617 | {ι : Type u} [LinearOrder ι] (x : CechTupleChain ι 0) : |
| 618 | cechTupleAlternatingProjection 0 x = x := by |
| 619 | induction x using Finsupp.induction_linear with |
| 620 | | zero => simp |
| 621 | | add x y hx hy => simp [hx, hy] |
| 622 | | single i a => |
| 623 | have hi : StrictMono i := by |
| 624 | intro k l hkl |
| 625 | omega |
| 626 | rw [cechTupleAlternatingProjection_single, |
| 627 | cechTupleAlternatingProjectionBasis_of_strictMono i hi] |
| 628 | simp |
| 629 | |
| 630 | private theorem cechTupleAlternatingHomotopyPrevious_boundaryBasis |
| 631 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 632 | (i : Fin (n + 2) → ι) : |
| 633 | cechTupleAlternatingHomotopyPrevious n |
| 634 | (cechTupleBoundaryBasis n i) = 0 := by |
| 635 | cases n with |
| 636 | | zero => rfl |
| 637 | | succ n => |
| 638 | change CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n |
| 639 | (cechTupleBoundary n (cechTupleBoundaryBasis (n + 1) i)) = 0 |
| 640 | have hsq := cechTupleBoundary_boundary (ι := ι) n |
| 641 | (Finsupp.single i 1) |
| 642 | simp only [cechTupleBoundary_single, one_smul] at hsq |
| 643 | rw [hsq, map_zero] |
| 644 | |
| 645 | /-- Conrad's recursive homotopy satisfies `∂h + h∂ = p - 1`. -/ |
| 646 | theorem cechTupleAlternatingHomotopy_identity |
| 647 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 648 | (x : CechTupleChain ι n) : |
| 649 | cechTupleBoundary n (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n x) + |
| 650 | cechTupleAlternatingHomotopyPrevious n x = |
| 651 | cechTupleAlternatingProjection n x - x := by |
| 652 | induction n with |
| 653 | | zero => |
| 654 | simp [cechTupleAlternatingProjection_zero] |
| 655 | | succ n ih => |
| 656 | induction x using Finsupp.induction_linear with |
| 657 | | zero => simp |
| 658 | | add x y hx hy => |
| 659 | simp only [map_add] |
| 660 | calc |
| 661 | (cechTupleBoundary (n + 1)) |
| 662 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) x) + |
| 663 | (cechTupleBoundary (n + 1)) |
| 664 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) y) + |
| 665 | (cechTupleAlternatingHomotopyPrevious (n + 1) x + |
| 666 | cechTupleAlternatingHomotopyPrevious (n + 1) y) = |
| 667 | ((cechTupleBoundary (n + 1)) |
| 668 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) x) + |
| 669 | cechTupleAlternatingHomotopyPrevious (n + 1) x) + |
| 670 | ((cechTupleBoundary (n + 1)) |
| 671 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) y) + |
| 672 | cechTupleAlternatingHomotopyPrevious (n + 1) y) := by |
| 673 | abel |
| 674 | _ = (cechTupleAlternatingProjection (n + 1) x - x) + |
| 675 | (cechTupleAlternatingProjection (n + 1) y - y) := by |
| 676 | rw [hx, hy] |
| 677 | _ = cechTupleAlternatingProjection (n + 1) x + |
| 678 | cechTupleAlternatingProjection (n + 1) y - |
| 679 | (x + y) := by |
| 680 | abel |
| 681 | | single i a => |
| 682 | let ω := |
| 683 | cechTupleAlternatingProjectionBasis (n + 1) i - |
| 684 | Finsupp.single i 1 - |
| 685 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n |
| 686 | (cechTupleBoundaryBasis n i) |
| 687 | have hp := cechTupleAlternatingProjection_boundary |
| 688 | (ι := ι) n (Finsupp.single i 1) |
| 689 | simp only [cechTupleAlternatingProjection_single, |
| 690 | cechTupleBoundary_single, one_smul] at hp |
| 691 | have hih := ih (cechTupleBoundaryBasis n i) |
| 692 | rw [cechTupleAlternatingHomotopyPrevious_boundaryBasis, |
| 693 | add_zero] at hih |
| 694 | have hcycle : cechTupleBoundary n ω = 0 := by |
| 695 | dsimp only [ω] |
| 696 | rw [map_sub, map_sub, hp, hih] |
| 697 | simp only [cechTupleBoundary_single, one_smul] |
| 698 | abel |
| 699 | have hcon := cechTuplePrepend_contraction (i 0) n ω |
| 700 | rw [hcycle, map_zero, add_zero] at hcon |
| 701 | have hunit : |
| 702 | cechTupleBoundary (n + 1) |
| 703 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (n + 1) |
| 704 | (Finsupp.single i 1)) + |
| 705 | cechTupleAlternatingHomotopyPrevious (n + 1) |
| 706 | (Finsupp.single i 1) = |
| 707 | cechTupleAlternatingProjection (n + 1) |
| 708 | (Finsupp.single i 1) - |
| 709 | Finsupp.single i 1 := by |
| 710 | rw [cechTupleAlternatingHomotopy_succ_single, one_smul, |
| 711 | cechTupleAlternatingHomotopyPrevious_succ_apply, |
| 712 | cechTupleBoundary_single, one_smul, |
| 713 | cechTupleAlternatingProjection_single, one_smul] |
| 714 | change cechTupleBoundary (n + 1) |
| 715 | (cechTuplePrependChain (i 0) (n + 1) ω) + |
| 716 | CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n |
| 717 | (cechTupleBoundaryBasis n i) = |
| 718 | cechTupleAlternatingProjectionBasis (n + 1) i - |
| 719 | Finsupp.single i 1 |
| 720 | rw [hcon] |
| 721 | dsimp only [ω] |
| 722 | abel |
| 723 | have h := congrArg (fun y => a • y) hunit |
| 724 | simpa [smul_sub, Finsupp.smul_single] using h |
| 725 | |
| 726 | namespace CechTupleChain |
| 727 | |
| 728 | /-- Every tuple occurring in a chain uses indices from `N`. -/ |
| 729 | def SupportedBy {ι : Type u} {n : ℕ} |
| 730 | (x : CechTupleChain ι n) (N : Set ι) : Prop := |
| 731 | ∀ ⦃i⦄, i ∈ x.support → Set.range i ⊆ N |
| 732 | |
| 733 | theorem supportedBy_zero {ι : Type u} {n : ℕ} {N : Set ι} : |
| 734 | SupportedBy (0 : CechTupleChain ι n) N := by |
| 735 | intro i hi |
| 736 | simp at hi |
| 737 | |
| 738 | theorem SupportedBy.add {ι : Type u} {n : ℕ} {N : Set ι} |
| 739 | {x y : CechTupleChain ι n} (hx : SupportedBy x N) |
| 740 | (hy : SupportedBy y N) : |
| 741 | SupportedBy (x + y) N := by |
| 742 | classical |
| 743 | intro i hi |
| 744 | rcases Finset.mem_union.mp (Finsupp.support_add hi) with hi | hi |
| 745 | · exact hx hi |
| 746 | · exact hy hi |
| 747 | |
| 748 | theorem SupportedBy.sub {ι : Type u} {n : ℕ} {N : Set ι} |
| 749 | {x y : CechTupleChain ι n} (hx : SupportedBy x N) |
| 750 | (hy : SupportedBy y N) : |
| 751 | SupportedBy (x - y) N := by |
| 752 | classical |
| 753 | intro i hi |
| 754 | rcases Finset.mem_union.mp (Finsupp.support_sub hi) with hi | hi |
| 755 | · exact hx hi |
| 756 | · exact hy hi |
| 757 | |
| 758 | theorem SupportedBy.smul {ι : Type u} {n : ℕ} {N : Set ι} |
| 759 | {x : CechTupleChain ι n} (hx : SupportedBy x N) (a : ℤ) : |
| 760 | SupportedBy (a • x) N := by |
| 761 | intro i hi |
| 762 | exact hx (Finsupp.support_smul hi) |
| 763 | |
| 764 | theorem SupportedBy.mono {ι : Type u} {n : ℕ} {N N' : Set ι} |
| 765 | {x : CechTupleChain ι n} (hx : SupportedBy x N) |
| 766 | (hNN' : N ⊆ N') : |
| 767 | SupportedBy x N' := by |
| 768 | intro i hi |
| 769 | exact (hx hi).trans hNN' |
| 770 | |
| 771 | theorem supportedBy_single {ι : Type u} {n : ℕ} {N : Set ι} |
| 772 | (i : Fin (n + 1) → ι) (a : ℤ) (hi : Set.range i ⊆ N) : |
| 773 | SupportedBy (Finsupp.single i a) N := by |
| 774 | intro j hj |
| 775 | have hji := Finsupp.support_single_subset hj |
| 776 | simp only [Finset.mem_singleton] at hji |
| 777 | subst j |
| 778 | exact hi |
| 779 | |
| 780 | theorem supportedBy_sum {ι : Type u} {n : ℕ} {N : Set ι} |
| 781 | {κ : Type*} (s : Finset κ) (f : κ → CechTupleChain ι n) |
| 782 | (hf : ∀ k ∈ s, SupportedBy (f k) N) : |
| 783 | SupportedBy (∑ k ∈ s, f k) N := by |
| 784 | classical |
| 785 | induction s using Finset.induction_on with |
| 786 | | empty => simp [supportedBy_zero] |
| 787 | | @insert k s hk ih => |
| 788 | rw [Finset.sum_insert hk] |
| 789 | exact (hf k (Finset.mem_insert_self k s)).add |
| 790 | (ih fun l hl => hf l (Finset.mem_insert_of_mem hl)) |
| 791 | |
| 792 | theorem supportedBy_linearExtension |
| 793 | {ι : Type u} {n m : ℕ} {N : Set ι} |
| 794 | (f : (Fin (n + 1) → ι) → CechTupleChain ι m) |
| 795 | (x : CechTupleChain ι n) |
| 796 | (hf : ∀ i ∈ x.support, SupportedBy (f i) N) : |
| 797 | SupportedBy (cechTupleLinearExtension f x) N := by |
| 798 | classical |
| 799 | intro j hj |
| 800 | rw [cechTupleLinearExtension, Finsupp.lsum_apply] at hj |
| 801 | change j ∈ (x.sum fun i a => a • f i).support at hj |
| 802 | obtain ⟨i, hi, hj⟩ := |
| 803 | Finset.mem_biUnion.mp (Finsupp.support_sum hj) |
| 804 | exact hf i hi (Finsupp.support_smul hj) |
| 805 | |
| 806 | end CechTupleChain |
| 807 | |
| 808 | theorem cechTupleBoundaryBasis_supportedBy |
| 809 | {ι : Type u} (n : ℕ) (i : Fin (n + 2) → ι) : |
| 810 | CechTupleChain.SupportedBy (cechTupleBoundaryBasis n i) |
| 811 | (Set.range i) := by |
| 812 | unfold cechTupleBoundaryBasis |
| 813 | refine CechTupleChain.supportedBy_sum Finset.univ _ ?_ |
| 814 | intro k _ |
| 815 | apply CechTupleChain.supportedBy_single |
| 816 | rintro x ⟨l, rfl⟩ |
| 817 | exact ⟨k.succAbove l, rfl⟩ |
| 818 | |
| 819 | theorem cechTupleAlternatingProjectionBasis_supportedBy |
| 820 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 821 | (i : Fin (n + 1) → ι) : |
| 822 | CechTupleChain.SupportedBy |
| 823 | (cechTupleAlternatingProjectionBasis n i) (Set.range i) := by |
| 824 | by_cases hi : Function.Injective i |
| 825 | · rw [cechTupleAlternatingProjectionBasis_of_injective i hi] |
| 826 | apply CechTupleChain.supportedBy_single |
| 827 | rintro x ⟨k, rfl⟩ |
| 828 | exact ⟨Tuple.sort i k, rfl⟩ |
| 829 | · rw [cechTupleAlternatingProjectionBasis_of_not_injective i hi] |
| 830 | exact CechTupleChain.supportedBy_zero |
| 831 | |
| 832 | theorem cechTuplePrependChain_supportedBy |
| 833 | {ι : Type u} (i₀ : ι) (n : ℕ) |
| 834 | (x : CechTupleChain ι n) (N : Set ι) |
| 835 | (hi₀ : i₀ ∈ N) (hx : CechTupleChain.SupportedBy x N) : |
| 836 | CechTupleChain.SupportedBy (cechTuplePrependChain i₀ n x) N := by |
| 837 | rw [cechTuplePrependChain] |
| 838 | apply CechTupleChain.supportedBy_linearExtension |
| 839 | intro i hi |
| 840 | apply CechTupleChain.supportedBy_single |
| 841 | rintro y ⟨k, rfl⟩ |
| 842 | induction k using Fin.cases with |
| 843 | | zero => exact hi₀ |
| 844 | | succ l => exact hx hi ⟨l, rfl⟩ |
| 845 | |
| 846 | theorem cechTupleBoundary_supportedBy |
| 847 | {ι : Type u} (n : ℕ) (x : CechTupleChain ι (n + 1)) |
| 848 | (N : Set ι) (hx : CechTupleChain.SupportedBy x N) : |
| 849 | CechTupleChain.SupportedBy (cechTupleBoundary n x) N := by |
| 850 | rw [cechTupleBoundary] |
| 851 | apply CechTupleChain.supportedBy_linearExtension |
| 852 | intro i hi |
| 853 | exact (cechTupleBoundaryBasis_supportedBy n i).mono (hx hi) |
| 854 | |
| 855 | theorem cechTupleAlternatingProjection_supportedBy |
| 856 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 857 | (x : CechTupleChain ι n) (N : Set ι) |
| 858 | (hx : CechTupleChain.SupportedBy x N) : |
| 859 | CechTupleChain.SupportedBy |
| 860 | (cechTupleAlternatingProjection n x) N := by |
| 861 | rw [cechTupleAlternatingProjection] |
| 862 | apply CechTupleChain.supportedBy_linearExtension |
| 863 | intro i hi |
| 864 | exact (cechTupleAlternatingProjectionBasis_supportedBy n i).mono (hx hi) |
| 865 | |
| 866 | theorem cechTupleAlternatingHomotopy_supportedBy |
| 867 | {ι : Type u} [LinearOrder ι] (n : ℕ) |
| 868 | (x : CechTupleChain ι n) (N : Set ι) |
| 869 | (hx : CechTupleChain.SupportedBy x N) : |
| 870 | CechTupleChain.SupportedBy |
| 871 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy n x) N := by |
| 872 | induction n generalizing N with |
| 873 | | zero => |
| 874 | change CechTupleChain.SupportedBy 0 N |
| 875 | exact CechTupleChain.supportedBy_zero |
| 876 | | succ n ih => |
| 877 | rw [CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy] |
| 878 | apply CechTupleChain.supportedBy_linearExtension |
| 879 | intro i hi |
| 880 | have hiN : Set.range i ⊆ N := hx hi |
| 881 | have hp := |
| 882 | (cechTupleAlternatingProjectionBasis_supportedBy (n + 1) i).mono hiN |
| 883 | have hsingle := |
| 884 | (CechTupleChain.supportedBy_single i 1 (Subset.rfl)).mono hiN |
| 885 | have hboundary := |
| 886 | (cechTupleBoundaryBasis_supportedBy n i).mono hiN |
| 887 | have hh := ih _ _ hboundary |
| 888 | apply cechTuplePrependChain_supportedBy |
| 889 | · exact hiN ⟨0, rfl⟩ |
| 890 | · exact (hp.sub hsingle).sub hh |
| 891 | |
| 892 | /-- A free tuple-chain map does not introduce new tuple indices. -/ |
| 893 | def CechTupleSupportNonincreasing |
| 894 | {ι : Type u} {n m : ℕ} |
| 895 | (f : CechTupleChain ι n →ₗ[ℤ] CechTupleChain ι m) : Prop := |
| 896 | ∀ i : Fin (n + 1) → ι, |
| 897 | CechTupleChain.SupportedBy (f (Finsupp.single i 1)) (Set.range i) |
| 898 | |
| 899 | theorem cechTupleAlternatingHomotopy_supportNonincreasing |
| 900 | {ι : Type u} [LinearOrder ι] (n : ℕ) : |
| 901 | CechTupleSupportNonincreasing |
| 902 | (CechTupleAlternatingHomotopy.cechTupleAlternatingHomotopy (ι := ι) n) := by |
| 903 | intro i |
| 904 | apply cechTupleAlternatingHomotopy_supportedBy |
| 905 | exact CechTupleChain.supportedBy_single i 1 Subset.rfl |
| 906 | |
| 907 | end |
| 908 | |
| 909 | end OAI.AlgebraicGeometry.SheafCohomology.Projective.CechTupleAlternatingHomotopy |