AlexKontorovich/PrimeNumberTheoremAnd
Source indexedtheorem · leanprover/lean4:v4.32.0
FKS2.corollary_24_row3
PrimeNumberTheoremAnd.IEANTN.FKS2Cor24Row3 · PrimeNumberTheoremAnd/IEANTN/FKS2Cor24Row3.lean:112 to 141
Source documentation
FKS2 Corollary 24, row 3
(table7 entry (x ↦ (1/(8π))·(log x)²·x^{-1/2}, Icc 8 60.8)):
Eπ x ≤ (1/(8π))·(log x)²·x^{-1/2} whenever log x ∈ [8, 60.8]. For x > 0 this
splits into the three segments above; for x < 0 (possible since log is even) the
exponent -(1)/2 gives cos((-(1)/2)·π) = cos(-π/2) = 0, so x^{-1/2} = 0 and the RHS
is 0, while Eπ x ≤ 0.
Exact Lean statement
theorem corollary_24_row3 :
∀ x, Real.log x ∈ Set.Icc (8:ℝ) 60.8 →
Eπ x ≤ (1 / (8 * π)) * (Real.log x) ^ 2 * x ^ (-(1:ℝ) / 2)Complete declaration
Lean source
Full Lean sourceLean 4
theorem corollary_24_row3 : ∀ x, Real.log x ∈ Set.Icc (8:ℝ) 60.8 → Eπ x ≤ (1 / (8 * π)) * (Real.log x) ^ 2 * x ^ (-(1:ℝ) / 2) := by intro x hlog obtain ⟨hlo, hhi⟩ := hlog rcases lt_trichotomy x 0 with hxneg | hx0 | hxpos · -- x < 0: `x^{-1/2} = exp(...)·cos(-π/2) = 0`, so RHS = 0; and `Eπ x ≤ 0` have hLpos : (0:ℝ) < Real.log x := by linarith have hEle0 : Eπ x ≤ 0 := by unfold Eπ apply div_nonpos_of_nonneg_of_nonpos (abs_nonneg _) exact le_of_lt (div_neg_of_neg_of_pos hxneg hLpos) have hxhalf0 : x ^ (-(1:ℝ) / 2) = 0 := by rw [Real.rpow_def_of_neg hxneg, show (-(1:ℝ) / 2) * π = -(π / 2) by ring, Real.cos_neg, Real.cos_pi_div_two, mul_zero] rw [hxhalf0, mul_zero] exact hEle0 · -- x = 0: `log 0 = 0` contradicts `8 ≤ log x` exfalso; rw [hx0, Real.log_zero] at hlo; linarith · -- x > 0: dispatch to the three segments split at `log x = 9, 43` have cvt : ∀ a b : ℝ, a ≤ Real.log x → Real.log x ≤ b → x ∈ Set.Icc (Real.exp a) (Real.exp b) := by intro a b ha hb exact ⟨by rw [← Real.exp_log hxpos]; exact Real.exp_le_exp.mpr ha, by rw [← Real.exp_log hxpos]; exact Real.exp_le_exp.mpr hb⟩ rcases le_total (Real.log x) 9 with h1 | h1 · exact floor_trusted_row3 x (cvt 8 9 hlo h1) · rcases le_total (Real.log x) 43 with h2 | h2 · exact floor_row3 x (cvt 9 43 h1 h2) · exact band_row3 x (cvt 43 60.8 h2 hhi)