Development/AutomorphicArithmetic/DedekindLFunctions/LandauTheorems/landauTails.lean
1import Development.AutomorphicArithmetic.DedekindLFunctions.LandauZeroFreeCriterion2import Development.AutomorphicArithmetic.DedekindLFunctions.LandauTheorems.kernelIntegral34open Complex MeasureTheory Set Filter Topology56noncomputable section78namespace Deduction910lemma landau_tails_integrable (k : ℕ) {a : ℝ} (ha : 0 < a) :11IntegrableOn (fun u : ℝ => u ^ k * Real.exp (-a * u) / (k.factorial : ℝ)) (Ioi 0) := by12by_contra h13have h1 := kernel_integral k a ha14rw [integral_undef h] at h115have : 0 < (a ^ (k + 1))⁻¹ := by positivity16linarith1718lemma landau_tails_chernoff (k : ℕ) {s l U V : ℝ} (hl : 0 ≤ l) (hs : l < s) :19∫ u in Ioi (0 : ℝ) \ Icc U V, u ^ k * Real.exp (-s * u) / (k.factorial : ℝ) ≤20Real.exp (-(l * V)) * ((s - l) ^ (k + 1))⁻¹ + Real.exp (l * U) * ((s + l) ^ (k + 1))⁻¹ := by21have ha : 0 < s - l := by linarith22have hb : 0 < s + l := by linarith23have hs0 : 0 < s := by linarith24have i1 := (landau_tails_integrable k ha).const_mul (Real.exp (-(l * V)))25have i2 := (landau_tails_integrable k hb).const_mul (Real.exp (l * U))26have i0 := landau_tails_integrable k hs027have i3 := i1.add i228rw [← kernel_integral k _ ha, ← kernel_integral k _ hb, ← integral_const_mul, ← integral_const_mul,29← integral_add i1 i2]30have hm : MeasurableSet (Ioi (0 : ℝ) \ Icc U V) := measurableSet_Ioi.diff measurableSet_Icc31refine le_trans (setIntegral_mono_on (IntegrableOn.mono_set i0 sdiff_subset)32(IntegrableOn.mono_set i3 sdiff_subset) hm ?_) (setIntegral_mono_set i3 ?_ sdiff_subset.eventuallyLE)33· intro u hu34have hu0 : 0 < u := hu.135have hf : 0 < (k.factorial : ℝ) := by positivity36have hp : 0 ≤ u ^ k / (k.factorial : ℝ) := by positivity37have e1 : Real.exp (-(l * V)) * Real.exp (-(s - l) * u) = Real.exp (-s * u + l * (u - V)) := by38rw [← Real.exp_add]; congr 1; ring39have e2 : Real.exp (l * U) * Real.exp (-(s + l) * u) = Real.exp (-s * u + l * (U - u)) := by40rw [← Real.exp_add]; congr 1; ring41have key : Real.exp (-s * u) ≤ Real.exp (-s * u + l * (u - V)) + Real.exp (-s * u + l * (U - u)) := by42have hn := hu.243rw [mem_Icc, not_and_or, not_le, not_le] at hn44rcases hn with h | h45· have : Real.exp (-s * u) ≤ Real.exp (-s * u + l * (U - u)) :=46Real.exp_le_exp.2 (by nlinarith [mul_nonneg hl (sub_nonneg.2 h.le)])47linarith [Real.exp_pos (-s * u + l * (u - V))]48· have : Real.exp (-s * u) ≤ Real.exp (-s * u + l * (u - V)) :=49Real.exp_le_exp.2 (by nlinarith [mul_nonneg hl (sub_nonneg.2 h.le)])50linarith [Real.exp_pos (-s * u + l * (U - u))]