- factors : α → multiset α
- factors_prod : ∀ {a : α}, a ≠ 0 → associated (unique_factorization_domain.factors a).prod a
- prime_factors : ∀ {a : α}, a ≠ 0 → ∀ (x : α), x ∈ unique_factorization_domain.factors a → prime x
Unique factorization domains.
In a unique factorization domain each element (except zero) is uniquely represented as a multiset of irreducible factors. Uniqueness is only up to associated elements.
This is equivalent to defining a unique factorization domain as a domain in which each element (except zero) is non-uniquely represented as a multiset of prime factors. This definition is used.
To define a UFD using the traditional definition in terms of multisets
of irreducible factors, use the definition of_unique_irreducible_factorization
- factors : α → multiset α
- factors_prod : ∀ {a : α}, a ≠ 0 → associated (c.factors a).prod a
- irreducible_factors : ∀ {a : α}, a ≠ 0 → ∀ (x : α), x ∈ c.factors a → irreducible x
- unique : ∀ {f g : multiset α}, (∀ (x : α), x ∈ f → irreducible x) → (∀ (x : α), x ∈ g → irreducible x) → associated f.prod g.prod → multiset.rel associated f g
Equations
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})
Equations
Equations
- associates.factors' a ha = multiset.pmap (λ (a : α) (ha : irreducible a), ⟨associates.mk a, _⟩) (unique_factorization_domain.factors a) _
Equations
- a.factors = dite (a = 0) (λ (h : a = 0), ⊤) (λ (h : ¬a = 0), quotient.hrec_on a (λ (x : α) (h : ¬⟦x⟧ = 0), option.some (associates.factors' x _)) associates.factors._proof_2 h)
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_domain.to_gcd_monoid α = {norm_unit := normalization_monoid.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 := _}
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.