Documentation

Mathlib.Data.Nat.Squarefree

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 #

Tags #

squarefree, multiplicity

theorem Nat.factorization_eq_one_of_squarefree {n : ℕ} {p : ℕ} (hn : Squarefree n) (hp : Nat.Prime p) (hpn : p ∣ n) :
theorem Nat.squarefree_of_factorization_le_one {n : ℕ} (hn : n ≠ 0) (hn' : ∀ (p : ℕ), (Nat.factorization n) p ≤ 1) :
theorem Nat.Squarefree.ext_iff {n : ℕ} {m : ℕ} (hn : Squarefree n) (hm : Squarefree m) :
n = m ↔ ∀ (p : ℕ), Nat.Prime p → (p ∣ n ↔ p ∣ m)
theorem Nat.squarefree_pow_iff {n : ℕ} {k : ℕ} (hn : n ≠ 1) (hk : k ≠ 0) :

Assuming that n has no factors less than k, returns the smallest prime p such that p^2 ∣ n.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    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, then n is squarefree;
      • If some d, then d is a minimal square factor of n
      Equations
      Instances For
        theorem Nat.minSqFacProp_div (n : ℕ) {k : ℕ} (pk : Nat.Prime k) (dk : k ∣ n) (dkk : ¬k * k ∣ n) {o : Option ℕ} (H : Nat.MinSqFacProp (n / k) o) :
        theorem Nat.minSqFacAux_has_prop {n : ℕ} (k : ℕ) (n0 : 0 < n) (i : ℕ) (e : k = 2 * i + 3) (ih : ∀ (m : ℕ), Nat.Prime m → m ∣ n → k ≤ m) :
        theorem Nat.minSqFac_prime {n : ℕ} {d : ℕ} (h : Nat.minSqFac n = some d) :
        theorem Nat.minSqFac_dvd {n : ℕ} {d : ℕ} (h : Nat.minSqFac n = some d) :
        d * d ∣ n
        theorem Nat.minSqFac_le_of_dvd {n : ℕ} {d : ℕ} (h : Nat.minSqFac n = some d) {m : ℕ} (m2 : 2 ≤ m) (md : m * m ∣ n) :
        d ≤ m
        theorem Nat.sq_mul_squarefree_of_pos {n : ℕ} (hn : 0 < n) :
        ∃ (a : ℕ) (b : ℕ), 0 < a ∧ 0 < b ∧ b ^ 2 * a = n ∧ Squarefree a
        theorem Nat.sq_mul_squarefree_of_pos' {n : ℕ} (h : 0 < n) :
        ∃ (a : ℕ) (b : ℕ), (b + 1) ^ 2 * (a + 1) = n ∧ Squarefree (a + 1)
        theorem Nat.sq_mul_squarefree (n : ℕ) :
        ∃ (a : ℕ) (b : ℕ), b ^ 2 * a = n ∧ Squarefree a
        theorem Nat.squarefree_mul {m : ℕ} {n : ℕ} (hmn : Nat.Coprime m 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.coprime_of_squarefree_mul {m : ℕ} {n : ℕ} (h : Squarefree (m * n)) :
        theorem Nat.coprime_div_gcd_of_squarefree {m : ℕ} {n : ℕ} (hm : Squarefree m) (hn : n ≠ 0) :
        theorem Nat.prod_primeFactors_of_squarefree {n : ℕ} (hn : Squarefree n) :
        (Finset.prod n.primeFactors fun (p : ℕ) => p) = n
        theorem Nat.primeFactors_prod {s : Finset ℕ} (hs : ∀ p ∈ s, Nat.Prime p) :
        (Finset.prod s fun (p : ℕ) => p).primeFactors = s
        theorem Nat.primeFactors_div_gcd {m : ℕ} {n : ℕ} (hm : Squarefree m) (hn : n ≠ 0) :
        (m / Nat.gcd m n).primeFactors = m.primeFactors \ n.primeFactors
        theorem Nat.prod_primeFactors_invOn_squarefree :
        Set.InvOn (fun (n : ℕ) => (Nat.factorization n).support) (fun (s : Finset ℕ) => Finset.prod s fun (p : ℕ) => p) {s : Finset ℕ | ∀ p ∈ s, Nat.Prime p} {n : ℕ | Squarefree n}
        theorem Nat.prod_primeFactors_sdiff_of_squarefree {n : ℕ} (hn : Squarefree n) {t : Finset ℕ} (ht : t ⊆ n.primeFactors) :
        (Finset.prod (n.primeFactors \ t) fun (a : ℕ) => a) = n / Finset.prod t fun (a : ℕ) => a