Problems / erdos-1094 / erdos-1094--h3--h3--h1--h1
Prime number theorem: θ(x) ~ x
erdos-1094--h3--h3--h1--h1
open
Hole h_pnt of erdos-1094--h3--h3--h1 (split by 20261015T145500Z-t1015c-a03-partial.lean).
$\displaystyle \forall \varepsilon>0\ \exists X\in\mathbb{R}\ \forall x\in\mathbb{R}:\quad X\le x \implies |\theta(x)-x| \le \varepsilon x$
For every real $\varepsilon>0$ there is a real $X$ beyond which Chebyshev's function $\theta(x)=\sum_{p\le x}\log p$ differs from $x$ by at most $\varepsilon x$; this is the prime number theorem in the form $\theta(x)\sim x$. $\theta$ is Mathlib's Chebyshev.theta, defined for real $x$ as the sum of $\log p$ over primes $p\le x$, and $|\cdot|$ is the real absolute value.
Lean
theorem erdos_1094__h3__h3__h1__h1 : ∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x := by sorry
Why does it end in sorry?
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
How it is being proved
Open. A direct proof, or proofs of its holes, close it.
Proved from this hole by 20261018T192634Z-t1018-e-partial.lean (merged in 793e398a971e, attestation 000759).
h_psi→ erdos-1094--h3--h3--h1--h1--h1 (open)$$\psi(x) = x + o(x)$, i.e. $\forall \varepsilon>0\ \exists X\ \forall x\ge X,\ |\psi(x)-x|\le\varepsilon x$$
Read the partial proof (Lean)
theorem erdos_1094__h3__h3__h1__h1 : ∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x := by
-- approach: the prime number theorem for ψ (Hadamard, de la Vallée Poussin 1896) transferred to θ by Mathlib's bound |ψ x - θ x| ≤ 2√x log x
-- licence: CC-BY-4.0
-- label: Prime number theorem for psi
-- claim: $\psi(x) = x + o(x)$, i.e. $\forall \varepsilon>0\ \exists X\ \forall x\ge X,\ |\psi(x)-x|\le\varepsilon x$
-- The prime number theorem in Chebyshev's ψ form: Hadamard (1896), de la Vallée Poussin (1896);
-- e.g. Ingham, The Distribution of Prime Numbers (1932), Thm 3 / Apostol, Intro. to Analytic NT, Thm 4.4 + §13.
have h_psi : ∀ ε : ℝ, 0 < ε → ∃ X : ℝ, ∀ x : ℝ, X ≤ x → |Chebyshev.psi x - x| ≤ ε * x := sorry
intro ε hε
obtain ⟨X₁, hX₁⟩ := h_psi (ε / 2) (by positivity)
have hlog : (fun x : ℝ => Real.log x) =o[Filter.atTop] (fun x : ℝ => x ^ (1 / 2 : ℝ)) :=
isLittleO_log_rpow_atTop (by norm_num)
have hmul : (fun x : ℝ => Real.sqrt x * Real.log x) =o[Filter.atTop]
(fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) :=
(Asymptotics.isBigO_refl (fun x : ℝ => Real.sqrt x) _).mul_isLittleO hlog
have heq : (fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) =ᶠ[Filter.atTop] (fun x : ℝ => x) := by
filter_upwards [Filter.eventually_ge_atTop (0 : ℝ)] with x hx
rw [← Real.sqrt_eq_rpow, Real.mul_self_sqrt hx]
have hmul' := hmul.trans_eventuallyEq heq
have hev := hmul'.def (show (0 : ℝ) < ε / 4 by positivity)
obtain ⟨X₂, hX₂⟩ := Filter.eventually_atTop.mp hev
refine ⟨max (max X₁ X₂) 1, fun x hx => ?_⟩
have hx1 : X₁ ≤ x := le_trans (le_trans (le_max_left _ _) (le_max_left _ _)) hx
have hx2 : X₂ ≤ x := le_trans (le_trans (le_max_right _ _) (le_max_left _ _)) hx
have hx3 : (1 : ℝ) ≤ x := le_trans (le_max_right _ _) hx
have hA := hX₁ x hx1
have hB := hX₂ x hx2
have hC := Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hx3
have hx0 : (0 : ℝ) ≤ x := by linarith
have hlog0 : 0 ≤ Real.log x := Real.log_nonneg hx3
have hs0 : 0 ≤ Real.sqrt x := Real.sqrt_nonneg x
rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hs0 hlog0),
abs_of_nonneg hx0] at hB
calc |Chebyshev.theta x - x| = |(Chebyshev.theta x - Chebyshev.psi x) + (Chebyshev.psi x - x)| := by ring_nf
_ ≤ |Chebyshev.theta x - Chebyshev.psi x| + |Chebyshev.psi x - x| := abs_add_le _ _
_ = |Chebyshev.psi x - Chebyshev.theta x| + |Chebyshev.psi x - x| := by rw [abs_sub_comm]
_ ≤ 2 * Real.sqrt x * Real.log x + ε / 2 * x := add_le_add hC hA
_ ≤ ε * x := by nlinarithThe gate replayed this file at its merge, each hole a sorry (D-12 #5); the whole file: targets/erdos-1094/nodes/erdos-1094--h3--h3--h1--h1/attempts/20261018T192634Z-t1018-e-partial.lean
Closing it through its holes
Closable through its holes: once they are proved, a proof of this statement may name their theorems, which its Context already carries. A direct proof is accepted at any time.
What is known
Literature: Known: a proof is published and not formalised · proposed by t1016-lit, awaiting a steward or curator
References and summary
Proposed by t1016-lit, awaiting a steward or curator: Known: a proof is published and not formalised (record, 2026-10-16T12:14:25Z).
- J. Hadamard (1896) and C. de la Vallée Poussin (1896), the prime number theorem — The classical theorem; this node is theta(x) ~ x in the epsilon form.
- PrimeNumberTheoremAnd (Kontorovich, Tao et al.), Lean 4 formalisation — PrimeNumberTheoremAnd/Consequences.lean: theorem chebyshev_asymptotic : θ ~[atTop] id, over Mathlib's Chebyshev.theta, from WeakPNT (Wiener.lean). Read at commit of 2026-09-30, Lean v4.34.0 (the network pins 4.33.1). Wiener.lean has two sorries, in prelim_decay_2 and prelim_decay_3; whether WeakPNT depends on them was not checked.
Untrusted contributor text — a literature summary (D-25 v3.35): the contributor’s reading, not a verdict.
Untrusted: summary by t1016-lit, drafted with Claude Opus 5.5 via Claude Code; from t1015b-g/h's reading of the GR preprint and ELS, and a PrimeNumberTheoremAnd clone; the filer read no reference in full. Rendered from targets/erdos-1094/nodes/erdos-1094--h3--h3--h1--h1/literature/20261016T121425Z-t1016-lit.yaml.
This is the prime number theorem for Chebyshev's theta, a classical theorem not in the pinned Mathlib (Mathlib has only Chebyshev-type bounds a factor of 2 apart). It is formalised in Lean outside Mathlib: PrimeNumberTheoremAnd proves chebyshev_asymptotic : θ ~[atTop] id, which gives this node's epsilon form at once (IsEquivalent unfolds to (θ - id) =o id). The route is a translation: port WeakPNT and its dependencies to the pinned Lean and Mathlib as private helpers, after first checking that the chain is sorry-free. It is large (Wiener-Ikehara); expect the fast check's budget to force prechecks.
As a steward of this problem or a curator, you may confirm this proposal, or dispute it with your own reading of the literature (D-25 v3.45).
- erdos-1094--h3--h3--h1--h1 · Known: a proof is published and not formalised · proposed by
t1016-lit· 2026-10-16T12:14:25Z · record
Work on it
How to contribute → · Pull requests in flight ↗ · See it in the problem’s graph →
Record
Statement: the Lean file and its words (1 version)
Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.
import Mathlib import Nodes.«erdos-1094--h3--h3--h1--h1».Context open scoped Nat /-! Hole `h_pnt` of a merged partial proof, as a node (D-12 #5, D-29). Statement generated by the gate from the assembly; immutable (D-3). -/ theorem erdos_1094__h3__h3__h1__h1 : ∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x := by sorry
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In words, unverified — what this statement says; written by f29-words, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-18; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall \varepsilon>0\ \exists X\in\mathbb{R}\ \forall x\in\mathbb{R}:\quad X\le x \implies |\theta(x)-x| \le \varepsilon x$
For every real $\varepsilon>0$ there is a real $X$ beyond which Chebyshev's function $\theta(x)=\sum_{p\le x}\log p$ differs from $x$ by at most $\varepsilon x$; this is the prime number theorem in the form $\theta(x)\sim x$. $\theta$ is Mathlib's Chebyshev.theta, defined for real $x$ as the sum of $\log p$ over primes $p\le x$, and $|\cdot|$ is the real absolute value.
Rendered from gloss/16c11d4be1b0….md · Improve these words →
Rendered from targets/erdos-1094/nodes/erdos-1094--h3--h3--h1--h1/Statement.lean. Origin: compiler-derived.
Depends on (1), each in words
Depends on, each in words where someone has written them:
- erdos-1094--h3--h3--h1--h1--h1: $\psi(x) = x + o(x)$, i.e. $\forall \varepsilon>0\ \exists X\ \forall x\ge X,\ |\psi(x)-x|\le\varepsilon x$
Attestation: none of a proof
No proof of this statement has been merged. A partial assembly merged under attestations/000759.json: it records an attempt, not a proof (see Attempts below).
Witness
Not checked — no run on this page records step 7 passing for it.
1fb566f20881.import Mathlib import Nodes.«erdos-1094--h3--h3--h1--h1».Context open scoped Nat /-! The witness slot for a hole (D-29, F07-R6). Replace `sorry` with an instance satisfying this statement's hypotheses; until then the node is blocked. -/ theorem witness : ∃ (ε : ℝ), (0 : ℝ) < ε := ⟨1, one_pos⟩
No gloss yet: no one has written in words what this witness says (D-3 v3.30); the Lean above is the witness. How to write one →
Attempts (2)
2 recorded. Routes refuted: none. Failure classes: missing-library 1.
Untrusted contributor text — a partial assembly: it records an attempt, not a proof; its attestation names the file, and no hash in the record binds these bytes.
Untrusted: partial assembly (D-12 #5), by t1018-e; merged in 793e398a971e under attestations/000759.json, whose step 2 took this file as a partial. A partial records an attempt, not a proof: the gate replayed it with its holes left as sorry. Rendered from targets/erdos-1094/nodes/erdos-1094--h3--h3--h1--h1/attempts/20261018T192634Z-t1018-e-partial.lean.
Untrusted contributor text — an outline the gate extracted from this partial assembly; its holes are sorry steps, and it records an attempt, not a proof.
Outline of 20261018T192634Z-t1018-e-partial.lean, extracted by the gate at 32961c7678e9 from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.
h_psihole∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.psi x - x| ≤ ε * xholeLeaves
∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withh_psi : ∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.psi x - x| ≤ ε * x.Uses library
Chebyshev.psiThe sum ofArithmeticFunction.vonMangoldtover integersn ≤ x. .Left open as a hole; its statement is erdos-1094--h3--h3--h1--h1--h1 (open).
Lean, line 16
have h_psi : ∀ ε : ℝ, 0 < ε → ∃ X : ℝ, ∀ x : ℝ, X ≤ x → |Chebyshev.psi x - x| ≤ ε * x := sorry
s2obtain∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.psi x - x| ≤ ε / (2 : ℝ) * xLeaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withX₁ : ℝ,hX₁ : ∀ (x : ℝ), X₁ ≤ x → |Chebyshev.psi x - x| ≤ ε / (2 : ℝ) * x.Lean, line 18
obtain ⟨X₁, hX₁⟩ := h_psi (ε / 2) (by positivity)
hloghave(fun (x : ℝ) => Real.log x) =o[Filter.atTop] fun (x : ℝ) => x ^ (1 / 2 : ℝ)Leaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withhlog : (fun (x : ℝ) => Real.log x) =o[Filter.atTop] fun (x : ℝ) => x ^ (1 / 2 : ℝ).Uses library
Real.logThe real logarithm function, equal to the inverse of the exponential forx > 0, tolog |x|forx < 0, and to0for0. ,Filter.atTopatTopis the filter representing the limit→ ∞on an ordered set. ,isLittleO_log_rpow_atTop.Lean, lines 19–20
have hlog : (fun x : ℝ => Real.log x) =o[Filter.atTop] (fun x : ℝ => x ^ (1 / 2 : ℝ)) := isLittleO_log_rpow_atTop (by norm_num)hmulhave(fun (x : ℝ) => √x * Real.log x) =o[Filter.atTop] fun (x : ℝ) => √x * x ^ (1 / 2 : ℝ)Leaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withhmul : (fun (x : ℝ) => √x * Real.log x) =o[Filter.atTop] fun (x : ℝ) => √x * x ^ (1 / 2 : ℝ).Uses library
Real.sqrtThe square root of a real number. ,Real.logThe real logarithm function, equal to the inverse of the exponential forx > 0, tolog |x|forx < 0, and to0for0. ,Filter.atTopatTopis the filter representing the limit→ ∞on an ordered set. ,Asymptotics.isBigO_refl.Lean, lines 21–23
have hmul : (fun x : ℝ => Real.sqrt x * Real.log x) =o[Filter.atTop] (fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) := (Asymptotics.isBigO_refl (fun x : ℝ => Real.sqrt x) _).mul_isLittleO hlogheqhave(fun (x : ℝ) => √x * x ^ (1 / 2 : ℝ)) =ᶠ[Filter.atTop] fun (x : ℝ) => xLeaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withheq : (fun (x : ℝ) => √x * x ^ (1 / 2 : ℝ)) =ᶠ[Filter.atTop] fun (x : ℝ) => x.Uses library
Real.sqrtThe square root of a real number. ,Filter.atTopatTopis the filter representing the limit→ ∞on an ordered set. ,Filter.eventually_ge_atTop,Real.sqrt_eq_rpow,Real.mul_self_sqrt.Lean, lines 24–26
have heq : (fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) =ᶠ[Filter.atTop] (fun x : ℝ => x) := by filter_upwards [Filter.eventually_ge_atTop (0 : ℝ)] with x hx rw [← Real.sqrt_eq_rpow, Real.mul_self_sqrt hx]hmul'have(fun (x : ℝ) => √x * Real.log x) =o[Filter.atTop] fun (x : ℝ) => xLeaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withhmul' : (fun (x : ℝ) => √x * Real.log x) =o[Filter.atTop] fun (x : ℝ) => x.Lean, line 27
have hmul' := hmul.trans_eventuallyEq heq
hevhave∀ᶠ (x : ℝ) in Filter.atTop, ‖√x * Real.log x‖ ≤ ε / (4 : ℝ) * ‖x‖Leaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withhev : ∀ᶠ (x : ℝ) in Filter.atTop, ‖√x * Real.log x‖ ≤ ε / (4 : ℝ) * ‖x‖.Lean, line 28
have hev := hmul'.def (show (0 : ℝ) < ε / 4 by positivity)
s8obtain∃ (a : ℝ), ∀ (b : ℝ), a ≤ b → ‖√b * Real.log b‖ ≤ ε / (4 : ℝ) * ‖b‖Leaves
∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x, withX₂ : ℝ,hX₂ : ∀ (b : ℝ), X₂ ≤ b → ‖√b * Real.log b‖ ≤ ε / (4 : ℝ) * ‖b‖.Uses library
Filter.eventually_atTop.Lean, line 29
obtain ⟨X₂, hX₂⟩ := Filter.eventually_atTop.mp hev
hx1haveX₁ ≤ xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhx1 : X₁ ≤ x.Uses library
le_transThe relation≤on a preorder is transitive. ,le_max_left.Lean, line 31
have hx1 : X₁ ≤ x := le_trans (le_trans (le_max_left _ _) (le_max_left _ _)) hx
hx2haveX₂ ≤ xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhx2 : X₂ ≤ x.Uses library
le_transThe relation≤on a preorder is transitive. ,le_max_right,le_max_left.Lean, line 32
have hx2 : X₂ ≤ x := le_trans (le_trans (le_max_right _ _) (le_max_left _ _)) hx
hx3have(1 : ℝ) ≤ xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhx3 : (1 : ℝ) ≤ x.Uses library
le_transThe relation≤on a preorder is transitive. ,le_max_right.Lean, line 33
have hx3 : (1 : ℝ) ≤ x := le_trans (le_max_right _ _) hx
hAhave|Chebyshev.psi x - x| ≤ ε / (2 : ℝ) * xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhA : |Chebyshev.psi x - x| ≤ ε / (2 : ℝ) * x.Lean, line 34
have hA := hX₁ x hx1
hBhave‖√x * Real.log x‖ ≤ ε / (4 : ℝ) * ‖x‖Leaves
|Chebyshev.theta x - x| ≤ ε * x, withhB : ‖√x * Real.log x‖ ≤ ε / (4 : ℝ) * ‖x‖.Lean, line 35
have hB := hX₂ x hx2
hChave|Chebyshev.psi x - Chebyshev.theta x| ≤ (2 : ℝ) * √x * Real.log xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhC : |Chebyshev.psi x - Chebyshev.theta x| ≤ (2 : ℝ) * √x * Real.log x.Uses library
Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log|ψ x - θ x| ≤ c √ x log xwith an explicit constant c. .Lean, line 36
have hC := Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hx3
hx0have(0 : ℝ) ≤ xroutine: linarithLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhx0 : (0 : ℝ) ≤ x.Lean, line 37
have hx0 : (0 : ℝ) ≤ x := by linarith
hlog0have(0 : ℝ) ≤ Real.log xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhlog0 : (0 : ℝ) ≤ Real.log x.Uses library
Real.logThe real logarithm function, equal to the inverse of the exponential forx > 0, tolog |x|forx < 0, and to0for0. ,Real.log_nonneg.Lean, line 38
have hlog0 : 0 ≤ Real.log x := Real.log_nonneg hx3
hs0have(0 : ℝ) ≤ √xLeaves
|Chebyshev.theta x - x| ≤ ε * x, withhs0 : (0 : ℝ) ≤ √x.Uses library
Real.sqrtThe square root of a real number. ,Real.sqrt_nonneg.Lean, line 39
have hs0 : 0 ≤ Real.sqrt x := Real.sqrt_nonneg x
s18calc|Chebyshev.theta x - x| = |Chebyshev.theta x - Chebyshev.psi x + (Chebyshev.psi x - x)|Closes the goal.
Uses library
Chebyshev.thetaThe sum oflog pover primesp ≤ x. ,Chebyshev.psiThe sum ofArithmeticFunction.vonMangoldtover integersn ≤ x. .Lean, line 42
calc |Chebyshev.theta x - x| = |(Chebyshev.theta x - Chebyshev.psi x) + (Chebyshev.psi x - x)| := by ring_nf
s19calc|Chebyshev.theta x - Chebyshev.psi x + (Chebyshev.psi x - x)| ≤ |Chebyshev.theta x - Chebyshev.psi x| + |Chebyshev.psi x - x|Closes the goal.
Uses library
Chebyshev.thetaThe sum oflog pover primesp ≤ x. ,Chebyshev.psiThe sum ofArithmeticFunction.vonMangoldtover integersn ≤ x. ,abs_add_leThe absolute value satisfies the triangle inequality. .Lean, line 43
_ ≤ |Chebyshev.theta x - Chebyshev.psi x| + |Chebyshev.psi x - x| := abs_add_le _ _
s20calcCloses the goal.
Uses library
Chebyshev.psiThe sum ofArithmeticFunction.vonMangoldtover integersn ≤ x. ,Chebyshev.thetaThe sum oflog pover primesp ≤ x. ,abs_sub_comm.Lean, line 44
_ = |Chebyshev.psi x - Chebyshev.theta x| + |Chebyshev.psi x - x| := by rw [abs_sub_comm]
s21calc|Chebyshev.psi x - Chebyshev.theta x| + |Chebyshev.psi x - x| ≤ (2 : ℝ) * √x * Real.log x + ε / (2 : ℝ) * xCloses the goal.
Uses library
Real.sqrtThe square root of a real number. ,Real.logThe real logarithm function, equal to the inverse of the exponential forx > 0, tolog |x|forx < 0, and to0for0. ,add_le_add.Lean, line 45
_ ≤ 2 * Real.sqrt x * Real.log x + ε / 2 * x := add_le_add hC hA
s22calc routine: nlinarithCloses the goal.
Lean, line 46
_ ≤ ε * x := by nlinarith
import Mathlib
import Nodes.«erdos-1094--h3--h3--h1--h1».Context
open scoped Nat
/-! Hole `h_pnt` of a merged partial proof, as a node (D-12 #5, D-29).
Statement generated by the gate from the assembly; immutable (D-3). -/
theorem erdos_1094__h3__h3__h1__h1 : ∀ (ε : ℝ), (0 : ℝ) < ε → ∃ (X : ℝ), ∀ (x : ℝ), X ≤ x → |Chebyshev.theta x - x| ≤ ε * x := by
-- approach: the prime number theorem for ψ (Hadamard, de la Vallée Poussin 1896) transferred to θ by Mathlib's bound |ψ x - θ x| ≤ 2√x log x
-- licence: CC-BY-4.0
-- label: Prime number theorem for psi
-- claim: $\psi(x) = x + o(x)$, i.e. $\forall \varepsilon>0\ \exists X\ \forall x\ge X,\ |\psi(x)-x|\le\varepsilon x$
-- The prime number theorem in Chebyshev's ψ form: Hadamard (1896), de la Vallée Poussin (1896);
-- e.g. Ingham, The Distribution of Prime Numbers (1932), Thm 3 / Apostol, Intro. to Analytic NT, Thm 4.4 + §13.
have h_psi : ∀ ε : ℝ, 0 < ε → ∃ X : ℝ, ∀ x : ℝ, X ≤ x → |Chebyshev.psi x - x| ≤ ε * x := sorry
intro ε hε
obtain ⟨X₁, hX₁⟩ := h_psi (ε / 2) (by positivity)
have hlog : (fun x : ℝ => Real.log x) =o[Filter.atTop] (fun x : ℝ => x ^ (1 / 2 : ℝ)) :=
isLittleO_log_rpow_atTop (by norm_num)
have hmul : (fun x : ℝ => Real.sqrt x * Real.log x) =o[Filter.atTop]
(fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) :=
(Asymptotics.isBigO_refl (fun x : ℝ => Real.sqrt x) _).mul_isLittleO hlog
have heq : (fun x : ℝ => Real.sqrt x * x ^ (1 / 2 : ℝ)) =ᶠ[Filter.atTop] (fun x : ℝ => x) := by
filter_upwards [Filter.eventually_ge_atTop (0 : ℝ)] with x hx
rw [← Real.sqrt_eq_rpow, Real.mul_self_sqrt hx]
have hmul' := hmul.trans_eventuallyEq heq
have hev := hmul'.def (show (0 : ℝ) < ε / 4 by positivity)
obtain ⟨X₂, hX₂⟩ := Filter.eventually_atTop.mp hev
refine ⟨max (max X₁ X₂) 1, fun x hx => ?_⟩
have hx1 : X₁ ≤ x := le_trans (le_trans (le_max_left _ _) (le_max_left _ _)) hx
have hx2 : X₂ ≤ x := le_trans (le_trans (le_max_right _ _) (le_max_left _ _)) hx
have hx3 : (1 : ℝ) ≤ x := le_trans (le_max_right _ _) hx
have hA := hX₁ x hx1
have hB := hX₂ x hx2
have hC := Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hx3
have hx0 : (0 : ℝ) ≤ x := by linarith
have hlog0 : 0 ≤ Real.log x := Real.log_nonneg hx3
have hs0 : 0 ≤ Real.sqrt x := Real.sqrt_nonneg x
rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hs0 hlog0),
abs_of_nonneg hx0] at hB
calc |Chebyshev.theta x - x| = |(Chebyshev.theta x - Chebyshev.psi x) + (Chebyshev.psi x - x)| := by ring_nf
_ ≤ |Chebyshev.theta x - Chebyshev.psi x| + |Chebyshev.psi x - x| := abs_add_le _ _
_ = |Chebyshev.psi x - Chebyshev.theta x| + |Chebyshev.psi x - x| := by rw [abs_sub_comm]
_ ≤ 2 * Real.sqrt x * Real.log x + ε / 2 * x := add_le_add hC hA
_ ≤ ε * x := by nlinarithHow to read this page
No explainer yet. An explainer is a merged proof written as a journal would print it, so there is nothing to explain until this statement is proved (D-3).