All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257c8e4

Chebyshev asymptotic pnt

chebyshev_asymptotic_pnt

Project documentation

A prime number theorem in arithmetic progressions, in Chebyshev-weighted form. If q1q\ge1, a<qa<q, and gcd(a,q)=1\gcd(a,q)=1, then pxpa(modq)logpxφ(q)\sum_{\substack{p\le x\\p\equiv a\pmod q}}\log p\sim\frac{x}{\varphi(q)} as xx\to\infty.

Exact Lean statement

@[blueprint
  "chebyshev-asymptotic-pnt"
  (title := "Prime number theorem in AP")
  (statement := /--
  If $a\ (q)$ is a primitive residue class, then one has
  $$ \sum_{p \leq x: p = a\ (q)} \log p = \frac{x}{\phi(q)} + o(x).$$
  -/)
  (proof := /--
  This is a routine modification of the proof of Theorem \ref{chebyshev-asymptotic}.
  -/)
  (proofUses := ["chebyshev-asymptotic"])
  (latexEnv := "theorem")]
theorem chebyshev_asymptotic_pnt
    {q : ℕ} {a : ℕ} (hq : q ≥ 1) (ha : a.Coprime q) (ha' : a < q) :
    (fun x ↦ ∑ p ∈ filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then log p else 0) ~[atTop]
      fun x ↦ x / q.totient

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
@[blueprint  "chebyshev-asymptotic-pnt"  (title := "Prime number theorem in AP")  (statement := /--  If $a\ (q)$ is a primitive residue class, then one has  $$ \sum_{p \leq x: p = a\ (q)} \log p = \frac{x}{\phi(q)} + o(x).$$  -/)  (proof := /--  This is a routine modification of the proof of Theorem \ref{chebyshev-asymptotic}.  -/)  (proofUses := ["chebyshev-asymptotic"])  (latexEnv := "theorem")]theorem chebyshev_asymptotic_pnt    {q : } {a : } (hq : q  1) (ha : a.Coprime q) (ha' : a < q) :    (fun x  ∑ p  filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then log p else 0) ~[atTop]      fun x  x / q.totient := by  let ψ_aq :    := fun x  ∑ n  Icc 1 ⌊x⌋₊, if n % q = a then Λ n else 0  have htot_pos : (0 : ) < q.totient := cast_pos.mpr (totient_pos.mpr hq)  have hψ_equiv : ψ_aq ~[atTop] fun x  x / q.totient := by    have hW := WeakPNT_AP hq ha ha'    simp only [cumsum,  Iio_eq_range] at hW    have hψ_eq x : ψ_aq x = ∑ n  Iio (⌊x⌋₊ + 1), if n % q = a then Λ n else 0 := by      simp only [ψ_aq, show Icc 1 ⌊x⌋₊ = (Iio (⌊x⌋₊ + 1)).filter (1  ·) by        ext n; simp [mem_Icc, mem_filter]; tauto, sum_filter]      refine sum_congr rfl fun n _  ?_      by_cases hn : 1  n <;> simp only [hn, ↓reduceIte]      push Not at hn; interval_cases n; simp    refine (isEquivalent_iff_tendsto_one ?_).mpr ?_    · filter_upwards [eventually_ge_atTop 1] with x hx; exact div_ne_zero (by linarith) htot_pos.ne'    have hlim1 : Tendsto (fun x :   (∑ n  Iio (⌊x⌋₊ + 1), if n % q = a then Λ n else 0) /        (⌊x⌋₊ + 1 : )) atTop (nhds (1 / q.totient)) := by      have heq : (fun x :   (∑ n  Iio (⌊x⌋₊ + 1), if n % q = a then Λ n else 0) /          (⌊x⌋₊ + 1 : )) = (fun N  (∑ n  Iio N, if n % q = a then Λ n else 0) / N) ∘          (fun x :   ⌊x⌋₊ + 1) := by ext x; simp [Function.comp_apply]      exact heq ▸ hW.comp ((tendsto_add_atTop_nat 1).comp tendsto_nat_floor_atTop)    have hgoal_eq : (ψ_aq / fun x  x / (q.totient : )) =        fun x  ψ_aq x / x * q.totient := by ext x; simp only [Pi.div_apply, div_div_eq_mul_div]; ring    rw [hgoal_eq, show (1 : ) = 1 / q.totient * 1 * q.totient by field_simp]    refine Tendsto.mul ?_ tendsto_const_nhds    have heq' : (fun x  ψ_aq x / x) =ᶠ[atTop]        fun x  (∑ n  Iio (⌊x⌋₊ + 1), if n % q = a then Λ n else 0) / (⌊x⌋₊ + 1 : ) * ((⌊x⌋₊ + 1 : ) / x) := by      filter_upwards [eventually_gt_atTop 0] with x hx      simp only [hψ_eq]; field_simp    exact Tendsto.congr' heq'.symm (hlim1.mul tendsto_floor_add_one_div_self)  refine hψ_equiv.add_isLittleO'' (IsBigO.trans_isLittleO (g := fun x  2 * x.sqrt * x.log) ?_ ?_)  · rw [isBigO_iff']; refine 1, one_pos, eventually_atTop.mpr 2, fun x hx  ?_⟩⟩    simp only [Pi.sub_apply, norm_eq_abs, one_mul]    have hdiff_nonneg : 0  ψ_aq x - ∑ p  filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then log p else 0 := by      simp only [ψ_aq, sub_nonneg]      calc (∑ p  filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then log p else (0 : ))           ∑ p  filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then Λ p else (0 : ) :=            sum_le_sum fun p hp  by split_ifs <;> simp [vonMangoldt_apply_prime (mem_filter.mp hp).2]        _  ∑ n  Icc 1 ⌊x⌋₊, if n % q = a then Λ n else (0 : ) :=            sum_le_sum_of_subset_of_nonneg              (fun p hp  by simp only [mem_filter, mem_Iic, mem_Icc] at hp ; exact hp.2.one_lt.le, hp.1)              (fun n _ _  by split_ifs <;> [exact vonMangoldt_nonneg; rfl])    have hdiff_le : ψ_aq x - (∑ p  filter Nat.Prime (Iic ⌊x⌋₊), if p % q = a then log p else (0 : ))  ψ x - θ x := by      simp only [ψ_aq, Chebyshev.psi_eq_sum_Icc, Chebyshev.theta_eq_sum_Icc]      conv_rhs => rw [Icc_zero_eq_insert, sum_insert (by simp : (0 : )  Icc 1 ⌊x⌋₊),        show Λ 0 = 0 by simp only [ArithmeticFunction.map_zero], zero_add,        show filter Nat.Prime (insert 0 (Icc 1 ⌊x⌋₊)) = filter Nat.Prime (Icc 1 ⌊x⌋₊) by          simp [filter_insert, Nat.not_prime_zero]]      rw [filter_prime_Iic_eq_Icc,  sum_filter_add_sum_filter_not (Icc 1 ⌊x⌋₊) Nat.Prime,        show (∑ p  filter Nat.Prime (Icc 1 ⌊x⌋₊), if p % q = a then log p else (0 : )) =          ∑ p  filter Nat.Prime (Icc 1 ⌊x⌋₊), if p % q = a then Λ p else (0 : ) from          sum_congr rfl fun p hp  by simp only [mem_filter] at hp; split_ifs <;> simp [vonMangoldt_apply_prime hp.2],         sum_filter_add_sum_filter_not (Icc 1 ⌊x⌋₊) Nat.Prime,        show (∑ p  filter Nat.Prime (Icc 1 ⌊x⌋₊), Λ p) = ∑ p  filter Nat.Prime (Icc 1 ⌊x⌋₊), log p from          sum_congr rfl fun p hp  vonMangoldt_apply_prime (mem_filter.mp hp).2]      have h1 : (∑ n  (Icc 1 ⌊x⌋₊).filter (¬Nat.Prime ·), if n % q = a then Λ n else (0 : ))           ∑ n  (Icc 1 ⌊x⌋₊).filter (¬Nat.Prime ·), Λ n :=        sum_le_sum fun n _  by split_ifs <;> [exact le_refl _; exact vonMangoldt_nonneg]      linarith    rw [abs_of_nonneg hdiff_nonneg, abs_of_nonneg (by bound)]    exact hdiff_le.trans ((le_abs_self _).trans (Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log (by linarith)))  · simpa only [mul_assoc] using      (isLittleO_sqrt_mul_log.const_mul_left 2).trans_isTheta (isTheta_self_div_const htot_pos.ne')
Project
Prime Number Theorem and More
License
Apache-2.0
Commit
a93551347dce
Source
PrimeNumberTheoremAnd/Consequences.lean:2436-2512

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.32.0

Admissible bound mono

admissible_bound.mono

Plain-language statement

For positive parameters A,B,C,RA,B,C,R, the classical error-bound function A(logxR)Bexp ⁣(ClogxR)A\left(\frac{\log x}{R}\right)^B\exp\!\left(-C\sqrt{\frac{\log x}{R}}\right) is nonincreasing once xexp ⁣(R(2B/C)2)x\ge \exp\!\left(R(2B/C)^2\right).

analytic number theoryprime numbersasymptotics

Source project: Prime Number Theorem and More

Person-level attribution pending.

View proof record
Project-declaredLean 4.32.0

Analytic On div Removable zero

AnalyticOn_divRemovable_zero

Plain-language statement

Let ff be analytic on an open set ss containing 00, and suppose f(0)=0f(0)=0. Define g(z)=f(z)/zg(z)=f(z)/z for z0z\ne0 and g(0)=f(0)g(0)=f'(0). Then the apparent singularity at 00 is removable and gg is analytic throughout ss.

analytic number theoryprime numbersasymptotics

Source project: Prime Number Theorem and More

Person-level attribution pending.

View proof record
Project-declaredLean 4.32.0

Analytic On div Removable zero closed Ball

AnalyticOn_divRemovable_zero_closedBall

Plain-language statement

Suppose R>0R>0 and ff is analytic on the closed disc zR|z|\le R with f(0)=0f(0)=0. Define g(z)=f(z)/zg(z)=f(z)/z for z0z\ne0 and g(0)=f(0)g(0)=f'(0). Then gg is analytic on the entire closed disc, including at the removed singularity.

analytic number theoryprime numbersasymptotics

Source project: Prime Number Theorem and More

Person-level attribution pending.

View proof record