38656
|
1 |
(* Author: Armin Heller, Johannes Hoelzl, TU Muenchen *)
|
|
2 |
|
35582
|
3 |
header {*Lebesgue Integration*}
|
|
4 |
|
38656
|
5 |
theory Lebesgue_Integration
|
35582
|
6 |
imports Measure Borel
|
|
7 |
begin
|
|
8 |
|
38656
|
9 |
section "@{text \<mu>}-null sets"
|
35582
|
10 |
|
38656
|
11 |
abbreviation (in measure_space) "null_sets \<equiv> {N\<in>sets M. \<mu> N = 0}"
|
35582
|
12 |
|
38656
|
13 |
lemma sums_If_finite:
|
|
14 |
assumes finite: "finite {r. P r}"
|
|
15 |
shows "(\<lambda>r. if P r then f r else 0) sums (\<Sum>r\<in>{r. P r}. f r)" (is "?F sums _")
|
|
16 |
proof cases
|
|
17 |
assume "{r. P r} = {}" hence "\<And>r. \<not> P r" by auto
|
|
18 |
thus ?thesis by (simp add: sums_zero)
|
|
19 |
next
|
|
20 |
assume not_empty: "{r. P r} \<noteq> {}"
|
|
21 |
have "?F sums (\<Sum>r = 0..< Suc (Max {r. P r}). ?F r)"
|
|
22 |
by (rule series_zero)
|
|
23 |
(auto simp add: Max_less_iff[OF finite not_empty] less_eq_Suc_le[symmetric])
|
|
24 |
also have "(\<Sum>r = 0..< Suc (Max {r. P r}). ?F r) = (\<Sum>r\<in>{r. P r}. f r)"
|
|
25 |
by (subst setsum_cases)
|
|
26 |
(auto intro!: setsum_cong simp: Max_ge_iff[OF finite not_empty] less_Suc_eq_le)
|
|
27 |
finally show ?thesis .
|
|
28 |
qed
|
35582
|
29 |
|
38656
|
30 |
lemma sums_single:
|
|
31 |
"(\<lambda>r. if r = i then f r else 0) sums f i"
|
|
32 |
using sums_If_finite[of "\<lambda>r. r = i" f] by simp
|
|
33 |
|
|
34 |
section "Simple function"
|
35582
|
35 |
|
38656
|
36 |
text {*
|
|
37 |
|
|
38 |
Our simple functions are not restricted to positive real numbers. Instead
|
|
39 |
they are just functions with a finite range and are measurable when singleton
|
|
40 |
sets are measurable.
|
35582
|
41 |
|
38656
|
42 |
*}
|
|
43 |
|
|
44 |
definition (in sigma_algebra) "simple_function g \<longleftrightarrow>
|
|
45 |
finite (g ` space M) \<and>
|
|
46 |
(\<forall>x \<in> g ` space M. g -` {x} \<inter> space M \<in> sets M)"
|
36624
|
47 |
|
38656
|
48 |
lemma (in sigma_algebra) simple_functionD:
|
|
49 |
assumes "simple_function g"
|
|
50 |
shows "finite (g ` space M)"
|
|
51 |
"x \<in> g ` space M \<Longrightarrow> g -` {x} \<inter> space M \<in> sets M"
|
|
52 |
using assms unfolding simple_function_def by auto
|
36624
|
53 |
|
38656
|
54 |
lemma (in sigma_algebra) simple_function_indicator_representation:
|
|
55 |
fixes f ::"'a \<Rightarrow> pinfreal"
|
|
56 |
assumes f: "simple_function f" and x: "x \<in> space M"
|
|
57 |
shows "f x = (\<Sum>y \<in> f ` space M. y * indicator (f -` {y} \<inter> space M) x)"
|
|
58 |
(is "?l = ?r")
|
|
59 |
proof -
|
38705
|
60 |
have "?r = (\<Sum>y \<in> f ` space M.
|
38656
|
61 |
(if y = f x then y * indicator (f -` {y} \<inter> space M) x else 0))"
|
|
62 |
by (auto intro!: setsum_cong2)
|
|
63 |
also have "... = f x * indicator (f -` {f x} \<inter> space M) x"
|
|
64 |
using assms by (auto dest: simple_functionD simp: setsum_delta)
|
|
65 |
also have "... = f x" using x by (auto simp: indicator_def)
|
|
66 |
finally show ?thesis by auto
|
|
67 |
qed
|
36624
|
68 |
|
38656
|
69 |
lemma (in measure_space) simple_function_notspace:
|
|
70 |
"simple_function (\<lambda>x. h x * indicator (- space M) x::pinfreal)" (is "simple_function ?h")
|
35692
|
71 |
proof -
|
38656
|
72 |
have "?h ` space M \<subseteq> {0}" unfolding indicator_def by auto
|
|
73 |
hence [simp, intro]: "finite (?h ` space M)" by (auto intro: finite_subset)
|
|
74 |
have "?h -` {0} \<inter> space M = space M" by auto
|
|
75 |
thus ?thesis unfolding simple_function_def by auto
|
|
76 |
qed
|
|
77 |
|
|
78 |
lemma (in sigma_algebra) simple_function_cong:
|
|
79 |
assumes "\<And>t. t \<in> space M \<Longrightarrow> f t = g t"
|
|
80 |
shows "simple_function f \<longleftrightarrow> simple_function g"
|
|
81 |
proof -
|
|
82 |
have "f ` space M = g ` space M"
|
|
83 |
"\<And>x. f -` {x} \<inter> space M = g -` {x} \<inter> space M"
|
|
84 |
using assms by (auto intro!: image_eqI)
|
|
85 |
thus ?thesis unfolding simple_function_def using assms by simp
|
|
86 |
qed
|
|
87 |
|
|
88 |
lemma (in sigma_algebra) borel_measurable_simple_function:
|
|
89 |
assumes "simple_function f"
|
|
90 |
shows "f \<in> borel_measurable M"
|
|
91 |
proof (rule borel_measurableI)
|
|
92 |
fix S
|
|
93 |
let ?I = "f ` (f -` S \<inter> space M)"
|
|
94 |
have *: "(\<Union>x\<in>?I. f -` {x} \<inter> space M) = f -` S \<inter> space M" (is "?U = _") by auto
|
|
95 |
have "finite ?I"
|
|
96 |
using assms unfolding simple_function_def by (auto intro: finite_subset)
|
|
97 |
hence "?U \<in> sets M"
|
|
98 |
apply (rule finite_UN)
|
|
99 |
using assms unfolding simple_function_def by auto
|
|
100 |
thus "f -` S \<inter> space M \<in> sets M" unfolding * .
|
35692
|
101 |
qed
|
|
102 |
|
38656
|
103 |
lemma (in sigma_algebra) simple_function_borel_measurable:
|
|
104 |
fixes f :: "'a \<Rightarrow> 'x::t2_space"
|
|
105 |
assumes "f \<in> borel_measurable M" and "finite (f ` space M)"
|
|
106 |
shows "simple_function f"
|
|
107 |
using assms unfolding simple_function_def
|
|
108 |
by (auto intro: borel_measurable_vimage)
|
|
109 |
|
|
110 |
lemma (in sigma_algebra) simple_function_const[intro, simp]:
|
|
111 |
"simple_function (\<lambda>x. c)"
|
|
112 |
by (auto intro: finite_subset simp: simple_function_def)
|
|
113 |
|
|
114 |
lemma (in sigma_algebra) simple_function_compose[intro, simp]:
|
|
115 |
assumes "simple_function f"
|
|
116 |
shows "simple_function (g \<circ> f)"
|
|
117 |
unfolding simple_function_def
|
|
118 |
proof safe
|
|
119 |
show "finite ((g \<circ> f) ` space M)"
|
|
120 |
using assms unfolding simple_function_def by (auto simp: image_compose)
|
|
121 |
next
|
|
122 |
fix x assume "x \<in> space M"
|
|
123 |
let ?G = "g -` {g (f x)} \<inter> (f`space M)"
|
|
124 |
have *: "(g \<circ> f) -` {(g \<circ> f) x} \<inter> space M =
|
|
125 |
(\<Union>x\<in>?G. f -` {x} \<inter> space M)" by auto
|
|
126 |
show "(g \<circ> f) -` {(g \<circ> f) x} \<inter> space M \<in> sets M"
|
|
127 |
using assms unfolding simple_function_def *
|
|
128 |
by (rule_tac finite_UN) (auto intro!: finite_UN)
|
|
129 |
qed
|
|
130 |
|
|
131 |
lemma (in sigma_algebra) simple_function_indicator[intro, simp]:
|
|
132 |
assumes "A \<in> sets M"
|
|
133 |
shows "simple_function (indicator A)"
|
35692
|
134 |
proof -
|
38656
|
135 |
have "indicator A ` space M \<subseteq> {0, 1}" (is "?S \<subseteq> _")
|
|
136 |
by (auto simp: indicator_def)
|
|
137 |
hence "finite ?S" by (rule finite_subset) simp
|
|
138 |
moreover have "- A \<inter> space M = space M - A" by auto
|
|
139 |
ultimately show ?thesis unfolding simple_function_def
|
|
140 |
using assms by (auto simp: indicator_def_raw)
|
35692
|
141 |
qed
|
|
142 |
|
38656
|
143 |
lemma (in sigma_algebra) simple_function_Pair[intro, simp]:
|
|
144 |
assumes "simple_function f"
|
|
145 |
assumes "simple_function g"
|
|
146 |
shows "simple_function (\<lambda>x. (f x, g x))" (is "simple_function ?p")
|
|
147 |
unfolding simple_function_def
|
|
148 |
proof safe
|
|
149 |
show "finite (?p ` space M)"
|
|
150 |
using assms unfolding simple_function_def
|
|
151 |
by (rule_tac finite_subset[of _ "f`space M \<times> g`space M"]) auto
|
|
152 |
next
|
|
153 |
fix x assume "x \<in> space M"
|
|
154 |
have "(\<lambda>x. (f x, g x)) -` {(f x, g x)} \<inter> space M =
|
|
155 |
(f -` {f x} \<inter> space M) \<inter> (g -` {g x} \<inter> space M)"
|
|
156 |
by auto
|
|
157 |
with `x \<in> space M` show "(\<lambda>x. (f x, g x)) -` {(f x, g x)} \<inter> space M \<in> sets M"
|
|
158 |
using assms unfolding simple_function_def by auto
|
|
159 |
qed
|
35692
|
160 |
|
38656
|
161 |
lemma (in sigma_algebra) simple_function_compose1:
|
|
162 |
assumes "simple_function f"
|
|
163 |
shows "simple_function (\<lambda>x. g (f x))"
|
|
164 |
using simple_function_compose[OF assms, of g]
|
|
165 |
by (simp add: comp_def)
|
35582
|
166 |
|
38656
|
167 |
lemma (in sigma_algebra) simple_function_compose2:
|
|
168 |
assumes "simple_function f" and "simple_function g"
|
|
169 |
shows "simple_function (\<lambda>x. h (f x) (g x))"
|
|
170 |
proof -
|
|
171 |
have "simple_function ((\<lambda>(x, y). h x y) \<circ> (\<lambda>x. (f x, g x)))"
|
|
172 |
using assms by auto
|
|
173 |
thus ?thesis by (simp_all add: comp_def)
|
|
174 |
qed
|
35582
|
175 |
|
38656
|
176 |
lemmas (in sigma_algebra) simple_function_add[intro, simp] = simple_function_compose2[where h="op +"]
|
|
177 |
and simple_function_diff[intro, simp] = simple_function_compose2[where h="op -"]
|
|
178 |
and simple_function_uminus[intro, simp] = simple_function_compose[where g="uminus"]
|
|
179 |
and simple_function_mult[intro, simp] = simple_function_compose2[where h="op *"]
|
|
180 |
and simple_function_div[intro, simp] = simple_function_compose2[where h="op /"]
|
|
181 |
and simple_function_inverse[intro, simp] = simple_function_compose[where g="inverse"]
|
|
182 |
|
|
183 |
lemma (in sigma_algebra) simple_function_setsum[intro, simp]:
|
|
184 |
assumes "\<And>i. i \<in> P \<Longrightarrow> simple_function (f i)"
|
|
185 |
shows "simple_function (\<lambda>x. \<Sum>i\<in>P. f i x)"
|
|
186 |
proof cases
|
|
187 |
assume "finite P" from this assms show ?thesis by induct auto
|
|
188 |
qed auto
|
35582
|
189 |
|
38656
|
190 |
lemma (in sigma_algebra) simple_function_le_measurable:
|
|
191 |
assumes "simple_function f" "simple_function g"
|
|
192 |
shows "{x \<in> space M. f x \<le> g x} \<in> sets M"
|
|
193 |
proof -
|
|
194 |
have *: "{x \<in> space M. f x \<le> g x} =
|
|
195 |
(\<Union>(F, G)\<in>f`space M \<times> g`space M.
|
|
196 |
if F \<le> G then (f -` {F} \<inter> space M) \<inter> (g -` {G} \<inter> space M) else {})"
|
|
197 |
apply (auto split: split_if_asm)
|
|
198 |
apply (rule_tac x=x in bexI)
|
|
199 |
apply (rule_tac x=x in bexI)
|
|
200 |
by simp_all
|
|
201 |
have **: "\<And>x y. x \<in> space M \<Longrightarrow> y \<in> space M \<Longrightarrow>
|
|
202 |
(f -` {f x} \<inter> space M) \<inter> (g -` {g y} \<inter> space M) \<in> sets M"
|
|
203 |
using assms unfolding simple_function_def by auto
|
|
204 |
have "finite (f`space M \<times> g`space M)"
|
|
205 |
using assms unfolding simple_function_def by auto
|
|
206 |
thus ?thesis unfolding *
|
|
207 |
apply (rule finite_UN)
|
|
208 |
using assms unfolding simple_function_def
|
|
209 |
by (auto intro!: **)
|
35582
|
210 |
qed
|
|
211 |
|
38656
|
212 |
lemma setsum_indicator_disjoint_family:
|
|
213 |
fixes f :: "'d \<Rightarrow> 'e::semiring_1"
|
|
214 |
assumes d: "disjoint_family_on A P" and "x \<in> A j" and "finite P" and "j \<in> P"
|
|
215 |
shows "(\<Sum>i\<in>P. f i * indicator (A i) x) = f j"
|
|
216 |
proof -
|
|
217 |
have "P \<inter> {i. x \<in> A i} = {j}"
|
|
218 |
using d `x \<in> A j` `j \<in> P` unfolding disjoint_family_on_def
|
|
219 |
by auto
|
|
220 |
thus ?thesis
|
|
221 |
unfolding indicator_def
|
|
222 |
by (simp add: if_distrib setsum_cases[OF `finite P`])
|
|
223 |
qed
|
35692
|
224 |
|
38656
|
225 |
lemma (in sigma_algebra) borel_measurable_implies_simple_function_sequence:
|
|
226 |
fixes u :: "'a \<Rightarrow> pinfreal"
|
|
227 |
assumes u: "u \<in> borel_measurable M"
|
|
228 |
shows "\<exists>f. (\<forall>i. simple_function (f i) \<and> (\<forall>x\<in>space M. f i x \<noteq> \<omega>)) \<and> f \<up> u"
|
35582
|
229 |
proof -
|
38656
|
230 |
have "\<exists>f. \<forall>x j. (of_nat j \<le> u x \<longrightarrow> f x j = j*2^j) \<and>
|
|
231 |
(u x < of_nat j \<longrightarrow> of_nat (f x j) \<le> u x * 2^j \<and> u x * 2^j < of_nat (Suc (f x j)))"
|
|
232 |
(is "\<exists>f. \<forall>x j. ?P x j (f x j)")
|
|
233 |
proof(rule choice, rule, rule choice, rule)
|
|
234 |
fix x j show "\<exists>n. ?P x j n"
|
|
235 |
proof cases
|
|
236 |
assume *: "u x < of_nat j"
|
|
237 |
then obtain r where r: "u x = Real r" "0 \<le> r" by (cases "u x") auto
|
|
238 |
from reals_Archimedean6a[of "r * 2^j"]
|
|
239 |
obtain n :: nat where "real n \<le> r * 2 ^ j" "r * 2 ^ j < real (Suc n)"
|
|
240 |
using `0 \<le> r` by (auto simp: zero_le_power zero_le_mult_iff)
|
|
241 |
thus ?thesis using r * by (auto intro!: exI[of _ n])
|
|
242 |
qed auto
|
35582
|
243 |
qed
|
38656
|
244 |
then obtain f where top: "\<And>j x. of_nat j \<le> u x \<Longrightarrow> f x j = j*2^j" and
|
|
245 |
upper: "\<And>j x. u x < of_nat j \<Longrightarrow> of_nat (f x j) \<le> u x * 2^j" and
|
|
246 |
lower: "\<And>j x. u x < of_nat j \<Longrightarrow> u x * 2^j < of_nat (Suc (f x j))" by blast
|
35582
|
247 |
|
38656
|
248 |
{ fix j x P
|
|
249 |
assume 1: "of_nat j \<le> u x \<Longrightarrow> P (j * 2^j)"
|
|
250 |
assume 2: "\<And>k. \<lbrakk> u x < of_nat j ; of_nat k \<le> u x * 2^j ; u x * 2^j < of_nat (Suc k) \<rbrakk> \<Longrightarrow> P k"
|
|
251 |
have "P (f x j)"
|
|
252 |
proof cases
|
|
253 |
assume "of_nat j \<le> u x" thus "P (f x j)"
|
|
254 |
using top[of j x] 1 by auto
|
|
255 |
next
|
|
256 |
assume "\<not> of_nat j \<le> u x"
|
|
257 |
hence "u x < of_nat j" "of_nat (f x j) \<le> u x * 2^j" "u x * 2^j < of_nat (Suc (f x j))"
|
|
258 |
using upper lower by auto
|
|
259 |
from 2[OF this] show "P (f x j)" .
|
|
260 |
qed }
|
|
261 |
note fI = this
|
|
262 |
|
|
263 |
{ fix j x
|
|
264 |
have "f x j = j * 2 ^ j \<longleftrightarrow> of_nat j \<le> u x"
|
|
265 |
by (rule fI, simp, cases "u x") (auto split: split_if_asm) }
|
|
266 |
note f_eq = this
|
35582
|
267 |
|
38656
|
268 |
{ fix j x
|
|
269 |
have "f x j \<le> j * 2 ^ j"
|
|
270 |
proof (rule fI)
|
|
271 |
fix k assume *: "u x < of_nat j"
|
|
272 |
assume "of_nat k \<le> u x * 2 ^ j"
|
|
273 |
also have "\<dots> \<le> of_nat (j * 2^j)"
|
|
274 |
using * by (cases "u x") (auto simp: zero_le_mult_iff)
|
|
275 |
finally show "k \<le> j*2^j" by (auto simp del: real_of_nat_mult)
|
|
276 |
qed simp }
|
|
277 |
note f_upper = this
|
35582
|
278 |
|
38656
|
279 |
let "?g j x" = "of_nat (f x j) / 2^j :: pinfreal"
|
|
280 |
show ?thesis unfolding simple_function_def isoton_fun_expand unfolding isoton_def
|
|
281 |
proof (safe intro!: exI[of _ ?g])
|
|
282 |
fix j
|
|
283 |
have *: "?g j ` space M \<subseteq> (\<lambda>x. of_nat x / 2^j) ` {..j * 2^j}"
|
|
284 |
using f_upper by auto
|
|
285 |
thus "finite (?g j ` space M)" by (rule finite_subset) auto
|
|
286 |
next
|
|
287 |
fix j t assume "t \<in> space M"
|
|
288 |
have **: "?g j -` {?g j t} \<inter> space M = {x \<in> space M. f t j = f x j}"
|
|
289 |
by (auto simp: power_le_zero_eq Real_eq_Real mult_le_0_iff)
|
35582
|
290 |
|
38656
|
291 |
show "?g j -` {?g j t} \<inter> space M \<in> sets M"
|
|
292 |
proof cases
|
|
293 |
assume "of_nat j \<le> u t"
|
|
294 |
hence "?g j -` {?g j t} \<inter> space M = {x\<in>space M. of_nat j \<le> u x}"
|
|
295 |
unfolding ** f_eq[symmetric] by auto
|
|
296 |
thus "?g j -` {?g j t} \<inter> space M \<in> sets M"
|
|
297 |
using u by auto
|
35582
|
298 |
next
|
38656
|
299 |
assume not_t: "\<not> of_nat j \<le> u t"
|
|
300 |
hence less: "f t j < j*2^j" using f_eq[symmetric] `f t j \<le> j*2^j` by auto
|
|
301 |
have split_vimage: "?g j -` {?g j t} \<inter> space M =
|
|
302 |
{x\<in>space M. of_nat (f t j)/2^j \<le> u x} \<inter> {x\<in>space M. u x < of_nat (Suc (f t j))/2^j}"
|
|
303 |
unfolding **
|
|
304 |
proof safe
|
|
305 |
fix x assume [simp]: "f t j = f x j"
|
|
306 |
have *: "\<not> of_nat j \<le> u x" using not_t f_eq[symmetric] by simp
|
|
307 |
hence "of_nat (f t j) \<le> u x * 2^j \<and> u x * 2^j < of_nat (Suc (f t j))"
|
|
308 |
using upper lower by auto
|
|
309 |
hence "of_nat (f t j) / 2^j \<le> u x \<and> u x < of_nat (Suc (f t j))/2^j" using *
|
|
310 |
by (cases "u x") (auto simp: zero_le_mult_iff power_le_zero_eq divide_real_def[symmetric] field_simps)
|
|
311 |
thus "of_nat (f t j) / 2^j \<le> u x" "u x < of_nat (Suc (f t j))/2^j" by auto
|
|
312 |
next
|
|
313 |
fix x
|
|
314 |
assume "of_nat (f t j) / 2^j \<le> u x" "u x < of_nat (Suc (f t j))/2^j"
|
|
315 |
hence "of_nat (f t j) \<le> u x * 2 ^ j \<and> u x * 2 ^ j < of_nat (Suc (f t j))"
|
|
316 |
by (cases "u x") (auto simp: zero_le_mult_iff power_le_zero_eq divide_real_def[symmetric] field_simps)
|
|
317 |
hence 1: "of_nat (f t j) \<le> u x * 2 ^ j" and 2: "u x * 2 ^ j < of_nat (Suc (f t j))" by auto
|
|
318 |
note 2
|
|
319 |
also have "\<dots> \<le> of_nat (j*2^j)"
|
|
320 |
using less by (auto simp: zero_le_mult_iff simp del: real_of_nat_mult)
|
|
321 |
finally have bound_ux: "u x < of_nat j"
|
|
322 |
by (cases "u x") (auto simp: zero_le_mult_iff power_le_zero_eq)
|
|
323 |
show "f t j = f x j"
|
|
324 |
proof (rule antisym)
|
|
325 |
from 1 lower[OF bound_ux]
|
|
326 |
show "f t j \<le> f x j" by (cases "u x") (auto split: split_if_asm)
|
|
327 |
from upper[OF bound_ux] 2
|
|
328 |
show "f x j \<le> f t j" by (cases "u x") (auto split: split_if_asm)
|
|
329 |
qed
|
|
330 |
qed
|
|
331 |
show ?thesis unfolding split_vimage using u by auto
|
35582
|
332 |
qed
|
38656
|
333 |
next
|
|
334 |
fix j t assume "?g j t = \<omega>" thus False by (auto simp: power_le_zero_eq)
|
|
335 |
next
|
|
336 |
fix t
|
|
337 |
{ fix i
|
|
338 |
have "f t i * 2 \<le> f t (Suc i)"
|
|
339 |
proof (rule fI)
|
|
340 |
assume "of_nat (Suc i) \<le> u t"
|
|
341 |
hence "of_nat i \<le> u t" by (cases "u t") auto
|
|
342 |
thus "f t i * 2 \<le> Suc i * 2 ^ Suc i" unfolding f_eq[symmetric] by simp
|
|
343 |
next
|
|
344 |
fix k
|
|
345 |
assume *: "u t * 2 ^ Suc i < of_nat (Suc k)"
|
|
346 |
show "f t i * 2 \<le> k"
|
|
347 |
proof (rule fI)
|
|
348 |
assume "of_nat i \<le> u t"
|
|
349 |
hence "of_nat (i * 2^Suc i) \<le> u t * 2^Suc i"
|
|
350 |
by (cases "u t") (auto simp: zero_le_mult_iff power_le_zero_eq)
|
|
351 |
also have "\<dots> < of_nat (Suc k)" using * by auto
|
|
352 |
finally show "i * 2 ^ i * 2 \<le> k"
|
|
353 |
by (auto simp del: real_of_nat_mult)
|
|
354 |
next
|
|
355 |
fix j assume "of_nat j \<le> u t * 2 ^ i"
|
|
356 |
with * show "j * 2 \<le> k" by (cases "u t") (auto simp: zero_le_mult_iff power_le_zero_eq)
|
|
357 |
qed
|
|
358 |
qed
|
|
359 |
thus "?g i t \<le> ?g (Suc i) t"
|
|
360 |
by (auto simp: zero_le_mult_iff power_le_zero_eq divide_real_def[symmetric] field_simps) }
|
|
361 |
hence mono: "mono (\<lambda>i. ?g i t)" unfolding mono_iff_le_Suc by auto
|
35582
|
362 |
|
38656
|
363 |
show "(SUP j. of_nat (f t j) / 2 ^ j) = u t"
|
|
364 |
proof (rule pinfreal_SUPI)
|
|
365 |
fix j show "of_nat (f t j) / 2 ^ j \<le> u t"
|
|
366 |
proof (rule fI)
|
|
367 |
assume "of_nat j \<le> u t" thus "of_nat (j * 2 ^ j) / 2 ^ j \<le> u t"
|
|
368 |
by (cases "u t") (auto simp: power_le_zero_eq divide_real_def[symmetric] field_simps)
|
|
369 |
next
|
|
370 |
fix k assume "of_nat k \<le> u t * 2 ^ j"
|
|
371 |
thus "of_nat k / 2 ^ j \<le> u t"
|
|
372 |
by (cases "u t")
|
|
373 |
(auto simp: power_le_zero_eq divide_real_def[symmetric] field_simps zero_le_mult_iff)
|
|
374 |
qed
|
|
375 |
next
|
|
376 |
fix y :: pinfreal assume *: "\<And>j. j \<in> UNIV \<Longrightarrow> of_nat (f t j) / 2 ^ j \<le> y"
|
|
377 |
show "u t \<le> y"
|
|
378 |
proof (cases "u t")
|
|
379 |
case (preal r)
|
|
380 |
show ?thesis
|
|
381 |
proof (rule ccontr)
|
|
382 |
assume "\<not> u t \<le> y"
|
|
383 |
then obtain p where p: "y = Real p" "0 \<le> p" "p < r" using preal by (cases y) auto
|
|
384 |
with LIMSEQ_inverse_realpow_zero[of 2, unfolded LIMSEQ_iff, rule_format, of "r - p"]
|
|
385 |
obtain n where n: "\<And>N. n \<le> N \<Longrightarrow> inverse (2^N) < r - p" by auto
|
|
386 |
let ?N = "max n (natfloor r + 1)"
|
|
387 |
have "u t < of_nat ?N" "n \<le> ?N"
|
|
388 |
using ge_natfloor_plus_one_imp_gt[of r n] preal
|
38705
|
389 |
using real_natfloor_add_one_gt
|
|
390 |
by (auto simp: max_def real_of_nat_Suc)
|
38656
|
391 |
from lower[OF this(1)]
|
|
392 |
have "r < (real (f t ?N) + 1) / 2 ^ ?N" unfolding less_divide_eq
|
|
393 |
using preal by (auto simp add: power_le_zero_eq zero_le_mult_iff real_of_nat_Suc split: split_if_asm)
|
|
394 |
hence "u t < of_nat (f t ?N) / 2 ^ ?N + 1 / 2 ^ ?N"
|
|
395 |
using preal by (auto simp: field_simps divide_real_def[symmetric])
|
|
396 |
with n[OF `n \<le> ?N`] p preal *[of ?N]
|
|
397 |
show False
|
|
398 |
by (cases "f t ?N") (auto simp: power_le_zero_eq split: split_if_asm)
|
|
399 |
qed
|
|
400 |
next
|
|
401 |
case infinite
|
|
402 |
{ fix j have "f t j = j*2^j" using top[of j t] infinite by simp
|
|
403 |
hence "of_nat j \<le> y" using *[of j]
|
|
404 |
by (cases y) (auto simp: power_le_zero_eq zero_le_mult_iff field_simps) }
|
|
405 |
note all_less_y = this
|
|
406 |
show ?thesis unfolding infinite
|
|
407 |
proof (rule ccontr)
|
|
408 |
assume "\<not> \<omega> \<le> y" then obtain r where r: "y = Real r" "0 \<le> r" by (cases y) auto
|
|
409 |
moreover obtain n ::nat where "r < real n" using ex_less_of_nat by (auto simp: real_eq_of_nat)
|
|
410 |
with all_less_y[of n] r show False by auto
|
|
411 |
qed
|
|
412 |
qed
|
|
413 |
qed
|
35582
|
414 |
qed
|
|
415 |
qed
|
|
416 |
|
38656
|
417 |
lemma (in sigma_algebra) borel_measurable_implies_simple_function_sequence':
|
|
418 |
fixes u :: "'a \<Rightarrow> pinfreal"
|
|
419 |
assumes "u \<in> borel_measurable M"
|
|
420 |
obtains (x) f where "f \<up> u" "\<And>i. simple_function (f i)" "\<And>i. \<omega>\<notin>f i`space M"
|
35582
|
421 |
proof -
|
38656
|
422 |
from borel_measurable_implies_simple_function_sequence[OF assms]
|
|
423 |
obtain f where x: "\<And>i. simple_function (f i)" "f \<up> u"
|
|
424 |
and fin: "\<And>i. \<And>x. x\<in>space M \<Longrightarrow> f i x \<noteq> \<omega>" by auto
|
|
425 |
{ fix i from fin[of _ i] have "\<omega> \<notin> f i`space M" by fastsimp }
|
|
426 |
with x show thesis by (auto intro!: that[of f])
|
|
427 |
qed
|
|
428 |
|
|
429 |
section "Simple integral"
|
|
430 |
|
|
431 |
definition (in measure_space)
|
|
432 |
"simple_integral f = (\<Sum>x \<in> f ` space M. x * \<mu> (f -` {x} \<inter> space M))"
|
35582
|
433 |
|
38656
|
434 |
lemma (in measure_space) simple_integral_cong:
|
|
435 |
assumes "\<And>t. t \<in> space M \<Longrightarrow> f t = g t"
|
|
436 |
shows "simple_integral f = simple_integral g"
|
|
437 |
proof -
|
|
438 |
have "f ` space M = g ` space M"
|
|
439 |
"\<And>x. f -` {x} \<inter> space M = g -` {x} \<inter> space M"
|
|
440 |
using assms by (auto intro!: image_eqI)
|
|
441 |
thus ?thesis unfolding simple_integral_def by simp
|
|
442 |
qed
|
|
443 |
|
|
444 |
lemma (in measure_space) simple_integral_const[simp]:
|
|
445 |
"simple_integral (\<lambda>x. c) = c * \<mu> (space M)"
|
|
446 |
proof (cases "space M = {}")
|
|
447 |
case True thus ?thesis unfolding simple_integral_def by simp
|
|
448 |
next
|
|
449 |
case False hence "(\<lambda>x. c) ` space M = {c}" by auto
|
|
450 |
thus ?thesis unfolding simple_integral_def by simp
|
35582
|
451 |
qed
|
|
452 |
|
38656
|
453 |
lemma (in measure_space) simple_function_partition:
|
|
454 |
assumes "simple_function f" and "simple_function g"
|
|
455 |
shows "simple_integral f = (\<Sum>A\<in>(\<lambda>x. f -` {f x} \<inter> g -` {g x} \<inter> space M) ` space M. contents (f`A) * \<mu> A)"
|
|
456 |
(is "_ = setsum _ (?p ` space M)")
|
|
457 |
proof-
|
|
458 |
let "?sub x" = "?p ` (f -` {x} \<inter> space M)"
|
|
459 |
let ?SIGMA = "Sigma (f`space M) ?sub"
|
35582
|
460 |
|
38656
|
461 |
have [intro]:
|
|
462 |
"finite (f ` space M)"
|
|
463 |
"finite (g ` space M)"
|
|
464 |
using assms unfolding simple_function_def by simp_all
|
|
465 |
|
|
466 |
{ fix A
|
|
467 |
have "?p ` (A \<inter> space M) \<subseteq>
|
|
468 |
(\<lambda>(x,y). f -` {x} \<inter> g -` {y} \<inter> space M) ` (f`space M \<times> g`space M)"
|
|
469 |
by auto
|
|
470 |
hence "finite (?p ` (A \<inter> space M))"
|
|
471 |
by (rule finite_subset) (auto intro: finite_SigmaI finite_imageI) }
|
|
472 |
note this[intro, simp]
|
35582
|
473 |
|
38656
|
474 |
{ fix x assume "x \<in> space M"
|
|
475 |
have "\<Union>(?sub (f x)) = (f -` {f x} \<inter> space M)" by auto
|
|
476 |
moreover {
|
|
477 |
fix x y
|
|
478 |
have *: "f -` {f x} \<inter> g -` {g x} \<inter> space M
|
|
479 |
= (f -` {f x} \<inter> space M) \<inter> (g -` {g x} \<inter> space M)" by auto
|
|
480 |
assume "x \<in> space M" "y \<in> space M"
|
|
481 |
hence "f -` {f x} \<inter> g -` {g x} \<inter> space M \<in> sets M"
|
|
482 |
using assms unfolding simple_function_def * by auto }
|
|
483 |
ultimately
|
|
484 |
have "\<mu> (f -` {f x} \<inter> space M) = setsum (\<mu>) (?sub (f x))"
|
|
485 |
by (subst measure_finitely_additive) auto }
|
|
486 |
hence "simple_integral f = (\<Sum>(x,A)\<in>?SIGMA. x * \<mu> A)"
|
|
487 |
unfolding simple_integral_def
|
|
488 |
by (subst setsum_Sigma[symmetric],
|
|
489 |
auto intro!: setsum_cong simp: setsum_right_distrib[symmetric])
|
|
490 |
also have "\<dots> = (\<Sum>A\<in>?p ` space M. contents (f`A) * \<mu> A)"
|
|
491 |
proof -
|
|
492 |
have [simp]: "\<And>x. x \<in> space M \<Longrightarrow> f ` ?p x = {f x}" by (auto intro!: imageI)
|
|
493 |
have "(\<lambda>A. (contents (f ` A), A)) ` ?p ` space M
|
|
494 |
= (\<lambda>x. (f x, ?p x)) ` space M"
|
|
495 |
proof safe
|
|
496 |
fix x assume "x \<in> space M"
|
|
497 |
thus "(f x, ?p x) \<in> (\<lambda>A. (contents (f`A), A)) ` ?p ` space M"
|
|
498 |
by (auto intro!: image_eqI[of _ _ "?p x"])
|
|
499 |
qed auto
|
|
500 |
thus ?thesis
|
|
501 |
apply (auto intro!: setsum_reindex_cong[of "\<lambda>A. (contents (f`A), A)"] inj_onI)
|
|
502 |
apply (rule_tac x="xa" in image_eqI)
|
|
503 |
by simp_all
|
|
504 |
qed
|
|
505 |
finally show ?thesis .
|
35582
|
506 |
qed
|
|
507 |
|
38656
|
508 |
lemma (in measure_space) simple_integral_add[simp]:
|
|
509 |
assumes "simple_function f" and "simple_function g"
|
|
510 |
shows "simple_integral (\<lambda>x. f x + g x) = simple_integral f + simple_integral g"
|
35582
|
511 |
proof -
|
38656
|
512 |
{ fix x let ?S = "g -` {g x} \<inter> f -` {f x} \<inter> space M"
|
|
513 |
assume "x \<in> space M"
|
|
514 |
hence "(\<lambda>a. f a + g a) ` ?S = {f x + g x}" "f ` ?S = {f x}" "g ` ?S = {g x}"
|
|
515 |
"(\<lambda>x. (f x, g x)) -` {(f x, g x)} \<inter> space M = ?S"
|
|
516 |
by auto }
|
|
517 |
thus ?thesis
|
|
518 |
unfolding
|
|
519 |
simple_function_partition[OF simple_function_add[OF assms] simple_function_Pair[OF assms]]
|
|
520 |
simple_function_partition[OF `simple_function f` `simple_function g`]
|
|
521 |
simple_function_partition[OF `simple_function g` `simple_function f`]
|
|
522 |
apply (subst (3) Int_commute)
|
|
523 |
by (auto simp add: field_simps setsum_addf[symmetric] intro!: setsum_cong)
|
35582
|
524 |
qed
|
|
525 |
|
38656
|
526 |
lemma (in measure_space) simple_integral_setsum[simp]:
|
|
527 |
assumes "\<And>i. i \<in> P \<Longrightarrow> simple_function (f i)"
|
|
528 |
shows "simple_integral (\<lambda>x. \<Sum>i\<in>P. f i x) = (\<Sum>i\<in>P. simple_integral (f i))"
|
|
529 |
proof cases
|
|
530 |
assume "finite P"
|
|
531 |
from this assms show ?thesis
|
|
532 |
by induct (auto simp: simple_function_setsum simple_integral_add)
|
|
533 |
qed auto
|
|
534 |
|
|
535 |
lemma (in measure_space) simple_integral_mult[simp]:
|
|
536 |
assumes "simple_function f"
|
|
537 |
shows "simple_integral (\<lambda>x. c * f x) = c * simple_integral f"
|
|
538 |
proof -
|
|
539 |
note mult = simple_function_mult[OF simple_function_const[of c] assms]
|
|
540 |
{ fix x let ?S = "f -` {f x} \<inter> (\<lambda>x. c * f x) -` {c * f x} \<inter> space M"
|
|
541 |
assume "x \<in> space M"
|
|
542 |
hence "(\<lambda>x. c * f x) ` ?S = {c * f x}" "f ` ?S = {f x}"
|
|
543 |
by auto }
|
|
544 |
thus ?thesis
|
|
545 |
unfolding simple_function_partition[OF mult assms]
|
|
546 |
simple_function_partition[OF assms mult]
|
|
547 |
by (auto simp: setsum_right_distrib field_simps intro!: setsum_cong)
|
35582
|
548 |
qed
|
|
549 |
|
38656
|
550 |
lemma (in measure_space) simple_integral_mono:
|
|
551 |
assumes "simple_function f" and "simple_function g"
|
|
552 |
and mono: "\<And> x. x \<in> space M \<Longrightarrow> f x \<le> g x"
|
|
553 |
shows "simple_integral f \<le> simple_integral g"
|
|
554 |
unfolding
|
|
555 |
simple_function_partition[OF `simple_function f` `simple_function g`]
|
|
556 |
simple_function_partition[OF `simple_function g` `simple_function f`]
|
|
557 |
apply (subst Int_commute)
|
|
558 |
proof (safe intro!: setsum_mono)
|
|
559 |
fix x let ?S = "g -` {g x} \<inter> f -` {f x} \<inter> space M"
|
|
560 |
assume "x \<in> space M"
|
|
561 |
hence "f ` ?S = {f x}" "g ` ?S = {g x}" by auto
|
|
562 |
thus "contents (f`?S) * \<mu> ?S \<le> contents (g`?S) * \<mu> ?S"
|
|
563 |
using mono[OF `x \<in> space M`] by (auto intro!: mult_right_mono)
|
35582
|
564 |
qed
|
|
565 |
|
38656
|
566 |
lemma (in measure_space) simple_integral_indicator:
|
|
567 |
assumes "A \<in> sets M"
|
|
568 |
assumes "simple_function f"
|
|
569 |
shows "simple_integral (\<lambda>x. f x * indicator A x) =
|
|
570 |
(\<Sum>x \<in> f ` space M. x * \<mu> (f -` {x} \<inter> space M \<inter> A))"
|
|
571 |
proof cases
|
|
572 |
assume "A = space M"
|
|
573 |
moreover hence "simple_integral (\<lambda>x. f x * indicator A x) = simple_integral f"
|
|
574 |
by (auto intro!: simple_integral_cong)
|
|
575 |
moreover have "\<And>X. X \<inter> space M \<inter> space M = X \<inter> space M" by auto
|
|
576 |
ultimately show ?thesis by (simp add: simple_integral_def)
|
|
577 |
next
|
|
578 |
assume "A \<noteq> space M"
|
|
579 |
then obtain x where x: "x \<in> space M" "x \<notin> A" using sets_into_space[OF assms(1)] by auto
|
|
580 |
have I: "(\<lambda>x. f x * indicator A x) ` space M = f ` A \<union> {0}" (is "?I ` _ = _")
|
35582
|
581 |
proof safe
|
38656
|
582 |
fix y assume "?I y \<notin> f ` A" hence "y \<notin> A" by auto thus "?I y = 0" by auto
|
|
583 |
next
|
|
584 |
fix y assume "y \<in> A" thus "f y \<in> ?I ` space M"
|
|
585 |
using sets_into_space[OF assms(1)] by (auto intro!: image_eqI[of _ _ y])
|
|
586 |
next
|
|
587 |
show "0 \<in> ?I ` space M" using x by (auto intro!: image_eqI[of _ _ x])
|
35582
|
588 |
qed
|
38656
|
589 |
have *: "simple_integral (\<lambda>x. f x * indicator A x) =
|
|
590 |
(\<Sum>x \<in> f ` space M \<union> {0}. x * \<mu> (f -` {x} \<inter> space M \<inter> A))"
|
|
591 |
unfolding simple_integral_def I
|
|
592 |
proof (rule setsum_mono_zero_cong_left)
|
|
593 |
show "finite (f ` space M \<union> {0})"
|
|
594 |
using assms(2) unfolding simple_function_def by auto
|
|
595 |
show "f ` A \<union> {0} \<subseteq> f`space M \<union> {0}"
|
|
596 |
using sets_into_space[OF assms(1)] by auto
|
|
597 |
have "\<And>x. f x \<notin> f ` A \<Longrightarrow> f -` {f x} \<inter> space M \<inter> A = {}" by (auto simp: image_iff)
|
|
598 |
thus "\<forall>i\<in>f ` space M \<union> {0} - (f ` A \<union> {0}).
|
|
599 |
i * \<mu> (f -` {i} \<inter> space M \<inter> A) = 0" by auto
|
|
600 |
next
|
|
601 |
fix x assume "x \<in> f`A \<union> {0}"
|
|
602 |
hence "x \<noteq> 0 \<Longrightarrow> ?I -` {x} \<inter> space M = f -` {x} \<inter> space M \<inter> A"
|
|
603 |
by (auto simp: indicator_def split: split_if_asm)
|
|
604 |
thus "x * \<mu> (?I -` {x} \<inter> space M) =
|
|
605 |
x * \<mu> (f -` {x} \<inter> space M \<inter> A)" by (cases "x = 0") simp_all
|
|
606 |
qed
|
|
607 |
show ?thesis unfolding *
|
|
608 |
using assms(2) unfolding simple_function_def
|
|
609 |
by (auto intro!: setsum_mono_zero_cong_right)
|
|
610 |
qed
|
35582
|
611 |
|
38656
|
612 |
lemma (in measure_space) simple_integral_indicator_only[simp]:
|
|
613 |
assumes "A \<in> sets M"
|
|
614 |
shows "simple_integral (indicator A) = \<mu> A"
|
|
615 |
proof cases
|
|
616 |
assume "space M = {}" hence "A = {}" using sets_into_space[OF assms] by auto
|
|
617 |
thus ?thesis unfolding simple_integral_def using `space M = {}` by auto
|
|
618 |
next
|
|
619 |
assume "space M \<noteq> {}" hence "(\<lambda>x. 1) ` space M = {1::pinfreal}" by auto
|
|
620 |
thus ?thesis
|
|
621 |
using simple_integral_indicator[OF assms simple_function_const[of 1]]
|
|
622 |
using sets_into_space[OF assms]
|
|
623 |
by (auto intro!: arg_cong[where f="\<mu>"])
|
|
624 |
qed
|
35582
|
625 |
|
38656
|
626 |
lemma (in measure_space) simple_integral_null_set:
|
|
627 |
assumes "simple_function u" "N \<in> null_sets"
|
|
628 |
shows "simple_integral (\<lambda>x. u x * indicator N x) = 0"
|
|
629 |
proof -
|
|
630 |
have "simple_integral (\<lambda>x. u x * indicator N x) \<le>
|
|
631 |
simple_integral (\<lambda>x. \<omega> * indicator N x)"
|
|
632 |
using assms
|
|
633 |
by (safe intro!: simple_integral_mono simple_function_mult simple_function_indicator simple_function_const) simp
|
|
634 |
also have "... = 0" apply(subst simple_integral_mult)
|
|
635 |
using assms(2) by auto
|
|
636 |
finally show ?thesis by auto
|
|
637 |
qed
|
35582
|
638 |
|
38656
|
639 |
lemma (in measure_space) simple_integral_cong':
|
|
640 |
assumes f: "simple_function f" and g: "simple_function g"
|
|
641 |
and mea: "\<mu> {x\<in>space M. f x \<noteq> g x} = 0"
|
|
642 |
shows "simple_integral f = simple_integral g"
|
|
643 |
proof -
|
|
644 |
let ?h = "\<lambda>h. \<lambda>x. (h x * indicator {x\<in>space M. f x = g x} x
|
|
645 |
+ h x * indicator {x\<in>space M. f x \<noteq> g x} x
|
|
646 |
+ h x * indicator (-space M) x::pinfreal)"
|
|
647 |
have *:"\<And>h. h = ?h h" unfolding indicator_def apply rule by auto
|
|
648 |
have mea_neq:"{x \<in> space M. f x \<noteq> g x} \<in> sets M" using f g by (auto simp: borel_measurable_simple_function)
|
|
649 |
then have mea_nullset: "{x \<in> space M. f x \<noteq> g x} \<in> null_sets" using mea by auto
|
|
650 |
have h1:"\<And>h::_=>pinfreal. simple_function h \<Longrightarrow>
|
|
651 |
simple_function (\<lambda>x. h x * indicator {x\<in>space M. f x = g x} x)"
|
|
652 |
apply(safe intro!: simple_function_add simple_function_mult simple_function_indicator)
|
|
653 |
using f g by (auto simp: borel_measurable_simple_function)
|
|
654 |
have h2:"\<And>h::_\<Rightarrow>pinfreal. simple_function h \<Longrightarrow>
|
|
655 |
simple_function (\<lambda>x. h x * indicator {x\<in>space M. f x \<noteq> g x} x)"
|
|
656 |
apply(safe intro!: simple_function_add simple_function_mult simple_function_indicator)
|
|
657 |
by(rule mea_neq)
|
|
658 |
have **:"\<And>a b c d e f. a = b \<Longrightarrow> c = d \<Longrightarrow> e = f \<Longrightarrow> a+c+e = b+d+f" by auto
|
|
659 |
note *** = simple_integral_add[OF simple_function_add[OF h1 h2] simple_function_notspace]
|
|
660 |
simple_integral_add[OF h1 h2]
|
|
661 |
show ?thesis apply(subst *[of g]) apply(subst *[of f])
|
|
662 |
unfolding ***[OF f f] ***[OF g g]
|
|
663 |
proof(rule **) case goal1 show ?case apply(rule arg_cong[where f=simple_integral]) apply rule
|
|
664 |
unfolding indicator_def by auto
|
|
665 |
next note * = simple_integral_null_set[OF _ mea_nullset]
|
|
666 |
case goal2 show ?case unfolding *[OF f] *[OF g] ..
|
|
667 |
next case goal3 show ?case apply(rule simple_integral_cong) by auto
|
35582
|
668 |
qed
|
|
669 |
qed
|
|
670 |
|
35692
|
671 |
section "Continuous posititve integration"
|
|
672 |
|
38656
|
673 |
definition (in measure_space)
|
|
674 |
"positive_integral f =
|
|
675 |
(SUP g : {g. simple_function g \<and> g \<le> f \<and> \<omega> \<notin> g`space M}. simple_integral g)"
|
35582
|
676 |
|
38656
|
677 |
lemma (in measure_space) positive_integral_alt1:
|
|
678 |
"positive_integral f =
|
|
679 |
(SUP g : {g. simple_function g \<and> (\<forall>x\<in>space M. g x \<le> f x \<and> g x \<noteq> \<omega>)}. simple_integral g)"
|
|
680 |
unfolding positive_integral_def SUPR_def
|
|
681 |
proof (safe intro!: arg_cong[where f=Sup])
|
|
682 |
fix g let ?g = "\<lambda>x. if x \<in> space M then g x else f x"
|
|
683 |
assume "simple_function g" "\<forall>x\<in>space M. g x \<le> f x \<and> g x \<noteq> \<omega>"
|
|
684 |
hence "?g \<le> f" "simple_function ?g" "simple_integral g = simple_integral ?g"
|
|
685 |
"\<omega> \<notin> g`space M"
|
|
686 |
unfolding le_fun_def by (auto cong: simple_function_cong simple_integral_cong)
|
|
687 |
thus "simple_integral g \<in> simple_integral ` {g. simple_function g \<and> g \<le> f \<and> \<omega> \<notin> g`space M}"
|
|
688 |
by auto
|
|
689 |
next
|
|
690 |
fix g assume "simple_function g" "g \<le> f" "\<omega> \<notin> g`space M"
|
|
691 |
hence "simple_function g" "\<forall>x\<in>space M. g x \<le> f x \<and> g x \<noteq> \<omega>"
|
|
692 |
by (auto simp add: le_fun_def image_iff)
|
|
693 |
thus "simple_integral g \<in> simple_integral ` {g. simple_function g \<and> (\<forall>x\<in>space M. g x \<le> f x \<and> g x \<noteq> \<omega>)}"
|
|
694 |
by auto
|
35582
|
695 |
qed
|
|
696 |
|
38656
|
697 |
lemma (in measure_space) positive_integral_alt:
|
|
698 |
"positive_integral f =
|
|
699 |
(SUP g : {g. simple_function g \<and> g \<le> f}. simple_integral g)"
|
|
700 |
apply(rule order_class.antisym) unfolding positive_integral_def
|
|
701 |
apply(rule SUPR_subset) apply blast apply(rule SUPR_mono_lim)
|
|
702 |
proof safe fix u assume u:"simple_function u" and uf:"u \<le> f"
|
|
703 |
let ?u = "\<lambda>n x. if u x = \<omega> then Real (real (n::nat)) else u x"
|
|
704 |
have su:"\<And>n. simple_function (?u n)" using simple_function_compose1[OF u] .
|
|
705 |
show "\<exists>b. \<forall>n. b n \<in> {g. simple_function g \<and> g \<le> f \<and> \<omega> \<notin> g ` space M} \<and>
|
|
706 |
(\<lambda>n. simple_integral (b n)) ----> simple_integral u"
|
|
707 |
apply(rule_tac x="?u" in exI, safe) apply(rule su)
|
|
708 |
proof- fix n::nat have "?u n \<le> u" unfolding le_fun_def by auto
|
|
709 |
also note uf finally show "?u n \<le> f" .
|
|
710 |
let ?s = "{x \<in> space M. u x = \<omega>}"
|
|
711 |
show "(\<lambda>n. simple_integral (?u n)) ----> simple_integral u"
|
|
712 |
proof(cases "\<mu> ?s = 0")
|
|
713 |
case True have *:"\<And>n. {x\<in>space M. ?u n x \<noteq> u x} = {x\<in>space M. u x = \<omega>}" by auto
|
|
714 |
have *:"\<And>n. simple_integral (?u n) = simple_integral u"
|
|
715 |
apply(rule simple_integral_cong'[OF su u]) unfolding * True ..
|
|
716 |
show ?thesis unfolding * by auto
|
|
717 |
next case False note m0=this
|
|
718 |
have s:"{x \<in> space M. u x = \<omega>} \<in> sets M" using u by (auto simp: borel_measurable_simple_function)
|
|
719 |
have "\<omega> = simple_integral (\<lambda>x. \<omega> * indicator {x\<in>space M. u x = \<omega>} x)"
|
|
720 |
apply(subst simple_integral_mult) using s
|
|
721 |
unfolding simple_integral_indicator_only[OF s] using False by auto
|
|
722 |
also have "... \<le> simple_integral u"
|
|
723 |
apply (rule simple_integral_mono)
|
|
724 |
apply (rule simple_function_mult)
|
|
725 |
apply (rule simple_function_const)
|
|
726 |
apply(rule ) prefer 3 apply(subst indicator_def)
|
|
727 |
using s u by auto
|
|
728 |
finally have *:"simple_integral u = \<omega>" by auto
|
|
729 |
show ?thesis unfolding * Lim_omega_pos
|
|
730 |
proof safe case goal1
|
|
731 |
from real_arch_simple[of "B / real (\<mu> ?s)"] guess N0 .. note N=this
|
|
732 |
def N \<equiv> "Suc N0" have N:"real N \<ge> B / real (\<mu> ?s)" "N > 0"
|
|
733 |
unfolding N_def using N by auto
|
|
734 |
show ?case apply-apply(rule_tac x=N in exI,safe)
|
|
735 |
proof- case goal1
|
|
736 |
have "Real B \<le> Real (real N) * \<mu> ?s"
|
|
737 |
proof(cases "\<mu> ?s = \<omega>")
|
|
738 |
case True thus ?thesis using `B>0` N by auto
|
|
739 |
next case False
|
|
740 |
have *:"B \<le> real N * real (\<mu> ?s)"
|
|
741 |
using N(1) apply-apply(subst (asm) pos_divide_le_eq)
|
|
742 |
apply rule using m0 False by auto
|
|
743 |
show ?thesis apply(subst Real_real'[THEN sym,OF False])
|
|
744 |
apply(subst pinfreal_times,subst if_P) defer
|
|
745 |
apply(subst pinfreal_less_eq,subst if_P) defer
|
|
746 |
using * N `B>0` by(auto intro: mult_nonneg_nonneg)
|
|
747 |
qed
|
|
748 |
also have "... \<le> Real (real n) * \<mu> ?s"
|
|
749 |
apply(rule mult_right_mono) using goal1 by auto
|
|
750 |
also have "... = simple_integral (\<lambda>x. Real (real n) * indicator ?s x)"
|
|
751 |
apply(subst simple_integral_mult) apply(rule simple_function_indicator[OF s])
|
|
752 |
unfolding simple_integral_indicator_only[OF s] ..
|
|
753 |
also have "... \<le> simple_integral (\<lambda>x. if u x = \<omega> then Real (real n) else u x)"
|
|
754 |
apply(rule simple_integral_mono) apply(rule simple_function_mult)
|
|
755 |
apply(rule simple_function_const)
|
|
756 |
apply(rule simple_function_indicator) apply(rule s su)+ by auto
|
|
757 |
finally show ?case .
|
|
758 |
qed qed qed
|
|
759 |
fix x assume x:"\<omega> = (if u x = \<omega> then Real (real n) else u x)" "x \<in> space M"
|
|
760 |
hence "u x = \<omega>" apply-apply(rule ccontr) by auto
|
|
761 |
hence "\<omega> = Real (real n)" using x by auto
|
|
762 |
thus False by auto
|
35582
|
763 |
qed
|
|
764 |
qed
|
|
765 |
|
38656
|
766 |
lemma (in measure_space) positive_integral_cong:
|
|
767 |
assumes "\<And>x. x \<in> space M \<Longrightarrow> f x = g x"
|
|
768 |
shows "positive_integral f = positive_integral g"
|
|
769 |
proof -
|
|
770 |
have "\<And>h. (\<forall>x\<in>space M. h x \<le> f x \<and> h x \<noteq> \<omega>) = (\<forall>x\<in>space M. h x \<le> g x \<and> h x \<noteq> \<omega>)"
|
|
771 |
using assms by auto
|
|
772 |
thus ?thesis unfolding positive_integral_alt1 by auto
|
|
773 |
qed
|
|
774 |
|
|
775 |
lemma (in measure_space) positive_integral_eq_simple_integral:
|
|
776 |
assumes "simple_function f"
|
|
777 |
shows "positive_integral f = simple_integral f"
|
|
778 |
unfolding positive_integral_alt
|
|
779 |
proof (safe intro!: pinfreal_SUPI)
|
|
780 |
fix g assume "simple_function g" "g \<le> f"
|
|
781 |
with assms show "simple_integral g \<le> simple_integral f"
|
|
782 |
by (auto intro!: simple_integral_mono simp: le_fun_def)
|
|
783 |
next
|
|
784 |
fix y assume "\<forall>x. x\<in>{g. simple_function g \<and> g \<le> f} \<longrightarrow> simple_integral x \<le> y"
|
|
785 |
with assms show "simple_integral f \<le> y" by auto
|
|
786 |
qed
|
35582
|
787 |
|
38656
|
788 |
lemma (in measure_space) positive_integral_mono:
|
|
789 |
assumes mono: "\<And>x. x \<in> space M \<Longrightarrow> u x \<le> v x"
|
|
790 |
shows "positive_integral u \<le> positive_integral v"
|
|
791 |
unfolding positive_integral_alt1
|
|
792 |
proof (safe intro!: SUPR_mono)
|
|
793 |
fix a assume a: "simple_function a" and "\<forall>x\<in>space M. a x \<le> u x \<and> a x \<noteq> \<omega>"
|
|
794 |
with mono have "\<forall>x\<in>space M. a x \<le> v x \<and> a x \<noteq> \<omega>" by fastsimp
|
|
795 |
with a show "\<exists>b\<in>{g. simple_function g \<and> (\<forall>x\<in>space M. g x \<le> v x \<and> g x \<noteq> \<omega>)}. simple_integral a \<le> simple_integral b"
|
|
796 |
by (auto intro!: bexI[of _ a])
|
|
797 |
qed
|
|
798 |
|
|
799 |
lemma (in measure_space) positive_integral_SUP_approx:
|
|
800 |
assumes "f \<up> s"
|
|
801 |
and f: "\<And>i. f i \<in> borel_measurable M"
|
|
802 |
and "simple_function u"
|
|
803 |
and le: "u \<le> s" and real: "\<omega> \<notin> u`space M"
|
|
804 |
shows "simple_integral u \<le> (SUP i. positive_integral (f i))" (is "_ \<le> ?S")
|
|
805 |
proof (rule pinfreal_le_mult_one_interval)
|
|
806 |
fix a :: pinfreal assume "0 < a" "a < 1"
|
|
807 |
hence "a \<noteq> 0" by auto
|
|
808 |
let "?B i" = "{x \<in> space M. a * u x \<le> f i x}"
|
|
809 |
have B: "\<And>i. ?B i \<in> sets M"
|
|
810 |
using f `simple_function u` by (auto simp: borel_measurable_simple_function)
|
|
811 |
|
|
812 |
let "?uB i x" = "u x * indicator (?B i) x"
|
|
813 |
|
|
814 |
{ fix i have "?B i \<subseteq> ?B (Suc i)"
|
|
815 |
proof safe
|
|
816 |
fix i x assume "a * u x \<le> f i x"
|
|
817 |
also have "\<dots> \<le> f (Suc i) x"
|
|
818 |
using `f \<up> s` unfolding isoton_def le_fun_def by auto
|
|
819 |
finally show "a * u x \<le> f (Suc i) x" .
|
|
820 |
qed }
|
|
821 |
note B_mono = this
|
35582
|
822 |
|
38656
|
823 |
have u: "\<And>x. x \<in> space M \<Longrightarrow> u -` {u x} \<inter> space M \<in> sets M"
|
|
824 |
using `simple_function u` by (auto simp add: simple_function_def)
|
|
825 |
|
|
826 |
{ fix i
|
|
827 |
have "(\<lambda>n. (u -` {i} \<inter> space M) \<inter> ?B n) \<up> (u -` {i} \<inter> space M)" using B_mono unfolding isoton_def
|
|
828 |
proof safe
|
|
829 |
fix x assume "x \<in> space M"
|
|
830 |
show "x \<in> (\<Union>i. (u -` {u x} \<inter> space M) \<inter> ?B i)"
|
|
831 |
proof cases
|
|
832 |
assume "u x = 0" thus ?thesis using `x \<in> space M` by simp
|
|
833 |
next
|
|
834 |
assume "u x \<noteq> 0"
|
|
835 |
with `a < 1` real `x \<in> space M`
|
|
836 |
have "a * u x < 1 * u x" by (rule_tac pinfreal_mult_strict_right_mono) (auto simp: image_iff)
|
|
837 |
also have "\<dots> \<le> (SUP i. f i x)" using le `f \<up> s`
|
|
838 |
unfolding isoton_fun_expand by (auto simp: isoton_def le_fun_def)
|
|
839 |
finally obtain i where "a * u x < f i x" unfolding SUPR_def
|
|
840 |
by (auto simp add: less_Sup_iff)
|
|
841 |
hence "a * u x \<le> f i x" by auto
|
|
842 |
thus ?thesis using `x \<in> space M` by auto
|
|
843 |
qed
|
|
844 |
qed auto }
|
|
845 |
note measure_conv = measure_up[OF u Int[OF u B] this]
|
|
846 |
|
|
847 |
have "simple_integral u = (SUP i. simple_integral (?uB i))"
|
|
848 |
unfolding simple_integral_indicator[OF B `simple_function u`]
|
|
849 |
proof (subst SUPR_pinfreal_setsum, safe)
|
|
850 |
fix x n assume "x \<in> space M"
|
|
851 |
have "\<mu> (u -` {u x} \<inter> space M \<inter> {x \<in> space M. a * u x \<le> f n x})
|
|
852 |
\<le> \<mu> (u -` {u x} \<inter> space M \<inter> {x \<in> space M. a * u x \<le> f (Suc n) x})"
|
|
853 |
using B_mono Int[OF u[OF `x \<in> space M`] B] by (auto intro!: measure_mono)
|
|
854 |
thus "u x * \<mu> (u -` {u x} \<inter> space M \<inter> ?B n)
|
|
855 |
\<le> u x * \<mu> (u -` {u x} \<inter> space M \<inter> ?B (Suc n))"
|
|
856 |
by (auto intro: mult_left_mono)
|
|
857 |
next
|
|
858 |
show "simple_integral u =
|
|
859 |
(\<Sum>i\<in>u ` space M. SUP n. i * \<mu> (u -` {i} \<inter> space M \<inter> ?B n))"
|
|
860 |
using measure_conv unfolding simple_integral_def isoton_def
|
|
861 |
by (auto intro!: setsum_cong simp: pinfreal_SUP_cmult)
|
|
862 |
qed
|
|
863 |
moreover
|
|
864 |
have "a * (SUP i. simple_integral (?uB i)) \<le> ?S"
|
|
865 |
unfolding pinfreal_SUP_cmult[symmetric]
|
38705
|
866 |
proof (safe intro!: SUP_mono bexI)
|
38656
|
867 |
fix i
|
|
868 |
have "a * simple_integral (?uB i) = simple_integral (\<lambda>x. a * ?uB i x)"
|
|
869 |
using B `simple_function u`
|
|
870 |
by (subst simple_integral_mult[symmetric]) (auto simp: field_simps)
|
|
871 |
also have "\<dots> \<le> positive_integral (f i)"
|
|
872 |
proof -
|
|
873 |
have "\<And>x. a * ?uB i x \<le> f i x" unfolding indicator_def by auto
|
|
874 |
hence *: "simple_function (\<lambda>x. a * ?uB i x)" using B assms(3)
|
|
875 |
by (auto intro!: simple_integral_mono)
|
|
876 |
show ?thesis unfolding positive_integral_eq_simple_integral[OF *, symmetric]
|
|
877 |
by (auto intro!: positive_integral_mono simp: indicator_def)
|
|
878 |
qed
|
|
879 |
finally show "a * simple_integral (?uB i) \<le> positive_integral (f i)"
|
|
880 |
by auto
|
38705
|
881 |
qed simp
|
38656
|
882 |
ultimately show "a * simple_integral u \<le> ?S" by simp
|
35582
|
883 |
qed
|
|
884 |
|
|
885 |
text {* Beppo-Levi monotone convergence theorem *}
|
38656
|
886 |
lemma (in measure_space) positive_integral_isoton:
|
|
887 |
assumes "f \<up> u" "\<And>i. f i \<in> borel_measurable M"
|
|
888 |
shows "(\<lambda>i. positive_integral (f i)) \<up> positive_integral u"
|
|
889 |
unfolding isoton_def
|
|
890 |
proof safe
|
|
891 |
fix i show "positive_integral (f i) \<le> positive_integral (f (Suc i))"
|
|
892 |
apply (rule positive_integral_mono)
|
|
893 |
using `f \<up> u` unfolding isoton_def le_fun_def by auto
|
|
894 |
next
|
|
895 |
have "u \<in> borel_measurable M"
|
|
896 |
using borel_measurable_SUP[of UNIV f] assms by (auto simp: isoton_def)
|
|
897 |
have u: "u = (SUP i. f i)" using `f \<up> u` unfolding isoton_def by auto
|
35582
|
898 |
|
38656
|
899 |
show "(SUP i. positive_integral (f i)) = positive_integral u"
|
|
900 |
proof (rule antisym)
|
|
901 |
from `f \<up> u`[THEN isoton_Sup, unfolded le_fun_def]
|
|
902 |
show "(SUP j. positive_integral (f j)) \<le> positive_integral u"
|
|
903 |
by (auto intro!: SUP_leI positive_integral_mono)
|
|
904 |
next
|
|
905 |
show "positive_integral u \<le> (SUP i. positive_integral (f i))"
|
|
906 |
unfolding positive_integral_def[of u]
|
|
907 |
by (auto intro!: SUP_leI positive_integral_SUP_approx[OF assms])
|
35582
|
908 |
qed
|
|
909 |
qed
|
|
910 |
|
38656
|
911 |
lemma (in measure_space) SUP_simple_integral_sequences:
|
|
912 |
assumes f: "f \<up> u" "\<And>i. simple_function (f i)"
|
|
913 |
and g: "g \<up> u" "\<And>i. simple_function (g i)"
|
|
914 |
shows "(SUP i. simple_integral (f i)) = (SUP i. simple_integral (g i))"
|
|
915 |
(is "SUPR _ ?F = SUPR _ ?G")
|
|
916 |
proof -
|
|
917 |
have "(SUP i. ?F i) = (SUP i. positive_integral (f i))"
|
|
918 |
using assms by (simp add: positive_integral_eq_simple_integral)
|
|
919 |
also have "\<dots> = positive_integral u"
|
|
920 |
using positive_integral_isoton[OF f(1) borel_measurable_simple_function[OF f(2)]]
|
|
921 |
unfolding isoton_def by simp
|
|
922 |
also have "\<dots> = (SUP i. positive_integral (g i))"
|
|
923 |
using positive_integral_isoton[OF g(1) borel_measurable_simple_function[OF g(2)]]
|
|
924 |
unfolding isoton_def by simp
|
|
925 |
also have "\<dots> = (SUP i. ?G i)"
|
|
926 |
using assms by (simp add: positive_integral_eq_simple_integral)
|
|
927 |
finally show ?thesis .
|
|
928 |
qed
|
|
929 |
|
|
930 |
lemma (in measure_space) positive_integral_const[simp]:
|
|
931 |
"positive_integral (\<lambda>x. c) = c * \<mu> (space M)"
|
|
932 |
by (subst positive_integral_eq_simple_integral) auto
|
|
933 |
|
|
934 |
lemma (in measure_space) positive_integral_isoton_simple:
|
|
935 |
assumes "f \<up> u" and e: "\<And>i. simple_function (f i)"
|
|
936 |
shows "(\<lambda>i. simple_integral (f i)) \<up> positive_integral u"
|
|
937 |
using positive_integral_isoton[OF `f \<up> u` e(1)[THEN borel_measurable_simple_function]]
|
|
938 |
unfolding positive_integral_eq_simple_integral[OF e] .
|
|
939 |
|
|
940 |
lemma (in measure_space) positive_integral_linear:
|
|
941 |
assumes f: "f \<in> borel_measurable M"
|
|
942 |
and g: "g \<in> borel_measurable M"
|
|
943 |
shows "positive_integral (\<lambda>x. a * f x + g x) =
|
|
944 |
a * positive_integral f + positive_integral g"
|
|
945 |
(is "positive_integral ?L = _")
|
35582
|
946 |
proof -
|
38656
|
947 |
from borel_measurable_implies_simple_function_sequence'[OF f] guess u .
|
|
948 |
note u = this positive_integral_isoton_simple[OF this(1-2)]
|
|
949 |
from borel_measurable_implies_simple_function_sequence'[OF g] guess v .
|
|
950 |
note v = this positive_integral_isoton_simple[OF this(1-2)]
|
|
951 |
let "?L' i x" = "a * u i x + v i x"
|
|
952 |
|
|
953 |
have "?L \<in> borel_measurable M"
|
|
954 |
using assms by simp
|
|
955 |
from borel_measurable_implies_simple_function_sequence'[OF this] guess l .
|
|
956 |
note positive_integral_isoton_simple[OF this(1-2)] and l = this
|
|
957 |
moreover have
|
|
958 |
"(SUP i. simple_integral (l i)) = (SUP i. simple_integral (?L' i))"
|
|
959 |
proof (rule SUP_simple_integral_sequences[OF l(1-2)])
|
|
960 |
show "?L' \<up> ?L" "\<And>i. simple_function (?L' i)"
|
|
961 |
using u v by (auto simp: isoton_fun_expand isoton_add isoton_cmult_right)
|
|
962 |
qed
|
|
963 |
moreover from u v have L'_isoton:
|
|
964 |
"(\<lambda>i. simple_integral (?L' i)) \<up> a * positive_integral f + positive_integral g"
|
|
965 |
by (simp add: isoton_add isoton_cmult_right)
|
|
966 |
ultimately show ?thesis by (simp add: isoton_def)
|
|
967 |
qed
|
|
968 |
|
|
969 |
lemma (in measure_space) positive_integral_cmult:
|
|
970 |
assumes "f \<in> borel_measurable M"
|
|
971 |
shows "positive_integral (\<lambda>x. c * f x) = c * positive_integral f"
|
|
972 |
using positive_integral_linear[OF assms, of "\<lambda>x. 0" c] by auto
|
|
973 |
|
|
974 |
lemma (in measure_space) positive_integral_indicator[simp]:
|
|
975 |
"A \<in> sets M \<Longrightarrow> positive_integral (\<lambda>x. indicator A x) = \<mu> A"
|
|
976 |
by (subst positive_integral_eq_simple_integral) (auto simp: simple_function_indicator simple_integral_indicator)
|
|
977 |
|
|
978 |
lemma (in measure_space) positive_integral_cmult_indicator:
|
|
979 |
"A \<in> sets M \<Longrightarrow> positive_integral (\<lambda>x. c * indicator A x) = c * \<mu> A"
|
|
980 |
by (subst positive_integral_eq_simple_integral) (auto simp: simple_function_indicator simple_integral_indicator)
|
|
981 |
|
|
982 |
lemma (in measure_space) positive_integral_add:
|
|
983 |
assumes "f \<in> borel_measurable M" "g \<in> borel_measurable M"
|
|
984 |
shows "positive_integral (\<lambda>x. f x + g x) = positive_integral f + positive_integral g"
|
|
985 |
using positive_integral_linear[OF assms, of 1] by simp
|
|
986 |
|
|
987 |
lemma (in measure_space) positive_integral_setsum:
|
|
988 |
assumes "\<And>i. i\<in>P \<Longrightarrow> f i \<in> borel_measurable M"
|
|
989 |
shows "positive_integral (\<lambda>x. \<Sum>i\<in>P. f i x) = (\<Sum>i\<in>P. positive_integral (f i))"
|
|
990 |
proof cases
|
|
991 |
assume "finite P"
|
|
992 |
from this assms show ?thesis
|
|
993 |
proof induct
|
|
994 |
case (insert i P)
|
|
995 |
have "f i \<in> borel_measurable M"
|
|
996 |
"(\<lambda>x. \<Sum>i\<in>P. f i x) \<in> borel_measurable M"
|
|
997 |
using insert by (auto intro!: borel_measurable_pinfreal_setsum)
|
|
998 |
from positive_integral_add[OF this]
|
|
999 |
show ?case using insert by auto
|
|
1000 |
qed simp
|
|
1001 |
qed simp
|
|
1002 |
|
|
1003 |
lemma (in measure_space) positive_integral_diff:
|
|
1004 |
assumes f: "f \<in> borel_measurable M" and g: "g \<in> borel_measurable M"
|
|
1005 |
and fin: "positive_integral g \<noteq> \<omega>"
|
|
1006 |
and mono: "\<And>x. x \<in> space M \<Longrightarrow> g x \<le> f x"
|
|
1007 |
shows "positive_integral (\<lambda>x. f x - g x) = positive_integral f - positive_integral g"
|
|
1008 |
proof -
|
|
1009 |
have borel: "(\<lambda>x. f x - g x) \<in> borel_measurable M"
|
|
1010 |
using f g by (rule borel_measurable_pinfreal_diff)
|
|
1011 |
have "positive_integral (\<lambda>x. f x - g x) + positive_integral g =
|
|
1012 |
positive_integral f"
|
|
1013 |
unfolding positive_integral_add[OF borel g, symmetric]
|
|
1014 |
proof (rule positive_integral_cong)
|
|
1015 |
fix x assume "x \<in> space M"
|
|
1016 |
from mono[OF this] show "f x - g x + g x = f x"
|
|
1017 |
by (cases "f x", cases "g x", simp, simp, cases "g x", auto)
|
|
1018 |
qed
|
|
1019 |
with mono show ?thesis
|
|
1020 |
by (subst minus_pinfreal_eq2[OF _ fin]) (auto intro!: positive_integral_mono)
|
|
1021 |
qed
|
|
1022 |
|
|
1023 |
lemma (in measure_space) positive_integral_psuminf:
|
|
1024 |
assumes "\<And>i. f i \<in> borel_measurable M"
|
|
1025 |
shows "positive_integral (\<lambda>x. \<Sum>\<^isub>\<infinity> i. f i x) = (\<Sum>\<^isub>\<infinity> i. positive_integral (f i))"
|
|
1026 |
proof -
|
|
1027 |
have "(\<lambda>i. positive_integral (\<lambda>x. \<Sum>i<i. f i x)) \<up> positive_integral (\<lambda>x. \<Sum>\<^isub>\<infinity>i. f i x)"
|
|
1028 |
by (rule positive_integral_isoton)
|
|
1029 |
(auto intro!: borel_measurable_pinfreal_setsum assms positive_integral_mono
|
|
1030 |
arg_cong[where f=Sup]
|
|
1031 |
simp: isoton_def le_fun_def psuminf_def expand_fun_eq SUPR_def Sup_fun_def)
|
|
1032 |
thus ?thesis
|
|
1033 |
by (auto simp: isoton_def psuminf_def positive_integral_setsum[OF assms])
|
|
1034 |
qed
|
|
1035 |
|
|
1036 |
text {* Fatou's lemma: convergence theorem on limes inferior *}
|
|
1037 |
lemma (in measure_space) positive_integral_lim_INF:
|
|
1038 |
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> pinfreal"
|
|
1039 |
assumes "\<And>i. u i \<in> borel_measurable M"
|
|
1040 |
shows "positive_integral (SUP n. INF m. u (m + n)) \<le>
|
|
1041 |
(SUP n. INF m. positive_integral (u (m + n)))"
|
|
1042 |
proof -
|
|
1043 |
have "(SUP n. INF m. u (m + n)) \<in> borel_measurable M"
|
|
1044 |
by (auto intro!: borel_measurable_SUP borel_measurable_INF assms)
|
|
1045 |
|
|
1046 |
have "(\<lambda>n. INF m. u (m + n)) \<up> (SUP n. INF m. u (m + n))"
|
38705
|
1047 |
proof (unfold isoton_def, safe intro!: INF_mono bexI)
|
|
1048 |
fix i m show "u (Suc m + i) \<le> u (m + Suc i)" by simp
|
|
1049 |
qed simp
|
38656
|
1050 |
from positive_integral_isoton[OF this] assms
|
|
1051 |
have "positive_integral (SUP n. INF m. u (m + n)) =
|
|
1052 |
(SUP n. positive_integral (INF m. u (m + n)))"
|
|
1053 |
unfolding isoton_def by (simp add: borel_measurable_INF)
|
|
1054 |
also have "\<dots> \<le> (SUP n. INF m. positive_integral (u (m + n)))"
|
38705
|
1055 |
apply (rule SUP_mono)
|
|
1056 |
apply (rule_tac x=n in bexI)
|
|
1057 |
by (auto intro!: positive_integral_mono INFI_bound INF_leI exI simp: INFI_fun_expand)
|
38656
|
1058 |
finally show ?thesis .
|
35582
|
1059 |
qed
|
|
1060 |
|
38656
|
1061 |
lemma (in measure_space) measure_space_density:
|
|
1062 |
assumes borel: "u \<in> borel_measurable M"
|
|
1063 |
shows "measure_space M (\<lambda>A. positive_integral (\<lambda>x. u x * indicator A x))" (is "measure_space M ?v")
|
|
1064 |
proof
|
|
1065 |
show "?v {} = 0" by simp
|
|
1066 |
show "countably_additive M ?v"
|
|
1067 |
unfolding countably_additive_def
|
|
1068 |
proof safe
|
|
1069 |
fix A :: "nat \<Rightarrow> 'a set"
|
|
1070 |
assume "range A \<subseteq> sets M"
|
|
1071 |
hence "\<And>i. (\<lambda>x. u x * indicator (A i) x) \<in> borel_measurable M"
|
|
1072 |
using borel by (auto intro: borel_measurable_indicator)
|
|
1073 |
moreover assume "disjoint_family A"
|
|
1074 |
note psuminf_indicator[OF this]
|
|
1075 |
ultimately show "(\<Sum>\<^isub>\<infinity>n. ?v (A n)) = ?v (\<Union>x. A x)"
|
|
1076 |
by (simp add: positive_integral_psuminf[symmetric])
|
|
1077 |
qed
|
|
1078 |
qed
|
35582
|
1079 |
|
38656
|
1080 |
lemma (in measure_space) positive_integral_null_set:
|
|
1081 |
assumes borel: "u \<in> borel_measurable M" and "N \<in> null_sets"
|
|
1082 |
shows "positive_integral (\<lambda>x. u x * indicator N x) = 0" (is "?I = 0")
|
|
1083 |
proof -
|
|
1084 |
have "N \<in> sets M" using `N \<in> null_sets` by auto
|
|
1085 |
have "(\<lambda>i x. min (of_nat i) (u x) * indicator N x) \<up> (\<lambda>x. u x * indicator N x)"
|
|
1086 |
unfolding isoton_fun_expand
|
|
1087 |
proof (safe intro!: isoton_cmult_left, unfold isoton_def, safe)
|
|
1088 |
fix j i show "min (of_nat j) (u i) \<le> min (of_nat (Suc j)) (u i)"
|
|
1089 |
by (rule min_max.inf_mono) auto
|
|
1090 |
next
|
|
1091 |
fix i show "(SUP j. min (of_nat j) (u i)) = u i"
|
|
1092 |
proof (cases "u i")
|
|
1093 |
case infinite
|
|
1094 |
moreover hence "\<And>j. min (of_nat j) (u i) = of_nat j"
|
|
1095 |
by (auto simp: min_def)
|
|
1096 |
ultimately show ?thesis by (simp add: Sup_\<omega>)
|
35582
|
1097 |
next
|
38656
|
1098 |
case (preal r)
|
|
1099 |
obtain j where "r \<le> of_nat j" using ex_le_of_nat ..
|
|
1100 |
hence "u i \<le> of_nat j" using preal by (auto simp: real_of_nat_def)
|
|
1101 |
show ?thesis
|
|
1102 |
proof (rule pinfreal_SUPI)
|
|
1103 |
fix y assume "\<And>j. j \<in> UNIV \<Longrightarrow> min (of_nat j) (u i) \<le> y"
|
|
1104 |
note this[of j]
|
|
1105 |
moreover have "min (of_nat j) (u i) = u i"
|
|
1106 |
using `u i \<le> of_nat j` by (auto simp: min_def)
|
|
1107 |
ultimately show "u i \<le> y" by simp
|
35582
|
1108 |
qed simp
|
|
1109 |
qed
|
|
1110 |
qed
|
38656
|
1111 |
from positive_integral_isoton[OF this]
|
|
1112 |
have "?I = (SUP i. positive_integral (\<lambda>x. min (of_nat i) (u x) * indicator N x))"
|
|
1113 |
unfolding isoton_def using borel `N \<in> sets M` by (simp add: borel_measurable_indicator)
|
|
1114 |
also have "\<dots> \<le> (SUP i. positive_integral (\<lambda>x. of_nat i * indicator N x))"
|
38705
|
1115 |
proof (rule SUP_mono, rule bexI, rule positive_integral_mono)
|
38656
|
1116 |
fix x i show "min (of_nat i) (u x) * indicator N x \<le> of_nat i * indicator N x"
|
|
1117 |
by (cases "x \<in> N") auto
|
38705
|
1118 |
qed simp
|
38656
|
1119 |
also have "\<dots> = 0"
|
|
1120 |
using `N \<in> null_sets` by (simp add: positive_integral_cmult_indicator)
|
|
1121 |
finally show ?thesis by simp
|
|
1122 |
qed
|
35582
|
1123 |
|
38656
|
1124 |
lemma (in measure_space) positive_integral_Markov_inequality:
|
|
1125 |
assumes borel: "u \<in> borel_measurable M" and "A \<in> sets M" and c: "c \<noteq> \<omega>"
|
|
1126 |
shows "\<mu> ({x\<in>space M. 1 \<le> c * u x} \<inter> A) \<le> c * positive_integral (\<lambda>x. u x * indicator A x)"
|
|
1127 |
(is "\<mu> ?A \<le> _ * ?PI")
|
|
1128 |
proof -
|
|
1129 |
have "?A \<in> sets M"
|
|
1130 |
using `A \<in> sets M` borel by auto
|
|
1131 |
hence "\<mu> ?A = positive_integral (\<lambda>x. indicator ?A x)"
|
|
1132 |
using positive_integral_indicator by simp
|
|
1133 |
also have "\<dots> \<le> positive_integral (\<lambda>x. c * (u x * indicator A x))"
|
|
1134 |
proof (rule positive_integral_mono)
|
|
1135 |
fix x assume "x \<in> space M"
|
|
1136 |
show "indicator ?A x \<le> c * (u x * indicator A x)"
|
|
1137 |
by (cases "x \<in> ?A") auto
|
|
1138 |
qed
|
|
1139 |
also have "\<dots> = c * positive_integral (\<lambda>x. u x * indicator A x)"
|
|
1140 |
using assms
|
|
1141 |
by (auto intro!: positive_integral_cmult borel_measurable_indicator)
|
|
1142 |
finally show ?thesis .
|
35582
|
1143 |
qed
|
|
1144 |
|
38656
|
1145 |
lemma (in measure_space) positive_integral_0_iff:
|
|
1146 |
assumes borel: "u \<in> borel_measurable M"
|
|
1147 |
shows "positive_integral u = 0 \<longleftrightarrow> \<mu> {x\<in>space M. u x \<noteq> 0} = 0"
|
|
1148 |
(is "_ \<longleftrightarrow> \<mu> ?A = 0")
|
35582
|
1149 |
proof -
|
38656
|
1150 |
have A: "?A \<in> sets M" using borel by auto
|
|
1151 |
have u: "positive_integral (\<lambda>x. u x * indicator ?A x) = positive_integral u"
|
|
1152 |
by (auto intro!: positive_integral_cong simp: indicator_def)
|
35582
|
1153 |
|
38656
|
1154 |
show ?thesis
|
|
1155 |
proof
|
|
1156 |
assume "\<mu> ?A = 0"
|
|
1157 |
hence "?A \<in> null_sets" using `?A \<in> sets M` by auto
|
|
1158 |
from positive_integral_null_set[OF borel this]
|
|
1159 |
have "0 = positive_integral (\<lambda>x. u x * indicator ?A x)" by simp
|
|
1160 |
thus "positive_integral u = 0" unfolding u by simp
|
|
1161 |
next
|
|
1162 |
assume *: "positive_integral u = 0"
|
|
1163 |
let "?M n" = "{x \<in> space M. 1 \<le> of_nat n * u x}"
|
|
1164 |
have "0 = (SUP n. \<mu> (?M n \<inter> ?A))"
|
|
1165 |
proof -
|
|
1166 |
{ fix n
|
|
1167 |
from positive_integral_Markov_inequality[OF borel `?A \<in> sets M`, of "of_nat n"]
|
|
1168 |
have "\<mu> (?M n \<inter> ?A) = 0" unfolding * u by simp }
|
|
1169 |
thus ?thesis by simp
|
35582
|
1170 |
qed
|
38656
|
1171 |
also have "\<dots> = \<mu> (\<Union>n. ?M n \<inter> ?A)"
|
|
1172 |
proof (safe intro!: continuity_from_below)
|
|
1173 |
fix n show "?M n \<inter> ?A \<in> sets M"
|
|
1174 |
using borel by (auto intro!: Int)
|
|
1175 |
next
|
|
1176 |
fix n x assume "1 \<le> of_nat n * u x"
|
|
1177 |
also have "\<dots> \<le> of_nat (Suc n) * u x"
|
|
1178 |
by (subst (1 2) mult_commute) (auto intro!: pinfreal_mult_cancel)
|
|
1179 |
finally show "1 \<le> of_nat (Suc n) * u x" .
|
|
1180 |
qed
|
|
1181 |
also have "\<dots> = \<mu> ?A"
|
|
1182 |
proof (safe intro!: arg_cong[where f="\<mu>"])
|
|
1183 |
fix x assume "u x \<noteq> 0" and [simp, intro]: "x \<in> space M"
|
|
1184 |
show "x \<in> (\<Union>n. ?M n \<inter> ?A)"
|
|
1185 |
proof (cases "u x")
|
|
1186 |
case (preal r)
|
|
1187 |
obtain j where "1 / r \<le> of_nat j" using ex_le_of_nat ..
|
|
1188 |
hence "1 / r * r \<le> of_nat j * r" using preal unfolding mult_le_cancel_right by auto
|
|
1189 |
hence "1 \<le> of_nat j * r" using preal `u x \<noteq> 0` by auto
|
|
1190 |
thus ?thesis using `u x \<noteq> 0` preal by (auto simp: real_of_nat_def[symmetric])
|
|
1191 |
qed auto
|
|
1192 |
qed
|
|
1193 |
finally show "\<mu> ?A = 0" by simp
|
35582
|
1194 |
qed
|
|
1195 |
qed
|
|
1196 |
|
38656
|
1197 |
lemma (in measure_space) positive_integral_cong_on_null_sets:
|
|
1198 |
assumes f: "f \<in> borel_measurable M" and g: "g \<in> borel_measurable M"
|
|
1199 |
and measure: "\<mu> {x\<in>space M. f x \<noteq> g x} = 0"
|
|
1200 |
shows "positive_integral f = positive_integral g"
|
35582
|
1201 |
proof -
|
38656
|
1202 |
let ?N = "{x\<in>space M. f x \<noteq> g x}" and ?E = "{x\<in>space M. f x = g x}"
|
|
1203 |
let "?A h x" = "h x * indicator ?E x :: pinfreal"
|
|
1204 |
let "?B h x" = "h x * indicator ?N x :: pinfreal"
|
|
1205 |
|
|
1206 |
have A: "positive_integral (?A f) = positive_integral (?A g)"
|
|
1207 |
by (auto intro!: positive_integral_cong simp: indicator_def)
|
|
1208 |
|
|
1209 |
have [intro]: "?N \<in> sets M" "?E \<in> sets M" using f g by auto
|
|
1210 |
hence "?N \<in> null_sets" using measure by auto
|
|
1211 |
hence B: "positive_integral (?B f) = positive_integral (?B g)"
|
|
1212 |
using f g by (simp add: positive_integral_null_set)
|
|
1213 |
|
|
1214 |
have "positive_integral f = positive_integral (\<lambda>x. ?A f x + ?B f x)"
|
|
1215 |
by (auto intro!: positive_integral_cong simp: indicator_def)
|
|
1216 |
also have "\<dots> = positive_integral (?A f) + positive_integral (?B f)"
|
|
1217 |
using f g by (auto intro!: positive_integral_add borel_measurable_indicator)
|
|
1218 |
also have "\<dots> = positive_integral (\<lambda>x. ?A g x + ?B g x)"
|
|
1219 |
unfolding A B using f g by (auto intro!: positive_integral_add[symmetric] borel_measurable_indicator)
|
|
1220 |
also have "\<dots> = positive_integral g"
|
|
1221 |
by (auto intro!: positive_integral_cong simp: indicator_def)
|
|
1222 |
finally show ?thesis by simp
|
35582
|
1223 |
qed
|
|
1224 |
|
35692
|
1225 |
section "Lebesgue Integral"
|
|
1226 |
|
38656
|
1227 |
definition (in measure_space) integrable where
|
|
1228 |
"integrable f \<longleftrightarrow> f \<in> borel_measurable M \<and>
|
|
1229 |
positive_integral (\<lambda>x. Real (f x)) \<noteq> \<omega> \<and>
|
|
1230 |
positive_integral (\<lambda>x. Real (- f x)) \<noteq> \<omega>"
|
35692
|
1231 |
|
38656
|
1232 |
lemma (in measure_space) integrableD[dest]:
|
|
1233 |
assumes "integrable f"
|
|
1234 |
shows "f \<in> borel_measurable M"
|
|
1235 |
"positive_integral (\<lambda>x. Real (f x)) \<noteq> \<omega>"
|
|
1236 |
"positive_integral (\<lambda>x. Real (- f x)) \<noteq> \<omega>"
|
|
1237 |
using assms unfolding integrable_def by auto
|
35692
|
1238 |
|
38656
|
1239 |
definition (in measure_space) integral where
|
|
1240 |
"integral f =
|
|
1241 |
real (positive_integral (\<lambda>x. Real (f x))) -
|
|
1242 |
real (positive_integral (\<lambda>x. Real (- f x)))"
|
|
1243 |
|
|
1244 |
lemma (in measure_space) integral_cong:
|
35582
|
1245 |
assumes cong: "\<And>x. x \<in> space M \<Longrightarrow> f x = g x"
|
|
1246 |
shows "integral f = integral g"
|
38656
|
1247 |
using assms by (simp cong: positive_integral_cong add: integral_def)
|
35582
|
1248 |
|
38656
|
1249 |
lemma (in measure_space) integrable_cong:
|
|
1250 |
"(\<And>x. x \<in> space M \<Longrightarrow> f x = g x) \<Longrightarrow> integrable f \<longleftrightarrow> integrable g"
|
|
1251 |
by (simp cong: positive_integral_cong measurable_cong add: integrable_def)
|
|
1252 |
|
|
1253 |
lemma (in measure_space) integral_eq_positive_integral:
|
|
1254 |
assumes "\<And>x. 0 \<le> f x"
|
|
1255 |
shows "integral f = real (positive_integral (\<lambda>x. Real (f x)))"
|
35582
|
1256 |
proof -
|
38656
|
1257 |
have "\<And>x. Real (- f x) = 0" using assms by simp
|
|
1258 |
thus ?thesis by (simp del: Real_eq_0 add: integral_def)
|
35582
|
1259 |
qed
|
|
1260 |
|
38656
|
1261 |
lemma (in measure_space) integral_minus[intro, simp]:
|
|
1262 |
assumes "integrable f"
|
|
1263 |
shows "integrable (\<lambda>x. - f x)" "integral (\<lambda>x. - f x) = - integral f"
|
|
1264 |
using assms by (auto simp: integrable_def integral_def)
|
|
1265 |
|
|
1266 |
lemma (in measure_space) integral_of_positive_diff:
|
|
1267 |
assumes integrable: "integrable u" "integrable v"
|
|
1268 |
and f_def: "\<And>x. f x = u x - v x" and pos: "\<And>x. 0 \<le> u x" "\<And>x. 0 \<le> v x"
|
|
1269 |
shows "integrable f" and "integral f = integral u - integral v"
|
35582
|
1270 |
proof -
|
38656
|
1271 |
let ?PI = positive_integral
|
|
1272 |
let "?f x" = "Real (f x)"
|
|
1273 |
let "?mf x" = "Real (- f x)"
|
|
1274 |
let "?u x" = "Real (u x)"
|
|
1275 |
let "?v x" = "Real (v x)"
|
|
1276 |
|
|
1277 |
from borel_measurable_diff[of u v] integrable
|
|
1278 |
have f_borel: "?f \<in> borel_measurable M" and
|
|
1279 |
mf_borel: "?mf \<in> borel_measurable M" and
|
|
1280 |
v_borel: "?v \<in> borel_measurable M" and
|
|
1281 |
u_borel: "?u \<in> borel_measurable M" and
|
|
1282 |
"f \<in> borel_measurable M"
|
|
1283 |
by (auto simp: f_def[symmetric] integrable_def)
|
35582
|
1284 |
|
38656
|
1285 |
have "?PI (\<lambda>x. Real (u x - v x)) \<le> ?PI ?u"
|
|
1286 |
using pos by (auto intro!: positive_integral_mono)
|
|
1287 |
moreover have "?PI (\<lambda>x. Real (v x - u x)) \<le> ?PI ?v"
|
|
1288 |
using pos by (auto intro!: positive_integral_mono)
|
|
1289 |
ultimately show f: "integrable f"
|
|
1290 |
using `integrable u` `integrable v` `f \<in> borel_measurable M`
|
|
1291 |
by (auto simp: integrable_def f_def)
|
|
1292 |
hence mf: "integrable (\<lambda>x. - f x)" ..
|
|
1293 |
|
|
1294 |
have *: "\<And>x. Real (- v x) = 0" "\<And>x. Real (- u x) = 0"
|
|
1295 |
using pos by auto
|
35582
|
1296 |
|
38656
|
1297 |
have "\<And>x. ?u x + ?mf x = ?v x + ?f x"
|
|
1298 |
unfolding f_def using pos by simp
|
|
1299 |
hence "?PI (\<lambda>x. ?u x + ?mf x) = ?PI (\<lambda>x. ?v x + ?f x)" by simp
|
|
1300 |
hence "real (?PI ?u + ?PI ?mf) = real (?PI ?v + ?PI ?f)"
|
|
1301 |
using positive_integral_add[OF u_borel mf_borel]
|
|
1302 |
using positive_integral_add[OF v_borel f_borel]
|
|
1303 |
by auto
|
|
1304 |
then show "integral f = integral u - integral v"
|
|
1305 |
using f mf `integrable u` `integrable v`
|
|
1306 |
unfolding integral_def integrable_def *
|
|
1307 |
by (cases "?PI ?f", cases "?PI ?mf", cases "?PI ?v", cases "?PI ?u")
|
|
1308 |
(auto simp add: field_simps)
|
35582
|
1309 |
qed
|
|
1310 |
|
38656
|
1311 |
lemma (in measure_space) integral_linear:
|
|
1312 |
assumes "integrable f" "integrable g" and "0 \<le> a"
|
|
1313 |
shows "integrable (\<lambda>t. a * f t + g t)"
|
|
1314 |
and "integral (\<lambda>t. a * f t + g t) = a * integral f + integral g"
|
|
1315 |
proof -
|
|
1316 |
let ?PI = positive_integral
|
|
1317 |
let "?f x" = "Real (f x)"
|
|
1318 |
let "?g x" = "Real (g x)"
|
|
1319 |
let "?mf x" = "Real (- f x)"
|
|
1320 |
let "?mg x" = "Real (- g x)"
|
|
1321 |
let "?p t" = "max 0 (a * f t) + max 0 (g t)"
|
|
1322 |
let "?n t" = "max 0 (- (a * f t)) + max 0 (- g t)"
|
|
1323 |
|
|
1324 |
have pos: "?f \<in> borel_measurable M" "?g \<in> borel_measurable M"
|
|
1325 |
and neg: "?mf \<in> borel_measurable M" "?mg \<in> borel_measurable M"
|
|
1326 |
and p: "?p \<in> borel_measurable M"
|
|
1327 |
and n: "?n \<in> borel_measurable M"
|
|
1328 |
using assms by (simp_all add: integrable_def)
|
35582
|
1329 |
|
38656
|
1330 |
have *: "\<And>x. Real (?p x) = Real a * ?f x + ?g x"
|
|
1331 |
"\<And>x. Real (?n x) = Real a * ?mf x + ?mg x"
|
|
1332 |
"\<And>x. Real (- ?p x) = 0"
|
|
1333 |
"\<And>x. Real (- ?n x) = 0"
|
|
1334 |
using `0 \<le> a` by (auto simp: max_def min_def zero_le_mult_iff mult_le_0_iff add_nonpos_nonpos)
|
|
1335 |
|
|
1336 |
note linear =
|
|
1337 |
positive_integral_linear[OF pos]
|
|
1338 |
positive_integral_linear[OF neg]
|
35582
|
1339 |
|
38656
|
1340 |
have "integrable ?p" "integrable ?n"
|
|
1341 |
"\<And>t. a * f t + g t = ?p t - ?n t" "\<And>t. 0 \<le> ?p t" "\<And>t. 0 \<le> ?n t"
|
|
1342 |
using assms p n unfolding integrable_def * linear by auto
|
|
1343 |
note diff = integral_of_positive_diff[OF this]
|
|
1344 |
|
|
1345 |
show "integrable (\<lambda>t. a * f t + g t)" by (rule diff)
|
|
1346 |
|
|
1347 |
from assms show "integral (\<lambda>t. a * f t + g t) = a * integral f + integral g"
|
|
1348 |
unfolding diff(2) unfolding integral_def * linear integrable_def
|
|
1349 |
by (cases "?PI ?f", cases "?PI ?mf", cases "?PI ?g", cases "?PI ?mg")
|
|
1350 |
(auto simp add: field_simps zero_le_mult_iff)
|
|
1351 |
qed
|
|
1352 |
|
|
1353 |
lemma (in measure_space) integral_add[simp, intro]:
|
|
1354 |
assumes "integrable f" "integrable g"
|
35582
|
1355 |
shows "integrable (\<lambda>t. f t + g t)"
|
|
1356 |
and "integral (\<lambda>t. f t + g t) = integral f + integral g"
|
38656
|
1357 |
using assms integral_linear[where a=1] by auto
|
|
1358 |
|
|
1359 |
lemma (in measure_space) integral_zero[simp, intro]:
|
|
1360 |
shows "integrable (\<lambda>x. 0)"
|
|
1361 |
and "integral (\<lambda>x. 0) = 0"
|
|
1362 |
unfolding integrable_def integral_def
|
|
1363 |
by (auto simp add: borel_measurable_const)
|
35582
|
1364 |
|
38656
|
1365 |
lemma (in measure_space) integral_cmult[simp, intro]:
|
|
1366 |
assumes "integrable f"
|
|
1367 |
shows "integrable (\<lambda>t. a * f t)" (is ?P)
|
|
1368 |
and "integral (\<lambda>t. a * f t) = a * integral f" (is ?I)
|
|
1369 |
proof -
|
|
1370 |
have "integrable (\<lambda>t. a * f t) \<and> integral (\<lambda>t. a * f t) = a * integral f"
|
|
1371 |
proof (cases rule: le_cases)
|
|
1372 |
assume "0 \<le> a" show ?thesis
|
|
1373 |
using integral_linear[OF assms integral_zero(1) `0 \<le> a`]
|
|
1374 |
by (simp add: integral_zero)
|
|
1375 |
next
|
|
1376 |
assume "a \<le> 0" hence "0 \<le> - a" by auto
|
|
1377 |
have *: "\<And>t. - a * t + 0 = (-a) * t" by simp
|
|
1378 |
show ?thesis using integral_linear[OF assms integral_zero(1) `0 \<le> - a`]
|
|
1379 |
integral_minus(1)[of "\<lambda>t. - a * f t"]
|
|
1380 |
unfolding * integral_zero by simp
|
|
1381 |
qed
|
|
1382 |
thus ?P ?I by auto
|
35582
|
1383 |
qed
|
|
1384 |
|
38656
|
1385 |
lemma (in measure_space) integral_mono:
|
|
1386 |
assumes fg: "integrable f" "integrable g"
|
35582
|
1387 |
and mono: "\<And>t. t \<in> space M \<Longrightarrow> f t \<le> g t"
|
|
1388 |
shows "integral f \<le> integral g"
|
38656
|
1389 |
using fg unfolding integral_def integrable_def diff_minus
|
|
1390 |
proof (safe intro!: add_mono real_of_pinfreal_mono le_imp_neg_le positive_integral_mono)
|
|
1391 |
fix x assume "x \<in> space M" from mono[OF this]
|
|
1392 |
show "Real (f x) \<le> Real (g x)" "Real (- g x) \<le> Real (- f x)" by auto
|
35582
|
1393 |
qed
|
|
1394 |
|
38656
|
1395 |
lemma (in measure_space) integral_diff[simp, intro]:
|
|
1396 |
assumes f: "integrable f" and g: "integrable g"
|
|
1397 |
shows "integrable (\<lambda>t. f t - g t)"
|
|
1398 |
and "integral (\<lambda>t. f t - g t) = integral f - integral g"
|
|
1399 |
using integral_add[OF f integral_minus(1)[OF g]]
|
|
1400 |
unfolding diff_minus integral_minus(2)[OF g]
|
|
1401 |
by auto
|
|
1402 |
|
|
1403 |
lemma (in measure_space) integral_indicator[simp, intro]:
|
|
1404 |
assumes "a \<in> sets M" and "\<mu> a \<noteq> \<omega>"
|
|
1405 |
shows "integral (indicator a) = real (\<mu> a)" (is ?int)
|
|
1406 |
and "integrable (indicator a)" (is ?able)
|
35582
|
1407 |
proof -
|
38656
|
1408 |
have *:
|
|
1409 |
"\<And>A x. Real (indicator A x) = indicator A x"
|
|
1410 |
"\<And>A x. Real (- indicator A x) = 0" unfolding indicator_def by auto
|
|
1411 |
show ?int ?able
|
|
1412 |
using assms unfolding integral_def integrable_def
|
|
1413 |
by (auto simp: * positive_integral_indicator borel_measurable_indicator)
|
35582
|
1414 |
qed
|
|
1415 |
|
38656
|
1416 |
lemma (in measure_space) integral_cmul_indicator:
|
|
1417 |
assumes "A \<in> sets M" and "c \<noteq> 0 \<Longrightarrow> \<mu> A \<noteq> \<omega>"
|
|
1418 |
shows "integrable (\<lambda>x. c * indicator A x)" (is ?P)
|
|
1419 |
and "integral (\<lambda>x. c * indicator A x) = c * real (\<mu> A)" (is ?I)
|
|
1420 |
proof -
|
|
1421 |
show ?P
|
|
1422 |
proof (cases "c = 0")
|
|
1423 |
case False with assms show ?thesis by simp
|
|
1424 |
qed simp
|
35582
|
1425 |
|
38656
|
1426 |
show ?I
|
|
1427 |
proof (cases "c = 0")
|
|
1428 |
case False with assms show ?thesis by simp
|
|
1429 |
qed simp
|
|
1430 |
qed
|
35582
|
1431 |
|
38656
|
1432 |
lemma (in measure_space) integral_setsum[simp, intro]:
|
35582
|
1433 |
assumes "\<And>n. n \<in> S \<Longrightarrow> integrable (f n)"
|
|
1434 |
shows "integral (\<lambda>x. \<Sum> i \<in> S. f i x) = (\<Sum> i \<in> S. integral (f i))" (is "?int S")
|
38656
|
1435 |
and "integrable (\<lambda>x. \<Sum> i \<in> S. f i x)" (is "?I S")
|
35582
|
1436 |
proof -
|
38656
|
1437 |
have "?int S \<and> ?I S"
|
|
1438 |
proof (cases "finite S")
|
|
1439 |
assume "finite S"
|
|
1440 |
from this assms show ?thesis by (induct S) simp_all
|
|
1441 |
qed simp
|
35582
|
1442 |
thus "?int S" and "?I S" by auto
|
|
1443 |
qed
|
|
1444 |
|
36624
|
1445 |
lemma (in measure_space) integrable_abs:
|
|
1446 |
assumes "integrable f"
|
|
1447 |
shows "integrable (\<lambda> x. \<bar>f x\<bar>)"
|
|
1448 |
proof -
|
38656
|
1449 |
have *:
|
|
1450 |
"\<And>x. Real \<bar>f x\<bar> = Real (f x) + Real (- f x)"
|
|
1451 |
"\<And>x. Real (- \<bar>f x\<bar>) = 0" by auto
|
|
1452 |
have abs: "(\<lambda>x. \<bar>f x\<bar>) \<in> borel_measurable M" and
|
|
1453 |
f: "(\<lambda>x. Real (f x)) \<in> borel_measurable M"
|
|
1454 |
"(\<lambda>x. Real (- f x)) \<in> borel_measurable M"
|
|
1455 |
using assms unfolding integrable_def by auto
|
|
1456 |
from abs assms show ?thesis unfolding integrable_def *
|
|
1457 |
using positive_integral_linear[OF f, of 1] by simp
|
|
1458 |
qed
|
|
1459 |
|
|
1460 |
lemma (in measure_space) integrable_bound:
|
|
1461 |
assumes "integrable f"
|
|
1462 |
and f: "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x"
|
|
1463 |
"\<And>x. x \<in> space M \<Longrightarrow> \<bar>g x\<bar> \<le> f x"
|
|
1464 |
assumes borel: "g \<in> borel_measurable M"
|
|
1465 |
shows "integrable g"
|
|
1466 |
proof -
|
|
1467 |
have "positive_integral (\<lambda>x. Real (g x)) \<le> positive_integral (\<lambda>x. Real \<bar>g x\<bar>)"
|
|
1468 |
by (auto intro!: positive_integral_mono)
|
|
1469 |
also have "\<dots> \<le> positive_integral (\<lambda>x. Real (f x))"
|
|
1470 |
using f by (auto intro!: positive_integral_mono)
|
|
1471 |
also have "\<dots> < \<omega>"
|
|
1472 |
using `integrable f` unfolding integrable_def by (auto simp: pinfreal_less_\<omega>)
|
|
1473 |
finally have pos: "positive_integral (\<lambda>x. Real (g x)) < \<omega>" .
|
|
1474 |
|
|
1475 |
have "positive_integral (\<lambda>x. Real (- g x)) \<le> positive_integral (\<lambda>x. Real (\<bar>g x\<bar>))"
|
|
1476 |
by (auto intro!: positive_integral_mono)
|
|
1477 |
also have "\<dots> \<le> positive_integral (\<lambda>x. Real (f x))"
|
|
1478 |
using f by (auto intro!: positive_integral_mono)
|
|
1479 |
also have "\<dots> < \<omega>"
|
|
1480 |
using `integrable f` unfolding integrable_def by (auto simp: pinfreal_less_\<omega>)
|
|
1481 |
finally have neg: "positive_integral (\<lambda>x. Real (- g x)) < \<omega>" .
|
|
1482 |
|
|
1483 |
from neg pos borel show ?thesis
|
36624
|
1484 |
unfolding integrable_def by auto
|
38656
|
1485 |
qed
|
|
1486 |
|
|
1487 |
lemma (in measure_space) integrable_abs_iff:
|
|
1488 |
"f \<in> borel_measurable M \<Longrightarrow> integrable (\<lambda> x. \<bar>f x\<bar>) \<longleftrightarrow> integrable f"
|
|
1489 |
by (auto intro!: integrable_bound[where g=f] integrable_abs)
|
|
1490 |
|
|
1491 |
lemma (in measure_space) integrable_max:
|
|
1492 |
assumes int: "integrable f" "integrable g"
|
|
1493 |
shows "integrable (\<lambda> x. max (f x) (g x))"
|
|
1494 |
proof (rule integrable_bound)
|
|
1495 |
show "integrable (\<lambda>x. \<bar>f x\<bar> + \<bar>g x\<bar>)"
|
|
1496 |
using int by (simp add: integrable_abs)
|
|
1497 |
show "(\<lambda>x. max (f x) (g x)) \<in> borel_measurable M"
|
|
1498 |
using int unfolding integrable_def by auto
|
|
1499 |
next
|
|
1500 |
fix x assume "x \<in> space M"
|
|
1501 |
show "0 \<le> \<bar>f x\<bar> + \<bar>g x\<bar>" "\<bar>max (f x) (g x)\<bar> \<le> \<bar>f x\<bar> + \<bar>g x\<bar>"
|
|
1502 |
by auto
|
|
1503 |
qed
|
|
1504 |
|
|
1505 |
lemma (in measure_space) integrable_min:
|
|
1506 |
assumes int: "integrable f" "integrable g"
|
|
1507 |
shows "integrable (\<lambda> x. min (f x) (g x))"
|
|
1508 |
proof (rule integrable_bound)
|
|
1509 |
show "integrable (\<lambda>x. \<bar>f x\<bar> + \<bar>g x\<bar>)"
|
|
1510 |
using int by (simp add: integrable_abs)
|
|
1511 |
show "(\<lambda>x. min (f x) (g x)) \<in> borel_measurable M"
|
|
1512 |
using int unfolding integrable_def by auto
|
|
1513 |
next
|
|
1514 |
fix x assume "x \<in> space M"
|
|
1515 |
show "0 \<le> \<bar>f x\<bar> + \<bar>g x\<bar>" "\<bar>min (f x) (g x)\<bar> \<le> \<bar>f x\<bar> + \<bar>g x\<bar>"
|
|
1516 |
by auto
|
|
1517 |
qed
|
|
1518 |
|
|
1519 |
lemma (in measure_space) integral_triangle_inequality:
|
|
1520 |
assumes "integrable f"
|
|
1521 |
shows "\<bar>integral f\<bar> \<le> integral (\<lambda>x. \<bar>f x\<bar>)"
|
|
1522 |
proof -
|
|
1523 |
have "\<bar>integral f\<bar> = max (integral f) (- integral f)" by auto
|
|
1524 |
also have "\<dots> \<le> integral (\<lambda>x. \<bar>f x\<bar>)"
|
|
1525 |
using assms integral_minus(2)[of f, symmetric]
|
|
1526 |
by (auto intro!: integral_mono integrable_abs simp del: integral_minus)
|
|
1527 |
finally show ?thesis .
|
36624
|
1528 |
qed
|
|
1529 |
|
38656
|
1530 |
lemma (in measure_space) integral_positive:
|
|
1531 |
assumes "integrable f" "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x"
|
|
1532 |
shows "0 \<le> integral f"
|
|
1533 |
proof -
|
|
1534 |
have "0 = integral (\<lambda>x. 0)" by (auto simp: integral_zero)
|
|
1535 |
also have "\<dots> \<le> integral f"
|
|
1536 |
using assms by (rule integral_mono[OF integral_zero(1)])
|
|
1537 |
finally show ?thesis .
|
|
1538 |
qed
|
|
1539 |
|
|
1540 |
lemma (in measure_space) integral_monotone_convergence_pos:
|
|
1541 |
assumes i: "\<And>i. integrable (f i)" and mono: "\<And>x. mono (\<lambda>n. f n x)"
|
|
1542 |
and pos: "\<And>x i. 0 \<le> f i x"
|
|
1543 |
and lim: "\<And>x. (\<lambda>i. f i x) ----> u x"
|
|
1544 |
and ilim: "(\<lambda>i. integral (f i)) ----> x"
|
|
1545 |
shows "integrable u"
|
|
1546 |
and "integral u = x"
|
35582
|
1547 |
proof -
|
38656
|
1548 |
{ fix x have "0 \<le> u x"
|
|
1549 |
using mono pos[of 0 x] incseq_le[OF _ lim, of x 0]
|
|
1550 |
by (simp add: mono_def incseq_def) }
|
|
1551 |
note pos_u = this
|
|
1552 |
|
|
1553 |
hence [simp]: "\<And>i x. Real (- f i x) = 0" "\<And>x. Real (- u x) = 0"
|
|
1554 |
using pos by auto
|
|
1555 |
|
|
1556 |
have SUP_F: "\<And>x. (SUP n. Real (f n x)) = Real (u x)"
|
|
1557 |
using mono pos pos_u lim by (rule SUP_eq_LIMSEQ[THEN iffD2])
|
|
1558 |
|
|
1559 |
have borel_f: "\<And>i. (\<lambda>x. Real (f i x)) \<in> borel_measurable M"
|
|
1560 |
using i unfolding integrable_def by auto
|
|
1561 |
hence "(SUP i. (\<lambda>x. Real (f i x))) \<in> borel_measurable M"
|
35582
|
1562 |
by auto
|
38656
|
1563 |
hence borel_u: "u \<in> borel_measurable M"
|
|
1564 |
using pos_u by (auto simp: borel_measurable_Real_eq SUPR_fun_expand SUP_F)
|
|
1565 |
|
|
1566 |
have integral_eq: "\<And>n. positive_integral (\<lambda>x. Real (f n x)) = Real (integral (f n))"
|
|
1567 |
using i unfolding integral_def integrable_def by (auto simp: Real_real)
|
|
1568 |
|
|
1569 |
have pos_integral: "\<And>n. 0 \<le> integral (f n)"
|
|
1570 |
using pos i by (auto simp: integral_positive)
|
|
1571 |
hence "0 \<le> x"
|
|
1572 |
using LIMSEQ_le_const[OF ilim, of 0] by auto
|
|
1573 |
|
|
1574 |
have "(\<lambda>i. positive_integral (\<lambda>x. Real (f i x))) \<up> positive_integral (\<lambda>x. Real (u x))"
|
|
1575 |
proof (rule positive_integral_isoton)
|
|
1576 |
from SUP_F mono pos
|
|
1577 |
show "(\<lambda>i x. Real (f i x)) \<up> (\<lambda>x. Real (u x))"
|
|
1578 |
unfolding isoton_fun_expand by (auto simp: isoton_def mono_def)
|
|
1579 |
qed (rule borel_f)
|
|
1580 |
hence pI: "positive_integral (\<lambda>x. Real (u x)) =
|
|
1581 |
(SUP n. positive_integral (\<lambda>x. Real (f n x)))"
|
|
1582 |
unfolding isoton_def by simp
|
|
1583 |
also have "\<dots> = Real x" unfolding integral_eq
|
|
1584 |
proof (rule SUP_eq_LIMSEQ[THEN iffD2])
|
|
1585 |
show "mono (\<lambda>n. integral (f n))"
|
|
1586 |
using mono i by (auto simp: mono_def intro!: integral_mono)
|
|
1587 |
show "\<And>n. 0 \<le> integral (f n)" using pos_integral .
|
|
1588 |
show "0 \<le> x" using `0 \<le> x` .
|
|
1589 |
show "(\<lambda>n. integral (f n)) ----> x" using ilim .
|
|
1590 |
qed
|
|
1591 |
finally show "integrable u" "integral u = x" using borel_u `0 \<le> x`
|
|
1592 |
unfolding integrable_def integral_def by auto
|
|
1593 |
qed
|
|
1594 |
|
|
1595 |
lemma (in measure_space) integral_monotone_convergence:
|
|
1596 |
assumes f: "\<And>i. integrable (f i)" and "mono f"
|
|
1597 |
and lim: "\<And>x. (\<lambda>i. f i x) ----> u x"
|
|
1598 |
and ilim: "(\<lambda>i. integral (f i)) ----> x"
|
|
1599 |
shows "integrable u"
|
|
1600 |
and "integral u = x"
|
|
1601 |
proof -
|
|
1602 |
have 1: "\<And>i. integrable (\<lambda>x. f i x - f 0 x)"
|
|
1603 |
using f by (auto intro!: integral_diff)
|
|
1604 |
have 2: "\<And>x. mono (\<lambda>n. f n x - f 0 x)" using `mono f`
|
|
1605 |
unfolding mono_def le_fun_def by auto
|
|
1606 |
have 3: "\<And>x n. 0 \<le> f n x - f 0 x" using `mono f`
|
|
1607 |
unfolding mono_def le_fun_def by (auto simp: field_simps)
|
|
1608 |
have 4: "\<And>x. (\<lambda>i. f i x - f 0 x) ----> u x - f 0 x"
|
|
1609 |
using lim by (auto intro!: LIMSEQ_diff)
|
|
1610 |
have 5: "(\<lambda>i. integral (\<lambda>x. f i x - f 0 x)) ----> x - integral (f 0)"
|
|
1611 |
using f ilim by (auto intro!: LIMSEQ_diff simp: integral_diff)
|
|
1612 |
note diff = integral_monotone_convergence_pos[OF 1 2 3 4 5]
|
|
1613 |
have "integrable (\<lambda>x. (u x - f 0 x) + f 0 x)"
|
|
1614 |
using diff(1) f by (rule integral_add(1))
|
|
1615 |
with diff(2) f show "integrable u" "integral u = x"
|
|
1616 |
by (auto simp: integral_diff)
|
|
1617 |
qed
|
|
1618 |
|
|
1619 |
lemma (in measure_space) integral_0_iff:
|
|
1620 |
assumes "integrable f"
|
|
1621 |
shows "integral (\<lambda>x. \<bar>f x\<bar>) = 0 \<longleftrightarrow> \<mu> {x\<in>space M. f x \<noteq> 0} = 0"
|
|
1622 |
proof -
|
|
1623 |
have *: "\<And>x. Real (- \<bar>f x\<bar>) = 0" by auto
|
|
1624 |
have "integrable (\<lambda>x. \<bar>f x\<bar>)" using assms by (rule integrable_abs)
|
|
1625 |
hence "(\<lambda>x. Real (\<bar>f x\<bar>)) \<in> borel_measurable M"
|
|
1626 |
"positive_integral (\<lambda>x. Real \<bar>f x\<bar>) \<noteq> \<omega>" unfolding integrable_def by auto
|
|
1627 |
from positive_integral_0_iff[OF this(1)] this(2)
|
|
1628 |
show ?thesis unfolding integral_def *
|
|
1629 |
by (simp add: real_of_pinfreal_eq_0)
|
35582
|
1630 |
qed
|
|
1631 |
|
38656
|
1632 |
lemma LIMSEQ_max:
|
|
1633 |
"u ----> (x::real) \<Longrightarrow> (\<lambda>i. max (u i) 0) ----> max x 0"
|
|
1634 |
by (fastsimp intro!: LIMSEQ_I dest!: LIMSEQ_D)
|
|
1635 |
|
|
1636 |
lemma (in sigma_algebra) borel_measurable_LIMSEQ:
|
|
1637 |
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
|
|
1638 |
assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x"
|
|
1639 |
and u: "\<And>i. u i \<in> borel_measurable M"
|
|
1640 |
shows "u' \<in> borel_measurable M"
|
|
1641 |
proof -
|
|
1642 |
let "?pu x i" = "max (u i x) 0"
|
|
1643 |
let "?nu x i" = "max (- u i x) 0"
|
|
1644 |
|
|
1645 |
{ fix x assume x: "x \<in> space M"
|
|
1646 |
have "(?pu x) ----> max (u' x) 0"
|
|
1647 |
"(?nu x) ----> max (- u' x) 0"
|
|
1648 |
using u'[OF x] by (auto intro!: LIMSEQ_max LIMSEQ_minus)
|
|
1649 |
from LIMSEQ_imp_lim_INF[OF _ this(1)] LIMSEQ_imp_lim_INF[OF _ this(2)]
|
|
1650 |
have "(SUP n. INF m. Real (u (n + m) x)) = Real (u' x)"
|
|
1651 |
"(SUP n. INF m. Real (- u (n + m) x)) = Real (- u' x)"
|
|
1652 |
by (simp_all add: Real_max'[symmetric]) }
|
|
1653 |
note eq = this
|
|
1654 |
|
|
1655 |
have *: "\<And>x. real (Real (u' x)) - real (Real (- u' x)) = u' x"
|
|
1656 |
by auto
|
|
1657 |
|
|
1658 |
have "(SUP n. INF m. (\<lambda>x. Real (u (n + m) x))) \<in> borel_measurable M"
|
|
1659 |
"(SUP n. INF m. (\<lambda>x. Real (- u (n + m) x))) \<in> borel_measurable M"
|
|
1660 |
using u by (auto intro: borel_measurable_SUP borel_measurable_INF borel_measurable_Real)
|
|
1661 |
with eq[THEN measurable_cong, of M "\<lambda>x. x" borel_space]
|
|
1662 |
have "(\<lambda>x. Real (u' x)) \<in> borel_measurable M"
|
|
1663 |
"(\<lambda>x. Real (- u' x)) \<in> borel_measurable M"
|
|
1664 |
unfolding SUPR_fun_expand INFI_fun_expand by auto
|
|
1665 |
note this[THEN borel_measurable_real]
|
|
1666 |
from borel_measurable_diff[OF this]
|
|
1667 |
show ?thesis unfolding * .
|
|
1668 |
qed
|
|
1669 |
|
|
1670 |
lemma (in measure_space) integral_dominated_convergence:
|
|
1671 |
assumes u: "\<And>i. integrable (u i)" and bound: "\<And>x j. x\<in>space M \<Longrightarrow> \<bar>u j x\<bar> \<le> w x"
|
|
1672 |
and w: "integrable w" "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> w x"
|
|
1673 |
and u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) ----> u' x"
|
|
1674 |
shows "integrable u'"
|
|
1675 |
and "(\<lambda>i. integral (\<lambda>x. \<bar>u i x - u' x\<bar>)) ----> 0" (is "?lim_diff")
|
|
1676 |
and "(\<lambda>i. integral (u i)) ----> integral u'" (is ?lim)
|
36624
|
1677 |
proof -
|
38656
|
1678 |
{ fix x j assume x: "x \<in> space M"
|
|
1679 |
from u'[OF x] have "(\<lambda>i. \<bar>u i x\<bar>) ----> \<bar>u' x\<bar>" by (rule LIMSEQ_imp_rabs)
|
|
1680 |
from LIMSEQ_le_const2[OF this]
|
|
1681 |
have "\<bar>u' x\<bar> \<le> w x" using bound[OF x] by auto }
|
|
1682 |
note u'_bound = this
|
|
1683 |
|
|
1684 |
from u[unfolded integrable_def]
|
|
1685 |
have u'_borel: "u' \<in> borel_measurable M"
|
|
1686 |
using u' by (blast intro: borel_measurable_LIMSEQ[of u])
|
|
1687 |
|
|
1688 |
show "integrable u'"
|
|
1689 |
proof (rule integrable_bound)
|
|
1690 |
show "integrable w" by fact
|
|
1691 |
show "u' \<in> borel_measurable M" by fact
|
|
1692 |
next
|
|
1693 |
fix x assume x: "x \<in> space M"
|
|
1694 |
thus "0 \<le> w x" by fact
|
|
1695 |
show "\<bar>u' x\<bar> \<le> w x" using u'_bound[OF x] .
|
|
1696 |
qed
|
|
1697 |
|
|
1698 |
let "?diff n x" = "2 * w x - \<bar>u n x - u' x\<bar>"
|
|
1699 |
have diff: "\<And>n. integrable (\<lambda>x. \<bar>u n x - u' x\<bar>)"
|
|
1700 |
using w u `integrable u'`
|
|
1701 |
by (auto intro!: integral_add integral_diff integral_cmult integrable_abs)
|
|
1702 |
|
|
1703 |
{ fix j x assume x: "x \<in> space M"
|
|
1704 |
have "\<bar>u j x - u' x\<bar> \<le> \<bar>u j x\<bar> + \<bar>u' x\<bar>" by auto
|
|
1705 |
also have "\<dots> \<le> w x + w x"
|
|
1706 |
by (rule add_mono[OF bound[OF x] u'_bound[OF x]])
|
|
1707 |
finally have "\<bar>u j x - u' x\<bar> \<le> 2 * w x" by simp }
|
|
1708 |
note diff_less_2w = this
|
|
1709 |
|
|
1710 |
have PI_diff: "\<And>m n. positive_integral (\<lambda>x. Real (?diff (m + n) x)) =
|
|
1711 |
positive_integral (\<lambda>x. Real (2 * w x)) - positive_integral (\<lambda>x. Real \<bar>u (m + n) x - u' x\<bar>)"
|
|
1712 |
using diff w diff_less_2w
|
|
1713 |
by (subst positive_integral_diff[symmetric])
|
|
1714 |
(auto simp: integrable_def intro!: positive_integral_cong)
|
|
1715 |
|
|
1716 |
have "integrable (\<lambda>x. 2 * w x)"
|
|
1717 |
using w by (auto intro: integral_cmult)
|
|
1718 |
hence I2w_fin: "positive_integral (\<lambda>x. Real (2 * w x)) \<noteq> \<omega>" and
|
|
1719 |
borel_2w: "(\<lambda>x. Real (2 * w x)) \<in> borel_measurable M"
|
|
1720 |
unfolding integrable_def by auto
|
|
1721 |
|
|
1722 |
have "(INF n. SUP m. positive_integral (\<lambda>x. Real \<bar>u (m + n) x - u' x\<bar>)) = 0" (is "?lim_SUP = 0")
|
|
1723 |
proof cases
|
|
1724 |
assume eq_0: "positive_integral (\<lambda>x. Real (2 * w x)) = 0"
|
|
1725 |
have "\<And>i. positive_integral (\<lambda>x. Real \<bar>u i x - u' x\<bar>) \<le> positive_integral (\<lambda>x. Real (2 * w x))"
|
|
1726 |
proof (rule positive_integral_mono)
|
|
1727 |
fix i x assume "x \<in> space M" from diff_less_2w[OF this, of i]
|
|
1728 |
show "Real \<bar>u i x - u' x\<bar> \<le> Real (2 * w x)" by auto
|
|
1729 |
qed
|
|
1730 |
hence "\<And>i. positive_integral (\<lambda>x. Real \<bar>u i x - u' x\<bar>) = 0" using eq_0 by auto
|
|
1731 |
thus ?thesis by simp
|
|
1732 |
next
|
|
1733 |
assume neq_0: "positive_integral (\<lambda>x. Real (2 * w x)) \<noteq> 0"
|
|
1734 |
have "positive_integral (\<lambda>x. Real (2 * w x)) = positive_integral (SUP n. INF m. (\<lambda>x. Real (?diff (m + n) x)))"
|
|
1735 |
proof (rule positive_integral_cong, unfold SUPR_fun_expand INFI_fun_expand, subst add_commute)
|
|
1736 |
fix x assume x: "x \<in> space M"
|
|
1737 |
show "Real (2 * w x) = (SUP n. INF m. Real (?diff (n + m) x))"
|
|
1738 |
proof (rule LIMSEQ_imp_lim_INF[symmetric])
|
|
1739 |
fix j show "0 \<le> ?diff j x" using diff_less_2w[OF x, of j] by simp
|
|
1740 |
next
|
|
1741 |
have "(\<lambda>i. ?diff i x) ----> 2 * w x - \<bar>u' x - u' x\<bar>"
|
|
1742 |
using u'[OF x] by (safe intro!: LIMSEQ_diff LIMSEQ_const LIMSEQ_imp_rabs)
|
|
1743 |
thus "(\<lambda>i. ?diff i x) ----> 2 * w x" by simp
|
|
1744 |
qed
|
|
1745 |
qed
|
|
1746 |
also have "\<dots> \<le> (SUP n. INF m. positive_integral (\<lambda>x. Real (?diff (m + n) x)))"
|
|
1747 |
using u'_borel w u unfolding integrable_def
|
|
1748 |
by (auto intro!: positive_integral_lim_INF)
|
|
1749 |
also have "\<dots> = positive_integral (\<lambda>x. Real (2 * w x)) -
|
|
1750 |
(INF n. SUP m. positive_integral (\<lambda>x. Real \<bar>u (m + n) x - u' x\<bar>))"
|
|
1751 |
unfolding PI_diff pinfreal_INF_minus[OF I2w_fin] pinfreal_SUP_minus ..
|
|
1752 |
finally show ?thesis using neq_0 I2w_fin by (rule pinfreal_le_minus_imp_0)
|
|
1753 |
qed
|
|
1754 |
|
|
1755 |
have [simp]: "\<And>n m x. Real (- \<bar>u (m + n) x - u' x\<bar>) = 0" by auto
|
|
1756 |
|
|
1757 |
have [simp]: "\<And>n m. positive_integral (\<lambda>x. Real \<bar>u (m + n) x - u' x\<bar>) =
|
|
1758 |
Real (integral (\<lambda>x. \<bar>u (n + m) x - u' x\<bar>))"
|
|
1759 |
using diff by (subst add_commute) (simp add: integral_def integrable_def Real_real)
|
|
1760 |
|
|
1761 |
have "(SUP n. INF m. positive_integral (\<lambda>x. Real \<bar>u (m + n) x - u' x\<bar>)) \<le> ?lim_SUP"
|
|
1762 |
(is "?lim_INF \<le> _") by (subst (1 2) add_commute) (rule lim_INF_le_lim_SUP)
|
|
1763 |
hence "?lim_INF = Real 0" "?lim_SUP = Real 0" using `?lim_SUP = 0` by auto
|
|
1764 |
thus ?lim_diff using diff by (auto intro!: integral_positive lim_INF_eq_lim_SUP)
|
|
1765 |
|
|
1766 |
show ?lim
|
|
1767 |
proof (rule LIMSEQ_I)
|
|
1768 |
fix r :: real assume "0 < r"
|
|
1769 |
from LIMSEQ_D[OF `?lim_diff` this]
|
|
1770 |
obtain N where N: "\<And>n. N \<le> n \<Longrightarrow> integral (\<lambda>x. \<bar>u n x - u' x\<bar>) < r"
|
|
1771 |
using diff by (auto simp: integral_positive)
|
|
1772 |
|
|
1773 |
show "\<exists>N. \<forall>n\<ge>N. norm (integral (u n) - integral u') < r"
|
|
1774 |
proof (safe intro!: exI[of _ N])
|
|
1775 |
fix n assume "N \<le> n"
|
|
1776 |
have "\<bar>integral (u n) - integral u'\<bar> = \<bar>integral (\<lambda>x. u n x - u' x)\<bar>"
|
|
1777 |
using u `integrable u'` by (auto simp: integral_diff)
|
|
1778 |
also have "\<dots> \<le> integral (\<lambda>x. \<bar>u n x - u' x\<bar>)" using u `integrable u'`
|
|
1779 |
by (rule_tac integral_triangle_inequality) (auto intro!: integral_diff)
|
|
1780 |
also note N[OF `N \<le> n`]
|
|
1781 |
finally show "norm (integral (u n) - integral u') < r" by simp
|
|
1782 |
qed
|
|
1783 |
qed
|
|
1784 |
qed
|
|
1785 |
|
|
1786 |
lemma (in measure_space) integral_sums:
|
|
1787 |
assumes borel: "\<And>i. integrable (f i)"
|
|
1788 |
and summable: "\<And>x. x \<in> space M \<Longrightarrow> summable (\<lambda>i. \<bar>f i x\<bar>)"
|
|
1789 |
and sums: "summable (\<lambda>i. integral (\<lambda>x. \<bar>f i x\<bar>))"
|
|
1790 |
shows "integrable (\<lambda>x. (\<Sum>i. f i x))" (is "integrable ?S")
|
|
1791 |
and "(\<lambda>i. integral (f i)) sums integral (\<lambda>x. (\<Sum>i. f i x))" (is ?integral)
|
|
1792 |
proof -
|
|
1793 |
have "\<forall>x\<in>space M. \<exists>w. (\<lambda>i. \<bar>f i x\<bar>) sums w"
|
|
1794 |
using summable unfolding summable_def by auto
|
|
1795 |
from bchoice[OF this]
|
|
1796 |
obtain w where w: "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. \<bar>f i x\<bar>) sums w x" by auto
|
|
1797 |
|
|
1798 |
let "?w y" = "if y \<in> space M then w y else 0"
|
|
1799 |
|
|
1800 |
obtain x where abs_sum: "(\<lambda>i. integral (\<lambda>x. \<bar>f i x\<bar>)) sums x"
|
|
1801 |
using sums unfolding summable_def ..
|
|
1802 |
|
|
1803 |
have 1: "\<And>n. integrable (\<lambda>x. \<Sum>i = 0..<n. f i x)"
|
|
1804 |
using borel by (auto intro!: integral_setsum)
|
|
1805 |
|
|
1806 |
{ fix j x assume [simp]: "x \<in> space M"
|
|
1807 |
have "\<bar>\<Sum>i = 0..< j. f i x\<bar> \<le> (\<Sum>i = 0..< j. \<bar>f i x\<bar>)" by (rule setsum_abs)
|
|
1808 |
also have "\<dots> \<le> w x" using w[of x] series_pos_le[of "\<lambda>i. \<bar>f i x\<bar>"] unfolding sums_iff by auto
|
|
1809 |
finally have "\<bar>\<Sum>i = 0..<j. f i x\<bar> \<le> ?w x" by simp }
|
|
1810 |
note 2 = this
|
|
1811 |
|
|
1812 |
have 3: "integrable ?w"
|
|
1813 |
proof (rule integral_monotone_convergence(1))
|
|
1814 |
let "?F n y" = "(\<Sum>i = 0..<n. \<bar>f i y\<bar>)"
|
|
1815 |
let "?w' n y" = "if y \<in> space M then ?F n y else 0"
|
|
1816 |
have "\<And>n. integrable (?F n)"
|
|
1817 |
using borel by (auto intro!: integral_setsum integrable_abs)
|
|
1818 |
thus "\<And>n. integrable (?w' n)" by (simp cong: integrable_cong)
|
|
1819 |
show "mono ?w'"
|
|
1820 |
by (auto simp: mono_def le_fun_def intro!: setsum_mono2)
|
|
1821 |
{ fix x show "(\<lambda>n. ?w' n x) ----> ?w x"
|
|
1822 |
using w by (cases "x \<in> space M") (simp_all add: LIMSEQ_const sums_def) }
|
|
1823 |
have *: "\<And>n. integral (?w' n) = (\<Sum>i = 0..< n. integral (\<lambda>x. \<bar>f i x\<bar>))"
|
|
1824 |
using borel by (simp add: integral_setsum integrable_abs cong: integral_cong)
|
|
1825 |
from abs_sum
|
|
1826 |
show "(\<lambda>i. integral (?w' i)) ----> x" unfolding * sums_def .
|
|
1827 |
qed
|
|
1828 |
|
|
1829 |
have 4: "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> ?w x" using 2[of _ 0] by simp
|
|
1830 |
|
|
1831 |
from summable[THEN summable_rabs_cancel]
|
|
1832 |
have 5: "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>n. \<Sum>i = 0..<n. f i x) ----> (\<Sum>i. f i x)"
|
|
1833 |
by (auto intro: summable_sumr_LIMSEQ_suminf)
|
|
1834 |
|
|
1835 |
note int = integral_dominated_convergence(1,3)[OF 1 2 3 4 5]
|
|
1836 |
|
|
1837 |
from int show "integrable ?S" by simp
|
|
1838 |
|
|
1839 |
show ?integral unfolding sums_def integral_setsum(1)[symmetric, OF borel]
|
|
1840 |
using int(2) by simp
|
36624
|
1841 |
qed
|
|
1842 |
|
35748
|
1843 |
section "Lebesgue integration on countable spaces"
|
|
1844 |
|
38656
|
1845 |
lemma (in measure_space) integral_on_countable:
|
|
1846 |
assumes f: "f \<in> borel_measurable M"
|
35748
|
1847 |
and bij: "bij_betw enum S (f ` space M)"
|
|
1848 |
and enum_zero: "enum ` (-S) \<subseteq> {0}"
|
38656
|
1849 |
and fin: "\<And>x. x \<noteq> 0 \<Longrightarrow> \<mu> (f -` {x} \<inter> space M) \<noteq> \<omega>"
|
|
1850 |
and abs_summable: "summable (\<lambda>r. \<bar>enum r * real (\<mu> (f -` {enum r} \<inter> space M))\<bar>)"
|
35748
|
1851 |
shows "integrable f"
|
38656
|
1852 |
and "(\<lambda>r. enum r * real (\<mu> (f -` {enum r} \<inter> space M))) sums integral f" (is ?sums)
|
35748
|
1853 |
proof -
|
38656
|
1854 |
let "?A r" = "f -` {enum r} \<inter> space M"
|
|
1855 |
let "?F r x" = "enum r * indicator (?A r) x"
|
|
1856 |
have enum_eq: "\<And>r. enum r * real (\<mu> (?A r)) = integral (?F r)"
|
|
1857 |
using f fin by (simp add: borel_measurable_vimage integral_cmul_indicator)
|
35748
|
1858 |
|
38656
|
1859 |
{ fix x assume "x \<in> space M"
|
|
1860 |
hence "f x \<in> enum ` S" using bij unfolding bij_betw_def by auto
|
|
1861 |
then obtain i where "i\<in>S" "enum i = f x" by auto
|
|
1862 |
have F: "\<And>j. ?F j x = (if j = i then f x else 0)"
|
|
1863 |
proof cases
|
|
1864 |
fix j assume "j = i"
|
|
1865 |
thus "?thesis j" using `x \<in> space M` `enum i = f x` by (simp add: indicator_def)
|
|
1866 |
next
|
|
1867 |
fix j assume "j \<noteq> i"
|
|
1868 |
show "?thesis j" using bij `i \<in> S` `j \<noteq> i` `enum i = f x` enum_zero
|
|
1869 |
by (cases "j \<in> S") (auto simp add: indicator_def bij_betw_def inj_on_def)
|
|
1870 |
qed
|
|
1871 |
hence F_abs: "\<And>j. \<bar>if j = i then f x else 0\<bar> = (if j = i then \<bar>f x\<bar> else 0)" by auto
|
|
1872 |
have "(\<lambda>i. ?F i x) sums f x"
|
|
1873 |
"(\<lambda>i. \<bar>?F i x\<bar>) sums \<bar>f x\<bar>"
|
|
1874 |
by (auto intro!: sums_single simp: F F_abs) }
|
|
1875 |
note F_sums_f = this(1) and F_abs_sums_f = this(2)
|
35748
|
1876 |
|
38656
|
1877 |
have int_f: "integral f = integral (\<lambda>x. \<Sum>r. ?F r x)" "integrable f = integrable (\<lambda>x. \<Sum>r. ?F r x)"
|
|
1878 |
using F_sums_f by (auto intro!: integral_cong integrable_cong simp: sums_iff)
|
35748
|
1879 |
|
|
1880 |
{ fix r
|
38656
|
1881 |
have "integral (\<lambda>x. \<bar>?F r x\<bar>) = integral (\<lambda>x. \<bar>enum r\<bar> * indicator (?A r) x)"
|
|
1882 |
by (auto simp: indicator_def intro!: integral_cong)
|
|
1883 |
also have "\<dots> = \<bar>enum r\<bar> * real (\<mu> (?A r))"
|
|
1884 |
using f fin by (simp add: borel_measurable_vimage integral_cmul_indicator)
|
|
1885 |
finally have "integral (\<lambda>x. \<bar>?F r x\<bar>) = \<bar>enum r * real (\<mu> (?A r))\<bar>"
|
|
1886 |
by (simp add: abs_mult_pos real_pinfreal_pos) }
|
|
1887 |
note int_abs_F = this
|
35748
|
1888 |
|
38656
|
1889 |
have 1: "\<And>i. integrable (\<lambda>x. ?F i x)"
|
|
1890 |
using f fin by (simp add: borel_measurable_vimage integral_cmul_indicator)
|
|
1891 |
|
|
1892 |
have 2: "\<And>x. x \<in> space M \<Longrightarrow> summable (\<lambda>i. \<bar>?F i x\<bar>)"
|
|
1893 |
using F_abs_sums_f unfolding sums_iff by auto
|
|
1894 |
|
|
1895 |
from integral_sums(2)[OF 1 2, unfolded int_abs_F, OF _ abs_summable]
|
|
1896 |
show ?sums unfolding enum_eq int_f by simp
|
|
1897 |
|
|
1898 |
from integral_sums(1)[OF 1 2, unfolded int_abs_F, OF _ abs_summable]
|
|
1899 |
show "integrable f" unfolding int_f by simp
|
35748
|
1900 |
qed
|
|
1901 |
|
35692
|
1902 |
section "Lebesgue integration on finite space"
|
|
1903 |
|
38656
|
1904 |
lemma (in measure_space) integral_on_finite:
|
|
1905 |
assumes f: "f \<in> borel_measurable M" and finite: "finite (f`space M)"
|
|
1906 |
and fin: "\<And>x. x \<noteq> 0 \<Longrightarrow> \<mu> (f -` {x} \<inter> space M) \<noteq> \<omega>"
|
|
1907 |
shows "integrable f"
|
|
1908 |
and "integral (\<lambda>x. f x) =
|
|
1909 |
(\<Sum> r \<in> f`space M. r * real (\<mu> (f -` {r} \<inter> space M)))" (is "?integral")
|
35582
|
1910 |
proof -
|
38656
|
1911 |
let "?A r" = "f -` {r} \<inter> space M"
|
|
1912 |
let "?S x" = "\<Sum>r\<in>f`space M. r * indicator (?A r) x"
|
35582
|
1913 |
|
38656
|
1914 |
{ fix x assume "x \<in> space M"
|
|
1915 |
have "f x = (\<Sum>r\<in>f`space M. if x \<in> ?A r then r else 0)"
|
|
1916 |
using finite `x \<in> space M` by (simp add: setsum_cases)
|
|
1917 |
also have "\<dots> = ?S x"
|
|
1918 |
by (auto intro!: setsum_cong)
|
|
1919 |
finally have "f x = ?S x" . }
|
|
1920 |
note f_eq = this
|
|
1921 |
|
|
1922 |
have f_eq_S: "integrable f \<longleftrightarrow> integrable ?S" "integral f = integral ?S"
|
|
1923 |
by (auto intro!: integrable_cong integral_cong simp only: f_eq)
|
|
1924 |
|
|
1925 |
show "integrable f" ?integral using fin f f_eq_S
|
|
1926 |
by (simp_all add: integral_cmul_indicator borel_measurable_vimage)
|
35582
|
1927 |
qed
|
|
1928 |
|
35977
|
1929 |
lemma sigma_algebra_cong:
|
|
1930 |
fixes M :: "('a, 'b) algebra_scheme" and M' :: "('a, 'c) algebra_scheme"
|
|
1931 |
assumes *: "sigma_algebra M"
|
|
1932 |
and cong: "space M = space M'" "sets M = sets M'"
|
|
1933 |
shows "sigma_algebra M'"
|
|
1934 |
using * unfolding sigma_algebra_def algebra_def sigma_algebra_axioms_def unfolding cong .
|
|
1935 |
|
|
1936 |
lemma finite_Pow_additivity_sufficient:
|
|
1937 |
assumes "finite (space M)" and "sets M = Pow (space M)"
|
38656
|
1938 |
and "positive \<mu>" and "additive M \<mu>"
|
|
1939 |
and "\<And>x. x \<in> space M \<Longrightarrow> \<mu> {x} \<noteq> \<omega>"
|
|
1940 |
shows "finite_measure_space M \<mu>"
|
35977
|
1941 |
proof -
|
|
1942 |
have "sigma_algebra M"
|
|
1943 |
using assms by (auto intro!: sigma_algebra_cong[OF sigma_algebra_Pow])
|
|
1944 |
|
38656
|
1945 |
have "measure_space M \<mu>"
|
|
1946 |
by (rule sigma_algebra.finite_additivity_sufficient) (fact+)
|
35977
|
1947 |
thus ?thesis
|
|
1948 |
unfolding finite_measure_space_def finite_measure_space_axioms_def
|
|
1949 |
using assms by simp
|
|
1950 |
qed
|
|
1951 |
|
|
1952 |
lemma finite_measure_spaceI:
|
38656
|
1953 |
assumes "measure_space M \<mu>" and "finite (space M)" and "sets M = Pow (space M)"
|
|
1954 |
and "\<And>x. x \<in> space M \<Longrightarrow> \<mu> {x} \<noteq> \<omega>"
|
|
1955 |
shows "finite_measure_space M \<mu>"
|
35977
|
1956 |
unfolding finite_measure_space_def finite_measure_space_axioms_def
|
|
1957 |
using assms by simp
|
|
1958 |
|
38705
|
1959 |
lemma (in finite_measure_space) borel_measurable_finite[intro, simp]: "f \<in> borel_measurable M"
|
38656
|
1960 |
unfolding measurable_def sets_eq_Pow by auto
|
|
1961 |
|
38705
|
1962 |
lemma (in finite_measure_space) simple_function_finite: "simple_function f"
|
|
1963 |
unfolding simple_function_def sets_eq_Pow using finite_space by auto
|
|
1964 |
|
|
1965 |
lemma (in finite_measure_space) positive_integral_finite_eq_setsum:
|
|
1966 |
"positive_integral f = (\<Sum>x \<in> space M. f x * \<mu> {x})"
|
|
1967 |
proof -
|
|
1968 |
have *: "positive_integral f = positive_integral (\<lambda>x. \<Sum>y\<in>space M. f y * indicator {y} x)"
|
|
1969 |
by (auto intro!: positive_integral_cong simp add: indicator_def if_distrib setsum_cases[OF finite_space])
|
|
1970 |
show ?thesis unfolding * using borel_measurable_finite[of f]
|
|
1971 |
by (simp add: positive_integral_setsum positive_integral_cmult_indicator sets_eq_Pow)
|
|
1972 |
qed
|
|
1973 |
|
35977
|
1974 |
lemma (in finite_measure_space) integral_finite_singleton:
|
38656
|
1975 |
shows "integrable f"
|
|
1976 |
and "integral f = (\<Sum>x \<in> space M. f x * real (\<mu> {x}))" (is ?I)
|
35977
|
1977 |
proof -
|
38705
|
1978 |
have [simp]:
|
|
1979 |
"positive_integral (\<lambda>x. Real (f x)) = (\<Sum>x \<in> space M. Real (f x) * \<mu> {x})"
|
|
1980 |
"positive_integral (\<lambda>x. Real (- f x)) = (\<Sum>x \<in> space M. Real (- f x) * \<mu> {x})"
|
|
1981 |
unfolding positive_integral_finite_eq_setsum by auto
|
38656
|
1982 |
|
38705
|
1983 |
show "integrable f" using finite_space finite_measure
|
|
1984 |
by (simp add: setsum_\<omega> integrable_def sets_eq_Pow)
|
38656
|
1985 |
|
38705
|
1986 |
show ?I using finite_measure
|
|
1987 |
apply (simp add: integral_def sets_eq_Pow real_of_pinfreal_setsum[symmetric]
|
|
1988 |
real_of_pinfreal_mult[symmetric] setsum_subtractf[symmetric])
|
|
1989 |
by (rule setsum_cong) (simp_all split: split_if)
|
35977
|
1990 |
qed
|
|
1991 |
|
35748
|
1992 |
end
|