Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 65031ca

Browse files
urkudVierkantor
andcommitted
feat(ring_theory/dedekind_domain/ideal): drop an unneeded assumption (#14444)
Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
1 parent 273986a commit 65031ca

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/ring_theory/dedekind_domain/ideal.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,13 @@ theorem ideal.prime_iff_is_prime {P : ideal A} (hP : P ≠ ⊥) :
673673
prime P ↔ is_prime P :=
674674
⟨ideal.is_prime_of_prime, ideal.prime_of_is_prime hP⟩
675675

676+
/-- In a Dedekind domain, the the prime ideals are the zero ideal together with the prime elements
677+
of the monoid with zero `ideal A`. -/
678+
theorem ideal.is_prime_iff_bot_or_prime {P : ideal A} :
679+
is_prime P ↔ P = ⊥ ∨ prime P :=
680+
⟨λ hp, (eq_or_ne P ⊥).imp_right $ λ hp0, (ideal.prime_of_is_prime hp0 hp),
681+
λ hp, hp.elim (λ h, h.symm ▸ ideal.bot_prime) ideal.is_prime_of_prime⟩
682+
676683
lemma ideal.strict_anti_pow (I : ideal A) (hI0 : I ≠ ⊥) (hI1 : I ≠ ⊤) :
677684
strict_anti ((^) I : ℕ → ideal A) :=
678685
strict_anti_nat_of_succ_lt $ λ e, ideal.dvd_not_unit_iff_lt.mp
@@ -899,10 +906,11 @@ section
899906

900907
open_locale classical
901908

902-
lemma ideal.count_normalized_factors_eq {p x : ideal R} (hp0 : p ≠ ⊥) [hp : p.is_prime] {n : ℕ}
909+
lemma ideal.count_normalized_factors_eq {p x : ideal R} [hp : p.is_prime] {n : ℕ}
903910
(hle : x ≤ p^n) (hlt : ¬ (x ≤ p^(n+1))) :
904911
(normalized_factors x).count p = n :=
905-
count_normalized_factors_eq ((ideal.prime_iff_is_prime hp0).mpr hp).irreducible
912+
count_normalized_factors_eq'
913+
((ideal.is_prime_iff_bot_or_prime.mp hp).imp_right prime.irreducible)
906914
(by { haveI : unique (ideal R)ˣ := ideal.unique_units, apply normalize_eq })
907915
(by convert ideal.dvd_iff_le.mpr hle) (by convert mt ideal.le_of_dvd hlt)
908916
/- Warning: even though a pure term-mode proof typechecks (the `by convert` can simply be

src/ring_theory/unique_factorization_domain.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ begin
783783
end
784784

785785
omit dec_dvd
786+
786787
/-- The number of times an irreducible factor `p` appears in `normalized_factors x` is defined by
787788
the number of times it divides `x`.
788789
@@ -801,6 +802,24 @@ begin
801802
exact (multiplicity.eq_coe_iff.mpr ⟨hle, hlt⟩).symm
802803
end
803804

805+
/-- The number of times an irreducible factor `p` appears in `normalized_factors x` is defined by
806+
the number of times it divides `x`. This is a slightly more general version of
807+
`unique_factorization_monoid.count_normalized_factors_eq` that allows `p = 0`.
808+
809+
See also `multiplicity_eq_count_normalized_factors` if `n` is given by `multiplicity p x`.
810+
-/
811+
lemma count_normalized_factors_eq' {p x : R} (hp : p = 0 ∨ irreducible p) (hnorm : normalize p = p)
812+
{n : ℕ} (hle : p^n ∣ x) (hlt : ¬ (p^(n+1) ∣ x)) :
813+
(normalized_factors x).count p = n :=
814+
begin
815+
rcases hp with rfl|hp,
816+
{ cases n,
817+
{ exact count_eq_zero.2 (zero_not_mem_normalized_factors _) },
818+
{ rw [zero_pow (nat.succ_pos _)] at hle hlt,
819+
exact absurd hle hlt } },
820+
{ exact count_normalized_factors_eq hp hnorm hle hlt }
821+
end
822+
804823
end multiplicity
805824

806825
end unique_factorization_monoid

0 commit comments

Comments
 (0)