author wenzelm Mon Dec 07 20:19:59 2015 +0100 (2015-12-07) changeset 61808 fc1556774cfe parent 61807 965769fe2b63 child 61809 81d34cf268d8 child 61811 1530a0f19539
isabelle update_cartouches -c -t;
     1.1 --- a/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy	Mon Dec 07 16:48:10 2015 +0000
1.2 +++ b/src/HOL/Multivariate_Analysis/Bounded_Continuous_Function.thy	Mon Dec 07 20:19:59 2015 +0100
1.3 @@ -169,7 +169,7 @@
1.4  instance bcontfun :: (metric_space, complete_space) complete_space
1.5  proof
1.6    fix f :: "nat \<Rightarrow> ('a, 'b) bcontfun"
1.7 -  assume "Cauchy f"  -- \<open>Cauchy equals uniform convergence\<close>
1.8 +  assume "Cauchy f"  \<comment> \<open>Cauchy equals uniform convergence\<close>
1.9    then obtain g where limit_function:
1.10      "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x. dist (Rep_bcontfun (f n) x) (g x) < e"
1.11      using uniformly_convergent_eq_cauchy[of "\<lambda>_. True"
1.12 @@ -177,13 +177,13 @@
1.13      unfolding Cauchy_def
1.14      by (metis dist_fun_lt_imp_dist_val_lt)
1.15
1.16 -  then obtain N where fg_dist:  -- \<open>for an upper bound on @{term g}\<close>
1.17 +  then obtain N where fg_dist:  \<comment> \<open>for an upper bound on @{term g}\<close>
1.18      "\<forall>n\<ge>N. \<forall>x. dist (g x) ( Rep_bcontfun (f n) x) < 1"
1.19      by (force simp add: dist_commute)
1.20    from bcontfunE'[OF Rep_bcontfun, of "f N"] obtain b where
1.21      f_bound: "\<forall>x. dist (Rep_bcontfun (f N) x) undefined \<le> b"
1.22      by force
1.23 -  have "g \<in> bcontfun"  -- \<open>The limit function is bounded and continuous\<close>
1.24 +  have "g \<in> bcontfun"  \<comment> \<open>The limit function is bounded and continuous\<close>
1.25    proof (intro bcontfunI)
1.26      show "continuous_on UNIV g"
1.27        using bcontfunE[OF Rep_bcontfun] limit_function
1.28 @@ -199,7 +199,7 @@
1.29    qed
1.30    show "convergent f"
1.31    proof (rule convergentI, subst lim_sequentially, safe)
1.32 -    -- \<open>The limit function converges according to its norm\<close>
1.33 +    \<comment> \<open>The limit function converges according to its norm\<close>
1.34      fix e :: real
1.35      assume "e > 0"
1.36      then have "e/2 > 0" by simp

     2.1 --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy	Mon Dec 07 16:48:10 2015 +0000
2.2 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy	Mon Dec 07 20:19:59 2015 +0100
2.3 @@ -142,7 +142,7 @@
2.4  lemma kuhn_counting_lemma:
2.5    fixes bnd compo compo' face S F
2.6    defines "nF s == card {f\<in>F. face f s \<and> compo' f}"
2.7 -  assumes [simp, intro]: "finite F" -- "faces" and [simp, intro]: "finite S" -- "simplices"
2.8 +  assumes [simp, intro]: "finite F" \<comment> "faces" and [simp, intro]: "finite S" \<comment> "simplices"
2.9      and "\<And>f. f \<in> F \<Longrightarrow> bnd f \<Longrightarrow> card {s\<in>S. face f s} = 1"
2.10      and "\<And>f. f \<in> F \<Longrightarrow> \<not> bnd f \<Longrightarrow> card {s\<in>S. face f s} = 2"
2.11      and "\<And>s. s \<in> S \<Longrightarrow> compo s \<Longrightarrow> nF s = 1"
2.12 @@ -1932,7 +1932,7 @@
2.13    using assms by auto
2.14
2.15  text \<open>Still more general form; could derive this directly without using the
2.16 -  rather involved @{text "HOMEOMORPHIC_CONVEX_COMPACT"} theorem, just using
2.17 +  rather involved \<open>HOMEOMORPHIC_CONVEX_COMPACT\<close> theorem, just using
2.18    a scaling and translation to put the set inside the unit cube.\<close>
2.19
2.20  lemma brouwer:

     3.1 --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy	Mon Dec 07 16:48:10 2015 +0000
3.2 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy	Mon Dec 07 20:19:59 2015 +0100
3.3 @@ -3209,7 +3209,7 @@
3.4        by simp
3.5      have "f y = f x" if "y \<in> s" and ccs: "f y \<in> connected_component_set (f  s) (f x)" for y
3.6        apply (rule ccontr)
3.7 -      using connected_closed [of "connected_component_set (f  s) (f x)"] e>0
3.8 +      using connected_closed [of "connected_component_set (f  s) (f x)"] \<open>e>0\<close>
3.9        apply (simp add: del: ex_simps)
3.10        apply (drule spec [where x="cball (f x) (e / 2)"])
3.11        apply (drule spec [where x="- ball(f x) e"])
3.12 @@ -3217,7 +3217,7 @@
3.13          apply (metis diff_self e2 ele norm_minus_commute norm_zero not_less)
3.14         using centre_in_cball connected_component_refl_eq e2 x apply blast
3.15        using ccs
3.16 -      apply (force simp: cball_def dist_norm norm_minus_commute dest: ele [OF y \<in> s])
3.17 +      apply (force simp: cball_def dist_norm norm_minus_commute dest: ele [OF \<open>y \<in> s\<close>])
3.18        done
3.19      moreover have "connected_component_set (f  s) (f x) \<subseteq> f  s"
3.20        by (auto simp: connected_component_in)
3.21 @@ -3365,7 +3365,7 @@
3.22      using contour_integral_nearby_ends [of "UNIV - {z}" \<gamma>] assms by (auto simp: open_delete)
3.23    then obtain h where h: "polynomial_function h \<and> pathstart h = pathstart \<gamma> \<and> pathfinish h = pathfinish \<gamma> \<and>
3.24                            (\<forall>t \<in> {0..1}. norm(h t - \<gamma> t) < d/2)"
3.25 -    using path_approx_polynomial_function [OF path \<gamma>, of "d/2"] d by auto
3.26 +    using path_approx_polynomial_function [OF \<open>path \<gamma>\<close>, of "d/2"] d by auto
3.27    def nn \<equiv> "1/(2* pi*ii) * contour_integral h (\<lambda>w. 1/(w - z))"
3.28    have "\<exists>n. \<forall>e > 0. \<exists>p. valid_path p \<and> z \<notin> path_image p \<and>
3.29                          pathstart p = pathstart \<gamma> \<and>  pathfinish p = pathfinish \<gamma> \<and>
3.30 @@ -3377,7 +3377,7 @@
3.31        assume e: "e>0"
3.32        obtain p where p: "polynomial_function p \<and>
3.33              pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> (\<forall>t\<in>{0..1}. cmod (p t - \<gamma> t) < min e (d / 2))"
3.34 -        using path_approx_polynomial_function [OF path \<gamma>, of "min e (d/2)"] d 0<e by auto
3.35 +        using path_approx_polynomial_function [OF \<open>path \<gamma>\<close>, of "min e (d/2)"] d \<open>0<e\<close> by auto
3.36        have "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
3.37          by (auto simp: intro!: holomorphic_intros)
3.38        then show "?PP e nn"
3.39 @@ -3389,7 +3389,7 @@
3.40    then show ?thesis
3.41      unfolding winding_number_def
3.42      apply (rule someI2_ex)
3.43 -    apply (blast intro: 0<e)
3.44 +    apply (blast intro: \<open>0<e\<close>)
3.45      done
3.46  qed
3.47
3.48 @@ -3692,7 +3692,7 @@
3.49    obtain k where fink: "finite k" and g_C1_diff: "\<gamma> C1_differentiable_on ({a..b} - k)"
3.50      using \<gamma> by (force simp: piecewise_C1_differentiable_on_def)
3.51    have o: "open ({a<..<b} - k)"
3.52 -    using finite k by (simp add: finite_imp_closed open_Diff)
3.53 +    using \<open>finite k\<close> by (simp add: finite_imp_closed open_Diff)
3.54    moreover have "{a<..<b} - k \<subseteq> {a..b} - k"
3.55      by force
3.56    ultimately have g_diff_at: "\<And>x. \<lbrakk>x \<notin> k; x \<in> {a<..<b}\<rbrakk> \<Longrightarrow> \<gamma> differentiable at x"
3.57 @@ -3933,31 +3933,31 @@
3.58                      "pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma>"
3.59                and pg: "\<And>t. t\<in>{0..1} \<Longrightarrow> cmod (\<gamma> t - p t) < min d e / 2"
3.60                and pi: "contour_integral p (\<lambda>x. 1 / (x - z)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z"
3.61 -    using winding_number [OF \<gamma> z, of "min d e / 2"] d>0 e>0 by auto
3.62 +    using winding_number [OF \<gamma> z, of "min d e / 2"] \<open>d>0\<close> \<open>e>0\<close> by auto
3.63    { fix w
3.64      assume d2: "cmod (w - z) < d/2" and e2: "cmod (w - z) < e/2"
3.65      then have wnotp: "w \<notin> path_image p"
3.66 -      using cbg d>0 e>0
3.67 +      using cbg \<open>d>0\<close> \<open>e>0\<close>
3.68        apply (simp add: path_image_def cball_def dist_norm, clarify)
3.69        apply (frule pg)
3.70        apply (drule_tac c="\<gamma> x" in subsetD)
3.71        apply (auto simp: less_eq_real_def norm_minus_commute norm_triangle_half_l)
3.72        done
3.73      have wnotg: "w \<notin> path_image \<gamma>"
3.74 -      using cbg e2 e>0 by (force simp: dist_norm norm_minus_commute)
3.75 +      using cbg e2 \<open>e>0\<close> by (force simp: dist_norm norm_minus_commute)
3.76      { fix k::real
3.77        assume k: "k>0"
3.78        then obtain q where q: "valid_path q" "w \<notin> path_image q"
3.79                               "pathstart q = pathstart \<gamma> \<and> pathfinish q = pathfinish \<gamma>"
3.80                      and qg: "\<And>t. t \<in> {0..1} \<Longrightarrow> cmod (\<gamma> t - q t) < min k (min d e) / 2"
3.81                      and qi: "contour_integral q (\<lambda>u. 1 / (u - w)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> w"
3.82 -        using winding_number [OF \<gamma> wnotg, of "min k (min d e) / 2"] d>0 e>0 k
3.83 +        using winding_number [OF \<gamma> wnotg, of "min k (min d e) / 2"] \<open>d>0\<close> \<open>e>0\<close> k
3.84          by (force simp: min_divide_distrib_right)
3.85        have "contour_integral p (\<lambda>u. 1 / (u - w)) = contour_integral q (\<lambda>u. 1 / (u - w))"
3.86 -        apply (rule pi_eq [OF valid_path q valid_path p, THEN conjunct2, THEN conjunct2, rule_format])
3.87 +        apply (rule pi_eq [OF \<open>valid_path q\<close> \<open>valid_path p\<close>, THEN conjunct2, THEN conjunct2, rule_format])
3.88          apply (frule pg)
3.89          apply (frule qg)
3.90 -        using p q d>0 e2
3.91 +        using p q \<open>d>0\<close> e2
3.92          apply (auto simp: dist_norm norm_minus_commute intro!: holomorphic_intros)
3.93          done
3.94        then have "contour_integral p (\<lambda>x. 1 / (x - w)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> w"
3.95 @@ -3979,11 +3979,11 @@
3.96        and L: "\<And>f B. \<lbrakk>f holomorphic_on - cball z (3 / 4 * pe);
3.97                        \<forall>z \<in> - cball z (3 / 4 * pe). cmod (f z) \<le> B\<rbrakk> \<Longrightarrow>
3.98                        cmod (contour_integral p f) \<le> L * B"
3.99 -    using contour_integral_bound_exists [of "- cball z (3/4*pe)" p] cbp valid_path p by force
3.100 +    using contour_integral_bound_exists [of "- cball z (3/4*pe)" p] cbp \<open>valid_path p\<close> by force
3.101    { fix e::real and w::complex
3.102      assume e: "0 < e" and w: "cmod (w - z) < pe/4" "cmod (w - z) < e * pe\<^sup>2 / (8 * L)"
3.103      then have [simp]: "w \<notin> path_image p"
3.104 -      using cbp p(2) 0 < pe
3.105 +      using cbp p(2) \<open>0 < pe\<close>
3.106        by (force simp: dist_norm norm_minus_commute path_image_def cball_def)
3.107      have [simp]: "contour_integral p (\<lambda>x. 1/(x - w)) - contour_integral p (\<lambda>x. 1/(x - z)) =
3.108                    contour_integral p (\<lambda>x. 1/(x - w) - 1/(x - z))"
3.109 @@ -4001,13 +4001,13 @@
3.110          using pe by auto
3.111        then have "(pe/2)^2 < cmod (w - x) ^ 2"
3.112          apply (rule power_strict_mono)
3.113 -        using pe>0 by auto
3.114 +        using \<open>pe>0\<close> by auto
3.115        then have pe2: "pe^2 < 4 * cmod (w - x) ^ 2"
3.117        have "8 * L * cmod (w - z) < e * pe\<^sup>2"
3.118 -        using w L>0 by (simp add: field_simps)
3.119 +        using w \<open>L>0\<close> by (simp add: field_simps)
3.120        also have "... < e * 4 * cmod (w - x) * cmod (w - x)"
3.121 -        using pe2 e>0 by (simp add: power2_eq_square)
3.122 +        using pe2 \<open>e>0\<close> by (simp add: power2_eq_square)
3.123        also have "... < e * 4 * cmod (w - x) * (4/3 * cmod (z - x))"
3.124          using wx
3.125          apply (rule mult_strict_left_mono)
3.126 @@ -4019,23 +4019,23 @@
3.127        finally have Lwz: "L * cmod (w - z) < e * cmod (w - x) * cmod (z - x)" .
3.128        have "L * cmod (1 / (x - w) - 1 / (x - z)) \<le> e"
3.129          apply (cases "x=z \<or> x=w")
3.130 -        using pe pe>0 w L>0
3.131 +        using pe \<open>pe>0\<close> w \<open>L>0\<close>
3.132          apply (force simp: norm_minus_commute)
3.133 -        using wx w(2) L>0 pe pe2 Lwz
3.134 +        using wx w(2) \<open>L>0\<close> pe pe2 Lwz
3.135          apply (auto simp: divide_simps mult_less_0_iff norm_minus_commute norm_divide norm_mult power2_eq_square)
3.136          done
3.137      } note L_cmod_le = this
3.138      have *: "cmod (contour_integral p (\<lambda>x. 1 / (x - w) - 1 / (x - z))) \<le> L * (e * pe\<^sup>2 / L / 4 * (inverse (pe / 2))\<^sup>2)"
3.139        apply (rule L)
3.140 -      using pe>0 w
3.141 +      using \<open>pe>0\<close> w
3.142        apply (force simp: dist_norm norm_minus_commute intro!: holomorphic_intros)
3.143 -      using pe>0 w L>0
3.144 +      using \<open>pe>0\<close> w \<open>L>0\<close>
3.145        apply (auto simp: cball_def dist_norm field_simps L_cmod_le  simp del: less_divide_eq_numeral1 le_divide_eq_numeral1)
3.146        done
3.147      have "cmod (contour_integral p (\<lambda>x. 1 / (x - w)) - contour_integral p (\<lambda>x. 1 / (x - z))) < 2*e"
3.149        apply (rule le_less_trans [OF *])
3.150 -      using L>0 e
3.151 +      using \<open>L>0\<close> e
3.152        apply (force simp: field_simps)
3.153        done
3.154      then have "cmod (winding_number p w - winding_number p z) < e"
3.155 @@ -4044,10 +4044,10 @@
3.156    } note cmod_wn_diff = this
3.157    show ?thesis
3.158      apply (rule continuous_transform_at [of "min d e / 2" _ "winding_number p"])
3.159 -    apply (auto simp: d>0 e>0 dist_norm wnwn simp del: less_divide_eq_numeral1)
3.160 +    apply (auto simp: \<open>d>0\<close> \<open>e>0\<close> dist_norm wnwn simp del: less_divide_eq_numeral1)
3.161      apply (simp add: continuous_at_eps_delta, clarify)
3.162      apply (rule_tac x="min (pe/4) (e/2*pe^2/L/4)" in exI)
3.163 -    using pe>0 L>0
3.164 +    using \<open>pe>0\<close> \<open>L>0\<close>
3.165      apply (simp add: dist_norm cmod_wn_diff)
3.166      done
3.167  qed
3.168 @@ -4057,7 +4057,7 @@
3.169    by (simp add: continuous_at_imp_continuous_on continuous_at_winding_number)
3.170
3.171
3.172 -subsection{*The winding number is constant on a connected region*}
3.173 +subsection\<open>The winding number is constant on a connected region\<close>
3.174
3.175  lemma winding_number_constant:
3.176    assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" and cs: "connected s" and sg: "s \<inter> path_image \<gamma> = {}"
3.177 @@ -4067,7 +4067,7 @@
3.178      assume ne: "winding_number \<gamma> y \<noteq> winding_number \<gamma> z"
3.179      assume "y \<in> s" "z \<in> s"
3.180      then have "winding_number \<gamma> y \<in> \<int>"  "winding_number \<gamma> z \<in>  \<int>"
3.181 -      using integer_winding_number [OF \<gamma> loop] sg y \<in> s by auto
3.182 +      using integer_winding_number [OF \<gamma> loop] sg \<open>y \<in> s\<close> by auto
3.183      with ne have "1 \<le> cmod (winding_number \<gamma> y - winding_number \<gamma> z)"
3.184        by (auto simp: Ints_def of_int_diff [symmetric] simp del: of_int_diff)
3.185    } note * = this
3.186 @@ -4132,7 +4132,7 @@
3.187        obtain p where p: "polynomial_function p" "pathstart p = pathstart \<gamma>" "pathfinish p = pathfinish \<gamma>"
3.188                   and pg1: "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> cmod (p t - \<gamma> t) < 1)"
3.189                   and pge: "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> cmod (p t - \<gamma> t) < e)"
3.190 -        using path_approx_polynomial_function [OF \<gamma>, of "min 1 e"] e>0 by force
3.191 +        using path_approx_polynomial_function [OF \<gamma>, of "min 1 e"] \<open>e>0\<close> by force
3.192        have pip: "path_image p \<subseteq> ball 0 (B + 1)"
3.193          using B
3.194          apply (clarsimp simp add: path_image_def dist_norm ball_def)
3.195 @@ -4197,7 +4197,7 @@
3.196      hence "x \<notin> path_image \<gamma>"
3.197        by (meson disjoint_iff_not_equal s_disj)
3.198      thus "x \<in> inside (path_image \<gamma>)"
3.199 -      using x \<in> s by (metis (no_types) ComplI UnE cos \<gamma> loop s_disj union_with_outside winding_number_eq winding_number_zero_in_outside wn_nz z)
3.200 +      using \<open>x \<in> s\<close> by (metis (no_types) ComplI UnE cos \<gamma> loop s_disj union_with_outside winding_number_eq winding_number_zero_in_outside wn_nz z)
3.201  qed
3.202    show ?thesis
3.203      apply (rule winding_number_eq [OF \<gamma> loop w])
3.204 @@ -4326,10 +4326,10 @@
3.205      have *: "a \<bullet> z' \<le> b - d / 3 * cmod a"
3.206        unfolding z'_def inner_mult_right' divide_inverse
3.207        apply (simp add: divide_simps algebra_simps dot_square_norm power2_eq_square anz)
3.208 -      apply (metis 0 < d add_increasing azb less_eq_real_def mult_nonneg_nonneg mult_right_mono norm_ge_zero norm_numeral)
3.209 +      apply (metis \<open>0 < d\<close> add_increasing azb less_eq_real_def mult_nonneg_nonneg mult_right_mono norm_ge_zero norm_numeral)
3.210        done
3.211      have "cmod (winding_number \<gamma> z' - winding_number \<gamma> z) < \<bar>Re (winding_number \<gamma> z)\<bar> - 1/2"
3.212 -      using d [of z'] anz d>0 by (simp add: dist_norm z'_def)
3.213 +      using d [of z'] anz \<open>d>0\<close> by (simp add: dist_norm z'_def)
3.214      then have "1/2 < \<bar>Re (winding_number \<gamma> z)\<bar> - cmod (winding_number \<gamma> z' - winding_number \<gamma> z)"
3.215        by simp
3.216      then have "1/2 < \<bar>Re (winding_number \<gamma> z)\<bar> - \<bar>Re (winding_number \<gamma> z') - Re (winding_number \<gamma> z)\<bar>"
3.217 @@ -4338,7 +4338,7 @@
3.218        by linarith
3.219      moreover have "\<bar>Re (winding_number \<gamma> z')\<bar> < 1/2"
3.220        apply (rule winding_number_lt_half [OF \<gamma> *])
3.221 -      using azb d>0 pag
3.222 +      using azb \<open>d>0\<close> pag
3.223        apply (auto simp: add_strict_increasing anz divide_simps algebra_simps dest!: subsetD)
3.224        done
3.225      ultimately have False
3.226 @@ -4372,7 +4372,7 @@
3.227  qed
3.228
3.229
3.230 -subsection{* Cauchy's integral formula, again for a convex enclosing set.*}
3.231 +subsection\<open>Cauchy's integral formula, again for a convex enclosing set.\<close>
3.232
3.233  lemma Cauchy_integral_formula_weak:
3.234      assumes s: "convex s" and "finite k" and conf: "continuous_on s f"
3.235 @@ -4462,7 +4462,7 @@
3.236        using contour_integral_nearby [OF \<open>open s\<close> pak pik, of atends] f by metis
3.237      obtain d where "d>0" and d:
3.238          "\<And>x x'. \<lbrakk>x \<in> {0..1} \<times> {0..1}; x' \<in> {0..1} \<times> {0..1}; norm (x'-x) < d\<rbrakk> \<Longrightarrow> norm (k x' - k x) < e/4"
3.239 -      by (rule uniformly_continuous_onE [OF ucontk, of "e/4"]) (auto simp: dist_norm e>0)
3.240 +      by (rule uniformly_continuous_onE [OF ucontk, of "e/4"]) (auto simp: dist_norm \<open>e>0\<close>)
3.241      { fix t1 t2
3.242        assume t1: "0 \<le> t1" "t1 \<le> 1" and t2: "0 \<le> t2" "t2 \<le> 1" and ltd: "\<bar>t1 - t\<bar> < d" "\<bar>t2 - t\<bar> < d"
3.243        have no2: "\<And>g1 k1 kt. \<lbrakk>norm(g1 - k1) < e/4; norm(k1 - kt) < e/4\<rbrakk> \<Longrightarrow> norm(g1 - kt) < e"
3.244 @@ -4544,7 +4544,7 @@
3.245      have n'N_less: "\<bar>real (Suc n) / real N - t\<bar> < ee t"
3.246        using t N \<open>N > 0\<close> e_le_ee [of t]
3.248 -    have t01: "t \<in> {0..1}" using kk \<subseteq> {0..1} t \<in> kk by blast
3.249 +    have t01: "t \<in> {0..1}" using \<open>kk \<subseteq> {0..1}\<close> \<open>t \<in> kk\<close> by blast
3.250      obtain d1 where "d1 > 0" and d1:
3.251          "\<And>g1 g2. \<lbrakk>valid_path g1; valid_path g2;
3.252                     \<forall>u\<in>{0..1}. cmod (g1 u - k (n/N, u)) < d1 \<and> cmod (g2 u - k ((Suc n) / N, u)) < d1;
3.253 @@ -4562,7 +4562,7 @@
3.254        using N01 by auto
3.255      then have pkn: "path (\<lambda>u. k (n/N, u))"
3.257 -    have min12: "min d1 d2 > 0" by (simp add: 0 < d1 0 < d2)
3.258 +    have min12: "min d1 d2 > 0" by (simp add: \<open>0 < d1\<close> \<open>0 < d2\<close>)
3.259      obtain p where "polynomial_function p"
3.260          and psf: "pathstart p = pathstart (\<lambda>u. k (n/N, u))"
3.261                   "pathfinish p = pathfinish (\<lambda>u. k (n/N, u))"
3.262 @@ -4573,7 +4573,7 @@
3.263        by (metis (mono_tags, lifting) N01(1) ksf linked_paths_def pathfinish_def pathstart_def psf)
3.264      show ?case
3.265        apply (rule_tac x="min d1 d2" in exI)
3.266 -      apply (simp add: 0 < d1 0 < d2, clarify)
3.267 +      apply (simp add: \<open>0 < d1\<close> \<open>0 < d2\<close>, clarify)
3.268        apply (rule_tac s="contour_integral p f" in trans)
3.269        using pk_le N01(1) ksf pathfinish_def pathstart_def

     4.1 --- a/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy	Mon Dec 07 16:48:10 2015 +0000
4.2 +++ b/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy	Mon Dec 07 20:19:59 2015 +0100
4.3 @@ -897,7 +897,7 @@
4.4  proof -
4.5    from assms(4) obtain g' where A: "uniform_limit s (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially"
4.6      unfolding uniformly_convergent_on_def by blast
4.7 -  from x and open s have s: "at x within s = at x" by (rule at_within_open)
4.8 +  from x and \<open>open s\<close> have s: "at x within s = at x" by (rule at_within_open)
4.9    have "\<exists>g. \<forall>x\<in>s. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within s)"
4.10      by (intro has_field_derivative_series[of s f f' g' x0] assms A has_field_derivative_at_within)
4.11    then obtain g where g: "\<And>x. x \<in> s \<Longrightarrow> (\<lambda>n. f n x) sums g x"
4.12 @@ -906,7 +906,7 @@
4.13    from g(2)[OF x] have g': "(g has_derivative op * (g' x)) (at x)"
4.14      by (simp add: has_field_derivative_def s)
4.15    have "((\<lambda>x. \<Sum>n. f n x) has_derivative op * (g' x)) (at x)"
4.16 -    by (rule has_derivative_transform_within_open[OF open s x _ g'])
4.17 +    by (rule has_derivative_transform_within_open[OF \<open>open s\<close> x _ g'])
4.18         (insert g, auto simp: sums_iff)
4.19    thus "(\<lambda>x. \<Sum>n. f n x) complex_differentiable (at x)" unfolding differentiable_def
4.20      by (auto simp: summable_def complex_differentiable_def has_field_derivative_def)
4.21 @@ -919,7 +919,7 @@
4.22    assumes "uniformly_convergent_on s (\<lambda>n x. \<Sum>i<n. f' i x)"
4.23    assumes "x0 \<in> s" "summable (\<lambda>n. f n x0)"
4.24    shows   "(\<lambda>x. \<Sum>n. f n x) complex_differentiable (at x0)"
4.25 -  using complex_differentiable_series[OF assms, of x0] x0 \<in> s by blast+
4.26 +  using complex_differentiable_series[OF assms, of x0] \<open>x0 \<in> s\<close> by blast+
4.27
4.28  subsection\<open>Bound theorem\<close>
4.29

     5.1 --- a/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy	Mon Dec 07 16:48:10 2015 +0000
5.2 +++ b/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy	Mon Dec 07 20:19:59 2015 +0100
5.3 @@ -2116,7 +2116,7 @@
5.4  lemma sin_Arcsin [simp]: "sin(Arcsin z) = z"
5.5  proof -
5.6    have "\<i>*z*2 + csqrt (1 - z\<^sup>2)*2 = 0 \<longleftrightarrow> (\<i>*z)*2 + csqrt (1 - z\<^sup>2)*2 = 0"
5.7 -    by (simp add: algebra_simps)  --\<open>Cancelling a factor of 2\<close>
5.8 +    by (simp add: algebra_simps)  \<comment>\<open>Cancelling a factor of 2\<close>
5.9    moreover have "... \<longleftrightarrow> (\<i>*z) + csqrt (1 - z\<^sup>2) = 0"
5.10      by (metis Arcsin_body_lemma distrib_right no_zero_divisors zero_neq_numeral)
5.11    ultimately show ?thesis
5.12 @@ -2294,7 +2294,7 @@
5.13  lemma cos_Arccos [simp]: "cos(Arccos z) = z"
5.14  proof -
5.15    have "z*2 + \<i> * (2 * csqrt (1 - z\<^sup>2)) = 0 \<longleftrightarrow> z*2 + \<i> * csqrt (1 - z\<^sup>2)*2 = 0"
5.16 -    by (simp add: algebra_simps)  --\<open>Cancelling a factor of 2\<close>
5.17 +    by (simp add: algebra_simps)  \<comment>\<open>Cancelling a factor of 2\<close>
5.18    moreover have "... \<longleftrightarrow> z + \<i> * csqrt (1 - z\<^sup>2) = 0"
5.19      by (metis distrib_right mult_eq_0_iff zero_neq_numeral)
5.20    ultimately show ?thesis

     6.1 --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy	Mon Dec 07 16:48:10 2015 +0000
6.2 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy	Mon Dec 07 20:19:59 2015 +0100
6.3 @@ -266,7 +266,7 @@
6.4    have [simp]: "g  f  S = S"
6.5      using g by (simp add: image_comp)
6.6    have cgf: "closed (g  f  S)"
6.7 -    by (simp add: g \<circ> f = id S image_comp)
6.8 +    by (simp add: \<open>g \<circ> f = id\<close> S image_comp)
6.9    have [simp]: "{x \<in> range f. g x \<in> S} = f  S"
6.10      using g by (simp add: o_def id_def image_def) metis
6.11    show ?thesis
6.12 @@ -5695,7 +5695,7 @@
6.13    apply auto
6.14    done
6.15
6.16 -subsection \<open>On @{text "real"}, @{text "is_interval"}, @{text "convex"} and @{text "connected"} are all equivalent.\<close>
6.17 +subsection \<open>On \<open>real\<close>, \<open>is_interval\<close>, \<open>convex\<close> and \<open>connected\<close> are all equivalent.\<close>
6.18
6.19  lemma is_interval_1:
6.20    "is_interval (s::real set) \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. \<forall> x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> s)"
6.21 @@ -9132,7 +9132,7 @@
6.22      { fix u v x
6.23        assume uv: "setsum u t = 1" "\<forall>x\<in>s. 0 \<le> v x" "setsum v s = 1"
6.24                   "(\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>v\<in>t. u v *\<^sub>R v)" "x \<in> t"
6.25 -      then have s: "s = (s - t) \<union> t" --\<open>split into separate cases\<close>
6.26 +      then have s: "s = (s - t) \<union> t" \<comment>\<open>split into separate cases\<close>
6.27          using assms by auto
6.28        have [simp]: "(\<Sum>x\<in>t. v x *\<^sub>R x) + (\<Sum>x\<in>s - t. v x *\<^sub>R x) = (\<Sum>x\<in>t. u x *\<^sub>R x)"
6.29                     "setsum v t + setsum v (s - t) = 1"
6.30 @@ -9250,7 +9250,7 @@
6.31        using assms by (simp add: aff_independent_finite)
6.32      { fix a b and d::real
6.33        assume ab: "a \<in> s" "b \<in> s" "a \<noteq> b"
6.34 -      then have s: "s = (s - {a,b}) \<union> {a,b}" --\<open>split into separate cases\<close>
6.35 +      then have s: "s = (s - {a,b}) \<union> {a,b}" \<comment>\<open>split into separate cases\<close>
6.36          by auto
6.37        have "(\<Sum>x\<in>s. if x = a then - d else if x = b then d else 0) = 0"
6.38             "(\<Sum>x\<in>s. (if x = a then - d else if x = b then d else 0) *\<^sub>R x) = d *\<^sub>R b - d *\<^sub>R a"

     7.1 --- a/src/HOL/Multivariate_Analysis/Derivative.thy	Mon Dec 07 16:48:10 2015 +0000
7.2 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy	Mon Dec 07 20:19:59 2015 +0100
7.3 @@ -1585,7 +1585,7 @@
7.4
7.5  text \<open>Hence the following eccentric variant of the inverse function theorem.
7.6    This has no continuity assumptions, but we do need the inverse function.
7.7 -  We could put @{text "f' \<circ> g = I"} but this happens to fit with the minimal linear
7.8 +  We could put \<open>f' \<circ> g = I\<close> but this happens to fit with the minimal linear
7.9    algebra theory I've set up so far.\<close>
7.10
7.11  (* move  before left_inverse_linear in Euclidean_Space*)
7.12 @@ -2264,7 +2264,7 @@
7.13  proof -
7.14    from assms(4) obtain g' where A: "uniform_limit s (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially"
7.15      unfolding uniformly_convergent_on_def by blast
7.16 -  from x and open s have s: "at x within s = at x" by (rule at_within_open)
7.17 +  from x and \<open>open s\<close> have s: "at x within s = at x" by (rule at_within_open)
7.18    have "\<exists>g. \<forall>x\<in>s. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within s)"
7.19      by (intro has_field_derivative_series[of s f f' g' x0] assms A has_field_derivative_at_within)
7.20    then obtain g where g: "\<And>x. x \<in> s \<Longrightarrow> (\<lambda>n. f n x) sums g x"
7.21 @@ -2273,7 +2273,7 @@
7.22    from g(2)[OF x] have g': "(g has_derivative op * (g' x)) (at x)"
7.23      by (simp add: has_field_derivative_def s)
7.24    have "((\<lambda>x. \<Sum>n. f n x) has_derivative op * (g' x)) (at x)"
7.25 -    by (rule has_derivative_transform_within_open[OF open s x _ g'])
7.26 +    by (rule has_derivative_transform_within_open[OF \<open>open s\<close> x _ g'])
7.27         (insert g, auto simp: sums_iff)
7.28    thus "(\<lambda>x. \<Sum>n. f n x) differentiable (at x)" unfolding differentiable_def
7.29      by (auto simp: summable_def differentiable_def has_field_derivative_def)
7.30 @@ -2286,7 +2286,7 @@
7.31    assumes "uniformly_convergent_on s (\<lambda>n x. \<Sum>i<n. f' i x)"
7.32    assumes "x0 \<in> s" "summable (\<lambda>n. f n x0)"
7.33    shows   "(\<lambda>x. \<Sum>n. f n x) differentiable (at x0)"
7.34 -  using differentiable_series[OF assms, of x0] x0 \<in> s by blast+
7.35 +  using differentiable_series[OF assms, of x0] \<open>x0 \<in> s\<close> by blast+
7.36
7.37  text \<open>Considering derivative @{typ "real \<Rightarrow> 'b::real_normed_vector"} as a vector.\<close>
7.38

     8.1 --- a/src/HOL/Multivariate_Analysis/Integration.thy	Mon Dec 07 16:48:10 2015 +0000
8.2 +++ b/src/HOL/Multivariate_Analysis/Integration.thy	Mon Dec 07 20:19:59 2015 +0100
8.3 @@ -9574,7 +9574,7 @@
8.4  subsection \<open>Geometric progression\<close>
8.5
8.6  text \<open>FIXME: Should one or more of these theorems be moved to @{file
8.7 -"~~/src/HOL/Set_Interval.thy"}, alongside @{text geometric_sum}?\<close>
8.8 +"~~/src/HOL/Set_Interval.thy"}, alongside \<open>geometric_sum\<close>?\<close>
8.9
8.10  lemma sum_gp_basic:
8.11    fixes x :: "'a::ring_1"

     9.1 --- a/src/HOL/Multivariate_Analysis/Linear_Algebra.thy	Mon Dec 07 16:48:10 2015 +0000
9.2 +++ b/src/HOL/Multivariate_Analysis/Linear_Algebra.thy	Mon Dec 07 20:19:59 2015 +0100
9.3 @@ -476,7 +476,7 @@
9.4    apply auto
9.5    done
9.6
9.7 -lemma approachable_lt_le2:  --\<open>like the above, but pushes aside an extra formula\<close>
9.8 +lemma approachable_lt_le2:  \<comment>\<open>like the above, but pushes aside an extra formula\<close>
9.9      "(\<exists>(d::real) > 0. \<forall>x. Q x \<longrightarrow> f x < d \<longrightarrow> P x) \<longleftrightarrow> (\<exists>d>0. \<forall>x. f x \<le> d \<longrightarrow> Q x \<longrightarrow> P x)"
9.10    apply auto
9.11    apply (rule_tac x="d/2" in exI, auto)

    10.1 --- a/src/HOL/Multivariate_Analysis/Operator_Norm.thy	Mon Dec 07 16:48:10 2015 +0000
10.2 +++ b/src/HOL/Multivariate_Analysis/Operator_Norm.thy	Mon Dec 07 20:19:59 2015 +0100
10.3 @@ -9,7 +9,7 @@
10.4  imports Complex_Main
10.5  begin
10.6
10.7 -text \<open>This formulation yields zero if @{text 'a} is the trivial vector space.\<close>
10.8 +text \<open>This formulation yields zero if \<open>'a\<close> is the trivial vector space.\<close>
10.9
10.10  definition onorm :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> real"
10.11    where "onorm f = (SUP x. norm (f x) / norm x)"

    11.1 --- a/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy	Mon Dec 07 16:48:10 2015 +0000
11.2 +++ b/src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy	Mon Dec 07 20:19:59 2015 +0100
11.3 @@ -174,7 +174,7 @@
11.4        inner_Basis_SUP_left Sup_prod_def less_prod_def less_eq_prod_def eucl_le[where 'a='a]
11.5        eucl_le[where 'a='b] abs_prod_def abs_inner)
11.6
11.7 -text\<open>Instantiation for intervals on @{text ordered_euclidean_space}\<close>
11.8 +text\<open>Instantiation for intervals on \<open>ordered_euclidean_space\<close>\<close>
11.9
11.10  lemma
11.11    fixes a :: "'a::ordered_euclidean_space"

    12.1 --- a/src/HOL/Multivariate_Analysis/Path_Connected.thy	Mon Dec 07 16:48:10 2015 +0000
12.2 +++ b/src/HOL/Multivariate_Analysis/Path_Connected.thy	Mon Dec 07 20:19:59 2015 +0100
12.3 @@ -755,14 +755,14 @@
12.4    then have umin': "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; t < u\<rbrakk> \<Longrightarrow>  g t \<in> S"
12.5      using closure_def by fastforce
12.6    { assume "u \<noteq> 0"
12.7 -    then have "u > 0" using 0 \<le> u by auto
12.8 +    then have "u > 0" using \<open>0 \<le> u\<close> by auto
12.9      { fix e::real assume "e > 0"
12.10        obtain d where "d>0" and d: "\<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u < d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e"
12.11 -        using continuous_onD [OF gcon _ e > 0] 0 \<le> _ _ \<le> 1 atLeastAtMost_iff by auto
12.12 +        using continuous_onD [OF gcon _ \<open>e > 0\<close>] \<open>0 \<le> _\<close> \<open>_ \<le> 1\<close> atLeastAtMost_iff by auto
12.13        have *: "dist (max 0 (u - d / 2)) u < d"
12.14 -        using 0 \<le> u u \<le> 1 d > 0 by (simp add: dist_real_def)
12.15 +        using \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close> by (simp add: dist_real_def)
12.16        have "\<exists>y\<in>S. dist y (g u) < e"
12.17 -        using 0 < u u \<le> 1 d > 0
12.18 +        using \<open>0 < u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close>
12.19          by (force intro: d [OF _ *] umin')
12.20      }
12.21      then have "g u \<in> closure S"
12.22 @@ -770,8 +770,8 @@
12.23    }
12.24    then show ?thesis
12.25      apply (rule_tac u=u in that)
12.26 -    apply (auto simp: 0 \<le> u u \<le> 1 gu interior_closure umin)
12.27 -    using _ \<le> 1 interior_closure umin apply fastforce
12.28 +    apply (auto simp: \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> gu interior_closure umin)
12.29 +    using \<open>_ \<le> 1\<close> interior_closure umin apply fastforce
12.30      done
12.31  qed
12.32
12.33 @@ -785,9 +785,9 @@
12.34               and gunot: "(g u \<notin> interior S)" and u0: "(u = 0 \<or> g u \<in> closure S)"
12.35      using subpath_to_frontier_explicit [OF assms] by blast
12.36    show ?thesis
12.37 -    apply (rule that [OF 0 \<le> u u \<le> 1])
12.38 +    apply (rule that [OF \<open>0 \<le> u\<close> \<open>u \<le> 1\<close>])
12.40 -    using 0 \<le> u u0 by (force simp: subpath_def gxin)
12.41 +    using \<open>0 \<le> u\<close> u0 by (force simp: subpath_def gxin)
12.42  qed
12.43
12.44  lemma subpath_to_frontier:
12.45 @@ -800,9 +800,9 @@
12.46                          (\<forall>x. 0 \<le> x \<and> x < 1 \<longrightarrow> subpath 0 u g x \<in> interior S) \<and> g u \<in> closure S"
12.47      using subpath_to_frontier_strong [OF g g1] by blast
12.48    show ?thesis
12.49 -    apply (rule that [OF 0 \<le> u u \<le> 1])
12.50 +    apply (rule that [OF \<open>0 \<le> u\<close> \<open>u \<le> 1\<close>])
12.51      apply (metis DiffI disj frontier_def g0 notin pathstart_def)
12.52 -    using 0 \<le> u g0 disj
12.53 +    using \<open>0 \<le> u\<close> g0 disj
12.55      apply (auto simp: closed_segment_eq_real_ivl pathstart_def pathfinish_def subpath_def)
12.56      apply (rename_tac y)
12.57 @@ -840,7 +840,7 @@
12.58                      "pathfinish h \<in> frontier S"
12.59      using exists_path_subpath_to_frontier [OF g _ g1] closure_closed [OF S] g0 by auto
12.60    show ?thesis
12.61 -    apply (rule that [OF path h])
12.62 +    apply (rule that [OF \<open>path h\<close>])
12.63      using assms h
12.64      apply auto
12.65      apply (metis diff_single_insert frontier_subset_eq insert_iff interior_subset subset_iff)
12.66 @@ -1555,9 +1555,9 @@
12.67    case False
12.68    then obtain a where "a \<in> s" by auto
12.69    { fix x y assume "x \<notin> s" "y \<notin> s"
12.70 -    then have "x \<noteq> a" "y \<noteq> a" using a \<in> s by auto
12.71 +    then have "x \<noteq> a" "y \<noteq> a" using \<open>a \<in> s\<close> by auto
12.72      then have bxy: "bounded(insert x (insert y s))"
12.73 -      by (simp add: bounded s)
12.74 +      by (simp add: \<open>bounded s\<close>)
12.75      then obtain B::real where B: "0 < B" and Bx: "norm (a - x) < B" and By: "norm (a - y) < B"
12.76                            and "s \<subseteq> ball a B"
12.77        using bounded_subset_ballD [OF bxy, of a] by (auto simp: dist_norm)
12.78 @@ -1565,7 +1565,7 @@
12.79      { fix u
12.80        assume u: "(1 - u) *\<^sub>R x + u *\<^sub>R (a + C *\<^sub>R (x - a)) \<in> s" and "0 \<le> u" "u \<le> 1"
12.81        have CC: "1 \<le> 1 + (C - 1) * u"
12.82 -        using x \<noteq> a 0 \<le> u
12.83 +        using \<open>x \<noteq> a\<close> \<open>0 \<le> u\<close>
12.84          apply (simp add: C_def divide_simps norm_minus_commute)
12.85          using Bx by auto
12.86        have *: "\<And>v. (1 - u) *\<^sub>R x + u *\<^sub>R (a + v *\<^sub>R (x - a)) = a + (1 + (v - 1) * u) *\<^sub>R (x - a)"
12.87 @@ -1583,24 +1583,24 @@
12.88        finally have xeq: "(1 - 1 / (1 + (C - 1) * u)) *\<^sub>R a + (1 / (1 + (C - 1) * u)) *\<^sub>R (a + (1 + (C - 1) * u) *\<^sub>R (x - a)) = x"
12.90        have False
12.91 -        using convex s
12.92 +        using \<open>convex s\<close>
12.94          apply (drule_tac x=a in bspec)
12.95 -         apply (rule  a \<in> s)
12.96 +         apply (rule  \<open>a \<in> s\<close>)
12.97          apply (drule_tac x="a + (1 + (C - 1) * u) *\<^sub>R (x - a)" in bspec)
12.98           using u apply (simp add: *)
12.99          apply (drule_tac x="1 / (1 + (C - 1) * u)" in spec)
12.100 -        using x \<noteq> a x \<notin> s 0 \<le> u CC
12.101 +        using \<open>x \<noteq> a\<close> \<open>x \<notin> s\<close> \<open>0 \<le> u\<close> CC
12.102          apply (auto simp: xeq)
12.103          done
12.104      }
12.105      then have pcx: "path_component (- s) x (a + C *\<^sub>R (x - a))"
12.106        by (force simp: closed_segment_def intro!: path_connected_linepath)
12.107 -    def D == "B / norm(y - a)"  --{*massive duplication with the proof above*}
12.108 +    def D == "B / norm(y - a)"  \<comment>\<open>massive duplication with the proof above\<close>
12.109      { fix u
12.110        assume u: "(1 - u) *\<^sub>R y + u *\<^sub>R (a + D *\<^sub>R (y - a)) \<in> s" and "0 \<le> u" "u \<le> 1"
12.111        have DD: "1 \<le> 1 + (D - 1) * u"
12.112 -        using y \<noteq> a 0 \<le> u
12.113 +        using \<open>y \<noteq> a\<close> \<open>0 \<le> u\<close>
12.114          apply (simp add: D_def divide_simps norm_minus_commute)
12.115          using By by auto
12.116        have *: "\<And>v. (1 - u) *\<^sub>R y + u *\<^sub>R (a + v *\<^sub>R (y - a)) = a + (1 + (v - 1) * u) *\<^sub>R (y - a)"
12.117 @@ -1618,14 +1618,14 @@
12.118        finally have xeq: "(1 - 1 / (1 + (D - 1) * u)) *\<^sub>R a + (1 / (1 + (D - 1) * u)) *\<^sub>R (a + (1 + (D - 1) * u) *\<^sub>R (y - a)) = y"
12.120        have False
12.121 -        using convex s
12.122 +        using \<open>convex s\<close>
12.124          apply (drule_tac x=a in bspec)
12.125 -         apply (rule  a \<in> s)
12.126 +         apply (rule  \<open>a \<in> s\<close>)
12.127          apply (drule_tac x="a + (1 + (D - 1) * u) *\<^sub>R (y - a)" in bspec)
12.128           using u apply (simp add: *)
12.129          apply (drule_tac x="1 / (1 + (D - 1) * u)" in spec)
12.130 -        using y \<noteq> a y \<notin> s 0 \<le> u DD
12.131 +        using \<open>y \<noteq> a\<close> \<open>y \<notin> s\<close> \<open>0 \<le> u\<close> DD
12.132          apply (auto simp: xeq)
12.133          done
12.134      }
12.135 @@ -1633,10 +1633,10 @@
12.136        by (force simp: closed_segment_def intro!: path_connected_linepath)
12.137      have pyx: "path_component (- s) (a + D *\<^sub>R (y - a)) (a + C *\<^sub>R (x - a))"
12.138        apply (rule path_component_of_subset [of "{x. norm(x - a) = B}"])
12.139 -       using s \<subseteq> ball a B
12.140 +       using \<open>s \<subseteq> ball a B\<close>
12.141         apply (force simp: ball_def dist_norm norm_minus_commute)
12.142        apply (rule path_connected_sphere [OF 2, of a B, simplified path_connected_component, rule_format])
12.143 -      using x \<noteq> a  using y \<noteq> a  B apply (auto simp: C_def D_def)
12.144 +      using \<open>x \<noteq> a\<close>  using \<open>y \<noteq> a\<close>  B apply (auto simp: C_def D_def)
12.145        done
12.146      have "path_component (- s) x y"
12.147        by (metis path_component_trans path_component_sym pcx pdy pyx)
12.148 @@ -1834,7 +1834,7 @@
12.149  proof -
12.150    obtain dx dy where "dx \<ge> 0" "dy \<ge> 0" "x = B + dx" "y = B + dy"
12.152 -  with 0 \<le> u u \<le> 1 show ?thesis
12.153 +  with \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> show ?thesis
12.155  qed
12.156
12.157 @@ -2036,20 +2036,20 @@
12.158        by (metis mem_Collect_eq)
12.159      def C \<equiv> "((B + 1 + norm z) / norm (z-a))"
12.160      have "C > 0"
12.161 -      using 0 < B zna by (simp add: C_def divide_simps add_strict_increasing)
12.162 +      using \<open>0 < B\<close> zna by (simp add: C_def divide_simps add_strict_increasing)
12.163      have "\<bar>norm (z + C *\<^sub>R (z-a)) - norm (C *\<^sub>R (z-a))\<bar> \<le> norm z"
12.165      moreover have "norm (C *\<^sub>R (z-a)) > norm z + B"
12.166 -      using zna B>0 by (simp add: C_def le_max_iff_disj field_simps)
12.167 +      using zna \<open>B>0\<close> by (simp add: C_def le_max_iff_disj field_simps)
12.168      ultimately have C: "norm (z + C *\<^sub>R (z-a)) > B" by linarith
12.169      { fix u::real
12.170        assume u: "0\<le>u" "u\<le>1" and ins: "(1 - u) *\<^sub>R z + u *\<^sub>R (z + C *\<^sub>R (z - a)) \<in> s"
12.171        then have Cpos: "1 + u * C > 0"
12.172 -        by (meson 0 < C add_pos_nonneg less_eq_real_def zero_le_mult_iff zero_less_one)
12.173 +        by (meson \<open>0 < C\<close> add_pos_nonneg less_eq_real_def zero_le_mult_iff zero_less_one)
12.174        then have *: "(1 / (1 + u * C)) *\<^sub>R z + (u * C / (1 + u * C)) *\<^sub>R z = z"
12.176        then have False
12.177 -        using convexD_alt [OF s a \<in> s ins, of "1/(u*C + 1)"] C>0 z \<notin> s Cpos u
12.178 +        using convexD_alt [OF s \<open>a \<in> s\<close> ins, of "1/(u*C + 1)"] \<open>C>0\<close> \<open>z \<notin> s\<close> Cpos u
12.179          by (simp add: * divide_simps algebra_simps)
12.180      } note contra = this
12.181      have "connected_component (- s) z (z + C *\<^sub>R (z-a))"
12.182 @@ -2250,7 +2250,7 @@
12.183    next
12.184      case False
12.185        have front: "frontier t \<subseteq> - s"
12.186 -        using s \<subseteq> t frontier_disjoint_eq t by auto
12.187 +        using \<open>s \<subseteq> t\<close> frontier_disjoint_eq t by auto
12.188        { fix \<gamma>
12.189          assume "path \<gamma>" and pimg_sbs: "path_image \<gamma> - {pathfinish \<gamma>} \<subseteq> interior (- t)"
12.190             and pf: "pathfinish \<gamma> \<in> frontier t" and ps: "pathstart \<gamma> = a"
12.191 @@ -2267,20 +2267,20 @@
12.192          have pimg_sbs_cos: "path_image \<gamma> \<subseteq> -s"
12.193            using pimg_sbs apply (auto simp: path_image_def)
12.194            apply (drule subsetD)
12.195 -          using c \<in> - s s \<subseteq> t interior_subset apply (auto simp: c_def)
12.196 +          using \<open>c \<in> - s\<close> \<open>s \<subseteq> t\<close> interior_subset apply (auto simp: c_def)
12.197            done
12.198          have "closed_segment c d \<le> cball c \<epsilon>"
12.200            apply (rule hull_minimal)
12.201 -          using  \<epsilon> > 0 d apply (auto simp: dist_commute)
12.202 +          using  \<open>\<epsilon> > 0\<close> d apply (auto simp: dist_commute)
12.203            done
12.204          with \<epsilon> have "closed_segment c d \<subseteq> -s" by blast
12.205          moreover have con_gcd: "connected (path_image \<gamma> \<union> closed_segment c d)"
12.206 -          by (rule connected_Un) (auto simp: c_def path \<gamma> connected_path_image)
12.207 +          by (rule connected_Un) (auto simp: c_def \<open>path \<gamma>\<close> connected_path_image)
12.208          ultimately have "connected_component (- s) a d"
12.209            unfolding connected_component_def using pimg_sbs_cos ps by blast
12.210          then have "outside s \<inter> t \<noteq> {}"
12.211 -          using outside_same_component [OF _ a]  by (metis IntI d \<in> t empty_iff)
12.212 +          using outside_same_component [OF _ a]  by (metis IntI \<open>d \<in> t\<close> empty_iff)
12.213        } note * = this
12.214        have pal: "pathstart (linepath a b) \<in> closure (- t)"
12.215          by (auto simp: False closure_def)
12.216 @@ -2328,10 +2328,10 @@
12.217      moreover have "outside s \<inter> inside t \<noteq> {}"
12.218        by (meson False assms(4) compact_eq_bounded_closed coms open_inside outside_compact_in_open t)
12.219      ultimately have "inside s \<inter> t = {}"
12.220 -      using inside_outside_intersect_connected [OF connected t, of s]
12.221 +      using inside_outside_intersect_connected [OF \<open>connected t\<close>, of s]
12.222        by (metis "2" compact_eq_bounded_closed coms connected_outside inf.commute inside_outside_intersect_connected outst)
12.223      then show ?thesis
12.224 -      using inside_inside [OF s \<subseteq> inside t] by blast
12.225 +      using inside_inside [OF \<open>s \<subseteq> inside t\<close>] by blast
12.226    qed
12.227  qed
12.228

    13.1 --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Mon Dec 07 16:48:10 2015 +0000
13.2 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Mon Dec 07 20:19:59 2015 +0100
13.3 @@ -728,7 +728,7 @@
13.4                   openin (subtopology euclidean s) e2 \<and>
13.5                   s \<subseteq> e1 \<union> e2 \<and> e1 \<inter> e2 = {} \<and> e1 \<noteq> {} \<and> e2 \<noteq> {})"
13.6    apply (simp add: connected_def openin_open, safe)
13.7 -  apply (simp_all, blast+)  --\<open>slow\<close>
13.8 +  apply (simp_all, blast+)  \<comment>\<open>slow\<close>
13.9    done
13.10
13.11  lemma connected_open_in_eq:
13.12 @@ -1898,7 +1898,7 @@
13.13    next
13.14      assume "\<forall>x \<in> s. connected_component_set s x = s"
13.15      then show "connected s"
13.16 -      by (metis x \<in> s connected_connected_component)
13.17 +      by (metis \<open>x \<in> s\<close> connected_connected_component)
13.18    qed
13.19  qed
13.20
13.21 @@ -5211,7 +5211,7 @@
13.22  lemma Lim_trivial_limit: "trivial_limit net \<Longrightarrow> (f ---> l) net"
13.23    by simp
13.24
13.25 -lemmas continuous_on = continuous_on_def -- "legacy theorem name"
13.26 +lemmas continuous_on = continuous_on_def \<comment> "legacy theorem name"
13.27
13.28  lemma continuous_within_subset:
13.29    "continuous (at x within s) f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> continuous (at x within t) f"

    14.1 --- a/src/HOL/Multivariate_Analysis/Uniform_Limit.thy	Mon Dec 07 16:48:10 2015 +0000
14.2 +++ b/src/HOL/Multivariate_Analysis/Uniform_Limit.thy	Mon Dec 07 20:19:59 2015 +0100
14.3 @@ -209,7 +209,7 @@
14.4        fix x assume x: "x \<in> X"
14.5        with assms have "(\<lambda>n. f n x) ----> ?f x"
14.6          by (auto dest!: Cauchy_convergent uniformly_Cauchy_imp_Cauchy simp: convergent_LIMSEQ_iff)
14.7 -      with e/2 > 0 have "eventually (\<lambda>m. m \<ge> N \<and> dist (f m x) (?f x) < e/2) sequentially"
14.8 +      with \<open>e/2 > 0\<close> have "eventually (\<lambda>m. m \<ge> N \<and> dist (f m x) (?f x) < e/2) sequentially"
14.9          by (intro tendstoD eventually_conj eventually_ge_at_top)
14.10        then obtain m where m: "m \<ge> N" "dist (f m x) (?f x) < e/2"
14.11          unfolding eventually_at_top_linorder by blast

    15.1 --- a/src/HOL/Probability/Binary_Product_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
15.2 +++ b/src/HOL/Probability/Binary_Product_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
15.3 @@ -2,7 +2,7 @@
15.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
15.5  *)
15.6
15.7 -section {*Binary product measures*}
15.8 +section \<open>Binary product measures\<close>
15.9
15.10  theory Binary_Product_Measure
15.11  imports Nonnegative_Lebesgue_Integration
15.12 @@ -249,17 +249,17 @@
15.13      have "(\<Sum>i. emeasure M (?C x i)) = emeasure M (\<Union>i. ?C x i)"
15.14      proof (intro suminf_emeasure)
15.15        show "range (?C x) \<subseteq> sets M"
15.16 -        using F Q \<in> sets (N \<Otimes>\<^sub>M M) by (auto intro!: sets_Pair1)
15.17 +        using F \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close> by (auto intro!: sets_Pair1)
15.18        have "disjoint_family F" using F by auto
15.19        show "disjoint_family (?C x)"
15.20 -        by (rule disjoint_family_on_bisimulation[OF disjoint_family F]) auto
15.21 +        by (rule disjoint_family_on_bisimulation[OF \<open>disjoint_family F\<close>]) auto
15.22      qed
15.23      also have "(\<Union>i. ?C x i) = Pair x - Q"
15.24 -      using F sets.sets_into_space[OF Q \<in> sets (N \<Otimes>\<^sub>M M)]
15.25 +      using F sets.sets_into_space[OF \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close>]
15.26        by (auto simp: space_pair_measure)
15.27      finally have "emeasure M (Pair x - Q) = (\<Sum>i. emeasure M (?C x i))"
15.28        by simp }
15.29 -  ultimately show ?thesis using Q \<in> sets (N \<Otimes>\<^sub>M M) F_sets
15.30 +  ultimately show ?thesis using \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close> F_sets
15.31      by auto
15.32  qed
15.33
15.34 @@ -320,7 +320,7 @@
15.36  qed
15.37
15.38 -subsection {* Binary products of $\sigma$-finite emeasure spaces *}
15.39 +subsection \<open>Binary products of $\sigma$-finite emeasure spaces\<close>
15.40
15.41  locale pair_sigma_finite = M1?: sigma_finite_measure M1 + M2?: sigma_finite_measure M2
15.42    for M1 :: "'a measure" and M2 :: "'b measure"
15.43 @@ -359,7 +359,7 @@
15.44        then obtain i j where "fst x \<in> F1 i" "snd x \<in> F2 j"
15.45          by (auto simp: space)
15.46        then have "fst x \<in> F1 (max i j)" "snd x \<in> F2 (max j i)"
15.47 -        using incseq F1 incseq F2 unfolding incseq_def
15.48 +        using \<open>incseq F1\<close> \<open>incseq F2\<close> unfolding incseq_def
15.49          by (force split: split_max)+
15.50        then have "(fst x, snd x) \<in> F1 (max i j) \<times> F2 (max i j)"
15.51          by (intro SigmaI) (auto simp add: max.commute)
15.52 @@ -369,7 +369,7 @@
15.53        using space by (auto simp: space)
15.54    next
15.55      fix i show "incseq (\<lambda>i. F1 i \<times> F2 i)"
15.56 -      using incseq F1 incseq F2 unfolding incseq_Suc_iff by auto
15.57 +      using \<open>incseq F1\<close> \<open>incseq F2\<close> unfolding incseq_Suc_iff by auto
15.58    next
15.59      fix i
15.60      from F1 F2 have "F1 i \<in> sets M1" "F2 i \<in> sets M2" by auto
15.61 @@ -453,7 +453,7 @@
15.62      using assms unfolding eventually_ae_filter by auto
15.63    show ?thesis
15.64    proof (rule AE_I)
15.65 -    from N measurable_emeasure_Pair1[OF N \<in> sets (M1 \<Otimes>\<^sub>M M2)]
15.66 +    from N measurable_emeasure_Pair1[OF \<open>N \<in> sets (M1 \<Otimes>\<^sub>M M2)\<close>]
15.67      show "emeasure M1 {x\<in>space M1. emeasure M2 (Pair x - N) \<noteq> 0} = 0"
15.68        by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff emeasure_nonneg)
15.69      show "{x \<in> space M1. emeasure M2 (Pair x - N) \<noteq> 0} \<in> sets M1"
15.70 @@ -464,7 +464,7 @@
15.71          show "emeasure M2 (Pair x - N) = 0" by fact
15.72          show "Pair x - N \<in> sets M2" using N(1) by (rule sets_Pair1)
15.73          show "{y \<in> space M2. \<not> Q (x, y)} \<subseteq> Pair x - N"
15.74 -          using N x \<in> space M1 unfolding space_pair_measure by auto
15.75 +          using N \<open>x \<in> space M1\<close> unfolding space_pair_measure by auto
15.76        qed }
15.77      then show "{x \<in> space M1. \<not> (AE y in M2. Q (x, y))} \<subseteq> {x \<in> space M1. emeasure M2 (Pair x - N) \<noteq> 0}"
15.78        by auto
15.79 @@ -599,7 +599,7 @@
15.80    shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f x y \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f x y \<partial>M2) \<partial>M1)"
15.81    using Fubini[OF f] by simp
15.82
15.83 -subsection {* Products on counting spaces, densities and distributions *}
15.84 +subsection \<open>Products on counting spaces, densities and distributions\<close>
15.85
15.86  lemma sigma_prod:
15.87    assumes X_cover: "\<exists>E\<subseteq>A. countable E \<and> X = \<Union>E" and A: "A \<subseteq> Pow X"
15.88 @@ -628,18 +628,18 @@
15.89        fix a assume "a \<in> A"
15.90        from Y_cover obtain E where E: "E \<subseteq> B" "countable E" and "Y = \<Union>E"
15.91          by auto
15.92 -      with a \<in> A A have eq: "fst - a \<inter> X \<times> Y = (\<Union>e\<in>E. a \<times> e)"
15.93 +      with \<open>a \<in> A\<close> A have eq: "fst - a \<inter> X \<times> Y = (\<Union>e\<in>E. a \<times> e)"
15.94          by auto
15.95        show "fst - a \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
15.96 -        using a \<in> A E unfolding eq by (auto intro!: XY.countable_UN')
15.97 +        using \<open>a \<in> A\<close> E unfolding eq by (auto intro!: XY.countable_UN')
15.98      next
15.99        fix b assume "b \<in> B"
15.100        from X_cover obtain E where E: "E \<subseteq> A" "countable E" and "X = \<Union>E"
15.101          by auto
15.102 -      with b \<in> B B have eq: "snd - b \<inter> X \<times> Y = (\<Union>e\<in>E. e \<times> b)"
15.103 +      with \<open>b \<in> B\<close> B have eq: "snd - b \<inter> X \<times> Y = (\<Union>e\<in>E. e \<times> b)"
15.104          by auto
15.105        show "snd - b \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
15.106 -        using b \<in> B E unfolding eq by (auto intro!: XY.countable_UN')
15.107 +        using \<open>b \<in> B\<close> E unfolding eq by (auto intro!: XY.countable_UN')
15.108      qed
15.109    next
15.110      fix Z assume "Z \<in> {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
15.111 @@ -769,9 +769,9 @@
15.112      with A have "emeasure (?A \<Otimes>\<^sub>M ?B) C \<le> emeasure (?A \<Otimes>\<^sub>M ?B) A"
15.113        by (intro emeasure_mono) auto
15.114      also have "emeasure (?A \<Otimes>\<^sub>M ?B) C = emeasure (count_space UNIV) C"
15.115 -      using countable C by (rule *)
15.116 +      using \<open>countable C\<close> by (rule *)
15.117      finally show ?thesis
15.118 -      using infinite C infinite A by simp
15.119 +      using \<open>infinite C\<close> \<open>infinite A\<close> by simp
15.120    qed
15.121  qed
15.122
15.123 @@ -799,7 +799,7 @@
15.124      by (auto simp add: nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator)
15.125  next
15.126    { fix x assume "f x \<noteq> 0"
15.127 -    with 0 \<le> f x have "(\<exists>r. 0 < r \<and> f x = ereal r) \<or> f x = \<infinity>"
15.128 +    with \<open>0 \<le> f x\<close> have "(\<exists>r. 0 < r \<and> f x = ereal r) \<or> f x = \<infinity>"
15.129        by (cases "f x") (auto simp: less_le)
15.130      then have "\<exists>n. ereal (1 / real (Suc n)) \<le> f x"
15.131        by (auto elim!: nat_approx_posE intro!: less_imp_le) }
15.132 @@ -814,16 +814,16 @@
15.133      by (metis infinite_countable_subset')
15.134
15.135    have [measurable]: "C \<in> sets ?P"
15.136 -    using sets.countable[OF _ countable C, of ?P] by (auto simp: sets_Pair)
15.137 +    using sets.countable[OF _ \<open>countable C\<close>, of ?P] by (auto simp: sets_Pair)
15.138
15.139    have "(\<integral>\<^sup>+x. ereal (1/Suc n) * indicator C x \<partial>?P) \<le> nn_integral ?P f"
15.140      using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric])
15.141    moreover have "(\<integral>\<^sup>+x. ereal (1/Suc n) * indicator C x \<partial>?P) = \<infinity>"
15.142 -    using infinite C by (simp add: nn_integral_cmult emeasure_count_space_prod_eq)
15.143 +    using \<open>infinite C\<close> by (simp add: nn_integral_cmult emeasure_count_space_prod_eq)
15.144    moreover have "(\<integral>\<^sup>+x. ereal (1/Suc n) * indicator C x \<partial>count_space UNIV) \<le> nn_integral (count_space UNIV) f"
15.145      using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric])
15.146    moreover have "(\<integral>\<^sup>+x. ereal (1/Suc n) * indicator C x \<partial>count_space UNIV) = \<infinity>"
15.147 -    using infinite C by (simp add: nn_integral_cmult)
15.148 +    using \<open>infinite C\<close> by (simp add: nn_integral_cmult)
15.149    ultimately show ?thesis
15.150      by simp
15.151  qed
15.152 @@ -930,11 +930,11 @@
15.153  next
15.154    fix X assume X: "X \<subseteq> S1 \<times> S2"
15.155    then have "countable X"
15.156 -    by (metis countable_subset countable S1 countable S2 countable_SIGMA)
15.157 +    by (metis countable_subset \<open>countable S1\<close> \<open>countable S2\<close> countable_SIGMA)
15.158    have "X = (\<Union>(a, b)\<in>X. {a} \<times> {b})" by auto
15.159    also have "\<dots> \<in> sets (M \<Otimes>\<^sub>M N)"
15.160      using X
15.161 -    by (safe intro!: sets.countable_UN' countable X subsetI pair_measureI) (auto simp: M N)
15.162 +    by (safe intro!: sets.countable_UN' \<open>countable X\<close> subsetI pair_measureI) (auto simp: M N)
15.163    finally show "X \<in> sets (M \<Otimes>\<^sub>M N)" .
15.164  qed
15.165
15.166 @@ -977,7 +977,7 @@
15.167    finally show ?thesis .
15.168  next
15.169    { fix xy assume "f xy \<noteq> 0"
15.170 -    with 0 \<le> f xy have "(\<exists>r. 0 < r \<and> f xy = ereal r) \<or> f xy = \<infinity>"
15.171 +    with \<open>0 \<le> f xy\<close> have "(\<exists>r. 0 < r \<and> f xy = ereal r) \<or> f xy = \<infinity>"
15.172        by (cases "f xy") (auto simp: less_le)
15.173      then have "\<exists>n. ereal (1 / real (Suc n)) \<le> f xy"
15.174        by (auto elim!: nat_approx_posE intro!: less_imp_le) }
15.175 @@ -1060,7 +1060,7 @@
15.176  using _ _ assms(1)
15.177  by(rule measurable_compose_countable'[where f="\<lambda>a b. f (a, snd b)" and g=fst and I=A, simplified])simp_all
15.178
15.179 -subsection {* Product of Borel spaces *}
15.180 +subsection \<open>Product of Borel spaces\<close>
15.181
15.182  lemma borel_Times:
15.183    fixes A :: "'a::topological_space set" and B :: "'b::topological_space set"

    16.1 --- a/src/HOL/Probability/Bochner_Integration.thy	Mon Dec 07 16:48:10 2015 +0000
16.2 +++ b/src/HOL/Probability/Bochner_Integration.thy	Mon Dec 07 20:19:59 2015 +0100
16.3 @@ -2,18 +2,18 @@
16.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
16.5  *)
16.6
16.7 -section {* Bochner Integration for Vector-Valued Functions *}
16.8 +section \<open>Bochner Integration for Vector-Valued Functions\<close>
16.9
16.10  theory Bochner_Integration
16.11    imports Finite_Product_Measure
16.12  begin
16.13
16.14 -text {*
16.15 +text \<open>
16.16
16.17  In the following development of the Bochner integral we use second countable topologies instead
16.18  of separable spaces. A second countable topology is also separable.
16.19
16.20 -*}
16.21 +\<close>
16.22
16.23  lemma borel_measurable_implies_sequence_metric:
16.24    fixes f :: "'a \<Rightarrow> 'b :: {metric_space, second_countable_topology}"
16.25 @@ -28,7 +28,7 @@
16.26    { fix n x
16.27      obtain d where "d \<in> D" and d: "d \<in> ball x (1 / Suc n)"
16.28        using D[of "ball x (1 / Suc n)"] by auto
16.29 -    from d \<in> D D[of UNIV] countable D obtain i where "d = e i"
16.30 +    from \<open>d \<in> D\<close> D[of UNIV] \<open>countable D\<close> obtain i where "d = e i"
16.31        unfolding e_def by (auto dest: from_nat_into_surj)
16.32      with d have "\<exists>i. dist x (e i) < 1 / Suc n"
16.33        by auto }
16.34 @@ -109,16 +109,16 @@
16.35        then have "\<And>i. F i x = z"
16.36          by (auto simp: F_def)
16.37        then show ?thesis
16.38 -        using f x = z by auto
16.39 +        using \<open>f x = z\<close> by auto
16.40      next
16.41        assume "f x \<noteq> z"
16.42
16.43        show ?thesis
16.44        proof (rule tendstoI)
16.45          fix e :: real assume "0 < e"
16.46 -        with f x \<noteq> z obtain n where "1 / Suc n < e" "1 / Suc n < dist (f x) z"
16.47 +        with \<open>f x \<noteq> z\<close> obtain n where "1 / Suc n < e" "1 / Suc n < dist (f x) z"
16.48            by (metis dist_nz order_less_trans neq_iff nat_approx_posE)
16.49 -        with x\<in>space M f x \<noteq> z have "x \<in> (\<Union>i. B n i)"
16.50 +        with \<open>x\<in>space M\<close> \<open>f x \<noteq> z\<close> have "x \<in> (\<Union>i. B n i)"
16.51            unfolding A_def B_def UN_disjointed_eq using e by auto
16.52          then obtain i where i: "x \<in> B n i" by auto
16.53
16.54 @@ -131,7 +131,7 @@
16.55            also have "\<dots> \<le> 1 / Suc n"
16.56              using j m_upper[OF _ _ i]
16.57              by (auto simp: field_simps)
16.58 -          also note 1 / Suc n < e
16.59 +          also note \<open>1 / Suc n < e\<close>
16.60            finally show "dist (F j x) (f x) < e"
16.61              by (simp add: less_imp_le dist_commute)
16.62          qed
16.63 @@ -292,7 +292,7 @@
16.64      with nn show "m * indicator {x \<in> space M. 0 \<noteq> f x} x \<le> f x"
16.65        using f by (auto split: split_indicator simp: simple_function_def m_def)
16.66    qed
16.67 -  also note \<dots> < \<infinity>
16.68 +  also note \<open>\<dots> < \<infinity>\<close>
16.69    finally show ?thesis
16.70      using m by auto
16.71  next
16.72 @@ -556,7 +556,7 @@
16.73    have sbi: "simple_bochner_integrable M (indicator A::'a \<Rightarrow> real)"
16.74    proof
16.75      have "{y \<in> space M. (indicator A y::real) \<noteq> 0} = A"
16.76 -      using sets.sets_into_space[OF A\<in>sets M] by (auto split: split_indicator)
16.77 +      using sets.sets_into_space[OF \<open>A\<in>sets M\<close>] by (auto split: split_indicator)
16.78      then show "emeasure M {y \<in> space M. (indicator A y::real) \<noteq> 0} \<noteq> \<infinity>"
16.79        using A by auto
16.80    qed (rule simple_function_indicator assms)+
16.81 @@ -743,7 +743,7 @@
16.82    then have "(\<integral>\<^sup>+x. norm (s i x) \<partial>M) \<le> (\<integral>\<^sup>+x. ereal m * indicator {x\<in>space M. s i x \<noteq> 0} x \<partial>M)"
16.83      by (auto split: split_indicator intro!: Max_ge nn_integral_mono simp:)
16.84    also have "\<dots> < \<infinity>"
16.85 -    using s by (subst nn_integral_cmult_indicator) (auto simp: 0 \<le> m simple_bochner_integrable.simps)
16.86 +    using s by (subst nn_integral_cmult_indicator) (auto simp: \<open>0 \<le> m\<close> simple_bochner_integrable.simps)
16.87    finally have s_fin: "(\<integral>\<^sup>+x. norm (s i x) \<partial>M) < \<infinity>" .
16.88
16.89    have "(\<integral>\<^sup>+ x. norm (f x) \<partial>M) \<le> (\<integral>\<^sup>+ x. ereal (norm (f x - s i x)) + ereal (norm (s i x)) \<partial>M)"
16.90 @@ -824,7 +824,7 @@
16.91      show "eventually (\<lambda>i. norm (?s i - ?t i) \<le> ?S i + ?T i) sequentially"
16.92        by (intro always_eventually allI simple_bochner_integral_bounded s t f)
16.93      show "(\<lambda>i. ?S i + ?T i) ----> ereal 0"
16.94 -      using tendsto_add_ereal[OF _ _ ?S ----> 0 ?T ----> 0]
16.95 +      using tendsto_add_ereal[OF _ _ \<open>?S ----> 0\<close> \<open>?T ----> 0\<close>]
16.97    qed
16.98    then have "(\<lambda>i. norm (?s i - ?t i)) ----> 0"
16.99 @@ -1159,7 +1159,7 @@
16.100        have "norm (?s n - ?s m) \<le> ?S n + ?S m"
16.101          by (intro simple_bochner_integral_bounded s f)
16.102        also have "\<dots> < ereal (e / 2) + e / 2"
16.103 -        using ereal_add_strict_mono[OF less_imp_le[OF M[OF n]] _ ?S n \<noteq> \<infinity> M[OF m]]
16.104 +        using ereal_add_strict_mono[OF less_imp_le[OF M[OF n]] _ \<open>?S n \<noteq> \<infinity>\<close> M[OF m]]
16.105          by (auto simp: nn_integral_nonneg)
16.106        also have "\<dots> = e" by simp
16.107        finally show "dist (?s n) (?s m) < e"
16.108 @@ -1460,7 +1460,7 @@
16.109      using bound[of 0] by eventually_elim (auto intro: norm_ge_zero order_trans)
16.110    then have "(\<integral>\<^sup>+x. w x \<partial>M) = (\<integral>\<^sup>+x. norm (w x) \<partial>M)"
16.111      by (intro nn_integral_cong_AE) auto
16.112 -  with integrable M w have w: "w \<in> borel_measurable M" "(\<integral>\<^sup>+x. w x \<partial>M) < \<infinity>"
16.113 +  with \<open>integrable M w\<close> have w: "w \<in> borel_measurable M" "(\<integral>\<^sup>+x. w x \<partial>M) < \<infinity>"
16.114      unfolding integrable_iff_bounded by auto
16.115
16.116    show int_s: "\<And>i. integrable M (s i)"
16.117 @@ -1690,7 +1690,7 @@
16.118     (\<And>i x. x \<in> space M \<Longrightarrow> norm (s i x) \<le> 2 * norm (f x)) \<Longrightarrow> integrable M f \<Longrightarrow> P f"
16.119    shows "P f"
16.120  proof -
16.121 -  from integrable M f have f: "f \<in> borel_measurable M" "(\<integral>\<^sup>+x. norm (f x) \<partial>M) < \<infinity>"
16.122 +  from \<open>integrable M f\<close> have f: "f \<in> borel_measurable M" "(\<integral>\<^sup>+x. norm (f x) \<partial>M) < \<infinity>"
16.123      unfolding integrable_iff_bounded by auto
16.124    from borel_measurable_implies_sequence_metric[OF f(1)]
16.125    obtain s where s: "\<And>i. simple_function M (s i)" "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. s i x) ----> f x"
16.126 @@ -1746,7 +1746,7 @@
16.127      fix x assume "x \<in> space M" with s show "(\<lambda>i. s' i x) ----> f x"
16.129      show "norm (s' i x) \<le> 2 * norm (f x)"
16.130 -      using x \<in> space M s by (simp add: s'_eq_s)
16.131 +      using \<open>x \<in> space M\<close> s by (simp add: s'_eq_s)
16.132    qed fact
16.133  qed
16.134
16.135 @@ -1838,7 +1838,7 @@
16.137  qed
16.138
16.139 -subsection {* Restricted measure spaces *}
16.140 +subsection \<open>Restricted measure spaces\<close>
16.141
16.142  lemma integrable_restrict_space:
16.143    fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
16.144 @@ -1890,7 +1890,7 @@
16.145    thus ?thesis by simp
16.146  qed
16.147
16.148 -subsection {* Measure spaces with an associated density *}
16.149 +subsection \<open>Measure spaces with an associated density\<close>
16.150
16.151  lemma integrable_density:
16.152    fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}" and g :: "'a \<Rightarrow> real"
16.153 @@ -1972,7 +1972,7 @@
16.154      has_bochner_integral M (\<lambda>x. g x *\<^sub>R f x) x \<Longrightarrow> has_bochner_integral (density M g) f x"
16.155    by (simp add: has_bochner_integral_iff integrable_density integral_density)
16.156
16.157 -subsection {* Distributions *}
16.158 +subsection \<open>Distributions\<close>
16.159
16.160  lemma integrable_distr_eq:
16.161    fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
16.162 @@ -2044,7 +2044,7 @@
16.163      has_bochner_integral M (\<lambda>x. f (g x)) x \<Longrightarrow> has_bochner_integral (distr M N g) f x"
16.164    by (simp add: has_bochner_integral_iff integrable_distr_eq integral_distr)
16.165
16.166 -subsection {* Lebesgue integration on @{const count_space} *}
16.167 +subsection \<open>Lebesgue integration on @{const count_space}\<close>
16.168
16.169  lemma integrable_count_space:
16.170    fixes f :: "'a \<Rightarrow> 'b::{banach,second_countable_topology}"
16.171 @@ -2109,7 +2109,7 @@
16.172    shows "integrable (count_space UNIV) f \<Longrightarrow> integral\<^sup>L (count_space UNIV) f = (\<Sum>x. f x)"
16.173    using sums_integral_count_space_nat by (rule sums_unique)
16.174
16.175 -subsection {* Point measure *}
16.176 +subsection \<open>Point measure\<close>
16.177
16.178  lemma lebesgue_integral_point_measure_finite:
16.179    fixes g :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
16.180 @@ -2126,7 +2126,7 @@
16.181    apply (auto simp: AE_count_space integrable_count_space)
16.182    done
16.183
16.184 -subsection {* Lebesgue integration on @{const null_measure} *}
16.185 +subsection \<open>Lebesgue integration on @{const null_measure}\<close>
16.186
16.187  lemma has_bochner_integral_null_measure_iff[iff]:
16.188    "has_bochner_integral (null_measure M) f 0 \<longleftrightarrow> f \<in> borel_measurable M"
16.189 @@ -2140,7 +2140,7 @@
16.190    by (cases "integrable (null_measure M) f")
16.191       (auto simp add: not_integrable_integral_eq has_bochner_integral_integral_eq)
16.192
16.193 -subsection {* Legacy lemmas for the real-valued Lebesgue integral *}
16.194 +subsection \<open>Legacy lemmas for the real-valued Lebesgue integral\<close>
16.195
16.196  lemma real_lebesgue_integral_def:
16.197    assumes f[measurable]: "integrable M f"
16.198 @@ -2388,7 +2388,7 @@
16.199        using int A by (simp add: integrable_def)
16.200      ultimately have "emeasure M A = 0"
16.201        using emeasure_nonneg[of M A] by simp
16.202 -    with (emeasure M) A \<noteq> 0 show False by auto
16.203 +    with \<open>(emeasure M) A \<noteq> 0\<close> show False by auto
16.204    qed
16.205    ultimately show ?thesis by auto
16.206  qed
16.207 @@ -2413,7 +2413,7 @@
16.208      show "AE x in M. (\<lambda>n. indicator {..X n} x *\<^sub>R f x) ----> f x"
16.209      proof
16.210        fix x
16.211 -      from filterlim X at_top sequentially
16.212 +      from \<open>filterlim X at_top sequentially\<close>
16.213        have "eventually (\<lambda>n. x \<le> X n) sequentially"
16.214          unfolding filterlim_at_top_ge[where c=x] by auto
16.215        then show "(\<lambda>n. indicator {..X n} x *\<^sub>R f x) ----> f x"
16.216 @@ -2455,7 +2455,7 @@
16.217      by (auto simp: _has_bochner_integral_iff)
16.218  qed
16.219
16.220 -subsection {* Product measure *}
16.221 +subsection \<open>Product measure\<close>
16.222
16.223  lemma (in sigma_finite_measure) borel_measurable_lebesgue_integrable[measurable (raw)]:
16.224    fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _::{banach, second_countable_topology}"
16.225 @@ -2823,7 +2823,7 @@
16.226      have f_borel: "f \<in> borel_measurable (Pi\<^sub>M (insert i I) M)"
16.227        using f by auto
16.228      show "(\<lambda>y. f (x(i := y))) \<in> borel_measurable (M i)"
16.229 -      using measurable_comp[OF measurable_component_update f_borel, OF x i \<notin> I]
16.230 +      using measurable_comp[OF measurable_component_update f_borel, OF x \<open>i \<notin> I\<close>]
16.231        unfolding comp_def .
16.232      from x I show "(\<integral> y. f (merge I {i} (x,y)) \<partial>Pi\<^sub>M {i} M) = (\<integral> xa. f (x(i := xa i)) \<partial>Pi\<^sub>M {i} M)"
16.233        by (auto intro!: integral_cong arg_cong[where f=f] simp: merge_def space_PiM extensional_def PiE_def)
16.234 @@ -2867,7 +2867,7 @@
16.235      by (intro product_integrable_setprod insert(4)) (auto intro: finite_subset)
16.236    interpret I: finite_product_sigma_finite M I by standard fact
16.237    have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
16.238 -    using i \<notin> I by (auto intro!: setprod.cong)
16.239 +    using \<open>i \<notin> I\<close> by (auto intro!: setprod.cong)
16.240    show ?case
16.241      unfolding product_integral_insert[OF insert(1,2) prod[OF subset_refl]]
16.242      by (simp add: * insert prod subset_insertI)

    17.1 --- a/src/HOL/Probability/Borel_Space.thy	Mon Dec 07 16:48:10 2015 +0000
17.2 +++ b/src/HOL/Probability/Borel_Space.thy	Mon Dec 07 20:19:59 2015 +0100
17.3 @@ -3,7 +3,7 @@
17.4      Author:     Armin Heller, TU MÃ¼nchen
17.5  *)
17.6
17.7 -section {*Borel spaces*}
17.8 +section \<open>Borel spaces\<close>
17.9
17.10  theory Borel_Space
17.11  imports
17.12 @@ -22,7 +22,7 @@
17.13      by (auto intro: topological_basis_prod topological_basis_trivial topological_basis_imp_subbasis)
17.14  qed
17.15
17.16 -subsection {* Generic Borel spaces *}
17.17 +subsection \<open>Generic Borel spaces\<close>
17.18
17.19  definition borel :: "'a::topological_space measure" where
17.20    "borel = sigma UNIV {S. open S}"
17.21 @@ -182,7 +182,7 @@
17.22        by metis
17.23      def U \<equiv> "(\<Union>k\<in>K. m k)"
17.24      with m have "countable U"
17.25 -      by (intro countable_subset[OF _ countable B]) auto
17.26 +      by (intro countable_subset[OF _ \<open>countable B\<close>]) auto
17.27      have "\<Union>U = (\<Union>A\<in>U. A)" by simp
17.28      also have "\<dots> = \<Union>K"
17.29        unfolding U_def UN_simps by (simp add: m)
17.30 @@ -195,9 +195,9 @@
17.31      then have "(\<Union>b\<in>U. u b) \<subseteq> \<Union>K" "\<Union>U \<subseteq> (\<Union>b\<in>U. u b)"
17.32        by auto
17.33      then have "\<Union>K = (\<Union>b\<in>U. u b)"
17.34 -      unfolding \<Union>U = \<Union>K by auto
17.35 +      unfolding \<open>\<Union>U = \<Union>K\<close> by auto
17.36      also have "\<dots> \<in> sigma_sets UNIV X"
17.37 -      using u UN by (intro X.countable_UN' countable U) auto
17.38 +      using u UN by (intro X.countable_UN' \<open>countable U\<close>) auto
17.39      finally show "\<Union>K \<in> sigma_sets UNIV X" .
17.40    qed auto
17.41  qed (auto simp: eq intro: generate_topology.Basis)
17.42 @@ -257,7 +257,7 @@
17.43    fix X::"'a set" assume "open X"
17.44    from open_countable_basisE[OF this] guess B' . note B' = this
17.45    then show "X \<in> sigma_sets UNIV B"
17.46 -    by (blast intro: sigma_sets_UNION countable B countable_subset)
17.47 +    by (blast intro: sigma_sets_UNION \<open>countable B\<close> countable_subset)
17.48  next
17.49    fix b assume "b \<in> B"
17.50    hence "open b" by (rule topological_basis_open[OF assms(2)])
17.51 @@ -302,7 +302,7 @@
17.52      unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto
17.53  qed
17.54
17.55 -subsection {* Borel spaces on order topologies *}
17.56 +subsection \<open>Borel spaces on order topologies\<close>
17.57
17.58
17.59  lemma borel_Iio:
17.60 @@ -441,7 +441,7 @@
17.61    finally show ?thesis .
17.62  qed
17.63
17.64 -subsection {* Borel spaces on euclidean spaces *}
17.65 +subsection \<open>Borel spaces on euclidean spaces\<close>
17.66
17.67  lemma borel_measurable_inner[measurable (raw)]:
17.68    fixes f g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_inner}"
17.69 @@ -603,7 +603,7 @@
17.70    fix M :: "'a set" assume "M \<in> {S. open S}"
17.71    then have "open M" by simp
17.72    show "M \<in> ?SIGMA"
17.73 -    apply (subst open_UNION_box[OF open M])
17.74 +    apply (subst open_UNION_box[OF \<open>open M\<close>])
17.75      apply (safe intro!: sets.countable_UN' countable_PiE countable_Collect)
17.76      apply (auto intro: countable_rat)
17.77      done
17.78 @@ -746,7 +746,7 @@
17.79    fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis"
17.80    then have i: "i \<in> Basis" by auto
17.81    have "{x::'a. a \<le> x\<bullet>i} = UNIV - {x::'a. x\<bullet>i < a}" by auto
17.82 -  also have *: "{x::'a. x\<bullet>i < a} = (\<Union>k::nat. {x. x <e (\<Sum>n\<in>Basis. (if n = i then a else real k) *\<^sub>R n)})" using i\<in> Basis
17.83 +  also have *: "{x::'a. x\<bullet>i < a} = (\<Union>k::nat. {x. x <e (\<Sum>n\<in>Basis. (if n = i then a else real k) *\<^sub>R n)})" using \<open>i\<in> Basis\<close>
17.84    proof (safe, simp_all add: eucl_less_def split: split_if_asm)
17.85      fix x :: 'a
17.86      from reals_Archimedean2[of "Max ((\<lambda>i. x\<bullet>i)Basis)"]
17.87 @@ -817,13 +817,13 @@
17.88    fix x :: "'a set" assume "open x"
17.89    hence "x = UNIV - (UNIV - x)" by auto
17.90    also have "\<dots> \<in> sigma_sets UNIV (Collect closed)"
17.91 -    by (force intro: sigma_sets.Compl simp: open x)
17.92 +    by (force intro: sigma_sets.Compl simp: \<open>open x\<close>)
17.93    finally show "x \<in> sigma_sets UNIV (Collect closed)" by simp
17.94  next
17.95    fix x :: "'a set" assume "closed x"
17.96    hence "x = UNIV - (UNIV - x)" by auto
17.97    also have "\<dots> \<in> sigma_sets UNIV (Collect open)"
17.98 -    by (force intro: sigma_sets.Compl simp: closed x)
17.99 +    by (force intro: sigma_sets.Compl simp: \<open>closed x\<close>)
17.100    finally show "x \<in> sigma_sets UNIV (Collect open)" by simp
17.101  qed simp_all
17.102
17.103 @@ -965,12 +965,12 @@
17.104    show "(\<lambda>x. a + b *\<^sub>R f x) - S \<inter> space M \<in> sets M"
17.105    proof cases
17.106      assume "b \<noteq> 0"
17.107 -    with open S have "open ((\<lambda>x. (- a + x) /\<^sub>R b)  S)" (is "open ?S")
17.108 +    with \<open>open S\<close> have "open ((\<lambda>x. (- a + x) /\<^sub>R b)  S)" (is "open ?S")
17.109        using open_affinity [of S "inverse b" "- a /\<^sub>R b"]
17.110        by (auto simp: algebra_simps)
17.111      hence "?S \<in> sets borel" by auto
17.112      moreover
17.113 -    from b \<noteq> 0 have "(\<lambda>x. a + b *\<^sub>R f x) - S = f - ?S"
17.114 +    from \<open>b \<noteq> 0\<close> have "(\<lambda>x. a + b *\<^sub>R f x) - S = f - ?S"
17.115        apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all)
17.116      ultimately show ?thesis using assms unfolding in_borel_measurable_borel
17.117        by auto
17.118 @@ -1315,7 +1315,7 @@
17.119    shows "(\<lambda>x. (\<Sum>i. f i x)) \<in> borel_measurable M"
17.120    unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp
17.121
17.122 -subsection {* LIMSEQ is borel measurable *}
17.123 +subsection \<open>LIMSEQ is borel measurable\<close>
17.124
17.125  lemma borel_measurable_LIMSEQ:
17.126    fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
17.127 @@ -1352,7 +1352,7 @@
17.128    proof cases
17.129      assume "A \<noteq> {}"
17.130      then have "\<And>x. infdist x A = 0 \<longleftrightarrow> x \<in> A"
17.131 -      using closed A by (simp add: in_closed_iff_infdist_zero)
17.132 +      using \<open>closed A\<close> by (simp add: in_closed_iff_infdist_zero)
17.133      then have "g - A \<inter> space M = {x\<in>space M. infdist (g x) A = 0}"
17.134        by auto
17.135      also have "\<dots> \<in> sets M"

    18.1 --- a/src/HOL/Probability/Caratheodory.thy	Mon Dec 07 16:48:10 2015 +0000
18.2 +++ b/src/HOL/Probability/Caratheodory.thy	Mon Dec 07 20:19:59 2015 +0100
18.3 @@ -3,15 +3,15 @@
18.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
18.5  *)
18.6
18.7 -section {*Caratheodory Extension Theorem*}
18.8 +section \<open>Caratheodory Extension Theorem\<close>
18.9
18.10  theory Caratheodory
18.11    imports Measure_Space
18.12  begin
18.13
18.14 -text {*
18.15 +text \<open>
18.16    Originally from the Hurd/Coble measure theory development, translated by Lawrence Paulson.
18.17 -*}
18.18 +\<close>
18.19
18.20  lemma suminf_ereal_2dimen:
18.21    fixes f:: "nat \<times> nat \<Rightarrow> ereal"
18.22 @@ -45,7 +45,7 @@
18.23                       SUP_ereal_setsum[symmetric] incseq_setsumI setsum_nonneg)
18.24  qed
18.25
18.26 -subsection {* Characterizations of Measures *}
18.27 +subsection \<open>Characterizations of Measures\<close>
18.28
18.30    "subadditive M f \<longleftrightarrow> (\<forall>x\<in>M. \<forall>y\<in>M. x \<inter> y = {} \<longrightarrow> f (x \<union> y) \<le> f x + f y)"
18.31 @@ -60,7 +60,7 @@
18.32  lemma subadditiveD: "subadditive M f \<Longrightarrow> x \<inter> y = {} \<Longrightarrow> x \<in> M \<Longrightarrow> y \<in> M \<Longrightarrow> f (x \<union> y) \<le> f x + f y"
18.34
18.35 -subsubsection {* Lambda Systems *}
18.36 +subsubsection \<open>Lambda Systems\<close>
18.37
18.38  definition lambda_system where
18.39    "lambda_system \<Omega> M f = {l \<in> M. \<forall>x \<in> M. f (l \<inter> x) + f ((\<Omega> - l) \<inter> x) = f x}"
18.40 @@ -393,7 +393,7 @@
18.41    assumes posf: "positive M f" and "0 < e" and "outer_measure M f X \<noteq> \<infinity>"
18.42    shows "\<exists>A. range A \<subseteq> M \<and> disjoint_family A \<and> X \<subseteq> (\<Union>i. A i) \<and> (\<Sum>i. f (A i)) \<le> outer_measure M f X + e"
18.43  proof -
18.44 -  from outer_measure M f X \<noteq> \<infinity> have fin: "\<bar>outer_measure M f X\<bar> \<noteq> \<infinity>"
18.45 +  from \<open>outer_measure M f X \<noteq> \<infinity>\<close> have fin: "\<bar>outer_measure M f X\<bar> \<noteq> \<infinity>"
18.46      using outer_measure_nonneg[OF posf, of X] by auto
18.47    show ?thesis
18.48      using Inf_ereal_close[OF fin[unfolded outer_measure_def INF_def], OF \<open>0 < e\<close>]
18.49 @@ -509,7 +509,7 @@
18.50  lemma measure_down: "measure_space \<Omega> N \<mu> \<Longrightarrow> sigma_algebra \<Omega> M \<Longrightarrow> M \<subseteq> N \<Longrightarrow> measure_space \<Omega> M \<mu>"
18.52
18.53 -subsection {* Caratheodory's theorem *}
18.54 +subsection \<open>Caratheodory's theorem\<close>
18.55
18.56  theorem (in ring_of_sets) caratheodory':
18.57    assumes posf: "positive M f" and ca: "countably_additive M f"
18.58 @@ -546,7 +546,7 @@
18.59    show "\<forall>A\<in>M. f A \<noteq> \<infinity>" using fin by auto
18.60  qed (rule cont)
18.61
18.62 -subsection {* Volumes *}
18.63 +subsection \<open>Volumes\<close>
18.64
18.65  definition volume :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ereal) \<Rightarrow> bool" where
18.66    "volume M f \<longleftrightarrow>
18.67 @@ -575,16 +575,16 @@
18.68  proof -
18.69    have "AI \<subseteq> M" "disjoint (AI)" "finite (AI)" "\<Union>(AI) \<in> M"
18.70      using A unfolding SUP_def by (auto simp: disjoint_family_on_disjoint_image)
18.71 -  with volume M f have "f (\<Union>(AI)) = (\<Sum>a\<in>AI. f a)"
18.72 +  with \<open>volume M f\<close> have "f (\<Union>(AI)) = (\<Sum>a\<in>AI. f a)"
18.73      unfolding volume_def by blast
18.74    also have "\<dots> = (\<Sum>i\<in>I. f (A i))"
18.75    proof (subst setsum.reindex_nontrivial)
18.76      fix i j assume "i \<in> I" "j \<in> I" "i \<noteq> j" "A i = A j"
18.77 -    with disjoint_family_on A I have "A i = {}"
18.78 +    with \<open>disjoint_family_on A I\<close> have "A i = {}"
18.79        by (auto simp: disjoint_family_on_def)
18.80      then show "f (A i) = 0"
18.81 -      using volume_empty[OF volume M f] by simp
18.82 -  qed (auto intro: finite I)
18.83 +      using volume_empty[OF \<open>volume M f\<close>] by simp
18.84 +  qed (auto intro: \<open>finite I\<close>)
18.85    finally show "f (UNION I A) = (\<Sum>i\<in>I. f (A i))"
18.86      by simp
18.87  qed
18.88 @@ -622,15 +622,15 @@
18.89      proof (intro setsum.cong refl)
18.90        fix d assume "d \<in> D"
18.91        have Un_eq_d: "(\<Union>c\<in>C. c \<inter> d) = d"
18.92 -        using d \<in> D \<Union>C = \<Union>D by auto
18.93 +        using \<open>d \<in> D\<close> \<open>\<Union>C = \<Union>D\<close> by auto
18.94        moreover have "\<mu> (\<Union>c\<in>C. c \<inter> d) = (\<Sum>c\<in>C. \<mu> (c \<inter> d))"
18.96          { fix c assume "c \<in> C" then show "c \<inter> d \<in> M"
18.97 -            using C D d \<in> D by auto }
18.98 +            using C D \<open>d \<in> D\<close> by auto }
18.99          show "(\<Union>a\<in>C. a \<inter> d) \<in> M"
18.100 -          unfolding Un_eq_d using d \<in> D D by auto
18.101 +          unfolding Un_eq_d using \<open>d \<in> D\<close> D by auto
18.102          show "disjoint_family_on (\<lambda>a. a \<inter> d) C"
18.103 -          using disjoint C by (auto simp: disjoint_family_on_def disjoint_def)
18.104 +          using \<open>disjoint C\<close> by (auto simp: disjoint_family_on_def disjoint_def)
18.105        qed fact+
18.106        ultimately show "\<mu> d = (\<Sum>c\<in>C. \<mu> (c \<inter> d))" by simp
18.107      qed }
18.108 @@ -659,7 +659,7 @@
18.110    next
18.111      fix a assume "a \<in> ?R" then guess Ca .. note Ca = this
18.112 -    with \<mu>'[of Ca] volume M \<mu>[THEN volume_positive]
18.113 +    with \<mu>'[of Ca] \<open>volume M \<mu>\<close>[THEN volume_positive]
18.114      show "0 \<le> \<mu>' a"
18.115        by (auto intro!: setsum_nonneg)
18.116    next
18.117 @@ -671,10 +671,10 @@
18.118      with Ca Cb have "Ca \<inter> Cb \<subseteq> {{}}" by auto
18.119      then have C_Int_cases: "Ca \<inter> Cb = {{}} \<or> Ca \<inter> Cb = {}" by auto
18.120
18.121 -    from a \<inter> b = {} have "\<mu>' (\<Union>(Ca \<union> Cb)) = (\<Sum>c\<in>Ca \<union> Cb. \<mu> c)"
18.122 +    from \<open>a \<inter> b = {}\<close> have "\<mu>' (\<Union>(Ca \<union> Cb)) = (\<Sum>c\<in>Ca \<union> Cb. \<mu> c)"
18.123        using Ca Cb by (intro \<mu>') (auto intro!: disjoint_union)
18.124      also have "\<dots> = (\<Sum>c\<in>Ca \<union> Cb. \<mu> c) + (\<Sum>c\<in>Ca \<inter> Cb. \<mu> c)"
18.125 -      using C_Int_cases volume_empty[OF volume M \<mu>] by (elim disjE) simp_all
18.126 +      using C_Int_cases volume_empty[OF \<open>volume M \<mu>\<close>] by (elim disjE) simp_all
18.127      also have "\<dots> = (\<Sum>c\<in>Ca. \<mu> c) + (\<Sum>c\<in>Cb. \<mu> c)"
18.128        using Ca Cb by (simp add: setsum.union_inter)
18.129      also have "\<dots> = \<mu>' a + \<mu>' b"
18.130 @@ -684,7 +684,7 @@
18.131    qed
18.132  qed
18.133
18.134 -subsubsection {* Caratheodory on semirings *}
18.135 +subsubsection \<open>Caratheodory on semirings\<close>
18.136
18.137  theorem (in semiring_of_sets) caratheodory:
18.138    assumes pos: "positive M \<mu>" and ca: "countably_additive M \<mu>"
18.139 @@ -698,14 +698,14 @@
18.140
18.141      fix C assume sets_C: "C \<subseteq> M" "\<Union>C \<in> M" and "disjoint C" "finite C"
18.142      have "\<exists>F'. bij_betw F' {..<card C} C"
18.143 -      by (rule finite_same_card_bij[OF _ finite C]) auto
18.144 +      by (rule finite_same_card_bij[OF _ \<open>finite C\<close>]) auto
18.145      then guess F' .. note F' = this
18.146      then have F': "C = F'  {..< card C}" "inj_on F' {..< card C}"
18.147        by (auto simp: bij_betw_def)
18.148      { fix i j assume *: "i < card C" "j < card C" "i \<noteq> j"
18.149        with F' have "F' i \<in> C" "F' j \<in> C" "F' i \<noteq> F' j"
18.150          unfolding inj_on_def by auto
18.151 -      with disjoint C[THEN disjointD]
18.152 +      with \<open>disjoint C\<close>[THEN disjointD]
18.153        have "F' i \<inter> F' j = {}"
18.154          by auto }
18.155      note F'_disj = this
18.156 @@ -733,7 +733,7 @@
18.157      finally show "\<mu> (\<Union>C) = (\<Sum>c\<in>C. \<mu> c)" .
18.158    next
18.159      show "\<mu> {} = 0"
18.160 -      using positive M \<mu> by (rule positiveD1)
18.161 +      using \<open>positive M \<mu>\<close> by (rule positiveD1)
18.162    qed
18.163    from extend_volume[OF this] obtain \<mu>_r where
18.164      V: "volume generated_ring \<mu>_r" "\<And>a. a \<in> M \<Longrightarrow> \<mu> a = \<mu>_r a"
18.165 @@ -758,7 +758,7 @@
18.166          and Un_A: "(\<Union>i. A i) \<in> generated_ring"
18.167          using A' C'
18.168          by (auto intro!: G.Int G.finite_Union intro: generated_ringI_Basic simp: disjoint_family_on_def)
18.169 -      from A C' c \<in> C' have UN_eq: "(\<Union>i. A i) = c"
18.170 +      from A C' \<open>c \<in> C'\<close> have UN_eq: "(\<Union>i. A i) = c"
18.171          by (auto simp: A_def)
18.172
18.173        have "\<forall>i::nat. \<exists>f::nat \<Rightarrow> 'a set. \<mu>_r (A i) = (\<Sum>j. \<mu>_r (f j)) \<and> disjoint_family f \<and> \<Union>range f = A i \<and> (\<forall>j. f j \<in> M)"
18.174 @@ -769,7 +769,7 @@
18.175          from generated_ringE[OF this] guess C . note C = this
18.176
18.177          have "\<exists>F'. bij_betw F' {..<card C} C"
18.178 -          by (rule finite_same_card_bij[OF _ finite C]) auto
18.179 +          by (rule finite_same_card_bij[OF _ \<open>finite C\<close>]) auto
18.180          then guess F .. note F = this
18.181          def f \<equiv> "\<lambda>i. if i < card C then F i else {}"
18.182          then have f: "bij_betw f {..< card C} C"
18.183 @@ -831,7 +831,7 @@
18.184        also have "\<dots> = (\<Sum>n. \<mu> (case_prod f (prod_decode n)))"
18.185          using f V(2) by (auto intro!: arg_cong[where f=suminf] split: prod.split)
18.186        also have "\<dots> = \<mu> (\<Union>i. case_prod f (prod_decode i))"
18.187 -        using f c \<in> C' C'
18.188 +        using f \<open>c \<in> C'\<close> C'
18.189          by (intro ca[unfolded countably_additive_def, rule_format])
18.190             (auto split: prod.split simp: UN_f_eq d UN_eq)
18.191        finally have "(\<Sum>n. \<mu>_r (A' n \<inter> c)) = \<mu> c"
18.192 @@ -858,7 +858,7 @@
18.193      finally show "(\<Sum>n. \<mu>_r (A' n)) = \<mu>_r (\<Union>i. A' i)"
18.194        using C' by simp
18.195    qed
18.196 -  from G.caratheodory'[OF positive generated_ring \<mu>_r countably_additive generated_ring \<mu>_r]
18.197 +  from G.caratheodory'[OF \<open>positive generated_ring \<mu>_r\<close> \<open>countably_additive generated_ring \<mu>_r\<close>]
18.198    guess \<mu>' ..
18.199    with V show ?thesis
18.200      unfolding sigma_sets_generated_ring_eq

    19.1 --- a/src/HOL/Probability/Complete_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
19.2 +++ b/src/HOL/Probability/Complete_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
19.3 @@ -256,7 +256,7 @@
19.4        have "?F (f x) - ?N = main_part M (?F (f x)) \<union> null_part M (?F (f x)) - ?N"
19.5          using main_part_null_part_Un[OF F] by auto
19.6        also have "\<dots> = main_part M (?F (f x)) - ?N"
19.7 -        using N x \<in> space M by auto
19.8 +        using N \<open>x \<in> space M\<close> by auto
19.9        finally have "?F (f x) - ?N \<in> sets M"
19.10          using F sets by auto }
19.11      ultimately show "?f' - {?f' x} \<inter> space M \<in> sets M" by auto
19.12 @@ -284,7 +284,7 @@
19.13      proof (elim AE_mp, safe intro!: AE_I2)
19.14        fix x assume eq: "\<forall>i. f i x = f' i x"
19.15        moreover have "g x = (SUP i. f i x)"
19.16 -        unfolding f using 0 \<le> g x by (auto split: split_max)
19.17 +        unfolding f using \<open>0 \<le> g x\<close> by (auto split: split_max)
19.18        ultimately show "g x = ?f x" by auto
19.19      qed
19.20      show "?f \<in> borel_measurable M"

    20.1 --- a/src/HOL/Probability/Convolution.thy	Mon Dec 07 16:48:10 2015 +0000
20.2 +++ b/src/HOL/Probability/Convolution.thy	Mon Dec 07 20:19:59 2015 +0100
20.3 @@ -2,7 +2,7 @@
20.4      Author:     Sudeep Kanav, TU MÃ¼nchen
20.5      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen *)
20.6
20.7 -section {* Convolution Measure *}
20.8 +section \<open>Convolution Measure\<close>
20.9
20.10  theory Convolution
20.11    imports Independent_Family
20.12 @@ -160,7 +160,7 @@
20.13        by (subst nn_integral_real_affine[where c=1 and t="-y"])
20.14           (auto simp del: gt_0 simp add: one_ereal_def[symmetric])
20.15      also have "\<dots> = (\<integral>\<^sup>+x. g y * (f (x - y) * indicator A x) \<partial>lborel)"
20.16 -      using 0 \<le> g y by (intro nn_integral_cmult[symmetric]) auto
20.17 +      using \<open>0 \<le> g y\<close> by (intro nn_integral_cmult[symmetric]) auto
20.18      finally show "(\<integral>\<^sup>+ x. g y * (f x * indicator A (x + y)) \<partial>lborel) =
20.19        (\<integral>\<^sup>+ x. f (x - y) * g y * indicator A x \<partial>lborel)"

    21.1 --- a/src/HOL/Probability/Discrete_Topology.thy	Mon Dec 07 16:48:10 2015 +0000
21.2 +++ b/src/HOL/Probability/Discrete_Topology.thy	Mon Dec 07 20:19:59 2015 +0100
21.3 @@ -6,7 +6,7 @@
21.4  imports "~~/src/HOL/Multivariate_Analysis/Multivariate_Analysis"
21.5  begin
21.6
21.7 -text {* Copy of discrete types with discrete topology. This space is polish. *}
21.8 +text \<open>Copy of discrete types with discrete topology. This space is polish.\<close>
21.9
21.10  typedef 'a discrete = "UNIV::'a set"
21.11  morphisms of_discrete discrete

    22.1 --- a/src/HOL/Probability/Distributions.thy	Mon Dec 07 16:48:10 2015 +0000
22.2 +++ b/src/HOL/Probability/Distributions.thy	Mon Dec 07 20:19:59 2015 +0100
22.3 @@ -3,7 +3,7 @@
22.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
22.5      Author:     Jeremy Avigad, CMU *)
22.6
22.7 -section {* Properties of Various Distributions *}
22.8 +section \<open>Properties of Various Distributions\<close>
22.9
22.10  theory Distributions
22.11    imports Convolution Information
22.12 @@ -69,7 +69,7 @@
22.13    finally show ?thesis .
22.14  qed
22.15
22.16 -subsection {* Erlang *}
22.17 +subsection \<open>Erlang\<close>
22.18
22.19  lemma nn_intergal_power_times_exp_Icc:
22.20    assumes [arith]: "0 \<le> a"
22.21 @@ -327,7 +327,7 @@
22.22      by simp (auto simp: power2_eq_square field_simps of_nat_Suc)
22.23  qed
22.24
22.25 -subsection {* Exponential distribution *}
22.26 +subsection \<open>Exponential distribution\<close>
22.27
22.28  abbreviation exponential_density :: "real \<Rightarrow> real \<Rightarrow> real" where
22.29    "exponential_density \<equiv> erlang_density 0"
22.30 @@ -353,7 +353,7 @@
22.31        using assms by (auto simp: distributed_real_AE)
22.32      then have "AE x in lborel. x \<le> (0::real)"
22.33        apply eventually_elim
22.34 -      using l < 0
22.35 +      using \<open>l < 0\<close>
22.36        apply (auto simp: exponential_density_def zero_le_mult_iff split: split_if_asm)
22.37        done
22.38      then show "emeasure lborel {x :: real \<in> space lborel. 0 < x} = 0"
22.39 @@ -391,7 +391,7 @@
22.40    shows "\<P>(x in M. a + t < X x \<bar> a < X x) = \<P>(x in M. t < X x)"
22.41  proof -
22.42    have "\<P>(x in M. a + t < X x \<bar> a < X x) = \<P>(x in M. a + t < X x) / \<P>(x in M. a < X x)"
22.43 -    using 0 \<le> t by (auto simp: cond_prob_def intro!: arg_cong[where f=prob] arg_cong2[where f="op /"])
22.44 +    using \<open>0 \<le> t\<close> by (auto simp: cond_prob_def intro!: arg_cong[where f=prob] arg_cong2[where f="op /"])
22.45    also have "\<dots> = exp (- (a + t) * l) / exp (- a * l)"
22.46      using a t by (simp add: exponential_distributedD_gt[OF D])
22.47    also have "\<dots> = exp (- t * l)"
22.48 @@ -563,7 +563,7 @@
22.49    assumes erlY: "distributed M lborel Y (erlang_density k\<^sub>2 l)"
22.50    shows "distributed M lborel (\<lambda>x. X x + Y x) (erlang_density (Suc k\<^sub>1 + Suc k\<^sub>2 - 1) l)"
22.51    using assms
22.52 -  apply (subst convolution_erlang_density[symmetric, OF 0<l])
22.53 +  apply (subst convolution_erlang_density[symmetric, OF \<open>0<l\<close>])
22.54    apply (intro distributed_convolution)
22.55    apply auto
22.56    done
22.57 @@ -630,7 +630,7 @@
22.58      by (simp add: log_def divide_simps ln_div)
22.59  qed
22.60
22.61 -subsection {* Uniform distribution *}
22.62 +subsection \<open>Uniform distribution\<close>
22.63
22.64  lemma uniform_distrI:
22.65    assumes X: "X \<in> measurable M M'"
22.66 @@ -679,7 +679,7 @@
22.67      (\<integral>\<^sup>+ x. ereal (1 / measure lborel A) * indicator (A \<inter> {..a}) x \<partial>lborel)"
22.68      by (auto intro!: nn_integral_cong split: split_indicator)
22.69    also have "\<dots> = ereal (1 / measure lborel A) * emeasure lborel (A \<inter> {..a})"
22.70 -    using A \<in> sets borel
22.71 +    using \<open>A \<in> sets borel\<close>
22.72      by (intro nn_integral_cmult_indicator) (auto simp: measure_nonneg)
22.73    also have "\<dots> = ereal (measure lborel (A \<inter> {..a}) / r)"
22.74      unfolding emeasure_eq_ereal_measure[OF fin] using A by (simp add: measure_def)
22.75 @@ -702,27 +702,27 @@
22.76      then have "emeasure M {x\<in>space M. X x \<le> t} \<le> emeasure M {x\<in>space M. X x \<le> a}"
22.77        using X by (auto intro!: emeasure_mono measurable_sets)
22.78      also have "\<dots> = 0"
22.79 -      using distr[of a] a < b by (simp add: emeasure_eq_measure)
22.80 +      using distr[of a] \<open>a < b\<close> by (simp add: emeasure_eq_measure)
22.81      finally have "emeasure M {x\<in>space M. X x \<le> t} = 0"
22.82        by (simp add: antisym measure_nonneg emeasure_le_0_iff)
22.83 -    with t < a show ?thesis by simp
22.84 +    with \<open>t < a\<close> show ?thesis by simp
22.85    next
22.86      assume bnds: "a \<le> t" "t \<le> b"
22.87      have "{a..b} \<inter> {..t} = {a..t}"
22.88        using bnds by auto
22.89 -    then show ?thesis using a \<le> t a < b
22.90 +    then show ?thesis using \<open>a \<le> t\<close> \<open>a < b\<close>
22.91        using distr[OF bnds] by (simp add: emeasure_eq_measure)
22.92    next
22.93      assume "b < t"
22.94      have "1 = emeasure M {x\<in>space M. X x \<le> b}"
22.95 -      using distr[of b] a < b by (simp add: one_ereal_def emeasure_eq_measure)
22.96 +      using distr[of b] \<open>a < b\<close> by (simp add: one_ereal_def emeasure_eq_measure)
22.97      also have "\<dots> \<le> emeasure M {x\<in>space M. X x \<le> t}"
22.98 -      using X b < t by (auto intro!: emeasure_mono measurable_sets)
22.99 +      using X \<open>b < t\<close> by (auto intro!: emeasure_mono measurable_sets)
22.100      finally have "emeasure M {x\<in>space M. X x \<le> t} = 1"
22.101         by (simp add: antisym emeasure_eq_measure one_ereal_def)
22.102 -    with b < t a < b show ?thesis by (simp add: measure_def one_ereal_def)
22.103 +    with \<open>b < t\<close> \<open>a < b\<close> show ?thesis by (simp add: measure_def one_ereal_def)
22.104    qed
22.105 -qed (insert X a < b, auto)
22.106 +qed (insert X \<open>a < b\<close>, auto)
22.107
22.108  lemma (in prob_space) uniform_distributed_measure:
22.109    fixes a b :: real
22.110 @@ -734,12 +734,12 @@
22.111      using distributed_measurable[OF D]
22.112      by (subst emeasure_distr) (auto intro!: arg_cong2[where f=emeasure])
22.113    also have "\<dots> = (\<integral>\<^sup>+x. ereal (1 / (b - a)) * indicator {a .. t} x \<partial>lborel)"
22.114 -    using distributed_borel_measurable[OF D] a \<le> t t \<le> b
22.115 +    using distributed_borel_measurable[OF D] \<open>a \<le> t\<close> \<open>t \<le> b\<close>
22.116      unfolding distributed_distr_eq_density[OF D]
22.117      by (subst emeasure_density)
22.118         (auto intro!: nn_integral_cong simp: measure_def split: split_indicator)
22.119    also have "\<dots> = ereal (1 / (b - a)) * (t - a)"
22.120 -    using a \<le> t t \<le> b
22.121 +    using \<open>a \<le> t\<close> \<open>t \<le> b\<close>
22.122      by (subst nn_integral_cmult_indicator) auto
22.123    finally show ?thesis
22.125 @@ -788,12 +788,12 @@
22.126        by (auto intro!: isCont_divide)
22.127      have *: "b\<^sup>2 / (2 * measure lborel {a..b}) - a\<^sup>2 / (2 * measure lborel {a..b}) =
22.128        (b*b - a * a) / (2 * (b - a))"
22.129 -      using a < b
22.130 +      using \<open>a < b\<close>
22.131        by (auto simp: measure_def power2_eq_square diff_divide_distrib[symmetric])
22.132      show "b\<^sup>2 / (2 * measure lborel {a..b}) - a\<^sup>2 / (2 * measure lborel {a..b}) = (a + b) / 2"
22.133 -      using a < b
22.134 +      using \<open>a < b\<close>
22.135        unfolding * square_diff_square_factored by (auto simp: field_simps)
22.136 -  qed (insert a < b, simp)
22.137 +  qed (insert \<open>a < b\<close>, simp)
22.138    finally show "(\<integral> x. indicator {a .. b} x / measure lborel {a .. b} * x \<partial>lborel) = (a + b) / 2" .
22.139  qed auto
22.140
22.141 @@ -812,7 +812,7 @@
22.142    finally show "(\<integral>x. x\<^sup>2 * ?D x \<partial>lborel) = (b - a)\<^sup>2 / 12" .
22.143  qed fact
22.144
22.145 -subsection {* Normal distribution *}
22.146 +subsection \<open>Normal distribution\<close>
22.147
22.148
22.149  definition normal_density :: "real \<Rightarrow> real \<Rightarrow> real \<Rightarrow> real" where
22.150 @@ -936,7 +936,7 @@
22.151      let ?f = "\<lambda>b. \<integral>x. indicator {0..} x *\<^sub>R ?M (k + 2) x * indicator {..b} x \<partial>lborel"
22.152      have "((\<lambda>b. (k + 1) / 2 * (\<integral>x. indicator {..b} x *\<^sub>R (indicator {0..} x *\<^sub>R ?M k x) \<partial>lborel) - ?M (k + 1) b / 2) --->
22.153          (k + 1) / 2 * (\<integral>x. indicator {0..} x *\<^sub>R ?M k x \<partial>lborel) - 0 / 2) at_top" (is ?tendsto)
22.154 -    proof (intro tendsto_intros 2 \<noteq> 0 tendsto_integral_at_top sets_lborel Mk[THEN integrable.intros])
22.155 +    proof (intro tendsto_intros \<open>2 \<noteq> 0\<close> tendsto_integral_at_top sets_lborel Mk[THEN integrable.intros])
22.156        show "(?M (k + 1) ---> 0) at_top"
22.157        proof cases
22.158          assume "even k"
22.159 @@ -945,7 +945,7 @@
22.160                     filterlim_at_top_imp_at_infinity filterlim_ident filterlim_pow_at_top filterlim_ident)
22.161               auto
22.162          also have "(\<lambda>x. ((x\<^sup>2)^(k div 2 + 1) / exp (x\<^sup>2)) * (1 / x) :: real) = ?M (k + 1)"
22.163 -          using even k by (auto simp: fun_eq_iff exp_minus field_simps power2_eq_square power_mult elim: evenE)
22.164 +          using \<open>even k\<close> by (auto simp: fun_eq_iff exp_minus field_simps power2_eq_square power_mult elim: evenE)
22.165          finally show ?thesis by simp
22.166        next
22.167          assume "odd k"
22.168 @@ -954,7 +954,7 @@
22.169                      filterlim_ident filterlim_pow_at_top)
22.170               auto
22.171          also have "(\<lambda>x. ((x\<^sup>2)^((k - 1) div 2 + 1) / exp (x\<^sup>2)) :: real) = ?M (k + 1)"
22.172 -          using odd k by (auto simp: fun_eq_iff exp_minus field_simps power2_eq_square power_mult elim: oddE)
22.173 +          using \<open>odd k\<close> by (auto simp: fun_eq_iff exp_minus field_simps power2_eq_square power_mult elim: oddE)
22.174          finally show ?thesis by simp
22.175        qed
22.176      qed
22.177 @@ -1203,7 +1203,7 @@
22.178      by (simp add: normal_density_def real_sqrt_mult field_simps)
22.180    show ?thesis
22.181 -    by (rule distributed_affineI[OF _ \<alpha> \<noteq> 0, where t=\<beta>]) (simp_all add: eq X)
22.182 +    by (rule distributed_affineI[OF _ \<open>\<alpha> \<noteq> 0\<close>, where t=\<beta>]) (simp_all add: eq X)
22.183  qed
22.184
22.185  lemma (in prob_space) normal_standard_normal_convert:

    23.1 --- a/src/HOL/Probability/Embed_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
23.2 +++ b/src/HOL/Probability/Embed_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
23.3 @@ -6,7 +6,7 @@
23.4      measure on the left part of the sum type 'a + 'b)
23.5  *)
23.6
23.7 -section {* Embed Measure Spaces with a Function *}
23.8 +section \<open>Embed Measure Spaces with a Function\<close>
23.9
23.10  theory Embed_Measure
23.11  imports Binary_Product_Measure
23.12 @@ -216,7 +216,7 @@
23.13    moreover {
23.14      fix X assume "X \<in> sets A"
23.15      from asm have "emeasure ?M (fX) = emeasure ?N (fX)" by simp
23.16 -    with X \<in> sets A and sets A = sets B and assms
23.17 +    with \<open>X \<in> sets A\<close> and \<open>sets A = sets B\<close> and assms
23.18          have "emeasure A X = emeasure B X" by (simp add: emeasure_embed_measure_image)
23.19    }
23.20    ultimately show "A = B" by (rule measure_eqI)
23.21 @@ -312,7 +312,7 @@
23.22    with A have "f x \<in> f  B" by blast
23.23    then obtain y where "f x = f y" and "y \<in> B" by blast
23.24    with assms and B have "x = y" by (auto dest: inj_onD)
23.25 -  with y \<in> B show "x \<in> B" by simp
23.26 +  with \<open>y \<in> B\<close> show "x \<in> B" by simp
23.27  qed auto
23.28
23.29

    24.1 --- a/src/HOL/Probability/Fin_Map.thy	Mon Dec 07 16:48:10 2015 +0000
24.2 +++ b/src/HOL/Probability/Fin_Map.thy	Mon Dec 07 20:19:59 2015 +0100
24.3 @@ -2,21 +2,21 @@
24.4      Author:     Fabian Immler, TU MÃ¼nchen
24.5  *)
24.6
24.7 -section {* Finite Maps *}
24.8 +section \<open>Finite Maps\<close>
24.9
24.10  theory Fin_Map
24.11  imports Finite_Product_Measure
24.12  begin
24.13
24.14 -text {* Auxiliary type that is instantiated to @{class polish_space}, needed for the proof of
24.15 +text \<open>Auxiliary type that is instantiated to @{class polish_space}, needed for the proof of
24.16    projective limit. @{const extensional} functions are used for the representation in order to
24.17    stay close to the developments of (finite) products @{const Pi\<^sub>E} and their sigma-algebra
24.18 -  @{const Pi\<^sub>M}. *}
24.19 +  @{const Pi\<^sub>M}.\<close>
24.20
24.21  typedef ('i, 'a) finmap ("(_ \<Rightarrow>\<^sub>F /_)" [22, 21] 21) =
24.22    "{(I::'i set, f::'i \<Rightarrow> 'a). finite I \<and> f \<in> extensional I}" by auto
24.23
24.24 -subsection {* Domain and Application *}
24.25 +subsection \<open>Domain and Application\<close>
24.26
24.27  definition domain where "domain P = fst (Rep_finmap P)"
24.28
24.29 @@ -38,7 +38,7 @@
24.30       (auto simp add: Abs_finmap_inject extensional_def domain_def proj_def Abs_finmap_inverse
24.31                intro: extensionalityI)
24.32
24.33 -subsection {* Countable Finite Maps *}
24.34 +subsection \<open>Countable Finite Maps\<close>
24.35
24.36  instance finmap :: (countable, countable) countable
24.37  proof
24.38 @@ -50,15 +50,15 @@
24.39      then have "map fst (?F f1) = map fst (?F f2)" by simp
24.40      then have "mapper f1 = mapper f2" by (simp add: comp_def)
24.41      then have "domain f1 = domain f2" by (simp add: mapper[symmetric])
24.42 -    with ?F f1 = ?F f2 show "f1 = f2"
24.43 -      unfolding mapper f1 = mapper f2 map_eq_conv mapper
24.44 +    with \<open>?F f1 = ?F f2\<close> show "f1 = f2"
24.45 +      unfolding \<open>mapper f1 = mapper f2\<close> map_eq_conv mapper
24.47    qed
24.48    then show "\<exists>to_nat :: 'a \<Rightarrow>\<^sub>F 'b \<Rightarrow> nat. inj to_nat"
24.49      by (intro exI[of _ "to_nat \<circ> ?F"] inj_comp) auto
24.50  qed
24.51
24.52 -subsection {* Constructor of Finite Maps *}
24.53 +subsection \<open>Constructor of Finite Maps\<close>
24.54
24.55  definition "finmap_of inds f = Abs_finmap (inds, restrict f inds)"
24.56
24.57 @@ -93,9 +93,9 @@
24.58    show "x = y" using assms by (simp add: extensional_restrict)
24.59  qed
24.60
24.61 -subsection {* Product set of Finite Maps *}
24.62 +subsection \<open>Product set of Finite Maps\<close>
24.63
24.64 -text {* This is @{term Pi} for Finite Maps, most of this is copied *}
24.65 +text \<open>This is @{term Pi} for Finite Maps, most of this is copied\<close>
24.66
24.67  definition Pi' :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a set) \<Rightarrow> ('i \<Rightarrow>\<^sub>F 'a) set" where
24.68    "Pi' I A = { P. domain P = I \<and> (\<forall>i. i \<in> I \<longrightarrow> (P)\<^sub>F i \<in> A i) } "
24.69 @@ -107,7 +107,7 @@
24.70  translations
24.71    "PI' x:A. B" == "CONST Pi' A (%x. B)"
24.72
24.73 -subsubsection{*Basic Properties of @{term Pi'}*}
24.74 +subsubsection\<open>Basic Properties of @{term Pi'}\<close>
24.75
24.76  lemma Pi'_I[intro!]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B"
24.78 @@ -146,7 +146,7 @@
24.79    apply auto
24.80    done
24.81
24.82 -subsection {* Topological Space of Finite Maps *}
24.83 +subsection \<open>Topological Space of Finite Maps\<close>
24.84
24.85  instantiation finmap :: (type, topological_space) topological_space
24.86  begin
24.87 @@ -171,7 +171,7 @@
24.88      fix i::"'a set"
24.89      assume "finite i"
24.90      hence "{m. domain m = i} = Pi' i (\<lambda>_. UNIV)" by (auto simp: Pi'_def)
24.91 -    also have "open \<dots>" by (auto intro: open_Pi'I simp: finite i)
24.92 +    also have "open \<dots>" by (auto intro: open_Pi'I simp: \<open>finite i\<close>)
24.93      finally show "open {m. domain m = i}" .
24.94    next
24.95      fix i::"'a set"
24.96 @@ -196,7 +196,7 @@
24.97    moreover assume "\<forall>S. open S \<longrightarrow> a \<in> S \<longrightarrow> eventually (\<lambda>x. x \<in> S) F" "a i \<in> S"
24.98    ultimately have "eventually (\<lambda>x. x \<in> ?S) F" by auto
24.99    thus "eventually (\<lambda>x. (x)\<^sub>F i \<in> S) F"
24.100 -    by eventually_elim (insert a i \<in> S, force simp: Pi'_iff split: split_if_asm)
24.101 +    by eventually_elim (insert \<open>a i \<in> S\<close>, force simp: Pi'_iff split: split_if_asm)
24.102  qed
24.103
24.104  lemma continuous_proj:
24.105 @@ -236,7 +236,7 @@
24.106        case (UN B)
24.107        then obtain b where "x \<in> b" "b \<in> B" by auto
24.108        hence "\<exists>a\<in>?A. a \<subseteq> b" using UN by simp
24.109 -      thus ?case using b \<in> B by blast
24.110 +      thus ?case using \<open>b \<in> B\<close> by blast
24.111      next
24.112        case (Basis s)
24.113        then obtain a b where xs: "x\<in> Pi' a b" "s = Pi' a b" "\<And>i. i\<in>a \<Longrightarrow> open (b i)" by auto
24.114 @@ -254,7 +254,7 @@
24.115    qed (insert A,auto simp: PiE_iff intro!: open_Pi'I)
24.116  qed
24.117
24.118 -subsection {* Metric Space of Finite Maps *}
24.119 +subsection \<open>Metric Space of Finite Maps\<close>
24.120
24.121  instantiation finmap :: (type, metric_space) metric_space
24.122  begin
24.123 @@ -342,25 +342,25 @@
24.124          fix x assume "x \<in> s"
24.125          hence [simp]: "finite a" and a_dom: "a = domain x" using s by (auto simp: Pi'_iff)
24.126          obtain es where es: "\<forall>i \<in> a. es i > 0 \<and> (\<forall>y. dist y (proj x i) < es i \<longrightarrow> y \<in> b i)"
24.127 -          using b x \<in> s by atomize_elim (intro bchoice, auto simp: open_dist s)
24.128 +          using b \<open>x \<in> s\<close> by atomize_elim (intro bchoice, auto simp: open_dist s)
24.129          hence in_b: "\<And>i y. i \<in> a \<Longrightarrow> dist y (proj x i) < es i \<Longrightarrow> y \<in> b i" by auto
24.130          show "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s"
24.131          proof (cases, rule, safe)
24.132            assume "a \<noteq> {}"
24.133 -          show "0 < min 1 (Min (es  a))" using es by (auto simp: a \<noteq> {})
24.134 +          show "0 < min 1 (Min (es  a))" using es by (auto simp: \<open>a \<noteq> {}\<close>)
24.135            fix y assume d: "dist y x < min 1 (Min (es  a))"
24.136            show "y \<in> s" unfolding s
24.137            proof
24.138 -            show "domain y = a" using d s a \<noteq> {} by (auto simp: dist_le_1_imp_domain_eq a_dom)
24.139 +            show "domain y = a" using d s \<open>a \<noteq> {}\<close> by (auto simp: dist_le_1_imp_domain_eq a_dom)
24.140              fix i assume i: "i \<in> a"
24.141              hence "dist ((y)\<^sub>F i) ((x)\<^sub>F i) < es i" using d
24.142 -              by (auto simp: dist_finmap_def a \<noteq> {} intro!: le_less_trans[OF dist_proj])
24.143 +              by (auto simp: dist_finmap_def \<open>a \<noteq> {}\<close> intro!: le_less_trans[OF dist_proj])
24.144              with i show "y i \<in> b i" by (rule in_b)
24.145            qed
24.146          next
24.147            assume "\<not>a \<noteq> {}"
24.148            thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s"
24.149 -            using s x \<in> s by (auto simp: Pi'_def dist_le_1_imp_domain_eq intro!: exI[where x=1])
24.150 +            using s \<open>x \<in> s\<close> by (auto simp: Pi'_def dist_le_1_imp_domain_eq intro!: exI[where x=1])
24.151          qed
24.152        qed
24.153      qed
24.154 @@ -380,7 +380,7 @@
24.155        assume "y \<in> S"
24.156        moreover
24.157        assume "x \<in> (\<Pi>' i\<in>domain y. ball (y i) (e y))"
24.158 -      hence "dist x y < e y" using e_pos y \<in> S
24.159 +      hence "dist x y < e y" using e_pos \<open>y \<in> S\<close>
24.160          by (auto simp: dist_finmap_def Pi'_iff finite_proj_diag dist_commute)
24.161        ultimately show "x \<in> S" by (rule e_in)
24.162      qed
24.163 @@ -415,7 +415,7 @@
24.164
24.165  end
24.166
24.167 -subsection {* Complete Space of Finite Maps *}
24.168 +subsection \<open>Complete Space of Finite Maps\<close>
24.169
24.170  lemma tendsto_finmap:
24.171    fixes f::"nat \<Rightarrow> ('i \<Rightarrow>\<^sub>F ('a::metric_space))"
24.172 @@ -430,13 +430,13 @@
24.173      using finite_domain[of g] proj_g
24.174    proof induct
24.175      case (insert i G)
24.176 -    with 0 < e have "eventually (\<lambda>x. ?dists x i < e) sequentially" by (auto simp add: tendsto_iff)
24.177 +    with \<open>0 < e\<close> have "eventually (\<lambda>x. ?dists x i < e) sequentially" by (auto simp add: tendsto_iff)
24.178      moreover
24.179      from insert have "eventually (\<lambda>x. \<forall>i\<in>G. dist ((f x)\<^sub>F i) ((g)\<^sub>F i) < e) sequentially" by simp
24.180      ultimately show ?case by eventually_elim auto
24.181    qed simp
24.182    thus "eventually (\<lambda>x. dist (f x) g < e) sequentially"
24.183 -    by eventually_elim (auto simp add: dist_finmap_def finite_proj_diag ind_f 0 < e)
24.184 +    by eventually_elim (auto simp add: dist_finmap_def finite_proj_diag ind_f \<open>0 < e\<close>)
24.185  qed
24.186
24.187  instance finmap :: (type, complete_space) complete_space
24.188 @@ -457,7 +457,7 @@
24.189      have "Cauchy (p i)" unfolding cauchy p_def
24.190      proof safe
24.191        fix e::real assume "0 < e"
24.192 -      with Cauchy P obtain N where N: "\<And>n. n\<ge>N \<Longrightarrow> dist (P n) (P N) < min e 1"
24.193 +      with \<open>Cauchy P\<close> obtain N where N: "\<And>n. n\<ge>N \<Longrightarrow> dist (P n) (P N) < min e 1"
24.194          by (force simp: cauchy min_def)
24.195        hence "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = domain (P N)" using dist_le_1_imp_domain_eq by auto
24.196        with dim have dim: "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = d" by (metis nat_le_linear)
24.197 @@ -465,9 +465,9 @@
24.198        proof (safe intro!: exI[where x="N"])
24.199          fix n assume "N \<le> n" have "N \<le> N" by simp
24.200          have "dist ((P n) i) ((P N) i) \<le> dist (P n) (P N)"
24.201 -          using dim[OF N \<le> n]  dim[OF N \<le> N] i \<in> d
24.202 +          using dim[OF \<open>N \<le> n\<close>]  dim[OF \<open>N \<le> N\<close>] \<open>i \<in> d\<close>
24.203            by (auto intro!: dist_proj)
24.204 -        also have "\<dots> < e" using N[OF N \<le> n] by simp
24.205 +        also have "\<dots> < e" using N[OF \<open>N \<le> n\<close>] by simp
24.206          finally show "dist ((P n) i) ((P N) i) < e" .
24.207        qed
24.208      qed
24.209 @@ -480,7 +480,7 @@
24.210      have "\<exists>ni. \<forall>i\<in>d. \<forall>n\<ge>ni i. dist (p i n) (q i) < e"
24.211      proof (safe intro!: bchoice)
24.212        fix i assume "i \<in> d"
24.213 -      from p[OF i \<in> d, THEN metric_LIMSEQ_D, OF 0 < e]
24.214 +      from p[OF \<open>i \<in> d\<close>, THEN metric_LIMSEQ_D, OF \<open>0 < e\<close>]
24.215        show "\<exists>no. \<forall>n\<ge>no. dist (p i n) (q i) < e" .
24.216      qed then guess ni .. note ni = this
24.217      def N \<equiv> "max Nd (Max (ni  d))"
24.218 @@ -490,12 +490,12 @@
24.219        hence dom: "domain (P n) = d" "domain Q = d" "domain (P n) = domain Q"
24.220          using dim by (simp_all add: N_def Q_def dim_def Abs_finmap_inverse)
24.221        show "dist (P n) Q < e"
24.222 -      proof (rule dist_finmap_lessI[OF dom(3) 0 < e])
24.223 +      proof (rule dist_finmap_lessI[OF dom(3) \<open>0 < e\<close>])
24.224          fix i
24.225          assume "i \<in> domain (P n)"
24.226          hence "ni i \<le> Max (ni  d)" using dom by simp
24.227          also have "\<dots> \<le> N" by (simp add: N_def)
24.228 -        finally show "dist ((P n)\<^sub>F i) ((Q)\<^sub>F i) < e" using ni i \<in> domain (P n) N \<le> n dom
24.229 +        finally show "dist ((P n)\<^sub>F i) ((Q)\<^sub>F i) < e" using ni \<open>i \<in> domain (P n)\<close> \<open>N \<le> n\<close> dom
24.230            by (auto simp: p_def q N_def less_imp_le)
24.231        qed
24.232      qed
24.233 @@ -503,7 +503,7 @@
24.234    thus "convergent P" by (auto simp: convergent_def)
24.235  qed
24.236
24.237 -subsection {* Second Countable Space of Finite Maps *}
24.238 +subsection \<open>Second Countable Space of Finite Maps\<close>
24.239
24.240  instantiation finmap :: (countable, second_countable_topology) second_countable_topology
24.241  begin
24.242 @@ -582,7 +582,7 @@
24.243    then guess B .. note B = this
24.244    def B' \<equiv> "Pi' (domain x) (\<lambda>i. (B i)::'b set)"
24.245    have "B' \<subseteq> Pi' (domain x) a" using B by (auto intro!: Pi'_mono simp: B'_def)
24.246 -  also note \<dots> \<subseteq> O'
24.247 +  also note \<open>\<dots> \<subseteq> O'\<close>
24.248    finally show "\<exists>B'\<in>basis_finmap. x \<in> B' \<and> B' \<subseteq> O'" using B
24.249      by (auto intro!: bexI[where x=B'] Pi'_mono in_basis_finmapI simp: B'_def)
24.250  qed
24.251 @@ -596,12 +596,12 @@
24.252
24.253  end
24.254
24.255 -subsection {* Polish Space of Finite Maps *}
24.256 +subsection \<open>Polish Space of Finite Maps\<close>
24.257
24.258  instance finmap :: (countable, polish_space) polish_space proof qed
24.259
24.260
24.261 -subsection {* Product Measurable Space of Finite Maps *}
24.262 +subsection \<open>Product Measurable Space of Finite Maps\<close>
24.263
24.264  definition "PiF I M \<equiv>
24.265    sigma (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j))) {(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}"
24.266 @@ -700,7 +700,7 @@
24.267    proof safe
24.268      fix x X s assume *: "x \<in> f s" "P s"
24.269      with assms obtain l where "s = set l" using finite_list by blast
24.270 -    with * show "x \<in> (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" using P s
24.271 +    with * show "x \<in> (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" using \<open>P s\<close>
24.272        by (auto intro!: exI[where x="to_nat l"])
24.273    next
24.274      fix x n assume "x \<in> (let s = set (from_nat n) in if P s then f s else {})"
24.275 @@ -755,7 +755,7 @@
24.276      apply (case_tac "set (from_nat i) \<in> I")
24.277      apply simp_all
24.278      apply (rule singleton_subspace_set_in_sets[OF measurable_sets[OF MN]])
24.279 -    using assms y \<in> sets N
24.280 +    using assms \<open>y \<in> sets N\<close>
24.281      apply (auto simp: space_PiF)
24.282      done
24.283    finally show "A - y \<inter> space (PiF I M) \<in> sets (PiF I M)" .
24.284 @@ -806,7 +806,7 @@
24.285  next
24.286    case (Compl a)
24.287    have "(space (PiF I M) - a) \<inter> {m. domain m \<in> J} = (space (PiF J M) - (a \<inter> {m. domain m \<in> J}))"
24.288 -    using J \<subseteq> I by (auto simp: space_PiF Pi'_def)
24.289 +    using \<open>J \<subseteq> I\<close> by (auto simp: space_PiF Pi'_def)
24.290    also have "\<dots> \<in> sets (PiF J M)" using Compl by auto
24.291    finally show ?case by (simp add: space_PiF)
24.292  qed simp
24.293 @@ -848,7 +848,7 @@
24.294    apply (rule measurable_component_singleton)
24.295    apply simp
24.296    apply rule
24.297 -  apply (rule finite J)
24.298 +  apply (rule \<open>finite J\<close>)
24.299    apply simp
24.300    done
24.301
24.302 @@ -859,9 +859,9 @@
24.303    assume "i \<in> I"
24.304    hence "(\<lambda>x. (x)\<^sub>F i) - A \<inter> space (PiF {I} M) =
24.305      Pi' I (\<lambda>x. if x = i then A else space (M x))"
24.306 -    using sets.sets_into_space[OF ] A \<in> sets (M i) assms
24.307 +    using sets.sets_into_space[OF ] \<open>A \<in> sets (M i)\<close> assms
24.308      by (auto simp: space_PiF Pi'_def)
24.309 -  thus ?thesis  using assms A \<in> sets (M i)
24.310 +  thus ?thesis  using assms \<open>A \<in> sets (M i)\<close>
24.311      by (intro in_sets_PiFI) auto
24.312  next
24.313    assume "i \<notin> I"
24.314 @@ -874,7 +874,7 @@
24.315    assumes "i \<in> I"
24.316    shows "(\<lambda>x. (x)\<^sub>F i) \<in> measurable (PiF {I} M) (M i)"
24.317    by (unfold measurable_def, intro CollectI conjI ballI proj_measurable_singleton assms)
24.318 -     (insert i \<in> I, auto simp: space_PiF)
24.319 +     (insert \<open>i \<in> I\<close>, auto simp: space_PiF)
24.320
24.321  lemma measurable_proj_countable:
24.322    fixes I::"'a::countable set set"
24.323 @@ -889,11 +889,11 @@
24.324      have "(\<lambda>x. if i \<in> domain x then x i else y) - z \<inter> space (PiF {J} M) =
24.325        (\<lambda>x. if i \<in> J then (x)\<^sub>F i else y) - z \<inter> space (PiF {J} M)"
24.326        by (auto simp: space_PiF Pi'_def)
24.327 -    also have "\<dots> \<in> sets (PiF {J} M)" using z \<in> sets (M i) finite J
24.328 +    also have "\<dots> \<in> sets (PiF {J} M)" using \<open>z \<in> sets (M i)\<close> \<open>finite J\<close>
24.329        by (cases "i \<in> J") (auto intro!: measurable_sets[OF measurable_proj_singleton])
24.330      finally show "(\<lambda>x. if i \<in> domain x then x i else y) - z \<inter> space (PiF {J} M) \<in>
24.331        sets (PiF {J} M)" .
24.332 -  qed (insert y \<in> space (M i), auto simp: space_PiF Pi'_def)
24.333 +  qed (insert \<open>y \<in> space (M i)\<close>, auto simp: space_PiF Pi'_def)
24.334  qed
24.335
24.336  lemma measurable_restrict_proj:
24.337 @@ -927,7 +927,7 @@
24.338    shows "space (PiF {I} M) = (\<Pi>' i\<in>I. space (M i))"
24.339    by (auto simp: product_def space_PiF assms)
24.340
24.341 -text {* adapted from @{thm sets_PiM_single} *}
24.342 +text \<open>adapted from @{thm sets_PiM_single}\<close>
24.343
24.344  lemma sets_PiF_single:
24.345    assumes "finite I" "I \<noteq> {}"
24.346 @@ -942,11 +942,11 @@
24.347    then obtain X where X: "A = Pi' I X" "X \<in> (\<Pi> j\<in>I. sets (M j))" by auto
24.348    show "A \<in> sigma_sets ?\<Omega> ?R"
24.349    proof -
24.350 -    from I \<noteq> {} X have "A = (\<Inter>j\<in>I. {f\<in>space (PiF {I} M). f j \<in> X j})"
24.351 +    from \<open>I \<noteq> {}\<close> X have "A = (\<Inter>j\<in>I. {f\<in>space (PiF {I} M). f j \<in> X j})"
24.352        using sets.sets_into_space
24.353        by (auto simp: space_PiF product_def) blast
24.354      also have "\<dots> \<in> sigma_sets ?\<Omega> ?R"
24.355 -      using X I \<noteq> {} assms by (intro R.finite_INT) (auto simp: space_PiF)
24.356 +      using X \<open>I \<noteq> {}\<close> assms by (intro R.finite_INT) (auto simp: space_PiF)
24.357      finally show "A \<in> sigma_sets ?\<Omega> ?R" .
24.358    qed
24.359  next
24.360 @@ -965,7 +965,7 @@
24.361    finally show "A \<in> sigma_sets ?\<Omega> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" .
24.362  qed
24.363
24.364 -text {* adapted from @{thm PiE_cong} *}
24.365 +text \<open>adapted from @{thm PiE_cong}\<close>
24.366
24.367  lemma Pi'_cong:
24.368    assumes "finite I"
24.369 @@ -973,7 +973,7 @@
24.370    shows "Pi' I f = Pi' I g"
24.371  using assms by (auto simp: Pi'_def)
24.372
24.373 -text {* adapted from @{thm Pi_UN} *}
24.374 +text \<open>adapted from @{thm Pi_UN}\<close>
24.375
24.376  lemma Pi'_UN:
24.377    fixes A :: "nat \<Rightarrow> 'i \<Rightarrow> 'a set"
24.378 @@ -982,20 +982,20 @@
24.379    shows "(\<Union>n. Pi' I (A n)) = Pi' I (\<lambda>i. \<Union>n. A n i)"
24.380  proof (intro set_eqI iffI)
24.381    fix f assume "f \<in> Pi' I (\<lambda>i. \<Union>n. A n i)"
24.382 -  then have "\<forall>i\<in>I. \<exists>n. f i \<in> A n i" "domain f = I" by (auto simp: finite I Pi'_def)
24.383 +  then have "\<forall>i\<in>I. \<exists>n. f i \<in> A n i" "domain f = I" by (auto simp: \<open>finite I\<close> Pi'_def)
24.384    from bchoice[OF this(1)] obtain n where n: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> (A (n i) i)" by auto
24.385    obtain k where k: "\<And>i. i \<in> I \<Longrightarrow> n i \<le> k"
24.386 -    using finite I finite_nat_set_iff_bounded_le[of "nI"] by auto
24.387 +    using \<open>finite I\<close> finite_nat_set_iff_bounded_le[of "nI"] by auto
24.388    have "f \<in> Pi' I (\<lambda>i. A k i)"
24.389    proof
24.390      fix i assume "i \<in> I"
24.391 -    from mono[OF this, of "n i" k] k[OF this] n[OF this] domain f = I i \<in> I
24.392 -    show "f i \<in> A k i " by (auto simp: finite I)
24.393 -  qed (simp add: domain f = I finite I)
24.394 +    from mono[OF this, of "n i" k] k[OF this] n[OF this] \<open>domain f = I\<close> \<open>i \<in> I\<close>
24.395 +    show "f i \<in> A k i " by (auto simp: \<open>finite I\<close>)
24.396 +  qed (simp add: \<open>domain f = I\<close> \<open>finite I\<close>)
24.397    then show "f \<in> (\<Union>n. Pi' I (A n))" by auto
24.398 -qed (auto simp: Pi'_def finite I)
24.399 +qed (auto simp: Pi'_def \<open>finite I\<close>)
24.400
24.401 -text {* adapted from @{thm sets_PiM_sigma} *}
24.402 +text \<open>adapted from @{thm sets_PiM_sigma}\<close>
24.403
24.404  lemma sigma_fprod_algebra_sigma_eq:
24.405    fixes E :: "'i \<Rightarrow> 'a set set" and S :: "'i \<Rightarrow> nat \<Rightarrow> 'a set"
24.406 @@ -1008,9 +1008,9 @@
24.407    shows "sets (PiF {I} M) = sigma_sets (space (PiF {I} M)) P"
24.408  proof
24.409    let ?P = "sigma (space (Pi\<^sub>F {I} M)) P"
24.410 -  from finite I[THEN ex_bij_betw_finite_nat] guess T ..
24.411 +  from \<open>finite I\<close>[THEN ex_bij_betw_finite_nat] guess T ..
24.412    then have T: "\<And>i. i \<in> I \<Longrightarrow> T i < card I" "\<And>i. i\<in>I \<Longrightarrow> the_inv_into I T (T i) = i"
24.413 -    by (auto simp add: bij_betw_def set_eq_iff image_iff the_inv_into_f_f simp del: finite I)
24.414 +    by (auto simp add: bij_betw_def set_eq_iff image_iff the_inv_into_f_f simp del: \<open>finite I\<close>)
24.415    have P_closed: "P \<subseteq> Pow (space (Pi\<^sub>F {I} M))"
24.416      using E_closed by (auto simp: space_PiF P_def Pi'_iff subset_eq)
24.417    then have space_P: "space ?P = (\<Pi>' i\<in>I. space (M i))"
24.418 @@ -1023,14 +1023,14 @@
24.419      fix i A assume "i \<in> I" and A: "A \<in> sets (M i)"
24.420      have "(\<lambda>x. (x)\<^sub>F i) \<in> measurable ?P (sigma (space (M i)) (E i))"
24.421      proof (subst measurable_iff_measure_of)
24.422 -      show "E i \<subseteq> Pow (space (M i))" using i \<in> I by fact
24.423 -      from space_P i \<in> I show "(\<lambda>x. (x)\<^sub>F i) \<in> space ?P \<rightarrow> space (M i)"
24.424 +      show "E i \<subseteq> Pow (space (M i))" using \<open>i \<in> I\<close> by fact
24.425 +      from space_P \<open>i \<in> I\<close> show "(\<lambda>x. (x)\<^sub>F i) \<in> space ?P \<rightarrow> space (M i)"
24.426          by auto
24.427        show "\<forall>A\<in>E i. (\<lambda>x. (x)\<^sub>F i) - A \<inter> space ?P \<in> sets ?P"
24.428        proof
24.429          fix A assume A: "A \<in> E i"
24.430          then have "(\<lambda>x. (x)\<^sub>F i) - A \<inter> space ?P = (\<Pi>' j\<in>I. if i = j then A else space (M j))"
24.431 -          using E_closed i \<in> I by (auto simp: space_P Pi_iff subset_eq split: split_if_asm)
24.432 +          using E_closed \<open>i \<in> I\<close> by (auto simp: space_P Pi_iff subset_eq split: split_if_asm)
24.433          also have "\<dots> = (\<Pi>' j\<in>I. \<Union>n. if i = j then A else S j n)"
24.434            by (intro Pi'_cong) (simp_all add: S_union)
24.435          also have "\<dots> = (\<Union>xs\<in>{xs. length xs = card I}. \<Pi>' j\<in>I. if i = j then A else S j (xs ! T j))"
24.436 @@ -1052,7 +1052,7 @@
24.437            using P_closed by simp
24.438        qed
24.439      qed
24.440 -    from measurable_sets[OF this, of A] A i \<in> I E_closed
24.441 +    from measurable_sets[OF this, of A] A \<open>i \<in> I\<close> E_closed
24.442      have "(\<lambda>x. (x)\<^sub>F i) - A \<inter> space ?P \<in> sets ?P"
24.444      also have "(\<lambda>x. (x)\<^sub>F i) - A \<inter> space ?P = {f \<in> \<Pi>' i\<in>I. space (M i). f i \<in> A}"
24.445 @@ -1062,7 +1062,7 @@
24.446    finally show "sets (PiF {I} M) \<subseteq> sigma_sets (space (PiF {I} M)) P"
24.448    show "sigma_sets (space (PiF {I} M)) P \<subseteq> sets (PiF {I} M)"
24.449 -    using finite I I \<noteq> {}
24.450 +    using \<open>finite I\<close> \<open>I \<noteq> {}\<close>
24.451      by (auto intro!: sets.sigma_sets_subset product_in_sets_PiFI simp: E_generates P_def)
24.452  qed
24.453
24.454 @@ -1105,7 +1105,7 @@
24.455    then obtain B' where B': "B'\<subseteq>basis_finmap" "a = \<Union>B'"
24.456      using finmap_topological_basis by (force simp add: topological_basis_def)
24.457    have "a \<in> sigma UNIV {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}"
24.458 -    unfolding a = \<Union>B'
24.459 +    unfolding \<open>a = \<Union>B'\<close>
24.460    proof (rule sets.countable_Union)
24.461      from B' countable_basis_finmap show "countable B'" by (metis countable_subset)
24.462    next
24.463 @@ -1134,7 +1134,7 @@
24.464        proof cases
24.465          assume "?b J \<noteq> {}"
24.466          then obtain f where "f \<in> b" "domain f = {}" using ef by auto
24.467 -        hence "?b J = {f}" using J = {}
24.468 +        hence "?b J = {f}" using \<open>J = {}\<close>
24.469            by (auto simp: finmap_eq_iff)
24.470          also have "{f} \<in> sets borel" by simp
24.471          finally show ?thesis .
24.472 @@ -1143,11 +1143,11 @@
24.473        assume "J \<noteq> ({}::'i set)"
24.474        have "(?b J) = b \<inter> {m. domain m \<in> {J}}" by auto
24.475        also have "\<dots> \<in> sets (PiF {J} (\<lambda>_. borel))"
24.476 -        using b' by (rule restrict_sets_measurable) (auto simp: finite J)
24.477 +        using b' by (rule restrict_sets_measurable) (auto simp: \<open>finite J\<close>)
24.478        also have "\<dots> = sigma_sets (space (PiF {J} (\<lambda>_. borel)))
24.479          {Pi' (J) F |F. (\<forall>j\<in>J. F j \<in> Collect open)}"
24.480          (is "_ = sigma_sets _ ?P")
24.481 -       by (rule product_open_generates_sets_PiF_single[OF J \<noteq> {} finite J])
24.482 +       by (rule product_open_generates_sets_PiF_single[OF \<open>J \<noteq> {}\<close> \<open>finite J\<close>])
24.483        also have "\<dots> \<subseteq> sigma_sets UNIV (Collect open)"
24.484          by (intro sigma_sets_mono'') (auto intro!: open_Pi'I simp: space_PiF)
24.485        finally have "(?b J) \<in> sets borel" by (simp add: borel_def)
24.486 @@ -1156,7 +1156,7 @@
24.487    finally show "b \<in> sigma_sets UNIV (Collect open)" by (simp add: borel_def)
24.488  qed (simp add: emeasure_sigma borel_def PiF_def)
24.489
24.490 -subsection {* Isomorphism between Functions and Finite Maps *}
24.491 +subsection \<open>Isomorphism between Functions and Finite Maps\<close>
24.492
24.493  lemma measurable_finmap_compose:
24.494    shows "(\<lambda>m. compose J m f) \<in> measurable (PiM (f  J) (\<lambda>_. M)) (PiM J (\<lambda>_. M))"
24.495 @@ -1173,7 +1173,7 @@
24.496    assumes inv: "i \<in> J \<Longrightarrow> f' (f i) = i"
24.497  begin
24.498
24.499 -text {* to measure finmaps *}
24.500 +text \<open>to measure finmaps\<close>
24.501
24.502  definition "fm = (finmap_of (f  J)) o (\<lambda>g. compose (f  J) g f')"
24.503
24.504 @@ -1222,7 +1222,7 @@
24.505    apply (auto)
24.506    done
24.507
24.508 -text {* to measure functions *}
24.509 +text \<open>to measure functions\<close>
24.510
24.511  definition "mf = (\<lambda>g. compose J g f) o proj"
24.512
24.513 @@ -1284,7 +1284,7 @@
24.514    using fm_image_measurable[OF assms]
24.515    by (rule subspace_set_in_sets) (auto simp: finite_subset)
24.516
24.517 -text {* measure on finmaps *}
24.518 +text \<open>measure on finmaps\<close>
24.519
24.520  definition "mapmeasure M N = distr M (PiF (Collect finite) N) (fm)"
24.521

    25.1 --- a/src/HOL/Probability/Finite_Product_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
25.2 +++ b/src/HOL/Probability/Finite_Product_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
25.3 @@ -2,7 +2,7 @@
25.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
25.5  *)
25.6
25.7 -section {*Finite product measures*}
25.8 +section \<open>Finite product measures\<close>
25.9
25.10  theory Finite_Product_Measure
25.11  imports Binary_Product_Measure
25.12 @@ -15,7 +15,7 @@
25.13  lemma case_prod_const: "(\<lambda>(i, j). c) = (\<lambda>_. c)"
25.14    by auto
25.15
25.16 -subsubsection {* More about Function restricted by @{const extensional}  *}
25.17 +subsubsection \<open>More about Function restricted by @{const extensional}\<close>
25.18
25.19  definition
25.20    "merge I J = (\<lambda>(x, y) i. if i \<in> I then x i else if i \<in> J then y i else undefined)"
25.21 @@ -92,10 +92,10 @@
25.22    proof cases
25.23      assume x: "x \<in> (\<Pi>\<^sub>E i\<in>J. S i)"
25.24      have "x \<in> A \<longleftrightarrow> merge J (I - J) (x,y) \<in> (\<lambda>x. restrict x J) - A \<inter> (\<Pi>\<^sub>E i\<in>I. S i)"
25.25 -      using y x J \<subseteq> I PiE_cancel_merge[of "J" "I - J" x y S]
25.26 +      using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S]
25.27        by (auto simp del: PiE_cancel_merge simp add: Un_absorb1)
25.28      then show "x \<in> A \<longleftrightarrow> x \<in> B"
25.29 -      using y x J \<subseteq> I PiE_cancel_merge[of "J" "I - J" x y S]
25.30 +      using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S]
25.31        by (auto simp del: PiE_cancel_merge simp add: Un_absorb1 eq)
25.32    qed (insert sets, auto)
25.33  qed
25.34 @@ -109,9 +109,9 @@
25.35    "I \<inter> J = {} \<Longrightarrow> merge I J - Pi\<^sub>E (I \<union> J) E = Pi I E \<times> Pi J E"
25.36    by (auto simp: restrict_Pi_cancel PiE_def)
25.37
25.38 -subsection {* Finite product spaces *}
25.39 +subsection \<open>Finite product spaces\<close>
25.40
25.41 -subsubsection {* Products *}
25.42 +subsubsection \<open>Products\<close>
25.43
25.44  definition prod_emb where
25.45    "prod_emb I M K X = (\<lambda>x. restrict x K) - X \<inter> (PIE i:I. space (M i))"
25.46 @@ -324,7 +324,7 @@
25.47  proof -
25.48    have space: "\<And>i. i \<in> I \<Longrightarrow> space (M i) = space (N i)"
25.49      using sets_eq_imp_space_eq[OF sets] by auto
25.50 -  with sets show ?thesis unfolding I = J
25.51 +  with sets show ?thesis unfolding \<open>I = J\<close>
25.52      by (intro antisym prod_algebra_mono) auto
25.53  qed
25.54
25.55 @@ -339,7 +339,7 @@
25.56    then have "(\<Pi>\<^sub>E i\<in>I. space (M i)) = prod_emb I M {i} (\<Pi>\<^sub>E i\<in>{i}. space (M i))"
25.57      by (auto simp: prod_emb_def)
25.58    also have "\<dots> \<in> prod_algebra I M"
25.59 -    using i \<in> I by (intro prod_algebraI) auto
25.60 +    using \<open>i \<in> I\<close> by (intro prod_algebraI) auto
25.61    finally show ?thesis .
25.62  qed
25.63
25.64 @@ -370,13 +370,13 @@
25.65    proof cases
25.66      assume "I = {}"
25.67      with X have "A = {\<lambda>x. undefined}" by (auto simp: prod_emb_def)
25.68 -    with I = {} show ?thesis by (auto intro!: sigma_sets_top)
25.69 +    with \<open>I = {}\<close> show ?thesis by (auto intro!: sigma_sets_top)
25.70    next
25.71      assume "I \<noteq> {}"
25.72      with X have "A = (\<Inter>j\<in>J. {f\<in>(\<Pi>\<^sub>E i\<in>I. space (M i)). f j \<in> X j})"
25.73        by (auto simp: prod_emb_def)
25.74      also have "\<dots> \<in> sigma_sets ?\<Omega> ?R"
25.75 -      using X I \<noteq> {} by (intro R.finite_INT sigma_sets.Basic) auto
25.76 +      using X \<open>I \<noteq> {}\<close> by (intro R.finite_INT sigma_sets.Basic) auto
25.77      finally show "A \<in> sigma_sets ?\<Omega> ?R" .
25.78    qed
25.79  next
25.80 @@ -412,9 +412,9 @@
25.81    shows "sets (\<Pi>\<^sub>M i\<in>I. sigma (\<Omega> i) (E i)) = sets (sigma (\<Pi>\<^sub>E i\<in>I. \<Omega> i) P)"
25.82  proof cases
25.83    assume "I = {}"
25.84 -  with \<Union>J = I have "P = {{\<lambda>_. undefined}} \<or> P = {}"
25.85 +  with \<open>\<Union>J = I\<close> have "P = {{\<lambda>_. undefined}} \<or> P = {}"
25.86      by (auto simp: P_def)
25.87 -  with I = {} show ?thesis
25.88 +  with \<open>I = {}\<close> show ?thesis
25.89      by (auto simp add: sets_PiM_empty sigma_sets_empty_eq)
25.90  next
25.91    let ?F = "\<lambda>i. {(\<lambda>x. x i) - A \<inter> Pi\<^sub>E I \<Omega> |A. A \<in> E i}"
25.92 @@ -425,7 +425,7 @@
25.93    also have "\<dots> = sets (\<Squnion>\<^sub>\<sigma> i\<in>I. sigma (Pi\<^sub>E I \<Omega>) (?F i))"
25.94      using E by (intro SUP_sigma_cong arg_cong[where f=sets] vimage_algebra_sigma) auto
25.95    also have "\<dots> = sets (sigma (Pi\<^sub>E I \<Omega>) (\<Union>i\<in>I. ?F i))"
25.96 -    using I \<noteq> {} by (intro arg_cong[where f=sets] SUP_sigma_sigma) auto
25.97 +    using \<open>I \<noteq> {}\<close> by (intro arg_cong[where f=sets] SUP_sigma_sigma) auto
25.98    also have "\<dots> = sets (sigma (Pi\<^sub>E I \<Omega>) P)"
25.99    proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI)
25.100      show "(\<Union>i\<in>I. ?F i) \<subseteq> Pow (Pi\<^sub>E I \<Omega>)" "P \<subseteq> Pow (Pi\<^sub>E I \<Omega>)"
25.101 @@ -437,34 +437,34 @@
25.102      fix Z assume "Z \<in> (\<Union>i\<in>I. ?F i)"
25.103      then obtain i A where i: "i \<in> I" "A \<in> E i" and Z_def: "Z = (\<lambda>x. x i) - A \<inter> Pi\<^sub>E I \<Omega>"
25.104        by auto
25.105 -    from i \<in> I J obtain j where j: "i \<in> j" "j \<in> J" "j \<subseteq> I" "finite j"
25.106 +    from \<open>i \<in> I\<close> J obtain j where j: "i \<in> j" "j \<in> J" "j \<subseteq> I" "finite j"
25.107        by auto
25.108      obtain S where S: "\<And>i. i \<in> j \<Longrightarrow> S i \<subseteq> E i" "\<And>i. i \<in> j \<Longrightarrow> countable (S i)"
25.109        "\<And>i. i \<in> j \<Longrightarrow> \<Omega> i = \<Union>(S i)"
25.110 -      by (metis subset_eq \<Omega>_cover j \<subseteq> I)
25.111 +      by (metis subset_eq \<Omega>_cover \<open>j \<subseteq> I\<close>)
25.112      def A' \<equiv> "\<lambda>n. n(i := A)"
25.113      then have A'_i: "\<And>n. A' n i = A"
25.114        by simp
25.115      { fix n assume "n \<in> Pi\<^sub>E (j - {i}) S"
25.116        then have "A' n \<in> Pi j E"
25.117 -        unfolding PiE_def Pi_def using S(1) by (auto simp: A'_def A \<in> E i )
25.118 -      with j \<in> J have "{f \<in> Pi\<^sub>E I \<Omega>. \<forall>i\<in>j. f i \<in> A' n i} \<in> P"
25.119 +        unfolding PiE_def Pi_def using S(1) by (auto simp: A'_def \<open>A \<in> E i\<close> )
25.120 +      with \<open>j \<in> J\<close> have "{f \<in> Pi\<^sub>E I \<Omega>. \<forall>i\<in>j. f i \<in> A' n i} \<in> P"
25.121          by (auto simp: P_def) }
25.122      note A'_in_P = this
25.123
25.124      { fix x assume "x i \<in> A" "x \<in> Pi\<^sub>E I \<Omega>"
25.125 -      with S(3) j \<subseteq> I have "\<forall>i\<in>j. \<exists>s\<in>S i. x i \<in> s"
25.126 +      with S(3) \<open>j \<subseteq> I\<close> have "\<forall>i\<in>j. \<exists>s\<in>S i. x i \<in> s"
25.127          by (auto simp: PiE_def Pi_def)
25.128        then obtain s where s: "\<And>i. i \<in> j \<Longrightarrow> s i \<in> S i" "\<And>i. i \<in> j \<Longrightarrow> x i \<in> s i"
25.129          by metis
25.130 -      with x i \<in> A have "\<exists>n\<in>PiE (j-{i}) S. \<forall>i\<in>j. x i \<in> A' n i"
25.131 +      with \<open>x i \<in> A\<close> have "\<exists>n\<in>PiE (j-{i}) S. \<forall>i\<in>j. x i \<in> A' n i"
25.132          by (intro bexI[of _ "restrict (s(i := A)) (j-{i})"]) (auto simp: A'_def split: if_splits) }
25.133      then have "Z = (\<Union>n\<in>PiE (j-{i}) S. {f\<in>(\<Pi>\<^sub>E i\<in>I. \<Omega> i). \<forall>i\<in>j. f i \<in> A' n i})"
25.134        unfolding Z_def
25.135 -      by (auto simp add: set_eq_iff ball_conj_distrib i\<in>j A'_i dest: bspec[OF _ i\<in>j]
25.136 +      by (auto simp add: set_eq_iff ball_conj_distrib \<open>i\<in>j\<close> A'_i dest: bspec[OF _ \<open>i\<in>j\<close>]
25.137                 cong: conj_cong)
25.138      also have "\<dots> \<in> sigma_sets (\<Pi>\<^sub>E i\<in>I. \<Omega> i) P"
25.139 -      using finite j S(2)
25.140 +      using \<open>finite j\<close> S(2)
25.141        by (intro P.countable_UN' countable_PiE) (simp_all add: image_subset_iff A'_in_P)
25.142      finally show "Z \<in> sigma_sets (\<Pi>\<^sub>E i\<in>I. \<Omega> i) P" .
25.143    next
25.144 @@ -487,8 +487,8 @@
25.145          unfolding b(1)
25.146          by (auto simp: PiE_def Pi_def)
25.147        show ?thesis
25.148 -        unfolding eq using A \<in> Pi j E j \<in> J J(2)
25.149 -        by (intro F.finite_INT J j \<in> J j \<noteq> {} sigma_sets.Basic) blast
25.150 +        unfolding eq using \<open>A \<in> Pi j E\<close> \<open>j \<in> J\<close> J(2)
25.151 +        by (intro F.finite_INT J \<open>j \<in> J\<close> \<open>j \<noteq> {}\<close> sigma_sets.Basic) blast
25.152      qed
25.153    qed
25.154    finally show "?thesis" .
25.155 @@ -575,18 +575,18 @@
25.156  lemma sets_PiM_I_finite[measurable]:
25.157    assumes "finite I" and sets: "(\<And>i. i \<in> I \<Longrightarrow> E i \<in> sets (M i))"
25.158    shows "(PIE j:I. E j) \<in> sets (PIM i:I. M i)"
25.159 -  using sets_PiM_I[of I I E M] sets.sets_into_space[OF sets] finite I sets by auto
25.160 +  using sets_PiM_I[of I I E M] sets.sets_into_space[OF sets] \<open>finite I\<close> sets by auto
25.161
25.162  lemma measurable_component_singleton[measurable (raw)]:
25.163    assumes "i \<in> I" shows "(\<lambda>x. x i) \<in> measurable (Pi\<^sub>M I M) (M i)"
25.164  proof (unfold measurable_def, intro CollectI conjI ballI)
25.165    fix A assume "A \<in> sets (M i)"
25.166    then have "(\<lambda>x. x i) - A \<inter> space (Pi\<^sub>M I M) = prod_emb I M {i} (\<Pi>\<^sub>E j\<in>{i}. A)"
25.167 -    using sets.sets_into_space i \<in> I
25.168 +    using sets.sets_into_space \<open>i \<in> I\<close>
25.169      by (fastforce dest: Pi_mem simp: prod_emb_def space_PiM split: split_if_asm)
25.170    then show "(\<lambda>x. x i) - A \<inter> space (Pi\<^sub>M I M) \<in> sets (Pi\<^sub>M I M)"
25.171 -    using A \<in> sets (M i) i \<in> I by (auto intro!: sets_PiM_I)
25.172 -qed (insert i \<in> I, auto simp: space_PiM)
25.173 +    using \<open>A \<in> sets (M i)\<close> \<open>i \<in> I\<close> by (auto intro!: sets_PiM_I)
25.174 +qed (insert \<open>i \<in> I\<close>, auto simp: space_PiM)
25.175
25.176  lemma measurable_component_singleton'[measurable_dest]:
25.177    assumes f: "f \<in> measurable N (Pi\<^sub>M I M)"
25.178 @@ -863,7 +863,7 @@
25.179      show "f \<in> (\<Union>i. ?F i)" by (auto simp: incseq_def PiE_def)
25.180    next
25.181      fix i show "?F i \<subseteq> ?F (Suc i)"
25.182 -      using \<And>i. incseq (F i)[THEN incseq_SucD] by auto
25.183 +      using \<open>\<And>i. incseq (F i)\<close>[THEN incseq_SucD] by auto
25.184    qed
25.185  qed
25.186
25.187 @@ -892,7 +892,7 @@
25.188  proof (induct I arbitrary: A rule: finite_induct)
25.189    case (insert i I)
25.190    interpret finite_product_sigma_finite M I by standard fact
25.191 -  have "finite (insert i I)" using finite I by auto
25.192 +  have "finite (insert i I)" using \<open>finite I\<close> by auto
25.193    interpret I': finite_product_sigma_finite M "insert i I" by standard fact
25.194    let ?h = "(\<lambda>(f, y). f(i := y))"
25.195
25.196 @@ -1065,7 +1065,7 @@
25.197      fix x assume x: "x \<in> space (Pi\<^sub>M I M)"
25.198      let ?f = "\<lambda>y. f (x(i := y))"
25.199      show "?f \<in> borel_measurable (M i)"
25.200 -      using measurable_comp[OF measurable_component_update f, OF x i \<notin> I]
25.201 +      using measurable_comp[OF measurable_component_update f, OF x \<open>i \<notin> I\<close>]
25.202        unfolding comp_def .
25.203      show "(\<integral>\<^sup>+ y. f (merge I {i} (x, y)) \<partial>Pi\<^sub>M {i} M) = (\<integral>\<^sup>+ y. f (x(i := y i)) \<partial>Pi\<^sub>M {i} M)"
25.204        using x
25.205 @@ -1092,7 +1092,7 @@
25.206    shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
25.207  using assms proof induct
25.208    case (insert i I)
25.209 -  note finite I[intro, simp]
25.210 +  note \<open>finite I\<close>[intro, simp]
25.211    interpret I: finite_product_sigma_finite M I by standard auto
25.212    have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
25.213      using insert by (auto intro!: setprod.cong)

    26.1 --- a/src/HOL/Probability/Giry_Monad.thy	Mon Dec 07 16:48:10 2015 +0000
26.2 +++ b/src/HOL/Probability/Giry_Monad.thy	Mon Dec 07 20:19:59 2015 +0100
26.3 @@ -10,7 +10,7 @@
26.5  begin
26.6
26.7 -section {* Sub-probability spaces *}
26.8 +section \<open>Sub-probability spaces\<close>
26.9
26.10  locale subprob_space = finite_measure +
26.11    assumes emeasure_space_le_1: "emeasure M (space M) \<le> 1"
26.12 @@ -93,7 +93,7 @@
26.13    from mono' derivg have "\<And>x. x \<in> {a<..<b} \<Longrightarrow> g' x \<ge> 0"
26.14      by (rule mono_on_imp_deriv_nonneg) (auto simp: interior_atLeastAtMost_real)
26.15    from contg' this have derivg_nonneg: "\<And>x. x \<in> {a..b} \<Longrightarrow> g' x \<ge> 0"
26.16 -    by (rule continuous_ge_on_Iii) (simp_all add: a < b)
26.17 +    by (rule continuous_ge_on_Iii) (simp_all add: \<open>a < b\<close>)
26.18
26.19    from derivg have contg: "continuous_on {a..b} g" by (rule has_real_derivative_imp_continuous_on)
26.20    have A: "h - {a..b} = {g a..g b}"
26.21 @@ -119,13 +119,13 @@
26.22    with assms have "(\<integral>\<^sup>+x. f x * indicator {g a..g b} x \<partial>lborel) =
26.23                        (\<integral>\<^sup>+x. f (g x) * g' x * indicator {a..b} x \<partial>lborel)"
26.24      by (intro nn_integral_substitution_aux)
26.25 -       (auto simp: derivg_nonneg A B emeasure_density mult.commute a < b)
26.26 +       (auto simp: derivg_nonneg A B emeasure_density mult.commute \<open>a < b\<close>)
26.27    also have "... = emeasure (density lborel (\<lambda>x. f (g x) * g' x)) {a..b}"
26.29    finally show ?thesis .
26.30  next
26.31    assume "\<not>a < b"
26.32 -  with a \<le> b have [simp]: "b = a" by (simp add: not_less del: a \<le> b)
26.33 +  with \<open>a \<le> b\<close> have [simp]: "b = a" by (simp add: not_less del: \<open>a \<le> b\<close>)
26.34    from inv and range have "h - {a} = {g a}" by auto
26.35    thus ?thesis by (simp_all add: emeasure_distr emeasure_density measurable_sets_borel[OF Mh])
26.36  qed
26.37 @@ -185,7 +185,7 @@
26.38    using measurable_space[OF N x]
26.39    by (auto simp: space_subprob_algebra intro!: measurable_cong_sets dest: sets_eq_imp_space_eq)
26.40
26.41 -ML {*
26.42 +ML \<open>
26.43
26.44  fun subprob_cong thm ctxt = (
26.45    let
26.46 @@ -198,7 +198,7 @@
26.47    end
26.48    handle THM _ => ([], ctxt) | TERM _ => ([], ctxt))
26.49
26.50 -*}
26.51 +\<close>
26.52
26.53  setup \<open>
26.55 @@ -460,7 +460,7 @@
26.56    qed
26.57  qed
26.58
26.59 -section {* Properties of return *}
26.60 +section \<open>Properties of return\<close>
26.61
26.62  definition return :: "'a measure \<Rightarrow> 'a \<Rightarrow> 'a measure" where
26.63    "return R x = measure_of (space R) (sets R) (\<lambda>A. indicator A x)"
26.64 @@ -525,11 +525,11 @@
26.65    assumes "g x \<ge> 0" "x \<in> space M" "g \<in> borel_measurable M"
26.66    shows "(\<integral>\<^sup>+ a. g a \<partial>return M x) = g x"
26.67  proof-
26.68 -  interpret prob_space "return M x" by (rule prob_space_return[OF x \<in> space M])
26.69 +  interpret prob_space "return M x" by (rule prob_space_return[OF \<open>x \<in> space M\<close>])
26.70    have "(\<integral>\<^sup>+ a. g a \<partial>return M x) = (\<integral>\<^sup>+ a. g x \<partial>return M x)" using assms
26.71      by (intro nn_integral_cong_AE) (auto simp: AE_return)
26.72    also have "... = g x"
26.73 -    using nn_integral_const[OF g x \<ge> 0, of "return M x"] emeasure_space_1 by simp
26.74 +    using nn_integral_const[OF \<open>g x \<ge> 0\<close>, of "return M x"] emeasure_space_1 by simp
26.75    finally show ?thesis .
26.76  qed
26.77
26.78 @@ -538,7 +538,7 @@
26.79    assumes "x \<in> space M" "g \<in> borel_measurable M"
26.80    shows "(\<integral>a. g a \<partial>return M x) = g x"
26.81  proof-
26.82 -  interpret prob_space "return M x" by (rule prob_space_return[OF x \<in> space M])
26.83 +  interpret prob_space "return M x" by (rule prob_space_return[OF \<open>x \<in> space M\<close>])
26.84    have "(\<integral>a. g a \<partial>return M x) = (\<integral>a. g x \<partial>return M x)" using assms
26.85      by (intro integral_cong_AE) (auto simp: AE_return)
26.86    then show ?thesis
26.87 @@ -696,7 +696,7 @@
26.88    "sets M = sets (subprob_algebra N) \<Longrightarrow> space (select_sets M) = space N"
26.89    by (intro sets_eq_imp_space_eq sets_select_sets)
26.90
26.91 -section {* Join *}
26.92 +section \<open>Join\<close>
26.93
26.94  definition join :: "'a measure measure \<Rightarrow> 'a measure" where
26.95    "join M = measure_of (space (select_sets M)) (sets (select_sets M)) (\<lambda>B. \<integral>\<^sup>+ M'. emeasure M' B \<partial>M)"
26.96 @@ -734,10 +734,10 @@
26.97    proof (rule measurable_cong)
26.98      fix M' assume "M' \<in> space (subprob_algebra (subprob_algebra N))"
26.99      then show "emeasure (join M') A = (\<integral>\<^sup>+ M''. emeasure M'' A \<partial>M')"
26.100 -      by (intro emeasure_join) (auto simp: space_subprob_algebra A\<in>sets N)
26.101 +      by (intro emeasure_join) (auto simp: space_subprob_algebra \<open>A\<in>sets N\<close>)
26.102    qed
26.103    also have "(\<lambda>M'. \<integral>\<^sup>+M''. emeasure M'' A \<partial>M') \<in> ?B"
26.104 -    using measurable_emeasure_subprob_algebra[OF A\<in>sets N]
26.105 +    using measurable_emeasure_subprob_algebra[OF \<open>A\<in>sets N\<close>]
26.106      by (rule nn_integral_measurable_subprob_algebra)
26.107    finally show "(\<lambda>M'. emeasure (join M') A) \<in> borel_measurable (subprob_algebra (subprob_algebra N))" .
26.108  next
26.109 @@ -1037,7 +1037,7 @@
26.110      fix M' assume "M' \<in> space M"
26.111      from assms have "space M = space (subprob_algebra R)"
26.112          using sets_eq_imp_space_eq by blast
26.113 -    with M' \<in> space M have [simp]: "sets M' = sets R" using space_subprob_algebra by blast
26.114 +    with \<open>M' \<in> space M\<close> have [simp]: "sets M' = sets R" using space_subprob_algebra by blast
26.115      show "f \<in> measurable M' N" by (simp cong: measurable_cong_sets add: assms)
26.116      have "space M' = space R" by (rule sets_eq_imp_space_eq) simp
26.117      thus "emeasure M' (f - A \<inter> space R) = emeasure M' (f - A \<inter> space M')" by simp
26.118 @@ -1088,7 +1088,7 @@
26.119    assume "space M \<noteq> {}"
26.120    hence "(SOME x. x \<in> space M) \<in> space M" by (rule_tac someI_ex) blast
26.121    with assms have "f (SOME x. x \<in> space M) = g (SOME x. x \<in> space M)" by blast
26.122 -  with space M \<noteq> {} and assms show ?thesis by (simp add: bind_nonempty cong: distr_cong)
26.123 +  with \<open>space M \<noteq> {}\<close> and assms show ?thesis by (simp add: bind_nonempty cong: distr_cong)
26.125
26.126  lemma bind_nonempty':
26.127 @@ -1319,7 +1319,7 @@
26.128    shows "(distr M X f \<guillemotright>= N) = (M \<guillemotright>= (\<lambda>x. N (f x)))"
26.129  proof -
26.130    have "space X \<noteq> {}" "space M \<noteq> {}"
26.131 -    using space M \<noteq> {} f[THEN measurable_space] by auto
26.132 +    using \<open>space M \<noteq> {}\<close> f[THEN measurable_space] by auto
26.133    then show ?thesis
26.134      by (simp add: bind_nonempty''[where N=K] distr_distr comp_def)
26.135  qed
26.136 @@ -1419,8 +1419,8 @@
26.137    from assms have sets_fx[simp]: "\<And>x. x \<in> space M \<Longrightarrow> sets (f x) = sets N"
26.139    have ex_in: "\<And>A. A \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> A" by blast
26.140 -  note sets_some[simp] = sets_kernel[OF M1 someI_ex[OF ex_in[OF space M \<noteq> {}]]]
26.141 -                         sets_kernel[OF M2 someI_ex[OF ex_in[OF space N \<noteq> {}]]]
26.142 +  note sets_some[simp] = sets_kernel[OF M1 someI_ex[OF ex_in[OF \<open>space M \<noteq> {}\<close>]]]
26.143 +                         sets_kernel[OF M2 someI_ex[OF ex_in[OF \<open>space N \<noteq> {}\<close>]]]
26.144    note space_some[simp] = sets_eq_imp_space_eq[OF this(1)] sets_eq_imp_space_eq[OF this(2)]
26.145
26.146    have "bind M (\<lambda>x. bind (f x) g) =
26.147 @@ -1504,7 +1504,7 @@
26.148    finally show ?thesis .
26.149  qed
26.150
26.151 -section {* Measures form a $\omega$-chain complete partial order *}
26.152 +section \<open>Measures form a $\omega$-chain complete partial order\<close>
26.153
26.154  definition SUP_measure :: "(nat \<Rightarrow> 'a measure) \<Rightarrow> 'a measure" where
26.155    "SUP_measure M = measure_of (\<Union>i. space (M i)) (\<Union>i. sets (M i)) (\<lambda>A. SUP i. emeasure (M i) A)"

    27.1 --- a/src/HOL/Probability/Independent_Family.thy	Mon Dec 07 16:48:10 2015 +0000
27.2 +++ b/src/HOL/Probability/Independent_Family.thy	Mon Dec 07 20:19:59 2015 +0100
27.3 @@ -3,7 +3,7 @@
27.4      Author:     Sudeep Kanav, TU MÃ¼nchen
27.5  *)
27.6
27.7 -section {* Independent families of events, event sets, and random variables *}
27.8 +section \<open>Independent families of events, event sets, and random variables\<close>
27.9
27.10  theory Independent_Family
27.11    imports Probability_Measure Infinite_Product_Measure
27.12 @@ -101,7 +101,7 @@
27.13    fix F J assume "J \<noteq> {}" "J \<subseteq> UNIV"
27.14      and F: "\<forall>j\<in>J. F j \<in> (case j of True \<Rightarrow> A | False \<Rightarrow> B)"
27.15    have "J \<in> Pow UNIV" by auto
27.16 -  with F J \<noteq> {} indep[of "F True" "F False"]
27.17 +  with F \<open>J \<noteq> {}\<close> indep[of "F True" "F False"]
27.18    show "prob (\<Inter>j\<in>J. F j) = (\<Prod>j\<in>J. prob (F j))"
27.19      unfolding UNIV_bool Pow_insert by (auto simp: ac_simps)
27.20  qed (auto split: bool.split simp: ev)
27.21 @@ -155,19 +155,19 @@
27.22              next
27.23                assume "J \<noteq> {j}"
27.24                have "prob (\<Inter>i\<in>J. A i) = prob ((\<Inter>i\<in>J-{j}. A i) \<inter> X)"
27.25 -                using j \<in> J A j = X by (auto intro!: arg_cong[where f=prob] split: split_if_asm)
27.26 +                using \<open>j \<in> J\<close> \<open>A j = X\<close> by (auto intro!: arg_cong[where f=prob] split: split_if_asm)
27.27                also have "\<dots> = prob X * (\<Prod>i\<in>J-{j}. prob (A i))"
27.28                proof (rule indep)
27.29                  show "J - {j} \<noteq> {}" "J - {j} \<subseteq> K" "finite (J - {j})" "j \<notin> J - {j}"
27.30 -                  using J J \<noteq> {j} j \<in> J by auto
27.31 +                  using J \<open>J \<noteq> {j}\<close> \<open>j \<in> J\<close> by auto
27.32                  show "\<forall>i\<in>J - {j}. A i \<in> G i"
27.33                    using J by auto
27.34                qed
27.35                also have "\<dots> = prob (A j) * (\<Prod>i\<in>J-{j}. prob (A i))"
27.36 -                using A j = X by simp
27.37 +                using \<open>A j = X\<close> by simp
27.38                also have "\<dots> = (\<Prod>i\<in>J. prob (A i))"
27.39 -                unfolding setprod.insert_remove[OF finite J, symmetric, of "\<lambda>i. prob  (A i)"]
27.40 -                using j \<in> J by (simp add: insert_absorb)
27.41 +                unfolding setprod.insert_remove[OF \<open>finite J\<close>, symmetric, of "\<lambda>i. prob  (A i)"]
27.42 +                using \<open>j \<in> J\<close> by (simp add: insert_absorb)
27.43                finally show ?thesis .
27.44              qed
27.45            next
27.46 @@ -191,23 +191,23 @@
27.47              using G by auto
27.48            have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) =
27.49                prob ((\<Inter>j\<in>J. A j) - (\<Inter>i\<in>insert j J. (A(j := X)) i))"
27.50 -            using A_sets sets.sets_into_space[of _ M] X J \<noteq> {}
27.51 +            using A_sets sets.sets_into_space[of _ M] X \<open>J \<noteq> {}\<close>
27.52              by (auto intro!: arg_cong[where f=prob] split: split_if_asm)
27.53            also have "\<dots> = prob (\<Inter>j\<in>J. A j) - prob (\<Inter>i\<in>insert j J. (A(j := X)) i)"
27.54 -            using J J \<noteq> {} j \<notin> J A_sets X sets.sets_into_space
27.55 +            using J \<open>J \<noteq> {}\<close> \<open>j \<notin> J\<close> A_sets X sets.sets_into_space
27.56              by (auto intro!: finite_measure_Diff sets.finite_INT split: split_if_asm)
27.57            finally have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) =
27.58                prob (\<Inter>j\<in>J. A j) - prob (\<Inter>i\<in>insert j J. (A(j := X)) i)" .
27.59            moreover {
27.60              have "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))"
27.61 -              using J A finite J by (intro indep_setsD[OF G(1)]) auto
27.62 +              using J A \<open>finite J\<close> by (intro indep_setsD[OF G(1)]) auto
27.63              then have "prob (\<Inter>j\<in>J. A j) = prob (space M) * (\<Prod>i\<in>J. prob (A i))"
27.64                using prob_space by simp }
27.65            moreover {
27.66              have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = (\<Prod>i\<in>insert j J. prob ((A(j := X)) i))"
27.67 -              using J A j \<in> K by (intro indep_setsD[OF G']) auto
27.68 +              using J A \<open>j \<in> K\<close> by (intro indep_setsD[OF G']) auto
27.69              then have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = prob X * (\<Prod>i\<in>J. prob (A i))"
27.70 -              using finite J j \<notin> J by (auto intro!: setprod.cong) }
27.71 +              using \<open>finite J\<close> \<open>j \<notin> J\<close> by (auto intro!: setprod.cong) }
27.72            ultimately have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = (prob (space M) - prob X) * (\<Prod>i\<in>J. prob (A i))"
27.74            also have "\<dots> = prob (space M - X) * (\<Prod>i\<in>J. prob (A i))"
27.75 @@ -223,19 +223,19 @@
27.76            then have A_sets: "\<And>i. i\<in>J \<Longrightarrow> A i \<in> events"
27.77              using G by auto
27.78            have "prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)) = prob (\<Union>k. (\<Inter>i\<in>insert j J. (A(j := F k)) i))"
27.79 -            using J \<noteq> {} j \<notin> J j \<in> K by (auto intro!: arg_cong[where f=prob] split: split_if_asm)
27.80 +            using \<open>J \<noteq> {}\<close> \<open>j \<notin> J\<close> \<open>j \<in> K\<close> by (auto intro!: arg_cong[where f=prob] split: split_if_asm)
27.81            moreover have "(\<lambda>k. prob (\<Inter>i\<in>insert j J. (A(j := F k)) i)) sums prob (\<Union>k. (\<Inter>i\<in>insert j J. (A(j := F k)) i))"
27.82            proof (rule finite_measure_UNION)
27.83              show "disjoint_family (\<lambda>k. \<Inter>i\<in>insert j J. (A(j := F k)) i)"
27.84                using disj by (rule disjoint_family_on_bisimulation) auto
27.85              show "range (\<lambda>k. \<Inter>i\<in>insert j J. (A(j := F k)) i) \<subseteq> events"
27.86 -              using A_sets F finite J J \<noteq> {} j \<notin> J by (auto intro!: sets.Int)
27.87 +              using A_sets F \<open>finite J\<close> \<open>J \<noteq> {}\<close> \<open>j \<notin> J\<close> by (auto intro!: sets.Int)
27.88            qed
27.89            moreover { fix k
27.90 -            from J A j \<in> K have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * (\<Prod>i\<in>J. prob (A i))"
27.91 +            from J A \<open>j \<in> K\<close> have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * (\<Prod>i\<in>J. prob (A i))"
27.92                by (subst indep_setsD[OF F(2)]) (auto intro!: setprod.cong split: split_if_asm)
27.93              also have "\<dots> = prob (F k) * prob (\<Inter>i\<in>J. A i)"
27.94 -              using J A j \<in> K by (subst indep_setsD[OF G(1)]) auto
27.95 +              using J A \<open>j \<in> K\<close> by (subst indep_setsD[OF G(1)]) auto
27.96              finally have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * prob (\<Inter>i\<in>J. A i)" . }
27.97            ultimately have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)))"
27.98              by simp
27.99 @@ -243,7 +243,7 @@
27.100            have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob (\<Union>k. F k) * prob (\<Inter>i\<in>J. A i))"
27.101              using disj F(1) by (intro finite_measure_UNION sums_mult2) auto
27.102            then have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob (\<Union>k. F k) * (\<Prod>i\<in>J. prob (A i)))"
27.103 -            using J A j \<in> K by (subst indep_setsD[OF G(1), symmetric]) auto
27.104 +            using J A \<open>j \<in> K\<close> by (subst indep_setsD[OF G(1), symmetric]) auto
27.105            ultimately
27.106            show "prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)) = prob (\<Union>k. F k) * (\<Prod>j\<in>J. prob (A j))"
27.107              by (auto dest!: sums_unique)
27.108 @@ -252,10 +252,10 @@
27.109        then have mono: "dynkin (space M) (G j) \<subseteq> {E \<in> events. indep_sets (G(j := {E})) K}"
27.110        proof (rule dynkin_system.dynkin_subset, safe)
27.111          fix X assume "X \<in> G j"
27.112 -        then show "X \<in> events" using G j \<in> K by auto
27.113 -        from indep_sets G K
27.114 +        then show "X \<in> events" using G \<open>j \<in> K\<close> by auto
27.115 +        from \<open>indep_sets G K\<close>
27.116          show "indep_sets (G(j := {X})) K"
27.117 -          by (rule indep_sets_mono_sets) (insert X \<in> G j, auto)
27.118 +          by (rule indep_sets_mono_sets) (insert \<open>X \<in> G j\<close>, auto)
27.119        qed
27.120        have "indep_sets (G(j:=?D)) K"
27.121        proof (rule indep_setsI)
27.122 @@ -279,9 +279,9 @@
27.123        then have "indep_sets (G(j := dynkin (space M) (G j))) K"
27.124          by (rule indep_sets_mono_sets) (insert mono, auto)
27.125        then show ?case
27.126 -        by (rule indep_sets_mono_sets) (insert j \<in> K j \<notin> J, auto simp: G_def)
27.127 -    qed (insert indep_sets F K, simp) }
27.128 -  from this[OF indep_sets F J finite J subset_refl]
27.129 +        by (rule indep_sets_mono_sets) (insert \<open>j \<in> K\<close> \<open>j \<notin> J\<close>, auto simp: G_def)
27.130 +    qed (insert \<open>indep_sets F K\<close>, simp) }
27.131 +  from this[OF \<open>indep_sets F J\<close> \<open>finite J\<close> subset_refl]
27.132    show "indep_sets ?F J"
27.133      by (rule indep_sets_mono_sets) auto
27.134  qed
27.135 @@ -375,7 +375,7 @@
27.136    have "indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV"
27.137    proof (rule indep_sets_sigma)
27.138      show "indep_sets (case_bool A B) UNIV"
27.139 -      by (rule indep_set A B[unfolded indep_set_def])
27.140 +      by (rule \<open>indep_set A B\<close>[unfolded indep_set_def])
27.141      fix i show "Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)"
27.142        using A B by (cases i) auto
27.143    qed
27.144 @@ -398,7 +398,7 @@
27.145      then have "{{x \<in> space M. P i (X i x)}} = {X i - {x\<in>space (N i). P i x} \<inter> space M}"
27.146        using indep by (auto simp: indep_vars_def dest: measurable_space)
27.147      also have "\<dots> \<subseteq> {X i - A \<inter> space M |A. A \<in> sets (N i)}"
27.148 -      using P[OF i \<in> I] by blast
27.149 +      using P[OF \<open>i \<in> I\<close>] by blast
27.150      finally show "{{x \<in> space M. P i (X i x)}} \<subseteq> {X i - A \<inter> space M |A. A \<in> sets (N i)}" .
27.151    qed
27.152  qed
27.153 @@ -457,10 +457,10 @@
27.154          have "k = j"
27.155          proof (rule ccontr)
27.156            assume "k \<noteq> j"
27.157 -          with disjoint K \<subseteq> J k \<in> K j \<in> K have "I k \<inter> I j = {}"
27.158 +          with disjoint \<open>K \<subseteq> J\<close> \<open>k \<in> K\<close> \<open>j \<in> K\<close> have "I k \<inter> I j = {}"
27.159              unfolding disjoint_family_on_def by auto
27.160 -          with L(2,3)[OF j \<in> K] L(2,3)[OF k \<in> K]
27.161 -          show False using l \<in> L k l \<in> L j by auto
27.162 +          with L(2,3)[OF \<open>j \<in> K\<close>] L(2,3)[OF \<open>k \<in> K\<close>]
27.163 +          show False using \<open>l \<in> L k\<close> \<open>l \<in> L j\<close> by auto
27.164          qed }
27.165        note L_inj = this
27.166
27.167 @@ -494,7 +494,7 @@
27.168        let ?A = "\<lambda>k. (if k \<in> Ka \<inter> Kb then Ea k \<inter> Eb k else if k \<in> Kb then Eb k else if k \<in> Ka then Ea k else {})"
27.169        have "a \<inter> b = INTER (Ka \<union> Kb) ?A"
27.170          by (simp add: a b set_eq_iff) auto
27.171 -      with a b j \<in> J Int_stableD[OF Int_stable] show "a \<inter> b \<in> ?E j"
27.172 +      with a b \<open>j \<in> J\<close> Int_stableD[OF Int_stable] show "a \<inter> b \<in> ?E j"
27.173          by (intro CollectI exI[of _ "Ka \<union> Kb"] exI[of _ ?A]) auto
27.174      qed
27.175    qed
27.176 @@ -536,10 +536,10 @@
27.177          { interpret sigma_algebra "space M" "?UN j"
27.178              by (rule sigma_algebra_sigma_sets) auto
27.179            have "\<And>A. (\<And>i. i \<in> J \<Longrightarrow> A i \<in> ?UN j) \<Longrightarrow> INTER J A \<in> ?UN j"
27.180 -            using finite J J \<noteq> {} by (rule finite_INT) blast }
27.181 +            using \<open>finite J\<close> \<open>J \<noteq> {}\<close> by (rule finite_INT) blast }
27.182          note INT = this
27.183
27.184 -        from J \<noteq> {} J K E[rule_format, THEN sets.sets_into_space] j
27.185 +        from \<open>J \<noteq> {}\<close> J K E[rule_format, THEN sets.sets_into_space] j
27.186          have "(\<lambda>\<omega>. \<lambda>i\<in>K j. X i \<omega>) - prod_emb (K j) M' J (Pi\<^sub>E J E) \<inter> space M
27.187            = (\<Inter>i\<in>J. X i - E i \<inter> space M)"
27.188            apply (subst prod_emb_PiE[OF _ ])
27.189 @@ -552,7 +552,7 @@
27.190          also have "\<dots> \<in> ?UN j"
27.191            apply (rule INT)
27.192            apply (rule sigma_sets.Basic)
27.193 -          using J \<subseteq> K j E
27.194 +          using \<open>J \<subseteq> K j\<close> E
27.195            apply auto
27.196            done
27.197          finally show ?thesis .
27.198 @@ -630,7 +630,7 @@
27.199      from this[of 0] have "X \<in> sigma_sets (space M) (UNION UNIV A)" by simp
27.200      then have "X \<subseteq> space M"
27.201        by induct (insert A.sets_into_space, auto)
27.202 -    with x \<in> X show "x \<in> space M" by auto }
27.203 +    with \<open>x \<in> X\<close> show "x \<in> space M" by auto }
27.204    { fix F :: "nat \<Rightarrow> 'a set" and n assume "range F \<subseteq> ?A"
27.205      then show "(UNION UNIV F) \<in> sigma_sets (space M) (UNION {n..} A)"
27.206        by (intro sigma_sets.Union) auto }
27.207 @@ -661,11 +661,11 @@
27.208        using sets.sets_into_space by auto
27.209    next
27.210      show "space M \<in> ?D"
27.211 -      using prob_space X \<subseteq> space M by (simp add: Int_absorb2)
27.212 +      using prob_space \<open>X \<subseteq> space M\<close> by (simp add: Int_absorb2)
27.213    next
27.214      fix A assume A: "A \<in> ?D"
27.215      have "prob (X \<inter> (space M - A)) = prob (X - (X \<inter> A))"
27.216 -      using X \<subseteq> space M by (auto intro!: arg_cong[where f=prob])
27.217 +      using \<open>X \<subseteq> space M\<close> by (auto intro!: arg_cong[where f=prob])
27.218      also have "\<dots> = prob X - prob (X \<inter> A)"
27.219        using X_in A by (intro finite_measure_Diff) auto
27.220      also have "\<dots> = prob X * prob (space M) - prob X * prob A"
27.221 @@ -674,7 +674,7 @@
27.222        using X_in A sets.sets_into_space
27.223        by (subst finite_measure_Diff) (auto simp: field_simps)
27.224      finally show "space M - A \<in> ?D"
27.225 -      using A X \<subseteq> space M by auto
27.226 +      using A \<open>X \<subseteq> space M\<close> by auto
27.227    next
27.228      fix F :: "nat \<Rightarrow> 'a set" assume dis: "disjoint_family F" and "range F \<subseteq> ?D"
27.229      then have F: "range F \<subseteq> events" "\<And>i. prob (X \<inter> F i) = prob X * prob (F i)"
27.230 @@ -726,7 +726,7 @@
27.231    then have "(\<Union>n. sigma_sets (space M) (\<Union>m\<in>{..n}. A m)) \<subseteq> ?D" (is "?A \<subseteq> _")
27.232      by auto
27.233
27.234 -  note X \<in> tail_events A
27.235 +  note \<open>X \<in> tail_events A\<close>
27.236    also {
27.237      have "\<And>n. sigma_sets (space M) (\<Union>i\<in>{n..}. A i) \<subseteq> sigma_sets (space M) ?A"
27.238        by (intro sigma_sets_subseteq UN_mono) auto
27.239 @@ -757,7 +757,7 @@
27.240      qed
27.241    qed
27.242    also have "dynkin (space M) ?A \<subseteq> ?D"
27.243 -    using ?A \<subseteq> ?D by (auto intro!: D.dynkin_subset)
27.244 +    using \<open>?A \<subseteq> ?D\<close> by (auto intro!: D.dynkin_subset)
27.245    finally show ?thesis by auto
27.246  qed
27.247
27.248 @@ -838,8 +838,8 @@
27.249      with indep have "prob (\<Inter>j\<in>I. ?A j) = (\<Prod>j\<in>I. prob (?A j))"
27.250        by auto
27.251      also have "\<dots> = (\<Prod>j\<in>J. prob (A j))"
27.252 -      unfolding if_distrib setprod.If_cases[OF finite I]
27.253 -      using prob_space J \<subseteq> I by (simp add: Int_absorb1 setprod.neutral_const)
27.254 +      unfolding if_distrib setprod.If_cases[OF \<open>finite I\<close>]
27.255 +      using prob_space \<open>J \<subseteq> I\<close> by (simp add: Int_absorb1 setprod.neutral_const)
27.256      finally show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" ..
27.257    qed
27.258  qed
27.259 @@ -858,10 +858,10 @@
27.260      unfolding measurable_def by simp
27.261
27.262    { fix i assume "i\<in>I"
27.263 -    from closed[OF i \<in> I]
27.264 +    from closed[OF \<open>i \<in> I\<close>]
27.265      have "sigma_sets (space M) {X i - A \<inter> space M |A. A \<in> sets (M' i)}
27.266        = sigma_sets (space M) {X i - A \<inter> space M |A. A \<in> E i}"
27.267 -      unfolding sigma_sets_vimage_commute[OF X, OF i \<in> I, symmetric] M'[OF i \<in> I]
27.268 +      unfolding sigma_sets_vimage_commute[OF X, OF \<open>i \<in> I\<close>, symmetric] M'[OF \<open>i \<in> I\<close>]
27.269        by (subst sigma_sets_sigma_sets_eq) auto }
27.270    note sigma_sets_X = this
27.271
27.272 @@ -875,7 +875,7 @@
27.273        then obtain B where "b = X i - B \<inter> space M" "B \<in> E i" by auto
27.274        moreover
27.275        have "(X i - A \<inter> space M) \<inter> (X i - B \<inter> space M) = X i - (A \<inter> B) \<inter> space M" by auto
27.276 -      moreover note Int_stable[OF i \<in> I]
27.277 +      moreover note Int_stable[OF \<open>i \<in> I\<close>]
27.278        ultimately
27.279        show "a \<inter> b \<in> {X i - A \<inter> space M |A. A \<in> E i}"
27.280          by (auto simp del: vimage_Int intro!: exI[of _ "A \<inter> B"] dest: Int_stableD)
27.281 @@ -884,12 +884,12 @@
27.282
27.283    { fix i assume "i \<in> I"
27.284      { fix A assume "A \<in> E i"
27.285 -      with M'[OF i \<in> I] have "A \<in> sets (M' i)" by auto
27.286 +      with M'[OF \<open>i \<in> I\<close>] have "A \<in> sets (M' i)" by auto
27.287        moreover
27.288 -      from rv[OF i\<in>I] have "X i \<in> measurable M (M' i)" by auto
27.289 +      from rv[OF \<open>i\<in>I\<close>] have "X i \<in> measurable M (M' i)" by auto
27.290        ultimately
27.291        have "X i - A \<inter> space M \<in> sets M" by (auto intro: measurable_sets) }
27.292 -    with X[OF i\<in>I] space[OF i\<in>I]
27.293 +    with X[OF \<open>i\<in>I\<close>] space[OF \<open>i\<in>I\<close>]
27.294      have "{X i - A \<inter> space M |A. A \<in> E i} \<subseteq> events"
27.295        "space M \<in> {X i - A \<inter> space M |A. A \<in> E i}"
27.296        by (auto intro!: exI[of _ "space (M' i)"]) }
27.297 @@ -900,7 +900,7 @@
27.298      (is "?L = ?R")
27.299    proof safe
27.300      fix A assume ?L and A: "A \<in> (\<Pi> i\<in>I. E i)"
27.301 -    from ?L[THEN bspec, of "\<lambda>i. X i - A i \<inter> space M"] A I \<noteq> {}
27.302 +    from \<open>?L\<close>[THEN bspec, of "\<lambda>i. X i - A i \<inter> space M"] A \<open>I \<noteq> {}\<close>
27.303      show "prob ((\<Inter>j\<in>I. X j - A j) \<inter> space M) = (\<Prod>x\<in>I. prob (X x - A x \<inter> space M))"
27.304        by (auto simp add: Pi_iff)
27.305    next
27.306 @@ -908,11 +908,11 @@
27.307      from A have "\<forall>i\<in>I. \<exists>B. A i = X i - B \<inter> space M \<and> B \<in> E i" by auto
27.308      from bchoice[OF this] obtain B where B: "\<forall>i\<in>I. A i = X i - B i \<inter> space M"
27.309        "B \<in> (\<Pi> i\<in>I. E i)" by auto
27.310 -    from ?R[THEN bspec, OF B(2)] B(1) I \<noteq> {}
27.311 +    from \<open>?R\<close>[THEN bspec, OF B(2)] B(1) \<open>I \<noteq> {}\<close>
27.312      show "prob (INTER I A) = (\<Prod>j\<in>I. prob (A j))"
27.313        by simp
27.314    qed
27.315 -  then show ?thesis using I \<noteq> {}
27.316 +  then show ?thesis using \<open>I \<noteq> {}\<close>
27.317      by (simp add: rv indep_vars_def indep_sets_X sigma_sets_X indep_sets_finite_X cong: indep_sets_cong)
27.318  qed
27.319
27.320 @@ -922,21 +922,21 @@
27.321    shows "indep_vars N (\<lambda>i. Y i \<circ> X i) I"
27.322    unfolding indep_vars_def
27.323  proof
27.324 -  from rv indep_vars M' X I
27.325 +  from rv \<open>indep_vars M' X I\<close>
27.326    show "\<forall>i\<in>I. random_variable (N i) (Y i \<circ> X i)"
27.327      by (auto simp: indep_vars_def)
27.328
27.329    have "indep_sets (\<lambda>i. sigma_sets (space M) {X i - A \<inter> space M |A. A \<in> sets (M' i)}) I"
27.330 -    using indep_vars M' X I by (simp add: indep_vars_def)
27.331 +    using \<open>indep_vars M' X I\<close> by (simp add: indep_vars_def)
27.332    then show "indep_sets (\<lambda>i. sigma_sets (space M) {(Y i \<circ> X i) - A \<inter> space M |A. A \<in> sets (N i)}) I"
27.333    proof (rule indep_sets_mono_sets)
27.334      fix i assume "i \<in> I"
27.335 -    with indep_vars M' X I have X: "X i \<in> space M \<rightarrow> space (M' i)"
27.336 +    with \<open>indep_vars M' X I\<close> have X: "X i \<in> space M \<rightarrow> space (M' i)"
27.337        unfolding indep_vars_def measurable_def by auto
27.338      { fix A assume "A \<in> sets (N i)"
27.339        then have "\<exists>B. (Y i \<circ> X i) - A \<inter> space M = X i - B \<inter> space M \<and> B \<in> sets (M' i)"
27.340          by (intro exI[of _ "Y i - A \<inter> space (M' i)"])
27.341 -           (auto simp: vimage_comp intro!: measurable_sets rv i \<in> I funcset_mem[OF X]) }
27.342 +           (auto simp: vimage_comp intro!: measurable_sets rv \<open>i \<in> I\<close> funcset_mem[OF X]) }
27.343      then show "sigma_sets (space M) {(Y i \<circ> X i) - A \<inter> space M |A. A \<in> sets (N i)} \<subseteq>
27.344        sigma_sets (space M) {X i - A \<inter> space M |A. A \<in> sets (M' i)}"
27.345        by (intro sigma_sets_subseteq) (auto simp: vimage_comp)
27.346 @@ -1078,9 +1078,9 @@
27.347        then have "emeasure ?D E = emeasure M (?X - E \<inter> space M)"
27.348          by (simp add: emeasure_distr X)
27.349        also have "?X - E \<inter> space M = (\<Inter>i\<in>J. X i - Y i \<inter> space M)"
27.350 -        using J I \<noteq> {} measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm)
27.351 +        using J \<open>I \<noteq> {}\<close> measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm)
27.352        also have "emeasure M (\<Inter>i\<in>J. X i - Y i \<inter> space M) = (\<Prod> i\<in>J. emeasure M (X i - Y i \<inter> space M))"
27.353 -        using indep_vars M' X I J I \<noteq> {} using indep_varsD[of M' X I J]
27.354 +        using \<open>indep_vars M' X I\<close> J \<open>I \<noteq> {}\<close> using indep_varsD[of M' X I J]
27.355          by (auto simp: emeasure_eq_measure setprod_ereal)
27.356        also have "\<dots> = (\<Prod> i\<in>J. emeasure (?D' i) (Y i))"
27.357          using rv J by (simp add: emeasure_distr)
27.358 @@ -1109,13 +1109,13 @@
27.359          Y: "\<And>j. j \<in> J \<Longrightarrow> Y' j = X j - Y j \<inter> space M" "\<And>j. j \<in> J \<Longrightarrow> Y j \<in> sets (M' j)" by auto
27.360        let ?E = "prod_emb I M' J (Pi\<^sub>E J Y)"
27.361        from Y have "(\<Inter>j\<in>J. Y' j) = ?X - ?E \<inter> space M"
27.362 -        using J I \<noteq> {} measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm)
27.363 +        using J \<open>I \<noteq> {}\<close> measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm)
27.364        then have "emeasure M (\<Inter>j\<in>J. Y' j) = emeasure M (?X - ?E \<inter> space M)"
27.365          by simp
27.366        also have "\<dots> = emeasure ?D ?E"
27.367          using Y  J by (intro emeasure_distr[symmetric] X sets_PiM_I) auto
27.368        also have "\<dots> = emeasure ?P' ?E"
27.369 -        using ?D = ?P' by simp
27.370 +        using \<open>?D = ?P'\<close> by simp
27.371        also have "\<dots> = (\<Prod> i\<in>J. emeasure (?D' i) (Y i))"
27.372          using P.emeasure_PiM_emb[of J Y] J Y by (simp add: prod_emb_def)
27.373        also have "\<dots> = (\<Prod> i\<in>J. emeasure M (Y' i))"
27.374 @@ -1191,7 +1191,7 @@
27.375      have "emeasure ?J (A \<times> B) = emeasure M ((\<lambda>x. (X x, Y x)) - (A \<times> B) \<inter> space M)"
27.376        using A B by (intro emeasure_distr[OF XY]) auto
27.377      also have "\<dots> = emeasure M (X - A \<inter> space M) * emeasure M (Y - B \<inter> space M)"
27.378 -      using indep_varD[OF indep_var S X T Y, of A B] A B by (simp add: emeasure_eq_measure)
27.379 +      using indep_varD[OF \<open>indep_var S X T Y\<close>, of A B] A B by (simp add: emeasure_eq_measure)
27.380      also have "\<dots> = emeasure ?S A * emeasure ?T B"
27.381        using rvs A B by (simp add: emeasure_distr)
27.382      finally show "emeasure ?S A * emeasure ?T B = emeasure ?J (A \<times> B)" by simp
27.383 @@ -1222,15 +1222,15 @@
27.384      show "indep_set {X - A \<inter> space M |A. A \<in> sets S} {Y - A \<inter> space M |A. A \<in> sets T}"
27.385      proof (safe intro!: indep_setI)
27.386        { fix A assume "A \<in> sets S" then show "X - A \<inter> space M \<in> sets M"
27.387 -        using X \<in> measurable M S by (auto intro: measurable_sets) }
27.388 +        using \<open>X \<in> measurable M S\<close> by (auto intro: measurable_sets) }
27.389        { fix A assume "A \<in> sets T" then show "Y - A \<inter> space M \<in> sets M"
27.390 -        using Y \<in> measurable M T by (auto intro: measurable_sets) }
27.391 +        using \<open>Y \<in> measurable M T\<close> by (auto intro: measurable_sets) }
27.392      next
27.393        fix A B assume ab: "A \<in> sets S" "B \<in> sets T"
27.394        then have "ereal (prob ((X - A \<inter> space M) \<inter> (Y - B \<inter> space M))) = emeasure ?J (A \<times> B)"
27.395          using XY by (auto simp add: emeasure_distr emeasure_eq_measure intro!: arg_cong[where f="prob"])
27.396        also have "\<dots> = emeasure (?S \<Otimes>\<^sub>M ?T) (A \<times> B)"
27.397 -        unfolding ?S \<Otimes>\<^sub>M ?T = ?J ..
27.398 +        unfolding \<open>?S \<Otimes>\<^sub>M ?T = ?J\<close> ..
27.399        also have "\<dots> = emeasure ?S A * emeasure ?T B"
27.400          using ab by (simp add: Y.emeasure_pair_measure_Times)
27.401        finally show "prob ((X - A \<inter> space M) \<inter> (Y - B \<inter> space M)) =
27.402 @@ -1275,9 +1275,9 @@
27.403    also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. max 0 (\<omega> i)) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))"
27.404      by (subst nn_integral_distr) auto
27.405    also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. max 0 (\<omega> i)) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))"
27.406 -    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF I \<noteq> {} rv_Y indep_Y] ..
27.407 +    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y] ..
27.408    also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<^sup>+\<omega>. max 0 \<omega> \<partial>distr M borel (Y i)))"
27.409 -    by (rule product_nn_integral_setprod) (auto intro: finite I)
27.410 +    by (rule product_nn_integral_setprod) (auto intro: \<open>finite I\<close>)
27.411    also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<^sup>+\<omega>. X i \<omega> \<partial>M)"
27.412      by (intro setprod.cong nn_integral_cong)
27.413         (auto simp: nn_integral_distr nn_integral_max_0 Y_def rv_X)
27.414 @@ -1317,17 +1317,17 @@
27.415    also have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))"
27.416      by (subst integral_distr) auto
27.417    also have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))"
27.418 -    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF I \<noteq> {} rv_Y indep_Y] ..
27.419 +    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y] ..
27.420    also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<omega>. \<omega> \<partial>distr M borel (Y i)))"
27.421 -    by (rule product_integral_setprod) (auto intro: finite I simp: integrable_distr_eq int_Y)
27.422 +    by (rule product_integral_setprod) (auto intro: \<open>finite I\<close> simp: integrable_distr_eq int_Y)
27.423    also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)"
27.424      by (intro setprod.cong integral_cong)
27.425         (auto simp: integral_distr Y_def rv_X)
27.426    finally show ?eq .
27.427
27.428    have "integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. (\<Prod>i\<in>I. \<omega> i))"
27.429 -    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF I \<noteq> {} rv_Y indep_Y]
27.430 -    by (intro product_integrable_setprod[OF finite I])
27.431 +    unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y]
27.432 +    by (intro product_integrable_setprod[OF \<open>finite I\<close>])
27.434    then show ?int
27.435      by (simp add: integrable_distr_eq Y_def)

    28.1 --- a/src/HOL/Probability/Infinite_Product_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
28.2 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
28.3 @@ -2,7 +2,7 @@
28.4      Author:     Johannes HÃ¶lzl, TU MÃ¼nchen
28.5  *)
28.6
28.7 -section {*Infinite Product Measure*}
28.8 +section \<open>Infinite Product Measure\<close>
28.9
28.10  theory Infinite_Product_Measure
28.11    imports Probability_Measure Caratheodory Projective_Family
28.12 @@ -98,7 +98,7 @@
28.13    moreover have "((\<lambda>\<omega>. \<omega> i) - A \<inter> space (PiM I M)) = {x\<in>space (PiM I M). x i \<in> A}"
28.14      by auto
28.15    ultimately show "emeasure (M i) A = emeasure (distr (PiM I M) (M i) (\<lambda>\<omega>. \<omega> i)) A"
28.16 -    by (auto simp: i\<in>I emeasure_distr measurable_component_singleton emeasure_PiM_Collect_single)
28.17 +    by (auto simp: \<open>i\<in>I\<close> emeasure_distr measurable_component_singleton emeasure_PiM_Collect_single)
28.18  qed simp
28.19
28.20  lemma (in product_prob_space) PiM_eq:
28.21 @@ -118,7 +118,7 @@
28.22    apply simp_all
28.23    done
28.24
28.25 -subsection {* Sequence space *}
28.26 +subsection \<open>Sequence space\<close>
28.27
28.28  definition comb_seq :: "nat \<Rightarrow> (nat \<Rightarrow> 'a) \<Rightarrow> (nat \<Rightarrow> 'a) \<Rightarrow> (nat \<Rightarrow> 'a)" where
28.29    "comb_seq i \<omega> \<omega>' j = (if j < i then \<omega> j else \<omega>' (j - i))"

    29.1 --- a/src/HOL/Probability/Information.thy	Mon Dec 07 16:48:10 2015 +0000
29.2 +++ b/src/HOL/Probability/Information.thy	Mon Dec 07 20:19:59 2015 +0100
29.3 @@ -3,7 +3,7 @@
29.4      Author:     Armin Heller, TU MÃ¼nchen
29.5  *)
29.6
29.7 -section {*Information theory*}
29.8 +section \<open>Information theory\<close>
29.9
29.10  theory Information
29.11  imports
29.12 @@ -33,7 +33,7 @@
29.13  context information_space
29.14  begin
29.15
29.16 -text {* Introduce some simplification rules for logarithm of base @{term b}. *}
29.17 +text \<open>Introduce some simplification rules for logarithm of base @{term b}.\<close>
29.18
29.19  lemma log_neg_const:
29.20    assumes "x \<le> 0"
29.21 @@ -69,8 +69,8 @@
29.22
29.23  subsection "Kullback$-$Leibler divergence"
29.24
29.25 -text {* The Kullback$-$Leibler divergence is also known as relative entropy or
29.26 -Kullback$-$Leibler distance. *}
29.27 +text \<open>The Kullback$-$Leibler divergence is also known as relative entropy or
29.28 +Kullback$-$Leibler distance.\<close>
29.29
29.30  definition
29.31    "entropy_density b M N = log b \<circ> real_of_ereal \<circ> RN_deriv M N"
29.32 @@ -118,9 +118,9 @@
29.33      KL_divergence b (density M f) (density (density M f) (\<lambda>x. g x / f x))"
29.34      using f g ac by (subst density_density_divide) simp_all
29.35    also have "\<dots> = (\<integral>x. (g x / f x) * log b (g x / f x) \<partial>density M f)"
29.36 -    using f g 1 < b by (intro Mf.KL_density) (auto simp: AE_density)
29.37 +    using f g \<open>1 < b\<close> by (intro Mf.KL_density) (auto simp: AE_density)
29.38    also have "\<dots> = (\<integral>x. g x * log b (g x / f x) \<partial>M)"
29.39 -    using ac f g 1 < b by (subst integral_density) (auto intro!: integral_cong_AE)
29.40 +    using ac f g \<open>1 < b\<close> by (subst integral_density) (auto intro!: integral_cong_AE)
29.41    finally show ?thesis .
29.42  qed
29.43
29.44 @@ -135,7 +135,7 @@
29.45    interpret N: prob_space "density M D" by fact
29.46
29.47    obtain A where "A \<in> sets M" "emeasure (density M D) A \<noteq> emeasure M A"
29.48 -    using measure_eqI[of "density M D" M] density M D \<noteq> M by auto
29.49 +    using measure_eqI[of "density M D" M] \<open>density M D \<noteq> M\<close> by auto
29.50
29.51    let ?D_set = "{x\<in>space M. D x \<noteq> 0}"
29.52    have [simp, intro]: "?D_set \<in> sets M"
29.53 @@ -157,12 +157,12 @@
29.54    have "0 \<le> 1 - measure M ?D_set"
29.55      using prob_le_1 by (auto simp: field_simps)
29.56    also have "\<dots> = (\<integral> x. D x - indicator ?D_set x \<partial>M)"
29.57 -    using integrable M D integral\<^sup>L M D = 1
29.58 +    using \<open>integrable M D\<close> \<open>integral\<^sup>L M D = 1\<close>
29.60    also have "\<dots> < (\<integral> x. D x * (ln b * log b (D x)) \<partial>M)"
29.61    proof (rule integral_less_AE)
29.62      show "integrable M (\<lambda>x. D x - indicator ?D_set x)"
29.63 -      using integrable M D by auto
29.64 +      using \<open>integrable M D\<close> by auto
29.65    next
29.66      from integrable_mult_left(1)[OF int, of "ln b"]
29.67      show "integrable M (\<lambda>x. D x * (ln b * log b (D x)))"
29.68 @@ -183,8 +183,8 @@
29.69        then have "(\<integral>\<^sup>+x. indicator A x\<partial>M) = (\<integral>\<^sup>+x. ereal (D x) * indicator A x\<partial>M)"
29.70          by (intro nn_integral_cong_AE) (auto simp: one_ereal_def[symmetric])
29.71        also have "\<dots> = density M D A"
29.72 -        using A \<in> sets M D by (simp add: emeasure_density)
29.73 -      finally show False using A \<in> sets M emeasure (density M D) A \<noteq> emeasure M A by simp
29.74 +        using \<open>A \<in> sets M\<close> D by (simp add: emeasure_density)
29.75 +      finally show False using \<open>A \<in> sets M\<close> \<open>emeasure (density M D) A \<noteq> emeasure M A\<close> by simp
29.76      qed
29.77      show "{x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<in> sets M"
29.78        using D(1) by (auto intro: sets.sets_Collect_conj)
29.79 @@ -200,11 +200,11 @@
29.80          using Dt by simp
29.81        also note eq
29.82        also have "D t * (ln b * log b (D t)) = - D t * ln (1 / D t)"
29.83 -        using b_gt_1 D t \<noteq> 0 0 \<le> D t
29.84 +        using b_gt_1 \<open>D t \<noteq> 0\<close> \<open>0 \<le> D t\<close>
29.85          by (simp add: log_def ln_div less_le)
29.86        finally have "ln (1 / D t) = 1 / D t - 1"
29.87 -        using D t \<noteq> 0 by (auto simp: field_simps)
29.88 -      from ln_eq_minus_one[OF _ this] D t \<noteq> 0 0 \<le> D t D t \<noteq> 1
29.89 +        using \<open>D t \<noteq> 0\<close> by (auto simp: field_simps)
29.90 +      from ln_eq_minus_one[OF _ this] \<open>D t \<noteq> 0\<close> \<open>0 \<le> D t\<close> \<open>D t \<noteq> 1\<close>
29.91        show False by auto
29.92      qed
29.93
29.94 @@ -215,14 +215,14 @@
29.95        show "D t - indicator ?D_set t \<le> D t * (ln b * log b (D t))"
29.96        proof cases
29.97          assume asm: "D t \<noteq> 0"
29.98 -        then have "0 < D t" using 0 \<le> D t by auto
29.99 +        then have "0 < D t" using \<open>0 \<le> D t\<close> by auto
29.100          then have "0 < 1 / D t" by auto
29.101          have "D t - indicator ?D_set t \<le> - D t * (1 / D t - 1)"
29.102 -          using asm t \<in> space M by (simp add: field_simps)
29.103 +          using asm \<open>t \<in> space M\<close> by (simp add: field_simps)
29.104          also have "- D t * (1 / D t - 1) \<le> - D t * ln (1 / D t)"
29.105 -          using ln_le_minus_one 0 < 1 / D t by (intro mult_left_mono_neg) auto
29.106 +          using ln_le_minus_one \<open>0 < 1 / D t\<close> by (intro mult_left_mono_neg) auto
29.107          also have "\<dots> = D t * (ln b * log b (D t))"
29.108 -          using 0 < D t b_gt_1
29.109 +          using \<open>0 < D t\<close> b_gt_1
29.110            by (simp_all add: log_def ln_div)
29.111          finally show ?thesis by simp
29.112        qed simp
29.113 @@ -289,7 +289,7 @@
29.114         (auto simp: N entropy_density_def)
29.115    with D b_gt_1 have "integrable M (\<lambda>x. D x * log b (D x))"
29.116      by (subst integrable_real_density[symmetric]) (auto simp: N[symmetric] comp_def)
29.117 -  with prob_space N D show ?thesis
29.118 +  with \<open>prob_space N\<close> D show ?thesis
29.119      unfolding N
29.120      by (intro KL_eq_0_iff_eq) auto
29.121  qed
29.122 @@ -323,7 +323,7 @@
29.123      show "AE x in density M f. 0 \<le> g x / f x"
29.124        using f g by (auto simp: AE_density)
29.125      show "integrable (density M f) (\<lambda>x. g x / f x * log b (g x / f x))"
29.126 -      using 1 < b f g ac
29.127 +      using \<open>1 < b\<close> f g ac
29.128        by (subst integrable_density)
29.129           (auto intro!: integrable_cong_AE[THEN iffD2, OF _ _ _ int] measurable_If)
29.130    qed
29.131 @@ -332,7 +332,7 @@
29.132    finally show ?thesis .
29.133  qed
29.134
29.135 -subsection {* Finite Entropy *}
29.136 +subsection \<open>Finite Entropy\<close>
29.137
29.138  definition (in information_space)
29.139    "finite_entropy S X f \<longleftrightarrow> distributed M S X f \<and> integrable S (\<lambda>x. f x * log b (f x))"
29.140 @@ -421,7 +421,7 @@
29.141    using distributed_transform_integrable[of M T Y Py S X Px f "\<lambda>x. log b (Px x)"]
29.142    by auto
29.143
29.144 -subsection {* Mutual Information *}
29.145 +subsection \<open>Mutual Information\<close>
29.146
29.147  definition (in prob_space)
29.148    "mutual_information b S T X Y =
29.149 @@ -459,16 +459,16 @@
29.150      have "AE x in P. 1 = RN_deriv P Q x"
29.151      proof (rule P.RN_deriv_unique)
29.152        show "density P (\<lambda>x. 1) = Q"
29.153 -        unfolding Q = P by (intro measure_eqI) (auto simp: emeasure_density)
29.154 +        unfolding \<open>Q = P\<close> by (intro measure_eqI) (auto simp: emeasure_density)
29.155      qed auto
29.156      then have ae_0: "AE x in P. entropy_density b P Q x = 0"
29.157        by eventually_elim (auto simp: entropy_density_def)
29.158      then have "integrable P (entropy_density b P Q) \<longleftrightarrow> integrable Q (\<lambda>x. 0::real)"
29.159 -      using ed unfolding Q = P by (intro integrable_cong_AE) auto
29.160 +      using ed unfolding \<open>Q = P\<close> by (intro integrable_cong_AE) auto
29.161      then show "integrable Q (entropy_density b P Q)" by simp
29.162
29.163      from ae_0 have "mutual_information b S T X Y = (\<integral>x. 0 \<partial>P)"
29.164 -      unfolding mutual_information_def KL_divergence_def P_def[symmetric] Q_def[symmetric] Q = P
29.165 +      unfolding mutual_information_def KL_divergence_def P_def[symmetric] Q_def[symmetric] \<open>Q = P\<close>
29.166        by (intro integral_cong_AE) auto
29.167      then show "mutual_information b S T X Y = 0"
29.168        by simp }
29.169 @@ -753,7 +753,7 @@
29.170      Pxy (x, y) * log b (Pxy (x, y) / (Px x * Py y))) = 0" by simp
29.171  qed
29.172
29.173 -subsection {* Entropy *}
29.174 +subsection \<open>Entropy\<close>
29.175
29.176  definition (in prob_space) entropy :: "real \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> real" where
29.177    "entropy b S X = - KL_divergence b S (distr M S X)"
29.178 @@ -946,7 +946,7 @@
29.179    finally show ?thesis .
29.180  qed
29.181
29.182 -subsection {* Conditional Mutual Information *}
29.183 +subsection \<open>Conditional Mutual Information\<close>
29.184
29.185  definition (in prob_space)
29.186    "conditional_mutual_information b MX MY MZ X Y Z \<equiv>
29.187 @@ -1173,7 +1173,7 @@
29.188        done
29.189    qed (auto simp: b_gt_1 minus_log_convex)
29.190    also have "\<dots> = conditional_mutual_information b S T P X Y Z"
29.191 -    unfolding ?eq
29.192 +    unfolding \<open>?eq\<close>
29.193      apply (subst integral_real_density)
29.194      apply simp
29.195      apply (auto intro!: distributed_real_AE[OF Pxyz]) []
29.196 @@ -1430,7 +1430,7 @@
29.197        done
29.198    qed (auto simp: b_gt_1 minus_log_convex)
29.199    also have "\<dots> = conditional_mutual_information b S T P X Y Z"
29.200 -    unfolding ?eq
29.201 +    unfolding \<open>?eq\<close>
29.202      apply (subst integral_real_density)
29.203      apply simp
29.204      apply (auto intro!: distributed_real_AE[OF Pxyz]) []
29.205 @@ -1490,7 +1490,7 @@
29.206    have "(\<lambda>(x, y, z). ?i x y z) = (\<lambda>x. if x \<in> (\<lambda>x. (X x, Y x, Z x))  space M then ?j (fst x) (fst (snd x)) (snd (snd x)) else 0)"
29.207      by (auto intro!: ext)
29.208    then show "(\<integral> (x, y, z). ?i x y z \<partial>?P) = (\<Sum>(x, y, z)\<in>(\<lambda>x. (X x, Y x, Z x))  space M. ?j x y z)"
29.209 -    by (auto intro!: setsum.cong simp add: ?P = ?C lebesgue_integral_count_space_finite simple_distributed_finite setsum.If_cases split_beta')
29.210 +    by (auto intro!: setsum.cong simp add: \<open>?P = ?C\<close> lebesgue_integral_count_space_finite simple_distributed_finite setsum.If_cases split_beta')
29.211  qed
29.212
29.213  lemma (in information_space) conditional_mutual_information_nonneg:
29.214 @@ -1514,7 +1514,7 @@
29.215     done
29.216  qed
29.217
29.218 -subsection {* Conditional Entropy *}
29.219 +subsection \<open>Conditional Entropy\<close>
29.220
29.221  definition (in prob_space)
29.222    "conditional_entropy b S T X Y = - (\<integral>(x, y). log b (real_of_ereal (RN_deriv (S \<Otimes>\<^sub>M T) (distr M (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x))) (x, y)) /
29.223 @@ -1614,7 +1614,7 @@
29.224      by (rule conditional_entropy_eq_entropy sigma_finite_measure_count_space_finite
29.225                   simple_functionD  X Y simple_distributed simple_distributedI[OF _ refl]
29.226                   simple_distributed_joint simple_function_Pair integrable_count_space)+
29.227 -       (auto simp: ?P = ?C intro!: integrable_count_space simple_functionD  X Y)
29.228 +       (auto simp: \<open>?P = ?C\<close> intro!: integrable_count_space simple_functionD  X Y)
29.229  qed
29.230
29.231  lemma (in information_space) conditional_entropy_eq:
29.232 @@ -1642,7 +1642,7 @@
29.233      by auto
29.234    from Y show "- (\<integral> (x, y). ?f (x, y) * log b (?f (x, y) / Py y) \<partial>?P) =
29.235      - (\<Sum>(x, y)\<in>(\<lambda>x. (X x, Y x))  space M. Pxy (x, y) * log b (Pxy (x, y) / Py y))"
29.236 -    by (auto intro!: setsum.cong simp add: ?P = ?C lebesgue_integral_count_space_finite simple_distributed_finite eq setsum.If_cases split_beta')
29.237 +    by (auto intro!: setsum.cong simp add: \<open>?P = ?C\<close> lebesgue_integral_count_space_finite simple_distributed_finite eq setsum.If_cases split_beta')
29.238  qed
29.239
29.240  lemma (in information_space) conditional_mutual_information_eq_conditional_entropy:
29.241 @@ -1685,7 +1685,7 @@
29.242    using conditional_mutual_information_eq_conditional_entropy[OF X Y] conditional_mutual_information_nonneg[OF X X Y]
29.243    by simp
29.244
29.245 -subsection {* Equalities *}
29.246 +subsection \<open>Equalities\<close>
29.247
29.248  lemma (in information_space) mutual_information_eq_entropy_conditional_entropy_distr:
29.249    fixes Px :: "'b \<Rightarrow> real" and Py :: "'c \<Rightarrow> real" and Pxy :: "('b \<times> 'c) \<Rightarrow> real"
29.250 @@ -1752,7 +1752,7 @@
29.252      done
29.253    also have "\<dots> = integral\<^sup>L (S \<Otimes>\<^sub>M T) ?g"
29.254 -    using AE x in _. ?f x = ?g x by (intro integral_cong_AE) auto
29.255 +    using \<open>AE x in _. ?f x = ?g x\<close> by (intro integral_cong_AE) auto
29.256    also have "\<dots> = mutual_information b S T X Y"
29.257      by (rule mutual_information_distr[OF S T Px Py Pxy, symmetric])
29.258    finally show ?thesis ..

    30.1 --- a/src/HOL/Probability/Interval_Integral.thy	Mon Dec 07 16:48:10 2015 +0000
30.2 +++ b/src/HOL/Probability/Interval_Integral.thy	Mon Dec 07 20:19:59 2015 +0100
30.3 @@ -23,7 +23,7 @@
30.4      unfolding has_vector_derivative_def has_derivative_iff_norm
30.5      using assms by (intro conj_cong Lim_cong_within refl) auto
30.6    then show ?thesis
30.7 -    using has_vector_derivative_within_subset[OF f s \<subseteq> t] by simp
30.8 +    using has_vector_derivative_within_subset[OF f \<open>s \<subseteq> t\<close>] by simp
30.9  qed
30.10
30.11  definition "einterval a b = {x. a < ereal x \<and> ereal x < b}"
30.12 @@ -65,7 +65,7 @@
30.13      "incseq X" "\<And>i. a < X i" "\<And>i. X i < b" "X ----> b"
30.14  proof (cases b)
30.15    case PInf
30.16 -  with a < b have "a = -\<infinity> \<or> (\<exists>r. a = ereal r)"
30.17 +  with \<open>a < b\<close> have "a = -\<infinity> \<or> (\<exists>r. a = ereal r)"
30.18      by (cases a) auto
30.19    moreover have "(\<lambda>x. ereal (real (Suc x))) ----> \<infinity>"
30.20        apply (subst LIMSEQ_Suc_iff)
30.21 @@ -82,12 +82,12 @@
30.22  next
30.23    case (real b')
30.24    def d \<equiv> "b' - (if a = -\<infinity> then b' - 1 else real_of_ereal a)"
30.25 -  with a < b have a': "0 < d"
30.26 +  with \<open>a < b\<close> have a': "0 < d"
30.27      by (cases a) (auto simp: real)
30.28    moreover
30.29    have "\<And>i r. r < b' \<Longrightarrow> (b' - r) * 1 < (b' - r) * real (Suc (Suc i))"
30.30      by (intro mult_strict_left_mono) auto
30.31 -  with a < b a' have "\<And>i. a < ereal (b' - d / real (Suc (Suc i)))"
30.32 +  with \<open>a < b\<close> a' have "\<And>i. a < ereal (b' - d / real (Suc (Suc i)))"
30.33      by (cases a) (auto simp: real d_def field_simps)
30.34    moreover have "(\<lambda>i. b' - d / Suc (Suc i)) ----> b'"
30.35      apply (subst filterlim_sequentially_Suc)
30.36 @@ -99,7 +99,7 @@
30.37    ultimately show thesis
30.38      by (intro that[of "\<lambda>i. b' - d / Suc (Suc i)"])
30.39         (auto simp add: real incseq_def intro!: divide_left_mono)
30.40 -qed (insert a < b, auto)
30.41 +qed (insert \<open>a < b\<close>, auto)
30.42
30.43  lemma ereal_decseq_approx:
30.44    fixes a b :: ereal
30.45 @@ -107,7 +107,7 @@
30.46    obtains X :: "nat \<Rightarrow> real" where
30.47      "decseq X" "\<And>i. a < X i" "\<And>i. X i < b" "X ----> a"
30.48  proof -
30.49 -  have "-b < -a" using a < b by simp
30.50 +  have "-b < -a" using \<open>a < b\<close> by simp
30.51    from ereal_incseq_approx[OF this] guess X .
30.52    then show thesis
30.53      apply (intro that[of "\<lambda>i. - X i"])
30.54 @@ -125,25 +125,25 @@
30.55      "incseq u" "decseq l" "\<And>i. l i < u i" "\<And>i. a < l i" "\<And>i. u i < b"
30.56      "l ----> a" "u ----> b"
30.57  proof -
30.58 -  from dense[OF a < b] obtain c where "a < c" "c < b" by safe
30.59 -  from ereal_incseq_approx[OF c < b] guess u . note u = this
30.60 -  from ereal_decseq_approx[OF a < c] guess l . note l = this
30.61 -  { fix i from less_trans[OF l i < c c < u i] have "l i < u i" by simp }
30.62 +  from dense[OF \<open>a < b\<close>] obtain c where "a < c" "c < b" by safe
30.63 +  from ereal_incseq_approx[OF \<open>c < b\<close>] guess u . note u = this
30.64 +  from ereal_decseq_approx[OF \<open>a < c\<close>] guess l . note l = this
30.65 +  { fix i from less_trans[OF \<open>l i < c\<close> \<open>c < u i\<close>] have "l i < u i" by simp }
30.66    have "einterval a b = (\<Union>i. {l i .. u i})"
30.67    proof (auto simp: einterval_iff)
30.68      fix x assume "a < ereal x" "ereal x < b"
30.69      have "eventually (\<lambda>i. ereal (l i) < ereal x) sequentially"
30.70 -      using l(4) a < ereal x by (rule order_tendstoD)
30.71 +      using l(4) \<open>a < ereal x\<close> by (rule order_tendstoD)
30.72      moreover
30.73      have "eventually (\<lambda>i. ereal x < ereal (u i)) sequentially"
30.74 -      using u(4) ereal x< b by (rule order_tendstoD)
30.75 +      using u(4) \<open>ereal x< b\<close> by (rule order_tendstoD)
30.76      ultimately have "eventually (\<lambda>i. l i < x \<and> x < u i) sequentially"
30.77        by eventually_elim auto
30.78      then show "\<exists>i. l i \<le> x \<and> x \<le> u i"
30.79        by (auto intro: less_imp_le simp: eventually_sequentially)
30.80    next
30.81      fix x i assume "l i \<le> x" "x \<le> u i"
30.82 -    with a < ereal (l i) ereal (u i) < b
30.83 +    with \<open>a < ereal (l i)\<close> \<open>ereal (u i) < b\<close>
30.84      show "a < ereal x" "ereal x < b"
30.85        by (auto simp del: ereal_less_eq(3) simp add: ereal_less_eq(3)[symmetric])
30.86    qed
30.87 @@ -553,15 +553,15 @@
30.88      proof (intro AE_I2 tendsto_intros Lim_eventually)
30.89        fix x
30.90        { fix i assume "l i \<le> x" "x \<le> u i"
30.91 -        with incseq u[THEN incseqD, of i] decseq l[THEN decseqD, of i]
30.92 +        with \<open>incseq u\<close>[THEN incseqD, of i] \<open>decseq l\<close>[THEN decseqD, of i]
30.93          have "eventually (\<lambda>i. l i \<le> x \<and> x \<le> u i) sequentially"
30.94            by (auto simp: eventually_sequentially decseq_def incseq_def intro: order_trans) }
30.95        then show "eventually (\<lambda>xa. indicator {l xa..u xa} x = (indicator (einterval a b) x::real)) sequentially"
30.96 -        using approx order_tendstoD(2)[OF l ----> a, of x] order_tendstoD(1)[OF u ----> b, of x]
30.97 +        using approx order_tendstoD(2)[OF \<open>l ----> a\<close>, of x] order_tendstoD(1)[OF \<open>u ----> b\<close>, of x]
30.98          by (auto split: split_indicator)
30.99      qed
30.100    qed
30.101 -  with a < b \<And>i. l i < u i show ?thesis
30.102 +  with \<open>a < b\<close> \<open>\<And>i. l i < u i\<close> show ?thesis
30.103      by (simp add: interval_lebesgue_integral_le_eq[symmetric] interval_integral_Icc less_imp_le)
30.104  qed
30.105
30.106 @@ -615,7 +615,7 @@
30.107      "set_integrable lborel (einterval a b) f"
30.108      "(LBINT x=a..b. f x) = B - A"
30.109  proof -
30.110 -  from einterval_Icc_approximation[OF a < b] guess u l . note approx = this
30.111 +  from einterval_Icc_approximation[OF \<open>a < b\<close>] guess u l . note approx = this
30.112    have [simp]: "\<And>x i. l i \<le> x \<Longrightarrow> a < ereal x"
30.113      by (rule order_less_le_trans, rule approx, force)
30.114    have [simp]: "\<And>x i. x \<le> u i \<Longrightarrow> ereal x < b"
30.115 @@ -629,7 +629,7 @@
30.116    have 1: "\<And>i. set_integrable lborel {l i..u i} f"
30.117    proof -
30.118      fix i show "set_integrable lborel {l i .. u i} f"
30.119 -      using a < l i u i < b
30.120 +      using \<open>a < l i\<close> \<open>u i < b\<close>
30.121        by (intro borel_integrable_compact f continuous_at_imp_continuous_on compact_Icc ballI)
30.122           (auto simp del: ereal_less_eq simp add: ereal_less_eq(3)[symmetric])
30.123    qed
30.124 @@ -645,9 +645,9 @@
30.125      using A approx unfolding tendsto_at_iff_sequentially comp_def
30.126      by (elim allE[of _ "\<lambda>i. ereal (l i)"], auto)
30.127    show "(LBINT x=a..b. f x) = B - A"
30.128 -    by (rule interval_integral_Icc_approx_nonneg [OF a < b approx 1 f_nonneg 2 3])
30.129 +    by (rule interval_integral_Icc_approx_nonneg [OF \<open>a < b\<close> approx 1 f_nonneg 2 3])
30.130    show "set_integrable lborel (einterval a b) f"
30.131 -    by (rule interval_integral_Icc_approx_nonneg [OF a < b approx 1 f_nonneg 2 3])
30.132 +    by (rule interval_integral_Icc_approx_nonneg [OF \<open>a < b\<close> approx 1 f_nonneg 2 3])
30.133  qed
30.134
30.135  lemma interval_integral_FTC_integrable:
30.136 @@ -660,7 +660,7 @@
30.137    assumes B: "((F \<circ> real_of_ereal) ---> B) (at_left b)"
30.138    shows "(LBINT x=a..b. f x) = B - A"
30.139  proof -
30.140 -  from einterval_Icc_approximation[OF a < b] guess u l . note approx = this
30.141 +  from einterval_Icc_approximation[OF \<open>a < b\<close>] guess u l . note approx = this
30.142    have [simp]: "\<And>x i. l i \<le> x \<Longrightarrow> a < ereal x"
30.143      by (rule order_less_le_trans, rule approx, force)
30.144    have [simp]: "\<And>x i. x \<le> u i \<Longrightarrow> ereal x < b"
30.145 @@ -678,7 +678,7 @@
30.146      using A approx unfolding tendsto_at_iff_sequentially comp_def
30.147      by (elim allE[of _ "\<lambda>i. ereal (l i)"], auto)
30.148    moreover have "(\<lambda>i. LBINT x=l i..u i. f x) ----> (LBINT x=a..b. f x)"
30.149 -    by (rule interval_integral_Icc_approx_integrable [OF a < b approx f_integrable])
30.150 +    by (rule interval_integral_Icc_approx_integrable [OF \<open>a < b\<close> approx f_integrable])
30.151    ultimately show ?thesis
30.152      by (elim LIMSEQ_unique)
30.153  qed
30.154 @@ -701,7 +701,7 @@
30.155      by (rule borel_integrable_atLeastAtMost', rule contf)
30.156    have "((\<lambda>u. integral {a..u} f) has_vector_derivative f x) (at x within {a..b})"
30.157      apply (intro integral_has_vector_derivative)
30.158 -    using a \<le> x x \<le> b by (intro continuous_on_subset [OF contf], auto)
30.159 +    using \<open>a \<le> x\<close> \<open>x \<le> b\<close> by (intro continuous_on_subset [OF contf], auto)
30.160    then have "((\<lambda>u. integral {a..u} f) has_vector_derivative (f x)) (at x within {a..b})"
30.161      by simp
30.162    then have "(?F has_vector_derivative (f x)) (at x within {a..b})"
30.163 @@ -725,7 +725,7 @@
30.164    assumes "a < b" and contf: "\<And>x :: real. a < x \<Longrightarrow> x < b \<Longrightarrow> isCont f x"
30.165    shows "\<exists>F. \<forall>x :: real. a < x \<longrightarrow> x < b \<longrightarrow> (F has_vector_derivative f x) (at x)"
30.166  proof -
30.167 -  from einterval_nonempty [OF a < b] obtain c :: real where [simp]: "a < c" "c < b"
30.168 +  from einterval_nonempty [OF \<open>a < b\<close>] obtain c :: real where [simp]: "a < c" "c < b"
30.169      by (auto simp add: einterval_def)
30.170    let ?F = "(\<lambda>u. LBINT y=c..u. f y)"
30.171    show ?thesis
30.172 @@ -747,9 +747,9 @@
30.173        apply (rule interval_integral_FTC2, auto simp add: less_imp_le)
30.174        apply (rule continuous_at_imp_continuous_on)
30.175        apply (auto intro!: contf)
30.176 -      apply (rule order_less_le_trans, rule a < d, auto)
30.177 +      apply (rule order_less_le_trans, rule \<open>a < d\<close>, auto)
30.178        apply (rule order_le_less_trans) prefer 2
30.179 -      by (rule e < b, auto)
30.180 +      by (rule \<open>e < b\<close>, auto)
30.181    qed
30.182  qed
30.183
30.184 @@ -778,13 +778,13 @@
30.185      apply (auto simp add: min_def max_def less_imp_le)
30.186      apply (frule (1) IVT' [of g], auto simp add: assms)
30.187      by (frule (1) IVT2' [of g], auto simp add: assms)
30.188 -  from contg a \<le> b have "\<exists>c d. g  {a..b} = {c..d} \<and> c \<le> d"
30.189 +  from contg \<open>a \<le> b\<close> have "\<exists>c d. g  {a..b} = {c..d} \<and> c \<le> d"
30.190      by (elim continuous_image_closed_interval)
30.191    then obtain c d where g_im: "g  {a..b} = {c..d}" and "c \<le> d" by auto
30.192    have "\<exists>F. \<forall>x\<in>{a..b}. (F has_vector_derivative (f (g x))) (at (g x) within (g  {a..b}))"
30.193      apply (rule exI, auto, subst g_im)
30.194      apply (rule interval_integral_FTC2 [of c c d])
30.195 -    using c \<le> d apply auto
30.196 +    using \<open>c \<le> d\<close> apply auto
30.197      apply (rule continuous_on_subset [OF contf])
30.198      using g_im by auto
30.199    then guess F ..
30.200 @@ -798,7 +798,7 @@
30.201      by (blast intro: continuous_on_compose2 contf contg)
30.202    have "LBINT x=a..b. g' x *\<^sub>R f (g x) = F (g b) - F (g a)"
30.203      apply (subst interval_integral_Icc, simp add: assms)
30.204 -    apply (rule integral_FTC_atLeastAtMost[of a b "\<lambda>x. F (g x)", OF a \<le> b])
30.205 +    apply (rule integral_FTC_atLeastAtMost[of a b "\<lambda>x. F (g x)", OF \<open>a \<le> b\<close>])
30.206      apply (rule vector_diff_chain_within[OF v_derivg derivF, unfolded comp_def])
30.207      apply (auto intro!: continuous_on_scaleR contg' contfg)
30.208      done
30.209 @@ -827,7 +827,7 @@
30.210    and integrable2: "set_integrable lborel (einterval A B) (\<lambda>x. f x)"
30.211    shows "(LBINT x=A..B. f x) = (LBINT x=a..b. g' x *\<^sub>R f (g x))"
30.212  proof -
30.213 -  from einterval_Icc_approximation[OF a < b] guess u l . note approx [simp] = this
30.214 +  from einterval_Icc_approximation[OF \<open>a < b\<close>] guess u l . note approx [simp] = this
30.215    note less_imp_le [simp]
30.216    have [simp]: "\<And>x i. l i \<le> x \<Longrightarrow> a < ereal x"
30.217      by (rule order_less_le_trans, rule approx, force)
30.218 @@ -891,7 +891,7 @@
30.219          done
30.220    } note eq1 = this
30.221    have "(\<lambda>i. LBINT x=l i..u i. g' x *\<^sub>R f (g x)) ----> (LBINT x=a..b. g' x *\<^sub>R f (g x))"
30.222 -    apply (rule interval_integral_Icc_approx_integrable [OF a < b approx])
30.223 +    apply (rule interval_integral_Icc_approx_integrable [OF \<open>a < b\<close> approx])
30.224      by (rule assms)
30.225    hence 2: "(\<lambda>i. (LBINT y=g (l i)..g (u i). f y)) ----> (LBINT x=a..b. g' x *\<^sub>R f (g x))"
30.227 @@ -902,7 +902,7 @@
30.228      by (erule order_less_le_trans, rule g_nondec, auto)
30.229    have "(\<lambda>i. (LBINT y=g (l i)..g (u i). f y)) ----> (LBINT x = A..B. f x)"
30.230      apply (subst interval_lebesgue_integral_le_eq, auto simp del: real_scaleR_def)
30.231 -    apply (subst interval_lebesgue_integral_le_eq, rule A \<le> B)
30.232 +    apply (subst interval_lebesgue_integral_le_eq, rule \<open>A \<le> B\<close>)
30.233      apply (subst un, rule set_integral_cont_up, auto simp del: real_scaleR_def)
30.234      apply (rule incseq)
30.235      apply (subst un [symmetric])
30.236 @@ -929,7 +929,7 @@
30.237      "set_integrable lborel (einterval A B) f"
30.238      "(LBINT x=A..B. f x) = (LBINT x=a..b. (f (g x) * g' x))"
30.239  proof -
30.240 -  from einterval_Icc_approximation[OF a < b] guess u l . note approx [simp] = this
30.241 +  from einterval_Icc_approximation[OF \<open>a < b\<close>] guess u l . note approx [simp] = this
30.242    note less_imp_le [simp]
30.243    have [simp]: "\<And>x i. l i \<le> x \<Longrightarrow> a < ereal x"
30.244      by (rule order_less_le_trans, rule approx, force)
30.245 @@ -994,7 +994,7 @@
30.246    } note eq1 = this
30.247    have "(\<lambda>i. LBINT x=l i..u i. f (g x) * g' x)
30.248        ----> (LBINT x=a..b. f (g x) * g' x)"
30.249 -    apply (rule interval_integral_Icc_approx_integrable [OF a < b approx])
30.250 +    apply (rule interval_integral_Icc_approx_integrable [OF \<open>a < b\<close> approx])
30.251      by (rule assms)
30.252    hence 2: "(\<lambda>i. (LBINT y=g (l i)..g (u i). f y)) ----> (LBINT x=a..b. f (g x) * g' x)"

    31.1 --- a/src/HOL/Probability/Lebesgue_Integral_Substitution.thy	Mon Dec 07 16:48:10 2015 +0000
31.2 +++ b/src/HOL/Probability/Lebesgue_Integral_Substitution.thy	Mon Dec 07 20:19:59 2015 +0100
31.3 @@ -6,7 +6,7 @@
31.4      This could probably be weakened somehow.
31.5  *)
31.6
31.7 -section {* Integration by Substition *}
31.8 +section \<open>Integration by Substition\<close>
31.9
31.10  theory Lebesgue_Integral_Substitution
31.11  imports Interval_Integral
31.12 @@ -36,7 +36,7 @@
31.13    also from assms(1) have "closed (g - {a..} \<inter> {c..d})"
31.14      by (auto simp: continuous_on_closed_vimage)
31.15    hence "closure (g - {a..} \<inter> {c..d}) = g - {a..} \<inter> {c..d}" by simp
31.16 -  finally show ?thesis using x \<in> {c..d} by auto
31.17 +  finally show ?thesis using \<open>x \<in> {c..d}\<close> by auto
31.18  qed
31.19
31.20  lemma interior_real_semiline':
31.21 @@ -103,7 +103,7 @@
31.22      using assms by (subst borel_measurable_restrict_space_iff) auto
31.23    then have "f - B \<inter> space (restrict_space M X) \<in> sets (restrict_space M X)"
31.24      by (rule measurable_sets) fact
31.25 -  with X \<in> sets M show ?thesis
31.26 +  with \<open>X \<in> sets M\<close> show ?thesis
31.27      by (subst (asm) sets_restrict_space_iff) (auto simp: space_restrict_space)
31.28  qed
31.29
31.30 @@ -171,8 +171,8 @@
31.31    shows "strict_mono g"
31.32  proof
31.33    fix x y :: 'b assume "x < y"
31.34 -  from surj f obtain x' y' where [simp]: "x = f x'" "y = f y'" by blast
31.35 -  with x < y and strict_mono f have "x' < y'" by (simp add: strict_mono_less)
31.36 +  from \<open>surj f\<close> obtain x' y' where [simp]: "x = f x'" "y = f y'" by blast
31.37 +  with \<open>x < y\<close> and \<open>strict_mono f\<close> have "x' < y'" by (simp add: strict_mono_less)
31.38    with inv show "g x < g y" by simp
31.39  qed
31.40
31.41 @@ -218,11 +218,11 @@
31.42      also have "(op + (-x)  interior A) = ?A'" by auto
31.43      finally show "open ?A'" .
31.44    next
31.45 -    from x \<in> interior A show "0 \<in> ?A'" by auto
31.46 +    from \<open>x \<in> interior A\<close> show "0 \<in> ?A'" by auto
31.47    next
31.48      fix h assume "h \<in> ?A'"
31.49      hence "x + h \<in> interior A" by auto
31.50 -    with mono' and x \<in> interior A show "(f (x + h) - f x) / h \<ge> 0"
31.51 +    with mono' and \<open>x \<in> interior A\<close> show "(f (x + h) - f x) / h \<ge> 0"
31.52        by (cases h rule: linorder_cases[of _ 0])
31.53           (simp_all add: divide_nonpos_neg divide_nonneg_pos mono_onD field_simps)
31.54    qed
31.55 @@ -267,7 +267,7 @@
31.56  proof (cases "a < b")
31.57    assume "a < b"
31.58    from deriv have "\<forall>x. x \<ge> a \<and> x \<le> b \<longrightarrow> (g has_real_derivative g' x) (at x)" by simp
31.59 -  from MVT2[OF a < b this] and deriv
31.60 +  from MVT2[OF \<open>a < b\<close> this] and deriv
31.61      obtain \<xi> where \<xi>_ab: "\<xi> > a" "\<xi> < b" and g_ab: "g b - g a = (b - a) * g' \<xi>" by blast
31.62    from \<xi>_ab ab nonneg have "(b - a) * g' \<xi> \<ge> 0" by simp
31.63    with g_ab show ?thesis by simp
31.64 @@ -279,9 +279,9 @@
31.65    obtains c' d' where "{a..b} \<inter> g - {c..d} = {c'..d'}" "c' \<le> d'" "g c' = c" "g d' = d"
31.66  proof-
31.67      let ?A = "{a..b} \<inter> g - {c..d}"
31.68 -    from IVT'[of g a c b, OF _ _ a \<le> b assms(1)] assms(4,5)
31.69 +    from IVT'[of g a c b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5)
31.70           obtain c'' where c'': "c'' \<in> ?A" "g c'' = c" by auto
31.71 -    from IVT'[of g a d b, OF _ _ a \<le> b assms(1)] assms(4,5)
31.72 +    from IVT'[of g a d b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5)
31.73           obtain d'' where d'': "d'' \<in> ?A" "g d'' = d" by auto
31.74      hence [simp]: "?A \<noteq> {}" by blast
31.75
31.76 @@ -319,7 +319,7 @@
31.77    shows "(\<integral>\<^sup>+x. f x * indicator {g a..g b} x \<partial>lborel) =
31.78               (\<integral>\<^sup>+x. f (g x) * g' x * indicator {a..b} x \<partial>lborel)"
31.79  proof-
31.80 -  from a < b have [simp]: "a \<le> b" by simp
31.81 +  from \<open>a < b\<close> have [simp]: "a \<le> b" by simp
31.82    from derivg have contg: "continuous_on {a..b} g" by (rule has_real_derivative_imp_continuous_on)
31.83    from this and contg' have Mg: "set_borel_measurable borel {a..b} g" and
31.84                               Mg': "set_borel_measurable borel {a..b} g'"
31.85 @@ -364,7 +364,7 @@
31.86              by (simp only: u'v' max_absorb2 min_absorb1)
31.87                 (intro continuous_on_subset[OF contg'], insert u'v', auto)
31.88          have "\<And>x. x \<in> {u'..v'} \<Longrightarrow> (g has_real_derivative g' x) (at x within {u'..v'})"
31.89 -           using asm by (intro has_field_derivative_subset[OF derivg] set_mp[OF {u'..v'} \<subseteq> {a..b}]) auto
31.90 +           using asm by (intro has_field_derivative_subset[OF derivg] set_mp[OF \<open>{u'..v'} \<subseteq> {a..b}\<close>]) auto
31.91          hence B: "\<And>x. min u' v' \<le> x \<Longrightarrow> x \<le> max u' v' \<Longrightarrow>
31.92                        (g has_vector_derivative g' x) (at x within {min u' v'..max u' v'})"
31.93              by (simp only: u'v' max_absorb2 min_absorb1)
31.94 @@ -377,7 +377,7 @@
31.95               (auto intro: measurable_sets Mg simp: derivg_nonneg mult.commute split: split_indicator)
31.96          also from interval_integral_FTC_finite[OF A B]
31.97              have "LBINT x:{a..b} \<inter> g-{u..v}. g' x = v - u"
31.98 -                by (simp add: u'v' interval_integral_Icc u \<le> v)
31.99 +                by (simp add: u'v' interval_integral_Icc \<open>u \<le> v\<close>)
31.100          finally have "(\<integral>\<^sup>+ x. ereal (g' x) * indicator ({a..b} \<inter> g - {u..v}) x \<partial>lborel) =
31.101                             ereal (v - u)" .
31.102        } note A = this
31.103 @@ -386,11 +386,11 @@
31.104                 (\<integral>\<^sup>+ x. ereal (g' x) * indicator ({a..b} \<inter> g - {c..d}) x \<partial>lborel)"
31.105          by (intro nn_integral_cong) (simp split: split_indicator)
31.106        also have "{a..b} \<inter> g-{c..d} = {a..b} \<inter> g-{max (g a) c..min (g b) d}"
31.107 -        using a \<le> b c \<le> d
31.108 +        using \<open>a \<le> b\<close> \<open>c \<le> d\<close>
31.109          by (auto intro!: monog intro: order.trans)
31.110        also have "(\<integral>\<^sup>+ x. ereal (g' x) * indicator ... x \<partial>lborel) =
31.111          (if max (g a) c \<le> min (g b) d then min (g b) d - max (g a) c else 0)"
31.112 -         using c \<le> d by (simp add: A)
31.113 +         using \<open>c \<le> d\<close> by (simp add: A)
31.114        also have "... = (\<integral>\<^sup>+ x. indicator ({g a..g b} \<inter> {c..d}) x \<partial>lborel)"
31.115          by (subst nn_integral_indicator) (auto intro!: measurable_sets Mg simp:)
31.116        also have "... = (\<integral>\<^sup>+ x. indicator {c..d} x * indicator {g a..g b} x \<partial>lborel)"
31.117 @@ -400,7 +400,7 @@
31.118        next
31.119
31.120        case (compl A)
31.121 -      note A \<in> sets borel[measurable]
31.122 +      note \<open>A \<in> sets borel\<close>[measurable]
31.123        from emeasure_mono[of "A \<inter> {g a..g b}" "{g a..g b}" lborel]
31.124            have [simp]: "emeasure lborel (A \<inter> {g a..g b}) \<noteq> \<infinity>" by auto
31.125        have [simp]: "g - A \<inter> {a..b} \<in> sets borel"
31.126 @@ -415,10 +415,10 @@
31.127          by (simp add: vimage_Compl diff_eq Int_commute[of "-A"])
31.128        also have "{g a..g b} - A = {g a..g b} - A \<inter> {g a..g b}" by blast
31.129        also have "emeasure lborel ... = g b - g a - emeasure lborel (A \<inter> {g a..g b})"
31.130 -             using A \<in> sets borel by (subst emeasure_Diff) (auto simp: real_of_ereal_minus)
31.131 +             using \<open>A \<in> sets borel\<close> by (subst emeasure_Diff) (auto simp: real_of_ereal_minus)
31.132       also have "emeasure lborel (A \<inter> {g a..g b}) =
31.133                      \<integral>\<^sup>+x. indicator A x * indicator {g a..g b} x \<partial>lborel"
31.134 -       using A \<in> sets borel
31.135 +       using \<open>A \<in> sets borel\<close>
31.136         by (subst nn_integral_indicator[symmetric], simp, intro nn_integral_cong)
31.137            (simp split: split_indicator)
31.138        also have "... = \<integral>\<^sup>+ x. indicator (g-A \<inter> {a..b}) x * ereal (g' x * indicator {a..b} x) \<partial>lborel" (is "_ = ?I")
31.139 @@ -500,7 +500,7 @@
31.140
31.141  next
31.142    case (mult f c)
31.143 -    note Mf[measurable] = f \<in> borel_measurable borel
31.144 +    note Mf[measurable] = \<open>f \<in> borel_measurable borel\<close>
31.145      let ?I = "indicator {a..b}"
31.146      have "(\<lambda>x. f (g x * ?I x) * ereal (g' x * ?I x)) \<in> borel_measurable borel" using Mg Mg'
31.147        by (intro borel_measurable_ereal_times measurable_compose[OF _ Mf])
31.148 @@ -522,7 +522,7 @@
31.149        also have "(\<lambda>x. f (g x * ?I x) * ereal (g' x * ?I x)) = (\<lambda>x. f (g x) * ereal (g' x) * ?I x)"
31.150          by (intro ext) (simp split: split_indicator)
31.151        finally have "(\<lambda>x. f (g x) * ereal (g' x) * ?I x) \<in> borel_measurable borel" .
31.152 -    } note Mf' = this[OF f1 \<in> borel_measurable borel] this[OF f2 \<in> borel_measurable borel]
31.153 +    } note Mf' = this[OF \<open>f1 \<in> borel_measurable borel\<close>] this[OF \<open>f2 \<in> borel_measurable borel\<close>]
31.154      from add have not_neginf: "\<And>x. f1 x \<noteq> -\<infinity>" "\<And>x. f2 x \<noteq> -\<infinity>"
31.155        by (metis Infty_neq_0(1) ereal_0_le_uminus_iff ereal_infty_less_eq(1))+
31.156
31.157 @@ -583,7 +583,7 @@
31.158               (\<integral>\<^sup>+x. f (g x) * g' x * indicator {a..b} x \<partial>lborel)"
31.159  proof (cases "a = b")
31.160    assume "a \<noteq> b"
31.161 -  with a \<le> b have "a < b" by auto
31.162 +  with \<open>a \<le> b\<close> have "a < b" by auto
31.163    let ?f' = "\<lambda>x. max 0 (f x * indicator {g a..g b} x)"
31.164
31.165    from derivg derivg_nonneg have monog: "\<And>x y. a \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> b \<Longrightarrow> g x \<le> g y"
31.166 @@ -602,7 +602,7 @@
31.167      by (subst nn_integral_max_0[symmetric], intro nn_integral_cong)
31.168         (auto split: split_indicator simp: zero_ereal_def)
31.169    also have "... = \<integral>\<^sup>+ x. ?f' (g x) * ereal (g' x) * indicator {a..b} x \<partial>lborel" using Mf
31.170 -    by (subst nn_integral_substitution_aux[OF _ _ derivg contg' derivg_nonneg a < b])
31.171 +    by (subst nn_integral_substitution_aux[OF _ _ derivg contg' derivg_nonneg \<open>a < b\<close>])
31.172         (auto simp add: zero_ereal_def mult.commute)
31.173    also have "... = \<integral>\<^sup>+ x. max 0 (f (g x)) * ereal (g' x) * indicator {a..b} x \<partial>lborel"
31.174      by (intro nn_integral_cong)
31.175 @@ -653,14 +653,14 @@
31.176      by (intro nn_integral_cong) (simp split: split_indicator)
31.177    also with M1 have A: "(\<integral>\<^sup>+ x. ereal (f x * indicator {g a..g b} x) \<partial>lborel) =
31.178                              (\<integral>\<^sup>+ x. ereal (f (g x) * g' x * indicator {a..b} x) \<partial>lborel)"
31.179 -    by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg a \<le> b])
31.180 +    by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
31.181         (auto simp: nn_integral_set_ereal mult.commute)
31.182    also have "(\<integral>\<^sup>+ x. ereal (- (f x)) * indicator {g a..g b} x \<partial>lborel) =
31.183                 (\<integral>\<^sup>+ x. ereal (- (f x) * indicator {g a..g b} x) \<partial>lborel)"
31.184      by (intro nn_integral_cong) (simp split: split_indicator)
31.185    also with M2 have B: "(\<integral>\<^sup>+ x. ereal (- (f x) * indicator {g a..g b} x) \<partial>lborel) =
31.186                              (\<integral>\<^sup>+ x. ereal (- (f (g x)) * g' x * indicator {a..b} x) \<partial>lborel)"
31.187 -    by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg a \<le> b])
31.188 +    by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
31.189         (auto simp: nn_integral_set_ereal mult.commute)
31.190
31.191    also {

    32.1 --- a/src/HOL/Probability/Lebesgue_Measure.thy	Mon Dec 07 16:48:10 2015 +0000
32.2 +++ b/src/HOL/Probability/Lebesgue_Measure.thy	Mon Dec 07 20:19:59 2015 +0100
32.3 @@ -5,13 +5,13 @@
32.4      Author:     Luke Serafin
32.5  *)
32.6
32.7 -section {* Lebesgue measure *}
32.8 +section \<open>Lebesgue measure\<close>
32.9
32.10  theory Lebesgue_Measure
32.11    imports Finite_Product_Measure Bochner_Integration Caratheodory
32.12  begin
32.13
32.14 -subsection {* Every right continuous and nondecreasing function gives rise to a measure *}
32.15 +subsection \<open>Every right continuous and nondecreasing function gives rise to a measure\<close>
32.16
32.17  definition interval_measure :: "(real \<Rightarrow> real) \<Rightarrow> real measure" where
32.18    "interval_measure F = extend_measure UNIV {(a, b). a \<le> b} (\<lambda>(a, b). {a <.. b}) (\<lambda>(a, b). ereal (F b - F a))"
32.19 @@ -21,7 +21,7 @@
32.20    assumes mono_F: "\<And>x y. x \<le> y \<Longrightarrow> F x \<le> F y"
32.21    assumes right_cont_F : "\<And>a. continuous (at_right a) F"
32.22    shows "emeasure (interval_measure F) {a <.. b} = F b - F a"
32.23 -proof (rule extend_measure_caratheodory_pair[OF interval_measure_def a \<le> b])
32.24 +proof (rule extend_measure_caratheodory_pair[OF interval_measure_def \<open>a \<le> b\<close>])
32.25    show "semiring_of_sets UNIV {{a<..b} |a b :: real. a \<le> b}"
32.26    proof (unfold_locales, safe)
32.27      fix a b c d :: real assume *: "a \<le> b" "c \<le> d"
32.28 @@ -50,7 +50,7 @@
32.29      by (auto intro!: l_r mono_F)
32.30
32.31    { fix S :: "nat set" assume "finite S"
32.32 -    moreover note a \<le> b
32.33 +    moreover note \<open>a \<le> b\<close>
32.34      moreover have "\<And>i. i \<in> S \<Longrightarrow> {l i <.. r i} \<subseteq> {a <.. b}"
32.35        unfolding lr_eq_ab[symmetric] by auto
32.36      ultimately have "(\<Sum>i\<in>S. F (r i) - F (l i)) \<le> F b - F a"
32.37 @@ -59,7 +59,7 @@
32.38        show ?case
32.39        proof cases
32.40          assume "\<exists>i\<in>S. l i < r i"
32.41 -        with finite S have "Min (l  {i\<in>S. l i < r i}) \<in> l  {i\<in>S. l i < r i}"
32.42 +        with \<open>finite S\<close> have "Min (l  {i\<in>S. l i < r i}) \<in> l  {i\<in>S. l i < r i}"
32.43            by (intro Min_in) auto
32.44          then obtain m where m: "m \<in> S" "l m < r m" "l m = Min (l  {i\<in>S. l i < r i})"
32.45            by fastforce
32.46 @@ -69,14 +69,14 @@
32.47          also have "(\<Sum>i\<in>S - {m}. F (r i) - F (l i)) \<le> F b - F (r m)"
32.48          proof (intro psubset.IH)
32.49            show "S - {m} \<subset> S"
32.50 -            using m\<in>S by auto
32.51 +            using \<open>m\<in>S\<close> by auto
32.52            show "r m \<le> b"
32.53 -            using psubset.prems(2)[OF m\<in>S] l m < r m by auto
32.54 +            using psubset.prems(2)[OF \<open>m\<in>S\<close>] \<open>l m < r m\<close> by auto
32.55          next
32.56            fix i assume "i \<in> S - {m}"
32.57            then have i: "i \<in> S" "i \<noteq> m" by auto
32.58            { assume i': "l i < r i" "l i < r m"
32.59 -            moreover with finite S i m have "l m \<le> l i"
32.60 +            moreover with \<open>finite S\<close> i m have "l m \<le> l i"
32.61                by auto
32.62              ultimately have "{l i <.. r i} \<inter> {l m <.. r m} \<noteq> {}"
32.63                by auto
32.64 @@ -85,14 +85,14 @@
32.65            then have "l i \<noteq> r i \<Longrightarrow> r m \<le> l i"
32.66              unfolding not_less[symmetric] using l_r[of i] by auto
32.67            then show "{l i <.. r i} \<subseteq> {r m <.. b}"
32.68 -            using psubset.prems(2)[OF i\<in>S] by auto
32.69 +            using psubset.prems(2)[OF \<open>i\<in>S\<close>] by auto
32.70          qed
32.71          also have "F (r m) - F (l m) \<le> F (r m) - F a"
32.72 -          using psubset.prems(2)[OF m \<in> S] l m < r m
32.73 +          using psubset.prems(2)[OF \<open>m \<in> S\<close>] \<open>l m < r m\<close>
32.74            by (auto simp add: Ioc_subset_iff intro!: mono_F)
32.75          finally show ?case
32.77 -      qed (auto simp add: a \<le> b less_le)
32.78 +      qed (auto simp add: \<open>a \<le> b\<close> less_le)
32.79      qed }
32.80    note claim1 = this
32.81
32.82 @@ -117,13 +117,13 @@
32.83          show ?case
32.84          proof cases
32.85            assume "?R"
32.86 -          with j \<in> S psubset.prems have "{u..v} \<subseteq> (\<Union>i\<in>S-{j}. {l i<..< r i})"
32.87 +          with \<open>j \<in> S\<close> psubset.prems have "{u..v} \<subseteq> (\<Union>i\<in>S-{j}. {l i<..< r i})"
32.88              apply (auto simp: subset_eq Ball_def)
32.89              apply (metis Diff_iff less_le_trans leD linear singletonD)
32.90              apply (metis Diff_iff less_le_trans leD linear singletonD)
32.91              apply (metis order_trans less_le_not_le linear)
32.92              done
32.93 -          with j \<in> S have "F v - F u \<le> (\<Sum>i\<in>S - {j}. F (r i) - F (l i))"
32.94 +          with \<open>j \<in> S\<close> have "F v - F u \<le> (\<Sum>i\<in>S - {j}. F (r i) - F (l i))"
32.95              by (intro psubset) auto
32.96            also have "\<dots> \<le> (\<Sum>i\<in>S. F (r i) - F (l i))"
32.97              using psubset.prems
32.98 @@ -137,7 +137,7 @@
32.99            let ?S2 = "{i \<in> S. r i > r j}"
32.100
32.101            have "(\<Sum>i\<in>S. F (r i) - F (l i)) \<ge> (\<Sum>i\<in>?S1 \<union> ?S2 \<union> {j}. F (r i) - F (l i))"
32.102 -            using j \<in> S finite S psubset.prems j
32.103 +            using \<open>j \<in> S\<close> \<open>finite S\<close> psubset.prems j
32.104              by (intro setsum_mono2) (auto intro: less_imp_le)
32.105            also have "(\<Sum>i\<in>?S1 \<union> ?S2 \<union> {j}. F (r i) - F (l i)) =
32.106              (\<Sum>i\<in>?S1. F (r i) - F (l i)) + (\<Sum>i\<in>?S2 . F (r i) - F (l i)) + (F (r j) - F (l j))"
32.107 @@ -149,13 +149,13 @@
32.108              apply (metis less_le_not_le)
32.109              done
32.110            also (xtrans) have "(\<Sum>i\<in>?S1. F (r i) - F (l i)) \<ge> F (l j) - F u"
32.111 -            using j \<in> S finite S psubset.prems j
32.112 +            using \<open>j \<in> S\<close> \<open>finite S\<close> psubset.prems j
32.113              apply (intro psubset.IH psubset)
32.114              apply (auto simp: subset_eq Ball_def)
32.115              apply (metis less_le_trans not_le)
32.116              done
32.117            also (xtrans) have "(\<Sum>i\<in>?S2. F (r i) - F (l i)) \<ge> F v - F (r j)"
32.118 -            using j \<in> S finite S psubset.prems j
32.119 +            using \<open>j \<in> S\<close> \<open>finite S\<close> psubset.prems j
32.120              apply (intro psubset.IH psubset)
32.121              apply (auto simp: subset_eq Ball_def)
32.122              apply (metis le_less_trans not_le)
32.123 @@ -326,7 +326,7 @@
32.124    proof (rule tendsto_at_left_sequentially)
32.125      show "a - 1 < a" by simp
32.126      fix X assume "\<And>n. X n < a" "incseq X" "X ----> a"
32.127 -    with a \<le> b have "(\<lambda>n. emeasure ?F {X n<..b}) ----> emeasure ?F (\<Inter>n. {X n <..b})"
32.128 +    with \<open>a \<le> b\<close> have "(\<lambda>n. emeasure ?F {X n<..b}) ----> emeasure ?F (\<Inter>n. {X n <..b})"
32.129        apply (intro Lim_emeasure_decseq)
32.130        apply (auto simp: decseq_def incseq_def emeasure_interval_measure_Ioc *)
32.131        apply force
32.132 @@ -334,14 +334,14 @@
32.133        apply (auto intro: less_le_trans less_imp_le)
32.134        done
32.135      also have "(\<Inter>n. {X n <..b}) = {a..b}"
32.136 -      using \<And>n. X n < a
32.137 +      using \<open>\<And>n. X n < a\<close>
32.138        apply auto
32.139 -      apply (rule LIMSEQ_le_const2[OF X ----> a])
32.140 +      apply (rule LIMSEQ_le_const2[OF \<open>X ----> a\<close>])
32.141        apply (auto intro: less_imp_le)
32.142        apply (auto intro: less_le_trans)
32.143        done
32.144      also have "(\<lambda>n. emeasure ?F {X n<..b}) = (\<lambda>n. F b - F (X n))"
32.145 -      using \<And>n. X n < a a \<le> b by (subst *) (auto intro: less_imp_le less_le_trans)
32.146 +      using \<open>\<And>n. X n < a\<close> \<open>a \<le> b\<close> by (subst *) (auto intro: less_imp_le less_le_trans)
32.147      finally show "(\<lambda>n. F b - F (X n)) ----> emeasure ?F {a..b}" .
32.148    qed
32.149    show "((\<lambda>a. ereal (F b - F a)) ---> F b - F a) (at_left a)"
32.150 @@ -359,7 +359,7 @@
32.151    apply (auto intro!: Rats_no_top_le Rats_no_bot_less countable_rat simp: emeasure_interval_measure_Ioc_eq[OF assms])
32.152    done
32.153
32.154 -subsection {* Lebesgue-Borel measure *}
32.155 +subsection \<open>Lebesgue-Borel measure\<close>
32.156
32.157  definition lborel :: "('a :: euclidean_space) measure" where
32.158    "lborel = distr (\<Pi>\<^sub>M b\<in>Basis. interval_measure (\<lambda>x. x)) borel (\<lambda>f. \<Sum>b\<in>Basis. f b *\<^sub>R b)"
32.159 @@ -557,7 +557,7 @@
32.160    ultimately show False by contradiction
32.161  qed
32.162
32.163 -subsection {* Affine transformation on the Lebesgue-Borel *}
32.164 +subsection \<open>Affine transformation on the Lebesgue-Borel\<close>
32.165
32.166  lemma lborel_eqI:
32.167    fixes M :: "'a::euclidean_space measure"
32.168 @@ -595,13 +595,13 @@
32.169      assume "0 < c"
32.170      then have "(\<lambda>x. t + c *\<^sub>R x) - box l u = box ((l - t) /\<^sub>R c) ((u - t) /\<^sub>R c)"
32.171        by (auto simp: field_simps box_def inner_simps)
32.172 -    with 0 < c show ?thesis
32.173 +    with \<open>0 < c\<close> show ?thesis
32.174        using le
32.175        by (auto simp: field_simps emeasure_density nn_integral_distr nn_integral_cmult
32.176                       emeasure_lborel_box_eq inner_simps setprod_dividef setprod_constant
32.177                       borel_measurable_indicator' emeasure_distr)
32.178    next
32.179 -    assume "\<not> 0 < c" with c \<noteq> 0 have "c < 0" by auto
32.180 +    assume "\<not> 0 < c" with \<open>c \<noteq> 0\<close> have "c < 0" by auto
32.181      then have "box ((u - t) /\<^sub>R c) ((l - t) /\<^sub>R c) = (\<lambda>x. t + c *\<^sub>R x) - box l u"
32.182        by (auto simp: field_simps box_def inner_simps)
32.183      then have "\<And>x. indicator (box l u) (t + c *\<^sub>R x) = (indicator (box ((u - t) /\<^sub>R c) ((l - t) /\<^sub>R c)) x :: ereal)"
32.184 @@ -615,7 +615,7 @@
32.185        finally have "(- c) ^ card ?B * (\<Prod>x\<in>?B. l \<bullet> x - u \<bullet> x) = c ^ card ?B * (\<Prod>b\<in>?B. u \<bullet> b - l \<bullet> b)"
32.186          by simp }
32.187      ultimately show ?thesis
32.188 -      using c < 0 le
32.189 +      using \<open>c < 0\<close> le
32.190        by (auto simp: field_simps emeasure_density nn_integral_distr nn_integral_cmult
32.191                       emeasure_lborel_box_eq inner_simps setprod_dividef setprod_constant
32.192                       borel_measurable_indicator' emeasure_distr)
32.193 @@ -736,7 +736,7 @@
32.194  lemma lborelD_Collect[measurable (raw)]: "{x\<in>space borel. P x} \<in> sets borel \<Longrightarrow> {x\<in>space lborel. P x} \<in> sets lborel" by simp
32.195  lemma lborelD[measurable (raw)]: "A \<in> sets borel \<Longrightarrow> A \<in> sets lborel" by simp
32.196
32.197 -subsection {* Equivalence Lebesgue integral on @{const lborel} and HK-integral *}
32.198 +subsection \<open>Equivalence Lebesgue integral on @{const lborel} and HK-integral\<close>
32.199
32.200  lemma has_integral_measure_lborel:
32.201    fixes A :: "'a::euclidean_space set"
32.202 @@ -915,7 +915,7 @@
32.203    have *: "f integrable_on UNIV \<and> (\<lambda>k. integral UNIV (U k)) ----> integral UNIV f"
32.204    proof (rule monotone_convergence_increasing)
32.205      show "\<forall>k. U k integrable_on UNIV" using U_int by auto
32.206 -    show "\<forall>k. \<forall>x\<in>UNIV. U k x \<le> U (Suc k) x" using incseq U by (auto simp: incseq_def le_fun_def)
32.207 +    show "\<forall>k. \<forall>x\<in>UNIV. U k x \<le> U (Suc k) x" using \<open>incseq U\<close> by (auto simp: incseq_def le_fun_def)
32.208      then show "bounded {integral UNIV (U k) |k. True}"
32.209        using bnd int_eq by (auto simp: bounded_real intro!: exI[of _ r])
32.210      show "\<forall>x\<in>UNIV. (\<lambda>k. U k x) ----> f x"
32.211 @@ -1067,7 +1067,7 @@
32.212    proof (rule has_integral_dominated_convergence)
32.213      show "\<And>i. (s i has_integral integral\<^sup>L lborel (s i)) UNIV" by fact
32.214      show "(\<lambda>x. norm (2 * f x)) integrable_on UNIV"
32.215 -      using integrable lborel f
32.216 +      using \<open>integrable lborel f\<close>
32.217        by (intro nn_integral_integrable_on)
32.218           (auto simp: integrable_iff_bounded abs_mult times_ereal.simps(1)[symmetric] nn_integral_cmult
32.219                 simp del: times_ereal.simps)
32.220 @@ -1106,12 +1106,12 @@
32.221
32.222  end
32.223
32.224 -subsection {* Fundamental Theorem of Calculus for the Lebesgue integral *}
32.225 +subsection \<open>Fundamental Theorem of Calculus for the Lebesgue integral\<close>
32.226
32.227  lemma emeasure_bounded_finite:
32.228    assumes "bounded A" shows "emeasure lborel A < \<infinity>"
32.229  proof -
32.230 -  from bounded_subset_cbox[OF bounded A] obtain a b where "A \<subseteq> cbox a b"
32.231 +  from bounded_subset_cbox[OF \<open>bounded A\<close>] obtain a b where "A \<subseteq> cbox a b"
32.232      by auto
32.233    then have "emeasure lborel A \<le> emeasure lborel (cbox a b)"
32.234      by (intro emeasure_mono) auto
32.235 @@ -1130,7 +1130,7 @@
32.236    assume "S \<noteq> {}"
32.237    have "continuous_on S (\<lambda>x. norm (f x))"
32.238      using assms by (intro continuous_intros)
32.239 -  from continuous_attains_sup[OF compact S S \<noteq> {} this]
32.240 +  from continuous_attains_sup[OF \<open>compact S\<close> \<open>S \<noteq> {}\<close> this]
32.241    obtain M where M: "\<And>x. x \<in> S \<Longrightarrow> norm (f x) \<le> M"
32.242      by auto
32.243
32.244 @@ -1159,11 +1159,11 @@
32.245      by (auto simp: mult.commute)
32.246  qed
32.247
32.248 -text {*
32.249 +text \<open>
32.250
32.251  For the positive integral we replace continuity with Borel-measurability.
32.252
32.253 -*}
32.254 +\<close>
32.255
32.256  lemma
32.257    fixes f :: "real \<Rightarrow> real"
32.258 @@ -1181,7 +1181,7 @@
32.259    have "(f has_integral F b - F a) {a..b}"
32.260      by (intro fundamental_theorem_of_calculus)
32.261         (auto simp: has_field_derivative_iff_has_vector_derivative[symmetric]
32.262 -             intro: has_field_derivative_subset[OF f(1)] a \<le> b)
32.263 +             intro: has_field_derivative_subset[OF f(1)] \<open>a \<le> b\<close>)
32.264    then have i: "((\<lambda>x. f x * indicator {a .. b} x) has_integral F b - F a) UNIV"
32.265      unfolding indicator_def if_distrib[where f="\<lambda>x. a * x" for a]
32.266      by (simp cong del: if_cong del: atLeastAtMost_iff)
32.267 @@ -1235,7 +1235,7 @@
32.268    have 2: "continuous_on {a .. b} f"
32.269      using cont by (intro continuous_at_imp_continuous_on) auto
32.270    show ?has ?eq
32.271 -    using has_bochner_integral_FTC_Icc[OF a \<le> b 1 2] integral_FTC_Icc[OF a \<le> b 1 2]
32.272 +    using has_bochner_integral_FTC_Icc[OF \<open>a \<le> b\<close> 1 2] integral_FTC_Icc[OF \<open>a \<le> b\<close> 1 2]
32.273      by (auto simp: mult.commute)
32.274  qed
32.275
32.276 @@ -1300,7 +1300,7 @@
32.277      by (intro derivative_eq_intros) auto
32.278  qed (auto simp: field_simps simp del: of_nat_Suc)
32.279
32.280 -subsection {* Integration by parts *}
32.281 +subsection \<open>Integration by parts\<close>
32.282
32.283  lemma integral_by_parts_integrable:
32.284    fixes f g F G::"real \<Rightarrow> real"

    33.1 --- a/src/HOL/Probability/Measurable.thy	Mon Dec 07 16:48:10 2015 +0000
33.2 +++ b/src/HOL/Probability/Measurable.thy	Mon Dec 07 20:19:59 2015 +0100
33.3 @@ -7,7 +7,7 @@
33.4      "~~/src/HOL/Library/Order_Continuity"
33.5  begin
33.6
33.7 -subsection {* Measurability prover *}
33.8 +subsection \<open>Measurability prover\<close>
33.9
33.10  lemma (in algebra) sets_Collect_finite_All:
33.11    assumes "\<And>i. i \<in> S \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" "finite S"
33.12 @@ -48,7 +48,7 @@
33.13
33.14  ML_file "measurable.ML"
33.15
33.16 -attribute_setup measurable = {*
33.17 +attribute_setup measurable = \<open>
33.18    Scan.lift (
33.19      (Args.add >> K true || Args.del >> K false || Scan.succeed true) --
33.20      Scan.optional (Args.parens (
33.21 @@ -56,7 +56,7 @@
33.22        Scan.optional (Args.$"generic" >> K Measurable.Generic) Measurable.Concrete)) 33.23 (false, Measurable.Concrete) >> 33.24 Measurable.measurable_thm_attr) 33.25 -*} "declaration of measurability theorems" 33.26 +\<close> "declaration of measurability theorems" 33.27 33.28 attribute_setup measurable_dest = Measurable.dest_thm_attr 33.29 "add dest rule to measurability prover" 33.30 @@ -67,11 +67,11 @@ 33.31 method_setup measurable = \<open> Scan.lift (Scan.succeed (METHOD o Measurable.measurable_tac)) \<close> 33.32 "measurability prover" 33.33 33.34 -simproc_setup measurable ("A \<in> sets M" | "f \<in> measurable M N") = {* K Measurable.simproc *} 33.35 +simproc_setup measurable ("A \<in> sets M" | "f \<in> measurable M N") = \<open>K Measurable.simproc\<close> 33.36 33.37 -setup {* 33.38 +setup \<open> 33.39 Global_Theory.add_thms_dynamic (@{binding measurable}, Measurable.get_all) 33.40 -*} 33.41 +\<close> 33.42 33.43 declare 33.44 pred_sets1[measurable_dest] 33.45 @@ -288,7 +288,7 @@ 33.46 { fix x i j assume "P i x" "\<forall>n\<ge>j. \<not> P n x" 33.47 then have "finite {i. P i x}" 33.48 by (auto simp: subset_eq not_le[symmetric] finite_nat_iff_bounded) 33.49 - with P i x have "P (Max {i. P i x}) x" "i \<le> Max {i. P i x}" "finite {i. P i x}" 33.50 + with \<open>P i x\<close> have "P (Max {i. P i x}) x" "i \<le> Max {i. P i x}" "finite {i. P i x}" 33.51 using Max_in[of "{i. P i x}"] by auto } 33.52 note 2 = this 33.53 33.54 @@ -323,7 +323,7 @@ 33.55 { fix x i j assume "P i x" "\<forall>n\<ge>j. \<not> P n x" 33.56 then have "finite {i. P i x}" 33.57 by (auto simp: subset_eq not_le[symmetric] finite_nat_iff_bounded) 33.58 - with P i x have "P (Min {i. P i x}) x" "Min {i. P i x} \<le> i" "finite {i. P i x}" 33.59 + with \<open>P i x\<close> have "P (Min {i. P i x}) x" "Min {i. P i x} \<le> i" "finite {i. P i x}" 33.60 using Min_in[of "{i. P i x}"] by auto } 33.61 note 2 = this 33.62 33.63 @@ -380,7 +380,7 @@ 33.64 unfolding pred_def 33.65 by (auto intro!: sets.sets_Collect_countable_All' sets.sets_Collect_countable_Ex' assms) 33.66 33.67 -subsection {* Measurability for (co)inductive predicates *} 33.68 +subsection \<open>Measurability for (co)inductive predicates\<close> 33.69 33.70 lemma measurable_bot[measurable]: "bot \<in> measurable M (count_space UNIV)" 33.71 by (simp add: bot_fun_def) 33.72 @@ -427,7 +427,7 @@ 33.73 assumes *: "\<And>M A. P M \<Longrightarrow> (\<And>N. P N \<Longrightarrow> A \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" 33.74 shows "lfp F \<in> measurable M (count_space UNIV)" 33.75 proof - 33.76 - { fix i from P M have "((F ^^ i) bot) \<in> measurable M (count_space UNIV)" 33.77 + { fix i from \<open>P M\<close> have "((F ^^ i) bot) \<in> measurable M (count_space UNIV)" 33.78 by (induct i arbitrary: M) (auto intro!: *) } 33.79 then have "(\<lambda>x. SUP i. (F ^^ i) bot x) \<in> measurable M (count_space UNIV)" 33.80 by measurable 33.81 @@ -450,7 +450,7 @@ 33.82 assumes *: "\<And>M A. P M \<Longrightarrow> (\<And>N. P N \<Longrightarrow> A \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A \<in> measurable M (count_space UNIV)" 33.83 shows "gfp F \<in> measurable M (count_space UNIV)" 33.84 proof - 33.85 - { fix i from P M have "((F ^^ i) top) \<in> measurable M (count_space UNIV)" 33.86 + { fix i from \<open>P M\<close> have "((F ^^ i) top) \<in> measurable M (count_space UNIV)" 33.87 by (induct i arbitrary: M) (auto intro!: *) } 33.88 then have "(\<lambda>x. INF i. (F ^^ i) top x) \<in> measurable M (count_space UNIV)" 33.89 by measurable 33.90 @@ -473,7 +473,7 @@ 33.91 assumes *: "\<And>M A s. P M s \<Longrightarrow> (\<And>N t. P N t \<Longrightarrow> A t \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A s \<in> measurable M (count_space UNIV)" 33.92 shows "lfp F s \<in> measurable M (count_space UNIV)" 33.93 proof - 33.94 - { fix i from P M s have "(\<lambda>x. (F ^^ i) bot s x) \<in> measurable M (count_space UNIV)" 33.95 + { fix i from \<open>P M s\<close> have "(\<lambda>x. (F ^^ i) bot s x) \<in> measurable M (count_space UNIV)" 33.96 by (induct i arbitrary: M s) (auto intro!: *) } 33.97 then have "(\<lambda>x. SUP i. (F ^^ i) bot s x) \<in> measurable M (count_space UNIV)" 33.98 by measurable 33.99 @@ -489,7 +489,7 @@ 33.100 assumes *: "\<And>M A s. P M s \<Longrightarrow> (\<And>N t. P N t \<Longrightarrow> A t \<in> measurable N (count_space UNIV)) \<Longrightarrow> F A s \<in> measurable M (count_space UNIV)" 33.101 shows "gfp F s \<in> measurable M (count_space UNIV)" 33.102 proof - 33.103 - { fix i from P M s have "(\<lambda>x. (F ^^ i) top s x) \<in> measurable M (count_space UNIV)" 33.104 + { fix i from \<open>P M s\<close> have "(\<lambda>x. (F ^^ i) top s x) \<in> measurable M (count_space UNIV)" 33.105 by (induct i arbitrary: M s) (auto intro!: *) } 33.106 then have "(\<lambda>x. INF i. (F ^^ i) top s x) \<in> measurable M (count_space UNIV)" 33.107 by measurable 33.108 @@ -511,7 +511,7 @@ 33.109 have "f - {a} \<inter> space M = {x\<in>space M. f x = a}" 33.110 by auto 33.111 { fix i :: nat 33.112 - from R f have "Measurable.pred M (\<lambda>x. f x = enat i)" 33.113 + from \<open>R f\<close> have "Measurable.pred M (\<lambda>x. f x = enat i)" 33.114 proof (induction i arbitrary: f) 33.115 case 0 33.116 from *[OF this] obtain g h i P 33.117 @@ -533,7 +533,7 @@ 33.118 (\<lambda>x. (P x \<longrightarrow> h x = enat (Suc n)) \<and> (\<not> P x \<longrightarrow> g (i x) = enat n))" 33.119 by (auto simp: f zero_enat_def[symmetric] eSuc_enat[symmetric]) 33.120 also have "Measurable.pred M \<dots>" 33.121 - by (intro pred_intros_logic measurable_compose[OF M(2)] Suc R g) measurable 33.122 + by (intro pred_intros_logic measurable_compose[OF M(2)] Suc \<open>R g\<close>) measurable 33.123 finally show ?case . 33.124 qed 33.125 then have "f - {enat i} \<inter> space M \<in> sets M"   34.1 --- a/src/HOL/Probability/Measure_Space.thy Mon Dec 07 16:48:10 2015 +0000 34.2 +++ b/src/HOL/Probability/Measure_Space.thy Mon Dec 07 20:19:59 2015 +0100 34.3 @@ -4,7 +4,7 @@ 34.4 Author: Armin Heller, TU MÃ¼nchen 34.5 *) 34.6 34.7 -section {* Measure spaces and their properties *} 34.8 +section \<open>Measure spaces and their properties\<close> 34.9 34.10 theory Measure_Space 34.11 imports 34.12 @@ -19,7 +19,7 @@ 34.13 shows "(\<Sum>n. f n * indicator (A n) x) = f i" 34.14 proof - 34.15 have **: "\<And>n. f n * indicator (A n) x = (if n = i then f n else 0 :: ereal)" 34.16 - using x \<in> A i assms unfolding disjoint_family_on_def indicator_def by auto 34.17 + using \<open>x \<in> A i\<close> assms unfolding disjoint_family_on_def indicator_def by auto 34.18 then have "\<And>n. (\<Sum>j<n. f j * indicator (A j) x) = (if i < n then f i else 0 :: ereal)" 34.19 by (auto simp: setsum.If_cases) 34.20 moreover have "(SUP n. if i < n then f i else 0) = (f i :: ereal)" 34.21 @@ -37,7 +37,7 @@ 34.22 proof cases 34.23 assume *: "x \<in> (\<Union>i. A i)" 34.24 then obtain i where "x \<in> A i" by auto 34.25 - from suminf_cmult_indicator[OF assms(1), OF x \<in> A i, of "\<lambda>k. 1"] 34.26 + from suminf_cmult_indicator[OF assms(1), OF \<open>x \<in> A i\<close>, of "\<lambda>k. 1"] 34.27 show ?thesis using * by simp 34.28 qed simp 34.29 34.30 @@ -47,17 +47,17 @@ 34.31 shows "(\<Sum>i\<in>P. f i * indicator (A i) x) = f j" 34.32 proof - 34.33 have "P \<inter> {i. x \<in> A i} = {j}" 34.34 - using d x \<in> A j j \<in> P unfolding disjoint_family_on_def 34.35 + using d \<open>x \<in> A j\<close> \<open>j \<in> P\<close> unfolding disjoint_family_on_def 34.36 by auto 34.37 thus ?thesis 34.38 unfolding indicator_def 34.39 - by (simp add: if_distrib setsum.If_cases[OF finite P]) 34.40 + by (simp add: if_distrib setsum.If_cases[OF \<open>finite P\<close>]) 34.41 qed 34.42 34.43 -text {* 34.44 +text \<open> 34.45 The type for emeasure spaces is already defined in @{theory Sigma_Algebra}, as it is also used to 34.46 represent sigma algebras (with an arbitrary emeasure). 34.47 -*} 34.48 +\<close> 34.49 34.50 subsection "Extend binary sets" 34.51 34.52 @@ -91,12 +91,12 @@ 34.53 shows "f {} = 0 \<Longrightarrow> (\<Sum>n. f (binaryset A B n)) = f A + f B" 34.54 by (metis binaryset_sums sums_unique) 34.55 34.56 -subsection {* Properties of a premeasure @{term \<mu>} *} 34.57 +subsection \<open>Properties of a premeasure @{term \<mu>}\<close> 34.58 34.59 -text {* 34.60 +text \<open> 34.61 The definitions for @{const positive} and @{const countably_additive} should be here, by they are 34.62 necessary to define @{typ "'a measure"} in @{theory Sigma_Algebra}. 34.63 -*} 34.64 +\<close> 34.65 34.66 definition additive where 34.67 "additive M \<mu> \<longleftrightarrow> (\<forall>x\<in>M. \<forall>y\<in>M. x \<inter> y = {} \<longrightarrow> \<mu> (x \<union> y) = \<mu> x + \<mu> y)" 34.68 @@ -134,7 +134,7 @@ 34.69 also have "\<dots> = f (A n \<union> disjointed A (Suc n))" 34.70 using A by (subst f(2)[THEN additiveD]) (auto simp: disjointed_mono) 34.71 also have "A n \<union> disjointed A (Suc n) = A (Suc n)" 34.72 - using incseq A by (auto dest: incseq_SucD simp: disjointed_mono) 34.73 + using \<open>incseq A\<close> by (auto dest: incseq_SucD simp: disjointed_mono) 34.74 finally show ?case . 34.75 qed simp 34.76 34.77 @@ -144,7 +144,7 @@ 34.78 and A: "AS \<subseteq> M" 34.79 and disj: "disjoint_family_on A S" 34.80 shows "(\<Sum>i\<in>S. f (A i)) = f (\<Union>i\<in>S. A i)" 34.81 - using finite S disj A 34.82 + using \<open>finite S\<close> disj A 34.83 proof induct 34.84 case empty show ?case using f by (simp add: positive_def) 34.85 next 34.86 @@ -154,7 +154,7 @@ 34.87 moreover 34.88 have "A s \<in> M" using insert by blast 34.89 moreover have "(\<Union>i\<in>S. A i) \<in> M" 34.90 - using insert finite S by auto 34.91 + using insert \<open>finite S\<close> by auto 34.92 ultimately have "f (A s \<union> (\<Union>i\<in>S. A i)) = f (A s) + f(\<Union>i\<in>S. A i)" 34.93 using ad UNION_in_sets A by (auto simp add: additive_def) 34.94 with insert show ?case using ad disjoint_family_on_mono[of S "insert s S" A] 34.95 @@ -254,7 +254,7 @@ 34.96 by (metis F(2) assms(1) infinite_super sets_into_space) 34.97 34.98 have F_subset: "{i. \<mu> (F i) \<noteq> 0} \<subseteq> {i. F i \<noteq> {}}" 34.99 - by (auto simp: positiveD_empty[OF positive M \<mu>]) 34.100 + by (auto simp: positiveD_empty[OF \<open>positive M \<mu>\<close>]) 34.101 moreover have fin_not_empty: "finite {i. F i \<noteq> {}}" 34.102 proof (rule finite_imageD) 34.103 from f have "f{i. F i \<noteq> {}} \<subseteq> (\<Union>i. F i)" by auto 34.104 @@ -272,7 +272,7 @@ 34.105 also have "\<dots> = (\<Sum>i | F i \<noteq> {}. \<mu> (F i))" 34.106 using fin_not_empty F_subset by (rule setsum.mono_neutral_left) auto 34.107 also have "\<dots> = \<mu> (\<Union>i\<in>{i. F i \<noteq> {}}. F i)" 34.108 - using positive M \<mu> additive M \<mu> fin_not_empty disj_not_empty F by (intro additive_sum) auto 34.109 + using \<open>positive M \<mu>\<close> \<open>additive M \<mu>\<close> fin_not_empty disj_not_empty F by (intro additive_sum) auto 34.110 also have "\<dots> = \<mu> (\<Union>i. F i)" 34.111 by (rule arg_cong[where f=\<mu>]) auto 34.112 finally show "(\<Sum>i. \<mu> (F i)) = \<mu> (\<Union>i. F i)" . 34.113 @@ -327,7 +327,7 @@ 34.114 assume cont: "(\<forall>A. range A \<subseteq> M \<longrightarrow> decseq A \<longrightarrow> (\<Inter>i. A i) \<in> M \<longrightarrow> (\<forall>i. f (A i) \<noteq> \<infinity>) \<longrightarrow> (\<lambda>i. f (A i)) ----> f (\<Inter>i. A i))" 34.115 fix A :: "nat \<Rightarrow> 'a set" assume A: "range A \<subseteq> M" "decseq A" "(\<Inter>i. A i) = {}" "\<forall>i. f (A i) \<noteq> \<infinity>" 34.116 with cont[THEN spec, of A] show "(\<lambda>i. f (A i)) ----> 0" 34.117 - using positive M f[unfolded positive_def] by auto 34.118 + using \<open>positive M f\<close>[unfolded positive_def] by auto 34.119 next 34.120 assume cont: "\<forall>A. range A \<subseteq> M \<longrightarrow> decseq A \<longrightarrow> (\<Inter>i. A i) = {} \<longrightarrow> (\<forall>i. f (A i) \<noteq> \<infinity>) \<longrightarrow> (\<lambda>i. f (A i)) ----> 0" 34.121 fix A :: "nat \<Rightarrow> 'a set" assume A: "range A \<subseteq> M" "decseq A" "(\<Inter>i. A i) \<in> M" "\<forall>i. f (A i) \<noteq> \<infinity>" 34.122 @@ -415,7 +415,7 @@ 34.123 using empty_continuous_imp_continuous_from_below[OF f fin] cont 34.124 by blast 34.125 34.126 -subsection {* Properties of @{const emeasure} *} 34.127 +subsection \<open>Properties of @{const emeasure}\<close> 34.128 34.129 lemma emeasure_positive: "positive (sets M) (emeasure M)" 34.130 by (cases M) (auto simp: sets_def emeasure_def Abs_measure_inverse measure_space_def) 34.131 @@ -483,7 +483,7 @@ 34.132 by (rule plus_emeasure[symmetric]) (auto simp add: s) 34.133 finally have "emeasure M (space M) = emeasure M s + emeasure M (space M - s)" . 34.134 then show ?thesis 34.135 - using fin 0 \<le> emeasure M s 34.136 + using fin \<open>0 \<le> emeasure M s\<close> 34.137 unfolding ereal_eq_minus_iff by (auto simp: ac_simps) 34.138 qed 34.139 34.140 @@ -493,13 +493,13 @@ 34.141 shows "emeasure M (A - B) = emeasure M A - emeasure M B" 34.142 proof - 34.143 have "0 \<le> emeasure M B" using assms by auto 34.144 - have "(A - B) \<union> B = A" using B \<subseteq> A by auto 34.145 + have "(A - B) \<union> B = A" using \<open>B \<subseteq> A\<close> by auto 34.146 then have "emeasure M A = emeasure M ((A - B) \<union> B)" by simp 34.147 also have "\<dots> = emeasure M (A - B) + emeasure M B" 34.148 by (subst plus_emeasure[symmetric]) auto 34.149 finally show "emeasure M (A - B) = emeasure M A - emeasure M B" 34.150 unfolding ereal_eq_minus_iff 34.151 - using finite 0 \<le> emeasure M B by auto 34.152 + using finite \<open>0 \<le> emeasure M B\<close> by auto 34.153 qed 34.154 34.155 lemma Lim_emeasure_incseq: 34.156 @@ -541,13 +541,13 @@ 34.157 unfolding minus_ereal_def using A0 assms 34.158 by (subst SUP_ereal_add) (auto simp add: decseq_emeasure) 34.159 also have "\<dots> = (SUP n. emeasure M (A 0 - A n))" 34.160 - using A finite decseq A[unfolded decseq_def] by (subst emeasure_Diff) auto 34.161 + using A finite \<open>decseq A\<close>[unfolded decseq_def] by (subst emeasure_Diff) auto 34.162 also have "\<dots> = emeasure M (\<Union>i. A 0 - A i)" 34.163 proof (rule SUP_emeasure_incseq) 34.164 show "range (\<lambda>n. A 0 - A n) \<subseteq> sets M" 34.165 using A by auto 34.166 show "incseq (\<lambda>n. A 0 - A n)" 34.167 - using decseq A by (auto simp add: incseq_def decseq_def) 34.168 + using \<open>decseq A\<close> by (auto simp add: incseq_def decseq_def) 34.169 qed 34.170 also have "\<dots> = emeasure M (A 0) - emeasure M (\<Inter>i. A i)" 34.171 using A finite * by (simp, subst emeasure_Diff) auto 34.172 @@ -616,7 +616,7 @@ 34.173 proof - 34.174 have "emeasure M {x\<in>space M. lfp F x} = emeasure M (\<Union>i. {x\<in>space M. (F ^^ i) (\<lambda>x. False) x})" 34.175 using sup_continuous_lfp[OF cont] by (auto simp add: bot_fun_def intro!: arg_cong2[where f=emeasure]) 34.176 - moreover { fix i from P M have "{x\<in>space M. (F ^^ i) (\<lambda>x. False) x} \<in> sets M" 34.177 + moreover { fix i from \<open>P M\<close> have "{x\<in>space M. (F ^^ i) (\<lambda>x. False) x} \<in> sets M" 34.178 by (induct i arbitrary: M) (auto simp add: pred_def[symmetric] intro: *) } 34.179 moreover have "incseq (\<lambda>i. {x\<in>space M. (F ^^ i) (\<lambda>x. False) x})" 34.180 proof (rule incseq_SucI) 34.181 @@ -694,7 +694,7 @@ 34.182 assumes sets: "{x} \<in> sets M" "A \<in> sets M" and "x \<notin> A" 34.183 shows "emeasure M (insert x A) = emeasure M {x} + emeasure M A" 34.184 proof - 34.185 - have "{x} \<inter> A = {}" using x \<notin> A by auto 34.186 + have "{x} \<inter> A = {}" using \<open>x \<notin> A\<close> by auto 34.187 from plus_emeasure[OF sets this] show ?thesis by simp 34.188 qed 34.189 34.190 @@ -717,7 +717,7 @@ 34.191 have "(\<Sum>i\<in>S. emeasure M (A \<inter> (B i))) = emeasure M (\<Union>i\<in>S. A \<inter> (B i))" 34.192 proof (rule setsum_emeasure) 34.193 show "disjoint_family_on (\<lambda>i. A \<inter> B i) S" 34.194 - using disjoint_family_on B S 34.195 + using \<open>disjoint_family_on B S\<close> 34.196 unfolding disjoint_family_on_def by auto 34.197 qed (insert assms, auto) 34.198 also have "(\<Union>i\<in>S. A \<inter> (B i)) = A" 34.199 @@ -747,11 +747,11 @@ 34.200 fix X assume "X \<in> sets M" 34.201 then have X: "X \<subseteq> A" by auto 34.202 then have "emeasure M X = (\<Sum>a\<in>X. emeasure M {a})" 34.203 - using finite A by (subst emeasure_eq_setsum_singleton) (auto dest: finite_subset) 34.204 + using \<open>finite A\<close> by (subst emeasure_eq_setsum_singleton) (auto dest: finite_subset) 34.205 also have "\<dots> = (\<Sum>a\<in>X. emeasure N {a})" 34.206 using X eq by (auto intro!: setsum.cong) 34.207 also have "\<dots> = emeasure N X" 34.208 - using X finite A by (subst emeasure_eq_setsum_singleton) (auto dest: finite_subset) 34.209 + using X \<open>finite A\<close> by (subst emeasure_eq_setsum_singleton) (auto dest: finite_subset) 34.210 finally show "emeasure M X = emeasure N X" . 34.211 qed simp 34.212 34.213 @@ -767,18 +767,18 @@ 34.214 let ?\<mu> = "emeasure M" and ?\<nu> = "emeasure N" 34.215 interpret S: sigma_algebra \<Omega> "sigma_sets \<Omega> E" by (rule sigma_algebra_sigma_sets) fact 34.216 have "space M = \<Omega>" 34.217 - using sets.top[of M] sets.space_closed[of M] S.top S.space_closed sets M = sigma_sets \<Omega> E 34.218 + using sets.top[of M] sets.space_closed[of M] S.top S.space_closed \<open>sets M = sigma_sets \<Omega> E\<close> 34.219 by blast 34.220 34.221 { fix F D assume "F \<in> E" and "?\<mu> F \<noteq> \<infinity>" 34.222 then have [intro]: "F \<in> sigma_sets \<Omega> E" by auto 34.223 - have "?\<nu> F \<noteq> \<infinity>" using ?\<mu> F \<noteq> \<infinity> F \<in> E eq by simp 34.224 + have "?\<nu> F \<noteq> \<infinity>" using \<open>?\<mu> F \<noteq> \<infinity>\<close> \<open>F \<in> E\<close> eq by simp 34.225 assume "D \<in> sets M" 34.226 - with Int_stable E E \<subseteq> Pow \<Omega> have "emeasure M (F \<inter> D) = emeasure N (F \<inter> D)" 34.227 + with \<open>Int_stable E\<close> \<open>E \<subseteq> Pow \<Omega>\<close> have "emeasure M (F \<inter> D) = emeasure N (F \<inter> D)" 34.228 unfolding M 34.229 proof (induct rule: sigma_sets_induct_disjoint) 34.230 case (basic A) 34.231 - then have "F \<inter> A \<in> E" using Int_stable E F \<in> E by (auto simp: Int_stable_def) 34.232 + then have "F \<inter> A \<in> E" using \<open>Int_stable E\<close> \<open>F \<in> E\<close> by (auto simp: Int_stable_def) 34.233 then show ?case using eq by auto 34.234 next 34.235 case empty then show ?case by simp 34.236 @@ -786,19 +786,19 @@ 34.237 case (compl A) 34.238 then have **: "F \<inter> (\<Omega> - A) = F - (F \<inter> A)" 34.239 and [intro]: "F \<inter> A \<in> sigma_sets \<Omega> E" 34.240 - using F \<in> E S.sets_into_space by (auto simp: M) 34.241 + using \<open>F \<in> E\<close> S.sets_into_space by (auto simp: M) 34.242 have "?\<nu> (F \<inter> A) \<le> ?\<nu> F" by (auto intro!: emeasure_mono simp: M N) 34.243 - then have "?\<nu> (F \<inter> A) \<noteq> \<infinity>" using ?\<nu> F \<noteq> \<infinity> by auto 34.244 + then have "?\<nu> (F \<inter> A) \<noteq> \<infinity>" using \<open>?\<nu> F \<noteq> \<infinity>\<close> by auto 34.245 have "?\<mu> (F \<inter> A) \<le> ?\<mu> F" by (auto intro!: emeasure_mono simp: M N) 34.246 - then have "?\<mu> (F \<inter> A) \<noteq> \<infinity>" using ?\<mu> F \<noteq> \<infinity> by auto 34.247 + then have "?\<mu> (F \<inter> A) \<noteq> \<infinity>" using \<open>?\<mu> F \<noteq> \<infinity>\<close> by auto 34.248 then have "?\<mu> (F \<inter> (\<Omega> - A)) = ?\<mu> F - ?\<mu> (F \<inter> A)" unfolding ** 34.249 - using F \<inter> A \<in> sigma_sets \<Omega> E by (auto intro!: emeasure_Diff simp: M N) 34.250 - also have "\<dots> = ?\<nu> F - ?\<nu> (F \<inter> A)" using eq F \<in> E compl by simp 34.251 + using \<open>F \<inter> A \<in> sigma_sets \<Omega> E\<close> by (auto intro!: emeasure_Diff simp: M N) 34.252 + also have "\<dots> = ?\<nu> F - ?\<nu> (F \<inter> A)" using eq \<open>F \<in> E\<close> compl by simp 34.253 also have "\<dots> = ?\<nu> (F \<inter> (\<Omega> - A))" unfolding ** 34.254 - using F \<inter> A \<in> sigma_sets \<Omega> E ?\<nu> (F \<inter> A) \<noteq> \<infinity> 34.255 + using \<open>F \<inter> A \<in> sigma_sets \<Omega> E\<close> \<open>?\<nu> (F \<inter> A) \<noteq> \<infinity>\<close> 34.256 by (auto intro!: emeasure_Diff[symmetric] simp: M N) 34.257 finally show ?case 34.258 - using space M = \<Omega> by auto 34.259 + using \<open>space M = \<Omega>\<close> by auto 34.260 next 34.261 case (union A) 34.262 then have "?\<mu> (\<Union>x. F \<inter> A x) = ?\<nu> (\<Union>x. F \<inter> A x)" 34.263 @@ -815,10 +815,10 @@ 34.264 using A(1) by (auto simp: subset_eq M) 34.265 fix F assume "F \<in> sets M" 34.266 let ?D = "disjointed (\<lambda>i. F \<inter> A i)" 34.267 - from space M = \<Omega> have F_eq: "F = (\<Union>i. ?D i)" 34.268 - using F \<in> sets M[THEN sets.sets_into_space] A(2)[symmetric] by (auto simp: UN_disjointed_eq) 34.269 + from \<open>space M = \<Omega>\<close> have F_eq: "F = (\<Union>i. ?D i)" 34.270 + using \<open>F \<in> sets M\<close>[THEN sets.sets_into_space] A(2)[symmetric] by (auto simp: UN_disjointed_eq) 34.271 have [simp, intro]: "\<And>i. ?D i \<in> sets M" 34.272 - using sets.range_disjointed_sets[of "\<lambda>i. F \<inter> A i" M] F \<in> sets M 34.273 + using sets.range_disjointed_sets[of "\<lambda>i. F \<inter> A i" M] \<open>F \<in> sets M\<close> 34.274 by (auto simp: subset_eq) 34.275 have "disjoint_family ?D" 34.276 by (auto simp: disjoint_family_disjointed) 34.277 @@ -832,7 +832,7 @@ 34.278 using *[of "A i" "?D i", OF _ A(3)] A(1) by auto 34.279 qed 34.280 ultimately show "emeasure M F = emeasure N F" 34.281 - by (simp add: image_subset_iff sets M = sets N[symmetric] F_eq[symmetric] suminf_emeasure) 34.282 + by (simp add: image_subset_iff \<open>sets M = sets N\<close>[symmetric] F_eq[symmetric] suminf_emeasure) 34.283 qed 34.284 qed 34.285 34.286 @@ -845,7 +845,7 @@ 34.287 by (simp add: emeasure_countably_additive) 34.288 qed simp_all 34.289 34.290 -subsection {* @{text \<mu>}-null sets *} 34.291 +subsection \<open>\<open>\<mu>\<close>-null sets\<close> 34.292 34.293 definition null_sets :: "'a measure \<Rightarrow> 'a set set" where 34.294 "null_sets M = {N\<in>sets M. emeasure M N = 0}" 34.295 @@ -901,10 +901,10 @@ 34.296 show "(\<Union>i\<in>I. N i) \<in> sets M" 34.297 using assms by (intro sets.countable_UN') auto 34.298 have "emeasure M (\<Union>i\<in>I. N i) \<le> (\<Sum>n. emeasure M (N (from_nat_into I n)))" 34.299 - unfolding UN_from_nat_into[OF countable I I \<noteq> {}] 34.300 - using assms I \<noteq> {} by (intro emeasure_subadditive_countably) (auto intro: from_nat_into) 34.301 + unfolding UN_from_nat_into[OF \<open>countable I\<close> \<open>I \<noteq> {}\<close>] 34.302 + using assms \<open>I \<noteq> {}\<close> by (intro emeasure_subadditive_countably) (auto intro: from_nat_into) 34.303 also have "(\<lambda>n. emeasure M (N (from_nat_into I n))) = (\<lambda>_. 0)" 34.304 - using assms I \<noteq> {} by (auto intro: from_nat_into) 34.305 + using assms \<open>I \<noteq> {}\<close> by (auto intro: from_nat_into) 34.306 finally show "emeasure M (\<Union>i\<in>I. N i) = 0" 34.307 by (intro antisym emeasure_nonneg) simp 34.308 qed 34.309 @@ -953,7 +953,7 @@ 34.310 by (subst plus_emeasure[symmetric]) auto 34.311 qed 34.312 34.313 -subsection {* The almost everywhere filter (i.e.\ quantifier) *} 34.314 +subsection \<open>The almost everywhere filter (i.e.\ quantifier)\<close> 34.315 34.316 definition ae_filter :: "'a measure \<Rightarrow> 'a filter" where 34.317 "ae_filter M = (INF N:null_sets M. principal (space M - N))" 34.318 @@ -983,7 +983,7 @@ 34.319 have "0 \<le> emeasure M ?P" by auto 34.320 moreover have "emeasure M ?P \<le> emeasure M N" 34.321 using assms N(1,2) by (auto intro: emeasure_mono) 34.322 - ultimately have "emeasure M ?P = 0" unfolding emeasure M N = 0 by auto 34.323 + ultimately have "emeasure M ?P = 0" unfolding \<open>emeasure M N = 0\<close> by auto 34.324 then show "?P \<in> null_sets M" using assms by auto 34.325 next 34.326 assume "?P \<in> null_sets M" with assms show "AE x in M. P x" by (auto intro: AE_I') 34.327 @@ -1138,7 +1138,7 @@ 34.328 lemma AE_finite_allI: 34.329 assumes "finite S" 34.330 shows "(\<And>s. s \<in> S \<Longrightarrow> AE x in M. Q s x) \<Longrightarrow> AE x in M. \<forall>s\<in>S. Q s x" 34.331 - using AE_finite_all[OF finite S] by auto 34.332 + using AE_finite_all[OF \<open>finite S\<close>] by auto 34.333 34.334 lemma emeasure_mono_AE: 34.335 assumes imp: "AE x in M. x \<in> A \<longrightarrow> x \<in> B" 34.336 @@ -1187,7 +1187,7 @@ 34.337 finally show ?thesis . 34.338 qed 34.339 34.340 -subsection {* @{text \<sigma>}-finite Measures *} 34.341 +subsection \<open>\<open>\<sigma>\<close>-finite Measures\<close> 34.342 34.343 locale sigma_finite_measure = 34.344 fixes M :: "'a measure" 34.345 @@ -1204,19 +1204,19 @@ 34.346 using sigma_finite_countable by metis 34.347 show thesis 34.348 proof cases 34.349 - assume "A = {}" with (\<Union>A) = space M show thesis 34.350 + assume "A = {}" with \<open>(\<Union>A) = space M\<close> show thesis 34.351 by (intro that[of "\<lambda>_. {}"]) auto 34.352 next 34.353 assume "A \<noteq> {}" 34.354 show thesis 34.355 proof 34.356 show "range (from_nat_into A) \<subseteq> sets M" 34.357 - using A \<noteq> {} A by auto 34.358 + using \<open>A \<noteq> {}\<close> A by auto 34.359 have "(\<Union>i. from_nat_into A i) = \<Union>A" 34.360 - using range_from_nat_into[OF A \<noteq> {} countable A] by auto 34.361 + using range_from_nat_into[OF \<open>A \<noteq> {}\<close> \<open>countable A\<close>] by auto 34.362 with A show "(\<Union>i. from_nat_into A i) = space M" 34.363 by auto 34.364 - qed (intro A from_nat_into A \<noteq> {}) 34.365 + qed (intro A from_nat_into \<open>A \<noteq> {}\<close>) 34.366 qed 34.367 qed 34.368 34.369 @@ -1275,7 +1275,7 @@ 34.370 qed 34.371 qed 34.372 34.373 -subsection {* Measure space induced by distribution of @{const measurable}-functions *} 34.374 +subsection \<open>Measure space induced by distribution of @{const measurable}-functions\<close> 34.375 34.376 definition distr :: "'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b measure" where 34.377 "distr M N f = measure_of (space N) (sets N) (\<lambda>A. emeasure M (f - A \<inter> space M))" 34.378 @@ -1312,7 +1312,7 @@ 34.379 moreover have "(\<Union>i. f - A i \<inter> space M) \<in> sets M" 34.380 using * by blast 34.381 moreover have **: "disjoint_family (\<lambda>i. f - A i \<inter> space M)" 34.382 - using disjoint_family A by (auto simp: disjoint_family_on_def) 34.383 + using \<open>disjoint_family A\<close> by (auto simp: disjoint_family_on_def) 34.384 ultimately show "(\<Sum>i. ?\<mu> (A i)) = ?\<mu> (\<Union>i. A i)" 34.385 using suminf_emeasure[OF _ **] A f 34.386 by (auto simp: comp_def vimage_UN) 34.387 @@ -1334,21 +1334,21 @@ 34.388 shows "emeasure M' {x\<in>space M'. lfp F (f x)} = (SUP i. emeasure M' {x\<in>space M'. (F ^^ i) (\<lambda>x. False) (f x)})" 34.389 proof (subst (1 2) emeasure_Collect_distr[symmetric, where X=f]) 34.390 show "f \<in> measurable M' M" "f \<in> measurable M' M" 34.391 - using f[OF P M] by auto 34.392 + using f[OF \<open>P M\<close>] by auto 34.393 { fix i show "Measurable.pred M ((F ^^ i) (\<lambda>x. False))" 34.394 - using P M by (induction i arbitrary: M) (auto intro!: *) } 34.395 + using \<open>P M\<close> by (induction i arbitrary: M) (auto intro!: *) } 34.396 show "Measurable.pred M (lfp F)" 34.397 - using P M cont * by (rule measurable_lfp_coinduct[of P]) 34.398 + using \<open>P M\<close> cont * by (rule measurable_lfp_coinduct[of P]) 34.399 34.400 have "emeasure (distr M' M f) {x \<in> space (distr M' M f). lfp F x} = 34.401 (SUP i. emeasure (distr M' M f) {x \<in> space (distr M' M f). (F ^^ i) (\<lambda>x. False) x})" 34.402 - using P M 34.403 + using \<open>P M\<close> 34.404 proof (coinduction arbitrary: M rule: emeasure_lfp') 34.405 case (measurable A N) then have "\<And>N. P N \<Longrightarrow> Measurable.pred (distr M' N f) A" 34.406 by metis 34.407 then have "\<And>N. P N \<Longrightarrow> Measurable.pred N A" 34.408 by simp 34.409 - with P N[THEN *] show ?case 34.410 + with \<open>P N\<close>[THEN *] show ?case 34.411 by auto 34.412 qed fact 34.413 then show "emeasure (distr M' M f) {x \<in> space M. lfp F x} = 34.414 @@ -1405,7 +1405,7 @@ 34.415 by (auto simp add: emeasure_distr measurable_space 34.416 intro!: arg_cong[where f="emeasure M"] measure_eqI) 34.417 34.418 -subsection {* Real measure values *} 34.419 +subsection \<open>Real measure values\<close> 34.420 34.421 lemma measure_nonneg: "0 \<le> measure M A" 34.422 using emeasure_nonneg[of M A] unfolding measure_def by (auto intro: real_of_ereal_pos) 34.423 @@ -1449,7 +1449,7 @@ 34.424 using measurable by (auto intro!: emeasure_mono) 34.425 hence "measure M ((A - B) \<union> B) = measure M (A - B) + measure M B" 34.426 using measurable finite by (rule_tac measure_Union) auto 34.427 - thus ?thesis using B \<subseteq> A by (auto simp: Un_absorb2) 34.428 + thus ?thesis using \<open>B \<subseteq> A\<close> by (auto simp: Un_absorb2) 34.429 qed 34.430 34.431 lemma measure_UNION: 34.432 @@ -1548,7 +1548,7 @@ 34.433 by (intro lim_real_of_ereal) simp 34.434 qed 34.435 34.436 -subsection {* Measure spaces with @{term "emeasure M (space M) < \<infinity>"} *} 34.437 +subsection \<open>Measure spaces with @{term "emeasure M (space M) < \<infinity>"}\<close> 34.438 34.439 locale finite_measure = sigma_finite_measure M for M + 34.440 assumes finite_emeasure_space: "emeasure M (space M) \<noteq> \<infinity>" 34.441 @@ -1606,7 +1606,7 @@ 34.442 assumes A: "range A \<subseteq> sets M" and sum: "summable (\<lambda>i. measure M (A i))" 34.443 shows "measure M (\<Union>i. A i) \<le> (\<Sum>i. measure M (A i))" 34.444 proof - 34.445 - from summable (\<lambda>i. measure M (A i)) 34.446 + from \<open>summable (\<lambda>i. measure M (A i))\<close> 34.447 have "(\<lambda>i. ereal (measure M (A i))) sums ereal (\<Sum>i. measure M (A i))" 34.448 by (simp add: sums_ereal) (rule summable_sums) 34.449 from sums_unique[OF this, symmetric] 34.450 @@ -1729,7 +1729,7 @@ 34.451 shows "measure M e = (\<Sum> x \<in> s. measure M (e \<inter> f x))" 34.452 proof - 34.453 have e: "e = (\<Union>i \<in> s. e \<inter> f i)" 34.454 - using e \<in> sets M sets.sets_into_space upper by blast 34.455 + using \<open>e \<in> sets M\<close> sets.sets_into_space upper by blast 34.456 hence "measure M e = measure M (\<Union>i \<in> s. e \<inter> f i)" by simp 34.457 also have "\<dots> = (\<Sum> x \<in> s. measure M (e \<inter> f x))" 34.458 proof (rule finite_measure_finite_Union) 34.459 @@ -1774,7 +1774,7 @@ 34.460 using bound[of x] sets_eq_imp_space_eq[OF sets] by (simp add: iter) 34.461 qed (auto simp add: iter le_fun_def INF_apply[abs_def] intro!: meas cont) 34.462 34.463 -subsection {* Counting space *} 34.464 +subsection \<open>Counting space\<close> 34.465 34.466 lemma strict_monoI_Suc: 34.467 assumes ord [simp]: "(\<And>n. f n < f (Suc n))" shows "strict_mono f" 34.468 @@ -1789,7 +1789,7 @@ 34.469 (is "_ = ?M X") 34.470 unfolding count_space_def 34.471 proof (rule emeasure_measure_of_sigma) 34.472 - show "X \<in> Pow A" using X \<subseteq> A by auto 34.473 + show "X \<in> Pow A" using \<open>X \<subseteq> A\<close> by auto 34.474 show "sigma_algebra A (Pow A)" by (rule sigma_algebra_Pow) 34.475 show positive: "positive (Pow A) ?M" 34.476 by (auto simp: positive_def) 34.477 @@ -1806,7 +1806,7 @@ 34.478 proof cases 34.479 assume "\<exists>i. \<forall>j\<ge>i. F i = F j" 34.480 then guess i .. note i = this 34.481 - { fix j from i incseq F have "F j \<subseteq> F i" 34.482 + { fix j from i \<open>incseq F\<close> have "F j \<subseteq> F i" 34.483 by (cases "i \<le> j") (auto simp: incseq_def) } 34.484 then have eq: "(\<Union>i. F i) = F i" 34.485 by auto 34.486 @@ -1815,11 +1815,11 @@ 34.487 next 34.488 assume "\<not> (\<exists>i. \<forall>j\<ge>i. F i = F j)" 34.489 then obtain f where f: "\<And>i. i \<le> f i" "\<And>i. F i \<noteq> F (f i)" by metis 34.490 - then have "\<And>i. F i \<subseteq> F (f i)" using incseq F by (auto simp: incseq_def) 34.491 + then have "\<And>i. F i \<subseteq> F (f i)" using \<open>incseq F\<close> by (auto simp: incseq_def) 34.492 with f have *: "\<And>i. F i \<subset> F (f i)" by auto 34.493 34.494 have "incseq (\<lambda>i. ?M (F i))" 34.495 - using incseq F unfolding incseq_def by (auto simp: card_mono dest: finite_subset) 34.496 + using \<open>incseq F\<close> unfolding incseq_def by (auto simp: card_mono dest: finite_subset) 34.497 then have "(\<lambda>i. ?M (F i)) ----> (SUP n. ?M (F n))" 34.498 by (rule LIMSEQ_SUP) 34.499 34.500 @@ -1830,9 +1830,9 @@ 34.501 case (Suc n) 34.502 then guess k .. note k = this 34.503 moreover have "finite (F k) \<Longrightarrow> finite (F (f k)) \<Longrightarrow> card (F k) < card (F (f k))" 34.504 - using F k \<subset> F (f k) by (simp add: psubset_card_mono) 34.505 + using \<open>F k \<subset> F (f k)\<close> by (simp add: psubset_card_mono) 34.506 moreover have "finite (F (f k)) \<Longrightarrow> finite (F k)" 34.507 - using k \<le> f k incseq F by (auto simp: incseq_def dest: finite_subset) 34.508 + using \<open>k \<le> f k\<close> \<open>incseq F\<close> by (auto simp: incseq_def dest: finite_subset) 34.509 ultimately show ?case 34.510 by (auto intro!: exI[of _ "f k"]) 34.511 qed auto 34.512 @@ -1926,7 +1926,7 @@ 34.513 show "sigma_finite_measure (count_space A)" .. 34.514 qed 34.515 34.516 -subsection {* Measure restricted to space *} 34.517 +subsection \<open>Measure restricted to space\<close> 34.518 34.519 lemma emeasure_restrict_space: 34.520 assumes "\<Omega> \<inter> space M \<in> sets M" "A \<subseteq> \<Omega>" 34.521 @@ -1936,7 +1936,7 @@ 34.522 show ?thesis 34.523 proof (rule emeasure_measure_of[OF restrict_space_def]) 34.524 show "op \<inter> \<Omega>  sets M \<subseteq> Pow (\<Omega> \<inter> space M)" "A \<in> sets (restrict_space M \<Omega>)" 34.525 - using A \<subseteq> \<Omega> A \<in> sets M sets.space_closed by (auto simp: sets_restrict_space) 34.526 + using \<open>A \<subseteq> \<Omega>\<close> \<open>A \<in> sets M\<close> sets.space_closed by (auto simp: sets_restrict_space) 34.527 show "positive (sets (restrict_space M \<Omega>)) (emeasure M)" 34.528 by (auto simp: positive_def emeasure_nonneg) 34.529 show "countably_additive (sets (restrict_space M \<Omega>)) (emeasure M)" 34.530 @@ -2085,7 +2085,7 @@ 34.531 finally show "emeasure M X = emeasure N X" . 34.532 qed fact 34.533 34.534 -subsection {* Null measure *} 34.535 +subsection \<open>Null measure\<close> 34.536 34.537 definition "null_measure M = sigma (space M) (sets M)" 34.538   35.1 --- a/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Mon Dec 07 16:48:10 2015 +0000 35.2 +++ b/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Mon Dec 07 20:19:59 2015 +0100 35.3 @@ -3,7 +3,7 @@ 35.4 Author: Armin Heller, TU MÃ¼nchen 35.5 *) 35.6 35.7 -section {* Lebesgue Integration for Nonnegative Functions *} 35.8 +section \<open>Lebesgue Integration for Nonnegative Functions\<close> 35.9 35.10 theory Nonnegative_Lebesgue_Integration 35.11 imports Measure_Space Borel_Space 35.12 @@ -23,13 +23,13 @@ 35.13 35.14 subsection "Simple function" 35.15 35.16 -text {* 35.17 +text \<open> 35.18 35.19 Our simple functions are not restricted to nonnegative real numbers. Instead 35.20 they are just functions with a finite range and are measurable when singleton 35.21 sets are measurable. 35.22 35.23 -*} 35.24 +\<close> 35.25 35.26 definition "simple_function M g \<longleftrightarrow> 35.27 finite (g  space M) \<and> 35.28 @@ -170,7 +170,7 @@ 35.29 have "(\<lambda>x. (f x, g x)) - {(f x, g x)} \<inter> space M = 35.30 (f - {f x} \<inter> space M) \<inter> (g - {g x} \<inter> space M)" 35.31 by auto 35.32 - with x \<in> space M show "(\<lambda>x. (f x, g x)) - {(f x, g x)} \<inter> space M \<in> sets M" 35.33 + with \<open>x \<in> space M\<close> show "(\<lambda>x. (f x, g x)) - {(f x, g x)} \<inter> space M \<in> sets M" 35.34 using assms unfolding simple_function_def by auto 35.35 qed 35.36 35.37 @@ -316,7 +316,7 @@ 35.38 ultimately show False by auto 35.39 qed 35.40 then show "max 0 (u x) \<le> y" using real ux by simp 35.41 - qed (insert 0 \<le> y, auto) 35.42 + qed (insert \<open>0 \<le> y\<close>, auto) 35.43 qed 35.44 qed auto 35.45 qed 35.46 @@ -425,7 +425,7 @@ 35.47 unfolding u_eq 35.48 proof (rule seq) 35.49 fix i show "P (U i)" 35.50 - using simple_function M (U i) nn[of i] not_inf[of _ i] 35.51 + using \<open>simple_function M (U i)\<close> nn[of i] not_inf[of _ i] 35.52 proof (induct rule: simple_function_induct_nn) 35.53 case (mult u c) 35.54 show ?case 35.55 @@ -441,7 +441,7 @@ 35.56 by auto 35.57 with mult have "P u" 35.58 by auto 35.59 - from x mult(5)[OF x \<in> space M] mult(1) mult(3)[of x] have "c < \<infinity>" 35.60 + from x mult(5)[OF \<open>x \<in> space M\<close>] mult(1) mult(3)[of x] have "c < \<infinity>" 35.61 by auto 35.62 with u_fin mult 35.63 show ?thesis 35.64 @@ -715,7 +715,7 @@ 35.65 shows "(\<integral>\<^sup>Sx. u x * indicator N x \<partial>M) = 0" 35.66 proof - 35.67 have "AE x in M. indicator N x = (0 :: ereal)" 35.68 - using N \<in> null_sets M by (auto simp: indicator_def intro!: AE_I[of _ _ N]) 35.69 + using \<open>N \<in> null_sets M\<close> by (auto simp: indicator_def intro!: AE_I[of _ _ N]) 35.70 then have "(\<integral>\<^sup>Sx. u x * indicator N x \<partial>M) = (\<integral>\<^sup>Sx. 0 \<partial>M)" 35.71 using assms apply (intro simple_integral_cong_AE) by auto 35.72 then show ?thesis by simp 35.73 @@ -741,7 +741,7 @@ 35.74 then show ?thesis by simp 35.75 qed 35.76 35.77 -subsection {* Integral on nonnegative functions *} 35.78 +subsection \<open>Integral on nonnegative functions\<close> 35.79 35.80 definition nn_integral :: "'a measure \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> ereal" ("integral\<^sup>N") where 35.81 "integral\<^sup>N M f = (SUP g : {g. simple_function M g \<and> g \<le> max 0 \<circ> f}. integral\<^sup>S M g)" 35.82 @@ -798,12 +798,12 @@ 35.83 have "real n \<le> ?y * (emeasure M) ?G" 35.84 using \<mu>_G \<mu>_G_pos by (cases "(emeasure M) ?G") (auto simp: field_simps) 35.85 also have "\<dots> = (\<integral>\<^sup>Sx. ?y * indicator ?G x \<partial>M)" 35.86 - using 0 \<le> ?y ?g ?y \<in> ?A gM 35.87 + using \<open>0 \<le> ?y\<close> \<open>?g ?y \<in> ?A\<close> gM 35.88 by (subst simple_integral_cmult_indicator) auto 35.89 - also have "\<dots> \<le> integral\<^sup>S M (?g ?y)" using ?g ?y \<in> ?A gM 35.90 + also have "\<dots> \<le> integral\<^sup>S M (?g ?y)" using \<open>?g ?y \<in> ?A\<close> gM 35.91 by (intro simple_integral_mono) auto 35.92 finally show "\<exists>i\<in>?A. real n \<le> integral\<^sup>S M i" 35.93 - using ?g ?y \<in> ?A by blast 35.94 + using \<open>?g ?y \<in> ?A\<close> by blast 35.95 qed 35.96 then show ?thesis by simp 35.97 qed 35.98 @@ -898,7 +898,7 @@ 35.99 hence "a \<noteq> 0" by auto 35.100 let ?B = "\<lambda>i. {x \<in> space M. a * u x \<le> f i x}" 35.101 have B: "\<And>i. ?B i \<in> sets M" 35.102 - using f simple_function M u[THEN borel_measurable_simple_function] by auto 35.103 + using f \<open>simple_function M u\<close>[THEN borel_measurable_simple_function] by auto 35.104 35.105 let ?uB = "\<lambda>i x. u x * indicator (?B i) x" 35.106 35.107 @@ -906,7 +906,7 @@ 35.108 proof safe 35.109 fix i x assume "a * u x \<le> f i x" 35.110 also have "\<dots> \<le> f (Suc i) x" 35.111 - using incseq f[THEN incseq_SucD] unfolding le_fun_def by auto 35.112 + using \<open>incseq f\<close>[THEN incseq_SucD] unfolding le_fun_def by auto 35.113 finally show "a * u x \<le> f (Suc i) x" . 35.114 qed } 35.115 note B_mono = this 35.116 @@ -924,24 +924,24 @@ 35.117 fix x i assume x: "x \<in> space M" 35.118 show "x \<in> (\<Union>i. ?B' (u x) i)" 35.119 proof cases 35.120 - assume "u x = 0" thus ?thesis using x \<in> space M f(3) by simp 35.121 + assume "u x = 0" thus ?thesis using \<open>x \<in> space M\<close> f(3) by simp 35.122 next 35.123 assume "u x \<noteq> 0" 35.124 - with a < 1 u_range[OF x \<in> space M] 35.125 + with \<open>a < 1\<close> u_range[OF \<open>x \<in> space M\<close>] 35.126 have "a * u x < 1 * u x" 35.127 by (intro ereal_mult_strict_right_mono) (auto simp: image_iff) 35.128 also have "\<dots> \<le> (SUP i. f i x)" using u(2) by (auto simp: le_fun_def) 35.129 finally obtain i where "a * u x < f i x" unfolding SUP_def 35.130 by (auto simp add: less_SUP_iff) 35.131 hence "a * u x \<le> f i x" by auto 35.132 - thus ?thesis using x \<in> space M by auto 35.133 + thus ?thesis using \<open>x \<in> space M\<close> by auto 35.134 qed 35.135 qed 35.136 then show "?thesis i" using SUP_emeasure_incseq[OF 1 2] by simp 35.137 qed 35.138 35.139 have "integral\<^sup>S M u = (SUP i. integral\<^sup>S M (?uB i))" 35.140 - unfolding simple_integral_indicator[OF B simple_function M u] 35.141 + unfolding simple_integral_indicator[OF B \<open>simple_function M u\<close>] 35.142 proof (subst SUP_ereal_setsum, safe) 35.143 fix x n assume "x \<in> space M" 35.144 with u_range show "incseq (\<lambda>i. u x * (emeasure M) (?B' (u x) i))" "\<And>i. 0 \<le> u x * (emeasure M) (?B' (u x) i)" 35.145 @@ -957,21 +957,21 @@ 35.146 proof (safe intro!: SUP_mono bexI) 35.147 fix i 35.148 have "a * integral\<^sup>S M (?uB i) = (\<integral>\<^sup>Sx. a * ?uB i x \<partial>M)" 35.149 - using B simple_function M u u_range 35.150 + using B \<open>simple_function M u\<close> u_range 35.151 by (subst simple_integral_mult) (auto split: split_indicator) 35.152 also have "\<dots> \<le> integral\<^sup>N M (f i)" 35.153 proof - 35.154 - have *: "simple_function M (\<lambda>x. a * ?uB i x)" using B 0 < a u(1) by auto 35.155 - show ?thesis using f(3) * u_range 0 < a 35.156 + have *: "simple_function M (\<lambda>x. a * ?uB i x)" using B \<open>0 < a\<close> u(1) by auto 35.157 + show ?thesis using f(3) * u_range \<open>0 < a\<close> 35.158 by (subst nn_integral_eq_simple_integral[symmetric]) 35.159 (auto intro!: nn_integral_mono split: split_indicator) 35.160 qed 35.161 finally show "a * integral\<^sup>S M (?uB i) \<le> integral\<^sup>N M (f i)" 35.162 by auto 35.163 next 35.164 - fix i show "0 \<le> \<integral>\<^sup>S x. ?uB i x \<partial>M" using B 0 < a u(1) u_range 35.165 + fix i show "0 \<le> \<integral>\<^sup>S x. ?uB i x \<partial>M" using B \<open>0 < a\<close> u(1) u_range 35.166 by (intro simple_integral_nonneg) (auto split: split_indicator) 35.167 - qed (insert 0 < a, auto) 35.168 + qed (insert \<open>0 < a\<close>, auto) 35.169 ultimately show "a * integral\<^sup>S M u \<le> ?S" by simp 35.170 qed 35.171 35.172 @@ -987,7 +987,7 @@ 35.173 lemma nn_integral_max_0: "(\<integral>\<^sup>+x. max 0 (f x) \<partial>M) = integral\<^sup>N M f" 35.174 by (simp add: le_fun_def nn_integral_def) 35.175 35.176 -text {* Beppo-Levi monotone convergence theorem *} 35.177 +text \<open>Beppo-Levi monotone convergence theorem\<close> 35.178 lemma nn_integral_monotone_convergence_SUP: 35.179 assumes f: "incseq f" "\<And>i. f i \<in> borel_measurable M" 35.180 shows "(\<integral>\<^sup>+ x. (SUP i. f i x) \<partial>M) = (SUP i. integral\<^sup>N M (f i))" 35.181 @@ -1104,11 +1104,11 @@ 35.182 note l = nn_integral_monotone_convergence_simple[OF this(2,5,1)] this 35.183 35.184 have inc: "incseq (\<lambda>i. a * integral\<^sup>S M (u i))" "incseq (\<lambda>i. integral\<^sup>S M (v i))" 35.185 - using u v 0 \<le> a 35.186 + using u v \<open>0 \<le> a\<close> 35.187 by (auto simp: incseq_Suc_iff le_fun_def 35.188 intro!: add_mono ereal_mult_left_mono simple_integral_mono) 35.189 have pos: "\<And>i. 0 \<le> integral\<^sup>S M (u i)" "\<And>i. 0 \<le> integral\<^sup>S M (v i)" "\<And>i. 0 \<le> a * integral\<^sup>S M (u i)" 35.190 - using u v 0 \<le> a by (auto simp: simple_integral_nonneg) 35.191 + using u v \<open>0 \<le> a\<close> by (auto simp: simple_integral_nonneg) 35.192 { fix i from pos[of i] have "a * integral\<^sup>S M (u i) \<noteq> -\<infinity>" "integral\<^sup>S M (v i) \<noteq> -\<infinity>" 35.193 by (auto split: split_if_asm) } 35.194 note not_MInf = this 35.195 @@ -1116,26 +1116,26 @@ 35.196 have l': "(SUP i. integral\<^sup>S M (l i)) = (SUP i. integral\<^sup>S M (?L' i))" 35.197 proof (rule SUP_simple_integral_sequences[OF l(3,6,2)]) 35.198 show "incseq ?L'" "\<And>i x. 0 \<le> ?L' i x" "\<And>i. simple_function M (?L' i)" 35.199 - using u v 0 \<le> a unfolding incseq_Suc_iff le_fun_def 35.200 + using u v \<open>0 \<le> a\<close> unfolding incseq_Suc_iff le_fun_def 35.201 by (auto intro!: add_mono ereal_mult_left_mono) 35.202 { fix x 35.203 - { fix i have "a * u i x \<noteq> -\<infinity>" "v i x \<noteq> -\<infinity>" "u i x \<noteq> -\<infinity>" using 0 \<le> a u(6)[of i x] v(6)[of i x] 35.204 + { fix i have "a * u i x \<noteq> -\<infinity>" "v i x \<noteq> -\<infinity>" "u i x \<noteq> -\<infinity>" using \<open>0 \<le> a\<close> u(6)[of i x] v(6)[of i x] 35.205 by auto } 35.206 then have "(SUP i. a * u i x + v i x) = a * (SUP i. u i x) + (SUP i. v i x)" 35.207 - using 0 \<le> a u(3) v(3) u(6)[of _ x] v(6)[of _ x] 35.208 - by (subst SUP_ereal_mult_left [symmetric, OF _ u(6) 0 \<le> a]) 35.209 + using \<open>0 \<le> a\<close> u(3) v(3) u(6)[of _ x] v(6)[of _ x] 35.210 + by (subst SUP_ereal_mult_left [symmetric, OF _ u(6) \<open>0 \<le> a\<close>]) 35.211 (auto intro!: SUP_ereal_add 35.212 simp: incseq_Suc_iff le_fun_def add_mono ereal_mult_left_mono) } 35.213 then show "AE x in M. (SUP i. l i x) = (SUP i. ?L' i x)" 35.214 - unfolding l(5) using 0 \<le> a u(5) v(5) l(5) f(2) g(2) 35.215 + unfolding l(5) using \<open>0 \<le> a\<close> u(5) v(5) l(5) f(2) g(2) 35.216 by (intro AE_I2) (auto split: split_max) 35.217 qed 35.218 also have "\<dots> = (SUP i. a * integral\<^sup>S M (u i) + integral\<^sup>S M (v i))" 35.219 - using u(2, 6) v(2, 6) 0 \<le> a by (auto intro!: arg_cong[where f="SUPREMUM UNIV"] ext) 35.220 + using u(2, 6) v(2, 6) \<open>0 \<le> a\<close> by (auto intro!: arg_cong[where f="SUPREMUM UNIV"] ext) 35.221 finally have "(\<integral>\<^sup>+ x. max 0 (a * f x + g x) \<partial>M) = a * (\<integral>\<^sup>+x. max 0 (f x) \<partial>M) + (\<integral>\<^sup>+x. max 0 (g x) \<partial>M)" 35.222 unfolding l(5)[symmetric] u(5)[symmetric] v(5)[symmetric] 35.223 unfolding l(1)[symmetric] u(1)[symmetric] v(1)[symmetric] 35.224 - apply (subst SUP_ereal_mult_left [symmetric, OF _ pos(1) 0 \<le> a]) 35.225 + apply (subst SUP_ereal_mult_left [symmetric, OF _ pos(1) \<open>0 \<le> a\<close>]) 35.226 apply simp 35.227 apply (subst SUP_ereal_add [symmetric, OF inc not_MInf]) 35.228 . 35.229 @@ -1146,12 +1146,12 @@ 35.230 assumes f: "f \<in> borel_measurable M" "0 \<le> c" 35.231 shows "(\<integral>\<^sup>+ x. c * f x \<partial>M) = c * integral\<^sup>N M f" 35.232 proof - 35.233 - have [simp]: "\<And>x. c * max 0 (f x) = max 0 (c * f x)" using 0 \<le> c 35.234 + have [simp]: "\<And>x. c * max 0 (f x) = max 0 (c * f x)" using \<open>0 \<le> c\<close> 35.235 by (auto split: split_max simp: ereal_zero_le_0_iff) 35.236 have "(\<integral>\<^sup>+ x. c * f x \<partial>M) = (\<integral>\<^sup>+ x. c * max 0 (f x) \<partial>M)" 35.237 by (simp add: nn_integral_max_0) 35.238 then show ?thesis 35.239 - using nn_integral_linear[OF _ _ 0 \<le> c, of "\<lambda>x. max 0 (f x)" _ "\<lambda>x. 0"] f 35.240 + using nn_integral_linear[OF _ _ \<open>0 \<le> c\<close>, of "\<lambda>x. max 0 (f x)" _ "\<lambda>x. 0"] f 35.241 by (auto simp: nn_integral_max_0) 35.242 qed 35.243 35.244 @@ -1252,7 +1252,7 @@ 35.245 (is "(emeasure M) ?A \<le> _ * ?PI") 35.246 proof - 35.247 have "?A \<in> sets M" 35.248 - using A \<in> sets M u by auto 35.249 + using \<open>A \<in> sets M\<close> u by auto 35.250 hence "(emeasure M) ?A = (\<integral>\<^sup>+ x. indicator ?A x \<partial>M)" 35.251 using nn_integral_indicator by simp 35.252 also have "\<dots> \<le> (\<integral>\<^sup>+ x. c * (u x * indicator A x) \<partial>M)" using u c 35.253 @@ -1279,7 +1279,7 @@ 35.254 using g by (subst nn_integral_cmult_indicator) auto 35.255 also have "\<dots> \<le> integral\<^sup>N M g" 35.256 using assms by (auto intro!: nn_integral_mono_AE simp: indicator_def) 35.257 - finally show False using integral\<^sup>N M g \<noteq> \<infinity> by auto 35.258 + finally show False using \<open>integral\<^sup>N M g \<noteq> \<infinity>\<close> by auto 35.259 qed 35.260 35.261 lemma nn_integral_PInf: 35.262 @@ -1371,7 +1371,7 @@ 35.263 finally show ?thesis . 35.264 qed 35.265 35.266 -text {* Fatou's lemma: convergence theorem on limes inferior *} 35.267 +text \<open>Fatou's lemma: convergence theorem on limes inferior\<close> 35.268 35.269 lemma nn_integral_liminf: 35.270 fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> ereal" 35.271 @@ -1624,7 +1624,7 @@ 35.272 fix n :: nat and x 35.273 assume *: "1 \<le> real n * u x" 35.274 also from gt_1[OF *] have "real n * u x \<le> real (Suc n) * u x" 35.275 - using 0 \<le> u x by (auto intro!: ereal_mult_right_mono) 35.276 + using \<open>0 \<le> u x\<close> by (auto intro!: ereal_mult_right_mono) 35.277 finally show "1 \<le> real (Suc n) * u x" by auto 35.278 qed 35.279 qed 35.280 @@ -1633,12 +1633,12 @@ 35.281 fix x assume "0 < u x" and [simp, intro]: "x \<in> space M" 35.282 show "x \<in> (\<Union>n. ?M n \<inter> ?A)" 35.283 proof (cases "u x") 35.284 - case (real r) with 0 < u x have "0 < r" by auto 35.285 + case (real r) with \<open>0 < u x\<close> have "0 < r" by auto 35.286 obtain j :: nat where "1 / r \<le> real j" using real_arch_simple .. 35.287 - hence "1 / r * r \<le> real j * r" unfolding mult_le_cancel_right using 0 < r by auto 35.288 - hence "1 \<le> real j * r" using real 0 < r by auto 35.289 - thus ?thesis using 0 < r real by (auto simp: one_ereal_def) 35.290 - qed (insert 0 < u x, auto) 35.291 + hence "1 / r * r \<le> real j * r" unfolding mult_le_cancel_right using \<open>0 < r\<close> by auto 35.292 + hence "1 \<le> real j * r" using real \<open>0 < r\<close> by auto 35.293 + thus ?thesis using \<open>0 < r\<close> real by (auto simp: one_ereal_def) 35.294 + qed (insert \<open>0 < u x\<close>, auto) 35.295 qed auto 35.296 finally have "(emeasure M) {x\<in>space M. 0 < u x} = 0" by simp 35.297 moreover 35.298 @@ -1729,7 +1729,7 @@ 35.299 then have "(\<lambda>i. ereal(if i < f x then 1 else 0)) sums (ereal(of_nat(f x)))" 35.300 unfolding sums_ereal . 35.301 moreover have "\<And>i. ereal (if i < f x then 1 else 0) = indicator (F i) x" 35.302 - using x \<in> space M by (simp add: one_ereal_def F_def) 35.303 + using \<open>x \<in> space M\<close> by (simp add: one_ereal_def F_def) 35.304 ultimately have "ereal(of_nat(f x)) = (\<Sum>i. indicator (F i) x)" 35.305 by (simp add: sums_iff) } 35.306 then have "(\<integral>\<^sup>+x. ereal (of_nat (f x)) \<partial>M) = (\<integral>\<^sup>+x. (\<Sum>i. indicator (F i) x) \<partial>M)" 35.307 @@ -1793,7 +1793,7 @@ 35.308 by (subst step) auto 35.309 qed (insert bound, auto simp add: le_fun_def INF_apply[abs_def] top_fun_def intro!: meas f g) 35.310 35.311 -subsection {* Integral under concrete measures *} 35.312 +subsection \<open>Integral under concrete measures\<close> 35.313 35.314 lemma nn_integral_empty: 35.315 assumes "space M = {}" 35.316 @@ -1804,7 +1804,7 @@ 35.317 thus ?thesis by simp 35.318 qed 35.319 35.320 -subsubsection {* Distributions *} 35.321 +subsubsection \<open>Distributions\<close> 35.322 35.323 lemma nn_integral_distr': 35.324 assumes T: "T \<in> measurable M M'" 35.325 @@ -1835,7 +1835,7 @@ 35.326 by (subst (1 2) nn_integral_max_0[symmetric]) 35.327 (simp add: nn_integral_distr') 35.328 35.329 -subsubsection {* Counting space *} 35.330 +subsubsection \<open>Counting space\<close> 35.331 35.332 lemma simple_function_count_space[simp]: 35.333 "simple_function (count_space A) f \<longleftrightarrow> finite (f  A)" 35.334 @@ -1868,7 +1868,7 @@ 35.335 proof - 35.336 have "(\<integral>\<^sup>+x. f x \<partial>count_space B) = (\<Sum>a | a \<in> B \<and> 0 < f a. f a)" 35.337 using assms(2,3) 35.338 - by (intro nn_integral_count_space finite_subset[OF _ finite A]) (auto simp: less_le) 35.339 + by (intro nn_integral_count_space finite_subset[OF _ \<open>finite A\<close>]) (auto simp: less_le) 35.340 also have "\<dots> = (\<Sum>a\<in>A. f a)" 35.341 using assms by (intro setsum.mono_neutral_cong_left) (auto simp: less_le) 35.342 finally show ?thesis . 35.343 @@ -1927,7 +1927,7 @@ 35.344 assume "infinite I" 35.345 then have [simp]: "I \<noteq> {}" 35.346 by auto 35.347 - note * = bij_betw_from_nat_into[OF countable I infinite I] 35.348 + note * = bij_betw_from_nat_into[OF \<open>countable I\<close> \<open>infinite I\<close>] 35.349 have **: "\<And>f. (\<And>i. 0 \<le> f i) \<Longrightarrow> (\<integral>\<^sup>+i. f i \<partial>count_space I) = (\<Sum>n. f (from_nat_into I n))" 35.350 by (simp add: nn_integral_bij_count_space[symmetric, OF *] nn_integral_count_space_nat) 35.351 show ?thesis 35.352 @@ -2147,7 +2147,7 @@ 35.353 finally show ?thesis . 35.354 qed 35.355 35.356 -subsubsection {* Measures with Restricted Space *} 35.357 +subsubsection \<open>Measures with Restricted Space\<close> 35.358 35.359 lemma simple_function_iff_borel_measurable: 35.360 fixes f :: "'a \<Rightarrow> 'x::{t2_space}" 35.361 @@ -2271,7 +2271,7 @@ 35.362 finally show ?thesis . 35.363 qed 35.364 35.365 -subsubsection {* Measure spaces with an associated density *} 35.366 +subsubsection \<open>Measure spaces with an associated density\<close> 35.367 35.368 definition density :: "'a measure \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where 35.369 "density M f = measure_of (space M) (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)" 35.370 @@ -2351,10 +2351,10 @@ 35.371 have "(\<integral>\<^sup>+x. f x * indicator A x \<partial>M) = 0 \<longleftrightarrow> 35.372 emeasure M {x \<in> space M. max 0 (f x) * indicator A x \<noteq> 0} = 0" 35.373 unfolding eq 35.374 - using f A \<in> sets M 35.375 + using f \<open>A \<in> sets M\<close> 35.376 by (intro nn_integral_0_iff) auto 35.377 also have "\<dots> \<longleftrightarrow> (AE x in M. max 0 (f x) * indicator A x = 0)" 35.378 - using f A \<in> sets M 35.379 + using f \<open>A \<in> sets M\<close> 35.380 by (intro AE_iff_measurable[OF _ refl, symmetric]) auto 35.381 also have "(AE x in M. max 0 (f x) * indicator A x = 0) \<longleftrightarrow> (AE x in M. x \<in> A \<longrightarrow> f x \<le> 0)" 35.382 by (auto simp add: indicator_def max_def split: split_if_asm) 35.383 @@ -2517,7 +2517,7 @@ 35.384 apply (intro nn_integral_cong, simp split: split_indicator) 35.385 done 35.386 35.387 -subsubsection {* Point measure *} 35.388 +subsubsection \<open>Point measure\<close> 35.389 35.390 definition point_measure :: "'a set \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where 35.391 "point_measure A f = density (count_space A) f" 35.392 @@ -2549,7 +2549,7 @@ 35.393 shows "emeasure (point_measure A f) X = (\<Sum>a|a\<in>X \<and> 0 < f a. f a)" 35.394 proof - 35.395 have "{a. (a \<in> X \<longrightarrow> a \<in> A \<and> 0 < f a) \<and> a \<in> X} = {a\<in>X. 0 < f a}" 35.396 - using X \<subseteq> A by auto 35.397 + using \<open>X \<subseteq> A\<close> by auto 35.398 with A show ?thesis 35.399 by (simp add: emeasure_density nn_integral_count_space ereal_zero_le_0_iff 35.400 point_measure_def indicator_def) 35.401 @@ -2593,7 +2593,7 @@ 35.402 integral\<^sup>N (point_measure A f) g = (\<Sum>a\<in>A. f a * g a)" 35.403 by (subst nn_integral_point_measure) (auto intro!: setsum.mono_neutral_left simp: less_le) 35.404 35.405 -subsubsection {* Uniform measure *} 35.406 +subsubsection \<open>Uniform measure\<close> 35.407 35.408 definition "uniform_measure M A = density M (\<lambda>x. indicator A x / emeasure M A)" 35.409 35.410 @@ -2666,7 +2666,7 @@ 35.411 shows "(AE x in uniform_measure M A. P x) \<longleftrightarrow> (AE x in M. x \<in> A \<longrightarrow> P x)" 35.412 proof - 35.413 have "A \<in> sets M" 35.414 - using emeasure M A \<noteq> 0 by (metis emeasure_notin_sets) 35.415 + using \<open>emeasure M A \<noteq> 0\<close> by (metis emeasure_notin_sets) 35.416 moreover have "\<And>x. 0 < indicator A x / emeasure M A \<longleftrightarrow> x \<in> A" 35.417 using emeasure_nonneg[of M A] assms 35.418 by (cases "emeasure M A") (auto split: split_indicator simp: one_ereal_def) 35.419 @@ -2674,7 +2674,7 @@ 35.420 unfolding uniform_measure_def by (simp add: AE_density) 35.421 qed 35.422 35.423 -subsubsection {* Null measure *} 35.424 +subsubsection \<open>Null measure\<close> 35.425 35.426 lemma null_measure_eq_density: "null_measure M = density M (\<lambda>_. 0)" 35.427 by (intro measure_eqI) (simp_all add: emeasure_density) 35.428 @@ -2689,7 +2689,7 @@ 35.429 by (simp add: density_def) (simp only: null_measure_def[symmetric] emeasure_null_measure) 35.430 qed simp 35.431 35.432 -subsubsection {* Uniform count measure *} 35.433 +subsubsection \<open>Uniform count measure\<close> 35.434 35.435 definition "uniform_count_measure A = point_measure A (\<lambda>x. 1 / card A)" 35.436   36.1 --- a/src/HOL/Probability/Probability_Mass_Function.thy Mon Dec 07 16:48:10 2015 +0000 36.2 +++ b/src/HOL/Probability/Probability_Mass_Function.thy Mon Dec 07 20:19:59 2015 +0100 36.3 @@ -54,16 +54,16 @@ 36.4 from this(3) have *: "\<And>x. x \<in> X \<Longrightarrow> ?M / Suc n \<le> ?m x" 36.5 by auto 36.6 { fix x assume "x \<in> X" 36.7 - from ?M \<noteq> 0 *[OF this] have "?m x \<noteq> 0" by (auto simp: field_simps measure_le_0_iff) 36.8 + from \<open>?M \<noteq> 0\<close> *[OF this] have "?m x \<noteq> 0" by (auto simp: field_simps measure_le_0_iff) 36.9 then have "{x} \<in> sets M" by (auto dest: measure_notin_sets) } 36.10 note singleton_sets = this 36.11 have "?M < (\<Sum>x\<in>X. ?M / Suc n)" 36.12 - using ?M \<noteq> 0 36.13 - by (simp add: card X = Suc (Suc n) of_nat_Suc field_simps less_le measure_nonneg) 36.14 + using \<open>?M \<noteq> 0\<close> 36.15 + by (simp add: \<open>card X = Suc (Suc n)\<close> of_nat_Suc field_simps less_le measure_nonneg) 36.16 also have "\<dots> \<le> (\<Sum>x\<in>X. ?m x)" 36.17 by (rule setsum_mono) fact 36.18 also have "\<dots> = measure M (\<Union>x\<in>X. {x})" 36.19 - using singleton_sets finite X 36.20 + using singleton_sets \<open>finite X\<close> 36.21 by (intro finite_measure_finite_Union[symmetric]) (auto simp: disjoint_family_on_def) 36.22 finally have "?M < measure M (\<Union>x\<in>X. {x})" . 36.23 moreover have "measure M (\<Union>x\<in>X. {x}) \<le> ?M" 36.24 @@ -399,7 +399,7 @@ 36.25 lemma bind_pmf_cong: 36.26 assumes "p = q" 36.27 shows "(\<And>x. x \<in> set_pmf q \<Longrightarrow> f x = g x) \<Longrightarrow> bind_pmf p f = bind_pmf q g" 36.28 - unfolding p = q[symmetric] measure_pmf_inject[symmetric] bind_pmf.rep_eq 36.29 + unfolding \<open>p = q\<close>[symmetric] measure_pmf_inject[symmetric] bind_pmf.rep_eq 36.30 by (auto simp: AE_measure_pmf_iff Pi_iff space_subprob_algebra subprob_space_measure_pmf 36.31 sets_bind[where N="count_space UNIV"] emeasure_bind[where N="count_space UNIV"] 36.32 intro!: nn_integral_cong_AE measure_eqI) 36.33 @@ -736,7 +736,7 @@ 36.34 lemma set_pmf_transfer[transfer_rule]: 36.35 assumes "bi_total A" 36.36 shows "rel_fun (pcr_pmf A) (rel_set A) (\<lambda>f. {x. f x \<noteq> 0}) set_pmf" 36.37 - using bi_total A 36.38 + using \<open>bi_total A\<close> 36.39 by (auto simp: pcr_pmf_def cr_pmf_def rel_fun_def rel_set_def bi_total_def Bex_def set_pmf_iff) 36.40 metis+ 36.41 36.42 @@ -1079,9 +1079,9 @@ 36.43 with in_set eq have "measure p {x. R x y} = measure q {y. R x y}" 36.44 by auto 36.45 moreover have "{y. R x y} = C" 36.46 - using assms x \<in> C C quotientD[of UNIV ?R C x] by (simp add: equivp_equiv) 36.47 + using assms \<open>x \<in> C\<close> C quotientD[of UNIV ?R C x] by (simp add: equivp_equiv) 36.48 moreover have "{x. R x y} = C" 36.49 - using assms y \<in> C C quotientD[of UNIV "?R" C y] sympD[of R] 36.50 + using assms \<open>y \<in> C\<close> C quotientD[of UNIV "?R" C y] sympD[of R] 36.51 by (auto simp add: equivp_equiv elim: equivpE) 36.52 ultimately show ?thesis 36.53 by auto 36.54 @@ -1114,7 +1114,7 @@ 36.55 36.56 fix x y assume "x \<in> set_pmf p" "y \<in> set_pmf q" "R x y" 36.57 have "{y. R x y} \<in> UNIV // ?R" "{x. R x y} = {y. R x y}" 36.58 - using assms R x y by (auto simp: quotient_def dest: equivp_symp equivp_transp) 36.59 + using assms \<open>R x y\<close> by (auto simp: quotient_def dest: equivp_symp equivp_transp) 36.60 with eq show "measure p {x. R x y} = measure q {y. R x y}" 36.61 by auto 36.62 qed 36.63 @@ -1198,7 +1198,7 @@ 36.64 by (force elim: rel_pmf.cases) 36.65 moreover have "set_pmf (return_pmf x) = {x}" 36.66 by simp 36.67 - with a \<in> M have "(x, a) \<in> pq" 36.68 + with \<open>a \<in> M\<close> have "(x, a) \<in> pq" 36.69 by (force simp: eq) 36.70 with * show "R x a" 36.71 by auto 36.72 @@ -1366,12 +1366,12 @@ 36.73 by (rule rel_pmf_joinI) 36.74 (auto simp add: pmf.rel_map intro: pmf.rel_mono[THEN le_funD, THEN le_funD, THEN le_boolD, THEN mp, OF _ pq] fg) 36.75 36.76 -text {* 36.77 +text \<open> 36.78 Proof that @{const rel_pmf} preserves orders. 36.79 Antisymmetry proof follows Thm. 1 in N. Saheb-Djahromi, Cpo's of measures for nondeterminism, 36.80 Theoretical Computer Science 12(1):19--37, 1980, 36.81 @{url "http://dx.doi.org/10.1016/0304-3975(80)90003-1"} 36.82 -*} 36.83 +\<close> 36.84 36.85 lemma 36.86 assumes *: "rel_pmf R p q"   37.1 --- a/src/HOL/Probability/Probability_Measure.thy Mon Dec 07 16:48:10 2015 +0000 37.2 +++ b/src/HOL/Probability/Probability_Measure.thy Mon Dec 07 20:19:59 2015 +0100 37.3 @@ -3,7 +3,7 @@ 37.4 Author: Armin Heller, TU MÃ¼nchen 37.5 *) 37.6 37.7 -section {*Probability measure*} 37.8 +section \<open>Probability measure\<close> 37.9 37.10 theory Probability_Measure 37.11 imports Lebesgue_Measure Radon_Nikodym 37.12 @@ -88,21 +88,21 @@ 37.13 proof 37.14 assume ae: "AE x in M. x \<in> A" 37.15 have "{x \<in> space M. x \<in> A} = A" "{x \<in> space M. x \<notin> A} = space M - A" 37.16 - using A \<in> events[THEN sets.sets_into_space] by auto 37.17 - with AE_E2[OF ae] A \<in> events have "1 - emeasure M A = 0" 37.18 + using \<open>A \<in> events\<close>[THEN sets.sets_into_space] by auto 37.19 + with AE_E2[OF ae] \<open>A \<in> events\<close> have "1 - emeasure M A = 0" 37.20 by (simp add: emeasure_compl emeasure_space_1) 37.21 then show "prob A = 1" 37.22 - using A \<in> events by (simp add: emeasure_eq_measure one_ereal_def) 37.23 + using \<open>A \<in> events\<close> by (simp add: emeasure_eq_measure one_ereal_def) 37.24 next 37.25 assume prob: "prob A = 1" 37.26 show "AE x in M. x \<in> A" 37.27 proof (rule AE_I) 37.28 show "{x \<in> space M. x \<notin> A} \<subseteq> space M - A" by auto 37.29 show "emeasure M (space M - A) = 0" 37.30 - using A \<in> events prob 37.31 + using \<open>A \<in> events\<close> prob 37.32 by (simp add: prob_compl emeasure_space_1 emeasure_eq_measure one_ereal_def) 37.33 show "space M - A \<in> events" 37.34 - using A \<in> events by auto 37.35 + using \<open>A \<in> events\<close> by auto 37.36 qed 37.37 qed 37.38 37.39 @@ -117,7 +117,7 @@ 37.40 lemma (in prob_space) AE_prob_1: 37.41 assumes "prob A = 1" shows "AE x in M. x \<in> A" 37.42 proof - 37.43 - from prob A = 1 have "A \<in> events" 37.44 + from \<open>prob A = 1\<close> have "A \<in> events" 37.45 by (metis measure_notin_sets zero_neq_one) 37.46 with AE_in_set_eq_1 assms show ?thesis by simp 37.47 qed 37.48 @@ -204,21 +204,21 @@ 37.49 by (elim disjE) (auto simp: subset_eq) 37.50 moreover 37.51 { fix y assume y: "y \<in> I" 37.52 - with q(2) open I have "Sup ((\<lambda>x. q x + ?F x * (y - x))  I) = q y" 37.53 + with q(2) \<open>open I\<close> have "Sup ((\<lambda>x. q x + ?F x * (y - x))  I) = q y" 37.54 by (auto intro!: cSup_eq_maximum convex_le_Inf_differential image_eqI [OF _ y] simp: interior_open simp del: Sup_image_eq Inf_image_eq) } 37.55 ultimately have "q (expectation X) = Sup ((\<lambda>x. q x + ?F x * (expectation X - x))  I)" 37.56 by simp 37.57 also have "\<dots> \<le> expectation (\<lambda>w. q (X w))" 37.58 proof (rule cSup_least) 37.59 show "(\<lambda>x. q x + ?F x * (expectation X - x))  I \<noteq> {}" 37.60 - using I \<noteq> {} by auto 37.61 + using \<open>I \<noteq> {}\<close> by auto 37.62 next 37.63 fix k assume "k \<in> (\<lambda>x. q x + ?F x * (expectation X - x))  I" 37.64 then guess x .. note x = this 37.65 have "q x + ?F x * (expectation X - x) = expectation (\<lambda>w. q x + ?F x * (X w - x))" 37.66 using prob_space by (simp add: X) 37.67 also have "\<dots> \<le> expectation (\<lambda>w. q (X w))" 37.68 - using x \<in> I open I X(2) 37.69 + using \<open>x \<in> I\<close> \<open>open I\<close> X(2) 37.70 apply (intro integral_mono_AE integrable_add integrable_mult_right integrable_diff 37.71 integrable_const X q) 37.72 apply (elim eventually_elim1) 37.73 @@ -230,7 +230,7 @@ 37.74 finally show "q (expectation X) \<le> expectation (\<lambda>x. q (X x))" . 37.75 qed 37.76 37.77 -subsection {* Introduce binder for probability *} 37.78 +subsection \<open>Introduce binder for probability\<close> 37.79 37.80 syntax 37.81 "_prob" :: "pttrn \<Rightarrow> logic \<Rightarrow> logic \<Rightarrow> logic" ("('\<P>'((/_ in _./ _)'))") 37.82 @@ -238,7 +238,7 @@ 37.83 translations 37.84 "\<P>(x in M. P)" => "CONST measure M {x \<in> CONST space M. P}" 37.85 37.86 -print_translation {* 37.87 +print_translation \<open> 37.88 let 37.89 fun to_pattern (Const (@{const_syntax Pair}, _)$ l $r) = 37.90 Syntax.const @{const_syntax Pair} :: to_pattern l @ to_pattern r 37.91 @@ -299,7 +299,7 @@ 37.92 in 37.93 [(@{const_syntax Sigma_Algebra.measure}, K tr')] 37.94 end 37.95 -*} 37.96 +\<close> 37.97 37.98 definition 37.99 "cond_prob M P Q = \<P>(\<omega> in M. P \<omega> \<and> Q \<omega>) / \<P>(\<omega> in M. Q \<omega>)" 37.100 @@ -495,7 +495,7 @@ 37.101 finally show ?thesis by simp 37.102 qed 37.103 37.104 -subsection {* Distributions *} 37.105 +subsection \<open>Distributions\<close> 37.106 37.107 definition "distributed M N X f \<longleftrightarrow> distr M N X = density N f \<and> 37.108 f \<in> borel_measurable N \<and> (AE x in N. 0 \<le> f x) \<and> X \<in> measurable M N"   38.1 --- a/src/HOL/Probability/Projective_Family.thy Mon Dec 07 16:48:10 2015 +0000 38.2 +++ b/src/HOL/Probability/Projective_Family.thy Mon Dec 07 20:19:59 2015 +0100 38.3 @@ -3,7 +3,7 @@ 38.4 Author: Johannes HÃ¶lzl, TU MÃ¼nchen 38.5 *) 38.6 38.7 -section {*Projective Family*} 38.8 +section \<open>Projective Family\<close> 38.9 38.10 theory Projective_Family 38.11 imports Finite_Product_Measure Giry_Monad 38.12 @@ -22,11 +22,11 @@ 38.13 proof cases 38.14 assume x: "x \<in> (\<Pi>\<^sub>E i\<in>J. S i)" 38.15 have "merge J (I - J) (x,y) \<in> (\<lambda>x. restrict x J) - A \<inter> (\<Pi>\<^sub>E i\<in>I. S i)" 38.16 - using y x J \<subseteq> I PiE_cancel_merge[of "J" "I - J" x y S] \<open>x\<in>A\<close> 38.17 + using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S] \<open>x\<in>A\<close> 38.18 by (auto simp del: PiE_cancel_merge simp add: Un_absorb1) 38.19 also have "\<dots> \<subseteq> (\<lambda>x. restrict x J) - B \<inter> (\<Pi>\<^sub>E i\<in>I. S i)" by fact 38.20 finally show "x \<in> B" 38.21 - using y x J \<subseteq> I PiE_cancel_merge[of "J" "I - J" x y S] \<open>x\<in>A\<close> eq 38.22 + using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S] \<open>x\<in>A\<close> eq 38.23 by (auto simp del: PiE_cancel_merge simp add: Un_absorb1) 38.24 qed (insert \<open>x\<in>A\<close> sets, auto) 38.25 qed 38.26 @@ -62,7 +62,7 @@ 38.27 show "(\<Pi>\<^sub>E i\<in>L. space (M i)) \<noteq> {}" 38.28 using \<open>L \<subseteq> I\<close> by (auto simp add: not_empty_M space_PiM[symmetric]) 38.29 show "(\<lambda>x. restrict x J) - X \<inter> (\<Pi>\<^sub>E i\<in>L. space (M i)) \<subseteq> (\<lambda>x. restrict x J) - Y \<inter> (\<Pi>\<^sub>E i\<in>L. space (M i))" 38.30 - using prod_emb L M J X \<subseteq> prod_emb L M J Y by (simp add: prod_emb_def) 38.31 + using \<open>prod_emb L M J X \<subseteq> prod_emb L M J Y\<close> by (simp add: prod_emb_def) 38.32 qed fact 38.33 38.34 lemma emb_injective:   39.1 --- a/src/HOL/Probability/Projective_Limit.thy Mon Dec 07 16:48:10 2015 +0000 39.2 +++ b/src/HOL/Probability/Projective_Limit.thy Mon Dec 07 20:19:59 2015 +0100 39.3 @@ -2,7 +2,7 @@ 39.4 Author: Fabian Immler, TU MÃ¼nchen 39.5 *) 39.6 39.7 -section {* Projective Limit *} 39.8 +section \<open>Projective Limit\<close> 39.9 39.10 theory Projective_Limit 39.11 imports 39.12 @@ -14,7 +14,7 @@ 39.13 "~~/src/HOL/Library/Diagonal_Subsequence" 39.14 begin 39.15 39.16 -subsection {* Sequences of Finite Maps in Compact Sets *} 39.17 +subsection \<open>Sequences of Finite Maps in Compact Sets\<close> 39.18 39.19 locale finmap_seqs_into_compact = 39.20 fixes K::"nat \<Rightarrow> (nat \<Rightarrow>\<^sub>F 'a::metric_space) set" and f::"nat \<Rightarrow> (nat \<Rightarrow>\<^sub>F 'a)" and M 39.21 @@ -31,8 +31,8 @@ 39.22 obtain k where "k \<in> K (Suc 0)" using f_in_K by auto 39.23 assume "\<forall>n. t \<notin> domain (f n)" 39.24 thus ?thesis 39.25 - by (auto intro!: exI[where x=1] image_eqI[OF _ k \<in> K (Suc 0)] 39.26 - simp: domain_K[OF k \<in> K (Suc 0)]) 39.27 + by (auto intro!: exI[where x=1] image_eqI[OF _ \<open>k \<in> K (Suc 0)\<close>] 39.28 + simp: domain_K[OF \<open>k \<in> K (Suc 0)\<close>]) 39.29 qed blast 39.30 39.31 lemma proj_in_KE: 39.32 @@ -52,9 +52,9 @@ 39.33 proof atomize_elim 39.34 have "subseq (op + m)" by (simp add: subseq_def) 39.35 have "\<forall>n. (f o (\<lambda>i. m + i)) n \<in> S" using assms by auto 39.36 - from seq_compactE[OF compact S[unfolded compact_eq_seq_compact_metric] this] guess l r . 39.37 + from seq_compactE[OF \<open>compact S\<close>[unfolded compact_eq_seq_compact_metric] this] guess l r . 39.38 hence "l \<in> S" "subseq ((\<lambda>i. m + i) o r) \<and> (f \<circ> ((\<lambda>i. m + i) o r)) ----> l" 39.39 - using subseq_o[OF subseq (op + m) subseq r] by (auto simp: o_def) 39.40 + using subseq_o[OF \<open>subseq (op + m)\<close> \<open>subseq r\<close>] by (auto simp: o_def) 39.41 thus "\<exists>l r. l \<in> S \<and> subseq r \<and> (f \<circ> r) ----> l" by blast 39.42 qed 39.43 39.44 @@ -84,7 +84,7 @@ 39.45 assume "\<exists>l. (\<lambda>i. ((f \<circ> s) i)\<^sub>F n) ----> l" 39.46 then obtain l where "((\<lambda>i. (f i)\<^sub>F n) o s) ----> l" 39.47 by (auto simp: o_def) 39.48 - hence "((\<lambda>i. (f i)\<^sub>F n) o s o r) ----> l" using subseq r 39.49 + hence "((\<lambda>i. (f i)\<^sub>F n) o s o r) ----> l" using \<open>subseq r\<close> 39.50 by (rule LIMSEQ_subseq_LIMSEQ) 39.51 thus "\<exists>l. (\<lambda>i. ((f \<circ> (s \<circ> r)) i)\<^sub>F n) ----> l" by (auto simp add: o_def) 39.52 qed 39.53 @@ -93,9 +93,9 @@ 39.54 thus ?thesis .. 39.55 qed 39.56 39.57 -subsection {* Daniell-Kolmogorov Theorem *} 39.58 +subsection \<open>Daniell-Kolmogorov Theorem\<close> 39.59 39.60 -text {* Existence of Projective Limit *} 39.61 +text \<open>Existence of Projective Limit\<close> 39.62 39.63 locale polish_projective = projective_family I P "\<lambda>_. borel::'a::polish_space measure" 39.64 for I::"'i set" and P 39.65 @@ -175,15 +175,15 @@ 39.66 hence "?SUP n - emeasure (P' n) K > 2 powr (-n) * ?a" 39.67 unfolding not_less[symmetric] by simp 39.68 hence "?SUP n - 2 powr (-n) * ?a > emeasure (P' n) K" 39.69 - using 0 < ?a by (auto simp add: ereal_less_minus_iff ac_simps) 39.70 + using \<open>0 < ?a\<close> by (auto simp add: ereal_less_minus_iff ac_simps) 39.71 thus "?SUP n - 2 powr (-n) * ?a \<ge> emeasure (P' n) K" by simp 39.72 qed 39.73 - hence "?SUP n + 0 \<le> ?SUP n - (2 powr (-n) * ?a)" using 0 < ?a by simp 39.74 + hence "?SUP n + 0 \<le> ?SUP n - (2 powr (-n) * ?a)" using \<open>0 < ?a\<close> by simp 39.75 hence "?SUP n + 0 \<le> ?SUP n + - (2 powr (-n) * ?a)" unfolding minus_ereal_def . 39.76 hence "0 \<le> - (2 powr (-n) * ?a)" 39.77 - using ?SUP n \<noteq> \<infinity> ?SUP n \<noteq> - \<infinity> 39.78 + using \<open>?SUP n \<noteq> \<infinity>\<close> \<open>?SUP n \<noteq> - \<infinity>\<close> 39.79 by (subst (asm) ereal_add_le_add_iff) (auto simp:) 39.80 - moreover have "ereal (2 powr - real n) * ?a > 0" using 0 < ?a 39.81 + moreover have "ereal (2 powr - real n) * ?a > 0" using \<open>0 < ?a\<close> 39.82 by (auto simp: ereal_zero_less_0_iff) 39.83 ultimately show False by simp 39.84 qed 39.85 @@ -195,7 +195,7 @@ 39.86 def K \<equiv> "\<lambda>n. fm n - K' n \<inter> space (Pi\<^sub>M (J n) (\<lambda>_. borel))" 39.87 have K_sets: "\<And>n. K n \<in> sets (Pi\<^sub>M (J n) (\<lambda>_. borel))" 39.88 unfolding K_def 39.89 - using compact_imp_closed[OF compact (K' _)] 39.90 + using compact_imp_closed[OF \<open>compact (K' _)\<close>] 39.91 by (intro measurable_sets[OF fm_measurable, of _ "Collect finite"]) 39.92 (auto simp: borel_eq_PiF_borel[symmetric]) 39.93 have K_B: "\<And>n. K n \<subseteq> B n" 39.94 @@ -204,7 +204,7 @@ 39.95 then have fm_in: "fm n x \<in> fm n  B n" 39.96 using K' by (force simp: K_def) 39.97 show "x \<in> B n" 39.98 - using x \<in> K n K_sets sets.sets_into_space J(1,2,3)[of n] inj_on_image_mem_iff[OF inj_on_fm] 39.99 + using \<open>x \<in> K n\<close> K_sets sets.sets_into_space J(1,2,3)[of n] inj_on_image_mem_iff[OF inj_on_fm] 39.100 by (metis (no_types) Int_iff K_def fm_in space_borel) 39.101 qed 39.102 def Z' \<equiv> "\<lambda>n. emb I (J n) (K n)" 39.103 @@ -224,7 +224,7 @@ 39.104 by (auto simp add: space_P sets_P) 39.105 assume "fm n x = fm n y" 39.106 note inj_onD[OF inj_on_fm[OF space_borel], 39.107 - OF fm n x = fm n y x \<in> space _ y \<in> space _] 39.108 + OF \<open>fm n x = fm n y\<close> \<open>x \<in> space _\<close> \<open>y \<in> space _\<close>] 39.109 with y show "x \<in> B n" by simp 39.110 qed 39.111 qed 39.112 @@ -243,39 +243,39 @@ 39.113 have "Y n = (\<Inter>i\<in>{1..n}. emb I (J n) (emb (J n) (J i) (K i)))" using J J_mono 39.114 by (auto simp: Y_def Z'_def) 39.115 also have "\<dots> = prod_emb I (\<lambda>_. borel) (J n) (\<Inter>i\<in>{1..n}. emb (J n) (J i) (K i))" 39.116 - using n \<ge> 1 39.117 + using \<open>n \<ge> 1\<close> 39.118 by (subst prod_emb_INT) auto 39.119 finally 39.120 have Y_emb: 39.121 "Y n = prod_emb I (\<lambda>_. borel) (J n) (\<Inter>i\<in>{1..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))" . 39.122 - hence "Y n \<in> generator" using J J_mono K_sets n \<ge> 1 39.123 + hence "Y n \<in> generator" using J J_mono K_sets \<open>n \<ge> 1\<close> 39.124 by (auto simp del: prod_emb_INT intro!: generator.intros) 39.125 have *: "\<mu>G (Z n) = P (J n) (B n)" 39.126 unfolding Z_def using J by (intro mu_G_spec) auto 39.127 then have "\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>" by auto 39.128 note * 39.129 moreover have *: "\<mu>G (Y n) = P (J n) (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i))" 39.130 - unfolding Y_emb using J J_mono K_sets n \<ge> 1 by (subst mu_G_spec) auto 39.131 + unfolding Y_emb using J J_mono K_sets \<open>n \<ge> 1\<close> by (subst mu_G_spec) auto 39.132 then have "\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>" by auto 39.133 note * 39.134 moreover have "\<mu>G (Z n - Y n) = 39.135 P (J n) (B n - (\<Inter>i\<in>{Suc 0..n}. prod_emb (J n) (\<lambda>_. borel) (J i) (K i)))" 39.136 - unfolding Z_def Y_emb prod_emb_Diff[symmetric] using J J_mono K_sets n \<ge> 1 39.137 + unfolding Z_def Y_emb prod_emb_Diff[symmetric] using J J_mono K_sets \<open>n \<ge> 1\<close> 39.138 by (subst mu_G_spec) (auto intro!: sets.Diff) 39.139 ultimately 39.140 have "\<mu>G (Z n) - \<mu>G (Y n) = \<mu>G (Z n - Y n)" 39.141 - using J J_mono K_sets n \<ge> 1 39.142 + using J J_mono K_sets \<open>n \<ge> 1\<close> 39.143 by (simp only: emeasure_eq_measure Z_def) 39.144 (auto dest!: bspec[where x=n] intro!: measure_Diff[symmetric] set_mp[OF K_B] 39.145 simp: extensional_restrict emeasure_eq_measure prod_emb_iff sets_P space_P) 39.146 also have subs: "Z n - Y n \<subseteq> (\<Union>i\<in>{1..n}. (Z i - Z' i))" 39.147 - using n \<ge> 1 unfolding Y_def UN_extend_simps(7) by (intro UN_mono Diff_mono Z_mono order_refl) auto 39.148 + using \<open>n \<ge> 1\<close> unfolding Y_def UN_extend_simps(7) by (intro UN_mono Diff_mono Z_mono order_refl) auto 39.149 have "Z n - Y n \<in> generator" "(\<Union>i\<in>{1..n}. (Z i - Z' i)) \<in> generator" 39.150 - using Z' _ \<in> generator Z _ \<in> generator Y _ \<in> generator by auto 39.151 + using \<open>Z' _ \<in> generator\<close> \<open>Z _ \<in> generator\<close> \<open>Y _ \<in> generator\<close> by auto 39.152 hence "\<mu>G (Z n - Y n) \<le> \<mu>G (\<Union>i\<in>{1..n}. (Z i - Z' i))" 39.153 using subs generator.additive_increasing[OF positive_mu_G additive_mu_G] 39.154 unfolding increasing_def by auto 39.155 - also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. \<mu>G (Z i - Z' i))" using Z _ \<in> generator Z' _ \<in> generator 39.156 + also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. \<mu>G (Z i - Z' i))" using \<open>Z _ \<in> generator\<close> \<open>Z' _ \<in> generator\<close> 39.157 by (intro generator.subadditive[OF positive_mu_G additive_mu_G]) auto 39.158 also have "\<dots> \<le> (\<Sum> i\<in>{1..n}. 2 powr -real i * ?a)" 39.159 proof (rule setsum_mono) 39.160 @@ -285,11 +285,11 @@ 39.161 also have "\<dots> = P (J i) (B i - K i)" 39.162 using J K_sets by (subst mu_G_spec) auto 39.163 also have "\<dots> = P (J i) (B i) - P (J i) (K i)" 39.164 - using K_sets J K _ \<subseteq> B _ by (simp add: emeasure_Diff) 39.165 + using K_sets J \<open>K _ \<subseteq> B _\<close> by (simp add: emeasure_Diff) 39.166 also have "\<dots> = P (J i) (B i) - P' i (K' i)" 39.167 unfolding K_def P'_def 39.168 by (auto simp: mapmeasure_PiF borel_eq_PiF_borel[symmetric] 39.169 - compact_imp_closed[OF compact (K' _)] space_PiM PiE_def) 39.170 + compact_imp_closed[OF \<open>compact (K' _)\<close>] space_PiM PiE_def) 39.171 also have "\<dots> \<le> ereal (2 powr - real i) * ?a" using K'(1)[of i] . 39.172 finally show "\<mu>G (Z i - Z' i) \<le> (2 powr - real i) * ?a" . 39.173 qed 39.174 @@ -310,12 +310,12 @@ 39.175 using J by (auto intro: INF_lower simp: Z_def mu_G_spec) 39.176 finally have "\<mu>G (Z n) - \<mu>G (Y n) < \<mu>G (Z n)" . 39.177 hence R: "\<mu>G (Z n) < \<mu>G (Z n) + \<mu>G (Y n)" 39.178 - using \<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity> by (simp add: ereal_minus_less) 39.179 - have "0 \<le> (- \<mu>G (Z n)) + \<mu>G (Z n)" using \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity> by auto 39.180 + using \<open>\<bar>\<mu>G (Y n)\<bar> \<noteq> \<infinity>\<close> by (simp add: ereal_minus_less) 39.181 + have "0 \<le> (- \<mu>G (Z n)) + \<mu>G (Z n)" using \<open>\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>\<close> by auto 39.182 also have "\<dots> < (- \<mu>G (Z n)) + (\<mu>G (Z n) + \<mu>G (Y n))" 39.183 - apply (rule ereal_less_add[OF _ R]) using \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity> by auto 39.184 + apply (rule ereal_less_add[OF _ R]) using \<open>\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>\<close> by auto 39.185 finally have "\<mu>G (Y n) > 0" 39.186 - using \<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity> by (auto simp: ac_simps zero_ereal_def[symmetric]) 39.187 + using \<open>\<bar>\<mu>G (Z n)\<bar> \<noteq> \<infinity>\<close> by (auto simp: ac_simps zero_ereal_def[symmetric]) 39.188 thus "Y n \<noteq> {}" using positive_mu_G by (auto simp add: positive_def) 39.189 qed 39.190 hence "\<forall>n\<in>{1..}. \<exists>y. y \<in> Y n" by auto 39.191 @@ -323,8 +323,8 @@ 39.192 { 39.193 fix t and n m::nat 39.194 assume "1 \<le> n" "n \<le> m" hence "1 \<le> m" by simp 39.195 - from Y_mono[OF m \<ge> n] y[OF 1 \<le> m] have "y m \<in> Y n" by auto 39.196 - also have "\<dots> \<subseteq> Z' n" using Y_Z'[OF 1 \<le> n] . 39.197 + from Y_mono[OF \<open>m \<ge> n\<close>] y[OF \<open>1 \<le> m\<close>] have "y m \<in> Y n" by auto 39.198 + also have "\<dots> \<subseteq> Z' n" using Y_Z'[OF \<open>1 \<le> n\<close>] . 39.199 finally 39.200 have "fm n (restrict (y m) (J n)) \<in> K' n" 39.201 unfolding Z'_def K_def prod_emb_iff by (simp add: Z'_def K_def prod_emb_iff) 39.202 @@ -354,12 +354,12 @@ 39.203 assume "n \<le> m" hence "Suc n \<le> Suc m" by simp 39.204 assume "t \<in> domain (fm (Suc n) (y (Suc n)))" 39.205 then obtain j where j: "t = Utn j" "j \<in> J (Suc n)" by auto 39.206 - hence "j \<in> J (Suc m)" using J_mono[OF Suc n \<le> Suc m] by auto 39.207 - have img: "fm (Suc n) (y (Suc m)) \<in> K' (Suc n)" using n \<le> m 39.208 + hence "j \<in> J (Suc m)" using J_mono[OF \<open>Suc n \<le> Suc m\<close>] by auto 39.209 + have img: "fm (Suc n) (y (Suc m)) \<in> K' (Suc n)" using \<open>n \<le> m\<close> 39.210 by (intro fm_in_K') simp_all 39.211 show "(fm (Suc m) (y (Suc m)))\<^sub>F t \<in> (\<lambda>k. (k)\<^sub>F t)  K' (Suc n)" 39.212 apply (rule image_eqI[OF _ img]) 39.213 - using j \<in> J (Suc n) j \<in> J (Suc m) 39.214 + using \<open>j \<in> J (Suc n)\<close> \<open>j \<in> J (Suc m)\<close> 39.215 unfolding j by (subst proj_fm, auto)+ 39.216 qed 39.217 have "\<forall>t. \<exists>z. (\<lambda>i. (fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^sub>F t) ----> z" 39.218 @@ -383,7 +383,7 @@ 39.219 fix e :: real assume "0 < e" 39.220 { fix i and x :: "'i \<Rightarrow> 'a" assume i: "i \<ge> n" 39.221 assume "t \<in> domain (fm n x)" 39.222 - hence "t \<in> domain (fm i x)" using J_mono[OF i \<ge> n] by auto 39.223 + hence "t \<in> domain (fm i x)" using J_mono[OF \<open>i \<ge> n\<close>] by auto 39.224 with i have "(fm i x)\<^sub>F t = (fm n x)\<^sub>F t" 39.225 using j by (auto simp: proj_fm dest!: inj_onD[OF inj_on_Utn]) 39.226 } note index_shift = this 39.227 @@ -394,7 +394,7 @@ 39.228 done 39.229 from z 39.230 have "\<exists>N. \<forall>i\<ge>N. dist ((fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^sub>F t) (z t) < e" 39.231 - unfolding tendsto_iff eventually_sequentially using 0 < e by auto 39.232 + unfolding tendsto_iff eventually_sequentially using \<open>0 < e\<close> by auto 39.233 then obtain N where N: "\<And>i. i \<ge> N \<Longrightarrow> 39.234 dist ((fm (Suc (diagseq i)) (y (Suc (diagseq i))))\<^sub>F t) (z t) < e" by auto 39.235 show "\<exists>N. \<forall>na\<ge>N. dist ((fm n (y (Suc (diagseq na))))\<^sub>F t) (z t) < e " 39.236 @@ -403,7 +403,7 @@ 39.237 hence "dist ((fm n (y (Suc (diagseq na))))\<^sub>F t) (z t) = 39.238 dist ((fm (Suc (diagseq na)) (y (Suc (diagseq na))))\<^sub>F t) (z t)" using t 39.239 by (subst index_shift[OF I]) auto 39.240 - also have "\<dots> < e" using max N n \<le> na by (intro N) simp 39.241 + also have "\<dots> < e" using \<open>max N n \<le> na\<close> by (intro N) simp 39.242 finally show "dist ((fm n (y (Suc (diagseq na))))\<^sub>F t) (z t) < e" . 39.243 qed 39.244 qed 39.245 @@ -416,14 +416,14 @@ 39.246 by (intro lim_subseq) (simp add: subseq_def) 39.247 moreover 39.248 have "(\<forall>i. ((\<lambda>i. fm n (y (Suc (diagseq i)))) o (\<lambda>i. i + n)) i \<in> K' n)" 39.249 - apply (auto simp add: o_def intro!: fm_in_K' 1 \<le> n le_SucI) 39.250 + apply (auto simp add: o_def intro!: fm_in_K' \<open>1 \<le> n\<close> le_SucI) 39.251 apply (rule le_trans) 39.252 apply (rule le_add2) 39.253 using seq_suble[OF subseq_diagseq] 39.254 apply auto 39.255 done 39.256 moreover 39.257 - from compact (K' n) have "closed (K' n)" by (rule compact_imp_closed) 39.258 + from \<open>compact (K' n)\<close> have "closed (K' n)" by (rule compact_imp_closed) 39.259 ultimately 39.260 have "finmap_of (Utn  J n) z \<in> K' n" 39.261 unfolding closed_sequential_limits by blast   40.1 --- a/src/HOL/Probability/Radon_Nikodym.thy Mon Dec 07 16:48:10 2015 +0000 40.2 +++ b/src/HOL/Probability/Radon_Nikodym.thy Mon Dec 07 20:19:59 2015 +0100 40.3 @@ -2,7 +2,7 @@ 40.4 Author: Johannes HÃ¶lzl, TU MÃ¼nchen 40.5 *) 40.6 40.7 -section {*Radon-Nikod{\'y}m derivative*} 40.8 +section \<open>Radon-Nikod{\'y}m derivative\<close> 40.9 40.10 theory Radon_Nikodym 40.11 imports Bochner_Integration 40.12 @@ -80,7 +80,7 @@ 40.13 by (cases rule: ereal2_cases[of "n N" "emeasure M (A N)"]) 40.14 (simp_all add: inverse_eq_divide power_divide one_ereal_def ereal_power_divide) 40.15 finally show "n N * emeasure M (A N) \<le> (1 / 2) ^ Suc N" . 40.16 - show "0 \<le> n N * emeasure M (A N)" using n[of N] A N \<in> sets M by (simp add: emeasure_nonneg) 40.17 + show "0 \<le> n N * emeasure M (A N)" using n[of N] \<open>A N \<in> sets M\<close> by (simp add: emeasure_nonneg) 40.18 qed 40.19 finally show "integral\<^sup>N M ?h \<noteq> \<infinity>" unfolding suminf_half_series_ereal by auto 40.20 next 40.21 @@ -121,12 +121,12 @@ 40.22 and "absolutely_continuous M M'" "AE x in M. P x" 40.23 shows "AE x in M'. P x" 40.24 proof - 40.25 - from AE x in M. P x obtain N where N: "N \<in> null_sets M" "{x\<in>space M. \<not> P x} \<subseteq> N" 40.26 + from \<open>AE x in M. P x\<close> obtain N where N: "N \<in> null_sets M" "{x\<in>space M. \<not> P x} \<subseteq> N" 40.27 unfolding eventually_ae_filter by auto 40.28 show "AE x in M'. P x" 40.29 proof (rule AE_I') 40.30 show "{x\<in>space M'. \<not> P x} \<subseteq> N" using sets_eq_imp_space_eq[OF sets_eq] N(2) by simp 40.31 - from absolutely_continuous M M' show "N \<in> null_sets M'" 40.32 + from \<open>absolutely_continuous M M'\<close> show "N \<in> null_sets M'" 40.33 using N unfolding absolutely_continuous_def sets_eq null_sets_def by auto 40.34 qed 40.35 qed 40.36 @@ -167,14 +167,14 @@ 40.37 fix B assume "B \<in> sets M \<and> B \<subseteq> space M - A n \<and> ?d B \<le> - e" 40.38 hence "A n \<inter> B = {}" "B \<in> sets M" and dB: "?d B \<le> -e" by auto 40.39 hence "?d (A n \<union> B) = ?d (A n) + ?d B" 40.40 - using A n \<in> sets M finite_measure_Union M'.finite_measure_Union by (simp add: sets_eq) 40.41 + using \<open>A n \<in> sets M\<close> finite_measure_Union M'.finite_measure_Union by (simp add: sets_eq) 40.42 also have "\<dots> \<le> ?d (A n) - e" using dB by simp 40.43 finally show "?d (A n \<union> B) \<le> ?d (A n) - e" . 40.44 qed } 40.45 note dA_epsilon = this 40.46 { fix n have "?d (A (Suc n)) \<le> ?d (A n)" 40.47 proof (cases "\<exists>B. B\<in>sets M \<and> B \<subseteq> space M - A n \<and> ?d B \<le> - e") 40.48 - case True from dA_epsilon[OF this] show ?thesis using 0 < e by simp 40.49 + case True from dA_epsilon[OF this] show ?thesis using \<open>0 < e\<close> by simp 40.50 next 40.51 case False 40.52 hence "\<forall>B\<in>sets M. B \<subseteq> space M - A n \<longrightarrow> -e < ?d B" by (auto simp: not_le) 40.53 @@ -214,13 +214,13 @@ 40.54 fix n show "- ?d (A n) \<le> - ?d (A (Suc n))" using dA_mono[of n] by auto 40.55 qed 40.56 have A: "incseq A" by (auto intro!: incseq_SucI) 40.57 - from finite_Lim_measure_incseq[OF _ A] range A \<subseteq> sets M 40.58 + from finite_Lim_measure_incseq[OF _ A] \<open>range A \<subseteq> sets M\<close> 40.59 M'.finite_Lim_measure_incseq[OF _ A] 40.60 have convergent: "(\<lambda>i. ?d (A i)) ----> ?d (\<Union>i. A i)" 40.61 by (auto intro!: tendsto_diff simp: sets_eq) 40.62 obtain n :: nat where "- ?d (\<Union>i. A i) / e < real n" using reals_Archimedean2 by auto 40.63 moreover from order_trans[OF decseq_le[OF decseq convergent] dA_less] 40.64 - have "real n \<le> - ?d (\<Union>i. A i) / e" using 0<e by (simp add: field_simps) 40.65 + have "real n \<le> - ?d (\<Union>i. A i) / e" using \<open>0<e\<close> by (simp add: field_simps) 40.66 ultimately show ?thesis by auto 40.67 qed 40.68 qed 40.69 @@ -258,7 +258,7 @@ 40.70 by (auto simp add: mono_iff_le_Suc) 40.71 show ?thesis 40.72 proof (safe intro!: bexI[of _ "\<Inter>i. A i"]) 40.73 - show "(\<Inter>i. A i) \<in> sets M" using \<And>n. A n \<in> sets M by auto 40.74 + show "(\<Inter>i. A i) \<in> sets M" using \<open>\<And>n. A n \<in> sets M\<close> by auto 40.75 have "decseq A" using A by (auto intro!: decseq_SucI) 40.76 from A(1) finite_Lim_measure_decseq[OF _ this] N.finite_Lim_measure_decseq[OF _ this] 40.77 have "(\<lambda>i. ?d (A i)) ----> ?d (\<Inter>i. A i)" by (auto intro!: tendsto_diff simp: sets_eq) 40.78 @@ -299,10 +299,10 @@ 40.79 let ?A = "{x \<in> space M. f x \<le> g x}" 40.80 have "?A \<in> sets M" using f g unfolding G_def by auto 40.81 fix A assume "A \<in> sets M" 40.82 - hence sets: "?A \<inter> A \<in> sets M" "(space M - ?A) \<inter> A \<in> sets M" using ?A \<in> sets M by auto 40.83 + hence sets: "?A \<inter> A \<in> sets M" "(space M - ?A) \<inter> A \<in> sets M" using \<open>?A \<in> sets M\<close> by auto 40.84 hence sets': "?A \<inter> A \<in> sets N" "(space M - ?A) \<inter> A \<in> sets N" by (auto simp: sets_eq) 40.85 have union: "((?A \<inter> A) \<union> ((space M - ?A) \<inter> A)) = A" 40.86 - using sets.sets_into_space[OF A \<in> sets M] by auto 40.87 + using sets.sets_into_space[OF \<open>A \<in> sets M\<close>] by auto 40.88 have "\<And>x. x \<in> space M \<Longrightarrow> max (g x) (f x) * indicator A x = 40.89 g x * indicator (?A \<inter> A) x + f x * indicator ((space M - ?A) \<inter> A) x" 40.90 by (auto simp: indicator_def max_def) 40.91 @@ -333,11 +333,11 @@ 40.92 (\<integral>\<^sup>+x. (SUP i. f i x * indicator A x) \<partial>M)" 40.93 by (intro nn_integral_cong) (simp split: split_indicator) 40.94 also have "\<dots> = (SUP i. (\<integral>\<^sup>+x. f i x * indicator A x \<partial>M))" 40.95 - using incseq f f A \<in> sets M 40.96 + using \<open>incseq f\<close> f \<open>A \<in> sets M\<close> 40.97 by (intro nn_integral_monotone_convergence_SUP) 40.98 (auto simp: G_def incseq_Suc_iff le_fun_def split: split_indicator) 40.99 finally show "(\<integral>\<^sup>+x. (SUP i. f i x) * indicator A x \<partial>M) \<le> N A" 40.100 - using f A \<in> sets M by (auto intro!: SUP_least simp: G_def) 40.101 + using f \<open>A \<in> sets M\<close> by (auto intro!: SUP_least simp: G_def) 40.102 qed } 40.103 note SUP_in_G = this 40.104 let ?y = "SUP g : G. integral\<^sup>N M g" 40.105 @@ -347,7 +347,7 @@ 40.106 from this[THEN bspec, OF sets.top] show "integral\<^sup>N M g \<le> N (space M)" 40.107 by (simp cong: nn_integral_cong) 40.108 qed 40.109 - from SUP_countable_SUP [OF G \<noteq> {}, of "integral\<^sup>N M"] guess ys .. note ys = this 40.110 + from SUP_countable_SUP [OF \<open>G \<noteq> {}\<close>, of "integral\<^sup>N M"] guess ys .. note ys = this 40.111 then have "\<forall>n. \<exists>g. g\<in>G \<and> integral\<^sup>N M g = ys n" 40.112 proof safe 40.113 fix n assume "range ys \<subseteq> integral\<^sup>N M  G" 40.114 @@ -365,7 +365,7 @@ 40.115 case 0 thus ?case by simp fact 40.116 next 40.117 case (Suc i) 40.118 - with Suc gs_not_empty gs (Suc i) \<in> G show ?case 40.119 + with Suc gs_not_empty \<open>gs (Suc i) \<in> G\<close> show ?case 40.120 by (auto simp add: atMost_Suc intro!: max_in_G) 40.121 qed } 40.122 note g_in_G = this 40.123 @@ -374,7 +374,7 @@ 40.124 from SUP_in_G[OF this g_in_G] have [measurable]: "f \<in> G" unfolding f_def . 40.125 then have [simp, intro]: "f \<in> borel_measurable M" unfolding G_def by auto 40.126 have "integral\<^sup>N M f = (SUP i. integral\<^sup>N M (?g i))" unfolding f_def 40.127 - using g_in_G incseq ?g 40.128 + using g_in_G \<open>incseq ?g\<close> 40.129 by (auto intro!: nn_integral_monotone_convergence_SUP simp: G_def) 40.130 also have "\<dots> = ?y" 40.131 proof (rule antisym) 40.132 @@ -385,12 +385,12 @@ 40.133 qed 40.134 finally have int_f_eq_y: "integral\<^sup>N M f = ?y" . 40.135 have "\<And>x. 0 \<le> f x" 40.136 - unfolding f_def using \<And>i. gs i \<in> G 40.137 + unfolding f_def using \<open>\<And>i. gs i \<in> G\<close> 40.138 by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) 40.139 let ?t = "\<lambda>A. N A - (\<integral>\<^sup>+x. ?F A x \<partial>M)" 40.140 let ?M = "diff_measure N (density M f)" 40.141 have f_le_N: "\<And>A. A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+x. ?F A x \<partial>M) \<le> N A" 40.142 - using f \<in> G unfolding G_def by auto 40.143 + using \<open>f \<in> G\<close> unfolding G_def by auto 40.144 have emeasure_M: "\<And>A. A \<in> sets M \<Longrightarrow> emeasure ?M A = ?t A" 40.145 proof (subst emeasure_diff_measure) 40.146 from f_le_N[of "space M"] show "finite_measure N" "finite_measure (density M f)" 40.147 @@ -406,9 +406,9 @@ 40.148 have ac: "absolutely_continuous M ?M" unfolding absolutely_continuous_def 40.149 proof 40.150 fix A assume A_M: "A \<in> null_sets M" 40.151 - with absolutely_continuous M N have A_N: "A \<in> null_sets N" 40.152 + with \<open>absolutely_continuous M N\<close> have A_N: "A \<in> null_sets N" 40.153 unfolding absolutely_continuous_def by auto 40.154 - moreover from A_M A_N have "(\<integral>\<^sup>+ x. ?F A x \<partial>M) \<le> N A" using f \<in> G by (auto simp: G_def) 40.155 + moreover from A_M A_N have "(\<integral>\<^sup>+ x. ?F A x \<partial>M) \<le> N A" using \<open>f \<in> G\<close> by (auto simp: G_def) 40.156 ultimately have "N A - (\<integral>\<^sup>+ x. ?F A x \<partial>M) = 0" 40.157 using nn_integral_nonneg[of M] by (auto intro!: antisym) 40.158 then show "A \<in> null_sets ?M" 40.159 @@ -430,7 +430,7 @@ 40.160 using emeasure_nonneg[of M "space M"] by (simp add: le_less) 40.161 moreover 40.162 have "(\<integral>\<^sup>+x. f x * indicator (space M) x \<partial>M) \<le> N (space M)" 40.163 - using f \<in> G unfolding G_def by auto 40.164 + using \<open>f \<in> G\<close> unfolding G_def by auto 40.165 hence "(\<integral>\<^sup>+x. f x * indicator (space M) x \<partial>M) \<noteq> \<infinity>" 40.166 using M'.finite_emeasure_space by auto 40.167 moreover 40.168 @@ -452,31 +452,31 @@ 40.169 note bM_le_t = this 40.170 let ?f0 = "\<lambda>x. f x + b * indicator A0 x" 40.171 { fix A assume A: "A \<in> sets M" 40.172 - hence "A \<inter> A0 \<in> sets M" using A0 \<in> sets M by auto 40.173 + hence "A \<inter> A0 \<in> sets M" using \<open>A0 \<in> sets M\<close> by auto 40.174 have "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) = 40.175 (\<integral>\<^sup>+x. f x * indicator A x + b * indicator (A \<inter> A0) x \<partial>M)" 40.176 by (auto intro!: nn_integral_cong split: split_indicator) 40.177 hence "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) = 40.178 (\<integral>\<^sup>+x. f x * indicator A x \<partial>M) + b * emeasure M (A \<inter> A0)" 40.179 - using A0 \<in> sets M A \<inter> A0 \<in> sets M A b f \<in> G 40.180 + using \<open>A0 \<in> sets M\<close> \<open>A \<inter> A0 \<in> sets M\<close> A b \<open>f \<in> G\<close> 40.181 by (simp add: nn_integral_add nn_integral_cmult_indicator G_def) } 40.182 note f0_eq = this 40.183 { fix A assume A: "A \<in> sets M" 40.184 - hence "A \<inter> A0 \<in> sets M" using A0 \<in> sets M by auto 40.185 - have f_le_v: "(\<integral>\<^sup>+x. ?F A x \<partial>M) \<le> N A" using f \<in> G A unfolding G_def by auto 40.186 + hence "A \<inter> A0 \<in> sets M" using \<open>A0 \<in> sets M\<close> by auto 40.187 + have f_le_v: "(\<integral>\<^sup>+x. ?F A x \<partial>M) \<le> N A" using \<open>f \<in> G\<close> A unfolding G_def by auto 40.188 note f0_eq[OF A] 40.189 also have "(\<integral>\<^sup>+x. ?F A x \<partial>M) + b * emeasure M (A \<inter> A0) \<le> (\<integral>\<^sup>+x. ?F A x \<partial>M) + ?M (A \<inter> A0)" 40.190 - using bM_le_t[OF A \<inter> A0 \<in> sets M] A \<in> sets M A0 \<in> sets M 40.191 + using bM_le_t[OF \<open>A \<inter> A0 \<in> sets M\<close>] \<open>A \<in> sets M\<close> \<open>A0 \<in> sets M\<close> 40.192 by (auto intro!: add_left_mono) 40.193 also have "\<dots> \<le> (\<integral>\<^sup>+x. f x * indicator A x \<partial>M) + ?M A" 40.194 - using emeasure_mono[of "A \<inter> A0" A ?M] A \<in> sets M A0 \<in> sets M 40.195 + using emeasure_mono[of "A \<inter> A0" A ?M] \<open>A \<in> sets M\<close> \<open>A0 \<in> sets M\<close> 40.196 by (auto intro!: add_left_mono simp: sets_eq) 40.197 also have "\<dots> \<le> N A" 40.198 - unfolding emeasure_M[OF A \<in> sets M] 40.199 + unfolding emeasure_M[OF \<open>A \<in> sets M\<close>] 40.200 using f_le_v N.emeasure_eq_measure[of A] nn_integral_nonneg[of M "?F A"] 40.201 by (cases "\<integral>\<^sup>+x. ?F A x \<partial>M", cases "N A") auto 40.202 finally have "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) \<le> N A" . } 40.203 - hence "?f0 \<in> G" using A0 \<in> sets M b f \<in> G by (auto simp: G_def) 40.204 + hence "?f0 \<in> G" using \<open>A0 \<in> sets M\<close> b \<open>f \<in> G\<close> by (auto simp: G_def) 40.205 have int_f_finite: "integral\<^sup>N M f \<noteq> \<infinity>" 40.206 by (metis N.emeasure_finite ereal_infty_less_eq2(1) int_f_eq_y y_le) 40.207 have "0 < ?M (space M) - emeasure ?Mb (space M)" 40.208 @@ -484,25 +484,25 @@ 40.209 by (simp add: b emeasure_density_const) 40.210 (simp add: M'.emeasure_eq_measure emeasure_eq_measure pos_M b_def) 40.211 also have "\<dots> \<le> ?M A0 - b * emeasure M A0" 40.212 - using space_less_A0 A0 \<in> sets M b 40.213 + using space_less_A0 \<open>A0 \<in> sets M\<close> b 40.214 by (cases b) (auto simp add: b emeasure_density_const sets_eq M'.emeasure_eq_measure emeasure_eq_measure) 40.215 finally have 1: "b * emeasure M A0 < ?M A0" 40.216 - by (metis M'.emeasure_real A0 \<in> sets M bM_le_t diff_self ereal_less(1) ereal_minus(1) 40.217 + by (metis M'.emeasure_real \<open>A0 \<in> sets M\<close> bM_le_t diff_self ereal_less(1) ereal_minus(1) 40.218 less_eq_ereal_def mult_zero_left not_square_less_zero subset_refl zero_ereal_def) 40.219 with b have "0 < ?M A0" 40.220 by (metis M'.emeasure_real MInfty_neq_PInfty(1) emeasure_real ereal_less_eq(5) ereal_zero_times 40.221 ereal_mult_eq_MInfty ereal_mult_eq_PInfty ereal_zero_less_0_iff less_eq_ereal_def) 40.222 - then have "emeasure M A0 \<noteq> 0" using ac A0 \<in> sets M 40.223 + then have "emeasure M A0 \<noteq> 0" using ac \<open>A0 \<in> sets M\<close> 40.224 by (auto simp: absolutely_continuous_def null_sets_def) 40.225 then have "0 < emeasure M A0" using emeasure_nonneg[of M A0] by auto 40.226 hence "0 < b * emeasure M A0" using b by (auto simp: ereal_zero_less_0_iff) 40.227 with int_f_finite have "?y + 0 < integral\<^sup>N M f + b * emeasure M A0" unfolding int_f_eq_y 40.228 - using f \<in> G 40.229 + using \<open>f \<in> G\<close> 40.230 by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 nn_integral_nonneg) 40.231 - also have "\<dots> = integral\<^sup>N M ?f0" using f0_eq[OF sets.top] A0 \<in> sets M sets.sets_into_space 40.232 + also have "\<dots> = integral\<^sup>N M ?f0" using f0_eq[OF sets.top] \<open>A0 \<in> sets M\<close> sets.sets_into_space 40.233 by (simp cong: nn_integral_cong) 40.234 finally have "?y < integral\<^sup>N M ?f0" by simp 40.235 - moreover from ?f0 \<in> G have "integral\<^sup>N M ?f0 \<le> ?y" by (auto intro!: SUP_upper) 40.236 + moreover from \<open>?f0 \<in> G\<close> have "integral\<^sup>N M ?f0 \<le> ?y" by (auto intro!: SUP_upper) 40.237 ultimately show False by auto 40.238 qed 40.239 let ?f = "\<lambda>x. max 0 (f x)" 40.240 @@ -512,7 +512,7 @@ 40.241 by (simp add: sets_eq) 40.242 fix A assume A: "A\<in>sets (density M ?f)" 40.243 then show "emeasure (density M ?f) A = emeasure N A" 40.244 - using f \<in> G A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] 40.245 + using \<open>f \<in> G\<close> A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] 40.246 by (cases "integral\<^sup>N M (?F A)") 40.247 (auto intro!: antisym simp add: emeasure_density G_def emeasure_M density_max_0[symmetric]) 40.248 qed auto 40.249 @@ -599,7 +599,7 @@ 40.250 also have "\<dots> = (SUP i. emeasure M (?O i \<union> A))" 40.251 proof (rule SUP_emeasure_incseq[of "\<lambda>i. ?O i \<union> A", symmetric, simplified]) 40.252 show "range (\<lambda>i. ?O i \<union> A) \<subseteq> sets M" 40.253 - using N A \<noteq> \<infinity> O_sets A by auto 40.254 + using \<open>N A \<noteq> \<infinity>\<close> O_sets A by auto 40.255 qed (fastforce intro!: incseq_SucI) 40.256 also have "\<dots> \<le> ?a" 40.257 proof (safe intro!: SUP_least) 40.258 @@ -609,13 +609,13 @@ 40.259 from O_in_G[of i] have "N (?O i \<union> A) \<le> N (?O i) + N A" 40.260 using emeasure_subadditive[of "?O i" N A] A O_sets by (auto simp: sets_eq) 40.261 with O_in_G[of i] show "N (?O i \<union> A) \<noteq> \<infinity>" 40.262 - using N A \<noteq> \<infinity> by auto 40.263 + using \<open>N A \<noteq> \<infinity>\<close> by auto 40.264 qed 40.265 then show "emeasure M (?O i \<union> A) \<le> ?a" by (rule SUP_upper) 40.266 qed 40.267 finally have "emeasure M A = 0" 40.268 unfolding a_eq using measure_nonneg[of M A] by (simp add: emeasure_eq_measure) 40.269 - with emeasure M A \<noteq> 0 show ?thesis by auto 40.270 + with \<open>emeasure M A \<noteq> 0\<close> show ?thesis by auto 40.271 qed 40.272 qed } 40.273 { fix i show "N (Q i) \<noteq> \<infinity>" 40.274 @@ -624,7 +624,7 @@ 40.275 unfolding Q_def using Q'[of 0] by simp 40.276 next 40.277 case (Suc n) 40.278 - with ?O n \<in> ?Q ?O (Suc n) \<in> ?Q 40.279 + with \<open>?O n \<in> ?Q\<close> \<open>?O (Suc n) \<in> ?Q\<close> 40.280 emeasure_Diff[OF _ _ _ O_mono, of N n] emeasure_nonneg[of N "(\<Union>x\<le>n. Q' x)"] 40.281 show ?thesis 40.282 by (auto simp: sets_eq ereal_minus_eq_PInfty_iff Q_def) 40.283 @@ -671,7 +671,7 @@ 40.284 show "sets (?N i) = sets (?M i)" by (simp add: sets_eq) 40.285 have [measurable]: "\<And>A. A \<in> sets M \<Longrightarrow> A \<in> sets N" by (simp add: sets_eq) 40.286 show "absolutely_continuous (?M i) (?N i)" 40.287 - using absolutely_continuous M N Q i \<in> sets M 40.288 + using \<open>absolutely_continuous M N\<close> \<open>Q i \<in> sets M\<close> 40.289 by (auto simp: absolutely_continuous_def null_sets_density_iff sets_eq 40.290 intro!: absolutely_continuous_AE[OF sets_eq]) 40.291 qed 40.292 @@ -700,31 +700,31 @@ 40.293 have Qi: "\<And>i. Q i \<in> sets M" using Q by auto 40.294 have [intro,simp]: "\<And>i. (\<lambda>x. f i x * indicator (Q i \<inter> A) x) \<in> borel_measurable M" 40.295 "\<And>i. AE x in M. 0 \<le> f i x * indicator (Q i \<inter> A) x" 40.296 - using borel Qi Q0(1) A \<in> sets M by (auto intro!: borel_measurable_ereal_times) 40.297 + using borel Qi Q0(1) \<open>A \<in> sets M\<close> by (auto intro!: borel_measurable_ereal_times) 40.298 have "(\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M) = (\<integral>\<^sup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) + \<infinity> * indicator (Q0 \<inter> A) x \<partial>M)" 40.299 using borel by (intro nn_integral_cong) (auto simp: indicator_def) 40.300 also have "\<dots> = (\<integral>\<^sup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) \<partial>M) + \<infinity> * emeasure M (Q0 \<inter> A)" 40.301 - using borel Qi Q0(1) A \<in> sets M 40.302 + using borel Qi Q0(1) \<open>A \<in> sets M\<close> 40.303 by (subst nn_integral_add) (auto simp del: ereal_infty_mult 40.304 simp add: nn_integral_cmult_indicator sets.Int intro!: suminf_0_le) 40.305 also have "\<dots> = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" 40.306 - by (subst integral_eq[OF A \<in> sets M], subst nn_integral_suminf) auto 40.307 + by (subst integral_eq[OF \<open>A \<in> sets M\<close>], subst nn_integral_suminf) auto 40.308 finally have "(\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M) = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" . 40.309 moreover have "(\<Sum>i. N (Q i \<inter> A)) = N ((\<Union>i. Q i) \<inter> A)" 40.310 - using Q Q_sets A \<in> sets M 40.311 + using Q Q_sets \<open>A \<in> sets M\<close> 40.312 by (subst suminf_emeasure) (auto simp: disjoint_family_on_def sets_eq) 40.313 moreover have "\<infinity> * emeasure M (Q0 \<inter> A) = N (Q0 \<inter> A)" 40.314 proof - 40.315 - have "Q0 \<inter> A \<in> sets M" using Q0(1) A \<in> sets M by blast 40.316 + have "Q0 \<inter> A \<in> sets M" using Q0(1) \<open>A \<in> sets M\<close> by blast 40.317 from in_Q0[OF this] show ?thesis by auto 40.318 qed 40.319 moreover have "Q0 \<inter> A \<in> sets M" "((\<Union>i. Q i) \<inter> A) \<in> sets M" 40.320 - using Q_sets A \<in> sets M Q0(1) by auto 40.321 + using Q_sets \<open>A \<in> sets M\<close> Q0(1) by auto 40.322 moreover have "((\<Union>i. Q i) \<inter> A) \<union> (Q0 \<inter> A) = A" "((\<Union>i. Q i) \<inter> A) \<inter> (Q0 \<inter> A) = {}" 40.323 - using A \<in> sets M sets.sets_into_space Q0 by auto 40.324 + using \<open>A \<in> sets M\<close> sets.sets_into_space Q0 by auto 40.325 ultimately have "N A = (\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M)" 40.326 using plus_emeasure[of "(\<Union>i. Q i) \<inter> A" N "Q0 \<inter> A"] by (simp add: sets_eq) 40.327 - with A \<in> sets M borel Q Q0(1) show "emeasure (density M ?f) A = N A" 40.328 + with \<open>A \<in> sets M\<close> borel Q Q0(1) show "emeasure (density M ?f) A = N A" 40.329 by (auto simp: subset_eq emeasure_density) 40.330 qed (simp add: sets_eq) 40.331 qed 40.332 @@ -752,7 +752,7 @@ 40.333 with pos sets.sets_into_space have "AE x in M. x \<notin> A" 40.334 by (elim eventually_elim1) (auto simp: not_le[symmetric]) 40.335 then have "A \<in> null_sets M" 40.336 - using A \<in> sets M by (simp add: AE_iff_null_sets) 40.337 + using \<open>A \<in> sets M\<close> by (simp add: AE_iff_null_sets) 40.338 with ac show "A \<in> null_sets N" 40.339 by (auto simp: absolutely_continuous_def) 40.340 qed (auto simp add: sets_eq) 40.341 @@ -762,7 +762,7 @@ 40.342 by (auto intro!: bexI[of _ "\<lambda>x. h x * f x"] simp: density_density_eq) 40.343 qed 40.344 40.345 -subsection {* Uniqueness of densities *} 40.346 +subsection \<open>Uniqueness of densities\<close> 40.347 40.348 lemma finite_density_unique: 40.349 assumes borel: "f \<in> borel_measurable M" "g \<in> borel_measurable M" 40.350 @@ -848,13 +848,13 @@ 40.351 fix i ::nat have "?A i \<in> sets M" 40.352 using borel Q0(1) by auto 40.353 have "?N (?A i) \<le> (\<integral>\<^sup>+x. (i::ereal) * indicator (?A i) x \<partial>M)" 40.354 - unfolding eq[OF ?A i \<in> sets M] 40.355 + unfolding eq[OF \<open>?A i \<in> sets M\<close>] 40.356 by (auto intro!: nn_integral_mono simp: indicator_def) 40.357 also have "\<dots> = i * emeasure M (?A i)" 40.358 - using ?A i \<in> sets M by (auto intro!: nn_integral_cmult_indicator) 40.359 + using \<open>?A i \<in> sets M\<close> by (auto intro!: nn_integral_cmult_indicator) 40.360 also have "\<dots> < \<infinity>" using emeasure_real[of "?A i"] by simp 40.361 finally have "?N (?A i) \<noteq> \<infinity>" by simp 40.362 - then show "?A i \<in> null_sets M" using in_Q0[OF ?A i \<in> sets M] ?A i \<in> sets M by auto 40.363 + then show "?A i \<in> null_sets M" using in_Q0[OF \<open>?A i \<in> sets M\<close>] \<open>?A i \<in> sets M\<close> by auto 40.364 qed 40.365 also have "(\<Union>i. ?A i) = Q0 \<inter> {x\<in>space M. f x \<noteq> \<infinity>}" 40.366 by (auto simp: less_PInf_Ex_of_nat) 40.367 @@ -894,21 +894,21 @@ 40.368 then have "{x \<in> space M. h x * indicator A x \<noteq> 0} = A" 40.369 using pos(1) sets.sets_into_space by (force simp: indicator_def) 40.370 then have "(\<integral>\<^sup>+x. h x * indicator A x \<partial>M) = 0 \<longleftrightarrow> A \<in> null_sets M" 40.371 - using h_borel A \<in> sets M h_nn by (subst nn_integral_0_iff) auto } 40.372 + using h_borel \<open>A \<in> sets M\<close> h_nn by (subst nn_integral_0_iff) auto } 40.373 note h_null_sets = this 40.374 { fix A assume "A \<in> sets M" 40.375 have "(\<integral>\<^sup>+x. f x * (h x * indicator A x) \<partial>M) = (\<integral>\<^sup>+x. h x * indicator A x \<partial>?fM)" 40.376 - using A \<in> sets M h_borel h_nn f f' 40.377 + using \<open>A \<in> sets M\<close> h_borel h_nn f f' 40.378 by (intro nn_integral_density[symmetric]) auto 40.379 also have "\<dots> = (\<integral>\<^sup>+x. h x * indicator A x \<partial>?f'M)" 40.380 by (simp_all add: density_eq) 40.381 also have "\<dots> = (\<integral>\<^sup>+x. f' x * (h x * indicator A x) \<partial>M)" 40.382 - using A \<in> sets M h_borel h_nn f f' 40.383 + using \<open>A \<in> sets M\<close> h_borel h_nn f f' 40.384 by (intro nn_integral_density) auto 40.385 finally have "(\<integral>\<^sup>+x. h x * (f x * indicator A x) \<partial>M) = (\<integral>\<^sup>+x. h x * (f' x * indicator A x) \<partial>M)" 40.386 by (simp add: ac_simps) 40.387 then have "(\<integral>\<^sup>+x. (f x * indicator A x) \<partial>?H) = (\<integral>\<^sup>+x. (f' x * indicator A x) \<partial>?H)" 40.388 - using A \<in> sets M h_borel h_nn f f' 40.389 + using \<open>A \<in> sets M\<close> h_borel h_nn f f' 40.390 by (subst (asm) (1 2) nn_integral_density[symmetric]) auto } 40.391 then have "AE x in ?H. f x = f' x" using h_borel h_nn f f' 40.392 by (intro h.density_unique_finite_measure absolutely_continuous_AE[of M]) 40.393 @@ -1025,7 +1025,7 @@ 40.394 proof (cases i) 40.395 case 0 40.396 have "AE x in M. f x * indicator (A i \<inter> Q j) x = 0" 40.397 - using AE by (auto simp: A_def i = 0) 40.398 + using AE by (auto simp: A_def \<open>i = 0\<close>) 40.399 from nn_integral_cong_AE[OF this] show ?thesis by simp 40.400 next 40.401 case (Suc n) 40.402 @@ -1050,7 +1050,7 @@ 40.403 apply (auto simp: max_def intro!: measurable_If) 40.404 done 40.405 40.406 -subsection {* Radon-Nikodym derivative *} 40.407 +subsection \<open>Radon-Nikodym derivative\<close> 40.408 40.409 definition RN_deriv :: "'a measure \<Rightarrow> 'a measure \<Rightarrow> 'a \<Rightarrow> ereal" where 40.410 "RN_deriv M N = 40.411 @@ -1164,11 +1164,11 @@ 40.412 next 40.413 fix X assume "X \<in> (\<lambda>A. T' - A \<inter> space ?M')F" 40.414 then obtain A where [simp]: "X = T' - A \<inter> space ?M'" and "A \<in> F" by auto 40.415 - have "X \<in> sets M'" using F T' A\<in>F by auto 40.416 + have "X \<in> sets M'" using F T' \<open>A\<in>F\<close> by auto 40.417 moreover 40.418 - have Fi: "A \<in> sets M" using F A\<in>F by auto 40.419 + have Fi: "A \<in> sets M" using F \<open>A\<in>F\<close> by auto 40.420 ultimately show "emeasure ?M' X \<noteq> \<infinity>" 40.421 - using F T T' A\<in>F by (simp add: emeasure_distr) 40.422 + using F T T' \<open>A\<in>F\<close> by (simp add: emeasure_distr) 40.423 qed (insert F, auto) 40.424 qed 40.425 have "(RN_deriv ?M' ?N') \<circ> T \<in> borel_measurable M" 40.426 @@ -1291,7 +1291,7 @@ 40.427 and x: "{x} \<in> sets M" 40.428 shows "N {x} = RN_deriv M N x * emeasure M {x}" 40.429 proof - 40.430 - from {x} \<in> sets M 40.431 + from \<open>{x} \<in> sets M\<close> 40.432 have "density M (RN_deriv M N) {x} = (\<integral>\<^sup>+w. RN_deriv M N x * indicator {x} w \<partial>M)" 40.433 by (auto simp: indicator_def emeasure_density intro!: nn_integral_cong) 40.434 with x density_RN_deriv[OF ac] RN_deriv_nonneg[of M N] show ?thesis   41.1 --- a/src/HOL/Probability/Regularity.thy Mon Dec 07 16:48:10 2015 +0000 41.2 +++ b/src/HOL/Probability/Regularity.thy Mon Dec 07 20:19:59 2015 +0100 41.3 @@ -2,7 +2,7 @@ 41.4 Author: Fabian Immler, TU MÃ¼nchen 41.5 *) 41.6 41.7 -section {* Regularity of Measures *} 41.8 +section \<open>Regularity of Measures\<close> 41.9 41.10 theory Regularity 41.11 imports Measure_Space Borel_Space 41.12 @@ -24,12 +24,12 @@ 41.13 show "x \<le> y" 41.14 proof (rule ccontr) 41.15 assume "\<not> x \<le> y" hence "x > y" by simp 41.16 - hence y_fin: "\<bar>y\<bar> \<noteq> \<infinity>" using y \<ge> 0 by auto 41.17 - have x_fin: "\<bar>x\<bar> \<noteq> \<infinity>" using x > y f_fin approx[where e = 1] by auto 41.18 + hence y_fin: "\<bar>y\<bar> \<noteq> \<infinity>" using \<open>y \<ge> 0\<close> by auto 41.19 + have x_fin: "\<bar>x\<bar> \<noteq> \<infinity>" using \<open>x > y\<close> f_fin approx[where e = 1] by auto 41.20 def e \<equiv> "real_of_ereal ((x - y) / 2)" 41.21 - have e: "x > y + e" "e > 0" using x > y y_fin x_fin by (auto simp: e_def field_simps) 41.22 + have e: "x > y + e" "e > 0" using \<open>x > y\<close> y_fin x_fin by (auto simp: e_def field_simps) 41.23 note e(1) 41.24 - also from approx[OF e > 0] obtain i where i: "i \<in> A" "x \<le> f i + e" by blast 41.25 + also from approx[OF \<open>e > 0\<close>] obtain i where i: "i \<in> A" "x \<le> f i + e" by blast 41.26 note i(2) 41.27 finally have "y < f i" using y_fin f_fin by (metis add_right_mono linorder_not_le) 41.28 moreover have "f i \<le> y" by (rule f_le_y) fact 41.29 @@ -53,12 +53,12 @@ 41.30 show "y \<le> x" 41.31 proof (rule ccontr) 41.32 assume "\<not> y \<le> x" hence "y > x" by simp hence "y \<noteq> - \<infinity>" by auto 41.33 - hence y_fin: "\<bar>y\<bar> \<noteq> \<infinity>" using y \<noteq> \<infinity> by auto 41.34 - have x_fin: "\<bar>x\<bar> \<noteq> \<infinity>" using y > x f_fin f_nonneg approx[where e = 1] A_notempty 41.35 + hence y_fin: "\<bar>y\<bar> \<noteq> \<infinity>" using \<open>y \<noteq> \<infinity>\<close> by auto 41.36 + have x_fin: "\<bar>x\<bar> \<noteq> \<infinity>" using \<open>y > x\<close> f_fin f_nonneg approx[where e = 1] A_notempty 41.37 by auto 41.38 def e \<equiv> "real_of_ereal ((y - x) / 2)" 41.39 - have e: "y > x + e" "e > 0" using y > x y_fin x_fin by (auto simp: e_def field_simps) 41.40 - from approx[OF e > 0] obtain i where i: "i \<in> A" "x + e \<ge> f i" by blast 41.41 + have e: "y > x + e" "e > 0" using \<open>y > x\<close> y_fin x_fin by (auto simp: e_def field_simps) 41.42 + from approx[OF \<open>e > 0\<close>] obtain i where i: "i \<in> A" "x + e \<ge> f i" by blast 41.43 note i(2) 41.44 also note e(1) 41.45 finally have "y > f i" . 41.46 @@ -78,7 +78,7 @@ 41.47 moreover 41.48 from INF have "\<And>y. (\<And>i. i \<in> A \<Longrightarrow> y \<le> f i) \<Longrightarrow> y \<le> x" by (auto intro: INF_greatest) 41.49 ultimately 41.50 - have "(INF i : A. f i) = x + e" using e > 0 41.51 + have "(INF i : A. f i) = x + e" using \<open>e > 0\<close> 41.52 by (intro INF_eqI) 41.53 (force, metis add.comm_neutral add_left_mono ereal_less(1) 41.54 linorder_not_le not_less_iff_gr_or_eq) 41.55 @@ -96,7 +96,7 @@ 41.56 moreover 41.57 from SUP have "\<And>y. (\<And>i. i \<in> A \<Longrightarrow> f i \<le> y) \<Longrightarrow> y \<ge> x" by (auto intro: SUP_least) 41.58 ultimately 41.59 - have "(SUP i : A. f i) = x - e" using e > 0 \<bar>x\<bar> \<noteq> \<infinity> 41.60 + have "(SUP i : A. f i) = x - e" using \<open>e > 0\<close> \<open>\<bar>x\<bar> \<noteq> \<infinity>\<close> 41.61 by (intro SUP_eqI) 41.62 (metis PInfty_neq_ereal(2) abs_ereal.simps(1) ereal_minus_le linorder_linear, 41.63 metis ereal_between(1) ereal_less(2) less_eq_ereal_def order_trans) 41.64 @@ -136,7 +136,7 @@ 41.65 (auto intro!: borel_closed bexI simp: closed_cball incseq_def Us sb) 41.66 also have "?U = space M" 41.67 proof safe 41.68 - fix x from X(2)[OF open_ball[of x r]] r > 0 obtain d where d: "d\<in>X" "d \<in> ball x r" by auto 41.69 + fix x from X(2)[OF open_ball[of x r]] \<open>r > 0\<close> obtain d where d: "d\<in>X" "d \<in> ball x r" by auto 41.70 show "x \<in> ?U" 41.71 using X(1) d by (auto intro!: exI[where x="to_nat_on X d"] simp: dist_commute Bex_def) 41.72 qed (simp add: sU) 41.73 @@ -145,10 +145,10 @@ 41.74 { 41.75 fix e ::real and n :: nat assume "e > 0" "n > 0" 41.76 hence "1/n > 0" "e * 2 powr - n > 0" by (auto) 41.77 - from M_space[OF 1/n>0] 41.78 + from M_space[OF \<open>1/n>0\<close>] 41.79 have "(\<lambda>k. measure M (\<Union>i\<in>{0..k}. cball (from_nat_into X i) (1/real n))) ----> measure M (space M)" 41.80 unfolding emeasure_eq_measure by simp 41.81 - from metric_LIMSEQ_D[OF this 0 < e * 2 powr -n] 41.82 + from metric_LIMSEQ_D[OF this \<open>0 < e * 2 powr -n\<close>] 41.83 obtain k where "dist (measure M (\<Union>i\<in>{0..k}. cball (from_nat_into X i) (1/real n))) (measure M (space M)) < 41.84 e * 2 powr -n" 41.85 by auto 41.86 @@ -176,13 +176,13 @@ 41.87 def B \<equiv> "\<lambda>n. \<Union>i\<in>{0..k e (Suc n)}. cball (from_nat_into X i) (1 / Suc n)" 41.88 have "\<And>n. closed (B n)" by (auto simp: B_def closed_cball) 41.89 hence [simp]: "\<And>n. B n \<in> sets M" by (simp add: sb) 41.90 - from k[OF e > 0 zero_less_Suc] 41.91 + from k[OF \<open>e > 0\<close> zero_less_Suc] 41.92 have "\<And>n. measure M (space M) - measure M (B n) \<le> e * 2 powr - real (Suc n)" 41.93 by (simp add: algebra_simps B_def finite_measure_compl) 41.94 hence B_compl_le: "\<And>n::nat. measure M (space M - B n) \<le> e * 2 powr - real (Suc n)" 41.95 by (simp add: finite_measure_compl) 41.96 def K \<equiv> "\<Inter>n. B n" 41.97 - from closed (B _) have "closed K" by (auto simp: K_def) 41.98 + from \<open>closed (B _)\<close> have "closed K" by (auto simp: K_def) 41.99 hence [simp]: "K \<in> sets M" by (simp add: sb) 41.100 have "measure M (space M) - measure M K = measure M (space M - K)" 41.101 by (simp add: finite_measure_compl) 41.102 @@ -197,14 +197,14 @@ 41.103 unfolding times_ereal.simps[symmetric] ereal_power[symmetric] one_ereal_def numeral_eq_ereal 41.104 by simp 41.105 also have "\<dots> = ereal e * (\<Sum>n. ((1 / 2) ^ Suc n))" 41.106 - by (rule suminf_cmult_ereal) (auto simp: 0 < e less_imp_le) 41.107 + by (rule suminf_cmult_ereal) (auto simp: \<open>0 < e\<close> less_imp_le) 41.108 also have "\<dots> = e" unfolding suminf_half_series_ereal by simp 41.109 finally have "measure M (space M) \<le> measure M K + e" by simp 41.110 hence "emeasure M (space M) \<le> emeasure M K + e" by (simp add: emeasure_eq_measure) 41.111 moreover have "compact K" 41.112 unfolding compact_eq_totally_bounded 41.113 proof safe 41.114 - show "complete K" using closed K by (simp add: complete_eq_closed) 41.115 + show "complete K" using \<open>closed K\<close> by (simp add: complete_eq_closed) 41.116 fix e'::real assume "0 < e'" 41.117 from nat_approx_posE[OF this] guess n . note n = this 41.118 let ?k = "from_nat_into X  {0..k e (Suc n)}" 41.119 @@ -236,7 +236,7 @@ 41.120 also have "\<dots> \<le> e" using K by (simp add: emeasure_eq_measure) 41.121 finally have "emeasure M A \<le> emeasure M (A \<inter> K) + ereal e" 41.122 by (simp add: emeasure_eq_measure algebra_simps) 41.123 - moreover have "A \<inter> K \<subseteq> A" "compact (A \<inter> K)" using closed A compact K by auto 41.124 + moreover have "A \<inter> K \<subseteq> A" "compact (A \<inter> K)" using \<open>closed A\<close> \<open>compact K\<close> by auto 41.125 ultimately show "\<exists>K \<subseteq> A. compact K \<and> emeasure M A \<le> emeasure M K + ereal e" 41.126 by blast 41.127 qed simp 41.128 @@ -251,7 +251,7 @@ 41.129 by (intro continuous_open_vimage) (auto intro!: continuous_infdist continuous_at_id) 41.130 finally have "open (?G d)" . 41.131 } note open_G = this 41.132 - from in_closed_iff_infdist_zero[OF closed A A \<noteq> {}] 41.133 + from in_closed_iff_infdist_zero[OF \<open>closed A\<close> \<open>A \<noteq> {}\<close>] 41.134 have "A = {x. infdist x A = 0}" by auto 41.135 also have "\<dots> = (\<Inter>i. ?G (1/real (Suc i)))" 41.136 proof (auto simp del: of_nat_Suc, rule ccontr) 41.137 @@ -291,9 +291,9 @@ 41.138 by (rule INF_greatest) (auto intro!: emeasure_mono simp: sb) 41.139 ultimately show ?thesis by simp 41.140 qed (auto intro!: INF_eqI) 41.141 - note ?inner A ?outer A } 41.142 + note \<open>?inner A\<close> \<open>?outer A\<close> } 41.143 note closed_in_D = this 41.144 - from B \<in> sets borel 41.145 + from \<open>B \<in> sets borel\<close> 41.146 have "Int_stable (Collect closed)" "Collect closed \<subseteq> Pow UNIV" "B \<in> sigma_sets UNIV (Collect closed)" 41.147 by (auto simp: Int_stable_def borel_eq_closed) 41.148 then show "?inner B" "?outer B" 41.149 @@ -340,10 +340,10 @@ 41.150 also have "\<dots> = (SUP K:{K. K \<subseteq> space M - B \<and> compact K}. emeasure M K)" 41.151 proof (safe intro!: antisym SUP_least) 41.152 fix K assume "closed K" "K \<subseteq> space M - B" 41.153 - from closed_in_D[OF closed K] 41.154 + from closed_in_D[OF \<open>closed K\<close>] 41.155 have K_inner: "emeasure M K = (SUP K:{Ka. Ka \<subseteq> K \<and> compact Ka}. emeasure M K)" by simp 41.156 show "emeasure M K \<le> (SUP K:{K. K \<subseteq> space M - B \<and> compact K}. emeasure M K)" 41.157 - unfolding K_inner using K \<subseteq> space M - B 41.158 + unfolding K_inner using \<open>K \<subseteq> space M - B\<close> 41.159 by (auto intro!: SUP_upper SUP_least) 41.160 qed (fastforce intro!: SUP_least SUP_upper simp: compact_imp_closed) 41.161 finally show ?case by (auto intro!: antisym simp: sets_eq_imp_space_eq[OF sb]) 41.162 @@ -355,7 +355,7 @@ 41.163 by (intro summable_LIMSEQ summable_ereal_pos emeasure_nonneg) 41.164 finally have measure_LIMSEQ: "(\<lambda>n. \<Sum>i<n. measure M (D i)) ----> measure M (\<Union>i. D i)" 41.165 by (simp add: emeasure_eq_measure) 41.166 - have "(\<Union>i. D i) \<in> sets M" using range D \<subseteq> sets M by auto 41.167 + have "(\<Union>i. D i) \<in> sets M" using \<open>range D \<subseteq> sets M\<close> by auto 41.168 41.169 case 1 41.170 show ?case 41.171 @@ -377,10 +377,10 @@ 41.172 have "\<forall>i. \<exists>K. K \<subseteq> D i \<and> compact K \<and> emeasure M (D i) \<le> emeasure M K + e/(2*Suc n0)" 41.173 proof 41.174 fix i 41.175 - from 0 < e have "0 < e/(2*Suc n0)" by simp 41.176 + from \<open>0 < e\<close> have "0 < e/(2*Suc n0)" by simp 41.177 have "emeasure M (D i) = (SUP K:{K. K \<subseteq> (D i) \<and> compact K}. emeasure M K)" 41.178 using union by blast 41.179 - from SUP_approx_ereal[OF 0 < e/(2*Suc n0) this] 41.180 + from SUP_approx_ereal[OF \<open>0 < e/(2*Suc n0)\<close> this] 41.181 show "\<exists>K. K \<subseteq> D i \<and> compact K \<and> emeasure M (D i) \<le> emeasure M K + e/(2*Suc n0)" 41.182 by (auto simp: emeasure_eq_measure) 41.183 qed 41.184 @@ -388,7 +388,7 @@ 41.185 "\<And>i. emeasure M (D i) \<le> emeasure M (K i) + e/(2*Suc n0)" 41.186 unfolding choice_iff by blast 41.187 let ?K = "\<Union>i\<in>{..<n0}. K i" 41.188 - have "disjoint_family_on K {..<n0}" using K disjoint_family D 41.189 + have "disjoint_family_on K {..<n0}" using K \<open>disjoint_family D\<close> 41.190 unfolding disjoint_family_on_def by blast 41.191 hence mK: "measure M ?K = (\<Sum>i<n0. measure M (K i))" using K 41.192 by (intro finite_measure_finite_Union) (auto simp: sb compact_imp_closed) 41.193 @@ -397,7 +397,7 @@ 41.194 using K by (auto intro: setsum_mono simp: emeasure_eq_measure) 41.195 also have "\<dots> = (\<Sum>i<n0. measure M (K i)) + (\<Sum>i<n0. e/(2*Suc n0))" 41.196 by (simp add: setsum.distrib) 41.197 - also have "\<dots> \<le> (\<Sum>i<n0. measure M (K i)) + e / 2" using 0 < e 41.198 + also have "\<dots> \<le> (\<Sum>i<n0. measure M (K i)) + e / 2" using \<open>0 < e\<close> 41.199 by (auto simp: field_simps intro!: mult_left_mono) 41.200 finally 41.201 have "measure M (\<Union>i. D i) < (\<Sum>i<n0. measure M (K i)) + e / 2 + e / 2" 41.202 @@ -413,15 +413,15 @@ 41.203 qed fact 41.204 case 2 41.205 show ?case 41.206 - proof (rule approx_outer[OF (\<Union>i. D i) \<in> sets M]) 41.207 + proof (rule approx_outer[OF \<open>(\<Union>i. D i) \<in> sets M\<close>]) 41.208 fix e::real assume "e > 0" 41.209 have "\<forall>i::nat. \<exists>U. D i \<subseteq> U \<and> open U \<and> e/(2 powr Suc i) > emeasure M U - emeasure M (D i)" 41.210 proof 41.211 fix i::nat 41.212 - from 0 < e have "0 < e/(2 powr Suc i)" by simp 41.213 + from \<open>0 < e\<close> have "0 < e/(2 powr Suc i)" by simp 41.214 have "emeasure M (D i) = (INF U:{U. (D i) \<subseteq> U \<and> open U}. emeasure M U)" 41.215 using union by blast 41.216 - from INF_approx_ereal[OF 0 < e/(2 powr Suc i) this] 41.217 + from INF_approx_ereal[OF \<open>0 < e/(2 powr Suc i)\<close> this] 41.218 show "\<exists>U. D i \<subseteq> U \<and> open U \<and> e/(2 powr Suc i) > emeasure M U - emeasure M (D i)" 41.219 by (auto simp: emeasure_eq_measure) 41.220 qed 41.221 @@ -429,13 +429,13 @@ 41.222 "\<And>i. e/(2 powr Suc i) > emeasure M (U i) - emeasure M (D i)" 41.223 unfolding choice_iff by blast 41.224 let ?U = "\<Union>i. U i" 41.225 - have "M ?U - M (\<Union>i. D i) = M (?U - (\<Union>i. D i))" using U (\<Union>i. D i) \<in> sets M 41.226 + have "M ?U - M (\<Union>i. D i) = M (?U - (\<Union>i. D i))" using U \<open>(\<Union>i. D i) \<in> sets M\<close> 41.227 by (subst emeasure_Diff) (auto simp: sb) 41.228 - also have "\<dots> \<le> M (\<Union>i. U i - D i)" using U range D \<subseteq> sets M 41.229 + also have "\<dots> \<le> M (\<Union>i. U i - D i)" using U \<open>range D \<subseteq> sets M\<close> 41.230 by (intro emeasure_mono) (auto simp: sb intro!: sets.countable_nat_UN sets.Diff) 41.231 - also have "\<dots> \<le> (\<Sum>i. M (U i - D i))" using U range D \<subseteq> sets M 41.232 + also have "\<dots> \<le> (\<Sum>i. M (U i - D i))" using U \<open>range D \<subseteq> sets M\<close> 41.233 by (intro emeasure_subadditive_countably) (auto intro!: sets.Diff simp: sb) 41.234 - also have "\<dots> \<le> (\<Sum>i. ereal e/(2 powr Suc i))" using U range D \<subseteq> sets M 41.235 + also have "\<dots> \<le> (\<Sum>i. ereal e/(2 powr Suc i))" using U \<open>range D \<subseteq> sets M\<close> 41.236 by (intro suminf_le_pos, subst emeasure_Diff) 41.237 (auto simp: emeasure_Diff emeasure_eq_measure sb measure_nonneg intro: less_imp_le) 41.238 also have "\<dots> \<le> (\<Sum>n. ereal (e * (1 / 2) ^ Suc n))" 41.239 @@ -444,7 +444,7 @@ 41.240 unfolding times_ereal.simps[symmetric] ereal_power[symmetric] one_ereal_def numeral_eq_ereal 41.241 by simp 41.242 also have "\<dots> = ereal e * (\<Sum>n. ((1 / 2) ^ Suc n))" 41.243 - by (rule suminf_cmult_ereal) (auto simp: 0 < e less_imp_le) 41.244 + by (rule suminf_cmult_ereal) (auto simp: \<open>0 < e\<close> less_imp_le) 41.245 also have "\<dots> = e" unfolding suminf_half_series_ereal by simp 41.246 finally 41.247 have "emeasure M ?U \<le> emeasure M (\<Union>i. D i) + ereal e" by (simp add: emeasure_eq_measure)   42.1 --- a/src/HOL/Probability/Set_Integral.thy Mon Dec 07 16:48:10 2015 +0000 42.2 +++ b/src/HOL/Probability/Set_Integral.thy Mon Dec 07 20:19:59 2015 +0100 42.3 @@ -104,7 +104,7 @@ 42.4 proof - 42.5 have "set_integrable M B (\<lambda>x. indicator A x *\<^sub>R f x)" 42.6 by (rule integrable_mult_indicator) fact+ 42.7 - with B \<subseteq> A show ?thesis 42.8 + with \<open>B \<subseteq> A\<close> show ?thesis 42.9 by (simp add: indicator_inter_arith[symmetric] Int_absorb2) 42.10 qed 42.11 42.12 @@ -287,7 +287,7 @@ 42.13 have "set_borel_measurable M B (\<lambda>x. indicator A x *\<^sub>R f x)" 42.14 by measurable 42.15 also have "(\<lambda>x. indicator B x *\<^sub>R indicator A x *\<^sub>R f x) = (\<lambda>x. indicator B x *\<^sub>R f x)" 42.16 - using B \<subseteq> A by (auto simp: fun_eq_iff split: split_indicator) 42.17 + using \<open>B \<subseteq> A\<close> by (auto simp: fun_eq_iff split: split_indicator) 42.18 finally show ?thesis . 42.19 qed 42.20 42.21 @@ -340,7 +340,7 @@ 42.22 apply (rule intgbl) 42.23 prefer 3 apply (rule lim) 42.24 apply (rule AE_I2) 42.25 - using mono A apply (auto simp: mono_def nneg split: split_indicator) [] 42.26 + using \<open>mono A\<close> apply (auto simp: mono_def nneg split: split_indicator) [] 42.27 proof (rule AE_I2) 42.28 { fix x assume "x \<in> space M" 42.29 show "(\<lambda>i. indicator (A i) x *\<^sub>R f x) ----> indicator (\<Union>i. A i) x *\<^sub>R f x" 42.30 @@ -348,7 +348,7 @@ 42.31 assume "\<exists>i. x \<in> A i" 42.32 then guess i .. 42.33 then have *: "eventually (\<lambda>i. x \<in> A i) sequentially" 42.34 - using x \<in> A i mono A by (auto simp: eventually_sequentially mono_def) 42.35 + using \<open>x \<in> A i\<close> \<open>mono A\<close> by (auto simp: eventually_sequentially mono_def) 42.36 show ?thesis 42.37 apply (intro Lim_eventually) 42.38 using *   43.1 --- a/src/HOL/Probability/Sigma_Algebra.thy Mon Dec 07 16:48:10 2015 +0000 43.2 +++ b/src/HOL/Probability/Sigma_Algebra.thy Mon Dec 07 20:19:59 2015 +0100 43.3 @@ -5,7 +5,7 @@ 43.4 translated by Lawrence Paulson. 43.5 *) 43.6 43.7 -section {* Describing measurable sets *} 43.8 +section \<open>Describing measurable sets\<close> 43.9 43.10 theory Sigma_Algebra 43.11 imports 43.12 @@ -17,15 +17,15 @@ 43.13 "~~/src/HOL/Library/Disjoint_Sets" 43.14 begin 43.15 43.16 -text {* Sigma algebras are an elementary concept in measure 43.17 +text \<open>Sigma algebras are an elementary concept in measure 43.18 theory. To measure --- that is to integrate --- functions, we first have 43.19 to measure sets. Unfortunately, when dealing with a large universe, 43.20 it is often not possible to consistently assign a measure to every 43.21 subset. Therefore it is necessary to define the set of measurable 43.22 subsets of the universe. A sigma algebra is such a set that has 43.23 - three very natural and desirable properties. *} 43.24 + three very natural and desirable properties.\<close> 43.25 43.26 -subsection {* Families of sets *} 43.27 +subsection \<open>Families of sets\<close> 43.28 43.29 locale subset_class = 43.30 fixes \<Omega> :: "'a set" and M :: "'a set set" 43.31 @@ -34,7 +34,7 @@ 43.32 lemma (in subset_class) sets_into_space: "x \<in> M \<Longrightarrow> x \<subseteq> \<Omega>" 43.33 by (metis PowD contra_subsetD space_closed) 43.34 43.35 -subsubsection {* Semiring of sets *} 43.36 +subsubsection \<open>Semiring of sets\<close> 43.37 43.38 locale semiring_of_sets = subset_class + 43.39 assumes empty_sets[iff]: "{} \<in> M" 43.40 @@ -67,7 +67,7 @@ 43.41 shows "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} \<in> M" 43.42 proof - 43.43 have "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} = (\<Inter>i\<in>S. {x\<in>\<Omega>. P i x})" 43.44 - using S \<noteq> {} by auto 43.45 + using \<open>S \<noteq> {}\<close> by auto 43.46 with assms show ?thesis by auto 43.47 qed 43.48 43.49 @@ -158,13 +158,13 @@ 43.50 interpret ring_of_sets \<Omega> M 43.51 proof (rule ring_of_setsI) 43.52 show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M" 43.53 - using ?Un by auto 43.54 + using \<open>?Un\<close> by auto 43.55 fix a b assume a: "a \<in> M" and b: "b \<in> M" 43.56 - then show "a \<union> b \<in> M" using ?Un by auto 43.57 + then show "a \<union> b \<in> M" using \<open>?Un\<close> by auto 43.58 have "a - b = \<Omega> - ((\<Omega> - a) \<union> b)" 43.59 using \<Omega> a b by auto 43.60 then show "a - b \<in> M" 43.61 - using a b ?Un by auto 43.62 + using a b \<open>?Un\<close> by auto 43.63 qed 43.64 show "algebra \<Omega> M" proof qed fact 43.65 qed 43.66 @@ -183,13 +183,13 @@ 43.67 show "algebra \<Omega> M" 43.68 proof (unfold algebra_iff_Un, intro conjI ballI) 43.69 show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M" 43.70 - using ?Int by auto 43.71 - from ?Int show "\<And>a. a \<in> M \<Longrightarrow> \<Omega> - a \<in> M" by auto 43.72 + using \<open>?Int\<close> by auto 43.73 + from \<open>?Int\<close> show "\<And>a. a \<in> M \<Longrightarrow> \<Omega> - a \<in> M" by auto 43.74 fix a b assume M: "a \<in> M" "b \<in> M" 43.75 hence "a \<union> b = \<Omega> - ((\<Omega> - a) \<inter> (\<Omega> - b))" 43.76 using \<Omega> by blast 43.77 also have "... \<in> M" 43.78 - using M ?Int by auto 43.79 + using M \<open>?Int\<close> by auto 43.80 finally show "a \<union> b \<in> M" . 43.81 qed 43.82 qed 43.83 @@ -214,7 +214,7 @@ 43.84 "X \<subseteq> S \<Longrightarrow> algebra S { {}, X, S - X, S }" 43.85 by (auto simp: algebra_iff_Int) 43.86 43.87 -subsubsection {* Restricted algebras *} 43.88 +subsubsection \<open>Restricted algebras\<close> 43.89 43.90 abbreviation (in algebra) 43.91 "restricted_space A \<equiv> (op \<inter> A)  M" 43.92 @@ -223,7 +223,7 @@ 43.93 assumes "A \<in> M" shows "algebra A (restricted_space A)" 43.94 using assms by (auto simp: algebra_iff_Int) 43.95 43.96 -subsubsection {* Sigma Algebras *} 43.97 +subsubsection \<open>Sigma Algebras\<close> 43.98 43.99 locale sigma_algebra = algebra + 43.100 assumes countable_nat_UN [intro]: "\<And>A. range A \<subseteq> M \<Longrightarrow> (\<Union>i::nat. A i) \<in> M" 43.101 @@ -236,7 +236,7 @@ 43.102 then have "(\<Union>i. A i) = (\<Union>s\<in>M \<inter> range A. s)" 43.103 by auto 43.104 also have "(\<Union>s\<in>M \<inter> range A. s) \<in> M" 43.105 - using finite M by auto 43.106 + using \<open>finite M\<close> by auto 43.107 finally show "(\<Union>i. A i) \<in> M" . 43.108 qed 43.109 43.110 @@ -267,7 +267,7 @@ 43.111 hence "\<Union>X = (\<Union>n. from_nat_into X n)" 43.112 using assms by (auto intro: from_nat_into) (metis from_nat_into_surj) 43.113 also have "\<dots> \<in> M" using assms 43.114 - by (auto intro!: countable_nat_UN) (metis X \<noteq> {} from_nat_into set_mp) 43.115 + by (auto intro!: countable_nat_UN) (metis \<open>X \<noteq> {}\<close> from_nat_into set_mp) 43.116 finally show ?thesis . 43.117 qed simp 43.118 43.119 @@ -421,9 +421,9 @@ 43.120 lemma sigma_algebra_single_set: 43.121 assumes "X \<subseteq> S" 43.122 shows "sigma_algebra S { {}, X, S - X, S }" 43.123 - using algebra.is_sigma_algebra[OF algebra_single_set[OF X \<subseteq> S]] by simp 43.124 + using algebra.is_sigma_algebra[OF algebra_single_set[OF \<open>X \<subseteq> S\<close>]] by simp 43.125 43.126 -subsubsection {* Binary Unions *} 43.127 +subsubsection \<open>Binary Unions\<close> 43.128 43.129 definition binary :: "'a \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a" 43.130 where "binary a b = (\<lambda>x. b)(0 := a)" 43.131 @@ -445,10 +445,10 @@ 43.132 by (auto simp add: range_binary_eq sigma_algebra_def sigma_algebra_axioms_def 43.133 algebra_iff_Un Un_range_binary) 43.134 43.135 -subsubsection {* Initial Sigma Algebra *} 43.136 +subsubsection \<open>Initial Sigma Algebra\<close> 43.137 43.138 -text {*Sigma algebras can naturally be created as the closure of any set of 43.139 - M with regard to the properties just postulated. *} 43.140 +text \<open>Sigma algebras can naturally be created as the closure of any set of 43.141 + M with regard to the properties just postulated.\<close> 43.142 43.143 inductive_set sigma_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set" 43.144 for sp :: "'a set" and A :: "'a set set" 43.145 @@ -482,7 +482,7 @@ 43.146 proof safe 43.147 fix B X assume "A \<subseteq> B" and sa: "sigma_algebra S B" 43.148 and X: "X \<in> sigma_sets S A" 43.149 - from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF A \<subseteq> B] X 43.150 + from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF \<open>A \<subseteq> B\<close>] X 43.151 show "X \<in> B" by auto 43.152 next 43.153 fix X assume "X \<in> \<Inter>{B. A \<subseteq> B \<and> sigma_algebra S B}" 43.154 @@ -569,19 +569,19 @@ 43.155 lemma sigma_sets_subseteq: assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B" 43.156 proof 43.157 fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" 43.158 - by induct (insert A \<subseteq> B, auto intro: sigma_sets.intros(2-)) 43.159 + by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-)) 43.160 qed 43.161 43.162 lemma sigma_sets_mono: assumes "A \<subseteq> sigma_sets X B" shows "sigma_sets X A \<subseteq> sigma_sets X B" 43.163 proof 43.164 fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" 43.165 - by induct (insert A \<subseteq> sigma_sets X B, auto intro: sigma_sets.intros(2-)) 43.166 + by induct (insert \<open>A \<subseteq> sigma_sets X B\<close>, auto intro: sigma_sets.intros(2-)) 43.167 qed 43.168 43.169 lemma sigma_sets_mono': assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B" 43.170 proof 43.171 fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" 43.172 - by induct (insert A \<subseteq> B, auto intro: sigma_sets.intros(2-)) 43.173 + by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-)) 43.174 qed 43.175 43.176 lemma sigma_sets_superset_generator: "A \<subseteq> sigma_sets X A" 43.177 @@ -595,7 +595,7 @@ 43.178 proof - 43.179 { fix i have "A i \<in> ?r" using * by auto 43.180 hence "\<exists>B. A i = B \<inter> S \<and> B \<in> M" by auto 43.181 - hence "A i \<subseteq> S" "A i \<in> M" using S \<in> M by auto } 43.182 + hence "A i \<subseteq> S" "A i \<in> M" using \<open>S \<in> M\<close> by auto } 43.183 thus "range A \<subseteq> M" "(\<Union>i. A i) \<in> (\<lambda>A. S \<inter> A)  M" 43.184 by (auto intro!: image_eqI[of _ _ "(\<Union>i. A i)"]) 43.185 qed 43.186 @@ -630,14 +630,14 @@ 43.187 simp add: UN_extend_simps simp del: UN_simps) 43.188 qed (auto intro!: sigma_sets.intros(2-)) 43.189 then show "x \<in> sigma_sets A (op \<inter> A  st)" 43.190 - using A \<subseteq> sp by (simp add: Int_absorb2) 43.191 + using \<open>A \<subseteq> sp\<close> by (simp add: Int_absorb2) 43.192 next 43.193 fix x assume "x \<in> sigma_sets A (op \<inter> A  st)" 43.194 then show "x \<in> op \<inter> A  sigma_sets sp st" 43.195 proof induct 43.196 case (Compl a) 43.197 then obtain x where "a = A \<inter> x" "x \<in> sigma_sets sp st" by auto 43.198 - then show ?case using A \<subseteq> sp 43.199 + then show ?case using \<open>A \<subseteq> sp\<close> 43.200 by (force simp add: image_iff intro!: bexI[of _ "sp - x"] sigma_sets.Compl) 43.201 next 43.202 case (Union a) 43.203 @@ -793,7 +793,7 @@ 43.204 thus "(\<Union>i::nat. A i) \<in> M" by (simp add: UN_disjointed_eq) 43.205 qed 43.206 43.207 -subsubsection {* Ring generated by a semiring *} 43.208 +subsubsection \<open>Ring generated by a semiring\<close> 43.209 43.210 definition (in semiring_of_sets) 43.211 "generated_ring = { \<Union>C | C. C \<subseteq> M \<and> finite C \<and> disjoint C }" 43.212 @@ -822,7 +822,7 @@ 43.213 show ?thesis 43.214 proof 43.215 show "disjoint (Ca \<union> Cb)" 43.216 - using a \<inter> b = {} Ca Cb by (auto intro!: disjoint_union) 43.217 + using \<open>a \<inter> b = {}\<close> Ca Cb by (auto intro!: disjoint_union) 43.218 qed (insert Ca Cb, auto) 43.219 qed 43.220 43.221 @@ -888,7 +888,7 @@ 43.222 43.223 show "a - b \<in> ?R" 43.224 proof cases 43.225 - assume "Cb = {}" with Cb a \<in> ?R show ?thesis 43.226 + assume "Cb = {}" with Cb \<open>a \<in> ?R\<close> show ?thesis 43.227 by simp 43.228 next 43.229 assume "Cb \<noteq> {}" 43.230 @@ -900,7 +900,7 @@ 43.231 by (auto simp add: generated_ring_def) 43.232 next 43.233 show "disjoint ((\<lambda>a'. \<Inter>b'\<in>Cb. a' - b')Ca)" 43.234 - using Ca by (auto simp add: disjoint_def Cb \<noteq> {}) 43.235 + using Ca by (auto simp add: disjoint_def \<open>Cb \<noteq> {}\<close>) 43.236 next 43.237 show "finite Ca" "finite Cb" "Cb \<noteq> {}" by fact+ 43.238 qed 43.239 @@ -923,7 +923,7 @@ 43.240 by (blast intro!: sigma_sets_mono elim: generated_ringE) 43.241 qed (auto intro!: generated_ringI_Basic sigma_sets_mono) 43.242 43.243 -subsubsection {* A Two-Element Series *} 43.244 +subsubsection \<open>A Two-Element Series\<close> 43.245 43.246 definition binaryset :: "'a set \<Rightarrow> 'a set \<Rightarrow> nat \<Rightarrow> 'a set " 43.247 where "binaryset A B = (\<lambda>x. {})(0 := A, Suc 0 := B)" 43.248 @@ -937,7 +937,7 @@ 43.249 lemma UN_binaryset_eq: "(\<Union>i. binaryset A B i) = A \<union> B" 43.250 by (simp add: SUP_def range_binaryset_eq) 43.251 43.252 -subsubsection {* Closed CDI *} 43.253 +subsubsection \<open>Closed CDI\<close> 43.254 43.255 definition closed_cdi where 43.256 "closed_cdi \<Omega> M \<longleftrightarrow> 43.257 @@ -1171,7 +1171,7 @@ 43.258 by blast 43.259 qed 43.260 43.261 -subsubsection {* Dynkin systems *} 43.262 +subsubsection \<open>Dynkin systems\<close> 43.263 43.264 locale dynkin_system = subset_class + 43.265 assumes space: "\<Omega> \<in> M" 43.266 @@ -1193,7 +1193,7 @@ 43.267 by (auto simp: image_iff split: split_if_asm) 43.268 moreover 43.269 have "disjoint_family ?f" unfolding disjoint_family_on_def 43.270 - using D \<in> M[THEN sets_into_space] D \<subseteq> E by auto 43.271 + using \<open>D \<in> M\<close>[THEN sets_into_space] \<open>D \<subseteq> E\<close> by auto 43.272 ultimately have "\<Omega> - (D \<union> (\<Omega> - E)) \<in> M" 43.273 using sets by auto 43.274 also have "\<Omega> - (D \<union> (\<Omega> - E)) = E - D" 43.275 @@ -1265,7 +1265,7 @@ 43.276 "\<Omega> - A \<in> M" "\<Omega> - B \<in> M" 43.277 using sets_into_space by auto 43.278 then show "A \<union> B \<in> M" 43.279 - using Int_stable M unfolding Int_stable_def by auto 43.280 + using \<open>Int_stable M\<close> unfolding Int_stable_def by auto 43.281 qed auto 43.282 qed 43.283 43.284 @@ -1314,15 +1314,15 @@ 43.285 shows "dynkin_system \<Omega> {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> D \<in> M}" 43.286 proof (rule dynkin_systemI, simp_all) 43.287 have "\<Omega> \<inter> D = D" 43.288 - using D \<in> M sets_into_space by auto 43.289 + using \<open>D \<in> M\<close> sets_into_space by auto 43.290 then show "\<Omega> \<inter> D \<in> M" 43.291 - using D \<in> M by auto 43.292 + using \<open>D \<in> M\<close> by auto 43.293 next 43.294 fix A assume "A \<subseteq> \<Omega> \<and> A \<inter> D \<in> M" 43.295 moreover have "(\<Omega> - A) \<inter> D = (\<Omega> - (A \<inter> D)) - (\<Omega> - D)" 43.296 by auto 43.297 ultimately show "\<Omega> - A \<subseteq> \<Omega> \<and> (\<Omega> - A) \<inter> D \<in> M" 43.298 - using D \<in> M by (auto intro: diff) 43.299 + using \<open>D \<in> M\<close> by (auto intro: diff) 43.300 next 43.301 fix A :: "nat \<Rightarrow> 'a set" 43.302 assume "disjoint_family A" "range A \<subseteq> {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> D \<in> M}" 43.303 @@ -1340,7 +1340,7 @@ 43.304 have "dynkin_system \<Omega> M" .. 43.305 then have "dynkin_system \<Omega> M" 43.306 using assms unfolding dynkin_system_def dynkin_system_axioms_def subset_class_def by simp 43.307 - with N \<subseteq> M show ?thesis by (auto simp add: dynkin_def) 43.308 + with \<open>N \<subseteq> M\<close> show ?thesis by (auto simp add: dynkin_def) 43.309 qed 43.310 43.311 lemma sigma_eq_dynkin: 43.312 @@ -1363,22 +1363,22 @@ 43.313 proof 43.314 fix E assume "E \<in> M" 43.315 then have "M \<subseteq> ?D E" "E \<in> dynkin \<Omega> M" 43.316 - using sets_into_space Int_stable M by (auto simp: Int_stable_def) 43.317 + using sets_into_space \<open>Int_stable M\<close> by (auto simp: Int_stable_def) 43.318 then have "dynkin \<Omega> M \<subseteq> ?D E" 43.319 - using restricted_dynkin_system E \<in> dynkin \<Omega> M 43.320 + using restricted_dynkin_system \<open>E \<in> dynkin \<Omega> M\<close> 43.321 by (intro dynkin_system.dynkin_subset) simp_all 43.322 then have "B \<in> ?D E" 43.323 - using B \<in> dynkin \<Omega> M by auto 43.324 + using \<open>B \<in> dynkin \<Omega> M\<close> by auto 43.325 then have "E \<inter> B \<in> dynkin \<Omega> M" 43.326 by (subst Int_commute) simp 43.327 then show "E \<in> ?D B" 43.328 - using sets E \<in> M by auto 43.329 + using sets \<open>E \<in> M\<close> by auto 43.330 qed 43.331 then have "dynkin \<Omega> M \<subseteq> ?D B" 43.332 - using restricted_dynkin_system B \<in> dynkin \<Omega> M 43.333 + using restricted_dynkin_system \<open>B \<in> dynkin \<Omega> M\<close> 43.334 by (intro dynkin_system.dynkin_subset) simp_all 43.335 then show "A \<inter> B \<in> dynkin \<Omega> M" 43.336 - using A \<in> dynkin \<Omega> M sets_into_space by auto 43.337 + using \<open>A \<in> dynkin \<Omega> M\<close> sets_into_space by auto 43.338 qed 43.339 from sigma_algebra.sigma_sets_subset[OF this, of "M"] 43.340 have "sigma_sets (\<Omega>) (M) \<subseteq> dynkin \<Omega> M" by auto 43.341 @@ -1409,17 +1409,17 @@ 43.342 have "E \<subseteq> Pow \<Omega>" 43.343 using E sets_into_space by force 43.344 then have *: "sigma_sets \<Omega> E = dynkin \<Omega> E" 43.345 - using Int_stable E by (rule sigma_eq_dynkin) 43.346 + using \<open>Int_stable E\<close> by (rule sigma_eq_dynkin) 43.347 then have "dynkin \<Omega> E = M" 43.348 using assms dynkin_subset[OF E(1)] by simp 43.349 with * show ?thesis 43.350 using assms by (auto simp: dynkin_def) 43.351 qed 43.352 43.353 -subsubsection {* Induction rule for intersection-stable generators *} 43.354 +subsubsection \<open>Induction rule for intersection-stable generators\<close> 43.355 43.356 -text {* The reason to introduce Dynkin-systems is the following induction rules for$\sigma$-algebras 43.357 -generated by a generator closed under intersection. *} 43.358 +text \<open>The reason to introduce Dynkin-systems is the following induction rules for$\sigma$-algebras 43.359 +generated by a generator closed under intersection.\<close> 43.360 43.361 lemma sigma_sets_induct_disjoint[consumes 3, case_names basic empty compl union]: 43.362 assumes "Int_stable G" 43.363 @@ -1438,11 +1438,11 @@ 43.364 interpret dynkin_system \<Omega> ?D 43.365 by standard (auto dest: sets_into_space intro!: space compl union) 43.366 have "sigma_sets \<Omega> G = ?D" 43.367 - by (rule dynkin_lemma) (auto simp: basic Int_stable G) 43.368 + by (rule dynkin_lemma) (auto simp: basic \<open>Int_stable G\<close>) 43.369 with A show ?thesis by auto 43.370 qed 43.371 43.372 -subsection {* Measure type *} 43.373 +subsection \<open>Measure type\<close> 43.374 43.375 definition positive :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ereal) \<Rightarrow> bool" where 43.376 "positive M \<mu> \<longleftrightarrow> \<mu> {} = 0 \<and> (\<forall>A\<in>M. 0 \<le> \<mu> A)" 43.377 @@ -1554,7 +1554,7 @@ 43.378 hence "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) 43.379 (\<lambda>a. if a \<in> sigma_sets \<Omega> A then \<mu> a else 0)" 43.380 by(rule measure_space_eq) auto 43.381 - with True A \<subseteq> Pow \<Omega> show ?thesis 43.382 + with True \<open>A \<subseteq> Pow \<Omega>\<close> show ?thesis 43.383 by(simp add: measure_of_def space_def sets_def emeasure_def Abs_measure_inverse) 43.384 next 43.385 case False thus ?thesis 43.386 @@ -1599,10 +1599,10 @@ 43.387 next 43.388 case Empty show ?case by (rule sigma_sets.Empty) 43.389 next 43.390 - from assms have "A \<in> sets (sigma C D)" by (subst sets_measure_of[OF D \<subseteq> Pow C]) 43.391 - moreover case (Compl a) hence "a \<in> sets (sigma C D)" by (subst sets_measure_of[OF D \<subseteq> Pow C]) 43.392 + from assms have "A \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) 43.393 + moreover case (Compl a) hence "a \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) 43.394 ultimately have "A - a \<in> sets (sigma C D)" .. 43.395 - thus ?case by (subst (asm) sets_measure_of[OF D \<subseteq> Pow C]) 43.396 + thus ?case by (subst (asm) sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) 43.397 next 43.398 case (Union a) 43.399 thus ?case by (intro sigma_sets.Union) 43.400 @@ -1616,7 +1616,7 @@ 43.401 by (metis Pow_empty Sup_bot_conv(1) cSup_singleton empty_iff 43.402 sets.sigma_sets_eq sets.space_closed sigma_sets_top subset_singletonD) 43.403 43.404 -subsubsection {* Constructing simple @{typ "'a measure"} *} 43.405 +subsubsection \<open>Constructing simple @{typ "'a measure"}\<close> 43.406 43.407 lemma emeasure_measure_of: 43.408 assumes M: "M = measure_of \<Omega> A \<mu>" 43.409 @@ -1671,17 +1671,17 @@ 43.410 interpret N: sigma_algebra \<Omega>' A' using measure_measure by (auto simp: measure_space_def) 43.411 have "A = sets M" "A' = sets N" 43.412 using measure_measure by (simp_all add: sets_def Abs_measure_inverse) 43.413 - with sets M = sets N have AA': "A = A'" by simp 43.414 + with \<open>sets M = sets N\<close> have AA': "A = A'" by simp 43.415 moreover from M.top N.top M.space_closed N.space_closed AA' have "\<Omega> = \<Omega>'" by auto 43.416 moreover { fix B have "\<mu> B = \<mu>' B" 43.417 proof cases 43.418 assume "B \<in> A" 43.419 - with eq A = sets M have "emeasure M B = emeasure N B" by simp 43.420 + with eq \<open>A = sets M\<close> have "emeasure M B = emeasure N B" by simp 43.421 with measure_measure show "\<mu> B = \<mu>' B" 43.422 by (simp add: emeasure_def Abs_measure_inverse) 43.423 next 43.424 assume "B \<notin> A" 43.425 - with A = sets M A' = sets N A = A' have "B \<notin> sets M" "B \<notin> sets N" 43.426 + with \<open>A = sets M\<close> \<open>A' = sets N\<close> \<open>A = A'\<close> have "B \<notin> sets M" "B \<notin> sets N" 43.427 by auto 43.428 then have "emeasure M B = 0" "emeasure N B = 0" 43.429 by (simp_all add: emeasure_notin_sets) 43.430 @@ -1698,7 +1698,7 @@ 43.431 shows "sigma \<Omega> M = sigma \<Omega> N" 43.432 by (rule measure_eqI) (simp_all add: emeasure_sigma) 43.433 43.434 -subsubsection {* Measurable functions *} 43.435 +subsubsection \<open>Measurable functions\<close> 43.436 43.437 definition measurable :: "'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) set" where 43.438 "measurable A B = {f \<in> space A \<rightarrow> space B. \<forall>y \<in> sets B. f - y \<inter> space A \<in> sets A}" 43.439 @@ -1860,7 +1860,7 @@ 43.440 measurable (measure_of \<Omega> M \<mu>) N \<subseteq> measurable (measure_of \<Omega> M' \<mu>') N" 43.441 using measure_of_subset[of M' \<Omega> M] by (auto simp add: measurable_def) 43.442 43.443 -subsubsection {* Counting space *} 43.444 +subsubsection \<open>Counting space\<close> 43.445 43.446 definition count_space :: "'a set \<Rightarrow> 'a measure" where 43.447 "count_space \<Omega> = measure_of \<Omega> (Pow \<Omega>) (\<lambda>A. if finite A then ereal (card A) else \<infinity>)" 43.448 @@ -1898,11 +1898,11 @@ 43.449 shows "f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f - {a} \<inter> space M \<in> sets M))" 43.450 proof - 43.451 { fix X assume "X \<subseteq> A" "f \<in> space M \<rightarrow> A" 43.452 - with countable A have "f - X \<inter> space M = (\<Union>a\<in>X. f - {a} \<inter> space M)" "countable X" 43.453 + with \<open>countable A\<close> have "f - X \<inter> space M = (\<Union>a\<in>X. f - {a} \<inter> space M)" "countable X" 43.454 by (auto dest: countable_subset) 43.455 moreover assume "\<forall>a\<in>A. f - {a} \<inter> space M \<in> sets M" 43.456 ultimately have "f - X \<inter> space M \<in> sets M" 43.457 - using X \<subseteq> A by (auto intro!: sets.countable_UN' simp del: UN_simps) } 43.458 + using \<open>X \<subseteq> A\<close> by (auto intro!: sets.countable_UN' simp del: UN_simps) } 43.459 then show ?thesis 43.460 unfolding measurable_def by auto 43.461 qed 43.462 @@ -1938,7 +1938,7 @@ 43.463 "space N = {} \<Longrightarrow> f \<in> measurable M N \<longleftrightarrow> space M = {}" 43.464 by (auto simp add: measurable_def Pi_iff) 43.465 43.466 -subsubsection {* Extend measure *} 43.467 +subsubsection \<open>Extend measure\<close> 43.468 43.469 definition "extend_measure \<Omega> I G \<mu> = 43.470 (if (\<exists>\<mu>'. (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (GI)) \<mu>') \<and> \<not> (\<forall>i\<in>I. \<mu> i = 0) 43.471 @@ -1961,10 +1961,10 @@ 43.472 assume *: "(\<forall>i\<in>I. \<mu> i = 0)" 43.473 with M have M_eq: "M = measure_of \<Omega> (GI) (\<lambda>_. 0)" 43.474 by (simp add: extend_measure_def) 43.475 - from measure_space_0[OF ms(1)] ms i\<in>I 43.476 + from measure_space_0[OF ms(1)] ms \<open>i\<in>I\<close> 43.477 have "emeasure M (G i) = 0" 43.478 by (intro emeasure_measure_of[OF M_eq]) (auto simp add: M measure_space_def sets_extend_measure) 43.479 - with i\<in>I * show ?thesis 43.480 + with \<open>i\<in>I\<close> * show ?thesis 43.481 by simp 43.482 next 43.483 def P \<equiv> "\<lambda>\<mu>'. (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (GI)) \<mu>'" 43.484 @@ -1978,14 +1978,14 @@ 43.485 ultimately have M_eq: "M = measure_of \<Omega> (GI) (Eps P)" 43.486 by (simp add: M extend_measure_def P_def[symmetric]) 43.487 43.488 - from \<exists>\<mu>'. P \<mu>' have P: "P (Eps P)" by (rule someI_ex) 43.489 + from \<open>\<exists>\<mu>'. P \<mu>'\<close> have P: "P (Eps P)" by (rule someI_ex) 43.490 show "emeasure M (G i) = \<mu> i" 43.491 proof (subst emeasure_measure_of[OF M_eq]) 43.492 have sets_M: "sets M = sigma_sets \<Omega> (GI)" 43.493 using M_eq ms by (auto simp: sets_extend_measure) 43.494 - then show "G i \<in> sets M" using i \<in> I by auto 43.495 + then show "G i \<in> sets M" using \<open>i \<in> I\<close> by auto 43.496 show "positive (sets M) (Eps P)" "countably_additive (sets M) (Eps P)" "Eps P (G i) = \<mu> i" 43.497 - using P i\<in>I by (auto simp add: sets_M measure_space_def P_def) 43.498 + using P \<open>i\<in>I\<close> by (auto simp add: sets_M measure_space_def P_def) 43.499 qed fact 43.500 qed 43.501 43.502 @@ -1995,10 +1995,10 @@ 43.503 and ms: "\<And>i j. I i j \<Longrightarrow> G i j \<in> Pow \<Omega>" "positive (sets M) \<mu>'" "countably_additive (sets M) \<mu>'" 43.504 and "I i j" 43.505 shows "emeasure M (G i j) = \<mu> i j" 43.506 - using emeasure_extend_measure[OF M _ _ ms(2,3), of "(i,j)"] eq ms(1) I i j 43.507 + using emeasure_extend_measure[OF M _ _ ms(2,3), of "(i,j)"] eq ms(1) \<open>I i j\<close> 43.508 by (auto simp: subset_eq) 43.509 43.510 -subsubsection {* Supremum of a set of$\sigma$-algebras *} 43.511 +subsubsection \<open>Supremum of a set of$\sigma$-algebras\<close> 43.512 43.513 definition "Sup_sigma M = sigma (\<Union>x\<in>M. space x) (\<Union>x\<in>M. sets x)" 43.514 43.515 @@ -2078,7 +2078,7 @@ 43.516 by (simp add: image_image) 43.517 qed 43.518 43.519 -subsection {* The smallest$\sigma$-algebra regarding a function *} 43.520 +subsection \<open>The smallest$\sigma\$-algebra regarding a function\<close>
43.521
43.522  definition
43.523    "vimage_algebra X f M = sigma X {f - A \<inter> X | A. A \<in> sets M}"
43.524 @@ -2178,7 +2178,7 @@
43.525      using assms by (rule sets_vimage_Sup_eq)
43.526  qed (simp add: vimage_algebra_def Sup_sigma_def emeasure_sigma)
43.527
43.528 -subsubsection {* Restricted Space Sigma Algebra *}
43.529 +subsubsection \<open>Restricted Space Sigma Algebra\<close>
43.530
43.531  definition restrict_space where
43.532    "restrict_space M \<Omega> = measure_of (\<Omega> \<inter> space M) ((op \<inter> \<Omega>)  sets M) (emeasure M)"
43.533 @@ -2263,7 +2263,7 @@
43.534      by (auto simp: space_restrict_space)
43.535    also have "\<dots> \<in> sets (restrict_space M \<Omega>)"
43.536      unfolding sets_restrict_space
43.537 -    using measurable_sets[OF f A \<in> sets N] by blast
43.538 +    using measurable_sets[OF f \<open>A \<in> sets N\<close>] by blast
43.539    finally show "f - A \<inter> space (restrict_space M \<Omega>) \<in> sets (restrict_space M \<Omega>)" .
43.540  qed
43.541
43.542 @@ -2324,7 +2324,7 @@
43.543    shows "(\<lambda>x. if x \<in> A then f x else g x) \<in> measurable M M'"
43.544  proof (rule measurable_If[OF measure])
43.545    have "{x \<in> space M. x \<in> A} = A \<inter> space M" by auto
43.546 -  thus "{x \<in> space M. x \<in> A} \<in> sets M" using A \<inter> space M \<in> sets M by auto
43.547 +  thus "{x \<in> space M. x \<in> A} \<in> sets M" using \<open>A \<inter> space M \<in> sets M\<close> by auto
43.548  qed
43.549
43.550  lemma measurable_restrict_space_iff:

    44.1 --- a/src/HOL/Probability/Stream_Space.thy	Mon Dec 07 16:48:10 2015 +0000
44.2 +++ b/src/HOL/Probability/Stream_Space.thy	Mon Dec 07 20:19:59 2015 +0100
44.3 @@ -76,7 +76,7 @@
44.4    shows "f \<in> measurable N (stream_space M)"
44.5  proof (rule measurable_stream_space2)
44.6    fix n show "(\<lambda>x. f x !! n) \<in> measurable N M"
44.7 -    using F f by (induction n arbitrary: f) (auto intro: h t)
44.8 +    using \<open>F f\<close> by (induction n arbitrary: f) (auto intro: h t)
44.9  qed
44.10
44.11  lemma measurable_sdrop[measurable]: "sdrop n \<in> measurable (stream_space M) (stream_space M)"
44.12 @@ -355,11 +355,11 @@
44.13          case (Suc i) from this[of "stl x"] show ?case
44.14            by (simp add: length_Suc_conv Bex_def ex_simps[symmetric] del: ex_simps)
44.15               (metis stream.collapse streams_Stream)
44.16 -      qed (insert a \<in> S, auto intro: streams_stl in_streams) }
44.17 +      qed (insert \<open>a \<in> S\<close>, auto intro: streams_stl in_streams) }
44.18      then have "(\<lambda>x. x !! i) - {a} \<inter> streams S = (\<Union>xs\<in>{xs\<in>lists S. length xs = i}. sstart S (xs @ [a]))"
44.19        by (auto simp add: set_eq_iff)
44.20      also have "\<dots> \<in> sets ?S"
44.21 -      using a\<in>S by (intro sets.countable_UN') (auto intro!: sigma_sets.Basic image_eqI)
44.22 +      using \<open>a\<in>S\<close> by (intro sets.countable_UN') (auto intro!: sigma_sets.Basic image_eqI)
44.23      finally have " (\<lambda>x. x !! i) - {a} \<inter> streams S \<in> sets ?S" . }
44.24    then show "sets (stream_space (count_space S)) \<subseteq> sets (sigma (streams S) (sstart Slists S \<union> {{}}))"
44.25      by (intro sets_stream_space_in_sets) (auto simp: measurable_count_space_eq_countable snth_in)

    45.1 --- a/src/HOL/Probability/ex/Dining_Cryptographers.thy	Mon Dec 07 16:48:10 2015 +0000
45.2 +++ b/src/HOL/Probability/ex/Dining_Cryptographers.thy	Mon Dec 07 20:19:59 2015 +0100
45.3 @@ -8,9 +8,9 @@
45.4  lemma Ex1_eq: "\<exists>!x. P x \<Longrightarrow> P x \<Longrightarrow> P y \<Longrightarrow> x = y"
45.5    by auto
45.6
45.7 -subsection {* Define the state space *}
45.8 +subsection \<open>Define the state space\<close>
45.9
45.10 -text {*
45.11 +text \<open>
45.12
45.13  We introduce the state space on which the algorithm operates.
45.14
45.15 @@ -35,7 +35,7 @@
45.16
45.17  The observables are the \emph{inversions}
45.18
45.19 -*}
45.20 +\<close>
45.21
45.22  locale dining_cryptographers_space =
45.23    fixes n :: nat
45.24 @@ -64,11 +64,11 @@
45.25    have foldl_coin:
45.26      "\<not> ?XOR (\<lambda>c. coin dc c \<noteq> coin dc (c + 1)) n"
45.27    proof -
45.28 -    def n' \<equiv> n -- "Need to hide n, as it is hidden in coin"
45.29 +    def n' \<equiv> n \<comment> "Need to hide n, as it is hidden in coin"
45.30      have "?XOR (\<lambda>c. coin dc c \<noteq> coin dc (c + 1)) n'
45.31          = (coin dc 0 \<noteq> coin dc n')"
45.32        by (induct n') auto
45.33 -    thus ?thesis using n' \<equiv> n by simp
45.34 +    thus ?thesis using \<open>n' \<equiv> n\<close> by simp
45.35    qed
45.36
45.37    from assms have "payer dc = None \<or> (\<exists>k<n. payer dc = Some k)"
45.38 @@ -81,22 +81,22 @@
45.39    next
45.40      assume "\<exists>k<n. payer dc = Some k"
45.41      then obtain k where "k < n" and "payer dc = Some k" by auto
45.42 -    def l \<equiv> n -- "Need to hide n, as it is hidden in coin, payer etc."
45.43 +    def l \<equiv> n \<comment> "Need to hide n, as it is hidden in coin, payer etc."
45.44      have "?XOR (\<lambda>c. (payer dc = Some c) \<noteq> (coin dc c \<noteq> coin dc (c + 1))) l =
45.45          ((k < l) \<noteq> ?XOR (\<lambda>c. (coin dc c \<noteq> coin dc (c + 1))) l)"
45.46 -      using payer dc = Some k by (induct l) auto
45.47 +      using \<open>payer dc = Some k\<close> by (induct