diff -r 15ea98537c76 -r a6678da5692c src/HOL/Probability/Binary_Product_Measure.thy --- a/src/HOL/Probability/Binary_Product_Measure.thy Wed Oct 10 12:12:34 2012 +0200 +++ b/src/HOL/Probability/Binary_Product_Measure.thy Wed Oct 10 12:12:34 2012 +0200 @@ -331,7 +331,7 @@ qed qed -sublocale pair_sigma_finite \ sigma_finite_measure "M1 \\<^isub>M M2" +sublocale pair_sigma_finite \ P: sigma_finite_measure "M1 \\<^isub>M M2" proof from sigma_finite_up_in_pair_measure_generator guess F :: "nat \ ('a \ 'b) set" .. note F = this show "\F::nat \ ('a \ 'b) set. range F \ sets (M1 \\<^isub>M M2) \ (\i. F i) = space (M1 \\<^isub>M M2) \ (\i. emeasure (M1 \\<^isub>M M2) (F i) \ \)" @@ -472,105 +472,58 @@ section "Fubinis theorem" -lemma (in pair_sigma_finite) simple_function_cut: - assumes f: "simple_function (M1 \\<^isub>M M2) f" "\x. 0 \ f x" - shows "(\x. \\<^isup>+y. f (x, y) \M2) \ borel_measurable M1" - and "(\\<^isup>+ x. (\\<^isup>+ y. f (x, y) \M2) \M1) = integral\<^isup>P (M1 \\<^isub>M M2) f" -proof - - have f_borel: "f \ borel_measurable (M1 \\<^isub>M M2)" - using f(1) by (rule borel_measurable_simple_function) - let ?F = "\z. f -` {z} \ space (M1 \\<^isub>M M2)" - let ?F' = "\x z. Pair x -` ?F z" - { fix x assume "x \ space M1" - have [simp]: "\z y. indicator (?F z) (x, y) = indicator (?F' x z) y" - by (auto simp: indicator_def) - have "\y. y \ space M2 \ (x, y) \ space (M1 \\<^isub>M M2)" using `x \ space M1` - by (simp add: space_pair_measure) - moreover have "\x z. ?F' x z \ sets M2" using f_borel - by (rule sets_Pair1[OF measurable_sets]) auto - ultimately have "simple_function M2 (\ y. f (x, y))" - apply (rule_tac simple_function_cong[THEN iffD2, OF _]) - apply (rule simple_function_indicator_representation[OF f(1)]) - using `x \ space M1` by auto } - note M2_sf = this - { fix x assume x: "x \ space M1" - then have "(\\<^isup>+y. f (x, y) \M2) = (\z\f ` space (M1 \\<^isub>M M2). z * emeasure M2 (?F' x z))" - unfolding positive_integral_eq_simple_integral[OF M2_sf[OF x] f(2)] - unfolding simple_integral_def - proof (safe intro!: setsum_mono_zero_cong_left) - from f(1) show "finite (f ` space (M1 \\<^isub>M M2))" by (rule simple_functionD) - next - fix y assume "y \ space M2" then show "f (x, y) \ f ` space (M1 \\<^isub>M M2)" - using `x \ space M1` by (auto simp: space_pair_measure) - next - fix x' y assume "(x', y) \ space (M1 \\<^isub>M M2)" - "f (x', y) \ (\y. f (x, y)) ` space M2" - then have *: "?F' x (f (x', y)) = {}" - by (force simp: space_pair_measure) - show "f (x', y) * emeasure M2 (?F' x (f (x', y))) = 0" - unfolding * by simp - qed (simp add: vimage_compose[symmetric] comp_def - space_pair_measure) } - note eq = this - moreover have "\z. ?F z \ sets (M1 \\<^isub>M M2)" - by (auto intro!: f_borel borel_measurable_vimage) - moreover then have "\z. (\x. emeasure M2 (?F' x z)) \ borel_measurable M1" - by (auto intro!: measurable_emeasure_Pair1 simp del: vimage_Int) - moreover have *: "\i x. 0 \ emeasure M2 (Pair x -` (f -` {i} \ space (M1 \\<^isub>M M2)))" - using f(1)[THEN simple_functionD(2)] f(2) by (intro emeasure_nonneg) - moreover { fix i assume "i \ f`space (M1 \\<^isub>M M2)" - with * have "\x. 0 \ i * emeasure M2 (Pair x -` (f -` {i} \ space (M1 \\<^isub>M M2)))" - using f(2) by auto } - ultimately - show "(\x. \\<^isup>+y. f (x, y) \M2) \ borel_measurable M1" - and "(\\<^isup>+ x. (\\<^isup>+ y. f (x, y) \M2) \M1) = integral\<^isup>P (M1 \\<^isub>M M2) f" using f(2) - by (auto simp del: vimage_Int cong: measurable_cong intro!: setsum_cong - simp add: positive_integral_setsum simple_integral_def - positive_integral_cmult - positive_integral_cong[OF eq] - positive_integral_eq_simple_integral[OF f] - M2.emeasure_pair_measure_alt[symmetric]) -qed +lemma measurable_compose_Pair1: + "x \ space M1 \ g \ measurable (M1 \\<^isub>M M2) L \ (\y. g (x, y)) \ measurable M2 L" + by (rule measurable_compose[OF measurable_Pair]) auto + +lemma (in pair_sigma_finite) borel_measurable_positive_integral_fst: + assumes f: "f \ borel_measurable (M1 \\<^isub>M M2)" "\x. 0 \ f x" + shows "(\x. \\<^isup>+ y. f (x, y) \M2) \ borel_measurable M1" +using f proof induct + case (cong u v) + then have "\w x. w \ space M1 \ x \ space M2 \ u (w, x) = v (w, x)" + by (auto simp: space_pair_measure) + show ?case + apply (subst measurable_cong) + apply (rule positive_integral_cong) + apply fact+ + done +next + case (set Q) + have [simp]: "\x y. indicator Q (x, y) = indicator (Pair x -` Q) y" + by (auto simp: indicator_def) + have "\x. x \ space M1 \ emeasure M2 (Pair x -` Q) = \\<^isup>+ y. indicator Q (x, y) \M2" + by (simp add: sets_Pair1[OF set]) + from this M2.measurable_emeasure_Pair[OF set] show ?case + by (rule measurable_cong[THEN iffD1]) +qed (simp_all add: positive_integral_add positive_integral_cmult measurable_compose_Pair1 + positive_integral_monotone_convergence_SUP incseq_def le_fun_def + cong: measurable_cong) + +lemma (in pair_sigma_finite) positive_integral_fst: + assumes f: "f \ borel_measurable (M1 \\<^isub>M M2)" "\x. 0 \ f x" + shows "(\\<^isup>+ x. \\<^isup>+ y. f (x, y) \M2 \M1) = integral\<^isup>P (M1 \\<^isub>M M2) f" (is "?I f = _") +using f proof induct + case (cong u v) + moreover then have "?I u = ?I v" + by (intro positive_integral_cong) (auto simp: space_pair_measure) + ultimately show ?case + by (simp cong: positive_integral_cong) +qed (simp_all add: M2.emeasure_pair_measure positive_integral_cmult positive_integral_add + positive_integral_monotone_convergence_SUP + measurable_compose_Pair1 positive_integral_positive + borel_measurable_positive_integral_fst positive_integral_mono incseq_def le_fun_def + cong: positive_integral_cong) lemma (in pair_sigma_finite) positive_integral_fst_measurable: assumes f: "f \ borel_measurable (M1 \\<^isub>M M2)" shows "(\x. \\<^isup>+ y. f (x, y) \M2) \ borel_measurable M1" (is "?C f \ borel_measurable M1") and "(\\<^isup>+ x. (\\<^isup>+ y. f (x, y) \M2) \M1) = integral\<^isup>P (M1 \\<^isub>M M2) f" -proof - - from borel_measurable_implies_simple_function_sequence'[OF f] guess F . note F = this - then have F_borel: "\i. F i \ borel_measurable (M1 \\<^isub>M M2)" - by (auto intro: borel_measurable_simple_function) - note sf = simple_function_cut[OF F(1,5)] - then have "(\x. SUP i. ?C (F i) x) \ borel_measurable M1" - using F(1) by auto - moreover - { fix x assume "x \ space M1" - from F measurable_Pair2[OF F_borel `x \ space M1`] - have "(\\<^isup>+y. (SUP i. F i (x, y)) \M2) = (SUP i. ?C (F i) x)" - by (intro positive_integral_monotone_convergence_SUP) - (auto simp: incseq_Suc_iff le_fun_def) - then have "(SUP i. ?C (F i) x) = ?C f x" - unfolding F(4) positive_integral_max_0 by simp } - note SUPR_C = this - ultimately show "?C f \ borel_measurable M1" - by (simp cong: measurable_cong) - have "(\\<^isup>+x. (SUP i. F i x) \(M1 \\<^isub>M M2)) = (SUP i. integral\<^isup>P (M1 \\<^isub>M M2) (F i))" - using F_borel F - by (intro positive_integral_monotone_convergence_SUP) auto - also have "(SUP i. integral\<^isup>P (M1 \\<^isub>M M2) (F i)) = (SUP i. \\<^isup>+ x. (\\<^isup>+ y. F i (x, y) \M2) \M1)" - unfolding sf(2) by simp - also have "\ = \\<^isup>+ x. (SUP i. \\<^isup>+ y. F i (x, y) \M2) \M1" using F sf(1) - by (intro positive_integral_monotone_convergence_SUP[symmetric]) - (auto intro!: positive_integral_mono positive_integral_positive - simp: incseq_Suc_iff le_fun_def) - also have "\ = \\<^isup>+ x. (\\<^isup>+ y. (SUP i. F i (x, y)) \M2) \M1" - using F_borel F(2,5) - by (auto intro!: positive_integral_cong positive_integral_monotone_convergence_SUP[symmetric] measurable_Pair2 - simp: incseq_Suc_iff le_fun_def) - finally show "(\\<^isup>+ x. (\\<^isup>+ y. f (x, y) \M2) \M1) = integral\<^isup>P (M1 \\<^isub>M M2) f" - using F by (simp add: positive_integral_max_0) -qed + using f + borel_measurable_positive_integral_fst[of "\x. max 0 (f x)"] + positive_integral_fst[of "\x. max 0 (f x)"] + unfolding positive_integral_max_0 by auto lemma (in pair_sigma_finite) positive_integral_snd_measurable: assumes f: "f \ borel_measurable (M1 \\<^isub>M M2)"