# HG changeset patch # User hoelzl # Date 1291886537 -3600 # Node ID ababba14c965c5f98ec2b09fe9d6eff521702954 # Parent 1dc7652ce404e538f084499b3f6844729b41f113# Parent a1abfa4e2b44b17abc703743244a8980244b91e2 merged diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Thu Dec 09 10:22:17 2010 +0100 @@ -1347,6 +1347,16 @@ by (auto intro!: measurable_If) qed +lemma (in sigma_algebra) borel_measurable_pextreal_setsum[simp, intro]: + fixes f :: "'c \ 'a \ pextreal" + assumes "\i. i \ S \ f i \ borel_measurable M" + shows "(\x. \i\S. f i x) \ borel_measurable M" +proof cases + assume "finite S" + thus ?thesis using assms + by induct auto +qed (simp add: borel_measurable_const) + lemma (in sigma_algebra) borel_measurable_pextreal_times[intro, simp]: fixes f :: "'a \ pextreal" assumes "f \ borel_measurable M" "g \ borel_measurable M" shows "(\x. f x * g x) \ borel_measurable M" @@ -1359,15 +1369,14 @@ by (auto intro!: measurable_If) qed -lemma (in sigma_algebra) borel_measurable_pextreal_setsum[simp, intro]: +lemma (in sigma_algebra) borel_measurable_pextreal_setprod[simp, intro]: fixes f :: "'c \ 'a \ pextreal" assumes "\i. i \ S \ f i \ borel_measurable M" - shows "(\x. \i\S. f i x) \ borel_measurable M" + shows "(\x. \i\S. f i x) \ borel_measurable M" proof cases assume "finite S" - thus ?thesis using assms - by induct auto -qed (simp add: borel_measurable_const) + thus ?thesis using assms by induct auto +qed simp lemma (in sigma_algebra) borel_measurable_pextreal_min[simp, intro]: fixes f g :: "'a \ pextreal" @@ -1386,7 +1395,7 @@ lemma (in sigma_algebra) borel_measurable_SUP[simp, intro]: fixes f :: "'d\countable \ 'a \ pextreal" assumes "\i. i \ A \ f i \ borel_measurable M" - shows "(SUP i : A. f i) \ borel_measurable M" (is "?sup \ borel_measurable M") + shows "(\x. SUP i : A. f i x) \ borel_measurable M" (is "?sup \ borel_measurable M") unfolding borel_measurable_pextreal_iff_greater proof safe fix a @@ -1399,7 +1408,7 @@ lemma (in sigma_algebra) borel_measurable_INF[simp, intro]: fixes f :: "'d :: countable \ 'a \ pextreal" assumes "\i. i \ A \ f i \ borel_measurable M" - shows "(INF i : A. f i) \ borel_measurable M" (is "?inf \ borel_measurable M") + shows "(\x. INF i : A. f i x) \ borel_measurable M" (is "?inf \ borel_measurable M") unfolding borel_measurable_pextreal_iff_less proof safe fix a @@ -1423,20 +1432,10 @@ using assms by auto qed -lemma INFI_fun_expand: - "(INF y:A. f y) = (\x. (INF y:A. f y x))" - by (simp add: fun_eq_iff INFI_apply) - -lemma SUPR_fun_expand: - "(SUP y:A. f y) = (\x. (SUP y:A. f y x))" - by (simp add: fun_eq_iff SUPR_apply) - lemma (in sigma_algebra) borel_measurable_psuminf[simp, intro]: assumes "\i. f i \ borel_measurable M" shows "(\x. (\\<^isub>\ i. f i x)) \ borel_measurable M" - using assms unfolding psuminf_def - by (auto intro!: borel_measurable_SUP [unfolded SUPR_fun_expand]) - + using assms unfolding psuminf_def by auto section "LIMSEQ is borel measurable" @@ -1459,13 +1458,12 @@ note eq = this have *: "\x. real (Real (u' x)) - real (Real (- u' x)) = u' x" by auto - have "(SUP n. INF m. (\x. Real (u (n + m) x))) \ borel_measurable M" - "(SUP n. INF m. (\x. Real (- u (n + m) x))) \ borel_measurable M" - using u by (auto intro: borel_measurable_SUP borel_measurable_INF borel_measurable_Real) + have "(\x. SUP n. INF m. Real (u (n + m) x)) \ borel_measurable M" + "(\x. SUP n. INF m. Real (- u (n + m) x)) \ borel_measurable M" + using u by auto with eq[THEN measurable_cong, of M "\x. x" borel] have "(\x. Real (u' x)) \ borel_measurable M" - "(\x. Real (- u' x)) \ borel_measurable M" - unfolding SUPR_fun_expand INFI_fun_expand by auto + "(\x. Real (- u' x)) \ borel_measurable M" by auto note this[THEN borel_measurable_real] from borel_measurable_diff[OF this] show ?thesis unfolding * . diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Complete_Measure.thy --- a/src/HOL/Probability/Complete_Measure.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Complete_Measure.thy Thu Dec 09 10:22:17 2010 +0100 @@ -257,17 +257,14 @@ show ?thesis proof (intro bexI) from AE[unfolded all_AE_countable] - show "AE x. g x = (SUP i. f' i) x" (is "AE x. g x = ?f x") + show "AE x. g x = (SUP i. f' i x)" (is "AE x. g x = ?f x") proof (rule AE_mp, safe intro!: AE_cong) fix x assume eq: "\i. f i x = f' i x" - have "g x = (SUP i. f i x)" - using `f \ g` unfolding isoton_def SUPR_fun_expand by auto - then show "g x = ?f x" - using eq unfolding SUPR_fun_expand by auto + moreover have "g = SUPR UNIV f" using `f \ g` unfolding isoton_def by simp + ultimately show "g x = ?f x" by (simp add: SUPR_apply) qed show "?f \ borel_measurable M" - using sf by (auto intro!: borel_measurable_SUP - intro: borel_measurable_simple_function) + using sf by (auto intro: borel_measurable_simple_function) qed qed diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Information.thy --- a/src/HOL/Probability/Information.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Information.thy Thu Dec 09 10:22:17 2010 +0100 @@ -188,7 +188,7 @@ using f by (rule \.measure_space_isomorphic) let ?RN = "sigma_finite_measure.RN_deriv ?M ?\ ?\" - from RN_deriv_vimage[OF f \] + from RN_deriv_vimage[OF f[THEN bij_inv_the_inv_into] \] have *: "\.almost_everywhere (\x. ?RN (the_inv_into S f x) = RN_deriv \ x)" by (rule absolutely_continuous_AE[OF \]) diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Thu Dec 09 10:22:17 2010 +0100 @@ -1069,16 +1069,16 @@ lemma (in measure_space) positive_integral_vimage_inv: fixes g :: "'d \ pextreal" and f :: "'d \ 'a" - assumes f: "bij_betw f S (space M)" + 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 (the_inv_into S f x))" + positive_integral (\x. g (h x))" proof - interpret v: measure_space "vimage_algebra S f" "\A. \ (f ` A)" - using f by (rule measure_space_isomorphic) + using f by (rule measure_space_isomorphic[OF bij_inv_bij_betw(1)]) show ?thesis - unfolding positive_integral_vimage[OF f, of "\x. g (the_inv_into S f x)"] - using f[unfolded bij_betw_def] - by (auto intro!: v.positive_integral_cong simp: the_inv_into_f_f) + unfolding positive_integral_vimage[OF f[THEN bij_inv_bij_betw(1)], of "\x. g (h x)"] + using f[unfolded bij_inv_def] + by (auto intro!: v.positive_integral_cong) qed lemma (in measure_space) positive_integral_SUP_approx: @@ -1176,8 +1176,6 @@ apply (rule positive_integral_mono) using `f \ u` unfolding isoton_def le_fun_def by auto next - have "u \ borel_measurable M" - using borel_measurable_SUP[of UNIV f] assms by (auto simp: isoton_def) have u: "u = (SUP i. f i)" using `f \ u` unfolding isoton_def by auto show "(SUP i. positive_integral (f i)) = positive_integral u" @@ -1198,8 +1196,6 @@ shows "(SUP i. positive_integral (f i)) = positive_integral (\x. SUP i. f i x)" (is "_ = positive_integral ?u") proof - - have "?u \ borel_measurable M" - using borel_measurable_SUP[of _ f] assms by (simp add: SUPR_fun_expand) show ?thesis proof (rule antisym) show "(SUP j. positive_integral (f j)) \ positive_integral ?u" @@ -1209,9 +1205,9 @@ have "\i. rf i \ borel_measurable M" unfolding rf_def using assms by (simp cong: measurable_cong) moreover have iso: "rf \ ru" using assms unfolding rf_def ru_def - unfolding isoton_def SUPR_fun_expand le_fun_def fun_eq_iff + unfolding isoton_def le_fun_def fun_eq_iff SUPR_apply using SUP_const[OF UNIV_not_empty] - by (auto simp: restrict_def le_fun_def SUPR_fun_expand fun_eq_iff) + by (auto simp: restrict_def le_fun_def fun_eq_iff) ultimately have "positive_integral ru \ (SUP i. positive_integral (rf i))" unfolding positive_integral_alt[of ru] by (auto simp: le_fun_def intro!: SUP_leI positive_integral_SUP_approx) @@ -1283,6 +1279,11 @@ shows "positive_integral (\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" + 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) @@ -1349,24 +1350,16 @@ lemma (in measure_space) positive_integral_lim_INF: fixes u :: "nat \ 'a \ pextreal" assumes "\i. u i \ borel_measurable M" - shows "positive_integral (SUP n. INF m. u (m + n)) \ + shows "positive_integral (\x. SUP n. INF m. u (m + n) x) \ (SUP n. INF m. positive_integral (u (m + n)))" proof - - have "(SUP n. INF m. u (m + n)) \ borel_measurable M" - by (auto intro!: borel_measurable_SUP borel_measurable_INF assms) - - have "(\n. INF m. u (m + n)) \ (SUP n. INF m. u (m + n))" - proof (unfold isoton_def, safe intro!: INF_mono bexI) - fix i m show "u (Suc m + i) \ u (m + Suc i)" by simp - qed simp - from positive_integral_isoton[OF this] assms - have "positive_integral (SUP n. INF m. u (m + n)) = - (SUP n. positive_integral (INF m. u (m + n)))" - unfolding isoton_def by (simp add: borel_measurable_INF) + have "positive_integral (\x. SUP n. INF m. u (m + n) x) + = (SUP n. positive_integral (\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]) also have "\ \ (SUP n. INF m. positive_integral (u (m + n)))" - apply (rule SUP_mono) - apply (rule_tac x=n in bexI) - by (auto intro!: positive_integral_mono INFI_bound INF_leI exI simp: INFI_fun_expand) + by (auto intro!: SUP_mono bexI le_INFI positive_integral_mono INF_leI) finally show ?thesis . qed @@ -1763,6 +1756,11 @@ thus ?P ?I by auto qed +lemma (in measure_space) integral_multc: + assumes "integrable f" + shows "integral (\x. f x * c) = integral f * c" + unfolding mult_commute[of _ c] integral_cmult[OF assms] .. + lemma (in measure_space) integral_mono_AE: assumes fg: "integrable f" "integrable g" and mono: "AE t. f t \ g t" @@ -1950,10 +1948,10 @@ have borel_f: "\i. (\x. Real (f i x)) \ borel_measurable M" using i unfolding integrable_def by auto - hence "(SUP i. (\x. Real (f i x))) \ borel_measurable M" + hence "(\x. SUP i. Real (f i x)) \ borel_measurable M" by auto hence borel_u: "u \ borel_measurable M" - using pos_u by (auto simp: borel_measurable_Real_eq SUPR_fun_expand SUP_F) + 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))" using i unfolding integral_def integrable_def by (auto simp: Real_real) @@ -2134,8 +2132,8 @@ 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 (SUP n. INF m. (\x. Real (?diff (m + n) x)))" - proof (rule positive_integral_cong, unfold SUPR_fun_expand INFI_fun_expand, subst add_commute) + have "positive_integral (\x. Real (2 * w x)) = positive_integral (\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))" proof (rule LIMSEQ_imp_lim_INF[symmetric]) diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Thu Dec 09 10:22:17 2010 +0100 @@ -552,10 +552,10 @@ proof - from positive_integral_isoton[unfolded isoton_fun_expand isoton_iff_Lim_mono, of f u] show ?ilim using mono lim i by auto - have "(SUP i. f i) = u" using mono lim SUP_Lim_pextreal - unfolding fun_eq_iff SUPR_fun_expand mono_def by auto - moreover have "(SUP i. f i) \ borel_measurable M" - using i by (rule borel_measurable_SUP) + have "\x. (SUP i. f i x) = u x" using mono lim SUP_Lim_pextreal + unfolding fun_eq_iff mono_def by auto + moreover have "(\x. SUP i. f i x) \ borel_measurable M" + using i by auto ultimately show "u \ borel_measurable M" by simp qed @@ -647,44 +647,20 @@ definition p2e :: "(nat \ real) \ 'a::ordered_euclidean_space" where "p2e x = (\\ i. x i)" -lemma bij_euclidean_component: - "bij_betw (e2p::'a::ordered_euclidean_space \ _) (UNIV :: 'a set) - ({..\<^isub>E (UNIV :: real set))" - unfolding bij_betw_def e2p_def_raw -proof let ?e = "\x.\i\{.. real" assume x:"\i. i \ {.. x i = undefined" - hence "x = ?e (\\ i. x i)" apply-apply(rule,case_tac "xa range ?e" by fastsimp - } thus "range ?e = ({.. UNIV) \ extensional {.. extensional {.. e2p (p2e x::'a::ordered_euclidean_space) = x" + by (auto simp: fun_eq_iff extensional_def p2e_def e2p_def) -lemma bij_p2e: - "bij_betw (p2e::_ \ 'a::ordered_euclidean_space) ({..\<^isub>E (UNIV :: real set)) - (UNIV :: 'a set)" (is "bij_betw ?p ?U _") - unfolding bij_betw_def -proof show "inj_on ?p ?U" unfolding inj_on_def p2e_def - apply(subst euclidean_eq) apply(safe,rule) unfolding extensional_def - apply(case_tac "xa ?p ` extensional {.. extensional {..\<^isub>E UNIV) (UNIV :: 'a::ordered_euclidean_space set) + p2e e2p" (is "bij_inv ?P ?U _ _") +proof (rule bij_invI) + show "p2e \ ?P \ ?U" "e2p \ ?U \ ?P" by (auto simp: e2p_def) +qed auto interpretation borel_product: product_sigma_finite "\x. borel::real algebra" "\x. lmeasure" by default @@ -692,71 +668,80 @@ lemma cube_subset_Suc[intro]: "cube n \ cube (Suc n)" unfolding cube_def_raw subset_eq apply safe unfolding mem_interval by auto -lemma borel_vimage_algebra_eq: - "sigma_algebra.vimage_algebra - (borel :: ('a::ordered_euclidean_space) algebra) ({..\<^isub>E UNIV) p2e = - sigma (product_algebra (\x. \ space = UNIV::real set, sets = range (\a. {..) {.. "product_algebra (\x. \ space = UNIV::real set, sets = range (\a. {..) {.. "\space = (UNIV::'a set), sets = range lessThan\" - have *:"(({.. UNIV) \ extensional {.. Pow (space E)" "p2e \ space F \ space E" unfolding E_def by auto - next fix A assume "A \ sets F" - hence A:"A \ (Pi\<^isub>E {.. range lessThan)" - unfolding F_def product_algebra_def algebra.simps . - then guess B unfolding image_iff .. note B=this - hence "\x range lessThan" by auto - hence "\x. \xa. x B x = {..i Pi I X \ (\i\I. f i \ X i)" + unfolding Pi_def by auto - show "A \ (\X. p2e -` X \ space F) ` sets E" unfolding image_iff B - proof(rule_tac x="{..< \\ i. Sup (B i)}" in bexI) - show "Pi\<^isub>E {..\ i. Sup (B i))::'a} \ space F" - unfolding F_def E_def product_algebra_def algebra.simps - proof(rule,unfold subset_eq,rule_tac[!] ballI) - fix x assume "x \ Pi\<^isub>E {..ii\DIM('a). x i = undefined" - unfolding Pi_def extensional_def using b by auto - have "(p2e x::'a) < (\\ i. Sup (B i))" unfolding less_prod_def eucl_less[of "p2e x"] - apply safe unfolding euclidean_lambda_beta b'[rule_format] p2e_def using * by auto - moreover have "x \ extensional {.. p2e -` {..<(\\ i. Sup (B i)) ::'a} \ - (({.. UNIV) \ extensional {.. p2e -` {..<(\\ i. Sup (B i))::'a} \ - (({.. UNIV) \ extensional {..\ i. Sup (B i))::'a)" by auto - hence "\i B i" apply-apply(subst(asm) eucl_less) - unfolding p2e_def using b b' by auto - thus "x \ Pi\<^isub>E {..\ i. Sup (B i))::'a} \ sets E" unfolding E_def algebra.simps by auto - qed - next fix A assume "A \ sets E" - then guess a unfolding E_def algebra.simps image_iff .. note a = this(2) - def B \ "\i. {.. space F \ sets F" unfolding F_def - unfolding product_algebra_def algebra.simps image_iff - apply(rule_tac x=B in bexI) apply rule unfolding subset_eq apply(rule_tac[1-2] ballI) - proof- show "B \ {.. range lessThan" unfolding B_def by auto - fix x assume as:"x \ p2e -` A \ (({.. UNIV) \ extensional {.. A" by auto - hence "\i B i" unfolding B_def a lessThan_iff - apply-apply(subst (asm) eucl_less) unfolding p2e_def by auto - thus "x \ Pi\<^isub>E {.. Pi\<^isub>E {.. A" unfolding a lessThan_iff p2e_def apply(subst eucl_less) - using x unfolding Pi_def extensional_def B_def by auto - ultimately show "x \ p2e -` A \ (({.. UNIV) \ extensional {.. measurable \ space = UNIV::'a set, sets = range lessThan \ + (product_algebra + (\x. \ space = UNIV::real set, sets = range lessThan \) + {.. measurable ?E ?P") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "e2p \ space ?E \ space ?P" by (auto simp: e2p_def) + fix A assume "A \ sets ?P" + then obtain E where A: "A = (\\<^isub>E i\{.. {.. (range lessThan)" + by (auto elim!: product_algebraE) + then have "\i\{..xs. E i = {..< xs}" by auto + from this[THEN bchoice] guess xs .. + then have A_eq: "A = (\\<^isub>E i\{..\ i. xs i) :: 'a}" + using DIM_positive by (auto simp add: Pi_iff set_eq_iff e2p_def A_eq + euclidean_eq[where 'a='a] eucl_less[where 'a='a]) + then show "e2p -` A \ space ?E \ sets ?E" by simp qed +lemma measurable_p2e_on_generator: + "p2e \ measurable + (product_algebra + (\x. \ space = UNIV::real set, sets = range lessThan \) + {.. space = UNIV::'a set, sets = range lessThan \" + (is "p2e \ measurable ?P ?E") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "p2e \ space ?P \ space ?E" by simp + fix A assume "A \ sets ?E" + then obtain x where "A = {.. space ?P = (\\<^isub>E i\{.. Pow (space F)" "sets ?E \ Pow (space ?E)" unfolding F_def + by (intro product_algebra_sets_into_space) auto + show "p2e \ measurable F ?E" + "e2p \ measurable ?E F" + unfolding F_def using measurable_p2e_on_generator measurable_e2p_on_generator by auto +qed + +lemma product_borel_eq_vimage: + "sigma (product_algebra (\x. borel) {.. 'a::ordered_euclidean_space)" + unfolding borel_vimage_algebra_eq[simplified] + unfolding borel_eq_lessThan + apply(subst sigma_product_algebra_sigma_eq[where S="\i. \n. lessThan (real n)"]) + unfolding lessThan_iff +proof- fix i assume i:"in. {.. space \space = UNIV, sets = range lessThan\" + by(auto intro!:real_arch_lt isotoneI) +qed auto + lemma e2p_Int:"e2p ` A \ e2p ` B = e2p ` (A \ B)" (is "?L = ?R") - apply(rule image_Int[THEN sym]) using bij_euclidean_component + apply(rule image_Int[THEN sym]) + using bij_inv_p2e_e2p[THEN bij_inv_bij_betw(2)] unfolding bij_betw_def by auto lemma Int_stable_cuboids: fixes x::"'a::ordered_euclidean_space" @@ -775,18 +760,6 @@ unfolding Int_stable_def algebra.select_convs apply safe unfolding inter_interval by auto -lemma product_borel_eq_vimage: - "sigma (product_algebra (\x. borel) {.. UNIV) \ extensional {.. 'a::ordered_euclidean_space)" - unfolding borel_vimage_algebra_eq unfolding borel_eq_lessThan - apply(subst sigma_product_algebra_sigma_eq[where S="\i. \n. lessThan (real n)"]) - unfolding lessThan_iff -proof- fix i assume i:"in. {.. space \space = UNIV, sets = range lessThan\" - by(auto intro!:real_arch_lt isotoneI) -qed auto - lemma inj_on_disjoint_family_on: assumes "disjoint_family_on A S" "inj f" shows "disjoint_family_on (\x. f ` A x) S" unfolding disjoint_family_on_def @@ -808,12 +781,12 @@ unfolding e2p_def by auto lemma e2p_image_vimage: fixes A::"'a::ordered_euclidean_space set" - shows "e2p ` A = p2e -` A \ (({.. UNIV) \ extensional {.. extensional {.. e2p ` A" then guess y unfolding image_iff .. note y=this - show "x \ p2e -` A \ (({.. UNIV) \ extensional {.. p2e -` A \ extensional {.. p2e -` A \ (({.. UNIV) \ extensional {.. p2e -` A \ extensional {.. e2p ` A" unfolding image_iff apply(rule_tac x="p2e x" in bexI) apply(subst e2p_p2e) by auto qed @@ -879,17 +852,15 @@ qed show "disjoint_family (\n. e2p ` A n)" apply(rule inj_on_disjoint_family_on) - using bij_euclidean_component using A(2) unfolding bij_betw_def by auto + using bij_inv_p2e_e2p[THEN bij_inv_bij_betw(2)] using A(2) unfolding bij_betw_def by auto show "(\n. e2p ` A n) \ sets (sigma (product_algebra (\x. borel) {.. (\n. e2p ` A n)" hence "p2e x \ (\i. A i)" by auto moreover have "x \ extensional {.. p2e -` (\i. A i) \ (({.. UNIV) \ - extensional {.. p2e -` (\i. A i) \ (({.. UNIV) \ - extensional {.. p2e -` (\i. A i) \ extensional {.. p2e -` (\i. A i) \ extensional {.. (\i. A i)" by auto hence "\n. x \ e2p ` A n" apply safe apply(rule_tac x=i in exI) unfolding image_iff apply(rule_tac x="p2e x" in bexI) @@ -925,23 +896,20 @@ assumes f: "f \ borel_measurable borel" shows "borel.positive_integral f = borel_product.product_positive_integral {.. p2e)" -proof- def U \ "(({.. UNIV) \ extensional {.. real) set" +proof- def U \ "extensional {.. real) set" interpret fprod: finite_product_sigma_finite "\x. borel" "\x. lmeasure" "{..x. \i::nat. x < real i" by (metis real_arch_lt) - hence "(\n::nat. {.. UNIV" apply-apply(rule isotoneI) by auto - hence *:"sigma_algebra.vimage_algebra borel U (p2e:: _ \ 'a) + have *:"sigma_algebra.vimage_algebra borel U (p2e:: _ \ 'a) = sigma (product_algebra (\x. borel) {..A. lmeasure (p2e ` A)"]) unfolding U_def[symmetric] *[THEN sym] o_def proof- fix A assume A:"A \ sets (sigma_algebra.vimage_algebra borel U (p2e ::_ \ 'a))" hence *:"A \ extensional {.. sets borel" unfolding B apply(subst Int_left_commute) - apply(subst Int_absorb1) unfolding p2e_inv_extensional[of B,THEN sym] using B(1) by auto + from A guess B unfolding borel.in_vimage_algebra U_def .. + then have "(p2e ` A::'a set) \ sets borel" + by (simp add: p2e_inv_extensional[of B, symmetric]) from lmeasure_measure_eq_borel_prod[OF this] show "lmeasure (p2e ` A::'a set) = finite_product_sigma_finite.measure (\x. borel) (\x. lmeasure) {..x\) = 0" + by simp + lemma pextreal_plus_eq_\[simp]: "(a :: pextreal) + b = \ \ a = \ \ b = \" by (cases a, cases b) auto diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Probability_Space.thy --- a/src/HOL/Probability/Probability_Space.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Probability_Space.thy Thu Dec 09 10:22:17 2010 +0100 @@ -352,7 +352,7 @@ show "sigma_algebra (sigma (pair_algebra MX MY))" by default have sa: "sigma_algebra M" by default show "(\x. (X x, Y x)) \ measurable M (sigma (pair_algebra MX MY))" - unfolding P.measurable_pair[OF sa] using assms by (simp add: comp_def) + unfolding P.measurable_pair_iff[OF sa] using assms by (simp add: comp_def) qed lemma (in prob_space) distribution_order: @@ -410,8 +410,9 @@ assume A: "range A \ sets XY.P" and df: "disjoint_family A" have "(\\<^isub>\n. \ (?X (A n))) = \ (\x. ?X (A x))" proof (intro measure_countably_additive) - from assms have *: "(\x. (X x, Y x)) \ measurable M XY.P" - by (intro XY.measurable_prod_sigma) (simp_all add: comp_def, default) + have "sigma_algebra M" by default + then have *: "(\x. (X x, Y x)) \ measurable M XY.P" + using assms by (simp add: XY.measurable_pair comp_def) show "range (\n. ?X (A n)) \ events" using measurable_sets[OF *] A by auto show "disjoint_family (\n. ?X (A n))" @@ -503,7 +504,7 @@ show "finite_sigma_algebra (sigma (pair_algebra MX MY))" by default have sa: "sigma_algebra M" by default show "(\x. (X x, Y x)) \ measurable M (sigma (pair_algebra MX MY))" - unfolding P.measurable_pair[OF sa] using assms by (simp add: comp_def) + unfolding P.measurable_pair_iff[OF sa] using assms by (simp add: comp_def) qed lemma (in prob_space) finite_random_variable_imp_sets: @@ -640,7 +641,7 @@ proof fix x assume "x \ space XY.P" moreover have "(\x. (X x, Y x)) \ measurable M XY.P" - using X Y by (subst XY.measurable_pair) (simp_all add: o_def, default) + using X Y by (intro XY.measurable_pair) (simp_all add: o_def, default) ultimately have "(\x. (X x, Y x)) -` {x} \ space M \ sets M" unfolding measurable_def by simp then show "joint_distribution X Y {x} \ \" @@ -1068,13 +1069,13 @@ show "\g\borel_measurable M'. \x\space M. Z x = g (Y x)" proof (intro ballI bexI) - show "(SUP i. g i) \ borel_measurable M'" + show "(\x. SUP i. g i x) \ borel_measurable M'" using g by (auto intro: M'.borel_measurable_simple_function) fix x assume "x \ space M" have "Z x = (SUP i. f i) x" using `f \ Z` unfolding isoton_def by simp - also have "\ = (SUP i. g i) (Y x)" unfolding SUPR_fun_expand + also have "\ = (SUP i. g i (Y x))" unfolding SUPR_apply using g `x \ space M` by simp - finally show "Z x = (SUP i. g i) (Y x)" . + finally show "Z x = (SUP i. g i (Y x))" . qed qed diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Product_Measure.thy --- a/src/HOL/Probability/Product_Measure.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Product_Measure.thy Thu Dec 09 10:22:17 2010 +0100 @@ -92,6 +92,12 @@ shows "a \ extensional (insert i I)" using assms unfolding extensional_def by auto +lemma merge_singleton[simp]: "i \ I \ merge I x {i} y = restrict (x(i := y i)) (insert i I)" + unfolding merge_def by (auto simp: fun_eq_iff) + +lemma Pi_Int: "Pi I E \ Pi I F = (\ i\I. E i \ F i)" + by auto + lemma PiE_Int: "(Pi\<^isub>E I A) \ (Pi\<^isub>E I B) = Pi\<^isub>E I (\x. A x \ B x)" by auto @@ -107,6 +113,64 @@ lemma Pi_cancel_fupd[simp]: "i \ I \ x(i := a) \ Pi I B \ x \ Pi I B" by (auto simp: Pi_def) +lemma restrict_vimage: + assumes "I \ J = {}" + shows "(\x. (restrict x I, restrict x J)) -` (Pi\<^isub>E I E \ Pi\<^isub>E J F) = Pi (I \ J) (merge I E J F)" + using assms by (auto simp: restrict_Pi_cancel) + +lemma merge_vimage: + assumes "I \ J = {}" + shows "(\(x,y). merge I x J y) -` Pi\<^isub>E (I \ J) E = Pi I E \ Pi J E" + using assms by (auto simp: restrict_Pi_cancel) + +lemma restrict_fupd[simp]: "i \ I \ restrict (f (i := x)) I = restrict f I" + by (auto simp: restrict_def intro!: ext) + +lemma merge_restrict[simp]: + "merge I (restrict x I) J y = merge I x J y" + "merge I x J (restrict y J) = merge I x J y" + unfolding merge_def by (auto intro!: ext) + +lemma merge_x_x_eq_restrict[simp]: + "merge I x J x = restrict x (I \ J)" + unfolding merge_def by (auto intro!: ext) + +lemma Pi_fupd_iff: "i \ I \ f \ Pi I (B(i := A)) \ f \ Pi (I - {i}) B \ f i \ A" + apply auto + apply (drule_tac x=x in Pi_mem) + apply (simp_all split: split_if_asm) + apply (drule_tac x=i in Pi_mem) + apply (auto dest!: Pi_mem) + done + +lemma Pi_UN: + fixes A :: "nat \ 'i \ 'a set" + assumes "finite I" and mono: "\i n m. i \ I \ n \ m \ A n i \ A m i" + shows "(\n. Pi I (A n)) = (\ i\I. \n. A n i)" +proof (intro set_eqI iffI) + fix f assume "f \ (\ i\I. \n. A n i)" + then have "\i\I. \n. f i \ A n i" by auto + from bchoice[OF this] obtain n where n: "\i. i \ I \ f i \ (A (n i) i)" by auto + obtain k where k: "\i. i \ I \ n i \ k" + using `finite I` finite_nat_set_iff_bounded_le[of "n`I"] by auto + have "f \ Pi I (A k)" + proof (intro Pi_I) + fix i assume "i \ I" + from mono[OF this, of "n i" k] k[OF this] n[OF this] + show "f i \ A k i" by auto + qed + then show "f \ (\n. Pi I (A n))" by auto +qed auto + +lemma PiE_cong: + assumes "\i. i\I \ A i = B i" + shows "Pi\<^isub>E I A = Pi\<^isub>E I B" + using assms by (auto intro!: Pi_cong) + +lemma restrict_upd[simp]: + "i \ I \ (restrict f I)(i := y) = restrict (f(i := y)) (insert i I)" + by (auto simp: fun_eq_iff) + section "Binary products" definition @@ -134,6 +198,14 @@ "space (pair_algebra A B) = space A \ space B" by (simp add: pair_algebra_def) +lemma sets_pair_algebra: "sets (pair_algebra N M) = (\(x, y). x \ y) ` (sets N \ sets M)" + unfolding pair_algebra_def by auto + +lemma pair_algebra_sets_into_space: + assumes "sets M \ Pow (space M)" "sets N \ Pow (space N)" + shows "sets (pair_algebra M N) \ Pow (space (pair_algebra M N))" + using assms by (auto simp: pair_algebra_def) + lemma pair_algebra_Int_snd: assumes "sets S1 \ Pow (space S1)" shows "pair_algebra S1 (algebra.restricted_space S2 A) = @@ -176,7 +248,7 @@ then show ?fst ?snd by auto qed -lemma (in pair_sigma_algebra) measurable_pair: +lemma (in pair_sigma_algebra) measurable_pair_iff: assumes "sigma_algebra M" shows "f \ measurable M P \ (fst \ f) \ measurable M M1 \ (snd \ f) \ measurable M M2" @@ -205,42 +277,11 @@ qed qed -lemma (in pair_sigma_algebra) measurable_prod_sigma: +lemma (in pair_sigma_algebra) measurable_pair: assumes "sigma_algebra M" - assumes 1: "(fst \ f) \ measurable M M1" and 2: "(snd \ f) \ measurable M M2" + assumes "(fst \ f) \ measurable M M1" "(snd \ f) \ measurable M M2" shows "f \ measurable M P" -proof - - interpret M: sigma_algebra M by fact - from 1 have fn1: "fst \ f \ space M \ space M1" - and q1: "\y\sets M1. (fst \ f) -` y \ space M \ sets M" - by (auto simp add: measurable_def) - from 2 have fn2: "snd \ f \ space M \ space M2" - and q2: "\y\sets M2. (snd \ f) -` y \ space M \ sets M" - by (auto simp add: measurable_def) - show ?thesis - proof (rule M.measurable_sigma) - show "sets E \ Pow (space E)" - using M1.space_closed M2.space_closed - by (auto simp add: sigma_algebra_iff pair_algebra_def) - next - show "f \ space M \ space E" - by (simp add: space_pair_algebra) (rule prod_final [OF fn1 fn2]) - next - fix z - assume z: "z \ sets E" - thus "f -` z \ space M \ sets M" - proof (auto simp add: pair_algebra_def vimage_Times) - fix x y - assume x: "x \ sets M1" and y: "y \ sets M2" - have "(fst \ f) -` x \ (snd \ f) -` y \ space M = - ((fst \ f) -` x \ space M) \ ((snd \ f) -` y \ space M)" - by blast - also have "... \ sets M" using x y q1 q2 - by blast - finally show "(fst \ f) -` x \ (snd \ f) -` y \ space M \ sets M" . - qed - qed -qed + unfolding measurable_pair_iff[OF assms(1)] using assms(2,3) by simp lemma pair_algebraE: assumes "X \ sets (pair_algebra M1 M2)" @@ -726,11 +767,11 @@ then have F_borel: "\i. F i \ borel_measurable P" and F_mono: "\i x. F i x \ F (Suc i) x" and F_SUPR: "\x. (SUP i. F i x) = f x" - unfolding isoton_def le_fun_def SUPR_fun_expand + unfolding isoton_fun_expand unfolding isoton_def le_fun_def by (auto intro: borel_measurable_simple_function) note sf = simple_function_cut[OF F(1)] - then have "(SUP i. ?C (F i)) \ borel_measurable M1" - using F(1) by (auto intro!: M1.borel_measurable_SUP) + then have "(\x. SUP i. ?C (F i) x) \ borel_measurable M1" + using F(1) by auto moreover { fix x assume "x \ space M1" have isotone: "(\ i y. F i (x, y)) \ (\y. f (x, y))" @@ -742,7 +783,7 @@ by (simp add: isoton_def) } note SUPR_C = this ultimately show "?C f \ borel_measurable M1" - unfolding SUPR_fun_expand by (simp cong: measurable_cong) + by (simp cong: measurable_cong) 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]) @@ -1003,10 +1044,25 @@ sublocale finite_product_sigma_algebra \ sigma_algebra P using product_algebra_into_space by (rule sigma_algebra_sigma) +lemma product_algebraE: + assumes "A \ sets (product_algebra M I)" + obtains E where "A = Pi\<^isub>E I E" "E \ (\ i\I. sets (M i))" + using assms unfolding product_algebra_def by auto + +lemma product_algebraI[intro]: + assumes "E \ (\ i\I. sets (M i))" + shows "Pi\<^isub>E I E \ sets (product_algebra M I)" + using assms unfolding product_algebra_def by auto + lemma space_product_algebra[simp]: "space (product_algebra M I) = Pi\<^isub>E I (\i. space (M i))" unfolding product_algebra_def by simp +lemma product_algebra_sets_into_space: + assumes "\i. i\I \ sets (M i) \ Pow (space (M i))" + shows "sets (product_algebra M I) \ Pow (space (product_algebra M I))" + using assms by (auto simp: product_algebra_def) blast + lemma (in finite_product_sigma_algebra) P_empty: "I = {} \ P = \ space = {\k. undefined}, sets = { {}, {\k. undefined} }\" unfolding product_algebra_def by (simp add: sigma_def image_constant) @@ -1015,34 +1071,122 @@ "\ \i. i \ I \ A i \ sets (M i) \ \ Pi\<^isub>E I A \ sets P" by (auto simp: product_algebra_def sets_sigma intro!: sigma_sets.Basic) -lemma bij_betw_prod_fold: - assumes "i \ I" - shows "bij_betw (\x. (x(i:=undefined), x i)) (\\<^isub>E j\insert i I. space (M j)) ((\\<^isub>E j\I. space (M j)) \ space (M i))" - (is "bij_betw ?f ?P ?F") - using `i \ I` -proof (unfold bij_betw_def, intro conjI set_eqI iffI) - show "inj_on ?f ?P" - proof (safe intro!: inj_onI ext) - fix a b x assume "a(i:=undefined) = b(i:=undefined)" "a i = b i" - then show "a x = b x" - by (cases "x = i") (auto simp: fun_eq_iff split: split_if_asm) +lemma (in product_sigma_algebra) bij_inv_restrict_merge: + assumes [simp]: "I \ J = {}" + shows "bij_inv + (space (sigma (product_algebra M (I \ J)))) + (space (sigma (pair_algebra (product_algebra M I) (product_algebra M J)))) + (\x. (restrict x I, restrict x J)) (\(x, y). merge I x J y)" + by (rule bij_invI) (auto simp: space_pair_algebra extensional_restrict) + +lemma (in product_sigma_algebra) bij_inv_singleton: + "bij_inv (space (sigma (product_algebra M {i}))) (space (M i)) + (\x. x i) (\x. (\j\{i}. x))" + by (rule bij_invI) (auto simp: restrict_def extensional_def fun_eq_iff) + +lemma (in product_sigma_algebra) bij_inv_restrict_insert: + assumes [simp]: "i \ I" + shows "bij_inv + (space (sigma (product_algebra M (insert i I)))) + (space (sigma (pair_algebra (product_algebra M I) (M i)))) + (\x. (restrict x I, x i)) (\(x, y). x(i := y))" + by (rule bij_invI) (auto simp: space_pair_algebra extensional_restrict) + +lemma (in product_sigma_algebra) measurable_restrict_on_generating: + assumes [simp]: "I \ J = {}" + shows "(\x. (restrict x I, restrict x J)) \ measurable + (product_algebra M (I \ J)) + (pair_algebra (product_algebra M I) (product_algebra M J))" + (is "?R \ measurable ?IJ ?P") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "?R \ space ?IJ \ space ?P" by (auto simp: space_pair_algebra) + { fix F E assume "E \ (\ i\I. sets (M i))" "F \ (\ i\J. sets (M i))" + then have "Pi (I \ J) (merge I E J F) \ (\\<^isub>E i\I \ J. space (M i)) = + Pi\<^isub>E (I \ J) (merge I E J F)" + using M.sets_into_space by auto blast+ } + note this[simp] + show "\A. A \ sets ?P \ ?R -` A \ space ?IJ \ sets ?IJ" + by (force elim!: pair_algebraE product_algebraE + simp del: vimage_Int simp: restrict_vimage merge_vimage space_pair_algebra) + qed + +lemma (in product_sigma_algebra) measurable_merge_on_generating: + assumes [simp]: "I \ J = {}" + shows "(\(x, y). merge I x J y) \ measurable + (pair_algebra (product_algebra M I) (product_algebra M J)) + (product_algebra M (I \ J))" + (is "?M \ measurable ?P ?IJ") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "?M \ space ?P \ space ?IJ" by (auto simp: space_pair_algebra) + { fix E assume "E \ (\ i\I. sets (M i))" "E \ (\ i\J. sets (M i))" + then have "Pi I E \ Pi J E \ (\\<^isub>E i\I. space (M i)) \ (\\<^isub>E i\J. space (M i)) = + Pi\<^isub>E I E \ Pi\<^isub>E J E" + using M.sets_into_space by auto blast+ } + note this[simp] + show "\A. A \ sets ?IJ \ ?M -` A \ space ?P \ sets ?P" + by (force elim!: pair_algebraE product_algebraE + simp del: vimage_Int simp: restrict_vimage merge_vimage space_pair_algebra) qed -next - fix X assume *: "X \ ?F" show "X \ ?f ` ?P" - proof (cases X) - case (Pair a b) with * `i \ I` show ?thesis - by (auto intro!: image_eqI[where x="a (i := b)"] ext simp: extensional_def) - qed -qed auto + +lemma (in product_sigma_algebra) measurable_singleton_on_generator: + "(\x. \j\{i}. x) \ measurable (M i) (product_algebra M {i})" + (is "?f \ measurable _ ?P") +proof (unfold measurable_def, intro CollectI conjI) + show "?f \ space (M i) \ space ?P" by auto + have "\E. E i \ sets (M i) \ ?f -` Pi\<^isub>E {i} E \ space (M i) = E i" + using M.sets_into_space by auto + then show "\A \ sets ?P. ?f -` A \ space (M i) \ sets (M i)" + by (auto elim!: product_algebraE) +qed + +lemma (in product_sigma_algebra) measurable_component_on_generator: + assumes "i \ I" shows "(\x. x i) \ measurable (product_algebra M I) (M i)" + (is "?f \ measurable ?P _") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "?f \ space ?P \ space (M i)" using `i \ I` by auto + fix A assume "A \ sets (M i)" + moreover then have "(\x. x i) -` A \ (\\<^isub>E i\I. space (M i)) = + (\\<^isub>E j\I. if i = j then A else space (M j))" + using M.sets_into_space `i \ I` + by (fastsimp dest: Pi_mem split: split_if_asm) + ultimately show "?f -` A \ space ?P \ sets ?P" + by (auto intro!: product_algebraI) +qed -lemma borel_measurable_product_component: - assumes "i \ I" - shows "(\x. x i) \ borel_measurable (sigma (product_algebra (\x. borel) I))" -proof - - have *: "\A. (\x. x i) -` A \ extensional I = (\\<^isub>E j\I. if j = i then A else UNIV)" - using `i \ I` by (auto elim!: PiE) - show ?thesis - by (auto simp: * measurable_def product_algebra_def) +lemma (in product_sigma_algebra) measurable_restrict_singleton_on_generating: + assumes [simp]: "i \ I" + shows "(\x. (restrict x I, x i)) \ measurable + (product_algebra M (insert i I)) + (pair_algebra (product_algebra M I) (M i))" + (is "?R \ measurable ?I ?P") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "?R \ space ?I \ space ?P" by (auto simp: space_pair_algebra) + { fix E F assume "E \ (\ i\I. sets (M i))" "F \ sets (M i)" + then have "(\x. (restrict x I, x i)) -` (Pi\<^isub>E I E \ F) \ (\\<^isub>E i\insert i I. space (M i)) = + Pi\<^isub>E (insert i I) (E(i := F))" + using M.sets_into_space using `i\I` by (auto simp: restrict_Pi_cancel) blast+ } + note this[simp] + show "\A. A \ sets ?P \ ?R -` A \ space ?I \ sets ?I" + by (force elim!: pair_algebraE product_algebraE + simp del: vimage_Int simp: space_pair_algebra) +qed + +lemma (in product_sigma_algebra) measurable_merge_singleton_on_generating: + assumes [simp]: "i \ I" + shows "(\(x, y). x(i := y)) \ measurable + (pair_algebra (product_algebra M I) (M i)) + (product_algebra M (insert i I))" + (is "?M \ measurable ?P ?IJ") +proof (unfold measurable_def, intro CollectI conjI ballI) + show "?M \ space ?P \ space ?IJ" by (auto simp: space_pair_algebra) + { fix E assume "E \ (\ i\I. sets (M i))" "E i \ sets (M i)" + then have "(\(x, y). x(i := y)) -` Pi\<^isub>E (insert i I) E \ (\\<^isub>E i\I. space (M i)) \ space (M i) = + Pi\<^isub>E I E \ E i" + using M.sets_into_space by auto blast+ } + note this[simp] + show "\A. A \ sets ?IJ \ ?M -` A \ space ?P \ sets ?P" + by (force elim!: pair_algebraE product_algebraE + simp del: vimage_Int simp: space_pair_algebra) qed section "Generating set generates also product algebra" @@ -1108,38 +1252,6 @@ by (simp add: pair_algebra_def sigma_def) qed -lemma Pi_fupd_iff: "i \ I \ f \ Pi I (B(i := A)) \ f \ Pi (I - {i}) B \ f i \ A" - apply auto - apply (drule_tac x=x in Pi_mem) - apply (simp_all split: split_if_asm) - apply (drule_tac x=i in Pi_mem) - apply (auto dest!: Pi_mem) - done - -lemma Pi_UN: - fixes A :: "nat \ 'i \ 'a set" - assumes "finite I" and mono: "\i n m. i \ I \ n \ m \ A n i \ A m i" - shows "(\n. Pi I (A n)) = (\ i\I. \n. A n i)" -proof (intro set_eqI iffI) - fix f assume "f \ (\ i\I. \n. A n i)" - then have "\i\I. \n. f i \ A n i" by auto - from bchoice[OF this] obtain n where n: "\i. i \ I \ f i \ (A (n i) i)" by auto - obtain k where k: "\i. i \ I \ n i \ k" - using `finite I` finite_nat_set_iff_bounded_le[of "n`I"] by auto - have "f \ Pi I (A k)" - proof (intro Pi_I) - fix i assume "i \ I" - from mono[OF this, of "n i" k] k[OF this] n[OF this] - show "f i \ A k i" by auto - qed - then show "f \ (\n. Pi I (A n))" by auto -qed auto - -lemma PiE_cong: - assumes "\i. i\I \ A i = B i" - shows "Pi\<^isub>E I A = Pi\<^isub>E I B" - using assms by (auto intro!: Pi_cong) - lemma sigma_product_algebra_sigma_eq: assumes "finite I" assumes isotone: "\i. i \ I \ (S i) \ (space (E i))" @@ -1209,150 +1321,163 @@ by (simp add: product_algebra_def sigma_def) qed -lemma (in finite_product_sigma_algebra) pair_sigma_algebra_finite_product_space: - "sigma (pair_algebra P (M i)) = sigma (pair_algebra G (M i))" -proof - - have "sigma (pair_algebra P (M i)) = sigma (pair_algebra P (sigma (M i)))" by simp - also have "\ = sigma (pair_algebra G (M i))" - proof (rule pair_sigma_algebra_sigma) - show "(\_. \\<^isub>E i\I. space (M i)) \ space G" - "(\_. space (M i)) \ space (M i)" - by (simp_all add: isoton_const) - show "range (\_. \\<^isub>E i\I. space (M i)) \ sets G" "range (\_. space (M i)) \ sets (M i)" - by (auto intro!: image_eqI[where x="\i\I. space (M i)"] dest: Pi_mem - simp: product_algebra_def) - show "sets G \ Pow (space G)" "sets (M i) \ Pow (space (M i))" - using product_algebra_into_space M.sets_into_space by auto - qed - finally show ?thesis . -qed - -lemma sets_pair_algebra: "sets (pair_algebra N M) = (\(x, y). x \ y) ` (sets N \ sets M)" - unfolding pair_algebra_def by auto - -lemma (in finite_product_sigma_algebra) sigma_pair_algebra_sigma_eq: +lemma (in product_sigma_algebra) sigma_pair_algebra_sigma_eq: "sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))) = sigma (pair_algebra (product_algebra M I) (product_algebra M J))" using M.sets_into_space by (intro pair_sigma_algebra_sigma[of "\_. \\<^isub>E i\I. space (M i)", of _ "\_. \\<^isub>E i\J. space (M i)"]) (auto simp: isoton_const product_algebra_def, blast+) +lemma (in product_sigma_algebra) sigma_pair_algebra_product_singleton: + "sigma (pair_algebra (sigma (product_algebra M I)) (M i)) = + sigma (pair_algebra (product_algebra M I) (M i))" + using M.sets_into_space apply (subst M.sigma_eq[symmetric]) + by (intro pair_sigma_algebra_sigma[of "\_. \\<^isub>E i\I. space (M i)" _ "\_. space (M i)"]) + (auto simp: isoton_const product_algebra_def, blast+) + +lemma (in product_sigma_algebra) measurable_restrict: + assumes [simp]: "I \ J = {}" + shows "(\x. (restrict x I, restrict x J)) \ measurable + (sigma (product_algebra M (I \ J))) + (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))))" + unfolding sigma_pair_algebra_sigma_eq using M.sets_into_space + by (intro measurable_sigma_sigma measurable_restrict_on_generating + pair_algebra_sets_into_space product_algebra_sets_into_space) + auto + +lemma (in product_sigma_algebra) measurable_merge: + assumes [simp]: "I \ J = {}" + shows "(\(x, y). merge I x J y) \ measurable + (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J)))) + (sigma (product_algebra M (I \ J)))" + unfolding sigma_pair_algebra_sigma_eq using M.sets_into_space + by (intro measurable_sigma_sigma measurable_merge_on_generating + pair_algebra_sets_into_space product_algebra_sets_into_space) + auto + lemma (in product_sigma_algebra) product_product_vimage_algebra: - assumes [simp]: "I \ J = {}" and "finite I" "finite J" + assumes [simp]: "I \ J = {}" shows "sigma_algebra.vimage_algebra (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J)))) - (space (product_algebra M (I \ J))) (\x. ((\i\I. x i), (\i\J. x i))) = + (space (sigma (product_algebra M (I \ J)))) (\x. ((\i\I. x i), (\i\J. x i))) = sigma (product_algebra M (I \ J))" - (is "sigma_algebra.vimage_algebra _ (space ?IJ) ?f = sigma ?IJ") -proof - - have "finite (I \ J)" using assms by auto - interpret I: finite_product_sigma_algebra M I by default fact - interpret J: finite_product_sigma_algebra M J by default fact - interpret IJ: finite_product_sigma_algebra M "I \ J" by default fact - interpret pair_sigma_algebra I.P J.P by default + unfolding sigma_pair_algebra_sigma_eq using sets_into_space + by (intro vimage_algebra_sigma[OF bij_inv_restrict_merge] + pair_algebra_sets_into_space product_algebra_sets_into_space + measurable_merge_on_generating measurable_restrict_on_generating) + auto + +lemma (in product_sigma_algebra) pair_product_product_vimage_algebra: + assumes [simp]: "I \ J = {}" + shows "sigma_algebra.vimage_algebra (sigma (product_algebra M (I \ J))) + (space (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))))) (\(x,y). merge I x J y) = + (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))))" + unfolding sigma_pair_algebra_sigma_eq using sets_into_space + by (intro vimage_algebra_sigma[OF bij_inv_restrict_merge[symmetric]] + pair_algebra_sets_into_space product_algebra_sets_into_space + measurable_merge_on_generating measurable_restrict_on_generating) + auto + +lemma (in product_sigma_algebra) pair_product_singleton_vimage_algebra: + assumes [simp]: "i \ I" + shows "sigma_algebra.vimage_algebra (sigma (pair_algebra (sigma (product_algebra M I)) (M i))) + (space (sigma (product_algebra M (insert i I)))) (\x. (restrict x I, x i)) = + (sigma (product_algebra M (insert i I)))" + unfolding sigma_pair_algebra_product_singleton using sets_into_space + by (intro vimage_algebra_sigma[OF bij_inv_restrict_insert] + pair_algebra_sets_into_space product_algebra_sets_into_space + measurable_merge_singleton_on_generating measurable_restrict_singleton_on_generating) + auto - show "vimage_algebra (space ?IJ) ?f = sigma ?IJ" - unfolding I.sigma_pair_algebra_sigma_eq - proof (rule vimage_algebra_sigma) - from M.sets_into_space - show "sets (pair_algebra I.G J.G) \ Pow (space (pair_algebra I.G J.G))" - by (auto simp: sets_pair_algebra space_pair_algebra product_algebra_def) blast+ - show "?f \ space IJ.G \ space (pair_algebra I.G J.G)" - by (auto simp: space_pair_algebra product_algebra_def) - let ?F = "\A. ?f -` A \ (space IJ.G)" - let ?s = "\I. Pi\<^isub>E I ` (\ i\I. sets (M i))" - { fix A assume "A \ sets IJ.G" - then obtain F where A: "A = Pi\<^isub>E (I \ J) F" "F \ (\ i\I. sets (M i))" "F \ (\ i\J. sets (M i))" - by (auto simp: product_algebra_def) - show "A \ ?F ` sets (pair_algebra I.G J.G)" - using A M.sets_into_space - by (auto simp: restrict_Pi_cancel product_algebra_def - intro!: image_eqI[where x="Pi\<^isub>E I F \ Pi\<^isub>E J F"]) blast+ } - { fix A assume "A \ sets (pair_algebra I.G J.G)" - then obtain E F where A: "A = Pi\<^isub>E I E \ Pi\<^isub>E J F" "E \ (\ i\I. sets (M i))" "F \ (\ i\J. sets (M i))" - by (auto simp: product_algebra_def sets_pair_algebra) - then show "?F A \ sets IJ.G" - using A M.sets_into_space - by (auto simp: restrict_Pi_cancel product_algebra_def - intro!: image_eqI[where x="merge I E J F"]) blast+ } - qed -qed +lemma (in product_sigma_algebra) singleton_vimage_algebra: + "sigma_algebra.vimage_algebra (sigma (product_algebra M {i})) (space (M i)) (\x. \j\{i}. x) = M i" + using sets_into_space + by (intro vimage_algebra_sigma[of "M i", unfolded M.sigma_eq, OF bij_inv_singleton[symmetric]] + product_algebra_sets_into_space measurable_singleton_on_generator measurable_component_on_generator) + auto + +lemma (in product_sigma_algebra) measurable_restrict_iff: + assumes IJ[simp]: "I \ J = {}" + shows "f \ measurable (sigma (pair_algebra + (sigma (product_algebra M I)) (sigma (product_algebra M J)))) M' \ + (\x. f (restrict x I, restrict x J)) \ measurable (sigma (product_algebra M (I \ J))) M'" + using M.sets_into_space + apply (subst pair_product_product_vimage_algebra[OF IJ, symmetric]) + apply (subst sigma_pair_algebra_sigma_eq) + apply (subst sigma_algebra.measurable_vimage_iff_inv[OF _ + bij_inv_restrict_merge[symmetric]]) + apply (intro sigma_algebra_sigma product_algebra_sets_into_space) + by auto -lemma (in finite_product_sigma_algebra) sigma_pair_algebra_sigma_M_eq: - "sigma (pair_algebra P (M i)) = sigma (pair_algebra G (M i))" +lemma (in product_sigma_algebra) measurable_merge_iff: + assumes IJ: "I \ J = {}" + shows "f \ measurable (sigma (product_algebra M (I \ J))) M' \ + (\(x, y). f (merge I x J y)) \ + measurable (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J)))) M'" + unfolding measurable_restrict_iff[OF IJ] + by (rule measurable_cong) (auto intro!: arg_cong[where f=f] simp: extensional_restrict) + +lemma (in product_sigma_algebra) measurable_component: + assumes "i \ I" and f: "f \ measurable (M i) M'" + shows "(\x. f (x i)) \ measurable (sigma (product_algebra M I)) M'" + (is "?f \ measurable ?P M'") proof - - have "sigma (pair_algebra P (sigma (M i))) = sigma (pair_algebra G (M i))" - using M.sets_into_space - by (intro pair_sigma_algebra_sigma[of "\_. \\<^isub>E i\I. space (M i)", of _ "\_. space (M i)"]) - (auto simp: isoton_const product_algebra_def, blast+) - then show ?thesis by simp + have "f \ (\x. x i) \ measurable ?P M'" + apply (rule measurable_comp[OF _ f]) + using measurable_up_sigma[of "product_algebra M I" "M i"] + using measurable_component_on_generator[OF `i \ I`] + by auto + then show "?f \ measurable ?P M'" by (simp add: comp_def) qed -lemma (in product_sigma_algebra) product_singleton_vimage_algebra_eq: - assumes [simp]: "i \ I" "finite I" - shows "sigma_algebra.vimage_algebra - (sigma (pair_algebra (sigma (product_algebra M I)) (M i))) - (space (product_algebra M (insert i I))) (\x. ((\i\I. x i), x i)) = - sigma (product_algebra M (insert i I))" - (is "sigma_algebra.vimage_algebra _ (space ?I') ?f = sigma ?I'") -proof - - have "finite (insert i I)" using assms by auto - interpret I: finite_product_sigma_algebra M I by default fact - interpret I': finite_product_sigma_algebra M "insert i I" by default fact - interpret pair_sigma_algebra I.P "M i" by default - show "vimage_algebra (space ?I') ?f = sigma ?I'" - unfolding I.sigma_pair_algebra_sigma_M_eq - proof (rule vimage_algebra_sigma) - from M.sets_into_space - show "sets (pair_algebra I.G (M i)) \ Pow (space (pair_algebra I.G (M i)))" - by (auto simp: sets_pair_algebra space_pair_algebra product_algebra_def) blast - show "?f \ space I'.G \ space (pair_algebra I.G (M i))" - by (auto simp: space_pair_algebra product_algebra_def) - let ?F = "\A. ?f -` A \ (space I'.G)" - { fix A assume "A \ sets I'.G" - then obtain F where A: "A = Pi\<^isub>E (insert i I) F" "F \ (\ i\I. sets (M i))" "F i \ sets (M i)" - by (auto simp: product_algebra_def) - show "A \ ?F ` sets (pair_algebra I.G (M i))" - using A M.sets_into_space - by (auto simp: restrict_Pi_cancel product_algebra_def - intro!: image_eqI[where x="Pi\<^isub>E I F \ F i"]) blast+ } - { fix A assume "A \ sets (pair_algebra I.G (M i))" - then obtain E F where A: "A = Pi\<^isub>E I E \ F" "E \ (\ i\I. sets (M i))" "F \ sets (M i)" - by (auto simp: product_algebra_def sets_pair_algebra) - then show "?F A \ sets I'.G" - using A M.sets_into_space - by (auto simp: restrict_Pi_cancel product_algebra_def - intro!: image_eqI[where x="E(i:= F)"]) blast+ } +lemma (in product_sigma_algebra) measurable_component_singleton: + "(\x. f (x i)) \ measurable (sigma (product_algebra M {i})) M' \ + f \ measurable (M i) M'" + using sets_into_space + apply (subst singleton_vimage_algebra[symmetric]) + apply (subst sigma_algebra.measurable_vimage_iff_inv[OF _ bij_inv_singleton[symmetric]]) + by (auto intro!: sigma_algebra_sigma product_algebra_sets_into_space) + +lemma (in product_sigma_algebra) measurable_component_iff: + assumes "i \ I" and not_empty: "\i\I. space (M i) \ {}" + shows "(\x. f (x i)) \ measurable (sigma (product_algebra M I)) M' \ + f \ measurable (M i) M'" + (is "?f \ measurable ?P M' \ _") +proof + assume "f \ measurable (M i) M'" then show "?f \ measurable ?P M'" + by (rule measurable_component[OF `i \ I`]) +next + assume f: "?f \ measurable ?P M'" + def t \ "\i. SOME x. x \ space (M i)" + have t: "\i. i\I \ t i \ space (M i)" + unfolding t_def using not_empty by (rule_tac someI_ex) auto + have "?f \ (\x. (\j\I. if j = i then x else t j)) \ measurable (M i) M'" + (is "?f \ ?t \ measurable _ _") + proof (rule measurable_comp[OF _ f]) + have "?t \ measurable (M i) (product_algebra M I)" + proof (unfold measurable_def, intro CollectI conjI ballI) + from t show "?t \ space (M i) \ (space (product_algebra M I))" by auto + next + fix A assume A: "A \ sets (product_algebra M I)" + { fix E assume "E \ (\ i\I. sets (M i))" + then have "?t -` Pi\<^isub>E I E \ space (M i) = (if (\j\I-{i}. t j \ E j) then E i else {})" + using `i \ I` sets_into_space by (auto dest: Pi_mem[where B=E]) } + note * = this + with A `i \ I` show "?t -` A \ space (M i) \ sets (M i)" + by (auto elim!: product_algebraE simp del: vimage_Int) + qed + also have "\ \ measurable (M i) (sigma (product_algebra M I))" + using M.sets_into_space by (intro measurable_subset) (auto simp: product_algebra_def, blast) + finally show "?t \ measurable (M i) (sigma (product_algebra M I))" . qed + then show "f \ measurable (M i) M'" unfolding comp_def using `i \ I` by simp qed -lemma restrict_fupd[simp]: "i \ I \ restrict (f (i := x)) I = restrict f I" - by (auto simp: restrict_def intro!: ext) - -lemma bij_betw_restrict_I_i: - "i \ I \ bij_betw (\x. (restrict x I, x i)) - (space (product_algebra M (insert i I))) - (space (pair_algebra (sigma (product_algebra M I)) (M i)))" - by (intro bij_betwI[where g="(\(x,y). x(i:=y))"]) - (auto simp: space_pair_algebra extensional_def intro!: ext) - -lemma (in product_sigma_algebra) product_singleton_vimage_algebra_inv_eq: - assumes [simp]: "i \ I" "finite I" - shows "sigma_algebra.vimage_algebra - (sigma (product_algebra M (insert i I))) - (space (pair_algebra (sigma (product_algebra M I)) (M i))) (\(x,y). x(i:=y)) = - sigma (pair_algebra (sigma (product_algebra M I)) (M i))" -proof - - have "finite (insert i I)" using `finite I` by auto - interpret I: finite_product_sigma_algebra M I by default fact - interpret I': finite_product_sigma_algebra M "insert i I" by default fact - interpret pair_sigma_algebra I.P "M i" by default - show ?thesis - unfolding product_singleton_vimage_algebra_eq[OF assms, symmetric] - using bij_betw_restrict_I_i[OF `i \ I`, of M] - by (rule vimage_vimage_inv[unfolded space_sigma]) - (auto simp: space_pair_algebra product_algebra_def dest: extensional_restrict) -qed +lemma (in product_sigma_algebra) measurable_singleton: + shows "f \ measurable (sigma (product_algebra M {i})) M' \ + (\x. f (\j\{i}. x)) \ measurable (M i) M'" + using sets_into_space unfolding measurable_component_singleton[symmetric] + by (auto intro!: measurable_cong arg_cong[where f=f] simp: fun_eq_iff extensional_def) locale product_sigma_finite = fixes M :: "'i \ 'a algebra" and \ :: "'i \ 'a set \ pextreal" @@ -1427,9 +1552,10 @@ let ?h = "\x. (restrict x I, x i)" let ?\ = "\A. P.pair_measure (?h ` A)" interpret I': measure_space "sigma (product_algebra M (insert i I))" ?\ - unfolding product_singleton_vimage_algebra_eq[OF `i \ I` `finite I`, symmetric] - using bij_betw_restrict_I_i[OF `i \ I`, of M] - by (intro P.measure_space_isomorphic) auto + apply (subst pair_product_singleton_vimage_algebra[OF `i \ I`, symmetric]) + apply (intro P.measure_space_isomorphic bij_inv_bij_betw) + unfolding sigma_pair_algebra_product_singleton + by (rule bij_inv_restrict_insert[OF `i \ I`]) show ?case proof (intro exI[of _ ?\] conjI ballI) { fix A assume A: "A \ (\ i\insert i I. sets (M i))" @@ -1512,6 +1638,17 @@ "product_integral I \ measure_space.integral (sigma (product_algebra M I)) (product_measure I)" +abbreviation (in product_sigma_finite) + "product_integrable I \ + measure_space.integrable (sigma (product_algebra M I)) (product_measure I)" + +lemma (in product_sigma_finite) product_measure_empty[simp]: + "product_measure {} {\x. undefined} = 1" +proof - + interpret finite_product_sigma_finite M \ "{}" by default auto + from measure_times[of "\x. {}"] show ?thesis by simp +qed + lemma (in product_sigma_finite) positive_integral_empty: "product_positive_integral {} f = f (\k. undefined)" proof - @@ -1528,46 +1665,6 @@ qed qed -lemma merge_restrict[simp]: - "merge I (restrict x I) J y = merge I x J y" - "merge I x J (restrict y J) = merge I x J y" - unfolding merge_def by (auto intro!: ext) - -lemma merge_x_x_eq_restrict[simp]: - "merge I x J x = restrict x (I \ J)" - unfolding merge_def by (auto intro!: ext) - -lemma bij_betw_restrict_I_J: - "I \ J = {} \ bij_betw (\x. (restrict x I, restrict x J)) - (space (product_algebra M (I \ J))) - (space (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))))" - by (intro bij_betwI[where g="\(x,y). merge I x J y"]) - (auto dest: extensional_restrict simp: space_pair_algebra) - -lemma (in product_sigma_algebra) product_product_vimage_algebra_eq: - assumes [simp]: "I \ J = {}" and "finite I" "finite J" - shows "sigma_algebra.vimage_algebra - (sigma (product_algebra M (I \ J))) - (space (sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J))))) - (\(x, y). merge I x J y) = - sigma (pair_algebra (sigma (product_algebra M I)) (sigma (product_algebra M J)))" - (is "sigma_algebra.vimage_algebra ?IJ ?S ?m = ?P") -proof - - interpret I: finite_product_sigma_algebra M I by default fact - interpret J: finite_product_sigma_algebra M J by default fact - have "finite (I \ J)" using assms by auto - interpret IJ: finite_product_sigma_algebra M "I \ J" by default fact - interpret P: pair_sigma_algebra I.P J.P by default - - let ?g = "\x. (restrict x I, restrict x J)" - let ?f = "\(x, y). merge I x J y" - show "IJ.vimage_algebra (space P.P) ?f = P.P" - using bij_betw_restrict_I_J[OF `I \ J = {}`] - by (subst P.vimage_vimage_inv[of ?g "space IJ.G" ?f, - unfolded product_product_vimage_algebra[OF assms]]) - (auto simp: pair_algebra_def dest: extensional_restrict) -qed - lemma (in product_sigma_finite) measure_fold: assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" assumes A: "A \ sets (sigma (product_algebra M (I \ J)))" @@ -1598,9 +1695,10 @@ show "range ?F \ sets IJ.G" using F by (simp add: image_subset_iff product_algebra_def) show "?F \ space IJ.G " using F(2) by simp show "measure_space IJ.P (\A. P.pair_measure (?f ` A))" - unfolding product_product_vimage_algebra[OF IJ fin, symmetric] - using bij_betw_restrict_I_J[OF IJ, of M] - by (auto intro!: P.measure_space_isomorphic) + apply (subst product_product_vimage_algebra[OF IJ, symmetric]) + apply (intro P.measure_space_isomorphic bij_inv_bij_betw) + unfolding sigma_pair_algebra_sigma_eq + by (rule bij_inv_restrict_merge[OF `I \ J = {}`]) show "measure_space IJ.P IJ.measure" by fact next fix A assume "A \ sets IJ.G" @@ -1640,14 +1738,16 @@ interpret P: pair_sigma_finite I.P I.measure J.P J.measure by default let ?f = "\x. ((\i\I. x i), (\i\J. x i))" have P_borel: "(\x. f (case x of (x, y) \ merge I x J y)) \ borel_measurable P.P" - by (subst product_product_vimage_algebra_eq[OF IJ fin, symmetric]) - (auto simp: space_pair_algebra intro!: IJ.measurable_vimage f) + unfolding case_prod_distrib measurable_merge_iff[OF IJ, symmetric] using f . + have bij: "bij_betw ?f (space IJ.P) (space P.P)" + unfolding sigma_pair_algebra_sigma_eq + by (intro bij_inv_bij_betw) (rule bij_inv_restrict_merge[OF IJ]) have "IJ.positive_integral f = IJ.positive_integral (\x. f (restrict x (I \ J)))" by (auto intro!: IJ.positive_integral_cong arg_cong[where f=f] dest!: extensional_restrict) also have "\ = I.positive_integral (\x. J.positive_integral (\y. f (merge I x J y)))" unfolding P.positive_integral_fst_measurable[OF P_borel, simplified] - unfolding P.positive_integral_vimage[unfolded space_sigma, OF bij_betw_restrict_I_J[OF IJ]] - unfolding product_product_vimage_algebra[OF IJ fin] + unfolding P.positive_integral_vimage[OF bij] + unfolding product_product_vimage_algebra[OF IJ] apply simp apply (rule IJ.positive_integral_cong_measure[symmetric]) apply (rule measure_fold) @@ -1687,6 +1787,59 @@ qed simp qed +lemma (in product_sigma_finite) product_positive_integral_insert: + assumes [simp]: "finite I" "i \ I" + and f: "f \ borel_measurable (sigma (product_algebra M (insert i I)))" + shows "product_positive_integral (insert i I) f + = product_positive_integral I (\x. M.positive_integral i (\y. f (x(i:=y))))" +proof - + interpret I: finite_product_sigma_finite M \ I by default auto + interpret i: finite_product_sigma_finite M \ "{i}" by default auto + interpret P: pair_sigma_algebra I.P i.P .. + have IJ: "I \ {i} = {}" by auto + show ?thesis + unfolding product_positive_integral_fold[OF IJ, simplified, OF f] + proof (rule I.positive_integral_cong, subst product_positive_integral_singleton) + fix x assume x: "x \ space I.P" + let "?f y" = "f (restrict (x(i := y)) (insert i I))" + have f'_eq: "\y. ?f y = f (x(i := y))" + using x by (auto intro!: arg_cong[where f=f] simp: fun_eq_iff extensional_def) + note fP = f[unfolded measurable_merge_iff[OF IJ, simplified]] + show "?f \ borel_measurable (M i)" + using P.measurable_pair_image_snd[OF fP x] + unfolding measurable_singleton f'_eq by (simp add: f'_eq) + show "M.positive_integral i ?f = M.positive_integral i (\y. f (x(i := y)))" + unfolding f'_eq by simp + qed +qed + +lemma (in product_sigma_finite) product_positive_integral_setprod: + fixes f :: "'i \ 'a \ pextreal" + assumes "finite I" and borel: "\i. i \ I \ f i \ borel_measurable (M i)" + shows "product_positive_integral I (\x. (\i\I. f i (x i))) = + (\i\I. M.positive_integral i (f i))" +using assms proof induct + case empty + interpret finite_product_sigma_finite M \ "{}" by default auto + then show ?case by simp +next + case (insert i I) + note `finite I`[intro, simp] + interpret I: finite_product_sigma_finite M \ I by default auto + have *: "\x y. (\j\I. f j (if j = i then y else x j)) = (\j\I. f j (x j))" + using insert by (auto intro!: setprod_cong) + have prod: "\J. J \ insert i I \ + (\x. (\i\J. f i (x i))) \ borel_measurable (sigma (product_algebra M J))" + using sets_into_space insert + by (intro sigma_algebra.borel_measurable_pextreal_setprod + sigma_algebra_sigma product_algebra_sets_into_space + measurable_component) + auto + show ?case + by (simp add: product_positive_integral_insert[OF insert(1,2) prod]) + (simp add: insert I.positive_integral_cmult M.positive_integral_multc * prod subset_insertI) +qed + lemma (in product_sigma_finite) product_integral_singleton: assumes f: "f \ borel_measurable (M i)" shows "product_integral {i} (\x. f (x i)) = M.integral i f" @@ -1700,45 +1853,6 @@ unfolding *[THEN product_positive_integral_singleton] .. qed -lemma (in product_sigma_finite) borel_measurable_merge_iff: - assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" - shows "f \ measurable (sigma (pair_algebra - (sigma (product_algebra M I)) (sigma (product_algebra M J)))) M' \ - (\x. f (restrict x I, restrict x J)) \ measurable (sigma (product_algebra M (I \ J))) M'" -proof - - interpret I: finite_product_sigma_finite M \ I by default fact - interpret J: finite_product_sigma_finite M \ J by default fact - have "finite (I \ J)" using fin by auto - interpret IJ: finite_product_sigma_finite M \ "I \ J" by default fact - interpret P: pair_sigma_finite I.P I.measure J.P J.measure by default - let ?f = "\x. (restrict x I, restrict x J)" - let ?S = "space (product_algebra M (I \ J))" - { fix p assume p: "p \ space (pair_algebra I.P J.P)" - have "?f (the_inv_into ?S ?f p) = p" - proof (intro f_the_inv_into_f[where f="?f"] inj_onI ext) - fix x y t assume "x \ ?S" "y \ ?S" "?f x = ?f y" - show "x t = y t" - proof cases - assume "t \ I \ J" then show ?thesis using `?f x = ?f y` - by (auto simp: restrict_def fun_eq_iff split: split_if_asm) - next - assume "t \ I \ J" then show ?thesis - using `x \ ?S` `y \ ?S` by (auto simp: space_pair_algebra extensional_def) - qed - next - show "p \ ?f ` ?S" using p - by (intro image_eqI[of _ _ "merge I (fst p) J (snd p)"]) - (auto simp: space_pair_algebra extensional_restrict) - qed } - note restrict = this - show ?thesis - apply (subst product_product_vimage_algebra[OF assms, symmetric]) - apply (subst P.measurable_vimage_iff_inv) - using bij_betw_restrict_I_J[OF IJ, of M] apply simp - apply (rule measurable_cong) - by (auto simp del: space_product_algebra simp: restrict) -qed - lemma (in product_sigma_finite) product_integral_fold: assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" and f: "measure_space.integrable (sigma (product_algebra M (I \ J))) (product_measure (I \ J)) f" @@ -1761,7 +1875,7 @@ then have f'_borel: "(\x. Real (?f x)) \ borel_measurable P.P" "(\x. Real (- ?f x)) \ borel_measurable P.P" - unfolding borel_measurable_merge_iff[OF IJ fin] + unfolding measurable_restrict_iff[OF IJ] by simp_all have PI: "P.positive_integral (\x. Real (?f x)) = IJ.positive_integral (\x. Real (f x))" @@ -1771,7 +1885,7 @@ by simp_all have "P.integrable ?f" using `IJ.integrable f` unfolding P.integrable_def IJ.integrable_def - unfolding borel_measurable_merge_iff[OF IJ fin] + unfolding measurable_restrict_iff[OF IJ] using f_restrict PI by simp_all show ?thesis unfolding P.integrable_fst_measurable(2)[OF `P.integrable ?f`, simplified] @@ -1779,6 +1893,84 @@ unfolding PI by simp qed +lemma (in product_sigma_finite) product_integral_insert: + assumes [simp]: "finite I" "i \ I" + and f: "measure_space.integrable (sigma (product_algebra M (insert i I))) (product_measure (insert i I)) f" + shows "product_integral (insert i I) f + = product_integral I (\x. M.integral i (\y. f (x(i:=y))))" +proof - + interpret I: finite_product_sigma_finite M \ I by default auto + interpret I': finite_product_sigma_finite M \ "insert i I" by default auto + interpret i: finite_product_sigma_finite M \ "{i}" by default auto + interpret P: pair_sigma_algebra I.P i.P .. + have IJ: "I \ {i} = {}" by auto + show ?thesis + unfolding product_integral_fold[OF IJ, simplified, OF f] + proof (rule I.integral_cong, subst product_integral_singleton) + fix x assume x: "x \ space I.P" + let "?f y" = "f (restrict (x(i := y)) (insert i I))" + have f'_eq: "\y. ?f y = f (x(i := y))" + using x by (auto intro!: arg_cong[where f=f] simp: fun_eq_iff extensional_def) + have "f \ borel_measurable I'.P" using f unfolding I'.integrable_def by auto + note fP = this[unfolded measurable_merge_iff[OF IJ, simplified]] + show "?f \ borel_measurable (M i)" + using P.measurable_pair_image_snd[OF fP x] + unfolding measurable_singleton f'_eq by (simp add: f'_eq) + show "M.integral i ?f = M.integral i (\y. f (x(i := y)))" + unfolding f'_eq by simp + qed +qed + +lemma (in product_sigma_finite) product_integrable_setprod: + fixes f :: "'i \ 'a \ real" + assumes [simp]: "finite I" and integrable: "\i. i \ I \ M.integrable i (f i)" + shows "product_integrable I (\x. (\i\I. f i (x i)))" (is "product_integrable I ?f") +proof - + interpret finite_product_sigma_finite M \ I by default fact + have f: "\i. i \ I \ f i \ borel_measurable (M i)" + using integrable unfolding M.integrable_def by auto + then have borel: "?f \ borel_measurable P" + by (intro borel_measurable_setprod measurable_component) auto + moreover have "integrable (\x. \\i\I. f i (x i)\)" + 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))))" + 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 + also have "\ < \" + using integrable[THEN M.integrable_abs] + unfolding pextreal_less_\ setprod_\ M.integrable_def by simp + finally show "positive_integral (\x. Real (abs (?f x))) \ \" by auto + show "positive_integral (\x. Real (- abs (?f x))) \ \" by simp + qed + ultimately show ?thesis + by (rule integrable_abs_iff[THEN iffD1]) +qed + +lemma (in product_sigma_finite) product_integral_setprod: + fixes f :: "'i \ 'a \ real" + assumes "finite I" "I \ {}" and integrable: "\i. i \ I \ M.integrable i (f i)" + shows "product_integral I (\x. (\i\I. f i (x i))) = (\i\I. M.integral i (f i))" +using assms proof (induct rule: finite_ne_induct) + case (singleton i) + then show ?case by (simp add: product_integral_singleton integrable_def) +next + case (insert i I) + then have iI: "finite (insert i I)" by auto + then have prod: "\J. J \ insert i I \ + product_integrable J (\x. (\i\J. f i (x i)))" + by (intro product_integrable_setprod insert(5)) (auto intro: finite_subset) + interpret I: finite_product_sigma_finite M \ I by default fact + have *: "\x y. (\j\I. f j (if j = i then y else x j)) = (\j\I. f j (x j))" + using `i \ I` by (auto intro!: setprod_cong) + show ?case + unfolding product_integral_insert[OF insert(1,3) prod[OF subset_refl]] + by (simp add: * insert integral_multc I.integral_cmult[OF prod] subset_insertI) +qed + section "Products on finite spaces" lemma sigma_sets_pair_algebra_finite: diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Radon_Nikodym.thy --- a/src/HOL/Probability/Radon_Nikodym.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Radon_Nikodym.thy Thu Dec 09 10:22:17 2010 +0100 @@ -323,9 +323,10 @@ { fix f g assume "f \ g" and f: "\i. f i \ G" have "g \ G" unfolding G_def proof safe - from `f \ g` have [simp]: "g = (SUP i. f i)" unfolding isoton_def by simp + from `f \ g` have [simp]: "g = (\x. SUP i. f i x)" + unfolding isoton_def fun_eq_iff SUPR_apply by simp have f_borel: "\i. f i \ borel_measurable M" using f unfolding G_def by simp - thus "g \ borel_measurable M" by (auto intro!: borel_measurable_SUP) + thus "g \ borel_measurable M" by auto fix A assume "A \ sets M" hence "\i. (\x. f i x * indicator A x) \ borel_measurable M" using f_borel by (auto intro!: borel_measurable_indicator) @@ -1103,42 +1104,36 @@ unfolding eq[OF A, symmetric] RN_deriv(2)[OF \ A, symmetric] .. qed -lemma the_inv_into_in: - assumes "inj_on f A" and x: "x \ f`A" - shows "the_inv_into A f x \ A" - using assms by (auto simp: the_inv_into_f_f) - lemma (in sigma_finite_measure) RN_deriv_vimage: fixes f :: "'b \ 'a" - assumes f: "bij_betw f S (space M)" + assumes f: "bij_inv S (space M) f g" assumes \: "measure_space M \" "absolutely_continuous \" shows "AE x. - sigma_finite_measure.RN_deriv (vimage_algebra S f) (\A. \ (f ` A)) (\A. \ (f ` A)) (the_inv_into S f x) = RN_deriv \ x" + sigma_finite_measure.RN_deriv (vimage_algebra S f) (\A. \ (f ` A)) (\A. \ (f ` A)) (g x) = RN_deriv \ x" proof (rule RN_deriv_unique[OF \]) interpret sf: sigma_finite_measure "vimage_algebra S f" "\A. \ (f ` A)" - using f by (rule sigma_finite_measure_isomorphic) + using f by (rule sigma_finite_measure_isomorphic[OF bij_inv_bij_betw(1)]) interpret \: measure_space M \ using \(1) . have \': "measure_space (vimage_algebra S f) (\A. \ (f ` A))" - using f by (rule \.measure_space_isomorphic) + using f by (rule \.measure_space_isomorphic[OF bij_inv_bij_betw(1)]) { fix A assume "A \ sets M" then have "f ` (f -` A \ S) = A" - using sets_into_space f[unfolded bij_betw_def] + using sets_into_space f[THEN bij_inv_bij_betw(1), unfolded bij_betw_def] by (intro image_vimage_inter_eq[where T="space M"]) auto } note A_f = this then have ac: "sf.absolutely_continuous (\A. \ (f ` A))" using \(2) by (auto simp: sf.absolutely_continuous_def absolutely_continuous_def) - show "(\x. sf.RN_deriv (\A. \ (f ` A)) (the_inv_into S f x)) \ borel_measurable M" + show "(\x. sf.RN_deriv (\A. \ (f ` A)) (g x)) \ borel_measurable M" using sf.RN_deriv(1)[OF \' ac] unfolding measurable_vimage_iff_inv[OF f] comp_def . fix A assume "A \ sets M" - then have *: "\x. x \ space M \ indicator (f -` A \ S) (the_inv_into S f x) = (indicator A x :: pextreal)" - using f[unfolded bij_betw_def] - unfolding indicator_def by (auto simp: f_the_inv_into_f the_inv_into_in) + then have *: "\x. x \ space M \ indicator (f -` A \ S) (g x) = (indicator A x :: pextreal)" + 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)) (the_inv_into S f x) * indicator A x)" + also have "\ = positive_integral (\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)) (the_inv_into S f x) * indicator A x)" + finally show "\ A = positive_integral (\x. sf.RN_deriv (\A. \ (f ` A)) (g x) * indicator A x)" unfolding A_f[OF `A \ sets M`] . qed diff -r 1dc7652ce404 -r ababba14c965 src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Thu Dec 09 08:46:04 2010 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Thu Dec 09 10:22:17 2010 +0100 @@ -806,13 +806,6 @@ (simp_all add: f_the_inv_into_f cong: measurable_cong) qed -lemma (in sigma_algebra) measurable_vimage_iff_inv: - fixes f :: "'b \ 'a" assumes f: "bij_betw f S (space M)" - shows "g \ measurable (vimage_algebra S f) M' \ (g \ the_inv_into S f) \ measurable M M'" - unfolding measurable_vimage_iff[OF f] - using f[unfolded bij_betw_def] - by (auto intro!: measurable_cong simp add: the_inv_into_f_f) - lemma sigma_sets_vimage: assumes "f \ S' \ S" and "A \ Pow S" shows "sigma_sets S' ((\X. f -` X \ S') ` A) = (\X. f -` X \ S') ` sigma_sets S A" @@ -871,22 +864,6 @@ qed qed -lemma vimage_algebra_sigma: - assumes E: "sets E \ Pow (space E)" - and f: "f \ space F \ space E" - and "\A. A \ sets F \ A \ (\X. f -` X \ space F) ` sets E" - and "\A. A \ sets E \ f -` A \ space F \ sets F" - shows "sigma_algebra.vimage_algebra (sigma E) (space F) f = sigma F" -proof - - interpret sigma_algebra "sigma E" - using assms by (intro sigma_algebra_sigma) auto - have eq: "sets F = (\X. f -` X \ space F) ` sets E" - using assms by auto - show "vimage_algebra (space F) f = sigma F" - unfolding vimage_algebra_def using assms - by (simp add: sigma_def eq sigma_sets_vimage) -qed - section {* Conditional space *} definition (in algebra) @@ -1420,6 +1397,8 @@ using E by simp qed +subsection "Sigma algebras on finite sets" + locale finite_sigma_algebra = sigma_algebra + assumes finite_space: "finite (space M)" and sets_eq_Pow[simp]: "sets M = Pow (space M)" @@ -1438,4 +1417,92 @@ by (auto simp: image_space_def) qed +subsection "Bijective functions with inverse" + +definition "bij_inv A B f g \ + f \ A \ B \ g \ B \ A \ (\x\A. g (f x) = x) \ (\x\B. f (g x) = x)" + +lemma bij_inv_symmetric[sym]: "bij_inv A B f g \ bij_inv B A g f" + unfolding bij_inv_def by auto + +lemma bij_invI: + assumes "f \ A \ B" "g \ B \ A" + and "\x. x \ A \ g (f x) = x" + and "\x. x \ B \ f (g x) = x" + shows "bij_inv A B f g" + using assms unfolding bij_inv_def by auto + +lemma bij_invE: + assumes "bij_inv A B f g" + "\ f \ A \ B ; g \ B \ A ; + (\x. x \ A \ g (f x) = x) ; + (\x. x \ B \ f (g x) = x) \ \ P" + shows P + using assms unfolding bij_inv_def by auto + +lemma bij_inv_bij_betw: + assumes "bij_inv A B f g" + shows "bij_betw f A B" "bij_betw g B A" + using assms by (auto intro: bij_betwI elim!: bij_invE) + +lemma bij_inv_vimage_vimage: + assumes "bij_inv A B f e" + shows "f -` (e -` X \ B) \ A = X \ A" + using assms by (auto elim!: bij_invE) + +lemma (in sigma_algebra) measurable_vimage_iff_inv: + fixes f :: "'b \ 'a" assumes "bij_inv S (space M) f g" + shows "h \ measurable (vimage_algebra S f) M' \ (\x. h (g x)) \ measurable M M'" + unfolding measurable_vimage_iff[OF bij_inv_bij_betw(1), OF assms] +proof (rule measurable_cong) + fix w assume "w \ space (vimage_algebra S f)" + then have "w \ S" by auto + then show "h w = ((\x. h (g x)) \ f) w" + using assms by (auto elim: bij_invE) +qed + +lemma vimage_algebra_sigma: + assumes bi: "bij_inv (space (sigma F)) (space (sigma E)) f e" + and "sets E \ Pow (space E)" and F: "sets F \ Pow (space F)" + and "f \ measurable F E" "e \ measurable E F" + shows "sigma_algebra.vimage_algebra (sigma E) (space (sigma F)) f = sigma F" +proof - + interpret sigma_algebra "sigma E" + using assms by (intro sigma_algebra_sigma) auto + have eq: "sets F = (\X. f -` X \ space F) ` sets E" + proof safe + fix X assume "X \ sets F" + then have "e -` X \ space E \ sets E" + using `e \ measurable E F` unfolding measurable_def by auto + then show "X \(\Y. f -` Y \ space F) ` sets E" + apply (rule rev_image_eqI) + unfolding bij_inv_vimage_vimage[OF bi[simplified]] + using F `X \ sets F` by auto + next + fix X assume "X \ sets E" then show "f -` X \ space F \ sets F" + using `f \ measurable F E` unfolding measurable_def by auto + qed + show "vimage_algebra (space (sigma F)) f = sigma F" + unfolding vimage_algebra_def + using assms by (auto simp: bij_inv_def eq sigma_sets_vimage[symmetric] sigma_def) +qed + +lemma measurable_sigma_sigma: + assumes M: "sets M \ Pow (space M)" and N: "sets N \ Pow (space N)" + shows "f \ measurable M N \ f \ measurable (sigma M) (sigma N)" + using sigma_algebra.measurable_subset[OF sigma_algebra_sigma[OF M], of N] + using measurable_up_sigma[of M N] N by auto + +lemma bij_inv_the_inv_into: + assumes "bij_betw f A B" shows "bij_inv A B f (the_inv_into A f)" +proof (rule bij_invI) + show "the_inv_into A f \ B \ A" + using bij_betw_the_inv_into[OF assms] by (rule bij_betw_imp_funcset) + show "f \ A \ B" using assms by (rule bij_betw_imp_funcset) + show "\x. x \ A \ the_inv_into A f (f x) = x" + "\x. x \ B \ f (the_inv_into A f x) = x" + using the_inv_into_f_f[of f A] f_the_inv_into_f[of f A] + using assms by (auto simp: bij_betw_def) +qed + end