Skip to content

Commit 50efe24

Browse files
committed
feat(RingTheory): Localization.exists_finite_awayMapₐ_of_surjective_awayMapₐ (leanprover-community#34274)
1 parent 2255913 commit 50efe24

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

Mathlib/RingTheory/Etale/QuasiFinite.lean

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.RingTheory.Polynomial.UniversalFactorizationRing
99
public import Mathlib.RingTheory.LocalRing.ResidueField.Fiber
1010
public import Mathlib.RingTheory.Spectrum.Prime.Noetherian
1111
public import Mathlib.RingTheory.QuasiFinite.Basic
12+
public import Mathlib.RingTheory.Localization.InvSubmonoid
1213

1314
/-!
1415
# Etale local structure of finite maps
@@ -78,7 +79,8 @@ section
7879

7980
universe u v
8081

81-
variable {R : Type u} {S : Type v} [CommRing R] [CommRing S] [Algebra R S]
82+
variable {R : Type u} {S : Type v} {T : Type*}
83+
[CommRing R] [CommRing S] [CommRing T] [Algebra R S] [Algebra R T]
8284

8385
open Polynomial in
8486
/--
@@ -155,4 +157,59 @@ lemma Algebra.exists_etale_isIdempotentElem_forall_liesOver_eq [Module.Finite R
155157
← Polynomial.map_map, ← ha']
156158
simp
157159

160+
/-- Suppose `f : S →ₐ[R] T` is an `R`-algebra homomorphism with `S` integral and `T` of finite type,
161+
such that the induced map `S[1/g] → T[1/g]` is surjective for some `g : S`.
162+
Then for any prime `p` of `R` such that `1 ⊗ₜ g` is invertible in `κ(p) ⊗ S`,
163+
there exists `r ∉ p` such that `T[1/r]` is finite over `R[1/r]`. -/
164+
@[stacks 00UI]
165+
lemma Localization.exists_finite_awayMapₐ_of_surjective_awayMapₐ
166+
[Algebra.FiniteType R T] [Algebra.IsIntegral R S] (f : S →ₐ[R] T) (g : S)
167+
(hg : Function.Surjective (Localization.awayMapₐ f g)) (p : Ideal R) [p.IsPrime]
168+
(hgp : IsUnit (M := p.Fiber S) (1 ⊗ₜ g)) :
169+
∃ r ∉ p, (Localization.awayMapₐ (Algebra.ofId R T) r).Finite := by
170+
have := PrimeSpectrum.isClosedMap_comap_of_isIntegral (algebraMap R S)
171+
(algebraMap_isIntegral_iff.mpr ‹_›) _ (PrimeSpectrum.isClosed_zeroLocus {g})
172+
obtain ⟨_, ⟨_, ⟨r, rfl⟩, rfl⟩, hpr, hrg⟩ := PrimeSpectrum.isBasis_basic_opens
173+
|>.exists_subset_of_mem_open (a := ⟨p, ‹_›⟩) (ou := this.isOpen_compl) <| by
174+
rintro ⟨q, hq, e⟩
175+
have : q.asIdeal.LiesOver p := ⟨congr(($e).1).symm⟩
176+
have : 1 ⊗ₜ g ∉ (PrimeSpectrum.preimageEquivFiber R S ⟨p, ‹_›⟩ ⟨q, e⟩).asIdeal :=
177+
fun h ↦ Ideal.IsPrime.ne_top' (Ideal.eq_top_of_isUnit_mem _ h hgp)
178+
rw [PrimeSpectrum.preimageEquivFiber_apply_asIdeal] at this
179+
simp_all
180+
refine ⟨r, hpr, RingHom.finite_iff_isIntegral_and_finiteType.mpr ⟨?_, ?_⟩⟩
181+
· have : IsLocalization.Away (f.toRingHom (algebraMap R S r))
182+
(Localization.Away (algebraMap R T r)) := by
183+
simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, AlgHom.commutes]; infer_instance
184+
have h₁ : (Localization.awayMap (algebraMap R S) r).IsIntegral := isIntegral_localization
185+
have h₂ : Function.Surjective (IsLocalization.Away.map (Localization.Away (algebraMap R S r))
186+
(Localization.Away (algebraMap R T r)) f.toRingHom (algebraMap R S r)) := by
187+
intro x
188+
obtain ⟨x, ⟨_, n, rfl⟩, rfl⟩ := IsLocalization.exists_mk'_eq (.powers (algebraMap R T r)) x
189+
suffices ∃ a k l, algebraMap R T r ^ (l + n) * f a =
190+
algebraMap R T r ^ (l + k) * x by
191+
simpa [(IsLocalization.mk'_surjective (.powers (algebraMap R S r))).exists,
192+
IsLocalization.Away.map, IsLocalization.map_mk', IsLocalization.mk'_eq_iff_eq,
193+
← map_pow, Submonoid.mem_powers_iff, IsLocalization.Away.map, IsLocalization.map_mk',
194+
IsLocalization.mk'_eq_iff_eq, ← map_mul, ← mul_assoc, ← pow_add,
195+
IsLocalization.eq_iff_exists (.powers (algebraMap R T r))]
196+
have : PrimeSpectrum.basicOpen (algebraMap R S r) ≤ PrimeSpectrum.basicOpen g := by
197+
simpa [← SetLike.coe_subset_coe] using hrg
198+
simp only [PrimeSpectrum.basicOpen_le_basicOpen_iff, Ideal.mem_radical_iff,
199+
Ideal.mem_span_singleton] at this
200+
obtain ⟨m', s, hs⟩ := this
201+
obtain ⟨b, m, e : f b = f g ^ m * x⟩ := Localization.awayMap_surjective_iff.mp hg x
202+
have : f (s ^ m * b) = f (g * s) ^ m * x := by simp [e, mul_pow, mul_assoc, mul_left_comm]
203+
simp_rw [← hs, map_pow, AlgHom.commutes, ← pow_mul] at this
204+
refine ⟨s ^ m * b, (n + m' * m), 0, this ▸ ?_⟩
205+
simp [pow_add, mul_assoc]
206+
convert h₁.trans _ _ (RingHom.IsIntegral.of_finite (.of_surjective _ h₂)) using 1
207+
refine IsLocalization.ringHom_ext (.powers r) (RingHom.ext fun x ↦ ?_)
208+
simp [Localization.awayMap, IsLocalization.Away.map, ← IsScalarTower.algebraMap_apply R T]
209+
· algebraize [(Localization.awayMapₐ (Algebra.ofId R T) r).toRingHom]
210+
have := IsScalarTower.of_algebraMap_eq'
211+
(Localization.awayMapₐ (Algebra.ofId R T) r).comp_algebraMap.symm
212+
refine RingHom.finiteType_algebraMap.mpr ?_
213+
exact .of_restrictScalars_finiteType R _ _
214+
158215
end

Mathlib/RingTheory/Localization/InvSubmonoid.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ theorem finiteType_of_monoid_fg [Monoid.FG M] : Algebra.FiniteType R S := by
114114
rw [Algebra.adjoin_eq_span, hs, span_invSubmonoid]
115115
trivial
116116

117+
instance {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] [Algebra.FiniteType R S]
118+
(M : Submonoid S) [Monoid.FG M] : Algebra.FiniteType R (Localization M) :=
119+
.trans ‹_› (IsLocalization.finiteType_of_monoid_fg M _)
120+
117121
end InvSubmonoid
118122

119123
end IsLocalization

0 commit comments

Comments
 (0)