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 TauCeti.AlgebraicGeometry.Frobenius.Perfect |
| 4 | import TauCeti.RingTheory.Perfect.Colimit |
| 5 | import Mathlib.CategoryTheory.Limits.Shapes.Connected |
| 6 | import Mathlib.RingTheory.PiTensorProduct |
| 7 | public import Lib.PadicComparison.Descent.TestCategory |
| 8 | public import Lib.PadicComparison.Descent.TestCovers -- shake: keep (needed public by an exposed definition) |
| 9 | |
| 10 | /-! |
| 11 | # Perfect algebras, étale algebras over perfect rings, and constant Laurent polynomials |
| 12 | |
| 13 | Fix a prime p (the class `ThePrime p`). An algebra is perfect when x ↦ x^p is bijective; for hp : |
| 14 | p = 0, `frobPow hp 1` is this map x ↦ x^p as a ring endomorphism, and O♭ denotes the tilt of the |
| 15 | ring of integers of ℂ_p. The file constructs perfections of quotients and of the affine charts of |
| 16 | `f V = g U` in the projective line with coordinates `[U : V]`. It shows that étale algebras lift |
| 17 | along surjections and are perfect over a perfect base in which p = 0. It also proves that a Laurent |
| 18 | polynomial that is a polynomial both in T and in T⁻¹ is constant. |
| 19 | |
| 20 | ## Main definitions and results |
| 21 | |
| 22 | * `New.Variety.perfectRing_monoidAlgebra`: O♭[G] is perfect when G is a module over the non-negative |
| 23 | rationals. |
| 24 | * `New.Variety.PerfectAlg.isClosedUnderColimitsOfShape_widePushoutShape`, |
| 25 | `New.Variety.perfectRing_tensor`: if p = 0 in S, perfect S-algebras are closed under wide |
| 26 | pushouts, so, for perfect S, under tensor products. |
| 27 | * `New.Variety.exists_perfection_quotient`: the perfection of B/t, for p = 0 in the base. |
| 28 | * `New.Variety.exists_perfect_blowup_charts`: for f, g in a perfect algebra B over a perfect ring |
| 29 | with p = 0, perfected charts B₁ (where g ∣ f) and B₂ (where f ∣ g) form an exact sequence |
| 30 | B → B₁ × B₂ → B₀ → 0; the proof splits Laurent polynomials by |
| 31 | `New.Variety.surjective_toLaurent_add_invert`. |
| 32 | * `New.Variety.perfectRing_of_etale`: an étale algebra over a perfect ring in which p = 0 is |
| 33 | perfect. |
| 34 | |
| 35 | Notions from other files: |
| 36 | * `New.Variety.PadicTest.tilt`: The functor from p-adic tests to commutative O^♭-algebras sending a |
| 37 | test S to its tilt S^♭. |
| 38 | |
| 39 | ## Relation to the literature |
| 40 | |
| 41 | Known; see `Lib.PadicComparison.Descent.AlmostDescent` for sources. |
| 42 | -/ |
| 43 | |
| 44 | @[expose] public section |
| 45 | |
| 46 | noncomputable section |
| 47 | |
| 48 | /-! ## Constant Laurent polynomials -/ |
| 49 | section LaurentConstant |
| 50 | |
| 51 | open Polynomial LaurentPolynomial |
| 52 | |
| 53 | /-- `H⁰(ℙ¹, 𝒪) = k`: if `P(T) = Q(T⁻¹)` as Laurent polynomials over the commutative ring `k`, then |
| 54 | `P` and `Q` are the same constant. -/ |
| 55 | lemma New.Variety.eq_C_of_toLaurent_eq {k : Type} [CommRing k] (P Q : k[X]) |
| 56 | (hPQ : P.toLaurent = invert Q.toLaurent) : |
| 57 | ∃ c : k, P = Polynomial.C c ∧ Q = Polynomial.C c := by |
| 58 | -- `trunc` cuts off the negative powers of `T`: it returns `P` on the left side, and of the right |
| 59 | -- side, with `Q` written as a sum of monomials, only the constant term of `Q` remains. |
| 60 | have hP : P = .C (Q.coeff 0) := by |
| 61 | rw [Q.as_sum_range] at hPQ |
| 62 | simpa using congrArg trunc hPQ |
| 63 | -- So `Q(T⁻¹) = P(T)` is that constant, and `Q ↦ Q(T⁻¹)` is injective. |
| 64 | have hQ : Q = .C (Q.coeff 0) := by |
| 65 | rw [← toLaurent_inj, ← invert.injective.eq_iff, ← hPQ, hP] |
| 66 | simp |
| 67 | exact ⟨Q.coeff 0, hP, hQ⟩ |
| 68 | |
| 69 | end LaurentConstant |
| 70 | |
| 71 | namespace New.Variety |
| 72 | |
| 73 | variable {p : ℕ} |
| 74 | /-! |
| 75 | ## Perfect algebras, tensor products and divisibility |
| 76 | |
| 77 | The category `New.Variety.PerfectAlg p S` of perfect S-algebras, mostly for a ring S with p = 0. The |
| 78 | tilt of a p-adic test (`New.Variety.PadicTest`) is a perfect O♭-algebra. |
| 79 | -/ |
| 80 | |
| 81 | section PerfectAlgebras |
| 82 | |
| 83 | open CategoryTheory Limits TauCeti TensorProduct AlgHom Polynomial Fact Ideal Quotient Period |
| 84 | Function NeZero Algebra.TensorProduct ObjectProperty CharP |
| 85 | |
| 86 | /-! ### Perfect algebras and Frobenius -/ |
| 87 | |
| 88 | /-- The full subcategory of commutative S-algebras on which x ↦ x^p is bijective. -/ |
| 89 | abbrev PerfectAlg (p : ℕ) (S : Type) [CommRing S] : Type 1 := |
| 90 | FullSubcategory fun A : CommAlg S ↦ PerfectRing A p |
| 91 | |
| 92 | variable {S : Type} [CommRing S] [ThePrime p] |
| 93 | |
| 94 | /-- The underlying ring of a perfect S-algebra is perfect. -/ |
| 95 | instance (b : PerfectAlg p S) : PerfectRing b.obj p := b.property |
| 96 | |
| 97 | /-- The maximal ideal 𝔪 of the local ring O^♭. -/ |
| 98 | abbrev MaxIdealFlat : Type := ↥(IsLocalRing.maximalIdeal OFlat) |
| 99 | |
| 100 | /-- The functor from p-adic tests to perfect O^♭-algebras sending S to its tilt S^♭. -/ |
| 101 | def PadicTest.perfectTilt : PadicTest ⥤ PerfectAlg p OFlat := |
| 102 | ObjectProperty.lift _ tilt fun c ↦ c.isPerfectTorsionFree_tilt.1 |
| 103 | |
| 104 | /-- The prime p is zero in every O^♭-algebra, as O^♭ has characteristic p. -/ |
| 105 | lemma natCast_eq_zero_of_algebra_oFlat [Algebra OFlat S] : (p : S) = 0 := by |
| 106 | simp [← map_natCast (algebraMap OFlat S), cast_eq_zero] |
| 107 | |
| 108 | /-- The ring endomorphism `frobPow hp 1` is the map `x ↦ x ^ p`. -/ |
| 109 | lemma coe_frobPow_one (hp : (p : S) = 0) : ⇑(frobPow hp 1) = fun x : S ↦ x ^ p := by ext; simp |
| 110 | |
| 111 | /-- If `S` is perfect and `p = 0` in `S`, then `frobPow hp 1` is bijective. -/ |
| 112 | lemma bijective_frobPow_one (hp : (p : S) = 0) [PerfectRing S p] : Bijective (frobPow hp 1) := by |
| 113 | simpa only [coe_frobPow_one] using PerfectRing.bijective_frobenius |
| 114 | |
| 115 | /-- If `p = 0` in `S` and `frobPow hp 1` is bijective, then `S` is a perfect ring. -/ |
| 116 | lemma perfectRing_of_bijective_frobPow (hp : (p : S) = 0) (h_bij : Bijective (frobPow hp 1)) : |
| 117 | PerfectRing S p := ⟨by rwa [coe_frobPow_one] at h_bij⟩ |
| 118 | |
| 119 | open AddMonoidAlgebra in |
| 120 | /-- For a commutative additive monoid G that is a module over the non-negative rationals, the |
| 121 | monoid algebra O♭[G] is perfect: x ↦ x^p is bijective on it. Here p is the fixed prime and |
| 122 | O♭ = `OFlat` is the tilt of the ring of integers of ℂ_p, a perfect ring of characteristic p. -/ |
| 123 | lemma perfectRing_monoidAlgebra (G : Type) [AddCommMonoid G] [Module ℚ≥0 G] : |
| 124 | PerfectRing OFlat[G] p := by |
| 125 | -- Frobenius is the composite of two ring isomorphisms: multiplication by `p` on the exponents |
| 126 | -- and Frobenius on the coefficients. |
| 127 | let e : OFlat[G] ≃+* OFlat[G] := |
| 128 | mapDomainRingEquiv _ (DistribMulAction.toAddEquiv₀ G (p : ℚ≥0) (NeZero.ne _)) * |
| 129 | mapRingEquiv G (frobeniusEquiv OFlat p) |
| 130 | have he : e.toRingHom = frobPow natCast_eq_zero_of_algebra_oFlat 1 := by |
| 131 | ext |
| 132 | · simp [e, frobenius_def] |
| 133 | · simp [e, ← Nat.cast_smul_eq_nsmul ℚ≥0, DistribMulAction.toAddEquiv₀] |
| 134 | refine perfectRing_of_bijective_frobPow natCast_eq_zero_of_algebra_oFlat ?_ |
| 135 | simpa [← he] using e.bijective |
| 136 | |
| 137 | /-- A perfect ring `S` is reduced, since `x ↦ x ^ p` is injective on it. -/ |
| 138 | lemma isReduced_of_perfectRing (h_perf : PerfectRing S p) : IsReduced S := by |
| 139 | refine (isReduced_iff_pow_one_lt p out).2 fun x hx ↦ ?_ |
| 140 | exact h_perf.bijective_frobenius.injective (by simpa [ne] using hx) |
| 141 | |
| 142 | open LaurentPolynomial hiding C |
| 143 | |
| 144 | /-- Every Laurent polynomial over S is a polynomial in T plus a polynomial in T⁻¹ without |
| 145 | constant term: the map (P, Q) ↦ P(T) + T⁻¹ Q(T⁻¹) from S[X] × S[X] to S[T, T⁻¹] is surjective, |
| 146 | that is, H¹(ℙ¹, 𝒪) = 0. -/ |
| 147 | lemma surjective_toLaurent_add_invert : |
| 148 | Surjective fun ((P, Q) : S[X] × S[X]) ↦ P.toLaurent + invert (X * Q).toLaurent := by |
| 149 | intro f |
| 150 | induction f using LaurentPolynomial.induction_on' with |
| 151 | | add u v hu hv => |
| 152 | obtain ⟨⟨P₁, Q₁⟩, rfl⟩ := hu |
| 153 | obtain ⟨⟨P₂, Q₂⟩, rfl⟩ := hv |
| 154 | exact ⟨(P₁ + P₂, Q₁ + Q₂), by simp [mul_add, add_add_add_comm]⟩ |
| 155 | | C_mul_T n a => |
| 156 | -- it remains to treat the monomials `a Tⁿ` and `a T⁻⁽ⁿ⁺¹⁾` |
| 157 | obtain n | n := n |
| 158 | · exact ⟨(monomial n a, 0), by simp⟩ |
| 159 | · exact ⟨(0, monomial n a), by simp [Int.negSucc_eq]⟩ |
| 160 | |
| 161 | /-! ### Algebras over a ring with p = 0: colimits and perfection -/ |
| 162 | |
| 163 | omit [ThePrime p] in |
| 164 | /-- If `p = 0` in `S`, then `p = 0` in every commutative `S`-algebra `B`. -/ |
| 165 | lemma natCast_eq_zero_of_algebra (hp : (p : S) = 0) (B : Type) [CommRing B] [Algebra S B] : |
| 166 | (p : B) = 0 := by |
| 167 | rw [← map_natCast (algebraMap S B), hp, map_zero] |
| 168 | |
| 169 | /-- If p = 0 in S, a wide pushout (indexed by any type J) of perfect S-algebras is perfect. -/ |
| 170 | lemma PerfectAlg.isClosedUnderColimitsOfShape_widePushoutShape (hp : (p : S) = 0) (J : Type*) : |
| 171 | IsClosedUnderColimitsOfShape (fun A : CommAlg S ↦ PerfectRing A p) (WidePushoutShape J) := by |
| 172 | -- Frobenius is a natural endomorphism `τ` of the forgetful functor to rings, invertible on the |
| 173 | -- diagram. The functor preserves connected colimits, so `τ` is invertible at the colimit too. |
| 174 | refine ⟨fun A ⟨c⟩ ↦ ?_⟩ |
| 175 | have hp_alg (B : CommAlg S) : (p : B) = 0 := natCast_eq_zero_of_algebra hp B |
| 176 | let F : CommAlg S ⥤ CommRingCat := (commAlgCatEquivUnder (.of S)).functor ⋙ Under.forget _ |
| 177 | let τ : F ⟶ F := |
| 178 | { app B := CommRingCat.ofHom (frobPow (hp_alg B) 1) |
| 179 | naturality := by aesop_cat (add simp [F, commAlgCatEquivUnder]) } |
| 180 | have (j : WidePushoutShape J) : PerfectRing (c.diag.obj j) p := c.prop_diag_obj j |
| 181 | have : IsIso (c.diag.whiskerLeft τ) := |
| 182 | (isoOfAppBijective _ fun j ↦ bijective_frobPow_one (hp_alg (c.diag.obj j))).isIso_hom |
| 183 | have : IsIso (τ.app A) := isIso_app_coconePt_of_preservesColimit _ τ _ c.isColimit |
| 184 | exact perfectRing_of_bijective_frobPow (hp_alg A) (ConcreteCategory.bijective_of_isIso (τ.app A)) |
| 185 | |
| 186 | /-- For a prime `p` (fixed by the class `ThePrime p`) with `p = 0` in the commutative ring `S`, an |
| 187 | `S`-algebra `B` and an element `t ∈ B`, there is a perfection of `B/t`: a perfect `S`-algebra `c` |
| 188 | (one on which x ↦ x^p is bijective) with an `S`-algebra map `e : B → c` such that (a) every |
| 189 | `S`-algebra map `φ` from `B` to a perfect `S`-algebra with `φ t = 0` factors as `ψ ∘ e`; (b) |
| 190 | `e r = e s` implies `t ∣ r^{p^n} − s^{p^n}` for some `n`; (c) `e t = 0`; (d) every `y` in `c` has |
| 191 | some power `y^{p^n}` in the image of `e`. -/ |
| 192 | lemma exists_perfection_quotient (hp : (p : S) = 0) (B : Type) [CommRing B] [Algebra S B] (t : B) : |
| 193 | ∃ (c : PerfectAlg p S) (e : B →ₐ[S] c.obj), |
| 194 | (∀ {d : PerfectAlg p S} (φ : B →ₐ[S] d.obj), φ t = 0 → |
| 195 | ∃ ψ : c.obj →ₐ[S] d.obj, ψ.comp e = φ) ∧ |
| 196 | (∀ r s : B, e r = e s → ∃ n : ℕ, t ∣ r ^ p ^ n - s ^ p ^ n) ∧ |
| 197 | e t = 0 ∧ |
| 198 | ∀ y : c.obj, ∃ (n : ℕ) (r : B), e r = y ^ p ^ n := by |
| 199 | let Q : Type := B ⧸ span ({t} : Set B) |
| 200 | let π : B →ₐ[S] Q := Ideal.Quotient.mkₐ S (span {t}) |
| 201 | have hQ : (p : Q) = 0 := natCast_eq_zero_of_algebra hp Q |
| 202 | have h_ker (r : B) : π r = 0 ↔ t ∣ r := Ideal.Quotient.eq_zero_iff_dvd t r |
| 203 | -- A map that kills `t` descends to the quotient `Q`. |
| 204 | let descend {d : PerfectAlg p S} (φ : B →ₐ[S] d.obj) (hφ : φ t = 0) : Q →ₐ[S] d.obj := |
| 205 | liftₐ (span {t}) φ ((RingHom.ker φ).span_singleton_le_iff_mem.2 hφ) |
| 206 | algebraize [(ColimitPerfection.of Q p hQ).comp (algebraMap S Q)] |
| 207 | let ι : Q →ₐ[S] ColimitPerfection Q p hQ := ⟨ColimitPerfection.of Q p hQ, fun _ ↦ rfl⟩ |
| 208 | refine ⟨⟨.of S (ColimitPerfection Q p hQ), inferInstance⟩, ι.comp π, ?_, ?_, ?_, fun y ↦ ?_⟩ |
| 209 | · -- (a) Every map from `Q` to a perfect ring lifts along `ColimitPerfection.of`. |
| 210 | intro d φ hφ |
| 211 | refine ⟨⟨ColimitPerfection.lift hQ (descend φ hφ).toRingHom, fun s ↦ ?_⟩, |
| 212 | AlgHom.ext fun b ↦ ColimitPerfection.lift_of _ (π b)⟩ |
| 213 | exact (ColimitPerfection.lift_of _ (algebraMap S Q s)).trans ((descend φ hφ).commutes s) |
| 214 | · -- (b) Two elements of `Q` have the same image iff an iterate of Frobenius identifies them. |
| 215 | intro r s (hrs : ColimitPerfection.of Q p hQ (π r) = ColimitPerfection.of Q p hQ (π s)) |
| 216 | rw [← ColimitPerfection.mk_zero_eq_of] at hrs |
| 217 | obtain ⟨n, hn⟩ := ColimitPerfection.mk_eq_mk_iff.1 hrs |
| 218 | exact ⟨n, (h_ker _).1 (by simp [hn])⟩ |
| 219 | · simp [(h_ker t).2 dvd_rfl] |
| 220 | · -- (d) Every element of the colimit perfection has a `p ^ n`-th power in the image of `Q`. |
| 221 | obtain ⟨n, q, rfl⟩ := ColimitPerfection.exists_eq_mk y |
| 222 | obtain ⟨r, rfl⟩ := Ideal.Quotient.mk_surjective q |
| 223 | exact ⟨n, r, (ColimitPerfection.mk_pow_pow n _).symm⟩ |
| 224 | |
| 225 | /-- If p = 0 in the reduced ring S and every element is a p-th power, then S is perfect. -/ |
| 226 | lemma perfectRing_of_pow_surjective (hp : (p : S) = 0) [IsReduced S] |
| 227 | (h_surj : Surjective fun x : S ↦ x ^ p) : PerfectRing S p := by |
| 228 | -- Frobenius is a ring homomorphism, and its kernel consists of nilpotent elements. |
| 229 | have h_inj : Injective (frobPow hp 1) := (injective_iff_map_eq_zero _).2 (by simp [ne]) |
| 230 | exact ⟨by rwa [coe_frobPow_one] at h_inj, h_surj⟩ |
| 231 | |
| 232 | /-! ### Tensor products and divisibility -/ |
| 233 | |
| 234 | /-- If `p = 0` in the perfect ring `S`, the tensor product of two perfect `S`-algebras is |
| 235 | perfect. -/ |
| 236 | lemma perfectRing_tensor (hp : (p : S) = 0) [PerfectRing S p] (B D : PerfectAlg p S) : |
| 237 | PerfectRing (B.obj ⊗[S] D.obj) p := by |
| 238 | -- The tensor product is the pushout of `B` and `D` over `S`, and all three rings are perfect. |
| 239 | have h_pushout := |
| 240 | IsPushout.of_is_coproduct (B.obj.binaryCofanIsColimit D.obj) CommAlgCat.isInitialSelf |
| 241 | refine (PerfectAlg.isClosedUnderColimitsOfShape_widePushoutShape hp |
| 242 | WalkingPair).colimitsOfShape_le _ |
| 243 | ⟨{ diag := _, ι := _, isColimit := h_pushout.isColimit, prop_diag_obj := ?_ }⟩ |
| 244 | -- The vertices of the span are `S`, `B` and `D`. |
| 245 | rintro (_ | _ | _) |
| 246 | exacts [inferInstanceAs (PerfectRing S p), B.property, D.property] |
| 247 | |
| 248 | /-- Let S be perfect with p = 0 and i a map from a perfect S-algebra B to an S-algebra A. Suppose |
| 249 | that for every field k and every map a : B → k some injective map η from k to a perfect S-algebra |
| 250 | makes η ∘ a factor through i. Then i is injective after tensoring with any perfect S-algebra. -/ |
| 251 | lemma injective_rTensor_of_field_maps_factor (hp : (p : S) = 0) [PerfectRing S p] |
| 252 | (B : PerfectAlg p S) {A : Type} [CommRing A] [Algebra S A] (i : B.obj →ₐ[S] A) |
| 253 | (h_factor : ∀ (k : Type) [Field k] [Algebra S k] (a : B.obj →ₐ[S] k), |
| 254 | ∃ (K : PerfectAlg p S) (η : k →ₐ[S] K.obj) (ψ : A →ₐ[S] K.obj), |
| 255 | Injective η ∧ ψ.comp i = η.comp a) |
| 256 | (D : PerfectAlg p S) : Injective (i.toLinearMap.rTensor D.obj) := by |
| 257 | refine (injective_iff_map_eq_zero _).2 fun x hx ↦ ?_ |
| 258 | -- `B ⊗ D` is perfect, so reduced; it suffices that `x` lies in every prime `J`. |
| 259 | have : IsReduced (B.obj ⊗[S] D.obj) := isReduced_of_perfectRing (perfectRing_tensor hp B D) |
| 260 | refine IsNilpotent.eq_zero (nilpotent_iff_mem_prime.2 fun J _ ↦ ?_) |
| 261 | let φ := IsScalarTower.toAlgHom S (B.obj ⊗[S] D.obj) J.ResidueField |
| 262 | obtain ⟨K, η, ψ, h_inj, hψ⟩ := h_factor _ (φ.comp includeLeft) |
| 263 | -- `η ∘ φ` factors through `A ⊗ D`, so it kills `x`. |
| 264 | have factor (u : B.obj ⊗[S] D.obj) : η (φ u) = |
| 265 | productMap ψ (η.comp (φ.comp includeRight)) (i.toLinearMap.rTensor D.obj u) := by |
| 266 | induction u with |
| 267 | | tmul b d => |
| 268 | have hb : ψ (i b) = η (φ (b ⊗ₜ 1)) := AlgHom.congr_fun hψ b |
| 269 | simp [hb, ← map_mul] |
| 270 | | add u v hu hv => simp [hu, hv] |
| 271 | simpa [φ] using show φ x = 0 from h_inj (by simp [factor, hx]) |
| 272 | |
| 273 | /-- The relation f = g T in terms of T⁻¹: (g - f T⁻¹) = -(f - g T) T⁻¹. -/ |
| 274 | lemma invert_toLaurent_C_sub_C_mul_X {R : Type} [CommRing R] (f g : R) : |
| 275 | invert (C g - C f * X).toLaurent = -(C f - C g * X).toLaurent * T (-1) := by |
| 276 | have h_inv : (T 1 * T (-1) : R[T;T⁻¹]) = 1 := by rw [← T_add, add_neg_cancel, T_zero] |
| 277 | simp only [map_sub, map_mul, toLaurent_C, toLaurent_X, invert_C, invert_T] |
| 278 | linear_combination -LaurentPolynomial.C g * h_inv |
| 279 | |
| 280 | /-- If P(T) - Q(T⁻¹) = (f - g T)(U(T) + T⁻¹ V(T⁻¹)), then P - (f - g X) U and Q - (g - f X) V are |
| 281 | the same constant. -/ |
| 282 | lemma exists_C_of_toLaurent_sub_invert_eq {R : Type} [CommRing R] (f g : R) (P Q U V : R[X]) |
| 283 | (h_eq : P.toLaurent - invert Q.toLaurent = |
| 284 | (C f - C g * X).toLaurent * (U.toLaurent + invert V.toLaurent * T (-1))) : |
| 285 | ∃ c : R, P - (C f - C g * X) * U = C c ∧ Q - (C g - C f * X) * V = C c := by |
| 286 | refine eq_C_of_toLaurent_eq _ _ ?_ |
| 287 | calc (P - (C f - C g * X) * U).toLaurent |
| 288 | = P.toLaurent - (C f - C g * X).toLaurent * U.toLaurent := by rw [map_sub, map_mul] |
| 289 | _ = invert Q.toLaurent - invert (C g - C f * X).toLaurent * invert V.toLaurent := by |
| 290 | rw [invert_toLaurent_C_sub_C_mul_X] |
| 291 | linear_combination h_eq |
| 292 | _ = invert (Q - (C g - C f * X) * V).toLaurent := by simp only [map_sub, map_mul] |
| 293 | |
| 294 | /-- If p = 0 in S, every S-algebra k that is a field maps injectively to a perfect S-algebra. -/ |
| 295 | lemma exists_injective_algHom_perfect (hp : (p : S) = 0) (k : Type) [Field k] [Algebra S k] : |
| 296 | ∃ (K : PerfectAlg p S) (η : k →ₐ[S] K.obj), Injective η := by |
| 297 | have : CharP k p := (charP_iff_prime_eq_zero Fact.out).2 (natCast_eq_zero_of_algebra hp k) |
| 298 | algebraize [(PerfectClosure.of k p).comp (algebraMap S k)] |
| 299 | exact ⟨⟨.of S (PerfectClosure k p), inferInstance⟩, |
| 300 | ⟨PerfectClosure.of k p, fun _ ↦ rfl⟩, (PerfectClosure.of k p).injective⟩ |
| 301 | |
| 302 | omit [ThePrime p] in |
| 303 | /-- On a perfect algebra `A`, the map `x ↦ x ^ p ^ n` is bijective for every `n`. -/ |
| 304 | lemma bijective_pow_prime_pow (A : PerfectAlg p S) (n : ℕ) : Bijective fun x : A.obj ↦ x ^ p ^ n := |
| 305 | (A.property.pow _ p n).bijective_frobenius |
| 306 | |
| 307 | /-- Let p = 0 in S and B, B₁, B₂, B₀ be perfect S-algebras. Let E₁, E₂ map B[X] to B₁, B₂, let E₀ |
| 308 | map B[T, T⁻¹] to B₀, and let j₁, j₂ map B₁, B₂ to B₀ with j₁ (E₁ P) = E₀ (P(T)) and |
| 309 | j₂ (E₂ P) = E₀ (P(T⁻¹)). If every element of B₀ has a p^n-th power in the image of E₀, then |
| 310 | (y, z) ↦ j₁ y - j₂ z maps onto B₀. -/ |
| 311 | lemma surjective_blowup_difference (hp : (p : S) = 0) {B B₁ B₂ B₀ : PerfectAlg p S} |
| 312 | (E₁ : B.obj[X] →ₐ[S] B₁.obj) (E₂ : B.obj[X] →ₐ[S] B₂.obj) |
| 313 | (E₀ : B.obj[T;T⁻¹] →ₐ[S] B₀.obj) (j₁ : B₁.obj →ₐ[S] B₀.obj) (j₂ : B₂.obj →ₐ[S] B₀.obj) |
| 314 | (hj₁ : ∀ P : B.obj[X], j₁ (E₁ P) = E₀ P.toLaurent) |
| 315 | (hj₂ : ∀ P : B.obj[X], j₂ (E₂ P) = E₀ (invert P.toLaurent)) |
| 316 | (h_root : ∀ w : B₀.obj, ∃ (n : ℕ) (r : B.obj[T;T⁻¹]), E₀ r = w ^ p ^ n) : |
| 317 | Surjective (j₁.toLinearMap.coprod (-j₂.toLinearMap)) := by |
| 318 | intro w |
| 319 | -- `w ^ p ^ n` is the image of `P(T) + T⁻¹ Q(T⁻¹)`; take roots of both terms. |
| 320 | obtain ⟨n, r, hw⟩ := h_root w |
| 321 | obtain ⟨⟨P, Q⟩, rfl⟩ := surjective_toLaurent_add_invert r |
| 322 | obtain ⟨y, hy⟩ : ∃ y, y ^ p ^ n = E₁ P := (bijective_pow_prime_pow B₁ n).surjective _ |
| 323 | obtain ⟨z, hz⟩ : ∃ z, z ^ p ^ n = E₂ (X * Q) := (bijective_pow_prime_pow B₂ n).surjective _ |
| 324 | refine ⟨(y, -z), (bijective_pow_prime_pow B₀ n).injective ?_⟩ |
| 325 | calc j₁.toLinearMap.coprod (-j₂.toLinearMap) (y, -z) ^ p ^ n |
| 326 | = j₁ y ^ p ^ n + j₂ z ^ p ^ n := by |
| 327 | simp [add_pow_prime_pow_eq out, natCast_eq_zero_of_algebra hp] |
| 328 | _ = j₁ (E₁ P) + j₂ (E₂ (X * Q)) := by rw [← map_pow, ← map_pow, hy, hz] |
| 329 | _ = w ^ p ^ n := by rw [hj₁, hj₂, ← hw, map_add] |
| 330 | |
| 331 | omit [ThePrime p] in |
| 332 | /-- Let B, B₁, B₂, B₀ be perfect S-algebras (x ↦ x^p is bijective on them). Let E₁, E₂ map B[X] to |
| 333 | B₁, B₂, let E₀ map B[T, T⁻¹] to B₀, and let j₁, j₂ satisfy j₁ (E₁ P) = E₀ (P(T)) and j₂ (E₂ P) = E₀ |
| 334 | (P(T⁻¹)). Suppose E₁, E₂ kill f - g X, respectively g - f X, every element of B₁, B₂ has a p^n-th |
| 335 | power in the image of E₁, E₂, and elements with the same image under E₀ have p^n-th powers congruent |
| 336 | modulo f - g T. Then y in B₁ and z in B₂ with j₁ y = j₂ z are E₁ r and E₂ r for one constant r in |
| 337 | B. -/ |
| 338 | lemma exists_eq_of_blowup_glue_eq {B B₁ B₂ B₀ : PerfectAlg p S} (f g : B.obj) |
| 339 | (E₁ : B.obj[X] →ₐ[S] B₁.obj) (E₂ : B.obj[X] →ₐ[S] B₂.obj) |
| 340 | (E₀ : B.obj[T;T⁻¹] →ₐ[S] B₀.obj) (j₁ : B₁.obj →ₐ[S] B₀.obj) (j₂ : B₂.obj →ₐ[S] B₀.obj) |
| 341 | (hj₁ : ∀ P : B.obj[X], j₁ (E₁ P) = E₀ P.toLaurent) |
| 342 | (hj₂ : ∀ P : B.obj[X], j₂ (E₂ P) = E₀ (invert P.toLaurent)) |
| 343 | (h_rel₁ : E₁ (C f - C g * X) = 0) (h_rel₂ : E₂ (C g - C f * X) = 0) |
| 344 | (h_root₁ : ∀ y : B₁.obj, ∃ (n : ℕ) (P : B.obj[X]), E₁ P = y ^ p ^ n) |
| 345 | (h_root₂ : ∀ z : B₂.obj, ∃ (n : ℕ) (Q : B.obj[X]), E₂ Q = z ^ p ^ n) |
| 346 | (h_ker₀ : ∀ r s : B.obj[T;T⁻¹], E₀ r = E₀ s → |
| 347 | ∃ n : ℕ, (C f - C g * X).toLaurent ∣ r ^ p ^ n - s ^ p ^ n) |
| 348 | {y : B₁.obj} {z : B₂.obj} (hyz : j₁ y = j₂ z) : |
| 349 | ∃ r : B.obj, E₁ (C r) = y ∧ E₂ (C r) = z := by |
| 350 | -- Powers of `y` and `z` are images of polynomials, and some powers of these differ in |
| 351 | -- `B[T, T⁻¹]` by a multiple of `f - g T`. |
| 352 | obtain ⟨n, P, hP⟩ := h_root₁ y |
| 353 | obtain ⟨m, Q, hQ⟩ := h_root₂ (z ^ p ^ n) |
| 354 | have h_same : E₀ (P.toLaurent ^ p ^ m) = E₀ (invert Q.toLaurent) := by |
| 355 | simp [← hj₁, ← hj₂, hP, hQ, hyz] |
| 356 | obtain ⟨N, W, hW⟩ := h_ker₀ _ _ h_same |
| 357 | obtain ⟨⟨U, V⟩, rfl⟩ := surjective_toLaurent_add_invert W |
| 358 | -- As `(f - g T) T⁻¹ = -(g - f T⁻¹)`, the polynomials corrected by multiples of the relations |
| 359 | -- agree as Laurent polynomials, so both are one constant `c`. Its root maps to `(y, z)`. |
| 360 | have h_diff : ((P ^ p ^ m) ^ p ^ N).toLaurent - invert (Q ^ p ^ N).toLaurent = |
| 361 | (C f - C g * X).toLaurent * (U.toLaurent + invert V.toLaurent * T (-1)) := by |
| 362 | simpa using hW |
| 363 | obtain ⟨c, hPc, hQc⟩ := exists_C_of_toLaurent_sub_invert_eq f g _ _ U V h_diff |
| 364 | obtain ⟨r, rfl⟩ : ∃ r, r ^ p ^ (n + m + N) = c := (bijective_pow_prime_pow B _).surjective c |
| 365 | have hy : E₁ (C r) ^ p ^ (n + m + N) = y ^ p ^ (n + m + N) := by |
| 366 | simpa [hP, h_rel₁, pow_add, pow_mul] using (congrArg E₁ hPc).symm |
| 367 | have hz : E₂ (C r) ^ p ^ (n + m + N) = z ^ p ^ (n + m + N) := by |
| 368 | simpa [hQ, h_rel₂, pow_add, pow_mul] using (congrArg E₂ hQc).symm |
| 369 | exact ⟨r, (bijective_pow_prime_pow B₁ _).injective hy, |
| 370 | (bijective_pow_prime_pow B₂ _).injective hz⟩ |
| 371 | |
| 372 | /-- Let p = 0 in S. Suppose maps from B[X] to perfect S-algebras that kill f - g X factor through |
| 373 | E₁ : B[X] → B₁, and those that kill g - f X factor through E₂ : B[X] → B₂. Then every point |
| 374 | a : B → k of B in a field becomes, after some injective map η from k to a perfect S-algebra, a |
| 375 | point that factors through B → B₁ × B₂. -/ |
| 376 | lemma exists_factor_through_blowup_charts (hp : (p : S) = 0) {B B₁ B₂ : PerfectAlg p S} |
| 377 | (f g : B.obj) |
| 378 | (E₁ : B.obj[X] →ₐ[S] B₁.obj) (E₂ : B.obj[X] →ₐ[S] B₂.obj) |
| 379 | (h_lift₁ : ∀ {K : PerfectAlg p S} (φ : B.obj[X] →ₐ[S] K.obj), φ (C f - C g * X) = 0 → |
| 380 | ∃ ψ : B₁.obj →ₐ[S] K.obj, ψ.comp E₁ = φ) |
| 381 | (h_lift₂ : ∀ {K : PerfectAlg p S} (φ : B.obj[X] →ₐ[S] K.obj), φ (C g - C f * X) = 0 → |
| 382 | ∃ ψ : B₂.obj →ₐ[S] K.obj, ψ.comp E₂ = φ) |
| 383 | (k : Type) [Field k] [Algebra S k] (a : B.obj →ₐ[S] k) : |
| 384 | ∃ (K : PerfectAlg p S) (η : k →ₐ[S] K.obj) (ψ : (B₁.obj × B₂.obj) →ₐ[S] K.obj), |
| 385 | Injective η ∧ ψ.comp ((E₁.comp CAlgHom).prod (E₂.comp CAlgHom)) = η.comp a := by |
| 386 | obtain ⟨K, η, hη⟩ := exists_injective_algHom_perfect hp k |
| 387 | -- In `k` either `g ∣ f` or `f ∣ g`, so the point `η ∘ a` of `B` lifts to a chart. |
| 388 | obtain ⟨w, hw | hw⟩ := ValuationRing.cond (a g) (a f) |
| 389 | · obtain ⟨ψ, hψ⟩ := h_lift₁ (η.comp (aevalTower a w)) (by simp [← hw]) |
| 390 | exact ⟨K, η, ψ.comp (.fst S _ _), hη, |
| 391 | AlgHom.ext fun b ↦ by simpa using AlgHom.congr_fun hψ (C b)⟩ |
| 392 | · obtain ⟨ψ, hψ⟩ := h_lift₂ (η.comp (aevalTower a w)) (by simp [← hw]) |
| 393 | exact ⟨K, η, ψ.comp (.snd S _ _), hη, |
| 394 | AlgHom.ext fun b ↦ by simpa using AlgHom.congr_fun hψ (C b)⟩ |
| 395 | |
| 396 | /-- The two affine charts of `f V = g U` in the projective line over `B`, perfected. |
| 397 | For `S` perfect with `p = 0` and `f, g` in a perfect `S`-algebra `B`, there are perfect |
| 398 | `S`-algebras B₁ and B₂ under B, and B₀, such that (a) g ∣ f in B₁ and f ∣ g in B₂, |
| 399 | (b) B → B₁ × B₂ → B₀ → 0 is an exact sequence of S-modules, and (c) the first map is injective |
| 400 | after tensoring over S with any perfect S-algebra. -/ |
| 401 | lemma exists_perfect_blowup_charts (hp : (p : S) = 0) [PerfectRing S p] (B : PerfectAlg p S) |
| 402 | (f g : B.obj) : |
| 403 | ∃ (B₁ B₂ B₀ : PerfectAlg p S) (i₁ : B.obj →ₐ[S] B₁.obj) (i₂ : B.obj →ₐ[S] B₂.obj) |
| 404 | (j : (B₁.obj × B₂.obj) →ₗ[S] B₀.obj), |
| 405 | i₁ g ∣ i₁ f ∧ i₂ f ∣ i₂ g ∧ |
| 406 | Surjective j ∧ Exact (i₁.prod i₂) j ∧ |
| 407 | ∀ D : PerfectAlg p S, Injective ((i₁.prod i₂).toLinearMap.rTensor D.obj) := by |
| 408 | -- The charts are the perfections `B₁` of `B[X] / (f - g X)`, `B₂` of `B[X] / (g - f X)` and `B₀` |
| 409 | -- of `B[T, T⁻¹] / (f - g T)`, with `j₁ : X ↦ T`, `j₂ : X ↦ T⁻¹` and `j (y, z) = j₁ y - j₂ z`. |
| 410 | obtain ⟨B₁, E₁, lift₁, -, rel₁, root₁⟩ := exists_perfection_quotient hp _ (C f - C g * X) |
| 411 | obtain ⟨B₂, E₂, lift₂, -, rel₂, root₂⟩ := exists_perfection_quotient hp _ (C g - C f * X) |
| 412 | obtain ⟨B₀, E₀, -, ker₀, rel₀, root₀⟩ := exists_perfection_quotient hp _ (C f - C g * X).toLaurent |
| 413 | obtain ⟨j₁, hj₁'⟩ := lift₁ (E₀.comp ⟨toLaurent, by simp⟩) rel₀ |
| 414 | obtain ⟨j₂, hj₂'⟩ := lift₂ (E₀.comp ⟨.comp invert.toRingHom toLaurent, by simp⟩) |
| 415 | (show E₀ (invert (C g - C f * X).toLaurent) = 0 by |
| 416 | simp [invert_toLaurent_C_sub_C_mul_X, rel₀, -map_sub]) |
| 417 | have hj₁ : ∀ P : B.obj[X], j₁ (E₁ P) = E₀ P.toLaurent := AlgHom.congr_fun hj₁' |
| 418 | have hj₂ : ∀ P : B.obj[X], j₂ (E₂ P) = E₀ (invert P.toLaurent) := AlgHom.congr_fun hj₂' |
| 419 | let i₁ : B.obj →ₐ[S] B₁.obj := E₁.comp CAlgHom |
| 420 | let i₂ : B.obj →ₐ[S] B₂.obj := E₂.comp CAlgHom |
| 421 | let j : (B₁.obj × B₂.obj) →ₗ[S] B₀.obj := j₁.toLinearMap.coprod (-j₂.toLinearMap) |
| 422 | refine ⟨B₁, B₂, B₀, i₁, i₂, j, ?_, ?_, |
| 423 | surjective_blowup_difference hp E₁ E₂ E₀ j₁ j₂ hj₁ hj₂ root₀, |
| 424 | fun ⟨y, z⟩ ↦ ⟨fun hyz ↦ ?_, fun ⟨r, hr⟩ ↦ by simp [← hr, j, i₁, i₂, hj₁, hj₂]⟩, |
| 425 | injective_rTensor_of_field_maps_factor hp B (i₁.prod i₂) |
| 426 | (exists_factor_through_blowup_charts hp f g E₁ E₂ lift₁ lift₂)⟩ |
| 427 | · exact ⟨E₁ X, by simpa [i₁, sub_eq_zero] using rel₁⟩ |
| 428 | · exact ⟨E₂ X, by simpa [i₂, sub_eq_zero] using rel₂⟩ |
| 429 | · have h_glue : j₁ y = j₂ z := by simpa [j, add_neg_eq_zero] using hyz |
| 430 | obtain ⟨r, hy, hz⟩ := |
| 431 | exists_eq_of_blowup_glue_eq f g E₁ E₂ E₀ j₁ j₂ hj₁ hj₂ rel₁ rel₂ root₁ root₂ ker₀ h_glue |
| 432 | exact ⟨r, Prod.ext hy hz⟩ |
| 433 | |
| 434 | end PerfectAlgebras |
| 435 | |
| 436 | /-! ## Étale algebras over quotients and over perfect rings -/ |
| 437 | |
| 438 | section EtalePerfect |
| 439 | |
| 440 | open Function Algebra RingHom NeZero TensorProduct FormallyUnramified Etale IsLocalization Away |
| 441 | |
| 442 | variable [ThePrime p] (C D : Type) [CommRing C] [CommRing D] [Algebra C D] |
| 443 | |
| 444 | open AlgebraicGeometry in |
| 445 | /-- An étale algebra over a perfect ring in which p = 0 is perfect. -/ |
| 446 | lemma perfectRing_of_etale [Etale C D] [k : PerfectRing C p] (hp : (p : C) = 0) : |
| 447 | PerfectRing D p := by |
| 448 | -- Perfect schemes are stable under étale morphisms; apply this to `Spec D → Spec C`. |
| 449 | have : Scheme.IsPerfect (Spec (.of C)) p := (Scheme.isPerfect_Spec_iff C).2 ⟨hp, k⟩ |
| 450 | let f := Spec.map (CommRingCat.ofHom (algebraMap C D)) |
| 451 | have : AlgebraicGeometry.Etale f := |
| 452 | (HasRingHomProperty.Spec_iff (P := @AlgebraicGeometry.Etale)).2 |
| 453 | (RingHom.etale_algebraMap.2 inferInstance) |
| 454 | exact ((Scheme.isPerfect_Spec_iff D).1 (Scheme.IsPerfect.of_etale f)).2 |
| 455 | |
| 456 | end EtalePerfect |
| 457 | |
| 458 | end New.Variety |
| 459 | |
| 460 | end |