- well_founded_dvd_not_unit : well_founded dvd_not_unit
Well-foundedness of the strict version of |, which is equivalent to the descending chain condition on divisibility and to the ascending chain condition on principal ideals in an integral domain.
- to_wf_dvd_monoid : wf_dvd_monoid α
- irreducible_iff_prime : ∀ {a : α}, irreducible a ↔ prime a
unique factorization monoids.
These are defined as comm_cancel_monoid_with_zero
s with well-founded strict divisibility
relations, but this is equivalent to more familiar definitions:
Each element (except zero) is uniquely represented as a multiset of irreducible factors. Uniqueness is only up to associated elements.
Each element (except zero) is non-uniquely represented as a multiset of prime factors.
To define a UFD using the definition in terms of multisets
of irreducible factors, use the definition of_unique_irreducible_factorization
To define a UFD using the definition in terms of multisets
of prime factors, use the definition of_exists_prime_factorization
If an irreducible has a prime factorization, then it is an associate of one of its prime factors.
Noncomputably determines the multiset of prime factors.
Equations
- unique_factorization_monoid.factors a = dite (a = 0) (λ (h : a = 0), 0) (λ (h : ¬a = 0), multiset.map ⇑normalize (classical.some _))
Euclid's lemma: if a ∣ b * c
and a
and c
have no common prime factors, a ∣ b
.
Compare is_coprime.dvd_of_dvd_mul_left
.
Euclid's lemma: if a ∣ b * c
and a
and b
have no common prime factors, a ∣ c
.
Compare is_coprime.dvd_of_dvd_mul_right
.
If a ≠ 0, b
are elements of a unique factorization domain, then dividing
out their common factor c'
gives a'
and b'
with no factors in common.
factor_set α
representation elements of unique factorization domain as multisets.
multiset α
produced by factors
are only unique up to associated elements, while the multisets in
factor_set α
are unqiue by equality and restricted to irreducible elements. This gives us a
representation of each element as a unique multisets (or the added ⊤ for 0), which has a complete
lattice struture. Infimum is the greatest common divisor and supremum is the least common multiple.
Equations
- associates.factor_set α = with_top (multiset {a // irreducible a})
Evaluates the product of a factor_set
to be the product of the corresponding multiset,
or 0
if there is none.
Equations
bcount p s
is the multiplicity of p
in the factor_set s
(with bundled p
)
Equations
- associates.bcount p (some s) = multiset.count p s
- associates.bcount p none = 0
count p s
is the multiplicity of the irreducible p
in the factor_set s
.
If p
is not irreducible, count p s
is defined to be 0
.
Equations
- p.count = dite (irreducible p) (λ (hp : irreducible p), associates.bcount ⟨p, hp⟩) (λ (hp : ¬irreducible p), 0)
membership in a factor_set (bundled version)
Equations
- associates.bfactor_set_mem p (some l) = (p ∈ l)
- associates.bfactor_set_mem _x ⊤ = true
factor_set_mem p s
is the predicate that the irreducible p
is a member of s : factor_set α
.
If p
is not irreducible, p
is not a member of any factor_set
.
Equations
- p.factor_set_mem s = dite (irreducible p) (λ (hp : irreducible p), associates.bfactor_set_mem ⟨p, hp⟩ s) (λ (hp : ¬irreducible p), false)
Equations
- associates.has_mem = {mem := associates.factor_set_mem (λ (p : associates α), dec_irr p)}
This returns the multiset of irreducible factors as a factor_set
,
a multiset of irreducible associates with_top
.
Equations
- associates.factors' a = multiset.pmap (λ (a : α) (ha : irreducible a), ⟨associates.mk a, _⟩) (unique_factorization_monoid.factors a) _
This returns the multiset of irreducible factors of an associate as a factor_set
,
a multiset of irreducible associates with_top
.
Equations
- associates.has_sup = {sup := λ (a b : associates α), (a.factors ⊔ b.factors).prod}
Equations
- associates.has_inf = {inf := λ (a b : associates α), (a.factors ⊓ b.factors).prod}
Equations
- associates.bounded_lattice = {sup := has_sup.sup associates.has_sup, le := partial_order.le associates.partial_order, lt := partial_order.lt associates.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := has_inf.inf associates.has_inf, inf_le_left := _, inf_le_right := _, le_inf := _, top := order_top.top associates.order_top, le_top := _, bot := order_bot.bot associates.order_bot, bot_le := _}
to_gcd_monoid
constructs a GCD monoid out of a normalization on a
unique factorization domain.
Equations
- unique_factorization_monoid.to_gcd_monoid α = {norm_unit := norm_unit _inst_3, norm_unit_zero := _, norm_unit_mul := _, norm_unit_coe_units := _, gcd := λ (a b : α), (associates.mk a ⊓ associates.mk b).out, lcm := λ (a b : α), (associates.mk a ⊔ associates.mk b).out, gcd_dvd_left := _, gcd_dvd_right := _, dvd_gcd := _, normalize_gcd := _, gcd_mul_lcm := _, lcm_zero_left := _, lcm_zero_right := _}