# HG changeset patch # User hoelzl # Date 1295017213 -3600 # Node ID 4638b1210d26009490ca30d5750a2d008333650c # Parent a5478b1c8b8aa594564287a23b566b56cf389234# Parent 2a12c23b7a34c08b8c2b73b60c67d16e312f19af merged diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Fri Jan 14 16:00:13 2011 +0100 @@ -170,7 +170,7 @@ qed lemma (in sigma_algebra) borel_measurable_subalgebra: - assumes "N \ sets M" "f \ borel_measurable (M\sets:=N\)" + assumes "sets N \ sets M" "space N = space M" "f \ borel_measurable N" shows "f \ borel_measurable M" using assms unfolding measurable_def by auto diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Fri Jan 14 16:00:13 2011 +0100 @@ -463,12 +463,12 @@ qed lemma (in sigma_algebra) simple_function_subalgebra: - assumes "sigma_algebra.simple_function (M\sets:=N\) f" - and N_subalgebra: "N \ sets M" "sigma_algebra (M\sets:=N\)" + assumes "sigma_algebra.simple_function N f" + and N_subalgebra: "sets N \ sets M" "space N = space M" "sigma_algebra N" shows "simple_function f" using assms unfolding simple_function_def - unfolding sigma_algebra.simple_function_def[OF N_subalgebra(2)] + unfolding sigma_algebra.simple_function_def[OF N_subalgebra(3)] by auto lemma (in sigma_algebra) simple_function_vimage: @@ -489,7 +489,7 @@ section "Simple integral" -definition (in measure_space) +definition (in measure_space) simple_integral (binder "\\<^isup>S " 10) where "simple_integral f = (\x \ f ` space M. x * \ (f -` {x} \ space M))" lemma (in measure_space) simple_integral_cong: @@ -514,7 +514,7 @@ qed lemma (in measure_space) simple_integral_const[simp]: - "simple_integral (\x. c) = c * \ (space M)" + "(\\<^isup>Sx. c) = c * \ (space M)" proof (cases "space M = {}") case True thus ?thesis unfolding simple_integral_def by simp next @@ -579,7 +579,7 @@ lemma (in measure_space) simple_integral_add[simp]: assumes "simple_function f" and "simple_function g" - shows "simple_integral (\x. f x + g x) = simple_integral f + simple_integral g" + shows "(\\<^isup>Sx. f x + g x) = simple_integral f + simple_integral g" proof - { fix x let ?S = "g -` {g x} \ f -` {f x} \ space M" assume "x \ space M" @@ -597,7 +597,7 @@ lemma (in measure_space) simple_integral_setsum[simp]: assumes "\i. i \ P \ simple_function (f i)" - shows "simple_integral (\x. \i\P. f i x) = (\i\P. simple_integral (f i))" + shows "(\\<^isup>Sx. \i\P. f i x) = (\i\P. simple_integral (f i))" proof cases assume "finite P" from this assms show ?thesis @@ -606,7 +606,7 @@ lemma (in measure_space) simple_integral_mult[simp]: assumes "simple_function f" - shows "simple_integral (\x. c * f x) = c * simple_integral f" + shows "(\\<^isup>Sx. c * f x) = c * simple_integral f" proof - note mult = simple_function_mult[OF simple_function_const[of c] assms] { fix x let ?S = "f -` {f x} \ (\x. c * f x) -` {c * f x} \ space M" @@ -700,11 +700,11 @@ lemma (in measure_space) simple_integral_indicator: assumes "A \ sets M" assumes "simple_function f" - shows "simple_integral (\x. f x * indicator A x) = + shows "(\\<^isup>Sx. f x * indicator A x) = (\x \ f ` space M. x * \ (f -` {x} \ space M \ A))" proof cases assume "A = space M" - moreover hence "simple_integral (\x. f x * indicator A x) = simple_integral f" + moreover hence "(\\<^isup>Sx. f x * indicator A x) = simple_integral f" by (auto intro!: simple_integral_cong) moreover have "\X. X \ space M \ space M = X \ space M" by auto ultimately show ?thesis by (simp add: simple_integral_def) @@ -720,7 +720,7 @@ next show "0 \ ?I ` space M" using x by (auto intro!: image_eqI[of _ _ x]) qed - have *: "simple_integral (\x. f x * indicator A x) = + have *: "(\\<^isup>Sx. f x * indicator A x) = (\x \ f ` space M \ {0}. x * \ (f -` {x} \ space M \ A))" unfolding simple_integral_def I proof (rule setsum_mono_zero_cong_left) @@ -760,18 +760,18 @@ lemma (in measure_space) simple_integral_null_set: assumes "simple_function u" "N \ null_sets" - shows "simple_integral (\x. u x * indicator N x) = 0" + shows "(\\<^isup>Sx. u x * indicator N x) = 0" proof - have "AE x. indicator N x = (0 :: pextreal)" using `N \ null_sets` by (auto simp: indicator_def intro!: AE_I[of _ N]) - then have "simple_integral (\x. u x * indicator N x) = simple_integral (\x. 0)" + then have "(\\<^isup>Sx. u x * indicator N x) = (\\<^isup>Sx. 0)" using assms by (intro simple_integral_cong_AE) (auto intro!: AE_disjI2) then show ?thesis by simp qed lemma (in measure_space) simple_integral_cong_AE_mult_indicator: assumes sf: "simple_function f" and eq: "AE x. x \ S" and "S \ sets M" - shows "simple_integral f = simple_integral (\x. f x * indicator S x)" + shows "simple_integral f = (\\<^isup>Sx. f x * indicator S x)" proof (rule simple_integral_cong_AE) show "simple_function f" by fact show "simple_function (\x. f x * indicator S x)" @@ -783,7 +783,7 @@ lemma (in measure_space) simple_integral_restricted: assumes "A \ sets M" assumes sf: "simple_function (\x. f x * indicator A x)" - shows "measure_space.simple_integral (restricted_space A) \ f = simple_integral (\x. f x * indicator A x)" + shows "measure_space.simple_integral (restricted_space A) \ f = (\\<^isup>Sx. f x * indicator A x)" (is "_ = simple_integral ?f") unfolding measure_space.simple_integral_def[OF restricted_measure_space[OF `A \ sets M`]] unfolding simple_integral_def @@ -809,11 +809,11 @@ unfolding pextreal_mult_cancel_left by auto qed -lemma (in measure_space) simple_integral_subalgebra[simp]: - assumes "measure_space (M\sets := N\) \" - shows "measure_space.simple_integral (M\sets := N\) \ = simple_integral" +lemma (in measure_space) simple_integral_subalgebra: + assumes N: "measure_space N \" and [simp]: "space N = space M" + shows "measure_space.simple_integral N \ = simple_integral" unfolding simple_integral_def_raw - unfolding measure_space.simple_integral_def_raw[OF assms] by simp + unfolding measure_space.simple_integral_def_raw[OF N] by simp lemma (in measure_space) simple_integral_vimage: fixes g :: "'a \ pextreal" and f :: "'d \ 'a" @@ -842,7 +842,7 @@ section "Continuous posititve integration" -definition (in measure_space) +definition (in measure_space) positive_integral (binder "\\<^isup>+ " 10) where "positive_integral f = SUPR {g. simple_function g \ g \ f} simple_integral" lemma (in measure_space) positive_integral_alt: @@ -1071,7 +1071,7 @@ fixes g :: "'d \ pextreal" and f :: "'d \ 'a" assumes f: "bij_inv S (space M) f h" shows "measure_space.positive_integral (vimage_algebra S f) (\A. \ (f ` A)) g = - positive_integral (\x. g (h x))" + (\\<^isup>+x. g (h x))" proof - interpret v: measure_space "vimage_algebra S f" "\A. \ (f ` A)" using f by (rule measure_space_isomorphic[OF bij_inv_bij_betw(1)]) @@ -1149,7 +1149,7 @@ unfolding pextreal_SUP_cmult[symmetric] proof (safe intro!: SUP_mono bexI) fix i - have "a * simple_integral (?uB i) = simple_integral (\x. a * ?uB i x)" + have "a * simple_integral (?uB i) = (\\<^isup>Sx. a * ?uB i x)" using B `simple_function u` by (subst simple_integral_mult[symmetric]) (auto simp: field_simps) also have "\ \ positive_integral (f i)" @@ -1193,7 +1193,7 @@ lemma (in measure_space) positive_integral_monotone_convergence_SUP: assumes "\i x. x \ space M \ f i x \ f (Suc i) x" assumes "\i. f i \ borel_measurable M" - shows "(SUP i. positive_integral (f i)) = positive_integral (\x. SUP i. f i x)" + shows "(SUP i. positive_integral (f i)) = (\\<^isup>+ x. SUP i. f i x)" (is "_ = positive_integral ?u") proof - show ?thesis @@ -1236,7 +1236,7 @@ qed lemma (in measure_space) positive_integral_const[simp]: - "positive_integral (\x. c) = c * \ (space M)" + "(\\<^isup>+ x. c) = c * \ (space M)" by (subst positive_integral_eq_simple_integral) auto lemma (in measure_space) positive_integral_isoton_simple: @@ -1248,7 +1248,7 @@ lemma (in measure_space) positive_integral_linear: assumes f: "f \ borel_measurable M" and g: "g \ borel_measurable M" - shows "positive_integral (\x. a * f x + g x) = + shows "(\\<^isup>+ x. a * f x + g x) = a * positive_integral f + positive_integral g" (is "positive_integral ?L = _") proof - @@ -1276,30 +1276,32 @@ lemma (in measure_space) positive_integral_cmult: assumes "f \ borel_measurable M" - shows "positive_integral (\x. c * f x) = c * positive_integral f" + shows "(\\<^isup>+ x. c * f x) = c * positive_integral f" using positive_integral_linear[OF assms, of "\x. 0" c] by auto lemma (in measure_space) positive_integral_multc: assumes "f \ borel_measurable M" - shows "positive_integral (\x. f x * c) = positive_integral f * c" + shows "(\\<^isup>+ x. f x * c) = positive_integral f * c" unfolding mult_commute[of _ c] positive_integral_cmult[OF assms] by simp lemma (in measure_space) positive_integral_indicator[simp]: - "A \ sets M \ positive_integral (\x. indicator A x) = \ A" -by (subst positive_integral_eq_simple_integral) (auto simp: simple_function_indicator simple_integral_indicator) + "A \ sets M \ (\\<^isup>+ x. indicator A x) = \ A" + by (subst positive_integral_eq_simple_integral) + (auto simp: simple_function_indicator simple_integral_indicator) lemma (in measure_space) positive_integral_cmult_indicator: - "A \ sets M \ positive_integral (\x. c * indicator A x) = c * \ A" -by (subst positive_integral_eq_simple_integral) (auto simp: simple_function_indicator simple_integral_indicator) + "A \ sets M \ (\\<^isup>+ x. c * indicator A x) = c * \ A" + by (subst positive_integral_eq_simple_integral) + (auto simp: simple_function_indicator simple_integral_indicator) lemma (in measure_space) positive_integral_add: assumes "f \ borel_measurable M" "g \ borel_measurable M" - shows "positive_integral (\x. f x + g x) = positive_integral f + positive_integral g" + shows "(\\<^isup>+ x. f x + g x) = positive_integral f + positive_integral g" using positive_integral_linear[OF assms, of 1] by simp lemma (in measure_space) positive_integral_setsum: assumes "\i. i\P \ f i \ borel_measurable M" - shows "positive_integral (\x. \i\P. f i x) = (\i\P. positive_integral (f i))" + shows "(\\<^isup>+ x. \i\P. f i x) = (\i\P. positive_integral (f i))" proof cases assume "finite P" from this assms show ?thesis @@ -1317,11 +1319,11 @@ assumes f: "f \ borel_measurable M" and g: "g \ borel_measurable M" and fin: "positive_integral g \ \" and mono: "\x. x \ space M \ g x \ f x" - shows "positive_integral (\x. f x - g x) = positive_integral f - positive_integral g" + shows "(\\<^isup>+ x. f x - g x) = positive_integral f - positive_integral g" proof - have borel: "(\x. f x - g x) \ borel_measurable M" using f g by (rule borel_measurable_pextreal_diff) - have "positive_integral (\x. f x - g x) + positive_integral g = + have "(\\<^isup>+x. f x - g x) + positive_integral g = positive_integral f" unfolding positive_integral_add[OF borel g, symmetric] proof (rule positive_integral_cong) @@ -1335,9 +1337,9 @@ lemma (in measure_space) positive_integral_psuminf: assumes "\i. f i \ borel_measurable M" - shows "positive_integral (\x. \\<^isub>\ i. f i x) = (\\<^isub>\ i. positive_integral (f i))" + shows "(\\<^isup>+ x. \\<^isub>\ i. f i x) = (\\<^isub>\ i. positive_integral (f i))" proof - - have "(\i. positive_integral (\x. \i positive_integral (\x. \\<^isub>\i. f i x)" + have "(\i. (\\<^isup>+x. \i (\\<^isup>+x. \\<^isub>\i. f i x)" by (rule positive_integral_isoton) (auto intro!: borel_measurable_pextreal_setsum assms positive_integral_mono arg_cong[where f=Sup] @@ -1350,11 +1352,11 @@ lemma (in measure_space) positive_integral_lim_INF: fixes u :: "nat \ 'a \ pextreal" assumes "\i. u i \ borel_measurable M" - shows "positive_integral (\x. SUP n. INF m. u (m + n) x) \ + shows "(\\<^isup>+ x. SUP n. INF m. u (m + n) x) \ (SUP n. INF m. positive_integral (u (m + n)))" proof - - have "positive_integral (\x. SUP n. INF m. u (m + n) x) - = (SUP n. positive_integral (\x. INF m. u (m + n) x))" + have "(\\<^isup>+x. SUP n. INF m. u (m + n) x) + = (SUP n. (\\<^isup>+x. INF m. u (m + n) x))" using assms by (intro positive_integral_monotone_convergence_SUP[symmetric] INF_mono) (auto simp del: add_Suc simp add: add_Suc[symmetric]) @@ -1365,7 +1367,7 @@ lemma (in measure_space) measure_space_density: assumes borel: "u \ borel_measurable M" - shows "measure_space M (\A. positive_integral (\x. u x * indicator A x))" (is "measure_space M ?v") + shows "measure_space M (\A. (\\<^isup>+ x. u x * indicator A x))" (is "measure_space M ?v") proof show "?v {} = 0" by simp show "countably_additive M ?v" @@ -1384,8 +1386,8 @@ lemma (in measure_space) positive_integral_translated_density: assumes "f \ borel_measurable M" "g \ borel_measurable M" - shows "measure_space.positive_integral M (\A. positive_integral (\x. f x * indicator A x)) g = - positive_integral (\x. f x * g x)" (is "measure_space.positive_integral M ?T _ = _") + shows "measure_space.positive_integral M (\A. (\\<^isup>+ x. f x * indicator A x)) g = + (\\<^isup>+ x. f x * g x)" (is "measure_space.positive_integral M ?T _ = _") proof - from measure_space_density[OF assms(1)] interpret T: measure_space M ?T . @@ -1399,30 +1401,30 @@ using G(1) unfolding simple_function_def by auto have "T.positive_integral (G i) = T.simple_integral (G i)" using G T.positive_integral_eq_simple_integral by simp - also have "\ = positive_integral (\x. f x * (\y\G i`space M. y * indicator (G i -` {y} \ space M) x))" + also have "\ = (\\<^isup>+x. f x * (\y\G i`space M. y * indicator (G i -` {y} \ space M) x))" apply (simp add: T.simple_integral_def) apply (subst positive_integral_cmult[symmetric]) using G_borel assms(1) apply (fastsimp intro: borel_measurable_indicator borel_measurable_vimage) apply (subst positive_integral_setsum[symmetric]) using G_borel assms(1) apply (fastsimp intro: borel_measurable_indicator borel_measurable_vimage) by (simp add: setsum_right_distrib field_simps) - also have "\ = positive_integral (\x. f x * G i x)" + also have "\ = (\\<^isup>+x. f x * G i x)" by (auto intro!: positive_integral_cong simp: indicator_def if_distrib setsum_cases) - finally have "T.positive_integral (G i) = positive_integral (\x. f x * G i x)" . } - with * have eq_Tg: "(\i. positive_integral (\x. f x * G i x)) \ T.positive_integral g" by simp + finally have "T.positive_integral (G i) = (\\<^isup>+x. f x * G i x)" . } + with * have eq_Tg: "(\i. (\\<^isup>+x. f x * G i x)) \ T.positive_integral g" by simp from G(2) have "(\i x. f x * G i x) \ (\x. f x * g x)" unfolding isoton_fun_expand by (auto intro!: isoton_cmult_right) - then have "(\i. positive_integral (\x. f x * G i x)) \ positive_integral (\x. f x * g x)" + then have "(\i. (\\<^isup>+x. f x * G i x)) \ (\\<^isup>+x. f x * g x)" using assms(1) G_borel by (auto intro!: positive_integral_isoton borel_measurable_pextreal_times) - with eq_Tg show "T.positive_integral g = positive_integral (\x. f x * g x)" + with eq_Tg show "T.positive_integral g = (\\<^isup>+x. f x * g x)" unfolding isoton_def by simp qed lemma (in measure_space) positive_integral_null_set: - assumes "N \ null_sets" shows "positive_integral (\x. u x * indicator N x) = 0" + assumes "N \ null_sets" shows "(\\<^isup>+ x. u x * indicator N x) = 0" proof - - have "positive_integral (\x. u x * indicator N x) = positive_integral (\x. 0)" + have "(\\<^isup>+ x. u x * indicator N x) = (\\<^isup>+ x. 0)" proof (intro positive_integral_cong_AE AE_I) show "{x \ space M. u x * indicator N x \ 0} \ N" by (auto simp: indicator_def) @@ -1434,20 +1436,20 @@ lemma (in measure_space) positive_integral_Markov_inequality: assumes borel: "u \ borel_measurable M" and "A \ sets M" and c: "c \ \" - shows "\ ({x\space M. 1 \ c * u x} \ A) \ c * positive_integral (\x. u x * indicator A x)" + shows "\ ({x\space M. 1 \ c * u x} \ A) \ c * (\\<^isup>+ x. u x * indicator A x)" (is "\ ?A \ _ * ?PI") proof - have "?A \ sets M" using `A \ sets M` borel by auto - hence "\ ?A = positive_integral (\x. indicator ?A x)" + hence "\ ?A = (\\<^isup>+ x. indicator ?A x)" using positive_integral_indicator by simp - also have "\ \ positive_integral (\x. c * (u x * indicator A x))" + also have "\ \ (\\<^isup>+ x. c * (u x * indicator A x))" proof (rule positive_integral_mono) fix x assume "x \ space M" show "indicator ?A x \ c * (u x * indicator A x)" by (cases "x \ ?A") auto qed - also have "\ = c * positive_integral (\x. u x * indicator A x)" + also have "\ = c * (\\<^isup>+ x. u x * indicator A x)" using assms by (auto intro!: positive_integral_cmult borel_measurable_indicator) finally show ?thesis . @@ -1459,7 +1461,7 @@ (is "_ \ \ ?A = 0") proof - have A: "?A \ sets M" using borel by auto - have u: "positive_integral (\x. u x * indicator ?A x) = positive_integral u" + have u: "(\\<^isup>+ x. u x * indicator ?A x) = positive_integral u" by (auto intro!: positive_integral_cong simp: indicator_def) show ?thesis @@ -1467,7 +1469,7 @@ assume "\ ?A = 0" hence "?A \ null_sets" using `?A \ sets M` by auto from positive_integral_null_set[OF this] - have "0 = positive_integral (\x. u x * indicator ?A x)" by simp + have "0 = (\\<^isup>+ x. u x * indicator ?A x)" by simp thus "positive_integral u = 0" unfolding u by simp next assume *: "positive_integral u = 0" @@ -1507,7 +1509,7 @@ lemma (in measure_space) positive_integral_restricted: assumes "A \ sets M" - shows "measure_space.positive_integral (restricted_space A) \ f = positive_integral (\x. f x * indicator A x)" + shows "measure_space.positive_integral (restricted_space A) \ f = (\\<^isup>+ x. f x * indicator A x)" (is "measure_space.positive_integral ?R \ f = positive_integral ?f") proof - have msR: "measure_space ?R \" by (rule restricted_measure_space[OF `A \ sets M`]) @@ -1524,7 +1526,7 @@ fix g assume "simple_function (\x. g x * indicator A x)" "g \ f" then show "\x. simple_function x \ x \ (\x. f x * indicator A x) \ - simple_integral (\x. g x * indicator A x) = simple_integral x" + (\\<^isup>Sx. g x * indicator A x) = simple_integral x" apply (rule_tac exI[of _ "\x. g x * indicator A x"]) by (auto simp: indicator_def le_fun_def) next @@ -1541,39 +1543,36 @@ qed qed -lemma (in measure_space) positive_integral_subalgebra[simp]: - assumes borel: "f \ borel_measurable (M\sets := N\)" - and N_subalgebra: "N \ sets M" "sigma_algebra (M\sets := N\)" - shows "measure_space.positive_integral (M\sets := N\) \ f = positive_integral f" +lemma (in measure_space) positive_integral_subalgebra: + assumes borel: "f \ borel_measurable N" + and N: "sets N \ sets M" "space N = space M" and sa: "sigma_algebra N" + shows "measure_space.positive_integral N \ f = positive_integral f" proof - - note msN = measure_space_subalgebra[OF N_subalgebra] - then interpret N: measure_space "M\sets:=N\" \ . + interpret N: measure_space N \ using measure_space_subalgebra[OF sa N] . from N.borel_measurable_implies_simple_function_sequence[OF borel] obtain fs where Nsf: "\i. N.simple_function (fs i)" and "fs \ f" by blast then have sf: "\i. simple_function (fs i)" - using simple_function_subalgebra[OF _ N_subalgebra] by blast + using simple_function_subalgebra[OF _ N sa] by blast from positive_integral_isoton_simple[OF `fs \ f` sf] N.positive_integral_isoton_simple[OF `fs \ f` Nsf] - show ?thesis unfolding simple_integral_subalgebra[OF msN] isoton_def by simp + show ?thesis unfolding isoton_def simple_integral_def N.simple_integral_def `space N = space M` by simp qed section "Lebesgue Integral" definition (in measure_space) integrable where "integrable f \ f \ borel_measurable M \ - positive_integral (\x. Real (f x)) \ \ \ - positive_integral (\x. Real (- f x)) \ \" + (\\<^isup>+ x. Real (f x)) \ \ \ + (\\<^isup>+ x. Real (- f x)) \ \" lemma (in measure_space) integrableD[dest]: assumes "integrable f" shows "f \ borel_measurable M" - "positive_integral (\x. Real (f x)) \ \" - "positive_integral (\x. Real (- f x)) \ \" + "(\\<^isup>+ x. Real (f x)) \ \" + "(\\<^isup>+ x. Real (- f x)) \ \" using assms unfolding integrable_def by auto -definition (in measure_space) integral where - "integral f = - real (positive_integral (\x. Real (f x))) - - real (positive_integral (\x. Real (- f x)))" +definition (in measure_space) integral (binder "\ " 10) where + "integral f = real ((\\<^isup>+ x. Real (f x))) - real ((\\<^isup>+ x. Real (- f x)))" lemma (in measure_space) integral_cong: assumes cong: "\x. x \ space M \ f x = g x" @@ -1609,7 +1608,7 @@ lemma (in measure_space) integral_eq_positive_integral: assumes "\x. 0 \ f x" - shows "integral f = real (positive_integral (\x. Real (f x)))" + shows "integral f = real ((\\<^isup>+ x. Real (f x)))" proof - have "\x. Real (- f x) = 0" using assms by simp thus ?thesis by (simp del: Real_eq_0 add: integral_def) @@ -1617,7 +1616,7 @@ lemma (in measure_space) integral_vimage_inv: assumes f: "bij_betw f S (space M)" - shows "measure_space.integral (vimage_algebra S f) (\A. \ (f ` A)) (\x. g x) = integral (\x. g (the_inv_into S f x))" + shows "measure_space.integral (vimage_algebra S f) (\A. \ (f ` A)) (\x. g x) = (\x. g (the_inv_into S f x))" proof - interpret v: measure_space "vimage_algebra S f" "\A. \ (f ` A)" using f by (rule measure_space_isomorphic) @@ -1634,7 +1633,7 @@ lemma (in measure_space) integral_minus[intro, simp]: assumes "integrable f" - shows "integrable (\x. - f x)" "integral (\x. - f x) = - integral f" + shows "integrable (\x. - f x)" "(\x. - f x) = - integral f" using assms by (auto simp: integrable_def integral_def) lemma (in measure_space) integral_of_positive_diff: @@ -1685,7 +1684,7 @@ lemma (in measure_space) integral_linear: assumes "integrable f" "integrable g" and "0 \ a" shows "integrable (\t. a * f t + g t)" - and "integral (\t. a * f t + g t) = a * integral f + integral g" + and "(\ t. a * f t + g t) = a * integral f + integral g" proof - let ?PI = positive_integral let "?f x" = "Real (f x)" @@ -1718,7 +1717,7 @@ show "integrable (\t. a * f t + g t)" by (rule diff) - from assms show "integral (\t. a * f t + g t) = a * integral f + integral g" + from assms show "(\ t. a * f t + g t) = a * integral f + integral g" unfolding diff(2) unfolding integral_def * linear integrable_def by (cases "?PI ?f", cases "?PI ?mf", cases "?PI ?g", cases "?PI ?mg") (auto simp add: field_simps zero_le_mult_iff) @@ -1727,21 +1726,21 @@ lemma (in measure_space) integral_add[simp, intro]: assumes "integrable f" "integrable g" shows "integrable (\t. f t + g t)" - and "integral (\t. f t + g t) = integral f + integral g" + and "(\ t. f t + g t) = integral f + integral g" using assms integral_linear[where a=1] by auto lemma (in measure_space) integral_zero[simp, intro]: shows "integrable (\x. 0)" - and "integral (\x. 0) = 0" + and "(\ x.0) = 0" unfolding integrable_def integral_def by (auto simp add: borel_measurable_const) lemma (in measure_space) integral_cmult[simp, intro]: assumes "integrable f" shows "integrable (\t. a * f t)" (is ?P) - and "integral (\t. a * f t) = a * integral f" (is ?I) + and "(\ t. a * f t) = a * integral f" (is ?I) proof - - have "integrable (\t. a * f t) \ integral (\t. a * f t) = a * integral f" + have "integrable (\t. a * f t) \ (\ t. a * f t) = a * integral f" proof (cases rule: le_cases) assume "0 \ a" show ?thesis using integral_linear[OF assms integral_zero(1) `0 \ a`] @@ -1758,7 +1757,7 @@ lemma (in measure_space) integral_multc: assumes "integrable f" - shows "integral (\x. f x * c) = integral f * c" + shows "(\ x. f x * c) = integral f * c" unfolding mult_commute[of _ c] integral_cmult[OF assms] .. lemma (in measure_space) integral_mono_AE: @@ -1785,7 +1784,7 @@ lemma (in measure_space) integral_diff[simp, intro]: assumes f: "integrable f" and g: "integrable g" shows "integrable (\t. f t - g t)" - and "integral (\t. f t - g t) = integral f - integral g" + and "(\ t. f t - g t) = integral f - integral g" using integral_add[OF f integral_minus(1)[OF g]] unfolding diff_minus integral_minus(2)[OF g] by auto @@ -1806,7 +1805,7 @@ lemma (in measure_space) integral_cmul_indicator: assumes "A \ sets M" and "c \ 0 \ \ A \ \" shows "integrable (\x. c * indicator A x)" (is ?P) - and "integral (\x. c * indicator A x) = c * real (\ A)" (is ?I) + and "(\x. c * indicator A x) = c * real (\ A)" (is ?I) proof - show ?P proof (cases "c = 0") @@ -1821,7 +1820,7 @@ lemma (in measure_space) integral_setsum[simp, intro]: assumes "\n. n \ S \ integrable (f n)" - shows "integral (\x. \ i \ S. f i x) = (\ i \ S. integral (f i))" (is "?int S") + shows "(\x. \ i \ S. f i x) = (\ i \ S. integral (f i))" (is "?int S") and "integrable (\x. \ i \ S. f i x)" (is "?I S") proof - have "?int S \ ?I S" @@ -1847,6 +1846,22 @@ using positive_integral_linear[OF f, of 1] by simp qed +lemma (in measure_space) integral_subalgebra: + assumes borel: "f \ borel_measurable N" + and N: "sets N \ sets M" "space N = space M" and sa: "sigma_algebra N" + shows "measure_space.integrable N \ f \ integrable f" (is ?P) + and "measure_space.integral N \ f = integral f" (is ?I) +proof - + interpret N: measure_space N \ using measure_space_subalgebra[OF sa N] . + have "(\x. Real (f x)) \ borel_measurable N" "(\x. Real (- f x)) \ borel_measurable N" + using borel by auto + note * = this[THEN positive_integral_subalgebra[OF _ N sa]] + have "f \ borel_measurable M \ f \ borel_measurable N" + using assms unfolding measurable_def by auto + then show ?P ?I unfolding integrable_def N.integrable_def integral_def N.integral_def + unfolding * by auto +qed + lemma (in measure_space) integrable_bound: assumes "integrable f" and f: "\x. x \ space M \ 0 \ f x" @@ -1854,21 +1869,21 @@ assumes borel: "g \ borel_measurable M" shows "integrable g" proof - - have "positive_integral (\x. Real (g x)) \ positive_integral (\x. Real \g x\)" + have "(\\<^isup>+ x. Real (g x)) \ (\\<^isup>+ x. Real \g x\)" by (auto intro!: positive_integral_mono) - also have "\ \ positive_integral (\x. Real (f x))" + also have "\ \ (\\<^isup>+ x. Real (f x))" using f by (auto intro!: positive_integral_mono) also have "\ < \" using `integrable f` unfolding integrable_def by (auto simp: pextreal_less_\) - finally have pos: "positive_integral (\x. Real (g x)) < \" . + finally have pos: "(\\<^isup>+ x. Real (g x)) < \" . - have "positive_integral (\x. Real (- g x)) \ positive_integral (\x. Real (\g x\))" + have "(\\<^isup>+ x. Real (- g x)) \ (\\<^isup>+ x. Real (\g x\))" by (auto intro!: positive_integral_mono) - also have "\ \ positive_integral (\x. Real (f x))" + also have "\ \ (\\<^isup>+ x. Real (f x))" using f by (auto intro!: positive_integral_mono) also have "\ < \" using `integrable f` unfolding integrable_def by (auto simp: pextreal_less_\) - finally have neg: "positive_integral (\x. Real (- g x)) < \" . + finally have neg: "(\\<^isup>+ x. Real (- g x)) < \" . from neg pos borel show ?thesis unfolding integrable_def by auto @@ -1908,10 +1923,10 @@ lemma (in measure_space) integral_triangle_inequality: assumes "integrable f" - shows "\integral f\ \ integral (\x. \f x\)" + shows "\integral f\ \ (\x. \f x\)" proof - have "\integral f\ = max (integral f) (- integral f)" by auto - also have "\ \ integral (\x. \f x\)" + also have "\ \ (\x. \f x\)" using assms integral_minus(2)[of f, symmetric] by (auto intro!: integral_mono integrable_abs simp del: integral_minus) finally show ?thesis . @@ -1921,7 +1936,7 @@ assumes "integrable f" "\x. x \ space M \ 0 \ f x" shows "0 \ integral f" proof - - have "0 = integral (\x. 0)" by (auto simp: integral_zero) + have "0 = (\x. 0)" by (auto simp: integral_zero) also have "\ \ integral f" using assms by (rule integral_mono[OF integral_zero(1)]) finally show ?thesis . @@ -1953,7 +1968,7 @@ hence borel_u: "u \ borel_measurable M" using pos_u by (auto simp: borel_measurable_Real_eq SUP_F) - have integral_eq: "\n. positive_integral (\x. Real (f n x)) = Real (integral (f n))" + have integral_eq: "\n. (\\<^isup>+ x. Real (f n x)) = Real (integral (f n))" using i unfolding integral_def integrable_def by (auto simp: Real_real) have pos_integral: "\n. 0 \ integral (f n)" @@ -1961,14 +1976,14 @@ hence "0 \ x" using LIMSEQ_le_const[OF ilim, of 0] by auto - have "(\i. positive_integral (\x. Real (f i x))) \ positive_integral (\x. Real (u x))" + have "(\i. (\\<^isup>+ x. Real (f i x))) \ (\\<^isup>+ x. Real (u x))" proof (rule positive_integral_isoton) from SUP_F mono pos show "(\i x. Real (f i x)) \ (\x. Real (u x))" unfolding isoton_fun_expand by (auto simp: isoton_def mono_def) qed (rule borel_f) - hence pI: "positive_integral (\x. Real (u x)) = - (SUP n. positive_integral (\x. Real (f n x)))" + hence pI: "(\\<^isup>+ x. Real (u x)) = + (SUP n. (\\<^isup>+ x. Real (f n x)))" unfolding isoton_def by simp also have "\ = Real x" unfolding integral_eq proof (rule SUP_eq_LIMSEQ[THEN iffD2]) @@ -1997,7 +2012,7 @@ unfolding mono_def le_fun_def by (auto simp: field_simps) have 4: "\x. (\i. f i x - f 0 x) ----> u x - f 0 x" using lim by (auto intro!: LIMSEQ_diff) - have 5: "(\i. integral (\x. f i x - f 0 x)) ----> x - integral (f 0)" + have 5: "(\i. (\x. f i x - f 0 x)) ----> x - integral (f 0)" using f ilim by (auto intro!: LIMSEQ_diff simp: integral_diff) note diff = integral_monotone_convergence_pos[OF 1 2 3 4 5] have "integrable (\x. (u x - f 0 x) + f 0 x)" @@ -2008,12 +2023,12 @@ lemma (in measure_space) integral_0_iff: assumes "integrable f" - shows "integral (\x. \f x\) = 0 \ \ {x\space M. f x \ 0} = 0" + shows "(\x. \f x\) = 0 \ \ {x\space M. f x \ 0} = 0" proof - have *: "\x. Real (- \f x\) = 0" by auto have "integrable (\x. \f x\)" using assms by (rule integrable_abs) hence "(\x. Real (\f x\)) \ borel_measurable M" - "positive_integral (\x. Real \f x\) \ \" unfolding integrable_def by auto + "(\\<^isup>+ x. Real \f x\) \ \" unfolding integrable_def by auto from positive_integral_0_iff[OF this(1)] this(2) show ?thesis unfolding integral_def * by (simp add: real_of_pextreal_eq_0) @@ -2024,7 +2039,7 @@ and "positive_integral f \ \" shows "\ (f -` {\} \ space M) = 0" proof - - have "\ * \ (f -` {\} \ space M) = positive_integral (\x. \ * indicator (f -` {\} \ space M) x)" + have "\ * \ (f -` {\} \ space M) = (\\<^isup>+ x. \ * indicator (f -` {\} \ space M) x)" using positive_integral_cmult_indicator[OF borel_measurable_vimage, OF assms(1), of \ \] by simp also have "\ \ positive_integral f" by (auto intro!: positive_integral_mono simp: indicator_def) @@ -2054,15 +2069,15 @@ lemma (in measure_space) integral_real: fixes f :: "'a \ pextreal" assumes "AE x. f x \ \" - shows "integral (\x. real (f x)) = real (positive_integral f)" (is ?plus) - and "integral (\x. - real (f x)) = - real (positive_integral f)" (is ?minus) + shows "(\x. real (f x)) = real (positive_integral f)" (is ?plus) + and "(\x. - real (f x)) = - real (positive_integral f)" (is ?minus) proof - - have "positive_integral (\x. Real (real (f x))) = positive_integral f" + have "(\\<^isup>+ x. Real (real (f x))) = positive_integral f" apply (rule positive_integral_cong_AE) apply (rule AE_mp[OF assms(1)]) by (auto intro!: AE_cong simp: Real_real) moreover - have "positive_integral (\x. Real (- real (f x))) = positive_integral (\x. 0)" + have "(\\<^isup>+ x. Real (- real (f x))) = (\\<^isup>+ x. 0)" by (intro positive_integral_cong) auto ultimately show ?plus ?minus by (auto simp: integral_def integrable_def) @@ -2073,7 +2088,7 @@ and w: "integrable w" "\x. x \ space M \ 0 \ w x" and u': "\x. x \ space M \ (\i. u i x) ----> u' x" shows "integrable u'" - and "(\i. integral (\x. \u i x - u' x\)) ----> 0" (is "?lim_diff") + and "(\i. (\x. \u i x - u' x\)) ----> 0" (is "?lim_diff") and "(\i. integral (u i)) ----> integral u'" (is ?lim) proof - { fix x j assume x: "x \ space M" @@ -2108,31 +2123,31 @@ finally have "\u j x - u' x\ \ 2 * w x" by simp } note diff_less_2w = this - have PI_diff: "\m n. positive_integral (\x. Real (?diff (m + n) x)) = - positive_integral (\x. Real (2 * w x)) - positive_integral (\x. Real \u (m + n) x - u' x\)" + have PI_diff: "\m n. (\\<^isup>+ x. Real (?diff (m + n) x)) = + (\\<^isup>+ x. Real (2 * w x)) - (\\<^isup>+ x. Real \u (m + n) x - u' x\)" using diff w diff_less_2w by (subst positive_integral_diff[symmetric]) (auto simp: integrable_def intro!: positive_integral_cong) have "integrable (\x. 2 * w x)" using w by (auto intro: integral_cmult) - hence I2w_fin: "positive_integral (\x. Real (2 * w x)) \ \" and + hence I2w_fin: "(\\<^isup>+ x. Real (2 * w x)) \ \" and borel_2w: "(\x. Real (2 * w x)) \ borel_measurable M" unfolding integrable_def by auto - have "(INF n. SUP m. positive_integral (\x. Real \u (m + n) x - u' x\)) = 0" (is "?lim_SUP = 0") + have "(INF n. SUP m. (\\<^isup>+ x. Real \u (m + n) x - u' x\)) = 0" (is "?lim_SUP = 0") proof cases - assume eq_0: "positive_integral (\x. Real (2 * w x)) = 0" - have "\i. positive_integral (\x. Real \u i x - u' x\) \ positive_integral (\x. Real (2 * w x))" + assume eq_0: "(\\<^isup>+ x. Real (2 * w x)) = 0" + have "\i. (\\<^isup>+ x. Real \u i x - u' x\) \ (\\<^isup>+ x. Real (2 * w x))" proof (rule positive_integral_mono) fix i x assume "x \ space M" from diff_less_2w[OF this, of i] show "Real \u i x - u' x\ \ Real (2 * w x)" by auto qed - hence "\i. positive_integral (\x. Real \u i x - u' x\) = 0" using eq_0 by auto + hence "\i. (\\<^isup>+ x. Real \u i x - u' x\) = 0" using eq_0 by auto thus ?thesis by simp next - assume neq_0: "positive_integral (\x. Real (2 * w x)) \ 0" - have "positive_integral (\x. Real (2 * w x)) = positive_integral (\x. SUP n. INF m. Real (?diff (m + n) x))" + assume neq_0: "(\\<^isup>+ x. Real (2 * w x)) \ 0" + have "(\\<^isup>+ x. Real (2 * w x)) = (\\<^isup>+ x. SUP n. INF m. Real (?diff (m + n) x))" proof (rule positive_integral_cong, subst add_commute) fix x assume x: "x \ space M" show "Real (2 * w x) = (SUP n. INF m. Real (?diff (n + m) x))" @@ -2144,22 +2159,22 @@ thus "(\i. ?diff i x) ----> 2 * w x" by simp qed qed - also have "\ \ (SUP n. INF m. positive_integral (\x. Real (?diff (m + n) x)))" + also have "\ \ (SUP n. INF m. (\\<^isup>+ x. Real (?diff (m + n) x)))" using u'_borel w u unfolding integrable_def by (auto intro!: positive_integral_lim_INF) - also have "\ = positive_integral (\x. Real (2 * w x)) - - (INF n. SUP m. positive_integral (\x. Real \u (m + n) x - u' x\))" + also have "\ = (\\<^isup>+ x. Real (2 * w x)) - + (INF n. SUP m. (\\<^isup>+ x. Real \u (m + n) x - u' x\))" unfolding PI_diff pextreal_INF_minus[OF I2w_fin] pextreal_SUP_minus .. finally show ?thesis using neq_0 I2w_fin by (rule pextreal_le_minus_imp_0) qed have [simp]: "\n m x. Real (- \u (m + n) x - u' x\) = 0" by auto - have [simp]: "\n m. positive_integral (\x. Real \u (m + n) x - u' x\) = - Real (integral (\x. \u (n + m) x - u' x\))" + have [simp]: "\n m. (\\<^isup>+ x. Real \u (m + n) x - u' x\) = + Real ((\x. \u (n + m) x - u' x\))" using diff by (subst add_commute) (simp add: integral_def integrable_def Real_real) - have "(SUP n. INF m. positive_integral (\x. Real \u (m + n) x - u' x\)) \ ?lim_SUP" + have "(SUP n. INF m. (\\<^isup>+ x. Real \u (m + n) x - u' x\)) \ ?lim_SUP" (is "?lim_INF \ _") by (subst (1 2) add_commute) (rule lim_INF_le_lim_SUP) hence "?lim_INF = Real 0" "?lim_SUP = Real 0" using `?lim_SUP = 0` by auto thus ?lim_diff using diff by (auto intro!: integral_positive lim_INF_eq_lim_SUP) @@ -2168,15 +2183,15 @@ proof (rule LIMSEQ_I) fix r :: real assume "0 < r" from LIMSEQ_D[OF `?lim_diff` this] - obtain N where N: "\n. N \ n \ integral (\x. \u n x - u' x\) < r" + obtain N where N: "\n. N \ n \ (\x. \u n x - u' x\) < r" using diff by (auto simp: integral_positive) show "\N. \n\N. norm (integral (u n) - integral u') < r" proof (safe intro!: exI[of _ N]) fix n assume "N \ n" - have "\integral (u n) - integral u'\ = \integral (\x. u n x - u' x)\" + have "\integral (u n) - integral u'\ = \(\x. u n x - u' x)\" using u `integrable u'` by (auto simp: integral_diff) - also have "\ \ integral (\x. \u n x - u' x\)" using u `integrable u'` + also have "\ \ (\x. \u n x - u' x\)" using u `integrable u'` by (rule_tac integral_triangle_inequality) (auto intro!: integral_diff) also note N[OF `N \ n`] finally show "norm (integral (u n) - integral u') < r" by simp @@ -2187,9 +2202,9 @@ lemma (in measure_space) integral_sums: assumes borel: "\i. integrable (f i)" and summable: "\x. x \ space M \ summable (\i. \f i x\)" - and sums: "summable (\i. integral (\x. \f i x\))" + and sums: "summable (\i. (\x. \f i x\))" shows "integrable (\x. (\i. f i x))" (is "integrable ?S") - and "(\i. integral (f i)) sums integral (\x. (\i. f i x))" (is ?integral) + and "(\i. integral (f i)) sums (\x. (\i. f i x))" (is ?integral) proof - have "\x\space M. \w. (\i. \f i x\) sums w" using summable unfolding summable_def by auto @@ -2198,7 +2213,7 @@ let "?w y" = "if y \ space M then w y else 0" - obtain x where abs_sum: "(\i. integral (\x. \f i x\)) sums x" + obtain x where abs_sum: "(\i. (\x. \f i x\)) sums x" using sums unfolding summable_def .. have 1: "\n. integrable (\x. \i = 0..n. ?w' n x) ----> ?w x" using w by (cases "x \ space M") (simp_all add: LIMSEQ_const sums_def) } - have *: "\n. integral (?w' n) = (\i = 0..< n. integral (\x. \f i x\))" + have *: "\n. integral (?w' n) = (\i = 0..< n. (\x. \f i x\))" using borel by (simp add: integral_setsum integrable_abs cong: integral_cong) from abs_sum show "(\i. integral (?w' i)) ----> x" unfolding * sums_def . @@ -2275,15 +2290,15 @@ by (auto intro!: sums_single simp: F F_abs) } note F_sums_f = this(1) and F_abs_sums_f = this(2) - have int_f: "integral f = integral (\x. \r. ?F r x)" "integrable f = integrable (\x. \r. ?F r x)" + have int_f: "integral f = (\x. \r. ?F r x)" "integrable f = integrable (\x. \r. ?F r x)" using F_sums_f by (auto intro!: integral_cong integrable_cong simp: sums_iff) { fix r - have "integral (\x. \?F r x\) = integral (\x. \enum r\ * indicator (?A r) x)" + have "(\x. \?F r x\) = (\x. \enum r\ * indicator (?A r) x)" by (auto simp: indicator_def intro!: integral_cong) also have "\ = \enum r\ * real (\ (?A r))" using f fin by (simp add: borel_measurable_vimage integral_cmul_indicator) - finally have "integral (\x. \?F r x\) = \enum r * real (\ (?A r))\" + finally have "(\x. \?F r x\) = \enum r * real (\ (?A r))\" by (simp add: abs_mult_pos real_pextreal_pos) } note int_abs_F = this @@ -2306,7 +2321,7 @@ assumes f: "f \ borel_measurable M" and finite: "finite (f`space M)" and fin: "\x. x \ 0 \ \ (f -` {x} \ space M) \ \" shows "integrable f" - and "integral (\x. f x) = + and "(\x. f x) = (\ r \ f`space M. r * real (\ (f -` {r} \ space M)))" (is "?integral") proof - let "?A r" = "f -` {r} \ space M" @@ -2336,7 +2351,7 @@ lemma (in finite_measure_space) positive_integral_finite_eq_setsum: "positive_integral f = (\x \ space M. f x * \ {x})" proof - - have *: "positive_integral f = positive_integral (\x. \y\space M. f y * indicator {y} x)" + have *: "positive_integral f = (\\<^isup>+ x. \y\space M. f y * indicator {y} x)" by (auto intro!: positive_integral_cong simp add: indicator_def if_distrib setsum_cases[OF finite_space]) show ?thesis unfolding * using borel_measurable_finite[of f] by (simp add: positive_integral_setsum positive_integral_cmult_indicator) @@ -2347,8 +2362,8 @@ and "integral f = (\x \ space M. f x * real (\ {x}))" (is ?I) proof - have [simp]: - "positive_integral (\x. Real (f x)) = (\x \ space M. Real (f x) * \ {x})" - "positive_integral (\x. Real (- f x)) = (\x \ space M. Real (- f x) * \ {x})" + "(\\<^isup>+ x. Real (f x)) = (\x \ space M. Real (f x) * \ {x})" + "(\\<^isup>+ x. Real (- f x)) = (\x \ space M. Real (- f x) * \ {x})" unfolding positive_integral_finite_eq_setsum by auto show "integrable f" using finite_space finite_measure by (simp add: setsum_\ integrable_def) diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Fri Jan 14 16:00:13 2011 +0100 @@ -626,11 +626,38 @@ qed qed +lemma lebesgue_positive_integral_eq_borel: + "f \ borel_measurable borel \ lebesgue.positive_integral f = borel.positive_integral f " + by (auto intro!: lebesgue.positive_integral_subalgebra[symmetric]) default + +lemma lebesgue_integral_eq_borel: + assumes "f \ borel_measurable borel" + shows "lebesgue.integrable f = borel.integrable f" (is ?P) + and "lebesgue.integral f = borel.integral f" (is ?I) +proof - + have *: "sigma_algebra borel" by default + have "sets borel \ sets lebesgue" by auto + from lebesgue.integral_subalgebra[OF assms this _ *] + show ?P ?I by auto +qed + +lemma borel_integral_has_integral: + fixes f::"'a::ordered_euclidean_space => real" + assumes f:"borel.integrable f" + shows "(f has_integral (borel.integral f)) UNIV" +proof - + have borel: "f \ borel_measurable borel" + using f unfolding borel.integrable_def by auto + from f show ?thesis + using lebesgue_integral_has_integral[of f] + unfolding lebesgue_integral_eq_borel[OF borel] by simp +qed + lemma continuous_on_imp_borel_measurable: fixes f::"'a::ordered_euclidean_space \ 'b::ordered_euclidean_space" assumes "continuous_on UNIV f" - shows "f \ borel_measurable lebesgue" - apply(rule lebesgue.borel_measurableI) + shows "f \ borel_measurable borel" + apply(rule borel.borel_measurableI) using continuous_open_preimage[OF assms] unfolding vimage_def by auto lemma (in measure_space) integral_monotone_convergence_pos': diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Measure.thy --- a/src/HOL/Probability/Measure.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Measure.thy Fri Jan 14 16:00:13 2011 +0100 @@ -919,16 +919,15 @@ qed lemma (in measure_space) measure_space_subalgebra: - assumes "N \ sets M" "sigma_algebra (M\ sets := N \)" - shows "measure_space (M\ sets := N \) \" + assumes "sigma_algebra N" and [simp]: "sets N \ sets M" "space N = space M" + shows "measure_space N \" proof - - interpret N: sigma_algebra "M\ sets := N \" by fact + interpret N: sigma_algebra N by fact show ?thesis proof - show "countably_additive (M\sets := N\) \" - using `N \ sets M` - by (auto simp add: countably_additive_def - intro!: measure_countably_additive) + from `sets N \ sets M` have "\A. range A \ sets N \ range A \ sets M" by blast + then show "countably_additive N \" + by (auto intro!: measure_countably_additive simp: countably_additive_def) qed simp qed diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Positive_Extended_Real.thy --- a/src/HOL/Probability/Positive_Extended_Real.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Positive_Extended_Real.thy Fri Jan 14 16:00:13 2011 +0100 @@ -1603,6 +1603,136 @@ qed end +lemma minus_omega[simp]: "x - \ = 0" by (cases x) auto + +lemma open_pextreal_alt: "open A \ + (\x\A. \e>0. {x-e <..< x+e} \ A) \ (\ \ A \ (\x\0. {Real x <..} \ A))" +proof - + have *: "(\T. open T \ (Real ` (T\{0..}) = A - {\})) \ + open (real ` (A - {\}) \ {..<0})" + proof safe + fix T assume "open T" and A: "Real ` (T \ {0..}) = A - {\}" + have *: "(\x. real (Real x)) ` (T \ {0..}) = T \ {0..}" + by auto + have **: "T \ {0..} \ {..<0} = T \ {..<0}" by auto + show "open (real ` (A - {\}) \ {..<0})" + unfolding A[symmetric] image_image * ** using `open T` by auto + next + assume "open (real ` (A - {\}) \ {..<0})" + moreover have "Real ` ((real ` (A - {\}) \ {..<0}) \ {0..}) = A - {\}" + apply auto + apply (case_tac xb) + apply auto + apply (case_tac x) + apply (auto simp: image_iff) + apply (erule_tac x="Real r" in ballE) + apply auto + done + ultimately show "\T. open T \ Real ` (T \ {0..}) = A - {\}" by auto + qed + also have "\ \ (\x\A. \e>0. {x-e <..< x+e} \ A)" + proof (intro iffI ballI open_subopen[THEN iffD2]) + fix x assume *: "\x\A. \e>0. {x - e<.. A" and x: "x \ real ` (A - {\}) \ {..<0}" + show "\T. open T \ x \ T \ T \ real ` (A - {\}) \ {..<0}" + proof (cases rule: linorder_cases) + assume "x < 0" then show ?thesis by (intro exI[of _ "{..<0}"]) auto + next + assume "x = 0" with x + have "0 \ A" + apply auto by (case_tac x) auto + with * obtain e where "e > 0" "{0 - e<..<0 + e} \ A" by auto + then have "{.. A" using `0 \ A` + apply auto + apply (case_tac "x = 0") + by (auto dest!: pextreal_zero_lessI) + then have *: "{.. A - {\}" by auto + def e' \ "if e = \ then 1 else real e" + then have "0 < e'" using `e > 0` by (cases e) auto + have "{0.. real ` (A - {\})" + proof (cases e) + case infinite + then have "{..}" by auto + then have A: "A - {\} = UNIV - {\}" using * by auto + show ?thesis unfolding e'_def infinite A + apply safe + apply (rule_tac x="Real x" in image_eqI) + apply auto + done + next + case (preal r) + then show ?thesis unfolding e'_def using * + apply safe + apply (rule_tac x="Real x" in image_eqI) + by (auto simp: subset_eq) + qed + then have "{0.. {..<0} \ real ` (A - {\}) \ {..<0}" by auto + moreover have "{0.. {..<0} = {.. real ` (A - {\}) \ {..<0}" by simp + then show ?thesis using `0 < e'` `x = 0` by auto + next + assume "0 < x" + with x have "Real x \ A" apply auto by (case_tac x) auto + with * obtain e where "0 < e" and e: "{Real x - e<.. A" by auto + show ?thesis + proof cases + assume "e < Real x" + with `0 < e` obtain r where r: "e = Real r" "0 < r" by (cases e) auto + then have "r < x" using `e < Real x` `0 < e` by (auto split: split_if_asm) + then have "{x - r <..< x + r} \ real ` (A - {\}) \ {..<0}" + using e unfolding r + apply (auto simp: subset_eq) + apply (rule_tac x="Real xa" in image_eqI) + by auto + then show ?thesis using `0 < r` by (intro exI[of _ "{x - r <..< x + r}"]) auto + next + assume "\ e < Real x" + moreover then have "Real x - e = 0" by (cases e) auto + moreover have "\z. 0 < z \ z * 2 < 3 * x \ Real z < Real x + e" + using `\ e < Real x` by (cases e) auto + ultimately have "{0 <..< x + x / 2} \ real ` (A - {\}) \ {..<0}" + using e + apply (auto simp: subset_eq) + apply (erule_tac x="Real xa" in ballE) + apply (auto simp: not_less) + apply (rule_tac x="Real xa" in image_eqI) + apply auto + done + moreover have "x \ {0 <..< x + x / 2}" using `0 < x` by auto + ultimately show ?thesis by (intro exI[of _ "{0 <..< x + x / 2}"]) auto + qed + qed + next + fix x assume x: "x \ A" "open (real ` (A - {\}) \ {..<0})" + then show "\e>0. {x - e<.. A" + proof (cases x) + case infinite then show ?thesis by (intro exI[of _ 2]) auto + next + case (preal r) + with `x \ A` have r: "r \ real ` (A - {\}) \ {..<0}" by force + from x(2)[unfolded open_real, THEN bspec, OF r] + obtain e where e: "0 < e" "\x'. \x' - r\ < e \ x' \ real ` (A - {\}) \ {..<0}" + by auto + show ?thesis using `0 < e` preal + proof (auto intro!: exI[of _ "Real e"] simp: greaterThanLessThan_iff not_less + split: split_if_asm) + fix z assume *: "Real (r - e) < z" "z < Real (r + e)" + then obtain q where [simp]: "z = Real q" "0 \ q" by (cases z) auto + with * have "r - e < q" "q < r + e" by (auto split: split_if_asm) + with e(2)[of q] have "q \ real ` (A - {\}) \ {..<0}" by auto + then show "z \ A" using `0 \ q` apply auto apply (case_tac x) apply auto done + next + fix z assume *: "0 < z" "z < Real (r + e)" "r \ e" + then obtain q where [simp]: "z = Real q" and "0 < q" by (cases z) auto + with * have "q < r + e" by (auto split: split_if_asm) + moreover have "r - e < q" using `r \ e` `0 < q` by auto + ultimately have "q \ real ` (A - {\}) \ {..<0}" using e(2)[of q] by auto + then show "z \ A" using `0 < q` apply auto apply (case_tac x) apply auto done + qed + qed + qed + finally show ?thesis unfolding open_pextreal_def by simp +qed + lemma open_pextreal_lessThan[simp]: "open {..< a :: pextreal}" proof (cases a) diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Probability_Space.thy --- a/src/HOL/Probability/Probability_Space.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Probability_Space.thy Fri Jan 14 16:00:13 2011 +0100 @@ -851,13 +851,13 @@ qed lemma (in prob_space) prob_space_subalgebra: - assumes "N \ sets M" "sigma_algebra (M\ sets := N \)" - shows "prob_space (M\ sets := N \) \" + assumes "sigma_algebra N" "sets N \ sets M" "space N = space M" + shows "prob_space N \" proof - - interpret N: measure_space "M\ sets := N \" \ + interpret N: measure_space N \ using measure_space_subalgebra[OF assms] . show ?thesis - proof qed (simp add: measure_space_1) + proof qed (simp add: `space N = space M` measure_space_1) qed lemma (in prob_space) prob_space_of_restricted_space: @@ -955,46 +955,46 @@ lemma (in prob_space) conditional_expectation_exists: fixes X :: "'a \ pextreal" assumes borel: "X \ borel_measurable M" - and N_subalgebra: "N \ sets M" "sigma_algebra (M\ sets := N \)" - shows "\Y\borel_measurable (M\ sets := N \). \C\N. - positive_integral (\x. Y x * indicator C x) = positive_integral (\x. X x * indicator C x)" + and N: "sigma_algebra N" "sets N \ sets M" "space N = space M" + shows "\Y\borel_measurable N. \C\sets N. + (\\<^isup>+x. Y x * indicator C x) = (\\<^isup>+x. X x * indicator C x)" proof - - interpret P: prob_space "M\ sets := N \" \ - using prob_space_subalgebra[OF N_subalgebra] . + interpret P: prob_space N \ + using prob_space_subalgebra[OF N] . let "?f A" = "\x. X x * indicator A x" let "?Q A" = "positive_integral (?f A)" from measure_space_density[OF borel] - have Q: "measure_space (M\ sets := N \) ?Q" - by (rule measure_space.measure_space_subalgebra[OF _ N_subalgebra]) - then interpret Q: measure_space "M\ sets := N \" ?Q . + have Q: "measure_space N ?Q" + by (rule measure_space.measure_space_subalgebra[OF _ N]) + then interpret Q: measure_space N ?Q . have "P.absolutely_continuous ?Q" unfolding P.absolutely_continuous_def - proof (safe, simp) - fix A assume "A \ N" "\ A = 0" + proof safe + fix A assume "A \ sets N" "\ A = 0" moreover then have f_borel: "?f A \ borel_measurable M" - using borel N_subalgebra by (auto intro: borel_measurable_indicator) + using borel N by (auto intro: borel_measurable_indicator) moreover have "{x\space M. ?f A x \ 0} = (?f A -` {0<..} \ space M) \ A" by (auto simp: indicator_def) moreover have "\ \ \ \ A" - using `A \ N` N_subalgebra f_borel + using `A \ sets N` N f_borel by (auto intro!: measure_mono Int[of _ A] measurable_sets) ultimately show "?Q A = 0" by (simp add: positive_integral_0_iff) qed from P.Radon_Nikodym[OF Q this] - obtain Y where Y: "Y \ borel_measurable (M\sets := N\)" - "\A. A \ sets (M\sets:=N\) \ ?Q A = P.positive_integral (\x. Y x * indicator A x)" + obtain Y where Y: "Y \ borel_measurable N" + "\A. A \ sets N \ ?Q A = P.positive_integral (\x. Y x * indicator A x)" by blast - with N_subalgebra show ?thesis - by (auto intro!: bexI[OF _ Y(1)]) + with N(2) show ?thesis + by (auto intro!: bexI[OF _ Y(1)] simp: positive_integral_subalgebra[OF _ N(2,3,1)]) qed definition (in prob_space) - "conditional_expectation N X = (SOME Y. Y\borel_measurable (M\sets:=N\) - \ (\C\N. positive_integral (\x. Y x * indicator C x) = positive_integral (\x. X x * indicator C x)))" + "conditional_expectation N X = (SOME Y. Y\borel_measurable N + \ (\C\sets N. (\\<^isup>+x. Y x * indicator C x) = (\\<^isup>+x. X x * indicator C x)))" abbreviation (in prob_space) "conditional_prob N A \ conditional_expectation N (indicator A)" @@ -1002,19 +1002,19 @@ lemma (in prob_space) fixes X :: "'a \ pextreal" assumes borel: "X \ borel_measurable M" - and N_subalgebra: "N \ sets M" "sigma_algebra (M\ sets := N \)" + and N: "sigma_algebra N" "sets N \ sets M" "space N = space M" shows borel_measurable_conditional_expectation: - "conditional_expectation N X \ borel_measurable (M\ sets := N \)" - and conditional_expectation: "\C. C \ N \ - positive_integral (\x. conditional_expectation N X x * indicator C x) = - positive_integral (\x. X x * indicator C x)" - (is "\C. C \ N \ ?eq C") + "conditional_expectation N X \ borel_measurable N" + and conditional_expectation: "\C. C \ sets N \ + (\\<^isup>+x. conditional_expectation N X x * indicator C x) = + (\\<^isup>+x. X x * indicator C x)" + (is "\C. C \ sets N \ ?eq C") proof - note CE = conditional_expectation_exists[OF assms, unfolded Bex_def] - then show "conditional_expectation N X \ borel_measurable (M\ sets := N \)" + then show "conditional_expectation N X \ borel_measurable N" unfolding conditional_expectation_def by (rule someI2_ex) blast - from CE show "\C. C\N \ ?eq C" + from CE show "\C. C \ sets N \ ?eq C" unfolding conditional_expectation_def by (rule someI2_ex) blast qed diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Product_Measure.thy --- a/src/HOL/Probability/Product_Measure.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Product_Measure.thy Fri Jan 14 16:00:13 2011 +0100 @@ -784,7 +784,7 @@ note SUPR_C = this ultimately show "?C f \ borel_measurable M1" by (simp cong: measurable_cong) - have "positive_integral (\x. SUP i. F i x) = (SUP i. positive_integral (F i))" + have "positive_integral (\x. (SUP i. F i x)) = (SUP i. positive_integral (F i))" using F_borel F_mono by (auto intro!: positive_integral_monotone_convergence_SUP[symmetric]) also have "(SUP i. positive_integral (F i)) = @@ -1935,8 +1935,7 @@ proof (unfold integrable_def, intro conjI) show "(\x. abs (?f x)) \ borel_measurable P" using borel by auto - have "positive_integral (\x. Real (abs (?f x))) = - positive_integral (\x. \i\I. Real (abs (f i (x i))))" + have "positive_integral (\x. Real (abs (?f x))) = positive_integral (\x. \i\I. Real (abs (f i (x i))))" by (simp add: Real_setprod abs_setprod) also have "\ = (\i\I. M.positive_integral i (\x. Real (abs (f i x))))" using f by (subst product_positive_integral_setprod) auto diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Radon_Nikodym.thy --- a/src/HOL/Probability/Radon_Nikodym.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Radon_Nikodym.thy Fri Jan 14 16:00:13 2011 +0100 @@ -114,7 +114,7 @@ qed lemma (in measure_space) density_is_absolutely_continuous: - assumes "\A. A \ sets M \ \ A = positive_integral (\x. f x * indicator A x)" + assumes "\A. A \ sets M \ \ A = (\\<^isup>+x. f x * indicator A x)" shows "absolutely_continuous \" using assms unfolding absolutely_continuous_def by (simp add: positive_integral_null_set) @@ -289,10 +289,10 @@ lemma (in finite_measure) Radon_Nikodym_finite_measure: assumes "finite_measure M \" assumes "absolutely_continuous \" - shows "\f \ borel_measurable M. \A\sets M. \ A = positive_integral (\x. f x * indicator A x)" + shows "\f \ borel_measurable M. \A\sets M. \ A = (\\<^isup>+x. f x * indicator A x)" proof - interpret M': finite_measure M \ using assms(1) . - def G \ "{g \ borel_measurable M. \A\sets M. positive_integral (\x. g x * indicator A x) \ \ A}" + def G \ "{g \ borel_measurable M. \A\sets M. (\\<^isup>+x. g x * indicator A x) \ \ A}" have "(\x. 0) \ G" unfolding G_def by auto hence "G \ {}" by auto { fix f g assume f: "f \ G" and g: "g \ G" @@ -308,16 +308,16 @@ have "\x. x \ space M \ max (g x) (f x) * indicator A x = g x * indicator (?A \ A) x + f x * indicator ((space M - ?A) \ A) x" by (auto simp: indicator_def max_def) - hence "positive_integral (\x. max (g x) (f x) * indicator A x) = - positive_integral (\x. g x * indicator (?A \ A) x) + - positive_integral (\x. f x * indicator ((space M - ?A) \ A) x)" + hence "(\\<^isup>+x. max (g x) (f x) * indicator A x) = + (\\<^isup>+x. g x * indicator (?A \ A) x) + + (\\<^isup>+x. f x * indicator ((space M - ?A) \ A) x)" using f g sets unfolding G_def by (auto cong: positive_integral_cong intro!: positive_integral_add borel_measurable_indicator) also have "\ \ \ (?A \ A) + \ ((space M - ?A) \ A)" using f g sets unfolding G_def by (auto intro!: add_mono) also have "\ = \ A" using M'.measure_additive[OF sets] union by auto - finally show "positive_integral (\x. max (g x) (f x) * indicator A x) \ \ A" . + finally show "(\\<^isup>+x. max (g x) (f x) * indicator A x) \ \ A" . qed } note max_in_G = this { fix f g assume "f \ g" and f: "\i. f i \ G" @@ -331,17 +331,17 @@ hence "\i. (\x. f i x * indicator A x) \ borel_measurable M" using f_borel by (auto intro!: borel_measurable_indicator) from positive_integral_isoton[OF isoton_indicator[OF `f \ g`] this] - have SUP: "positive_integral (\x. g x * indicator A x) = - (SUP i. positive_integral (\x. f i x * indicator A x))" + have SUP: "(\\<^isup>+x. g x * indicator A x) = + (SUP i. (\\<^isup>+x. f i x * indicator A x))" unfolding isoton_def by simp - show "positive_integral (\x. g x * indicator A x) \ \ A" unfolding SUP + show "(\\<^isup>+x. g x * indicator A x) \ \ A" unfolding SUP using f `A \ sets M` unfolding G_def by (auto intro!: SUP_leI) qed } note SUP_in_G = this let ?y = "SUP g : G. positive_integral g" have "?y \ \ (space M)" unfolding G_def proof (safe intro!: SUP_leI) - fix g assume "\A\sets M. positive_integral (\x. g x * indicator A x) \ \ A" + fix g assume "\A\sets M. (\\<^isup>+x. g x * indicator A x) \ \ A" from this[THEN bspec, OF top] show "positive_integral g \ \ (space M)" by (simp cong: positive_integral_cong) qed @@ -384,7 +384,7 @@ by (auto intro!: SUP_mono positive_integral_mono Max_ge) qed finally have int_f_eq_y: "positive_integral f = ?y" . - let "?t A" = "\ A - positive_integral (\x. f x * indicator A x)" + let "?t A" = "\ A - (\\<^isup>+x. f x * indicator A x)" have "finite_measure M ?t" proof show "?t {} = 0" by simp @@ -392,26 +392,26 @@ show "countably_additive M ?t" unfolding countably_additive_def proof safe fix A :: "nat \ 'a set" assume A: "range A \ sets M" "disjoint_family A" - have "(\\<^isub>\ n. positive_integral (\x. f x * indicator (A n) x)) - = positive_integral (\x. (\\<^isub>\n. f x * indicator (A n) x))" + have "(\\<^isub>\ n. (\\<^isup>+x. f x * indicator (A n) x)) + = (\\<^isup>+x. (\\<^isub>\n. f x * indicator (A n) x))" using `range A \ sets M` by (rule_tac positive_integral_psuminf[symmetric]) (auto intro!: borel_measurable_indicator) - also have "\ = positive_integral (\x. f x * indicator (\n. A n) x)" + also have "\ = (\\<^isup>+x. f x * indicator (\n. A n) x)" apply (rule positive_integral_cong) apply (subst psuminf_cmult_right) unfolding psuminf_indicator[OF `disjoint_family A`] .. - finally have "(\\<^isub>\ n. positive_integral (\x. f x * indicator (A n) x)) - = positive_integral (\x. f x * indicator (\n. A n) x)" . + finally have "(\\<^isub>\ n. (\\<^isup>+x. f x * indicator (A n) x)) + = (\\<^isup>+x. f x * indicator (\n. A n) x)" . moreover have "(\\<^isub>\n. \ (A n)) = \ (\n. A n)" using M'.measure_countably_additive A by (simp add: comp_def) - moreover have "\i. positive_integral (\x. f x * indicator (A i) x) \ \ (A i)" + moreover have "\i. (\\<^isup>+x. f x * indicator (A i) x) \ \ (A i)" using A `f \ G` unfolding G_def by auto moreover have v_fin: "\ (\i. A i) \ \" using M'.finite_measure A by (simp add: countable_UN) moreover { - have "positive_integral (\x. f x * indicator (\i. A i) x) \ \ (\i. A i)" + have "(\\<^isup>+x. f x * indicator (\i. A i) x) \ \ (\i. A i)" using A `f \ G` unfolding G_def by (auto simp: countable_UN) also have "\ (\i. A i) < \" using v_fin by (simp add: pextreal_less_\) - finally have "positive_integral (\x. f x * indicator (\i. A i) x) \ \" + finally have "(\\<^isup>+x. f x * indicator (\i. A i) x) \ \" by (simp add: pextreal_less_\) } ultimately show "(\\<^isub>\ n. ?t (A n)) = ?t (\i. A i)" @@ -433,9 +433,9 @@ hence pos_M: "0 < \ (space M)" using ac top unfolding absolutely_continuous_def by auto moreover - have "positive_integral (\x. f x * indicator (space M) x) \ \ (space M)" + have "(\\<^isup>+x. f x * indicator (space M) x) \ \ (space M)" using `f \ G` unfolding G_def by auto - hence "positive_integral (\x. f x * indicator (space M) x) \ \" + hence "(\\<^isup>+x. f x * indicator (space M) x) \ \" using M'.finite_measure_of_space by auto moreover def b \ "?t (space M) / \ (space M) / 2" @@ -462,30 +462,30 @@ let "?f0 x" = "f x + b * indicator A0 x" { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto - have "positive_integral (\x. ?f0 x * indicator A x) = - positive_integral (\x. f x * indicator A x + b * indicator (A \ A0) x)" + have "(\\<^isup>+x. ?f0 x * indicator A x) = + (\\<^isup>+x. f x * indicator A x + b * indicator (A \ A0) x)" by (auto intro!: positive_integral_cong simp: field_simps indicator_inter_arith) - hence "positive_integral (\x. ?f0 x * indicator A x) = - positive_integral (\x. f x * indicator A x) + b * \ (A \ A0)" + hence "(\\<^isup>+x. ?f0 x * indicator A x) = + (\\<^isup>+x. f x * indicator A x) + b * \ (A \ A0)" using `A0 \ sets M` `A \ A0 \ sets M` A by (simp add: borel_measurable_indicator positive_integral_add positive_integral_cmult_indicator) } note f0_eq = this { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto - have f_le_v: "positive_integral (\x. f x * indicator A x) \ \ A" + have f_le_v: "(\\<^isup>+x. f x * indicator A x) \ \ A" using `f \ G` A unfolding G_def by auto note f0_eq[OF A] - also have "positive_integral (\x. f x * indicator A x) + b * \ (A \ A0) \ - positive_integral (\x. f x * indicator A x) + ?t (A \ A0)" + also have "(\\<^isup>+x. f x * indicator A x) + b * \ (A \ A0) \ + (\\<^isup>+x. f x * indicator A x) + ?t (A \ A0)" using bM_le_t[OF `A \ A0 \ sets M`] `A \ sets M` `A0 \ sets M` by (auto intro!: add_left_mono) - also have "\ \ positive_integral (\x. f x * indicator A x) + ?t A" + also have "\ \ (\\<^isup>+x. f x * indicator A x) + ?t A" using M.measure_mono[simplified, OF _ `A \ A0 \ sets M` `A \ sets M`] by (auto intro!: add_left_mono) also have "\ \ \ A" using f_le_v M'.finite_measure[simplified, OF `A \ sets M`] - by (cases "positive_integral (\x. f x * indicator A x)", cases "\ A", auto) - finally have "positive_integral (\x. ?f0 x * indicator A x) \ \ A" . } + by (cases "(\\<^isup>+x. f x * indicator A x)", cases "\ A", auto) + finally have "(\\<^isup>+x. ?f0 x * indicator A x) \ \ A" . } hence "?f0 \ G" using `A0 \ sets M` unfolding G_def by (auto intro!: borel_measurable_indicator borel_measurable_pextreal_add borel_measurable_pextreal_times) have real: "?t (space M) \ \" "?t A0 \ \" @@ -525,11 +525,11 @@ show ?thesis proof (safe intro!: bexI[of _ f]) fix A assume "A\sets M" - show "\ A = positive_integral (\x. f x * indicator A x)" + show "\ A = (\\<^isup>+x. f x * indicator A x)" proof (rule antisym) - show "positive_integral (\x. f x * indicator A x) \ \ A" + show "(\\<^isup>+x. f x * indicator A x) \ \ A" using `f \ G` `A \ sets M` unfolding G_def by auto - show "\ A \ positive_integral (\x. f x * indicator A x)" + show "\ A \ (\\<^isup>+x. f x * indicator A x)" using upper_bound[THEN bspec, OF `A \ sets M`] by (simp add: pextreal_zero_le_diff) qed @@ -669,7 +669,7 @@ lemma (in finite_measure) Radon_Nikodym_finite_measure_infinite: assumes "measure_space M \" assumes "absolutely_continuous \" - shows "\f \ borel_measurable M. \A\sets M. \ A = positive_integral (\x. f x * indicator A x)" + shows "\f \ borel_measurable M. \A\sets M. \ A = (\\<^isup>+x. f x * indicator A x)" proof - interpret v: measure_space M \ by fact from split_space_into_finite_sets_and_rest[OF assms] @@ -680,7 +680,7 @@ and Q_fin: "\i. \ (Q i) \ \" by force from Q have Q_sets: "\i. Q i \ sets M" by auto have "\i. \f. f\borel_measurable M \ (\A\sets M. - \ (Q i \ A) = positive_integral (\x. f x * indicator (Q i \ A) x))" + \ (Q i \ A) = (\\<^isup>+x. f x * indicator (Q i \ A) x))" proof fix i have indicator_eq: "\f x A. (f x :: pextreal) * indicator (Q i \ A) x * indicator (Q i) x @@ -702,17 +702,17 @@ by (auto simp: R.absolutely_continuous_def absolutely_continuous_def) from finite_measure.Radon_Nikodym_finite_measure[OF fm fmv this] obtain f where f: "(\x. f x * indicator (Q i) x) \ borel_measurable M" - and f_int: "\A. A\sets M \ \ (Q i \ A) = positive_integral (\x. (f x * indicator (Q i) x) * indicator A x)" + and f_int: "\A. A\sets M \ \ (Q i \ A) = (\\<^isup>+x. (f x * indicator (Q i) x) * indicator A x)" unfolding Bex_def borel_measurable_restricted[OF `Q i \ sets M`] positive_integral_restricted[OF `Q i \ sets M`] by (auto simp: indicator_eq) then show "\f. f\borel_measurable M \ (\A\sets M. - \ (Q i \ A) = positive_integral (\x. f x * indicator (Q i \ A) x))" + \ (Q i \ A) = (\\<^isup>+x. f x * indicator (Q i \ A) x))" by (fastsimp intro!: exI[of _ "\x. f x * indicator (Q i) x"] positive_integral_cong simp: indicator_def) qed from choice[OF this] obtain f where borel: "\i. f i \ borel_measurable M" and f: "\A i. A \ sets M \ - \ (Q i \ A) = positive_integral (\x. f i x * indicator (Q i \ A) x)" + \ (Q i \ A) = (\\<^isup>+x. f i x * indicator (Q i \ A) x)" by auto let "?f x" = "(\\<^isub>\ i. f i x * indicator (Q i) x) + \ * indicator Q0 x" @@ -728,7 +728,7 @@ f i x * indicator (Q i \ A) x" "\x i. (indicator A x * indicator Q0 x :: pextreal) = indicator (Q0 \ A) x" by (auto simp: indicator_def) - have "positive_integral (\x. ?f x * indicator A x) = + have "(\\<^isup>+x. ?f x * indicator A x) = (\\<^isub>\ i. \ (Q i \ A)) + \ * \ (Q0 \ A)" unfolding f[OF `A \ sets M`] apply (simp del: pextreal_times(2) add: field_simps *) @@ -755,7 +755,7 @@ using Q_sets `A \ sets M` Q0(1) by (auto intro!: countable_UN) moreover have "((\i. Q i) \ A) \ (Q0 \ A) = A" "((\i. Q i) \ A) \ (Q0 \ A) = {}" using `A \ sets M` sets_into_space Q0 by auto - ultimately show "\ A = positive_integral (\x. ?f x * indicator A x)" + ultimately show "\ A = (\\<^isup>+x. ?f x * indicator A x)" using v.measure_additive[simplified, of "(\i. Q i) \ A" "Q0 \ A"] by simp qed @@ -764,14 +764,14 @@ lemma (in sigma_finite_measure) Radon_Nikodym: assumes "measure_space M \" assumes "absolutely_continuous \" - shows "\f \ borel_measurable M. \A\sets M. \ A = positive_integral (\x. f x * indicator A x)" + shows "\f \ borel_measurable M. \A\sets M. \ A = (\\<^isup>+x. f x * indicator A x)" proof - from Ex_finite_integrable_function obtain h where finite: "positive_integral h \ \" and borel: "h \ borel_measurable M" and pos: "\x. x \ space M \ 0 < h x" and "\x. x \ space M \ h x < \" by auto - let "?T A" = "positive_integral (\x. h x * indicator A x)" + let "?T A" = "(\\<^isup>+x. h x * indicator A x)" from measure_space_density[OF borel] finite interpret T: finite_measure M ?T unfolding finite_measure_def finite_measure_axioms_def @@ -792,7 +792,7 @@ then have "(\x. f x * indicator A x) \ borel_measurable M" using f_borel by (auto intro: borel_measurable_pextreal_times borel_measurable_indicator) from positive_integral_translated_density[OF borel this] - show "\ A = positive_integral (\x. h x * f x * indicator A x)" + show "\ A = (\\<^isup>+x. h x * f x * indicator A x)" unfolding fT[OF `A \ sets M`] by (simp add: field_simps) qed qed @@ -802,7 +802,7 @@ lemma (in measure_space) finite_density_unique: assumes borel: "f \ borel_measurable M" "g \ borel_measurable M" and fin: "positive_integral f < \" - shows "(\A\sets M. positive_integral (\x. f x * indicator A x) = positive_integral (\x. g x * indicator A x)) + shows "(\A\sets M. (\\<^isup>+x. f x * indicator A x) = (\\<^isup>+x. g x * indicator A x)) \ (AE x. f x = g x)" (is "(\A\sets M. ?P f A = ?P g A) \ _") proof (intro iffI ballI) @@ -817,7 +817,7 @@ and g_fin: "positive_integral g < \" and eq: "\A\sets M. ?P f A = ?P g A" let ?N = "{x\space M. g x < f x}" have N: "?N \ sets M" using borel by simp - have "?P (\x. (f x - g x)) ?N = positive_integral (\x. f x * indicator ?N x - g x * indicator ?N x)" + have "?P (\x. (f x - g x)) ?N = (\\<^isup>+x. f x * indicator ?N x - g x * indicator ?N x)" by (auto intro!: positive_integral_cong simp: indicator_def) also have "\ = ?P f ?N - ?P g ?N" proof (rule positive_integral_diff) @@ -848,7 +848,7 @@ lemma (in finite_measure) density_unique_finite_measure: assumes borel: "f \ borel_measurable M" "f' \ borel_measurable M" - assumes f: "\A. A \ sets M \ positive_integral (\x. f x * indicator A x) = positive_integral (\x. f' x * indicator A x)" + assumes f: "\A. A \ sets M \ (\\<^isup>+x. f x * indicator A x) = (\\<^isup>+x. f' x * indicator A x)" (is "\A. A \ sets M \ ?P f A = ?P f' A") shows "AE x. f x = f' x" proof - @@ -876,13 +876,13 @@ have 2: "AE x. ?f Q0 x = ?f' Q0 x" proof (rule AE_I') { fix f :: "'a \ pextreal" assume borel: "f \ borel_measurable M" - and eq: "\A. A \ sets M \ ?\ A = positive_integral (\x. f x * indicator A x)" + and eq: "\A. A \ sets M \ ?\ A = (\\<^isup>+x. f x * indicator A x)" let "?A i" = "Q0 \ {x \ space M. f x < of_nat i}" have "(\i. ?A i) \ null_sets" proof (rule null_sets_UN) fix i have "?A i \ sets M" using borel Q0(1) by auto - have "?\ (?A i) \ positive_integral (\x. of_nat i * indicator (?A i) x)" + have "?\ (?A i) \ (\\<^isup>+x. of_nat i * indicator (?A i) x)" unfolding eq[OF `?A i \ sets M`] by (auto intro!: positive_integral_mono simp: indicator_def) also have "\ = of_nat i * \ (?A i)" @@ -912,38 +912,38 @@ lemma (in sigma_finite_measure) density_unique: assumes borel: "f \ borel_measurable M" "f' \ borel_measurable M" - assumes f: "\A. A \ sets M \ positive_integral (\x. f x * indicator A x) = positive_integral (\x. f' x * indicator A x)" + assumes f: "\A. A \ sets M \ (\\<^isup>+x. f x * indicator A x) = (\\<^isup>+x. f' x * indicator A x)" (is "\A. A \ sets M \ ?P f A = ?P f' A") shows "AE x. f x = f' x" proof - obtain h where h_borel: "h \ borel_measurable M" and fin: "positive_integral h \ \" and pos: "\x. x \ space M \ 0 < h x \ h x < \" using Ex_finite_integrable_function by auto - interpret h: measure_space M "\A. positive_integral (\x. h x * indicator A x)" + interpret h: measure_space M "\A. (\\<^isup>+x. h x * indicator A x)" using h_borel by (rule measure_space_density) - interpret h: finite_measure M "\A. positive_integral (\x. h x * indicator A x)" + interpret h: finite_measure M "\A. (\\<^isup>+x. h x * indicator A x)" by default (simp cong: positive_integral_cong add: fin) - interpret f: measure_space M "\A. positive_integral (\x. f x * indicator A x)" + interpret f: measure_space M "\A. (\\<^isup>+x. f x * indicator A x)" using borel(1) by (rule measure_space_density) - interpret f': measure_space M "\A. positive_integral (\x. f' x * indicator A x)" + interpret f': measure_space M "\A. (\\<^isup>+x. f' x * indicator A x)" using borel(2) by (rule measure_space_density) { fix A assume "A \ sets M" then have " {x \ space M. h x \ 0 \ indicator A x \ (0::pextreal)} = A" using pos sets_into_space by (force simp: indicator_def) - then have "positive_integral (\xa. h xa * indicator A xa) = 0 \ A \ null_sets" + then have "(\\<^isup>+x. h x * indicator A x) = 0 \ A \ null_sets" using h_borel `A \ sets M` by (simp add: positive_integral_0_iff) } note h_null_sets = this { fix A assume "A \ sets M" - have "positive_integral (\x. h x * (f x * indicator A x)) = + have "(\\<^isup>+x. h x * (f x * indicator A x)) = f.positive_integral (\x. h x * indicator A x)" using `A \ sets M` h_borel borel by (simp add: positive_integral_translated_density ac_simps cong: positive_integral_cong) also have "\ = f'.positive_integral (\x. h x * indicator A x)" by (rule f'.positive_integral_cong_measure) (rule f) - also have "\ = positive_integral (\x. h x * (f' x * indicator A x))" + also have "\ = (\\<^isup>+x. h x * (f' x * indicator A x))" using `A \ sets M` h_borel borel by (simp add: positive_integral_translated_density ac_simps cong: positive_integral_cong) - finally have "positive_integral (\x. h x * (f x * indicator A x)) = positive_integral (\x. h x * (f' x * indicator A x))" . } + finally have "(\\<^isup>+x. h x * (f x * indicator A x)) = (\\<^isup>+x. h x * (f' x * indicator A x))" . } then have "h.almost_everywhere (\x. f x = f' x)" using h_borel borel by (intro h.density_unique_finite_measure[OF borel]) @@ -955,7 +955,7 @@ lemma (in sigma_finite_measure) sigma_finite_iff_density_finite: assumes \: "measure_space M \" and f: "f \ borel_measurable M" - and eq: "\A. A \ sets M \ \ A = positive_integral (\x. f x * indicator A x)" + and eq: "\A. A \ sets M \ \ A = (\\<^isup>+x. f x * indicator A x)" shows "sigma_finite_measure M \ \ (AE x. f x \ \)" proof assume "sigma_finite_measure M \" @@ -965,10 +965,10 @@ and fin: "\x. x \ space M \ 0 < h x \ h x < \" by auto have "AE x. f x * h x \ \" proof (rule AE_I') - have "\.positive_integral h = positive_integral (\x. f x * h x)" + have "\.positive_integral h = (\\<^isup>+x. f x * h x)" by (simp add: \.positive_integral_cong_measure[symmetric, OF eq[symmetric]]) (intro positive_integral_translated_density f h) - then have "positive_integral (\x. f x * h x) \ \" + then have "(\\<^isup>+x. f x * h x) \ \" using h(2) by simp then show "(\x. f x * h x) -` {\} \ space M \ null_sets" using f h(1) by (auto intro!: positive_integral_omega borel_measurable_vimage) @@ -1018,12 +1018,12 @@ next fix n obtain i j where [simp]: "prod_decode n = (i, j)" by (cases "prod_decode n") auto - have "positive_integral (\x. f x * indicator (A i \ Q j) x) \ \" + have "(\\<^isup>+x. f x * indicator (A i \ Q j) x) \ \" proof (cases i) case 0 have "AE x. f x * indicator (A i \ Q j) x = 0" using AE by (rule AE_mp) (auto intro!: AE_cong simp: A_def `i = 0`) - then have "positive_integral (\x. f x * indicator (A i \ Q j) x) = 0" + then have "(\\<^isup>+x. f x * indicator (A i \ Q j) x) = 0" using A_in_sets f apply (subst positive_integral_0_iff) apply fast @@ -1034,8 +1034,8 @@ then show ?thesis by simp next case (Suc n) - then have "positive_integral (\x. f x * indicator (A i \ Q j) x) \ - positive_integral (\x. of_nat (Suc n) * indicator (Q j) x)" + then have "(\\<^isup>+x. f x * indicator (A i \ Q j) x) \ + (\\<^isup>+x. of_nat (Suc n) * indicator (Q j) x)" by (auto intro!: positive_integral_mono simp: indicator_def A_def) also have "\ = of_nat (Suc n) * \ (Q j)" using Q by (auto intro!: positive_integral_cmult_indicator) @@ -1052,7 +1052,7 @@ definition (in sigma_finite_measure) "RN_deriv \ \ SOME f. f \ borel_measurable M \ - (\A \ sets M. \ A = positive_integral (\x. f x * indicator A x))" + (\A \ sets M. \ A = (\\<^isup>+x. f x * indicator A x))" lemma (in sigma_finite_measure) RN_deriv_cong: assumes cong: "\A. A \ sets M \ \' A = \ A" "\A. A \ sets M \ \' A = \ A" @@ -1069,7 +1069,7 @@ assumes "measure_space M \" assumes "absolutely_continuous \" shows "RN_deriv \ \ borel_measurable M" (is ?borel) - and "\A. A \ sets M \ \ A = positive_integral (\x. RN_deriv \ x * indicator A x)" + and "\A. A \ sets M \ \ A = (\\<^isup>+x. RN_deriv \ x * indicator A x)" (is "\A. _ \ ?int A") proof - note Ex = Radon_Nikodym[OF assms, unfolded Bex_def] @@ -1082,13 +1082,13 @@ lemma (in sigma_finite_measure) RN_deriv_positive_integral: assumes \: "measure_space M \" "absolutely_continuous \" and f: "f \ borel_measurable M" - shows "measure_space.positive_integral M \ f = positive_integral (\x. RN_deriv \ x * f x)" + shows "measure_space.positive_integral M \ f = (\\<^isup>+x. RN_deriv \ x * f x)" proof - interpret \: measure_space M \ by fact have "\.positive_integral f = - measure_space.positive_integral M (\A. positive_integral (\x. RN_deriv \ x * indicator A x)) f" + measure_space.positive_integral M (\A. (\\<^isup>+x. RN_deriv \ x * indicator A x)) f" by (intro \.positive_integral_cong_measure[symmetric] RN_deriv(2)[OF \, symmetric]) - also have "\ = positive_integral (\x. RN_deriv \ x * f x)" + also have "\ = (\\<^isup>+x. RN_deriv \ x * f x)" by (intro positive_integral_translated_density RN_deriv[OF \] f) finally show ?thesis . qed @@ -1096,11 +1096,11 @@ lemma (in sigma_finite_measure) RN_deriv_unique: assumes \: "measure_space M \" "absolutely_continuous \" and f: "f \ borel_measurable M" - and eq: "\A. A \ sets M \ \ A = positive_integral (\x. f x * indicator A x)" + and eq: "\A. A \ sets M \ \ A = (\\<^isup>+x. f x * indicator A x)" shows "AE x. f x = RN_deriv \ x" proof (rule density_unique[OF f RN_deriv(1)[OF \]]) fix A assume A: "A \ sets M" - show "positive_integral (\x. f x * indicator A x) = positive_integral (\x. RN_deriv \ x * indicator A x)" + show "(\\<^isup>+x. f x * indicator A x) = (\\<^isup>+x. RN_deriv \ x * indicator A x)" unfolding eq[OF A, symmetric] RN_deriv(2)[OF \ A, symmetric] .. qed @@ -1130,10 +1130,10 @@ using f by (auto simp: bij_inv_def indicator_def) have "\ (f ` (f -` A \ S)) = sf.positive_integral (\x. sf.RN_deriv (\A. \ (f ` A)) x * indicator (f -` A \ S) x)" using `A \ sets M` by (force intro!: sf.RN_deriv(2)[OF \' ac]) - also have "\ = positive_integral (\x. sf.RN_deriv (\A. \ (f ` A)) (g x) * indicator A x)" + also have "\ = (\\<^isup>+x. sf.RN_deriv (\A. \ (f ` A)) (g x) * indicator A x)" unfolding positive_integral_vimage_inv[OF f] by (simp add: * cong: positive_integral_cong) - finally show "\ A = positive_integral (\x. sf.RN_deriv (\A. \ (f ` A)) (g x) * indicator A x)" + finally show "\ A = (\\<^isup>+x. sf.RN_deriv (\A. \ (f ` A)) (g x) * indicator A x)" unfolding A_f[OF `A \ sets M`] . qed @@ -1150,7 +1150,7 @@ lemma (in sigma_finite_measure) assumes \: "sigma_finite_measure M \" "absolutely_continuous \" and f: "f \ borel_measurable M" - shows RN_deriv_integral: "measure_space.integral M \ f = integral (\x. real (RN_deriv \ x) * f x)" (is ?integral) + shows RN_deriv_integral: "measure_space.integral M \ f = (\x. real (RN_deriv \ x) * f x)" (is ?integral) and RN_deriv_integrable: "measure_space.integrable M \ f \ integrable (\x. real (RN_deriv \ x) * f x)" (is ?integrable) proof - interpret \: sigma_finite_measure M \ by fact @@ -1164,7 +1164,7 @@ then have "RN_deriv \ x * Real (f x) = Real (real (RN_deriv \ x) * f x)" using * by (simp add: Real_real) } note * = this - have "positive_integral (\x. RN_deriv \ x * Real (f x)) = positive_integral (\x. Real (real (RN_deriv \ x) * f x))" + have "(\\<^isup>+x. RN_deriv \ x * Real (f x)) = (\\<^isup>+x. Real (real (RN_deriv \ x) * f x))" apply (rule positive_integral_cong_AE) apply (rule AE_mp[OF RN_deriv_finite[OF \]]) by (auto intro!: AE_cong simp: *) } @@ -1182,7 +1182,7 @@ proof - note deriv = RN_deriv[OF assms(1, 2)] from deriv(2)[OF `{x} \ sets M`] - have "\ {x} = positive_integral (\w. RN_deriv \ x * indicator {x} w)" + have "\ {x} = (\\<^isup>+w. RN_deriv \ x * indicator {x} w)" by (auto simp: indicator_def intro!: positive_integral_cong) thus ?thesis using positive_integral_cmult_indicator[OF `{x} \ sets M`] by auto diff -r a5478b1c8b8a -r 4638b1210d26 src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Fri Jan 14 13:59:06 2011 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Fri Jan 14 16:00:13 2011 +0100 @@ -222,7 +222,44 @@ | Union: "(\i::nat. a i \ sigma_sets sp A) \ (\i. a i) \ sigma_sets sp A" definition - "sigma M = (| space = space M, sets = sigma_sets (space M) (sets M) |)" + "sigma M = \ space = space M, sets = sigma_sets (space M) (sets M) \" + +lemma (in sigma_algebra) sigma_sets_subset: + assumes a: "a \ sets M" + shows "sigma_sets (space M) a \ sets M" +proof + fix x + assume "x \ sigma_sets (space M) a" + from this show "x \ sets M" + by (induct rule: sigma_sets.induct, auto) (metis a subsetD) +qed + +lemma sigma_sets_into_sp: "A \ Pow sp \ x \ sigma_sets sp A \ x \ sp" + by (erule sigma_sets.induct, auto) + +lemma sigma_algebra_sigma_sets: + "a \ Pow (space M) \ sets M = sigma_sets (space M) a \ sigma_algebra M" + by (auto simp add: sigma_algebra_iff2 dest: sigma_sets_into_sp + intro!: sigma_sets.Union sigma_sets.Empty sigma_sets.Compl) + +lemma sigma_sets_least_sigma_algebra: + assumes "A \ Pow S" + shows "sigma_sets S A = \{B. A \ B \ sigma_algebra \space = S, sets = B\}" +proof safe + fix B X assume "A \ B" and sa: "sigma_algebra \ space = S, sets = B \" + and X: "X \ sigma_sets S A" + from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF `A \ B`] X + show "X \ B" by auto +next + fix X assume "X \ \{B. A \ B \ sigma_algebra \space = S, sets = B\}" + then have [intro!]: "\B. A \ B \ sigma_algebra \space = S, sets = B\ \ X \ B" + by simp + have "A \ sigma_sets S A" using assms + by (auto intro!: sigma_sets.Basic) + moreover have "sigma_algebra \space = S, sets = sigma_sets S A\" + using assms by (intro sigma_algebra_sigma_sets[of A]) auto + ultimately show "X \ sigma_sets S A" by auto +qed lemma sets_sigma: "sets (sigma M) = sigma_sets (space M) (sets M)" unfolding sigma_def by simp @@ -233,9 +270,6 @@ lemma sigma_sets_top: "sp \ sigma_sets sp A" by (metis Diff_empty sigma_sets.Compl sigma_sets.Empty) -lemma sigma_sets_into_sp: "A \ Pow sp \ x \ sigma_sets sp A \ x \ sp" - by (erule sigma_sets.induct, auto) - lemma sigma_sets_Un: "a \ sigma_sets sp A \ b \ sigma_sets sp A \ a \ b \ sigma_sets sp A" apply (simp add: Un_range_binary range_binary_eq) @@ -274,16 +308,6 @@ finally show ?thesis . qed -lemma (in sigma_algebra) sigma_sets_subset: - assumes a: "a \ sets M" - shows "sigma_sets (space M) a \ sets M" -proof - fix x - assume "x \ sigma_sets (space M) a" - from this show "x \ sets M" - by (induct rule: sigma_sets.induct, auto) (metis a subsetD) -qed - lemma (in sigma_algebra) sigma_sets_eq: "sigma_sets (space M) (sets M) = sets M" proof @@ -294,14 +318,6 @@ by (metis sigma_sets_subset subset_refl) qed -lemma sigma_algebra_sigma_sets: - "a \ Pow (space M) \ sets M = sigma_sets (space M) a \ sigma_algebra M" - apply (auto simp add: sigma_algebra_def sigma_algebra_axioms_def - algebra_def sigma_sets.Empty sigma_sets.Compl sigma_sets_Un) - apply (blast dest: sigma_sets_into_sp) - apply (rule sigma_sets.Union, fast) - done - lemma sigma_algebra_sigma: "sets M \ Pow (space M) \ sigma_algebra (sigma M)" apply (rule sigma_algebra_sigma_sets) @@ -312,25 +328,6 @@ "sets N \ sets M \ space N = space M \ sets (sigma N) \ (sets M)" by (simp add: sigma_def sigma_sets_subset) -lemma sigma_sets_least_sigma_algebra: - assumes "A \ Pow S" - shows "sigma_sets S A = \{B. A \ B \ sigma_algebra \space = S, sets = B\}" -proof safe - fix B X assume "A \ B" and sa: "sigma_algebra \ space = S, sets = B \" - and X: "X \ sigma_sets S A" - from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF `A \ B`] X - show "X \ B" by auto -next - fix X assume "X \ \{B. A \ B \ sigma_algebra \space = S, sets = B\}" - then have [intro!]: "\B. A \ B \ sigma_algebra \space = S, sets = B\ \ X \ B" - by simp - have "A \ sigma_sets S A" using assms - by (auto intro!: sigma_sets.Basic) - moreover have "sigma_algebra \space = S, sets = sigma_sets S A\" - using assms by (intro sigma_algebra_sigma_sets[of A]) auto - ultimately show "X \ sigma_sets S A" by auto -qed - lemma (in sigma_algebra) restriction_in_sets: fixes A :: "nat \ 'a set" assumes "S \ sets M"