diff -r f17602cbf76a -r 1d066f6ab25d src/HOL/Probability/Binary_Product_Measure.thy --- a/src/HOL/Probability/Binary_Product_Measure.thy Thu Apr 14 12:17:44 2016 +0200 +++ b/src/HOL/Probability/Binary_Product_Measure.thy Thu Apr 14 15:48:11 2016 +0200 @@ -110,8 +110,8 @@ shows "f \ measurable M (M1 \\<^sub>M M2)" using measurable_Pair[OF assms] by simp -lemma - assumes f[measurable]: "f \ measurable M (N \\<^sub>M P)" +lemma + assumes f[measurable]: "f \ measurable M (N \\<^sub>M P)" shows measurable_fst': "(\x. fst (f x)) \ measurable M N" and measurable_snd': "(\x. snd (f x)) \ measurable M P" by simp_all @@ -134,7 +134,7 @@ finally have "a \ b \ sets (Sup_sigma {?fst, ?snd})" . } moreover have "sets ?fst \ sets (A \\<^sub>M B)" by (rule sets_image_in_sets) (auto simp: space_pair_measure[symmetric]) - moreover have "sets ?snd \ sets (A \\<^sub>M B)" + moreover have "sets ?snd \ sets (A \\<^sub>M B)" by (rule sets_image_in_sets) (auto simp: space_pair_measure) ultimately show ?thesis by (intro antisym[of "sets A" for A] sets_Sup_in_sets sets_pair_in_sets ) @@ -143,7 +143,7 @@ lemma measurable_pair_iff: "f \ measurable M (M1 \\<^sub>M M2) \ (fst \ f) \ measurable M M1 \ (snd \ f) \ measurable M M2" - by (auto intro: measurable_pair[of f M M1 M2]) + by (auto intro: measurable_pair[of f M M1 M2]) lemma measurable_split_conv: "(\(x, y). f x y) \ measurable A B \ (\x. f (fst x) (snd x)) \ measurable A B" @@ -190,7 +190,7 @@ shows "(\y. f (x, y)) \ measurable M2 M" using measurable_comp[OF measurable_Pair1' f, OF x] by (simp add: comp_def) - + lemma measurable_Pair1: assumes f: "f \ measurable (M1 \\<^sub>M M2) M" and y: "y \ space M2" shows "(\x. f (x, y)) \ measurable M1 M" @@ -279,7 +279,7 @@ shows "emeasure (N \\<^sub>M M) X = (\\<^sup>+ x. \\<^sup>+ y. indicator X (x, y) \M \N)" (is "_ = ?\ X") proof (rule emeasure_measure_of[OF pair_measure_def]) show "positive (sets (N \\<^sub>M M)) ?\" - by (auto simp: positive_def nn_integral_nonneg) + by (auto simp: positive_def) have eq[simp]: "\A x y. indicator A (x, y) = indicator (Pair x -` A) y" by (auto simp: indicator_def) show "countably_additive (sets (N \\<^sub>M M)) ?\" @@ -291,7 +291,7 @@ moreover have "\x. range (\i. Pair x -` F i) \ sets M" using F by (auto simp: sets_Pair1) ultimately show "(\n. ?\ (F n)) = ?\ (\i. F i)" - by (auto simp add: nn_integral_suminf[symmetric] vimage_UN suminf_emeasure emeasure_nonneg + by (auto simp add: nn_integral_suminf[symmetric] vimage_UN suminf_emeasure intro!: nn_integral_cong nn_integral_indicator[symmetric]) qed show "{a \ b |a b. a \ sets N \ b \ sets M} \ Pow (space N \ space M)" @@ -315,7 +315,7 @@ have "emeasure (N \\<^sub>M M) (A \ B) = (\\<^sup>+x. emeasure M B * indicator A x \N)" using A B by (auto intro!: nn_integral_cong simp: emeasure_pair_measure_alt) also have "\ = emeasure M B * emeasure N A" - using A by (simp add: emeasure_nonneg nn_integral_cmult_indicator) + using A by (simp add: nn_integral_cmult_indicator) finally show ?thesis by (simp add: ac_simps) qed @@ -373,9 +373,8 @@ next fix i from F1 F2 have "F1 i \ sets M1" "F2 i \ sets M2" by auto - with F1 F2 emeasure_nonneg[of M1 "F1 i"] emeasure_nonneg[of M2 "F2 i"] - show "emeasure (M1 \\<^sub>M M2) (F1 i \ F2 i) \ \" - by (auto simp add: emeasure_pair_measure_Times) + with F1 F2 show "emeasure (M1 \\<^sub>M M2) (F1 i \ F2 i) \ \" + by (auto simp add: emeasure_pair_measure_Times ennreal_mult_eq_top_iff) qed qed @@ -386,8 +385,7 @@ ultimately show "\A. countable A \ A \ sets (M1 \\<^sub>M M2) \ \A = space (M1 \\<^sub>M M2) \ (\a\A. emeasure (M1 \\<^sub>M M2) a \ \)" by (intro exI[of _ "(\(a, b). a \ b) ` (F1 \ F2)"] conjI) - (auto simp: M2.emeasure_pair_measure_Times space_pair_measure set_eq_iff subset_eq - dest: sets.sets_into_space) + (auto simp: M2.emeasure_pair_measure_Times space_pair_measure set_eq_iff subset_eq ennreal_mult_eq_top_iff) qed lemma sigma_finite_pair_measure: @@ -455,9 +453,9 @@ proof (rule AE_I) from N measurable_emeasure_Pair1[OF \N \ sets (M1 \\<^sub>M M2)\] show "emeasure M1 {x\space M1. emeasure M2 (Pair x -` N) \ 0} = 0" - by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff emeasure_nonneg) + by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff) show "{x \ space M1. emeasure M2 (Pair x -` N) \ 0} \ sets M1" - by (intro borel_measurable_ereal_neq_const measurable_emeasure_Pair1 N) + by (intro borel_measurable_eq measurable_emeasure_Pair1 N sets.sets_Collect_neg N) simp { fix x assume "x \ space M1" "emeasure M2 (Pair x -` N) = 0" have "AE y in M2. Q (x, y)" proof (rule AE_I) @@ -523,8 +521,8 @@ "x \ space M1 \ g \ measurable (M1 \\<^sub>M M2) L \ (\y. g (x, y)) \ measurable M2 L" by simp -lemma (in sigma_finite_measure) borel_measurable_nn_integral_fst': - assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" "\x. 0 \ f x" +lemma (in sigma_finite_measure) borel_measurable_nn_integral_fst: + assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" shows "(\x. \\<^sup>+ y. f (x, y) \M) \ borel_measurable M1" using f proof induct case (cong u v) @@ -547,8 +545,8 @@ nn_integral_monotone_convergence_SUP incseq_def le_fun_def cong: measurable_cong) -lemma (in sigma_finite_measure) nn_integral_fst': - assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" "\x. 0 \ f x" +lemma (in sigma_finite_measure) nn_integral_fst: + assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" shows "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \M \M1) = integral\<^sup>N (M1 \\<^sub>M M) f" (is "?I f = _") using f proof induct case (cong u v) @@ -557,26 +555,16 @@ with cong show ?case by (simp cong: nn_integral_cong) qed (simp_all add: emeasure_pair_measure nn_integral_cmult nn_integral_add - nn_integral_monotone_convergence_SUP - measurable_compose_Pair1 nn_integral_nonneg - borel_measurable_nn_integral_fst' nn_integral_mono incseq_def le_fun_def + nn_integral_monotone_convergence_SUP measurable_compose_Pair1 + borel_measurable_nn_integral_fst nn_integral_mono incseq_def le_fun_def cong: nn_integral_cong) -lemma (in sigma_finite_measure) nn_integral_fst: - assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" - shows "(\\<^sup>+ x. (\\<^sup>+ y. f (x, y) \M) \M1) = integral\<^sup>N (M1 \\<^sub>M M) f" - using f - borel_measurable_nn_integral_fst'[of "\x. max 0 (f x)"] - nn_integral_fst'[of "\x. max 0 (f x)"] - unfolding nn_integral_max_0 by auto - lemma (in sigma_finite_measure) borel_measurable_nn_integral[measurable (raw)]: "case_prod f \ borel_measurable (N \\<^sub>M M) \ (\x. \\<^sup>+ y. f x y \M) \ borel_measurable N" - using borel_measurable_nn_integral_fst'[of "\x. max 0 (case_prod f x)" N] - by (simp add: nn_integral_max_0) + using borel_measurable_nn_integral_fst[of "case_prod f" N] by simp lemma (in pair_sigma_finite) nn_integral_snd: - assumes f: "f \ borel_measurable (M1 \\<^sub>M M2)" + assumes f[measurable]: "f \ borel_measurable (M1 \\<^sub>M M2)" shows "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = integral\<^sup>N (M1 \\<^sub>M M2) f" proof - note measurable_pair_swap[OF f] @@ -584,8 +572,7 @@ have "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = (\\<^sup>+ (x, y). f (y, x) \(M2 \\<^sub>M M1))" by simp also have "(\\<^sup>+ (x, y). f (y, x) \(M2 \\<^sub>M M1)) = integral\<^sup>N (M1 \\<^sub>M M2) f" - by (subst distr_pair_swap) - (auto simp: nn_integral_distr[OF measurable_pair_swap' f] intro!: nn_integral_cong) + by (subst distr_pair_swap) (auto simp add: nn_integral_distr intro!: nn_integral_cong) finally show ?thesis . qed @@ -610,13 +597,13 @@ have [simp]: "snd \ X \ Y \ Y" "fst \ X \ Y \ X" by auto let ?XY = "{{fst -` a \ X \ Y | a. a \ A}, {snd -` b \ X \ Y | b. b \ B}}" - have "sets ?P = + have "sets ?P = sets (\\<^sub>\ xy\?XY. sigma (X \ Y) xy)" by (simp add: vimage_algebra_sigma sets_pair_eq_sets_fst_snd A B) also have "\ = sets (sigma (X \ Y) (\?XY))" by (intro Sup_sigma_sigma arg_cong[where f=sets]) auto also have "\ = sets ?S" - proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI) + proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI) show "\?XY \ Pow (X \ Y)" "{a \ b |a b. a \ A \ b \ B} \ Pow (X \ Y)" using A B by auto next @@ -710,20 +697,17 @@ with A B have fin_Pair: "\x. finite (Pair x -` X)" by (intro finite_subset[OF _ B]) auto have fin_X: "finite X" using X_subset by (rule finite_subset) (auto simp: A B) + have pos_card: "(0::ennreal) < of_nat (card (Pair x -` X)) \ Pair x -` X \ {}" for x + by (auto simp: card_eq_0_iff fin_Pair) blast + show "emeasure ?P X = emeasure ?C X" + using X_subset A fin_Pair fin_X apply (subst B.emeasure_pair_measure_alt[OF X]) apply (subst emeasure_count_space) - using X_subset apply auto [] - apply (simp add: fin_Pair emeasure_count_space X_subset fin_X) - apply (subst nn_integral_count_space) - using A apply simp - apply (simp del: of_nat_setsum add: of_nat_setsum[symmetric]) - apply (subst card_gt_0_iff) - apply (simp add: fin_Pair) - apply (subst card_SigmaI[symmetric]) - using A apply simp - using fin_Pair apply simp - using X_subset apply (auto intro!: arg_cong[where f=card]) + apply (auto simp add: emeasure_count_space nn_integral_count_space + pos_card of_nat_setsum[symmetric] card_SigmaI[symmetric] + simp del: of_nat_setsum card_SigmaI + intro!: arg_cong[where f=card]) done qed @@ -732,16 +716,15 @@ assumes A: "A \ sets (count_space UNIV \\<^sub>M M)" (is "A \ sets (?A \\<^sub>M ?B)") shows "emeasure (?A \\<^sub>M ?B) A = (\\<^sup>+ x. \\<^sup>+ y. indicator A (x, y) \?B \?A)" by (rule emeasure_measure_of[OF pair_measure_def]) - (auto simp: countably_additive_def positive_def suminf_indicator nn_integral_nonneg A + (auto simp: countably_additive_def positive_def suminf_indicator A nn_integral_suminf[symmetric] dest: sets.sets_into_space) lemma emeasure_prod_count_space_single[simp]: "emeasure (count_space UNIV \\<^sub>M count_space UNIV) {x} = 1" proof - - have [simp]: "\a b x y. indicator {(a, b)} (x, y) = (indicator {a} x * indicator {b} y::ereal)" + have [simp]: "\a b x y. indicator {(a, b)} (x, y) = (indicator {a} x * indicator {b} y::ennreal)" by (auto split: split_indicator) show ?thesis - by (cases x) - (auto simp: emeasure_prod_count_space nn_integral_cmult sets_Pair nn_integral_max_0 one_ereal_def[symmetric]) + by (cases x) (auto simp: emeasure_prod_count_space nn_integral_cmult sets_Pair) qed lemma emeasure_count_space_prod_eq: @@ -771,17 +754,16 @@ also have "emeasure (?A \\<^sub>M ?B) C = emeasure (count_space UNIV) C" using \countable C\ by (rule *) finally show ?thesis - using \infinite C\ \infinite A\ by simp + using \infinite C\ \infinite A\ by (simp add: top_unique) qed qed -lemma nn_intergal_count_space_prod_eq': - assumes [simp]: "\x. 0 \ f x" - shows "nn_integral (count_space UNIV \\<^sub>M count_space UNIV) f = nn_integral (count_space UNIV) f" +lemma nn_integral_count_space_prod_eq: + "nn_integral (count_space UNIV \\<^sub>M count_space UNIV) f = nn_integral (count_space UNIV) f" (is "nn_integral ?P f = _") proof cases assume cntbl: "countable {x. f x \ 0}" - have [simp]: "\x. ereal (real (card ({x} \ {x. f x \ 0}))) = indicator {x. f x \ 0} x" + have [simp]: "\x. card ({x} \ {x. f x \ 0}) = (indicator {x. f x \ 0} x::ennreal)" by (auto split: split_indicator) have [measurable]: "\y. (\x. indicator {y} x) \ borel_measurable ?P" by (rule measurable_discrete_difference[of "\x. 0" _ borel "{y}" "\x. indicator {y} x" for y]) @@ -799,9 +781,9 @@ by (auto simp add: nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator) next { fix x assume "f x \ 0" - with \0 \ f x\ have "(\r. 0 < r \ f x = ereal r) \ f x = \" - by (cases "f x") (auto simp: less_le) - then have "\n. ereal (1 / real (Suc n)) \ f x" + then have "(\r\0. 0 < r \ f x = ennreal r) \ f x = \" + by (cases "f x" rule: ennreal_cases) (auto simp: less_le) + then have "\n. ennreal (1 / real (Suc n)) \ f x" by (auto elim!: nat_approx_posE intro!: less_imp_le) } note * = this @@ -816,25 +798,21 @@ have [measurable]: "C \ sets ?P" using sets.countable[OF _ \countable C\, of ?P] by (auto simp: sets_Pair) - have "(\\<^sup>+x. ereal (1/Suc n) * indicator C x \?P) \ nn_integral ?P f" + have "(\\<^sup>+x. ennreal (1/Suc n) * indicator C x \?P) \ nn_integral ?P f" using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric]) - moreover have "(\\<^sup>+x. ereal (1/Suc n) * indicator C x \?P) = \" - using \infinite C\ by (simp add: nn_integral_cmult emeasure_count_space_prod_eq) - moreover have "(\\<^sup>+x. ereal (1/Suc n) * indicator C x \count_space UNIV) \ nn_integral (count_space UNIV) f" + moreover have "(\\<^sup>+x. ennreal (1/Suc n) * indicator C x \?P) = \" + using \infinite C\ by (simp add: nn_integral_cmult emeasure_count_space_prod_eq ennreal_mult_top) + moreover have "(\\<^sup>+x. ennreal (1/Suc n) * indicator C x \count_space UNIV) \ nn_integral (count_space UNIV) f" using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric]) - moreover have "(\\<^sup>+x. ereal (1/Suc n) * indicator C x \count_space UNIV) = \" - using \infinite C\ by (simp add: nn_integral_cmult) + moreover have "(\\<^sup>+x. ennreal (1/Suc n) * indicator C x \count_space UNIV) = \" + using \infinite C\ by (simp add: nn_integral_cmult ennreal_mult_top) ultimately show ?thesis - by simp + by (simp add: top_unique) qed -lemma nn_intergal_count_space_prod_eq: - "nn_integral (count_space UNIV \\<^sub>M count_space UNIV) f = nn_integral (count_space UNIV) f" - by (subst (1 2) nn_integral_max_0[symmetric]) (auto intro!: nn_intergal_count_space_prod_eq') - lemma pair_measure_density: - assumes f: "f \ borel_measurable M1" "AE x in M1. 0 \ f x" - assumes g: "g \ borel_measurable M2" "AE x in M2. 0 \ g x" + assumes f: "f \ borel_measurable M1" + assumes g: "g \ borel_measurable M2" assumes "sigma_finite_measure M2" "sigma_finite_measure (density M2 g)" shows "density M1 f \\<^sub>M density M2 g = density (M1 \\<^sub>M M2) (\(x,y). f x * g y)" (is "?L = ?R") proof (rule measure_eqI) @@ -916,7 +894,7 @@ by simp qed qed - + lemma sets_pair_countable: assumes "countable S1" "countable S2" assumes M: "sets M = Pow S1" and N: "sets N = Pow S2" @@ -948,25 +926,22 @@ by (subst sets_pair_countable[OF assms]) auto next fix A B assume "A \ sets (count_space S1)" "B \ sets (count_space S2)" - then show "emeasure (count_space S1) A * emeasure (count_space S2) B = + then show "emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \ S2)) (A \ B)" - by (subst (1 2 3) emeasure_count_space) (auto simp: finite_cartesian_product_iff) + by (subst (1 2 3) emeasure_count_space) (auto simp: finite_cartesian_product_iff ennreal_mult_top ennreal_top_mult) qed -lemma nn_integral_fst_count_space': - assumes nonneg: "\xy. 0 \ f xy" - shows "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \count_space UNIV \count_space UNIV) = integral\<^sup>N (count_space UNIV) f" +lemma nn_integral_fst_count_space: + "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \count_space UNIV \count_space UNIV) = integral\<^sup>N (count_space UNIV) f" (is "?lhs = ?rhs") proof(cases) assume *: "countable {xy. f xy \ 0}" let ?A = "fst ` {xy. f xy \ 0}" let ?B = "snd ` {xy. f xy \ 0}" from * have [simp]: "countable ?A" "countable ?B" by(rule countable_image)+ - from nonneg have f_neq_0: "\xy. f xy \ 0 \ f xy > 0" - by(auto simp add: order.order_iff_strict) have "?lhs = (\\<^sup>+ x. \\<^sup>+ y. f (x, y) \count_space UNIV \count_space ?A)" by(rule nn_integral_count_space_eq) - (auto simp add: f_neq_0 nn_integral_0_iff_AE AE_count_space not_le intro: rev_image_eqI) + (auto simp add: nn_integral_0_iff_AE AE_count_space not_le intro: rev_image_eqI) also have "\ = (\\<^sup>+ x. \\<^sup>+ y. f (x, y) \count_space ?B \count_space ?A)" by(intro nn_integral_count_space_eq nn_integral_cong)(auto intro: rev_image_eqI) also have "\ = (\\<^sup>+ xy. f xy \count_space (?A \ ?B))" @@ -977,9 +952,9 @@ finally show ?thesis . next { fix xy assume "f xy \ 0" - with \0 \ f xy\ have "(\r. 0 < r \ f xy = ereal r) \ f xy = \" - by (cases "f xy") (auto simp: less_le) - then have "\n. ereal (1 / real (Suc n)) \ f xy" + then have "(\r\0. 0 < r \ f xy = ennreal r) \ f xy = \" + by (cases "f xy" rule: ennreal_cases) (auto simp: less_le) + then have "\n. ennreal (1 / real (Suc n)) \ f xy" by (auto elim!: nat_approx_posE intro!: less_imp_le) } note * = this @@ -991,15 +966,15 @@ then obtain C where C: "C \ {xy. 1/Suc n \ f xy}" and "countable C" "infinite C" by (metis infinite_countable_subset') - have "\ = (\\<^sup>+ xy. ereal (1 / Suc n) * indicator C xy \count_space UNIV)" - using \infinite C\ by(simp add: nn_integral_cmult) + have "\ = (\\<^sup>+ xy. ennreal (1 / Suc n) * indicator C xy \count_space UNIV)" + using \infinite C\ by(simp add: nn_integral_cmult ennreal_mult_top) also have "\ \ ?rhs" using C - by(intro nn_integral_mono)(auto split: split_indicator simp add: nonneg) - finally have "?rhs = \" by simp + by(intro nn_integral_mono)(auto split: split_indicator) + finally have "?rhs = \" by (simp add: top_unique) moreover have "?lhs = \" proof(cases "finite (fst ` C)") case True - then obtain x C' where x: "x \ fst ` C" + then obtain x C' where x: "x \ fst ` C" and C': "C' = fst -` {x} \ C" and "infinite C'" using \infinite C\ by(auto elim!: inf_img_fin_domE') @@ -1007,37 +982,33 @@ from C' \infinite C'\ have "infinite (snd ` C')" by(auto dest!: finite_imageD simp add: inj_on_def) - then have "\ = (\\<^sup>+ y. ereal (1 / Suc n) * indicator (snd ` C') y \count_space UNIV)" - by(simp add: nn_integral_cmult) - also have "\ = (\\<^sup>+ y. ereal (1 / Suc n) * indicator C' (x, y) \count_space UNIV)" + then have "\ = (\\<^sup>+ y. ennreal (1 / Suc n) * indicator (snd ` C') y \count_space UNIV)" + by(simp add: nn_integral_cmult ennreal_mult_top) + also have "\ = (\\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \count_space UNIV)" by(rule nn_integral_cong)(force split: split_indicator intro: rev_image_eqI simp add: C') - also have "\ = (\\<^sup>+ x'. (\\<^sup>+ y. ereal (1 / Suc n) * indicator C' (x, y) \count_space UNIV) * indicator {x} x' \count_space UNIV)" - by(simp add: one_ereal_def[symmetric] nn_integral_nonneg max_def) - also have "\ \ (\\<^sup>+ x. \\<^sup>+ y. ereal (1 / Suc n) * indicator C' (x, y) \count_space UNIV \count_space UNIV)" - by(rule nn_integral_mono)(simp split: split_indicator add: nn_integral_nonneg) + also have "\ = (\\<^sup>+ x'. (\\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \count_space UNIV) * indicator {x} x' \count_space UNIV)" + by(simp add: one_ereal_def[symmetric]) + also have "\ \ (\\<^sup>+ x. \\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \count_space UNIV \count_space UNIV)" + by(rule nn_integral_mono)(simp split: split_indicator) also have "\ \ ?lhs" using ** - by(intro nn_integral_mono)(auto split: split_indicator simp add: nonneg) - finally show ?thesis by simp + by(intro nn_integral_mono)(auto split: split_indicator) + finally show ?thesis by (simp add: top_unique) next case False def C' \ "fst ` C" - have "\ = \\<^sup>+ x. ereal (1 / Suc n) * indicator C' x \count_space UNIV" - using C'_def False by(simp add: nn_integral_cmult) - also have "\ = \\<^sup>+ x. \\<^sup>+ y. ereal (1 / Suc n) * indicator C' x * indicator {SOME y. (x, y) \ C} y \count_space UNIV \count_space UNIV" + have "\ = \\<^sup>+ x. ennreal (1 / Suc n) * indicator C' x \count_space UNIV" + using C'_def False by(simp add: nn_integral_cmult ennreal_mult_top) + also have "\ = \\<^sup>+ x. \\<^sup>+ y. ennreal (1 / Suc n) * indicator C' x * indicator {SOME y. (x, y) \ C} y \count_space UNIV \count_space UNIV" by(auto simp add: one_ereal_def[symmetric] max_def intro: nn_integral_cong) - also have "\ \ \\<^sup>+ x. \\<^sup>+ y. ereal (1 / Suc n) * indicator C (x, y) \count_space UNIV \count_space UNIV" + also have "\ \ \\<^sup>+ x. \\<^sup>+ y. ennreal (1 / Suc n) * indicator C (x, y) \count_space UNIV \count_space UNIV" by(intro nn_integral_mono)(auto simp add: C'_def split: split_indicator intro: someI) also have "\ \ ?lhs" using C - by(intro nn_integral_mono)(auto split: split_indicator simp add: nonneg) - finally show ?thesis by simp + by(intro nn_integral_mono)(auto split: split_indicator) + finally show ?thesis by (simp add: top_unique) qed ultimately show ?thesis by simp qed -lemma nn_integral_fst_count_space: - "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \count_space UNIV \count_space UNIV) = integral\<^sup>N (count_space UNIV) f" -by(subst (2 3) nn_integral_max_0[symmetric])(rule nn_integral_fst_count_space', simp) - lemma nn_integral_snd_count_space: "(\\<^sup>+ y. \\<^sup>+ x. f (x, y) \count_space UNIV \count_space UNIV) = integral\<^sup>N (count_space UNIV) f" (is "?lhs = ?rhs") @@ -1118,7 +1089,7 @@ interpret M: finite_measure M by fact interpret N: finite_measure N by fact show "emeasure (N \\<^sub>M M) (space (N \\<^sub>M M)) \ \" - by (auto simp: space_pair_measure M.emeasure_pair_measure_Times) + by (auto simp: space_pair_measure M.emeasure_pair_measure_Times ennreal_mult_eq_top_iff) qed end