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 rindicates thatris only divisible byx * xifxis a unit.
Main Results #
multiplicity.squarefree_iff_multiplicity_le_one:xissquarefreeiff for everyy, eithermultiplicity y x ≤ 1oris_unit y.unique_factorization_monoid.squarefree_iff_nodup_factors: A nonzero elementxof a unique factorization monoid is squarefree ifffactors xhas no duplicate factors.nat.squarefree_iff_nodup_factors: A positive natural numberxis squarefree iff the listfactors xhas 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, thennis squarefree; - If
some d, thendis 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.