Squarefree elements of monoids #
An element of a monoid is squarefree when it is not divisible by any squares except the squares of units.
Main Definitions #
squarefree r
indicates thatr
is only divisible byx * x
ifx
is a unit.
Main Results #
multiplicity.squarefree_iff_multiplicity_le_one
:x
issquarefree
iff for everyy
, eithermultiplicity y x ≤ 1
oris_unit y
.unique_factorization_monoid.squarefree_iff_nodup_factors
: A nonzero elementx
of a unique factorization monoid is squarefree ifffactors x
has no duplicate factors.nat.squarefree_iff_nodup_factors
: A positive natural numberx
is squarefree iff the listfactors x
has no duplicate factors.
Tags #
squarefree, multiplicity
An element of a monoid is squarefree if the only squares that divide it are the squares of units.
Equations
- squarefree r = ∀ (x : R), x * x ∣ r → is_unit x
Assuming that n
has no factors less than k
, returns the smallest prime p
such that
p^2 ∣ n
.
Returns the smallest prime factor p
of n
such that p^2 ∣ n
, or none
if there is no
such p
(that is, n
is squarefree). See also squarefree_iff_min_sq_fac
.
Equations
- n.min_sq_fac = ite (2 ∣ n) (let n' : ℕ := n / 2 in ite (2 ∣ n') (some 2) (n'.min_sq_fac_aux 3)) (n.min_sq_fac_aux 3)
The correctness property of the return value of min_sq_fac
.
- If
none
, thenn
is squarefree; - If
some d
, thend
is a minimal square factor ofn
Equations
squarefree
is multiplicative. Note that the → direction does not require hmn
and generalizes to arbitrary commutative monoids. See squarefree.of_mul_left
and
squarefree.of_mul_right
above for auxiliary lemmas.
Square-free prover #
A predicate representing partial progress in a proof of squarefree
.