src/HOL/Probability/Characteristic_Functions.thy
changeset 63886 685fb01256af
parent 63626 44ce6b524ff3
child 63992 3aa9837d05c7
equal deleted inserted replaced
63885:a6cd18af8bf9 63886:685fb01256af
   314   have "k \<le> n \<Longrightarrow> expectation (c k) = (\<i>*t) ^ k * (expectation (\<lambda>x. x ^ k)) / fact k" for k
   314   have "k \<le> n \<Longrightarrow> expectation (c k) = (\<i>*t) ^ k * (expectation (\<lambda>x. x ^ k)) / fact k" for k
   315     unfolding c_def integral_mult_right_zero integral_complex_of_real by simp
   315     unfolding c_def integral_mult_right_zero integral_complex_of_real by simp
   316   then have "norm (char M t - ?t1) = norm (char M t - (CLINT x | M. (\<Sum>k \<le> n. c k x)))"
   316   then have "norm (char M t - ?t1) = norm (char M t - (CLINT x | M. (\<Sum>k \<le> n. c k x)))"
   317     by (simp add: integ_c)
   317     by (simp add: integ_c)
   318   also have "\<dots> = norm ((CLINT x | M. iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   318   also have "\<dots> = norm ((CLINT x | M. iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   319     unfolding char_def by (subst integral_diff[OF integ_iexp]) (auto intro!: integ_c)
   319     unfolding char_def by (subst Bochner_Integration.integral_diff[OF integ_iexp]) (auto intro!: integ_c)
   320   also have "\<dots> \<le> expectation (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   320   also have "\<dots> \<le> expectation (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   321     by (intro integral_norm_bound integrable_diff integ_iexp integrable_setsum integ_c) simp
   321     by (intro integral_norm_bound Bochner_Integration.integrable_diff integ_iexp Bochner_Integration.integrable_setsum integ_c) simp
   322   also have "\<dots> \<le> expectation (\<lambda>x. 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n)"
   322   also have "\<dots> \<le> expectation (\<lambda>x. 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n)"
   323   proof (rule integral_mono)
   323   proof (rule integral_mono)
   324     show "integrable M (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)))"
   324     show "integrable M (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)))"
   325       by (intro integrable_norm integrable_diff integ_iexp integrable_setsum integ_c) simp
   325       by (intro integrable_norm Bochner_Integration.integrable_diff integ_iexp Bochner_Integration.integrable_setsum integ_c) simp
   326     show "integrable M (\<lambda>x. 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n)"
   326     show "integrable M (\<lambda>x. 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n)"
   327       unfolding power_abs[symmetric]
   327       unfolding power_abs[symmetric]
   328       by (intro integrable_mult_right integrable_abs integrable_moments) simp
   328       by (intro integrable_mult_right integrable_abs integrable_moments) simp
   329     show "cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)) \<le> 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n" for x
   329     show "cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)) \<le> 2 * \<bar>t\<bar> ^ n / fact n * \<bar>x\<bar> ^ n" for x
   330       using iexp_approx2[of "t * x" n] by (auto simp add: abs_mult field_simps c_def)
   330       using iexp_approx2[of "t * x" n] by (auto simp add: abs_mult field_simps c_def)
   358   have "k \<le> n \<Longrightarrow> expectation (c k) = (\<i>*t) ^ k * (expectation (\<lambda>x. x ^ k)) / fact k" for k
   358   have "k \<le> n \<Longrightarrow> expectation (c k) = (\<i>*t) ^ k * (expectation (\<lambda>x. x ^ k)) / fact k" for k
   359     unfolding c_def integral_mult_right_zero integral_complex_of_real by simp
   359     unfolding c_def integral_mult_right_zero integral_complex_of_real by simp
   360   then have "norm (char M t - ?t1) = norm (char M t - (CLINT x | M. (\<Sum>k \<le> n. c k x)))"
   360   then have "norm (char M t - ?t1) = norm (char M t - (CLINT x | M. (\<Sum>k \<le> n. c k x)))"
   361     by (simp add: integ_c)
   361     by (simp add: integ_c)
   362   also have "\<dots> = norm ((CLINT x | M. iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   362   also have "\<dots> = norm ((CLINT x | M. iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   363     unfolding char_def by (subst integral_diff[OF integ_iexp]) (auto intro!: integ_c)
   363     unfolding char_def by (subst Bochner_Integration.integral_diff[OF integ_iexp]) (auto intro!: integ_c)
   364   also have "\<dots> \<le> expectation (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   364   also have "\<dots> \<le> expectation (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k \<le> n. c k x)))"
   365     by (intro integral_norm_bound integrable_diff integ_iexp integrable_setsum integ_c) simp
   365     by (intro integral_norm_bound Bochner_Integration.integrable_diff integ_iexp Bochner_Integration.integrable_setsum integ_c) simp
   366   also have "\<dots> \<le> expectation (\<lambda>x. min (2 * \<bar>t * x\<bar>^n / fact n) (\<bar>t * x\<bar>^(Suc n) / fact (Suc n)))"
   366   also have "\<dots> \<le> expectation (\<lambda>x. min (2 * \<bar>t * x\<bar>^n / fact n) (\<bar>t * x\<bar>^(Suc n) / fact (Suc n)))"
   367     (is "_ \<le> expectation ?f")
   367     (is "_ \<le> expectation ?f")
   368   proof (rule integral_mono)
   368   proof (rule integral_mono)
   369     show "integrable M (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)))"
   369     show "integrable M (\<lambda>x. cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)))"
   370       by (intro integrable_norm integrable_diff integ_iexp integrable_setsum integ_c) simp
   370       by (intro integrable_norm Bochner_Integration.integrable_diff integ_iexp Bochner_Integration.integrable_setsum integ_c) simp
   371     show "integrable M ?f"
   371     show "integrable M ?f"
   372       by (rule integrable_bound[where f="\<lambda>x. 2 * \<bar>t * x\<bar> ^ n / fact n"])
   372       by (rule Bochner_Integration.integrable_bound[where f="\<lambda>x. 2 * \<bar>t * x\<bar> ^ n / fact n"])
   373          (auto simp: integrable_moments power_abs[symmetric] power_mult_distrib)
   373          (auto simp: integrable_moments power_abs[symmetric] power_mult_distrib)
   374     show "cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)) \<le> ?f x" for x
   374     show "cmod (iexp (t * x) - (\<Sum>k\<le>n. c k x)) \<le> ?f x" for x
   375       using iexp_approx1[of "t * x" n] iexp_approx2[of "t * x" n]
   375       using iexp_approx1[of "t * x" n] iexp_approx2[of "t * x" n]
   376       by (auto simp add: abs_mult field_simps c_def intro!: min.boundedI)
   376       by (auto simp add: abs_mult field_simps c_def intro!: min.boundedI)
   377   qed
   377   qed
   378   also have "\<dots> = (\<bar>t\<bar>^n / fact (Suc n)) * expectation (\<lambda>x. min (2 * \<bar>x\<bar>^n * Suc n) (\<bar>t\<bar> * \<bar>x\<bar>^Suc n))"
   378   also have "\<dots> = (\<bar>t\<bar>^n / fact (Suc n)) * expectation (\<lambda>x. min (2 * \<bar>x\<bar>^n * Suc n) (\<bar>t\<bar> * \<bar>x\<bar>^Suc n))"
   379     unfolding *
   379     unfolding *
   380   proof (rule integral_mult_right)
   380   proof (rule Bochner_Integration.integral_mult_right)
   381     show "integrable M (\<lambda>x. min (2 * \<bar>x\<bar> ^ n * real (Suc n)) (\<bar>t\<bar> * \<bar>x\<bar> ^ Suc n))"
   381     show "integrable M (\<lambda>x. min (2 * \<bar>x\<bar> ^ n * real (Suc n)) (\<bar>t\<bar> * \<bar>x\<bar> ^ Suc n))"
   382       by (rule integrable_bound[where f="\<lambda>x. 2 * \<bar>x\<bar> ^ n * real (Suc n)"])
   382       by (rule Bochner_Integration.integrable_bound[where f="\<lambda>x. 2 * \<bar>x\<bar> ^ n * real (Suc n)"])
   383          (auto simp: integrable_moments power_abs[symmetric] power_mult_distrib)
   383          (auto simp: integrable_moments power_abs[symmetric] power_mult_distrib)
   384   qed
   384   qed
   385   finally show ?thesis
   385   finally show ?thesis
   386     unfolding integral_mult_right_zero .
   386     unfolding integral_mult_right_zero .
   387 qed
   387 qed