Set_Integral.thy
Interaktion und PortierbarkeitIsabelle
(* Title: HOL/Analysis/Set_Integral.thy Author: Jeremy Avigad (CMU), Johannes Hölzl (TUM), Luke Serafin (CMU) Author: Sébastien Gouëzel sebastien.gouezel@univ-rennes1.fr Author: Ata Keskin, TU Muenchen
Notation and useful facts for working with integrals over a set.
TODO: keep all these? Need unicode translations as well.
*)
chapter\<open>Integrals over a Set\<close>
theory Set_Integral imports Radon_Nikodym begin
section \<open>Notation\<close>
definition\<^marker>\<open>tag important\<close> "set_borel_measurable M A f \<equiv> (\<lambda>x. indicator A x *\<^sub>R f x) \<in> borel_measurable M"
definition\<^marker>\<open>tag important\<close> "set_integrable M A f \<equiv> integrable M (\<lambda>x. indicator A x *\<^sub>R f x)"
definition\<^marker>\<open>tag important\<close> "set_lebesgue_integral M A f \<equiv> lebesgue_integral M (\<lambda>x. indicator A x *\<^sub>R f x)"
syntax "_ascii_set_lebesgue_integral" :: "pttrn \ 'a set \ 'a measure \ real \ real"
(\<open>(\<open>indent=4 notation=\<open>binder LINT\<close>\<close>LINT (_):(_)/|(_)./ _)\<close> [0,0,0,10] 10)
syntax_consts "_ascii_set_lebesgue_integral" == set_lebesgue_integral translations "LINT x:A|M. f" == "CONST set_lebesgue_integral M A (\x. f)"
section \<open>Basic properties\<close>
lemma set_integrable_eq: fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes"\ \ space M \ sets M" shows"set_integrable M \ f = integrable (restrict_space M \) f" by (meson assms integrable_restrict_space set_integrable_def)
lemma set_integrable_cong: assumes"M = M'""A = A'""\x. x \ A \ f x = f' x" shows"set_integrable M A f = set_integrable M' A' f'" proof - have"(\x. indicator A x *\<^sub>R f x) = (\x. indicator A' x *\<^sub>R f' x)" using assms by (auto simp: indicator_def of_bool_def) thus ?thesis by (simp add: set_integrable_def assms) qed
lemma set_borel_measurable_sets: fixes f :: "_ \ _::real_normed_vector" assumes"set_borel_measurable M X f""B \ sets borel" "X \ sets M" shows"f -` B \ X \ sets M" proof - have"f \ borel_measurable (restrict_space M X)" using assms unfolding set_borel_measurable_def by (subst borel_measurable_restrict_space_iff) auto thenhave"f -` B \ space (restrict_space M X) \ sets (restrict_space M X)" by (rule measurable_sets) fact with\<open>X \<in> sets M\<close> show ?thesis by (subst (asm) sets_restrict_space_iff) (auto simp: space_restrict_space) qed
lemma set_integrable_bound: fixes f :: "'a \ 'b::{banach, second_countable_topology}" and g :: "'a \ 'c::{banach, second_countable_topology}" assumes"set_integrable M A f""set_borel_measurable M A g" assumes"AE x in M. x \ A \ norm (g x) \ norm (f x)" shows"set_integrable M A g" unfolding set_integrable_def proof (rule Bochner_Integration.integrable_bound) from assms(1) show"integrable M (\x. indicator A x *\<^sub>R f x)" by (simp add: set_integrable_def) from assms(2) show"(\x. indicat_real A x *\<^sub>R g x) \ borel_measurable M" by (simp add: set_borel_measurable_def) from assms(3) show"AE x in M. norm (indicat_real A x *\<^sub>R g x) \ norm (indicat_real A x *\<^sub>R f x)" by eventually_elim (simp add: indicator_def) qed
lemma set_lebesgue_integral_zero [simp]: "set_lebesgue_integral M A (\x. 0) = 0" by (auto simp: set_lebesgue_integral_def)
lemma set_lebesgue_integral_cong: assumes"A \ sets M" and "\x. x \ A \ f x = g x" shows"(LINT x:A|M. f x) = (LINT x:A|M. g x)" unfolding set_lebesgue_integral_def using assms by (metis indicator_simps(2) real_vector.scale_zero_left)
lemma set_lebesgue_integral_cong_AE: assumes [measurable]: "A \ sets M" "f \ borel_measurable M" "g \ borel_measurable M" assumes"AE x \ A in M. f x = g x" shows"(LINT x:A|M. f x) = (LINT x:A|M. g x)"
proof- have"AE x in M. indicator A x *\<^sub>R f x = indicator A x *\<^sub>R g x" using assms by auto thus ?thesis unfolding set_lebesgue_integral_def by (intro integral_cong_AE) auto qed
lemma set_integrable_cong_AE: "f \ borel_measurable M \ g \ borel_measurable M \
AE x \<in> A in M. f x = g x \<Longrightarrow> A \<in> sets M \<Longrightarrow>
set_integrable M A f = set_integrable M A g" unfolding set_integrable_def by (rule integrable_cong_AE) auto
lemma set_integrable_subset: fixes M A B and f :: "_ \ _ :: {banach, second_countable_topology}" assumes"set_integrable M A f""B \ sets M" "B \ A" shows"set_integrable M B f" proof - have"set_integrable M B (\x. indicator A x *\<^sub>R f x)" using assms integrable_mult_indicator set_integrable_def by blast with\<open>B \<subseteq> A\<close> show ?thesis unfolding set_integrable_def by (simp add: indicator_inter_arith[symmetric] Int_absorb2) qed
lemma set_integrable_restrict_space: fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes f: "set_integrable M S f"and T: "T \ sets (restrict_space M S)" shows"set_integrable M T f" proof - obtain T' where T_eq: "T = S \ T'" and "T' \ sets M" using T by (auto simp: sets_restrict_space) have\<open>integrable M (\<lambda>x. indicator T' x *\<^sub>R (indicator S x *\<^sub>R f x))\<close> using\<open>T' \<in> sets M\<close> f integrable_mult_indicator set_integrable_def by blast thenshow ?thesis unfolding set_integrable_def unfolding T_eq indicator_inter_arith by (simp add: ac_simps) qed
(* TODO: integral_cmul_indicator should be named set_integral_const *) (* TODO: borel_integrable_atLeastAtMost should be named something like set_integrable_Icc_isCont *)
lemma set_integral_scaleR_left: assumes"A \ sets M" "c \ 0 \ integrable M f" shows"(LINT t:A|M. f t *\<^sub>R c) = (LINT t:A|M. f t) *\<^sub>R c" unfolding set_lebesgue_integral_def using integrable_mult_indicator[OF assms] by (subst integral_scaleR_left[symmetric], auto)
lemma set_integral_scaleR_right [simp]: "(LINT t:A|M. a *\<^sub>R f t) = a *\<^sub>R (LINT t:A|M. f t)" unfolding set_lebesgue_integral_def by (subst integral_scaleR_right[symmetric]) (auto intro!: Bochner_Integration.integral_cong)
lemma set_integral_mult_right [simp]: fixes a :: "'a::{real_normed_field, second_countable_topology}" shows"(LINT t:A|M. a * f t) = a * (LINT t:A|M. f t)" unfolding set_lebesgue_integral_def by (subst integral_mult_right_zero[symmetric]) auto
lemma set_integral_mult_left [simp]: fixes a :: "'a::{real_normed_field, second_countable_topology}" shows"(LINT t:A|M. f t * a) = (LINT t:A|M. f t) * a" unfolding set_lebesgue_integral_def by (subst integral_mult_left_zero[symmetric]) auto
lemma set_integral_divide_zero [simp]: fixes a :: "'a::{real_normed_field, field, second_countable_topology}" shows"(LINT t:A|M. f t / a) = (LINT t:A|M. f t) / a" unfolding set_lebesgue_integral_def by (subst integral_divide_zero[symmetric], intro Bochner_Integration.integral_cong)
(auto split: split_indicator)
lemma set_integrable_scaleR_right [simp, intro]: shows"(a \ 0 \ set_integrable M A f) \ set_integrable M A (\t. a *\<^sub>R f t)" unfolding set_integrable_def unfolding scaleR_left_commute by (rule integrable_scaleR_right)
lemma set_integrable_scaleR_left [simp, intro]: fixes a :: "_ :: {banach, second_countable_topology}" shows"(a \ 0 \ set_integrable M A f) \ set_integrable M A (\t. f t *\<^sub>R a)" unfolding set_integrable_def using integrable_scaleR_left[of a M "\x. indicator A x *\<^sub>R f x"] by simp
lemma set_integrable_mult_right [simp, intro]: fixes a :: "'a::{real_normed_field, second_countable_topology}" shows"(a \ 0 \ set_integrable M A f) \ set_integrable M A (\t. a * f t)" unfolding set_integrable_def using integrable_mult_right[of a M "\x. indicator A x *\<^sub>R f x"] by simp
lemma set_integrable_mult_right_iff [simp]: fixes a :: "'a::{real_normed_field, second_countable_topology}" assumes"a \ 0" shows"set_integrable M A (\t. a * f t) \ set_integrable M A f" proof assume"set_integrable M A (\t. a * f t)" thenhave"set_integrable M A (\t. 1/a * (a * f t))" using set_integrable_mult_right by blast thenshow"set_integrable M A f" using assms by auto qed auto
lemma set_integrable_mult_left [simp, intro]: fixes a :: "'a::{real_normed_field, second_countable_topology}" shows"(a \ 0 \ set_integrable M A f) \ set_integrable M A (\t. f t * a)" unfolding set_integrable_def using integrable_mult_left[of a M "\x. indicator A x *\<^sub>R f x"] by simp
lemma set_integrable_mult_left_iff [simp]: fixes a :: "'a::{real_normed_field, second_countable_topology}" assumes"a \ 0" shows"set_integrable M A (\t. f t * a) \ set_integrable M A f" using assms by (subst set_integrable_mult_right_iff [symmetric]) (auto simp: mult.commute)
lemma set_integrable_divide [simp, intro]: fixes a :: "'a::{real_normed_field, field, second_countable_topology}" assumes"a \ 0 \ set_integrable M A f" shows"set_integrable M A (\t. f t / a)" proof - have"integrable M (\x. indicator A x *\<^sub>R f x / a)" using assms unfolding set_integrable_def by (rule integrable_divide_zero) alsohave"(\x. indicator A x *\<^sub>R f x / a) = (\x. indicator A x *\<^sub>R (f x / a))" by (auto split: split_indicator) finallyshow ?thesis unfolding set_integrable_def . qed
lemma set_integrable_mult_divide_iff [simp]: fixes a :: "'a::{real_normed_field, second_countable_topology}" assumes"a \ 0" shows"set_integrable M A (\t. f t / a) \ set_integrable M A f" by (simp add: divide_inverse assms)
lemma set_integral_add [simp, intro]: fixes f g :: "_ \ _ :: {banach, second_countable_topology}" assumes"set_integrable M A f""set_integrable M A g" shows"set_integrable M A (\x. f x + g x)" and"(LINT x:A|M. f x + g x) = (LINT x:A|M. f x) + (LINT x:A|M. g x)" using assms unfolding set_integrable_def set_lebesgue_integral_def by (simp_all add: scaleR_add_right)
lemma set_integral_diff [simp, intro]: assumes"set_integrable M A f""set_integrable M A g" shows"set_integrable M A (\x. f x - g x)" and "(LINT x:A|M. f x - g x) = (LINT x:A|M. f x) - (LINT x:A|M. g x)" using assms unfolding set_integrable_def set_lebesgue_integral_def by (simp_all add: scaleR_diff_right)
lemma set_integral_uminus: "set_integrable M A f \ (LINT x:A|M. - f x) = - (LINT x:A|M. f x)" unfolding set_integrable_def set_lebesgue_integral_def by (subst integral_minus[symmetric]) simp_all
lemma set_integral_mono: fixes f g :: "_ \ real" assumes"set_integrable M A f""set_integrable M A g" "\x. x \ A \ f x \ g x" shows"(LINT x:A|M. f x) \ (LINT x:A|M. g x)" using assms unfolding set_integrable_def set_lebesgue_integral_def by (auto intro: integral_mono split: split_indicator)
lemma set_integral_mono_AE: fixes f g :: "_ \ real" assumes"set_integrable M A f""set_integrable M A g" "AE x \ A in M. f x \ g x" shows"(LINT x:A|M. f x) \ (LINT x:A|M. g x)" using assms unfolding set_integrable_def set_lebesgue_integral_def by (auto intro: integral_mono_AE split: split_indicator)
lemma set_integrable_abs: "set_integrable M A f \ set_integrable M A (\x. \f x\ :: real)" using integrable_abs[of M "\x. f x * indicator A x"]unfolding set_integrable_def by (simp add: abs_mult ac_simps)
lemma set_integrable_abs_iff: fixes f :: "_ \ real" shows"set_borel_measurable M A f \ set_integrable M A (\x. \f x\) = set_integrable M A f" unfolding set_integrable_def set_borel_measurable_def by (subst (2) integrable_abs_iff[symmetric]) (simp_all add: abs_mult ac_simps)
lemma set_integrable_abs_iff': fixes f :: "_ \ real" shows"f \ borel_measurable M \ A \ sets M \
set_integrable M A (\<lambda>x. \<bar>f x\<bar>) = set_integrable M A f" by (simp add: set_borel_measurable_def set_integrable_abs_iff)
lemma set_integrable_discrete_difference: fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes"countable X" assumes diff: "(A - B) \ (B - A) \ X" assumes"\x. x \ X \ emeasure M {x} = 0" "\x. x \ X \ {x} \ sets M" shows"set_integrable M A f \ set_integrable M B f" unfolding set_integrable_def proof (rule integrable_discrete_difference[where X=X]) show"\x. x \ space M \ x \ X \ indicator A x *\<^sub>R f x = indicator B x *\<^sub>R f x" using diff by (auto split: split_indicator) qed fact+
lemma set_integral_discrete_difference: fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes"countable X" assumes diff: "(A - B) \ (B - A) \ X" assumes"\x. x \ X \ emeasure M {x} = 0" "\x. x \ X \ {x} \ sets M" shows"set_lebesgue_integral M A f = set_lebesgue_integral M B f" unfolding set_lebesgue_integral_def proof (rule integral_discrete_difference[where X=X]) show"\x. x \ space M \ x \ X \ indicator A x *\<^sub>R f x = indicator B x *\<^sub>R f x" using diff by (auto split: split_indicator) qed fact+
lemma set_integrable_Un: fixes f g :: "_ \ _ :: {banach, second_countable_topology}" assumes f_A: "set_integrable M A f"and f_B: "set_integrable M B f" and [measurable]: "A \ sets M" "B \ sets M" shows"set_integrable M (A \ B) f" proof - have"set_integrable M (A - B) f" using f_A by (rule set_integrable_subset) auto with f_B have"integrable M (\x. indicator (A - B) x *\<^sub>R f x + indicator B x *\<^sub>R f x)" unfolding set_integrable_def using integrable_add by blast thenshow ?thesis unfolding set_integrable_def by (rule integrable_cong[THEN iffD1, rotated 2]) (auto split: split_indicator) qed
lemma set_integrable_empty [simp]: "set_integrable M {} f" by (auto simp: set_integrable_def)
lemma set_integrable_UN: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes"finite I""\i. i\I \ set_integrable M (A i) f" "\i. i\I \ A i \ sets M" shows"set_integrable M (\i\I. A i) f" using assms by (induct I) (auto simp: set_integrable_Un sets.finite_UN)
lemma set_integral_Un: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes"A \ B = {}" and"set_integrable M A f" and"set_integrable M B f" shows"(LINT x:A\B|M. f x) = (LINT x:A|M. f x) + (LINT x:B|M. f x)" using assms unfolding set_integrable_def set_lebesgue_integral_def by (auto simp add: indicator_union_arith indicator_inter_arith[symmetric] scaleR_add_left)
lemma set_integral_cong_set: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes"set_borel_measurable M A f""set_borel_measurable M B f" and ae: "AE x in M. x \ A \ x \ B" shows"(LINT x:B|M. f x) = (LINT x:A|M. f x)" unfolding set_lebesgue_integral_def proof (rule integral_cong_AE) show"AE x in M. indicator B x *\<^sub>R f x = indicator A x *\<^sub>R f x" using ae by (auto simp: subset_eq split: split_indicator) qed (use assms in\<open>auto simp: set_borel_measurable_def\<close>)
proposition set_borel_measurable_subset: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes [measurable]: "set_borel_measurable M A f""B \ sets M" and "B \ A" shows"set_borel_measurable M B f"
proof- have"set_borel_measurable M B (\x. indicator A x *\<^sub>R f x)" using assms unfolding set_borel_measurable_def using borel_measurable_indicator borel_measurable_scaleR by blast moreoverhave"(\x. indicator B x *\<^sub>R indicator A x *\<^sub>R f x) = (\x. indicator B x *\<^sub>R f x)" using\<open>B \<subseteq> A\<close> by (auto simp: fun_eq_iff split: split_indicator) ultimatelyshow ?thesis unfolding set_borel_measurable_def by simp qed
lemma set_integral_Un_AE: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes ae: "AE x in M. \ (x \ A \ x \ B)" and [measurable]: "A \ sets M" "B \ sets M" and"set_integrable M A f" and"set_integrable M B f" shows"(LINT x:A\B|M. f x) = (LINT x:A|M. f x) + (LINT x:B|M. f x)" proof - have f: "set_integrable M (A \ B) f" by (intro set_integrable_Un assms) thenhave f': "set_borel_measurable M (A \ B) f" using integrable_iff_bounded set_borel_measurable_def set_integrable_def by blast have"(LINT x:A\B|M. f x) = (LINT x:(A - A \ B) \ (B - A \ B)|M. f x)" proof (rule set_integral_cong_set) show"AE x in M. (x \ A - A \ B \ (B - A \ B)) = (x \ A \ B)" using ae by auto show"set_borel_measurable M (A - A \ B \ (B - A \ B)) f" using f' by (rule set_borel_measurable_subset) auto qed fact alsohave"\ = (LINT x:(A - A \ B)|M. f x) + (LINT x:(B - A \ B)|M. f x)" by (auto intro!: set_integral_Un set_integrable_subset[OF f]) alsohave"\ = (LINT x:A|M. f x) + (LINT x:B|M. f x)" using ae by (intro arg_cong2[where f="(+)"] set_integral_cong_set)
(auto intro!: set_borel_measurable_subset[OF f']) finallyshow ?thesis . qed
lemma set_integral_finite_Union: fixes f :: "_ \ _ :: {banach, second_countable_topology}" assumes"finite I""disjoint_family_on A I" and"\i. i \ I \ set_integrable M (A i) f" "\i. i \ I \ A i \ sets M" shows"(LINT x:(\i\I. A i)|M. f x) = (\i\I. LINT x:A i|M. f x)" using assms proofinduction case (insert x F) thenhave"A x \ \(A ` F) = {}" by (meson disjoint_family_on_insert) with insert show ?case by (simp add: set_integral_Un set_integrable_Un set_integrable_UN disjoint_family_on_insert) qed (simp add: set_lebesgue_integral_def)
(* TODO: find a better name? *) lemma pos_integrable_to_top: fixes l::real assumes"\i. A i \ sets M" "mono A" assumes nneg: "\x i. x \ A i \ 0 \ f x" and intgbl: "\i::nat. set_integrable M (A i) f" and lim: "(\i::nat. LINT x:A i|M. f x) \ l" shows"set_integrable M (\i. A i) f" unfolding set_integrable_def apply (rule integrable_monotone_convergence[where f = "\i::nat. \x. indicator (A i) x *\<^sub>R f x" and x = l]) apply (rule intgbl [unfolded set_integrable_def]) prefer 3 apply (rule lim [unfolded set_lebesgue_integral_def]) apply (rule AE_I2) using\<open>mono A\<close> apply (auto simp: mono_def nneg split: split_indicator) [] proof (rule AE_I2)
{ fix x assume"x \ space M" show"(\i. indicator (A i) x *\<^sub>R f x) \ indicator (\i. A i) x *\<^sub>R f x" proof cases assume"\i. x \ A i" thenobtain i where"x \ A i" .. thenhave"\\<^sub>F i in sequentially. x \ A i" using\<open>x \<in> A i\<close> \<open>mono A\<close> by (auto simp: eventually_sequentially mono_def) with eventually_mono have"\\<^sub>F i in sequentially. indicat_real (A i) x *\<^sub>R f x = indicat_real (\ (range A)) x *\<^sub>R f x" by fastforce thenshow ?thesis by (intro tendsto_eventually) qed auto } thenshow"(\x. indicator (\i. A i) x *\<^sub>R f x) \ borel_measurable M" apply (rule borel_measurable_LIMSEQ_real) apply assumption using intgbl set_integrable_def by blast qed
text\<open>Proof from Royden, \emph{Real Analysis}, p. 91.\<close> lemma lebesgue_integral_countable_add: fixes f :: "_ \ 'a :: {banach, second_countable_topology}" assumes meas[intro]: "\i::nat. A i \ sets M" and disj: "\i j. i \ j \ A i \ A j = {}" and intgbl: "set_integrable M (\i. A i) f" shows"(LINT x:(\i. A i)|M. f x) = (\i. (LINT x:(A i)|M. f x))" unfolding set_lebesgue_integral_def proof (subst integral_suminf[symmetric]) show int_A: "integrable M (\x. indicat_real (A i) x *\<^sub>R f x)" for i using intgbl unfolding set_integrable_def [symmetric] by (rule set_integrable_subset) auto
{ fix x assume"x \ space M" have"(\i. indicator (A i) x *\<^sub>R f x) sums (indicator (\i. A i) x *\<^sub>R f x)" by (intro sums_scaleR_left indicator_sums) fact } note sums = this
have norm_f: "\i. set_integrable M (A i) (\x. norm (f x))" using int_A[THEN integrable_norm] unfolding set_integrable_def by auto
show"AE x in M. summable (\i. norm (indicator (A i) x *\<^sub>R f x))" using disj by (intro AE_I2) (auto intro!: summable_mult2 sums_summable[OF indicator_sums])
show"summable (\i. LINT x|M. norm (indicator (A i) x *\<^sub>R f x))" proof (rule summableI_nonneg_bounded) fix n show"0 \ LINT x|M. norm (indicator (A n) x *\<^sub>R f x)" using norm_f by (auto intro!: integral_nonneg_AE)
have"(\iR f x)) = (\i by (simp add: abs_mult set_lebesgue_integral_def) alsohave"\ = set_lebesgue_integral M (\ix. norm (f x))" using norm_f by (subst set_integral_finite_Union) (auto simp: disjoint_family_on_def disj) alsohave"\ \ set_lebesgue_integral M (\i. A i) (\x. norm (f x))" using intgbl[unfolded set_integrable_def, THEN integrable_norm] norm_f unfolding set_lebesgue_integral_def set_integrable_def apply (intro integral_mono set_integrable_UN[of "{.., unfolded set_integrable_def]) apply (auto split: split_indicator) done finallyshow"(\iR f x)) \
set_lebesgue_integral M (\<Union>i. A i) (\<lambda>x. norm (f x))" by simp qed show"LINT x|M. indicator (\(A ` UNIV)) x *\<^sub>R f x = LINT x|M. (\i. indicator (A i) x *\<^sub>R f x)" by (metis (no_types, lifting) integral_cong sums sums_unique) qed
lemma set_integral_cont_up: fixes f :: "_ \ 'a :: {banach, second_countable_topology}" assumes [measurable]: "\i. A i \ sets M" and A: "incseq A" and intgbl: "set_integrable M (\i. A i) f" shows"(\i. LINT x:(A i)|M. f x) \ (LINT x:(\i. A i)|M. f x)" unfolding set_lebesgue_integral_def proof (intro integral_dominated_convergence[where w="\x. indicator (\i. A i) x *\<^sub>R norm (f x)"]) have int_A: "\i. set_integrable M (A i) f" using intgbl by (rule set_integrable_subset) auto show"\i. (\x. indicator (A i) x *\<^sub>R f x) \ borel_measurable M" using int_A integrable_iff_bounded set_integrable_def by blast show"(\x. indicator (\(A ` UNIV)) x *\<^sub>R f x) \ borel_measurable M" using integrable_iff_bounded intgbl set_integrable_def by blast show"integrable M (\x. indicator (\i. A i) x *\<^sub>R norm (f x))" using int_A intgbl integrable_norm unfolding set_integrable_def by fastforce
{ fix x i assume"x \ A i" with A have"(\xa. indicator (A xa) x::real) \ 1 \ (\xa. 1::real) \ 1" by (intro filterlim_cong refl)
(fastforce simp: eventually_sequentially incseq_def subset_eq intro!: exI[of _ i]) } thenshow"AE x in M. (\i. indicator (A i) x *\<^sub>R f x) \ indicator (\i. A i) x *\<^sub>R f x" by (intro AE_I2 tendsto_intros) (auto split: split_indicator) qed (auto split: split_indicator)
(* Can the int0 hypothesis be dropped? *) lemma set_integral_cont_down: fixes f :: "_ \ 'a :: {banach, second_countable_topology}" assumes [measurable]: "\i. A i \ sets M" and A: "decseq A" and int0: "set_integrable M (A 0) f" shows"(\i::nat. LINT x:(A i)|M. f x) \ (LINT x:(\i. A i)|M. f x)" unfolding set_lebesgue_integral_def proof (rule integral_dominated_convergence) have int_A: "\i. set_integrable M (A i) f" using int0 by (rule set_integrable_subset) (insert A, auto simp: decseq_def) have"integrable M (\c. norm (indicat_real (A 0) c *\<^sub>R f c))" by (metis (no_types) int0 integrable_norm set_integrable_def) thenshow"integrable M (\x. indicator (A 0) x *\<^sub>R norm (f x))" by force have"set_integrable M (\i. A i) f" using int0 by (rule set_integrable_subset) (insert A, auto simp: decseq_def) with int_A show"(\x. indicat_real (\(A ` UNIV)) x *\<^sub>R f x) \ borel_measurable M" "\i. (\x. indicat_real (A i) x *\<^sub>R f x) \ borel_measurable M" by (auto simp: set_integrable_def) show"\i. AE x in M. norm (indicator (A i) x *\<^sub>R f x) \ indicator (A 0) x *\<^sub>R norm (f x)" using A by (auto split: split_indicator simp: decseq_def)
{ fix x i assume"x \ space M" "x \ A i" with A have"(\i. indicator (A i) x::real) \ 0 \ (\i. 0::real) \ 0" by (intro filterlim_cong refl)
(auto split: split_indicator simp: eventually_sequentially decseq_def intro!: exI[of _ i]) } thenshow"AE x in M. (\i. indicator (A i) x *\<^sub>R f x) \ indicator (\i. A i) x *\<^sub>R f x" by (intro AE_I2 tendsto_intros) (auto split: split_indicator) qed
lemma set_integral_at_point: fixes a :: real assumes"set_integrable M {a} f" and [simp]: "{a} \ sets M" and "(emeasure M) {a} \ \" shows"(LINT x:{a} | M. f x) = f a * measure M {a}"
proof- have"set_lebesgue_integral M {a} f = set_lebesgue_integral M {a} (%x. f a)" by (intro set_lebesgue_integral_cong) simp_all thenshow ?thesis using assms unfolding set_lebesgue_integral_def by simp qed
section \<open>Complex integrals\<close>
abbreviation complex_integrable :: "'a measure \ ('a \ complex) \ bool" where "complex_integrable M f \ integrable M f"
abbreviation complex_lebesgue_integral :: "'a measure \ ('a \ complex) \ complex" (\integral\<^sup>C\) where "integral\<^sup>C M f == integral\<^sup>L M f"
lemma complex_integrable_cnj [simp]: "complex_integrable M (\x. cnj (f x)) \ complex_integrable M f" proof assume"complex_integrable M (\x. cnj (f x))" thenhave"complex_integrable M (\x. cnj (cnj (f x)))" by (rule integrable_cnj) thenshow"complex_integrable M f" by simp qed simp
lemma complex_of_real_integrable_eq: "complex_integrable M (\x. complex_of_real (f x)) \ integrable M f" proof assume"complex_integrable M (\x. complex_of_real (f x))" thenhave"integrable M (\x. Re (complex_of_real (f x)))" by (rule integrable_Re) thenshow"integrable M f" by simp qed simp
abbreviation complex_set_integrable :: "'a measure \ 'a set \ ('a \ complex) \ bool" where "complex_set_integrable M A f \ set_integrable M A f"
abbreviation complex_set_lebesgue_integral :: "'a measure \ 'a set \ ('a \ complex) \ complex" where "complex_set_lebesgue_integral M A f \ set_lebesgue_integral M A f"
syntax "_ascii_complex_set_lebesgue_integral" :: "pttrn \ 'a set \ 'a measure \ real \ real"
(\<open>(\<open>indent=4 notation=\<open>binder CLINT\<close>\<close>CLINT _:_|_. _)\<close> [0,0,0,10] 10)
syntax_consts "_ascii_complex_set_lebesgue_integral" == complex_set_lebesgue_integral translations "CLINT x:A|M. f" == "CONST complex_set_lebesgue_integral M A (\x. f)"
lemma set_measurable_continuous_on: fixes f g :: "'a::topological_space \ 'b::real_normed_vector" shows"A \ sets borel \ continuous_on A f \ set_borel_measurable borel A f" by (meson borel_measurable_continuous_on_indicator
set_borel_measurable_def)
section \<open>NN Set Integrals\<close>
text\<open>This notation is from Sébastien Gouëzel: His use is not directly in line with the
notations in this file, they are more in line with sum, and more readable he thinks.\<close>
abbreviation"set_nn_integral M A f \ nn_integral M (\x. f x * indicator A x)"
syntax "_set_nn_integral" :: "pttrn => 'a set => 'a measure => ereal => ereal"
(\<open>(\<open>notation=\<open>binder integral\<close>\<close>\<integral>\<^sup>+((_)\<in>(_)./ _)/\<partial>_)\<close> [0,0,0,110] 10) "_set_lebesgue_integral" :: "pttrn => 'a set => 'a measure => ereal => ereal"
(\<open>(\<open>notation=\<open>binder integral\<close>\<close>\<integral>((_)\<in>(_)./ _)/\<partial>_)\<close> [0,0,0,110] 10)
syntax_consts "_set_nn_integral" == set_nn_integral and "_set_lebesgue_integral" == set_lebesgue_integral translations "\\<^sup>+x \ A. f \M" == "CONST set_nn_integral M A (\x. f)" "\x \ A. f \M" == "CONST set_lebesgue_integral M A (\x. f)"
lemma set_nn_integral_cong: assumes"M = M'""A = B""\x. x \ space M \ A \ f x = g x" shows"set_nn_integral M A f = set_nn_integral M' B g" by (metis (mono_tags, lifting) IntI assms indicator_simps(2) mult_eq_0_iff nn_integral_cong)
lemma nn_integral_disjoint_pair: assumes [measurable]: "f \ borel_measurable M" "B \ sets M" "C \ sets M" "B \ C = {}" shows"(\\<^sup>+x \ B \ C. f x \M) = (\\<^sup>+x \ B. f x \M) + (\\<^sup>+x \ C. f x \M)" proof - have mes: "\D. D \ sets M \ (\x. f x * indicator D x) \ borel_measurable M" by simp have pos: "\D. AE x in M. f x * indicator D x \ 0" using assms(2) by auto have"\x. f x * indicator (B \ C) x = f x * indicator B x + f x * indicator C x" using assms(4) by (auto split: split_indicator) thenhave"(\\<^sup>+x. f x * indicator (B \ C) x \M) = (\\<^sup>+x. f x * indicator B x + f x * indicator C x \M)" by simp alsohave"\ = (\\<^sup>+x. f x * indicator B x \M) + (\\<^sup>+x. f x * indicator C x \M)" by (rule nn_integral_add) (auto simp add: assms mes pos) finallyshow ?thesis by simp qed
lemma nn_integral_disjoint_pair_countspace: assumes"B \ C = {}" shows"(\\<^sup>+x \ B \ C. f x \count_space UNIV) = (\\<^sup>+x \ B. f x \count_space UNIV) + (\\<^sup>+x \ C. f x \count_space UNIV)" by (rule nn_integral_disjoint_pair) (simp_all add: assms)
lemma nn_integral_null_delta: assumes"A \ sets M" "B \ sets M" "(A - B) \ (B - A) \ null_sets M" shows"(\\<^sup>+x \ A. f x \M) = (\\<^sup>+x \ B. f x \M)" proof (rule nn_integral_cong_AE) have *: "AE a in M. a \ (A - B) \ (B - A)" using assms(3) AE_not_in by blast thenshow\<open>AE x in M. f x * indicator A x = f x * indicator B x\<close> by auto qed
proposition nn_integral_disjoint_family: assumes [measurable]: "f \ borel_measurable M" "\(n::nat). B n \ sets M" and"disjoint_family B" shows"(\\<^sup>+x \ (\n. B n). f x \M) = (\n. (\\<^sup>+x \ B n. f x \M))" proof - have"(\\<^sup>+ x. (\n. f x * indicator (B n) x) \M) = (\n. (\\<^sup>+ x. f x * indicator (B n) x \M))" by (rule nn_integral_suminf) simp moreoverhave"(\n. f x * indicator (B n) x) = f x * indicator (\n. B n) x" for x proof (cases) assume"x \ (\n. B n)" thenobtain n where"x \ B n" by blast have a: "finite {n}"by simp have"\i. i \ n \ x \ B i" using \x \ B n\ assms(3) disjoint_family_on_def by (metis IntI UNIV_I empty_iff) thenhave"\i. i \ {n} \ indicator (B i) x = (0::ennreal)" using indicator_def by simp thenhave b: "\i. i \ {n} \ f x * indicator (B i) x = (0::ennreal)" by simp
define h where"h = (\i. f x * indicator (B i) x)" thenhave"\i. i \ {n} \ h i = 0" using b by simp thenhave"(\i. h i) = (\i\{n}. h i)" by (metis sums_unique[OF sums_finite[OF a]]) thenhave"(\i. h i) = h n" by simp thenhave"(\n. f x * indicator (B n) x) = f x * indicator (B n) x" using h_def by simp thenhave"(\n. f x * indicator (B n) x) = f x" using \x \ B n\ indicator_def by simp thenshow ?thesis using\<open>x \<in> (\<Union>n. B n)\<close> by auto next assume"x \ (\n. B n)" thenhave"\n. f x * indicator (B n) x = 0" by simp have"(\n. f x * indicator (B n) x) = 0" by (simp add: \<open>\<And>n. f x * indicator (B n) x = 0\<close>) thenshow ?thesis using\<open>x \<notin> (\<Union>n. B n)\<close> by auto qed ultimatelyshow ?thesis by simp qed
lemma nn_set_integral_add: assumes [measurable]: "f \ borel_measurable M" "g \ borel_measurable M" "A \ sets M" shows"(\\<^sup>+x \ A. (f x + g x) \M) = (\\<^sup>+x \ A. f x \M) + (\\<^sup>+x \ A. g x \M)" proof - have"(\\<^sup>+x \ A. (f x + g x) \M) = (\\<^sup>+x. (f x * indicator A x + g x * indicator A x) \M)" by (auto simp add: indicator_def intro!: nn_integral_cong) alsohave"\ = (\\<^sup>+x. f x * indicator A x \M) + (\\<^sup>+x. g x * indicator A x \M)" apply (rule nn_integral_add) using assms(1) assms(2) by auto finallyshow ?thesis by simp qed
lemma nn_set_integral_cong: assumes"AE x in M. f x = g x" shows"(\\<^sup>+x \ A. f x \M) = (\\<^sup>+x \ A. g x \M)" apply (rule nn_integral_cong_AE) using assms(1) by auto
lemma nn_set_integral_set_mono: "A \ B \ (\\<^sup>+ x \ A. f x \M) \ (\\<^sup>+ x \ B. f x \M)" by (auto intro!: nn_integral_mono split: split_indicator)
lemma nn_set_integral_mono: assumes [measurable]: "f \ borel_measurable M" "g \ borel_measurable M" "A \ sets M" and"AE x\A in M. f x \ g x" shows"(\\<^sup>+x \ A. f x \M) \ (\\<^sup>+x \ A. g x \M)" by (auto intro!: nn_integral_mono_AE split: split_indicator simp: assms)
lemma nn_set_integral_space [simp]: shows"(\\<^sup>+ x \ space M. f x \M) = (\\<^sup>+x. f x \M)" by (metis (mono_tags, lifting) indicator_simps(1) mult.right_neutral nn_integral_cong)
lemma nn_integral_count_compose_inj: assumes"inj_on g A" shows"(\\<^sup>+x \ A. f (g x) \count_space UNIV) = (\\<^sup>+y \ g`A. f y \count_space UNIV)" proof - have"(\\<^sup>+x \ A. f (g x) \count_space UNIV) = (\\<^sup>+x. f (g x) \count_space A)" by (auto simp add: nn_integral_count_space_indicator[symmetric]) alsohave"\ = (\\<^sup>+y. f y \count_space (g`A))" by (simp add: assms nn_integral_bij_count_space inj_on_imp_bij_betw) alsohave"\ = (\\<^sup>+y \ g`A. f y \count_space UNIV)" by (auto simp add: nn_integral_count_space_indicator[symmetric]) finallyshow ?thesis by simp qed
lemma nn_integral_count_compose_bij: assumes"bij_betw g A B" shows"(\\<^sup>+x \ A. f (g x) \count_space UNIV) = (\\<^sup>+y \ B. f y \count_space UNIV)" proof - have"inj_on g A"using assms bij_betw_def by auto thenhave"(\\<^sup>+x \ A. f (g x) \count_space UNIV) = (\\<^sup>+y \ g`A. f y \count_space UNIV)" by (rule nn_integral_count_compose_inj) thenshow ?thesis using assms by (simp add: bij_betw_def) qed
lemma set_integral_null_delta: fixes f::"_ \ _ :: {banach, second_countable_topology}" assumes [measurable]: "integrable M f""A \ sets M" "B \ sets M" and null: "(A - B) \ (B - A) \ null_sets M" shows"(\x \ A. f x \M) = (\x \ B. f x \M)" proof (rule set_integral_cong_set) have *: "AE a in M. a \ (A - B) \ (B - A)" using null AE_not_in by blast thenshow"AE x in M. (x \ B) = (x \ A)" by auto qed (simp_all add: set_borel_measurable_def)
lemma set_integral_space: assumes"integrable M f" shows"(\x \ space M. f x \M) = (\x. f x \M)" by (metis (no_types, lifting) indicator_simps(1) integral_cong scaleR_one set_lebesgue_integral_def)
lemma null_if_pos_func_has_zero_nn_int: fixes f::"'a \ ennreal" assumes [measurable]: "f \ borel_measurable M" "A \ sets M" and"AE x\A in M. f x > 0" "(\\<^sup>+x\A. f x \M) = 0" shows"A \ null_sets M" proof - have"AE x in M. f x * indicator A x = 0" by (subst nn_integral_0_iff_AE[symmetric], auto simp add: assms(4)) thenhave"AE x\A in M. False" using assms(3) by auto thenshow"A \ null_sets M" using assms(2) by (simp add: AE_iff_null_sets) qed
lemma null_if_pos_func_has_zero_int: assumes [measurable]: "integrable M f""A \ sets M" and"AE x\A in M. f x > 0" "(\x\A. f x \M) = (0::real)" shows"A \ null_sets M" proof - have"AE x in M. indicator A x * f x = 0" apply (subst integral_nonneg_eq_0_iff_AE[symmetric]) using assms integrable_mult_indicator[OF \<open>A \<in> sets M\<close> assms(1)] by (auto simp: set_lebesgue_integral_def) thenhave"AE x\A in M. f x = 0" by auto thenhave"AE x\A in M. False" using assms(3) by auto thenshow"A \ null_sets M" using assms(2) by (simp add: AE_iff_null_sets) qed
text\<open>The next lemma is a variant of \<open>density_unique\<close>. Note that it uses the notation for nonnegative set integrals introduced earlier.\<close>
lemma (in sigma_finite_measure) density_unique2: assumes [measurable]: "f \ borel_measurable M" "f' \ borel_measurable M" assumes density_eq: "\A. A \ sets M \ (\\<^sup>+ x \ A. f x \M) = (\\<^sup>+ x \ A. f' x \M)" shows"AE x in M. f x = f' x" proof (rule density_unique) show"density M f = density M f'" by (intro measure_eqI) (auto simp: emeasure_density intro!: density_eq) qed (auto simp add: assms)
text\<open>The next lemma implies the same statement for Banach-space valued functions using Hahn-Banach theoremand linear forms. Since they are not yet easily available, I
only formulate it for real-valued functions.\<close>
lemma density_unique_real: fixes f f'::"_ \ real" assumes M[measurable]: "integrable M f""integrable M f'" assumes density_eq: "\A. A \ sets M \ (\x \ A. f x \M) = (\x \ A. f' x \M)" shows"AE x in M. f x = f' x" proof -
define A where"A = {x \ space M. f x < f' x}" thenhave [measurable]: "A \ sets M" by simp have"(\x \ A. (f' x - f x) \M) = (\x \ A. f' x \M) - (\x \ A. f x \M)" using\<open>A \<in> sets M\<close> M integrable_mult_indicator set_integrable_def by blast thenhave"(\x \ A. (f' x - f x) \M) = 0" using assms(3) by simp thenhave"A \ null_sets M" using A_def null_if_pos_func_has_zero_int[where ?f = "\x. f' x - f x" and ?A = A] assms by auto thenhave"AE x in M. x \ A" by (simp add: AE_not_in) thenhave *: "AE x in M. f' x \ f x" unfolding A_def by auto
define B where"B = {x \ space M. f' x < f x}" thenhave [measurable]: "B \ sets M" by simp have"(\x \ B. (f x - f' x) \M) = (\x \ B. f x \M) - (\x \ B. f' x \M)" using\<open>B \<in> sets M\<close> M integrable_mult_indicator set_integrable_def by blast thenhave"(\x \ B. (f x - f' x) \M) = 0" using assms(3) by simp thenhave"B \ null_sets M" using B_def null_if_pos_func_has_zero_int[where ?f = "\x. f x - f' x" and ?A = B] assms by auto thenhave"AE x in M. x \ B" by (simp add: AE_not_in) thenhave"AE x in M. f' x \ f x" unfolding B_def by auto thenshow ?thesis using * by auto qed
section \<open>Scheffé's lemma\<close>
text\<open>The next lemma shows that \<open>L\<^sup>1\<close> convergence of a sequence of functions follows from almost
everywhere convergence and the weaker condition of the convergence of the integrated norms (or even
just the nontrivial inequality about them). Useful in a lot of contexts! This statement (or its
variations) are known as Scheffe lemma.
The formalization is more painful as one should jump backand forth between reals and ereals andjustify
all the time positivity or integrability (thankfully, measurability is handled more or less automatically).\<close>
proposition Scheffe_lemma1: assumes"\n. integrable M (F n)" "integrable M f" "AE x in M. (\n. F n x) \ f x" "limsup (\n. \\<^sup>+ x. norm(F n x) \M) \ (\\<^sup>+ x. norm(f x) \M)" shows"(\n. \\<^sup>+ x. norm(F n x - f x) \M) \ 0" proof - have [measurable]: "\n. F n \ borel_measurable M" "f \ borel_measurable M" using assms(1) assms(2) by simp_all
define G where"G = (\n x. norm(f x) + norm(F n x) - norm(F n x - f x))" have [measurable]: "\n. G n \ borel_measurable M" unfolding G_def by simp have G_pos[simp]: "\n x. G n x \ 0" unfolding G_def by (metis ge_iff_diff_ge_0 norm_minus_commute norm_triangle_ineq4) have finint: "(\\<^sup>+ x. norm(f x) \M) \ \" using has_bochner_integral_implies_finite_norm[OF has_bochner_integral_integrable[OF \<open>integrable M f\<close>]] by simp thenhave fin2: "2 * (\\<^sup>+ x. norm(f x) \M) \ \" by (auto simp: ennreal_mult_eq_top_iff)
{ fix x assume *: "(\n. F n x) \ f x" thenhave"(\n. norm(F n x)) \ norm(f x)" using tendsto_norm by blast moreoverhave"(\n. norm(F n x - f x)) \ 0" using * Lim_null tendsto_norm_zero_iff by fastforce ultimatelyhave a: "(\n. norm(F n x) - norm(F n x - f x)) \ norm(f x)" using tendsto_diff by fastforce have"(\n. norm(f x) + (norm(F n x) - norm(F n x - f x))) \ norm(f x) + norm(f x)" by (rule tendsto_add) (auto simp add: a) moreoverhave"\n. G n x = norm(f x) + (norm(F n x) - norm(F n x - f x))" unfolding G_def by simp ultimatelyhave"(\n. G n x) \ 2 * norm(f x)" by simp thenhave"(\n. ennreal(G n x)) \ ennreal(2 * norm(f x))" by simp thenhave"liminf (\n. ennreal(G n x)) = ennreal(2 * norm(f x))" using sequentially_bot tendsto_iff_Liminf_eq_Limsup by blast
} thenhave"AE x in M. liminf (\n. ennreal(G n x)) = ennreal(2 * norm(f x))" using assms(3) by auto thenhave"(\\<^sup>+ x. liminf (\n. ennreal (G n x)) \M) = (\\<^sup>+ x. 2 * ennreal(norm(f x)) \M)" by (simp add: nn_integral_cong_AE ennreal_mult) alsohave"\ = 2 * (\\<^sup>+ x. norm(f x) \M)" by (rule nn_integral_cmult) auto finallyhave int_liminf: "(\\<^sup>+ x. liminf (\n. ennreal (G n x)) \M) = 2 * (\\<^sup>+ x. norm(f x) \M)" by simp
have"(\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M) = (\\<^sup>+x. norm(f x) \M) + (\\<^sup>+x. norm(F n x) \M)" for n by (rule nn_integral_add) (auto simp add: assms) thenhave"limsup (\n. (\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M)) =
limsup (\<lambda>n. (\<integral>\<^sup>+x. norm(f x) \<partial>M) + (\<integral>\<^sup>+x. norm(F n x) \<partial>M))" by simp alsohave"\ = (\\<^sup>+x. norm(f x) \M) + limsup (\n. (\\<^sup>+x. norm(F n x) \M))" by (rule Limsup_const_add, auto simp add: finint) alsohave"\ \ (\\<^sup>+x. norm(f x) \M) + (\\<^sup>+x. norm(f x) \M)" using assms(4) by (simp add: add_left_mono) alsohave"\ = 2 * (\\<^sup>+x. norm(f x) \M)" unfolding one_add_one[symmetric] distrib_right by simp ultimatelyhave a: "limsup (\n. (\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M)) \
2 * (\<integral>\<^sup>+x. norm(f x) \<partial>M)" by simp
have le: "ennreal (norm (F n x - f x)) \ ennreal (norm (f x)) + ennreal (norm (F n x))" for n x by (simp add: norm_minus_commute norm_triangle_ineq4 ennreal_minus flip: ennreal_plus) thenhave le2: "(\\<^sup>+ x. ennreal (norm (F n x - f x)) \M) \ (\\<^sup>+ x. ennreal (norm (f x)) + ennreal (norm (F n x)) \M)" for n by (rule nn_integral_mono)
have"2 * (\\<^sup>+ x. norm(f x) \M) = (\\<^sup>+ x. liminf (\n. ennreal (G n x)) \M)" by (simp add: int_liminf) alsohave"\ \ liminf (\n. (\\<^sup>+x. G n x \M))" by (rule nn_integral_liminf) auto alsohave"liminf (\n. (\\<^sup>+x. G n x \M)) =
liminf (\<lambda>n. (\<integral>\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \<partial>M) - (\<integral>\<^sup>+x. norm(F n x - f x) \<partial>M))" proof (intro arg_cong[where f=liminf] ext) fix n have"\x. ennreal(G n x) = ennreal(norm(f x)) + ennreal(norm(F n x)) - ennreal(norm(F n x - f x))" unfolding G_def by (simp add: ennreal_minus flip: ennreal_plus) moreoverhave"(\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) - ennreal(norm(F n x - f x)) \M)
= (\<integral>\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \<partial>M) - (\<integral>\<^sup>+x. norm(F n x - f x) \<partial>M)" proof (rule nn_integral_diff) from le show"AE x in M. ennreal (norm (F n x - f x)) \ ennreal (norm (f x)) + ennreal (norm (F n x))" by simp from le2 have"(\\<^sup>+x. ennreal (norm (F n x - f x)) \M) < \" using assms(1) assms(2) by (metis has_bochner_integral_implies_finite_norm integrable.simps Bochner_Integration.integrable_diff) thenshow"(\\<^sup>+x. ennreal (norm (F n x - f x)) \M) \ \" by simp qed (auto simp add: assms) ultimatelyshow"(\\<^sup>+x. G n x \M) = (\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M) - (\\<^sup>+x. norm(F n x - f x) \M)" by simp qed finallyhave"2 * (\\<^sup>+ x. norm(f x) \M) + limsup (\n. (\\<^sup>+x. norm(F n x - f x) \M)) \
liminf (\<lambda>n. (\<integral>\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \<partial>M) - (\<integral>\<^sup>+x. norm(F n x - f x) \<partial>M)) +
limsup (\<lambda>n. (\<integral>\<^sup>+x. norm(F n x - f x) \<partial>M))" by (intro add_mono) auto alsohave"\ \ (limsup (\n. \\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M) - limsup (\n. \\<^sup>+x. norm (F n x - f x) \M)) +
limsup (\<lambda>n. (\<integral>\<^sup>+x. norm(F n x - f x) \<partial>M))" by (intro add_mono liminf_minus_ennreal le2) auto alsohave"\ = limsup (\n. (\\<^sup>+x. ennreal(norm(f x)) + ennreal(norm(F n x)) \M))" by (intro diff_add_cancel_ennreal Limsup_mono always_eventually allI le2) alsohave"\ \ 2 * (\\<^sup>+x. norm(f x) \M)" by fact finallyhave"limsup (\n. (\\<^sup>+x. norm(F n x - f x) \M)) = 0" using fin2 by simp thenshow ?thesis by (rule tendsto_0_if_Limsup_eq_0_ennreal) qed
proposition Scheffe_lemma2: fixes F::"nat \ 'a \ 'b::{banach, second_countable_topology}" assumes"\ n::nat. F n \ borel_measurable M" "integrable M f" "AE x in M. (\n. F n x) \ f x" "\n. (\\<^sup>+ x. norm(F n x) \M) \ (\\<^sup>+ x. norm(f x) \M)" shows"(\n. \\<^sup>+ x. norm(F n x - f x) \M) \ 0" proof (rule Scheffe_lemma1) fix n::nat have"(\\<^sup>+ x. norm(f x) \M) < \" using assms(2) by (metis has_bochner_integral_implies_finite_norm integrable.cases) thenhave"(\\<^sup>+ x. norm(F n x) \M) < \" using assms(4)[of n] by auto thenshow"integrable M (F n)"by (subst integrable_iff_bounded, simp add: assms(1)[of n]) qed (auto simp add: assms Limsup_bounded)
lemma tendsto_set_lebesgue_integral_at_right: fixes a b :: real and f :: "real \ 'a :: {banach,second_countable_topology}" assumes"a < b"and sets: "\a'. a' \ {a<..b} \ {a'..b} \ sets M" and"set_integrable M {a<..b} f" shows"((\a'. set_lebesgue_integral M {a'..b} f) \
set_lebesgue_integral M {a<..b} f) (at_right a)" proof (rule tendsto_at_right_sequentially[OF assms(1)], goal_cases) case (1 S) have eq: "(\n. {S n..b}) = {a<..b}" proof safe fix x n assume"x \ {S n..b}" with 1(1,2)[of n] show"x \ {a<..b}" by auto next fix x assume"x \ {a<..b}" with order_tendstoD[OF \<open>S \<longlonglongrightarrow> a\<close>, of x] show "x \<in> (\<Union>n. {S n..b})" by (force simp: eventually_at_top_linorder dest: less_imp_le) qed have"(\n. set_lebesgue_integral M {S n..b} f) \ set_lebesgue_integral M (\n. {S n..b}) f" by (rule set_integral_cont_up) (insert assms 1, auto simp: eq incseq_def decseq_def less_imp_le) with eq show ?caseby simp qed
section \<open>Convergence of integrals over an interval\<close>
text\<open>
The nextlemmas relate convergence of integrals over an interval to
improper integrals. \<close> lemma tendsto_set_lebesgue_integral_at_left: fixes a b :: real and f :: "real \ 'a :: {banach,second_countable_topology}" assumes"a < b"and sets: "\b'. b' \ {a.. {a..b'} \ sets M" and"set_integrable M {a.. shows"((\b'. set_lebesgue_integral M {a..b'} f) \
set_lebesgue_integral M {a..<b} f) (at_left b)" proof (rule tendsto_at_left_sequentially[OF assms(1)], goal_cases) case (1 S) have eq: "(\n. {a..S n}) = {a.. proof safe fix x n assume"x \ {a..S n}" with 1(1,2)[of n] show"x \ {a.. next fix x assume"x \ {a.. with order_tendstoD[OF \<open>S \<longlonglongrightarrow> b\<close>, of x] show "x \<in> (\<Union>n. {a..S n})" by (force simp: eventually_at_top_linorder dest: less_imp_le) qed have"(\n. set_lebesgue_integral M {a..S n} f) \ set_lebesgue_integral M (\n. {a..S n}) f" by (rule set_integral_cont_up) (insert assms 1, auto simp: eq incseq_def decseq_def less_imp_le) with eq show ?caseby simp qed
proposition tendsto_set_lebesgue_integral_at_top: fixes f :: "real \ 'a::{banach, second_countable_topology}" assumes sets: "\b. b \ a \ {a..b} \ sets M" and int: "set_integrable M {a..} f" shows"((\b. set_lebesgue_integral M {a..b} f) \ set_lebesgue_integral M {a..} f) at_top" proof (rule tendsto_at_topI_sequentially) fix X :: "nat \ real" assume "filterlim X at_top sequentially" show"(\n. set_lebesgue_integral M {a..X n} f) \ set_lebesgue_integral M {a..} f" unfolding set_lebesgue_integral_def proof (rule integral_dominated_convergence) show"integrable M (\x. indicat_real {a..} x *\<^sub>R norm (f x))" using integrable_norm[OF int[unfolded set_integrable_def]] by simp show"AE x in M. (\n. indicator {a..X n} x *\<^sub>R f x) \ indicat_real {a..} x *\<^sub>R f x" proof fix x from\<open>filterlim X at_top sequentially\<close> have"eventually (\n. x \ X n) sequentially" unfolding filterlim_at_top_ge[where c=x] by auto thenshow"(\n. indicator {a..X n} x *\<^sub>R f x) \ indicat_real {a..} x *\<^sub>R f x" by (intro tendsto_eventually) (auto split: split_indicator elim!: eventually_mono) qed fix n show"AE x in M. norm (indicator {a..X n} x *\<^sub>R f x) \
indicator {a..} x *\<^sub>R norm (f x)" by (auto split: split_indicator) next from int show"(\x. indicat_real {a..} x *\<^sub>R f x) \ borel_measurable M" by (simp add: set_integrable_def) next fix n :: nat from sets have"{a..X n} \ sets M" by (cases "X n \ a") auto with int have"set_integrable M {a..X n} f" by (rule set_integrable_subset) auto thus"(\x. indicat_real {a..X n} x *\<^sub>R f x) \ borel_measurable M" by (simp add: set_integrable_def) qed qed
proposition tendsto_set_lebesgue_integral_at_bot: fixes f :: "real \ 'a::{banach, second_countable_topology}" assumes sets: "\a. a \ b \ {a..b} \ sets M" and int: "set_integrable M {..b} f" shows"((\a. set_lebesgue_integral M {a..b} f) \ set_lebesgue_integral M {..b} f) at_bot" proof (rule tendsto_at_botI_sequentially) fix X :: "nat \ real" assume "filterlim X at_bot sequentially" show"(\n. set_lebesgue_integral M {X n..b} f) \ set_lebesgue_integral M {..b} f" unfolding set_lebesgue_integral_def proof (rule integral_dominated_convergence) show"integrable M (\x. indicat_real {..b} x *\<^sub>R norm (f x))" using integrable_norm[OF int[unfolded set_integrable_def]] by simp show"AE x in M. (\n. indicator {X n..b} x *\<^sub>R f x) \ indicat_real {..b} x *\<^sub>R f x" proof fix x from\<open>filterlim X at_bot sequentially\<close> have"eventually (\n. x \ X n) sequentially" unfolding filterlim_at_bot_le[where c=x] by auto thenshow"(\n. indicator {X n..b} x *\<^sub>R f x) \ indicat_real {..b} x *\<^sub>R f x" by (intro tendsto_eventually) (auto split: split_indicator elim!: eventually_mono) qed fix n show"AE x in M. norm (indicator {X n..b} x *\<^sub>R f x) \
indicator {..b} x *\<^sub>R norm (f x)" by (auto split: split_indicator) next from int show"(\x. indicat_real {..b} x *\<^sub>R f x) \ borel_measurable M" by (simp add: set_integrable_def) next fix n :: nat from sets have"{X n..b} \ sets M" by (cases "X n \ b") auto with int have"set_integrable M {X n..b} f" by (rule set_integrable_subset) auto thus"(\x. indicat_real {X n..b} x *\<^sub>R f x) \ borel_measurable M" by (simp add: set_integrable_def) qed qed
theorem integral_Markov_inequality': fixes u :: "'a \ real" assumes [measurable]: "set_integrable M A u"and"A \ sets M" assumes"AE x in M. x \ A \ u x \ 0" and "0 < (c::real)" shows"emeasure M {x\A. u x \ c} \ (1/c::real) * (\x\A. u x \M)" proof - have"(\x. u x * indicator A x) \ borel_measurable M" using assms by (auto simp: set_integrable_def mult_ac) hence"(\x. ennreal (u x * indicator A x)) \ borel_measurable M" by measurable alsohave"(\x. ennreal (u x * indicator A x)) = (\x. ennreal (u x) * indicator A x)" by (intro ext) (auto simp: indicator_def) finallyhave meas: "\ \ borel_measurable M" . from assms(3) have AE: "AE x in M. 0 \ u x * indicator A x" by eventually_elim (auto simp: indicator_def) have nonneg: "set_lebesgue_integral M A u \ 0" unfolding set_lebesgue_integral_def by (intro Bochner_Integration.integral_nonneg_AE eventually_mono[OF AE]) (auto simp: mult_ac)
have A: "A \ space M" using\<open>A \<in> sets M\<close> by (simp add: sets.sets_into_space) have"{x \ A. u x \ c} = {x \ A. ennreal(1/c) * u x \ 1}" using\<open>c>0\<close> A by (auto simp: ennreal_mult'[symmetric]) thenhave"emeasure M {x \ A. u x \ c} = emeasure M ({x \ A. ennreal(1/c) * u x \1})" by simp alsohave"\ \ ennreal(1/c) * (\\<^sup>+ x. ennreal(u x) * indicator A x \M)" by (intro nn_integral_Markov_inequality meas assms) alsohave"(\\<^sup>+ x. ennreal(u x) * indicator A x \M) = ennreal (set_lebesgue_integral M A u)" unfolding set_lebesgue_integral_def nn_integral_set_ennreal using assms AE by (subst nn_integral_eq_integral) (simp_all add: mult_ac set_integrable_def) finallyshow ?thesis using\<open>c > 0\<close> nonneg by (subst ennreal_mult) auto qed
theorem integral_Markov_inequality'_measure: assumes [measurable]: "set_integrable M A u"and"A \ sets M" and"AE x in M. x \ A \ 0 \ u x" "0 < (c::real)" shows"measure M {x\A. u x \ c} \ (\x\A. u x \M) / c" proof - have nonneg: "set_lebesgue_integral M A u \ 0" unfolding set_lebesgue_integral_def by (intro Bochner_Integration.integral_nonneg_AE eventually_mono[OF assms(3)])
(auto simp: mult_ac) have le: "emeasure M {x\A. u x \ c} \ ennreal ((1/c) * (\x\A. u x \M))" by (rule integral_Markov_inequality') (use assms in auto) alsohave"\ < top" by auto finallyhave"ennreal (measure M {x\A. u x \ c}) = emeasure M {x\A. u x \ c}" by (intro emeasure_eq_ennreal_measure [symmetric]) auto alsonote le finallyshow ?thesis using nonneg by (subst (asm) ennreal_le_iff)
(auto intro!: divide_nonneg_pos Bochner_Integration.integral_nonneg_AE assms) qed
theorem%important (in finite_measure) Chernoff_ineq_ge: assumes s: "s > 0" assumes integrable: "set_integrable M A (\x. exp (s * f x))" and "A \ sets M" shows"measure M {x\A. f x \ a} \ exp (-s * a) * (\x\A. exp (s * f x) \M)" proof - have"{x\A. f x \ a} = {x\A. exp (s * f x) \ exp (s * a)}" using s by auto alsohave"measure M \ \ set_lebesgue_integral M A (\x. exp (s * f x)) / exp (s * a)" by (intro integral_Markov_inequality'_measure assms) auto finallyshow ?thesis by (simp add: exp_minus field_simps) qed
theorem%important (in finite_measure) Chernoff_ineq_le: assumes s: "s > 0" assumes integrable: "set_integrable M A (\x. exp (-s * f x))" and "A \ sets M" shows"measure M {x\A. f x \ a} \ exp (s * a) * (\x\A. exp (-s * f x) \M)" proof - have"{x\A. f x \ a} = {x\A. exp (-s * f x) \ exp (-s * a)}" using s by auto alsohave"measure M \ \ set_lebesgue_integral M A (\x. exp (-s * f x)) / exp (-s * a)" by (intro integral_Markov_inequality'_measure assms) auto finallyshow ?thesis by (simp add: exp_minus field_simps) qed
text\<open>This section is from the Martingales AFP entry, by Ata Keskin, TU München\<close>
text\<open>We restate some basic results concerning Bochner-integrable functions.\<close>
lemma integrable_implies_simple_function_sequence: fixes f :: "'a \ 'b::{banach, second_countable_topology}" assumes"integrable M f" obtains s where"\i. simple_function M (s i)" and"\i. emeasure M {y \ space M. s i y \ 0} \ \" and"\x. x \ space M \ (\i. s i x) \ f x" and"\x i. x \ space M \ norm (s i x) \ 2 * norm (f x)"
proof- have f: "f \ borel_measurable M" "(\\<^sup>+x. norm (f x) \M) < \" using assms unfolding integrable_iff_bounded by auto obtain s where s: "\i. simple_function M (s i)" "\x. x \ space M \ (\i. s i x) \ f x" "\i x. x \ space M \ norm (s i x) \ 2 * norm (f x)" using borel_measurable_implies_sequence_metric[OF f(1)] unfolding norm_conv_dist by metis
{ fix i have"(\\<^sup>+x. norm (s i x) \M) \ (\\<^sup>+x. ennreal (2 * norm (f x)) \M)" using s by (intro nn_integral_mono, auto) alsohave"\ < \" using f by (simp add: nn_integral_cmult ennreal_mult_less_top ennreal_mult)
--> --------------------
--> maximum size reached
--> --------------------
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.