274 have "simple_function M ((\<lambda>(x, y). h x y) \<circ> (\<lambda>x. (f x, g x)))" |
274 have "simple_function M ((\<lambda>(x, y). h x y) \<circ> (\<lambda>x. (f x, g x)))" |
275 using assms by auto |
275 using assms by auto |
276 thus ?thesis by (simp_all add: comp_def) |
276 thus ?thesis by (simp_all add: comp_def) |
277 qed |
277 qed |
278 |
278 |
279 lemmas simple_function_add[intro, simp] = simple_function_compose2[where h="op +"] |
279 lemmas simple_function_add[intro, simp] = simple_function_compose2[where h="(+)"] |
280 and simple_function_diff[intro, simp] = simple_function_compose2[where h="op -"] |
280 and simple_function_diff[intro, simp] = simple_function_compose2[where h="(-)"] |
281 and simple_function_uminus[intro, simp] = simple_function_compose[where g="uminus"] |
281 and simple_function_uminus[intro, simp] = simple_function_compose[where g="uminus"] |
282 and simple_function_mult[intro, simp] = simple_function_compose2[where h="op *"] |
282 and simple_function_mult[intro, simp] = simple_function_compose2[where h="( * )"] |
283 and simple_function_div[intro, simp] = simple_function_compose2[where h="op /"] |
283 and simple_function_div[intro, simp] = simple_function_compose2[where h="(/)"] |
284 and simple_function_inverse[intro, simp] = simple_function_compose[where g="inverse"] |
284 and simple_function_inverse[intro, simp] = simple_function_compose[where g="inverse"] |
285 and simple_function_max[intro, simp] = simple_function_compose2[where h=max] |
285 and simple_function_max[intro, simp] = simple_function_compose2[where h=max] |
286 |
286 |
287 lemma simple_function_sum[intro, simp]: |
287 lemma simple_function_sum[intro, simp]: |
288 assumes "\<And>i. i \<in> P \<Longrightarrow> simple_function M (f i)" |
288 assumes "\<And>i. i \<in> P \<Longrightarrow> simple_function M (f i)" |
758 have "(\<integral>\<^sup>Sx. f x * indicator A x \<partial>M) = |
758 have "(\<integral>\<^sup>Sx. f x * indicator A x \<partial>M) = |
759 (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x))`space M. (fst y * snd y) * emeasure M {x\<in>space M. (f x, indicator A x) = y})" |
759 (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x))`space M. (fst y * snd y) * emeasure M {x\<in>space M. (f x, indicator A x) = y})" |
760 using assms by (intro simple_function_partition) auto |
760 using assms by (intro simple_function_partition) auto |
761 also have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x::ennreal))`space M. |
761 also have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, indicator A x::ennreal))`space M. |
762 if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)" |
762 if snd y = 1 then fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A) else 0)" |
763 by (auto simp: indicator_def split: if_split_asm intro!: arg_cong2[where f="op *"] arg_cong2[where f=emeasure] sum.cong) |
763 by (auto simp: indicator_def split: if_split_asm intro!: arg_cong2[where f="( * )"] arg_cong2[where f=emeasure] sum.cong) |
764 also have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, 1::ennreal))`A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))" |
764 also have "\<dots> = (\<Sum>y\<in>(\<lambda>x. (f x, 1::ennreal))`A. fst y * emeasure M (f -` {fst y} \<inter> space M \<inter> A))" |
765 using assms by (subst sum.If_cases) (auto intro!: simple_functionD(1) simp: eq) |
765 using assms by (subst sum.If_cases) (auto intro!: simple_functionD(1) simp: eq) |
766 also have "\<dots> = (\<Sum>y\<in>fst`(\<lambda>x. (f x, 1::ennreal))`A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))" |
766 also have "\<dots> = (\<Sum>y\<in>fst`(\<lambda>x. (f x, 1::ennreal))`A. y * emeasure M (f -` {y} \<inter> space M \<inter> A))" |
767 by (subst sum.reindex [of fst]) (auto simp: inj_on_def) |
767 by (subst sum.reindex [of fst]) (auto simp: inj_on_def) |
768 also have "\<dots> = (\<Sum>x \<in> f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))" |
768 also have "\<dots> = (\<Sum>x \<in> f ` space M. x * emeasure M (f -` {x} \<inter> space M \<inter> A))" |
1871 finally show "emeasure M A = emeasure N A" .. |
1871 finally show "emeasure M A = emeasure N A" .. |
1872 qed simp |
1872 qed simp |
1873 |
1873 |
1874 lemma nn_integral_monotone_convergence_SUP_nat: |
1874 lemma nn_integral_monotone_convergence_SUP_nat: |
1875 fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal" |
1875 fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal" |
1876 assumes chain: "Complete_Partial_Order.chain op \<le> (f ` Y)" |
1876 assumes chain: "Complete_Partial_Order.chain (\<le>) (f ` Y)" |
1877 and nonempty: "Y \<noteq> {}" |
1877 and nonempty: "Y \<noteq> {}" |
1878 shows "(\<integral>\<^sup>+ x. (SUP i:Y. f i x) \<partial>count_space UNIV) = (SUP i:Y. (\<integral>\<^sup>+ x. f i x \<partial>count_space UNIV))" |
1878 shows "(\<integral>\<^sup>+ x. (SUP i:Y. f i x) \<partial>count_space UNIV) = (SUP i:Y. (\<integral>\<^sup>+ x. f i x \<partial>count_space UNIV))" |
1879 (is "?lhs = ?rhs" is "integral\<^sup>N ?M _ = _") |
1879 (is "?lhs = ?rhs" is "integral\<^sup>N ?M _ = _") |
1880 proof (rule order_class.order.antisym) |
1880 proof (rule order_class.order.antisym) |
1881 show "?rhs \<le> ?lhs" |
1881 show "?rhs \<le> ?lhs" |
1911 thus ?thesis using nonempty by auto |
1911 thus ?thesis using nonempty by auto |
1912 next |
1912 next |
1913 case True |
1913 case True |
1914 let ?Y = "I ` {..<m}" |
1914 let ?Y = "I ` {..<m}" |
1915 have "f ` ?Y \<subseteq> f ` Y" using I by auto |
1915 have "f ` ?Y \<subseteq> f ` Y" using I by auto |
1916 with chain have chain': "Complete_Partial_Order.chain op \<le> (f ` ?Y)" by(rule chain_subset) |
1916 with chain have chain': "Complete_Partial_Order.chain (\<le>) (f ` ?Y)" by(rule chain_subset) |
1917 hence "Sup (f ` ?Y) \<in> f ` ?Y" |
1917 hence "Sup (f ` ?Y) \<in> f ` ?Y" |
1918 by(rule ccpo_class.in_chain_finite)(auto simp add: True lessThan_empty_iff) |
1918 by(rule ccpo_class.in_chain_finite)(auto simp add: True lessThan_empty_iff) |
1919 then obtain m' where "m' < m" and m': "(SUP i:?Y. f i) = f (I m')" by auto |
1919 then obtain m' where "m' < m" and m': "(SUP i:?Y. f i) = f (I m')" by auto |
1920 have "I m' \<in> Y" using I by blast |
1920 have "I m' \<in> Y" using I by blast |
1921 have "(\<Sum>x<m. g x n) \<le> (\<Sum>x<m. f (I m') x)" |
1921 have "(\<Sum>x<m. g x n) \<le> (\<Sum>x<m. f (I m') x)" |