Documentation

Mathlib.NumberTheory.ArithmeticFunction.Misc

Miscellaneous arithmetic Functions #

This file defines some simple examples of arithmetic functions (functions ℕ → R vanishing at 0, considered as a ring under Dirichlet convolution). Note that the Von Mangoldt and Möbius functions are in separate files.

Main Definitions #

Notation #

The arithmetic functions σ, ω and Ω have Greek letter names. This notation is scoped to the separate locales ArithmeticFunction.sigma for σ, ArithmeticFunction.omega for ω and ArithmeticFunction.Omega for Ω, to allow for selective access.

Tags #

arithmetic functions, dirichlet convolution, divisors

The map $n \mapsto \prod_{p \mid n} f(p)$ as an arithmetic function

Equations
Instances For

    ∏ᵖ p ∣ n, f p is custom notation for prodPrimeFactors f n

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      theorem ArithmeticFunction.prodPrimeFactors_apply {R : Type u_1} [CommMonoidWithZero R] {f : ℕ → R} {n : ℕ} (hn : n ≠ 0) :
      (prodPrimeFactors fun (p : ℕ) => f p) n = ∏ p ∈ n.primeFactors, f p

      The identity on ℕ as an ArithmeticFunction.

      Equations
      Instances For
        @[simp]
        theorem ArithmeticFunction.id_apply {x : ℕ} :
        id x = x

        pow k n = n ^ k, except pow 0 0 = 0.

        Equations
        Instances For
          @[simp]
          theorem ArithmeticFunction.pow_apply {k n : ℕ} :
          (pow k) n = if k = 0 ∧ n = 0 then 0 else n ^ k

          σ k n is the sum of the kth powers of the divisors of n

          Equations
          Instances For

            σ k n is the sum of the kth powers of the divisors of n

            Equations
            Instances For
              theorem ArithmeticFunction.sigma_apply {k n : ℕ} :
              (sigma k) n = ∑ d ∈ n.divisors, d ^ k
              @[simp]
              theorem ArithmeticFunction.sigma_eq_zero {k n : ℕ} :
              (sigma k) n = 0 ↔ n = 0
              @[simp]
              theorem ArithmeticFunction.sigma_pos_iff {k n : ℕ} :
              0 < (sigma k) n ↔ 0 < n
              theorem ArithmeticFunction.sigma_apply_prime_pow {k p i : ℕ} (hp : Nat.Prime p) :
              (sigma k) (p ^ i) = ∑ j ∈ Finset.range (i + 1), p ^ (j * k)
              theorem ArithmeticFunction.sigma_one_apply (n : ℕ) :
              (sigma 1) n = ∑ d ∈ n.divisors, d
              theorem ArithmeticFunction.sigma_one_apply_prime_pow {p i : ℕ} (hp : Nat.Prime p) :
              (sigma 1) (p ^ i) = ∑ k ∈ Finset.range (i + 1), p ^ k
              theorem ArithmeticFunction.sigma_eq_sum_div (k n : ℕ) :
              (sigma k) n = ∑ d ∈ n.divisors, (n / d) ^ k
              @[simp]
              theorem ArithmeticFunction.sigma_one (k : ℕ) :
              (sigma k) 1 = 1
              theorem ArithmeticFunction.sigma_pos (k n : ℕ) (hn0 : n ≠ 0) :
              0 < (sigma k) n
              theorem ArithmeticFunction.sigma_mono (k k' n : ℕ) (hk : k ≤ k') :
              (sigma k) n ≤ (sigma k') n
              theorem ArithmeticFunction.sigma_le_pow_succ (k n : ℕ) :
              (sigma k) n ≤ n ^ (k + 1)

              A crude upper bound: σ_k(n) ≤ n ^ (k + 1).

              theorem Nat.card_divisors {n : ℕ} (hn : n ≠ 0) :
              n.divisors.card = ∏ x ∈ n.primeFactors, (n.factorization x + 1)
              @[simp]
              @[simp]
              theorem ArithmeticFunction.sigma_eq_one_iff (k n : ℕ) :
              (sigma k) n = 1 ↔ n = 1
              theorem Nat.sum_divisors {n : ℕ} (hn : n ≠ 0) :
              ∑ d ∈ n.divisors, d = ∏ p ∈ n.primeFactors, ∑ k ∈ Finset.range (n.factorization p + 1), p ^ k

              Ω n is the number of prime factors of n.

              Equations
              Instances For

                Ω n is the number of prime factors of n.

                Equations
                Instances For
                  theorem ArithmeticFunction.cardFactors_mul {m n : ℕ} (m0 : m ≠ 0) (n0 : n ≠ 0) :

                  ω n is the number of distinct prime factors of n.

                  Equations
                  Instances For

                    ω n is the number of distinct prime factors of n.

                    Equations
                    Instances For
                      theorem ArithmeticFunction.cardDistinctFactors_prod {ι : Type u_2} {s : Finset ι} {f : ι → ℕ} (h : (↑s).Pairwise (Function.onFun Nat.Coprime f)) :
                      cardDistinctFactors (∏ i ∈ s, f i) = ∑ i ∈ s, cardDistinctFactors (f i)
                      theorem ArithmeticFunction.sum_Ioc_zeta (N : ℕ) :
                      ∑ n ∈ Finset.Ioc 0 N, zeta n = N
                      theorem ArithmeticFunction.sum_Ioc_mul_eq_sum_prod_filter {R : Type u_2} [Semiring R] (f g : ArithmeticFunction R) (N : ℕ) :
                      ∑ n ∈ Finset.Ioc 0 N, (f * g) n = ∑ x ∈ Finset.Ioc 0 N ×ˢ Finset.Ioc 0 N with x.1 * x.2 ≤ N, f x.1 * g x.2
                      theorem ArithmeticFunction.sum_Ioc_mul_eq_sum_sum {R : Type u_2} [Semiring R] (f g : ArithmeticFunction R) (N : ℕ) :
                      ∑ n ∈ Finset.Ioc 0 N, (f * g) n = ∑ n ∈ Finset.Ioc 0 N, f n * ∑ m ∈ Finset.Ioc 0 (N / n), g m
                      theorem ArithmeticFunction.sum_Ioc_mul_zeta_eq_sum {R : Type u_2} [Semiring R] (f : ArithmeticFunction R) (N : ℕ) :
                      ∑ n ∈ Finset.Ioc 0 N, (f * ↑zeta) n = ∑ n ∈ Finset.Ioc 0 N, f n * ↑(N / n)
                      theorem ArithmeticFunction.sum_Ioc_sigma0_eq_sum_div (N : ℕ) :
                      ∑ n ∈ Finset.Ioc 0 N, (sigma 0) n = ∑ n ∈ Finset.Ioc 0 N, N / n

                      An O(N) formula for the sum of the number of divisors function.

                      theorem Nat.Coprime.sum_divisors_mul {m n : ℕ} (hmn : m.Coprime n) :
                      ∑ d ∈ (m * n).divisors, d = (∑ d ∈ m.divisors, d) * ∑ d ∈ n.divisors, d

                      Extension for ArithmeticFunction.sigma.

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