diff -r aea11797247b -r 9c295f84d55f src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sun Feb 19 21:21:19 2023 +0000 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Mon Feb 20 15:19:53 2023 +0000 @@ -696,7 +696,7 @@ lemma nn_integral_has_integral_lebesgue: fixes f :: "'a::euclidean_space \ real" - assumes nonneg: "\x. 0 \ f x" and I: "(f has_integral I) \" + assumes nonneg: "\x. x \ \ \ 0 \ f x" and I: "(f has_integral I) \" shows "integral\<^sup>N lborel (\x. indicator \ x * f x) = I" proof - from I have "(\x. indicator \ x *\<^sub>R f x) \ lebesgue \\<^sub>M borel" @@ -713,8 +713,9 @@ by (rule nn_integral_has_integral_lborel[rotated 2]) auto also have "integral\<^sup>N lborel (\x. abs (f' x)) = integral\<^sup>N lborel (\x. abs (indicator \ x * f x))" using eq by (intro nn_integral_cong_AE) auto - finally show ?thesis - using nonneg by auto + also have "(\x. abs (indicator \ x * f x)) = (\x. indicator \ x * f x)" + using nonneg by (auto simp: indicator_def fun_eq_iff) + finally show ?thesis . qed lemma has_integral_iff_nn_integral_lebesgue: @@ -741,6 +742,38 @@ using f by (auto simp: nn_integral_completion) qed +lemma set_nn_integral_lborel_eq_integral: + fixes f::"'a::euclidean_space \ real" + assumes "set_borel_measurable borel A f" + assumes "\x. x \ A \ 0 \ f x" "(\\<^sup>+x\A. f x \lborel) < \" + shows "(\\<^sup>+x\A. f x \lborel) = integral A f" +proof - + have eq: "(\\<^sup>+x\A. f x \lborel) = (\\<^sup>+x. ennreal (indicator A x * f x) \lborel)" + by (intro nn_integral_cong) (auto simp: indicator_def) + also have "\ = integral UNIV (\x. indicator A x * f x)" + using assms eq by (intro nn_integral_lborel_eq_integral) + (auto simp: indicator_def set_borel_measurable_def) + also have "integral UNIV (\x. indicator A x * f x) = integral A (\x. indicator A x * f x)" + by (rule integral_spike_set) (auto intro: empty_imp_negligible) + + also have "\ = integral A f" + by (rule integral_cong) (auto simp: indicator_def) + finally show ?thesis . +qed + +lemma nn_integral_has_integral_lebesgue': + fixes f :: "'a::euclidean_space \ real" + assumes nonneg: "\x. x \ \ \ 0 \ f x" and I: "(f has_integral I) \" + shows "integral\<^sup>N lborel (\x. ennreal (f x) * indicator \ x) = ennreal I" +proof - + have "integral\<^sup>N lborel (\x. ennreal (f x) * indicator \ x) = + integral\<^sup>N lborel (\x. ennreal (indicator \ x * f x))" + by (intro nn_integral_cong) (auto simp: indicator_def) + also have "\ = ennreal I" + using assms by (intro nn_integral_has_integral_lebesgue) + finally show ?thesis . +qed + context fixes f::"'a::euclidean_space \ 'b::euclidean_space" begin @@ -959,7 +992,7 @@ show "(\x. indicator S x *\<^sub>R f x) \ borel_measurable lebesgue" using f has_integral_implies_lebesgue_measurable[of f _ S] by (auto simp: integrable_on_def) show "(\\<^sup>+ x. ennreal (norm (indicator S x *\<^sub>R f x)) \lebesgue) < \" - using nf nn_integral_has_integral_lebesgue[of "\x. norm (f x)" _ S] + using nf nn_integral_has_integral_lebesgue[of _ "\x. norm (f x)"] by (auto simp: integrable_on_def nn_integral_completion) qed qed