Documentation

Mathlib.NumberTheory.Chebyshev

Chebyshev functions #

This file defines the Chebyshev functions theta and psi. These give logarithmically weighted sums of primes and prime powers.

Main definitions #

Main results #

Notation #

We introduce the scoped notations θ and ψ in the Chebyshev namespace for the Chebyshev functions.

References #

Parts of this file were upstreamed from the PrimeNumberTheoremAnd project by Kontorovich et al, https://github.com/alexKontorovich/PrimeNumberTheoremAnd.

noncomputable def Chebyshev.psi (x : ℝ) :

The sum of ArithmeticFunction.vonMangoldt over integers n ≤ x.

Equations
Instances For

    The sum of ArithmeticFunction.vonMangoldt over integers n ≤ x.

    Equations
    Instances For
      noncomputable def Chebyshev.theta (x : ℝ) :

      The sum of log p over primes p ≤ x.

      Equations
      Instances For

        The sum of log p over primes p ≤ x.

        Equations
        Instances For
          theorem Chebyshev.theta_pos {x : ℝ} (hy : 2 ≤ x) :
          0 < theta x
          theorem Chebyshev.psi_eq_zero_of_lt_two {x : ℝ} (hx : x < 2) :
          psi x = 0
          @[simp]
          theorem Chebyshev.psi_eq_zero_iff {x : ℝ} :
          psi x = 0 ↔ x < 2
          theorem Chebyshev.psi_eq_zero_of_le_one {x : ℝ} (hx : x ≤ 1) :
          psi x = 0
          @[simp]
          theorem Chebyshev.psi_zero :
          psi 0 = 0
          @[simp]
          theorem Chebyshev.psi_one :
          psi 1 = 0
          theorem Chebyshev.theta_eq_zero_of_lt_two {x : ℝ} (hx : x < 2) :
          theta x = 0
          @[simp]
          theorem Chebyshev.theta_eq_zero_iff {x : ℝ} :
          theta x = 0 ↔ x < 2
          theorem Chebyshev.theta_eq_zero_of_le_one {x : ℝ} (hx : x ≤ 1) :
          theta x = 0
          @[simp]
          @[simp]

          θ x is the log of the product of the primes up to x.

          theorem Chebyshev.theta_le_log4_mul_x {x : ℝ} (hx : 0 ≤ x) :

          Chebyshev's upper bound: θ x ≤ c x with the constant c = log 4.

          Least common multiple of {1,...,n} #

          Basic facts about the least common multiple of the first n natural numbers

          def Nat.lcmUpto (n : ℕ) :

          Least common multiple of Icc 1 n.

          Equations
          Instances For
            theorem Nat.lcmUpto_pos (n : ℕ) :
            theorem Nat.factorization_lcmUpto (n : ℕ) {p : ℕ} (hp : Prime p) :
            theorem Nat.lcmUpto_eq_prod_pow_log (n : ℕ) :
            n.lcmUpto = ∏ p ∈ n.primesLE, p ^ log p n
            theorem Chebyshev.psi_eq_sum_mul_log_prime (n : ℕ) :
            psi ↑n = ∑ p ∈ n.primesLE, ↑(Nat.log p n) * Real.log ↑p

            ψ n is the logarithm of lcmUpto n.

            theorem Chebyshev.choose_dvd_lcmUpto {n k : ℕ} (hkn : k ≤ n) :

            lcmUpto n is divisible by choose n k for all k ≤ n

            Relating ψ and θ #

            We isolate the contributions of different prime powers to ψ and use this to show that ψ and θ are close.

            theorem Chebyshev.sum_PrimePow_eq_sum_sum' {R : Type u_1} [AddCommMonoid R] (f : ℕ → R) {x : ℝ} (hx : 0 ≤ x) {N : ℕ} (hN : ⌊Real.log x / Real.log 2⌋₊ ≤ N) :
            ∑ n ∈ Finset.Ioc 0 ⌊x⌋₊ with IsPrimePow n, f n = ∑ k ∈ Finset.Icc 1 N, ∑ p ∈ Finset.Ioc 0 ⌊x ^ (1 / ↑k)⌋₊ with Nat.Prime p, f (p ^ k)

            A sum over prime powers may be written as a double sum over exponents and then primes.

            theorem Chebyshev.sum_PrimePow_eq_sum_sum {R : Type u_1} [AddCommMonoid R] (f : ℕ → R) {x : ℝ} (hx : 0 ≤ x) :
            ∑ n ∈ Finset.Ioc 0 ⌊x⌋₊ with IsPrimePow n, f n = ∑ k ∈ Finset.Icc 1 ⌊Real.log x / Real.log 2⌋₊, ∑ p ∈ Finset.Ioc 0 ⌊x ^ (1 / ↑k)⌋₊ with Nat.Prime p, f (p ^ k)
            theorem Chebyshev.psi_eq_sum_theta' {x : ℝ} (hx : 0 ≤ x) {N : ℕ} (hN : ⌊Real.log x / Real.log 2⌋₊ ≤ N) :
            psi x = ∑ n ∈ Finset.Icc 1 N, theta (x ^ (1 / ↑n))
            theorem Chebyshev.psi_eq_sum_theta {x : ℝ} (hx : 0 ≤ x) :
            psi x = ∑ n ∈ Finset.Icc 1 ⌊Real.log x / Real.log 2⌋₊, theta (x ^ (1 / ↑n))
            theorem Chebyshev.psi_eq_theta_add_sum_theta' {x : ℝ} (hx : 2 ≤ x) {N : ℕ} (hN : ⌊Real.log x / Real.log 2⌋₊ ≤ N) :
            psi x = theta x + ∑ n ∈ Finset.Icc 2 N, theta (x ^ (1 / ↑n))
            theorem Chebyshev.psi_eq_theta_add_sum_theta {x : ℝ} (hx : 2 ≤ x) :
            psi x = theta x + ∑ n ∈ Finset.Icc 2 ⌊Real.log x / Real.log 2⌋₊, theta (x ^ (1 / ↑n))

            |ψ x - θ x| ≤ c √ x log x with an explicit constant c. To remove the log, see psi_sub_theta_le_mul_sqrt.

            theorem Chebyshev.psi_le {x : ℝ} (hx : 1 ≤ x) :

            Explicit upper bound on ψ.

            theorem Chebyshev.psi_le_const_mul_self {x : ℝ} (hx : 0 ≤ x) :
            psi x ≤ (Real.log 4 + 4) * x

            Chebyshev's bound ψ x ≤ c x with an explicit constant. Note that Chebyshev.psi_le gives a sharper bound with a better main term.

            ψ - θ is the sum of Λ over non-primes.

            theorem Chebyshev.psi_ge (n : ℕ) :
            ↑n * Real.log 2 - Real.log (↑n + 1) ≤ psi ↑n

            The Chebyshev lower bound for ψ.

            theorem Chebyshev.psi_ge' {x : ℝ} (hx : 0 ≤ x) :
            (x - 1) * Real.log 2 - Real.log (x + 2) ≤ psi x
            theorem Chebyshev.psi_sub_theta_le {x : ℝ} (hx : 1 ≤ x) :
            theorem Chebyshev.theta_ge (n : ℕ) :
            ↑n * Real.log 2 - Real.log (↑n + 1) - 2 * √↑n * Real.log ↑n ≤ theta ↑n

            The Chebyshev lower bound for θ.

            theorem Chebyshev.theta_ge' {x : ℝ} (hx : 1 ≤ x) :
            (x - 1) * Real.log 2 - Real.log (x + 2) - 2 * √x * Real.log x ≤ theta x

            The Costa-Pereira inequalities #

            The Costa-Pereira inequalities give explicit upper and lower bounds on the difference ψ x - θ x, namely that they lie between ψ x^(1/2) + ψ x^(1/3) + ψ x^(1/7) and ψ x^(1/2) + ψ x^(1/3) + ψ x^(1/5). These are useful for applications in explicit analytic number theory.

            theorem Chebyshev.psi_sub_theta_le_mul_sqrt :
            ∃ (C : ℝ), ∀ (x : ℝ), psi x - theta x ≤ C * √x

            ψ x = θ x + O( √x ).

            Relation to prime counting #

            We relate θ to the prime counting function π.

            Expresses the prime counting function π in terms of θ by using Abel summation.

            Expresses the Chebyshev theta function ϑ in terms of π by using Abel summation.

            theorem Chebyshev.intervalIntegrable_one_div_log_sq {a b : ℝ} (one_lt_a : 1 < a) (one_lt_b : 1 < b) :
            theorem Chebyshev.integral_one_div_log_sq_isBigO :
            (fun (x : ℝ) => ∫ (t : ℝ) in 2..x, 1 / Real.log t ^ 2) =O[Filter.atTop] fun (x : ℝ) => x / Real.log x ^ 2
            theorem Chebyshev.integral_theta_div_log_sq_isLittleO :
            (fun (x : ℝ) => ∫ (t : ℝ) in 2..x, theta t / (t * Real.log t ^ 2)) =o[Filter.atTop] fun (x : ℝ) => x / Real.log x

            Chebyshev's upper bound on the prime counting function

            theorem Chebyshev.pi_ge (n : ℕ) :
            (↑n * Real.log 2 - Real.log (↑n + 1)) / Real.log ↑n ≤ ↑n.primeCounting
            theorem Chebyshev.pi_ge' {x : ℝ} (hx : 1 < x) :

            A weak but completely explicit upper bound on $\pi(x)$.

            Extension for the positivity tactic: the first Chebyshev function is nonnegative.

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

              Extension for the positivity tactic: the second Chebyshev function is nonnegative.

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