diff -r 143f58bb34f9 -r 0909deb8059b src/HOL/Probability/Levy.thy --- a/src/HOL/Probability/Levy.thy Thu May 26 16:57:14 2016 +0200 +++ b/src/HOL/Probability/Levy.thy Thu May 26 17:51:22 2016 +0200 @@ -28,7 +28,7 @@ (iexp (-(t * a)) - (1 + ii * -(t * a))) / (ii * t) - (iexp (-(t * b)) - (1 + ii * -(t * b))) / (ii * t))" (is "_ = cmod (?one / (ii * t) - ?two / (ii * t))") - using `t \ 0` by (intro arg_cong[where f=norm]) (simp add: field_simps) + using \t \ 0\ by (intro arg_cong[where f=norm]) (simp add: field_simps) also have "\ \ cmod (?one / (ii * t)) + cmod (?two / (ii * t))" by (rule norm_triangle_ineq4) also have "cmod (?one / (ii * t)) = cmod ?one / abs t" @@ -45,8 +45,8 @@ using iexp_approx1 [of "-(t * b)" 1] apply (simp add: field_simps eval_nat_numeral) by force also have "\ = a^2 / 2 * abs t + b^2 / 2 * abs t" - using `t \ 0` apply (case_tac "t \ 0", simp add: field_simps power2_eq_square) - using `t \ 0` by (subst (1 2) abs_of_neg, auto simp add: field_simps power2_eq_square) + using \t \ 0\ apply (case_tac "t \ 0", simp add: field_simps power2_eq_square) + using \t \ 0\ by (subst (1 2) abs_of_neg, auto simp add: field_simps power2_eq_square) finally show "cmod (?F t - (b - a)) \ a^2 / 2 * abs t + b^2 / 2 * abs t" . qed show ?thesis @@ -63,9 +63,9 @@ shows "cmod ((iexp (t * b) - iexp (t * a)) / (ii * t)) \ b - a" (is "?F \ _") proof - have "?F = cmod (iexp (t * a) * (iexp (t * (b - a)) - 1) / (ii * t))" - using `t \ 0` by (intro arg_cong[where f=norm]) (simp add: field_simps exp_diff exp_minus) + using \t \ 0\ by (intro arg_cong[where f=norm]) (simp add: field_simps exp_diff exp_minus) also have "\ = cmod (iexp (t * (b - a)) - 1) / abs t" - unfolding norm_divide norm_mult norm_exp_ii_times using `t \ 0` + unfolding norm_divide norm_mult norm_exp_ii_times using \t \ 0\ by (simp add: complex_eq_iff norm_mult) also have "\ \ abs (t * (b - a)) / abs t" using iexp_approx1 [of "t * (b - a)" 0] @@ -100,7 +100,7 @@ apply (auto intro!: AE_I [of _ _ "{0}"] simp: assms) done have "(CLBINT t. ?f' (t, x)) = (CLBINT t=-T..T. ?f t x)" - using `T \ 0` by (simp add: interval_lebesgue_integral_def) + using \T \ 0\ by (simp add: interval_lebesgue_integral_def) also have "\ = (CLBINT t=-T..(0 :: real). ?f t x) + (CLBINT t=(0 :: real)..T. ?f t x)" (is "_ = _ + ?t") using 1 by (intro interval_integral_sum[symmetric]) (simp add: min_absorb1 max_absorb2 \T \ 0\) @@ -111,10 +111,10 @@ by (intro interval_lebesgue_integral_add(2) [symmetric] interval_integrable_mirror[THEN iffD2]) simp_all also have "\ = (CLBINT t=(0::real)..T. ((iexp(t * (x - a)) - iexp (-(t * (x - a)))) - (iexp(t * (x - b)) - iexp (-(t * (x - b))))) / (ii * t))" - using `T \ 0` by (intro interval_integral_cong) (auto simp add: divide_simps) + using \T \ 0\ by (intro interval_integral_cong) (auto simp add: divide_simps) also have "\ = (CLBINT t=(0::real)..T. complex_of_real( 2 * (sin (t * (x - a)) / t) - 2 * (sin (t * (x - b)) / t)))" - using `T \ 0` + using \T \ 0\ apply (intro interval_integral_cong) apply (simp add: field_simps cis.ctr Im_divide Re_divide Im_exp Re_exp complex_eq_iff) unfolding minus_diff_eq[symmetric, of "y * x" "y * a" for y a] sin_minus cos_minus @@ -128,14 +128,14 @@ apply (subst interval_lebesgue_integral_diff) apply (rule interval_lebesgue_integrable_mult_right, rule integrable_sinc')+ apply (subst interval_lebesgue_integral_mult_right)+ - apply (simp add: zero_ereal_def[symmetric] LBINT_I0c_sin_scale_divide[OF `T \ 0`]) + apply (simp add: zero_ereal_def[symmetric] LBINT_I0c_sin_scale_divide[OF \T \ 0\]) done finally have "(CLBINT t. ?f' (t, x)) = 2 * (sgn (x - a) * Si (T * abs (x - a)) - sgn (x - b) * Si (T * abs (x - b)))" . } note main_eq = this have "(CLBINT t=-T..T. ?F t * \ t) = (CLBINT t. (CLINT x | M. ?F t * iexp (t * x) * indicator {-T<.. 0` unfolding \_def char_def interval_lebesgue_integral_def + using \T \ 0\ unfolding \_def char_def interval_lebesgue_integral_def by (auto split: split_indicator intro!: integral_cong) also have "\ = (CLBINT t. (CLINT x | M. ?f' (t, x)))" by (auto intro!: integral_cong simp: field_simps exp_diff exp_minus split: split_indicator) @@ -146,7 +146,7 @@ by (subst emeasure_pair_measure_Times) (auto simp: ennreal_mult_less_top not_less top_unique) show "AE x\{- T<.. space M in lborel \\<^sub>M M. cmod (case x of (t, x) \ ?f' (t, x)) \ b - a" - using Levy_Inversion_aux2[of "x - b" "x - a" for x] `a \ b` + using Levy_Inversion_aux2[of "x - b" "x - a" for x] \a \ b\ by (intro AE_I [of _ _ "{0} \ UNIV"]) (force simp: emeasure_pair_measure_Times)+ qed (auto split: split_indicator split_indicator_asm) also have "\ = (CLINT x | M. (complex_of_real (2 * (sgn (x - a) * @@ -178,7 +178,7 @@ then show "\n. AE x in M. norm (2 * ?S n x) \ 4 * B" by auto have "AE x in M. x \ a" "AE x in M. x \ b" - using prob_eq_0[of "{a}"] prob_eq_0[of "{b}"] `\ {a} = 0` `\ {b} = 0` by (auto simp: \_def) + using prob_eq_0[of "{a}"] prob_eq_0[of "{b}"] \\ {a} = 0\ \\ {b} = 0\ by (auto simp: \_def) then show "AE x in M. (\n. 2 * ?S n x) \ 2 * pi * indicator {a<..b} x" proof eventually_elim fix x assume x: "x \ a" "x \ b" @@ -190,7 +190,7 @@ also have "(\n. 2 * (sgn (x - a) * Si (\x - a\ * n) - sgn (x - b) * Si (\x - b\ * n))) = (\n. 2 * ?S n x)" by (auto simp: ac_simps) also have "2 * (sgn (x - a) * (pi / 2) - sgn (x - b) * (pi / 2)) = 2 * pi * indicator {a<..b} x" - using x `a \ b` by (auto split: split_indicator) + using x \a \ b\ by (auto split: split_indicator) finally show "(\n. 2 * ?S n x) \ 2 * pi * indicator {a<..b} x" . qed qed simp_all @@ -226,7 +226,7 @@ { fix \ :: real assume "\ > 0" - from `\ > 0` `(cdf M1 \ 0) at_bot` `(cdf M2 \ 0) at_bot` + from \\ > 0\ \(cdf M1 \ 0) at_bot\ \(cdf M2 \ 0) at_bot\ have "eventually (\y. \cdf M1 y\ < \ / 4 \ \cdf M2 y\ < \ / 4 \ y \ x) at_bot" by (simp only: tendsto_iff dist_real_def diff_0_right eventually_conj eventually_le_at_bot) then obtain M where "\y. y \ M \ \cdf M1 y\ < \ / 4" "\y. y \ M \ \cdf M2 y\ < \ / 4" "M \ x" @@ -235,7 +235,7 @@ "measure M1 {a} = 0" "measure M2 {a} = 0" "a < M" "a \ x" "\cdf M1 a\ < \ / 4" "\cdf M2 a\ < \ / 4" by auto - from `\ > 0` `(cdf M1 \ cdf M1 x) (at_right x)` `(cdf M2 \ cdf M2 x) (at_right x)` + from \\ > 0\ \(cdf M1 \ cdf M1 x) (at_right x)\ \(cdf M2 \ cdf M2 x) (at_right x)\ have "eventually (\y. \cdf M1 y - cdf M1 x\ < \ / 4 \ \cdf M2 y - cdf M2 x\ < \ / 4 \ x < y) (at_right x)" by (simp only: tendsto_iff dist_real_def eventually_conj eventually_at_right_less) then obtain N where "N > x" "\y. x < y \ y < N \ \cdf M1 y - cdf M1 x\ < \ / 4" @@ -244,16 +244,16 @@ with open_minus_countable[OF count, of "{x <..< N}"] obtain b where "x < b" "b < N" "measure M1 {b} = 0" "measure M2 {b} = 0" "\cdf M2 x - cdf M2 b\ < \ / 4" "\cdf M1 x - cdf M1 b\ < \ / 4" by (auto simp: abs_minus_commute) - from `a \ x` `x < b` have "a < b" "a \ b" by auto + from \a \ x\ \x < b\ have "a < b" "a \ b" by auto - from `char M1 = char M2` - M1.Levy_Inversion [OF `a \ b` `measure M1 {a} = 0` `measure M1 {b} = 0`] - M2.Levy_Inversion [OF `a \ b` `measure M2 {a} = 0` `measure M2 {b} = 0`] + from \char M1 = char M2\ + M1.Levy_Inversion [OF \a \ b\ \measure M1 {a} = 0\ \measure M1 {b} = 0\] + M2.Levy_Inversion [OF \a \ b\ \measure M2 {a} = 0\ \measure M2 {b} = 0\] have "complex_of_real (measure M1 {a<..b}) = complex_of_real (measure M2 {a<..b})" by (intro LIMSEQ_unique) auto then have "measure M1 {a<..b} = measure M2 {a<..b}" by auto then have *: "cdf M1 b - cdf M1 a = cdf M2 b - cdf M2 a" - unfolding M1.cdf_diff_eq [OF `a < b`] M2.cdf_diff_eq [OF `a < b`] . + unfolding M1.cdf_diff_eq [OF \a < b\] M2.cdf_diff_eq [OF \a < b\] . have "abs (cdf M1 x - (cdf M1 b - cdf M1 a)) = abs (cdf M1 x - cdf M1 b + cdf M1 a)" by simp @@ -281,7 +281,7 @@ by (metis abs_le_zero_iff dense_ge eq_iff_diff_eq_0) qed thus ?thesis - by (rule cdf_unique [OF `real_distribution M1` `real_distribution M2`]) + by (rule cdf_unique [OF \real_distribution M1\ \real_distribution M2\]) qed @@ -311,7 +311,7 @@ hence "(CLBINT t:{-u..u}. 1 - iexp (t * x)) = (CLBINT t=-u..u. 1 - iexp (t * x))" by (subst interval_integral_Icc, auto) also have "\ = (CLBINT t=-u..0. 1 - iexp (t * x)) + (CLBINT t=0..u. 1 - iexp (t * x))" - using `u > 0` + using \u > 0\ apply (subst interval_integral_sum) apply (simp add: min_absorb1 min_absorb2 max_absorb1 max_absorb2) apply (rule interval_integrable_isCont) @@ -329,7 +329,7 @@ also have "\ = 2 * u - 2 * sin (u * x) / x" by (subst interval_lebesgue_integral_diff) (auto intro!: interval_integrable_isCont - simp: interval_lebesgue_integral_of_real integral_cos [OF `x \ 0`] mult.commute[of _ x]) + simp: interval_lebesgue_integral_of_real integral_cos [OF \x \ 0\] mult.commute[of _ x]) finally show "(CLBINT t:{-u..u}. 1 - iexp (t * x)) = 2 * (u - sin (u * x) / x)" by (simp add: field_simps) qed @@ -345,7 +345,7 @@ have Mn2 [simp]: "\x. complex_integrable (M n) (\t. exp (\ * complex_of_real (x * t)))" by (rule Mn.integrable_const_bound [where B = 1], auto) have Mn3: "set_integrable (M n \\<^sub>M lborel) (UNIV \ {- u..u}) (\a. 1 - exp (\ * complex_of_real (snd a * fst a)))" - using `0 < u` + using \0 < u\ by (intro integrableI_bounded_set_indicator [where B="2"]) (auto simp: lborel.emeasure_pair_measure_Times ennreal_mult_less_top not_less top_unique split: split_indicator @@ -358,7 +358,7 @@ also have "\ = (CLINT x | M n. (CLBINT t:{-u..u}. 1 - iexp (t * x)))" using Mn3 by (subst P.Fubini_integral) (auto simp: indicator_times split_beta') also have "\ = (CLINT x | M n. (if x = 0 then 0 else 2 * (u - sin (u * x) / x)))" - using `u > 0` by (intro integral_cong, auto simp add: * simp del: of_real_mult) + using \u > 0\ by (intro integral_cong, auto simp add: * simp del: of_real_mult) also have "\ = (LINT x | M n. (if x = 0 then 0 else 2 * (u - sin (u * x) / x)))" by (rule integral_complex_of_real) finally have "Re (CLBINT t:{-u..u}. 1 - char (M n) t) = @@ -368,7 +368,7 @@ have "complex_integrable (M n) (\x. CLBINT t:{-u..u}. 1 - iexp (snd (x, t) * fst (x, t)))" using Mn3 by (intro P.integrable_fst) (simp add: indicator_times split_beta') hence "complex_integrable (M n) (\x. if x = 0 then 0 else 2 * (u - sin (u * x) / x))" - using `u > 0` by (subst integrable_cong) (auto simp add: * simp del: of_real_mult) + using \u > 0\ by (subst integrable_cong) (auto simp add: * simp del: of_real_mult) hence **: "integrable (M n) (\x. if x = 0 then 0 else 2 * (u - sin (u * x) / x))" unfolding complex_of_real_integrable_eq . have "2 * sin x \ x" if "2 \ x" for x :: real @@ -378,7 +378,7 @@ moreover have "x < 0 \ x \ sin x" for x :: real using sin_x_le_x[of "-x"] by simp ultimately show ?thesis - using `u > 0` + using \u > 0\ by (intro integral_mono [OF _ **]) (auto simp: divide_simps sin_x_le_x mult.commute[of u] mult_neg_pos top_unique less_top[symmetric] split: split_indicator) @@ -397,7 +397,7 @@ hence "\d>0. \t. abs t < d \ cmod (char M' t - 1) < \ / 4" apply (subst (asm) continuous_at_eps_delta) apply (drule_tac x = "\ / 4" in spec) - using `\ > 0` by (auto simp add: dist_real_def dist_complex_def M'.char_zero) + using \\ > 0\ by (auto simp add: dist_real_def dist_complex_def M'.char_zero) then obtain d where "d > 0 \ (\t. (abs t < d \ cmod (char M' t - 1) < \ / 4))" .. hence d0: "d > 0" and d1: "\t. abs t < d \ cmod (char M' t - 1) < \ / 4" by auto have 1: "\x. cmod (1 - char M' x) \ 2" @@ -433,7 +433,7 @@ done hence "eventually (\n. cmod ((CLBINT t:{-d/2..d/2}. 1 - char (M n) t) - (CLBINT t:{-d/2..d/2}. 1 - char M' t)) < d * \ / 4) sequentially" - using d0 `\ > 0` apply (subst (asm) tendsto_iff) + using d0 \\ > 0\ apply (subst (asm) tendsto_iff) by (subst (asm) dist_complex_def, drule spec, erule mp, auto) hence "\N. \n \ N. cmod ((CLBINT t:{-d/2..d/2}. 1 - char (M n) t) - (CLBINT t:{-d/2..d/2}. 1 - char M' t)) < d * \ / 4" by (simp add: eventually_sequentially) @@ -449,7 +449,7 @@ (CLBINT t:{-d/2..d/2}. 1 - char M' t)) + cmod(CLBINT t:{-d/2..d/2}. 1 - char M' t)" by (rule norm_triangle_ineq) also have "\ < d * \ / 4 + d * \ / 4" - by (rule add_less_le_mono [OF N [OF `n \ N`] bound]) + by (rule add_less_le_mono [OF N [OF \n \ N\] bound]) also have "\ = d * \ / 2" by auto finally have "cmod (CLBINT t:{-d/2..d/2}. 1 - char (M n) t) < d * \ / 2" . hence "d * \ / 2 > Re (CLBINT t:{-d/2..d/2}. 1 - char (M n) t)" @@ -458,7 +458,7 @@ also have "?lhs \ (d / 2) * measure (M n) {x. abs x \ 2 / (d / 2)}" using d0 by (intro main_bound, simp) finally (xtrans) have "d * \ / 2 > (d / 2) * measure (M n) {x. abs x \ 2 / (d / 2)}" . - with d0 `\ > 0` have "\ > measure (M n) {x. abs x \ 2 / (d / 2)}" by (simp add: field_simps) + with d0 \\ > 0\ have "\ > measure (M n) {x. abs x \ 2 / (d / 2)}" by (simp add: field_simps) hence "\ > 1 - measure (M n) (UNIV - {x. abs x \ 2 / (d / 2)})" apply (subst Mn.borel_UNIV [symmetric]) by (subst Mn.prob_compl, auto) @@ -484,7 +484,7 @@ using Mn.prob_space unfolding * Mn.borel_UNIV by simp hence "eventually (\k. measure (M n) {- real k<..real k} > 1 - \) sequentially" apply (elim order_tendstoD (1)) - using `\ > 0` by auto + using \\ > 0\ by auto } note 7 = this { fix n :: nat have "eventually (\k. \m < n. measure (M m) {- real k<..real k} > 1 - \) sequentially" @@ -533,7 +533,7 @@ have 5: "\t. (\n. char ((M \ s) n) t) \ char M' t" by (subst 4, rule LIMSEQ_subseq_LIMSEQ [OF _ s], rule assms) hence "char \ = char M'" by (intro ext, intro LIMSEQ_unique [OF 3 5]) - hence "\ = M'" by (rule Levy_uniqueness [OF * `real_distribution M'`]) + hence "\ = M'" by (rule Levy_uniqueness [OF * \real_distribution M'\]) thus "weak_conv_m (M \ s) M'" by (elim subst) (rule nu) qed