# HG changeset patch # User hoelzl # Date 1349863941 -7200 # Node ID 92a58f80b20cd2216de9d47f9b3b9a58ee91318e # Parent 1484b4b828558277705479efffb38fda3e2521ad merge should operate on pairs diff -r 1484b4b82855 -r 92a58f80b20c src/HOL/Probability/Finite_Product_Measure.thy --- a/src/HOL/Probability/Finite_Product_Measure.thy Wed Oct 10 12:12:20 2012 +0200 +++ b/src/HOL/Probability/Finite_Product_Measure.thy Wed Oct 10 12:12:21 2012 +0200 @@ -44,45 +44,45 @@ unfolding extensional_def by auto definition - "merge I x J y = (\i. if i \ I then x i else if i \ J then y i else undefined)" + "merge I J = (\(x, y) i. if i \ I then x i else if i \ J then y i else undefined)" lemma merge_apply[simp]: - "I \ J = {} \ i \ I \ merge I x J y i = x i" - "I \ J = {} \ i \ J \ merge I x J y i = y i" - "J \ I = {} \ i \ I \ merge I x J y i = x i" - "J \ I = {} \ i \ J \ merge I x J y i = y i" - "i \ I \ i \ J \ merge I x J y i = undefined" + "I \ J = {} \ i \ I \ merge I J (x, y) i = x i" + "I \ J = {} \ i \ J \ merge I J (x, y) i = y i" + "J \ I = {} \ i \ I \ merge I J (x, y) i = x i" + "J \ I = {} \ i \ J \ merge I J (x, y) i = y i" + "i \ I \ i \ J \ merge I J (x, y) i = undefined" unfolding merge_def by auto lemma merge_commute: - "I \ J = {} \ merge I x J y = merge J y I x" + "I \ J = {} \ merge I J (x, y) = merge J I (y, x)" by (auto simp: merge_def intro!: ext) lemma Pi_cancel_merge_range[simp]: - "I \ J = {} \ x \ Pi I (merge I A J B) \ x \ Pi I A" - "I \ J = {} \ x \ Pi I (merge J B I A) \ x \ Pi I A" - "J \ I = {} \ x \ Pi I (merge I A J B) \ x \ Pi I A" - "J \ I = {} \ x \ Pi I (merge J B I A) \ x \ Pi I A" + "I \ J = {} \ x \ Pi I (merge I J (A, B)) \ x \ Pi I A" + "I \ J = {} \ x \ Pi I (merge J I (B, A)) \ x \ Pi I A" + "J \ I = {} \ x \ Pi I (merge I J (A, B)) \ x \ Pi I A" + "J \ I = {} \ x \ Pi I (merge J I (B, A)) \ x \ Pi I A" by (auto simp: Pi_def) lemma Pi_cancel_merge[simp]: - "I \ J = {} \ merge I x J y \ Pi I B \ x \ Pi I B" - "J \ I = {} \ merge I x J y \ Pi I B \ x \ Pi I B" - "I \ J = {} \ merge I x J y \ Pi J B \ y \ Pi J B" - "J \ I = {} \ merge I x J y \ Pi J B \ y \ Pi J B" + "I \ J = {} \ merge I J (x, y) \ Pi I B \ x \ Pi I B" + "J \ I = {} \ merge I J (x, y) \ Pi I B \ x \ Pi I B" + "I \ J = {} \ merge I J (x, y) \ Pi J B \ y \ Pi J B" + "J \ I = {} \ merge I J (x, y) \ Pi J B \ y \ Pi J B" by (auto simp: Pi_def) -lemma extensional_merge[simp]: "merge I x J y \ extensional (I \ J)" +lemma extensional_merge[simp]: "merge I J (x, y) \ extensional (I \ J)" by (auto simp: extensional_def) lemma restrict_Pi_cancel: "restrict x I \ Pi I A \ x \ Pi I A" by (auto simp: restrict_def Pi_def) lemma restrict_merge[simp]: - "I \ J = {} \ restrict (merge I x J y) I = restrict x I" - "I \ J = {} \ restrict (merge I x J y) J = restrict y J" - "J \ I = {} \ restrict (merge I x J y) I = restrict x I" - "J \ I = {} \ restrict (merge I x J y) J = restrict y J" + "I \ J = {} \ restrict (merge I J (x, y)) I = restrict x I" + "I \ J = {} \ restrict (merge I J (x, y)) J = restrict y J" + "J \ I = {} \ restrict (merge I J (x, y)) I = restrict x I" + "J \ I = {} \ restrict (merge I J (x, y)) J = restrict y J" by (auto simp: restrict_def) lemma extensional_insert_undefined[intro, simp]: @@ -95,7 +95,7 @@ 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)" +lemma merge_singleton[simp]: "i \ I \ merge I {i} (x,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)" @@ -118,24 +118,24 @@ 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)" + shows "(\x. (restrict x I, restrict x J)) -` (Pi\<^isub>E I E \ Pi\<^isub>E J F) = Pi (I \ J) (merge I J (E, 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" + shows "merge I J -` 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) 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" + "merge I J (restrict x I, y) = merge I J (x, y)" + "merge I J (x, restrict y J) = merge I J (x, y)" unfolding merge_def by auto lemma merge_x_x_eq_restrict[simp]: - "merge I x J x = restrict x (I \ J)" + "merge I J (x, x) = restrict x (I \ J)" unfolding merge_def by auto lemma Pi_fupd_iff: "i \ I \ f \ Pi I (B(i := A)) \ f \ Pi (I - {i}) B \ f i \ A" @@ -518,17 +518,17 @@ qed (auto simp: space_pair_measure space_PiM) lemma measurable_merge: - "(\(x, y). merge I x J y) \ measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) (Pi\<^isub>M (I \ J) M)" + "merge I J \ measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) (Pi\<^isub>M (I \ J) M)" (is "?f \ measurable ?P ?U") proof (rule measurable_PiM_single) fix i A assume A: "A \ sets (M i)" "i \ I \ J" - then have "{\ \ space ?P. prod_case (\x y. merge I x J y) \ i \ A} = + then have "{\ \ space ?P. merge I J \ i \ A} = (if i \ I then ((\x. x i) \ fst) -` A \ space ?P else ((\x. x i) \ snd) -` A \ space ?P)" by (auto simp: merge_def) also have "\ \ sets ?P" using A by (auto intro!: measurable_sets[OF measurable_comp, OF _ measurable_component_singleton]) - finally show "{\ \ space ?P. prod_case (\x y. merge I x J y) \ i \ A} \ sets ?P" . + finally show "{\ \ space ?P. merge I J \ i \ A} \ sets ?P" . qed (auto simp: space_pair_measure space_PiM Pi_iff merge_def extensional_def) lemma measurable_restrict: @@ -585,29 +585,34 @@ qed qed +lemma + shows space_PiM_empty: "space (Pi\<^isub>M {} M) = {\k. undefined}" + and sets_PiM_empty: "sets (Pi\<^isub>M {} M) = { {}, {\k. undefined} }" + by (simp_all add: space_PiM sets_PiM_single image_constant sigma_sets_empty_eq) + +lemma emeasure_PiM_empty[simp]: "emeasure (PiM {} M) {\_. undefined} = 1" +proof - + let ?\ = "\A. if A = {} then 0 else (1::ereal)" + have "emeasure (Pi\<^isub>M {} M) (prod_emb {} M {} (\\<^isub>E i\{}. {})) = 1" + proof (subst emeasure_extend_measure_Pair[OF PiM_def]) + show "positive (PiM {} M) ?\" + by (auto simp: positive_def) + show "countably_additive (PiM {} M) ?\" + by (rule countably_additiveI_finite) + (auto simp: additive_def positive_def sets_PiM_empty space_PiM_empty intro!: ) + qed (auto simp: prod_emb_def) + also have "(prod_emb {} M {} (\\<^isub>E i\{}. {})) = {\_. undefined}" + by (auto simp: prod_emb_def) + finally show ?thesis + by simp +qed + +lemma PiM_empty: "PiM {} M = count_space {\_. undefined}" + by (rule measure_eqI) (auto simp add: sets_PiM_empty one_ereal_def) + lemma (in product_sigma_finite) emeasure_PiM: "finite I \ (\i. i\I \ A i \ sets (M i)) \ emeasure (PiM I M) (Pi\<^isub>E I A) = (\i\I. emeasure (M i) (A i))" proof (induct I arbitrary: A rule: finite_induct) - case empty - let ?\ = "\A. if A = {} then 0 else (1::ereal)" - have "prod_algebra {} M = {{\_. undefined}}" - by (auto simp: prod_algebra_def prod_emb_def intro!: image_eqI) - then have sets_empty: "sets (PiM {} M) = {{}, {\_. undefined}}" - by (simp add: sets_PiM) - have "emeasure (Pi\<^isub>M {} M) (prod_emb {} M {} (\\<^isub>E i\{}. {})) = 1" - proof (subst emeasure_extend_measure_Pair[OF PiM_def]) - have "finite (space (PiM {} M))" - by (simp add: space_PiM) - moreover show "positive (PiM {} M) ?\" - by (auto simp: positive_def) - ultimately show "countably_additive (PiM {} M) ?\" - by (rule countably_additiveI_finite) (auto simp: additive_def space_PiM sets_empty) - qed (auto simp: prod_emb_def) - also have *: "(prod_emb {} M {} (\\<^isub>E i\{}. {})) = {\_. undefined}" - by (auto simp: prod_emb_def) - finally show ?case - using * by simp -next case (insert i I) interpret finite_product_sigma_finite M I by default fact have "finite (insert i I)" using `finite I` by auto @@ -660,7 +665,7 @@ qed (auto intro!: setprod_cong) with insert show ?case by (subst (asm) prod_emb_PiE_same_index) (auto intro!: sets_into_space) -qed +qed (simp add: emeasure_PiM_empty) lemma (in product_sigma_finite) sigma_finite: assumes "finite I" @@ -696,18 +701,6 @@ "(\i. i \ I \ A i \ sets (M i)) \ emeasure (Pi\<^isub>M I M) (Pi\<^isub>E I A) = (\i\I. emeasure (M i) (A i))" using emeasure_PiM[OF finite_index] by auto -lemma (in product_sigma_finite) product_measure_empty[simp]: - "emeasure (Pi\<^isub>M {} M) {\x. undefined} = 1" -proof - - interpret finite_product_sigma_finite M "{}" by default auto - from measure_times[of "\x. {}"] show ?thesis by simp -qed - -lemma - shows space_PiM_empty: "space (Pi\<^isub>M {} M) = {\k. undefined}" - and sets_PiM_empty: "sets (Pi\<^isub>M {} M) = { {}, {\k. undefined} }" - by (simp_all add: space_PiM sets_PiM_single image_constant sigma_sets_empty_eq) - lemma (in product_sigma_finite) positive_integral_empty: assumes pos: "0 \ f (\k. undefined)" shows "integral\<^isup>P (Pi\<^isub>M {} M) f = f (\k. undefined)" @@ -727,7 +720,7 @@ lemma (in product_sigma_finite) distr_merge: assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" - shows "distr (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) (Pi\<^isub>M (I \ J) M) (\(x,y). merge I x J y) = Pi\<^isub>M (I \ J) M" + shows "distr (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) (Pi\<^isub>M (I \ J) M) (merge I J) = Pi\<^isub>M (I \ J) M" (is "?D = ?P") proof - interpret I: finite_product_sigma_finite M I by default fact @@ -735,7 +728,7 @@ 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 "Pi\<^isub>M I M" "Pi\<^isub>M J M" by default - let ?g = "\(x,y). merge I x J y" + let ?g = "merge I J" from IJ.sigma_finite_pairs obtain F where F: "\i. i\ I \ J \ range (F i) \ sets (M i)" @@ -793,12 +786,12 @@ assumes IJ: "I \ J = {}" "finite I" "finite J" and f: "f \ borel_measurable (Pi\<^isub>M (I \ J) M)" shows "integral\<^isup>P (Pi\<^isub>M (I \ J) M) f = - (\\<^isup>+ x. (\\<^isup>+ y. f (merge I x J y) \(Pi\<^isub>M J M)) \(Pi\<^isub>M I M))" + (\\<^isup>+ x. (\\<^isup>+ y. f (merge I J (x, y)) \(Pi\<^isub>M J M)) \(Pi\<^isub>M I M))" proof - interpret I: finite_product_sigma_finite M I by default fact interpret J: finite_product_sigma_finite M J by default fact interpret P: pair_sigma_finite "Pi\<^isub>M I M" "Pi\<^isub>M J M" by default - have P_borel: "(\x. f (case x of (x, y) \ merge I x J y)) \ borel_measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" + have P_borel: "(\x. f (merge I J x)) \ borel_measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" using measurable_comp[OF measurable_merge f] by (simp add: comp_def) show ?thesis apply (subst distr_merge[OF IJ, symmetric]) @@ -833,7 +826,7 @@ qed lemma (in product_sigma_finite) product_positive_integral_insert: - assumes [simp]: "finite I" "i \ I" + assumes I[simp]: "finite I" "i \ I" and f: "f \ borel_measurable (Pi\<^isub>M (insert i I) M)" shows "integral\<^isup>P (Pi\<^isub>M (insert i I) M) f = (\\<^isup>+ x. (\\<^isup>+ y. f (x(i := y)) \(M i)) \(Pi\<^isub>M I M))" proof - @@ -842,17 +835,17 @@ have IJ: "I \ {i} = {}" and insert: "I \ {i} = insert i I" using f by auto show ?thesis - unfolding product_positive_integral_fold[OF IJ, unfolded insert, simplified, OF f] - proof (rule positive_integral_cong, subst product_positive_integral_singleton) + unfolding product_positive_integral_fold[OF IJ, unfolded insert, OF I(1) i.finite_index f] + proof (rule positive_integral_cong, subst product_positive_integral_singleton[symmetric]) fix x assume x: "x \ space (Pi\<^isub>M I M)" - 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 space_PiM) - show "?f \ borel_measurable (M i)" unfolding f'_eq + let ?f = "\y. f (x(i := y))" + show "?f \ borel_measurable (M i)" using measurable_comp[OF measurable_component_update f, OF x `i \ I`] unfolding comp_def . - show "integral\<^isup>P (M i) ?f = \\<^isup>+ y. f (x(i:=y)) \M i" - unfolding f'_eq by simp + show "(\\<^isup>+ y. f (merge I {i} (x, y)) \Pi\<^isub>M {i} M) = (\\<^isup>+ y. f (x(i := y i)) \Pi\<^isub>M {i} M)" + using x + by (auto intro!: positive_integral_cong arg_cong[where f=f] + simp add: space_PiM extensional_def) qed qed @@ -895,18 +888,18 @@ lemma (in product_sigma_finite) product_integral_fold: assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" and f: "integrable (Pi\<^isub>M (I \ J) M) f" - shows "integral\<^isup>L (Pi\<^isub>M (I \ J) M) f = (\x. (\y. f (merge I x J y) \Pi\<^isub>M J M) \Pi\<^isub>M I M)" + shows "integral\<^isup>L (Pi\<^isub>M (I \ J) M) f = (\x. (\y. f (merge I J (x, y)) \Pi\<^isub>M J M) \Pi\<^isub>M I 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 "Pi\<^isub>M I M" "Pi\<^isub>M J M" by default - let ?M = "\(x, y). merge I x J y" + let ?M = "merge I J" let ?f = "\x. f (?M x)" from f have f_borel: "f \ borel_measurable (Pi\<^isub>M (I \ J) M)" by auto - have P_borel: "(\x. f (case x of (x, y) \ merge I x J y)) \ borel_measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" + have P_borel: "(\x. f (merge I J x)) \ borel_measurable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" using measurable_comp[OF measurable_merge f_borel] by (simp add: comp_def) have f_int: "integrable (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) ?f" by (rule integrable_distr[OF measurable_merge]) (simp add: distr_merge[OF IJ fin] f) @@ -921,14 +914,14 @@ lemma (in product_sigma_finite) assumes IJ: "I \ J = {}" "finite I" "finite J" and A: "A \ sets (Pi\<^isub>M (I \ J) M)" shows emeasure_fold_integral: - "emeasure (Pi\<^isub>M (I \ J) M) A = (\\<^isup>+x. emeasure (Pi\<^isub>M J M) (merge I x J -` A \ space (Pi\<^isub>M J M)) \Pi\<^isub>M I M)" (is ?I) + "emeasure (Pi\<^isub>M (I \ J) M) A = (\\<^isup>+x. emeasure (Pi\<^isub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^isub>M J M)) \Pi\<^isub>M I M)" (is ?I) and emeasure_fold_measurable: - "(\x. emeasure (Pi\<^isub>M J M) (merge I x J -` A \ space (Pi\<^isub>M J M))) \ borel_measurable (Pi\<^isub>M I M)" (is ?B) + "(\x. emeasure (Pi\<^isub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^isub>M J M))) \ borel_measurable (Pi\<^isub>M I M)" (is ?B) proof - interpret I: finite_product_sigma_finite M I by default fact interpret J: finite_product_sigma_finite M J by default fact interpret IJ: pair_sigma_finite "Pi\<^isub>M I M" "Pi\<^isub>M J M" .. - have merge: "(\(x, y). merge I x J y) -` A \ space (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) \ sets (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" + have merge: "merge I J -` A \ space (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M) \ sets (Pi\<^isub>M I M \\<^isub>M Pi\<^isub>M J M)" by (intro measurable_sets[OF _ A] measurable_merge assms) show ?I @@ -950,7 +943,7 @@ proof - have "integral\<^isup>L (Pi\<^isub>M (insert i I) M) f = integral\<^isup>L (Pi\<^isub>M (I \ {i}) M) f" by simp - also have "\ = (\x. (\y. f (merge I x {i} y) \Pi\<^isub>M {i} M) \Pi\<^isub>M I M)" + also have "\ = (\x. (\y. f (merge I {i} (x,y)) \Pi\<^isub>M {i} M) \Pi\<^isub>M I M)" using f I by (intro product_integral_fold) auto also have "\ = (\x. (\y. f (x(i := y)) \M i) \Pi\<^isub>M I M)" proof (rule integral_cong, subst product_integral_singleton[symmetric]) @@ -960,7 +953,7 @@ show "(\y. f (x(i := y))) \ borel_measurable (M i)" using measurable_comp[OF measurable_component_update f_borel, OF x `i \ I`] unfolding comp_def . - from x I show "(\ y. f (merge I x {i} y) \Pi\<^isub>M {i} M) = (\ xa. f (x(i := xa i)) \Pi\<^isub>M {i} M)" + from x I show "(\ y. f (merge I {i} (x,y)) \Pi\<^isub>M {i} M) = (\ xa. f (x(i := xa i)) \Pi\<^isub>M {i} M)" by (auto intro!: integral_cong arg_cong[where f=f] simp: merge_def space_PiM extensional_def) qed finally show ?thesis . @@ -998,22 +991,24 @@ lemma (in product_sigma_finite) product_integral_setprod: fixes f :: "'i \ 'a \ real" - assumes "finite I" "I \ {}" and integrable: "\i. i \ I \ integrable (M i) (f i)" + assumes "finite I" and integrable: "\i. i \ I \ integrable (M i) (f i)" shows "(\x. (\i\I. f i (x i)) \Pi\<^isub>M I M) = (\i\I. integral\<^isup>L (M 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) +using assms proof induct + case empty + interpret finite_measure "Pi\<^isub>M {} M" + by rule (simp add: space_PiM) + show ?case by (simp add: space_PiM measure_def) next case (insert i I) then have iI: "finite (insert i I)" by auto then have prod: "\J. J \ insert i I \ integrable (Pi\<^isub>M J M) (\x. (\i\J. f i (x i)))" - by (intro product_integrable_setprod insert(5)) (auto intro: finite_subset) + by (intro product_integrable_setprod insert(4)) (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]] + unfolding product_integral_insert[OF insert(1,2) prod[OF subset_refl]] by (simp add: * insert integral_multc integral_cmult[OF prod] subset_insertI) qed diff -r 1484b4b82855 -r 92a58f80b20c src/HOL/Probability/Infinite_Product_Measure.thy --- a/src/HOL/Probability/Infinite_Product_Measure.thy Wed Oct 10 12:12:20 2012 +0200 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy Wed Oct 10 12:12:21 2012 +0200 @@ -14,10 +14,10 @@ lemma restrict_restrict[simp]: "restrict (restrict f A) B = restrict f (A \ B)" unfolding restrict_def by (simp add: fun_eq_iff) -lemma split_merge: "P (merge I x J y i) \ (i \ I \ P (x i)) \ (i \ J - I \ P (y i)) \ (i \ I \ J \ P undefined)" +lemma split_merge: "P (merge I J (x,y) i) \ (i \ I \ P (x i)) \ (i \ J - I \ P (y i)) \ (i \ I \ J \ P undefined)" unfolding merge_def by auto -lemma extensional_merge_sub: "I \ J \ K \ merge I x J y \ extensional K" +lemma extensional_merge_sub: "I \ J \ K \ merge I J (x, y) \ extensional K" unfolding merge_def extensional_def by auto lemma injective_vimage_restrict: @@ -32,7 +32,7 @@ show "x \ A \ x \ B" proof cases assume x: "x \ (\\<^isub>E i\J. S i)" - have "x \ A \ merge J x (I - J) y \ (\x. restrict x J) -` A \ (\\<^isub>E i\I. S i)" + have "x \ A \ merge J (I - J) (x,y) \ (\x. restrict x J) -` A \ (\\<^isub>E i\I. S i)" using y x `J \ I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub split: split_merge) then show "x \ A \ x \ B" using y x `J \ I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub eq split: split_merge) @@ -131,7 +131,7 @@ show "X \ (\\<^isub>E i\J. space (M i))" "Y \ (\\<^isub>E i\J. space (M i))" using sets[THEN sets_into_space] by (auto simp: space_PiM) have "\i\L. \x. x \ space (M i)" - using M.not_empty by auto + using M.not_empty by auto from bchoice[OF this] show "(\\<^isub>E i\L. space (M i)) \ {}" by auto show "(\x. restrict x J) -` X \ (\\<^isub>E i\L. space (M i)) = (\x. restrict x J) -` Y \ (\\<^isub>E i\L. space (M i))" @@ -230,23 +230,19 @@ qed lemma (in product_prob_space) merge_sets: - assumes "finite J" "finite K" "J \ K = {}" and A: "A \ sets (Pi\<^isub>M (J \ K) M)" and x: "x \ space (Pi\<^isub>M J M)" - shows "merge J x K -` A \ space (Pi\<^isub>M K M) \ sets (Pi\<^isub>M K M)" -proof - - from sets_Pair1[OF - measurable_merge[THEN measurable_sets, OF `J \ K = {}`], OF A, of x] x - show ?thesis - by (simp add: space_pair_measure comp_def vimage_compose[symmetric]) -qed + assumes "J \ K = {}" and A: "A \ sets (Pi\<^isub>M (J \ K) M)" and x: "x \ space (Pi\<^isub>M J M)" + shows "(\y. merge J K (x,y)) -` A \ space (Pi\<^isub>M K M) \ sets (Pi\<^isub>M K M)" + by (rule measurable_sets[OF _ A] measurable_compose[OF measurable_Pair measurable_merge] + measurable_const x measurable_ident)+ lemma (in product_prob_space) merge_emb: assumes "K \ I" "J \ I" and y: "y \ space (Pi\<^isub>M J M)" - shows "(merge J y (I - J) -` emb I K X \ space (Pi\<^isub>M I M)) = - emb I (K - J) (merge J y (K - J) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M))" + shows "((\x. merge J (I - J) (y, x)) -` emb I K X \ space (Pi\<^isub>M I M)) = + emb I (K - J) ((\x. merge J (K - J) (y, x)) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M))" proof - - have [simp]: "\x J K L. merge J y K (restrict x L) = merge J y (K \ L) x" + have [simp]: "\x J K L. merge J K (y, restrict x L) = merge J (K \ L) (y, x)" by (auto simp: restrict_def merge_def) - have [simp]: "\x J K L. restrict (merge J y K x) L = merge (J \ L) y (K \ L) x" + have [simp]: "\x J K L. restrict (merge J K (y, x)) L = merge (J \ L) (K \ L) (y, x)" by (auto simp: restrict_def merge_def) have [simp]: "(I - J) \ K = K - J" using `K \ I` `J \ I` by auto have [simp]: "(K - J) \ (K \ J) = K - J" by auto @@ -331,16 +327,16 @@ "K - J \ {}" "K - J \ I" "\G Z = emeasure (Pi\<^isub>M K M) X" by (auto simp: subset_insertI) - let ?M = "\y. merge J y (K - J) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M)" + let ?M = "\y. (\x. merge J (K - J) (y, x)) -` emb (J \ K) K X \ space (Pi\<^isub>M (K - J) M)" { fix y assume y: "y \ space (Pi\<^isub>M J M)" note * = merge_emb[OF `K \ I` `J \ I` y, of X] moreover have **: "?M y \ sets (Pi\<^isub>M (K - J) M)" using J K y by (intro merge_sets) auto ultimately - have ***: "(merge J y (I - J) -` Z \ space (Pi\<^isub>M I M)) \ ?G" + have ***: "((\x. merge J (I - J) (y, x)) -` Z \ space (Pi\<^isub>M I M)) \ ?G" using J K by (intro generatorI) auto - have "\G (merge J y (I - J) -` emb I K X \ space (Pi\<^isub>M I M)) = emeasure (Pi\<^isub>M (K - J) M) (?M y)" + have "\G ((\x. merge J (I - J) (y, x)) -` emb I K X \ space (Pi\<^isub>M I M)) = emeasure (Pi\<^isub>M (K - J) M) (?M y)" unfolding * using K J by (subst \G_eq[OF _ _ _ **]) auto note * ** *** this } note merge_in_G = this @@ -354,7 +350,7 @@ using K J by simp also have "\ = (\\<^isup>+ x. emeasure (Pi\<^isub>M (K - J) M) (?M x) \Pi\<^isub>M J M)" using K J by (subst emeasure_fold_integral) auto - also have "\ = (\\<^isup>+ y. \G (merge J y (I - J) -` Z \ space (Pi\<^isub>M I M)) \Pi\<^isub>M J M)" + also have "\ = (\\<^isup>+ y. \G ((\x. merge J (I - J) (y, x)) -` Z \ space (Pi\<^isub>M I M)) \Pi\<^isub>M J M)" (is "_ = (\\<^isup>+x. \G (?MZ x) \Pi\<^isub>M J M)") proof (intro positive_integral_cong) fix x assume x: "x \ space (Pi\<^isub>M J M)" @@ -370,7 +366,7 @@ by (intro KmJ.measure_le_1 merge_in_G(2)[OF x]) } note le_1 = this - let ?q = "\y. \G (merge J y (I - J) -` Z \ space (Pi\<^isub>M I M))" + let ?q = "\y. \G ((\x. merge J (I - J) (y,x)) -` Z \ space (Pi\<^isub>M I M))" have "?q \ borel_measurable (Pi\<^isub>M J M)" unfolding `Z = emb I K X` using J K merge_in_G(3) by (simp add: merge_in_G \G_eq emeasure_fold_measurable cong: measurable_cong) @@ -416,7 +412,7 @@ using \G_spec[of "J 0" "A 0" "X 0"] J A_eq by (auto intro!: INF_lower2[of 0] J.measure_le_1) - let ?M = "\K Z y. merge K y (I - K) -` Z \ space (Pi\<^isub>M I M)" + let ?M = "\K Z y. (\x. merge K (I - K) (y, x)) -` Z \ space (Pi\<^isub>M I M)" { fix Z k assume Z: "range Z \ ?G" "decseq Z" "\n. ?a / 2^k \ \G (Z n)" then have Z_sets: "\n. Z n \ ?G" by auto @@ -524,9 +520,9 @@ from Ex_w[OF this `?D \ {}`] J[of "Suc k"] obtain w' where w': "w' \ space (Pi\<^isub>M ?D M)" "\n. ?a / 2 ^ (Suc k + 1) \ \G (?M ?D (?M (J k) (A n) (w k)) w')" by auto - let ?w = "merge (J k) (w k) ?D w'" - have [simp]: "\x. merge (J k) (w k) (I - J k) (merge ?D w' (I - ?D) x) = - merge (J (Suc k)) ?w (I - (J (Suc k))) x" + let ?w = "merge (J k) ?D (w k, w')" + have [simp]: "\x. merge (J k) (I - J k) (w k, merge ?D (I - ?D) (w', x)) = + merge (J (Suc k)) (I - (J (Suc k))) (?w, x)" using J(3)[of "Suc k"] J(3)[of k] J_mono[of k "Suc k"] by (auto intro!: ext split: split_merge) have *: "\n. ?M ?D (?M (J k) (A n) (w k)) w' = ?M (J (Suc k)) (A n) ?w" @@ -552,7 +548,7 @@ using positive_\G[OF I_not_empty, unfolded positive_def] `0 < ?a` `?a \ 1` by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq) then obtain x where "x \ ?M (J k) (A k) (w k)" by auto - then have "merge (J k) (w k) (I - J k) x \ A k" by auto + then have "merge (J k) (I - J k) (w k, x) \ A k" by auto then have "\x\A k. restrict x (J k) = w k" using `w k \ space (Pi\<^isub>M (J k) M)` by (intro rev_bexI) (auto intro!: ext simp: extensional_def space_PiM)