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 | import Mathlib.RingTheory.Unramified.LocalStructure |
| 4 | public import Lib.Cohomology.ProjectiveLine.ConstantLineFormula |
| 5 | public import Lib.PadicComparison.Duality.GoodPairs |
| 6 | import Lib.Cohomology.Etale.DenseSubfunctors |
| 7 | |
| 8 | /-! |
| 9 | # Charted varieties, and smooth base change from a valuation ring to its fraction field |
| 10 | |
| 11 | From local charts to whole varieties, for cohomology computed on test rings. |
| 12 | |
| 13 | * `New.Variety.algToBaseChange`, `New.Variety.isBijective_algToBaseChange`: the cohomology of the |
| 14 | base change `Y_A` on all test rings agrees with that of `Y` on tests over `A` |
| 15 | (`New.Variety.TestOver`). |
| 16 | * `New.Variety.ComparedTheory.mem_of_isClosedClass_of_isCharting`: a class of functors governed by |
| 17 | `New.Variety.ComparedTheory.IsFiniteLerayHirsch` that contains the point contains every functor |
| 18 | charted by pieces étale over tori (`New.Variety.IsCharting`). |
| 19 | * `New.Variety.isTestCohomEquiv_baseChangeTransition`: let `A` be a valuation ring of an algebraic |
| 20 | closure `Ω` of `ℚ`, of residue characteristic `p ≠ ℓ`, and let `Y` be charted; then the mod `ℓ` |
| 21 | cohomology of `Y_A` and of `Y_Ω` agree. |
| 22 | |
| 23 | `D.IsFiniteLerayHirsch N` says that the cohomology of `N` with locally constant `ZMod ℓ` |
| 24 | coefficients is finite and computes that of the theory `D`. The functor |
| 25 | `relFreeAb (offClosedFiber X)` is `ℤ[X] / ℤ[U]`, where `U` consists of the points over the tests in |
| 26 | which the maximal ideal of `A` generates the unit ideal. |
| 27 | |
| 28 | Notions from other files: |
| 29 | * `New.Variety.freeAb`: The functor sending a set-valued functor Y to Z[Y], whose value at A is the |
| 30 | free abelian group on Y(A). |
| 31 | * `New.Variety.IsClosedClass`: A closed class P of functors D → Ab: (a) P contains every zero |
| 32 | functor N (written `𝟙 N = 0`); (b) for a short exact sequence 0 → X₁ → X₂ → X₃ → 0 with X₁ in P, |
| 33 | the middle term X₂ is in P exactly when the quotient X₃ is. |
| 34 | * `New.Variety.geomPoints`: The functor of points of the base change `X ×_R Ω` of a scheme `X` over |
| 35 | `R`. |
| 36 | |
| 37 | ## Relation to the literature |
| 38 | |
| 39 | Known result: Smooth base change, with restriction to the generic fibre bijective on cohomology. |
| 40 | Here it is proved for schemes that are covered by finitely many pieces étale over tori and are not |
| 41 | assumed proper. The base is the valuation ring of a place above p of an algebraic closure of Q, the |
| 42 | coefficients are the constant F_ℓ with ℓ invertible, and the result is deduced from proper base |
| 43 | change and duality on products of projective lines. Source: Artin, SGA 4 Exp. XV 2.1, XVI 1.2 |
| 44 | (1973); Stacks Project Tag 0EYQ; for the route through the class of the diagonal, Zavyalov, Poincaré |
| 45 | duality in abstract 6-functor formalisms (arXiv 2301.03821) and Li-Reinecke-Zavyalov (arXiv |
| 46 | 2410.08200). |
| 47 | -/ |
| 48 | |
| 49 | @[expose] public section |
| 50 | |
| 51 | namespace New.Variety |
| 52 | |
| 53 | open CategoryTheory AlgebraicGeometry ObjectProperty Function Ideal nonZeroDivisors Algebra |
| 54 | PrimeSpectrum CommRingCat Set Localization TensorProduct IsSmoothAt Comparison |
| 55 | |
| 56 | section BaseChange |
| 57 | |
| 58 | variable {R : CommRingCat} (A : Type) [CommRing A] [Algebra R A] (Y : Over (Spec R)) |
| 59 | |
| 60 | /-- For Y over R, the map sending a point of Y over R in an A-algebra c to the point of the base |
| 61 | change Y_A given by it and the structure map A → c. -/ |
| 62 | noncomputable def algToBaseChange : |
| 63 | algPointsOf A R Y ⟶ forget₂ (CommAlg A) CommRingCat ⋙ geomPoints R A Y where |
| 64 | -- the point `y` together with the structure map `A → c`; the two are compatible over `R` |
| 65 | app c := |
| 66 | ↾fun y ↦ ⟨(⟨y.1.1⟩, ⟨ofHom (algebraMap A c)⟩), congr(⟨$(Spec.homEquiv.eq_symm_apply.1 y.1.w)⟩)⟩ |
| 67 | naturality _ _ f := by |
| 68 | ext |
| 69 | exact baseChangeOf.ext rfl fun a ↦ (f.hom.commutes a).symm |
| 70 | |
| 71 | /-- Let `Y` be over `Spec R` and `A` an `R`-algebra. For any coefficient `F` on test rings, the map |
| 72 | induced by `algToBaseChange`, from the cohomology of the base change `Y_A` to the cohomology of the |
| 73 | points of `Y` on tests over `A` (`New.Variety.TestOver`: test rings with an `A`-algebra structure), |
| 74 | is bijective in every degree. -/ |
| 75 | lemma isBijective_algToBaseChange (F : AbFunctor TestRing) : |
| 76 | (Comparison.restrict (TestOver.toTest A) F).IsBijective |
| 77 | (freeAbMap (Y := testIncl ⋙ (geomPoints R A).obj Y) |
| 78 | ((ι _).whiskerLeft (algToBaseChange A Y))) := by |
| 79 | -- A point `y` of the base change over a test ring `c` includes a ring map `A → c`. The ring `c` |
| 80 | -- with this algebra structure, with the point of `Y` given by `y`, is universal over `y`. |
| 81 | refine Comparison.HasUniversalPoints.isBijective fun c y ↦ ?_ |
| 82 | -- The second component of `y`, a ring map `A → c`, makes `c` a test `B` over `A`. |
| 83 | let algebra_c : Algebra A c.obj := y.val.2.down.hom'.toAlgebra |
| 84 | let B : TestOver A := ⟨.of A c.obj, c.property⟩ |
| 85 | let x : (ι _ ⋙ algPointsOf A R Y).obj B := |
| 86 | ⟨Over.homMk _ (Spec.homEquiv.eq_symm_apply.2 congr($(y.property).down))⟩ |
| 87 | refine ⟨B, x, 𝟙 c, ?_, fun d z f hzf ↦ ?_, ?_⟩ |
| 88 | · -- The point `x` lies over `y`. |
| 89 | exact (ConcreteCategory.congr_hom ((testIncl ⋙ (geomPoints R A).obj Y).map_id c) y).symm |
| 90 | · -- The ring map of `f` is a map of `A`-algebras, by the second component of `hzf`. |
| 91 | have h_commutes (a : A) : f.hom.hom (algebraMap A c.obj a) = algebraMap A d.obj a := |
| 92 | congr($(hzf).val.2.down.hom' a).symm |
| 93 | let g : B ⟶ d := ⟨CommAlg.homOfRingHom _ h_commutes⟩ |
| 94 | -- It carries `x` to `z`, by the first component of `hzf`; it is unique, its ring map being |
| 95 | -- `f`. |
| 96 | refine ⟨g, ⟨congrArg _ (Over.OverMorphism.ext congr($(hzf).val.1.down).symm), rfl⟩, ?_⟩ |
| 97 | bound |
| 98 | · -- On coefficients the comparison is the identity of `F c`. |
| 99 | exact ConcreteCategory.bijective_of_isIso (F.map (𝟙 c)) |
| 100 | |
| 101 | end BaseChange |
| 102 | |
| 103 | variable {C : Type _} [Category C] {ℓ : ℕ} {R : CommRingCat} {A : Type} [CommRing A] |
| 104 | [Algebra R A] [InvertsPrime A ℓ] {g : C ⥤ TestOver A} (D : ComparedTheory g) |
| 105 | |
| 106 | /-- Let `A` be a valuation ring (`PreValuationRing`) in which `ℓ` is a unit, `D` a compared theory |
| 107 | along a functor `g` from a category `C` to tests over `A`, and `P` a closed class of functors on |
| 108 | tests over `A` that contains `ℤ[Hom(A, -)]`, holds at `ℤ[Y]` whenever it holds at `ℤ[U]` for a |
| 109 | subfunctor `U` that is Zariski locally all of `Y`, and holds at `ℤ[Y]` for each functor `Y` on |
| 110 | tests over `A` exactly when `D.IsFiniteLerayHirsch` holds for `ℤ[Y] / ℤ[offClosedFiber Y]`. Then |
| 111 | `P` holds at `ℤ[testSpec A B]` for every smooth `A`-algebra `B`. -/ |
| 112 | private lemma ComparedTheory.mem_testSpec_of_smooth [PreValuationRing A] |
| 113 | {P : TestOver A ⥤ Ab → Prop} (hP : IsClosedClass P) |
| 114 | (h_iff : ∀ {X : TestOver A ⥤ Type 1}, |
| 115 | P (freeAb X) ↔ D.IsFiniteLerayHirsch (relFreeAb (offClosedFiber X))) |
| 116 | (h_pt : P (freeAb (reprBy (TestOver.ofSelf A)))) |
| 117 | (of_cover : ∀ {Y : TestOver A ⥤ Type 1} (U : Subfunctor Y), |
| 118 | IsZariskiLocallyTop (ringOf (𝟭 _)) U → P (freeAb U.toFunctor) → P (freeAb Y)) |
| 119 | (B : CommAlgCat A) [Algebra.Smooth A B] : |
| 120 | P (freeAb (testSpec A B)) := by |
| 121 | -- Reduce from a chart to a finite cover by standard étale pieces; for these |
| 122 | -- `ComparedTheory.isFiniteLerayHirsch_standard_etale` applies. |
| 123 | -- For each prime `x` there is `a x ∉ x` with `B[1/(a x)]` standard étale over the polynomial ring |
| 124 | -- `S = MvPolynomial (Fin (d x)) A`; finitely many of the unit loci of the `a x` cover `Spec B`. |
| 125 | -- `ha x : a x ∉ x`; `algebra_x`, `tower_x` make `Away (a x)` an algebra over the polynomial ring |
| 126 | -- `MvPolynomial (Fin (d x)) A`, standard étale by `h_etale x`. |
| 127 | choose a ha d algebra_x tower_x h_etale using fun x : PrimeSpectrum B ↦ |
| 128 | exists_isStandardEtale_mvPolynomial (R := A) (p := x.asIdeal) |
| 129 | obtain ⟨s, hs⟩ : |
| 130 | ∃ s : Finset (PrimeSpectrum B), ⋃ x ∈ s, (basicOpen (a x) : Set (PrimeSpectrum B)) = ⊤ := |
| 131 | CompactSpace.elim_nhds_subcover _ fun x ↦ isOpen_basicOpen.mem_nhds (ha x) |
| 132 | -- Every `B[1/(a x * f)]` is again standard étale over `S`, so it is `(S[X]/E.f)[1/E.g]` for a |
| 133 | -- standard étale pair `E`, and `S[X]` is again a polynomial ring over `A`. |
| 134 | have h_piece (x : PrimeSpectrum B) (f : B) : P (freeAb (testUnitLocus (a x * f)).toFunctor) := by |
| 135 | have h_etale_x : IsStandardEtale (MvPolynomial (Fin (d x)) A) (Away (a x)) := h_etale x |
| 136 | obtain ⟨⟨E⟩⟩ : |
| 137 | IsStandardEtale (MvPolynomial (Fin (d x)) A) (Away (algebraMap B (Away (a x)) f)) := |
| 138 | .of_isLocalizationAway (algebraMap B (Away (a x)) f) |
| 139 | have h_std : P (freeAb (testUnitLocus (AdjoinRoot.mk E.f E.g)).toFunctor) := |
| 140 | h_iff.2 (D.isFiniteLerayHirsch_standard_etale |
| 141 | (h_iff.1 (hP.freeAb_of_bijective _ pointMap_ofSelf_bijective h_pt)) _ |
| 142 | (MvPolynomial.finSuccEquiv A (d x))) |
| 143 | -- Both unit loci are represented by localisations, and these are isomorphic over `A`. |
| 144 | let iso := CommAlgCat.isoMk ((E.equivRing.trans E.equivAwayAdjoinRoot).restrictScalars A) |
| 145 | let e : (testUnitLocus (AdjoinRoot.mk E.f E.g)).toFunctor ⟶ |
| 146 | (testUnitLocus (a x * f)).toFunctor := |
| 147 | (testUnitLocus.nonempty_iso_away _).some.inv ≫ (ι _).whiskerLeft (reprMap iso.hom) ≫ |
| 148 | (testUnitLocus.nonempty_iso_away _ _).some.hom |
| 149 | exact (hP.iff_of_isIso (freeAb.map e)).1 h_std |
| 150 | refine of_cover (⨆ x : s, testUnitLocus (a x)) (fun t φ m hm ↦ ?_) ?_ |
| 151 | · -- The prime of `B` below `m` misses `a x` for some `x ∈ s`. |
| 152 | obtain ⟨x, hx, h_unit⟩ := iUnion₂_eq_univ_iff.1 hs (comap φ.down.hom'.toRingHom ⟨m, hm.isPrime⟩) |
| 153 | refine ⟨_, h_unit, fun B' f hf ↦ ?_⟩ |
| 154 | -- After `f` the point lies in the unit locus of `a x`, one of the pieces of the union. |
| 155 | aesop |
| 156 | · -- Mayer–Vietoris (`IsClosedClass.freeAb_iSup`): the unit loci of the `a x * f` form a family |
| 157 | -- that is closed under intersection, so `P` passes to finite unions. |
| 158 | refine hP.freeAb_iSup (range fun y : PrimeSpectrum B × B ↦ testUnitLocus (a y.1 * y.2)) ?_ ?_ |
| 159 | fun x ↦ ⟨(x, 1), by simp⟩ |
| 160 | · exact Set.forall_mem_range.2 fun y ↦ h_piece y.1 y.2 |
| 161 | · rintro _ ⟨⟨x, f⟩, rfl⟩ _ ⟨⟨y, f'⟩, rfl⟩ |
| 162 | exact ⟨(x, f * a y * f'), by simp only [← testUnitLocus_mul, mul_assoc]⟩ |
| 163 | |
| 164 | /-- Let `A` be a valuation ring (`PreValuationRing`) and a `k`-algebra in which `ℓ` is a unit, `D` a |
| 165 | compared theory along `g`, and `P` a closed class of functors on tests over `A` that contains |
| 166 | `ℤ[Hom(A, -)]` and holds at `ℤ[Y]`, for each functor `Y` on tests over `A`, exactly when |
| 167 | `D.IsFiniteLerayHirsch` holds for `ℤ[Y] / ℤ[offClosedFiber Y]`. If the functor `X` on `k`-algebras |
| 168 | is charted by some `V` (`New.Variety.IsCharting`: `V` is Zariski locally all of `X`, and `ℤ[V]` lies |
| 169 | in every closed class containing `ℤ[Spec R]` for each chart `R` of `X` étale over a torus), then `P` |
| 170 | holds at `ℤ[X]`, restricted to tests over `A`. -/ |
| 171 | lemma ComparedTheory.mem_of_isClosedClass_of_isCharting [PreValuationRing A] |
| 172 | {P : TestOver A ⥤ Ab → Prop} (hP : IsClosedClass P) |
| 173 | (h_iff : ∀ {X : TestOver A ⥤ Type 1}, |
| 174 | P (freeAb X) ↔ D.IsFiniteLerayHirsch (relFreeAb (offClosedFiber X))) |
| 175 | {k : Type} [CommRing k] [Algebra k A] {X : CommAlg k ⥤ Type 1} |
| 176 | (hV : ∃ V : Subfunctor X, IsCharting (k := k) V) |
| 177 | (h_pt : P (freeAb (reprBy (TestOver.ofSelf A)))) : |
| 178 | P (freeAb ((ι _ ⋙ restrictAlg k A) ⋙ X)) := by |
| 179 | -- Reduce from `X` to `V`, from `V` to affine charts (`mem_testSpec_of_smooth`). `P` is local: by |
| 180 | -- excision (`ComparedTheory.isFiniteLerayHirsch_iff_of_locally_bijective`) it passes from `U` to |
| 181 | -- `Y` if `U` is locally all of `Y`. |
| 182 | have of_cover {Y : TestOver A ⥤ Type 1} (U : Subfunctor Y) |
| 183 | (hU : IsZariskiLocallyTop (ringOf (𝟭 _)) U) |
| 184 | (h_mem : P (freeAb U.toFunctor)) : P (freeAb Y) := by |
| 185 | -- A point of `U` lies in the range of `U.ι`. |
| 186 | have h_cover : IsZariskiLocallyTop (ringOf (𝟭 _)) (.range U.ι ⊔ offClosedFiber Y) := |
| 187 | fun t y m hm ↦ (hU t y m hm).imp fun _ ↦ .imp_right fun h B f hf ↦ |
| 188 | Or.inl ⟨⟨_, h B f hf⟩, rfl⟩ |
| 189 | have h_inj : IsZariskiLocallyTop (ringOf (𝟭 _)) (sameClassLocus U.ι (offClosedFiber Y)) := |
| 190 | isZariskiLocallyTop_sameClassLocus_of_injective _ _ fun _ ↦ Subtype.val_injective |
| 191 | exact h_iff.2 ((D.isFiniteLerayHirsch_iff_of_locally_bijective U.ι h_cover h_inj).1 |
| 192 | (h_iff.1 h_mem)) |
| 193 | -- `V` is locally all of `X`, and `ℤ[V]` lies in every closed class that contains its charts. |
| 194 | obtain ⟨V, hV_local, hV_charts⟩ := hV |
| 195 | refine of_cover (V.whisker _) (hV_local.whisker _) |
| 196 | (hV_charts _ (hP.comap (restrictAlong _)) fun chart _ ↦ ?_) |
| 197 | -- On tests over `A` the chart is represented by its base change `B`, a smooth `A`-algebra. |
| 198 | let B := CommAlgCat.of A (A ⊗[k] chart.coordRing) |
| 199 | suffices hB : P (freeAb (testSpec A B)) from |
| 200 | (hP.comap (restrictAlong (ι _))).freeAb_of_bijective |
| 201 | (Y := restrictAlg k A ⋙ reprBy chart.coordRing) _ |
| 202 | (pointMap_algBaseChange_unit_bijective _) hB |
| 203 | exact D.mem_testSpec_of_smooth hP h_iff h_pt of_cover B |
| 204 | |
| 205 | /-- Let `A` be a valuation ring of `Ω` (a `ClosurePlace`) with the prime `p` in its maximal ideal. |
| 206 | Then `A` has rank one: for every nonzero `a ∈ A`, the maximal ideal lies in the radical of `(a)`. -/ |
| 207 | private lemma maximalIdeal_le_radical_span {A : ClosurePlace} {p : ℕ} [Fact p.Prime] |
| 208 | (hp : A.valuation p < 1) (a : A⁰) : IsLocalRing.maximalIdeal A ≤ radical (span {(a : A)}) := by |
| 209 | -- `A` comes from `PadicAlgCl p`, whose valuation has rank one: a nonzero `a` divides a power of |
| 210 | -- any nonunit. |
| 211 | obtain ⟨j, rfl⟩ := exists_comap_intQpBar_eq hp |
| 212 | have h_int : (Valued.v.comap j).Integers ((New.intQpBar p).comap j) := |
| 213 | Valuation.integer.integers _ |
| 214 | -- A power of a value below one drops below any positive value. So a nonunit `b` (valuation |
| 215 | -- below one) has a power `b ^ n` of valuation at most that of `a` (positive): `a ∣ b ^ n`. |
| 216 | have h_pow_le {r s : NNReal} (hr : 0 < r) (hs : s < 1) : ∃ n : ℕ, s ^ n ≤ r := |
| 217 | (exists_pow_lt_of_lt_one hr hs).imp fun _ ↦ le_of_lt |
| 218 | intro b |
| 219 | simp +contextual [radical, mem_span_singleton, h_int.dvd_iff_le, isUnit_iff_dvd_one, h_pow_le] |
| 220 | |
| 221 | /-- Let `A` be a valuation ring of `Ω` (a `ClosurePlace`) with the prime `p` in its maximal ideal, |
| 222 | and `ℓ` a unit in `A`. For a functor `X` on tests over `A`, restriction of the mod `ℓ` cohomology |
| 223 | from tests over `A` to tests over `Ω` (`New.Variety.TestOver.restrictScalars`) is bijective on |
| 224 | `ℤ[X]` exactly when `ℤ[X] / ℤ[offClosedFiber X]` has no cohomology. -/ |
| 225 | private lemma isBijective_restrict_restrictScalars_iff {A : ClosurePlace} {p : ℕ} [Fact p.Prime] |
| 226 | (hp : A.valuation p < 1) [InvertsPrime A ℓ] {X : TestOver A ⥤ Type 1} : |
| 227 | (Comparison.restrict (TestOver.restrictScalars A Ω) |
| 228 | (locConstAlong (𝟭 (TestOver A)))).IsBijective |
| 229 | (𝟙 (TestOver.restrictScalars A Ω ⋙ freeAb X)) ↔ |
| 230 | ∀ n : ℕ, |
| 231 | Subsingleton (H (relFreeAb (offClosedFiber X)) (locConstAlong (𝟭 (TestOver A))) n) := by |
| 232 | let κ := Comparison.restrict (TestOver.restrictScalars A Ω) (locConstAlong (𝟭 (TestOver A))) |
| 233 | -- In an `Ω`-algebra `p` is a unit, so every point of `X` over it lies in `offClosedFiber X`. |
| 234 | let u : TestOver.restrictScalars A Ω ⋙ X ⟶ κ.functor ⋙ (offClosedFiber X).toFunctor := |
| 235 | { app c := ↾fun x ↦ |
| 236 | ⟨x, eq_top_of_isUnit_mem _ (mem_map_of_mem _ ((A.valuation_lt_one_iff p).2 hp)) |
| 237 | ((NeZero.ne (p : Ω)).isUnit.map (algebraMap Ω c.obj))⟩ } |
| 238 | -- Conversely, if a test `c` carries a point of `offClosedFiber X`, nonzero elements of `A` are |
| 239 | -- units in `c` (rank one), so `A → c` extends uniquely to `Ω`. |
| 240 | have h_unit {c : TestOver A} (hc : (IsLocalRing.maximalIdeal A).map (algebraMap A c.obj) = ⊤) |
| 241 | (a : A⁰) : IsUnit (algebraMap A c.obj a) := by |
| 242 | rw [← span_singleton_eq_top, ← Set.image_singleton (f := algebraMap A c.obj), ← map_span, |
| 243 | ← radical_eq_top] |
| 244 | exact eq_top_mono ((map_mono (maximalIdeal_le_radical_span hp a)).trans (map_radical_le _)) hc |
| 245 | -- Two `A`-algebra maps out of the fraction field `Ω` agree. |
| 246 | have h_sub (c : TestOver A) : |
| 247 | Subsingleton ((reprBy ⟨.of A Ω, isTest_of_preValuationRing⟩).obj c) := |
| 248 | ⟨fun _ _ ↦ congr(⟨⟨CommAlgCat.ofHom $(IsLocalization.algHom_ext A⁰ (by ext))⟩⟩)⟩ |
| 249 | -- Thus `u` is the pull-back of `TestOver.structurePt A Ω` along the map sending a point of |
| 250 | -- `offClosedFiber X` to that unique extension `Ω → c`, so `κ` is bijective along `u`. |
| 251 | let t : (offClosedFiber X).toFunctor ⟶ reprBy ⟨.of A Ω, isTest_of_preValuationRing⟩ := |
| 252 | { app c := ↾fun y ↦ ⟨⟨CommAlg.homOfRingHom _ (IsLocalization.lift_eq (h_unit y.property))⟩⟩ |
| 253 | naturality _ _ _ := by ext; exact Subsingleton.elim _ _ } |
| 254 | have h_bij : κ.IsBijective (freeAbMap u) := |
| 255 | (hasUniversalPoints_structurePt A Ω).isBijective_of_isPullback (toUnit _) t <| |
| 256 | isPullback_iff.2 ⟨fun _ _ ↦ Subsingleton.elim _ _, |
| 257 | fun _ _ y _ ↦ ⟨y.val, ⟨rfl, rfl⟩, fun _ ⟨_, h⟩ ↦ congrArg Subtype.val h⟩⟩ |
| 258 | -- So `κ` is bijective on `X` iff `offClosedFiber X ⊆ X` is an equivalence iff the quotient is |
| 259 | -- acyclic. |
| 260 | calc κ.IsBijective (𝟙 (κ.functor ⋙ freeAb X)) |
| 261 | _ ↔ IsCohomEquiv (locConstAlong (𝟭 _)) (freeAb.map (offClosedFiber X).ι) := by |
| 262 | refine (h_bij.trans_iff (c := .id _) ?_).trans isCohomEquiv_iff_isBijective.symm |
| 263 | -- `u` followed by the inclusion of `offClosedFiber X` is the identity |
| 264 | exact freeAb.hom_ext fun _ _ ↦ rfl |
| 265 | _ ↔ ∀ n, Subsingleton (H (relFreeAb (offClosedFiber X)) (locConstAlong (𝟭 _)) n) := |
| 266 | relFreeAb.isCohomEquiv_iff_subsingleton_rel _ |
| 267 | |
| 268 | /-- Let `ℓ` be prime and `A` a valuation ring of the algebraic closure `Ω` of `ℚ` (a `ClosurePlace`) |
| 269 | and an `R`-algebra, with a prime `p` in its maximal ideal and `ℓ` a unit. Suppose `Y` is charted |
| 270 | over `R` (`IsCharted`: its functor of points on `R`-algebras has a subfunctor `V` with |
| 271 | `IsCharting V`). Then pull-back `Hⁿ(Y_A, ℤ/ℓ) → Hⁿ(Y_Ω, ℤ/ℓ)` along `Y_Ω → Y_A` is bijective for all |
| 272 | `n`, where cohomology is computed on test rings with locally constant coefficients. -/ |
| 273 | lemma isTestCohomEquiv_baseChangeTransition [ThePrime ℓ] |
| 274 | {A : ClosurePlace} {p : ℕ} [Fact p.Prime] (hp : A.valuation p < 1) |
| 275 | (hℓ : IsUnit (ℓ : A)) [Algebra R A] (Y : Over (Spec R)) [IsCharted Y R] : |
| 276 | IsTestCohomEquiv ⟨ZMod ℓ⟩ (Y := geomPoints R A Y) |
| 277 | (baseChangeTransition (pointsToBase Y.hom) (ofHom A.subtype) rfl) := by |
| 278 | -- Compare the cohomology of tests over `A` with that of tests over `Ω` (the comparison `κ`). The |
| 279 | -- functors on which `κ` is bijective form a class to which |
| 280 | -- `ComparedTheory.mem_of_isClosedClass_of_isCharting` applies; it contains the point, hence `Y`. |
| 281 | -- Then `isBijective_algToBaseChange` translates back to the base changes of `Y`. |
| 282 | -- `h_inverts`, `algebra_Ω` and `h_faithful` serve as instances (for the theory of locally |
| 283 | -- constant functions and for the line formula). |
| 284 | have h_inverts : InvertsPrime A ℓ := .mk hℓ |
| 285 | -- The line formula holds because `A ⊆ Ω` embeds in `ℂ_[ℓ]`. |
| 286 | let algebra_Ω : Algebra Ω ℂ_[ℓ] := |
| 287 | ((algebraMap (PadicAlgCl ℓ) ℂ_[ℓ]).comp Classical.ofNonempty).toAlgebra |
| 288 | have h_faithful : FaithfulSMul A ℂ_[ℓ] := A.faithfulSMul |
| 289 | have h_line : (Theory.locallyConstant (A := A)).HasLineFormula := hasLineFormula_locallyConstant A |
| 290 | -- With no comparison maps, `D.IsFiniteLerayHirsch N` says that `N` has no cohomology: the map |
| 291 | -- from the empty direct sum to the cohomology is bijective. |
| 292 | let D : ComparedTheory (𝟭 (TestOver A)) := ⟨Theory.locallyConstant, Empty, nofun, h_line, h_line⟩ |
| 293 | have h_acyclic (N : AbFunctor (TestOver A)) : |
| 294 | (∀ n, Subsingleton (H N (locConstAlong (𝟭 _)) n)) ↔ D.IsFiniteLerayHirsch N := by |
| 295 | constructor |
| 296 | · -- The total cohomology is then trivial, so the empty direct sum maps bijectively onto it. |
| 297 | intro h_sub |
| 298 | exact ⟨Unique.bijective (B := TotalH N (locConstAlong _)), .of_subsingleton⟩ |
| 299 | · -- The empty direct sum maps onto the total cohomology, so it and each degree are trivial. |
| 300 | rintro ⟨h_bij, -⟩ n |
| 301 | have h_total : Subsingleton (TotalH N (locConstAlong (𝟭 _))) := h_bij.surjective.subsingleton |
| 302 | exact (DirectSum.of_injective n).subsingleton |
| 303 | let κ := Comparison.restrict (TestOver.restrictScalars A Ω) (locConstAlong (𝟭 _)) |
| 304 | have h_iff {X : TestOver A ⥤ Type 1} : |
| 305 | κ.IsBijective (𝟙 (κ.functor ⋙ freeAb X)) ↔ D.IsFiniteLerayHirsch |
| 306 | (relFreeAb (offClosedFiber X)) := |
| 307 | (isBijective_restrict_restrictScalars_iff hp).trans (h_acyclic _) |
| 308 | -- The point: both `A` and `Ω` are domains, so both sides are the constants `ZMod ℓ`. |
| 309 | have h_pt : κ.IsBijective (freeAbMap (𝟙 (κ.functor ⋙ reprBy (TestOver.ofSelf A)))) := by |
| 310 | refine κ.isBijective_of_repr ⟨⟨structureMap⟩⟩ |
| 311 | (fun c ↦ ((pointMap_ofSelf_bijective _).of_comp_iff' _).1 (pointMap_ofSelf_bijective c)) ?_ |
| 312 | exact ((bijective_const_of_isDomain (B := .of A)).of_comp_iff _).1 |
| 313 | (bijective_const_of_isDomain (B := .of Ω)) |
| 314 | have h_cl : IsClosedClass fun N ↦ κ.IsBijective (𝟙 (κ.functor ⋙ N)) := |
| 315 | (κ.devissage (𝟭 _) (𝟙 _)).isClosedClass |
| 316 | have h_Y : κ.IsBijective (𝟙 (κ.functor ⋙ freeAb |
| 317 | ((ι _ ⋙ restrictAlg R A) ⋙ algPointsOf R R Y))) := by |
| 318 | refine D.mem_of_isClosedClass_of_isCharting h_cl h_iff IsCharted.exists_isCharting ?_ |
| 319 | -- `freeAb` maps the identity to the identity. |
| 320 | rwa [freeAbMap, freeAb.map_id] at h_pt |
| 321 | -- Both `H(Y_A) → H(Y on tests over A) → H(Y on tests over Ω)` and `H(Y_Ω) → H(Y on tests over Ω)` |
| 322 | -- are bijective, hence so is `H(Y_A) → H(Y_Ω)`. |
| 323 | have h_A := isBijective_algToBaseChange A Y (locConstCoeff ⟨ZMod ℓ⟩) |
| 324 | let algebra_R_Ω : Algebra R Ω := .compHom Ω (algebraMap R A) |
| 325 | have h_Ω := isBijective_algToBaseChange Ω Y (locConstCoeff ⟨ZMod ℓ⟩) |
| 326 | -- (`(… :)` elaborates the composite `H(Y_A) → H(Y on tests over Ω)` on its own.) |
| 327 | refine IsBijective.eqv ((h_Ω.trans_iff ?_).1 (h_A.trans h_Y rfl :)) |
| 328 | exact freeAb.hom_ext fun _ _ ↦ rfl |
| 329 | |
| 330 | end New.Variety |