@@ -4,15 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Anne Baanen, Alex J. Best
5
5
-/
6
6
import Mathlib.Algebra.CharP.Quotient
7
- import Mathlib.Algebra.GroupWithZero.NonZeroDivisors
8
- import Mathlib.Data.Finsupp.Fintype
9
7
import Mathlib.Data.Int.AbsoluteValue
10
8
import Mathlib.Data.Int.Associated
11
9
import Mathlib.LinearAlgebra.FreeModule.Determinant
12
10
import Mathlib.LinearAlgebra.FreeModule.IdealQuotient
13
11
import Mathlib.RingTheory.DedekindDomain.PID
14
- import Mathlib.RingTheory.Ideal.Basis
15
- import Mathlib.RingTheory.LocalProperties.Basic
16
12
import Mathlib.RingTheory.Localization.NormTrace
17
13
18
14
/-!
@@ -391,24 +387,66 @@ theorem absNorm_eq_zero_iff {I : Ideal S} : Ideal.absNorm I = 0 ↔ I = ⊥ := b
391
387
· rintro rfl
392
388
exact absNorm_bot
393
389
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]
396
393
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 : ℕ) :
398
405
{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]
412
450
413
451
theorem norm_dvd_iff {x : S} (hx : Prime (Algebra.norm ℤ x)) {y : ℤ} :
414
452
Algebra.norm ℤ x ∣ y ↔ x ∣ y := by
0 commit comments