Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | public import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives |
| 4 | public import Mathlib.CategoryTheory.Monoidal.FunctorCategory |
| 5 | public import Mathlib.CategoryTheory.Monoidal.Types.Basic |
| 6 | import Mathlib.AlgebraicTopology.AlternatingFaceMapComplex |
| 7 | import Mathlib.CategoryTheory.Abelian.Exact |
| 8 | import Mathlib.CategoryTheory.EffectiveEpi.Comp |
| 9 | import Mathlib.CategoryTheory.ExtremalEpi |
| 10 | import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory |
| 11 | import Mathlib.CategoryTheory.Subfunctor.Equalizer |
| 12 | public import Lib.General.Algebra.LongExactSequences |
| 13 | |
| 14 | /-! |
| 15 | # Criteria for comparison maps of Ext cohomology of functors of points to be bijective |
| 16 | |
| 17 | For a set-valued functor of points `Y` on a category `C` with coefficients `F`, cohomology is |
| 18 | `Hⁿ(Y, F) = New.Variety.H (freeAb.obj Y) F n`, an `Ext` group in functors to abelian groups, where |
| 19 | `ℤ[Y]` is the free abelian functor on `Y`; `reprBy A` is the functor `B ↦ (A ⟶ B)` (lifted), and a |
| 20 | point `y` of `Y A` gives `pointMap y : reprBy A ⟶ Y`, `f ↦ Y.map f y`. A comparison `c = (φ, β)` |
| 21 | with `φ : C' ⥤ C` and `β : φ ⋙ F ⟶ F'`, together with a map `u : Y' ⟶ φ ⋙ Y`, gives maps |
| 22 | `c.pull (freeAbMap u) n : Hⁿ(Y, F) → Hⁿ(Y', F')`. The file gives criteria for these maps to be |
| 23 | bijective. The tools are dévissage and Čech descent along covers, and pointwise descriptions of |
| 24 | bijections and pull-back squares. The file also builds cocycle classes from witnesses of a relation |
| 25 | `R ⊆ V × L`, relative to a subfunctor `U ⊆ V`, by a Čech-type complex. |
| 26 | |
| 27 | ## Main definitions and results |
| 28 | |
| 29 | * `New.Variety.witnessed.universalClass`, `New.Variety.witnessed.cocycleClass`: splicing the short |
| 30 | exact sequences into which the complex of points with witnesses splits gives a universal class; |
| 31 | its push-forward along a cocycle with values in `F` is a class in `Extⁿ(ℤ[V]/ℤ[U], F)`. |
| 32 | * `New.Variety.cech_descent_step`, `New.Variety.Devissage.allBijective_freeAb_range_of_cech`: Čech |
| 33 | descent of bijectivity from `E` and its fibre powers `New.Variety.cech p m` to the image of |
| 34 | `p : E ⟶ Y`. |
| 35 | * `New.Variety.IsCover`: `p` is a cover for `F`, that is, the inclusion of its image induces |
| 36 | bijections on all `Extⁿ(ℤ[-], F)`; pointwise surjections are covers |
| 37 | (`New.Variety.IsPointwiseSurjective.isCover`). |
| 38 | * `New.Variety.Comparison.IsBijective`: for a natural map `α : N' ⟶ c.functor ⋙ N`, the maps |
| 39 | `c.pull α n : Extⁿ(N, F) → Extⁿ(N', F')` are bijective in all degrees; for `α = freeAbMap u` these |
| 40 | are the maps `Hⁿ(Y, F) → Hⁿ(Y', F')`. |
| 41 | * `New.Variety.Comparison.isBijective_of_fibers`: it is enough to test on the fibres over the points |
| 42 | of `Y`; the proof is Čech descent (`New.Variety.Comparison.bijectiveUpTo_of_cech_pred`), one |
| 43 | condition of `New.Variety.BijectiveUpTo` at a time. |
| 44 | * `New.Variety.Comparison.HasUniversalPoints.isBijective`: representable fibres with equal |
| 45 | coefficients (`New.Variety.Comparison.IsUnivPoint`) suffice; |
| 46 | `New.Variety.Comparison.isBijective_of_adj` is the case of an adjunction. |
| 47 | |
| 48 | Notions from other files: |
| 49 | * `New.Variety.H`: The group Ext^n(N,F) in the category of functors from C to abelian groups; |
| 50 | `H.map F α n` is the pull-back along α: N' → N and `H.push N β n` the push-forward along β: |
| 51 | F → F'. |
| 52 | * `New.Variety.Comparison`: A comparison from F on C to F' on C' is a functor φ: C' → C with a map |
| 53 | β: F∘φ → F'. For α: N' → N∘φ, `Comparison.pull` is the map Ext^n(N,F) → Ext^n(N',F') that |
| 54 | restricts along φ, pushes by β and pulls by α. |
| 55 | * `New.Variety.BijectiveUpTo`: For maps f_n: A_n → B_n, the first r of the conditions: f₀ injective, |
| 56 | f₀ surjective, f₁ injective, f₁ surjective, and so on. |
| 57 | * `New.Variety.IsCohomEquiv`: α: N' → N is an equivalence for F: the pull-back |
| 58 | Ext^n(N,F) → Ext^n(N',F) is bijective for every n. |
| 59 | * `New.Variety.freeAbMap`: For u: Y' → Y∘φ, the induced map of free abelian group functors |
| 60 | Z[Y'] → Z[Y]∘φ. |
| 61 | |
| 62 | ## Relation to the literature |
| 63 | |
| 64 | Known; see `Lib.Cohomology.Hodge.FixedPointFormula` and `Lib.Cohomology.Etale.FilteredLimits` for |
| 65 | sources. |
| 66 | -/ |
| 67 | |
| 68 | @[expose] public section |
| 69 | |
| 70 | noncomputable section |
| 71 | |
| 72 | namespace New.Variety |
| 73 | |
| 74 | /-! |
| 75 | ## Witnesses, a Čech-type resolution and the universal cocycle class |
| 76 | |
| 77 | Cohomology classes from witnesses. A relation `R ⊆ V × L` between functors of points gives each |
| 78 | point `x` of `V` a set of witnesses `l`. A subfunctor `U ⊆ V` consists of points that have one. The |
| 79 | chains on tuples `(x, l₁, …, lₘ)` form a Čech-type complex, exact in positive degrees. |
| 80 | -/ |
| 81 | |
| 82 | section WitnessCocycles |
| 83 | |
| 84 | open CategoryTheory MonoidalCategory Abelian.Ext FreeAddCommGroup QuotientAddGroup Fin ShortComplex |
| 85 | abCoker H freeAb |
| 86 | |
| 87 | variable {C : Type _} [Category C] {m n : ℕ} {V L : C ⥤ Type _} (R : Subfunctor (V ⊗ L)) |
| 88 | |
| 89 | /-! ### The complex of points with witnesses -/ |
| 90 | |
| 91 | /-- The functor of points with `m` witnesses: a point `x` of `V` together with `m` points `l i` |
| 92 | of `L` such that each pair `(x, l i)` lies in `R`. -/ |
| 93 | def witnessed (m : ℕ) : C ⥤ Type _ where |
| 94 | obj A := {t : V.obj A × (Fin m → L.obj A) // ∀ i : Fin m, (t.fst, t.snd i) ∈ R.obj A} |
| 95 | map f := ↾fun t ↦ |
| 96 | ⟨(V.map f t.val.fst, fun i ↦ L.map f (t.val.snd i)), fun i ↦ R.map f (t.property i)⟩ |
| 97 | |
| 98 | namespace witnessed |
| 99 | |
| 100 | /-- Reindexing the witnesses of a point along `g`: the `i`-th new witness is the `g i`-th old |
| 101 | one. -/ |
| 102 | def reindexWitness (g : Fin m → Fin n) : witnessed R n ⟶ witnessed R m where |
| 103 | app _ := ↾fun t ↦ ⟨(t.val.fst, t.val.snd ∘ g), fun i ↦ t.property (g i)⟩ |
| 104 | |
| 105 | /-- The boundary map from chains with `m + 1` witnesses to chains with `m` witnesses: the |
| 106 | alternating sum of the maps that drop one witness. -/ |
| 107 | def boundary (m : ℕ) : freeAb.obj (witnessed R (m + 1)) ⟶ freeAb.obj (witnessed R m) := |
| 108 | ∑ j : Fin (m + 1), (-1) ^ j.val • freeAb.map (reindexWitness R j.succAbove) |
| 109 | |
| 110 | /-- The boundary of a boundary is zero. -/ |
| 111 | lemma boundary_comp_boundary (m : ℕ) : boundary R (m + 1) ≫ boundary R m = 0 := by |
| 112 | cases m with |
| 113 | | zero => |
| 114 | -- Dropping the two witnesses of a point in either order gives the same point. |
| 115 | rw [boundary, boundary, Fin.sum_univ_two, Fin.sum_univ_one] |
| 116 | simp only [Fin.val_zero, Fin.val_one, pow_zero, pow_one, one_smul, neg_one_zsmul, |
| 117 | Preadditive.add_comp, Preadditive.neg_comp, add_neg_eq_zero, ← freeAb.map_comp] |
| 118 | refine congrArg freeAb.map ?_ |
| 119 | ext A t |
| 120 | exact Subtype.ext (Prod.ext rfl (Subsingleton.elim _ _)) |
| 121 | | succ m => |
| 122 | -- The points with `m + 1` witnesses, for all `m`, form a simplicial object, and `boundary` |
| 123 | -- is the differential of its alternating face map complex. |
| 124 | exact AlgebraicTopology.AlternatingFaceMapComplex.d_squared |
| 125 | (.mk _ (fun g ↦ reindexWitness R g.unop) ⋙ freeAb) m |
| 126 | |
| 127 | /-- The map induced by the boundary, from the chains with `m + 1` witnesses modulo boundaries to |
| 128 | the chains with `m` witnesses. -/ |
| 129 | def boundaryFromCoker (m : ℕ) : abCoker (boundary R (m + 1)) ⟶ freeAb.obj (witnessed R m) := |
| 130 | desc (α := boundary R (m + 1)) (boundary R m) (boundary_comp_boundary R m) |
| 131 | |
| 132 | /-- Composing `π (boundary R (m + 1))` with `boundaryFromCoker R m` |
| 133 | equals `boundary R m`. -/ |
| 134 | lemma proj_comp_boundaryFromCoker (m : ℕ) : |
| 135 | π (boundary R (m + 1)) ≫ boundaryFromCoker R m = boundary R m := |
| 136 | rfl |
| 137 | |
| 138 | /-- The natural isomorphism from points with `0` witnesses to points of `V` that forgets the empty |
| 139 | tuple of witnesses. -/ |
| 140 | def noWitness : witnessed R 0 ≅ V := |
| 141 | NatIso.ofComponents fun A ↦ |
| 142 | ((Equiv.subtypeUnivEquiv fun _ ↦ nofun).trans |
| 143 | (Equiv.prodUnique (V.obj A) (Fin 0 → L.obj A))).toIso |
| 144 | |
| 145 | variable {R} |
| 146 | |
| 147 | private lemma boundary_apply {A : C} (t : (witnessed R (m + 1)).obj A) : |
| 148 | (boundary R m).app A (of t) = |
| 149 | ∑ j : Fin (m + 1), (-1 : ℤ) ^ j.val • of ((reindexWitness R j.succAbove).app A t) := by |
| 150 | refine (sum_app_apply (A := A) (x := of t) |
| 151 | (g := fun j : Fin (m + 1) ↦ |
| 152 | (-1) ^ j.val • freeAb.map (reindexWitness R j.succAbove))).trans ?_ |
| 153 | exact Finset.sum_congr rfl fun _ _ ↦ rfl |
| 154 | |
| 155 | /-- A point of `V` that has a witness is a boundary, as a chain without witnesses. -/ |
| 156 | lemma proj_boundary_of_eq_zero {A : C} {t : (witnessed R 0).obj A} |
| 157 | (h_wit : ∃ l : L.obj A, (t.val.fst, l) ∈ R.obj A) : |
| 158 | (π (boundary R 0)).app A (of t) = 0 := by |
| 159 | obtain ⟨l, hl⟩ := h_wit |
| 160 | -- `t` is the boundary of the same point with the one witness `l`. |
| 161 | let t' : (witnessed R 1).obj A := ⟨(t.val.fst, fun _ ↦ l), fun _ ↦ hl⟩ |
| 162 | exact (eq_zero_iff _).2 ⟨of t', (boundary_apply t').trans |
| 163 | (congrArg of (Subtype.ext (Prod.ext rfl (Subsingleton.elim _ _))))⟩ |
| 164 | |
| 165 | /-- For a category `C`, functors `V`, `L : C ⥤ Type _`, a subfunctor `R` of `V ⊗ L`, a natural |
| 166 | number `m`, and an object `A : C`, the component at `A` of the induced boundary map |
| 167 | `boundaryFromCoker R m` from `Cₘ₊₁ / ∂Cₘ₊₂` to `Cₘ` is injective, where `Cₖ` denotes the chains on |
| 168 | points with `k` witnesses. -/ |
| 169 | private lemma injective_boundaryFromCoker_app (A : C) : |
| 170 | Function.Injective ((boundaryFromCoker R m).app A) := by |
| 171 | -- Let `c` put a chosen witness (if there is one) in front of the others. It is a contraction, |
| 172 | -- `c ∂ t + ∂ c t = t`, so `c` induces a left inverse of `boundaryFromCoker`. |
| 173 | let prepend (m : ℕ) (t : (witnessed R m).obj A) (h : ∃ l, (t.val.1, l) ∈ R.obj A) : |
| 174 | (witnessed R (m + 1)).obj A := |
| 175 | ⟨(t.val.1, cons h.choose t.val.2), cases h.choose_spec t.property⟩ |
| 176 | let c m := lift fun t : (witnessed R m).obj A ↦ |
| 177 | ∑ᶠ h : ∃ l, (t.val.1, l) ∈ R.obj A, of (prepend m t h) |
| 178 | have hc (m : ℕ) (t : (witnessed R m).obj A) (h : ∃ l, (t.val.1, l) ∈ R.obj A) : |
| 179 | c m (of t) = of (prepend m t h) := by |
| 180 | simp only [c, FreeAddCommGroup.lift_apply_of] |
| 181 | exact finsum_eq_single _ h fun g hne ↦ (hne (Subsingleton.elim g h)).elim |
| 182 | let d₁ : FreeAddCommGroup ((witnessed R (m + 2)).obj A) →+ |
| 183 | FreeAddCommGroup ((witnessed R (m + 1)).obj A) := ((boundary R (m + 1)).app A).hom |
| 184 | let d₀ : FreeAddCommGroup ((witnessed R (m + 1)).obj A) →+ |
| 185 | FreeAddCommGroup ((witnessed R m).obj A) := ((boundary R m).app A).hom |
| 186 | have h_contr (t : (witnessed R (m + 1)).obj A) : |
| 187 | d₁ (-c (m + 1) (of t)) = c m (d₀ (of t)) - of t := by |
| 188 | have h_wit : ∃ l, (t.val.1, l) ∈ R.obj A := ⟨_, t.property 0⟩ |
| 189 | have h_zero : |
| 190 | (reindexWitness R (0 : Fin (m + 2)).succAbove).app A (prepend (m + 1) t h_wit) = t := by |
| 191 | apply Subtype.ext |
| 192 | refine Prod.ext rfl ?_ |
| 193 | funext i |
| 194 | change cons (α := fun _ ↦ L.obj A) h_wit.choose t.val.2 |
| 195 | ((0 : Fin (m + 2)).succAbove i) = t.val.2 i |
| 196 | simp |
| 197 | have h_succ (j : Fin (m + 1)) : |
| 198 | (reindexWitness R j.succ.succAbove).app A (prepend (m + 1) t h_wit) = |
| 199 | prepend m ((reindexWitness R j.succAbove).app A t) h_wit := by |
| 200 | apply Subtype.ext |
| 201 | refine Prod.ext rfl ?_ |
| 202 | funext i |
| 203 | change cons (α := fun _ ↦ L.obj A) h_wit.choose t.val.2 (j.succ.succAbove i) = |
| 204 | cons (α := fun _ ↦ L.obj A) h_wit.choose (t.val.2 ∘ j.succAbove) i |
| 205 | refine Fin.cases ?_ (fun a ↦ ?_) i |
| 206 | · simp |
| 207 | · simp |
| 208 | have h_c (j : Fin (m + 1)) : |
| 209 | c m (of ((reindexWitness R j.succAbove).app A t)) = |
| 210 | of (prepend m ((reindexWitness R j.succAbove).app A t) h_wit) := |
| 211 | hc m _ h_wit |
| 212 | have h_bd0 : d₀ (of t) = |
| 213 | ∑ j : Fin (m + 1), (-1 : ℤ) ^ j.val • of ((reindexWitness R j.succAbove).app A t) := |
| 214 | boundary_apply t |
| 215 | have h_bd1 : d₁ (of (prepend (m + 1) t h_wit)) = |
| 216 | ∑ j : Fin (m + 2), (-1 : ℤ) ^ j.val • |
| 217 | of ((reindexWitness R j.succAbove).app A (prepend (m + 1) t h_wit)) := |
| 218 | boundary_apply (prepend (m + 1) t h_wit) |
| 219 | rw [hc (m + 1) t h_wit, map_neg, h_bd1, h_bd0, map_sum] |
| 220 | rw [Fin.sum_univ_succ] |
| 221 | simp only [map_zsmul, h_c, h_zero, h_succ, Fin.val_zero, pow_zero, one_smul, Fin.val_succ, |
| 222 | pow_succ, mul_neg_one, neg_zsmul, Finset.sum_neg_distrib] |
| 223 | abel |
| 224 | have h_inv : (mk' d₁.range).comp ((c m).comp d₀) = mk' d₁.range := |
| 225 | lift_ext _ _ fun t ↦ eq_iff_sub_mem.2 ⟨_, h_contr t⟩ |
| 226 | exact Function.HasLeftInverse.injective ⟨fun x ↦ ⟦c m x⟧, Quot.ind (DFunLike.congr_fun h_inv)⟩ |
| 227 | |
| 228 | /-- With `Cₘ` the chains on points with `m` witnesses, the sequence |
| 229 | `0 → Cₘ₊₁/∂Cₘ₊₂ → Cₘ → Cₘ/∂Cₘ₊₁ → 0` is short exact. -/ |
| 230 | lemma shortExact_boundaryFromCoker : |
| 231 | ∃ w : boundaryFromCoker R m ≫ π (boundary R m) = 0, |
| 232 | (ShortComplex.mk (boundaryFromCoker R m) (π (boundary R m)) w).ShortExact := by |
| 233 | refine shortExact_of_app injective_boundaryFromCoker_app (fun A x ↦ ?_) fun _ ↦ mk_surjective |
| 234 | -- Exactness in the middle: `boundaryFromCoker` has the same image as `boundary`. |
| 235 | exact (eq_zero_iff x).trans (.symm exists_mk) |
| 236 | |
| 237 | /-- Composing `boundaryFromCoker R m` with `π (boundary R m)` is zero. -/ |
| 238 | lemma boundaryFromCoker_comp_π : boundaryFromCoker R m ≫ π (boundary R m) = 0 := |
| 239 | shortExact_boundaryFromCoker.fst |
| 240 | |
| 241 | /-- The short complex formed by `boundaryFromCoker R m` and |
| 242 | `π (boundary R m)` is short exact. -/ |
| 243 | lemma shortExact_boundaryFromCoker_π : |
| 244 | ShortExact (ShortComplex.mk (boundaryFromCoker R m) (π (boundary R m)) |
| 245 | boundaryFromCoker_comp_π) := |
| 246 | shortExact_boundaryFromCoker.snd |
| 247 | |
| 248 | variable {U : Subfunctor V} (hU : ∀ A : C, ∀ x ∈ U.obj A, ∃ l : L.obj A, (x, l) ∈ R.obj A) |
| 249 | {F : AbFunctor C} {C' : Type 1} [Category C'] {F' : AbFunctor C'} {V' L' : C' ⥤ Type _} |
| 250 | {R' : Subfunctor (V' ⊗ L')} {U' : Subfunctor V'} |
| 251 | (hU' : ∀ A : C', ∀ x ∈ U'.obj A, ∃ l : L'.obj A, (x, l) ∈ R'.obj A) |
| 252 | |
| 253 | /-! ### The class of a cocycle -/ |
| 254 | |
| 255 | /-- The map `x ↦ [x]` from `ℤ[V]/ℤ[U]` to the chains without witnesses modulo boundaries. It is |
| 256 | well defined because every point of `U` has a witness. -/ |
| 257 | def fromRel : relFreeAb U ⟶ abCoker (boundary R 0) := |
| 258 | desc (freeAb.map (noWitness R).inv ≫ π (boundary R 0)) |
| 259 | (freeAb.hom_ext fun A x ↦ proj_boundary_of_eq_zero |
| 260 | (R := R) (A := A) (t := (noWitness R).inv.app A x.val) (hU A x.val x.property)) |
| 261 | |
| 262 | /-- The universal class in degree `n`, with coefficients in the chains with `n` witnesses modulo |
| 263 | boundaries. In degree `0` it is the map `fromRel hU`; each further degree composes with the |
| 264 | extension class of the short exact sequence `shortExact_boundaryFromCoker`. -/ |
| 265 | def universalClass : ∀ n : ℕ, H (relFreeAb U) (abCoker (boundary R n)) n |
| 266 | | 0 => mk₀ (fromRel hU) |
| 267 | | n + 1 => (universalClass n).comp shortExact_boundaryFromCoker_π.extClass rfl |
| 268 | |
| 269 | /-- At degree `0`, `universalClass hU 0` equals `mk₀ (fromRel hU)`. -/ |
| 270 | lemma universalClass_zero : universalClass hU 0 = mk₀ (fromRel hU) := |
| 271 | rfl |
| 272 | |
| 273 | /-- The universal class in degree `n + 1` is the universal class in |
| 274 | degree `n` composed with the extension class of |
| 275 | `shortExact_boundaryFromCoker_π`. -/ |
| 276 | lemma universalClass_succ (n : ℕ) : |
| 277 | universalClass hU (n + 1) = |
| 278 | (universalClass hU n).comp shortExact_boundaryFromCoker_π.extClass rfl := |
| 279 | rfl |
| 280 | |
| 281 | /-- The class of a cocycle. A cocycle of degree `n` is a map `y` to `F` from the chains with `n` |
| 282 | witnesses modulo boundaries. Its class in `Extⁿ(ℤ[V]/ℤ[U], F)` is the push-forward of |
| 283 | `universalClass hU n` along `y`. -/ |
| 284 | def cocycleClass : (abCoker (boundary R n) ⟶ F) →+ H (relFreeAb U) F n := |
| 285 | AddMonoidHom.mk' (fun y ↦ H.push (relFreeAb U) y n (universalClass hU n)) |
| 286 | (by simp [H.push, mk₀_add]) |
| 287 | |
| 288 | /-- Evaluating `cocycleClass hU y` equals pushing `universalClass hU n` |
| 289 | along `y`. -/ |
| 290 | lemma cocycleClass_apply (y : abCoker (boundary R n) ⟶ F) : |
| 291 | cocycleClass hU y = push (relFreeAb U) y n (universalClass hU n) := |
| 292 | rfl |
| 293 | |
| 294 | /-! ### Naturality -/ |
| 295 | |
| 296 | /-- Let `γ` and `y` be compatible maps between the last two terms of short exact sequences `S` |
| 297 | and `T`, let `β : T.X₁ ⟶ F`, and let `x` be a class in `Extⁿ(N, S.X₃)`. Then there is a map |
| 298 | `z : S.X₁ ⟶ F` with `z s = β t` whenever `t` and `s` have the same image in `T.X₂`, and the |
| 299 | product of `y_* x` with `β_* [T]` equals `z_*` of the product of `x` with `[S]`. Here `[S]` and |
| 300 | `[T]` are the extension classes. -/ |
| 301 | lemma exists_map_extClass_comp {S T : ShortComplex (AbFunctor C)} (hS : S.ShortExact) |
| 302 | (hT : T.ShortExact) (β : T.X₁ ⟶ F) {N : AbFunctor C} (x : H N S.X₃ n) (γ : S.X₂ ⟶ T.X₂) |
| 303 | (y : S.X₃ ⟶ T.X₃) (h_comm : S.g ≫ y = γ ≫ T.g) : |
| 304 | ∃ z : S.X₁ ⟶ F, |
| 305 | (∀ (A : C) (s : S.X₁.obj A) (w : F.obj A), |
| 306 | (∃ t : T.X₁.obj A, T.f.app A t = γ.app A (S.f.app A s) ∧ β.app A t = w) → |
| 307 | w = z.app A s) ∧ |
| 308 | (H.push N y n x).comp (hT.extClass.comp (mk₀ β) rfl) rfl = |
| 309 | H.push N z (n + 1) (x.comp hS.extClass rfl) := by |
| 310 | -- `γ` restricts to a map `z₁ : S.X₁ ⟶ T.X₁`, which completes a morphism of short exact sequences. |
| 311 | have h_mono : Mono T.f := hT.mono_f |
| 312 | obtain ⟨z₁, hz₁⟩ : ∃ z₁ : S.X₁ ⟶ T.X₁, z₁ ≫ T.f = S.f ≫ γ := |
| 313 | hT.exact.lift' (S.f ≫ γ) (by simp [← h_comm]) |
| 314 | refine ⟨z₁ ≫ β, fun A s w ⟨t, ht, hw⟩ ↦ ?_, ?_⟩ |
| 315 | · obtain rfl : t = z₁.app A s := ConcreteCategory.injective_of_mono_of_preservesPullback _ |
| 316 | (ht.trans (ConcreteCategory.congr_hom (NatTrans.congr_app hz₁ A) s).symm) |
| 317 | exact hw.symm |
| 318 | · simp [← comp_assoc_of_third_deg_zero, |
| 319 | ← hS.extClass_naturality hT ⟨z₁, γ, y, hz₁, h_comm.symm⟩, H.push] |
| 320 | |
| 321 | /-- Classes of cocycles are carried along an exact functor `Φ`. Let the maps `q m` send chains |
| 322 | with `m` witnesses for `R'` to the image under `Φ` of the chains with `m` witnesses for `R`, |
| 323 | compatibly with reindexing and, in degree `0`, with `α`. Then a cocycle `y` for `R` induces a |
| 324 | cocycle `y'` for `R'`, and the class of `y`, moved along `Φ`, `β` and `α`, is the class of `y'`. -/ |
| 325 | lemma map_cocycleClass (Φ : AbFunctor C ⥤ AbFunctor C') [IsExactFunctor Φ] (β : Φ.obj F ⟶ F') |
| 326 | {α : relFreeAb U' ⟶ Φ.obj (relFreeAb U)} |
| 327 | (q : ∀ m : ℕ, freeAb.obj (witnessed R' m) ⟶ Φ.obj (freeAb.obj (witnessed R m))) |
| 328 | (h_deg_zero : ∀ (A : C') (x : V'.obj A), |
| 329 | (α ≫ Φ.map (fromRel hU)).app A (relFreeAb.mk U' x) = |
| 330 | (q 0 ≫ Φ.map (π (boundary R 0))).app A (of ((noWitness R').inv.app A x))) |
| 331 | (h_reindex : ∀ (m n : ℕ) (g : Fin m → Fin n), |
| 332 | freeAb.map (reindexWitness R' g) ≫ q m = q n ≫ Φ.map (freeAb.map (reindexWitness R g))) |
| 333 | (y : abCoker (boundary R n) ⟶ F) : |
| 334 | ∃ y' : abCoker (boundary R' n) ⟶ F', |
| 335 | π (boundary R' n) ≫ y' = q n ≫ Φ.map (π (boundary R n) ≫ y) ≫ β ∧ |
| 336 | H.map F' α n (H.push (Φ.obj (relFreeAb U)) β n ((cocycleClass hU y).mapExactFunctor Φ)) = |
| 337 | cocycleClass hU' y' := by |
| 338 | -- The maps `q m` commute with the boundaries, so they descend to maps `k m` of the cokernels. |
| 339 | -- They form maps of the short exact sequences `shortExact_boundaryFromCoker`. Naturality of |
| 340 | -- `extClass` and induction on `n` show that `universalClass hU n` is carried to the |
| 341 | -- push-forward of `universalClass hU' n` along `k n`. |
| 342 | have h_bd (m : ℕ) : |
| 343 | boundary R' m ≫ q m = q (m + 1) ≫ Φ.map (π _) ≫ Φ.map (boundaryFromCoker R m) := |
| 344 | calc |
| 345 | _ = q (m + 1) ≫ Φ.map (boundary R m) := by |
| 346 | rw [boundary, boundary, Preadditive.sum_comp, Φ.map_sum, Preadditive.comp_sum] |
| 347 | refine Finset.sum_congr rfl fun j _ ↦ ?_ |
| 348 | rw [Preadditive.zsmul_comp, Φ.map_zsmul, Preadditive.comp_zsmul, h_reindex] |
| 349 | _ = q (m + 1) ≫ Φ.map (π _) ≫ Φ.map (boundaryFromCoker R m) := by |
| 350 | rw [← Φ.map_comp, proj_comp_boundaryFromCoker] |
| 351 | let k (m : ℕ) : abCoker (boundary R' m) ⟶ Φ.obj (abCoker (boundary R m)) := |
| 352 | abCoker.desc (q m ≫ Φ.map (π _)) |
| 353 | (by simp [reassoc_of% h_bd, ← Φ.map_comp, shortExact_boundaryFromCoker.1]) |
| 354 | have h_cl (n : ℕ) : H.map _ α n ((universalClass hU n).mapExactFunctor Φ) = |
| 355 | push _ (k n) n (universalClass hU' n) := by |
| 356 | induction n with |
| 357 | | zero => |
| 358 | simpa [universalClass_zero, H.map, H.push, mapExactFunctor_mk₀] using |
| 359 | congrArg mk₀ (relFreeAb.hom_ext h_deg_zero) |
| 360 | | succ n ih => |
| 361 | have hS := (shortExact_boundaryFromCoker (R := R) (m := n)).2 |
| 362 | have hS' := (shortExact_boundaryFromCoker (R := R') (m := n)).2 |
| 363 | have h_nat : hS'.extClass.comp (mk₀ (k (n + 1))) rfl = |
| 364 | (mk₀ (k n)).comp (hS.map_of_exact Φ).extClass rfl := |
| 365 | hS'.extClass_naturality (hS.map_of_exact Φ) |
| 366 | ⟨k (n + 1), q n, k n, (cancel_epi (π _)).1 (h_bd n).symm, rfl⟩ |
| 367 | have h_ih : (mk₀ α).comp ((universalClass hU n).mapExactFunctor Φ) n.zero_add = |
| 368 | (universalClass hU' n).comp (mk₀ (k n)) rfl := ih |
| 369 | -- Unfold one splicing step on both sides; `h_nat` moves `k` past the extension class. |
| 370 | simp [universalClass_succ, ← comp_assoc (h₁₂ := n.zero_add), h_ih, h_nat, H.map, H.push, |
| 371 | mapExactFunctor_comp, mapExactFunctor_extClass] |
| 372 | refine ⟨k n ≫ Φ.map y ≫ β, ?_, ?_⟩ |
| 373 | · have h_proj : π (boundary R' n) ≫ k n = q n ≫ Φ.map (π (boundary R n)) := rfl |
| 374 | rw [reassoc_of% h_proj, Φ.map_comp_assoc] |
| 375 | · simpa [H.map, H.push, cocycleClass_apply, mapExactFunctor_comp, mapExactFunctor_mk₀] using |
| 376 | congrArg (H.push _ (Φ.map y ≫ β) n) (h_cl n) |
| 377 | |
| 378 | /-- Pull-back of the class of a cocycle along a comparison `c`. Let `u` map points and `v` map |
| 379 | witnesses so that the relation `R'` goes to `R`, and let `α` be induced by `u`. If the cocycle |
| 380 | `y'` is `y` read through `u` and `v` and followed by the coefficient map of `c`, then the class of |
| 381 | `y` pulls back to the class of `y'`. -/ |
| 382 | lemma pull_cocycleClass (c : Comparison F F') (u : V' ⟶ c.functor ⋙ V) (v : V' ⊗ L' ⟶ c.functor ⋙ L) |
| 383 | (hR : ∀ A : C', ∀ x ∈ R'.obj A, (u.app A x.1, v.app A x) ∈ R.obj (c.functor.obj A)) |
| 384 | {y : abCoker (boundary R n) ⟶ F} {y' : abCoker (boundary R' n) ⟶ F'} |
| 385 | (hy : ∀ (A : C') (t : (witnessed R' n).obj A), |
| 386 | c.coeffHom.app A ((π (boundary R n) ≫ y).app (c.functor.obj A) |
| 387 | (of ⟨(u.app A t.val.1, fun i : Fin n ↦ v.app A (t.val.1, t.val.2 i)), |
| 388 | fun i : Fin n ↦ hR A _ (t.property i)⟩)) = |
| 389 | (π (boundary R' n) ≫ y').app A (of t)) |
| 390 | {α : relFreeAb U' ⟶ c.functor ⋙ relFreeAb U} |
| 391 | (hα : ∀ (A : C') (x : V'.obj A), |
| 392 | α.app A (relFreeAb.mk U' x) = relFreeAb.mk U (u.app A x)) : |
| 393 | c.pull α n (cocycleClass hU y) = cocycleClass hU' y' := by |
| 394 | -- `u` and `v` map a point with witnesses for `R'` to a point with witnesses for `R`. |
| 395 | let q (m : ℕ) : witnessed R' m ⟶ c.functor ⋙ witnessed R m := |
| 396 | { app A := ↾fun t ↦ |
| 397 | ⟨(u.app A t.val.1, fun i ↦ v.app A (t.val.1, t.val.2 i)), fun i ↦ hR A _ (t.property i)⟩ |
| 398 | naturality A B f := by |
| 399 | ext |
| 400 | congrm ⟨($(u.naturality f) _, fun i ↦ $(v.naturality f) (_, _)), _⟩ } |
| 401 | -- On points without witnesses `q 0` is `u`, which induces `α`. |
| 402 | have h_deg_zero (A : C') (x : V'.obj A) : |
| 403 | (α ≫ (restrictAlong c.functor).map (fromRel hU)).app A (relFreeAb.mk U' x) = |
| 404 | (freeAbMap (q 0) ≫ (restrictAlong c.functor).map (π _)).app A |
| 405 | (of ((noWitness R').inv A x)) := by |
| 406 | refine (congrArg _ (hα A x)).trans |
| 407 | (congrArg (fun t ↦ (π (boundary R 0)).app _ (FreeAddCommGroup.of t)) ?_) |
| 408 | exact Subtype.ext (Prod.ext rfl (funext nofun)) |
| 409 | obtain ⟨z, hz, h_coc⟩ := |
| 410 | map_cocycleClass hU hU' (restrictAlong c.functor) c.coeffHom (fun m ↦ freeAbMap (q m)) |
| 411 | h_deg_zero |
| 412 | (fun _ _ _ ↦ hom_ext) y |
| 413 | -- The induced cocycle `z` is `y'`: they agree on generators by `hy`. |
| 414 | obtain rfl : z = y' := (cancel_epi (π _)).1 (hz.trans (hom_ext hy)) |
| 415 | exact h_coc |
| 416 | |
| 417 | end witnessed |
| 418 | |
| 419 | end WitnessCocycles |
| 420 | |
| 421 | /-! |
| 422 | ## Closed classes, dévissage, Čech descent and covers |
| 423 | |
| 424 | * `New.Variety.IsClosedClass`: the class P of functors D → Ab contains 0 and, along a short exact |
| 425 | sequence whose subobject is in P, contains the middle term exactly when it contains the quotient. |
| 426 | * `New.Variety.Devissage`: the five and four lemmas for a family of maps f_{N,n}; |
| 427 | `New.Variety.Comparison.devissage` shows that comparison maps of Ext groups have them. |
| 428 | |
| 429 | `New.Variety.cech p m` is the (m+1)-fold fibre power of `E` over `Y`. |
| 430 | -/ |
| 431 | |
| 432 | section CechDescent |
| 433 | |
| 434 | open CategoryTheory MonoidalCategory Subfunctor ShortComplex CartesianMonoidalCategory witnessed |
| 435 | abCoker cech Function Limits |
| 436 | |
| 437 | variable {C C' D : Type _} [Category C] [Category C'] [Category D] {Y E : D ⥤ Type 1} |
| 438 | (F) (p : E ⟶ Y) {P : D ⥤ Ab → Prop} {A B : (D ⥤ Ab.{1}) → ℕ → Type*} |
| 439 | (f : ∀ (N : D ⥤ Ab) (n : ℕ), A N n → B N n) |
| 440 | |
| 441 | /-! ### Closed classes -/ |
| 442 | |
| 443 | /-- A closed class P of functors D → Ab: (a) P contains every zero functor N (written `𝟙 N = 0`); |
| 444 | (b) for a short exact sequence 0 → X₁ → X₂ → X₃ → 0 with X₁ in P, the middle term X₂ is in P exactly |
| 445 | when the quotient X₃ is. Nothing is asked about X₁ when X₂ and X₃ are in P. -/ |
| 446 | def IsClosedClass (P : (D ⥤ Ab.{1}) → Prop) : Prop := |
| 447 | (∀ N : D ⥤ Ab, 𝟙 N = 0 → P N) ∧ |
| 448 | ∀ S : ShortComplex (CategoryTheory.Functor.{_, 1, _, 2} D Ab), |
| 449 | ShortExact S → P S.X₁ → (P S.X₂ ↔ P S.X₃) |
| 450 | |
| 451 | /-- A closed class P is invariant under isomorphism: for an isomorphism g : M → N, P holds for M |
| 452 | exactly when it holds for N. Proof: apply (b) to 0 → ker g → M → N → 0, whose kernel is zero. -/ |
| 453 | lemma IsClosedClass.iff_of_isIso (hP : IsClosedClass P) {M N : D ⥤ Ab} (g : M ⟶ N) [IsIso g] : |
| 454 | P M ↔ P N := by |
| 455 | obtain ⟨h_zero, h_short⟩ := hP |
| 456 | exact h_short _ ⟨exact_kernel g⟩ (h_zero _ ((isZero_kernel_of_mono g).eq_of_src (𝟙 _) 0)) |
| 457 | |
| 458 | /-- If N is a zero object (its identity is zero), then every group Extⁿ(N, F) has at most one |
| 459 | element. -/ |
| 460 | lemma H.subsingleton_of_id_eq_zero {N : AbFunctor C} (h_id : 𝟙 N = 0) (F : AbFunctor C) (n : ℕ) : |
| 461 | Subsingleton (H N F n) := by |
| 462 | -- every class is its composite with the identity of `N`, which is zero |
| 463 | refine ⟨fun x y ↦ ?_⟩ |
| 464 | rw [← x.mk₀_id_comp, ← y.mk₀_id_comp] |
| 465 | simp [h_id] |
| 466 | |
| 467 | /-- The stepwise four lemma for the family f: along every short exact sequence 0 → X₁ → X₂ → X₃ → 0, |
| 468 | the first r conditions of `New.Variety.BijectiveUpTo` at X₂ and the first r − 1 at X₁ give the first |
| 469 | r at X₃. -/ |
| 470 | structure StepwiseFourLemma where |
| 471 | /-- The first r conditions at X₂ and the first r − 1 at X₁ give the first r at X₃. -/ |
| 472 | bijectiveUpTo_quotient {X : ShortComplex (CategoryTheory.Functor.{_, 1, _, 2} D Ab)} {r : ℕ} : |
| 473 | ShortExact X → BijectiveUpTo (f X.X₂) r → BijectiveUpTo (f X.X₁) (r - 1) → |
| 474 | BijectiveUpTo (f X.X₃) r |
| 475 | |
| 476 | /-! ### Dévissage -/ |
| 477 | |
| 478 | /-- The five and four lemmas for a family of maps f_{N,n} : A N n → B N n, indexed by functors N : |
| 479 | D → Ab and degrees n, as for a map of contravariant δ-functors. In `bijectiveUpTo_quotient`, `r - 1` |
| 480 | is subtraction of natural numbers; for r = 0 there is no condition. -/ |
| 481 | structure Devissage extends StepwiseFourLemma f where |
| 482 | /-- Five lemma: the functors on which `f` is bijective in all degrees form a closed class. -/ |
| 483 | isClosedClass : IsClosedClass (AllBijective <| f ·) |
| 484 | |
| 485 | /-- For a comparison (φ,β) from F to F', exact functors Φ, Φ' and a natural map η: Φ'N → (ΦN)∘φ, |
| 486 | the induced maps Ext^n(ΦN,F) → Ext^n(Φ'N,F') have the five- and four-lemma properties |
| 487 | `New.Variety.Devissage`. -/ |
| 488 | lemma Comparison.devissage {F : AbFunctor C} {F' : AbFunctor C'} (c : Comparison F F') |
| 489 | (Φ : (D ⥤ Ab) ⥤ C ⥤ AddCommGrpCat) {Φ' : (D ⥤ Ab) ⥤ C' ⥤ AddCommGrpCat} |
| 490 | (η : Φ' ⟶ Φ ⋙ restrictAlong c.functor) [IsExactFunctor Φ] [IsExactFunctor Φ'] : |
| 491 | Devissage fun (N : D ⥤ Ab) (n : ℕ) ↦ c.pull (η N) n := by |
| 492 | -- A short exact sequence gives a morphism of long exact sequences; the four and five lemmas |
| 493 | -- `LongExactSeq.Hom.four_lemma` and `LongExactSeq.Hom.five_lemma` apply to it. |
| 494 | have ladder (X : ShortComplex (D ⥤ Ab.{1})) (hX : X.ShortExact) : |
| 495 | (LongExactSeq.contravariant (hX.map_of_exact Φ) F).Hom |
| 496 | (LongExactSeq.contravariant (hX.map_of_exact Φ') F') |
| 497 | (c.pull (X.mapNatTrans η).τ₃) (c.pull (X.mapNatTrans η).τ₂) |
| 498 | (c.pull (X.mapNatTrans η).τ₁) := |
| 499 | c.pull_hom_contravariant (hX.map_of_exact Φ) (hX.map_of_exact Φ') (mapNatTrans X η) |
| 500 | refine |
| 501 | { bijectiveUpTo_quotient := fun hX ↦ (ladder _ hX).four_lemma |
| 502 | isClosedClass := ⟨fun N hN n ↦ ?_, fun X hX ↦ (ladder X hX).five_lemma⟩ } |
| 503 | -- For `N = 0` both cohomology groups are trivial. |
| 504 | have h_sub : Subsingleton (H (Φ.obj N) F n) := |
| 505 | H.subsingleton_of_id_eq_zero (by simp [← Φ.map_id, hN]) F n |
| 506 | have h_sub' : Subsingleton (H (Φ'.obj N) F' n) := |
| 507 | H.subsingleton_of_id_eq_zero (by simp [← Φ'.map_id, hN]) F' n |
| 508 | exact ⟨injective_of_subsingleton _, surjective_to_subsingleton _⟩ |
| 509 | |
| 510 | variable {f} |
| 511 | |
| 512 | /-- The projection from the one-fold fibre power `cech p 0` to E is an isomorphism. -/ |
| 513 | instance : IsIso (proj p 0 0) := |
| 514 | (isoOfAppBijective _ fun _ ↦ |
| 515 | ((Equiv.subtypeUnivEquiv (by simp)).trans (.funUnique (Fin 1) _)).bijective).isIso_hom |
| 516 | |
| 517 | /-- Čech descent, for a family of maps f_{N,n} : A N n → B N n indexed by functors N : D → Ab and |
| 518 | degrees n. Suppose that, in short exact sequences, r conditions of |
| 519 | `New.Variety.BijectiveUpTo` on the middle term and r − 1 on the kernel give r on the quotient. Then |
| 520 | r on Z[E] and r − 1 on all fibre powers of p give r on Z[im p]. -/ |
| 521 | theorem cech_descent_step (h_four : StepwiseFourLemma f) {r : ℕ} |
| 522 | (hE : BijectiveUpTo (f (freeAb E)) r) |
| 523 | (h_cech : ∀ m : ℕ, BijectiveUpTo (f (freeAb (cech p m))) (r - 1)) : |
| 524 | BijectiveUpTo (f (freeAb (range p).toFunctor)) r := by |
| 525 | -- Let `R` relate a point of the image to the points of `E` over it. The points of the image with |
| 526 | -- `m + 1` witnesses for `R` form the fibre power `cech p m`. |
| 527 | let R : Subfunctor ((range p).toFunctor ⊗ E) := |
| 528 | Subfunctor.equalizer (ι ⊤ ≫ snd _ _ ≫ p) (ι ⊤ ≫ fst _ _ ≫ (range p).ι) |
| 529 | -- `e` forgets the point of the image, which is recovered as `p` of the first witness. |
| 530 | let e (m : ℕ) : witnessed R (m + 1) ≅ cech p m := NatIso.ofComponents fun A ↦ Equiv.toIso |
| 531 | { toFun := fun ⟨⟨y, x⟩, h_wit⟩ ↦ ⟨x, fun i j ↦ (h_wit i).2.trans (h_wit j).2.symm⟩ |
| 532 | invFun := fun ⟨x, h_fibre⟩ ↦ |
| 533 | ⟨(⟨p.app A (x 0), x 0, rfl⟩, x), fun i ↦ ⟨⟨⟩, h_fibre i 0⟩⟩ |
| 534 | left_inv := fun ⟨⟨y, x⟩, h_wit⟩ ↦ Subtype.ext (Prod.ext (Subtype.ext (h_wit 0).2) rfl) } |
| 535 | -- The four lemma for the short exact sequence `shortExact_boundaryFromCoker_π`, its last two |
| 536 | -- terms changed by isomorphisms. |
| 537 | have h_four_iso {m k : ℕ} {P K : D ⥤ Ab} (eP : freeAb (witnessed R m) ≅ P) |
| 538 | (eK : abCoker (boundary R m) ≅ K) : |
| 539 | BijectiveUpTo (f P) k → |
| 540 | BijectiveUpTo (f (abCoker (boundary R (m + 1)))) (k - 1) → |
| 541 | BijectiveUpTo (f K) k := by |
| 542 | have h_comp_zero : |
| 543 | (boundaryFromCoker R m ≫ eP.hom) ≫ eP.inv ≫ π (boundary R m) ≫ eK.hom = 0 := by |
| 544 | simp [reassoc_of% boundaryFromCoker_comp_π] |
| 545 | exact h_four.bijectiveUpTo_quotient (X := |
| 546 | ⟨boundaryFromCoker R m ≫ eP.hom, eP.inv ≫ π _ ≫ eK.hom, h_comp_zero⟩) |
| 547 | (shortExact_of_iso (isoMk (.refl (abCoker _)) eP eK) shortExact_boundaryFromCoker_π) |
| 548 | -- By induction on `k`, for all `m` at once: if `k` conditions hold on the fibre powers, they |
| 549 | -- hold on the chains with at least two witnesses modulo boundaries. |
| 550 | have h_cok (k : ℕ) (hk : ∀ m : ℕ, BijectiveUpTo (f (freeAb (cech p m))) k) (m : ℕ) : |
| 551 | BijectiveUpTo (f (abCoker (boundary R (m + 2)))) k := by |
| 552 | induction k generalizing m with |
| 553 | | zero => simp [BijectiveUpTo] |
| 554 | | succ k ih => |
| 555 | exact h_four_iso (freeAb.mapIso (e _)) (.refl _) (hk _) |
| 556 | (ih (by grind [BijectiveUpTo]) _) |
| 557 | -- Every point of the image has a witness, so every chain without witnesses is a boundary and |
| 558 | -- the chains with one witness modulo boundaries are `freeAb` of the image. |
| 559 | have h_zero : π (boundary R 0) = 0 := by |
| 560 | refine freeAb.hom_ext fun A t ↦ proj_boundary_of_eq_zero ?_ |
| 561 | obtain ⟨x, h_px⟩ := t.val.1.property |
| 562 | exact ⟨x, ⟨⟩, h_px⟩ |
| 563 | have h_iso : IsIso (boundaryFromCoker R 0) := |
| 564 | shortExact_boundaryFromCoker_π.isIso_f_iff.2 (.of_epi_eq_zero _ h_zero) |
| 565 | exact h_four_iso (freeAb.mapIso (e 0 ≪≫ asIso (proj p 0 0))) |
| 566 | (asIso (boundaryFromCoker R 0) ≪≫ freeAb.mapIso (noWitness R)) hE (h_cok _ h_cech 0) |
| 567 | |
| 568 | /-- Čech descent: if the maps f obey the five and four lemmas (`New.Variety.Devissage`) and are |
| 569 | bijective in all degrees on ℤ[-] of every fibre power of p: E → Y, E included, then they are so |
| 570 | on ℤ[im p]. -/ |
| 571 | lemma Devissage.allBijective_freeAb_range_of_cech (h_dev : Devissage f) |
| 572 | (h_cech : ∀ m : ℕ, AllBijective (f (freeAb (cech p m)))) : |
| 573 | AllBijective (f (freeAb (range p).toFunctor)) := by |
| 574 | -- the first fibre power `cech p 0` is isomorphic to `E` |
| 575 | have hE : AllBijective (f (freeAb E)) := |
| 576 | (h_dev.isClosedClass.iff_of_isIso (freeAb.map (proj p 0 0))).mp (h_cech 0) |
| 577 | simp only [allBijective_iff_forall_bijectiveUpTo] at hE h_cech ⊢ |
| 578 | exact fun r ↦ cech_descent_step p h_dev.toStepwiseFourLemma (hE r) (h_cech · (r - 1)) |
| 579 | |
| 580 | /-- p: E → Y is a cover for F: the inclusion of the image of p in Y induces bijections on |
| 581 | Ext^n(Z[−],F) for all n. -/ |
| 582 | def IsCover : Prop := IsCohomEquiv F (freeAb.map (Subfunctor.range p).ι) |
| 583 | |
| 584 | /-- If `p` is pointwise surjective, then `IsCover F p` holds for any |
| 585 | `F : AbFunctor D`. -/ |
| 586 | lemma IsPointwiseSurjective.isCover {F : AbFunctor D} (hp : IsPointwiseSurjective p) : |
| 587 | IsCover F p := by |
| 588 | -- `range p` is all of `Y`, so its inclusion is an isomorphism |
| 589 | have : IsIso (range p).ι := (range p).eq_top_iff_isIso.1 (by aesop : range p = ⊤) |
| 590 | exact .of_isIso _ |
| 591 | |
| 592 | end CechDescent |
| 593 | |
| 594 | /-! |
| 595 | ## Pointwise bijections and pull-back squares of set-valued functors |
| 596 | |
| 597 | * `New.Variety.IsCohomEquiv.of_bijective`: a map that is bijective at every object induces |
| 598 | bijections on all `Extⁿ(ℤ[-], F)`. |
| 599 | * `New.Variety.isPullback_iff`: a square is a pull-back exactly when it commutes and is a pull-back |
| 600 | of sets at every object; fibre products and fibre powers give such squares. |
| 601 | -/ |
| 602 | |
| 603 | section BijectiveEquivalence |
| 604 | |
| 605 | open CategoryTheory Limits cech fiberProd Fin |
| 606 | |
| 607 | variable {C : Type _} [Category C] {Y E W V : C ⥤ Type 1} {p : E ⟶ Y} {u : W ⟶ Y} {q : V ⟶ W} |
| 608 | {v : V ⟶ E} |
| 609 | |
| 610 | /-- A map `p : E ⟶ Y` that is bijective at every object is an isomorphism, so `ℤ[E] ⟶ ℤ[Y]` is an |
| 611 | equivalence for every coefficient functor `F`. -/ |
| 612 | lemma IsCohomEquiv.of_bijective {F : AbFunctor C} (hp_bij : AllBijective fun B : C ↦ p B) : |
| 613 | IsCohomEquiv F (freeAb.map p) := |
| 614 | of_isIso (freeAb.map (isoOfAppBijective p hp_bij).hom) |
| 615 | |
| 616 | /-- A square of functors is a pull-back if and only if it commutes and is a pull-back on points at |
| 617 | every object. -/ |
| 618 | @[local simp] |
| 619 | lemma isPullback_iff : |
| 620 | IsPullback v q p u ↔ |
| 621 | (∀ (B : C) (z : V.obj B), p B (v B z) = u B (q B z)) ∧ |
| 622 | ∀ (B : C) (w : W.obj B) (x : E.obj B), |
| 623 | p B x = u B w → ∃! z : V.obj B, q B z = w ∧ v B z = x := by |
| 624 | -- Object by object, a pull-back of sets is a commuting square in which each compatible pair |
| 625 | -- `(x, w)` has a point over it, and at most one. |
| 626 | have h_app : IsPullback v q p u ↔ ∀ B : C, |
| 627 | (∀ z : V.obj B, p B (v B z) = u B (q B z)) ∧ |
| 628 | (∀ z₁ z₂ : V.obj B, v B z₁ = v B z₂ → q B z₁ = q B z₂ → z₁ = z₂) ∧ |
| 629 | ∀ (x : E.obj B) (w : W.obj B), p B x = u B w → ∃ z : V.obj B, v B z = x ∧ q B z = w := by |
| 630 | simp only [IsPullback.iff_app, Types.isPullback_iff, ConcreteCategory.hom_ext_iff, |
| 631 | ConcreteCategory.comp_apply, and_imp] |
| 632 | refine h_app.trans ⟨fun h ↦ ⟨fun B ↦ (h B).1, fun B w x hx ↦ ?_⟩, fun ⟨hc, hu⟩ B ↦ |
| 633 | ⟨hc B, fun z₁ z₂ hv hq ↦ ?_, fun x w hx ↦ ?_⟩⟩ |
| 634 | · obtain ⟨z, hv, hq⟩ := (h B).2.2 x w hx |
| 635 | exact ⟨z, ⟨hq, hv⟩, fun z' ⟨hq', hv'⟩ ↦ (h B).2.1 z' z (hv'.trans hv.symm) (hq'.trans hq.symm)⟩ |
| 636 | · obtain ⟨z, _, huniq⟩ := hu B (q B z₁) (v B z₁) (hc B z₁) |
| 637 | exact (huniq z₁ ⟨rfl, rfl⟩).trans (huniq z₂ ⟨hq.symm, hv.symm⟩).symm |
| 638 | · obtain ⟨z, ⟨hq, hv⟩, _⟩ := hu B w x hx |
| 639 | exact ⟨z, hv, hq⟩ |
| 640 | |
| 641 | /-- The preimage of a subfunctor, with its two natural maps, is a pullback of the inclusion. -/ |
| 642 | lemma isPullback_subfunctor_preimage.{w} {D : Type*} [Category D] {X Z : D ⥤ Type w} |
| 643 | (U : Subfunctor Z) (f : X ⟶ Z) : |
| 644 | IsPullback (U.fromPreimage f) (U.preimage f).ι U.ι f := by |
| 645 | rw [IsPullback.iff_app] |
| 646 | intro B |
| 647 | refine (Types.isPullback_iff ..).mpr ⟨rfl, fun _ _ h ↦ Subtype.ext h.2, ?_⟩ |
| 648 | intro x w (hx : x.val = f.app B w) |
| 649 | exact ⟨⟨w, (hx ▸ x.property : f.app B w ∈ U.obj B)⟩, Subtype.ext hx.symm, rfl⟩ |
| 650 | |
| 651 | /-- The fibre product of `u : W ⟶ Y` and `p : E ⟶ Y` with its two projections is a pull-back |
| 652 | square. -/ |
| 653 | lemma isPullback_fiberProd : IsPullback (snd u p) (fst u p) p u := |
| 654 | isPullback_iff.mpr ⟨fun _ z ↦ z.property.symm, fun _ w x hx ↦ |
| 655 | ⟨⟨(w, x), hx.symm⟩, ⟨rfl, rfl⟩, fun _ ⟨h1, h2⟩ ↦ Subtype.ext (Prod.ext h1 h2)⟩⟩ |
| 656 | |
| 657 | /-- The fibre power with `m + 2` factors is the pull-back of `p` along the fibre power with `m + 1` |
| 658 | factors, by the first coordinate `proj p (m + 1) 0` (`proj p m i` is the `i`-th coordinate map of |
| 659 | `cech p m` to `E`) and the map that drops the first coordinate: a tuple is its first coordinate |
| 660 | together with the remaining ones. -/ |
| 661 | lemma isPullback_cech {m : ℕ} : |
| 662 | IsPullback (Y := cech p m) (proj p (m + 1) 0) |
| 663 | { app _ := ↾fun e ↦ ⟨fun j : Fin (m + 1) ↦ e.val j.succ, by grind⟩ } p (proj p m 0 ≫ p) := by |
| 664 | -- The point over a tuple `a` and a point `x` is the tuple `a` with `x` put in front. |
| 665 | refine isPullback_iff.mpr |
| 666 | ⟨fun _ e ↦ e.property _ _, fun B a x (hx : p.app B x = p.app B (a.val 0)) ↦ ?_⟩ |
| 667 | -- the tuple `x, a 0, …, a m` lies in the fibre power, since all its entries lie over `p x` |
| 668 | let b : Fin (m + 1 + 1) → E.obj B := cons x a.val |
| 669 | have h_b : ∀ i j : Fin (m + 1 + 1), p.app B (b i) = p.app B (b j) := by |
| 670 | simp [b, forall_fin_succ, hx, a.property _ 0] |
| 671 | refine ⟨⟨b, h_b⟩, ⟨rfl, rfl⟩, ?_⟩ |
| 672 | -- it is the only one: a tuple is its first coordinate followed by the others |
| 673 | rintro z ⟨rfl, rfl⟩ |
| 674 | exact Subtype.ext (cons_self_tail z.val).symm |
| 675 | |
| 676 | end BijectiveEquivalence |
| 677 | |
| 678 | /-! ## Bijective comparisons: representable case, fibres, universal points -/ |
| 679 | |
| 680 | section BijectiveComparisons |
| 681 | |
| 682 | open CategoryTheory Abelian Function Functor Subfunctor Ext H IsCohomEquiv ConcreteCategory cech |
| 683 | Arrow BijectiveUpTo sigma IsPointwiseSurjective fiberProd Iso |
| 684 | |
| 685 | variable {C C' C'' : Type 1} [Category C] [Category C'] [Category C''] |
| 686 | {F G N : AbFunctor C} {F' G' N' : AbFunctor C'} {F'' N'' : AbFunctor C''} {Y E : C ⥤ Type 1} |
| 687 | {Y' E' : C' ⥤ Type 1} {r : ℕ} {φ : C' ⥤ C} (c : Comparison F F') {A : C} {B : C'} |
| 688 | (u : Y' ⟶ c.functor ⋙ reprBy A) |
| 689 | |
| 690 | /-! ### Bijective comparisons and representable functors -/ |
| 691 | |
| 692 | /-- For a comparison (φ,β) from F to F' and α: N' → N∘φ, the property that Ext^n(N,F) → |
| 693 | Ext^n(N',F') is bijective for every n. -/ |
| 694 | def Comparison.IsBijective {N : AbFunctor C} {N' : AbFunctor C'} (α : N' ⟶ c.functor ⋙ N) : Prop := |
| 695 | ∀ n : ℕ, Bijective (c.pull (N := N) (N' := N') α n) |
| 696 | |
| 697 | /-- A map α: N → G of functors from C to abelian groups is an equivalence for F if and only if |
| 698 | the identity comparison from F to itself is bijective along α in every degree. -/ |
| 699 | lemma isCohomEquiv_iff_isBijective {α : N ⟶ G} : |
| 700 | IsCohomEquiv F α ↔ (Comparison.id F).IsBijective α := by |
| 701 | simp [IsCohomEquiv, Comparison.IsBijective] |
| 702 | |
| 703 | alias ⟨IsCohomEquiv.bij, Comparison.IsBijective.eqv⟩ := isCohomEquiv_iff_isBijective |
| 704 | |
| 705 | lemma H.push_bijective_of_isIso {γ : F ⟶ G} (hγ : IsIso γ) (n : ℕ) : Bijective (push N γ n) := |
| 706 | bijective_of_isIso ((extFunctorObj N n).map γ) |
| 707 | |
| 708 | lemma pointMap_comp (y : E.obj A) (p : E ⟶ Y) : pointMap y ≫ p = pointMap (p A y) := by |
| 709 | ext |
| 710 | apply p.naturality_apply |
| 711 | |
| 712 | /-- If `Y` is represented by `B` through the point `z`, then `freeAb.obj Y` is projective and |
| 713 | maps from it to `F` are determined bijectively by the image of `z` in `F.obj B`. -/ |
| 714 | lemma projective_and_eval_bijective (F : C ⥤ Ab) {B : C} (z : Y.obj B) |
| 715 | (hz : AllBijective fun A : C ↦ pointMap z A) : |
| 716 | Projective (freeAb Y) ∧ Bijective fun s : freeAb Y ⟶ F ↦ s B (FreeAddCommGroup.of z) := by |
| 717 | -- `Y` is represented by `B`, so both claims come from `reprBy B`, the second by Yoneda |
| 718 | let e : freeAb Y ≅ freeAb (reprBy B) := freeAb.mapIso (isoOfAppBijective _ hz).symm |
| 719 | -- write `z` as `Y.map (𝟙 B) z`, the form in which the Yoneda equivalence returns it |
| 720 | rw [← Y.map_id_apply B z] |
| 721 | exact ⟨e.retract.projective, (e.homFromEquiv.trans (homReprEquiv B F).toEquiv).bijective⟩ |
| 722 | |
| 723 | /-- For a fully faithful functor `ψ : C ⥤ C'` and an object `c`, the functor |
| 724 | `d ↦ (ψ c ⟶ ψ d)` is represented by `c` through the identity of `ψ c`: the point map of the |
| 725 | identity is bijective at every object. -/ |
| 726 | lemma pointMap_id_bijective_of_fullyFaithful (ψ : C ⥤ C') [ψ.Full] [ψ.Faithful] (c : C) : |
| 727 | AllBijective fun d : C ↦ |
| 728 | pointMap (Y := ψ ⋙ reprBy (ψ.obj c)) (A := c) ⟨𝟙 (ψ.obj c)⟩ d := by |
| 729 | intro d |
| 730 | -- on `d` the map sends `f : c ⟶ d` to `𝟙 _ ≫ ψ.map f` |
| 731 | have hψ : Bijective (ψ.map : (c ⟶ d) → _) := ⟨ψ.map_injective, ψ.map_surjective⟩ |
| 732 | exact ULift.map_bijective.mpr ((Iso.refl _).homFromEquiv.bijective.comp hψ) |
| 733 | |
| 734 | namespace Comparison |
| 735 | |
| 736 | /-- For `u : Y' ⟶ c.functor ⋙ reprBy A`, which sends a point `y` of `Y' B` to a map |
| 737 | `A ⟶ c.functor B`, the homomorphism `F A → (ℤ[Y'] ⟶ F')` that sends `x` (via the Yoneda bijection |
| 738 | `homReprEquiv A F : (ℤ[reprBy A] ⟶ F) ≃ F A`) to the section taking `y` to |
| 739 | `c.coeffHom B (F.map (u y) x)`. -/ |
| 740 | noncomputable def homOfValue : F.obj A →+ (freeAb.obj Y' ⟶ F') := |
| 741 | AddMonoidHom.mk' (fun x ↦ freeAbMap u ≫ whiskerLeft c.functor ((homReprEquiv A F).symm x) ≫ |
| 742 | c.coeffHom) |
| 743 | (by bound) |
| 744 | |
| 745 | variable {c} {c' : Comparison F' F''} {α : N' ⟶ c.functor ⋙ N} {α' : N'' ⟶ c'.functor ⋙ N'} |
| 746 | |
| 747 | /-- Let c, c' be comparisons from F to F' and F' to F'', with c' bijective in all degrees along α'. |
| 748 | Then c is bijective along α exactly if the composite comparison is bijective along γ, the composite |
| 749 | of α' with α whiskered by `c'.functor`. -/ |
| 750 | lemma IsBijective.trans_iff (h_bij' : c'.IsBijective α') {γ : N'' ⟶ c'.functor ⋙ c.functor ⋙ N} |
| 751 | (hγ : α' ≫ whiskerLeft c'.functor α = γ) : |
| 752 | (c.trans c').IsBijective γ ↔ c.IsBijective α := by |
| 753 | -- in each degree the composite comparison is that of `c` followed by a bijection |
| 754 | simp [IsBijective, ← (h_bij' _).of_comp_iff', comp_def, pull_trans, hγ] |
| 755 | |
| 756 | /-- Bijective comparisons compose: if `c` is bijective along `α` and `c'` along `α'`, the composite |
| 757 | comparison is bijective along the composite `γ` of `α'` with `α` whiskered by `c'.functor`. -/ |
| 758 | lemma IsBijective.trans (h_bij : c.IsBijective α) (h_bij' : c'.IsBijective α') |
| 759 | {γ : N'' ⟶ c'.functor ⋙ c.functor ⋙ N} (hγ : α' ≫ whiskerLeft c'.functor α = γ) : |
| 760 | (c.trans c').IsBijective γ := |
| 761 | (h_bij'.trans_iff hγ).mpr h_bij |
| 762 | |
| 763 | /-- Let `γ : F ⟶ G` and `γ' : F' ⟶ G'` be isomorphisms of coefficient functors. Let |
| 764 | `β : c.functor ⋙ G ⟶ G'` satisfy `β ∘ γ = γ' ∘ c.coeffHom`. Then `c` is bijective along `α` in all |
| 765 | degrees if and only if the comparison `(c.functor, β)` from `G` to `G'` is. -/ |
| 766 | lemma isBijective_iff_of_coeff_iso {β : c.functor ⋙ G ⟶ G'} (γ : F ⟶ G) (γ' : F' ⟶ G') [IsIso γ] |
| 767 | [IsIso γ'] (w : whiskerLeft c.functor γ ≫ β = c.coeffHom ≫ γ') : |
| 768 | c.IsBijective α ↔ IsBijective ⟨c.functor, β⟩ α := by |
| 769 | -- the two comparisons differ by the maps induced by `γ` and `γ'`, which are bijective |
| 770 | simp [IsBijective, bijective_iff_of_comm_sq (c.pull_push β γ γ' w _), push_bijective_of_isIso] |
| 771 | |
| 772 | lemma homOfValue_app (x : F.obj A) (B : C') (y : Y'.obj B) : |
| 773 | c.homOfValue u x B (FreeAddCommGroup.of y) = c.coeffHom B (F.map (u B y).down x) := by |
| 774 | -- by definition the left side is `c.coeffHom B` applied to `F.map (u B y).down x + 0` |
| 775 | rw [← add_zero (F.map (u B y).down x)] |
| 776 | rfl |
| 777 | |
| 778 | attribute [instance] subsingleton_of_projective |
| 779 | |
| 780 | variable {u} |
| 781 | |
| 782 | /-- For `u : Y' ⟶ c.functor ⋙ reprBy A`, the comparison `Hⁿ(ℤ[reprBy A], F) → Hⁿ(ℤ[Y'], F')` is |
| 783 | bijective for all `n` if and only if `c.homOfValue u : F A → (ℤ[Y'] ⟶ F')` is bijective and |
| 784 | `Hⁿ(ℤ[Y'], F') = 0` for all `n ≥ 1`. -/ |
| 785 | lemma isBijective_reprBy_iff : |
| 786 | c.IsBijective (freeAbMap u) ↔ |
| 787 | Bijective (c.homOfValue u) ∧ ∀ n : ℕ, Subsingleton (H (freeAb Y') F' (n + 1)) := by |
| 788 | -- treat degree zero and the positive degrees separately |
| 789 | refine Nat.and_forall_add_one.symm.trans (.and ?_ (forall_congr' fun n ↦ ?_)) |
| 790 | · -- in degree zero the classes are morphisms, and the comparison is `c.homOfValue u` by Yoneda |
| 791 | let e : H (freeAb.obj (reprBy A)) F 0 ≃ F.obj A := homEquiv₀.trans (homReprEquiv A F).toEquiv |
| 792 | have h_square (x : F.obj A) : c.pull (freeAbMap u) 0 (e.symm x) = mk₀ (c.homOfValue u x) := by |
| 793 | simp [e, pull, H.map, H.push, mapExtAddHom, mapExactFunctor_mk₀, homOfValue] |
| 794 | exact (bijective_iff_of_comm_sq h_square e.symm.bijective (mk₀_bijective ..)).symm |
| 795 | · -- in positive degree the source vanishes, as `freeAb.obj (reprBy A)` is projective |
| 796 | exact ⟨fun h ↦ h.surjective.subsingleton, |
| 797 | fun h ↦ ⟨injective_of_subsingleton _, fun y ↦ ⟨0, h.allEq _ y⟩⟩⟩ |
| 798 | |
| 799 | /-- Let `Y'` be represented by `B` through the point `z`, and let `u z : A ⟶ φ B` (the map under |
| 800 | `ULift`). If `c.coeffHom B ∘ F.map (u z) : F A → F' B` is bijective, the comparison along `u` is |
| 801 | bijective in all degrees. -/ |
| 802 | lemma isBijective_of_repr (z : Y'.obj B) (hz : AllBijective fun D : C' ↦ pointMap z D) |
| 803 | (h_coeff : Bijective fun x : F.obj A ↦ c.coeffHom B (F.map (u B z).down x)) : |
| 804 | c.IsBijective (freeAbMap u) := by |
| 805 | obtain ⟨h_proj, h_eval⟩ := projective_and_eval_bijective F' z hz |
| 806 | -- sections on `Y'` are read at the point `z`, which turns `c.homOfValue u` into `h_coeff` |
| 807 | have h_hom : Bijective (c.homOfValue u) := by |
| 808 | rw [← h_eval.of_comp_iff'] |
| 809 | simpa [comp_def, homOfValue_app] using h_coeff |
| 810 | -- the higher groups vanish, as `freeAb Y'` is projective |
| 811 | exact isBijective_reprBy_iff.mpr ⟨h_hom, fun n ↦ inferInstance⟩ |
| 812 | |
| 813 | end Comparison |
| 814 | |
| 815 | end BijectiveComparisons |
| 816 | |
| 817 | section ComparisonDescent |
| 818 | |
| 819 | open CategoryTheory Abelian Function Functor Subfunctor Ext H IsCohomEquiv ConcreteCategory cech |
| 820 | Arrow BijectiveUpTo sigma IsPointwiseSurjective fiberProd Iso |
| 821 | |
| 822 | variable {C C' : Type 1} [Category C] [Category C'] {F : AbFunctor C} {F' : AbFunctor C'} |
| 823 | {Y E : C ⥤ Type 1} {Y' E' : C' ⥤ Type 1} {r : ℕ} {φ : C' ⥤ C} {c : Comparison F F'} |
| 824 | {u : Y' ⟶ c.functor ⋙ Y} {v : E' ⟶ c.functor ⋙ E} {p : E ⟶ Y} {p' : E' ⟶ Y'} |
| 825 | |
| 826 | namespace Comparison |
| 827 | |
| 828 | /-- If the comparison is bijective along `u` and `p' : E' ⟶ Y'` is bijective at every object, |
| 829 | then it is bijective along `v = p' ≫ u`. -/ |
| 830 | lemma IsBijective.precomp_of_bijective (h_bij : c.IsBijective (freeAbMap u)) |
| 831 | {v : E' ⟶ c.functor ⋙ Y} |
| 832 | (p' : E' ⟶ Y') (w : p' ≫ u = v) (hp' : AllBijective fun B : C' ↦ p' B) : |
| 833 | c.IsBijective (freeAbMap v) := by |
| 834 | -- a bijection `p'` is an equivalence; compose its comparison with that along `u` |
| 835 | subst w |
| 836 | exact h_bij.trans (of_bijective hp').bij (freeAb.hom_ext fun _ _ ↦ rfl) |
| 837 | |
| 838 | /-! ### Descent: covers and fibres -/ |
| 839 | |
| 840 | /-- The Čech step. Let `p : E ⟶ Y` and `p' : E' ⟶ Y'` be covers for `F` and `F'`, and let |
| 841 | `v : E' ⟶ c.functor ⋙ E` lift `u : Y' ⟶ c.functor ⋙ Y` to them (`w : p' ≫ u = v ≫ p`). Suppose that |
| 842 | (a) the comparison along `v` is bijective in all degrees and (b) on every fibre power `cech p m` |
| 843 | (`m + 1` factors) the comparison along the map `cech p' m ⟶ c.functor ⋙ cech p m` induced by |
| 844 | `(v, u)` satisfies the first `r - 1` conditions of `New.Variety.BijectiveUpTo`. Then the comparison |
| 845 | along `u` satisfies the first `r`. -/ |
| 846 | lemma bijectiveUpTo_of_cech_pred (w : p' ≫ u = v ≫ c.functor.whiskerLeft p) (hp : IsCover F p) |
| 847 | (hp' : IsCover F' p') (hv : c.IsBijective (freeAbMap v)) |
| 848 | (h_cech : ∀ m : ℕ, BijectiveUpTo (fun n : ℕ ↦ c.pull (freeAbMap (Y := cech p m) |
| 849 | (Y' := cech p' m) ((cechFunctor m).map (homMk' v u w.symm))) n) (r - 1)) : |
| 850 | BijectiveUpTo (fun n : ℕ ↦ c.pull (freeAbMap u) n) r := by |
| 851 | -- The map of covers `(v, u)`, seen as a map of functors to arrows, lets every functor `N` on |
| 852 | -- arrows be evaluated on `p` and on `p'`, with a map `τ N` between the results. |
| 853 | let τ : |
| 854 | (whiskeringLeft _ _ Ab).obj (toArrowFunctor (.mk p')) ⟶ |
| 855 | (whiskeringLeft _ _ Ab).obj (toArrowFunctor (.mk p)) ⋙ restrictAlong c.functor := |
| 856 | (whiskeringLeft _ _ Ab).map (toArrowFunctor.map (homMk' v u w.symm)) |
| 857 | -- The comparisons along `τ` obey the four lemma (`Comparison.devissage`), so Čech descent for the |
| 858 | -- universal map `leftToRight` on the category of arrows gives the claim for the images of `p'` |
| 859 | -- and `p`. |
| 860 | have h_range : |
| 861 | BijectiveUpTo (fun n : ℕ ↦ c.pull (τ (freeAb (range leftToRight).toFunctor)) n) r := |
| 862 | cech_descent_step leftToRight (c.devissage _ τ).toStepwiseFourLemma |
| 863 | (allBijective_iff_forall_bijectiveUpTo.mp hv r) h_cech |
| 864 | -- The images have the same cohomology as `Y'` and `Y`. |
| 865 | have h_comm : freeAb.map (range p').ι ≫ freeAbMap u = |
| 866 | τ (freeAb (range leftToRight).toFunctor) ≫ |
| 867 | whiskerLeft c.functor (freeAb.map (range p).ι) := |
| 868 | freeAb.hom_ext fun _ _ ↦ rfl |
| 869 | exact (BijectiveUpTo.congr hp hp' (map_pull_eq_pull_map h_comm)).mpr h_range |
| 870 | |
| 871 | /-- Let `v : E' ⟶ c.functor ⋙ E`, with `p' : E' ⟶ Y'`, be the pull-back of `u` along `t`. If the |
| 872 | comparison is bijective along the projection of the fibre of `u` over every point `t x`, then it is |
| 873 | bijective along the projection of the fibre of `v` over every point `x` of `E A`. -/ |
| 874 | private lemma isBijective_snd_fiber_of_isPullback (t : E ⟶ Y) |
| 875 | (h_pb : IsPullback v p' (c.functor.whiskerLeft t) u) |
| 876 | (h_fibre : ∀ (A : C) (x : E.obj A), |
| 877 | c.IsBijective (freeAbMap (snd u (whiskerLeft c.functor (pointMap (t A x)))))) |
| 878 | (A : C) (x : E A) : |
| 879 | c.IsBijective (freeAbMap (snd v (whiskerLeft _ (pointMap x)))) := by |
| 880 | have h_fibre_tx : c.IsBijective (freeAbMap (snd u (whiskerLeft _ (pointMap x ≫ t)))) := by |
| 881 | rw [pointMap_comp x t] |
| 882 | exact h_fibre A x |
| 883 | let i : c.functor ⋙ reprBy A ⟶ c.functor ⋙ E := whiskerLeft c.functor (pointMap x) |
| 884 | have h_pasted : IsPullback (snd v i) (fst v i ≫ p') (i ≫ whiskerLeft c.functor t) u := |
| 885 | isPullback_fiberProd.paste_vert h_pb |
| 886 | exact h_fibre_tx.precomp_of_bijective _ |
| 887 | (h_pasted.isoIsPullback_hom_fst _ _ isPullback_fiberProd) |
| 888 | fun B ↦ (Iso.app _ B).toEquiv.bijective |
| 889 | |
| 890 | /-- Let `u : Y' ⟶ c.functor ⋙ Y` and `t : E ⟶ Y`, and let `v : E' ⟶ c.functor ⋙ E`, with |
| 891 | `p' : E' ⟶ Y'`, be the pull-back of `u` along `t`. Suppose that for every point `x` of `E A` the |
| 892 | comparison is bijective in all degrees along the projection to `c.functor ⋙ reprBy A` of the fibre |
| 893 | product of `u` with the point `reprBy A ⟶ Y` given by `t x`. Then it is bijective along `v`. -/ |
| 894 | lemma isBijective_of_fibers (t : E ⟶ Y) (h_pb : IsPullback v p' (c.functor.whiskerLeft t) u) |
| 895 | (h_fibre : ∀ (A : C) (x : E.obj A), |
| 896 | c.IsBijective (freeAbMap (snd u (whiskerLeft c.functor (pointMap (t A x)))))) : |
| 897 | c.IsBijective (freeAbMap v) := by |
| 898 | -- Induction on the number `r` of conditions, for all base changes at once, by Čech descent |
| 899 | -- along the cover `q` of `E` by the representable functors of all its points and the cover `q'` |
| 900 | -- of `E'` by the fibres of `v` over these points. |
| 901 | refine allBijective_iff_forall_bijectiveUpTo.mpr fun r ↦ ?_ |
| 902 | induction r generalizing Y Y' E E' with |
| 903 | | zero => simp [BijectiveUpTo] |
| 904 | | succ r ih => |
| 905 | -- The fibre of `v` over `x` is the fibre of `u` over `t x`, by pasting of pull-backs. |
| 906 | have h_fib := isBijective_snd_fiber_of_isPullback t h_pb h_fibre |
| 907 | let repr (x : E.Elements) : C ⥤ Type 1 := reprBy x.obj |
| 908 | let fib (x : E.Elements) : C' ⥤ Type 1 := fiberProd v (whiskerLeft _ (pointMap x.val)) |
| 909 | let q : sigma repr ⟶ E := desc fun x ↦ pointMap x.val |
| 910 | let q' : sigma fib ⟶ E' := desc fun x ↦ fst v (whiskerLeft _ (pointMap x.val)) |
| 911 | have hq : IsPointwiseSurjective q := fun A y ↦ ⟨⟨⟨y⟩, ⟨𝟙 A⟩⟩, E.map_id_apply A y⟩ |
| 912 | -- a point `y` of `E'` is hit by the point `(y, 𝟙)` of the fibre of `v` over `v y` |
| 913 | have hq' : IsPointwiseSurjective q' := fun B y ↦ |
| 914 | ⟨⟨⟨v B y⟩, (y, ⟨𝟙 _⟩), (E.map_id_apply ..).symm⟩, rfl⟩ |
| 915 | -- On the disjoint unions the comparison is the product of the bijections `h_fib` |
| 916 | -- (`sigma_bijective`: cohomology turns disjoint unions into products). |
| 917 | let v₁ : sigma fib ⟶ c.functor ⋙ sigma repr := |
| 918 | desc fun x ↦ snd v (whiskerLeft _ (pointMap x.val)) ≫ whiskerLeft _ (ι repr x) |
| 919 | have hv₁ : c.IsBijective (freeAbMap v₁) := by |
| 920 | intro n |
| 921 | refine (bijective_iff_of_comm_sq (fun z ↦ funext fun x ↦ (map_pull_eq_pull_map ?_ n z).symm) |
| 922 | (sigma_bijective ..) (sigma_bijective ..)).mpr (.piMap fun x ↦ h_fib x.obj x.val n) |
| 923 | -- on the summand `x`, the map `v₁` is the second projection of the fibre over `x` |
| 924 | exact freeAb.hom_ext fun _ _ ↦ rfl |
| 925 | have h_sq : q' ≫ v = v₁ ≫ whiskerLeft _ q := by |
| 926 | -- a point of a fibre product has the same image under both of its projections |
| 927 | ext B ⟨x, ⟨_, h_lies⟩⟩ |
| 928 | exact h_lies |
| 929 | -- The map of the fibre powers is a base change of `v`, so `ih` applies to it. |
| 930 | have h_cech_pullback (m : ℕ) : |
| 931 | IsPullback ((cechFunctor m).map (homMk' v₁ v h_sq.symm)) (proj q' m 0 ≫ q') |
| 932 | (c.functor.whiskerLeft (proj q m 0 ≫ q)) v := by |
| 933 | refine isPullback_iff.mpr |
| 934 | ⟨fun B z ↦ (z.val 0).snd.property.symm, fun B y g hg ↦ ⟨?_, ?_, ?_⟩⟩ |
| 935 | · -- over a point `y` of `E'` and a tuple `g` lies the tuple that puts `y` beside each |
| 936 | -- `g i`: each `g i` has the image of `g 0` in `E`, which is `v y` |
| 937 | exact ⟨fun i ↦ ⟨(g.val i).fst, (y, (g.val i).snd), hg.symm.trans (g.property 0 i)⟩, |
| 938 | fun _ _ ↦ rfl⟩ |
| 939 | · -- this tuple lies over `y` and over `g` |
| 940 | exact ⟨rfl, rfl⟩ |
| 941 | · -- it is the only one: the points of `E'` in a tuple of the fibre power are all equal |
| 942 | rintro z ⟨⟨⟩, ⟨⟩⟩ |
| 943 | refine Subtype.ext (funext fun i ↦ ?_) |
| 944 | exact Sigma.ext rfl (heq_of_eq (Subtype.ext (Prod.ext (z.property i 0) rfl))) |
| 945 | exact bijectiveUpTo_of_cech_pred h_sq hq.isCover hq'.isCover hv₁ fun m ↦ |
| 946 | ih (proj q m 0 ≫ q) (h_cech_pullback m) fun A z ↦ h_fib A _ |
| 947 | |
| 948 | /-! ### Universal points -/ |
| 949 | |
| 950 | variable (c u) in |
| 951 | /-- Let `u : Y' ⟶ c.functor ⋙ Y` and let `y` be a point of `Y A`. A pair `(z, f)` of a point `z` of |
| 952 | `Y' D` and a map `f : A ⟶ c.functor D` lies over `y` if `u z = f y`. The pair `(x, s)` over `B` is a |
| 953 | universal point if it is universal among these pairs, so that `B` represents the fibre of `u` over |
| 954 | `y`, and the coefficients `F A` and `F' B` agree along `s`. -/ |
| 955 | structure IsUnivPoint {A : C} (y : Y.obj A) {B : C'} (x : Y'.obj B) (s : A ⟶ c.functor.obj B) : |
| 956 | Prop where |
| 957 | /-- The pair `(x, s)` lies over `y`. -/ |
| 958 | apply_eq_map : u B x = Y.map s y |
| 959 | /-- Every pair `(z, f)` that lies over `y` comes from `(x, s)` by exactly one map `g`. -/ |
| 960 | existsUnique_hom (D : C') (z : Y'.obj D) (f : A ⟶ c.functor.obj D) (hz : u D z = Y.map f y) : |
| 961 | ∃! g : B ⟶ D, Y'.map g x = z ∧ s ≫ c.functor.map g = f |
| 962 | /-- The map `F A → F (c.functor B) → F' B` on coefficients is bijective. -/ |
| 963 | coeff_bijective : Bijective fun a : F.obj A ↦ c.coeffHom B (F.map s a) |
| 964 | |
| 965 | variable (c u) in |
| 966 | /-- The map `u : Y' ⟶ c.functor ⋙ Y` has universal points: over every point of `Y` there is a |
| 967 | universal point (`New.Variety.Comparison.IsUnivPoint`), at which the coefficients agree. -/ |
| 968 | def HasUniversalPoints : Prop := |
| 969 | ∀ (A : C) (y : Y.obj A), ∃ (B : C') (x : Y'.obj B) (s : A ⟶ c.functor.obj B), |
| 970 | c.IsUnivPoint u y x s |
| 971 | |
| 972 | /-- If u: Y' → Y∘φ has universal points (`New.Variety.Comparison.HasUniversalPoints`), then for |
| 973 | every t: E → Y the comparison is bijective in all degrees along the pull-back v: E' → E∘φ of u along |
| 974 | t, with p': E' → Y'. Indeed, for every point y of E the fibre of v over y is the fibre of u over |
| 975 | t y, which is represented by a universal point over t y. -/ |
| 976 | lemma HasUniversalPoints.isBijective_of_isPullback (h_points : c.HasUniversalPoints u) |
| 977 | (p' : E' ⟶ Y') (t : E ⟶ Y) (h_pb : IsPullback v p' (c.functor.whiskerLeft t) u) : |
| 978 | c.IsBijective (freeAbMap v) := by |
| 979 | -- The fibre of `u` over `t y` is represented by the universal point `(x, f)`. |
| 980 | refine isBijective_of_fibers t h_pb fun A y ↦ ?_ |
| 981 | obtain ⟨B, x, f, h_univ⟩ : |
| 982 | ∃ (B : C') (x : Y'.obj B) (f : A ⟶ c.functor.obj B), c.IsUnivPoint u (t A y) x f := |
| 983 | h_points A (t A y) |
| 984 | refine isBijective_of_repr ⟨(x, ⟨f⟩), h_univ.apply_eq_map⟩ |
| 985 | (fun D ↦ (bijective_iff_existsUnique _).mpr fun z ↦ ?_) h_univ.coeff_bijective |
| 986 | -- A point `z` of the fibre comes from `(x, f)` by exactly one map `B ⟶ D`. |
| 987 | refine (Equiv.ulift.existsUnique_congr fun g ↦ ⟨?_, ?_⟩).mpr |
| 988 | (h_univ.existsUnique_hom D _ _ z.property) |
| 989 | · -- the map `g` carries the universal point to its image |
| 990 | rintro rfl |
| 991 | exact ⟨rfl, rfl⟩ |
| 992 | · -- the two equations determine the point of the fibre |
| 993 | rintro ⟨h_map, h_comp⟩ |
| 994 | exact Subtype.ext (Prod.ext h_map (ULift.down_injective h_comp)) |
| 995 | |
| 996 | /-- If there are universal points on which the coefficients agree, the comparison along `u` is |
| 997 | bijective in all degrees. -/ |
| 998 | lemma HasUniversalPoints.isBijective (h_points : c.HasUniversalPoints u) : |
| 999 | c.IsBijective (freeAbMap u) := |
| 1000 | h_points.isBijective_of_isPullback _ (𝟙 _) .of_id_snd |
| 1001 | |
| 1002 | /-- If the comparison c has universal points for u: Y' → Y∘φ |
| 1003 | (`New.Variety.Comparison.HasUniversalPoints`), then for every subfunctor U of Y the comparison is |
| 1004 | bijective in all degrees along the restricted map u⁻¹(U∘φ) → U∘φ. -/ |
| 1005 | lemma HasUniversalPoints.isBijective_subfunctor (h_points : c.HasUniversalPoints u) |
| 1006 | (U : Subfunctor Y) : |
| 1007 | c.IsBijective (freeAbMap (Y := toFunctor U) ((U.whisker c.functor).fromPreimage u)) := |
| 1008 | h_points.isBijective_of_isPullback (Subfunctor.ι _) U.ι |
| 1009 | (isPullback_subfunctor_preimage (U.whisker c.functor) u) |
| 1010 | |
| 1011 | /-- With universal points, a subfunctor `U` of `Y` has the cohomology of `Y` for `F` if and only |
| 1012 | if its preimage `S` in `Y'` has the cohomology of `Y'` for `F'`. -/ |
| 1013 | lemma HasUniversalPoints.isCohomEquiv_incl_iff (h_points : c.HasUniversalPoints u) |
| 1014 | (U : Subfunctor Y) {S : Subfunctor Y'} (hS : S = (U.whisker c.functor).preimage u) : |
| 1015 | IsCohomEquiv F (freeAb.map U.ι) ↔ IsCohomEquiv F' (freeAb.map S.ι) := by |
| 1016 | subst hS |
| 1017 | -- the comparison is bijective on `Y` and on `U`, and commutes with the two restrictions |
| 1018 | have h_comm : freeAb.map ((U.whisker c.functor).preimage u).ι ≫ freeAbMap u = |
| 1019 | freeAbMap ((U.whisker c.functor).fromPreimage u) ≫ whiskerLeft c.functor (freeAb.map U.ι) := |
| 1020 | freeAb.hom_ext fun _ _ ↦ rfl |
| 1021 | exact forall_congr' fun n ↦ bijective_iff_of_comm_sq (map_pull_eq_pull_map h_comm n) |
| 1022 | (h_points.isBijective n) (h_points.isBijective_subfunctor U n) |
| 1023 | |
| 1024 | /-- For an adjunction `φ ⊣ U`, restriction along `U` followed by the counit identifies the |
| 1025 | cohomology of `Y'` with coefficients `φ ⋙ F` and that of `U ⋙ Y'` with coefficients `F`. -/ |
| 1026 | lemma isBijective_of_adj {U : C ⥤ C'} (a : φ ⊣ U) : |
| 1027 | IsBijective (F := φ ⋙ F) ⟨U, whiskerRight a.counit F⟩ (freeAbMap (𝟙 (U ⋙ Y'))) := by |
| 1028 | -- Over `y` in `Y' A` the universal point is the image of `y` under the unit `A ⟶ U (φ A)`. |
| 1029 | refine HasUniversalPoints.isBijective fun A y ↦ |
| 1030 | ⟨φ.obj A, Y'.map (a.unit.app A) y, a.unit.app A, rfl, fun D z f hz ↦ ?_, ?_⟩ |
| 1031 | · -- by adjunction `f : A ⟶ U D` factors through the unit by a unique `g : φ A ⟶ D` |
| 1032 | obtain ⟨g, rfl, h_uniq⟩ : ∃! g : φ.obj A ⟶ D, a.unit.app A ≫ U.map g = f := |
| 1033 | (a.homEquiv A D).bijective.existsUnique f |
| 1034 | -- and this `g` carries the universal point to `z = f y` |
| 1035 | exact ⟨g, ⟨by simpa using hz.symm, rfl⟩, fun g' ⟨_, h_comp⟩ ↦ h_uniq g' h_comp⟩ |
| 1036 | · -- the map on coefficients is the identity, by the triangle identity |
| 1037 | have h_triangle (x : F.obj (φ.obj A)) : |
| 1038 | F.map (a.counit.app (φ.obj A)) (F.map (φ.map (a.unit.app A)) x) = x := by |
| 1039 | simp [← F.map_comp_apply] |
| 1040 | exact bijective_iff_has_inverse.mpr ⟨fun x ↦ x, h_triangle, h_triangle⟩ |
| 1041 | |
| 1042 | /-- If `p` and `p'` are equivalences for `F` and `F'` and `v` lifts `u` along them |
| 1043 | (`w : p' ≫ u = v ≫ p`), the comparisons along `u` and along `v` satisfy the same conditions of |
| 1044 | `New.Variety.BijectiveUpTo`. -/ |
| 1045 | lemma bijectiveUpTo_congr (w : p' ≫ u = v ≫ c.functor.whiskerLeft p) |
| 1046 | (hp_equiv : IsCohomEquiv F (freeAb.map p)) (hp'_equiv : IsCohomEquiv F' (freeAb.map p')) : |
| 1047 | BijectiveUpTo (fun n : ℕ ↦ c.pull (freeAbMap u) n) r ↔ |
| 1048 | BijectiveUpTo (fun n : ℕ ↦ c.pull (freeAbMap v) n) r := |
| 1049 | BijectiveUpTo.congr hp_equiv hp'_equiv (map_pull_eq_pull_map (freeAb.map_commSq ⟨w⟩).w) |
| 1050 | |
| 1051 | /-- If `p` and `p'` are equivalences for `F` and `F'` and `v` lifts `u` along them |
| 1052 | (`w : p' ≫ u = v ≫ p`), the comparison is bijective along `u` if and only if it is along `v`. -/ |
| 1053 | lemma isBijective_congr (w : p' ≫ u = v ≫ c.functor.whiskerLeft p) |
| 1054 | (hp_equiv : IsCohomEquiv F (freeAb.map p)) (hp'_equiv : IsCohomEquiv F' (freeAb.map p')) : |
| 1055 | c.IsBijective (freeAbMap u) ↔ c.IsBijective (freeAbMap v) := by |
| 1056 | exact forall_congr' fun n ↦ |
| 1057 | bijective_iff_of_comm_sq (fun x ↦ (map_pull_eq_pull_map (freeAb.map_commSq ⟨w⟩).w n x).symm) |
| 1058 | (hp_equiv n) (hp'_equiv n) |
| 1059 | |
| 1060 | end Comparison |
| 1061 | |
| 1062 | end ComparisonDescent |
| 1063 | |
| 1064 | end New.Variety |
| 1065 | |
| 1066 | end |