Skip to main content
AlexKontorovich/PrimeNumberTheoremAnd
Source indexedtheorem · leanprover/lean4:v4.32.0

FKS2.corollary_24_row5

PrimeNumberTheoremAnd.IEANTN.FKS2Cor24Row5 · PrimeNumberTheoremAnd/IEANTN/FKS2Cor24Row5.lean:91 to 119

Source documentation

FKS2 Corollary 24, row 5 (table7 entry (x ↦ (log x)³·x^{-1/2}, Icc 1 80)): Eπ x ≤ (log x)³·x^{-1/2} whenever log x ∈ [1, 80]. 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_row5 :
    ∀ x, Real.log x ∈ Set.Icc (1:ℝ) 80 → Eπ x ≤ (Real.log x) ^ 3 * x ^ (-(1:ℝ) / 2)

Complete declaration

Lean source

Canonical source
Full Lean sourceLean 4
theorem corollary_24_row5 :     x, Real.log x  Set.Icc (1:) 80  Eπ x  (Real.log x) ^ 3 * 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 `1 ≤ log x`    exfalso; rw [hx0, Real.log_zero] at hlo; linarith  · -- x > 0: dispatch to the three segments split at `log x = 3, 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) 3 with h1 | h1    · exact floor_trusted_row5 x (cvt 1 3 hlo h1)    · rcases le_total (Real.log x) 43 with h2 | h2      · exact floor_xhalf_row5 x (cvt 3 43 h1 h2)      · exact band_row5 x (cvt 43 80 h2 hhi)