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.Order.CompletePartialOrder |
| 5 | import Mathlib.RingTheory.Henselian |
| 6 | import Mathlib.RingTheory.Localization.Pi |
| 7 | import Mathlib.RingTheory.SimpleRing.Principal |
| 8 | public import Lib.Cohomology.Etale.FilteredLimits |
| 9 | |
| 10 | /-! |
| 11 | # The space of places of residue fields and its properness over the base |
| 12 | |
| 13 | Spaces are functors from rings to sets (`New.Variety.PointFunctor`). For `s : Z ⟶ reprBy D` and a |
| 14 | point `x ∈ Z(C)`, the ring map under `x` is `baseRingMap s x : D ⟶ C`. The space of places is a form |
| 15 | of the Riemann–Zariski space. It is used to cover a proper functor `Z` over `D`. |
| 16 | |
| 17 | A place of a `D`-algebra `P` is a prime `q` of `P` together with a valuation ring of `κ(q)` over |
| 18 | `D`. For `α : D ⟶ P`, the ring `T = prodValuationRing α` is the product of these valuation rings. |
| 19 | Each `t ∈ P` is a ratio `a t / b t` in it, with `a = numerator` and `b = denominator`. The space of |
| 20 | places `W` of a valuative lift `z`, with `z.point ∈ Z(T)`, has as points over `C` the classes of |
| 21 | maps `f : T → C`. Two maps are identified if they give the same point `Z.map f z.point` of `Z(C)` |
| 22 | and the same ratios `(f (a t) : f (b t))`. |
| 23 | |
| 24 | * `New.Variety.IsProperOver`: properness, as a closed diagonal and a valuative criterion. |
| 25 | * `New.Variety.ResiduePlace.placeSpace`: the space of places `W`. |
| 26 | * `New.Variety.ResiduePlace.exists_isLocalHom_eq_projHom_comp`: a point of `W` in a local ring comes |
| 27 | from one place. |
| 28 | * `New.Variety.ResiduePlace.isProperOver_placeSpace`: the space of places is proper over `D`. |
| 29 | |
| 30 | Notions from other files: |
| 31 | * `New.Variety.reprBy D`: the functor `Hom(D, −)` represented by `D`. |
| 32 | |
| 33 | ## Relation to the literature |
| 34 | |
| 35 | Known; see `Lib.Cohomology.ProperBaseChange.Theorem` for sources. |
| 36 | -/ |
| 37 | |
| 38 | @[expose] public section |
| 39 | |
| 40 | noncomputable section |
| 41 | |
| 42 | open Pi CategoryTheory CommRingCat IsLocalRing RingHom Ideal ResidueField Set algebraMap |
| 43 | |
| 44 | namespace New.Variety |
| 45 | |
| 46 | variable {Z : CommRingCat ⥤ Type 1} {D P C C' : CommRingCat} (α : D ⟶ P) {s : Z ⟶ reprBy D} |
| 47 | {F : Type} [Field.{0} F] |
| 48 | |
| 49 | /-! ### Proper functors -/ |
| 50 | |
| 51 | /-- The functor `Z` on rings, with structure map `s : Z ⟶ reprBy D`, is proper over `D`: its |
| 52 | diagonal is closed, and it satisfies a valuative criterion with one ring `T` and one point |
| 53 | `a ∈ Z(T)` serving all valuation rings of algebraically closed fields (which includes |
| 54 | quasi-compactness). -/ |
| 55 | structure IsProperOver (s : Z ⟶ reprBy D) where |
| 56 | /-- The diagonal is closed: for points `x`, `y` over `C`, some ideal `I` of `C` is killed exactly |
| 57 | by the maps `C ⟶ C'` that make `x` and `y` equal. -/ |
| 58 | diagonal_closed (C : CommRingCat) (x y : Z.obj C) : |
| 59 | ∃ I : Ideal C, ∀ (C' : CommRingCat) (f : C ⟶ C'), |
| 60 | Z.map f x = Z.map f y ↔ I ≤ ker f.hom |
| 61 | /-- For one ring `T` and one point `a` over it, each point in an algebraically closed field `K` |
| 62 | that maps `D` into a valuation ring `O` of `K` is the image of `a` under some `T → O ⊆ K`. -/ |
| 63 | valuative_cover : ∃ (T : CommRingCat) (a : Z.obj T), |
| 64 | ∀ {K : Type} [Field K] [IsAlgClosed K] (O : ValuationSubring K) (z : Z.obj (of K)), |
| 65 | (∀ d : D, baseRingMap (B := of K) s z d ∈ O) → |
| 66 | ∃ u : T ⟶ of O, Z.map (u ≫ ofHom O.subtype) a = z |
| 67 | |
| 68 | /-- Two points of a proper functor over `C` are equal if they become equal along a jointly |
| 69 | injective family of ring maps `C ⟶ K j`. -/ |
| 70 | lemma IsProperOver.ext_of_jointly_injective (hs : IsProperOver s) {J : Sort*} {K : J → CommRingCat} |
| 71 | (π : ∀ j : J, C ⟶ K j) (hπ : ∀ c : C, (∀ j : J, π j c = 0) → c = 0) {x y : Z.obj C} |
| 72 | (h_eq : ∀ j : J, Z.map (π j) x = Z.map (π j) y) : |
| 73 | x = y := by |
| 74 | -- The ideal where `x = y` dies under every `π j`, so it is zero; now use the identity map. |
| 75 | obtain ⟨I, hI⟩ : ∃ I : Ideal C, ∀ (C' : CommRingCat) (f : C ⟶ C'), |
| 76 | Z.map f x = Z.map f y ↔ I ≤ ker f.hom := hs.diagonal_closed C x y |
| 77 | have h_le : I ≤ ker (𝟙 C : C ⟶ C).hom := fun c hc ↦ |
| 78 | hπ c fun j ↦ (hI (K j) (π j)).mp (h_eq j) hc |
| 79 | simpa using (hI C (𝟙 C)).mpr h_le |
| 80 | |
| 81 | /-- For `Z` proper over `D` and a valuation subring `U` of a field `F`, the map `Z(U) → Z(F)` is |
| 82 | injective. -/ |
| 83 | lemma IsProperOver.injective_map_valuationSubring (hs : IsProperOver s) (U : ValuationSubring F) : |
| 84 | (Z.map (ofHom U.subtype) ·).Injective := fun _ _ hxy ↦ |
| 85 | hs.ext_of_jointly_injective (fun _ : Unit ↦ ofHom U.subtype) (by simp) fun _ ↦ hxy |
| 86 | |
| 87 | /-- For `α : D → P`, a place is a prime `q` of `P` together with a valuation ring `O` of the residue |
| 88 | field `κ(q)` that contains the image of `D`. -/ |
| 89 | structure ResiduePlace where |
| 90 | /-- A prime ideal of `P`. -/ |
| 91 | prime : PrimeSpectrum P |
| 92 | /-- A valuation ring of the residue field of that prime. -/ |
| 93 | valuationSubring : ValuationSubring prime.asIdeal.ResidueField |
| 94 | /-- The valuation ring contains the image of `D`. -/ |
| 95 | base_mem (d : D) : ↑(α d) ∈ valuationSubring |
| 96 | |
| 97 | namespace ResiduePlace |
| 98 | |
| 99 | /-- For α: D → P, the product of the valuation rings O over all places (q, O) of |
| 100 | `New.Variety.ResiduePlace`. -/ |
| 101 | abbrev prodValuationRing : CommRingCat := of (∀ j : ResiduePlace α, j.valuationSubring) |
| 102 | |
| 103 | variable {α} (s) (f : prodValuationRing α ⟶ C) (t : P) (j : ResiduePlace α) |
| 104 | |
| 105 | /-- For a place j, the projection ring homomorphism from the product of all the valuation rings |
| 106 | to the valuation ring of j. -/ |
| 107 | abbrev projHom : prodValuationRing α ⟶ of j.valuationSubring := |
| 108 | ofHom (evalRingHom (fun j ↦ j.valuationSubring) j) |
| 109 | |
| 110 | /-- For a place j=(q,O), the residue field κ(q) of the prime q of P. -/ |
| 111 | abbrev PlaceField : Type := j.prime.asIdeal.ResidueField |
| 112 | |
| 113 | /-- The componentwise inclusion ∏ O → ∏ κ(q), both products over all places (q, O). -/ |
| 114 | abbrev toFieldProd : prodValuationRing α ⟶ ⟨∀ j : ResiduePlace α, j.PlaceField⟩ := |
| 115 | ofHom (algebraMap ..) |
| 116 | |
| 117 | /-- Any element outside the valuation subring is nonzero. -/ |
| 118 | lemma ne_zero_of_notMem_valuationSubring (h_notMem : ↑t ∉ j.valuationSubring) : |
| 119 | ↑t ≠ (0 : j.PlaceField) := |
| 120 | fun h_zero ↦ by simp [h_zero] at h_notMem |
| 121 | |
| 122 | open scoped Classical in |
| 123 | /-- For t∈P and a place (q,O), the element of O equal to 1 if the image of t in κ(q) lies in O, |
| 124 | and its inverse otherwise. -/ |
| 125 | def denominator : j.valuationSubring := |
| 126 | if h : ↑t ∈ j.valuationSubring then 1 else |
| 127 | ⟨t⁻¹, (j.valuationSubring.mem_or_inv_mem' t).resolve_left h⟩ |
| 128 | |
| 129 | /-- For t∈P and a place (q,O), the element of O given by the image of t in κ(q) times the |
| 130 | denominator. -/ |
| 131 | def numerator : j.valuationSubring := |
| 132 | ⟨t * j.denominator t, by |
| 133 | -- the product is `t` if `t ∈ j.valuationSubring`, and `t * t⁻¹ = 1` otherwise |
| 134 | by_cases h_mem : ↑t ∈ j.valuationSubring |
| 135 | · simp [denominator, h_mem] |
| 136 | · simp [denominator, h_mem, mul_inv_cancel₀ (ne_zero_of_notMem_valuationSubring t j h_mem)]⟩ |
| 137 | |
| 138 | /-- For `f : prodValuationRing α ⟶ C` and `t ∈ P`, `f (denominator t)` and `f (numerator t)` are |
| 139 | coprime. -/ |
| 140 | lemma isCoprime_denominator_numerator : IsCoprime (f (denominator t)) (f (numerator t)) := by |
| 141 | -- At each place `denominator t = 1` or `numerator t = 1`, so |
| 142 | -- `(1 - numerator t) * denominator t + numerator t = 1`. |
| 143 | refine IsCoprime.map ⟨1 - numerator t, 1, ?_⟩ f.hom |
| 144 | ext j |
| 145 | by_cases h_mem : ↑t ∈ j.valuationSubring |
| 146 | · simp [numerator, denominator, h_mem] |
| 147 | · simp [numerator, denominator, h_mem, mul_inv_cancel₀ |
| 148 | (ne_zero_of_notMem_valuationSubring t j h_mem)] |
| 149 | |
| 150 | /-- The image of the denominator is a unit exactly when it divides the image of the numerator. -/ |
| 151 | lemma isUnit_denominator_iff_dvd_numerator : |
| 152 | IsUnit (f (denominator t)) ↔ f (denominator t) ∣ f (numerator t) := |
| 153 | ⟨IsUnit.dvd, (isCoprime_denominator_numerator f t).isUnit_of_dvd⟩ |
| 154 | |
| 155 | /-- For `f : ∏ O → C`, the subring of pairs `(t, c)` in `P × C` with the following property: there |
| 156 | are `r`, `r'` in the product of the valuation rings such that `f r` is a unit, `r · t = r'` in |
| 157 | `∏ κ(q)`, and `f r · c = f r'`. -/ |
| 158 | def fractionGraph : Subring (P × C) := |
| 159 | letI : Algebra (prodValuationRing α) C := f.hom.toAlgebra |
| 160 | ((⊥ : Subalgebra (prodValuationRing α) _).saturation |
| 161 | (_ ⊓ (IsUnit.submonoid C).comap (snd ((j : ResiduePlace α) → j.PlaceField) C)) |
| 162 | inf_le_left).toSubring.comap |
| 163 | ((algebraMap P (∀ j : ResiduePlace α, j.PlaceField)).prodMap (RingHom.id C)) |
| 164 | |
| 165 | /-- For `ξ ∈ Z(P)`: a point of `Z` over the product of the valuation rings of all places that agrees |
| 166 | with `ξ` over the product of the residue fields. It comes with three facts: `Z` is proper over `D`, |
| 167 | `P` is absolutely flat, and all residue fields of `P` are algebraically closed. -/ |
| 168 | structure ValuativeLift (ξ : Z P) where |
| 169 | /-- A point of `Z` over the product of the valuation rings of all places. -/ |
| 170 | point : Z (prodValuationRing (baseRingMap s ξ)) |
| 171 | /-- Over the product `∏ⱼ κ(j.prime)` of residue fields, indexed by the places `j`, the point |
| 172 | agrees with `ξ`; the map on the right is the algebra map `P → ∏ⱼ κ(j.prime)`, |
| 173 | `t ↦ (t mod j.prime)_j`. -/ |
| 174 | map_point_eq : Z.map toFieldProd point = Z.map (ofHom (algebraMap ..)) ξ |
| 175 | /-- `Z` is proper over `D`. -/ |
| 176 | isProperOver : IsProperOver s |
| 177 | /-- Each `a ∈ P` satisfies `y * a * a = a` for some `y ∈ P`. -/ |
| 178 | absolutely_flat (a : P) : ∃ y : P, y * a * a = a |
| 179 | /-- Every residue field of `P` is algebraically closed. -/ |
| 180 | isAlgClosed_residueField (q : Ideal P) [q.IsPrime] : IsAlgClosed q.ResidueField |
| 181 | |
| 182 | variable {f t s} {ξ : Z P} (z : ValuativeLift s ξ) |
| 183 | |
| 184 | /-- A pair `(t, c)` lies in the graph of `f` iff `f (numerator t) = f (denominator t) * c`. -/ |
| 185 | lemma mem_fractionGraph {c : C} : |
| 186 | (t, c) ∈ fractionGraph f ↔ f (numerator t) = f (denominator t) * c := by |
| 187 | constructor |
| 188 | · -- a witness: `r`, `r'` with `f r` a unit, `r' = r t` in the residue fields, `f r' = f r * c` |
| 189 | rintro ⟨_, ⟨⟨r, rfl⟩, h_unit : IsUnit (f r)⟩, r', h⟩ |
| 190 | have h_snd : f r' = f r * c := congrArg Prod.snd h |
| 191 | have h_fst (j : ResiduePlace α) : (r' j : PlaceField j) = r j * algebraMap P _ t := |
| 192 | congrFun (congrArg Prod.fst h) j |
| 193 | -- at each place `numerator t = t * denominator t` and `r' = r * t` |
| 194 | have h_key : r * numerator t = denominator t * r' := by |
| 195 | ext j |
| 196 | change (r j : j.PlaceField) * (algebraMap P _ t * denominator t j) = denominator t j * r' j |
| 197 | rw [h_fst, ← mul_assoc, mul_comm] |
| 198 | refine h_unit.mul_left_cancel ?_ |
| 199 | calc f r * f (numerator t) = f (denominator t) * f r' := by rw [← map_mul, h_key, map_mul] |
| 200 | _ = f r * (f (denominator t) * c) := by rw [h_snd, mul_left_comm] |
| 201 | · -- `f (denominator t)` divides `f (numerator t)` and is coprime to it, so it is a unit: the |
| 202 | -- witness is `denominator t`, `numerator t` |
| 203 | intro h |
| 204 | have h_unit : IsUnit (f (denominator t)) := |
| 205 | (isUnit_denominator_iff_dvd_numerator f t).2 ⟨c, h⟩ |
| 206 | refine ⟨_, ⟨⟨denominator t, rfl⟩, h_unit⟩, numerator t, Prod.ext ?_ h⟩ |
| 207 | -- at each place `numerator t = t * denominator t` |
| 208 | ext j |
| 209 | exact mul_comm (algebraMap P j.PlaceField t) (denominator t j) |
| 210 | |
| 211 | /-! ### The space of places and its loci -/ |
| 212 | |
| 213 | /-- The space of places of a valuative lift `z` of `ξ ∈ Z(P)`. With `T` the product |
| 214 | `prodValuationRing (baseRingMap s ξ)` of the valuation rings of all places, its points over `C` are |
| 215 | classes of maps `f : T ⟶ C`. Two maps are identified when they send the point of `z` to the same |
| 216 | point of `Z(C)` and give the same ratios `f (numerator t) : f (denominator t)` for all `t ∈ P`. -/ |
| 217 | def placeSpace : PointFunctor where |
| 218 | obj C := ULift <| Quotient |
| 219 | { r (f g : prodValuationRing (baseRingMap s ξ) ⟶ C) := |
| 220 | Z.map f z.point = Z.map g z.point ∧ |
| 221 | ∀ t : P, f (numerator t) * g (denominator t) = g (numerator t) * f (denominator t) |
| 222 | iseqv := by |
| 223 | -- transitivity: the middle pair can be cancelled because it is coprime |
| 224 | constructor <;> intros <;> grind [!isCoprime_denominator_numerator, IsCoprime] } |
| 225 | map k := ↾fun x ↦ ULift.up (x.down.map' (· ≫ k) (by simp_all [← map_mul])) |
| 226 | map_id C := by |
| 227 | ext ⟨⟨f⟩⟩ |
| 228 | rfl |
| 229 | map_comp k k' := by |
| 230 | ext ⟨⟨f⟩⟩ |
| 231 | rfl |
| 232 | |
| 233 | /-- The map from the space of places of `z` to `Z` that sends the class of `f` to `f z ∈ Z(C)`. -/ |
| 234 | def placeSpaceMap : placeSpace z ⟶ Z where |
| 235 | app _ := ↾fun x ↦ x.down.lift (fun f ↦ Z.map f z.point) fun _ _ ↦ And.left |
| 236 | naturality _ _ _ := by |
| 237 | ext ⟨⟨f⟩⟩ |
| 238 | apply Z.map_comp_apply |
| 239 | |
| 240 | variable {z} {R : Type} [CommRing R] [IsLocalRing R] {q : Ideal P} [M : q.IsMaximal] |
| 241 | (x : placeSpace z C) |
| 242 | |
| 243 | /-- A ring map `g : P ⟶ F` to a field factors through the residue field of some prime `q` of |
| 244 | `P`. -/ |
| 245 | lemma exists_algebraMap_residueField_comp_eq (g : P ⟶ of F) : |
| 246 | ∃ q : PrimeSpectrum P, ∃ l : of q.asIdeal.ResidueField ⟶ of F, |
| 247 | ofHom (algebraMap P q.asIdeal.ResidueField) ≫ l = g := by |
| 248 | -- Take `q = ker g`: elements outside it go to units of the field `F`. |
| 249 | have := ker_isPrime g.hom |
| 250 | have h_unit : (ker g.hom).primeCompl ≤ (IsUnit.submonoid F).comap g.hom := fun p hp ↦ .mk0 _ hp |
| 251 | exact ⟨⟨ker g.hom, inferInstance⟩, ofHom (lift _ g.hom le_rfl h_unit), |
| 252 | hom_ext (RingHom.ext (lift_algebraMap _ g.hom le_rfl h_unit))⟩ |
| 253 | |
| 254 | /-- For a point `x` of the space of places over `C`, the subring of `P × C` of pairs `(t, c)` such |
| 255 | that `x` gives `t` the finite value `c`. For any representative `f` of `x`, these are the pairs of |
| 256 | `New.Variety.ResiduePlace.fractionGraph f`, that is, `f (numerator t) = f (denominator t) * c`. This |
| 257 | does not depend on the choice of `f`. -/ |
| 258 | def placeGraph : Subring (P × C) := |
| 259 | x.down.lift fractionGraph (by |
| 260 | -- equal values give the same graph, by `mem_fractionGraph` and coprimality |
| 261 | rintro _ _ ⟨⟩ |
| 262 | grind +extAll [mem_fractionGraph, isCoprime_denominator_numerator, IsCoprime]) |
| 263 | |
| 264 | /-- If `x` gives `t` the value `c`, then the image of `x` under `k : C ⟶ C'` gives `t` the value |
| 265 | `k c`. -/ |
| 266 | lemma placeGraph_map {k : C ⟶ C'} {c : C} : |
| 267 | ∀ {x : (placeSpace z).obj C}, (t, c) ∈ placeGraph x → |
| 268 | (t, k c) ∈ placeGraph ((placeSpace z).map k x) := by |
| 269 | rintro ⟨⟨f⟩⟩ (h_mem : (t, c) ∈ fractionGraph f) |
| 270 | -- apply `k` to the equation of `mem_fractionGraph` |
| 271 | change (t, k c) ∈ fractionGraph (f ≫ k) |
| 272 | simp [mem_fractionGraph, mem_fractionGraph.mp h_mem] |
| 273 | |
| 274 | variable (z) (J : Ideal D) (B : Subring q.ResidueField) |
| 275 | |
| 276 | /-- For an ideal I of P, the subfunctor of the space of places W of points that give every t ∈ I |
| 277 | the value 0. -/ |
| 278 | def killingPlaces (I : Ideal P) : Subfunctor (placeSpace z) where |
| 279 | obj _ := {x | ∀ t ∈ I, (t, 0) ∈ placeGraph x} |
| 280 | map k x hx t ht := by simpa using placeGraph_map (k := k) (hx t ht) |
| 281 | |
| 282 | /-- For a maximal ideal q of P and a place y killing q, the subring of κ(q) = P/q formed by the |
| 283 | images of the t ∈ P finite at y, that is, of those `t` with a value at `y`: some |
| 284 | `(t, c) ∈ placeGraph y`. -/ |
| 285 | def finiteValueSubring (y : killingPlaces z q C) : Subring q.ResidueField := |
| 286 | (((algebraMap P q.ResidueField).comp (fst P C)).domRestrict (placeGraph y.val)).range |
| 287 | |
| 288 | /-- For an ideal J of D and a subring B of κ(q), the subfunctor of places vanishing on q that |
| 289 | are finite on B and whose structure map from D kills J. -/ |
| 290 | def placesFiniteOn : Subfunctor (killingPlaces z q).toFunctor := |
| 291 | zeroPoints ((killingPlaces z q).ι ≫ placeSpaceMap z ≫ s) J ⊓ |
| 292 | { obj _ := {y | B ≤ finiteValueSubring z y} |
| 293 | map k y hy u hb := by |
| 294 | -- if `u` is the residue of `t` and `t` has the value `c`, then it now has the value `k c` |
| 295 | obtain ⟨⟨⟨t, c⟩, htc⟩, ht⟩ := hy hb |
| 296 | exact ⟨⟨(t, k c), placeGraph_map htc⟩, ht⟩ } |
| 297 | |
| 298 | variable {z J B x} |
| 299 | |
| 300 | /-- A point `x` of the space of places gives an element `t ∈ P` at most one finite value: if |
| 301 | `(t, c)` and `(t, d)` both lie in `New.Variety.ResiduePlace.placeGraph x`, then `c = d`. -/ |
| 302 | lemma placeGraph_unique {c d : C} (hc : (t, c) ∈ placeGraph x) (hd : (t, d) ∈ placeGraph x) : |
| 303 | c = d := by |
| 304 | obtain ⟨⟨f⟩⟩ := x |
| 305 | -- `f (denominator t)` divides `f (numerator t)` and is coprime to it, so it is a unit and cancels |
| 306 | have hc_eq : f (numerator t) = f (denominator t) * c := mem_fractionGraph.mp hc |
| 307 | have h_unit : IsUnit (f (denominator t)) := |
| 308 | (isUnit_denominator_iff_dvd_numerator f t).2 ⟨c, hc_eq⟩ |
| 309 | exact h_unit.mul_left_cancel (hc_eq.symm.trans (mem_fractionGraph.mp hd)) |
| 310 | |
| 311 | /-- For an ideal `I` of `P`, the inclusion of the places that give every `t ∈ I` the value `0` |
| 312 | (`New.Variety.ResiduePlace.killingPlaces z I`) into the space of places is relatively affine. -/ |
| 313 | lemma isRelAffine_killingPlaces (I : Ideal P) : IsRelAffine (killingPlaces z I).ι := by |
| 314 | refine isRelAffine_ι_of_forall_map_mem_iff ?_ |
| 315 | rintro C ⟨⟨f⟩⟩ |
| 316 | -- by `mem_fractionGraph`, the place kills `t` iff `numerator t` is sent to `0` |
| 317 | exact ⟨f '' (numerator '' I), ∅, fun C' k ↦ |
| 318 | (forall₂_congr fun t _ ↦ mem_fractionGraph).trans (by simp)⟩ |
| 319 | |
| 320 | /-- Let `q` be a maximal ideal of `P` and let the class of `f : prodValuationRing → C` be a place |
| 321 | that kills `q`. Then the place is finite at the residue of `t ∈ P` in `κ(q)` iff `f (denominator t)` |
| 322 | is a unit. -/ |
| 323 | lemma mem_finiteValueSubring_iff {f : prodValuationRing (baseRingMap s ξ) ⟶ C} |
| 324 | (h_kill : { down := ⟦f⟧ } ∈ (killingPlaces z q).obj C) : |
| 325 | ↑t ∈ finiteValueSubring z (⟨⟨⟦f⟧⟩, h_kill⟩ : killingPlaces z q C) ↔ |
| 326 | IsUnit (f (denominator t)) := by |
| 327 | refine ⟨?_, fun h_unit ↦ ?_⟩ |
| 328 | · -- some `u ≡ t` mod `q` has a value `c`; as the place kills `t - u`, `t` has the value `c` too |
| 329 | rintro ⟨⟨⟨u, c⟩, huc⟩, hu⟩ |
| 330 | have h_diff : t - u ∈ q := by simp_all [← algebraMap_residueField_eq_zero] |
| 331 | have h_sum : (u, c) + (t - u, 0) ∈ fractionGraph f := add_mem huc (h_kill _ h_diff) |
| 332 | have h_mem : (t, c) ∈ fractionGraph f := by simpa using h_sum |
| 333 | exact (isUnit_denominator_iff_dvd_numerator f t).2 ⟨c, mem_fractionGraph.mp h_mem⟩ |
| 334 | · obtain ⟨c, hc⟩ := (isUnit_denominator_iff_dvd_numerator f t).1 h_unit |
| 335 | exact ⟨⟨(t, c), mem_fractionGraph.mpr hc⟩, rfl⟩ |
| 336 | |
| 337 | /-- Through the place `j`, an element `t` with residue in the valuation ring of `j` has as value the |
| 338 | image of that residue. -/ |
| 339 | lemma mem_fractionGraph_projHom {φ : of j.valuationSubring ⟶ C} (t : P) |
| 340 | (h_mem : ↑t ∈ j.valuationSubring) : |
| 341 | (t, φ ⟨t, h_mem⟩) ∈ fractionGraph (j.projHom ≫ φ) := by |
| 342 | simp [mem_fractionGraph, numerator, denominator, h_mem] |
| 343 | |
| 344 | /-- A point that factors through the place `j` kills the prime of `j`. -/ |
| 345 | lemma projHom_mem_killingPlaces {Z : CommRingCat ⥤ Type 1} {D P C : CommRingCat} |
| 346 | {s : Z ⟶ reprBy D} {ξ : Z P} {z : ValuativeLift s ξ} (j : ResiduePlace (baseRingMap s ξ)) |
| 347 | (φ : of j.valuationSubring ⟶ C) : |
| 348 | ⟨⟦projHom j ≫ φ⟧⟩ ∈ killingPlaces z j.prime.asIdeal C := by |
| 349 | intro t ht |
| 350 | -- `t` is zero in the residue field of `j`, hence so is `j.numerator t` |
| 351 | have h_num : j.numerator t = 0 := by |
| 352 | simp [Subtype.ext_iff, numerator, algebraMap_residueField_eq_zero.mpr ht] |
| 353 | exact mem_fractionGraph.mpr (by simp [h_num]) |
| 354 | |
| 355 | /-- For an ideal `J` of `D` and a subring `B` of `κ(q)`, the inclusion of the places that kill the |
| 356 | maximal ideal `q` of `P`, are finite on `B` and whose structure map kills `J` |
| 357 | (`New.Variety.ResiduePlace.placesFiniteOn z J B`) into the places that kill `q` is relatively |
| 358 | affine. -/ |
| 359 | lemma isRelAffine_placesFiniteOn : IsRelAffine (placesFiniteOn z J B).ι := by |
| 360 | refine isRelAffine_ι_of_forall_map_mem_iff ?_ |
| 361 | rintro C ⟨⟨⟨f⟩⟩, hf⟩ |
| 362 | -- the image of `J` must vanish, and `denominator t` must become a unit for each `t` over `B` |
| 363 | -- (`mem_finiteValueSubring_iff`) |
| 364 | refine ⟨baseRingMap s (Z.map f z.point) '' J, |
| 365 | (fun t ↦ f (denominator t)) '' {t | algebraMap P q.ResidueField t ∈ B}, |
| 366 | fun C' k ↦ .trans (.and ?_ ?_) (forall_mem_image.and forall_mem_image).symm⟩ |
| 367 | · -- the structure map of the image under `k` is that of `Z.map f z.point` followed by `k` |
| 368 | refine forall₂_congr fun d _ ↦ ?_ |
| 369 | change baseRingMap s (Z.map (f ≫ k) z.point) d = 0 ↔ k (baseRingMap s (Z.map f z.point) d) = 0 |
| 370 | simp |
| 371 | · exact q.algebraMap_residueField_surjective.forall.trans |
| 372 | (forall₂_congr fun _ _ ↦ mem_finiteValueSubring_iff _) |
| 373 | |
| 374 | /-- For `d ∈ D`, the point `x` of the space of places gives the image `baseRingMap s ξ d` of `d` in |
| 375 | `P` the value `baseRingMap (placeSpaceMap z ≫ s) x d`, the image of `d` under the structure map |
| 376 | of `x`. -/ |
| 377 | lemma baseRingMap_mem_placeGraph {Z : CommRingCat ⥤ Type 1} {D P C : CommRingCat} |
| 378 | {s : Z ⟶ reprBy D} {ξ : Z P} {z : ValuativeLift s ξ} {x : placeSpace z C} (d : D) : |
| 379 | (baseRingMap s ξ d, baseRingMap (placeSpaceMap z ≫ s) x d) ∈ placeGraph x := by |
| 380 | obtain ⟨⟨f⟩⟩ := x |
| 381 | -- `baseRingMap s z.point d` lifts both components: the first by `z.map_point_eq`, the second by |
| 382 | -- `baseRingMap_map` |
| 383 | refine ⟨1, one_mem _, baseRingMap s z.point d, Prod.ext ?_ ?_⟩ |
| 384 | · simpa using congrArg (baseRingMap s · d) z.map_point_eq |
| 385 | · change f (baseRingMap s z.point d) = 1 * baseRingMap s (Z.map f z.point) d |
| 386 | simp |
| 387 | |
| 388 | /-! ### Points in local rings, and properness -/ |
| 389 | |
| 390 | /-- Let `z` be a valuative lift of `ξ ∈ Z(P)`, `U` a valuation subring of a field `L`, and |
| 391 | `f₀ : prodValuationRing (baseRingMap s ξ) ⟶ of U`. Suppose `f₀` factors over `L` through |
| 392 | `toFieldProd ≫ G`, where `G` agrees on `P` with `l : κ(𝔭) ⟶ L` for a prime `𝔭` of `P`. Then for |
| 393 | any valuation subring `O ⊆ U.comap l` of `κ(𝔭)` containing the image of `D`, `f₀` and |
| 394 | `projHom ⟨𝔭, O, hO⟩ ≫ ofHom (l.restrict O U h_le)` define the same point of `placeSpace z` over |
| 395 | `U`. -/ |
| 396 | private lemma placeSpace_mk_eq_projHom_comp {L : Type} [Field L] |
| 397 | (U : ValuationSubring L) (f₀ : prodValuationRing (baseRingMap s ξ) ⟶ of U) |
| 398 | {G : of (∀ j : ResiduePlace (baseRingMap s ξ), j.PlaceField) ⟶ of L} |
| 399 | (hG : toFieldProd ≫ G = f₀ ≫ ofHom U.subtype) {𝔭 : PrimeSpectrum P} |
| 400 | {l : of 𝔭.asIdeal.ResidueField ⟶ of L} |
| 401 | (hl : ofHom (algebraMap P _) ≫ l = ofHom (algebraMap P _) ≫ G) |
| 402 | (O : ValuationSubring 𝔭.asIdeal.ResidueField) (hO : ∀ d : D, ↑(baseRingMap s ξ d) ∈ O) |
| 403 | (h_le : O ≤ U.comap l.hom) : |
| 404 | (⟨⟦f₀⟧⟩ : (placeSpace z).obj (of U)) = |
| 405 | ⟨⟦projHom ⟨𝔭, O, hO⟩ ≫ ofHom (restrict l.hom O U h_le)⟧⟩ := by |
| 406 | -- Both `f₀` and `f'` factor over `L` through `toFieldProd` followed by a map extending `l` on |
| 407 | -- `P`. |
| 408 | let f' : prodValuationRing (baseRingMap s ξ) ⟶ of U := |
| 409 | projHom ⟨𝔭, O, hO⟩ ≫ ofHom (restrict l.hom O U h_le) |
| 410 | have h_compat {g : prodValuationRing (baseRingMap s ξ) ⟶ of U} |
| 411 | {H : of (∀ j : ResiduePlace (baseRingMap s ξ), j.PlaceField) ⟶ of L} |
| 412 | (hg : g ≫ ofHom U.subtype = toFieldProd ≫ H) |
| 413 | (hH : ofHom (algebraMap P _) ≫ H = ofHom (algebraMap P _) ≫ l) : |
| 414 | Z.map (ofHom U.subtype) (Z.map g z.point) = Z.map (ofHom (algebraMap P _) ≫ l) ξ ∧ |
| 415 | ∀ t : P, (g (numerator t) : L) = l (algebraMap P _ t) * (g (denominator t) : L) := by |
| 416 | refine ⟨?_, fun t ↦ ?_⟩ |
| 417 | · -- By `z.map_point_eq`, both sides over `L` are the image of `ξ`. |
| 418 | rw [← Z.map_comp_apply, hg, Z.map_comp_apply, z.map_point_eq, ← Z.map_comp_apply, hH] |
| 419 | · -- In `L`, both `f₀` and `f'` send `numerator t` to `l t` times the image of `denominator t`. |
| 420 | have h_eq (r : prodValuationRing (baseRingMap s ξ)) : (g r : L) = H (toFieldProd r) := |
| 421 | ConcreteCategory.congr_hom hg r |
| 422 | have h_l : H (algebraMap P _ t) = l (algebraMap P _ t) := ConcreteCategory.congr_hom hH t |
| 423 | rw [h_eq, h_eq, ← h_l] |
| 424 | exact map_mul H.hom (algebraMap P _ t) (toFieldProd (denominator t)) |
| 425 | obtain ⟨h_pt₀, h_val₀⟩ := h_compat hG.symm hl.symm |
| 426 | obtain ⟨h_pt', h_val'⟩ := |
| 427 | h_compat (g := f') (H := ofHom (evalRingHom PlaceField ⟨𝔭, O, hO⟩) ≫ l) rfl rfl |
| 428 | have h_point : Z.map f₀ z.point = Z.map f' z.point := |
| 429 | z.isProperOver.injective_map_valuationSubring U (h_pt₀.trans h_pt'.symm) |
| 430 | have h_value (t : P) : |
| 431 | f₀ (numerator t) * f' (denominator t) = f' (numerator t) * f₀ (denominator t) := |
| 432 | Subtype.ext (show (f₀ (numerator t) : L) * f' (denominator t) = |
| 433 | f' (numerator t) * f₀ (denominator t) by rw [h_val₀, h_val', mul_right_comm]) |
| 434 | -- so `f₀` and `f'` have the same class |
| 435 | exact congrArg ULift.up (Quot.sound ⟨h_point, h_value⟩) |
| 436 | |
| 437 | /-- Let `z` be a valuative lift of `ξ ∈ Z(P)`. This is a point of `Z` over `prodValuationRing`, the |
| 438 | product of the valuation rings of all places `(q, O)`, and it agrees with `ξ` over the product of |
| 439 | the residue fields. Here a place is a prime `q` of `P` together with a valuation ring `O` of `κ(q)` |
| 440 | containing the image of `D` under `baseRingMap s ξ`. Let `R` be a local ring and `x` a point over |
| 441 | `R` of the space of places of `z`, that is, a class of maps `prodValuationRing → R`; then there is a |
| 442 | place `(q, O')` with two properties. (a) There is a local map `φ : O' → R`. (b) For every valuation |
| 443 | ring `O ⊆ O'` of `κ(q)` containing the image of `D`, `x` is the class of the composite |
| 444 | `prodValuationRing → O ⊆ O' → R` of the projection, the inclusion and `φ`. -/ |
| 445 | lemma exists_isLocalHom_eq_projHom_comp {Z : CommRingCat ⥤ Type 1} {D P : CommRingCat} |
| 446 | {s : Z ⟶ reprBy D} {ξ : Z P} {z : ValuativeLift s ξ} {R : Type} [CommRing R] [IsLocalRing R] |
| 447 | (x : (placeSpace z).obj (of R)) : |
| 448 | ∃ (j : ResiduePlace (baseRingMap s ξ)) (φ : j.valuationSubring →+* R), |
| 449 | IsLocalHom φ ∧ |
| 450 | -- `x` comes from `φ` on every smaller valuation ring `O` over `D` |
| 451 | ∀ (O : ValuationSubring j.prime.asIdeal.ResidueField) |
| 452 | (hO : ∀ d : D, ↑(baseRingMap s ξ d) ∈ O) (h_le : O ≤ j.valuationSubring), |
| 453 | x = ⟨⟦projHom ⟨j.prime, O, hO⟩ ≫ ofHom |
| 454 | (φ.comp (O.inclusion j.valuationSubring h_le))⟧⟩ := by |
| 455 | -- Localise the product ring at the preimage of the maximal ideal; as it is a test ring, this |
| 456 | -- gives a valuation ring `U` of a field `L`. The map to `L` extends to the product of the residue |
| 457 | -- fields, so on `P` it factors through an embedding `l` of one residue field; the place is the |
| 458 | -- preimage of `U`. |
| 459 | obtain ⟨⟨f⟩⟩ := x |
| 460 | have (q : Ideal P) [q.IsPrime] : IsAlgClosed q.ResidueField := z.isAlgClosed_residueField q |
| 461 | have h_test : IsTest (prodValuationRing (baseRingMap s ξ)) := |
| 462 | IsTest.pi fun _ ↦ isTest_of_preValuationRing |
| 463 | obtain ⟨-, -, L, _, _, U, _, hU : IsLocalization.AtPrime U ((maximalIdeal R).comap f.hom)⟩ := |
| 464 | h_test.exists_valuationSubring_atPrime ((maximalIdeal R).comap f.hom) |
| 465 | -- `f` factors through the localisation `U`, as `R` is local. |
| 466 | let f₀ : prodValuationRing (baseRingMap s ξ) ⟶ of U := ofHom (algebraMap _ U) |
| 467 | obtain ⟨ψ, rfl⟩ : ∃ ψ : of U ⟶ of R, f₀ ≫ ψ = f := ⟨_, hom_ext (hU.lift_comp (by simp))⟩ |
| 468 | -- The product of the residue fields is a localisation of `prodValuationRing` at |
| 469 | -- non-zero-divisors, which stay nonzero in `L`. |
| 470 | obtain ⟨G, hG⟩ : ∃ G : of (∀ j : ResiduePlace (baseRingMap s ξ), j.PlaceField) ⟶ of L, |
| 471 | toFieldProd ≫ G = f₀ ≫ ofHom U.subtype := by |
| 472 | refine ⟨_, hom_ext (IsLocalization.map_comp |
| 473 | (M := .pi univ fun j ↦ nonZeroDivisors j.valuationSubring) |
| 474 | fun _ _ ↦ hU.nonZeroDivisors_le_comap _ _ ?_)⟩ |
| 475 | simp_all [funext_iff, Submonoid.mem_pi, mem_nonZeroDivisors_iff] |
| 476 | obtain ⟨q, l, hl⟩ : ∃ (q : PrimeSpectrum P) (l : of q.asIdeal.ResidueField ⟶ of L), |
| 477 | ofHom (algebraMap P _) ≫ l = ofHom (algebraMap P _) ≫ G := |
| 478 | exists_algebraMap_residueField_comp_eq _ |
| 479 | have h_finite (d : D) : algebraMap P _ (baseRingMap s ξ d) ∈ U.comap l.hom := by |
| 480 | -- the image of `baseRingMap s ξ d` in `L` is that of an element `r` of `prodValuationRing` |
| 481 | let r : prodValuationRing (baseRingMap s ξ) := fun j ↦ ⟨_, j.base_mem d⟩ |
| 482 | have h_eq : l (algebraMap P _ (baseRingMap s ξ d)) = (f₀ r : L) := |
| 483 | (ConcreteCategory.congr_hom hl _).trans (ConcreteCategory.congr_hom hG r) |
| 484 | simp [h_eq] |
| 485 | refine ⟨⟨q, U.comap l.hom, h_finite⟩, ψ.hom.comp (l.hom.restrict _ U (by simp)), |
| 486 | ⟨fun a ↦ not_imp_not.mp fun ha ↦ ?_⟩, fun O hO h_le ↦ ?_⟩ |
| 487 | · -- `ψ` is local, and `l` sends nonunits to nonunits. |
| 488 | have h_nonunit : (l.hom.restrict _ U (by simp)) a ∈ maximalIdeal U := by |
| 489 | simp_all [Submonoid.isUnit_iff_and] |
| 490 | exact hU.map_eq_maximalIdeal.ge.trans ((maximalIdeal R).comap ψ.hom).map_comap_le h_nonunit |
| 491 | -- `f₀` and the projection composite have the same class over `U`; push forward along `ψ`. |
| 492 | exact congrArg ((placeSpace z).map ψ) (placeSpace_mk_eq_projHom_comp U f₀ hG hl O hO h_le) |
| 493 | |
| 494 | /-- Let `z` be a valuative lift of `ξ ∈ Z(P)`: `Z` is proper over `D`, `P` is absolutely flat, the |
| 495 | residue fields of `P` are algebraically closed, and the point of `z` agrees with `ξ` over the |
| 496 | product of the residue fields. Then the space of places of `z` is proper over `D`. -/ |
| 497 | lemma isProperOver_placeSpace {Z : CommRingCat ⥤ Type 1} {D P : CommRingCat} {s : Z ⟶ reprBy D} |
| 498 | {ξ : Z P} {z : ValuativeLift s ξ} : IsProperOver (placeSpaceMap z ≫ s) := by |
| 499 | refine ⟨?_, prodValuationRing (baseRingMap s ξ), ⟨⟦𝟙 _⟧⟩, fun {K} _ _ O x hx ↦ ?_⟩ |
| 500 | · -- Separatedness: add the equations for equal values to the ideal that `z.isProperOver` gives. |
| 501 | rintro C ⟨⟨f⟩⟩ ⟨⟨g⟩⟩ |
| 502 | obtain ⟨I, hI⟩ := z.isProperOver.diagonal_closed C (Z.map f z.point) (Z.map g z.point) |
| 503 | refine ⟨I ⊔ ⨆ t : P, |
| 504 | span {f (numerator t) * g (denominator t) - g (numerator t) * f (denominator t)}, |
| 505 | fun C' k ↦ ?_⟩ |
| 506 | -- two classes are equal iff the points and all the ratios agree |
| 507 | refine ULift.up_inj.trans (Quotient.eq.trans ?_) |
| 508 | simp [← hI, sub_eq_zero] |
| 509 | -- Valuative criterion: `x` comes from a local map `φ : j.valuationSubring → K`, and the preimage |
| 510 | -- `O'` of `O` is a valuation ring inside `j.valuationSubring` that gives the lift. |
| 511 | obtain ⟨j, φ, hφ : IsLocalHom φ, hx_eq⟩ := exists_isLocalHom_eq_projHom_comp x |
| 512 | let O' : Subring j.PlaceField := (O.toSubring.comap φ).map j.valuationSubring.subtype |
| 513 | have h_val (y : j.PlaceField) : y ∈ O' ∨ y⁻¹ ∈ O' := by |
| 514 | -- if `y ∉ j.valuationSubring`, then `y⁻¹ ∈ j.valuationSubring` and the claim for `y⁻¹` gives it |
| 515 | wlog hy : y ∈ j.valuationSubring generalizing y |
| 516 | · grind [j.valuationSubring.mem_or_inv_mem] |
| 517 | -- If `y ∉ O'` then `φ y ≠ 0`, so `y` is a unit of `j.valuationSubring` and `φ y⁻¹ ∈ O`. |
| 518 | refine or_iff_not_imp_left.mpr fun h_not ↦ ?_ |
| 519 | have hφ_unit : IsUnit (φ ⟨y, hy⟩) := by aesop |
| 520 | obtain ⟨u, hu⟩ : IsUnit (⟨y, hy⟩ : j.valuationSubring) := hφ.map_nonunit _ hφ_unit |
| 521 | have h_inv_mem : (φ u)⁻¹ ∈ O := |
| 522 | (O.mem_or_inv_mem _).resolve_left fun h_mem ↦ h_not ⟨u, h_mem, by simp [hu]⟩ |
| 523 | exact ⟨↑u⁻¹, by simpa using h_inv_mem, by aesop⟩ |
| 524 | -- `O'` lies over `D`: the value of `x` at `baseRingMap s ξ d` is both its image under `φ` |
| 525 | -- (`mem_fractionGraph_projHom`) and the image of `d` under the structure map of `x` |
| 526 | -- (`baseRingMap_mem_placeGraph`), which lies in `O`. |
| 527 | have h_finite (d : D) : algebraMap P _ (baseRingMap s ξ d) ∈ O' := by |
| 528 | have h_graph : (baseRingMap s ξ d, φ ⟨_, j.base_mem d⟩) ∈ placeGraph x := by |
| 529 | rw [hx_eq _ _ le_rfl] |
| 530 | exact j.mem_fractionGraph_projHom (baseRingMap s ξ d) (j.base_mem d) |
| 531 | have h_value : baseRingMap (placeSpaceMap z ≫ s) x d = φ ⟨_, j.base_mem d⟩ := |
| 532 | placeGraph_unique (baseRingMap_mem_placeGraph d) h_graph |
| 533 | exact ⟨⟨_, j.base_mem d⟩, by simpa [← h_value] using hx d, rfl⟩ |
| 534 | refine ⟨projHom ⟨_, ⟨O', h_val⟩, h_finite⟩ ≫ ofHom ((φ.comp _).codRestrict O ?_), |
| 535 | (hx_eq _ _ image_val_subset).symm⟩ |
| 536 | -- an element of `O'` comes from an element of `j.valuationSubring` that `φ` sends into `O` |
| 537 | rintro ⟨_, w, hw, rfl⟩ |
| 538 | exact hw |
| 539 | |
| 540 | /-- Let `q` be a maximal ideal of `P` and `x` a point of the space of places in a local ring `R` |
| 541 | that kills `q`. There are a valuation ring `V` of `κ(q)` over `D` and a map `φ : V → R` such that |
| 542 | `V` is the subring of `κ(q)` on which `x` is finite, and `x` is the class of |
| 543 | `prodValuationRing → O ⊆ V → R` for every valuation ring `O ⊆ V` over `D`. -/ |
| 544 | private lemma exists_valuationSubring_eq_finiteValueSubring {x : placeSpace z ⟨R⟩} |
| 545 | (hq : x ∈ (killingPlaces z q).obj ⟨R⟩) : |
| 546 | ∃ (V : ValuationSubring q.ResidueField) (_ : ∀ d : D, ↑(baseRingMap s ξ d) ∈ V) (φ : V →+* R), |
| 547 | finiteValueSubring z ⟨x, hq⟩ = V.toSubring ∧ |
| 548 | ∀ (O : ValuationSubring q.ResidueField) (hO : ∀ d : D, ↑(baseRingMap s ξ d) ∈ O) |
| 549 | (h_le : O ≤ V), |
| 550 | x = ⟨⟦projHom ⟨⟨q, M.isPrime⟩, O, hO⟩ ≫ ofHom (φ.comp (O.inclusion V h_le))⟧⟩ := by |
| 551 | obtain ⟨⟨⟨q', hq'⟩, V, hV⟩, φ, φ_local : IsLocalHom φ, hx⟩ := exists_isLocalHom_eq_projHom_comp x |
| 552 | have h_kill : x ∈ (killingPlaces z q').obj (of R) := by |
| 553 | simpa [hx V hV le_rfl] using projHom_mem_killingPlaces ⟨⟨q', hq'⟩, V, hV⟩ _ |
| 554 | -- The place lies over `q`: for `t ∈ q` with `y * t * t = t`, either `t ∈ q'` or `1 - y * t ∈ q'`. |
| 555 | -- In the second case `x` kills `y * t` and `1 - y * t`, so `1` would have the value `0`. |
| 556 | have h_le : q ≤ q' := by |
| 557 | intro t ht |
| 558 | obtain ⟨y, hy : y * t * t = t⟩ := z.absolutely_flat t |
| 559 | have h_prod : (1 - y * t) * t ∈ q' := by simp [sub_mul, hy] |
| 560 | refine (hq'.mem_or_mem h_prod).resolve_left fun hmem ↦ ?_ |
| 561 | have h_one : ((1 : P), (0 : R)) ∈ placeGraph x := by |
| 562 | simpa using add_mem (hq _ (q.mul_mem_left y ht)) (h_kill _ hmem) |
| 563 | exact one_ne_zero (placeGraph_unique (one_mem _) h_one) |
| 564 | -- `q'` is `q`, as `q` is maximal, and `x` is the class of `projHom ≫ φ` |
| 565 | obtain rfl : q = q' := M.eq_of_le hq'.ne_top h_le |
| 566 | obtain rfl := hx V hV le_rfl |
| 567 | -- the ring where the place is finite is the valuation ring `V` |
| 568 | refine ⟨V, hV, φ, Subring.ext (q.algebraMap_residueField_surjective.forall.mpr fun t ↦ ?_), hx⟩ |
| 569 | rw [mem_finiteValueSubring_iff] |
| 570 | by_cases ht : algebraMap P _ t ∈ V |
| 571 | · simp [denominator, ht] |
| 572 | · -- `φ` is local, and `t⁻¹` is not a unit of `V` when `t ∉ V` |
| 573 | have h_nonunit (h_inv : (algebraMap P _ t)⁻¹ ∈ V) : ¬IsUnit (⟨_, h_inv⟩ : V) := by |
| 574 | simp [Submonoid.isUnit_iff_and, ht] |
| 575 | simp [denominator, ht] |
| 576 | exact h_nonunit _ |
| 577 | |
| 578 | /-- Let `x` be a point of the space of places in a local ring that kills the maximal ideal `q`. The |
| 579 | subring of `κ(q)` on which `x` is finite is a valuation ring. -/ |
| 580 | lemma finiteValueSubring_mem_or_inv_mem {x : placeSpace z ⟨R⟩} |
| 581 | (hq : x ∈ (killingPlaces z q).obj ⟨R⟩) (t : q.ResidueField) : |
| 582 | t ∈ finiteValueSubring z ⟨x, hq⟩ ∨ t⁻¹ ∈ finiteValueSubring z ⟨x, hq⟩ := by |
| 583 | obtain ⟨V, -, -, h_eq, -⟩ := exists_valuationSubring_eq_finiteValueSubring hq |
| 584 | simpa [h_eq] using V.mem_or_inv_mem t |
| 585 | |
| 586 | /-- Let `x` be a point of the space of places in a local ring `R` that kills the maximal ideal `q`, |
| 587 | and `O` a valuation ring of `κ(q)` over `D` inside the subring on which `x` is finite. Then `x` is |
| 588 | the class of `prodValuationRing → O → R` for some map `O → R`. -/ |
| 589 | lemma exists_eq_projHom_comp_of_le_finiteValueSubring {x : placeSpace z ⟨R⟩} |
| 590 | (hq : x ∈ (killingPlaces z q).obj ⟨R⟩) (O : ValuationSubring q.ResidueField) |
| 591 | (hO : ∀ d : D, ↑(baseRingMap s ξ d) ∈ O) (h_le : O.toSubring ≤ finiteValueSubring z ⟨x, hq⟩) : |
| 592 | ∃ φ : of O ⟶ ⟨R⟩, x = ⟨⟦projHom ⟨⟨q, M.isPrime⟩, O, hO⟩ ≫ φ⟧⟩ := by |
| 593 | obtain ⟨V, -, φ, h_eq, hx⟩ := exists_valuationSubring_eq_finiteValueSubring hq |
| 594 | exact ⟨_, hx O hO (h_le.trans_eq h_eq)⟩ |
| 595 | |
| 596 | end ResiduePlace |
| 597 | |
| 598 | end New.Variety |
| 599 | |
| 600 | end |