(* Title: HOL/Probability/Sinc_Integral.thy Authors: Jeremy Avigad (CMU), Luke Serafin (CMU) Authors: Johannes Hölzl, TU München
*)
section ‹Integral of sinc›
theory Sinc_Integral imports Distributions begin
subsection ‹Various preparatory integrals›
text‹ Naming convention
The theorem name consists of the following parts: 🚫 Kind of integral: ‹has_bochner_integral› / ‹integrable› / ‹LBINT› 🚫 Interval: Interval (0 / infinity / open / closed) (infinity / open / closed) 🚫 Name of the occurring constants: power, exp, m (for minus), scale, sin, $\ldots$ ›
lemma shows integrable_inverse_1_plus_square: "set_integrable lborel (einterval (-\) \) (\x. inverse (1 + x^2))" and LBINT_inverse_1_plus_square: "LBINT x=-\..\. inverse (1 + x^2) = pi" proof - have 1: "- (pi / 2) < x \ x * 2 < pi \ (tan has_real_derivative 1 + (tan x)\<^sup>2) (at x)"for x using cos_gt_zero_pi[of x] by (subst tan_sec) (auto intro!: DERIV_tan simp: power_inverse) have 2: "- (pi / 2) < x \ x * 2 < pi \ isCont (\x. 1 + (tan x)\<^sup>2) x"for x using cos_gt_zero_pi[of x] by auto have 3: "\- (pi / 2) < x; x * 2 < pi\ \ isCont (\x. inverse (1 + x\<^sup>2)) (tan x)"for x by (rule continuous_intros | simp add: add_nonneg_eq_0_iff)+ show"LBINT x=-\..\. inverse (1 + x^2) = pi" by (subst interval_integral_substitution_nonneg[of "-pi/2""pi/2" tan "\x. 1 + (tan x)^2"])
(auto intro: derivative_eq_intros 1 2 3 filterlim_tan_at_right
simp add: ereal_tendsto_simps filterlim_tan_at_left add_nonneg_eq_0_iff set_integrable_def) show"set_integrable lborel (einterval (-\) \) (\x. inverse (1 + x^2))" by (subst interval_integral_substitution_nonneg[of "-pi/2""pi/2" tan "\x. 1 + (tan x)^2"])
(auto intro: derivative_eq_intros 1 2 3 filterlim_tan_at_right
simp add: ereal_tendsto_simps filterlim_tan_at_left add_nonneg_eq_0_iff set_integrable_def) qed
lemma shows integrable_I0i_1_div_plus_square: "interval_lebesgue_integrable lborel 0 \ (\x. 1 / (1 + x^2))" and LBINT_I0i_1_div_plus_square: "LBINT x=0..\. 1 / (1 + x^2) = pi / 2" proof - have 1: "0 < x \ x * 2 < pi \ (tan has_real_derivative 1 + (tan x)\<^sup>2) (at x)"for x using cos_gt_zero_pi[of x] by (subst tan_sec) (auto intro!: DERIV_tan simp: power_inverse) have 2: "0 < x \ x * 2 < pi \ isCont (\x. 1 + (tan x)\<^sup>2) x"for x using cos_gt_zero_pi[of x] by auto show"LBINT x=0..\. 1 / (1 + x^2) = pi / 2" by (subst interval_integral_substitution_nonneg[of "0""pi/2" tan "\x. 1 + (tan x)^2"])
(auto intro: derivative_eq_intros 1 2 tendsto_eq_intros
simp add: ereal_tendsto_simps filterlim_tan_at_left zero_ereal_def add_nonneg_eq_0_iff set_integrable_def) show"interval_lebesgue_integrable lborel 0 \ (\x. 1 / (1 + x^2))" unfolding interval_lebesgue_integrable_def by (subst interval_integral_substitution_nonneg[of "0""pi/2" tan "\x. 1 + (tan x)^2"])
(auto intro: derivative_eq_intros 1 2 tendsto_eq_intros
simp add: ereal_tendsto_simps filterlim_tan_at_left zero_ereal_def add_nonneg_eq_0_iff set_integrable_def) qed
section ‹The sinc function, and the sine integral (Si)›
abbreviation sinc :: "real \ real"where "sinc \ (\x. if x = 0 then 1 else sin x / x)"
lemma sinc_at_0: "((\x. sin x / x::real) \ 1) (at 0)" using DERIV_sin [of 0] by (auto simp add: has_field_derivative_def field_has_derivative_at)
lemma isCont_sinc: "isCont sinc x" proof cases assume"x = 0"thenshow ?thesis using LIM_equal [where g = "\x. sin x / x"and a=0 and f=sinc and l=1] by (auto simp: isCont_def sinc_at_0) next assume"x \ 0"show ?thesis by (rule continuous_transform_within [where δ = "abs x"and f = "\x. sin x / x"])
(auto simp add: dist_real_def ‹x ≠ 0›) qed
lemma continuous_on_sinc[continuous_intros]: "continuous_on S f \ continuous_on S (\x. sinc (f x))" using continuous_on_compose[of S f sinc, OF _ continuous_at_imp_continuous_on] by (auto simp: isCont_sinc)
lemma Si_at_top_LBINT: "((\t. (LBINT x=0..\. exp (-(x * t)) * (x * sin t + cos t) / (1 + x^2))) \ 0) at_top" proof - let ?F = "\x t. exp (- (x * t)) * (x * sin t + cos t) / (1 + x\<^sup>2) :: real" have int: "set_integrable lborel {0<..} (\x. exp (- x) * (x + 1) :: real)" unfolding distrib_left using has_bochner_integral_I0i_power_exp_m[of 0] has_bochner_integral_I0i_power_exp_m[of 1] by (intro set_integral_add) (auto dest!: integrable.intros simp: ac_simps set_integrable_def)
have"((\t::real. LBINT x:{0<..}. ?F x t) \ (LBINT x::real:{0<..}. 0)) at_top" unfolding set_lebesgue_integral_def proof (rule integral_dominated_convergence_at_top[OF _ _ int [unfolded set_integrable_def]],
simp_all del: abs_divide split: split_indicator) have *: "0 < x \ \x * sin t + cos t\ / (1 + x\<^sup>2) \ (x * 1 + 1) / 1"for x t :: real by (intro frac_le abs_triangle_ineq[THEN order_trans] add_mono)
(auto simp add: abs_mult simp del: mult_1_right intro!: mult_mono) thenhave"1 \ t \ 0 < x \ \?F x t\ \ exp (- x) * (x + 1)"for x t :: real by (auto simp add: abs_mult times_divide_eq_right[symmetric] simp del: times_divide_eq_right
intro!: mult_mono) thenshow"\\<^sub>F i in at_top. AE x in lborel. 0 < x \ \?F x i\ \ exp (- x) * (x + 1)" by (auto intro: eventually_mono eventually_ge_at_top[of "1::real"]) show"AE x in lborel. 0 < x \ (?F x \ 0) at_top" proof (intro always_eventually impI allI) fix x :: real assume"0 < x" show"((\t. exp (- (x * t)) * (x * sin t + cos t) / (1 + x\<^sup>2)) \ 0) at_top" proof (rule Lim_null_comparison) show"\\<^sub>F t in at_top. norm (?F x t) \ exp (- (x * t)) * (x + 1)" using eventually_ge_at_top[of "1::real"] * ‹0 < x› by (auto simp add: abs_mult times_divide_eq_right[symmetric] simp del: times_divide_eq_right
intro!: mult_mono elim: eventually_mono) show"((\t. exp (- (x * t)) * (x + 1)) \ 0) at_top" by (auto simp: filterlim_uminus_at_top [symmetric]
intro!: filterlim_tendsto_pos_mult_at_top[OF tendsto_const] ‹0<x› filterlim_ident
tendsto_mult_left_zero filterlim_compose[OF exp_at_bot]) qed qed qed thenshow"((\t. (LBINT x=0..\. exp (-(x * t)) * (x * sin t + cos t) / (1 + x^2))) \ 0) at_top" by (simp add: interval_lebesgue_integral_0_infty set_lebesgue_integral_def) qed
lemma Si_at_top_integrable: assumes"t \ 0" shows"interval_lebesgue_integrable lborel 0 \ (\x. exp (- (x * t)) * (x * sin t + cos t) / (1 + x\<^sup>2))" using‹0 ≤ t›unfolding le_less proof assume"0 = t"thenshow ?thesis using integrable_I0i_1_div_plus_square by simp next assume [arith]: "0 < t" have *: "0 \ a \ 0 < x \ a / (1 + x\<^sup>2) \ a"for a x :: real using zero_le_power2[of x, arith] using divide_left_mono[of 1 "1+x\<^sup>2" a] by auto have"set_integrable lborel {0<..} (\x. (exp (- x) * x) * (sin t/t) + exp (- x) * cos t)" using has_bochner_integral_I0i_power_exp_m[of 0] has_bochner_integral_I0i_power_exp_m[of 1] by (intro set_integral_add set_integrable_mult_left)
(auto dest!: integrable.intros simp: ac_simps set_integrable_def) from lborel_integrable_real_affine[OF this [unfolded set_integrable_def], of t 0] show ?thesis unfolding interval_lebesgue_integral_0_infty set_integrable_def by (rule Bochner_Integration.integrable_bound) (auto simp: field_simps * split: split_indicator) qed
lemma Si_at_top: "(Si \ pi / 2) at_top" proof - have†: "\\<^sub>F t in at_top. pi / 2 - (LBINT u=0..\. exp (-(u * t)) * (u * sin t + cos t) / (1 + u^2)) = Si t" using eventually_ge_at_top[of 0] proof eventually_elim fix t :: real assume"t \ 0" have"Si t = LBINT x=0..t. sin x * (LBINT u=0..\. exp (-(u * x)))" unfolding Si_def using‹0 ≤ t› by (intro interval_integral_discrete_difference[where X="{0}"]) (auto simp: LBINT_I0i_exp_mscale) alsohave"\ = (LBINT x. (LBINT u=ereal 0..\. indicator {0 <..< t} x *\<^sub>R sin x * exp (-(u * x))))" using‹0≤t›by (simp add: zero_ereal_def interval_lebesgue_integral_le_eq mult_ac set_lebesgue_integral_def) alsohave"\ = (LBINT x. (LBINT u. indicator ({0<..} \ {0 <..< t}) (u, x) *\<^sub>R (sin x * exp (-(u * x)))))" apply (subst interval_integral_Ioi) unfolding set_lebesgue_integral_def by(simp_all add: indicator_times ac_simps ) alsohave"\ = (LBINT u. (LBINT x. indicator ({0<..} \ {0 <..< t}) (u, x) *\<^sub>R (sin x * exp (-(u * x)))))" proof (intro lborel_pair.Fubini_integral[symmetric] lborel_pair.Fubini_integrable) show"(\(x, y). indicator ({0<..} \ {0<..R (sin x * exp (- (y * x)))) ∈ borel_measurable (lborel ⨂🚫M lborel)" (is "?f ∈ borel_measurable _") by measurable
have"AE x in lborel. indicator {0..t} x *\<^sub>R abs (sinc x) = (LBINT y. norm (?f (x, y)))" using AE_lborel_singleton[of 0] AE_lborel_singleton[of t] proof eventually_elim fix x :: real assume x: "x \ 0""x \ t" have"(LBINT y. \indicator ({0<..} \ {0<..R (sin x * exp (- (y * x)))\) =
(LBINT y. ∣sin x∣ * exp (- (y * x)) * indicator {0<..} y * indicator {0<..<t} x)" by (intro Bochner_Integration.integral_cong) (auto split: split_indicator simp: abs_mult) alsohave"\ = \sin x\ * indicator {0<... exp (- (y * x)))" by (cases "x > 0")
(auto simp: field_simps interval_lebesgue_integral_0_infty set_lebesgue_integral_def split: split_indicator) alsohave"\ = \sin x\ * indicator {0<.. by (cases "x > 0") (auto simp add: LBINT_I0i_exp_mscale) alsohave"\ = indicator {0..t} x *\<^sub>R \sinc x\" using x by (simp add: field_simps split: split_indicator) finallyshow"indicator {0..t} x *\<^sub>R abs (sinc x) = (LBINT y. norm (?f (x, y)))" by simp qed moreoverhave"integrable lborel (\x. indicat_real {0..t} x *\<^sub>R \sinc x\)" by (auto intro!: borel_integrable_compact continuous_intros simp del: real_scaleR_def) ultimatelyshow"integrable lborel (\x. LBINT y. norm (?f (x, y)))" by (rule integrable_cong_AE_imp[rotated 2]) simp
have"0 < x \ set_integrable lborel {0<..} (\y. sin x * exp (- (y * x)))"for x :: real by (intro set_integrable_mult_right integrable_I0i_exp_mscale) thenshow"AE x in lborel. integrable lborel (\y. ?f (x, y))" by (intro AE_I2) (auto simp: indicator_times set_integrable_def split: split_indicator) qed alsohave"... = (LBINT u=0..\. (LBINT x=0..t. exp (-(u * x)) * sin x))" using‹0≤t› by (auto simp: interval_lebesgue_integral_def set_lebesgue_integral_def zero_ereal_def ac_simps
split: split_indicator intro!: Bochner_Integration.integral_cong) alsohave"\ = (LBINT u=0..\. 1 / (1 + u\<^sup>2) - 1 / (1 + u\<^sup>2) * (exp (- (u * t)) * (u * sin t + cos t)))" by (auto simp: divide_simps LBINT_I0c_exp_mscale_sin intro!: interval_integral_cong) alsohave"... = pi / 2 - (LBINT u=0..\. exp (- (u * t)) * (u * sin t + cos t) / (1 + u^2))" using Si_at_top_integrable[OF ‹0≤t›] by (simp add: integrable_I0i_1_div_plus_square LBINT_I0i_1_div_plus_square) finallyshow"pi / 2 - (LBINT u=0..\. exp (-(u * t)) * (u * sin t + cos t) / (1 + u^2)) = Si t" .. qed show ?thesis by (rule Lim_transform_eventually [OF _ †])
(auto intro!: tendsto_eq_intros Si_at_top_LBINT) qed
subsection ‹The final theorems: boundedness and scalability›
lemma bounded_Si: "\B. \T. \Si T\ \ B" proof - have *: "0 \ y \ dist x y < z \ abs x \ y + z"for x y z :: real by (simp add: dist_real_def)
have"eventually (\T. dist (Si T) (pi / 2) < 1) at_top" using Si_at_top by (elim tendstoD) simp thenhave"eventually (\T. 0 \ T \ \Si T\ \ pi / 2 + 1) at_top" using eventually_ge_at_top[of 0] by eventually_elim (insert *[of "pi/2""Si _" 1], auto) thenhave"\T. 0 \ T \ (\t \ T. \Si t\ \ pi / 2 + 1)" by (auto simp add: eventually_at_top_linorder) thenobtain T where T: "0 \ T""\t. t \ T \ \Si t\ \ pi / 2 + 1" by auto moreoverhave"t \ - T \ \Si t\ \ pi / 2 + 1"for t using T(1) T(2)[of "-t"] Si_neg[of "- t"] by simp moreoverhave"\M. \t. -T \ t \ t \ T \ \Si t\ \ M" by (rule isCont_bounded) (auto intro!: isCont_Si continuous_intros ‹0 ≤ T›) thenobtain M where M: "\t. -T \ t \ t \ T \ \Si t\ \ M" by auto ultimatelyshow ?thesis by (intro exI[of _ "max M (pi/2 + 1)"]) (meson le_max_iff_disj linorder_not_le order_le_less) qed
lemma LBINT_I0c_sin_scale_divide: assumes"T \ 0" shows"LBINT t=0..T. sin (t * \) / t = sgn \ * Si (T * \\\)" proof -
{ assume"0 < \" have"(LBINT t=ereal 0..T. sin (t * \) / t) = (LBINT t=ereal 0..T. \ *\<^sub>R sinc (t * \))" by (rule interval_integral_discrete_difference[of "{0}"]) auto alsohave"\ = (LBINT t=ereal (0 * \)..T * \. sinc t)" apply (rule interval_integral_substitution_finite [OF assms]) apply (subst mult.commute, rule DERIV_subset) by (auto intro!: derivative_intros continuous_at_imp_continuous_on isCont_sinc) alsohave"\ = (LBINT t=ereal (0 * \)..T * \. sin t / t)" by (rule interval_integral_discrete_difference[of "{0}"]) auto finallyhave"(LBINT t=ereal 0..T. sin (t * \) / t) = (LBINT t=ereal 0..T * \. sin t / t)" by simp hence"(LBINT x. indicator {0<..) / x) = (LBINT x. indicator {0<..} x * sin x / x)" using assms ‹0 < θ›unfolding interval_lebesgue_integral_def einterval_eq zero_ereal_def by (auto simp: ac_simps set_lebesgue_integral_def)
} note aux1 = this
{ assume"0 > \" have [simp]: "integrable lborel (\x. sin (x * \) * indicator {0<.. using integrable_sinc' [of T \] assms by (simp add: interval_lebesgue_integrable_def set_integrable_def ac_simps) have"(LBINT t=ereal 0..T. sin (t * -\) / t) = (LBINT t=ereal 0..T. -\ *\<^sub>R sinc (t * -\))" by (rule interval_integral_discrete_difference[of "{0}"]) auto alsohave"\ = (LBINT t=ereal (0 * -\)..T * -\. sinc t)" apply (rule interval_integral_substitution_finite [OF assms]) apply (subst mult.commute, rule DERIV_subset) by (auto intro!: derivative_intros continuous_at_imp_continuous_on isCont_sinc) alsohave"\ = (LBINT t=ereal (0 * -\)..T * -\. sin t / t)" by (rule interval_integral_discrete_difference[of "{0}"]) auto finallyhave"(LBINT t=ereal 0..T. sin (t * -\) / t) = (LBINT t=ereal 0..T * -\. sin t / t)" by simp hence"(LBINT x. indicator {0<..) / x) =
- (LBINT x. indicator {0<..<- (T * θ)} x * sin x / x)" using assms ‹0 > θ›unfolding interval_lebesgue_integral_def einterval_eq zero_ereal_def by (auto simp add: field_simps mult_le_0_iff set_lebesgue_integral_def split: if_split_asm)
} note aux2 = this show ?thesis using assms unfolding Si_def interval_lebesgue_integral_def set_lebesgue_integral_def sgn_real_def einterval_eq zero_ereal_def by (auto simp: aux1 aux2) qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.