src/HOL/Probability/Lebesgue_Integral_Substitution.thy
changeset 63540 f8652d0534fa
parent 62975 1d066f6ab25d
equal deleted inserted replaced
63539:70d4d9e5707b 63540:f8652d0534fa
   321   assumes "a \<le> b"
   321   assumes "a \<le> b"
   322   shows "set_integrable lborel {a..b} (\<lambda>x. f (g x) * g' x)"
   322   shows "set_integrable lborel {a..b} (\<lambda>x. f (g x) * g' x)"
   323     and "(LBINT x. f x * indicator {g a..g b} x) = (LBINT x. f (g x) * g' x * indicator {a..b} x)"
   323     and "(LBINT x. f x * indicator {g a..g b} x) = (LBINT x. f (g x) * g' x * indicator {a..b} x)"
   324 proof-
   324 proof-
   325   from derivg have contg: "continuous_on {a..b} g" by (rule has_real_derivative_imp_continuous_on)
   325   from derivg have contg: "continuous_on {a..b} g" by (rule has_real_derivative_imp_continuous_on)
   326   from this and contg' have Mg: "set_borel_measurable borel {a..b} g" and
   326   with contg' have Mg: "set_borel_measurable borel {a..b} g"
   327                              Mg': "set_borel_measurable borel {a..b} g'"
   327     and Mg': "set_borel_measurable borel {a..b} g'"
   328       by (simp_all only: set_measurable_continuous_on_ivl)
   328     by (simp_all only: set_measurable_continuous_on_ivl)
   329   from derivg derivg_nonneg have monog: "\<And>x y. a \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> b \<Longrightarrow> g x \<le> g y"
   329   from derivg derivg_nonneg have monog: "\<And>x y. a \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> b \<Longrightarrow> g x \<le> g y"
   330     by (rule deriv_nonneg_imp_mono) simp_all
   330     by (rule deriv_nonneg_imp_mono) simp_all
   331 
   331 
   332   have "(\<lambda>x. ennreal (f x) * indicator {g a..g b} x) =
   332   have "(\<lambda>x. ennreal (f x) * indicator {g a..g b} x) =
   333            (\<lambda>x. ennreal (f x * indicator {g a..g b} x))"
   333            (\<lambda>x. ennreal (f x * indicator {g a..g b} x))"
   339 
   339 
   340   have "LBINT x. (f x :: real) * indicator {g a..g b} x =
   340   have "LBINT x. (f x :: real) * indicator {g a..g b} x =
   341           enn2real (\<integral>\<^sup>+ x. ennreal (f x) * indicator {g a..g b} x \<partial>lborel) -
   341           enn2real (\<integral>\<^sup>+ x. ennreal (f x) * indicator {g a..g b} x \<partial>lborel) -
   342           enn2real (\<integral>\<^sup>+ x. ennreal (- (f x)) * indicator {g a..g b} x \<partial>lborel)" using integrable
   342           enn2real (\<integral>\<^sup>+ x. ennreal (- (f x)) * indicator {g a..g b} x \<partial>lborel)" using integrable
   343     by (subst real_lebesgue_integral_def) (simp_all add: nn_integral_set_ennreal mult.commute)
   343     by (subst real_lebesgue_integral_def) (simp_all add: nn_integral_set_ennreal mult.commute)
   344   also have "(\<integral>\<^sup>+x. ennreal (f x) * indicator {g a..g b} x \<partial>lborel) =
   344   also have *: "(\<integral>\<^sup>+x. ennreal (f x) * indicator {g a..g b} x \<partial>lborel) =
   345                (\<integral>\<^sup>+x. ennreal (f x * indicator {g a..g b} x) \<partial>lborel)"
   345       (\<integral>\<^sup>+x. ennreal (f x * indicator {g a..g b} x) \<partial>lborel)"
   346     by (intro nn_integral_cong) (simp split: split_indicator)
   346     by (intro nn_integral_cong) (simp split: split_indicator)
   347   also with M1 have A: "(\<integral>\<^sup>+ x. ennreal (f x * indicator {g a..g b} x) \<partial>lborel) =
   347   also from M1 * have A: "(\<integral>\<^sup>+ x. ennreal (f x * indicator {g a..g b} x) \<partial>lborel) =
   348                             (\<integral>\<^sup>+ x. ennreal (f (g x) * g' x * indicator {a..b} x) \<partial>lborel)"
   348                             (\<integral>\<^sup>+ x. ennreal (f (g x) * g' x * indicator {a..b} x) \<partial>lborel)"
   349     by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
   349     by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
   350        (auto simp: nn_integral_set_ennreal mult.commute)
   350        (auto simp: nn_integral_set_ennreal mult.commute)
   351   also have "(\<integral>\<^sup>+ x. ennreal (- (f x)) * indicator {g a..g b} x \<partial>lborel) =
   351   also have **: "(\<integral>\<^sup>+ x. ennreal (- (f x)) * indicator {g a..g b} x \<partial>lborel) =
   352                (\<integral>\<^sup>+ x. ennreal (- (f x) * indicator {g a..g b} x) \<partial>lborel)"
   352       (\<integral>\<^sup>+ x. ennreal (- (f x) * indicator {g a..g b} x) \<partial>lborel)"
   353     by (intro nn_integral_cong) (simp split: split_indicator)
   353     by (intro nn_integral_cong) (simp split: split_indicator)
   354   also with M2 have B: "(\<integral>\<^sup>+ x. ennreal (- (f x) * indicator {g a..g b} x) \<partial>lborel) =
   354   also from M2 ** have B: "(\<integral>\<^sup>+ x. ennreal (- (f x) * indicator {g a..g b} x) \<partial>lborel) =
   355                             (\<integral>\<^sup>+ x. ennreal (- (f (g x)) * g' x * indicator {a..b} x) \<partial>lborel)"
   355         (\<integral>\<^sup>+ x. ennreal (- (f (g x)) * g' x * indicator {a..b} x) \<partial>lborel)"
   356     by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
   356     by (subst nn_integral_substitution[OF _ derivg contg' derivg_nonneg \<open>a \<le> b\<close>])
   357        (auto simp: nn_integral_set_ennreal mult.commute)
   357        (auto simp: nn_integral_set_ennreal mult.commute)
   358 
   358 
   359   also {
   359   also {
   360     from integrable have Mf: "set_borel_measurable borel {g a..g b} f"
   360     from integrable have Mf: "set_borel_measurable borel {g a..g b} f"