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 numberx
is squarefree iff the listfactors x
has no duplicate factors.
Tags #
squarefree, multiplicity
theorem
Nat.squarefree_iff_nodup_primeFactorsList
{n : ℕ}
(h0 : n ≠ 0)
:
Squarefree n ↔ n.primeFactorsList.Nodup
@[deprecated Nat.squarefree_iff_nodup_primeFactorsList]
theorem
Nat.squarefree_iff_nodup_factors
{n : ℕ}
(h0 : n ≠ 0)
:
Squarefree n ↔ n.primeFactorsList.Nodup
@[deprecated Squarefree.nodup_primeFactorsList]
Alias of Squarefree.nodup_primeFactorsList
.
theorem
Squarefree.natFactorization_le_one
{n : ℕ}
(p : ℕ)
(hn : Squarefree n)
:
n.factorization p ≤ 1
theorem
Nat.factorization_eq_one_of_squarefree
{n : ℕ}
{p : ℕ}
(hn : Squarefree n)
(hp : Nat.Prime p)
(hpn : p ∣ n)
:
n.factorization p = 1
theorem
Nat.squarefree_of_factorization_le_one
{n : ℕ}
(hn : n ≠ 0)
(hn' : ∀ (p : ℕ), n.factorization p ≤ 1)
:
theorem
Nat.squarefree_iff_factorization_le_one
{n : ℕ}
(hn : n ≠ 0)
:
Squarefree n ↔ ∀ (p : ℕ), n.factorization p ≤ 1
theorem
Nat.squarefree_pow_iff
{n : ℕ}
{k : ℕ}
(hn : n ≠ 1)
(hk : k ≠ 0)
:
Squarefree (n ^ k) ↔ Squarefree n ∧ k = 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
, thenn
is squarefree; - If
some d
, thend
is a minimal square factor ofn
Equations
Instances For
Equations
- x.instDecidablePredSquarefree = decidable_of_iff' (x.minSqFac = none) ⋯
theorem
Nat.divisors_filter_squarefree_of_squarefree
{n : ℕ}
(hn : Squarefree n)
:
Finset.filter (fun (d : ℕ) => Squarefree d) n.divisors = n.divisors
theorem
Nat.divisors_filter_squarefree
{n : ℕ}
(h0 : n ≠ 0)
:
(Finset.filter (fun (d : ℕ) => Squarefree d) n.divisors).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 ∈ Finset.filter (fun (d : ℕ) => Squarefree d) n.divisors, f d = ∑ i ∈ (UniqueFactorizationMonoid.normalizedFactors n).toFinset.powerset, f i.val.prod
theorem
Nat.squarefree_mul
{m : ℕ}
{n : ℕ}
(hmn : m.Coprime n)
:
Squarefree (m * n) ↔ Squarefree m ∧ Squarefree n
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.squarefree_mul_iff
{m : ℕ}
{n : ℕ}
:
Squarefree (m * n) ↔ m.Coprime n ∧ Squarefree m ∧ Squarefree n
theorem
Nat.coprime_div_gcd_of_squarefree
{m : ℕ}
{n : ℕ}
(hm : Squarefree m)
(hn : n ≠ 0)
:
(m / m.gcd n).Coprime n
theorem
Nat.prod_primeFactors_of_squarefree
{n : ℕ}
(hn : Squarefree n)
:
∏ p ∈ n.primeFactors, p = n
theorem
Nat.prod_primeFactors_sdiff_of_squarefree
{n : ℕ}
(hn : Squarefree n)
{t : Finset ℕ}
(ht : t ⊆ n.primeFactors)
: