Lemmas about squarefreeness of natural numbers #
A number is squarefree when it is not divisible by any squares except the squares of units.
Main Results #
Nat.squarefree_iff_nodup_primeFactorsList: A positive natural numberxis squarefree iff the listfactors xhas no duplicate factors.
Tags #
squarefree, multiplicity
theorem Nat.factorization_eq_one_of_squarefree {n p : ℕ} (hn : Squarefree n) (hp : Prime p) (hpn : p ∣ n) :
theorem Nat.squarefree_of_factorization_le_one {n : ℕ} (hn : n ≠ 0) (hn' : ∀ (p : ℕ), n.factorization p ≤ 1) :
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 Nat.squarefree_iff_minSqFac.
Equations
Instances For
The correctness property of the return value of minSqFac.
- If
none, thennis squarefree; - If
some d, thendis a minimal square factor ofn
Equations
Instances For
theorem Nat.minSqFacProp_div (n : ℕ) {k : ℕ} (pk : Prime k) (dk : k ∣ n) (dkk : ¬k * k ∣ n) {o : Option ℕ} (H : (n / k).MinSqFacProp o) :
n.MinSqFacProp o
theorem Nat.minSqFacAux_has_prop {n : ℕ} (k : ℕ) (n0 : 0 < n) (i : ℕ) (e : k = 2 * i + 3) (ih : ∀ (m : ℕ), Prime m → m ∣ n → k ≤ m) :
n.MinSqFacProp (n.minSqFacAux k)
@[instance_reducible]
Equations
- x✝.instDecidablePredSquarefree = decidable_of_iff' (x✝.minSqFac = none) ⋯
theorem Nat.divisors_filter_squarefree {n : ℕ} (h0 : n ≠ 0) :
{d ∈ n.divisors | Squarefree d}.val = Multiset.map (fun (x : Finset ℕ) => x.val.prod) (UniqueFactorizationMonoid.normalizedFactors n).toFinset.powerset.val
theorem Nat.sum_divisors_filter_squarefree {n : ℕ} (h0 : n ≠ 0) {α : Type u_1} [AddCommMonoid α] {f : ℕ → α} :
∑ d ∈ n.divisors with Squarefree d, f d = ∑ i ∈ (UniqueFactorizationMonoid.normalizedFactors n).toFinset.powerset, f i.val.prod
@[deprecated "Use `exists_sq_mul_squarefree` instead, which binds the witnesses in the order in which they appear." (since := "2026-08-17")]
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.
theorem Nat.prod_primeFactors_sdiff_of_squarefree {n : ℕ} (hn : Squarefree n) {t : Finset ℕ} (ht : t ⊆ n.primeFactors) :
An integer is squarefree iff no prime square divides it.