src/HOL/Probability/Lebesgue_Integration.thy
changeset 41097 a1abfa4e2b44
parent 41096 843c40bbc379
child 41544 c3b977fee8a3
equal deleted inserted replaced
41096:843c40bbc379 41097:a1abfa4e2b44
  1174 proof safe
  1174 proof safe
  1175   fix i show "positive_integral (f i) \<le> positive_integral (f (Suc i))"
  1175   fix i show "positive_integral (f i) \<le> positive_integral (f (Suc i))"
  1176     apply (rule positive_integral_mono)
  1176     apply (rule positive_integral_mono)
  1177     using `f \<up> u` unfolding isoton_def le_fun_def by auto
  1177     using `f \<up> u` unfolding isoton_def le_fun_def by auto
  1178 next
  1178 next
  1179   have "u \<in> borel_measurable M"
       
  1180     using borel_measurable_SUP[of UNIV f] assms by (auto simp: isoton_def)
       
  1181   have u: "u = (SUP i. f i)" using `f \<up> u` unfolding isoton_def by auto
  1179   have u: "u = (SUP i. f i)" using `f \<up> u` unfolding isoton_def by auto
  1182 
  1180 
  1183   show "(SUP i. positive_integral (f i)) = positive_integral u"
  1181   show "(SUP i. positive_integral (f i)) = positive_integral u"
  1184   proof (rule antisym)
  1182   proof (rule antisym)
  1185     from `f \<up> u`[THEN isoton_Sup, unfolded le_fun_def]
  1183     from `f \<up> u`[THEN isoton_Sup, unfolded le_fun_def]
  1196   assumes "\<And>i x. x \<in> space M \<Longrightarrow> f i x \<le> f (Suc i) x"
  1194   assumes "\<And>i x. x \<in> space M \<Longrightarrow> f i x \<le> f (Suc i) x"
  1197   assumes "\<And>i. f i \<in> borel_measurable M"
  1195   assumes "\<And>i. f i \<in> borel_measurable M"
  1198   shows "(SUP i. positive_integral (f i)) = positive_integral (\<lambda>x. SUP i. f i x)"
  1196   shows "(SUP i. positive_integral (f i)) = positive_integral (\<lambda>x. SUP i. f i x)"
  1199     (is "_ = positive_integral ?u")
  1197     (is "_ = positive_integral ?u")
  1200 proof -
  1198 proof -
  1201   have "?u \<in> borel_measurable M"
       
  1202     using borel_measurable_SUP[of _ f] assms by (simp add: SUPR_fun_expand)
       
  1203   show ?thesis
  1199   show ?thesis
  1204   proof (rule antisym)
  1200   proof (rule antisym)
  1205     show "(SUP j. positive_integral (f j)) \<le> positive_integral ?u"
  1201     show "(SUP j. positive_integral (f j)) \<le> positive_integral ?u"
  1206       by (auto intro!: SUP_leI positive_integral_mono le_SUPI)
  1202       by (auto intro!: SUP_leI positive_integral_mono le_SUPI)
  1207   next
  1203   next
  1208     def rf \<equiv> "\<lambda>i. \<lambda>x\<in>space M. f i x" and ru \<equiv> "\<lambda>x\<in>space M. ?u x"
  1204     def rf \<equiv> "\<lambda>i. \<lambda>x\<in>space M. f i x" and ru \<equiv> "\<lambda>x\<in>space M. ?u x"
  1209     have "\<And>i. rf i \<in> borel_measurable M" unfolding rf_def
  1205     have "\<And>i. rf i \<in> borel_measurable M" unfolding rf_def
  1210       using assms by (simp cong: measurable_cong)
  1206       using assms by (simp cong: measurable_cong)
  1211     moreover have iso: "rf \<up> ru" using assms unfolding rf_def ru_def
  1207     moreover have iso: "rf \<up> ru" using assms unfolding rf_def ru_def
  1212       unfolding isoton_def SUPR_fun_expand le_fun_def fun_eq_iff
  1208       unfolding isoton_def le_fun_def fun_eq_iff SUPR_apply
  1213       using SUP_const[OF UNIV_not_empty]
  1209       using SUP_const[OF UNIV_not_empty]
  1214       by (auto simp: restrict_def le_fun_def SUPR_fun_expand fun_eq_iff)
  1210       by (auto simp: restrict_def le_fun_def fun_eq_iff)
  1215     ultimately have "positive_integral ru \<le> (SUP i. positive_integral (rf i))"
  1211     ultimately have "positive_integral ru \<le> (SUP i. positive_integral (rf i))"
  1216       unfolding positive_integral_alt[of ru]
  1212       unfolding positive_integral_alt[of ru]
  1217       by (auto simp: le_fun_def intro!: SUP_leI positive_integral_SUP_approx)
  1213       by (auto simp: le_fun_def intro!: SUP_leI positive_integral_SUP_approx)
  1218     then show "positive_integral ?u \<le> (SUP i. positive_integral (f i))"
  1214     then show "positive_integral ?u \<le> (SUP i. positive_integral (f i))"
  1219       unfolding ru_def rf_def by (simp cong: positive_integral_cong)
  1215       unfolding ru_def rf_def by (simp cong: positive_integral_cong)
  1352 
  1348 
  1353 text {* Fatou's lemma: convergence theorem on limes inferior *}
  1349 text {* Fatou's lemma: convergence theorem on limes inferior *}
  1354 lemma (in measure_space) positive_integral_lim_INF:
  1350 lemma (in measure_space) positive_integral_lim_INF:
  1355   fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> pextreal"
  1351   fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> pextreal"
  1356   assumes "\<And>i. u i \<in> borel_measurable M"
  1352   assumes "\<And>i. u i \<in> borel_measurable M"
  1357   shows "positive_integral (SUP n. INF m. u (m + n)) \<le>
  1353   shows "positive_integral (\<lambda>x. SUP n. INF m. u (m + n) x) \<le>
  1358     (SUP n. INF m. positive_integral (u (m + n)))"
  1354     (SUP n. INF m. positive_integral (u (m + n)))"
  1359 proof -
  1355 proof -
  1360   have "(SUP n. INF m. u (m + n)) \<in> borel_measurable M"
  1356   have "positive_integral (\<lambda>x. SUP n. INF m. u (m + n) x)
  1361     by (auto intro!: borel_measurable_SUP borel_measurable_INF assms)
  1357       = (SUP n. positive_integral (\<lambda>x. INF m. u (m + n) x))"
  1362 
  1358     using assms
  1363   have "(\<lambda>n. INF m. u (m + n)) \<up> (SUP n. INF m. u (m + n))"
  1359     by (intro positive_integral_monotone_convergence_SUP[symmetric] INF_mono)
  1364   proof (unfold isoton_def, safe intro!: INF_mono bexI)
  1360        (auto simp del: add_Suc simp add: add_Suc[symmetric])
  1365     fix i m show "u (Suc m + i) \<le> u (m + Suc i)" by simp
       
  1366   qed simp
       
  1367   from positive_integral_isoton[OF this] assms
       
  1368   have "positive_integral (SUP n. INF m. u (m + n)) =
       
  1369     (SUP n. positive_integral (INF m. u (m + n)))"
       
  1370     unfolding isoton_def by (simp add: borel_measurable_INF)
       
  1371   also have "\<dots> \<le> (SUP n. INF m. positive_integral (u (m + n)))"
  1361   also have "\<dots> \<le> (SUP n. INF m. positive_integral (u (m + n)))"
  1372     apply (rule SUP_mono)
  1362     by (auto intro!: SUP_mono bexI le_INFI positive_integral_mono INF_leI)
  1373     apply (rule_tac x=n in bexI)
       
  1374     by (auto intro!: positive_integral_mono INFI_bound INF_leI exI simp: INFI_fun_expand)
       
  1375   finally show ?thesis .
  1363   finally show ?thesis .
  1376 qed
  1364 qed
  1377 
  1365 
  1378 lemma (in measure_space) measure_space_density:
  1366 lemma (in measure_space) measure_space_density:
  1379   assumes borel: "u \<in> borel_measurable M"
  1367   assumes borel: "u \<in> borel_measurable M"
  1958   have SUP_F: "\<And>x. (SUP n. Real (f n x)) = Real (u x)"
  1946   have SUP_F: "\<And>x. (SUP n. Real (f n x)) = Real (u x)"
  1959     using mono pos pos_u lim by (rule SUP_eq_LIMSEQ[THEN iffD2])
  1947     using mono pos pos_u lim by (rule SUP_eq_LIMSEQ[THEN iffD2])
  1960 
  1948 
  1961   have borel_f: "\<And>i. (\<lambda>x. Real (f i x)) \<in> borel_measurable M"
  1949   have borel_f: "\<And>i. (\<lambda>x. Real (f i x)) \<in> borel_measurable M"
  1962     using i unfolding integrable_def by auto
  1950     using i unfolding integrable_def by auto
  1963   hence "(SUP i. (\<lambda>x. Real (f i x))) \<in> borel_measurable M"
  1951   hence "(\<lambda>x. SUP i. Real (f i x)) \<in> borel_measurable M"
  1964     by auto
  1952     by auto
  1965   hence borel_u: "u \<in> borel_measurable M"
  1953   hence borel_u: "u \<in> borel_measurable M"
  1966     using pos_u by (auto simp: borel_measurable_Real_eq SUPR_fun_expand SUP_F)
  1954     using pos_u by (auto simp: borel_measurable_Real_eq SUP_F)
  1967 
  1955 
  1968   have integral_eq: "\<And>n. positive_integral (\<lambda>x. Real (f n x)) = Real (integral (f n))"
  1956   have integral_eq: "\<And>n. positive_integral (\<lambda>x. Real (f n x)) = Real (integral (f n))"
  1969     using i unfolding integral_def integrable_def by (auto simp: Real_real)
  1957     using i unfolding integral_def integrable_def by (auto simp: Real_real)
  1970 
  1958 
  1971   have pos_integral: "\<And>n. 0 \<le> integral (f n)"
  1959   have pos_integral: "\<And>n. 0 \<le> integral (f n)"
  2142     qed
  2130     qed
  2143     hence "\<And>i. positive_integral (\<lambda>x. Real \<bar>u i x - u' x\<bar>) = 0" using eq_0 by auto
  2131     hence "\<And>i. positive_integral (\<lambda>x. Real \<bar>u i x - u' x\<bar>) = 0" using eq_0 by auto
  2144     thus ?thesis by simp
  2132     thus ?thesis by simp
  2145   next
  2133   next
  2146     assume neq_0: "positive_integral (\<lambda>x. Real (2 * w x)) \<noteq> 0"
  2134     assume neq_0: "positive_integral (\<lambda>x. Real (2 * w x)) \<noteq> 0"
  2147     have "positive_integral (\<lambda>x. Real (2 * w x)) = positive_integral (SUP n. INF m. (\<lambda>x. Real (?diff (m + n) x)))"
  2135     have "positive_integral (\<lambda>x. Real (2 * w x)) = positive_integral (\<lambda>x. SUP n. INF m. Real (?diff (m + n) x))"
  2148     proof (rule positive_integral_cong, unfold SUPR_fun_expand INFI_fun_expand, subst add_commute)
  2136     proof (rule positive_integral_cong, subst add_commute)
  2149       fix x assume x: "x \<in> space M"
  2137       fix x assume x: "x \<in> space M"
  2150       show "Real (2 * w x) = (SUP n. INF m. Real (?diff (n + m) x))"
  2138       show "Real (2 * w x) = (SUP n. INF m. Real (?diff (n + m) x))"
  2151       proof (rule LIMSEQ_imp_lim_INF[symmetric])
  2139       proof (rule LIMSEQ_imp_lim_INF[symmetric])
  2152         fix j show "0 \<le> ?diff j x" using diff_less_2w[OF x, of j] by simp
  2140         fix j show "0 \<le> ?diff j x" using diff_less_2w[OF x, of j] by simp
  2153       next
  2141       next