Lemmas about squarefreeness of natural numbers #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4. A number is squarefree when it is not divisible by any squares except the squares of units.
Main Results #
nat.squarefree_iff_nodup_factors
: A positive natural numberx
is squarefree iff the listfactors x
has no duplicate factors.
Tags #
squarefree, multiplicity
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') (option.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
- n.min_sq_fac_prop (option.some d) = (nat.prime d ∧ d * d ∣ n ∧ ∀ (p : ℕ), nat.prime p → p * p ∣ n → d ≤ p)
- n.min_sq_fac_prop option.none = squarefree n
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
.