# HG changeset patch # User hoelzl # Date 1384280936 -3600 # Node ID dbb8ecfe13377168064d76390d6083022c30993e # Parent 7fb88ed6ff3c5a109f92332359bb89f7a20634b9 add restrict_space measure diff -r 7fb88ed6ff3c -r dbb8ecfe1337 src/HOL/Library/FuncSet.thy --- a/src/HOL/Library/FuncSet.thy Tue Nov 12 19:28:55 2013 +0100 +++ b/src/HOL/Library/FuncSet.thy Tue Nov 12 19:28:56 2013 +0100 @@ -183,18 +183,20 @@ subsection{*Bounded Abstraction: @{term restrict}*} -lemma restrict_in_funcset: "(!!x. x \ A ==> f x \ B) ==> (\x\A. f x) \ A -> B" +lemma restrict_in_funcset: "(\x. x \ A \ f x \ B) \ (\x\A. f x) \ A \ B" by (simp add: Pi_def restrict_def) -lemma restrictI[intro!]: "(!!x. x \ A ==> f x \ B x) ==> (\x\A. f x) \ Pi A B" +lemma restrictI[intro!]: "(\x. x \ A \ f x \ B x) \ (\x\A. f x) \ Pi A B" by (simp add: Pi_def restrict_def) -lemma restrict_apply [simp]: - "(\y\A. f y) x = (if x \ A then f x else undefined)" +lemma restrict_apply[simp]: "(\y\A. f y) x = (if x \ A then f x else undefined)" by (simp add: restrict_def) +lemma restrict_apply': "x \ A \ (\y\A. f y) x = f x" + by simp + lemma restrict_ext: - "(!!x. x \ A ==> f x = g x) ==> (\x\A. f x) = (\x\A. g x)" + "(\x. x \ A \ f x = g x) \ (\x\A. f x) = (\x\A. g x)" by (simp add: fun_eq_iff Pi_def restrict_def) lemma inj_on_restrict_eq [simp]: "inj_on (restrict f A) A = inj_on f A" @@ -364,6 +366,9 @@ lemma PiE_empty_domain[simp]: "PiE {} T = {%x. undefined}" unfolding PiE_def by simp +lemma PiE_UNIV_domain: "PiE UNIV T = Pi UNIV T" + unfolding PiE_def by simp + lemma PiE_empty_range[simp]: "i \ I \ F i = {} \ (PIE i:I. F i) = {}" unfolding PiE_def by auto diff -r 7fb88ed6ff3c -r dbb8ecfe1337 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Tue Nov 12 19:28:55 2013 +0100 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Tue Nov 12 19:28:56 2013 +0100 @@ -2521,6 +2521,36 @@ "f \ borel_measurable (count_space A)" by simp +section {* Measures with Restricted Space *} + +lemma positive_integral_restrict_space: + assumes \: "\ \ sets M" and f: "f \ borel_measurable M" "\x. 0 \ f x" "\x. x \ space M - \ \ f x = 0" + shows "positive_integral (restrict_space M \) f = positive_integral M f" +using f proof (induct rule: borel_measurable_induct) + case (cong f g) then show ?case + using positive_integral_cong[of M f g] positive_integral_cong[of "restrict_space M \" f g] + sets.sets_into_space[OF `\ \ sets M`] + by (simp add: subset_eq space_restrict_space) +next + case (set A) + then have "A \ \" + unfolding indicator_eq_0_iff by (auto dest: sets.sets_into_space) + with set `\ \ sets M` sets.sets_into_space[OF `\ \ sets M`] show ?case + by (subst positive_integral_indicator') + (auto simp add: sets_restrict_space_iff space_restrict_space + emeasure_restrict_space Int_absorb2 + dest: sets.sets_into_space) +next + case (mult f c) then show ?case + by (cases "c = 0") (simp_all add: measurable_restrict_space1 \ positive_integral_cmult) +next + case (add f g) then show ?case + by (simp add: measurable_restrict_space1 \ positive_integral_add ereal_add_nonneg_eq_0_iff) +next + case (seq F) then show ?case + by (auto simp add: SUP_eq_iff measurable_restrict_space1 \ positive_integral_monotone_convergence_SUP) +qed + section {* Measure spaces with an associated density *} definition density :: "'a measure \ ('a \ ereal) \ 'a measure" where diff -r 7fb88ed6ff3c -r dbb8ecfe1337 src/HOL/Probability/Measure_Space.thy --- a/src/HOL/Probability/Measure_Space.thy Tue Nov 12 19:28:55 2013 +0100 +++ b/src/HOL/Probability/Measure_Space.thy Tue Nov 12 19:28:56 2013 +0100 @@ -1118,6 +1118,10 @@ and measurable_distr_eq2[simp]: "measurable Mg' (distr Mg Ng g) = measurable Mg' Ng" by (auto simp: measurable_def) +lemma distr_cong: + "M = K \ sets N = sets L \ (\x. x \ space M \ f x = g x) \ distr M N f = distr K L g" + using sets_eq_imp_space_eq[of N L] by (simp add: distr_def Int_def cong: rev_conj_cong) + lemma emeasure_distr: fixes f :: "'a \ 'b" assumes f: "f \ measurable M N" and A: "A \ sets N" @@ -1649,5 +1653,50 @@ show "sigma_finite_measure (count_space A)" .. qed +section {* Measure restricted to space *} + +lemma emeasure_restrict_space: + assumes "\ \ sets M" "A \ \" + shows "emeasure (restrict_space M \) A = emeasure M A" +proof cases + assume "A \ sets M" + + have "emeasure (restrict_space M \) A = emeasure M (A \ \)" + proof (rule emeasure_measure_of[OF restrict_space_def]) + show "op \ \ ` sets M \ Pow \" "A \ sets (restrict_space M \)" + using assms `A \ sets M` by (auto simp: sets_restrict_space sets.sets_into_space) + show "positive (sets (restrict_space M \)) (\A. emeasure M (A \ \))" + by (auto simp: positive_def emeasure_nonneg) + show "countably_additive (sets (restrict_space M \)) (\A. emeasure M (A \ \))" + proof (rule countably_additiveI) + fix A :: "nat \ _" assume "range A \ sets (restrict_space M \)" "disjoint_family A" + with assms have "\i. A i \ sets M" "\i. A i \ space M" "disjoint_family A" + by (auto simp: sets_restrict_space_iff subset_eq dest: sets.sets_into_space) + with `\ \ sets M` show "(\i. emeasure M (A i \ \)) = emeasure M ((\i. A i) \ \)" + by (subst suminf_emeasure) (auto simp: disjoint_family_subset) + qed + qed + with `A \ \` show ?thesis + by (simp add: Int_absorb2) +next + assume "A \ sets M" + moreover with assms have "A \ sets (restrict_space M \)" + by (simp add: sets_restrict_space_iff) + ultimately show ?thesis + by (simp add: emeasure_notin_sets) +qed + +lemma restrict_count_space: + assumes "A \ B" shows "restrict_space (count_space B) A = count_space A" +proof (rule measure_eqI) + show "sets (restrict_space (count_space B) A) = sets (count_space A)" + using `A \ B` by (subst sets_restrict_space) auto + moreover fix X assume "X \ sets (restrict_space (count_space B) A)" + moreover note `A \ B` + ultimately have "X \ A" by auto + with `A \ B` show "emeasure (restrict_space (count_space B) A) X = emeasure (count_space A) X" + by (cases "finite X") (auto simp add: emeasure_restrict_space) +qed + end diff -r 7fb88ed6ff3c -r dbb8ecfe1337 src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Tue Nov 12 19:28:55 2013 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Tue Nov 12 19:28:56 2013 +0100 @@ -1171,16 +1171,13 @@ using assms by(simp_all add: sets_measure_of_conv space_measure_of_conv) -lemma (in sigma_algebra) sets_measure_of_eq[simp]: - "sets (measure_of \ M \) = M" +lemma (in sigma_algebra) sets_measure_of_eq[simp]: "sets (measure_of \ M \) = M" using space_closed by (auto intro!: sigma_sets_eq) -lemma (in sigma_algebra) space_measure_of_eq[simp]: - "space (measure_of \ M \) = \" - using space_closed by (auto intro!: sigma_sets_eq) +lemma (in sigma_algebra) space_measure_of_eq[simp]: "space (measure_of \ M \) = \" + by (rule space_measure_of_conv) -lemma measure_of_subset: - "M \ Pow \ \ M' \ M \ sets (measure_of \ M' \) \ sets (measure_of \ M \')" +lemma measure_of_subset: "M \ Pow \ \ M' \ M \ sets (measure_of \ M' \) \ sets (measure_of \ M \')" by (auto intro!: sigma_sets_subseteq) lemma sigma_sets_mono'': @@ -1725,6 +1722,42 @@ qed auto qed +subsection {* Restricted Space \-Algebra *} + +definition "restrict_space M \ = measure_of \ ((op \ \) ` sets M) (\A. emeasure M (A \ \))" + +lemma space_restrict_space: "space (restrict_space M \) = \" + unfolding restrict_space_def by (subst space_measure_of) auto + +lemma sets_restrict_space: "\ \ space M \ sets (restrict_space M \) = (op \ \) ` sets M" + using sigma_sets_vimage[of "\x. x" \ "space M" "sets M"] + unfolding restrict_space_def + by (subst sets_measure_of) (auto simp: sets.sigma_sets_eq Int_commute[of _ \] sets.space_closed) + +lemma sets_restrict_space_iff: + "\ \ sets M \ A \ sets (restrict_space M \) \ (A \ \ \ A \ sets M)" + by (subst sets_restrict_space) (auto dest: sets.sets_into_space) + +lemma measurable_restrict_space1: + assumes \: "\ \ sets M" and f: "f \ measurable M N" shows "f \ measurable (restrict_space M \) N" + unfolding measurable_def +proof (intro CollectI conjI ballI) + show sp: "f \ space (restrict_space M \) \ space N" + using measurable_space[OF f] sets.sets_into_space[OF \] by (auto simp: space_restrict_space) + + fix A assume "A \ sets N" + have "f -` A \ space (restrict_space M \) = (f -` A \ space M) \ \" + using sets.sets_into_space[OF \] by (auto simp: space_restrict_space) + also have "\ \ sets (restrict_space M \)" + unfolding sets_restrict_space_iff[OF \] + using measurable_sets[OF f `A \ sets N`] \ by blast + finally show "f -` A \ space (restrict_space M \) \ sets (restrict_space M \)" . +qed + +lemma measurable_restrict_space2: + "\ \ sets N \ f \ space M \ \ \ f \ measurable M N \ f \ measurable M (restrict_space N \)" + by (simp add: measurable_def space_restrict_space sets_restrict_space_iff) + subsection {* A Two-Element Series *} definition binaryset :: "'a set \ 'a set \ nat \ 'a set "