Documentation

Mathlib.NumberTheory.SmoothNumbers

Smooth numbers #

We define the set Nat.smoothNumbers n consisting of the positive natural numbers all of whose prime factors are strictly less than n.

We also define the finite set Nat.primesBelow n to be the set of prime numbers less than n.

The main definition Nat.equivProdNatSmoothNumbers establishes the bijection between ℕ × (smoothNumbers p) and smoothNumbers (p+1) given by sending (e, n) to p^e * n. Here p is a prime number.

Additionally, we define Nat.smoothNumbersUpTo N n as the Finset of n-smooth numbers up to and including N, and similarly Nat.roughNumbersUpTo for its complement in {1, ..., N}, and we provide some API, in particular bounds for their cardinalities; see Nat.smoothNumbersUpTo_card_le and Nat.roughNumbersUpTo_card_le.

primesBelow n is the set of primes less than n as a finset.

Equations
Instances For
    theorem Nat.lt_of_mem_primesBelow {p : ℕ} {n : ℕ} (h : p ∈ Nat.primesBelow n) :
    p < n

    smoothNumbers n is the set of n-smooth positive natural numbers, i.e., the positive natural numbers all of whose prime factors are less than n.

    Equations
    Instances For
      theorem Nat.mem_smoothNumbers {n : ℕ} {m : ℕ} :
      m ∈ Nat.smoothNumbers n ↔ m ≠ 0 ∧ ∀ p ∈ Nat.factors m, p < n
      theorem Nat.mem_smoothNumbers_of_dvd {n : ℕ} {m : ℕ} {k : ℕ} (h : m ∈ Nat.smoothNumbers n) (h' : k ∣ m) (hk : k ≠ 0) :

      A number that divides an n-smooth number is itself n-smooth.

      theorem Nat.mem_smoothNumbers_iff_forall_le {n : ℕ} {m : ℕ} :
      m ∈ Nat.smoothNumbers n ↔ m ≠ 0 ∧ ∀ p ≤ m, Nat.Prime p → p ∣ m → p < n

      m is n-smooth if and only if m is nonzero and all prime divisors ≤ m of m are less than n.

      theorem Nat.mem_smoothNumbers' {n : ℕ} {m : ℕ} :
      m ∈ Nat.smoothNumbers n ↔ ∀ (p : ℕ), Nat.Prime p → p ∣ m → p < n

      m is n-smooth if and only if all prime divisors of m are less than n.

      The product of the prime factors of n that are less than N is an N-smooth number.

      The sets of N-smooth and of (N+1)-smooth numbers are the same when N is not prime. See Nat.equivProdNatSmoothNumbers for when N is prime.

      theorem Nat.smoothNumbers_compl (N : ℕ) :
      (Nat.smoothNumbers N)ᶜ \ {0} ⊆ {n : ℕ | N ≤ n}

      The non-zero non-N-smooth numbers are ≥ N.

      theorem Nat.pow_mul_mem_smoothNumbers {p : ℕ} {n : ℕ} (hp : p ≠ 0) (e : ℕ) (hn : n ∈ Nat.smoothNumbers p) :

      If p is positive and n is p-smooth, then every product p^e * n is (p+1)-smooth.

      If p is a prime and n is p-smooth, then p and n are coprime.

      theorem Nat.map_prime_pow_mul {F : Type u_1} [CommSemiring F] {f : ℕ → F} (hmul : ∀ {m n : ℕ}, Nat.Coprime m n → f (m * n) = f m * f n) {p : ℕ} (hp : Nat.Prime p) (e : ℕ) {m : ↑(Nat.smoothNumbers p)} :
      f (p ^ e * ↑m) = f (p ^ e) * f ↑m

      If f : ℕ → F is multiplicative on coprime arguments, p is a prime and m is p-smooth, then f (p^e * m) = f (p^e) * f m.

      We establish the bijection from ℕ × smoothNumbers p to smoothNumbers (p+1) given by (e, n) ↦ p^e * n when p is a prime. See Nat.smoothNumbers_succ for when p is not prime.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem Nat.equivProdNatSmoothNumbers_apply {p : ℕ} {e : ℕ} {m : ℕ} (hp : Nat.Prime p) (hm : m ∈ Nat.smoothNumbers p) :
        ↑((Nat.equivProdNatSmoothNumbers hp) (e, { val := m, property := hm })) = p ^ e * m
        @[simp]
        theorem Nat.equivProdNatSmoothNumbers_apply' {p : ℕ} (hp : Nat.Prime p) (x : ℕ × ↑(Nat.smoothNumbers p)) :
        ↑((Nat.equivProdNatSmoothNumbers hp) x) = p ^ x.1 * ↑x.2

        The k-smooth numbers up to and including N as a Finset

        Equations
        Instances For

          The positive non-k-smooth (so "k-rough") numbers up to and including N as a Finset

          Equations
          Instances For

            A k-smooth number can be written as a square times a product of distinct primes < k.

            The set of k-smooth numbers ≤ N is contained in the set of numbers of the form m^2 * P, where m ≤ √N and P is a product of distinct primes < k.

            The cardinality of the set of k-smooth numbers ≤ N is bounded by 2^π(k-1) * √N.

            The set of k-rough numbers ≤ N can be written as the union of the sets of multiples ≤ N of primes k ≤ p ≤ N.

            The cardinality of the set of k-rough numbers ≤ N is bounded by the sum of ⌊N/p⌋ over the primes k ≤ p ≤ N.