# HG changeset patch # User hoelzl # Date 1400502418 -7200 # Node ID 891e992e510fd111b2d08a0beb2eba0d52bbb037 # Parent 61855ade6c7e55694b7569ec01584a0585835376 renamed positive_integral to nn_integral diff -r 61855ade6c7e -r 891e992e510f NEWS --- a/NEWS Mon May 19 13:53:58 2014 +0200 +++ b/NEWS Mon May 19 14:26:58 2014 +0200 @@ -733,6 +733,13 @@ integral_cmul_indicator integral_real + - Renamed positive_integral to nn_integral: + + * Renamed all lemmas "*positive_integral*" to *nn_integral*" + positive_integral_positive ~> nn_integral_nonneg + + * Renamed abbreviation integral\<^sup>P to integral\<^sup>N. + *** Scala *** * The signature and semantics of Document.Snapshot.cumulate_markup / diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Binary_Product_Measure.thy --- a/src/HOL/Probability/Binary_Product_Measure.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Binary_Product_Measure.thy Mon May 19 14:26:58 2014 +0200 @@ -239,7 +239,7 @@ shows "emeasure (N \\<^sub>M M) X = (\\<^sup>+ x. \\<^sup>+ y. indicator X (x, y) \M \N)" (is "_ = ?\ X") proof (rule emeasure_measure_of[OF pair_measure_def]) show "positive (sets (N \\<^sub>M M)) ?\" - by (auto simp: positive_def positive_integral_positive) + by (auto simp: positive_def nn_integral_nonneg) have eq[simp]: "\A x y. indicator A (x, y) = indicator (Pair x -` A) y" by (auto simp: indicator_def) show "countably_additive (sets (N \\<^sub>M M)) ?\" @@ -253,8 +253,8 @@ moreover have "\x. range (\i. Pair x -` F i) \ sets M" using F by (auto simp: sets_Pair1) ultimately show "(\n. ?\ (F n)) = ?\ (\i. F i)" - by (auto simp add: vimage_UN positive_integral_suminf[symmetric] suminf_emeasure subset_eq emeasure_nonneg sets_Pair1 - intro!: positive_integral_cong positive_integral_indicator[symmetric]) + by (auto simp add: vimage_UN nn_integral_suminf[symmetric] suminf_emeasure subset_eq emeasure_nonneg sets_Pair1 + intro!: nn_integral_cong nn_integral_indicator[symmetric]) qed show "{a \ b |a b. a \ sets N \ b \ sets M} \ Pow (space N \ space M)" using sets.space_closed[of N] sets.space_closed[of M] by auto @@ -267,7 +267,7 @@ have [simp]: "\x y. indicator X (x, y) = indicator (Pair x -` X) y" by (auto simp: indicator_def) show ?thesis - using X by (auto intro!: positive_integral_cong simp: emeasure_pair_measure sets_Pair1) + using X by (auto intro!: nn_integral_cong simp: emeasure_pair_measure sets_Pair1) qed lemma (in sigma_finite_measure) emeasure_pair_measure_Times: @@ -275,9 +275,9 @@ shows "emeasure (N \\<^sub>M M) (A \ B) = emeasure N A * emeasure M B" proof - have "emeasure (N \\<^sub>M M) (A \ B) = (\\<^sup>+x. emeasure M B * indicator A x \N)" - using A B by (auto intro!: positive_integral_cong simp: emeasure_pair_measure_alt) + using A B by (auto intro!: nn_integral_cong simp: emeasure_pair_measure_alt) also have "\ = emeasure M B * emeasure N A" - using A by (simp add: emeasure_nonneg positive_integral_cmult_indicator) + using A by (simp add: emeasure_nonneg nn_integral_cmult_indicator) finally show ?thesis by (simp add: ac_simps) qed @@ -418,7 +418,7 @@ proof (rule AE_I) from N measurable_emeasure_Pair1[OF `N \ sets (M1 \\<^sub>M M2)`] show "emeasure M1 {x\space M1. emeasure M2 (Pair x -` N) \ 0} = 0" - by (auto simp: M2.emeasure_pair_measure_alt positive_integral_0_iff emeasure_nonneg) + by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff emeasure_nonneg) show "{x \ space M1. emeasure M2 (Pair x -` N) \ 0} \ sets M1" by (intro borel_measurable_ereal_neq_const measurable_emeasure_Pair1 N) { fix x assume "x \ space M1" "emeasure M2 (Pair x -` N) = 0" @@ -446,9 +446,9 @@ by (simp add: M2.emeasure_pair_measure) also have "\ = (\\<^sup>+ x. \\<^sup>+ y. 0 \M2 \M1)" using ae - apply (safe intro!: positive_integral_cong_AE) + apply (safe intro!: nn_integral_cong_AE) apply (intro AE_I2) - apply (safe intro!: positive_integral_cong_AE) + apply (safe intro!: nn_integral_cong_AE) apply auto done finally show "emeasure (M1 \\<^sub>M M2) {x \ space (M1 \\<^sub>M M2). \ P x} = 0" by simp @@ -486,7 +486,7 @@ "x \ space M1 \ g \ measurable (M1 \\<^sub>M M2) L \ (\y. g (x, y)) \ measurable M2 L" by simp -lemma (in sigma_finite_measure) borel_measurable_positive_integral_fst': +lemma (in sigma_finite_measure) borel_measurable_nn_integral_fst': assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" "\x. 0 \ f x" shows "(\x. \\<^sup>+ y. f (x, y) \M) \ borel_measurable M1" using f proof induct @@ -495,7 +495,7 @@ by (auto simp: space_pair_measure) show ?case apply (subst measurable_cong) - apply (rule positive_integral_cong) + apply (rule nn_integral_cong) apply fact+ done next @@ -506,56 +506,56 @@ by (simp add: sets_Pair1[OF set]) from this measurable_emeasure_Pair[OF set] show ?case by (rule measurable_cong[THEN iffD1]) -qed (simp_all add: positive_integral_add positive_integral_cmult measurable_compose_Pair1 - positive_integral_monotone_convergence_SUP incseq_def le_fun_def +qed (simp_all add: nn_integral_add nn_integral_cmult measurable_compose_Pair1 + nn_integral_monotone_convergence_SUP incseq_def le_fun_def cong: measurable_cong) -lemma (in sigma_finite_measure) positive_integral_fst': +lemma (in sigma_finite_measure) nn_integral_fst': assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" "\x. 0 \ f x" - shows "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \M \M1) = integral\<^sup>P (M1 \\<^sub>M M) f" (is "?I f = _") + shows "(\\<^sup>+ x. \\<^sup>+ y. f (x, y) \M \M1) = integral\<^sup>N (M1 \\<^sub>M M) f" (is "?I f = _") using f proof induct case (cong u v) then have "?I u = ?I v" - by (intro positive_integral_cong) (auto simp: space_pair_measure) + by (intro nn_integral_cong) (auto simp: space_pair_measure) with cong show ?case - by (simp cong: positive_integral_cong) -qed (simp_all add: emeasure_pair_measure positive_integral_cmult positive_integral_add - positive_integral_monotone_convergence_SUP - measurable_compose_Pair1 positive_integral_positive - borel_measurable_positive_integral_fst' positive_integral_mono incseq_def le_fun_def - cong: positive_integral_cong) + by (simp cong: nn_integral_cong) +qed (simp_all add: emeasure_pair_measure nn_integral_cmult nn_integral_add + nn_integral_monotone_convergence_SUP + measurable_compose_Pair1 nn_integral_nonneg + borel_measurable_nn_integral_fst' nn_integral_mono incseq_def le_fun_def + cong: nn_integral_cong) -lemma (in sigma_finite_measure) positive_integral_fst: +lemma (in sigma_finite_measure) nn_integral_fst: assumes f: "f \ borel_measurable (M1 \\<^sub>M M)" - shows "(\\<^sup>+ x. (\\<^sup>+ y. f (x, y) \M) \M1) = integral\<^sup>P (M1 \\<^sub>M M) f" + shows "(\\<^sup>+ x. (\\<^sup>+ y. f (x, y) \M) \M1) = integral\<^sup>N (M1 \\<^sub>M M) f" using f - borel_measurable_positive_integral_fst'[of "\x. max 0 (f x)"] - positive_integral_fst'[of "\x. max 0 (f x)"] - unfolding positive_integral_max_0 by auto + borel_measurable_nn_integral_fst'[of "\x. max 0 (f x)"] + nn_integral_fst'[of "\x. max 0 (f x)"] + unfolding nn_integral_max_0 by auto -lemma (in sigma_finite_measure) borel_measurable_positive_integral[measurable (raw)]: +lemma (in sigma_finite_measure) borel_measurable_nn_integral[measurable (raw)]: "split f \ borel_measurable (N \\<^sub>M M) \ (\x. \\<^sup>+ y. f x y \M) \ borel_measurable N" - using borel_measurable_positive_integral_fst'[of "\x. max 0 (split f x)" N] - by (simp add: positive_integral_max_0) + using borel_measurable_nn_integral_fst'[of "\x. max 0 (split f x)" N] + by (simp add: nn_integral_max_0) -lemma (in pair_sigma_finite) positive_integral_snd: +lemma (in pair_sigma_finite) nn_integral_snd: assumes f: "f \ borel_measurable (M1 \\<^sub>M M2)" - shows "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = integral\<^sup>P (M1 \\<^sub>M M2) f" + shows "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = integral\<^sup>N (M1 \\<^sub>M M2) f" proof - note measurable_pair_swap[OF f] - from M1.positive_integral_fst[OF this] + from M1.nn_integral_fst[OF this] have "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = (\\<^sup>+ (x, y). f (y, x) \(M2 \\<^sub>M M1))" by simp - also have "(\\<^sup>+ (x, y). f (y, x) \(M2 \\<^sub>M M1)) = integral\<^sup>P (M1 \\<^sub>M M2) f" + also have "(\\<^sup>+ (x, y). f (y, x) \(M2 \\<^sub>M M1)) = integral\<^sup>N (M1 \\<^sub>M M2) f" by (subst distr_pair_swap) - (auto simp: positive_integral_distr[OF measurable_pair_swap' f] intro!: positive_integral_cong) + (auto simp: nn_integral_distr[OF measurable_pair_swap' f] intro!: nn_integral_cong) finally show ?thesis . qed lemma (in pair_sigma_finite) Fubini: assumes f: "f \ borel_measurable (M1 \\<^sub>M M2)" shows "(\\<^sup>+ y. (\\<^sup>+ x. f (x, y) \M1) \M2) = (\\<^sup>+ x. (\\<^sup>+ y. f (x, y) \M2) \M1)" - unfolding positive_integral_snd[OF assms] M2.positive_integral_fst[OF assms] .. + unfolding nn_integral_snd[OF assms] M2.nn_integral_fst[OF assms] .. subsection {* Products on counting spaces, densities and distributions *} @@ -602,7 +602,7 @@ apply (subst emeasure_count_space) using X_subset apply auto [] apply (simp add: fin_Pair emeasure_count_space X_subset fin_X) - apply (subst positive_integral_count_space) + apply (subst nn_integral_count_space) using A apply simp apply (simp del: real_of_nat_setsum add: real_of_nat_setsum[symmetric]) apply (subst card_gt_0_iff) @@ -626,12 +626,12 @@ fix A assume A: "A \ sets ?L" with f g have "(\\<^sup>+ x. f x * \\<^sup>+ y. g y * indicator A (x, y) \M2 \M1) = (\\<^sup>+ x. \\<^sup>+ y. f x * g y * indicator A (x, y) \M2 \M1)" - by (intro positive_integral_cong_AE) - (auto simp add: positive_integral_cmult[symmetric] ac_simps) + by (intro nn_integral_cong_AE) + (auto simp add: nn_integral_cmult[symmetric] ac_simps) with A f g show "emeasure ?L A = emeasure ?R A" - by (simp add: D2.emeasure_pair_measure emeasure_density positive_integral_density - M2.positive_integral_fst[symmetric] - cong: positive_integral_cong) + by (simp add: D2.emeasure_pair_measure emeasure_density nn_integral_density + M2.nn_integral_fst[symmetric] + cong: nn_integral_cong) qed simp lemma sigma_finite_measure_distr: @@ -662,8 +662,8 @@ fix A assume A: "A \ sets ?P" with f g show "emeasure ?P A = emeasure ?D A" by (auto simp add: N.emeasure_pair_measure_alt space_pair_measure emeasure_distr - T.emeasure_pair_measure_alt positive_integral_distr - intro!: positive_integral_cong arg_cong[where f="emeasure N"]) + T.emeasure_pair_measure_alt nn_integral_distr + intro!: nn_integral_cong arg_cong[where f="emeasure N"]) qed simp lemma pair_measure_eqI: diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Bochner_Integration.thy --- a/src/HOL/Probability/Bochner_Integration.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Bochner_Integration.thy Mon May 19 14:26:58 2014 +0200 @@ -284,10 +284,10 @@ from m have "m * emeasure M {x\space M. 0 \ f x} = (\\<^sup>+x. m * indicator {x\space M. 0 \ f x} x \M)" - using f by (intro positive_integral_cmult_indicator[symmetric]) auto + using f by (intro nn_integral_cmult_indicator[symmetric]) auto also have "\ \ (\\<^sup>+x. f x \M)" using AE_space - proof (intro positive_integral_mono_AE, eventually_elim) + proof (intro nn_integral_mono_AE, eventually_elim) fix x assume "x \ space M" with nn show "m * indicator {x \ space M. 0 \ f x} x \ f x" using f by (auto split: split_indicator simp: simple_function_def m_def) @@ -447,7 +447,7 @@ finally show ?thesis . qed -lemma simple_bochner_integral_eq_positive_integral: +lemma simple_bochner_integral_eq_nn_integral: assumes f: "simple_bochner_integrable M f" "\x. 0 \ f x" shows "simple_bochner_integral M f = (\\<^sup>+x. f x \M)" proof - @@ -479,7 +479,7 @@ simp del: setsum_ereal times_ereal.simps(1)) also have "\ = (\\<^sup>+x. f x \M)" using f - by (intro positive_integral_eq_simple_integral[symmetric]) + by (intro nn_integral_eq_simple_integral[symmetric]) (auto simp: simple_function_compose1 simple_bochner_integrable.simps) finally show ?thesis . qed @@ -502,13 +502,13 @@ by (auto intro!: simple_bochner_integral_norm_bound) also have "\ = (\\<^sup>+x. norm (s x - t x) \M)" using simple_bochner_integrable_compose2[of "\x y. norm (x - y)" M "s" "t"] s t - by (auto intro!: simple_bochner_integral_eq_positive_integral) + by (auto intro!: simple_bochner_integral_eq_nn_integral) also have "\ \ (\\<^sup>+x. ereal (norm (f x - s x)) + ereal (norm (f x - t x)) \M)" - by (auto intro!: positive_integral_mono) + by (auto intro!: nn_integral_mono) (metis (erased, hide_lams) add_diff_cancel_left add_diff_eq diff_add_eq order_trans norm_minus_commute norm_triangle_ineq4 order_refl) also have "\ = ?S + ?T" - by (rule positive_integral_add) auto + by (rule nn_integral_add) auto finally show ?thesis . qed @@ -524,14 +524,14 @@ assumes "M = N" "\x. x \ space N \ f x = g x" "x = y" shows "has_bochner_integral M f x \ has_bochner_integral N g y" unfolding has_bochner_integral.simps assms(1,3) - using assms(2) by (simp cong: measurable_cong_strong positive_integral_cong_strong) + using assms(2) by (simp cong: measurable_cong_strong nn_integral_cong_strong) lemma has_bochner_integral_cong_AE: "f \ borel_measurable M \ g \ borel_measurable M \ (AE x in M. f x = g x) \ has_bochner_integral M f x \ has_bochner_integral M g x" unfolding has_bochner_integral.simps by (intro arg_cong[where f=Ex] ext conj_cong rev_conj_cong refl arg_cong[where f="\x. x ----> 0"] - positive_integral_cong_AE) + nn_integral_cong_AE) auto lemma borel_measurable_has_bochner_integral[measurable_dest]: @@ -557,7 +557,7 @@ using A by auto qed (rule simple_function_indicator assms)+ moreover have "simple_bochner_integral M (indicator A) = measure M A" - using simple_bochner_integral_eq_positive_integral[OF sbi] A + using simple_bochner_integral_eq_nn_integral[OF sbi] A by (simp add: ereal_indicator emeasure_eq_ereal_measure) ultimately show ?thesis by (metis has_bochner_integral_simple_bochner_integrable) @@ -584,14 +584,14 @@ (is "?f ----> 0") proof (rule tendsto_sandwich) show "eventually (\n. 0 \ ?f n) sequentially" "(\_. 0) ----> 0" - by (auto simp: positive_integral_positive) + by (auto simp: nn_integral_nonneg) show "eventually (\i. ?f i \ (\\<^sup>+ x. (norm (f x - sf i x)) \M) + \\<^sup>+ x. (norm (g x - sg i x)) \M) sequentially" (is "eventually (\i. ?f i \ ?g i) sequentially") proof (intro always_eventually allI) fix i have "?f i \ (\\<^sup>+ x. (norm (f x - sf i x)) + ereal (norm (g x - sg i x)) \M)" - by (auto intro!: positive_integral_mono norm_diff_triangle_ineq) + by (auto intro!: nn_integral_mono norm_diff_triangle_ineq) also have "\ = ?g i" - by (intro positive_integral_add) auto + by (intro nn_integral_add) auto finally show "?f i \ ?g i" . qed show "?g ----> 0" @@ -625,15 +625,15 @@ (is "?f ----> 0") proof (rule tendsto_sandwich) show "eventually (\n. 0 \ ?f n) sequentially" "(\_. 0) ----> 0" - by (auto simp: positive_integral_positive) + by (auto simp: nn_integral_nonneg) show "eventually (\i. ?f i \ K * (\\<^sup>+ x. norm (f x - s i x) \M)) sequentially" (is "eventually (\i. ?f i \ ?g i) sequentially") proof (intro always_eventually allI) fix i have "?f i \ (\\<^sup>+ x. ereal K * norm (f x - s i x) \M)" - using K by (intro positive_integral_mono) (auto simp: mult_ac) + using K by (intro nn_integral_mono) (auto simp: mult_ac) also have "\ = ?g i" - using K by (intro positive_integral_cmult) auto + using K by (intro nn_integral_cmult) auto finally show "?f i \ ?g i" . qed show "?g ----> 0" @@ -738,15 +738,15 @@ then have "\x. x \ space M \ norm (s i x) \ m" "0 \ m" by (auto simp: m_def image_comp comp_def Max_ge_iff) then have "(\\<^sup>+x. norm (s i x) \M) \ (\\<^sup>+x. ereal m * indicator {x\space M. s i x \ 0} x \M)" - by (auto split: split_indicator intro!: Max_ge positive_integral_mono simp:) + by (auto split: split_indicator intro!: Max_ge nn_integral_mono simp:) also have "\ < \" - using s by (subst positive_integral_cmult_indicator) (auto simp: `0 \ m` simple_bochner_integrable.simps) + using s by (subst nn_integral_cmult_indicator) (auto simp: `0 \ m` simple_bochner_integrable.simps) finally have s_fin: "(\\<^sup>+x. norm (s i x) \M) < \" . have "(\\<^sup>+ x. norm (f x) \M) \ (\\<^sup>+ x. ereal (norm (f x - s i x)) + ereal (norm (s i x)) \M)" - by (auto intro!: positive_integral_mono) (metis add_commute norm_triangle_sub) + by (auto intro!: nn_integral_mono) (metis add_commute norm_triangle_sub) also have "\ = (\\<^sup>+x. norm (f x - s i x) \M) + (\\<^sup>+x. norm (s i x) \M)" - by (rule positive_integral_add) auto + by (rule nn_integral_add) auto also have "\ < \" using s_fin f_s_fin by auto finally show "(\\<^sup>+ x. ereal (norm (f x)) \M) < \" . @@ -776,13 +776,13 @@ have "ereal (norm (?s n)) \ simple_bochner_integral M (\x. norm (s n x))" by (auto intro!: simple_bochner_integral_norm_bound) also have "\ = (\\<^sup>+x. norm (s n x) \M)" - by (intro simple_bochner_integral_eq_positive_integral) + by (intro simple_bochner_integral_eq_nn_integral) (auto intro: s simple_bochner_integrable_compose2) also have "\ \ (\\<^sup>+x. ereal (norm (f x - s n x)) + norm (f x) \M)" - by (auto intro!: positive_integral_mono) + by (auto intro!: nn_integral_mono) (metis add_commute norm_minus_commute norm_triangle_sub) also have "\ = ?t n" - by (rule positive_integral_add) auto + by (rule nn_integral_add) auto finally show "norm (?s n) \ ?t n" . qed have "?t ----> 0 + (\\<^sup>+ x. ereal (norm (f x)) \M)" @@ -816,7 +816,7 @@ have "(\i. ereal (norm (?s i - ?t i))) ----> ereal 0" proof (rule tendsto_sandwich) show "eventually (\i. 0 \ ereal (norm (?s i - ?t i))) sequentially" "(\_. 0) ----> ereal 0" - by (auto simp: positive_integral_positive zero_ereal_def[symmetric]) + by (auto simp: nn_integral_nonneg zero_ereal_def[symmetric]) show "eventually (\i. norm (?s i - ?t i) \ ?S i + ?T i) sequentially" by (intro always_eventually allI simple_bochner_integral_bounded s t f) @@ -841,7 +841,7 @@ fix s assume "(\i. \\<^sup>+ x. ereal (norm (f x - s i x)) \M) ----> 0" also have "(\i. \\<^sup>+ x. ereal (norm (f x - s i x)) \M) = (\i. \\<^sup>+ x. ereal (norm (g x - s i x)) \M)" using ae - by (intro ext positive_integral_cong_AE, eventually_elim) simp + by (intro ext nn_integral_cong_AE, eventually_elim) simp finally show "(\i. \\<^sup>+ x. ereal (norm (g x - s i x)) \M) ----> 0" . qed (auto intro: g) @@ -1087,7 +1087,7 @@ by (intro simple_bochner_integral_bounded s f) also have "\ < ereal (e / 2) + e / 2" using ereal_add_strict_mono[OF less_imp_le[OF M[OF n]] _ `?S n \ \` M[OF m]] - by (auto simp: positive_integral_positive) + by (auto simp: nn_integral_nonneg) also have "\ = e" by simp finally show "dist (?s n) (?s m) < e" by (simp add: dist_norm) @@ -1098,7 +1098,7 @@ by (rule, rule) fact+ qed -lemma positive_integral_dominated_convergence_norm: +lemma nn_integral_dominated_convergence_norm: fixes u' :: "_ \ _::{real_normed_vector, second_countable_topology}" assumes [measurable]: "\i. u i \ borel_measurable M" "u' \ borel_measurable M" "w \ borel_measurable M" @@ -1122,9 +1122,9 @@ qed have "(\i. (\\<^sup>+x. norm (u' x - u i x) \M)) ----> (\\<^sup>+x. 0 \M)" - proof (rule positive_integral_dominated_convergence) + proof (rule nn_integral_dominated_convergence) show "(\\<^sup>+x. 2 * w x \M) < \" - by (rule positive_integral_mult_bounded_inf[OF _ w, of 2]) auto + by (rule nn_integral_mult_bounded_inf[OF _ w, of 2]) auto show "AE x in M. (\i. ereal (norm (u' x - u i x))) ----> 0" using u' proof eventually_elim @@ -1152,9 +1152,9 @@ proof (rule integrableI_sequence) { fix i have "(\\<^sup>+x. norm (s i x) \M) \ (\\<^sup>+x. 2 * ereal (norm (f x)) \M)" - by (intro positive_integral_mono) (simp add: bound) + by (intro nn_integral_mono) (simp add: bound) also have "\ = 2 * (\\<^sup>+x. ereal (norm (f x)) \M)" - by (rule positive_integral_cmult) auto + by (rule nn_integral_cmult) auto finally have "(\\<^sup>+x. norm (s i x) \M) < \" using fin by auto } note fin_s = this @@ -1163,13 +1163,13 @@ by (rule simple_bochner_integrableI_bounded) fact+ show "(\i. \\<^sup>+ x. ereal (norm (f x - s i x)) \M) ----> 0" - proof (rule positive_integral_dominated_convergence_norm) + proof (rule nn_integral_dominated_convergence_norm) show "\j. AE x in M. norm (s j x) \ 2 * norm (f x)" using bound by auto show "\i. s i \ borel_measurable M" "(\x. 2 * norm (f x)) \ borel_measurable M" using s by (auto intro: borel_measurable_simple_function) show "(\\<^sup>+ x. ereal (2 * norm (f x)) \M) < \" - using fin unfolding times_ereal.simps(1)[symmetric] by (subst positive_integral_cmult) auto + using fin unfolding times_ereal.simps(1)[symmetric] by (subst nn_integral_cmult) auto show "AE x in M. (\i. s i x) ----> f x" using pointwise by auto qed fact @@ -1182,7 +1182,7 @@ shows "integrable M f" proof - have "(\\<^sup>+x. norm (f x) \M) = (\\<^sup>+x. f x \M)" - using assms by (intro positive_integral_cong_AE) auto + using assms by (intro nn_integral_cong_AE) auto then show ?thesis using assms by (intro integrableI_bounded) auto qed @@ -1203,7 +1203,7 @@ assume "f \ borel_measurable M" "g \ borel_measurable M" assume "AE x in M. norm (g x) \ norm (f x)" then have "(\\<^sup>+ x. ereal (norm (g x)) \M) \ (\\<^sup>+ x. ereal (norm (f x)) \M)" - by (intro positive_integral_mono_AE) auto + by (intro nn_integral_mono_AE) auto also assume "(\\<^sup>+ x. ereal (norm (f x)) \M) < \" finally show "(\\<^sup>+ x. ereal (norm (g x)) \M) < \" . qed @@ -1249,7 +1249,7 @@ lemma integrable_indicator_iff: "integrable M (indicator A::_ \ real) \ A \ space M \ sets M \ emeasure M (A \ space M) < \" - by (simp add: integrable_iff_bounded borel_measurable_indicator_iff ereal_indicator positive_integral_indicator' + by (simp add: integrable_iff_bounded borel_measurable_indicator_iff ereal_indicator nn_integral_indicator' cong: conj_cong) lemma integral_dominated_convergence: @@ -1264,7 +1264,7 @@ have "AE x in M. 0 \ w x" using bound[of 0] by eventually_elim (auto intro: norm_ge_zero order_trans) then have "(\\<^sup>+x. w x \M) = (\\<^sup>+x. norm (w x) \M)" - by (intro positive_integral_cong_AE) auto + by (intro nn_integral_cong_AE) auto with `integrable M w` have w: "w \ borel_measurable M" "(\\<^sup>+x. w x \M) < \" unfolding integrable_iff_bounded by auto @@ -1273,7 +1273,7 @@ proof fix i have "(\\<^sup>+ x. ereal (norm (s i x)) \M) \ (\\<^sup>+x. w x \M)" - using bound by (intro positive_integral_mono_AE) auto + using bound by (intro nn_integral_mono_AE) auto with w show "(\\<^sup>+ x. ereal (norm (s i x)) \M) < \" by auto qed fact @@ -1285,7 +1285,7 @@ proof have "(\\<^sup>+ x. ereal (norm (f x)) \M) \ (\\<^sup>+x. w x \M)" using all_bound lim - proof (intro positive_integral_mono_AE, eventually_elim) + proof (intro nn_integral_mono_AE, eventually_elim) fix x assume "\i. norm (s i x) \ w x" "(\i. s i x) ----> f x" then show "ereal (norm (f x)) \ ereal (w x)" by (intro LIMSEQ_le_const2[where X="\i. ereal (norm (s i x))"] tendsto_intros lim_ereal[THEN iffD2]) auto @@ -1308,7 +1308,7 @@ show "(\n. \\<^sup>+x. norm (s n x - f x) \M) ----> ereal 0" unfolding zero_ereal_def[symmetric] apply (subst norm_minus_commute) - proof (rule positive_integral_dominated_convergence_norm[where w=w]) + proof (rule nn_integral_dominated_convergence_norm[where w=w]) show "\n. s n \ borel_measurable M" using int_s unfolding integrable_iff_bounded by auto qed fact+ @@ -1325,7 +1325,7 @@ using integrable_mult_left[of c M f] integrable_mult_left[of "1 / c" M "\x. c * f x"] by (cases "c = 0") auto -lemma positive_integral_eq_integral: +lemma nn_integral_eq_integral: assumes f: "integrable M f" assumes nonneg: "AE x in M. 0 \ f x" shows "(\\<^sup>+ x. f x \M) = integral\<^sup>L M f" @@ -1338,7 +1338,7 @@ next case (mult f c) then show ?case unfolding times_ereal.simps(1)[symmetric] - by (subst positive_integral_cmult) + by (subst nn_integral_cmult) (auto simp add: integrable_mult_left_iff zero_ereal_def[symmetric]) next case (add g f) @@ -1346,7 +1346,7 @@ by (auto intro!: integrable_bound[OF add(8)]) with add show ?case unfolding plus_ereal.simps(1)[symmetric] - by (subst positive_integral_add) auto + by (subst nn_integral_add) auto next case (seq s) { fix i x assume "x \ space M" with seq(4) have "s i x \ f x" @@ -1366,7 +1366,7 @@ using seq f s_le_f by (intro integrable_bound[OF f(3)]) auto have "(\i. \\<^sup>+ x. s i x \M) ----> \\<^sup>+ x. f x \M" using seq s_le_f f - by (intro positive_integral_dominated_convergence[where w=f]) + by (intro nn_integral_dominated_convergence[where w=f]) (auto simp: integrable_iff_bounded) also have "(\i. \\<^sup>+x. s i x \M) = (\i. \x. s i x \M)" using seq int_s by simp @@ -1379,19 +1379,19 @@ also have "\ = integral\<^sup>L M f" using assms by (auto intro!: integral_cong_AE) also have "(\\<^sup>+ x. max 0 (f x) \M) = (\\<^sup>+ x. f x \M)" - using assms by (auto intro!: positive_integral_cong_AE simp: max_def) + using assms by (auto intro!: nn_integral_cong_AE simp: max_def) finally show ?thesis . qed lemma integral_norm_bound: fixes f :: "_ \ 'a :: {banach, second_countable_topology}" shows "integrable M f \ norm (integral\<^sup>L M f) \ (\x. norm (f x) \M)" - using positive_integral_eq_integral[of M "\x. norm (f x)"] + using nn_integral_eq_integral[of M "\x. norm (f x)"] using integral_norm_bound_ereal[of M f] by simp -lemma integral_eq_positive_integral: +lemma integral_eq_nn_integral: "integrable M f \ (\x. 0 \ f x) \ integral\<^sup>L M f = real (\\<^sup>+ x. ereal (f x) \M)" - by (subst positive_integral_eq_integral) auto + by (subst nn_integral_eq_integral) auto lemma integrableI_simple_bochner_integrable: fixes f :: "'a \ 'b::{banach, second_countable_topology}" @@ -1445,9 +1445,9 @@ fix i have "(\\<^sup>+x. norm (s' i x) \M) \ (\\<^sup>+x. 2 * ereal (norm (f x)) \M)" - using s by (intro positive_integral_mono) (auto simp: s'_eq_s) + using s by (intro nn_integral_mono) (auto simp: s'_eq_s) also have "\ < \" - using f by (subst positive_integral_cmult) auto + using f by (subst nn_integral_cmult) auto finally have sbi: "simple_bochner_integrable M (s' i)" using sf by (intro simple_bochner_integrableI_bounded) auto then show "integrable M (s' i)" @@ -1475,8 +1475,8 @@ shows "0 \ integral\<^sup>L M f" proof - have "0 \ ereal (integral\<^sup>L M (\x. max 0 (f x)))" - by (subst integral_eq_positive_integral) - (auto intro: real_of_ereal_pos positive_integral_positive integrable_max assms) + by (subst integral_eq_nn_integral) + (auto intro: real_of_ereal_pos nn_integral_nonneg integrable_max assms) also have "integral\<^sup>L M (\x. max 0 (f x)) = integral\<^sup>L M f" using assms(2) by (intro integral_cong_AE assms integrable_max) auto finally show ?thesis @@ -1493,10 +1493,10 @@ shows "integral\<^sup>L M f = 0 \ (AE x in M. f x = 0)" proof assume "integral\<^sup>L M f = 0" - then have "integral\<^sup>P M f = 0" - using positive_integral_eq_integral[OF f nonneg] by simp + then have "integral\<^sup>N M f = 0" + using nn_integral_eq_integral[OF f nonneg] by simp then have "AE x in M. ereal (f x) \ 0" - by (simp add: positive_integral_0_iff_AE) + by (simp add: nn_integral_0_iff_AE) with nonneg show "AE x in M. f x = 0" by auto qed (auto simp add: integral_eq_zero_AE) @@ -1527,8 +1527,8 @@ and nn: "AE x in M. 0 \ g x" shows "integrable (density M g) f \ integrable M (\x. g x *\<^sub>R f x)" unfolding integrable_iff_bounded using nn - apply (simp add: positive_integral_density ) - apply (intro arg_cong2[where f="op ="] refl positive_integral_cong_AE) + apply (simp add: nn_integral_density ) + apply (intro arg_cong2[where f="op ="] refl nn_integral_cong_AE) apply auto done @@ -1547,9 +1547,9 @@ have int: "integrable M (\x. g x * indicator A x)" using g base integrable_density[of "indicator A :: 'a \ real" M g] by simp then have "integral\<^sup>L M (\x. g x * indicator A x) = (\\<^sup>+ x. ereal (g x * indicator A x) \M)" - using g by (subst positive_integral_eq_integral) auto + using g by (subst nn_integral_eq_integral) auto also have "\ = (\\<^sup>+ x. ereal (g x) * indicator A x \M)" - by (intro positive_integral_cong) (auto split: split_indicator) + by (intro nn_integral_cong) (auto split: split_indicator) also have "\ = emeasure (density M g) A" by (rule emeasure_density[symmetric]) auto also have "\ = ereal (measure (density M g) A)" @@ -1607,7 +1607,7 @@ fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes [measurable]: "g \ measurable M N" "f \ borel_measurable N" shows "integrable (distr M N g) f \ integrable M (\x. f (g x))" - unfolding integrable_iff_bounded by (simp_all add: positive_integral_distr) + unfolding integrable_iff_bounded by (simp_all add: nn_integral_distr) lemma integrable_distr: fixes f :: "'a \ 'b::{banach, second_countable_topology}" @@ -1678,7 +1678,7 @@ lemma integrable_count_space: fixes f :: "'a \ 'b::{banach,second_countable_topology}" shows "finite X \ integrable (count_space X) f" - by (auto simp: positive_integral_count_space integrable_iff_bounded) + by (auto simp: nn_integral_count_space integrable_iff_bounded) lemma measure_count_space[simp]: "B \ A \ finite B \ measure (count_space A) B = card B" @@ -1731,15 +1731,15 @@ also have "\ = integral\<^sup>L M (\x. max 0 (f x)) - integral\<^sup>L M (\x. max 0 (- f x))" by (intro integral_diff integrable_max integrable_minus integrable_zero f) also have "integral\<^sup>L M (\x. max 0 (f x)) = real (\\<^sup>+x. max 0 (f x) \M)" - by (subst integral_eq_positive_integral[symmetric]) (auto intro!: integrable_max f) + by (subst integral_eq_nn_integral[symmetric]) (auto intro!: integrable_max f) also have "integral\<^sup>L M (\x. max 0 (- f x)) = real (\\<^sup>+x. max 0 (- f x) \M)" - by (subst integral_eq_positive_integral[symmetric]) (auto intro!: integrable_max f) + by (subst integral_eq_nn_integral[symmetric]) (auto intro!: integrable_max f) also have "(\x. ereal (max 0 (f x))) = (\x. max 0 (ereal (f x)))" by (auto simp: max_def) also have "(\x. ereal (max 0 (- f x))) = (\x. max 0 (- ereal (f x)))" by (auto simp: max_def) finally show ?thesis - unfolding positive_integral_max_0 . + unfolding nn_integral_max_0 . qed lemma real_integrable_def: @@ -1749,12 +1749,12 @@ proof (safe del: notI) assume *: "(\\<^sup>+ x. ereal (norm (f x)) \M) < \" have "(\\<^sup>+ x. ereal (f x) \M) \ (\\<^sup>+ x. ereal (norm (f x)) \M)" - by (intro positive_integral_mono) auto + by (intro nn_integral_mono) auto also note * finally show "(\\<^sup>+ x. ereal (f x) \M) \ \" by simp have "(\\<^sup>+ x. ereal (- f x) \M) \ (\\<^sup>+ x. ereal (norm (f x)) \M)" - by (intro positive_integral_mono) auto + by (intro nn_integral_mono) auto also note * finally show "(\\<^sup>+ x. ereal (- f x) \M) \ \" by simp @@ -1762,11 +1762,11 @@ assume [measurable]: "f \ borel_measurable M" assume fin: "(\\<^sup>+ x. ereal (f x) \M) \ \" "(\\<^sup>+ x. ereal (- f x) \M) \ \" have "(\\<^sup>+ x. norm (f x) \M) = (\\<^sup>+ x. max 0 (ereal (f x)) + max 0 (ereal (- f x)) \M)" - by (intro positive_integral_cong) (auto simp: max_def) + by (intro nn_integral_cong) (auto simp: max_def) also have"\ = (\\<^sup>+ x. max 0 (ereal (f x)) \M) + (\\<^sup>+ x. max 0 (ereal (- f x)) \M)" - by (intro positive_integral_add) auto + by (intro nn_integral_add) auto also have "\ < \" - using fin by (auto simp: positive_integral_max_0) + using fin by (auto simp: nn_integral_max_0) finally show "(\\<^sup>+ x. norm (f x) \M) < \" . qed @@ -1782,8 +1782,8 @@ "(\\<^sup>+x. ereal (-f x)\M) = ereal q" "f \ borel_measurable M" "integral\<^sup>L M f = r - q" using assms unfolding real_integrable_def real_lebesgue_integral_def[OF assms] - using positive_integral_positive[of M "\x. ereal (f x)"] - using positive_integral_positive[of M "\x. ereal (-f x)"] + using nn_integral_nonneg[of M "\x. ereal (f x)"] + using nn_integral_nonneg[of M "\x. ereal (-f x)"] by (cases rule: ereal2_cases[of "(\\<^sup>+x. ereal (-f x)\M)" "(\\<^sup>+x. ereal (f x)\M)"]) auto lemma integral_monotone_convergence_nonneg: @@ -1797,7 +1797,7 @@ and "integral\<^sup>L M u = x" proof - have "(\\<^sup>+ x. ereal (u x) \M) = (SUP n. (\\<^sup>+ x. ereal (f n x) \M))" - proof (subst positive_integral_monotone_convergence_SUP_AE[symmetric]) + proof (subst nn_integral_monotone_convergence_SUP_AE[symmetric]) fix i from mono pos show "AE x in M. ereal (f i x) \ ereal (f (Suc i) x) \ 0 \ ereal (f i x)" by eventually_elim (auto simp: mono_def) @@ -1805,16 +1805,16 @@ using i by auto next show "(\\<^sup>+ x. ereal (u x) \M) = \\<^sup>+ x. (SUP i. ereal (f i x)) \M" - apply (rule positive_integral_cong_AE) + apply (rule nn_integral_cong_AE) using lim mono by eventually_elim (simp add: SUP_eq_LIMSEQ[THEN iffD2]) qed also have "\ = ereal x" - using mono i unfolding positive_integral_eq_integral[OF i pos] + using mono i unfolding nn_integral_eq_integral[OF i pos] by (subst SUP_eq_LIMSEQ) (auto simp: mono_def intro!: integral_mono_AE ilim) finally have "(\\<^sup>+ x. ereal (u x) \M) = ereal x" . moreover have "(\\<^sup>+ x. ereal (- u x) \M) = 0" - proof (subst positive_integral_0_iff_AE) + proof (subst nn_integral_0_iff_AE) show "(\x. ereal (- u x)) \ borel_measurable M" using u by auto from mono pos[of 0] lim show "AE x in M. ereal (- u x) \ 0" @@ -1865,11 +1865,11 @@ shows "(\x. norm (f x) \M) = 0 \ emeasure M {x\space M. f x \ 0} = 0" proof - have "(\\<^sup>+x. norm (f x) \M) = (\x. norm (f x) \M)" - using f by (intro positive_integral_eq_integral integrable_norm) auto + using f by (intro nn_integral_eq_integral integrable_norm) auto then have "(\x. norm (f x) \M) = 0 \ (\\<^sup>+x. norm (f x) \M) = 0" by simp also have "\ \ emeasure M {x\space M. ereal (norm (f x)) \ 0} = 0" - by (intro positive_integral_0_iff) auto + by (intro nn_integral_0_iff) auto finally show ?thesis by simp qed @@ -1917,7 +1917,7 @@ using int by (simp add: integral_0_iff) moreover have "(\\<^sup>+x. indicator A x \M) \ (\\<^sup>+x. indicator {x \ space M. Y x - X x \ 0} x \M)" - using A by (intro positive_integral_mono_AE) auto + using A by (intro nn_integral_mono_AE) auto then have "(emeasure M) A \ (emeasure M) {x \ space M. Y x - X x \ 0}" using int A by (simp add: integrable_def) ultimately have "emeasure M A = 0" @@ -2221,7 +2221,7 @@ by (intro simple_function_borel_measurable) (auto simp: space_pair_measure dest: finite_subset) have "(\\<^sup>+ y. ereal (norm (s i (x, y))) \M) \ (\\<^sup>+ y. 2 * norm (f x y) \M)" - using x s by (intro positive_integral_mono) auto + using x s by (intro nn_integral_mono) auto also have "(\\<^sup>+ y. 2 * norm (f x y) \M) < \" using int_2f by (simp add: integrable_iff_bounded) finally show "(\\<^sup>+ xa. ereal (norm (s i (x, xa))) \M) < \" . @@ -2276,7 +2276,7 @@ have "(\\<^sup>+ x. emeasure M2 (Pair x -` A) \M1) \ \" by simp then have "AE x in M1. emeasure M2 (Pair x -` A) \ \" - by (rule positive_integral_PInf_AE[rotated]) (intro M2.measurable_emeasure_Pair A) + by (rule nn_integral_PInf_AE[rotated]) (intro M2.measurable_emeasure_Pair A) moreover have "\x. x \ space M1 \ Pair x -` A = {y\space M2. (x, y) \ A}" using sets.sets_into_space[OF A] by (auto simp: space_pair_measure) ultimately show ?thesis by auto @@ -2288,11 +2288,11 @@ shows "AE x in M1. integrable M2 (\y. f (x, y))" proof - have "(\\<^sup>+x. (\\<^sup>+y. norm (f (x, y)) \M2) \M1) = (\\<^sup>+x. norm (f x) \(M1 \\<^sub>M M2))" - by (rule M2.positive_integral_fst) simp + by (rule M2.nn_integral_fst) simp also have "(\\<^sup>+x. norm (f x) \(M1 \\<^sub>M M2)) \ \" using f unfolding integrable_iff_bounded by simp finally have "AE x in M1. (\\<^sup>+y. norm (f (x, y)) \M2) \ \" - by (intro positive_integral_PInf_AE M2.borel_measurable_positive_integral ) + by (intro nn_integral_PInf_AE M2.borel_measurable_nn_integral ) (auto simp: measurable_split_conv) with AE_space show ?thesis by eventually_elim @@ -2308,9 +2308,9 @@ show "(\x. \ y. f (x, y) \M2) \ borel_measurable M1" by (rule M2.borel_measurable_lebesgue_integral) simp have "(\\<^sup>+ x. ereal (norm (\ y. f (x, y) \M2)) \M1) \ (\\<^sup>+x. (\\<^sup>+y. norm (f (x, y)) \M2) \M1)" - using AE_integrable_fst'[OF f] by (auto intro!: positive_integral_mono_AE integral_norm_bound_ereal) + using AE_integrable_fst'[OF f] by (auto intro!: nn_integral_mono_AE integral_norm_bound_ereal) also have "(\\<^sup>+x. (\\<^sup>+y. norm (f (x, y)) \M2) \M1) = (\\<^sup>+x. norm (f x) \(M1 \\<^sub>M M2))" - by (rule M2.positive_integral_fst) simp + by (rule M2.nn_integral_fst) simp also have "(\\<^sup>+x. norm (f x) \(M1 \\<^sub>M M2)) < \" using f unfolding integrable_iff_bounded by simp finally show "(\\<^sup>+ x. ereal (norm (\ y. f (x, y) \M2)) \M1) < \" . @@ -2341,18 +2341,18 @@ have "(\\<^sup>+x. ereal (measure M2 {y \ space M2. (x, y) \ A}) \M1) = (\\<^sup>+x. emeasure M2 {y \ space M2. (x, y) \ A} \M1)" using emeasure_pair_measure_finite[OF base] - by (intro positive_integral_cong_AE, eventually_elim) (simp add: emeasure_eq_ereal_measure) + by (intro nn_integral_cong_AE, eventually_elim) (simp add: emeasure_eq_ereal_measure) also have "\ = emeasure (M1 \\<^sub>M M2) A" using sets.sets_into_space[OF A] by (subst M2.emeasure_pair_measure_alt) - (auto intro!: positive_integral_cong arg_cong[where f="emeasure M2"] simp: space_pair_measure) + (auto intro!: nn_integral_cong arg_cong[where f="emeasure M2"] simp: space_pair_measure) finally have *: "(\\<^sup>+x. ereal (measure M2 {y \ space M2. (x, y) \ A}) \M1) = emeasure (M1 \\<^sub>M M2) A" . from base * show "integrable M1 (\x. measure M2 {y \ space M2. (x, y) \ A})" by (simp add: measure_nonneg integrable_iff_bounded) then have "(\x. measure M2 {y \ space M2. (x, y) \ A} \M1) = (\\<^sup>+x. ereal (measure M2 {y \ space M2. (x, y) \ A}) \M1)" - by (rule positive_integral_eq_integral[symmetric]) (simp add: measure_nonneg) + by (rule nn_integral_eq_integral[symmetric]) (simp add: measure_nonneg) also note * finally show "(\x. measure M2 {y \ space M2. (x, y) \ A} \M1) *\<^sub>R c = measure (M1 \\<^sub>M M2) A *\<^sub>R c" using base by (simp add: emeasure_eq_ereal_measure) @@ -2417,9 +2417,9 @@ from s have "norm (\ y. s i (x, y) \M2) \ (\\<^sup>+y. norm (s i (x, y)) \M2)" by (rule integral_norm_bound_ereal) also have "\ \ (\\<^sup>+y. 2 * norm (f (x, y)) \M2)" - using x lim by (auto intro!: positive_integral_mono simp: space_pair_measure) + using x lim by (auto intro!: nn_integral_mono simp: space_pair_measure) also have "\ = (\y. 2 * norm (f (x, y)) \M2)" - using f by (intro positive_integral_eq_integral) auto + using f by (intro nn_integral_eq_integral) auto finally show "norm (\ y. s i (x, y) \M2) \ (\ y. 2 * norm (f (x, y)) \M2)" by simp qed @@ -2530,9 +2530,9 @@ (\\<^sup>+ x. (\i\I. ereal (norm (f i (x i)))) \Pi\<^sub>M I M)" by (simp add: setprod_norm setprod_ereal) also have "\ = (\i\I. \\<^sup>+ x. ereal (norm (f i x)) \M i)" - using assms by (intro product_positive_integral_setprod) auto + using assms by (intro product_nn_integral_setprod) auto also have "\ < \" - using integrable by (simp add: setprod_PInf positive_integral_positive integrable_iff_bounded) + using integrable by (simp add: setprod_PInf nn_integral_nonneg integrable_iff_bounded) finally show "(\\<^sup>+ x. ereal (norm (\i\I. f i (x i))) \Pi\<^sub>M I M) < \" . qed @@ -2568,7 +2568,7 @@ have "f \ borel_measurable M" using assms by (auto simp: measurable_def) with assms show ?thesis - using assms by (auto simp: integrable_iff_bounded positive_integral_subalgebra) + using assms by (auto simp: integrable_iff_bounded nn_integral_subalgebra) qed lemma integral_subalgebra: diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Distributions.thy --- a/src/HOL/Probability/Distributions.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Distributions.thy Mon May 19 14:26:58 2014 +0200 @@ -56,9 +56,9 @@ have "emeasure ?D (space ?D) = (\\<^sup>+ x. ereal (?f x) * indicator {0..} x \lborel)" by (auto simp: emeasure_density exponential_density_def - intro!: positive_integral_cong split: split_indicator) + intro!: nn_integral_cong split: split_indicator) also have "\ = ereal (0 - ?F 0)" - proof (rule positive_integral_FTC_atLeast) + proof (rule nn_integral_FTC_atLeast) have "((\x. exp (l * x)) ---> 0) at_bot" by (rule filterlim_compose[OF exp_at_bot filterlim_tendsto_pos_mult_at_bot[of _ l]]) (simp_all add: tendsto_const filterlim_ident) @@ -72,10 +72,10 @@ assume "0 \ a" have "emeasure ?D {..a} = (\\<^sup>+x. ereal (?f x) * indicator {0..a} x \lborel)" - by (auto simp add: emeasure_density intro!: positive_integral_cong split: split_indicator) + by (auto simp add: emeasure_density intro!: nn_integral_cong split: split_indicator) (auto simp: exponential_density_def) also have "(\\<^sup>+x. ereal (?f x) * indicator {0..a} x \lborel) = ereal (?F a) - ereal (?F 0)" - using `0 \ a` deriv by (intro positive_integral_FTC_atLeastAtMost) auto + using `0 \ a` deriv by (intro nn_integral_FTC_atLeastAtMost) auto also have "\ = 1 - exp (- a * l)" by simp finally show "emeasure ?D {.. a} = 1 - exp (- a * l)" . @@ -241,9 +241,9 @@ by simp also have "\ = (\\<^sup>+ x. (1 / emeasure M' A) * indicator (A \ B) x \M')" using A B - by (intro positive_integral_cmult_indicator[symmetric]) (auto intro!: zero_le_divide_ereal) + by (intro nn_integral_cmult_indicator[symmetric]) (auto intro!: zero_le_divide_ereal) also have "\ = (\\<^sup>+ x. ?f x * indicator B x \M')" - by (rule positive_integral_cong) (auto split: split_indicator) + by (rule nn_integral_cong) (auto split: split_indicator) finally show "emeasure (distr M M' X) B = emeasure (density M' ?f) B" using A B X by (auto simp add: emeasure_distr emeasure_density) qed simp @@ -271,10 +271,10 @@ have "(\\<^sup>+ x. ereal (indicator A x / measure lborel A * indicator {..a} x) \lborel) = (\\<^sup>+ x. ereal (1 / measure lborel A) * indicator (A \ {..a}) x \lborel)" - by (auto intro!: positive_integral_cong split: split_indicator) + by (auto intro!: nn_integral_cong split: split_indicator) also have "\ = ereal (1 / measure lborel A) * emeasure lborel (A \ {..a})" using `A \ sets borel` - by (intro positive_integral_cmult_indicator) (auto simp: measure_nonneg) + by (intro nn_integral_cmult_indicator) (auto simp: measure_nonneg) also have "\ = ereal (measure lborel (A \ {..a}) / r)" unfolding emeasure_eq_ereal_measure[OF fin] using A by (simp add: measure_def) finally show "(\\<^sup>+ x. ereal (indicator A x / measure lborel A * indicator {..a} x) \lborel) = @@ -331,10 +331,10 @@ using distributed_borel_measurable[OF D] `a \ t` `t \ b` unfolding distributed_distr_eq_density[OF D] by (subst emeasure_density) - (auto intro!: positive_integral_cong simp: measure_def split: split_indicator) + (auto intro!: nn_integral_cong simp: measure_def split: split_indicator) also have "\ = ereal (1 / (b - a)) * (t - a)" using `a \ t` `t \ b` - by (subst positive_integral_cmult_indicator) auto + by (subst nn_integral_cmult_indicator) auto finally show ?thesis by (simp add: measure_def) qed diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Finite_Product_Measure.thy --- a/src/HOL/Probability/Finite_Product_Measure.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Finite_Product_Measure.thy Mon May 19 14:26:58 2014 +0200 @@ -688,15 +688,15 @@ "(\i. i \ I \ A i \ sets (M i)) \ emeasure (Pi\<^sub>M I M) (Pi\<^sub>E I A) = (\i\I. emeasure (M i) (A i))" using emeasure_PiM[OF finite_index] by auto -lemma (in product_sigma_finite) positive_integral_empty: +lemma (in product_sigma_finite) nn_integral_empty: assumes pos: "0 \ f (\k. undefined)" - shows "integral\<^sup>P (Pi\<^sub>M {} M) f = f (\k. undefined)" + shows "integral\<^sup>N (Pi\<^sub>M {} M) f = f (\k. undefined)" proof - interpret finite_product_sigma_finite M "{}" by default (fact finite.emptyI) have "\A. emeasure (Pi\<^sub>M {} M) (Pi\<^sub>E {} A) = 1" using assms by (subst measure_times) auto then show ?thesis - unfolding positive_integral_def simple_function_def simple_integral_def[abs_def] + unfolding nn_integral_def simple_function_def simple_integral_def[abs_def] proof (simp add: space_PiM_empty sets_PiM_empty, intro antisym) show "f (\k. undefined) \ (SUP f:{g. g \ max 0 \ f}. f (\k. undefined))" by (intro SUP_upper) (auto simp: le_fun_def split: split_max) @@ -768,10 +768,10 @@ qed qed -lemma (in product_sigma_finite) product_positive_integral_fold: +lemma (in product_sigma_finite) product_nn_integral_fold: assumes IJ: "I \ J = {}" "finite I" "finite J" and f: "f \ borel_measurable (Pi\<^sub>M (I \ J) M)" - shows "integral\<^sup>P (Pi\<^sub>M (I \ J) M) f = + shows "integral\<^sup>N (Pi\<^sub>M (I \ J) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (merge I J (x, y)) \(Pi\<^sub>M J M)) \(Pi\<^sub>M I M))" proof - interpret I: finite_product_sigma_finite M I by default fact @@ -781,8 +781,8 @@ using measurable_comp[OF measurable_merge f] by (simp add: comp_def) show ?thesis apply (subst distr_merge[OF IJ, symmetric]) - apply (subst positive_integral_distr[OF measurable_merge f]) - apply (subst J.positive_integral_fst[symmetric, OF P_borel]) + apply (subst nn_integral_distr[OF measurable_merge f]) + apply (subst J.nn_integral_fst[symmetric, OF P_borel]) apply simp done qed @@ -799,30 +799,30 @@ by (simp add: emeasure_distr measurable_component_singleton) qed simp -lemma (in product_sigma_finite) product_positive_integral_singleton: +lemma (in product_sigma_finite) product_nn_integral_singleton: assumes f: "f \ borel_measurable (M i)" - shows "integral\<^sup>P (Pi\<^sub>M {i} M) (\x. f (x i)) = integral\<^sup>P (M i) f" + shows "integral\<^sup>N (Pi\<^sub>M {i} M) (\x. f (x i)) = integral\<^sup>N (M i) f" proof - interpret I: finite_product_sigma_finite M "{i}" by default simp from f show ?thesis apply (subst distr_singleton[symmetric]) - apply (subst positive_integral_distr[OF measurable_component_singleton]) + apply (subst nn_integral_distr[OF measurable_component_singleton]) apply simp_all done qed -lemma (in product_sigma_finite) product_positive_integral_insert: +lemma (in product_sigma_finite) product_nn_integral_insert: assumes I[simp]: "finite I" "i \ I" and f: "f \ borel_measurable (Pi\<^sub>M (insert i I) M)" - shows "integral\<^sup>P (Pi\<^sub>M (insert i I) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (x(i := y)) \(M i)) \(Pi\<^sub>M I M))" + shows "integral\<^sup>N (Pi\<^sub>M (insert i I) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (x(i := y)) \(M i)) \(Pi\<^sub>M I M))" proof - interpret I: finite_product_sigma_finite M I by default auto interpret i: finite_product_sigma_finite M "{i}" by default auto have IJ: "I \ {i} = {}" and insert: "I \ {i} = insert i I" using f by auto show ?thesis - unfolding product_positive_integral_fold[OF IJ, unfolded insert, OF I(1) i.finite_index f] - proof (rule positive_integral_cong, subst product_positive_integral_singleton[symmetric]) + unfolding product_nn_integral_fold[OF IJ, unfolded insert, OF I(1) i.finite_index f] + proof (rule nn_integral_cong, subst product_nn_integral_singleton[symmetric]) fix x assume x: "x \ space (Pi\<^sub>M I M)" let ?f = "\y. f (x(i := y))" show "?f \ borel_measurable (M i)" @@ -830,16 +830,16 @@ unfolding comp_def . show "(\\<^sup>+ y. f (merge I {i} (x, y)) \Pi\<^sub>M {i} M) = (\\<^sup>+ y. f (x(i := y i)) \Pi\<^sub>M {i} M)" using x - by (auto intro!: positive_integral_cong arg_cong[where f=f] + by (auto intro!: nn_integral_cong arg_cong[where f=f] simp add: space_PiM extensional_def PiE_def) qed qed -lemma (in product_sigma_finite) product_positive_integral_setprod: +lemma (in product_sigma_finite) product_nn_integral_setprod: fixes f :: "'i \ 'a \ ereal" assumes "finite I" and borel: "\i. i \ I \ f i \ borel_measurable (M i)" and pos: "\i x. i \ I \ 0 \ f i x" - shows "(\\<^sup>+ x. (\i\I. f i (x i)) \Pi\<^sub>M I M) = (\i\I. integral\<^sup>P (M i) (f i))" + shows "(\\<^sup>+ x. (\i\I. f i (x i)) \Pi\<^sub>M I M) = (\i\I. integral\<^sup>N (M i) (f i))" using assms proof induct case (insert i I) note `finite I`[intro, simp] @@ -852,10 +852,10 @@ measurable_comp[OF measurable_component_singleton, unfolded comp_def]) auto then show ?case - apply (simp add: product_positive_integral_insert[OF insert(1,2) prod]) - apply (simp add: insert(2-) * pos borel setprod_ereal_pos positive_integral_multc) - apply (subst positive_integral_cmult) - apply (auto simp add: pos borel insert(2-) setprod_ereal_pos positive_integral_positive) + apply (simp add: product_nn_integral_insert[OF insert(1,2) prod]) + apply (simp add: insert(2-) * pos borel setprod_ereal_pos nn_integral_multc) + apply (subst nn_integral_cmult) + apply (auto simp add: pos borel insert(2-) setprod_ereal_pos nn_integral_nonneg) done qed (simp add: space_PiM) @@ -871,9 +871,9 @@ then have "emeasure ?P A = (\\<^sup>+x. indicator A x \?P)" by simp also have "\ = (\\<^sup>+x. indicator ((\x. \i\{i}. x) -` A \ space (M i)) (x i) \PiM {i} M)" - by (intro positive_integral_cong) (auto simp: space_PiM indicator_def PiE_def eq) + by (intro nn_integral_cong) (auto simp: space_PiM indicator_def PiE_def eq) also have "\ = emeasure ?D A" - using A by (simp add: product_positive_integral_singleton emeasure_distr) + using A by (simp add: product_nn_integral_singleton emeasure_distr) finally show "emeasure (Pi\<^sub>M {i} M) A = emeasure ?D A" . qed simp @@ -894,7 +894,7 @@ apply (subst distr_merge[symmetric, OF IJ]) apply (subst emeasure_distr[OF measurable_merge A]) apply (subst J.emeasure_pair_measure_alt[OF merge]) - apply (auto intro!: positive_integral_cong arg_cong2[where f=emeasure] simp: space_pair_measure) + apply (auto intro!: nn_integral_cong arg_cong2[where f=emeasure] simp: space_pair_measure) done show ?B diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Infinite_Product_Measure.thy --- a/src/HOL/Probability/Infinite_Product_Measure.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy Mon May 19 14:26:58 2014 +0200 @@ -59,7 +59,7 @@ using K J by (subst emeasure_fold_integral) auto also have "\ = (\\<^sup>+ y. \G ((\x. merge J (I - J) (y, x)) -` Z \ space (Pi\<^sub>M I M)) \Pi\<^sub>M J M)" (is "_ = (\\<^sup>+x. \G (?MZ x) \Pi\<^sub>M J M)") - proof (intro positive_integral_cong) + proof (intro nn_integral_cong) fix x assume x: "x \ space (Pi\<^sub>M J M)" with K merge_in_G(2)[OF this] show "emeasure (Pi\<^sub>M (K - J) M) (?M x) = \G (?MZ x)" @@ -141,7 +141,7 @@ have "?a / 2^k \ \G (Z n)" using Z by auto also have "\ \ (\\<^sup>+ x. indicator (?Q n) x + ?a / 2^(k+1) \Pi\<^sub>M J' M)" unfolding fold(2)[OF J' `Z n \ ?G`] - proof (intro positive_integral_mono) + proof (intro nn_integral_mono) fix x assume x: "x \ space (Pi\<^sub>M J' M)" then have "?q n x \ 1 + 0" using J' Z fold(3) Z_sets by auto @@ -153,7 +153,7 @@ qed also have "\ = emeasure (Pi\<^sub>M J' M) (?Q n) + ?a / 2^(k+1)" using `0 \ ?a` Q_sets J'.emeasure_space_1 - by (subst positive_integral_add) auto + by (subst nn_integral_add) auto finally show "?a / 2^(k+1) \ emeasure (Pi\<^sub>M J' M) (?Q n)" using `?a \ 1` by (cases rule: ereal2_cases[of ?a "emeasure (Pi\<^sub>M J' M) (?Q n)"]) (auto simp: field_simps) diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Information.thy --- a/src/HOL/Probability/Information.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Information.thy Mon May 19 14:26:58 2014 +0200 @@ -143,10 +143,10 @@ using D by auto have D_neg: "(\\<^sup>+ x. ereal (- D x) \M) = 0" - using D by (subst positive_integral_0_iff_AE) auto + using D by (subst nn_integral_0_iff_AE) auto have "(\\<^sup>+ x. ereal (D x) \M) = emeasure (density M D) (space M)" - using D by (simp add: emeasure_density cong: positive_integral_cong) + using D by (simp add: emeasure_density cong: nn_integral_cong) then have D_pos: "(\\<^sup>+ x. ereal (D x) \M) = 1" using N.emeasure_space_1 by simp @@ -178,11 +178,11 @@ have "emeasure M {x\space M. D x = 1} = (\\<^sup>+ x. indicator {x\space M. D x = 1} x \M)" using D(1) by auto also have "\ = (\\<^sup>+ x. ereal (D x) \M)" - using disj by (auto intro!: positive_integral_cong_AE simp: indicator_def one_ereal_def) + using disj by (auto intro!: nn_integral_cong_AE simp: indicator_def one_ereal_def) finally have "AE x in M. D x = 1" using D D_pos by (intro AE_I_eq_1) auto then have "(\\<^sup>+x. indicator A x\M) = (\\<^sup>+x. ereal (D x) * indicator A x\M)" - by (intro positive_integral_cong_AE) (auto simp: one_ereal_def[symmetric]) + by (intro nn_integral_cong_AE) (auto simp: one_ereal_def[symmetric]) also have "\ = density M D A" using `A \ sets M` D by (simp add: emeasure_density) finally show False using `A \ sets M` `emeasure (density M D) A \ emeasure M A` by simp @@ -844,9 +844,9 @@ from X.emeasure_space_1 have "(\\<^sup>+x. Px x \MX) = 1" unfolding distributed_distr_eq_density[OF X] using Px by (subst (asm) emeasure_density) - (auto simp: borel_measurable_ereal_iff intro!: integral_cong cong: positive_integral_cong) + (auto simp: borel_measurable_ereal_iff intro!: integral_cong cong: nn_integral_cong) ultimately show False - by (simp add: positive_integral_cong_AE) + by (simp add: nn_integral_cong_AE) qed lemma (in information_space) entropy_le: @@ -876,11 +876,11 @@ have [simp]: "\x. x \ space MX \ ereal (if Px x = 0 then 0 else 1) = indicator {x \ space MX. Px x \ 0} x" by (auto simp: one_ereal_def) have "(\\<^sup>+ x. max 0 (ereal (- (if Px x = 0 then 0 else 1))) \MX) = (\\<^sup>+ x. 0 \MX)" - by (intro positive_integral_cong) (auto split: split_max) + by (intro nn_integral_cong) (auto split: split_max) then show "integrable (distr M MX X) (\x. 1 / Px x)" unfolding distributed_distr_eq_density[OF X] using Px - by (auto simp: positive_integral_density real_integrable_def borel_measurable_ereal_iff fin positive_integral_max_0 - cong: positive_integral_cong) + by (auto simp: nn_integral_density real_integrable_def borel_measurable_ereal_iff fin nn_integral_max_0 + cong: nn_integral_cong) have "integrable MX (\x. Px x * log b (1 / Px x)) = integrable MX (\x. - Px x * log b (Px x))" using Px @@ -1084,37 +1084,37 @@ by (intro TP.AE_pair_measure) (auto dest: distributed_real_AE) have "(\\<^sup>+ x. ?f x \?P) \ (\\<^sup>+ (x, y, z). Pxz (x, z) * (Pyz (y, z) / Pz z) \(S \\<^sub>M T \\<^sub>M P))" - apply (subst positive_integral_density) + apply (subst nn_integral_density) apply simp apply (rule distributed_AE[OF Pxyz]) apply auto [] - apply (rule positive_integral_mono_AE) + apply (rule nn_integral_mono_AE) using ae5 ae6 ae7 ae8 apply eventually_elim apply auto done also have "\ = (\\<^sup>+(y, z). \\<^sup>+ x. ereal (Pxz (x, z)) * ereal (Pyz (y, z) / Pz z) \S \T \\<^sub>M P)" - by (subst STP.positive_integral_snd[symmetric]) (auto simp add: split_beta') + by (subst STP.nn_integral_snd[symmetric]) (auto simp add: split_beta') also have "\ = (\\<^sup>+x. ereal (Pyz x) * 1 \T \\<^sub>M P)" - apply (rule positive_integral_cong_AE) + apply (rule nn_integral_cong_AE) using aeX1 aeX2 aeX3 distributed_AE[OF Pyz] AE_space apply eventually_elim proof (case_tac x, simp del: times_ereal.simps add: space_pair_measure) fix a b assume "Pz b = 0 \ Pyz (a, b) = 0" "0 \ Pz b" "a \ space T \ b \ space P" "(\\<^sup>+ x. ereal (Pxz (x, b)) \S) = ereal (Pz b)" "0 \ Pyz (a, b)" then show "(\\<^sup>+ x. ereal (Pxz (x, b)) * ereal (Pyz (a, b) / Pz b) \S) = ereal (Pyz (a, b))" - by (subst positive_integral_multc) + by (subst nn_integral_multc) (auto split: prod.split) qed also have "\ = 1" using Q.emeasure_space_1 distributed_AE[OF Pyz] distributed_distr_eq_density[OF Pyz] - by (subst positive_integral_density[symmetric]) auto + by (subst nn_integral_density[symmetric]) auto finally have le1: "(\\<^sup>+ x. ?f x \?P) \ 1" . also have "\ < \" by simp finally have fin: "(\\<^sup>+ x. ?f x \?P) \ \" by simp have pos: "(\\<^sup>+x. ?f x \?P) \ 0" - apply (subst positive_integral_density) + apply (subst nn_integral_density) apply simp apply (rule distributed_AE[OF Pxyz]) apply auto [] @@ -1123,18 +1123,18 @@ let ?g = "\x. ereal (if Pxyz x = 0 then 0 else Pxz (fst x, snd (snd x)) * Pyz (snd x) / Pz (snd (snd x)))" assume "(\\<^sup>+x. ?g x \(S \\<^sub>M T \\<^sub>M P)) = 0" then have "AE x in S \\<^sub>M T \\<^sub>M P. ?g x \ 0" - by (intro positive_integral_0_iff_AE[THEN iffD1]) auto + by (intro nn_integral_0_iff_AE[THEN iffD1]) auto then have "AE x in S \\<^sub>M T \\<^sub>M P. Pxyz x = 0" using ae1 ae2 ae3 ae4 ae5 ae6 ae7 ae8 Pxyz[THEN distributed_real_AE] by eventually_elim (auto split: split_if_asm simp: mult_le_0_iff divide_le_0_iff) then have "(\\<^sup>+ x. ereal (Pxyz x) \S \\<^sub>M T \\<^sub>M P) = 0" - by (subst positive_integral_cong_AE[of _ "\x. 0"]) auto + by (subst nn_integral_cong_AE[of _ "\x. 0"]) auto with P.emeasure_space_1 show False - by (subst (asm) emeasure_density) (auto cong: positive_integral_cong) + by (subst (asm) emeasure_density) (auto cong: nn_integral_cong) qed have neg: "(\\<^sup>+ x. - ?f x \?P) = 0" - apply (rule positive_integral_0_iff_AE[THEN iffD2]) + apply (rule nn_integral_0_iff_AE[THEN iffD2]) apply simp apply (subst AE_density) apply simp @@ -1160,14 +1160,14 @@ by simp qed simp then have "(\\<^sup>+ x. ?f x \?P) = (\x. ?f x \?P)" - apply (rule positive_integral_eq_integral) + apply (rule nn_integral_eq_integral) apply (subst AE_density) apply simp using ae5 ae6 ae7 ae8 apply eventually_elim apply auto done - with positive_integral_positive[of ?P ?f] pos le1 + with nn_integral_nonneg[of ?P ?f] pos le1 show "0 < (\x. ?f x \?P)" "(\x. ?f x \?P) \ 1" by (simp_all add: one_ereal_def) qed @@ -1341,36 +1341,36 @@ using Pz distributed_marginal_eq_joint2[OF P S Pz Pxz] by (intro TP.AE_pair_measure) (auto dest: distributed_real_AE) have "(\\<^sup>+ x. ?f x \?P) \ (\\<^sup>+ (x, y, z). Pxz (x, z) * (Pyz (y, z) / Pz z) \(S \\<^sub>M T \\<^sub>M P))" - apply (subst positive_integral_density) + apply (subst nn_integral_density) apply (rule distributed_borel_measurable[OF Pxyz]) apply (rule distributed_AE[OF Pxyz]) apply simp - apply (rule positive_integral_mono_AE) + apply (rule nn_integral_mono_AE) using ae5 ae6 ae7 ae8 apply eventually_elim apply auto done also have "\ = (\\<^sup>+(y, z). \\<^sup>+ x. ereal (Pxz (x, z)) * ereal (Pyz (y, z) / Pz z) \S \T \\<^sub>M P)" - by (subst STP.positive_integral_snd[symmetric]) (auto simp add: split_beta') + by (subst STP.nn_integral_snd[symmetric]) (auto simp add: split_beta') also have "\ = (\\<^sup>+x. ereal (Pyz x) * 1 \T \\<^sub>M P)" - apply (rule positive_integral_cong_AE) + apply (rule nn_integral_cong_AE) using aeX1 aeX2 aeX3 distributed_AE[OF Pyz] AE_space apply eventually_elim proof (case_tac x, simp del: times_ereal.simps add: space_pair_measure) fix a b assume "Pz b = 0 \ Pyz (a, b) = 0" "0 \ Pz b" "a \ space T \ b \ space P" "(\\<^sup>+ x. ereal (Pxz (x, b)) \S) = ereal (Pz b)" "0 \ Pyz (a, b)" then show "(\\<^sup>+ x. ereal (Pxz (x, b)) * ereal (Pyz (a, b) / Pz b) \S) = ereal (Pyz (a, b))" - by (subst positive_integral_multc) auto + by (subst nn_integral_multc) auto qed also have "\ = 1" using Q.emeasure_space_1 distributed_AE[OF Pyz] distributed_distr_eq_density[OF Pyz] - by (subst positive_integral_density[symmetric]) auto + by (subst nn_integral_density[symmetric]) auto finally have le1: "(\\<^sup>+ x. ?f x \?P) \ 1" . also have "\ < \" by simp finally have fin: "(\\<^sup>+ x. ?f x \?P) \ \" by simp have pos: "(\\<^sup>+ x. ?f x \?P) \ 0" - apply (subst positive_integral_density) + apply (subst nn_integral_density) apply simp apply (rule distributed_AE[OF Pxyz]) apply simp @@ -1379,18 +1379,18 @@ let ?g = "\x. ereal (if Pxyz x = 0 then 0 else Pxz (fst x, snd (snd x)) * Pyz (snd x) / Pz (snd (snd x)))" assume "(\\<^sup>+ x. ?g x \(S \\<^sub>M T \\<^sub>M P)) = 0" then have "AE x in S \\<^sub>M T \\<^sub>M P. ?g x \ 0" - by (intro positive_integral_0_iff_AE[THEN iffD1]) (auto intro!: borel_measurable_ereal measurable_If) + by (intro nn_integral_0_iff_AE[THEN iffD1]) (auto intro!: borel_measurable_ereal measurable_If) then have "AE x in S \\<^sub>M T \\<^sub>M P. Pxyz x = 0" using ae1 ae2 ae3 ae4 ae5 ae6 ae7 ae8 Pxyz[THEN distributed_real_AE] by eventually_elim (auto split: split_if_asm simp: mult_le_0_iff divide_le_0_iff) then have "(\\<^sup>+ x. ereal (Pxyz x) \S \\<^sub>M T \\<^sub>M P) = 0" - by (subst positive_integral_cong_AE[of _ "\x. 0"]) auto + by (subst nn_integral_cong_AE[of _ "\x. 0"]) auto with P.emeasure_space_1 show False - by (subst (asm) emeasure_density) (auto cong: positive_integral_cong) + by (subst (asm) emeasure_density) (auto cong: nn_integral_cong) qed have neg: "(\\<^sup>+ x. - ?f x \?P) = 0" - apply (rule positive_integral_0_iff_AE[THEN iffD2]) + apply (rule nn_integral_0_iff_AE[THEN iffD2]) apply (auto simp: split_beta') [] apply (subst AE_density) apply (auto simp: split_beta') [] @@ -1416,14 +1416,14 @@ by simp qed simp then have "(\\<^sup>+ x. ?f x \?P) = (\x. ?f x \?P)" - apply (rule positive_integral_eq_integral) + apply (rule nn_integral_eq_integral) apply (subst AE_density) apply simp using ae5 ae6 ae7 ae8 apply eventually_elim apply auto done - with positive_integral_positive[of ?P ?f] pos le1 + with nn_integral_nonneg[of ?P ?f] pos le1 show "0 < (\x. ?f x \?P)" "(\x. ?f x \?P) \ 1" by (simp_all add: one_ereal_def) qed diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Lebesgue_Measure.thy --- a/src/HOL/Probability/Lebesgue_Measure.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Lebesgue_Measure.thy Mon May 19 14:26:58 2014 +0200 @@ -544,7 +544,7 @@ by (auto simp: field_simps) with `0 < c` show ?thesis by (cases "a \ b") - (auto simp: field_simps emeasure_density positive_integral_distr positive_integral_cmult + (auto simp: field_simps emeasure_density nn_integral_distr nn_integral_cmult borel_measurable_indicator' emeasure_distr) next assume "\ 0 < c" with `c \ 0` have "c < 0" by auto @@ -552,23 +552,23 @@ by (auto simp: field_simps) with `c < 0` show ?thesis by (cases "a \ b") - (auto simp: field_simps emeasure_density positive_integral_distr - positive_integral_cmult borel_measurable_indicator' emeasure_distr) + (auto simp: field_simps emeasure_density nn_integral_distr + nn_integral_cmult borel_measurable_indicator' emeasure_distr) qed qed simp -lemma positive_integral_real_affine: +lemma nn_integral_real_affine: fixes c :: real assumes [measurable]: "f \ borel_measurable borel" and c: "c \ 0" shows "(\\<^sup>+x. f x \lborel) = \c\ * (\\<^sup>+x. f (t + c * x) \lborel)" by (subst lborel_real_affine[OF c, of t]) - (simp add: positive_integral_density positive_integral_distr positive_integral_cmult) + (simp add: nn_integral_density nn_integral_distr nn_integral_cmult) lemma lborel_integrable_real_affine: fixes f :: "real \ _ :: {banach, second_countable_topology}" assumes f: "integrable lborel f" shows "c \ 0 \ integrable lborel (\x. f (t + c * x))" using f f[THEN borel_measurable_integrable] unfolding integrable_iff_bounded - by (subst (asm) positive_integral_real_affine[where c=c and t=t]) auto + by (subst (asm) nn_integral_real_affine[where c=c and t=t]) auto lemma lborel_integrable_real_affine_iff: fixes f :: "real \ 'a :: {banach, second_countable_topology}" @@ -638,7 +638,7 @@ by simp qed -lemma positive_integral_has_integral: +lemma nn_integral_has_integral: fixes f::"'a::ordered_euclidean_space \ real" assumes f: "f \ borel_measurable lebesgue" "\x. 0 \ f x" "(\\<^sup>+x. f x \lebesgue) = ereal r" shows "(f has_integral r) UNIV" @@ -648,7 +648,7 @@ next case (mult g c) then have "ereal c * (\\<^sup>+ x. g x \lebesgue) = ereal r" - by (subst positive_integral_cmult[symmetric]) auto + by (subst nn_integral_cmult[symmetric]) auto then obtain r' where "(c = 0 \ r = 0) \ ((\\<^sup>+ x. ereal (g x) \lebesgue) = ereal r' \ r = c * r')" by (cases "\\<^sup>+ x. ereal (g x) \lebesgue") (auto split: split_if_asm) with mult show ?case @@ -657,7 +657,7 @@ case (add g h) moreover then have "(\\<^sup>+ x. h x + g x \lebesgue) = (\\<^sup>+ x. h x \lebesgue) + (\\<^sup>+ x. g x \lebesgue)" - unfolding plus_ereal.simps[symmetric] by (subst positive_integral_add) auto + unfolding plus_ereal.simps[symmetric] by (subst nn_integral_add) auto with add obtain a b where "(\\<^sup>+ x. h x \lebesgue) = ereal a" "(\\<^sup>+ x. g x \lebesgue) = ereal b" "r = a + b" by (cases "\\<^sup>+ x. h x \lebesgue" "\\<^sup>+ x. g x \lebesgue" rule: ereal2_cases) auto ultimately show ?case @@ -677,11 +677,11 @@ { fix i have "(\\<^sup>+x. ereal (U i x) \lebesgue) \ (\\<^sup>+x. ereal (f x) \lebesgue)" - using U_le_f by (intro positive_integral_mono) simp + using U_le_f by (intro nn_integral_mono) simp then obtain p where "(\\<^sup>+x. U i x \lebesgue) = ereal p" "p \ r" using seq(6) by (cases "\\<^sup>+x. U i x \lebesgue") auto moreover then have "0 \ p" - by (metis ereal_less_eq(5) positive_integral_positive) + by (metis ereal_less_eq(5) nn_integral_nonneg) moreover note seq ultimately have "\p. (\\<^sup>+x. U i x \lebesgue) = ereal p \ 0 \ p \ p \ r \ (U i has_integral p) UNIV" by auto } @@ -701,7 +701,7 @@ using seq by auto qed moreover have "(\i. (\\<^sup>+x. U i x \lebesgue)) ----> (\\<^sup>+x. f x \lebesgue)" - using seq U_le_f by (intro positive_integral_dominated_convergence[where w=f]) auto + using seq U_le_f by (intro nn_integral_dominated_convergence[where w=f]) auto ultimately have "integral UNIV f = r" by (auto simp add: int_eq p seq intro: LIMSEQ_unique) with * show ?case @@ -712,9 +712,9 @@ fixes f::"'a::ordered_euclidean_space \ real" assumes f: "integrable lebesgue f" "\x. 0 \ f x" shows "(f has_integral integral\<^sup>L lebesgue f) UNIV" -proof (rule positive_integral_has_integral) +proof (rule nn_integral_has_integral) show "(\\<^sup>+ x. ereal (f x) \lebesgue) = ereal (integral\<^sup>L lebesgue f)" - using f by (intro positive_integral_eq_integral) auto + using f by (intro nn_integral_eq_integral) auto qed (insert f, auto) lemma has_integral_lebesgue_integral_lebesgue: @@ -744,13 +744,13 @@ qed qed -lemma lebesgue_positive_integral_eq_borel: +lemma lebesgue_nn_integral_eq_borel: assumes f: "f \ borel_measurable borel" - shows "integral\<^sup>P lebesgue f = integral\<^sup>P lborel f" + shows "integral\<^sup>N lebesgue f = integral\<^sup>N lborel f" proof - - from f have "integral\<^sup>P lebesgue (\x. max 0 (f x)) = integral\<^sup>P lborel (\x. max 0 (f x))" - by (auto intro!: positive_integral_subalgebra[symmetric]) - then show ?thesis unfolding positive_integral_max_0 . + from f have "integral\<^sup>N lebesgue (\x. max 0 (f x)) = integral\<^sup>N lborel (\x. max 0 (f x))" + by (auto intro!: nn_integral_subalgebra[symmetric]) + then show ?thesis unfolding nn_integral_max_0 . qed lemma lebesgue_integral_eq_borel: @@ -777,29 +777,29 @@ unfolding lebesgue_integral_eq_borel[OF borel] by simp qed -lemma positive_integral_bound_simple_function: +lemma nn_integral_bound_simple_function: assumes bnd: "\x. x \ space M \ 0 \ f x" "\x. x \ space M \ f x < \" assumes f[measurable]: "simple_function M f" assumes supp: "emeasure M {x\space M. f x \ 0} < \" - shows "positive_integral M f < \" + shows "nn_integral M f < \" proof cases assume "space M = {}" - then have "positive_integral M f = (\\<^sup>+x. 0 \M)" - by (intro positive_integral_cong) auto + then have "nn_integral M f = (\\<^sup>+x. 0 \M)" + by (intro nn_integral_cong) auto then show ?thesis by simp next assume "space M \ {}" with simple_functionD(1)[OF f] bnd have bnd: "0 \ Max (f`space M) \ Max (f`space M) < \" by (subst Max_less_iff) (auto simp: Max_ge_iff) - have "positive_integral M f \ (\\<^sup>+x. Max (f`space M) * indicator {x\space M. f x \ 0} x \M)" - proof (rule positive_integral_mono) + have "nn_integral M f \ (\\<^sup>+x. Max (f`space M) * indicator {x\space M. f x \ 0} x \M)" + proof (rule nn_integral_mono) fix x assume "x \ space M" with f show "f x \ Max (f ` space M) * indicator {x \ space M. f x \ 0} x" by (auto split: split_indicator intro!: Max_ge simple_functionD) qed also have "\ < \" - using bnd supp by (subst positive_integral_cmult) auto + using bnd supp by (subst nn_integral_cmult) auto finally show ?thesis . qed @@ -814,10 +814,10 @@ from f_borel have "(\x. ereal (f x)) \ borel_measurable lebesgue" by auto from borel_measurable_implies_simple_function_sequence'[OF this] guess F . note F = this - have "(\\<^sup>+ x. ereal (f x) \lebesgue) = (SUP i. integral\<^sup>P lebesgue (F i))" + have "(\\<^sup>+ x. ereal (f x) \lebesgue) = (SUP i. integral\<^sup>N lebesgue (F i))" using F - by (subst positive_integral_monotone_convergence_SUP[symmetric]) - (simp_all add: positive_integral_max_0 borel_measurable_simple_function) + by (subst nn_integral_monotone_convergence_SUP[symmetric]) + (simp_all add: nn_integral_max_0 borel_measurable_simple_function) also have "\ \ ereal I" proof (rule SUP_least) fix i :: nat @@ -873,7 +873,7 @@ unfolding integrable_iff_bounded proof have "(\\<^sup>+x. F i x \lebesgue) < \" - proof (rule positive_integral_bound_simple_function) + proof (rule nn_integral_bound_simple_function) fix x::'a assume "x \ space lebesgue" then show "0 \ F i x" "F i x < \" using F by (auto simp: image_iff eq_commute) next @@ -890,9 +890,9 @@ by (rule has_integral_lebesgue_integral_lebesgue) from this I have "integral\<^sup>L lebesgue (\x. real (F i x)) \ I" by (rule has_integral_le) (intro ballI F_bound) - moreover have "integral\<^sup>P lebesgue (F i) = integral\<^sup>L lebesgue (\x. real (F i x))" - using int F by (subst positive_integral_eq_integral[symmetric]) (auto simp: F_eq2[symmetric] real_of_ereal_pos) - ultimately show "integral\<^sup>P lebesgue (F i) \ ereal I" + moreover have "integral\<^sup>N lebesgue (F i) = integral\<^sup>L lebesgue (\x. real (F i x))" + using int F by (subst nn_integral_eq_integral[symmetric]) (auto simp: F_eq2[symmetric] real_of_ereal_pos) + ultimately show "integral\<^sup>N lebesgue (F i) \ ereal I" by simp qed finally show "integrable lebesgue f" @@ -1003,8 +1003,8 @@ lemma borel_fubini_positiv_integral: fixes f :: "'a::ordered_euclidean_space \ ereal" assumes f: "f \ borel_measurable borel" - shows "integral\<^sup>P lborel f = \\<^sup>+x. f (p2e x) \(\\<^sub>M (i::'a)\Basis. lborel)" - by (subst lborel_eq_lborel_space) (simp add: positive_integral_distr measurable_p2e f) + shows "integral\<^sup>N lborel f = \\<^sup>+x. f (p2e x) \(\\<^sub>M (i::'a)\Basis. lborel)" + by (subst lborel_eq_lborel_space) (simp add: nn_integral_distr measurable_p2e f) lemma borel_fubini_integrable: fixes f :: "'a::ordered_euclidean_space \ _::{banach, second_countable_topology}" @@ -1125,21 +1125,21 @@ by (intro integrable_has_integral_nonneg) (auto split: split_indicator) qed -lemma positive_integral_FTC_atLeastAtMost: +lemma nn_integral_FTC_atLeastAtMost: assumes "f \ borel_measurable borel" "\x. x \ {a..b} \ DERIV F x :> f x" "\x. x \ {a..b} \ 0 \ f x" "a \ b" shows "(\\<^sup>+x. f x * indicator {a .. b} x \lborel) = F b - F a" proof - have "integrable lborel (\x. f x * indicator {a .. b} x)" by (rule integrable_FTC_Icc_nonneg) fact+ then have "(\\<^sup>+x. f x * indicator {a .. b} x \lborel) = (\x. f x * indicator {a .. b} x \lborel)" - using assms by (intro positive_integral_eq_integral) (auto simp: indicator_def) + using assms by (intro nn_integral_eq_integral) (auto simp: indicator_def) also have "(\x. f x * indicator {a .. b} x \lborel) = F b - F a" by (rule integral_FTC_Icc_nonneg) fact+ finally show ?thesis unfolding ereal_indicator[symmetric] by simp qed -lemma positive_integral_FTC_atLeast: +lemma nn_integral_FTC_atLeast: fixes f :: "real \ real" assumes f_borel: "f \ borel_measurable borel" assumes f: "\x. a \ x \ DERIV F x :> f x" @@ -1161,10 +1161,10 @@ then show "(\n. ?f n x) ----> ?fR x" by (rule Lim_eventually) qed - then have "integral\<^sup>P lborel ?fR = (\\<^sup>+ x. (SUP i::nat. ?f i x) \lborel)" + then have "integral\<^sup>N lborel ?fR = (\\<^sup>+ x. (SUP i::nat. ?f i x) \lborel)" by simp also have "\ = (SUP i::nat. (\\<^sup>+ x. ?f i x \lborel))" - proof (rule positive_integral_monotone_convergence_SUP) + proof (rule nn_integral_monotone_convergence_SUP) show "incseq ?f" using nonneg by (auto simp: incseq_def le_fun_def split: split_indicator) show "\i. (?f i) \ borel_measurable lborel" @@ -1173,7 +1173,7 @@ using nonneg by (auto split: split_indicator) qed also have "\ = (SUP i::nat. ereal (F (a + real i) - F a))" - by (subst positive_integral_FTC_atLeastAtMost[OF f_borel f nonneg]) auto + by (subst nn_integral_FTC_atLeastAtMost[OF f_borel f nonneg]) auto also have "\ = T - F a" proof (rule SUP_Lim_ereal) show "incseq (\n. ereal (F (a + real n) - F a))" diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy --- a/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy Mon May 19 14:26:58 2014 +0200 @@ -17,7 +17,7 @@ text {* -Our simple functions are not restricted to positive real numbers. Instead +Our simple functions are not restricted to nonnegative real numbers. Instead they are just functions with a finite range and are measurable when singleton sets are measurable. @@ -725,7 +725,7 @@ using simple_integral_mult[OF simple_function_indicator[OF A]] unfolding simple_integral_indicator_only[OF A] by simp -lemma simple_integral_positive: +lemma simple_integral_nonneg: assumes f: "simple_function M f" and ae: "AE x in M. 0 \ f x" shows "0 \ integral\<^sup>S M f" proof - @@ -736,26 +736,26 @@ subsection {* Integral on nonnegative functions *} -definition positive_integral :: "'a measure \ ('a \ ereal) \ ereal" ("integral\<^sup>P") where - "integral\<^sup>P M f = (SUP g : {g. simple_function M g \ g \ max 0 \ f}. integral\<^sup>S M g)" +definition nn_integral :: "'a measure \ ('a \ ereal) \ ereal" ("integral\<^sup>N") where + "integral\<^sup>N M f = (SUP g : {g. simple_function M g \ g \ max 0 \ f}. integral\<^sup>S M g)" syntax - "_positive_integral" :: "pttrn \ ereal \ 'a measure \ ereal" ("\\<^sup>+ _. _ \_" [60,61] 110) + "_nn_integral" :: "pttrn \ ereal \ 'a measure \ ereal" ("\\<^sup>+ _. _ \_" [60,61] 110) translations - "\\<^sup>+ x. f \M" == "CONST positive_integral M (%x. f)" + "\\<^sup>+x. f \M" == "CONST nn_integral M (\x. f)" -lemma positive_integral_positive: - "0 \ integral\<^sup>P M f" - by (auto intro!: SUP_upper2[of "\x. 0"] simp: positive_integral_def le_fun_def) +lemma nn_integral_nonneg: + "0 \ integral\<^sup>N M f" + by (auto intro!: SUP_upper2[of "\x. 0"] simp: nn_integral_def le_fun_def) -lemma positive_integral_not_MInfty[simp]: "integral\<^sup>P M f \ -\" - using positive_integral_positive[of M f] by auto +lemma nn_integral_not_MInfty[simp]: "integral\<^sup>N M f \ -\" + using nn_integral_nonneg[of M f] by auto -lemma positive_integral_def_finite: - "integral\<^sup>P M f = (SUP g : {g. simple_function M g \ g \ max 0 \ f \ range g \ {0 ..< \}}. integral\<^sup>S M g)" +lemma nn_integral_def_finite: + "integral\<^sup>N M f = (SUP g : {g. simple_function M g \ g \ max 0 \ f \ range g \ {0 ..< \}}. integral\<^sup>S M g)" (is "_ = SUPREMUM ?A ?f") - unfolding positive_integral_def + unfolding nn_integral_def proof (safe intro!: antisym SUP_least) fix g assume g: "simple_function M g" "g \ max 0 \ f" let ?G = "{x \ space M. \ g x \ \}" @@ -797,9 +797,9 @@ qed qed (auto intro: SUP_upper) -lemma positive_integral_mono_AE: - assumes ae: "AE x in M. u x \ v x" shows "integral\<^sup>P M u \ integral\<^sup>P M v" - unfolding positive_integral_def +lemma nn_integral_mono_AE: + assumes ae: "AE x in M. u x \ v x" shows "integral\<^sup>N M u \ integral\<^sup>N M v" + unfolding nn_integral_def proof (safe intro!: SUP_mono) fix n assume n: "simple_function M n" "n \ max 0 \ u" from ae[THEN AE_E] guess N . note N = this @@ -822,57 +822,57 @@ by force qed -lemma positive_integral_mono: - "(\x. x \ space M \ u x \ v x) \ integral\<^sup>P M u \ integral\<^sup>P M v" - by (auto intro: positive_integral_mono_AE) +lemma nn_integral_mono: + "(\x. x \ space M \ u x \ v x) \ integral\<^sup>N M u \ integral\<^sup>N M v" + by (auto intro: nn_integral_mono_AE) -lemma positive_integral_cong_AE: - "AE x in M. u x = v x \ integral\<^sup>P M u = integral\<^sup>P M v" - by (auto simp: eq_iff intro!: positive_integral_mono_AE) +lemma nn_integral_cong_AE: + "AE x in M. u x = v x \ integral\<^sup>N M u = integral\<^sup>N M v" + by (auto simp: eq_iff intro!: nn_integral_mono_AE) -lemma positive_integral_cong: - "(\x. x \ space M \ u x = v x) \ integral\<^sup>P M u = integral\<^sup>P M v" - by (auto intro: positive_integral_cong_AE) +lemma nn_integral_cong: + "(\x. x \ space M \ u x = v x) \ integral\<^sup>N M u = integral\<^sup>N M v" + by (auto intro: nn_integral_cong_AE) -lemma positive_integral_cong_strong: - "M = N \ (\x. x \ space M \ u x = v x) \ integral\<^sup>P M u = integral\<^sup>P N v" - by (auto intro: positive_integral_cong) +lemma nn_integral_cong_strong: + "M = N \ (\x. x \ space M \ u x = v x) \ integral\<^sup>N M u = integral\<^sup>N N v" + by (auto intro: nn_integral_cong) -lemma positive_integral_eq_simple_integral: - assumes f: "simple_function M f" "\x. 0 \ f x" shows "integral\<^sup>P M f = integral\<^sup>S M f" +lemma nn_integral_eq_simple_integral: + assumes f: "simple_function M f" "\x. 0 \ f x" shows "integral\<^sup>N M f = integral\<^sup>S M f" proof - let ?f = "\x. f x * indicator (space M) x" have f': "simple_function M ?f" using f by auto with f(2) have [simp]: "max 0 \ ?f = ?f" by (auto simp: fun_eq_iff max_def split: split_indicator) - have "integral\<^sup>P M ?f \ integral\<^sup>S M ?f" using f' - by (force intro!: SUP_least simple_integral_mono simp: le_fun_def positive_integral_def) - moreover have "integral\<^sup>S M ?f \ integral\<^sup>P M ?f" - unfolding positive_integral_def + have "integral\<^sup>N M ?f \ integral\<^sup>S M ?f" using f' + by (force intro!: SUP_least simple_integral_mono simp: le_fun_def nn_integral_def) + moreover have "integral\<^sup>S M ?f \ integral\<^sup>N M ?f" + unfolding nn_integral_def using f' by (auto intro!: SUP_upper) ultimately show ?thesis - by (simp cong: positive_integral_cong simple_integral_cong) + by (simp cong: nn_integral_cong simple_integral_cong) qed -lemma positive_integral_eq_simple_integral_AE: - assumes f: "simple_function M f" "AE x in M. 0 \ f x" shows "integral\<^sup>P M f = integral\<^sup>S M f" +lemma nn_integral_eq_simple_integral_AE: + assumes f: "simple_function M f" "AE x in M. 0 \ f x" shows "integral\<^sup>N M f = integral\<^sup>S M f" proof - have "AE x in M. f x = max 0 (f x)" using f by (auto split: split_max) - with f have "integral\<^sup>P M f = integral\<^sup>S M (\x. max 0 (f x))" - by (simp cong: positive_integral_cong_AE simple_integral_cong_AE - add: positive_integral_eq_simple_integral) + with f have "integral\<^sup>N M f = integral\<^sup>S M (\x. max 0 (f x))" + by (simp cong: nn_integral_cong_AE simple_integral_cong_AE + add: nn_integral_eq_simple_integral) with assms show ?thesis by (auto intro!: simple_integral_cong_AE split: split_max) qed -lemma positive_integral_SUP_approx: +lemma nn_integral_SUP_approx: assumes f: "incseq f" "\i. f i \ borel_measurable M" "\i x. 0 \ f i x" and u: "simple_function M u" "u \ (SUP i. f i)" "u`space M \ {0..<\}" - shows "integral\<^sup>S M u \ (SUP i. integral\<^sup>P M (f i))" (is "_ \ ?S") + shows "integral\<^sup>S M u \ (SUP i. integral\<^sup>N M (f i))" (is "_ \ ?S") proof (rule ereal_le_mult_one_interval) - have "0 \ (SUP i. integral\<^sup>P M (f i))" - using f(3) by (auto intro!: SUP_upper2 positive_integral_positive) - then show "(SUP i. integral\<^sup>P M (f i)) \ -\" by auto + have "0 \ (SUP i. integral\<^sup>N M (f i))" + using f(3) by (auto intro!: SUP_upper2 nn_integral_nonneg) + then show "(SUP i. integral\<^sup>N M (f i)) \ -\" by auto have u_range: "\x. x \ space M \ 0 \ u x \ u x \ \" using u(3) by auto fix a :: ereal assume "0 < a" "a < 1" @@ -940,55 +940,55 @@ have "a * integral\<^sup>S M (?uB i) = (\\<^sup>Sx. a * ?uB i x \M)" using B `simple_function M u` u_range by (subst simple_integral_mult) (auto split: split_indicator) - also have "\ \ integral\<^sup>P M (f i)" + also have "\ \ integral\<^sup>N M (f i)" proof - have *: "simple_function M (\x. a * ?uB i x)" using B `0 < a` u(1) by auto show ?thesis using f(3) * u_range `0 < a` - by (subst positive_integral_eq_simple_integral[symmetric]) - (auto intro!: positive_integral_mono split: split_indicator) + by (subst nn_integral_eq_simple_integral[symmetric]) + (auto intro!: nn_integral_mono split: split_indicator) qed - finally show "a * integral\<^sup>S M (?uB i) \ integral\<^sup>P M (f i)" + finally show "a * integral\<^sup>S M (?uB i) \ integral\<^sup>N M (f i)" by auto next fix i show "0 \ \\<^sup>S x. ?uB i x \M" using B `0 < a` u(1) u_range - by (intro simple_integral_positive) (auto split: split_indicator) + by (intro simple_integral_nonneg) (auto split: split_indicator) qed (insert `0 < a`, auto) ultimately show "a * integral\<^sup>S M u \ ?S" by simp qed -lemma incseq_positive_integral: - assumes "incseq f" shows "incseq (\i. integral\<^sup>P M (f i))" +lemma incseq_nn_integral: + assumes "incseq f" shows "incseq (\i. integral\<^sup>N M (f i))" proof - have "\i x. f i x \ f (Suc i) x" using assms by (auto dest!: incseq_SucD simp: le_fun_def) then show ?thesis - by (auto intro!: incseq_SucI positive_integral_mono) + by (auto intro!: incseq_SucI nn_integral_mono) qed text {* Beppo-Levi monotone convergence theorem *} -lemma positive_integral_monotone_convergence_SUP: +lemma nn_integral_monotone_convergence_SUP: assumes f: "incseq f" "\i. f i \ borel_measurable M" "\i x. 0 \ f i x" - shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>P M (f i))" + shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>N M (f i))" proof (rule antisym) - show "(SUP j. integral\<^sup>P M (f j)) \ (\\<^sup>+ x. (SUP i. f i x) \M)" - by (auto intro!: SUP_least SUP_upper positive_integral_mono) + show "(SUP j. integral\<^sup>N M (f j)) \ (\\<^sup>+ x. (SUP i. f i x) \M)" + by (auto intro!: SUP_least SUP_upper nn_integral_mono) next - show "(\\<^sup>+ x. (SUP i. f i x) \M) \ (SUP j. integral\<^sup>P M (f j))" - unfolding positive_integral_def_finite[of _ "\x. SUP i. f i x"] + show "(\\<^sup>+ x. (SUP i. f i x) \M) \ (SUP j. integral\<^sup>N M (f j))" + unfolding nn_integral_def_finite[of _ "\x. SUP i. f i x"] proof (safe intro!: SUP_least) fix g assume g: "simple_function M g" and *: "g \ max 0 \ (\x. SUP i. f i x)" "range g \ {0..<\}" then have "\x. 0 \ (SUP i. f i x)" and g': "g`space M \ {0..<\}" using f by (auto intro!: SUP_upper2) - with * show "integral\<^sup>S M g \ (SUP j. integral\<^sup>P M (f j))" - by (intro positive_integral_SUP_approx[OF f g _ g']) + with * show "integral\<^sup>S M g \ (SUP j. integral\<^sup>N M (f j))" + by (intro nn_integral_SUP_approx[OF f g _ g']) (auto simp: le_fun_def max_def) qed qed -lemma positive_integral_monotone_convergence_SUP_AE: +lemma nn_integral_monotone_convergence_SUP_AE: assumes f: "\i. AE x in M. f i x \ f (Suc i) x \ 0 \ f i x" "\i. f i \ borel_measurable M" - shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>P M (f i))" + shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>N M (f i))" proof - from f have "AE x in M. \i. f i x \ f (Suc i) x \ 0 \ f i x" by (simp add: AE_all_countable) @@ -996,9 +996,9 @@ let ?f = "\i x. if x \ space M - N then f i x else 0" have f_eq: "AE x in M. \i. ?f i x = f i x" using N by (auto intro!: AE_I[of _ _ N]) then have "(\\<^sup>+ x. (SUP i. f i x) \M) = (\\<^sup>+ x. (SUP i. ?f i x) \M)" - by (auto intro!: positive_integral_cong_AE) + by (auto intro!: nn_integral_cong_AE) also have "\ = (SUP i. (\\<^sup>+ x. ?f i x \M))" - proof (rule positive_integral_monotone_convergence_SUP) + proof (rule nn_integral_monotone_convergence_SUP) show "incseq ?f" using N(1) by (force intro!: incseq_SucI le_funI) { fix i show "(\x. if x \ space M - N then f i x else 0) \ borel_measurable M" using f N(3) by (intro measurable_If_set) auto @@ -1006,39 +1006,39 @@ using N(1) by auto } qed also have "\ = (SUP i. (\\<^sup>+ x. f i x \M))" - using f_eq by (force intro!: arg_cong[where f="SUPREMUM UNIV"] positive_integral_cong_AE ext) + using f_eq by (force intro!: arg_cong[where f="SUPREMUM UNIV"] nn_integral_cong_AE ext) finally show ?thesis . qed -lemma positive_integral_monotone_convergence_SUP_AE_incseq: +lemma nn_integral_monotone_convergence_SUP_AE_incseq: assumes f: "incseq f" "\i. AE x in M. 0 \ f i x" and borel: "\i. f i \ borel_measurable M" - shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>P M (f i))" + shows "(\\<^sup>+ x. (SUP i. f i x) \M) = (SUP i. integral\<^sup>N M (f i))" using f[unfolded incseq_Suc_iff le_fun_def] - by (intro positive_integral_monotone_convergence_SUP_AE[OF _ borel]) + by (intro nn_integral_monotone_convergence_SUP_AE[OF _ borel]) auto -lemma positive_integral_monotone_convergence_simple: +lemma nn_integral_monotone_convergence_simple: assumes f: "incseq f" "\i x. 0 \ f i x" "\i. simple_function M (f i)" shows "(SUP i. integral\<^sup>S M (f i)) = (\\<^sup>+x. (SUP i. f i x) \M)" - using assms unfolding positive_integral_monotone_convergence_SUP[OF f(1) + using assms unfolding nn_integral_monotone_convergence_SUP[OF f(1) f(3)[THEN borel_measurable_simple_function] f(2)] - by (auto intro!: positive_integral_eq_simple_integral[symmetric] arg_cong[where f="SUPREMUM UNIV"] ext) + by (auto intro!: nn_integral_eq_simple_integral[symmetric] arg_cong[where f="SUPREMUM UNIV"] ext) -lemma positive_integral_max_0: - "(\\<^sup>+x. max 0 (f x) \M) = integral\<^sup>P M f" - by (simp add: le_fun_def positive_integral_def) +lemma nn_integral_max_0: + "(\\<^sup>+x. max 0 (f x) \M) = integral\<^sup>N M f" + by (simp add: le_fun_def nn_integral_def) -lemma positive_integral_cong_pos: +lemma nn_integral_cong_pos: assumes "\x. x \ space M \ f x \ 0 \ g x \ 0 \ f x = g x" - shows "integral\<^sup>P M f = integral\<^sup>P M g" + shows "integral\<^sup>N M f = integral\<^sup>N M g" proof - - have "integral\<^sup>P M (\x. max 0 (f x)) = integral\<^sup>P M (\x. max 0 (g x))" - proof (intro positive_integral_cong) + have "integral\<^sup>N M (\x. max 0 (f x)) = integral\<^sup>N M (\x. max 0 (g x))" + proof (intro nn_integral_cong) fix x assume "x \ space M" from assms[OF this] show "max 0 (f x) = max 0 (g x)" by (auto split: split_max) qed - then show ?thesis by (simp add: positive_integral_max_0) + then show ?thesis by (simp add: nn_integral_max_0) qed lemma SUP_simple_integral_sequences: @@ -1049,40 +1049,40 @@ (is "SUPREMUM _ ?F = SUPREMUM _ ?G") proof - have "(SUP i. integral\<^sup>S M (f i)) = (\\<^sup>+x. (SUP i. f i x) \M)" - using f by (rule positive_integral_monotone_convergence_simple) + using f by (rule nn_integral_monotone_convergence_simple) also have "\ = (\\<^sup>+x. (SUP i. g i x) \M)" - unfolding eq[THEN positive_integral_cong_AE] .. + unfolding eq[THEN nn_integral_cong_AE] .. also have "\ = (SUP i. ?G i)" - using g by (rule positive_integral_monotone_convergence_simple[symmetric]) + using g by (rule nn_integral_monotone_convergence_simple[symmetric]) finally show ?thesis by simp qed -lemma positive_integral_const[simp]: +lemma nn_integral_const[simp]: "0 \ c \ (\\<^sup>+ x. c \M) = c * (emeasure M) (space M)" - by (subst positive_integral_eq_simple_integral) auto + by (subst nn_integral_eq_simple_integral) auto -lemma positive_integral_linear: +lemma nn_integral_linear: assumes f: "f \ borel_measurable M" "\x. 0 \ f x" and "0 \ a" and g: "g \ borel_measurable M" "\x. 0 \ g x" - shows "(\\<^sup>+ x. a * f x + g x \M) = a * integral\<^sup>P M f + integral\<^sup>P M g" - (is "integral\<^sup>P M ?L = _") + shows "(\\<^sup>+ x. a * f x + g x \M) = a * integral\<^sup>N M f + integral\<^sup>N M g" + (is "integral\<^sup>N M ?L = _") proof - from borel_measurable_implies_simple_function_sequence'[OF f(1)] guess u . - note u = positive_integral_monotone_convergence_simple[OF this(2,5,1)] this + note u = nn_integral_monotone_convergence_simple[OF this(2,5,1)] this from borel_measurable_implies_simple_function_sequence'[OF g(1)] guess v . - note v = positive_integral_monotone_convergence_simple[OF this(2,5,1)] this + note v = nn_integral_monotone_convergence_simple[OF this(2,5,1)] this let ?L' = "\i x. a * u i x + v i x" have "?L \ borel_measurable M" using assms by auto from borel_measurable_implies_simple_function_sequence'[OF this] guess l . - note l = positive_integral_monotone_convergence_simple[OF this(2,5,1)] this + note l = nn_integral_monotone_convergence_simple[OF this(2,5,1)] this have inc: "incseq (\i. a * integral\<^sup>S M (u i))" "incseq (\i. integral\<^sup>S M (v i))" using u v `0 \ a` by (auto simp: incseq_Suc_iff le_fun_def intro!: add_mono ereal_mult_left_mono simple_integral_mono) have pos: "\i. 0 \ integral\<^sup>S M (u i)" "\i. 0 \ integral\<^sup>S M (v i)" "\i. 0 \ a * integral\<^sup>S M (u i)" - using u v `0 \ a` by (auto simp: simple_integral_positive) + using u v `0 \ a` by (auto simp: simple_integral_nonneg) { fix i from pos[of i] have "a * integral\<^sup>S M (u i) \ -\" "integral\<^sup>S M (v i) \ -\" by (auto split: split_if_asm) } note not_MInf = this @@ -1111,69 +1111,69 @@ unfolding l(1)[symmetric] u(1)[symmetric] v(1)[symmetric] apply (subst SUP_ereal_cmult [symmetric, OF pos(1) `0 \ a`]) apply (subst SUP_ereal_add [symmetric, OF inc not_MInf]) . - then show ?thesis by (simp add: positive_integral_max_0) + then show ?thesis by (simp add: nn_integral_max_0) qed -lemma positive_integral_cmult: +lemma nn_integral_cmult: assumes f: "f \ borel_measurable M" "0 \ c" - shows "(\\<^sup>+ x. c * f x \M) = c * integral\<^sup>P M f" + shows "(\\<^sup>+ x. c * f x \M) = c * integral\<^sup>N M f" proof - have [simp]: "\x. c * max 0 (f x) = max 0 (c * f x)" using `0 \ c` by (auto split: split_max simp: ereal_zero_le_0_iff) have "(\\<^sup>+ x. c * f x \M) = (\\<^sup>+ x. c * max 0 (f x) \M)" - by (simp add: positive_integral_max_0) + by (simp add: nn_integral_max_0) then show ?thesis - using positive_integral_linear[OF _ _ `0 \ c`, of "\x. max 0 (f x)" _ "\x. 0"] f - by (auto simp: positive_integral_max_0) + using nn_integral_linear[OF _ _ `0 \ c`, of "\x. max 0 (f x)" _ "\x. 0"] f + by (auto simp: nn_integral_max_0) qed -lemma positive_integral_multc: +lemma nn_integral_multc: assumes "f \ borel_measurable M" "0 \ c" - shows "(\\<^sup>+ x. f x * c \M) = integral\<^sup>P M f * c" - unfolding mult_commute[of _ c] positive_integral_cmult[OF assms] by simp + shows "(\\<^sup>+ x. f x * c \M) = integral\<^sup>N M f * c" + unfolding mult_commute[of _ c] nn_integral_cmult[OF assms] by simp -lemma positive_integral_indicator[simp]: +lemma nn_integral_indicator[simp]: "A \ sets M \ (\\<^sup>+ x. indicator A x\M) = (emeasure M) A" - by (subst positive_integral_eq_simple_integral) + by (subst nn_integral_eq_simple_integral) (auto simp: simple_integral_indicator) -lemma positive_integral_cmult_indicator: +lemma nn_integral_cmult_indicator: "0 \ c \ A \ sets M \ (\\<^sup>+ x. c * indicator A x \M) = c * (emeasure M) A" - by (subst positive_integral_eq_simple_integral) + by (subst nn_integral_eq_simple_integral) (auto simp: simple_function_indicator simple_integral_indicator) -lemma positive_integral_indicator': +lemma nn_integral_indicator': assumes [measurable]: "A \ space M \ sets M" shows "(\\<^sup>+ x. indicator A x \M) = emeasure M (A \ space M)" proof - have "(\\<^sup>+ x. indicator A x \M) = (\\<^sup>+ x. indicator (A \ space M) x \M)" - by (intro positive_integral_cong) (simp split: split_indicator) + by (intro nn_integral_cong) (simp split: split_indicator) also have "\ = emeasure M (A \ space M)" by simp finally show ?thesis . qed -lemma positive_integral_add: +lemma nn_integral_add: assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" and g: "g \ borel_measurable M" "AE x in M. 0 \ g x" - shows "(\\<^sup>+ x. f x + g x \M) = integral\<^sup>P M f + integral\<^sup>P M g" + shows "(\\<^sup>+ x. f x + g x \M) = integral\<^sup>N M f + integral\<^sup>N M g" proof - have ae: "AE x in M. max 0 (f x) + max 0 (g x) = max 0 (f x + g x)" using assms by (auto split: split_max) have "(\\<^sup>+ x. f x + g x \M) = (\\<^sup>+ x. max 0 (f x + g x) \M)" - by (simp add: positive_integral_max_0) + by (simp add: nn_integral_max_0) also have "\ = (\\<^sup>+ x. max 0 (f x) + max 0 (g x) \M)" - unfolding ae[THEN positive_integral_cong_AE] .. + unfolding ae[THEN nn_integral_cong_AE] .. also have "\ = (\\<^sup>+ x. max 0 (f x) \M) + (\\<^sup>+ x. max 0 (g x) \M)" - using positive_integral_linear[of "\x. max 0 (f x)" _ 1 "\x. max 0 (g x)"] f g + using nn_integral_linear[of "\x. max 0 (f x)" _ 1 "\x. max 0 (g x)"] f g by auto finally show ?thesis - by (simp add: positive_integral_max_0) + by (simp add: nn_integral_max_0) qed -lemma positive_integral_setsum: +lemma nn_integral_setsum: assumes "\i. i\P \ f i \ borel_measurable M" "\i. i\P \ AE x in M. 0 \ f i x" - shows "(\\<^sup>+ x. (\i\P. f i x) \M) = (\i\P. integral\<^sup>P M (f i))" + shows "(\\<^sup>+ x. (\i\P. f i x) \M) = (\i\P. integral\<^sup>N M (f i))" proof cases assume f: "finite P" from assms have "AE x in M. \i\P. 0 \ f i x" unfolding AE_finite_all[OF f] by auto @@ -1183,12 +1183,12 @@ then have "f i \ borel_measurable M" "AE x in M. 0 \ f i x" "(\x. \i\P. f i x) \ borel_measurable M" "AE x in M. 0 \ (\i\P. f i x)" by (auto intro!: setsum_nonneg) - from positive_integral_add[OF this] + from nn_integral_add[OF this] show ?case using insert by auto qed simp qed simp -lemma positive_integral_Markov_inequality: +lemma nn_integral_Markov_inequality: assumes u: "u \ borel_measurable M" "AE x in M. 0 \ u x" and "A \ sets M" and c: "0 \ c" shows "(emeasure M) ({x\space M. 1 \ c * u x} \ A) \ c * (\\<^sup>+ x. u x * indicator A x \M)" (is "(emeasure M) ?A \ _ * ?PI") @@ -1196,19 +1196,19 @@ have "?A \ sets M" using `A \ sets M` u by auto hence "(emeasure M) ?A = (\\<^sup>+ x. indicator ?A x \M)" - using positive_integral_indicator by simp + using nn_integral_indicator by simp also have "\ \ (\\<^sup>+ x. c * (u x * indicator A x) \M)" using u c - by (auto intro!: positive_integral_mono_AE + by (auto intro!: nn_integral_mono_AE simp: indicator_def ereal_zero_le_0_iff) also have "\ = c * (\\<^sup>+ x. u x * indicator A x \M)" using assms - by (auto intro!: positive_integral_cmult simp: ereal_zero_le_0_iff) + by (auto intro!: nn_integral_cmult simp: ereal_zero_le_0_iff) finally show ?thesis . qed -lemma positive_integral_noteq_infinite: +lemma nn_integral_noteq_infinite: assumes g: "g \ borel_measurable M" "AE x in M. 0 \ g x" - and "integral\<^sup>P M g \ \" + and "integral\<^sup>N M g \ \" shows "AE x in M. g x \ \" proof (rule ccontr) assume c: "\ (AE x in M. g x \ \)" @@ -1218,34 +1218,34 @@ ultimately have "0 < (emeasure M) {x\space M. g x = \}" by auto then have "\ = \ * (emeasure M) {x\space M. g x = \}" by auto also have "\ \ (\\<^sup>+x. \ * indicator {x\space M. g x = \} x \M)" - using g by (subst positive_integral_cmult_indicator) auto - also have "\ \ integral\<^sup>P M g" - using assms by (auto intro!: positive_integral_mono_AE simp: indicator_def) - finally show False using `integral\<^sup>P M g \ \` by auto + using g by (subst nn_integral_cmult_indicator) auto + also have "\ \ integral\<^sup>N M g" + using assms by (auto intro!: nn_integral_mono_AE simp: indicator_def) + finally show False using `integral\<^sup>N M g \ \` by auto qed -lemma positive_integral_PInf: +lemma nn_integral_PInf: assumes f: "f \ borel_measurable M" - and not_Inf: "integral\<^sup>P M f \ \" + and not_Inf: "integral\<^sup>N M f \ \" shows "(emeasure M) (f -` {\} \ space M) = 0" proof - have "\ * (emeasure M) (f -` {\} \ space M) = (\\<^sup>+ x. \ * indicator (f -` {\} \ space M) x \M)" - using f by (subst positive_integral_cmult_indicator) (auto simp: measurable_sets) - also have "\ \ integral\<^sup>P M (\x. max 0 (f x))" - by (auto intro!: positive_integral_mono simp: indicator_def max_def) - finally have "\ * (emeasure M) (f -` {\} \ space M) \ integral\<^sup>P M f" - by (simp add: positive_integral_max_0) + using f by (subst nn_integral_cmult_indicator) (auto simp: measurable_sets) + also have "\ \ integral\<^sup>N M (\x. max 0 (f x))" + by (auto intro!: nn_integral_mono simp: indicator_def max_def) + finally have "\ * (emeasure M) (f -` {\} \ space M) \ integral\<^sup>N M f" + by (simp add: nn_integral_max_0) moreover have "0 \ (emeasure M) (f -` {\} \ space M)" by (rule emeasure_nonneg) ultimately show ?thesis using assms by (auto split: split_if_asm) qed -lemma positive_integral_PInf_AE: - assumes "f \ borel_measurable M" "integral\<^sup>P M f \ \" shows "AE x in M. f x \ \" +lemma nn_integral_PInf_AE: + assumes "f \ borel_measurable M" "integral\<^sup>N M f \ \" shows "AE x in M. f x \ \" proof (rule AE_I) show "(emeasure M) (f -` {\} \ space M) = 0" - by (rule positive_integral_PInf[OF assms]) + by (rule nn_integral_PInf[OF assms]) show "f -` {\} \ space M \ sets M" using assms by (auto intro: borel_measurable_vimage) qed auto @@ -1254,18 +1254,18 @@ assumes "simple_function M f" "\x. 0 \ f x" and "integral\<^sup>S M f \ \" shows "(emeasure M) (f -` {\} \ space M) = 0" -proof (rule positive_integral_PInf) +proof (rule nn_integral_PInf) show "f \ borel_measurable M" using assms by (auto intro: borel_measurable_simple_function) - show "integral\<^sup>P M f \ \" - using assms by (simp add: positive_integral_eq_simple_integral) + show "integral\<^sup>N M f \ \" + using assms by (simp add: nn_integral_eq_simple_integral) qed -lemma positive_integral_diff: +lemma nn_integral_diff: assumes f: "f \ borel_measurable M" and g: "g \ borel_measurable M" "AE x in M. 0 \ g x" - and fin: "integral\<^sup>P M g \ \" + and fin: "integral\<^sup>N M g \ \" and mono: "AE x in M. g x \ f x" - shows "(\\<^sup>+ x. f x - g x \M) = integral\<^sup>P M f - integral\<^sup>P M g" + shows "(\\<^sup>+ x. f x - g x \M) = integral\<^sup>N M f - integral\<^sup>N M g" proof - have diff: "(\x. f x - g x) \ borel_measurable M" "AE x in M. 0 \ f x - g x" using assms by (auto intro: ereal_diff_positive) @@ -1274,61 +1274,61 @@ by (cases rule: ereal2_cases[of a b]) auto } note * = this then have "AE x in M. f x = f x - g x + g x" - using mono positive_integral_noteq_infinite[OF g fin] assms by auto - then have **: "integral\<^sup>P M f = (\\<^sup>+x. f x - g x \M) + integral\<^sup>P M g" - unfolding positive_integral_add[OF diff g, symmetric] - by (rule positive_integral_cong_AE) + using mono nn_integral_noteq_infinite[OF g fin] assms by auto + then have **: "integral\<^sup>N M f = (\\<^sup>+x. f x - g x \M) + integral\<^sup>N M g" + unfolding nn_integral_add[OF diff g, symmetric] + by (rule nn_integral_cong_AE) show ?thesis unfolding ** - using fin positive_integral_positive[of M g] - by (cases rule: ereal2_cases[of "\\<^sup>+ x. f x - g x \M" "integral\<^sup>P M g"]) auto + using fin nn_integral_nonneg[of M g] + by (cases rule: ereal2_cases[of "\\<^sup>+ x. f x - g x \M" "integral\<^sup>N M g"]) auto qed -lemma positive_integral_suminf: +lemma nn_integral_suminf: assumes f: "\i. f i \ borel_measurable M" "\i. AE x in M. 0 \ f i x" - shows "(\\<^sup>+ x. (\i. f i x) \M) = (\i. integral\<^sup>P M (f i))" + shows "(\\<^sup>+ x. (\i. f i x) \M) = (\i. integral\<^sup>N M (f i))" proof - have all_pos: "AE x in M. \i. 0 \ f i x" using assms by (auto simp: AE_all_countable) - have "(\i. integral\<^sup>P M (f i)) = (SUP n. \iP M (f i))" - using positive_integral_positive by (rule suminf_ereal_eq_SUP) + have "(\i. integral\<^sup>N M (f i)) = (SUP n. \iN M (f i))" + using nn_integral_nonneg by (rule suminf_ereal_eq_SUP) also have "\ = (SUP n. \\<^sup>+x. (\iM)" - unfolding positive_integral_setsum[OF f] .. + unfolding nn_integral_setsum[OF f] .. also have "\ = \\<^sup>+x. (SUP n. \iM" using f all_pos - by (intro positive_integral_monotone_convergence_SUP_AE[symmetric]) + by (intro nn_integral_monotone_convergence_SUP_AE[symmetric]) (elim AE_mp, auto simp: setsum_nonneg simp del: setsum_lessThan_Suc intro!: AE_I2 setsum_mono3) also have "\ = \\<^sup>+x. (\i. f i x) \M" using all_pos - by (intro positive_integral_cong_AE) (auto simp: suminf_ereal_eq_SUP) + by (intro nn_integral_cong_AE) (auto simp: suminf_ereal_eq_SUP) finally show ?thesis by simp qed -lemma positive_integral_mult_bounded_inf: +lemma nn_integral_mult_bounded_inf: assumes f: "f \ borel_measurable M" "(\\<^sup>+x. f x \M) < \" and c: "0 \ c" "c \ \" and ae: "AE x in M. g x \ c * f x" shows "(\\<^sup>+x. g x \M) < \" proof - have "(\\<^sup>+x. g x \M) \ (\\<^sup>+x. c * f x \M)" - by (intro positive_integral_mono_AE ae) + by (intro nn_integral_mono_AE ae) also have "(\\<^sup>+x. c * f x \M) < \" - using c f by (subst positive_integral_cmult) auto + using c f by (subst nn_integral_cmult) auto finally show ?thesis . qed text {* Fatou's lemma: convergence theorem on limes inferior *} -lemma positive_integral_liminf: +lemma nn_integral_liminf: fixes u :: "nat \ 'a \ ereal" assumes u: "\i. u i \ borel_measurable M" "\i. AE x in M. 0 \ u i x" - shows "(\\<^sup>+ x. liminf (\n. u n x) \M) \ liminf (\n. integral\<^sup>P M (u n))" + shows "(\\<^sup>+ x. liminf (\n. u n x) \M) \ liminf (\n. integral\<^sup>N M (u n))" proof - have pos: "AE x in M. \i. 0 \ u i x" using u by (auto simp: AE_all_countable) have "(\\<^sup>+ x. liminf (\n. u n x) \M) = (SUP n. \\<^sup>+ x. (INF i:{n..}. u i x) \M)" unfolding liminf_SUP_INF using pos u - by (intro positive_integral_monotone_convergence_SUP_AE) + by (intro nn_integral_monotone_convergence_SUP_AE) (elim AE_mp, auto intro!: AE_I2 intro: INF_greatest INF_superset_mono) - also have "\ \ liminf (\n. integral\<^sup>P M (u n))" + also have "\ \ liminf (\n. integral\<^sup>N M (u n))" unfolding liminf_SUP_INF - by (auto intro!: SUP_mono exI INF_greatest positive_integral_mono INF_lower) + by (auto intro!: SUP_mono exI INF_greatest nn_integral_mono INF_lower) finally show ?thesis . qed @@ -1345,11 +1345,11 @@ shows "c - a \ c - b \ 0 \ c \ c < \ \ b \ a" by (cases a b c rule: ereal3_cases) auto -lemma positive_integral_limsup: +lemma nn_integral_limsup: fixes u :: "nat \ 'a \ ereal" assumes [measurable]: "\i. u i \ borel_measurable M" "w \ borel_measurable M" assumes bounds: "\i. AE x in M. 0 \ u i x" "\i. AE x in M. u i x \ w x" and w: "(\\<^sup>+x. w x \M) < \" - shows "limsup (\n. integral\<^sup>P M (u n)) \ (\\<^sup>+ x. limsup (\n. u n x) \M)" + shows "limsup (\n. integral\<^sup>N M (u n)) \ (\\<^sup>+ x. limsup (\n. u n x) \M)" proof - have bnd: "AE x in M. \i. 0 \ u i x \ u i x \ w x" using bounds by (auto simp: AE_all_countable) @@ -1358,38 +1358,38 @@ by auto have "(\\<^sup>+x. w x \M) - (\\<^sup>+x. limsup (\n. u n x) \M) = (\\<^sup>+x. w x - limsup (\n. u n x) \M)" - proof (intro positive_integral_diff[symmetric]) + proof (intro nn_integral_diff[symmetric]) show "AE x in M. 0 \ limsup (\n. u n x)" using bnd by (auto intro!: le_Limsup) show "AE x in M. limsup (\n. u n x) \ w x" using bnd by (auto intro!: Limsup_le) then have "(\\<^sup>+x. limsup (\n. u n x) \M) < \" - by (intro positive_integral_mult_bounded_inf[OF _ w, of 1]) auto + by (intro nn_integral_mult_bounded_inf[OF _ w, of 1]) auto then show "(\\<^sup>+x. limsup (\n. u n x) \M) \ \" by simp qed auto also have "\ = (\\<^sup>+x. liminf (\n. w x - u n x) \M)" using w_nonneg - by (intro positive_integral_cong_AE, eventually_elim) + by (intro nn_integral_cong_AE, eventually_elim) (auto intro!: liminf_ereal_cminus[symmetric]) also have "\ \ liminf (\n. \\<^sup>+x. w x - u n x \M)" - proof (rule positive_integral_liminf) + proof (rule nn_integral_liminf) fix i show "AE x in M. 0 \ w x - u i x" using bounds[of i] by eventually_elim (auto intro: ereal_diff_positive) qed simp also have "(\n. \\<^sup>+x. w x - u n x \M) = (\n. (\\<^sup>+x. w x \M) - (\\<^sup>+x. u n x \M))" - proof (intro ext positive_integral_diff) + proof (intro ext nn_integral_diff) fix i have "(\\<^sup>+x. u i x \M) < \" - using bounds by (intro positive_integral_mult_bounded_inf[OF _ w, of 1]) auto + using bounds by (intro nn_integral_mult_bounded_inf[OF _ w, of 1]) auto then show "(\\<^sup>+x. u i x \M) \ \" by simp qed (insert bounds, auto) also have "liminf (\n. (\\<^sup>+x. w x \M) - (\\<^sup>+x. u n x \M)) = (\\<^sup>+x. w x \M) - limsup (\n. \\<^sup>+x. u n x \M)" using w by (intro liminf_ereal_cminus) auto finally show ?thesis - by (rule ereal_mono_minus_cancel) (intro w positive_integral_positive)+ + by (rule ereal_mono_minus_cancel) (intro w nn_integral_nonneg)+ qed -lemma positive_integral_dominated_convergence: +lemma nn_integral_dominated_convergence: assumes [measurable]: "\i. u i \ borel_measurable M" "u' \ borel_measurable M" "w \ borel_measurable M" and bound: "\j. AE x in M. 0 \ u j x" "\j. AE x in M. u j x \ w x" @@ -1397,25 +1397,25 @@ and u': "AE x in M. (\i. u i x) ----> u' x" shows "(\i. (\\<^sup>+x. u i x \M)) ----> (\\<^sup>+x. u' x \M)" proof - - have "limsup (\n. integral\<^sup>P M (u n)) \ (\\<^sup>+ x. limsup (\n. u n x) \M)" - by (intro positive_integral_limsup[OF _ _ bound w]) auto + have "limsup (\n. integral\<^sup>N M (u n)) \ (\\<^sup>+ x. limsup (\n. u n x) \M)" + by (intro nn_integral_limsup[OF _ _ bound w]) auto moreover have "(\\<^sup>+ x. limsup (\n. u n x) \M) = (\\<^sup>+ x. u' x \M)" - using u' by (intro positive_integral_cong_AE, eventually_elim) (metis tendsto_iff_Liminf_eq_Limsup sequentially_bot) + using u' by (intro nn_integral_cong_AE, eventually_elim) (metis tendsto_iff_Liminf_eq_Limsup sequentially_bot) moreover have "(\\<^sup>+ x. liminf (\n. u n x) \M) = (\\<^sup>+ x. u' x \M)" - using u' by (intro positive_integral_cong_AE, eventually_elim) (metis tendsto_iff_Liminf_eq_Limsup sequentially_bot) - moreover have "(\\<^sup>+x. liminf (\n. u n x) \M) \ liminf (\n. integral\<^sup>P M (u n))" - by (intro positive_integral_liminf[OF _ bound(1)]) auto - moreover have "liminf (\n. integral\<^sup>P M (u n)) \ limsup (\n. integral\<^sup>P M (u n))" + using u' by (intro nn_integral_cong_AE, eventually_elim) (metis tendsto_iff_Liminf_eq_Limsup sequentially_bot) + moreover have "(\\<^sup>+x. liminf (\n. u n x) \M) \ liminf (\n. integral\<^sup>N M (u n))" + by (intro nn_integral_liminf[OF _ bound(1)]) auto + moreover have "liminf (\n. integral\<^sup>N M (u n)) \ limsup (\n. integral\<^sup>N M (u n))" by (intro Liminf_le_Limsup sequentially_bot) ultimately show ?thesis by (intro Liminf_eq_Limsup) auto qed -lemma positive_integral_null_set: +lemma nn_integral_null_set: assumes "N \ null_sets M" shows "(\\<^sup>+ x. u x * indicator N x \M) = 0" proof - have "(\\<^sup>+ x. u x * indicator N x \M) = (\\<^sup>+ x. 0 \M)" - proof (intro positive_integral_cong_AE AE_I) + proof (intro nn_integral_cong_AE AE_I) show "{x \ space M. u x * indicator N x \ 0} \ N" by (auto simp: indicator_def) show "(emeasure M) N = 0" "N \ sets M" @@ -1424,29 +1424,29 @@ then show ?thesis by simp qed -lemma positive_integral_0_iff: +lemma nn_integral_0_iff: assumes u: "u \ borel_measurable M" and pos: "AE x in M. 0 \ u x" - shows "integral\<^sup>P M u = 0 \ emeasure M {x\space M. u x \ 0} = 0" + shows "integral\<^sup>N M u = 0 \ emeasure M {x\space M. u x \ 0} = 0" (is "_ \ (emeasure M) ?A = 0") proof - - have u_eq: "(\\<^sup>+ x. u x * indicator ?A x \M) = integral\<^sup>P M u" - by (auto intro!: positive_integral_cong simp: indicator_def) + have u_eq: "(\\<^sup>+ x. u x * indicator ?A x \M) = integral\<^sup>N M u" + by (auto intro!: nn_integral_cong simp: indicator_def) show ?thesis proof assume "(emeasure M) ?A = 0" - with positive_integral_null_set[of ?A M u] u - show "integral\<^sup>P M u = 0" by (simp add: u_eq null_sets_def) + with nn_integral_null_set[of ?A M u] u + show "integral\<^sup>N M u = 0" by (simp add: u_eq null_sets_def) next { fix r :: ereal and n :: nat assume gt_1: "1 \ real n * r" then have "0 < real n * r" by (cases r) (auto split: split_if_asm simp: one_ereal_def) then have "0 \ r" by (auto simp add: ereal_zero_less_0_iff) } note gt_1 = this - assume *: "integral\<^sup>P M u = 0" + assume *: "integral\<^sup>N M u = 0" let ?M = "\n. {x \ space M. 1 \ real (n::nat) * u x}" have "0 = (SUP n. (emeasure M) (?M n \ ?A))" proof - { fix n :: nat - from positive_integral_Markov_inequality[OF u pos, of ?A "ereal (real n)"] + from nn_integral_Markov_inequality[OF u pos, of ?A "ereal (real n)"] have "(emeasure M) (?M n \ ?A) \ 0" unfolding u_eq * using u by simp moreover have "0 \ (emeasure M) (?M n \ ?A)" using u by auto ultimately have "(emeasure M) (?M n \ ?A) = 0" by auto } @@ -1489,33 +1489,33 @@ qed qed -lemma positive_integral_0_iff_AE: +lemma nn_integral_0_iff_AE: assumes u: "u \ borel_measurable M" - shows "integral\<^sup>P M u = 0 \ (AE x in M. u x \ 0)" + shows "integral\<^sup>N M u = 0 \ (AE x in M. u x \ 0)" proof - have sets: "{x\space M. max 0 (u x) \ 0} \ sets M" using u by auto - from positive_integral_0_iff[of "\x. max 0 (u x)"] - have "integral\<^sup>P M u = 0 \ (AE x in M. max 0 (u x) = 0)" - unfolding positive_integral_max_0 + from nn_integral_0_iff[of "\x. max 0 (u x)"] + have "integral\<^sup>N M u = 0 \ (AE x in M. max 0 (u x) = 0)" + unfolding nn_integral_max_0 using AE_iff_null[OF sets] u by auto also have "\ \ (AE x in M. u x \ 0)" by (auto split: split_max) finally show ?thesis . qed -lemma AE_iff_positive_integral: - "{x\space M. P x} \ sets M \ (AE x in M. P x) \ integral\<^sup>P M (indicator {x. \ P x}) = 0" - by (subst positive_integral_0_iff_AE) (auto simp: one_ereal_def zero_ereal_def +lemma AE_iff_nn_integral: + "{x\space M. P x} \ sets M \ (AE x in M. P x) \ integral\<^sup>N M (indicator {x. \ P x}) = 0" + by (subst nn_integral_0_iff_AE) (auto simp: one_ereal_def zero_ereal_def sets.sets_Collect_neg indicator_def[abs_def] measurable_If) -lemma positive_integral_const_If: +lemma nn_integral_const_If: "(\\<^sup>+x. a \M) = (if 0 \ a then a * (emeasure M) (space M) else 0)" - by (auto intro!: positive_integral_0_iff_AE[THEN iffD2]) + by (auto intro!: nn_integral_0_iff_AE[THEN iffD2]) -lemma positive_integral_subalgebra: +lemma nn_integral_subalgebra: assumes f: "f \ borel_measurable N" "\x. 0 \ f x" and N: "sets N \ sets M" "space N = space M" "\A. A \ sets N \ emeasure N A = emeasure M A" - shows "integral\<^sup>P N f = integral\<^sup>P M f" + shows "integral\<^sup>N N f = integral\<^sup>N M f" proof - have [simp]: "\f :: 'a \ ereal. f \ borel_measurable N \ f \ borel_measurable M" using N by (auto simp: measurable_def) @@ -1525,12 +1525,12 @@ using N by auto from f show ?thesis apply induct - apply (simp_all add: positive_integral_add positive_integral_cmult positive_integral_monotone_convergence_SUP N) - apply (auto intro!: positive_integral_cong cong: positive_integral_cong simp: N(2)[symmetric]) + apply (simp_all add: nn_integral_add nn_integral_cmult nn_integral_monotone_convergence_SUP N) + apply (auto intro!: nn_integral_cong cong: nn_integral_cong simp: N(2)[symmetric]) done qed -lemma positive_integral_nat_function: +lemma nn_integral_nat_function: fixes f :: "'a \ nat" assumes "f \ measurable M (count_space UNIV)" shows "(\\<^sup>+x. ereal (of_nat (f x)) \M) = (\t. emeasure M {x\space M. t < f x})" @@ -1549,9 +1549,9 @@ ultimately have "ereal(of_nat(f x)) = (\i. indicator (F i) x)" by (simp add: sums_iff) } then have "(\\<^sup>+x. ereal (of_nat (f x)) \M) = (\\<^sup>+x. (\i. indicator (F i) x) \M)" - by (simp cong: positive_integral_cong) + by (simp cong: nn_integral_cong) also have "\ = (\i. emeasure M (F i))" - by (simp add: positive_integral_suminf) + by (simp add: nn_integral_suminf) finally show ?thesis by (simp add: F_def) qed @@ -1560,17 +1560,17 @@ subsubsection {* Distributions *} -lemma positive_integral_distr': +lemma nn_integral_distr': assumes T: "T \ measurable M M'" and f: "f \ borel_measurable (distr M M' T)" "\x. 0 \ f x" - shows "integral\<^sup>P (distr M M' T) f = (\\<^sup>+ x. f (T x) \M)" + shows "integral\<^sup>N (distr M M' T) f = (\\<^sup>+ x. f (T x) \M)" using f proof induct case (cong f g) with T show ?case - apply (subst positive_integral_cong[of _ f g]) + apply (subst nn_integral_cong[of _ f g]) apply simp - apply (subst positive_integral_cong[of _ "\x. f (T x)" "\x. g (T x)"]) + apply (subst nn_integral_cong[of _ "\x. f (T x)" "\x. g (T x)"]) apply (simp add: measurable_def Pi_iff) apply simp done @@ -1579,15 +1579,15 @@ then have eq: "\x. x \ space M \ indicator A (T x) = indicator (T -` A \ space M) x" by (auto simp: indicator_def) from set T show ?case - by (subst positive_integral_cong[OF eq]) - (auto simp add: emeasure_distr intro!: positive_integral_indicator[symmetric] measurable_sets) -qed (simp_all add: measurable_compose[OF T] T positive_integral_cmult positive_integral_add - positive_integral_monotone_convergence_SUP le_fun_def incseq_def) + by (subst nn_integral_cong[OF eq]) + (auto simp add: emeasure_distr intro!: nn_integral_indicator[symmetric] measurable_sets) +qed (simp_all add: measurable_compose[OF T] T nn_integral_cmult nn_integral_add + nn_integral_monotone_convergence_SUP le_fun_def incseq_def) -lemma positive_integral_distr: - "T \ measurable M M' \ f \ borel_measurable M' \ integral\<^sup>P (distr M M' T) f = (\\<^sup>+ x. f (T x) \M)" - by (subst (1 2) positive_integral_max_0[symmetric]) - (simp add: positive_integral_distr') +lemma nn_integral_distr: + "T \ measurable M M' \ f \ borel_measurable M' \ integral\<^sup>N (distr M M' T) f = (\\<^sup>+ x. f (T x) \M)" + by (subst (1 2) nn_integral_max_0[symmetric]) + (simp add: nn_integral_distr') subsubsection {* Counting space *} @@ -1595,26 +1595,26 @@ "simple_function (count_space A) f \ finite (f ` A)" unfolding simple_function_def by simp -lemma positive_integral_count_space: +lemma nn_integral_count_space: assumes A: "finite {a\A. 0 < f a}" - shows "integral\<^sup>P (count_space A) f = (\a|a\A \ 0 < f a. f a)" + shows "integral\<^sup>N (count_space A) f = (\a|a\A \ 0 < f a. f a)" proof - have *: "(\\<^sup>+x. max 0 (f x) \count_space A) = (\\<^sup>+ x. (\a|a\A \ 0 < f a. f a * indicator {a} x) \count_space A)" - by (auto intro!: positive_integral_cong + by (auto intro!: nn_integral_cong simp add: indicator_def if_distrib setsum_cases[OF A] max_def le_less) also have "\ = (\a|a\A \ 0 < f a. \\<^sup>+ x. f a * indicator {a} x \count_space A)" - by (subst positive_integral_setsum) + by (subst nn_integral_setsum) (simp_all add: AE_count_space ereal_zero_le_0_iff less_imp_le) also have "\ = (\a|a\A \ 0 < f a. f a)" - by (auto intro!: setsum_cong simp: positive_integral_cmult_indicator one_ereal_def[symmetric]) - finally show ?thesis by (simp add: positive_integral_max_0) + by (auto intro!: setsum_cong simp: nn_integral_cmult_indicator one_ereal_def[symmetric]) + finally show ?thesis by (simp add: nn_integral_max_0) qed -lemma positive_integral_count_space_finite: +lemma nn_integral_count_space_finite: "finite A \ (\\<^sup>+x. f x \count_space A) = (\a\A. max 0 (f a))" - by (subst positive_integral_max_0[symmetric]) - (auto intro!: setsum_mono_zero_left simp: positive_integral_count_space less_le) + by (subst nn_integral_max_0[symmetric]) + (auto intro!: setsum_mono_zero_left simp: nn_integral_count_space less_le) lemma emeasure_UN_countable: assumes sets: "\i. i \ I \ X i \ sets M" and I: "countable I" @@ -1623,7 +1623,7 @@ proof cases assume "finite I" with sets disj show ?thesis by (subst setsum_emeasure[symmetric]) - (auto intro!: setsum_cong simp add: max_def subset_eq positive_integral_count_space_finite emeasure_nonneg) + (auto intro!: setsum_cong simp add: max_def subset_eq nn_integral_count_space_finite emeasure_nonneg) next assume f: "\ finite I" then have [intro]: "I \ {}" by auto @@ -1648,15 +1648,15 @@ by (auto simp: ereal_zero_less_0_iff indicator_def from_nat_into `I \ {}` simp del: ereal_0_less_1) have "(\\<^sup>+ ia. emeasure M (X ia) * indicator {from_nat_into I i} ia \count_space I) = (if 0 < emeasure M (X (from_nat_into I i)) then emeasure M (X (from_nat_into I i)) else 0)" - by (subst positive_integral_count_space) (simp_all add: eq) + by (subst nn_integral_count_space) (simp_all add: eq) also have "\ = emeasure M (X (from_nat_into I i))" by (simp add: less_le emeasure_nonneg) finally show "emeasure M (X (from_nat_into I i)) = \\<^sup>+ ia. emeasure M (X ia) * indicator {from_nat_into I i} ia \count_space I" .. qed also have "\ = (\\<^sup>+i. emeasure M (X i) \count_space I)" - apply (subst positive_integral_suminf[symmetric]) - apply (auto simp: emeasure_nonneg intro!: positive_integral_cong) + apply (subst nn_integral_suminf[symmetric]) + apply (auto simp: emeasure_nonneg intro!: nn_integral_cong) proof - fix x assume "x \ I" then have "(\i. emeasure M (X x) * indicator {from_nat_into I i} x) = (\i\{to_nat_on I x}. emeasure M (X x) * indicator {from_nat_into I i} x)" @@ -1670,12 +1670,12 @@ subsubsection {* Measures with Restricted Space *} -lemma positive_integral_restrict_space: +lemma nn_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" + shows "nn_integral (restrict_space M \) f = nn_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] + using nn_integral_cong[of M f g] nn_integral_cong[of "restrict_space M \" f g] sets.sets_into_space[OF `\ \ sets M`] by (simp add: subset_eq space_restrict_space) next @@ -1683,19 +1683,19 @@ 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') + by (subst nn_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) + by (cases "c = 0") (simp_all add: measurable_restrict_space1 \ nn_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) + by (simp add: measurable_restrict_space1 \ nn_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) + by (auto simp add: SUP_eq_iff measurable_restrict_space1 \ nn_integral_monotone_convergence_SUP) qed subsubsection {* Measure spaces with an associated density *} @@ -1720,14 +1720,14 @@ lemma density_cong: "f \ borel_measurable M \ f' \ borel_measurable M \ (AE x in M. f x = f' x) \ density M f = density M f'" - unfolding density_def by (auto intro!: measure_of_eq positive_integral_cong_AE sets.space_closed) + unfolding density_def by (auto intro!: measure_of_eq nn_integral_cong_AE sets.space_closed) lemma density_max_0: "density M f = density M (\x. max 0 (f x))" proof - have "\x A. max 0 (f x) * indicator A x = max 0 (f x * indicator A x)" by (auto simp: indicator_def) then show ?thesis - unfolding density_def by (simp add: positive_integral_max_0) + unfolding density_def by (simp add: nn_integral_max_0) qed lemma density_ereal_max_0: "density M (\x. ereal (f x)) = density M (\x. ereal (max 0 (f x)))" @@ -1741,10 +1741,10 @@ proof (rule emeasure_measure_of_sigma) show "sigma_algebra (space M) (sets M)" .. show "positive (sets M) ?\" - using f by (auto simp: positive_def intro!: positive_integral_positive) + using f by (auto simp: positive_def intro!: nn_integral_nonneg) have \_eq: "?\ = (\A. \\<^sup>+ x. max 0 (f x) * indicator A x \M)" (is "?\ = ?\'") - apply (subst positive_integral_max_0[symmetric]) - apply (intro ext positive_integral_cong_AE AE_I2) + apply (subst nn_integral_max_0[symmetric]) + apply (intro ext nn_integral_cong_AE AE_I2) apply (auto simp: indicator_def) done show "countably_additive (sets M) ?\" @@ -1756,9 +1756,9 @@ by (auto simp: set_eq_iff) assume disj: "disjoint_family A" have "(\n. ?\' (A n)) = (\\<^sup>+ x. (\n. max 0 (f x) * indicator (A n) x) \M)" - using f * by (simp add: positive_integral_suminf) + using f * by (simp add: nn_integral_suminf) also have "\ = (\\<^sup>+ x. max 0 (f x) * (\n. indicator (A n) x) \M)" using f - by (auto intro!: suminf_cmult_ereal positive_integral_cong_AE) + by (auto intro!: suminf_cmult_ereal nn_integral_cong_AE) also have "\ = (\\<^sup>+ x. max 0 (f x) * indicator (\n. A n) x \M)" unfolding suminf_indicator[OF disj] .. finally show "(\n. ?\' (A n)) = ?\' (\x. A x)" by simp @@ -1771,15 +1771,15 @@ proof - { assume "A \ sets M" have eq: "(\\<^sup>+x. f x * indicator A x \M) = (\\<^sup>+x. max 0 (f x) * indicator A x \M)" - apply (subst positive_integral_max_0[symmetric]) - apply (intro positive_integral_cong) + apply (subst nn_integral_max_0[symmetric]) + apply (intro nn_integral_cong) apply (auto simp: indicator_def) done have "(\\<^sup>+x. f x * indicator A x \M) = 0 \ emeasure M {x \ space M. max 0 (f x) * indicator A x \ 0} = 0" unfolding eq using f `A \ sets M` - by (intro positive_integral_0_iff) auto + by (intro nn_integral_0_iff) auto also have "\ \ (AE x in M. max 0 (f x) * indicator A x = 0)" using f `A \ sets M` by (intro AE_iff_measurable[OF _ refl, symmetric]) auto @@ -1814,15 +1814,15 @@ (auto elim: eventually_elim2) qed -lemma positive_integral_density': +lemma nn_integral_density': assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" assumes g: "g \ borel_measurable M" "\x. 0 \ g x" - shows "integral\<^sup>P (density M f) g = (\\<^sup>+ x. f x * g x \M)" + shows "integral\<^sup>N (density M f) g = (\\<^sup>+ x. f x * g x \M)" using g proof induct case (cong u v) then show ?case - apply (subst positive_integral_cong[OF cong(3)]) - apply (simp_all cong: positive_integral_cong) + apply (subst nn_integral_cong[OF cong(3)]) + apply (simp_all cong: nn_integral_cong) done next case (set A) then show ?case @@ -1831,31 +1831,31 @@ case (mult u c) moreover have "\x. f x * (c * u x) = c * (f x * u x)" by (simp add: field_simps) ultimately show ?case - using f by (simp add: positive_integral_cmult) + using f by (simp add: nn_integral_cmult) next case (add u v) then have "\x. f x * (v x + u x) = f x * v x + f x * u x" by (simp add: ereal_right_distrib) with add f show ?case - by (auto simp add: positive_integral_add ereal_zero_le_0_iff intro!: positive_integral_add[symmetric]) + by (auto simp add: nn_integral_add ereal_zero_le_0_iff intro!: nn_integral_add[symmetric]) next case (seq U) from f(2) have eq: "AE x in M. f x * (SUP i. U i x) = (SUP i. f x * U i x)" by eventually_elim (simp add: SUP_ereal_cmult seq) from seq f show ?case - apply (simp add: positive_integral_monotone_convergence_SUP) - apply (subst positive_integral_cong_AE[OF eq]) - apply (subst positive_integral_monotone_convergence_SUP_AE) + apply (simp add: nn_integral_monotone_convergence_SUP) + apply (subst nn_integral_cong_AE[OF eq]) + apply (subst nn_integral_monotone_convergence_SUP_AE) apply (auto simp: incseq_def le_fun_def intro!: ereal_mult_left_mono) done qed -lemma positive_integral_density: +lemma nn_integral_density: "f \ borel_measurable M \ AE x in M. 0 \ f x \ g' \ borel_measurable M \ - integral\<^sup>P (density M f) g' = (\\<^sup>+ x. f x * g' x \M)" - by (subst (1 2) positive_integral_max_0[symmetric]) - (auto intro!: positive_integral_cong_AE - simp: measurable_If max_def ereal_zero_le_0_iff positive_integral_density') + integral\<^sup>N (density M f) g' = (\\<^sup>+ x. f x * g' x \M)" + by (subst (1 2) nn_integral_max_0[symmetric]) + (auto intro!: nn_integral_cong_AE + simp: measurable_If max_def ereal_zero_le_0_iff nn_integral_density') lemma emeasure_restricted: assumes S: "S \ sets M" and X: "X \ sets M" @@ -1864,7 +1864,7 @@ have "emeasure (density M (indicator S)) X = (\\<^sup>+x. indicator S x * indicator X x \M)" using S X by (simp add: emeasure_density) also have "\ = (\\<^sup>+x. indicator (S \ X) x \M)" - by (auto intro!: positive_integral_cong simp: indicator_def) + by (auto intro!: nn_integral_cong simp: indicator_def) also have "\ = emeasure M (S \ X)" using S X by (simp add: sets.Int) finally show ?thesis . @@ -1880,7 +1880,7 @@ lemma emeasure_density_const: "A \ sets M \ 0 \ c \ emeasure (density M (\_. c)) A = c * emeasure M A" - by (auto simp: positive_integral_cmult_indicator emeasure_density) + by (auto simp: nn_integral_cmult_indicator emeasure_density) lemma measure_density_const: "A \ sets M \ 0 < c \ c \ \ \ measure (density M (\_. c)) A = real c * measure M A" @@ -1889,7 +1889,7 @@ lemma density_density_eq: "f \ borel_measurable M \ g \ borel_measurable M \ AE x in M. 0 \ f x \ density (density M f) g = density M (\x. f x * g x)" - by (auto intro!: measure_eqI simp: emeasure_density positive_integral_density ac_simps) + by (auto intro!: measure_eqI simp: emeasure_density nn_integral_density ac_simps) lemma distr_density_distr: assumes T: "T \ measurable M M'" and T': "T' \ measurable M' M" @@ -1904,7 +1904,7 @@ using T inv by (auto simp: indicator_def measurable_space) } with A T T' f show "emeasure ?R A = emeasure ?L A" by (simp add: measurable_comp emeasure_density emeasure_distr - positive_integral_distr measurable_sets cong: positive_integral_cong) + nn_integral_distr measurable_sets cong: nn_integral_cong) qed simp lemma density_density_divide: @@ -1951,7 +1951,7 @@ have "{a. (a \ X \ a \ A \ 0 < f a) \ a \ X} = {a\X. 0 < f a}" using `X \ A` by auto with A show ?thesis - by (simp add: emeasure_density positive_integral_count_space ereal_zero_le_0_iff + by (simp add: emeasure_density nn_integral_count_space ereal_zero_le_0_iff point_measure_def indicator_def) qed @@ -1973,14 +1973,14 @@ unfolding point_measure_def by (subst AE_density) (auto simp: AE_density AE_count_space point_measure_def) -lemma positive_integral_point_measure: +lemma nn_integral_point_measure: "finite {a\A. 0 < f a \ 0 < g a} \ - integral\<^sup>P (point_measure A f) g = (\a|a\A \ 0 < f a \ 0 < g a. f a * g a)" + integral\<^sup>N (point_measure A f) g = (\a|a\A \ 0 < f a \ 0 < g a. f a * g a)" unfolding point_measure_def apply (subst density_max_0) - apply (subst positive_integral_density) - apply (simp_all add: AE_count_space positive_integral_density) - apply (subst positive_integral_count_space ) + apply (subst nn_integral_density) + apply (simp_all add: AE_count_space nn_integral_density) + apply (subst nn_integral_count_space ) apply (auto intro!: setsum_cong simp: max_def ereal_zero_less_0_iff) apply (rule finite_subset) prefer 2 @@ -1988,10 +1988,10 @@ apply auto done -lemma positive_integral_point_measure_finite: +lemma nn_integral_point_measure_finite: "finite A \ (\a. a \ A \ 0 \ f a) \ (\a. a \ A \ 0 \ g a) \ - integral\<^sup>P (point_measure A f) g = (\a\A. f a * g a)" - by (subst positive_integral_point_measure) (auto intro!: setsum_mono_zero_left simp: less_le) + integral\<^sup>N (point_measure A f) g = (\a\A. f a * g a)" + by (subst nn_integral_point_measure) (auto intro!: setsum_mono_zero_left simp: less_le) subsubsection {* Uniform measure *} @@ -2008,10 +2008,10 @@ proof - from A B have "emeasure (uniform_measure M A) B = (\\<^sup>+x. (1 / emeasure M A) * indicator (A \ B) x \M)" by (auto simp add: uniform_measure_def emeasure_density split: split_indicator - intro!: positive_integral_cong) + intro!: nn_integral_cong) also have "\ = emeasure M (A \ B) / emeasure M A" using A B - by (subst positive_integral_cmult_indicator) (simp_all add: sets.Int emeasure_nonneg) + by (subst nn_integral_cmult_indicator) (simp_all add: sets.Int emeasure_nonneg) finally show ?thesis . qed diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Probability_Measure.thy --- a/src/HOL/Probability/Probability_Measure.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Probability_Measure.thy Mon May 19 14:26:58 2014 +0200 @@ -290,7 +290,7 @@ simp: disjoint_family_on_def) also have "\ = (\\<^sup>+i. \

(x in M. P i x) \count_space I)" unfolding emeasure_eq_measure using disj - by (intro positive_integral_cong ereal.inject[THEN iffD2] prob_eq_AE) + by (intro nn_integral_cong ereal.inject[THEN iffD2] prob_eq_AE) (auto intro!: sets.sets_Collect_countable_Ex' sets.sets_Collect_conj sets.sets_Collect_countable_Ex1' I sets)+ finally show ?thesis . qed @@ -402,9 +402,9 @@ also have "\ = emeasure (density (count_space A) P) {a}" using X by (simp add: distributed_distr_eq_density) also have "\ = (\\<^sup>+x. P a * indicator {a} x \count_space A)" - using X a by (auto simp add: emeasure_density distributed_def indicator_def intro!: positive_integral_cong) + using X a by (auto simp add: emeasure_density distributed_def indicator_def intro!: nn_integral_cong) also have "\ = P a" - using X a by (subst positive_integral_cmult_indicator) (auto simp: distributed_def one_ereal_def[symmetric] AE_count_space) + using X a by (subst nn_integral_cmult_indicator) (auto simp: distributed_def one_ereal_def[symmetric] AE_count_space) finally show ?thesis .. qed @@ -446,10 +446,10 @@ by (auto simp: distributed_AE distributed_distr_eq_density[symmetric] emeasure_density[symmetric] emeasure_distr) -lemma distributed_positive_integral: +lemma distributed_nn_integral: "distributed M N X f \ g \ borel_measurable N \ (\\<^sup>+x. f x * g x \N) = (\\<^sup>+x. g (X x) \M)" by (auto simp: distributed_AE - distributed_distr_eq_density[symmetric] positive_integral_density[symmetric] positive_integral_distr) + distributed_distr_eq_density[symmetric] nn_integral_density[symmetric] nn_integral_distr) lemma distributed_integral: "distributed M N X f \ g \ borel_measurable N \ (\x. f x * g x \N) = (\x. g (X x) \M)" @@ -520,10 +520,10 @@ have "emeasure ?L E = emeasure M {x \ space M. X x \ A \ Y x \ B}" by (auto intro!: arg_cong[where f="emeasure M"] simp add: emeasure_distr measurable_Pair) also have "\ = (\\<^sup>+x. (\\<^sup>+y. (f (x, y) * indicator B y) * indicator A x \T) \S)" - using f by (auto simp add: eq positive_integral_multc intro!: positive_integral_cong) + using f by (auto simp add: eq nn_integral_multc intro!: nn_integral_cong) also have "\ = emeasure ?R E" - by (auto simp add: emeasure_density T.positive_integral_fst[symmetric] - intro!: positive_integral_cong split: split_indicator) + by (auto simp add: emeasure_density T.nn_integral_fst[symmetric] + intro!: nn_integral_cong split: split_indicator) finally show "emeasure ?L E = emeasure ?R E" . qed qed (auto simp: f) @@ -564,12 +564,12 @@ using Pxy A by (intro distributed_emeasure) auto finally have "emeasure M ((\x. (Y x, X x)) -` A \ space M) = (\\<^sup>+ x. Pxy x * indicator A (snd x, fst x) \(S \\<^sub>M T))" - by (auto intro!: positive_integral_cong split: split_indicator) } + by (auto intro!: nn_integral_cong split: split_indicator) } note * = this show "distr M ?D (\x. (Y x, X x)) = density ?D (\(x, y). Pxy (y, x))" apply (intro measure_eqI) apply (simp_all add: emeasure_distr[OF 2] emeasure_density[OF 1]) - apply (subst positive_integral_distr) + apply (subst nn_integral_distr) apply (auto intro!: * simp: comp_def split_beta) done qed @@ -590,13 +590,13 @@ show X: "X \ measurable M S" by simp show borel: "Px \ borel_measurable S" - by (auto intro!: T.positive_integral_fst simp: Px_def) + by (auto intro!: T.nn_integral_fst simp: Px_def) interpret Pxy: prob_space "distr M (S \\<^sub>M T) (\x. (X x, Y x))" by (intro prob_space_distr) simp have "(\\<^sup>+ x. max 0 (- Pxy x) \(S \\<^sub>M T)) = (\\<^sup>+ x. 0 \(S \\<^sub>M T))" using Pxy - by (intro positive_integral_cong_AE) (auto simp: max_def dest: distributed_AE) + by (intro nn_integral_cong_AE) (auto simp: max_def dest: distributed_AE) show "distr M S X = density S Px" proof (rule measure_eqI) @@ -608,18 +608,18 @@ using Pxy by (simp add: distributed_def) also have "\ = \\<^sup>+ x. \\<^sup>+ y. Pxy (x, y) * indicator (A \ space T) (x, y) \T \S" using A borel Pxy - by (simp add: emeasure_density T.positive_integral_fst[symmetric]) + by (simp add: emeasure_density T.nn_integral_fst[symmetric]) also have "\ = \\<^sup>+ x. Px x * indicator A x \S" - apply (rule positive_integral_cong_AE) + apply (rule nn_integral_cong_AE) using Pxy[THEN distributed_AE, THEN ST.AE_pair] AE_space proof eventually_elim fix x assume "x \ space S" "AE y in T. 0 \ Pxy (x, y)" moreover have eq: "\y. y \ space T \ indicator (A \ space T) (x, y) = indicator A x" by (auto simp: indicator_def) ultimately have "(\\<^sup>+ y. Pxy (x, y) * indicator (A \ space T) (x, y) \T) = (\\<^sup>+ y. Pxy (x, y) \T) * indicator A x" - by (simp add: eq positive_integral_multc cong: positive_integral_cong) + by (simp add: eq nn_integral_multc cong: nn_integral_cong) also have "(\\<^sup>+ y. Pxy (x, y) \T) = Px x" - by (simp add: Px_def ereal_real positive_integral_positive) + by (simp add: Px_def ereal_real nn_integral_nonneg) finally show "(\\<^sup>+ y. Pxy (x, y) * indicator (A \ space T) (x, y) \T) = Px x * indicator A x" . qed finally show "emeasure (distr M S X) A = emeasure (density S Px) A" @@ -627,7 +627,7 @@ qed simp show "AE x in S. 0 \ Px x" - by (simp add: Px_def positive_integral_positive real_of_ereal_pos) + by (simp add: Px_def nn_integral_nonneg real_of_ereal_pos) qed lemma (in prob_space) distr_marginal2: @@ -727,10 +727,10 @@ intro!: arg_cong[where f=prob]) also have "\ = (\\<^sup>+x. ereal (P' a) * indicator {a} x \S)" using A X a - by (subst positive_integral_cmult_indicator) + by (subst nn_integral_cmult_indicator) (auto simp: S_def P'_def simple_distributed_def simple_functionD measure_nonneg) also have "\ = (\\<^sup>+x. ereal (P' x) * indicator {a} x \S)" - by (auto simp: indicator_def intro!: positive_integral_cong) + by (auto simp: indicator_def intro!: nn_integral_cong) also have "\ = emeasure (density S P') {a}" using a A by (intro emeasure_density[symmetric]) (auto simp: S_def) finally show "emeasure (distr M S X) {a} = emeasure (density S P') {a}" . @@ -866,7 +866,7 @@ Pxy[THEN simple_distributed, THEN distributed_real_AE] show ?thesis unfolding AE_count_space - apply (auto simp add: positive_integral_count_space_finite * intro!: setsum_cong split: split_max) + apply (auto simp add: nn_integral_count_space_finite * intro!: setsum_cong split: split_max) done qed diff -r 61855ade6c7e -r 891e992e510f src/HOL/Probability/Radon_Nikodym.thy --- a/src/HOL/Probability/Radon_Nikodym.thy Mon May 19 13:53:58 2014 +0200 +++ b/src/HOL/Probability/Radon_Nikodym.thy Mon May 19 14:26:58 2014 +0200 @@ -44,7 +44,7 @@ qed fact lemma (in sigma_finite_measure) Ex_finite_integrable_function: - shows "\h\borel_measurable M. integral\<^sup>P M h \ \ \ (\x\space M. 0 < h x \ h x < \) \ (\x. 0 \ h x)" + shows "\h\borel_measurable M. integral\<^sup>N M h \ \ \ (\x\space M. 0 < h x \ h x < \) \ (\x. 0 \ h x)" proof - obtain A :: "nat \ 'a set" where range[measurable]: "range A \ sets M" and @@ -67,8 +67,8 @@ proof (safe intro!: bexI[of _ ?h] del: notI) have "\i. A i \ sets M" using range by fastforce+ - then have "integral\<^sup>P M ?h = (\i. n i * emeasure M (A i))" using pos - by (simp add: positive_integral_suminf positive_integral_cmult_indicator) + then have "integral\<^sup>N M ?h = (\i. n i * emeasure M (A i))" using pos + by (simp add: nn_integral_suminf nn_integral_cmult_indicator) also have "\ \ (\i. (1 / 2)^Suc i)" proof (rule suminf_le_pos) fix N @@ -82,7 +82,7 @@ finally show "n N * emeasure M (A N) \ (1 / 2) ^ Suc N" . show "0 \ n N * emeasure M (A N)" using n[of N] `A N \ sets M` by (simp add: emeasure_nonneg) qed - finally show "integral\<^sup>P M ?h \ \" unfolding suminf_half_series_ereal by auto + finally show "integral\<^sup>N M ?h \ \" unfolding suminf_half_series_ereal by auto next { fix x assume "x \ space M" then obtain i where "x \ A i" using space[symmetric] by auto @@ -317,7 +317,7 @@ (\\<^sup>+x. g x * indicator (?A \ A) x \M) + (\\<^sup>+x. f x * indicator ((space M - ?A) \ A) x \M)" using f g sets unfolding G_def - by (auto cong: positive_integral_cong intro!: positive_integral_add) + by (auto cong: nn_integral_cong intro!: nn_integral_add) also have "\ \ N (?A \ A) + N ((space M - ?A) \ A)" using f g sets unfolding G_def by (auto intro!: add_mono) also have "\ = N A" @@ -338,31 +338,31 @@ fix A assume "A \ sets M" have "(\\<^sup>+x. (SUP i. f i x) * indicator A x \M) = (\\<^sup>+x. (SUP i. f i x * indicator A x) \M)" - by (intro positive_integral_cong) (simp split: split_indicator) + by (intro nn_integral_cong) (simp split: split_indicator) also have "\ = (SUP i. (\\<^sup>+x. f i x * indicator A x \M))" using `incseq f` f `A \ sets M` - by (intro positive_integral_monotone_convergence_SUP) + by (intro nn_integral_monotone_convergence_SUP) (auto simp: G_def incseq_Suc_iff le_fun_def split: split_indicator) finally show "(\\<^sup>+x. (SUP i. f i x) * indicator A x \M) \ N A" using f `A \ sets M` by (auto intro!: SUP_least simp: G_def) qed } note SUP_in_G = this - let ?y = "SUP g : G. integral\<^sup>P M g" + let ?y = "SUP g : G. integral\<^sup>N M g" have y_le: "?y \ N (space M)" unfolding G_def proof (safe intro!: SUP_least) fix g assume "\A\sets M. (\\<^sup>+x. g x * indicator A x \M) \ N A" - from this[THEN bspec, OF sets.top] show "integral\<^sup>P M g \ N (space M)" - by (simp cong: positive_integral_cong) + from this[THEN bspec, OF sets.top] show "integral\<^sup>N M g \ N (space M)" + by (simp cong: nn_integral_cong) qed - from SUP_countable_SUP [OF `G \ {}`, of "integral\<^sup>P M"] guess ys .. note ys = this - then have "\n. \g. g\G \ integral\<^sup>P M g = ys n" + from SUP_countable_SUP [OF `G \ {}`, of "integral\<^sup>N M"] guess ys .. note ys = this + then have "\n. \g. g\G \ integral\<^sup>N M g = ys n" proof safe - fix n assume "range ys \ integral\<^sup>P M ` G" - hence "ys n \ integral\<^sup>P M ` G" by auto - thus "\g. g\G \ integral\<^sup>P M g = ys n" by auto + fix n assume "range ys \ integral\<^sup>N M ` G" + hence "ys n \ integral\<^sup>N M ` G" by auto + thus "\g. g\G \ integral\<^sup>N M g = ys n" by auto qed - from choice[OF this] obtain gs where "\i. gs i \ G" "\n. integral\<^sup>P M (gs n) = ys n" by auto - hence y_eq: "?y = (SUP i. integral\<^sup>P M (gs i))" using ys by auto + from choice[OF this] obtain gs where "\i. gs i \ G" "\n. integral\<^sup>N M (gs n) = ys n" by auto + hence y_eq: "?y = (SUP i. integral\<^sup>N M (gs i))" using ys by auto let ?g = "\i x. Max ((\n. gs n x) ` {..i})" def f \ "\x. SUP i. ?g i x" let ?F = "\A x. f x * indicator A x" @@ -380,17 +380,17 @@ by (auto intro!: incseq_SucI le_funI simp add: atMost_Suc) from SUP_in_G[OF this g_in_G] have [measurable]: "f \ G" unfolding f_def . then have [simp, intro]: "f \ borel_measurable M" unfolding G_def by auto - have "integral\<^sup>P M f = (SUP i. integral\<^sup>P M (?g i))" unfolding f_def + have "integral\<^sup>N M f = (SUP i. integral\<^sup>N M (?g i))" unfolding f_def using g_in_G `incseq ?g` - by (auto intro!: positive_integral_monotone_convergence_SUP simp: G_def) + by (auto intro!: nn_integral_monotone_convergence_SUP simp: G_def) also have "\ = ?y" proof (rule antisym) - show "(SUP i. integral\<^sup>P M (?g i)) \ ?y" + show "(SUP i. integral\<^sup>N M (?g i)) \ ?y" using g_in_G by (auto intro: SUP_mono) - show "?y \ (SUP i. integral\<^sup>P M (?g i))" unfolding y_eq - by (auto intro!: SUP_mono positive_integral_mono Max_ge) + show "?y \ (SUP i. integral\<^sup>N M (?g i))" unfolding y_eq + by (auto intro!: SUP_mono nn_integral_mono Max_ge) qed - finally have int_f_eq_y: "integral\<^sup>P M f = ?y" . + finally have int_f_eq_y: "integral\<^sup>N M f = ?y" . have "\x. 0 \ f x" unfolding f_def using `\i. gs i \ G` by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) @@ -401,12 +401,12 @@ have emeasure_M: "\A. A \ sets M \ emeasure ?M A = ?t A" proof (subst emeasure_diff_measure) from f_le_N[of "space M"] show "finite_measure N" "finite_measure (density M f)" - by (auto intro!: finite_measureI simp: emeasure_density cong: positive_integral_cong) + by (auto intro!: finite_measureI simp: emeasure_density cong: nn_integral_cong) next fix B assume "B \ sets N" with f_le_N[of B] show "emeasure (density M f) B \ emeasure N B" - by (auto simp: sets_eq emeasure_density cong: positive_integral_cong) + by (auto simp: sets_eq emeasure_density cong: nn_integral_cong) qed (auto simp: sets_eq emeasure_density) - from emeasure_M[of "space M"] N.finite_emeasure_space positive_integral_positive[of M "?F (space M)"] + from emeasure_M[of "space M"] N.finite_emeasure_space nn_integral_nonneg[of M "?F (space M)"] interpret M': finite_measure ?M by (auto intro!: finite_measureI simp: sets_eq_imp_space_eq[OF sets_eq] N.emeasure_eq_measure ereal_minus_eq_PInfty_iff) @@ -417,7 +417,7 @@ unfolding absolutely_continuous_def by auto moreover from A_M A_N have "(\\<^sup>+ x. ?F A x \M) \ N A" using `f \ G` by (auto simp: G_def) ultimately have "N A - (\\<^sup>+ x. ?F A x \M) = 0" - using positive_integral_positive[of M] by (auto intro!: antisym) + using nn_integral_nonneg[of M] by (auto intro!: antisym) then show "A \ null_sets ?M" using A_M by (simp add: emeasure_M null_sets_def sets_eq) qed @@ -462,11 +462,11 @@ hence "A \ A0 \ sets M" using `A0 \ sets M` by auto have "(\\<^sup>+x. ?f0 x * indicator A x \M) = (\\<^sup>+x. f x * indicator A x + b * indicator (A \ A0) x \M)" - by (auto intro!: positive_integral_cong split: split_indicator) + by (auto intro!: nn_integral_cong split: split_indicator) hence "(\\<^sup>+x. ?f0 x * indicator A x \M) = (\\<^sup>+x. f x * indicator A x \M) + b * emeasure M (A \ A0)" using `A0 \ sets M` `A \ A0 \ sets M` A b `f \ G` - by (simp add: positive_integral_add positive_integral_cmult_indicator G_def) } + by (simp add: nn_integral_add nn_integral_cmult_indicator G_def) } note f0_eq = this { fix A assume A: "A \ sets M" hence "A \ A0 \ sets M" using `A0 \ sets M` by auto @@ -480,11 +480,11 @@ by (auto intro!: add_left_mono simp: sets_eq) also have "\ \ N A" unfolding emeasure_M[OF `A \ sets M`] - using f_le_v N.emeasure_eq_measure[of A] positive_integral_positive[of M "?F A"] + using f_le_v N.emeasure_eq_measure[of A] nn_integral_nonneg[of M "?F A"] by (cases "\\<^sup>+x. ?F A x \M", cases "N A") auto finally have "(\\<^sup>+x. ?f0 x * indicator A x \M) \ N A" . } hence "?f0 \ G" using `A0 \ sets M` b `f \ G` by (auto simp: G_def) - have int_f_finite: "integral\<^sup>P M f \ \" + have int_f_finite: "integral\<^sup>N M f \ \" by (metis N.emeasure_finite ereal_infty_less_eq2(1) int_f_eq_y y_le) have "0 < ?M (space M) - emeasure ?Mb (space M)" using pos_t @@ -503,13 +503,13 @@ by (auto simp: absolutely_continuous_def null_sets_def) then have "0 < emeasure M A0" using emeasure_nonneg[of M A0] by auto hence "0 < b * emeasure M A0" using b by (auto simp: ereal_zero_less_0_iff) - with int_f_finite have "?y + 0 < integral\<^sup>P M f + b * emeasure M A0" unfolding int_f_eq_y + with int_f_finite have "?y + 0 < integral\<^sup>N M f + b * emeasure M A0" unfolding int_f_eq_y using `f \ G` - by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 positive_integral_positive) - also have "\ = integral\<^sup>P M ?f0" using f0_eq[OF sets.top] `A0 \ sets M` sets.sets_into_space - by (simp cong: positive_integral_cong) - finally have "?y < integral\<^sup>P M ?f0" by simp - moreover from `?f0 \ G` have "integral\<^sup>P M ?f0 \ ?y" by (auto intro!: SUP_upper) + by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 nn_integral_nonneg) + also have "\ = integral\<^sup>N M ?f0" using f0_eq[OF sets.top] `A0 \ sets M` sets.sets_into_space + by (simp cong: nn_integral_cong) + finally have "?y < integral\<^sup>N M ?f0" by simp + moreover from `?f0 \ G` have "integral\<^sup>N M ?f0 \ ?y" by (auto intro!: SUP_upper) ultimately show False by auto qed let ?f = "\x. max 0 (f x)" @@ -520,7 +520,7 @@ fix A assume A: "A\sets (density M ?f)" then show "emeasure (density M ?f) A = emeasure N A" using `f \ G` A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] - by (cases "integral\<^sup>P M (?F A)") + by (cases "integral\<^sup>N M (?F A)") (auto intro!: antisym simp add: emeasure_density G_def emeasure_M density_max_0[symmetric]) qed auto qed @@ -669,10 +669,10 @@ proof (intro allI finite_measure.Radon_Nikodym_finite_measure) fix i from Q show "finite_measure (?M i)" - by (auto intro!: finite_measureI cong: positive_integral_cong + by (auto intro!: finite_measureI cong: nn_integral_cong simp add: emeasure_density subset_eq sets_eq) from Q have "emeasure (?N i) (space N) = emeasure N (Q i)" - by (simp add: sets_eq[symmetric] emeasure_density subset_eq cong: positive_integral_cong) + by (simp add: sets_eq[symmetric] emeasure_density subset_eq cong: nn_integral_cong) with Q_fin show "finite_measure (?N i)" by (auto intro!: finite_measureI) show "sets (?N i) = sets (?M i)" by (simp add: sets_eq) @@ -688,8 +688,8 @@ by force { fix A i assume A: "A \ sets M" with Q borel have "(\\<^sup>+x. f i x * indicator (Q i \ A) x \M) = emeasure (density (?M i) (f i)) A" - by (auto simp add: emeasure_density positive_integral_density subset_eq - intro!: positive_integral_cong split: split_indicator) + by (auto simp add: emeasure_density nn_integral_density subset_eq + intro!: nn_integral_cong split: split_indicator) also have "\ = emeasure N (Q i \ A)" using A Q by (simp add: f_density emeasure_restricted subset_eq sets_eq) finally have "emeasure N (Q i \ A) = (\\<^sup>+x. f i x * indicator (Q i \ A) x \M)" .. } @@ -709,13 +709,13 @@ "\i. AE x in M. 0 \ f i x * indicator (Q i \ A) x" using borel Qi Q0(1) `A \ sets M` by (auto intro!: borel_measurable_ereal_times) have "(\\<^sup>+x. ?f x * indicator A x \M) = (\\<^sup>+x. (\i. f i x * indicator (Q i \ A) x) + \ * indicator (Q0 \ A) x \M)" - using borel by (intro positive_integral_cong) (auto simp: indicator_def) + using borel by (intro nn_integral_cong) (auto simp: indicator_def) also have "\ = (\\<^sup>+x. (\i. f i x * indicator (Q i \ A) x) \M) + \ * emeasure M (Q0 \ A)" using borel Qi Q0(1) `A \ sets M` - by (subst positive_integral_add) (auto simp del: ereal_infty_mult - simp add: positive_integral_cmult_indicator sets.Int intro!: suminf_0_le) + by (subst nn_integral_add) (auto simp del: ereal_infty_mult + simp add: nn_integral_cmult_indicator sets.Int intro!: suminf_0_le) also have "\ = (\i. N (Q i \ A)) + \ * emeasure M (Q0 \ A)" - by (subst integral_eq[OF `A \ sets M`], subst positive_integral_suminf) auto + by (subst integral_eq[OF `A \ sets M`], subst nn_integral_suminf) auto finally have "(\\<^sup>+x. ?f x * indicator A x \M) = (\i. N (Q i \ A)) + \ * emeasure M (Q0 \ A)" . moreover have "(\i. N (Q i \ A)) = N ((\i. Q i) \ A)" using Q Q_sets `A \ sets M` @@ -742,7 +742,7 @@ shows "\f \ borel_measurable M. (\x. 0 \ f x) \ density M f = N" proof - from Ex_finite_integrable_function - obtain h where finite: "integral\<^sup>P M h \ \" and + obtain h where finite: "integral\<^sup>N M h \ \" and borel: "h \ borel_measurable M" and nn: "\x. 0 \ h x" and pos: "\x. x \ space M \ 0 < h x" and @@ -750,7 +750,7 @@ let ?T = "\A. (\\<^sup>+x. h x * indicator A x \M)" let ?MT = "density M h" from borel finite nn interpret T: finite_measure ?MT - by (auto intro!: finite_measureI cong: positive_integral_cong simp: emeasure_density) + by (auto intro!: finite_measureI cong: nn_integral_cong simp: emeasure_density) have "absolutely_continuous ?MT N" "sets N = sets ?MT" proof (unfold absolutely_continuous_def, safe) fix A assume "A \ null_sets ?MT" @@ -774,7 +774,7 @@ lemma finite_density_unique: assumes borel: "f \ borel_measurable M" "g \ borel_measurable M" assumes pos: "AE x in M. 0 \ f x" "AE x in M. 0 \ g x" - and fin: "integral\<^sup>P M f \ \" + and fin: "integral\<^sup>N M f \ \" shows "density M f = density M g \ (AE x in M. f x = g x)" proof (intro iffI ballI) fix A assume eq: "AE x in M. f x = g x" @@ -786,19 +786,19 @@ with borel have eq: "\A\sets M. ?P f A = ?P g A" by (simp add: emeasure_density[symmetric]) from this[THEN bspec, OF sets.top] fin - have g_fin: "integral\<^sup>P M g \ \" by (simp cong: positive_integral_cong) + have g_fin: "integral\<^sup>N M g \ \" by (simp cong: nn_integral_cong) { fix f g assume borel: "f \ borel_measurable M" "g \ borel_measurable M" and pos: "AE x in M. 0 \ f x" "AE x in M. 0 \ g x" - and g_fin: "integral\<^sup>P M g \ \" and eq: "\A\sets M. ?P f A = ?P g A" + and g_fin: "integral\<^sup>N M g \ \" and eq: "\A\sets M. ?P f A = ?P g A" let ?N = "{x\space M. g x < f x}" have N: "?N \ sets M" using borel by simp - have "?P g ?N \ integral\<^sup>P M g" using pos - by (intro positive_integral_mono_AE) (auto split: split_indicator) + have "?P g ?N \ integral\<^sup>N M g" using pos + by (intro nn_integral_mono_AE) (auto split: split_indicator) then have Pg_fin: "?P g ?N \ \" using g_fin by auto have "?P (\x. (f x - g x)) ?N = (\\<^sup>+x. f x * indicator ?N x - g x * indicator ?N x \M)" - by (auto intro!: positive_integral_cong simp: indicator_def) + by (auto intro!: nn_integral_cong simp: indicator_def) also have "\ = ?P f ?N - ?P g ?N" - proof (rule positive_integral_diff) + proof (rule nn_integral_diff) show "(\x. f x * indicator ?N x) \ borel_measurable M" "(\x. g x * indicator ?N x) \ borel_measurable M" using borel N by auto show "AE x in M. g x * indicator ?N x \ f x * indicator ?N x" @@ -806,10 +806,10 @@ using pos by (auto split: split_indicator) qed fact also have "\ = 0" - unfolding eq[THEN bspec, OF N] using positive_integral_positive[of M] Pg_fin by auto + unfolding eq[THEN bspec, OF N] using nn_integral_nonneg[of M] Pg_fin by auto finally have "AE x in M. f x \ g x" - using pos borel positive_integral_PInf_AE[OF borel(2) g_fin] - by (subst (asm) positive_integral_0_iff_AE) + using pos borel nn_integral_PInf_AE[OF borel(2) g_fin] + by (subst (asm) nn_integral_0_iff_AE) (auto split: split_indicator simp: not_less ereal_minus_le_iff) } from this[OF borel pos g_fin eq] this[OF borel(2,1) pos(2,1) fin] eq show "AE x in M. f x = g x" by auto @@ -856,9 +856,9 @@ using borel Q0(1) by auto have "?N (?A i) \ (\\<^sup>+x. (i::ereal) * indicator (?A i) x \M)" unfolding eq[OF `?A i \ sets M`] - by (auto intro!: positive_integral_mono simp: indicator_def) + by (auto intro!: nn_integral_mono simp: indicator_def) also have "\ = i * emeasure M (?A i)" - using `?A i \ sets M` by (auto intro!: positive_integral_cmult_indicator) + using `?A i \ sets M` by (auto intro!: nn_integral_cmult_indicator) also have "\ < \" using emeasure_real[of "?A i"] by simp finally have "?N (?A i) \ \" by simp then show "?A i \ null_sets M" using in_Q0[OF `?A i \ sets M`] `?A i \ sets M` by auto @@ -888,35 +888,35 @@ shows "AE x in M. f x = f' x" proof - obtain h where h_borel: "h \ borel_measurable M" - and fin: "integral\<^sup>P M h \ \" and pos: "\x. x \ space M \ 0 < h x \ h x < \" "\x. 0 \ h x" + and fin: "integral\<^sup>N M h \ \" and pos: "\x. x \ space M \ 0 < h x \ h x < \" "\x. 0 \ h x" using Ex_finite_integrable_function by auto then have h_nn: "AE x in M. 0 \ h x" by auto let ?H = "density M h" interpret h: finite_measure ?H using fin h_borel pos - by (intro finite_measureI) (simp cong: positive_integral_cong emeasure_density add: fin) + by (intro finite_measureI) (simp cong: nn_integral_cong emeasure_density add: fin) let ?fM = "density M f" let ?f'M = "density M f'" { fix A assume "A \ sets M" then have "{x \ space M. h x * indicator A x \ 0} = A" using pos(1) sets.sets_into_space by (force simp: indicator_def) then have "(\\<^sup>+x. h x * indicator A x \M) = 0 \ A \ null_sets M" - using h_borel `A \ sets M` h_nn by (subst positive_integral_0_iff) auto } + using h_borel `A \ sets M` h_nn by (subst nn_integral_0_iff) auto } note h_null_sets = this { fix A assume "A \ sets M" have "(\\<^sup>+x. f x * (h x * indicator A x) \M) = (\\<^sup>+x. h x * indicator A x \?fM)" using `A \ sets M` h_borel h_nn f f' - by (intro positive_integral_density[symmetric]) auto + by (intro nn_integral_density[symmetric]) auto also have "\ = (\\<^sup>+x. h x * indicator A x \?f'M)" by (simp_all add: density_eq) also have "\ = (\\<^sup>+x. f' x * (h x * indicator A x) \M)" using `A \ sets M` h_borel h_nn f f' - by (intro positive_integral_density) auto + by (intro nn_integral_density) auto finally have "(\\<^sup>+x. h x * (f x * indicator A x) \M) = (\\<^sup>+x. h x * (f' x * indicator A x) \M)" by (simp add: ac_simps) then have "(\\<^sup>+x. (f x * indicator A x) \?H) = (\\<^sup>+x. (f' x * indicator A x) \?H)" using `A \ sets M` h_borel h_nn f f' - by (subst (asm) (1 2) positive_integral_density[symmetric]) auto } + by (subst (asm) (1 2) nn_integral_density[symmetric]) auto } then have "AE x in ?H. f x = f' x" using h_borel h_nn f f' by (intro h.density_unique_finite_measure absolutely_continuous_AE[of M]) (auto simp add: AE_density) @@ -975,17 +975,17 @@ assume "sigma_finite_measure ?N" then interpret N: sigma_finite_measure ?N . from N.Ex_finite_integrable_function obtain h where - h: "h \ borel_measurable M" "integral\<^sup>P ?N h \ \" and + h: "h \ borel_measurable M" "integral\<^sup>N ?N h \ \" and h_nn: "\x. 0 \ h x" and fin: "\x\space M. 0 < h x \ h x < \" by auto have "AE x in M. f x * h x \ \" proof (rule AE_I') - have "integral\<^sup>P ?N h = (\\<^sup>+x. f x * h x \M)" using f h h_nn - by (auto intro!: positive_integral_density) + have "integral\<^sup>N ?N h = (\\<^sup>+x. f x * h x \M)" using f h h_nn + by (auto intro!: nn_integral_density) then have "(\\<^sup>+x. f x * h x \M) \ \" using h(2) by simp then show "(\x. f x * h x) -` {\} \ space M \ null_sets M" - using f h(1) by (auto intro!: positive_integral_PInf borel_measurable_vimage) + using f h(1) by (auto intro!: nn_integral_PInf borel_measurable_vimage) qed auto then show "AE x in M. f x \ \" using fin by (auto elim!: AE_Ball_mp) @@ -1036,14 +1036,14 @@ case 0 have "AE x in M. f x * indicator (A i \ Q j) x = 0" using AE by (auto simp: A_def `i = 0`) - from positive_integral_cong_AE[OF this] show ?thesis by simp + from nn_integral_cong_AE[OF this] show ?thesis by simp next case (Suc n) then have "(\\<^sup>+x. f x * indicator (A i \ Q j) x \M) \ (\\<^sup>+x. (Suc n :: ereal) * indicator (Q j) x \M)" - by (auto intro!: positive_integral_mono simp: indicator_def A_def real_eq_of_nat) + by (auto intro!: nn_integral_mono simp: indicator_def A_def real_eq_of_nat) also have "\ = Suc n * emeasure M (Q j)" - using Q by (auto intro!: positive_integral_cmult_indicator) + using Q by (auto intro!: nn_integral_cmult_indicator) also have "\ < \" using Q by (auto simp: real_eq_of_nat[symmetric]) finally show ?thesis by simp @@ -1109,15 +1109,15 @@ "absolutely_continuous M N \ sets N = sets M \ density M (RN_deriv M N) = N" by (metis RN_derivI Radon_Nikodym) -lemma (in sigma_finite_measure) RN_deriv_positive_integral: +lemma (in sigma_finite_measure) RN_deriv_nn_integral: assumes N: "absolutely_continuous M N" "sets N = sets M" and f: "f \ borel_measurable M" - shows "integral\<^sup>P N f = (\\<^sup>+x. RN_deriv M N x * f x \M)" + shows "integral\<^sup>N N f = (\\<^sup>+x. RN_deriv M N x * f x \M)" proof - - have "integral\<^sup>P N f = integral\<^sup>P (density M (RN_deriv M N)) f" + have "integral\<^sup>N N f = integral\<^sup>N (density M (RN_deriv M N)) f" using N by (simp add: density_RN_deriv) also have "\ = (\\<^sup>+x. RN_deriv M N x * f x \M)" - using f by (simp add: positive_integral_density RN_deriv_nonneg) + using f by (simp add: nn_integral_density RN_deriv_nonneg) finally show ?thesis by simp qed @@ -1261,9 +1261,9 @@ have "N (?RN \) = (\\<^sup>+ x. RN_deriv M N x * indicator (?RN \) x \M)" using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) also have "\ = (\\<^sup>+ x. \ * indicator (?RN \) x \M)" - by (intro positive_integral_cong) (auto simp: indicator_def) + by (intro nn_integral_cong) (auto simp: indicator_def) also have "\ = \ * emeasure M (?RN \)" - using RN by (intro positive_integral_cmult_indicator) auto + using RN by (intro nn_integral_cmult_indicator) auto finally have eq: "N (?RN \) = \ * emeasure M (?RN \)" . moreover have "emeasure M (?RN \) = 0" @@ -1287,7 +1287,7 @@ have "N (?RN 0) = (\\<^sup>+ x. RN_deriv M N x * indicator (?RN 0) x \M)" using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) also have "\ = (\\<^sup>+ x. 0 \M)" - by (intro positive_integral_cong) (auto simp: indicator_def) + by (intro nn_integral_cong) (auto simp: indicator_def) finally have "AE x in N. RN_deriv M N x \ 0" using RN by (subst AE_iff_measurable[OF _ refl]) (auto simp: ac cong: sets_eq_imp_space_eq) with RN(3) eq show "AE x in N. 0 < real (RN_deriv M N x)" @@ -1301,9 +1301,9 @@ proof - from `{x} \ sets M` have "density M (RN_deriv M N) {x} = (\\<^sup>+w. RN_deriv M N x * indicator {x} w \M)" - by (auto simp: indicator_def emeasure_density intro!: positive_integral_cong) + by (auto simp: indicator_def emeasure_density intro!: nn_integral_cong) with x density_RN_deriv[OF ac] RN_deriv_nonneg[of M N] show ?thesis - by (auto simp: positive_integral_cmult_indicator) + by (auto simp: nn_integral_cmult_indicator) qed end