Skip to content

Commit f20f26d

Browse files
committed
refactor(RingTheory/Algebraic): Golf IsIntegralClosure.exists_smul_eq_mul (#18594)
This PR golfs `IsIntegralClosure.exists_smul_eq_mul` by proving a generalization to algebraic extensions.
1 parent a78ac3b commit f20f26d

File tree

4 files changed

+58
-41
lines changed

4 files changed

+58
-41
lines changed

Mathlib/NumberTheory/ClassNumber/Finite.lean

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable [Algebra R K] [IsFractionRing R K]
3535
variable [Algebra K L] [FiniteDimensional K L] [Algebra.IsSeparable K L]
3636
variable [algRL : Algebra R L] [IsScalarTower R K L]
3737
variable [Algebra R S] [Algebra S L]
38-
variable [ist : IsScalarTower R S L] [iic : IsIntegralClosure S R L]
38+
variable [ist : IsScalarTower R S L]
3939
variable (abv : AbsoluteValue R ℤ)
4040
variable {ι : Type*} [DecidableEq ι] [Fintype ι] (bS : Basis ι R S)
4141

@@ -235,13 +235,10 @@ theorem exists_mem_finsetApprox (a : S) {b} (hb : b ≠ (0 : R)) :
235235
· exact mod_cast ε_le
236236

237237
/-- We can approximate `a / b : L` with `q / r`, where `r` has finitely many options for `L`. -/
238-
theorem exists_mem_finset_approx' [Algebra.IsAlgebraic R L] (a : S) {b : S} (hb : b ≠ 0) :
238+
theorem exists_mem_finset_approx' [Algebra.IsAlgebraic R S] (a : S) {b : S} (hb : b ≠ 0) :
239239
∃ q : S,
240240
∃ r ∈ finsetApprox bS adm, abv (Algebra.norm R (r • a - q * b)) < abv (Algebra.norm R b) := by
241-
have inj : Function.Injective (algebraMap R L) := by
242-
rw [IsScalarTower.algebraMap_eq R S L]
243-
exact (IsIntegralClosure.algebraMap_injective S R L).comp bS.algebraMap_injective
244-
obtain ⟨a', b', hb', h⟩ := IsIntegralClosure.exists_smul_eq_mul inj a hb
241+
obtain ⟨a', b', hb', h⟩ := Algebra.IsAlgebraic.exists_smul_eq_mul R a hb
245242
obtain ⟨q, r, hr, hqr⟩ := exists_mem_finsetApprox bS adm a' hb'
246243
refine ⟨q, r, hr, ?_⟩
247244
refine
@@ -268,7 +265,7 @@ theorem ne_bot_of_prod_finsetApprox_mem (J : Ideal S)
268265

269266
/-- Each class in the class group contains an ideal `J`
270267
such that `M := Π m ∈ finsetApprox` is in `J`. -/
271-
theorem exists_mk0_eq_mk0 [IsDedekindDomain S] [Algebra.IsAlgebraic R L] (I : (Ideal S)⁰) :
268+
theorem exists_mk0_eq_mk0 [IsDedekindDomain S] [Algebra.IsAlgebraic R S] (I : (Ideal S)⁰) :
272269
∃ J : (Ideal S)⁰,
273270
ClassGroup.mk0 I = ClassGroup.mk0 J ∧
274271
algebraMap _ _ (∏ m ∈ finsetApprox bS adm, m) ∈ (J : Ideal S) := by
@@ -294,7 +291,7 @@ theorem exists_mk0_eq_mk0 [IsDedekindDomain S] [Algebra.IsAlgebraic R L] (I : (I
294291
rw [Ideal.dvd_iff_le, Ideal.mul_le]
295292
intro r' hr' a ha
296293
rw [Ideal.mem_span_singleton] at hr' ⊢
297-
obtain ⟨q, r, r_mem, lt⟩ := exists_mem_finset_approx' L bS adm a b_ne_zero
294+
obtain ⟨q, r, r_mem, lt⟩ := exists_mem_finset_approx' bS adm a b_ne_zero
298295
apply @dvd_of_mul_left_dvd _ _ q
299296
simp only [Algebra.smul_def] at lt
300297
rw [←
@@ -310,11 +307,11 @@ noncomputable def mkMMem [IsDedekindDomain S]
310307
ClassGroup.mk0
311308
⟨J.1, mem_nonZeroDivisors_iff_ne_zero.mpr (ne_bot_of_prod_finsetApprox_mem bS adm J.1 J.2)⟩
312309

313-
theorem mkMMem_surjective [IsDedekindDomain S] [Algebra.IsAlgebraic R L] :
310+
theorem mkMMem_surjective [IsDedekindDomain S] [Algebra.IsAlgebraic R S] :
314311
Function.Surjective (ClassGroup.mkMMem bS adm) := by
315312
intro I'
316313
obtain ⟨⟨I, hI⟩, rfl⟩ := ClassGroup.mk0_surjective I'
317-
obtain ⟨J, mk0_eq_mk0, J_dvd⟩ := exists_mk0_eq_mk0 L bS adm ⟨I, hI⟩
314+
obtain ⟨J, mk0_eq_mk0, J_dvd⟩ := exists_mk0_eq_mk0 bS adm ⟨I, hI⟩
318315
exact ⟨⟨J, J_dvd⟩, mk0_eq_mk0.symm⟩
319316

320317
open Classical in
@@ -325,7 +322,7 @@ See also `ClassGroup.fintypeOfAdmissibleOfFinite` where `L` is a finite
325322
extension of `K = Frac(R)`, supplying most of the required assumptions automatically.
326323
-/
327324
noncomputable def fintypeOfAdmissibleOfAlgebraic [IsDedekindDomain S]
328-
[Algebra.IsAlgebraic R L] : Fintype (ClassGroup S) :=
325+
[Algebra.IsAlgebraic R S] : Fintype (ClassGroup S) :=
329326
@Fintype.ofSurjective _ _ _
330327
(@Fintype.ofEquiv _
331328
{ J // J ∣ Ideal.span ({algebraMap R S (∏ m ∈ finsetApprox bS adm, m)} : Set S) }
@@ -336,7 +333,7 @@ noncomputable def fintypeOfAdmissibleOfAlgebraic [IsDedekindDomain S]
336333
((Equiv.refl _).subtypeEquiv fun I =>
337334
Ideal.dvd_iff_le.trans (by
338335
rw [Equiv.refl_apply, Ideal.span_le, Set.singleton_subset_iff]; rfl)))
339-
(ClassGroup.mkMMem bS adm) (ClassGroup.mkMMem_surjective L bS adm)
336+
(ClassGroup.mkMMem bS adm) (ClassGroup.mkMMem_surjective bS adm)
340337

341338
/-- The main theorem: the class group of an integral closure `S` of `R` in a
342339
finite extension `L` of `K = Frac(R)` is finite if there is an admissible
@@ -345,7 +342,8 @@ absolute value.
345342
See also `ClassGroup.fintypeOfAdmissibleOfAlgebraic` where `L` is an
346343
algebraic extension of `R`, that includes some extra assumptions.
347344
-/
348-
noncomputable def fintypeOfAdmissibleOfFinite : Fintype (ClassGroup S) := by
345+
noncomputable def fintypeOfAdmissibleOfFinite [IsIntegralClosure S R L] :
346+
Fintype (ClassGroup S) := by
349347
letI := Classical.decEq L
350348
letI := IsIntegralClosure.isFractionRing_of_finite_extension R K L S
351349
letI := IsIntegralClosure.isDedekindDomain R K L S
@@ -363,9 +361,8 @@ noncomputable def fintypeOfAdmissibleOfFinite : Fintype (ClassGroup S) := by
363361
· exact Submodule.quotEquivOfEqBot _ rfl
364362
· exact IsIntegralClosure.algebraMap_injective _ R _
365363
let bS := b.map ((LinearMap.quotKerEquivRange _).symm ≪≫ₗ f)
366-
have : Algebra.IsAlgebraic R L := ⟨fun x =>
367-
(IsFractionRing.isAlgebraic_iff R K L).mpr (Algebra.IsAlgebraic.isAlgebraic x)⟩
368-
exact fintypeOfAdmissibleOfAlgebraic L bS adm
364+
have : Algebra.IsIntegral R S := IsIntegralClosure.isIntegral_algebra R L
365+
exact fintypeOfAdmissibleOfAlgebraic bS adm
369366

370367
end IsAdmissible
371368

Mathlib/NumberTheory/RamificationInertia.lean

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Here,
263263
More precisely, we avoid quotients in this statement and instead require that `b ∪ pS` spans `S`.
264264
-/
265265
theorem FinrankQuotientMap.span_eq_top [IsDomain R] [IsDomain S] [Algebra K L] [Module.Finite R S]
266-
[Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsIntegralClosure S R L]
266+
[Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [Algebra.IsAlgebraic R S]
267267
[NoZeroSMulDivisors R K] (hp : p ≠ ⊤) (b : Set S)
268268
(hb' : Submodule.span R b ⊔ (p.map (algebraMap R S)).restrictScalars R = ⊤) :
269269
Submodule.span K (algebraMap S L '' b) = ⊤ := by
@@ -349,10 +349,6 @@ theorem FinrankQuotientMap.span_eq_top [IsDomain R] [IsDomain S] [Algebra K L] [
349349
-- And we conclude `L = span L {det A} ≤ span K b`, so `span K b` spans everything.
350350
· intro x hx
351351
rw [Submodule.restrictScalars_mem, IsScalarTower.algebraMap_apply R S L] at hx
352-
have : Algebra.IsAlgebraic R L := by
353-
have : NoZeroSMulDivisors R L := NoZeroSMulDivisors.of_algebraMap_injective hRL
354-
rw [← IsFractionRing.isAlgebraic_iff' R S]
355-
infer_instance
356352
exact IsFractionRing.ideal_span_singleton_map_subset R hRL span_d hx
357353

358354
variable (K)
@@ -403,7 +399,7 @@ variable (L)
403399
/-- If `p` is a maximal ideal of `R`, and `S` is the integral closure of `R` in `L`,
404400
then the dimension `[S/pS : R/p]` is equal to `[Frac(S) : Frac(R)]`. -/
405401
theorem finrank_quotient_map [IsDomain S] [IsDedekindDomain R] [Algebra K L]
406-
[Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L] [IsIntegralClosure S R L]
402+
[Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L]
407403
[hp : p.IsMaximal] [Module.Finite R S] :
408404
finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) = finrank K L := by
409405
-- Choose an arbitrary basis `b` for `[S/pS : R/p]`.

Mathlib/RingTheory/Algebraic.lean

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,46 @@ end Field
562562

563563
end
564564

565+
section
566+
567+
variable {R S : Type*} [CommRing R] [Ring S] [Algebra R S]
568+
569+
theorem IsAlgebraic.exists_nonzero_coeff_and_aeval_eq_zero
570+
{s : S} (hRs : IsAlgebraic R s) (hs : s ∈ nonZeroDivisors S) :
571+
∃ (q : Polynomial R), q.coeff 00 ∧ aeval s q = 0 := by
572+
obtain ⟨p, hp0, hp⟩ := hRs
573+
obtain ⟨q, hpq, hq⟩ := Polynomial.exists_eq_pow_rootMultiplicity_mul_and_not_dvd p hp0 0
574+
simp only [C_0, sub_zero, X_pow_mul, X_dvd_iff] at hpq hq
575+
rw [hpq, map_mul, aeval_X_pow] at hp
576+
exact ⟨q, hq, (nonZeroDivisors S).pow_mem hs (rootMultiplicity 0 p) (aeval s q) hp⟩
577+
578+
theorem IsAlgebraic.exists_nonzero_dvd
579+
{s : S} (hRs : IsAlgebraic R s) (hs : s ∈ nonZeroDivisors S) :
580+
∃ r : R, r ≠ 0 ∧ s ∣ (algebraMap R S) r := by
581+
obtain ⟨q, hq0, hq⟩ := hRs.exists_nonzero_coeff_and_aeval_eq_zero hs
582+
have key := map_dvd (Polynomial.aeval s) (Polynomial.X_dvd_sub_C (p := q))
583+
rw [map_sub, hq, zero_sub, dvd_neg, Polynomial.aeval_X, Polynomial.aeval_C] at key
584+
exact ⟨q.coeff 0, hq0, key⟩
585+
586+
/-- A fraction `(a : S) / (b : S)` can be reduced to `(c : S) / (d : R)`,
587+
if `b` is algebraic over `R`. -/
588+
theorem IsAlgebraic.exists_smul_eq_mul
589+
(a : S) {b : S} (hRb : IsAlgebraic R b) (hb : b ∈ nonZeroDivisors S) :
590+
∃ᵉ (c : S) (d ≠ (0 : R)), d • a = b * c := by
591+
obtain ⟨r, hr, s, h⟩ := IsAlgebraic.exists_nonzero_dvd (R := R) (S := S) hRb hb
592+
exact ⟨s * a, r, hr, by rw [Algebra.smul_def, h, mul_assoc]⟩
593+
594+
variable (R)
595+
596+
/-- A fraction `(a : S) / (b : S)` can be reduced to `(c : S) / (d : R)`,
597+
if `b` is algebraic over `R`. -/
598+
theorem Algebra.IsAlgebraic.exists_smul_eq_mul [IsDomain S] [Algebra.IsAlgebraic R S]
599+
(a : S) {b : S} (hb : b ≠ 0) :
600+
∃ᵉ (c : S) (d ≠ (0 : R)), d • a = b * c :=
601+
(Algebra.IsAlgebraic.isAlgebraic b).exists_smul_eq_mul a (mem_nonZeroDivisors_iff_ne_zero.mpr hb)
602+
603+
end
604+
565605
variable {R S : Type*} [CommRing R] [IsDomain R] [CommRing S]
566606

567607
theorem exists_integral_multiple [Algebra R S] {z : S} (hz : IsAlgebraic R z)
@@ -575,22 +615,6 @@ theorem exists_integral_multiple [Algebra R S] {z : S} (hz : IsAlgebraic R z)
575615
integralNormalization_aeval_eq_zero px inj⟩
576616
exact ⟨⟨_, x_integral⟩, a, a_ne_zero, rfl⟩
577617

578-
/-- A fraction `(a : S) / (b : S)` can be reduced to `(c : S) / (d : R)`,
579-
if `S` is the integral closure of `R` in an algebraic extension `L` of `R`. -/
580-
theorem IsIntegralClosure.exists_smul_eq_mul {L : Type*} [Field L] [Algebra R S] [Algebra S L]
581-
[Algebra R L] [IsScalarTower R S L] [IsIntegralClosure S R L] [Algebra.IsAlgebraic R L]
582-
(inj : Function.Injective (algebraMap R L)) (a : S) {b : S} (hb : b ≠ 0) :
583-
∃ᵉ (c : S) (d ≠ (0 : R)), d • a = b * c := by
584-
obtain ⟨c, d, d_ne, hx⟩ :=
585-
exists_integral_multiple (Algebra.IsAlgebraic.isAlgebraic (algebraMap _ L a / algebraMap _ L b))
586-
((injective_iff_map_eq_zero _).mp inj)
587-
refine
588-
⟨IsIntegralClosure.mk' S (c : L) c.2, d, d_ne, IsIntegralClosure.algebraMap_injective S R L ?_⟩
589-
simp only [Algebra.smul_def, RingHom.map_mul, IsIntegralClosure.algebraMap_mk', ← hx, ←
590-
IsScalarTower.algebraMap_apply]
591-
rw [← mul_assoc _ (_ / _), mul_div_cancel₀ (algebraMap S L a), mul_comm]
592-
exact mt ((injective_iff_map_eq_zero _).mp (IsIntegralClosure.algebraMap_injective S R L) _) hb
593-
594618
section Field
595619

596620
variable {K L : Type*} [Field K] [Field L] [Algebra K L] (A : Subalgebra K L)

Mathlib/RingTheory/Localization/Integral.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,16 +401,16 @@ variable {S K}
401401
/-- If the `S`-multiples of `a` are contained in some `R`-span, then `Frac(S)`-multiples of `a`
402402
are contained in the equivalent `Frac(R)`-span. -/
403403
theorem ideal_span_singleton_map_subset {L : Type*} [IsDomain R] [IsDomain S] [Field K] [Field L]
404-
[Algebra R K] [Algebra R L] [Algebra S L] [IsIntegralClosure S R L] [IsFractionRing S L]
404+
[Algebra R K] [Algebra R L] [Algebra S L] [Algebra.IsAlgebraic R S] [IsFractionRing S L]
405405
[Algebra K L] [IsScalarTower R S L] [IsScalarTower R K L] {a : S} {b : Set S}
406-
[Algebra.IsAlgebraic R L] (inj : Function.Injective (algebraMap R L))
406+
(inj : Function.Injective (algebraMap R L))
407407
(h : (Ideal.span ({a} : Set S) : Set S) ⊆ Submodule.span R b) :
408408
(Ideal.span ({algebraMap S L a} : Set L) : Set L) ⊆ Submodule.span K (algebraMap S L '' b) := by
409409
intro x hx
410410
obtain ⟨x', rfl⟩ := Ideal.mem_span_singleton.mp hx
411411
obtain ⟨y', z', rfl⟩ := IsLocalization.mk'_surjective S⁰ x'
412412
obtain ⟨y, z, hz0, yz_eq⟩ :=
413-
IsIntegralClosure.exists_smul_eq_mul inj y' (nonZeroDivisors.coe_ne_zero z')
413+
Algebra.IsAlgebraic.exists_smul_eq_mul R y' (nonZeroDivisors.coe_ne_zero z')
414414
have injRS : Function.Injective (algebraMap R S) := by
415415
refine
416416
Function.Injective.of_comp (show Function.Injective (algebraMap S L ∘ algebraMap R S) from ?_)

0 commit comments

Comments
 (0)