# HG changeset patch # User hoelzl # Date 1301500436 -7200 # Node ID f88c7315d72d4f7eb2e95d135367311c34da7949 # Parent 392fd6c4669c8a5c389e2c79bf9498fe41e2f1aa add lebesgue_real_affine diff -r 392fd6c4669c -r f88c7315d72d src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Wed Mar 30 11:32:52 2011 +0200 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Wed Mar 30 17:53:56 2011 +0200 @@ -980,4 +980,97 @@ shows "integral\<^isup>L lborel f = \x. f (p2e x) \(lborel_space.P DIM('a))" using f by (simp add: borel_fubini_positiv_integral lebesgue_integral_def) + +lemma Int_stable_atLeastAtMost: + "Int_stable \space = UNIV, sets = range (\(a,b). {a::'a::ordered_euclidean_space .. b}) \" +proof (simp add: Int_stable_def image_iff, intro allI) + fix a1 b1 a2 b2 :: 'a + have "\ia b. {a1$$i..b1$$i} \ {a2$$i..b2$$i} = {a..b}" by auto + then have "\a b. \i {a2$$i..b2$$i} = {a i..b i}" + unfolding choice_iff' . + then guess a b by safe + then have "{a1..b1} \ {a2..b2} = {(\\ i. a i) .. (\\ i. b i)}" + by (simp add: set_eq_iff eucl_le[where 'a='a] all_conj_distrib[symmetric]) blast + then show "\a' b'. {a1..b1} \ {a2..b2} = {a'..b'}" by blast +qed + +lemma (in sigma_algebra) borel_measurable_sets: + assumes "f \ measurable borel M" "A \ sets M" + shows "f -` A \ sets borel" + using measurable_sets[OF assms] by simp + +lemma (in sigma_algebra) measurable_identity[intro,simp]: + "(\x. x) \ measurable M M" + unfolding measurable_def by auto + +lemma lebesgue_real_affine: + fixes X :: "real set" + assumes "X \ sets borel" and "c \ 0" + shows "measure lebesgue X = extreal \c\ * measure lebesgue ((\x. t + c * x) -` X)" + (is "_ = ?\ X") +proof - + let ?E = "\space = UNIV, sets = range (\(a,b). {a::real .. b})\ :: real algebra" + let "?M \" = "\space = space ?E, sets = sets (sigma ?E), measure = \\ :: real measure_space" + have *: "?M (measure lebesgue) = lborel" + unfolding borel_eq_atLeastAtMost[symmetric] + by (simp add: lborel_def lebesgue_def) + have **: "?M ?\ = lborel \ measure := ?\ \" + unfolding borel_eq_atLeastAtMost[symmetric] + by (simp add: lborel_def lebesgue_def) + show ?thesis + proof (rule measure_unique_Int_stable[where X=X, OF Int_stable_atLeastAtMost], unfold * **) + show "X \ sets (sigma ?E)" + unfolding borel_eq_atLeastAtMost[symmetric] by fact + have "\x. \xa. x \ cube xa" apply(rule_tac x=x in mem_big_cube) by fastsimp + then show "(\i. cube i) = space ?E" by auto + show "incseq cube" by (intro incseq_SucI cube_subset_Suc) + show "range cube \ sets ?E" + unfolding cube_def_raw by auto + show "\i. measure lebesgue (cube i) \ \" + by (simp add: cube_def) + show "measure_space lborel" by default + then interpret sigma_algebra "lborel\measure := ?\\" + by (auto simp add: measure_space_def) + show "measure_space (lborel\measure := ?\\)" + proof + show "positive (lborel\measure := ?\\) (measure (lborel\measure := ?\\))" + by (auto simp: positive_def intro!: extreal_0_le_mult borel.borel_measurable_sets) + show "countably_additive (lborel\measure := ?\\) (measure (lborel\measure := ?\\))" + proof (simp add: countably_additive_def, safe) + fix A :: "nat \ real set" assume A: "range A \ sets borel" "disjoint_family A" + then have Ai: "\i. A i \ sets borel" by auto + have "(\n. measure lebesgue ((\x. t + c * x) -` A n)) = measure lebesgue (\n. (\x. t + c * x) -` A n)" + proof (intro lborel.measure_countably_additive) + { fix n have "(\x. t + c * x) -` A n \ space borel \ sets borel" + using A borel.measurable_ident unfolding id_def + by (intro measurable_sets[where A=borel] borel.borel_measurable_add[OF _ borel.borel_measurable_times]) auto } + then show "range (\i. (\x. t + c * x) -` A i) \ sets borel" by auto + from `disjoint_family A` + show "disjoint_family (\i. (\x. t + c * x) -` A i)" + by (rule disjoint_family_on_bisimulation) auto + qed + with Ai show "(\n. ?\ (A n)) = ?\ (UNION UNIV A)" + by (subst suminf_cmult_extreal) + (auto simp: vimage_UN borel.borel_measurable_sets) + qed + qed + fix X assume "X \ sets ?E" + then obtain a b where [simp]: "X = {a .. b}" by auto + show "measure lebesgue X = ?\ X" + proof cases + assume "0 < c" + then have "(\x. t + c * x) -` {a..b} = {(a - t) / c .. (b - t) / c}" + by (auto simp: field_simps) + with `0 < c` show ?thesis + by (cases "a \ b") (auto simp: field_simps) + next + assume "\ 0 < c" with `c \ 0` have "c < 0" by auto + then have *: "(\x. t + c * x) -` {a..b} = {(b - t) / c .. (a - t) / c}" + by (auto simp: field_simps) + with `c < 0` show ?thesis + by (cases "a \ b") (auto simp: field_simps) + qed + qed +qed + end