Quelle Finite_Product_Measure.thy
Sprache: Isabelle
(* Title: HOL/Analysis/Finite_Product_Measure.thy Author: Johannes Hölzl, TU München
*)
section \<open>Finite Product Measure\<close>
theory Finite_Product_Measure imports Binary_Product_Measure Function_Topology begin
lemma Pi_choice: "(\i\I. \x\F i. P i x) \ (\f\Pi I F. \i\I. P i (f i))" by (metis Pi_iff)
lemma PiE_choice: "(\i\I. \x\F i. P i x) \(\f\Pi\<^sub>E I F. \i\I. P i (f i))" unfolding Pi_choice by (metis Int_iff PiE_def restrict_PiE restrict_apply)
lemma case_prod_const: "(\(i, j). c) = (\_. c)" by auto
subsection\<^marker>\<open>tag unimportant\<close> \<open>More about Function restricted by \<^const>\<open>extensional\<close>\<close>
definition "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 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 J (x, y) = merge J I (y, x)" by (force simp: merge_def)
lemma Pi_cancel_merge_range[simp]: "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 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 J (x, y) \ extensional (I \ J)" by (auto simp: extensional_def)
lemma restrict_merge[simp]: "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 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 PiE_cancel_merge[simp]: "I \ J = {} \
merge I J (x, y) \<in> Pi\<^sub>E (I \<union> J) B \<longleftrightarrow> x \<in> Pi I B \<and> y \<in> Pi J B" by (auto simp: PiE_def restrict_Pi_cancel)
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 extensional_merge_sub: "I \ J \ K \ merge I J (x, y) \ extensional K" unfolding merge_def extensional_def by auto
lemma merge_restrict[simp]: "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 J (x, x) = restrict x (I \ J)" unfolding merge_def by auto
lemma injective_vimage_restrict: assumes J: "J \ I" and sets: "A \ (\\<^sub>E i\J. S i)" "B \ (\\<^sub>E i\J. S i)" and ne: "(\\<^sub>E i\I. S i) \ {}" and eq: "(\x. restrict x J) -` A \ (\\<^sub>E i\I. S i) = (\x. restrict x J) -` B \ (\\<^sub>E i\I. S i)" shows"A = B" proof (intro set_eqI) fix x from ne obtain y where y: "\i. i \ I \ y i \ S i" by auto have"J \ (I - J) = {}" by auto show"x \ A \ x \ B" proof cases assume x: "x \ (\\<^sub>E i\J. S i)" have"x \ A \ merge J (I - J) (x,y) \ (\x. restrict x J) -` A \ (\\<^sub>E i\I. S i)" using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S] by (auto simp del: PiE_cancel_merge simp add: Un_absorb1) thenshow"x \ A \ x \ B" using y x \<open>J \<subseteq> I\<close> PiE_cancel_merge[of "J" "I - J" x y S] by (auto simp del: PiE_cancel_merge simp add: Un_absorb1 eq) qed (use sets in auto) qed
lemma restrict_vimage: "I \ J = {} \
(\<lambda>x. (restrict x I, restrict x J)) -` (Pi\<^sub>E I E \<times> Pi\<^sub>E J F) = Pi (I \<union> J) (merge I J (E, F))" by (auto simp: restrict_Pi_cancel PiE_def)
lemma merge_vimage: "I \ J = {} \ merge I J -` Pi\<^sub>E (I \ J) E = Pi I E \ Pi J E" by (auto simp: restrict_Pi_cancel PiE_def)
subsection \<open>Finite product spaces\<close>
definition\<^marker>\<open>tag important\<close> prod_emb where "prod_emb I M K X = (\x. restrict x K) -` X \ (\\<^sub>E i\I. space (M i))"
lemma prod_emb_iff: "f \ prod_emb I M K X \ f \ extensional I \ (restrict f K \ X) \ (\i\I. f i \ space (M i))" unfolding prod_emb_def PiE_def by auto
lemma shows prod_emb_empty[simp]: "prod_emb M L K {} = {}" and prod_emb_Un[simp]: "prod_emb M L K (A \ B) = prod_emb M L K A \ prod_emb M L K B" and prod_emb_Int: "prod_emb M L K (A \ B) = prod_emb M L K A \ prod_emb M L K B" and prod_emb_UN[simp]: "prod_emb M L K (\i\I. F i) = (\i\I. prod_emb M L K (F i))" and prod_emb_INT[simp]: "I \ {} \ prod_emb M L K (\i\I. F i) = (\i\I. prod_emb M L K (F i))" and prod_emb_Diff[simp]: "prod_emb M L K (A - B) = prod_emb M L K A - prod_emb M L K B" by (auto simp: prod_emb_def)
lemma prod_emb_PiE: "J \ I \ (\i. i \ J \ E i \ space (M i)) \
prod_emb I M J (\<Pi>\<^sub>E i\<in>J. E i) = (\<Pi>\<^sub>E i\<in>I. if i \<in> J then E i else space (M i))" by (force simp: prod_emb_def PiE_iff if_split_mem2)
lemma prod_emb_PiE_same_index[simp]: "(\i. i \ I \ E i \ space (M i)) \ prod_emb I M I (Pi\<^sub>E I E) = Pi\<^sub>E I E" by (auto simp: prod_emb_def PiE_iff)
lemma prod_emb_trans[simp]: "J \ K \ K \ L \ prod_emb L M K (prod_emb K M J X) = prod_emb L M J X" by (auto simp add: Int_absorb1 prod_emb_def PiE_def)
lemma prod_emb_Pi: assumes"X \ (\ j\J. sets (M j))" "J \ K" shows"prod_emb K M J (Pi\<^sub>E J X) = (\\<^sub>E i\K. if i \ J then X i else space (M i))" using assms sets.space_closed by (auto simp: prod_emb_def PiE_iff split: if_split_asm) blast+
lemma prod_emb_id: "B \ (\\<^sub>E i\L. space (M i)) \ prod_emb L M L B = B" by (auto simp: prod_emb_def subset_eq extensional_restrict)
lemma prod_emb_mono: "F \ G \ prod_emb A M B F \ prod_emb A M B G" by (auto simp: prod_emb_def)
definition\<^marker>\<open>tag important\<close> PiM :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a measure) \<Rightarrow> ('i \<Rightarrow> 'a) measure" where "PiM I M = extend_measure (\\<^sub>E i\I. space (M i))
{(J, X). (J \<noteq> {} \<or> I = {}) \<and> finite J \<and> J \<subseteq> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
(\<lambda>(J, X). prod_emb I M J (\<Pi>\<^sub>E j\<in>J. X j))
(\<lambda>(J, X). \<Prod>j\<in>J \<union> {i\<in>I. emeasure (M i) (space (M i)) \<noteq> 1}. if j \<in> J then emeasure (M j) (X j) else emeasure (M j) (space (M j)))"
definition\<^marker>\<open>tag important\<close> prod_algebra :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a measure) \<Rightarrow> ('i \<Rightarrow> 'a) set set" where "prod_algebra I M = (\(J, X). prod_emb I M J (\\<^sub>E j\J. X j)) `
{(J, X). (J \<noteq> {} \<or> I = {}) \<and> finite J \<and> J \<subseteq> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}"
lemma extend_measure_cong: assumes"\ = \'" "I = I'" "G = G'" "\i. i \ I' \ \ i = \' i" shows"extend_measure \ I G \ = extend_measure \' I' G' \'" unfolding extend_measure_def by (auto simp add: assms)
lemma Pi_cong_sets: "\I = J; \x. x \ I \ M x = N x\ \ Pi I M = Pi J N" by auto
lemma PiM_cong: assumes"I = J""\x. x \ I \ M x = N x" shows"PiM I M = PiM J N" unfolding PiM_def proof (rule extend_measure_cong, goal_cases) case 1 show ?caseusing assms by (subst assms(1), intro PiE_cong[of J "\i. space (M i)" "\i. space (N i)"]) simp_all next case 2 have"\K. K \ J \ (\ j\K. sets (M j)) = (\ j\K. sets (N j))" using assms by (intro Pi_cong_sets) auto thus ?caseby (auto simp: assms) next case 3 show ?caseusing assms by (intro ext) (auto simp: prod_emb_def dest: PiE_mem) next case (4 x) thus ?caseusing assms by (auto intro!: prod.cong split: if_split_asm) qed
lemma prod_algebra_sets_into_space: "prod_algebra I M \ Pow (\\<^sub>E i\I. space (M i))" by (auto simp: prod_emb_def prod_algebra_def)
lemma prod_algebra_eq_finite: assumes I: "finite I" shows"prod_algebra I M = {(\\<^sub>E i\I. X i) |X. X \ (\ j\I. sets (M j))}" (is "?L = ?R") proof (intro iffI set_eqI) fix A assume"A \ ?L" thenobtain J E where J: "J \ {} \ I = {}" "finite J" "J \ I" "\i\J. E i \ sets (M i)" and A: "A = prod_emb I M J (\\<^sub>E j\J. E j)" by (auto simp: prod_algebra_def) let ?A = "\\<^sub>E i\I. if i \ J then E i else space (M i)" have A: "A = ?A" unfolding A using J by (intro prod_emb_PiE sets.sets_into_space) auto show"A \ ?R" unfolding A using J sets.top by (intro CollectI exI[of _ "\i. if i \ J then E i else space (M i)"]) simp next fix A assume"A \ ?R" thenobtain X where A: "A = (\\<^sub>E i\I. X i)" and X: "X \ (\ j\I. sets (M j))" by auto thenhave A: "A = prod_emb I M I (\\<^sub>E i\I. X i)" by (simp add: prod_emb_PiE_same_index[OF sets.sets_into_space] Pi_iff) from X I show"A \ ?L" unfolding A by (auto simp: prod_algebra_def) qed
lemma prod_algebraI: "finite J \ (J \ {} \ I = {}) \ J \ I \ (\i. i \ J \ E i \ sets (M i)) \<Longrightarrow> prod_emb I M J (\<Pi>\<^sub>E j\<in>J. E j) \<in> prod_algebra I M" by (auto simp: prod_algebra_def)
lemma prod_algebraI_finite: "finite I \ (\i\I. E i \ sets (M i)) \ (Pi\<^sub>E I E) \ prod_algebra I M" using prod_algebraI[of I I E M] prod_emb_PiE_same_index[of I E M, OF sets.sets_into_space] by simp
lemma Int_stable_PiE: "Int_stable {Pi\<^sub>E J E | E. \i\I. E i \ sets (M i)}" proof (safe intro!: Int_stableI) fix E F assume"\i\I. E i \ sets (M i)" "\i\I. F i \ sets (M i)" thenshow"\G. Pi\<^sub>E J E \ Pi\<^sub>E J F = Pi\<^sub>E J G \ (\i\I. G i \ sets (M i))" by (auto intro!: exI[of _ "\i. E i \ F i"] simp: PiE_Int) qed
lemma prod_algebraE: assumes A: "A \ prod_algebra I M" obtains J E where"A = prod_emb I M J (\\<^sub>E j\J. E j)" "finite J""J \ {} \ I = {}" "J \ I" "\i. i \ J \ E i \ sets (M i)" using A by (auto simp: prod_algebra_def)
lemma prod_algebraE_all: assumes A: "A \ prod_algebra I M" obtains E where"A = Pi\<^sub>E I E" "E \ (\ i\I. sets (M i))" proof - from A obtain E J where A: "A = prod_emb I M J (Pi\<^sub>E J E)" and J: "J \ I" and E: "E \ (\ i\J. sets (M i))" by (auto simp: prod_algebra_def) from E have"\i. i \ J \ E i \ space (M i)" using sets.sets_into_space by auto thenhave"A = (\\<^sub>E i\I. if i\J then E i else space (M i))" using A J by (auto simp: prod_emb_PiE) moreoverhave"(\i. if i\J then E i else space (M i)) \ (\ i\I. sets (M i))" using sets.top E by auto ultimatelyshow ?thesis using that by auto qed
lemma Int_stable_prod_algebra: "Int_stable (prod_algebra I M)" unfolding Int_stable_def proof safe fix A assume"A \ prod_algebra I M" from prod_algebraE[OF this] obtain J E where A: "A = prod_emb I M J (Pi\<^sub>E J E)" "finite J" "J \ {} \ I = {}" "J \ I" "\i. i \ J \ E i \ sets (M i)" by auto fix B assume"B \ prod_algebra I M" from prod_algebraE[OF this] obtain K F where B: "B = prod_emb I M K (Pi\<^sub>E K F)" "finite K" "K \ {} \ I = {}" "K \ I" "\i. i \ K \ F i \ sets (M i)" by auto have"A \ B = prod_emb I M (J \ K) (\\<^sub>E i\J \ K. (if i \ J then E i else space (M i)) \
(if i \<in> K then F i else space (M i)))" unfolding A B using A(2,3,4) A(5)[THEN sets.sets_into_space] B(2,3,4)
B(5)[THEN sets.sets_into_space] apply (subst (1 2 3) prod_emb_PiE) apply (simp_all add: subset_eq PiE_Int) apply blast apply (intro PiE_cong) apply auto done alsohave"\ \ prod_algebra I M" using A B by (auto intro!: prod_algebraI) finallyshow"A \ B \ prod_algebra I M" . qed
proposition prod_algebra_mono: assumes space: "\i. i \ I \ space (E i) = space (F i)" assumes sets: "\i. i \ I \ sets (E i) \ sets (F i)" shows"prod_algebra I E \ prod_algebra I F" proof fix A assume"A \ prod_algebra I E" thenobtain J G where J: "J \ {} \ I = {}" "finite J" "J \ I" and A: "A = prod_emb I E J (\\<^sub>E i\J. G i)" and G: "\i. i \ J \ G i \ sets (E i)" by (auto simp: prod_algebra_def) moreover from space have"(\\<^sub>E i\I. space (E i)) = (\\<^sub>E i\I. space (F i))" by (rule PiE_cong) with A have"A = prod_emb I F J (\\<^sub>E i\J. G i)" by (simp add: prod_emb_def) moreover from sets G J have"\i. i \ J \ G i \ sets (F i)" by auto ultimatelyshow"A \ prod_algebra I F" apply (simp add: prod_algebra_def image_iff) apply (intro exI[of _ J] exI[of _ G] conjI) apply auto done qed
proposition prod_algebra_cong: assumes"I = J"and"(\i. i \ I \ sets (M i) = sets (N i))" shows"prod_algebra I M = prod_algebra J N" by (metis assms prod_algebra_mono sets_eq_imp_space_eq subsetI subset_antisym)
lemma space_in_prod_algebra: "(\\<^sub>E i\I. space (M i)) \ prod_algebra I M" proof cases assume"I = {}"thenshow ?thesis by (auto simp add: prod_algebra_def image_iff prod_emb_def) next assume"I \ {}" thenobtain i where"i \ I" by auto thenhave"(\\<^sub>E i\I. space (M i)) = prod_emb I M {i} (\\<^sub>E i\{i}. space (M i))" by (auto simp: prod_emb_def) thenshow ?thesis by (simp add: \<open>i \<in> I\<close> prod_algebraI) qed
lemma space_PiM: "space (\\<^sub>M i\I. M i) = (\\<^sub>E i\I. space (M i))" using prod_algebra_sets_into_space unfolding PiM_def prod_algebra_def by (intro space_extend_measure) simp
lemma prod_emb_subset_PiM[simp]: "prod_emb I M K X \ space (PiM I M)" by (auto simp: prod_emb_def space_PiM)
lemma space_PiM_empty_iff[simp]: "space (PiM I M) = {} \ (\i\I. space (M i) = {})" by (auto simp: space_PiM PiE_eq_empty_iff)
lemma undefined_in_PiM_empty[simp]: "(\x. undefined) \ space (PiM {} M)" by (auto simp: space_PiM)
lemma sets_PiM: "sets (\\<^sub>M i\I. M i) = sigma_sets (\\<^sub>E i\I. space (M i)) (prod_algebra I M)" using prod_algebra_sets_into_space unfolding PiM_def prod_algebra_def by (intro sets_extend_measure) simp
proposition sets_PiM_single: "sets (PiM I M) =
sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) {{f\<in>\<Pi>\<^sub>E i\<in>I. space (M i). f i \<in> A} | i A. i \<in> I \<and> A \<in> sets (M i)}"
(is"_ = sigma_sets ?\ ?R") unfolding sets_PiM proof (rule sigma_sets_eqI) interpret R: sigma_algebra ?\<Omega> "sigma_sets ?\<Omega> ?R" by (rule sigma_algebra_sigma_sets) auto fix A assume"A \ prod_algebra I M" from prod_algebraE[OF this] obtain J X where X: "A = prod_emb I M J (Pi\<^sub>E J X)" "finite J" "J \ {} \ I = {}" "J \ I" "\i. i \ J \ X i \ sets (M i)" by auto show"A \ sigma_sets ?\ ?R" proof cases assume"I = {}" with X show ?thesis by (metis (no_types, lifting) PiE_cong R.top empty_iff prod_emb_PiE subset_eq) next assume"I \ {}" with X have"A = (\j\J. {f\(\\<^sub>E i\I. space (M i)). f j \ X j})" by (auto simp: prod_emb_def) alsohave"\ \ sigma_sets ?\ ?R" using X \<open>I \<noteq> {}\<close> by (intro R.finite_INT sigma_sets.Basic) auto finallyshow"A \ sigma_sets ?\ ?R" . qed next fix A assume"A \ ?R" thenobtain i B where A: "A = {f\\\<^sub>E i\I. space (M i). f i \ B}" "i \ I" "B \ sets (M i)" by auto thenhave"A = prod_emb I M {i} (\\<^sub>E i\{i}. B)" by (auto simp: prod_emb_def) alsohave"\ \ sigma_sets ?\ (prod_algebra I M)" using A by (intro sigma_sets.Basic prod_algebraI) auto finallyshow"A \ sigma_sets ?\ (prod_algebra I M)" . qed
lemma sets_PiM_eq_proj: assumes"I \ {}" shows"sets (PiM I M) = sets (SUP i\I. vimage_algebra (\\<^sub>E i\I. space (M i)) (\x. x i) (M i))"
(is"?lhs = ?rhs") proof - have"?lhs =
sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) {{f \<in> \<Pi>\<^sub>E i\<in>I. space (M i). f i \<in> A} |i A. i \<in> I \<and> A \<in> sets (M i)}" by (simp add: sets_PiM_single) alsohave"\ = sigma_sets (\\<^sub>E i\I. space (M i))
(\<Union>x\<in>I. sets (vimage_algebra (\<Pi>\<^sub>E i\<in>I. space (M i)) (\<lambda>xa. xa x) (M x)))" apply (subst arg_cong [of _ _ Sup, OF image_cong, OF refl]) apply (rule sets_vimage_algebra2) by (auto intro!: arg_cong2[where f=sigma_sets]) alsohave"... = sigma_sets (\\<^sub>E i\I. space (M i))
(\<Union> (sets ` (\<lambda>i. vimage_algebra (\<Pi>\<^sub>E i\<in>I. space (M i)) (\<lambda>x. x i) (M i)) ` I))" by simp alsohave"... = ?rhs" by (subst sets_Sup_eq[where X="\\<^sub>E i\I. space (M i)"]) (use assms in auto) finallyshow ?thesis . qed
lemma shows space_PiM_empty: "space (Pi\<^sub>M {} M) = {\k. undefined}" and sets_PiM_empty: "sets (Pi\<^sub>M {} M) = { {}, {\k. undefined} }" by (simp_all add: space_PiM sets_PiM_single image_constant sigma_sets_empty_eq)
proposition sets_PiM_sigma: assumes\<Omega>_cover: "\<And>i. i \<in> I \<Longrightarrow> \<exists>S\<subseteq>E i. countable S \<and> \<Omega> i = \<Union>S" assumes E: "\i. i \ I \ E i \ Pow (\ i)" assumes J: "\j. j \ J \ finite j" "\J = I" defines"P \ {{f\(\\<^sub>E i\I. \ i). \i\j. f i \ A i} | A j. j \ J \ A \ Pi j E}" shows"sets (\\<^sub>M i\I. sigma (\ i) (E i)) = sets (sigma (\\<^sub>E i\I. \ i) P)" proof cases assume"I = {}" with\<open>\<Union>J = I\<close> have "P = {{\<lambda>_. undefined}} \<or> P = {}" by (auto simp: P_def) with\<open>I = {}\<close> show ?thesis by (auto simp add: sets_PiM_empty sigma_sets_empty_eq) next let ?F = "\i. {(\x. x i) -` A \ Pi\<^sub>E I \ |A. A \ E i}" assume"I \ {}" thenhave"sets (Pi\<^sub>M I (\i. sigma (\ i) (E i))) =
sets (SUP i\<in>I. vimage_algebra (\<Pi>\<^sub>E i\<in>I. \<Omega> i) (\<lambda>x. x i) (sigma (\<Omega> i) (E i)))" by (subst sets_PiM_eq_proj) (auto simp: space_measure_of_conv) alsohave"\ = sets (SUP i\I. sigma (Pi\<^sub>E I \) (?F i))" using E by (intro sets_SUP_cong arg_cong[where f=sets] vimage_algebra_sigma) auto alsohave"\ = sets (sigma (Pi\<^sub>E I \) (\i\I. ?F i))" using\<open>I \<noteq> {}\<close> by (intro arg_cong[where f=sets] SUP_sigma_sigma) auto alsohave"\ = sets (sigma (Pi\<^sub>E I \) P)" proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI) show"(\i\I. ?F i) \ Pow (Pi\<^sub>E I \)" "P \ Pow (Pi\<^sub>E I \)" by (auto simp: P_def) next interpret P: sigma_algebra "\\<^sub>E i\I. \ i" "sigma_sets (\\<^sub>E i\I. \ i) P" by (auto intro!: sigma_algebra_sigma_sets simp: P_def)
fix Z assume"Z \ (\i\I. ?F i)" thenobtain i A where i: "i \ I" "A \ E i" and Z_def: "Z = (\x. x i) -` A \ Pi\<^sub>E I \" by auto from\<open>i \<in> I\<close> J obtain j where j: "i \<in> j" "j \<in> J" "j \<subseteq> I" "finite j" by auto obtain S where S: "\i. i \ j \ S i \ E i" "\i. i \ j \ countable (S i)" "\i. i \ j \ \ i = \(S i)" by (metis subset_eq \<Omega>_cover \<open>j \<subseteq> I\<close>)
define A' where "A' n = n(i := A)" for n thenhave A'_i: "\n. A' n i = A" by simp
{ fix n assume"n \ Pi\<^sub>E (j - {i}) S" thenhave"A' n \ Pi j E" unfolding PiE_def Pi_def using S(1) by (auto simp: A'_def \A \ E i\ ) with\<open>j \<in> J\<close> have "{f \<in> Pi\<^sub>E I \<Omega>. \<forall>i\<in>j. f i \<in> A' n i} \<in> P" by (auto simp: P_def) } note A'_in_P = this
{ fix x assume"x i \ A" "x \ Pi\<^sub>E I \" with S(3) \<open>j \<subseteq> I\<close> have "\<forall>i\<in>j. \<exists>s\<in>S i. x i \<in> s" by (auto simp: PiE_def Pi_def) thenobtain s where s: "\i. i \ j \ s i \ S i" "\i. i \ j \ x i \ s i" by metis with\<open>x i \<in> A\<close> have "\<exists>n\<in>Pi\<^sub>E (j-{i}) S. \<forall>i\<in>j. x i \<in> A' n i" by (intro bexI[of _ "restrict (s(i := A)) (j-{i})"]) (auto simp: A'_def split: if_splits) } thenhave"Z = (\n\Pi\<^sub>E (j-{i}) S. {f\(\\<^sub>E i\I. \ i). \i\j. f i \ A' n i})" unfolding Z_def by (auto simp add: set_eq_iff ball_conj_distrib \<open>i\<in>j\<close> A'_i dest: bspec[OF _ \<open>i\<in>j\<close>]
cong: conj_cong) alsohave"\ \ sigma_sets (\\<^sub>E i\I. \ i) P" using\<open>finite j\<close> S(2) by (intro P.countable_UN' countable_PiE) (simp_all add: image_subset_iff A'_in_P) finallyshow"Z \ sigma_sets (\\<^sub>E i\I. \ i) P" . next interpret F: sigma_algebra "\\<^sub>E i\I. \ i" "sigma_sets (\\<^sub>E i\I. \ i) (\i\I. ?F i)" by (auto intro!: sigma_algebra_sigma_sets)
fix b assume"b \ P" thenobtain A j where b: "b = {f\(\\<^sub>E i\I. \ i). \i\j. f i \ A i}" "j \ J" "A \ Pi j E" by (auto simp: P_def) show"b \ sigma_sets (Pi\<^sub>E I \) (\i\I. ?F i)" proof cases assume"j = {}" with b have"b = (\\<^sub>E i\I. \ i)" by auto thenshow ?thesis by blast next assume"j \ {}" with J b(2,3) have eq: "b = (\i\j. ((\x. x i) -` A i \ Pi\<^sub>E I \))" unfolding b(1) by (auto simp: PiE_def Pi_def) show ?thesis unfolding eq using\<open>A \<in> Pi j E\<close> \<open>j \<in> J\<close> J(2) by (intro F.finite_INT J \<open>j \<in> J\<close> \<open>j \<noteq> {}\<close> sigma_sets.Basic) blast qed qed finallyshow"?thesis" . qed
lemma sets_PiM_in_sets: assumes space: "space N = (\\<^sub>E i\I. space (M i))" assumes sets: "\i A. i \ I \ A \ sets (M i) \ {x\space N. x i \ A} \ sets N" shows"sets (\\<^sub>M i \ I. M i) \ sets N" unfolding sets_PiM_single space[symmetric] by (intro sets.sigma_sets_subset subsetI) (auto intro: sets)
lemma sets_PiM_cong[measurable_cong]: assumes"I = J""\i. i \ J \ sets (M i) = sets (N i)" shows "sets (PiM I M) = sets (PiM J N)" using assms sets_eq_imp_space_eq[OF assms(2)] by (simp add: sets_PiM_single cong: PiE_cong conj_cong)
lemma sets_PiM_I: assumes"finite J""J \ I" "\i\J. E i \ sets (M i)" shows"prod_emb I M J (\\<^sub>E j\J. E j) \ sets (\\<^sub>M i\I. M i)" proof cases assume"J = {}" thenhave"prod_emb I M J (\\<^sub>E j\J. E j) = (\\<^sub>E j\I. space (M j))" by (auto simp: prod_emb_def) thenshow ?thesis by (auto simp add: sets_PiM intro!: sigma_sets_top) next assume"J \ {}" with assms show ?thesis by (force simp add: sets_PiM prod_algebra_def) qed
proposition measurable_PiM: assumes space: "f \ space N \ (\\<^sub>E i\I. space (M i))" assumes sets: "\X J. J \ {} \ I = {} \ finite J \ J \ I \ (\i. i \ J \ X i \ sets (M i)) \
f -` prod_emb I M J (Pi\<^sub>E J X) \<inter> space N \<in> sets N" shows"f \ measurable N (PiM I M)" using sets_PiM prod_algebra_sets_into_space space proof (rule measurable_sigma_sets) fix A assume"A \ prod_algebra I M" from prod_algebraE[OF this] obtain J X where "A = prod_emb I M J (Pi\<^sub>E J X)" "finite J" "J \ {} \ I = {}" "J \ I" "\i. i \ J \ X i \ sets (M i)" by auto with sets[of J X] show"f -` A \ space N \ sets N" by auto qed
lemma measurable_PiM_Collect: assumes space: "f \ space N \ (\\<^sub>E i\I. space (M i))" assumes sets: "\X J. J \ {} \ I = {} \ finite J \ J \ I \ (\i. i \ J \ X i \ sets (M i)) \
{\<omega>\<in>space N. \<forall>i\<in>J. f \<omega> i \<in> X i} \<in> sets N" shows"f \ measurable N (PiM I M)" using sets_PiM prod_algebra_sets_into_space space proof (rule measurable_sigma_sets) fix A assume"A \ prod_algebra I M" from prod_algebraE[OF this] obtain J X where X: "A = prod_emb I M J (Pi\<^sub>E J X)" "finite J" "J \ {} \ I = {}" "J \ I" "\i. i \ J \ X i \ sets (M i)" by auto thenhave"f -` A \ space N = {\ \ space N. \i\J. f \ i \ X i}" using space by (auto simp: prod_emb_def del: PiE_I) alsohave"\ \ sets N" using X(3,2,4,5) by (rule sets) finallyshow"f -` A \ space N \ sets N" . qed
lemma measurable_PiM_single: assumes space: "f \ space N \ (\\<^sub>E i\I. space (M i))" assumes sets: "\A i. i \ I \ A \ sets (M i) \ {\ \ space N. f \ i \ A} \ sets N" shows"f \ measurable N (PiM I M)" using sets_PiM_single proof (rule measurable_sigma_sets) fix A assume"A \ {{f \ \\<^sub>E i\I. space (M i). f i \ A} |i A. i \ I \ A \ sets (M i)}" thenobtain B i where"A = {f \ \\<^sub>E i\I. space (M i). f i \ B}" and B: "i \ I" "B \ sets (M i)" by auto with space have"f -` A \ space N = {\ \ space N. f \ i \ B}" by auto alsohave"\ \ sets N" using B by (rule sets) finallyshow"f -` A \ space N \ sets N" . qed (auto simp: space)
lemma measurable_PiM_single': assumes f: "\i. i \ I \ f i \ measurable N (M i)" and"(\\ i. f i \) \ space N \ (\\<^sub>E i\I. space (M i))" shows"(\\ i. f i \) \ measurable N (Pi\<^sub>M I M)" proof (rule measurable_PiM_single) fix A i assume A: "i \ I" "A \ sets (M i)" thenhave"{\ \ space N. f i \ \ A} = f i -` A \ space N" by auto thenshow"{\ \ space N. f i \ \ A} \ sets N" using A f by (auto intro!: measurable_sets) qed fact
lemma sets_PiM_I_finite[measurable]: assumes"finite I"and sets: "(\i. i \ I \ E i \ sets (M i))" shows"(\\<^sub>E j\I. E j) \ sets (\\<^sub>M i\I. M i)" using sets_PiM_I[of I I E M] sets.sets_into_space[OF sets] \<open>finite I\<close> sets by auto
lemma measurable_component_singleton[measurable (raw)]: assumes"i \ I" shows "(\x. x i) \ measurable (Pi\<^sub>M I M) (M i)" proof (unfold measurable_def, intro CollectI conjI ballI) fix A assume"A \ sets (M i)" thenhave"(\x. x i) -` A \ space (Pi\<^sub>M I M) = prod_emb I M {i} (\\<^sub>E j\{i}. A)" using sets.sets_into_space \<open>i \<in> I\<close> by (fastforce dest: Pi_mem simp: prod_emb_def space_PiM split: if_split_asm) thenshow"(\x. x i) -` A \ space (Pi\<^sub>M I M) \ sets (Pi\<^sub>M I M)" using\<open>A \<in> sets (M i)\<close> \<open>i \<in> I\<close> by (auto intro!: sets_PiM_I) qed (use\<open>i \<in> I\<close> in \<open>auto simp: space_PiM\<close>)
lemma measurable_component_singleton'[measurable_dest]: assumes f: "f \ measurable N (Pi\<^sub>M I M)" assumes g: "g \ measurable L N" assumes i: "i \ I" shows"(\x. (f (g x)) i) \ measurable L (M i)" using measurable_compose[OF measurable_compose[OF g f] measurable_component_singleton, OF i] .
lemma measurable_PiM_component_rev: "i \ I \ f \ measurable (M i) N \ (\x. f (x i)) \ measurable (PiM I M) N" by simp
lemma measurable_case_nat[measurable (raw)]: assumes [measurable (raw)]: "i = 0 \ f \ measurable M N" "\j. i = Suc j \ (\x. g x j) \ measurable M N" shows"(\x. case_nat (f x) (g x) i) \ measurable M N" by (cases i) simp_all
lemma measurable_case_nat'[measurable (raw)]: assumes fg[measurable]: "f \ measurable N M" "g \ measurable N (\\<^sub>M i\UNIV. M)" shows"(\x. case_nat (f x) (g x)) \ measurable N (\\<^sub>M i\UNIV. M)" using fg[THEN measurable_space] by (auto intro!: measurable_PiM_single' simp add: space_PiM PiE_iff split: nat.split)
lemma measurable_add_dim[measurable]: "(\(f, y). f(i := y)) \ measurable (Pi\<^sub>M I M \\<^sub>M M i) (Pi\<^sub>M (insert i I) M)"
(is"?f \ measurable ?P ?I") proof (rule measurable_PiM_single) fix j A assume j: "j \ insert i I" and A: "A \ sets (M j)" have"{\ \ space ?P. (\(f, x). fun_upd f i x) \ j \ A} =
(if j = i then space (Pi\<^sub>M I M) \<times> A else ((\<lambda>x. x j) \<circ> fst) -` A \<inter> space ?P)" using sets.sets_into_space[OF A] by (auto simp add: space_pair_measure space_PiM) alsohave"\ \ sets ?P" using A j by (auto intro!: measurable_sets[OF measurable_comp, OF _ measurable_component_singleton]) finallyshow"{\ \ space ?P. case_prod (\f. fun_upd f i) \ j \ A} \ sets ?P" . qed (auto simp: space_pair_measure space_PiM PiE_def)
proposition measurable_fun_upd: assumes I: "I = J \ {i}" assumes f[measurable]: "f \ measurable N (PiM J M)" assumes h[measurable]: "h \ measurable N (M i)" shows"(\x. (f x) (i := h x)) \ measurable N (PiM I M)" proof (intro measurable_PiM_single') fix j assume"j \ I" then show "(\\. ((f \)(i := h \)) j) \ measurable N (M j)" unfolding I by (cases "j = i") auto next show"(\x. (f x)(i := h x)) \ space N \ (\\<^sub>E i\I. space (M i))" using I f[THEN measurable_space] h[THEN measurable_space] by (auto simp: space_PiM PiE_iff extensional_def) qed
lemma measurable_component_update: "x \ space (Pi\<^sub>M I M) \ i \ I \ (\v. x(i := v)) \ measurable (M i) (Pi\<^sub>M (insert i I) M)" by simp
lemma measurable_merge[measurable]: "merge I J \ measurable (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>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" thenhave"{\ \ space ?P. merge I J \ i \ A} =
(if i \<in> I then ((\<lambda>x. x i) \<circ> fst) -` A \<inter> space ?P else ((\<lambda>x. x i) \<circ> snd) -` A \<inter> space ?P)" by (auto simp: merge_def) alsohave"\ \ sets ?P" using A by (auto intro!: measurable_sets[OF measurable_comp, OF _ measurable_component_singleton]) finallyshow"{\ \ space ?P. merge I J \ i \ A} \ sets ?P" . qed (auto simp: space_pair_measure space_PiM PiE_iff merge_def extensional_def)
lemma measurable_restrict[measurable (raw)]: assumes X: "\i. i \ I \ X i \ measurable N (M i)" shows"(\x. \i\I. X i x) \ measurable N (Pi\<^sub>M I M)" proof (rule measurable_PiM_single) fix A i assume A: "i \ I" "A \ sets (M i)" thenhave"{\ \ space N. (\i\I. X i \) i \ A} = X i -` A \ space N" by auto thenshow"{\ \ space N. (\i\I. X i \) i \ A} \ sets N" using A X by (auto intro!: measurable_sets) next show"(\x. \i\I. X i x) \ space N \ (\\<^sub>E i\I. space (M i))" using X by (auto simp add: PiE_def dest: measurable_space) qed
lemma measurable_abs_UNIV: "(\n. (\\. f n \) \ measurable M (N n)) \ (\\ n. f n \) \ measurable M (PiM UNIV N)" by (intro measurable_PiM_single) (auto dest: measurable_space)
lemma measurable_restrict_subset: "J \ L \ (\f. restrict f J) \ measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M)" by (intro measurable_restrict measurable_component_singleton) auto
lemma measurable_restrict_subset': assumes"J \ L" "\x. x \ J \ sets (M x) = sets (N x)" shows"(\f. restrict f J) \ measurable (Pi\<^sub>M L M) (Pi\<^sub>M J N)" by (metis (no_types) assms measurable_cong_sets measurable_restrict_subset sets_PiM_cong)
lemma measurable_prod_emb[intro, simp]: "J \ L \ X \ sets (Pi\<^sub>M J M) \ prod_emb L M J X \ sets (Pi\<^sub>M L M)" unfolding prod_emb_def space_PiM[symmetric] by (auto intro!: measurable_sets measurable_restrict measurable_component_singleton)
lemma merge_in_prod_emb: assumes"y \ space (PiM I M)" "x \ X" and X: "X \ sets (Pi\<^sub>M J M)" and "J \ I" shows"merge J I (x, y) \ prod_emb I M J X" using assms sets.sets_into_space[OF X] by (simp add: merge_def prod_emb_def subset_eq space_PiM PiE_def extensional_restrict Pi_iff
cong: if_cong restrict_cong)
(simp add: extensional_def)
lemma prod_emb_eq_emptyD: assumes J: "J \ I" and ne: "space (PiM I M) \ {}" and X: "X \ sets (Pi\<^sub>M J M)" and *: "prod_emb I M J X = {}" shows"X = {}" proof safe fix x assume"x \ X" obtain\<omega> where "\<omega> \<in> space (PiM I M)" using ne by blast from merge_in_prod_emb[OF this \<open>x\<in>X\<close> X J] * show "x \<in> {}" by auto qed
lemma sets_in_Pi_aux: "finite I \ (\j. j \ I \ {x\space (M j). x \ F j} \ sets (M j)) \
{x\<in>space (PiM I M). x \<in> Pi I F} \<in> sets (PiM I M)" by (simp add: subset_eq Pi_iff)
lemma sets_in_Pi[measurable (raw)]: "finite I \ f \ measurable N (PiM I M) \
(\<And>j. j \<in> I \<Longrightarrow> {x\<in>space (M j). x \<in> F j} \<in> sets (M j)) \<Longrightarrow>
Measurable.pred N (\<lambda>x. f x \<in> Pi I F)" unfolding pred_def by (rule measurable_sets_Collect[of f N "PiM I M", OF _ sets_in_Pi_aux]) auto
lemma sets_in_extensional_aux: "{x\space (PiM I M). x \ extensional I} \ sets (PiM I M)" by (smt (verit) PiE_iff mem_Collect_eq sets.top space_PiM subsetI subset_antisym)
lemma sets_in_extensional[measurable (raw)]: "f \ measurable N (PiM I M) \ Measurable.pred N (\x. f x \ extensional I)" unfolding pred_def by (rule measurable_sets_Collect[of f N "PiM I M", OF _ sets_in_extensional_aux]) auto
lemma sets_PiM_I_countable: assumes I: "countable I"and E: "\i. i \ I \ E i \ sets (M i)" shows "Pi\<^sub>E I E \ sets (Pi\<^sub>M I M)" proof cases assume"I \ {}" thenhave"Pi\<^sub>E I E = (\i\I. prod_emb I M {i} (Pi\<^sub>E {i} E))" using E[THEN sets.sets_into_space] by (auto simp: PiE_iff prod_emb_def fun_eq_iff) alsohave"\ \ sets (PiM I M)" using I \<open>I \<noteq> {}\<close> by (simp add: E sets.countable_INT' sets_PiM_I subset_eq) finallyshow ?thesis . qed (simp add: sets_PiM_empty)
lemma sets_PiM_D_countable: assumes A: "A \ PiM I M" shows"\J\I. \X\PiM J M. countable J \ A = prod_emb I M J X" using A[unfolded sets_PiM_single] proofinduction case (Basic A) thenobtain i X where *: "i \ I" "X \ sets (M i)" and "A = {f \ \\<^sub>E i\I. space (M i). f i \ X}" by auto thenhave A: "A = prod_emb I M {i} (\\<^sub>E _\{i}. X)" by (auto simp: prod_emb_def) thenshow ?case by (intro exI[of _ "{i}"] conjI bexI[of _ "\\<^sub>E _\{i}. X"])
(auto intro: countable_finite * sets_PiM_I_finite) next case Empty thenshow ?case by (intro exI[of _ "{}"] conjI bexI[of _ "{}"]) auto next case (Compl A) thenobtain J X where"J \ I" "X \ sets (Pi\<^sub>M J M)" "countable J" "A = prod_emb I M J X" by auto thenshow ?case by (intro exI[of _ J] bexI[of _ "space (PiM J M) - X"] conjI)
(auto simp add: space_PiM prod_emb_PiE intro!: sets_PiM_I_countable) next case (Union K) obtain J X where J: "\i. J i \ I" "\i. countable (J i)" and X: "\i. X i \ sets (Pi\<^sub>M (J i) M)" and K: "\i. K i = prod_emb I M (J i) (X i)" by (metis Union.IH) show ?case proof (intro exI bexI conjI) show"(\i. J i) \ I" "countable (\i. J i)" using J by auto with J show"\(K ` UNIV) = prod_emb I M (\i. J i) (\i. prod_emb (\i. J i) M (J i) (X i))" by (simp add: K[abs_def] SUP_upper) qed(auto intro: X) qed
proposition measure_eqI_PiM_finite: assumes [simp]: "finite I""sets P = PiM I M""sets Q = PiM I M" assumes eq: "\A. (\i. i \ I \ A i \ sets (M i)) \ P (Pi\<^sub>E I A) = Q (Pi\<^sub>E I A)" assumes A: "range A \ prod_algebra I M" "(\i. A i) = space (PiM I M)" "\i::nat. P (A i) \ \" shows"P = Q" proof (rule measure_eqI_generator_eq[OF Int_stable_prod_algebra prod_algebra_sets_into_space]) show"range A \ prod_algebra I M" "(\i. A i) = (\\<^sub>E i\I. space (M i))" "\i. P (A i) \ \" unfolding space_PiM[symmetric] by fact+ fix X assume"X \ prod_algebra I M" thenobtain J E where X: "X = prod_emb I M J (\\<^sub>E j\J. E j)" and J: "finite J""J \ I" "\j. j \ J \ E j \ sets (M j)" by (force elim!: prod_algebraE) thenshow"emeasure P X = emeasure Q X" unfolding X by (subst (1 2) prod_emb_Pi) (auto simp: eq) qed (simp_all add: sets_PiM)
proposition measure_eqI_PiM_infinite: assumes [simp]: "sets P = PiM I M""sets Q = PiM I M" assumes eq: "\A J. finite J \ J \ I \ (\i. i \ J \ A i \ sets (M i)) \
P (prod_emb I M J (Pi\<^sub>E J A)) = Q (prod_emb I M J (Pi\<^sub>E J A))" assumes A: "finite_measure P" shows"P = Q" proof (rule measure_eqI_generator_eq[OF Int_stable_prod_algebra prod_algebra_sets_into_space]) interpret finite_measure P by fact
define i where"i = (SOME i. i \ I)" have i: "I \ {} \ i \ I" unfolding i_def by (rule someI_ex) auto
define A where"A n =
(if I = {} then prod_emb I M {} (\<Pi>\<^sub>E i\<in>{}. {}) else prod_emb I M {i} (\<Pi>\<^sub>E i\<in>{i}. space (M i)))" for n :: nat thenshow"range A \ prod_algebra I M" using prod_algebraI[of "{}" I "\i. space (M i)" M] by (auto intro!: prod_algebraI i) have"\i. A i = space (PiM I M)" by (auto simp: prod_emb_def space_PiM PiE_iff A_def i ex_in_conv[symmetric] exI) thenshow"(\i. A i) = (\\<^sub>E i\I. space (M i))" "\i. emeasure P (A i) \ \" by (auto simp: space_PiM) next fix X assume X: "X \ prod_algebra I M" thenobtain J E where X: "X = prod_emb I M J (\\<^sub>E j\J. E j)" and J: "finite J""J \ I" "\j. j \ J \ E j \ sets (M j)" by (force elim!: prod_algebraE) thenshow"emeasure P X = emeasure Q X" by (auto intro!: eq) qed (auto simp: sets_PiM)
locale\<^marker>\<open>tag unimportant\<close> product_sigma_finite = fixes M :: "'i \ 'a measure" assumes sigma_finite_measures: "\i. sigma_finite_measure (M i)"
sublocale\<^marker>\<open>tag unimportant\<close> product_sigma_finite \<subseteq> M?: sigma_finite_measure "M i" for i by (rule sigma_finite_measures)
locale\<^marker>\<open>tag unimportant\<close> finite_product_sigma_finite = product_sigma_finite M for M :: "'i \<Rightarrow> 'a measure" + fixes I :: "'i set" assumes finite_index: "finite I"
proposition (in finite_product_sigma_finite) sigma_finite_pairs: "\F::'i \ nat \ 'a set.
(\<forall>i\<in>I. range (F i) \<subseteq> sets (M i)) \<and>
(\<forall>k. \<forall>i\<in>I. emeasure (M i) (F i k) \<noteq> \<infinity>) \<and> incseq (\<lambda>k. \<Pi>\<^sub>E i\<in>I. F i k) \<and>
(\<Union>k. \<Pi>\<^sub>E i\<in>I. F i k) = space (PiM I M)" proof - have"\i::'i. \F::nat \ 'a set. range F \ sets (M i) \ incseq F \ (\i. F i) = space (M i) \ (\k. emeasure (M i) (F k) \ \)" using M.sigma_finite_incseq by metis thenobtain F :: "'i \ nat \ 'a set" where"\x. range (F x) \ sets (M x) \ incseq (F x) \ \ (range (F x)) = space (M x) \ (\k. emeasure (M x) (F x k) \ \)" by metis thenhave F: "\i. range (F i) \ sets (M i)" "\i. incseq (F i)" "\i. (\j. F i j) = space (M i)" "\i k. emeasure (M i) (F i k) \ \" by auto let ?F = "\k. \\<^sub>E i\I. F i k" note space_PiM[simp] show ?thesis proof (intro exI[of _ F] conjI allI incseq_SucI set_eqI iffI ballI) fix i show"range (F i) \ sets (M i)" by fact next fix i k show"emeasure (M i) (F i k) \ \" by fact next fix x assume"x \ (\i. ?F i)" with F(1) show "x \ space (PiM I M)" by (auto simp: PiE_def dest!: sets.sets_into_space) next fix f assume"f \ space (PiM I M)" with Pi_UN[OF finite_index, of "\k i. F i k"] F show"f \ (\i. ?F i)" by (auto simp: incseq_def PiE_def) next fix i show"?F i \ ?F (Suc i)" using\<open>\<And>i. incseq (F i)\<close>[THEN incseq_SucD] by auto qed qed
lemma emeasure_PiM_empty[simp]: "emeasure (PiM {} M) {\_. undefined} = 1" proof - let ?\<mu> = "\<lambda>A. if A = {} then 0 else (1::ennreal)" have"emeasure (Pi\<^sub>M {} M) (prod_emb {} M {} (\\<^sub>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 sets.countably_additiveI_finite)
(auto simp: additive_def positive_def sets_PiM_empty space_PiM_empty intro!: ) qed (auto simp: prod_emb_def) alsohave"(prod_emb {} M {} (\\<^sub>E i\{}. {})) = {\_. undefined}" by (auto simp: prod_emb_def) finallyshow ?thesis by simp qed
lemma PiM_empty: "PiM {} M = count_space {\_. undefined}" by (rule measure_eqI) (auto simp add: sets_PiM_empty)
lemma (in product_sigma_finite) emeasure_PiM: "finite I \ (\i. i\I \ A i \ sets (M i)) \ emeasure (PiM I M) (Pi\<^sub>E I A) = (\i\I. emeasure (M i) (A i))" proof (induct I arbitrary: A rule: finite_induct) case (insert i I) interpret finite_product_sigma_finite M I by standard fact have"finite (insert i I)"using\<open>finite I\<close> by auto interpret I': finite_product_sigma_finite M "insert i I" by standard fact let ?h = "(\(f, y). f(i := y))"
let ?P = "distr (Pi\<^sub>M I M \\<^sub>M M i) (Pi\<^sub>M (insert i I) M) ?h" let ?\<mu> = "emeasure ?P" let ?I = "{j \ insert i I. emeasure (M j) (space (M j)) \ 1}" let ?f = "\J E j. if j \ J then emeasure (M j) (E j) else emeasure (M j) (space (M j))"
have"emeasure (Pi\<^sub>M (insert i I) M) (prod_emb (insert i I) M (insert i I) (Pi\<^sub>E (insert i I) A)) =
(\<Prod>i\<in>insert i I. emeasure (M i) (A i))" proof (subst emeasure_extend_measure_Pair[OF PiM_def]) fix J E assume"(J \ {} \ insert i I = {}) \ finite J \ J \ insert i I \ E \ (\ j\J. sets (M j))" thenhave J: "J \ {}" "finite J" "J \ insert i I" and E: "\j\J. E j \ sets (M j)" by auto let ?p = "prod_emb (insert i I) M J (Pi\<^sub>E J E)" let ?p' = "prod_emb I M (J - {i}) (\\<^sub>E j\J-{i}. E j)" have"?\ ?p =
emeasure (Pi\<^sub>M I M \<Otimes>\<^sub>M (M i)) (?h -` ?p \<inter> space (Pi\<^sub>M I M \<Otimes>\<^sub>M M i))" by (intro emeasure_distr measurable_add_dim sets_PiM_I) fact+ alsohave"?h -` ?p \ space (Pi\<^sub>M I M \\<^sub>M M i) = ?p' \ (if i \ J then E i else space (M i))" using J E[rule_format, THEN sets.sets_into_space] by (force simp: space_pair_measure space_PiM prod_emb_iff PiE_def Pi_iff split: if_split_asm) alsohave"emeasure (Pi\<^sub>M I M \\<^sub>M (M i)) (?p' \ (if i \ J then E i else space (M i))) =
emeasure (Pi\<^sub>M I M) ?p' * emeasure (M i) (if i \<in> J then (E i) else space (M i))" using J E by (intro M.emeasure_pair_measure_Times sets_PiM_I) auto alsohave"?p' = (\\<^sub>E j\I. if j \ J-{i} then E j else space (M j))" using J E[rule_format, THEN sets.sets_into_space] by (auto simp: prod_emb_iff PiE_def Pi_iff split: if_split_asm) blast+ alsohave"emeasure (Pi\<^sub>M I M) (\\<^sub>E j\I. if j \ J-{i} then E j else space (M j)) =
(\<Prod> j\<in>I. if j \<in> J-{i} then emeasure (M j) (E j) else emeasure (M j) (space (M j)))" using E by (subst insert) (auto intro!: prod.cong) alsohave"(\j\I. if j \ J - {i} then emeasure (M j) (E j) else emeasure (M j) (space (M j))) *
emeasure (M i) (if i \<in> J then E i else space (M i)) = (\<Prod>j\<in>insert i I. ?f J E j)" using insert by (auto simp: mult.commute intro!: arg_cong2[where f="(*)"] prod.cong) alsohave"\ = (\j\J \ ?I. ?f J E j)" using insert(1,2) J E by (intro prod.mono_neutral_right) auto finallyshow"?\ ?p = \" .
show"prod_emb (insert i I) M J (Pi\<^sub>E J E) \ Pow (\\<^sub>E i\insert i I. space (M i))" using J E[rule_format, THEN sets.sets_into_space] by (auto simp: prod_emb_iff PiE_def) next show"positive (sets (Pi\<^sub>M (insert i I) M)) ?\" "countably_additive (sets (Pi\<^sub>M (insert i I) M)) ?\" using emeasure_positive[of ?P] emeasure_countably_additive[of ?P] by simp_all next show"(insert i I \ {} \ insert i I = {}) \ finite (insert i I) \
insert i I \<subseteq> insert i I \<and> A \<in> (\<Pi> j\<in>insert i I. sets (M j))" using insert by auto qed (auto intro!: prod.cong) with insert show ?case by (subst (asm) prod_emb_PiE_same_index) (auto intro!: sets.sets_into_space) qed simp
lemma (in product_sigma_finite) PiM_eqI: assumes I[simp]: "finite I"and P: "sets P = PiM I M" assumes eq: "\A. (\i. i \ I \ A i \ sets (M i)) \ P (Pi\<^sub>E I A) = (\i\I. emeasure (M i) (A i))" shows"P = PiM I M" proof - interpret finite_product_sigma_finite M I by standard fact from sigma_finite_pairs obtain C where C: "\i\I. range (C i) \ sets (M i)" "\k. \i\I. emeasure (M i) (C i k) \ \" "incseq (\k. \\<^sub>E i\I. C i k)" "(\k. \\<^sub>E i\I. C i k) = space (Pi\<^sub>M I M)" by auto show ?thesis proof (rule measure_eqI_PiM_finite[OF I refl P, symmetric]) show"(\i. i \ I \ A i \ sets (M i)) \ (Pi\<^sub>M I M) (Pi\<^sub>E I A) = P (Pi\<^sub>E I A)" for A by (simp add: eq emeasure_PiM)
define A where"A n = (\\<^sub>E i\I. C i n)" for n with C show"range A \ prod_algebra I M" "\i. emeasure (Pi\<^sub>M I M) (A i) \ \" "(\i. A i) = space (PiM I M)" by (auto intro!: prod_algebraI_finite simp: emeasure_PiM subset_eq ennreal_prod_eq_top) qed qed
lemma (in product_sigma_finite) sigma_finite: assumes"finite I" shows"sigma_finite_measure (PiM I M)" proof interpret finite_product_sigma_finite M I by standard fact
obtain F where F: "\j. countable (F j)" "\j f. f \ F j \ f \ sets (M j)" "\j f. f \ F j \ emeasure (M j) f \ \" and
in_space: "\j. space (M j) = \(F j)" using sigma_finite_countable by (metis subset_eq) moreoverhave"(\(Pi\<^sub>E I ` Pi\<^sub>E I F)) = space (Pi\<^sub>M I M)" using in_space by (auto simp: space_PiM PiE_iff intro!: PiE_choice[THEN iffD1]) ultimatelyshow"\A. countable A \ A \ sets (Pi\<^sub>M I M) \ \A = space (Pi\<^sub>M I M) \ (\a\A. emeasure (Pi\<^sub>M I M) a \ \)" by (intro exI[of _ "Pi\<^sub>E I ` Pi\<^sub>E I F"])
(auto intro!: countable_PiE sets_PiM_I_finite
simp: PiE_iff emeasure_PiM finite_index ennreal_prod_eq_top) qed
sublocale finite_product_sigma_finite \<subseteq> sigma_finite_measure "Pi\<^sub>M I M" using sigma_finite[OF finite_index] .
lemma (in finite_product_sigma_finite) measure_times: "(\i. i \ I \ A i \ sets (M i)) \ emeasure (Pi\<^sub>M I M) (Pi\<^sub>E I A) = (\i\I. emeasure (M i) (A i))" using emeasure_PiM[OF finite_index] by auto
lemma (in product_sigma_finite) nn_integral_empty: "0 \ f (\k. undefined) \ integral\<^sup>N (Pi\<^sub>M {} M) f = f (\k. undefined)" by (simp add: PiM_empty nn_integral_count_space_finite max.absorb2)
lemma\<^marker>\<open>tag important\<close> (in product_sigma_finite) distr_merge: assumes IJ[simp]: "I \ J = {}" and fin: "finite I" "finite J" shows"distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J) = Pi\<^sub>M (I \ J) M"
(is"?D = ?P") proof (rule PiM_eqI) interpret I: finite_product_sigma_finite M I by standard fact interpret J: finite_product_sigma_finite M J by standard fact fix A assume A: "\i. i \ I \ J \ A i \ sets (M i)" have *: "(merge I J -` Pi\<^sub>E (I \ J) A \ space (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)) = Pi\<^sub>E I A \ Pi\<^sub>E J A" using A[THEN sets.sets_into_space] by (auto simp: space_PiM space_pair_measure) from A fin show"emeasure (distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J)) (Pi\<^sub>E (I \ J) A) =
(\<Prod>i\<in>I \<union> J. emeasure (M i) (A i))" by (subst emeasure_distr)
(auto simp: * J.emeasure_pair_measure_Times I.measure_times J.measure_times prod.union_disjoint) qed (use fin in simp_all)
proposition (in product_sigma_finite) product_nn_integral_fold: assumes IJ: "I \ J = {}" "finite I" "finite J" and f[measurable]: "f \ borel_measurable (Pi\<^sub>M (I \ J) M)" shows"integral\<^sup>N (Pi\<^sub>M (I \ J) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (merge I J (x, y)) \(Pi\<^sub>M J M)) \(Pi\<^sub>M I M))"
(is"?lhs = ?rhs") proof - interpret I: finite_product_sigma_finite M I by standard fact interpret J: finite_product_sigma_finite M J by standard fact interpret P: pair_sigma_finite "Pi\<^sub>M I M" "Pi\<^sub>M J M" by standard have P_borel: "(\x. f (merge I J x)) \ borel_measurable (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" using measurable_comp[OF measurable_merge f] by (simp add: comp_def) have"?lhs = integral\<^sup>N (distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J)) f" by (simp add: I.finite_index J.finite_index assms(1) distr_merge) alsohave"... = \\<^sup>+ x. f (merge I J x) \(Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" by (simp add: nn_integral_distr) alsohave"... = ?rhs" using P.Fubini P.nn_integral_snd by force finallyshow ?thesis . qed
lemma (in product_sigma_finite) distr_singleton: "distr (Pi\<^sub>M {i} M) (M i) (\x. x i) = M i" (is "?D = _") proof (intro measure_eqI[symmetric]) interpret I: finite_product_sigma_finite M "{i}"by standard simp fix A assume A: "A \ sets (M i)" thenhave"(\x. x i) -` A \ space (Pi\<^sub>M {i} M) = (\\<^sub>E i\{i}. A)" using sets.sets_into_space by (auto simp: space_PiM) thenshow"emeasure (M i) A = emeasure ?D A" using A I.measure_times[of "\_. A"] by (simp add: emeasure_distr measurable_component_singleton) qed simp
lemma (in product_sigma_finite) product_nn_integral_singleton: assumes f: "f \ borel_measurable (M i)" shows"integral\<^sup>N (Pi\<^sub>M {i} M) (\x. f (x i)) = integral\<^sup>N (M i) f" proof - interpret I: finite_product_sigma_finite M "{i}"by standard simp from f show ?thesis by (metis distr_singleton insert_iff measurable_component_singleton nn_integral_distr) qed
proposition (in product_sigma_finite) product_nn_integral_insert: assumes I[simp]: "finite I""i \ I" and f: "f \ borel_measurable (Pi\<^sub>M (insert i I) M)" shows"integral\<^sup>N (Pi\<^sub>M (insert i I) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (x(i := y)) \(M i)) \(Pi\<^sub>M I M))" proof - interpret I: finite_product_sigma_finite M I by standard auto interpret i: finite_product_sigma_finite M "{i}"by standard auto have IJ: "I \ {i} = {}" and insert: "I \ {i} = insert i I" using f by auto show ?thesis unfolding product_nn_integral_fold[OF IJ, unfolded insert, OF I(1) i.finite_index f] proof (rule nn_integral_cong, subst product_nn_integral_singleton[symmetric]) fix x assume x: "x \ space (Pi\<^sub>M I M)" let ?f = "\y. f (x(i := y))" show"?f \ borel_measurable (M i)" using measurable_comp[OF measurable_component_update f, OF x \<open>i \<notin> I\<close>] unfolding comp_def . show"(\\<^sup>+ y. f (merge I {i} (x, y)) \Pi\<^sub>M {i} M) = (\\<^sup>+ y. f (x(i := y i)) \Pi\<^sub>M {i} M)" using x by (auto intro!: nn_integral_cong arg_cong[where f=f]
simp add: space_PiM extensional_def PiE_def) qed qed
lemma (in product_sigma_finite) product_nn_integral_insert_rev: assumes I[simp]: "finite I""i \ I" and [measurable]: "f \ borel_measurable (Pi\<^sub>M (insert i I) M)" shows"integral\<^sup>N (Pi\<^sub>M (insert i I) M) f = (\\<^sup>+ y. (\\<^sup>+ x. f (x(i := y)) \(Pi\<^sub>M I M)) \(M i))" apply (subst product_nn_integral_insert[OF assms]) apply (rule pair_sigma_finite.Fubini') apply (simp add: local.sigma_finite pair_sigma_finite.intro sigma_finite_measures) apply measurable done
lemma (in product_sigma_finite) product_nn_integral_prod: assumes"finite I""\i. i \ I \ f i \ borel_measurable (M i)" shows"(\\<^sup>+ x. (\i\I. f i (x i)) \Pi\<^sub>M I M) = (\i\I. integral\<^sup>N (M i) (f i))" using assms proof (induction I) case (insert i I) note insert.prems[measurable] note\<open>finite I\<close>[intro, simp] interpret I: finite_product_sigma_finite M I by standard 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!: prod.cong) have prod: "\J. J \ insert i I \ (\x. (\i\J. f i (x i))) \ borel_measurable (Pi\<^sub>M J M)" using sets.sets_into_space insert by (intro borel_measurable_prod_ennreal
measurable_comp[OF measurable_component_singleton, unfolded comp_def])
auto thenshow ?case using product_nn_integral_insert[OF insert(1,2)] by (simp add: insert(2-) * nn_integral_multc nn_integral_cmult) qed (simp add: space_PiM)
proposition (in product_sigma_finite) product_nn_integral_pair: assumes [measurable]: "case_prod f \ borel_measurable (M x \\<^sub>M M y)" assumes xy: "x \ y" shows"(\\<^sup>+\. f (\ x) (\ y) \PiM {x, y} M) = (\\<^sup>+z. f (fst z) (snd z) \(M x \\<^sub>M M y))" proof - interpret psm: pair_sigma_finite "M x""M y" unfolding pair_sigma_finite_def using sigma_finite_measures by simp_all have"{x, y} = {y, x}"by auto alsohave"(\\<^sup>+\. f (\ x) (\ y) \PiM {y, x} M) = (\\<^sup>+y. \\<^sup>+\. f (\ x) y \PiM {x} M \M y)" using xy by (subst product_nn_integral_insert_rev) simp_all alsohave"... = (\\<^sup>+y. \\<^sup>+x. f x y \M x \M y)" by (intro nn_integral_cong, subst product_nn_integral_singleton) simp_all alsohave"... = (\\<^sup>+z. f (fst z) (snd z) \(M x \\<^sub>M M y))" by (subst psm.nn_integral_snd[symmetric]) simp_all finallyshow ?thesis . qed
lemma (in product_sigma_finite) distr_component: "distr (M i) (Pi\<^sub>M {i} M) (\x. \i\{i}. x) = Pi\<^sub>M {i} M" (is "?D = ?P") proof (intro PiM_eqI) fix A assume A: "\ia. ia \ {i} \ A ia \ sets (M ia)" thenhave"(\x. \i\{i}. x) -` Pi\<^sub>E {i} A \ space (M i) = A i" by (fastforce dest: sets.sets_into_space) with A show"emeasure (distr (M i) (Pi\<^sub>M {i} M) (\x. \i\{i}. x)) (Pi\<^sub>E {i} A) = (\i\{i}. emeasure (M i) (A i))" by (subst emeasure_distr) (auto intro!: sets_PiM_I_finite measurable_restrict) qed simp_all
lemma (in product_sigma_finite) assumes IJ: "I \ J = {}" "finite I" "finite J" and A: "A \ sets (Pi\<^sub>M (I \ J) M)" shows emeasure_fold_integral: "emeasure (Pi\<^sub>M (I \ J) M) A = (\\<^sup>+x. emeasure (Pi\<^sub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^sub>M J M)) \Pi\<^sub>M I M)"
(is"?lhs = ?rhs") and emeasure_fold_measurable: "(\x. emeasure (Pi\<^sub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^sub>M J M))) \ borel_measurable (Pi\<^sub>M I M)" (is ?B) proof - interpret I: finite_product_sigma_finite M I by standard fact interpret J: finite_product_sigma_finite M J by standard fact interpret IJ: pair_sigma_finite "Pi\<^sub>M I M" "Pi\<^sub>M J M" .. have merge: "merge I J -` A \ space (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) \ sets (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" by (intro measurable_sets[OF _ A] measurable_merge assms) have"?lhs = emeasure (distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J)) A" by (simp add: I.finite_index J.finite_index assms(1) distr_merge) alsohave"... = emeasure (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (merge I J -` A \ space (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M))" by (meson A emeasure_distr measurable_merge) alsohave"... = ?rhs" apply (subst J.emeasure_pair_measure_alt[OF merge]) by (auto intro!: nn_integral_cong arg_cong2[where f=emeasure] simp: space_pair_measure) finallyshow"?lhs = ?rhs" .
show ?B using IJ.measurable_emeasure_Pair1[OF merge] by (simp add: vimage_comp comp_def space_pair_measure cong: measurable_cong) qed
lemma sets_Collect_single: "i \ I \ A \ sets (M i) \ { x \ space (Pi\<^sub>M I M). x i \ A } \ sets (Pi\<^sub>M I M)" by simp lemma pair_measure_eq_distr_PiM: fixes M1 :: "'a measure"and M2 :: "'a measure" assumes"sigma_finite_measure M1""sigma_finite_measure M2" shows"(M1 \\<^sub>M M2) = distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \\<^sub>M M2) (\x. (x True, x False))"
(is"?P = ?D") proof (rule pair_measure_eqI[OF assms]) interpret B: product_sigma_finite "case_bool M1 M2" unfolding product_sigma_finite_def using assms by (auto split: bool.split) let ?B = "Pi\<^sub>M UNIV (case_bool M1 M2)"
--> --------------------
--> maximum size reached
--> --------------------
¤ Dauer der Verarbeitung: 0.30 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.