# HG changeset patch # User hoelzl # Date 1400673166 -7200 # Node ID 22568fb8916542dae700af678ffad85178008a67 # Parent e865c4d99c492ff55555c44a083d983cdd875db7 generalized Bochner integral over infinite sums diff -r e865c4d99c49 -r 22568fb89165 src/HOL/Probability/Bochner_Integration.thy --- a/src/HOL/Probability/Bochner_Integration.thy Wed May 21 12:49:27 2014 +0200 +++ b/src/HOL/Probability/Bochner_Integration.thy Wed May 21 13:52:46 2014 +0200 @@ -563,7 +563,7 @@ by (metis has_bochner_integral_simple_bochner_integrable) qed -lemma has_bochner_integral_add: +lemma has_bochner_integral_add[intro]: "has_bochner_integral M f x \ has_bochner_integral M g y \ has_bochner_integral M (\x. f x + g x) (x + y)" proof (safe intro!: has_bochner_integral.intros elim!: has_bochner_integral.cases) @@ -713,8 +713,7 @@ lemma has_bochner_integral_setsum: "(\i. i \ I \ has_bochner_integral M (f i) (x i)) \ has_bochner_integral M (\x. \i\I. f i x) (\i\I. x i)" - by (induct I rule: infinite_finite_induct) - (auto intro: has_bochner_integral_zero has_bochner_integral_add) + by (induct I rule: infinite_finite_induct) auto lemma has_bochner_integral_implies_finite_norm: "has_bochner_integral M f x \ (\\<^sup>+x. norm (f x) \M) < \" @@ -918,7 +917,7 @@ by (intro has_bochner_integral_cong_AE arg_cong[where f=The] ext) lemma integrable_add[simp, intro]: "integrable M f \ integrable M g \ integrable M (\x. f x + g x)" - by (auto simp: integrable.simps intro: has_bochner_integral_add) + by (auto simp: integrable.simps) lemma integrable_zero[simp, intro]: "integrable M (\x. 0)" by (metis has_bochner_integral_zero integrable.simps) @@ -1383,6 +1382,56 @@ finally show ?thesis . qed +lemma + fixes f :: "_ \ _ \ 'a :: {banach, second_countable_topology}" + assumes integrable[measurable]: "\i. integrable M (f i)" + and summable: "AE x in M. summable (\i. norm (f i x))" + and sums: "summable (\i. (\x. norm (f i x) \M))" + shows integrable_suminf: "integrable M (\x. (\i. f i x))" (is "integrable M ?S") + and sums_integral: "(\i. integral\<^sup>L M (f i)) sums (\x. (\i. f i x) \M)" (is "?f sums ?x") + and integral_suminf: "(\x. (\i. f i x) \M) = (\i. integral\<^sup>L M (f i))" + and summable_integral: "summable (\i. integral\<^sup>L M (f i))" +proof - + have 1: "integrable M (\x. \i. norm (f i x))" + proof (rule integrableI_bounded) + have "(\\<^sup>+ x. ereal (norm (\i. norm (f i x))) \M) = (\\<^sup>+ x. (\i. ereal (norm (f i x))) \M)" + apply (intro nn_integral_cong_AE) + using summable + apply eventually_elim + apply (simp add: suminf_ereal' suminf_nonneg) + done + also have "\ = (\i. \\<^sup>+ x. norm (f i x) \M)" + by (intro nn_integral_suminf) auto + also have "\ = (\i. ereal (\x. norm (f i x) \M))" + by (intro arg_cong[where f=suminf] ext nn_integral_eq_integral integrable_norm integrable) auto + finally show "(\\<^sup>+ x. ereal (norm (\i. norm (f i x))) \M) < \" + by (simp add: suminf_ereal' sums) + qed simp + + have 2: "AE x in M. (\n. \i (\i. f i x)" + using summable by eventually_elim (auto intro: summable_LIMSEQ summable_norm_cancel) + + have 3: "\j. AE x in M. norm (\i (\i. norm (f i x))" + using summable + proof eventually_elim + fix j x assume [simp]: "summable (\i. norm (f i x))" + have "norm (\i (\i \ (\i. norm (f i x))" + using setsum_le_suminf[of "\i. norm (f i x)"] unfolding sums_iff by auto + finally show "norm (\i (\i. norm (f i x))" by simp + qed + + note int = integral_dominated_convergence(1,3)[OF _ _ 1 2 3] + + show "integrable M ?S" + by (rule int) measurable + + show "?f sums ?x" unfolding sums_def + using int(2) by (simp add: integrable) + then show "?x = suminf ?f" "summable ?f" + unfolding sums_iff by auto +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)" @@ -1475,8 +1524,7 @@ shows "0 \ integral\<^sup>L M f" proof - have "0 \ ereal (integral\<^sup>L M (\x. max 0 (f x)))" - by (subst integral_eq_nn_integral) - (auto intro: real_of_ereal_pos nn_integral_nonneg integrable_max assms) + by (subst integral_eq_nn_integral) (auto intro: real_of_ereal_pos nn_integral_nonneg 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 @@ -1616,7 +1664,7 @@ show "(\i. integral\<^sup>L M (\x. g x *\<^sub>R s i x)) ----> integral\<^sup>L (density M g) f" unfolding lim(2)[symmetric] by (rule integral_dominated_convergence(3)[where w="\x. 2 * norm (f x)"]) - (insert lim(3-5), auto intro: integrable_norm) + (insert lim(3-5), auto) qed qed qed (simp add: f g integrable_density) @@ -1686,7 +1734,7 @@ show "(\i. integral\<^sup>L M (\x. s i (g x))) ----> integral\<^sup>L M (\x. f (g x))" proof (rule integral_dominated_convergence(3)) show "integrable M (\x. 2 * norm (f (g x)))" - using lim by (auto intro!: integrable_norm simp: integrable_distr_eq) + using lim by (auto simp: integrable_distr_eq) show "AE x in M. (\i. s i (g x)) ----> f (g x)" using lim(3) g[THEN measurable_space] by auto show "\i. AE x in M. norm (s i (g x)) \ 2 * norm (f (g x))" @@ -1695,7 +1743,7 @@ show "(\i. integral\<^sup>L M (\x. s i (g x))) ----> integral\<^sup>L (distr M N g) f" unfolding lim(2)[symmetric] by (rule integral_dominated_convergence(3)[where w="\x. 2 * norm (f x)"]) - (insert lim(3-5), auto intro: integrable_norm) + (insert lim(3-5), auto) qed qed qed (simp add: f g integrable_distr_eq) @@ -1764,9 +1812,9 @@ 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_nn_integral[symmetric]) (auto intro!: integrable_max f) + by (subst integral_eq_nn_integral[symmetric]) (auto intro!: f) also have "integral\<^sup>L M (\x. max 0 (- f x)) = real (\\<^sup>+x. max 0 (- f x) \M)" - by (subst integral_eq_nn_integral[symmetric]) (auto intro!: integrable_max f) + by (subst integral_eq_nn_integral[symmetric]) (auto intro!: 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)))" @@ -1967,73 +2015,10 @@ shows "integral\<^sup>L M X < integral\<^sup>L M Y" using gt by (intro integral_less_AE[OF int, where A="space M"]) auto -(* GENERALIZE to banach, sct *) -lemma integral_sums: - fixes f :: "nat \ 'a \ real" - assumes integrable[measurable]: "\i. integrable M (f i)" - and summable: "\x. x \ space M \ summable (\i. \f i x\)" - and sums: "summable (\i. (\x. \f i x\ \M))" - shows "integrable M (\x. (\i. f i x))" (is "integrable M ?S") - and "(\i. integral\<^sup>L M (f i)) sums (\x. (\i. f i x) \M)" (is ?integral) -proof - - have "\x\space M. \w. (\i. \f i x\) sums w" - using summable unfolding summable_def by auto - from bchoice[OF this] - obtain w where w: "\x. x \ space M \ (\i. \f i x\) sums w x" by auto - then have w_borel: "w \ borel_measurable M" unfolding sums_def - by (rule borel_measurable_LIMSEQ) auto - - let ?w = "\y. if y \ space M then w y else 0" - - obtain x where abs_sum: "(\i. (\x. \f i x\ \M)) sums x" - using sums unfolding summable_def .. - - have 1: "\n. integrable M (\x. \ij. AE x in M. norm (\i ?w x" - using AE_space - proof eventually_elim - fix j x assume [simp]: "x \ space M" - have "\\i \ (\if i x\)" by (rule setsum_abs) - also have "\ \ w x" using w[of x] setsum_le_suminf[of "\i. \f i x\"] unfolding sums_iff by auto - finally show "norm (\i ?w x" by simp - qed - - have 3: "integrable M ?w" - proof (rule integrable_monotone_convergence(1)) - let ?F = "\n y. (\if i y\)" - let ?w' = "\n y. if y \ space M then ?F n y else 0" - have "\n. integrable M (?F n)" - using integrable by (auto intro!: integrable_abs) - thus "\n. integrable M (?w' n)" by (simp cong: integrable_cong) - show "AE x in M. mono (\n. ?w' n x)" - by (auto simp: mono_def le_fun_def intro!: setsum_mono2) - show "AE x in M. (\n. ?w' n x) ----> ?w x" - using w by (simp_all add: tendsto_const sums_def) - have *: "\n. integral\<^sup>L M (?w' n) = (\i< n. (\x. \f i x\ \M))" - using integrable by (simp add: integrable_abs cong: integral_cong) - from abs_sum - show "(\i. integral\<^sup>L M (?w' i)) ----> x" unfolding * sums_def . - qed (simp add: w_borel measurable_If_set) - - from summable[THEN summable_rabs_cancel] - have 4: "AE x in M. (\n. \i (\i. f i x)" - by (auto intro: summable_LIMSEQ) - - note int = integral_dominated_convergence(1,3)[OF _ _ 3 4 2] - - from int show "integrable M ?S" by simp - - show ?integral unfolding sums_def integral_setsum(1)[symmetric, OF integrable] - using int(2) by simp -qed - lemma integrable_mult_indicator: fixes f :: "'a \ real" shows "A \ sets M \ integrable M f \ integrable M (\x. f x * indicator A x)" - by (rule integrable_bound[where f="\x. \f x\"]) - (auto intro: integrable_abs split: split_indicator) + by (rule integrable_bound[where f="\x. \f x\"]) (auto split: split_indicator) lemma tendsto_integral_at_top: fixes f :: "real \ real" @@ -2069,15 +2054,14 @@ let ?p = "integral\<^sup>L M (\x. max 0 (f x))" let ?n = "integral\<^sup>L M (\x. max 0 (- f x))" have "(?P ---> ?p) at_top" "(?N ---> ?n) at_top" - by (auto intro!: nonneg integrable_max f) + by (auto intro!: nonneg f) note tendsto_diff[OF this] also have "(\y. ?P y - ?N y) = (\y. \ x. f x * indicator {..y} x \M)" by (subst integral_diff[symmetric]) - (auto intro!: integrable_mult_indicator integrable_max f integral_cong + (auto intro!: integrable_mult_indicator f integral_cong simp: M split: split_max) also have "?p - ?n = integral\<^sup>L M f" - by (subst integral_diff[symmetric]) - (auto intro!: integrable_max f integral_cong simp: M split: split_max) + by (subst integral_diff[symmetric]) (auto intro!: f integral_cong simp: M split: split_max) finally show ?thesis . qed @@ -2112,67 +2096,6 @@ by (auto simp: _has_bochner_integral_iff) qed - -subsection {* Lebesgue integration on countable spaces *} - -lemma integral_on_countable: - fixes f :: "real \ real" - assumes f: "f \ borel_measurable M" - and bij: "bij_betw enum S (f ` space M)" - and enum_zero: "enum ` (-S) \ {0}" - and fin: "\x. x \ 0 \ (emeasure M) (f -` {x} \ space M) \ \" - and abs_summable: "summable (\r. \enum r * real ((emeasure M) (f -` {enum r} \ space M))\)" - shows "integrable M f" - and "(\r. enum r * real ((emeasure M) (f -` {enum r} \ space M))) sums integral\<^sup>L M f" (is ?sums) -proof - - let ?A = "\r. f -` {enum r} \ space M" - let ?F = "\r x. enum r * indicator (?A r) x" - have enum_eq: "\r. enum r * real ((emeasure M) (?A r)) = integral\<^sup>L M (?F r)" - using f fin by (simp add: measure_def cong: disj_cong) - - { fix x assume "x \ space M" - hence "f x \ enum ` S" using bij unfolding bij_betw_def by auto - then obtain i where "i\S" "enum i = f x" by auto - have F: "\j. ?F j x = (if j = i then f x else 0)" - proof cases - fix j assume "j = i" - thus "?thesis j" using `x \ space M` `enum i = f x` by (simp add: indicator_def) - next - fix j assume "j \ i" - show "?thesis j" using bij `i \ S` `j \ i` `enum i = f x` enum_zero - by (cases "j \ S") (auto simp add: indicator_def bij_betw_def inj_on_def) - qed - hence F_abs: "\j. \if j = i then f x else 0\ = (if j = i then \f x\ else 0)" by auto - have "(\i. ?F i x) sums f x" - "(\i. \?F i x\) sums \f x\" - by (auto intro!: sums_single simp: F F_abs) } - note F_sums_f = this(1) and F_abs_sums_f = this(2) - - have int_f: "integral\<^sup>L M f = (\x. (\r. ?F r x) \M)" "integrable M f = integrable M (\x. \r. ?F r x)" - using F_sums_f by (auto intro!: integral_cong integrable_cong simp: sums_iff) - - { fix r - have "(\x. \?F r x\ \M) = (\x. \enum r\ * indicator (?A r) x \M)" - by (auto simp: indicator_def intro!: integral_cong) - also have "\ = \enum r\ * real ((emeasure M) (?A r))" - using f fin by (simp add: measure_def cong: disj_cong) - finally have "(\x. \?F r x\ \M) = \enum r * real ((emeasure M) (?A r))\" - using f by (subst (2) abs_mult_pos[symmetric]) (auto intro!: real_of_ereal_pos measurable_sets) } - note int_abs_F = this - - have 1: "\i. integrable M (\x. ?F i x)" - using f fin by auto - - have 2: "\x. x \ space M \ summable (\i. \?F i x\)" - using F_abs_sums_f unfolding sums_iff by auto - - from integral_sums(2)[OF 1 2, unfolded int_abs_F, OF _ abs_summable] - show ?sums unfolding enum_eq int_f by simp - - from integral_sums(1)[OF 1 2, unfolded int_abs_F, OF _ abs_summable] - show "integrable M f" unfolding int_f by simp -qed - subsection {* Product measure *} lemma (in sigma_finite_measure) borel_measurable_lebesgue_integrable[measurable (raw)]: @@ -2419,7 +2342,7 @@ show "(\i. integral\<^sup>L (M1 \\<^sub>M M2) (s i)) ----> integral\<^sup>L (M1 \\<^sub>M M2) f" proof (rule integral_dominated_convergence) show "integrable (M1 \\<^sub>M M2) (\x. 2 * norm (f x))" - using lim(5) by (auto intro: integrable_norm) + using lim(5) by auto qed (insert lim, auto) have "(\i. \ x. \ y. s i (x, y) \M2 \M1) ----> \ x. \ y. f (x, y) \M2 \M1" proof (rule integral_dominated_convergence) @@ -2433,7 +2356,7 @@ show "(\i. \ y. s i (x, y) \M2) ----> \ y. f (x, y) \M2" proof (rule integral_dominated_convergence) show "integrable M2 (\y. 2 * norm (f (x, y)))" - using f by (auto intro: integrable_norm) + using f by auto show "AE xa in M2. (\i. s i (x, xa)) ----> f (x, xa)" using x lim(3) by (auto simp: space_pair_measure) show "\i. AE xa in M2. norm (s i (x, xa)) \ 2 * norm (f (x, xa))" diff -r e865c4d99c49 -r 22568fb89165 src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Wed May 21 12:49:27 2014 +0200 +++ b/src/HOL/Probability/Borel_Space.thy Wed May 21 13:52:46 2014 +0200 @@ -1187,13 +1187,13 @@ qed auto lemma sets_Collect_Cauchy[measurable]: - fixes f :: "nat \ 'a => real" + fixes f :: "nat \ 'a => 'b::{metric_space, second_countable_topology}" assumes f[measurable]: "\i. f i \ borel_measurable M" shows "{x\space M. Cauchy (\i. f i x)} \ sets M" - unfolding Cauchy_iff2 using f by auto + unfolding metric_Cauchy_iff2 using f by auto lemma borel_measurable_lim[measurable (raw)]: - fixes f :: "nat \ 'a \ real" + fixes f :: "nat \ 'a \ 'b::{banach, second_countable_topology}" assumes f[measurable]: "\i. f i \ borel_measurable M" shows "(\x. lim (\i. f i x)) \ borel_measurable M" proof - @@ -1201,7 +1201,7 @@ then have *: "\x. lim (\i. f i x) = (if Cauchy (\i. f i x) then u' x else (THE x. False))" by (auto simp: lim_def convergent_eq_cauchy[symmetric]) have "u' \ borel_measurable M" - proof (rule borel_measurable_LIMSEQ) + proof (rule borel_measurable_LIMSEQ_metric) fix x have "convergent (\i. if Cauchy (\i. f i x) then f i x else 0)" by (cases "Cauchy (\i. f i x)") @@ -1215,7 +1215,7 @@ qed lemma borel_measurable_suminf[measurable (raw)]: - fixes f :: "nat \ 'a \ real" + fixes f :: "nat \ 'a \ 'b::{banach, second_countable_topology}" assumes f[measurable]: "\i. f i \ borel_measurable M" shows "(\x. suminf (\i. f i x)) \ borel_measurable M" unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp