src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy
changeset 57137 f174712d0a84
parent 57025 e7fd64f82876
child 57275 0ddb5b755cdc
equal deleted inserted replaced
57136:653e56c6c963 57137:f174712d0a84
  1731     by simp
  1731     by simp
  1732 qed simp
  1732 qed simp
  1733 
  1733 
  1734 subsubsection {* Measures with Restricted Space *}
  1734 subsubsection {* Measures with Restricted Space *}
  1735 
  1735 
       
  1736 lemma simple_function_iff_borel_measurable:
       
  1737   fixes f :: "'a \<Rightarrow> 'x::{t2_space}"
       
  1738   shows "simple_function M f \<longleftrightarrow> finite (f ` space M) \<and> f \<in> borel_measurable M"
       
  1739   by (metis borel_measurable_simple_function simple_functionD(1) simple_function_borel_measurable)
       
  1740 
       
  1741 lemma simple_function_restrict_space_ereal:
       
  1742   fixes f :: "'a \<Rightarrow> ereal"
       
  1743   assumes "\<Omega> \<inter> space M \<in> sets M"
       
  1744   shows "simple_function (restrict_space M \<Omega>) f \<longleftrightarrow> simple_function M (\<lambda>x. f x * indicator \<Omega> x)"
       
  1745 proof -
       
  1746   { assume "finite (f ` space (restrict_space M \<Omega>))"
       
  1747     then have "finite (f ` space (restrict_space M \<Omega>) \<union> {0})" by simp
       
  1748     then have "finite ((\<lambda>x. f x * indicator \<Omega> x) ` space M)"
       
  1749       by (rule rev_finite_subset) (auto split: split_indicator simp: space_restrict_space) }
       
  1750   moreover
       
  1751   { assume "finite ((\<lambda>x. f x * indicator \<Omega> x) ` space M)"
       
  1752     then have "finite (f ` space (restrict_space M \<Omega>))"
       
  1753       by (rule rev_finite_subset) (auto split: split_indicator simp: space_restrict_space) }
       
  1754   ultimately show ?thesis
       
  1755     unfolding simple_function_iff_borel_measurable
       
  1756       borel_measurable_restrict_space_iff_ereal[OF assms]
       
  1757     by auto
       
  1758 qed
       
  1759 
       
  1760 lemma simple_function_restrict_space:
       
  1761   fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
       
  1762   assumes "\<Omega> \<inter> space M \<in> sets M"
       
  1763   shows "simple_function (restrict_space M \<Omega>) f \<longleftrightarrow> simple_function M (\<lambda>x. indicator \<Omega> x *\<^sub>R f x)"
       
  1764 proof -
       
  1765   { assume "finite (f ` space (restrict_space M \<Omega>))"
       
  1766     then have "finite (f ` space (restrict_space M \<Omega>) \<union> {0})" by simp
       
  1767     then have "finite ((\<lambda>x. indicator \<Omega> x *\<^sub>R f x) ` space M)"
       
  1768       by (rule rev_finite_subset) (auto split: split_indicator simp: space_restrict_space) }
       
  1769   moreover
       
  1770   { assume "finite ((\<lambda>x. indicator \<Omega> x *\<^sub>R f x) ` space M)"
       
  1771     then have "finite (f ` space (restrict_space M \<Omega>))"
       
  1772       by (rule rev_finite_subset) (auto split: split_indicator simp: space_restrict_space) }
       
  1773   ultimately show ?thesis
       
  1774     unfolding simple_function_iff_borel_measurable
       
  1775       borel_measurable_restrict_space_iff[OF assms]
       
  1776     by auto
       
  1777 qed
       
  1778 
       
  1779 
       
  1780 lemma split_indicator_asm: "P (indicator Q x) = (\<not> (x \<in> Q \<and> \<not> P 1 \<or> x \<notin> Q \<and> \<not> P 0))"
       
  1781   by (auto split: split_indicator)
       
  1782 
       
  1783 lemma simple_integral_restrict_space:
       
  1784   assumes \<Omega>: "\<Omega> \<inter> space M \<in> sets M" "simple_function (restrict_space M \<Omega>) f"
       
  1785   shows "simple_integral (restrict_space M \<Omega>) f = simple_integral M (\<lambda>x. f x * indicator \<Omega> x)"
       
  1786   using simple_function_restrict_space_ereal[THEN iffD1, OF \<Omega>, THEN simple_functionD(1)]
       
  1787   by (auto simp add: space_restrict_space emeasure_restrict_space[OF \<Omega>(1)] le_infI2 simple_integral_def
       
  1788            split: split_indicator split_indicator_asm
       
  1789            intro!: setsum_mono_zero_cong_left ereal_left_mult_cong arg_cong2[where f=emeasure])
       
  1790 
       
  1791 lemma one_not_less_zero[simp]: "\<not> 1 < (0::ereal)"
       
  1792   by (simp add: zero_ereal_def one_ereal_def) 
       
  1793 
  1736 lemma nn_integral_restrict_space:
  1794 lemma nn_integral_restrict_space:
  1737   assumes \<Omega>: "\<Omega> \<in> sets M" and f: "f \<in> borel_measurable M" "\<And>x. 0 \<le> f x" "\<And>x. x \<in> space M - \<Omega> \<Longrightarrow> f x = 0"
  1795   assumes \<Omega>[simp]: "\<Omega> \<inter> space M \<in> sets M"
  1738   shows "nn_integral (restrict_space M \<Omega>) f = nn_integral M f"
  1796   shows "nn_integral (restrict_space M \<Omega>) f = nn_integral M (\<lambda>x. f x * indicator \<Omega> x)"
  1739 using f proof (induct rule: borel_measurable_induct)
  1797 proof -
  1740   case (cong f g) then show ?case
  1798   let ?R = "restrict_space M \<Omega>" and ?X = "\<lambda>M f. {s. simple_function M s \<and> s \<le> max 0 \<circ> f \<and> range s \<subseteq> {0 ..< \<infinity>}}"
  1741     using nn_integral_cong[of M f g] nn_integral_cong[of "restrict_space M \<Omega>" f g]
  1799   have "integral\<^sup>S ?R ` ?X ?R f = integral\<^sup>S M ` ?X M (\<lambda>x. f x * indicator \<Omega> x)"
  1742       sets.sets_into_space[OF `\<Omega> \<in> sets M`]
  1800   proof (safe intro!: image_eqI)
  1743     by (simp add: subset_eq space_restrict_space)
  1801     fix s assume s: "simple_function ?R s" "s \<le> max 0 \<circ> f" "range s \<subseteq> {0..<\<infinity>}"
  1744 next
  1802     from s show "integral\<^sup>S (restrict_space M \<Omega>) s = integral\<^sup>S M (\<lambda>x. s x * indicator \<Omega> x)"
  1745   case (set A)
  1803       by (intro simple_integral_restrict_space) auto
  1746   then have "A \<subseteq> \<Omega>"
  1804     from s show "simple_function M (\<lambda>x. s x * indicator \<Omega> x)"
  1747     unfolding indicator_eq_0_iff by (auto dest: sets.sets_into_space)
  1805       by (simp add: simple_function_restrict_space_ereal)
  1748   with set `\<Omega> \<in> sets M` sets.sets_into_space[OF `\<Omega> \<in> sets M`] show ?case
  1806     from s show "(\<lambda>x. s x * indicator \<Omega> x) \<le> max 0 \<circ> (\<lambda>x. f x * indicator \<Omega> x)"
  1749     by (subst nn_integral_indicator')
  1807       "\<And>x. s x * indicator \<Omega> x \<in> {0..<\<infinity>}"
  1750        (auto simp add: sets_restrict_space_iff space_restrict_space
  1808       by (auto split: split_indicator simp: le_fun_def image_subset_iff)
  1751                   emeasure_restrict_space Int_absorb2
  1809   next
  1752                 dest: sets.sets_into_space)
  1810     fix s assume s: "simple_function M s" "s \<le> max 0 \<circ> (\<lambda>x. f x * indicator \<Omega> x)" "range s \<subseteq> {0..<\<infinity>}"
  1753 next
  1811     then have "simple_function M (\<lambda>x. s x * indicator (\<Omega> \<inter> space M) x)" (is ?s')
  1754   case (mult f c) then show ?case
  1812       by (intro simple_function_mult simple_function_indicator) auto
  1755     by (cases "c = 0") (simp_all add: measurable_restrict_space1 \<Omega> nn_integral_cmult)
  1813     also have "?s' \<longleftrightarrow> simple_function M (\<lambda>x. s x * indicator \<Omega> x)"
  1756 next
  1814       by (rule simple_function_cong) (auto split: split_indicator)
  1757   case (add f g) then show ?case
  1815     finally show sf: "simple_function (restrict_space M \<Omega>) s"
  1758     by (simp add: measurable_restrict_space1 \<Omega> nn_integral_add ereal_add_nonneg_eq_0_iff)
  1816       by (simp add: simple_function_restrict_space_ereal)
  1759 next
  1817 
  1760   case (seq F) then show ?case
  1818     from s have s_eq: "s = (\<lambda>x. s x * indicator \<Omega> x)"
  1761     by (auto simp add: SUP_eq_iff measurable_restrict_space1 \<Omega> nn_integral_monotone_convergence_SUP)
  1819       by (auto simp add: fun_eq_iff le_fun_def image_subset_iff
       
  1820                   split: split_indicator split_indicator_asm
       
  1821                   intro: antisym)
       
  1822 
       
  1823     show "integral\<^sup>S M s = integral\<^sup>S (restrict_space M \<Omega>) s"
       
  1824       by (subst s_eq) (rule simple_integral_restrict_space[symmetric, OF \<Omega> sf])
       
  1825     show "\<And>x. s x \<in> {0..<\<infinity>}"
       
  1826       using s by (auto simp: image_subset_iff)
       
  1827     from s show "s \<le> max 0 \<circ> f" 
       
  1828       by (subst s_eq) (auto simp: image_subset_iff le_fun_def split: split_indicator split_indicator_asm)
       
  1829   qed
       
  1830   then show ?thesis
       
  1831     unfolding nn_integral_def_finite SUP_def by simp
  1762 qed
  1832 qed
  1763 
  1833 
  1764 subsubsection {* Measure spaces with an associated density *}
  1834 subsubsection {* Measure spaces with an associated density *}
  1765 
  1835 
  1766 definition density :: "'a measure \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where
  1836 definition density :: "'a measure \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where