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 Aesop.BuiltinRules |
| 4 | public import Mathlib.CategoryTheory.SingleObj |
| 5 | public import Mathlib.CategoryTheory.Monoidal.Cartesian.FunctorCategory |
| 6 | import Mathlib.Algebra.AddConstMap.Basic |
| 7 | import Mathlib.Algebra.Category.Grp.Ulift |
| 8 | import Mathlib.Algebra.Category.Grp.Zero |
| 9 | import Mathlib.Algebra.Order.Star.Rat |
| 10 | public import Lib.PadicComparison.Descent.AlmostDescent |
| 11 | import Lib.PadicComparison.Descent.TestCovers |
| 12 | public import TauCeti.Data.Nat.Factorial.Basic |
| 13 | |
| 14 | /-! |
| 15 | # Wang sequence on C × Bℕ, lines, and root systems of units via periodic sequences |
| 16 | |
| 17 | Write Bℕ for the one-object category of the monoid ℕ. A functor on C × Bℕ (`New.Variety.TimesBNat`) |
| 18 | is a functor Y on C with an endomorphism γ. Its cohomology plays the part of that of the homotopy |
| 19 | quotient by γ. Cohomology is Hⁿ(Y, F) = Extⁿ(ℤ[Y], F) in functors to abelian groups. Y is a line |
| 20 | over a functor U on C (`New.Variety.IsLine`) if a map from Y to U is bijective on cohomology. Root |
| 21 | systems of a unit are defined on O_C-algebras, twisted by the character s ↦ (ε^s)^♯. For a unit `v` |
| 22 | of a `p`-adic test (`New.Variety.PadicTest`: its ring `ProdRing` is a product of cells `Cell j`, |
| 23 | `TiltRing` is its tilt, and `algFunctor` sends it to `ProdRing` as an O_C-algebra), they form a line |
| 24 | for the coefficients `tilt ⋙ moduleCoeff (tensorCoeff M)`, provided `moduleCoeff (tensorCoeff M)` is |
| 25 | acyclic on perfect rings (`New.Variety.IsAcyclicOnPerfect`). This is proved by representing them, |
| 26 | through tilting, by the ring of periodic sequences. There the twist becomes the shift. |
| 27 | |
| 28 | ## Main definitions and results |
| 29 | |
| 30 | * `New.Variety.TimesBNat.shortExact_wangComplex`: the short exact sequence |
| 31 | 0 → ℤ[Y × ℕ] → ℤ[Y × ℕ] → ℤ[Y] → 0 (`New.Variety.TimesBNat.wangComplex`; |
| 32 | `New.Variety.TimesBNat.shortExact_induced` is the same with the two maps written out). Its long |
| 33 | exact sequence is the Wang sequence, since Y × ℕ on C × Bℕ has the cohomology of Y on C |
| 34 | (`New.Variety.TimesBNat.isLine_fst`). |
| 35 | * `New.Variety.IsLine.of_acyclic`: a criterion for Y to be a line over a representable functor |
| 36 | Hom(A, −), in terms of the kernel and cokernel of γ - 1 on coefficients |
| 37 | (`New.Variety.KoszulExact`). |
| 38 | * `New.Variety.compatibleRoots`: A ↦ characters ℚ≥0 → A, that is, elements with a compatible system |
| 39 | of n-th roots for all n ≥ 1. |
| 40 | * `New.Variety.CompatibleRootsAreLines`: the property of coefficients F and a functor ψ to |
| 41 | O_C-algebras that the root systems of every unit of every ψ(A) form a line (`New.Variety.IsLine`) |
| 42 | over Hom(A, −). |
| 43 | * `New.Variety.periodicSeq.koszulExact_shift`: in characteristic `p`, the constants contain the |
| 44 | kernel of the shift minus the identity, and this map is onto (`New.Variety.KoszulExact`). This |
| 45 | also holds after tensoring with a module. |
| 46 | * `New.Variety.PadicTest.isLine_compatibleRoots`: if `moduleCoeff (tensorCoeff M)` is acyclic on |
| 47 | perfect rings (`New.Variety.IsAcyclicOnPerfect`), root systems of `v` have flat base change |
| 48 | (`New.Variety.HasFlatBaseChange`) and form a line (`New.Variety.IsLine`) for the coefficients |
| 49 | `tilt ⋙ moduleCoeff (tensorCoeff M)`. |
| 50 | |
| 51 | Notions from other files: |
| 52 | * `New.Variety.freeAb`: The functor sending a set-valued functor Y to ℤ[Y], whose value at A is the |
| 53 | free abelian group on Y(A). |
| 54 | * `New.OC`: The ring of integers O_C of the field C_p of p-adic complex numbers. |
| 55 | * `New.Period.OFlat`: The ring O^♭, the inverse limit of O_C/p along x ↦ x^p, where O_C is the ring |
| 56 | of integers of C_p. |
| 57 | |
| 58 | ## Relation to the literature |
| 59 | |
| 60 | Known result: Faltings' toric towers and their Koszul complexes. Here the variables are treated one |
| 61 | at a time, and the discrete monoid generated by one automorphism replaces continuous cohomology of |
| 62 | Z_p^d, so that Wang sequences replace the Koszul complex. Source: P. Scholze, p-adic Hodge theory |
| 63 | for rigid-analytic varieties, Forum Math. Pi 1 (2013), Lemmas 4.5 and 5.5; Bhatt, Morrow, Scholze |
| 64 | 2018, Lemma 7.3; Stacks project, tag 0EBS; G. Faltings, p-adic Hodge theory, J. Amer. Math. Soc. 1 |
| 65 | (1988). |
| 66 | -/ |
| 67 | |
| 68 | @[expose] public section |
| 69 | |
| 70 | noncomputable section |
| 71 | |
| 72 | /-! |
| 73 | ## Homotopy quotients on C × Bℕ, the Wang sequence and lines |
| 74 | |
| 75 | `IsBijective (.restrict φ F) (freeAbMap u)` says that Hⁿ(Y, F) → Hⁿ(Y', F ∘ φ) along u : Y' → Y ∘ φ |
| 76 | is bijective for all n. |
| 77 | -/ |
| 78 | |
| 79 | section WangSequence |
| 80 | |
| 81 | open CategoryTheory Function FreeAddCommGroup AddCommGrpCat |
| 82 | |
| 83 | namespace New.Variety |
| 84 | |
| 85 | variable (C : Type 1) {C' : Type 1} [Category C] [Category C'] {F : AbFunctor C} {F' : AbFunctor C'} |
| 86 | {U : C ⥤ Type 1} |
| 87 | |
| 88 | /-- For a category C, the product category C × Bℕ, where Bℕ is the one-object category whose |
| 89 | endomorphism monoid is the additive natural numbers. -/ |
| 90 | abbrev TimesBNat : Type 1 := C × SingleObj (Multiplicative ℕ) |
| 91 | |
| 92 | /-- The projection functor from the product category C × Bℕ to its first factor C. -/ |
| 93 | abbrev TimesBNat.fst : TimesBNat C ⥤ C := .mk (·.1) (·.1) |
| 94 | |
| 95 | /-- The functor C → C × Bℕ sending an object A to (A, ∗) and a morphism f to (f, identity). -/ |
| 96 | abbrev TimesBNat.incl : C ⥤ TimesBNat C where |
| 97 | obj X := (X, ⟨⟩) |
| 98 | map f := (f, 𝟙 _) |
| 99 | |
| 100 | open TimesBNat Abelian.Ext Comparison freeAb ShortComplex LongExactSeq MonoidalCategory |
| 101 | CartesianMonoidalCategory AddChar |
| 102 | |
| 103 | variable {C} (Y : TimesBNat C ⥤ Type 1) |
| 104 | |
| 105 | /-- The set-valued functor on C × Bℕ with value ℕ at every object, on which morphisms of C act |
| 106 | trivially and k in Bℕ acts by adding k. -/ |
| 107 | abbrev TimesBNat.natWithShift : TimesBNat C ⥤ Type 1 := |
| 108 | { obj X := X.2, map f := f.2 } ⋙ uliftCoyoneda ⟨⟨⟩⟩ |
| 109 | |
| 110 | /-- For a set-valued functor Y on C × Bℕ, the additive character of ℕ sending k to the endomorphism |
| 111 | of the restriction of Y to C given at A by Y(id_A, k). -/ |
| 112 | def TimesBNat.shiftEnd : AddChar ℕ (End (incl C ⋙ Y)) := |
| 113 | toMonoidHomEquiv.invFun ((Y.curryObj.flip.mapEnd _).comp (SingleObj.toEnd _).toMonoidHom) |
| 114 | |
| 115 | /-! ### Criteria for a bijection on cohomology -/ |
| 116 | |
| 117 | variable {Y} (F) in |
| 118 | /-- For Y on C × Bℕ, U on C and a map a from Y to U (with ℕ acting trivially on U), the property |
| 119 | that Hⁿ(U, F) → Hⁿ(Y, F) is bijective for all n, the coefficients F being pulled back to C × Bℕ. -/ |
| 120 | abbrev IsLine (a : Y ⟶ TimesBNat.fst C ⋙ U) : Prop := IsBijective (.restrict _ F) (freeAbMap a) |
| 121 | |
| 122 | /-- For a set-valued functor X on C, the projection X(A) × ℕ → X(A) induces bijections from |
| 123 | Hⁿ(X, F) to the cohomology of X × ℕ on C × Bℕ, ℕ acting by translation, with coefficients F |
| 124 | pulled back. -/ |
| 125 | lemma TimesBNat.isLine_fst {X : C ⥤ Type 1} : |
| 126 | IsLine F (SemiCartesianMonoidalCategory.fst (fst C ⋙ X) natWithShift) := by |
| 127 | -- Above a point `y` of `X` at `A`, the point `(y, 0)` of `X × ℕ` at `(A, ⋆)` is universal: |
| 128 | -- a point `(x, k)` above `X.map f y` is its image under `(f, k)` and under no other map over `f`. |
| 129 | refine HasUniversalPoints.isBijective fun (A : C) (y : X.obj A) ↦ |
| 130 | ⟨(A, ⟨⟩), (y, ⟨.zero⟩), 𝟙 A, (X.map_id_apply A y).symm, ?_, ?_⟩ |
| 131 | · rintro D ⟨x, ⟨k⟩⟩ f hf |
| 132 | refine ⟨(f, k), ⟨Prod.ext hf.symm rfl, Category.id_comp f⟩, ?_⟩ |
| 133 | rintro ⟨g₁, g₂⟩ ⟨h_image, h_comp⟩ |
| 134 | -- the second coordinate of the image of `(y, 0)` is `0` shifted by `g₂`, which is `g₂` |
| 135 | have h_snd : g₂ = k := congrArg (fun p ↦ p.snd.down) h_image |
| 136 | have h_fst : g₁ = f := by simpa using h_comp |
| 137 | rw [h_fst, h_snd] |
| 138 | · -- the coefficients are pulled back along the identity of `A` |
| 139 | simpa [Function.id_def] using bijective_id |
| 140 | |
| 141 | /-- The retraction in the Wang sequence at one object, for a map `t` of a set `X` to itself: it |
| 142 | sends `(x, 0)` to `0` and `(x, k + 1)` to its value at `(t x, k)` minus `(x, k)`. -/ |
| 143 | private def wangRetraction {X : Type 1} (t : X → X) : ℕ → X → FreeAddCommGroup (X × ULift.{1} ℕ) |
| 144 | | 0, _ => 0 |
| 145 | | k + 1, x => wangRetraction t k (t x) - of (x, ⟨k⟩) |
| 146 | |
| 147 | /-- The maps `(x, k) ↦ γ^k x` from `Y × ℕ` to `Y`, with `γ = shiftEnd Y 1`, are natural on |
| 148 | C × Bℕ: a map `(f, j)` sends `(x, k)` to `(Y(f, 0) x, k + j)`, and `Y(f, j) ∘ γ^k` is |
| 149 | `γ^(k + j) ∘ Y(f, 0)`. -/ |
| 150 | private lemma TimesBNat.shiftEnd_naturality {D D' : TimesBNat C} (f : D ⟶ D') : |
| 151 | (fst C ⋙ incl C ⋙ Y ⊗ natWithShift).map f ≫ |
| 152 | (↾fun x ↦ (shiftEnd Y x.2.down).asHom.app D'.1 x.1 : |
| 153 | (fst C ⋙ incl C ⋙ Y ⊗ natWithShift).obj D' ⟶ Y.obj D') = |
| 154 | (↾fun x ↦ (shiftEnd Y x.2.down).asHom.app D.1 x.1 : |
| 155 | (fst C ⋙ incl C ⋙ Y ⊗ natWithShift).obj D ⟶ Y.obj D) ≫ Y.map f := by |
| 156 | ext ⟨x, ⟨k⟩⟩ |
| 157 | -- `Y` maps the commuting square `(f.1, 𝟙) ≫ (𝟙, k ≫ f.2) = (𝟙, k) ≫ f` of C × Bℕ to a commuting |
| 158 | -- square of maps; at the point `x` it is the claim. |
| 159 | have h_sq : CommSq ((f.1, 𝟙 _) : (D.1, ⟨⟩) ⟶ (D'.1, ⟨⟩)) ((𝟙 D.1, k) : (D.1, ⟨⟩) ⟶ D) |
| 160 | ((𝟙 D'.1, k ≫ f.2) : (D'.1, ⟨⟩) ⟶ D') f := ⟨Prod.ext (by simp) (Category.id_comp _)⟩ |
| 161 | exact ConcreteCategory.congr_hom (Y.map_commSq h_sq).w x |
| 162 | |
| 163 | /-- For Y on C × Bℕ with endomorphism γ, the sequence 0 → ℤ[Y × ℕ] → ℤ[Y × ℕ] → ℤ[Y] → 0 is short |
| 164 | exact. Here Y × ℕ is the product of the restriction of Y to C, pulled back to C × Bℕ, with |
| 165 | `New.Variety.TimesBNat.natWithShift`; the first map is (x, k) ↦ (γ x, k) - (x, k + 1), the second is |
| 166 | (x, k) ↦ γ^k x, and `w` is the proof that their composite is zero. -/ |
| 167 | lemma TimesBNat.shortExact_induced : |
| 168 | ∃ w, ShortExact (ShortComplex.mk |
| 169 | (X₂ := freeAb.obj ((fst C ⋙ incl C ⋙ Y) ⊗ natWithShift)) (X₃ := freeAb.obj Y) |
| 170 | -- the first map, `(x, k) ↦ (γ x, k) - (x, k + 1)` |
| 171 | (Sub.sub (freeAb.map ((fst C).whiskerLeft (shiftEnd Y 1).asHom ▷ natWithShift)) |
| 172 | (freeAb.map ((fst C ⋙ incl C ⋙ Y) ◁ { app _ := ↾ULift.map.{_, _, 1, 1} Nat.succ }))) |
| 173 | -- the second map, `(x, k) ↦ γ^k x` |
| 174 | (freeAb.map ⟨fun D : TimesBNat C ↦ ↾fun x ↦ (shiftEnd Y x.2.down).asHom.app D.1 x.1, |
| 175 | fun _ _ f ↦ by exact shiftEnd_naturality Y f⟩) |
| 176 | w) := by |
| 177 | -- With `t = shiftEnd Y 1` the maps are `(x, k) ↦ (t x, k) - (x, k + 1)` and `(x, k) ↦ tᵏ x`. The |
| 178 | -- sequence splits at each object `A`. |
| 179 | have h_at (A : C) : ∃ w, ShortExact |
| 180 | ⟨ofHom (map (Prod.map ((shiftEnd Y 1).asHom.app A) id) - |
| 181 | map (Prod.map id (ULift.map.{_, _, 1, 1} .succ))), |
| 182 | ofHom (map fun (x, ⟨k⟩) ↦ (shiftEnd Y k).asHom.app A x), w⟩ := by |
| 183 | -- The retraction is `(x, k) ↦ wangRetraction t k x`; the section is `x ↦ (x, 0)`. |
| 184 | refine ⟨?_, Splitting.shortExact |
| 185 | { r := ofHom (lift fun (x, ⟨k⟩) ↦ wangRetraction ((shiftEnd Y 1).asHom.app A) k x) |
| 186 | s := ofHom (map fun x ↦ (x, ⟨0⟩)), f_r := ?_, s_g := ?_, id := ?_ }⟩ |
| 187 | · -- the composite of the two maps is zero |
| 188 | ext ⟨x, ⟨k⟩⟩ |
| 189 | simp [map_add_eq_mul] |
| 190 | · -- the retraction is a left inverse of the first map |
| 191 | ext ⟨x, ⟨k⟩⟩ |
| 192 | simp [wangRetraction] |
| 193 | · -- the section is a right inverse of the second map |
| 194 | ext |
| 195 | simp |
| 196 | · -- the retraction and the section split the middle term |
| 197 | ext ⟨x, ⟨k⟩⟩ |
| 198 | induction k generalizing x with |
| 199 | | zero => simp [wangRetraction] |
| 200 | | succ k ih => |
| 201 | -- The claim at `(x, k + 1)` is the claim at `(t x, k)`, rearranged. |
| 202 | simp [wangRetraction, map_add_eq_mul] at ih ⊢ |
| 203 | linear_combination (norm := abel1) ih ((shiftEnd Y 1).asHom.app A x) |
| 204 | -- Exactness of functors is tested object by object. |
| 205 | choose w h_short using h_at |
| 206 | exact shortExact_of_app (fun A ↦ (h_short A.1).ab_injective_f) |
| 207 | (fun A ↦ exact_of_shortComplex_exact (h_short A.1).exact) fun A ↦ (h_short A.1).ab_surjective_g |
| 208 | |
| 209 | /-- The first map of the Wang sequence, ℤ[Y × ℕ] → ℤ[Y × ℕ], `(x, k) ↦ (γ x, k) - (x, k + 1)` with |
| 210 | `γ = shiftEnd Y 1`. Here Y × ℕ is the restriction of Y to C, pulled back to C × Bℕ, times |
| 211 | `New.Variety.TimesBNat.natWithShift`. -/ |
| 212 | def TimesBNat.wangSub : |
| 213 | freeAb.obj ((fst C ⋙ incl C ⋙ Y) ⊗ natWithShift) ⟶ |
| 214 | freeAb.obj ((fst C ⋙ incl C ⋙ Y) ⊗ natWithShift) := |
| 215 | freeAb.map ((fst C).whiskerLeft (shiftEnd Y 1).asHom ▷ natWithShift) - |
| 216 | freeAb.map ((fst C ⋙ incl C ⋙ Y) ◁ ({ app _ := ↾ULift.map.{_, _, 1, 1} Nat.succ } : |
| 217 | (natWithShift : TimesBNat C ⥤ Type 1) ⟶ natWithShift)) |
| 218 | |
| 219 | /-- The second map of the Wang sequence, ℤ[Y × ℕ] → ℤ[Y], `(x, k) ↦ γ^k x` with |
| 220 | `γ = shiftEnd Y 1`. -/ |
| 221 | def TimesBNat.wangPow : freeAb.obj ((fst C ⋙ incl C ⋙ Y) ⊗ natWithShift) ⟶ freeAb.obj Y := |
| 222 | freeAb.map ⟨fun D ↦ ↾fun x ↦ (shiftEnd Y x.2.down).asHom.app D.1 x.1, |
| 223 | fun _ _ f ↦ by exact shiftEnd_naturality Y f⟩ |
| 224 | |
| 225 | /-- The two maps of the Wang sequence compose to zero, as `γ^k (γ x) = γ^(k + 1) x`. -/ |
| 226 | lemma TimesBNat.wangSub_comp_wangPow : wangSub Y ≫ wangPow Y = 0 := |
| 227 | (shortExact_induced Y).fst |
| 228 | |
| 229 | /-- The Wang sequence ℤ[Y × ℕ] → ℤ[Y × ℕ] → ℤ[Y] (`wangSub`, then `wangPow`), a short complex of |
| 230 | functors from C × Bℕ to abelian groups. -/ |
| 231 | abbrev TimesBNat.wangComplex : ShortComplex (TimesBNat C ⥤ AddCommGrpCat.{1}) := |
| 232 | .mk (wangSub Y) (wangPow Y) (wangSub_comp_wangPow Y) |
| 233 | |
| 234 | /-- For Y on C × Bℕ with endomorphism γ, the Wang sequence 0 → ℤ[Y × ℕ] → ℤ[Y × ℕ] → ℤ[Y] → 0 is |
| 235 | short exact (`wangComplex`): the first map is `(x, k) ↦ (γ x, k) - (x, k + 1)`, the second |
| 236 | `(x, k) ↦ γ^k x`. -/ |
| 237 | lemma TimesBNat.shortExact_wangComplex : (wangComplex Y).ShortExact := |
| 238 | (shortExact_induced Y).snd |
| 239 | |
| 240 | /-- The map i is injective, every fixed point of g lies in its image, and z ↦ g(z) − z is onto. -/ |
| 241 | abbrev KoszulExact {A : Sort*} {B : Type*} [Sub B] (i : A → B) (g : B → B) : Prop := |
| 242 | Injective i ∧ fixedPoints g ⊆ Set.range i ∧ Surjective (g - id) |
| 243 | |
| 244 | /-- For `e : ψ ⋙ reprBy E ≅ incl C ⋙ Y`, the projection `Y × ℕ → Y` composed with `e⁻¹` on |
| 245 | `C × Bℕ`, giving a map `(Y × ℕ) ⟶ Hom(E, ψ ∘ fst −)`. -/ |
| 246 | private abbrev TimesBNat.wangProj {Y : TimesBNat C ⥤ Type 1} {ψ : C ⥤ C'} {E : C'} |
| 247 | (e : ψ ⋙ reprBy E ≅ incl C ⋙ Y) : |
| 248 | (TimesBNat.fst C ⋙ incl C ⋙ Y) ⊗ natWithShift ⟶ TimesBNat.fst C ⋙ ψ ⋙ reprBy E := |
| 249 | SemiCartesianMonoidalCategory.fst _ natWithShift ≫ (TimesBNat.fst C).whiskerLeft e.inv |
| 250 | |
| 251 | /-- If `ψ` is acyclic at `E` for `F'` (`IsAcyclicAt ψ F' E`), then pulling back along |
| 252 | `TimesBNat.wangProj e : Y × ℕ ⟶ Hom(E, ψ ∘ fst −)` is bijective on cohomology. -/ |
| 253 | private lemma TimesBNat.isBijective_wangProj {Y : TimesBNat C ⥤ Type 1} {ψ : C ⥤ C'} {E : C'} |
| 254 | (e : ψ ⋙ reprBy E ≅ incl C ⋙ Y) (hψ : IsAcyclicAt ψ F' E) : |
| 255 | (Comparison.restrict (TimesBNat.fst C ⋙ ψ) F').IsBijective |
| 256 | (freeAbMap (Y := reprBy E) (wangProj e)) := by |
| 257 | refine (hψ.precomp_of_bijective _ rfl fun D ↦ (e.app D).toEquiv.symm.bijective).trans |
| 258 | isLine_fst ?_ |
| 259 | exact freeAb.hom_ext fun _ _ ↦ rfl |
| 260 | |
| 261 | /-- Under `z ↦ homOfValue … (wangProj e) z`, precomposition with `wangSub Y` (the map |
| 262 | `(x, k) ↦ (γ x, k) - (x, k + 1)`) acts as `F'(g) - 1`. -/ |
| 263 | private lemma TimesBNat.wangSub_comp_homOfValue_wangProj {Y : TimesBNat C ⥤ Type 1} {ψ : C ⥤ C'} |
| 264 | {E : C'} (e : ψ ⋙ reprBy E ≅ incl C ⋙ Y) {g : E ⟶ E} |
| 265 | (h_shift_square : CommSq (ψ.whiskerLeft (reprMap g)) e.hom e.hom (shiftEnd Y 1).asHom) |
| 266 | (z : F'.obj E) : |
| 267 | wangSub Y ≫ homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) z = |
| 268 | homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) (F'.map g z - z) := by |
| 269 | let r := homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) |
| 270 | have r_app (D : TimesBNat C) (x : (incl C ⋙ Y).obj D.1) (k : natWithShift.obj D) (w : F'.obj E) : |
| 271 | (r w).app D (.of (x, k)) = F'.map (e.inv.app D.1 x).down w := homOfValue_app .. |
| 272 | refine hom_ext fun D ⟨x, k⟩ ↦ ?_ |
| 273 | -- the square `h_shift_square` at `x`: `e⁻¹ (t x) = g ≫ e⁻¹ x`, with `t = shiftEnd Y 1` |
| 274 | have h_square : |
| 275 | (e.inv.app D.1 ((shiftEnd Y 1).asHom.app D.1 x)).down = g ≫ (e.inv.app D.1 x).down := |
| 276 | congrArg (fun α ↦ (α.app D.1 x).down) h_shift_square.vert_inv.w |
| 277 | calc (wangSub Y ≫ r z).app D (.of (x, k)) |
| 278 | = (r z).app D (.of ((shiftEnd Y 1).asHom.app D.1 x, k)) - |
| 279 | (r z).app D (.of (x, k.map .succ)) := |
| 280 | (congrArg ((r z).app D) (congrArg₂ HSub.hSub (freeAb.map_of _ _ _) |
| 281 | (freeAb.map_of _ _ _))).trans (map_sub ((r z).app D).hom _ _) |
| 282 | _ = (r (F'.map g z - z)).app D (.of (x, k)) := by |
| 283 | refine (congrArg₂ HSub.hSub (r_app D _ k z) (r_app D x (k.map .succ) z)).trans ?_ |
| 284 | rw [r_app, h_square, map_sub, F'.map_comp_apply] |
| 285 | |
| 286 | /-- Pulling a section `y ∈ F'(ψ A)` back along `q : Y ⟶ Hom(A, −)` and then along |
| 287 | `wangPow Y : ℤ[Y × ℕ] ⟶ ℤ[Y]` gives the section on `ℤ[Y × ℕ]` associated to `F'(i) y` via |
| 288 | `wangProj e`. -/ |
| 289 | private lemma TimesBNat.wangPow_comp_homOfValue {Y : TimesBNat C ⥤ Type 1} {ψ : C ⥤ C'} {A : C} |
| 290 | {E : C'} {q : Y ⟶ TimesBNat.fst C ⋙ reprBy A} (e : ψ ⋙ reprBy E ≅ incl C ⋙ Y) |
| 291 | {i : ψ.obj A ⟶ E} |
| 292 | (hq_eq_comp : ∀ (D : C) (f : (ψ ⋙ reprBy E).obj D), |
| 293 | ψ.map (q ((incl C).obj D) (e.hom D f)).down = i ≫ f.down) |
| 294 | (y : (ψ ⋙ F').obj A) : |
| 295 | wangPow Y ≫ homOfValue (.restrict _ (ψ ⋙ F')) q y = |
| 296 | homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) (F'.map i y) := by |
| 297 | refine hom_ext fun D ⟨x, k⟩ ↦ (homOfValue_app (c := .restrict ..) q y D _).trans ?_ |
| 298 | let shift : (incl C).obj D.1 ⟶ D := (𝟙 D.1, k.down) |
| 299 | have h_shift : q.app D ((shiftEnd Y k.down).asHom.app D.1 x) = q.app ((incl C).obj D.1) x := by |
| 300 | change q.app D (Y.map shift x) = q.app ((incl C).obj D.1) x |
| 301 | simp [shift] |
| 302 | have h_comp : ψ.map (q.app ((incl C).obj D.1) x).down = i ≫ (e.inv.app D.1 x).down := by |
| 303 | simpa using hq_eq_comp D.1 (e.inv.app D.1 x) |
| 304 | have r_app : (homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) (F'.map i y)).app D |
| 305 | (.of (x, k)) = F'.map (e.inv.app D.1 x).down (F'.map i y) := homOfValue_app .. |
| 306 | change F'.map (ψ.map (q.app D ((shiftEnd Y k.down).asHom.app D.1 x)).down) y = _ |
| 307 | calc |
| 308 | _ = F'.map (i ≫ (e.inv.app D.1 x).down) y := by rw [h_shift, h_comp] |
| 309 | _ = _ := (F'.map_comp_apply _ _ _).trans r_app.symm |
| 310 | |
| 311 | /-- For a short exact sequence `0 → S.X₁ → S.X₂ → S.X₃ → 0` and coefficients `G`, if all higher |
| 312 | cohomology of `S.X₁` vanishes, `H^{n+1}(S.X₂, G)` vanishes, and precomposition with `S.f` is |
| 313 | surjective on `Hom(S.X₂, G) → Hom(S.X₁, G)`, then `H^{n+1}(S.X₃, G)` vanishes. -/ |
| 314 | private lemma subsingleton_H_succ_of_shortExact {D : Type 1} [Category D] |
| 315 | {S : ShortComplex (AbFunctor D)} (hS : S.ShortExact) (G : AbFunctor D) |
| 316 | (h_high₁ : ∀ m : ℕ, Subsingleton (H S.X₁ G (m + 1))) |
| 317 | (h_surj₀ : Surjective fun φ : S.X₂ ⟶ G ↦ S.f ≫ φ) |
| 318 | {n : ℕ} (h_high₂ : Subsingleton (H S.X₂ G (n + 1))) : |
| 319 | Subsingleton (H S.X₃ G (n + 1)) := by |
| 320 | have hf_surj : ∀ m : ℕ, Surjective (H.map G S.f m) |
| 321 | | 0, x => by |
| 322 | obtain ⟨φ, rfl⟩ : ∃ φ, mk₀ φ = x := (mk₀_bijective ..).surjective x |
| 323 | obtain ⟨ψ, rfl⟩ := h_surj₀ φ |
| 324 | exact ⟨mk₀ ψ, mk₀_comp_mk₀ _ _⟩ |
| 325 | | m + 1, x => ⟨0, (h_high₁ m).elim _ x⟩ |
| 326 | have hg_inj : Injective (H.map G S.g (n + 1)) := |
| 327 | (contravariant hS _).f_injective_of_g_surjective fun m _ ↦ hf_surj m |
| 328 | exact ⟨fun _ _ ↦ hg_inj (h_high₂.elim _ _)⟩ |
| 329 | |
| 330 | /-- Let `Y` be a set-valued functor on `C × Bℕ`, let `ψ : C ⥤ C'`, `A : C` and `E : C'`, and let |
| 331 | `F'` be an abelian-group-valued functor on `C'`. Let `e` identify the restriction of `Y` to `C` with |
| 332 | `Hom(E, ψ −)`, let `q : Y → Hom(A, −)` be induced by `i : ψ A → E` (`hq_eq_comp`), and let the |
| 333 | generator of ℕ act on `Y` by `g : E → E` (`h_shift_square`: through `e` it is `reprMap g`, |
| 334 | precomposition with `g` on `reprBy E = Hom(E, −)`). Suppose that restriction along `ψ` is bijective |
| 335 | on the cohomology of `Hom(E, −)` with coefficients `F'` (`New.Variety.IsAcyclicAt`), and that |
| 336 | `F'(i)` and `F'(g)` satisfy `New.Variety.KoszulExact`: `F'(i)` is injective, every fixed point of |
| 337 | `F'(g)` lies in the image of `F'(i)`, and `z ↦ F'(g) z − z` is onto. Then `q` is a line: for every |
| 338 | `n`, the map `Hⁿ(Hom(A, −), F' ∘ ψ) → Hⁿ(Y, F' ∘ ψ)` is bijective. -/ |
| 339 | lemma IsLine.of_acyclic {Y : TimesBNat C ⥤ Type 1} {ψ : C ⥤ C'} {A : C} {E : C'} |
| 340 | {q : Y ⟶ TimesBNat.fst C ⋙ reprBy A} (e : ψ ⋙ reprBy E ≅ incl C ⋙ Y) (hψ : IsAcyclicAt ψ F' E) |
| 341 | (i : ψ.obj A ⟶ E) (g : E ⟶ E) |
| 342 | (hq_eq_comp : ∀ (D : C) (f : (ψ ⋙ reprBy E).obj D), |
| 343 | ψ.map (q ((incl C).obj D) (e.hom D f)).down = i ≫ f.down) |
| 344 | (h_shift_square : CommSq (ψ.whiskerLeft (reprMap g)) e.hom e.hom (shiftEnd Y 1).asHom) |
| 345 | (h_koszul : KoszulExact (F'.map i) (F'.map g)) : |
| 346 | IsLine (ψ ⋙ F') q := by |
| 347 | -- Use the Wang sequence `0 → S.X₁ → S.X₂ → freeAb.obj Y → 0` (`wangComplex`). Its first two terms |
| 348 | -- have cohomology `F'.obj E` in degree `0` only, and `S.f` acts there as `F'.map g - 1`; so |
| 349 | -- `h_koszul` gives the cohomology of `Y`. |
| 350 | let S : ShortComplex (TimesBNat C ⥤ AddCommGrpCat.{1}) := wangComplex Y |
| 351 | have hS : S.ShortExact := shortExact_wangComplex Y |
| 352 | -- `r z` is the section `(x, k) ↦ F'(e⁻¹ x) z` on `S.X₂`. By `isBijective_reprBy_iff`, a |
| 353 | -- comparison from `reprBy E` is bijective iff this map is and the higher cohomology vanishes. |
| 354 | let r : F'.obj E →+ (S.X₂ ⟶ TimesBNat.fst C ⋙ ψ ⋙ F') := |
| 355 | homOfValue (.restrict (TimesBNat.fst C ⋙ ψ) F') (wangProj e) |
| 356 | obtain ⟨hr_bij, h_high⟩ : |
| 357 | Bijective r ∧ ∀ n : ℕ, Subsingleton (H S.X₂ (TimesBNat.fst C ⋙ ψ ⋙ F') (n + 1)) := |
| 358 | isBijective_reprBy_iff.mp (isBijective_wangProj e hψ) |
| 359 | have hf (z : F'.obj E) : S.f ≫ r z = r (F'.map g z - z) := |
| 360 | wangSub_comp_homOfValue_wangProj e h_shift_square z |
| 361 | have hq (y : (ψ ⋙ F').obj A) : S.g ≫ homOfValue (.restrict _ (ψ ⋙ F')) q y = r (F'.map i y) := |
| 362 | wangPow_comp_homOfValue e hq_eq_comp y |
| 363 | obtain ⟨h_inj, h_ker, h_surj⟩ : Injective (F'.map i) ∧ |
| 364 | fixedPoints (F'.map g) ⊆ Set.range (F'.map i) ∧ |
| 365 | Surjective fun z : F'.obj E ↦ F'.map g z - z := h_koszul |
| 366 | refine isBijective_reprBy_iff.mpr ⟨⟨fun y y' hy ↦ ?_, fun φ ↦ ?_⟩, fun n ↦ ?_⟩ |
| 367 | · -- Injective: pulled back along `S.g`, the section of `y` is `r (F'.map i y)`. |
| 368 | exact h_inj (hr_bij.injective (by rw [← hq, ← hq, hy])) |
| 369 | · -- A section `φ` on `Y` pulls back to some `r z` that `S.f` kills, so `z` is fixed by `g`. |
| 370 | obtain ⟨z, hz⟩ : ∃ z : F'.obj E, r z = S.g ≫ φ := hr_bij.surjective (S.g ≫ φ) |
| 371 | have hz_fixed : F'.map g z - z = 0 := |
| 372 | hr_bij.injective (by rw [← hf, hz, S.zero_assoc, Limits.zero_comp, map_zero]) |
| 373 | obtain ⟨y, rfl⟩ : z ∈ Set.range (F'.map i) := h_ker (sub_eq_zero.mp hz_fixed) |
| 374 | exact ⟨y, hS.epi_g.left_cancellation _ _ ((hq y).trans hz)⟩ |
| 375 | · -- `S.f` is onto on cohomology in all degrees, so that of `Y` embeds in that of `S.X₂`. |
| 376 | refine subsingleton_H_succ_of_shortExact hS _ h_high (fun φ ↦ ?_) (h_high n) |
| 377 | -- a class of degree `0` is some `r (F'.map g z - z)`, the image of `r z` |
| 378 | obtain ⟨z, rfl⟩ : ∃ z : F'.obj E, r (F'.map g z - z) = φ := hr_bij.surjective.comp h_surj φ |
| 379 | exact ⟨r z, hf z⟩ |
| 380 | |
| 381 | end New.Variety |
| 382 | |
| 383 | end WangSequence |
| 384 | |
| 385 | namespace New.Variety |
| 386 | |
| 387 | /-! |
| 388 | ## Compatible root systems twisted by ε |
| 389 | |
| 390 | `New.Period.epsPow` is the chosen homomorphism s ↦ ε^s from ℚ to the tilt O^♭ of O_C. The symbol ♯ |
| 391 | is Mathlib's `PreTilt.untilt`. |
| 392 | |
| 393 | * `New.Variety.compatibleRoots.atOne`: the value at 1. The twist does not change it, since ε^♯ = 1. |
| 394 | -/ |
| 395 | |
| 396 | section RootSystems |
| 397 | |
| 398 | open TimesBNat CategoryTheory Period PreTilt MonoidHom SingleObj |
| 399 | |
| 400 | variable {p : ℕ} [ThePrime p] |
| 401 | |
| 402 | /-- The character s ↦ ε^s of ℚ≥0 with values in O^♭, the restriction of the chosen character |
| 403 | `New.Period.epsPow` of ℚ. -/ |
| 404 | abbrev epsPowNNRat : Multiplicative ℚ≥0 →* OFlat := |
| 405 | epsPow.comp NNRat.coeHom.toAddMonoidHom.toMultiplicative |
| 406 | |
| 407 | /-- The functor sending a commutative O_C-algebra to its underlying set, lifted to an arbitrary |
| 408 | universe. -/ |
| 409 | abbrev underlyingSet.{u} : CommAlg OC ⥤ Type u := forget (CommAlg OC) ⋙ uliftFunctor.{u} |
| 410 | |
| 411 | /-- The functor on (O_C-algebras) × Bℕ sending A to the monoid homomorphisms χ from (ℚ≥0, +) to |
| 412 | (A, ·). A map (f, k) from A to B sends χ to η^k · (f ∘ χ), where η is the character s ↦ (ε^s)^♯ |
| 413 | read in B. -/ |
| 414 | def compatibleRoots : TimesBNat (CommAlg OC) ⥤ Type 1 where |
| 415 | obj A := ULift (Multiplicative ℚ≥0 →* A.1) |
| 416 | -- a map `(f, k)` pushes a character forward along `f`, then multiplies it `k` times by |
| 417 | -- the character `a ↦ (ε ^ a)^♯` |
| 418 | map {_ B} f := ↾fun χ ↦ |
| 419 | ⟨(fun φ ↦ (algebraMap OC B.1).toMonoidHom.comp (untilt.comp epsPowNNRat) * φ)^[f.2.toAdd] |
| 420 | (MonoidHom.comp f.1.hom χ.down)⟩ |
| 421 | map_id _ := by |
| 422 | ext |
| 423 | simp [id_as_one] |
| 424 | map_comp _ _ := by |
| 425 | ext |
| 426 | simp [comp_as_mul, toAdd_mul (α := ℕ), pow_add, mul_assoc] |
| 427 | |
| 428 | /-- The natural map, on O_C-algebras times Bℕ, sending a character ℚ≥0 → A to its value at 1. -/ |
| 429 | def compatibleRoots.atOne : compatibleRoots ⟶ TimesBNat.fst (CommAlg OC) ⋙ underlyingSet where |
| 430 | app _ := ↾fun χ ↦ ⟨χ.down (Multiplicative.ofAdd 1)⟩ |
| 431 | naturality A B f := by |
| 432 | -- the twist `η` does not change the value at `1`: there it is the untilt of `ε`, which is `1` |
| 433 | ext χ |
| 434 | let η : Multiplicative ℚ≥0 →* B.1 := (algebraMap OC B.1).1.comp (untilt.comp epsPowNNRat) |
| 435 | change ULift.up ((η * ·)^[f.2.toAdd] (MonoidHom.comp f.1.hom χ.down) (.ofAdd 1)) = |
| 436 | ⟨f.1.hom (χ.down (.ofAdd 1))⟩ |
| 437 | simp [η] |
| 438 | |
| 439 | variable {C : Type 1} [Category C] (F : AbFunctor C) (ψ : C ⥤ CommAlg OC) |
| 440 | |
| 441 | /-- Let ψ be a functor from C to O_C-algebras and y a point of ψ(A). This is the functor on C × Bℕ, |
| 442 | the fibre product (`fiberProd`) of `compatibleRoots.atOne` along ψ with the point `pointMap y`, |
| 443 | sending B to the pairs of a character w : ℚ≥0 → ψ(B) and a map f : A → B with w(1) = ψ(f)(y). Such a |
| 444 | w is a system of roots of the image of y. -/ |
| 445 | abbrev compatibleRootsAt {A : C} (y : (ψ ⋙ underlyingSet).obj A) : |
| 446 | C × SingleObj (Multiplicative ℕ) ⥤ Type 1 := |
| 447 | fiberProd ((ψ.prod (𝟭 (SingleObj (Multiplicative ℕ)))).whiskerLeft compatibleRoots.atOne) |
| 448 | ((TimesBNat.fst C).whiskerLeft (pointMap (Y := ψ ⋙ underlyingSet) (A := A) y)) |
| 449 | |
| 450 | /-- For every object A and unit y of ψ(A), the root systems of y (`New.Variety.compatibleRootsAt`) |
| 451 | form a line over Hom(A, −). That is, the projection to Hom(A, −) is bijective on cohomology with |
| 452 | coefficients F. -/ |
| 453 | abbrev CompatibleRootsAreLines : Prop := |
| 454 | ∀ (A : C) (y : (ψ ⋙ underlyingSet) A), IsUnit y.down → |
| 455 | IsLine F (Y := compatibleRootsAt ψ y) (fiberProd.snd ..) |
| 456 | |
| 457 | end RootSystems |
| 458 | |
| 459 | /-! |
| 460 | ## Periodic sequences and root systems of a unit of a test |
| 461 | |
| 462 | A root system of a unit `v` of a `p`-adic test (`New.Variety.PadicTest`) is a character of `ℚ≥0` |
| 463 | with value `v` at `1`. |
| 464 | |
| 465 | * `New.Variety.periodicSeq.koszulExact_shift`: the constants contain the kernel of the shift minus |
| 466 | the identity, and this map is onto. |
| 467 | * `New.Variety.periodicSeq.existsUnique_hom`: the universal property, over one domain. |
| 468 | * `New.Variety.PadicTest.isLine_compatibleRoots`: the root systems of a unit have flat base change |
| 469 | and form a line. |
| 470 | -/ |
| 471 | |
| 472 | section KummerTorsor |
| 473 | |
| 474 | open CategoryTheory Function CommAlgCat Filter Period Finset Pi IsScalarTower Fin ShortComplex |
| 475 | ModuleCat PreTilt Nat AddConstMapClass |
| 476 | |
| 477 | variable {p : ℕ} [ThePrime p] (R : Type _) [CommRing R] [Algebra OFlat R] |
| 478 | |
| 479 | /-- The `R`-algebra of periodic sequences `ℕ → R`. A sequence has a positive period if and only |
| 480 | if `n !` is a period for all large `n`; the latter form is the one that is visibly closed under |
| 481 | sums and products. -/ |
| 482 | def periodicSeq : Subalgebra R (ℕ → R) where |
| 483 | carrier := {f : ℕ → R | ∀ᶠ n : ℕ in atTop, Periodic f n !} |
| 484 | mul_mem' hf hg := (hf.and hg).mono fun _ h ↦ h.1.mul h.2 |
| 485 | add_mem' hf hg := (hf.and hg).mono fun _ h ↦ h.1.add h.2 |
| 486 | algebraMap_mem' _ := Eventually.of_forall fun _ _ ↦ rfl |
| 487 | |
| 488 | /-- The shift of periodic sequences, `(γ f) k = f (k + 1)`. -/ |
| 489 | @[local simp] |
| 490 | def periodicSeq.shift : periodicSeq R →ₐ[OFlat] periodicSeq R where |
| 491 | toFun f := ⟨f.val ∘ Nat.succ, f.property.mono (by grind [Periodic])⟩ |
| 492 | map_one' := by aesop |
| 493 | map_mul' := by aesop |
| 494 | map_zero' := by aesop |
| 495 | map_add' := by aesop |
| 496 | commutes' := by aesop |
| 497 | |
| 498 | open periodicSeq Multiplicative NeZero NNRat IsCell Submonoid Equiv MonoidalCategory |
| 499 | |
| 500 | variable {R} {M : ModuleCat OFlat} {D E : Type*} [CommRing D] [IsDomain D] [CommRing E] [IsDomain E] |
| 501 | |
| 502 | /-- A sequence `f` with a positive period `n` is periodic in the sense of `New.Variety.periodicSeq`: |
| 503 | for `m ≥ n` the number `m !` is a multiple of `n`, hence a period. -/ |
| 504 | lemma periodicSeq.mem_of_periodic {f : ℕ → R} (n : ℕ) (hn_pos : 0 < n) (h_periodic : Periodic f n) : |
| 505 | f ∈ periodicSeq R := by |
| 506 | filter_upwards [mem_atTop n] with m hm |
| 507 | simpa [Nat.div_mul_cancel (dvd_factorial hn_pos hm)] using h_periodic.nsmul (m ! / n) |
| 508 | |
| 509 | /-- Let `R` be an `O^♭`-algebra, so of characteristic `p`. Let `γ` be the shift. The inclusion of |
| 510 | the constants in the periodic sequences is injective, and its image contains the kernel of `γ - 1`. |
| 511 | The map `γ - 1` is onto. These facts hold after tensoring with any `O^♭`-module `M`, that is, for |
| 512 | the coefficients `moduleCoeff (tensorCoeff M)`, `B ↦ B ⊗ M`. -/ |
| 513 | lemma periodicSeq.koszulExact_shift : |
| 514 | KoszulExact ((moduleCoeff (tensorCoeff M)).map |
| 515 | (CommAlgCat.ofHom (toAlgHom OFlat R (periodicSeq R)))) |
| 516 | ((moduleCoeff (tensorCoeff M)).map (CommAlgCat.ofHom (shift R))) := by |
| 517 | -- The partial sums `σ f` satisfy `(shift - 1) (σ f) = f` and `f = f 0 + σ ((shift - 1) f)`, so |
| 518 | -- the sequence splits, and a split sequence stays exact after tensoring with `M`. |
| 519 | have h_sum (f : periodicSeq R) : (fun k ↦ ∑ i ∈ range k, f.val i) ∈ periodicSeq R := by |
| 520 | obtain ⟨n, hn⟩ : ∃ n : ℕ, Periodic f.val n ! := f.prop.exists |
| 521 | -- a shift by the period `n !` adds a constant, so a shift by `p * n !` adds `p` times it, |
| 522 | -- which is `0` in `R` |
| 523 | let s (k : ℕ) : R := ∑ i ∈ range k, f.val i |
| 524 | have h_shift (k : ℕ) : s (k + n !) = s k + s n ! := by |
| 525 | simp_rw [s, add_comm k, sum_range_add, add_comm n !, hn _, add_comm] |
| 526 | refine mem_of_periodic (p * n !) pos' fun k ↦ ?_ |
| 527 | simpa [natCast_eq_zero_of_algebra_oFlat] using map_add_nsmul (AddConstMap.mk s h_shift) k p |
| 528 | -- `ev₀` is the value at `0`, and `σ f` is the sequence of partial sums of `f` |
| 529 | let ev₀ : periodicSeq R →ₗ[OFlat] R := |
| 530 | { toFun f := f.val 0, map_add' f g := by simp, map_smul' a f := by simp } |
| 531 | let σ : periodicSeq R →ₗ[OFlat] periodicSeq R := |
| 532 | { toFun f := ⟨_, h_sum f⟩ |
| 533 | map_add' f g := Subtype.ext (funext fun k ↦ by simp [sum_add_distrib]) |
| 534 | map_smul' a f := Subtype.ext (funext fun k ↦ by simp [smul_sum]) } |
| 535 | let S : ShortComplex (ModuleCat OFlat) := |
| 536 | .mk (↟(toAlgHom _ R (periodicSeq R)).toLinearMap) (↟(shift R).toLinearMap - 𝟙 _) |
| 537 | let split : S.Splitting := |
| 538 | { r := ↟ev₀, s := ↟σ |
| 539 | -- the value at `0` of a constant sequence is the constant |
| 540 | f_r := by ext; simp [S, ev₀] |
| 541 | -- `(shift - 1) (σ f) = f` |
| 542 | s_g := by ext; simp [S, σ, sum_range_succ_sub_sum] |
| 543 | -- `f = f 0 + σ ((shift - 1) f)` |
| 544 | id := by ext; simp [S, ev₀, σ, ← sum_sub_distrib, sum_range_sub] } |
| 545 | let G : ModuleCat OFlat ⥤ AddCommGrpCat.{1} := |
| 546 | tensorRight M ⋙ forget₂ .. ⋙ AddCommGrpCat.uliftFunctor |
| 547 | have h_exact : (S.map G).ShortExact := (split.map G).shortExact |
| 548 | -- the maps of the mapped complex become those of the statement (`simp` splits the image of |
| 549 | -- `shift - 1`) |
| 550 | simp [S, ShortComplex.map] at h_exact |
| 551 | exact ⟨h_exact.ab_injective_f, |
| 552 | fun x hx ↦ (ab_exact_iff _).mp h_exact.exact x (sub_eq_zero.mpr hx), |
| 553 | h_exact.ab_surjective_g⟩ |
| 554 | |
| 555 | /-- For a ring map ψ from the periodic R-valued sequences to a ring without zero divisors and |
| 556 | finitely many sequences w_i, there is one index k with ψ(w_i) = ψ(w_i(k)) for all i, w_i(k) |
| 557 | read as a constant sequence. -/ |
| 558 | lemma periodicSeq.exists_eq_eval {ι : Sort*} [Finite ι] (ψ : periodicSeq R →+* D) |
| 559 | (w : ι → periodicSeq R) : |
| 560 | ∃ k : ℕ, ∀ i : ι, ψ (w i) = ψ (algebraMap R (periodicSeq R) ((w i).val k)) := by |
| 561 | -- Let `N !` be a common period. If every `k` fails for some sequence `w (f k)`, then the product |
| 562 | -- over `k < N !` of `w (f k)` minus its value at `k` is `0`, while `ψ` of each factor is not. |
| 563 | obtain ⟨N, hN⟩ : ∃ N : ℕ, ∀ i : ι, Periodic (w i).val N ! := |
| 564 | (eventually_all.mpr fun i ↦ (w i).prop).exists |
| 565 | by_contra! h_bad : ∀ k : ℕ, ∃ i : ι, ψ (w i) ≠ ψ (algebraMap R (periodicSeq R) ((w i).val k)) |
| 566 | choose f hf using h_bad |
| 567 | have h_prod : |
| 568 | ∏ k ∈ range N !, (w (f k) - algebraMap R (periodicSeq R) ((w (f k)).val k)) = 0 := by |
| 569 | ext x |
| 570 | -- at `x` the factor of index `x % N !` vanishes |
| 571 | simp [prod_eq_zero (mem_range.mpr (x.mod_lt pos')), (hN _).map_mod_nat] |
| 572 | simpa [prod_eq_zero_iff, sub_eq_zero, hf] using congrArg ψ h_prod |
| 573 | |
| 574 | /-- The Kummer torsor. Let `ζ`, `r`, `u` be characters of `ℚ≥0` in a domain `E`, with `ζ a` a |
| 575 | primitive root of unity of order the denominator of `a` and `u 1 = r 1 ≠ 0`. Let `D` be a ring |
| 576 | without zero divisors, `f : R →+* D`, let `s : D → E` be any map, and let the periodic sequence |
| 577 | `x n` lift `k ↦ ζ n ^ k * r n` along `s ∘ f`. Then `f` has exactly one extension `ϕ` to periodic |
| 578 | sequences with `s (ϕ (x n)) = u n` for all `n`. -/ |
| 579 | lemma periodicSeq.existsUnique_hom (f : R →+* D) (s : D → E) (ζ r u : Multiplicative ℚ≥0 →* E) |
| 580 | (x : Multiplicative ℚ≥0 → periodicSeq R) |
| 581 | (hx : ∀ (n : Multiplicative ℚ≥0) (k : ℕ), s (f ((x n).val k)) = (ζ ^ k * r) n) |
| 582 | (hr_ne : r (ofAdd 1) ≠ 0) (hζ : ∀ a : Multiplicative ℚ≥0, IsPrimitiveRoot (ζ a) a.toAdd.den) |
| 583 | (hu : u (ofAdd 1) = r (ofAdd 1)) : |
| 584 | ∃! ϕ : periodicSeq R →+* D, |
| 585 | ϕ.comp (algebraMap R (periodicSeq R)) = f ∧ ∀ n : Multiplicative ℚ≥0, s (ϕ (x n)) = u n := by |
| 586 | -- Write `q n = 1 / n !`. Both `u (q n)` and `r (q n)` are `n !`-th roots of `r 1`, so they differ |
| 587 | -- by a power `a n` of the primitive root `ζ (q n)`. A periodic sequence `y` takes the same value |
| 588 | -- at `a n` for all large `n`, and `ϕ y` is `f` of that value. |
| 589 | let q (n : ℕ) : Multiplicative ℚ≥0 := ofAdd (n ! : ℚ≥0)⁻¹ |
| 590 | have h_one (n : ℕ) : ofAdd 1 = q n ^ n ! := by simp [q, ← ofAdd_nsmul] |
| 591 | have h_prim {n : ℕ} : IsPrimitiveRoot (ζ (q n)) n ! := by |
| 592 | simpa [q, NeZero.ne, den_inv_of_ne_zero] using hζ (q n) |
| 593 | have h_root (n : ℕ) : ∃ k ∈ range n !, ζ (q n) ^ k * r (q n) = u (q n) := by |
| 594 | have h_pow : u (q n) ^ n ! = r (q n) ^ n ! := by simpa [h_one n] using hu |
| 595 | rwa [← Polynomial.mem_nthRoots pos', h_prim.nthRoots_eq rfl, Multiset.mem_map] at h_pow |
| 596 | choose a ha_lt ha using h_root |
| 597 | -- the exponent `a n` is unique modulo `n !` |
| 598 | have h_mod (n k : ℕ) (hk : ζ (q n) ^ k * r (q n) = u (q n)) : a n = k % n ! := by |
| 599 | have hr : r (q n) ≠ 0 := |
| 600 | ne_zero_pow (factorial_ne_zero n) (by rwa [← map_pow, ← h_one n]) |
| 601 | refine h_prim.pow_inj (mem_range.mp (ha_lt n)) (mod_lt k pos') (mul_right_cancel₀ hr ?_) |
| 602 | rw [← pow_eq_pow_mod k h_prim.pow_eq_one, ha, hk] |
| 603 | -- so a sequence `y` of period `(N y) !` has the same value at every such exponent `k` |
| 604 | choose N hN using fun y : periodicSeq R ↦ y.prop.exists |
| 605 | have h_val (y : periodicSeq R) (k : ℕ) (hk : ζ (q (N y)) ^ k * r (q (N y)) = u (q (N y))) : |
| 606 | y.val (a (N y)) = y.val k := by rw [h_mod (N y) k hk, (hN y).map_mod_nat] |
| 607 | -- `a m` works at every `t` that is a multiple of `1 / m !`, so at a given `t` for large `m` |
| 608 | have h_large (t : Multiplicative ℚ≥0) : ∀ᶠ m in atTop, (ζ ^ a m * r) t = u t := by |
| 609 | filter_upwards [mem_atTop t.toAdd.den] with m hm |
| 610 | have h_pow : q m ^ (t.toAdd.num * (m ! / t.toAdd.den)) = t := |
| 611 | toAdd.injective (by simp [q, field, dvd_factorial, hm]) |
| 612 | rw [← h_pow, map_pow, map_pow, ← ha m, MonoidHom.mul_apply, MonoidHom.pow_apply] |
| 613 | have h_lim (y : periodicSeq R) : (fun _ ↦ y.val (a (N y))) =ᶠ[atTop] fun m ↦ y.val (a m) := |
| 614 | (h_large (q (N y))).mono fun m h_m ↦ h_val y (a m) h_m |
| 615 | -- the limit of `y (a m)` is a ring map in `y` |
| 616 | let lim : periodicSeq R →+* R := |
| 617 | { toFun y := y.val (a (N y)) |
| 618 | map_one' := rfl |
| 619 | map_zero' := rfl |
| 620 | map_mul' y y' := |
| 621 | eventually_const.mp ((h_lim (y * y')).trans ((h_lim y).mul (h_lim y')).symm) |
| 622 | map_add' y y' := |
| 623 | eventually_const.mp ((h_lim (y + y')).trans ((h_lim y).add (h_lim y')).symm) } |
| 624 | refine ⟨f.comp lim, ⟨rfl, fun t ↦ ?_⟩, ?_⟩ |
| 625 | · obtain ⟨m, h_eq, h_exp⟩ : ∃ m : ℕ, |
| 626 | (x t).val (a (N (x t))) = (x t).val (a m) ∧ (ζ ^ a m * r) t = u t := |
| 627 | ((h_lim (x t)).and (h_large t)).exists |
| 628 | change s (f ((x t).val (a (N (x t))))) = u t |
| 629 | rw [h_eq, hx, h_exp] |
| 630 | · rintro ψ ⟨rfl, hψ⟩ |
| 631 | ext y |
| 632 | -- `ψ` is evaluation at one index `k` on both `y` and `x (q (N y))`; the latter pins `k` down |
| 633 | obtain ⟨k, hk⟩ := exists_eq_eval ψ ![y, x (q (N y))] |
| 634 | have hk_x : ψ (x (q (N y))) = ψ (algebraMap R (periodicSeq R) ((x (q (N y))).val k)) := hk 1 |
| 635 | have h_exp : (ζ ^ k * r) (q (N y)) = u (q (N y)) := by rw [← hx, ← hψ, hk_x, RingHom.comp_apply] |
| 636 | calc ψ y = ψ (algebraMap R (periodicSeq R) (y.val k)) := hk 0 |
| 637 | _ = ψ (algebraMap R (periodicSeq R) (y.val (a (N y)))) := by rw [h_val y k h_exp] |
| 638 | |
| 639 | omit [ThePrime p] [Algebra OFlat R] in |
| 640 | /-- If `R` is perfect of characteristic `p`, so is the ring of periodic sequences over `R`: |
| 641 | Frobenius acts termwise, and a sequence is periodic exactly when its termwise image is. -/ |
| 642 | lemma periodicSeq.perfectRing [ExpChar R p] [PerfectRing R p] : PerfectRing (periodicSeq R) p where |
| 643 | bijective_frobenius := by |
| 644 | let e : (ℕ → R) ≃ (ℕ → R) := (Equiv.refl ℕ).arrowCongr (frobeniusEquiv R p).toEquiv |
| 645 | have h_mem (f : ℕ → R) : f ∈ periodicSeq R ↔ e f ∈ periodicSeq R := by |
| 646 | -- without `-RingEquiv.toEquiv_eq_coe` simp unfolds the equivalence to `frobenius` |
| 647 | simp [periodicSeq, e, -RingEquiv.toEquiv_eq_coe] |
| 648 | exact (e.subtypeEquiv h_mem).bijective |
| 649 | |
| 650 | /-- Every ring map `g` from `O_C` to a cell `T` (`New.Variety.IsCell`: a `p`-adically complete, |
| 651 | absolutely integrally closed valuation domain in which `p ≠ 0`) is injective. -/ |
| 652 | lemma injective_of_isCell {T : Type} [CommRing T] [IsCell p T] (g : OC →+* T) : |
| 653 | Function.Injective g := by |
| 654 | -- a nonzero element of `OC` divides a power of `p`, which is nonzero in the cell |
| 655 | refine (injective_iff_map_eq_zero _).mpr fun a ha ↦ by_contra fun h_ne ↦ ?_ |
| 656 | obtain ⟨n, hn⟩ : ∃ n : ℕ, a ∣ p ^ n := |
| 657 | OC.exists_dvd_pow (Fact.out : ¬IsUnit (p : OC)) h_ne |
| 658 | have h_dvd : g a ∣ (p : T) ^ n := by simpa using map_dvd g hn |
| 659 | rw [ha, zero_dvd_iff] at h_dvd |
| 660 | exact pow_ne_zero n p_ne_zero h_dvd |
| 661 | |
| 662 | /-- The map of tests `c ⟶ D` whose tilt agrees on constant sequences with the `O^♭`-algebra map `ϕ` |
| 663 | from the periodic sequences over the tilt of `c` to the tilt of `D`. -/ |
| 664 | private def PadicTest.baseOfHom {c D : PadicTest} |
| 665 | (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) : c ⟶ D := |
| 666 | tilt.preimage (X := c) (ofHom (ϕ.comp (toAlgHom OFlat c.TiltRing (periodicSeq c.TiltRing)))) |
| 667 | |
| 668 | /-- The tilt of `PadicTest.baseOfHom ϕ` is `ϕ` on constant sequences. -/ |
| 669 | private lemma PadicTest.preTiltMap_baseOfHom_apply {c D : PadicTest} |
| 670 | (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) (y : c.TiltRing) : |
| 671 | PreTilt.map p (baseOfHom ϕ).toRingHom y = |
| 672 | ϕ (algebraMap c.TiltRing (periodicSeq c.TiltRing) y) := |
| 673 | ConcreteCategory.congr_hom (tilt.map_preimage _) y |
| 674 | |
| 675 | /-- `PadicTest.baseOfHom ϕ` is the map of tests `f` whose tilt agrees with `ϕ` on constant |
| 676 | sequences. -/ |
| 677 | private lemma PadicTest.baseOfHom_eq_of_forall_algebraMap {c D : PadicTest} |
| 678 | {ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing} {f : c ⟶ D} |
| 679 | (h_const : |
| 680 | ∀ y : c.TiltRing, |
| 681 | ϕ (algebraMap c.TiltRing (periodicSeq c.TiltRing) y) = PreTilt.map p f.1 y) : |
| 682 | baseOfHom ϕ = f := |
| 683 | tilt.map_injective <| hom_ext <| AlgHom.ext fun y ↦ |
| 684 | (preTiltMap_baseOfHom_apply ϕ y).trans (h_const y) |
| 685 | |
| 686 | /-- A termwise relation between the untilts `♯` of two periodic sequences passes through `ϕ`: if |
| 687 | `(w k)^♯ = t * (w' k)^♯` for every `k`, then `(ϕ w)^♯ = t' * (ϕ w')^♯`, where `t'` is the image of |
| 688 | `t` under `PadicTest.baseOfHom ϕ`. -/ |
| 689 | private lemma PadicTest.untilt_map_eq_mul_of_forall {c D : PadicTest} |
| 690 | (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) (t : c.ProdRing) |
| 691 | (w w' : periodicSeq c.TiltRing) (hw : ∀ k : ℕ, (w.val k).untilt = t * (w'.val k).untilt) : |
| 692 | (ϕ w).untilt = (baseOfHom ϕ).toRingHom t * (ϕ w').untilt := by |
| 693 | -- On each cell `j`, `ϕ` agrees on `w` and on `w'` with the evaluation at one index |
| 694 | -- (`exists_eq_eval`). |
| 695 | funext j |
| 696 | let ev_j : D.ProdRing →+* D.Cell j := Pi.evalRingHom D.Cell j |
| 697 | obtain ⟨k, hk⟩ := exists_eq_eval ((PreTilt.map p ev_j).comp ϕ.toRingHom) ![w, w'] |
| 698 | -- where `ϕ y` agrees on the cell with `ϕ` of the constant `y k`, its untilt is that of `y k` |
| 699 | -- mapped by `baseOfHom ϕ` |
| 700 | have h_at_k (y : periodicSeq c.TiltRing) |
| 701 | (hy : PreTilt.map p ev_j (ϕ y) = |
| 702 | PreTilt.map p ev_j (ϕ (algebraMap c.TiltRing (periodicSeq c.TiltRing) (y.val k)))) : |
| 703 | (ϕ y).untilt j = (baseOfHom ϕ).toRingHom (y.val k).untilt j := by |
| 704 | simpa [ev_j, PreTilt.untilt_natural, ← preTiltMap_baseOfHom_apply] using congrArg untilt hy |
| 705 | rw [Pi.mul_apply, h_at_k w (hk 0), h_at_k w' (hk 1), hw, map_mul, Pi.mul_apply] |
| 706 | |
| 707 | /-- The character `a ↦ (ε ^ a)^♯` of `ℚ≥0` valued in the ring of a `p`-adic test `c`. -/ |
| 708 | private def PadicTest.epsChar (c : PadicTest) : Multiplicative ℚ≥0 →* c.ProdRing := |
| 709 | c.structureMap.toMonoidHom.comp (untilt.comp epsPowNNRat) |
| 710 | |
| 711 | /-- The statement on one cell: let `r` be a character of `ℚ≥0` in `c.ProdRing` with `r 1` a unit, |
| 712 | let the periodic sequences `x n` over the tilt of `c` have untilts `k ↦ c.epsChar n ^ k * r n`, and |
| 713 | let `f : c ⟶ D` and the character `u` in the ring of `D` satisfy `u 1 = f (r 1)`. Then for each |
| 714 | index `j` exactly one ring map `ϕ` from the periodic sequences over the tilt of `c` to the tilt of |
| 715 | `D.Cell j` restricts on constants to the tilt of `f` followed by the projection, and has |
| 716 | `(ϕ (x n))^♯ = u n j` for all `n`. -/ |
| 717 | private lemma PadicTest.existsUnique_cell_hom_untilt_eq {c D : PadicTest} |
| 718 | (r : Multiplicative ℚ≥0 →* c.ProdRing) (hr_unit : IsUnit (r (ofAdd 1))) |
| 719 | (x : Multiplicative ℚ≥0 → periodicSeq c.TiltRing) |
| 720 | (hx : ∀ (n : Multiplicative ℚ≥0) (k : ℕ), ((x n).val k).untilt = c.epsChar n ^ k * r n) |
| 721 | (f : c ⟶ D) (u : Multiplicative ℚ≥0 →* D.ProdRing) (hu : u (ofAdd 1) = f.1 (r (ofAdd 1))) |
| 722 | (j : D.Index) : |
| 723 | ∃! ϕ : periodicSeq c.TiltRing →+* PreTilt (D.Cell j) p, |
| 724 | ϕ.comp (algebraMap c.TiltRing (periodicSeq c.TiltRing)) = |
| 725 | PreTilt.map p ((Pi.evalRingHom D.Cell j).comp f.toRingHom) ∧ |
| 726 | ∀ n : Multiplicative ℚ≥0, (ϕ (x n)).untilt = u n j := by |
| 727 | -- This is `existsUnique_hom`; `c.epsChar` stays faithful as `OC` embeds in the cell. |
| 728 | let g : c.ProdRing →+* D.Cell j := (Pi.evalRingHom D.Cell j).comp f.toRingHom |
| 729 | let ζ_j : Multiplicative ℚ≥0 →* D.Cell j := g.toMonoidHom.comp c.epsChar |
| 730 | have h_inj : Injective (g.comp c.structureMap) := injective_of_isCell _ |
| 731 | have hx_j (n : Multiplicative ℚ≥0) (k : ℕ) : |
| 732 | untilt (PreTilt.map p g ((x n).val k)) = (ζ_j ^ k * g.toMonoidHom.comp r) n := by |
| 733 | simp [ζ_j, hx] |
| 734 | have hζ_j (a : Multiplicative ℚ≥0) : IsPrimitiveRoot (ζ_j a) a.toAdd.den := |
| 735 | (isPrimitiveRoot_untilt_epsPow (ofAdd (a.toAdd : ℚ))).map_of_injective h_inj |
| 736 | exact existsUnique_hom (PreTilt.map p g) untilt ζ_j (g.toMonoidHom.comp r) |
| 737 | ((Pi.evalRingHom D.Cell j).toMonoidHom.comp u) x hx_j (hr_unit.map g).ne_zero hζ_j |
| 738 | (congrFun hu j) |
| 739 | |
| 740 | /-- Let `r` be a character of `ℚ≥0` in `c.ProdRing` with `r 1` a unit, and let the periodic |
| 741 | sequences `x n` over the tilt of `c` have untilts `k ↦ c.epsChar n ^ k * r n`. For a map of tests |
| 742 | `f : c ⟶ D` and a character `u` in the ring of `D` with `u 1 = f (r 1)`, exactly one `ϕ` from the |
| 743 | periodic sequences to the tilt of `D` has `baseOfHom ϕ = f` and `(ϕ (x n))^♯ = u n`. -/ |
| 744 | private lemma PadicTest.existsUnique_baseOfHom_eq_and_untilt_eq {c D : PadicTest} |
| 745 | (r : Multiplicative ℚ≥0 →* c.ProdRing) (hr_unit : IsUnit (r (ofAdd 1))) |
| 746 | (x : Multiplicative ℚ≥0 → periodicSeq c.TiltRing) |
| 747 | (hx : ∀ (n : Multiplicative ℚ≥0) (k : ℕ), ((x n).val k).untilt = c.epsChar n ^ k * r n) |
| 748 | (f : c ⟶ D) (u : Multiplicative ℚ≥0 →* D.ProdRing) (hu : u (ofAdd 1) = f.1 (r (ofAdd 1))) : |
| 749 | ∃! ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing, |
| 750 | baseOfHom ϕ = f ∧ ∀ n : Multiplicative ℚ≥0, (ϕ (x n)).untilt = u n := by |
| 751 | -- On each cell this is `existsUnique_cell_hom_untilt_eq`; the tilt of `D` is the product of the |
| 752 | -- tilts of its cells. |
| 753 | choose ϕ hϕ h_unique using existsUnique_cell_hom_untilt_eq r hr_unit x hx f u hu |
| 754 | let ψ : periodicSeq c.TiltRing →+* D.TiltRing := D.tiltPiEquiv.symm.toRingHom.comp (.pi ϕ) |
| 755 | have hψ_cell (j : D.Index) (y : periodicSeq c.TiltRing) : |
| 756 | PreTilt.map p (Pi.evalRingHom D.Cell j) (ψ y) = ϕ j y := |
| 757 | congrFun (D.tiltPiEquiv.right_inv fun j ↦ ϕ j y) j |
| 758 | have hψ_const (y : c.TiltRing) : |
| 759 | ψ (algebraMap c.TiltRing (periodicSeq c.TiltRing) y) = PreTilt.map p f.toRingHom y := |
| 760 | D.tiltPiEquiv.symm_apply_eq.mpr |
| 761 | (funext fun j ↦ |
| 762 | (RingHom.congr_fun (hϕ j).left y).trans (RingHom.congr_fun (PreTilt.map_comp ..) _)) |
| 763 | have hψ_commutes (a : OFlat) : |
| 764 | ψ (algebraMap OFlat (periodicSeq c.TiltRing) a) = algebraMap OFlat D.TiltRing a := |
| 765 | (hψ_const (algebraMap OFlat c.TiltRing a)).trans ((tilt.map f).hom.commutes a) |
| 766 | refine ⟨⟨ψ, hψ_commutes⟩, ⟨baseOfHom_eq_of_forall_algebraMap hψ_const, fun n ↦ ?_⟩, ?_⟩ |
| 767 | · funext j |
| 768 | have h_cell_x : ((ϕ j) (x n)).untilt = u n j := (hϕ j).right n |
| 769 | rwa [← hψ_cell, PreTilt.untilt_natural] at h_cell_x |
| 770 | · rintro ψ' ⟨rfl, hψ'⟩ |
| 771 | -- on constants, `ψ'` followed by the tilt of the projection to the cell `j` is the tilt of |
| 772 | -- `baseOfHom ψ'` followed by that projection |
| 773 | have h_const (j : D.Index) : |
| 774 | ((PreTilt.map p (Pi.evalRingHom D.Cell j)).comp ψ'.toRingHom).comp |
| 775 | (algebraMap c.TiltRing (periodicSeq c.TiltRing)) = |
| 776 | PreTilt.map p ((Pi.evalRingHom D.Cell j).comp (baseOfHom ψ').toRingHom) := by |
| 777 | ext y |
| 778 | simp [PreTilt.map_comp, ← preTiltMap_baseOfHom_apply] |
| 779 | have h_eq (j : D.Index) : (PreTilt.map p (Pi.evalRingHom D.Cell j)).comp ψ'.toRingHom = ϕ j := |
| 780 | h_unique j _ ⟨h_const j, fun n ↦ (PreTilt.untilt_natural ..).trans (congrFun (hψ' n) j)⟩ |
| 781 | exact AlgHom.ext fun y ↦ |
| 782 | D.tiltPiEquiv.eq_symm_apply.mpr (funext fun j ↦ RingHom.congr_fun (h_eq j) y) |
| 783 | |
| 784 | /-- Let `v` be a unit of the ring of the test `c`. There are a root system `r` of `v` (a character |
| 785 | of `ℚ≥0` with `r 1 = v`) and periodic sequences `x n` over the tilt of `c` whose untilts are |
| 786 | `k ↦ c.epsChar n ^ k * r n`. -/ |
| 787 | private lemma PadicTest.exists_rootSystem_periodicSeq (c : PadicTest) {v : c.ProdRing} |
| 788 | (hv : IsUnit v) : |
| 789 | ∃ (r : Multiplicative ℚ≥0 →* c.ProdRing) (x : Multiplicative ℚ≥0 → periodicSeq c.TiltRing), |
| 790 | r (ofAdd 1) = v ∧ ∀ (n : Multiplicative ℚ≥0) (k : ℕ), |
| 791 | ((x n).val k).untilt = c.epsChar n ^ k * r n := by |
| 792 | have h_untilt_surj : ∀ y : c.ProdRing, ∃ b : c.TiltRing, b.untilt = y := |
| 793 | untilt_surjective_of_isAbsIntegrallyClosed (R := c.ProdRing) (p := p) |
| 794 | choose σ hσ using h_untilt_surj |
| 795 | -- The ring of `c` is absolutely integrally closed, so `v` has a compatible system `s` of roots; |
| 796 | -- `r` is its restriction to `ℚ≥0`. |
| 797 | obtain ⟨s, hs⟩ : ∃ s : ℚ →+ _root_.Additive c.ProdRingˣ, s 1 = hv.unit := |
| 798 | exists_compatible_roots _ |
| 799 | let r : Multiplicative ℚ≥0 →* c.ProdRing := |
| 800 | (Units.coeHom _).comp (s.comp coeHom.toAddMonoidHom).toMultiplicativeLeft |
| 801 | have h_r_one : r (ofAdd 1) = v := by |
| 802 | have h_r : r (ofAdd 1) = ((Additive.toMul hv.unit : c.ProdRingˣ) : c.ProdRing) := by |
| 803 | simp [r, hs] |
| 804 | exact h_r.trans hv.unit_spec |
| 805 | -- `c.epsChar n` is a root of unity of order dividing the denominator of `n`, a period of `x n`. |
| 806 | have hζ (n : Multiplicative ℚ≥0) : c.epsChar n ^ n.toAdd.den = 1 := by |
| 807 | -- `(ε ^ n)^♯` is a primitive root of unity of order the denominator of `n` |
| 808 | have h_root : c.structureMap ((epsPow (ofAdd (n.toAdd : ℚ))).untilt ^ (n.toAdd : ℚ).den) = |
| 809 | c.structureMap 1 := |
| 810 | congrArg c.structureMap (isPrimitiveRoot_untilt_epsPow (ofAdd (n.toAdd : ℚ))).pow_eq_one |
| 811 | simpa [epsChar, NNRat.den_coe] using h_root |
| 812 | have h_periodic (n : Multiplicative ℚ≥0) : |
| 813 | Periodic (fun k ↦ σ ((c.epsChar ^ k * r) n)) n.toAdd.den := by |
| 814 | simp [pow_add, hζ] |
| 815 | let x (n : Multiplicative ℚ≥0) : periodicSeq c.TiltRing := |
| 816 | ⟨fun k ↦ σ ((c.epsChar ^ k * r) n), mem_of_periodic n.toAdd.den n.toAdd.den_pos (h_periodic n)⟩ |
| 817 | exact ⟨r, x, h_r_one, fun n k ↦ hσ _⟩ |
| 818 | |
| 819 | /-- Given periodic sequences `x n` lifting `k ↦ c.epsChar n ^ k * r n`, an `OFlat`-algebra map |
| 820 | `ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing` induces the character `n ↦ (ϕ (x n))^♯` of `ℚ≥0` |
| 821 | in `D.ProdRing`. -/ |
| 822 | private def PadicTest.rootSystemOfHom {c D : PadicTest} {r : Multiplicative ℚ≥0 →* c.ProdRing} |
| 823 | {x : Multiplicative ℚ≥0 → periodicSeq c.TiltRing} |
| 824 | (hx : ∀ (n : Multiplicative ℚ≥0) (k : ℕ), ((x n).val k).untilt = c.epsChar n ^ k * r n) |
| 825 | (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) : Multiplicative ℚ≥0 →* D.ProdRing where |
| 826 | toFun := untilt ∘ ϕ ∘ x |
| 827 | map_one' := by |
| 828 | have h_x_one (k : ℕ) : |
| 829 | ((x 1).val k).untilt = 1 * ((1 : periodicSeq c.TiltRing).val k).untilt := by |
| 830 | simp [hx] |
| 831 | simpa using untilt_map_eq_mul_of_forall ϕ 1 (x 1) 1 h_x_one |
| 832 | map_mul' a b := by |
| 833 | have h_x_mul (k : ℕ) : |
| 834 | ((x (a * b)).val k).untilt = 1 * ((x a * x b).val k).untilt := by |
| 835 | rw [one_mul, Subalgebra.coe_mul, Pi.mul_apply, map_mul, hx, hx, hx, map_mul, map_mul, |
| 836 | mul_pow, mul_mul_mul_comm] |
| 837 | simpa using untilt_map_eq_mul_of_forall ϕ 1 (x (a * b)) (x a * x b) h_x_mul |
| 838 | |
| 839 | /-- Given a root system `r` of a unit `r 1` of `c.ProdRing` and periodic sequences `x n` lifting |
| 840 | `k ↦ c.epsChar n ^ k * r n`, sending `ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing` to |
| 841 | `(rootSystemOfHom hx ϕ, baseOfHom ϕ)` gives a natural isomorphism from |
| 842 | `tilt ⋙ reprBy (.of _ (periodicSeq c.TiltRing))` to the functor of compatible root systems of |
| 843 | `r 1`. -/ |
| 844 | private def PadicTest.compatibleRootsIso (c : PadicTest) |
| 845 | {r : Multiplicative ℚ≥0 →* c.ProdRing} (hv : IsUnit (r (ofAdd 1))) |
| 846 | {x : Multiplicative ℚ≥0 → periodicSeq c.TiltRing} |
| 847 | (hx : ∀ (n : Multiplicative ℚ≥0) (k : ℕ), ((x n).val k).untilt = c.epsChar n ^ k * r n) : |
| 848 | tilt ⋙ reprBy (.of _ (periodicSeq c.TiltRing)) ≅ |
| 849 | TimesBNat.incl PadicTest ⋙ compatibleRootsAt algFunctor ⟨r (ofAdd 1)⟩ := |
| 850 | let toFib (D : PadicTest) (ϕ : (tilt ⋙ reprBy (.of _ (periodicSeq c.TiltRing))).obj D) : |
| 851 | (TimesBNat.incl PadicTest ⋙ compatibleRootsAt algFunctor ⟨r (ofAdd 1)⟩).obj D := |
| 852 | ⟨(⟨rootSystemOfHom hx ϕ.down.hom⟩, ⟨baseOfHom ϕ.down.hom⟩), congrArg ULift.up <| by |
| 853 | -- `c.epsChar 1 = 1`, so the sequence `x 1` lifts the constant `r 1` |
| 854 | let ϕ' : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing := ϕ.down.hom |
| 855 | have h_x_one (k : ℕ) : ((x (ofAdd 1)).val k).untilt = |
| 856 | r (ofAdd 1) * ((1 : periodicSeq c.TiltRing).val k).untilt := by |
| 857 | simp [hx, epsChar] |
| 858 | change (ϕ' (x (ofAdd 1))).untilt = (baseOfHom ϕ').1 (r (ofAdd 1)) |
| 859 | simpa using untilt_map_eq_mul_of_forall ϕ' (r (ofAdd 1)) (x (ofAdd 1)) 1 h_x_one⟩ |
| 860 | -- Universality: a map `f` of tests and a system `u` of roots of `f v` come from one `ϕ`. |
| 861 | have h_univ {D : PadicTest} (f : c ⟶ D) (u : Multiplicative ℚ≥0 →* D.ProdRing) |
| 862 | (hu : u (ofAdd 1) = f.1 (r (ofAdd 1))) : |
| 863 | ∃! ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing, |
| 864 | baseOfHom ϕ = f ∧ rootSystemOfHom hx ϕ = u := by |
| 865 | have h_sys_eq (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) : |
| 866 | rootSystemOfHom hx ϕ = u ↔ ∀ n, (ϕ (x n)).untilt = u n := MonoidHom.ext_iff |
| 867 | simpa only [h_sys_eq] using existsUnique_baseOfHom_eq_and_untilt_eq r hv x hx f u hu |
| 868 | -- So `ϕ ↦ (rootSystemOfHom hx ϕ, baseOfHom ϕ)` is a bijection onto the pairs of the statement. |
| 869 | have h_bij (D : PadicTest) : Bijective (toFib D) := by |
| 870 | refine (bijective_iff_existsUnique _).2 fun ⟨⟨⟨u⟩, ⟨f⟩⟩, hu⟩ ↦ ?_ |
| 871 | obtain ⟨ϕ, ⟨rfl, rfl⟩, h_unique⟩ := h_univ f u (congrArg ULift.down hu) |
| 872 | refine ⟨⟨ofHom ϕ⟩, rfl, fun ψ hψ ↦ ?_⟩ |
| 873 | -- `toFib D ψ = toFib D ⟨ofHom ϕ⟩` compares the maps of tests and the root systems |
| 874 | have h_pair : (toFib D ψ).val = (toFib D ⟨ofHom ϕ⟩).val := congrArg Subtype.val hψ |
| 875 | have h_base_eq : baseOfHom ψ.down.hom = baseOfHom ϕ := congrArg (ULift.down ∘ Prod.snd) h_pair |
| 876 | have h_sys_eq : rootSystemOfHom hx ψ.down.hom = rootSystemOfHom hx ϕ := |
| 877 | congrArg (ULift.down ∘ Prod.fst) h_pair |
| 878 | rw [← h_unique ψ.down.hom ⟨h_base_eq, h_sys_eq⟩] |
| 879 | rfl |
| 880 | NatIso.ofComponents (fun D ↦ (Equiv.ofBijective (toFib D) (h_bij D)).toIso) fun f ↦ by |
| 881 | -- The bijection is natural in the test `D`. |
| 882 | ext ⟨⟨ϕ⟩⟩ |
| 883 | have h_sys_map : rootSystemOfHom hx ((tilt.map f).hom.comp ϕ) = |
| 884 | f.toRingHom.toMonoidHom.comp (rootSystemOfHom hx ϕ) := |
| 885 | MonoidHom.ext fun _ ↦ PreTilt.untilt_natural f.toRingHom _ |
| 886 | have h_base_map : baseOfHom ((tilt.map f).hom.comp ϕ) = baseOfHom ϕ ≫ f := |
| 887 | baseOfHom_eq_of_forall_algebraMap fun y ↦ |
| 888 | ((RingHom.congr_fun (PreTilt.map_comp p f.toRingHom (baseOfHom ϕ).toRingHom) y).trans |
| 889 | (congrArg (PreTilt.map p f.toRingHom) (preTiltMap_baseOfHom_apply ϕ y))).symm |
| 890 | exact Subtype.ext (Prod.ext (congrArg ULift.up h_sys_map) (congrArg ULift.up h_base_map)) |
| 891 | |
| 892 | /-- Let the coefficients `B ↦ B^♭ ⊗ M` make `Hom(b, (-)^♭)` acyclic for every perfect `b`, and let |
| 893 | `v` be a unit of the ring of a test `c`. The root systems of `v` (pairs of a character `u` of `ℚ≥0` |
| 894 | and a map of tests `f : c ⟶ D` with `u 1 = f v`, the generator of `ℕ` multiplying `u` by |
| 895 | `a ↦ (ε ^ a)^♯`) (a) have flat base change and (b) form a line over the functor represented by `c`: |
| 896 | the projection `(u, f) ↦ f` identifies the cohomology of the functor represented by `c` with that |
| 897 | of the homotopy quotient. -/ |
| 898 | lemma PadicTest.isLine_compatibleRoots |
| 899 | (h_acyclic : IsAcyclicOnPerfect (moduleCoeff (tensorCoeff M))) |
| 900 | (c : PadicTest) (v : (algFunctor ⋙ underlyingSet) c) (hv : IsUnit v.down) : |
| 901 | -- (a) the systems of roots of `v` have flat base change |
| 902 | HasFlatBaseChange (freeAb (TimesBNat.incl PadicTest ⋙ compatibleRootsAt algFunctor v)) ∧ |
| 903 | -- (b) they form a line |
| 904 | IsLine (tilt ⋙ moduleCoeff (tensorCoeff M)) (Y := compatibleRootsAt algFunctor v) |
| 905 | (fiberProd.snd ..) := by |
| 906 | -- The functor of root systems of `v` is `Hom(periodicSeq c.TiltRing, (-)^♭)`: choose one system |
| 907 | -- `r`; the periodic sequences `x n` lifting `k ↦ (c.epsChar ^ k * r) n` along the untilt give the |
| 908 | -- universal system. As `periodicSeq c.TiltRing` is perfect, both claims follow, `shift` acting as |
| 909 | -- multiplication by the character `c.epsChar : a ↦ (ε ^ a)^♯`. |
| 910 | obtain ⟨r, x, hr_one, hx⟩ := exists_rootSystem_periodicSeq c hv |
| 911 | obtain rfl : (⟨r (ofAdd 1)⟩ : (algFunctor ⋙ underlyingSet).obj c) = v := congrArg ULift.up hr_one |
| 912 | have h_perfect : PerfectRing (periodicSeq c.TiltRing) p := perfectRing |
| 913 | -- The shift multiplies each root `(ϕ (x n))^♯` by `(ε ^ n)^♯`, read in `D`. |
| 914 | have h_shift {D : PadicTest} (ϕ : periodicSeq c.TiltRing →ₐ[OFlat] D.TiltRing) |
| 915 | (n : Multiplicative ℚ≥0) : |
| 916 | (ϕ (shift _ (x n))).untilt = |
| 917 | algebraMap OC D.ProdRing (untilt (epsPowNNRat n)) * rootSystemOfHom hx ϕ n := by |
| 918 | have h_x_succ (k : ℕ) : |
| 919 | ((shift c.TiltRing (x n)).val k).untilt = c.epsChar n * ((x n).val k).untilt := by |
| 920 | simp [hx, _root_.pow_succ', mul_assoc] |
| 921 | exact (untilt_map_eq_mul_of_forall ϕ (c.epsChar n) (shift c.TiltRing (x n)) (x n) |
| 922 | h_x_succ).trans |
| 923 | (congrArg (· * rootSystemOfHom hx ϕ n) ((baseOfHom ϕ).commutes (untilt (epsPowNNRat n)))) |
| 924 | let e := compatibleRootsIso c hv hx |
| 925 | -- Flat base change: by `homTiltIso` the functor is that of points of an `OC`-algebra. The line: |
| 926 | -- `IsLine.of_acyclic` asks for acyclicity, the actions of constants and shift, and |
| 927 | -- `koszulExact_shift`. |
| 928 | refine ⟨hasFlatBaseChange_of_iso_reprBy (homTiltIso.symm ≪≫ e), ?_⟩ |
| 929 | refine .of_acyclic e (h_acyclic _) _ _ (fun _ _ ↦ tilt.map_preimage _) ⟨?_⟩ koszulExact_shift |
| 930 | -- The generator of `ℕ` multiplies a root system by `(ε ^ a)^♯`, as the shift does. |
| 931 | ext D ⟨⟨ϕ⟩⟩ |
| 932 | exact Subtype.ext (Prod.ext (congrArg ULift.up (MonoidHom.ext (h_shift ϕ))) rfl) |
| 933 | |
| 934 | end KummerTorsor |
| 935 | |
| 936 | end New.Variety |
| 937 | |
| 938 | end |