src/HOL/Probability/Nonnegative_Lebesgue_Integration.thy
changeset 60636 ee18efe9b246
parent 60614 e39e6881985c
child 61169 4de9ff3ea29a
equal deleted inserted replaced
60635:22830a64358f 60636:ee18efe9b246
  1543     using f by (intro INF_shift[symmetric] nn_integral_mono antimonoI le_funI max.mono) 
  1543     using f by (intro INF_shift[symmetric] nn_integral_mono antimonoI le_funI max.mono) 
  1544                (auto simp: decseq_def le_fun_def)
  1544                (auto simp: decseq_def le_fun_def)
  1545   finally show ?thesis unfolding nn_integral_max_0 .
  1545   finally show ?thesis unfolding nn_integral_max_0 .
  1546 qed
  1546 qed
  1547 
  1547 
  1548 lemma sup_continuous_nn_integral:
  1548 lemma sup_continuous_nn_integral[order_continuous_intros]:
  1549   assumes f: "\<And>y. sup_continuous (f y)"
  1549   assumes f: "\<And>y. sup_continuous (f y)"
  1550   assumes [measurable]: "\<And>x. (\<lambda>y. f y x) \<in> borel_measurable M"
  1550   assumes [measurable]: "\<And>x. (\<lambda>y. f y x) \<in> borel_measurable M"
  1551   shows "sup_continuous (\<lambda>x. (\<integral>\<^sup>+y. f y x \<partial>M))"
  1551   shows "sup_continuous (\<lambda>x. (\<integral>\<^sup>+y. f y x \<partial>M))"
  1552   unfolding sup_continuous_def
  1552   unfolding sup_continuous_def
  1553 proof safe
  1553 proof safe
  1555   with sup_continuous_mono[OF f] show "(\<integral>\<^sup>+ y. f y (SUPREMUM UNIV C) \<partial>M) = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)"
  1555   with sup_continuous_mono[OF f] show "(\<integral>\<^sup>+ y. f y (SUPREMUM UNIV C) \<partial>M) = (SUP i. \<integral>\<^sup>+ y. f y (C i) \<partial>M)"
  1556     unfolding sup_continuousD[OF f C]
  1556     unfolding sup_continuousD[OF f C]
  1557     by (subst nn_integral_monotone_convergence_SUP) (auto simp: mono_def le_fun_def)
  1557     by (subst nn_integral_monotone_convergence_SUP) (auto simp: mono_def le_fun_def)
  1558 qed
  1558 qed
  1559 
  1559 
  1560 lemma inf_continuous_nn_integral:
  1560 lemma inf_continuous_nn_integral[order_continuous_intros]:
  1561   assumes f: "\<And>y. inf_continuous (f y)"
  1561   assumes f: "\<And>y. inf_continuous (f y)"
  1562   assumes [measurable]: "\<And>x. (\<lambda>y. f y x) \<in> borel_measurable M"
  1562   assumes [measurable]: "\<And>x. (\<lambda>y. f y x) \<in> borel_measurable M"
  1563   assumes bnd: "\<And>x. (\<integral>\<^sup>+ y. f y x \<partial>M) \<noteq> \<infinity>"
  1563   assumes bnd: "\<And>x. (\<integral>\<^sup>+ y. f y x \<partial>M) \<noteq> \<infinity>"
  1564   shows "inf_continuous (\<lambda>x. (\<integral>\<^sup>+y. f y x \<partial>M))"
  1564   shows "inf_continuous (\<lambda>x. (\<integral>\<^sup>+y. f y x \<partial>M))"
  1565   unfolding inf_continuous_def
  1565   unfolding inf_continuous_def
  1737   finally show ?thesis
  1737   finally show ?thesis
  1738     by (simp add: F_def)
  1738     by (simp add: F_def)
  1739 qed
  1739 qed
  1740 
  1740 
  1741 lemma nn_integral_lfp:
  1741 lemma nn_integral_lfp:
  1742   assumes sets: "\<And>s. sets (M s) = sets N"
  1742   assumes sets[simp]: "\<And>s. sets (M s) = sets N"
  1743   assumes f: "sup_continuous f"
  1743   assumes f: "sup_continuous f"
       
  1744   assumes g: "sup_continuous g"
       
  1745   assumes nonneg: "\<And>F s. 0 \<le> g F s"
  1744   assumes meas: "\<And>F. F \<in> borel_measurable N \<Longrightarrow> f F \<in> borel_measurable N"
  1746   assumes meas: "\<And>F. F \<in> borel_measurable N \<Longrightarrow> f F \<in> borel_measurable N"
  1745   assumes nonneg: "\<And>F s. 0 \<le> g F s"
       
  1746   assumes g: "sup_continuous g"
       
  1747   assumes step: "\<And>F s. F \<in> borel_measurable N \<Longrightarrow> integral\<^sup>N (M s) (f F) = g (\<lambda>s. integral\<^sup>N (M s) F) s"
  1747   assumes step: "\<And>F s. F \<in> borel_measurable N \<Longrightarrow> integral\<^sup>N (M s) (f F) = g (\<lambda>s. integral\<^sup>N (M s) F) s"
  1748   shows "(\<integral>\<^sup>+\<omega>. lfp f \<omega> \<partial>M s) = lfp g s"
  1748   shows "(\<integral>\<^sup>+\<omega>. lfp f \<omega> \<partial>M s) = lfp g s"
  1749 proof (rule antisym)
  1749 proof (subst lfp_transfer_bounded[where \<alpha>="\<lambda>F s. \<integral>\<^sup>+x. F x \<partial>M s" and g=g and f=f and P="\<lambda>f. f \<in> borel_measurable N", symmetric])
  1750   show "lfp g s \<le> (\<integral>\<^sup>+\<omega>. lfp f \<omega> \<partial>M s)"
  1750   fix C :: "nat \<Rightarrow> 'b \<Rightarrow> ereal" assume "incseq C" "\<And>i. C i \<in> borel_measurable N"
  1751   proof (induction arbitrary: s rule: lfp_ordinal_induct[OF sup_continuous_mono[OF g]])
  1751   then show "(\<lambda>s. \<integral>\<^sup>+x. (SUP i. C i) x \<partial>M s) = (SUP i. (\<lambda>s. \<integral>\<^sup>+x. C i x \<partial>M s))"
  1752     case (1 F) then show ?case
  1752     unfolding SUP_apply[abs_def]
  1753       apply (subst lfp_unfold[OF sup_continuous_mono[OF f]])
  1753     by (subst nn_integral_monotone_convergence_SUP)
  1754       apply (subst step)
  1754        (auto simp: mono_def fun_eq_iff intro!: arg_cong2[where f=emeasure] cong: measurable_cong_sets)
  1755       apply (rule borel_measurable_lfp[OF f])
  1755 next
  1756       apply (rule meas)
  1756   show "\<And>x. (\<lambda>s. integral\<^sup>N (M s) bot) \<le> g x"
  1757       apply assumption+
  1757     by (subst nn_integral_max_0[symmetric])
  1758       apply (rule monoD[OF sup_continuous_mono[OF g], THEN le_funD])
  1758        (simp add: sup_ereal_def[symmetric] le_fun_def nonneg del: sup_ereal_def)
  1759       apply (simp add: le_fun_def)
  1759 qed (auto simp add: step nonneg le_fun_def SUP_apply[abs_def] bot_fun_def intro!: meas f g)
  1760       done
       
  1761   qed (auto intro: SUP_least)
       
  1762 
       
  1763   have lfp_nonneg: "\<And>s. 0 \<le> lfp g s"
       
  1764     by (subst lfp_unfold[OF sup_continuous_mono[OF g]]) (rule nonneg)
       
  1765 
       
  1766   { fix i have "((f ^^ i) bot) \<in> borel_measurable N"
       
  1767       by (induction i) (simp_all add: meas) }
       
  1768 
       
  1769   have "(\<integral>\<^sup>+\<omega>. lfp f \<omega> \<partial>M s) = (\<integral>\<^sup>+\<omega>. (SUP i. (f ^^ i) bot \<omega>) \<partial>M s)"
       
  1770     by (simp add: sup_continuous_lfp f)
       
  1771   also have "\<dots> = (SUP i. \<integral>\<^sup>+\<omega>. (f ^^ i) bot \<omega> \<partial>M s)"
       
  1772   proof (rule nn_integral_monotone_convergence_SUP)
       
  1773     show "incseq (\<lambda>i. (f ^^ i) bot)"
       
  1774       using f[THEN sup_continuous_mono] by (rule mono_funpow)
       
  1775     show "\<And>i. ((f ^^ i) bot) \<in> borel_measurable (M s)"
       
  1776       unfolding measurable_cong_sets[OF sets refl] by fact
       
  1777   qed
       
  1778   also have "\<dots> \<le> lfp g s"
       
  1779   proof (rule SUP_least)
       
  1780     fix i show "integral\<^sup>N (M s) ((f ^^ i) bot) \<le> lfp g s"
       
  1781     proof (induction i arbitrary: s)
       
  1782       case 0 then show ?case
       
  1783         by (simp add: nn_integral_const_nonpos lfp_nonneg)
       
  1784     next
       
  1785       case (Suc n)
       
  1786       show ?case
       
  1787         apply (simp del: bot_apply)
       
  1788         apply (subst step)
       
  1789         apply fact
       
  1790         apply (subst lfp_unfold[OF sup_continuous_mono[OF g]])
       
  1791         apply (rule monoD[OF sup_continuous_mono[OF g], THEN le_funD])
       
  1792         apply (rule le_funI)
       
  1793         apply (rule Suc)
       
  1794         done
       
  1795     qed
       
  1796   qed
       
  1797   finally show "(\<integral>\<^sup>+\<omega>. lfp f \<omega> \<partial>M s) \<le> lfp g s" .
       
  1798 qed
       
  1799 
  1760 
  1800 lemma nn_integral_gfp:
  1761 lemma nn_integral_gfp:
  1801   assumes sets: "\<And>s. sets (M s) = sets N"
  1762   assumes sets[simp]: "\<And>s. sets (M s) = sets N"
  1802   assumes f: "inf_continuous f"
  1763   assumes f: "inf_continuous f" and g: "inf_continuous g"
  1803   assumes meas: "\<And>F. F \<in> borel_measurable N \<Longrightarrow> f F \<in> borel_measurable N"
  1764   assumes meas: "\<And>F. F \<in> borel_measurable N \<Longrightarrow> f F \<in> borel_measurable N"
  1804   assumes bound: "\<And>F s. (\<integral>\<^sup>+x. f F x \<partial>M s) < \<infinity>"
  1765   assumes bound: "\<And>F s. F \<in> borel_measurable N \<Longrightarrow> (\<integral>\<^sup>+x. f F x \<partial>M s) < \<infinity>"
  1805   assumes non_zero: "\<And>s. emeasure (M s) (space (M s)) \<noteq> 0"
  1766   assumes non_zero: "\<And>s. emeasure (M s) (space (M s)) \<noteq> 0"
  1806   assumes g: "inf_continuous g"
       
  1807   assumes step: "\<And>F s. F \<in> borel_measurable N \<Longrightarrow> integral\<^sup>N (M s) (f F) = g (\<lambda>s. integral\<^sup>N (M s) F) s"
  1767   assumes step: "\<And>F s. F \<in> borel_measurable N \<Longrightarrow> integral\<^sup>N (M s) (f F) = g (\<lambda>s. integral\<^sup>N (M s) F) s"
  1808   shows "(\<integral>\<^sup>+\<omega>. gfp f \<omega> \<partial>M s) = gfp g s"
  1768   shows "(\<integral>\<^sup>+\<omega>. gfp f \<omega> \<partial>M s) = gfp g s"
  1809 proof (rule antisym)
  1769 proof (subst gfp_transfer_bounded[where \<alpha>="\<lambda>F s. \<integral>\<^sup>+x. F x \<partial>M s" and g=g and f=f
  1810   show "(\<integral>\<^sup>+\<omega>. gfp f \<omega> \<partial>M s) \<le> gfp g s"
  1770     and P="\<lambda>F. F \<in> borel_measurable N \<and> (\<forall>s. (\<integral>\<^sup>+x. F x \<partial>M s) < \<infinity>)", symmetric])
  1811   proof (induction arbitrary: s rule: gfp_ordinal_induct[OF inf_continuous_mono[OF g]])
  1771   fix C :: "nat \<Rightarrow> 'b \<Rightarrow> ereal" assume "decseq C" "\<And>i. C i \<in> borel_measurable N \<and> (\<forall>s. integral\<^sup>N (M s) (C i) < \<infinity>)"
  1812     case (1 F) then show ?case
  1772   then show "(\<lambda>s. \<integral>\<^sup>+x. (INF i. C i) x \<partial>M s) = (INF i. (\<lambda>s. \<integral>\<^sup>+x. C i x \<partial>M s))"
  1813       apply (subst gfp_unfold[OF inf_continuous_mono[OF f]])
  1773     unfolding INF_apply[abs_def]
  1814       apply (subst step)
  1774     by (subst nn_integral_monotone_convergence_INF)
  1815       apply (rule borel_measurable_gfp[OF f])
  1775        (auto simp: mono_def fun_eq_iff intro!: arg_cong2[where f=emeasure] cong: measurable_cong_sets)
  1816       apply (rule meas)
  1776 next
  1817       apply assumption+
  1777   show "\<And>x. g x \<le> (\<lambda>s. integral\<^sup>N (M s) (f top))"
  1818       apply (rule monoD[OF inf_continuous_mono[OF g], THEN le_funD])
  1778     by (subst step)
  1819       apply (simp add: le_fun_def)
  1779        (auto simp add: top_fun_def top_ereal_def less_le emeasure_nonneg non_zero le_fun_def
  1820       done
  1780              cong del: if_cong intro!: monoD[OF inf_continuous_mono[OF g], THEN le_funD])
  1821   qed (auto intro: INF_greatest)
  1781 next
  1822 
  1782   fix C assume "\<And>i::nat. C i \<in> borel_measurable N \<and> (\<forall>s. integral\<^sup>N (M s) (C i) < \<infinity>)" "decseq C"
  1823   { fix i have "((f ^^ i) top) \<in> borel_measurable N"
  1783   with bound show "INFIMUM UNIV C \<in> borel_measurable N \<and> (\<forall>s. integral\<^sup>N (M s) (INFIMUM UNIV C) < \<infinity>)"
  1824       by (induction i) (simp_all add: meas) }
  1784     unfolding INF_apply[abs_def]
  1825 
  1785     by (subst nn_integral_monotone_convergence_INF)
  1826   have "(\<integral>\<^sup>+\<omega>. gfp f \<omega> \<partial>M s) = (\<integral>\<^sup>+\<omega>. (INF i. (f ^^ i) top \<omega>) \<partial>M s)"
  1786        (auto cong: measurable_cong_sets intro!: borel_measurable_INF
  1827     by (simp add: inf_continuous_gfp f)
  1787              simp: INF_less_iff simp del: ereal_infty_less(1))
  1828   also have "\<dots> = (INF i. \<integral>\<^sup>+\<omega>. (f ^^ i) top \<omega> \<partial>M s)"
  1788 next
  1829   proof (rule nn_integral_monotone_convergence_INF)
  1789   show "\<And>x. x \<in> borel_measurable N \<and> (\<forall>s. integral\<^sup>N (M s) x < \<infinity>) \<Longrightarrow>
  1830     show "decseq (\<lambda>i. (f ^^ i) top)"
  1790          (\<lambda>s. integral\<^sup>N (M s) (f x)) = g (\<lambda>s. integral\<^sup>N (M s) x)"
  1831       using f[THEN inf_continuous_mono] by (rule antimono_funpow)
  1791     by (subst step) auto
  1832     show "\<And>i. ((f ^^ i) top) \<in> borel_measurable (M s)"
  1792 qed (insert bound, auto simp add: le_fun_def INF_apply[abs_def] top_fun_def intro!: meas f g)
  1833       unfolding measurable_cong_sets[OF sets refl] by fact
       
  1834     show "integral\<^sup>N (M s) ((f ^^ 1) top) < \<infinity>"
       
  1835       using bound[of s top] by simp
       
  1836   qed
       
  1837   also have "\<dots> \<ge> gfp g s"
       
  1838   proof (rule INF_greatest)
       
  1839     fix i show "gfp g s \<le> integral\<^sup>N (M s) ((f ^^ i) top)"
       
  1840     proof (induction i arbitrary: s)
       
  1841       case 0 with non_zero[of s] show ?case
       
  1842         by (simp add: top_ereal_def less_le emeasure_nonneg)
       
  1843     next
       
  1844       case (Suc n)
       
  1845       show ?case
       
  1846         apply (simp del: top_apply)
       
  1847         apply (subst step)
       
  1848         apply fact
       
  1849         apply (subst gfp_unfold[OF inf_continuous_mono[OF g]])
       
  1850         apply (rule monoD[OF inf_continuous_mono[OF g], THEN le_funD])
       
  1851         apply (rule le_funI)
       
  1852         apply (rule Suc)
       
  1853         done
       
  1854     qed
       
  1855   qed
       
  1856   finally show "gfp g s \<le> (\<integral>\<^sup>+\<omega>. gfp f \<omega> \<partial>M s)" .
       
  1857 qed
       
  1858 
  1793 
  1859 subsection {* Integral under concrete measures *}
  1794 subsection {* Integral under concrete measures *}
  1860 
  1795 
  1861 lemma nn_integral_empty: 
  1796 lemma nn_integral_empty: 
  1862   assumes "space M = {}"
  1797   assumes "space M = {}"