Skip to content

Commit b4f6eb5

Browse files
committed
feat(RingTheory/UniqueFactorizationDomain/Basic): associated elements have the same number of factors (#34572)
This PR proves that associated elements have the same number of factors (this follows from the preceeding lemma `factors_unique`). Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent a1c5c92 commit b4f6eb5

File tree

1 file changed

+9
-0
lines changed
  • Mathlib/RingTheory/UniqueFactorizationDomain

1 file changed

+9
-0
lines changed

Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ theorem factors_unique {f g : Multiset α} (hf : ∀ x ∈ f, Irreducible x)
110110
prime_factors_unique (fun x hx => UniqueFactorizationMonoid.irreducible_iff_prime.mp (hf x hx))
111111
(fun x hx => UniqueFactorizationMonoid.irreducible_iff_prime.mp (hg x hx)) h
112112

113+
theorem _root_.Associated.card_factors_eq {a b : α} (h : Associated a b) :
114+
(factors a).card = (factors b).card := by
115+
by_cases hb : b = 0
116+
· simp_all
117+
have ha : a ≠ 0 := h.ne_zero_iff.mpr hb
118+
apply Multiset.card_eq_card_of_rel
119+
apply factors_unique irreducible_of_factor irreducible_of_factor
120+
exact (factors_prod ha).trans <| h.trans (factors_prod hb).symm
121+
113122
end UniqueFactorizationMonoid
114123

115124
/-- If an irreducible has a prime factorization,

0 commit comments

Comments
 (0)