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

BKLNW_app.besselI0_sub_partial_le

PrimeNumberTheoremAnd.IEANTN.BKLNW.BKLNW_app · PrimeNumberTheoremAnd/IEANTN/BKLNW/BKLNW_app.lean:1045 to 1078

Mathematical statement

Exact Lean statement

lemma besselI0_sub_partial_le (x : ℝ) (N : ℕ) :
    besselI0 x - ∑ m ∈ Finset.range N, (x / 2) ^ (2 * m) / ((m.factorial : ℝ)) ^ 2 ≤
      (x / 2) ^ (2 * N) / ((N.factorial : ℝ)) ^ 2 * besselI0 x

Complete declaration

Lean source

Canonical source
Full Lean sourceLean 4
lemma besselI0_sub_partial_le (x : ) (N : ) :    besselI0 x - ∑ m  Finset.range N, (x / 2) ^ (2 * m) / ((m.factorial : )) ^ 2       (x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2 * besselI0 x := by  have hsum := besselI0_summable x  have hb : besselI0 x = ∑' m : , (x / 2) ^ (2 * m) / ((m.factorial : )) ^ 2 := rfl  have hsplit := hsum.sum_add_tsum_nat_add N  have hterm :  k : , (x / 2) ^ (2 * (k + N)) / (((k + N).factorial : )) ^ 2       (x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2 *        ((x / 2) ^ (2 * k) / ((k.factorial : )) ^ 2) := by    intro k    have hfact : (N.factorial : ) * (k.factorial : )  ((k + N).factorial : ) := by      exact_mod_cast Nat.le_of_dvd (k + N).factorial_pos        (by simpa [mul_comm] using Nat.factorial_mul_factorial_dvd_factorial_add k N)    have hN : (0 : ) < ((N.factorial : )) ^ 2 :=      pow_pos (by exact_mod_cast N.factorial_pos) 2    have hk : (0 : ) < ((k.factorial : )) ^ 2 :=      pow_pos (by exact_mod_cast k.factorial_pos) 2    have hNk : (0 : )  (N.factorial : ) * (k.factorial : ) := by positivity    rw [show 2 * (k + N) = 2 * N + 2 * k by ring, pow_add, div_mul_div_comm]    gcongr (x / 2) ^ (2 * N) * (x / 2) ^ (2 * k) / ?_ <;>      first        | exact mul_pos hN hk        | (rw [pow_mul, pow_mul]; positivity)        | nlinarith [hfact, hNk]  have htail : (∑' k : , (x / 2) ^ (2 * (k + N)) / (((k + N).factorial : )) ^ 2)       (x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2 * besselI0 x := by    calc (∑' k : , (x / 2) ^ (2 * (k + N)) / (((k + N).factorial : )) ^ 2)         ∑' k : , (x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2 *            ((x / 2) ^ (2 * k) / ((k.factorial : )) ^ 2) :=          Summable.tsum_le_tsum hterm ((summable_nat_add_iff N).mpr hsum)            (hsum.mul_left ((x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2))      _ = (x / 2) ^ (2 * N) / ((N.factorial : )) ^ 2 * besselI0 x := by          rw [tsum_mul_left,  hb]  linarith [hsplit, htail, hb.le, hb.ge]