Unique factorization #
Main Definitions #
WfDvdMonoid
holds forMonoid
s for which a strict divisibility relation is well-founded.UniqueFactorizationMonoid
holds forWfDvdMonoid
s whereIrreducible
is equivalent toPrime
Main results #
Ideal.setOf_isPrincipal_wellFoundedOn_gt
,WfDvdMonoid.of_setOf_isPrincipal_wellFoundedOn_gt
in a domain, well-foundedness of the strict version of ∣ is equivalent to the ascending chain condition on principal ideals.
TODO #
- set up the complete lattice structure on
FactorSet
.
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.
Equations
- WfDvdMonoid α = IsWellFounded α DvdNotUnit
Instances For
Equations
- ⋯ = ⋯
unique factorization monoids.
These are defined as CancelCommMonoidWithZero
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_exists_unique_irreducible_factors
To define a UFD using the definition in terms of multisets
of prime factors, use the definition of_exists_prime_factors
- wf : WellFounded DvdNotUnit
- irreducible_iff_prime : ∀ {a : α}, Irreducible a ↔ Prime a
Instances
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
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
- UniqueFactorizationMonoid.factors a = if h : a = 0 then 0 else Classical.choose ⋯
Instances For
Noncomputably determines the multiset of prime factors.
Equations
Instances For
An arbitrary choice of factors of x : M
is exactly the (unique) normalized set of factors,
if M
has a trivial group of units.
Noncomputably defines a normalizationMonoid
structure on a UniqueFactorizationMonoid
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Euclid's lemma: if a ∣ b * c
and a
and c
have no common prime factors, a ∣ b
.
Compare IsCoprime.dvd_of_dvd_mul_left
.
Euclid's lemma: if a ∣ b * c
and a
and b
have no common prime factors, a ∣ c
.
Compare IsCoprime.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.
Alias of pow_injective_of_not_isUnit
.
Alias of pow_inj_of_not_isUnit
.
The multiplicity of an irreducible factor of a nonzero element is exactly the number of times
the normalized factor occurs in the normalizedFactors
.
See also count_normalizedFactors_eq
which expands the definition of multiplicity
to produce a specification for count (normalizedFactors _) _
..
The number of times an irreducible factor p
appears in normalizedFactors x
is defined by
the number of times it divides x
.
See also multiplicity_eq_count_normalizedFactors
if n
is given by multiplicity p x
.
The number of times an irreducible factor p
appears in normalizedFactors x
is defined by
the number of times it divides x
. This is a slightly more general version of
UniqueFactorizationMonoid.count_normalizedFactors_eq
that allows p = 0
.
See also multiplicity_eq_count_normalizedFactors
if n
is given by multiplicity p x
.
Deprecated. Use WfDvdMonoid.max_power_factor
instead.
If P
holds for units and powers of primes,
and P x ∧ P y
for coprime x, y
implies P (x * y)
,
then P
holds on a product of powers of distinct primes.
If P
holds for 0
, units and powers of primes,
and P x ∧ P y
for coprime x, y
implies P (x * y)
,
then P
holds on all a : α
.
If f
maps p ^ i
to (f p) ^ i
for primes p
, and f
is multiplicative on coprime elements, then f
is multiplicative on all products of primes.
If f
maps p ^ i
to (f p) ^ i
for primes p
, and f
is multiplicative on coprime elements, then f
is multiplicative everywhere.
FactorSet α
representation elements of unique factorization domain as multisets.
Multiset α
produced by normalizedFactors
are only unique up to associated elements, while the
multisets in FactorSet α
are unique 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 structure. Infimum is the greatest common divisor and supremum is the least common
multiple.
Equations
- Associates.FactorSet α = WithTop (Multiset { a : Associates α // Irreducible a })
Instances For
Evaluates the product of a FactorSet
to be the product of the corresponding multiset,
or 0
if there is none.
Equations
- Associates.FactorSet.prod none = 0
- Associates.FactorSet.prod (some s) = (Multiset.map Subtype.val s).prod
Instances For
bcount p s
is the multiplicity of p
in the FactorSet s
(with bundled p
)
Equations
- Associates.bcount p none = 0
- Associates.bcount p (some s) = Multiset.count p s
Instances For
count p s
is the multiplicity of the irreducible p
in the FactorSet s
.
If p
is not irreducible, count p s
is defined to be 0
.
Equations
- p.count = if hp : Irreducible p then Associates.bcount ⟨p, hp⟩ else 0
Instances For
membership in a FactorSet (bundled version)
Equations
- Associates.BfactorSetMem x none = True
- Associates.BfactorSetMem x (some l) = (x ∈ l)
Instances For
FactorSetMem p s
is the predicate that the irreducible p
is a member of
s : FactorSet α
.
If p
is not irreducible, p
is not a member of any FactorSet
.
Equations
- Associates.FactorSetMem s p = if hp : Irreducible p then Associates.BfactorSetMem ⟨p, hp⟩ s else False
Instances For
Equations
- Associates.instMembershipFactorSet = { mem := Associates.FactorSetMem }
This returns the multiset of irreducible factors as a FactorSet
,
a multiset of irreducible associates WithTop
.
Equations
- Associates.factors' a = Multiset.pmap (fun (a : α) (ha : Irreducible a) => ⟨Associates.mk a, ⋯⟩) (UniqueFactorizationMonoid.factors a) ⋯
Instances For
This returns the multiset of irreducible factors of an associate as a FactorSet
,
a multiset of irreducible associates WithTop
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Alias of Associates.factors_zero
.
Alias of Associates.factors_eq_top_iff_zero
.
Equations
- Associates.instSup = { sup := fun (a b : Associates α) => (a.factors ⊔ b.factors).prod }
Equations
- Associates.instInf = { inf := fun (a b : Associates α) => (a.factors ⊓ b.factors).prod }
Equations
- Associates.instLattice = Lattice.mk ⋯ ⋯ ⋯
The only divisors of prime powers are prime powers. See eq_pow_find_of_dvd_irreducible_pow
for an explicit expression as a p-power (without using count
).
The only divisors of prime powers are prime powers.
toGCDMonoid
constructs a GCD monoid out of a unique factorization domain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
toNormalizedGCDMonoid
constructs a GCD monoid out of a normalization on a
unique factorization domain.
Instances For
Equations
- ⋯ = ⋯
If y
is a nonzero element of a unique factorization monoid with finitely
many units (e.g. ℤ
, Ideal (ring_of_integers K)
), it has finitely many divisors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This returns the multiset of irreducible factors as a Finsupp
.
Equations
- factorization n = Multiset.toFinsupp (UniqueFactorizationMonoid.normalizedFactors n)
Instances For
The support of factorization n
is exactly the Finset of normalized factors
For nonzero a
and b
, the power of p
in a * b
is the sum of the powers in a
and b
For any p
, the power of p
in x^n
is n
times the power in x
Every non-zero prime ideal in a unique factorization domain contains a prime element.
The ascending chain condition on principal ideals holds in a WfDvdMonoid
domain.
The ascending chain condition on principal ideals in a domain is sufficient to prove that
the domain is WfDvdMonoid
.
Equations
- ⋯ = ⋯