Skip to content

Commit a5a0711

Browse files
committed
feat(RingTheory/Ideal/Norm): Generalize Ideal.finite_setOf_absNorm_eq and add Ideal.finite_setOf_absNorm_le (#18132)
Also: - prove some results about the norm of `nonZeroDivisors` ideals - golf the proof of Dirichlet unit theorem using the generalization - clean up the import of `RingTheory.Ideal.Norm` This PR is part of the proof of the Analytic Class Number Formula.
1 parent a86c9d3 commit a5a0711

File tree

2 files changed

+67
-38
lines changed

2 files changed

+67
-38
lines changed

Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ def seq : ℕ → { x : 𝓞 K // x ≠ 0 }
250250
theorem seq_ne_zero (n : ℕ) : algebraMap (𝓞 K) K (seq K w₁ hB n) ≠ 0 :=
251251
RingOfIntegers.coe_ne_zero_iff.mpr (seq K w₁ hB n).prop
252252

253-
/-- The terms of the sequence have nonzero norm. -/
254-
theorem seq_norm_ne_zero (n : ℕ) : Algebra.norm ℤ (seq K w₁ hB n : 𝓞 K) ≠ 0 :=
255-
Algebra.norm_ne_zero_iff.mpr (Subtype.coe_ne_coe.1 (seq_ne_zero K w₁ hB n))
256-
257253
/-- The sequence is strictly decreasing at infinite places distinct from `w₁`. -/
258254
theorem seq_decreasing {n m : ℕ} (h : n < m) (w : InfinitePlace K) (hw : w ≠ w₁) :
259255
w (algebraMap (𝓞 K) K (seq K w₁ hB m)) < w (algebraMap (𝓞 K) K (seq K w₁ hB n)) := by
@@ -301,20 +297,15 @@ theorem exists_unit (w₁ : InfinitePlace K) :
301297
_ = w (algebraMap (𝓞 K) K (seq K w₁ hB m) * (algebraMap (𝓞 K) K (seq K w₁ hB n))⁻¹) := by
302298
rw [← congr_arg (algebraMap (𝓞 K) K) hu.choose_spec, mul_comm, map_mul (algebraMap _ _),
303299
← mul_assoc, inv_mul_cancel₀ (seq_ne_zero K w₁ hB n), one_mul]
304-
_ = w (algebraMap (𝓞 K) K (seq K w₁ hB m)) * w (algebraMap (𝓞 K) K (seq K w₁ hB n))⁻¹ :=
305-
_root_.map_mul _ _ _
306-
_ < 1 := by
307-
rw [map_inv₀, mul_inv_lt_iff₀ (pos_iff.mpr (seq_ne_zero K w₁ hB n)), one_mul]
308-
exact seq_decreasing K w₁ hB hnm w hw
309-
refine Set.Finite.exists_lt_map_eq_of_forall_mem
310-
(t := { I : Ideal (𝓞 K) | 1 ≤ Ideal.absNorm I ∧ Ideal.absNorm I ≤ B })
311-
(fun n => ?_) ?_
312-
· rw [Set.mem_setOf_eq, Ideal.absNorm_span_singleton]
313-
refine ⟨?_, seq_norm_le K w₁ hB n⟩
314-
exact Nat.one_le_iff_ne_zero.mpr (Int.natAbs_ne_zero.mpr (seq_norm_ne_zero K w₁ hB n))
315-
· rw [show { I : Ideal (𝓞 K) | 1 ≤ Ideal.absNorm I ∧ Ideal.absNorm I ≤ B } =
316-
(⋃ n ∈ Set.Icc 1 B, { I : Ideal (𝓞 K) | Ideal.absNorm I = n }) by ext; simp]
317-
exact Set.Finite.biUnion (Set.finite_Icc _ _) (fun n hn => Ideal.finite_setOf_absNorm_eq hn.1)
300+
_ = w (algebraMap (𝓞 K) K (seq K w₁ hB m)) * w (algebraMap (𝓞 K) K (seq K w₁ hB n))⁻¹ :=
301+
_root_.map_mul _ _ _
302+
_ < 1 := by
303+
rw [map_inv₀, mul_inv_lt_iff₀' (pos_iff.mpr (seq_ne_zero K w₁ hB n)), mul_one]
304+
exact seq_decreasing K w₁ hB hnm w hw
305+
refine Set.Finite.exists_lt_map_eq_of_forall_mem (t := {I : Ideal (𝓞 K) | Ideal.absNorm I ≤ B})
306+
(fun n ↦ ?_) (Ideal.finite_setOf_absNorm_le B)
307+
rw [Set.mem_setOf_eq, Ideal.absNorm_span_singleton]
308+
exact seq_norm_le K w₁ hB n
318309

319310
theorem unitLattice_span_eq_top :
320311
Submodule.span ℝ (unitLattice K : Set ({w : InfinitePlace K // w ≠ w₀} → ℝ)) = ⊤ := by

Mathlib/RingTheory/Ideal/Norm.lean

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Anne Baanen, Alex J. Best
55
-/
66
import Mathlib.Algebra.CharP.Quotient
7-
import Mathlib.Algebra.GroupWithZero.NonZeroDivisors
8-
import Mathlib.Data.Finsupp.Fintype
97
import Mathlib.Data.Int.AbsoluteValue
108
import Mathlib.Data.Int.Associated
119
import Mathlib.LinearAlgebra.FreeModule.Determinant
1210
import Mathlib.LinearAlgebra.FreeModule.IdealQuotient
1311
import Mathlib.RingTheory.DedekindDomain.PID
14-
import Mathlib.RingTheory.Ideal.Basis
15-
import Mathlib.RingTheory.LocalProperties.Basic
1612
import Mathlib.RingTheory.Localization.NormTrace
1713

1814
/-!
@@ -391,24 +387,66 @@ theorem absNorm_eq_zero_iff {I : Ideal S} : Ideal.absNorm I = 0 ↔ I = ⊥ := b
391387
· rintro rfl
392388
exact absNorm_bot
393389

394-
theorem absNorm_ne_zero_of_nonZeroDivisors (I : (Ideal S)⁰) : Ideal.absNorm (I : Ideal S) ≠ 0 :=
395-
Ideal.absNorm_eq_zero_iff.not.mpr <| nonZeroDivisors.coe_ne_zero _
390+
theorem absNorm_ne_zero_iff_mem_nonZeroDivisors {I : Ideal S} :
391+
absNorm I ≠ 0 ↔ I ∈ (Ideal S)⁰ := by
392+
simp_rw [ne_eq, Ideal.absNorm_eq_zero_iff, mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot]
396393

397-
theorem finite_setOf_absNorm_eq [CharZero S] {n : ℕ} (hn : 0 < n) :
394+
theorem absNorm_pos_iff_mem_nonZeroDivisors {I : Ideal S} :
395+
0 < absNorm I ↔ I ∈ (Ideal S)⁰ := by
396+
rw [← absNorm_ne_zero_iff_mem_nonZeroDivisors, Nat.pos_iff_ne_zero]
397+
398+
theorem absNorm_ne_zero_of_nonZeroDivisors (I : (Ideal S)⁰) : absNorm (I : Ideal S) ≠ 0 :=
399+
absNorm_ne_zero_iff_mem_nonZeroDivisors.mpr (SetLike.coe_mem I)
400+
401+
theorem absNorm_pos_of_nonZeroDivisors (I : (Ideal S)⁰) : 0 < absNorm (I : Ideal S) :=
402+
absNorm_pos_iff_mem_nonZeroDivisors.mpr (SetLike.coe_mem I)
403+
404+
theorem finite_setOf_absNorm_eq [CharZero S] (n : ℕ) :
398405
{I : Ideal S | Ideal.absNorm I = n}.Finite := by
399-
let f := fun I : Ideal S => Ideal.map (Ideal.Quotient.mk (@Ideal.span S _ {↑n})) I
400-
refine @Set.Finite.of_finite_image _ _ _ f ?_ ?_
401-
· suffices Finite (S ⧸ @Ideal.span S _ {↑n}) by
402-
let g := ((↑) : Ideal (S ⧸ @Ideal.span S _ {↑n}) → Set (S ⧸ @Ideal.span S _ {↑n}))
403-
refine @Set.Finite.of_finite_image _ _ _ g ?_ SetLike.coe_injective.injOn
404-
exact Set.Finite.subset (@Set.finite_univ _ (@Set.finite' _ this)) (Set.subset_univ _)
405-
rw [← absNorm_ne_zero_iff, absNorm_span_singleton]
406-
simpa only [Ne, Int.natAbs_eq_zero, Algebra.norm_eq_zero_iff, Nat.cast_eq_zero] using
407-
ne_of_gt hn
408-
· intro I hI J hJ h
409-
rw [← comap_map_mk (span_singleton_absNorm_le I), ← hI.symm, ←
410-
comap_map_mk (span_singleton_absNorm_le J), ← hJ.symm]
411-
congr
406+
obtain hn | hn := Nat.eq_zero_or_pos n
407+
· simp only [hn, absNorm_eq_zero_iff, Set.setOf_eq_eq_singleton, Set.finite_singleton]
408+
· let f := fun I : Ideal S => Ideal.map (Ideal.Quotient.mk (@Ideal.span S _ {↑n})) I
409+
refine Set.Finite.of_finite_image (f := f) ?_ ?_
410+
· suffices Finite (S ⧸ @Ideal.span S _ {↑n}) by
411+
let g := ((↑) : Ideal (S ⧸ @Ideal.span S _ {↑n}) → Set (S ⧸ @Ideal.span S _ {↑n}))
412+
refine Set.Finite.of_finite_image (f := g) ?_ SetLike.coe_injective.injOn
413+
exact Set.Finite.subset Set.finite_univ (Set.subset_univ _)
414+
rw [← absNorm_ne_zero_iff, absNorm_span_singleton]
415+
simpa only [Ne, Int.natAbs_eq_zero, Algebra.norm_eq_zero_iff, Nat.cast_eq_zero] using
416+
ne_of_gt hn
417+
· intro I hI J hJ h
418+
rw [← comap_map_mk (span_singleton_absNorm_le I), ← hI.symm, ←
419+
comap_map_mk (span_singleton_absNorm_le J), ← hJ.symm]
420+
congr
421+
422+
theorem finite_setOf_absNorm_le [CharZero S] (n : ℕ) :
423+
{I : Ideal S | Ideal.absNorm I ≤ n}.Finite := by
424+
rw [show {I : Ideal S | Ideal.absNorm I ≤ n} =
425+
(⋃ i ∈ Set.Icc 0 n, {I : Ideal S | Ideal.absNorm I = i}) by ext; simp]
426+
refine Set.Finite.biUnion (Set.finite_Icc 0 n) (fun i _ => Ideal.finite_setOf_absNorm_eq i)
427+
428+
theorem card_norm_le_eq_card_norm_le_add_one (n : ℕ) [CharZero S] :
429+
Nat.card {I : Ideal S // absNorm I ≤ n} =
430+
Nat.card {I : (Ideal S)⁰ // absNorm (I : Ideal S) ≤ n} + 1 := by
431+
classical
432+
have : Finite {I : Ideal S // I ∈ (Ideal S)⁰ ∧ absNorm I ≤ n} :=
433+
(finite_setOf_absNorm_le n).subset fun _ ⟨_, h⟩ ↦ h
434+
have : Finite {I : Ideal S // I ∉ (Ideal S)⁰ ∧ absNorm I ≤ n} :=
435+
(finite_setOf_absNorm_le n).subset fun _ ⟨_, h⟩ ↦ h
436+
rw [Nat.card_congr (Equiv.subtypeSubtypeEquivSubtypeInter (fun I ↦ I ∈ (Ideal S)⁰)
437+
(fun I ↦ absNorm I ≤ n))]
438+
let e : {I : Ideal S // absNorm I ≤ n} ≃ {I : Ideal S // I ∈ (Ideal S)⁰ ∧ absNorm I ≤ n} ⊕
439+
{I : Ideal S // I ∉ (Ideal S)⁰ ∧ absNorm I ≤ n} := by
440+
refine (Equiv.subtypeEquivRight ?_).trans (subtypeOrEquiv _ _ ?_)
441+
· intro _
442+
simp_rw [← or_and_right, em, true_and]
443+
· exact Pi.disjoint_iff.mpr fun I ↦ Prop.disjoint_iff.mpr (by tauto)
444+
simp_rw [Nat.card_congr e, Nat.card_sum, add_right_inj]
445+
conv_lhs =>
446+
enter [1, 1, I]
447+
rw [← absNorm_ne_zero_iff_mem_nonZeroDivisors, ne_eq, not_not, and_iff_left_iff_imp.mpr
448+
(fun h ↦ by rw [h]; exact Nat.zero_le n), absNorm_eq_zero_iff]
449+
rw [Nat.card_unique]
412450

413451
theorem norm_dvd_iff {x : S} (hx : Prime (Algebra.norm ℤ x)) {y : ℤ} :
414452
Algebra.norm ℤ x ∣ y ↔ x ∣ y := by

0 commit comments

Comments
 (0)