# HG changeset patch # User hoelzl # Date 1291300368 -3600 # Node ID e2929572d5c761cf73442362b66f80727d4541fb # Parent 177cd660abb764a0d1a0c203f786a8701a692579# Parent 9a9d33f6fb46bf842742194f3de40afaad2ebd51 merged diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Complete_Lattice.thy --- a/src/HOL/Complete_Lattice.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Complete_Lattice.thy Thu Dec 02 15:32:48 2010 +0100 @@ -172,6 +172,18 @@ "(\m. m \ B \ \n\A. f n \ g m) \ (INF n:A. f n) \ (INF n:B. g n)" by (force intro!: Inf_mono simp: INFI_def) +lemma SUP_subset: "A \ B \ SUPR A f \ SUPR B f" + by (intro SUP_mono) auto + +lemma INF_subset: "A \ B \ INFI B f \ INFI A f" + by (intro INF_mono) auto + +lemma SUP_commute: "(SUP i:A. SUP j:B. f i j) = (SUP j:B. SUP i:A. f i j)" + by (iprover intro: SUP_leI le_SUPI order_trans antisym) + +lemma INF_commute: "(INF i:A. INF j:B. f i j) = (INF j:B. INF i:A. f i j)" + by (iprover intro: INF_leI le_INFI order_trans antisym) + end lemma less_Sup_iff: @@ -184,6 +196,16 @@ shows "Inf S < a \ (\x\S. x < a)" unfolding not_le[symmetric] le_Inf_iff by auto +lemma less_SUP_iff: + fixes a :: "'a::{complete_lattice,linorder}" + shows "a < (SUP i:A. f i) \ (\x\A. a < f x)" + unfolding SUPR_def less_Sup_iff by auto + +lemma INF_less_iff: + fixes a :: "'a::{complete_lattice,linorder}" + shows "(INF i:A. f i) < a \ (\x\A. f x < a)" + unfolding INFI_def Inf_less_iff by auto + subsection {* @{typ bool} and @{typ "_ \ _"} as complete lattice *} instantiation bool :: complete_lattice diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Thu Dec 02 15:32:48 2010 +0100 @@ -6,12 +6,6 @@ imports Sigma_Algebra Positive_Infinite_Real Multivariate_Analysis begin -lemma (in sigma_algebra) sets_sigma_subset: - assumes "space N = space M" - assumes "sets N \ sets M" - shows "sets (sigma N) \ sets M" - by (unfold assms sets_sigma, rule sigma_sets_subset, rule assms) - lemma LIMSEQ_max: "u ----> (x::real) \ (\i. max (u i) 0) ----> max x 0" by (fastsimp intro!: LIMSEQ_I dest!: LIMSEQ_D) @@ -612,13 +606,10 @@ then show ?thesis by (intro sets_sigma_subset) auto qed -lemma algebra_eqI: assumes "sets A = sets (B::'a algebra)" "space A = space B" - shows "A = B" using assms by auto - lemma borel_eq_atMost: "borel = (sigma \space=UNIV, sets=range (\ a. {.. a::'a\ordered_euclidean_space})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using halfspace_le_span_atMost halfspace_span_halfspace_le open_span_halfspace by auto @@ -629,7 +620,7 @@ lemma borel_eq_atLeastAtMost: "borel = (sigma \space=UNIV, sets=range (\ (a :: 'a\ordered_euclidean_space, b). {a .. b})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using atMost_span_atLeastAtMost halfspace_le_span_atMost halfspace_span_halfspace_le open_span_halfspace @@ -641,7 +632,7 @@ lemma borel_eq_greaterThan: "borel = (sigma \space=UNIV, sets=range (\ (a :: 'a\ordered_euclidean_space). {a <..})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using halfspace_le_span_greaterThan halfspace_span_halfspace_le open_span_halfspace @@ -653,7 +644,7 @@ lemma borel_eq_lessThan: "borel = (sigma \space=UNIV, sets=range (\ (a :: 'a\ordered_euclidean_space). {..< a})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using halfspace_le_span_lessThan halfspace_span_halfspace_ge open_span_halfspace @@ -665,7 +656,7 @@ lemma borel_eq_greaterThanLessThan: "borel = (sigma \space=UNIV, sets=range (\ (a, b). {a <..< (b :: 'a \ ordered_euclidean_space)})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets ?SIGMA \ sets borel" by (rule borel.sets_sigma_subset) auto show "sets borel \ sets ?SIGMA" @@ -686,7 +677,7 @@ lemma borel_eq_halfspace_le: "borel = (sigma \space=UNIV, sets=range (\ (a, i). {x::'a::ordered_euclidean_space. x$$i \ a})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using open_span_halfspace halfspace_span_halfspace_le by auto show "sets ?SIGMA \ sets borel" @@ -696,7 +687,7 @@ lemma borel_eq_halfspace_less: "borel = (sigma \space=UNIV, sets=range (\ (a, i). {x::'a::ordered_euclidean_space. x$$i < a})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using open_span_halfspace . show "sets ?SIGMA \ sets borel" @@ -706,7 +697,7 @@ lemma borel_eq_halfspace_gt: "borel = (sigma \space=UNIV, sets=range (\ (a, i). {x::'a::ordered_euclidean_space. a < x$$i})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using halfspace_le_span_halfspace_gt open_span_halfspace halfspace_span_halfspace_le by auto show "sets ?SIGMA \ sets borel" @@ -716,7 +707,7 @@ lemma borel_eq_halfspace_ge: "borel = (sigma \space=UNIV, sets=range (\ (a, i). {x::'a::ordered_euclidean_space. a \ x$$i})\)" (is "_ = ?SIGMA") -proof (rule algebra_eqI, rule antisym) +proof (intro algebra.equality antisym) show "sets borel \ sets ?SIGMA" using halfspace_span_halfspace_ge open_span_halfspace by auto show "sets ?SIGMA \ sets borel" @@ -1025,7 +1016,6 @@ then obtain T x where T: "open T" "Real ` (T \ {0..}) = B - {\}" and x: "\ \ B \ 0 \ x" "\ \ B \ {Real x <..} \ B" unfolding open_pinfreal_def by blast - have "Real -` B = Real -` (B - {\})" by auto also have "\ = Real -` (Real ` (T \ {0..}))" using T by simp also have "\ = (if 0 \ T then T \ {.. 0} else T \ {0..})" @@ -1231,12 +1221,10 @@ hence **: "\a. {x\space M. f x < a} \ sets M" unfolding less_eq_le_pinfreal_measurable unfolding greater_eq_le_measurable . - show "f \ borel_measurable M" unfolding borel_measurable_pinfreal_eq_real borel_measurable_iff_greater proof safe have "f -` {\} \ space M = space M - {x\space M. f x < \}" by auto then show \: "f -` {\} \ space M \ sets M" using ** by auto - fix a have "{w \ space M. a < real (f w)} = (if 0 \ a then {w\space M. Real a < f w} - (f -` {\} \ space M) else space M)" @@ -1367,14 +1355,14 @@ by induct auto qed (simp add: borel_measurable_const) -lemma (in sigma_algebra) borel_measurable_pinfreal_min[intro, simp]: +lemma (in sigma_algebra) borel_measurable_pinfreal_min[simp, intro]: fixes f g :: "'a \ pinfreal" assumes "f \ borel_measurable M" assumes "g \ borel_measurable M" shows "(\x. min (g x) (f x)) \ borel_measurable M" using assms unfolding min_def by (auto intro!: measurable_If) -lemma (in sigma_algebra) borel_measurable_pinfreal_max[intro]: +lemma (in sigma_algebra) borel_measurable_pinfreal_max[simp, intro]: fixes f g :: "'a \ pinfreal" assumes "f \ borel_measurable M" and "g \ borel_measurable M" @@ -1421,7 +1409,7 @@ using assms by auto qed -lemma (in sigma_algebra) borel_measurable_psuminf: +lemma (in sigma_algebra) borel_measurable_psuminf[simp, intro]: assumes "\i. f i \ borel_measurable M" shows "(\x. (\\<^isub>\ i. f i x)) \ borel_measurable M" using assms unfolding psuminf_def @@ -1437,7 +1425,6 @@ proof - let "?pu x i" = "max (u i x) 0" let "?nu x i" = "max (- u i x) 0" - { fix x assume x: "x \ space M" have "(?pu x) ----> max (u' x) 0" "(?nu x) ----> max (- u' x) 0" @@ -1447,10 +1434,8 @@ "(SUP n. INF m. Real (- u (n + m) x)) = Real (- u' x)" by (simp_all add: Real_max'[symmetric]) } note eq = this - have *: "\x. real (Real (u' x)) - real (Real (- u' x)) = u' x" by auto - have "(SUP n. INF m. (\x. Real (u (n + m) x))) \ borel_measurable M" "(SUP n. INF m. (\x. Real (- u (n + m) x))) \ borel_measurable M" using u by (auto intro: borel_measurable_SUP borel_measurable_INF borel_measurable_Real) diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Complete_Measure.thy --- a/src/HOL/Probability/Complete_Measure.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Complete_Measure.thy Thu Dec 02 15:32:48 2010 +0100 @@ -189,56 +189,13 @@ qed qed -lemma (in sigma_algebra) simple_functionD': - assumes "simple_function f" - shows "f -` {x} \ space M \ sets M" -proof cases - assume "x \ f`space M" from simple_functionD(2)[OF assms this] show ?thesis . -next - assume "x \ f`space M" then have "f -` {x} \ space M = {}" by auto - then show ?thesis by auto -qed - -lemma (in sigma_algebra) simple_function_If: - assumes sf: "simple_function f" "simple_function g" and A: "A \ sets M" - shows "simple_function (\x. if x \ A then f x else g x)" (is "simple_function ?IF") -proof - - def F \ "\x. f -` {x} \ space M" and G \ "\x. g -` {x} \ space M" - show ?thesis unfolding simple_function_def - proof safe - have "?IF ` space M \ f ` space M \ g ` space M" by auto - from finite_subset[OF this] assms - show "finite (?IF ` space M)" unfolding simple_function_def by auto - next - fix x assume "x \ space M" - then have *: "?IF -` {?IF x} \ space M = (if x \ A - then ((F (f x) \ A) \ (G (f x) - (G (f x) \ A))) - else ((F (g x) \ A) \ (G (g x) - (G (g x) \ A))))" - using sets_into_space[OF A] by (auto split: split_if_asm simp: G_def F_def) - have [intro]: "\x. F x \ sets M" "\x. G x \ sets M" - unfolding F_def G_def using sf[THEN simple_functionD'] by auto - show "?IF -` {?IF x} \ space M \ sets M" unfolding * using A by auto - qed -qed - -lemma (in measure_space) null_sets_finite_UN: - assumes "finite S" "\i. i \ S \ A i \ null_sets" - shows "(\i\S. A i) \ null_sets" -proof (intro CollectI conjI) - show "(\i\S. A i) \ sets M" using assms by (intro finite_UN) auto - have "\ (\i\S. A i) \ (\i\S. \ (A i))" - using assms by (intro measure_finitely_subadditive) auto - then show "\ (\i\S. A i) = 0" - using assms by auto -qed - lemma (in completeable_measure_space) completion_ex_simple_function: assumes f: "completion.simple_function f" shows "\f'. simple_function f' \ (AE x. f x = f' x)" proof - let "?F x" = "f -` {x} \ space M" have F: "\x. ?F x \ sets completion" and fin: "finite (f`space M)" - using completion.simple_functionD'[OF f] + using completion.simple_functionD[OF f] completion.simple_functionD[OF f] by simp_all have "\x. \N. N \ null_sets \ null_part (?F x) \ N" using F null_part by auto diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Lebesgue_Integration.thy --- a/src/HOL/Probability/Lebesgue_Integration.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Lebesgue_Integration.thy Thu Dec 02 15:32:48 2010 +0100 @@ -6,20 +6,6 @@ imports Measure Borel_Space begin -lemma image_set_cong: - assumes A: "\x. x \ A \ \y\B. f x = g y" - assumes B: "\y. y \ B \ \x\A. g y = f x" - shows "f ` A = g ` B" -proof safe - fix x assume "x \ A" - with A obtain y where "f x = g y" "y \ B" by auto - then show "f x \ g ` B" by auto -next - fix y assume "y \ B" - with B obtain x where "g y = f x" "x \ A" by auto - then show "g y \ f ` A" by auto -qed - lemma sums_If_finite: assumes finite: "finite {r. P r}" shows "(\r. if P r then f r else 0) sums (\r\{r. P r}. f r)" (is "?F sums _") @@ -57,9 +43,15 @@ lemma (in sigma_algebra) simple_functionD: assumes "simple_function g" - shows "finite (g ` space M)" - "x \ g ` space M \ g -` {x} \ space M \ sets M" - using assms unfolding simple_function_def by auto + shows "finite (g ` space M)" and "g -` X \ space M \ sets M" +proof - + show "finite (g ` space M)" + using assms unfolding simple_function_def by auto + have "g -` X \ space M = g -` (X \ g`space M) \ space M" by auto + also have "\ = (\x\X \ g`space M. g-`{x} \ space M)" by auto + finally show "g -` X \ space M \ sets M" using assms + by (auto intro!: finite_UN simp del: UN_simps simp: simple_function_def) +qed lemma (in sigma_algebra) simple_function_indicator_representation: fixes f ::"'a \ pinfreal" @@ -516,9 +508,7 @@ proof - interpret v: measure_space M \ by (rule measure_space_cong) fact - have "\x. x \ space M \ f -` {f x} \ space M \ sets M" - using `simple_function f`[THEN simple_functionD(2)] by auto - with assms show ?thesis + from simple_functionD[OF `simple_function f`] assms show ?thesis unfolding simple_integral_def v.simple_integral_def by (auto intro!: setsum_cong) qed @@ -629,6 +619,28 @@ by (auto simp: setsum_right_distrib field_simps intro!: setsum_cong) qed +lemma (in sigma_algebra) simple_function_If: + assumes sf: "simple_function f" "simple_function g" and A: "A \ sets M" + shows "simple_function (\x. if x \ A then f x else g x)" (is "simple_function ?IF") +proof - + def F \ "\x. f -` {x} \ space M" and G \ "\x. g -` {x} \ space M" + show ?thesis unfolding simple_function_def + proof safe + have "?IF ` space M \ f ` space M \ g ` space M" by auto + from finite_subset[OF this] assms + show "finite (?IF ` space M)" unfolding simple_function_def by auto + next + fix x assume "x \ space M" + then have *: "?IF -` {?IF x} \ space M = (if x \ A + then ((F (f x) \ A) \ (G (f x) - (G (f x) \ A))) + else ((F (g x) \ A) \ (G (g x) - (G (g x) \ A))))" + using sets_into_space[OF A] by (auto split: split_if_asm simp: G_def F_def) + have [intro]: "\x. F x \ sets M" "\x. G x \ sets M" + unfolding F_def G_def using sf[THEN simple_functionD(2)] by auto + show "?IF -` {?IF x} \ space M \ sets M" unfolding * using A by auto + qed +qed + lemma (in measure_space) simple_integral_mono_AE: assumes "simple_function f" and "simple_function g" and mono: "AE x. f x \ g x" @@ -652,8 +664,8 @@ obtain N where N: "{x\space M. \ f x \ g x} \ N" "N \ sets M" "\ N = 0" using mono by (auto elim!: AE_E) have "?S x \ N" using N `x \ space M` False by auto - moreover have "?S x \ sets M" using assms `x \ space M` - by (rule_tac Int) (auto intro!: simple_functionD(2)) + moreover have "?S x \ sets M" using assms + by (rule_tac Int) (auto intro!: simple_functionD) ultimately have "\ (?S x) \ \ N" using `N \ sets M` by (auto intro!: measure_mono) then show ?thesis using `\ N = 0` by auto @@ -831,8 +843,67 @@ section "Continuous posititve integration" definition (in measure_space) + "positive_integral f = SUPR {g. simple_function g \ g \ f} simple_integral" + +lemma (in measure_space) positive_integral_alt: "positive_integral f = - (SUP g : {g. simple_function g \ g \ f \ \ \ g`space M}. simple_integral g)" + (SUPR {g. simple_function g \ g \ f \ \ \ g`space M} simple_integral)" (is "_ = ?alt") +proof (rule antisym SUP_leI) + show "positive_integral f \ ?alt" unfolding positive_integral_def + proof (safe intro!: SUP_leI) + fix g assume g: "simple_function g" "g \ f" + let ?G = "g -` {\} \ space M" + show "simple_integral g \ + SUPR {g. simple_function g \ g \ f \ \ \ g ` space M} simple_integral" + (is "simple_integral g \ SUPR ?A simple_integral") + proof cases + let ?g = "\x. indicator (space M - ?G) x * g x" + have g': "simple_function ?g" + using g by (auto intro: simple_functionD) + moreover + assume "\ ?G = 0" + then have "AE x. g x = ?g x" using g + by (intro AE_I[where N="?G"]) + (auto intro: simple_functionD simp: indicator_def) + with g(1) g' have "simple_integral g = simple_integral ?g" + by (rule simple_integral_cong_AE) + moreover have "?g \ g" by (auto simp: le_fun_def indicator_def) + from this `g \ f` have "?g \ f" by (rule order_trans) + moreover have "\ \ ?g ` space M" + by (auto simp: indicator_def split: split_if_asm) + ultimately show ?thesis by (auto intro!: le_SUPI) + next + assume "\ ?G \ 0" + then have "?G \ {}" by auto + then have "\ \ g`space M" by force + then have "space M \ {}" by auto + have "SUPR ?A simple_integral = \" + proof (intro SUP_\[THEN iffD2] allI impI) + fix x assume "x < \" + then guess n unfolding less_\_Ex_of_nat .. note n = this + then have "0 < n" by (intro neq0_conv[THEN iffD1] notI) simp + let ?g = "\x. (of_nat n / (if \ ?G = \ then 1 else \ ?G)) * indicator ?G x" + show "\i\?A. x < simple_integral i" + proof (intro bexI impI CollectI conjI) + show "simple_function ?g" using g + by (auto intro!: simple_functionD simple_function_add) + have "?g \ g" by (auto simp: le_fun_def indicator_def) + from this g(2) show "?g \ f" by (rule order_trans) + show "\ \ ?g ` space M" + using `\ ?G \ 0` by (auto simp: indicator_def split: split_if_asm) + have "x < (of_nat n / (if \ ?G = \ then 1 else \ ?G)) * \ ?G" + using n `\ ?G \ 0` `0 < n` + by (auto simp: pinfreal_noteq_omega_Ex field_simps) + also have "\ = simple_integral ?g" using g `space M \ {}` + by (subst simple_integral_indicator) + (auto simp: image_constant ac_simps dest: simple_functionD) + finally show "x < simple_integral ?g" . + qed + qed + then show ?thesis by simp + qed + qed +qed (auto intro!: SUP_subset simp: positive_integral_def) lemma (in measure_space) positive_integral_cong_measure: assumes "\A. A \ sets M \ \ A = \ A" @@ -849,7 +920,7 @@ lemma (in measure_space) positive_integral_alt1: "positive_integral f = (SUP g : {g. simple_function g \ (\x\space M. g x \ f x \ g x \ \)}. simple_integral g)" - unfolding positive_integral_def SUPR_def + unfolding positive_integral_alt SUPR_def proof (safe intro!: arg_cong[where f=Sup]) fix g let ?g = "\x. if x \ space M then g x else f x" assume "simple_function g" "\x\space M. g x \ f x \ g x \ \" @@ -866,75 +937,6 @@ by auto qed -lemma (in measure_space) positive_integral_alt: - "positive_integral f = - (SUP g : {g. simple_function g \ g \ f}. simple_integral g)" - apply(rule order_class.antisym) unfolding positive_integral_def - apply(rule SUPR_subset) apply blast apply(rule SUPR_mono_lim) -proof safe fix u assume u:"simple_function u" and uf:"u \ f" - let ?u = "\n x. if u x = \ then Real (real (n::nat)) else u x" - have su:"\n. simple_function (?u n)" using simple_function_compose1[OF u] . - show "\b. \n. b n \ {g. simple_function g \ g \ f \ \ \ g ` space M} \ - (\n. simple_integral (b n)) ----> simple_integral u" - apply(rule_tac x="?u" in exI, safe) apply(rule su) - proof- fix n::nat have "?u n \ u" unfolding le_fun_def by auto - also note uf finally show "?u n \ f" . - let ?s = "{x \ space M. u x = \}" - show "(\n. simple_integral (?u n)) ----> simple_integral u" - proof(cases "\ ?s = 0") - case True have *:"\n. {x\space M. ?u n x \ u x} = {x\space M. u x = \}" by auto - have *:"\n. simple_integral (?u n) = simple_integral u" - apply(rule simple_integral_cong'[OF su u]) unfolding * True .. - show ?thesis unfolding * by auto - next case False note m0=this - have s:"{x \ space M. u x = \} \ sets M" using u by (auto simp: borel_measurable_simple_function) - have "\ = simple_integral (\x. \ * indicator {x\space M. u x = \} x)" - apply(subst simple_integral_mult) using s - unfolding simple_integral_indicator_only[OF s] using False by auto - also have "... \ simple_integral u" - apply (rule simple_integral_mono) - apply (rule simple_function_mult) - apply (rule simple_function_const) - apply(rule ) prefer 3 apply(subst indicator_def) - using s u by auto - finally have *:"simple_integral u = \" by auto - show ?thesis unfolding * Lim_omega_pos - proof safe case goal1 - from real_arch_simple[of "B / real (\ ?s)"] guess N0 .. note N=this - def N \ "Suc N0" have N:"real N \ B / real (\ ?s)" "N > 0" - unfolding N_def using N by auto - show ?case apply-apply(rule_tac x=N in exI,safe) - proof- case goal1 - have "Real B \ Real (real N) * \ ?s" - proof(cases "\ ?s = \") - case True thus ?thesis using `B>0` N by auto - next case False - have *:"B \ real N * real (\ ?s)" - using N(1) apply-apply(subst (asm) pos_divide_le_eq) - apply rule using m0 False by auto - show ?thesis apply(subst Real_real'[THEN sym,OF False]) - apply(subst pinfreal_times,subst if_P) defer - apply(subst pinfreal_less_eq,subst if_P) defer - using * N `B>0` by(auto intro: mult_nonneg_nonneg) - qed - also have "... \ Real (real n) * \ ?s" - apply(rule mult_right_mono) using goal1 by auto - also have "... = simple_integral (\x. Real (real n) * indicator ?s x)" - apply(subst simple_integral_mult) apply(rule simple_function_indicator[OF s]) - unfolding simple_integral_indicator_only[OF s] .. - also have "... \ simple_integral (\x. if u x = \ then Real (real n) else u x)" - apply(rule simple_integral_mono) apply(rule simple_function_mult) - apply(rule simple_function_const) - apply(rule simple_function_indicator) apply(rule s su)+ by auto - finally show ?case . - qed qed qed - fix x assume x:"\ = (if u x = \ then Real (real n) else u x)" "x \ space M" - hence "u x = \" apply-apply(rule ccontr) by auto - hence "\ = Real (real n)" using x by auto - thus False by auto - qed -qed - lemma (in measure_space) positive_integral_cong: assumes "\x. x \ space M \ f x = g x" shows "positive_integral f = positive_integral g" @@ -947,7 +949,7 @@ lemma (in measure_space) positive_integral_eq_simple_integral: assumes "simple_function f" shows "positive_integral f = simple_integral f" - unfolding positive_integral_alt + unfolding positive_integral_def proof (safe intro!: pinfreal_SUPI) fix g assume "simple_function g" "g \ f" with assms show "simple_integral g \ simple_integral f" @@ -1008,6 +1010,12 @@ shows "positive_integral u \ positive_integral v" using mono by (auto intro!: AE_cong positive_integral_mono_AE) +lemma image_set_cong: + assumes A: "\x. x \ A \ \y\B. f x = g y" + assumes B: "\y. y \ B \ \x\A. g y = f x" + shows "f ` A = g ` B" + using assms by blast + lemma (in measure_space) positive_integral_vimage: fixes g :: "'a \ pinfreal" and f :: "'d \ 'a" assumes f: "bij_betw f S (space M)" @@ -1020,14 +1028,12 @@ from assms have inv: "bij_betw (the_inv_into S f) (space M) S" by (rule bij_betw_the_inv_into) then have inv_fun: "the_inv_into S f \ space M \ S" unfolding bij_betw_def by auto - have surj: "f`S = space M" using f unfolding bij_betw_def by simp have inj: "inj_on f S" using f unfolding bij_betw_def by simp have inv_f: "\x. x \ space M \ f (the_inv_into S f x) = x" using f_the_inv_into_f[of f S] f unfolding bij_betw_def by auto - from simple_integral_vimage[OF assms, symmetric] have *: "simple_integral = T.simple_integral \ (\g. g \ f)" by (simp add: comp_def) show ?thesis @@ -1181,7 +1187,7 @@ by (auto intro!: SUP_leI positive_integral_mono) next show "positive_integral u \ (SUP i. positive_integral (f i))" - unfolding positive_integral_def[of u] + unfolding positive_integral_alt[of u] by (auto intro!: SUP_leI positive_integral_SUP_approx[OF assms]) qed qed @@ -1194,7 +1200,6 @@ proof - have "?u \ borel_measurable M" using borel_measurable_SUP[of _ f] assms by (simp add: SUPR_fun_expand) - show ?thesis proof (rule antisym) show "(SUP j. positive_integral (f j)) \ positive_integral ?u" @@ -1205,9 +1210,10 @@ using assms by (simp cong: measurable_cong) moreover have iso: "rf \ ru" using assms unfolding rf_def ru_def unfolding isoton_def SUPR_fun_expand le_fun_def fun_eq_iff + using SUP_const[OF UNIV_not_empty] by (auto simp: restrict_def le_fun_def SUPR_fun_expand fun_eq_iff) ultimately have "positive_integral ru \ (SUP i. positive_integral (rf i))" - unfolding positive_integral_def[of ru] + unfolding positive_integral_alt[of ru] by (auto simp: le_fun_def intro!: SUP_leI positive_integral_SUP_approx) then show "positive_integral ?u \ (SUP i. positive_integral (f i))" unfolding ru_def rf_def by (simp cong: positive_integral_cong) @@ -1523,19 +1529,18 @@ apply (rule arg_cong[where f=Sup]) proof (auto simp add: image_iff simple_integral_restricted[OF `A \ sets M`]) fix g assume "simple_function (\x. g x * indicator A x)" - "g \ f" "\x\A. \ \ g x" - then show "\x. simple_function x \ x \ (\x. f x * indicator A x) \ (\y\space M. \ \ x y) \ + "g \ f" + then show "\x. simple_function x \ x \ (\x. f x * indicator A x) \ simple_integral (\x. g x * indicator A x) = simple_integral x" apply (rule_tac exI[of _ "\x. g x * indicator A x"]) by (auto simp: indicator_def le_fun_def) next fix g assume g: "simple_function g" "g \ (\x. f x * indicator A x)" - "\x\space M. \ \ g x" then have *: "(\x. g x * indicator A x) = g" "\x. g x * indicator A x = g x" "\x. g x \ f x" by (auto simp: le_fun_def fun_eq_iff indicator_def split: split_if_asm) - from g show "\x. simple_function (\xa. x xa * indicator A xa) \ x \ f \ (\xa\A. \ \ x xa) \ + from g show "\x. simple_function (\xa. x xa * indicator A xa) \ x \ f \ simple_integral g = simple_integral (\xa. x xa * indicator A xa)" using `A \ sets M`[THEN sets_into_space] apply (rule_tac exI[of _ "\x. g x * indicator A x"]) @@ -2299,7 +2304,7 @@ qed lemma (in finite_measure_space) simple_function_finite[simp, intro]: "simple_function f" - unfolding simple_function_def sets_eq_Pow using finite_space by auto + unfolding simple_function_def using finite_space by auto lemma (in finite_measure_space) borel_measurable_finite[intro, simp]: "f \ borel_measurable M" by (auto intro: borel_measurable_simple_function) @@ -2310,7 +2315,7 @@ have *: "positive_integral f = positive_integral (\x. \y\space M. f y * indicator {y} x)" by (auto intro!: positive_integral_cong simp add: indicator_def if_distrib setsum_cases[OF finite_space]) show ?thesis unfolding * using borel_measurable_finite[of f] - by (simp add: positive_integral_setsum positive_integral_cmult_indicator sets_eq_Pow) + by (simp add: positive_integral_setsum positive_integral_cmult_indicator) qed lemma (in finite_measure_space) integral_finite_singleton: @@ -2322,9 +2327,9 @@ "positive_integral (\x. Real (- f x)) = (\x \ space M. Real (- f x) * \ {x})" unfolding positive_integral_finite_eq_setsum by auto show "integrable f" using finite_space finite_measure - by (simp add: setsum_\ integrable_def sets_eq_Pow) + by (simp add: setsum_\ integrable_def) show ?I using finite_measure - apply (simp add: integral_def sets_eq_Pow real_of_pinfreal_setsum[symmetric] + apply (simp add: integral_def real_of_pinfreal_setsum[symmetric] real_of_pinfreal_mult[symmetric] setsum_subtractf[symmetric]) by (rule setsum_cong) (simp_all split: split_if) qed diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Thu Dec 02 15:32:48 2010 +0100 @@ -4,89 +4,6 @@ imports Product_Measure Gauge_Measure Complete_Measure begin -lemma (in complete_lattice) SUP_pair: - "(SUP i:A. SUP j:B. f i j) = (SUP p:A\B. (\ (i, j). f i j) p)" (is "?l = ?r") -proof (intro antisym SUP_leI) - fix i j assume "i \ A" "j \ B" - then have "(case (i,j) of (i,j) \ f i j) \ ?r" - by (intro SUPR_upper) auto - then show "f i j \ ?r" by auto -next - fix p assume "p \ A \ B" - then obtain i j where "p = (i,j)" "i \ A" "j \ B" by auto - have "f i j \ (SUP j:B. f i j)" using `j \ B` by (intro SUPR_upper) - also have "(SUP j:B. f i j) \ ?l" using `i \ A` by (intro SUPR_upper) - finally show "(case p of (i, j) \ f i j) \ ?l" using `p = (i,j)` by simp -qed - -lemma (in complete_lattice) SUP_surj_compose: - assumes *: "f`A = B" shows "SUPR A (g \ f) = SUPR B g" - unfolding SUPR_def unfolding *[symmetric] - by (simp add: image_compose) - -lemma (in complete_lattice) SUP_swap: - "(SUP i:A. SUP j:B. f i j) = (SUP j:B. SUP i:A. f i j)" -proof - - have *: "(\(i,j). (j,i)) ` (B \ A) = A \ B" by auto - show ?thesis - unfolding SUP_pair SUP_surj_compose[symmetric, OF *] - by (auto intro!: arg_cong[where f=Sup] image_eqI simp: comp_def SUPR_def) -qed - -lemma SUP_\: "(SUP i:A. f i) = \ \ (\x<\. \i\A. x < f i)" -proof - assume *: "(SUP i:A. f i) = \" - show "(\x<\. \i\A. x < f i)" unfolding *[symmetric] - proof (intro allI impI) - fix x assume "x < SUPR A f" then show "\i\A. x < f i" - unfolding less_SUP_iff by auto - qed -next - assume *: "\x<\. \i\A. x < f i" - show "(SUP i:A. f i) = \" - proof (rule pinfreal_SUPI) - fix y assume **: "\i. i \ A \ f i \ y" - show "\ \ y" - proof cases - assume "y < \" - from *[THEN spec, THEN mp, OF this] - obtain i where "i \ A" "\ (f i \ y)" by auto - with ** show ?thesis by auto - qed auto - qed auto -qed - -lemma psuminf_commute: - shows "(\\<^isub>\ i j. f i j) = (\\<^isub>\ j i. f i j)" -proof - - have "(SUP n. \ i < n. SUP m. \ j < m. f i j) = (SUP n. SUP m. \ i < n. \ j < m. f i j)" - apply (subst SUPR_pinfreal_setsum) - by auto - also have "\ = (SUP m n. \ j < m. \ i < n. f i j)" - apply (subst SUP_swap) - apply (subst setsum_commute) - by auto - also have "\ = (SUP m. \ j < m. SUP n. \ i < n. f i j)" - apply (subst SUPR_pinfreal_setsum) - by auto - finally show ?thesis - unfolding psuminf_def by auto -qed - -lemma psuminf_SUP_eq: - assumes "\n i. f n i \ f (Suc n) i" - shows "(\\<^isub>\ i. SUP n::nat. f n i) = (SUP n::nat. \\<^isub>\ i. f n i)" -proof - - { fix n :: nat - have "(\ii 'a::ordered_euclidean_space set" where @@ -838,20 +755,6 @@ qed qed -lemma Real_mult_nonneg: assumes "x \ 0" "y \ 0" - shows "Real (x * y) = Real x * Real y" using assms by auto - -lemma Real_setprod: assumes "\x\A. f x \ 0" shows "Real (setprod f A) = setprod (\x. Real (f x)) A" -proof(cases "finite A") - case True thus ?thesis using assms - proof(induct A) case (insert x A) - have "0 \ setprod f A" apply(rule setprod_nonneg) using insert by auto - thus ?case unfolding setprod_insert[OF insert(1-2)] apply- - apply(subst Real_mult_nonneg) prefer 3 apply(subst insert(3)[THEN sym]) - using insert by auto - qed auto -qed auto - lemma e2p_Int:"e2p ` A \ e2p ` B = e2p ` (A \ B)" (is "?L = ?R") apply(rule image_Int[THEN sym]) using bij_euclidean_component unfolding bij_betw_def by auto diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Measure.thy --- a/src/HOL/Probability/Measure.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Measure.thy Thu Dec 02 15:32:48 2010 +0100 @@ -651,27 +651,6 @@ abbreviation (in measure_space) "null_sets \ {N\sets M. \ N = 0}" -definition (in measure_space) - almost_everywhere :: "('a \ bool) \ bool" (binder "AE " 10) where - "almost_everywhere P \ (\N\null_sets. { x \ space M. \ P x } \ N)" - -lemma (in measure_space) AE_I': - "N \ null_sets \ {x\space M. \ P x} \ N \ (AE x. P x)" - unfolding almost_everywhere_def by auto - -lemma (in measure_space) AE_iff_null_set: - assumes "{x\space M. \ P x} \ sets M" (is "?P \ sets M") - shows "(AE x. P x) \ {x\space M. \ P x} \ null_sets" -proof - assume "AE x. P x" then obtain N where N: "N \ sets M" "?P \ N" "\ N = 0" - unfolding almost_everywhere_def by auto - moreover have "\ ?P \ \ N" - using assms N(1,2) by (auto intro: measure_mono) - ultimately show "?P \ null_sets" using assms by auto -next - assume "?P \ null_sets" with assms show "AE x. P x" by (auto intro: AE_I') -qed - lemma (in measure_space) null_sets_Un[intro]: assumes "N \ null_sets" "N' \ null_sets" shows "N \ N' \ null_sets" @@ -703,6 +682,17 @@ using assms by auto qed +lemma (in measure_space) null_sets_finite_UN: + assumes "finite S" "\i. i \ S \ A i \ null_sets" + shows "(\i\S. A i) \ null_sets" +proof (intro CollectI conjI) + show "(\i\S. A i) \ sets M" using assms by (intro finite_UN) auto + have "\ (\i\S. A i) \ (\i\S. \ (A i))" + using assms by (intro measure_finitely_subadditive) auto + then show "\ (\i\S. A i) = 0" + using assms by auto +qed + lemma (in measure_space) null_set_Int1: assumes "B \ null_sets" "A \ sets M" shows "A \ B \ null_sets" using assms proof (intro CollectI conjI) @@ -741,6 +731,29 @@ by (subst measure_additive[symmetric]) auto qed +section "Formalise almost everywhere" + +definition (in measure_space) + almost_everywhere :: "('a \ bool) \ bool" (binder "AE " 10) where + "almost_everywhere P \ (\N\null_sets. { x \ space M. \ P x } \ N)" + +lemma (in measure_space) AE_I': + "N \ null_sets \ {x\space M. \ P x} \ N \ (AE x. P x)" + unfolding almost_everywhere_def by auto + +lemma (in measure_space) AE_iff_null_set: + assumes "{x\space M. \ P x} \ sets M" (is "?P \ sets M") + shows "(AE x. P x) \ {x\space M. \ P x} \ null_sets" +proof + assume "AE x. P x" then obtain N where N: "N \ sets M" "?P \ N" "\ N = 0" + unfolding almost_everywhere_def by auto + moreover have "\ ?P \ \ N" + using assms N(1,2) by (auto intro: measure_mono) + ultimately show "?P \ null_sets" using assms by auto +next + assume "?P \ null_sets" with assms show "AE x. P x" by (auto intro: AE_I') +qed + lemma (in measure_space) AE_True[intro, simp]: "AE x. True" unfolding almost_everywhere_def by auto @@ -1409,7 +1422,7 @@ show "\ {x} \ \" by (auto simp: insert_absorb[OF *] Diff_subset) } qed -sublocale finite_measure_space < finite_measure +sublocale finite_measure_space \ finite_measure proof show "\ (space M) \ \" unfolding sum_over_space[symmetric] setsum_\ diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Positive_Infinite_Real.thy --- a/src/HOL/Probability/Positive_Infinite_Real.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Positive_Infinite_Real.thy Thu Dec 02 15:32:48 2010 +0100 @@ -6,14 +6,6 @@ imports Complex_Main Nat_Bijection Multivariate_Analysis begin -lemma range_const[simp]: "range (\x. c) = {c}" by auto - -lemma (in complete_lattice) SUPR_const[simp]: "(SUP i. c) = c" - unfolding SUPR_def by simp - -lemma (in complete_lattice) INFI_const[simp]: "(INF i. c) = c" - unfolding INFI_def by simp - lemma (in complete_lattice) Sup_start: assumes *: "\x. f x \ f 0" shows "(SUP n. f n) = f 0" @@ -94,6 +86,26 @@ ultimately show ?thesis by simp qed +lemma (in complete_lattice) lim_INF_le_lim_SUP: + fixes f :: "nat \ 'a" + shows "(SUP n. INF m. f (n + m)) \ (INF n. SUP m. f (n + m))" +proof (rule SUP_leI, rule le_INFI) + fix i j show "(INF m. f (i + m)) \ (SUP m. f (j + m))" + proof (cases rule: le_cases) + assume "i \ j" + have "(INF m. f (i + m)) \ f (i + (j - i))" by (rule INF_leI) simp + also have "\ = f (j + 0)" using `i \ j` by auto + also have "\ \ (SUP m. f (j + m))" by (rule le_SUPI) simp + finally show ?thesis . + next + assume "j \ i" + have "(INF m. f (i + m)) \ f (i + 0)" by (rule INF_leI) simp + also have "\ = f (j + (i - j))" using `j \ i` by auto + also have "\ \ (SUP m. f (j + m))" by (rule le_SUPI) simp + finally show ?thesis . + qed +qed + text {* We introduce the the positive real numbers as needed for measure theory. @@ -348,6 +360,20 @@ lemma real_of_pinfreal_mult: "real X * real Y = real (X * Y :: pinfreal)" by (cases X, cases Y) (auto simp: zero_le_mult_iff) +lemma Real_mult_nonneg: assumes "x \ 0" "y \ 0" + shows "Real (x * y) = Real x * Real y" using assms by auto + +lemma Real_setprod: assumes "\x\A. f x \ 0" shows "Real (setprod f A) = setprod (\x. Real (f x)) A" +proof(cases "finite A") + case True thus ?thesis using assms + proof(induct A) case (insert x A) + have "0 \ setprod f A" apply(rule setprod_nonneg) using insert by auto + thus ?case unfolding setprod_insert[OF insert(1-2)] apply- + apply(subst Real_mult_nonneg) prefer 3 apply(subst insert(3)[THEN sym]) + using insert by auto + qed auto +qed auto + subsection "@{typ pinfreal} is a linear order" instantiation pinfreal :: linorder @@ -549,6 +575,14 @@ lemma pinfreal_of_nat[simp]: "of_nat m = Real (real m)" by (induct m) (auto simp: real_of_nat_Suc one_pinfreal_def simp del: Real_1) +lemma less_\_Ex_of_nat: "x < \ \ (\n. x < of_nat n)" +proof safe + assume "x < \" + then obtain r where "0 \ r" "x = Real r" by (cases x) auto + moreover obtain n where "r < of_nat n" using ex_less_of_nat by auto + ultimately show "\n. x < of_nat n" by (auto simp: real_eq_of_nat) +qed auto + lemma real_of_pinfreal_mono: fixes a b :: pinfreal assumes "b \ \" "a \ b" @@ -831,6 +865,29 @@ qed simp qed simp +lemma SUP_\: "(SUP i:A. f i) = \ \ (\x<\. \i\A. x < f i)" +proof + assume *: "(SUP i:A. f i) = \" + show "(\x<\. \i\A. x < f i)" unfolding *[symmetric] + proof (intro allI impI) + fix x assume "x < SUPR A f" then show "\i\A. x < f i" + unfolding less_SUP_iff by auto + qed +next + assume *: "\x<\. \i\A. x < f i" + show "(SUP i:A. f i) = \" + proof (rule pinfreal_SUPI) + fix y assume **: "\i. i \ A \ f i \ y" + show "\ \ y" + proof cases + assume "y < \" + from *[THEN spec, THEN mp, OF this] + obtain i where "i \ A" "\ (f i \ y)" by auto + with ** show ?thesis by auto + qed auto + qed auto +qed + subsubsection {* Equivalence between @{text "f ----> x"} and @{text SUP} on @{typ pinfreal} *} lemma monoseq_monoI: "mono f \ monoseq f" @@ -1241,7 +1298,6 @@ have [intro, simp]: "\A. inj_on f A" using `bij f` unfolding bij_def by (auto intro: subset_inj_on) have f[intro, simp]: "\x. f (inv f x) = x" using `bij f` unfolding bij_def by (auto intro: surj_f_inv_f) - show ?thesis proof (rule psuminf_equality) fix n @@ -1266,49 +1322,6 @@ qed qed -lemma psuminf_2dimen: - fixes f:: "nat * nat \ pinfreal" - assumes fsums: "\m. g m = (\\<^isub>\ n. f (m,n))" - shows "psuminf (f \ prod_decode) = psuminf g" -proof (rule psuminf_equality) - fix n :: nat - let ?P = "prod_decode ` {.. prod_decode) {.. \ setsum f ({..Max (fst ` ?P)} \ {..Max (snd ` ?P)})" - proof (safe intro!: setsum_mono3 Max_ge image_eqI) - fix a b x assume "(a, b) = prod_decode x" - from this[symmetric] show "a = fst (prod_decode x)" "b = snd (prod_decode x)" - by simp_all - qed simp_all - also have "\ = (\m\Max (fst ` ?P). (\n\Max (snd ` ?P). f (m,n)))" - unfolding setsum_cartesian_product by simp - also have "\ \ (\m\Max (fst ` ?P). g m)" - by (auto intro!: setsum_mono psuminf_upper simp del: setsum_lessThan_Suc - simp: fsums lessThan_Suc_atMost[symmetric]) - also have "\ \ psuminf g" - by (auto intro!: psuminf_upper simp del: setsum_lessThan_Suc - simp: lessThan_Suc_atMost[symmetric]) - finally show "setsum (f \ prod_decode) {.. psuminf g" . -next - fix y assume *: "\n. setsum (f \ prod_decode) {.. y" - have g: "g = (\m. \\<^isub>\ n. f (m,n))" unfolding fsums[symmetric] .. - show "psuminf g \ y" unfolding g - proof (rule psuminf_bound, unfold setsum_pinfsum[symmetric], safe intro!: psuminf_bound) - fix N M :: nat - let ?P = "{.. {..nm (\(m, n)\?P. f (m, n))" - unfolding setsum_commute[of _ _ "{.. \ (\(m,n)\(prod_decode ` {..?M}). f (m, n))" - by (auto intro!: setsum_mono3 image_eqI[where f=prod_decode, OF prod_encode_inverse[symmetric]]) - also have "\ \ y" using *[of "Suc ?M"] - by (simp add: lessThan_Suc_atMost[symmetric] setsum_reindex - inj_prod_decode del: setsum_lessThan_Suc) - finally show "(\nm y" . - qed -qed - lemma pinfreal_mult_less_right: assumes "b * a < c * a" "0 < a" "a < \" shows "b < c" @@ -1384,6 +1397,80 @@ qed simp qed simp +lemma psuminf_SUP_eq: + assumes "\n i. f n i \ f (Suc n) i" + shows "(\\<^isub>\ i. SUP n::nat. f n i) = (SUP n::nat. \\<^isub>\ i. f n i)" +proof - + { fix n :: nat + have "(\ii\<^isub>\ i j. f i j) = (\\<^isub>\ j i. f i j)" +proof - + have "(SUP n. \ i < n. SUP m. \ j < m. f i j) = (SUP n. SUP m. \ i < n. \ j < m. f i j)" + apply (subst SUPR_pinfreal_setsum) + by auto + also have "\ = (SUP m n. \ j < m. \ i < n. f i j)" + apply (subst SUP_commute) + apply (subst setsum_commute) + by auto + also have "\ = (SUP m. \ j < m. SUP n. \ i < n. f i j)" + apply (subst SUPR_pinfreal_setsum) + by auto + finally show ?thesis + unfolding psuminf_def by auto +qed + +lemma psuminf_2dimen: + fixes f:: "nat * nat \ pinfreal" + assumes fsums: "\m. g m = (\\<^isub>\ n. f (m,n))" + shows "psuminf (f \ prod_decode) = psuminf g" +proof (rule psuminf_equality) + fix n :: nat + let ?P = "prod_decode ` {.. prod_decode) {.. \ setsum f ({..Max (fst ` ?P)} \ {..Max (snd ` ?P)})" + proof (safe intro!: setsum_mono3 Max_ge image_eqI) + fix a b x assume "(a, b) = prod_decode x" + from this[symmetric] show "a = fst (prod_decode x)" "b = snd (prod_decode x)" + by simp_all + qed simp_all + also have "\ = (\m\Max (fst ` ?P). (\n\Max (snd ` ?P). f (m,n)))" + unfolding setsum_cartesian_product by simp + also have "\ \ (\m\Max (fst ` ?P). g m)" + by (auto intro!: setsum_mono psuminf_upper simp del: setsum_lessThan_Suc + simp: fsums lessThan_Suc_atMost[symmetric]) + also have "\ \ psuminf g" + by (auto intro!: psuminf_upper simp del: setsum_lessThan_Suc + simp: lessThan_Suc_atMost[symmetric]) + finally show "setsum (f \ prod_decode) {.. psuminf g" . +next + fix y assume *: "\n. setsum (f \ prod_decode) {.. y" + have g: "g = (\m. \\<^isub>\ n. f (m,n))" unfolding fsums[symmetric] .. + show "psuminf g \ y" unfolding g + proof (rule psuminf_bound, unfold setsum_pinfsum[symmetric], safe intro!: psuminf_bound) + fix N M :: nat + let ?P = "{.. {..nm (\(m, n)\?P. f (m, n))" + unfolding setsum_commute[of _ _ "{.. \ (\(m,n)\(prod_decode ` {..?M}). f (m, n))" + by (auto intro!: setsum_mono3 image_eqI[where f=prod_decode, OF prod_encode_inverse[symmetric]]) + also have "\ \ y" using *[of "Suc ?M"] + by (simp add: lessThan_Suc_atMost[symmetric] setsum_reindex + inj_prod_decode del: setsum_lessThan_Suc) + finally show "(\nm y" . + qed +qed + lemma Real_max: assumes "x \ 0" "y \ 0" shows "Real (max x y) = max (Real x) (Real y)" @@ -2076,20 +2163,6 @@ lemma real_Real_max:"real (Real x) = max x 0" unfolding real_Real by auto -lemma (in complete_lattice) SUPR_upper: - "x \ A \ f x \ SUPR A f" - unfolding SUPR_def apply(rule Sup_upper) by auto - -lemma (in complete_lattice) SUPR_subset: - assumes "A \ B" shows "SUPR A f \ SUPR B f" - apply(rule SUP_leI) apply(rule SUPR_upper) using assms by auto - -lemma (in complete_lattice) SUPR_mono: - assumes "\a\A. \b\B. f b \ f a" - shows "SUPR A f \ SUPR B f" - unfolding SUPR_def apply(rule Sup_mono) - using assms by auto - lemma Sup_lim: assumes "\n. b n \ s" "b ----> (a::pinfreal)" shows "a \ Sup s" @@ -2161,11 +2234,6 @@ unfolding Real_real using om by auto qed qed -lemma less_SUP_iff: - fixes a :: pinfreal - shows "(a < (SUP i:A. f i)) \ (\x\A. a < f x)" - unfolding SUPR_def less_Sup_iff by auto - lemma Sup_mono_lim: assumes "\a\A. \b. \n. b n \ B \ b ----> (a::pinfreal)" shows "Sup A \ Sup B" @@ -2371,26 +2439,6 @@ shows "a \ a - b \ a \ 0 \ a \ \ \ b = 0" by (cases a, cases b, auto split: split_if_asm) -lemma lim_INF_le_lim_SUP: - fixes f :: "nat \ pinfreal" - shows "(SUP n. INF m. f (n + m)) \ (INF n. SUP m. f (n + m))" -proof (rule complete_lattice_class.SUP_leI, rule complete_lattice_class.le_INFI) - fix i j show "(INF m. f (i + m)) \ (SUP m. f (j + m))" - proof (cases rule: le_cases) - assume "i \ j" - have "(INF m. f (i + m)) \ f (i + (j - i))" by (rule INF_leI) simp - also have "\ = f (j + 0)" using `i \ j` by auto - also have "\ \ (SUP m. f (j + m))" by (rule le_SUPI) simp - finally show ?thesis . - next - assume "j \ i" - have "(INF m. f (i + m)) \ f (i + 0)" by (rule INF_leI) simp - also have "\ = f (j + (i - j))" using `j \ i` by auto - also have "\ \ (SUP m. f (j + m))" by (rule le_SUPI) simp - finally show ?thesis . - qed -qed - lemma lim_INF_eq_lim_SUP: fixes X :: "nat \ real" assumes "\i. 0 \ X i" and "0 \ x" @@ -2707,4 +2755,21 @@ lemma lessThan_0_Empty: "{..< 0 :: pinfreal} = {}" by auto +lemma real_of_pinfreal_inverse[simp]: + fixes X :: pinfreal + shows "real (inverse X) = 1 / real X" + by (cases X) (auto simp: inverse_eq_divide) + +lemma real_of_pinfreal_le_0[simp]: "real (X :: pinfreal) \ 0 \ (X = 0 \ X = \)" + by (cases X) auto + +lemma real_of_pinfreal_less_0[simp]: "\ (real (X :: pinfreal) < 0)" + by (cases X) auto + +lemma abs_real_of_pinfreal[simp]: "\real (X :: pinfreal)\ = real X" + by simp + +lemma zero_less_real_of_pinfreal: "0 < real (X :: pinfreal) \ X \ 0 \ X \ \" + by (cases X) auto + end diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Product_Measure.thy --- a/src/HOL/Probability/Product_Measure.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Product_Measure.thy Thu Dec 02 15:32:48 2010 +0100 @@ -2,28 +2,6 @@ imports Lebesgue_Integration begin -lemma in_sigma[intro, simp]: "A \ sets M \ A \ sets (sigma M)" - unfolding sigma_def by (auto intro!: sigma_sets.Basic) - -lemma (in sigma_algebra) sigma_eq[simp]: "sigma M = M" - unfolding sigma_def sigma_sets_eq by simp - -lemma vimage_algebra_sigma: - assumes E: "sets E \ Pow (space E)" - and f: "f \ space F \ space E" - and "\A. A \ sets F \ A \ (\X. f -` X \ space F) ` sets E" - and "\A. A \ sets E \ f -` A \ space F \ sets F" - shows "sigma_algebra.vimage_algebra (sigma E) (space F) f = sigma F" -proof - - interpret sigma_algebra "sigma E" - using assms by (intro sigma_algebra_sigma) auto - have eq: "sets F = (\X. f -` X \ space F) ` sets E" - using assms by auto - show "vimage_algebra (space F) f = sigma F" - unfolding vimage_algebra_def using assms - by (simp add: sigma_def eq sigma_sets_vimage) -qed - lemma times_Int_times: "A \ B \ C \ D = (A \ C) \ (B \ D)" by auto @@ -786,13 +764,10 @@ positive_integral f" proof - interpret Q: pair_sigma_finite M2 \2 M1 \1 by default - have s: "\x y. (case (x, y) of (x, y) \ f (y, x)) = f (y, x)" by simp have t: "(\x. f (case x of (x, y) \ (y, x))) = (\(x, y). f (y, x))" by (auto simp: fun_eq_iff) - have bij: "bij_betw (\(x, y). (y, x)) (space M2 \ space M1) (space P)" by (auto intro!: inj_onI simp: space_pair_algebra bij_betw_def) - note pair_sigma_algebra_measurable[OF f] from Q.positive_integral_fst_measurable[OF this] have "M2.positive_integral (\y. M1.positive_integral (\x. f (x, y))) = @@ -890,7 +865,7 @@ lemma (in finite_product_sigma_algebra) P_empty: "I = {} \ P = \ space = {\k. undefined}, sets = { {}, {\k. undefined} }\" - unfolding product_algebra_def by (simp add: sigma_def) + unfolding product_algebra_def by (simp add: sigma_def image_constant) lemma (in finite_product_sigma_algebra) in_P[simp, intro]: "\ \i. i \ I \ A i \ sets (M i) \ \ Pi\<^isub>E I A \ sets P" @@ -930,7 +905,6 @@ using E1 E2 by (auto simp add: pair_algebra_def) interpret E: sigma_algebra ?E unfolding pair_algebra_def using E1 E2 by (intro sigma_algebra_sigma) auto - { fix A assume "A \ sets E1" then have "fst -` A \ space ?E = A \ (\i. S2 i)" using E1 2 unfolding isoton_def pair_algebra_def by auto @@ -954,7 +928,6 @@ "fst \ measurable ?E (sigma E1) \ snd \ measurable ?E (sigma E2)" using E1 E2 by (subst (1 2) E.measurable_iff_sigma) (auto simp: pair_algebra_def sets_sigma) - { fix A B assume A: "A \ sets (sigma E1)" and B: "B \ sets (sigma E2)" with proj have "fst -` A \ space ?E \ sets ?E" "snd -` B \ space ?E \ sets ?E" unfolding measurable_def by simp_all @@ -966,7 +939,6 @@ by (intro E.sigma_sets_subset) (auto simp add: pair_algebra_def sets_sigma) then have subset: "sets ?S \ sets ?E" by (simp add: sets_sigma pair_algebra_def) - have "sets ?S = sets ?E" proof (intro set_eqI iffI) fix A assume "A \ sets ?E" then show "A \ sets ?S" @@ -1286,7 +1258,7 @@ by (auto intro!: exI[of _ "\A. if A = {} then 0 else 1"] sigma_algebra_sigma sigma_algebra.finite_additivity_sufficient simp add: positive_def additive_def sets_sigma sigma_finite_measure_def - sigma_finite_measure_axioms_def) + sigma_finite_measure_axioms_def image_constant) next case (insert i I) interpret finite_product_sigma_finite M \ I by default fact @@ -1304,7 +1276,6 @@ unfolding product_singleton_vimage_algebra_eq[OF `i \ I` `finite I`, symmetric] using bij_betw_restrict_I_i[OF `i \ I`, of M] by (intro P.measure_space_isomorphic) auto - show ?case proof (intro exI[of _ ?\] conjI ballI) { fix A assume A: "A \ (\ i\insert i I. sets (M i))" @@ -1322,7 +1293,6 @@ apply fastsimp using `i \ I` `finite I` prod[of A] by (auto simp: ac_simps) } note product = this - show "sigma_finite_measure I'.P ?\" proof from I'.sigma_finite_pairs guess F :: "'i \ nat \ 'a set" .. @@ -1395,7 +1365,7 @@ have "\A. measure (Pi\<^isub>E {} A) = 1" using assms by (subst measure_times) auto then show ?thesis - unfolding positive_integral_alt simple_function_def simple_integral_def_raw + unfolding positive_integral_def simple_function_def simple_integral_def_raw proof (simp add: P_empty, intro antisym) show "f (\k. undefined) \ (SUP f:{g. g \ f}. f (\k. undefined))" by (intro le_SUPI) auto @@ -1455,17 +1425,13 @@ have "finite (I \ J)" using fin by auto interpret IJ: finite_product_sigma_finite M \ "I \ J" by default fact interpret P: pair_sigma_finite I.P I.measure J.P J.measure by default - let ?f = "\x. ((\i\I. x i), (\i\J. x i))" - have P_borel: "(\x. f (case x of (x, y) \ merge I x J y)) \ borel_measurable P.P" by (subst product_product_vimage_algebra_eq[OF IJ fin, symmetric]) (auto simp: space_pair_algebra intro!: IJ.measurable_vimage f) - have split_f_image[simp]: "\F. ?f ` (Pi\<^isub>E (I \ J) F) = (Pi\<^isub>E I F) \ (Pi\<^isub>E J F)" apply auto apply (rule_tac x="merge I a J b" in image_eqI) by (auto dest: extensional_restrict) - have "IJ.positive_integral f = IJ.positive_integral (\x. f (restrict x (I \ J)))" by (auto intro!: IJ.positive_integral_cong arg_cong[where f=f] dest!: extensional_restrict) also have "\ = I.positive_integral (\x. J.positive_integral (\y. f (merge I x J y)))" diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Radon_Nikodym.thy --- a/src/HOL/Probability/Radon_Nikodym.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Radon_Nikodym.thy Thu Dec 02 15:32:48 2010 +0100 @@ -69,6 +69,8 @@ qed qed +subsection "Absolutely continuous" + definition (in measure_space) "absolutely_continuous \ = (\N\null_sets. \ N = (0 :: pinfreal))" @@ -111,6 +113,14 @@ finally show "\ N = 0" . qed +lemma (in measure_space) density_is_absolutely_continuous: + assumes "\A. A \ sets M \ \ A = positive_integral (\x. f x * indicator A x)" + shows "absolutely_continuous \" + using assms unfolding absolutely_continuous_def + by (simp add: positive_integral_null_set) + +subsection "Existence of the Radon-Nikodym derivative" + lemma (in finite_measure) Radon_Nikodym_aux_epsilon: fixes e :: real assumes "0 < e" assumes "finite_measure M s" @@ -120,21 +130,17 @@ proof - let "?d A" = "real (\ A) - real (s A)" interpret M': finite_measure M s by fact - let "?A A" = "if (\B\sets M. B \ space M - A \ -e < ?d B) then {} else (SOME B. B \ sets M \ B \ space M - A \ ?d B \ -e)" def A \ "\n. ((\B. B \ ?A B) ^^ n) {}" - have A_simps[simp]: "A 0 = {}" "\n. A (Suc n) = (A n \ ?A (A n))" unfolding A_def by simp_all - { fix A assume "A \ sets M" have "?A A \ sets M" by (auto intro!: someI2[of _ _ "\A. A \ sets M"] simp: not_less) } note A'_in_sets = this - { fix n have "A n \ sets M" proof (induct n) case (Suc n) thus "A (Suc n) \ sets M" @@ -142,7 +148,6 @@ qed (simp add: A_def) } note A_in_sets = this hence "range A \ sets M" by auto - { fix n B assume Ex: "\B. B \ sets M \ B \ space M - A n \ ?d B \ -e" hence False: "\ (\B\sets M. B \ space M - A n \ -e < ?d B)" by (auto simp: not_less) @@ -156,7 +161,6 @@ finally show "?d (A n \ B) \ ?d (A n) - e" . qed } note dA_epsilon = this - { fix n have "?d (A (Suc n)) \ ?d (A n)" proof (cases "\B. B\sets M \ B \ space M - A n \ ?d B \ - e") case True from dA_epsilon[OF this] show ?thesis using `0 < e` by simp @@ -166,7 +170,6 @@ thus ?thesis by simp qed } note dA_mono = this - show ?thesis proof (cases "\n. \B\sets M. B \ space M - A n \ -e < ?d B") case True then obtain n where B: "\B. \ B \ sets M; B \ space M - A n\ \ -e < ?d B" by blast @@ -220,11 +223,8 @@ proof - let "?d A" = "real (\ A) - real (s A)" let "?P A B n" = "A \ sets M \ A \ B \ ?d B \ ?d A \ (\C\sets M. C \ A \ - 1 / real (Suc n) < ?d C)" - interpret M': finite_measure M s by fact - let "?r S" = "restricted_space S" - { fix S n assume S: "S \ sets M" hence **: "\X. X \ op \ S ` sets M \ X \ sets M \ X \ S" by auto @@ -242,11 +242,9 @@ qed hence "\A. ?P A S n" by auto } note Ex_P = this - def A \ "nat_rec (space M) (\n A. SOME B. ?P B A n)" have A_Suc: "\n. A (Suc n) = (SOME B. ?P B (A n) n)" by (simp add: A_def) have A_0[simp]: "A 0 = space M" unfolding A_def by simp - { fix i have "A i \ sets M" unfolding A_def proof (induct i) case (Suc i) @@ -254,19 +252,15 @@ by (rule someI2_ex) simp qed simp } note A_in_sets = this - { fix n have "?P (A (Suc n)) (A n) n" using Ex_P[OF A_in_sets] unfolding A_Suc by (rule someI2_ex) simp } note P_A = this - have "range A \ sets M" using A_in_sets by auto - have A_mono: "\i. A (Suc i) \ A i" using P_A by simp have mono_dA: "mono (\i. ?d (A i))" using P_A by (simp add: mono_iff_le_Suc) have epsilon: "\C i. \ C \ sets M; C \ A (Suc i) \ \ - 1 / real (Suc i) < ?d C" using P_A by auto - show ?thesis proof (safe intro!: bexI[of _ "\i. A i"]) show "(\i. A i) \ sets M" using A_in_sets by auto @@ -298,24 +292,19 @@ shows "\f \ borel_measurable M. \A\sets M. \ A = positive_integral (\x. f x * indicator A x)" proof - interpret M': finite_measure M \ using assms(1) . - def G \ "{g \ borel_measurable M. \A\sets M. positive_integral (\x. g x * indicator A x) \ \ A}" have "(\x. 0) \ G" unfolding G_def by auto hence "G \ {}" by auto - { fix f g assume f: "f \ G" and g: "g \ G" have "(\x. max (g x) (f x)) \ G" (is "?max \ G") unfolding G_def proof safe show "?max \ borel_measurable M" using f g unfolding G_def by auto - let ?A = "{x \ space M. f x \ g x}" have "?A \ sets M" using f g unfolding G_def by auto - fix A assume "A \ sets M" hence sets: "?A \ A \ sets M" "(space M - ?A) \ A \ sets M" using `?A \ sets M` by auto have union: "((?A \ A) \ ((space M - ?A) \ A)) = A" using sets_into_space[OF `A \ sets M`] by auto - have "\x. x \ space M \ max (g x) (f x) * indicator A x = g x * indicator (?A \ A) x + f x * indicator ((space M - ?A) \ A) x" by (auto simp: indicator_def max_def) @@ -331,14 +320,12 @@ finally show "positive_integral (\x. max (g x) (f x) * indicator A x) \ \ A" . qed } note max_in_G = this - { fix f g assume "f \ g" and f: "\i. f i \ G" have "g \ G" unfolding G_def proof safe from `f \ g` have [simp]: "g = (SUP i. f i)" unfolding isoton_def by simp have f_borel: "\i. f i \ borel_measurable M" using f unfolding G_def by simp thus "g \ borel_measurable M" by (auto intro!: borel_measurable_SUP) - fix A assume "A \ sets M" hence "\i. (\x. f i x * indicator A x) \ borel_measurable M" using f_borel by (auto intro!: borel_measurable_indicator) @@ -350,7 +337,6 @@ using f `A \ sets M` unfolding G_def by (auto intro!: SUP_leI) qed } note SUP_in_G = this - let ?y = "SUP g : G. positive_integral g" have "?y \ \ (space M)" unfolding G_def proof (safe intro!: SUP_leI) @@ -385,7 +371,6 @@ hence isoton_g: "?g \ f" by (simp add: isoton_def le_fun_def f_def) from SUP_in_G[OF this g_in_G] have "f \ G" . hence [simp, intro]: "f \ borel_measurable M" unfolding G_def by auto - have "(\i. positive_integral (?g i)) \ positive_integral f" using isoton_g g_in_G by (auto intro!: positive_integral_isoton simp: G_def f_def) hence "positive_integral f = (SUP i. positive_integral (?g i))" @@ -398,9 +383,7 @@ by (auto intro!: SUP_mono positive_integral_mono Max_ge) qed finally have int_f_eq_y: "positive_integral f = ?y" . - let "?t A" = "\ A - positive_integral (\x. f x * indicator A x)" - have "finite_measure M ?t" proof show "?t {} = 0" by simp @@ -435,9 +418,7 @@ qed qed then interpret M: finite_measure M ?t . - have ac: "absolutely_continuous ?t" using `absolutely_continuous \` unfolding absolutely_continuous_def by auto - have upper_bound: "\A\sets M. ?t A \ 0" proof (rule ccontr) assume "\ ?thesis" @@ -460,7 +441,6 @@ ultimately have b: "b \ 0" "b \ \" using M'.finite_measure_of_space by (auto simp: pinfreal_inverse_eq_0 finite_measure_of_space) - have "finite_measure M (\A. b * \ A)" (is "finite_measure M ?b") proof show "?b {} = 0" by simp @@ -469,7 +449,6 @@ unfolding countably_additive_def psuminf_cmult_right using measure_countably_additive by auto qed - from M.Radon_Nikodym_aux[OF this] obtain A0 where "A0 \ sets M" and space_less_A0: "real (?t (space M)) - real (b * \ (space M)) \ real (?t A0) - real (b * \ A0)" and @@ -479,9 +458,7 @@ using M'.finite_measure b finite_measure by (cases "b * \ B", cases "?t B") (auto simp: field_simps) } note bM_le_t = this - let "?f0 x" = "f x + b * indicator A0 x" - { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto have "positive_integral (\x. ?f0 x * indicator A x) = @@ -492,7 +469,6 @@ using `A0 \ sets M` `A \ A0 \ sets M` A by (simp add: borel_measurable_indicator positive_integral_add positive_integral_cmult_indicator) } note f0_eq = this - { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto have f_le_v: "positive_integral (\x. f x * indicator A x) \ \ A" @@ -511,18 +487,15 @@ finally have "positive_integral (\x. ?f0 x * indicator A x) \ \ A" . } hence "?f0 \ G" using `A0 \ sets M` unfolding G_def by (auto intro!: borel_measurable_indicator borel_measurable_pinfreal_add borel_measurable_pinfreal_times) - have real: "?t (space M) \ \" "?t A0 \ \" "b * \ (space M) \ \" "b * \ A0 \ \" using `A0 \ sets M` b finite_measure[of A0] M.finite_measure[of A0] finite_measure_of_space M.finite_measure_of_space by auto - have int_f_finite: "positive_integral f \ \" using M'.finite_measure_of_space pos_t unfolding pinfreal_zero_less_diff_iff by (auto cong: positive_integral_cong) - have "?t (space M) > b * \ (space M)" unfolding b_def apply (simp add: field_simps) apply (subst mult_assoc[symmetric]) @@ -539,18 +512,15 @@ hence "0 < \ A0" using ac unfolding absolutely_continuous_def using `A0 \ sets M` by auto hence "0 < b * \ A0" using b by auto - from int_f_finite this have "?y + 0 < positive_integral f + b * \ A0" unfolding int_f_eq_y by (rule pinfreal_less_add) also have "\ = positive_integral ?f0" using f0_eq[OF top] `A0 \ sets M` sets_into_space by (simp cong: positive_integral_cong) finally have "?y < positive_integral ?f0" by simp - moreover from `?f0 \ G` have "positive_integral ?f0 \ ?y" by (auto intro!: le_SUPI) ultimately show False by auto qed - show ?thesis proof (safe intro!: bexI[of _ f]) fix A assume "A\sets M" @@ -575,10 +545,8 @@ interpret v: measure_space M \ by fact let ?Q = "{Q\sets M. \ Q \ \}" let ?a = "SUP Q:?Q. \ Q" - have "{} \ ?Q" using v.empty_measure by auto then have Q_not_empty: "?Q \ {}" by blast - have "?a \ \ (space M)" using sets_into_space by (auto intro!: SUP_leI measure_mono top) then have "?a \ \" using finite_measure_of_space @@ -596,9 +564,7 @@ show "range ?O \ sets M" using Q' by (auto intro!: finite_UN) show "\i. ?O i \ ?O (Suc i)" by fastsimp qed - have Q'_sets: "\i. Q' i \ sets M" using Q' by auto - have O_sets: "\i. ?O i \ sets M" using Q' by (auto intro!: finite_UN Un) then have O_in_G: "\i. ?O i \ ?Q" @@ -611,7 +577,6 @@ finally show "\ (?O i) \ \" unfolding pinfreal_less_\ by auto qed auto have O_mono: "\n. ?O n \ ?O (Suc n)" by fastsimp - have a_eq: "?a = \ (\i. ?O i)" unfolding Union[symmetric] proof (rule antisym) show "?a \ (SUP i. \ (?O i))" unfolding a_Lim @@ -625,14 +590,11 @@ using O_in_G[of i] by (auto intro!: exI[of _ "?O i"]) qed qed - let "?O_0" = "(\i. ?O i)" have "?O_0 \ sets M" using Q' by auto - def Q \ "\i. case i of 0 \ Q' 0 | Suc n \ ?O (Suc n) - ?O n" { fix i have "Q i \ sets M" unfolding Q_def using Q'[of 0] by (cases i) (auto intro: O_sets) } note Q_sets = this - show ?thesis proof (intro bexI exI conjI ballI impI allI) show "disjoint_family Q" @@ -640,7 +602,6 @@ split: nat.split_asm) show "range Q \ sets M" using Q_sets by auto - { fix A assume A: "A \ sets M" "A \ space M - ?O_0" show "\ A = 0 \ \ A = 0 \ 0 < \ A \ \ A = \" proof (rule disjCI, simp) @@ -677,7 +638,6 @@ with `\ A \ 0` show ?thesis by auto qed qed } - { fix i show "\ (Q i) \ \" proof (cases i) case 0 then show ?thesis @@ -688,9 +648,7 @@ using `?O n \ ?Q` `?O (Suc n) \ ?Q` O_mono using v.measure_Diff[of "?O n" "?O (Suc n)"] by auto qed } - show "space M - ?O_0 \ sets M" using Q'_sets by auto - { fix j have "(\i\j. ?O i) = (\i\j. Q i)" proof (induct j) case 0 then show ?case by (simp add: Q_def) @@ -713,7 +671,6 @@ shows "\f \ borel_measurable M. \A\sets M. \ A = positive_integral (\x. f x * indicator A x)" proof - interpret v: measure_space M \ by fact - from split_space_into_finite_sets_and_rest[OF assms] obtain Q0 and Q :: "nat \ 'a set" where Q: "disjoint_family Q" "range Q \ sets M" @@ -721,7 +678,6 @@ and in_Q0: "\A. A \ sets M \ A \ Q0 \ \ A = 0 \ \ A = 0 \ 0 < \ A \ \ A = \" and Q_fin: "\i. \ (Q i) \ \" by force from Q have Q_sets: "\i. Q i \ sets M" by auto - have "\i. \f. f\borel_measurable M \ (\A\sets M. \ (Q i \ A) = positive_integral (\x. f x * indicator (Q i \ A) x))" proof @@ -729,7 +685,6 @@ have indicator_eq: "\f x A. (f x :: pinfreal) * indicator (Q i \ A) x * indicator (Q i) x = (f x * indicator (Q i) x) * indicator A x" unfolding indicator_def by auto - have fm: "finite_measure (restricted_space (Q i)) \" (is "finite_measure ?R \") by (rule restricted_finite_measure[OF Q_sets[of i]]) then interpret R: finite_measure ?R . @@ -843,12 +798,6 @@ section "Uniqueness of densities" -lemma (in measure_space) density_is_absolutely_continuous: - assumes "\A. A \ sets M \ \ A = positive_integral (\x. f x * indicator A x)" - shows "absolutely_continuous \" - using assms unfolding absolutely_continuous_def - by (simp add: positive_integral_null_set) - lemma (in measure_space) finite_density_unique: assumes borel: "f \ borel_measurable M" "g \ borel_measurable M" and fin: "positive_integral f < \" @@ -973,19 +922,16 @@ using h_borel by (rule measure_space_density) interpret h: finite_measure M "\A. positive_integral (\x. h x * indicator A x)" by default (simp cong: positive_integral_cong add: fin) - interpret f: measure_space M "\A. positive_integral (\x. f x * indicator A x)" using borel(1) by (rule measure_space_density) interpret f': measure_space M "\A. positive_integral (\x. f' x * indicator A x)" using borel(2) by (rule measure_space_density) - { fix A assume "A \ sets M" then have " {x \ space M. h x \ 0 \ indicator A x \ (0::pinfreal)} = A" using pos sets_into_space by (force simp: indicator_def) then have "positive_integral (\xa. h xa * indicator A xa) = 0 \ A \ null_sets" using h_borel `A \ sets M` by (simp add: positive_integral_0_iff) } note h_null_sets = this - { fix A assume "A \ sets M" have "positive_integral (\x. h x * (f x * indicator A x)) = f.positive_integral (\x. h x * indicator A x)" @@ -1101,7 +1047,7 @@ qed qed -section "Radon Nikodym derivative" +section "Radon-Nikodym derivative" definition (in sigma_finite_measure) "RN_deriv \ \ SOME f. f \ borel_measurable M \ diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Probability/Sigma_Algebra.thy --- a/src/HOL/Probability/Sigma_Algebra.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Probability/Sigma_Algebra.thy Thu Dec 02 15:32:48 2010 +0100 @@ -397,6 +397,18 @@ by (auto intro: sigma_sets.Empty sigma_sets_top) qed +lemma (in sigma_algebra) sets_sigma_subset: + assumes "space N = space M" + assumes "sets N \ sets M" + shows "sets (sigma N) \ sets M" + by (unfold assms sets_sigma, rule sigma_sets_subset, rule assms) + +lemma in_sigma[intro, simp]: "A \ sets M \ A \ sets (sigma M)" + unfolding sigma_def by (auto intro!: sigma_sets.Basic) + +lemma (in sigma_algebra) sigma_eq[simp]: "sigma M = M" + unfolding sigma_def sigma_sets_eq by simp + section {* Measurable functions *} definition @@ -859,6 +871,22 @@ qed qed +lemma vimage_algebra_sigma: + assumes E: "sets E \ Pow (space E)" + and f: "f \ space F \ space E" + and "\A. A \ sets F \ A \ (\X. f -` X \ space F) ` sets E" + and "\A. A \ sets E \ f -` A \ space F \ sets F" + shows "sigma_algebra.vimage_algebra (sigma E) (space F) f = sigma F" +proof - + interpret sigma_algebra "sigma E" + using assms by (intro sigma_algebra_sigma) auto + have eq: "sets F = (\X. f -` X \ space F) ` sets E" + using assms by auto + show "vimage_algebra (space F) f = sigma F" + unfolding vimage_algebra_def using assms + by (simp add: sigma_def eq sigma_sets_vimage) +qed + section {* Conditional space *} definition (in algebra) @@ -1149,7 +1177,6 @@ section {* Dynkin systems *} - locale dynkin_system = fixes M :: "'a algebra" assumes space_closed: "sets M \ Pow (space M)" diff -r 177cd660abb7 -r e2929572d5c7 src/HOL/Set.thy --- a/src/HOL/Set.thy Thu Dec 02 14:56:16 2010 +0100 +++ b/src/HOL/Set.thy Thu Dec 02 15:32:48 2010 +0100 @@ -882,7 +882,6 @@ lemma rangeE [elim?]: "b \ range (\x. f x) ==> (!!x. b = f x ==> P) ==> P" by blast - subsubsection {* Some rules with @{text "if"} *} text{* Elimination of @{text"{x. \ & x=t & \}"}. *}