949 (auto intro!: borel_measurable_ereal_times f Int simp: *) |
949 (auto intro!: borel_measurable_ereal_times f Int simp: *) |
950 moreover have "AE x. ?f Q0 x = ?f' Q0 x" |
950 moreover have "AE x. ?f Q0 x = ?f' Q0 x" |
951 proof (rule AE_I') |
951 proof (rule AE_I') |
952 { fix f :: "'a \<Rightarrow> ereal" assume borel: "f \<in> borel_measurable M" |
952 { fix f :: "'a \<Rightarrow> ereal" assume borel: "f \<in> borel_measurable M" |
953 and eq: "\<And>A. A \<in> sets M \<Longrightarrow> ?\<nu> A = (\<integral>\<^isup>+x. f x * indicator A x \<partial>M)" |
953 and eq: "\<And>A. A \<in> sets M \<Longrightarrow> ?\<nu> A = (\<integral>\<^isup>+x. f x * indicator A x \<partial>M)" |
954 let "?A i" = "Q0 \<inter> {x \<in> space M. f x < of_nat i}" |
954 let "?A i" = "Q0 \<inter> {x \<in> space M. f x < (i::nat)}" |
955 have "(\<Union>i. ?A i) \<in> null_sets" |
955 have "(\<Union>i. ?A i) \<in> null_sets" |
956 proof (rule null_sets_UN) |
956 proof (rule null_sets_UN) |
957 fix i have "?A i \<in> sets M" |
957 fix i ::nat have "?A i \<in> sets M" |
958 using borel Q0(1) by auto |
958 using borel Q0(1) by auto |
959 have "?\<nu> (?A i) \<le> (\<integral>\<^isup>+x. of_nat i * indicator (?A i) x \<partial>M)" |
959 have "?\<nu> (?A i) \<le> (\<integral>\<^isup>+x. (i::ereal) * indicator (?A i) x \<partial>M)" |
960 unfolding eq[OF `?A i \<in> sets M`] |
960 unfolding eq[OF `?A i \<in> sets M`] |
961 by (auto intro!: positive_integral_mono simp: indicator_def) |
961 by (auto intro!: positive_integral_mono simp: indicator_def) |
962 also have "\<dots> = of_nat i * \<mu> (?A i)" |
962 also have "\<dots> = i * \<mu> (?A i)" |
963 using `?A i \<in> sets M` by (auto intro!: positive_integral_cmult_indicator) |
963 using `?A i \<in> sets M` by (auto intro!: positive_integral_cmult_indicator) |
964 also have "\<dots> < \<infinity>" |
964 also have "\<dots> < \<infinity>" |
965 using `?A i \<in> sets M`[THEN finite_measure] by auto |
965 using `?A i \<in> sets M`[THEN finite_measure] by auto |
966 finally have "?\<nu> (?A i) \<noteq> \<infinity>" by simp |
966 finally have "?\<nu> (?A i) \<noteq> \<infinity>" by simp |
967 then show "?A i \<in> null_sets" using in_Q0[OF `?A i \<in> sets M`] `?A i \<in> sets M` by auto |
967 then show "?A i \<in> null_sets" using in_Q0[OF `?A i \<in> sets M`] `?A i \<in> sets M` by auto |
1065 assume AE: "AE x. f x \<noteq> \<infinity>" |
1065 assume AE: "AE x. f x \<noteq> \<infinity>" |
1066 from sigma_finite guess Q .. note Q = this |
1066 from sigma_finite guess Q .. note Q = this |
1067 interpret \<nu>: measure_space ?N |
1067 interpret \<nu>: measure_space ?N |
1068 where "borel_measurable ?N = borel_measurable M" and "measure ?N = \<nu>" |
1068 where "borel_measurable ?N = borel_measurable M" and "measure ?N = \<nu>" |
1069 and "sets ?N = sets M" and "space ?N = space M" using \<nu> by (auto simp: measurable_def) |
1069 and "sets ?N = sets M" and "space ?N = space M" using \<nu> by (auto simp: measurable_def) |
1070 def A \<equiv> "\<lambda>i. f -` (case i of 0 \<Rightarrow> {\<infinity>} | Suc n \<Rightarrow> {.. of_nat (Suc n)}) \<inter> space M" |
1070 def A \<equiv> "\<lambda>i. f -` (case i of 0 \<Rightarrow> {\<infinity>} | Suc n \<Rightarrow> {.. ereal(of_nat (Suc n))}) \<inter> space M" |
1071 { fix i j have "A i \<inter> Q j \<in> sets M" |
1071 { fix i j have "A i \<inter> Q j \<in> sets M" |
1072 unfolding A_def using f Q |
1072 unfolding A_def using f Q |
1073 apply (rule_tac Int) |
1073 apply (rule_tac Int) |
1074 by (cases i) (auto intro: measurable_sets[OF f(1)]) } |
1074 by (cases i) (auto intro: measurable_sets[OF f(1)]) } |
1075 note A_in_sets = this |
1075 note A_in_sets = this |
1093 show "x \<in> (\<Union>i. A i)" |
1093 show "x \<in> (\<Union>i. A i)" |
1094 proof (cases "f x") |
1094 proof (cases "f x") |
1095 case PInf with x show ?thesis unfolding A_def by (auto intro: exI[of _ 0]) |
1095 case PInf with x show ?thesis unfolding A_def by (auto intro: exI[of _ 0]) |
1096 next |
1096 next |
1097 case (real r) |
1097 case (real r) |
1098 with less_PInf_Ex_of_nat[of "f x"] obtain n where "f x < of_nat n" by (auto simp: real_eq_of_nat) |
1098 with less_PInf_Ex_of_nat[of "f x"] obtain n :: nat where "f x < n" by (auto simp: real_eq_of_nat) |
1099 then show ?thesis using x real unfolding A_def by (auto intro!: exI[of _ "Suc n"]) |
1099 then show ?thesis using x real unfolding A_def by (auto intro!: exI[of _ "Suc n"]) |
1100 next |
1100 next |
1101 case MInf with x show ?thesis |
1101 case MInf with x show ?thesis |
1102 unfolding A_def by (auto intro!: exI[of _ "Suc 0"]) |
1102 unfolding A_def by (auto intro!: exI[of _ "Suc 0"]) |
1103 qed |
1103 qed |
1113 using AE by (auto simp: A_def `i = 0`) |
1113 using AE by (auto simp: A_def `i = 0`) |
1114 from positive_integral_cong_AE[OF this] show ?thesis by simp |
1114 from positive_integral_cong_AE[OF this] show ?thesis by simp |
1115 next |
1115 next |
1116 case (Suc n) |
1116 case (Suc n) |
1117 then have "(\<integral>\<^isup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<le> |
1117 then have "(\<integral>\<^isup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<le> |
1118 (\<integral>\<^isup>+x. of_nat (Suc n) * indicator (Q j) x \<partial>M)" |
1118 (\<integral>\<^isup>+x. (Suc n :: ereal) * indicator (Q j) x \<partial>M)" |
1119 by (auto intro!: positive_integral_mono simp: indicator_def A_def) |
1119 by (auto intro!: positive_integral_mono simp: indicator_def A_def) |
1120 also have "\<dots> = of_nat (Suc n) * \<mu> (Q j)" |
1120 also have "\<dots> = Suc n * \<mu> (Q j)" |
1121 using Q by (auto intro!: positive_integral_cmult_indicator) |
1121 using Q by (auto intro!: positive_integral_cmult_indicator) |
1122 also have "\<dots> < \<infinity>" |
1122 also have "\<dots> < \<infinity>" |
1123 using Q by (auto simp: real_eq_of_nat[symmetric]) |
1123 using Q by (auto simp: real_eq_of_nat[symmetric]) |
1124 finally show ?thesis by simp |
1124 finally show ?thesis by simp |
1125 qed |
1125 qed |