1185 from nn_integral_add[OF this] |
1185 from nn_integral_add[OF this] |
1186 show ?case using insert by auto |
1186 show ?case using insert by auto |
1187 qed simp |
1187 qed simp |
1188 qed simp |
1188 qed simp |
1189 |
1189 |
|
1190 lemma nn_integral_bound_simple_function: |
|
1191 assumes bnd: "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x" "\<And>x. x \<in> space M \<Longrightarrow> f x < \<infinity>" |
|
1192 assumes f[measurable]: "simple_function M f" |
|
1193 assumes supp: "emeasure M {x\<in>space M. f x \<noteq> 0} < \<infinity>" |
|
1194 shows "nn_integral M f < \<infinity>" |
|
1195 proof cases |
|
1196 assume "space M = {}" |
|
1197 then have "nn_integral M f = (\<integral>\<^sup>+x. 0 \<partial>M)" |
|
1198 by (intro nn_integral_cong) auto |
|
1199 then show ?thesis by simp |
|
1200 next |
|
1201 assume "space M \<noteq> {}" |
|
1202 with simple_functionD(1)[OF f] bnd have bnd: "0 \<le> Max (f`space M) \<and> Max (f`space M) < \<infinity>" |
|
1203 by (subst Max_less_iff) (auto simp: Max_ge_iff) |
|
1204 |
|
1205 have "nn_integral M f \<le> (\<integral>\<^sup>+x. Max (f`space M) * indicator {x\<in>space M. f x \<noteq> 0} x \<partial>M)" |
|
1206 proof (rule nn_integral_mono) |
|
1207 fix x assume "x \<in> space M" |
|
1208 with f show "f x \<le> Max (f ` space M) * indicator {x \<in> space M. f x \<noteq> 0} x" |
|
1209 by (auto split: split_indicator intro!: Max_ge simple_functionD) |
|
1210 qed |
|
1211 also have "\<dots> < \<infinity>" |
|
1212 using bnd supp by (subst nn_integral_cmult) auto |
|
1213 finally show ?thesis . |
|
1214 qed |
|
1215 |
1190 lemma nn_integral_Markov_inequality: |
1216 lemma nn_integral_Markov_inequality: |
1191 assumes u: "u \<in> borel_measurable M" "AE x in M. 0 \<le> u x" and "A \<in> sets M" and c: "0 \<le> c" |
1217 assumes u: "u \<in> borel_measurable M" "AE x in M. 0 \<le> u x" and "A \<in> sets M" and c: "0 \<le> c" |
1192 shows "(emeasure M) ({x\<in>space M. 1 \<le> c * u x} \<inter> A) \<le> c * (\<integral>\<^sup>+ x. u x * indicator A x \<partial>M)" |
1218 shows "(emeasure M) ({x\<in>space M. 1 \<le> c * u x} \<inter> A) \<le> c * (\<integral>\<^sup>+ x. u x * indicator A x \<partial>M)" |
1193 (is "(emeasure M) ?A \<le> _ * ?PI") |
1219 (is "(emeasure M) ?A \<le> _ * ?PI") |
1194 proof - |
1220 proof - |