# HG changeset patch # User hoelzl # Date 1417709158 -3600 # Node ID ff2bd4a14ddb3ed49f2b74254478b9f5858a9b0f # Parent 8535cfcfa4934afa892276adabb08d393a274fa2 generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Binary_Product_Measure.thy --- a/src/HOL/Probability/Binary_Product_Measure.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Binary_Product_Measure.thy Thu Dec 04 17:05:58 2014 +0100 @@ -594,6 +594,65 @@ subsection {* Products on counting spaces, densities and distributions *} +lemma sigma_prod: + assumes X_cover: "\E\A. countable E \ X = \E" and A: "A \ Pow X" + assumes Y_cover: "\E\B. countable E \ Y = \E" and B: "B \ Pow Y" + shows "sigma X A \\<^sub>M sigma Y B = sigma (X \ Y) {a \ b | a b. a \ A \ b \ B}" + (is "?P = ?S") +proof (rule measure_eqI) + 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 = + 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) + show "\?XY \ Pow (X \ Y)" "{a \ b |a b. a \ A \ b \ B} \ Pow (X \ Y)" + using A B by auto + next + interpret XY: sigma_algebra "X \ Y" "sigma_sets (X \ Y) {a \ b |a b. a \ A \ b \ B}" + using A B by (intro sigma_algebra_sigma_sets) auto + fix Z assume "Z \ \?XY" + then show "Z \ sigma_sets (X \ Y) {a \ b |a b. a \ A \ b \ B}" + proof safe + fix a assume "a \ A" + from Y_cover obtain E where E: "E \ B" "countable E" and "Y = \E" + by auto + with `a \ A` A have eq: "fst -` a \ X \ Y = (\e\E. a \ e)" + by auto + show "fst -` a \ X \ Y \ sigma_sets (X \ Y) {a \ b |a b. a \ A \ b \ B}" + using `a \ A` E unfolding eq by (auto intro!: XY.countable_UN') + next + fix b assume "b \ B" + from X_cover obtain E where E: "E \ A" "countable E" and "X = \E" + by auto + with `b \ B` B have eq: "snd -` b \ X \ Y = (\e\E. e \ b)" + by auto + show "snd -` b \ X \ Y \ sigma_sets (X \ Y) {a \ b |a b. a \ A \ b \ B}" + using `b \ B` E unfolding eq by (auto intro!: XY.countable_UN') + qed + next + fix Z assume "Z \ {a \ b |a b. a \ A \ b \ B}" + then obtain a b where "Z = a \ b" and ab: "a \ A" "b \ B" + by auto + then have Z: "Z = (fst -` a \ X \ Y) \ (snd -` b \ X \ Y)" + using A B by auto + interpret XY: sigma_algebra "X \ Y" "sigma_sets (X \ Y) (\?XY)" + by (intro sigma_algebra_sigma_sets) auto + show "Z \ sigma_sets (X \ Y) (\?XY)" + unfolding Z by (rule XY.Int) (blast intro: ab)+ + qed + finally show "sets ?P = sets ?S" . +next + interpret finite_measure "sigma X A" for X A + proof qed (simp add: emeasure_sigma) + fix A assume "A \ sets ?P" then show "emeasure ?P A = emeasure ?S A" + by (simp add: emeasure_pair_measure_alt emeasure_sigma) +qed + lemma sigma_sets_pair_measure_generator_finite: assumes "finite A" and "finite B" shows "sigma_sets (A \ B) { a \ b | a b. a \ A \ b \ B} = Pow (A \ B)" @@ -618,6 +677,18 @@ show "a \ A" and "b \ B" by auto qed +lemma borel_prod: + "(borel \\<^sub>M borel) = (borel :: ('a::second_countable_topology \ 'b::second_countable_topology) measure)" + (is "?P = ?B") +proof - + have "?B = sigma UNIV {A \ B | A B. open A \ open B}" + by (rule second_countable_borel_measurable[OF open_prod_generated]) + also have "\ = ?P" + unfolding borel_def + by (subst sigma_prod) (auto intro!: exI[of _ "{UNIV}"]) + finally show ?thesis .. +qed + lemma pair_measure_count_space: assumes A: "finite A" and B: "finite B" shows "count_space A \\<^sub>M count_space B = count_space (A \ B)" (is "?P = ?C") @@ -821,50 +892,6 @@ by auto qed -lemma borel_prod: "sets (borel \\<^sub>M borel) = - (sets borel :: ('a::second_countable_topology \ 'b::second_countable_topology) set set)" - (is "?l = ?r") -proof - - obtain A :: "'a set set" where A: "countable A" "topological_basis A" - by (metis ex_countable_basis) - moreover obtain B :: "'b set set" where B: "countable B" "topological_basis B" - by (metis ex_countable_basis) - ultimately have AB: "countable ((\(a, b). a \ b) ` (A \ B))" "topological_basis ((\(a, b). a \ b) ` (A \ B))" - by (auto intro!: topological_basis_prod) - have "sets (borel \\<^sub>M borel) = sigma_sets UNIV {a \ b |a b. a \ sigma_sets UNIV A \ b \ sigma_sets UNIV B}" - by (simp add: sets_pair_measure - borel_eq_countable_basis[OF A] borel_eq_countable_basis[OF B]) - also have "\ \ sigma_sets UNIV ((\(a, b). a \ b) ` (A \ B))" (is "... \ ?A") - by (auto intro!: sigma_sets_mono) - also (xtrans) have "?A = sets borel" - by (simp add: borel_eq_countable_basis[OF AB]) - finally have "?r \ ?l" . - moreover have "?l \ ?r" - proof (simp add: sets_pair_measure, safe intro!: sigma_sets_mono) - fix A::"('a \ 'b) set" assume "A \ sigma_sets UNIV {a \ b |a b. a \ sets borel \ b \ sets borel}" - then show "A \ sets borel" - by (induct A) (auto intro!: borel_Times) - qed - ultimately show ?thesis by auto -qed - -lemma borel_prod': - "borel \\<^sub>M borel = (borel :: - ('a::second_countable_topology \ 'b::second_countable_topology) measure)" -proof (rule measure_eqI[OF borel_prod]) - interpret sigma_finite_measure "borel :: 'b measure" - proof qed (intro exI[of _ "{UNIV}"], auto simp: borel_def emeasure_sigma) - fix X :: "('a \ 'b) set" assume asm: "X \ sets (borel \\<^sub>M borel)" - have "UNIV \ UNIV \ sets (borel \\<^sub>M borel :: ('a \ 'b) measure)" - by (simp add: borel_prod) - moreover have "emeasure (borel \\<^sub>M borel) (UNIV \ UNIV :: ('a \ 'b) set) = 0" - by (subst emeasure_pair_measure_Times, simp_all add: borel_def emeasure_sigma) - moreover have "X \ UNIV \ UNIV" by auto - ultimately have "emeasure (borel \\<^sub>M borel) X = 0" by (rule emeasure_eq_0) - thus "emeasure (borel \\<^sub>M borel) X = emeasure borel X" - by (simp add: borel_def emeasure_sigma) -qed - lemma finite_measure_pair_measure: assumes "finite_measure M" "finite_measure N" shows "finite_measure (N \\<^sub>M M)" diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Thu Dec 04 17:05:58 2014 +0100 @@ -11,6 +11,17 @@ "~~/src/HOL/Multivariate_Analysis/Multivariate_Analysis" begin +lemma topological_basis_trivial: "topological_basis {A. open A}" + by (auto simp: topological_basis_def) + +lemma open_prod_generated: "open = generate_topology {A \ B | A B. open A \ open B}" +proof - + have "{A \ B :: ('a \ 'b) set | A B. open A \ open B} = ((\(a, b). a \ b) ` ({A. open A} \ {A. open A}))" + by auto + then show ?thesis + by (auto intro: topological_basis_prod topological_basis_trivial topological_basis_imp_subbasis) +qed + subsection {* Generic Borel spaces *} definition borel :: "'a::topological_space measure" where @@ -147,6 +158,50 @@ lemma borel_compact: "compact (A::'a::t2_space set) \ A \ sets borel" by (auto intro: borel_closed dest!: compact_imp_closed) +lemma second_countable_borel_measurable: + fixes X :: "'a::second_countable_topology set set" + assumes eq: "open = generate_topology X" + shows "borel = sigma UNIV X" + unfolding borel_def +proof (intro sigma_eqI sigma_sets_eqI) + interpret X: sigma_algebra UNIV "sigma_sets UNIV X" + by (rule sigma_algebra_sigma_sets) simp + + fix S :: "'a set" assume "S \ Collect open" + then have "generate_topology X S" + by (auto simp: eq) + then show "S \ sigma_sets UNIV X" + proof induction + case (UN K) + then have K: "\k. k \ K \ open k" + unfolding eq by auto + from ex_countable_basis obtain B :: "'a set set" where + B: "\b. b \ B \ open b" "\X. open X \ \b\B. (\b) = X" and "countable B" + by (auto simp: topological_basis_def) + from B(2)[OF K] obtain m where m: "\k. k \ K \ m k \ B" "\k. k \ K \ (\m k) = k" + by metis + def U \ "(\k\K. m k)" + with m have "countable U" + by (intro countable_subset[OF _ `countable B`]) auto + have "\U = (\A\U. A)" by simp + also have "\ = \K" + unfolding U_def UN_simps by (simp add: m) + finally have "\U = \K" . + + have "\b\U. \k\K. b \ k" + using m by (auto simp: U_def) + then obtain u where u: "\b. b \ U \ u b \ K" and "\b. b \ U \ b \ u b" + by metis + then have "(\b\U. u b) \ \K" "\U \ (\b\U. u b)" + by auto + then have "\K = (\b\U. u b)" + unfolding `\U = \K` by auto + also have "\ \ sigma_sets UNIV X" + using u UN by (intro X.countable_UN' `countable U`) auto + finally show "\K \ sigma_sets UNIV X" . + qed auto +qed (auto simp: eq intro: generate_topology.Basis) + lemma borel_measurable_continuous_on_if: assumes A: "A \ sets borel" and f: "continuous_on A f" and g: "continuous_on (- A) g" shows "(\x. if x \ A then f x else g x) \ borel_measurable borel" @@ -261,6 +316,145 @@ unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto qed +subsection {* Borel spaces on order topologies *} + + +lemma borel_Iio: + "borel = sigma UNIV (range lessThan :: 'a::{linorder_topology, second_countable_topology} set set)" + unfolding second_countable_borel_measurable[OF open_generated_order] +proof (intro sigma_eqI sigma_sets_eqI) + from countable_dense_setE guess D :: "'a set" . note D = this + + interpret L: sigma_algebra UNIV "sigma_sets UNIV (range lessThan)" + by (rule sigma_algebra_sigma_sets) simp + + fix A :: "'a set" assume "A \ range lessThan \ range greaterThan" + then obtain y where "A = {y <..} \ A = {..< y}" + by blast + then show "A \ sigma_sets UNIV (range lessThan)" + proof + assume A: "A = {y <..}" + show ?thesis + proof cases + assume "\x>y. \d. y < d \ d < x" + with D(2)[of "{y <..< x}" for x] have "\x>y. \d\D. y < d \ d < x" + by (auto simp: set_eq_iff) + then have "A = UNIV - (\d\{d\D. y < d}. {..< d})" + by (auto simp: A) (metis less_asym) + also have "\ \ sigma_sets UNIV (range lessThan)" + using D(1) by (intro L.Diff L.top L.countable_INT'') auto + finally show ?thesis . + next + assume "\ (\x>y. \d. y < d \ d < x)" + then obtain x where "y < x" "\d. y < d \ \ d < x" + by auto + then have "A = UNIV - {..< x}" + unfolding A by (auto simp: not_less[symmetric]) + also have "\ \ sigma_sets UNIV (range lessThan)" + by auto + finally show ?thesis . + qed + qed auto +qed auto + +lemma borel_Ioi: + "borel = sigma UNIV (range greaterThan :: 'a::{linorder_topology, second_countable_topology} set set)" + unfolding second_countable_borel_measurable[OF open_generated_order] +proof (intro sigma_eqI sigma_sets_eqI) + from countable_dense_setE guess D :: "'a set" . note D = this + + interpret L: sigma_algebra UNIV "sigma_sets UNIV (range greaterThan)" + by (rule sigma_algebra_sigma_sets) simp + + fix A :: "'a set" assume "A \ range lessThan \ range greaterThan" + then obtain y where "A = {y <..} \ A = {..< y}" + by blast + then show "A \ sigma_sets UNIV (range greaterThan)" + proof + assume A: "A = {..< y}" + show ?thesis + proof cases + assume "\xd. x < d \ d < y" + with D(2)[of "{x <..< y}" for x] have "\xd\D. x < d \ d < y" + by (auto simp: set_eq_iff) + then have "A = UNIV - (\d\{d\D. d < y}. {d <..})" + by (auto simp: A) (metis less_asym) + also have "\ \ sigma_sets UNIV (range greaterThan)" + using D(1) by (intro L.Diff L.top L.countable_INT'') auto + finally show ?thesis . + next + assume "\ (\xd. x < d \ d < y)" + then obtain x where "x < y" "\d. y > d \ x \ d" + by (auto simp: not_less[symmetric]) + then have "A = UNIV - {x <..}" + unfolding A Compl_eq_Diff_UNIV[symmetric] by auto + also have "\ \ sigma_sets UNIV (range greaterThan)" + by auto + finally show ?thesis . + qed + qed auto +qed auto + +lemma borel_measurableI_less: + fixes f :: "'a \ 'b::{linorder_topology, second_countable_topology}" + shows "(\y. {x\space M. f x < y} \ sets M) \ f \ borel_measurable M" + unfolding borel_Iio + by (rule measurable_measure_of) (auto simp: Int_def conj_commute) + +lemma borel_measurableI_greater: + fixes f :: "'a \ 'b::{linorder_topology, second_countable_topology}" + shows "(\y. {x\space M. y < f x} \ sets M) \ f \ borel_measurable M" + unfolding borel_Ioi + by (rule measurable_measure_of) (auto simp: Int_def conj_commute) + +lemma borel_measurable_SUP[measurable (raw)]: + fixes F :: "_ \ _ \ _::{complete_linorder, linorder_topology, second_countable_topology}" + assumes [simp]: "countable I" + assumes [measurable]: "\i. i \ I \ F i \ borel_measurable M" + shows "(\x. SUP i:I. F i x) \ borel_measurable M" + by (rule borel_measurableI_greater) (simp add: less_SUP_iff) + +lemma borel_measurable_INF[measurable (raw)]: + fixes F :: "_ \ _ \ _::{complete_linorder, linorder_topology, second_countable_topology}" + assumes [simp]: "countable I" + assumes [measurable]: "\i. i \ I \ F i \ borel_measurable M" + shows "(\x. INF i:I. F i x) \ borel_measurable M" + by (rule borel_measurableI_less) (simp add: INF_less_iff) + +lemma borel_measurable_lfp[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_linorder, linorder_topology, second_countable_topology})" + assumes "Order_Continuity.continuous F" + assumes *: "\f. f \ borel_measurable M \ F f \ borel_measurable M" + shows "lfp F \ borel_measurable M" +proof - + { fix i have "((F ^^ i) bot) \ borel_measurable M" + by (induct i) (auto intro!: *) } + then have "(\x. SUP i. (F ^^ i) bot x) \ borel_measurable M" + by measurable + also have "(\x. SUP i. (F ^^ i) bot x) = (SUP i. (F ^^ i) bot)" + by auto + also have "(SUP i. (F ^^ i) bot) = lfp F" + by (rule continuous_lfp[symmetric]) fact + finally show ?thesis . +qed + +lemma borel_measurable_gfp[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_linorder, linorder_topology, second_countable_topology})" + assumes "Order_Continuity.down_continuous F" + assumes *: "\f. f \ borel_measurable M \ F f \ borel_measurable M" + shows "gfp F \ borel_measurable M" +proof - + { fix i have "((F ^^ i) top) \ borel_measurable M" + by (induct i) (auto intro!: * simp: bot_fun_def) } + then have "(\x. INF i. (F ^^ i) top x) \ borel_measurable M" + by measurable + also have "(\x. INF i. (F ^^ i) top x) = (INF i. (F ^^ i) top)" + by auto + also have "\ = gfp F" + by (rule down_continuous_gfp[symmetric]) fact + finally show ?thesis . +qed + subsection {* Borel spaces on euclidean spaces *} lemma borel_measurable_inner[measurable (raw)]: @@ -1169,32 +1363,6 @@ thus ?thesis using assms by induct auto qed simp -lemma borel_measurable_SUP[measurable (raw)]: - fixes f :: "'d\countable \ 'a \ ereal" - assumes "\i. i \ A \ f i \ borel_measurable M" - shows "(\x. SUP i : A. f i x) \ borel_measurable M" (is "?sup \ borel_measurable M") - unfolding borel_measurable_ereal_iff_ge -proof - fix a - have "?sup -` {a<..} \ space M = (\i\A. {x\space M. a < f i x})" - by (auto simp: less_SUP_iff) - then show "?sup -` {a<..} \ space M \ sets M" - using assms by auto -qed - -lemma borel_measurable_INF[measurable (raw)]: - fixes f :: "'d :: countable \ 'a \ ereal" - assumes "\i. i \ A \ f i \ borel_measurable M" - shows "(\x. INF i : A. f i x) \ borel_measurable M" (is "?inf \ borel_measurable M") - unfolding borel_measurable_ereal_iff_less -proof - fix a - have "?inf -` {.. space M = (\i\A. {x\space M. f i x < a})" - by (auto simp: INF_less_iff) - then show "?inf -` {.. space M \ sets M" - using assms by auto -qed - lemma [measurable (raw)]: fixes f :: "nat \ 'a \ ereal" assumes "\i. f i \ borel_measurable M" @@ -1325,23 +1493,6 @@ (\x. sup (f x) (g x)::ereal) \ borel_measurable M" by simp -lemma borel_measurable_lfp[consumes 1, case_names continuity step]: - fixes F :: "('a \ ereal) \ ('a \ ereal)" - assumes "Order_Continuity.continuous F" - assumes *: "\f. f \ borel_measurable M \ F f \ borel_measurable M" - shows "lfp F \ borel_measurable M" -proof - - { fix i have "((F ^^ i) (\t. bot)) \ borel_measurable M" - by (induct i) (auto intro!: * simp: bot_fun_def) } - then have "(\x. SUP i. (F ^^ i) (\t. bot) x) \ borel_measurable M" - by measurable - also have "(\x. SUP i. (F ^^ i) (\t. bot) x) = (SUP i. (F ^^ i) bot)" - by (auto simp add: bot_fun_def) - also have "(SUP i. (F ^^ i) bot) = lfp F" - by (rule continuous_lfp[symmetric]) fact - finally show ?thesis . -qed - (* Proof by Jeremy Avigad and Luke Serafin *) lemma isCont_borel: fixes f :: "'b::metric_space \ 'a::metric_space" diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Fin_Map.thy --- a/src/HOL/Probability/Fin_Map.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Fin_Map.thy Thu Dec 04 17:05:58 2014 +0100 @@ -1005,7 +1005,7 @@ then show "f \ (\n. Pi' I (A n))" by auto qed (auto simp: Pi'_def `finite I`) -text {* adapted from @{thm sigma_prod_algebra_sigma_eq} *} +text {* adapted from @{thm sets_PiM_sigma} *} lemma sigma_fprod_algebra_sigma_eq: fixes E :: "'i \ 'a set set" and S :: "'i \ nat \ 'a set" diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Finite_Product_Measure.thy --- a/src/HOL/Probability/Finite_Product_Measure.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Finite_Product_Measure.thy Thu Dec 04 17:05:58 2014 +0100 @@ -362,6 +362,101 @@ apply (auto intro!: arg_cong2[where f=sigma_sets]) done +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) + +lemma sets_PiM_sigma: + assumes \_cover: "\i. i \ I \ \S\E i. countable S \ \ i = \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 `\J = I` have "P = {{\_. undefined}} \ P = {}" + by (auto simp: P_def) + with `I = {}` 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 \ {}" + then have "sets (Pi\<^sub>M I (\i. sigma (\ i) (E i))) = + sets (\\<^sub>\ i\I. vimage_algebra (\\<^sub>E i\I. \ i) (\x. x i) (sigma (\ i) (E i)))" + by (subst sets_PiM_eq_proj) (auto simp: space_measure_of_conv) + also have "\ = sets (\\<^sub>\ i\I. sigma (Pi\<^sub>E I \) (?F i))" + using E by (intro SUP_sigma_cong arg_cong[where f=sets] vimage_algebra_sigma) auto + also have "\ = sets (sigma (Pi\<^sub>E I \) (\i\I. ?F i))" + using `I \ {}` by (intro arg_cong[where f=sets] SUP_sigma_sigma) auto + also have "\ = 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)" + then obtain i A where i: "i \ I" "A \ E i" and Z_def: "Z = (\x. x i) -` A \ Pi\<^sub>E I \" + by auto + from `i \ I` J obtain j where j: "i \ j" "j \ J" "j \ 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 \_cover `j \ I`) + def A' \ "\n. n(i := A)" + then have A'_i: "\n. A' n i = A" + by simp + { fix n assume "n \ Pi\<^sub>E (j - {i}) S" + then have "A' n \ Pi j E" + unfolding PiE_def Pi_def using S(1) by (auto simp: A'_def `A \ E i` ) + with `j \ J` have "{f \ Pi\<^sub>E I \. \i\j. f i \ A' n i} \ 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) `j \ I` have "\i\j. \s\S i. x i \ s" + by (auto simp: PiE_def Pi_def) + then obtain s where s: "\i. i \ j \ s i \ S i" "\i. i \ j \ x i \ s i" + by metis + with `x i \ A` have "\n\PiE (j-{i}) S. \i\j. x i \ A' n i" + by (intro bexI[of _ "restrict (s(i := A)) (j-{i})"]) (auto simp: A'_def split: if_splits) } + then have "Z = (\n\PiE (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 `i\j` A'_i dest: bspec[OF _ `i\j`] + cong: conj_cong) + also have "\ \ sigma_sets (\\<^sub>E i\I. \ i) P" + using `finite j` S(2) + by (intro P.countable_UN' countable_PiE) (simp_all add: image_subset_iff A'_in_P) + finally show "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" + then obtain 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 + then show ?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 `A \ Pi j E` `j \ J` J(2) + by (intro F.finite_INT J `j \ J` `j \ {}` sigma_sets.Basic) blast + qed + qed + finally show "?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" @@ -600,11 +695,6 @@ qed 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) - lemma emeasure_PiM_empty[simp]: "emeasure (PiM {} M) {\_. undefined} = 1" proof - let ?\ = "\A. if A = {} then 0 else (1::ereal)" @@ -927,116 +1017,6 @@ "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 sigma_prod_algebra_sigma_eq_infinite: - fixes E :: "'i \ 'a set set" - assumes S_union: "\i. i \ I \ (\j. S i j) = space (M i)" - and S_in_E: "\i. i \ I \ range (S i) \ E i" - assumes E_closed: "\i. i \ I \ E i \ Pow (space (M i))" - and E_generates: "\i. i \ I \ sets (M i) = sigma_sets (space (M i)) (E i)" - defines "P == {{f\\\<^sub>E i\I. space (M i). f i \ A} | i A. i \ I \ A \ E i}" - shows "sets (PiM I M) = sigma_sets (space (PiM I M)) P" -proof - let ?P = "sigma (space (Pi\<^sub>M I M)) P" - have P_closed: "P \ Pow (space (Pi\<^sub>M I M))" - using E_closed by (auto simp: space_PiM P_def subset_eq) - then have space_P: "space ?P = (\\<^sub>E i\I. space (M i))" - by (simp add: space_PiM) - have "sets (PiM I M) = - sigma_sets (space ?P) {{f \ \\<^sub>E i\I. space (M i). f i \ A} |i A. i \ I \ A \ sets (M i)}" - using sets_PiM_single[of I M] by (simp add: space_P) - also have "\ \ sets (sigma (space (PiM I M)) P)" - proof (safe intro!: sets.sigma_sets_subset) - fix i A assume "i \ I" and A: "A \ sets (M i)" - then have "(\x. x i) \ measurable ?P (sigma (space (M i)) (E i))" - apply (subst measurable_iff_measure_of) - apply (simp_all add: P_closed) - using E_closed - apply (force simp: subset_eq space_PiM) - apply (force simp: subset_eq space_PiM) - apply (auto simp: P_def intro!: sigma_sets.Basic exI[of _ i]) - apply (rule_tac x=Aa in exI) - apply (auto simp: space_PiM) - done - from measurable_sets[OF this, of A] A `i \ I` E_closed - have "(\x. x i) -` A \ space ?P \ sets ?P" - by (simp add: E_generates) - also have "(\x. x i) -` A \ space ?P = {f \ \\<^sub>E i\I. space (M i). f i \ A}" - using P_closed by (auto simp: space_PiM) - finally show "\ \ sets ?P" . - qed - finally show "sets (PiM I M) \ sigma_sets (space (PiM I M)) P" - by (simp add: P_closed) - show "sigma_sets (space (PiM I M)) P \ sets (PiM I M)" - unfolding P_def space_PiM[symmetric] - by (intro sets.sigma_sets_subset) (auto simp: E_generates sets_Collect_single) -qed - -lemma sigma_prod_algebra_sigma_eq: - fixes E :: "'i \ 'a set set" and S :: "'i \ nat \ 'a set" - assumes "finite I" - assumes S_union: "\i. i \ I \ (\j. S i j) = space (M i)" - and S_in_E: "\i. i \ I \ range (S i) \ E i" - assumes E_closed: "\i. i \ I \ E i \ Pow (space (M i))" - and E_generates: "\i. i \ I \ sets (M i) = sigma_sets (space (M i)) (E i)" - defines "P == { Pi\<^sub>E I F | F. \i\I. F i \ E i }" - shows "sets (PiM I M) = sigma_sets (space (PiM I M)) P" -proof - let ?P = "sigma (space (Pi\<^sub>M I M)) P" - from `finite I`[THEN ex_bij_betw_finite_nat] guess T .. - then have T: "\i. i \ I \ T i < card I" "\i. i\I \ the_inv_into I T (T i) = i" - by (auto simp add: bij_betw_def set_eq_iff image_iff the_inv_into_f_f) - have P_closed: "P \ Pow (space (Pi\<^sub>M I M))" - using E_closed by (auto simp: space_PiM P_def subset_eq) - then have space_P: "space ?P = (\\<^sub>E i\I. space (M i))" - by (simp add: space_PiM) - have "sets (PiM I M) = - sigma_sets (space ?P) {{f \ \\<^sub>E i\I. space (M i). f i \ A} |i A. i \ I \ A \ sets (M i)}" - using sets_PiM_single[of I M] by (simp add: space_P) - also have "\ \ sets (sigma (space (PiM I M)) P)" - proof (safe intro!: sets.sigma_sets_subset) - fix i A assume "i \ I" and A: "A \ sets (M i)" - have "(\x. x i) \ measurable ?P (sigma (space (M i)) (E i))" - proof (subst measurable_iff_measure_of) - show "E i \ Pow (space (M i))" using `i \ I` by fact - from space_P `i \ I` show "(\x. x i) \ space ?P \ space (M i)" by auto - show "\A\E i. (\x. x i) -` A \ space ?P \ sets ?P" - proof - fix A assume A: "A \ E i" - then have "(\x. x i) -` A \ space ?P = (\\<^sub>E j\I. if i = j then A else space (M j))" - using E_closed `i \ I` by (auto simp: space_P subset_eq split: split_if_asm) - also have "\ = (\\<^sub>E j\I. \n. if i = j then A else S j n)" - by (intro PiE_cong) (simp add: S_union) - also have "\ = (\xs\{xs. length xs = card I}. \\<^sub>E j\I. if i = j then A else S j (xs ! T j))" - using T - apply (auto simp: PiE_iff bchoice_iff) - apply (rule_tac x="map (\n. f (the_inv_into I T n)) [0.. \ sets ?P" - proof (safe intro!: sets.countable_UN) - fix xs show "(\\<^sub>E j\I. if i = j then A else S j (xs ! T j)) \ sets ?P" - using A S_in_E - by (simp add: P_closed) - (auto simp: P_def subset_eq intro!: exI[of _ "\j. if i = j then A else S j (xs ! T j)"]) - qed - finally show "(\x. x i) -` A \ space ?P \ sets ?P" - using P_closed by simp - qed - qed - from measurable_sets[OF this, of A] A `i \ I` E_closed - have "(\x. x i) -` A \ space ?P \ sets ?P" - by (simp add: E_generates) - also have "(\x. x i) -` A \ space ?P = {f \ \\<^sub>E i\I. space (M i). f i \ A}" - using P_closed by (auto simp: space_PiM) - finally show "\ \ sets ?P" . - qed - finally show "sets (PiM I M) \ sigma_sets (space (PiM I M)) P" - by (simp add: P_closed) - show "sigma_sets (space (PiM I M)) P \ sets (PiM I M)" - using `finite I` - by (auto intro!: sets.sigma_sets_subset sets_PiM_I_finite simp: E_generates P_def) -qed - lemma pair_measure_eq_distr_PiM: fixes M1 :: "'a measure" and M2 :: "'a measure" assumes "sigma_finite_measure M1" "sigma_finite_measure M2" diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Measurable.thy --- a/src/HOL/Probability/Measurable.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Measurable.thy Thu Dec 04 17:05:58 2014 +0100 @@ -377,105 +377,129 @@ qed qed rule +lemma measurable_pred_countable[measurable (raw)]: + assumes "countable X" + shows + "(\i. i \ X \ Measurable.pred M (\x. P x i)) \ Measurable.pred M (\x. \i\X. P x i)" + "(\i. i \ X \ Measurable.pred M (\x. P x i)) \ Measurable.pred M (\x. \i\X. P x i)" + unfolding pred_def + by (auto intro!: sets.sets_Collect_countable_All' sets.sets_Collect_countable_Ex' assms) + subsection {* Measurability for (co)inductive predicates *} +lemma measurable_bot[measurable]: "bot \ measurable M (count_space UNIV)" + by (simp add: bot_fun_def) + +lemma measurable_top[measurable]: "top \ measurable M (count_space UNIV)" + by (simp add: top_fun_def) + +lemma measurable_SUP[measurable]: + fixes F :: "'i \ 'a \ 'b::{complete_lattice, countable}" + assumes [simp]: "countable I" + assumes [measurable]: "\i. i \ I \ F i \ measurable M (count_space UNIV)" + shows "(\x. SUP i:I. F i x) \ measurable M (count_space UNIV)" + unfolding measurable_count_space_eq2_countable +proof (safe intro!: UNIV_I) + fix a + have "(\x. SUP i:I. F i x) -` {a} \ space M = + {x\space M. (\i\I. F i x \ a) \ (\b. (\i\I. F i x \ b) \ a \ b)}" + unfolding SUP_le_iff[symmetric] by auto + also have "\ \ sets M" + by measurable + finally show "(\x. SUP i:I. F i x) -` {a} \ space M \ sets M" . +qed + +lemma measurable_INF[measurable]: + fixes F :: "'i \ 'a \ 'b::{complete_lattice, countable}" + assumes [simp]: "countable I" + assumes [measurable]: "\i. i \ I \ F i \ measurable M (count_space UNIV)" + shows "(\x. INF i:I. F i x) \ measurable M (count_space UNIV)" + unfolding measurable_count_space_eq2_countable +proof (safe intro!: UNIV_I) + fix a + have "(\x. INF i:I. F i x) -` {a} \ space M = + {x\space M. (\i\I. a \ F i x) \ (\b. (\i\I. b \ F i x) \ b \ a)}" + unfolding le_INF_iff[symmetric] by auto + also have "\ \ sets M" + by measurable + finally show "(\x. INF i:I. F i x) -` {a} \ space M \ sets M" . +qed + +lemma measurable_lfp_coinduct[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_lattice, countable})" + assumes "P M" + assumes F: "Order_Continuity.continuous F" + assumes *: "\M A. P M \ (\N. P N \ A \ measurable N (count_space UNIV)) \ F A \ measurable M (count_space UNIV)" + shows "lfp F \ measurable M (count_space UNIV)" +proof - + { fix i from `P M` have "((F ^^ i) bot) \ measurable M (count_space UNIV)" + by (induct i arbitrary: M) (auto intro!: *) } + then have "(\x. SUP i. (F ^^ i) bot x) \ measurable M (count_space UNIV)" + by measurable + also have "(\x. SUP i. (F ^^ i) bot x) = lfp F" + by (subst continuous_lfp) (auto intro: F) + finally show ?thesis . +qed + lemma measurable_lfp: - assumes "Order_Continuity.continuous F" - assumes *: "\A. pred M A \ pred M (F A)" - shows "pred M (lfp F)" + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_lattice, countable})" + assumes F: "Order_Continuity.continuous F" + assumes *: "\A. A \ measurable M (count_space UNIV) \ F A \ measurable M (count_space UNIV)" + shows "lfp F \ measurable M (count_space UNIV)" + by (coinduction rule: measurable_lfp_coinduct[OF _ F]) (blast intro: *) + +lemma measurable_gfp_coinduct[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_lattice, countable})" + assumes "P M" + assumes F: "Order_Continuity.down_continuous F" + assumes *: "\M A. P M \ (\N. P N \ A \ measurable N (count_space UNIV)) \ F A \ measurable M (count_space UNIV)" + shows "gfp F \ measurable M (count_space UNIV)" proof - - { fix i have "Measurable.pred M (\x. (F ^^ i) (\x. False) x)" - by (induct i) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\x. False) x)" + { fix i from `P M` have "((F ^^ i) top) \ measurable M (count_space UNIV)" + by (induct i arbitrary: M) (auto intro!: *) } + then have "(\x. INF i. (F ^^ i) top x) \ measurable M (count_space UNIV)" by measurable - also have "(\x. \i. (F ^^ i) (\x. False) x) = (SUP i. (F ^^ i) bot)" - by (auto simp add: bot_fun_def) - also have "\ = lfp F" - by (rule continuous_lfp[symmetric]) fact + also have "(\x. INF i. (F ^^ i) top x) = gfp F" + by (subst down_continuous_gfp) (auto intro: F) finally show ?thesis . qed lemma measurable_gfp: - assumes "Order_Continuity.down_continuous F" - assumes *: "\A. pred M A \ pred M (F A)" - shows "pred M (gfp F)" -proof - - { fix i have "Measurable.pred M (\x. (F ^^ i) (\x. True) x)" - by (induct i) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\x. True) x)" - by measurable - also have "(\x. \i. (F ^^ i) (\x. True) x) = (INF i. (F ^^ i) top)" - by (auto simp add: top_fun_def) - also have "\ = gfp F" - by (rule down_continuous_gfp[symmetric]) fact - finally show ?thesis . -qed - -lemma measurable_lfp_coinduct[consumes 1, case_names continuity step]: - assumes "P M" - assumes "Order_Continuity.continuous F" - assumes *: "\M A. P M \ (\N. P N \ Measurable.pred N A) \ Measurable.pred M (F A)" - shows "Measurable.pred M (lfp F)" -proof - - { fix i from `P M` have "Measurable.pred M (\x. (F ^^ i) (\x. False) x)" - by (induct i arbitrary: M) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\x. False) x)" - by measurable - also have "(\x. \i. (F ^^ i) (\x. False) x) = (SUP i. (F ^^ i) bot)" - by (auto simp add: bot_fun_def) - also have "\ = lfp F" - by (rule continuous_lfp[symmetric]) fact - finally show ?thesis . -qed - -lemma measurable_gfp_coinduct[consumes 1, case_names continuity step]: - assumes "P M" - assumes "Order_Continuity.down_continuous F" - assumes *: "\M A. P M \ (\N. P N \ Measurable.pred N A) \ Measurable.pred M (F A)" - shows "Measurable.pred M (gfp F)" -proof - - { fix i from `P M` have "Measurable.pred M (\x. (F ^^ i) (\x. True) x)" - by (induct i arbitrary: M) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\x. True) x)" - by measurable - also have "(\x. \i. (F ^^ i) (\x. True) x) = (INF i. (F ^^ i) top)" - by (auto simp add: top_fun_def) - also have "\ = gfp F" - by (rule down_continuous_gfp[symmetric]) fact - finally show ?thesis . -qed + fixes F :: "('a \ 'b) \ ('a \ 'b::{complete_lattice, countable})" + assumes F: "Order_Continuity.down_continuous F" + assumes *: "\A. A \ measurable M (count_space UNIV) \ F A \ measurable M (count_space UNIV)" + shows "gfp F \ measurable M (count_space UNIV)" + by (coinduction rule: measurable_gfp_coinduct[OF _ F]) (blast intro: *) lemma measurable_lfp2_coinduct[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'c \ 'b) \ ('a \ 'c \ 'b::{complete_lattice, countable})" assumes "P M s" - assumes "Order_Continuity.continuous F" - assumes *: "\M A s. P M s \ (\N t. P N t \ Measurable.pred N (A t)) \ Measurable.pred M (F A s)" - shows "Measurable.pred M (lfp F s)" + assumes F: "Order_Continuity.continuous F" + assumes *: "\M A s. P M s \ (\N t. P N t \ A t \ measurable N (count_space UNIV)) \ F A s \ measurable M (count_space UNIV)" + shows "lfp F s \ measurable M (count_space UNIV)" proof - - { fix i from `P M s` have "Measurable.pred M (\x. (F ^^ i) (\t x. False) s x)" + { fix i from `P M s` have "(\x. (F ^^ i) bot s x) \ measurable M (count_space UNIV)" by (induct i arbitrary: M s) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\t x. False) s x)" + then have "(\x. SUP i. (F ^^ i) bot s x) \ measurable M (count_space UNIV)" by measurable - also have "(\x. \i. (F ^^ i) (\t x. False) s x) = (SUP i. (F ^^ i) bot) s" - by (auto simp add: bot_fun_def) - also have "(SUP i. (F ^^ i) bot) = lfp F" - by (rule continuous_lfp[symmetric]) fact + also have "(\x. SUP i. (F ^^ i) bot s x) = lfp F s" + by (subst continuous_lfp) (auto simp: F) finally show ?thesis . qed lemma measurable_gfp2_coinduct[consumes 1, case_names continuity step]: + fixes F :: "('a \ 'c \ 'b) \ ('a \ 'c \ 'b::{complete_lattice, countable})" assumes "P M s" - assumes "Order_Continuity.down_continuous F" - assumes *: "\M A s. P M s \ (\N t. P N t \ Measurable.pred N (A t)) \ Measurable.pred M (F A s)" - shows "Measurable.pred M (gfp F s)" + assumes F: "Order_Continuity.down_continuous F" + assumes *: "\M A s. P M s \ (\N t. P N t \ A t \ measurable N (count_space UNIV)) \ F A s \ measurable M (count_space UNIV)" + shows "gfp F s \ measurable M (count_space UNIV)" proof - - { fix i from `P M s` have "Measurable.pred M (\x. (F ^^ i) (\t x. True) s x)" + { fix i from `P M s` have "(\x. (F ^^ i) top s x) \ measurable M (count_space UNIV)" by (induct i arbitrary: M s) (auto intro!: *) } - then have "Measurable.pred M (\x. \i. (F ^^ i) (\t x. True) s x)" + then have "(\x. INF i. (F ^^ i) top s x) \ measurable M (count_space UNIV)" by measurable - also have "(\x. \i. (F ^^ i) (\t x. True) s x) = (INF i. (F ^^ i) top) s" - by (auto simp add: top_fun_def) - also have "(INF i. (F ^^ i) top) = gfp F" - by (rule down_continuous_gfp[symmetric]) fact + also have "(\x. INF i. (F ^^ i) top s x) = gfp F s" + by (subst down_continuous_gfp) (auto simp: F) finally show ?thesis . qed @@ -531,14 +555,6 @@ qed (simp add: fin) qed -lemma measurable_pred_countable[measurable (raw)]: - assumes "countable X" - shows - "(\i. i \ X \ Measurable.pred M (\x. P x i)) \ Measurable.pred M (\x. \i\X. P x i)" - "(\i. i \ X \ Measurable.pred M (\x. P x i)) \ Measurable.pred M (\x. \i\X. P x i)" - unfolding pred_def - by (auto intro!: sets.sets_Collect_countable_All' sets.sets_Collect_countable_Ex' assms) - lemma measurable_THE: fixes P :: "'a \ 'b \ bool" assumes [measurable]: "\i. Measurable.pred M (P i)" @@ -565,12 +581,6 @@ finally show "f -` X \ space M \ sets M" . qed simp -lemma measurable_bot[measurable]: "Measurable.pred M bot" - by (simp add: bot_fun_def) - -lemma measurable_top[measurable]: "Measurable.pred M top" - by (simp add: top_fun_def) - lemma measurable_Ex1[measurable (raw)]: assumes [simp]: "countable I" and [measurable]: "\i. i \ I \ Measurable.pred M (P i)" shows "Measurable.pred M (\x. \!i\I. P i x)" diff -r 8535cfcfa493 -r ff2bd4a14ddb src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Wed Dec 03 22:44:24 2014 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Thu Dec 04 17:05:58 2014 +0100 @@ -364,6 +364,9 @@ finally show ?thesis . qed +lemma (in sigma_algebra) countable_INT'': + "UNIV \ M \ countable I \ (\i. i \ I \ F i \ M) \ (\i\I. F i) \ M" + by (cases "I = {}") (auto intro: countable_INT') lemma (in sigma_algebra) countable: assumes "\a. a \ A \ {a} \ M" "countable A" @@ -2285,6 +2288,30 @@ using measurable_space[OF f] M by auto qed (auto intro: measurable_sets f dest: sets.sets_into_space) +lemma Sup_sigma_sigma: + assumes [simp]: "M \ {}" and M: "\m. m \ M \ m \ Pow \" + shows "(\\<^sub>\ m\M. sigma \ m) = sigma \ (\M)" +proof (rule measure_eqI) + { fix a m assume "a \ sigma_sets \ m" "m \ M" + then have "a \ sigma_sets \ (\M)" + by induction (auto intro: sigma_sets.intros) } + then show "sets (\\<^sub>\ m\M. sigma \ m) = sets (sigma \ (\M))" + apply (simp add: sets_Sup_sigma space_measure_of_conv M Union_least) + apply (rule sigma_sets_eqI) + apply auto + done +qed (simp add: Sup_sigma_def emeasure_sigma) + +lemma SUP_sigma_sigma: + assumes M: "M \ {}" "\m. m \ M \ f m \ Pow \" + shows "(\\<^sub>\ m\M. sigma \ (f m)) = sigma \ (\m\M. f m)" +proof - + have "Sup_sigma (sigma \ ` f ` M) = sigma \ (\(f ` M))" + using M by (intro Sup_sigma_sigma) auto + then show ?thesis + by (simp add: image_image) +qed + subsection {* The smallest $\sigma$-algebra regarding a function *} definition @@ -2332,10 +2359,20 @@ finally show "g -` A \ space N \ sets N" . qed (insert g, auto) +lemma vimage_algebra_sigma: + assumes X: "X \ Pow \'" and f: "f \ \ \ \'" + shows "vimage_algebra \ f (sigma \' X) = sigma \ {f -` A \ \ | A. A \ X }" (is "?V = ?S") +proof (rule measure_eqI) + have \: "{f -` A \ \ |A. A \ X} \ Pow \" by auto + show "sets ?V = sets ?S" + using sigma_sets_vimage_commute[OF f, of X] + by (simp add: space_measure_of_conv f sets_vimage_algebra2 \ X) +qed (simp add: vimage_algebra_def emeasure_sigma) + lemma vimage_algebra_vimage_algebra_eq: assumes *: "f \ X \ Y" "g \ Y \ space M" shows "vimage_algebra X f (vimage_algebra Y g M) = vimage_algebra X (\x. g (f x)) M" - (is "?VV = ?V") + (is "?VV = ?V") proof (rule measure_eqI) have "(\x. g (f x)) \ X \ space M" "\A. A \ f -` Y \ X = A \ X" using * by auto