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
To do #
- set up the complete lattice structure on
FactorSet
.
- wellFounded_dvdNotUnit : WellFounded DvdNotUnit
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.
Instances
- wellFounded_dvdNotUnit : WellFounded DvdNotUnit
- irreducible_iff_prime : ∀ {a : α}, Irreducible a ↔ Prime a
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
Instances
Can't be an instance because it would cause a loop ufm → WfDvdMonoid → ufm → ...
.
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.
Instances For
Noncomputably determines the multiset of prime factors.
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
.
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.
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
.
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.
Instances For
Evaluates the product of a FactorSet
to be the product of the corresponding multiset,
or 0
if there is none.
Instances For
bcount p s
is the multiplicity of p
in the FactorSet s
(with bundled p
)
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
.
Instances For
membership in a FactorSet (bundled version)
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
.
Instances For
This returns the multiset of irreducible factors as a FactorSet
,
a multiset of irreducible associates WithTop
.
Instances For
This returns the multiset of irreducible factors of an associate as a FactorSet
,
a multiset of irreducible associates WithTop
.
Instances For
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.
Instances For
toNormalizedGCDMonoid
constructs a GCD monoid out of a normalization on a
unique factorization domain.
Instances For
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.
Instances For
This returns the multiset of irreducible factors as a Finsupp
.
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