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.Morphisms.FinitePresentation.Basic |
| 4 | import TauCeti.AlgebraicGeometry.Morphisms.Flat.Descent |
| 5 | import TauCeti.RingTheory.Ideal.MinimalPrime.Localization |
| 6 | import TauCeti.RingTheory.Ideal.TensorProduct |
| 7 | public import Aesop.BuiltinRules |
| 8 | public import Mathlib.AlgebraicGeometry.Morphisms.QuasiFinite |
| 9 | import Mathlib.AlgebraicGeometry.Morphisms.WeaklyEtale |
| 10 | import Mathlib.AlgebraicGeometry.QuasiAffine |
| 11 | import Mathlib.AlgebraicGeometry.ZariskisMainTheorem |
| 12 | import Mathlib.CategoryTheory.Limits.Shapes.Connected |
| 13 | import Mathlib.RingTheory.Etale.Weakly |
| 14 | import Mathlib.RingTheory.Finiteness.ModuleFinitePresentation |
| 15 | import Mathlib.RingTheory.TotallySplit |
| 16 | import TauCeti.AlgebraicGeometry.Morphisms.Smooth.GeometricallyReduced |
| 17 | public import Lib.Shimura.AbelianScheme.Basic |
| 18 | import Lib.General.Geometry.PointsOfProperSchemes |
| 19 | |
| 20 | /-! |
| 21 | # Isogenies: factorisation of homomorphisms, finiteness and flatness |
| 22 | |
| 23 | Two facts on isogenies. Over an Artinian ring, a homomorphism that kills the kernel of an isogeny |
| 24 | factors through it. Over a local ring, a quasi-finite surjective homomorphism of abelian schemes is |
| 25 | an isogeny. |
| 26 | |
| 27 | * `New.Variety.exists_isAdditive_comp_eq_of_isIsogeny`: over an Artinian ring, a homomorphism that |
| 28 | kills the kernel of an isogeny `f`, tested on finite local algebras, factors through `f`. |
| 29 | * `New.Variety.isIsogeny_of_locallyQuasiFinite`: over a local ring, a locally quasi-finite |
| 30 | surjective homomorphism of abelian schemes is finite and flat. |
| 31 | |
| 32 | Notions from other files: |
| 33 | * `New.specOver`: The spectrum of an R-algebra B, as a scheme over Spec R. |
| 34 | * `New.IsAbelianScheme`: A commutative group scheme that is smooth and proper over the base, and on |
| 35 | which multiplication by every m ≠ 0 is surjective. |
| 36 | * `New.IsIsogeny`: A homomorphism that is finite, flat and surjective. |
| 37 | |
| 38 | ## Relation to the literature |
| 39 | |
| 40 | Known result: Factorisation through an isogeny, and quasi-finite surjective homomorphisms of abelian |
| 41 | schemes are finite flat. Here an abelian scheme means a smooth and proper commutative group scheme |
| 42 | on which multiplication by every m ≠ 0 is surjective; the base is an Artinian ring for the first |
| 43 | result and a local ring for the second. Source: B. Edixhoven, G. van der Geer, B. Moonen, Abelian |
| 44 | Varieties (draft), ch. IV §3; The Stacks project, Section 0BF9; EGA IV and S. Bosch, W. |
| 45 | Lütkebohmert, M. Raynaud, Néron Models (1990) 7.3, 8.1. |
| 46 | -/ |
| 47 | |
| 48 | @[expose] public section |
| 49 | |
| 50 | open CategoryTheory Category AlgebraicGeometry Limits MonoidalCategory CartesianMonoidalCategory |
| 51 | Algebra TensorProduct HasRingHomProperty MorphismProperty RingHom Module Flat LinearMap |
| 52 | IsLocalRing Over CommRingCat Ideal Scheme Spec IsLocalization AtPrime AddMonObj |
| 53 | |
| 54 | /-- Let R be a local ring with maximal ideal 𝔪, and L an R-algebra such that L ⧸ 𝔪L is reduced. |
| 55 | For a minimal prime q over 𝔪L, the ideal 𝔪 generates the maximal ideal of the localisation of L |
| 56 | at q. -/ |
| 57 | lemma Ideal.map_maximalIdeal_eq_maximalIdeal_of_mem_minimalPrimes {R L : Type} [CommRing R] |
| 58 | [IsLocalRing R] [CommRing L] [Algebra R L] {q : Ideal L} [q.IsPrime] |
| 59 | (hq : q ∈ ((maximalIdeal R).map (algebraMap R L)).minimalPrimes) |
| 60 | (h_red : IsReduced (L ⧸ (maximalIdeal R).map (algebraMap R L))) : |
| 61 | (maximalIdeal R).map (algebraMap R (Localization.AtPrime q)) = |
| 62 | maximalIdeal (Localization.AtPrime q) := by |
| 63 | have h := IsLocalization.AtPrime.map_eq_maximalIdeal_of_mem_minimalPrimes |
| 64 | (Localization.AtPrime q) ((isRadical_iff_quotient_reduced _).2 h_red) hq |
| 65 | rwa [Ideal.map_map] at h |
| 66 | |
| 67 | namespace New.Variety |
| 68 | |
| 69 | /-- Let `A` be a commutative group scheme and `B`, `C` abelian schemes over an Artinian ring `k`. |
| 70 | Let `f : A ⟶ B` be an isogeny and `g : A ⟶ C` a homomorphism that kills every point of the |
| 71 | kernel of `f` with values in a finite local Noetherian `k`-algebra `S`. Then `g` factors through `f` |
| 72 | by a homomorphism. -/ |
| 73 | lemma exists_isAdditive_comp_eq_of_isIsogeny {k : Type} [CommRing k] [IsArtinianRing k] |
| 74 | {A B C : Over (Spec (of k))} [AddObj A] [IsAbelianScheme B] [IsAbelianScheme C] (f : A ⟶ B) |
| 75 | [f_isog : IsIsogeny f] (g : A ⟶ C) [IsAdditive g] |
| 76 | (h_loc : ∀ (S : Type) [CommRing S] [IsLocalRing S] [Algebra k S] [Module.Finite k S] |
| 77 | [IsNoetherianRing S] (y : specOver k S ⟶ A), y ≫ f = 0 → y ≫ g = 0) : |
| 78 | ∃ j : B ⟶ C, IsAdditive j ∧ f ≫ j = g := by |
| 79 | -- The kernel of `f`: a closed subscheme `ι : Spec S ⟶ A` with `S` finite over `k`. |
| 80 | obtain ⟨S, ι, S_fin, -, ι_closed, ι_ker, ι_lift⟩ := |
| 81 | exists_finite_kernel_ring (f := f) inferInstance |
| 82 | -- `g` kills the kernel: the ideal `I` cutting out `ι ≫ g = 0` is zero in each |
| 83 | -- localisation at a maximal ideal. |
| 84 | have g_ker : ι ≫ g = 0 := by |
| 85 | obtain ⟨I, -, hI⟩ := exists_ideal_le_ker_iff_factors ζ[C].left (ι ≫ g).left |
| 86 | have I_zero : I ≤ RingHom.ker (RingHom.id S) := by |
| 87 | refine fun s hs ↦ eq_zero_of_localization s fun J _ ↦ ?_ |
| 88 | -- Over the Artinian ring `k` the localisation `S_J` is again finite, so `h_loc` applies. |
| 89 | have J_fin : Module.Finite k (Localization.AtPrime J) := .of_quasiFinite |
| 90 | have J_noeth : IsNoetherianRing (Localization.AtPrime J) := EssFiniteType.isNoetherianRing k _ |
| 91 | let y : specOver k (Localization.AtPrime J) ⟶ A := |
| 92 | specOver.map ⟨algebraMap S _, fun _ ↦ rfl⟩ ≫ ι |
| 93 | exact (hI _).mpr |
| 94 | (eq_zero_iff_factors_zero_section.mp (h_loc _ y (by simp [y, ι_ker]))) hs |
| 95 | simpa [eq_zero_iff_factors_zero_section] using (hI (.id S)).mp I_zero |
| 96 | have g_zero {T : Over (Spec (of k))} (a : T ⟶ A) (ha : a ≫ f = 0) : a ≫ g = 0 := by |
| 97 | obtain ⟨z, rfl⟩ := ι_lift a ha |
| 98 | simp [g_ker] |
| 99 | -- Descend `g` along the fpqc cover `f`; the relation, the graph `a ≫ f = b`, is stable. |
| 100 | have h_nat {T' T : Over (Spec (of k))} {a : T ⟶ A} {b : T ⟶ B} (t : T' ⟶ T) (h_ab : a ≫ f = b) : |
| 101 | (t ≫ a) ≫ f = t ≫ b := by rw [assoc, h_ab] |
| 102 | have h_sub {T : Over (Spec (of k))} {a a' : T ⟶ A} {b b' : T ⟶ B} (h_ab : a ≫ f = b) |
| 103 | (h_ab' : a' ≫ f = b') : (a - a') ≫ f = b - b' := by rw [AddGrpObj.sub_comp, h_ab, h_ab'] |
| 104 | have h_cover : Presieve.singleton f.left ∈ Scheme.fpqcPrecoverage B.left := by simp |
| 105 | obtain ⟨j, j_add, hj⟩ := exists_hom_of_rel g (fun a b ↦ a ≫ f = b) h_nat h_sub g_zero |
| 106 | (.singleton f.left) h_cover fun Z a h_mem ↦ by cases h_mem; exact ⟨homMk (𝟙 _), rfl⟩ |
| 107 | -- Applied to the point `𝟙 A`, related to `f`, the factorisation gives `f ≫ j = g`. |
| 108 | exact ⟨j, j_add, (hj A (𝟙 A) f (id_comp f)).trans (id_comp g)⟩ |
| 109 | |
| 110 | /-- For a commutative group scheme B over S, with x : T → B and y : Y → B, the sum map T × Y → B, |
| 111 | `(a, t) ↦ x a + y t`, inherits from `x` and from the structure map of `Y` every multiplicative |
| 112 | property that is stable under base change. -/ |
| 113 | lemma fst_comp_add_snd_comp_left_mem {S : Scheme.{0}} {B T Y : Over S} [AddObj B] |
| 114 | {Q : MorphismProperty Scheme} |
| 115 | [IsMultiplicative Q] [Q.IsStableUnderBaseChange] {x : T ⟶ B} (y : Y ⟶ B) (hx : Q x.left) |
| 116 | (hY : Q Y.hom) : |
| 117 | Q (SemiCartesianMonoidalCategory.fst T Y ≫ x + |
| 118 | SemiCartesianMonoidalCategory.snd T Y ≫ y).left := by |
| 119 | -- The map is `x ▷ Y`, then a shear of `B ⊗ Y` (an isomorphism), then the projection to `B`. |
| 120 | let shear (s : Y ⟶ B) : B ⊗ Y ⟶ B ⊗ Y := lift (fst B Y + snd B Y ≫ s) (snd B Y) |
| 121 | -- the shear by `y` has the shear by `-y` as inverse |
| 122 | have h_iso : IsIso (shear y) := |
| 123 | ⟨shear (-y), by aesop (add simp [AddGrpObj.comp_neg, comp_add])⟩ |
| 124 | have h_comp : Q (x ▷ Y ≫ shear y ≫ SemiCartesianMonoidalCategory.fst B Y).left := by |
| 125 | apply_rules [pullback_fst, overPullbackMap, RespectsIso.precomp, comp_mem] |
| 126 | simpa [shear, comp_add] using h_comp |
| 127 | |
| 128 | /-- Translation by the first factor identifies the pull-back of a homomorphism f : A → B along |
| 129 | v : A ⊗ Z → B with its pull-back along the map m (a, z) = f a + v (a, z). -/ |
| 130 | lemma isPullback_fst_comp_add {S : Scheme.{0}} {A B Z : Over S} [AddObj A] [AddObj B] (f : A ⟶ B) |
| 131 | [IsAdditive f] (v : A ⊗ Z ⟶ B) : |
| 132 | IsPullback (pullback.snd f v) (pullback.snd f v ≫ fst A Z + pullback.fst f v) |
| 133 | (fst A Z ≫ f + v) f := by |
| 134 | have square : IsPullback (pullback.fst f v) (pullback.snd f v) f v := .of_hasPullback f v |
| 135 | -- the square commutes, as `pullback.fst f v ≫ f = pullback.snd f v ≫ v` |
| 136 | have h_w : pullback.snd f v ≫ (fst A Z ≫ f + v) = |
| 137 | (pullback.snd f v ≫ fst A Z + pullback.fst f v) ≫ f := by |
| 138 | simp [square.w, comp_add, add_comp] |
| 139 | -- a point of the pull-back is fixed by its images in `A ⊗ Z` and in `A` |
| 140 | have h_ext : ∀ ⦃T : Over S⦄ ⦃φ φ' : T ⟶ pullback f v⦄, |
| 141 | φ ≫ pullback.snd f v = φ' ≫ pullback.snd f v → |
| 142 | φ ≫ (pullback.snd f v ≫ fst A Z + pullback.fst f v) = |
| 143 | φ' ≫ (pullback.snd f v ≫ fst A Z + pullback.fst f v) → φ = φ' := by |
| 144 | simp_all [pullback.hom_ext_iff, ← assoc, comp_add] |
| 145 | refine .mk' h_w h_ext fun T c b h_eq ↦ ?_ |
| 146 | -- the lift of `(c, b)` is the point `(b - c ≫ fst, c)` of the pull-back along `v` |
| 147 | have h_sq : (b - c ≫ fst A Z) ≫ f = c ≫ v := by |
| 148 | simp [← h_eq, AddGrpObj.sub_comp, comp_add] |
| 149 | exact ⟨square.lift (b - c ≫ fst A Z) c h_sq, by simp [comp_add]⟩ |
| 150 | |
| 151 | /-- Let f : A → B be a surjective homomorphism of abelian schemes over Spec R, and |
| 152 | u : Spec D → B a flat map over Spec R, where D is an R-algebra and Spec D → Spec R is surjective. |
| 153 | If the pull-back g : X → Spec D of f along u is flat, then f is flat, by descent along the fpqc |
| 154 | cover m (a, d) = f a + u d of B. -/ |
| 155 | lemma flat_left_of_isPullback_flat {R : Type} [CommRing R] {A B : Over (Spec ⟨R⟩)} |
| 156 | [IsAbelianScheme A] [IsAbelianScheme B] (f : A ⟶ B) [IsAdditive f] |
| 157 | (hf_surj : Surjective f.left) {D : Type} [CommRing D] |
| 158 | [Algebra R D] (u : specOver R D ⟶ B) (u_flat : Flat u.left) |
| 159 | (D_surj : Surjective (specOver R D).hom) {X : Scheme.{0}} {j : X ⟶ A.left} |
| 160 | {g : X ⟶ (specOver R D).left} (h_pb : IsPullback j g f.left u.left) (hg : Flat g) : |
| 161 | Flat f.left := by |
| 162 | let v : A ⊗ specOver R D ⟶ B := snd A (specOver R D) ≫ u |
| 163 | let m : A ⊗ specOver R D ⟶ B := fst A (specOver R D) ≫ f + v |
| 164 | have m_surj : Surjective m.left := fst_comp_add_snd_comp_left_mem u hf_surj D_surj |
| 165 | have m_flat : Flat m.left := by |
| 166 | -- `↓`: `comp_left` must fire before simp unfolds the braiding |
| 167 | simpa [m, v, add_comm, ↓← comp_left, comp_add] using |
| 168 | comp (β_ A _).hom.left _ (hg := fst_comp_add_snd_comp_left_mem f u_flat inferInstance) |
| 169 | have m_qc : QuasiCompact m.left := |
| 170 | fst_comp_add_snd_comp_left_mem u (inferInstance : QuasiCompact f.left) |
| 171 | (quasiCompact_of_compactSpace (map _)) |
| 172 | -- Translation by the first factor identifies the pull-backs of `f` along `v` and along `m`. |
| 173 | have translated : |
| 174 | IsPullback (pullback.snd f v) |
| 175 | (pullback.snd f v ≫ fst A (specOver R D) + pullback.fst f v) m f := |
| 176 | isPullback_fst_comp_add f v |
| 177 | -- `v` factors through `u`, so the pull-back along `v` is a base change of `g`. |
| 178 | have base_flat : Flat (pullback.snd f v).left := |
| 179 | of_isPullback (((IsPullback.of_hasPullback f v).map (Over.forget _)).of_right' h_pb) hg |
| 180 | -- Descend along the fpqc cover `m`. |
| 181 | exact AlgebraicGeometry.Flat.descendsAlong_surjective_inf_flat_inf_quasicompact.of_isPullback |
| 182 | (translated.map (Over.forget _)) ⟨⟨m_surj, m_flat⟩, m_qc⟩ base_flat |
| 183 | |
| 184 | /-- Let f : A → B be a finite morphism of abelian schemes over the local ring R, and u : Spec D → B |
| 185 | a flat map, where D is a local R-algebra whose maximal ideal is generated by that of R. If |
| 186 | Spec P → Spec D, given by φ : D → P, is the pull-back of f along u, then φ is flat. -/ |
| 187 | lemma flat_of_isPullback_of_map_maximalIdeal_eq {R D : Type} [CommRing R] [IsLocalRing R] |
| 188 | [CommRing D] [IsLocalRing D] [Algebra R D] {A B : Over (Spec ⟨R⟩)} [IsAbelianScheme A] |
| 189 | [IsAbelianScheme B] (f : A ⟶ B) (f_fin : IsFinite f.left) (u : specOver R D ⟶ B) |
| 190 | (u_flat : Flat u.left) (max_eq : (maximalIdeal R).map (algebraMap R D) = maximalIdeal D) |
| 191 | {P : CommRingCat} {φ : of D ⟶ P} {j : Spec P ⟶ A.left} |
| 192 | (h_pb : IsPullback j (Spec.map φ) f.left u.left) : φ.hom.Flat := by |
| 193 | algebraize [φ.hom, φ.hom.comp (algebraMap R D)] |
| 194 | -- `P` is finitely presented over the local ring `D`, so free once `𝔪_D ⊗ P → P` is injective. |
| 195 | have : LocallyOfFinitePresentation (f.left ≫ B.hom) := by |
| 196 | rw [f.w] |
| 197 | infer_instance |
| 198 | have h_f_pres := locallyOfFinitePresentation_of_comp f.left B.hom |
| 199 | apply_rules +allowSynthFailures [of_free, free_of_maximalIdeal_rTensor_injective, |
| 200 | h_f_pres, FinitePresentation.of_finite_of_finitePresentation, |
| 201 | (IsFinite.SpecMap_iff φ).1, of_isPullback, (LocallyOfFinitePresentation.SpecMap_iff φ).1] |
| 202 | -- `P` is flat over `R`: `j` is a base change of the flat `u`, and `A` is flat over `R` |
| 203 | have P_flat : Flat (Spec.map (ofHom (algebraMap R D) ≫ φ)) := by |
| 204 | have h_eq : j ≫ f.left ≫ B.hom = Spec.map φ ≫ u.left ≫ B.hom := h_pb.w_assoc B.hom |
| 205 | simpa [(of_isPullback h_pb.flip u_flat).comp j A.hom] using |
| 206 | congrArg (fun g ↦ AlgebraicGeometry.Flat g) h_eq |
| 207 | have : Module.Flat R P := SpecMap_iff.1 P_flat |
| 208 | rw [← max_eq] |
| 209 | exact Module.Flat.map_subtype_rTensor_injective (maximalIdeal R) |
| 210 | |
| 211 | /-- For a smooth scheme `B` over a local ring `R` with a section `s`, there exists an affine open |
| 212 | chart `i : specOver R L ⟶ B` such that `𝔪_R L ≠ ⊤` and the special fibre `L ⧸ 𝔪_R L` is reduced, |
| 213 | where `𝔪_R` is the maximal ideal of `R`. -/ |
| 214 | private lemma exists_isOpenImmersion_specOver_ne_top_isReduced {R : Type} [CommRing R] |
| 215 | [IsLocalRing R] {B : Over (Spec ⟨R⟩)} [Smooth B.hom] (s : 𝟙_ (Over (Spec ⟨R⟩)) ⟶ B) : |
| 216 | ∃ (L : Type) (_ : CommRing L) (_ : Algebra R L) (i : specOver R L ⟶ B), |
| 217 | IsOpenImmersion i.left ∧ |
| 218 | (maximalIdeal R).map (algebraMap R L) ≠ ⊤ ∧ |
| 219 | IsReduced (L ⧸ (maximalIdeal R).map (algebraMap R L)) := by |
| 220 | -- Take an affine open `i : Spec L ⟶ B` around the point `y` of the special fibre given by `s`, |
| 221 | -- and let `τ : R ⟶ L` be the ring map that induces `i ≫ B.hom`. |
| 222 | obtain ⟨L, i, i_open, y, hy⟩ := exists_Spec_apply_eq (s.left (closedPoint R)) |
| 223 | obtain ⟨τ, hτ⟩ := map_surjective (i ≫ B.hom) |
| 224 | algebraize [τ.hom] |
| 225 | -- The special fibre `L ⧸ 𝔪` of the chart is nonzero, and reduced since `B` is smooth. |
| 226 | let 𝔪 : Ideal L := (maximalIdeal R).map (algebraMap R L) |
| 227 | have y_over : Spec.map τ y = closedPoint R := by |
| 228 | -- `s` is a section of `B.hom` |
| 229 | rw [hτ, Scheme.Hom.comp_apply, hy] |
| 230 | exact congrArg (fun g ↦ g (closedPoint R)) s.w |
| 231 | have proper : 𝔪 ≠ ⊤ := |
| 232 | -- `𝔪` lies in the prime ideal of `y`, which lies over the maximal ideal of `R` |
| 233 | ne_top_of_le_ne_top y.isPrime.ne_top |
| 234 | (map_le_of_le_comap (congrArg PrimeSpectrum.asIdeal y_over).ge) |
| 235 | have reduced : IsReduced (L ⧸ 𝔪) := by |
| 236 | have geom : GeometricallyReduced (Spec.map τ) := by rw [hτ]; infer_instance |
| 237 | have fibre : IsReduced (L ⊗[R] (R ⧸ maximalIdeal R)) := |
| 238 | (affine_isReduced_iff _).1 <| geom.geometrically_isReduced (K := ResidueField R) _ _ _ |
| 239 | (isPullback_SpecMap_of_isPushout (h := isPushout_tensorProduct R L (R ⧸ maximalIdeal R))) |
| 240 | exact isReduced_of_injective _ (quotIdealMapEquivTensorQuot L (maximalIdeal R)).injective |
| 241 | exact ⟨L, inferInstance, inferInstance, homMk i hτ.symm, i_open, proper, reduced⟩ |
| 242 | |
| 243 | /-- For an abelian scheme `B` over a local ring `R`, there exists a local `R`-algebra `D` with a |
| 244 | flat morphism `u : specOver R D ⟶ B` such that the maximal ideal of `R` generates the maximal ideal |
| 245 | of `D` and the structure map `Spec D ⟶ Spec R` is surjective. -/ |
| 246 | private lemma exists_flat_specOver_map_maximalIdeal_eq {R : Type} [CommRing R] [IsLocalRing R] |
| 247 | (B : Over (Spec ⟨R⟩)) [IsAbelianScheme B] : |
| 248 | ∃ (D : Type) (_ : CommRing D) (_ : IsLocalRing D) (_ : Algebra R D) (u : specOver R D ⟶ B), |
| 249 | Flat u.left ∧ |
| 250 | (maximalIdeal R).map (algebraMap R D) = maximalIdeal D ∧ |
| 251 | Surjective (specOver R D).hom := by |
| 252 | -- Take an affine open chart around the origin section `ζ[B]` of the special fibre. |
| 253 | obtain ⟨L, _, _, i, i_open, proper, reduced⟩ := |
| 254 | exists_isOpenImmersion_specOver_ne_top_isReduced ζ[B] |
| 255 | -- `q` is a generic point of the special fibre; as that is reduced, the maximal ideal of `R` |
| 256 | -- generates that of `D`. |
| 257 | obtain ⟨q, hq⟩ : Nonempty ((maximalIdeal R).map (algebraMap R L)).minimalPrimes := |
| 258 | nonempty_minimalPrimes proper |
| 259 | have q_prime : q.IsPrime := Ideal.IsMinimalPrime.isPrime hq |
| 260 | let D := Localization.AtPrime q |
| 261 | have max_eq : (maximalIdeal R).map (algebraMap R D) = maximalIdeal D := |
| 262 | Ideal.map_maximalIdeal_eq_maximalIdeal_of_mem_minimalPrimes hq reduced |
| 263 | -- The algebra map `R → D` is `algebraMap R L` followed by `algebraMap L D`. |
| 264 | let u : specOver R D ⟶ B := specOver.map ⟨algebraMap L D, fun _ ↦ rfl⟩ ≫ i |
| 265 | have h_D_flat : Flat (Spec.map (ofHom (algebraMap L D))) := |
| 266 | SpecMap_iff.2 (flat_algebraMap_iff.2 inferInstance) |
| 267 | have u_flat : Flat u.left := |
| 268 | inferInstanceAs (Flat (Spec.map (ofHom (algebraMap L D)) ≫ i.left)) |
| 269 | -- The image of `Spec D` in `Spec R` is stable under generalisation and has the closed point. |
| 270 | have D_surj : Surjective (specOver R D).hom := by |
| 271 | have lifts : GeneralizingMap (specOver R D).hom := by |
| 272 | rw [← u.w] |
| 273 | exact generalizingMap (u.left ≫ B.hom) |
| 274 | exact ⟨fun x ↦ lifts.stableUnderGeneralization_range (specializes_closedPoint x) |
| 275 | ⟨closedPoint D, top_unique (α := PrimeSpectrum R) (le_comap_of_map_le max_eq.le)⟩⟩ |
| 276 | exact ⟨D, inferInstance, inferInstance, inferInstance, u, u_flat, max_eq, D_surj⟩ |
| 277 | |
| 278 | /-- A locally quasi-finite surjective homomorphism of abelian schemes over a local ring is finite |
| 279 | and flat, that is, an isogeny. -/ |
| 280 | lemma isIsogeny_of_locallyQuasiFinite {R : Type} [CommRing R] [IsLocalRing R] |
| 281 | {A B : Over (Spec ⟨R⟩)} [IsAbelianScheme A] [IsAbelianScheme B] (f : A ⟶ B) [IsAdditive f] |
| 282 | (hf_quasi : LocallyQuasiFinite f.left) (hf_surj : Surjective f.left) : |
| 283 | IsIsogeny f := by |
| 284 | -- Localise `B` at a generic point of its special fibre: `u : Spec D ⟶ B` is flat, and the maximal |
| 285 | -- ideal of `R` generates that of `D`. The pull-back of `f` along `u` is flat by the local |
| 286 | -- criterion. The translates of `u` by the image of `f` form an fpqc cover of `B`, over which `f` |
| 287 | -- becomes a base change of that pull-back; so `f` is flat by descent. |
| 288 | have f_fin : IsFinite f.left := .of_isProper_of_locallyQuasiFinite f.left |
| 289 | obtain ⟨D, _, _, _, u, u_flat, max_eq, D_surj⟩ := exists_flat_specOver_map_maximalIdeal_eq B |
| 290 | -- `Spec.map φ : Spec P ⟶ Spec D` is the pull-back of `f` along `u`. |
| 291 | obtain ⟨P, φ, j, h_pb⟩ := exists_isPullback_SpecMap f.left u.left |
| 292 | have φ_flat : φ.hom.Flat := |
| 293 | flat_of_isPullback_of_map_maximalIdeal_eq f f_fin u u_flat max_eq h_pb |
| 294 | -- Descend along the cover of `B` by the translates of `u`. |
| 295 | have f_flat : Flat f.left := |
| 296 | flat_left_of_isPullback_flat f hf_surj u u_flat D_surj h_pb (Spec_iff.2 φ_flat) |
| 297 | -- `IsIsogeny f` collects the instances: `f` additive, finite (`f_fin`), flat and surjective |
| 298 | exact .mk |
| 299 | |
| 300 | end New.Variety |